diff options
author | Hironori Shiina <shiina.hironori@jp.fujitsu.com> | 2018-02-14 21:10:26 +0900 |
---|---|---|
committer | Julia Kreger <juliaashleykreger@gmail.com> | 2018-02-20 03:54:31 +0000 |
commit | 2bc984aabacce75f01fa0879b7783c392255417e (patch) | |
tree | 4d6fb0540ba638b72b95abe82e5ccd9887d47819 | |
parent | 254ce221cbd14f252dbb8829c63a144ba9c7b1fb (diff) | |
download | ironic-2bc984aabacce75f01fa0879b7783c392255417e.tar.gz |
Build instance PXE options for unrescue
This patch always builds PXE options for booting a user image even if
the provision state is related to rescue mode. When the state is
unrescuing, these options are necessary to boot a user image. When the
provision state is rescuing, these options are just ignored because
the PXE configuration is used at deployment mode.
Change-Id: I1ff51cab120e6612c71e5d9c45cf28797bc16e76
Closes-Bug: 1749433
(cherry picked from commit 4df93fc4746184f42e852fbb372c0662aa829a55)
-rw-r--r-- | ironic/drivers/modules/pxe.py | 13 | ||||
-rw-r--r-- | ironic/tests/unit/drivers/modules/test_pxe.py | 13 | ||||
-rw-r--r-- | releasenotes/notes/bug-1749433-363b747d2db67df6.yaml | 6 |
3 files changed, 19 insertions, 13 deletions
diff --git a/ironic/drivers/modules/pxe.py b/ironic/drivers/modules/pxe.py index c43558377..20b7f013e 100644 --- a/ironic/drivers/modules/pxe.py +++ b/ironic/drivers/modules/pxe.py @@ -243,13 +243,12 @@ def _build_pxe_config_options(task, pxe_info, service=False): else: pxe_options = _build_deploy_pxe_options(task, pxe_info, mode=mode) - if mode == 'deploy': - # NOTE(pas-ha) we still must always add user image kernel and ramdisk - # info as later during switching PXE config to service mode the - # template will not be regenerated anew, but instead edited as-is. - # This can be changed later if/when switching PXE config will also use - # proper templating instead of editing existing files on disk. - pxe_options.update(_build_instance_pxe_options(task, pxe_info)) + # NOTE(pas-ha) we still must always add user image kernel and ramdisk + # info as later during switching PXE config to service mode the + # template will not be regenerated anew, but instead edited as-is. + # This can be changed later if/when switching PXE config will also use + # proper templating instead of editing existing files on disk. + pxe_options.update(_build_instance_pxe_options(task, pxe_info)) pxe_options.update(_build_extra_pxe_options()) diff --git a/ironic/tests/unit/drivers/modules/test_pxe.py b/ironic/tests/unit/drivers/modules/test_pxe.py index 454d508c5..575427da3 100644 --- a/ironic/tests/unit/drivers/modules/test_pxe.py +++ b/ironic/tests/unit/drivers/modules/test_pxe.py @@ -249,11 +249,11 @@ class PXEPrivateMethodsTestCase(db_base.DbTestCase): 'deployment_aki_path': pxe_kernel, 'tftp_server': tftp_server, 'ipxe_timeout': 0, + 'ari_path': ramdisk, + 'aki_path': kernel, } - if mode == 'deploy': - expected_options.update({'ari_path': ramdisk, 'aki_path': kernel}) - elif mode == 'rescue': + if mode == 'rescue': self.node.provision_state = states.RESCUING self.node.save() @@ -412,10 +412,11 @@ class PXEPrivateMethodsTestCase(db_base.DbTestCase): 'deployment_aki_path': pxe_kernel, 'tftp_server': tftp_server, 'ipxe_timeout': ipxe_timeout_in_ms, + 'ari_path': ramdisk, + 'aki_path': kernel, } - if mode == 'deploy': - expected_options.update({'ari_path': ramdisk, 'aki_path': kernel}) - elif mode == 'rescue': + + if mode == 'rescue': self.node.provision_state = states.RESCUING self.node.save() diff --git a/releasenotes/notes/bug-1749433-363b747d2db67df6.yaml b/releasenotes/notes/bug-1749433-363b747d2db67df6.yaml new file mode 100644 index 000000000..6bdb4c6e9 --- /dev/null +++ b/releasenotes/notes/bug-1749433-363b747d2db67df6.yaml @@ -0,0 +1,6 @@ +--- +fixes: + - | + Fixes a bug preventing a node from booting into the user instance after unrescuing + if instance netboot is used. See `bug 1749433 + <https://bugs.launchpad.net/ironic/+bug/1749433>`_ for details. |