diff options
author | Dmitry Tantsur <dtantsur@protonmail.com> | 2022-06-23 19:24:44 +0200 |
---|---|---|
committer | Dmitry Tantsur <dtantsur@protonmail.com> | 2022-06-23 19:49:16 +0200 |
commit | 65583e64172a0188d125117d1f2288e105832395 (patch) | |
tree | 9f82c64c0e2b356cd7f9618d8cdb0d7c205499f7 /ironic/drivers/modules | |
parent | 1b6114934c122df115b8c945ca1ce8c3b7bd9bfd (diff) | |
download | ironic-65583e64172a0188d125117d1f2288e105832395.tar.gz |
No deploy_kernel/ramdisk with the ramdisk deploy and no cleaning
Ramdisk deploys don't use IPA, no need to provide it. Cleaning may need
the agent, so only skip verification if cleaning is disabled.
Other boot interfaces may need fixing as well, I haven't checked them.
Change-Id: Ia2739311f065e19ba539fe3df7268075d6075787
Diffstat (limited to 'ironic/drivers/modules')
-rw-r--r-- | ironic/drivers/modules/deploy_utils.py | 14 | ||||
-rw-r--r-- | ironic/drivers/modules/redfish/boot.py | 7 |
2 files changed, 20 insertions, 1 deletions
diff --git a/ironic/drivers/modules/deploy_utils.py b/ironic/drivers/modules/deploy_utils.py index f6883249f..89258b134 100644 --- a/ironic/drivers/modules/deploy_utils.py +++ b/ironic/drivers/modules/deploy_utils.py @@ -1452,3 +1452,17 @@ def get_root_device_for_deploy(node): _('Failed to validate the root device hints %(hints)s (from the ' 'node\'s %(source)s) for node %(node)s: %(error)s') % {'node': node.uuid, 'hints': hints, 'source': source, 'error': e}) + + +def needs_agent_ramdisk(node, mode='deploy'): + """Checks whether the node requires an agent ramdisk now.""" + if mode != 'deploy': + return True # Rescue always needs a ramdisk + + if get_boot_option(node) != 'ramdisk': + return True # Normal deploys need an agent + + # Ramdisk deploys don't need an agent, but cleaning will. Since we don't + # want nodes to be stuck on deletion, require an agent when cleaning is + # enabled. + return not manager_utils.skip_automated_cleaning(node, log=False) diff --git a/ironic/drivers/modules/redfish/boot.py b/ironic/drivers/modules/redfish/boot.py index 1ce05ced9..25240228e 100644 --- a/ironic/drivers/modules/redfish/boot.py +++ b/ironic/drivers/modules/redfish/boot.py @@ -91,9 +91,14 @@ def _parse_driver_info(node): :raises: InvalidParameterValue, if any of the parameters have invalid value. """ + mode = deploy_utils.rescue_or_deploy_mode(node) + if not deploy_utils.needs_agent_ramdisk(node, mode=mode): + # Ramdisk deploy does not need an agent, nor does it support any other + # options. Skipping. + return {'can_provide_config': False} + d_info = node.driver_info - mode = deploy_utils.rescue_or_deploy_mode(node) iso_param = f'{mode}_iso' iso_ref = driver_utils.get_agent_iso(node, deprecated_prefix='redfish', mode=mode) |