diff options
author | Aija Jauntēva <aija.jaunteva@dell.com> | 2022-06-29 08:09:53 -0400 |
---|---|---|
committer | Aija Jauntēva <aija.jaunteva@dell.com> | 2022-06-29 09:12:13 -0400 |
commit | 73040c88d99f066644277f32e86d196305fc8596 (patch) | |
tree | 98fb241bee08b4b0a17d8af988b908eccbb476fe /ironic/drivers/modules | |
parent | 8aaf2e08c074e786767a24adbbe3afec5ff622c3 (diff) | |
download | ironic-73040c88d99f066644277f32e86d196305fc8596.tar.gz |
Fix redfish-virtual-media for newer iDRACs
The issue with standard Redfish virtual media boot has
been fixed now. Update to restrict use of redfish-virtual-media
based on iDRAC firmware version.
Change-Id: I8ead1d24a9bd502b64fe7dd058e77550fcee141c
Diffstat (limited to 'ironic/drivers/modules')
-rw-r--r-- | ironic/drivers/modules/drac/boot.py | 2 | ||||
-rw-r--r-- | ironic/drivers/modules/redfish/boot.py | 25 |
2 files changed, 22 insertions, 5 deletions
diff --git a/ironic/drivers/modules/drac/boot.py b/ironic/drivers/modules/drac/boot.py index 1e2f30dc0..aa3b49708 100644 --- a/ironic/drivers/modules/drac/boot.py +++ b/ironic/drivers/modules/drac/boot.py @@ -69,7 +69,7 @@ class DracRedfishVirtualMediaBoot(redfish_boot.RedfishVirtualMediaBoot): boot_devices.CDROM: sushy.VIRTUAL_MEDIA_CD } - def _validate_vendor(self, task): + def _validate_vendor(self, task, managers): pass # assume people are doing the right thing @classmethod diff --git a/ironic/drivers/modules/redfish/boot.py b/ironic/drivers/modules/redfish/boot.py index 25240228e..164425eee 100644 --- a/ironic/drivers/modules/redfish/boot.py +++ b/ironic/drivers/modules/redfish/boot.py @@ -407,18 +407,34 @@ class RedfishVirtualMediaBoot(base.BootInterface): d_info = _parse_deploy_info(node) deploy_utils.validate_image_properties(task, d_info) - def _validate_vendor(self, task): + def _validate_vendor(self, task, managers): + """Validates vendor specific requirements for the task's node. + + :param task: a TaskManager instance containing the node to act on. + :param managers: Redfish managers for Redfish system associated + with node. + :raises: InvalidParameterValue if vendor not supported + """ vendor = task.node.properties.get('vendor') if not vendor: return if 'Dell' in vendor.split(): + # Check if iDRAC fw >= 6.00.00.00 that supports virtual media boot + bmc_manager = [m for m in managers + if m.manager_type == sushy.MANAGER_TYPE_BMC] + if bmc_manager: + fwv = bmc_manager[0].firmware_version.split('.') + if int(fwv[0]) >= 6: + return raise exception.InvalidParameterValue( _("The %(iface)s boot interface is not suitable for node " - "%(node)s with vendor %(vendor)s, use " + "%(node)s with vendor %(vendor)s and BMC version %(fwv)s, " + "upgrade to 6.00.00.00 or newer or use " "idrac-redfish-virtual-media instead") % {'iface': task.node.get_interface('boot'), - 'node': task.node.uuid, 'vendor': vendor}) + 'node': task.node.uuid, 'vendor': vendor, + 'fwv': bmc_manager[0].firmware_version}) def validate(self, task): """Validate the deployment information for the task's node. @@ -431,7 +447,6 @@ class RedfishVirtualMediaBoot(base.BootInterface): :raises: InvalidParameterValue on malformed parameter(s) :raises: MissingParameterValue on missing parameter(s) """ - self._validate_vendor(task) self._validate_driver_info(task) self._validate_instance_info(task) @@ -474,6 +489,8 @@ class RedfishVirtualMediaBoot(base.BootInterface): d_info = _parse_driver_info(node) managers = redfish_utils.get_system(task.node).managers + self._validate_vendor(task, managers) + if manager_utils.is_fast_track(task): if _has_vmedia_device(managers, sushy.VIRTUAL_MEDIA_CD, inserted=True): |