dell / iDRAC-Redfish-Scripting

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

Trying to Set next one time boot to virtual media device #116

Closed rlopez133 closed 4 years ago

rlopez133 commented 4 years ago

Hello,

I'm getting a weird issue with my iDRAC (2.70.70.70 , PowerEdge R730xd) where at times I get a 503 error and only after a racadm racreset does it work the initial first time and fails afterwards everytime with 503. I'm using the script as such:

Scrubbed creds.

python3 ./SetNextOneTimeBootVirtualMediaDeviceOemREDFISH.py -ip 192.168.0.2 -u ADMIN -p PASSWORD -d 1 -r y

If I attempt after a successful run, I get:


- WARNING, setting next onetime boot device to Virtual CD

- FAIL: status code 503 returned
- Detailed error information: {'_content': b'', '_content_consumed': True, '_next': None, 'status_code': 503, 'headers': {'Strict-Transport-Security': 'max-age=63072000', 'Vary': 'Accept-Encoding', 'Content-Type': 'application/json; charset=utf-8', 'Server': 'iDRAC/8', 'Date': 'Wed, 24 Jun 2020 02:07:13 GMT', 'Cache-Control': 'no-cache', 'Connection': 'Keep-Alive', 'Transfer-Encoding': 'chunked', 'Accept-Ranges': 'bytes'}, 'raw': <urllib3.response.HTTPResponse object at 0x7fd46cde4080>, 'url': 'https://192.168.0.2/redfish/v1/Managers/iDRAC.Embedded.1/Actions/Oem/EID_674_Manager.ImportSystemConfiguration', 'encoding': 'utf-8', 'history': [], 'reason': 'Service Unavailable', 'cookies': <RequestsCookieJar[]>, 'elapsed': datetime.timedelta(0, 0, 600526), 'request': <PreparedRequest [POST]>, 'connection': <requests.adapters.HTTPAdapter object at 0x7fd46ce38860>}

Any ideas why this happens? I have nothing pending in my jobqueue

Another question I have is, I'd like to be able to do this as a Ansible task and I've attempted this with no luck. Is there something wrong with my body format?

- name: Set Boot Override to VirtualMedia
  uri:
    url: "https://192.168.0.2/redfish/v1/Managers/iDRAC.Embedded.1/Actions/Oem/EID_674_Manager.ImportSystemConfiguration"
    validate_certs: no
    method: POST
    user: "ADMIN"
    password: "PASSWORD"
    headers:
      content-type: application/json
    body: '{"ShareParameters":{"Target":"ALL"},"ImportBuffer":"<SystemConfiguration><Component FQDD=\"iDRAC.Embedded.1\"><Attribute Name=\"ServerBoot.1#BootOnce\">Enabled</Attribute><Attribute Name=\"ServerBoot.1#FirstBootDevice\">VCD-DVD</Attribute></Component></SystemConfiguration>"}'
rlopez133 commented 4 years ago

@texroemer was wondering if by chance you had any sight? thanks a million :)

texroemer commented 4 years ago

Hi @rlopez133

After a successful run of setting onetime boot to virtual CD, server reboots and boots to ISO, can you let me know what state the server is in when you try the onetime boot command again and fails? Is the server still booted to the ISO, server booted to the OS, server off, etc?

Also when in failed state, can you try a different POST action, see if it passes? This will help in figuring out if Redfish API itself is having issues or just a certain action is failing. You can use script SetPowerStateREDFISH.py to execute POST action to reboot the server.

Thanks

rlopez133 commented 4 years ago

@texroemer so I went off and tried the following

In a nutshell, my problem is my uri module :( I'm sadly not passing something correctly. Latest attempt

- name: Set Boot Override to VirtualMedia
  uri:
    url: "https://192.168.0.2/redfish/v1/Managers/iDRAC.Embedded.1/Actions/Oem/EID_674_Manager.ImportSystemConfiguration"
    validate_certs: no
    return_content: yes
    method: POST
    user: "ADMIN"
    password: "PASSWORD"
    headers:
      Content-Type: application/json
      Accept: application/json;odata.metadata=minimal;charset=utf-8
    body_format: json
    body: '{"ShareParameters":{"Target":"ALL"},"ImportBuffer":"<SystemConfiguration><Component FQDD=\"iDRAC.Embedded.1\"><Attribute Name=\"ServerBoot.1#BootOnce\">Enabled</Attribute><Attribute Name=\"ServerBoot.1#FirstBootDevice\">VCD-DVD</Attribute></Component></SystemConfiguration>"}'

Just curious if by chance you see something wrong here? i understand your not dealing with Ansible I'm just wondering if theres some header or something else I need to be passing that will give a clue

This curl works

curl -k -u ADMIN:PASSWORD -X POST https://192.168.0.2/redfish/v1/Managers/iDRAC.Embedded.1/Actions/Oem/EID_674_Manager.ImportSystemConfiguration -H "Content-Type: application/json" -d '{"ShareParameters":{"Target":"ALL"},"ImportBuffer":"<SystemConfiguration><Component FQDD=\"iDRAC.Embedded.1\"><Attribute Name=\"ServerBoot.1#BootOnce\">Enabled</Attribute><Attribute Name=\"ServerBoot.1#FirstBootDevice\">VCD-DVD</Attribute></Component></SystemConfiguration>"}'

Appreciate all your guidance, really helped troubleshoot. I guess when I was attempting the Ansible cmds it was putting it in 503 state and then the regular .py or curl commands when I'd run manually wouldn't work at that point.

texroemer commented 4 years ago

@rlopez133

I've only used Ansible a few times but this was calling playbooks. How are you calling the uri module you created directly, can you give me an example and i'll try it out.

Thanks

texroemer commented 4 years ago

@rlopez133

I was able to repro your issue on iDRAC 8, issue does not occur on iDRAC 9 using same playbook. I went ahead and escalated this issue to the Redfish team at Dell, will let you know once i hear back.

Thanks

rlopez133 commented 4 years ago

Hi @texroemer ,

my observations:

Regarding the URI module, this is something I tried but doesn't work and I believe it may be an Ansible bug.

For example, I've gone and reverted to using shell directly in Ansible, something like

    - name: Set BootOnce into Virtual CD (DELL)
      shell: |
             curl -k -u {{ user }}:{{ password }} -X POST https://{{ bmc_address }}/redfish/v1/Managers/iDRAC.Embedded.1/Actions/Oem/EID_674_Manager.ImportSystemConfiguration -H "Content-Type: application/json" -d '{"ShareParameters":{"Target":"ALL"},"ImportBuffer":"<SystemConfiguration><Component FQDD=\"iDRAC.Embedded.1\"><Attribute Name=\"ServerBoot.1#BootOnce\">Enabled</Attribute><Attribute Name=\"ServerBoot.1#FirstBootDevice\">VCD-DVD</Attribute></Component></SystemConfiguration>"}' -i

Ideally, there would be a module in https://docs.ansible.com/ansible/latest/modules/redfish_command_module.html that would let you boot into VirtualMedia.

However, if that is not available (redfish_command module), I'd expect something like this to work using the URI module

- name: Set Boot Override to VirtualMedia
  uri:
    url: "https://{{ bmc_address 
 }}/redfish/v1/Managers/iDRAC.Embedded.1/Actions/Oem/EID_674_Manager.ImportSystemConfiguration"
    validate_certs: no
    method: POST
    user: "{{ user }}"
    password: "{{ password }}"
    headers:
      content-type: application/json
      accept: application/json
    body_format: json
    body: "{{ lookup('file','body.json') }}"

The body.json file

{
  "ShareParameters": {
    "Target": "ALL"
  },
  "ImportBuffer": "<SystemConfiguration><Component FQDD=\"iDRAC.Embedded.1\"><Attribute Name=\"ServerBoot.1#BootOnce\">Enabled<\/Attribute><Attribute Name=\"ServerBoot.1#FirstBootDevice\">VCD-DVD<\/Attribute><\/Component><\/SystemConfiguration>"
}

However, that URI request doesn't work as it complains about body format. This is easier to see if you attempted something like the below where your just trying to boot up the server. For example

- name: Power on System
  uri:
    url: "https://{{ bmc_address 
 }}/redfish/v1/Systems/System.Embedded.1/Actions/ComputerSystem.Reset"
    validate_certs: no
    method: POST
    user: "{{ user }}"
    password: "{{ password }}"
    headers:
      content-type: application/json
      accept: application/json
    body_format: json
    body: "{'ResetType': 'On'}"
texroemer commented 4 years ago

@rlopez133

Your URI module is not configured correctly. See my example below where its passing for me on iDRAC 9 (iDRAC 8 still fails which i'm still working with Redfish team on this issue).

[root@localhost dellemc-openmanage-ansible-modules]# ansible-playbook scp_local.yml -i inventory_14g.yml

PLAY [myhosts] ***

TASK [set onetime virtual CD using SCP] ** ok: [redfish1]

PLAY RECAP *** redfish1 : ok=1 changed=0 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0

[root@localhost dellemc-openmanage-ansible-modules]# cat scp_local.yml

rlopez133 commented 4 years ago

@texroemer on a FC640 that I have access to

    - name: set onetime virtual CD using SCP
      uri:
        url: "https://{{ hostvars[item]['bmc_address'] }}/redfish/v1/Managers/iDRAC.Embedded.1/Actions/Oem/EID_674_Manager.ImportSystemConfiguration"
        user: "{{ hostvars[item]['bmc_user'] }}"
        password: "{{ hostvars[item]['bmc_password'] }}"
        method: POST
        headers:
          content-type: application/json
          Accept: application/json
        body: '{"ShareParameters":{"Target":"ALL"},"ImportBuffer":"<Component FQDD="iDRAC.Embedded.1"><Attribute Name="ServerBoot.1#BootOnce">Enabled<Attribute Name="ServerBoot.1#FirstBootDevice">VCD-DVD"}'
        body_format: json
        validate_certs: no
        status_code: 202
        return_content: yes

It's not happy :/

[FAILED! => {"access_control_allow_origin": "*", "cache_control": "no-cache", "changed": false, "connection": "close", "content": "{\"error\":{\"@Message.ExtendedInfo\":[{\"Message\":\"Unable to complete the operation because the JSON data format entered is invalid.\",\"MessageArgs\":[],\"MessageArgs@odata.count\":0,\"MessageId\":\"IDRAC.2.1.SYS405\",\"RelatedProperties\":[],\"RelatedProperties@odata.count\":0,\"Resolution\":\"Do the following and the retry the operation: 1) Enter the correct JSON data format and retry the operation. 2) Make sure that no syntax error is present in JSON data format. 3) Make sure that a duplicate key is not present in JSON data format.\",\"Severity\":\"Critical\"},{\"Message\":\"The request body submitted was malformed JSON and could not be parsed by the receiving service.\",\"MessageArgs\":[],\"MessageArgs@odata.count\":0,\"MessageId\":\"Base.1.5.MalformedJSON\",\"RelatedProperties\":[],\"RelatedProperties@odata.count\":0,\"Resolution\":\"Ensure that the request body is valid JSON and resubmit the request.\",\"Severity\":\"Critical\"}],\"code\":\"Base.1.5.GeneralError\",\"message\":\"A general error has occurred. See ExtendedInfo for more information\"}}\n", "content_length": "1015", "content_type": "application/json;odata.metadata=minimal;charset=utf-8", "date": "Mon, 29 Jun 2020 21:38:25 GMT", "elapsed": 0, "json": {"error": {"@Message.ExtendedInfo": [{"Message": "Unable to complete the operation because the JSON data format entered is invalid.", "MessageArgs": [], "MessageArgs@odata.count": 0, "MessageId": "IDRAC.2.1.SYS405", "RelatedProperties": [], "RelatedProperties@odata.count": 0, "Resolution": "Do the following and the retry the operation: 1) Enter the correct JSON data format and retry the operation. 2) Make sure that no syntax error is present in JSON data format. 3) Make sure that a duplicate key is not present in JSON data format.", "Severity": "Critical"}, {"Message": "The request body submitted was malformed JSON and could not be parsed by the receiving service.", "MessageArgs": [], "MessageArgs@odata.count": 0, "MessageId": "Base.1.5.MalformedJSON", "RelatedProperties": [], "RelatedProperties@odata.count": 0, "Resolution": "Ensure that the request body is valid JSON and resubmit the request.", "Severity": "Critical"}], "code": "Base.1.5.GeneralError", "message": "A general error has occurred. See ExtendedInfo for more information"}}, "msg": "Status code was 400 and not [202]: HTTP Error 400: Bad Request", "odata_version": "4.0", "redirected": false, "server": "Apache", "status": 400, "strict_transport_security": "max-age=63072000; includeSubDomains; preload", "url": "https://mgmt-e20-h14-b03-fc640.rdu2.scalelab.redhat.com/redfish/v1/Managers/iDRAC.Embedded.1/Actions/Oem/EID_674_Manager.ImportSystemConfiguration", "x_frame_options": "DENY"}
texroemer commented 4 years ago

Your body is incorrect. You are missing open / closed SystemConfiguration XML tags in the string. Here is example of the correct body to pass in.

body: {"ShareParameters":{"Target":"ALL"},"ImportBuffer":"<SystemConfiguration><Component FQDD=\"iDRAC.Embedded.1\"><Attribute Name=\"ServerBoot.1#BootOnce\">Enabled</Attribute><Attribute Name=\"ServerBoot.1#FirstBootDevice\">VCD-DVD</Attribute></Component></SystemConfiguration>"}

rlopez133 commented 4 years ago

@texroemer can I say eagle eye? lol THANK YOU! Finally got that thing working.

texroemer commented 4 years ago

Good to hear its working for iDRAC9 now. Will let you know once i find out more details about iDRAC8 issue.

rlopez133 commented 4 years ago

@texroemer Another thing, so I went back to some other examples because you are correct I had it wrong here in what I pasted just a few moments ago. However, if you look at my original post it was correct. The real reason this didn't work is because the default status code for uri module is 200 but in the case of this iDRAC it uses a status code of 202 as success thus Ansible was failing it because the code wasn't right.

Taking the same exact code with correct body and removing the status_code: 202 you get

FAILED! => {"access_control_allow_origin": "*", "cache_control": "no-cache", "changed": false, "connection": "close", "content": "", "content_length": "0", "content_type": "application/json;odata.metadata=minimal;charset=utf-8", "cookies": {}, "cookies_string": "", "date": "Mon, 29 Jun 2020 22:18:55 GMT", "elapsed": 0, "location": "https://mgmt-e20-h14-b03-fc640.rdu2.scalelab.redhat.com/redfish/v1/TaskService/Tasks/JID_934691359798", "msg": "Status code was 202 and not [200]: OK (0 bytes)", "odata_version": "4.0", "redirected": false, "server": "Apache", "status": 202, "strict_transport_security": "max-age=63072000; includeSubDomains; preload", "url": "https://{{ host }}/redfish/v1/Managers/iDRAC.Embedded.1/Actions/Oem/EID_674_Manager.ImportSystemConfiguration", "x_frame_options": "DENY"}
rlopez133 commented 4 years ago

@texroemer thinking some more, is there a reason they don't use the standard success code of 200?

texroemer commented 4 years ago

Ansible seems to be hard coding looking for status code 200 when POST action is executed which is incorrect (i already escalated this issue to Ansible team). POST action could return 200, 202 or 204 depending on what the operation needs to do. Here it returns 202 because the operation passed but there is still something that needs to be completed. A job ID is returned in the header for this POST action which needs to execute and get marked completed, this is why 202 status code is returned.

texroemer commented 4 years ago

Found in Ansible docs, default status code 200 is checked for URI module.

https://docs.ansible.com/ansible/latest/modules/uri_module.html

In the URI module, i would add "status_code: [200, 202, 204]" which will handle all success status codes for POST.

texroemer commented 4 years ago

Hi @rlopez133

Can you go ahead and escalate the Ansible issue to Dell Tech Support? This will help in getting this issue escalated to the correct iDRAC team in Dell to get resolved.

Thanks

mel1nn commented 3 years ago

Hi,

I'm facing the same issue on an IDRAC 7 (Version 2.65.65.65).

When I try to run the same curl command as you did, I get a code error 503:

` curl -k -u USERNAME:PASSWORD-X POST https:///redfish/v1/Managers/iDRAC.Embedded.1/Actions/Oem/EID_674_Manager.ImportSystemConfiguration -H "Content-Type: application/json" -d '{"ShareParameters":{"Target":"ALL"},"ImportBuffer":"<Component FQDD=\"iD RAC.Embedded.1\"><Attribute Name=\"ServerBoot.1#BootOnce\">Enabled<Attribute Name=\"ServerBoot.1#FirstBootDevice\">VCD-DVD"}' -i

HTTP/1.1 503 Service Unavailable Strict-Transport-Security: max-age=63072000 Vary: Accept-Encoding Content-Type: application/json; charset=utf-8 Server: iDRAC/8 Date: Wed, 25 Nov 2020 16:59:24 GMT Cache-Control: no-cache Connection: Keep-Alive Transfer-Encoding: chunked Accept-Ranges: bytes `

Thanks for your help !

texroemer commented 3 years ago

Hi @mel1nn

Your string value for ImportBuffer parameter is incorrect. See working example below:

[root@localhost ~]# curl -X POST -u root:calvin -k "https://192.168.0.120/redfish/v1/Mana
gers/iDRAC.Embedded.1/Actions/Oem/EID_674_Manager.ImportSystemConfiguration" -H "Content-T
ype: application/json" -d '{"ShareParameters":{"Target":"ALL"},"ImportBuffer":"<SystemConf
iguration><Component FQDD=\"iDRAC.Embedded.1\"><Attribute Name=\"ServerBoot.1#BootOnce\">E
nabled</Attribute><Attribute Name=\"ServerBoot.1#FirstBootDevice\">VCD-DVD</Attribute></Co
mponent></SystemConfiguration>"}' -i -o output.txt
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   275    0     0  100   275      0    123  0:00:02  0:00:02 --:--:--   123
[root@localhost ~]# cat output.txt
HTTP/1.1 202 Accepted
Strict-Transport-Security: max-age=63072000
OData-Version: 4.0
Vary: Accept-Encoding
Content-Type: application/json;odata.metadata=minimal;charset=utf-8
Server: iDRAC/8
Location: /redfish/v1/TaskService/Tasks/JID_067858218360
Date: Tue, 01 Dec 2020 01:23:41 GMT
Cache-Control: no-cache
Content-Length: 0
Connection: Keep-Alive
Access-Control-Allow-Origin: *
Accept-Ranges: bytes
mel1nn commented 3 years ago

Same error:

curl -k -u ADMIN:PASSWORD -X POST https://X.X.X.X/redfish/v1/Managers/iDRAC.Embedded.1/Actions/Oem/EID_674_Manager.ImportSystemConfiguration -H "Content-Type: application/json" -d '{"ShareParameters":{"Target":"ALL"},"ImportBuffer":"<SystemConfiguration><Component FQDD=\"iDRAC.Embedded.1\"><Attribute Name=\"ServerBoot.1#BootOnce\">Enabled</Attribute><Attribute Name=\"ServerBoot.1#FirstBootDevice\">VCD-DVD</Attribute></Component></SystemConfiguration>"}' -i
HTTP/1.1 503 Service Unavailable
Strict-Transport-Security: max-age=63072000
Vary: Accept-Encoding
Content-Type: application/json; charset=utf-8
Server: iDRAC/8
Date: Tue, 01 Dec 2020 14:03:11 GMT
Cache-Control: no-cache
Connection: Keep-Alive
Transfer-Encoding: chunked
Accept-Ranges: bytes

And I also faced this problem when using Ironic for virtual media provisioning

texroemer commented 3 years ago

Are other GET/POST operations also failing? Can you try another POST operation and see if it also fails?

Example:

[root@localhost ~]# curl -k "https://192.168.0.120/redfish/v1/Systems/System.Embedded.1/A
ctions/ComputerSystem.Reset" -d '{"ResetType":"ForceRestart"}' -X POST -u root:calvin -H "Content-Type: application/json" -i -o output.txt
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100    28    0     0  100    28      0      6  0:00:04  0:00:04 --:--:--     6
[root@localhost ~]# cat output.txt
HTTP/1.1 204 No Content
Strict-Transport-Security: max-age=63072000
OData-Version: 4.0
OData-EntityId: /redfish/v1/Systems/System.Embedded.1
Vary: Accept-Encoding
Content-Type: application/json;odata.metadata=minimal;charset=utf-8
Server: iDRAC/8
Date: Fri, 04 Dec 2020 05:13:55 GMT
Cache-Control: no-cache
Content-Length: 0
Connection: Keep-Alive
Access-Control-Allow-Origin: *
Accept-Ranges: bytes
mel1nn commented 3 years ago

No, the other operations are working well, I only faced an error using the "EID_674_Manager.ImportSystemConfiguration" operation.

texroemer commented 3 years ago

Ok, can you flash latest iDRAC 2.75 version and see if issue still exists? Also which server platform are you using?

Thanks

ajaysimha commented 3 years ago

Hi,

I'm trying the curl command and it is failing: BIOS Version 2.10.0 iDRAC Firmware Version 4.40.10.00

Curl command: curl -X POST -u user:pass -k "https://192.168.1.1/redfish/v1/Managers/iDRAC.Embedded.1/Actions/Oem/EI D_674_Manager.ImportSystemConfiguration" -H "Content-Type: application/json" -d '{"ShareParameters":{ "Target":"ALL"},"ImportBuffer":"<Component FQDD=\"iDRAC.Embedded.1\"><Attribute Name=\"ServerBoot.1#BootOnce\">Enabled<Attribute Name=\"ServerBoot.1#FirstBootDevice\">VC D-DVD"}' -i -o output.txt

more output.txt HTTP/1.1 400 Bad Request Date: Fri, 07 May 2021 05:55:35 GMT Server: Apache OData-Version: 4.0 Access-Control-Allow-Origin: * Cache-Control: no-cache X-Frame-Options: DENY Strict-Transport-Security: max-age=63072000; includeSubDomains; preload Content-Length: 793 Connection: close Content-Type: application/json;odata.metadata=minimal;charset=utf-8

{"error":{"@Message.ExtendedInfo":[{"Message":"Unable to perform the import or export operation because t here are pending attribute changes or a configuration job is in progress.","MessageArgs":[],"MessageArgs@ odata.count":0,"MessageId":"IDRAC.2.3.LC068","RelatedProperties":[],"RelatedProperties@odata.count":0,"Re solution":"Apply or cancel any pending attribute changes. Changes can be applied by creating a targeted c onfiguration job, or the changes can be cancelled by invoking the DeletePendingConfiguration method. If a configuration job is in progress, wait until it is completed before retrying the import or export system configuration operation.","Severity":"Warning"}],"code":"Base.1.7.GeneralError","message":"A general err or has occurred. See ExtendedInfo for more information"}}

Please note there were no configuration jobs before running the curl. The curl command created a job.

Thanks

texroemer commented 3 years ago

Hi @ajaysimha

If there are no jobs reported as running or scheduled in the Job Queue, then iDRAC is in a state where pending data has not been cleared from the configuration database. Can you execute commands below to see if this resolves your issue.

  1. Clear the job queue using force option which will also clear any pending data and restart processes for the configuration database.

curl -k "https://<<idrac IP>>/redfish/v1/Dell/Managers/iDRAC.Embedded.1/DellJobService/Actions/DellJobService.DeleteJobQueue" -d '{"JobID":"JID_CLEARALL_FORCE"}' -X POST -u <<iDRAC username>>:<<iDRAC password>> -H "Content-Type: application/json" -i

  1. Once you executed the command to force clear the job queue, wait a few minutes and then execute command below to check LC status. Continue to execute this command until you see LC status reported as Ready which shouldn't take longer than a couple of minutes.

curl -k "https://<<iDRAC IP>>/redfish/v1/Dell/Managers/iDRAC.Embedded.1/DellLCService/Actions/DellLCService.GetRemoteServicesAPIStatus" -d '{}' -X POST -u <<iDRAC username>>:<<iDRAC password>> -H "Content-Type: application/json" -i

Example of output, LC status shows ready.

{"@Message.ExtendedInfo":[{"Message":"Successfully Completed Request","MessageArgs":[],"MessageArgs@odata.count":0,"MessageId":"Base.1.7.Success","RelatedProperties":[],"RelatedProperties@odata.count":0,"Resolution":"None","Severity":"OK"},{"Message":"Lifecycle controller is ready to take provisioning requests","MessageArgs":[],"MessageArgs@odata.count":0,"MessageId":"IDRAC.2.3.LC061","RelatedProperties":[],"RelatedProperties@odata.count":0,"Resolution":"No response action is required.","Severity":"Informational"}],"**LCStatus":"Ready**","RTStatus":"Ready","ServerStatus":"OutOfPOST","Status":"Ready"}

If both of these steps doesn't resolve your issue, reboot the iDRAC which should fix this issue.

Thanks Tex

ajaysimha commented 3 years ago

I don't see jobs any more /clear-job-queue.sh HTTP/1.1 200 OK Date: Sat, 08 May 2021 01:48:41 GMT Server: Apache OData-Version: 4.0 Access-Control-Allow-Origin: * Cache-Control: no-cache X-Frame-Options: DENY Strict-Transport-Security: max-age=63072000; includeSubDomains; preload Content-Length: 493 Content-Type: application/json;odata.metadata=minimal;charset=utf-8

{"@Message.ExtendedInfo":[{"Message":"Successfully Completed @. @.":0,"Resolution":"None","Severity":"OK"},{"Message":"The specified job was @. @.":0,"Resolution":"No response action is required.","Severity":"Informational"}]}

finally lc-status becomes ready:

@.**:~/cluster_mgnt_roles # ./lc-status.sh HTTP/1.1 200 OK Date: Sat, 08 May 2021 01:49:23 GMT Server: Apache OData-Version: 4.0 Access-Control-Allow-Origin: Cache-Control: no-cache X-Frame-Options: DENY Strict-Transport-Security: max-age=63072000; includeSubDomains; preload Content-Length: 693 Content-Type: application/json;odata.metadata=minimal;charset=utf-8

{"@Message.ExtendedInfo":[{"Message":"Successfully Completed @. @.":0,"Resolution":"None","Severity":"OK"},{"Message":"Lifecycle controller is currently not ready to take provisioning @. @.":0,"Resolution":"Wait until Lifecycle controller finishes performing current tasks and host system to finish POST.","Severity":"Warning"}],"LCStatus":"NotInitialized","RTStatus":"NotReady","ServerStatus":"OutOfPOST","Status":"NotReady"} @.**:~/cluster_mgnt_roles # ./lc-status.sh HTTP/1.1 200 OK Date: Sat, 08 May 2021 01:49:36 GMT Server: Apache OData-Version: 4.0 Access-Control-Allow-Origin: Cache-Control: no-cache X-Frame-Options: DENY Strict-Transport-Security: max-age=63072000; includeSubDomains; preload Content-Length: 693 Content-Type: application/json;odata.metadata=minimal;charset=utf-8

{"@Message.ExtendedInfo":[{"Message":"Successfully Completed @. @.":0,"Resolution":"None","Severity":"OK"},{"Message":"Lifecycle controller is currently not ready to take provisioning @. @.":0,"Resolution":"Wait until Lifecycle controller finishes performing current tasks and host system to finish POST.","Severity":"Warning"}],"LCStatus":"NotInitialized","RTStatus":"NotReady","ServerStatus":"OutOfPOST","Status":"NotReady"} @.**:~/cluster_mgnt_roles # ./lc-status.sh HTTP/1.1 200 OK Date: Sat, 08 May 2021 01:50:40 GMT Server: Apache OData-Version: 4.0 Access-Control-Allow-Origin: Cache-Control: no-cache X-Frame-Options: DENY Strict-Transport-Security: max-age=63072000; includeSubDomains; preload Content-Length: 604 Content-Type: application/json;odata.metadata=minimal;charset=utf-8

{"@Message.ExtendedInfo":[{"Message":"Successfully Completed @. @.":0,"Resolution":"None","Severity":"OK"},{"Message":"Lifecycle controller is ready to take provisioning @. @.":0,"Resolution":"No response action is required.","Severity":"Informational"}],"LCStatus":"Ready","RTStatus":"Ready","ServerStatus":"OutOfPOST","Status":"Ready"}

but when i run the set-one-time boot it fails:

@.***:~/cluster_mgnt_roles # ./test.sh % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 1068 100 793 100 275 2958 1026 --:--:-- --:--:-- --:--:-- 3985

@.**:~/cluster_mgnt_roles # cat output.txt HTTP/1.1 400 Bad Request Date: Sat, 08 May 2021 01:51:40 GMT Server: Apache OData-Version: 4.0 Access-Control-Allow-Origin: Cache-Control: no-cache X-Frame-Options: DENY Strict-Transport-Security: max-age=63072000; includeSubDomains; preload Content-Length: 793 Connection: close Content-Type: application/json;odata.metadata=minimal;charset=utf-8

{"error":{"@Message.ExtendedInfo":[{"Message":"Unable to perform the import or export operation because there are pending attribute changes or a configuration job is in @. ":0,"MessageId":"IDRAC.2.1.LC068 @.":0,"Resolution":"Apply or cancel any pending attribute changes. Changes can be applied by creating a targeted configuration job, or the changes can be cancelled by invoking the DeletePendingConfiguration method. If a configuration job is in progress, wait until it is completed before retrying the import or export system configuration operation.","Severity":"Warning"}],"code":"Base.1.5.GeneralError","message":"A general error has occurred. See ExtendedInfo for more information"}}

On Fri, May 7, 2021 at 4:10 PM texroemer @.***> wrote:

Hi @ajaysimha https://github.com/ajaysimha

If there are no jobs reported as running or scheduled in the Job Queue, then iDRAC is in a state where pending data has not been cleared from the configuration database. Can you execute commands below to see if this resolves your issue.

  1. Clear the job queue using force option which will also clear any pending data and restart processes for the configuration database.

curl -k "https://<>/redfish/v1/Dell/Managers/iDRAC.Embedded.1/DellJobService/Actions/DellJobService.DeleteJobQueue" -d '{"JobID":"JID_CLEARALL_FORCE"}' -X POST -u <>:<> -H "Content-Type: application/json" -i

  1. Once you executed the command to force clear the job queue, wait a few minutes and then execute command below to check LC status. Continue to execute this command until you see LC status reported as Ready which shouldn't take longer than a couple of minutes.

curl -k "https://<>/redfish/v1/Dell/Managers/iDRAC.Embedded.1/DellLCService/Actions/DellLCService.GetRemoteServicesAPIStatus" -d '{}' -X POST -u <>:<> -H "Content-Type: application/json" -i

Example of output, LC status shows ready.

{"@Message.ExtendedInfo":[{"Message":"Successfully Completed @. ":0,"MessageId":"Base.1.7.Success","RelatedProperties":[]," @.":0,"Resolution":"None","Severity":"OK"},{"Message":"Lifecycle controller is ready to take provisioning requests","MessageArgs":[]," @. ":0,"MessageId":"IDRAC.2.3.LC061","RelatedProperties":[]," @.":0,"Resolution":"No response action is required.","Severity":"Informational"}],"LCStatus":"Ready ","RTStatus":"Ready","ServerStatus":"OutOfPOST","Status":"Ready"}

If both of these steps doesn't resolve your issue, reboot the iDRAC which should fix this issue.

Thanks Tex

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/dell/iDRAC-Redfish-Scripting/issues/116#issuecomment-834743939, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEF5MSWMEMXUOQM3DL3F56TTMRCKHANCNFSM4OGEFCXA .

texroemer commented 3 years ago

Can you reboot the iDRAC, see if this resolves the issue?

Thanks Tex

schmaustech commented 2 years ago

@texroemer Do you know if Dell every fixed it for the iDRAC8's? I have the latest Dell firmware for iDRAC8 - 2.82.82.82 and I can still reproduce the original issue `python3 SetNextOneTimeBootVirtualMediaDeviceOemREDFISH.py -ip node19-idrac.com -u **** -p **** -d 1 -r y

texroemer commented 2 years ago

Hi @schmaustech

iDRAC 2.82, should be no issues with setting next onetime boot for virtual CD. I just tested on my server and no issues (see below).

Can you confirm other Redfish POST actions work on your server?

[root@localhost nfs]# racadm -r 192.168.0.120 -u root -p calvin --nocertwarn getversion
 Bios Version                     = 2.12.1

 iDRAC Version                    = 2.82.82.82

 Lifecycle Controller Version     = 2.82.82.82

 IDSDM Version                    = NA

[root@localhost nfs]# python3 SetNextOneTimeBootVirtualMediaDeviceOemREDFISH.py -ip 192.168.0.120 -u root -p calvin -d 1 -r n

- WARNING, setting next onetime boot device to Virtual CD
- PASS, successfully set next onetime boot device to Virtual CD
- WARNING, no reboot selected for -r argument. Onetime boot will be applied on next manual server reboot
[root@localhost nfs]#

Thanks Tex