Manage the SnapCenter Server repository
Information related to various operations performed from SnapCenter is stored in the SnapCenter Server database repository. You must create backups of the repository to protect the SnapCenter Server from data loss.
The SnapCenter Server repository is sometimes referred to as the NSM database. Refer to the SnapCenter Software Cmdlet Reference Guide for details of all available cmdlets.
Prerequisites for protecting the SnapCenter repository
Your environment should meet certain prerequisites to protect the SnapCenter repository.
-
Managing storage virtual machine (SVM) connections
You should configure the storage credentials.
-
Provisioning hosts
At least one NetApp storage disk should be present on the SnapCenter repository host. If a NetApp disk is not present on the SnapCenter repository host, you must create one.
For details about adding hosts, setting up SVM connections, and provisioning hosts, see the installation instructions.
-
Provisioning iSCSI LUN or VMDK
For high availability (HA) configuration, you can provision either a iSCSI LUN or a VMDK in one of the SnapCenter Servers.
Back up the SnapCenter repository
Backing up the SnapCenter Server repository helps protect it from data loss. You can back up the repository by running the Protect-SmRepository cmdlet.
The Protect-SmRepository cmdlet accomplishes the following tasks:
-
Creates a resource group and a policy
-
Creates a backup schedule for the SnapCenter repository
-
Launch PowerShell.
-
On the SnapCenter Server host, establish a session using the
Open-SmConnectioncmdlet, and enter your credentials. -
Back up the repository using the
Protect-SmRepositorycmdlet that takes the following required parameters:-
-HostName (String): Specifies the hostname of the server where the SnapCenter repository is located. -
-Path (String): Specifies the file system path on the NetApp storage system where the repository backups are stored. -
-Schedule (Hashtable): Defines the schedule for the repository backup. It is typically defined as a hashtable. -
-RetentionCount (Int32): Specifies the number of repository backups to retain. When the number of backups exceeds this count, the oldest backup is deleted.
-
View backups of the SnapCenter repository
You can display a list of SnapCenter Server database repository backups by running the Get-SmRepositoryBackups cmdlet. Refer to the SnapCenter Software Cmdlet Reference Guide - Get-SmRepositoryBackups for details.
The repository backups are created according to the schedule specified in the Protect-SmRepository cmdlet.
-
Launch PowerShell.
-
From the command prompt, enter the
Open-SmConnectioncmdlet, and provide credentials to connect to the SnapCenter Server. -
List all available SnapCenter database backups using the
Get-SmRepositoryBackupscmdlet.
Restore the SnapCenter database repository
You can restore the SnapCenter repository by running the Restore-SmRepositoryBackup cmdlet.
When you are restoring the SnapCenter repository, other SnapCenter operations that are running are impacted because during the restore operation the repository database is not accessible.
-
Launch PowerShell.
-
From the command prompt, enter the
Open-SmConnectioncmdlet, and provide credentials to connect to the SnapCenter Server. -
Restore the repository backup using the
Restore-SmRepositoryBackupcmdlet.The following cmdlet restores the SnapCenter MySQL database repository from the backups existing on either iSCSI LUN or VMDK:
C:\PS>Restore-SmRepositoryBackup -BackupName MYSQL_DS_SC_Repository_mva-x3550-s09_09-15-2016_10.32.00.4445
The following cmdlet restores the SnapCenter MySQL database when backup files are deleted accidentally in the iSCSI LUN. For VMDK manually restore the backup from ONTAP snapshots.
C:\PS>Restore-SmRepositoryBackup -BackupName MYSQL_DS_SC_Repository_mva-x3550-s09_09-15-2016_10.32.00.4445 -RestoreFileSystem
|
|
The backup that was used to perform the repository restore operation will not be listed when the repository backups are retrieved after performing the restore operation. |
Migrate the SnapCenter repository
You can migrate the SnapCenter Server database repository from the default location to another disk. You might migrate the repository when you want to relocate it to a disk with more space.
-
Stop the MYSQL57 service in Windows.
-
Locate the MySQL data directory.
You can usually find the data directory at C:\ProgramData\MySQL\MySQL Server 5.7\Data.
-
Copy the MySQL data directory to the new location, for example, E:\Data\nsm.
-
Right click on the new directory, and then select Properties > Security to add the Network Service local server account to the new directory, and then assign the account full control.
-
Rename the original database directory, for example, nsm_copy.
-
From a Windows command prompt, create a symbolic directory link by using the mklink command.
"mklink /d "C:\ProgramData\MySQL\MySQL Server 5.7\Data\nsm" "E:\Data\nsm" " -
Start the MYSQL57 service in Windows.
-
Verify that the database location change is successful by logging in to SnapCenter and checking repository entries, or by logging in to the MySQL utility and connecting to the new repository.
-
Delete the original, renamed, database repository directory (nsm_copy).
Reset the SnapCenter repository password
The MySQL Server repository database password is automatically generated during SnapCenter Server installation from SnapCenter 4.2. This automatically generated password is not known to SnapCenter user at any point. If you want to access the repository database, you should reset the password.
You should have the SnapCenter administrator privileges to reset the password.
-
Launch PowerShell.
-
From the command prompt, enter the
Open-SmConnectioncmdlet, and provide credentials to connect to the SnapCenter Server. -
Reset the repository password using the
Set-SmRepositoryPasswordcmdlet.The following command resets the repository password:
Set-SmRepositoryPassword at command pipeline position 1 Supply values for the following parameters: NewPassword: ******** ConfirmPassword: ******** Successfully updated the MySQL server password.
You can obtain the information regarding the parameters that you can use with the cmdlet and their descriptions by running the Get-Help command_name command. Alternatively, you can refer to the SnapCenter Software Cmdlet Reference Guide.