public class VirtualMachineDeviceManager extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
VirtualMachineDeviceManager.VirtualNetworkAdapterType
Enumeration for all the possible network adapter types
|
| Constructor and Description |
|---|
VirtualMachineDeviceManager(VirtualMachine vm) |
| Modifier and Type | Method and Description |
|---|---|
void |
addCdDriveFromHost(String hostDevice,
boolean startConnected) |
void |
addCdDriveFromIso(String isoPath,
boolean startConnected) |
Task |
addFloppyDriveFromHost(String hostDevice,
boolean startConnected) |
Task |
addFloppyDriveFromISO(String floppyImagePath,
boolean startConnected) |
void |
addHardDisk(String diskFilePath,
VirtualDiskMode diskMode) |
void |
addPassthroughDevice() |
Task |
createFloppyDrive(String floppyImagePath,
boolean startConnected) |
void |
createHardDisk(int diskSizeMB,
VirtualDiskType type,
VirtualDiskMode mode) |
void |
createNetworkAdapter(VirtualMachineDeviceManager.VirtualNetworkAdapterType type,
String networkName,
String macAddress,
boolean wakeOnLan,
boolean startConnected)
Create a new virtual network adapter on the VM
Your MAC address should start with 00:50:56
|
VirtualDisk |
findHardDisk(String diskName) |
VirtualDevice[] |
getAllVirtualDevices()
Get all the virtual devices of a virtual machine
|
VirtualDevice |
getDeviceByBackingFileName(String name) |
String |
getPassThroughDevice(String type) |
<T extends VirtualDevice> |
getVirtualDevicesOfType(Class<T> clazz) |
VirtualMachine |
getVM() |
Task |
removeDevice(VirtualDevice device,
boolean destroyDeviceBacking)
Remove the device.
|
Task |
removeDevices(List<VirtualDevice> deviceList,
boolean destroyDeviceBacking)
Remove all devices as listed in the deviceList.
|
void |
removePassthroughDevice() |
public VirtualMachineDeviceManager(VirtualMachine vm)
public VirtualMachine getVM()
public Task addFloppyDriveFromISO(String floppyImagePath, boolean startConnected) throws InvalidName, VmConfigFault, DuplicateName, TaskInProgress, FileFault, InvalidState, ConcurrentAccess, InvalidDatastore, InsufficientResourcesFault, RuntimeFault, RemoteException
floppyImagePath - - i.e. "[storage1] myVM/myFloppy.flp" Note: there is a space after ].InvalidNameVmConfigFaultDuplicateNameTaskInProgressFileFaultInvalidStateConcurrentAccessInvalidDatastoreInsufficientResourcesFaultRuntimeFaultRemoteExceptionpublic Task addFloppyDriveFromHost(String hostDevice, boolean startConnected) throws InvalidName, VmConfigFault, DuplicateName, TaskInProgress, FileFault, InvalidState, ConcurrentAccess, InvalidDatastore, InsufficientResourcesFault, RuntimeFault, RemoteException
hostDevice - - i.e. "/dev/fd0"InvalidNameVmConfigFaultDuplicateNameTaskInProgressFileFaultInvalidStateConcurrentAccessInvalidDatastoreInsufficientResourcesFaultRuntimeFaultRemoteExceptionpublic Task createFloppyDrive(String floppyImagePath, boolean startConnected) throws InvalidName, VmConfigFault, DuplicateName, TaskInProgress, FileFault, InvalidState, ConcurrentAccess, InvalidDatastore, InsufficientResourcesFault, RuntimeFault, RemoteException
public void addPassthroughDevice()
public void removePassthroughDevice()
public void addCdDriveFromIso(String isoPath, boolean startConnected) throws InvalidProperty, RuntimeFault, RemoteException, InterruptedException
public void addCdDriveFromHost(String hostDevice, boolean startConnected) throws InvalidProperty, RuntimeFault, RemoteException, InterruptedException
public void createHardDisk(int diskSizeMB,
VirtualDiskType type,
VirtualDiskMode mode)
throws Exception
Exceptionpublic void addHardDisk(String diskFilePath, VirtualDiskMode diskMode) throws Exception
Exceptionpublic VirtualDisk findHardDisk(String diskName)
public void createNetworkAdapter(VirtualMachineDeviceManager.VirtualNetworkAdapterType type, String networkName, String macAddress, boolean wakeOnLan, boolean startConnected) throws InvalidProperty, RuntimeFault, RemoteException, InterruptedException
public Task removeDevice(VirtualDevice device, boolean destroyDeviceBacking) throws InvalidName, VmConfigFault, DuplicateName, TaskInProgress, FileFault, InvalidState, ConcurrentAccess, InvalidDatastore, InsufficientResourcesFault, RuntimeFault, RemoteException
public Task removeDevices(List<VirtualDevice> deviceList, boolean destroyDeviceBacking) throws InvalidName, VmConfigFault, DuplicateName, TaskInProgress, FileFault, InvalidState, ConcurrentAccess, InvalidDatastore, InsufficientResourcesFault, RuntimeFault, RemoteException
public VirtualDevice[] getAllVirtualDevices()
public <T extends VirtualDevice> List<T> getVirtualDevicesOfType(Class<T> clazz)
public VirtualDevice getDeviceByBackingFileName(String name)
Copyright © 2011-2012. All Rights Reserved.