@Sample(name="fcd-create",
description="This sample creates a virtual storage object(FCD).")
public class FcdCreate
extends ConnectedVimServiceBase
FcdCreate
This sample creates a virtual storage object
Parameters:
url [required] : url of the web service
username [required] : username for the authentication
password [required] : password for the authentication
vstorageobjectname [required] : Name of the disk
datastorename [required] : Name of the datastore
vstorageobjectsizeinMB [required] : Size of the disk(in MB)
provisioningtype [optional] : Type of provisioning for the disk
[thin | eagerZeroedThick |
lazyZeroedThick | virtualMode |
physicalMode]
devicename [optional] : Canonical name of the LUN to use for disk types
Command Line:
Create a disk (virtual storage object) given vstorageobject name, datastore
name and vstorageobject size
run.bat com.vmware.vm.FcdCreate --url [webserviceurl]
--username [username] --password [password]
--vstorageobjectname [vstorageobjectname] --datastorename [datastorename]
--vstorageobject [vstorageobject]
Create a disk (virtual storage object) given vstorageobject name, datastore
names, vstorageobject size and provisioning type of vstorageobject
run.bat com.vmware.vm.FcdCreate --url [webserviceurl]
--username [username] --password [password]
--vstorageobjectname [vstorageobjectname] --datastorename [datastorename]
--vstorageobject [vstorageobject] --provisioningtype [provisioningtype]
--devicename [devicename]
Ex: devicename :: vmhba0:0:0:0
ConnectedVimServiceBase.ConnectionExceptionPROP_ME_NAME, SVC_INST_NAME| Constructor and Description |
|---|
FcdCreate() |
| Modifier and Type | Method and Description |
|---|---|
com.vmware.vim25.VslmCreateSpec |
generateVslmCreateSpec(com.vmware.vim25.ManagedObjectReference dsMor,
com.vmware.fcd.FcdCreate.DiskProvisioningTypes provisioningType)
This method constructs a VslmCreateSpec for the vStorageObject
|
static java.lang.String |
getFcdFilePath(com.vmware.vim25.VStorageObject vStorageObject)
Util method to get the FilePath of a given VStorageObject.
|
void |
init() |
static boolean |
isFcdIdInFcdList(java.util.List<java.lang.String> fcdStrIdList,
java.util.List<com.vmware.vim25.ID> fcdIdList)
Verifies if Fcd Id List<String> is included in fcdIDList
|
void |
run() |
void |
setDatastoreName(java.lang.String datastoreName) |
void |
setDeviceName(java.lang.String deviceName) |
void |
setProvisioningType(java.lang.String provisioningType) |
void |
setVStorageObjectName(java.lang.String vStorageObjectName) |
void |
setVStorageObjectSize(long vStorageObjectSizeInMB) |
basicConnectionFromConnection, connect, disconnect, getServiceInstanceReference, setConnection, setHostConnection@Option(name="vstorageobjectname",
required=true,
description="Name of the Disk.")
public void setVStorageObjectName(java.lang.String vStorageObjectName)
vStorageObjectName - the vStorageObjectName to set@Option(name="datastorename",
required=true,
description="Name of datastore.")
public void setDatastoreName(java.lang.String datastoreName)
datastoreName - the datastoreName to set@Option(name="vstorageobjectsizeinMB",
required=true,
description="Size of the Disk (in MB)")
public void setVStorageObjectSize(long vStorageObjectSizeInMB)
vStorageObjectSizeInMB - the vStorageObjectSizeInMB to set@Option(name="provisioningtype",
required=false,
description="Provisioning Type of the Disk.\n [thin | eagerZeroedThick | lazyZeroedThick | virtualMode | physicalMode]")
public void setProvisioningType(java.lang.String provisioningType)
provisioningType - the provisioningType to set@Option(name="devicename",
required=false,
description="Canonical name of the LUN to use for RDM provisioning type.")
public void setDeviceName(java.lang.String deviceName)
deviceName - the deviceName to set@Before public void init()
public static boolean isFcdIdInFcdList(java.util.List<java.lang.String> fcdStrIdList,
java.util.List<com.vmware.vim25.ID> fcdIdList)
fcdStrIdList - List of FCD IDs as StringfcdIdList - List of FCD IDs as IDpublic com.vmware.vim25.VslmCreateSpec generateVslmCreateSpec(com.vmware.vim25.ManagedObjectReference dsMor,
com.vmware.fcd.FcdCreate.DiskProvisioningTypes provisioningType)
throws java.lang.IllegalArgumentException
dsMor - The ManagedObjectReferece of the datastoreprovisioningType - The provisioningType of the diskjava.lang.IllegalArgumentExceptionpublic static java.lang.String getFcdFilePath(com.vmware.vim25.VStorageObject vStorageObject)
vStorageObject - The vStorageObject whose path is to be found.@Action
public void run()
throws java.lang.IllegalArgumentException,
java.lang.RuntimeException,
com.vmware.vim25.FileFaultFaultMsg,
com.vmware.vim25.InvalidDatastoreFaultMsg,
com.vmware.vim25.RuntimeFaultFaultMsg,
com.vmware.vim25.InvalidPropertyFaultMsg,
com.vmware.vim25.InvalidCollectorVersionFaultMsg,
com.vmware.vim25.NotFoundFaultMsg
java.lang.IllegalArgumentExceptionjava.lang.RuntimeExceptioncom.vmware.vim25.FileFaultFaultMsgcom.vmware.vim25.InvalidDatastoreFaultMsgcom.vmware.vim25.RuntimeFaultFaultMsgcom.vmware.vim25.InvalidPropertyFaultMsgcom.vmware.vim25.InvalidCollectorVersionFaultMsgcom.vmware.vim25.NotFoundFaultMsg