diff --git a/changelogs/fragments/6969-redfish-supermicro-virtual-media-discover-empty-workaround b/changelogs/fragments/6969-redfish-supermicro-virtual-media-discover-empty-workaround new file mode 100644 index 0000000000..9fb03e6c21 --- /dev/null +++ b/changelogs/fragments/6969-redfish-supermicro-virtual-media-discover-empty-workaround @@ -0,0 +1,2 @@ +bugfixes: + - redfish_command - add workaround in ``VirtualMediaInsert`` for Supermicro systems to treat slots marked as ``NotConnected`` as empty (https://github.com/ansible-collections/community.general/issues/6969). diff --git a/plugins/module_utils/redfish_utils.py b/plugins/module_utils/redfish_utils.py index 6c470c7da3..a60ec1fdac 100644 --- a/plugins/module_utils/redfish_utils.py +++ b/plugins/module_utils/redfish_utils.py @@ -2620,6 +2620,11 @@ class RedfishUtils(object): if (not data.get('Inserted', False) and not data.get('ImageName')): return uri, data + # WORKAROUND + # Supermicro systems do not properly clear out ImageName when media is ejected + if vendor == 'Supermicro': + if data.get('ConnectedVia') == 'NotConnected': + return uri, data return None, None @staticmethod