Hello there.
I use SRM Appliance Management Version 8.3.0
My issue is to add a new VM into a protection group via SRM SOAP API. I have to use Python.
The protection group type in my SRM is Individual VMs (vSphere Replication).
Regarding documentation (https://code.vmware.com/docs/11774/site-recovery-manager-api-developer-s-guide)
to do that I need to call 2 methods from the ‘SrmProtectionGroup’ managed object: ProtectVms() и AssociateVms().
AssociateVms() is executed fine: VM is added to the group, but its mappings are not configured (protection status: Not Configured).
ProtectVms() call error:
…
<soapenv:Fault><faultcode>ServerFaultCode</faultcode><faultstring>
Required property vm is missing from data object of type SrmProtectionGroupVmProtectionSpec
while parsing serialized DataObject of type drextapi.ProtectionGroup.VmProtectionSpec
…
As I understand, It means I have to add one more argument with mappings’ definitions.
XML body from the python script:
data_protect_vms = “””
<soapenv:Envelope xmlns:soapenv=”http://schemas.xmlsoap.org/soap/envelope/” xmlns:urn=”urn:srm0″>
<soapenv:Header/>
<soapenv:Body>
<urn:ProtectVms>
<urn:_this type=”SrmProtectionGroup”>srm-vm-protection-group-1271</urn:_this>
<urn:vms>vm-481</urn:vms>
</urn:ProtectVms>
</soapenv:Body>
</soapenv:Envelope>
“””
Obviously, it’s needed to add a string:
<urn:SrmProtectionGroupVmProtectionSpec>some_value</urn:SrmProtectionGroupVmProtectionSpec>
The question is which format should I use for some_value and how to get mappings and put them into some_value in a correct way?
Maybe I do everything wrong and a solution(managed object and methods) should be totally different?