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).
[1m [0m
[1m [0m[1;33mUsage: [0m[1mlftools-uv openstack [OPTIONS] COMMAND [ARGS]...[0m[1m [0m[1m [0m
[1m [0m
Provide an interface to OpenStack.
[2mâ•─[0m[2m Options [0m[2m───────────────────────────────────────────────────────────────────[0m[2m─╮[0m
[2m│[0m [31m*[0m [1;36m-[0m[1;36m-os[0m[1;36m-cloud[0m [1;2;33m<[0m[1;33mstr[0m[1;2;33m>[0m[1;33m [0m OpenStack cloud name [2m│[0m
[2m│[0m [2;33m[env var: OS_CLOUD] [0m [2m│[0m
[2m│[0m [2;31m[required] [0m [2m│[0m
[2m│[0m [1;36m-[0m[1;36m-help[0m [1;2;33m<[0m[1;33mbool[0m[1;2;33m>[0m Show this message and exit. [2m│[0m
[2m╰──────────────────────────────────────────────────────────────────────────────╯[0m
[2mâ•─[0m[2m Commands [0m[2m──────────────────────────────────────────────────────────────────[0m[2m─╮[0m
[2m│[0m [1;36mcluster [0m[1;36m [0m Command for manipulating COE clusters. [2m│[0m
[2m│[0m [1;36mimage [0m[1;36m [0m Command for manipulating images. [2m│[0m
[2m│[0m [1;36mobject [0m[1;36m [0m Command for manipulating objects. [2m│[0m
[2m│[0m [1;36mserver [0m[1;36m [0m Command for manipulating servers. [2m│[0m
[2m│[0m [1;36mstack [0m[1;36m [0m Command for manipulating stacks. [2m│[0m
[2m│[0m [1;36mvolume [0m[1;36m [0m Command for manipulating volumes. [2m│[0m
[2m╰──────────────────────────────────────────────────────────────────────────────╯[0m
Commands¶
image¶
[1m [0m
[1m [0m[1;33mUsage: [0m[1mlftools-uv openstack image [OPTIONS] COMMAND [ARGS]...[0m[1m [0m[1m [0m
[1m [0m
Command for manipulating images.
[2mâ•─[0m[2m Options [0m[2m───────────────────────────────────────────────────────────────────[0m[2m─╮[0m
[2m│[0m [1;36m-[0m[1;36m-help[0m [1;2;33m<[0m[1;33mbool[0m[1;2;33m>[0m Show this message and exit. [2m│[0m
[2m╰──────────────────────────────────────────────────────────────────────────────╯[0m
[2mâ•─[0m[2m Commands [0m[2m──────────────────────────────────────────────────────────────────[0m[2m─╮[0m
[2m│[0m [1;36mcleanup [0m[1;36m [0m Cleanup old images. [2m│[0m
[2m│[0m [1;36mlist [0m[1;36m [0m List cloud images. [2m│[0m
[2m│[0m [1;36mshare [0m[1;36m [0m Share image with another tenant. [2m│[0m
[2m│[0m [1;36mupload [0m[1;36m [0m Upload image to OpenStack cloud. [2m│[0m
[2m╰──────────────────────────────────────────────────────────────────────────────╯[0m
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.
[1m [0m
[1m [0m[1;33mUsage: [0m[1mlftools-uv openstack image cleanup [OPTIONS][0m[1m [0m[1m [0m
[1m [0m
Cleanup old images.
[2mâ•─[0m[2m Options [0m[2m───────────────────────────────────────────────────────────────────[0m[2m─╮[0m
[2m│[0m [1;36m-[0m[1;36m-ci[0m[1;36m-managed[0m [1;2;33m<[0m[1;33mbool[0m[1;2;33m>[0m Filter only images that have the ci_managed=yes [2m│[0m
[2m│[0m metadata set. [2m│[0m
[2m│[0m [1;36m-[0m[1;36m-days[0m [1;2;33m<[0m[1;33mint[0m[1;2;33m>[0m[1;33m [0m Find images older than or equal to days. [2m│[0m
[2m│[0m [2m[default: 0] [0m [2m│[0m
[2m│[0m [1;36m-[0m[1;36m-hide[0m[1;36m-public[0m [1;2;33m<[0m[1;33mbool[0m[1;2;33m>[0m Ignore public images. [2m│[0m
[2m│[0m [1;36m-[0m[1;36m-clouds[0m [1;2;33m<[0m[1;33mstr[0m[1;2;33m>[0m[1;33m [0m Clouds (as defined in clouds.yaml) to remove [2m│[0m
[2m│[0m images from. If not passed will assume from [2m│[0m
[2m│[0m os-cloud parameter. (optional) [2m│[0m
[2m│[0m [1;36m-[0m[1;36m-help[0m [1;2;33m<[0m[1;33mbool[0m[1;2;33m>[0m Show this message and exit. [2m│[0m
[2m╰──────────────────────────────────────────────────────────────────────────────╯[0m
list¶
[1m [0m
[1m [0m[1;33mUsage: [0m[1mlftools-uv openstack image list [OPTIONS][0m[1m [0m[1m [0m
[1m [0m
List cloud images.
[2mâ•─[0m[2m Options [0m[2m───────────────────────────────────────────────────────────────────[0m[2m─╮[0m
[2m│[0m [1;36m-[0m[1;36m-ci[0m[1;36m-managed[0m [1;2;33m<[0m[1;33mbool[0m[1;2;33m>[0m Filter only images that have the ci_managed=yes [2m│[0m
[2m│[0m metadata set. [2m│[0m
[2m│[0m [1;36m-[0m[1;36m-days[0m [1;2;33m<[0m[1;33mint[0m[1;2;33m>[0m[1;33m [0m Find images older than or equal to days. [2m│[0m
[2m│[0m [2m[default: 0] [0m [2m│[0m
[2m│[0m [1;36m-[0m[1;36m-hide[0m[1;36m-public[0m [1;2;33m<[0m[1;33mbool[0m[1;2;33m>[0m Ignore public images. [2m│[0m
[2m│[0m [1;36m-[0m[1;36m-help[0m [1;2;33m<[0m[1;33mbool[0m[1;2;33m>[0m Show this message and exit. [2m│[0m
[2m╰──────────────────────────────────────────────────────────────────────────────╯[0m
cluster¶
Command for managing Container Orchestration Engine (COE) clusters.
[1m [0m
[1m [0m[1;33mUsage: [0m[1mlftools-uv openstack cluster [OPTIONS] COMMAND [ARGS]...[0m[1m [0m[1m [0m
[1m [0m
Command for manipulating COE clusters.
[2mâ•─[0m[2m Options [0m[2m───────────────────────────────────────────────────────────────────[0m[2m─╮[0m
[2m│[0m [1;36m-[0m[1;36m-help[0m [1;2;33m<[0m[1;33mbool[0m[1;2;33m>[0m Show this message and exit. [2m│[0m
[2m╰──────────────────────────────────────────────────────────────────────────────╯[0m
[2mâ•─[0m[2m Commands [0m[2m──────────────────────────────────────────────────────────────────[0m[2m─╮[0m
[2m│[0m [1;36mcleanup [0m[1;36m [0m Cleanup orphaned COE clusters. [2m│[0m
[2m│[0m [1;36mlist [0m[1;36m [0m List COE clusters. [2m│[0m
[2m│[0m [1;36mremove [0m[1;36m [0m Remove a COE cluster. [2m│[0m
[2m│[0m [1;36mshow [0m[1;36m [0m Show COE cluster details. [2m│[0m
[2m╰──────────────────────────────────────────────────────────────────────────────╯[0m
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.
[1m [0m
[1m [0m[1;33mUsage: [0m[1mlftools-uv openstack cluster cleanup [OPTIONS][0m[1m [0m[1m [0m
[1m [0m
Cleanup orphaned COE clusters.
[2mRemoves clusters not in use by active Jenkins builds.[0m[2m [0m[2mPreserves managed [0m
[2mclusters (names containing -managed-prod-k8s- or -managed-test-k8s-).[0m
[2mâ•─[0m[2m Options [0m[2m───────────────────────────────────────────────────────────────────[0m[2m─╮[0m
[2m│[0m [1;36m-[0m[1;36m-jenkins[0m [1;2;33m<[0m[1;33mstr[0m[1;2;33m>[0m[1;33m [0m Space-separated list of Jenkins URLs to check for [2m│[0m
[2m│[0m active builds. [2m│[0m
[2m│[0m [1;36m-[0m[1;36m-help[0m [1;2;33m<[0m[1;33mbool[0m[1;2;33m>[0m Show this message and exit. [2m│[0m
[2m╰──────────────────────────────────────────────────────────────────────────────╯[0m
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.
[1m [0m
[1m [0m[1;33mUsage: [0m[1mlftools-uv openstack cluster list [OPTIONS][0m[1m [0m[1m [0m
[1m [0m
List COE clusters.
[2mâ•─[0m[2m Options [0m[2m───────────────────────────────────────────────────────────────────[0m[2m─╮[0m
[2m│[0m [1;36m-[0m[1;36m-help[0m [1;2;33m<[0m[1;33mbool[0m[1;2;33m>[0m Show this message and exit. [2m│[0m
[2m╰──────────────────────────────────────────────────────────────────────────────╯[0m
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.
[1m [0m
[1m [0m[1;33mUsage: [0m[1mlftools-uv openstack cluster remove [OPTIONS] {cluster}[0m[1m [0m[1m [0m
[1m [0m
Remove a COE cluster.
[2mâ•─[0m[2m Arguments [0m[2m─────────────────────────────────────────────────────────────────[0m[2m─╮[0m
[2m│[0m [31m*[0m cluster [1;2;33m<[0m[1;33mstr[0m[1;2;33m>[0m Cluster to remove [2m│[0m
[2m│[0m [2;31m[required] [0m [2m│[0m
[2m╰──────────────────────────────────────────────────────────────────────────────╯[0m
[2mâ•─[0m[2m Options [0m[2m───────────────────────────────────────────────────────────────────[0m[2m─╮[0m
[2m│[0m [1;36m-[0m[1;36m-minutes[0m [1;2;33m<[0m[1;33mint[0m[1;2;33m>[0m[1;33m [0m Delete cluster if older than x minutes. [2m│[0m
[2m│[0m [2m[default: 0] [0m [2m│[0m
[2m│[0m [1;36m-[0m[1;36m-help[0m [1;2;33m<[0m[1;33mbool[0m[1;2;33m>[0m Show this message and exit. [2m│[0m
[2m╰──────────────────────────────────────────────────────────────────────────────╯[0m
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.
[1m [0m
[1m [0m[1;33mUsage: [0m[1mlftools-uv openstack cluster show [OPTIONS] {cluster}[0m[1m [0m[1m [0m
[1m [0m
Show COE cluster details.
[2mâ•─[0m[2m Arguments [0m[2m─────────────────────────────────────────────────────────────────[0m[2m─╮[0m
[2m│[0m [31m*[0m cluster [1;2;33m<[0m[1;33mstr[0m[1;2;33m>[0m Cluster to show [2m│[0m
[2m│[0m [2;31m[required] [0m [2m│[0m
[2m╰──────────────────────────────────────────────────────────────────────────────╯[0m
[2mâ•─[0m[2m Options [0m[2m───────────────────────────────────────────────────────────────────[0m[2m─╮[0m
[2m│[0m [1;36m-[0m[1;36m-help[0m [1;2;33m<[0m[1;33mbool[0m[1;2;33m>[0m Show this message and exit. [2m│[0m
[2m╰──────────────────────────────────────────────────────────────────────────────╯[0m
object¶
Command for managing objects.
[1m [0m
[1m [0m[1;33mUsage: [0m[1mlftools-uv openstack object [OPTIONS] COMMAND [ARGS]...[0m[1m [0m[1m [0m
[1m [0m
Command for manipulating objects.
[2mâ•─[0m[2m Options [0m[2m───────────────────────────────────────────────────────────────────[0m[2m─╮[0m
[2m│[0m [1;36m-[0m[1;36m-help[0m [1;2;33m<[0m[1;33mbool[0m[1;2;33m>[0m Show this message and exit. [2m│[0m
[2m╰──────────────────────────────────────────────────────────────────────────────╯[0m
[2mâ•─[0m[2m Commands [0m[2m──────────────────────────────────────────────────────────────────[0m[2m─╮[0m
[2m│[0m [1;36mlist [0m[1;36m [0m List available containers. [2m│[0m
[2m╰──────────────────────────────────────────────────────────────────────────────╯[0m
list-containers¶
[1;33mUsage: [0m[1mlftools-uv openstack object [OPTIONS] COMMAND [ARGS]...[0m
[2mTry [0m[2;34m'lftools-uv openstack object [0m[1;2;34m-[0m[1;2;34m-help[0m[2;34m'[0m[2m for help.[0m
[31mâ•─[0m[31m Error [0m[31m─────────────────────────────────────────────────────────────────────[0m[31m─╮[0m
[31m│[0m No such command 'list-containers'. [31m│[0m
[31m╰──────────────────────────────────────────────────────────────────────────────╯[0m
stack¶
Command for managing stacks.
[1m [0m
[1m [0m[1;33mUsage: [0m[1mlftools-uv openstack stack [OPTIONS] COMMAND [ARGS]...[0m[1m [0m[1m [0m
[1m [0m
Command for manipulating stacks.
[2mâ•─[0m[2m Options [0m[2m───────────────────────────────────────────────────────────────────[0m[2m─╮[0m
[2m│[0m [1;36m-[0m[1;36m-help[0m [1;2;33m<[0m[1;33mbool[0m[1;2;33m>[0m Show this message and exit. [2m│[0m
[2m╰──────────────────────────────────────────────────────────────────────────────╯[0m
[2mâ•─[0m[2m Commands [0m[2m──────────────────────────────────────────────────────────────────[0m[2m─╮[0m
[2m│[0m [1;36mcreate [0m[1;36m [0m Create stack. [2m│[0m
[2m│[0m [1;36mdelete [0m[1;36m [0m Delete stack. [2m│[0m
[2m│[0m [1;36mcost [0m[1;36m [0m Get Total Stack Cost. [2m│[0m
[2m│[0m [1;36mdelete-stale [0m[1;36m [0m Delete stale stacks. [2m│[0m
[2m╰──────────────────────────────────────────────────────────────────────────────╯[0m
create¶
Create a new stack.
[1m [0m
[1m [0m[1;33mUsage: [0m[1mlftools-uv openstack stack create [OPTIONS] {name} {template_file}[0m[1m [0m[1m [0m
[1m [0m[1m {parameter_file}[0m[1m [0m[1m [0m
[1m [0m
Create stack.
[2mâ•─[0m[2m Arguments [0m[2m─────────────────────────────────────────────────────────────────[0m[2m─╮[0m
[2m│[0m [31m*[0m name [1;2;33m<[0m[1;33mstr[0m[1;2;33m>[0m Stack name [2m│[0m
[2m│[0m [2;31m[required] [0m [2m│[0m
[2m│[0m [31m*[0m template_file [1;2;33m<[0m[1;33mstr[0m[1;2;33m>[0m Template file [2m│[0m
[2m│[0m [2;31m[required] [0m [2m│[0m
[2m│[0m [31m*[0m parameter_file [1;2;33m<[0m[1;33mstr[0m[1;2;33m>[0m Parameter file [2m│[0m
[2m│[0m [2;31m[required] [0m [2m│[0m
[2m╰──────────────────────────────────────────────────────────────────────────────╯[0m
[2mâ•─[0m[2m Options [0m[2m───────────────────────────────────────────────────────────────────[0m[2m─╮[0m
[2m│[0m [1;36m-[0m[1;36m-timeout[0m [1;2;33m<[0m[1;33mint[0m[1;2;33m>[0m[1;33m [0m Stack create timeout in seconds. [2m│[0m
[2m│[0m [2m[default: 900] [0m [2m│[0m
[2m│[0m [1;36m-[0m[1;36m-tries[0m [1;2;33m<[0m[1;33mint[0m[1;2;33m>[0m[1;33m [0m Number of tries before giving up. [2m│[0m
[2m│[0m [2m[default: 2] [0m [2m│[0m
[2m│[0m [1;36m-[0m[1;36m-help[0m [1;2;33m<[0m[1;33mbool[0m[1;2;33m>[0m Show this message and exit. [2m│[0m
[2m╰──────────────────────────────────────────────────────────────────────────────╯[0m
The create command requires a parameters file in the following format to build out the stack:
delete¶
Delete existing stack.
[1m [0m
[1m [0m[1;33mUsage: [0m[1mlftools-uv openstack stack delete [OPTIONS] {name_or_id}[0m[1m [0m[1m [0m
[1m [0m
Delete stack.
[2mâ•─[0m[2m Arguments [0m[2m─────────────────────────────────────────────────────────────────[0m[2m─╮[0m
[2m│[0m [31m*[0m name_or_id [1;2;33m<[0m[1;33mstr[0m[1;2;33m>[0m Stack name or ID [2m│[0m
[2m│[0m [2;31m[required] [0m [2m│[0m
[2m╰──────────────────────────────────────────────────────────────────────────────╯[0m
[2mâ•─[0m[2m Options [0m[2m───────────────────────────────────────────────────────────────────[0m[2m─╮[0m
[2m│[0m [1;36m-[0m[1;36m-force[0m [1;2;33m<[0m[1;33mbool[0m[1;2;33m>[0m Ignore timeout and continue with next stack. [2m│[0m
[2m│[0m [1;36m-[0m[1;36m-timeout[0m [1;2;33m<[0m[1;33mint[0m[1;2;33m>[0m[1;33m [0m Stack delete timeout in seconds. [2m│[0m
[2m│[0m [2m[default: 900] [0m [2m│[0m
[2m│[0m [1;36m-[0m[1;36m-help[0m [1;2;33m<[0m[1;33mbool[0m[1;2;33m>[0m Show this message and exit. [2m│[0m
[2m╰──────────────────────────────────────────────────────────────────────────────╯[0m
cost¶
Get total cost of existing stack.
[1m [0m
[1m [0m[1;33mUsage: [0m[1mlftools-uv openstack stack cost [OPTIONS] {stack_name}[0m[1m [0m[1m [0m
[1m [0m
Get Total Stack Cost.
[2mâ•─[0m[2m Arguments [0m[2m─────────────────────────────────────────────────────────────────[0m[2m─╮[0m
[2m│[0m [31m*[0m stack_name [1;2;33m<[0m[1;33mstr[0m[1;2;33m>[0m Stack name [2m│[0m
[2m│[0m [2;31m[required] [0m [2m│[0m
[2m╰──────────────────────────────────────────────────────────────────────────────╯[0m
[2mâ•─[0m[2m Options [0m[2m───────────────────────────────────────────────────────────────────[0m[2m─╮[0m
[2m│[0m [1;36m-[0m[1;36m-timeout[0m [1;2;33m<[0m[1;33mint[0m[1;2;33m>[0m[1;33m [0m Timeout in seconds for cost retrieval operations [2m│[0m
[2m│[0m (default: 60) [2m│[0m
[2m│[0m [2m[default: 60] [0m [2m│[0m
[2m│[0m [1;36m-[0m[1;36m-help[0m [1;2;33m<[0m[1;33mbool[0m[1;2;33m>[0m Show this message and exit. [2m│[0m
[2m╰──────────────────────────────────────────────────────────────────────────────╯[0m
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.