bradbbee
Contributor
Contributor

Getting information for Managed Object Reference object

Hello,

I am using VMWare SRM API (VMware vCenter Site Recovery Manager 5.0) to query information about various objects including Protection Groups, Datastores, VMs, Recovery Plans etc.

There are ways to get more information for ProtectionGroups and RecoveryPlans via GetInfo() and  RecoveryPlanGetInfo() respectively. But how do I get this extended information (atleast the name) for other objects such as Datastores, VMs, etc.

Thanks,

Hemanth

0 Kudos
3 Replies
admin
Immortal
Immortal

You would need to use other API's for gaining information from vCenter. Here's a list of the API's:

VMware API and SDK Documentation

0 Kudos
kac2
Expert
Expert

I'm also in the same boat. I'm trying to use SoapUI to connect to SRM so I can get the Raw envelope.

Has anyone ever used SoapUI with SRM? I've been on 2 forums and no one can figure out how create the ManagedObjectReference session container (as depicted in the API documentation). I've tried with both SoapUI and Ruby using the Savon gem. Each time I end up with the following error:

HTTP/1.1 500 Internal Server Error

Date: Wed, 11 Dec 2013 15:24:26 GMT

Set-Cookie: vmware_soap_session="52f5fdd9-

7657-6d62-5476-8e132801fe24"; Path=/; HttpOnly; Secure;
Cache-Control: no-cache
Connection: Keep-Alive
Content-Type: text/xml; charset=utf-8
Content-Length: 649

<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
  xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body>
<soapenv:Fault>
  <faultcode>ClientFaultCode</faultcode>
   <faultstring>Unsupported version URI &quot;urn:srm0/2.0&quot;

while parsing SOAP body
at line 3, column 3

while parsing SOAP envelope
at line 1, column 0

while parsing HTTP request before method was determined
at line 1, column 0</faultstring>
</soapenv:Fault>
</soapenv:Body>
</soapenv:Envelope>

Any help would be greatly appreciated

Screen Shot 2013-12-11 at 12.48.05 PM.png

Here is the output from the ruby console when trying to use the Savon gem:

D, [2013-12-11T10:15:13.451613 #9643] DEBUG -- : HTTPI GET request to srm-vcenter-a.kendrickcoleman.c0m (httpclient)

at depth 0 - 20: unable to get local issuer certificate

I, [2013-12-11T10:15:13.632403 #9643]  INFO -- : SOAP request: https://srm-vcenter-a.kendrickcoleman.c0m/sdk/srm

I, [2013-12-11T10:15:13.632529 #9643]  INFO -- : SOAPAction: "urn:srm0/2.0", Content-Type: text/xml;charset=UTF-8, Content-Length: 509

D, [2013-12-11T10:15:13.632597 #9643] DEBUG -- : <?xml version="1.0" encoding="UTF-8"?><env:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:srm0="urn:srm0Service" xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ins0="urn:srm0"><env:Body><srm0:SrmLoginLocale><srm0:_this>#<ManagedObjectReference:0x007fddb3a0daa0></srm0:_this><srm0:username>kcoleman</srm0:username><srm0:password>mypw</srm0:password><srm0:locale xsi:nil="true"/></srm0:SrmLoginLocale></env:Body></env:Envelope>

D, [2013-12-11T10:15:13.632963 #9643] DEBUG -- : HTTPI POST request to srm-vcenter-a.kendrickcoleman.c0m (httpclient)

at depth 0 - 20: unable to get local issuer certificate

I, [2013-12-11T10:15:13.653343 #9643]  INFO -- : SOAP response (status 500)

D, [2013-12-11T10:15:13.653460 #9643] DEBUG -- : <?xml version="1.0" encoding="UTF-8"?>

<soapenv:Envelope xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"

xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"

xmlns:xsd="http://www.w3.org/2001/XMLSchema"

xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

<soapenv:Body>

<soapenv:Fault>

  <faultcode>ClientFaultCode</faultcode>

  <faultstring>Unsupported version URI &quot;urn:srm0/2.0&quot;

while parsing SOAP body

at line 1, column 256

while parsing SOAP envelope

at line 1, column 38

while parsing HTTP request before method was determined

at line 1, column 0</faultstring>

</soapenv:Fault>

</soapenv:Body>

</soapenv:Envelope>

/Users/colemk1/.rvm/gems/ruby-2.0.0-p247/gems/savon-2.3.0/lib/savon/response.rb:85:in `raise_soap_and_http_errors!': (ClientFaultCode) Unsupported version URI "urn:srm0/2.0" (Savon::SOAPFault)

while parsing SOAP body

at line 1, column 256

while parsing SOAP envelope

at line 1, column 38

while parsing HTTP request before method was determined

at line 1, column 0

    from /Users/colemk1/.rvm/gems/ruby-2.0.0-p247/gems/savon-2.3.0/lib/savon/response.rb:14:in `initialize'

    from /Users/colemk1/.rvm/gems/ruby-2.0.0-p247/gems/savon-2.3.0/lib/savon/operation.rb:64:in `new'

    from /Users/colemk1/.rvm/gems/ruby-2.0.0-p247/gems/savon-2.3.0/lib/savon/operation.rb:64:in `create_response'

    from /Users/colemk1/.rvm/gems/ruby-2.0.0-p247/gems/savon-2.3.0/lib/savon/operation.rb:55:in `call'

    from /Users/colemk1/.rvm/gems/ruby-2.0.0-p247/gems/savon-2.3.0/lib/savon/client.rb:36:in `call'

    from /Users/colemk1/Documents/Aptana Studio 3 Workspace/SRMconnectiontest/srmtest.rb:36:in `<main>'

0 Kudos
SBeso
Contributor
Contributor

Hi all,

I'm in the same situation.

Someone has resolved it?

Thanks

0 Kudos