How to setup Canonical MicroCloud

img placeholder

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

img placeholder

  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

img placeholder

  1. Login to micro-01, micro-02 and mirco-03 and run the following commands.
1sudo snap refresh
2sudo snap install lxd microceph microcloud microovn --cohort="+"
3sudo 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:
1sudo 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

    img placeholder

  2. Select the machines that you want to add to the MicroCloud cluster.

    img placeholder
    img placeholder
    img placeholder

  3. Select No for set up local storage. Press Enter to continue with distributed storage

    img placeholder

  4. Select the disks for Storage

    img placeholder
    img placeholder

  5. Continue with skipping distributed networking

    img placeholder

  6. MicroCloud now starts to bootstrap the cluster. Monitor the output to see whether all steps complete successfully. See Bootstrapping process for more information

    img placeholder
    img placeholder

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

1lxc cluster list
2lxc storage list
3lxc network list
4lxc 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):
1sudo snap set lxd ui.enable=true
2sudo systemctl reload snap.lxd.daemon

img placeholder
2. Access the UI in your browser by entering the server address (for example, https://micro-01.cloudbricks.local:8443).
img placeholder
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.
img placeholder
4. After setting up the certificates, you can start creating instances, editing profiles, or configuring your server
img placeholder
img placeholder
img placeholder
img placeholder
img placeholder
img placeholder

Posts in this Series