none
Please, need helf with CSV Serialization Script on Technet RRS feed

  • Question

  • Hi !

    We are trying to protect CSVs with the onboard Software VSS Provider, I have tried to run the script on either on of the cluster nodes from the technet article at http://technet.microsoft.com/en-us/library/ff634192.aspx but it does not work. The powershell script always ends with this error message:

    Get-Content : Cannot bind argument to parameter ‘Path’ because it is null.
    At C:\Scripts\ListVMsOnClusterForDPM.ps1:41 char:8
    + type <<<> DataSourceGroups.xml # Consolidating groups pertaining to all the volumes.
    + CategoryInfo : InvalidData: (:) [Get-Content], ParameterBindingValidationException
    + FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,Microsoft.PowerShell.Commands.GetContentCommand

     

    Afterwards the DataSourceGroups.xml file is empty except for the header and the cluster group name.

    I have followed all instructions in the technet article but I cannot get this to work.

    Can you please help !

     

    Thanks !

    Alex

     

    • Moved by MarcReynolds Wednesday, September 15, 2010 2:21 PM (From:Data Protection Manager)
    Wednesday, September 15, 2010 1:59 PM

Answers

All replies

  • There aren't 41 lines in this script. Are you using a modified version? Can you post the script here?


    Thanks Shyama Hembram[MSFT] This posting is provided AS IS, with no warranties, and confers no rights.
    Wednesday, September 15, 2010 6:14 PM
    Moderator
  • Hi

    Look at this blogpost: http://robertanddpm.blogspot.com/2010/07/enabling-serialized-backup-of-hyper-v.html 

    BR

    Robert Hedblom



    Check out my DPM blog @ http://robertanddpm.blogspot.com

    Wednesday, September 15, 2010 6:17 PM
    Moderator
  • Hi Shyama,

     

    I have tried both the script on technet and the script on this site:

    http://www.hodgkins.net.au/2010/03/enabling-serialized-hyper-v-virtual-machine-backups-in-dpm-2010-rc/

    The script in the link above is longer. The error message was for that script.

     

    The script on technet is shorter, you are right. But even with this script, I get the same errors:

    Get-Content : Cannot bind argument to parameter 'Path' because it is null.

    At C:\DPMCSVScript\test.ps1:33 char:8
    +    type <<<<  $file >> DataSourceGroups.xml # Consolidating groups pertaining to all the volumes.
        + CategoryInfo          : InvalidData: (:) [Get-Content], ParameterBindingValidationException
        + FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,Microsoft.PowerShell.Commands.GetContentCommand

     

    I took the script directly from technet, I did not make any changes.

    Thanks for your help !

    Wednesday, September 15, 2010 8:12 PM
  • Hi Robert,

     

    if I am not mistaken this script seems to be the same as the one here:

    http://www.hodgkins.net.au/2010/03/enabling-serialized-hyper-v-virtual-machine-backups-in-dpm-2010-rc

     

    and it does not work either.

    Sorry !

     

    Wednesday, September 15, 2010 8:13 PM
  • Can you try this?
    # 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=`"http://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\*
    $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
    

    Thanks Shyama Hembram[MSFT] This posting is provided AS IS, with no warranties, and confers no rights.
    Thursday, September 16, 2010 4:08 PM
    Moderator
  • Hi Shyama,

     

    thanks, that script has worked correctly. Can you tell me which part you changed ? Can I add this change to the script on this site too ?

    http://www.hodgkins.net.au/2010/03/enabling-serialized-hyper-v-virtual-machine-backups-in-dpm-2010-rc

     

    Thanks,

    Alex

    Thursday, September 16, 2010 9:18 PM
  • I updated the following line:

    $filelist = dir $dir\*
    
    

    This is also updated recently on our blog

    http://blogs.technet.com/b/dpm/archive/2010/09/10/updated-dsconfig-script.aspx

     


    Thanks Shyama Hembram[MSFT] This posting is provided AS IS, with no warranties, and confers no rights.
    Friday, September 17, 2010 12:54 AM
    Moderator
  • If the above suggested answer does not help in resolving the thread please re-open it.
    Cheers, Tyler F [MSFT] - This posting is provided "AS IS" with no warranties, and confers no rights.
    Friday, September 17, 2010 6:12 PM
    Moderator