From 97b118133edd82d2558fc169ab3974cb0b5b3946 Mon Sep 17 00:00:00 2001 From: Alexandru Avadanii Date: Sun, 10 Sep 2017 01:52:18 +0200 Subject: reclass: Multiarch support for arch specific param Introduce a simple mechanism that simulates an 'if-arch-then' cond for reclass models: - add new class hierarchy; - at runtime (via ) make 'all-mcp-ocata-common.arch' point to 'all-mcp-ocata-common.$(uname -i)' dynamically; - inherit new 'arch' class in all cluster models; - factor out current x86_64 default for "salt_control_xenial_image"; - add AArch64 default for param "salt_control_xenial_image"; Change-Id: I3b239b28d0fd1cc2ced8579e2e93b764eb71ffc3 Signed-off-by: Alexandru Avadanii --- mcp/reclass/classes/cluster/README.rst | 23 ++++++++++++++++++++++ .../cluster/all-mcp-ocata-common/aarch64/init.yml | 3 +++ .../classes/cluster/all-mcp-ocata-common/init.yml | 2 ++ .../cluster/all-mcp-ocata-common/x86_64/init.yml | 3 +++ .../baremetal-mcp-ocata-odl-ha/infra/init.yml | 1 - .../cluster/baremetal-mcp-ocata-odl-ha/init.yml | 1 + .../baremetal-mcp-ocata-ovs-dpdk-ha/infra/init.yml | 1 - .../baremetal-mcp-ocata-ovs-dpdk-ha/init.yml | 1 + .../baremetal-mcp-ocata-ovs-ha/infra/init.yml | 1 - .../cluster/baremetal-mcp-ocata-ovs-ha/init.yml | 1 + .../cluster/virtual-mcp-ocata-odl-router/init.yml | 1 + .../cluster/virtual-mcp-ocata-ovs-dpdk/init.yml | 1 + .../classes/cluster/virtual-mcp-ocata-ovs/init.yml | 1 + 13 files changed, 37 insertions(+), 3 deletions(-) create mode 100644 mcp/reclass/classes/cluster/README.rst create mode 100644 mcp/reclass/classes/cluster/all-mcp-ocata-common/aarch64/init.yml create mode 100644 mcp/reclass/classes/cluster/all-mcp-ocata-common/init.yml create mode 100644 mcp/reclass/classes/cluster/all-mcp-ocata-common/x86_64/init.yml (limited to 'mcp/reclass') diff --git a/mcp/reclass/classes/cluster/README.rst b/mcp/reclass/classes/cluster/README.rst new file mode 100644 index 000000000..3fec9b0f2 --- /dev/null +++ b/mcp/reclass/classes/cluster/README.rst @@ -0,0 +1,23 @@ +.. This work is licensed under a Creative Commons Attribution 4.0 International License. +.. http://creativecommons.org/licenses/by/4.0 +.. (c) 2017 Mirantis Inc., Enea AB and others. + +Fuel@OPNFV Cluster Reclass Models +================================= + +Overview +-------- + +#. Common classes (baremetal + virtual) + + - all-mcp-ocata-common + +#. Common classes (specific to either baremetal or virtual deploys) + + - baremetal-mcp-ocata-common + - virtual-mcp-ocata-common + +#. Cluster specific classes + + - baremetal-mcp-ocata-* + - virtual-mcp-ocata-* diff --git a/mcp/reclass/classes/cluster/all-mcp-ocata-common/aarch64/init.yml b/mcp/reclass/classes/cluster/all-mcp-ocata-common/aarch64/init.yml new file mode 100644 index 000000000..05aa5d237 --- /dev/null +++ b/mcp/reclass/classes/cluster/all-mcp-ocata-common/aarch64/init.yml @@ -0,0 +1,3 @@ +parameters: + _param: + salt_control_xenial_image: https://cloud-images.ubuntu.com/xenial/current/xenial-server-cloudimg-arm64-uefi1.img diff --git a/mcp/reclass/classes/cluster/all-mcp-ocata-common/init.yml b/mcp/reclass/classes/cluster/all-mcp-ocata-common/init.yml new file mode 100644 index 000000000..1139b9d72 --- /dev/null +++ b/mcp/reclass/classes/cluster/all-mcp-ocata-common/init.yml @@ -0,0 +1,2 @@ +classes: +- cluster.all-mcp-ocata-common.arch diff --git a/mcp/reclass/classes/cluster/all-mcp-ocata-common/x86_64/init.yml b/mcp/reclass/classes/cluster/all-mcp-ocata-common/x86_64/init.yml new file mode 100644 index 000000000..87865fd4e --- /dev/null +++ b/mcp/reclass/classes/cluster/all-mcp-ocata-common/x86_64/init.yml @@ -0,0 +1,3 @@ +parameters: + _param: + salt_control_xenial_image: http://apt.mirantis.com/images/ubuntu-16-04-x64-latest.qcow2 diff --git a/mcp/reclass/classes/cluster/baremetal-mcp-ocata-odl-ha/infra/init.yml b/mcp/reclass/classes/cluster/baremetal-mcp-ocata-odl-ha/infra/init.yml index 0baebb65e..f1769d714 100644 --- a/mcp/reclass/classes/cluster/baremetal-mcp-ocata-odl-ha/infra/init.yml +++ b/mcp/reclass/classes/cluster/baremetal-mcp-ocata-odl-ha/infra/init.yml @@ -54,7 +54,6 @@ parameters: address: ${_param:single_address} netmask: 255.255.255.0 - salt_control_xenial_image: http://apt.mirantis.com/images/ubuntu-16-04-x64-latest.qcow2 salt_api_password_hash: "$6$WV0P1shnoDh2gI/Z$22/Bcd7ffMv0jDlFpT63cAU4PiXHz9pjXwngToKwqAsgoeK4HNR3PiKaushjxp3JsQ8hNoJmAC6TxzVqfV8WH/" linux: system: diff --git a/mcp/reclass/classes/cluster/baremetal-mcp-ocata-odl-ha/init.yml b/mcp/reclass/classes/cluster/baremetal-mcp-ocata-odl-ha/init.yml index 92d662c82..b2c795fdd 100644 --- a/mcp/reclass/classes/cluster/baremetal-mcp-ocata-odl-ha/init.yml +++ b/mcp/reclass/classes/cluster/baremetal-mcp-ocata-odl-ha/init.yml @@ -1,3 +1,4 @@ classes: +- cluster.all-mcp-ocata-common - cluster.baremetal-mcp-ocata-odl-ha.infra - cluster.baremetal-mcp-ocata-odl-ha.openstack diff --git a/mcp/reclass/classes/cluster/baremetal-mcp-ocata-ovs-dpdk-ha/infra/init.yml b/mcp/reclass/classes/cluster/baremetal-mcp-ocata-ovs-dpdk-ha/infra/init.yml index 0bd74f832..1389aefff 100644 --- a/mcp/reclass/classes/cluster/baremetal-mcp-ocata-ovs-dpdk-ha/infra/init.yml +++ b/mcp/reclass/classes/cluster/baremetal-mcp-ocata-ovs-dpdk-ha/infra/init.yml @@ -54,7 +54,6 @@ parameters: address: ${_param:single_address} netmask: 255.255.255.0 - salt_control_xenial_image: http://apt.mirantis.com/images/ubuntu-16-04-x64-latest.qcow2 salt_api_password_hash: "$6$WV0P1shnoDh2gI/Z$22/Bcd7ffMv0jDlFpT63cAU4PiXHz9pjXwngToKwqAsgoeK4HNR3PiKaushjxp3JsQ8hNoJmAC6TxzVqfV8WH/" linux: system: diff --git a/mcp/reclass/classes/cluster/baremetal-mcp-ocata-ovs-dpdk-ha/init.yml b/mcp/reclass/classes/cluster/baremetal-mcp-ocata-ovs-dpdk-ha/init.yml index 1147d35be..1b839fb19 100644 --- a/mcp/reclass/classes/cluster/baremetal-mcp-ocata-ovs-dpdk-ha/init.yml +++ b/mcp/reclass/classes/cluster/baremetal-mcp-ocata-ovs-dpdk-ha/init.yml @@ -1,3 +1,4 @@ classes: +- cluster.all-mcp-ocata-common - cluster.baremetal-mcp-ocata-ovs-dpdk-ha.infra - cluster.baremetal-mcp-ocata-ovs-dpdk-ha.openstack diff --git a/mcp/reclass/classes/cluster/baremetal-mcp-ocata-ovs-ha/infra/init.yml b/mcp/reclass/classes/cluster/baremetal-mcp-ocata-ovs-ha/infra/init.yml index 62f887d1e..d7e365a1b 100644 --- a/mcp/reclass/classes/cluster/baremetal-mcp-ocata-ovs-ha/infra/init.yml +++ b/mcp/reclass/classes/cluster/baremetal-mcp-ocata-ovs-ha/infra/init.yml @@ -54,7 +54,6 @@ parameters: address: ${_param:single_address} netmask: 255.255.255.0 - salt_control_xenial_image: http://apt.mirantis.com/images/ubuntu-16-04-x64-latest.qcow2 salt_api_password_hash: "$6$WV0P1shnoDh2gI/Z$22/Bcd7ffMv0jDlFpT63cAU4PiXHz9pjXwngToKwqAsgoeK4HNR3PiKaushjxp3JsQ8hNoJmAC6TxzVqfV8WH/" linux: system: diff --git a/mcp/reclass/classes/cluster/baremetal-mcp-ocata-ovs-ha/init.yml b/mcp/reclass/classes/cluster/baremetal-mcp-ocata-ovs-ha/init.yml index 402923973..e571689ef 100644 --- a/mcp/reclass/classes/cluster/baremetal-mcp-ocata-ovs-ha/init.yml +++ b/mcp/reclass/classes/cluster/baremetal-mcp-ocata-ovs-ha/init.yml @@ -1,3 +1,4 @@ classes: +- cluster.all-mcp-ocata-common - cluster.baremetal-mcp-ocata-ovs-ha.infra - cluster.baremetal-mcp-ocata-ovs-ha.openstack diff --git a/mcp/reclass/classes/cluster/virtual-mcp-ocata-odl-router/init.yml b/mcp/reclass/classes/cluster/virtual-mcp-ocata-odl-router/init.yml index e0311de55..20d6d18d3 100644 --- a/mcp/reclass/classes/cluster/virtual-mcp-ocata-odl-router/init.yml +++ b/mcp/reclass/classes/cluster/virtual-mcp-ocata-odl-router/init.yml @@ -1,5 +1,6 @@ classes: - system.linux.system.single +- cluster.all-mcp-ocata-common - cluster.virtual-mcp-ocata-common.init_options - cluster.virtual-mcp-ocata-common.infra - cluster.virtual-mcp-ocata-odl-router.openstack diff --git a/mcp/reclass/classes/cluster/virtual-mcp-ocata-ovs-dpdk/init.yml b/mcp/reclass/classes/cluster/virtual-mcp-ocata-ovs-dpdk/init.yml index 77e238057..e4e09b52b 100644 --- a/mcp/reclass/classes/cluster/virtual-mcp-ocata-ovs-dpdk/init.yml +++ b/mcp/reclass/classes/cluster/virtual-mcp-ocata-ovs-dpdk/init.yml @@ -1,5 +1,6 @@ classes: - system.linux.system.single +- cluster.all-mcp-ocata-common - cluster.virtual-mcp-ocata-common.init_options - cluster.virtual-mcp-ocata-common.infra - cluster.virtual-mcp-ocata-ovs-dpdk.openstack diff --git a/mcp/reclass/classes/cluster/virtual-mcp-ocata-ovs/init.yml b/mcp/reclass/classes/cluster/virtual-mcp-ocata-ovs/init.yml index 34dca1f5f..b6ff33202 100644 --- a/mcp/reclass/classes/cluster/virtual-mcp-ocata-ovs/init.yml +++ b/mcp/reclass/classes/cluster/virtual-mcp-ocata-ovs/init.yml @@ -1,5 +1,6 @@ classes: - system.linux.system.single +- cluster.all-mcp-ocata-common - cluster.virtual-mcp-ocata-common.init_options - cluster.virtual-mcp-ocata-common.infra - cluster.virtual-mcp-ocata-ovs.openstack -- cgit 1.2.3-korg From 0546e310ce230a46dcf3a3795c6a0baefd7aaaf2 Mon Sep 17 00:00:00 2001 From: Alexandru Avadanii Date: Sun, 10 Sep 2017 02:37:11 +0200 Subject: reclass: virtual: Factor out VM interface naming Define two groups of VM interface naming: - ens3..ens6 - used by infra VMs, virtual node VMs; - ens2..ens3 - used by VCP VMs (spawned by salt.control); Parametrize newly defined interface names throughout the cluster models. While at it, add AArch64 default values for above iface names. NOTE: baremetal clusters will be parametrized later, after common config is factored out into . Change-Id: I89aba9aaf85b585cc510302eb76d7810fbf60679 Signed-off-by: Alexandru Avadanii --- .../classes/cluster/all-mcp-ocata-common/aarch64/init.yml | 11 +++++++++++ .../classes/cluster/all-mcp-ocata-common/x86_64/init.yml | 11 +++++++++++ .../classes/cluster/virtual-mcp-ocata-common/infra/config.yml | 3 ++- .../cluster/virtual-mcp-ocata-common/openstack_compute.yml | 8 ++++---- .../cluster/virtual-mcp-ocata-common/openstack_control.yml | 6 ++++-- .../cluster/virtual-mcp-ocata-common/openstack_gateway.yml | 8 ++++---- .../virtual-mcp-ocata-odl-router/opendaylight/control.yml | 3 ++- .../cluster/virtual-mcp-ocata-ovs-dpdk/infra/config.yml | 4 ++-- 8 files changed, 40 insertions(+), 14 deletions(-) (limited to 'mcp/reclass') diff --git a/mcp/reclass/classes/cluster/all-mcp-ocata-common/aarch64/init.yml b/mcp/reclass/classes/cluster/all-mcp-ocata-common/aarch64/init.yml index 05aa5d237..daa89de66 100644 --- a/mcp/reclass/classes/cluster/all-mcp-ocata-common/aarch64/init.yml +++ b/mcp/reclass/classes/cluster/all-mcp-ocata-common/aarch64/init.yml @@ -1,3 +1,14 @@ parameters: _param: salt_control_xenial_image: https://cloud-images.ubuntu.com/xenial/current/xenial-server-cloudimg-arm64-uefi1.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 2) + # 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} diff --git a/mcp/reclass/classes/cluster/all-mcp-ocata-common/x86_64/init.yml b/mcp/reclass/classes/cluster/all-mcp-ocata-common/x86_64/init.yml index 87865fd4e..669eb7dc4 100644 --- a/mcp/reclass/classes/cluster/all-mcp-ocata-common/x86_64/init.yml +++ b/mcp/reclass/classes/cluster/all-mcp-ocata-common/x86_64/init.yml @@ -1,3 +1,14 @@ parameters: _param: salt_control_xenial_image: http://apt.mirantis.com/images/ubuntu-16-04-x64-latest.qcow2 + + # 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 2) + # NOTE(armband): Only x86 VCP VMs spawned via salt.control names differ + opnfv_vcp_vm_primary_interface: ens2 + opnfv_vcp_vm_secondary_interface: ens3 diff --git a/mcp/reclass/classes/cluster/virtual-mcp-ocata-common/infra/config.yml b/mcp/reclass/classes/cluster/virtual-mcp-ocata-common/infra/config.yml index a5fc3b1d3..d60c81dd1 100644 --- a/mcp/reclass/classes/cluster/virtual-mcp-ocata-common/infra/config.yml +++ b/mcp/reclass/classes/cluster/virtual-mcp-ocata-common/infra/config.yml @@ -25,8 +25,9 @@ parameters: linux: network: interface: - ens4: + single_int: enabled: true + name: ${_param:opnfv_fn_vm_secondary_interface} type: eth proto: static address: ${_param:single_address} diff --git a/mcp/reclass/classes/cluster/virtual-mcp-ocata-common/openstack_compute.yml b/mcp/reclass/classes/cluster/virtual-mcp-ocata-common/openstack_compute.yml index 0cb7ccb01..2485d1ff2 100644 --- a/mcp/reclass/classes/cluster/virtual-mcp-ocata-common/openstack_compute.yml +++ b/mcp/reclass/classes/cluster/virtual-mcp-ocata-common/openstack_compute.yml @@ -12,9 +12,9 @@ classes: - system.ceilometer.client.cinder_volume parameters: _param: - primary_interface: ens4 - tenant_interface: ens5 - external_interface: ens6 + primary_interface: ${_param:opnfv_fn_vm_secondary_interface} + tenant_interface: ${_param:opnfv_fn_vm_tertiary_interface} + external_interface: ${_param:opnfv_fn_vm_quaternary_interface} interface_mtu: 9000 linux_system_codename: xenial loopback_device_size: 10 @@ -50,7 +50,7 @@ parameters: interface: dhcp_int: enabled: true - name: ens3 + name: ${_param:opnfv_fn_vm_primary_interface} proto: dhcp type: eth mtu: ${_param:interface_mtu} diff --git a/mcp/reclass/classes/cluster/virtual-mcp-ocata-common/openstack_control.yml b/mcp/reclass/classes/cluster/virtual-mcp-ocata-common/openstack_control.yml index 0927900cb..5b68b7b62 100644 --- a/mcp/reclass/classes/cluster/virtual-mcp-ocata-common/openstack_control.yml +++ b/mcp/reclass/classes/cluster/virtual-mcp-ocata-common/openstack_control.yml @@ -48,14 +48,16 @@ parameters: version: latest network: interface: - ens4: + single_int: enabled: true + name: ${_param:opnfv_fn_vm_secondary_interface} type: eth proto: static address: ${_param:single_address} netmask: 255.255.255.0 - ens6: + public_int: enabled: true + name: ${_param:opnfv_fn_vm_quaternary_interface} type: eth proto: static address: ${_param:cluster_public_host} diff --git a/mcp/reclass/classes/cluster/virtual-mcp-ocata-common/openstack_gateway.yml b/mcp/reclass/classes/cluster/virtual-mcp-ocata-common/openstack_gateway.yml index 926259023..f726c4af2 100644 --- a/mcp/reclass/classes/cluster/virtual-mcp-ocata-common/openstack_gateway.yml +++ b/mcp/reclass/classes/cluster/virtual-mcp-ocata-common/openstack_gateway.yml @@ -4,9 +4,9 @@ classes: - system.linux.system.repo.saltstack.xenial parameters: _param: - primary_interface: ens4 - tenant_interface: ens5 - external_interface: ens6 + primary_interface: ${_param:opnfv_fn_vm_secondary_interface} + tenant_interface: ${_param:opnfv_fn_vm_tertiary_interface} + external_interface: ${_param:opnfv_fn_vm_quaternary_interface} interface_mtu: 9000 linux_system_codename: xenial neutron: @@ -19,7 +19,7 @@ parameters: interface: dhcp_int: enabled: true - name: ens3 + name: ${_param:opnfv_fn_vm_primary_interface} proto: dhcp type: eth mtu: ${_param:interface_mtu} diff --git a/mcp/reclass/classes/cluster/virtual-mcp-ocata-odl-router/opendaylight/control.yml b/mcp/reclass/classes/cluster/virtual-mcp-ocata-odl-router/opendaylight/control.yml index 6bc0f510e..8f83ddee8 100644 --- a/mcp/reclass/classes/cluster/virtual-mcp-ocata-odl-router/opendaylight/control.yml +++ b/mcp/reclass/classes/cluster/virtual-mcp-ocata-odl-router/opendaylight/control.yml @@ -10,8 +10,9 @@ parameters: linux: network: interface: - ens4: + single_int: enabled: true + name: ${_param:opnfv_fn_vm_secondary_interface} type: eth proto: static address: ${_param:single_address} diff --git a/mcp/reclass/classes/cluster/virtual-mcp-ocata-ovs-dpdk/infra/config.yml b/mcp/reclass/classes/cluster/virtual-mcp-ocata-ovs-dpdk/infra/config.yml index 87a42105f..784011ad0 100644 --- a/mcp/reclass/classes/cluster/virtual-mcp-ocata-ovs-dpdk/infra/config.yml +++ b/mcp/reclass/classes/cluster/virtual-mcp-ocata-ovs-dpdk/infra/config.yml @@ -7,9 +7,9 @@ parameters: node: openstack_compute_node01: params: - dpdk0_name: ens5 + dpdk0_name: ${_param:opnfv_fn_vm_tertiary_interface} dpdk0_pci: '"0000:00:05.0"' openstack_compute_node02: params: - dpdk0_name: ens5 + dpdk0_name: ${_param:opnfv_fn_vm_tertiary_interface} dpdk0_pci: '"0000:00:05.0"' -- cgit 1.2.3-korg