Menu Close

How to install Microstack on Virtualbox with Ubuntu guest OS

MicroStack is an OpenStack distribution for Ubuntu, which is suitable for the deployment of fully functional OpenStack on a single machine. Installation is quite straightforward.

My environment

  • Host system: Win 10 Pro 64bit
  • VirtualBox 6.1.25r 64bit
  • Guest System:
    • clear server install of Ubuntu 20.04.3 :LTS with bridged networking
    • 4GB of RAM
    • 4 vPCU
    • 100GB of HDD (the size is officially recommended, but mainly is used for hosting virtual VMs)

Single node installation steps using snap

Official guides use the snap system, where all applications are packaged with all their dependencies. All the microstack installation is relatively fast, taking no more than 15 minutes.

Installation steps:

# Update and upgrade system packages
sudo apt update
sudo apt upgrade

Snap should be already installed and available for use on the majority of the latest Ubuntu distributions. If you have any issues regarding Snap, we recommend installing it by using the command below.

# Install snapd 
sudo apt install snapd

We recommend checking if open-vm-tools.service is disabled on your guest OS. In normal conditions, this tool should be enabled only on guest operating systems running under VMware. To check the status please enter the command below. You should see similar output.

# Check open-vm-tools status 
sudo systemctl status open-vm-tools.service

 open-vm-tools.service
     Loaded: masked (Reason: Unit open-vm-tools.service is masked.)
     Active: inactive (dead)

If the status is active, you need to disable open-vm-tools.service by using the command below and reboot the system for changes to apply.

# Disable open-vm-tools
sudo systemctl disable open-vm-tools.service

# Reboot system
sudo reboot now

Now we can finally proceed to the actual installation of the Microstack. Official documentation recommends using installation channel beta with dev mode for now. There are many channels and options to be used for installation. To list all of them with descriptions use the command below.

# List all channels and available options
sudo snap install microstack --help

# Install microstack
sudo snap install microstack --devmode --beta

Ensure prerequisites for "microstack" are available
Fetch and check assertions for snap "microstack" (233)
Mount snap "microstack" (233)
Copy snap "microstack" data
Setup snap "microstack" (233) security profiles
Connect microstack:network-bind to core:network-bind
Setup snap "microstack" (233) security profiles for auto-connections
Run install hook of "microstack" snap if present
Start snap "microstack" (233) services
Run configure hook of "microstack" snap if present
Run health check of "microstack" snap
microstack (beta) ussuri from Canonical✓ installed

# Verification 
sudo snap list microstack

Name       Version  Rev   Tracking     Publisher    Notes
microstack ussuri   233   latest/beta  canonical✓  devmode

After the installation, it is necessary to initialize the Microstack. There are a few options available when initializing. We used the one mentioned and recommended in the official documentation. To list all available options please see the command below.

Important! Make sure that your VM will have the same IP address as was assigned during the initialization process. Once the IP address changes (e.g. after reboot) you may encounter problems. We recommend setting up the IP address statically to avoid issues.

# List all options with descriptions
sudo microstack init --help

# Setup the microstack
sudo microstack init --auto --control

2021-10-18 11:51:24,089 - microstack_init - INFO - Configuring clustering …
2021-10-18 11:51:24,231 - microstack_init - INFO - Setting up as a control node.
2021-10-18 11:51:28,830 - microstack_init - INFO - Configuring networking …
2021-10-18 11:51:39,566 - microstack_init - INFO - Opening horizon dashboard up to *
2021-10-18 11:51:41,301 - microstack_init - INFO - Waiting for RabbitMQ to start …
Waiting for 192.168.10.216:5672
2021-10-18 11:51:50,177 - microstack_init - INFO - RabbitMQ started!
2021-10-18 11:51:50,177 - microstack_init - INFO - Configuring RabbitMQ …
2021-10-18 11:51:51,752 - microstack_init - INFO - RabbitMQ Configured!
2021-10-18 11:51:51,792 - microstack_init - INFO - Waiting for MySQL server to start …
Waiting for 192.168.10.216:3306
2021-10-18 11:52:06,797 - microstack_init - INFO - Mysql server started! Creating databases …
2021-10-18 11:52:10,051 - microstack_init - INFO - Configuring Keystone Fernet Keys …
2021-10-18 11:52:42,964 - microstack_init - INFO - Bootstrapping Keystone …
2021-10-18 11:53:00,660 - microstack_init - INFO - Creating service project …
2021-10-18 11:53:10,592 - microstack_init - INFO - Keystone configured!
2021-10-18 11:53:10,630 - microstack_init - INFO - Configuring the Placement service…
2021-10-18 11:53:46,582 - microstack_init - INFO - Running Placement DB migrations…
2021-10-18 11:53:53,485 - microstack_init - INFO - Configuring nova control plane services …
2021-10-18 11:54:14,139 - microstack_init - INFO - Running Nova API DB migrations (this may take a lot of time)…
2021-10-18 11:55:02,675 - microstack_init - INFO - Running Nova DB migrations (this may take a lot of time)…
Waiting for 192.168.10.216:8774
2021-10-18 11:56:59,458 - microstack_init - INFO - Creating default flavors…
2021-10-18 11:57:44,607 - microstack_init - INFO - Configuring nova compute hypervisor …
2021-10-18 11:57:44,608 - microstack_init - INFO - Checking virtualization extensions presence on the host
2021-10-18 11:57:44,651 - microstack_init - WARNING - Unable to determine hardware virtualization support by CPU vendor id "GenuineIntel": assuming it is not supported.
2021-10-18 11:57:44,652 - microstack_init - WARNING - Hardware virtualization is not supported - software emulation will be used for Nova instances
2021-10-18 11:57:49,067 - microstack_init - INFO - Configuring the Spice HTML5 console service…
2021-10-18 11:57:50,087 - microstack_init - INFO - Configuring Neutron
Waiting for 192.168.10.216:9696
2021-10-18 12:00:29,445 - microstack_init - INFO - Configuring Glance …
Waiting for 192.168.10.216:9292
2021-10-18 12:01:42,117 - microstack_init - INFO - Adding cirros image …
2021-10-18 12:01:49,036 - microstack_init - INFO - Creating security group rules …
2021-10-18 12:02:08,167 - microstack_init - INFO - Configuring the Cinder services…
2021-10-18 12:03:49,646 - microstack_init - INFO - Running Cinder DB migrations…
2021-10-18 12:04:26,458 - microstack_init - INFO - restarting libvirt and virtlogd …
2021-10-18 12:05:09,660 - microstack_init - INFO - Complete. Marked microstack as initialized!

You can verify the initialization by using these commands.

# List all available images
microstack.openstack image list

+--------------------------------------+--------+--------+
| ID                                   | Name   | Status |
+--------------------------------------+--------+--------+
| 2a61f2e6-ea86-4161-8ea1-17d0955c0717 | cirros | active |
+--------------------------------------+--------+--------+

# List default flavors
microstack.openstack flavor list

+----+-----------+-------+------+-----------+-------+-----------+
| ID | Name      |   RAM | Disk | Ephemeral | VCPUs | Is Public |
+----+-----------+-------+------+-----------+-------+-----------+
| 1  | m1.tiny   |   512 |    1 |         0 |     1 | True      |
| 2  | m1.small  |  2048 |   20 |         0 |     1 | True      |
| 3  | m1.medium |  4096 |   20 |         0 |     2 | True      |
| 4  | m1.large  |  8192 |   20 |         0 |     4 | True      |
| 5  | m1.xlarge | 16384 |   20 |         0 |     8 | True      |
+----+-----------+-------+------+-----------+-------+-----------+

If you got similar outputs as mentioned above, we can move on and create a VM instance. By default the only OS available for use is cirros. If not specified, a tiny flavor will be used when creating an instance. The command below will launch a VM with the name test, cirros OS, one CPU core, 1 GB HDD and 512 MB RAM (see m1.tiny flavor).

# List all launch options with descriptions
microstack launch --help

# Launch a VM
microstack launch cirros --name test

Creating local "microstack" ssh key at /home/root/snap/microstack/common/.ssh/id_microstack
Launching server …
Allocating floating ip …
Server test launched! (status is BUILD)

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

Finally, we should be able to verify if the Microstack installation is running performing some CLI query

sudo microstack.openstack keypair list
+------------+-------------------------------------------------+
| Name | Fingerprint |
+------------+-------------------------------------------------+
| microstack | ba:19:fc:70:92:92:56:92:6e:d5:72:2e:42:7e:4b:1b |
+------------+-------------------------------------------------+

There are two ways on how to access the created VM. The first way is with the use of SSH, second is with the use of the WEB dashboard. All information needed to access the VM using SSH are provided when you create the instance. In our case, the command is shown below.

# Access VM using SSH
ssh -i /home/user/snap/microstack/common/.ssh/id_microstack cirros@192.168.10.216

To list every created instance and its corresponding status execute the following command.

# List all instances
microstack.openstack server list

+--------------------------------------+----------+--------+-----------------------------------+--------+---------+
| ID                                   | Name     | Status | Networks                          | Image  | Flavor  |
+--------------------------------------+----------+--------+-----------------------------------+--------+---------+
| 79bd75d0-24be-4ebb-99d1-6a9d2da613c7 | firstTry | ACTIVE | test=192.168.222.195, 10.20.20.34 | cirros | m1.tiny |
+--------------------------------------+----------+--------+-----------------------------------+--------+---------+

If you need more information on OpenStack commands try the command below.

# List OpenStack commands and help
microstack.openstack --help

WEB access

The Microstack installation supports also the web login using the HTTP URI in the form http://VM_IP_address

Then we need to specify a username and a password. The username is ‘admin’ and the password must be obtained in this way:

sudo snap get microstack config.credentials.keystone-password

What will return a password, for example:

1jv2r3RH0NwenKRtUttXyBqMHbwFUX9J

then open a browser and access the microstack using the HTTP URI (not https), in my case http://192.168.10.216 where the login page is displayed. Using mentioned credentials we are admitted enter to the dashboard.

Well. it works!

The space consumed by the installation is about 8GB:

root@psserver:~# df -h
root@psserver:~# df -h
Filesystem                         Size  Used Avail Use% Mounted on
udev                               1.9G     0  1.9G   0% /dev
tmpfs                              394M  1.5M  393M   1% /run
/dev/mapper/ubuntu--vg-ubuntu--lv   49G  7.1G   39G  16% /
tmpfs                              2.0G     0  2.0G   0% /dev/shm
tmpfs                              5.0M     0  5.0M   0% /run/lock
tmpfs                              2.0G     0  2.0G   0% /sys/fs/cgroup
/dev/loop4                          33M   33M     0 100% /snap/snapd/12704
/dev/loop1                          56M   56M     0 100% /snap/core18/2128
/dev/loop2                          71M   71M     0 100% /snap/lxd/21029
/dev/loop0                          62M   62M     0 100% /snap/core20/1169
/dev/sda2                          976M  107M  803M  12% /boot
/dev/loop5                          33M   33M     0 100% /snap/snapd/13270
/dev/loop6                          68M   68M     0 100% /snap/lxd/21545
tmpfs                              394M     0  394M   0% /run/user/1000
/dev/loop3                         387M  387M     0 100% /snap/microstack/233

Problems

1::

The command used in several guides :

sudo snap install microstack --beta

does not work and after a few steps ends with an error.

2021-10-18 11:36:51,655 - microstack_init - INFO - Configuring clustering ...
2021-10-18 11:36:51,797 - microstack_init - INFO - Setting up as a control node.
2021-10-18 11:36:56,667 - microstack_init - INFO - Configuring networking ...
Traceback (most recent call last):
  File "/snap/microstack/233/bin/microstack", line 11, in <module>
    load_entry_point('microstack==0.0.1', 'console_scripts', 'microstack')()
  File "/snap/microstack/233/lib/python3.8/site-packages/microstack/main.py", line 44, in main
    cmd()
  File "/snap/microstack/233/lib/python3.8/site-packages/init/main.py", line 60, in wrapper
    return func(*args, **kwargs)
  File "/snap/microstack/233/lib/python3.8/site-packages/init/main.py", line 227, in init
    question.ask()
  File "/snap/microstack/233/lib/python3.8/site-packages/init/questions/question.py", line 210, in ask
    self.yes(awr)
  File "/snap/microstack/233/lib/python3.8/site-packages/init/questions/__init__.py", line 189, in yes
    enable('ovs-vswitchd')
  File "/snap/microstack/233/lib/python3.8/site-packages/init/shell.py", line 162, in enable
    check('snapctl', 'start', 'microstack.{}'.format(service), '--enable')
  File "/snap/microstack/233/lib/python3.8/site-packages/init/shell.py", line 69, in check
    raise subprocess.CalledProcessError(proc.returncode, " ".join(args))
subprocess.CalledProcessError: Command 'snapctl start microstack.ovs-vswitchd --enable' returned non-zero exit status 1.

Solution: Remove the snap installation using

snap remove microstack

and try the install process mentioned above again.

2:: The IP address of guest system has hanged

One cause of problems is that the DHCP has a very short lease time where after the reboot or a time as it was shut down VM will obtain a different IP address. For example, after reboot, I have obtained 192.168.10.208, but Microstack was installed when I had 192.168.10.230. Then you may receive an error message:

palo@psserver:~$ sudo microstack.openstack keypair list

Failed to discover available identity versions when contacting http://192.168.10.230:5000. Attempting to parse version from URL.
Could not find versioned identity endpoints when attempting to authenticate. Please check that your auth_url is correct. Unable to establish connection to http://192.168.10.230:5000: HTTPConnectionPool(host='192.168.10.230', port=5000): Max retries exceeded with url: / (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 113] No route to host'))

The web GUI shows login page, but the login does not work and the web server returns 504 Error message

Solution:

  1. Remove the snap installation and try the install process mentioned above again.
  2. Set the IP address statically

3:: open-vm-tools is not disabled

You should disable open-vm-tools.service if you are trying to install Microstack.

Start snap "microstack" (233) services                                         |
error: cannot perform the following tasks:
- Start snap "microstack" (233) services (systemctl command [start snap.microstack.load-modules.service] failed with exit status 1: Job for snap.microstack.load-modules.service failed because the control process exited with error code.
See "systemctl status snap.microstack.load-modules.service" and "journalctl -xe" for details.
)

Debugging:

systemctl status snap.microstack.load-modules.service

snap.microstack.load-modules.service
     Loaded: not-found (Reason: Unit snap.microstack.load-modules.service not found.)
     Active: failed (Result: exit-code) since Thu 2021-10-21 09:10:41 UTC; 3min 4s ago
   Main PID: 4408 (code=exited, status=1/FAILURE)

Oct 21 09:10:40 ubuntu systemd[1]: Starting Service for snap application microstack.load-modules...
Oct 21 09:10:40 ubuntu microstack.load-modules[4484]: ++ systemd-detect-virt --container
Oct 21 09:10:40 ubuntu microstack.load-modules[4408]: + [[ none == \n\o\n\e ]]
Oct 21 09:10:40 ubuntu microstack.load-modules[4408]: + modprobe -a vhost vhost-net vhost-scsi vhost-vsock vfio nbd dm-mod dm-thin-pool dm-snapshot iscsi-tcp target-core-mod
Oct 21 09:10:41 ubuntu microstack.load-modules[4486]: modprobe: ERROR: could not insert 'vhost_vsock': Device or resource busy
Oct 21 09:10:41 ubuntu systemd[1]: snap.microstack.load-modules.service: Main process exited, code=exited, status=1/FAILURE
Oct 21 09:10:41 ubuntu systemd[1]: snap.microstack.load-modules.service: Failed with result 'exit-code'.
Oct 21 09:10:41 ubuntu systemd[1]: Failed to start Service for snap application microstack.load-modules.

Solution: Remove the snap installation using

# Remove microstack installation
sudo snap remove microstack

and install Microstack using the guide above.

4:: NGINX

If your host OS is running NGINX you may encounter an error during initialization.

Error message:

2021-10-25 20:00:20,658 - microstack_init - INFO - Mysql server started! Creating databases ...
Traceback (most recent call last):
  File "/snap/microstack/233/bin/microstack", line 11, in <module>
    load_entry_point('microstack==0.0.1', 'console_scripts', 'microstack')()
  File "/snap/microstack/233/lib/python3.8/site-packages/microstack/main.py", line 44, in main
    cmd()
  File "/snap/microstack/233/lib/python3.8/site-packages/init/main.py", line 60, in wrapper
    return func(*args, **kwargs)
  File "/snap/microstack/233/lib/python3.8/site-packages/init/main.py", line 227, in init
    question.ask()
  File "/snap/microstack/233/lib/python3.8/site-packages/init/questions/question.py", line 210, in ask
    self.yes(awr)
  File "/snap/microstack/233/lib/python3.8/site-packages/init/questions/__init__.py", line 388, in yes
    enable('nginx')
  File "/snap/microstack/233/lib/python3.8/site-packages/init/shell.py", line 162, in enable
    check('snapctl', 'start', 'microstack.{}'.format(service), '--enable')
  File "/snap/microstack/233/lib/python3.8/site-packages/init/shell.py", line 69, in check
    raise subprocess.CalledProcessError(proc.returncode, " ".join(args))
subprocess.CalledProcessError: Command 'snapctl start microstack.nginx --enable' returned non-zero exit status 1.

Solution:

Uninstall Nginx with

sudo apt-get remove nginx
sudo apt-get autoremove

and retry the initialization process.

Some links

Rate this post

Leave a Reply

Your email address will not be published. Required fields are marked *

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.