@Sample(name="fcd-attachtovm",
description="This sample attaches a given virtual storage object(FCD) to the given virtual machine.")
public class FcdAttachToVM
extends ConnectedVimServiceBase
FcdAttachToVM
This sample attaches a given virtual storage object to the given virtual
machine.
Parameters:
url [required] : url of the web service
username [required] : username for the authentication
password [required] : password for the authentication
vstorageobjectid [required] : Uuid of the disk
datastorename [required] : Name of the datastore which contains
the virtual storage object
vmname [required] : Name of the virtual machine. A minimum
virtual machine version of 'vmx-13' is
required for the attach operation to
succeed
controllerkey [optional] : Device Key of the controller the disk
will connect to. It can be unset if
there is only one controller (SCSI or
SATA) with the available slot in the
virtual machine. If there are multiple
SCSI or SATA controllers available, user
must specify the controller
unitnumber [optional] : Unit number of the virtual machine
Command Line:
Attach a given virtual storage object to the given virtual machine.
run.bat com.vmware.vm.FcdAttachToVM --url [webserviceurl] --username [username]
--password [password] --vstorageobjectid [vstorageobjectid] --vmname [vmname]
Attach a given virtual storage object to the given virtual machine by specifying
controller key and unit number.
run.bat com.vmware.vm.FcdAttachToVM --url [webserviceurl] --username [username]
--password [password] --vstorageobjectid [vstorageobjectid] --vmname [vmname]
--controllerkey [controllerkey] --unitnumber [unitnumber]
ConnectedVimServiceBase.ConnectionExceptionPROP_ME_NAME, SVC_INST_NAME| Constructor and Description |
|---|
FcdAttachToVM() |
| Modifier and Type | Method and Description |
|---|---|
void |
run() |
void |
setControllerKey(java.lang.String controllerKey) |
void |
setDatastoreName(java.lang.String datastoreName) |
void |
setUnitNumber(java.lang.String unitNumber) |
void |
setVmName(java.lang.String vmName) |
void |
setVStorageObjectId(java.lang.String vStorageObjectId) |
basicConnectionFromConnection, connect, disconnect, getServiceInstanceReference, setConnection, setHostConnection@Option(name="vstorageobjectid",
required=true,
description="Uuid of the disk.")
public void setVStorageObjectId(java.lang.String vStorageObjectId)
vStorageObjectId - the vStorageObjectId to set@Option(name="datastorename",
required=true,
description="Name of datastore containing the vstorageobject.")
public void setDatastoreName(java.lang.String datastoreName)
datastoreName - the datastoreName to set@Option(name="vmname",
required=true,
description="Name of virtual machine.")
public void setVmName(java.lang.String vmName)
vmName - the vmName to set@Option(name="controllerkey",
required=false,
description="Device Key of the controller.")
public void setControllerKey(java.lang.String controllerKey)
controllerKey - the controllerKey to set@Option(name="unitnumber",
required=false,
description="Unit number of the virtual machine.")
public void setUnitNumber(java.lang.String unitNumber)
unitNumber - the unitNumber to set@Action
public void run()
throws com.vmware.vim25.InvalidPropertyFaultMsg,
com.vmware.vim25.RuntimeFaultFaultMsg,
com.vmware.vim25.FileFaultFaultMsg,
com.vmware.vim25.InvalidDatastoreFaultMsg,
com.vmware.vim25.NotFoundFaultMsg,
com.vmware.vim25.InvalidControllerFaultMsg,
com.vmware.vim25.InvalidStateFaultMsg,
com.vmware.vim25.MissingControllerFaultMsg,
com.vmware.vim25.VmConfigFaultFaultMsg,
com.vmware.vim25.InvalidCollectorVersionFaultMsg,
com.vmware.vim25.DeviceUnsupportedForVmVersionFaultMsg
com.vmware.vim25.InvalidPropertyFaultMsgcom.vmware.vim25.RuntimeFaultFaultMsgcom.vmware.vim25.FileFaultFaultMsgcom.vmware.vim25.InvalidDatastoreFaultMsgcom.vmware.vim25.NotFoundFaultMsgcom.vmware.vim25.InvalidControllerFaultMsgcom.vmware.vim25.InvalidStateFaultMsgcom.vmware.vim25.MissingControllerFaultMsgcom.vmware.vim25.VmConfigFaultFaultMsgcom.vmware.vim25.InvalidCollectorVersionFaultMsgcom.vmware.vim25.DeviceUnsupportedForVmVersionFaultMsg