本文整理汇总了Java中com.vmware.vim25.VirtualCdromIsoBackingInfo类的典型用法代码示例。如果您正苦于以下问题:Java VirtualCdromIsoBackingInfo类的具体用法?Java VirtualCdromIsoBackingInfo怎么用?Java VirtualCdromIsoBackingInfo使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
VirtualCdromIsoBackingInfo类属于com.vmware.vim25包,在下文中一共展示了VirtualCdromIsoBackingInfo类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: createAddCdConfigSpec
import com.vmware.vim25.VirtualCdromIsoBackingInfo; //导入依赖的package包/类
static VirtualDeviceConfigSpec createAddCdConfigSpec(VirtualMachine vm, String dsName, String isoName) throws Exception
{
VirtualDeviceConfigSpec cdSpec = new VirtualDeviceConfigSpec();
cdSpec.setOperation(VirtualDeviceConfigSpecOperation.add);
VirtualCdrom cdrom = new VirtualCdrom();
VirtualCdromIsoBackingInfo cdDeviceBacking = new VirtualCdromIsoBackingInfo();
DatastoreSummary ds = findDatastoreSummary(vm, dsName);
cdDeviceBacking.setDatastore(ds.getDatastore());
cdDeviceBacking.setFileName("[" + dsName +"] "+ vm.getName()
+ "/" + isoName + ".iso");
VirtualDevice vd = getIDEController(vm);
cdrom.setBacking(cdDeviceBacking);
cdrom.setControllerKey(vd.getKey());
cdrom.setUnitNumber(vd.getUnitNumber());
cdrom.setKey(-1);
cdSpec.setDevice(cdrom);
return cdSpec;
}
开发者ID:Juniper,项目名称:vijava,代码行数:23,代码来源:VmCdOp.java
示例2: getPopulatedCDSpecs
import com.vmware.vim25.VirtualCdromIsoBackingInfo; //导入依赖的package包/类
VirtualDeviceConfigSpec getPopulatedCDSpecs(String fileName, ManagedObjectReference dataStoreRef,
List<VirtualDevice> virtualDevicesList,
VirtualDeviceConfigSpecOperation operation,
Integer controllerKey, Integer unitNumber, Integer key,
String parameter, VmInputs vmInputs) {
VirtualDeviceConfigSpec cdSpecs = new VirtualDeviceConfigSpec();
if (Operation.ADD.toString().equalsIgnoreCase(parameter)) {
VirtualCdromIsoBackingInfo cdIsoBacking = new VirtualCdromIsoBackingInfo();
cdIsoBacking.setDatastore(dataStoreRef);
cdIsoBacking.setFileName(fileName + TEST_CD_ISO);
VirtualCdrom cdRom = new VirtualCdrom();
cdRom.setBacking(cdIsoBacking);
cdRom.setControllerKey(controllerKey);
cdRom.setUnitNumber(unitNumber);
cdRom.setKey(key);
return getCDSpec(cdSpecs, operation, cdRom);
} else {
VirtualCdrom cdRemove = findVirtualDevice(VirtualCdrom.class, virtualDevicesList, vmInputs);
if (cdRemove != null) {
return getCDSpec(cdSpecs, operation, cdRemove);
}
}
throw new RuntimeException("No optical device named: [" + vmInputs.getUpdateValue() + "] can be found.");
}
开发者ID:CloudSlang,项目名称:cs-actions,代码行数:28,代码来源:VmUtils.java
示例3: getIsoDevice
import com.vmware.vim25.VirtualCdromIsoBackingInfo; //导入依赖的package包/类
public VirtualDevice getIsoDevice(String filename) throws Exception {
List<VirtualDevice> devices = (List<VirtualDevice>)_context.getVimClient().
getDynamicProperty(_mor, "config.hardware.device");
if(devices != null && devices.size() > 0) {
for(VirtualDevice device : devices) {
if(device instanceof VirtualCdrom && device.getBacking() instanceof VirtualCdromIsoBackingInfo &&
((VirtualCdromIsoBackingInfo)device.getBacking()).getFileName().equals(filename)) {
return device;
}
}
}
return null;
}
开发者ID:apache,项目名称:cloudstack,代码行数:14,代码来源:VirtualMachineMO.java
示例4: insertCdrom
import com.vmware.vim25.VirtualCdromIsoBackingInfo; //导入依赖的package包/类
/**
* Changes to backing of the cdrom to an iso-backed one.
*
* @param cdrom
* @param imagePath
* path to iso on disk, sth. like "[datastore] /images/ubuntu-16.04-amd64.iso"
*/
public static void insertCdrom(VirtualCdrom cdrom, String imagePath) {
VirtualCdromIsoBackingInfo backing = new VirtualCdromIsoBackingInfo();
backing.setFileName(imagePath);
cdrom.setBacking(backing);
}
开发者ID:vmware,项目名称:photon-model,代码行数:14,代码来源:ClientUtils.java
注:本文中的com.vmware.vim25.VirtualCdromIsoBackingInfo类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论