This method gets the virtual machine protection status after completion of ProtectVms or UnprotectVms.

Synopsis

ProtectionGroup.VmProtectionInfo[] getProtectionStatus()

VmProtectionInfo[] – the completed protection status of VMs that were requested to be protected or unprotected. For more information about VmProtectionInfo, see ProtectionGroupQueryVmProtection.

The VmProtectionInfo.ProtectionStatus has the following fields:

Fields Description
canBeProtected the VM is able to be protected, but is not currently
canNotBeProtected the VM is not able to be protected
isProtected the VM is already protected
needsConfiguration the VM must be configured or repaired before it may be protected. Please check the faults property for information about any additional prerequisites.

Faults

  • RuntimeFault

For information about the faults that Site Recovery Manager throws, see Faults in Site Recovery Manager API.

Example for GetProtectionStatus

List < SrmProtectionGroupVmProtectionInfo > protectionStatus = srmPortType.getProtectionStatus(ManagedObjectReference _this);

Where ManagedObjectReference _this = _protectionTaskRef;
where _protectionTaskRef can be taken from:
  SrmServiceInstanceContent content = _srmPortType.retrieveContent(_svcRef);
ManagedObjectReference _protectionRef = content.getProtection();
List < ManagedObjectReference > groups = srmPortType.listProtectionGroups(_protectionRef);
_protectionGroupRef = groups.get(0);
ManagedObjectReference _protectionTaskRef = srmPortType.protectVms(
  _protectionGroupRef,
  _vms);