Always add 'boot_method' vmedia in redfish/ilo vmedia boot

The inclusion of a boot_method=vmedia kernel command line
argument is mandatory singnaling so IPA understands it has
been booted via virtual media, and to act accordingly.

Change-Id: I92751a3f4305fe0ded9ff379643b45132fe66157
Story: 2008749
Task: 42181
This commit is contained in:
Julia Kreger 2021-03-29 10:41:47 -07:00
parent 851aac397e
commit 4bd1c40bdc
5 changed files with 28 additions and 5 deletions

View File

@ -453,6 +453,8 @@ class IloVirtualMediaBoot(base.BootInterface):
task.node.driver_internal_info['agent_secret_token']
task.node.save()
ramdisk_params['boot_method'] = 'vmedia'
deploy_nic_mac = deploy_utils.get_single_nic_with_vif_port_id(task)
if deploy_nic_mac is not None:
ramdisk_params['BOOTIF'] = deploy_nic_mac
@ -1097,6 +1099,9 @@ class IloUefiHttpsBoot(base.BootInterface):
if deploy_nic_mac is not None:
ramdisk_params['BOOTIF'] = deploy_nic_mac
# Signal to IPA that this is a vmedia boot operation.
ramdisk_params['boot_method'] = 'vmedia'
mode = 'deploy'
if node.provision_state == states.RESCUING:
mode = 'rescue'

View File

@ -487,6 +487,10 @@ class RedfishVirtualMediaBoot(base.BootInterface):
managers = redfish_utils.get_system(task.node).managers
# NOTE(TheJulia): This is a mandatory setting for virtual media
# based deployment operations.
ramdisk_params['boot_method'] = 'vmedia'
if config_via_removable:
removable = _has_vmedia_device(
@ -494,10 +498,6 @@ class RedfishVirtualMediaBoot(base.BootInterface):
# Prefer USB devices since floppies are outdated
[sushy.VIRTUAL_MEDIA_USBSTICK, sushy.VIRTUAL_MEDIA_FLOPPY])
if removable:
# NOTE (etingof): IPA will read the device only if
# we tell it to
ramdisk_params['boot_method'] = 'vmedia'
floppy_ref = image_utils.prepare_floppy_image(
task, params=ramdisk_params)

View File

@ -592,7 +592,8 @@ class IloVirtualMediaBootTestCase(test_common.BaseIloTest):
prepare_node_for_deploy_mock.assert_called_once_with(task)
eject_mock.assert_called_once_with(task)
expected_ramdisk_opts = {'a': 'b', 'BOOTIF': '12:34:56:78:90:ab',
'ipa-agent-token': mock.ANY}
'ipa-agent-token': mock.ANY,
'boot_method': 'vmedia'}
get_nic_mock.assert_called_once_with(task)
setup_vmedia_mock.assert_called_once_with(task, iso,
expected_ramdisk_opts)

View File

@ -448,6 +448,7 @@ class RedfishVirtualMediaBootTestCase(db_base.DbTestCase):
expected_params = {
'ipa-agent-token': mock.ANY,
'ipa-debug': '1',
'boot_method': 'vmedia',
}
mock_prepare_deploy_iso.assert_called_once_with(
@ -494,6 +495,7 @@ class RedfishVirtualMediaBootTestCase(db_base.DbTestCase):
expected_params = {
'ipa-agent-token': mock.ANY,
'boot_method': 'vmedia',
}
mock_prepare_deploy_iso.assert_called_once_with(

View File

@ -0,0 +1,15 @@
---
security:
- |
Fixes an issue where ironic was not properly labeling dynamicly built
virtual media ramdisks with the signifier flag so the ramdisk understands
it was booted from virtual media.
fixes:
- |
Fixes the missing ``boot_method`` ramdisk parameter for dynamicly build
virtual media payloads. This value must be set to ``vmedia`` for the
ramdisk running on virtual media to understand it is executing from
virtual media. This was fixed for cases where it is used with the
``redfish-virtual-media`` based boot interfaces as well as the
``ilo-virtual-media`` boot interface, which is where dynamic virtual media
deployment/cleaning ramdisk generation is supported.