[baremetal] public gateway setup on prx nodes 91/47591/1
authorGuillermo Herrero <guillermo.herrero@enea.com>
Thu, 16 Nov 2017 13:05:42 +0000 (14:05 +0100)
committerAlexandru Avadanii <Alexandru.Avadanii@enea.com>
Tue, 21 Nov 2017 15:46:29 +0000 (15:46 +0000)
- prx: add route for public traffic to public interface
- prx: add route towards salt master through maas
- remove dashboard class from proxy node (already implements horizon)
- remove dashboard (and benchmark) class definitions (no longer used)
- (temporary) backport Pharos change for adapter template

JIRA: FUEL-305

Change-Id: Ia14a18ac0123c1134d8d99dc43da9a1f770001d0
Signed-off-by: Guillermo Herrero <guillermo.herrero@enea.com>
(cherry picked from commit 07f4e0238646fcb77072769feb8a0b68df52caca)

18 files changed:
mcp/config/states/virtual_control_plane
mcp/patches/pharos/0006-extend-public-gateway-support.patch [new file with mode: 0644]
mcp/patches/reclass-system-salt-model/0001-Bring-in-opendaylight-support.patch
mcp/reclass/classes/cluster/all-mcp-ocata-common/opnfv/pod_config.yml.example
mcp/reclass/classes/cluster/all-mcp-ocata-common/opnfv/runtime.yml
mcp/reclass/classes/cluster/all-mcp-ocata-common/opnfv/runtime.yml.template
mcp/reclass/classes/cluster/baremetal-mcp-ocata-common/openstack_benchmark.yml [deleted file]
mcp/reclass/classes/cluster/baremetal-mcp-ocata-common/openstack_dashboard.yml [deleted file]
mcp/reclass/classes/cluster/baremetal-mcp-ocata-common/openstack_proxy.yml
mcp/reclass/classes/cluster/baremetal-mcp-ocata-odl-ha/openstack/benchmark.yml [deleted file]
mcp/reclass/classes/cluster/baremetal-mcp-ocata-odl-ha/openstack/dashboard.yml [deleted file]
mcp/reclass/classes/cluster/baremetal-mcp-ocata-odl-ha/openstack/proxy.yml
mcp/reclass/classes/cluster/baremetal-mcp-ocata-ovs-dpdk-ha/openstack/benchmark.yml [deleted file]
mcp/reclass/classes/cluster/baremetal-mcp-ocata-ovs-dpdk-ha/openstack/dashboard.yml [deleted file]
mcp/reclass/classes/cluster/baremetal-mcp-ocata-ovs-dpdk-ha/openstack/proxy.yml
mcp/reclass/classes/cluster/baremetal-mcp-ocata-ovs-ha/openstack/benchmark.yml [deleted file]
mcp/reclass/classes/cluster/baremetal-mcp-ocata-ovs-ha/openstack/dashboard.yml [deleted file]
mcp/reclass/classes/cluster/baremetal-mcp-ocata-ovs-ha/openstack/proxy.yml

index b9db08a..cfd5e42 100755 (executable)
@@ -12,7 +12,6 @@ CI_DEBUG=${CI_DEBUG:-0}; [[ "${CI_DEBUG}" =~ (false|0) ]] || set -x
 # shellcheck disable=SC1090
 source "$(dirname "${BASH_SOURCE[0]}")/../../scripts/lib.sh"
 
-# KVM, compute node prereqs (libvirt first), VCP deployment
 # patch the networking module for Debian based distros
 debian_ip_source=/usr/lib/python2.7/dist-packages/salt/modules/debian_ip.py
 salt -C 'kvm* or cmp*' file.line $debian_ip_source \
@@ -62,3 +61,7 @@ wait_for 10 "! salt -C 'E@^(?!cfg01|mas01|kvm|cmp00).*' state.apply linux,ntp |
 
 wait_for 10 "salt -C 'E@^(?!cfg01|mas01|kvm|cmp00).*' ssh.set_auth_key ${SUDO_USER} \
   $(awk 'NR==1{print $2}' "$(eval echo "~${SUDO_USER}/.ssh/authorized_keys")")"
+
+# Disable proxy dhcp routes after installation
+salt -C 'prx*' file.write /etc/dhcp/dhclient-enter-hooks.d/no-default-route \
+  args='unset new_routers'
diff --git a/mcp/patches/pharos/0006-extend-public-gateway-support.patch b/mcp/patches/pharos/0006-extend-public-gateway-support.patch
new file mode 100644 (file)
index 0000000..d7b6ae7
--- /dev/null
@@ -0,0 +1,62 @@
+::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+: Copyright (c) 2017 Mirantis Inc., Enea AB and others.
+:
+: All rights reserved. This program and the accompanying materials
+: are made available under the terms of the Apache License, Version 2.0
+: which accompanies this distribution, and is available at
+: http://www.apache.org/licenses/LICENSE-2.0
+::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+From: Guillermo Herrero <guillermo.herrero@enea.com>
+Date: Mon, 20 Nov 2017 11:33:29 +0100
+Subject: [PATCH] extend public gateway support
+
+JIRA: FUEL-305
+
+Change-Id: Ic5a2d499925aeec5b597394a059640ddae83fb2d
+Signed-off-by: Guillermo Herrero <guillermo.herrero@enea.com>
+---
+ config/installers/fuel/pod_config.yml.j2 | 10 ++++++++++
+ 1 file changed, 10 insertions(+)
+
+diff --git a/config/installers/fuel/pod_config.yml.j2 b/config/installers/fuel/pod_config.yml.j2
+index bd815d5..e42e3d5 100644
+--- a/config/installers/fuel/pod_config.yml.j2
++++ b/config/installers/fuel/pod_config.yml.j2
+@@ -8,6 +8,9 @@
+     {%- if conf.net_config.public.dns is defined -%}
+         {%- set dns_public = conf['net_config']['public']['dns'] -%}
+     {%- endif -%}
++    {%- if conf.net_config.public.gateway is defined -%}
++        {%- set net_public_gw = conf['net_config']['public']['gateway'] -%}
++    {%- endif -%}
+     {%- set pxe_interface = conf['net_config']['admin']['interface'] -%}
+ {%- else -%}
+     {%- set net_admin = '192.168.11.0' -%}
+@@ -22,6 +25,10 @@
+ {%- if dns_public is not defined -%}
+     {%- set dns_public = [ '8.8.8.8', '8.8.4.4' ] -%}
+ {%- endif -%}
++{%- if net_public_gw is not defined -%}
++    {%- set net_public_gw =  net_public | ipaddr_index('1')  -%}
++{%- endif -%}
++
+ ---
+ parameters:
+   _param:
+@@ -55,6 +62,8 @@ parameters:
+     opnfv_openstack_proxy_address: {{ net_public | ipaddr_index('103') }}
+     opnfv_openstack_proxy_node01_address: {{ net_public | ipaddr_index('104') }}
+     opnfv_openstack_proxy_node02_address: {{ net_public | ipaddr_index('105') }}
++    opnfv_openstack_proxy_node01_control_address: {{ net_mgmt | ipaddr_index('104') }}
++    opnfv_openstack_proxy_node02_control_address: {{ net_mgmt | ipaddr_index('105') }}
+     opnfv_openstack_control_address: {{ net_mgmt | ipaddr_index('10') }}
+     opnfv_openstack_control_node01_address: {{ net_mgmt | ipaddr_index('11') }}
+     opnfv_openstack_control_node02_address: {{ net_mgmt | ipaddr_index('12') }}
+@@ -85,6 +94,7 @@ parameters:
+
+     opnfv_opendaylight_server_node01_single_address: {{ net_mgmt | ipaddr_index('111') }}
+
++    opnfv_net_public_gw: {{ net_public_gw }}
+     opnfv_name_servers: {{ dns_public }}
+     opnfv_dns_server01: '{{ dns_public[0] }}'
+
index cc22006..c7ba5a7 100644 (file)
@@ -11,10 +11,22 @@ Date: Thu, 29 Jun 2017 12:22:42 +0400
 Subject: [PATCH] Bring in opendaylight support
 
 Change-Id: I3efec9a8b586a6c75b1c1635ad2a7024d73d9ad2
+---
+ neutron/control/opendaylight/cluster.yml               | 17 +++++++++++++++++
+ neutron/control/opendaylight/single.yml                | 15 +++++++++++++++
+ neutron/gateway/opendaylight/single.yml                |  7 +++++++
+ opendaylight/server/single.yml                         |  2 ++
+ reclass/storage/system/opendaylight_control_single.yml | 13 +++++++++++++
+ 5 files changed, 54 insertions(+)
+ create mode 100644 neutron/control/opendaylight/cluster.yml
+ create mode 100644 neutron/control/opendaylight/single.yml
+ create mode 100644 neutron/gateway/opendaylight/single.yml
+ create mode 100644 opendaylight/server/single.yml
+ create mode 100644 reclass/storage/system/opendaylight_control_single.yml
 
 diff --git a/neutron/control/opendaylight/cluster.yml b/neutron/control/opendaylight/cluster.yml
 new file mode 100644
-index 00000000..a32e7abb
+index 0000000..a32e7ab
 --- /dev/null
 +++ b/neutron/control/opendaylight/cluster.yml
 @@ -0,0 +1,17 @@
@@ -37,7 +49,7 @@ index 00000000..a32e7abb
 +            driver: opendaylight_v2
 diff --git a/neutron/control/opendaylight/single.yml b/neutron/control/opendaylight/single.yml
 new file mode 100644
-index 00000000..053f14df
+index 0000000..053f14d
 --- /dev/null
 +++ b/neutron/control/opendaylight/single.yml
 @@ -0,0 +1,15 @@
@@ -58,7 +70,7 @@ index 00000000..053f14df
 +            driver: opendaylight_v2
 diff --git a/neutron/gateway/opendaylight/single.yml b/neutron/gateway/opendaylight/single.yml
 new file mode 100644
-index 00000000..21690017
+index 0000000..2169001
 --- /dev/null
 +++ b/neutron/gateway/opendaylight/single.yml
 @@ -0,0 +1,7 @@
@@ -71,7 +83,7 @@ index 00000000..21690017
 +        ovsdb_connection: tcp:127.0.0.1:6639
 diff --git a/opendaylight/server/single.yml b/opendaylight/server/single.yml
 new file mode 100644
-index 00000000..3d11872c
+index 0000000..3d11872
 --- /dev/null
 +++ b/opendaylight/server/single.yml
 @@ -0,0 +1,2 @@
@@ -79,7 +91,7 @@ index 00000000..3d11872c
 +- service.opendaylight.server.single
 diff --git a/reclass/storage/system/opendaylight_control_single.yml b/reclass/storage/system/opendaylight_control_single.yml
 new file mode 100644
-index 00000000..ad809f59
+index 0000000..ad809f5
 --- /dev/null
 +++ b/reclass/storage/system/opendaylight_control_single.yml
 @@ -0,0 +1,13 @@
index d787628..e5b852f 100644 (file)
@@ -61,6 +61,7 @@ parameters:
 
     opnfv_opendaylight_server_node01_single_address: 10.167.4.111
 
+    opnfv_net_public_gw: 172.30.10.1
     opnfv_name_servers: ['8.8.8.8', '8.8.4.4']
     opnfv_dns_server01: '8.8.8.8'
     opnfv_net_mgmt_vlan: 300
index 9dbc030..4fd9e03 100644 (file)
@@ -10,6 +10,8 @@ parameters:
   _param:
     reclass_config_master: 10.20.0.2
     opnfv_maas_mcp_address: 10.20.0.3
+    opnfv_net_mcpcontrol: 10.20.0.0
+    opnfv_net_mcpcontrol_mask: 255.255.255.0
 
     # These should be moved to pod_config.yml and read based on PDF admin net
     opnfv_maas_pxe_network_address: 192.168.11.0
index cbd47ef..1445917 100644 (file)
@@ -10,6 +10,8 @@ parameters:
   _param:
     reclass_config_master: ${SALT_MASTER}
     opnfv_maas_mcp_address: ${MAAS_IP}
+    opnfv_net_mcpcontrol: ${SALT_MASTER%.*}.0
+    opnfv_net_mcpcontrol_mask: 255.255.255.0
 
     # These should be moved to pod_config.yml and read based on PDF admin net
     opnfv_maas_pxe_network_address: ${MAAS_PXE_NETWORK}
diff --git a/mcp/reclass/classes/cluster/baremetal-mcp-ocata-common/openstack_benchmark.yml b/mcp/reclass/classes/cluster/baremetal-mcp-ocata-common/openstack_benchmark.yml
deleted file mode 100644 (file)
index b9c3e16..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-##############################################################################
-# Copyright (c) 2017 Mirantis Inc., Enea AB and others.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Apache License, Version 2.0
-# which accompanies this distribution, and is available at
-# http://www.apache.org/licenses/LICENSE-2.0
-##############################################################################
----
-parameters:
-  _param:
-    dhcp_nic: eth0
-    single_nic: eth1
-  linux:
-    network:
-      interface:
-        dhcp: ${_param:linux_dhcp_interface}
-        single: ${_param:linux_single_interface}
diff --git a/mcp/reclass/classes/cluster/baremetal-mcp-ocata-common/openstack_dashboard.yml b/mcp/reclass/classes/cluster/baremetal-mcp-ocata-common/openstack_dashboard.yml
deleted file mode 100644 (file)
index e082d26..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-##############################################################################
-# Copyright (c) 2017 Mirantis Inc., Enea AB and others.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Apache License, Version 2.0
-# which accompanies this distribution, and is available at
-# http://www.apache.org/licenses/LICENSE-2.0
-##############################################################################
----
-classes:
-  - system.horizon.server.single
-parameters:
-  _param:
-    horizon_site_branding: OpenStack Dashboard
-    dhcp_nic: ${_param:opnfv_vcp_vm_primary_interface}
-    single_nic: ${_param:opnfv_vcp_vm_secondary_interface}
-  linux:
-    network:
-      interface:
-        dhcp: ${_param:linux_dhcp_interface}
-        single: ${_param:linux_single_interface}
index 1d0e8d1..6239df2 100644 (file)
@@ -37,8 +37,28 @@ parameters:
   linux:
     network:
       interface:
-        dhcp: ${_param:linux_dhcp_interface}
-        single: ${_param:linux_single_interface}
+        dhcp:
+          enabled: true
+          type: eth
+          proto: dhcp
+          name: ${_param:dhcp_nic}
+          route:
+            mcpcontol:
+              address: ${_param:opnfv_net_mcpcontrol}
+              netmask: ${_param:opnfv_net_mcpcontrol_mask}
+              gateway: ${_param:opnfv_infra_maas_node01_deploy_address}
+        single:
+          enabled: true
+          type: eth
+          proto: static
+          name: ${_param:single_nic}
+          address: ${_param:single_address}
+          netmask: 255.255.255.0
+          route:
+            public:
+              address: 0.0.0.0
+              netmask: 0.0.0.0
+              gateway: ${_param:opnfv_net_public_gw}
         control:
           enabled: true
           type: eth
diff --git a/mcp/reclass/classes/cluster/baremetal-mcp-ocata-odl-ha/openstack/benchmark.yml b/mcp/reclass/classes/cluster/baremetal-mcp-ocata-odl-ha/openstack/benchmark.yml
deleted file mode 100644 (file)
index 5ae972d..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-##############################################################################
-# Copyright (c) 2017 Mirantis Inc., Enea AB and others.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Apache License, Version 2.0
-# which accompanies this distribution, and is available at
-# http://www.apache.org/licenses/LICENSE-2.0
-##############################################################################
----
-classes:
-  - cluster.baremetal-mcp-ocata-common.openstack_benchmark
-  - cluster.baremetal-mcp-ocata-odl-ha
diff --git a/mcp/reclass/classes/cluster/baremetal-mcp-ocata-odl-ha/openstack/dashboard.yml b/mcp/reclass/classes/cluster/baremetal-mcp-ocata-odl-ha/openstack/dashboard.yml
deleted file mode 100644 (file)
index c60d7c4..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-##############################################################################
-# Copyright (c) 2017 Mirantis Inc., Enea AB and others.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Apache License, Version 2.0
-# which accompanies this distribution, and is available at
-# http://www.apache.org/licenses/LICENSE-2.0
-##############################################################################
----
-classes:
-  - cluster.baremetal-mcp-ocata-common.openstack_dashboard
-  - cluster.baremetal-mcp-ocata-odl-ha
index 7cb1c10..a516803 100644 (file)
@@ -9,7 +9,6 @@
 classes:
   - cluster.baremetal-mcp-ocata-common.openstack_proxy
   - cluster.baremetal-mcp-ocata-odl-ha.infra
-  - cluster.baremetal-mcp-ocata-odl-ha.openstack.dashboard
 parameters:
   nginx:
     server:
diff --git a/mcp/reclass/classes/cluster/baremetal-mcp-ocata-ovs-dpdk-ha/openstack/benchmark.yml b/mcp/reclass/classes/cluster/baremetal-mcp-ocata-ovs-dpdk-ha/openstack/benchmark.yml
deleted file mode 100644 (file)
index 1c02ae4..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-##############################################################################
-# Copyright (c) 2017 Mirantis Inc., Enea AB and others.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Apache License, Version 2.0
-# which accompanies this distribution, and is available at
-# http://www.apache.org/licenses/LICENSE-2.0
-##############################################################################
----
-classes:
-  - cluster.baremetal-mcp-ocata-common.openstack_benchmark
-  - cluster.baremetal-mcp-ocata-ovs-dpdk-ha
diff --git a/mcp/reclass/classes/cluster/baremetal-mcp-ocata-ovs-dpdk-ha/openstack/dashboard.yml b/mcp/reclass/classes/cluster/baremetal-mcp-ocata-ovs-dpdk-ha/openstack/dashboard.yml
deleted file mode 100644 (file)
index 278bf14..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-##############################################################################
-# Copyright (c) 2017 Mirantis Inc., Enea AB and others.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Apache License, Version 2.0
-# which accompanies this distribution, and is available at
-# http://www.apache.org/licenses/LICENSE-2.0
-##############################################################################
----
-classes:
-  - cluster.baremetal-mcp-ocata-common.openstack_dashboard
-  - cluster.baremetal-mcp-ocata-ovs-dpdk-ha
index 07da7eb..63ff2c8 100644 (file)
@@ -9,4 +9,3 @@
 classes:
   - cluster.baremetal-mcp-ocata-common.openstack_proxy
   - cluster.baremetal-mcp-ocata-ovs-dpdk-ha.infra
-  - cluster.baremetal-mcp-ocata-ovs-dpdk-ha.openstack.dashboard
diff --git a/mcp/reclass/classes/cluster/baremetal-mcp-ocata-ovs-ha/openstack/benchmark.yml b/mcp/reclass/classes/cluster/baremetal-mcp-ocata-ovs-ha/openstack/benchmark.yml
deleted file mode 100644 (file)
index 783561a..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-##############################################################################
-# Copyright (c) 2017 Mirantis Inc., Enea AB and others.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Apache License, Version 2.0
-# which accompanies this distribution, and is available at
-# http://www.apache.org/licenses/LICENSE-2.0
-##############################################################################
----
-classes:
-  - cluster.baremetal-mcp-ocata-common.openstack_benchmark
-  - cluster.baremetal-mcp-ocata-ovs-ha
diff --git a/mcp/reclass/classes/cluster/baremetal-mcp-ocata-ovs-ha/openstack/dashboard.yml b/mcp/reclass/classes/cluster/baremetal-mcp-ocata-ovs-ha/openstack/dashboard.yml
deleted file mode 100644 (file)
index 8dec9ed..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-##############################################################################
-# Copyright (c) 2017 Mirantis Inc., Enea AB and others.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Apache License, Version 2.0
-# which accompanies this distribution, and is available at
-# http://www.apache.org/licenses/LICENSE-2.0
-##############################################################################
----
-classes:
-  - cluster.baremetal-mcp-ocata-common.openstack_dashboard
-  - cluster.baremetal-mcp-ocata-ovs-ha
index f2a9d89..9288e6f 100644 (file)
@@ -9,4 +9,3 @@
 classes:
   - cluster.baremetal-mcp-ocata-common.openstack_proxy
   - cluster.baremetal-mcp-ocata-ovs-ha.infra
-  - cluster.baremetal-mcp-ocata-ovs-ha.openstack.dashboard