How to reorganize cts and vms and swap storage pools?

Martini2

Member
Jan 28, 2022
18
0
6
54
Hello,
i need to reorganize my containers and vms on the storage pools i have. Basically i want to swap 'zpool1' with 'zpool2' and put the ct and vm files in one folder/place. Also as live snapshots do not work i think i need to change the kind of the backup storage from 'directory' to 'zfs pool'.
What would be the safest and quickest way to do this?
Code:
$ zpool list
NAME     SIZE  ALLOC   FREE  CKPOINT  EXPANDSZ   FRAG    CAP  DEDUP    HEALTH  ALTROOT
rpool    118G  75.4G  42.6G        -         -    24%    63%  1.00x    ONLINE  -
zpool1   928G   566G   362G        -         -    28%    61%  1.00x    ONLINE  -
zpool2  1.81T   141G  1.68T        -         -     0%     7%  1.00x    ONLINE  -
zpool3  14.5T  12.7T  1.79T        -         -     5%    87%  1.00x    ONLINE  -

 $ zfs list
NAME                                        USED  AVAIL     REFER  MOUNTPOINT
rpool                                      75.4G  39.0G      104K  none
rpool/ROOT                                 75.3G  39.0G       96K  none
rpool/ROOT/pve-1                           75.3G  39.0G     29.6G  /
rpool/data                                   96K  39.0G       96K  none
zpool1                                      566G   333G       27K  /zpool1
zpool1/cdata                               25.2G   333G     25.2G  /zpool1/cdata
zpool1/vmdata                               541G   333G       24K  /zpool1/vmdata
zpool1/vmdata/vm-100-disk-0                  12K   333G       12K  -
zpool1/vmdata/vm-102-disk-0                6.54G   333G     6.54G  -
zpool1/vmdata/vm-103-disk-0                  12K   333G       12K  -
zpool1/vmdata/vm-104-disk-0                3.35G   333G     3.35G  -
zpool1/vmdata/vm-104-disk-1                34.9G   333G     34.9G  -
zpool1/vmdata/vm-105-disk-0                10.3G   333G     8.42G  -
zpool1/vmdata/vm-105-state-dietpi20210808   247M   333G      247M  -
zpool1/vmdata/vm-106-disk-0                14.8G   333G     14.8G  -
zpool1/vmdata/vm-200-disk-0                29.8G   333G     29.8G  -
zpool1/vmdata/vm-200-disk-1                19.5K   333G     19.5K  -
zpool1/vmdata/vm-300-disk-0                 278G   333G      278G  -
zpool1/vmdata/vm-301-disk-0                6.18G   333G     6.18G  -
zpool1/vmdata/vm-302-disk-0                6.58G   333G     6.19G  -
zpool1/vmdata/vm-302-state-first            655M   333G      655M  -
zpool1/vmdata/vm-399-disk-0                6.56G   333G     6.56G  -
zpool1/vmdata/vm-400-disk-0                 102G   333G      102G  -
zpool1/vmdata/vm-400-disk-1                  12K   333G       12K  -
zpool1/vmdata/vm-400-disk-2                  12K   333G       12K  -
zpool1/vmdata/vm-400-disk-3                  12K   333G       12K  -
zpool1/vmdata/vm-501-disk-0                32.0G   333G     32.0G  -
zpool1/vmdata/vm-502-disk-0                2.09G   333G     2.09G  -
zpool1/vmdata/vm-503-disk-0                  12K   333G       12K  -
zpool1/vmdata/vm-504-disk-0                  12K   333G       12K  -
zpool1/vmdata/vm-505-disk-0                7.12G   333G     7.12G  -
zpool2                                      141G  1.62T     6.24G  /zpool2
zpool2/cvmdata                               24K  1.62T       24K  /zpool2/cvmdata
zpool2/shares                               134G  1.62T      133G  /zpool2/shares
zpool2/vztmp                                 26K  1.62T       26K  /mnt/vztmp
zpool3                                     12.7T  1.66T      104K  /zpool3
zpool3/backups                             2.56T  1.66T     2.56T  /zpool3/backups
zpool3/shares                              10.2T  1.66T     9.43T  /zpool3/shares

$ cat /etc/pve/storage.cfg
dir: local
        path /var/lib/vz
        content vztmpl,iso
        prune-backups keep-last=2,keep-monthly=11
        shared 0

dir: zpool3_backups
        path /zpool3/backups
        content backup
        prune-backups keep-last=8,keep-monthly=11,keep-yearly=3
        mkdir 0
        shared 0

dir: zpool1_cdata
        path /zpool1/cdata
        content rootdir
        mkdir 0
        shared 0

zfspool: zpool1_vmdata
        pool zpool1/vmdata
        content images
        sparse 1

dir: zpool2_cvmdata
        path /zpool2/cvmdata
        content images
        prune-backups keep-all=1
        shared 0
 
You can shutdown a VM, go to the VMs hardware tab, click on each virtual disk and then click the "move disk" button to move the disks to another storage on your zpool2.
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!