summaryrefslogtreecommitdiffstats
path: root/meta-openstack/recipes-devtools/python/python-cinder
diff options
context:
space:
mode:
authorVu Tran <vu.tran@windriver.com>2014-02-28 09:11:14 -0500
committerBruce Ashfield <bruce.ashfield@windriver.com>2014-03-17 14:24:31 -0400
commit1e2599e4801c1acd16ea61a533d95bbd7a808a54 (patch)
treeab8dcc3b2c4869fc74366661de1d346d34ff65d2 /meta-openstack/recipes-devtools/python/python-cinder
parente617d0205fc566ef70b61a75c484d78c540ef791 (diff)
downloadmeta-cloud-services-1e2599e4801c1acd16ea61a533d95bbd7a808a54.tar.gz
cinder-volume: change lvm pv to be configured at runtime
By default lvm-iscsi uses loopdev as lvm physical volume. This patch makes it a bit easier to allow other layer to be able configure lvm physical volume. Signed-off-by: Vu Tran <vu.tran@windriver.com> Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
Diffstat (limited to 'meta-openstack/recipes-devtools/python/python-cinder')
-rw-r--r--meta-openstack/recipes-devtools/python/python-cinder/cinder-volume11
-rw-r--r--meta-openstack/recipes-devtools/python/python-cinder/lvm_iscsi_setup.sh13
2 files changed, 15 insertions, 9 deletions
diff --git a/meta-openstack/recipes-devtools/python/python-cinder/cinder-volume b/meta-openstack/recipes-devtools/python/python-cinder/cinder-volume
index 51bbac9..3cc2aa3 100644
--- a/meta-openstack/recipes-devtools/python/python-cinder/cinder-volume
+++ b/meta-openstack/recipes-devtools/python/python-cinder/cinder-volume
@@ -29,15 +29,8 @@ start()
29 fi 29 fi
30 fi 30 fi
31 31
32 #Load volume group 32 #Load volume group
33 DEV=`losetup -j /etc/cinder/volumes-backing | cut -d ":" -f 1 | head -1` 33 /bin/bash /etc/cinder/drivers/lvm_iscsi_setup.sh
34 if [ -z $DEV ]; then
35 DEV=`losetup -f --show /etc/cinder/volumes-backing`
36 fi
37 if ! vgs cinder-volumes &> /dev/null ; then
38 vgcreate cinder-volumes $DEV
39 fi
40 vgchange -ay cinder-volumes
41 34
42 echo -n "Starting $DESC..." 35 echo -n "Starting $DESC..."
43 36
diff --git a/meta-openstack/recipes-devtools/python/python-cinder/lvm_iscsi_setup.sh b/meta-openstack/recipes-devtools/python/python-cinder/lvm_iscsi_setup.sh
new file mode 100644
index 0000000..6cd7011
--- /dev/null
+++ b/meta-openstack/recipes-devtools/python/python-cinder/lvm_iscsi_setup.sh
@@ -0,0 +1,13 @@
1#Load volume group
2
3[[ -f /etc/cinder/volumes-backing ]] || truncate -s %CINDER_LVM_VOLUME_BACKING_FILE_SIZE% /etc/cinder/volumes-backing
4
5DEV=`losetup -j /etc/cinder/volumes-backing | cut -d ":" -f 1 | head -1`
6if [ -z $DEV ]; then
7 DEV=`losetup -f --show /etc/cinder/volumes-backing`
8fi
9if ! vgs cinder-volumes &> /dev/null ; then
10 vgcreate cinder-volumes $DEV
11fi
12
13vgchange -ay cinder-volumes