From ffd28c7a766d35d80c15b8c8044f388ddb877e30 Mon Sep 17 00:00:00 2001 From: Kyle Mestery Date: Sun, 3 Jan 2016 07:01:13 -0600 Subject: [PATCH] Vagrant: Use the IP address from eth1 Make sure to use the IP address from eth1 for all OpenStack services. This is the private IP address which is accessible from the host running Vagrant. Fixup the names of the two compute nodes to be independent. Change-Id: I8a62e8ba09bfd4321d36ea1f7013ea2188e11d19 Signed-off-by: Kyle Mestery --- vagrant/provisioning/setup-compute.sh | 14 ++++++++++++++ vagrant/provisioning/setup-controller.sh | 19 +++++++++++++++++++ vagrant/provisioning/virtualbox.conf.yml | 4 ++-- 3 files changed, 35 insertions(+), 2 deletions(-) diff --git a/vagrant/provisioning/setup-compute.sh b/vagrant/provisioning/setup-compute.sh index 17fbd26e8..329e6d742 100644 --- a/vagrant/provisioning/setup-compute.sh +++ b/vagrant/provisioning/setup-compute.sh @@ -3,4 +3,18 @@ cp /dragonflow/doc/source/multi-node-conf/compute_node_local_controller.conf ~/d if [ "$1" != "" ]; then sed -i -e 's//'$1'/g' ~/devstack/local.conf fi + +# Get the IP address +ipaddress=$(/sbin/ifconfig eth1 | grep 'inet addr' | awk -F' ' '{print $2}' | awk -F':' '{print $2}') + +# Adjust some things in local.conf +cat << DEVSTACKEOF >> devstack/local.conf + +# Set this to the address of the main DevStack host running the rest of the +# OpenStack services. +Q_HOST=$1 +HOST_IP=$ipaddress +HOSTNAME=$(hostname) +DEVSTACKEOF + ~/devstack/stack.sh diff --git a/vagrant/provisioning/setup-controller.sh b/vagrant/provisioning/setup-controller.sh index c91307ed4..55e50c6a1 100644 --- a/vagrant/provisioning/setup-controller.sh +++ b/vagrant/provisioning/setup-controller.sh @@ -1,3 +1,22 @@ #!/usr/bin/env bash cp /dragonflow/doc/source/multi-node-conf/controller_node_local_controller.conf ~/devstack/local.conf + +# Get the IP address +ipaddress=$(/sbin/ifconfig eth1 | grep 'inet addr' | awk -F' ' '{print $2}' | awk -F':' '{print $2}') + +# Adjust some things in local.conf +cat << DEVSTACKEOF >> devstack/local.conf + +# Adjust this in case we're running on a cloud which may use 10.0.0.x +# for VM IP addresses +NETWORK_GATEWAY=10.100.100.100 +FIXED_RANGE=10.100.100.0/24 + +# Good to set these +HOST_IP=$ipaddress +HOSTNAME=$(hostname) +SERVICE_HOST_NAME=${HOSTNAME} +SERVICE_HOST=$ipaddress +DEVSTACKEOF + ~/devstack/stack.sh diff --git a/vagrant/provisioning/virtualbox.conf.yml b/vagrant/provisioning/virtualbox.conf.yml index f3a7c7c39..6c4b323db 100644 --- a/vagrant/provisioning/virtualbox.conf.yml +++ b/vagrant/provisioning/virtualbox.conf.yml @@ -6,12 +6,12 @@ devstack_controller: memory: 8192 cpus: 2 devstack_compute1: - host_name: compute.devstack.dev + host_name: compute1.devstack.dev ip: "192.168.33.102" memory: 1024 cpus: 1 devstack_compute2: - host_name: compute.devstack.dev + host_name: compute2.devstack.dev ip: "192.168.33.103" memory: 1024 cpus: 1