CLI Client: Images
This page describes how to use the Openstack CLI client to manage images.
List Available Images
openstack image list
This command lists available images. Additional filters can be applied:
--public
: lists CAC supported public images available to all projects.--private
: lists images created by users in your project and available only to your project.
Upload an Image
openstack image create --file <path to image file> --disk-format raw <new-image-name>
Upload a new image file in raw format. Use the qemu-img
command if you need to convert images in other format to raw.
Options:
--progress
: Displays the progress during the image upload.
Create an Image from Volume
openstack image create --volume <volume-name-or-ID> <new-image-name>
Create a new image from an existing volume. If the volume is attached, it is best to shut off the instance first. After the image is created, you can restart the instance.
Download an Image
openstack image save --file <image file> <image>
Download the specified image onto your local computer. The image will be saved in a file named specified by the --file
option.
Edit Image Attributes
openstack image set ... <image-name-or-ID>
The following attributes can be changed:
--name
: Set the name of the image- Minimum instance requirements to run this image:
--min-disk
: Minimum disk size in GB--min-ram
: Minimum RAM in MB
--protected
: Image cannot be deleted or its attributes changed if protected.--unprotected
: Remove the protected attribute.- Visibility:
--private
: A private image is visible only to the owner's project--shared
: A shared image can be shared with another project.
Delete an Image
openstack image delete <image-name-or-ID>
Delete the specified image. If an image is protected, it must be set to unprotected first