openstack

Requires a pip install lftools-uv[openstack] to activate this command. Requires qemu-img binary to upload images

                                                                                
 Usage: lftools-uv openstack [OPTIONS] COMMAND [ARGS]...                        
                                                                                
 Provide an interface to OpenStack.                                             
                                                                                
╭─ Options ────────────────────────────────────────────────────────────────────╮
│ *  --os-cloud        TEXT  OpenStack cloud name                              │
│                            [env var: OS_CLOUD]                               │
│                            [required]                                        │
│    --help                  Show this message and exit.                       │
╰──────────────────────────────────────────────────────────────────────────────╯
╭─ Commands ───────────────────────────────────────────────────────────────────╮
│ image   Command for manipulating images.                                     │
│ object  Command for manipulating objects.                                    │
│ server  Command for manipulating servers.                                    │
│ stack   Command for manipulating stacks.                                     │
│ volume  Command for manipulating volumes.                                    │
╰──────────────────────────────────────────────────────────────────────────────╯

Commands

image

                                                                                
 Usage: lftools-uv openstack image [OPTIONS] COMMAND [ARGS]...                  
                                                                                
 Command for manipulating images.                                               
                                                                                
╭─ Options ────────────────────────────────────────────────────────────────────╮
│ --help          Show this message and exit.                                  │
╰──────────────────────────────────────────────────────────────────────────────╯
╭─ Commands ───────────────────────────────────────────────────────────────────╮
│ cleanup  Cleanup old images.                                                 │
│ list     List cloud images.                                                  │
│ share    Share image with another tenant.                                    │
│ upload   Upload image to OpenStack cloud.                                    │
╰──────────────────────────────────────────────────────────────────────────────╯

cleanup

The intent of this command is to automatically cleanup old images in the cloud. The OpenDaylight project has 2 clouds, a Private Cloud and a Public cloud which needs the –clouds option to automatically remove the same images from more than one cloud simultaneously.

                                                                                
 Usage: lftools-uv openstack image cleanup [OPTIONS]                            
                                                                                
 Cleanup old images.                                                            
                                                                                
╭─ Options ────────────────────────────────────────────────────────────────────╮
│ --ci-managed                  Filter only images that have the               │
│                               ci_managed=yes metadata set.                   │
│ --days               INTEGER  Find images older than or equal to days.       │
│                               [default: 0]                                   │
│ --hide-public                 Ignore public images.                          │
│ --clouds             TEXT     Clouds (as defined in clouds.yaml) to remove   │
│                               images from. If not passed will assume from    │
│                               os-cloud parameter. (optional)                 │
│ --help                        Show this message and exit.                    │
╰──────────────────────────────────────────────────────────────────────────────╯

list

                                                                                
 Usage: lftools-uv openstack image list [OPTIONS]                               
                                                                                
 List cloud images.                                                             
                                                                                
╭─ Options ────────────────────────────────────────────────────────────────────╮
│ --ci-managed                  Filter only images that have the               │
│                               ci_managed=yes metadata set.                   │
│ --days               INTEGER  Find images older than or equal to days.       │
│                               [default: 0]                                   │
│ --hide-public                 Ignore public images.                          │
│ --help                        Show this message and exit.                    │
╰──────────────────────────────────────────────────────────────────────────────╯

cluster

Command for managing Container Orchestration Engine (COE) clusters.

Usage: lftools-uv openstack [OPTIONS] COMMAND [ARGS]...
Try 'lftools-uv openstack --help' for help.
╭─ Error ──────────────────────────────────────────────────────────────────────╮
│ No such command 'cluster'.                                                   │
╰──────────────────────────────────────────────────────────────────────────────╯

cleanup

Remove orphaned COE clusters from the cloud. This command scans for Kubernetes clusters not in use by active Jenkins builds and removes them. The cleanup operation preserves managed clusters (names containing -managed-prod-k8s- or -managed-test-k8s-) as these are long-lived infrastructure.

The command queries Jenkins URLs for active builds to prevent deletion of clusters in use. Provide one or more Jenkins URLs separated by spaces.

Usage: lftools-uv openstack [OPTIONS] COMMAND [ARGS]...
Try 'lftools-uv openstack --help' for help.
╭─ Error ──────────────────────────────────────────────────────────────────────╮
│ No such command 'cluster'.                                                   │
╰──────────────────────────────────────────────────────────────────────────────╯

Example usage:

# Cleanup orphaned clusters, checking two Jenkins instances
lftools-uv openstack --os-cloud mycloud cluster cleanup \
  --jenkins "https://jenkins.example.org https://jenkins.example.io"

list

List all COE clusters on the specified cloud with their current status.

Usage: lftools-uv openstack [OPTIONS] COMMAND [ARGS]...
Try 'lftools-uv openstack --help' for help.
╭─ Error ──────────────────────────────────────────────────────────────────────╮
│ No such command 'cluster'.                                                   │
╰──────────────────────────────────────────────────────────────────────────────╯

object

Command for managing objects.

                                                                                
 Usage: lftools-uv openstack object [OPTIONS] COMMAND [ARGS]...                 
                                                                                
 Command for manipulating objects.                                              
                                                                                
╭─ Options ────────────────────────────────────────────────────────────────────╮
│ --help          Show this message and exit.                                  │
╰──────────────────────────────────────────────────────────────────────────────╯
╭─ Commands ───────────────────────────────────────────────────────────────────╮
│ list  List available containers.                                             │
╰──────────────────────────────────────────────────────────────────────────────╯

list-containers

Usage: lftools-uv openstack object [OPTIONS] COMMAND [ARGS]...
Try 'lftools-uv openstack object --help' for help.
╭─ Error ──────────────────────────────────────────────────────────────────────╮
│ No such command 'list-containers'.                                           │
╰──────────────────────────────────────────────────────────────────────────────╯

stack

Command for managing stacks.

                                                                                
 Usage: lftools-uv openstack stack [OPTIONS] COMMAND [ARGS]...                  
                                                                                
 Command for manipulating stacks.                                               
                                                                                
╭─ Options ────────────────────────────────────────────────────────────────────╮
│ --help          Show this message and exit.                                  │
╰──────────────────────────────────────────────────────────────────────────────╯
╭─ Commands ───────────────────────────────────────────────────────────────────╮
│ create        Create stack.                                                  │
│ delete        Delete stack.                                                  │
│ cost          Get Total Stack Cost.                                          │
│ delete-stale  Delete stale stacks.                                           │
╰──────────────────────────────────────────────────────────────────────────────╯

create

Create a new stack.

                                                                                
 Usage: lftools-uv openstack stack create [OPTIONS] NAME TEMPLATE_FILE          
                                          PARAMETER_FILE                        
                                                                                
 Create stack.                                                                  
                                                                                
╭─ Arguments ──────────────────────────────────────────────────────────────────╮
│ *    name                TEXT  Stack name                                    │
│                                [required]                                    │
│ *    template_file       TEXT  Template file                                 │
│                                [required]                                    │
│ *    parameter_file      TEXT  Parameter file                                │
│                                [required]                                    │
╰──────────────────────────────────────────────────────────────────────────────╯
╭─ Options ────────────────────────────────────────────────────────────────────╮
│ --timeout        INTEGER  Stack create timeout in seconds.                   │
│                           [default: 900]                                     │
│ --tries          INTEGER  Number of tries before giving up.                  │
│                           [default: 2]                                       │
│ --help                    Show this message and exit.                        │
╰──────────────────────────────────────────────────────────────────────────────╯

The create command requires a parameters file in the following format to build out the stack:

delete

Delete existing stack.

                                                                                
 Usage: lftools-uv openstack stack delete [OPTIONS] NAME_OR_ID                  
                                                                                
 Delete stack.                                                                  
                                                                                
╭─ Arguments ──────────────────────────────────────────────────────────────────╮
│ *    name_or_id      TEXT  Stack name or ID                                  │
│                            [required]                                        │
╰──────────────────────────────────────────────────────────────────────────────╯
╭─ Options ────────────────────────────────────────────────────────────────────╮
│ --force                   Ignore timeout and continue with next stack.       │
│ --timeout        INTEGER  Stack delete timeout in seconds.                   │
│                           [default: 900]                                     │
│ --help                    Show this message and exit.                        │
╰──────────────────────────────────────────────────────────────────────────────╯

cost

Get total cost of existing stack.

                                                                                
 Usage: lftools-uv openstack stack cost [OPTIONS] STACK_NAME                    
                                                                                
 Get Total Stack Cost.                                                          
                                                                                
╭─ Arguments ──────────────────────────────────────────────────────────────────╮
│ *    stack_name      TEXT  Stack name                                        │
│                            [required]                                        │
╰──────────────────────────────────────────────────────────────────────────────╯
╭─ Options ────────────────────────────────────────────────────────────────────╮
│ --timeout        INTEGER  Timeout in seconds for cost retrieval operations   │
│                           (default: 60)                                      │
│                           [default: 60]                                      │
│ --help                    Show this message and exit.                        │
╰──────────────────────────────────────────────────────────────────────────────╯

Return sum of costs for each member of the running stack.