在集群中迁移客户机

容器

pct migrate 105 19pi-2 --restart --target-storage n2-sata1

https://pve.proxmox.com/pve-docs/pct.1.html#:~:text=of%20the%20VM.-,pct%20migrate,-%3Cvmid%3E%20%3Ctarget%3E

注意要在存储里关掉共享。

虚拟机

qm migrate 108 19pi-2 --targetstorage n2-sata1 --with-local-disks --online

https://pve.proxmox.com/pve-docs/qm.1.html#:~:text=of%20the%20VM.-,qm%20migrate,-%3Cvmid%3E%20%3Ctarget%3E

单节点移动存储

容器

pct move-volume 106 rootfs n2-sata1 --delete 1

如果出现以下错误,可以先 resize 一下

mount: /var/lib/lxc/106/.copy-volume-2: cannot mount /dev/loop0 read-only.
       dmesg(1) may have more information after failed mount system call.
Specified filename /var/lib/lxc/106/.copy-volume-1 does not exist.
command 'mount -o ro /dev/loop0 /var/lib/lxc/106/.copy-volume-2//' failed: exit code 32
pct resize 201 rootfs +1G

虚拟机

qm disk move 108 ide2 n2-sata1 --delete 1