{"id":3866,"date":"2024-01-06T01:04:33","date_gmt":"2024-01-06T06:04:33","guid":{"rendered":"https:\/\/dft.wiki\/?p=3866"},"modified":"2026-06-08T16:27:43","modified_gmt":"2026-06-08T20:27:43","slug":"canonical-microcloud-2","status":"publish","type":"post","link":"https:\/\/dft.wiki\/?p=3866","title":{"rendered":"Deploying a MicroCloud Cluster"},"content":{"rendered":"<p><strong>MicroCloud<\/strong> is a solution from Canonical that orchestrates System Containers (<strong>LXC<\/strong>) and Virtual Machines (<strong>VMs<\/strong>) with Software Defined Networking (<strong>SDN<\/strong>) and Software Defined Storage (<strong>SDS<\/strong>) platforms.<\/p>\n<p>Despite the name, it supports between 3 and 50 nodes on a single fleet of hosts. The name refers to its small footprint: it delivers a virtualisation platform with high availability and live migration in minutes, with minimal overhead (close to bare-metal performance).<\/p>\n<p>The whole package is open source:<\/p>\n<ul>\n<li>MicroCloud &#8211; orchestrator<\/li>\n<li>LXD &#8211; high-availability computing<\/li>\n<li>Ceph &#8211; distributed storage<\/li>\n<li>OVN &#8211; virtual networking<\/li>\n<\/ul>\n<p>Requirements \/ Recommendations:<\/p>\n<ul>\n<li>3 hosts (VM, LXC, or bare-metal)<\/li>\n<li>4 vCPUs + 4 GB of RAM per host<\/li>\n<li>2 network adapters per host<\/li>\n<li>1 system volume + 1 local volume + 1 distributed volume per host<\/li>\n<\/ul>\n<hr \/>\n<p><strong>INSTALLATION<\/strong><\/p>\n<p>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 assigned (disable DHCP).<\/p>\n<p>MicroCloud and all of its components are Snap packages. Since Snap is the native package manager on Ubuntu, deploy as many hosts as needed with the latest Ubuntu LTS, then run the following commands on all of them.<\/p>\n<pre>sudo apt update\r\nsudo apt upgrade -y\r\nsudo snap install microcloud lxd microceph microovn<\/pre>\n<p>On one of the hosts, run the command that scans for eligible hosts to join the cluster.<\/p>\n<pre>sudo microcloud init<\/pre>\n<p>Follow the prompts and make the necessary adjustments for your environment.<\/p>\n<p>It is recommended to limit the search scope for faster discovery (it uses multicast UDP packets via mDNS).<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-3873\" src=\"https:\/\/dft.wiki\/wp-content\/uploads\/sites\/15\/2024\/01\/Screenshot-from-2024-01-06-00-06-09.png\" alt=\"\" width=\"788\" height=\"231\" srcset=\"https:\/\/dft.wiki\/wp-content\/uploads\/sites\/15\/2024\/01\/Screenshot-from-2024-01-06-00-06-09.png 788w, https:\/\/dft.wiki\/wp-content\/uploads\/sites\/15\/2024\/01\/Screenshot-from-2024-01-06-00-06-09-300x88.png 300w, https:\/\/dft.wiki\/wp-content\/uploads\/sites\/15\/2024\/01\/Screenshot-from-2024-01-06-00-06-09-768x225.png 768w\" sizes=\"auto, (max-width: 788px) 100vw, 788px\" \/><\/p>\n<p>Select all that apply. There will be no prompt or confirmation on the other hosts.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-3872\" src=\"https:\/\/dft.wiki\/wp-content\/uploads\/sites\/15\/2024\/01\/Screenshot-from-2024-01-06-00-06-15.png\" alt=\"\" width=\"788\" height=\"200\" srcset=\"https:\/\/dft.wiki\/wp-content\/uploads\/sites\/15\/2024\/01\/Screenshot-from-2024-01-06-00-06-15.png 788w, https:\/\/dft.wiki\/wp-content\/uploads\/sites\/15\/2024\/01\/Screenshot-from-2024-01-06-00-06-15-300x76.png 300w, https:\/\/dft.wiki\/wp-content\/uploads\/sites\/15\/2024\/01\/Screenshot-from-2024-01-06-00-06-15-768x195.png 768w\" sizes=\"auto, (max-width: 788px) 100vw, 788px\" \/><\/p>\n<p>Besides the system volume, allocate the secondary drive for host-local storage.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-3871\" src=\"https:\/\/dft.wiki\/wp-content\/uploads\/sites\/15\/2024\/01\/Screenshot-from-2024-01-06-00-07-28.png\" alt=\"\" width=\"987\" height=\"182\" srcset=\"https:\/\/dft.wiki\/wp-content\/uploads\/sites\/15\/2024\/01\/Screenshot-from-2024-01-06-00-07-28.png 987w, https:\/\/dft.wiki\/wp-content\/uploads\/sites\/15\/2024\/01\/Screenshot-from-2024-01-06-00-07-28-300x55.png 300w, https:\/\/dft.wiki\/wp-content\/uploads\/sites\/15\/2024\/01\/Screenshot-from-2024-01-06-00-07-28-768x142.png 768w\" sizes=\"auto, (max-width: 987px) 100vw, 987px\" \/><\/p>\n<p>Allocate the third volume to Ceph (SDS).<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-3870\" src=\"https:\/\/dft.wiki\/wp-content\/uploads\/sites\/15\/2024\/01\/Screenshot-from-2024-01-06-00-10-24.png\" alt=\"\" width=\"990\" height=\"179\" srcset=\"https:\/\/dft.wiki\/wp-content\/uploads\/sites\/15\/2024\/01\/Screenshot-from-2024-01-06-00-10-24.png 990w, https:\/\/dft.wiki\/wp-content\/uploads\/sites\/15\/2024\/01\/Screenshot-from-2024-01-06-00-10-24-300x54.png 300w, https:\/\/dft.wiki\/wp-content\/uploads\/sites\/15\/2024\/01\/Screenshot-from-2024-01-06-00-10-24-768x139.png 768w\" sizes=\"auto, (max-width: 990px) 100vw, 990px\" \/><\/p>\n<p>Assign the secondary network adapter to OVN (SDN).<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-3869 size-full\" src=\"https:\/\/dft.wiki\/wp-content\/uploads\/sites\/15\/2024\/01\/Screenshot-from-2024-01-06-00-11-13.png\" alt=\"\" width=\"531\" height=\"164\" srcset=\"https:\/\/dft.wiki\/wp-content\/uploads\/sites\/15\/2024\/01\/Screenshot-from-2024-01-06-00-11-13.png 531w, https:\/\/dft.wiki\/wp-content\/uploads\/sites\/15\/2024\/01\/Screenshot-from-2024-01-06-00-11-13-300x93.png 300w\" sizes=\"auto, (max-width: 531px) 100vw, 531px\" \/><\/p>\n<p>Enter the default gateway and the range of IPs not currently in use (reserved on the DHCP server).<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-3868 size-full\" src=\"https:\/\/dft.wiki\/wp-content\/uploads\/sites\/15\/2024\/01\/Screenshot-from-2024-01-06-00-12-05.png\" alt=\"\" width=\"834\" height=\"132\" srcset=\"https:\/\/dft.wiki\/wp-content\/uploads\/sites\/15\/2024\/01\/Screenshot-from-2024-01-06-00-12-05.png 834w, https:\/\/dft.wiki\/wp-content\/uploads\/sites\/15\/2024\/01\/Screenshot-from-2024-01-06-00-12-05-300x47.png 300w, https:\/\/dft.wiki\/wp-content\/uploads\/sites\/15\/2024\/01\/Screenshot-from-2024-01-06-00-12-05-768x122.png 768w\" sizes=\"auto, (max-width: 834px) 100vw, 834px\" \/><\/p>\n<hr \/>\n<p><strong>VISUALISATION<\/strong><\/p>\n<pre>sudo microcloud cluster list\r\nsudo lxc cluster list\r\nsudo microceph cluster list\r\nsudo microovn cluster list\r\nsudo lxc list\r\nsudo lxc storage list\r\nsudo lxc storage info local\r\nsudo lxc storage info remote\r\nsudo lxc network show default\r\nsudo lxc network list<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-3874\" src=\"https:\/\/dft.wiki\/wp-content\/uploads\/sites\/15\/2024\/01\/Screenshot-from-2024-01-04-20-11-52.png\" alt=\"\" width=\"1300\" height=\"890\" srcset=\"https:\/\/dft.wiki\/wp-content\/uploads\/sites\/15\/2024\/01\/Screenshot-from-2024-01-04-20-11-52.png 1300w, https:\/\/dft.wiki\/wp-content\/uploads\/sites\/15\/2024\/01\/Screenshot-from-2024-01-04-20-11-52-300x205.png 300w, https:\/\/dft.wiki\/wp-content\/uploads\/sites\/15\/2024\/01\/Screenshot-from-2024-01-04-20-11-52-1024x701.png 1024w, https:\/\/dft.wiki\/wp-content\/uploads\/sites\/15\/2024\/01\/Screenshot-from-2024-01-04-20-11-52-768x526.png 768w\" sizes=\"auto, (max-width: 1300px) 100vw, 1300px\" \/><\/p>\n<hr \/>\n<p><strong>UPDATES<\/strong><\/p>\n<p>Note that <strong>snapd<\/strong> (Snap Daemon) automatically checks for new versions in the Snap Store and initiates updates.<\/p>\n<p>Check the currently installed versions:<\/p>\n<pre>sudo snap list<\/pre>\n<p>In Snap, the <code>refresh<\/code> argument is equivalent to running <code>update<\/code> followed by <code>upgrade<\/code> in <code>apt<\/code>.<\/p>\n<pre>sudo snap refresh --list\r\nsudo snap refresh lxd --cohort=\"+\"\r\nsudo snap refresh microceph --cohort=\"+\"\r\nsudo snap refresh microovn --cohort=\"+\"\r\nsudo snap refresh microcloud --cohort=\"+\"<\/pre>\n<hr \/>\n<p><strong>UTILISATION<\/strong><\/p>\n<p>Use the <code>lxc<\/code> command to manage containers and VMs (QEMU). MicroCloud handles the software-defined infrastructure (network and storage) transparently. See the <strong>LXC Cheat Sheet<\/strong> post [<a href=\"https:\/\/dft.wiki\/?p=2852\">Link<\/a>].<\/p>\n<pre>sudo lxc launch ubuntu:22.04 ct1 --storage remote\r\nsudo lxc launch ubuntu:22.04 ct2 --storage local\r\nsudo lxc launch ubuntu:22.04 vm1 --vm\r\nsudo lxc list<\/pre>\n<p>Some commands are only relevant in a cluster:<\/p>\n<pre>sudo lxc mv ct1 --target micro2\r\nsudo lxc cp ct1 --target micro3 ct1-copy<\/pre>\n<p>System Containers can be migrated live, with no interruption.<\/p>\n<p>To remove a node from the cluster for maintenance or shutdown:<\/p>\n<pre>lxc cluster evacuate micro3\r\nlxc cluster restore micro3<\/pre>\n<p>To permanently remove a node from the cluster:<\/p>\n<pre>lxc cluster remove micro3\r\nlxc cluster remove --force micro3<\/pre>\n<p>To add a new node:<\/p>\n<pre>sudo microcloud add<\/pre>\n<hr \/>\n<p><strong>BONUS<\/strong><\/p>\n<p>For a more cutting-edge experience, you may want to try the next release candidate (with KVM):<\/p>\n<pre>sudo apt update\r\nsudo apt install qemu-kvm ovmf -y\r\nkvm-ok &amp;&amp; sudo reboot<\/pre>\n<pre>sudo snap refresh lxd --channel=latest\/edge\r\nsudo snap install microceph --channel=latest\/edge\r\nsudo snap install microovn --channel=22.03\/edge\r\nsudo snap install microcloud --channel=latest\/edge\r\nsudo snap set lxd ui.enable=true\r\nsudo snap set lxd criu.enable=true\r\nsudo systemctl reload snap.lxd.daemon.service<\/pre>\n<pre>sudo microcloud init<\/pre>\n<pre>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'<\/pre>\n<p><strong>Note:<\/strong> By April 2024, Canonical planned to release MicroCloud 2.0 alongside Ubuntu 24.04 LTS on its 20th anniversary. If that has already happened, some of the commands above may be outdated.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>MicroCloud is a solution from Canonical that orchestrates System Containers (LXC) and Virtual Machines (VMs) [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4,1],"tags":[],"class_list":["post-3866","post","type-post","status-publish","format-standard","hentry","category-linux","category-ccna"],"_links":{"self":[{"href":"https:\/\/dft.wiki\/index.php?rest_route=\/wp\/v2\/posts\/3866","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/dft.wiki\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/dft.wiki\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/dft.wiki\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/dft.wiki\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3866"}],"version-history":[{"count":22,"href":"https:\/\/dft.wiki\/index.php?rest_route=\/wp\/v2\/posts\/3866\/revisions"}],"predecessor-version":[{"id":5635,"href":"https:\/\/dft.wiki\/index.php?rest_route=\/wp\/v2\/posts\/3866\/revisions\/5635"}],"wp:attachment":[{"href":"https:\/\/dft.wiki\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3866"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/dft.wiki\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3866"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/dft.wiki\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3866"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}