OpenStack uses volumes to store data. Think of volumes as a hard disk that you can attach at will to one of your virtual servers. There are a few steps to attach these to an instance, that will be detailed here.
First, you need to log into the advanced control panel - called Horizon by selecting the advanced interface box. This box has a link to the Horizon login and your username and password
Go to Horizon and put your details in:
You can then view the volumes by clicking on the volumes button, located on the left of the screen you are presented with once you are logged in:
This will give you a list of all the volumes that are part of your project;
To create a volume, select the “Create Volume” button, located to the top right of the list of volumes
This will present you with a form to fill in:
Provide a volume name, select “ceph” from the volume type and input the size you want the volume to be. The interface tells you how much of your quota this will use;
Once you are happy, hit create volume, and a new volume will appear at the top of your list:
To attach this to a VM, you need to tell openstack to do this;
select ‘Manage Attachments’ and then choose the instance you want to attach it to;
This will then show it is attached;
at this point you can log into the system, format and mount the volume.
First create a partition table for the volume:
sudo fdisk /dev/vdc
once fdisk starts enter ‘n’ hit and accept the default options. Once the command prompt asks for the following, enter the command ‘w’ and hit enter;
Command (m for help):
this will create a volume on /dev/vdc1 that is unformatted. Formatting a disk is DESTRUCTIVE, see the WARNING below! To format this run the command:
sudo mkfs.ext4 /dev/vdc1
This will create the filesystem. Then you can mount the volume in your space:
sudo mount /dev/vdc1 example/
because the volume will have been mounted as root, you need to make sure that your user has ownership. In this example the user is ubuntu:
sudo chown ubuntu:ubuntu example/
At that point you should be able to use the volume you have created;
/dev/vdc1 99G 60M 94G 1% /home/ubuntu/example
After you reboot your instance, your volumes will be UNMOUNTED but still ATTACHED.
To remount them, simply
To find the device name (looks like
mount /dev/vdX [mountpoint]
DO NOT RUN
fdisk ON A VOLUME THAT CONTAINS DATA, IT WILL DESTROY ALL DATA ON THE VOLUME!