• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java VirtualDeviceBackingInfo类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中com.vmware.vim25.VirtualDeviceBackingInfo的典型用法代码示例。如果您正苦于以下问题:Java VirtualDeviceBackingInfo类的具体用法?Java VirtualDeviceBackingInfo怎么用?Java VirtualDeviceBackingInfo使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



VirtualDeviceBackingInfo类属于com.vmware.vim25包,在下文中一共展示了VirtualDeviceBackingInfo类的19个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: updateDiskStateFromVirtualDevice

import com.vmware.vim25.VirtualDeviceBackingInfo; //导入依赖的package包/类
/**
 * Capture virtual cdrom attributes in the disk state for reference.
 */
public static void updateDiskStateFromVirtualDevice(VirtualDevice vd, DiskService.DiskState
        disk, VirtualDeviceBackingInfo backing) {
    fillInControllerUnitNumber(disk, vd.getUnitNumber());
    if (backing != null && backing instanceof VirtualDeviceFileBackingInfo) {
        disk.sourceImageReference = VimUtils
                .datastorePathToUri(((VirtualDeviceFileBackingInfo) backing).getFileName());
    }
    disk.status = DiskService.DiskStatus.ATTACHED;
    CustomProperties.of(disk)
            .put(PROVIDER_DISK_UNIQUE_ID, vd.getDeviceInfo().getLabel());
    if (vd.getConnectable() != null) {
        CustomProperties.of(disk)
                .put(DEVICE_CONNECTED, vd.getConnectable().isConnected())
                .put(DEVICE_STATUS, vd.getConnectable().getStatus());
    }
}
 
开发者ID:vmware,项目名称:photon-model,代码行数:20,代码来源:ClientUtils.java


示例2: testGetDvsPortBackingInfoWithUUID

import com.vmware.vim25.VirtualDeviceBackingInfo; //导入依赖的package包/类
@Test
public void testGetDvsPortBackingInfoWithUUID() {
    this.subnet = new SubnetState();
    this.subnet.customProperties = new HashMap<>();
    this.subnet.customProperties.put(DvsProperties.DVS_UUID, UUID.randomUUID().toString());
    this.subnet.customProperties.put(DvsProperties.PORT_GROUP_KEY, UUID.randomUUID().toString());

    VirtualDeviceBackingInfo deviceBackingInfo = NetworkDeviceBackingFactory
            .getNetworkDeviceBackingInfo(this.subnet);

    assertTrue(deviceBackingInfo instanceof
            VirtualEthernetCardDistributedVirtualPortBackingInfo);

    VirtualEthernetCardDistributedVirtualPortBackingInfo distributedVirtualPortBackingInfo =
            (VirtualEthernetCardDistributedVirtualPortBackingInfo) deviceBackingInfo;

    DistributedVirtualSwitchPortConnection port = distributedVirtualPortBackingInfo.getPort();

    assertNotNull(port);

    assertEquals(this.subnet.customProperties.get(DvsProperties.DVS_UUID),
            port.getSwitchUuid());
    assertEquals(this.subnet.customProperties.get(DvsProperties.PORT_GROUP_KEY),
            port.getPortgroupKey());
}
 
开发者ID:vmware,项目名称:photon-model,代码行数:26,代码来源:NetworkDeviceBackingFactoryTest.java


示例3: testGetOpaqueNetworkBackingInfo

import com.vmware.vim25.VirtualDeviceBackingInfo; //导入依赖的package包/类
@Test
public void testGetOpaqueNetworkBackingInfo() {
    this.subnet = new SubnetState();
    this.subnet.customProperties = new HashMap<>();
    this.subnet.customProperties.put(NsxProperties.OPAQUE_NET_ID, UUID.randomUUID().toString());
    this.subnet.customProperties.put(NsxProperties.OPAQUE_NET_TYPE, UUID.randomUUID().toString());

    VirtualDeviceBackingInfo deviceBackingInfo = NetworkDeviceBackingFactory
            .getNetworkDeviceBackingInfo(this.subnet);

    assertTrue(deviceBackingInfo instanceof VirtualEthernetCardOpaqueNetworkBackingInfo);

    VirtualEthernetCardOpaqueNetworkBackingInfo opaqueNetworkBackingInfo =
            (VirtualEthernetCardOpaqueNetworkBackingInfo) deviceBackingInfo;

    assertEquals(this.subnet.customProperties.get(NsxProperties.OPAQUE_NET_ID),
            opaqueNetworkBackingInfo.getOpaqueNetworkId());
    assertEquals(this.subnet.customProperties.get(NsxProperties.OPAQUE_NET_TYPE),
            opaqueNetworkBackingInfo.getOpaqueNetworkType());
}
 
开发者ID:vmware,项目名称:photon-model,代码行数:21,代码来源:NetworkDeviceBackingFactoryTest.java


示例4: testStandardNetworkBackingInfo

import com.vmware.vim25.VirtualDeviceBackingInfo; //导入依赖的package包/类
@Test
public void testStandardNetworkBackingInfo() {
    this.subnet = new SubnetState();
    this.subnet.name = UUID.randomUUID().toString();
    this.subnet.customProperties = new HashMap<>();
    this.subnet.customProperties.put(CustomProperties.TYPE, VimNames.TYPE_NETWORK);

    VirtualDeviceBackingInfo deviceBackingInfo = NetworkDeviceBackingFactory
            .getNetworkDeviceBackingInfo(this.subnet);

    assertTrue(deviceBackingInfo instanceof VirtualEthernetCardNetworkBackingInfo);

    VirtualEthernetCardNetworkBackingInfo virtualEthernetCardNetworkBackingInfo =
            (VirtualEthernetCardNetworkBackingInfo) deviceBackingInfo;

    assertEquals(this.subnet.name, virtualEthernetCardNetworkBackingInfo.getDeviceName());
}
 
开发者ID:vmware,项目名称:photon-model,代码行数:18,代码来源:NetworkDeviceBackingFactoryTest.java


示例5: testNetworkStateBackingInfo

import com.vmware.vim25.VirtualDeviceBackingInfo; //导入依赖的package包/类
@Test
public void testNetworkStateBackingInfo() {
    this.network = new NetworkState();
    this.network.name = UUID.randomUUID().toString();
    this.network.customProperties = new HashMap<>();

    VirtualDeviceBackingInfo deviceBackingInfo = NetworkDeviceBackingFactory
            .getNetworkDeviceBackingInfo(this.network);

    assertTrue(deviceBackingInfo instanceof VirtualEthernetCardNetworkBackingInfo);

    VirtualEthernetCardNetworkBackingInfo virtualEthernetCardNetworkBackingInfo =
            (VirtualEthernetCardNetworkBackingInfo) deviceBackingInfo;

    assertEquals(this.network.name, virtualEthernetCardNetworkBackingInfo.getDeviceName());
}
 
开发者ID:vmware,项目名称:photon-model,代码行数:17,代码来源:NetworkDeviceBackingFactoryTest.java


示例6: getDeviceByBackingFileName

import com.vmware.vim25.VirtualDeviceBackingInfo; //导入依赖的package包/类
public VirtualDevice getDeviceByBackingFileName(String name)
{
  if(name==null)
  {
    throw new IllegalArgumentException("name must not be null!");
  }
    
  VirtualDevice[] devices = this.getAllVirtualDevices(); 

  for(VirtualDevice device : devices)
  {
    VirtualDeviceBackingInfo bi = device.getBacking();
    if(bi instanceof VirtualDeviceFileBackingInfo)
    {
      String fileName = ((VirtualDeviceFileBackingInfo)bi).getFileName();
      if(name.equals(fileName))
        return device;
    }
   }
   return null;
}
 
开发者ID:Juniper,项目名称:vijava,代码行数:22,代码来源:VirtualMachineDeviceManager.java


示例7: getDiskCurrentTopBackingFileInChain

import com.vmware.vim25.VirtualDeviceBackingInfo; //导入依赖的package包/类
public String getDiskCurrentTopBackingFileInChain(String deviceBusName) throws Exception {
    List<VirtualDevice> devices = _context.getVimClient().getDynamicProperty(_mor, "config.hardware.device");
    if (devices != null && devices.size() > 0) {
        for (VirtualDevice device : devices) {
            if (device instanceof VirtualDisk) {
                s_logger.info("Test against disk device, controller key: " + device.getControllerKey() + ", unit number: " + device.getUnitNumber());

                VirtualDeviceBackingInfo backingInfo = ((VirtualDisk)device).getBacking();
                if (backingInfo instanceof VirtualDiskFlatVer2BackingInfo) {
                    VirtualDiskFlatVer2BackingInfo diskBackingInfo = (VirtualDiskFlatVer2BackingInfo)backingInfo;

                    String deviceNumbering = getDeviceBusName(devices, device);
                    if (deviceNumbering.equals(deviceBusName))
                        return diskBackingInfo.getFileName();
                }
            }
        }
    }

    return null;
}
 
开发者ID:apache,项目名称:cloudstack,代码行数:22,代码来源:VirtualMachineMO.java


示例8: getDiskInfoBuilder

import com.vmware.vim25.VirtualDeviceBackingInfo; //导入依赖的package包/类
public VirtualMachineDiskInfoBuilder getDiskInfoBuilder() throws Exception {
    VirtualMachineDiskInfoBuilder builder = new VirtualMachineDiskInfoBuilder();

    List<VirtualDevice> devices = _context.getVimClient().getDynamicProperty(_mor, "config.hardware.device");

    if (devices != null && devices.size() > 0) {
        for (VirtualDevice device : devices) {
            if (device instanceof VirtualDisk) {
                VirtualDeviceBackingInfo backingInfo = ((VirtualDisk)device).getBacking();
                if (backingInfo instanceof VirtualDiskFlatVer2BackingInfo) {
                    VirtualDiskFlatVer2BackingInfo diskBackingInfo = (VirtualDiskFlatVer2BackingInfo)backingInfo;

                    while (diskBackingInfo != null) {
                        String deviceBusName = getDeviceBusName(devices, device);
                        builder.addDisk(deviceBusName, diskBackingInfo.getFileName());
                        diskBackingInfo = diskBackingInfo.getParent();
                    }
                }
            }
        }
    }

    return builder;
}
 
开发者ID:apache,项目名称:cloudstack,代码行数:25,代码来源:VirtualMachineMO.java


示例9: getAllDiskDatastores

import com.vmware.vim25.VirtualDeviceBackingInfo; //导入依赖的package包/类
public List<Pair<Integer, ManagedObjectReference>> getAllDiskDatastores() throws Exception {
    List<Pair<Integer, ManagedObjectReference>> disks = new ArrayList<Pair<Integer, ManagedObjectReference>>();

    List<VirtualDevice> devices = _context.getVimClient().getDynamicProperty(_mor, "config.hardware.device");
    if (devices != null && devices.size() > 0) {
        for (VirtualDevice device : devices) {
            if (device instanceof VirtualDisk) {
                VirtualDeviceBackingInfo backingInfo = ((VirtualDisk)device).getBacking();
                if (backingInfo instanceof VirtualDiskFlatVer2BackingInfo) {
                    VirtualDiskFlatVer2BackingInfo diskBackingInfo = (VirtualDiskFlatVer2BackingInfo)backingInfo;
                    disks.add(new Pair<Integer, ManagedObjectReference>(new Integer(device.getKey()), diskBackingInfo.getDatastore()));
                }
            }
        }
    }

    return disks;
}
 
开发者ID:apache,项目名称:cloudstack,代码行数:19,代码来源:VirtualMachineMO.java


示例10: getDiskInfoBuilder

import com.vmware.vim25.VirtualDeviceBackingInfo; //导入依赖的package包/类
public static VirtualMachineDiskInfoBuilder getDiskInfoBuilder(List<VirtualDevice> devices) throws Exception {
    VirtualMachineDiskInfoBuilder builder = new VirtualMachineDiskInfoBuilder();

    if (devices != null) {
        for (VirtualDevice device : devices) {
            if (device instanceof VirtualDisk) {
                VirtualDisk virtualDisk = (VirtualDisk)device;
                VirtualDeviceBackingInfo backingInfo = virtualDisk.getBacking();

                if (backingInfo instanceof VirtualDiskFlatVer2BackingInfo) {
                    VirtualDiskFlatVer2BackingInfo diskBackingInfo = (VirtualDiskFlatVer2BackingInfo)backingInfo;

                    String deviceBusName = VMwareUtil.getDeviceBusName(devices, virtualDisk);

                    while (diskBackingInfo != null) {
                        builder.addDisk(deviceBusName, diskBackingInfo.getFileName());

                        diskBackingInfo = diskBackingInfo.getParent();
                    }
                }
            }
        }
    }

    return builder;
}
 
开发者ID:apache,项目名称:cloudstack,代码行数:27,代码来源:VMwareUtil.java


示例11: getNetworkDeviceBackingInfo

import com.vmware.vim25.VirtualDeviceBackingInfo; //导入依赖的package包/类
/**
 * Get network device's {@link VirtualDeviceBackingInfo} based on the information available
 * on resource level. The type of custom properties present on a resource decides the type of
 * device backing.
 *
 * @param resource      A {@link ResourceState} of type {@link SubnetState} or {@link NetworkState}
 *
 * @param queryConfigTargetRequest  A {@link QueryConfigTargetRequest} object so to get
 *                                  config target when needed
 *
 * @return              {@link VirtualDeviceBackingInfo}
 */
public static VirtualDeviceBackingInfo getNetworkDeviceBackingInfo(ResourceState resource,
        QueryConfigTargetRequest queryConfigTargetRequest) {

    if (resource == null) {
        return null;
    }

    CustomProperties props = CustomProperties.of(resource);

    if (props.getString(DvsProperties.DVS_UUID) != null ||
            props.getString(DvsProperties.PORT_GROUP_KEY) != null) {
        // an isolated network created by vSphere adapter or nsx adapter will set this property
        // NSX-V can only set PORT_GROUP_KEY as DVS_UUID is not available
        return getDistributedPortBackingInfo(props, queryConfigTargetRequest);
    } else if (props.getString(NsxProperties.OPAQUE_NET_ID) != null) {
        // An opaque network
        // NSX-T will set OpaqueId to subnet's id
        return getOpaqueNetworkBackingInfo(props);
    } else if (props.getString(CustomProperties.TYPE) != null &&
            props.getString(CustomProperties.TYPE).equals(VimNames.TYPE_NETWORK)) {
        // The default case when we want to connect to existing network
        return getStandardNetworkBackingInfo(resource.name);
    } else if (resource instanceof NetworkState) {
        // satisfying an existing code path from InstanceClient.
        // Do we really need it?
        return getStandardNetworkBackingInfo(resource.name);
    }

    return null;
}
 
开发者ID:vmware,项目名称:photon-model,代码行数:43,代码来源:NetworkDeviceBackingFactory.java


示例12: createNic

import com.vmware.vim25.VirtualDeviceBackingInfo; //导入依赖的package包/类
private VirtualEthernetCard createNic(NetworkInterfaceStateWithDetails nicWithDetails,
        Integer controllerKey)
        throws FinderException, InvalidPropertyFaultMsg, RuntimeFaultFaultMsg {
    VirtualEthernetCard nic = new VirtualE1000();
    nic.setAddressType(VirtualEthernetCardMacType.GENERATED.value());
    nic.setKey(-1);
    nic.setControllerKey(controllerKey);

    // Currently the network backing information is stored in both places subnet and network
    // If it were to exist at one state object, then it would reduce complexity further.
    // Question: Is it acceptable for querying subnet first and network later? Or the order
    // should be reversed?

    QueryConfigTargetRequest queryConfigTargetRequest = new
            QueryConfigTargetRequest(this.get, getVimPort(), this.ctx.computeMoRef);

    VirtualDeviceBackingInfo deviceBackingInfo = NetworkDeviceBackingFactory
            .getNetworkDeviceBackingInfo(nicWithDetails.subnet, queryConfigTargetRequest);

    if (deviceBackingInfo == null) {
        deviceBackingInfo = NetworkDeviceBackingFactory
                .getNetworkDeviceBackingInfo(nicWithDetails.network, queryConfigTargetRequest);
    }

    nic.setBacking(deviceBackingInfo);

    return nic;
}
 
开发者ID:vmware,项目名称:photon-model,代码行数:29,代码来源:InstanceClient.java


示例13: testGetDvsPortBackingInfoWithPortGroupKey

import com.vmware.vim25.VirtualDeviceBackingInfo; //导入依赖的package包/类
/**
 * NSX-V test case when only port group key is present
 *
 * Exception as
 */
@Test(expected = IllegalArgumentException.class)
public void testGetDvsPortBackingInfoWithPortGroupKey() {
    this.subnet = new SubnetState();
    this.subnet.customProperties = new HashMap<>();

    List<String> portGroupIds = new ArrayList<>();
    portGroupIds.add(UUID.randomUUID().toString());
    portGroupIds.add(UUID.randomUUID().toString());

    this.subnet.customProperties.put(DvsProperties.PORT_GROUP_KEY, Utils.toJson(portGroupIds));

    // will throw NPE here as the querytargetrequest is null
    VirtualDeviceBackingInfo deviceBackingInfo = NetworkDeviceBackingFactory
            .getNetworkDeviceBackingInfo(this.subnet);

    assertTrue(deviceBackingInfo instanceof
            VirtualEthernetCardDistributedVirtualPortBackingInfo);

    VirtualEthernetCardDistributedVirtualPortBackingInfo distributedVirtualPortBackingInfo =
            (VirtualEthernetCardDistributedVirtualPortBackingInfo) deviceBackingInfo;

    DistributedVirtualSwitchPortConnection port = distributedVirtualPortBackingInfo.getPort();

    assertNotNull(port);

    // TODO: mock get DVS switch call to vSphere and match the result
    // for now we are just using the expected exception as without UUID the backing info
    // cannot be set.
    assertNull(port.getSwitchUuid());

    assertEquals(this.subnet.customProperties.get(DvsProperties.PORT_GROUP_KEY),
            port.getPortgroupKey());
}
 
开发者ID:vmware,项目名称:photon-model,代码行数:39,代码来源:NetworkDeviceBackingFactoryTest.java


示例14: getVirtualMachineMacAddress

import com.vmware.vim25.VirtualDeviceBackingInfo; //导入依赖的package包/类
protected static String getVirtualMachineMacAddress(
        VirtualMachineConfigInfo vmConfigInfo,
        DistributedVirtualPortgroup portGroup) {
    VirtualDevice devices[] = vmConfigInfo.getHardware().getDevice();
    for (VirtualDevice device : devices) {
        // Assuming only one interface
        if (device instanceof VirtualEthernetCard) {
            VirtualDeviceBackingInfo backingInfo =
                    device.getBacking();

            if (backingInfo == null)
                continue;

            // Is it backed by the distributed virtual port group?
            if (backingInfo instanceof
                VirtualEthernetCardDistributedVirtualPortBackingInfo) {
                VirtualEthernetCardDistributedVirtualPortBackingInfo
                dvpBackingInfo =
                (VirtualEthernetCardDistributedVirtualPortBackingInfo)
                backingInfo;
                if ((dvpBackingInfo.getPort() == null) ||
                    (dvpBackingInfo.getPort().getPortgroupKey() == null))
                    continue;

                if (dvpBackingInfo.getPort().getPortgroupKey().
                        equals(portGroup.getKey())) {
                    String vmMac = ((VirtualEthernetCard) device).
                            getMacAddress();
                    return vmMac;
                }
            }
        }
    }
    s_logger.error("dvPg: " + portGroup.getName() + " vmConfig: " +
            vmConfigInfo + " MAC Address NOT found");
    return null;
}
 
开发者ID:Juniper,项目名称:contrail-vcenter-plugin,代码行数:38,代码来源:VCenterDB.java


示例15: getVmdkFileBaseName

import com.vmware.vim25.VirtualDeviceBackingInfo; //导入依赖的package包/类
public String getVmdkFileBaseName(VirtualDisk disk) throws Exception {
    String vmdkFileBaseName = null;
    VirtualDeviceBackingInfo backingInfo = disk.getBacking();
    if(backingInfo instanceof VirtualDiskFlatVer2BackingInfo) {
        VirtualDiskFlatVer2BackingInfo diskBackingInfo = (VirtualDiskFlatVer2BackingInfo)backingInfo;
        DatastoreFile dsBackingFile = new DatastoreFile(diskBackingInfo.getFileName());
        vmdkFileBaseName = dsBackingFile.getFileBaseName();
    }
    return vmdkFileBaseName;
}
 
开发者ID:apache,项目名称:cloudstack,代码行数:11,代码来源:VirtualMachineMO.java


示例16: getIndependentVirtualDiskKeys

import com.vmware.vim25.VirtualDeviceBackingInfo; //导入依赖的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


示例17: getDiskDeviceDatastore

import com.vmware.vim25.VirtualDeviceBackingInfo; //导入依赖的package包/类
public static ManagedObjectReference getDiskDeviceDatastore(VirtualDisk diskDevice) throws Exception {
    VirtualDeviceBackingInfo backingInfo = diskDevice.getBacking();
    assert (backingInfo instanceof VirtualDiskFlatVer2BackingInfo);
    return ((VirtualDiskFlatVer2BackingInfo)backingInfo).getDatastore();
}
 
开发者ID:apache,项目名称:cloudstack,代码行数:6,代码来源:VmwareHelper.java


示例18: getAbsoluteVmdkFile

import com.vmware.vim25.VirtualDeviceBackingInfo; //导入依赖的package包/类
public String getAbsoluteVmdkFile(VirtualDisk disk) {
    String vmdkAbsFile = null;
    VirtualDeviceBackingInfo backingInfo = disk.getBacking();
    if (backingInfo instanceof VirtualDiskFlatVer2BackingInfo) {
        VirtualDiskFlatVer2BackingInfo diskBackingInfo = (VirtualDiskFlatVer2BackingInfo)backingInfo;
        vmdkAbsFile = diskBackingInfo.getFileName();
    }
    return vmdkAbsFile;
}
 
开发者ID:apache,项目名称:cloudstack,代码行数:10,代码来源:VmwareResource.java


示例19: getIndependentVirtualDiskKeys

import com.vmware.vim25.VirtualDeviceBackingInfo; //导入依赖的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.VirtualDeviceBackingInfo类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java NodeMain类代码示例发布时间:2022-05-22
下一篇:
Java AccountPasswordMustChangeException类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap