REST API call to remove protection for a VM that has already been deleted fails.
Example error message:
PSMessageDetails :
Exception : Microsoft.PowerShell.Commands.HttpResponseException: Response status code does not indicate success: 404 (Not Found).
at System.Management.Automation.MshCommandRuntime.ThrowTerminatingError(ErrorRecorderrorRecord)
TargetObject : Method: POST, RequestUri: 'https://vcenter.example.com/api/rest/srm/v2/pairings/55169ee6-a6fa-363c-b4c8-9c8808e79d43/protection-management/groups/DrReplicationVmProtectionGroup:vm-protection-group-2000:dddbf270-bd93-4fc2-1234-4bbcd0ef04e6/vms/VirtualMachine:vm-5269439:6b527989-1234-4321-9478-ffe2f3afe68c/actions/remove-protection', Version: 1.1, Content:System.Net.Http.StringContent, Headers:
{
Accept: application/json
x-dr-session: YzVjOWFhNjAtMmJlOS00OFT2LWJlNzgtZDM2ZWYxNDNmYjNm
User-Agent: Mozilla/5.0
User-Agent: (Windows NT 10.0; Microsoft Windows 10.0.19045; en-US)
User-Agent: PowerShell/7.4.6
Accept-Encoding: gzip
Accept-Encoding: deflate
Accept-Encoding: br
Content-Type: application/json
Content-Length: 0
}
CategoryInfo : InvalidOperation: (Method: POST, Reque…ontent-Length: 0}:HttpRequestMessage) [Invoke-RestMethod], HttpResponseException
FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeRestMethodCommand
ErrorDetails :
InvocationInfo : System.Management.Automation.InvocationInfo
ScriptStackTrace : at <ScriptBlock>,
C:\Users\grover\SRMUnprotectVM.ps1: line 49
at <ScriptBlock>, <No file>: line 1
PipelineIterationInfo : {}
Live Recovery (Site Recovery Manager) 8.7
Workaround: Removing protection for a deleted VM through the UI.
Fixed in 8.8 and back ported to 8.7.0.4.