LXC create container Failed to run: btrfs subvolume create

We have a 7 node cluster, one of the node’s lxd storage volume was corrupted, couldn’t recover thus i had to delete and create the logical volume, post which I’m unable to run containers.

[lxd_admin@lxd-01 ~]$ lxc launch --target lxd-01.x.com ubuntu:18.04 c1
Creating c1
Error: Failed instance creation: Create instance from image: Failed to run: btrfs subvolume create /var/snap/lxd/common/lxd/storage-pools/lxd_storage/images/2cfc5a5567b8d74c0986f3d8a77a2a78e58fe22ea9abd2693112031f85afa1a1: ERROR: can’t access ‘/var/snap/lxd/common/lxd/storage-pools/lxd_storage/images’: No such file or directory

[lxd_admin@lxd-cloud-01 ~]$ lxc storage create lxd_storage btrfs source=/data Error: Config key ‘source’ is node-specific

[lxd_admin@lxd-01 ~]$ lxc storage list
±------------±------------±-------±--------±--------+
| NAME | DESCRIPTION | DRIVER | STATE | USED BY |
±------------±------------±-------±--------±--------+
| lxd_storage | | btrfs | CREATED | 12 |
±------------±------------±-------±--------±--------+
[lxd_admin@lxd-01 ~]$

lxc profile show default
config: {}
description: Default LXD profile
devices:
eth0:
name: eth0
nictype: bridged
parent: virbr0
type: nic
root:
path: /
pool: lxd_storage
type: disk
name: default
used_by:

  • /1.0/instances/rch
  • /1.0/instances/tr1
  • /1.0/instances/ts1

Kindly help resolve this issue.

Yeah, so your logic volume is missing the normal base structure.

You’ll want to go to /var/snap/lxd/common/mntns/var/snap/lxd/common/lxd/storage-pools/lxd_storage and make sure that the directories in there match those on your other systems.

You’ll likely need:

  • images
  • containers
  • containers-snapshots
  • virtual-machines
  • virtual-machines-snapshots
  • custom
  • custom-snapshots

Thanks a lot Stéphane, it worked !