From c8dc1f363ae8e0265bd945ebdf3516bb3e278871 Mon Sep 17 00:00:00 2001 From: Dan Wendlandt Date: Wed, 26 Sep 2012 01:04:55 -0700 Subject: [PATCH] update quantum setup to automatically add route to fixed_range - allows metadata service to work out of the box for VMs in fixed_range - allows direct access to VMs via their fixed_ips from the devstack host. Change-Id: I24da91fdf184e195185462554c044ee6f65d58ce --- stack.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/stack.sh b/stack.sh index 5ea1b9b770..fe6c896ea1 100755 --- a/stack.sh +++ b/stack.sh @@ -359,7 +359,7 @@ Q_AUTH_STRATEGY=${Q_AUTH_STRATEGY:-keystone} Q_USE_NAMESPACE=${Q_USE_NAMESPACE:-True} Q_USE_ROOTWRAP=${Q_USE_ROOTWRAP=:-True} # Meta data IP -Q_META_DATA_IP=${Q_META_DATA_IP:-} +Q_META_DATA_IP=${Q_META_DATA_IP:-$HOST_IP} # Name of the LVM volume group to use/create for iscsi volumes VOLUME_GROUP=${VOLUME_GROUP:-stack-volumes} @@ -2216,10 +2216,12 @@ if is_service_enabled q-svc; then EXT_NET_ID=$(quantum net-create ext_net -- --router:external=True | grep ' id ' | get_field 2) EXT_GW_IP=$(quantum subnet-create --ip_version 4 $EXT_NET_ID $FLOATING_RANGE -- --enable_dhcp=False | grep 'gateway_ip' | get_field 2) quantum router-gateway-set $ROUTER_ID $EXT_NET_ID - if [[ "$Q_PLUGIN" = "openvswitch" ]]; then + if [[ "$Q_PLUGIN" = "openvswitch" ]] && [[ "$Q_USE_NAMESPACE" = "True" ]]; then CIDR_LEN=${FLOATING_RANGE#*/} sudo ip addr add $EXT_GW_IP/$CIDR_LEN dev $PUBLIC_BRIDGE sudo ip link set $PUBLIC_BRIDGE up + ROUTER_GW_IP=`quantum port-list -c fixed_ips -c device_owner | grep router_gateway | awk -F '"' '{ print $8; }'` + sudo route add -net $FIXED_RANGE gw $ROUTER_GW_IP fi if [[ "$Q_USE_NAMESPACE" == "False" ]]; then # Explicitly set router id in l3 agent configuration