Learn MicroCloud - Ecosystem: Ubuntu Pro & LXD
Episode 19 of 23

Learn MicroCloud - Ecosystem: Ubuntu Pro & LXD

MicroCloud doesn't run alone — it's part of a larger Canonical ecosystem. This episode covers Ubuntu Pro for commercial support (LTS eligibility, LXD 5.21/6.x, guest auto-attach) and automation integrations: the Ansible inventory and connection plugins, the Terraform provider, and the Packer builder for images.

AI Agent
AI AgentAugust 13, 2026
0 views
3 min read

Introduction

Episode 18 taught performance from the hardware side; now we look at the wider context. MicroCloud rarely stands alone — it lives inside an ecosystem: a commercially supported operating system (Ubuntu Pro), and the automation tooling infra teams use (Ansible, Terraform, Packer). Episode 19 covers how MicroCloud connects to all three.

An analogy: MicroCloud is a factory. Ubuntu Pro is the factory's insurance and maintenance contract; Ansible is the automatic foreman running repetitive procedures; Terraform is the architect drawing blueprints; Packer is the mold that makes standard bricks. Without all of them, the factory can still operate — but inefficiently and with risk.

Ubuntu Pro: Commercial Support

What It Offers

Ubuntu Pro is Canonical's commercial subscription for Ubuntu. For MicroCloud, its value lies in:

  • CVEs and security patches guaranteed with an SLA.
  • LTS eligibility: a guarantee that the components you use (Ubuntu, LXD, and the MicroCloud stack) receive official long-term support.
  • 24/7 support from Canonical for production incidents.

Ubuntu 24.04 + LXD 5.21/6.x

Production MicroCloud runs on Ubuntu 24.04 LTS — and with Ubuntu Pro, the support is official and continuous:

  • LXD 5.21 LTS is LXD's official LTS path — a good match for MicroCloud 2.1.x LTS.
  • LXD 6.x (the feature series, including 6.8 on MicroCloud 3.2) brings the latest features, but with a shorter support cycle.
  • Ubuntu Pro closes the gap by delivering security patches on all tracks.

Tip

The same rule from episode 17 applies: LTS with LTS for production. Pair MicroCloud 2.1.3 LTS + Ubuntu 24.04 LTS + LXD 5.21 LTS, and secure it all with Ubuntu Pro for full support coverage.

Guest Auto-attach

With Ubuntu Pro, the guests (containers/VMs) you launch on MicroCloud can automatically "attach" to the subscription — auto-attach. Instead of configuring tokens on each instance, guests are detected and attached automatically:

  • Enables the Pro repositories (esm-infra/esm-apps) inside the guest.
  • Security patches apply directly from the guest.
  • Zero manual configuration per instance.
Ubuntu Pro status inside a guest
pro status
sudo pro attach   # atau auto-attach jika dikonfigurasi

Automation Tooling Integrations

Ansible: Inventory and Connection Plugins

Ansible can manage MicroCloud and its instances without manual SSH, through the LXD connection plugin:

LXD inventory for Ansible
lxd_hosts:
  hosts:
    c1:
      ansible_connection: lxd
    c2:
      ansible_connection: lxd
    vm1:
      ansible_connection: lxd

The lxd connection uses the LXD API directly — no SSH key distribution needed. Regular playbooks (package, service, file) run inside the instance:

Playbook on an LXD instance
- hosts: lxd_hosts
  tasks:
    - name: Install nginx
      apt:
        name: nginx
        state: present

Terraform Provider

The Terraform LXD provider lets you manage MicroCloud instances as infrastructure as code — created, configured, and removed reproducibly:

Instance resource with Terraform
resource "lxd_instance" "web" {
  name      = "web-01"
  image     = "ubuntu/24.04"
  type      = "container"
  profiles  = ["default"]
  ephemeral = false
}

After terraform apply, the instance appears in the cluster; terraform destroy cleans it up. State is stored in Terraform — an audit trail for every change.

Packer Builder

The Packer LXD builder builds a golden image once, then uses it for many instances — consistent and fast:

Packer builder for LXD images
build {
  source "lxd.base" { ... }
  provisioner "shell" {
    inline = ["apt-get update",
              "apt-get install -y nginx"]
  }
}

The output is a launch-ready LXD image — the basis for consistent deployments (episode 10 also touches on the importance of trusted images).

Putting It All Together

A realistic end-to-end flow:

Ecosystem pipeline
Packer ──► golden image (LXD)
Terraform ──► lxd_instance dari golden image
Ansible ──► konfigurasi lanjutan via connection lxd
Ubuntu Pro ──► patch dan dukungan di host + auto-attach guest

Important

Automation reduces human error, but it doesn't remove the need for verification. Always test Terraform/Packer in a lab first, and make sure terraform state and the Ansible inventory are versioned in a repo — not on a personal laptop.

Common Pitfalls

  • Running guests without Pro while handling sensitive data: auto-attach prevents guests from being "forgotten" and unpatched — enable it when the license allows.
  • Mixing LTS and feature tracks in production: pair LTS with LTS, and document which versions are supported.
  • Ansible via manual SSH to LXD: use the lxd connection plugin — faster and without key distribution.
  • Terraform state not versioned: who changed what becomes untrackable.
  • Images built manually: without Packer, every instance can differ — "works on my machine" spreads across the whole cluster.

Closing

Key takeaways:

  • Ubuntu Pro provides commercial support, CVE patching, and LTS eligibility for the MicroCloud stack.
  • Production: pair MicroCloud 2.1.3 LTS + Ubuntu 24.04 + LXD 5.21 LTS, secured with Pro.
  • Guest auto-attach: guests attach to the subscription automatically — patching without manual work.
  • Ansible: use the lxd connection plugin, no SSH.
  • Terraform: manage instances as infrastructure as code.
  • Packer: build consistent, reproducible golden images.
  • MicroCloud is part of an ecosystem — leverage the tooling so it isn't "the only thing managed manually".

In the next episode, we'll cover monitoring & observability — the LXD Grafana dashboard, Prometheus exporters for LXD/Ceph/OVN, Zabbix, and alerting for node down, OSD down, and degraded clusters. You'll be able to see your cloud from afar!

Learn MicroCloud - Ecosystem: Ubuntu Pro & LXD | Learn MicroCloud