Skip to content

Create an LXD Container

After at least one LXD node is enrolled you can spin up containers from the Containers tab.

Quick steps

  1. Containers tab → ➕ New Container.
  2. Fill in:
  3. Name — DNS-safe lowercase hostname.
  4. Host — pick an enrolled LXD node from the dropdown.
  5. Image — one of the alias entries from the node's cached images. If empty, pull one first with ⬇ Pull Image or Install an Appliance.
  6. Storage Pool — defaults to the image's preferred pool (set at pull time). Override only if you know better.
  7. NetworkNone (no NIC) or one of the LXD networks. For OVN binding leave this on None and use the OVN section below.
  8. CPU — vCPU limit (default 1).
  9. Memory (MB) — RAM limit (default 512).
  10. (Optional — OVN binding) Expand the OVN section:
  11. IPAM Pool — pick a pool bound to an OVN switch.
  12. MAC — leave blank to auto-generate a unique 00:16:3e:xx:xx:xx; or paste your own.
  13. Static IP — leave blank to take the next free address from the pool.
  14. Create.

The container appears in the Containers table within a couple of seconds. A WebSocket task stream shows the LXD operation progressing through Pending → Creating → Started → Running.

What happens under the hood

  1. Master inserts a row in lxd_containers with status='Creating'.
  2. (If OVN binding) Allocates an IP from the pool, picks/validates a MAC, INSERTs a lease.
  3. Enqueues a Celery task on the per-host queue (compute-<ip-with-dashes>).
  4. The worker on that host calls LXDClient.create_instance(...) against the local LXD socket.
  5. (If OVN binding) A BackgroundTask calls ovn-nbctl lsp-add lsp-<name> on an OVN-enabled host so the container's NIC is reachable on the tenant network.
  6. Row flips to Running (or Error with a friendly message in the task log).

Tips

  • The first container created from a new image takes a minute or two — LXD has to import the image. Subsequent containers from the same image are seconds.
  • Names with uppercase or dots break some LXD validation; stick to lowercase + hyphens (the modal validates this).
  • For long-running services, set a snapshot schedule via the Snapshots flow before installing anything custom.

See also