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(); }
public HostDiskDimensionsChs queryVirtualDiskGeometry(String name, ManagedObjectReference morDc) throws Exception { return _context.getService().queryVirtualDiskGeometry(_mor, name, morDc); }
HostDiskDimensionsChs queryVirtualDiskGeometry(String name, Datacenter datacenter) throws FileFault, RuntimeFault, RemoteException;