Class FcdMigrationOperations


  • @Sample(name="fcd-migrationoperation",
            description="This sample clones and relocates a virtual storage object from vslm.")
    public class FcdMigrationOperations
    extends com.vmware.connection.ConnectedVimServiceBase
     FcdMigrationOperations
    
     This sample executes migration related
     operations on a given VStorageObject from vslm:
    
     1. Clone a virtual storage object.
     2. Relocate a virtual storage object.
     3. Query synchronization status of the global catalog.
     4. Query the synchronization state of the Global Catalog
        for a specified datastore.
    
     Pre-requisite :        1. Existing VStorageObject ID
    
     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 vstorageobject
     destDatastoreName      [required] : Name of destination datastore
     cloneddiskname         [optional] : Name of cloned vStorageObject
     provisioningtype       [optional] : Type of provisioning for the disk
                                         [thin | eagerZeroedThick |
                                         lazyZeroedThick | virtualMode |
                                         physicalMode]
     hostscsidisk           [optional] : Host Scsi disk to clone vStorageObject
    
     Command Line:
     run.bat com.vmware.fcd.FcdMigrationOperations --url [webserviceurl]
     --username [username] --password [password]
     --vstorageobjectid [vstorageobjectid] --destdatastoredame [datastorename]
     --cloneddiskname [cloneddiskname]
     
    • Nested Class Summary

      • Nested classes/interfaces inherited from class com.vmware.connection.ConnectedVimServiceBase

        com.vmware.connection.ConnectedVimServiceBase.ConnectionException
    • Field Summary

      • Fields inherited from class com.vmware.connection.ConnectedVimServiceBase

        PROP_ME_NAME, SVC_INST_NAME
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      com.vmware.vim25.VslmCloneSpec generateVslmCloneSpec​(com.vmware.vim25.ManagedObjectReference dsMor, com.vmware.fcd.FcdMigrationOperations.DiskProvisioningTypes provisioningType)
      This method constructs a VslmCloneSpec for the vStorageObject
      com.vmware.vim25.VslmRelocateSpec generateVslmRelocateSpec​(com.vmware.vim25.ManagedObjectReference dsMor, com.vmware.fcd.FcdMigrationOperations.DiskProvisioningTypes provisioningType)
      This method constructs a VslmRelocateSpec for the vStorageObject
      void init()  
      void run()  
      void setDestDatastoreName​(java.lang.String destDatastoreName)  
      void setHostScsiDisk​(com.vmware.vim25.HostScsiDisk hostScsiDisk)  
      void setProvisioningType​(java.lang.String provisioningType)  
      void setVStorageObjectId​(java.lang.String vStorageObjectId)  
      void setVStorageObjectName​(java.lang.String clonedDiskName)  
      • Methods inherited from class com.vmware.connection.ConnectedVimServiceBase

        basicConnectionFromConnection, connect, disconnect, getServiceInstanceReference, setConnection, setHostConnection
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • FcdMigrationOperations

        public FcdMigrationOperations()
    • Method Detail

      • init

        @Before
        public void init()
      • setVStorageObjectId

        @Option(name="vstorageobjectid",
                required=true,
                description="Uuid of the vstorageobject.")
        public void setVStorageObjectId​(java.lang.String vStorageObjectId)
        Parameters:
        vStorageObjectId - the vStorageObjectId to set
      • setDestDatastoreName

        @Option(name="destdatastoredame",
                required=true,
                description="Name of destination datastore.")
        public void setDestDatastoreName​(java.lang.String destDatastoreName)
        Parameters:
        destDatastoreName - the destDatastoreName to set
      • setVStorageObjectName

        @Option(name="cloneddiskname",
                required=true,
                description="Name of the cloned Disk.")
        public void setVStorageObjectName​(java.lang.String clonedDiskName)
        Parameters:
        clonedDiskName - the clonedDiskName 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
      • setHostScsiDisk

        @Option(name="hostscsidisk",
                required=false,
                description="Uuid of the scsi disk.")
        public void setHostScsiDisk​(com.vmware.vim25.HostScsiDisk hostScsiDisk)
        Parameters:
        hostScsiDisk - the vStorageObjectId to set
      • generateVslmCloneSpec

        public com.vmware.vim25.VslmCloneSpec generateVslmCloneSpec​(com.vmware.vim25.ManagedObjectReference dsMor,
                                                                    com.vmware.fcd.FcdMigrationOperations.DiskProvisioningTypes provisioningType)
                                                             throws java.lang.IllegalArgumentException
        This method constructs a VslmCloneSpec for the vStorageObject
        Parameters:
        dsMor - The ManagedObjectReferece of the datastore
        provisioningType - The provisioningType of the disk
        Returns:
        VslmCloneSpec
        Throws:
        java.lang.IllegalArgumentException
      • generateVslmRelocateSpec

        public com.vmware.vim25.VslmRelocateSpec generateVslmRelocateSpec​(com.vmware.vim25.ManagedObjectReference dsMor,
                                                                          com.vmware.fcd.FcdMigrationOperations.DiskProvisioningTypes provisioningType)
                                                                   throws java.lang.IllegalArgumentException
        This method constructs a VslmRelocateSpec for the vStorageObject
        Parameters:
        dsMor - The ManagedObjectReferece of the datastore
        provisioningType - The provisioningType of the disk
        Returns:
        VslmCreateSpec
        Throws:
        java.lang.IllegalArgumentException
      • run

        @Action
        public void run()
                 throws java.lang.Exception
        Throws:
        java.lang.Exception