@Sample(name="vm-manage-cd",
description="This sample adds / removes CDROM to / from an existing VM\nThis sample lists information about a VMs CDROMs\nThis sample updates an existing CDROM a VM\n")
public class VMManageCD
extends ConnectedVimServiceBase
VMManageCD
This sample adds / removes CDROM to / from an existing VM
This sample lists information about a VMs CDROMs
This sample updates an existing CDROM a VM
Parameters:
url [required] : url of the web service
username [required] : username for the authentication
password [required] : password for the authentication
vmname [required] : name of the virtual machine
operation [required] : operation type - [get|add|remove|set]
isopath [optional] : full datastore path to the iso file
remote [optional] : Specify the device is a remote or client device or iso
startconnected [optional] : virtual CD starts connected when VM powers on
connect [optional] : virtual CD is connected after creation or update
Set only if VM is powered on
label [optional] : used to find the device.key value
devicename [optional] : Specify the path to the CD on the VM's host
Command Line:
Get CD-Rom Info");
run.bat com.vmware.vm.VMManageCD
--url [webserviceurl] --username [username] --password [password]
--operation get --vmname [Virtual Machine Name]
Add CD-Rom
run.bat com.vmware.vm.VMManageCD
--url [webserviceurl] --username [username] --password [password]
--operation add --vmname [Virtual Machine Name]
--isoPath "[datastore1] test.iso" --remote false --connect true
Remove CD-Rom
run.bat com.vmware.vm.VMManageCD
--url [webserviceurl] --username [username] --password [password]
--operation remove --vmname [Virtual Machine Name]
--label CD\\DVD Drive 1
Reconfigure CD-Rom
run.bat com.vmware.vm.VMManageCD
--url [webserviceurl] --username [username] --password [password]
--operation set --vmname [Virtual Machine Name]
--label CD\\DVD Drive 1 --connect false
ConnectedVimServiceBase.ConnectionExceptionPROP_ME_NAME, SVC_INST_NAME| Constructor and Description |
|---|
VMManageCD() |
| Modifier and Type | Method and Description |
|---|---|
void |
run() |
void |
setConnect(java.lang.String setting) |
void |
setDeviceName(java.lang.String name) |
void |
setIsoPath(java.lang.String path) |
void |
setLabelName(java.lang.String name) |
void |
setOperation(java.lang.String operation) |
void |
setRemote(java.lang.String remote) |
void |
setStartConnected(java.lang.String setting) |
void |
setVirtualMachineName(java.lang.String vmname) |
basicConnectionFromConnection, connect, disconnect, getServiceInstanceReference, setConnection, setHostConnection@Option(name="vmname",
description="name of the virtual machine")
public void setVirtualMachineName(java.lang.String vmname)
@Option(name="operation",
description="operation type - [get|add|remove|set]")
public void setOperation(java.lang.String operation)
@Option(name="isopath",
required=false,
description="full datastore path to the iso file")
public void setIsoPath(java.lang.String path)
@Option(name="remote",
required=false,
description="Specify the device is a remote or client device or iso")
public void setRemote(java.lang.String remote)
@Option(name="startconnected",
required=false,
description="virtual CD starts connected when VM powers on")
public void setStartConnected(java.lang.String setting)
@Option(name="connect",
required=false,
description="virtual CD is connected after creation or update\nSet only if VM is powered on")
public void setConnect(java.lang.String setting)
@Option(name="label",
required=false,
description="used to find the device.key value")
public void setLabelName(java.lang.String name)
@Option(name="devicename",
required=false,
description="Specify the path to the CD on the VM\'s host")
public void setDeviceName(java.lang.String name)
@Action
public void run()
throws com.vmware.vim25.DuplicateNameFaultMsg,
com.vmware.vim25.RuntimeFaultFaultMsg,
com.vmware.vim25.TaskInProgressFaultMsg,
com.vmware.vim25.VmConfigFaultFaultMsg,
com.vmware.vim25.InsufficientResourcesFaultFaultMsg,
com.vmware.vim25.InvalidDatastoreFaultMsg,
com.vmware.vim25.InvalidPropertyFaultMsg,
com.vmware.vim25.FileFaultFaultMsg,
com.vmware.vim25.ConcurrentAccessFaultMsg,
com.vmware.vim25.InvalidStateFaultMsg,
com.vmware.vim25.InvalidCollectorVersionFaultMsg,
com.vmware.vim25.InvalidNameFaultMsg
com.vmware.vim25.DuplicateNameFaultMsgcom.vmware.vim25.RuntimeFaultFaultMsgcom.vmware.vim25.TaskInProgressFaultMsgcom.vmware.vim25.VmConfigFaultFaultMsgcom.vmware.vim25.InsufficientResourcesFaultFaultMsgcom.vmware.vim25.InvalidDatastoreFaultMsgcom.vmware.vim25.InvalidPropertyFaultMsgcom.vmware.vim25.FileFaultFaultMsgcom.vmware.vim25.ConcurrentAccessFaultMsgcom.vmware.vim25.InvalidStateFaultMsgcom.vmware.vim25.InvalidCollectorVersionFaultMsgcom.vmware.vim25.InvalidNameFaultMsg