initial support for volumes

This commit is contained in:
Anthony Young 2011-10-20 10:12:58 -07:00
parent 148b13ac88
commit acff87a202
2 changed files with 29 additions and 2 deletions

View File

@ -127,7 +127,7 @@ OPENSTACKX_DIR=$DEST/openstackx
NOVNC_DIR=$DEST/noVNC NOVNC_DIR=$DEST/noVNC
# Specify which services to launch. These generally correspond to screen tabs # Specify which services to launch. These generally correspond to screen tabs
ENABLED_SERVICES=${ENABLED_SERVICES:-g-api,g-reg,key,n-api,n-cpu,n-net,n-sch,n-vnc,dash,mysql,rabbit} ENABLED_SERVICES=${ENABLED_SERVICES:-g-api,g-reg,key,n-api,n-cpu,n-net,n-sch,n-vnc,dash,mysql,rabbit,n-vol}
# Nova hypervisor configuration. We default to **kvm** but will drop back to # Nova hypervisor configuration. We default to **kvm** but will drop back to
# **qemu** if we are unable to load the kvm module. Stack.sh can also install # **qemu** if we are unable to load the kvm module. Stack.sh can also install
@ -534,6 +534,31 @@ if [[ "$ENABLED_SERVICES" =~ "n-net" ]]; then
mkdir -p $NOVA_DIR/networks mkdir -p $NOVA_DIR/networks
fi fi
# Volume Service
# --------------
if [[ "$ENABLED_SERVICES" =~ "n-vol" ]]; then
#
# Configure a default volume group called 'nova-volumes' for the nova-volume
# service if it does not yet exist. If you don't wish to use a file backed
# volume group, create your own volume group called 'nova-volumes' before
# invoking stack.sh.
#
# By default, the backing file is 2G in size, and is stored in /opt/stack.
#
VOLUME_BACKING_FILE=${VOLUME_BACKING_FILE:-/opt/stack/nova-volumes-backing-file}
VOLUME_BACKING_FILE_SIZE=${VOLUME_BACKING_FILE_SIZE:-2052M}
if ! sudo vgdisplay | grep -q nova-volumes; then
truncate -s $VOLUME_BACKING_FILE_SIZE $VOLUME_BACKING_FILE
DEV=`sudo losetup -f --show $VOLUME_BACKING_FILE`
sudo vgcreate nova-volumes $DEV
fi
# Configure iscsitarget
sudo sed 's/ISCSITARGET_ENABLE=false/ISCSITARGET_ENABLE=true/' -i /etc/default/iscsitarget
sudo /etc/init.d/iscsitarget restart
fi
function add_nova_flag { function add_nova_flag {
echo "$1" >> $NOVA_DIR/bin/nova.conf echo "$1" >> $NOVA_DIR/bin/nova.conf
} }
@ -671,6 +696,7 @@ fi
# within the context of our original shell (so our groups won't be updated). # within the context of our original shell (so our groups won't be updated).
# Use 'sg' to execute nova-compute as a member of the libvirtd group. # Use 'sg' to execute nova-compute as a member of the libvirtd group.
screen_it n-cpu "cd $NOVA_DIR && sg libvirtd $NOVA_DIR/bin/nova-compute" screen_it n-cpu "cd $NOVA_DIR && sg libvirtd $NOVA_DIR/bin/nova-compute"
screen_it n-vol "cd $NOVA_DIR && $NOVA_DIR/bin/nova-volume"
screen_it n-net "cd $NOVA_DIR && $NOVA_DIR/bin/nova-network" screen_it n-net "cd $NOVA_DIR && $NOVA_DIR/bin/nova-network"
screen_it n-sch "cd $NOVA_DIR && $NOVA_DIR/bin/nova-scheduler" screen_it n-sch "cd $NOVA_DIR && $NOVA_DIR/bin/nova-scheduler"
screen_it n-vnc "cd $NOVNC_DIR && ./utils/nova-wsproxy.py 6080 --web . --flagfile=../nova/bin/nova.conf" screen_it n-vnc "cd $NOVNC_DIR && ./utils/nova-wsproxy.py 6080 --web . --flagfile=../nova/bin/nova.conf"

View File

@ -38,7 +38,8 @@ DEST=${DEST:-/opt/stack}
WAIT_TILL_LAUNCH=${WAIT_TILL_LAUNCH:-1} WAIT_TILL_LAUNCH=${WAIT_TILL_LAUNCH:-1}
# Param string to pass to stack.sh. Like "EC2_DMZ_HOST=192.168.1.1 MYSQL_USER=nova" # Param string to pass to stack.sh. Like "EC2_DMZ_HOST=192.168.1.1 MYSQL_USER=nova"
STACKSH_PARAMS=${STACKSH_PARAMS:-} # By default, n-vol is disabled for lxc
STACKSH_PARAMS=${STACKSH_PARAMS:-"ENABLED_SERVICES=g-api,g-reg,key,n-api,n-cpu,n-net,n-sch,n-vnc,dash,mysql,rabbit"}
# Option to use the version of devstack on which we are currently working # Option to use the version of devstack on which we are currently working
USE_CURRENT_DEVSTACK=${USE_CURRENT_DEVSTACK:-1} USE_CURRENT_DEVSTACK=${USE_CURRENT_DEVSTACK:-1}