@Sample(name="fcd-associateprofile",
description="This sample attaches a given virtual storage object(FCD) to the given virtual machine.")
public class FcdAssociateProfile
extends ConnectedServiceBase
FcdAssociateProfile
This sample attaches a virtual storage object to given virtual machine and
associates a given storage profile to the virtual storage object.
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
vmpath [required] : Inventory path of the virtual machine
datastorename [required] : Name of the datastore which contains
the virtual storage object
profilename [required] : Name of the storage profile
Command Line:
Attach a given virtual storage object to the given virtual machine.
run.bat com.vmware.spbm.samples.FcdAssociateProfile --url [webserviceurl]
--username [username] --password [password]
--vstorageobjectid [vstorageobjectid] --vmpath [vmpath]
--datastorename [datastorename] --profilename [profilename]
Ex: vmpath ::
<DatacenterName>/<HiddenFolder - "vm">/<VmName>
( testDC/vm/VM_Test1 )
| Constructor and Description |
|---|
FcdAssociateProfile() |
| Modifier and Type | Method and Description |
|---|---|
void |
run() |
void |
setDatastoreName(java.lang.String datastoreName) |
void |
setProfileName(java.lang.String profileName) |
void |
setVmPath(java.lang.String vmPath) |
void |
setVStorageObjectId(java.lang.String vStorageObjectId) |
setConnection, start, stop@Option(name="vstorageobjectid",
required=true,
description="Uuid of the disk.")
public void setVStorageObjectId(java.lang.String vStorageObjectId)
vStorageObjectId - the vStorageObjectId to set@Option(name="vmpath",
required=true,
description="Path of virtual machine.")
public void setVmPath(java.lang.String vmPath)
vmPath - the vmPath 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="profilename",
required=true,
description="Name of the storage profile")
public void setProfileName(java.lang.String profileName)
profileName - the profileName 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.pbm.InvalidArgumentFaultMsg,
com.vmware.pbm.RuntimeFaultFaultMsg,
com.vmware.vim25.ConcurrentAccessFaultMsg,
com.vmware.vim25.DuplicateNameFaultMsg,
com.vmware.vim25.InsufficientResourcesFaultFaultMsg,
com.vmware.vim25.InvalidNameFaultMsg,
com.vmware.vim25.TaskInProgressFaultMsg
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.pbm.InvalidArgumentFaultMsgcom.vmware.vim25.ConcurrentAccessFaultMsgcom.vmware.vim25.DuplicateNameFaultMsgcom.vmware.vim25.InsufficientResourcesFaultFaultMsgcom.vmware.vim25.InvalidNameFaultMsgcom.vmware.vim25.TaskInProgressFaultMsg