From 97e721a490bca4d324091d9eb33bbeb441b2b5c7 Mon Sep 17 00:00:00 2001 From: Alex Yang Date: Sat, 6 Jan 2018 11:24:43 +0800 Subject: [PATCH] Fix the VIP of daisy VIP can not conflict with the address of any node. Otherwise the deployment will fail. See [1]. [1]: https://build.opnfv.org/ci/job/daisy-deploy-baremetal-daily-master/359 Change-Id: I53a79c478d355d00b6eec16c462694eab68292d7 Signed-off-by: Alex Yang --- config/installers/daisy/network-dpdk.yaml.j2 | 5 ++++- config/installers/daisy/network.yaml.j2 | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/config/installers/daisy/network-dpdk.yaml.j2 b/config/installers/daisy/network-dpdk.yaml.j2 index e4ecc3ba..ccd7c8c5 100644 --- a/config/installers/daisy/network-dpdk.yaml.j2 +++ b/config/installers/daisy/network-dpdk.yaml.j2 @@ -41,6 +41,7 @@ network-config-metadata: networks: + {%- set nodes_num = conf['nodes'] | length -%} {%- set networks = {} -%} {%- for key in mapping -%} {%- set net_data = conf['net_config'][mapping[key]] -%} @@ -61,7 +62,9 @@ networks: {%- set start = ".".join([ips[0], ips[1], ips[2], "10"]) -%} {%- set end = ".".join([ips[0], ips[1], ips[2], "200"]) -%} {%- endif -%} - {%- set vip = start -%} + {%- set vip = start.split(".")[3] | int -%} + {%- set vip = vip + nodes_num + 10 - (vip + nodes_num) % 10 -%} + {%- set vip = ".".join([ips[0], ips[1], ips[2], vip | string]) -%} {%- if 'gateway' in net_data -%} {%- set gateway = net_data.gateway -%} diff --git a/config/installers/daisy/network.yaml.j2 b/config/installers/daisy/network.yaml.j2 index a4132a1d..914df461 100644 --- a/config/installers/daisy/network.yaml.j2 +++ b/config/installers/daisy/network.yaml.j2 @@ -41,6 +41,7 @@ network-config-metadata: networks: + {%- set nodes_num = conf['nodes'] | length -%} {%- set networks = {} -%} {%- for key in mapping -%} {%- set net_data = conf['net_config'][mapping[key]] -%} @@ -61,7 +62,9 @@ networks: {%- set start = ".".join([ips[0], ips[1], ips[2], "10"]) -%} {%- set end = ".".join([ips[0], ips[1], ips[2], "200"]) -%} {%- endif -%} - {%- set vip = start -%} + {%- set vip = start.split(".")[3] | int -%} + {%- set vip = vip + nodes_num + 10 - (vip + nodes_num) % 10 -%} + {%- set vip = ".".join([ips[0], ips[1], ips[2], vip | string]) -%} {%- if 'gateway' in net_data -%} {%- set gateway = net_data.gateway -%} -- 2.16.6