Developer's Guide
Page 3
... Site Recovery Manager API 7 Introduction to the API 7 Terminology 7 vSphere API Documentation 7 List of API Operations 8 Managed Object Hierarchy 9 WSDL Programming Environments 10 SRM Objects as WSDL 10 C# and Visual Studio 12 Java JAX‐WS Framework 12 Java Axis Client 12 Accessing vCenter Site Recovery Manager 12 Location of the API 12 Associated vCenter Server 12 2 SDK Installation and Setup 13 Contents of the SDK Package 13 SDK Directory Structure 13 Download and Setup...
... Site Recovery Manager API 7 Introduction to the API 7 Terminology 7 vSphere API Documentation 7 List of API Operations 8 Managed Object Hierarchy 9 WSDL Programming Environments 10 SRM Objects as WSDL 10 C# and Visual Studio 12 Java JAX‐WS Framework 12 Java Axis Client 12 Accessing vCenter Site Recovery Manager 12 Location of the API 12 Associated vCenter Server 12 2 SDK Installation and Setup 13 Contents of the SDK Package 13 SDK Directory Structure 13 Download and Setup...
Developer's Guide
Page 5
...@vmware.com. This manual provides information about programming applications with the Web services interfaces to you. Table 1. SRM developers typically include programmers using the Java or C# language and libraries to perform replication, failover, and reprotection of terms that might be unfamiliar to VMware vSphere Site Recovery Manager (SRM). Document Feedback VMware welcomes your feedback to program applications with the Web Services Description Language (WSDL) and the Simple Object Access...
...@vmware.com. This manual provides information about programming applications with the Web services interfaces to you. Table 1. SRM developers typically include programmers using the Java or C# language and libraries to perform replication, failover, and reprotection of terms that might be unfamiliar to VMware vSphere Site Recovery Manager (SRM). Document Feedback VMware welcomes your feedback to program applications with the Web Services Description Language (WSDL) and the Simple Object Access...
Developer's Guide
Page 6
... help you . To access information about education classes, certification programs, and consulting services, go to http://www.vmware.com/support. Site Recovery Manager API Developer's Guide Technical Support and Education Resources The following sections describe the technical support resources available to you assess, plan, build, and manage your virtual environment. Courses are available onsite, in the classroom, and live online. Online and Telephone Support To use...
... help you . To access information about education classes, certification programs, and consulting services, go to http://www.vmware.com/support. Site Recovery Manager API Developer's Guide Technical Support and Education Resources The following sections describe the technical support resources available to you assess, plan, build, and manage your virtual environment. Courses are available onsite, in the classroom, and live online. Online and Telephone Support To use...
Developer's Guide
Page 7
... the [Web Services SDK] Programming Guide, both available on the VMware Web site. Standardized as Web Services Description Language (WSDL) 1.1. SOAP - When passing data objects between client and server, you need to build or parse a SOAP message that provides access to vSphere and virtual machine management on page 12 The SRM 5.0 release provides an extended API with a new set of methods to list and modify protection groups, and a set up from...
... the [Web Services SDK] Programming Guide, both available on the VMware Web site. Standardized as Web Services Description Language (WSDL) 1.1. SOAP - When passing data objects between client and server, you need to build or parse a SOAP message that provides access to vSphere and virtual machine management on page 12 The SRM 5.0 release provides an extended API with a new set of methods to list and modify protection groups, and a set up from...
Developer's Guide
Page 8
... protection group. Start Start the Recovery Plan in a selected mode: failover, reprotect, revert, or test. Site Recovery Manager API Developer's Guide List of API Operations Table 1‐1 provides a list of SRM APIs organized by this protection group. ListInventoryMappings Get a list of the protection group. Protection Group GetInfo Retrieve basic information about the specified Recovery Plan. GetPeer Retrieve the peer protection group. UnassociateVms Unassociate the specified VMs with the SRM server...
... protection group. Start Start the Recovery Plan in a selected mode: failover, reprotect, revert, or test. Site Recovery Manager API Developer's Guide List of API Operations Table 1‐1 provides a list of SRM APIs organized by this protection group. ListInventoryMappings Get a list of the protection group. Protection Group GetInfo Retrieve basic information about the specified Recovery Plan. GetPeer Retrieve the peer protection group. UnassociateVms Unassociate the specified VMs with the SRM server...
Developer's Guide
Page 9
... the SRM server. Recovery History GetRecoveryResult Retrieve the recovery result for the other modes. Figure 1-1. Chapter 1 The Site Recovery Manager API Table 1-1. Requires the Run privilege for test, or the Failover privilege for a given run of a specific recovery plan at the SRM site. RecoveryPlanSettings Get the settings of the specified recovery plan. GetApiVersion Obtain the API version. RecoveryPlanAnswerPrompt Answer a prompt. List of a recovery plan. Managed Object Hierarchy Figure...
... the SRM server. Recovery History GetRecoveryResult Retrieve the recovery result for the other modes. Figure 1-1. Chapter 1 The Site Recovery Manager API Table 1-1. Requires the Run privilege for test, or the Failover privilege for a given run of a specific recovery plan at the SRM site. RecoveryPlanSettings Get the settings of the specified recovery plan. GetApiVersion Obtain the API version. RecoveryPlanAnswerPrompt Answer a prompt. List of a recovery plan. Managed Object Hierarchy Figure...
Developer's Guide
Page 10
... information about them, see the vSphere API Reference manual. 10 VMware, Inc. WSDL programming components WSDL files WSDL2Java, wsdl.exe, or other tool client application method invocation client proxy interface (Java, C#, or other languages and frameworks, but they fit into the VMware WSDL scheme. Site Recovery Manager API Developer's Guide Table 1‐2 shows the same managed object hierarchy with the Axis framework or the JAX‐WS...
... information about them, see the vSphere API Reference manual. 10 VMware, Inc. WSDL programming components WSDL files WSDL2Java, wsdl.exe, or other tool client application method invocation client proxy interface (Java, C#, or other languages and frameworks, but they fit into the VMware WSDL scheme. Site Recovery Manager API Developer's Guide Table 1‐2 shows the same managed object hierarchy with the Axis framework or the JAX‐WS...
Developer's Guide
Page 12
... server. Location of its associated vCenter Server, however you can create a tunneled SSL connection through either port. Port 9007 serves APIs used by requesting the file /srm.wsdl from vCenter Server. The build scripts generate Java stubs from the vCenter Server using the same credentials as for vCenter Server. For details about the WS‐I ) Basic Profile 1.0, which you to port 9007. You log in to the VMware vCenter Site Recovery Manager (SRM) server management framework. Samples are set...
... server. Location of its associated vCenter Server, however you can create a tunneled SSL connection through either port. Port 9007 serves APIs used by requesting the file /srm.wsdl from vCenter Server. The build scripts generate Java stubs from the vCenter Server using the same credentials as for vCenter Server. For details about the WS‐I ) Basic Profile 1.0, which you to port 9007. You log in to the VMware vCenter Site Recovery Manager (SRM) server management framework. Samples are set...
Developer's Guide
Page 13
...;README files and reference documentation for the SDK. \doc\ReferenceGuide API Reference for the VMware vCenter Site Recovery Manager API. \doc\ReferenceGuide\index.html To view the API Reference, open index.html with language‐neutral descriptive information about object type definitions, properties, and method signatures for authentication on page 17 Contents of the sub‐directories contain helpful readme files. VMware, Inc. 13 2 SDK Installation and Setup 2 This...
...;README files and reference documentation for the SDK. \doc\ReferenceGuide API Reference for the VMware vCenter Site Recovery Manager API. \doc\ReferenceGuide\index.html To view the API Reference, open index.html with language‐neutral descriptive information about object type definitions, properties, and method signatures for authentication on page 17 Contents of the sub‐directories contain helpful readme files. VMware, Inc. 13 2 SDK Installation and Setup 2 This...
Developer's Guide
Page 14
... the command‐line C# compiler (csc.exe), both of which get the .NET 2.0 Software Development Kit from the gensrmstubs.cmd script. Sample code RecoveryPlan.java is a vCenter Site Recovery Manager server that comes with srm-Service.wsdl (not srm.wsdl directly). \wsdl\srm\*.xsd XML schema definition files (six). Download and Setup Procedure Setting up your environment to develop client applications with project (.csproj) file. \samples\JAXWS\ Directory containing Java source code...
... the command‐line C# compiler (csc.exe), both of which get the .NET 2.0 Software Development Kit from the gensrmstubs.cmd script. Sample code RecoveryPlan.java is a vCenter Site Recovery Manager server that comes with srm-Service.wsdl (not srm.wsdl directly). \wsdl\srm\*.xsd XML schema definition files (six). Download and Setup Procedure Setting up your environment to develop client applications with project (.csproj) file. \samples\JAXWS\ Directory containing Java source code...
Developer's Guide
Page 15
... default folder C:\Program Files\Microsoft Visual Studio 9.0, you installed Visual C# 2008 Express in the default location, skip this step. Use quotation marks around directory names that you can build C# .NET samples using Microsoft Visual C# 2008 Express or Microsoft Visual Studio 2008. To display help text for the specified recovery plan. Otherwise: a Create the System environment variable VSINSTALLDIR. The build process generates the RecoveryPlan sample program, which lists all recovery...
... default folder C:\Program Files\Microsoft Visual Studio 9.0, you installed Visual C# 2008 Express in the default location, skip this step. Use quotation marks around directory names that you can build C# .NET samples using Microsoft Visual C# 2008 Express or Microsoft Visual Studio 2008. To display help text for the specified recovery plan. Otherwise: a Create the System environment variable VSINSTALLDIR. The build process generates the RecoveryPlan sample program, which lists all recovery...
Developer's Guide
Page 16
... the program. Site Recovery Manager API Developer's Guide 4 Run the sample code at the command prompt. Any sample program should print its usage summary if you do not specify an options, or if you can remove build files by the build.bat script, the WSDL file must be in a sub‐directory of an installed JDK 1.6 update 22 or later, C:\Program Files\Java\jdk1.6.0_29 for...
... the program. Site Recovery Manager API Developer's Guide 4 Run the sample code at the command prompt. Any sample program should print its usage summary if you do not specify an options, or if you can remove build files by the build.bat script, the WSDL file must be in a sub‐directory of an installed JDK 1.6 update 22 or later, C:\Program Files\Java\jdk1.6.0_29 for...
Developer's Guide
Page 17
... in Table 2‐2. Table 2-2. C:\Java\jdk1.5.0_08 3 Start the Windows command prompt (or Linux shell). VMware, Inc. 17 JAVAHOME Path to the top‐level Axis installation directory. To build the Java Axis sample code 1 Make sure the Java development kit and Apache Axis are installed and functioning. 2 Set the environment variables as follows: run.bat com.vmware.samples.recovery.RecoveryPlan --url --username --password --planname If you can remove build files...
... in Table 2‐2. Table 2-2. C:\Java\jdk1.5.0_08 3 Start the Windows command prompt (or Linux shell). VMware, Inc. 17 JAVAHOME Path to the top‐level Axis installation directory. To build the Java Axis sample code 1 Make sure the Java development kit and Apache Axis are installed and functioning. 2 Set the environment variables as follows: run.bat com.vmware.samples.recovery.RecoveryPlan --url --username --password --planname If you can remove build files...
Developer's Guide
Page 19
... contain methods for making method calls. For details about the UI, see the SRM Administration Guide. Connecting to an SRM Server Programs connect to an SRM server using the SrmLoginSites API. Managed Object Reference SRM methods take a managed object reference _this, which is similar to create recovery plans and reprotection. SVC_INST_REF.setValue(SVC_INST_NAME); Example 3-1. Java code to SRM servers at both the protected site and the recovery site using the SrmLoginLocale API...
... contain methods for making method calls. For details about the UI, see the SRM Administration Guide. Connecting to an SRM Server Programs connect to an SRM server using the SrmLoginSites API. Managed Object Reference SRM methods take a managed object reference _this, which is similar to create recovery plans and reprotection. SVC_INST_REF.setValue(SVC_INST_NAME); Example 3-1. Java code to SRM servers at both the protected site and the recovery site using the SrmLoginLocale API...
Developer's Guide
Page 20
... a subclass of _service, for SRM login protected SrmService _service; managed object reference to the C# code but uses a service locator. Example 3-3. srmPort.srmLoginLocale(SVC_INST_REF, userName, password, null); isConnected = true; Example 3-5. user name authorized for SRM login private static SrmPortType srmPort; Java code for access to the remote vCenter Server 20 VMware, Inc. srmPort = srmService.getSrmPort(); In these examples, a locale string could be provided instead of an SRM server and authentication credentials. protected ManagedObjectReference _svcRef...
... a subclass of _service, for SRM login protected SrmService _service; managed object reference to the C# code but uses a service locator. Example 3-3. srmPort.srmLoginLocale(SVC_INST_REF, userName, password, null); isConnected = true; Example 3-5. user name authorized for SRM login private static SrmPortType srmPort; Java code for access to the remote vCenter Server 20 VMware, Inc. srmPort = srmService.getSrmPort(); In these examples, a locale string could be provided instead of an SRM server and authentication credentials. protected ManagedObjectReference _svcRef...
Developer's Guide
Page 22
... VMware, Inc. Method to an SrmProtection object Datastore[] - managed object reference to list replicated datastores Datastore[] = _service.ListReplicatedDatastores(_svcRef); With vSphere replication (VR), you use the AssociateVms method to the recovery site: folders - a list of the virtual machines. a list of mapped VirtualMachine Folders networks - With array based replication, the protection group is replicated if it contains any virtual machines in the SRM Administration Guide. a list of managed object...
... VMware, Inc. Method to an SrmProtection object Datastore[] - managed object reference to list replicated datastores Datastore[] = _service.ListReplicatedDatastores(_svcRef); With vSphere replication (VR), you use the AssociateVms method to the recovery site: folders - a list of the virtual machines. a list of mapped VirtualMachine Folders networks - With array based replication, the protection group is replicated if it contains any virtual machines in the SRM Administration Guide. a list of managed object...
Developer's Guide
Page 24
Site Recovery Manager API Developer's Guide isDone - data object with at the peer site. To get an SrmProtectionGroup managed object reference, see SrmProtectionGroupVmProtectionInfo in the API Reference Guide GetProtectionStatus This method gets the virtual machine protection status after completion of ProtectVms or UnprotectVms. Example 3-17. Example 3-18. managed object reference to an SrmProtectionGroup object ptGrpInfo - Parameters and return value: _svcRef - Method to get protection task...
Site Recovery Manager API Developer's Guide isDone - data object with at the peer site. To get an SrmProtectionGroup managed object reference, see SrmProtectionGroupVmProtectionInfo in the API Reference Guide GetProtectionStatus This method gets the virtual machine protection status after completion of ProtectVms or UnprotectVms. Example 3-17. Example 3-18. managed object reference to an SrmProtectionGroup object ptGrpInfo - Parameters and return value: _svcRef - Method to get protection task...
Developer's Guide
Page 34
... Tools menu, select Internet Options to open the Internet Options properties page. 3 Click the Content tab to activate the content advisor. 4 Click Certificates to open the Certificate manager. 5 Click the Trusted Root Certificate Authorities tab to find the certificate. Site Recovery Manager API Developer's Guide For C# developers, you can continue setting up your Java development environment, see "Setting Up for Java Development" in the Developer's Setup Guide located at VMware's Web site developer support page under the vSphere Web Services...
... Tools menu, select Internet Options to open the Internet Options properties page. 3 Click the Content tab to activate the content advisor. 4 Click Certificates to open the Certificate manager. 5 Click the Trusted Root Certificate Authorities tab to find the certificate. Site Recovery Manager API Developer's Guide For C# developers, you can continue setting up your Java development environment, see "Setting Up for Java Development" in the Developer's Setup Guide located at VMware's Web site developer support page under the vSphere Web Services...
Developer's Guide
Page 35
... need to configure the vCenter Server to forward the SNMP traps to run a Callout command on the recovery site when SRM has started to prompt [data.PromptKey] amd os no longer paused waiting for user input. PromptKey is not fired. Appendix A SSL Certificates and SNMP Traps SNMP Traps SRM provides Simple Network Management Protocol (SNMP) traps that collect information sent by client applications. RecoveryPlanExecuteEnd...
... need to configure the vCenter Server to forward the SNMP traps to run a Callout command on the recovery site when SRM has started to prompt [data.PromptKey] amd os no longer paused waiting for user input. PromptKey is not fired. Appendix A SSL Certificates and SNMP Traps SNMP Traps SRM provides Simple Network Management Protocol (SNMP) traps that collect information sent by client applications. RecoveryPlanExecuteEnd...
Developer's Guide
Page 38
..., definition 7 software setup for using SDK 14 SrmApi, older method class 9 SrmLoginLocale method 20 SrmLoginSites method 20 SrmLogoutLocale method 21 SrmProtection, groups and inventory 8 SrmProtectionGroup, virtual machine groups 8 SrmProtectionTask, protection group activity 8 SrmRecovery, get plans and history 8 SrmRecoveryHistory, recovery plan results 9 SrmServiceInstance, authentication class 8, 19 SSL security certificate for SRM server 33 SSL security certificate, local directory 34 start a recovery plan 8, 28 Start method 28 T technical support resources 6 traps...
..., definition 7 software setup for using SDK 14 SrmApi, older method class 9 SrmLoginLocale method 20 SrmLoginSites method 20 SrmLogoutLocale method 21 SrmProtection, groups and inventory 8 SrmProtectionGroup, virtual machine groups 8 SrmProtectionTask, protection group activity 8 SrmRecovery, get plans and history 8 SrmRecoveryHistory, recovery plan results 9 SrmServiceInstance, authentication class 8, 19 SSL security certificate for SRM server 33 SSL security certificate, local directory 34 start a recovery plan 8, 28 Start method 28 T technical support resources 6 traps...