OpenStack NFS Storage

Having an OpenStack NFS storage will allow for the testing of VM migration between Nova Compute nodes. The following highlights a simple way of building an NFS storage for your OpenStack VMs.

Prerequisites

  • NFS Server with nova access
  • CentOS 7.3 as the NFS Client
  • OpenStack compute nodes deployed (tested on Mitaka and Newton)

Server Side

Create a directory on your NFS Server
mkdir -p /share/nfs/nova_instances

Change permissions to r/w
chmod -R 777 /share/nfs/nova_instances

Client Side

Before beginning make sure /var/lib/nova/instances is empty of any existing VMs
ls /var/lib/nova/instances/

Make the following changes to /etc/libvirt/qemu.conf within each compute/nova node
vi /etc/libvirt/qemu.conf
Uncomment and change dynamic_ownership to 0

#dynamic_ownership = 1

Uncomment the following

#user = "root"
#group = "root"

Restart libvirtd
systemctl restart libvirtd

Edit fstab to add an NFS mount point to the bottom of the file
vi /etc/fstab

nfs.lab.local:/share/nfs/nova_instances /var/lib/nova/instances nfs auto 0 0

Reload the mount point
mount -a

Note1: Make sure file permissions on the NFS server allow the ‘nova’ user to write
Note2: nova user IDs should be in sync between compute nodes ( i.e. same uid/gid )
id nova
Sample output
uid=109(nova) gid=116(nova) groups=116(nova),111(libvirtd)

Make sure /var/lib/nova has correct user/group ownership
chown -R nova:nova /var/lib/nova



Categories: openstack

Tags: ,

2 replies

  1. Reblogged this on Tricky Deadline and commented:
    This is nice start form Scott. I am sure he has tons of info to share. Very powerful and simple post how to use a Shared NFS disk pool among nova computes.

    Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: