Lxc import - Error: not found (part 2)

Hello, I’m having the same problem as described in this prior message from 2020. It appears to have been fixed [1], [2] so I don’t know why it’s happening for me.

Details:

I have two workstations each running NixOS 21.04 and lxd 4.1.4. Both are ZFS filesystem, both with lxd pool named lxdpool and the zfs pool being rpool/safe/lxd. Same network adapter, albeit differently named in each system. Almost identical setups.

I ran lxc export comic-oriole comic-oriole.tar.gz on one machine, rsync’d it over to the other, and tried running lxc import comic-oriole.tar.gz. But got the error:

> lxc import comic-oriole.tar.gz                                             
Error: not found

I also ran lxc import comic-oriole.tar.gz --debug, but it’s still not clear exactly what isn’t being found.

Any ideas or suggestions?

Can you paste the contents of the backup/index.yaml and backup/container/backup.yaml here from inside the exported tarball please?

Sure, thanks.

  1. backup/index.yaml:
name: comic-oriole
backend: zfs
pool: lxdpool
optimized: false
optimized_header: false
type: container
  1. backup/container/backup.yaml
container:
  architecture: x86_64
  config:
    image.architecture: amd64
    image.description: ubuntu 21.04 amd64 (release) (20210720)
    image.label: release
    image.os: ubuntu
    image.release: hirsute
    image.serial: "20210720"
    image.type: squashfs
    image.version: "21.04"
    volatile.base_image: e27b5e92829661282f4947bdae508476dc675889b67d29bf0759ae5725af1e8b
    volatile.eth0.host_name: veth8e14a38d
    volatile.eth0.hwaddr: 00:16:3e:d5:36:36
    volatile.idmap.base: "0"
    volatile.idmap.current: '[{"Isuid":true,"Isgid":false,"Hostid":1000000,"Nsid":0,"Maprange":65536},{"Isuid":false,"Isgid":true,"Hostid":1000000,"Nsid":0,"Maprange":65536}]'
    volatile.idmap.next: '[{"Isuid":true,"Isgid":false,"Hostid":1000000,"Nsid":0,"Maprange":65536},{"Isuid":false,"Isgid":true,"Hostid":1000000,"Nsid":0,"Maprange":65536}]'
    volatile.last_state.idmap: '[{"Isuid":true,"Isgid":false,"Hostid":1000000,"Nsid":0,"Maprange":65536},{"Isuid":false,"Isgid":true,"Hostid":1000000,"Nsid":0,"Maprange":65536}]'
    volatile.last_state.power: RUNNING
    volatile.uuid: 77d5b971-ee09-497e-bcdc-8caa24c3c933
  devices: {}
  ephemeral: false
  profiles:
  - default
  stateful: false
  description: ""
  created_at: 2021-08-02T00:35:17.382155238-07:00
  expanded_config:
    image.architecture: amd64
    image.description: ubuntu 21.04 amd64 (release) (20210720)
    image.label: release
    image.os: ubuntu
    image.release: hirsute
    image.serial: "20210720"
    image.type: squashfs
    image.version: "21.04"
    volatile.base_image: e27b5e92829661282f4947bdae508476dc675889b67d29bf0759ae5725af1e8b
    volatile.eth0.host_name: veth8e14a38d
    volatile.eth0.hwaddr: 00:16:3e:d5:36:36
    volatile.idmap.base: "0"
    volatile.idmap.current: '[{"Isuid":true,"Isgid":false,"Hostid":1000000,"Nsid":0,"Maprange":65536},{"Isuid":false,"Isgid":true,"Hostid":1000000,"Nsid":0,"Maprange":65536}]'
    volatile.idmap.next: '[{"Isuid":true,"Isgid":false,"Hostid":1000000,"Nsid":0,"Maprange":65536},{"Isuid":false,"Isgid":true,"Hostid":1000000,"Nsid":0,"Maprange":65536}]'
    volatile.last_state.idmap: '[{"Isuid":true,"Isgid":false,"Hostid":1000000,"Nsid":0,"Maprange":65536},{"Isuid":false,"Isgid":true,"Hostid":1000000,"Nsid":0,"Maprange":65536}]'
    volatile.last_state.power: RUNNING
    volatile.uuid: 77d5b971-ee09-497e-bcdc-8caa24c3c933
  expanded_devices:
    eth0:
      name: eth0
      network: lxdbr0
      type: nic
    root:
      path: /
      pool: lxdpool
      type: disk
  name: comic-oriole
  status: Running
  status_code: 103
  last_used_at: 2021-08-02T00:35:31.015960824-07:00
  location: none
  type: container
pool:
  config:
    source: rpool/safe/lxd
    volatile.initial_source: rpool/safe/lxd
    zfs.pool_name: rpool/safe/lxd
  description: ""
  name: lxdpool
  driver: zfs
  used_by: []
  status: Created
  locations:
  - none
volume:
  config: {}
  description: ""
  name: comic-oriole
  type: container
  used_by: []
  location: none
  content_type: filesystem

Update, when trying to create a new instance I get another error, probably related:

> sudo lxc launch ubuntu:21.04                                                    
Creating the instance
Error: Failed instance creation: No storage pool found. Please create a new storage pool

Hmmm, the lxd pool I created using lxd init is not there (lxdpool), even though it appears in the config files above:

> sudo lxc storage list                                                           
+------+--------+--------+-------------+---------+
| NAME | DRIVER | SOURCE | DESCRIPTION | USED BY |
+------+--------+--------+-------------+---------+

But the ZFS pool exists, that was also created during lxd init:

> zfs list|grep lxd                                                               
rpool/safe/lxd                                                     1.88M   583G      192K  none
rpool/safe/lxd/containers                                           192K   583G      192K  none
rpool/safe/lxd/custom                                               192K   583G      192K  none
rpool/safe/lxd/deleted                                              960K   583G      192K  none
rpool/safe/lxd/deleted/containers                                   192K   583G      192K  none
rpool/safe/lxd/deleted/custom                                       192K   583G      192K  none
rpool/safe/lxd/deleted/images                                       192K   583G      192K  none
rpool/safe/lxd/deleted/virtual-machines                             192K   583G      192K  none
rpool/safe/lxd/images                                               192K   583G      192K  none
rpool/safe/lxd/virtual-machines                                     192K   583G      192K  none

No profiles either:

> sudo lxc profile list                                                        
+---------+---------------------+---------+
|  NAME   |     DESCRIPTION     | USED BY |
+---------+---------------------+---------+
| default | Default LXD profile | 0       |
+---------+---------------------+---------+

Seems somehow lxc init created the ZFS pools, but not everything else it was supposed to.

Update: I uninstalled and purged lxd/lxc and deleted the ZFS dataset, then did a fresh install and fresh lxd init.

That fixed the problem. I was able to successfully lxc import and start the other workstation’s exported container, as well as create a new container with lxc launch.

I think part of what happened the first time was that I initially ran lxc init --preseed preseed.from.other.workstation.txt. That seemed to work, but apparently not. After hitting the errors above, I tried running lxd init, but that gave errors too. Uninstalling and reinstalling fixed it all.