HewlettPackard / oneview-python

Python library for HPE OneView
https://github.com/HewlettPackard/oneview-python/wiki
Apache License 2.0
28 stars 27 forks source link

key error : firmwareBaselineID : ‘server_hardware’ #273

Closed alexp3518 closed 1 year ago

alexp3518 commented 1 year ago

key error Python : firmwareBaselineID : ‘server_hardware’

alisha-k-kalladassery commented 1 year ago

Hi @alexp3518

We have enabled trace logs in a branch to root cause this issue. Request you to run below steps to get the branch and generate the log file.

pip uninstall hpeOneView
git clone https://github.com/HewlettPackard/oneview-python.git
cd oneview-python
git checkout firmware_update_test
pip install .
python3 examples/server_hardware_firmware_update.py

This will generate a file named 'resource.txt' in the same directory. Please share the same to debug this issue further.

Thanks

alisha-k-kalladassery commented 1 year ago

Hi @alexp3518

Did you get a chance to run above and generate log?

Thanks

alexp3518 commented 1 year ago

Hello, i download the branch because i'm offline in my environment. Here is the txt file you asked for :

INFO:hpeOneView.connection:Logged in successfully DEBUG:root:Getting all resources with uri: /rest/firmware-drivers?start=0&count=-1 DEBUG:root:Making HTTP request to get all resources. Uri: /rest/firmware-drivers?start=0&count=-1 DEBUG:root:Response getAll: nextPageUri = /rest/firmware-drivers?start=0&count=-1, members list length: 2 DEBUG:root:Total # of members found = 2 DEBUG:root:Getting all resources with uri: /rest/server-hardware?start=0&count=-1&filter=%22name%3D%27%3Cserver%20name%3E%27%22 DEBUG:root:Making HTTP request to get all resources. Uri: /rest/server-hardware?start=0&count=-1&filter=%22name%3D%27%3Cserver%20name%3E%27%22 DEBUG:root:Response getAll: nextPageUri = /rest/server-hardware?start=0&count=-1&filter=%22name%3D%27%3Cserver%20name%3E%27%22, members list length: 0 DEBUG:root:Total # of members found = 0 DEBUG:root:Getting all resources with uri: /rest/server-hardware?start=0&count=-1 DEBUG:root:Making HTTP request to get all resources. Uri: /rest/server-hardware?start=0&count=-1 DEBUG:root:Response getAll: nextPageUri = /rest/server-hardware?start=0&count=-1, members list length: 12 DEBUG:root:Total # of members found = 12 DEBUG:root:Getting all resources with uri: /rest/server-hardware?start=0&count=-1&filter=%22name%3D%27HOSTNAME%27%22 DEBUG:root:Making HTTP request to get all resources. Uri: /rest/server-hardware?start=0&count=-1&filter=%22name%3D%27HOSTNAME%27%22 DEBUG:root:Response getAll: nextPageUri = /rest/server-hardware?start=0&count=-1&filter=%22name%3D%27HOSTNAME%27%22, members list length: 1 DEBUG:root:Total # of members found = 1 DEBUG:root:Update async (uri = /rest/server-hardware/37383638-3530-5A43-3239-3231304A4A32/powerState, resource = {'powerState': 'Off', 'powerControl': 'MomentaryPress'}) DEBUG:hpeOneView.resources.task_monitor:Waiting for task completion... DEBUG:hpeOneView.resources.task_monitor:Waiting for task. Percentage complete: 0 DEBUG:hpeOneView.resources.task_monitor:Waiting for task. Task state: New DEBUG:hpeOneView.resources.task_monitor:Waiting for task. Percentage complete: 0 DEBUG:hpeOneView.resources.task_monitor:Waiting for task. Task state: New DEBUG:hpeOneView.resources.task_monitor:Waiting for task. Percentage complete: 100 DEBUG:hpeOneView.resources.task_monitor:Waiting for task. Task state: Completed DEBUG:hpeOneView.resources.task_monitor:Task completed DEBUG:root:Patch resource (uri = /rest/server-hardware/37383638-3530-5A43-3239-3231304A4A32/firmware/settings, data = [{'op': 'replace', 'value': {'baselineUri': '/rest/firmware-drivers/P62619_001_gen10spp-2023_03_00_00-SPP2023030000_2023_0323_27', 'firmwareInstallType': 'FirmwareOnlyOfflineMode', 'installationPolicy': 'LowerThanBaseline'}}]) ERROR:hpeOneView.exceptions:Uncaught Exception: HPEOneViewException with message: Not Found {'errorSource': None, 'data': {}, 'details': 'The requested resource could not be found.', 'message': 'Not Found', 'messageParameters': [], 'nestedErrors': [], 'errorCode': 'GENERIC_HTTP_404', 'recommendedActions': ['Check the request URI, then resend the request.']}

alisha-k-kalladassery commented 1 year ago

Hi @alexp3518

We are using server hardware and firmware drivers here. Are these resources part of any scope? if yes, does user that you are using have the same scope assigned.

Thanks

alexp3518 commented 1 year ago

Hello, the firmwares files were uploaded with the main Admin user. To test the connection and to use the examples files I am connected to Oneview with the same user witch is the main Admin.

alisha-k-kalladassery commented 1 year ago

Hi @alexp3518

We are checking on this issue. Can you please let us know if you are providing any Api version in your config? If yes please share the api version you are using.

Also can you please share the screenshot showing your oneview appliance version from OneView UI.

Thanks

alexp3518 commented 1 year ago

I've already send it in previous comment :Oneview appliance 8.3.00 and the SDK 8.3.0 Oneview Appliance in GUI mode display the same info

alexp3518 commented 1 year ago

Have you got some news about this issue ?

alisha-k-kalladassery commented 1 year ago

Hi @alexp3518

We are still not able to reproduce your issue in our environment. As i asked in previous comment, please provide us the api version which you are using in your config file.

We have added api version condition check in the dev branch given to you. You can try updating your code by running below snippet and share us the output.

pip uninstall hpeOneView
git clone https://github.com/HewlettPackard/oneview-python.git
cd oneview-python
git checkout firmware_update_test
pip install .
python3 examples/server_hardware_firmware_update.py
alexp3518 commented 1 year ago

I was with the api version 3400 in the config file I change with 5200 the one that match with the appliance 8.3 of Oneview and it seems to be ok