diff options
authorFrancisco Redondo Marchena <>2014-11-27 18:01:12 +0000
committerRichard Ipsum <>2014-11-27 18:12:15 +0000
commit252173e035ea5c3e3568f4f2b843e3ab10b57e18 (patch)
parent5bbe18b50c8590366cfedbd2ebd2138a399f9a42 (diff)
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.
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
+# Create the log directory for cinder
+if [ ! -d /var/log/cinder ]; then
+ mkdir -p /var/log/cinder
+ chown -R cinder:cinder /var/log/cinder
# 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
+# 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
+ device=/dev/$(ls /sys/block | grep -v sda | grep [vs]d)
+# 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/