Package com.vmware.fcd
Class FcdCreate
- java.lang.Object
-
- com.vmware.connection.ConnectedVimServiceBase
-
- com.vmware.fcd.FcdCreate
-
@Sample(name="fcd-create", description="This sample creates a virtual storage object(FCD).") public class FcdCreate extends ConnectedVimServiceBaseFcdCreate 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
-
-
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 FcdCreate()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description com.vmware.vim25.VslmCreateSpecgenerateVslmCreateSpec(com.vmware.vim25.ManagedObjectReference dsMor, com.vmware.fcd.FcdCreate.DiskProvisioningTypes provisioningType)This method constructs a VslmCreateSpec for the vStorageObjectstatic java.lang.StringgetFcdFilePath(com.vmware.vim25.VStorageObject vStorageObject)Util method to get the FilePath of a given VStorageObject.voidinit()static booleanisFcdIdInFcdList(java.util.List<java.lang.String> fcdStrIdList, java.util.List<com.vmware.vim25.ID> fcdIdList)Verifies if Fcd Id List<String> is included in fcdIDListvoidrun()voidsetDatastoreName(java.lang.String datastoreName)voidsetDeviceName(java.lang.String deviceName)voidsetProvisioningType(java.lang.String provisioningType)voidsetVStorageObjectName(java.lang.String vStorageObjectName)voidsetVStorageObjectSize(long vStorageObjectSizeInMB)-
Methods inherited from class com.vmware.connection.ConnectedVimServiceBase
basicConnectionFromConnection, connect, disconnect, getServiceInstanceReference, setConnection, setHostConnection
-
-
-
-
Method Detail
-
setVStorageObjectName
@Option(name="vstorageobjectname", required=true, description="Name of the Disk.") public void setVStorageObjectName(java.lang.String vStorageObjectName)- Parameters:
vStorageObjectName- the vStorageObjectName to set
-
setDatastoreName
@Option(name="datastorename", required=true, description="Name of datastore.") public void setDatastoreName(java.lang.String datastoreName)- Parameters:
datastoreName- the datastoreName to set
-
setVStorageObjectSize
@Option(name="vstorageobjectsizeinMB", required=true, description="Size of the Disk (in MB)") public void setVStorageObjectSize(long vStorageObjectSizeInMB)- Parameters:
vStorageObjectSizeInMB- the vStorageObjectSizeInMB to set
-
setProvisioningType
@Option(name="provisioningtype", required=false, description="Provisioning Type of the Disk.\n [thin | eagerZeroedThick | lazyZeroedThick | virtualMode | physicalMode]") public void setProvisioningType(java.lang.String provisioningType)- Parameters:
provisioningType- the provisioningType to set
-
setDeviceName
@Option(name="devicename", required=false, description="Canonical name of the LUN to use for RDM provisioning type.") public void setDeviceName(java.lang.String deviceName)- Parameters:
deviceName- the deviceName to set
-
init
@Before public void init()
-
isFcdIdInFcdList
public 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- Parameters:
fcdStrIdList- List of FCD IDs as StringfcdIdList- List of FCD IDs as ID- Returns:
- true if fcdIDList<ID> contains all the fcds in fcdStrIDList<String>
-
generateVslmCreateSpec
public com.vmware.vim25.VslmCreateSpec generateVslmCreateSpec(com.vmware.vim25.ManagedObjectReference dsMor, com.vmware.fcd.FcdCreate.DiskProvisioningTypes provisioningType) throws java.lang.IllegalArgumentExceptionThis method constructs a VslmCreateSpec for the vStorageObject- Parameters:
dsMor- The ManagedObjectReferece of the datastoreprovisioningType- The provisioningType of the disk- Returns:
- VslmCreateSpec
- Throws:
java.lang.IllegalArgumentException
-
getFcdFilePath
public static java.lang.String getFcdFilePath(com.vmware.vim25.VStorageObject vStorageObject)
Util method to get the FilePath of a given VStorageObject.- Parameters:
vStorageObject- The vStorageObject whose path is to be found.- Returns:
- filePath of vStorageObject
-
run
@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- Throws:
java.lang.IllegalArgumentExceptionjava.lang.RuntimeExceptioncom.vmware.vim25.FileFaultFaultMsgcom.vmware.vim25.InvalidDatastoreFaultMsgcom.vmware.vim25.RuntimeFaultFaultMsgcom.vmware.vim25.InvalidPropertyFaultMsgcom.vmware.vim25.InvalidCollectorVersionFaultMsgcom.vmware.vim25.NotFoundFaultMsg
-
-