lenovo / python-redfish-lenovo Goto Github PK
View Code? Open in Web Editor NEWSample Python scripts and Ansible playbooks for using the Redfish API on Lenovo servers
License: Apache License 2.0
Sample Python scripts and Ansible playbooks for using the Redfish API on Lenovo servers
License: Apache License 2.0
This repo is very useful when I setup Lenovo servers, do you have Lenovo redfish API document link? I can use for more research.
we are getting some redfish errors when trying to provision these servers using ZTP ( openshift).
actually while testing the SE450 on OCP4.12 and ztp 4.12 i found the below error when ztp is trying to power up the server:
errorMessage: 'Failed to get power state for node 79505ed0-8b1b-43fd-b39d-42291b56200a.
Error: Redfish exception occurred. Error: Resource https://192.168.26.178/redfish/v1/Systems/1
This is the first time i am seeing this issue. last time it was related to virtual media.
even the api call below is getting general error access denied.
{"error":{"@Message.ExtendedInfo":[{"MessageSeverity":"Critical","Resolution":"Attempt to ensure that the URI is correct and that the service has the appropriate credentials.","@odata.type":"#Message.v1_1_0.Message","Message":"While attempting to establish a connection to /redfish/v1/Systems/1, the service denied access.","MessageId":"Base.1.8.AccessDenied","MessageArgs":["/redfish/v1/Systems/1"]}],"message":"A general error has occurred. See ExtendedInfo for more information.","code":"Base.1.8.GeneralError"}}
Note that i am using the user: USERID.
Hi, thanks for the great scripts!
I see there is a script to setup NTP server, but I use domain names for NTP server, where can I setup DNS server to support domain names?
Using the following API does not change the boot mode from UEFI boot mode to legacy let me know if any more details are needed.
Following is the response received:
root@productionserver:/home/ankit.timbadia/LENOVO/LENOVO/python-redfish-lenovo/examples# python set_bios_bootmode_legacy.py
"set bios bootmode legacy successful"
Checking the value applied shows:
root@productionserver:/home/ankit.timbadia/LENOVO/LENOVO/python-redfish-lenovo/examples# python get_bios_bootmode.py
{
"BootSourceOverrideMode": "Legacy"
}
Did a force restart/reboot of the server still the changes are not applied
Let me know if any other details are required.
Thanks,
Ankit Timbadia
Hi,
How can I build a raid volume with redfish commands ?
Thanks.
This is mostly just asking to add an error message, but I spent to long on this issue and needed to put it somewhere. If you have an operation mode set such as "OperatingModes_ChooseOperatingMode: MaximumPerformance" and then you use the example code to set a BIOS setting like trying to disable Processors_DFC_States their code says that the operation was successful. Then if you use the example code to check the pending settings, it shows up as a pending setting. Then if you reboot it it seems to reboot twice like it is trying to change the setting as asked to but it doesn't change the setting, because at some point it realizes that that setting being changed would conflict with the operating mode and it just doesn't change it.
It would be really nice if it checked for this when you tried to change the setting and gave some error like "can't set due to a conflicting setting", or if trying to set something like that it auto changed the operating mode to custom and then applied your setting.
please be so kind to give a working example for config.ini
. I'm sure I'm thinking too complicated but so far the README.md only tells us that we can set common parameters in it, but not the actual variable names for those parameters. in fact, it is not mentioned anywhere at all.
also, if it were an .ini
format, you'd need a [section]
heading, which is also not known.
The parser in fact expects one though:
File "/usr/lib64/python3.6/configparser.py", line 1080, in _read
raise MissingSectionHeaderError(fpname, lineno, line)
configparser.MissingSectionHeaderError: File contains no section headers.
the dnssservers script help also mentions one can set multiple, but does not inform about the correct separators. should one try i.e. a comma, they'll get a message that the format (printed to screen as parsed) they used is not a supported one. They do not get any info about what makes a supported format.
Hi all, we want to download service data from XCC redfish and open lenovo support ticket. At present I have no idea how to download the service data. It seems not so many docs about this online, either.
So my question is do you have idea how to do that using python-redfish-library? Thank you in advance.
On SR650v2, the created user account can't be deleted by the script "lenovo_delete_bmc_user.py"
neil@DevLab:~/work/redfish/python-redfish-lenovo/examples$ python lenovo_delete_bmc_user.py --username user1
/redfish/v1/AccountService/Accounts/2
{'If-Match': u'"c34e325042a1436b4098bd97b278fb7e"'}
Url '412
content-language en
transfer-encoding chunked
strict-transport-security max-age=31536000; includeSubDomains
server XCC Web Server
connection keep-alive
cache-control no-store
date Wed, 19 Feb 2020 09:19:52 GMT
odata-version 4.0
content-type application/json
{"error":{"@Message.ExtendedInfo":[{"MessageArgs":[],"Resolution":"Please correct precondition fields in request header.","MessageId":"ExtendedError.1.1.EtagPreconditionalFailed","Severity":"Warning","Message":"One or more conditions given in the request header fields is evaluated to false when tested on the server.","@odata.type":"#Message.v1_0_8.Message"}],"code":"Base.1.6.GeneralError","message":"A general error has occurred. See ExtendedInfo for more information."}}
' response Error code 412
error_message: One or more conditions given in the request header fields is evaluated to false when tested on the server.neil@DevLab:~/work/redfish/python-redfish-lenovo/examples$
The generic version of Mount Virtual Media should not look for a Lenovo specific Id (like "EXT")
Hi @renxulei
How are you ?
I have Lenovo servers which needs firmware upgrades for model SR630/SD530 using python script on multiple servers.
I am looking for a better way which upgrades, Using commands or utility which supports all type of versions.
Can you please suggest which one is the better way to upgrade both BIOS and iLO firmware
Thanks,
Shaik
Hello,
I don't see any scripts or way to set SNMP settings through Redfish. Any one already work on it?
Thank in advance
ps: I found a command with SSH (snmp -t on -t1 on -a3 on -l A -cn A
) but it doesn't allow to activate trap categories (Critical, Warning and System).
Hi Team,
Would it be possible to add the ability to disable/enable complex passwords on SR635/SR655 to lenovo_set_bmc_user_global.py ?
So far I see the request to the Redfish API does not send speicific physical disks
https://github.com/lenovo/python-redfish-lenovo/blob/master/examples/lenovo_create_raid_volume.py#L180-L184
For me it fails with code 500
I got 2x SSD 1TB and 8x8TB HDD on one conttroller and wants to create RAID1
Does the firmware support passing the actual drives ? So I could modify the lenovo-create_raid_volume.py script to pass list of drives in the request body ?
Similarly to iDRAC ? like https://jonamiki.com/2019/04/14/example-redfish-rest-calls-create-raid-volume/
Or it will work only when the list of drives matches the RAIDType ?
By guessing I tried passing drives or disks by guessing but none of them work
Url '/redfish/v1/Systems/1/Storage/RAID_Slot7/Volumes' response Error code 500
error_message: The property Drives is not in the list of valid properties for the resource
Also would be cool if the REST API guide was updated accordingly
also would like to know which firmware version supports it ?
I got mine SR650 updated to the newest firmware on all components
Mine BMC Version: 8.80 CDI3A2Q (09/22/2022)
https://sysmgt.lenovofiles.com/help/topic/com.lenovo.systems.management.xcc.restapi.doc/xcc_restapi_book.pdf
Originally posted by @mastier in #2 (comment)
I got the error local variable 'export_uri' referenced before assignment
while running examples/lenovo_export_ffdc_data.py
.
$ python -u ./examples/lenovo_export_ffdc_data.py -i 169.254.95.118 -u <user> -p <pass>
Start downloading ffdc files and may need to wait a few minutes...
|
\
-
/
|
...
time cost: 154.83s
error_message: local variable 'export_uri' referenced before assignment++ hostname
The use of this variable depends on the Oem
key not being present in response_task_uri.dict
.
Hi,
i´m trying to get a Self Signed Certificate to the Server via redfish.
found a request target like this:
The Body of the request is:
{
"CountryName": "DE",
"Service": "Server",
"StateOrProvinceName": "State",
"LocalityName": "Test City",
"OrganizationName": "Test",
"HostName": "test_01"
}
but i get allways one error message and dont know what is missing.
{
"error": {
"@Message.ExtendedInfo": [
{
"MessageArgs": [
"LenovoSecurityService.GenerateCertificate",
"CountryName"
],
"Resolution": "Supply the action with the required parameter in the request body when the request is resubmitted.",
"MessageId": "Base.1.4.ActionParameterMissing",
"Severity": "Critical",
"Message": "The action LenovoSecurityService.GenerateCertificate requires the parameter CountryName to be present in the request body.",
"@odata.type": "#Message.v1_0_6.Message"
}
],
"code": "Base.1.4.GeneralError",
"message": "A general error has occurred. See ExtendedInfo for more information."
}
}
Till now, i didnt find any example in the Internet :(
Maybe u can help here or create an example for this Action?
regards
Hi, I don't find strip size when creating RAID, do you support it?
Hello,
while preparing a script to change some Account Service Settings, i was not able to find the Setting inside the Account Service (and other Redfish paths) for the Button (in the WebGUI) "Complex Password Required"
Somebody knows where i can find this setting?
regards
I'm using the mount_virtual_media.py example to attempt to mount media on an XCC RedFish compliant Lenovo system (SD530 - MT 7X21).
When I attempt to mount the media, I get an error that says "Up to 4 files can be concurrently mounted to the server by the BMC." This is because the call to the virtual media url returns no members as I don't have any media mounted at the moment. Any ideas on how to work around this? I tried a POST with the body {"Image": media_uri, "WriteProtected": bool(writeprotocol), "Inserted": bool(inserted)}
to /redfish/v1/Managers/1/VirtualMedia/EXT2,
but I got a 404 back
Hello,
I have another question regarding hostname (System Name
and Ethernet Host Name
).
I can get the information with the script get_bmc_inventory.py
but don't find how to setup this value. I tried to use set_bios_attribute.py
script with --name FQDN --value TEST
as arguments but got this reply:
This bios attribute 'FQDN' not supported on this platform
.
This operation can be done with this script using another name? With another script?
Thanks in advance for your time and reply.
Please check the possibility of adding 'Step level' in the output of the python script 'get_cpu_inventory.py'
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.