diff options
Diffstat (limited to 'meta-openstack/recipes-devtools/python/python-cinder/lvm_iscsi_setup.sh')
| -rw-r--r-- | meta-openstack/recipes-devtools/python/python-cinder/lvm_iscsi_setup.sh | 13 |
1 files changed, 13 insertions, 0 deletions
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 | ||
