Create the new volume
To create a new volume, access the "Volumes" menu on the left panel in Horizon and then click "Create Volume" as show in the screenshot below:
Fill-in the form, including the desired size, and press "Create Volume" :
The new volume is created:
Attach the new volume
Once the volume has been created it can be attached to an instance.
For this, go to the Instances tab and select the instance which will get the extra volume.
Then open the top right menu and click "Attach Volume" :
Select the volume to be attached and click "Attach Volume" :
The new volume will then appear in the "Volumes Attached" section under the instance page :
Format the new disk
To use the new attached volume on the virtual machine, it needs to be partitioned, formatted and mounted.
Follow the instructions below.
- Login to the virtual machine.
The VM will now have an additional disk, typically named vd(SOME_LETTER) or sd(SOME_LETTER). We will assume the disk is named vdb, but it may be vdc, vdd, ... if the VM already had additional disks.
Check the attached disks by running
lsblk, which shows disks (e.g. vda, vdb) and partitions on the disks (vda1, vda2, etc for partitions 1 & 2 on vda).You should see something like this, showing vdb with no partition:
$ lsblk NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS vda 252:0 0 30G 0 disk └─vda1 252:1 0 30G 0 part / vdb 252:16 0 10G 0 disk
Create a single partition (number 1, so vdb1) filling the disk, labelled "data-1" here, and format it. You can use parted and mkfs.ext4:
sudo parted --script -- /dev/vdb mklabel gpt sudo parted --script --align optimal -- /dev/vdb mkpart primary ext4 0% 100% sudo mkfs.ext4 -L data-1 /dev/vdb1
You may partition the disk differently and use any other filesystem type. It is recommended to use the same name as the volume for the label of the new filesystem (here:
data-1).- To have the disk automounted on start up, add an entry to your VM's
/etc/fstab,adapting the label to the name you chose earlier:echo "LABEL=data-1 /data1 ext4 defaults 0 0" | sudo tee -a /etc/fstab > /dev/null
Create the directory where you are mounting your filesystem. Make sure you use the same path as defined in fstab:
sudo mkdir /data1
Mount the file system this first time around and check it's ok. It should be automatically mounted on future reboots (test this now if it's important).
sudo mount -av
Attaching many volumes
Due to limitations in the underlying OpenStack infrastructure at ECMWF, a user cannot hot-plug more than 12-13 pci devices. If you need more than 12-13 volumes, the VM must be powered off, before more devices are added.





