How to deploy cinder with NFS

Intro:
Cinder is responsible for management of block storage in openstack, and handles volume management related tasks. Cinder supports different volume drivers, those drivers allows creation and modification of volumes directly on related storage Vendor (type). in our case, NFS driver. we will configure and deploy cinder with native NFS Server installed on clean RHEL6.4 server.

Setup:
Cinder machine installed with RHEL6.4 * note: we are using basic AIO topology (it could be easily deployed on a dedicated machine running only cinder).

Dedicated physical machine installed with RHEL6.4 (64bit) * note: this machine will be used to host the NFS server

NFS Storage Server :
ssh to the storage server make sure that nfs-utils package is installed: # rpm -q nfs-utils if share does not exists: # mkdir /share # cp /etc/exports /etc/exports.orig # echo "/share *(rw,sync,no_root_squash)" > /etc/exports # exportfs -rav verify the share is exported: # showmount -e localhost

Cinder machine :
Run the following on openstack to configure Cinder to use the NFS share # openstack-config --set /etc/cinder/cinder.conf DEFAULT \nfs_shares_config /etc/cinder/shares.conf # openstack-config --set /etc/cinder/cinder.conf DEFAULT \volume_driver cinder.volume.nfs.NfsDriver # echo ":/ " > /etc/cinder/shares.conf # mkdir /var/lib/cinder/mnt # chown -v cinder.cinder /var/lib/cinder/mnt Verify the changes # cat /etc/cinder/shares.conf # grep -i nfs /etc/cinder/cinder.conf | grep -v \# Configure SELinux # setsebool -P virt_use_nfs on # setsebool virt_use_nfs Restart the Cinder services and verify they are running # for i in $(chkconfig --list | awk ' /cinder/ { print $1 }'); do service $i restart; done # for i in $(chkconfig --list | awk ' /cinder/ { print $1 }'); do service $i status; done Delete cinder-volumes # vgs # vgremove cinder-volumes # vgs

Testing:
let's make sure its indeed working: # cinder create --display-name  5 # cinder list