Search in sources :

Example 1 with VirtualCdromAtapiBackingInfo

use of com.vmware.vim25.VirtualCdromAtapiBackingInfo in project photon-model by vmware.

the class ClientUtils method createCdrom.

public static VirtualDeviceConfigSpec createCdrom(VirtualDevice ideController, int unitNumber) {
    VirtualCdrom cdrom = new VirtualCdrom();
    cdrom.setControllerKey(ideController.getKey());
    cdrom.setUnitNumber(unitNumber);
    VirtualDeviceConnectInfo info = new VirtualDeviceConnectInfo();
    info.setAllowGuestControl(true);
    info.setConnected(true);
    info.setStartConnected(true);
    cdrom.setConnectable(info);
    VirtualCdromAtapiBackingInfo backing = new VirtualCdromAtapiBackingInfo();
    backing.setDeviceName(String.format("cdrom-%d-%d", ideController.getKey(), unitNumber));
    backing.setUseAutoDetect(false);
    cdrom.setBacking(backing);
    VirtualDeviceConfigSpec spec = new VirtualDeviceConfigSpec();
    spec.setDevice(cdrom);
    spec.setOperation(VirtualDeviceConfigSpecOperation.ADD);
    return spec;
}
Also used : VirtualDeviceConfigSpec(com.vmware.vim25.VirtualDeviceConfigSpec) VirtualCdrom(com.vmware.vim25.VirtualCdrom) VirtualCdromAtapiBackingInfo(com.vmware.vim25.VirtualCdromAtapiBackingInfo) VirtualDeviceConnectInfo(com.vmware.vim25.VirtualDeviceConnectInfo)

Aggregations

VirtualCdrom (com.vmware.vim25.VirtualCdrom)1 VirtualCdromAtapiBackingInfo (com.vmware.vim25.VirtualCdromAtapiBackingInfo)1 VirtualDeviceConfigSpec (com.vmware.vim25.VirtualDeviceConfigSpec)1 VirtualDeviceConnectInfo (com.vmware.vim25.VirtualDeviceConnectInfo)1