Merge ~bjornt/maas:bug-2043970-vlan-interfaces-3.5 into maas:3.5

Proposed by Björn Tillenius
Status: Merged
Approved by: Björn Tillenius
Approved revision: 24117f0b806ca947144dfe1386a9d001485a4ce0
Merge reported by: MAAS Lander
Merged at revision: not available
Proposed branch: ~bjornt/maas:bug-2043970-vlan-interfaces-3.5
Merge into: maas:3.5
Diff against target: 464 lines (+246/-80)
2 files modified
src/metadataserver/builtin_scripts/network.py (+65/-60)
src/metadataserver/builtin_scripts/tests/test_network.py (+181/-20)
Reviewer Review Type Date Requested Status
Björn Tillenius Approve
Review via email: mp+465138@code.launchpad.net

Commit message

Bug #2043970: MAAS 3.2.9 creates for Calico Interfaces 80.000 fabrics

Redo the fix for bug #2043970.

In some cases we need to create VLANs/fabrics for interfaces that don't have
links. For example for VLAN interfaces, often it's the VLAN interface that has
an address, while the underlying physical interface often is without any
address. In that case, the physical interface should have a VLAN that is on the
same fabric as the VLAN interface.

Also removed the check whether a machine is a controller. A controller is not
special. It's a deployed machine. If Calico is installed on a controller, we
should not create useless fabrics.

(cherry picked from commit 94dac1082c3a3958e7c01f29e1d0320a775633ae)

To post a comment you must log in.
Revision history for this message
Björn Tillenius (bjornt) wrote :

Self-approve backport

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
diff --git a/src/metadataserver/builtin_scripts/network.py b/src/metadataserver/builtin_scripts/network.py
index 9282986..58f8120 100644
--- a/src/metadataserver/builtin_scripts/network.py
+++ b/src/metadataserver/builtin_scripts/network.py
@@ -13,7 +13,7 @@ from maasserver.models.interface import (
13)13)
14from maasserver.models.staticipaddress import StaticIPAddress14from maasserver.models.staticipaddress import StaticIPAddress
15from maasserver.models.subnet import Subnet15from maasserver.models.subnet import Subnet
16from maasserver.models.vlan import VLAN16from maasserver.models.vlan import DEFAULT_VID, VLAN
17from maasserver.utils.orm import transactional17from maasserver.utils.orm import transactional
18from provisioningserver.events import EVENT_TYPES18from provisioningserver.events import EVENT_TYPES
19from provisioningserver.logger import get_maas_logger19from provisioningserver.logger import get_maas_logger
@@ -266,7 +266,7 @@ def update_physical_interface(
266 if hints is not None:266 if hints is not None:
267 new_vlan = guess_vlan_from_hints(node, name, hints)267 new_vlan = guess_vlan_from_hints(node, name, hints)
268 if new_vlan is None:268 if new_vlan is None:
269 new_vlan = guess_vlan_for_interface(node, links)269 new_vlan = guess_vlan_for_interface(node, interface, links)
270 if new_vlan is not None:270 if new_vlan is not None:
271 interface.vlan = new_vlan271 interface.vlan = new_vlan
272 update_fields.add("vlan")272 update_fields.add("vlan")
@@ -362,16 +362,19 @@ def update_vlan_interface(node, name, network, links):
362 parent_nic = Interface.objects.get(362 parent_nic = Interface.objects.get(
363 node_config=node.current_config, name=parent_name363 node_config=node.current_config, name=parent_name
364 )364 )
365 parent_fabric = None
366 if parent_nic.vlan is not None:
367 parent_fabric = parent_nic.vlan.fabric
365 links_vlan = get_interface_vlan_from_links(links)368 links_vlan = get_interface_vlan_from_links(links)
369 interface = VLANInterface.objects.filter(
370 node_config=node.current_config,
371 name=name,
372 parents__id=parent_nic.id,
373 vlan__vid=vid,
374 ).first()
366 if links_vlan:375 if links_vlan:
367 vlan = links_vlan376 vlan = links_vlan
368 if parent_nic.vlan.fabric_id != vlan.fabric_id:377 parent_fabric = vlan.fabric
369 # XXX: We should surface this error to the API and UI, since
370 # it's something the user needs to fix.
371 maaslog.error(
372 f"Interface '{parent_nic.name}' on controller '{node.hostname}' "
373 f"is not on the same fabric as VLAN interface '{name}'."
374 )
375 if links_vlan.vid != vid:378 if links_vlan.vid != vid:
376 maaslog.error(379 maaslog.error(
377 f"VLAN interface '{name}' reports VLAN {vid} "380 f"VLAN interface '{name}' reports VLAN {vid} "
@@ -379,41 +382,31 @@ def update_vlan_interface(node, name, network, links):
379 )382 )
380 else:383 else:
381 vlan = None384 vlan = None
385 if interface is not None and interface.vlan is not None:
386 vlan = interface.vlan
387 parent_fabric = vlan.fabric
388 elif parent_fabric is None:
389 maaslog.info(
390 f"Unable to detect fabric VLAN Interface '{name}', using default"
391 )
392 parent_fabric = Fabric.objects.get_default_fabric()
393
394 if parent_nic.vlan_id is None:
395 parent_vlan, _ = VLAN.objects.get_or_create(
396 fabric=parent_fabric,
397 vid=DEFAULT_VID,
398 )
399 parent_nic.vlan = parent_vlan
400 parent_nic.save()
382401
383 from metadataserver.builtin_scripts.hooks import HARDWARE_SYNC_ACTIONS402 from metadataserver.builtin_scripts.hooks import HARDWARE_SYNC_ACTIONS
384403
385 interface = VLANInterface.objects.filter(404 if vlan is None:
386 node_config=node.current_config,405 # Since no suitable VLAN is found, create a new one in the same
387 name=name,406 # fabric as the parent interface.
388 parents__id=parent_nic.id,407 vlan, _ = VLAN.objects.get_or_create(fabric=parent_fabric, vid=vid)
389 vlan__vid=vid,
390 ).first()
391 if interface is None:
392 if vlan is None:
393 # Since no suitable VLAN is found, create a new one in the same
394 # fabric as the parent interface.
395 if parent_nic.vlan:
396 vlan, _ = VLAN.objects.get_or_create(
397 fabric=parent_nic.vlan.fabric, vid=vid
398 )
399 elif network["addresses"]: # use IP address to find VLAN
400 address = network["addresses"][0]["address"]
401 try:
402 subnet = Subnet.objects.get_subnet_for_ip(address)
403 except Subnet.DoesNotExist:
404 pass
405 else:
406 vlan, _ = VLAN.objects.get_or_create(
407 fabric=subnet.vlan.fabric, vid=vid
408 )
409 if vlan is None:
410 maaslog.error(
411 f"Unable to detect fabric VLAN Interface '{name}', using default"
412 )
413 vlan, _ = VLAN.objects.get_or_create(
414 fabric=Fabric.objects.get_default_fabric(), vid=vid
415 )
416408
409 if interface is None:
417 interface, created = VLANInterface.objects.get_or_create(410 interface, created = VLANInterface.objects.get_or_create(
418 node_config=node.current_config,411 node_config=node.current_config,
419 name=name,412 name=name,
@@ -435,6 +428,14 @@ def update_vlan_interface(node, name, network, links):
435 node, interface, HARDWARE_SYNC_ACTIONS.UPDATED428 node, interface, HARDWARE_SYNC_ACTIONS.UPDATED
436 )429 )
437430
431 if parent_nic.vlan.fabric_id != vlan.fabric_id:
432 # XXX: We should surface this error to the API and UI, since
433 # it's something the user needs to fix.
434 maaslog.error(
435 f"Interface '{parent_nic.name}' on controller '{node.hostname}' "
436 f"is not on the same fabric as VLAN interface '{name}'."
437 )
438
438 update_links(node, interface, links, force_vlan=True)439 update_links(node, interface, links, force_vlan=True)
439 return interface440 return interface
440441
@@ -507,10 +508,6 @@ def update_parent_vlans(node, interface, parent_nics, update_ip_addresses):
507508
508509
509def auto_vlan_creation(node) -> bool:510def auto_vlan_creation(node) -> bool:
510 if node.is_controller:
511 # Always create controller's vlans
512 return True
513
514 if node.status == NODE_STATUS.DEPLOYED:511 if node.status == NODE_STATUS.DEPLOYED:
515 # don't create empty vlan/fabric for interfaces discovered by HW sync,512 # don't create empty vlan/fabric for interfaces discovered by HW sync,
516 # they cannot be used.513 # they cannot be used.
@@ -519,25 +516,26 @@ def auto_vlan_creation(node) -> bool:
519 return Config.objects.get_config("auto_vlan_creation", True)516 return Config.objects.get_config("auto_vlan_creation", True)
520517
521518
522def guess_vlan_for_interface(node, links):519def guess_vlan_for_interface(node, interface, links):
523 # Make sure that the VLAN on the interface is correct. When520 # Make sure that the VLAN on the interface is correct. When
524 # links exists on this interface we place it into the correct521 # links exists on this interface we place it into the correct
525 # VLAN. If it cannot be determined and its a new interface it522 # VLAN. If it cannot be determined and its a new interface it
526 # gets placed on its own fabric.523 # gets placed on its own fabric.
527 new_vlan = get_interface_vlan_from_links(links)524 new_vlan = get_interface_vlan_from_links(links)
528 if new_vlan is None and auto_vlan_creation(node):525 if new_vlan is None:
529 # If the default VLAN on the default fabric has no interfaces526 if links:
530 # associated with it, the first interface will be placed there527 update_links(node, interface, links)
531 # (rather than creating a new fabric).528 new_vlan = get_interface_vlan_from_links(links)
532 default_vlan = VLAN.objects.get_default_vlan()529 elif auto_vlan_creation(node):
533 interfaces_on_default_vlan = Interface.objects.filter(530 default_vlan = VLAN.objects.get_default_vlan()
534 vlan=default_vlan531 interfaces_on_default_vlan = Interface.objects.filter(
535 ).exists()532 vlan=default_vlan
536 if not interfaces_on_default_vlan:533 ).exists()
537 new_vlan = default_vlan534 if not interfaces_on_default_vlan:
538 else:535 new_vlan = default_vlan
539 new_fabric = Fabric.objects.create()536 else:
540 new_vlan = new_fabric.get_default_vlan()537 new_fabric = Fabric.objects.create()
538 new_vlan = new_fabric.get_default_vlan()
541 return new_vlan539 return new_vlan
542540
543541
@@ -636,8 +634,15 @@ def update_links(
636 if use_interface_vlan and interface.vlan is not None:634 if use_interface_vlan and interface.vlan is not None:
637 vlan = interface.vlan635 vlan = interface.vlan
638 elif links:636 elif links:
639 fabric = Fabric.objects.create()637 default_vlan = VLAN.objects.get_default_vlan()
640 vlan = fabric.get_default_vlan()638 interfaces_on_default_vlan = Interface.objects.filter(
639 vlan=default_vlan
640 ).exists()
641 if not interfaces_on_default_vlan:
642 vlan = default_vlan
643 else:
644 new_fabric = Fabric.objects.create()
645 vlan = new_fabric.get_default_vlan()
641 interface.vlan = vlan646 interface.vlan = vlan
642 interface.save()647 interface.save()
643648
diff --git a/src/metadataserver/builtin_scripts/tests/test_network.py b/src/metadataserver/builtin_scripts/tests/test_network.py
index 214df73..24c1fa8 100644
--- a/src/metadataserver/builtin_scripts/tests/test_network.py
+++ b/src/metadataserver/builtin_scripts/tests/test_network.py
@@ -87,7 +87,9 @@ class TestUpdateInterfaces(MAASServerTestCase, UpdateInterfacesMixin):
87 eth0 = node.current_config.interface_set.get(name="eth0")87 eth0 = node.current_config.interface_set.get(name="eth0")
88 self.assertEqual(eth0.numa_node, node.default_numanode)88 self.assertEqual(eth0.numa_node, node.default_numanode)
8989
90 def test_dont_create_default_vlan_for_deployed_machines(self):90 def test_dont_create_default_vlan_for_missing_links_deployed_machines(
91 self,
92 ):
91 node = factory.make_Machine(status=NODE_STATUS.DEPLOYED)93 node = factory.make_Machine(status=NODE_STATUS.DEPLOYED)
92 data = FakeCommissioningData()94 data = FakeCommissioningData()
93 data_eth0 = data.create_physical_network(95 data_eth0 = data.create_physical_network(
@@ -101,6 +103,174 @@ class TestUpdateInterfaces(MAASServerTestCase, UpdateInterfacesMixin):
101 )103 )
102 self.assertIsNone(eth0.vlan)104 self.assertIsNone(eth0.vlan)
103105
106 def test_vlan_interfaces_with_known_link_deployed_machine(self):
107 node = factory.make_Machine(status=NODE_STATUS.DEPLOYED)
108 vlan123 = factory.make_VLAN(vid=123)
109 vlan456 = factory.make_VLAN(vid=456, fabric=vlan123.fabric)
110 factory.make_Subnet(cidr="10.10.10.0/24", vlan=vlan123)
111 factory.make_Subnet(cidr="10.10.20.0/24", vlan=vlan456)
112 data = FakeCommissioningData()
113 data_eth0 = data.create_physical_network(
114 "eth0",
115 mac_address="11:11:11:11:11:11",
116 )
117 data_eth0.state = "up"
118 vlan_network123 = data.create_vlan_network(
119 "eth0.123", parent=data_eth0, vid=123
120 )
121 vlan_network123.addresses = [LXDAddress("10.10.10.10", 24)]
122 vlan_network456 = data.create_vlan_network(
123 "eth0.456", parent=data_eth0, vid=456
124 )
125 vlan_network456.addresses = [LXDAddress("10.10.20.10", 24)]
126 self.update_interfaces(node, data)
127 eth0 = PhysicalInterface.objects.get(
128 name="eth0", node_config=node.current_config
129 )
130 eth0_vlan123 = Interface.objects.get(
131 name="eth0.123", node_config=node.current_config
132 )
133 eth0_vlan456 = Interface.objects.get(
134 name="eth0.456", node_config=node.current_config
135 )
136 self.assertEqual(INTERFACE_TYPE.VLAN, eth0_vlan123.type)
137 self.assertEqual(123, eth0_vlan123.vlan.vid)
138 self.assertEqual(INTERFACE_TYPE.VLAN, eth0_vlan456.type)
139 self.assertEqual(456, eth0_vlan456.vlan.vid)
140 self.assertEqual(
141 eth0_vlan123.vlan.fabric_id, eth0_vlan456.vlan.fabric_id
142 )
143 self.assertIsNotNone(eth0.vlan_id)
144 self.assertNotIn(
145 eth0.vlan_id, [eth0_vlan456.vlan_id, eth0_vlan123.vlan_id]
146 )
147 self.assertEqual(eth0.vlan.fabric_id, eth0_vlan123.vlan.fabric_id)
148 self.assertEqual(eth0.vlan.fabric_id, eth0_vlan456.vlan.fabric_id)
149
150 def test_vlan_interfaces_with_new_known_link_deployed_machine(self):
151 node = factory.make_Machine(status=NODE_STATUS.DEPLOYED)
152 vlan456 = factory.make_VLAN(vid=456)
153 factory.make_Subnet(cidr="10.10.20.0/24", vlan=vlan456)
154 data = FakeCommissioningData()
155 data_eth0 = data.create_physical_network(
156 "eth0",
157 mac_address="11:11:11:11:11:11",
158 )
159 data_eth0.state = "up"
160 vlan_network123 = data.create_vlan_network(
161 "eth0.123", parent=data_eth0, vid=123
162 )
163 vlan_network123.addresses = [LXDAddress("10.10.10.10", 24)]
164 vlan_network456 = data.create_vlan_network(
165 "eth0.456", parent=data_eth0, vid=456
166 )
167 vlan_network456.addresses = [LXDAddress("10.10.20.10", 24)]
168 self.update_interfaces(node, data)
169 eth0 = PhysicalInterface.objects.get(
170 name="eth0", node_config=node.current_config
171 )
172 eth0_vlan123 = Interface.objects.get(
173 name="eth0.123", node_config=node.current_config
174 )
175 eth0_vlan456 = Interface.objects.get(
176 name="eth0.456", node_config=node.current_config
177 )
178 self.assertEqual(INTERFACE_TYPE.VLAN, eth0_vlan123.type)
179 self.assertEqual(123, eth0_vlan123.vlan.vid)
180 self.assertEqual(INTERFACE_TYPE.VLAN, eth0_vlan456.type)
181 self.assertEqual(456, eth0_vlan456.vlan.vid)
182 self.assertEqual(
183 eth0_vlan123.vlan.fabric_id, eth0_vlan456.vlan.fabric_id
184 )
185 self.assertIsNotNone(eth0.vlan_id)
186 self.assertNotIn(
187 eth0.vlan_id, [eth0_vlan456.vlan_id, eth0_vlan123.vlan_id]
188 )
189 self.assertEqual(eth0.vlan.fabric_id, eth0_vlan123.vlan.fabric_id)
190 self.assertEqual(eth0.vlan.fabric_id, eth0_vlan456.vlan.fabric_id)
191
192 def test_vlan_interfaces_with_new_unknown_link_deployed_machine(self):
193 node = factory.make_Machine(status=NODE_STATUS.DEPLOYED)
194 vlan123 = factory.make_VLAN(vid=123)
195 factory.make_Subnet(cidr="10.10.10.0/24", vlan=vlan123)
196 data = FakeCommissioningData()
197 data_eth0 = data.create_physical_network(
198 "eth0",
199 mac_address="11:11:11:11:11:11",
200 )
201 data_eth0.state = "up"
202 vlan_network123 = data.create_vlan_network(
203 "eth0.123", parent=data_eth0, vid=123
204 )
205 vlan_network123.addresses = [LXDAddress("10.10.10.10", 24)]
206 vlan_network456 = data.create_vlan_network(
207 "eth0.456", parent=data_eth0, vid=456
208 )
209 vlan_network456.addresses = [LXDAddress("10.10.20.10", 24)]
210 self.update_interfaces(node, data)
211 eth0 = PhysicalInterface.objects.get(
212 name="eth0", node_config=node.current_config
213 )
214 eth0_vlan123 = Interface.objects.get(
215 name="eth0.123", node_config=node.current_config
216 )
217 eth0_vlan456 = Interface.objects.get(
218 name="eth0.456", node_config=node.current_config
219 )
220 self.assertEqual(INTERFACE_TYPE.VLAN, eth0_vlan123.type)
221 self.assertEqual(123, eth0_vlan123.vlan.vid)
222 self.assertEqual(INTERFACE_TYPE.VLAN, eth0_vlan456.type)
223 self.assertEqual(456, eth0_vlan456.vlan.vid)
224 self.assertEqual(
225 eth0_vlan123.vlan.fabric_id, eth0_vlan456.vlan.fabric_id
226 )
227 self.assertIsNotNone(eth0.vlan_id)
228 self.assertNotIn(
229 eth0.vlan_id, [eth0_vlan456.vlan_id, eth0_vlan123.vlan_id]
230 )
231 self.assertEqual(eth0.vlan.fabric_id, eth0_vlan123.vlan.fabric_id)
232 self.assertEqual(eth0.vlan.fabric_id, eth0_vlan456.vlan.fabric_id)
233
234 def test_vlan_interfaces_with_unknown_link_deployed_machine(self):
235 node = factory.make_Machine(status=NODE_STATUS.DEPLOYED)
236 data = FakeCommissioningData()
237 data_eth0 = data.create_physical_network(
238 "eth0",
239 mac_address="11:11:11:11:11:11",
240 )
241 data_eth0.state = "up"
242 vlan_network123 = data.create_vlan_network(
243 "eth0.123", parent=data_eth0, vid=123
244 )
245 vlan_network123.addresses = [LXDAddress("10.10.10.10", 24)]
246 vlan_network456 = data.create_vlan_network(
247 "eth0.456", parent=data_eth0, vid=456
248 )
249 vlan_network456.addresses = [LXDAddress("10.10.20.10", 24)]
250 self.update_interfaces(node, data)
251 eth0 = PhysicalInterface.objects.get(
252 name="eth0", node_config=node.current_config
253 )
254 eth0_vlan123 = Interface.objects.get(
255 name="eth0.123", node_config=node.current_config
256 )
257 eth0_vlan456 = Interface.objects.get(
258 name="eth0.456", node_config=node.current_config
259 )
260 self.assertEqual(INTERFACE_TYPE.VLAN, eth0_vlan123.type)
261 self.assertEqual(123, eth0_vlan123.vlan.vid)
262 self.assertEqual(INTERFACE_TYPE.VLAN, eth0_vlan456.type)
263 self.assertEqual(456, eth0_vlan456.vlan.vid)
264 self.assertEqual(
265 eth0_vlan123.vlan.fabric_id, eth0_vlan456.vlan.fabric_id
266 )
267 self.assertIsNotNone(eth0.vlan_id)
268 self.assertNotIn(
269 eth0.vlan_id, [eth0_vlan456.vlan_id, eth0_vlan123.vlan_id]
270 )
271 self.assertEqual(eth0.vlan.fabric_id, eth0_vlan123.vlan.fabric_id)
272 self.assertEqual(eth0.vlan.fabric_id, eth0_vlan456.vlan.fabric_id)
273
104 def test_dont_create_default_vlan_if_disabled(self):274 def test_dont_create_default_vlan_if_disabled(self):
105 Config.objects.set_config(name="auto_vlan_creation", value=False)275 Config.objects.set_config(name="auto_vlan_creation", value=False)
106 node = factory.make_Machine(status=NODE_STATUS.NEW)276 node = factory.make_Machine(status=NODE_STATUS.NEW)
@@ -138,9 +308,7 @@ class TestUpdateInterfaces(MAASServerTestCase, UpdateInterfacesMixin):
138 self.assertEqual("11:11:11:11:11:11", eth0.mac_address)308 self.assertEqual("11:11:11:11:11:11", eth0.mac_address)
139 self.assertTrue(eth0.enabled)309 self.assertTrue(eth0.enabled)
140 self.assertTrue(eth0.link_connected)310 self.assertTrue(eth0.link_connected)
141 self.assertEqual(311 self.assertIsNone(eth0.vlan)
142 Fabric.objects.get_default_fabric().get_default_vlan(), eth0.vlan
143 )
144 self.assertEqual([], list(eth0.parents.all()))312 self.assertEqual([], list(eth0.parents.all()))
145 eth1 = PhysicalInterface.objects.get(313 eth1 = PhysicalInterface.objects.get(
146 name="eth1", node_config=controller.current_config314 name="eth1", node_config=controller.current_config
@@ -547,10 +715,9 @@ class TestUpdateInterfaces(MAASServerTestCase, UpdateInterfacesMixin):
547 name="eth0", node_config=controller.current_config715 name="eth0", node_config=controller.current_config
548 )716 )
549717
550 default_vlan = Fabric.objects.get_default_fabric().get_default_vlan()
551 self.assertEqual(INTERFACE_TYPE.PHYSICAL, eth0.type)718 self.assertEqual(INTERFACE_TYPE.PHYSICAL, eth0.type)
552 self.assertEqual("11:11:11:11:11:11", eth0.mac_address)719 self.assertEqual("11:11:11:11:11:11", eth0.mac_address)
553 self.assertEqual(default_vlan, eth0.vlan)720 self.assertIsNone(eth0.vlan)
554 self.assertTrue(eth0.enabled)721 self.assertTrue(eth0.enabled)
555722
556 eth0_addresses = list(eth0.ip_addresses.all())723 eth0_addresses = list(eth0.ip_addresses.all())
@@ -1103,13 +1270,13 @@ class TestUpdateInterfaces(MAASServerTestCase, UpdateInterfacesMixin):
1103 maaslog.method_calls,1270 maaslog.method_calls,
1104 [1271 [
1105 call.error(1272 call.error(
1106 f"Interface 'eth0' on controller '{controller.hostname}' "
1107 f"is not on the same fabric as VLAN interface '{vlan_interface.name}'."
1108 ),
1109 call.error(
1110 f"VLAN interface '{vlan_interface.name}' reports VLAN {vid_on_fabric} "1273 f"VLAN interface '{vlan_interface.name}' reports VLAN {vid_on_fabric} "
1111 f"but links are on VLAN {other_vlan.vid}"1274 f"but links are on VLAN {other_vlan.vid}"
1112 ),1275 ),
1276 call.error(
1277 f"Interface 'eth0' on controller '{controller.hostname}' "
1278 f"is not on the same fabric as VLAN interface '{vlan_interface.name}'."
1279 ),
1113 ]1280 ]
1114 * passes,1281 * passes,
1115 )1282 )
@@ -1270,13 +1437,13 @@ class TestUpdateInterfaces(MAASServerTestCase, UpdateInterfacesMixin):
1270 maaslog.method_calls,1437 maaslog.method_calls,
1271 [1438 [
1272 call.error(1439 call.error(
1273 f"Interface 'eth0' on controller '{controller.hostname}' "
1274 f"is not on the same fabric as VLAN interface '{vlan_interface.name}'."
1275 ),
1276 call.error(
1277 f"VLAN interface '{vlan_interface.name}' reports VLAN {other_vlan.vid} "1440 f"VLAN interface '{vlan_interface.name}' reports VLAN {other_vlan.vid} "
1278 f"but links are on VLAN {new_vlan.vid}"1441 f"but links are on VLAN {new_vlan.vid}"
1279 ),1442 ),
1443 call.error(
1444 f"Interface 'eth0' on controller '{controller.hostname}' "
1445 f"is not on the same fabric as VLAN interface '{vlan_interface.name}'."
1446 ),
1280 ]1447 ]
1281 * passes,1448 * passes,
1282 )1449 )
@@ -2224,17 +2391,11 @@ class TestUpdateInterfaces(MAASServerTestCase, UpdateInterfacesMixin):
22242391
2225 self.update_interfaces(controller, data)2392 self.update_interfaces(controller, data)
22262393
2227 eth0 = get_one(
2228 PhysicalInterface.objects.filter(
2229 node_config=controller.current_config, name="eth0"
2230 )
2231 )
2232 eth1 = get_one(2394 eth1 = get_one(
2233 PhysicalInterface.objects.filter(2395 PhysicalInterface.objects.filter(
2234 node_config=controller.current_config, name="eth1"2396 node_config=controller.current_config, name="eth1"
2235 )2397 )
2236 )2398 )
2237 self.assertIsNotNone(eth0.vlan)
2238 self.assertIsNone(eth1.vlan)2399 self.assertIsNone(eth1.vlan)
22392400
2240 def test_subnet_seen_on_second_controller_does_not_create_fabric(self):2401 def test_subnet_seen_on_second_controller_does_not_create_fabric(self):

Subscribers

People subscribed via source and target branches