Volumes are block storage devices that you attach to instances to enable persistent storage. You can attach a volume to a running instance or detach a volume and attach it to another instance at any time. You can also create a snapshot from or delete a volume. Only administrative users can create volume types.
Table of Contents
Create a volume
- Log in to the dashboard.
- Select the appropriate project from the drop down menu at the top left.
- On the Project tab, open the Volumes tab and click Volumes category.
- Click Create Volume. In the dialog box that opens (fig), enter or select the following values.
Volume Name: Specify a name for the volume.
Description: Optionally, provide a brief description for the volume.
Volume Source: Select one of the following options:- No source, empty volume: Creates an empty volume. An empty volume does not contain a file system or a partition table.
- Snapshot: If you choose this option, a new field for Use snapshot as a source displays. You can select the snapshot from the list.
- Image: If you choose this option, a new field for Use image as a source displays. You can select the image from the list.
- Volume: If you choose this option, a new field for Use volume as a source displays. You can select the volume from the list. Options to use a snapshot or a volume as the source for a volume are displayed only if there are existing snapshots or volumes.
Type: Leave this field blank.
Size (GB): The size of the volume in gibibytes (GiB). Note the green bars on the right side of the image (Volume Limits), which represent the disk space and the number of volumes that you want to occupy.
Availability Zone: Leave the default Nova.
- Click Create Volume.
...
- Log in to the dashboard.
- Select the appropriate project from the drop down menu at the top left.
- On the Project tab, open the Volumes tab and click Volumes category.
- Select the check boxes for the volumes that you want to delete.
- Click Delete Volumes and confirm your choice.
A message indicates whether the action was successful.
Extend a volume
In order to extend a volume already attached to an instance, it following steps should be followed:
- Detach the volume from the instance so that is becomes available
- Extend the volume and save after specifying the desired size
- Re-attach the volume to the instance
Connect to the instance and perform a resize so the the device show the entire disk size:
Code Block language bash title check data collapse true root@minio-iotwins:~# df -h Filesystem Size Used Avail Use% Mounted on udev 3.9G 0 3.9G 0% /dev tmpfs 798M 844K 798M 1% /run /dev/vda1 78G 2.3G 76G 3% / tmpfs 3.9G 0 3.9G 0% /dev/shm tmpfs 5.0M 0 5.0M 0% /run/lock tmpfs 3.9G 0 3.9G 0% /sys/fs/cgroup /dev/vda15 105M 3.6M 101M 4% /boot/efi overlay 78G 2.3G 76G 3% /var/lib/docker/overlay2/9984becaaa691c6aa6842273a6f2e137e1fa0737bbca94dec1554caeee021f44/merged overlay 78G 2.3G 76G 3% /var/lib/docker/overlay2/ca67048011fc1a9e67ecf4ebad11aa2f210cac4336ef9683ccd6005251d4e69e/merged shm 64M 0 64M 0% /var/lib/docker/containers/fa9ae914556ca58893dd248939e8132710f672289b0baa35d8fb43d790c1deb9/mounts/shm shm 64M 0 64M 0% /var/lib/docker/containers/8cab3616d80fa0f136447f301ab699c5d3e2abb88f6a23b914dd34f7cb3dbf7d/mounts/shm tmpfs 798M 0 798M 0% /run/user/1000 /dev/vdc 45G 53M 42G 1% /data root@minio-iotwins:~# grep vdc /proc/partitions 252 32 49283072 vdc root@minio-iotwins:~# resize2fs /dev/vdc resize2fs 1.44.1 (24-Mar-2018) Filesystem at /dev/vdc is mounted on /data; on-line resizing required old_desc_blocks = 6, new_desc_blocks = 6 The filesystem on /dev/vdc is now 12320768 (4k) blocks long. root@minio-iotwins:~# df -h Filesystem Size Used Avail Use% Mounted on udev 3.9G 0 3.9G 0% /dev tmpfs 798M 844K 798M 1% /run /dev/vda1 78G 2.3G 76G 3% / tmpfs 3.9G 0 3.9G 0% /dev/shm tmpfs 5.0M 0 5.0M 0% /run/lock tmpfs 3.9G 0 3.9G 0% /sys/fs/cgroup /dev/vda15 105M 3.6M 101M 4% /boot/efi overlay 78G 2.3G 76G 3% /var/lib/docker/overlay2/9984becaaa691c6aa6842273a6f2e137e1fa0737bbca94dec1554caeee021f44/merged overlay 78G 2.3G 76G 3% /var/lib/docker/overlay2/ca67048011fc1a9e67ecf4ebad11aa2f210cac4336ef9683ccd6005251d4e69e/merged shm 64M 0 64M 0% /var/lib/docker/containers/fa9ae914556ca58893dd248939e8132710f672289b0baa35d8fb43d790c1deb9/mounts/shm shm 64M 0 64M 0% /var/lib/docker/containers/8cab3616d80fa0f136447f301ab699c5d3e2abb88f6a23b914dd34f7cb3dbf7d/mounts/shm tmpfs 798M 0 798M 0% /run/user/1000 /dev/vdc 47G 53M 44G 1% /data
Check data is still present on the
Code Block language bash title check data collapse true root@minio-iotwins:~# ll /data/ total 40 drwxr-xr-x 7 root root 4096 Dec 18 16:03 ./ drwxr-xr-x 24 root root 4096 Dec 18 06:17 ../ drwxr-xr-x 6 root root 4096 Dec 18 15:00 .minio.sys/ drwxr-xr-x 2 root root 4096 Dec 18 15:47 cduma/ drwx------ 2 root root 16384 Dec 17 16:28 lost+found/ drwxr-xr-x 3 root root 4096 Dec 18 16:05 rossitisbeni/ drwxr-xr-x 4 root root 4096 Dec 18 16:02 scratch/ root@minio-iotwins:~# ll /data/scratch/ total 16 drwxr-xr-x 4 root root 4096 Dec 18 16:02 ./ drwxr-xr-x 7 root root 4096 Dec 18 16:03 ../ drwxr-xr-x 2 root root 4096 Dec 18 16:01 pippo/ drwxr-xr-x 2 root root 4096 Dec 18 16:02 rossitisbeni/ root@minio-iotwins:~# ll /data/scratch/pippo/ total 32 drwxr-xr-x 2 root root 4096 Dec 18 16:01 ./ drwxr-xr-x 4 root root 4096 Dec 18 16:02 ../ -rw-r--r-- 1 root root 23407 Dec 18 16:01 'Screenshot 2020-12-18 at 10.50.50.png'