yunify / qingcloud-csi

Kubernetes volume plugin based on CSI specification which support block storage of qingcloud
Apache License 2.0
37 stars 22 forks source link

Create and delete snapshot #50

Closed wnxn closed 5 years ago

wnxn commented 5 years ago

A snapshot is corresponding to a full snapshot chain.


- Describe a full snapshot

qingcloud iaas describe-snapshots -z ap2a -n ss-pbho5fnk -f config.yaml -t 1

{ "action": "DescribeSnapshotsResponse", "snapshot_set": [ { "is_taken": 1, "resource_id": "vol-0mism5nd", "backstore_type": 1, "head_chain": 1, "console_id": "qingcloud", "snapshot_name": "test4", "raw_size": 1, "snapshot_id": "ss-pbho5fnk", "owner": "usr-kylwuKxL", "x_resource_id": "", "size": 10240, "virtual_size": 10240, "total_size": 10240, "sub_code": 0, "snapshot_mode": "zfs", "parent_id": "self", "provider": "self", "status_time": "2019-07-01T02:59:15Z", "status": "available", "description": null, "root_id": "ss-pbho5fnk", "transition_status": "", "snapshot_repl_info": { "ap2a": 2 }, "visibility": "private", "image_id": "", "controller": "self", "total_store_size": 2, "store_size": 1, "tags": [], "snapshot_time": "2019-07-01T02:59:07Z", "resource": { "resource_name": "test", "resource_type": "volume", "resource_id": "vol-0mism5nd" }, "is_head": 0, "sub_id": "", "total_count": 2, "snapshot_type": 1, "lastest_snapshot_time": "2019-07-01T02:59:43Z", "root_user_id": "usr-kylwuKxL", "create_time": "2019-07-01T02:59:15Z", "store_splits": 1, "resource_project_info": [] } ], "ret_code": 0, "total_count": 1 }


- Describe a increment snapshot

qingcloud iaas describe-snapshots -z ap2a -n ss-3ulk3x33 -f config.yaml -t 0

{ "action": "DescribeSnapshotsResponse", "snapshot_set": [ { "is_taken": 1, "resource_id": "vol-0mism5nd", "backstore_type": 1, "console_id": "qingcloud", "snapshot_name": "test5", "raw_size": 0, "snapshot_id": "ss-3ulk3x33", "owner": "usr-kylwuKxL", "x_resource_id": "", "size": 0, "virtual_size": 10240, "sub_code": 0, "snapshot_mode": "zfs", "parent_id": "ss-pbho5fnk", "provider": "self", "status_time": "2019-07-01T02:59:56Z", "status": "available", "description": null, "root_id": "ss-pbho5fnk", "transition_status": "", "snapshot_repl_info": { "ap2a": 2 }, "visibility": "private", "image_id": "", "controller": "self", "store_size": 1, "tags": [], "snapshot_time": "2019-07-01T02:59:43Z", "resource": { "resource_name": "test", "resource_type": "volume", "resource_id": "vol-0mism5nd" }, "is_head": 1, "sub_id": "", "snapshot_type": 0, "root_user_id": "usr-kylwuKxL", "create_time": "2019-07-01T02:59:56Z", "store_splits": 1, "resource_project_info": [] } ], "ret_code": 0, "total_count": 1 }


- Delete a full snapshot

qingcloud iaas delete-snapshots -z ap2a -f config.yaml -s ss-pbho5fnk

{ "action": "DeleteSnapshotsResponse", "job_id": "j-mn6q5uuplth", "ret_code": 0 }