How canonical/lxd works
LXD manages Linux containers and virtual machines through a REST API, with the lxc CLI and Go client SDK as user-facing access paths. A representative workflow is a user issuing a storage-volume command, the client sending an API request, and the daemon coordinating storage operations and cluster metadata. The tree and excerpts also show distinct image, network, identity, and instance subsystems. Several links are dashed where the available excerpts and index do not establish the runtime call path; unsampled source was not inspected.
Main entry points: api_1.0.go REST API · storage.go Storage backends · storage_volumes.go Storage volumes · lxd_storage_volumes.go Go client SDK
Components 22
Access
- lxc CLI
lxc/storage_volume.go - Go client SDK
client/lxd_storage_volumes.go
Control plane
- REST API
lxd/api_1.0.go - Cluster coordination
lxd/cluster/gateway.go - Identity and authorization
lxd/auth/drivers/authorization.go - Async operations
lxd/operations/operations.go - Events and lifecycle
lxd/events/events.go
Workloads
- Instance management
lxd/instances_post.go - Container and VM drivers
lxd/instance/drivers/driver_common.go - Image management
lxd/images.go - Networking
lxd/networks.go - Instance agent
lxd-agent/server.go
Storage
- Storage pools
lxd/storage_pools.go - Storage volumes
lxd/storage_volumes.go - Volume snapshots
lxd/storage_volumes_snapshot.go - Storage buckets
lxd/storage_buckets.go - Storage backends
lxd/storage/storage.go - Storage drivers
lxd/storage/drivers - Volume metadata
lxd/db/storage_volumes.go - Pool metadata
lxd/db/storage_pools.go - Bucket metadata
lxd/db/storage_buckets.go
Other components
- Operator
Connections 26
- Operator → lxc CLI: runs commands
- Operator → Go client SDK: integrates with
README.md - lxc CLI → Go client SDK: calls client
lxc/storage_volume.go - Go client SDK → REST API: sends requests
- REST API → Identity and authorization: authorizes requests
- REST API → Cluster coordination: forwards requests
- REST API → Async operations: starts operations
- REST API → Events and lifecycle: emits lifecycle
- REST API → Instance management: routes workload requests
- Instance management → Container and VM drivers: manages instances
- REST API → Image management: routes image requests
- REST API → Networking: routes network requests
- REST API → Storage pools: routes pool requests
- REST API → Storage volumes: routes volume requests
- Storage volumes → Volume metadata: reads and writes
lxd/storage_volumes.go - Storage volumes → Storage backends: uses pool operations
lxd/storage_volumes.go - Storage backends → Storage drivers: selects backend
- Storage volumes → Async operations: runs volume tasks
lxd/storage_volumes.go - REST API → Volume snapshots: routes snapshot requests
- Volume snapshots → Storage backends: creates and deletes
lxd/storage_volumes_snapshot.go - REST API → Storage buckets: routes bucket requests
- Storage buckets → Bucket metadata: reads and writes
lxd/storage_buckets.go - Storage buckets → Storage backends: uses pool operations
- Storage pools → Pool metadata: reads and writes
lxd/storage_pools.go - Storage pools → Storage backends: manages backends
lxd/storage_pools.go - Instance agent → Go client SDK: uses storage client