Install nova-volume on the cloud controller
While nova-volume does not directly use the network, you must have networking set up for Compute prior to configuring the volumes.
On Ubuntu, install nova-volume and lvm2.
$ apt-get install lvm2 nova-volume
On RHEL and derivatives, the nova-volume service should already be installed.
Configure Volumes for use with
nova-volume
The openstack-nova-volume service requires an LVM Volume Group called nova-volumes to exist.
If you do not already have LVM volumes on hand, but have free drive
space, you will need to create a LVM volume before proceeding. Here is a
short run down of how you would create a LVM from free drive space on
your system. Start off by issuing an fdisk command to your drive with
the free space:
$ fdisk /dev/sda
Once in fdisk, perform the following commands:
Press n
to create a new disk
partition,
Press p
to create a primary disk
partition,
Press 1
to denote it as 1st disk
partition,
Either press ENTER twice to
accept the default of 1st and last
cylinder – to convert the remainder
of hard disk to a single disk
partition -OR- press ENTER once to
accept the default of the 1st, and
then choose how big you want the
partition to be by specifying
+size[K,M,G]
e.g. +5G or +6700M.
Press t
and select the new partition that
you have created.
Press 8e
change your new partition to 8e,
i.e. Linux LVM partition
type.
Press p
to display the hard disk partition
setup. Please take note that the
first partition is denoted as
/dev/sda1 in
Linux.
Press w
to write the partition table and
exit fdisk upon completion.
Refresh your partition table
to ensure your new partition shows
up, and verify with
fdisk. We then
inform the OS about the table
partition update:
$ partprobe
$ fdisk -l
You should see your new partition in this listing.
Here is how you can set up partitioning during the OS
install to prepare for this nova-volume
configuration:
root@osdemo03:~# fdisk -l
Device Boot Start End Blocks Id System
/dev/sda1 * 1 12158 97280 83 Linux
/dev/sda2 12158 24316 97655808 83 Linux
/dev/sda3 24316 24328 97654784 83 Linux
/dev/sda4 24328 42443 145507329 5 Extended
/dev/sda5 24328 32352 64452608 8e Linux LVM
/dev/sda6 32352 40497 65428480 8e Linux LVM
/dev/sda7 40498 42443 15624192 82 Linux swap / Solaris
Now that you have identified a partition has been labeled
for LVM use, perform the following steps to configure LVM
and prepare it as nova-volumes. You
must name your volume group ‘nova-volumes’ or things
will not work as expected:
$ pvcreate /dev/sda5
$ vgcreate nova-volumes /dev/sda5