Rename a zpool with containers

I have a situation where I need to migrate my lxd containers data on a lxd-host using the storage-pool “default” zpool into a new pool, “default-new”.

What would the process look like to do this from a lxd perspective not to lose the containers in the process?

Do I create the “default-new”, move the containers into it, then rename the new-default zpool to “default”? Will lxd accept the new “default” pool after such a move?

1 Like

You can create a new pool, move the instances to it, and then update the default profile so that new instances use it by default for their root disks. Then delete the old storage pool.

  • What will happen to the existing instances ?
  • What do you mean by “move the instances” ? How is that done?

You can move them between storage pools using

lxc move (instance) -s (new pool)

2 Likes

@marcus check this out!

Is the move in effect a copy-then-delete operation ? Is it guaranteed to succeed as a transaction?

I couldn’t tell from this Linux Containers - LXD - Has been moved to Canonical

Yes, its a copy then delete, so if the copy fails it just doesn’t delete the old one.

2 Likes