Anyone who has used CreateAbrProtectionGroup API to create a new protection group?
What are the arguments to be passed to this method? The API doc says the arguments include the moref to the protection folder and the name of the protection group.
However, I see the below error on specifying these arguments:
$pgmoref=$srmApi.Protection.CreateAbrProtectionGroup("Folder-group-v22", "Group02")
Cannot find an overload for "CreateAbrProtectionGroup" and the argument count:
"2".
At line:1 char:53
+ $pgmoref=$srmApi.Protection.CreateAbrProtectionGroup <<<< ("Folder-group-v22"
, "Group02")
+ CategoryInfo : NotSpecified: (:) [], MethodException
+ FullyQualifiedErrorId : MethodCountCouldNotFindBest
According to the API Reference there are 4 parameters for the CreateAbrProtectionGroup method.
And I suspect you will to provide a MoRef object instead of a String for the parameters indicated as MoRef.
$folder.ExtensionData.MoRef
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
According to the API Reference there are 4 parameters for the CreateAbrProtectionGroup method.
And I suspect you will to provide a MoRef object instead of a String for the parameters indicated as MoRef.
$folder.ExtensionData.MoRef
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Yes, I had missed the other parameter.
Here's how I've specified it now, and it works-
$DSMoref = $srmApi.Protection.ListReplicatedDatastores()[0].moref
$folderMoref = $srmApi.Protection.GetProtectionGroupRootFolder().moref
$ProtectionGroupMoref = $srmApi.Protection.CreateAbrProtectionGroup($folderMoref, $ProtectionGroupName, $ProtectionGroupDescriotion, $DSMoref)
This creates the new protection group.
Thanks,
Shravan
Maybe use "ListUnassignedReplicatedDatastores" to create new protection groups.