dell / iDRAC-Redfish-Scripting

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

InsertEjectVirtualMediaREDFISH.py unable to insert ISO file residing on CIFS share; works from iDRAC GUI #284

Closed srcauley closed 4 months ago

srcauley commented 4 months ago

I can successfully mount this ISO via the iDRAC GUI...

image

I can see the ISO is mounted using the InsertEjectVirtualMediaREDFISH.py --get argument...

image

I can eject the virtual media...

image

But the following command fails. Note I copied and pasted the URI from the working GUI setting. Am I missing something?

image

Version info...

image

srcauley commented 4 months ago

Not sure if it is because of special characters in my password, but I had to enclose the CIFS username and and password in double quotes to get it to work. Issue resolved.

image

texroemer commented 4 months ago

Hi @srcauley

Thanks for root causing the issue and yes if your network share password has special characters surround the string with quotes. I'll update the argument help text to state this info.

Thanks Tex

srcauley commented 4 months ago

@texroemer Ugh, sorry I got ahead of myself. I had started using RACADM to accomplish the ISO virtual media mount and initially had the same issue. I discovered that the quotes resolved the issue with RACADM, not InsertEjectVirtualMediaREDFISH.py I subsequently tried the same with the Python script and it still results in the same error. I have Re-opened the issue.

texroemer commented 4 months ago

Ok can you share the special character(s) you're using in the password string.

srcauley commented 4 months ago

Ok can you share the special character(s) you're using in the password string.

There is a ^ in my password.

srcauley commented 4 months ago

I will get with my lab admin and see if there is another account I can use to rule out the special characters being the cause. I will let you know.

texroemer commented 4 months ago

Tested CIFS user password with ^ and no issues with attach virtual media. Are you still seeing Redfish action fail?

C:\Python310>python InsertEjectVirtualMediaREDFISH.py -ip 192.168.0.120 -u root -p calvin --action insert --index 1 --uripath //192.168.0.130/sambashare/boot.iso --username tester --password "Test123^"

- PASS, POST command passed to successfully insert virtual media, status code 204 returned
vincent-tang1 commented 4 months ago

python InsertEjectVirtualMediaREDFISH.py -ip 192.168.0.120 -u root -p calvin --action insert --index 1 --uripath //192.168.0.130/sambashare/boot.iso --username tester --password "Test123^"

sorry, may i have a extenstion question, above examples seems like no Donain Name required in sabma. If Donain Name is needed, what should the '--uripath' value in redfish script is like ? Thanks

srcauley commented 4 months ago

InsertEjectVirtualMediaREDFISH.py -ip 192.168.0.120 -u root -p calvin --action insert --index 1 --uripath //192.168.0.130/sambashare/boot.iso --username tester --password "Test123^

Apologies for the slow reply. I ended up using BootToNetworkIsoOsdREDFISH.py instead to accomplish the task. I did however circle back to test again and I am no longer seeing the issue with the mount. I am not sure why it was failing during my last check. All appears well at this time. Thanks Tex!!

srcauley commented 4 months ago

python InsertEjectVirtualMediaREDFISH.py -ip 192.168.0.120 -u root -p calvin --action insert --index 1 --uripath //192.168.0.130/sambashare/boot.iso --username tester --password "Test123^"

sorry, may i have a extenstion question, above examples seems like no Donain Name required in sabma. If Donain Name is needed, what should the '--uripath' value in redfish script is like ? Thanks

Perhaps try.... --username "DOMAIN_NAME/username" ###make sure to enclose in quotes. This is my best guess.

I'm no sure if that will work. I do not have to specify the domain name in my use case.

srcauley commented 4 months ago

Tested CIFS user password with ^ and no issues with attach virtual media. Are you still seeing Redfish action fail?

C:\Python310>python InsertEjectVirtualMediaREDFISH.py -ip 192.168.0.120 -u root -p calvin --action insert --index 1 --uripath //192.168.0.130/sambashare/boot.iso --username tester --password "Test123^"

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

Closing this as issue is no longer reproducible. Using double quotes around passwords with special characters works as demonstrated in Tex's example.

vincent-tang1 commented 4 months ago

python InsertEjectVirtualMediaREDFISH.py -ip 192.168.0.120 -u root -p calvin --action insert --index 1 --uripath //192.168.0.130/sambashare/boot.iso --username tester --password "Test123^"

sorry, may i have a extenstion question, above examples seems like no Donain Name required in sabma. If Donain Name is needed, what should the '--uripath' value in redfish script is like ? Thanks

Perhaps try.... --username "DOMAIN_NAME/username" ###make sure to enclose in quotes. This is my best guess.

I'm no sure if that will work. I do not have to specify the domain name in my use case.

Thanks @srcauley reply,

@texroemer because we have not the device to try in hand currently, but hope first understand related behavior. could you help to clarify @srcauley reply ? many thanks

texroemer commented 4 months ago

Hi @vincent-tang1

I currently don't have access to a samba share setup as a domain controller but if you do have to pass in the domain name to access the SMB share @srcauley response should work. Action VirtualMedia.InsertMedia DMTF does not support domain or workgroup properties to pass in for the body.

Thanks Tex

vincent-tang1 commented 1 month ago

Hi @vincent-tang1

I currently don't have access to a samba share setup as a domain controller but if you do have to pass in the domain name to access the SMB share @srcauley response should work. Action VirtualMedia.InsertMedia DMTF does not support domain or workgroup properties to pass in for the body.

Thanks Tex

@texroemer Not sure if you will consider to add statement about 'Donain Name' operation to this "InsertEjectVirtualMediaREDFISH.py" script help?

texroemer commented 1 month ago

@vincent-tang1

Thanks for pointing this out, I've updated the help text with this information.

-Tex