Discover OpenStack: The Compute components Glance and Nova

This article presents the OpenStack Compute (Nova) and Image (Glance) projects, explains how they fit into the overall OpenStack architecture, and shows how they operate. It illustrates these projects with insight into what it takes to install, configure, and use the components.

Share:

John Rhoton (john.rhoton@gmail.com), Cloud Computing Strategist, Recursive

Author photoJohn Rhoton is a technology strategist specializing in consulting to global enterprise customers, with a focus on public, private, and hybrid cloud computing. He speaks regularly at industry events on emerging technologies such as mobility, social networking, and virtualization and is the author of seven books, including Cloud Computing Explained (2009) and Cloud Computing Architected (2011).



02 December 2013

Also available in Chinese Russian Japanese

This article describes OpenStack Compute (Nova), which represents the core of any workload. Even though there are cloud services that work without computation, at best they represent static storage — all dynamic activity involves some element of computation.

The name OpenStack Compute refers to a specific project, also called Nova, but there are really two projects that relate to computation and the software that runs it — Image and Compute:

  • OpenStack Image manages static disk images which contain the executable code as well as the operating environment.
  • OpenStack Compute (Nova) manages the running instances.

Nova controls the cloud computing fabric and as such forms the core of an infrastructure service. Nova is also the most complex component of the OpenStack family, primarily because of its highly distributed nature and numerous processes.

Nova interfaces with several other OpenStack services: It uses Keystone to perform its authentication, Horizon as its administrative interface, and Glance to supply its images. The tightest interaction is with Glance which Nova requires to download images for use in launching images.

Before going into more detail on Nova, let's take a closer look at the Image service, which, chronologically, represents the beginning of the Compute workload. Glance is the project name for the OpenStack Image Service which registers, lists, and retrieves virtual machine (VM) images.

Glance manages the images in an OpenStack cluster but is not responsible for the actual storage. It provides an abstraction to multiple storage technologies ranging from simple file systems to object storage systems, such as the OpenStack Swift project. Along with the actual disk images, it holds metadata and status information describing the image.

The OpenStack Image Store is a central repository for virtual images. Users and other projects can store both public and private images which they can access to launch instances. They can request a list of available images, retrieve their configuration information, and then use them as a basis for starting Nova instances. It is also possible to take snapshots from running instances as a means of backing up the VMs and their states.

Nova comes into action after the image is created. It typically uses an image to launch an instance, or VM. Although it does not include any virtualization software itself, it can integrate with many common hypervisors through drivers that interface with the virtualization technologies.

From a practical perspective, launching an instance involves identifying and specifying the virtual hardware templates (called flavors in OpenStack). The templates describe the compute (virtual CPUs), memory (RAM), and storage configuration (hard disks) to be assigned to the VM instances. The default installation provides five flavors which are configurable by administrators.

Nova then schedules the requested instance by assigning execution to a specific compute node (called a host in OpenStack). Each system must regularly report its status and capabilities tonova-scheduler which uses the data to optimize its allocations.

The whole assignment process consists of two phases. The Filtering phase applies a set of filters to generate a list of the most suitable hosts. Every OpenStack service publishes its capabilities which is one of the most important considerations. The scheduler narrows the selection of hosts to meet the parameters of the request. A Weighting phase then uses a special function to calculate the cost of each host and sorts the results. The output of this phase is a list of hosts that can satisfy the user's request for a given number of instances with the least cost.

Nova also carries out several additional functions, many of which interact closely with other OpenStack projects covering networking, security, and administration. But Nova generally handles the instance-specific aspects of these, such as attaching and detaching storage, assigning IP addresses, or taking snapshots of running instances.

Architecture

Nova uses a shared-nothing architecture (Figure 1), so that all major components can be run on separate servers. The distributed design relies on a message queue to handle the asynchronous component-to-component communications.

Figure 1. Nova architecture
Image showing the Nova architecture

Nova stores states of VMs in a central Structured Query Language (SQL)-based database that all OpenStack components use. This database holds details of available instance types, networks (if nova-network is in use), and projects. Any database that SQLAlchemy supports can be used.

Web dashboard

The primary user interface to OpenStack Compute is the Web dashboard (OpenStack Horizon). This central portal for all OpenStack modules presents a graphic interface of all the projects and makes application programming interface (API) calls to invoke any requested services.

Try it!

Self-service IaaS SoftLayer infrastructure trial

API

The API is based on Representational State Transfer. It's a Web Server Gateway Interface application that routes uniform resource indicators to action methods on controller classes. The API receives HTTP requests, processes the commands, and then delegates the task to other components via the message queue or HTTP (in the case of the ObjectStore). The Nova API supports the OpenStack Compute API, the Amazon Elastic Compute Cloud (Amazon EC2) API, and an Admin API for privileged users. It initiates most orchestration activities and policies (like Quota).

Authorization Manager

Each HTTP request requires specific authentication credentials using one of the authentication schemes the provider has configured for the Compute node. The Authorization Manager is not a separate binary; rather, it is a Python class that any OpenStack component can use for authentication. It exposes authorized APIs usage for users, projects, and roles and communicates with OpenStack Keystone for details. The actual user store can be a database or Lightweight Directory Access Protocol (LDAP) back end.

ObjectStore

The ObjectStore is a simple HTTP-based object-based storage (like Amazon Simple Storage Service) for images. It can be and usually is replaced with OpenStack Glance.

Message queue

The message queue provides a means for all of the components in OpenStack Nova to communicate and coordinate with each other. It's like a central task list that all Nova components share and update.

All of these components run in a nonblocking message-based architecture and can be run from the same or different hosts as long as they use the same message queue service. They interact in a callback-oriented manner using the Advanced Message Queuing Protocol. By default, most distributions implement RabbitMQ accessed via the Kombu library, but plug-ins are also available for Apache Qpid and ZeroMQ.

Nova components use remote procedure call to communicate with each other via the Message Broker using Pub/sub. More technically, Nova implements rpc.call (request/response; the API acts as consumer) and rpc.cast (one way; the API acts as publisher).

Nova API and the scheduler use the message queue as the Invoker, whereas Network and Compute act as workers. An Invoker sends messages via rpc.call or rpc.cast. The Worker pattern receives messages from the queue and answers each rpc.call with the appropriate response.

Daemons

The two main daemons to consider for Nova are the scheduler and compute daemons. The scheduler decides which compute host to allot for a VM request. It uses the filtering and scheduling algorithms described above and considers a variety of parameters, including affinity (co-locating related workloads), anti-affinity (distributing workloads), availability zone, core CPU utilization, system RAM, and custom JavaScript Object Notation schedules. Note that it makes this decision at provisioning time only and does not redistribute running instances.

Nova compute is a worker daemon that manages communication with the hypervisors and VMs. It retrieves its orders from the message queue and performs VM create and delete tasks using the hypervisor's API. It also updates the status of its tasks in the central database.

For the sake of completeness, some daemons cover functionality originally assigned to Nova that is slowly moving to other projects. The Network Manager administers IP forwarding, network bridges, and virtual LANs. It is a worker daemon picking network-related tasks from message queue. These functions are now also covered by OpenStack Neutron which can be selected in its place.

The Volume Manager handles attach and detach of persistent block storage volumes to VMs (similar to Amazon Elastic Block Store). This functionality has been extracted to OpenStack Cinder. It's an iSCSI solution that uses Logical Volume Manager.


Setting it up

The actual installation instructions vary greatly between distributions and OpenStack releases. Generally, they are available as part of the distribution. Nonetheless, you must complete the same basic tasks. This section gives you an idea of what's involved.

System requirements

OpenStack relies on a 64-bit x86 architecture; otherwise, it is designed for commodity hardware, so the minimal system requirements are modest. It is possible to run the entire suite of OpenStack projects on a single system with 8GB of RAM, but for any serious work, the official recommendation is for the cloud controller node that runs the network, volume, API, scheduler, and image services to have at least 12GB of RAM, two 2TB disks, and a network adapter. Compute nodes (running the virtual instances) will vary much more in terms of their load, but a good starting point for a simple system is a quad-core CPU, 32GB of RAM, and 2Gbit network adapters.

Installation

The installation instructions depend on the distribution and, more specifically, on the package-management utility you select. In many cases, it's necessary to declare the repository. So, for example, in the case of Zypper, you announce to libzypp with zypper ar:

Click to see code listing

# zypper ar -f http://download.opensuse.org/repositories/Cloud:/OpenStack:/Grizzly/SLE_11_SP3/Cloud:OpenStack:Grizzly.repo

You then install the required Nova packages on both the controller and compute nodes. The package-management utility should automatically install any dependencies.

For the purpose of illustration, I have provided the primary commands for Ubuntu, Red Hat (Red Hat Enterprise Linux®, CentOS, Fedora), and openSUSE:

  • Ubuntu: On the controller node, run:

    Click to see code listing

    sudo apt-get install nova-novncproxy novnc nova-api nova-ajax-console-proxy nova-cert nova-conductor nova-consoleauth nova-doc nova-scheduler nova-network

    On the compute node, run:

    sudo apt-get install nova-compute nova-network
    sudo apt-get install glance
  • Red Hat: Run the following command:
    sudo yum install openstack-nova 
    sudo yum install openstack-glance
  • openSUSE: Run the following command:
    sudo zypper install openstack-nova openstack-glance

Configuration

Nova configuration involves several files, but the most important is nova.conf, which is installed in /etc/nova. A default set of options works fine for a standard installation, but you will need to edit the configuration for any special requirements. You can examine the nova.conf file format here and see a list of nova.conf configuration options here.


Usage scenario

To get an idea of how OpenStack Compute might be used in practice, imagine that you have a base image that you would like to launch in OpenStack. After configuring the system and making some personalized customizations, you may want to take a snapshot of the running instance so that you can accelerate the provisioning process to execute the same task again. After you have completed the project, you might want to stop the instance. You may even want to delete the image.

  1. Log in to the OpenStack Dashboard as a user with a Member role.
  2. In the navigation pane, beneath Manage Compute, click Images & Snapshots, then click Create Image. The Create An Image window opens (Figure 2) in which you can configure the settings that define your instance.
  3. Enter a name and location for the image that you have previously created or downloaded. You need to specify the format of the image file, but there is no need to indicate the minimum disk size or RAM unless you want to supply them.
    Figure 2. Create an image
    Image showing the Create An Image window
  4. After creating the image, beneath Manage Compute, click Instances, and then click Launch Instance.
    Figure 3. Launch an instance
    Image showing the Launch Instance window
  5. A window confirms your configuration and allows you to specify the required Flavor, or basic hardware configuration. Click Launch; the instance should be up and running.
  6. Consider taking a snapshot. Again, beneath Manage Compute, click Instances, and then click Create Snapshot in the row associated with the instance of interest.
    Figure 4. Instances
    Image showing the Instances window

    Click to see larger image

    Figure 4. Instances

    Image showing the Instances window

    Other tasks you can execute from this window include editing, pausing, suspending, and rebooting the instance. It is also the place to go to terminate the instance after you have finished using it.

  7. To delete the image and any snapshots, go back to the Images & Snapshots menu where you have the option to delete the objects you no longer need.
Figure 5. Images and snapshots
Image showing the Images & Shapshots window

Click to see larger image

Figure 5. Images and snapshots

Image showing the Images & Shapshots window

Conclusion

That's all it takes to get started with the OpenStack Compute functionality. The main point to remember as you plan and deploy your compute workloads using OpenStack is that it is not a virtualization platform but a management abstraction that allows you to orchestrate workflows across multiple hypervisors using a variety of pluggable technologies. OpenStack merely simplifies the management and integration of these components.

Resources

Learn

Get products and technologies

Discuss

  • Get involved in the developerWorks Community. Connect with other developerWorks users while you explore developer-driven blogs, forums, groups, and wikis.

Comments

developerWorks: Sign in

Required fields are indicated with an asterisk (*).


Need an IBM ID?
Forgot your IBM ID?


Forgot your password?
Change your password

By clicking Submit, you agree to the developerWorks terms of use.

 


The first time you sign into developerWorks, a profile is created for you. Information in your profile (your name, country/region, and company name) is displayed to the public and will accompany any content you post, unless you opt to hide your company name. You may update your IBM account at any time.

All information submitted is secure.

Choose your display name



The first time you sign in to developerWorks, a profile is created for you, so you need to choose a display name. Your display name accompanies the content you post on developerWorks.

Please choose a display name between 3-31 characters. Your display name must be unique in the developerWorks community and should not be your email address for privacy reasons.

Required fields are indicated with an asterisk (*).

(Must be between 3 – 31 characters.)

By clicking Submit, you agree to the developerWorks terms of use.

 


All information submitted is secure.

Dig deeper into Cloud computing on developerWorks


  • Bluemix Developers Community

    Get samples, articles, product docs, and community resources to help build, deploy, and manage your cloud apps.

  • developerWorks Labs

    Experiment with new directions in software development.

  • DevOps Services

    Software development in the cloud. Register today to create a project.

  • Try SoftLayer Cloud

    Deploy public cloud instances in as few as 5 minutes. Try the SoftLayer public cloud instance for one month.

static.content.url=http://www.ibm.com/developerworks/js/artrating/
SITE_ID=1
Zone=Cloud computing
ArticleID=953909
ArticleTitle=Discover OpenStack: The Compute components Glance and Nova
publish-date=12022013