Canonical LXD
The LXD integration reads an LXD server, or a whole LXD cluster through any one member, through the LXD REST API. It runs on an Integrator inside your network.
It is read-only. The integration never starts, stops, snapshots or reconfigures anything.
What it collects
| Sync | Collects |
|---|---|
| Hypervisor discovery | The cluster and every member with its LXD version, OS, kernel, CPU, memory, state, roles and failure domain |
| Instance discovery | Virtual machines and system containers in every project with their OS, addresses, MACs, CPU, memory, state and member; the image store |
| Network discovery | Managed bridges and networks with their IPv4 and IPv6 subnets and gateways |
LXD runs both containers and virtual machines. Each is reported by its type: system containers appear under Compute > Containers and virtual machines under Compute > Instances, next to those from every other cloud. Images appear under Compute > Registries.
Create a read-only client certificate
LXD authenticates API clients by TLS client certificate.
-
Generate a certificate and key for the integration:
openssl req -x509 -newkey ec -pkeyopt ec_paramgen_curve:secp384r1 -sha384 -days 3650 -nodes \-keyout inventory.key -out inventory.crt -subj "/CN=inventory" -
On LXD 6 or later, create a group that can only view, and add the certificate to it:
lxc auth group create inventory-readerslxc auth group permission add inventory-readers server viewerlxc auth identity create tls/inventory inventory.crt --group inventory-readers
On LXD 5.21 LTS, certificates cannot be limited to viewing. lxc config trust add inventory.crt
works, but the certificate then has full access to the server. Prefer LXD 6, or keep the
key on the Integrator only.
In a cluster, run these on any member: the trust store is shared.
Connect it
- Under Integrations, add Canonical LXD with the server's hostname (any cluster
member), the certificate (
inventory.crt) and its private key (inventory.key). - In the integration's settings, assign the Integrator that can reach the server on port 8443.
- Enable the syncs you want.
LXD serves its own self-signed certificate. The first connection records the certificate's fingerprint and later connections must present the same certificate. After replacing it, clear the pinned fingerprint in the integration's settings.
A certificate the server does not trust fails the sync with an error. It does not report an empty server.