本文整理汇总了Java中com.vmware.vim25.VirtualDiskRawDiskMappingVer1BackingInfo类的典型用法代码示例。如果您正苦于以下问题:Java VirtualDiskRawDiskMappingVer1BackingInfo类的具体用法?Java VirtualDiskRawDiskMappingVer1BackingInfo怎么用?Java VirtualDiskRawDiskMappingVer1BackingInfo使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
VirtualDiskRawDiskMappingVer1BackingInfo类属于com.vmware.vim25包,在下文中一共展示了VirtualDiskRawDiskMappingVer1BackingInfo类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getAllIndependentDiskDevice
import com.vmware.vim25.VirtualDiskRawDiskMappingVer1BackingInfo; //导入依赖的package包/类
public VirtualDisk[] getAllIndependentDiskDevice() throws Exception {
List<VirtualDisk> independentDisks = new ArrayList<VirtualDisk>();
VirtualDisk[] allDisks = getAllDiskDevice();
if (allDisks.length > 0) {
for (VirtualDisk disk : allDisks) {
String diskMode = "";
if (disk.getBacking() instanceof VirtualDiskFlatVer1BackingInfo) {
diskMode = ((VirtualDiskFlatVer1BackingInfo)disk.getBacking()).getDiskMode();
} else if (disk.getBacking() instanceof VirtualDiskFlatVer2BackingInfo) {
diskMode = ((VirtualDiskFlatVer2BackingInfo)disk.getBacking()).getDiskMode();
} else if (disk.getBacking() instanceof VirtualDiskRawDiskMappingVer1BackingInfo) {
diskMode = ((VirtualDiskRawDiskMappingVer1BackingInfo)disk.getBacking()).getDiskMode();
} else if (disk.getBacking() instanceof VirtualDiskSparseVer1BackingInfo) {
diskMode = ((VirtualDiskSparseVer1BackingInfo)disk.getBacking()).getDiskMode();
} else if (disk.getBacking() instanceof VirtualDiskSparseVer2BackingInfo) {
diskMode = ((VirtualDiskSparseVer2BackingInfo)disk.getBacking()).getDiskMode();
}
if (diskMode.indexOf("independent") != -1) {
independentDisks.add(disk);
}
}
}
return independentDisks.toArray(new VirtualDisk[0]);
}
示例2: getIndependentVirtualDiskKeys
import com.vmware.vim25.VirtualDiskRawDiskMappingVer1BackingInfo; //导入依赖的package包/类
private static ArrayList<Integer> getIndependentVirtualDiskKeys(VirtualMachine vm) throws Exception {
ArrayList<Integer> diskKeys = Lists.newArrayList();
VirtualDevice[] devices = (VirtualDevice[]) vm.getPropertyByPath("config.hardware.device");
for (int i = 0; i < devices.length; i++) {
if (devices[i] instanceof VirtualDisk) {
VirtualDisk vDisk = (VirtualDisk) devices[i];
String diskMode = "";
VirtualDeviceBackingInfo vdbi = vDisk.getBacking();
if (vdbi instanceof VirtualDiskFlatVer1BackingInfo) {
diskMode = ((VirtualDiskFlatVer1BackingInfo) vdbi).getDiskMode();
} else if (vdbi instanceof VirtualDiskFlatVer2BackingInfo) {
diskMode = ((VirtualDiskFlatVer2BackingInfo) vdbi).getDiskMode();
} else if (vdbi instanceof VirtualDiskRawDiskMappingVer1BackingInfo) {
diskMode = ((VirtualDiskRawDiskMappingVer1BackingInfo) vdbi).getDiskMode();
} else if (vdbi instanceof VirtualDiskSparseVer1BackingInfo) {
diskMode = ((VirtualDiskSparseVer1BackingInfo) vdbi).getDiskMode();
} else if (vdbi instanceof VirtualDiskSparseVer2BackingInfo) {
diskMode = ((VirtualDiskSparseVer2BackingInfo) vdbi).getDiskMode();
}
if (diskMode.indexOf("independent") != -1) {
diskKeys.add(vDisk.getKey());
}
}
}
return diskKeys;
}
示例3: getIndependentVirtualDiskKeys
import com.vmware.vim25.VirtualDiskRawDiskMappingVer1BackingInfo; //导入依赖的package包/类
private static ArrayList<Integer> getIndependentVirtualDiskKeys(VirtualMachine vm) throws Exception {
ArrayList<Integer> _diskKeys = new ArrayList<Integer>();
VirtualDevice[] devices = (VirtualDevice[]) vm.getPropertyByPath("config.hardware.device");
for(int i=0; i<devices.length; i++) {
if(devices[i] instanceof VirtualDisk) {
VirtualDisk vDisk = (VirtualDisk) devices[i];
String diskMode = "";
VirtualDeviceBackingInfo vdbi = vDisk.getBacking();
if(vdbi instanceof VirtualDiskFlatVer1BackingInfo) {
diskMode = ((VirtualDiskFlatVer1BackingInfo) vdbi).getDiskMode();
} else if(vdbi instanceof VirtualDiskFlatVer2BackingInfo) {
diskMode = ((VirtualDiskFlatVer2BackingInfo)vdbi).getDiskMode();
} else if(vdbi instanceof VirtualDiskRawDiskMappingVer1BackingInfo) {
diskMode = ((VirtualDiskRawDiskMappingVer1BackingInfo)vdbi).getDiskMode();
} else if(vdbi instanceof VirtualDiskSparseVer1BackingInfo) {
diskMode = ((VirtualDiskSparseVer1BackingInfo)vdbi).getDiskMode();
} else if(vdbi instanceof VirtualDiskSparseVer2BackingInfo) {
diskMode = ((VirtualDiskSparseVer2BackingInfo)vdbi).getDiskMode();
}
if(diskMode.indexOf("independent") != -1) {
_diskKeys.add(vDisk.getKey());
}
}
}
return _diskKeys;
}