Lxc launch (Failed to run: zfs create... parent does not exist)

Hi,

I’m trying to create a new container

lxc launch ubuntu:18.04 test

but I’m getting the following error

Error: Failed instance creation: Failed creating instance from image: Failed to run: zfs create -o mountpoint=legacy -o canmount=noauto lxd_storage/images/cfb4c7966a3837190fc4bc6c3e0f59b0f3ddf5eeeb48f173d649b0dde7be650b: exit status 1 (cannot create 'lxd_storage/images/cfb4c7966a3837190fc4bc6c3e0f59b0f3ddf5eeeb48f173d649b0dde7be650b': parent does not exist)

Here is some information

snap list
Name    Version      Rev    Tracking       Publisher   Notes
core    16-2.57.2    13886  latest/stable  canonical✓  core
core18  20220831     2566   latest/stable  canonical✓  base
core20  20220826     1623   latest/stable  canonical✓  base
lxd     5.5-37534be  23537  latest/stable  canonical✓  -
sudo zfs list -t filesystem,volume -r lxd_storage
NAME                                           USED  AVAIL     REFER  MOUNTPOINT
lxd_storage                                    230G   672G       24K  none
lxd_storage/containers                         230G   672G       24K  none
zfs list lxd_storage/images
cannot open 'lxd_storage/images': dataset does not exist
sudo zpool import lxd_storage
cannot import 'lxd_storage': a pool with that name already exists
zfs get mountpoint
NAME                                                                              PROPERTY    VALUE       SOURCE
lxd_storage                                                                       mountpoint  none        local
lxd_storage/containers                                                            mountpoint  none        inherited from lxd_storage
sudo lxc storage show default
config:
  size: 500GB
  source: lxd_storage
  zfs.pool_name: lxd_storage
description: ""
name: default
driver: zfs
used_by:
- /1.0/instances/...
- ...
status: Created
locations:
- none

About 6 months ago @stgraber helped us relocate our containers from btrfs to zfs. Everything is working fine so far, however, I doubt anyone has tried to create a new container since.

So are you expecting there to be any instances on the ZFS pool?

I was simply expecting the command lxc launch ubuntu:18.04 test to work as before.

Can you try creating the missing images data set using:

sudo zfs create -o mountpoint=legacy lxd_storage/images

You may also need to reboot so that the snap package’s mount namespace is brought into line with the changes you make.

Sorry @tomp, long weekend of 4 days off.

sudo zfs create -o mountpoint=legacy lxd_storage/images
cannot create 'lxd_storage/images': dataset already exists

After rebooting

lxc launch ubuntu:18.04 test
Creating test
Starting test

Yesssssssss, now it’s working. Maybe there was a zombie state or a restart required for the mount since @stgraber fixed it…?

Anywa, thank you so much.

1 Like