dell / iDRAC-Redfish-Scripting

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

Insert VirtualMedia Payload issue #111

Closed kgrvamsi closed 4 years ago

kgrvamsi commented 4 years ago

Hi @texroemer

When i try to insert a virtual media via postman i think the server is not accepting the boolean values as per the documentation

image

REF url: https://www.dell.com/support/manuals/id/en/idbiz1/idrac9-lifecycle-controller-v4.x-series/idrac9_4.00.00.00_redfishapiguide_pub/virtualmedia?guid=guid-44720af7-7951-49b2-89fc-01181a0edf92&lang=en-us

I tried the following

URL: https://{{DELL_SERVER}}/redfish/v1/Managers/iDRAC.Embedded.1/VirtualMedia/CD/Actions/VirtualMedia.InsertMedia

Method: POST

{
    "Image": "http://<webserver>/dell730raid.iso",
    "Inserted": 0,
    "WriteProtected": 0
}

{
    "Image": "http://<webserver>/dell730raid.iso",
    "Inserted": true,
    "WriteProtected": true
}

{
    "Image": "http://<webserver>/dell730raid.iso",
    "Inserted": "True",
    "WriteProtected": "True"
}

image

texroemer commented 4 years ago

Hi @kgrvamsi

I just tried using Postman with iDRAC 4.10, no issues.

image

Did you also try python script or Powershell cmdlet, also fails?

Thanks

kgrvamsi commented 4 years ago

How about this version?

iDRAC Firmware Version | 4.00.00.00

I didn't tried any scripts @texroemer

texroemer commented 4 years ago

I rollback the iDRAC to 4.00, still works with no issues. The only way i repro the issue was passing in a boolean value of false which is not supported.

Did you try removing WriteProtected from the JSON body, see if it passes?

kgrvamsi commented 4 years ago

@texroemer not sure on why my postman is not taking my request but i tried using the curl command

curl -v --location --request POST 'https://135.63.x.x/redfish/v1/Managers/iDRAC.Embedded.1/VirtualMedia/CD/Actions/VirtualMedia.InsertMedia' --header 'Authorization: Basic dtyUiopbDN5ZmM=' --header 'Content-Type: application/json' --data-raw '{
    "Image": "http://<web-Server>/dell730raid.iso",
    "Inserted": true,
    "WriteProtected": true
}' --insecure

Got this error which is more of networking issue from the idrac to web server

"error":{"@Message.ExtendedInfo":[{"Message":"The remote file location is not accessible or reachable.","MessageArgs":[],"MessageArgs@odata.count":0"

So i assume the above payload is working

texroemer commented 4 years ago

If works from curl but not Postman, seems to be issue specific to Postman now. I've been trying multiple scenarios to try and repro your issue with Postman but unable to.

For new issue now where it can't reach HTTP share, is your web server Apache or IIS?

kgrvamsi commented 4 years ago

we are using Nginx (Open Resty version) as the HTTP Server.

texroemer commented 4 years ago

Never used Nginx with OpenResty before for HTTP server. Did some research online and setup this HTTP server, works with no issues attaching ISO as vmedia.

Can you check directory permissions and firewall settings? I was able to repro your issue when i blocked the port but once i opened it, no issues with attach vmedia.