Error: copying containers between different storage pools is not implemented

Hi!

I’ve added a new hard-drive to my server with the idea of running ZFS on the entire disk, and not just in an image file. I would like to move my LXD containers to the new disk, but it doesn’t seem to work.

I’ve tried following the tips mentioned in these 2 topics:

https://github.com/lxc/lxd/issues/4444

Or, in more detail:

lxc storage create tank1 zfs source=/dev/sdb1
lxc profile create tank1
lxc profile device add tank1 root disk path=/ pool=tank1
lxc copy vm1 vm2 -p tank1

That gives me Error: copying containers between different storage pools is not implemented

I cannot use the -s/–storage flag as that only gives me Error: unknown shorthand flag: 's' in -s.

I am running LXD 3.0.3 on Ubuntu 18.04. Feels like I am missing something basic and that the option really should be there. Any ideas?

Thanks!

You’re not missing anything, that feature was introduced in a later feature release and is not part of LXD 3.0.x.

In this case, you need LXD 3.2 or higher.

There is a bit of an odd way to deal with this on older releases which may work for you.
You could add your existing server as a remote server in the CLI (lxc remote add) and then copy your container between the local remote and the newly added one using --mode=relay.

This should work just as copying between two LXD servers normally would and will not require the special code that was added for cross pool copy/move in newer releases.

Thank you, excellent advice as always :slight_smile:

After copying the container locally I had to change its name, it wouldn’t start otherwise. I imagine this has to do with old symlinks, but that’s not a problem.

Oh, that’s odd, but yeah, copy with a different name and then move back to the original name, that will avoid conflicts.