ProtectVms

This method adds virtual machines to a protection group. With array-based replication, the protection group is determined by datastore location of the virtual machines. With host-based replication (vSphere replication), you can use the AssociateVms method to place virtual machines into a protection group. With vVol replication, the protection group is determined by replication groups of the virtual machines. To protect a Virtual Machine, its folder, resource pool, and network must be mapped from the protected site to the recovery site. To get a list of currently configured mappings, see ListInventoryMappings. If a few or all the VMs in the list are already protected, then the operation succeeds.

Synopsis

ProtectionTask protectVms(ProtectionGroup.VmProtectionSpec[] vms)

vms[] is a list of virtual machines to protect. If some of the virtual machines from the list or all of them are already protected, the operation succeeds.

ProtectionTask is the task object to monitor for status of the requested virtual machines.

Faults

  • RuntimeFault

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

Example for ProtectVms

SrmProtectionTaskRef = _service.ProtectVms(_svcRef, vm[] );