Move juju lxd instances between lxd-hosts

I’m testing our moving juju models between two lxd-hosts.

Normal lxc containers can be moved, but with juju its not seamless.

My first take on this looks something like this:

lxc stop juju-c1ff78-0

lxc move juju-c1ff78-0 nuc11:
Error: Failed instance creation: Requested profile '"juju-movetest"' doesn't exist

Need to get a profile over…

lxc profile copy juju-movetest nuc11:
lxc copy juju-c1ff78-0 nuc11: --profile=juju-movetest
Error: Failed instance creation: Can't find a storage pool for the instance to use

Needs to also make use of the default profile…

lxc copy juju-c1ff78-0 nuc11: --profile=default --profile=juju-movetest

Starting up the instance at the new lxd host:

lxc start  nuc11:juju-c1ff78-0 

As you can see, juju also changes IP and the agent seems just fine!

Now, juju doesn’t know where the machine is any-more or how to manage it. So, if we try remove it, it will only be removed from juju, but the container will be still left running in the lxd-cloud it was moved to.

My question is if there is someone with more experience moving instances in a juju model between lxd-hosts and if juju has some magic to offer here?

All exciting things this…

@stgraber