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:
- Checks to see if backup already exist in the destination OmniStack Cluster,
- If the backup is already in the destination OmniStack Cluster it moves on to the next backup.
- The copy task is monitored until completed. If the task fails an error is displayed and the script moves on to the next backup.
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.