Default Dynamic IP Assignment for MAAS Subnets In a ways of Zero-touch-Provisionning

Hello,

We have been using MAAS for a long time to manage our infrastructure and are continuously working to improve our deployment and redeployment workflows. One of our key objectives is to achieve a Zero-Touch Provisioning (ZTP) process after machine creation.

Currently, we encounter a recurring challenge: after each commissioning, we must manually modify the “IP Assignment” setting on each machine’s interface to switch it from the default “static configured” mode to “dynamic”. This manual step introduces the risk of human error and slows down our ZTP goals.

Request:
Would it be possible to add a feature at the subnet level that allows machines discovered within a subnet to automatically inherit the “IP Assignment” setting as “dynamic”? This would streamline our workflow, reduce configuration errors, and align better with our use of an external DHCP server, which requires interfaces to remain in dynamic mode.

We believe this enhancement would significantly improve the reliability and efficiency of deployments in environments like ours.

Thank you for your time and consideration.

there is the default_boot_interface_link_type global setting to customize the type of the boot interface automatically after commissioning. You can set it to dhcp. Still only the boot interface is customizable at the moment

The default_boot_interface_link_type global setting (e.g., set to dhcp) works for me, but not for all users in our MAAS environment.

And After changing default_boot_interface_link_type, we are experiencing two related problems

  1. Cannot modify the Availability Zone (AZ) on existing machines.
  2. Cannot create new machines: The error “Select a valid choice. That choice is not one of the available choices” appears when attempting to create a machine.

reversing the global setting doesn’t solve it

Question:
What is causing these issues, and how can we resolve them?

hard to say without additional information. Please look at the logs

Alright, that what i found during test.

if i update zone of machine from Api ( cli ). i have no problem. everything is set

if i use UI. i got error. the same happen on maas-test-db in 3.8.0.alpha1

juin 10 14:33:29 server regiond[162328]: File “/usr/lib/python3/dist-packages/twisted/python/threadpool.py”, line 269, in inContext
juin 10 14:33:29 server regiond[162328]: result = inContext.theWork() # type: ignore[attr-defined]
juin 10 14:33:29 server regiond[162328]: File “/usr/lib/python3/dist-packages/twisted/python/threadpool.py”, line 285, in
juin 10 14:33:29 server regiond[162328]: inContext.theWork = lambda: context.call( # type: ignore[attr-defined]
juin 10 14:33:29 server regiond[162328]: File “/usr/lib/python3/dist-packages/twisted/python/context.py”, line 117, in callWithContext
juin 10 14:33:29 server regiond[162328]: return self.currentContext().callWithContext(ctx, func, *args, **kw)
juin 10 14:33:29 server regiond[162328]: File “/usr/lib/python3/dist-packages/twisted/python/context.py”, line 82, in callWithContext
juin 10 14:33:29 server regiond[162328]: return func(*args, **kw)
juin 10 14:33:29 server regiond[162328]: File “/usr/lib/python3/dist-packages/provisioningserver/utils/twisted.py”, line 856, in callInContext
juin 10 14:33:29 server regiond[162328]: return func(*args, **kwargs)
juin 10 14:33:29 server regiond[162328]: File “/usr/lib/python3/dist-packages/provisioningserver/utils/twisted.py”, line 203, in wrapper
juin 10 14:33:29 server regiond[162328]: result = func(*args, **kwargs)
juin 10 14:33:29 server regiond[162328]: File “/usr/lib/python3/dist-packages/maasserver/utils/orm.py”, line 792, in call_within_transaction
juin 10 14:33:29 server regiond[162328]: return func_outside_txn(*args, **kwargs)
juin 10 14:33:29 server regiond[162328]: File “/usr/lib/python3/dist-packages/maasserver/utils/orm.py”, line 575, in retrier
juin 10 14:33:29 server regiond[162328]: return func(*args, **kwargs)
juin 10 14:33:29 server regiond[162328]: File “/usr/lib/python3.12/contextlib.py”, line 81, in inner
juin 10 14:33:29 server regiond[162328]: return func(*args, **kwds)
juin 10 14:33:29 server regiond[162328]: File “/usr/lib/python3/dist-packages/maasserver/websockets/base.py”, line 442, in prep_user_execute
juin 10 14:33:29 server regiond[162328]: return self._call_method_track_queries(
juin 10 14:33:29 server regiond[162328]: File “/usr/lib/python3/dist-packages/maasserver/websockets/base.py”, line 466, in _call_method_track_queries
juin 10 14:33:29 server regiond[162328]: result = method(params)
juin 10 14:33:29 server regiond[162328]: File “/usr/lib/python3/dist-packages/maasserver/websockets/handlers/node.py”, line 181, in update
juin 10 14:33:29 server regiond[162328]: data = super().update(params)
juin 10 14:33:29 server regiond[162328]: File “/usr/lib/python3/dist-packages/maasserver/websockets/base.py”, line 780, in update
juin 10 14:33:29 server regiond[162328]: obj = self._update(obj, params)
juin 10 14:33:29 server regiond[162328]: File “/usr/lib/python3/dist-packages/maasserver/websockets/base.py”, line 805, in _update
juin 10 14:33:29 server regiond[162328]: raise HandlerValidationError(form.errors)
juin 10 14:33:29 server regiond[162328]: maasserver.websockets.base.HandlerValidationError: {‘zone’: [‘Select a valid choice. That choice is not one of the available choices.’]}
juin 10 14:33:29 server regiond[162328]: