To ensure business continuity and facilitate efficient disaster recovery for your virtual machines with array-based replication, you create protection groups and recovery plans.

Prerequisites

  • Verify that your SRM connection is authenticated against the protected and recovery vCenter Server systems. This example uses the $srmConnection variable from Connect to a Local and to a Remote Site Recovery Manager (SRM) Server.

  • Verify that you created a replicated array pair for the protected (local) and recovery (remote) SRM sites. This example uses the variables from Create Replicated Array Pair

  • You must have the required privileges to create protection groups and recovery plans on the recovery site.

Procedure

  1. Discover the storage devices of the replicated array pair.
    $task = Invoke-SrmDiscoverStorageDevices -PairingId $srmConnection.ConnectedPairing.PairingId `
       -SrmId $srmConnection.ConnectedPairing.LocalSrmServer.Id `
       -ArrayPairId $replicatedArrayPair.Id
     
  2. Monitor the task progress.
    $task = Invoke-SrmGetTaskInfo -TaskId $task.Id

    $task.Status eventually changes to SUCCESS.

  3. Retrieve the storage devices from the replicated array pair.
    $storageDevices = Invoke-SrmGetStorageDevices -PairingId $srmConnection.ConnectedPairing.PairingId `
       -SrmId $srmConnection.ConnectedPairing.LocalSrmServer.Id `
       -ArrayPairId $replicatedArrayPair.Id
  4. Prepare the ABR protection group spec.

    This example uses the replicated array pair with a single storage device and a single datastore created in Create Replicated Array Pair.

    $abrProtectionGroupSpec = Initialize-SrmAbrProtectionGroupSpec `
       -ReplicatedArrayPair $replicatedArrayPair.Id `
       -Datastores $storageDevices.StorageDevicesData[0].Datastores[0].Id
  5. Prepare the protection group create spec.
    For the ReplicationType parameter, specify ABR.
    $protectionGroupSpec = Initialize-SrmProtectionGroupCreateSpec -Name "<MyAbrProtectionGroup>" `
       -ReplicationType ABR `
       -ProtectedVcGuid $srmConnection.ConnectedPairing.LocalVcServer.Id `
       -AbrSpec $abrProtectionGroupSpec
  6. Create the ABR protection group.
    $task = Invoke-SrmCreateGroup -PairingId $srmConnection.ConnectedPairing.PairingId `
       -ProtectionGroupCreateSpec $protectionGroupSpec
  7. Monitor the task progress.
    $task = Invoke-SrmGetTaskInfo -TaskId $task.Id

    $task.Status eventually changes to SUCCESS.

  8. (Optional) Retrieve the ABR protection group.
    $protectionGroup = Invoke-SrmGetGroup -PairingId $srmConnection.ConnectedPairing.PairingId `
       -GroupId $task.Result
  9. Prepare the recovery plan create spec.
    $recPlanSpec = Initialize-SrmRecoveryPlanCreateSpec `
       -Name "<MyAbrRecoveryPlan>" `
       -ProtectedVcGuid $srmConnection.ConnectedPairing.LocalVcServer.Id `
       -ProtectionGroups @($protectionGroup.Id)
  10. Create the recovery plan.
    $task = Invoke-SrmCreatePlan -PairingId $srmConnection.ConnectedPairing.PairingId `  
       -RecoveryPlanCreateSpec $recPlanSpec
  11. Monitor the task progress.
    $task = Invoke-SrmGetTaskInfo -TaskId $task.Id

    $task.Status eventually changes to SUCCESS.