https://github.com/stackhpc/stackhpc-osutils
OpenStack utilities
https://github.com/stackhpc/stackhpc-osutils
Last synced: 14 days ago
JSON representation
OpenStack utilities
- Host: GitHub
- URL: https://github.com/stackhpc/stackhpc-osutils
- Owner: stackhpc
- Created: 2018-11-12T23:32:02.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2021-08-09T15:10:40.000Z (almost 5 years ago)
- Last Synced: 2024-04-14T22:50:23.459Z (about 2 years ago)
- Language: Python
- Size: 27.3 KB
- Stars: 2
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Various OpenStack tools
All utilities require OpenStack credentials present as environment variables.
## Installation
$ pip install git+https://github.com/stackhpc/stackhpc-osutils
## Gather baremetal nodes facts using server name
Query what keys are available for retrieval:
$ osutils.node -p openhpc -q '.driver_info.[]'
["deploy_kernel", "ipmi_address", "ipmi_username", "ipmi_password", "deploy_ramdisk"]
Get list of `ipmi_address` and format the output using `jq`:
$ osutils.node -p openhpc -q '.driver_info.ipmi_address' | jq
[
{
"value": "10.45.253.35",
"key": "openhpc-login-0"
},
{
"value": "10.45.253.11",
"key": "openhpc-compute-0"
},
{
"value": "10.45.253.12",
"key": "openhpc-compute-1"
}
]
Use regex to filter server names:
$ osutils.node -p 'openhpc-.*0' -q '.driver_info.ipmi_address'
[{"value": "10.45.253.1", "key": "openhpc-login-0"}, {"value": "10.45.253.22", "key": "openhpc-compute-0"}]
## Open tmux windows that match server name keyword
$ osutils.ipmi openhpc-compute
Opening tmux window: openhpc-compute-0
ipmitool -I lanplus -H 10.45.253.22 -U root -P calvin sol activate
Opening tmux window: openhpc-compute-1
ipmitool -I lanplus -H 10.45.253.35 -U root -P calvin sol activate