Merge ~andreserl/maas:lp1642298 into maas:master

Proposed by Andres Rodriguez
Status: Merged
Approved by: Andres Rodriguez
Approved revision: 62595abd087d419fb9e61944f03d473b0ca5789d
Merge reported by: MAAS Lander
Merged at revision: not available
Proposed branch: ~andreserl/maas:lp1642298
Merge into: maas:master
Diff against target: 38 lines (+17/-0)
2 files modified
src/maasserver/preseed.py (+7/-0)
src/maasserver/tests/test_preseed.py (+10/-0)
Reviewer Review Type Date Requested Status
Blake Rouse (community) Approve
Review via email: mp+330644@code.launchpad.net

Commit message

LP: #1642298 - Grub upgrades overwrites NVRAM, breaking MAAS boot order.

Grub2 package upgrades overwrite the NVRAM. This causes the MAAS written NVRAM to be overwritten, which causes machines to be unable to PXE boot in subsequent reboots.

To post a comment you must log in.
Revision history for this message
Blake Rouse (blake-rouse) wrote :

Looks good.

review: Approve
Revision history for this message
MAAS Lander (maas-lander) wrote :

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/src/maasserver/preseed.py b/src/maasserver/preseed.py
2index bee1ffe..3475dd0 100644
3--- a/src/maasserver/preseed.py
4+++ b/src/maasserver/preseed.py
5@@ -524,6 +524,13 @@ def get_curtin_config(node):
6 # must have this statement.
7 if node.distro_series == "precise":
8 config['power_state'] = {'mode': 'reboot'}
9+ # Ensure we always set debconf_selections for grub to ensure it doesn't
10+ # overwrite the config sent by MAAS. See LP: #1642298
11+ grub2_debconf = {'grub2': 'grub2 grub2/update_nvram boolean false'}
12+ if 'debconf_selections' in config:
13+ config['debconf_selections'].update(grub2_debconf)
14+ else:
15+ config['debconf_selections'] = grub2_debconf
16 return yaml.safe_dump(config)
17
18
19diff --git a/src/maasserver/tests/test_preseed.py b/src/maasserver/tests/test_preseed.py
20index a6eb6ba..d78b267 100644
21--- a/src/maasserver/tests/test_preseed.py
22+++ b/src/maasserver/tests/test_preseed.py
23@@ -1149,6 +1149,16 @@ class TestCurtinUtilities(
24 yaml_conf['late_commands']['maas'][2])
25 self.assertTrue('debconf_selections' in yaml_conf)
26
27+ def test_get_curtin_config_has_grub2_debconf_selections(self):
28+ node = factory.make_Node_with_Interface_on_Subnet(
29+ primary_rack=self.rpc_rack_controller)
30+ node.save()
31+ self.configure_get_boot_images_for_node(node, 'xinstall')
32+ config = get_curtin_config(node)
33+ self.assertThat(
34+ config,
35+ Contains('grub2: grub2 grub2/update_nvram boolean false'))
36+
37 def make_fastpath_node(self, main_arch=None):
38 """Return a `Node`, with FPI enabled, and the given main architecture.
39

Subscribers

People subscribed via source and target branches