Creating Volumes
A local volume is created only when creating a cloud server (virtual machine). A network volume can be created either together with the server or separately.
You can create a network volume with content (from image, another volume, or snapshot) and then connect it to the server as a boot (system) volume. You can also create an empty network volume and connect it to the VM as an additional one to scale the volume space. Learn more about connecting volumes to the server.
Creating Volumes from Images
You can create a volume from a prebuilt image or your own one.
Creating Volumes from Images in the Control Panel
To create a volume from an image in the Control panel:
- Go to the Volumes section in the project.
- Click Create volume.
- Specify the pool and pool segment. Select the pool where the image is located.
- Enter a name for the volume.
- Click on the Source field and go to the Default images or My images tab. You can upload your own image by following the Creating images article. Select the image and click Select.
- Select the volume type and specify its size in GB.
- Click Create.
Creating Volumes from Images through CLI
Learn more about getting started with the OpenStack CLI.
To create a volume from image, run the following:
openstack volume create --image <image> --size <size> --type <type> <volume name>
A list of all available images can be viewed using the openstack image list --public
command.
When creating from image, the volume --size
in GB is a required parameter, it must be greater than the image size or equal to it.
Available volume types can be viewed using the openstack volume type list
command. See Viewing volume types for more information.
When created from image, the volume automatically receives a boot label (bootable==true
parameter).
An example of creating a volume from image:
openstack volume create --image 'Ubuntu 18.04 LTS 64-bit' --size 5 --type fast.ru-7a VOLUME_FROM_IMAGE
The response will look as follows:
+---------------------+--------------------------------------+
| Field | Value |
+---------------------+--------------------------------------+
| attachments | [] |
| availability_zone | ru-7a |
| bootable | true |
| consistencygroup_id | None |
| created_at | 2020-04-28T00:43:21.000000 |
| description | None |
| encrypted | False |
| id | 578f123a-525b-46b9-acba-d22f11e9be9f |
| multiattach | False |
| name | VOLUME_FROM_IMAGE |
| properties | |
| replication_status | None |
| size | 5 |
| snapshot_id | None |
| source_volid | None |
| status | creating |
| type | fast.ru-7a |
| updated_at | None |
| user_id | d11f8bea67f94083803c1000f458664ak9 |
+---------------------+--------------------------------------+
Creating Volumes from other Volumes
To clone a volume, you need to create a new volume from it. In this case, the created volume is an exact copy of the previous one.
Creating Volumes from other Volumes in the Control Panel
To create a volume from another volume in the Control panel:
- Go to the Volumes section in the project.
- Click Create volume.
- Specify the pool and pool segment. Select the pool where the image is located.
- Enter a name for the volume.
- Click on the Source field and go to the Volumes tab. Volumes can be sorted by type. Select the volume and click Select.
- Select the volume type and specify its size in GB.
- Click Create.
Creating Volumes from other Volumes through CLI
Learn more about getting started with the OpenStack CLI.
To create a volume from another volume, run the following:
openstack volume create --source <volume> --size <size> --type <type> <volume name>
A list of all available volumes can be viewed using the openstack volume list --long
command.
The volume --size
parameter in GB is optional, but when specified, it must be greater than the size of the source volume or equal to it.
Available volume types can be viewed using the openstack volume type list
command. See Viewing volume types for more information.
An example of creating a volume from another volume:
openstack volume create --source 6d02b73e-1144-4986-8878-91127fe414dd --size 5 --type fast.ru-7a VOLUME_FROM_VOLUME
The response will look as follows:
+---------------------+--------------------------------------+
| Field | Value |
+---------------------+--------------------------------------+
| attachments | [] |
| availability_zone | ru-7a |
| bootable | false |
| consistencygroup_id | None |
| created_at | 2020-04-28T00:43:21.000000 |
| description | None |
| encrypted | False |
| id | 91622117-4950-46fb-89ab-b2940c2bfeba |
| multiattach | False |
| name | VOLUME_FROM_VOLUME |
| properties | |
| replication_status | None |
| size | 5 |
| snapshot_id | None |
| source_volid | 6d02b73e-1144-4986-8878-91127fe414dd |
| status | creating |
| type | fast.ru-7a |
| updated_at | None |
| user_id | d11f8bea67f94083803c1000f458664ak9 |
+---------------------+--------------------------------------+
When creating a new volume in a different zone (other than the one where the original volume is located), you need to add the new zone parameter --availability-zone
, for example:
openstack volume create --source 6d02b73e-1144-4986-8878-91127fe414dd --size 5 --type fast.ru-7a --availability-zone ru-7a VOLUME_FROM_VOLUME
Creating Volumes from Snapshots
To create a snapshot, see the Creating snapshots article.
Creating Volumes from Snapshots in the Control Panel
You can create a volume from a snapshot in the volume card or through the form for creating a new volume.
To create a volume in the volume card in the Control panel:
- Go to the Volumes section in the project.
- Open the volume card and go to the Snapshots tab.
- Expand the (⋮) menu and click Create volume from this snapshot.
- Enter a name for the volume.
- Select the volume type and specify its size in GB.
- Click Create.
To create a volume through a form in the Control panel:
- Go to the Volumes section in the project.
- Click Create volume.
- Specify the pool and pool segment. Select the pool where the volume from which the snapshot was created is located.
- Enter a name for the volume.
- Click on the Source field and go to the Snapshots tab. Select the snapshot and click Select.
- Select the volume type and specify its size in GB.
- Click Create.
Creating Volumes from Snapshots through CLI
Learn more about getting started with the OpenStack CLI.
To create a volume from a snapshot, run the following:
openstack volume create --snapshot <snapshot> --size <size> --type <type> <volume name>
See the list of available snapshots and information about them in Viewing snapshots.
The volume --size
parameter in GB is optional, but when specified, it must be greater than the size of the snapshot or equal to it.
Available volume types can be viewed using the openstack volume type list
command. See Viewing volume types for more information.
An example of creating a volume from a snapshot:
openstack volume create --snapshot e7f61170-f293-42d6-92b6-905f3f0edd69 --size 5 --type fast.ru-7a VOLUME_FROM_SNAPSHOT
The response will look as follows:
+---------------------+--------------------------------------+
| Field | Value |
+---------------------+--------------------------------------+
| attachments | [] |
| availability_zone | ru-7a |
| bootable | false |
| consistencygroup_id | None |
| created_at | 2020-04-28T00:43:21.000000 |
| description | None |
| encrypted | False |
| id | 12067494-4210-11da-01ab-f2030c1adecb |
| multiattach | False |
| name | VOLUME_FROM_SNAPSHOT |
| properties | |
| replication_status | None |
| size | 5 |
| snapshot_id | e7f61170-f293-42d6-92b6-905f3f0edd69 |
| source_volid | None |
| status | creating |
| type | fast.ru-7a |
| updated_at | None |
| user_id | d11f8bea67f94083803c1000f458664ak9 |
+---------------------+--------------------------------------+
Creating Empty Volumes
Creating Empty Volumes in the Control Panel
To create an empty volume in the Control Panel:
- Go to the Volumes section in the project.
- Click Create volume.
- Specify the pool and pool segment.
- Enter a name for the volume.
- Leave the Source field blank.
- Select the volume type and specify its size in GB.
- Click Create.
Creating Empty Volumes through CLI
Learn more about getting started with the OpenStack CLI.
To create an empty volume, run the following:
openstack volume create --size <size> --type <type> <volume name>
The volume --size
in GB is a required parameter.
Available volume types can be viewed using the openstack volume type list
command. See Viewing volume types for more information.
An example of creating an empty volume:
openstack volume create --size 5 --type fast.ru-7a VOLUME_EMPTY
The response will look as follows:
+---------------------+--------------------------------------+
| Field | Value |
+---------------------+--------------------------------------+
| attachments | [] |
| availability_zone | ru-7a |
| bootable | false |
| consistencygroup_id | None |
| created_at | 2020-04-28T00:43:21.000000 |
| description | None |
| encrypted | False |
| id | d4a61763-f293-42d6-92b6-905f3f0ecc69 |
| multiattach | False |
| name | VOLUME_EMPTY |
| properties | |
| replication_status | None |
| size | 5 |
| snapshot_id | None |
| source_volid | None |
| status | creating |
| type | fast.ru-7a |
| updated_at | None |
| user_id | d11f8bea67f94083803c1000f458664ak9 |
+---------------------+--------------------------------------+