本文整理汇总了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;
}
示例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.");
}
示例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;
}
示例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);
}