OpenStack Load Balancer Tree View
A Python script that displays a tree view of all loadbalancers in an OpenStack project, showing pools and members in a hierarchical structure.
Features
- Displays loadbalancers as root nodes
- Shows pools as children of loadbalancers
- Shows members as children of pools
- Shows
provisioning_statusandoperating_statusfor load balancers, pools, and members - Shows a per-pool member operating-status summary (e.g.
13 ERROR - 3 ONLINE - 16 TOTAL) - Highlights members with
provisioning_status != ACTIVE(yellow/bold) - Displays members with
operating_status != ONLINEin red - Single LB: Show the tree for one load balancer by name or ID (
--lb) - Filter mode: Show only problematic members (not ACTIVE/ONLINE) and pools with no members
- Collapse mode: Show pools with member status summary, without listing individual members
Installation
Install globally via pip
Install directly from PyPi:
pip install openstack-lb-treeview
After installation, the openstack-lb-treeview command will be available globally.
Set up OpenStack credentials
Set up your OpenStack credentials. You can either:
- Set environment variables (OS_AUTH_URL, OS_USERNAME, OS_PASSWORD, etc.)
- Use a
clouds.yamlfile in~/.config/openstack/or/etc/openstack/
Usage
After installation, use the openstack-lb-treeview command:
Basic usage (uses environment variables for authentication):
openstack-lb-treeview
Specify a cloud from clouds.yaml:
openstack-lb-treeview --cloud mycloud
Filter by project ID:
openstack-lb-treeview --project-id <project-id>
Single load balancer by name or ID:
openstack-lb-treeview --lb my-loadbalancer
openstack-lb-treeview --lb abc123-def456-...
Filter mode (only show problematic members and empty pools):
openstack-lb-treeview --filter
openstack-lb-treeview --lb my-loadbalancer --filter
Collapse mode (pool summary only, no individual members):
openstack-lb-treeview --collapse
Combined filter and collapse mode (show only load balancers with operating_status != 'ONLINE'):
openstack-lb-treeview --filter --collapse
Development Usage
If running from source without installation:
python -m openstack_lb_treeview.lb_treeview
Or directly:
python openstack_lb_treeview/lb_treeview.py
Example Output
Normal mode:
📦 my-loadbalancer (ID: abc123...) (provisioning: ACTIVE | operating: ONLINE)
├─ 🏊 pool-1 (ID: def456...) (provisioning: ACTIVE | operating: DEGRADED) | 1 OFFLINE - 1 ONLINE - 2 TOTAL
│ ├─ 👤 member-1 (provisioning: ACTIVE | operating: ONLINE)
│ └─ 👤 member-2 (provisioning: PENDING_CREATE | operating: OFFLINE)
└─ 🏊 pool-2 (ID: ghi789...) (provisioning: ACTIVE | operating: ONLINE) | 1 ONLINE - 1 TOTAL
└─ 👤 member-3 (provisioning: ACTIVE | operating: ONLINE)
Filter mode (--filter):
📦 my-loadbalancer (ID: abc123...) (provisioning: ACTIVE | operating: DEGRADED)
├─ 🏊 pool-1 (ID: def456...) (provisioning: ACTIVE | operating: DEGRADED) | 1 OFFLINE - 1 ONLINE - 2 TOTAL
│ └─ 👤 member-2 (provisioning: PENDING_CREATE | operating: OFFLINE)
└─ 🏊 pool-3 (ID: xyz789...) (provisioning: ACTIVE | operating: OFFLINE) | 0 TOTAL
└─ No members
In filter mode, only pools with problematic members (not ACTIVE or not ONLINE) or pools with no members are shown. The pool summary still counts all members.
Collapse mode (--collapse):
📦 my-loadbalancer (ID: abc123...) (provisioning: ACTIVE | operating: ONLINE)
├─ 🏊 pool-1 (ID: def456...) (provisioning: ACTIVE | operating: DEGRADED) | 1 OFFLINE - 1 ONLINE - 2 TOTAL
└─ 🏊 pool-2 (ID: ghi789...) (provisioning: ACTIVE | operating: ONLINE) | 1 ONLINE - 1 TOTAL
In collapse mode, pools are shown with status and member summary, but individual members are not listed.
Combined filter and collapse mode (--filter --collapse):
📦 my-loadbalancer (ID: abc123...) (provisioning: ACTIVE | operating: DEGRADED)
├─ 🏊 pool-1 (ID: def456...) (provisioning: ACTIVE | operating: DEGRADED) | 1 OFFLINE - 1 ONLINE - 2 TOTAL
└─ 🏊 pool-2 (ID: ghi789...) (provisioning: ACTIVE | operating: ONLINE) | 1 ONLINE - 1 TOTAL
When both --filter and --collapse are used together, only load balancers with operating_status != 'ONLINE' are displayed. This is useful for quickly identifying load balancers that are not in an ONLINE state.
Requirements
- Python 3.6+
- openstacksdk
- OpenStack credentials with appropriate permissions
Metadata
Release files for openstack-lb-treeview 0.1.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| openstack_lb_treeview-0.1.4.tar.gz | 11.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| openstack_lb_treeview-0.1.4-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 20.3 kB
Release files / openstack_lb_treeview-0.1.4.tar.gz
| Download URL | openstack_lb_treeview-0.1.4.tar.gz |
|---|---|
| Size | 11.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
105b5d003a534d979efc14e9b5c22d5a09c80f87c05aa43467e4f8d84b039225
|
|
BLAKE2b-256 checksum How to use checksums |
2fff08cd9d80b870621f2bb48f59f18e2fad5aa3f24e39865497208b07b1c0f2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.6
|
Release files / openstack_lb_treeview-0.1.4-py3-none-any.whl
| Download URL | openstack_lb_treeview-0.1.4-py3-none-any.whl |
|---|---|
| Size | 9.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a3aeef66ad8ce8088e97e97fafbf4ee4dc1296e4652cc28cf3872ccffe59e7c1
|
|
BLAKE2b-256 checksum How to use checksums |
723f76bfcbb4f8b04bc908898448a463bd7eb3b3c22466d64c9217b76aa72c9d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.6
|