diff options
Diffstat (limited to 'meta-openstack')
3 files changed, 18 insertions, 10 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 | |||
| 5 | DEV=`losetup -j /etc/cinder/volumes-backing | cut -d ":" -f 1 | head -1` | ||
| 6 | if [ -z $DEV ]; then | ||
| 7 | DEV=`losetup -f --show /etc/cinder/volumes-backing` | ||
| 8 | fi | ||
| 9 | if ! vgs cinder-volumes &> /dev/null ; then | ||
| 10 | vgcreate cinder-volumes $DEV | ||
| 11 | fi | ||
| 12 | |||
| 13 | vgchange -ay cinder-volumes | ||
diff --git a/meta-openstack/recipes-devtools/python/python-cinder_git.bb b/meta-openstack/recipes-devtools/python/python-cinder_git.bb index c2479f7..e03b54f 100644 --- a/meta-openstack/recipes-devtools/python/python-cinder_git.bb +++ b/meta-openstack/recipes-devtools/python/python-cinder_git.bb | |||
| @@ -14,6 +14,7 @@ SRC_URI = "git://github.com/openstack/${SRCNAME}.git;branch=stable/havana \ | |||
| 14 | file://0001-run_tests-respect-tools-dir.patch \ | 14 | file://0001-run_tests-respect-tools-dir.patch \ |
| 15 | file://nfs_setup.sh \ | 15 | file://nfs_setup.sh \ |
| 16 | file://glusterfs_setup.sh \ | 16 | file://glusterfs_setup.sh \ |
| 17 | file://lvm_iscsi_setup.sh \ | ||
| 17 | " | 18 | " |
| 18 | 19 | ||
| 19 | SRCREV="8b5fb8409322f61d8b610c97c109a61bf48a940e" | 20 | SRCREV="8b5fb8409322f61d8b610c97c109a61bf48a940e" |
| @@ -43,6 +44,7 @@ do_install_append() { | |||
| 43 | install -d ${CINDER_CONF_DIR}/drivers | 44 | install -d ${CINDER_CONF_DIR}/drivers |
| 44 | install -m 600 ${WORKDIR}/nfs_setup.sh ${CINDER_CONF_DIR}/drivers/ | 45 | install -m 600 ${WORKDIR}/nfs_setup.sh ${CINDER_CONF_DIR}/drivers/ |
| 45 | install -m 600 ${WORKDIR}/glusterfs_setup.sh ${CINDER_CONF_DIR}/drivers/ | 46 | install -m 600 ${WORKDIR}/glusterfs_setup.sh ${CINDER_CONF_DIR}/drivers/ |
| 47 | install -m 600 ${WORKDIR}/lvm_iscsi_setup.sh ${CINDER_CONF_DIR}/drivers/ | ||
| 46 | 48 | ||
| 47 | install -d ${D}${localstatedir}/log/${SRCNAME} | 49 | install -d ${D}${localstatedir}/log/${SRCNAME} |
| 48 | 50 | ||
| @@ -81,7 +83,7 @@ pkg_postinst_${SRCNAME}-setup () { | |||
| 81 | cinder-manage db sync | 83 | cinder-manage db sync |
| 82 | 84 | ||
| 83 | #Create cinder volume group backing file | 85 | #Create cinder volume group backing file |
| 84 | [[ -f /etc/cinder/volumes-backing ]] || truncate -s ${CINDER_LVM_VOLUME_BACKING_FILE_SIZE} /etc/cinder/volumes-backing | 86 | sed 's/%CINDER_LVM_VOLUME_BACKING_FILE_SIZE%/${CINDER_LVM_VOLUME_BACKING_FILE_SIZE}/g' -i /etc/cinder/drivers/lvm_iscsi_setup.sh |
| 85 | echo "include /etc/cinder/data/volumes/*" >> /etc/tgt/targets.conf | 87 | echo "include /etc/cinder/data/volumes/*" >> /etc/tgt/targets.conf |
| 86 | 88 | ||
| 87 | # Create Cinder nfs_share config file with default nfs server | 89 | # Create Cinder nfs_share config file with default nfs server |
