Browse code

work on lxc multi-node ha nova-net + flatdhcp + ha-nova-api

Anthony Young authored on 2011/09/16 15:49:02
Showing 2 changed files
... ...
@@ -103,6 +103,10 @@ if [ "$COPYENV" = "1" ]; then
103 103
     cp_it ~/.bashrc $ROOTFS/opt/.bashrc
104 104
 fi
105 105
 
106
+# Make our ip address hostnames look nice at the command prompt
107
+echo "export PS1='${debian_chroot:+($debian_chroot)}\\u@\\H:\\w\\$ '" >> $ROOTFS/opt/.bashrc
108
+echo "export PS1='${debian_chroot:+($debian_chroot)}\\u@\\H:\\w\\$ '" >> $ROOTFS/etc/profile
109
+
106 110
 # Give stack ownership over /opt so it may do the work needed
107 111
 chroot $ROOTFS chown -R stack /opt
108 112
 
... ...
@@ -7,19 +7,19 @@ COMPUTE_HOSTS=${COMPUTE_HOSTS:-192.168.1.53,192.168.1.54}
7 7
 NAMESERVER=${NAMESERVER:-192.168.2.1}
8 8
 GATEWAY=${GATEWAY:-192.168.1.1}
9 9
 
10
+# Variables common amongst all hosts in the cluster
11
+COMMON_VARS="MYSQL_HOST=$HEAD_HOST RABBIT_HOST=$HEAD_HOST GLANCE_HOSTPORT=$HEAD_HOST:9292 NET_MAN=FlatDHCPManager FLAT_INTERFACE=eth0"
12
+
10 13
 # Helper to launch containers
11 14
 function run_lxc {
12 15
     # For some reason container names with periods can cause issues :/
13
-    container_name=`echo $1 | sed 's/\./_/g'`
14
-    CONTAINER=$container_name CONTAINER_IP=$1 CONTAINER_GATEWAY=$GATEWAY NAMESERVER=$NAMESERVER STACKSH_PARAMS="$2" ./build_lxc.sh
16
+    CONTAINER=$1 CONTAINER_IP=$2 CONTAINER_GATEWAY=$GATEWAY NAMESERVER=$NAMESERVER STACKSH_PARAMS="$COMMON_VARS $3" ./build_lxc.sh
15 17
 }
16 18
 
17
-# Variables common amongst all hosts in the cluster
18
-COMMON_VARS="MYSQL_HOST=$HEAD_HOST RABBIT_HOST=$HEAD_HOST GLANCE_HOSTPORT=$HEAD_HOST:9292 NET_MAN=FlatDHCPManager FLAT_INTERFACE=eth0"
19
-
20
-# Launch the head node
21
-run_lxc $HEAD_HOST "$COMMON_VARS ENABLED_SERVICES=g-api,g-reg,key,n-api,n-sch,n-vnc,dash,mysql,rabbit"
19
+# Launch the head node - headnode uses a non-ip domain name,
20
+# because rabbit won't launch with an ip addr hostname :(
21
+run_lxc STACKMASTER $HEAD_HOST "ENABLED_SERVICES=g-api,g-reg,key,n-api,n-sch,n-vnc,dash,mysql,rabbit"
22 22
 for compute_host in ${COMPUTE_HOSTS//,/ }; do
23 23
     # Launch the compute hosts
24
-    run_lxc $compute_host "$COMMON_VARS ENABLED_SERVICES=n-cpu,n-net,n-api"
24
+    run_lxc $compute_host $compute_host "ENABLED_SERVICES=n-cpu,n-net,n-api"
25 25
 done