Get started with MicroStack

Overview

Duration: 1:00

What is OpenStack?

OpenStack is a collection of open source projects designed to work together to form the basis of a cloud. OpenStack can be used for both private and public clouds.

What is MicroStack?

MicroStack provides a single or multi-node OpenStack deployment which can run directly on your workstation. Although made for developers to prototype and test, it is also suitable for edge, IoT, and appliances. MicroStack is an OpenStack in a snap which means that all OpenStack services and supporting libraries are packaged together in a single package which can be easily installed, upgraded or removed. MicroStack includes all key OpenStack components: Keystone, Nova, Neutron, Glance, and Cinder.

In this tutorial you will learn how to:

  • Get a single-node OpenStack cloud up and running with MicroStack
  • Interact with OpenStack via the web UI and CLI
  • Launch your first VM on OpenStack and access it

You will need:

  • A machine running Linux, a multi-core processor and at least 8 GB of RAM

MicroStack has been tested on a physical machine running either Ubuntu 18.04 LTS or Ubuntu 20.04 LTS.

Originally authored by Tytus Kurek

Install MicroStack

Duration: 2:00

Install MicroStack from the beta channel:

sudo snap install microstack --devmode --beta

If you are using an older Ubuntu version or some other Linux distribution, you may have to install snapd first. Refer to snapd documentation for more information on installing snapd on your computer.

When the installation process has finished you should see the following message on the terminal:

microstack (beta) ussuri from Canonical✓ installed

Note that at the time of writing this tutorial, the installed version of OpenStack was Ussuri.

Being a snap, MicroStack is published in channels which are made up of a track (or a major version), and an expected level of stability. You can run snap info microstack command to see which versions are currently available.

OpenStack releases
MicroStack snap versions and channels do not correspond to the OpenStack release that will be installed.

Initialise MicroStack

Duration: 15:00

MicroStack needs to be initialised, so that networks and databases get configured. To do this, run:

sudo microstack init --auto --control

Once this completes (15 - 20 minutes) your OpenStack cloud will be up and running!

Interact with OpenStack

Duration: 4:00

Web UI

To interact with your cloud via the web UI visit http://10.20.20.1/.

The password for the admin user can be obtained in this way:

sudo snap get microstack config.credentials.keystone-password

Sample output:

OAEHxLgCBz7Wz4usvolAAt61TrDUz6zz

Type the credentials and press the “Sign In” button:

If everything goes fine you should see the landing page:

You can now start playing with your OpenStack installation (i.e. create additional users, launch instances, etc.).

CLI

You can also interact with your OpenStack cloud via the CLI by using the microstack.openstack command. The syntax is identical to the client delivered by the python-openstackclient package.

For example, to list available OpenStack endpoints run:

microstack.openstack catalog list

You can run microstack.openstack --help to get a list of available subcommands and their required syntax.

Launch and access a VM

Duration: 5:00

Test launch

To launch your first OpenStack instance (VM) called “test” based on the CirrOS image, run the following:

microstack launch cirros --name test

The resulting output provides the information you need to SSH to the instance:

Access it with `ssh -i /home/ubuntu/snap/microstack/common/.ssh/id_microstack cirros@10.20.20.123`

Note that the IP address of the instance may be different in your environment. In order to connect to the instance run the command from the output:

ssh -i /home/ubuntu/snap/microstack/common/.ssh/id_microstack cirros@10.20.20.123

Now that you are connected to the instance you can use normal Linux commands. Note that the CirrOS image provides a minimalist operating system! For example:

$ uptime
 14:51:42 up 4 min,  1 users,  load average: 0.00, 0.00, 0.00

To disconnect from the instance, type exit (or Ctrl-d).

You can also view the instance from the web UI. Go to http://10.20.20.1/ and click on the “Instances” tab on the left:

Next steps

The microstack.openstack command provides the same functionality as the upstream OpenStack client. This means you can use the same commands as on any other OpenStack installation.

MicroStack comes preconfigured with networking, an image, flavors, opened security groups (TCP port 22 and ICMP), and an SSH keypair. Use the above client command to view these things as you normally would. The launch command can even be replaced by the client command (microstack.openstack server create). You will need to handle floating IP addresses manually though.

Learn more by reading the MicroStack documentation. The clustering feature is particularly interesting.

That’s all folks!

Duration: 1:00

Congratulations! You have made it!

You may wish to temporarily disable your MicroStack installation when not in use. To do so, run:

sudo snap disable microstack

To re-enable it, run:

sudo snap enable microstack

Where to go from here?

i have this error and i cant reach the instance: ssh: connect to host 10.20.20.247 port 22: No route to host
on ubuntu18 vm

Many of the other simple OpenStack deployers (Packstack, Devstack, …) don’t permit rebooting the cloud without additional manual work. It would be great if you added a statement whether a Microstack can be rebooted, and what the conditions are if any.

Where does this address come from? http://10.20.20.1 ?? I’m installing headless…

1 Like

I have same confusion about the webui IP.
I think it’s the IP of your host machine, in my case it’s 10.10.10.10.
However, I can not reach the webui at all.

in log I see this:

sudo microstack init --auto --control
...
microstack_init - INFO - Opening horizon dashboard up to *
...

I assume that means it expose webui at 80 port ? But it’s not working.

From output of microstack.openstack catalog list, I can see the endpoints services.
but no horizon/dashboard: https://pastebin.ubuntu.com/p/QBrzQ57nkg/

It seems my above guessing about webui IP is wrong.

When I launch a vm, it prints:

microstack.launch cirros --name vm0    
Creating local "microstack" ssh key at /home/xxxx/snap/microstack/common/.ssh/id_microstack
Launching server ...
Allocating floating ip ...
Server vm0 launched! (status is BUILD)

Access it with `ssh -i /home/xxxx/snap/microstack/common/.ssh/id_microstack cirros@10.20.20.185`
You can also visit the OpenStack dashboard at http://10.20.20.1:80

There are 2 useful information there:

  1. dashboard/webui IP http://10.20.20.1:80

tried, not working either.

  1. how to access vm

But it’s not working either:

» ssh -i /home/xxxx/snap/microstack/common/.ssh/id_microstack cirros@10.20.20.185
ssh: connect to host 10.20.20.185 port 22: Connection refused

Hi. I was able to get this going by using tasksel to install a GUI on the server, then connecting with a browser. I think its the same sort of thing K8S has, where it does its own networking, but if you need to connect incoming you have to set up a proxy. Translate a system address:port to that internal one.
I haven’t tried it.
After getting the gui up, I tried installing and running cirros, as shown in the tutorial.
It did not start and i saw no logging or reason why.
So I’ve dumped it and gone on to something else.
–John