Verifying the Image Service Installation

To validate the Image service client is installed, enter glance help at the command line.

Obtain a test image.

mkdir /tmp/images
    cd /tmp/images/
    wget  http://download.cirros-cloud.net/0.3.1/cirros-0.3.1-x86_64-disk.img 

Upload the kernel.

[Note]Note

This example shows inputting --os-username, --os-password, --os-tenant-name, --os-auth-url on the command line for reference. You could also use the OS_* environment variables by setting them in an openrc file:

export OS_USERNAME=admin
export OS_TENANT_NAME=demo
export OS_PASSWORD=secrete
export OS_AUTH_URL=http://192.168.206.130:5000/v2.0/
export OS_REGION_NAME=RegionOne

Then you would source these environment variables by running source openrc.

glance --os-username=admin --os-password=secrete --os-tenant-name=demo --os-auth-url=http://192.168.206.130:5000/v2.0 \
image-create \
--name="Cirros 0.3.1" \
--disk-format=qcow2 \
--container-format bare < cirros-0.3.1-x86_64-disk.img
+------------------+--------------------------------------+
| Property         | Value                                |
+------------------+--------------------------------------+
| checksum         | d972013792949d0d3ba628fbe8685bce     |
| container_format | bare                                 |
| created_at       | 2013-05-08T18:59:18                  |
| deleted          | False                                |
| deleted_at       | None                                 |
| disk_format      | qcow2                                |
| id               | acafc7c0-40aa-4026-9673-b879898e1fc2 |
| is_public        | False                                |
| min_disk         | 0                                    |
| min_ram          | 0                                    |
| name             | Cirros 0.3.1                         |
| owner            | efa984b0a914450e9a47788ad330699d     |
| protected        | False                                |
| size             | 13147648                             |
| status           | active                               |
| updated_at       | 2013-05-08T18:59:18                  |
+------------------+--------------------------------------+

Now a glance image-list should show these image IDs.

glance --os-username=admin --os-password=secrete --os-tenant-name=demo --os-auth-url=http://192.168.206.130:5000/v2.0 image-list
+--------------------------------------+---------------------------------+-------------+------------------+----------+--------+
| ID                                   | Name                            | Disk Format | Container Format | Size     | Status |
+--------------------------------------+---------------------------------+-------------+------------------+----------+--------+
| acafc7c0-40aa-4026-9673-b879898e1fc2 | Cirros 0.3.1                    | qcow2       | bare             | 13147648 | active |
| 10ccdf86-e59e-41ac-ab41-65af91ea7a9c | cirros-0.3.0-x86_64-uec         | ami         | ami              | 25165824 | active |
| 8473f43f-cd1f-47cc-8d88-ccd9a62e566f | cirros-0.3.0-x86_64-uec-kernel  | aki         | aki              | 4731440  | active |
| 75c1bb27-a406-462c-a379-913e4e6221c9 | cirros-0.3.0-x86_64-uec-ramdisk | ari         | ari              | 2254249  | active |
+--------------------------------------+---------------------------------+-------------+------------------+----------+--------+

loading table of contents...