Considerations for Backing Up Virtual Machines on CSV with the System VSS Provider

適用於: System Center Data Protection Manager 2010

If your SAN vendor does not have hardware VSS providers, you can use software snapshots to back up your virtual machines.

We recommend that virtual machines deployed on CSV should be backed up serially.

There are two aspects to serialization of backup jobs in a CSV environment:

  • Serializing virtual machine backups on a per node basis.

  • Serializing virtual machine backups on a per CSV LUN basis.

Enabling Per Node Serialization

Create the following registry key on the DPM server:

Key

HKLM\Software\Microsoft\Microsoft Data Protection Manager\2.0\Configuration\MaxAllowedParallelBackups

Value

Microsoft Hyper-V

Data

1

Type

DWORD

This ensures that only one backup job will run at a time on a Hyper-V host.

Enabling Per CSV LUN Serialization

This form of serialization limits the number of virtual machine backups happening on a single CSV LUN. This is done by creating a DataSourceGroups.xml file and placing it in the DPM server at %PROGRAMFILES%\Microsoft DPM\DPM\Config. This file provides DPM with information about the CSV virtual machine deployment configuration/distribution on the various CSV LUN so as to serialize the backups that happen per CSV LUN.

A DSConfig.ps1 script (below) creates the DataSourceGroups.xml file by listing all the virtual machines running on CSV in groups. Each group has the list of all virtual machines hosted on one CSV LUN. DPM permits only one backup from one such group at a time.

# DSConfig.ps1

$infoText = "This script will generate the DatasourceGroups.xml file in the current path. Once this file is created merge it with the same file name under %programfiles%\Microsoft DPM\DPM\Config directory on the DPM server. Read the documentation for more details."
echo $infoText

$header = "<?xml version=`"1.0`" encoding=`"utf-16`"?> `n <DatasourceGroup xmlns:xsi=`"http://www.w3.org/2001/XMLSchema-instance`" xmlns:xsd=`"http://www.w3.org/2001/XMLSchema`" xmlns=`"https://schemas.microsoft.com/2003/dls/GroupDatasourceByDisk.xsd`">"
$footer = "</DatasourceGroup>"

import-module -name FailoverClusters

$dir = [guid]::NewGuid()
md $dir

$cluster = get-Cluster
$FQDN = $cluster.Name + "." + $cluster.Domain
$res = get-clusterresource | where-object { $_.ResourceType.Name -eq "Virtual Machine Configuration"}
foreach ($r in $res)
{
$VmObj = Get-ClusterParameter -inputobject $r | where {$_.Name -eq "VmStoreRootPath"} # Identifies the CSV volume on which the VM is hosted.
$VmName = Get-ClusterParameter -inputobject $r | where {$_.Name -eq "VmId"}
$vol = $vmobj.Value.Split("\")[2] # $vol will return to us the Volume<number> of the CSV on which the VM resides.
$line = "<Datasource DatasourceName=`"" + $VmName.Value +"`"" + " ProtectedServerName=`"" + $r.OwnerGroup.Name + "."+ $FQDN +"`"" + " WriterId=`"66841cd4-6ded-4f4b-8f17-fd23f8ddc3de`" />"
echo $line >> $dir\$vol # File VolumeX will contain entries for all VMs hosted on CSV VolumeX
}

echo $header > DataSourceGroups.xml
$filelist = dir $dir\Volume*
$GroupEndString = "</Group>"
foreach ($file in $filelist)
{
   $GroupBeginString = "<Group GroupName=`"" + $file.Name + "-" + $FQDN + "`">" # Group name is kept VolumeX itself
   echo $GroupBeginString >> DataSourceGroups.xml
   type $file >> DataSourceGroups.xml # Consolidating groups pertaining to all the volumes. 
   echo $GroupEndString >> DataSourceGroups.xml
}

Remove-Item -Force -Recurse $dir

echo $footer >> DataSourceGroups.xml

Procedure to Create the DataSourceGroups.xml File and Serialize the Backup Jobs

  1. Generate the DataSourceGroups.xml file by running the DSConfig.ps1 script on any one node of a cluster containing CSV. For more information about how to generate the file, see Procedure to Generate the DataSourceGroups.xml File on a CSV Cluster.

  2. Repeat step 1 for every cluster that is protected by a DPM server.

  3. Merge all such DataSourceGroups.xml files into a single file on the DPM server. You can skip this step and copy the file directly to %PROGRAMFILES%\Microsoft DPM\DPM\Config if the DPM server is protecting only one cluster. For more information about merging the files, see Procedure to Merge the DataSourceGroups.xml Files from All CSV Clusters.

  4. If a protection group has already been created for the virtual machines, perform the steps in the Modify Protection Group Wizard. If a protection group has not been created, create a new protection group and the job serialization described above will take effect.

The DataSourceGroups.xml file needs to be updated only when virtual machines are added, deleted, or modified in the cluster and protection is configured for them.

Regenerate the DataSourceGroups.xml file from the CSV cluster and update the DataSourceGroups.xml file by replacing the existing groups for that cluster with the new groups.

Procedure to Generate the DataSourceGroups.xml File on a CSV Cluster

  1. Copy the DSConfig.ps1 file to any one node of a CSV cluster.

  2. Run this script in an elevated Windows PowerShell window and locate the DataSourceGroups.xml file generated in the same folder C:\MyFolder\>DSConfig.ps1

  3. This script will generate the DataSourceGroups.xml file in the current path. After this file is created, copy it to the %programfiles%\Microsoft DPM\DPM\Config directory on the DPM server.

  4. You can verify the groupings by opening the XML file that is generated. The following is the expected format:

    <?xml version="1.0" encoding="utf-16"?>
    <DatasourceGroup xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="https://schemas.microsoft.com/2003/dls/GroupDatasourceByDisk.xsd">
    <Group GroupName="Group1">
    <Datasource DatasourceName="EA24071A-7B7B-42CF-AB1D-BBAE49F50632" ProtectedServerName="SCVMM VM-Vol7-03 Resources.CSVSCALE.SCALEDPM01.LAB" WriterId="66841cd4-6ded-4f4b-8f17-fd23f8ddc3de" />
    </Group>
    </DatasourceGroup>
    

Procedure to Merge the DataSourceGroups.xml Files from All CSV Clusters

注意

You can skip this step if the DPM server is protecting only one CSV cluster. The generated DataSourceGroups.xml file can be used directly on the DPM server.

  1. Copy any one of the DataSourceGroups.xml files that was generated to the DPM server under the location %Programfiles%\Microsoft DPM\DPM\Config.

  2. Open the file to edit it.

    <?xml version="1.0" encoding="utf-16"?>
    <DatasourceGroup xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="https://schemas.microsoft.com/2003/dls/GroupDatasourceByDisk.xsd">
    <Group GroupName="Group1">
    <Datasource DatasourceName="EA24071A-7B7B-42CF-AB1D-BBAE49F50632" ProtectedServerName="SCVMM VM-Vol7-03 Resources.CSVSCALE.SCALEDPM01.LAB" WriterId="66841cd4-6ded-4f4b-8f17-fd23f8ddc3de" />
    </Group>
    </DatasourceGroup>
    
  3. Copy the <Group> tags from all the DataSourceGroup.xml files generated and add the text between the <DataSourceGroup> tags. The DataSourceGroups.xml file will now contain one <header> tag, one <DataSourceGroup> tag, and <Group> tags from all CSV clusters.

  4. Close the DataSourceGroups.xml file on the DPM server. It is now ready to use.