From ce05e03213847da1220356e5d95adfde1bd3ae32 Mon Sep 17 00:00:00 2001 From: Adam Gandelman Date: Mon, 30 Jan 2012 14:43:14 -0800 Subject: [PATCH] exercises: Multihost support for Glance client floating_ips and volumes exercises both access Glance directly, but assume it is running locally. To better accomodate exercising a multi-host cloud, specify glance host via GLANCE_HOST setting which defaults to HOST_IP to maintain current single-node functionality. Change-Id: Iad06044af031083afa477204d446ada5161ca521 --- AUTHORS | 1 + exercises/floating_ips.sh | 4 ++-- exercises/volumes.sh | 4 ++-- openrc | 4 ++++ 4 files changed, 9 insertions(+), 4 deletions(-) diff --git a/AUTHORS b/AUTHORS index 34e04742f3..ec71326f6e 100644 --- a/AUTHORS +++ b/AUTHORS @@ -1,3 +1,4 @@ +Adam Gandelman Andy Smith Anthony Young Brad Hall diff --git a/exercises/floating_ips.sh b/exercises/floating_ips.sh index f7b5240b4b..8afa3ccdb5 100755 --- a/exercises/floating_ips.sh +++ b/exercises/floating_ips.sh @@ -70,10 +70,10 @@ nova list nova image-list # But we recommend using glance directly -glance -f -A $TOKEN index +glance -f -A $TOKEN -H $GLANCE_HOST index # Grab the id of the image to launch -IMAGE=`glance -f -A $TOKEN index | egrep $DEFAULT_IMAGE_NAME | head -1 | cut -d" " -f1` +IMAGE=`glance -f -A $TOKEN -H $GLANCE_HOST index | egrep $DEFAULT_IMAGE_NAME | head -1 | cut -d" " -f1` # Security Groups # --------------- diff --git a/exercises/volumes.sh b/exercises/volumes.sh index c2288de2c6..3f7548393a 100755 --- a/exercises/volumes.sh +++ b/exercises/volumes.sh @@ -56,10 +56,10 @@ nova list nova image-list # But we recommend using glance directly -glance -f -A $TOKEN index +glance -f -A $TOKEN -H $GLANCE_HOST index # Grab the id of the image to launch -IMAGE=`glance -f -A $TOKEN index | egrep $DEFAULT_IMAGE_NAME | head -1 | cut -d" " -f1` +IMAGE=`glance -f -A $TOKEN -H $GLANCE_HOST index | egrep $DEFAULT_IMAGE_NAME | head -1 | cut -d" " -f1` # determinine instance type # ------------------------- diff --git a/openrc b/openrc index 9c94141356..195a8fe897 100644 --- a/openrc +++ b/openrc @@ -8,6 +8,10 @@ source ./stackrc HOST_IP=${HOST_IP:-127.0.0.1} SERVICE_HOST=${SERVICE_HOST:-$HOST_IP} +# Some exercises call glance directly. On a single-node installation, Glance +# should be listening on HOST_IP. If its running elsewhere, it can be set here +GLANCE_HOST=${GLANCE_HOST:-$HOST_IP} + # Nova original used project_id as the *account* that owned resources (servers, # ip address, ...) With the addition of Keystone we have standardized on the # term **tenant** as the entity that owns the resources. **novaclient** still