Zerto APIs : VRAs API : VRAs: Change Recovery VRA APIs
  
VRAs: Change Recovery VRA APIs
Using the Change Recovery VRA APIs, you can change the recovery VRA for all virtual machines at once or specify the virtual machines to change.
There are two ways to run a change recovery VRA operation:
One-Step Operation for Changing Recovery VRA
Multi-Step Operation for Changing Recovery VRA
Privileges Required
Manage VRA
One-Step Operation for Changing Recovery VRA
Run this API to change the recovery VRA for all or specific virtual machines.
 
method
url
POST
https://zvm_ip:port/v1/vras/{vraIdentifier}/changeRecoveryVra/execute
 
Where:
 
zvm_ip
The IP address of the Zerto Virtual Manager where the API is run.
port
The port to access the Zerto Virtual Manager. The default port is 9669.
vraIdentifier
The identifier of the VRA.
Request Body Using Json Format
Response In Json Format
Request Body Using Json Format
The following is an example request.
{
  "VmsAllocations": [
    {
    "VmIdentifier": "vmId",
    "HostIdentifier": "hostId"
    },
    {
    "VmIdentifier": "vmId",
    "HostIdentifier": "null"
    }
  ]
}
 
Parameter
Description
mandatory
default
VmsAllocations
An array holding VMs with the identifiers of their new target host.
By default this parameter is set to null, which means all VMs will be automatically changed to recover to the most suitable target hosts.
When VMs are specified, only those specified will change host, once they pass validations.
VMs not specified are kept on their current recovery host.
VMs that are specified without a HostIdentifier (null), will be automatically changed to recover to the most suitable target hosts.
No
Null
VmIdentifier
The internal virtual machine identifier. The identifier comprises the server identifier and the virtual machine moref, with the format, serverid.moref.
No
 
HostIdentifier
The unique identifier of the host that the VM will be recovered to.
No
 
Response In Json Format
The following is an example response.
 
{
  "TaskIdentifier": "String content"
}
 
 
Parameter
Description
TaskIdentifier
The identifier of the task that can be used with the Tasks API to monitor the ongoing status.
Back to VRAs API
Back to All APIs
Multi-Step Operation for Changing Recovery VRA
Follow the below steps:
1. Get a Recovery Host Identifier.
2. Get VRA Alert Status.
3. To change the Recovery VRA, first get a list of target hosts for all VMs or specific VMs:
Run Get Potential Target Hosts to get a list of potential target hosts. Then, you can use that list to assign different target hosts for the VMs.
Or, run Get Recommendation to get a list of VMs paired with their recommended target hosts.
4. Run Validate Prior to Execute to ensure the operation will work successfully.
5. Execute the change recovery VRA operation.
Get a Recovery Host Identifier
Run this API to get a a list of virtual machines and their recovery host identifier. The full API can be found here: Protected VMs API.
 
method
 
url
GET
https://zvm_ip:port/v1/vms
Where:
zvm_ip
The IP address of the Zerto Virtual Manager where the API is run.
port
The port to access the Zerto Virtual Manager. The default port is 9669.
 
Parameter
Description
RecoveryHostIdentifier
The identifier of the host that handles the replicated data. The identifier comprises the server identifier and the host moref, with the format, serverid.moref.
Get VRA Alert Status
Run this API to get the VRA Alert Status from the VRA Alerts object. If the status is normal, you can proceed with the change recovery operation. The full API can be found here: VRAs API.
method
 
url
GET
https://zvm_ip:port/v1/vras
Where:
zvm_ip
The IP address of the Zerto Virtual Manager where the API is run.
port
The port to access the Zerto Virtual Manager. The default port is 9669.
 
Parameter
Description
VraAlerts
Details on the VRA alert status.
VraAlertsStatus
The alert status of the VRA. Possible values are:
0 or Normal
1 or Warning
2 or Error
Get Potential Target Hosts
Run this API to get a list of potential target hosts for the VMs replicating to the specified VRA - {vraIdentifier}.
method
 
url
GET
https://zvm_ip:port/v1/vras/{vraIdentifier}/changeRecoveryVra/potentials?VmIdentifier=<vmId>
Where:
zvm_ip
The IP address of the Zerto Virtual Manager where the API is run.
port
The port to access the Zerto Virtual Manager. The default port is 9669.
vraIdentifier
The identifier of the VRA.
Filters
Filters are optional and any combination of filters is valid. Filters are not case-sensitive.
 
Filter
Description
 
VmIdentifier
The internal virtual machine identifier. If specified, a list of potential target hosts will be returned for this VM only.
Request Body Using Json Format
Response In Json Format
Request Body Using Json Format
The request body is empty.
Response In Json Format
The following is an example response.
{
  "Hosts": [
    {
    "HostIdentifier": "string content",
    "HostName": "string content"
    },
    {
    "HostIdentifier": "string content,
    "HostName": "string content"
    }
  ]
}
 
Parameter
Description
Hosts
A list of potential hosts that VM/s can be recovered to. If a VM was specified, only potential hosts for the VM will be returned.
HostIdentifier
The unique identifier of the host.
HostName
The address or DNS name of the host.
Get Recommendation
Run this API to get a list of VMs paired with their recommended target hosts.
method
 
url
POST
https://zvm_ip:port/v1/vras/{vraIdentifier}/changeRecoveryVra/recommendation
Where:
zvm_ip
The IP address of the Zerto Virtual Manager where the API is run.
port
The port to access the Zerto Virtual Manager. The default port is 9669.
vraIdentifier
The identifier of the VRA.
Request Body Using Json Format
Response Body Using Json Format
Request Body Using Json Format
The following is an example request.
{
  "Constraints": [
    "FixedVmsAllocations":
    {
     "VmIdentifier": "vmId",
     "HostIdentifier": "hostId"
     },
     {
     "VmIdentifier": "vmId",
     "HostIdentifier": "hostId"
    }
  ],
  "VmsToCalculate": ["<vmId>","<vmId>"]
  
}
 
Parameter
Description
mandatory
default
FixedVmsAllocations
An optional constraints object which contains an array of VmIdentifier and HostIdentifier pairings that will be assumed when calculating recommendations for the VMs indicated in the VmsToCalculate array.
No
Null
VmIdentifier
The internal virtual machine identifier. The identifier comprises the server identifier and the virtual machine moref, with the format, serverid.moref.
No
 
HostIdentifier
The unique identifier of the host that the VM will be recovered to.
No
 
VmsToCalculate
An array of vmIds that will receive recommendations.
Yes
 
Response Body Using Json Format
The following is an example response.
{
  "Recommendations": [
    {
    "vmRecommendation": ,
     "VmIdentifier": "string content",
     "HostIdentifier": "string content",
     "HostName": "string content"
     "Reason": "string content"
    },
    "vmRecommendation": ,
     "VmIdentifier": "string content",
     "HostIdentifier": "string content",
     "HostName": "string content"
     "Reason": "string content"
    }
  ]
}
 
Parameter
Description
Recommendations
 
vmRecommendation
A list of recommended target hosts for each VM.
VmIdentifier
The internal virtual machine identifier. The identifier comprises the server identifier and the virtual machine moref, with the format, serverid.moref.
HostIdentifier
The unique identifier of the host that the VM will be recovered to. The response is null if a host was not successfully recommended.
HostName
The name of the host that the VM will be recovered to.
Reason
The reason describing why a new host could not be recommended. The response is null if a host was successfully recommended.
Back to VRAs: Change Recovery VRA APIs
Back to VRAs API
Back to All APIs
Validate Prior to Execute
Run this API to validate the VM to target host mapping before executing the change recovery VRA operation.
method
 
url
POST
https://zvm_ip:port/v1/vras/{vraIdentifier}/changeRecoveryVra/validate
Where:
zvm_ip
The IP address of the Zerto Virtual Manager where the API is run.
port
The port to access the Zerto Virtual Manager. The default port is 9669.
vraIdentifier
The identifier of the VRA.
Request Body Using Json Format
Response Body Using Json Format
Request Body Using Json Format
The following is an example request.
{
  "VmsAllocations":[
    {
    "VmIdentifier": "string content",
    "HostIdentifier": "string content"
    },
    {
    "VmIdentifier": "string content",
    "HostIdentifier": "string content"
    }
  ]
}
 
Parameter
Description
mandatory
default
VmsAllocations
An array holding VMs with the identifiers of their new target host.
By default this parameter is set to null, which means all VMs will be automatically changed to recover to the most suitable target host/s.
When VMs are specified, only those specified will change host (if they pass validations).
VMs not specified are kept on their current recovery host.
VMs that are specified without a target host (target host is null), will be automatically changed to recover to the most suitable target host/s.
Yes
 
VmIdentifier
The internal virtual machine identifier. The identifier comprises the server identifier and the virtual machine moref, with the format, serverid.moref.
Yes
 
HostIdentifier
The unique identifier of the host that the VM will be recovered to.
 
 
Response Body Using Json Format
The following is an example response.
{
  "VmsValidationResults": [
    {
    "VmIdentifier": "string content",
    "HostIdentifier": "string content,
    "Status": "VmValidationStatusEnum",
    "Reason": "string content"
    },
    {
    "VmIdentifier": "string content",
    "HostIdentifier": "string content",
    "Status": "VmValidationStatusEnum",
    "Reason": "string content"
    }
  ]
}
 
Parameter
Description
VmsValidationResults
Array of objects containing VmIdentifier, HostIdentifier, Status, and Reason for each proposed VM and target host change.
VmIdentifier
The internal virtual machine identifier. The identifier comprises the server identifier and the virtual machine moref, with the format, serverid.moref.
HostIdentifier
The unique identifier of the host on which validation was requested for the VMs.
Status
The status of the proposed change. Possible values are:
0 or Success
1 or Failure
2 or Warning
Reason
The reason for the status in the case of a Warning or Error.
Back to VRAs: Change Recovery VRA APIs
Back to VRAs API
Back to All APIs
Execute
Once the VM to target host mapping is set, run this API to execute the change recovery VRA operation.
method
 
url
POST
https://zvm_ip:port/v1/vras/{vraIdentifier}/changeRecoveryVra/execute
Where:
zvm_ip
The IP address of the Zerto Virtual Manager where the API is run.
port
The port to access the Zerto Virtual Manager. The default port is 9669.
vraIdentifier
The identifier of the VRA containing the VMs.
Response In Json Format
Response In Json Format
The following is an example response.
{
  "TaskIdentifier": "String content"
}
 
Parameter
Description
TaskIdentifier
The identifier of the task that can be used with the Tasks API to monitor the ongoing status.
Back to VRAs: Change Recovery VRA APIs
Back to VRAs API
Back to All APIs