kolla-ansible/docker/common/cinder-app/cinder-volume/volume-group-create.sh
Ryan Hallisey ae043642f9 The CINDER_LVM_LO_VOLUME_SIZE var had a typo
The truncate command is failing because the CINDER_LVM_LO_VOLUME_SIZE
has a typo.

Change-Id: If5f965fab2edbb8794cf6280e350c12a863b6464
Closes-bug: #1469229
2015-06-26 14:48:12 -04:00

23 lines
634 B
Bash
Executable File

#!/bin/bash
# The script will create the cinder-volume volume group that will
# allow cinder to create volumes from a backing file.
# This is based off devstack.
set -e
backing_file=/opt/data/cinder_volume
check_required_vars CINDER_LVM_LO_VOLUME_SIZE CINDER_VOLUME_GROUP
if ! vgs ${CINDER_VOLUME_GROUP}; then
[[ ! -f $backing_file ]] && truncate -s ${CINDER_LVM_LO_VOLUME_SIZE} $backing_file
vg_dev=`losetup -f --show $backing_file`
if ! vgs ${CINDER_VOLUME_GROUP}; then
vgcreate ${CINDER_VOLUME_GROUP} $vg_dev
fi
fi
# Remove iscsi targets
cinder-rtstool get-targets | xargs -rn 1 cinder-rtstool delete