Create VM Backup

POST/zstack/v1/volumes/{rootVolumeUuid}/vm-backups

Headers

Authorization: OAuth the-session-uuid

Body

{
  "params": {
    "backupStorageUuid": "fc50c1ece4753c1981e3e3f65a151e0e",
    "name": "backup-1",
    "description": "a critical volume backup"
  },
  "systemTags": [],
  "userTags": []
}

The systemTags and userTags fields in the above example are optional. They are listed to indicate that the body can contain these two fields.

Curl Example

curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X POST -d '{"params":{"backupStorageUuid":"fc50c1ece4753c1981e3e3f65a151e0e","name":"backup-1","description":"a critical volume backup"}}' http://localhost:8080/zstack/v1/volumes/aa6fad9b71af3785a9fdec200bab3ee8/vm-backups

Parameter List

NameTypeLocationDescriptionAllowed ValuesStarting Version
rootVolumeUuidStringurlRoot disk UUID 3.0.0
backupStorageUuidStringbody (Contained in the params structure)Image Storage UUID 3.0.0
nameStringbody (Contained in the params structure)Resource name 3.0.0
description (Optional)Stringbody (Contained in the params structure)Detailed description of the resource 3.0.0
resourceUuid (Optional)Stringbody (Contained in the params structure)  3.0.0
volumeReadBandwidth (Optional)Longbody (Contained in the params structure)Disk read bandwidth 3.1.0
volumeWriteBandwidth (Optional)Longbody (Contained in the params structure)Disk write bandwidth 3.1.0
networkReadBandwidth (Optional)Longbody (Contained in the params structure)Network download bandwidth 3.1.0
networkWriteBandwidth (Optional)Longbody (Contained in the params structure)Network upload bandwidth 3.1.0
systemTags (Optional)Listbody  3.0.0
userTags (Optional)Listbody  3.0.0
  • ZSvirt uses the backup network for host-to-image-repository traffic when creating VM backups. The SystemTags includes the backupnetwork option.
  • Option format: backup::network::cidr::CIDR
  • Example: backup::network::cidr::10.0.0.0/8
  • ZSvirt sets the transfer method for backup data to Image Storage when creating VM backups. The SystemTags includes the fsInfo option.
    • Option format: fsInfo::type::$TYPE::url::$URL::options::$OPTIONS
    • Example: fsInfo::type::nfs::url::172.32.1.119:/nas/nfs2::options::nolock,vers=3,rsize=32768,wsize=32768
  • ZSvirt sets the backup concurrency when creating VM backups. The SystemTags includes the volumeLiveBackup option.
    • Option format: volumeLiveBackup::parallelismDegree::$NUMBER
    • Example: volumeLiveBackup::parallelismDegree::1

API Response

Response Example

{
  "inventories": [
    {
      "uuid": "785edb93bb1b3a31857dac1e69cc8392",
      "volumeUuid": "2ae6b881bb1239cd907d48993e86a2e8",
      "name": "Root-Volume-Backup-1",
      "description": "volume backup",
      "size": 1073741824.0,
      "groupUuid": "2f7c0a5bb86430e8a5ac48312172d70d",
      "createDate": "Nov 14, 2017 10:20:57 PM",
      "lastOpDate": "Nov 14, 2017 10:20:57 PM"
    },
    {
      "uuid": "3084eea905f4311b9d484bfe97142bdf",
      "volumeUuid": "f6c7d5276c873eba8accddd4a09a1ee6",
      "name": "Data-Volume-Backup-1",
      "description": "volume backup",
      "size": 2147483648.0,
      "createDate": "Nov 14, 2017 10:20:57 PM",
      "lastOpDate": "Nov 14, 2017 10:20:57 PM"
    }
  ]
}
NameTypeDescriptionStarting Version
errorErrorCodeThe error code. If not null, the operation failed. This field is null when the operation succeeds. For details, see error3.0.0
inventoriesListFor details, see inventories3.0.0

error

NameTypeDescriptionStarting Version
codeStringThe error code number. A globally unique identifier for the error, for example, SYS.1000, HOST.10013.0.0
descriptionStringA brief description of the error3.0.0
detailsStringThe detailed error information3.0.0
elaborationStringA reserved field. The default value is null3.0.0
opaqueLinkedHashMapA reserved field. The default value is null3.0.0
causeErrorCodeThe root error. The source error that caused the current error. If no root error exists, this field is null3.0.0

inventories

NameTypeDescriptionStarting Version
uuidStringThe UUID of the disk backup. Uniquely identifies the resource3.0.0
volumeUuidStringDisk UUID3.0.0
nameStringBackup name3.0.0
descriptionStringDetailed description of the backup3.0.0
typeStringDisk type3.0.0
stateStringEnabled state of the disk backup3.0.0
statusStringStatus of the disk backup3.0.0
sizeLongSize of the current disk backup3.0.0
metadataStringMetadata of the disk backup3.0.0
createDateTimestampCreation time3.0.0
lastOpDateTimestampLast modification time3.0.0
backupStorageRefsListFor details, see backupStorageRefs3.0.0

backupStorageRefs

NameTypeDescriptionStarting Version
volumeBackupUuidStringDisk backup UUID3.0.0
backupStorageUuidStringImage Storage UUID3.0.0
installPathStringData path of the disk backup3.0.0
statusStringStatus of the disk backup on the Image Storage3.0.0
createDateTimestampCreation time3.0.0
lastOpDateTimestampLast modification time3.0.0

SDK Examples

Java SDK

CreateVmBackupAction action = new CreateVmBackupAction();
action.rootVolumeUuid = "aa6fad9b71af3785a9fdec200bab3ee8";
action.backupStorageUuid = "fc50c1ece4753c1981e3e3f65a151e0e";
action.name = "backup-1";
action.description = "a critical volume backup";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
CreateVmBackupAction.Result res = action.call();

Python SDK

CreateVmBackupAction action = CreateVmBackupAction()
action.rootVolumeUuid = "aa6fad9b71af3785a9fdec200bab3ee8"
action.backupStorageUuid = "fc50c1ece4753c1981e3e3f65a151e0e"
action.name = "backup-1"
action.description = "a critical volume backup"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
CreateVmBackupAction.Result res = action.call()