diff options
author | Francisco Redondo Marchena <francisco.marchena@codethink.co.uk> | 2014-11-27 18:01:12 +0000 |
---|---|---|
committer | Richard Ipsum <richardipsum@fastmail.co.uk> | 2014-11-27 18:12:15 +0000 |
commit | 252173e035ea5c3e3568f4f2b843e3ab10b57e18 (patch) | |
tree | 9821e5b3245c5a7987db88af9a5e8dcadccae1fe /openstack/usr/share | |
parent | 5bbe18b50c8590366cfedbd2ebd2138a399f9a42 (diff) | |
download | definitions-252173e035ea5c3e3568f4f2b843e3ab10b57e18.tar.gz |
FIXME and SQUEEZEME: Add log directory and create a volume group for cinderbaserock/richardipsum/openstack
This commit adds a temporarly way to test cinder. It assumes that when
the VM is deployed it will also add a second image to the VM where the
Volumes for cinder will be placed when creating.
Diffstat (limited to 'openstack/usr/share')
-rw-r--r-- | openstack/usr/share/openstack/openstack-cinder-setup | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/openstack/usr/share/openstack/openstack-cinder-setup b/openstack/usr/share/openstack/openstack-cinder-setup index 281481cd..bd21a6cc 100644 --- a/openstack/usr/share/openstack/openstack-cinder-setup +++ b/openstack/usr/share/openstack/openstack-cinder-setup @@ -60,6 +60,12 @@ if [ ! -d /var/lock/cinder ]; then chown -R cinder:cinder /var/lock/cinder fi +# Create the log directory for cinder +if [ ! -d /var/log/cinder ]; then + mkdir -p /var/log/cinder + chown -R cinder:cinder /var/log/cinder +fi + # Setup the cinder database if [ ! -e /var/lib/cinder/cinder.sqlite ]; then chown -R cinder:cinder /var/lib/cinder @@ -72,6 +78,23 @@ if [ ! -d /var/lib/cinder/volumes ]; then chown -R cinder:cinder /var/lib/cinder/volumes fi +# This is only for testing purposes and we need to change it for +# something more robust to deploy in production. +# This also assumes that the user will add a second disk to its VM +# and if it does not find sdb or vda it will fail. +if [ $(ls /sys/block | grep -v sda | grep [vs]d | wc -l) -ne 1 ]; then + echo "Error: More than one or none block device found, cinder will not be able to create a VG." + exit 1 +else + device=/dev/$(ls /sys/block | grep -v sda | grep [vs]d) +fi + +# Create a physical volume +pvcreate -ff -y $device + +# Create a volume group named "cinder-volumes" +vgcreate -y cinder-volumes $device + # Remove the one-shot setup service rm /etc/systemd/system/multi-user.target.wants/openstack-cinder-setup.service |