Answered by:
System protection not happening

Question
-
I want to add a new server in a already existing group.For this task i have written a script
$PGNAME = Protection group name
$DPMServer = dpm-server
$Client = New-machine
$pg = Get-ProtectionGroup -DPMServerName $DPMServer | Where-Object {$_.FriendlyName.ToUpper() -eq $PGNAME.ToUpper()}
$Modpg = Get-ModifiableProtectionGroup -ProtectionGroup $pg
$ps = Get-ProductionServer -DPMServerName $DPMServer
$machine = $ps | Where-Object {$_.MachineName.ToUpper() -eq $Client.ToUpper()}
$dds = Get-Datasource -ProductionServer $machine
Now instead of adding all the members i wanted to add just a particular drive and System protection so i did -
$ds=$dds | Where-Object {$_.Name -eq "C:\"-or $_.Name -contains "System Protection" }
Add-ChildDataSource -ProtectionGroup $Modpg -ChildDataSource $ds
Get-DatasourceDiskAllocation -Datasource $ds[0]
Set-DatasourceDiskAllocation -Datasource $ds[0] -ProtectionGroup $Modpg
Get-DatasourceDiskAllocation -Datasource $ds[1]
Set-DatasourceDiskAllocation -Datasource $ds[1] -ProtectionGroup $Modpg
And finally -
Set-ReplicaCreationMethod -ProtectionGroup $Modpg -NOW
Set-ProtectionGroup -ProtectionGroup $Modpg
But i get the following error -
Set-DatasourceDiskAllocation : The item Computer\System Protection does not exist in protection group PROTECTION_GROUP. (ID: 31019 ) At C:\PATH_TO_SCRIPT\SCRIPT_NAME.ps1:84 char:29 + Set-DatasourceDiskAllocation <<<< -Datasource $ds[1] -ProtectionGroup $Modpg + CategoryInfo : NotSpecified: (:) [Set-DatasourceDiskAllocation], DlsException + FullyQualifiedErrorId : 31019,Microsoft.Internal.EnterpriseStorage.Dls.UI.Cmdlet.ProtectionCmdLets.SetDiskAlloca tion
Set-DatasourceDiskAllocation
is not happening.Please help me out.- Edited by Mandeep Gandhi Tuesday, October 9, 2012 2:50 PM
Tuesday, October 9, 2012 2:50 PM
Answers
-
Hi Mandeep,
Sample of script I use with "system protection":
$dpmname = get-content env:computername
Disconnect-DPmServer $dpmname
Connect-DPmServer $dpmname$dsname = "System Protection"
$poname = "System state"
$pg = Get-ProtectionGroup -DPMServerName $DPMname | Where {$_.FriendlyName -match "YourExistingPGName"}$mpg = Get-ModifiableProtectionGroup -ProtectionGroup $pg
$ps = Get-ProductionServer -DPMServerName $DPMname | Where {$_.MachineName -contains "YourServerName"}
$ds = Get-Datasource -ProductionServer $ps -inquire | Where {$_.Name -contains $dsname}
$PoSrc = Get-ChildDatasource -ChildDatasource $ds -Inquire | where { ($_.logicalpath,$_.name,$_.type) -match $poname}Add-ChildDataSource -ProtectionGroup $mpg -ChildDataSource $Posrc
Get-DatasourceDiskAllocation -Datasource $ds
Set-DatasourceDiskAllocation -Datasource $ds -ProtectionGroup $mpg
Set-ReplicaCreationMethod -ProtectionGroup $mpg -NOW
Set-DPMProtectionGroup -ProtectionGroup $mpgDisconnect-DPmServer $dpmname
Stephane
Please remember to click “Mark as Answer” on the post that helps you. This posting is provided "AS IS" with no warranties. knowledge is valid only if it is shared by All.
My DPM blog Yet Another DPM Blog
- Marked as answer by Yegor Startsev Monday, March 18, 2013 6:27 AM
Monday, October 15, 2012 2:14 PM
All replies
-
Hi Mandeep,
If you want to add "System state", you need to use Cmdlet "Get-ChildDatasource", something like that:
$poname = "Computer\System Protection\System state"
$ds=$dds | Where-Object {$_.Name -eq "C:\"-or $_.Name -contains "System Protection" }
$PoSrc = Get-ChildDatasource -ChildDatasource
$ds
-Inquire | where { ($_.logicalpath,$_.name) -contains $poname }Add-ChildDataSource -ProtectionGroup $Modpg -ChildDataSource $PoSrc
I hope this will help you.
Stephane
Please remember to click “Mark as Answer” on the post that helps you. This posting is provided "AS IS" with no warranties. knowledge is valid only if it is shared by All.
My DPM blog Yet Another DPM Blog
Tuesday, October 9, 2012 4:56 PM -
$PoSrc = Get-ChildDatasource -ChildDatasource
$ds
-Inquire | where { ($_.logicalpath,$_.name) -contains $poname }is not working for me when i try to run
Get-ChildDatasource -ChildDatasource $ds[1]
where $ds[1] has "system protection" data source but
Get-ChildDatasource -ChildDatasource $ds[1] -Inquire
ain't working for me. Any suggestions?
Wednesday, October 10, 2012 7:32 AM -
Stephane LADUNE can u please replyMonday, October 15, 2012 7:21 AM
-
Hi Mandeep,
Sample of script I use with "system protection":
$dpmname = get-content env:computername
Disconnect-DPmServer $dpmname
Connect-DPmServer $dpmname$dsname = "System Protection"
$poname = "System state"
$pg = Get-ProtectionGroup -DPMServerName $DPMname | Where {$_.FriendlyName -match "YourExistingPGName"}$mpg = Get-ModifiableProtectionGroup -ProtectionGroup $pg
$ps = Get-ProductionServer -DPMServerName $DPMname | Where {$_.MachineName -contains "YourServerName"}
$ds = Get-Datasource -ProductionServer $ps -inquire | Where {$_.Name -contains $dsname}
$PoSrc = Get-ChildDatasource -ChildDatasource $ds -Inquire | where { ($_.logicalpath,$_.name,$_.type) -match $poname}Add-ChildDataSource -ProtectionGroup $mpg -ChildDataSource $Posrc
Get-DatasourceDiskAllocation -Datasource $ds
Set-DatasourceDiskAllocation -Datasource $ds -ProtectionGroup $mpg
Set-ReplicaCreationMethod -ProtectionGroup $mpg -NOW
Set-DPMProtectionGroup -ProtectionGroup $mpgDisconnect-DPmServer $dpmname
Stephane
Please remember to click “Mark as Answer” on the post that helps you. This posting is provided "AS IS" with no warranties. knowledge is valid only if it is shared by All.
My DPM blog Yet Another DPM Blog
- Marked as answer by Yegor Startsev Monday, March 18, 2013 6:27 AM
Monday, October 15, 2012 2:14 PM