- Community Home
- >
- Software
- >
- HPE OneView
- >
- pyrhon script to create new ilo user from oneview
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-28-2024 06:47 AM - last edited on тАО03-05-2024 06:16 AM by support_s
тАО02-28-2024 06:47 AM - last edited on тАО03-05-2024 06:16 AM by support_s
pyrhon script to create new ilo user from oneview
Hi everyone,
I'm trying to create a python script to create a user on ILO5 managed directly by oneview.
The restrictions I have are these:
1. I don't have an ilo username and password.
2. To access the ILO I have to go through oneview or the onboard administrator of the C7000.
3. The script must work for any blade>.
This is my script but it gives an error when I try to connect to the ILO from oneview.
I'm trying to consult the oneview 6.6 REST API but I can't find any solution.
Can you help me? I've been looking for a solution for days without success.
import requestsfrom requests.auth import HTTPBasicAuth# OneView Loginoneview_host = "https://<IP>"oneview_username = "<username>"oneview_password = "<pass>"# Token from OneViewdef get_oneview_session_token():auth_url = f"{oneview_host}/rest/login-sessions"auth_data = {"userName": oneview_username, "password": oneview_password}response = requests.post(auth_url, json=auth_data, verify=False) # Disabilita la verifica SSL se necessarioif response.status_code == 200:return response.json()['sessionID']else:raise Exception("Failed to authenticate with OneView")# Function to create the iLO userdef create_ilo_user(ilo_ip, username, password, user_login="test", user_password="test"ilo_url = f"https://{ilo_ip}/redfish/v1/AccountService/Accounts/"new_user_data = {"UserName": user_login,"Password": user_password,"Oem": {"Hp": {"LoginName": user_login,"Privileges": {"LoginPriv": True,"RemoteConsolePriv": True,"UserConfigPriv": True,"VirtualMediaPriv": True,"iLOConfigPriv": True,"VirtualPowerAndResetPriv": True}}}}response = requests.post(ilo_url, json=new_user_data, auth=HTTPBasicAuth(username, password), verify=False) # disable SSL check if necessaryif response.status_code in [200, 201]:print(f"User {user_login} created successfully on {ilo_ip}.")else:print(f"Failed to create user on {ilo_ip}. Response: {response.text}")# Ilo logintoken = get_oneview_session_token()ilo_ip_list = ["<iplist,iplist>"]for ilo_ip in ilo_ip_list:create_ilo_user(ilo_ip, oneview_username, oneview_password)
- Tags:
- Synergy system
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-28-2024 07:48 AM
тАО02-28-2024 07:48 AM
Query: pyrhon script to create new ilo user from oneview
System recommended content:
1. HPE iLO 6 1.56 User Guide | Other iLO configuration tools
2. HPE iLO 5 3.01 User Guide | Other iLO configuration tools
Please click on "Thumbs Up/Kudo" icon to give a "Kudo".
Thank you for being a HPE valuable community member.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-28-2024 08:49 AM
тАО02-28-2024 08:49 AM
Re: Query: pyrhon script to create new ilo user from oneview
Hi,
I have already viewed both solutions, but unfortunately isn't good because I don't have the ilo password, and the same procedure I need to improve in ~400 blades.
the idea is to reduce the procedure using a script and Oneview user. but I have a problem to forward the request
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-01-2024 11:10 AM
тАО03-01-2024 11:10 AM
Re: Query: pyrhon script to create new ilo user from oneview
You can manage user accounts directly from a Server Profile, without needing to develop a script to accomplish this task. Please review this documentation on iLO Settings that can be managed by server profiles here (v8.70) or here (v6.60). As you are asking for HPE BladeSystem c-Class support, you need to read the 6.60 Online Help.
I am an HPE employee