Skip to main content
SnapCenter 4.7 cmdlets

Add-SmProtectResource

Contributors

Protects a resource so that it is available for backup, restore and clone.

Syntax

Add-SmProtectResource [-ArchivedLocators]  <Hashtable[]>  [-PluginCode]  <PluginCode>  [-EnableEmail]  <>  [-EmailPreference]  <SmEmailNotificationPreference>

Detailed Description

Protects a resource so that it is available for backup, restore and clone.

Parameters

Name Description Required? Pipeline Input Default Value

ArchivedLocators

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

false

true (ByPropertyName)

PluginCode

Specifies the plug-in code of the host for which you are creating a backup resource group. Valid values are SCSQL, SCW, and SCO.

true

true (ByPropertyName)

EnableEmail

Specifies whether to enable or disable email.

false

false

EmailPreference

Specifies when you will receive e-mail notifications.Possible values: Always, Never, OnError, OnErrorOrWarning.

false

false

Resources

Specifies the resource you want to protect. You mustprovide the resource information in a key value format, and itmustcontain the resource name, type, and the host on which it islocated.For example, -Resources@{"Host"="host.example.com";"Type"="SQL Database";"Names"="NB-MVA-DEV054\newdb"} For Oracle Database, the format is -Resources @{"Host"="host.example.com";"Oracle Database"="db"}. For Oracle Application Volume, the format is -Resources @{"Host"="host.example.com";"Application Volume"="appVol"}.

true

true (ByPropertyName)

Description

Provides an optional description of the resource to beprotected.

false

true (ByPropertyName)

Tag

Enables you to apply a unique tag to help identify the resources. For example, you can add the tag "HR" to multiple resource groups. You can later search for all resource groups with the "HR" tag.

false

true (ByPropertyName)

Policies

Specifies the list of policies associated with the resource group. Multiple policies can be added as a comma-separated list.

false

true (ByPropertyName)

SchedulerCredentialName

false

true (ByPropertyName)

SchedulerInstance

Specifies the SQL Server Instance where the schedule is created and managed. This is mandatory if the policy has SQL scheduler enabled.

false

true (ByPropertyName)

VerificationServers

Specifies the list of verification servers to be associated with the resource group. Multiple verification servers can be added as a comma-separated list. This parameter is only required when you want to verify backups for SnapCenter Plug-in for Microsoft SQL Server resource groups.

false

true (ByPropertyName)

CustomSnapshotFormat

Specifies that you want to use a custom Snapshot copy naming format. By default, a timestamp is appended to the Snapshot copy name. Valid values for CustomSnapshotFormat are : $ResourceGroup, $Policy, $HostName, $ScheduleType, $CustomText

false

true (ByPropertyName)

CustomText

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

false

true (ByPropertyName)

DeleteBackupForDetachPolicies

false

true (ByPropertyName)

Schedules

Specifies the schedule parameters to be used in the resource group. Schedule parameters can include the policy name, schedule type, schedule start and end times. You can specify multiple schedules in a comma-separated list, for example:-Schedules @{"PolicyName"="BackupPolicy";"ScheduleType"="OneTime"}, @{"PolicyName"="BackupPolicy";"ScheduleType"="Hourly";"StartTime"=" 05/27/2016 6:13 PM";"EndTime"="'05/27/2016 6:30 PM'"}

false

true (ByPropertyName)

SchedulerType

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

false

true (ByPropertyName)

VerificationSchedules

Specifies the verification schedules you want to add to the resource. The verification schedule includes the following parameters:"VerificationType" which defines if and when verification is performed. The following values are available:VERIFY_SCHEDULEDVERIFY_AFTER_BACKUPNONE"ScheduleType" represents the schedule type for the verification."BackupScheduleType" represents the schedule type for the backup-VerificationServers "WIN-DVGQDI73QR6" needs to be provided in the above command if we are creating verification enabled resource group for SCSQL plugin.

false

true (ByPropertyName)

BackupArchiveLogsAfterRecentMissingOne

This option is only valid for SCO plugin code. Specifies that you want to backup archive log files, which are created after the most recent missing archive log files and ignore the files created prior to it. If this option is not specified, then all archive log files except the missing archive log files are be backed up.

false

true (ByPropertyName)

ExcludeArchiveLogPathsFromBackup

This option is only valid for SCO plugin code. Specifies the archive log destinations to be excluded from backup. Archive log files present in the specified destinations will be excluded during log backup. Multiple entries can be specified using comma separated list. For example: -ExcludeArchiveLogPathsFromBackup '/arch/logs/on/local/disk1, /arch/logs/on/local/disk2'.

false

true (ByPropertyName)

ConsistencyGroupSnapshot

false

true (ByPropertyName)

ConsistencyGroupWaflSync

false

true (ByPropertyName)

ConsistencyGroupTimeOut

false

true (ByPropertyName)

SnapShotCreateCommand

false

true (ByPropertyName)

UseFileSystemConsistentSnapshot

false

true (ByPropertyName)

UseSnapcenterWithoutFileSystemConsistency

false

true (ByPropertyName)

PreAppQuiesceCmd

false

true (ByPropertyName)

PostAppQuiesceCmd

false

true (ByPropertyName)

AppQuiesceCmd

false

true (ByPropertyName)

AppUnQuiesceCmd

false

true (ByPropertyName)

PreAppUnQuiesceCmd

false

true (ByPropertyName)

PostAppUnQuiesceCmd

false

true (ByPropertyName)

PreExitCmd

false

true (ByPropertyName)

PreSnapshotCmd

false

true (ByPropertyName)

PostSnapshotCmd

false

true (ByPropertyName)

AppIgnoreError

false

true (ByPropertyName)

UseExternalSnapShot

false

true (ByPropertyName)

ExternalSnapshotRegex

false

true (ByPropertyName)

ConfigParams

false

true (ByPropertyName)

Examples

Example 1: Protecting a resource

 Add-SmProtectResource -PluginCode SCSQL  -Policies BackupPolicy -Resources @{"Host"="host.example.com";"Type"="SQL Database";"Names"="NB-MVA-DEV054\newdb"} -Description test -EnableAsupOnFailure -Schedules @{"PolicyName"="p2";"ScheduleType"="Monthly";"daysOfTheMonth"="31";"monthsOfTheYear"="August,September";} -SchedulerRunAsName Administrator -SchedulerType Windows

This example syntax protects a resource.

Example 2: Protecting a resource with hourly backup policy

 Add-SmProtectResource -PluginCode SCSQL -Policies BackupPolicy
          -Resources @{"Host"="host.example.com";"Type"="SQL Database";"Names"="NBMVA-DEV054\newdb"} -Description test -EnableAsupOnFailure -schedules @{"PolicyName"="BackupPolicy";"StartTime"="05/21/2019 7:54 PM";"EndTime"="05/21/2019 8:03 PM";"ScheduleType"="Hourly";"RepeatTask_Every_Hour"="03:00"} -SchedulerType Windows

Example 3: Protecting a resource with daily backup policy

 Add-SmProtectResource -PluginCode SCSQL -Policies BackupPolicy
          -Resources @{"Host"="host.example.com";"Type"="SQL Database";"Names"="NBMVA-DEV054\newdb"} -Description test -EnableAsupOnFailure -schedules @{"PolicyName"="BackupPolicy";"StartTime"="05/21/2019 8:09 PM";"EndTime"="05/21/2019 9:18 PM";"ScheduleType"="Daily";"daysInterval"="1"} -SchedulerType Windows

Example 4: Protecting a resource with weekly backup policy

 Add-SmProtectResource -PluginCode SCSQL -Policies BackupPolicy
          -Resources @{"Host"="host.example.com";"Type"="SQL Database";"Names"="NBMVA-DEV054\newdb"} -Description test -EnableAsupOnFailure -schedules @{"PolicyName"="BackupPolicy";"StartTime"="05/21/2019 8:24 PM";"EndTime"="05/21/2019 8:41 PM";"ScheduleType"="Weekly";"DaysOfTheWeek"="Tuesday"} -SchedulerType Windows

Example 5: Protecting a resource with monthly backup policy

 Add-SmProtectResource -PluginCode SCSQL -Policies BackupPolicy
          -Resources @{"Host"="host.example.com";"Type"="SQL Database";"Names"="NBMVA-DEV054\newdb"} -Description test -EnableAsupOnFailure -schedules @{"PolicyName"="BackupPolicy";"StartTime"="05/21/2019 8:51 PM";"EndTime"="05/21/2019 9:18 PM";"ScheduleType"="Monthly";"MonthsOfTheYear"="May,June";"daysOfTheMonth"="21,26,16"} -SchedulerType Windows

Example 6: Protecting a HANA resource

 Add-SmProtectResource -PluginCode hana -Resources @{"Host"="schana02.gdl.englab.netapp.com";"Uid"="MDC\R57"} -Policies "HANAPOLICY"

This example protects a resource.

Tag :
ByPassRunAs : False
Configuration   : SMCoreContracts.SmConfiguration
CreationTime: 02-Oct-19 21:47:16
CustomSnapshotFormat:
CustomText  :
Description :
EmailBody   :
EmailFrom   :
EmailNotificationPreference :
EmailSMTPServer :
EmailSubject:
EmailTo :
EnableAsupOnFailure :
EnableEmail :
EnableSysLog:
HostResourceMaping  : {}
IsCustomSnapshot:
LastBackupStatus:
MaintenanceStatus   : Production
ModificationTime: 02-Oct-19 21:47:16
PluginProtectionGroupTypes  : {hana}
Policies: {}
ProtectionGroupType : Backup
SchedulerSQLInstance:
SearchResources : False
VerificationServer  :
VerificationServerInfo  : SMCoreContracts.SmVerificationServerInfo
Name: schana02_gdl_englab_netapp_com_hana_MDC_R57
Type: Group
Id  : 2
Host:
UserName:
Passphrase  :
Deleted : False
Auth: SMCoreContracts.SmAuth
IsClone : False
CloneLevel  : 0
Hosts   : {}
StorageName :
ResourceGroupNames  :
PolicyNames :
Key : 0
NsmObjectID : 0

Example 7: Protecting an Oracle Application Volume resource

 Add-SmProtectResource -PluginCode SCO -Resources @{"Host"="R8092776CF4V1.HNK2.com";"Application Volume"="appVol"} -Policies "appVolPolicy"

This example protects an Oracle application volume resource named appVol.

Description :
			CreationTime: 11/4/2021 4:41:46 AM
			ModificationTime: 11/4/2021 4:41:46 AM
			EnableEmail :
			EmailSMTPServer :
			EmailFrom   :
			EmailTo :
			EmailSubject:
			EnableSysLog:
			ProtectionGroupType : Backup
			EnableAsupOnFailure :
			Policies: {}
			HostResourceMaping  : {}
			Configuration   : SMCoreContracts.SmConfiguration
			LastBackupStatus:
			VerificationServer  :
			EmailBody   :
			EmailNotificationPreference :
			VerificationServerInfo  : SMCoreContracts.SmVerificationServerInfo
			SchedulerSQLInstance:
			CustomText  :
			CustomSnapshotFormat:
			SearchResources : False
			ByPassRunAs : False
			IsCustomSnapshot:
			MaintenanceStatus   : Production
			PluginProtectionGroupTypes  : {SCO}
			Tag :
			IsInternal  : True
			EnableEmailAttachment   :
			VerificationSettings: {}
			BackupServers   : {}
			EnableRecentSnapshotNaming  :
			Name: R8092776CF4V1_HNK2_com_appVol
			Type: Group
			Id  : 178
			Host:
			UserName:
			Passphrase  :
			Deleted : False
			Auth: SMCoreContracts.SmAuth
			IsClone : False
			CloneLevel  : 0
			Hosts   : {}
			StorageName :
			ResourceGroupNames  :
			PolicyNames :
			Key : 0
			NsmObjectID : 0
			SizeOfSmObject  : SMCoreContracts.SmObjectSize

Example 8: Protecting an Oracle Database resource

 Add-SmProtectResource -PluginCode SCO -Resources @{"Host"="R8092776CF4V1.HNK2.com";"Oracle Database"="DB16"} -Policies "dbPolicy"

This example protects an Oracle database resource named DB16.

Description :
			CreationTime: 11/4/2021 5:05:51 AM
			ModificationTime: 11/4/2021 5:05:51 AM
			EnableEmail :
			EmailSMTPServer :
			EmailFrom   :
			EmailTo :
			EmailSubject:
			EnableSysLog:
			ProtectionGroupType : Backup
			EnableAsupOnFailure :
			Policies: {}
			HostResourceMaping  : {}
			Configuration   : SMCoreContracts.SmConfiguration
			LastBackupStatus:
			VerificationServer  :
			EmailBody   :
			EmailNotificationPreference :
			VerificationServerInfo  : SMCoreContracts.SmVerificationServerInfo
			SchedulerSQLInstance:
			CustomText  :
			CustomSnapshotFormat:
			SearchResources : False
			ByPassRunAs : False
			IsCustomSnapshot:
			MaintenanceStatus   : Production
			PluginProtectionGroupTypes  : {SCO}
			Tag :
			IsInternal  : True
			EnableEmailAttachment   :
			VerificationSettings: {}
			BackupServers   : {}
			EnableRecentSnapshotNaming  :
			Name: R8092776CF4V1_HNK2_com_DB16
			Type: Group
			Id  : 179
			Host:
			UserName:
			Passphrase  :
			Deleted : False
			Auth: SMCoreContracts.SmAuth
			IsClone : False
			CloneLevel  : 0
			Hosts   : {}
			StorageName :
			ResourceGroupNames  :
			PolicyNames :
			Key : 0
			NsmObjectID : 0
			SizeOfSmObject  : SMCoreContracts.SmObjectSize