Unsolved
3 Posts
0
8379
RP4VM Protect VM via REST Call
I'm trying to use the REST API to protect VMs after a series of calls to get the source and destination parameters. However I feel the documentation is somewhat lacking with how to do this.
After generating a JSON file that looks to be what I want, I am returned with the following error:
"Unexpected token (END_OBJECT), expected FIELD_NAME: missing property 'JsonSubType' that is to contain type id (for class com.emc.fapi.version5_2.commons.ReplicateVmsParam) at [Source: org.apache.catalina.connector.CoyoteInputStream@42ae5db5; line: 1, column: 2863]"
Any advice/tips or sample JSON files that I could use to replicate to a non-existing VM? The documentation has a JSON for a VM that already exists at the remote site. I've tried adapting that to what I have.
My JSON file is as below:
{
"cgName": cgName,
"productionCopy": {
"clusterUID": {
"id": source_clusterUID
},
"copyUID": 0
},
"productionCopyName": prodName,
"vmReplicationSets": [{
"replicationSetVms": [{
"copyUID": 0,
"vmParam": {
"JsonSubType": "SourceVmParam",
"vmUID": {
"uuid": source_vm_uuid,
"virtualCenterUID": {
"uuid": source_vc_uuid
}
},
"clusterUID": {
"id": source_clusterUID
}
},
"vmParam": {
"JsonSubType": "CreateVMParam",
"targetVirtualCenterUID": {
"uuid": dest_vc_uuid
},
"targetResourcePlacementParam": {
"JsonSubType": "CreateTargetVMAutomaticResourcePlacementParam",
"targetResourcePoolUID": {
"uuid": dest_virtual_resource_pool_uuid
}
},
"targetDatastoreUID": {
"uuid": dest_datastore_uuid
},
"networkDevices": [],
"clusterUID": {
"id": source_clusterUID
}
}
}],
"virtualHardwareReplicationPolicy": {
"provisionPolicy": "SAME_AS_SOURCE",
"hwChangesPolicy": "REPLICATION_HW_CHANGES"
},
"virtualDisksReplicationPolicy": {
"autoReplicationNewVirtualDisks": "true"
}
}],
"links": [{
"linkUID": {
"groupUID": {
"id": cg_uid
},
"firstCopy": {
"clusterUID": {
"id": source_clusterUID
},
"copyUID": 0
},
"secondCopy": {
"clusterUID": {
"id": dest_clusterUID
},
"copyUID": 0
}
},
"linkPolicy": {
"JsonSubType": "ConsistencyGroupLinkPolicy",
"protectionPolicy": {
"protectionType": "ASYNCHRONOUS",
"syncReplicationLatencyThresholds": {
"thresholdEnabled": "false",
"startAsyncReplicationAbove": {
"value": 5000,
"type": "MICROSECONDS"
},
"resumeSyncReplicationBelow": {
"value": 3000,
"type": "MICROSECONDS"
}
},
"syncReplicationThroughputThresholds": {
"thresholdEnabled": "false",
"startAsyncReplicationAbove": {
"value": 45000,
"type": "KB"
},
"resumeSyncReplicationBelow": {
"value": 35000,
"type": "KB"
}
},
"rpoPolicy": {
"maximumAllowedLag": {
"value": 15,
"type": "MINUTES"
},
"allowRegulation": "false",
"minimizationType": "MINIMIZE_BANDWIDTH"
},
"replicatingOverWAN": "true",
"compression": "MEDIUM",
"bandwidthLimit": 0.0,
"measureLagToTargetRPA": "true",
"deduplication": "true",
"weight": 1
},
"advancedPolicy": {
"performLongInitialization": "true",
"snapshotGranularity": "DYNAMIC"
}
}
}],
"startTransfer": "true",
"copies": [
{
"copyUID": {
"clusterUID": {
"id": source_clusterUID
},
"copyUID": 0
},
"copyName": sourceCopyName,
"volumeCreationParams": {
"volumeParams": [{
"JsonSubType": "VolumeCreationParams",
"arrayUid": {
"id": source_arrayUID,
"clusterUID": {
"id": source_clusterUID
}
},
"poolUid": {
"uuid": source_virtual_resource_pool_uuid,
"storageResourcePoolId": source_datastore_moid,
"arrayUid": {
"id": source_arrayUID,
"clusterUID": {
"id": source_clusterUID
}
}
},
"resourcePoolType": "VC_DATASTORE"
}]
}
},
{
"copyUID": {
"clusterUID": {
"id": dest_clusterUID
},
"copyUID": 0
},
"copyName": destCopyName,
"volumeCreationParams": {
"volumeParams": [{
"JsonSubType": "VolumeCreationParams",
"arrayUid": {
"id": dest_arrayUID,
"clusterUID": {
"id": dest_clusterUID
}
},
"poolUid": {
"uuid": dest_virtual_resource_pool_uuid,
"storageResourcePoolId": dest_datastore_moid,
"arrayUid": {
"id": dest_arrayUID,
"clusterUID": {
"id": dest_clusterUID
}
}
},
"resourcePoolType": "VC_DATASTORE"
}]
}
}
]
}
Thanks!
Howja
1 Message
0
March 8th, 2019 13:00
Did you have any luck figuring this out? I'm attempting to do the same thing and am struggling with the convoluted sample JSON in the documentation. I have found zero instances online of anyone successfully protecting a VM using RP4VM's REST API, and the official documentation leaves a lot to be desired. If you were successful with this, it would be awesome if you can post your updated JSON.
I03nJ9U6p21163749524500
8 Posts
0
April 1st, 2019 03:00
Hi,
I have the same problem, I'm trying to replicate a VM using RESTAPI but I don't find the complete RESTAPI documentation. Please, anyone know where can I find some document where I can see all methods and parameters?
I have seen the pdf "docu89863_RecoverPoint-for-Virtual-Machines-5.2-REST-API-Guide.pdf" but there is very limited info.
Thanks and regards,
Francisco Tomas.
mosheb
7 Posts
0
April 24th, 2019 01:00
Hi,
I'm currently working on the same problem... Accessing RP4VM with abstract classes fails with no good explaination.
Some time has passed since the original post. Did anyone find a solution and can provide a JSON example?
raghav.viswanathan
39 Posts
0
May 7th, 2019 23:00
Lipun
3 Posts
0
July 3rd, 2019 00:00
Hi Viswanathan,
Need some help, please suggest how do we get the VM uuid through REST API for a source VM, such that we can populate the below replicate VM parameter.
"vmParam": {
"JsonSubType": "ExistingVMParam",
"vmUID": {
"uuid": "502236e5-38ce-a578-98cd-96ea5fee0445",
Lipun
3 Posts
0
July 3rd, 2019 00:00
Idan
675 Posts
0
July 3rd, 2019 00:00
Idan
675 Posts
0
July 3rd, 2019 01:00
That's right because we don't have a call which will show you the VM UUID of a VM we're not protecting yet. To clarify my previous response, this is something you'll need to query vCenter for.
Lipun
3 Posts
0
July 3rd, 2019 01:00
Thanks for suggestion.
But i want know Which Vcenter Api. i have checked all Vcenter api(https://{}:7225/fapi/rest/5_2/recoverpoint.wadl) but not found any api to reponse vmUUI(uuid)..
Please help me in this regards.
kelvinw22
13 Posts
0
September 26th, 2019 18:00
Just google and you can find the one-liner you need
https://communities.vmware.com/thread/152365
Get-VM | %{(Get-View $_.Id).config.uuid}