Short Outlines of How to Manage a VPG
You manage a VPG using the vpgSettings API by using multiple methods. This section outlines the basic use of the vpgSettings API to perform different VPG functions:
Creating a VPG
When creating a VPG the set of values are specified and saved as a VPG settings object in the API session. To update the Zerto Virtual Manager with the settings, you commit the object.
You create the VPG settings object by executing the vpgSettings API with the POST method and the necessary request body.
https://zvm_ip:port/v1/vpgsettings |
The request body specifies all the details required for the VPG, details of which are in
“VPGs: POST”, on page 104.
You can create a skeleton VPG settings object by using the following request body:
You can then edit the response body with the required values and pass the completed JSON as a new request body.
Executing this API creates the object settings and returns the vpgSettingsIdentifier in the response body. To create the VPG in the Zerto Virtual Manager, you have to commit the changes using the following API, with the POST method:
https://zvm_ip:port/v1/vpgsettings/vpgSettingsIdentifier/commit |
For more details, refer to
To create a VPG:.
Updating a VPG
When editing a VPG, you first get the VPG settings as an object using the vpgIdentifier to create a new vpgSettingsIdentifier. The settings for the VPG are then modified as required and then the VPG settings object with the changes is committed to update the Zerto Virtual Manager with the changed settings. For example, the following URL with a GET method retrieves the VPG identifier that can then be used to generate a vpgSettingsIdentifier for the settings object for the VPG:
https://zvm_ip:port/v1/vpgs |
Details of the VPG are returned including the VPG identifier, which is then used in the request body of the vpgSettings URL, using a POST method:
https://zvm_ip:port/v1/vpgsettings |
The request body is similar to the following, in JSON format:
{ "VpgIdentifier": "49b189ff-dcd7-4544-a25d-356bea6c6676" } |
The vpgSettingsIdentifier is returned in the response body. You can use this identifier to retrieve the settings object for the VPG, using a GET method:
https://zvm_ip:port/v1/vpgsettings/ac942f3f-8e40-4d5f-a782-8cfebe80ed33 |
You update the VPG settings object by executing the relevant API. For example to update any of the basic settings, you use the vpgsettings/vpgSettingsIdentifier/basic API with the PUT method and the necessary request body.
https://zvm_ip:port/v1/vpgsettings/ac942f3f-8e40-4d5f-a782-8cfebe80ed33/basic |
In the following example, the request body specifies that the priority is changed to high and the journal history is changed to 10 hours:
{ "JournalHistoryInHours": 10, "Priority": "High" } |
Executing this API changes the object settings. To update the Zerto Virtual Manager with the changed settings, you have to commit the changes using the following API, with the POST method:
https://zvm_ip:port/v1/vpgsettings/ac942f3f-8e40-4d5f-a782-8cfebe80ed33/commit |
The task identifier for the update is returned in the response body and the settings object is deleted.
Note: Changes to all the VPG settings, such as the expected RPO, the are performed in the same way as described here.
For more details, refer to
To update an existing VPG:.
Adding a Virtual Machine to a VPG
The procedure to add a virtual machine to an existing VPG is the same as updating a VPG, described above, but a POST method is used instead of a PUT method to update the settings object. After the settings object is updated with the new information, the object must be committed, also using the POST method. For more details, refer to
To add a virtual machine to the VPG:.
Resetting Values in a VPG Settings Object
To reset a value in a VPG settings object, do the following:
1. Get the object and save the response.
2. Delete the section of the VPG settings object, using the DELETE method.
3. Add the new value in the VPG settings object using the PUT method.
4. Commit the change using the POST method.
Note: Mandatory parameters that do not have a default value must be set using the PUT command.
Example 1: Resetting the priority to the default value
1. Retrieve the basic settings in the VPG settings object using the following URL with the GET method:
https://zvm_ip:port/v1/vpgsettings/vpgSettingsIdentifier/basic
2. Save the response body and then delete the settings in the current VPG settings object, using the same URL but with the DELETE object:
https://zvm_ip:port/v1/vpgsettings/vpgSettingsIdentifier/basic
3. Update the basic settings with the reset priority by changing the value of priority setting in the new request body, as follows:
{ "JournalHistoryInHours": 4, "Name": "test-using-API1", "Priority": null, "ProtectedSiteIdentifier": "6c36720e-b32d-44de-9600-042ce5268d0d", "RecoverySiteIdentifier": "02159615-16d8-40e0-87f8-2fe669bf414f", "RpoInSeconds": 300, "ServiceProfileIdentifier": null, "TestIntervalInMinutes": 262080, "UseWanCompression": true, "ZorgIdentifier": null } |
4. Update the VPG settings object using the following URL with the PUT method:
https://zvm_ip:port/v1/vpgsettings/vpgSettingsIdentifier/basic
5. Commit the settings to update the VPG using the following URL with the POST method:
https://zvm_ip:port/v1/vpgsettings/vpgSettingsIdentifier/commit
Example 2: Change Journal Settings
1. Retrieve the journal settings object using the following URL with the GET method:
https://zvm_ip:port/v1/vpgsettings/vpgSettingsIdentifier/journal
2. Save the response body and then delete the settings, using the same URL but with the DELETE object:
https://zvm_ip:port/v1/vpgsettings/vpgSettingsIdentifier/journal
3. You can now update the journal settings by changing the relevant values in the new request body.
Use the following URL with the PUT method to update the settings:
https://zvm_ip:port/v1/vpgsettings/vpgSettingsIdentifier/journal
For example, the storage to use and the hard limit and warning threshold are unlimited, as follows:
{ "DatastoreIdentifier":"841c3a57-e4bb-4e53-b045-47e95da4ece9.datastore-201", "Limitation":{ "HardLimitInMB":0, "HardLimitInPercent":0, "WarningThresholdInMB":0, "WarningThresholdInPercent": 0 } } |
4. Use the following URL with the POST method to commit the settings:
https://zvm_ip:port/v1/vpgsettings/vpgSettingsIdentifier/commit
Deleting a Virtual Machine from a VPG
The procedure to delete a virtual machine from an existing VPG requires that you first get the VPG settings as an object using the vpgIdentifier to create a new vpgSettingsIdentifier. The virtual machine identifier to remove from the VPG is then sent with the DELETE method to delete the virtual machine from the VPG settings:
https://zvm_ip:port/v1/vpgsettings/ac942f3f-8e40-4d5f-a782-8cfebe80ed33/vms/13d550a4-24af-4914-9ca4-09f8619eb703.vm-153 |
Executing this API changes the object settings. To update the Zerto Virtual Manager with the changed settings, you have to commit the changes using the following API, with the POST method:
https://zvm_ip:port/v1/vpgsettings/ac942f3f-8e40-4d5f-a782-8cfebe80ed33/commit |
The task identifier for the update is returned in the response body and the settings object is deleted.
Note: The virtual machine is deleted from the VPG but the target disks in the recovery site are kept.
Deleting the VPG Settings Object
A VPG settings object is destroyed in the following cases:
■ When a session times out.
■ When the object is not used in a session for 30 minutes, even if the session is still active.
■ When the object is committed.
■ By executing the vpgSettings API for the object, with a DELETE method:
https://zvm_ip:port/v1/vpgsettings/ac942f3f-8e40-4d5f-a782-8cfebe80ed33 |
Note: To delete a VPG you use the vpgs API. For details, refer to the Zerto Virtual Replication RESTful API Reference Guide documentation.