diff --git a/build_lxc.sh b/build_lxc.sh index 212261a..b5de232 100755 --- a/build_lxc.sh +++ b/build_lxc.sh @@ -103,6 +103,10 @@ if [ "$COPYENV" = "1" ]; then cp_it ~/.bashrc $ROOTFS/opt/.bashrc fi +# Make our ip address hostnames look nice at the command prompt +echo "export PS1='${debian_chroot:+($debian_chroot)}\\u@\\H:\\w\\$ '" >> $ROOTFS/opt/.bashrc +echo "export PS1='${debian_chroot:+($debian_chroot)}\\u@\\H:\\w\\$ '" >> $ROOTFS/etc/profile + # Give stack ownership over /opt so it may do the work needed chroot $ROOTFS chown -R stack /opt diff --git a/build_lxc_multi.sh b/build_lxc_multi.sh index 49407d4..b26cabf 100755 --- a/build_lxc_multi.sh +++ b/build_lxc_multi.sh @@ -7,19 +7,19 @@ COMPUTE_HOSTS=${COMPUTE_HOSTS:-192.168.1.53,192.168.1.54} NAMESERVER=${NAMESERVER:-192.168.2.1} GATEWAY=${GATEWAY:-192.168.1.1} -# Helper to launch containers -function run_lxc { - # For some reason container names with periods can cause issues :/ - container_name=`echo $1 | sed 's/\./_/g'` - CONTAINER=$container_name CONTAINER_IP=$1 CONTAINER_GATEWAY=$GATEWAY NAMESERVER=$NAMESERVER STACKSH_PARAMS="$2" ./build_lxc.sh -} - # Variables common amongst all hosts in the cluster COMMON_VARS="MYSQL_HOST=$HEAD_HOST RABBIT_HOST=$HEAD_HOST GLANCE_HOSTPORT=$HEAD_HOST:9292 NET_MAN=FlatDHCPManager FLAT_INTERFACE=eth0" -# Launch the head node -run_lxc $HEAD_HOST "$COMMON_VARS ENABLED_SERVICES=g-api,g-reg,key,n-api,n-sch,n-vnc,dash,mysql,rabbit" +# Helper to launch containers +function run_lxc { + # For some reason container names with periods can cause issues :/ + CONTAINER=$1 CONTAINER_IP=$2 CONTAINER_GATEWAY=$GATEWAY NAMESERVER=$NAMESERVER STACKSH_PARAMS="$COMMON_VARS $3" ./build_lxc.sh +} + +# Launch the head node - headnode uses a non-ip domain name, +# because rabbit won't launch with an ip addr hostname :( +run_lxc STACKMASTER $HEAD_HOST "ENABLED_SERVICES=g-api,g-reg,key,n-api,n-sch,n-vnc,dash,mysql,rabbit" for compute_host in ${COMPUTE_HOSTS//,/ }; do # Launch the compute hosts - run_lxc $compute_host "$COMMON_VARS ENABLED_SERVICES=n-cpu,n-net,n-api" + run_lxc $compute_host $compute_host "ENABLED_SERVICES=n-cpu,n-net,n-api" done