Procedure
Run the following command on any cluster node to create a volume snapshot with the specified name in a datastore:
zbs-meta snapshot create <pool_name> <volume_name> <snapshot_name>
| Parameter | Description |
|---|---|
pool_name | The datastore name. |
volume_name | The volume name. |
snapshot_name | The snapshot name. |
Output note
If the command succeeds, no output is displayed.
Procedure
Run the following command on any node in the cluster to create snapshots for multiple volumes in a batch:
zbs-meta snapshot batch_create "<volumes>"
volumes are the volumes for snapshot creation. You can enter multiple volumes and separate them with commas (,). The input format for a single volume is as follows:
VOLUME = VOLUME_ID,BATCH_SNAPSHOT_VOLUME_TYPE,OBJ_ID,SNAPSHOT_NAME,SNAPSHOT_DESCRIPTION,SECONDARY_ID
Parameter description
| Parameter | Description | Example |
|---|---|---|
VOLUME_ID | Required. Enter the volume ID. | 9c2e2f88-99f7-4581-8eae-289924118962 |
BATCH_SNAPSHOT_VOLUME_TYPE | Required. Enter the volume type. Depending on the volume type, this can be BATCH_SNAPSHOT_VOLUME, BATCH_SNAPSHOT_LUN, BATCH_SNAPSHOT_FILE, or BATCH_SNAPSHOT_NAMESPACE. All letters must be uppercase. | BATCH_SNAPSHOT_VOLUME_LUN |
OBJ_ID | Required. Enter the corresponding ID based on the volume type. For BATCH_SNAPSHOT_VOLUME, leave it blank. For BATCH_SNAPSHOT_LUN, enter the LUN ID. For BATCH_SNAPSHOT_FILE, enter the inode ID. For BATCH_SNAPSHOT_NAMESPACE, enter the namespace ID. | 1 |
SNAPSHOT_NAME | Optional. Enter the snapshot name. | snapshot1 |
SNAPSHOT_DESCRIPTION | Optional. Enter the snapshot description. Can be left empty. | snapshotdescription |
SECONDARY_ID | Optional. Enter the snapshot secondary ID. Can be left empty. | 99cf762a-0375-4327-927d-a17243374d25 |
Usage example
Create snapshots in batch for volumes with volume IDs 911dcc87-b366-42ad-a093-500a9ce7e0de and cf4f60ff-1190-4497-b8d8-3d1967b860b7. The example is as follows:
zbs-meta snapshot batch_create "911dcc87-b366-42ad-a093-500a9ce7e0de,BATCH_SNAPSHOT_VOLUME,,snapshot-name7,,secondary_id7;cf4f60ff-1190-4497-b8d8-3d1967b860b7,BATCH_SNAPSHOT_VOLUME,,snapshot-name6,snapshot-description2,secondary_id2"
Output example
ID Name Parent ID Size Perf Unique Size Perf Shared Size Cap Unique Size Cap Shared Size Logical Used Size Creation Time Status Resiliency Type Replica Num EC Param Thin Provision Read Only Description Alloc Even Clone count Prefer CID Access Points Is Prioritized Downgraded PRS
------------------------------------ ---------------- ------------------------------------ ----------- ------------------ ------------------ ----------------- ----------------- ------------------- ----------------------------- ------------- ----------------- ------------- ---------- ---------------- ----------- --------------------- ------------ ------------- ------------ --------------- ---------------- ----------------
7950dd46-07f2-4cf5-a42d-201eaf900839 snapshot-name456 4983d31d-798f-41ef-b36f-41a6938d287d 1024.00 GiB In Process In Process In Process In Process In Process 2024-06-18 14:47:47.459604104 VOLUME_ONLINE RT_REPLICA 2 True False False 0 0 [] False 0.00 B
ff0996f9-c749-4d61-9959-d95b30a5d0f3 snapshot-name123 fe4daff8-9cd3-494e-8d22-bd5a4af2e54d 0.00 B In Process In Process In Process In Process In Process 2024-06-18 14:47:47.459820330 VOLUME_ONLINE RT_REPLICA 3 True False snapshot-description2 False 0 0 [] False 0.00 B