Lxc list can't find containers

topics consulted :smiling_face_with_tear: lost database after upgrade

lxd.migrate results in no containers

lxd snap version installed: 4.0.9-a29c6f1

Hello,
After upgrade from ubuntu 18 to ubuntu 20, i realised i needed the snap package for my lxc containers.

however my server at the time was not connected to the internet and i was using a local mirror repository.
seeing the error (pink screen) i skipped it and continued the upgrade.

after that i connected my server to the internet and installed the lxd snap package. so far my zpool was mounted in /var/lib/lxd and my containers were mounted in /var/lib/lxd/storage-pools/default/containers/container-name.

I tried to use lxd migrate but it kept giving me errors. the snap.lxd.daemon.service is running but lxc list displays nothing.

I exported my pool lxd_data and imported it in /var/snap/lxd/common/lxd/ ( (sweat and tears :smiling_face_with_tear:)

:~$ df -h
Filesystem                                      Size  Used Avail Use% Mounted on
udev                                             32G     0   32G   0% /dev
tmpfs                                           6,3G  2,5M  6,3G   1% /run
rpool/ROOT/ubuntu                               3,8G  1,9G  2,0G  49% /
tmpfs                                            32G     0   32G   0% /dev/shm
tmpfs                                           5,0M     0  5,0M   0% /run/lock
tmpfs                                            32G     0   32G   0% /sys/fs/cgroup
/dev/sda8                                       511M  5,0M  507M   1% /boot/efi
rpool/home                                       43G   41G  2,0G  96% /home
rpool/var/log                                   2,4G  431M  2,0G  18% /var/log
rpool/var/spool                                 2,0G  1,2M  2,0G   1% /var/spool
tmpfs                                           6,3G     0  6,3G   0% /run/user/1006
/dev/loop0                                       39M   39M     0 100% /snap/snapd/21759
/dev/loop1                                       64M   64M     0 100% /snap/core20/2318
/dev/loop2                                       92M   92M     0 100% /snap/lxd/24061
lxd_data/lxd                                    8,4T  384K  8,4T   1% /var/snap/lxd/common/lxd
lxd_data/eho/containers/Network-fl11-tw1     94G  548M   93G   1% /var/snap/lxd/common/lxd/storage-pools/default/containers/Network-fl11-tw1
lxd_data/eho/containers/VPN-fl11-tw1         94G  547M   93G   1% /var/snap/lxd/common/lxd/storage-pools/default/containers/VPN-fl11-tw1
lxd_data/eho/containers/DATA-LVL1-fl11-tw1 1022G   25G  998G   3% /var/snap/lxd/common/lxd/storage-pools/default/containers/DATA-LVL1-fl11-tw1
lxd_data/eho/containers/DATA-LVL2-fl11-tw1 1023G  337G  687G  33% /var/snap/lxd/common/lxd/storage-pools/default/containers/DATA-LVL2-fl11-tw1
lxd_data/eho/containers/DATA-LVL3-fl11-tw1 1023G  2,6G 1020G   1% /var/snap/lxd/common/lxd/storage-pools/default/containers/DATA-LVL3-fl11-tw1
lxd_data/eho/containers/DATA-LVL4-fl11-tw1  937G  3,2G  934G   1% /var/lib/lxd/storage-pools/default/containers/DATA-LVL4-fl11-tw1

outputs :

:~$ sudo systemctl start lxd
Failed to start lxd.service: Unit lxd.service not found.
:~$ lxc list
+------+-------+------+------+------+-----------+
| NAME | STATE | IPV4 | IPV6 | TYPE | SNAPSHOTS |
+------+-------+------+------+------+-----------+
:~$ sudo lxd.migrate
=> Connecting to source server
error: Unable to connect to the source LXD: Get "http://unix.socket/1.0": dial unix /var/lib/lxd/unix.socket: connect: connection refused
:~$ sudo systemctl start lxd
[sudo] password for ard: 
Failed to start lxd.service: Unit lxd.service not found.
:~$  sudo systemctl status snap.lxd.daemon.service
● snap.lxd.daemon.service - Service for snap application lxd.daemon
     Loaded: loaded (/etc/systemd/system/snap.lxd.daemon.service; static; vendor preset: enabled)
     Active: active (running) since Wed 2024-07-17 11:31:01 CEST; 16s ago
TriggeredBy: ● snap.lxd.daemon.unix.socket
   Main PID: 29426 (daemon.start)
      Tasks: 0 (limit: 4915)
     Memory: 4.8M
     CGroup: /system.slice/snap.lxd.daemon.service
             ‣ 29426 /bin/sh /snap/lxd/24061/commands/daemon.start

juil. 17 11:31:01 srv01-fl11-tw1 lxd.daemon[29577]: - proc_uptime
juil. 17 11:31:01 srv01-fl11-tw1 lxd.daemon[29577]: - shared_pidns
juil. 17 11:31:01 srv01-fl11-tw1 lxd.daemon[29577]: - cpuview_daemon
juil. 17 11:31:01 srv01-fl11-tw1 lxd.daemon[29577]: - loadavg_daemon
juil. 17 11:31:01 srv01-fl11-tw1 lxd.daemon[29577]: - pidfds
juil. 17 11:31:02 srv01-fl11-tw1 lxd.daemon[29426]: => Starting LXD
juil. 17 11:31:02 srv01-fl11-tw1 lxd.daemon[29590]: t=2024-07-17T11:31:02+0200 lvl=warn msg=" - Couldn't find the CGroup blkio.weight, disk priority will be ignored"
juil. 17 11:31:02 srv01-fl11-tw1 lxd.daemon[29590]: t=2024-07-17T11:31:02+0200 lvl=warn msg=" - Couldn't find the CGroup memory swap accounting, swap limits will be ignored"
juil. 17 11:31:09 srv01-fl11-tw1 lxd.daemon[29590]: t=2024-07-17T11:31:09+0200 lvl=warn msg="Failed to initialize fanotify, falling back on fsnotify" err="Failed to initialize fanotify: invalid argument"
juil. 17 11:31:10 srv01-fl11-tw1 lxd.daemon[29426]: => LXD is ready
:~$ sudo ls -l /snap/bin/
total 3
lrwxrwxrwx 1 root root  7 juil. 17 16:03 lxc -> lxd.lxc
lrwxrwxrwx 1 root root 13 juil. 17 16:03 lxd -> /usr/bin/snap
lrwxrwxrwx 1 root root 13 juil. 17 16:03 lxd.buginfo -> /usr/bin/snap
lrwxrwxrwx 1 root root 13 juil. 17 16:03 lxd.check-kernel -> /usr/bin/snap
lrwxrwxrwx 1 root root 13 juil. 17 16:03 lxd.lxc -> /usr/bin/snap

:~$ sudo ls -l /usr/bin/snap
-rwxr-xr-x 1 root root 17083672 avril 24 02:00 /usr/bin/snap
:~$ which lxd
/usr/bin/lxd
:~$ which lxc
/usr/bin/lxc
:~$ /snap/bin/lxc project list
+-------------------+--------+----------+-----------------+-----------------+----------+---------------+---------------------+---------+
|       NAME        | IMAGES | PROFILES | STORAGE VOLUMES | STORAGE BUCKETS | NETWORKS | NETWORK ZONES |     DESCRIPTION     | USED BY |
+-------------------+--------+----------+-----------------+-----------------+----------+---------------+---------------------+---------+
| default (current) | YES    | YES      | YES             | YES             | YES      | YES           | Default LXD project | 2       |
+-------------------+--------+----------+-----------------+-----------------+----------+---------------+---------------------+---------+

:~$ lxc project list
+-------------------+--------+----------+-----------------+-----------------+----------+---------------+---------------------+---------+
|       NAME        | IMAGES | PROFILES | STORAGE VOLUMES | STORAGE BUCKETS | NETWORKS | NETWORK ZONES |     DESCRIPTION     | USED BY |
+-------------------+--------+----------+-----------------+-----------------+----------+---------------+---------------------+---------+
| default (current) | YES    | YES      | YES             | YES             | YES      | YES           | Default LXD project | 2       |
+-------------------+--------+----------+-----------------+-----------------+----------+---------------+---------------------+---------+

:~$ lxc storage list
+------+--------+--------+-------------+---------+-------+
| NAME | DRIVER | SOURCE | DESCRIPTION | USED BY | STATE |
+------+--------+--------+-------------+---------+-------+
:~$ lxc storage show default
Error: Storage pool not found

I know i messed up royally, but i can’t seem to find anything I haven’t tried, apart from a reboot
Any help to restore my containers is greatly appreciated

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.