none
DPM2016 adding new VM to Data protection Manager 2016

    Question

  • I'm trying to add a new datasource to a protection group in DPM2016 using powershell and I'm getting this error.

    Code---:

    $PGName = "HVGP01"
     $dpmservername = "DPMSRV01.domain.com"
     $PGList = @(Get-ProtectionGroup $dpmservername)
    $PG = $PGlist | where { $_.FriendlyName -ieq $PGName}
     
     
     $MPG = Get-dpmModifiableProtectionGroup $PG
    $ps01 = Get-DPMProductionServer -DPMServerName $dpmservername | ? Servername -eq "TEST01"
    $ds01 = Get-DPMDatasource -ProductionServer $ps01 | ? Name -eq 'RCT\TEST01'

    Add-DPMChildDatasource -ProtectionGroup $MPG -ChildDatasource $ds01


    Get-DatasourceDiskAllocation -Datasource $ds01
    Set-DPMDatasourceDiskAllocation -ProtectionGroup $MPG -Datasource $ds01 -PassThru
    Set-ReplicaCreationMethod -ProtectionGroup $MPG -Now
    Set-protectiongroup $MPGPS C:\Windows\system32> Add-DPMChildDatasource -ProtectionGroup $MPG -ChildDatasource $ds01

    Errors:
    Add-DPMChildDatasource : RCT\TEST01 cannot be added to protection because it is already a member of a protection group (ID: 157)
    At line:1 char:1
    + Add-DPMChildDatasource -ProtectionGroup $MPG -ChildDatasource $ds01
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : NotSpecified: (:) [Add-DPMChildDatasource], DlsException
        + FullyQualifiedErrorId : ProtectedGroupOverlap,Microsoft.Internal.EnterpriseStorage.Dls.UI.Cmdlet.ProtectionCmdLets.AddProtectableObject

    PS C:\Windows\system32> Get-DatasourceDiskAllocation -Datasource $ds01

    Computer Name        ObjectType       
    -------- ----        ----------       
    TEST01  RCT\TEST01 Microsoft Hyper-V



    PS C:\Windows\system32> Set-DPMDatasourceDiskAllocation -ProtectionGroup $MPG -Datasource $ds01 -PassThru
    Set-DPMDatasourceDiskAllocation : The item RCT\TEST01 does not exist in protection group Hyper-V Protection Group. (ID: 31019)
    At line:1 char:1
    + Set-DPMDatasourceDiskAllocation -ProtectionGroup $MPG -Datasource $ds ...
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : NotSpecified: (:) [Set-DPMDatasourceDiskAllocation], DlsException
        + FullyQualifiedErrorId : PODoesNotExistInPG,Microsoft.Internal.EnterpriseStorage.Dls.UI.Cmdlet.ProtectionCmdLets.SetDiskAllocation

    -------------------

    If I use

    Set-DatasourceDiskAllocation -ProtectionGroup $mpg -ExpectedDataSizePerClientInMB($mpg.ClientPGDetailsField.ExpectedDataSizePerClient/(1024*1024))

    I get the following Error:

    Set-DatasourceDiskAllocation : The parameter ExpectedDataSizePerClientInMB cannot be used while configuring protection of the selected data source. (ID: 7006)
    Refer to cmdlet help for more details.
    At line:1 char:1
    + Set-DatasourceDiskAllocation -ProtectionGroup $MPG -ExpectedDataSizeP ...
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : NotSpecified: (:) [Set-DPMDatasourceDiskAllocation], DlsException
        + FullyQualifiedErrorId : InvalidParameterForNormalPG,Microsoft.Internal.EnterpriseStorage.Dls.UI.Cmdlet.ProtectionCmdLets.SetDiskAllocation


    Any hep is greatly appreciated.


    Wednesday, April 3, 2019 4:44 PM

Answers

  • Thanks for your effort in trying to fix this issue. 

     I found the problem and fixed it and all seems working.The problem  lies with two

    1. I was using SCVMM script to create a VM, which places the VHDX disk and VM config file in random place as opposed to the specified location

    2. In DPM script, we need to query the cluster for list of VMs  prior to getting Production server and Data source.

    • Marked as answer by master1982 Monday, April 8, 2019 1:01 PM
    Monday, April 8, 2019 1:01 PM

All replies

  • Hi,

    I have written a TechNet Wiki post about how to protect a specific folder by using PowerShell, the method should work for different workloads, did you check it out?

    DPM: Step-by-Step How to protect a folder with PowerShell
    https://social.technet.microsoft.com/wiki/contents/articles/52443.dpm-step-by-step-how-to-protect-a-folder-with-powershell.aspx

    Best regards,
    Leon


    Blog: https://thesystemcenterblog.com LinkedIn:

    Wednesday, April 3, 2019 5:26 PM
  • Hi Lion,

    Thank you for your reply. The DPM server is in a different domain to Hyper-V cluster. I have used certificate authentication and when add using GUI, it all works fine, but when i use powershell i get the following error. The DPM server is in production.local domain and the Hyper-V cluster is in man.local

    PS C:\Windows\system32> $PS = Get-DPMProductionServer -DPMServerName $DPMSERVER | Where {$_.ServerName -eq “TEST01”}

    PS C:\Windows\system32> $ps

    ServerName ClusterName                   Domain           ServerProtectionState 
    ---------- -----------                   ------           --------------------- 
    TEST01    S2DCuster01.man.local man.local NoDatasourcesProtected



    PS C:\Windows\system32> $DS = Get-DPMDatasource -ProductionServer $PS -Inquire
    Get-DPMDatasource : Operation failed because TEST01.S2DCuster01.man.local or one of its owner nodes are not accessible from the DPM server. (ID: 31003)
    Use the cluster management software to check to see if the cluster resource group TEST01.S2DCuster01.man.local or any of its owner nodes are online.
    At line:1 char:7
    + $DS = Get-DPMDatasource -ProductionServer $PS -Inquire
    +       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : NotSpecified: (:) [Get-DPMDatasource], DlsException
        + FullyQualifiedErrorId : NoActiveVN,Microsoft.Internal.EnterpriseStorage.Dls.UI.Cmdlet.Common.GetDatasource

    I appreciate your help.


    • Edited by master1982 Thursday, April 4, 2019 9:15 AM
    Thursday, April 4, 2019 9:15 AM
  • Have you installed the DPM agent on all cluster nodes?

    Blog: https://thesystemcenterblog.com LinkedIn:

    Thursday, April 4, 2019 9:39 AM
  • I have now slightly modified the code as shown below and I get the disk allocation error

     [string]$DPMSERVER = "DPM01.production.local"
    $PG = Get-DPMProtectionGroup -DPMServerName $DPMSERVER | Where-Object {$_.FriendlyName.ToUpper() -eq “Hyper-VPG01”}
    $PS = Get-DPMProductionServer -DPMServerName $DPMSERVER | Where {$_.ServerName -eq “TEST01”}
    $DS = Get-DPMDatasource -ProductionServer $PS | ? name -eq "RCT\TEST01"
    $MPG01 = Get-DPMModifiableProtectionGroup $PG
    Add-DPMChildDatasource -ProtectionGroup $MPG01 -ChildDatasource $DS
    Set-DPMProtectionGroup -ProtectionGroup $MPG01

    Error:

    Set-DPMProtectionGroup : Operation failed since the protected data source size had not been calculated for RCT\TEST01 on TEST01.S2DCluster.man.local prior to running this 
    operation. (ID: 31000)
    Ensure that Get-DatasourceDiskAllocation and Set-DatasourceDiskAllocation are executed successfully prior to running this operation.
    At line:9 char:1
    + Set-DPMProtectionGroup -ProtectionGroup $MPG01
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : NotSpecified: (:) [Set-DPMProtectionGroup], DlsException
        + FullyQualifiedErrorId : CalculateSizePending,Microsoft.Internal.EnterpriseStorage.Dls.UI.Cmdlet.ProtectionCmdLets.CommitProtectionGroup

    Thursday, April 4, 2019 9:58 AM
  • Yes.
    Thursday, April 4, 2019 9:59 AM
  • I have now slightly modified the code as shown below and I get the disk allocation error

     [string]$DPMSERVER = "DPM01.production.local"
    $PG = Get-DPMProtectionGroup -DPMServerName $DPMSERVER | Where-Object {$_.FriendlyName.ToUpper() -eq “Hyper-VPG01”}
    $PS = Get-DPMProductionServer -DPMServerName $DPMSERVER | Where {$_.ServerName -eq “TEST01”}
    $DS = Get-DPMDatasource -ProductionServer $PS | ? name -eq "RCT\TEST01"
    $MPG01 = Get-DPMModifiableProtectionGroup $PG
    Add-DPMChildDatasource -ProtectionGroup $MPG01 -ChildDatasource $DS
    Set-DPMProtectionGroup -ProtectionGroup $MPG01

    Error:

    Set-DPMProtectionGroup : Operation failed since the protected data source size had not been calculated for RCT\TEST01 on TEST01.S2DCluster.man.local prior to running this 
    operation. (ID: 31000)
    Ensure that Get-DatasourceDiskAllocation and Set-DatasourceDiskAllocation are executed successfully prior to running this operation.
    At line:9 char:1
    + Set-DPMProtectionGroup -ProtectionGroup $MPG01
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : NotSpecified: (:) [Set-DPMProtectionGroup], DlsException
        + FullyQualifiedErrorId : CalculateSizePending,Microsoft.Internal.EnterpriseStorage.Dls.UI.Cmdlet.ProtectionCmdLets.CommitProtectionGroup

    I did notice you used these two cmdlets in your initial post, but you had some errors there, we need to start looking what's going wrong there to start with.

    So start by one line at the time, check what values each variable contains to get a better understanding.

    $PGName = "HVGP01"
    $dpmservername = "DPMSRV01.domain.com"
    $PGList = @(Get-ProtectionGroup $dpmservername)
    $PG = $PGlist | where { $_.FriendlyName -ieq $PGName}
     
    $MPG = Get-dpmModifiableProtectionGroup $PG
    $ps01 = Get-DPMProductionServer -DPMServerName $dpmservername | ? Servername -eq "TEST01"
    $ds01 = Get-DPMDatasource -ProductionServer $ps01 | ? Name -eq 'RCT\TEST01'
    
    Add-DPMChildDatasource -ProtectionGroup $MPG -ChildDatasource $ds01
    
    Get-DatasourceDiskAllocation -Datasource $ds01
    Set-DPMDatasourceDiskAllocation -ProtectionGroup $MPG -Datasource $ds01 -PassThru
    Set-ReplicaCreationMethod -ProtectionGroup $MPG -Now
    Set-protectiongroup $MPGPS
    Add-DPMChildDatasource -ProtectionGroup $MPG -ChildDatasource $ds01



    Blog: https://thesystemcenterblog.com LinkedIn:

    Thursday, April 4, 2019 10:24 AM
  • Hi Lion,

    I did run one step at a time and Up until 'Set-DPMdatasourceDiskAllocation' cmdlet everything works and I see values in each variable at each step, but throws error on disk allocation and I think there is an another way in 2016 to calculate disk allocation

    PS C:\Windows\system32> $x = Get-DatasourceDiskAllocation -Datasource $DS

    PS C:\Windows\system32> $x

    Computer Name        ObjectType       
    -------- ----        ----------       
    TEST01  RCT\TEST01 Microsoft Hyper-V

    PS C:\Windows\system32> $DS

    Computer Name        ObjectType       
    -------- ----        ----------       
    TEST01  RCT\TEST01 Microsoft Hyper-V


    PS C:\Windows\system32> $PS

    ServerName ClusterName                   Domain           ServerProtectionState 
    ---------- -----------                   ------           --------------------- 
    TEST01    S2DCluster.man.local          man.local       NoDatasourcesProtected




    PS C:\Windows\system32> Set-DatasourceDiskAllocation -Datasource $DS -ProtectionGroup $MPG01
    Set-DatasourceDiskAllocation : Operation failed since the protected data source size had not been calculated for RCT\TEST01 on TEST01.S2DCluster.man.local prior to running this 
    operation. (ID: 31000)
    Ensure that Get-DatasourceDiskAllocation and Set-DatasourceDiskAllocation are executed successfully prior to running this operation.
    At line:1 char:2
    +     Set-DatasourceDiskAllocation -Datasource $DS -ProtectionGroup $MP ...
    +     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : NotSpecified: (:) [Set-DPMDatasourceDiskAllocation], DlsException
        + FullyQualifiedErrorId : CalculateSizePending,Microsoft.Internal.EnterpriseStorage.Dls.UI.Cmdlet.ProtectionCmdLets.SetDiskAllocation

    Thursday, April 4, 2019 10:43 AM
  • Are you able to try on something that is not a Hyper-V virtual machine, for example just a normal server which is not part of a cluster?

    Blog: https://thesystemcenterblog.com LinkedIn:

    Thursday, April 4, 2019 1:09 PM
  • Hi Lion,

    I think I kind of know what was happening. In the cluster when I created a VM with name TEST01 using SCVMM it had created a VM with name TEST01 on SCVMM and 'SCVMM TEST01 Resources' on Cluster under roles. But DPM is seeing both TEST01 and 'SCVMM TEST01 Resources' when I query for Production server. I have now deleted that VM and created a new VM with different name and try to run the script again, this time when DPM can not automatically see the newly created VM, so I had to go to  GUI and expand Cluster name under GUI and then come back run the script, which  eventually returned the production server, Datasource($PS and $DS). I don't know why I had to go back to GUI and expand the cluster name in order for me to see it in script. After this, the script ran fine and added the TEST01 to DPM, but the replication showing inconsistent and when rerun the consistency check it fails all the time. Don't know why?

    This is what it says

    An unexpected error occurred while the job was running. (ID 104 Details: The filename, directory name, or volume label syntax is incorrect (0x8007007B))

    Thursday, April 4, 2019 1:43 PM
  • Ok I wasen't aware of that you had SCVMM in use, well that's good that you got forward at least.

    I would suggest to dig through the DPM log on the DPM server and the cluster nodes for more clues about the error.

    DPM server log location:

    • %ProgramFiles%\Microsoft System Center\DPM\DPM\Temp\MSDPMCurr.errlog

    DPM agent log location:

    • C:\Program Files\Microsoft Data Protection Manager\DPM\Temp\DPMRACurr.errlog

    Blog: https://thesystemcenterblog.com LinkedIn:

    Thursday, April 4, 2019 2:20 PM
  • Hi Lion,

    referring to your suggestion of try backing up another machine

    I had another VM on a same Hyper-V cluster and I could add this VM using powershell with no issues and the backup runs OK. I have added newly created VM 'MYVM01' both using powershell and using GUI and they both added to Protection group with no issues, but failing on replication and consistency check.

    The protection agent on DPM01.production.local was temporarily unable to respond because it was in an unexpected state. (ID 60 Details: Internal error code: 0x809909B0)

    Thursday, April 4, 2019 2:24 PM
  • What is your DPM 2016 build? And the version of the Hyper-V cluster?

    Blog: https://thesystemcenterblog.com LinkedIn:

    Thursday, April 4, 2019 2:34 PM
  • DPM 1801
    server version: 5.1.363.0

    Hyper-V Manager: 10.0.14393.0

    Cluster Functional Level = 9

    ClusterUpgrade version = 8

    • Edited by master1982 Thursday, April 4, 2019 3:15 PM
    Thursday, April 4, 2019 3:09 PM
  • Hi Lion,

    Any help?

    Friday, April 5, 2019 10:49 AM
  • Did you check the examine the DPMRA log file for any details regarding the cause of the crash?

    The DPMRA log file will be in the format of DPMRA*.errlog (e.g. DPMRACURR.ERRLOG) and by default is located in: C:\Program Files\Microsoft Data Protection Manager\DPM\Temp.


    Blog: https://thesystemcenterblog.com LinkedIn:

    Friday, April 5, 2019 12:47 PM
  • Thanks for your effort in trying to fix this issue. 

     I found the problem and fixed it and all seems working.The problem  lies with two

    1. I was using SCVMM script to create a VM, which places the VHDX disk and VM config file in random place as opposed to the specified location

    2. In DPM script, we need to query the cluster for list of VMs  prior to getting Production server and Data source.

    • Marked as answer by master1982 Monday, April 8, 2019 1:01 PM
    Monday, April 8, 2019 1:01 PM
  • Great to hear that you solved it! Indeed, with clusters you need to work with the cluster itself, it’s easy to get confused with this :-)

    Blog: https://thesystemcenterblog.com LinkedIn:

    Monday, April 8, 2019 1:17 PM