2010-02-03 07:04 AM
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:
New-Backup -Server ClusterServer1 -Dataset Set06 -PolicyId Set06 -BackupName BackupThisUpToTape
It created a SMHV Snapshot which I see in the SMHV console called: "Backup Name: BackupThisUpToTape_02-03-2010_16.39.50"
And the name of the Volume Snapshot is totally randomized. I cannot just schedule a volume snapshot alone to tape since I specifically need the one SMHV used to properly backup the VMs using VSS.
How can I do this, or is there a better way that I am missing to backup VMs using SMHV to tape?
Also, does this process also hold true for other products, like SM for SQL/Exchange?
2010-02-03 08:59 AM
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
1. $VMSnapshot 2. $SnapInfoName 3. $SnapInfoSnapshot
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.
2010-02-03 10:55 PM
Can you provide an example? I am lost as to what I need to put in the post script box for "Path:" and "Arguments". Do I need to put this in a batch file of sorts?
2010-02-03 11:44 PM
Attached is the screen shot of the backup wizard -> backup options page. For the post script section i added a test script "TransferbackuptoTape.bat" file and also added
arguments for the post script as follows.
parameter0 $VMSnapshot parameter1 $SnapInfoName parameter2 $SnapInfoSnapshot
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.
Following is the contents of the "TransferbackuptoTape.bat" file to show how to access the variables inside the batch file.
echo %1 %2 %3 %4 > postscriptvariables.txt
During the post policy execution these variables will be written to the postscriptvariables.txt file.
The content of this file is shown below, in this example the snapshot name consist of
the following -> SMHV dataset name "31vm08", Hyper-V parent host name "SMHV-HOST-31" the last section of the snapshotname is the timestamp.
31vm08_SMHV-HOST-31_02-03-2010_23.23.07 02-03-2010_23.23.07 smhv_snapinfo_smhv-host-31_02-03-2010_23.23.07
out of this first variable is the snapshotname, time stamp of the backup, and last one snapinfo snapshot name.
You can now use these variables to write the custom script of our choice to copy the snapshots to TAPE.
Please let us know if you have any more questions.
2010-02-04 12:55 AM
Could be that maybe I am just thick headed . . .
Question #1: Your batch file included 4 paramaters ("echo %1 %2 %3 %4") when you only mentioned three ($VMSnapshot, $SnapInfoName, $SnapInfoSnapshot)?
Question #2: The output generated by your batch was as follows:
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?
2010-02-04 08:03 AM
For the question 1 you can ommitt the last parameter %4, it was just to demonstrate parameters to the batch file.
For the question 2, We don't have a powershell to rename snapshot, but instead you can use SnapDrive CLI - SDCLI tool.
The only catch is that tool requires the mountpoint for the rename operation.
sdcli snap rename -d m:\ -o 31vm08_SMHV-HOST-31_02-03-2010_23.23.07 -n Snap01
Will it possible for you to hardcode the mount point?.
Other option is to use sdcli hyperv list command to get the list of VMs on the host, and it will also list the mountpoints of the VHDs belonging to the VMs.
you can parse through and get the mount point for the VMs of your choice.
2010-02-04 07:41 PM
Discovered one issue in using the rename approch.
The issue is that SMHV records the snapshot name in the metadata[snapinfo] of the backup.
So if the snapshot name is renamed in the storage system volume after the backup is taken
then the restore operation for that backup will fail.
This is because SMHV checks to make sure that the snapshot name in the backup metadata does exists in the filer
and if the same name snapshot is not found the restore operation will fail.
One option is to rename it back to the original SMHV specific name while copying back from the tape to the volume.
2010-02-09 11:21 PM
Well now - that's interesting.
I have to ask - how do customers backup SQL & Exchange snapshots to tape? Does SM for SQL\Exchange work in the same way?
Do people just never backup to tape?
2010-02-09 11:39 PM
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.