OpenStack Image Management with Glance

OpenStack Image Management with Glance

Glance is responsible for disk image and snapshot management.  It can be used to create and modify custom images that will be available when deploying Cloud or Baremetal servers within the Agile environment. Glance can be found in the Image section of the Horizon dashboard. See OpenStack’s documentation for more details: http://docs.openstack.org/developer/glance/

Notes:

  • Glance images can be used for every OpenStack server types (AgileCLOUD, AgileSERVER, Dedicated server,…)
  • Customer images must be uploaded to each region manually, since images are not global to the account nor is replication between Agile regions currently available.
  • Before you can start using Glance, you will need to install the OpenStack Command Line Interface tools

Here are some sample commands for the use of Glance:

  • Just like with any other OpenStack CLI tools, you can refer to the help feature for further assistance and guidance with Glance’s usage by running glance help
$ glance help
  • List the available images in your account with glance image-list
$ glance image-list
+--------------------------------------+-------------------------------------+
| ID                                   | Name                                |
+--------------------------------------+-------------------------------------+
| a2db0d30-d25e-464d-89e6-785e4b53e032 | CentOS 6                            |
| fda8c0ef-6588-4411-8d5b-441ccce81d18 | CentOS 7                            |
| 7b7d7f09-1cae-4c3a-aa7b-fa2638b503de | Debian 7 (Wheezy)                   |
| 7fe2ab97-b7a4-45fe-be6f-5ad9b17a3fcb | Debian 8 (Jessie)                   |
| d4bbe079-ce8b-43db-94b4-72387dd03638 | ESXi 6.0 U2                         |
| 93248db3-59fd-4661-86b1-6ab28001d5f9 | Ubuntu 12.04 LTS (Precise Pangolin) |
| 55c3d66b-ad38-470e-b745-d3f9118279ae | Ubuntu 14.04 LTS (Trusty Tahr)      |
| 95fcb1a2-9af0-4254-a3eb-c0827da4be00 | Ubuntu 16.04 LTS (Xenial Xerus)     |
| b1b4cf23-f963-47ed-b3d6-faf0f757d131 | Windows Server 2012 R2              |
+--------------------------------------+-------------------------------------+
  • Show the complete details of a specific image with glance image-show image_uuid
$ glance image-show 95fcb1a2-9af0-4254-a3eb-c0827da4be00
+------------------+--------------------------------------+
| Property         | Value                                |
+------------------+--------------------------------------+
| architecture     | x86_64                               |
| build_version    | 9                                    |
| checksum         | 7c5876290001f5b44a101a5d5e987b8e     |
| container_format | bare                                 |
| created_at       | 2016-08-30T00:25:37Z                 |
| disk_format      | qcow2                                |
| distro           | ubuntu                               |
| id               | 95fcb1a2-9af0-4254-a3eb-c0827da4be00 |
| iweb__1__visible | 1                                    |
| min_disk         | 10                                   |
| min_ram          | 256                                  |
| name             | Ubuntu 16.04 LTS (Xenial Xerus)      |
| os_type          | linux                                |
| owner            | b89d3a2aafd74370a5ba516477ab18fb     |
| protected        | False                                |
| size             | 1017062400                           |
| status           | active                               |
| tags             | []                                   |
| updated_at       | 2016-08-30T00:30:00Z                 |
| version          | 16.04                                |
| virtual_size     | None                                 |
| visibility       | public                               |
+------------------+--------------------------------------+
  • Upload an image with glance image-create … (see help for all the options list)
$ glance image-create --name Fedora_image --container-format bare --disk-format qcow2 < Fedora-Cloud-Base-24-1.2.x86_64.qcow2
+------------------+--------------------------------------+
| Property         | Value                                |
+------------------+--------------------------------------+
| checksum         | None                                 |
| container_format | bare                                 |
| created_at       | 2016-09-01T16:43:47Z                 |
| disk_format      | qcow2                                |
| id               | 9816abed-883a-4f0e-9643-62d6453954cb |
| min_disk         | 0                                    |
| min_ram          | 0                                    |
| name             | Fedora_image                         |
| owner            | ecc8b566306f4c3bb384fa218edca862     |
| protected        | False                                |
| size             | None                                 |
| status           | queued                               |
| tags             | []                                   |
| updated_at       | 2016-09-01T16:43:47Z                 |
| virtual_size     | None                                 |
| visibility       | private                              |
+------------------+--------------------------------------+
  • Delete an image with glance image-delete image_uuid
$ glance image-delete 9816abed-883a-4f0e-9643-62d6453954cb