Ask Your Question
0

Add LVM to RDO installation

asked 2013-12-23 01:21:58 -0500

Leonard gravatar image

updated 2014-01-22 15:13:05 -0500

Evgeny gravatar image

Hi, I have successfully installed Openstack through the packstack installer. However, Openstack Havana only shows the 50gb allocated to home. How can I add the /dev/sda2 LVM to be used for VMs?

Thank you.

edit retag flag offensive close merge delete

Comments

There are a few servicces that require a lot of space, so you will need separate LVMs/partitions for nova, glance (if on the same machine) and libvirt (if you reboot the compute node, libvirt will snapshot every instance in /var/lib/libvirt/something)

Cristi Falcas gravatar imageCristi Falcas ( 2013-12-23 05:50:48 -0500 )edit

2 answers

Sort by ยป oldest newest most voted
2

answered 2013-12-23 05:44:47 -0500

kashyapc gravatar image

updated 2013-12-23 06:41:13 -0500

The default location where Nova stores its guests is /var/lib/nova/instances. You can edit /etc/nova/nova.conf :

  • Change the instances_path attribute in nova.conf
  • Restart Nova services
     $ openstack-service restart nova 
  • Ensure you have the right SELinux context (if you're using Fedora or its derivative based infrastructure)

Update

You need to mount whatever block device to be used to store Nova instances.

Ensure the mount point has Nova specific SELinux context:

# For instance, if it's on an NFS share:
$ mount --verbose -t nfs xx.yy.www.zzz:/home/kashyap \
  /mnt -o "context=unconfined_u:object_r:nova_var_lib_t:s0"

Provide correct permissions on the mount point:

$ chown -R nova:nova /mnt/nova/
$ chgrp -R qemu /mnt/nova/instances/
$ chmod -R g+w /mnt/nova/instances

Ensure to have nova user own the QEMU instances:

$ grep nova /etc/libvirt/qemu.conf
user = "nova"
group = "nova"

Confirm your instances are indeed owned by nova user:

$ ps -ef | grep -i qemu-kvm | grep -i nova
edit flag offensive delete link more

Comments

Thanks for your answer kashyapc. How do I setup the instances on /dev/sda2? simply writing instances_path = /dev/sda2 doesn't seem to work.

Leonard gravatar imageLeonard ( 2013-12-23 06:01:17 -0500 )edit

mount /dev/sda2 /var/lib/nova/instances. But first you should move your existing instances to sda2, so I would first mount /dev/sda2/ /mnt/tmp; mv /var/lib/nova/instances/* /mnt/tmp; chown nova -R /mnt/tmp. After that you can mount sda2 to nova instances path.

Cristi Falcas gravatar imageCristi Falcas ( 2013-12-23 06:11:33 -0500 )edit

Cristi is right. Also, I updated my answer with some more details about mount/permissions. I just took an example that mount point is on an NFS share. You need to adjust them accordingly. Hope that helps.

kashyapc gravatar imagekashyapc ( 2013-12-23 06:45:18 -0500 )edit

@Cristi Falcas I just got this result running "mount /dev/sda2 /var/lib/nova/instances": mount: unknown filesystem type 'LVM2_member' @kashyapc I can't really understand your command. Are you doing the same thing Cristi is advocating?

Leonard gravatar imageLeonard ( 2013-12-23 12:43:38 -0500 )edit
1

Youd don't mount the physical partition when using LVM. Instead you mount your logical volume: lvscan and after that mount the desired volume. But I think that openstack may not be the ideal solution for you, since working with lvm is considered basic knowledge.

Cristi Falcas gravatar imageCristi Falcas ( 2013-12-23 15:02:32 -0500 )edit
0

answered 2018-06-14 04:34:40 -0500

@kashyapc : thanks so much, It work like a charm.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Get to know Ask OpenStack

Resources for moderators

Question Tools

2 followers

Stats

Asked: 2013-12-23 01:21:58 -0500

Seen: 778 times

Last updated: Dec 23 '13