Using OpenStack Compute

  • (4.0)
  • | 810 Ratings

OpenStack controls large pools of compute. It is used to host and manage cloud computing systems. OpenStack compute is also the major part of Infrastructure-as-a-service (IaaS).
OpenStack Compute interacts with OpenStack Identity for authentication, OpenStack Image Service for disk and server images, and OpenStack dashboard for the user and administrative interface. OpenStack Compute can scale horizontally on standard hardware, and download images to launch instances.
OpenStack Identity Service underpins all of the OpenStack services. The OpenStack Image Service is configured to use OpenStack Identity Service, then OpenStack Compute environment can now be used.
After configuring compute service on the controller node, you must configure another system as a compute node. The compute service relies on a hypervisor to run virtual machine instances.

To gain in-depth knowledge and be on par with practical experience, then explore  OpenStack Training course.

Getting started

To begin with, log into an Ubuntu client and assure that Nova Client is available. Nova is an OpenStack project designed to provide power massively scalable, on demand, self service access to compute resources and also produces virtual servers on demand.
If it isn’t, it can be installed as follows:
sudo apt-get update
sudo apt-get -y python-novaclient

How to achieve it…

To use OpenStack Identity Service as the authentication mechanism in our OpenStack environment, we need to set our environment variables accordingly. This is achieved as follows, for our demo user:
1. With the Nova Client installed, we use them by configuring our environment with the appropriate environment variables. We do this as follows:
export OS_TENANT_NAME=cookbook
export OS_USERNAME=demo
export OS_PASSWORD=openstack
export OS_AUTH_URL=
export OS_NO_CACHE=1


Add these to a file called novarc in your home area. We can then source these credentials, each time by simply executing:
. novarc
Note that if the user credential environment variables have been set in a shell that has the SERVICE_TOKEN and SERVICE_ENDPOINT environment variables, these will override our user credentials set in this step. Unset the and variables before continuing.
2. To access any Linux instances that we launch, we must create a keypair that allows us to access our Cloud instance. Keypairs are SSH private and public key combinations that together allow you to access a resource. You keep the private portion safe, but you’re able to give the public key to anyone or any computer without fear or compromise to your security, but only your private portion will match enabling you to beauauthorized. Cloud instances rely on keypairs for access. We create a keypair using Nova Client with the following commands:
nova keypair-add demo > demo.pem chmod 0600 *.pem
3. We can test that this is successful by issuing some nova commands, for example:
nova list
nova credentials

Explore OpenStack Sample Resumes! Download & Edit, Get Noticed by Top Employers!  Download Now!

How it works…

Configuring our environment to use OpenStack Identity Service for authentication for Nova Client so that launching our instances involves manually creating an environment resource file with the appropriate environment variables.
Our environment passes on our username, password and tenant to OpenStack Identity Service for authentication and passes back, behind the scenes, an appropriate token, which validates our user. This then allows us to seamlessly spin up instances within our tenancy (project) of cookbook.

Related Pages:
Openstack Tutorial

Interview Questions:
Openstack Interview Questions

Subscribe For Free Demo

Free Demo for Corporate & Online Trainings. Protection Status