Skip to content

Latest commit

 

History

History
91 lines (79 loc) · 3.49 KB

back-up-clusters-using-powershell-cmdlets-postgresql.adoc

File metadata and controls

91 lines (79 loc) · 3.49 KB
permalink sidebar keywords summary
protect-postgresql/back-up-clusters-using-powershell-cmdlets-postgresql.html
sidebar
SnapCenter Plug-in for PostgreSQL
Backing up a cluster includes establishing a connection with the SnapCenter Server, adding resources, adding a policy, creating a backup resource group, and backing up.

Back up clusters using PowerShell cmdlets

Backing up a cluster includes establishing a connection with the SnapCenter Server, adding resources, adding a policy, creating a backup resource group, and backing up.

Before you begin
  • You must have prepared the PowerShell environment to execute the PowerShell cmdlets.

  • You must have added the storage system connection and created a credential.

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

    PS C:\> Open-SmConnection

    The username and password prompt is displayed.

  2. Add manual resources by using the Add-SmResources cmdlet.

    This example shows how to add a PostgreSQL instance:

    PS C:\> Add-SmResource -HostName 10.32.212.13 -PluginCode PostgreSQL -ResourceType Instance -ResourceName postgresqlinst1 -StorageFootPrint (@{"VolumeName"="winpostgresql01_data01";"LUNName"="winpostgresql01_data01";"StorageSystem"="scsnfssvm"}) -MountPoints "D:\"
  3. Create a backup policy by using the Add-SmPolicy cmdlet.

  4. Protect the resource or add a new resource group to SnapCenter by using the Add-SmResourceGroup cmdlet.

  5. Initiate a new backup job by using the New-SmBackup cmdlet.

    This example shows how to backup a resource group:

    C:\PS> New-SMBackup -ResourceGroupName 'ResourceGroup_wback-up-clusters-using-powershell-cmdlets-postgresql.adocith_Resources'  -Policy postgresql_policy1

    This example backs up a protected resource:

    C:\PS> New-SMBackup -Resources @{"Host"="10.232.204.42";"Uid"="MDC\SID";"PluginName"="postgresql"} -Policy postgresql_policy2
  6. Monitor the job status (running, completed, or failed) by using the Get-smJobSummaryReport cmdlet.

    PS C:\> Get-smJobSummaryReport -JobID 123
  7. Monitor the backup job details like backup ID, backup name to perform restore or clone operation by using the Get-SmBackupReport cmdlet.

    PS C:\> Get-SmBackupReport -JobId 351
    Output:
    BackedUpObjects           : {DB1}
    FailedObjects             : {}
    IsScheduled               : False
    HasMetadata               : False
    SmBackupId                : 269
    SmJobId                   : 2361
    StartDateTime             : 10/4/2016 11:20:45 PM
    EndDateTime               : 10/4/2016 11:21:32 PM
    Duration                  : 00:00:46.2536470
    CreatedDateTime           : 10/4/2016 11:21:09 PM
    Status                    : Completed
    ProtectionGroupName       : Verify_ASUP_Message_windows
    SmProtectionGroupId       : 211
    PolicyName                : test2
    SmPolicyId                : 20
    BackupName                : Verify_ASUP_Message_windows_scc54_10-04-2016_23.20.46.2758
    VerificationStatus        : NotVerified
    VerificationStatuses      :
    SmJobError                :
    BackupType                : SCC_BACKUP
    CatalogingStatus          : NotApplicable
    CatalogingStatuses        :
    ReportDataCreatedDateTime :

The information regarding the parameters that can be used with the cmdlet and their descriptions can be obtained by running Get-Help command_name. Alternatively, you can also refer to the SnapCenter Software Cmdlet Reference Guide.