VMware VC-SRM4-A Developer's Guide - Page 22

Protection Groups and Replication, ListInventoryMappings, ListProtectionGroups

Page 22 highlights

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.

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38

Site Recovery Manager API Developer’s Guide
22
VMware, Inc.
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.