Volume
Overview
A volume provides storages for VM instances. A volume can either be a root volume or a data volume.
- Root volume: A system disk where the VM instance operating system is installed.
- Data volume: A data disk that provides additional storages for a VM instance.
Data volumes are mainly involved in the volume management.
Precautions
When you use volumes, note that:
Volumes are hypervisor specific. That is, a volume that has been attached to a VM instance of one hypervisor type cannot be attached to a VM instance of another hypervisor type. For example, a volume of KVM VM instances cannot be attached to VMware VM instances.
A volume can have two sizes: real size and virtual size. The real size is the size that a volume actually occupies in the storage system, while the virtual size is the size that a volume claims for. The virtual size is usually greater than or equal to the real size. As the number of written files increases, the real size will gradually increase.
A volume (excluding shared volumes) can only be attached to one VM instance at any given time. Ceph and Shared Block primary storages support shared volumes. A shared volume can be identified and accessed by multiple VM instances at the same time.
A root volume is always attached to its owner VM instance and cannot be detached.
A data volume can be attached to or detached from different VM instances of the same hypervisor type.
In the environment where multiple primary storages are available, you can specify a primary storage to create a volume. If no primary storage is specified, the default creation method is as follows:
- For local primary storages, volumes are created from the primary storage with large capacity.
- For NFS primary storages, volumes are created from a random primary storage.
- For mixed primary storages (local + NFS/Shared Mount Point), volumes are created from the primary storage where the root volume of the volume does not locate.
You can set QoS for data volumes to limit the disk bandwidth. Note that excessive low QoS might cause low I/O performance.
Inventory
Properties
| Name | Description | Optional | Valid Value | Starting Version |
|---|---|---|---|---|
| uuid | The UUID. For more information, see Resource Property. | 0.6 | ||
| name | The name. For more information, see Resource Property. | 0.6 | ||
| description | The description. For more information, see Resource Property. | Yes | 0.6 | |
| primaryStorageUuid | The UUID of the primary storage where the volume is located. For more information, see Primary Storage. | 0.6 | ||
| vmInstanceUuid | The UUID of the VM instance to which the volume is attached. If the volume is not attached to any VM instance, this parameter is NULL. For more information, see Attached VM Instance. | Yes | 0.6 | |
| diskOfferingUuid | The disk offering UUID. This parameter is valid if the volume is created from disk offering. | Yes | 0.6 | |
| rootImageUuid | The image UUID. This parameter is valid if the volume is created from image. | Yes | 0.6 | |
| installPath | The volume installation path on the primary storage. | 0.6 | ||
| type | The volume type. |
|
0.6 | |
| format | The volume format. For more information, see Format. |
|
0.6 | |
| size | The virtual size of the volume. Unit: byte. | 0.6 | ||
| actualSize | 0.6 | |||
| isShareable | 0.6 | |||
| volumeQoS | 4.6.21 | |||
| lastDetachDate | 4.6.21 | |||
| lastVmInstanceUuid | 4.6.21 | |||
| deviceId | The device ID. For more information, see Device ID. | Yes | 0.6 | |
| state | The volume state. For more information, see State. |
|
0.6 | |
| status | The volume status. For more information, see Status. |
|
0.6 | |
| createDate | The creation date. For more information, see Resource Property. | 0.6 | ||
| lastOpDate | The last operation date. For more information, see Resource Property. | 0.6 |
Sample
{
"inventories": [
{
"actualSize": 454033408,
"createDate": "Nov 14, 2017 1:21:32 PM",
"description": "Root volume for VM[uuid:7096021b405e41a2afa22d0f6d7ab6f8]",
"deviceId": 0,
"format": "qcow2",
"installPath": "/Cloud_ps_nxs/rootVolumes/acct-36c27e8ff05c4780bf6d2fa65700f22e/vol-c33a897
db91e461a9cbc011b0aa441c9/c33a897db91e461a9cbc011b0aa441c9.qcow2",
"isShareable": false,
"lastOpDate": "Nov 14, 2017 1:21:33 PM",
"name": "ROOT-for-pub",
"primaryStorageUuid": "cae8726c90784ba0946f852952731268",
"rootImageUuid": "e29e00c1d18a486b8802a8f53c6a6e4f",
"size": 4195352576,
"state": "Enabled",
"status": "Ready",
"type": "Root",
"uuid": "c33a897db91e461a9cbc011b0aa441c9",
"vmInstanceUuid": "7096021b405e41a2afa22d0f6d7ab6f8"
}
],
"success": true
}
Attached VM Instance
A data volume can be attached to a running or stopped VM instance. However, a data volume can only be attached to one VM instance at any given time. After a data volume is attached to a VM instance, the UUID of the data volume will show up in the vmInstanceUuid field. A data volume can be detached from a VM instance and then attached to the other as long as these two VM instances are of the same hypervisors type. A root volume is always attached to its owner VM instance and cannot be detached.
Format
The volume format reveals the relationship between a volume and a hypervisor type, specifying what VM instances of which hypervisor type that a volume can be attached.
Device ID
The device ID shows the order that volumes are attached to a VM instance. Root volumes are always the first volume to be attached. Therefore, root volumes have a fixed device ID 0. Data volumes might have device IDs 1, 2, 3 … N, depending on the sequence they are attached to a VM instance. The device ID can be used to identify the disk letter of a volume in the guest operating system. For example, in Linux, 0 usually means /dev/xvda, 1 usually means /dev/xvdb, and so forth.
State
A volume can have the following two states:
Enabled:
Indicates that the volume can be attached to a VM instance.
Disabled:
Indicates that the volume cannot be attached to a VM instance. However, an attached data volume can be detached even the data volume is in Disabled state.
Status
Status shows the lifecycle of a volume.
NotInstantiated:
A specific status for only data volumes. Data volumes of this status are just database records. Data volumes of the NotInstantiated status can be attached to VM instances of any hypervisor types. After a data volume is attached to a VM instance, the hypervisorType field of the data volume will store the hypervisor type of the VM instance, and will be instantiated to concrete binaries on primary storage. Meanwhile, the status will be changed to Ready. Then, the data volume can only be re-attached to VM instances of the same hypervisor type.
Ready:
Indicates that the volume is already instantiated on primary storage and is ready to use.
Creating:
Indicates that the volume is being created from image or volume snapshot, and is not ready to use.
The status transition of a volume is shown in Figure 5: Volume Status Transition Diagram.
VolumeSnapShot Inventory
| Name | Description | Optional | Valid Value | Starting Version |
|---|---|---|---|---|
| uuid | Please refer to Resource attributes | 0.6 | ||
| name | Please refer to Resource attributes | 0.6 | ||
| description | Please refer to Resource attributes | 是 | 0.6 | |
| format | Please refer to format | 0.6 | ||
| groupUuid | 0.6 | |||
| latest | 0.6 | |||
| parentUuid | 0.6 | |||
| primaryStorageInstallPath | 0.6 | |||
| primaryStorageUuid | The uuid of the primary storage where the cloud disk is located, refer toprimary storage | 0.6 | ||
| size | The virtual size of the cloud disk, in bytes | 0.6 | ||
| state | Please refer to state | 0.6 | ||
| status | Please refer to status | 0.6 | ||
| treeUuid | Snapshot tree UUID | 0.6 | ||
| type | Cloud disk virtualization type | 0.6 | ||
| volumeType | Cloud disk type |
|
0.6 | |
| volumeUuid | Cloud disk UUID | 0.6 | ||
| groupBy | Group by field, equivalent to the group by keyword in MySQL. For example, groupBy=type | 是 | 0.6 | |
| createDate | Please refer to Resource attributes | 0.6 | ||
| lastOpDate | Please refer to Resource attributes | 0.6 | ||
| userTags | User tags, please refer to CreateUserTag | 是 | 0.6 | |
| systemTags | System tags, please refer to CreateSystemTag | 是 | 0.6 |
Operations
CreateDataVolume
Creates a volume. For example,
CreateDataVolume name=testvolume diskOfferingUuid=73432f99feef483b97f984ff1830220e
Parameters
| Name | Description | Optional | Valid Value | Starting Version |
|---|---|---|---|---|
| name | The volume name. | 0.6 | ||
| description | The detailed description of the volume. | Yes | 0.6 | |
| diskOfferingUuid | The disk offering UUID. | Yes | 0.6 | |
| primaryStorageUuid | The primary storage UUID. | Yes | 0.6 | |
| resourceUuid | The resource UUID. If specified, the image will use the specified value as UUID. | Yes | 0.6 | |
| tagUuids | The tag UUID list. | Yes | 3.4.0 | |
| userTags | The user tags. For more information, see CreateUserTag. The resource type is VolumeVO. | Yes | 0.6 | |
| systemTags | The system tags. For more information, see CreateSystemTag. The resource type is VolumeVO. | Yes | 0.6 | |
| timeout | Yes |
When you create a data volume in ZStack Cloud, you can specify the volume provisioning strategy by adding the volumeProvisioningStrategy option to SystemTags. The SystemTag is passed by using the dataVolumeSystemTags parameter.
Format of the volumeProvisioningStrategy option:
volumeProvisioningStrategy::ThinProvisioning, volumeProvisioningStrategy::ThickProvisioningExample:
volumeProvisioningStrategy::ThinProvisioning, volumeProvisioningStrategy::ThickProvisioningWhen you create a data volume in ZStack Cloud, you can specify a path for the volume to integrate with a 3rd-party storage paltform. You can set the value of the systemTags parameters to required::installUrl.
- Format:
required::installUrl::{%s} - Example:
required::installUrl::zbs://poolname
- Format:
DeleteDataVolume
Deletes a volume. For example,
DeleteDataVolume uuid=2929b9e85c32478ea602824189c0d01a
Parameters
| Name | Description | Optional | Valid Value | Starting Version |
|---|---|---|---|---|
| uuid | The volume UUID. | 0.6 | ||
| deleteMode | The delete mode. For more information, see Delete Resources. | Yes |
|
0.6 |
| userTags | The user tags. For more information, see CreateUserTag. The resource type is VolumeVO. | Yes | 0.6 | |
| systemTags | The system tags. For more information, see CreateSystemTag. The resource type is VolumeVO. | Yes | 0.6 | |
| timeout | Yes |
ExpungeDataVolume
Completely deletes a volume. For example,
ExpungeDataVolume uuid=2929b9e85c32478ea602824189c0d01a
Parameters
| Name | Description | Optional | Valid Value | Starting Version |
|---|---|---|---|---|
| uuid | The volume UUID. | 0.6 | ||
| userTags | The user tags. For more information, see CreateUserTag. The resource type is VolumeVO. | Yes | 0.6 | |
| systemTags | The system tags. For more information, see CreateSystemTag. The resource type is VolumeVO. | Yes | 0.6 | |
| timeout | Yes |
RecoverDataVolume
Recovers a volume. For example,
RecoverDataVolume uuid=8994e6524c4945a0bf76d169297742df
Parameters
| Name | Description | Optional | Valid Value | Starting Version |
|---|---|---|---|---|
| uuid | The volume UUID. | 0.6 | ||
| userTags | The user tags. For more information, see CreateUserTag. The resource type is VolumeVO. | Yes | 0.6 | |
| systemTags | The system tags. For more information, see CreateSystemTag. The resource type is VolumeVO. | Yes | 0.6 | |
| timeout | Yes |
ChangeVolumeState
Enables or disables a volume. For example,
ChangeVolumeState uuid=8994e6524c4945a0bf76d169297742df stateEvent=enable
Parameters
| Name | Description | Optional | Valid Value | Starting Version |
|---|---|---|---|---|
| uuid | The volume UUID. | 0.6 | ||
| stateEvent | Whether to enable or disable the volume. |
|
0.6 | |
| userTags | The user tags. For more information, see CreateUserTag. The resource type is VolumeVO. | Yes | 0.6 | |
| systemTags | The system tags. For more information, see CreateSystemTag. The resource type is VolumeVO. | Yes | 0.6 | |
| timeout | Yes |
CreateDataVolumeFromVolumeTemplate
Creates a volume from image. For example,
CreateDataVolumeFromVolumeTemplate name=new-volume imageUuid=bbe7c4538bfb420c84d417c8af0cfcc2 \
primaryStorageUuid=49304a747e2046618befdba8f64a5e47
Parameters
| Name | Description | Optional | Valid Value | Starting Version |
|---|---|---|---|---|
| imageUuid | The image UUID. | 0.6 | ||
| name | The volume name. | 0.6 | ||
| description | The detailed description of the volume. | Yes | 0.6 | |
| primaryStorageUuid | The primary storage UUID. | 0.6 | ||
| hostUuid | The host UUID. | Yes | 0.6 | |
| resourceUuid | The resource UUID. | Yes | 0.6 | |
| userTags | The user tags. For more information, see CreateUserTag. The resource type is VolumeVO. | Yes | 0.6 | |
| systemTags | The system tags. For more information, see CreateSystemTag. The resource type is VolumeVO. | Yes | 0.6 | |
| timeout | Yes |
- When you create a volume from an image in ZStack Cloud, you can create a shared volume by adding the shareable option to SystemTags. The SystemTag is passed by using the shareable parameter. Note that you will create a shared volume if you add this SystemTag. If you do not add this SystemTag, you will create a normal volume.
CreateDataVolumeFromVolumeSnapshot
Creates a volume from snapshot. For example,
CreateDataVolumeFromVolumeSnapshot volumeSnapshotUuid=0e4b6901bc964e7d9ec369eefdc8ba55 \
name=newsnapshotvolume primaryStorageUuid=49304a747e2046618befdba8f64a5e47
Parameters
| Name | Description | Optional | Valid Value | Starting Version |
|---|---|---|---|---|
| volumeSnapshotUuid | The volume image UUID. | 0.6 | ||
| name | The volume name. | 0.6 | ||
| description | The detailed description of the volume. | Yes | 0.6 | |
| primaryStorageUuid | The primary storage UUID. | 0.6 | ||
| resourceUuid | The resource UUID. | Yes | 0.6 | |
| userTags | The user tags. For more information, see CreateUserTag. The resource type is VolumeVO. | Yes | 0.6 | |
| systemTags | The system tags. For more information, see CreateSystemTag. The resource type is VolumeVO. | Yes | 0.6 | |
| timeout | Yes |
QueryVolume
Obtains a list of volumes. For example,
QueryVolume type=Data vmInstanceUuid=71f5376ef53a46a9abddd59c942cf45f
QueryVolume diskOffering.name=small primaryStorage.uuid=8db7eb2ccdab4c4eb4784e46895bb016
Primitive Fields of Query
See Volume Inventory.
Nested and Expanded Fields of Query
| Field | Inventory | Description | Starting Version |
|---|---|---|---|
| vmInstance | VM Instance Inventory | The VM instances to which the volume is attached. | 0.6 |
| snapshot | Volume Snapshot Inventory | The snapshots that are created from the volume. | 0.6 |
| diskOffering | Disk Offering Inventory | The disk offerings that are created from the volume. | 0.6 |
| primaryStorage | Primary Storage Inventory | The primary storage where the volume is located. | 0.6 |
| image | Image Inventory | The images that are created from the volume. | 0.6 |
GetVolumeFormat
Obtains the volume format. Sample response:
{
"formats": [
{
"format": "iso",
"supportingHypervisorTypes": []
},
{
"format": "raw",
"masterHypervisorType": "KVM",
"supportingHypervisorTypes": [
"KVM"
]
},
{
"format": "vmtx",
"masterHypervisorType": "ESX",
"supportingHypervisorTypes": [
"ESX"
]
},
{
"format": "qcow2",
"masterHypervisorType": "KVM",
"supportingHypervisorTypes": [
"KVM"
]
}
]
}
Parameters
| Name | Description | Optional | Valid Value | Starting Version |
|---|---|---|---|---|
| userTags | The user tags. For more information, see CreateUserTag. The resource type is VolumeVO. | Yes | 0.6 | |
| systemTags | The system tags. For more information, see CreateSystemTag. The resource type is VolumeVO. | Yes | 0.6 | |
| timeout | Yes |
GetVolumeCapabilities
Obtains the volume capabilities. For example,
GetVolumeCapabilities uuid=30b1f7abb7884b80bbdacaf0fd1c7fe9
Parameters
| Name | Description | Optional | Valid Value | Starting Version |
|---|---|---|---|---|
| uuid | The volume UUID. | 0.6 | ||
| userTags | The user tags. For more information, see CreateUserTag. The resource type is VolumeVO. | Yes | 0.6 | |
| systemTags | The system tags. For more information, see CreateSystemTag. The resource type is VolumeVO. | Yes | 0.6 | |
| timeout | Yes |
SyncVolumeSize
Synchronizes the volume size. For example,
SyncVolumeSize uuid=30b1f7abb7884b80bbdacaf0fd1c7fe9
Parameters
| Name | Description | Optional | Valid Value | Starting Version |
|---|---|---|---|---|
| uuid | The volume UUID. | 0.6 | ||
| userTags | The user tags. For more information, see CreateUserTag. The resource type is VolumeVO. | Yes | 0.6 | |
| systemTags | The system tags. For more information, see CreateSystemTag. The resource type is VolumeVO. | Yes | 0.6 | |
| timeout | Yes |
BatchSyncVolumeSize
Synchronizes volume sizes in batch. For example,
BatchSyncVolumeSize clusterUuid=5hs8kc3m867kg4x46k8l04dv461vps9e
Parameters
| Name | Description | Optional | Valid Value | Starting Version |
|---|---|---|---|---|
| clusterUuid | The cluster UUID. | 4.5.3 | ||
| systemTags | The system tags. For more information, see CreateSystemTag. | Yes | 4.5.3 | |
| userTags | The user tags. For more information, see CreateUserTag. | Yes | 4.5.3 | |
| timeout | Yes |
ResizeRootVolume
Resizes a root volume. For example,
ResizeRootVolume uuid=78d879252ab84a3e96832535331bc9cc size=4294967296
Parameters
| Name | Description | Optional | Valid Value | Starting Version |
|---|---|---|---|---|
| uuid | The volume UUID. | 2.2 | ||
| size | The new size. | 2.2 | ||
| userTags | The user tags. For more information, see CreateUserTag. The resource type is VolumeVO. | Yes | 2.2 | |
| systemTags | The system tags. For more information, see CreateSystemTag. The resource type is VolumeVO. | Yes | 2.2 | |
| timeout | Yes |
ResizeDataVolume
Resizes a data volume. For example,
ResizeDataVolume uuid=6978048d1400484ca33a2ea84af061f5 size=1073741824
Parameters
| Name | Description | Optional | Valid Value | Starting Version |
|---|---|---|---|---|
| uuid | The volume UUID. | 2.2 | ||
| size | The new size. | 2.2 | ||
| userTags | The user tags. For more information, see CreateUserTag. The resource type is VolumeVO. | Yes | 2.2 | |
| systemTags | The system tags. For more information, see CreateSystemTag. The resource type is VolumeVO. | Yes | 2.2 | |
| timeout | Yes |
UpdateVolume
Changes the properties of a volume. For example,
UpdateVolume uuid=30b1f7abb7884b80bbdacaf0fd1c7fe9 name=newvolume
Parameters
| Name | Description | Optional | Valid Value | Starting Version |
|---|---|---|---|---|
| uuid | The volume UUID. | 0.6 | ||
| name | The volume name. | Yes | 0.6 | |
| description | The detailed description of the volume. | Yes | 0.6 | |
| userTags | The user tags. For more information, see CreateUserTag. The resource type is VolumeVO. | Yes | 0.6 | |
| systemTags | The system tags. For more information, see CreateSystemTag. The resource type is VolumeVO. | Yes | 0.6 | |
| timeout | Yes |
SetVolumeQoS
Sets the volume QoS. For example,
SetVolumeQos uuid=30b1f7abb7884b80bbdacaf0fd1c7fe9 volumeBandwidth=10000
Parameters
| Name | Description | Optional | Valid Value | Starting Version |
|---|---|---|---|---|
| uuid | The volume UUID. | 0.6 | ||
| volumeBandwidth | The volume bandwidth. | 0.6 | ||
| mode | Yes |
|
3.1.0 | |
| readBandwidth | Yes | 4.4.0 | ||
| writeBandwidth | Yes | 4.4.0 | ||
| totalBandwidth | Yes | 4.4.0 | ||
| readIOPS | Yes | 4.4.0 | ||
| writeIOPS | Yes | 4.4.0 | ||
| totalIOPS | Yes | 4.4.0 | ||
| userTags | The user tags. For more information, see CreateUserTag. The resource type is VolumeVO. | Yes | 0.6 | |
| systemTags | The system tags. For more information, see CreateSystemTag. The resource type is VolumeVO. | Yes | 0.6 | |
| timeout | Yes |
ZStack Cloud allows you to set the QoS read bandwidth for a volume by adding the volumeReadBandwidth option to SystemTags.
- Format of the volumeReadBandwidth option:
volumeReadBandwidth::xxx. Here, xxx is the read bandwidth. - Example:
volumeReadBandwidth::20971520
- Format of the volumeReadBandwidth option:
ZStack Cloud allows you to set the QoS write bandwidth for a volume by adding the volumeWriteBandwidth option to SystemTags.
- Format of the volumeWriteBandwidth option:
volumeWriteBandwidth::xxx. Here, xxx is the write bandwidth. - Example:
vvolumeWriteBandwidth::20971520
- Format of the volumeWriteBandwidth option:
GetVolumeQoS
Obtains the volume QoS. For example,
GetVolumeQos uuid=30b1f7abb7884b80bbdacaf0fd1c7fe9
Parameters
| Name | Description | Optional | Valid Value | Starting Version |
|---|---|---|---|---|
| uuid | The volume UUID. | 0.6 | ||
| forceSync | Optional. Whether to synchronize the data on the host. | Yes | 3.10.0 | |
| userTags | The user tags. For more information, see CreateUserTag. The resource type is VolumeVO. | Yes | 0.6 | |
| systemTags | The system tags. For more information, see CreateSystemTag. The resource type is VolumeVO. | Yes | 0.6 | |
| timeout | Yes |
ZStack Cloud allows you to obtain the QoS read bandwidth of a volume by adding the volumeReadBandwidth option to SystemTags.
- Format of the volumeReadBandwidth option:
volumeReadBandwidth::xxx. Here, xxx is the read bandwidth. - Example:
volumeReadBandwidth::20971520
- Format of the volumeReadBandwidth option:
ZStack Cloud allows you to obtain the QoS write bandwidth of a volume by adding the volumeWriteBandwidth option to SystemTags.
- Format of the volumeWriteBandwidth option:
volumeWriteBandwidth::xxx. Here, xxx is the write bandwidth. - Example:
vvolumeWriteBandwidth::20971520
- Format of the volumeWriteBandwidth option:
DeleteVolumeQoS
Deletes the volume QoS. For example,
DeleteVolumeQos uuid=30b1f7abb7884b80bbdacaf0fd1c7fe9
Parameters
| Name | Description | Optional | Valid Value | Starting Version |
|---|---|---|---|---|
| uuid | The volume UUID. | 0.6 | ||
| mode | Yes |
|
4.4.0 | |
| userTags | The user tags. For more information, see CreateUserTag. The resource type is VolumeVO. | Yes | 0.6 | |
| systemTags | The system tags. For more information, see CreateSystemTag. The resource type is VolumeVO. | Yes | 0.6 | |
| timeout | Yes |
ZStack Cloud allows you to delete the QoS read bandwidth of a volume by adding the volumeReadBandwidth option to SystemTags.
- Format of the volumeReadBandwidth option:
volumeReadBandwidth::xxx. Here, xxx is the read bandwidth. - Example:
volumeReadBandwidth::20971520
- Format of the volumeReadBandwidth option:
ZStack Cloud allows you to delete the QoS read bandwidth of a volume by adding the volumeWriteBandwidth option to SystemTags.
- Format of the volumeWriteBandwidth option:
volumeWriteBandwidth::xxx. Here, xxx is the write bandwidth. - Example:
vvolumeWriteBandwidth::20971520
- Format of the volumeWriteBandwidth option:
GetVolumeIoThreadPinMsg
Obtains the IO thread pin message of a volume. For example,
GetVolumeIoThreadPin uuid=0b699d672e7346629e7d824c93511ed8
Parameters
| Name | Description | Optional | Valid Value | Starting Version |
|---|---|---|---|---|
| uuid | The resource UUID. | 4.7.0 | ||
| userTags | The user tags. For more information, see CreateUserTag. | Yes | 4.7.0 | |
| systemTags | The system tags. For more information, see CreateSystemTag. | Yes | 4.7.0 |
SetVolumeIoThreadPin
Sets the IO thread pin for a volume. For example,
SetVolumeloThreadPin ioThreadID=1 pin="3-6" vmUuid=dcc01afafcc04a5e989466225b2905c6 uuid=0b699d672e7346629e7d824c93511ed8
Parameters
| Name | Description | Optional | Valid Value | Starting Version |
|---|---|---|---|---|
| uuid | The resource UUID. | 4.7.0 | ||
| vmUuid | The VM instance UUID | 4.7.0 | ||
| pin | The CPU pinning range | 4.7.0 | ||
| ioThreadId | The IO thread id | 4.7.0 | ||
| userTags | The user tags. For more information, see CreateUserTag. | Yes | 4.7.0 | |
| systemTags | The system tags. For more information, see CreateSystemTag. | Yes | 4.7.0 |
GetDataVolumeAttachableVm
Obtains a list of VM instances to which a volume can be attached. For example,
GetDataVolumeAttachableVm volumeUuid=30b1f7abb7884b80bbdacaf0fd1c7fe9
Parameters
| Name | Description | Optional | Valid Value | Starting Version |
|---|---|---|---|---|
| volumeUuid | The volume UUID. | 0.6 | ||
| userTags | The user tags. For more information, see CreateUserTag. The resource type is VolumeVO. | Yes | 0.6 | |
| systemTags | The system tags. For more information, see CreateSystemTag. The resource type is VolumeVO. | Yes | 0.6 | |
| timeout | Yes |
AttachDataVolumeToVm
Attaches a volume to a VM instance. For example,
AttachDataVolumeToVm volumeUuid=30b1f7abb7884b80bbdacaf0fd1c7fe9 \
vmInstanceUuid=108af59a0f4e4d6cb838a5591db1016a
Parameters
| Name | Description | Optional | Valid Value | Starting Version |
|---|---|---|---|---|
| vmInstanceUuid | The VM instance UUID. | 0.6 | ||
| volumeUuid | The volume UUID. | 0.6 | ||
| userTags | The user tags. For more information, see CreateUserTag. The resource type is VolumeVO. | Yes | 0.6 | |
| systemTags | The system tags. For more information, see CreateSystemTag. The resource type is VolumeVO. | Yes | 0.6 | |
| timeout | Yes |
DetachDataVolumeFromVm
Detaches a volume from a VM instance. For example,
DetachDataVolumeFromVm uuid=30b1f7abb7884b80bbdacaf0fd1c7fe9
Parameters
| Name | Description | Optional | Valid Value | Starting Version |
|---|---|---|---|---|
| uuid | The volume UUID. | 0.6 | ||
| vmUuid | The VM instance UUID. | 0.6 | ||
| userTags | The user tags. For more information, see CreateUserTag. The resource type is VolumeVO. | Yes | 0.6 | |
| systemTags | The system tags. For more information, see CreateSystemTag. The resource type is VolumeVO. | Yes | 0.6 | |
| timeout | Yes |
AttachDataVolumeToHost
Attaches a data volume to a host. For example,
AttachDataVolumeToHost volumeUuid=95bd25d20dff3591a83f45280d05a67d hostUuid=c7310b853b1d3e97b09e52c32bd2e9c6 mountPath=/test/mount/path
Parameters
| Name | Description | Optional | Valid Value | Starting Version |
|---|---|---|---|---|
| volumeUuid | The volume UUID. | 4.5.0 | ||
| hostUuid | The host UUID. | 4.5.0 | ||
| mountPath | The mount path on the host. | 4.5.0 | ||
| systemTags | The system tags. For more information, see CreateSystemTag. | 是 | 4.5.0 | |
| userTags | The user tags. For more information, see CreateUserTag. | 是 | 4.5.0 | |
| timeout | 是 |
DetachDataVolumeFromHost
Detaches a data volume from a host. For example,
DetachDataVolumeFromHost volumeUuid=961e87cd9adc335eb4227d98cb835e3c
Parameters
| Name | Description | Optional | Valid Value | Starting Version |
|---|---|---|---|---|
| volumeUuid | The volume UUID. | 4.5.0 | ||
| hostUuid | The host UUID. | 是 | 4.5.0 | |
| systemTags | The system tags. For more information, see CreateSystemTag. | 是 | 4.5.0 | |
| userTags | The user tags. For more information, see CreateUserTag. | 是 | 4.5.0 | |
| timeout | 是 |
CreateVolumeSnapshot
Creates a snapshot from volume. For example,
CreateVolumeSnapshot volumeUuid=30b1f7abb7884b80bbdacaf0fd1c7fe9 name=newsnapshot
Parameters
| Name | Description | Optional | Valid Value | Starting Version |
|---|---|---|---|---|
| volumeUuid | The volume UUID. | 0.6 | ||
| name | The snapshot name. | 0.6 | ||
| description | The detailed description of the snapshot. | Yes | 0.6 | |
| resourceUuid | The resource UUID. | Yes | 0.6 | |
| userTags | The user tags. For more information, see CreateUserTag. The resource type is VolumeVO. | Yes | 0.6 | |
| systemTags | The system tags. For more information, see CreateSystemTag. The resource type is VolumeVO. | Yes | 0.6 | |
| timeout | Yes |
QueryVolumeSnapshot
Queries a volume snapshot. For example,
QueryVolumeSnapshot uuid=2a31798356754fe0a48da09d9ee879dd
Primitive Fields of Query
See Volume Snapshot Inventory.
Nested and Expanded Fields of Query
| Field | Inventory | Description | Starting Version |
|---|---|---|---|
| backupStorage | Backup Storage Inventory | 0.6 | |
| backupStorageRef | 0.6 | ||
| backupStorageRefs | 0.6 | ||
| localStorageHostRef | 0.6 | ||
| primaryStorage | Primary Storage Inventory | 0.6 | |
| tree | 0.6 | ||
| volume | Volume Inventory | 0.6 |
QueryVolumeSnapshotTree
Queries a volume snapshot tree. For example,
QueryVolumeSnapshotTree uuid=b3e785f593bd4dc7b74bd0be1f612de8
Primitive Fields of Query
See Volume Snapshot Inventory.
Nested and Expanded Fields of Query
| Field | Inventory | Description | Starting Version |
|---|---|---|---|
| snapshot | Snapshot Inventory | 0.6 | |
| volume | Volume Inventory | 0.6 |
UpdateVolumeSnapshot
Updates a volume snapshot. For example,
UpdateVolumeSnapshot uuid=b3e785f593bd4dc7b74bd0be1f612de8
Parameters
| Name | Description | Optional | Valid Value | Starting Version |
|---|---|---|---|---|
| uuid | The snapshot UUID. | 0.6 | ||
| name | The new name of the snapshot. | Yes | 0.6 | |
| description | The detailed description of the snapshot. | Yes | 0.6 | |
| userTags | The user tags. For more information, see CreateUserTag. The resource type is VolumeVO. | Yes | 0.6 | |
| systemTags | The system tags. For more information, see CreateSystemTag. The resource type is VolumeVO. | Yes | 0.6 | |
| timeout | Yes |
DeleteVolumeSnapshot
Deletes a volume snapshot. For example,
DeleteVolumeSnapshot uuid=b3e785f593bd4dc7b74bd0be1f612de8 deleteMode=Permissive
Parameters
| Name | Description | Optional | Valid Value | Starting Version |
|---|---|---|---|---|
| uuid | The snapshot UUID. | 0.6 | ||
| deleteMode | The delete mode. For more information, see Delete Resources. | Yes |
|
0.6 |
| direction | The data merge direction. Pull: Merge forward; Commit: Merge backward; Auto: Automatically select the optimal merge direction. | Yes | 5.4.0 | |
| scope | The data merge mode. Single: Merge only a single snapshot; Chain: Merge the entire snapshot chain; Auto: Automatically determine the best possible merge scope. | Yes | 5.4.0 | |
| userTags | The user tags. For more information, see CreateUserTag. The resource type is VolumeVO. | Yes | 0.6 | |
| systemTags | The system tags. For more information, see CreateSystemTag. The resource type is VolumeVO. | Yes | 0.6 | |
| timeout | Yes |
RevertVolumeFromSnapshot
Reverts a volume to a specified snapshot. For example,
RevertVolumeFromSnapshot uuid=ee70cdf1f9c4492288403a9708bb6434
Parameters
| Name | Description | Optional | Valid Value | Starting Version |
|---|---|---|---|---|
| uuid | The snapshot UUID. | 0.6 | ||
| userTags | The user tags. For more information, see CreateUserTag. The resource type is VolumeVO. | Yes | 0.6 | |
| systemTags | The system tags. For more information, see CreateSystemTag. The resource type is VolumeVO. | Yes | 0.6 | |
| timeout | Yes |
GetVolumeSnapshotSize
Obtains the snapshot size of a volume. For example,
GetVolumeSnapshotSize uuid=ad2126f57be049ad9fcc85ccff53ce78
Parameters
| Name | Description | Optional | Valid Value | Starting Version |
|---|---|---|---|---|
| uuid | The snapshot UUID. | 3.5.0 | ||
| userTags | The user tags. For more information, see CreateUserTag. | Yes | 3.5.0 | |
| systemTags | The system tags. For more information, see CreateSystemTag. | Yes | 3.5.0 | |
| timeout | Yes |
ShrinkVolumeSnapshot
Shrinks a volume snapshot. For example,
ShrinkVolumeSnapshot uuid=7d8b27866eb24dc493ccf5bacd6ec883
Parameters
| Name | Description | Optional | Valid Value | Starting Version |
|---|---|---|---|---|
| uuid | The resource UUID. | 3.10.0 | ||
| userTags | The user tags. For more information, see CreateUserTag. | Yes | 3.10.0 | |
| systemTags | The system tags. For more information, see CreateSystemTag. | Yes | 3.10.0 | |
| timeout | Yes |
FlattenVolume
Flattens the snapshots of a volume. For example,
FlattenVolume uuid=7d8b27866eb24dc493ccf5bacd6ec883
Parameters
| Name | Description | Optional | Valid Value | Starting Version |
|---|---|---|---|---|
| uuid | The resource UUID. | 4.7.0 | ||
| dryRun | Trial. Predicate the data usage. | Yes | 4.7.0 | |
| userTags | The user tags. For more information, see CreateUserTag. | Yes | 4.7.0 | |
| systemTags | The system tags. For more information, see CreateSystemTag. | Yes | 4.7.0 | |
| timeout | Yes |
Tags
You can create a tag on a volume by using resourceType=VolumeVO. For example,
CreateUserTag resourceType=VolumeVO tag=goldenVolume \
resourceUuid=f97b8cb9bccc4872a723c8b7785d9a12
