LinuxCommandLibrary

openstack-image

Manage Glance (OpenStack Image service) images

TLDR

List available images

$ openstack image list [--private|--shared|--all]
copy

Display image details
$ openstack image show --human-readable [image_id]
copy

Create/upload an image
$ openstack image create --file [path/to/file] [--private|--shared|--all] [image_name]
copy

Delete image(s)
$ openstack image delete [image_id1 image_id2 ...]
copy

Save an image locally
$ openstack image save --file [filename] [image_id]
copy

SYNOPSIS

openstack image subcommand [options] [arguments]

Common subcommands:
  list: Lists all available images.
  show <image>: Displays detailed information about a specific image.
  create <name> [--file <file>] [--disk-format <format>]: Creates a new image.
  delete <image>: Deletes one or more images.
  set <image> [--property <key=value>]: Modifies properties of an existing image.
  save <image> [--file <file>]: Saves an image to a local file.

PARAMETERS

--file
    Specifies the local file path for image data to be uploaded or saved.

--disk-format
    Sets the disk image format (e.g., qcow2, raw, iso, vhd, vmdk) for image creation.

--container-format
    Sets the container format (e.g., bare, ovf) for image creation.

--public
    Makes the image publicly accessible to all tenants.

--private
    Makes the image private, accessible only to the owner tenant (default).

--protected
    Protects the image from accidental deletion.

--min-disk
    Sets the minimum disk size in GB required to boot the image.

--min-ram
    Sets the minimum RAM in MB required to boot the image.

--property
    Adds or updates custom metadata properties for the image. Can be used multiple times.

--tag
    Adds a tag to the image for easier categorization and filtering. Can be used multiple times.

--limit
    Restricts the number of images returned in a list operation.

--status
    Filters images by their current status (e.g., active, queued, killed) during list operations.

--long
    Displays additional information for list operations (e.g., properties).

DESCRIPTION

The openstack image command is a crucial component of the OpenStack command-line client (CLI), designed for interacting with the OpenStack Glance Image Service. It allows users to perform comprehensive management operations on virtual machine images, including creating, listing, showing details, updating, deleting, and sharing images. Images are fundamental to OpenStack, serving as templates for launching virtual machines. This command facilitates the entire lifecycle of images within an OpenStack cloud, enabling administrators and users to prepare, store, and distribute operating system and application environments for cloud instances.

CAVEATS

The openstack image command requires the OpenStack CLI client to be installed and properly configured with access to an OpenStack cloud. Authentication details (like OS_AUTH_URL, OS_USERNAME, etc.) must be set up via environment variables or a clouds.yaml file.

The behavior and available options might vary slightly depending on the specific version of OpenStack Glance and the OpenStack CLI client being used. It's crucial to refer to the official OpenStack documentation for the exact version you are working with.

IMAGE LIFECYCLE

Images typically go through several states: queued (uploading), saving (processing), active (ready for use), deactivated (temporarily unavailable), and killed (failed during creation/upload). Understanding these states is vital for troubleshooting image issues and monitoring image availability.

IMAGE FORMATS

OpenStack supports various disk image formats, with QCOW2 being the most common due to its features like snapshotting and smaller file sizes. Other formats include RAW (raw disk image), ISO (CD/DVD images), VHD (Hyper-V), and VMDK (VMware). Choosing the correct format is important for compatibility and performance with different hypervisors.

HISTORY

The OpenStack project, including its Glance Image Service, was initiated in 2010. As OpenStack matured, the original service-specific clients (like `glanceclient`) were consolidated into a single, unified OpenStack CLI client to provide a more consistent and user-friendly experience across all OpenStack services. The openstack image command emerged as part of this consolidation, replacing older, separate commands for image management. This evolution aimed to simplify cloud administration and operations by offering a unified interface for interacting with the entire OpenStack ecosystem.

SEE ALSO

openstack(1), openstack server(1), openstack network(1), openstack volume(1)

Copied to clipboard