ListProtectedVms

Retrieves the list of virtual machines currently protected in the specified protection group, with information about their placeholder VM and protection state.

Synopsis

ProtectionGroup.ProtectedVm[] listProtectedVms( )

ProtectedVm[] is an array of ProtectedVm data objects with the following fields:

Field Description
faults any faults associated with this protected virtual machine
needsConfiguration the protected virtual machine needs to be configured or repaired
peerProtectedVm the protected virtual machine identifier on the remote site
peerState the protection state on the remote site
protectedVm the protected virtual machine identifier on the local site
state the protection state of this particular virtual machine
vm the locally protected virtual machine (this reference is valid after reprotect or revert operations)
vmName the name of the locally protected virtual machine.
drVmIdentity

A DR-service (SRM) specific globally unique identifier for the virtual machine associated with this ProtectedVm object and similarly for the virtual machine associated with this ProtectedVm object's peer (e.g. the recovered virtual machine).

This identifier is generated by an SRM server; it does not necessarily correspond to any identifier in vCenter or any other service. The value of this property is the same in the peer ProtectedVm managed object. The value is immutable and is maintained on both sites after failover and reprotect+failback. After this virtual machine is unprotected (ProtectedVm object is removed) the value of this identity may be reused but only by a ProtectedVm instance that is subsequently protecting the same virtual machine.

Note: There is no guarantee that a virtual machine's drVmIdentity value remains the same even if it is unprotected and then reprotected. Maintaining this value is currently only a best-effort operation.

Faults

  • RuntimeFault

See Faults in Site Recovery Manager API for more details.

Example for ListProtectedVms

List < SrmProtectionGroupProtectedVm > protectedVms = srmPortType.listProtectedVms(ManagedObjectReference _this);

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