From 68fcc6b0d2575c66b25a49b8594b4e3a51ab2241 Mon Sep 17 00:00:00 2001 From: Riccardo Pittau Date: Thu, 18 Apr 2024 17:18:57 +0200 Subject: [PATCH] Fix device_type in attach/detach vmedia for Redfish We need to translate the generic device_type to sushy device_type Change-Id: Id09e6f2b989513b41980c7b89c9d76edecc320db --- ironic/drivers/modules/redfish/management.py | 6 ++++-- .../fix-device_type-redfish-advmedia-dff448c2f9085a47.yaml | 7 +++++++ 2 files changed, 11 insertions(+), 2 deletions(-) create mode 100644 ironic/releasenotes/notes/fix-device_type-redfish-advmedia-dff448c2f9085a47.yaml diff --git a/ironic/drivers/modules/redfish/management.py b/ironic/drivers/modules/redfish/management.py index 64e2df002d..289c4755d7 100644 --- a/ironic/drivers/modules/redfish/management.py +++ b/ironic/drivers/modules/redfish/management.py @@ -1346,7 +1346,8 @@ class RedfishManagement(base.ManagementInterface): :param image_url: URL of the image to attach, HTTP or HTTPS. """ - redfish_boot.insert_vmedia(task, image_url, device_type) + redfish_boot.insert_vmedia(task, image_url, + BOOT_DEVICE_MAP_REV[device_type]) @task_manager.require_exclusive_lock def detach_virtual_media(self, task, device_types=None): @@ -1362,4 +1363,5 @@ class RedfishManagement(base.ManagementInterface): redfish_boot.eject_vmedia(task) else: for device_type in device_types: - redfish_boot.eject_vmedia(task, device_type) + redfish_boot.eject_vmedia(task, + BOOT_DEVICE_MAP_REV[device_type]) diff --git a/ironic/releasenotes/notes/fix-device_type-redfish-advmedia-dff448c2f9085a47.yaml b/ironic/releasenotes/notes/fix-device_type-redfish-advmedia-dff448c2f9085a47.yaml new file mode 100644 index 0000000000..99c520bc3f --- /dev/null +++ b/ironic/releasenotes/notes/fix-device_type-redfish-advmedia-dff448c2f9085a47.yaml @@ -0,0 +1,7 @@ +--- +fixes: + - | + Fixes an issue in Redfish generic attach and detach virtual media + where the virtual media devices were not recognized causing a + failure when attaching or detaching a single virtual media device. +