3PAR Users Group

A Storage Administrator Community

Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: Scripts to snap VMs then snap array for vmware
PostPosted: Fri Jul 25, 2014 11:44 am 

Joined: Sun Jul 29, 2012 9:30 am
Posts: 576
I use this script to backup up over 700 VMs every night by snapping the VMs then snapping the array. Use at your own risk. It sues password file for the 3par CLI. You point it at a cluster and it will enumerate datastores and then one datastore at a time enumerate VMs and snap them then snap array and finally discard the VM snap.
There is an option to pass a duration on hor long the array snap will last before expiring so the array will do automatic cleanup.

There is an option dsfilter switch that allows you to only target datastores that match the filter. We use this since some datastores like our templates and SRM datastore are presented to all clusters and we do not want them snapped. We are very structured in our naming conventions so the filter works well. As an example we name all our datastores as aaaa:eee:nnnn where aaaa is the array name, eee is the cluster name and nnn is the datastore name. The script requires that you follow that format as it will parse the DS name and look at the last section and will expect there to be a volume on the array that contains that in its name. If you look at the function SnapArray you can modify that to fit your own naming enumeration.

We snap every datastore 7 days a week and retain the array snaps for 14 days. This process has been a huge success because recovery times are usually in <15min. Most traditional backup products will take forever to recover a VM. True this mans the recovery is a manual process and requires storage people to be involved, but my team is viirtualization and storage so there is no politics involved.

The recovery process we use is to pick the snap needed, preset a r/w copy to the cluster then browse the datastore of that snap and add the VM to inventory, power it up and then storage migrate it to the proper volume. When complete, remove the presented snap and clean up.

Script requires Powershell and PowerCLI as well as 3par CLI

vmsnaps-ds.txt [8.83 KiB]
Downloaded 1198 times
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

Who is online

Users browsing this forum: No registered users and 1 guest

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group | DVGFX2 by: Matt