Apr 03

Copy SimpliVity Backups to another SimpliVity Cluster

Recently a fellow SA, @agoelammohamed, had a customer who deployed a new production SimpliVity cluster and was planning to decommission and re-purpose the original SimpliVity cluster. Migrating the VMs from the original cluster to the new cluster was easy enough, but they also needed to move around 700 SimpliVity backups, which need to be kept through the configured retention periods, to the new cluster. This can be done from the vSphere Web Client, but @agoelammohamed was looking to see if there was an easy way to automate this process. There is! The SimpliVity REST API includes an operation to copy backups from one OmniStack Cluster to another.

There are a couple other situations where this may come in handy, @agoelammohamed‘s is one and another could be that customer originally deployed SimpliVity for production and later added a DR site and wants to get the existing backups to the DR site.

I put together a powershell script which uses the SimpliVity REST API to automate copying backups from one OmniStack Cluster to another OmniStack Cluster. The script, SVT-CopyBackups.ps1, can be found here: https://github.com/herseyc/SVT/blob/master/SVT-CopyBackups.ps1

There are a few variables which need to be configured in the script:

$ovc = "xxx.xxx.xxx.xxx" # OVC Management IP Address
$username = "user@domain" #vCenter Username
$pass = "Password-01" #vCenter Password

# Source OmniStack Cluster to Copy Backups From
$srcOSCluster = "ProductionCluster"
# Destination OmniStack Cluster to Copy Backups to
$dstOSCluster = "DRCluster"
#Number of backups to copy
$numberBackups = "1000"
#Starting backup 
$backupStartingOffset = "0"

When the powershell script, SVT-CopyBackups.ps1, is run it first grabs all the SimpliVity backups in the source OmniStack Cluster, $srcOSCluster, up to the number configured, $numberBackups, from the offset, $backupStartingOffset. It you have 1000 backups in the source cluster and you want to copy these in two chunks run the script with the number set to 500 and the offset set to 0, then run it again with the number set to 500 and the offset set to 500. This would also allow you to run two instances of the script in parallel to copy the backups – one instance working on backups 0-499, the other working on backups 500-999.

For each backup the SimpliVity REST API is used to:

  1. Checks to see if backup already exist in the destination OmniStack Cluster, $dstOSCluster.
    • If the backup is already in the destination OmniStack Cluster it moves on to the next backup.
  2. Checks to see if the backup has a retention policy set. If so it calculates the remaining retention time in minutes from the current time.
  3. Copies the backup from the source OmniStack Cluster to the destination OmniStack Cluster.
    • The copy task is monitored until completed. If the task fails an error is displayed and the script moves on to the next backup.
  4. If the source backup has a retention period set, the calculated retention period is set on the copy.
  5. The process is repeated for each backup in the source OmniStack Cluster.

Here is an example of the output from the script:

This script copies all backups from one OmniStack Cluster to another OmniStack Cluster in a SimpliVity Global Federation. The backup copy will leverage SimpliVity’s Global Data Virtualization Platform to ensure efficient copy between clusters.

It could easily be modified to copy just the backups for a single VM. I will probably create a separate script for that as I have also received some request for that.

Hope you find this helpful. Comments or feedback always appreciated.

About the author


Hersey Cartwright is an IT professional with extensive experience designing, implementing, managing, and supporting technologies that improve business processes. Hersey is Solutions Architect for SimpliVity covering Virginia, Washington DC, and Maryland. He holds the VMware Certified Design Expert (VCDX-DV #128) certification. Hersey actively participates in the VMware community and was awarded the VMware vExpert title in 2016, 2015, 2014, 2013, and 2012. He enjoys working with, teaching, and writing about virtualization and other data center technologies. Follow Hersey on Twitter @herseyc

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

2 × two =