wajahat021
(wajahat ullah)
April 26, 2021, 8:51am
1
Hi,
I had a single storage zfs pool and now i want to shift all the containers to another zfs pool since the previous pool is underutilized and i want to save the cost of storage i have already created a new zfs pool what is best solution to achieve my goal???
±--------±------------±-------±--------±--------+
| NAME | DESCRIPTION | DRIVER | SOURCE | USED BY |
±--------±------------±-------±--------±--------+
| default | | zfs | default | 61 |
±--------±------------±-------±--------±--------+
| stg | | zfs | stg | 0 |
±--------±------------±-------±--------±--------+
wajahat021
(wajahat ullah)
April 26, 2021, 11:30am
2
i have tried it by
lxc move container container-tmp -s stg
lxc move container-tmp container
lxc start container
all containers are running fine but if i remove old storage from linux VM it starts giving below error
Error: Get "http://unix.socket/1.0": dial unix /var/snap/lxd/common/lxd/unix.socket: connect: connection refused
tomp
(Thomas Parrott)
April 27, 2021, 3:07pm
3
Please can you tell me the LXD version?
wajahat021
(wajahat ullah)
April 27, 2021, 5:33pm
4
root@stg-us-east1-b-001:~# snap list
Name Version Rev Tracking Publisher Notes
core 16-2.49.2 10958 latest/stable canonical✓ core
core18 20210309 1997 latest/stable canonical✓ base
lxd 4.9 18772 4.9/stable canonical✓ -
tomp
(Thomas Parrott)
April 28, 2021, 8:44am
5
I’ve just tried this now on LXD 4.13 and it worked OK:
lxc storage create zfs1 zfs
lxc storage create zfs2 zfs
lxc init images:ubuntu/focal c1 -s zfs1
lxc move c1 -s zfs2
sudo zfs list | grep c1
zfs2/containers/test_c1 209M 18.7G 209M /var/lib/lxd/storage-pools/zfs2/containers/test_c1
So is it possible for you to try with 4.13 please?
2 Likes
Even, you can move lxd containers between different storage systems, between ceph to zfs or vice versa.
Regards.
I’m getting Error: Invalid number of arguments
if I try lxc move c1 -s zfs2
.
It works if I also rename the container (e.g. c1_tmp
) in the same command.
Apparently this interface has changed? How to do that without also having to rename it temporarily?
tomp
(Thomas Parrott)
January 19, 2022, 12:58pm
8
Sounds like a bug please can you log it on github issues. Thanks
It turns out LXD version 4.0.8, which is what you get by default in the latest Ubuntu Server LTS (20.04), does not have that feature yet.
Renaming the container at the same time “does a copy+delete”, which is already implemented in that version.
opened 01:09PM - 19 Jan 22 UTC
closed 03:43PM - 19 Jan 22 UTC
Ubuntu server 20.04 LTS; LXD 4.0.8
It seems it's no longer possible to migrat… e a container to another storage pool with `lxc move`.
I’m getting `Error: Invalid number of arguments` if I try the following:
```
lxc move <container_name> -s <storage_pool_name>
```
It works if I also rename the container (e.g. c1_tmp) in the same command, like so:
```
lxc move c1 c1_tmp -s zfs2
```
See also: https://discuss.linuxcontainers.org/t/migrate-from-one-storage-pool-to-another/10877/7
Apparently, the following is supposed to work, but doesn't for me:
```
lxc storage create zfs1 zfs
lxc storage create zfs2 zfs
lxc init images:ubuntu/focal c1 -s zfs1
lxc move c1 -s zfs2
```
I did not expect that.