Zerto Virtual Replication APIs : VPGs API : VPGs: POST
  
VPGs: POST
Creates a VPG or performs actions on a specific VPG.
URL
Create VPG (VMware only)
https://zvm_ip:port/v1/vpgs
Clone VPG
https://zvm_ip:port/v1/vpgs/{protectionGroupIdentifier}/CloneStart
Abort VPG clone
https://zvm_ip:port/v1/vpgs/{protectionGroupIdentifier}/CloneAbort
Failover VPG
https://zvm_ip:port/v1/vpgs/{protectionGroupIdentifier}/Failover
Commit VPG failover
https://zvm_ip:port/v1/vpgs/{protectionGroupIdentifier}/FailoverCommit
Rollback VPG failover
https://zvm_ip:port/v1/vpgs/{protectionGroupIdentifier}/FailoverRollback
Test VPG
https://zvm_ip:port/v1/vpgs/{protectionGroupIdentifier}/failoverTest
Stop VPG test
https://zvm_ip:port/v1/vpgs/{protectionGroupIdentifier}/failoverTestStop
Force synchronize a VPG
https://zvm_ip:port/v1/vpgs/{protectionGroupIdentifier}/forcesync
Pause VPG protection
https://zvm_ip:port/v1/vpgs/{protectionGroupIdentifier}/pause
Resume VPG protection
https://zvm_ip:port/v1/vpgs/{protectionGroupIdentifier}/resume
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.
protectionGroupIdentifier
The identifier of the VPG for which an action is executed, such as a clone, failover or failover test.
Json Request Format
The following is an example request Json body for https://zvm_ip:port/v1/vpgs.
{
  "DatastoreIdentifier": "String content",
  "OrgVdcIdentifier": "String content",
  "Priority":0,
  "ResourcePoolIdentifier": "String content",
  "ServiceProfileIdentifier": "String content",
  "SourceSiteIdentifier": "String content",
  "TargetSiteIdentifier": "String content",
  "VcdVappIdentifier": "String content",
  "VmsIdentifiers": [
    "String content",
    ...
  ],
  "VpgName": "String content",
  "ZorgIdentifier": "String content"
}
The following is an example request Json body for https://zvm_ip:port/v1/vpgs
 
{
  "DatastoreIdentifier": "String content",
  "OrgVdcIdentifier": "String content",
  "Priority":0,
  "ResourcePoolIdentifier": "String content",
  "ServiceProfileIdentifier": "String content",
  "SourceSiteIdentifier": "String content",
  "TargetSiteIdentifier": "String content",
    ...
  ],
  "VpgName": "String content",
  "ZorgIdentifier": "String content"
}
The following is an example request Json body for https://zvm_ip:port/v1/vpgs/{protectionGroupIdentifier}/CloneStart.
{
  "CheckpointIdtifier": "String content"
  "DatastoreIdentifier": "String content"
}
The following is an example request Json body for https://zvm_ip:port/v1/vpgs/{protectionGroupIdentifier}/Failover.
{
  "CheckpointIdentifier": "String content",
  "CommitPolicy":1,
  "ShutdownPolicy":0,
  "TimeToWaitBeforeShutdownInSec":2147483647
  "IsReverseProtection": Boolean
}
The following is an example request Json body for https://zvm_ip:port/v1/vpgs/{protectionGroupIdentifier}/FailoverTest.
{
  "CheckpointIdentifier": "String content"
}
The following is an example request Json body for https://zvm_ip:port/v1/vpgs/{protectionGroupIdentifier}/FailoverTestStop.
{
  "FailoverTestSuccess": Boolean,
  "FailoverTestSummary": "String content"
}
The following is an example request Json body for https://zvm_ip:port/v1/vpgs/{protectionGroupIdentifier}/FailoverCommit
{
  "IsReverseProtection": Boolean
}
The request bodies for the other VPGs POST APIs, such as https://zvm_ip:port/v1/vpgs/{protectionGroupIdentifier}/FailoverRollback, is empty.
Request Values
VMware only: Create a VPG
Request values for https://zvm_ip:port/v1/vpgs/{VpgIdentifier}.
Parameter
Description
DatastoreIdentifier
Optional: The identifier of the datastore for the recovered virtual machine disks. Get the identifier using Datastores. If a datastore is not specified, the datastore used is the datastore with the most free space, or the first datastore accessible by the ZORG, if specified. The identifier comprises the server identifier and the storage moref, with the format, serverid.moref.
OrgVdcIdentifier
Optional: The OrgvCD identifier when recovering to vCD. Get the identifier using VMware only: Resource Pools.
Priority
Optional: The priority to assign to the VPG. Possible values are (Json/XML):
0/Low: The VPG has a low priority for transferring data.
1/Medium: The VPG has a medium priority for transferring data.
2/High: The VPG has a high priority for transferring data.
ResourcePoolIdentifier
Optional: The identifier of the resource pool for the recovered virtual machines. Get the identifier using VMware only: Resource Pools.
ServiceProfileIdentifier
Optional: The identifier of the service profile to use for the VPG when a Zerto Cloud Manager is used. Get the identifier using Service Profiles API.
SourceSiteIdentifier
Optional: The identifier of the protected site. Get the identifier using Virtualization sites. If a source site is not specified, the site where the API runs is used as the source site.
TargetSiteIdentifier
Optional: The identifier of the target site. Get the identifier using Virtualization sites. If a target site is not specified, the target site is the same as the source site, and enabling replication to the same vCenter Server must be set in the Zerto user interface.
VcVappIdentifier
Deprecated. Deprecated. See VcdVappIdentifier.
VcdVappIdentifier
The identifier of the vCD vApp to protect. When protecting virtual machines in a vCenter Server, this value is null. Get the identifier using List Unprotected vCD vApps in a Site.
VmsIdentifier
The identifiers of the virtual machines to protect. When protecting a vCenter Server vApp or a vCD vApp, this value is null. Get the identifiers using Unprotected VMs.
VpgName
The name to identify the VPG. This name must be unique for a specific ZORG.
ZorgIdentifier
Optional: The identifier of the ZORG, Zerto organization, defined in the Zerto Cloud Manager. Get the identifier using ZORGs API.
Note: Only one of VcdVappIdentifier and VmsIdentifier is required. If a value is not specified in the request, a null value is used. Nulls are specified in Json as null, all lowercase. For example, the following Json object is to protect two virtual machines to a recovery site, with the site where the API is run being the protected site:
{"DatastoreIdentifier":null,"OrgVdcIdentifier":null,"ResourcePoolIdentifier":null,"ServiceProfileIdentifier":null,"SourceSiteIdentifier":null,"TargetSiteIdentifier":"a9cc87d9-1a97-41c0-a91f-9ef306097d40","VcdVappIdentifier":null,"VmsIdentifier":["598e5def-3500-4409-a691-d25b5cd10d22.vm-51","598e5def-3500-4409-a691-d25b5cd10d22.vm-50"],"VpgName":"Reports","ZorgIdentifier":null}
The above Json can be shortened to the following, as the values are defaulted to null when not specified:
{"TargetSite":"a9cc87d9-1a97-41c0-a91f-9ef306097d40","Vms":["598e5def-3500-4409-a691-d25b5cd10d22.vm-51","598e5def-3500-4409-a691-d25b5cd10d22.vm-50"],"VpgName":"Reports"}
Clone a VPG
Request values for https://zvm_ip:port/v1/vpgs/{VpgIdentifier}/CloneStart.
Parameter
Description
CheckpointId
Deprecated. See CheckpointIdentifier.
CheckpointIdentifier
Optional: The identifier of the checkpoint to use for cloning. If a checkpoint is not specified, the latest checkpoint is used.
DatastoreIdentifier
Optional: the identifier of the datastore on which the cloned virtual machines are created. If a datastore is not specified, the storage used for the cloned virtual machines is the datastore (vSphere) or storage (Hyper-V) with the most free space.
Specifying a datastore when the recovery site is vCD or Public cloud is not allowed.
Aborting a Clone
Request body for https://zvm_ip:port/v1/vpgs/{VpgIdentifier}/CloneAbort is empty.
Failover a VPG
Request values for https://zvm_ip:port/v1/vpgs/{VpgIdentifier}/failover.
 
Parameter
Description
CheckpointIdentifier
Optional: The identifier of the checkpoint to use for cloning. If a checkpoint is not specified, the latest checkpoint is used.
CommitPolicy
The policy to use after the failover enters a Before Commit state. Possible values are (Json/XML):
Rollback: After the seconds specified in the commitValue setting have elapsed, the failover is rolled back.
Commit: After the seconds specified in the commitValue setting have elapsed, the failover continue, committing the virtual machines in the recovery site.
None: The virtual machines in the VPG being failed over remain in the Before Commit state until either they are committed with Commit a failover, or rolled back with Roll back a failover.
CommitValue
The amount of time in seconds the failover waits in a Before Commit state to enable checking that the failover is as required before performing the commitPolicy setting.
ShutdownPolicy
The shutdown policy to apply to the virtual machines on the protected site that are being failed over Possible values are (Json/XML):
0 or None: The protected virtual machines are not touched before starting the failover. This assumes that you do not have access to the protected virtual machines.
1 or Shutdown: If the protected virtual machines have VMware Tools or Microsoft Integration Services available, the virtual machines are gracefully shut down, otherwise the failover operation fails. This is similar to performing a Move operation to a specified checkpoint.
2 or ForceShutdown: The protected virtual machines are forcibly shut down before starting the failover. If the protected virtual machines have VMware Tools or Microsoft Integration Services available, the procedure waits five minutes for the virtual machines to be gracefully shut down before forcibly powering them off. This is similar to performing a Move operation to a specified checkpoint.
TimeToWaitBeforeShutdownInSec
The amount of time in seconds the failover waits in a Before Commit state to enable checking that the failover is as required before performing the commit policy setting. The commit policy setting can either be commit or rollback.
IsReverseProtection
Optional. If IsReverseProtection is not set, the default value is False.
1/True - Enable reverse protection. The virtual machines are recovered on the recovery site and then protected using the default reverse protection settings.
0/False - Do not enable reverse protection. The VPG definition is kept with the status Needs Configuration and the reverse settings in the VPG definition are not set.
 
Commit a failover
Request body for https://zvm_ip:port/v1/vpgs/{VpgIdentifier}/FailoverCommit.
Parameter
Description
IsReverseProtection
Optional. If IsReverseProtection is not set, the default value is false.
1/True - Enable reverse protection. The virtual machines are recovered on the recovery site and then protected using the default reverse protection settings.
0/False - Do not enable reverse protection. The VPG definition is kept with the status Needs Configuration and the reverse settings in the VPG definition are not set.
Note: Attempting to commit a failover during the initial stage, before it is ready to commit or roll back, throws an exception.
Roll back a failover
Request body for https://zvm_ip:port/v1/vpgs/{VpgIdentifier}/FailoverRollback is empty.
Note: Attempting to rollback a failover during the initial stage, before it is ready to commit or roll back, throws an exception.
Test a failover
Request values for https://zvm_ip:port/v1/vpgs/{VpgIdentifier}/FailoverTest.
Parameter
Description
checkpointId
Deprecated. See CheckpointIdentifier.
CheckpointIdentifier
Optional: The identifier of the checkpoint to use for testing. If a checkpoint is not specified, the latest checkpoint is used.
Stopping a failover test
Request values for https://zvm_ip:port/v1/vpgs/{VpgIdentifier}/FailoverTestStop.
Parameter
Description
FailoverTestSuccess
Optional. The default is true.
True: The test was successful.
False: The test was not successful.
FailoverTestSummary
Optional: Free text describing the test.
Force synchronize a VPG
Request body for https://zvm_ip:port/v1/vpgs/{VpgIdentifier}/forcesync is empty.
Pause VPG protection
Request body for https://zvm_ip:port/v1/vpgs/{VpgIdentifier}/pause is empty.
Resume VPG protection
Request body for https://zvm_ip:port/v1/vpgs/{VpgIdentifier}/resume is empty.
XML Request Format
For the XML request format, see “VPGs API POST Method Request and Response Formats”, on page 246.
Json Response Format
The following is an example response Json body for https://zvm_ip:port/v1/vpgs, https://zvm_ip:port/v1/vpgs, https://zvm_ip:port/v1/vpgs/{protectionGroupIdentifier}/Failover, https://zvm_ip:port/v1/vpgs/{protectionGroupIdentifier}/FailoverCommit, https://zvm_ip:port/v1/vpgs/{protectionGroupIdentifier}/FailoverRollback, https://zvm_ip:port/v1/vpgs/{protectionGroupIdentifier}/FailoverTest, https://zvm_ip:port/v1/vpgs/{protectionGroupIdentifier}/FailoverTestStop, https://zvm_ip:port/v1/vpgs/{protectionGroupIdentifier}/forcesync, https://zvm_ip:port/v1/vpgs/{protectionGroupIdentifier}/pause, and for https://zvm_ip:port/v1/vpgs/{protectionGroupIdentifier}/resume.
"String content"
XML Response Format
For the XML response format, see “VPGs API POST Method Request and Response Formats”, on page 246.
Response values
The response value is the task identifier that can be used with the Tasks API to monitor the delete action.