Class FcdSnapshotOperations


  • @Sample(name="fcd-snapshotoperations",
            description="This sample executes snapshot related operation on a snapshot of a given VStorageObject.")
    public class FcdSnapshotOperations
    extends com.vmware.connection.ConnectedVimServiceBase
     FcdSnapshotOperations
    
     This sample executes below snapshot related operation on
     a snapshot of a given VStorageObject from vslm :
    
     1. Creates snapshot of a given VStorageObject.
     2. Retrieves Snapshot Info of a given VStorageObject.
     3. Retrieves Snapshot Details of a given VStorageObject.
     4. Query disk changed areas of a given VStorageObject.
     5. Creates vStorageObject from snapshot.
     6. Reverts VStorageObject to a given snapshot.
     7. Deletes snapshot  of a given VStorageObject.
    
     Pre-requisite :        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
     description            [required] : A short description to be associated
                                         with the snapshot.
     fcdname                [required] : FCD name is required to create
                                         disk from snapshot.
     pbmprofileid           [optional] : SPBM Profile requirement on the
                                         new virtual storage object.
     devicegroupid          [optional] : Id of the replication device group.
     faultdomainid          [optional] : Id of the fault domain to which the group belongs.
     datastorepath          [optional] : Relative location in the specified datastore where disk needs to be created.
    
     Command Line:
     run.bat com.vmware.fcd.FcdSnapshotOperations --url [webserviceurl]
     --username [username] --password [password]
     --vstorageobjectid [vstorageobjectid] --description [description]
     
    • 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 Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static boolean isSnapshotIdInSnapshotList​(com.vmware.vim25.VStorageObjectSnapshotInfo retrievedSnapshotInfo, com.vmware.vim25.ID snapshotId)
      Verifies if Snapshot Id is included in retrievedSnapshotInfo
      void run()  
      void setDatastorePath​(java.lang.String datastorePath)  
      void setDescription​(java.lang.String description)  
      void setDeviceGroupId​(java.lang.String deviceGroupId)  
      void setFaultDomainId​(java.lang.String faultDomainId)  
      void setProfileSpec​(java.lang.String pbmProfileId)  
      void setVStorageObjectId​(java.lang.String vStorageObjectId)  
      void setVStorageObjectName​(java.lang.String fcdName)  
      • 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

      • FcdSnapshotOperations

        public FcdSnapshotOperations()
    • Method Detail

      • setVStorageObjectId

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

        @Option(name="description",
                required=true,
                description="A short description to be associated with the snapshot.")
        public void setDescription​(java.lang.String description)
        Parameters:
        description - the description to set
      • setVStorageObjectName

        @Option(name="fcdname",
                required=true,
                description="A user friendly name to beassociated with the new disk.")
        public void setVStorageObjectName​(java.lang.String fcdName)
        Parameters:
        fcdName - the fcdName to set
      • setProfileSpec

        @Option(name="pbmprofileid",
                required=false,
                description="SPBM Profile requirement on thenew virtual storage object.")
        public void setProfileSpec​(java.lang.String pbmProfileId)
        Parameters:
        pbmProfileId - the pbmProfileId to set
      • setDeviceGroupId

        @Option(name="devicegroupid",
                required=false,
                description="Id of the replication device group.")
        public void setDeviceGroupId​(java.lang.String deviceGroupId)
        Parameters:
        deviceGroupId - the deviceGroupId to set
      • setFaultDomainId

        @Option(name="faultdomainid",
                required=false,
                description="ID of the fault domain to which the group belongs.")
        public void setFaultDomainId​(java.lang.String faultDomainId)
        Parameters:
        faultDomainId - the faultDomainId to set
      • setDatastorePath

        @Option(name="datastorepath",
                required=false,
                description="Relative location in the specified datastorewhere disk needs to be created.")
        public void setDatastorePath​(java.lang.String datastorePath)
        Parameters:
        datastorePath - the path to set
      • isSnapshotIdInSnapshotList

        public static boolean isSnapshotIdInSnapshotList​(com.vmware.vim25.VStorageObjectSnapshotInfo retrievedSnapshotInfo,
                                                         com.vmware.vim25.ID snapshotId)
        Verifies if Snapshot Id is included in retrievedSnapshotInfo
        Parameters:
        retrievedSnapshotInfo - VStorageObjectSnapshotInfo containing snapshot list of VStorageObject
        snapshotId - Snapshot Id of VStorageObject
        Returns:
        true if retrievedSnapshotInfo contains snapshotId details
      • run

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