Browse code

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

Adam Gandelman authored on 2012/01/31 07:43:14
Showing 4 changed files
... ...
@@ -1,3 +1,4 @@
1
+Adam Gandelman <adamg@canonical.com>
1 2
 Andy Smith <github@anarkystic.com>
2 3
 Anthony Young <sleepsonthefloor@gmail.com>
3 4
 Brad Hall <brad@nicira.com>
... ...
@@ -70,10 +70,10 @@ nova list
70 70
 nova image-list
71 71
 
72 72
 # But we recommend using glance directly
73
-glance -f -A $TOKEN index
73
+glance -f -A $TOKEN -H $GLANCE_HOST index
74 74
 
75 75
 # Grab the id of the image to launch
76
-IMAGE=`glance -f -A $TOKEN index | egrep $DEFAULT_IMAGE_NAME | head -1 | cut -d" " -f1`
76
+IMAGE=`glance -f -A $TOKEN -H $GLANCE_HOST index | egrep $DEFAULT_IMAGE_NAME | head -1 | cut -d" " -f1`
77 77
 
78 78
 # Security Groups
79 79
 # ---------------
... ...
@@ -56,10 +56,10 @@ nova list
56 56
 nova image-list
57 57
 
58 58
 # But we recommend using glance directly
59
-glance -f -A $TOKEN index
59
+glance -f -A $TOKEN -H $GLANCE_HOST index
60 60
 
61 61
 # Grab the id of the image to launch
62
-IMAGE=`glance -f -A $TOKEN index | egrep $DEFAULT_IMAGE_NAME | head -1 | cut -d" " -f1`
62
+IMAGE=`glance -f -A $TOKEN -H $GLANCE_HOST index | egrep $DEFAULT_IMAGE_NAME | head -1 | cut -d" " -f1`
63 63
 
64 64
 # determinine instance type
65 65
 # -------------------------
... ...
@@ -8,6 +8,10 @@ source ./stackrc
8 8
 HOST_IP=${HOST_IP:-127.0.0.1}
9 9
 SERVICE_HOST=${SERVICE_HOST:-$HOST_IP}
10 10
 
11
+# Some exercises call glance directly.  On a single-node installation, Glance
12
+# should be listening on HOST_IP.  If its running elsewhere, it can be set here
13
+GLANCE_HOST=${GLANCE_HOST:-$HOST_IP}
14
+
11 15
 # Nova original used project_id as the *account* that owned resources (servers,
12 16
 # ip address, ...)   With the addition of Keystone we have standardized on the
13 17
 # term **tenant** as the entity that owns the resources.  **novaclient** still