When adding a machine, min_hwe_kernel is not saved

Bug #1811358 reported by Alberto Donato
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
MAAS
Triaged
High
Unassigned

Bug Description

When manually adding a machine from the UI, the min_hwe_kernel parameter is not persisted, even when a value is set.

The value is passed to the backend but it's not persisted in the database

Alberto Donato (ack)
Changed in maas:
importance: Undecided → High
status: New → Triaged
Alberto Donato (ack)
Changed in maas:
milestone: none → 2.5.1
assignee: nobody → Alberto Donato (ack)
status: Triaged → In Progress
Revision history for this message
Alberto Donato (ack) wrote :

This also happens when creating a machine from the API

Revision history for this message
Alberto Donato (ack) wrote :

It turns out the reason is that when start_commissioning is called, it sets the min_hwe_kernel unconditionally to the default one (which was empty in my case).

This behavior was changed in 4c0cf27391954e93fbfffed4d4f9a22f85ae289d

Revision history for this message
Alberto Donato (ack) wrote :
Revision history for this message
Newell Jensen (newell-jensen) wrote :

Bjorn also pointed out that in the API documentation for commissioning there is no mention of setting the min_hwe_kernel.

Revision history for this message
Lee Trager (ltrager) wrote :

After discussing this in the SU I went through the code and some old reviews. We were mistaken that you can define the min_hwe_kernel during commissioning. You can only set it when creating a new machine or updating its settings. The min_hwe_kernel value is set to the value of default_min_hwe_kernel whenever commissioning is started. Before [1] min_hwe_kernel was only set if it wasn't set to something before. After [1] it was always set to the value of default_min_hwe_kernel regardless if the user had previously defined something. This means as of today if a user defines a min_hwe_kernel when adding a new machine it is always overwritten by the default_min_hwe_kernel even if that means no min_hwe_kernel will be set.

I think the min_hwe_kernel should only be set to the default_min_hwe_kernel value if min_hwe_kernel isn't defined. Users may want to have different min_hwe_kernels per host and always setting it to the global value during commissioning prevents that. If no min_hwe_kernel is set on the node and one is set globally commissioning will still set the min_hwe_kernel to default_min_hwe_kernel.

Alternatively we could just remove the ability to set a min_hwe_kernel when creating a new machine on the API and UI because as this bug points out it does nothing as of today.

[1] https://code.launchpad.net/~newell-jensen/maas/+git/maas/+merge/327404

Changed in maas:
status: In Progress → Triaged
assignee: Alberto Donato (ack) → Andres Rodriguez (andreserl)
Revision history for this message
Lee Trager (ltrager) wrote :

@Andres I assigned this to you as what we do is a product decision. Feel free to assign it to me or back to Alberto once we come to a decision.

Changed in maas:
milestone: 2.5.1 → 2.5.2
Changed in maas:
milestone: 2.5.2 → 2.5.3
Changed in maas:
milestone: 2.5.3 → 2.5.4
Changed in maas:
milestone: 2.5.4 → none
summary: - [2.5] - When adding a machine, min_hwe_kernel is not saved
+ When adding a machine, min_hwe_kernel is not saved
Changed in maas:
assignee: Andres Rodriguez (andreserl) → Adam Collard (adam-collard)
Changed in maas:
assignee: Adam Collard (adam-collard) → nobody
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.