Getresultlength; Retrievestatus; Listassociatedvms; Vsphere Replication Methods - VMware VC-SRM4-A - vCenter Site Recovery Manager Developer's Manual

Site recovery manager api
Table of Contents

Advertisement

GetResultLength

This method retrieves the size of the XML results for the specified recovery plan or peer plan history.
Example 3-38. Method to get size of recovery result
length = _service.GetResultLength(_srm.history, key);
Parameters and return value:
_srm.history – managed object reference to an SrmRecoveryHistory object
key – unique key for the plan history, from return value of the GetRecoveryResults method
length – integer specifying the number of lines in the XML file

RetrieveStatus

This method gets the XML representation for the specified historical run of the referenced recovery plan. The 
XML document is returned in chunks limited by the maximum length of a string in the transport layer. You 
specify what line to start at and how many lines to return. Only after you have retrieved all the lines and 
assembled them do you have a valid XML document.
Example 3-39. Method to get recovery history XML
*recoveryhistory = _service.RetrieveStatus(_srm.history, key, offset, lines);
Parameters and return value:
_srm.history – managed object reference to an SrmRecoveryHistory object
key – unique key for the plan history, from return value of the GetRecoveryResults method
offset – integer specifying the starting line number in the XML file, starting at 0
lines – integer specifying the maximum number of lines to retrieve
recoveryhistory – string containing an XML representation of all recovery steps and their results
vSphere Replication Methods
You can use these methods with vSphere replication (VR) but not with array based replication.
For array based replication, SRM organizes datastore groups to collect all files associated with protected 
virtual machines. You associate datastore groups with protection groups. All virtual machines in a datastore 
group replicate files together, and all virtual machines failover together.
For VR, you can configure replication for one virtual machine by associating it with a protection group, or you 
can configure multiple virtual machines by associating their folder or datacenter with a protection group.

ListAssociatedVms

This method lists the virtual machines currently associated with a specified VR protection group. For the 
method to get a list of protection groups, see "ListProtectionGroups" on page 22.
Example 3-40. Method to list associated virtual machines
VirtualMachine[] = _service.ListAssociatedVms(_svcPtGrp);
Parameter and return value:
_svcPtGrp – managed object reference to an SrmProtectionGroup object
VirtualMachine[] – an array of managed object references to VirtualMachine objects
VMware, Inc.
Chapter 3 Logical Order API Usage
31

Advertisement

Table of Contents
loading

This manual is also suitable for:

Vcenter site recovery manager 5.0

Table of Contents