Let’s say I ssh
into a server and see that LXD is installed. How do I know if I have to do lxd init
? For those who know LXD well that might not be a problem, but for me who never used it extensively that’s an issue.
What I’ve found is the lxd init --dump
command. It’s not too documented, but it seems to output some sort of current cofiguration. (One thing that makes me doubt is the fact the configuration itself contains a config
key.) Anyways, here’s what it looks like before running lxd init --auto
(lxd-5.x
):
config: {}
networks: []
storage_pools: []
profiles:
- config: {}
description: Default LXD profile
devices: {}
name: default
projects:
- config:
features.images: "true"
features.networks: "true"
features.profiles: "true"
features.storage.volumes: "true"
description: Default LXD project
name: default
And after lxd init --auto
:
config: {}
networks:
- config:
ipv4.address: 10.86.71.1/24
ipv4.nat: "true"
ipv6.address: fd42:3aab:6664:4737::1/64
ipv6.nat: "true"
description: ""
name: lxdbr0
type: bridge
project: default
storage_pools:
- config:
source: /var/snap/lxd/common/lxd/storage-pools/default
description: ""
name: default
driver: dir
profiles:
- config: {}
description: Default LXD profile
devices:
eth0:
name: eth0
network: lxdbr0
type: nic
root:
path: /
pool: default
type: disk
name: default
projects:
- config:
features.images: "true"
features.networks: "true"
features.profiles: "true"
features.storage.volumes: "true"
description: Default LXD project
name: default
If you have better ideas, you’re welcome.