当前位置: 首页>>代码示例>>Java>>正文


Java VirtualDiskRawDiskMappingVer1BackingInfo类代码示例

本文整理汇总了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]);
}
 
开发者ID:apache,项目名称:cloudstack,代码行数:27,代码来源:VirtualMachineMO.java

示例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;
}
 
开发者ID:igreenfield,项目名称:jcloud-vsphere,代码行数:31,代码来源:MasterToVirtualMachineCloneSpec.java

示例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;
}
 
开发者ID:WhiteBearSolutions,项目名称:WBSAirback,代码行数:30,代码来源:HypervisorManagerVMware.java


注:本文中的com.vmware.vim25.VirtualDiskRawDiskMappingVer1BackingInfo类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。