Skip to main content
SnapCenter Software 4.8
A newer release of this product is available.

Clone backups using PowerShell cmdlets

Contributors netapp-soumikd

The clone workflow includes planning, performing the clone operation, and monitoring the operation.

What you will need

You must have prepared the PowerShell environment to execute the PowerShell cmdlets.

For information about PowerShell cmdlets, use the SnapCenter cmdlet help or see the SnapCenter Software Cmdlet Reference Guide.

Steps

  1. Initiate a connection session with the SnapCenter Server for a specified user by using the Open-SmConnection cmdlet.

    Open-SmConnection  -SMSbaseurl  https:\\snapctr.demo.netapp.com:8146/
  2. List the backups that can be cloned using the Get-SmBackup or Get-SmResourceGroup cmdlet.

    This example displays information about all available backups:

     C:\PS>PS C:\> Get-SmBackup
    
    BackupId                      BackupName                    BackupTime                    BackupType
    --------                      ----------                    ----------                    ----------
       1              Payroll Dataset_vise-f6_08... 8/4/2015    11:02:32 AM                   Full Backup
       2              Payroll Dataset_vise-f6_08... 8/4/2015    11:23:17 AM

    This example displays information about a specified resource group:

    PS C:\> Get-SmResourceGroup
    
        Description                 :
        CreationTime                : 10/10/2016 4:45:53 PM
        ModificationTime            : 10/10/2016 4:45:53 PM
        EnableEmail                 : False
        EmailSMTPServer             :
        EmailFrom                   :
        EmailTo                     :
        EmailSubject                :
        EnableSysLog                : False
        ProtectionGroupType         : Backup
        EnableAsupOnFailure         : False
        Policies                    : {}
        HostResourceMaping          : {}
        Configuration               : SMCoreContracts.SmCloneConfiguration
        LastBackupStatus            : Completed
        VerificationServer          :
        EmailBody                   :
        EmailNotificationPreference : Never
        VerificationServerInfo      :
        SchedulerSQLInstance        :
        CustomText                  :
        CustomSnapshotFormat        :
        SearchResources             : False
        ByPassCredential            : False
        IsCustomSnapshot            :
        MaintenanceStatus           : Production
        PluginProtectionGroupTypes  : {SMSQL}
        Tag                         :
        IsInternal                  : False
        EnableEmailAttachment       : False
        VerificationSettings        : {}
        Name                        : NFS_DB
        Type                        : Group
        Id                          : 2
        Host                        :
        UserName                    :
        Passphrase                  :
        Deleted                     : False
        Auth                        : SMCoreContracts.SmAuth
        IsClone                     : False
        CloneLevel                  : 0
        Hosts                       :
        StorageName                 :
        ResourceGroupNames          :
        PolicyNames                 :
    
        Description                 :
        CreationTime                : 10/10/2016 4:51:36 PM
        ModificationTime            : 10/10/2016 5:27:57 PM
        EnableEmail                 : False
        EmailSMTPServer             :
        EmailFrom                   :
        EmailTo                     :
        EmailSubject                :
        EnableSysLog                : False
        ProtectionGroupType         : Backup
        EnableAsupOnFailure         : False
        Policies                    : {}
        HostResourceMaping          : {}
        Configuration               : SMCoreContracts.SmCloneConfiguration
        LastBackupStatus            : Failed
        VerificationServer          :
        EmailBody                   :
        EmailNotificationPreference : Never
        VerificationServerInfo      :
        SchedulerSQLInstance        :
        CustomText                  :
        CustomSnapshotFormat        :
        SearchResources             : False
        ByPassRunAs                 : False
        IsCustomSnapshot            :
        MaintenanceStatus           : Production
        PluginProtectionGroupTypes  : {SMSQL}
        Tag                         :
        IsInternal                  : False
        EnableEmailAttachment       : False
        VerificationSettings        : {}
        Name                        : Test
        Type                        : Group
        Id                          : 3
        Host                        :
        UserName                    :
        Passphrase                  :
        Deleted                     : False
        Auth                        : SMCoreContracts.SmAuth
        IsClone                     : False
        CloneLevel                  : 0
        Hosts                       :
        StorageName                 :
        ResourceGroupNames          :
        PolicyNames                 :
  3. Initiate a clone operation from a clone resource group or an existing backup using the New-SmClone cmdlet.

    This example creates a clone from a specified backup with all logs:

    New-SmClone -BackupName Verify_delete_clone_on_qtree_windows_scc54_10-04-2016_19.05.48.0886 -Resources @{"Host"="scc54.sccore.test.com";"Uid"="QTREE1"}  -
    CloneToInstance scc54.sccore.test.com -Suffix '_QtreeCloneWin9'  -AutoAssignMountPoint -AppPluginCode 'DummyPlugin' -initiatorname 'iqn.1991-
    05.com.microsoft:scc54.sccore.test.com' -igroupprotocol 'mixed'
  4. View the status of the clone job by using the Get-SmCloneReport cmdlet.

    This example displays a clone report for the specified job ID:

    PS C:\> Get-SmCloneReport -JobId 186
    
        SmCloneId           : 1
        SmJobId             : 186
        StartDateTime       : 8/3/2015 2:43:02 PM
        EndDateTime         : 8/3/2015 2:44:08 PM
        Duration            : 00:01:06.6760000
        Status              : Completed
        ProtectionGroupName : Draper
        SmProtectionGroupId : 4
        PolicyName          : OnDemand_Clone
        SmPolicyId          : 4
        BackupPolicyName    : OnDemand_Full_Log
        SmBackupPolicyId    : 1
        CloneHostName       : SCSPR0054212005.mycompany.com
        CloneHostId         : 4
        CloneName           : Draper__clone__08-03-2015_14.43.53
        SourceResources     : {Don, Betty, Bobby, Sally}
        ClonedResources     : {Don_DRAPER, Betty_DRAPER, Bobby_DRAPER, Sally_DRAPER}
        SmJobError          :