diff --git a/stack.sh b/stack.sh index 61c0f57144..79cc3778e7 100755 --- a/stack.sh +++ b/stack.sh @@ -127,7 +127,7 @@ OPENSTACKX_DIR=$DEST/openstackx NOVNC_DIR=$DEST/noVNC # 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 # **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 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 { 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). # 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-vol "cd $NOVA_DIR && $NOVA_DIR/bin/nova-volume" 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-vnc "cd $NOVNC_DIR && ./utils/nova-wsproxy.py 6080 --web . --flagfile=../nova/bin/nova.conf" diff --git a/tools/build_lxc.sh b/tools/build_lxc.sh index df9e32e988..8525b4951b 100755 --- a/tools/build_lxc.sh +++ b/tools/build_lxc.sh @@ -38,7 +38,8 @@ DEST=${DEST:-/opt/stack} 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" -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 USE_CURRENT_DEVSTACK=${USE_CURRENT_DEVSTACK:-1}