Move container from one pool to another

Hello,

I have two pools, like so:

+-------+-------------+--------+--------+---------+
| NAME  | DESCRIPTION | DRIVER | SOURCE | USED BY |
+-------+-------------+--------+--------+---------+
| 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 ?

1 Like

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…

1 Like

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

1 Like

How do you move a container though?

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.

2 Likes

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

1 Like

Tried this on lxc 3.0.3 and the -s flag has been remove/isn’t there. Is there any other way to do this?

@stgraber - Hi. Any update on -s flag for ‘lxc move’ please?

I have lxd v3.0.3 and there does not appear to be an -s flag option for move?

V/R

2 Likes

Hi Andrew, it appears to have been included in LXD 3.18.