From 33c017d388bf0f9cef5199c186bec5b4fd01f767 Mon Sep 17 00:00:00 2001 From: Alexandru Avadanii Date: Sat, 7 Apr 2018 05:27:48 +0200 Subject: Enforce static configuration instead of DHCP - noha: 'accept_policy: open_mode' to align with ha scenarios; - s/cmp01/cmp001/g to align all scenarios and allow code reuse; - rename network params: s/dhcp/mcpcontrol/g, cleanup; - computes XDF data: drop 'opnfv_*' layer of params, cleanup; - local vPDF: add comments with default roles by node index; - parameterize all netmasks; - drop unused address/netmask for 'proto: manual' interfaces; - virsh_net: cleanup definitions, remove hardcodes, align IP on jumpserver and DHCP range with MaaS for pxebr; - maas: parameterize hardcoded '/24' cidr for PXE/admin, refactor maas.region.machines parameterization; - merge templates; - move reclass.storage definitions of compute nodes to common dir; - drop 'openstack_compute_*' reclass params in favor of expanding them via j2 directly in reclass.storage params; - adopt `nm.cluster.has_*_nodes` where possible; - obsolete `runtime.yml` from reclass model; - refactor arch-specific reclass param selection; - remove unused defaults in favor of mandatory IDF properties; - noha: prepare for baremetal node support in cinder_lvm_devices; - interfaces: add interface_mtu and 'noifupdown: true' everywhere; - interfaces: use j2 macros to generate eth/vlan config; - states cleanup: remove DHCP route disable workaround on prx/cmp; - allow configuring NTP servers via: `idf.fuel.network.ntp_strata_host{1,2}`; - ovs_bridge: Allow setting gateway, dns-nameservers - apache: Adjust module list for novcp class inheritance; - glusterfs PPA: pin with same prio of MCP repos for novcp scenario; JIRA: FUEL-319 JIRA: FUEL-326 JIRA: FUEL-337 Change-Id: Ia6ad64ba8cade85a75fb22c9a2505decc3834360 Signed-off-by: Alexandru Avadanii --- .../installation/installation.instruction.rst | 2 +- mcp/config/labs/local/idf-virtual1.yaml | 2 + mcp/config/labs/local/virtual1.yaml | 10 +- mcp/config/scenario/os-nosdn-nofeature-ha.yaml.j2 | 10 +- mcp/config/scenario/os-nosdn-nofeature-noha.yaml | 4 +- mcp/config/scenario/os-nosdn-ovs-ha.yaml.j2 | 10 +- mcp/config/scenario/os-nosdn-ovs-noha.yaml | 8 +- mcp/config/scenario/os-odl-nofeature-ha.yaml.j2 | 10 +- mcp/config/scenario/os-odl-nofeature-noha.yaml | 4 +- mcp/config/scenario/os-ovn-nofeature-ha.yaml.j2 | 10 +- mcp/config/scenario/os-ovn-nofeature-noha.yaml | 8 +- mcp/config/states/baremetal_init | 4 - mcp/config/states/virtual_control_plane | 3 - .../0015-Set-ovs-bridges-as-L3-interfaces.patch | 8 +- ...ystem.repo-Pin-glusterfs-with-higher-prio.patch | 33 ++++ mcp/reclass/classes/cluster/.gitignore | 12 +- .../cluster/all-mcp-arch-common/aarch64/init.yml | 24 --- .../infra/config_dpdk_pdf.yml.j2 | 42 ----- .../all-mcp-arch-common/infra/config_pdf.yml.j2 | 93 +++++++++-- .../classes/cluster/all-mcp-arch-common/init.yml | 11 -- .../cluster/all-mcp-arch-common/init.yml.j2 | 41 +++++ .../cluster/all-mcp-arch-common/opnfv/init.yml | 11 -- .../cluster/all-mcp-arch-common/opnfv/init.yml.j2 | 29 ++++ .../all-mcp-arch-common/opnfv/runtime.yml.j2 | 15 -- .../cluster/all-mcp-arch-common/x86_64/init.yml | 24 --- .../cluster/mcp-common-ha/include/maas_proxy.yml | 25 --- .../mcp-common-ha/include/maas_proxy.yml.j2 | 27 ++++ .../classes/cluster/mcp-common-ha/infra/config.yml | 175 --------------------- .../cluster/mcp-common-ha/infra/config.yml.j2 | 160 +++++++++++++++++++ .../cluster/mcp-common-ha/infra/init.yml.j2 | 9 +- .../cluster/mcp-common-ha/infra/kvm_novcp.yml.j2 | 19 +++ .../cluster/mcp-common-ha/infra/kvm_pdf.yml.j2 | 48 +++--- .../classes/cluster/mcp-common-ha/infra/maas.yml | 69 -------- .../cluster/mcp-common-ha/infra/maas.yml.j2 | 149 ++++++++++++++++++ .../cluster/mcp-common-ha/infra/maas_pdf.yml.j2 | 94 ----------- .../cluster/mcp-common-ha/openstack_compute.yml | 1 + .../mcp-common-ha/openstack_compute_pdf.yml.j2 | 59 +++---- .../cluster/mcp-common-ha/openstack_control.yml.j2 | 3 - .../cluster/mcp-common-ha/openstack_init.yml.j2 | 32 ++-- .../openstack_interface_vcp_biport.yml.j2 | 14 +- .../openstack_interface_vcp_triport.yml.j2 | 31 ++-- .../cluster/mcp-common-ha/openstack_proxy.yml.j2 | 14 +- .../cluster/mcp-common-ha/openstack_telemetry.yml | 87 ---------- .../mcp-common-ha/openstack_telemetry.yml.j2 | 89 +++++++++++ .../cluster/mcp-common-noha/infra/config.yml | 82 ---------- .../cluster/mcp-common-noha/infra/config.yml.j2 | 59 +++++++ .../cluster/mcp-common-noha/init_options.yml | 2 - .../cluster/mcp-common-noha/openstack_compute.yml | 2 +- .../mcp-common-noha/openstack_compute_pdf.yml.j2 | 17 +- .../cluster/mcp-common-noha/openstack_control.yml | 2 +- .../mcp-common-noha/openstack_control_pdf.yml.j2 | 12 +- .../mcp-common-noha/openstack_gateway_pdf.yml.j2 | 12 +- .../cluster/mcp-common-noha/openstack_init.yml | 134 ---------------- .../cluster/mcp-common-noha/openstack_init.yml.j2 | 135 ++++++++++++++++ .../classes/cluster/mcp-odl-ha/infra/config.yml | 2 +- .../classes/cluster/mcp-odl-ha/infra/maas.yml.j2 | 9 +- .../mcp-odl-ha/openstack/compute_pdf.yml.j2 | 30 +--- .../cluster/mcp-odl-noha/infra/config.yml.j2 | 2 + .../mcp-odl-noha/opendaylight/control_pdf.yml.j2 | 11 +- .../cluster/mcp-odl-noha/openstack/compute.yml.j2 | 7 +- .../cluster/mcp-odl-noha/openstack/gateway.yml | 2 +- .../mcp-ovn-ha/openstack/compute_pdf.yml.j2 | 30 +--- .../cluster/mcp-ovn-noha/openstack/compute.yml | 52 ------ .../cluster/mcp-ovn-noha/openstack/compute.yml.j2 | 55 +++++++ .../cluster/mcp-ovs-dpdk-ha/infra/config.yml | 2 +- .../cluster/mcp-ovs-dpdk-noha/infra/config.yml | 3 +- .../mcp-ovs-dpdk-noha/openstack/compute.yml | 35 ----- .../mcp-ovs-dpdk-noha/openstack/compute.yml.j2 | 41 +++++ .../mcp-ovs-ha/openstack/compute_pdf.yml.j2 | 30 +--- .../classes/cluster/mcp-ovs-noha/infra/config.yml | 1 + .../cluster/mcp-ovs-noha/openstack/compute.yml | 24 --- .../cluster/mcp-ovs-noha/openstack/compute.yml.j2 | 30 ++++ .../cluster/mcp-ovs-noha/openstack/gateway.yml | 2 +- mcp/salt-formulas/maas/pxe_nat.sls | 6 +- mcp/scripts/lib_template.sh | 1 + mcp/scripts/pharos | 2 +- mcp/scripts/salt.sh | 1 - mcp/scripts/user-data.admin.sh.j2 | 4 +- mcp/scripts/virsh_net/net_mcpcontrol.xml.j2 | 5 +- mcp/scripts/virsh_net/net_mgmt.xml.j2 | 10 +- mcp/scripts/virsh_net/net_public.xml.j2 | 18 +-- mcp/scripts/virsh_net/net_pxebr.xml.j2 | 13 +- 82 files changed, 1170 insertions(+), 1248 deletions(-) create mode 100644 mcp/patches/reclass-system-salt-model/0003-system.repo-Pin-glusterfs-with-higher-prio.patch delete mode 100644 mcp/reclass/classes/cluster/all-mcp-arch-common/aarch64/init.yml delete mode 100644 mcp/reclass/classes/cluster/all-mcp-arch-common/infra/config_dpdk_pdf.yml.j2 delete mode 100644 mcp/reclass/classes/cluster/all-mcp-arch-common/init.yml create mode 100644 mcp/reclass/classes/cluster/all-mcp-arch-common/init.yml.j2 delete mode 100644 mcp/reclass/classes/cluster/all-mcp-arch-common/opnfv/init.yml create mode 100644 mcp/reclass/classes/cluster/all-mcp-arch-common/opnfv/init.yml.j2 delete mode 100644 mcp/reclass/classes/cluster/all-mcp-arch-common/opnfv/runtime.yml.j2 delete mode 100644 mcp/reclass/classes/cluster/all-mcp-arch-common/x86_64/init.yml delete mode 100644 mcp/reclass/classes/cluster/mcp-common-ha/include/maas_proxy.yml create mode 100644 mcp/reclass/classes/cluster/mcp-common-ha/include/maas_proxy.yml.j2 delete mode 100644 mcp/reclass/classes/cluster/mcp-common-ha/infra/config.yml create mode 100644 mcp/reclass/classes/cluster/mcp-common-ha/infra/config.yml.j2 create mode 100644 mcp/reclass/classes/cluster/mcp-common-ha/infra/kvm_novcp.yml.j2 delete mode 100644 mcp/reclass/classes/cluster/mcp-common-ha/infra/maas.yml create mode 100644 mcp/reclass/classes/cluster/mcp-common-ha/infra/maas.yml.j2 delete mode 100644 mcp/reclass/classes/cluster/mcp-common-ha/infra/maas_pdf.yml.j2 delete mode 100644 mcp/reclass/classes/cluster/mcp-common-ha/openstack_telemetry.yml create mode 100644 mcp/reclass/classes/cluster/mcp-common-ha/openstack_telemetry.yml.j2 delete mode 100644 mcp/reclass/classes/cluster/mcp-common-noha/infra/config.yml create mode 100644 mcp/reclass/classes/cluster/mcp-common-noha/infra/config.yml.j2 delete mode 100644 mcp/reclass/classes/cluster/mcp-common-noha/openstack_init.yml create mode 100644 mcp/reclass/classes/cluster/mcp-common-noha/openstack_init.yml.j2 delete mode 100644 mcp/reclass/classes/cluster/mcp-ovn-noha/openstack/compute.yml create mode 100644 mcp/reclass/classes/cluster/mcp-ovn-noha/openstack/compute.yml.j2 delete mode 100644 mcp/reclass/classes/cluster/mcp-ovs-dpdk-noha/openstack/compute.yml create mode 100644 mcp/reclass/classes/cluster/mcp-ovs-dpdk-noha/openstack/compute.yml.j2 delete mode 100644 mcp/reclass/classes/cluster/mcp-ovs-noha/openstack/compute.yml create mode 100644 mcp/reclass/classes/cluster/mcp-ovs-noha/openstack/compute.yml.j2 diff --git a/docs/release/installation/installation.instruction.rst b/docs/release/installation/installation.instruction.rst index 5d4c2cbd7..94d67c193 100644 --- a/docs/release/installation/installation.instruction.rst +++ b/docs/release/installation/installation.instruction.rst @@ -296,7 +296,7 @@ For virtual deploys all the targets are VMs on the Jumpserver. The deploy script +-----------------------+------------------------------------------------------------------------+ | ctl01 | Controller VM | +-----------------------+------------------------------------------------------------------------+ - | cmp01/cmp02 | Compute VMs | + | cmp001/cmp002 | Compute VMs | +-----------------------+------------------------------------------------------------------------+ | gtw01 | Gateway VM with neutron services (dhcp agent, L3 agent, metadata, etc) | +-----------------------+------------------------------------------------------------------------+ diff --git a/mcp/config/labs/local/idf-virtual1.yaml b/mcp/config/labs/local/idf-virtual1.yaml index 79a5fa044..402af9852 100644 --- a/mcp/config/labs/local/idf-virtual1.yaml +++ b/mcp/config/labs/local/idf-virtual1.yaml @@ -57,6 +57,8 @@ idf: private: ~ public: ~ network: + ntp_strata_host1: 1.se.pool.ntp.org + ntp_strata_host2: 0.se.pool.ntp.org node: # Ordered-list, index should be in sync with node index in PDF - interfaces: &interfaces diff --git a/mcp/config/labs/local/virtual1.yaml b/mcp/config/labs/local/virtual1.yaml index e46a2c6c9..b293b9775 100644 --- a/mcp/config/labs/local/virtual1.yaml +++ b/mcp/config/labs/local/virtual1.yaml @@ -58,7 +58,7 @@ jumphost: vlan: native ############################################################################## nodes: - - name: node-1 + - name: node-1 # noha ctl01 or ha (novcp) kvm01 node: &nodeparams # Fuel overrides certain params (e.g. cpus, mem) based on node role later type: virtual @@ -102,25 +102,25 @@ nodes: mac_address: "00:00:00:00:00:00" vlan: native ############################################################################ - - name: node-2 + - name: node-2 # noha gtw01 or ha (novcp) kvm02 node: *nodeparams disks: *disks remote_management: *remotemgmt interfaces: *interfaces ############################################################################ - - name: node-3 + - name: node-3 # noha odl01 / unused or ha (novcp) kvm02 node: *nodeparams disks: *disks remote_management: *remotemgmt interfaces: *interfaces ############################################################################ - - name: node-4 + - name: node-4 # cmp001 node: *nodeparams disks: *disks remote_management: *remotemgmt interfaces: *interfaces ############################################################################ - - name: node-5 + - name: node-5 # cmp002 node: *nodeparams disks: *disks remote_management: *remotemgmt diff --git a/mcp/config/scenario/os-nosdn-nofeature-ha.yaml.j2 b/mcp/config/scenario/os-nosdn-nofeature-ha.yaml.j2 index a6a641c63..26938262e 100644 --- a/mcp/config/scenario/os-nosdn-nofeature-ha.yaml.j2 +++ b/mcp/config/scenario/os-nosdn-nofeature-ha.yaml.j2 @@ -6,17 +6,11 @@ # http://www.apache.org/licenses/LICENSE-2.0 ############################################################################## {%- import 'net_map.j2' as nm with context %} -{%- set cluster = {'has_virtual_nodes': False} %} -{%- for node in conf.nodes %} - {%- if not cluster.has_virtual_nodes and node.node.type == 'baremetal' %} - {%- do cluster.update({'has_baremetal_nodes': True}) %} - {%- endif %} -{%- endfor %} --- cluster: domain: mcp-ovs-ha.local states: -{%- if cluster.has_baremetal_nodes %} +{%- if nm.cluster.has_baremetal_nodes %} - maas - baremetal_init {%- endif %} @@ -28,7 +22,7 @@ cluster: virtual: nodes: - cfg01 -{%- if cluster.has_baremetal_nodes %} +{%- if nm.cluster.has_baremetal_nodes %} - mas01 {%- endif %} {#- Most likely, controllers will always have the same type and number (3) #} diff --git a/mcp/config/scenario/os-nosdn-nofeature-noha.yaml b/mcp/config/scenario/os-nosdn-nofeature-noha.yaml index 1926d4977..5c5e77ceb 100644 --- a/mcp/config/scenario/os-nosdn-nofeature-noha.yaml +++ b/mcp/config/scenario/os-nosdn-nofeature-noha.yaml @@ -16,8 +16,8 @@ virtual: nodes: - cfg01 - ctl01 - - cmp01 - - cmp02 + - cmp001 + - cmp002 - gtw01 ctl01: vcpus: 4 diff --git a/mcp/config/scenario/os-nosdn-ovs-ha.yaml.j2 b/mcp/config/scenario/os-nosdn-ovs-ha.yaml.j2 index f43433014..f9ab7c3fb 100644 --- a/mcp/config/scenario/os-nosdn-ovs-ha.yaml.j2 +++ b/mcp/config/scenario/os-nosdn-ovs-ha.yaml.j2 @@ -6,17 +6,11 @@ # http://www.apache.org/licenses/LICENSE-2.0 ############################################################################## {%- import 'net_map.j2' as nm with context %} -{%- set cluster = {'has_virtual_nodes': False} %} -{%- for node in conf.nodes %} - {%- if not cluster.has_virtual_nodes and node.node.type == 'baremetal' %} - {%- do cluster.update({'has_baremetal_nodes': True}) %} - {%- endif %} -{%- endfor %} --- cluster: domain: mcp-ovs-dpdk-ha.local states: -{%- if cluster.has_baremetal_nodes %} +{%- if nm.cluster.has_baremetal_nodes %} - maas - baremetal_init {%- endif %} @@ -29,7 +23,7 @@ cluster: virtual: nodes: - cfg01 -{%- if cluster.has_baremetal_nodes %} +{%- if nm.cluster.has_baremetal_nodes %} - mas01 {%- endif %} {#- Most likely, controllers will always have the same type and number (3) #} diff --git a/mcp/config/scenario/os-nosdn-ovs-noha.yaml b/mcp/config/scenario/os-nosdn-ovs-noha.yaml index b44647c25..19e7946d1 100644 --- a/mcp/config/scenario/os-nosdn-ovs-noha.yaml +++ b/mcp/config/scenario/os-nosdn-ovs-noha.yaml @@ -17,17 +17,17 @@ virtual: nodes: - cfg01 - ctl01 - - cmp01 - - cmp02 + - cmp001 + - cmp002 - gtw01 ctl01: vcpus: 4 ram: 14336 gtw01: ram: 2048 - cmp01: + cmp001: vcpus: 4 ram: 8192 - cmp02: + cmp002: vcpus: 4 ram: 8192 diff --git a/mcp/config/scenario/os-odl-nofeature-ha.yaml.j2 b/mcp/config/scenario/os-odl-nofeature-ha.yaml.j2 index 9018adb87..c48f18c51 100644 --- a/mcp/config/scenario/os-odl-nofeature-ha.yaml.j2 +++ b/mcp/config/scenario/os-odl-nofeature-ha.yaml.j2 @@ -6,17 +6,11 @@ # http://www.apache.org/licenses/LICENSE-2.0 ############################################################################## {%- import 'net_map.j2' as nm with context %} -{%- set cluster = {'has_virtual_nodes': False} %} -{%- for node in conf.nodes %} - {%- if not cluster.has_virtual_nodes and node.node.type == 'baremetal' %} - {%- do cluster.update({'has_baremetal_nodes': True}) %} - {%- endif %} -{%- endfor %} --- cluster: domain: mcp-odl-ha.local states: -{%- if cluster.has_baremetal_nodes %} +{%- if nm.cluster.has_baremetal_nodes %} - maas - baremetal_init {%- endif %} @@ -29,7 +23,7 @@ cluster: virtual: nodes: - cfg01 -{%- if cluster.has_baremetal_nodes %} +{%- if nm.cluster.has_baremetal_nodes %} - mas01 {%- endif %} {#- Most likely, controllers will always have the same type and number (3) #} diff --git a/mcp/config/scenario/os-odl-nofeature-noha.yaml b/mcp/config/scenario/os-odl-nofeature-noha.yaml index c61abd539..ec04ee87a 100644 --- a/mcp/config/scenario/os-odl-nofeature-noha.yaml +++ b/mcp/config/scenario/os-odl-nofeature-noha.yaml @@ -17,8 +17,8 @@ virtual: nodes: - cfg01 - ctl01 - - cmp01 - - cmp02 + - cmp001 + - cmp002 - gtw01 - odl01 ctl01: diff --git a/mcp/config/scenario/os-ovn-nofeature-ha.yaml.j2 b/mcp/config/scenario/os-ovn-nofeature-ha.yaml.j2 index 2f6bd86dc..218b5dece 100644 --- a/mcp/config/scenario/os-ovn-nofeature-ha.yaml.j2 +++ b/mcp/config/scenario/os-ovn-nofeature-ha.yaml.j2 @@ -6,17 +6,11 @@ # http://www.apache.org/licenses/LICENSE-2.0 ############################################################################## {%- import 'net_map.j2' as nm with context %} -{%- set cluster = {'has_virtual_nodes': False} %} -{%- for node in conf.nodes %} - {%- if not cluster.has_virtual_nodes and node.node.type == 'baremetal' %} - {%- do cluster.update({'has_baremetal_nodes': True}) %} - {%- endif %} -{%- endfor %} --- cluster: domain: mcp-ovn-ha.local states: -{%- if cluster.has_baremetal_nodes %} +{%- if nm.cluster.has_baremetal_nodes %} - maas - baremetal_init {%- endif %} @@ -28,7 +22,7 @@ cluster: virtual: nodes: - cfg01 -{%- if cluster.has_baremetal_nodes %} +{%- if nm.cluster.has_baremetal_nodes %} - mas01 {%- endif %} {#- Most likely, controllers will always have the same type and number (3) #} diff --git a/mcp/config/scenario/os-ovn-nofeature-noha.yaml b/mcp/config/scenario/os-ovn-nofeature-noha.yaml index d2015754e..7036340bf 100644 --- a/mcp/config/scenario/os-ovn-nofeature-noha.yaml +++ b/mcp/config/scenario/os-ovn-nofeature-noha.yaml @@ -15,14 +15,14 @@ virtual: nodes: - cfg01 - ctl01 - - cmp01 - - cmp02 + - cmp001 + - cmp002 ctl01: vcpus: 4 ram: 14336 - cmp01: + cmp001: vcpus: 5 ram: 8192 - cmp02: + cmp002: vcpus: 5 ram: 8192 diff --git a/mcp/config/states/baremetal_init b/mcp/config/states/baremetal_init index c02333894..6a44b788b 100755 --- a/mcp/config/states/baremetal_init +++ b/mcp/config/states/baremetal_init @@ -31,10 +31,6 @@ wait_for 5.0 "salt -C 'kvm* or cmp*' state.apply opnfv.route_wrapper" wait_for 5.0 "salt -C 'cmp*' state.apply linux.network" wait_for 30.0 "salt -C 'kvm* or cmp*' test.ping" -# disable dhcp offered routes on compute nodes -salt -C 'cmp*' file.write /etc/dhcp/dhclient-enter-hooks.d/no-default-route \ - args='unset new_routers' - salt -C 'kvm* or cmp*' system.reboot wait_for 90.0 "salt -C 'kvm* or cmp*' test.ping" diff --git a/mcp/config/states/virtual_control_plane b/mcp/config/states/virtual_control_plane index c391cfe6f..18e6d1cd2 100755 --- a/mcp/config/states/virtual_control_plane +++ b/mcp/config/states/virtual_control_plane @@ -54,9 +54,6 @@ wait_for 10.0 "salt -C 'E@^(?!cfg01|mas01|kvm|cmp00).*' state.apply linux,ntp" wait_for 10.0 "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' salt -C 'prx*' state.apply opnfv.route_wrapper salt -C 'prx*' system.reboot wait_for 30.0 "salt -C 'prx*' test.ping" diff --git a/mcp/patches/0015-Set-ovs-bridges-as-L3-interfaces.patch b/mcp/patches/0015-Set-ovs-bridges-as-L3-interfaces.patch index d840e9f80..a7b366b94 100644 --- a/mcp/patches/0015-Set-ovs-bridges-as-L3-interfaces.patch +++ b/mcp/patches/0015-Set-ovs-bridges-as-L3-interfaces.patch @@ -17,7 +17,7 @@ new file mode 100644 index 0000000..c609e45 --- /dev/null +++ b/linux/files/ovs_bridge -@@ -0,0 +1,13 @@ +@@ -0,0 +1,19 @@ +auto {{ bridge_name }} +allow-ovs {{ bridge_name }} +iface {{ bridge_name }} inet static @@ -31,6 +31,12 @@ index 0000000..c609e45 + {%- if bridge.datapath_type is defined %} + ovs_extra set Bridge ${IFACE} datapath_type={{ bridge.datapath_type }} + {%- endif %} ++ {%- if bridge.gateway is defined %} ++ gateway {{ bridge.gateway }} ++ {%- endif %} ++ {%- if bridge.name_servers is defined %} ++ dns-nameservers {{ bridge.name_servers | join(' ') }} ++ {%- endif %} diff --git a/linux/files/ovs_port b/linux/files/ovs_port index 222ca8e..efb0307 100644 --- a/linux/files/ovs_port diff --git a/mcp/patches/reclass-system-salt-model/0003-system.repo-Pin-glusterfs-with-higher-prio.patch b/mcp/patches/reclass-system-salt-model/0003-system.repo-Pin-glusterfs-with-higher-prio.patch new file mode 100644 index 000000000..91219f6fa --- /dev/null +++ b/mcp/patches/reclass-system-salt-model/0003-system.repo-Pin-glusterfs-with-higher-prio.patch @@ -0,0 +1,33 @@ +:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: +: Copyright (c) 2018 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: Alexandru Avadanii +Date: Mon, 18 Jun 2018 15:53:31 +0200 +Subject: [PATCH] system.repo: Pin glusterfs with higher prio + +When both glusterfs PPA repo and MCP repos are used on the same node, +the MCP repos used to take priority and install a predefined version +no matter the configuration for GlusterFS PPA. + +Signed-off-by: Alexandru Avadanii +--- + linux/system/repo/glusterfs.yml | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/linux/system/repo/glusterfs.yml b/linux/system/repo/glusterfs.yml +index fb331f0f..71d063ac 100644 +--- a/linux/system/repo/glusterfs.yml ++++ b/linux/system/repo/glusterfs.yml +@@ -9,3 +9,7 @@ parameters: + architectures: amd64 + key_id: 3FE869A9 + key_server: keyserver.ubuntu.com ++ pin: ++ - package: '*' ++ pin: release o=LP-PPA-gluster-glusterfs-${_param:glusterfs_version} ++ priority: 1100 diff --git a/mcp/reclass/classes/cluster/.gitignore b/mcp/reclass/classes/cluster/.gitignore index bc812c229..a7efc5744 100644 --- a/mcp/reclass/classes/cluster/.gitignore +++ b/mcp/reclass/classes/cluster/.gitignore @@ -1,7 +1,14 @@ **/*_pdf.yml +all-mcp-arch-common/init.yml +all-mcp-arch-common/opnfv/init.yml +mcp*common-*/infra/config.yml mcp-common-ha/infra/init.yml +mcp-common-ha/infra/maas.yml +mcp-common-ha/infra/kvm_novcp.yml +mcp-common-ha/include/maas_proxy.yml mcp-common-ha/openstack_control.yml -mcp-common-ha/openstack_init.yml +mcp-common-ha/openstack_telemetry.yml +mcp*common-*/openstack_init.yml mcp-common-ha/openstack_interface_vcp_biport.yml mcp-common-ha/openstack_interface_vcp_triport.yml mcp-common-ha/openstack_proxy.yml @@ -11,9 +18,10 @@ mcp-ovs-dpdk-ha/infra/init_vcp.yml mcp-ovs-dpdk-ha/infra/kvm.yml mcp-odl-ha/infra/init_vcp.yml mcp-odl-ha/infra/kvm.yml +mcp-odl-ha/infra/maas.yml mcp-ovn-ha/infra/init_vcp.yml mcp-ovn-ha/infra/kvm.yml mcp-odl-ha/opendaylight/control.yml mcp-odl-ha/openstack/init.yml mcp-odl-noha/infra/config.yml -mcp-odl-noha/openstack/compute.yml +mcp-*-noha/openstack/compute.yml diff --git a/mcp/reclass/classes/cluster/all-mcp-arch-common/aarch64/init.yml b/mcp/reclass/classes/cluster/all-mcp-arch-common/aarch64/init.yml deleted file mode 100644 index a44475b49..000000000 --- a/mcp/reclass/classes/cluster/all-mcp-arch-common/aarch64/init.yml +++ /dev/null @@ -1,24 +0,0 @@ -############################################################################## -# Copyright (c) 2018 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: - salt_control_trusty_image: '' # Dummy value, to keep reclass 1.5.2 happy - salt_control_xenial_image: salt://salt/files/control/images/base_image_opnfv_fuel_vcp.img - - # VMs spawned on Foundation Node / Jump Host net ifaces (max 4) - opnfv_fn_vm_primary_interface: enp1s0 - opnfv_fn_vm_secondary_interface: enp2s0 - opnfv_fn_vm_tertiary_interface: enp3s0 - opnfv_fn_vm_quaternary_interface: enp4s0 - - # VCP VMs spawned on KVM Hosts net ifaces (max 3) - # NOTE(armband): Only x86 VCP VMs spawned via salt.control names differ - opnfv_vcp_vm_primary_interface: ${_param:opnfv_fn_vm_primary_interface} - opnfv_vcp_vm_secondary_interface: ${_param:opnfv_fn_vm_secondary_interface} - opnfv_vcp_vm_tertiary_interface: ${_param:opnfv_fn_vm_tertiary_interface} diff --git a/mcp/reclass/classes/cluster/all-mcp-arch-common/infra/config_dpdk_pdf.yml.j2 b/mcp/reclass/classes/cluster/all-mcp-arch-common/infra/config_dpdk_pdf.yml.j2 deleted file mode 100644 index 703d5350e..000000000 --- a/mcp/reclass/classes/cluster/all-mcp-arch-common/infra/config_dpdk_pdf.yml.j2 +++ /dev/null @@ -1,42 +0,0 @@ -############################################################################## -# Copyright (c) 2018 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 -############################################################################## -{%- import 'net_map.j2' as nm with context %} ---- -parameters: - reclass: - storage: - node: - # NOTE: Until SDF is in place, assume all computes are identical - openstack_compute_node01: &openstack_compute_node01 - params: -{#- No partial defaults, all or nothing. Defaults tuned for lf-pod2. #} -{%- if conf.idf.fuel.reclass is defined %} -{%- if conf.idf.fuel.reclass.node[nm.cmp001.idx].compute_params.dpdk is defined %} -{#- Can't dump json here due to dpdk0_* below, explicitly create yaml #} -{%- set _dpdk = conf.idf.fuel.reclass.node[nm.cmp001.idx].compute_params.dpdk %} -{%- for _i in _dpdk %} - {{ _i }}: '"{{ _dpdk[_i] }}"' -{%- endfor %} -{%- endif %} -{%- else %} - compute_hugepages_size: 2M - compute_hugepages_count: 8192 - compute_hugepages_mount: /mnt/hugepages_2M - compute_kernel_isolcpu: 2,3,10,11 - compute_dpdk_driver: uio - compute_ovs_pmd_cpu_mask: '"0xc04"' - compute_ovs_dpdk_socket_mem: '"2048,2048"' - compute_ovs_dpdk_lcore_mask: '"0x8"' - compute_ovs_memory_channels: '"2"' - dpdk0_driver: igb_uio - dpdk0_n_rxq: 2 -{%- endif %} - dpdk0_name: {{ nm.cmp001.nic_private }} - dpdk0_pci: '"{{ nm.cmp001.bus_private }}"' - openstack_compute_node02: - <<: *openstack_compute_node01 diff --git a/mcp/reclass/classes/cluster/all-mcp-arch-common/infra/config_pdf.yml.j2 b/mcp/reclass/classes/cluster/all-mcp-arch-common/infra/config_pdf.yml.j2 index fb25cc617..82d446b1f 100644 --- a/mcp/reclass/classes/cluster/all-mcp-arch-common/infra/config_pdf.yml.j2 +++ b/mcp/reclass/classes/cluster/all-mcp-arch-common/infra/config_pdf.yml.j2 @@ -7,27 +7,92 @@ ############################################################################## {%- import 'net_map.j2' as nm with context %} --- +classes: + - service.git.client + - system.linux.system.single + - system.linux.system.repo.mcp.salt + - system.reclass.storage.salt + - system.salt.master.api + - system.salt.master.pkg + - system.salt.minion.ca.salt_master parameters: + _param: + salt_master_environment_repository: "https://github.com/tcpcloud" + salt_master_environment_revision: master + reclass_data_repository: local + salt_master_base_environment: prd + # yamllint disable-line rule:line-length + salt_api_password_hash: "$6$sGnRlxGf$al5jMCetLP.vfI/fTl3Z0N7Za1aeiexL487jAtyRABVfT3NlwZxQGVhO7S1N8OwS/34VHYwZQA8lkXwKMN/GS1" + salt: + master: + accept_policy: open_mode + file_recv: true reclass: storage: + data_source: + engine: local node: - # NOTE: Until SDF is in place, assume all computes are identical - openstack_compute_node01: &openstack_compute_node01 + # We support per-node (not only per-role) compute configuration via IDF +{%- for cmp in range(1, nm.cmp_nodes + 1) %} + {%- set n = '%02d' | format(cmp) %} + {%- set i = nm.cmp001.idx + cmp - 1 %} + + {%- set admin = nm.net_admin_hosts | length + nm.start_ip[nm.net_admin] + loop.index %} + {%- set mgmt = nm.net_mgmt_hosts | length + nm.start_ip[nm.net_mgmt] + loop.index %} + {%- set pub = nm.net_public_hosts | length + nm.start_ip[nm.net_public] + loop.index %} + {%- set pri = nm.net_private_hosts | length + nm.start_ip[nm.net_private] + loop.index %} + openstack_compute_node{{ n }}: + name: cmp{{ '%03d' | format(cmp) }} + domain: ${_param:cluster_domain} + classes: + - cluster.${_param:cluster_name}.openstack.compute params: -{#- No partial defaults, all or nothing. Defaults tuned for lf-pod2. #} -{%- if conf.idf.fuel.reclass is defined %} -{%- if conf.idf.fuel.reclass.node[nm.cmp001.idx].compute_params.common is defined %} -{%- set _common = conf.idf.fuel.reclass.node[nm.cmp001.idx].compute_params.common %} -{%- for _i in _common %} + pxe_admin_address: {{ nm.net_admin | ipnet_hostaddr(admin) }} + control_address: {{ nm.net_mgmt | ipnet_hostaddr(mgmt) }} + tenant_address: {{ nm.net_private | ipnet_hostaddr(pri) }} + external_address: {{ nm.net_public | ipnet_hostaddr(pub) }} + salt_master_host: ${_param:reclass_config_master} + linux_system_codename: xenial + + {#- No partial defaults, all or nothing. Defaults tuned for lf-pod2. #} + {%- if 'dpdk' in conf.cluster.domain %} + {%- if conf.idf.fuel.reclass is defined %} + {%- if conf.idf.fuel.reclass.node[i].compute_params.dpdk is defined %} + {#- Can't dump json here due to dpdk0_* below, explicitly create yaml #} + {%- set _dpdk = conf.idf.fuel.reclass.node[i].compute_params.dpdk %} + {%- for _i in _dpdk %} + {{ _i }}: '"{{ _dpdk[_i] }}"' + {%- endfor %} + {%- endif %} + {%- else %} + compute_hugepages_size: 2M + compute_hugepages_count: 8192 + compute_hugepages_mount: /mnt/hugepages_2M + compute_kernel_isolcpu: 2,3,10,11 + compute_dpdk_driver: uio + compute_ovs_pmd_cpu_mask: '"0xc04"' + compute_ovs_dpdk_socket_mem: '"2048,2048"' + compute_ovs_dpdk_lcore_mask: '"0x8"' + compute_ovs_memory_channels: '"2"' + dpdk0_driver: igb_uio + dpdk0_n_rxq: 2 + {%- endif %} + dpdk0_name: {{ conf.idf.fuel.network.node[i].interfaces[nm.idx_private] }} + dpdk0_pci: '"{{ conf.idf.fuel.network.node[i].busaddr[nm.idx_private] }}"' + {%- else %} + {%- if conf.idf.fuel.reclass is defined %} + {%- if conf.idf.fuel.reclass.node[i].compute_params.common is defined %} + {%- set _common = conf.idf.fuel.reclass.node[i].compute_params.common %} + {%- for _i in _common %} {{ _i }}: '"{{ _common[_i] }}"' -{%- endfor %} -{%- else %} + {%- endfor %} + {%- else %} dummy_value: ~ -{%- endif %} -{%- else %} + {%- endif %} + {%- else %} compute_hugepages_size: 1G compute_hugepages_count: 16 compute_hugepages_mount: /mnt/hugepages_1G -{%- endif %} - openstack_compute_node02: - <<: *openstack_compute_node01 + {%- endif %} + {%- endif %} +{%- endfor %} diff --git a/mcp/reclass/classes/cluster/all-mcp-arch-common/init.yml b/mcp/reclass/classes/cluster/all-mcp-arch-common/init.yml deleted file mode 100644 index f9aeb71ad..000000000 --- a/mcp/reclass/classes/cluster/all-mcp-arch-common/init.yml +++ /dev/null @@ -1,11 +0,0 @@ -############################################################################## -# Copyright (c) 2018 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.all-mcp-arch-common.arch - - cluster.all-mcp-arch-common.opnfv diff --git a/mcp/reclass/classes/cluster/all-mcp-arch-common/init.yml.j2 b/mcp/reclass/classes/cluster/all-mcp-arch-common/init.yml.j2 new file mode 100644 index 000000000..19475c717 --- /dev/null +++ b/mcp/reclass/classes/cluster/all-mcp-arch-common/init.yml.j2 @@ -0,0 +1,41 @@ +############################################################################## +# Copyright (c) 2018 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.all-mcp-arch-common.opnfv +parameters: + _param: + salt_control_trusty_image: '' # Dummy value, to keep reclass 1.5.2 happy + salt_control_xenial_image: salt://salt/files/control/images/base_image_opnfv_fuel_vcp.img + + # VMs spawned on Foundation Node / Jump Host net ifaces (max 4) + # VCP VMs spawned on KVM Hosts net ifaces (max 3) + # NOTE(armband): Only x86 VCP VMs spawned via salt.control names differ + +{%- if conf.MCP_JUMP_ARCH == 'aarch64' %} + opnfv_fn_vm_primary_interface: enp1s0 + opnfv_fn_vm_secondary_interface: enp2s0 + opnfv_fn_vm_tertiary_interface: enp3s0 + opnfv_fn_vm_quaternary_interface: enp4s0 + + opnfv_vcp_vm_primary_interface: ${_param:opnfv_fn_vm_primary_interface} + opnfv_vcp_vm_secondary_interface: ${_param:opnfv_fn_vm_secondary_interface} + opnfv_vcp_vm_tertiary_interface: ${_param:opnfv_fn_vm_tertiary_interface} +{%- else %} + opnfv_fn_vm_primary_interface: ens3 + opnfv_fn_vm_secondary_interface: ens4 + opnfv_fn_vm_tertiary_interface: ens5 + opnfv_fn_vm_quaternary_interface: ens6 + + opnfv_vcp_vm_primary_interface: ens2 + opnfv_vcp_vm_secondary_interface: ens3 + opnfv_vcp_vm_tertiary_interface: ens4 +{%- endif %} + + ntp_strata_host1: {{ conf.idf.fuel.network.ntp_strata_host1 or '1.pool.ntp.org' }} + ntp_strata_host2: {{ conf.idf.fuel.network.ntp_strata_host2 or '0.pool.ntp.org' }} diff --git a/mcp/reclass/classes/cluster/all-mcp-arch-common/opnfv/init.yml b/mcp/reclass/classes/cluster/all-mcp-arch-common/opnfv/init.yml deleted file mode 100644 index 9a47b1c63..000000000 --- a/mcp/reclass/classes/cluster/all-mcp-arch-common/opnfv/init.yml +++ /dev/null @@ -1,11 +0,0 @@ -############################################################################## -# Copyright (c) 2018 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.all-mcp-arch-common.opnfv.runtime - - cluster.all-mcp-arch-common.opnfv.pod_config diff --git a/mcp/reclass/classes/cluster/all-mcp-arch-common/opnfv/init.yml.j2 b/mcp/reclass/classes/cluster/all-mcp-arch-common/opnfv/init.yml.j2 new file mode 100644 index 000000000..894d3bcc6 --- /dev/null +++ b/mcp/reclass/classes/cluster/all-mcp-arch-common/opnfv/init.yml.j2 @@ -0,0 +1,29 @@ +############################################################################## +# Copyright (c) 2018 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 +############################################################################## +{%- import 'net_map.j2' as nm with context %} +--- +parameters: + _param: + opnfv_net_admin_mask: {{ nm.net_admin | ipnet_netmask }} + opnfv_net_mgmt_mask: {{ nm.net_admin | ipnet_netmask }} + opnfv_net_private_mask: {{ nm.net_admin | ipnet_netmask }} + opnfv_net_public_mask: {{ nm.net_public | ipnet_netmask }} + + opnfv_net_public: {{ nm.net_public }} + opnfv_net_public_gw: {{ nm.net_public_gw }} + opnfv_net_public_pool_start: {{ nm.net_public_pool_start }} + opnfv_net_public_pool_end: {{ nm.net_public_pool_end }} + + opnfv_net_tenant_vlan: "{{ nm.vlan_private | string | replace('-', ':') }}" + +{%- for network in nm.networks %} +{%- for key in nm.hosts[network] %} +{%- set i = loop.index + nm.start_ip[network] %} + {{key}}: {{ network | ipnet_hostaddr(i) }} +{%- endfor %} +{%- endfor %} diff --git a/mcp/reclass/classes/cluster/all-mcp-arch-common/opnfv/runtime.yml.j2 b/mcp/reclass/classes/cluster/all-mcp-arch-common/opnfv/runtime.yml.j2 deleted file mode 100644 index d6f5aa965..000000000 --- a/mcp/reclass/classes/cluster/all-mcp-arch-common/opnfv/runtime.yml.j2 +++ /dev/null @@ -1,15 +0,0 @@ -############################################################################## -# Copyright (c) 2018 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 -############################################################################## ---- -{#- conf.MCPCONTROL_NET & co are mandatory, defaults are set via globals.sh #} -parameters: - _param: - opnfv_salt_master_ip: {{ conf.SALT_MASTER }} - opnfv_maas_mcp_address: {{ conf.MAAS_IP }} - opnfv_net_mcpcontrol: {{ conf.MCPCONTROL_NET }} - opnfv_net_mcpcontrol_mask: {{ conf.MCPCONTROL_PREFIX | netmask }} diff --git a/mcp/reclass/classes/cluster/all-mcp-arch-common/x86_64/init.yml b/mcp/reclass/classes/cluster/all-mcp-arch-common/x86_64/init.yml deleted file mode 100644 index a62dd04e0..000000000 --- a/mcp/reclass/classes/cluster/all-mcp-arch-common/x86_64/init.yml +++ /dev/null @@ -1,24 +0,0 @@ -############################################################################## -# Copyright (c) 2018 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: - salt_control_trusty_image: '' # Dummy value, to keep reclass 1.5.2 happy - salt_control_xenial_image: salt://salt/files/control/images/base_image_opnfv_fuel_vcp.img - - # VMs spawned on Foundation Node / Jump Host net ifaces (max 4) - opnfv_fn_vm_primary_interface: ens3 - opnfv_fn_vm_secondary_interface: ens4 - opnfv_fn_vm_tertiary_interface: ens5 - opnfv_fn_vm_quaternary_interface: ens6 - - # VCP VMs spawned on KVM Hosts net ifaces (max 3) - # NOTE(armband): Only x86 VCP VMs spawned via salt.control names differ - opnfv_vcp_vm_primary_interface: ens2 - opnfv_vcp_vm_secondary_interface: ens3 - opnfv_vcp_vm_tertiary_interface: ens4 diff --git a/mcp/reclass/classes/cluster/mcp-common-ha/include/maas_proxy.yml b/mcp/reclass/classes/cluster/mcp-common-ha/include/maas_proxy.yml deleted file mode 100644 index e5b263fe8..000000000 --- a/mcp/reclass/classes/cluster/mcp-common-ha/include/maas_proxy.yml +++ /dev/null @@ -1,25 +0,0 @@ -############################################################################## -# Copyright (c) 2018 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: - # NOTE: Apt proxy is set by curtin, Salt minion proxy is configured below, - # only enable proxy via /etc/environment if you need it for smth else - # linux: - # system: - # env: - # http_proxy: http://${_param:infra_maas_node01_deploy_address}:8000 - # https_proxy: http://${_param:infra_maas_node01_deploy_address}:8000 - # no_proxy: - # - .local - linux: - system: - proxy: - pkg: - enabled: true - http: http://${_param:infra_maas_node01_deploy_address}:8000 - https: http://${_param:infra_maas_node01_deploy_address}:8000 diff --git a/mcp/reclass/classes/cluster/mcp-common-ha/include/maas_proxy.yml.j2 b/mcp/reclass/classes/cluster/mcp-common-ha/include/maas_proxy.yml.j2 new file mode 100644 index 000000000..58ea46cad --- /dev/null +++ b/mcp/reclass/classes/cluster/mcp-common-ha/include/maas_proxy.yml.j2 @@ -0,0 +1,27 @@ +############################################################################## +# Copyright (c) 2018 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 +############################################################################## +--- +{%- if 'maas' in conf.cluster.states %} +parameters: + # NOTE: Apt proxy is set by curtin, Salt minion proxy is configured below, + # only enable proxy via /etc/environment if you need it for smth else + # linux: + # system: + # env: + # http_proxy: http://${_param:infra_maas_node01_deploy_address}:8000 + # https_proxy: http://${_param:infra_maas_node01_deploy_address}:8000 + # no_proxy: + # - .local + linux: + system: + proxy: + pkg: + enabled: true + http: http://${_param:infra_maas_node01_deploy_address}:8000 + https: http://${_param:infra_maas_node01_deploy_address}:8000 +{%- endif %} diff --git a/mcp/reclass/classes/cluster/mcp-common-ha/infra/config.yml b/mcp/reclass/classes/cluster/mcp-common-ha/infra/config.yml deleted file mode 100644 index 208393e52..000000000 --- a/mcp/reclass/classes/cluster/mcp-common-ha/infra/config.yml +++ /dev/null @@ -1,175 +0,0 @@ -############################################################################## -# Copyright (c) 2018 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: - - service.git.client - - system.linux.system.single - - system.linux.system.repo.mcp.salt - - system.linux.system.repo.saltstack.xenial - - system.salt.master.api - - system.salt.master.pkg - - system.salt.minion.ca.salt_master - - system.reclass.storage.salt - - system.reclass.storage.system.physical_control_cluster - - system.reclass.storage.system.openstack_control_cluster - - system.reclass.storage.system.openstack_proxy_cluster - - system.reclass.storage.system.openstack_database_cluster - - system.reclass.storage.system.openstack_message_queue_cluster - - system.reclass.storage.system.openstack_telemetry_cluster - # - system.reclass.storage.system.stacklight_log_cluster - # - system.reclass.storage.system.stacklight_monitor_cluster - # - system.reclass.storage.system.stacklight_telemetry_cluster - - system.reclass.storage.system.infra_maas_single - - cluster.mcp-common-ha.include.lab_proxy_pdf -parameters: - _param: - salt_master_base_environment: prd - reclass_data_repository: local - salt_master_environment_repository: "https://github.com/tcpcloud" - salt_master_environment_revision: master - single_address: ${_param:infra_config_address} - deploy_address: ${_param:infra_config_deploy_address} - pxe_address: ${_param:opnfv_infra_config_pxe_address} - salt_master_host: ${_param:infra_config_deploy_address} - # yamllint disable rule:line-length - salt_api_password_hash: "$6$sGnRlxGf$al5jMCetLP.vfI/fTl3Z0N7Za1aeiexL487jAtyRABVfT3NlwZxQGVhO7S1N8OwS/34VHYwZQA8lkXwKMN/GS1" - dhcp_nic: ${_param:opnfv_fn_vm_primary_interface} - single_nic: ${_param:opnfv_fn_vm_secondary_interface} - pxe_nic: ${_param:opnfv_fn_vm_tertiary_interface} - linux: - network: - interface: - dhcp: - enabled: true - type: eth - proto: dhcp - name: ${_param:dhcp_nic} - single: - enabled: true - type: eth - proto: static - name: ${_param:single_nic} - address: ${_param:single_address} - netmask: 255.255.255.0 - pxe: - enabled: true - type: eth - proto: static - name: ${_param:pxe_nic} - address: ${_param:pxe_address} - netmask: 255.255.255.0 - salt: - master: - accept_policy: open_mode - file_recv: true - worker_threads: 8 - command_timeout: 20 - reclass: - storage: - data_source: - engine: local - node: - infra_kvm_node01: - params: - keepalived_vip_priority: 100 - linux_system_codename: xenial - infra_kvm_node02: - params: - keepalived_vip_priority: 101 - linux_system_codename: xenial - infra_kvm_node03: - params: - keepalived_vip_priority: 102 - linux_system_codename: xenial - openstack_telemetry_node01: - params: - linux_system_codename: xenial - # create resources only from 1 controller - # to prevent race conditions - ceilometer_create_gnocchi_resources: true - redis_cluster_role: 'master' - openstack_telemetry_node02: - params: - linux_system_codename: xenial - redis_cluster_role: 'slave' - openstack_telemetry_node03: - params: - linux_system_codename: xenial - redis_cluster_role: 'slave' - openstack_message_queue_node01: - params: - linux_system_codename: xenial - openstack_message_queue_node02: - params: - linux_system_codename: xenial - openstack_message_queue_node03: - params: - linux_system_codename: xenial - openstack_proxy_node01: - params: - linux_system_codename: xenial - openstack_proxy_node02: - params: - linux_system_codename: xenial - # stacklight_log_node01: - # classes: - # - system.elasticsearch.client.single - # stacklight_monitor_node01: - # classes: - # - system.grafana.client.single - # - system.kibana.client.single - openstack_control_node01: - classes: - - cluster.mcp-common-ha.openstack_control_init - params: - linux_system_codename: xenial - # NOTE: When VCP is present, external_address is not used - external_address: ${_param:openstack_proxy_node01_address} - openstack_control_node02: - params: - linux_system_codename: xenial - external_address: 0.0.0.0 - openstack_control_node03: - params: - linux_system_codename: xenial - external_address: ${_param:openstack_proxy_node02_address} - openstack_database_node01: - classes: - - cluster.mcp-common-ha.openstack_database_init - params: - linux_system_codename: xenial - openstack_database_node02: - params: - linux_system_codename: xenial - openstack_database_node03: - params: - linux_system_codename: xenial - openstack_compute_node01: - name: ${_param:openstack_compute_node01_hostname} - domain: ${_param:cluster_domain} - classes: - - cluster.${_param:cluster_name}.openstack.compute - params: - salt_master_host: ${_param:reclass_config_master} - linux_system_codename: xenial - control_address: ${_param:openstack_compute_node01_control_address} - single_address: ${_param:openstack_compute_node01_single_address} - tenant_address: ${_param:openstack_compute_node01_tenant_address} - external_address: ${_param:openstack_compute_node01_external_address} - openstack_compute_node02: - name: ${_param:openstack_compute_node02_hostname} - domain: ${_param:cluster_domain} - classes: - - cluster.${_param:cluster_name}.openstack.compute - params: - salt_master_host: ${_param:reclass_config_master} - linux_system_codename: xenial - control_address: ${_param:openstack_compute_node02_control_address} - single_address: ${_param:openstack_compute_node02_single_address} - tenant_address: ${_param:openstack_compute_node02_tenant_address} - external_address: ${_param:openstack_compute_node02_external_address} diff --git a/mcp/reclass/classes/cluster/mcp-common-ha/infra/config.yml.j2 b/mcp/reclass/classes/cluster/mcp-common-ha/infra/config.yml.j2 new file mode 100644 index 000000000..f6e0baa11 --- /dev/null +++ b/mcp/reclass/classes/cluster/mcp-common-ha/infra/config.yml.j2 @@ -0,0 +1,160 @@ +############################################################################## +# Copyright (c) 2018 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 +############################################################################## +{%- import 'net_map.j2' as nm with context %} +--- +classes: + - system.linux.system.repo.saltstack.xenial + - system.reclass.storage.system.physical_control_cluster + - system.reclass.storage.system.openstack_control_cluster + - system.reclass.storage.system.openstack_proxy_cluster + - system.reclass.storage.system.openstack_database_cluster + - system.reclass.storage.system.openstack_message_queue_cluster + - system.reclass.storage.system.openstack_telemetry_cluster + # - system.reclass.storage.system.stacklight_log_cluster + # - system.reclass.storage.system.stacklight_monitor_cluster + # - system.reclass.storage.system.stacklight_telemetry_cluster + - system.reclass.storage.system.infra_maas_single + - cluster.mcp-common-ha.include.lab_proxy_pdf + - cluster.all-mcp-arch-common.infra.config_pdf +parameters: + _param: + salt_master_host: ${_param:infra_config_deploy_address} + single_address: ${_param:infra_config_address} + deploy_address: ${_param:infra_config_deploy_address} + pxe_admin_address: ${_param:opnfv_infra_config_pxe_admin_address} + mcpcontrol_nic: ${_param:opnfv_fn_vm_primary_interface} + single_nic: ${_param:opnfv_fn_vm_secondary_interface} + pxe_admin_nic: ${_param:opnfv_fn_vm_tertiary_interface} + linux: + network: + interface: + mcpcontrol_int: + enabled: true + type: eth + proto: dhcp + name: ${_param:mcpcontrol_nic} + single: + enabled: true + type: eth + proto: static + name: ${_param:single_nic} + address: ${_param:single_address} + netmask: ${_param:opnfv_net_mgmt_mask} + pxe_admin_int: + enabled: true + type: eth + proto: static + name: ${_param:pxe_admin_nic} + address: ${_param:pxe_admin_address} + netmask: ${_param:opnfv_net_admin_mask} + salt: + master: + accept_policy: open_mode + file_recv: true + worker_threads: 8 + command_timeout: 20 + reclass: + storage: + node: + # NOTE: compute nodes definitions are defined in + infra_kvm_node01: + params: + keepalived_vip_priority: 100 + linux_system_codename: xenial + pxe_admin_address: ${_param:opnfv_infra_kvm_node01_pxe_admin_address} + infra_kvm_node02: +{%- if not conf.MCP_VCP %} + classes: + - cluster.mcp-common-ha.infra.kvm_novcp +{%- endif %} + params: + keepalived_vip_priority: 101 + linux_system_codename: xenial + pxe_admin_address: ${_param:opnfv_infra_kvm_node02_pxe_admin_address} + infra_kvm_node03: + params: + keepalived_vip_priority: 102 + linux_system_codename: xenial + pxe_admin_address: ${_param:opnfv_infra_kvm_node03_pxe_admin_address} + openstack_telemetry_node01: + params: + linux_system_codename: xenial + # create resources only from 1 controller + # to prevent race conditions + ceilometer_create_gnocchi_resources: true + redis_cluster_role: 'master' + pxe_admin_address: ${_param:opnfv_openstack_telemetry_node01_pxe_admin_address} + openstack_telemetry_node02: + params: + linux_system_codename: xenial + redis_cluster_role: 'slave' + pxe_admin_address: ${_param:opnfv_openstack_telemetry_node02_pxe_admin_address} + openstack_telemetry_node03: + params: + linux_system_codename: xenial + redis_cluster_role: 'slave' + pxe_admin_address: ${_param:opnfv_openstack_telemetry_node03_pxe_admin_address} + openstack_message_queue_node01: + params: + linux_system_codename: xenial + pxe_admin_address: ${_param:opnfv_openstack_message_queue_node01_pxe_admin_address} + openstack_message_queue_node02: + params: + linux_system_codename: xenial + pxe_admin_address: ${_param:opnfv_openstack_message_queue_node02_pxe_admin_address} + openstack_message_queue_node03: + params: + linux_system_codename: xenial + pxe_admin_address: ${_param:opnfv_openstack_message_queue_node03_pxe_admin_address} + openstack_proxy_node01: + params: + linux_system_codename: xenial + pxe_admin_address: ${_param:opnfv_openstack_proxy_node01_pxe_admin_address} + openstack_proxy_node02: + params: + linux_system_codename: xenial + pxe_admin_address: ${_param:opnfv_openstack_proxy_node02_pxe_admin_address} + # stacklight_log_node01: + # classes: + # - system.elasticsearch.client.single + # stacklight_monitor_node01: + # classes: + # - system.grafana.client.single + # - system.kibana.client.single + openstack_control_node01: + classes: + - cluster.mcp-common-ha.openstack_control_init + params: + linux_system_codename: xenial + # NOTE: When VCP is present, external_address is not used + external_address: ${_param:openstack_proxy_node01_address} + pxe_admin_address: ${_param:opnfv_openstack_control_node01_pxe_admin_address} + openstack_control_node02: + params: + linux_system_codename: xenial + external_address: 0.0.0.0 + pxe_admin_address: ${_param:opnfv_openstack_control_node02_pxe_admin_address} + openstack_control_node03: + params: + linux_system_codename: xenial + external_address: ${_param:openstack_proxy_node02_address} + pxe_admin_address: ${_param:opnfv_openstack_control_node03_pxe_admin_address} + openstack_database_node01: + classes: + - cluster.mcp-common-ha.openstack_database_init + params: + linux_system_codename: xenial + pxe_admin_address: ${_param:opnfv_openstack_database_node01_pxe_admin_address} + openstack_database_node02: + params: + linux_system_codename: xenial + pxe_admin_address: ${_param:opnfv_openstack_database_node02_pxe_admin_address} + openstack_database_node03: + params: + linux_system_codename: xenial + pxe_admin_address: ${_param:opnfv_openstack_database_node03_pxe_admin_address} diff --git a/mcp/reclass/classes/cluster/mcp-common-ha/infra/init.yml.j2 b/mcp/reclass/classes/cluster/mcp-common-ha/infra/init.yml.j2 index 8c601f61b..c01042f54 100644 --- a/mcp/reclass/classes/cluster/mcp-common-ha/infra/init.yml.j2 +++ b/mcp/reclass/classes/cluster/mcp-common-ha/infra/init.yml.j2 @@ -19,14 +19,14 @@ parameters: cluster_domain: ${_param:cluster_name}.local # stacklight_environment: ${_param:cluster_domain} reclass_data_revision: master - reclass_config_master: ${_param:opnfv_infra_config_pxe_address} + reclass_config_master: ${_param:opnfv_infra_config_pxe_admin_address} cluster_public_host: ${_param:openstack_proxy_address} infra_config_hostname: cfg01 infra_maas_database_password: opnfv_secret # infra service addresses infra_config_address: ${_param:opnfv_infra_config_address} - infra_config_deploy_address: ${_param:opnfv_salt_master_ip} + infra_config_deploy_address: {{ conf.SALT_MASTER }} infra_maas_node01_address: ${_param:opnfv_infra_maas_node01_address} infra_maas_node01_deploy_address: ${_param:opnfv_infra_maas_node01_deploy_address} @@ -47,9 +47,6 @@ parameters: infra_kvm_node02_hostname: kvm02 infra_kvm_node03_hostname: kvm03 - ntp_strata_host1: 1.pool.ntp.org - ntp_strata_host2: 0.pool.ntp.org - # Interface definitions reclass: storage: @@ -64,9 +61,11 @@ parameters: openstack_proxy_node01: params: control_address: ${_param:openstack_proxy_node01_control_address} + pxe_admin_address: ${_param:opnfv_openstack_proxy_node01_pxe_admin_address} openstack_proxy_node02: params: control_address: ${_param:openstack_proxy_node02_control_address} + pxe_admin_address: ${_param:opnfv_openstack_proxy_node02_pxe_admin_address} linux: system: apt: diff --git a/mcp/reclass/classes/cluster/mcp-common-ha/infra/kvm_novcp.yml.j2 b/mcp/reclass/classes/cluster/mcp-common-ha/infra/kvm_novcp.yml.j2 new file mode 100644 index 000000000..8959a7856 --- /dev/null +++ b/mcp/reclass/classes/cluster/mcp-common-ha/infra/kvm_novcp.yml.j2 @@ -0,0 +1,19 @@ +############################################################################## +# Copyright (c) 2018 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 +############################################################################## +{#- NOTE: br-{mgmt,ctl} are cross-referenced, careful when changing names #} +{#- This class should only be inherited in NOVCP scenarios for kvm02 #} +{%- import 'net_map.j2' as nm with context %} +--- +parameters: + linux: + network: + interface: + br-mgmt: + gateway: {{ nm.net_admin_gw }} + name_servers: + - {{ nm.net_admin_gw }} diff --git a/mcp/reclass/classes/cluster/mcp-common-ha/infra/kvm_pdf.yml.j2 b/mcp/reclass/classes/cluster/mcp-common-ha/infra/kvm_pdf.yml.j2 index 97166c62c..6754d13dd 100644 --- a/mcp/reclass/classes/cluster/mcp-common-ha/infra/kvm_pdf.yml.j2 +++ b/mcp/reclass/classes/cluster/mcp-common-ha/infra/kvm_pdf.yml.j2 @@ -7,60 +7,52 @@ ############################################################################## {#- NOTE: br-{mgmt,ctl} are cross-referenced, careful when changing names #} {%- import 'net_map.j2' as nm with context %} +{%- import 'net_macros.j2' as ma with context %} {#- Filter-out NIC duplicates by constructing a dict (used NICs only) #} {%- set nics = { nm.ctl01.nic_admin: True, nm.ctl01.nic_mgmt: True, nm.ctl01.nic_public: True } %} {%- set vlans = { nm.vlan_admin: nm.ctl01.nic_admin, nm.vlan_mgmt: nm.ctl01.nic_mgmt, nm.vlan_public: nm.ctl01.nic_public } %} --- parameters: + _param: + interface_mtu: 1500 linux: network: interface: -{%- for nic in nics %} - {{ nic }}: - enabled: true - type: eth - proto: manual - address: 0.0.0.0 - netmask: 255.255.255.0 - name: {{ nic }} - noifupdown: true -{%- endfor %} -{%- for vlan in vlans %} - {%- if vlan | int > 0 %} - {{ vlans[vlan] }}.{{ vlan }}: - enabled: true - proto: manual - type: vlan - name: {{ vlans[vlan] }}.{{ vlan }} - use_interfaces: - - {{ vlans[vlan] }} - noifupdown: true - {%- endif %} -{%- endfor %} +{{ ma.linux_network_interfaces_nic(nics) }} + +{{ ma.linux_network_interfaces_vlan(vlans) }} br-mgmt: enabled: true - proto: dhcp + proto: static + address: ${_param:pxe_admin_address} + netmask: ${_param:opnfv_net_admin_mask} +{%- if conf.MCP_VCP %} +{#- For NOVCP scenarios, kvm02 gateway will be added via kvm_novcp class #} + gateway: {{ nm.net_admin_gw }} + name_servers: + - {{ nm.net_admin_gw }} +{%- endif %} type: bridge use_interfaces: - - {{ nm.ctl01.nic_admin }}{% if nm.vlan_admin | int > 0 %}.{{ nm.vlan_admin }}{% endif %} + - {{ ma.interface_str(nm.ctl01.nic_admin, nm.vlan_admin) }} noifupdown: true br-ctl: enabled: true type: bridge proto: static address: ${_param:single_address} - netmask: 255.255.255.0 + netmask: ${_param:opnfv_net_mgmt_mask} use_interfaces: - - {{ nm.ctl01.nic_mgmt }}{% if nm.vlan_mgmt | int > 0 %}.{{ nm.vlan_mgmt }}{% endif %} + - {{ ma.interface_str(nm.ctl01.nic_mgmt, nm.vlan_mgmt) }} noifupdown: true +{#- For NOVCP scenarios, kvm{01,03} external gateway will be added via triport class #} br-ex: enabled: true proto: manual - address: 0.0.0.0 netmask: ${_param:opnfv_net_public_mask} type: bridge use_interfaces: - - {{ nm.ctl01.nic_public }}{% if nm.vlan_public | int > 0 %}.{{ nm.vlan_public }}{% endif %} + - {{ ma.interface_str(nm.ctl01.nic_public, nm.vlan_public) }} noifupdown: true diff --git a/mcp/reclass/classes/cluster/mcp-common-ha/infra/maas.yml b/mcp/reclass/classes/cluster/mcp-common-ha/infra/maas.yml deleted file mode 100644 index 36c674b85..000000000 --- a/mcp/reclass/classes/cluster/mcp-common-ha/infra/maas.yml +++ /dev/null @@ -1,69 +0,0 @@ -############################################################################## -# Copyright (c) 2018 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.maas.region.single - - service.maas.cluster.single - - cluster.mcp-common-ha.include.lab_proxy_pdf - - cluster.mcp-common-ha.infra.maas_pdf -parameters: - _param: - dhcp_interface: ${_param:opnfv_fn_vm_primary_interface} - primary_interface: ${_param:opnfv_fn_vm_secondary_interface} - pxe_interface: ${_param:opnfv_fn_vm_tertiary_interface} - interface_mtu: 1500 - # MaaS has issues using MTU > 1500 for PXE interface - pxe_interface_mtu: 1500 - linux_system_codename: xenial - maas_admin_username: opnfv - maas_admin_password: opnfv_secret - maas_db_password: opnfv_secret - dns_server01: ${_param:opnfv_dns_server01} - single_address: ${_param:infra_maas_node01_deploy_address} - hwe_kernel: 'hwe-16.04' - maas: - region: - salt_master_ip: ${_param:reclass_config_master} - domain: ${_param:cluster_domain} - maas_config: - commissioning_distro_series: 'xenial' - default_distro_series: 'xenial' - default_osystem: 'ubuntu' - default_storage_layout: 'lvm' - enable_http_proxy: true - disk_erase_with_secure_erase: false - dnssec_validation: 'no' - enable_third_party_drivers: true - network_discovery: 'enabled' - default_min_hwe_kernel: ${_param:hwe_kernel} - cluster: - saltstack_repo_xenial: "http://repo.saltstack.com/apt/ubuntu/16.04/amd64/2016.11/ xenial main" - linux: - network: - interface: - dhcp_interface: - enabled: true - name: ${_param:dhcp_interface} - type: eth - proto: dhcp - primary_interface: - enabled: true - name: ${_param:primary_interface} - mtu: ${_param:interface_mtu} - proto: static - address: ${_param:infra_maas_node01_address} - netmask: 255.255.255.0 - type: eth - pxe_interface: - enabled: true - name: ${_param:pxe_interface} - mtu: ${_param:pxe_interface_mtu} - proto: static - address: ${_param:single_address} - netmask: 255.255.255.0 - type: eth diff --git a/mcp/reclass/classes/cluster/mcp-common-ha/infra/maas.yml.j2 b/mcp/reclass/classes/cluster/mcp-common-ha/infra/maas.yml.j2 new file mode 100644 index 000000000..bafdcf302 --- /dev/null +++ b/mcp/reclass/classes/cluster/mcp-common-ha/infra/maas.yml.j2 @@ -0,0 +1,149 @@ +############################################################################## +# Copyright (c) 2018 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 +############################################################################## +{%- import 'net_map.j2' as nm with context %} +--- +# NOTE: pod_config is generated and transferred into its final location on +# cfg01 only during deployment to prevent leaking sensitive data +classes: + - system.maas.region.single + - service.maas.cluster.single + - cluster.mcp-common-ha.include.lab_proxy_pdf + - cluster.all-mcp-arch-common.opnfv.pod_config +parameters: + _param: + mcpcontrol_interface: ${_param:opnfv_fn_vm_primary_interface} + primary_interface: ${_param:opnfv_fn_vm_secondary_interface} + pxe_admin_interface: ${_param:opnfv_fn_vm_tertiary_interface} + interface_mtu: 1500 + # MaaS has issues using MTU > 1500 for PXE interface + pxe_admin_interface_mtu: 1500 + linux_system_codename: xenial + maas_admin_username: opnfv + maas_admin_password: opnfv_secret + maas_db_password: opnfv_secret + dns_server01: '{{ nm.dns_public[0] }}' + single_address: ${_param:infra_maas_node01_deploy_address} + hwe_kernel: 'hwe-16.04' + opnfv_maas_timeout_comissioning: {{ nm.maas_timeout_comissioning }} + opnfv_maas_timeout_deploying: {{ nm.maas_timeout_deploying }} + maas: + region: + subnets: + {{ nm.net_admin }}: + name: {{ nm.net_admin }} + cidr: {{ nm.net_admin }} + gateway_ip: ${_param:single_address} + iprange: + start: {{ nm.net_admin_pool_start }} + end: {{ nm.net_admin_pool_end }} + type: dynamic + vlans: + untagged: + vid: 0 + dhcp_on: true + primary_rack: ${_param:infra_maas_node01_hostname} + # Space-separated list of dpkg architectures to be supported by MaaS + opnfv_arches:{%- for arch in nm.cluster.arch %} {{ arch | dpkg_arch }}{%- endfor %} + sshprefs: + - '{{ conf.MAAS_SSH_KEY }}' +{%- if 'aarch64' in nm.cluster.arch %} + package_repositories: + armband: + name: armband + enabled: '1' + url: 'http://linux.enea.com/mcp-repos/${_param:openstack_version}/${_param:linux_system_codename}' + distributions: '${_param:openstack_version}-armband' + components: 'main' + arches: 'arm64' + key: &armband_key | + -----BEGIN PGP PUBLIC KEY BLOCK----- + Version: GnuPG v2.0.14 (GNU/Linux) + + mQENBFagAroBCADWboNIjuF6lB1mWv2+EbvqY3lKl5mLKhr2DnSUkKeHUPBv8gNM + qK8Q00AMIyPiyEhgjA+dWizZ+5aBgxoiY7oMeLJ2Xym36U/8SYq2BWd3SGCbMNoz + SJDxDUSM/HFVs6atF1M3DY9oN65hSVnu4uy5Tu6asf6k4rhAyk0z4+pRcPBCu2vq + mnGi3COM/+9PShrEKeVOx5W2vRJywUFuq8EDvQnRoJ0GvM28JiJIanw17YwIPxhg + BKZVpZjan5X+ihVMXwA2h/G/FS5Omhd50RqV6LWSYs94VJJgYqHx8UMm7izcxI+P + ct3IcbD195bPbJ+SbuiFe45ZLsdY1MyGiU2BABEBAAG0K0VuZWEgQXJtYmFuZCBE + ZXZvcHMgVGVhbSA8YXJtYmFuZEBlbmVhLmNvbT6JATgEEwECACICGwMGCwkIBwMC + BhUIAgkKCwQWAgMBAh4BAheABQJaY3bYAAoJEN6rkLp5irHRoQMH/0PYl0A/6eWw + nQ/szhEFrr76Ln6wA4vEO+PiuWj9kTkZM2NaCnkisrIuHSPIVvOLfFmztbE6sKGe + t+a2b7Jqw48DZ/gq508aZE4Q307ookxdCOrzIu/796hFO34yXg3sqZoJh3VmKIjY + 4DL8yG1iAiQ5vOw3IFWQnATwIZUgaCcjmE7HGap+9ePuJfFuQ8mIG5cy28t8qocx + AB/B2tucfBMwomYxKqgbLI5AG7iSt58ajvrrNa9f8IX7Ihj/jiuXhUwX+geEp98K + IWVI1ftEthZvfBpZW4BS98J4z//dEPi31L4jb9RQXq3afF2RpXchDeUN85bW45nu + W/9PMAlgE/U= + =m+zE + -----END PGP PUBLIC KEY BLOCK----- +{%- endif %} + machines: + {%- set pxe_interface = conf.idf.net_config.admin.interface %} + {#- We only support exactly 5 nodes for now, hardcoded order #} + {%- set node_roles = ['kvm01', 'kvm02', 'kvm03', 'cmp001', 'cmp002'] %} + {%- for node in conf.nodes %} + {%- if node.node.type == 'baremetal' %} + {{ node_roles[loop.index0] }}: + interface: + mac: {{ node.interfaces[pxe_interface].mac_address }} + power_parameters: + power_address: {{ node.remote_management.address.rsplit('/')[0] }} + power_password: {{ node.remote_management.pass }} + power_type: {{ node.remote_management.type }} + power_user: {{ node.remote_management.user }} + architecture: {{ node.node.arch | dpkg_arch }}/generic + distro_series: xenial + hwe_kernel: ${_param:hwe_kernel} + {%- if loop.index0 >= node_roles.index('cmp001') %} + disk_layout: + type: lvm + root_device: sda + volume_group: vgroot + volume_name: lvroot + volume_size: 100 + {%- endif %} + {%- endif %} + {%- endfor %} + salt_master_ip: ${_param:reclass_config_master} + domain: ${_param:cluster_domain} + maas_config: + commissioning_distro_series: 'xenial' + default_distro_series: 'xenial' + default_osystem: 'ubuntu' + default_storage_layout: 'lvm' + enable_http_proxy: true + disk_erase_with_secure_erase: false + dnssec_validation: 'no' + enable_third_party_drivers: true + network_discovery: 'enabled' + default_min_hwe_kernel: ${_param:hwe_kernel} + cluster: + saltstack_repo_xenial: "http://repo.saltstack.com/apt/ubuntu/16.04/amd64/2017.7/ xenial main" + linux: + network: + interface: + mcpcontrol_interface: + enabled: true + name: ${_param:mcpcontrol_interface} + type: eth + proto: dhcp + primary_interface: + enabled: true + name: ${_param:primary_interface} + mtu: ${_param:interface_mtu} + proto: static + address: ${_param:infra_maas_node01_address} + netmask: ${_param:opnfv_net_mgmt_mask} + type: eth + pxe_admin_interface: + enabled: true + name: ${_param:pxe_admin_interface} + mtu: ${_param:pxe_admin_interface_mtu} + proto: static + address: ${_param:single_address} + netmask: ${_param:opnfv_net_admin_mask} + type: eth diff --git a/mcp/reclass/classes/cluster/mcp-common-ha/infra/maas_pdf.yml.j2 b/mcp/reclass/classes/cluster/mcp-common-ha/infra/maas_pdf.yml.j2 deleted file mode 100644 index 1838590e9..000000000 --- a/mcp/reclass/classes/cluster/mcp-common-ha/infra/maas_pdf.yml.j2 +++ /dev/null @@ -1,94 +0,0 @@ -############################################################################## -# Copyright (c) 2018 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 -############################################################################## -{%- set cluster_arch = [] %} -{%- for node in conf.nodes %} - {%- if node.node.arch not in cluster_arch %} - {%- do cluster_arch.append(node.node.arch) %} - {%- endif %} -{%- endfor %} -{%- set net_admin = [conf.idf.net_config.admin.network, - conf.idf.net_config.admin.mask] | join("/") %} ---- -parameters: - maas: - region: - subnets: - {{ net_admin }}: - name: {{ net_admin }} - cidr: {{ net_admin }} - gateway_ip: ${_param:single_address} - iprange: - start: ${_param:opnfv_infra_maas_pxe_start_address} - end: ${_param:opnfv_infra_maas_pxe_end_address} - type: dynamic - vlans: - untagged: - vid: 0 - dhcp_on: true - primary_rack: ${_param:infra_maas_node01_hostname} - # Space-separated list of dpkg architectures to be supported by MaaS - opnfv_arches:{%- for arch in cluster_arch %} {{ arch | dpkg_arch }}{%- endfor %} - sshprefs: - - '{{ conf.MAAS_SSH_KEY }}' -{%- if 'aarch64' in cluster_arch %} - package_repositories: - armband: - name: armband - enabled: '1' - url: 'http://linux.enea.com/mcp-repos/${_param:openstack_version}/${_param:linux_system_codename}' - distributions: '${_param:openstack_version}-armband' - components: 'main' - arches: 'arm64' - key: &armband_key | - -----BEGIN PGP PUBLIC KEY BLOCK----- - Version: GnuPG v2.0.14 (GNU/Linux) - - mQENBFagAroBCADWboNIjuF6lB1mWv2+EbvqY3lKl5mLKhr2DnSUkKeHUPBv8gNM - qK8Q00AMIyPiyEhgjA+dWizZ+5aBgxoiY7oMeLJ2Xym36U/8SYq2BWd3SGCbMNoz - SJDxDUSM/HFVs6atF1M3DY9oN65hSVnu4uy5Tu6asf6k4rhAyk0z4+pRcPBCu2vq - mnGi3COM/+9PShrEKeVOx5W2vRJywUFuq8EDvQnRoJ0GvM28JiJIanw17YwIPxhg - BKZVpZjan5X+ihVMXwA2h/G/FS5Omhd50RqV6LWSYs94VJJgYqHx8UMm7izcxI+P - ct3IcbD195bPbJ+SbuiFe45ZLsdY1MyGiU2BABEBAAG0K0VuZWEgQXJtYmFuZCBE - ZXZvcHMgVGVhbSA8YXJtYmFuZEBlbmVhLmNvbT6JATgEEwECACICGwMGCwkIBwMC - BhUIAgkKCwQWAgMBAh4BAheABQJaY3bYAAoJEN6rkLp5irHRoQMH/0PYl0A/6eWw - nQ/szhEFrr76Ln6wA4vEO+PiuWj9kTkZM2NaCnkisrIuHSPIVvOLfFmztbE6sKGe - t+a2b7Jqw48DZ/gq508aZE4Q307ookxdCOrzIu/796hFO34yXg3sqZoJh3VmKIjY - 4DL8yG1iAiQ5vOw3IFWQnATwIZUgaCcjmE7HGap+9ePuJfFuQ8mIG5cy28t8qocx - AB/B2tucfBMwomYxKqgbLI5AG7iSt58ajvrrNa9f8IX7Ihj/jiuXhUwX+geEp98K - IWVI1ftEthZvfBpZW4BS98J4z//dEPi31L4jb9RQXq3afF2RpXchDeUN85bW45nu - W/9PMAlgE/U= - =m+zE - -----END PGP PUBLIC KEY BLOCK----- -{%- endif %} - machines: - {%- set pxe_interface = conf.idf.net_config.admin.interface %} - {#- We only support exactly 5 nodes for now, hardcoded order #} - {%- set node_roles = ['kvm01', 'kvm02', 'kvm03', 'cmp001', 'cmp002'] %} - {%- for node in conf.nodes %} - {%- if node.node.type == 'baremetal' %} - {{ node_roles[loop.index0] }}: - interface: - mac: {{ node.interfaces[pxe_interface].mac_address }} - power_parameters: - power_address: {{ node.remote_management.address.rsplit('/')[0] }} - power_password: {{ node.remote_management.pass }} - power_type: {{ node.remote_management.type }} - power_user: {{ node.remote_management.user }} - architecture: {{ node.node.arch | dpkg_arch }}/generic - distro_series: xenial - hwe_kernel: ${_param:hwe_kernel} - {%- if loop.index0 >= node_roles.index('cmp001') %} - disk_layout: - type: lvm - root_device: sda - volume_group: vgroot - volume_name: lvroot - volume_size: 100 - {%- endif %} - {%- endif %} - {%- endfor %} diff --git a/mcp/reclass/classes/cluster/mcp-common-ha/openstack_compute.yml b/mcp/reclass/classes/cluster/mcp-common-ha/openstack_compute.yml index c8605462b..4a0764fd9 100644 --- a/mcp/reclass/classes/cluster/mcp-common-ha/openstack_compute.yml +++ b/mcp/reclass/classes/cluster/mcp-common-ha/openstack_compute.yml @@ -35,6 +35,7 @@ parameters: keepalived_vip_interface: br-ctl keepalived_vip_virtual_router_id: 69 linux_system_codename: xenial + single_address: ${_param:control_address} glusterfs_version: '3.13' glusterfs: client: diff --git a/mcp/reclass/classes/cluster/mcp-common-ha/openstack_compute_pdf.yml.j2 b/mcp/reclass/classes/cluster/mcp-common-ha/openstack_compute_pdf.yml.j2 index fd51f5fea..396334c6d 100644 --- a/mcp/reclass/classes/cluster/mcp-common-ha/openstack_compute_pdf.yml.j2 +++ b/mcp/reclass/classes/cluster/mcp-common-ha/openstack_compute_pdf.yml.j2 @@ -7,9 +7,10 @@ ############################################################################## {#- NOTE: br-{mgmt,ctl} are cross-referenced, careful when changing names #} {%- import 'net_map.j2' as nm with context %} +{%- import 'net_macros.j2' as ma with context %} {#- Filter-out NIC duplicates by constructing a dict (used NICs only) #} -{%- set nics = { nm.cmp001.nic_admin: True, nm.cmp001.nic_mgmt: True } %} -{%- set vlans = { nm.vlan_admin: nm.cmp001.nic_admin, nm.vlan_mgmt: nm.cmp001.nic_mgmt } %} +{%- set nics = { nm.cmp001.nic_mgmt: True } %} +{%- set vlans = { nm.vlan_mgmt: nm.cmp001.nic_mgmt } %} --- parameters: _param: @@ -26,49 +27,28 @@ parameters: network: bridge: openvswitch interface: -{%- for nic in nics %} - {%- if nic == nm.cmp001.nic_admin %} - {{ nic }}: - enabled: true - type: eth - proto: dhcp - name: {{ nic }} - {%- else %} - {{ nic }}: + # PXE/admin is always untagged on computes + pxe_admin_int: enabled: true + name: {{ nm.cmp001.nic_admin }} + proto: static type: eth - proto: manual - address: 0.0.0.0 - {%- if nic == nm.cmp001.nic_public %} - netmask: ${_param:opnfv_net_public_mask} - {%- else %} - netmask: 255.255.255.0 - {%- endif %} + address: ${_param:pxe_admin_address} + netmask: ${_param:opnfv_net_admin_mask} mtu: ${_param:interface_mtu} - name: {{ nic }} - {%- endif %} -{%- endfor %} -{%- for vlan in vlans %} - {%- if vlan | int > 0 %} - {{ vlans[vlan] }}.{{ vlan }}: - enabled: true - proto: manual - type: vlan - name: {{ vlans[vlan] }}.{{ vlan }} - use_interfaces: - - {{ vlans[vlan] }} - {%- endif %} -{%- endfor %} +{{ ma.linux_network_interfaces_nic(nics) }} + +{{ ma.linux_network_interfaces_vlan(vlans) }} br-ctl: enabled: true type: bridge proto: static address: ${_param:single_address} - netmask: 255.255.255.0 + netmask: ${_param:opnfv_net_mgmt_mask} use_interfaces: - - {{ nm.cmp001.nic_mgmt }}{% if nm.vlan_mgmt | int > 0 %}.{{ nm.vlan_mgmt }}{% endif %} + - {{ ma.interface_str(nm.cmp001.nic_mgmt, nm.vlan_mgmt) }} br-floating: enabled: true type: ovs_bridge @@ -77,15 +57,12 @@ parameters: address: ${_param:external_address} netmask: ${_param:opnfv_net_public_mask} use_interfaces: - - {{ nm.cmp001.nic_public }}{% if nm.vlan_public | int > 0 %}.{{ nm.vlan_public }}{% endif %} - route: - public: - address: 0.0.0.0 - netmask: 0.0.0.0 - gateway: ${_param:opnfv_net_public_gw} + - {{ ma.interface_str(nm.cmp001.nic_public, nm.vlan_public) }} + gateway: ${_param:opnfv_net_public_gw} + name_servers: {{ nm.dns_public }} ovs_port_{{ nm.cmp001.nic_public }}: enabled: true - name: {{ nm.cmp001.nic_public }}{% if nm.vlan_public | int > 0 %}.{{ nm.vlan_public }}{% endif %} + name: {{ ma.interface_str(nm.cmp001.nic_public, nm.vlan_public) }} proto: manual ovs_port_type: OVSPort type: ovs_port diff --git a/mcp/reclass/classes/cluster/mcp-common-ha/openstack_control.yml.j2 b/mcp/reclass/classes/cluster/mcp-common-ha/openstack_control.yml.j2 index 1870cc46b..ceb3622b1 100644 --- a/mcp/reclass/classes/cluster/mcp-common-ha/openstack_control.yml.j2 +++ b/mcp/reclass/classes/cluster/mcp-common-ha/openstack_control.yml.j2 @@ -99,9 +99,6 @@ parameters: server: bind: ~ports: ~ - ~modules: - - rewrite - - wsgi # sync from common-ha kvm role glusterfs: server: diff --git a/mcp/reclass/classes/cluster/mcp-common-ha/openstack_init.yml.j2 b/mcp/reclass/classes/cluster/mcp-common-ha/openstack_init.yml.j2 index 00f24087e..9f05790c9 100644 --- a/mcp/reclass/classes/cluster/mcp-common-ha/openstack_init.yml.j2 +++ b/mcp/reclass/classes/cluster/mcp-common-ha/openstack_init.yml.j2 @@ -5,6 +5,7 @@ # which accompanies this distribution, and is available at # http://www.apache.org/licenses/LICENSE-2.0 ############################################################################## +{%- import 'net_map.j2' as nm with context %} --- parameters: _param: @@ -63,19 +64,6 @@ parameters: openstack_telemetry_node03_address: ${_param:openstack_control_node03_address} {%- endif %} - # OpenStack Compute - openstack_compute_node01_single_address: ${_param:opnfv_openstack_compute_node01_single_address} - openstack_compute_node02_single_address: ${_param:opnfv_openstack_compute_node02_single_address} - openstack_compute_node03_single_address: ${_param:opnfv_openstack_compute_node03_single_address} - openstack_compute_node01_control_address: ${_param:opnfv_openstack_compute_node01_control_address} - openstack_compute_node02_control_address: ${_param:opnfv_openstack_compute_node02_control_address} - openstack_compute_node03_control_address: ${_param:opnfv_openstack_compute_node03_control_address} - openstack_compute_node01_tenant_address: ${_param:opnfv_openstack_compute_node01_tenant_address} - openstack_compute_node02_tenant_address: ${_param:opnfv_openstack_compute_node02_tenant_address} - openstack_compute_node03_tenant_address: ${_param:opnfv_openstack_compute_node03_tenant_address} - openstack_compute_node01_external_address: ${_param:opnfv_openstack_compute_node01_external_address} - openstack_compute_node02_external_address: ${_param:opnfv_openstack_compute_node02_external_address} - # openstack service hostnames {%- if conf.MCP_VCP %} openstack_proxy_hostname: prx @@ -387,13 +375,13 @@ parameters: - ${_param:openstack_control_node03_hostname} - ${_param:openstack_control_node03_hostname}.${_param:cluster_domain} {%- endif %} - cmp001: - address: ${_param:openstack_compute_node01_control_address} - names: - - ${_param:openstack_compute_node01_hostname} - - ${_param:openstack_compute_node01_hostname}.${_param:cluster_domain} - cmp002: - address: ${_param:openstack_compute_node02_control_address} +{#- For compute nodes, expand values in-place, bypassing reclass param expansion #} +{%- for cmp in range(1, nm.cmp_nodes + 1) %} + {%- set h = 'cmp%03d' | format(cmp) %} + {%- set mgmt = nm.net_mgmt_hosts | length + nm.start_ip[nm.net_mgmt] + loop.index %} + {{ h }}: + address: {{ nm.net_mgmt | ipnet_hostaddr(mgmt) }} names: - - ${_param:openstack_compute_node02_hostname} - - ${_param:openstack_compute_node02_hostname}.${_param:cluster_domain} + - {{ h }} + - {{ h }}.${_param:cluster_domain} +{%- endfor %} diff --git a/mcp/reclass/classes/cluster/mcp-common-ha/openstack_interface_vcp_biport.yml.j2 b/mcp/reclass/classes/cluster/mcp-common-ha/openstack_interface_vcp_biport.yml.j2 index 18576b257..3576acc2f 100644 --- a/mcp/reclass/classes/cluster/mcp-common-ha/openstack_interface_vcp_biport.yml.j2 +++ b/mcp/reclass/classes/cluster/mcp-common-ha/openstack_interface_vcp_biport.yml.j2 @@ -5,6 +5,7 @@ # which accompanies this distribution, and is available at # http://www.apache.org/licenses/LICENSE-2.0 ############################################################################## +{%- import 'net_map.j2' as nm with context %} --- {%- if conf.MCP_VCP %} classes: @@ -12,16 +13,21 @@ classes: - cluster.mcp-common-ha.include.lab_proxy_pdf parameters: _param: - dhcp_nic: ${_param:opnfv_vcp_vm_primary_interface} + pxe_admin_interface: ${_param:opnfv_vcp_vm_primary_interface} single_nic: ${_param:opnfv_vcp_vm_secondary_interface} linux: network: interface: - dhcp: + pxe_admin: enabled: true type: eth - proto: dhcp - name: ${_param:dhcp_nic} + proto: static + name: ${_param:pxe_admin_interface} + address: ${_param:pxe_admin_address} + netmask: ${_param:opnfv_net_admin_mask} + gateway: {{ nm.net_admin_gw }} + name_servers: + - {{ nm.net_admin_gw }} single: enabled: true type: eth diff --git a/mcp/reclass/classes/cluster/mcp-common-ha/openstack_interface_vcp_triport.yml.j2 b/mcp/reclass/classes/cluster/mcp-common-ha/openstack_interface_vcp_triport.yml.j2 index 2cd74992a..1fa22aa7f 100644 --- a/mcp/reclass/classes/cluster/mcp-common-ha/openstack_interface_vcp_triport.yml.j2 +++ b/mcp/reclass/classes/cluster/mcp-common-ha/openstack_interface_vcp_triport.yml.j2 @@ -5,6 +5,8 @@ # which accompanies this distribution, and is available at # http://www.apache.org/licenses/LICENSE-2.0 ############################################################################## +{%- import 'net_map.j2' as nm with context %} +{%- import 'net_macros.j2' as ma with context %} --- {%- if conf.MCP_VCP %} classes: @@ -12,17 +14,19 @@ classes: - cluster.mcp-common-ha.include.lab_proxy_pdf parameters: _param: - dhcp_nic: ${_param:opnfv_vcp_vm_primary_interface} + pxe_admin_interface: ${_param:opnfv_vcp_vm_primary_interface} single_nic: ${_param:opnfv_vcp_vm_secondary_interface} control_nic: ${_param:opnfv_vcp_vm_tertiary_interface} linux: network: interface: - dhcp_int: + pxe_admin: enabled: true type: eth - proto: dhcp - name: ${_param:dhcp_nic} + proto: static + name: ${_param:pxe_admin_interface} + address: ${_param:pxe_admin_address} + netmask: ${_param:opnfv_net_admin_mask} single_int: enabled: true type: eth @@ -30,16 +34,23 @@ parameters: name: ${_param:single_nic} address: ${_param:single_address} netmask: ${_param:opnfv_net_public_mask} - route: - public: - address: 0.0.0.0 - netmask: 0.0.0.0 - gateway: ${_param:opnfv_net_public_gw} + gateway: ${_param:opnfv_net_public_gw} + name_servers: {{ nm.dns_public }} control_int: enabled: true type: eth proto: static name: ${_param:control_nic} address: ${_param:control_address} - netmask: 255.255.255.0 + netmask: ${_param:opnfv_net_mgmt_mask} +{%- else %} +{#- For NOVCP scenarios, base config is in kvm_pdf, only add/override gw #} +parameters: + linux: + network: + interface: + br-ex: + proto: static + gateway: ${_param:opnfv_net_public_gw} + name_servers: {{ nm.dns_public }} {%- endif %} diff --git a/mcp/reclass/classes/cluster/mcp-common-ha/openstack_proxy.yml.j2 b/mcp/reclass/classes/cluster/mcp-common-ha/openstack_proxy.yml.j2 index 5ddb9860a..d7ccff532 100644 --- a/mcp/reclass/classes/cluster/mcp-common-ha/openstack_proxy.yml.j2 +++ b/mcp/reclass/classes/cluster/mcp-common-ha/openstack_proxy.yml.j2 @@ -39,15 +39,6 @@ parameters: libapache2-mod-wsgi: version: latest {%- if not conf.MCP_VCP %} - # Set up routes similar to prx*ovs-ha - network: - interface: - br-ex: - route: - public: - address: 0.0.0.0 - netmask: 0.0.0.0 - gateway: ${_param:opnfv_net_public_gw} nginx: server: # NOTE(armband): Define host.address for all proxies for uniformity @@ -67,6 +58,9 @@ parameters: <<: *nginx_openstack_proxy_address nginx_proxy_openstack_api_heat_cfn: <<: *nginx_openstack_proxy_address + nginx_proxy_openstack_api_heat_cloudwatch: + <<: *nginx_openstack_proxy_address + enabled: false nginx_proxy_openstack_api_keystone: <<: *nginx_openstack_proxy_address nginx_proxy_openstack_api_keystone_private: @@ -75,8 +69,6 @@ parameters: <<: *nginx_openstack_proxy_address nginx_proxy_openstack_api_nova: <<: *nginx_openstack_proxy_address - nginx_proxy_openstack_api_nova_ec2: - <<: *nginx_openstack_proxy_address nginx_proxy_openstack_web: <<: *nginx_openstack_proxy_address nginx_ssl_redirect_openstack_web: diff --git a/mcp/reclass/classes/cluster/mcp-common-ha/openstack_telemetry.yml b/mcp/reclass/classes/cluster/mcp-common-ha/openstack_telemetry.yml deleted file mode 100644 index b7bb83b35..000000000 --- a/mcp/reclass/classes/cluster/mcp-common-ha/openstack_telemetry.yml +++ /dev/null @@ -1,87 +0,0 @@ -############################################################################## -# Copyright (c) 2018 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.linux.system.repo.mcp.mirror.v1.openstack - - service.redis.server.single - - system.ceilometer.server.cluster - - system.ceilometer.server.coordination.redis - - system.ceilometer.server.backend.default - - system.aodh.server.cluster - - system.aodh.server.coordination.redis - - system.memcached.server.single - - system.apache.server.single - - system.apache.server.site.gnocchi - - system.apache.server.site.panko - - system.gnocchi.server.cluster - - system.gnocchi.common.storage.incoming.redis - - system.gnocchi.common.storage.redis - - system.gnocchi.common.coordination.redis - - system.panko.server.cluster -parameters: - _param: - keepalived_openstack_telemetry_vip_interface: ${_param:single_nic} - keepalived_vip_virtual_router_id: 230 - cluster_vip_address: ${_param:openstack_telemetry_address} - cluster_local_address: ${_param:single_address} - cluster_node01_hostname: ${_param:openstack_telemetry_node01_hostname} - cluster_node01_address: ${_param:openstack_telemetry_node01_address} - cluster_node02_hostname: ${_param:openstack_telemetry_node02_hostname} - cluster_node02_address: ${_param:openstack_telemetry_node02_address} - cluster_node03_hostname: ${_param:openstack_telemetry_node03_hostname} - cluster_node03_address: ${_param:openstack_telemetry_node03_address} - redis_sentinel_node01_address: ${_param:openstack_telemetry_node01_address} - redis_sentinel_node02_address: ${_param:openstack_telemetry_node02_address} - redis_sentinel_node03_address: ${_param:openstack_telemetry_node03_address} - # yamllint disable-line rule:line-length - openstack_telemetry_redis_url: redis://${_param:redis_sentinel_node01_address}:26379?sentinel=master_1&sentinel_fallback=${_param:redis_sentinel_node02_address}:26379&sentinel_fallback=${_param:redis_sentinel_node03_address}:26379 - gnocchi_coordination_url: ${_param:openstack_telemetry_redis_url} - gnocchi_storage_incoming_redis_url: ${_param:openstack_telemetry_redis_url} - redis: - server: - version: 3.0 - appendfsync: 'no' - bind: - address: ${_param:single_address} - cluster: - enabled: true - mode: sentinel - role: ${_param:redis_cluster_role} - quorum: 2 - master: - host: ${_param:cluster_node01_address} - port: 6379 - sentinel: - address: ${_param:single_address} - gnocchi: - common: - database: - host: ${_param:openstack_database_address} - server: - pkgs: - - gnocchi-api - - gnocchi-metricd - - python-memcache - apache: - server: - ~modules: - - wsgi - - rewrite - site: - gnocchi: - wsgi: - threads: 1 - aodh: - server: - coordination_backend: - url: ${_param:openstack_telemetry_redis_url} - ceilometer: - server: - ~database: ~ - coordination_backend: - url: ${_param:openstack_telemetry_redis_url} diff --git a/mcp/reclass/classes/cluster/mcp-common-ha/openstack_telemetry.yml.j2 b/mcp/reclass/classes/cluster/mcp-common-ha/openstack_telemetry.yml.j2 new file mode 100644 index 000000000..2ed7c5336 --- /dev/null +++ b/mcp/reclass/classes/cluster/mcp-common-ha/openstack_telemetry.yml.j2 @@ -0,0 +1,89 @@ +############################################################################## +# Copyright (c) 2018 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.linux.system.repo.mcp.mirror.v1.openstack + - service.redis.server.single + - system.ceilometer.server.cluster + - system.ceilometer.server.coordination.redis + - system.ceilometer.server.backend.default + - system.aodh.server.cluster + - system.aodh.server.coordination.redis + - system.memcached.server.single + - system.apache.server.single + - system.apache.server.site.gnocchi + - system.apache.server.site.panko + - system.gnocchi.server.cluster + - system.gnocchi.common.storage.incoming.redis + - system.gnocchi.common.storage.redis + - system.gnocchi.common.coordination.redis + - system.panko.server.cluster +parameters: + _param: + keepalived_openstack_telemetry_vip_interface: ${_param:single_nic} + keepalived_vip_virtual_router_id: 230 + cluster_vip_address: ${_param:openstack_telemetry_address} + cluster_local_address: ${_param:single_address} + cluster_node01_hostname: ${_param:openstack_telemetry_node01_hostname} + cluster_node01_address: ${_param:openstack_telemetry_node01_address} + cluster_node02_hostname: ${_param:openstack_telemetry_node02_hostname} + cluster_node02_address: ${_param:openstack_telemetry_node02_address} + cluster_node03_hostname: ${_param:openstack_telemetry_node03_hostname} + cluster_node03_address: ${_param:openstack_telemetry_node03_address} + redis_sentinel_node01_address: ${_param:openstack_telemetry_node01_address} + redis_sentinel_node02_address: ${_param:openstack_telemetry_node02_address} + redis_sentinel_node03_address: ${_param:openstack_telemetry_node03_address} + # yamllint disable-line rule:line-length + openstack_telemetry_redis_url: redis://${_param:redis_sentinel_node01_address}:26379?sentinel=master_1&sentinel_fallback=${_param:redis_sentinel_node02_address}:26379&sentinel_fallback=${_param:redis_sentinel_node03_address}:26379 + gnocchi_coordination_url: ${_param:openstack_telemetry_redis_url} + gnocchi_storage_incoming_redis_url: ${_param:openstack_telemetry_redis_url} + redis: + server: + version: 3.0 + appendfsync: 'no' + bind: + address: ${_param:single_address} + cluster: + enabled: true + mode: sentinel + role: ${_param:redis_cluster_role} + quorum: 2 + master: + host: ${_param:cluster_node01_address} + port: 6379 + sentinel: + address: ${_param:single_address} + gnocchi: + common: + database: + host: ${_param:openstack_database_address} + server: + pkgs: + - gnocchi-api + - gnocchi-metricd + - python-memcache + apache: + server: + ~modules: + - rewrite +{%- if conf.MCP_VCP %} {#- wsgi module will be enabled by a different class inherited later #} + - wsgi +{%- endif %} + site: + gnocchi: + wsgi: + threads: 1 + aodh: + server: + coordination_backend: + url: ${_param:openstack_telemetry_redis_url} + ceilometer: + server: + ~database: ~ + coordination_backend: + url: ${_param:openstack_telemetry_redis_url} diff --git a/mcp/reclass/classes/cluster/mcp-common-noha/infra/config.yml b/mcp/reclass/classes/cluster/mcp-common-noha/infra/config.yml deleted file mode 100644 index 0a2924bac..000000000 --- a/mcp/reclass/classes/cluster/mcp-common-noha/infra/config.yml +++ /dev/null @@ -1,82 +0,0 @@ -############################################################################## -# Copyright (c) 2018 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: - - service.git.client - - system.linux.system.single - - system.linux.system.repo.mcp.salt - - system.salt.master.api - - system.salt.master.pkg - - system.reclass.storage.salt - - system.salt.minion.ca.salt_master - - system.mysql.client.single - - system.reclass.storage.system.openstack_compute_multi -parameters: - _param: - openstack_control_node01_hostname: ctl01 - reclass_data_repository: local - reclass_config_master: ${_param:opnfv_infra_config_pxe_address} - salt_master_environment_repository: "https://github.com/tcpcloud" - salt_master_environment_revision: master - single_address: ${_param:opnfv_infra_config_address} - salt_master_host: 127.0.0.1 - salt_master_base_environment: prd - salt_minion_ca_host: ${linux:network:fqdn} - # yamllint disable-line rule:line-length - salt_api_password_hash: "$6$sGnRlxGf$al5jMCetLP.vfI/fTl3Z0N7Za1aeiexL487jAtyRABVfT3NlwZxQGVhO7S1N8OwS/34VHYwZQA8lkXwKMN/GS1" - linux: - network: - interface: - dhcp: - enabled: true - type: eth - proto: dhcp - name: ${_param:opnfv_fn_vm_primary_interface} - single_int: - enabled: true - name: ${_param:opnfv_fn_vm_secondary_interface} - type: eth - proto: static - address: ${_param:single_address} - netmask: 255.255.255.0 - pxe: - enabled: true - type: eth - proto: static - name: ${_param:opnfv_fn_vm_tertiary_interface} - address: ${_param:opnfv_infra_config_pxe_address} - netmask: 255.255.255.0 - salt: - master: - file_recv: true - worker_threads: 4 - command_timeout: 20 - reclass: - storage: - data_source: - engine: local - node: - openstack_control_node01: - name: ${_param:openstack_control_node01_hostname} - domain: ${_param:cluster_domain} - classes: - - cluster.${_param:cluster_name}.openstack.control - params: - linux_system_codename: xenial - salt_master_host: ${_param:reclass_config_master} - single_address: ${_param:openstack_control_node01_address} - openstack_compute_node01: - params: - single_address: ${_param:opnfv_openstack_compute_node01_control_address} - tenant_address: ${_param:opnfv_openstack_compute_node01_tenant_address} - external_address: ${_param:opnfv_openstack_compute_node01_external_address} - openstack_compute_node02: - params: - single_address: ${_param:opnfv_openstack_compute_node02_control_address} - tenant_address: ${_param:opnfv_openstack_compute_node02_tenant_address} - external_address: ${_param:opnfv_openstack_compute_node02_external_address} diff --git a/mcp/reclass/classes/cluster/mcp-common-noha/infra/config.yml.j2 b/mcp/reclass/classes/cluster/mcp-common-noha/infra/config.yml.j2 new file mode 100644 index 000000000..ac53e8225 --- /dev/null +++ b/mcp/reclass/classes/cluster/mcp-common-noha/infra/config.yml.j2 @@ -0,0 +1,59 @@ +############################################################################## +# Copyright (c) 2018 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 +############################################################################## +{%- import 'net_map.j2' as nm with context %} +--- +classes: + - system.mysql.client.single + - cluster.all-mcp-arch-common.infra.config_pdf +parameters: + _param: + openstack_control_node01_hostname: ctl01 + reclass_config_master: ${_param:opnfv_infra_config_pxe_admin_address} + single_address: ${_param:opnfv_infra_config_address} + salt_master_host: 127.0.0.1 + salt_minion_ca_host: ${linux:network:fqdn} + linux: + network: + interface: + mcpcontrol_int: + enabled: true + type: eth + proto: dhcp + name: ${_param:opnfv_fn_vm_primary_interface} + single_int: + enabled: true + name: ${_param:opnfv_fn_vm_secondary_interface} + type: eth + proto: static + address: ${_param:single_address} + netmask: ${_param:opnfv_net_mgmt_mask} + pxe_admin_int: + enabled: true + type: eth + proto: static + name: ${_param:opnfv_fn_vm_tertiary_interface} + address: ${_param:opnfv_infra_config_pxe_admin_address} + netmask: ${_param:opnfv_net_admin_mask} + salt: + master: + file_recv: true + worker_threads: 4 + command_timeout: 20 + reclass: + storage: + node: + openstack_control_node01: + name: ${_param:openstack_control_node01_hostname} + domain: ${_param:cluster_domain} + classes: + - cluster.${_param:cluster_name}.openstack.control + params: + linux_system_codename: xenial + salt_master_host: ${_param:reclass_config_master} + single_address: ${_param:openstack_control_node01_address} + pxe_admin_address: ${_param:opnfv_openstack_control_node01_pxe_admin_address} diff --git a/mcp/reclass/classes/cluster/mcp-common-noha/init_options.yml b/mcp/reclass/classes/cluster/mcp-common-noha/init_options.yml index 69aba92ad..462ab8312 100644 --- a/mcp/reclass/classes/cluster/mcp-common-noha/init_options.yml +++ b/mcp/reclass/classes/cluster/mcp-common-noha/init_options.yml @@ -24,5 +24,3 @@ parameters: openstack_message_queue_node03_address: ${_param:openstack_control_node03_address} openstack_gateway_address: ${_param:opnfv_openstack_gateway_node01_address} control_address: ${_param:openstack_control_address} - ntp_strata_host1: 1.se.pool.ntp.org - ntp_strata_host2: 0.se.pool.ntp.org diff --git a/mcp/reclass/classes/cluster/mcp-common-noha/openstack_compute.yml b/mcp/reclass/classes/cluster/mcp-common-noha/openstack_compute.yml index edd7f9f58..671f6eb07 100644 --- a/mcp/reclass/classes/cluster/mcp-common-noha/openstack_compute.yml +++ b/mcp/reclass/classes/cluster/mcp-common-noha/openstack_compute.yml @@ -21,7 +21,7 @@ parameters: _param: interface_mtu: 9000 linux_system_codename: xenial - ~cinder_lvm_devices: ['/dev/vdb'] + single_address: ${_param:control_address} nova: compute: libvirt_service: libvirtd diff --git a/mcp/reclass/classes/cluster/mcp-common-noha/openstack_compute_pdf.yml.j2 b/mcp/reclass/classes/cluster/mcp-common-noha/openstack_compute_pdf.yml.j2 index 64af148fd..aebd88828 100644 --- a/mcp/reclass/classes/cluster/mcp-common-noha/openstack_compute_pdf.yml.j2 +++ b/mcp/reclass/classes/cluster/mcp-common-noha/openstack_compute_pdf.yml.j2 @@ -10,6 +10,15 @@ --- parameters: _param: + # Should later be determined via PDF/IDF, AArch64 has ESP on /dev/sda1 +{%- if conf.nodes[nm.cmp001.idx].node.type == 'virtual' %} + ~cinder_lvm_devices: ['/dev/vdb'] +{%- elif conf.nodes[nm.cmp001.idx].node.arch == 'aarch64' or + conf.nodes[nm.cmp001.idx].disks.0.disk_capacity | storage_size_num | float > 2000000000000 %} + ~cinder_lvm_devices: ['/dev/sda2'] +{%- else %} + ~cinder_lvm_devices: ['/dev/sda1'] +{%- endif %} primary_interface: {{ nm.cmp001.nic_mgmt }} tenant_interface: {{ nm.cmp001.nic_private }} external_interface: {{ nm.cmp001.nic_public }} @@ -17,11 +26,13 @@ parameters: network: bridge: openvswitch interface: - dhcp_int: + pxe_admin_int: enabled: true name: {{ nm.cmp001.nic_admin }} - proto: dhcp + proto: static type: eth + address: ${_param:pxe_admin_address} + netmask: ${_param:opnfv_net_admin_mask} mtu: ${_param:interface_mtu} primary_interface: enabled: true @@ -39,6 +50,6 @@ parameters: type: bridge proto: static address: ${_param:single_address} - netmask: 255.255.255.0 + netmask: ${_param:opnfv_net_mgmt_mask} use_interfaces: - ${_param:primary_interface} diff --git a/mcp/reclass/classes/cluster/mcp-common-noha/openstack_control.yml b/mcp/reclass/classes/cluster/mcp-common-noha/openstack_control.yml index c4915c795..f458281ce 100644 --- a/mcp/reclass/classes/cluster/mcp-common-noha/openstack_control.yml +++ b/mcp/reclass/classes/cluster/mcp-common-noha/openstack_control.yml @@ -150,7 +150,7 @@ parameters: path: /srv/nova/instances host: nova: - host: ${_param:single_address}/24 + host: ${_param:single_address}/${_param:opnfv_net_mgmt_mask} params: - rw - no_root_squash diff --git a/mcp/reclass/classes/cluster/mcp-common-noha/openstack_control_pdf.yml.j2 b/mcp/reclass/classes/cluster/mcp-common-noha/openstack_control_pdf.yml.j2 index 8219637dc..b0b55afb9 100644 --- a/mcp/reclass/classes/cluster/mcp-common-noha/openstack_control_pdf.yml.j2 +++ b/mcp/reclass/classes/cluster/mcp-common-noha/openstack_control_pdf.yml.j2 @@ -11,22 +11,26 @@ parameters: linux: network: interface: - dhcp_int: + pxe_admin_int: enabled: true name: {{ nm.ctl01.nic_admin }} - proto: dhcp + proto: static type: eth + address: ${_param:pxe_admin_address} + netmask: ${_param:opnfv_net_admin_mask} single_int: enabled: true name: {{ nm.ctl01.nic_mgmt }} type: eth proto: static address: ${_param:single_address} - netmask: 255.255.255.0 + netmask: ${_param:opnfv_net_mgmt_mask} public_int: enabled: true name: {{ nm.ctl01.nic_public }} type: eth proto: static address: ${_param:cluster_public_host} - netmask: 255.255.255.0 + netmask: ${_param:opnfv_net_public_mask} + gateway: ${_param:opnfv_net_public_gw} + name_servers: {{ nm.dns_public }} diff --git a/mcp/reclass/classes/cluster/mcp-common-noha/openstack_gateway_pdf.yml.j2 b/mcp/reclass/classes/cluster/mcp-common-noha/openstack_gateway_pdf.yml.j2 index 7067d59a4..6bd61a2d4 100644 --- a/mcp/reclass/classes/cluster/mcp-common-noha/openstack_gateway_pdf.yml.j2 +++ b/mcp/reclass/classes/cluster/mcp-common-noha/openstack_gateway_pdf.yml.j2 @@ -16,11 +16,13 @@ parameters: network: bridge: openvswitch interface: - dhcp_int: + pxe_admin_int: enabled: true name: {{ nm.ctl01.nic_admin }} - proto: dhcp + proto: static type: eth + address: ${_param:pxe_admin_address} + netmask: ${_param:opnfv_net_admin_mask} mtu: ${_param:interface_mtu} primary_interface: enabled: true @@ -40,6 +42,8 @@ parameters: mtu: ${_param:interface_mtu} proto: manual type: eth + gateway: ${_param:opnfv_net_public_gw} + name_servers: {{ nm.dns_public }} br-floating: enabled: true type: ovs_bridge @@ -49,7 +53,7 @@ parameters: type: bridge proto: static address: ${_param:single_address} - netmask: 255.255.255.0 + netmask: ${_param:opnfv_net_mgmt_mask} mtu: ${_param:interface_mtu} use_interfaces: - ${_param:primary_interface} @@ -63,7 +67,7 @@ parameters: type: bridge mtu: ${_param:interface_mtu} address: ${_param:external_address} - netmask: 255.255.255.0 + netmask: ${_param:opnfv_net_public_mask} use_interfaces: - ${_param:external_interface} use_ovs_ports: diff --git a/mcp/reclass/classes/cluster/mcp-common-noha/openstack_init.yml b/mcp/reclass/classes/cluster/mcp-common-noha/openstack_init.yml deleted file mode 100644 index f76333374..000000000 --- a/mcp/reclass/classes/cluster/mcp-common-noha/openstack_init.yml +++ /dev/null @@ -1,134 +0,0 @@ -############################################################################## -# Copyright (c) 2018 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: - openstack_version: queens - apt_mk_version: nightly - mcp_repo_version: 1.1 - openstack_region: RegionOne - admin_email: root@localhost - cluster_public_protocol: http - cluster_public_host: ${_param:opnfv_openstack_control_node01_external_address} - neutron_public_protocol: http - neutron_control_dvr: 'False' - neutron_l3_ha: 'False' - neutron_global_physnet_mtu: 1500 - neutron_external_mtu: 1500 - neutron_gateway_dvr: 'False' - neutron_gateway_agent_mode: legacy - neutron_compute_dvr: 'False' - neutron_compute_agent_mode: legacy - neutron_compute_external_access: 'False' - galera_server_cluster_name: openstack_cluster - galera_server_maintenance_password: opnfv_secret - galera_server_admin_password: opnfv_secret - cluster_vip_address: ${_param:cluster_public_host} - cluster_local_address: ${_param:openstack_control_address} - cluster_node01_hostname: ctl01 - cluster_node01_address: ${_param:opnfv_openstack_control_node01_address} - cluster_node02_hostname: ctl02 - cluster_node02_address: ${_param:opnfv_openstack_control_node02_address} - cluster_node03_hostname: ctl03 - cluster_node03_address: ${_param:opnfv_openstack_control_node03_address} - rabbitmq_secret_key: opnfv_secret - rabbitmq_admin_password: opnfv_secret - rabbitmq_openstack_password: opnfv_secret - rabbitmq_cold_password: opnfv_secret - glance_version: ${_param:openstack_version} - glance_service_host: ${_param:cluster_local_address} - keystone_version: ${_param:openstack_version} - keystone_service_host: ${_param:cluster_local_address} - heat_version: ${_param:openstack_version} - heat_service_host: ${_param:cluster_local_address} - heat_domain_admin_password: opnfv_secret - ceilometer_version: ${_param:openstack_version} - ceilometer_service_host: ${_param:cluster_local_address} - ceilometer_database_host: ${_param:cluster_local_address} - cinder_version: ${_param:openstack_version} - cinder_service_host: ${_param:cluster_local_address} - nova_version: ${_param:openstack_version} - nova_service_host: ${_param:cluster_local_address} - nova_vncproxy_url: http://${_param:cluster_vip_address}:8060 - neutron_version: ${_param:openstack_version} - neutron_service_host: ${_param:cluster_local_address} - mysql_admin_user: root - mysql_admin_password: opnfv_secret - mysql_cinder_password: opnfv_secret - mysql_ceilometer_password: opnfv_secret - mysql_glance_password: opnfv_secret - mysql_grafana_password: opnfv_secret - mysql_heat_password: opnfv_secret - mysql_keystone_password: opnfv_secret - mysql_neutron_password: opnfv_secret - mysql_nova_password: opnfv_secret - mysql_aodh_password: opnfv_secret - keystone_service_token: opnfv_secret - keystone_admin_password: opnfv_secret - keystone_ceilometer_password: opnfv_secret - keystone_cinder_password: opnfv_secret - keystone_glance_password: opnfv_secret - keystone_heat_password: opnfv_secret - keystone_keystone_password: opnfv_secret - keystone_neutron_password: opnfv_secret - keystone_nova_password: opnfv_secret - ceilometer_secret_key: opnfv_secret - metadata_password: opnfv_secret - horizon_version: ${_param:openstack_version} - horizon_secret_key: opaesee8Que2yahJoh9fo0eefo1Aeyo6ahyei8zeiboh3aeth5loth7ieNa5xi5e - horizon_identity_host: ${_param:cluster_vip_address} - horizon_identity_encryption: none - horizon_identity_version: 3 - aodh_version: ${_param:openstack_version} - keystone_aodh_password: opnfv_secret - aodh_service_host: ${_param:cluster_local_address} - gnocchi_version: 4.0 - gnocchi_service_host: ${_param:cluster_local_address} - mysql_gnocchi_password: opnfv_secret - keystone_gnocchi_password: opnfv_secret - panko_version: ${_param:openstack_version} - panko_service_host: ${_param:cluster_local_address} - mysql_panko_password: opnfv_secret - keystone_panko_password: opnfv_secret - ceilometer_agent_default_polling_interval: 180 - ceilometer_agent_default_polling_meters: - - "*" - linux: - system: - kernel: - sysctl: - net.ipv4.tcp_congestion_control: yeah - net.ipv4.tcp_slow_start_after_idle: 0 - net.ipv4.tcp_fin_timeout: 30 - network: - host: - ctl: - address: ${_param:openstack_control_address} - names: - - ctl - - ctl.${_param:cluster_domain} - ctl01: - address: ${_param:openstack_control_node01_address} - names: - - ctl01 - - ctl01.${_param:cluster_domain} - gtw01: - address: ${_param:openstack_gateway_address} - names: - - gtw01 - - gtw01.${_param:cluster_domain} - cmp01: - address: ${_param:opnfv_openstack_compute_node01_control_address} - names: - - cmp01 - - cmp01.${_param:cluster_domain} - cmp02: - address: ${_param:opnfv_openstack_compute_node02_control_address} - names: - - cmp02 - - cmp02.${_param:cluster_domain} diff --git a/mcp/reclass/classes/cluster/mcp-common-noha/openstack_init.yml.j2 b/mcp/reclass/classes/cluster/mcp-common-noha/openstack_init.yml.j2 new file mode 100644 index 000000000..a62057ac3 --- /dev/null +++ b/mcp/reclass/classes/cluster/mcp-common-noha/openstack_init.yml.j2 @@ -0,0 +1,135 @@ +############################################################################## +# Copyright (c) 2018 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 +############################################################################## +{%- import 'net_map.j2' as nm with context %} +--- +parameters: + _param: + openstack_version: queens + apt_mk_version: nightly + mcp_repo_version: 1.1 + openstack_region: RegionOne + admin_email: root@localhost + cluster_public_protocol: http + cluster_public_host: ${_param:opnfv_openstack_control_node01_external_address} + neutron_public_protocol: http + neutron_control_dvr: 'False' + neutron_l3_ha: 'False' + neutron_global_physnet_mtu: 1500 + neutron_external_mtu: 1500 + neutron_gateway_dvr: 'False' + neutron_gateway_agent_mode: legacy + neutron_compute_dvr: 'False' + neutron_compute_agent_mode: legacy + neutron_compute_external_access: 'False' + galera_server_cluster_name: openstack_cluster + galera_server_maintenance_password: opnfv_secret + galera_server_admin_password: opnfv_secret + cluster_vip_address: ${_param:cluster_public_host} + cluster_local_address: ${_param:openstack_control_address} + cluster_node01_hostname: ctl01 + cluster_node01_address: ${_param:opnfv_openstack_control_node01_address} + cluster_node02_hostname: ctl02 + cluster_node02_address: ${_param:opnfv_openstack_control_node02_address} + cluster_node03_hostname: ctl03 + cluster_node03_address: ${_param:opnfv_openstack_control_node03_address} + rabbitmq_secret_key: opnfv_secret + rabbitmq_admin_password: opnfv_secret + rabbitmq_openstack_password: opnfv_secret + rabbitmq_cold_password: opnfv_secret + glance_version: ${_param:openstack_version} + glance_service_host: ${_param:cluster_local_address} + keystone_version: ${_param:openstack_version} + keystone_service_host: ${_param:cluster_local_address} + heat_version: ${_param:openstack_version} + heat_service_host: ${_param:cluster_local_address} + heat_domain_admin_password: opnfv_secret + ceilometer_version: ${_param:openstack_version} + ceilometer_service_host: ${_param:cluster_local_address} + ceilometer_database_host: ${_param:cluster_local_address} + cinder_version: ${_param:openstack_version} + cinder_service_host: ${_param:cluster_local_address} + nova_version: ${_param:openstack_version} + nova_service_host: ${_param:cluster_local_address} + nova_vncproxy_url: http://${_param:cluster_vip_address}:8060 + neutron_version: ${_param:openstack_version} + neutron_service_host: ${_param:cluster_local_address} + mysql_admin_user: root + mysql_admin_password: opnfv_secret + mysql_cinder_password: opnfv_secret + mysql_ceilometer_password: opnfv_secret + mysql_glance_password: opnfv_secret + mysql_grafana_password: opnfv_secret + mysql_heat_password: opnfv_secret + mysql_keystone_password: opnfv_secret + mysql_neutron_password: opnfv_secret + mysql_nova_password: opnfv_secret + mysql_aodh_password: opnfv_secret + keystone_service_token: opnfv_secret + keystone_admin_password: opnfv_secret + keystone_ceilometer_password: opnfv_secret + keystone_cinder_password: opnfv_secret + keystone_glance_password: opnfv_secret + keystone_heat_password: opnfv_secret + keystone_keystone_password: opnfv_secret + keystone_neutron_password: opnfv_secret + keystone_nova_password: opnfv_secret + ceilometer_secret_key: opnfv_secret + metadata_password: opnfv_secret + horizon_version: ${_param:openstack_version} + horizon_secret_key: opaesee8Que2yahJoh9fo0eefo1Aeyo6ahyei8zeiboh3aeth5loth7ieNa5xi5e + horizon_identity_host: ${_param:cluster_vip_address} + horizon_identity_encryption: none + horizon_identity_version: 3 + aodh_version: ${_param:openstack_version} + keystone_aodh_password: opnfv_secret + aodh_service_host: ${_param:cluster_local_address} + gnocchi_version: 4.0 + gnocchi_service_host: ${_param:cluster_local_address} + mysql_gnocchi_password: opnfv_secret + keystone_gnocchi_password: opnfv_secret + panko_version: ${_param:openstack_version} + panko_service_host: ${_param:cluster_local_address} + mysql_panko_password: opnfv_secret + keystone_panko_password: opnfv_secret + ceilometer_agent_default_polling_interval: 180 + ceilometer_agent_default_polling_meters: + - "*" + linux: + system: + kernel: + sysctl: + net.ipv4.tcp_congestion_control: yeah + net.ipv4.tcp_slow_start_after_idle: 0 + net.ipv4.tcp_fin_timeout: 30 + network: + host: + ctl: + address: ${_param:openstack_control_address} + names: + - ctl + - ctl.${_param:cluster_domain} + ctl01: + address: ${_param:openstack_control_node01_address} + names: + - ctl01 + - ctl01.${_param:cluster_domain} + gtw01: + address: ${_param:openstack_gateway_address} + names: + - gtw01 + - gtw01.${_param:cluster_domain} +{#- For compute nodes, expand values in-place, bypassing reclass param expansion #} +{%- for cmp in range(1, nm.cmp_nodes + 1) %} + {%- set h = 'cmp%03d' | format(cmp) %} + {%- set mgmt = nm.net_mgmt_hosts | length + nm.start_ip[nm.net_mgmt] + loop.index %} + {{ h }}: + address: {{ nm.net_mgmt | ipnet_hostaddr(mgmt) }} + names: + - {{ h }} + - {{ h }}.${_param:cluster_domain} +{%- endfor %} diff --git a/mcp/reclass/classes/cluster/mcp-odl-ha/infra/config.yml b/mcp/reclass/classes/cluster/mcp-odl-ha/infra/config.yml index 58e4cd09c..f72993f89 100644 --- a/mcp/reclass/classes/cluster/mcp-odl-ha/infra/config.yml +++ b/mcp/reclass/classes/cluster/mcp-odl-ha/infra/config.yml @@ -10,7 +10,6 @@ classes: - system.reclass.storage.system.opendaylight_control_single - cluster.mcp-common-ha.infra.config - cluster.mcp-odl-ha.infra - - cluster.all-mcp-arch-common.infra.config_pdf parameters: reclass: storage: @@ -21,3 +20,4 @@ parameters: params: linux_system_codename: xenial single_address: ${_param:opendaylight_server_node01_single_address} + pxe_admin_address: ${_param:opnfv_opendaylight_server_node01_pxe_admin_address} diff --git a/mcp/reclass/classes/cluster/mcp-odl-ha/infra/maas.yml.j2 b/mcp/reclass/classes/cluster/mcp-odl-ha/infra/maas.yml.j2 index 30d712634..c06643089 100644 --- a/mcp/reclass/classes/cluster/mcp-odl-ha/infra/maas.yml.j2 +++ b/mcp/reclass/classes/cluster/mcp-odl-ha/infra/maas.yml.j2 @@ -5,17 +5,12 @@ # which accompanies this distribution, and is available at # http://www.apache.org/licenses/LICENSE-2.0 ############################################################################## -{%- set cluster_arch = [] %} -{%- for node in conf.nodes %} - {%- if node.node.arch not in cluster_arch %} - {%- do cluster_arch.append(node.node.arch) %} - {%- endif %} -{%- endfor %} +{%- import 'net_map.j2' as nm with context %} --- classes: - cluster.mcp-common-ha.infra.maas - cluster.mcp-odl-ha.infra -{%- if 'aarch64' not in cluster_arch %} +{%- if 'aarch64' not in nm.cluster.arch %} parameters: _param: hwe_kernel: 'ga-16.04' diff --git a/mcp/reclass/classes/cluster/mcp-odl-ha/openstack/compute_pdf.yml.j2 b/mcp/reclass/classes/cluster/mcp-odl-ha/openstack/compute_pdf.yml.j2 index 7cf4c8864..cc39db11a 100644 --- a/mcp/reclass/classes/cluster/mcp-odl-ha/openstack/compute_pdf.yml.j2 +++ b/mcp/reclass/classes/cluster/mcp-odl-ha/openstack/compute_pdf.yml.j2 @@ -6,6 +6,7 @@ # http://www.apache.org/licenses/LICENSE-2.0 ############################################################################## {%- import 'net_map.j2' as nm with context %} +{%- import 'net_macros.j2' as ma with context %} {#- Filter-out NIC duplicates by constructing a dict (used NICs only) #} {%- set nics = { nm.cmp001.nic_private: True } %} {%- set vlan_private_start = (nm.vlan_private | string).rsplit('-')[0] %} @@ -15,35 +16,16 @@ parameters: linux: network: interface: -{%- for nic in nics %} - {{ nic }}: - enabled: true - type: eth - {%- if nic == nm.cmp001.nic_admin %} - proto: dhcp - {%- else %} - proto: manual - {%- endif %} - name: {{ nic }} -{%- endfor %} -{%- for vlan in vlans %} - {%- if vlan | int > 0 %} - {{ vlans[vlan] }}.{{ vlan }}: - enabled: true - proto: manual - type: vlan - name: {{ vlans[vlan] }}.{{ vlan }} - use_interfaces: - - {{ vlans[vlan] }} - {%- endif %} -{%- endfor %} +{{ ma.linux_network_interfaces_nic(nics) }} + +{{ ma.linux_network_interfaces_vlan(vlans) }} br-mesh: enabled: true type: bridge address: ${_param:tenant_address} - netmask: 255.255.255.0 + netmask: ${_param:opnfv_net_private_mask} mtu: 1500 use_interfaces: - - {{ nm.cmp001.nic_private }}{% if vlan_private_start | int > 0 %}.{{ vlan_private_start }}{% endif %} + - {{ ma.interface_str(nm.cmp001.nic_private, vlan_private_start) }} diff --git a/mcp/reclass/classes/cluster/mcp-odl-noha/infra/config.yml.j2 b/mcp/reclass/classes/cluster/mcp-odl-noha/infra/config.yml.j2 index 43e8c1f39..f25dd60fa 100644 --- a/mcp/reclass/classes/cluster/mcp-odl-noha/infra/config.yml.j2 +++ b/mcp/reclass/classes/cluster/mcp-odl-noha/infra/config.yml.j2 @@ -22,7 +22,9 @@ parameters: params: linux_system_codename: xenial single_address: ${_param:opendaylight_service_host} + pxe_admin_address: ${_param:opnfv_opendaylight_server_node01_pxe_admin_address} openstack_gateway_node01: params: tenant_address: ${_param:opnfv_openstack_gateway_node01_tenant_address} external_address: ${_param:opnfv_openstack_gateway_node01_external_address} + pxe_admin_address: ${_param:opnfv_openstack_gateway_node01_pxe_admin_address} diff --git a/mcp/reclass/classes/cluster/mcp-odl-noha/opendaylight/control_pdf.yml.j2 b/mcp/reclass/classes/cluster/mcp-odl-noha/opendaylight/control_pdf.yml.j2 index fbb7de8b3..5bb591765 100644 --- a/mcp/reclass/classes/cluster/mcp-odl-noha/opendaylight/control_pdf.yml.j2 +++ b/mcp/reclass/classes/cluster/mcp-odl-noha/opendaylight/control_pdf.yml.j2 @@ -11,15 +11,20 @@ parameters: linux: network: interface: - dhcp_int: + pxe_admin_int: enabled: true name: {{ nm.ctl01.nic_admin }} - proto: dhcp + proto: static type: eth + address: ${_param:pxe_admin_address} + netmask: ${_param:opnfv_net_admin_mask} + gateway: {{ nm.net_admin_gw }} + name_servers: + - {{ nm.net_admin_gw }} single_int: enabled: true name: {{ nm.ctl01.nic_mgmt }} type: eth proto: static address: ${_param:single_address} - netmask: 255.255.255.0 + netmask: ${_param:opnfv_net_mgmt_mask} diff --git a/mcp/reclass/classes/cluster/mcp-odl-noha/openstack/compute.yml.j2 b/mcp/reclass/classes/cluster/mcp-odl-noha/openstack/compute.yml.j2 index d0ee3a3e0..c3e79e524 100644 --- a/mcp/reclass/classes/cluster/mcp-odl-noha/openstack/compute.yml.j2 +++ b/mcp/reclass/classes/cluster/mcp-odl-noha/openstack/compute.yml.j2 @@ -5,6 +5,7 @@ # which accompanies this distribution, and is available at # http://www.apache.org/licenses/LICENSE-2.0 ############################################################################## +{%- import 'net_map.j2' as nm with context %} --- classes: - service.neutron.compute.single @@ -33,7 +34,7 @@ parameters: type: dpdk_ovs_bridge proto: static address: ${_param:tenant_address} - netmask: 255.255.255.0 + netmask: ${_param:opnfv_net_private_mask} tenant_interface: type: dpdk # Not a meaningful type, just match 'dpdk' for filtering {%- endif %} @@ -48,7 +49,7 @@ parameters: type: bridge proto: static address: ${_param:tenant_address} - netmask: 255.255.255.0 + netmask: ${_param:opnfv_net_private_mask} use_interfaces: - ${_param:tenant_interface} br-floating: @@ -70,3 +71,5 @@ parameters: - ${_param:external_interface} use_ovs_ports: - float-to-ex + gateway: ${_param:opnfv_net_public_gw} + name_servers: {{ nm.dns_public }} diff --git a/mcp/reclass/classes/cluster/mcp-odl-noha/openstack/gateway.yml b/mcp/reclass/classes/cluster/mcp-odl-noha/openstack/gateway.yml index e554eb6b6..678740f40 100644 --- a/mcp/reclass/classes/cluster/mcp-odl-noha/openstack/gateway.yml +++ b/mcp/reclass/classes/cluster/mcp-odl-noha/openstack/gateway.yml @@ -20,6 +20,6 @@ parameters: mtu: ${_param:interface_mtu} proto: static address: ${_param:tenant_address} - netmask: 255.255.255.0 + netmask: ${_param:opnfv_net_private_mask} use_interfaces: - ${_param:tenant_interface} diff --git a/mcp/reclass/classes/cluster/mcp-ovn-ha/openstack/compute_pdf.yml.j2 b/mcp/reclass/classes/cluster/mcp-ovn-ha/openstack/compute_pdf.yml.j2 index 7cf4c8864..cc39db11a 100644 --- a/mcp/reclass/classes/cluster/mcp-ovn-ha/openstack/compute_pdf.yml.j2 +++ b/mcp/reclass/classes/cluster/mcp-ovn-ha/openstack/compute_pdf.yml.j2 @@ -6,6 +6,7 @@ # http://www.apache.org/licenses/LICENSE-2.0 ############################################################################## {%- import 'net_map.j2' as nm with context %} +{%- import 'net_macros.j2' as ma with context %} {#- Filter-out NIC duplicates by constructing a dict (used NICs only) #} {%- set nics = { nm.cmp001.nic_private: True } %} {%- set vlan_private_start = (nm.vlan_private | string).rsplit('-')[0] %} @@ -15,35 +16,16 @@ parameters: linux: network: interface: -{%- for nic in nics %} - {{ nic }}: - enabled: true - type: eth - {%- if nic == nm.cmp001.nic_admin %} - proto: dhcp - {%- else %} - proto: manual - {%- endif %} - name: {{ nic }} -{%- endfor %} -{%- for vlan in vlans %} - {%- if vlan | int > 0 %} - {{ vlans[vlan] }}.{{ vlan }}: - enabled: true - proto: manual - type: vlan - name: {{ vlans[vlan] }}.{{ vlan }} - use_interfaces: - - {{ vlans[vlan] }} - {%- endif %} -{%- endfor %} +{{ ma.linux_network_interfaces_nic(nics) }} + +{{ ma.linux_network_interfaces_vlan(vlans) }} br-mesh: enabled: true type: bridge address: ${_param:tenant_address} - netmask: 255.255.255.0 + netmask: ${_param:opnfv_net_private_mask} mtu: 1500 use_interfaces: - - {{ nm.cmp001.nic_private }}{% if vlan_private_start | int > 0 %}.{{ vlan_private_start }}{% endif %} + - {{ ma.interface_str(nm.cmp001.nic_private, vlan_private_start) }} diff --git a/mcp/reclass/classes/cluster/mcp-ovn-noha/openstack/compute.yml b/mcp/reclass/classes/cluster/mcp-ovn-noha/openstack/compute.yml deleted file mode 100644 index f8183e7f8..000000000 --- a/mcp/reclass/classes/cluster/mcp-ovn-noha/openstack/compute.yml +++ /dev/null @@ -1,52 +0,0 @@ -############################################################################## -# Copyright (c) 2018 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: - - service.neutron.compute.ovn.single - - cluster.mcp-common-noha.openstack_compute - - cluster.mcp-ovn-noha -parameters: - neutron: - compute: - controller_vip: ${_param:cluster_local_address} - linux: - network: - interface: - external_interface: - enabled: true - name: ${_param:external_interface} - mtu: ${_param:interface_mtu} - proto: manual - type: eth - br-mesh: - enabled: true - type: bridge - proto: static - address: ${_param:tenant_address} - netmask: 255.255.255.0 - use_interfaces: - - ${_param:tenant_interface} - br-floating: - enabled: true - type: ovs_bridge - mtu: ${_param:interface_mtu} - float-to-ex: - enabled: true - type: ovs_port - mtu: ${_param:interface_mtu} - bridge: br-floating - br-ex: - enabled: true - type: bridge - mtu: ${_param:interface_mtu} - address: ${_param:external_address} - netmask: 255.255.255.0 - use_interfaces: - - ${_param:external_interface} - use_ovs_ports: - - float-to-ex diff --git a/mcp/reclass/classes/cluster/mcp-ovn-noha/openstack/compute.yml.j2 b/mcp/reclass/classes/cluster/mcp-ovn-noha/openstack/compute.yml.j2 new file mode 100644 index 000000000..89ba3b074 --- /dev/null +++ b/mcp/reclass/classes/cluster/mcp-ovn-noha/openstack/compute.yml.j2 @@ -0,0 +1,55 @@ +############################################################################## +# Copyright (c) 2018 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 +############################################################################## +{%- import 'net_map.j2' as nm with context %} +--- +classes: + - service.neutron.compute.ovn.single + - cluster.mcp-common-noha.openstack_compute + - cluster.mcp-ovn-noha +parameters: + neutron: + compute: + controller_vip: ${_param:cluster_local_address} + linux: + network: + interface: + external_interface: + enabled: true + name: ${_param:external_interface} + mtu: ${_param:interface_mtu} + proto: manual + type: eth + br-mesh: + enabled: true + type: bridge + proto: static + address: ${_param:tenant_address} + netmask: ${_param:opnfv_net_private_mask} + use_interfaces: + - ${_param:tenant_interface} + br-floating: + enabled: true + type: ovs_bridge + mtu: ${_param:interface_mtu} + float-to-ex: + enabled: true + type: ovs_port + mtu: ${_param:interface_mtu} + bridge: br-floating + br-ex: + enabled: true + type: bridge + mtu: ${_param:interface_mtu} + address: ${_param:external_address} + netmask: ${_param:opnfv_net_public_mask} + use_interfaces: + - ${_param:external_interface} + use_ovs_ports: + - float-to-ex + gateway: ${_param:opnfv_net_public_gw} + name_servers: {{ nm.dns_public }} diff --git a/mcp/reclass/classes/cluster/mcp-ovs-dpdk-ha/infra/config.yml b/mcp/reclass/classes/cluster/mcp-ovs-dpdk-ha/infra/config.yml index 6c14d916a..8c175712a 100644 --- a/mcp/reclass/classes/cluster/mcp-ovs-dpdk-ha/infra/config.yml +++ b/mcp/reclass/classes/cluster/mcp-ovs-dpdk-ha/infra/config.yml @@ -9,4 +9,4 @@ classes: - cluster.mcp-common-ha.infra.config - cluster.mcp-ovs-dpdk-ha.infra - - cluster.all-mcp-arch-common.infra.config_dpdk_pdf + - cluster.all-mcp-arch-common.infra.config_pdf diff --git a/mcp/reclass/classes/cluster/mcp-ovs-dpdk-noha/infra/config.yml b/mcp/reclass/classes/cluster/mcp-ovs-dpdk-noha/infra/config.yml index 08c23026f..721eba56c 100644 --- a/mcp/reclass/classes/cluster/mcp-ovs-dpdk-noha/infra/config.yml +++ b/mcp/reclass/classes/cluster/mcp-ovs-dpdk-noha/infra/config.yml @@ -10,7 +10,7 @@ classes: - system.reclass.storage.system.openstack_gateway_single - cluster.mcp-common-noha.infra.config - cluster.mcp-ovs-dpdk-noha - - cluster.all-mcp-arch-common.infra.config_dpdk_pdf + - cluster.all-mcp-arch-common.infra.config_pdf parameters: reclass: storage: @@ -19,3 +19,4 @@ parameters: params: tenant_address: ${_param:opnfv_openstack_gateway_node01_tenant_address} external_address: ${_param:opnfv_openstack_gateway_node01_external_address} + pxe_admin_address: ${_param:opnfv_openstack_gateway_node01_pxe_admin_address} diff --git a/mcp/reclass/classes/cluster/mcp-ovs-dpdk-noha/openstack/compute.yml b/mcp/reclass/classes/cluster/mcp-ovs-dpdk-noha/openstack/compute.yml deleted file mode 100644 index a4d6b8dd2..000000000 --- a/mcp/reclass/classes/cluster/mcp-ovs-dpdk-noha/openstack/compute.yml +++ /dev/null @@ -1,35 +0,0 @@ -############################################################################## -# Copyright (c) 2018 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.nova.compute.nfv.hugepages - - system.neutron.compute.nfv.dpdk - - service.neutron.compute.single - - cluster.mcp-common-noha.openstack_compute - - cluster.mcp-ovs-dpdk-noha -parameters: - neutron: - compute: - backend: - tenant_network_types: ${_param:neutron_tenant_network_types} - linux: - network: - interface: - dpdk0: - name: ${_param:dpdk0_name} - pci: ${_param:dpdk0_pci} - driver: ${_param:dpdk0_driver} - enabled: true - bridge: br-prv - type: dpdk_ovs_port - n_rxq: ${_param:dpdk0_n_rxq} - br-prv: - enabled: true - type: dpdk_ovs_bridge - tenant_interface: - type: dpdk # Not a meaningful type, just match 'dpdk' for filtering diff --git a/mcp/reclass/classes/cluster/mcp-ovs-dpdk-noha/openstack/compute.yml.j2 b/mcp/reclass/classes/cluster/mcp-ovs-dpdk-noha/openstack/compute.yml.j2 new file mode 100644 index 000000000..3e4eeceab --- /dev/null +++ b/mcp/reclass/classes/cluster/mcp-ovs-dpdk-noha/openstack/compute.yml.j2 @@ -0,0 +1,41 @@ +############################################################################## +# Copyright (c) 2018 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 +############################################################################## +{%- import 'net_map.j2' as nm with context %} +--- +classes: + - system.nova.compute.nfv.hugepages + - system.neutron.compute.nfv.dpdk + - service.neutron.compute.single + - cluster.mcp-common-noha.openstack_compute + - cluster.mcp-ovs-dpdk-noha +parameters: + neutron: + compute: + backend: + tenant_network_types: ${_param:neutron_tenant_network_types} + linux: + network: + interface: + pxe_admin_int: + # For scenarios without public network on cmp, set admin gw + gateway: {{ nm.net_admin_gw }} + name_servers: + - {{ nm.net_admin_gw }} + dpdk0: + name: ${_param:dpdk0_name} + pci: ${_param:dpdk0_pci} + driver: ${_param:dpdk0_driver} + enabled: true + bridge: br-prv + type: dpdk_ovs_port + n_rxq: ${_param:dpdk0_n_rxq} + br-prv: + enabled: true + type: dpdk_ovs_bridge + tenant_interface: + type: dpdk # Not a meaningful type, just match 'dpdk' for filtering diff --git a/mcp/reclass/classes/cluster/mcp-ovs-ha/openstack/compute_pdf.yml.j2 b/mcp/reclass/classes/cluster/mcp-ovs-ha/openstack/compute_pdf.yml.j2 index 7cf4c8864..cc39db11a 100644 --- a/mcp/reclass/classes/cluster/mcp-ovs-ha/openstack/compute_pdf.yml.j2 +++ b/mcp/reclass/classes/cluster/mcp-ovs-ha/openstack/compute_pdf.yml.j2 @@ -6,6 +6,7 @@ # http://www.apache.org/licenses/LICENSE-2.0 ############################################################################## {%- import 'net_map.j2' as nm with context %} +{%- import 'net_macros.j2' as ma with context %} {#- Filter-out NIC duplicates by constructing a dict (used NICs only) #} {%- set nics = { nm.cmp001.nic_private: True } %} {%- set vlan_private_start = (nm.vlan_private | string).rsplit('-')[0] %} @@ -15,35 +16,16 @@ parameters: linux: network: interface: -{%- for nic in nics %} - {{ nic }}: - enabled: true - type: eth - {%- if nic == nm.cmp001.nic_admin %} - proto: dhcp - {%- else %} - proto: manual - {%- endif %} - name: {{ nic }} -{%- endfor %} -{%- for vlan in vlans %} - {%- if vlan | int > 0 %} - {{ vlans[vlan] }}.{{ vlan }}: - enabled: true - proto: manual - type: vlan - name: {{ vlans[vlan] }}.{{ vlan }} - use_interfaces: - - {{ vlans[vlan] }} - {%- endif %} -{%- endfor %} +{{ ma.linux_network_interfaces_nic(nics) }} + +{{ ma.linux_network_interfaces_vlan(vlans) }} br-mesh: enabled: true type: bridge address: ${_param:tenant_address} - netmask: 255.255.255.0 + netmask: ${_param:opnfv_net_private_mask} mtu: 1500 use_interfaces: - - {{ nm.cmp001.nic_private }}{% if vlan_private_start | int > 0 %}.{{ vlan_private_start }}{% endif %} + - {{ ma.interface_str(nm.cmp001.nic_private, vlan_private_start) }} diff --git a/mcp/reclass/classes/cluster/mcp-ovs-noha/infra/config.yml b/mcp/reclass/classes/cluster/mcp-ovs-noha/infra/config.yml index 6835a2622..cd8a9e4ad 100644 --- a/mcp/reclass/classes/cluster/mcp-ovs-noha/infra/config.yml +++ b/mcp/reclass/classes/cluster/mcp-ovs-noha/infra/config.yml @@ -19,3 +19,4 @@ parameters: params: tenant_address: ${_param:opnfv_openstack_gateway_node01_tenant_address} external_address: ${_param:opnfv_openstack_gateway_node01_external_address} + pxe_admin_address: ${_param:opnfv_openstack_gateway_node01_pxe_admin_address} diff --git a/mcp/reclass/classes/cluster/mcp-ovs-noha/openstack/compute.yml b/mcp/reclass/classes/cluster/mcp-ovs-noha/openstack/compute.yml deleted file mode 100644 index beddc4ae8..000000000 --- a/mcp/reclass/classes/cluster/mcp-ovs-noha/openstack/compute.yml +++ /dev/null @@ -1,24 +0,0 @@ -############################################################################## -# Copyright (c) 2018 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: - - service.neutron.compute.single - - cluster.mcp-common-noha.openstack_compute - - cluster.mcp-ovs-noha -parameters: - linux: - network: - interface: - br-mesh: - enabled: true - type: bridge - proto: static - address: ${_param:tenant_address} - netmask: 255.255.255.0 - use_interfaces: - - ${_param:tenant_interface} diff --git a/mcp/reclass/classes/cluster/mcp-ovs-noha/openstack/compute.yml.j2 b/mcp/reclass/classes/cluster/mcp-ovs-noha/openstack/compute.yml.j2 new file mode 100644 index 000000000..c949de4f4 --- /dev/null +++ b/mcp/reclass/classes/cluster/mcp-ovs-noha/openstack/compute.yml.j2 @@ -0,0 +1,30 @@ +############################################################################## +# Copyright (c) 2018 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 +############################################################################## +{%- import 'net_map.j2' as nm with context %} +--- +classes: + - service.neutron.compute.single + - cluster.mcp-common-noha.openstack_compute + - cluster.mcp-ovs-noha +parameters: + linux: + network: + interface: + pxe_admin_int: + # For scenarios without public network on cmp, set admin gw + gateway: {{ nm.net_admin_gw }} + name_servers: + - {{ nm.net_admin_gw }} + br-mesh: + enabled: true + type: bridge + proto: static + address: ${_param:tenant_address} + netmask: ${_param:opnfv_net_private_mask} + use_interfaces: + - ${_param:tenant_interface} diff --git a/mcp/reclass/classes/cluster/mcp-ovs-noha/openstack/gateway.yml b/mcp/reclass/classes/cluster/mcp-ovs-noha/openstack/gateway.yml index b5dfcd40d..5c5547cfc 100644 --- a/mcp/reclass/classes/cluster/mcp-ovs-noha/openstack/gateway.yml +++ b/mcp/reclass/classes/cluster/mcp-ovs-noha/openstack/gateway.yml @@ -20,6 +20,6 @@ parameters: mtu: ${_param:interface_mtu} proto: static address: ${_param:tenant_address} - netmask: 255.255.255.0 + netmask: ${_param:opnfv_net_private_mask} use_interfaces: - ${_param:tenant_interface} diff --git a/mcp/salt-formulas/maas/pxe_nat.sls b/mcp/salt-formulas/maas/pxe_nat.sls index 701bae07a..8a03c4fdb 100644 --- a/mcp/salt-formulas/maas/pxe_nat.sls +++ b/mcp/salt-formulas/maas/pxe_nat.sls @@ -15,7 +15,7 @@ iptables_pxe_nat: - chain: POSTROUTING - jump: MASQUERADE - destination: 0/0 - - source: {{ salt['pillar.get']('_param:single_address') }}/24 + - source: {{ salt['pillar.get']('_param:single_address') }}/{{ salt['pillar.get']('_param:opnfv_net_admin_mask') }} - save: True iptables_pxe_source: @@ -24,7 +24,7 @@ iptables_pxe_source: - chain: INPUT - jump: ACCEPT - destination: 0/0 - - source: {{ salt['pillar.get']('_param:single_address') }}/24 + - source: {{ salt['pillar.get']('_param:single_address') }}/{{ salt['pillar.get']('_param:opnfv_net_admin_mask') }} - save: True iptables_pxe_destination: @@ -32,6 +32,6 @@ iptables_pxe_destination: - table: filter - chain: INPUT - jump: ACCEPT - - destination: {{ salt['pillar.get']('_param:single_address') }}/24 + - destination: {{ salt['pillar.get']('_param:single_address') }}/{{ salt['pillar.get']('_param:opnfv_net_admin_mask') }} - source: 0/0 - save: True diff --git a/mcp/scripts/lib_template.sh b/mcp/scripts/lib_template.sh index 0fbe628b7..4b5b0563d 100644 --- a/mcp/scripts/lib_template.sh +++ b/mcp/scripts/lib_template.sh @@ -50,6 +50,7 @@ function do_templates_scenario { fi fi if ! "${PHAROS_GEN_CFG}" -y "${LOCAL_PDF}" \ + -i "$(dirname "$(readlink -f "${PHAROS_IA}")")" \ -j "${PHAROS_IA}" -v > "${image_dir}/pod_config.yml"; then notify_e "[ERROR] Could not convert PDF+IDF to reclass model input!" fi diff --git a/mcp/scripts/pharos b/mcp/scripts/pharos index 70f8d6376..9184b745e 160000 --- a/mcp/scripts/pharos +++ b/mcp/scripts/pharos @@ -1 +1 @@ -Subproject commit 70f8d63761a0d52790f634642785c9e8bc0d7419 +Subproject commit 9184b745eee64dda19be05d6d01cc2519dcb6031 diff --git a/mcp/scripts/salt.sh b/mcp/scripts/salt.sh index fae644e07..4a20bc413 100755 --- a/mcp/scripts/salt.sh +++ b/mcp/scripts/salt.sh @@ -64,7 +64,6 @@ ssh ${SSH_OPTS} "${SSH_SALT}" bash -s -e << SALT_INSTALL_END ln -sf ${OPNFV_FUEL_DIR}/mcp/reclass /srv/salt ln -sf ${OPNFV_FUEL_DIR}/mcp/deploy/scripts /srv/salt ln -sf ${OPNFV_FUEL_DIR}/mcp/scripts/mcp.rsa $(dirname "${OPNFV_FUEL_DIR}") - cd /srv/salt/${OPNFV_RDIR} && rm -f arch && ln -sf "\$(uname -i)" arch cp -r ${OPNFV_FUEL_DIR}/mcp/metadata/service /usr/share/salt-formulas/reclass cd /srv/salt/reclass/classes/service && \ diff --git a/mcp/scripts/user-data.admin.sh.j2 b/mcp/scripts/user-data.admin.sh.j2 index d9b86c79c..d77773260 100644 --- a/mcp/scripts/user-data.admin.sh.j2 +++ b/mcp/scripts/user-data.admin.sh.j2 @@ -6,9 +6,9 @@ # which accompanies this distribution, and is available at # http://www.apache.org/licenses/LICENSE-2.0 ############################################################################## +{%- import 'net_map.j2' as nm with context %} rm /etc/salt/minion_id rm -f /etc/salt/pki/minion/minion_master.pub echo "id: $(hostname).{{ conf.cluster.domain }}" > /etc/salt/minion -{#- should be in sync with 'opnfv_infra_config_pxe_address' in 'pharos/config/installers/fuel/pod_config.yml.j2 #} -echo "master: {{ conf.idf.net_config.admin.network | ipaddr_index(2) }}" >> /etc/salt/minion +echo "master: {{ nm.net_admin | ipnet_hostaddr(nm.start_ip[nm.net_admin] + nm.net_admin_hosts.index('opnfv_infra_config_pxe_admin_address') +1) }}" >> /etc/salt/minion service salt-minion restart diff --git a/mcp/scripts/virsh_net/net_mcpcontrol.xml.j2 b/mcp/scripts/virsh_net/net_mcpcontrol.xml.j2 index 95424db4e..569fa7089 100644 --- a/mcp/scripts/virsh_net/net_mcpcontrol.xml.j2 +++ b/mcp/scripts/virsh_net/net_mcpcontrol.xml.j2 @@ -7,13 +7,14 @@ http://www.apache.org/licenses/LICENSE-2.0 --> {#- conf.MCPCONTROL_NET & co are mandatory, defaults are set via globals.sh #} +{%- set net_mcpcontrol = [conf.MCPCONTROL_NET, conf.MCPCONTROL_PREFIX] | join("/") %} mcpcontrol - + - + diff --git a/mcp/scripts/virsh_net/net_mgmt.xml.j2 b/mcp/scripts/virsh_net/net_mgmt.xml.j2 index a558293fa..23b32f2f4 100644 --- a/mcp/scripts/virsh_net/net_mgmt.xml.j2 +++ b/mcp/scripts/virsh_net/net_mgmt.xml.j2 @@ -6,15 +6,9 @@ which accompanies this distribution, and is available at http://www.apache.org/licenses/LICENSE-2.0 --> -{%- if conf.idf.net_config.mgmt is defined %} - {%- set mgmt_network = conf.idf.net_config.mgmt.network %} - {%- set mgmt_prefix = conf.idf.net_config.mgmt.mask %} -{%- else %} - {%- set mgmt_network = '172.16.10.0' %} - {%- set mgmt_prefix = '24' %} -{%- endif %} +{%- import 'net_map.j2' as nm with context %} mgmt - + diff --git a/mcp/scripts/virsh_net/net_public.xml.j2 b/mcp/scripts/virsh_net/net_public.xml.j2 index 737b638b3..a9e8349f4 100644 --- a/mcp/scripts/virsh_net/net_public.xml.j2 +++ b/mcp/scripts/virsh_net/net_public.xml.j2 @@ -6,27 +6,15 @@ which accompanies this distribution, and is available at http://www.apache.org/licenses/LICENSE-2.0 --> -{%- set cluster = {'has_virtual_nodes': False} %} -{%- for node in conf.nodes %} - {%- if not cluster.has_virtual_nodes and node.node.type == 'virtual' %} - {%- do cluster.update({'has_virtual_nodes': True}) %} - {%- endif %} -{%- endfor %} -{%- if conf.idf.net_config.public is defined %} - {%- set public_network = conf.idf.net_config.public.network %} - {%- set public_prefix = conf.idf.net_config.public.mask %} -{%- else %} - {%- set public_network = '10.16.0.0' %} - {%- set public_prefix = '24' %} -{%- endif %} +{%- import 'net_map.j2' as nm with context %} public -{%- if cluster.has_virtual_nodes %} +{%- if nm.cluster.has_virtual_nodes %} {#- Ideally, jumpserver would have a real Linux bridge we will hook to. In case it doesn't, we use this virsh network as a *mock* public. The *mock* public should NOT overlap with the real public in any way. #} - + {%- endif %} diff --git a/mcp/scripts/virsh_net/net_pxebr.xml.j2 b/mcp/scripts/virsh_net/net_pxebr.xml.j2 index f82780cf7..1c48e9b1a 100644 --- a/mcp/scripts/virsh_net/net_pxebr.xml.j2 +++ b/mcp/scripts/virsh_net/net_pxebr.xml.j2 @@ -6,21 +6,14 @@ which accompanies this distribution, and is available at http://www.apache.org/licenses/LICENSE-2.0 --> -{%- if conf.idf.net_config.admin is defined %} - {%- set pxebr_network = conf.idf.net_config.admin.network %} - {%- set pxebr_prefix = conf.idf.net_config.admin.mask %} -{%- else %} - {%- set pxebr_network = '192.168.11.0' %} - {%- set pxebr_prefix = '24' %} -{%- endif %} +{%- import 'net_map.j2' as nm with context %} pxebr - - + - + -- cgit 1.2.3-korg