Backup Management Interfaces


Create VM Backup (CreateVmBackup)

API Request

URLs
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": [] }
Note: 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
Name Type Location Description Allowed Values Starting Version
rootVolumeUuid String url Root disk UUID 3.0.0
backupStorageUuid String body (Contained in the params structure) Image Storage UUID 3.0.0
name String body (Contained in the params structure) Resource name 3.0.0
description (Optional) String body (Contained in the params structure) Detailed description of the resource 3.0.0
resourceUuid (Optional) String body (Contained in the params structure) 3.0.0
volumeReadBandwidth (Optional) Long body (Contained in the params structure) Disk read bandwidth 3.1.0
volumeWriteBandwidth (Optional) Long body (Contained in the params structure) Disk write bandwidth 3.1.0
networkReadBandwidth (Optional) Long body (Contained in the params structure) Network download bandwidth 3.1.0
networkWriteBandwidth (Optional) Long body (Contained in the params structure) Network upload bandwidth 3.1.0
systemTags (Optional) List body 3.0.0
userTags (Optional) List body 3.0.0
Note:
  • ZStack ZSphere 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
  • ZStack ZSphere 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
  • ZStack ZSphere 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": 1.073741824E9,       "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": 2.147483648E9,       "createDate": "Nov 14, 2017 10:20:57 PM",       "lastOpDate": "Nov 14, 2017 10:20:57 PM"     }   ] }
Name Type Description Starting Version
error ErrorCode The error code. If not null, the operation failed. This field is null when the operation succeeds. For details, see error 3.0.0
inventories List For details, see inventories 3.0.0
#error
Name Type Description Starting Version
code String The error code number. A globally unique identifier for the error, for example, SYS.1000, HOST.1001 3.0.0
description String A brief description of the error 3.0.0
details String The detailed error information 3.0.0
elaboration String A reserved field. The default value is null 3.0.0
opaque LinkedHashMap A reserved field. The default value is null 3.0.0
cause ErrorCode The root error. The source error that caused the current error. If no root error exists, this field is null 3.0.0
#inventories
Name Type Description Starting Version
uuid String The UUID of the disk backup. Uniquely identifies the resource 3.0.0
volumeUuid String Disk UUID 3.0.0
name String Backup name 3.0.0
description String Detailed description of the backup 3.0.0
type String Disk type 3.0.0
state String Enabled state of the disk backup 3.0.0
status String Status of the disk backup 3.0.0
size Long Size of the current disk backup 3.0.0
metadata String Metadata of the disk backup 3.0.0
createDate Timestamp Creation time 3.0.0
lastOpDate Timestamp Last modification time 3.0.0
backupStorageRefs List For details, see backupStorageRefs 3.0.0
#backupStorageRefs
Name Type Description Starting Version
volumeBackupUuid String Disk backup UUID 3.0.0
backupStorageUuid String Image Storage UUID 3.0.0
installPath String Data path of the disk backup 3.0.0
status String Status of the disk backup on the Image Storage 3.0.0
createDate Timestamp Creation time 3.0.0
lastOpDate Timestamp Last modification time 3.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()

Delete VM Backup (DeleteVmBackup)

API Request

URLs
DELETE zstack/v1/vm-backups/{groupUuid}?backupStorageUuids={backupStorageUuids}&deleteMode={deleteMode}
Headers
Authorization: OAuth the-session-uuid
Curl Example
curl -H "Content-Type: application/json;charset=UTF-8" \ -H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \ -X DELETE http://localhost:8080/zstack/v1/vm-backups/92046c016d7c3af7bdd4a5077fb91450?backupStorageUuids=255fc896605f3237a22940fa92d8670b&deleteMode=Permissive
Parameter List
Name Type Location Description Allowed Values Starting Version
groupUuid String url Backup group UUID 3.0.0
backupStorageUuids (Optional) List url Image Storage UUID list 3.0.0
deleteMode (Optional) String url 3.0.0
systemTags (Optional) List body 3.0.0
userTags (Optional) List body 3.0.0

API Response

On success, this API returns an empty JSON structure {}. On failure, the returned JSON structure contains an error field. For example:
{ 	"error": { 		"code": "SYS.1001", 		"description": "A message or a operation timeout", 		"details": "Create VM on KVM timeout after 300s" 	} }

SDK Examples

Java SDK
DeleteVmBackupAction action = new DeleteVmBackupAction(); action.groupUuid = "92046c016d7c3af7bdd4a5077fb91450"; action.backupStorageUuids = asList("255fc896605f3237a22940fa92d8670b"); action.deleteMode = "Permissive"; action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"; DeleteVmBackupAction.Result res = action.call();
Python SDK
DeleteVmBackupAction action = DeleteVmBackupAction() action.groupUuid = "92046c016d7c3af7bdd4a5077fb91450" action.backupStorageUuids = [255fc896605f3237a22940fa92d8670b] action.deleteMode = "Permissive" action.sessionId = "b86c9016b4f24953a9edefb53ca0678c" DeleteVmBackupAction.Result res = action.call()

Sync VM Backup (SyncVmBackup)

API Request

URLs
PUT zstack/v1/vm-backups/imageStore/{imageStoreUuid}/actions
Headers
Authorization: OAuth the-session-uuid
Body
{   "syncVmBackup": {},   "systemTags": [],   "userTags": [] }
Note: 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 PUT -d '{"syncVmBackup":{}}' http://localhost:8080/zstack/v1/vm-backups/imageStore/087b41055fbc4875aef622142cbe5ac3/actions
Parameter List
Name Type Location Description Allowed Values Starting Version
imageStoreUuid String url Backup server UUID 3.5.0
systemTags (Optional) List body 3.5.0
userTags (Optional) List body 3.5.0

API Response

On success, this API returns an empty JSON structure {}. On failure, the returned JSON structure contains an error field. For example:
{ 	"error": { 		"code": "SYS.1001", 		"description": "A message or a operation timeout", 		"details": "Create VM on KVM timeout after 300s" 	} }

SDK Examples

Java SDK
SyncVmBackupAction action = new SyncVmBackupAction(); action.imageStoreUuid = "7c3e52e35de449c9abc1343c83b93cd5"; action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"; SyncVmBackupAction.Result res = action.call();
Python SDK
SyncVmBackupAction action = SyncVmBackupAction() action.imageStoreUuid = "07270eb0ae25428586b224c33e88e485" action.sessionId = "b86c9016b4f24953a9edefb53ca0678c" SyncVmBackupAction.Result res = action.call()


























Archives

Download Document Archives

Download

Already filled the basic info?Click here.

Enter at least 2 characters.
Cannot be empty.
Invalid mobile number.
Enter at least 4 characters.
Invalid email address.
Wrong code. Try again. Send Code Resend Code (60s)

An email with a verification code will be sent to you. Make sure the address you provided is valid and correct.

同意 不同意

I have read and concur with the Site TermsPrivacy PolicyRules and Conventions on User Management of ZStack Cloud

Download

Not filled the basic info yet? Click here.

Invalid email address or mobile number.
同意 不同意

I have read and concur with the Site TermsPrivacy PolicyRules and Conventions on User Management of ZStack Cloud

Email Us

contact@zstack.io
ZStack Training and Certification
Enter at least 2 characters.
Invalid mobile number.
Enter at least 4 characters.
Invalid email address.
Wrong code. Try again. Send Code Resend Code (60s)

同意 不同意

I have read and concur with the Site TermsPrivacy PolicyRules and Conventions on User Management of ZStack Cloud

Email Us

contact@zstack.io
Request Trial
Enter at least 2 characters.
Invalid mobile number.
Enter at least 4 characters.
Invalid email address.
Wrong code. Try again. Send Code Resend Code (60s)

同意 不同意

I have read and concur with the Site TermsPrivacy PolicyRules and Conventions on User Management of ZStack Cloud

Email Us

contact@zstack.io

The download link is sent to your email address.

If you don't see it, check your spam folder, subscription folder, or AD folder. After receiving the email, click the URL to download the documentation.

The download link is sent to your email address.

If you don't see it, check your spam folder, subscription folder, or AD folder.
Or click on the URL below. (For Internet Explorer, right-click the URL and save it.)

Thank you for using ZStack products and services.

Submit successfully.

We'll connect soon.

Thank you for using ZStack products and services.