Image Service command-line clientThe glance client is the command-line interface
(CLI) for the OpenStack Image Service API and its extensions. This chapter documents
glance version 0.13.1.
For help on a specific glance
command, enter:
$glanceCOMMANDglance usageusage: glance [--version] [-d] [-v] [--get-schema] [-k]
[--cert-file CERT_FILE] [--key-file KEY_FILE]
[--os-cacert <ca-certificate-file>] [--ca-file OS_CACERT]
[--timeout TIMEOUT] [--no-ssl-compression] [-f] [--dry-run]
[--ssl] [-H ADDRESS] [-p PORT] [--os-username OS_USERNAME]
[-I OS_USERNAME] [--os-password OS_PASSWORD] [-K OS_PASSWORD]
[--os-tenant-id OS_TENANT_ID] [--os-tenant-name OS_TENANT_NAME]
[-T OS_TENANT_NAME] [--os-auth-url OS_AUTH_URL] [-N OS_AUTH_URL]
[--os-region-name OS_REGION_NAME] [-R OS_REGION_NAME]
[--os-auth-token OS_AUTH_TOKEN] [-A OS_AUTH_TOKEN]
[--os-image-url OS_IMAGE_URL] [-U OS_IMAGE_URL]
[--os-image-api-version OS_IMAGE_API_VERSION]
[--os-service-type OS_SERVICE_TYPE]
[--os-endpoint-type OS_ENDPOINT_TYPE] [-S OS_AUTH_STRATEGY]
<subcommand> ...SubcommandsaddDEPRECATED! Use image-create instead.
clearDEPRECATED!deleteDEPRECATED! Use image-delete instead.
detailsDEPRECATED! Use image-list instead.
image-create
Create a new image.
image-delete
Delete specified image(s).
image-download
Download a specific image.
image-list
List images you can access.
image-membersDEPRECATED! Use member-list instead.
image-show
Describe a specific image.
image-update
Update a specific image.
indexDEPRECATED! Use image-list instead.
member-addDEPRECATED! Use member-create instead.
member-create
Share a specific image with a tenant.
member-delete
Remove a shared image from a tenant.
member-imagesDEPRECATED! Use member-list instead.
member-list
Describe sharing permissions by image or tenant.
members-replaceDEPRECATED!showDEPRECATED! Use image-show instead.
updateDEPRECATED! Use image-update instead.
help
Display help about this program or one of its
subcommands.
glance optional arguments--version
show program's version number and exit
-d, --debug
Defaults to env[GLANCECLIENT_DEBUG].
-v, --verbose
Print more verbose output
--get-schema
Ignores cached copy and forces retrieval of schema
that generates portions of the help text. Ignored with
API version 1.
-k, --insecure
Explicitly allow glanceclient to perform "insecure
SSL" (https) requests. The server's certificate will
not be verified against any certificate authorities.
This option should be used with caution.
--cert-file CERT_FILE
Path of certificate file to use in SSL connection.
This file can optionally be prepended with the private
key.
--key-file KEY_FILE
Path of client key to use in SSL connection. This
option is not necessary if your key is prepended to
your cert file.
--os-cacert <ca-certificate-file>
Path of CA TLS certificate(s) used to verify the
remote server's certificate. Without this option
glance looks for the default system CA certificates.
--ca-file OS_CACERTDEPRECATED! Use --os-cacert.
--timeout TIMEOUT
Number of seconds to wait for a response
--no-ssl-compression
Disable SSL compression when using https.
-f, --force
Prevent select actions from requesting user
confirmation.
--dry-runDEPRECATED! Only used for deprecated legacy commands.
--sslDEPRECATED! Send a fully-formed endpoint using --os-
image-url instead.
-H ADDRESS, --host ADDRESSDEPRECATED! Send a fully-formed endpoint using --os-
image-url instead.
-p PORT, --port PORTDEPRECATED! Send a fully-formed endpoint using --os-
image-url instead.
--os-username OS_USERNAME
Defaults to env[OS_USERNAME].
-I OS_USERNAMEDEPRECATED! Use --os-username.
--os-password OS_PASSWORD
Defaults to env[OS_PASSWORD].
-K OS_PASSWORDDEPRECATED! Use --os-password.
--os-tenant-id OS_TENANT_ID
Defaults to env[OS_TENANT_ID].
--os-tenant-name OS_TENANT_NAME
Defaults to env[OS_TENANT_NAME].
-T OS_TENANT_NAMEDEPRECATED! Use --os-tenant-name.
--os-auth-url OS_AUTH_URL
Defaults to env[OS_AUTH_URL].
-N OS_AUTH_URLDEPRECATED! Use --os-auth-url.
--os-region-name OS_REGION_NAME
Defaults to env[OS_REGION_NAME].
-R OS_REGION_NAMEDEPRECATED! Use --os-region-name.
--os-auth-token OS_AUTH_TOKEN
Defaults to env[OS_AUTH_TOKEN].
-A OS_AUTH_TOKEN, --auth_token OS_AUTH_TOKENDEPRECATED! Use --os-auth-token.
--os-image-url OS_IMAGE_URL
Defaults to env[OS_IMAGE_URL].
-U OS_IMAGE_URL, --url OS_IMAGE_URLDEPRECATED! Use --os-image-url.
--os-image-api-version OS_IMAGE_API_VERSION
Defaults to env[OS_IMAGE_API_VERSION] or 1.
--os-service-type OS_SERVICE_TYPE
Defaults to env[OS_SERVICE_TYPE].
--os-endpoint-type OS_ENDPOINT_TYPE
Defaults to env[OS_ENDPOINT_TYPE].
-S OS_AUTH_STRATEGY, --os_auth_strategy OS_AUTH_STRATEGYDEPRECATED! This option is completely ignored.
glance image-create commandusage: glance image-create [--id <IMAGE_ID>] [--name <NAME>] [--store <STORE>]
[--disk-format <DISK_FORMAT>]
[--container-format <CONTAINER_FORMAT>]
[--owner <TENANT_ID>] [--size <SIZE>]
[--min-disk <DISK_GB>] [--min-ram <DISK_RAM>]
[--location <IMAGE_URL>] [--file <FILE>]
[--checksum <CHECKSUM>] [--copy-from <IMAGE_URL>]
[--is-public {True,False}]
[--is-protected {True,False}]
[--property <key=value>] [--human-readable]
[--progress]
Create a new image.
Optional arguments--id <IMAGE_ID> ID
of image to reserve.
--name <NAME>
Name of image.
--store <STORE>
Store to upload image to.
--disk-format <DISK_FORMAT>
Disk format of image. Acceptable formats: ami, ari,
aki, vhd, vmdk, raw, qcow2, vdi, and iso.
--container-format <CONTAINER_FORMAT>
Container format of image. Acceptable formats: ami,
ari, aki, bare, and ovf.
--owner <TENANT_ID>
Tenant who should own image.
--size <SIZE>
Size of image data (in bytes). Only used with '--
location' and '--copy_from'.
--min-disk <DISK_GB>
Minimum size of disk needed to boot image (in
gigabytes).
--min-ram <DISK_RAM>
Minimum amount of ram needed to boot image (in
megabytes).
--location <IMAGE_URL>
URL where the data for this image already resides. For
example, if the image data is stored in swift, you
could specify
'swift://account:key@example.com/container/obj'.
--file <FILE>
Local file that contains disk image to be uploaded
during creation. Alternatively, images can be passed
to the client via stdin.
--checksum <CHECKSUM>
Hash of image data used Glance can use for
verification. Provide a md5 checksum here.
--copy-from <IMAGE_URL>
Similar to '--location' in usage, but this indicates
that the Glance server should immediately copy the
data and store it in its configured image store.
--is-public {True,False}
Make image accessible to the public.
--is-protected {True,False}
Prevent image from being deleted.
--property <key=value>
Arbitrary property to associate with image. May be
used multiple times.
--human-readable
Print image size in a human-friendly format.
--progress
Show upload progress bar.
glance image-delete commandusage: glance image-delete <IMAGE> [<IMAGE> ...]
Delete specified image(s).
Positional arguments<IMAGE>
Name or ID of image(s) to delete.
glance image-list commandusage: glance image-list [--name <NAME>] [--status <STATUS>]
[--container-format <CONTAINER_FORMAT>]
[--disk-format <DISK_FORMAT>] [--size-min <SIZE>]
[--size-max <SIZE>] [--property-filter <KEY=VALUE>]
[--page-size <SIZE>] [--human-readable]
[--sort-key {name,status,container_format,disk_format,size,id,created_at,updated_at}]
[--sort-dir {asc,desc}] [--is-public {True,False}]
[--owner <TENANT_ID>] [--all-tenants]
List images you can access.
Optional arguments--name <NAME>
Filter images to those that have this name.
--status <STATUS>
Filter images to those that have this status.
--container-format <CONTAINER_FORMAT>
Filter images to those that have this container
format. Acceptable formats: ami, ari, aki, bare, and
ovf.
--disk-format <DISK_FORMAT>
Filter images to those that have this disk format.
Acceptable formats: ami, ari, aki, vhd, vmdk, raw,
qcow2, vdi, and iso.
--size-min <SIZE>
Filter images to those with a size greater than this.
--size-max <SIZE>
Filter images to those with a size less than this.
--property-filter <KEY=VALUE>
Filter images by a user-defined image property.
--page-size <SIZE>
Number of images to request in each paginated request.
--human-readable
Print image size in a human-friendly format.
--sort-key {name,status,container_format,disk_format,size,id,created_at,updated_at}
Sort image list by specified field.
--sort-dir {asc,desc}
Sort image list in specified direction.
--is-public {True,False}
Allows the user to select a listing of public or non
public images.
--owner <TENANT_ID>
Display only images owned by this tenant id. Filtering
occurs on the client side so may be inefficient. This
option is mainly intended for admin use. Use an empty
string ('') to list images with no owner. Note: This
option overrides the --is-public argument if present.
Note: the v2 API supports more efficient server-side
owner based filtering.
--all-tenants
Allows the admin user to list all images irrespective
of the image's owner or is_public value.
glance image-show commandusage: glance image-show [--human-readable] [--max-column-width <integer>]
<IMAGE>
Describe a specific image.
Positional arguments<IMAGE>
Name or ID of image to describe.
Optional arguments--human-readable
Print image size in a human-friendly format.
--max-column-width <integer>
The max column width of the printed table.
glance image-update commandusage: glance image-update [--name <NAME>] [--disk-format <DISK_FORMAT>]
[--container-format <CONTAINER_FORMAT>]
[--owner <TENANT_ID>] [--size <SIZE>]
[--min-disk <DISK_GB>] [--min-ram <DISK_RAM>]
[--location <IMAGE_URL>] [--file <FILE>]
[--checksum <CHECKSUM>] [--copy-from <IMAGE_URL>]
[--is-public {True,False}]
[--is-protected {True,False}]
[--property <key=value>] [--purge-props]
[--human-readable] [--progress]
<IMAGE>
Update a specific image.
Positional arguments<IMAGE>
Name or ID of image to modify.
Optional arguments--name <NAME>
Name of image.
--disk-format <DISK_FORMAT>
Disk format of image. Acceptable formats: ami, ari,
aki, vhd, vmdk, raw, qcow2, vdi, and iso.
--container-format <CONTAINER_FORMAT>
Container format of image. Acceptable formats: ami,
ari, aki, bare, and ovf.
--owner <TENANT_ID>
Tenant who should own image.
--size <SIZE>
Size of image data (in bytes).
--min-disk <DISK_GB>
Minimum size of disk needed to boot image (in
gigabytes).
--min-ram <DISK_RAM>
Minimum amount of ram needed to boot image (in
megabytes).
--location <IMAGE_URL>
URL where the data for this image already resides. For
example, if the image data is stored in swift, you
could specify
'swift://account:key@example.com/container/obj'.
--file <FILE>
Local file that contains disk image to be uploaded
during update. Alternatively, images can be passed to
the client via stdin.
--checksum <CHECKSUM>
Hash of image data used Glance can use for
verification.
--copy-from <IMAGE_URL>
Similar to '--location' in usage, but this indicates
that the Glance server should immediately copy the
data and store it in its configured image store.
--is-public {True,False}
Make image accessible to the public.
--is-protected {True,False}
Prevent image from being deleted.
--property <key=value>
Arbitrary property to associate with image. May be
used multiple times.
--purge-props
If this flag is present, delete all image properties
not explicitly set in the update request. Otherwise,
those properties not referenced are preserved.
--human-readable
Print image size in a human-friendly format.
--progress
Show upload progress bar.
glance member-create commandusage: glance member-create [--can-share] <IMAGE> <TENANT_ID>
Share a specific image with a tenant.
Positional arguments<IMAGE>
Image to add member to.
<TENANT_ID>
Tenant to add as member
Optional arguments--can-share
Allow the specified tenant to share this image.
glance member-delete commandusage: glance member-delete <IMAGE> <TENANT_ID>
Remove a shared image from a tenant.
Positional arguments<IMAGE>
Image from which to remove member.
<TENANT_ID>
Tenant to remove as member.
glance member-list commandusage: glance member-list [--image-id <IMAGE_ID>] [--tenant-id <TENANT_ID>]
Describe sharing permissions by image or tenant.
Optional arguments--image-id <IMAGE_ID>
Filter results by an image ID.
--tenant-id <TENANT_ID>
Filter results by a tenant ID.