Skip to content
Cloudbricks.dev logo

How to Set Up Canonical MicroCloud

Deploy Canonical MicroCloud on Ubuntu, letting a single snap command auto-configure LXD, Ceph, and OVN across a cluster of servers discovered over mDNS.

Kishore 3 min read
MicroCloud

MicroCloud allows you to deploy your own fully functional cloud in minutes.

It’s a snap package that can automatically configure LXD, Ceph, and OVN across a set of servers. It relies on mDNS to automatically detect other servers on the network, making it possible to set up a complete cluster by running a single command on one of the machines.

MicroCloud creates a small footprint cluster of compute nodes with distributed storage and secure networking, optimized for repeatable, reliable remote deployments. MicroCloud is aimed at edge computing, and anyone in need of a small-scale private cloud.


Requirements:

MicroCloud requires a minimum of three machines.

Networking requirements:

For networking, MicroCloud requires a dedicated network interface and an uplink network that is an actual L2 subnet. See Networking for more information.

The IP addresses of the machines must not change after installation, so DHCP is not configured for these servers

Software requirements:

MicroCloud requires snapd version 2.59 or newer.

HostnameIP AddressSpecifications
micro-01192.168.20.504CPU,8 GB RAM, 40GB for OS, 300GB disk for distributed storage
micro-02192.168.20.514CPU,8 GB RAM, 40GB for OS, 300GB disk for distributed storage
micro-03192.168.20.524CPU,8 GB RAM, 40GB for OS, 300GB disk for distributed storage

Getting started with setup:
  1. Ensure that the required DNS entries are created

Screenshot 1 from the Set Up Canonical MicroCloud walkthrough

  1. Create the Virtual Machines manually or using Packer template and clone using Terraform/OpenTofu. I have used the OpenTofu code, which will create 3 VMs with the required configuration

Screenshot 2 from the Set Up Canonical MicroCloud walkthrough

  1. Login to micro-01, micro-02 and micro-03 and run the following commands.
sudo snap refresh
sudo snap install lxd microceph microcloud microovn --cohort="+"
sudo snap refresh lxd --channel=latest/stable

sudo snap refresh - updates the Ubuntu snap to the latest version

sudo snap install lxd microceph microcloud microovn –cohort="+" - installs the required microcloud packages

sudo snap refresh lxd –channel=latest/stable - updates the LXD to the latest version


Getting started with initialization:

Complete the following steps to initialise MicroCloud:

  1. On micro-01, enter the following command:
sudo microcloud init

The initialisation process bootstraps the MicroCloud cluster. this initialisation is on one of the machines, and it configures the required services on all machines.

  1. Accept the default (yes), MicroCloud will automatically detect machines in the local subnet Screenshot 3 from the Set Up Canonical MicroCloud walkthrough

  2. Select the machines that you want to add to the MicroCloud cluster. Screenshot 4 from the Set Up Canonical MicroCloud walkthrough Screenshot 5 from the Set Up Canonical MicroCloud walkthrough Screenshot 6 from the Set Up Canonical MicroCloud walkthrough

  3. Select No for set up local storage. Press Enter to continue with distributed storage Screenshot 7 from the Set Up Canonical MicroCloud walkthrough

  4. Select the disks for Storage Screenshot 8 from the Set Up Canonical MicroCloud walkthrough Screenshot 9 from the Set Up Canonical MicroCloud walkthrough

  5. Continue with skipping distributed networking Screenshot 10 from the Set Up Canonical MicroCloud walkthrough

  6. MicroCloud now starts to bootstrap the cluster. Monitor the output to see whether all steps complete successfully. See Bootstrapping process for more information Screenshot 11 from the Set Up Canonical MicroCloud walkthrough Screenshot 12 from the Set Up Canonical MicroCloud walkthrough

  7. After the initialisation is complete, run the following commands to confirm the setup.

lxc cluster list
lxc storage list
lxc network list
lxc profile show default

Enable Web UI for LXD and Manage the Microcloud:

Enable LXD Web UI

  1. Enable the UI in the snap ( in micro-01):
sudo snap set lxd ui.enable=true
sudo systemctl reload snap.lxd.daemon

Screenshot 13 from the Set Up Canonical MicroCloud walkthrough 2. Access the UI in your browser by entering the server address (for example, https://micro-01.cloudbricks.local:8443). Screenshot 14 from the Set Up Canonical MicroCloud walkthrough 3. Set up the certificates that are required for the UI client to authenticate with the LXD server by following the steps presented in the UI. These steps include creating a set of certificates, adding the private key to your browser, and adding the public key to the server’s trust store. Screenshot 15 from the Set Up Canonical MicroCloud walkthrough 4. After setting up the certificates, you can start creating instances, editing profiles, or configuring your server Screenshot 16 from the Set Up Canonical MicroCloud walkthrough Screenshot 17 from the Set Up Canonical MicroCloud walkthrough Screenshot 18 from the Set Up Canonical MicroCloud walkthrough Screenshot 19 from the Set Up Canonical MicroCloud walkthrough Screenshot 20 from the Set Up Canonical MicroCloud walkthrough Screenshot 21 from the Set Up Canonical MicroCloud walkthrough