Package com.vmware.fcd
Class FcdAttachToVM
- java.lang.Object
-
- com.vmware.connection.ConnectedVimServiceBase
-
- com.vmware.fcd.FcdAttachToVM
-
@Sample(name="fcd-attachtovm", description="This sample attaches a given virtual storage object(FCD) to the given virtual machine.") public class FcdAttachToVM extends ConnectedVimServiceBaseFcdAttachToVM 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]
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.vmware.connection.ConnectedVimServiceBase
ConnectedVimServiceBase.ConnectionException
-
-
Field Summary
-
Fields inherited from class com.vmware.connection.ConnectedVimServiceBase
PROP_ME_NAME, SVC_INST_NAME
-
-
Constructor Summary
Constructors Constructor Description FcdAttachToVM()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidrun()voidsetControllerKey(java.lang.String controllerKey)voidsetDatastoreName(java.lang.String datastoreName)voidsetUnitNumber(java.lang.String unitNumber)voidsetVmName(java.lang.String vmName)voidsetVStorageObjectId(java.lang.String vStorageObjectId)-
Methods inherited from class com.vmware.connection.ConnectedVimServiceBase
basicConnectionFromConnection, connect, disconnect, getServiceInstanceReference, setConnection, setHostConnection
-
-
-
-
Method Detail
-
setVStorageObjectId
@Option(name="vstorageobjectid", required=true, description="Uuid of the disk.") public void setVStorageObjectId(java.lang.String vStorageObjectId)- Parameters:
vStorageObjectId- the vStorageObjectId to set
-
setDatastoreName
@Option(name="datastorename", required=true, description="Name of datastore containing the vstorageobject.") public void setDatastoreName(java.lang.String datastoreName)- Parameters:
datastoreName- the datastoreName to set
-
setVmName
@Option(name="vmname", required=true, description="Name of virtual machine.") public void setVmName(java.lang.String vmName)- Parameters:
vmName- the vmName to set
-
setControllerKey
@Option(name="controllerkey", required=false, description="Device Key of the controller.") public void setControllerKey(java.lang.String controllerKey)- Parameters:
controllerKey- the controllerKey to set
-
setUnitNumber
@Option(name="unitnumber", required=false, description="Unit number of the virtual machine.") public void setUnitNumber(java.lang.String unitNumber)- Parameters:
unitNumber- the unitNumber to set
-
run
@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- Throws:
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
-
-