Class FcdCreate


  • @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
     
    • Constructor Detail

      • FcdCreate

        public FcdCreate()
    • 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 String
        fcdIdList - 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.IllegalArgumentException
        This method constructs a VslmCreateSpec for the vStorageObject
        Parameters:
        dsMor - The ManagedObjectReferece of the datastore
        provisioningType - 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.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