Move container from one pool to another

(Tijl Van Den Brugghen) #1


I have two pools, like so:

| pool1 |             | zfs    | pool1  | 7       |
| pool2 |             | zfs    | pool2  | 0       |

And I would like to move one of my containers from the first pool to the second pool, because the first pool is an hdd and the second pool an ssd. How would I achieve that ?

(Stéphane Graber) #2

Right now, it’d be a very manual process involving manual database changes unfortunately…

@brauner implemented local volume copy/move recently (will be in LXD 3.0) but right now that doesn’t cover moving containers between pools yet.

One solution that’s not too hackish but still pretty slow and wasteful of diskspace is to publish your container as an image and then launch a new container from it.

Depending on the container for now it may be faster to create a new empty container and rsync the content between the two…

(Christian Brauner) #3

My branch does allow copy and move between storage pools. It just doesn’t allow it across lxd remotes yet.

(Stéphane Graber) #4

How do you move a container though?

(Mike Pontillo) #5

I see that I can lxc mv <container> <destination> -s <new-pool> but I have to rename the container at the same time if I want to move it between pools.

Maybe I missed another way to do this, but it would be nice to not require <destination> so the name can be the same when moving between pools.

(Stéphane Graber) #6

Yeah, that’s correct, right now you need to use lxc move and temporarily rename the container.