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 Optional 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.
  • Root
  • Data
0.6
format The volume format. For more information, see Format.
  • qcow2
0.6
size The virtual size of the volume. Unit: byte. 0.6
actualSize 0.6
isShareable 0.6
deviceId The device ID. For more information, see Device ID. Yes 0.6
state The volume state. For more information, see State.
  • Enabled
  • Disabled
0.6
status The volume status. For more information, see Status.
  • Creating
  • Ready
  • NotInstantiated
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": "/zstack_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 1.
Figure 1. Volume Status Transition Diagram































Back to Top

Download

Already filled the basic info?Click here.

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)

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

Download

Not filled the basic info yet? Click here.

Invalid email address or mobile number.

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)

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)

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.