Wednesday, November 5, 2014

OpenStack Series: Part 5 – Glance – Image Service


OpenStack Image Service offers retrieval, storage, and metadata assignment for the images used by Nova.

OpenStack Object Storage allows users to store and retrieve images through a simple Web Service (ReST: Representational State Transfer) interface.

Glance works hand in hand with Nova to provide support for virtual machine provisioning.  It also has interaction with Keystone for API authentication.

image source: http://ilearnstack.files.wordpress.com/2013/04/glance.png


In "Introduction to OpenStack" - Glance provides discovery, registration and delivery services for disk and server images. List of processes and their functions:
  • glance-api :  It accepts Image API calls for image discovery, image retrieval and image storage.
  • glance-registry : it stores, processes and retrieves metadata about images (size, type, etc.).
  • glance database : A database to store the image metadata.
  • A storage repository for the actual image files. Glance supports normal filesystems, RADOS block devices, Amazon S3, HTTP and Swift.
Glance accepts API requests for images (or image metadata) from end users or Nova components and can store its disk files in the object storage service, Swift or other storage repository.

A more comprehensive list of disk and container format supported int he storage repository can be found here:

Disk Format

The disk format of a virtual machine image is the format of the underlying disk image. Virtual appliance vendors have different formats for laying out the information contained in a virtual machine disk image.

You can set your image’s disk format to one of the following:
  • raw
    This is an unstructured disk image format
  • vhd
    This is the VHD disk format, a common disk format used by virtual machine monitors from VMWare, Xen, Microsoft, VirtualBox, and others
  • vmdk
    Another common disk format supported by many common virtual machine monitors
  • vdi
    A disk format supported by VirtualBox virtual machine monitor and the QEMU emulator
  • iso
    An archive format for the data contents of an optical disc (e.g. CDROM).
  • qcow2
    A disk format supported by the QEMU emulator that can expand dynamically and supports Copy on Write
  • aki
    This indicates what is stored in Glance is an Amazon kernel image
  • ari
    This indicates what is stored in Glance is an Amazon ramdisk image
  • ami
    This indicates what is stored in Glance is an Amazon machine image

Container Format

The container format refers to whether the virtual machine image is in a file format that also contains metadata about the actual virtual machine.

You can set your image’s container format to one of the following:
  • bare
    This indicates there is no container or metadata envelope for the image
  • ovf
    This is the OVF container format
  • aki
    This indicates what is stored in Glance is an Amazon kernel image
  • ari
    This indicates what is stored in Glance is an Amazon ramdisk image
  • ami
    This indicates what is stored in Glance is an Amazon machine image
  • ova
    This indicates what is stored in Glance is an OVA tar archive file
New in Juno release for Glance is the Metadata Definition Service in which data properties are stored.

oVirt integration with Glance

oVirt (Open Virtualization Manager) from Red Hat has a project to allow oVirt users to consume (use), export and share images with Glance. Glance is acting as the External Provider for oVirt 3.3

Besides importing and exporting images to Glance, this oVirt integration allows oVirt to perform image discovery and list out the content of Glance on oVirt's GUI.


image source: http://blog.antoni.me/oVirt2014/png/discovery_glance_provider_small.png

Another good feature from this oVirt integration with Glance is that oVirt can "discover" the size of the QCOW2 image by looking into the QCOW2 header.  Glance metadata does not provide the size of the image.

Glance API

API has an important role in Glance for image processing.  Check here for a deeper discussion of the Glance API.

There are 2 versions of Glance API - version 1 and version 2. Glance API version 2 provides standardization of some custom properties of the image.

Glance depends on Keystone and the OpenStack Identity API to handle authentication of clients. You must obtain an authentication token from Keystone using and send it along with all API requests to Glance through the X-Auth-Token header. Glance will communicate back to Keystone to verify the token validity and obtain your identity credentials.

Related Post:
OpenStack Series Part 1: How do you look at OpenStack?
OpenStack Series Part 2: What's new in the Juno Release?
OpenStack Series Part 3: Keystone - Identity Service
OpenStack Series Part 4: Nova - Compute Service
OpenStack Series Part 6: Cinder - Block Storage Service
OpenStack Series Part 7: Swift - Object Storage Service
OpenStack Series Part 8: Neutron - Networking Service  
OpenStack Series Part 9: Horizon - a web based UI Service
OpenStack Series Part 10: Heat - Orchestration Service 
OpenStack Series Part 11: Ceilometer - Monitoring and Metering Service
OpenStack Series Part 12: Trove - Database Service
OpenStack Series Part 13: Docker in OpenStack
OpenStack Series Part 14: Sahara - Data Processing Service
OpenStack Series part 15: Messaging and Queuing System in OpenStack
OpenStack Series Part 16: Ceph in OpenStack
OpenStack Series Part 17: Congress - Policy Service  
OpenStack Series Part 18: Network Function Virtualization in OpenStack

OpenStack Series Part 19: Storage Polices for Object Storage
OpenStack Series Part 20: Group-based Policy for Neutron
Reference:
"Introduction to Openstack." ILearnStack. N.p., n.d. Web. 05 Nov. 2014.
"OpenStack." Disk and Container Formats — Glance 2015.1.dev101.gc5d6cad Documentation. N.p., n.d. Web. 05 Nov. 2014.
"Features/Glance Integration." Features/Glance Integration. N.p., n.d. Web. 05 Nov. 2014.
"Home." OVirt. N.p., n.d. Web. 05 Nov. 2014.

3 comments: