From e73182cbfa7f7b544fddfcbc0ea79644722d730e Mon Sep 17 00:00:00 2001 From: Feng Pan Date: Sun, 10 Jul 2016 22:40:17 -0400 Subject: Move br-phy and ovs agent bring up after bridge ip assignment for dpdk Change-Id: I37dd541d3ad413b76d94cbc89ab1b2c8e1a723f1 Signed-off-by: Feng Pan --- lib/post-install-functions.sh | 50 +++++++++++++++++++++---------------------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/lib/post-install-functions.sh b/lib/post-install-functions.sh index f52e28e1..75207ba2 100755 --- a/lib/post-install-functions.sh +++ b/lib/post-install-functions.sh @@ -29,6 +29,31 @@ cat ~/jumphost_id_rsa.pub | ssh -T ${SSH_OPTIONS[@]} "heat-admin@\$node" 'cat >> done EOI + echo -e "${blue}INFO: Checking if OVS bridges have IP addresses...${reset}" + for network in ${opnfv_attach_networks}; do + ovs_ip=$(find_ip ${NET_MAP[$network]}) + tmp_ip='' + if [ -n "$ovs_ip" ]; then + echo -e "${blue}INFO: OVS Bridge ${NET_MAP[$network]} has IP address ${ovs_ip}${reset}" + else + echo -e "${blue}INFO: OVS Bridge ${NET_MAP[$network]} missing IP, will configure${reset}" + # use last IP of allocation pool + eval "ip_range=\${${network}_usable_ip_range}" + ovs_ip=${ip_range##*,} + eval "net_cidr=\${${network}_cidr}" + sudo ip addr add ${ovs_ip}/${net_cidr##*/} dev ${NET_MAP[$network]} + sudo ip link set up ${NET_MAP[$network]} + tmp_ip=$(find_ip ${NET_MAP[$network]}) + if [ -n "$tmp_ip" ]; then + echo -e "${blue}INFO: OVS Bridge ${NET_MAP[$network]} IP set: ${tmp_ip}${reset}" + continue + else + echo -e "${red}ERROR: Unable to set OVS Bridge ${NET_MAP[$network]} with IP: ${ovs_ip}${reset}" + return 1 + fi + fi + done + if [ "${deploy_options_array['dataplane']}" == 'ovs_dpdk' ]; then echo -e "${blue}INFO: Bringing up br-phy and ovs-agent for dpdk compute nodes...${reset}" compute_nodes=$(undercloud_connect stack "source stackrc; nova list | grep compute | wc -l") @@ -69,31 +94,6 @@ if [ "${deploy_options_array['congress']}" == 'True' ]; then fi EOI - echo -e "${blue}INFO: Checking if OVS bridges have IP addresses...${reset}" - for network in ${opnfv_attach_networks}; do - ovs_ip=$(find_ip ${NET_MAP[$network]}) - tmp_ip='' - if [ -n "$ovs_ip" ]; then - echo -e "${blue}INFO: OVS Bridge ${NET_MAP[$network]} has IP address ${ovs_ip}${reset}" - else - echo -e "${blue}INFO: OVS Bridge ${NET_MAP[$network]} missing IP, will configure${reset}" - # use last IP of allocation pool - eval "ip_range=\${${network}_usable_ip_range}" - ovs_ip=${ip_range##*,} - eval "net_cidr=\${${network}_cidr}" - sudo ip addr add ${ovs_ip}/${net_cidr##*/} dev ${NET_MAP[$network]} - sudo ip link set up ${NET_MAP[$network]} - tmp_ip=$(find_ip ${NET_MAP[$network]}) - if [ -n "$tmp_ip" ]; then - echo -e "${blue}INFO: OVS Bridge ${NET_MAP[$network]} IP set: ${tmp_ip}${reset}" - continue - else - echo -e "${red}ERROR: Unable to set OVS Bridge ${NET_MAP[$network]} with IP: ${ovs_ip}${reset}" - return 1 - fi - fi - done - # for virtual, we NAT public network through Undercloud if [ "$virtual" == "TRUE" ]; then if ! configure_undercloud_nat ${public_network_cidr}; then -- cgit 1.2.3-korg