[Rdo-list] Notes for setting up NFS share to store nova instances

Kashyap Chamarthy kchamart at redhat.com
Fri Jun 21 12:14:02 UTC 2013


Heya,

I just saw a question on RDO forum related to $subject. Just posting some notes here, as
this was in my drafts anyhow. (Will point a link to this on the Forum. Also, thanks to
Giulio Fidente for reminding me on the qemu.conf bit below).


NFS share to store nova instances
---------------------------------

If you have an NFS share to store images, you could add it the below
way. The default location where instances are stored --
`/var/lib/nova/instances`

First, on the NFS server side :

    $ cat /etc/exports
    /home/kashyap   *(rw,syn,no_root_squash)


Mount an nfs share w/ nova specific SELinux context :

    $ mount --verbose -t nfs xx.yy.www.zzz:/home/kashyap \
      /mnt -o "context=unconfined_u:object_r:nova_var_lib_t:s0"

    # Set correct permissions on mount point

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


Ensure to have nova own the QEMU instances invoked by :

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


Restart all 'running' OpenStack services :

    $ for j in `for i in $(ls -1 /etc/init.d/openstack-*) ; \
      do $i status | grep running ; done | awk '{print $1}'`; \
      do service $j restart ; done


Later, ensure, your instances are indeed owned by nova ::

    $ ps -ef | grep -i qemu-kvm | grep -i nova


-- 
/kashyap




More information about the rdo-list mailing list