diff --git a/ironic/drivers/modules/ilo/boot.py b/ironic/drivers/modules/ilo/boot.py index fe2cef02aa..63e302cabe 100644 --- a/ironic/drivers/modules/ilo/boot.py +++ b/ironic/drivers/modules/ilo/boot.py @@ -342,12 +342,7 @@ class IloVirtualMediaBoot(base.BootInterface): parameters :raises: UnsupportedDriverExtension """ - try: - _validate_driver_info(task) - except exception.MissingParameterValue: - # Fall back to non-managed in-band inspection - raise exception.UnsupportedDriverExtension( - driver=task.node.driver, extension='inspection') + _validate_driver_info(task) @METRICS.timer('IloVirtualMediaBoot.prepare_ramdisk') def prepare_ramdisk(self, task, ramdisk_params): @@ -921,12 +916,7 @@ class IloUefiHttpsBoot(base.BootInterface): parameters :raises: UnsupportedDriverExtension """ - try: - self._validate_driver_info(task) - except exception.MissingParameterValue: - # Fall back to non-managed in-band inspection - raise exception.UnsupportedDriverExtension( - driver=task.node.driver, extension='inspection') + self._validate_driver_info(task) @METRICS.timer('IloUefiHttpsBoot.prepare_ramdisk') def prepare_ramdisk(self, task, ramdisk_params): diff --git a/ironic/drivers/modules/redfish/boot.py b/ironic/drivers/modules/redfish/boot.py index 0afdc785ee..c684002338 100644 --- a/ironic/drivers/modules/redfish/boot.py +++ b/ironic/drivers/modules/redfish/boot.py @@ -606,14 +606,9 @@ class RedfishVirtualMediaBoot(base.BootInterface): :param task: A TaskManager instance with the node being checked :raises: MissingParameterValue if node is missing one or more required parameters - :raises: UnsupportedDriverExtension """ - try: - self._validate_driver_info(task) - except exception.MissingParameterValue: - # Fall back to non-managed in-band inspection - raise exception.UnsupportedDriverExtension( - driver=task.node.driver, extension='inspection') + # No unmanaged fallback for virtual media + self._validate_driver_info(task) def prepare_ramdisk(self, task, ramdisk_params): """Prepares the boot of deploy or rescue ramdisk over virtual media. @@ -979,14 +974,8 @@ class RedfishHttpsBoot(base.BootInterface): :param task: A TaskManager instance with the node being checked :raises: MissingParameterValue if node is missing one or more required parameters - :raises: UnsupportedDriverExtension """ - try: - self._validate_driver_info(task) - except exception.MissingParameterValue: - # Fall back to non-managed in-band inspection - raise exception.UnsupportedDriverExtension( - driver=task.node.driver, extension='inspection') + self._validate_driver_info(task) def prepare_ramdisk(self, task, ramdisk_params): """Prepares the boot of the agent ramdisk. diff --git a/ironic/tests/unit/drivers/modules/ilo/test_boot.py b/ironic/tests/unit/drivers/modules/ilo/test_boot.py index efce438489..fc6c0f8f18 100644 --- a/ironic/tests/unit/drivers/modules/ilo/test_boot.py +++ b/ironic/tests/unit/drivers/modules/ilo/test_boot.py @@ -577,7 +577,7 @@ class IloVirtualMediaBootTestCase(test_common.BaseIloTest): def test_validate_inspection_missing(self, mock_parse_driver_info): with task_manager.acquire(self.context, self.node.uuid, shared=True) as task: - self.assertRaises(exception.UnsupportedDriverExtension, + self.assertRaises(exception.MissingParameterValue, task.driver.boot.validate_inspection, task) @mock.patch.object(image_utils, 'prepare_deploy_iso', autospec=True) @@ -1838,7 +1838,7 @@ class IloUefiHttpsBootTestCase(db_base.DbTestCase): "Error validating iLO UEFIHTTPS for deploy.") with task_manager.acquire(self.context, self.node.uuid, shared=True) as task: - self.assertRaises(exception.UnsupportedDriverExtension, + self.assertRaises(exception.MissingParameterValue, task.driver.boot.validate_inspection, task) @mock.patch.object(ilo_common, 'add_certificates', diff --git a/ironic/tests/unit/drivers/modules/redfish/test_boot.py b/ironic/tests/unit/drivers/modules/redfish/test_boot.py index 5119713753..5aa388d4f3 100644 --- a/ironic/tests/unit/drivers/modules/redfish/test_boot.py +++ b/ironic/tests/unit/drivers/modules/redfish/test_boot.py @@ -507,7 +507,7 @@ class RedfishVirtualMediaBootTestCase(db_base.DbTestCase): def test_validate_inspection_missing(self, mock_parse_driver_info): with task_manager.acquire(self.context, self.node.uuid, shared=True) as task: - self.assertRaises(exception.UnsupportedDriverExtension, + self.assertRaises(exception.MissingParameterValue, task.driver.boot.validate_inspection, task) @mock.patch.object(redfish_boot.RedfishVirtualMediaBoot, diff --git a/releasenotes/notes/no-unmanaged-vmedia-9fc7378f93e3d11a.yaml b/releasenotes/notes/no-unmanaged-vmedia-9fc7378f93e3d11a.yaml new file mode 100644 index 0000000000..d94049d708 --- /dev/null +++ b/releasenotes/notes/no-unmanaged-vmedia-9fc7378f93e3d11a.yaml @@ -0,0 +1,9 @@ +--- +fixes: + - | + No longer falls back to `unmanaged` inspection for virtual media and + UEFI HTTP boot interfaces. Previously, if the validation of the boot + interface failed before in-band inspection, Ironic would switch to + unmanaged inspection, which involved PXE-booting. It is not expected + that nodes explicitly configured to use virtual media start booting + over PXE, so the fallback has been removed.