openstack¶

This command needs no extra: its dependencies are part of the core install. Requires qemu-img binary to upload images. Requires the openstack command from python-openstackclient on PATH to share images (image share).

                                                                                
 Usage: lftools-uv openstack [OPTIONS] COMMAND [ARGS]...                        
                                                                                
 Provide an interface to OpenStack.                                             
                                                                                
╭─ Options ────────────────────────────────────────────────────────────────────╮
│ *  --os-cloud        <str>   OpenStack cloud name                            │
│                              [env var: OS_CLOUD]                             │
│                              [required]                                      │
│    --help            <bool>  Show this message and exit.                     │
╰──────────────────────────────────────────────────────────────────────────────╯
╭─ Commands ───────────────────────────────────────────────────────────────────╮
│ cluster   Command for manipulating COE clusters.                             │
│ 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        <bool>  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         <bool>  Filter only images that have the ci_managed=yes │
│                              metadata set.                                   │
│ --days               <int>   Find images older than or equal to days.        │
│                              [default: 0]                                    │
│ --hide-public        <bool>  Ignore public images.                           │
│ --clouds             <str>   Clouds (as defined in clouds.yaml) to remove    │
│                              images from. If not passed will assume from     │
│                              os-cloud parameter. (optional)                  │
│ --help               <bool>  Show this message and exit.                     │
╰──────────────────────────────────────────────────────────────────────────────╯

list¶

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

cluster¶

Command for managing Container Orchestration Engine (COE) clusters.

                                                                                
 Usage: lftools-uv openstack cluster [OPTIONS] COMMAND [ARGS]...                
                                                                                
 Command for manipulating COE clusters.                                         
                                                                                
╭─ Options ────────────────────────────────────────────────────────────────────╮
│ --help        <bool>  Show this message and exit.                            │
╰──────────────────────────────────────────────────────────────────────────────╯
╭─ Commands ───────────────────────────────────────────────────────────────────╮
│ cleanup   Cleanup orphaned COE clusters.                                     │
│ list      List COE clusters.                                                 │
│ remove    Remove a COE cluster.                                              │
│ show      Show COE cluster details.                                          │
╰──────────────────────────────────────────────────────────────────────────────╯

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 cluster cleanup [OPTIONS]                          
                                                                                
 Cleanup orphaned COE clusters.                                                 
                                                                                
 Removes clusters not in use by active Jenkins builds. Preserves managed        
 clusters (names containing -managed-prod-k8s- or -managed-test-k8s-).          
                                                                                
╭─ Options ────────────────────────────────────────────────────────────────────╮
│ --jenkins        <str>   Space-separated list of Jenkins URLs to check for   │
│                          active builds.                                      │
│ --help           <bool>  Show this message and exit.                         │
╰──────────────────────────────────────────────────────────────────────────────╯

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 cluster list [OPTIONS]                             
                                                                                
 List COE clusters.                                                             
                                                                                
╭─ Options ────────────────────────────────────────────────────────────────────╮
│ --help        <bool>  Show this message and exit.                            │
╰──────────────────────────────────────────────────────────────────────────────╯

remove¶

Remove a single named COE cluster. With --minutes, the command skips a cluster created within that window and logs a warning instead of deleting it. The command exits non-zero when it cannot find or delete the cluster.

                                                                                
 Usage: lftools-uv openstack cluster remove [OPTIONS] {cluster}                 
                                                                                
 Remove a COE cluster.                                                          
                                                                                
╭─ Arguments ──────────────────────────────────────────────────────────────────╮
│ *    cluster      <str>  Cluster to remove                                   │
│                          [required]                                          │
╰──────────────────────────────────────────────────────────────────────────────╯
╭─ Options ────────────────────────────────────────────────────────────────────╮
│ --minutes        <int>   Delete cluster if older than x minutes.             │
│                          [default: 0]                                        │
│ --help           <bool>  Show this message and exit.                         │
╰──────────────────────────────────────────────────────────────────────────────╯

Example usage:

# Remove the cluster unless created in the last 15 minutes
lftools-uv openstack --os-cloud mycloud cluster remove --minutes 15 mycluster

show¶

Show the details of a single named COE cluster as JSON.

                                                                                
 Usage: lftools-uv openstack cluster show [OPTIONS] {cluster}                   
                                                                                
 Show COE cluster details.                                                      
                                                                                
╭─ Arguments ──────────────────────────────────────────────────────────────────╮
│ *    cluster      <str>  Cluster to show                                     │
│                          [required]                                          │
╰──────────────────────────────────────────────────────────────────────────────╯
╭─ Options ────────────────────────────────────────────────────────────────────╮
│ --help        <bool>  Show this message and exit.                            │
╰──────────────────────────────────────────────────────────────────────────────╯

object¶

Command for managing objects.

                                                                                
 Usage: lftools-uv openstack object [OPTIONS] COMMAND [ARGS]...                 
                                                                                
 Command for manipulating objects.                                              
                                                                                
╭─ Options ────────────────────────────────────────────────────────────────────╮
│ --help        <bool>  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        <bool>  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                <str>  Stack name                                   │
│                                 [required]                                   │
│ *    template_file       <str>  Template file                                │
│                                 [required]                                   │
│ *    parameter_file      <str>  Parameter file                               │
│                                 [required]                                   │
╰──────────────────────────────────────────────────────────────────────────────╯
╭─ Options ────────────────────────────────────────────────────────────────────╮
│ --timeout        <int>   Stack create timeout in seconds.                    │
│                          [default: 900]                                      │
│ --tries          <int>   Number of tries before giving up.                   │
│                          [default: 2]                                        │
│ --help           <bool>  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      <str>  Stack name or ID                                 │
│                             [required]                                       │
╰──────────────────────────────────────────────────────────────────────────────╯
╭─ Options ────────────────────────────────────────────────────────────────────╮
│ --force          <bool>  Ignore timeout and continue with next stack.        │
│ --timeout        <int>   Stack delete timeout in seconds.                    │
│                          [default: 900]                                      │
│ --help           <bool>  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      <str>  Stack name                                       │
│                             [required]                                       │
╰──────────────────────────────────────────────────────────────────────────────╯
╭─ Options ────────────────────────────────────────────────────────────────────╮
│ --timeout        <int>   Timeout in seconds for cost retrieval operations    │
│                          (default: 60)                                       │
│                          [default: 60]                                       │
│ --help           <bool>  Show this message and exit.                         │
╰──────────────────────────────────────────────────────────────────────────────╯

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

Prices come from the Vexxhost pricing API by default. To use another endpoint, for example a mirror, set LFTOOLS_STACK_PRICING_URL to an https:// URL template holding a %s for the flavour name followed by a %d for the elapsed seconds:

export LFTOOLS_STACK_PRICING_URL='https://pricing.example.org/v1/pricing/%s/cost?seconds=%d'

The endpoint must answer with a JSON object carrying a cost field, as the Vexxhost API does. Percent-encode any space, control or non-ASCII character in the URL, and double every percent sign other than those of %s and %d, since the template is a Python % format string: write a %20 escape as %%20. An unset or empty variable keeps the default. Any other value that is not such a template stops the command before it contacts OpenStack. As with the default, a server whose price lookup fails counts as zero.