MicroCloud is a new solution from Canonical that orchestrates the System Containers (LXC) and Virtual Machines (VM) with Software Defined Network (SDN) and Software Defined Storage (SDS) platforms.

In spite of the name, it is capable of handle from 3 to 50 nodes on a single fleet of hosts. In fact, the name comes from its small foot print because it manages to offer virtualisation platform with high-availability and live migration in minutes and minimum overhead (close to bare-metal performance).

The whole package is open source:

  • MicroCloud – orchestrator
  • LXD – high available computing
  • Ceph – distributed storage
  • OVN – virtual network

Requirements / Recommendations:

  • 3 hosts (VM, LXC, or bare-metal),
  • 4 vCPU + 4 GB of RAM per host,
  • 2 network adapters per host,
  • 1 system volume + 1 local volume + 1 distributed volume per host.

INSTALLATION

Start all hosts and connect them to the same network segment via the first network interface. The second network interface must have no IP address associated (disable DHCP).

Because MicroCloud and all of its components are Snap packages and Snap is a native package manager of Ubuntu. Deploy as many hosts as needed with the latest Ubuntu LTS then, issue the following commands in all of them.

sudo apt update
sudo apt upgrade -y
sudo snap install microcloud lxd microceph microovn

In one of the hosts, issue the command that will scan for eligible hosts to join the cluster.

sudo microcloud init

Follow the prompts but make the necessary adjustments to your environment.

It is recommended to limit the scope of the search for faster discovery (it uses multicast UDP packets from mDNS).

Select all that apply. There will be no prompt or confirmation on the other hosts.

Besides the system volume, allocate the secondary drive for host local storage usage.

Allocate the third volume to Ceph (SDS).

Assign the secondary network adapter to OVN (SDN).

Inform the default gateway and the range of IPs that are not in use (reserved on the DHCP server).


VISUALISATION

sudo microcloud cluster list
sudo lxc cluster list
sudo microceph cluster list
sudo microovn cluster list
sudo lxc list
sudo lxc storage list
sudo lxc storage info local
sudo lxc storage info remote
sudo lxc network show default
sudo lxc network list


UPDATES

It is important to note that snapd (Snap Daemon) automatically checks for new versions in the Snap Store and initiates the update process.

Check the current version of all installed packages:

sudo snap list

In Stap, the argument refresh is equivalent to the update followed by the upgrade in apt.

sudo snap refresh --list
sudo snap refresh lxd --cohort="+"
sudo snap refresh microceph --cohort="+"
sudo snap refresh microovn --cohort="+"
sudo snap refresh microcloud --cohort="+"

UTILISATION

Use lxc command to manage the CTs and VMs (QEMU) while MicroCloud will take care of the software defined infrastructure (network and storage) transparently. See the LXC Cheat Sheet post [Link].

sudo lxc launch ubuntu:22.04 ct1 --storage remote
sudo lxc launch ubuntu:22.04 ct2 --storage local
sudo lxc launch ubuntu:22.04 vm1 --vm
sudo lxc list

Some commands are only useful when in a cluster:

sudo lxc mv ct1 --target micro2
sudo lxc cp ct1 --target micro3 ct1-copy

It is possible to migrate System Containers live (with no interruption).

When there is a need to remove a node from the cluster for powering off or servicing:

lxc cluster evacuate micro3
lxc cluster restore micro3

To permanently delete a node from the cluster:

lxc cluster remove micro3
lxc cluster remove --force micro3

Or to add a new node:

sudo microcloud add

BONUS

For a more bleeding edge experience, you my want to taste the next release candidate (with KVM):

sudo apt update
sudo apt install qemu-kvm ovmf -y
kvm-ok && sudo reboot
sudo snap refresh lxd --channel=latest/edge
sudo snap install microceph --channel=latest/edge
sudo snap install microovn --channel=22.03/edge
sudo snap install microcloud --channel=latest/edge
sudo snap set lxd ui.enable=true
sudo snap set lxd criu.enable=true
sudo systemctl reload snap.lxd.daemon.service
sudo microcloud init
watch 'clear ; sudo microcloud cluster list ; sudo lxc cluster list ; sudo microceph cluster list ; sudo microovn cluster list ; sudo lxc list ; sudo lxc storage list ; sudo lxc network list'

Note: by April 2024 Canonical will release the version 2.0 of the MicroCloud together with the Ubuntu 24.04 LTS in its 20th anniversary! When it happens, the commands above may not be that interesting anymore.