Open ppeereb1 opened 1 year ago
Files identified in the description: None
If these files are incorrect, please update the component name
section of the description or use the !component
bot command.
Files identified in the description:
If these files are incorrect, please update the component name
section of the description or use the !component
bot command.
cc @TSKushal @bhavya06 @jyundt @mraineri @rajeevkallur @renxulei @tomasg2012 @xmadsen click here for bot help
Yes, that's what appears to be happening here. Since Image
still contains the URI of the media, that virtual media slot won't be recognized as available, so the insert request fails.
Would you be able to run the eject step without the option to ignore errors?
Hi @mraineri yes I've checked on a BMC that did not had the Image property set and there it succeeds. I could not find a way to remove the image entry. The ejecting of the image is just successfull:
- name: Ejecting {{ Image }} on {{ bmc_ip }}
redfish_command:
category: Manager
command: VirtualMediaEject
baseuri: "{{ bmc_ip }}"
username: "{{ user }}"
password: "{{ password }}"
virtual_media:
image_url: '{{ Image }}'
resource_id: 1
register: debug
- name: debug
debug:
var: debug
- name: Get Virtual Media information
community.general.redfish_info:
category: Manager
command: GetVirtualMedia
baseuri: "{{ bmc_ip }}"
username: "{{ user }}"
password: "{{ password }}"
register: result
- name: result
debug:
var: result
Output:
TASK [during_install : Ejecting http://10.10.10.10:8080/bogus.iso] ***
ok: [localhost]
TASK [during_install : debug] **************************************************
ok: [localhost] => {
"debug": {
"changed": false,
"failed": false,
"msg": "Action was successful",
"return_values": {},
"session": {}
}
}
TASK [during_install : Get Virtual Media information] **************************
ok: [localhost]
TASK [during_install : result] *************************************************
ok: [localhost] => {
"result": {
"changed": false,
"failed": false,
"redfish_facts": {
"virtual_media": {
"entries": [
[
{
"resource_uri": "/redfish/v1/Managers/1"
},
[
{
"ConnectedVia": "NotConnected",
"Id": "CD1",
"Image": "http://10.10.10.10:8080/bogus.iso",
"ImageName": "bogus.iso",
"MediaTypes": [
"CD",
"DVD"
],
"Name": "Virtual Removable Media",
"TransferMethod": "Stream",
"TransferProtocolType": "HTTP",
"WriteProtected": true
}
]
]
],
"ret": true
}
}
}
}
This works, but would rather use the redfish module:
- name: Insert virtual Media
ansible.builtin.uri:
url: https://{{ bmc_ip }}/redfish/v1/Managers/1/VirtualMedia/CD1/Actions/VirtualMedia.InsertMedia
method: POST
force_basic_auth: true
user: {{ user }}
password: "{{ password }}"
headers:
Content-Type: application/json
body_format: json
body:
Image: "{{ new_image_url }}"
status_code: 202
After you insert the media, what's shown in the response to "GetVirtualMedia"? I'm hoping there's something we can key off of to know if we should attempt any sort of workaround.
Do you also know if Supermicro is aware of this issue? While we can make workarounds to bypass the issue, I'd really like Supermicro to fix their implementation since this is clearly a bug and not conformant with the standard.
This is the output of GetVirtualMedia when an image is inserted:
TASK [during_install : debug] **************************************************
ok: [prov-51L02-09.lw.odcnoord.nl] => {
"result": {
"changed": false,
"failed": false,
"redfish_facts": {
"virtual_media": {
"entries": [
[
{
"resource_uri": "/redfish/v1/Managers/1"
},
[
{
"ConnectedVia": "URI",
"Id": "CD1",
"Image": "http://10.10.10.10:8080/bogus.iso",
"ImageName": "bogus.iso",
"MediaTypes": [
"CD",
"DVD"
],
"Name": "Virtual Removable Media",
"TransferMethod": "Stream",
"TransferProtocolType": "HTTP",
"WriteProtected": true
}
]
]
],
"ret": true
}
}
}
The only thing that could to be validated is the ConnectedVia property. Supermicro is currently not aware of this issue. I will check internally in my company to see if we have support on these machines. The behaviour of the VirtualMediaEject should be that it clears the image & imageName property?
I've updated the BMC firmware to latest available: Firmware Revision: 01.74.02
That's right, we have this text in the long description:
At the completion of the operation, inserted shall be set to
false
and the image name shall be cleared.
The image name certainly isn't cleared after the media is ejected.
We also have this statement for the image string:
The value
null
shall indicates no image connection.
So, based on these statements, I would expect "ImageName" to be an empty string and "Image" to be null.
And yes, I think we can use the "ConnectedVia" property as a way of helping with a workaround to this issue.
Do you also know if Supermicro is aware of this issue? While we can make workarounds to bypass the issue, I'd really like Supermicro to fix their implementation since this is clearly a bug and not conformant with the standard.
@ppeereb1 Can you provide the SMC server model? I can also dig into this one a little bit.
We have this one: SYS-1029U-TR25M https://www.supermicro.com/en/products/system/1u/1029/sys-1029u-tr25m.cfm
@ppeereb1
Got it, thank you! Because this is an X11 based platform, I think it's going to be unlikely that this will be "fixed" via a FW release. But let me try to dig into this a bit.
Summary
Currently I have this playbook:
This results in the following output:
I thought this: https://github.com/ansible-collections/community.general/pull/4839 would fix it but i'm using 7.2.0 version. I think it's failing because Image/ImageName already is configured?
Issue Type
Bug Report
Component Name
community.general.redfish_command
Ansible Version
Community.general Version
Configuration
OS / Environment
Ubuntu 22.04 docker image
Steps to Reproduce
See summary
Expected Results
See summary
Actual Results
Code of Conduct