From a13a25b4025384bb6a9f981206a24a4e999187f3 Mon Sep 17 00:00:00 2001 From: David Moreau Simard Date: Sat, 21 Nov 2015 18:53:33 -0500 Subject: [PATCH] Dynamically find the extra partitioned block device This provides support for using loopback devices for the extra disk. Change-Id: Ia61b32e27ba619d15860daa6a9ed75291dad1d06 Closes-bug: #1518641 --- tests/setup_centos.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/setup_centos.sh b/tests/setup_centos.sh index 0f5c1c6a10..5800cce3cf 100755 --- a/tests/setup_centos.sh +++ b/tests/setup_centos.sh @@ -19,8 +19,10 @@ sudo yum install -y libffi-devel openssl-devel docker-engine-1.8.2 xfsprogs # driver are used for Docker. It is recommend to use the thin provisioning # driver. https://github.com/docker/docker/blob/master/man/docker.1.md sudo parted /dev/${DEV} -s -- mklabel msdos mkpart pri 1 -1 -sudo pvcreate /dev/${DEV}1 -sudo vgcreate kolla01 /dev/${DEV}1 +# Figure out the path to the partitioned device +PARTDEV=$(ls "/dev/${DEV}"* | egrep "/dev/${DEV}p?1") +sudo pvcreate ${PARTDEV} +sudo vgcreate kolla01 ${PARTDEV} sudo lvcreate -n thin01 -L 60G kolla01 sudo lvcreate -n thin01meta -L 2G kolla01 yes | sudo lvconvert --type thin-pool --poolmetadata kolla01/thin01meta kolla01/thin01