Site Recovery Manager API Developer’s Guide - VMware

3y ago
19 Views
2 Downloads
1.02 MB
38 Pages
Last View : 30d ago
Last Download : 3m ago
Upload by : Wade Mabry
Transcription

Site Recovery Manager APIDeveloper’s GuideVMware vCenter Site Recovery Manager 5.0EN-000739-03

Site Recovery Manager API Developer’s GuideYou can find the most up-to-date technical documentation on the VMware Web site at:http://www.vmware.com/support/The VMware Web site also provides the latest product updates.If you have comments about this documentation, submit your feedback to:docfeedback@vmware.comCopyright 2011–2013 VMware, Inc. All rights reserved. This product is protected by U.S. and international copyright andintellectual property laws. VMware products are covered by one or more patents listed athttp://www.vmware.com/go/patents.VMware is a registered trademark or trademark of VMware, Inc. in the United States and/or other jurisdictions. All other marksand names mentioned herein may be trademarks of their respective companies.VMware, Inc.3401 Hillview Ave.Palo Alto, CA 94304www.vmware.com2VMware, Inc.

ContentsAbout This Book51 The Site Recovery Manager API 7Introduction to the API 7Terminology 7vSphere API Documentation 7List of API Operations 8Managed Object Hierarchy 9WSDL Programming Environments 10SRM Objects as WSDL 10C# and Visual Studio 12Java JAX‐WS Framework 12Java Axis Client 12Accessing vCenter Site Recovery Manager 12Location of the API 12Associated vCenter Server 122 SDK Installation and Setup 13Contents of the SDK Package 13SDK Directory Structure 13Download and Setup Procedure 14About the C# .NET Samples 15About the Java JAX‐WS Samples 16About the Java Axis Samples 173 Logical Order API Usage 19Protection and Recovery Plans 19Connecting to an SRM Server 19Managed Object Reference 19SrmLoginLocale 20SrmLoginSites 20SrmLogoutLocale 21GetApiVersion 21Protection Groups and Replication 22ListInventoryMappings 22ListProtectionGroups 22ListReplicatedDatastores 22ProtectVms 22UnprotectVms 23GetTasks 23IsComplete 23GetResult 24GetProtectionStatus 24GetInfo 24GetPeer 24GetProtectionState 25ListProtectedDatastores 25VMware, Inc.3

Site Recovery Manager API Developer’s GuideListProtectedVms 25ProtectionGroupQueryVmProtection 26ProtectionGroupListRecoveryPlans 26Recovery Plans and Reprotection 26ListPlans 27GetHistory 27RecoveryPlanGetInfo 27RecoveryPlanGetPeer 28Start 28Cancel 29ListPrompts 29AnswerPrompt 29GetHistory 29GetRecoveryResult 30GetResultCount 30GetResultLength 31RetrieveStatus 31vSphere Replication Methods 31ListAssociatedVms 31AssociateVms 32UnassociateVms 32A SSL Certificates and SNMP Traps 33SSL Certificates 33Server Certificate Requirements 33Exporting Cached Certificates to a Local Directory 34About the Virtual Machine Keystore 34SNMP Traps 35MIB Names for SNMP Traps 35Configuring SNMP Receivers in vCenter Server 36SNMP Traps and Object IDs 36Index 374VMware, Inc.

About This BookThe Site Recovery Manager API Developer’s Guide provides information about programming applications withthe Web services interfaces to VMware vSphere Site Recovery Manager (SRM).This manual provides information about both the old interfaces and the new interfaces in the SRM 5.0 release,for developers who are interested in automating site recovery tasks.Revision HistoryThis book is revised with each product release or when necessary. Table 1 summarizes changes in each release.Table 1. Revision HistoryRevision DateDescription4 October 2013Added cleanupTest mode on page 8, and more about SNMP traps.23 May 2013Specified WSDL port number on page 12.27 January 2012Added Associated vCenter Server on page 12, corrected array based replication on pages 22‐23.17 November 2011Updated Site Recovery Manager API Developer’s Guide published after the SRM 5.0 release.16 June 2008Technical note entitled Site Recovery Manager API published with the SRM 1.0 release.Intended AudienceThis book is intended for developers who need to set up their environment to program applications with theSite Recovery Manager API. SRM developers typically include programmers using the Java or C# languageand libraries to perform replication, failover, and reprotection of virtual machines in VMware vSphere.SRM developers should have some familiarity with the Web Services Description Language (WSDL) and theSimple Object Access Protocol (SOAP) for transmitting XML across the network. However the importantinterfaces are completely visible in Java or C# code.VMware Developer PublicationsTo view the current version of this book as well as other VMware API and SDK public documentation, go tohttp://www.vmware.com/support/pubs/sdk pubs.html.VMware Technical Publications GlossaryVMware Technical Publications provides a glossary of terms that might be unfamiliar to you. For definitionsof terms as they are used in VMware technical documentation go to http://www.vmware.com/support/pubs.VMware, Inc.5

Site Recovery Manager API Developer’s GuideDocument FeedbackVMware welcomes your suggestions for improving our documentation. Send your feedback todocfeedback@vmware.com.Technical Support and Education ResourcesThe following sections describe the technical support resources available to you. To access the current versionsof other VMware books, go to http://www.vmware.com/support/pubs.Online and Telephone SupportTo use online support to submit technical support requests, view your product and contract information, andregister your products, go to http://www.vmware.com/support.Support OfferingsTo find out how VMware support offerings can help meet your business needs, go tohttp://www.vmware.com/support/services.VMware Professional ServicesVMware Education Services courses offer extensive hands‐on labs, case study examples, and course materialsdesigned to be used as on‐the‐job reference tools. Courses are available onsite, in the classroom, and liveonline. For onsite pilot programs and implementation best practices, VMware Consulting Services providesofferings to help you assess, plan, build, and manage your virtual environment. To access information abouteducation classes, certification programs, and consulting services, go to http://www.vmware.com/services.6VMware, Inc.

1The Site Recovery Manager API1This manual describes a Web services programming interface to protection groups and recovery plans inVMware vCenter Site Recovery Manager (SRM). This chapter discusses the following topics. “Introduction to the API” on page 7 “List of API Operations” on page 8 “Managed Object Hierarchy” on page 9 “WSDL Programming Environments” on page 10 “Accessing vCenter Site Recovery Manager” on page 12The SRM 5.0 release provides an extended API with a new set of methods to list and modify protection groups,and a set of revised methods to list, modify, and run recovery plans.Introduction to the APIThe SRM API provides an interface similar to the vSphere API, which is a object‐oriented Web service thatprovides access to vSphere and virtual machine management on vCenter Server and ESXi hosts. You programthe vSphere API in Java, C#, or any language that supports Web services definition language (WDSL).The SRM API offers a way for third party systems to initiate test, failover, reprotect, or revert operations andcollect the results. Protection groups and recovery plans are usually set up from the user interface (UI).TerminologyThis document defines and uses the following terms: Web service operations – Client interfaces that perform server‐side management and monitoring tasks.Standardized as Web Services Interoperability Organization (WS‐I) Basic Profile 1.0. WSDL – The Web services API is defined in a WSDL file, which is used by client‐side Web services tocreate proxy code (stubs) that client applications use to interact with the server.Standardized as Web Services Description Language (WSDL) 1.1. SOAP – Client applications invoke operations by sending SOAP formatted messages. When passing dataobjects between client and server, you need to build or parse a SOAP message that contains the data objectproperties as XML elements corresponding to the message structures described in the WSDL.Standardized by W3C as Simple Object Access Protocol (SOAP) 1.1. XML – A text representation scheme similar to HTML but with more stringent regularized syntax.Standardized by W3C as Extensible Markup Language (XML) 1.0.vSphere API DocumentationFor information about the vSphere API from which the SRM API is derived, see the vSphere API Reference andthe [Web Services SDK] Programming Guide, both available on the VMware Web site.VMware, Inc.7

Site Recovery Manager API Developer’s GuideList of API OperationsTable 1‐1 provides a list of SRM APIs organized by approximate order of use.Table 1-1. List of API operations by functionMethodDescription of OperationAuthenticationSrmLoginLocaleBegin a session with the SRM server.SrmLoginSitesLog in to both the local and remote vCenter Servers.SrmLogoutLocaleLog out sites and terminate the current session.Service InstanceRetrieveContentRetrieve the properties of a service instance.ProtectionListProtectionGroupsGet a list of the protection groups that are currently configured.ListInventoryMappingsGet a list of the configured inventory mappings on the protection site.ListReplicatedDatastoresGet a list of the replicated datastores (not in Release Notes).Protection GroupGetInfoRetrieve basic information about this protection group.GetPeerRetrieve the peer protection group.ListProtectedVmsList VMs protected in this group with information about their protection state.ListProtectedDatastoresRetrieve a list of the Datastores protected by this protection group.ListAssociatedVmsRetrieve the list of VMs currently associated with this group. VR only.GetProtectionStateGet the current state of the protection group.ProtectionGroupListRecoveryPlansRetrieve a list of all recovery plans this protection group is a member of.ProtectionGroupQueryVmProtectionDetermine whether the specified VMs can be or currently are protected, whichmust be mapped to recovery site as per ListInventoryMappings.ProtectVmsProtect the specified VMs. Each virtual machine’s folder, resource pool, andnetwork must be mapped to the recovery site.UnprotectVmsUnprotect the specified VMs.AssociateVmsAssociate the specified VMs with a group. VR only, a prerequisite for protection.UnassociateVmsUnassociate the specified VMs with this group. VR only.Protection TaskGetProtectionStatusGet the results of ProtectVms or UnprotectVms.GetTasksGet Task information from the vCenter Server for each virtual machine that wasrequested to be protected or unprotected.IsCompleteCheck if this Task has finished.GetResultGet the results of this Task (not in Release Notes).RecoveryListPlansRetrieve all the Recovery Plans for this SRM Server.GetHistoryRetrieve the history for a given Recovery Plan.Recovery Plan8RecoveryPlanGetInfoRetrieve basic information about the specified Recovery Plan.RecoveryPlanGetPeerGet the peer plan for this Recovery Plan. The returned object refers to a plan atthe paired site, not the local site.StartStart the Recovery Plan in a selected mode: test, cleanupTest, failover, reprotect,or revert. Requires Run privilege for tests, Failover privilege for the others.VMware, Inc.

Chapter 1 The Site Recovery Manager APITable 1-1. List of API operations by functionMethodDescription of OperationCancelCancel the specified recovery plan.ListPromptsList the current prompts that are waiting for input. When a prompt step isreached, the plan goes into waiting state until AnswerPrompt is received.Prompts are given in the same order in which VMs are scheduled to start up.AnswerPromptAnswer the current prompt displayed by a Recovery Plan. Requires the Runprivilege for test, or the Failover privilege for the other modes.Recovery HistoryGetRecoveryResultRetrieve the recovery result for a given run of a Recovery Plan.GetResultCountRetrieve total number of stored results, including both Recovery and peer plans.GetResultLengthGet length of XML result document for the requested recovery result.RetrieveStatusRetrieve XML document for an historical run of the specified recovery plan.Old 1.0 MethodsSrmLogin, SrmLogoutLog in to and out of the SRM server.GetApiVersionObtain the API version.ListRecoveryPlansGet a list of recovery plans at the SRM site.RecoveryPlanSettingsGet the settings of a specific recovery plan at the SRM site.RecoveryPlanStartStart a specific recovery plan in recovery or test mode.RecoveryPlanPausePause a running recovery plan.RecoveryPlanResumeRestart a paused recovery plan.RecoveryPlanAnswerPromptAnswer a prompt.RecoveryPlanCancelCancel a recovery plan.GetFinalStatusGet the final status of a recovery plan.Managed Object HierarchyFigure 1‐1 shows the SRM managed object class hierarchy with each managed object’s methods.Figure 1-1. SRM Object HierarchyVMware, Inc.9

Site Recovery Manager API Developer’s GuideTable 1‐2 shows the same managed object hierarchy with each managed object’s methods, in alphabetic order.Table 1-2. Managed object hierarchyManaged ObjectRemarksLocal MethodsSrmApiOld version 1.0 API,still provided forbackwardcompatibilityGetApiVersion, GetFinalStatus, ListRecoveryPlans,RecoveryPlanAnswerPrompt, RecoveryPlanCancel,RecoveryPlanPause, RecoveryPlanResume, RecoveryPlanSettings,RecoveryPlanStart, SrmLogin, SrmLogoutSrmProtectionList inventorymappings, queryprotection groupsListInventoryMappings, otectionGroupAdd virtual machinesto a protection group,get peer, queryprotected datastoresAssociateVms, GetInfo, GetPeer, GetProtectionState,ListAssociatedVms, ListProtectedDatastores, ProtectionGroupQueryVmProtection, ProtectVms, UnassociateVms,UnprotectVmsSrmProtectionTaskGet task status forprotection groupsGetProtectionStatus, GetResult, GetTasks, IsCompleteSrmRecoveryQuery recovery plansGetHistory, ListPlansSrmRecoveryHistoryRecovery plan statusGetRecoveryResult, GetResultCount, GetResultLength,RetrieveStatusSrmRecoveryPlanRun a recovery planAnswerPrompt, Cancel, ListPrompts, RecoveryPlanGetInfo,RecoveryPlanGetPeer, StartSrmServiceInstanceOpen and close sessionRetrieveContent, SrmLoginLocale, SrmLoginSites, SrmLogoutLocaleWSDL Programming EnvironmentsYou can program Web services and read WSDL files using the C# language with Visual Studio .NET, or usingthe Java language with the Axis framework or the JAX‐WS framework. You can program Web services usingmany other languages and frameworks, but they are beyond the scope of this manual.Figure 1-2. WSDL programming componentsWSDL2Java,wsdl.exe, orother toolWSDLfilesclient va, C#,or other)SRM serverSOAP-encoded WSDLnetworkconnectionmethodexecutionSRM Objects as WSDLFigure 1‐3, “SRM managed objects,” on page 11 shows SRM managed entities and class relationships as theyfit into the VMware WSDL scheme. Classes with dashed lines are vSphere managed objects; for informationabout them, see the vSphere API Reference manual.10VMware, Inc.

Chapter 1 The Site Recovery Manager APIFigure 1-3. SRM managed objectsVMware, Inc.11

Site Recovery Manager API Developer’s GuideC# and Visual StudioThe SRM SDK provides sample C# .NET code prepared for use with Visual Studio 2008, which you can convertfor use with Visual Studio 2010 and perhaps later versions as well.Java JAX-WS FrameworkThe SDK provides sample code that uses the Java Development Kit (JDK) 1.6 with the JAX‐WS frameworkbundled with the JDK 1.6. The build scripts generate Java stubs from the SRM specific WSDL.Java Axis ClientThe SRM SDK provides legacy sample code that requires Java SE 1.5 or later and Apache Axis 1.4. Samples areset up for stub generation on Windows or on Linux.Accessing vCenter Site Recovery ManagerThe SRM API provides language‐neutral interfaces to the VMware vCenter Site Recovery Manager (SRM)server management framework. Interfaces are provided for managing protection groups and recovery plans.Both array based replication and vSphere replication (VR) are supported.Location of the APIThe API is located in the following directory: installdir \wwwThe API uses the following default listener port: SOAP – 9007You can obtain the WSDL for the SRM API by requesting the file /srm.wsdl from the WSDL port 9085.(The WSDL port number changed since the previous release.)The API is implemented as an industry‐standard Web service running on the SRM server. The API complieswith the Web Services Interoperability Organization (WS‐I) Basic Profile 1.0, which includes XML Schema 1.0,SOAP 1.1, and WSDL 1.1. For details about the WS‐I Basic Profile 1.0, see the http://www.ws‐i.org Web site.Associated vCenter ServerThe Site Recovery Manager API currently does not allow you to get the location of its associated vCenterServer, however you can find the SRM location from the vCenter Server using the vim.extensionManager –look for the com.vmware.vcDr extension.In the returned extensionList URL, use the https address following the vertical bar, probably on port 8095,ending in /dr. Port 8095 is the SOAP port for the SRM server’s internal API, while port 9007 is the SOAP portfor the SRM server’s external API. Port 8095 serves internal APIs used by SRM client, and is proxied fromvCenter Server with http on port 80 or https on port 8095. SRM clients can create a tunneled SSL connectionthrough either port. Port 9007 serves APIs used by external customers so it has no proxy from vCenter Server.External clients must create an SSL connection directly to port 9007.You log in to SRM using the same credentials as for vCenter Server. Both SOAP ports 9007 and 8095 verifyagainst these credentials.12VMware, Inc.

2SDK Installation and Setup2This chapter describes how to unpack and use the SDK, and includes the following sections: “Contents of the SDK Package” on page 13 “SDK Directory Structure” on page 13 “Download and Setup Procedure” on page 14 “About the C# .NET Samples” on page 15 “About the Java JAX‐WS Samples” on page 16 “About the Java Axis Samples” on page 17Contents of the SDK PackageYou can obtain the SDK package by navigating to http://www.vmware.com/support/developer/srm‐api andclicking the Download SDK link.You will need to provide an email address or customer number, with valid password, for authentication onthe SRM download site.The SRM SDK is delivered as a ZIP archive (VMware-srm-sdk- version - build .zip) containing thefollowing items: The WSDL and XML schema files that define the API available for SRM server management. Sample C# code for .NET and Java code for JAX‐WS demonstrating how to deal with a recovery plan. Batch files and shell scripts to automate the process of generating client‐side stubs, and for rebuilding thesample applications. For C# developers, Visual Studio project and solution files are included. Documentation, including the VMware Infrastructure SDK Reference Guide (the previous name for thevSphere API Reference) with language‐neutral descriptive information about object type definitions,properties, and method signatures for the SRM API.SDK Directory StructureAfter you unzip the Site Recovery Manager SDK, the following directories and sub‐directories appear. Manyof the sub‐directories contain helpful readme files.Table 2-1. SDK directory structureDirectory or FileDescription\docContains SDK‐README files and reference documentation for the SDK.\doc\ReferenceGuideAPI Reference for the VMware vCenter Site Recovery Manager API.\doc\ReferenceGuide\index.htmlTo view the API Reference, open index.html with a Web browser.\doc\SDK Terms and Conditions.*End user license agreement for the Site Recovery Manager SDK.VMware, Inc.13

Site Recovery Manager API Developer’s GuideTable 2-1. SDK directory structureDirectory or FileDescription\samplesTop‐level directory for language‐specific versions of sample client applications.\samples\Axis\Directory containing batch files and Java source code for the Axis framework.\samples\DotNet\csDirectory containing command scripts to generate the .NET proxy classes andWeb service stub

VMware, Inc. 5 The Site Recovery Manager API Developer’s Guide provides information about programming applications with the Web services interfaces to VMware vSphere Site Recovery Manager (SRM). This manual provides information about both the old interfaces and the new interfaces in the SRM 5.0 release,

Related Documents:

api 20 e rapid 20e api 20 ne api campy api nh api staph api 20 strep api coryne api listeriaapi 20 c aux api 20 a rapid id 32 a api 50 ch api 50 chb/e 50 chl reagents to be ordered. strips ref microorganisms suspension inoculum transfer medium i

Latest API exams,latest API-571 dumps,API-571 pdf,API-571 vce,API-571 dumps,API-571 exam questions,API-571 new questions,API-571 actual tests,API-571 practice tests,API-571 real exam questions Created Date

vRealize Suite Disaster Recovery by Using Site Recovery Manager 5 1 Disaster Recovery Introduction 6 Overview of VMware Site Recovery Manager 7 Local and Remote Sites 8 Heterogeneous Configurations on the Protected and Recovery Sites 9 Site Recovery Manager Workflow 10 Restoring the Pre-Recovery Site Configuration By Performing Failback 11 2

3 API Industry Guide on API Design Apiary - Apiary jump-started the modern API design movement by making API definitions more than just about API documentation, allowing API designers to define APIs in the machine-readable API definition format API blueprint, then mock, share, and publish

04 As we explored in The API Product Mindset ebook, typical roles on an API product team include an API Product Manager who owns the processes and cross-functional coordination critical to the API's success; an API Architect responsible for designing and guiding the creation of APIs; an API Developer who builds APIs from the API Architect's designs and

Site Recovery Manager API Developer’s Guide 10 VMware, Inc. WSDL – The Web services API is defined in a WSDL file, which is used by client‐side Web services to create proxy code (stubs) that client applications use to interact with the server.

consider using Bulk API, which is based on REST principles and optimized for large sets of data. Using Compression REST API uses the same underlying data model and standard objects as those in SOAP API . See the SOAP API Developer's Guide for details. REST API also follows the same limits as SOAP API . See the Limits section

Trustee Joy Harris Jane Gardener Simon Hebditch Trustee Sarah Howell- Davies Jill Batty Cartriona Sutherland treasurer Verity Mosenthal Jenny Thoma Steve Mattingly Trustee Anne Sharpley Lynn Whyte Katy Shaw Trustee Sandra Tait Tina Thorpe Judith Lempriere The position of chair is contested so there will be an election for this post Supporting Statements David Beamish Standing for Chair I .