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

InsertEjectVirtualMediaREDFISH powershell fails #68

Closed jpbolwe closed 5 years ago

jpbolwe commented 5 years ago

Hello again,

I was trying to mount a general ISO as a test. the information gathering using Invoke-InsertEjectVirtualMediaREDFISH worked but the mount was failing and I did realize the DRAC was outdated so I did upgrade it using the Set-UpdateOneDeviceREDFISH, it worked well as expected:

So I tried again my ISO mount, but I'm still getting an error, is there any issue on the below execution or is there any issue on the cmdlet, just one thing to check I have to point to the port in the http server:

Invoke-InsertEjectVirtualMediaREDFISH -idrac_ip -idrac_username root -idrac_password calvin -virtual_media_action 1 -virtual_media_device 1 -uri_path http://<Repository server:port/Folderpath>/vmwareESXI65u2.iso

{"error":{"@Message.ExtendedInfo":[{"Message":"The requested operation cannot be completed because of an internal error.","MessageArgs":[],"MessageArgs@odata.count":0,"MessageId":"IDRAC.1.6.SYS446","RelatedProperties":[],"RelatedProperties@odata.count":0,"Resolution":"Retry the operation after a few minutes. If the issue persists, contact your service provider.","Severity":"Critical"},{"Message":"The request failed due to an internal service error. The service is still operational.","MessageArgs":[],"MessageArgs@odata.count":0,"MessageId":"Base.1.2.InternalError","RelatedProperties":[],"RelatedProperties@odata.count":0,"Resolution":"Resubmit the request. If the problem persists, consider resetting the service.","Severity":"Critical"}],"code":"Base.1.2.GeneralError","message":"A general error has occurred. See ExtendedInfo for more information"}}

texroemer commented 5 years ago

Hi @jpbolwe

Can you check iDRAC Lifecycle Controller logs and see if there is any other log entries as to why it failed?

Using remote or local RACADM, can you execute "racadm get idrac.virtualmedia" command and send the output? Need to see if any other virtual media sessions are already running. If yes, this will cause Redfish attach to fail.

Example of output:

C:\Python27>racadm -r 192.168.0.120 -u root -p calvin get idrac.virtualmedia --nocertwarn [Key=idrac.Embedded.1#VirtualMedia.1]

ActiveSessions=0

Attached=AutoAttach BootOnce=Disabled Enable=Enabled EncryptEnable=Enabled FloppyEmulation=Disabled KeyEnable=Disabled

MaxSessions=1

jpbolwe commented 5 years ago

Hello,

I don't have racadm handy available here, so I did run your own check and I'm adding the details from within the DRAC web interface as well:

"Invoke-InsertEjectVirtualMediaREDFISH -idrac_ip -idrac_username root -idrac_password calvin -get_virtual_media_info y"

@odata.context : /redfish/v1/$metadata#VirtualMedia.VirtualMedia @odata.id : /redfish/v1/Managers/iDRAC.Embedded.1/VirtualMedia/RemovableDisk @odata.type : #VirtualMedia.v1_2_0.VirtualMedia Actions : @{#VirtualMedia.EjectMedia=; #VirtualMedia.InsertMedia=} ConnectedVia : NotConnected Description : iDRAC Virtual Media Services Settings Id : RemovableDisk Image : ImageName : Inserted : False MediaTypes : {USBStick} MediaTypes@odata.count : 1 Name : Virtual Removable Disk WriteProtected :

@odata.context : /redfish/v1/$metadata#VirtualMedia.VirtualMedia @odata.id : /redfish/v1/Managers/iDRAC.Embedded.1/VirtualMedia/CD @odata.type : #VirtualMedia.v1_2_0.VirtualMedia Actions : @{#VirtualMedia.EjectMedia=; #VirtualMedia.InsertMedia=} ConnectedVia : NotConnected Description : iDRAC Virtual Media Services Settings Id : CD Image : ImageName : Inserted : False MediaTypes : {CD, DVD} MediaTypes@odata.count : 2 Name : Virtual CD WriteProtected :

From the WEB interface:

General overview: Device Type 14G Modular
Hardware Version 0.01
Firmware Version 3.30.30.30
Firmware Updated Tue Jun 11 09:34:03 2019
RAC Time Tue Jun 11 17:11:03 2019
Number of Possible Sessions 8
Number of Current Sessions 1
IPMI Version 2.0

and under virtual media: image

jpbolwe commented 5 years ago

Just in case I did also run an unmount:

PS H:> Invoke-InsertEjectVirtualMediaREDFISH -idrac_ip -idrac_username root -idrac_password calvin -virtual_media_action 2 -virtual_media_device 1

{"error":{"@Message.ExtendedInfo":[{"Message":"No Virtual Media devices are currently connected.","MessageArgs":[],"MessageArgs@odata.count":0,"MessageId":"IDRAC.1.6.VRM0009","RelatedProperties":[],"RelatedProperties@odata.count":0,"Resolution":"No response action is required.","Severity":"Critical"},{"Message":"The request failed due to an internal service error. The service is still operational.","MessageArgs":[],"MessageArgs@odata.count":0,"MessageId":"Base.1.2.InternalError","RelatedProperties":[],"RelatedProperties@odata.count":0,"Resolution":"Resubmit the request. If the problem persists, consider resetting the service.","Severity":"Critical"}],"code":"Base.1.2.GeneralError","message":"A general error has occurred. See ExtendedInfo for more information"}}

texroemer commented 5 years ago

Thanks. So this confirms you have no active virtual media sessions.

Can you check iDRAC Lifecycle logs and see what error is reported? You should see an error message stating why it failed to access your share.

Also can you access your HTTP share with no issues? You are able to read and write to it, firewall is not blocking the port.

jpbolwe commented 5 years ago

Well, also general message from my knowledge, although through the console I'm able to map the media. The file is available and downloadable from the http repository see the logs below:

image

texroemer commented 5 years ago

Thanks. In the iDRAC GUI, can you go to Configuration / Virtual Media / Remote File Share and use this feature to try and connect with your HTTP share ISO. If this fails, then we know its not a Redfish specific issue and an issue with iDRAC accessing your HTTP share.

Also which web server are you using? Is it IIS or Apache?

jpbolwe commented 5 years ago

Hello, I tried from the GUI under the Virtual Media and it failed while accessing from my computer or any other did work, after some coffee, I did realize that under IIS the anonymous logon was not enabled, so totally my fault. After enabling the anon logon and configuring the site binding in my Repository IIS server it worked:

PS H:> Invoke-InsertEjectVirtualMediaREDFISH -idrac_ip -idrac_username root -idrac_password calvin -virtual_media_action 1 -virtual_media_device 1 -uri_path http://<RepoIP/Folderpath>/vmwareESXI65u2.iso

texroemer commented 5 years ago

Good to hear it's now working :)