From f8606568b23267f230af25e0ca0e759ea1ab20e2 Mon Sep 17 00:00:00 2001 From: Patrick Darley Date: Fri, 27 Mar 2015 18:40:56 +0000 Subject: Partition the second disk --- .../usr/share/openstack/openstack-cinder-configure-backends | 2 +- openstack/usr/share/openstack/openstack-cinder-setup | 11 +++++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/openstack/usr/share/openstack/openstack-cinder-configure-backends b/openstack/usr/share/openstack/openstack-cinder-configure-backends index 1f2c3a2a..9b805d46 100644 --- a/openstack/usr/share/openstack/openstack-cinder-configure-backends +++ b/openstack/usr/share/openstack/openstack-cinder-configure-backends @@ -19,7 +19,7 @@ set -xe # Reconfigure LVM to scan only the devices that contain the # cinder-volume volume group -sed -i 's|# filter = \[ \"a\/\.\*\/\" \]|filter = \[ \"a\/sdb\/\", \"r\/\.\*\/\" \]|' \ +sed -i 's|# filter = \[ \"a\/\.\*\/\" \]|filter = \[ \"a\/sdb1\/\", \"r\/\.\*\/\" \]|' \ /etc/lvm/lvm.conf # Create the cinder LVM type and set a volume backend name diff --git a/openstack/usr/share/openstack/openstack-cinder-setup b/openstack/usr/share/openstack/openstack-cinder-setup index 0c871fbe..2c133942 100644 --- a/openstack/usr/share/openstack/openstack-cinder-setup +++ b/openstack/usr/share/openstack/openstack-cinder-setup @@ -101,11 +101,18 @@ else device=/dev/$(ls /sys/block | grep -v sda | grep [vs]d) fi +# Wipe the disk +wipefs -fa $device + +# Partition disk +echo -e "n\np\n1\n\n\nw\n" | fdisk $device +partition="$device"1 + # Create a physical volume -pvcreate -ff -y $device +pvcreate -ff -y $partition # Create a volume group named "cinder-volumes" -vgcreate -y cinder-volumes $device +vgcreate -y cinder-volumes $partition # Remove the one-shot setup service rm /etc/systemd/system/multi-user.target.wants/openstack-cinder-setup.service -- cgit v1.2.1