Launching an Instance in Openstack!

This blog will guide you step-by-step in the process of spawning an instance in Openstack(Private cloud) through all the ways possible, even with Terraform Integration!

Harshit Dawar
3 min readJul 3, 2020
Openstack portal by Horizon service [Image by Author]

Ever wondered of hosting your own cloud in your own machine or on top of public cloud & launching an instance in it. If yes, then you are in the right place.

In this article, I will guide you on how to spawn an instance in Openstack! But before that let me explain why OpenStack is required?

Why Openstack & its real-world use cases?

  • Openstack is an open-source software that has a very large community to support, and that is the reason why Openstack keeps on evolving.
  • The benefit of using Openstack cloud is that it provides you the code of the services present in it, & they can be customized according to the requirement! This feature is not available in any other public cloud like AWS, GCP, BlueOcean etc.
  • If there is a requirement to store the dataset which is very critical, then a private cloud is required, as we cannot take risk of storing that data in the public cloud!
  • If there are various compliance in various companies, then a private cloud is required.
  • If we want to learn the services in depth then private cloud is the only option because none of the public cloud provides their software, they only provide services.

Spawning an Instance in Openstack!

A small note: before launching any instance or to do any operation, you should be in the demo or admin role in CLI mode.

There are 3 ways available to spawn an instance in Openstack:

Through WebUI: This service of WebUI is provided by the Horizon service in Openstack. Through this service, we can easily launch/spawn an instance in Openstack. The look & feel of this service is presented in the cover image of this article.

This service is very easy to use, that is why I am not covering instance spawning through this service in this article.

Through Command Line Interface (CLI): The service which is used for computing in Openstack is known as “Nova”, this is the service which launches an instance with the help of other services which are “Cinder”, “Glance”, & “Neutron”, they are used for block storage, image management, & network services respectively.

In order to launch the instance using CLI, we have to just use the nova service & mention some of the required things(these things are mentioned in the command below), after which your instance will be ready & active.

The command to launch the instance through CLI is: “nova boot — image <imagename/image id> — flavor <flavor name/ flavor id> — nic net-name=<network name> <Instance Name>”

Command to launch an instance in Openstack through CLI

Launched Instance can be verified by running the command “nova list”, or it can be also verified from WebUI provided by the Horizon service.

Output of nova list command [Image by Author]
Instance creation check using WebUI [Image by Author]

Through Terraform: This is the best approach to do the task, because for once only we have to write the code, & then our complete infrastructure will be ready in just one command.

The Terraform code is been presented in the below Github Gist.

Instance creation through Terraform!

Verification of the instance created or not can be done using both the ways which I illustrated in the instance creation through CLI mode above.

For more information about OpenStack with integration of Terraform, please visit my GitHub Repository & follow me there. Link for the same is given below.

I hope my article explains each and everything related to the instance creation in Openstack through all the ways possible along with the explanation & execution of code. Thank you so much for investing your time in reading my blog & boosting your knowledge!

--

--

Harshit Dawar
Harshit Dawar

Written by Harshit Dawar

Complete AIOPS Expert, have a demonstrated history of delivering large and complex projects. 28x Globally Certified. Rare & authentic content publisher.

Responses (1)