From 8c6d4ba39ff626c5f24bd84a2958b07692ea0294 Mon Sep 17 00:00:00 2001 From: Alexandru Avadanii Date: Sat, 19 Aug 2017 23:33:42 +0200 Subject: MaaS: Add support for dynamic fabric numbering Previously, we hardcoded the fabric name for our 3rd interface (which serves PXE/DHCP for the target nodes) to "fabric-2", relying on predictable index numbers to be provided by MaaS based on the interfaces defined in /etc/network/interfaces. However, the fabric IDs/names generated by MaaS are not predictable, and therefore cannot be hardcoded in our reclass model / scripts. Work around this by: - adding support for fabric ID deduction based on CIDR matching during subnet create/update operation in MaaS py module; - adding support for VLAN DHCP enablement to MaaS py module, which was previously handled via shell MaaS API operations from maas/region.sls; While at it, revert previous commit that disabled network discovery ("MaaS: Disable network discovery"), since it turns out that network discovery was not the culprit for subnet creation failure, but wrong fabric numbering. This reverts commit 8cdf22d1a1bae4694a373873cab4feb6251069b7. Change-Id: I15fa059004356cb4aaabb38999ea378dd3c0e0bb Signed-off-by: Alexandru Avadanii --- .../classes/cluster/baremetal-mcp-ocata-ovs-ha/infra/maas.yml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'mcp/reclass/classes/cluster') diff --git a/mcp/reclass/classes/cluster/baremetal-mcp-ocata-ovs-ha/infra/maas.yml b/mcp/reclass/classes/cluster/baremetal-mcp-ocata-ovs-ha/infra/maas.yml index cebcb90ae..d193469fc 100644 --- a/mcp/reclass/classes/cluster/baremetal-mcp-ocata-ovs-ha/infra/maas.yml +++ b/mcp/reclass/classes/cluster/baremetal-mcp-ocata-ovs-ha/infra/maas.yml @@ -29,18 +29,22 @@ parameters: disk_erase_with_secure_erase: false dnssec_validation: 'no' enable_third_party_drivers: true - network_discovery: 'disabled' + network_discovery: 'enabled' default_min_hwe_kernel: 'hwe-16.04' subnets: -# TODO: parametrize address root (192.168.11), fabric-2, dhcp start/end? + # TODO: parametrize address root (192.168.11), dhcp start/end? 192.168.11.0/24: - fabric: fabric-2 cidr: 192.168.11.0/24 gateway_ip: ${_param:single_address} iprange: start: 192.168.11.5 end: 192.168.11.250 type: dynamic + vlans: + untagged: + vid: 0 + dhcp_on: true + primary_rack: ${_param:infra_maas_node01_hostname} machines: kvm01: interface: -- cgit 1.2.3-korg