Pro tips

This page consists of a collection of tips and optional configurations that may improve your experience with MicroStack.

Kernel tweaks

OpenStack can potentially run a lot of processes and open a lot of network connections. For a busy deployment, here are some suggested kernel settings for your host:

echo fs.inotify.max_queued_events=1048576 | sudo tee -a /etc/sysctl.conf
echo fs.inotify.max_user_instances=1048576 | sudo tee -a /etc/sysctl.conf
echo fs.inotify.max_user_watches=1048576 | sudo tee -a /etc/sysctl.conf
echo vm.max_map_count=262144 | sudo tee -a /etc/sysctl.conf
echo vm.swappiness=1 | sudo tee -a /etc/sysctl.conf
sudo sysctl -p

Client alias

Create an alias to remove the need to type the microstack. prefix when using the openstack CLI client:

sudo snap alias microstack.openstack openstack

Custom DNS

The DNS server used by cloud instances is 1.1.1.1 (Cloudflare). To change this default create the file /var/snap/microstack/common/etc/neutron/dhcp_agent.ini and add the following:

[DEFAULT]

interface_driver = openvswitch
dhcp_driver = neutron.agent.linux.dhcp.Dnsmasq
enable_isolated_metadata = True
dnsmasq_dns_servers = <nameserver-ip>

Substitute in your chosen server IP address and save the file.

Now restart the MicroStack services:

sudo systemctl restart snap.microstack.*

Cirros image user account password

The ‘cirros’ user account on the CirrOS image comes with a default password of ‘gocubsgo’. This can be useful if you have trouble logging in with SSH keys.

Disabling MicroStack

You can save system resources by disabling MicroStack when it’s not in use:

sudo snap disable microstack

To re-enable:

sudo snap enable microstack

Accessing Horizon on a remote server

If you’ve installed MicroStack on a remote server you can use SSH local port forwarding to access Horizon:

sudo ssh -i <ssh-key> -N -L 8001:10.20.20.1:80 <user>@<server-ip>

Then point your browser at: http://localhost:8001.

I ran into this issue as I had both microk8s and microstack installed and my test started a local an nginx server on the default port

Changing the default port for Horizon

sudo snap set microstack config.network.ports.dashboard=5001
sudo snap restart microstack

MySQL and RabbitMQ ports can also be changed similarly using:

config.network.ports.mysql
config.network.ports.rabbit

Extend the minimum size for Image import from the Horizon UI

Edit /var/snap/microstack/common/etc/nginx/snap/nginx.conf

Add in the http section: client_max_body_size 2G; (adapt the value to what you think you will need). Restart microstack for changes to take effect.

1 Like