Site Recovery Manager API Developer's Guide
Protection Groups and Replication
This section covers the SRM API methods for protection groups and virtual machine replication.
ListInventoryMappings
You establish inventory mappings and placeholder datastores as described in the SRM Administration Guide.
This method returns the configured inventory mappings
Example 3-9. Method to list inventory mappings
inventoryMappingInfo = _service.ListInventoryMappings(_svcRef);
Parameter and return value:
_svcRef – managed object reference to an SrmProtection object
inventoryMappingInfo – a list of inventory mappings from the protected site to the recovery site:
folders – a list of mapped VirtualMachine Folders
networks – a list of mapped virtual machine Networks and dvPortgroups
pools – a list of mapped Resource Pools
ListProtectionGroups
This method lists the configured protection groups.
Example 3-10. Method to list protection groups
SrmProtectionGroup[] = _service.ListProtectionGroups(_svcRef);
Parameter and return value:
_svcRef – managed object reference to an SrmProtection object
SrmProtectionGroup[] – an array of managed object references to all the SrmProtectionGroup managed
objects that are currently configured
ListReplicatedDatastores
This method queries and lists replicated datastores. A datastore is replicated if it contains any virtual machines
in a protection group.
Example 3-11. Method to list replicated datastores
Datastore[] = _service.ListReplicatedDatastores(_svcRef);
Parameter and return value:
_svcRef – managed object reference to an SrmProtection object
Datastore[] – an array of managed object references to the replicated Datastore managed objects
You can also query protected virtual machines with "ProtectionGroupQueryVmProtection" on page 26.
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 vSphere replication (VR), you use the
AssociateVms method to place virtual machines into a protection group.
22
VMware, Inc.
Need help?
Do you have a question about the VC-SRM4-A - vCenter Site Recovery Manager and is the answer not in the manual?