Chapter 3. Understanding Glance

Glance is the newest OpenStack service. First debuting in the Bexar release, Glance provides a catalog service for storing and querying virtual disk images. Glance has been designed to be a standalone service for those needing to organize large sets of virtual disk images. However, when used along with Nova and Swift, it provides an end-to-end solution for cloud disk image management.

There are three pieces to Glance architecture: glance-api, glance-registry, and the image store. As you can probably guess, glance-api accepts API calls, much like nova-api, and the actual image blobs are placed in the image store. The glance-registry stores and retrieves metadata about images. The image store can be a number of different object stores, including Swift. Figure 3-1 illustrates Glance’s logical architecture.

glance-api is similar in functionality to nova-api, in that it accepts incoming API requests and then communicates with the other components (glance-registry and the image store) to facilitate querying, retrieving, uploading, or deleting images. By default, glance-api listens on port 9292.

The glance-registry process stores and retrieves metadata about images. The version that ships with Glance is only considered a reference implementation, as most large installations will want a customized version for their service. The reference version uses sqlite3 to store the metadata and the Glance API for communications. By default, glance-registry listens on port 9191.

The Glance database contains only two tables: Image and Image Property. The image table represents the image in the datastore (disk format, container format, size, etc.), while the Image Property table contains custom image metadata. While the image representation and image metadata is stored in the database, the actual images are stored in image stores.

Image stores are the storage places for the virtual disk image and come in a number of different options. The currently supported image stores are shown in Table 3-1.

Each of these options have their own strengths and weaknesses. However, most large installations will use Swift, while smaller installations will probably gravitate to the simplicity of the filesystem option with a shared NFS server. The S3 or HTTP image stores are probably only useful for referencing publicly available images.

With this overview of Glance, it should now be clear how Glance provides the “glue” between Swift and Nova. Figure 3-2 shows the interactions between OpenStack projects for virtual disk image storage and retrieval.