Skip to main content

OpenStack Load Balancer Tree View

PyPI version License Python versions

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_status and operating_status for 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 != ONLINE in 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
  • Count members: Rank those problematic members by how many load balancers each name appears in (--count-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.yaml file 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

Count members with a bad status, ordered by how many load balancers each name appears in (highest first). The member name is the host, so this works across environments without a hostname pattern:

openstack-lb-treeview --filter --count-members

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.

Count members (--filter --count-members):

Members with bad status, ordered by load balancer count:

  12  sck-production-scc-zhw-pool-ubuntu-1-aaa-bbb  ERROR
   3  sck-production-scc-zhw-pool-ubuntu-2-ccc-ddd  OFFLINE, ERROR
   1  sck-production-scc-zhw-pool-ubuntu-3-eee-fff  OFFLINE

Each line is one member name. The number is how many load balancers that host is in with a bad status (not ACTIVE or not ONLINE). Counts greater than 1 are highlighted. Names that show up on many load balancers are the usual candidates to replace.

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.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for openstack-lb-treeview 0.1.5
File Size Uploaded
openstack_lb_treeview-0.1.5.tar.gz 12.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for openstack-lb-treeview 0.1.5
File Interpreter ABI Platform
openstack_lb_treeview-0.1.5-py3-none-any.whl Python 3 none any Details

Total release size: 23.2 kB

Release files / openstack_lb_treeview-0.1.5.tar.gz

Download URL openstack_lb_treeview-0.1.5.tar.gz
Size 12.8 kB
Tags Source
SHA-256 checksum
How to use checksums
ff32040f045ee7d8c690e96e6fe31f3e83dc333bac342879eae147a7738ebdbb
BLAKE2b-256 checksum
How to use checksums
f647ab59b669ae0b5853078fa4ae8906d3f666dbd4872feead58ea0fd9a92d54
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.7

Release files / openstack_lb_treeview-0.1.5-py3-none-any.whl

Download URL openstack_lb_treeview-0.1.5-py3-none-any.whl
Size 10.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5ab0b35099271bfba4e0fa3994e1b8902f7cc8968a583263551edd33e37e0c08
BLAKE2b-256 checksum
How to use checksums
784408fbfab5493d2f02c2c81bd46403fd9f0ee18bc8e312686bb995f970340c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.7

Release history Release notifications | RSS feed

0.1.6

2 release files

This release

0.1.5 This release

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page