# Deploying an OpenStack Cloud Environment

When you think of on-premise Software-Defined Data Center (SDDC) solutions, the first option that really comes to mind is VMware vSphere. vSphere is an encompassing term that includes several other VMware technologies to provide an infrastructure for virtualization. I personally enjoy working with a VMware vSphere environment. However, there are other competing platforms out in today's marketplace.  Today we're going to look at OpenStack.

### What is OpenStack?

[OpenStack](https://www.openstack.org/) is an open-source cloud computing platform that can be used to manage distributed computing, network, and storage resources. You can use OpenStack to build private and public clouds. Resources can be managed through a dashboard, giving administrators control while empowering users to provision resources through a web interface. 

![OpenStack Overview](https://cdn.hashnode.com/res/hashnode/image/upload/v1645330216885/8oGbBnZmN.png)

OpenStack is also fully open-source meaning there are no licensing costs.  It is available under the Apache License which means that it can be used free of charge. Even if deployed within one of the available distributions, vendors must not add any additional licensing costs (ref [OpenStack vs VMware: Bringing costs down](https://ubuntu.com/blog/openstack-vs-vmware)).  However, OpenStack is also not just a simple technology that you install and use. It has a certain degree of complexity and takes time to fully understand and maximize utilization. Organizations, like [Canonical](https://ubuntu.com/openstack) and [Red Hat](https://www.redhat.com/en/resources/openstack-platform-subscription-overview),  provide professional services and support to help manage your OpenStack environment.

### How to use OpenStack?
Today I will be demonstrating how to deploy and configure an OpenStack cloud.  However, I will be utilizing [MicroStack](https://microstack.run/). MicroStack is a micro cloud platform based on OpenStack, designed for the edge and small-scale data center deployments, that can be installed and maintained with minimal effort.  Canonical provides [easy-to-understand tutorials](https://ubuntu.com/openstack/tutorials) to learn more about OpenStack. (For this demonstration, I used [these installation instructions](https://ubuntu.com/openstack/install) versus the one in the tutorials.  But they are the same instructions. 

### Create the VM

The first requirements are to have a physical machine to work on. The tutorial's requirements are as follows:

- The latest Ubuntu LTS installed.

- Multi-core CPU

- 8 GB of RAM

- 100 GB of storage

In fact, I'm just going to create a virtual machine in VMware Workstation Pro.  Something like this should be perfect for this demonstration:

![OpenStack VM on Ubuntu](https://cdn.hashnode.com/res/hashnode/image/upload/v1645387072723/JjW13eD2v.png)

### MicroStack Deployment

If you [follow along in the tutorial](https://ubuntu.com/tutorials/install-openstack-on-your-workstation-and-launch-your-first-instance#2-install-openstack), the commands are pretty simple. 

First, execute the following command to install the MicroStack snap:

``` sudo snap install microstack --devmode --beta``` 

When the installation process has finished, I will view information on the installed snap by entering the command: :

```snap list microstack``` 

*Looking good so far!*
![Install MicroStack snap](https://cdn.hashnode.com/res/hashnode/image/upload/v1645387323424/9wP5WL6wO.png)

### Initialization

I will then initialize MicroStack.  According to the [documentation](https://ubuntu.com/openstack/install), this will "automatically deploy, configures, and starts OpenStack services. In particular, it will create the database, networks, an image, several flavors, and ICMP/SSH security groups."  The command I will use is:

```sudo microstack init --auto --control``` 

Apparently, this can take quite a bit of time depending on your system. 

![MicroStack Initialization](https://cdn.hashnode.com/res/hashnode/image/upload/v1645389289892/N2m089h_4.png)

### Verification
Once the initialization is finished, you can run a few commands to check functionality.  The standard OpenStack client comes pre-installed and is invoked like so:

```microstack.openstack <command>``` 

To list the default image, run:

```microstack.openstack image list``` 

To get the default list of flavors:

```microstack.openstack flavor list``` 

![MicroStack Image and Flavor List](https://cdn.hashnode.com/res/hashnode/image/upload/v1645390979461/4n4vxrquv.png)

*Now we are getting somewhere!*

### Create an Instance
I will now create an instance (virtual machine) named 'test' based on the 'cirros' image. CirrOS is a minimal Linux distribution that was designed for use as a test image on clouds such as OpenStack Compute. You can download a CirrOS image in various formats from the  [CirrOS download page](http://download.cirros-cloud.net/)  I will use the command: 

```microstack launch cirros -name test```

![MicroStack launch cirrOS](https://cdn.hashnode.com/res/hashnode/image/upload/v1645398071334/Zqws0NQL_g.png)

Now I will connect to the instance via ssh using the generated ssh keys that were shown in the output.  *(I just copied the command from the resulting output from creating the instance.)*

![Connecting to Test instance via ssh](https://cdn.hashnode.com/res/hashnode/image/upload/v1645398748759/DmvtagK3N.png)

I then typed in ```ip a``` to get a quick status of the networking.  


### Access the Cloud Dashboard
*Now for the fun stuff!*

To access the OpenStack (MicroStack) Cloud Dashboard, I need to open a browser with the IP address of the virtual machine running MicroStack.   So let me browse over to the IP address.

![OpenStack Coud Dashboard](https://cdn.hashnode.com/res/hashnode/image/upload/v1645399221239/7-VBCueT3.png)

Now I need a username and password.  The tutorial states that the username is *admin*, but I also need to generate a password from the terminal console. The password is obtained by entering the command:

```sudo snap get microstack config.credentials.keystone-password``` 

![Generate OpenStack Admin Password](https://cdn.hashnode.com/res/hashnode/image/upload/v1645399170021/Zzdaf0vkv.png)

Now I need to enter the username *admin* and generated password into the console.

![OpenStack Login](https://cdn.hashnode.com/res/hashnode/image/upload/v1645399354877/5Nxk0yqVM.png)

And I can now look at my entire OpenStack environment on a Cloud Dashboard.

![OpenStack Cloud Dashboard](https://cdn.hashnode.com/res/hashnode/image/upload/v1645399440824/kXXtot_so.png)

If I select *Instances*  I should be able to see the *test* instance that we created in the terminal. 

![Test Instance Cloud Dashboard](https://cdn.hashnode.com/res/hashnode/image/upload/v1645399536959/OTkKe8rzS.png)

### Where to go from here?
Now that you have your MicroStack environment deployed, you can get started with the basics of OpenStack by going through the [OpenStack Tutorials](https://ubuntu.com/openstack/tutorials) by Canonical.  

Create your own micro cloud environment and have some fun!

There is even an [OpenStack Cheat Sheet](https://assets.ubuntu.com/v1/8d3130a1-OpenStack.cheat.sheet.1.pdf) should you need it.  I'm pretty sure you will if you're new to OpenStack. 

Thank you for your time during this tutorial/demonstration.  Please feel free to leave any comments below!














