|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.vmware.vim25.mox.VirtualMachineDeviceManager
public class VirtualMachineDeviceManager
VirtualMachineDeviceManager manages the virtual devices in a much simplified way than using the reconfigVM_Task() method defined in VirtualMachine managed object. Devices it manages include: FloppyDrive, CdDrive, NetworkAdapter, UsbDevice, HardDisk Operations include: create -- create something new add -- add something existing but not yet attached to the virtual machine remove -- remove the device(s) from the virtual machine get -- retrieve the device(s) from the virtual machine update -- update the existing device with new configuration
| Nested Class Summary | |
|---|---|
static class |
VirtualMachineDeviceManager.VirtualNetworkAdapterType
Enumeration for all the possible network adapter types |
| Constructor Summary | |
|---|---|
VirtualMachineDeviceManager(VirtualMachine vm)
|
|
| Method Summary | ||
|---|---|---|
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)
|
|
|
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()
|
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public VirtualMachineDeviceManager(VirtualMachine vm)
| Method Detail |
|---|
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 ].
InvalidName
VmConfigFault
DuplicateName
TaskInProgress
FileFault
InvalidState
ConcurrentAccess
InvalidDatastore
InsufficientResourcesFault
RuntimeFault
RemoteException
public Task addFloppyDriveFromHost(String hostDevice,
boolean startConnected)
throws InvalidName,
VmConfigFault,
DuplicateName,
TaskInProgress,
FileFault,
InvalidState,
ConcurrentAccess,
InvalidDatastore,
InsufficientResourcesFault,
RuntimeFault,
RemoteException
hostDevice - - i.e. "/dev/fd0"
InvalidName
VmConfigFault
DuplicateName
TaskInProgress
FileFault
InvalidState
ConcurrentAccess
InvalidDatastore
InsufficientResourcesFault
RuntimeFault
RemoteException
public Task createFloppyDrive(String floppyImagePath,
boolean startConnected)
throws InvalidName,
VmConfigFault,
DuplicateName,
TaskInProgress,
FileFault,
InvalidState,
ConcurrentAccess,
InvalidDatastore,
InsufficientResourcesFault,
RuntimeFault,
RemoteException
InvalidName
VmConfigFault
DuplicateName
TaskInProgress
FileFault
InvalidState
ConcurrentAccess
InvalidDatastore
InsufficientResourcesFault
RuntimeFault
RemoteExceptionpublic String getPassThroughDevice(String type)
public void addPassthroughDevice()
public void removePassthroughDevice()
public void addCdDriveFromIso(String isoPath,
boolean startConnected)
throws InvalidProperty,
RuntimeFault,
RemoteException,
InterruptedException
InvalidProperty
RuntimeFault
RemoteException
InterruptedException
public void addCdDriveFromHost(String hostDevice,
boolean startConnected)
throws InvalidProperty,
RuntimeFault,
RemoteException,
InterruptedException
InvalidProperty
RuntimeFault
RemoteException
InterruptedException
public void createHardDisk(int diskSizeMB,
VirtualDiskType type,
VirtualDiskMode mode)
throws Exception
Exception
public 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
InvalidProperty
RuntimeFault
RemoteException
InterruptedException
public Task removeDevice(VirtualDevice device,
boolean destroyDeviceBacking)
throws InvalidName,
VmConfigFault,
DuplicateName,
TaskInProgress,
FileFault,
InvalidState,
ConcurrentAccess,
InvalidDatastore,
InsufficientResourcesFault,
RuntimeFault,
RemoteException
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
InvalidName
VmConfigFault
DuplicateName
TaskInProgress
FileFault
InvalidState
ConcurrentAccess
InvalidDatastore
InsufficientResourcesFault
RuntimeFault
RemoteExceptionpublic VirtualDevice[] getAllVirtualDevices()
public <T extends VirtualDevice> List<T> getVirtualDevicesOfType(Class<T> clazz)
public VirtualDevice getDeviceByBackingFileName(String name)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||