Using the Cmdlets : Deleting VPGs
  
Deleting VPGs
You can delete VPGs from a site via the following cmdlets:
Unprotect-Vpg – Deletes the VPG, leaving the virtual machines that comprised the VPG unprotected. This cmdlet is described in Deleting a VPG.
ForceRemove-ProtectionGroup – Deletes the VPG regardless of its state, for example when the Unprotect-Vpg cmdlet failed. This cmdlet is described in Forcibly Deleting a VPG.
Deleting a VPG
You can remove a VPG using the Unprotect-Vpg cmdlet or from within the Zerto User Interface.
To delete a VPG:
1. Run the Unprotect-Vpg cmdlet from the PowerShell prompt.
PS C:\Windows\SysWOW64\WindowsPowerShell\v1.0> Unprotect-Vpg
2. You are prompted for the VPG to remove, thus unprotecting all the virtual machines specified in the VPG. The VPG name is case-sensitive.
By default, the target disks used to replicate the virtual machines in the peer site are saved, so that if you decide to reprotect the virtual machines in the VPG the synchronization is faster. If you also want to delete these target disks, specify the DeleteTargetDisks parameter when running the command:
Unprotect-Vpg -DeleteTargetDisks
3. You are prompted for the IP address of one of the Zerto Virtual Manager sites, either where the virtual machines in the VPG are protected or recovered, for the HTTP port used for inbound communication with that Zerto Virtual Manager and a valid username and password, defined in the users.txt file for the Zerto Virtual Manager where the cmdlet is run, as described in Defining Credentials to Run Zerto Virtual Replication Cmdlets.
After the Unprotect-Vpg cmdlet completes, returning the command task identifier and site identifier, some time might still be needed before the VPG is actually fully removed. You can monitor the progress in the vSphere Client console.
Forcibly Deleting a VPG
When attempting to remove a VPG fails after using the Unprotect-Vpg cmdlet, described above, or from within the Zerto User Interface, the virtual machines are left unprotected, but marked by Zerto Virtual Replication as being protected. To protect these virtual machines, the VPG must be removed so that the virtual machines can be added to a new VPG.
Zerto Virtual Replication includes the ForceRemove-ProtectionGroup cmdlet that enables you to removes the VPG regardless of its state.
To forcibly delete a VPG:
1. Run the ForceRemove-ProtectionGroup cmdlet from the PowerShell prompt.
PS C:\Windows\SysWOW64\WindowsPowerShell\v1.0> ForceRemove-ProtectionGroup c:\VPGs.xml
2. You are prompted for the VPG to remove, thus unprotecting all the virtual machines specified in the VPG. The VPG name is case-sensitive.
3. You are prompted for the IP address of one of the Zerto Virtual Manager sites, either where the virtual machines in the VPG are protected or recovered, for the HTTP port used for inbound communication with that Zerto Virtual Manager and a valid username and password, defined in the users.txt file for the Zerto Virtual Manager where the cmdlet is run, as described in Defining Credentials to Run Zerto Virtual Replication Cmdlets.
After the ForceRemove-ProtectionGroup cmdlet completes, returning the command task identifier and site identifier, some time might still be needed before the VPG is actually fully removed. You can monitor the progress in the vSphere Client console.
After the VPG has been removed, you can create a new VPG in the Zerto User Interface to protect the virtual machines.