Skip to main content
SnapCenter 5.0 cmdlets

Add-SmCloneJob

Contributors

Creates a new clone job.

Syntax

Add-SmCloneJob [-CloneJobName]  <String>  [-PluginCode]  <PluginCode>  [-CloneToInstance]  <String>  [-CloneToHost]  <String>  [-Description]  <String>  [-ResourceGroupName]  <String>  [-Resources]  <Hashtable[]>  [-EnableAsupOnFailure]  <Boolean>  [-EnableSysLog]  <Boolean>  [-EnableEmail]  <>  [-EmailPreference]  <SmEmailNotificationPreference>

Detailed Description

Creates a new clone job for the resource group.You can do the following to the clone job: add resources, define specific schedule policy, attach policies, set notification settings for Event Management System (EMS) logs, AutoSupport, send Email notification, specify clone options including clone type and instance, mount options, attach a suffix to the clone job name. Specify the secondary location if you are cloning to a SnapMirror or SnapVault destination.

Parameters

Name Description Required? Pipeline Input Default Value

CloneJobName

Specifies the name of the clone job.

true

true (ByPropertyName)

PluginCode

Specifies the plug-in code of the host for which you are creating a clone job. Valid values are SCSQL and SCO.

true

true (ByPropertyName)

CloneToInstance

Specifies the SQL Server instance that you want to clone to. All databases in the clone resource group are cloned to this instance.

true

true (ByPropertyName)

CloneToHost

Specifies the host to which you are cloning.

true

true (ByPropertyName)

Description

Provides an optional description of the clone job you are creating.

false

true (ByPropertyName)

ResourceGroupName

Provides an optional description of the clone job you are creating.

false

true (ByPropertyName)

Resources

Specifies the resources you want to add to the clone resource group.You must provide the resource information in a hashtable, and it must contain the resource name and type, as well as the host on which the resource is located. For example,@{"Host"="localhost";"Type"="SQL Database";"Names"="Instance\Database"}Valid Type values are SQL Database and Oracle Database.You can include comma-separated values for Names.

false

true (ByPropertyName)

EnableAsupOnFailure

Specifies whether to enable or disable AutoSupport on failure.

false

true (ByPropertyName)

EnableSysLog

Specifies whether to enable or disable sys log in the storage system.

false

true (ByPropertyName)

EnableEmail

Specifies whether to enable or disable email notifications.

false

false

EmailPreference

Specifies when you will receive email notifications.Possible values: Always, Never, OnError, OnErrorOrWarning.

false

false

AutoAssignMountPoint

Specifies that the file system mount point is assigned automatically.

false

true (ByPropertyName)

AssignMountPointUnderPath

Specifies that the file system mount point is created automatically under the specified mount path.

false

true (ByPropertyName)

CloneType

false

true (ByPropertyName)

Suffix

Provides a clone job name suffix. The clone job you create is appended with the suffix name.

false

true (ByPropertyName)

ArchivedLocators

Specifies the secondary storage system details for each of the unique primary storage system resource in the dataset. For example:-ArchivedLocators @{Primary="my_vs1:my_vol_iscsi";Secondary="my_vs1:my_vol_iscsi_SECONDARY"}

false

true (ByPropertyName)

CustomSnapShotFomat

Specifies the custom Snapshot copy naming format. For example, -CustomSnapShotFomat '$CustomText$ResourceGroup$Policy$HostName' -CustomText NetApp

false

true (ByPropertyName)

CustomText

Specifies the custom text in the custom Snapshot copy naming format.

false

true (ByPropertyName)

SchedulerCredentialName

false

true (ByPropertyName)

Schedules

Specifies in a hastable the schedule for the clone job, including the policy name and the schedule type. For example, -Schedules @{"PolicyName"="BackupPolicy";"ScheduleType"="OneTime"}You can specify multiple schedules in a comma-separated list.

false

true (ByPropertyName)

SchedulerType

Specifies the scheduler type. Possible values are Windows, SQL, and None.

false

true (ByPropertyName)

SchedulerInstance

false

true (ByPropertyName)

DeleteCloneOnScheduleExpiry

Specifies that the clone be deleted when the scheduled expiration time is reached.

false

true (ByPropertyName)

PreScriptCommand

Prescript file UNC path with proper privileges for scripts accessibility, (‘\\\\server\\share\path\\file’ for Universal Naming Convention (UNC) names).

false

true (ByPropertyName)

PreScriptArguments

Specifies the prescript arguments.

false

true (ByPropertyName)

PostScriptCommand

Postscript file UNC path with proper privileges for scripts accessibility, (‘\\\\server\\share\path\\file’ for Universal Naming Convention (UNC) names).

false

true (ByPropertyName)

PostScriptArguments

Specifies postscript arguments.

false

true (ByPropertyName)

ScriptTimeOut

Specifies the number of seconds before a script times out. The default is 60 seconds.

false

true (ByPropertyName)

EmailBody

Specifies the body of the email.

false

true (ByPropertyName)

EmailFrom

Specifies the sender's email address.

true

true (ByPropertyName)

EmailTo

Specifies the recipient's email address.

true

true (ByPropertyName)

EmailSubject

Specifies the subject of the email.

true

true (ByPropertyName)

EnableEmailAttachment

Specifies whether you are adding an email attachment.

false

true (ByPropertyName)

Examples

Example 1: Adding a new clone job

 Add-SmCloneJob -CloneJobName TestCLM1  -PluginCode SCSQL -CloneToInstance "CsmDevSuman\INST1" -CloneToHost host.example.com -Description 'testing clm'
          -Resources @{"Host"="CsmDevSuman";"Type"="SQL Database";"Names"="CsmDevSuman\INST1\TrialDB"} -Suffix "_Clone_July_12" -AutoAssignMountPoint

Example 2: Creating a clone job with hourly schedule policy

 Add-SmCloneJob -Resources @{"Host"="Cluster50176661";"Type"="SQL Database";"Names"="SQL12050176661\CLUSINST1\Cluster50176661_MDML_4"} -CloneJobName 'CloneJob_08767' -PluginCode 'SCSQL' -CloneToInstance 'SQL12050176661\CLUSINST1' -CloneToHost 'Cluster50176661' -autoassignmountpoint  -suffix '_Clone_08767' -schedulertype 'Windows' -schedules @{"ScheduleType"="Hourly";"StartTime"="05/30/2019 6:00 AM";"EndTime"="05/30/2019 8:57 AM";"RepeatTask_Every_Hour"="01:00"}

Example 3: Creating a clone job with daily schedule policy

 Add-SmCloneJob -Resources @{"Host"="Cluster50176661";"Type"="SQL Database";"Names"="SQL12050176661\CLUSINST1\Cluster50176661_MDSL_4"} -CloneJobName 'CloneJob_00970' -PluginCode 'SCSQL' -CloneToInstance 'SQL12050176661\CLUSINST1' -CloneToHost 'Cluster50176661' -suffix '_Clone_00970' -archivedlocators @{Primary="10.225.85.167:QA12050176661_1_MDSL_Data_Log_Vol";Secondary="C_84_173_CIT_SVM_2:QA12050176661_1_MDSL_Data_Log_Vol_SV"} -schedulertype 'Windows' -assignmountpointunderpath 'D:\MSSQL11.CLUSINST1\MSSQL\DATA\Clone10971' -schedules @{"ScheduleType"="Daily";"StartTime"="05/30/2019 6:25 AM";"EndTime"="05/30/2019 9:22 AM";"daysInterval"="1"} -clonetype 1

Example 4: Creating a clone job with weekly schedule policy

 Add-SmCloneJob -Resources @{"Host"="Cluster50176661";"Type"="SQL Database";"Names"="SQL12050176661\CLUSINST1\Cluster50176661_MDML_4"} -CloneJobName 'CloneJob_54758' -PluginCode 'SCSQL' -CloneToInstance 'SQL12050176661\CLUSINST1' -CloneToHost 'Cluster50176661' -autoassignmountpoint  -suffix '_Clone_54758' -schedulertype 'Windows' -schedules @{"ScheduleType"="Weekly";"StartTime"="05/30/2019 6:30 AM";"EndTime"="05/30/2019 9:27 AM";"DaysOfTheWeek"="Thursday,Saturday"}

Example 5: Creating a clone job with monthly schedule policy

 Add-SmCloneJob -Resources @{"Host"="Cluster50176661";"Type"="SQL Database";"Names"="SQL12050176661\CLUSINST1\Cluster50176661_MDML_4"} -CloneJobName 'CloneJob_02494' -PluginCode 'SCSQL' -CloneToInstance 'SQL12050176661\CLUSINST1' -CloneToHost 'Cluster50176661' -suffix '_Clone_02494' -assignmountpointunderpath 'D:\MSSQL11.CLUSINST1\MSSQL\DATA\Clone10971' -schedulertype 'Windows' -schedules @{"ScheduleType"="Monthly";"StartTime"="05/30/2019 6:40 AM";"EndTime"="05/30/2019 9:37 AM";"MonthsofTheYear"="May,June";"DaysoftheMonth"="30,4,25"}