Merge "install memcached for swift via files"
diff --git a/exercises/boot_from_volume.sh b/exercises/boot_from_volume.sh
index b06c8dd..4c2f279 100755
--- a/exercises/boot_from_volume.sh
+++ b/exercises/boot_from_volume.sh
@@ -32,12 +32,18 @@
# Import configuration
source $TOP_DIR/openrc
+# Import quantum functions if needed
+if is_service_enabled quantum; then
+ source $TOP_DIR/lib/quantum
+ setup_quantum
+fi
+
# Import exercise configuration
source $TOP_DIR/exerciserc
-# If cinder or n-vol are not enabled we exit with exitcode 55 so that
+# If cinder is not enabled we exit with exitcode 55 so that
# the exercise is skipped
-is_service_enabled cinder n-vol || exit 55
+is_service_enabled cinder || exit 55
# Boot this image, use first AMI image if unset
DEFAULT_IMAGE_NAME=${DEFAULT_IMAGE_NAME:-ami}
@@ -168,6 +174,10 @@
# Delete a secgroup
nova secgroup-delete $SECGROUP || die "Failure deleting security group $SECGROUP"
+if is_service_enabled quantum; then
+ teardown_quantum
+fi
+
set +o xtrace
echo "*********************************************************************"
echo "SUCCESS: End DevStack Exercise: $0"
diff --git a/exercises/euca.sh b/exercises/euca.sh
index b121493..c307a06 100755
--- a/exercises/euca.sh
+++ b/exercises/euca.sh
@@ -33,6 +33,12 @@
# Import EC2 configuration
source $TOP_DIR/eucarc
+# Import quantum functions if needed
+if is_service_enabled quantum; then
+ source $TOP_DIR/lib/quantum
+ setup_quantum
+fi
+
# Import exercise configuration
source $TOP_DIR/exerciserc
@@ -73,7 +79,7 @@
# Volumes
# -------
-if [[ "$ENABLED_SERVICES" =~ "n-vol" || "$ENABLED_SERVICES" =~ "c-vol" ]]; then
+if [[ "$ENABLED_SERVICES" =~ "c-vol" ]]; then
VOLUME_ZONE=`euca-describe-availability-zones | head -n1 | cut -f2`
die_if_not_set VOLUME_ZONE "Failure to find zone for volume"
@@ -169,6 +175,10 @@
# Delete group
euca-delete-group $SECGROUP || die "Failure deleting security group $SECGROUP"
+if is_service_enabled quantum; then
+ teardown_quantum
+fi
+
set +o xtrace
echo "*********************************************************************"
echo "SUCCESS: End DevStack Exercise: $0"
diff --git a/exercises/floating_ips.sh b/exercises/floating_ips.sh
index 6787878..ae5691f 100755
--- a/exercises/floating_ips.sh
+++ b/exercises/floating_ips.sh
@@ -31,6 +31,12 @@
# Import configuration
source $TOP_DIR/openrc
+# Import quantum functions if needed
+if is_service_enabled quantum; then
+ source $TOP_DIR/lib/quantum
+ setup_quantum
+fi
+
# Import exercise configuration
source $TOP_DIR/exerciserc
@@ -155,14 +161,16 @@
# test we can ping our floating ip within ASSOCIATE_TIMEOUT seconds
ping_check "$PUBLIC_NETWORK_NAME" $FLOATING_IP $ASSOCIATE_TIMEOUT
-# Allocate an IP from second floating pool
-TEST_FLOATING_IP=`nova floating-ip-create $TEST_FLOATING_POOL | grep $TEST_FLOATING_POOL | get_field 1`
-die_if_not_set TEST_FLOATING_IP "Failure creating floating IP in $TEST_FLOATING_POOL"
+if ! is_service_enabled quantum; then
+ # Allocate an IP from second floating pool
+ TEST_FLOATING_IP=`nova floating-ip-create $TEST_FLOATING_POOL | grep $TEST_FLOATING_POOL | get_field 1`
+ die_if_not_set TEST_FLOATING_IP "Failure creating floating IP in $TEST_FLOATING_POOL"
-# list floating addresses
-if ! timeout $ASSOCIATE_TIMEOUT sh -c "while ! nova floating-ip-list | grep $TEST_FLOATING_POOL | grep -q $TEST_FLOATING_IP; do sleep 1; done"; then
- echo "Floating IP not allocated"
- exit 1
+ # list floating addresses
+ if ! timeout $ASSOCIATE_TIMEOUT sh -c "while ! nova floating-ip-list | grep $TEST_FLOATING_POOL | grep -q $TEST_FLOATING_IP; do sleep 1; done"; then
+ echo "Floating IP not allocated"
+ exit 1
+ fi
fi
# dis-allow icmp traffic (ping)
@@ -171,12 +179,13 @@
# FIXME (anthony): make xs support security groups
if [ "$VIRT_DRIVER" != "xenserver" -a "$VIRT_DRIVER" != "openvz" ]; then
# test we can aren't able to ping our floating ip within ASSOCIATE_TIMEOUT seconds
- ping_check "$PUBLIC_NETWORK_NAME" $FLOATING_IP $ASSOCIATE_TIMEOUT
+ ping_check "$PUBLIC_NETWORK_NAME" $FLOATING_IP $ASSOCIATE_TIMEOUT Fail
fi
-# Delete second floating IP
-nova floating-ip-delete $TEST_FLOATING_IP || die "Failure deleting floating IP $TEST_FLOATING_IP"
-
+if ! is_service_enabled quantum; then
+ # Delete second floating IP
+ nova floating-ip-delete $TEST_FLOATING_IP || die "Failure deleting floating IP $TEST_FLOATING_IP"
+fi
# de-allocate the floating ip
nova floating-ip-delete $FLOATING_IP || die "Failure deleting floating IP $FLOATING_IP"
@@ -193,6 +202,10 @@
# Delete a secgroup
nova secgroup-delete $SECGROUP || die "Failure deleting security group $SECGROUP"
+if is_service_enabled quantum; then
+ teardown_quantum
+fi
+
set +o xtrace
echo "*********************************************************************"
echo "SUCCESS: End DevStack Exercise: $0"
diff --git a/exercises/quantum-adv-test.sh b/exercises/quantum-adv-test.sh
index 8f15b63..2ee82ff 100755
--- a/exercises/quantum-adv-test.sh
+++ b/exercises/quantum-adv-test.sh
@@ -52,13 +52,17 @@
# Import configuration
source $TOP_DIR/openrc
-# Import exercise configuration
-source $TOP_DIR/exerciserc
-
# If quantum is not enabled we exit with exitcode 55 which mean
# exercise is skipped.
is_service_enabled quantum && is_service_enabled q-agt && is_service_enabled q-dhcp || exit 55
+# Import quantum fucntions
+source $TOP_DIR/lib/quantum
+setup_quantum
+
+# Import exercise configuration
+source $TOP_DIR/exerciserc
+
#------------------------------------------------------------------------------
# Test settings for quantum
#------------------------------------------------------------------------------
@@ -76,14 +80,14 @@
DEMO2_NUM_NET=2
PUBLIC_NET1_CIDR="200.0.0.0/24"
-DEMO1_NET1_CIDR="10.1.0.0/24"
-DEMO2_NET1_CIDR="10.2.0.0/24"
-DEMO2_NET2_CIDR="10.2.1.0/24"
+DEMO1_NET1_CIDR="10.10.0.0/24"
+DEMO2_NET1_CIDR="10.20.0.0/24"
+DEMO2_NET2_CIDR="10.20.1.0/24"
PUBLIC_NET1_GATEWAY="200.0.0.1"
-DEMO1_NET1_GATEWAY="10.1.0.1"
-DEMO2_NET1_GATEWAY="10.2.0.1"
-DEMO2_NET2_GATEWAY="10.2.1.1"
+DEMO1_NET1_GATEWAY="10.10.0.1"
+DEMO2_NET1_GATEWAY="10.20.0.1"
+DEMO2_NET2_GATEWAY="10.20.1.1"
PUBLIC_NUM_VM=1
DEMO1_NUM_VM=1
@@ -188,7 +192,7 @@
function confirm_server_active {
local VM_UUID=$1
- if ! timeout $ACTIVE_TIMEOUT sh -c "while ! nova --no_cache show $VM_UUID | grep status | grep -q ACTIVE; do sleep 1; done"; then
+ if ! timeout $ACTIVE_TIMEOUT sh -c "while ! nova show $VM_UUID | grep status | grep -q ACTIVE; do sleep 1; done"; then
echo "server '$VM_UUID' did not become active!"
false
fi
@@ -232,6 +236,7 @@
source $TOP_DIR/openrc admin admin
add_tenant demo1 demo1 demo1
add_tenant demo2 demo2 demo2
+ source $TOP_DIR/openrc demo demo
}
function delete_tenants_and_users {
@@ -241,6 +246,7 @@
remove_user demo2
remove_tenant demo2
echo "removed all tenants"
+ source $TOP_DIR/openrc demo demo
}
function create_network {
@@ -256,12 +262,8 @@
source $TOP_DIR/openrc $TENANT $TENANT
local NET_ID=$(quantum net-create --tenant_id $TENANT_ID $NET_NAME $EXTRA| grep ' id ' | awk '{print $4}' )
quantum subnet-create --ip_version 4 --tenant_id $TENANT_ID --gateway $GATEWAY $NET_ID $CIDR
- #T0DO(nati) comment out until l3-agent is merged
- #local ROUTER_ID=$($QUANTUM router-create --tenant_id $TENANT_ID $ROUTER_NAME| grep ' id ' | awk '{print $4}' )
- #for NET_NAME in ${NET_NAMES//,/ };do
- # SUBNET_ID=`get_subnet_id $NET_NAME`
- # $QUANTUM router-interface-create $NAME --subnet_id $SUBNET_ID
- #done
+ quantum-debug probe-create $NET_ID
+ source $TOP_DIR/openrc demo demo
}
function create_networks {
@@ -285,7 +287,7 @@
done
#TODO (nati) Add multi-nic test
#TODO (nati) Add public-net test
- local VM_UUID=`nova --no_cache boot --flavor $(get_flavor_id m1.tiny) \
+ local VM_UUID=`nova boot --flavor $(get_flavor_id m1.tiny) \
--image $(get_image_id) \
$NIC \
$TENANT-server$NUM | grep ' id ' | cut -d"|" -f3 | sed 's/ //g'`
@@ -301,32 +303,26 @@
# Test agent connection. Assumes namespaces are disabled, and
# that DHCP is in use, but not L3
local VM_NAME=$1
- IP=`nova --no_cache show $VM_NAME | grep 'network' | awk '{print $5}'`
- if ! timeout $BOOT_TIMEOUT sh -c "while ! ping -c1 -w1 $IP; do sleep 1; done"; then
- echo "Could not ping $VM_NAME"
- false
- fi
+ local NET_NAME=$2
+ IP=`nova show $VM_NAME | grep 'network' | awk '{print $5}'`
+ ping_check $NET_NAME $IP $BOOT_TIMEOUT
}
function check_vm {
local TENANT=$1
local NUM=$2
local VM_NAME="$TENANT-server$NUM"
+ local NET_NAME=$3
source $TOP_DIR/openrc $TENANT $TENANT
- ping_ip $VM_NAME
+ ping_ip $VM_NAME $NET_NAME
# TODO (nati) test ssh connection
# TODO (nati) test inter connection between vm
- # TODO (nati) test namespace dhcp
# TODO (nati) test dhcp host routes
# TODO (nati) test multi-nic
- # TODO (nati) use test-agent
- # TODO (nati) test L3 forwarding
- # TODO (nati) test floating ip
- # TODO (nati) test security group
}
function check_vms {
- foreach_tenant_vm 'check_vm ${%TENANT%_NAME} %NUM%'
+ foreach_tenant_vm 'check_vm ${%TENANT%_NAME} %NUM% ${%TENANT%_VM%NUM%_NET}'
}
function shutdown_vm {
@@ -334,12 +330,12 @@
local NUM=$2
source $TOP_DIR/openrc $TENANT $TENANT
VM_NAME=${TENANT}-server$NUM
- nova --no_cache delete $VM_NAME
+ nova delete $VM_NAME
}
function shutdown_vms {
foreach_tenant_vm 'shutdown_vm ${%TENANT%_NAME} %NUM%'
- if ! timeout $TERMINATE_TIMEOUT sh -c "while nova --no_cache list | grep -q ACTIVE; do sleep 1; done"; then
+ if ! timeout $TERMINATE_TIMEOUT sh -c "while nova list | grep -q ACTIVE; do sleep 1; done"; then
echo "Some VMs failed to shutdown"
false
fi
@@ -347,17 +343,22 @@
function delete_network {
local TENANT=$1
+ local NUM=$2
+ local NET_NAME="${TENANT}-net$NUM"
source $TOP_DIR/openrc admin admin
local TENANT_ID=$(get_tenant_id $TENANT)
#TODO(nati) comment out until l3-agent merged
#for res in port subnet net router;do
- for res in port subnet net;do
- quantum ${res}-list -F id -F tenant_id | grep $TENANT_ID | awk '{print $2}' | xargs -I % quantum ${res}-delete %
+ for net_id in `quantum net-list -c id -c name | grep $NET_NAME | awk '{print $2}'`;do
+ delete_probe $net_id
+ quantum subnet-list | grep $net_id | awk '{print $2}' | xargs -I% quantum subnet-delete %
+ quantum net-delete $net_id
done
+ source $TOP_DIR/openrc demo demo
}
function delete_networks {
- foreach_tenant 'delete_network ${%TENANT%_NAME}'
+ foreach_tenant_net 'delete_network ${%TENANT%_NAME} ${%NUM%}'
#TODO(nati) add secuirty group check after it is implemented
# source $TOP_DIR/openrc demo1 demo1
# nova secgroup-delete-rule default icmp -1 -1 0.0.0.0/0
@@ -474,6 +475,7 @@
}
+teardown_quantum
#-------------------------------------------------------------------------------
# Kick off script.
#-------------------------------------------------------------------------------
diff --git a/exercises/volumes.sh b/exercises/volumes.sh
index 72c8729..3432763 100755
--- a/exercises/volumes.sh
+++ b/exercises/volumes.sh
@@ -9,7 +9,7 @@
echo "*********************************************************************"
# This script exits on an error so that errors don't compound and you see
-# only the first error that occured.
+# only the first error that occurred.
set -o errexit
# Print the commands being run so that we can see the command that triggers
@@ -30,12 +30,18 @@
# Import configuration
source $TOP_DIR/openrc
+# Import quantum functions if needed
+if is_service_enabled quantum; then
+ source $TOP_DIR/lib/quantum
+ setup_quantum
+fi
+
# Import exercise configuration
source $TOP_DIR/exerciserc
-# If cinder or n-vol are not enabled we exit with exitcode 55 which mean
+# If cinder is not enabled we exit with exitcode 55 which mean
# exercise is skipped.
-is_service_enabled cinder n-vol || exit 55
+is_service_enabled cinder || exit 55
# Instance type to create
DEFAULT_INSTANCE_TYPE=${DEFAULT_INSTANCE_TYPE:-m1.tiny}
@@ -206,6 +212,10 @@
# Delete a secgroup
nova secgroup-delete $SECGROUP || die "Failure deleting security group $SECGROUP"
+if is_service_enabled quantum; then
+ teardown_quantum
+fi
+
set +o xtrace
echo "*********************************************************************"
echo "SUCCESS: End DevStack Exercise: $0"
diff --git a/files/keystone_data.sh b/files/keystone_data.sh
index 3da11bf..71994a8 100755
--- a/files/keystone_data.sh
+++ b/files/keystone_data.sh
@@ -140,22 +140,6 @@
--role_id $RESELLER_ROLE
fi
-# Volume
-if [[ "$ENABLED_SERVICES" =~ "n-vol" ]]; then
- if [[ "$KEYSTONE_CATALOG_BACKEND" = 'sql' ]]; then
- VOLUME_SERVICE=$(get_id keystone service-create \
- --name=volume \
- --type=volume \
- --description="Volume Service")
- keystone endpoint-create \
- --region RegionOne \
- --service_id $VOLUME_SERVICE \
- --publicurl "http://$SERVICE_HOST:8776/v1/\$(tenant_id)s" \
- --adminurl "http://$SERVICE_HOST:8776/v1/\$(tenant_id)s" \
- --internalurl "http://$SERVICE_HOST:8776/v1/\$(tenant_id)s"
- fi
-fi
-
# Heat
if [[ "$ENABLED_SERVICES" =~ "heat" ]]; then
HEAT_USER=$(get_id keystone user-create --name=heat \
diff --git a/functions b/functions
index c7f65db..92c8a5f 100644
--- a/functions
+++ b/functions
@@ -462,7 +462,7 @@
# ``ENABLED_SERVICES`` list, if they are not already present.
#
# For example:
-# enable_service n-vol
+# enable_service qpid
#
# This function does not know about the special cases
# for nova, glance, and quantum built into is_service_enabled().
@@ -484,7 +484,7 @@
# ``ENABLED_SERVICES`` list, if they are present.
#
# For example:
-# disable_service n-vol
+# disable_service rabbit
#
# This function does not know about the special cases
# for nova, glance, and quantum built into is_service_enabled().
@@ -513,8 +513,8 @@
# Remove all services starting with '-'. For example, to install all default
-# services except nova-volume (n-vol) set in ``localrc``:
-# ENABLED_SERVICES+=",-n-vol"
+# services except rabbit (rabbit) set in ``localrc``:
+# ENABLED_SERVICES+=",-rabbit"
# Uses global ``ENABLED_SERVICES``
# disable_negated_services
function disable_negated_services() {
@@ -872,7 +872,11 @@
# ping check
# Uses globals ``ENABLED_SERVICES``
function ping_check() {
- _ping_check_novanet "$1" $2 $3
+ if is_service_enabled quantum; then
+ _ping_check_quantum "$1" $2 $3 $4
+ return
+ fi
+ _ping_check_novanet "$1" $2 $3 $4
}
# ping check for nova
@@ -881,19 +885,39 @@
local from_net=$1
local ip=$2
local boot_timeout=$3
+ local expected=${4:-"True"}
+ local check_command=""
MULTI_HOST=`trueorfalse False $MULTI_HOST`
if [[ "$MULTI_HOST" = "True" && "$from_net" = "$PRIVATE_NETWORK_NAME" ]]; then
sleep $boot_timeout
return
fi
- if ! timeout $boot_timeout sh -c "while ! ping -c1 -w1 $ip; do sleep 1; done"; then
- echo "Couldn't ping server"
+ if [[ "$expected" = "True" ]]; then
+ check_command="while ! ping -c1 -w1 $ip; do sleep 1; done"
+ else
+ check_command="while ping -c1 -w1 $ip; do sleep 1; done"
+ fi
+ if ! timeout $boot_timeout sh -c "$check_command"; then
+ if [[ "$expected" = "True" ]]; then
+ echo "[Fail] Couldn't ping server"
+ else
+ echo "[Fail] Could ping server"
+ fi
exit 1
fi
}
# ssh check
+
function ssh_check() {
+ if is_service_enabled quantum; then
+ _ssh_check_quantum "$1" $2 $3 $4 $5
+ return
+ fi
+ _ssh_check_novanet "$1" $2 $3 $4 $5
+}
+
+function _ssh_check_novanet() {
local NET_NAME=$1
local KEY_FILE=$2
local FLOATING_IP=$3
diff --git a/lib/ceilometer b/lib/ceilometer
index 2b014b0..aa1b396 100644
--- a/lib/ceilometer
+++ b/lib/ceilometer
@@ -66,6 +66,13 @@
cp $CEILOMETER_DIR/etc/ceilometer/policy.json $CEILOMETER_CONF_DIR
iniset $CEILOMETER_CONF DEFAULT policy_file $CEILOMETER_CONF_DIR/policy.json
+ # the compute and central agents need these credentials in order to
+ # call out to the public nova and glance APIs
+ iniset $CEILOMETER_CONF DEFAULT os_username ceilometer
+ iniset $CEILOMETER_CONF DEFAULT os_password $SERVICE_PASSWORD
+ iniset $CEILOMETER_CONF DEFAULT os_tenant_name $SERVICE_TENANT_NAME
+ iniset $CEILOMETER_CONF DEFAULT os_auth_url $OS_AUTH_URL
+
iniset $CEILOMETER_CONF keystone_authtoken auth_protocol http
iniset $CEILOMETER_CONF keystone_authtoken admin_user ceilometer
iniset $CEILOMETER_CONF keystone_authtoken admin_password $SERVICE_PASSWORD
@@ -82,7 +89,7 @@
# start_ceilometer() - Start running processes, including screen
function start_ceilometer() {
screen_it ceilometer-acompute "cd $CEILOMETER_DIR && sg libvirtd \"$CEILOMETER_BIN_DIR/ceilometer-agent-compute --config-file $CEILOMETER_CONF\""
- screen_it ceilometer-acentral "export OS_USERNAME=ceilometer OS_PASSWORD=$SERVICE_PASSWORD OS_TENANT_NAME=$SERVICE_TENANT_NAME OS_AUTH_URL=$OS_AUTH_URL && cd $CEILOMETER_DIR && $CEILOMETER_BIN_DIR/ceilometer-agent-central --config-file $CEILOMETER_CONF"
+ screen_it ceilometer-acentral "cd $CEILOMETER_DIR && $CEILOMETER_BIN_DIR/ceilometer-agent-central --config-file $CEILOMETER_CONF"
screen_it ceilometer-collector "cd $CEILOMETER_DIR && $CEILOMETER_BIN_DIR/ceilometer-collector --config-file $CEILOMETER_CONF"
screen_it ceilometer-api "cd $CEILOMETER_DIR && $CEILOMETER_BIN_DIR/ceilometer-api -d -v --log-dir=$CEILOMETER_API_LOG_DIR --config-file $CEILOMETER_CONF"
}
diff --git a/lib/heat b/lib/heat
index d1f1c7c..efdcfad 100644
--- a/lib/heat
+++ b/lib/heat
@@ -23,7 +23,7 @@
# Defaults
# --------
HEAT_DIR=$DEST/heat
-
+HEATCLIENT_DIR=$DEST/python-heatclient
# set up default directories
# cleanup_heat() - Remove residual data files, anything left over from previous
@@ -33,6 +33,11 @@
:
}
+# configure_heatclient() - Set config files, create data dirs, etc
+function configure_heatclient() {
+ setup_develop $HEATCLIENT_DIR
+}
+
# configure_heat() - Set config files, create data dirs, etc
function configure_heat() {
setup_develop $HEAT_DIR
@@ -193,6 +198,11 @@
$HEAT_DIR/tools/nova_create_flavors.sh
}
+# install_heatclient() - Collect source and prepare
+function install_heatclient() {
+ git_clone $HEATCLIENT_REPO $HEATCLIENT_DIR $HEATCLIENT_BRANCH
+}
+
# install_heat() - Collect source and prepare
function install_heat() {
git_clone $HEAT_REPO $HEAT_DIR $HEAT_BRANCH
diff --git a/lib/n-vol b/lib/n-vol
deleted file mode 100644
index db53582..0000000
--- a/lib/n-vol
+++ /dev/null
@@ -1,126 +0,0 @@
-# lib/n-vol
-# Install and start Nova volume service
-
-# Dependencies:
-# - functions
-# - DATA_DIR must be defined
-# - KEYSTONE_AUTH_* must be defined
-# - NOVA_DIR, NOVA_BIN_DIR, NOVA_STATE_PATH must be defined
-# SERVICE_{TENANT_NAME|PASSWORD} must be defined
-# _configure_tgt_for_config_d() from lib/cinder
-
-# stack.sh
-# ---------
-# install_nvol
-# configure_nvol
-# init_nvol
-# start_nvol
-# stop_nvol
-# cleanup_nvol
-
-# Save trace setting
-XTRACE=$(set +o | grep xtrace)
-set +o xtrace
-
-
-# Defaults
-# --------
-
-# Name of the LVM volume group to use/create for iscsi volumes
-VOLUME_GROUP=${VOLUME_GROUP:-stack-volumes}
-VOLUME_NAME_PREFIX=${VOLUME_NAME_PREFIX:-volume-}
-
-
-# cleanup_nvol() - Remove residual data files, anything left over from previous
-# runs that a clean run would need to clean up
-function cleanup_nvol() {
- # kill instances (nova)
- # delete image files (glance)
- # This function intentionally left blank
- :
-}
-
-# configure_nvol() - Set config files, create data dirs, etc
-function configure_nvol() {
- # sudo python setup.py deploy
- # iniset $XXX_CONF ...
- # This function intentionally left blank
- :
-}
-
-# init_nvol() - Initialize databases, etc.
-function init_nvol() {
- # Configure a default volume group called '`stack-volumes`' for the 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 ``stack-volumes`` before
- # invoking ``stack.sh``.
- #
- # By default, the backing file is 5G in size, and is stored in ``/opt/stack/data``.
-
- if ! sudo vgs $VOLUME_GROUP; then
- VOLUME_BACKING_FILE=${VOLUME_BACKING_FILE:-$DATA_DIR/${VOLUME_GROUP}-backing-file}
- # Only create if the file doesn't already exists
- [[ -f $VOLUME_BACKING_FILE ]] || truncate -s $VOLUME_BACKING_FILE_SIZE $VOLUME_BACKING_FILE
- DEV=`sudo losetup -f --show $VOLUME_BACKING_FILE`
- # Only create if the loopback device doesn't contain $VOLUME_GROUP
- if ! sudo vgs $VOLUME_GROUP; then sudo vgcreate $VOLUME_GROUP $DEV; fi
- fi
-
- mkdir -p $NOVA_STATE_PATH/volumes
-
- if sudo vgs $VOLUME_GROUP; then
- if [[ "$os_PACKAGE" = "rpm" ]]; then
- # RPM doesn't start the service
- start_service tgtd
- fi
-
- # Remove nova iscsi targets
- sudo tgtadm --op show --mode target | grep $VOLUME_NAME_PREFIX | grep Target | cut -f3 -d ' ' | sudo xargs -n1 tgt-admin --delete || true
- # Clean out existing volumes
- for lv in `sudo lvs --noheadings -o lv_name $VOLUME_GROUP`; do
- # ``VOLUME_NAME_PREFIX`` prefixes the LVs we want
- if [[ "${lv#$VOLUME_NAME_PREFIX}" != "$lv" ]]; then
- sudo lvremove -f $VOLUME_GROUP/$lv
- fi
- done
- fi
-}
-
-# install_nvol() - Collect source and prepare
-function install_nvol() {
- # git clone xxx
- # Install is handled when installing Nova
- :
-}
-
-# start_nvol() - Start running processes, including screen
-function start_nvol() {
- # Setup the tgt configuration file
- if [[ ! -f /etc/tgt/conf.d/nova.conf ]]; then
- _configure_tgt_for_config_d
- sudo mkdir -p /etc/tgt/conf.d
- echo "include $NOVA_STATE_PATH/volumes/*" | sudo tee /etc/tgt/conf.d/nova.conf
- fi
-
- if [[ "$os_PACKAGE" = "deb" ]]; then
- # tgt in oneiric doesn't restart properly if tgtd isn't running
- # do it in two steps
- sudo stop tgt || true
- sudo start tgt
- else
- restart_service tgtd
- fi
-
- screen_it n-vol "cd $NOVA_DIR && $NOVA_BIN_DIR/nova-volume"
-}
-
-# stop_nvol() - Stop running processes
-function stop_nvol() {
- # Kill the nova volume screen window
- screen -S $SCREEN_NAME -p n-vol -X kill
-
- stop_service tgt
-}
-
-# Restore xtrace
-$XTRACE
diff --git a/lib/nova b/lib/nova
index 2c1413d..fbb5a01 100644
--- a/lib/nova
+++ b/lib/nova
@@ -312,15 +312,6 @@
if is_service_enabled n-api; then
add_nova_opt "enabled_apis=$NOVA_ENABLED_APIS"
fi
- if is_service_enabled n-vol; then
- NOVA_ENABLED_APIS="${NOVA_ENABLED_APIS},osapi_volume"
- iniset $NOVA_CONF DEFAULT enabled_apis $NOVA_ENABLED_APIS
- add_nova_opt "volume_api_class=nova.volume.api.API"
- add_nova_opt "volume_group=$VOLUME_GROUP"
- add_nova_opt "volume_name_template=${VOLUME_NAME_PREFIX}%s"
- # oneiric no longer supports ietadm
- add_nova_opt "iscsi_helper=tgtadm"
- fi
if is_service_enabled cinder; then
add_nova_opt "volume_api_class=nova.volume.cinder.API"
fi
diff --git a/lib/quantum b/lib/quantum
index f9e1782..ba98b64 100644
--- a/lib/quantum
+++ b/lib/quantum
@@ -5,6 +5,8 @@
XTRACE=$(set +o | grep xtrace)
set +o xtrace
+export QUANTUM_TEST_CONFIG_FILE=${QUANTUM_TEST_CONFIG_FILE:-"/etc/quantum/debug.ini"}
+
# Configures keystone integration for quantum service and agents
function quantum_setup_keystone() {
local conf_file=$1
@@ -57,5 +59,72 @@
return 1
}
+function _get_net_id() {
+ quantum --os-tenant-name admin --os-username admin --os-password $ADMIN_PASSWORD net-list | grep $1 | awk '{print $2}'
+}
+
+function _get_probe_cmd_prefix() {
+ local from_net="$1"
+ net_id=`_get_net_id $from_net`
+ probe_id=`quantum-debug --os-tenant-name admin --os-username admin --os-password $ADMIN_PASSWORD probe-list -c id -c network_id | grep $net_id | awk '{print $2}' | head -n 1`
+ echo "sudo ip netns exec qprobe-$probe_id"
+}
+
+function delete_probe() {
+ local from_net="$1"
+ net_id=`_get_net_id $from_net`
+ probe_id=`quantum-debug --os-tenant-name admin --os-username admin --os-password $ADMIN_PASSWORD probe-list -c id -c network_id | grep $net_id | awk '{print $2}'`
+ quantum-debug --os-tenant-name admin --os-username admin probe-delete $probe_id
+}
+
+function _ping_check_quantum() {
+ local from_net=$1
+ local ip=$2
+ local timeout_sec=$3
+ local expected=${4:-"True"}
+ local check_command=""
+ probe_cmd=`_get_probe_cmd_prefix $from_net`
+ if [[ "$expected" = "True" ]]; then
+ check_command="while ! $probe_cmd ping -c1 -w1 $ip; do sleep 1; done"
+ else
+ check_command="while $probe_cmd ping -c1 -w1 $ip; do sleep 1; done"
+ fi
+ if ! timeout $timeout_sec sh -c "$check_command"; then
+ if [[ "$expected" = "True" ]]; then
+ echo "[Fail] Couldn't ping server"
+ else
+ echo "[Fail] Could ping server"
+ fi
+ exit 1
+ fi
+}
+
+# ssh check
+function _ssh_check_quantum() {
+ local from_net=$1
+ local key_file=$2
+ local ip=$3
+ local user=$4
+ local timeout_sec=$5
+ local probe_cmd = ""
+ probe_cmd=`_get_probe_cmd_prefix $from_net`
+ if ! timeout $timeout_sec sh -c "while ! $probe_cmd ssh -o StrictHostKeyChecking=no -i $key_file ${user}@$ip echo success ; do sleep 1; done"; then
+ echo "server didn't become ssh-able!"
+ exit 1
+ fi
+}
+
+function setup_quantum() {
+ public_net_id=`_get_net_id $PUBLIC_NETWORK_NAME`
+ quantum-debug --os-tenant-name admin --os-username admin --os-password $ADMIN_PASSWORD probe-create $public_net_id
+ private_net_id=`_get_net_id $PRIVATE_NETWORK_NAME`
+ quantum-debug --os-tenant-name admin --os-username admin --os-password $ADMIN_PASSWORD probe-create $private_net_id
+}
+
+function teardown_quantum() {
+ delete_probe $PUBLIC_NETWORK_NAME
+ delete_probe $PRIVATE_NETWORK_NAME
+}
+
# Restore xtrace
$XTRACE
diff --git a/openrc b/openrc
index 0a6a215..4b6b9b2 100644
--- a/openrc
+++ b/openrc
@@ -73,5 +73,5 @@
# export KEYSTONECLIENT_DEBUG=1
# export NOVACLIENT_DEBUG=1
-# set qunatum debug command
-export TEST_CONFIG_FILE=/etc/quantum/debug.ini
+# set quantum debug command
+export QUANTUM_TEST_CONFIG_FILE=${QUANTUM_TEST_CONFIG_FILE:-"/etc/quantum/debug.ini"}
diff --git a/stack.sh b/stack.sh
index 8947382..f250c6b 100755
--- a/stack.sh
+++ b/stack.sh
@@ -93,7 +93,7 @@
# ============
# Remove services which were negated in ENABLED_SERVICES
-# using the "-" prefix (e.g., "-n-vol") instead of
+# using the "-" prefix (e.g., "-rabbit") instead of
# calling disable_service().
disable_negated_services
@@ -154,12 +154,6 @@
fi
unset rpc_backend_cnt
-# Make sure we only have one volume service enabled.
-if is_service_enabled cinder && is_service_enabled n-vol; then
- echo "ERROR: n-vol and cinder must not be enabled at the same time"
- exit 1
-fi
-
# Set up logging level
VERBOSE=$(trueorfalse True $VERBOSE)
@@ -310,7 +304,6 @@
source $TOP_DIR/lib/glance
source $TOP_DIR/lib/nova
source $TOP_DIR/lib/cinder
-source $TOP_DIR/lib/n-vol
source $TOP_DIR/lib/ceilometer
source $TOP_DIR/lib/heat
source $TOP_DIR/lib/quantum
@@ -342,6 +335,8 @@
Q_USE_ROOTWRAP=${Q_USE_ROOTWRAP:-True}
# Meta data IP
Q_META_DATA_IP=${Q_META_DATA_IP:-$HOST_IP}
+# Use quantum-debug command
+Q_USE_DEBUG_COMMAND=${Q_USE_DEBUG_COMMAND:-False}
RYU_DIR=$DEST/ryu
# Ryu API Host
@@ -855,6 +850,7 @@
fi
if is_service_enabled heat; then
install_heat
+ install_heatclient
fi
if is_service_enabled cinder; then
install_cinder
@@ -910,6 +906,7 @@
fi
if is_service_enabled heat; then
configure_heat
+ configure_heatclient
fi
if is_service_enabled cinder; then
configure_cinder
@@ -1458,6 +1455,15 @@
iniset $Q_CONF_FILE DEFAULT rabbit_host $RABBIT_HOST
iniset $Q_CONF_FILE DEFAULT rabbit_password $RABBIT_PASSWORD
fi
+ if [[ "$Q_USE_DEBUG_COMMAND" == "True" ]]; then
+ Q_DEBUG_CONF_FILE=/etc/quantum/debug.ini
+ cp $QUANTUM_DIR/etc/l3_agent.ini $Q_DEBUG_CONF_FILE
+ iniset $Q_L3_CONF_FILE DEFAULT verbose False
+ iniset $Q_L3_CONF_FILE DEFAULT debug False
+ iniset $Q_L3_CONF_FILE DEFAULT metadata_ip $Q_META_DATA_IP
+ iniset $Q_L3_CONF_FILE DEFAULT use_namespaces $Q_USE_NAMESPACE
+ iniset $Q_L3_CONF_FILE DEFAULT root_helper "sudo"
+ fi
fi
@@ -1742,9 +1748,6 @@
if is_service_enabled cinder; then
echo_summary "Configuring Cinder"
init_cinder
-elif is_service_enabled n-vol; then
- echo_summary "Configuring Nova volumes"
- init_nvol
fi
if is_service_enabled nova; then
@@ -1944,10 +1947,6 @@
echo_summary "Starting Nova"
start_nova
fi
-if is_service_enabled n-vol; then
- echo_summary "Starting Nova volumes"
- start_nvol
-fi
if is_service_enabled cinder; then
echo_summary "Starting Cinder"
start_cinder
@@ -1996,7 +1995,7 @@
# Option to upload legacy ami-tty, which works with xenserver
if [[ -n "$UPLOAD_LEGACY_TTY" ]]; then
- IMAGE_URLS="${IMAGE_URLS:+${IMAGE_URLS},}http://images.ansolabs.com/tty.tgz"
+ IMAGE_URLS="${IMAGE_URLS:+${IMAGE_URLS},}https://github.com/downloads/citrix-openstack/warehouse/tty.tgz"
fi
for image_url in ${IMAGE_URLS//,/ }; do
diff --git a/stackrc b/stackrc
index 283b271..5689779 100644
--- a/stackrc
+++ b/stackrc
@@ -11,10 +11,6 @@
# ``disable_service`` functions in ``localrc``.
# For example, to enable Swift add this to ``localrc``:
# enable_service swift
-#
-# And to disable Cinder and use Nova Volumes instead:
-# disable_service c-api c-sch c-vol cinder
-# enable_service n-vol
ENABLED_SERVICES=g-api,g-reg,key,n-api,n-crt,n-obj,n-cpu,n-net,cinder,c-sch,c-api,c-vol,n-sch,n-novnc,n-xvnc,n-cauth,horizon,mysql,rabbit
# Set the default Nova APIs to enable
@@ -28,7 +24,7 @@
GIT_BASE=https://github.com
# metering service
-CEILOMETER_REPO=https://github.com/stackforge/ceilometer.git
+CEILOMETER_REPO=${GIT_BASE}/openstack/ceilometer.git
CEILOMETER_BRANCH=master
# volume service
@@ -101,6 +97,10 @@
HEAT_REPO=${GIT_BASE}/heat-api/heat.git
HEAT_BRANCH=master
+# python heat client library
+HEATCLIENT_REPO=${GIT_BASE}/heat-api/python-heatclient.git
+HEATCLIENT_BRANCH=master
+
# ryu service
RYU_REPO=https://github.com/osrg/ryu.git
RYU_BRANCH=master
diff --git a/tools/xen/prepare_guest_template.sh b/tools/xen/prepare_guest_template.sh
index baf9c3a..19bd2f8 100755
--- a/tools/xen/prepare_guest_template.sh
+++ b/tools/xen/prepare_guest_template.sh
@@ -60,7 +60,7 @@
rm -rf $TMP_DIR
else
echo "WARNING: no XenServer tools found, falling back to 5.6 tools"
- TOOLS_URL="http://images.ansolabs.com/xen/xe-guest-utilities_5.6.100-651_amd64.deb"
+ TOOLS_URL="https://github.com/downloads/citrix-openstack/warehouse/xe-guest-utilities_5.6.100-651_amd64.deb"
wget $TOOLS_URL -O $XS_TOOLS_FILE_NAME
cp $XS_TOOLS_FILE_NAME "${STAGING_DIR}${XS_TOOLS_PATH}"
rm -rf $XS_TOOLS_FILE_NAME
diff --git a/tools/xen/scripts/install_ubuntu_template.sh b/tools/xen/scripts/install_ubuntu_template.sh
index f67547b..43b6dec 100755
--- a/tools/xen/scripts/install_ubuntu_template.sh
+++ b/tools/xen/scripts/install_ubuntu_template.sh
@@ -45,6 +45,7 @@
# Clone built-in template to create new template
new_uuid=$(xe vm-clone uuid=$builtin_uuid \
new-name-label="$UBUNTU_INST_TEMPLATE_NAME")
+disk_size=$(($OSDOMU_VDI_GB * 1024 * 1024 * 1024))
# Some of these settings can be found in example preseed files
# however these need to be answered before the netinstall
@@ -73,6 +74,7 @@
PV-args="$pvargs" \
other-config:debian-release="$UBUNTU_INST_RELEASE" \
other-config:default_template=true \
+ other-config:disks='<provision><disk device="0" size="'$disk_size'" sr="" bootable="true" type="system"/></provision>' \
other-config:install-arch="$UBUNTU_INST_ARCH"
echo "Ubuntu template installed uuid:$new_uuid"
diff --git a/tools/xen/xenrc b/tools/xen/xenrc
index 0365a25..1a5a2a9 100644
--- a/tools/xen/xenrc
+++ b/tools/xen/xenrc
@@ -11,6 +11,7 @@
# Size of image
VDI_MB=${VDI_MB:-5000}
OSDOMU_MEM_MB=1024
+OSDOMU_VDI_GB=8
# VM Password
GUEST_PASSWORD=${GUEST_PASSWORD:-secrete}
diff --git a/unstack.sh b/unstack.sh
index 6b34aa3..1a2cad8 100755
--- a/unstack.sh
+++ b/unstack.sh
@@ -26,7 +26,6 @@
# Get project function libraries
source $TOP_DIR/lib/cinder
-source $TOP_DIR/lib/n-vol
# Determine what system we are running on. This provides ``os_VENDOR``,
# ``os_RELEASE``, ``os_UPDATE``, ``os_PACKAGE``, ``os_CODENAME``
@@ -58,11 +57,7 @@
SCSI_PERSIST_DIR=$CINDER_STATE_PATH/volumes/*
# Get the iSCSI volumes
-if is_service_enabled cinder n-vol; then
- if is_service_enabled n-vol; then
- SCSI_PERSIST_DIR=$NOVA_STATE_PATH/volumes/*
- fi
-
+if is_service_enabled cinder; then
TARGETS=$(sudo tgtadm --op show --mode target)
if [ $? -ne 0 ]; then
# If tgt driver isn't running this won't work obviously
@@ -88,10 +83,6 @@
sudo rm -rf $CINDER_STATE_PATH/volumes/*
fi
- if is_service_enabled n-vol; then
- sudo rm -rf $NOVA_STATE_PATH/volumes/*
- fi
-
if [[ "$os_PACKAGE" = "deb" ]]; then
stop_service tgt
else