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 --- .../0005-maas-vlan-DHCP-enable-on-fabric-2.patch | 28 ---------------------- 1 file changed, 28 deletions(-) delete mode 100644 mcp/patches/0005-maas-vlan-DHCP-enable-on-fabric-2.patch (limited to 'mcp/patches/0005-maas-vlan-DHCP-enable-on-fabric-2.patch') diff --git a/mcp/patches/0005-maas-vlan-DHCP-enable-on-fabric-2.patch b/mcp/patches/0005-maas-vlan-DHCP-enable-on-fabric-2.patch deleted file mode 100644 index 777850446..000000000 --- a/mcp/patches/0005-maas-vlan-DHCP-enable-on-fabric-2.patch +++ /dev/null @@ -1,28 +0,0 @@ -From: Alexandru Avadanii -Date: Sat, 5 Aug 2017 02:03:01 +0200 -Subject: [PATCH] maas: vlan DHCP enable on fabric-2 - -MaaS custom py modules does not implement vlan API support, -so use MaaS CLI directly to enable DHCP on vlan 0 on fabric-2. - -Signed-off-by: Alexandru Avadanii -Signed-off-by: Guillermo Herrero ---- - -diff --git a/maas/region.sls b/maas/region.sls -index d3227ca..8a2243d 100644 ---- a/maas/region.sls -+++ b/maas/region.sls -@@ -190,4 +190,12 @@ - - require: - - module: maas_config - -+maas_vlan_dhcp: -+# NOTE(armband): To be implemented via _modules/maas.py later -+ cmd.run: -+ - name: "maas login {{ region.admin.username }} http://{{ region.bind.host }}:5240/MAAS/api/2.0 - < /var/lib/maas/.maas_credentials && maas opnfv vlan update 2 0 dhcp_on=True primary_rack={{ region.maas_config.maas_name }}" -+ - require: -+ - module: maas_subnets -+ - module: maas_dhcp_snippets -+ - {%- endif %} -- cgit 1.2.3-korg