Lxd.migrate failed


(Kai) #1

I just used lxd.migrate to migrate from LXD 2.21 (xenial backports) to 3.0 (snap). That failed and now I cannot access my containers anymore. Any idea how to fix that?

lxd.migrate

=> Connecting to source server
=> Connecting to destination server
=> Running sanity checks

=== Source server
LXD version: 2.21
LXD PID: 17051
Resources:
Containers: 6
Images: 0
Networks: 1
Storage pools: 1

=== Destination server
LXD version: 3.0.0
LXD PID: 24355
Resources:
Containers: 0
Images: 0
Networks: 0
Storage pools: 0

The migration process will shut down all your containers then move your data to the destination LXD.
Once the data is moved, the destination LXD will start and apply any needed updates.
And finally your containers will be brought back to their previous state, completing the migration.

Are you ready to proceed (yes/no) [default=no]? yes
=> Shutting down the source LXD
=> Stopping the source LXD units
=> Stopping the destination LXD unit
=> Unmounting source LXD paths
=> Unmounting destination LXD paths
=> Wiping destination LXD clean
=> Moving the data
=> Moving the database
=> Backing up the database
=> Opening the database
=> Updating the storage backends
error: Failed to update the storage pools: Failed to run: zfs list -H -t all -o name,mountpoint -r : cannot open ‘’: invalid dataset name


(Stéphane Graber) #2

Can you e-mail /var/snap/lxd/common/lxd/lxd.db to stgraber@ubuntu.com? That should help us debug this.
The output of zfs list -t all would also be useful.


(Stéphane Graber) #3

As for bringing things back online, the following should help:

  • Ensure that /var/lib/lxd is empty
  • apt remove --purge lxd lxd-client
  • systemctl start snap.lxd.daemon

There’s a good chance things will be back online at that point though some manual DB fixes may be needed.
To figure out if you’ll need some of those, run lxd sql "SELECT * FROM storage_pools_config;"