Merge "Set 'initrd' to 'rescue_ramdisk' for rescue with iPXE" into stable/queens

This commit is contained in:
Zuul 2018-02-22 17:11:01 +00:00 committed by Gerrit Code Review
commit 46828a2a50
5 changed files with 13 additions and 1 deletions

View File

@ -4,7 +4,7 @@ goto deploy
:deploy
imgfree
kernel {% if pxe_options.ipxe_timeout > 0 %}--timeout {{ pxe_options.ipxe_timeout }} {% endif %}{{ pxe_options.deployment_aki_path }} selinux=0 troubleshoot=0 text {{ pxe_options.pxe_append_params|default("", true) }} ip=${ip}:${next-server}:${gateway}:${netmask} BOOTIF=${mac} ipa-api-url={{ pxe_options['ipa-api-url'] }} initrd=deploy_ramdisk coreos.configdrive=0 || goto deploy
kernel {% if pxe_options.ipxe_timeout > 0 %}--timeout {{ pxe_options.ipxe_timeout }} {% endif %}{{ pxe_options.deployment_aki_path }} selinux=0 troubleshoot=0 text {{ pxe_options.pxe_append_params|default("", true) }} ip=${ip}:${next-server}:${gateway}:${netmask} BOOTIF=${mac} ipa-api-url={{ pxe_options['ipa-api-url'] }} initrd={{ pxe_options.initrd_filename|default("deploy_ramdisk", true) }} coreos.configdrive=0 || goto deploy
initrd {% if pxe_options.ipxe_timeout > 0 %}--timeout {{ pxe_options.ipxe_timeout }} {% endif %}{{ pxe_options.deployment_ari_path }} || goto deploy
boot

View File

@ -171,6 +171,8 @@ def _build_deploy_pxe_options(task, pxe_info, mode='deploy'):
else:
pxe_opts[option] = pxe_utils.get_path_relative_to_tftp_root(
pxe_info[label][1])
if CONF.pxe.ipxe_enabled:
pxe_opts['initrd_filename'] = ramdisk_label
return pxe_opts

View File

@ -57,6 +57,7 @@ class TestPXEUtils(db_base.DbTestCase):
'deployment_ari_path': 'http://1.2.3.4:1234/deploy_ramdisk',
'aki_path': 'http://1.2.3.4:1234/kernel',
'ari_path': 'http://1.2.3.4:1234/ramdisk',
'initrd_filename': 'deploy_ramdisk',
})
self.ipxe_options_timeout = self.ipxe_options.copy()
@ -73,6 +74,7 @@ class TestPXEUtils(db_base.DbTestCase):
'username': 'fake_username',
'password': 'fake_password'
})
self.ipxe_options_boot_from_volume.pop('initrd_filename', None)
self.node = object_utils.create_test_node(self.context)

View File

@ -414,6 +414,7 @@ class PXEPrivateMethodsTestCase(db_base.DbTestCase):
'ipxe_timeout': ipxe_timeout_in_ms,
'ari_path': ramdisk,
'aki_path': kernel,
'initrd_filename': ramdisk_label,
}
if mode == 'rescue':
@ -430,6 +431,7 @@ class PXEPrivateMethodsTestCase(db_base.DbTestCase):
'password': 'fake_password'})
expected_options.pop('deployment_aki_path')
expected_options.pop('deployment_ari_path')
expected_options.pop('initrd_filename')
with task_manager.acquire(self.context, self.node.uuid,
shared=True) as task:

View File

@ -0,0 +1,6 @@
---
fixes:
- |
Fixes rescue timeout due to incorrect kernel parameter in the iPXE script.
See `bug 1749860 <https://bugs.launchpad.net/ironic/+bug/1749860>`_ for
details.