dell / iDRAC-Redfish-Scripting

Python and PowerShell scripting for Dell EMC PowerEdge iDRAC REST API with DMTF Redfish
GNU General Public License v2.0
603 stars 279 forks source link

InsertEjectVirtualMediaREDFISH.py always gives "remote file location is not accessible" #265

Closed eedelk closed 10 months ago

eedelk commented 1 year ago

Hi, for a Dell server with iDRAC version 6.10.30.00 I am running command: InsertEjectVirtualMediaREDFISH.py -ip IP -u root -p PWD --action insert --device cd --uripath http://WEBSERVER_IP/xxx.iso

The command always fails with error:

The uripath however is correct and working for sure. I can run: wget

I also tried with uripath: https://releases.ubuntu.com/jammy/ubuntu-22.04.3-desktop-amd64.iso and get the same error.

Anyone has an idea what could be the root cause? //Thank you

texroemer commented 1 year ago

Hi @eedelk

Starting in iDRAC version 6.00.02 insert / eject virtual media now uses Systems schema where you pass in the index ID for the virtual media device. See below example where i was able to attach the ISO using the index ID.

C:\Python310>racadm -r 192.168.0.120 -u root -p calvin --nocertwarn getversion
 Bios Version                     = 1.11.2

 iDRAC Version                    = 6.10.30.00

 Lifecycle Controller Version     = 6.10.30.00

 IDSDM Version                    = NA

C:\Python310>python InsertEjectVirtualMediaREDFISH.py -ip 192.168.0.120 -u root -p calvin --action insert --index 1 --uripath https://releases.ubuntu.com/jammy/ubuntu-22.04.3-desktop-amd64.iso

- PASS, POST command passed to successfully insert virtual media, status code 204 returned

Let me know if you're still seeing issues when using the index ID to attach virtual media.

Thanks Tex

eedelk commented 1 year ago

Hi Tex, thanks for your hint. But I still have the problem:

racadm -r IP -u root -p PWD --nocertwarn getversion Bios Version = 2.17.1

iDRAC Version = 6.10.30.00

Lifecycle Controller Version = 6.10.30.00

IDSDM Version = NA

I added printout of version and payload also:

python /usr/local/bin/InsertEjectVirtualMediaREDFISH.py -ip IP -u root -p PWD --action insert --index 1 --uripath https://releases.ubuntu.com/jammy/ubuntu-22.04.3-desktop-amd64.iso iDRAC_version: new payload: {'Image': 'https://releases.ubuntu.com/jammy/ubuntu-22.04.3-desktop-amd64.iso', 'Inserted': True, 'WriteProtected': True}

Credentials are correct for sure. Inserting virtual media manually via the GUI and then ejecting it with "InsertEjectVirtualMediaREDFISH.py" is working.

I also tried other locally available ISOs but always get above error :-(

"GET" to my surprise only working correct when using "CD" instead of index:

curl -ksu '***' -X GET https://IP/redfish/v1/Managers/iDRAC.Embedded.1/VirtualMedia/CD -H 'Content-Type: application/json' | python -m json.tool { "@odata.context": "/redfish/v1/$metadata#VirtualMedia.VirtualMedia", "@odata.id": "/redfish/v1/Managers/iDRAC.Embedded.1/VirtualMedia/CD", "@odata.type": "#VirtualMedia.v1_5_1.VirtualMedia", "Actions": { "#VirtualMedia.EjectMedia": { "target": "/redfish/v1/Managers/iDRAC.Embedded.1/VirtualMedia/CD/Actions/VirtualMedia.EjectMedia" }, "#VirtualMedia.InsertMedia": { "target": "/redfish/v1/Managers/iDRAC.Embedded.1/VirtualMedia/CD/Actions/VirtualMedia.InsertMedia" } }, "ConnectedVia": "Applet", "Description": "iDRAC Virtual Media Services Settings", "Id": "CD", "Inserted": true, "MediaTypes": [ "CD", "DVD" ], "MediaTypes@odata.count": 2, "Name": "Virtual CD", "Password": null, "WriteProtected": null }

Thank you eedelk

texroemer commented 1 year ago

Since you have RACADM installed can you try using remoteimage command to mount the ISO, see if that also fails or passes. If it fails then we'll know its not an interface issue meaning issue only occurs with Redfish not RACADM.

Example of using RACADM command:

[root@SCPexport opt]# racadm -r 192.168.0.120 -u root -p calvin remoteimage -s
Security Alert: Certificate is invalid - self signed certificate
Continuing execution. Use -S option for racadm to stop execution on certificate-related errors.
Remote File Share is Disabled
UserName
Password
ShareName

[root@SCPexport opt]# racadm -r 192.168.0.120 -u root -p calvin remoteimage -l https://releases.ubuntu.com/jammy/ubuntu-22.04.3-desktop-amd64.iso -c
Security Alert: Certificate is invalid - self signed certificate
Continuing execution. Use -S option for racadm to stop execution on certificate-related errors.
Remote Image is now Configured

[root@SCPexport opt]# racadm -r 192.168.0.120 -u root -p calvin remoteimage -s
Security Alert: Certificate is invalid - self signed certificate
Continuing execution. Use -S option for racadm to stop execution on certificate-related errors.
Remote File Share is Enabled
UserName
Password
ShareName https://releases.ubuntu.com/jammy/ubuntu-22.04.3-desktop-amd64.iso

Thanks Tex

eedelk commented 1 year ago

Hi Tex,

I tried racadm also and it failed:

racadm -r IP -u root -p PWD remoteimage -l https://releases.ubuntu.com/jammy/ubuntu-22.04.3-desktop-amd64.iso -c
Security Alert: Certificate is invalid - self signed certificate
Continuing execution. Use -S option for racadm to stop execution on certificate-related errors.
ERROR: RAC0720: Unable to locate the ISO or IMG image file in the network share        
             location because the file path or the user credentials entered may be        
             incorrect. Ensure that you provide the correct file path and credentials,        
             and then retry the operation.

Probably it is something related to my environment :-( I tried with a local iso and then it seems it is doing something (at least it took a while until the error popped up) But finally failed also:

racadm -r IP -u root -p PWD remoteimage -l MY_ISO -c
Security Alert: Certificate is invalid - self signed certificate
Continuing execution. Use -S option for racadm to stop execution on certificate-related errors.
ERROR: Unable to perform requested operation.  

Thank you eedelk

texroemer commented 1 year ago

Do you have a local CIFS or NFS share you can use to try and attach the ISO? This can help narrow down which network protocol is failing or getting blocked on your network.

Example using RHEL 8 NFS share:

C:\Python310>racadm -r 192.168.0.120 -u root -p calvin --nocertwarn remoteimage -c -l 192.168.0.130:/nfs/boot.iso
Remote Image is now Configured

Thanks Tex