I am trying to understand how I can backup a SMHV backup/snapshot to tape.
We would like to configure a backup job on our backup server to always backup the volume with snapshot called (for example) "SMHV_Backup_00". However, I tried running the following PShell command just to see what it would do:
The snapshot name naming convention in SMHV is datasetName_hostname_timestamp and datasetName_hostname_timestamp_backup.
[each SMHV backup creates two snapshots including autorecovery].
You can create a post script in SMHV dataset policy to rename the snapshots mentioned earlier to the name of your choice
and then copy that to the tape.
For the post script, SMHV support passing up to three arguments to the scripts, following are the predefined variables which SMHV expects the user to pass. Administrator can pass one or all of these values in the post arguments edit box in the Policy Management wizard
During the post policy execution phase SMHV will replace the $VMSnapshot variable with the snapshot name, $SnapInfoName with the time stamp of the backup, $SnapInfoSnapshot with the snapinfo snapshot name. You can access these variables from your scripts and do the necessary actions.
Now, you tell me that through this information I can parse the snapshot name. I am not looking to do SnapMirror to Tape or similar. I am looking to rename the Snapshot to be called for example, "SMHV_Snap01", and that path will always exist in my backup server path as the snapshot I want to backup. How do I rename the snapshot from "31vm08_SMHV-HOST-31_02-03-2010_23.23.07" to "Snap01". Is there a PowerShell command Snap-Rename?
SMHV takes two snapshots on storage system as part of a backup. The second snapshot name is the first snapshot name with suffix "_backup". In order to access the VHD files in backup by mounting the snapshot, one should always use the snapshot with "_backup" suffix.
If I am backing up to tape these Snapshots - do I just need to backup the "_backup" volume snapshot? Do I need to backup the SnapInfo volume as well?
Also - you spoke about having to change the name back to the original one when transfering it back to disk. How should/could I know what the original name was? Assuming for example I would be restoring two different snapshots - one from a few days ago and another from a year ago.
You will need to backup "_backup" volume snapshot plus the base snapshot (the one without _backup suffix). Both of these snapshots are required to restore the VM itself.
SMHV also takes snapshot of SnapInfo LUN after backup. This snapshot captures the backup metadata. SMHV cannot restore a VM from backup if corresponding backup metadata is not available. So yes, it is good to back this up to tape as well.
This is going to sound a bit grough - but it seems almost impossible for someone to properly backup a SMHV backup to tape for offline storage. It sounds like I need to move these backups to SnapVault or the like.
Is there not a ready package of some sort with the entire script/batch from start to finish, with proper instructions? Is anything going to change in the next version of SMHV?
Just to end this post - and to let everyone know what I did . . .
I was told/recommended by someone who specializes in backups that it is not particularly good to always backup an entire volume via NDMP, since you have to restore the entire LUN in total to restore an individual VHD file. You cannot just select the individual VHD file. That could sometimes be problematic since you may have a 1TB LUN with CSV VM VHDs and need to restore a 8GB VM VHD.
So, we decided to use the tips you mentioned, in conjunction with SnapDrive, to do the following:
Take a snapshot of the VMs using SMHV
Output the name of the snapshot to a text file via a batch file
Run a vbscript at the end of that batch file which will mount the latest snapshot copy of this LUN onto my backup server using SDCLI (snapdrive) onto a mount point on that server
We backup the LUN snapshot as a local disk directory on my backup server
Since these files are very big we get very good performance when backing up to tape, prob. just as good as we could get if we chose NDMP (which is known not to be the most efficient)
And the nicest thing, is that we can restore an individual VHD (or even a 100k VM config file) only!
Also - I don't have to bother with renaming the SMHV snapshot, which also allows SMHV to routinely delete the older snapshots, something which currently I would have to do manually if I renamed the snapshot since SMHV wouldn't be able to find it.
You need to modify the Policy that you use with your dataset, and add the batch file below as a Post Script to run, as well as pass it the parameter $VMSnapshot. So the screen would look like:
REM Output the snapshot name to a text file echo %1 >> C:\SMHV\SnapshotNames.txt
REM Call a script to connect the snapshot to the backup server C:\SMHV\MountBackupDisk.vbs
What the script below does it mount the snapshot copy for ServerX on my backup server's Mount Point Directory ("C:\Snapshots"). For example, ServerA's snapshot would appear as "C:\Snapshots\ServerA"
that looks like a good solution if you're able to keep all of the VMs on a CSV running on a particular Hyper-V server in the cluster.
I believe you may have issues in the future, however, if VMs on a single CSV begin to shuffle between Hyper-V cluster nodes (due to performance management, outages etc), as SMHV will take separate snapshots for each Hyper-V server which is running VMs in the Dataset even if they're contained on the same CSV.
EG: (this is a greatly simplified view of my customer's environment)
* 4-node Hyper-V cluster.
* 1 x 4TB CSV LUN.
* 12 x VMs stored on the same CSV LUN.
* Each Hyper-V server in the cluster has 3 x VMs each from the CSV running on it.
* 1 x Dataset within SMHV to backup all VMs on this CSV once per day.
My customer only has a requirement to snapshot his VMs once per day.
Since SMHV takes 2 snapshots per Hyper-V server per Dataset (the base & then the "xxxxx_backup" snap), I will end up with a total of 8 snapshots for each daily SMHV backup. The problem with this situation is that there are only 3 VMs which are consistent in any one "xxxxxxxx_backup" snapshot - the other 9 VMs would be crash consistent. The other 9 VMs would be consistent within the other 3 x "xxxxxx_backup" snapshots.
This being the case you would then need to greatly complicate your post-script to determine which VMs were quiesced as part of that snapshot; only backup those VMs from your backup server; mount the snapshot for the next Hyper-V server in this Dataset and repeat the process.
I would be greatly interested if anyone has a solution to this conundrum, as I'm trying to find a way to SnapVault this environment for long-term retention. Currently the easiest option for long-term management appears to be installing OSSV on all of the VMs and have them each individually replicate to the DR site and manage with Protection Manager.