The glance client is the command-line interface (CLI) for the Image service API and its extensions.
This chapter documents glance version 2.0.0.
For help on a specific glance command, enter:
$ glance help COMMAND
usage: glance [--version] [-d] [-v] [--get-schema] [--no-ssl-compression] [-f]
[--os-image-url OS_IMAGE_URL]
[--os-image-api-version OS_IMAGE_API_VERSION]
[--profile HMAC_KEY] [--insecure] [--os-cacert <ca-certificate>]
[--os-cert <certificate>] [--os-key <key>] [--timeout <seconds>]
[--os-auth-url OS_AUTH_URL] [--os-domain-id OS_DOMAIN_ID]
[--os-domain-name OS_DOMAIN_NAME]
[--os-project-id OS_PROJECT_ID]
[--os-project-name OS_PROJECT_NAME]
[--os-project-domain-id OS_PROJECT_DOMAIN_ID]
[--os-project-domain-name OS_PROJECT_DOMAIN_NAME]
[--os-trust-id OS_TRUST_ID] [--os-user-id OS_USER_ID]
[--os-username OS_USERNAME]
[--os-user-domain-id OS_USER_DOMAIN_ID]
[--os-user-domain-name OS_USER_DOMAIN_NAME]
[--os-password OS_PASSWORD] [--key-file OS_KEY]
[--ca-file OS_CACERT] [--cert-file OS_CERT]
[--os-tenant-id OS_TENANT_ID] [--os-tenant-name OS_TENANT_NAME]
[--os-region-name OS_REGION_NAME]
[--os-auth-token OS_AUTH_TOKEN]
[--os-service-type OS_SERVICE_TYPE]
[--os-endpoint-type OS_ENDPOINT_TYPE]
<subcommand> ...
usage: glance --os-image-api-version 1 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:
usage: glance --os-image-api-version 1 image-delete <IMAGE> [<IMAGE> ...]
Delete specified image(s).
Positional arguments:
usage: glance --os-image-api-version 1 image-download [--file <FILE>] [--progress] <IMAGE>
Download a specific image.
Positional arguments:
Optional arguments:
usage: glance --os-image-api-version 1 image-list [--name <NAME>] [--status <STATUS>]
[--changes-since <CHANGES_SINCE>]
[--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:
usage: glance --os-image-api-version 1 image-show [--human-readable] [--max-column-width <integer>]
<IMAGE>
Describe a specific image.
Positional arguments:
Optional arguments:
usage: glance --os-image-api-version 1 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:
Optional arguments:
usage: glance --os-image-api-version 1 member-create [--can-share] <IMAGE> <TENANT_ID>
Share a specific image with a tenant.
Positional arguments:
Optional arguments:
usage: glance --os-image-api-version 1 member-delete <IMAGE> <TENANT_ID>
Remove a shared image from a tenant.
Positional arguments:
usage: glance --os-image-api-version 1 member-list [--image-id <IMAGE_ID>] [--tenant-id <TENANT_ID>]
Describe sharing permissions by image or tenant.
Optional arguments:
You can select an API version to use by adding the --os-image-api-version parameter or by setting the corresponding environment variable:
export OS_IMAGE_API_VERSION=2
usage: glance --os-image-api-version 2 explain <MODEL>
Describe a specific model.
Positional arguments:
usage: glance --os-image-api-version 2 image-create [--architecture <ARCHITECTURE>]
[--protected [True|False]] [--name <NAME>]
[--instance-uuid <INSTANCE_UUID>]
[--min-disk <MIN_DISK>] [--visibility <VISIBILITY>]
[--kernel-id <KERNEL_ID>]
[--tags <TAGS> [<TAGS> ...]]
[--os-version <OS_VERSION>]
[--disk-format <DISK_FORMAT>]
[--os-distro <OS_DISTRO>] [--id <ID>]
[--owner <OWNER>] [--ramdisk-id <RAMDISK_ID>]
[--min-ram <MIN_RAM>]
[--container-format <CONTAINER_FORMAT>]
[--property <key=value>] [--file <FILE>]
[--progress]
Create a new image.
Optional arguments:
usage: glance --os-image-api-version 2 image-deactivate <IMAGE_ID>
Deactivate specified image.
Positional arguments:
usage: glance --os-image-api-version 2 image-delete <IMAGE_ID> [<IMAGE_ID> ...]
Delete specified image.
Positional arguments:
usage: glance --os-image-api-version 2 image-download [--file <FILE>] [--progress] <IMAGE_ID>
Download a specific image.
Positional arguments:
Optional arguments:
usage: glance --os-image-api-version 2 image-list [--limit <LIMIT>] [--page-size <SIZE>]
[--visibility <VISIBILITY>]
[--member-status <MEMBER_STATUS>] [--owner <OWNER>]
[--property-filter <KEY=VALUE>]
[--checksum <CHECKSUM>] [--tag <TAG>]
[--sort-key {name,status,container_format,disk_format,size,id,created_at,updated_at}]
[--sort-dir {asc,desc}] [--sort <key>[:<direction>]]
List images you can access.
Optional arguments:
usage: glance --os-image-api-version 2 image-reactivate <IMAGE_ID>
Reactivate specified image.
Positional arguments:
usage: glance --os-image-api-version 2 image-show [--human-readable] [--max-column-width <integer>]
<IMAGE_ID>
Describe a specific image.
Positional arguments:
Optional arguments:
usage: glance --os-image-api-version 2 image-tag-delete <IMAGE_ID> <TAG_VALUE>
Delete the tag associated with the given image.
Positional arguments:
usage: glance --os-image-api-version 2 image-tag-update <IMAGE_ID> <TAG_VALUE>
Update an image with the given tag.
Positional arguments:
usage: glance --os-image-api-version 2 image-update [--architecture <ARCHITECTURE>]
[--protected [True|False]] [--name <NAME>]
[--instance-uuid <INSTANCE_UUID>]
[--min-disk <MIN_DISK>] [--visibility <VISIBILITY>]
[--kernel-id <KERNEL_ID>]
[--os-version <OS_VERSION>]
[--disk-format <DISK_FORMAT>]
[--os-distro <OS_DISTRO>] [--owner <OWNER>]
[--ramdisk-id <RAMDISK_ID>] [--min-ram <MIN_RAM>]
[--container-format <CONTAINER_FORMAT>]
[--property <key=value>] [--remove-property key]
<IMAGE_ID>
Update an existing image.
Positional arguments:
Optional arguments:
usage: glance --os-image-api-version 2 image-upload [--file <FILE>] [--size <IMAGE_SIZE>] [--progress]
<IMAGE_ID>
Upload data for a specific image.
Positional arguments:
Optional arguments:
usage: glance --os-image-api-version 2 location-add --url <URL> [--metadata <STRING>] <IMAGE_ID>
Add a location (and related metadata) to an image.
Positional arguments:
Optional arguments:
usage: glance --os-image-api-version 2 location-delete --url <URL> <IMAGE_ID>
Remove locations (and related metadata) from an image.
Positional arguments:
Optional arguments:
usage: glance --os-image-api-version 2 location-update --url <URL> [--metadata <STRING>] <IMAGE_ID>
Update metadata of an image’s location.
Positional arguments:
Optional arguments:
usage: glance --os-image-api-version 2 md-namespace-create <NAMESPACE> <unavailable>
Create a new metadata definitions namespace.
Positional arguments:
usage: glance --os-image-api-version 2 md-namespace-delete <NAMESPACE>
Delete specified metadata definitions namespace with its contents.
Positional arguments:
usage: glance --os-image-api-version 2 md-namespace-import [--file <FILEPATH>]
Import a metadata definitions namespace from file or standard input.
Optional arguments:
usage: glance --os-image-api-version 2 md-namespace-list [--resource-types <RESOURCE_TYPES>]
[--visibility <VISIBILITY>]
[--page-size <SIZE>]
List metadata definitions namespaces.
Optional arguments:
usage: glance --os-image-api-version 2 md-namespace-objects-delete <NAMESPACE>
Delete all metadata definitions objects inside a specific namespace.
Positional arguments:
usage: glance --os-image-api-version 2 md-namespace-properties-delete <NAMESPACE>
Delete all metadata definitions property inside a specific namespace.
Positional arguments:
usage: glance --os-image-api-version 2 md-namespace-resource-type-list <NAMESPACE>
List resource types associated to specific namespace.
Positional arguments:
usage: glance --os-image-api-version 2 md-namespace-show [--resource-type <RESOURCE_TYPE>]
[--max-column-width <integer>]
<NAMESPACE>
Describe a specific metadata definitions namespace. Lists also the namespace properties, objects and resource type associations.
Positional arguments:
Optional arguments:
usage: glance --os-image-api-version 2 md-namespace-tags-delete <NAMESPACE>
Delete all metadata definitions tags inside a specific namespace.
Positional arguments:
usage: glance --os-image-api-version 2 md-namespace-update <NAMESPACE> <unavailable>
Update an existing metadata definitions namespace.
Positional arguments:
usage: glance --os-image-api-version 2 md-object-create --name <NAME> --schema <SCHEMA> <NAMESPACE>
Create a new metadata definitions object inside a namespace.
Positional arguments:
Optional arguments:
usage: glance --os-image-api-version 2 md-object-delete <NAMESPACE> <OBJECT>
Delete a specific metadata definitions object inside a namespace.
Positional arguments:
usage: glance --os-image-api-version 2 md-object-list <NAMESPACE>
List metadata definitions objects inside a specific namespace.
Positional arguments:
usage: glance --os-image-api-version 2 md-object-property-show [--max-column-width <integer>]
<NAMESPACE> <OBJECT> <PROPERTY>
Describe a specific metadata definitions property inside an object.
Positional arguments:
Optional arguments:
usage: glance --os-image-api-version 2 md-object-show [--max-column-width <integer>]
<NAMESPACE> <OBJECT>
Describe a specific metadata definitions object inside a namespace.
Positional arguments:
Optional arguments:
usage: glance --os-image-api-version 2 md-object-update [--name <NAME>] [--schema <SCHEMA>]
<NAMESPACE> <OBJECT>
Update metadata definitions object inside a namespace.
Positional arguments:
Optional arguments:
usage: glance --os-image-api-version 2 md-property-create --name <NAME> --title <TITLE> --schema
<SCHEMA>
<NAMESPACE>
Create a new metadata definitions property inside a namespace.
Positional arguments:
Optional arguments:
usage: glance --os-image-api-version 2 md-property-delete <NAMESPACE> <PROPERTY>
Delete a specific metadata definitions property inside a namespace.
Positional arguments:
usage: glance --os-image-api-version 2 md-property-list <NAMESPACE>
List metadata definitions properties inside a specific namespace.
Positional arguments:
usage: glance --os-image-api-version 2 md-property-show [--max-column-width <integer>]
<NAMESPACE> <PROPERTY>
Describe a specific metadata definitions property inside a namespace.
Positional arguments:
Optional arguments:
usage: glance --os-image-api-version 2 md-property-update [--name <NAME>] [--title <TITLE>]
[--schema <SCHEMA>]
<NAMESPACE> <PROPERTY>
Update metadata definitions property inside a namespace.
Positional arguments:
Optional arguments:
usage: glance --os-image-api-version 2 md-resource-type-associate <NAMESPACE> <unavailable>
Associate resource type with a metadata definitions namespace.
Positional arguments:
usage: glance --os-image-api-version 2 md-resource-type-deassociate <NAMESPACE> <RESOURCE_TYPE>
Deassociate resource type with a metadata definitions namespace.
Positional arguments:
usage: glance --os-image-api-version 2 md-resource-type-list
List available resource type names.
usage: glance --os-image-api-version 2 md-tag-create --name <NAME> <NAMESPACE>
Add a new metadata definitions tag inside a namespace.
Positional arguments:
Optional arguments:
usage: glance --os-image-api-version 2 md-tag-create-multiple --names <NAMES> [--delim <DELIM>]
<NAMESPACE>
Create new metadata definitions tags inside a namespace.
Positional arguments:
Optional arguments:
usage: glance --os-image-api-version 2 md-tag-delete <NAMESPACE> <TAG>
Delete a specific metadata definitions tag inside a namespace.
Positional arguments:
usage: glance --os-image-api-version 2 md-tag-list <NAMESPACE>
List metadata definitions tags inside a specific namespace.
Positional arguments:
usage: glance --os-image-api-version 2 md-tag-show <NAMESPACE> <TAG>
Describe a specific metadata definitions tag inside a namespace.
Positional arguments:
usage: glance --os-image-api-version 2 md-tag-update --name <NAME> <NAMESPACE> <TAG>
Rename a metadata definitions tag inside a namespace.
Positional arguments:
Optional arguments:
usage: glance --os-image-api-version 2 member-create <IMAGE_ID> <MEMBER_ID>
Create member for a given image.
Positional arguments:
usage: glance --os-image-api-version 2 member-delete <IMAGE_ID> <MEMBER_ID>
Delete image member.
Positional arguments:
usage: glance --os-image-api-version 2 member-list --image-id <IMAGE_ID>
Describe sharing permissions by image.
Optional arguments:
usage: glance --os-image-api-version 2 member-update <IMAGE_ID> <MEMBER_ID> <MEMBER_STATUS>
Update the status of a member for a given image.
Positional arguments:
usage: glance --os-image-api-version 2 task-create [--type <TYPE>] [--input <STRING>]
Create a new task.
Optional arguments:
usage: glance --os-image-api-version 2 task-list [--sort-key {id,type,status}] [--sort-dir {asc,desc}]
[--page-size <SIZE>] [--type <TYPE>]
[--status <STATUS>]
List tasks you can access.
Optional arguments:
usage: glance --os-image-api-version 2 task-show <TASK_ID>
Describe a specific task.
Positional arguments:
orphan: |
---|
The following keys, together with the components to which they are specific, can be used with the property option for both the glance image-update and glance image-create commands. For example:
$ glance image-update IMG-UUID --property architecture=x86_64
Note
Behavior set using image properties overrides behavior set using flavors. For more information, refer to the OpenStack Administrator Guide <http://docs.openstack.org/admin-guide/>.
Specific to | Key | Description | Supported values |
---|---|---|---|
All | architecture | The CPU architecture that must be supported by the hypervisor. For example, x86_64, arm, or ppc64. Run uname -m to get the architecture of a machine. We strongly recommend using the architecture data vocabulary defined by the libosinfo project for this purpose. |
|
All | hypervisor-type | The hypervisor type. Note that qemu is used for both QEMU and KVM hypervisor types. | hyperv, ironic, lxc, qemu, uml, vmware, or xen. |
All | instance_type_rxtx_factor | Optional property allows created servers to have a different bandwidth cap than that defined in the network they are attached to. This factor is multiplied by the rxtx_base property of the network. The rxtx_base property defaults to 1.0, which is the same as the attached network. This parameter is only available for Xen or NSX based systems. | Float (default value is 1.0) |
All | instance_uuid | For snapshot images, this is the UUID of the server used to create this image. | Valid server UUID |
All | img_config_drive | Specifies whether the image needs a config drive. | mandatory or optional (default if property is not used). |
All | kernel_id | The ID of an image stored in the Image service that should be used as the kernel when booting an AMI-style image. | Valid image ID |
All | os_distro | The common name of the operating system distribution in lowercase (uses the same data vocabulary as the libosinfo project). Specify only a recognized value for this field. Deprecated values are listed to assist you in searching for the recognized value. |
|
All | os_version | The operating system version as specified by the distributor. | Valid version number (for example, 11.10). |
All | ramdisk_id | The ID of image stored in the Image service that should be used as the ramdisk when booting an AMI-style image. | Valid image ID. |
All | vm_mode | The virtual machine mode. This represents the host/guest ABI (application binary interface) used for the virtual machine. |
|
libvirt API driver | hw_cpu_sockets | The preferred number of sockets to expose to the guest. | Integer. |
libvirt API driver | hw_cpu_cores | The preferred number of cores to expose to the guest. | Integer. |
libvirt API driver | hw_cpu_threads | The preferred number of threads to expose to the guest. | Integer. |
libvirt API driver | hw_disk_bus | Specifies the type of disk controller to attach disk devices to. | One of scsi, virtio, uml, xen, ide, or usb. |
libvirt API driver | hw_rng_model | Adds a random-number generator device to the image’s instances. The cloud administrator can enable and control device behavior by configuring the instance’s flavor. By default:
rng_dev_path=/dev/hwrng
|
virtio, or other supported device. |
libvirt API driver, Hyper-V driver | hw_machine_type | For libvirt: Enables booting an ARM system using the specified machine type. By default, if an ARM image is used and its type is not specified, Compute uses vexpress-a15 (for ARMv7) or virt (for AArch64) machine types. For Hyper-V: Specifies whether the Hyper-V instance will be a generation 1 or generation 2 VM. By default, if the property is not provided, the instances will be generation 1 VMs. If the image is specific for generation 2 VMs but the property is not provided accordingly, the instance will fail to boot. |
For libvirt: Valid types can be viewed by using the virsh capabilities command (machine types are displayed in the machine tag). For hyper-V: Acceptable values are either hyperv-gen1 or hyperv-gen2. |
libvirt API driver | hw_scsi_model | Enables the use of VirtIO SCSI (virtio-scsi) to provide block device access for compute instances; by default, instances use VirtIO Block (virtio-blk). VirtIO SCSI is a para-virtualized SCSI controller device that provides improved scalability and performance, and supports advanced SCSI hardware. | virtio-scsi |
libvirt API driver | hw_serial_port_count | Specifies the count of serial ports that should be provided. If hw:serial_port_count is not set in the flavor’s extra_specs, then any count is permitted. If hw:serial_port_count is set, then this provides the default serial port count. It is permitted to override the default serial port count, but only with a lower value. | Integer |
libvirt API driver | hw_video_model | The video image driver used. | vga, cirrus, vmvga, xen, or qxl. |
libvirt API driver | hw_video_ram | Maximum RAM for the video image. Used only if a hw_video:ram_max_mb value has been set in the flavor’s extra_specs and that value is higher than the value set in hw_video_ram. | Integer in MB (for example, 64). |
libvirt API driver | hw_watchdog_action | Enables a virtual hardware watchdog device that carries out the specified action if the server hangs. The watchdog uses the i6300esb device (emulating a PCI Intel 6300ESB). If hw_watchdog_action is not specified, the watchdog is disabled. |
|
libvirt API driver | os_command_line | The kernel command line to be used by the libvirt driver, instead of the default. For Linux Containers (LXC), the value is used as arguments for initialization. This key is valid only for Amazon kernel, ramdisk, or machine images (aki, ari, or ami). | |
libvirt API driver and VMware API driver | hw_vif_model | Specifies the model of virtual network interface device to use. |
|
libvirt API driver | hw_vif_multiqueue_enabled | If true, this enables the virtio-net multiqueue feature. In this case, the driver sets the number of queues equal to the number of guest vCPUs. This makes the network performance scale across a number of vCPUs. | true | false |
libvirt API driver | hw_boot_menu | If true, enables the BIOS bootmenu. In cases where both the image metadata and Extra Spec are set, the Extra Spec setting is used. This allows for flexibility in setting/overriding the default behavior as needed. | true or false |
VMware API driver | vmware_adaptertype | The virtual SCSI or IDE controller used by the hypervisor. | lsiLogic, lsiLogicsas, busLogic, ide, or paraVirtual. |
VMware API driver | vmware_ostype | A VMware GuestID which describes the operating system installed in the image. This value is passed to the hypervisor when creating a virtual machine. If not specified, the key defaults to otherGuest. | See thinkvirt.com. |
VMware API driver | vmware_image_version | Currently unused. | 1 |
XenAPI driver | auto_disk_config | If true, the root partition on the disk is automatically resized before the instance boots. This value is only taken into account by the Compute service when using a Xen-based hypervisor with the XenAPI driver. The Compute service will only attempt to resize if there is a single partition on the image, and only if the partition is in ext3 or ext4 format. | true or false |
XenAPI driver | os_type | The operating system installed on the image. The XenAPI driver contains logic that takes different actions depending on the value of the os_type parameter of the image. For example, for os_type=windows images, it creates a FAT32-based swap partition instead of a Linux swap partition, and it limits the injected host name to less than 16 characters. | linux or windows. |
Except where otherwise noted, this document is licensed under Creative Commons Attribution 3.0 License. See all OpenStack Legal Documents.