Make volumes work again with oneiric

Change-Id: I70ba7f8b1d5493e795262e433f8c5783e08482bc
This commit is contained in:
Vishvananda Ishaya 2012-01-14 01:08:34 +00:00
parent f5fb057a8d
commit 524aa547e7
2 changed files with 9 additions and 6 deletions

View File

@ -1,3 +1,2 @@
iscsitarget # NOPRIME tgt
iscsitarget-dkms # NOPRIME
lvm2 lvm2

View File

@ -1053,7 +1053,8 @@ if [[ "$ENABLED_SERVICES" =~ "n-vol" ]]; then
# #
# By default, the backing file is 2G in size, and is stored in /opt/stack. # By default, the backing file is 2G in size, and is stored in /opt/stack.
apt_get install iscsitarget-dkms iscsitarget # install the package
apt_get install tgt
if ! sudo vgs $VOLUME_GROUP; then if ! sudo vgs $VOLUME_GROUP; then
VOLUME_BACKING_FILE=${VOLUME_BACKING_FILE:-$DEST/nova-volumes-backing-file} VOLUME_BACKING_FILE=${VOLUME_BACKING_FILE:-$DEST/nova-volumes-backing-file}
@ -1080,9 +1081,10 @@ if [[ "$ENABLED_SERVICES" =~ "n-vol" ]]; then
done done
fi fi
# Configure iscsitarget # tgt in oneiric doesn't restart properly if tgtd isn't running
sudo sed 's/ISCSITARGET_ENABLE=false/ISCSITARGET_ENABLE=true/' -i /etc/default/iscsitarget # do it in two steps
sudo /etc/init.d/iscsitarget restart sudo stop tgt || true
sudo start tgt
fi fi
function add_nova_flag { function add_nova_flag {
@ -1112,6 +1114,8 @@ fi
if [[ "$ENABLED_SERVICES" =~ "n-vol" ]]; then if [[ "$ENABLED_SERVICES" =~ "n-vol" ]]; then
add_nova_flag "--volume_group=$VOLUME_GROUP" add_nova_flag "--volume_group=$VOLUME_GROUP"
add_nova_flag "--volume_name_template=${VOLUME_NAME_PREFIX}%08x" add_nova_flag "--volume_name_template=${VOLUME_NAME_PREFIX}%08x"
# oneiric no longer supports ietadm
add_nova_flag "--iscsi_helper=tgtadm"
fi fi
add_nova_flag "--my_ip=$HOST_IP" add_nova_flag "--my_ip=$HOST_IP"
add_nova_flag "--public_interface=$PUBLIC_INTERFACE" add_nova_flag "--public_interface=$PUBLIC_INTERFACE"