Closed EajksEajks closed 5 months ago
A brief explanation why I try to attach both at the same time:
Hi @EajksEajks
For attaching multiple virtual media devices, supported index IDs are 1 and 2 not 0 and 1. Can you try using index 1 and 2 for attaching devices and see if it works.
See example below of attaching ISO (index 1) and IMG (index 2) at the same time.
C:\Python310>python InsertEjectVirtualMediaREDFISH.py -ip 192.168.0.120 -u root -p calvin --get
- Virtual Media Device Details -
{'@odata.context': '/redfish/v1/$metadata#VirtualMedia.VirtualMedia',
'@odata.id': '/redfish/v1/Systems/System.Embedded.1/VirtualMedia/1',
'@odata.type': '#VirtualMedia.v1_6_1.VirtualMedia',
'Actions': {'#VirtualMedia.EjectMedia': {'target': '/redfish/v1/Systems/System.Embedded.1/VirtualMedia/1/Actions/VirtualMedia.EjectMedia'},
'#VirtualMedia.InsertMedia': {'target': '/redfish/v1/Systems/System.Embedded.1/VirtualMedia/1/Actions/VirtualMedia.InsertMedia'}},
'Certificates': {'@odata.id': '/redfish/v1/Systems/System.Embedded.1/VirtualMedia/1/Certificates'},
'ConnectedVia': 'NotConnected',
'Description': 'iDRAC Virtual Media Instance',
'Id': '1',
'Image': None,
'ImageName': None,
'Inserted': False,
'MediaTypes': ['CD', 'DVD', 'USBStick'],
'MediaTypes@odata.count': 3,
'Name': 'VirtualMedia Instance 1',
'Password': None,
'TransferMethod': None,
'TransferProtocolType': None,
'UserName': None,
'VerifyCertificate': False,
'WriteProtected': None}
{'@odata.context': '/redfish/v1/$metadata#VirtualMedia.VirtualMedia',
'@odata.id': '/redfish/v1/Systems/System.Embedded.1/VirtualMedia/2',
'@odata.type': '#VirtualMedia.v1_6_1.VirtualMedia',
'Actions': {'#VirtualMedia.EjectMedia': {'target': '/redfish/v1/Systems/System.Embedded.1/VirtualMedia/2/Actions/VirtualMedia.EjectMedia'},
'#VirtualMedia.InsertMedia': {'target': '/redfish/v1/Systems/System.Embedded.1/VirtualMedia/2/Actions/VirtualMedia.InsertMedia'}},
'Certificates': {'@odata.id': '/redfish/v1/Systems/System.Embedded.1/VirtualMedia/2/Certificates'},
'ConnectedVia': 'NotConnected',
'Description': 'iDRAC Virtual Media Instance',
'Id': '2',
'Image': None,
'ImageName': None,
'Inserted': False,
'MediaTypes': ['CD', 'DVD', 'USBStick'],
'MediaTypes@odata.count': 3,
'Name': 'VirtualMedia Instance 2',
'Password': None,
'TransferMethod': None,
'TransferProtocolType': None,
'UserName': None,
'VerifyCertificate': False,
'WriteProtected': None}
C:\Python310>python InsertEjectVirtualMediaREDFISH.py -ip 192.168.0.120 -u root -p calvin --action insert --index 1 --uripath http://192.168.0.130/http_share/boot.iso
- PASS, POST command passed to successfully insert virtual media, status code 204 returned
C:\Python310>python InsertEjectVirtualMediaREDFISH.py -ip 192.168.0.120 -u root -p calvin --action insert --index 2 --uripath http://192.168.0.130/http_share/ks.img
- PASS, POST command passed to successfully insert virtual media, status code 204 returned
C:\Python310>python InsertEjectVirtualMediaREDFISH.py -ip 192.168.0.120 -u root -p calvin --get
- Virtual Media Device Details -
{'@odata.context': '/redfish/v1/$metadata#VirtualMedia.VirtualMedia',
'@odata.id': '/redfish/v1/Systems/System.Embedded.1/VirtualMedia/1',
'@odata.type': '#VirtualMedia.v1_6_1.VirtualMedia',
'Actions': {'#VirtualMedia.EjectMedia': {'target': '/redfish/v1/Systems/System.Embedded.1/VirtualMedia/1/Actions/VirtualMedia.EjectMedia'},
'#VirtualMedia.InsertMedia': {'target': '/redfish/v1/Systems/System.Embedded.1/VirtualMedia/1/Actions/VirtualMedia.InsertMedia'}},
'Certificates': {'@odata.id': '/redfish/v1/Systems/System.Embedded.1/VirtualMedia/1/Certificates'},
'ConnectedVia': 'URI',
'Description': 'iDRAC Virtual Media Instance',
'Id': '1',
'Image': 'http://192.168.0.130/http_share/boot.iso',
'ImageName': 'boot.iso',
'Inserted': True,
'MediaTypes': ['CD', 'DVD', 'USBStick'],
'MediaTypes@odata.count': 3,
'Name': 'VirtualMedia Instance 1',
'Password': None,
'TransferMethod': 'Stream',
'TransferProtocolType': 'HTTP',
'UserName': None,
'VerifyCertificate': False,
'WriteProtected': True}
{'@odata.context': '/redfish/v1/$metadata#VirtualMedia.VirtualMedia',
'@odata.id': '/redfish/v1/Systems/System.Embedded.1/VirtualMedia/2',
'@odata.type': '#VirtualMedia.v1_6_1.VirtualMedia',
'Actions': {'#VirtualMedia.EjectMedia': {'target': '/redfish/v1/Systems/System.Embedded.1/VirtualMedia/2/Actions/VirtualMedia.EjectMedia'},
'#VirtualMedia.InsertMedia': {'target': '/redfish/v1/Systems/System.Embedded.1/VirtualMedia/2/Actions/VirtualMedia.InsertMedia'}},
'Certificates': {'@odata.id': '/redfish/v1/Systems/System.Embedded.1/VirtualMedia/2/Certificates'},
'ConnectedVia': 'URI',
'Description': 'iDRAC Virtual Media Instance',
'Id': '2',
'Image': 'http://192.168.0.130/http_share/ks.img',
'ImageName': 'ks.img',
'Inserted': True,
'MediaTypes': ['CD', 'DVD', 'USBStick'],
'MediaTypes@odata.count': 3,
'Name': 'VirtualMedia Instance 2',
'Password': None,
'TransferMethod': 'Stream',
'TransferProtocolType': 'HTTP',
'UserName': None,
'VerifyCertificate': False,
'WriteProtected': True}
Thanks Tex
Hi Tex,
There seems to be two URLs dealing with VirtualMedia:
/redfish/v1/Managers/iDRAC.Embedded.1/VirtualMedia/CD/Actions/VirtualMedia.InsertMedia
/redfish/v1/Managers/iDRAC.Embedded.1/VirtualMedia/RemovableDisk/Actions/VirtualMedia.InsertMedia
/redfish/v1/Systems/System.Embedded.1/VirtualMedia/1/Actions/VirtualMedia.InsertMedia -> CD
/redfish/v1/Systems/System.Embedded.1/VirtualMedia/2/Actions/VirtualMedia.InsertMedia -> RemovableDisk
Only the second one allows the simultaneous insertion. Do you know the difference which justify there exists two different URLs?
By the way, the reason why it doesn't always work in my setup is because I used two different generations of PowerEdge servers (and I didn't pay attention). It doesn't work on R740/R640 (iDRAC firmware 5.x). It does work on R760/R660 (iDRAC firmware 7.x).
VirtualMedia support for Manager schema was legacy behavior and support has been deprecated. But the URIs for Manager schema are still reported for backwards compatibility if the user is still using older iDRAC firmware (5.10 or older).
Starting in iDRAC 6.00 VirtualMedia support for ComputerSystem schema was added to allow the user to attach multiple virtual devices at the same time and also be compliant with DMTF. If you run GET on URI "redfish/v1/Managers/iDRAC.Embedded.1" you will see "VirtualMedia@Redfish.Deprecated" property reporting the correct URI to now use.
Example:
Thanks Tex
Hi.
When I try to insert a CD (using an https://...iso URI), then a RemovableDisk (using an https://...img URI), the 1st one succeeds, the 2nd one fails. If I switch the order of insertion, same result : the 1st one always succeeds, the 2nd one always fails.
I tried it successfully a couple of weeks ago. Unfortunately I didn't write the python commands I executed at that time, but I remember I had to identify CD by 0 and RemovableDisk by 1. Pretty strange it is no longer possible. However I upgraded the iDRAC firmware to the latest version beginning of this work. No idea whether it explains that I was able to do it, or not.
Anyway it doesn't work using your python package to call the Redfish API but it works (attaching both CD and RemovableDisk) if I use the dropdown menu in the virtual console (through the iDRAC web UI).