Java 类com.vmware.vim25.HostDiskDimensionsChs 实例源码

项目:vijava    文件:QueryVirtualDisk.java   
public static void main(String[] args) throws Exception
{
  if(args.length != 3)
  {
    System.out.println("Usage: java QueryVirtualDisk " 
      + "<url> <username> <password>");
    return;
  }

  ServiceInstance si = new ServiceInstance(
    new URL(args[0]), args[1], args[2], true);

  VirtualDiskManager vdMgr = si.getVirtualDiskManager();
  if(vdMgr==null)
  {
    System.out.println("VirtualDiskManager not available.");
    si.getServerConnection().logout();
    return;
  }

  String vmdkPath = 
    "[storage1 (2)] sdk188_sec/sdk188_sec.vmdk";

  int fragPerfent = vdMgr.queryVirtualDiskFragmentation(
      vmdkPath, null);
  System.out.println("Defragmentation:" + fragPerfent + "%");

  String uuid = vdMgr.queryVirtualDiskUuid(vmdkPath, null);
  System.out.println("Disk UUID:" + uuid);

  HostDiskDimensionsChs hddc = vdMgr.queryVirtualDiskGeometry(
      vmdkPath, null);
  System.out.println("Cylinder:" + hddc.getCylinder());
  System.out.println("Head:" + hddc.getHead());
  System.out.println("Sector:" + hddc.getSector());

  si.getServerConnection().logout();
}
项目:cloudstack    文件:VirtualDiskManagerMO.java   
public HostDiskDimensionsChs queryVirtualDiskGeometry(String name, ManagedObjectReference morDc) throws Exception {
    return _context.getService().queryVirtualDiskGeometry(_mor, name, morDc);
}
项目:jcloud-vsphere    文件:VirtualDiskManagerApi.java   
HostDiskDimensionsChs queryVirtualDiskGeometry(String name, Datacenter datacenter) throws FileFault, RuntimeFault, RemoteException;