在不同的proxmox vm集群之间迁移虚拟机
proxmove的Python项目详细描述
示例运行
首先,您需要配置 ~/.proxmoverc ;请参见下文。
配置后,您可以执行以下操作:
$ proxmove banana-cluster the-new-cluster node2 node2-ssd the-vm-to-move 12:12:27: Attempt moving banana-cluster<e1400248> => the-new-cluster<6669ad2c> (node 'node2'): the-vm-to-move 12:12:27: - source VM the-vm-to-move@node1<qemu/565/running> 12:12:27: - storage 'ide2': None,media=cdrom (host=<unknown>, guest=<unknown>) 12:12:27: - storage 'virtio0': sharedsan:565/vm-565-disk-1.qcow2,format=qcow2,iops_rd=4000,iops_wr=500,size=50G (host=37.7GiB, guest=50.0GiB) 12:12:27: Creating new VM 'the-vm-to-move' on 'the-new-cluster', node 'node2' 12:12:27: - created new VM 'the-vm-to-move--CREATING' as UPID:node2:00005977:1F4D78F4:57C55C0B:qmcreate:126:user@pve:; waiting for it to show up 12:12:34: - created new VM 'the-vm-to-move--CREATING': the-vm-to-move--CREATING@node2<qemu/126/stopped> 12:12:34: Stopping VM the-vm-to-move@node1<qemu/565/running> 12:12:42: - stopped VM the-vm-to-move@node1<qemu/565/stopped> 12:12:42: Ejected (cdrom?) volume 'ide2' (none) added to the-vm-to-move--CREATING@node2<qemu/126/stopped> 12:12:42: Begin copy of 'virtio0' (sharedsan:565/vm-565-disk-1.qcow2,format=qcow2,iops_rd=4000,iops_wr=500,size=50G) to local-ssd 12:12:42: scp(1) copy from '/pool0/san/images/565/vm-565-disk-1.qcow2' (on sharedsan) to 'root@node2.the-new-cluster.com:/node2-ssd/temp/temp-proxmove/vm-126-virtio0' Warning: Permanently added 'node2.the-new-cluster.com' (ECDSA) to the list of known hosts. vm-565-disk-1.qcow2 100% 50GB 90.5MB/s 09:26 Connection to san.banana-cluster.com closed. 12:22:08: Temp data '/node2-ssd/temp/temp-proxmove/vm-126-virtio0' on local-ssd 12:22:08: Writing data from temp '/node2-ssd/temp/temp-proxmove/vm-126-virtio0' to '/dev/zvol/node2-ssd/vm-126-virtio0' (on local-ssd) (100.00/100%) Connection to node2.the-new-cluster.com closed. 12:24:25: Removing temp '/node2-ssd/temp/temp-proxmove/vm-126-virtio0' (on local-ssd) 12:24:26: Starting VM the-vm-to-move@node2<qemu/126/stopped> 12:24:27: - started VM the-vm-to-move@node2<qemu/126/running> 12:24:27: Completed moving banana-cluster<e1400248> => the-new-cluster<6669ad2c> (node 'node2'): the-vm-to-move
在此之前,要移动的虚拟机在香蕉集群上运行。
之后,要移动的vm在节点2上运行。 要在香蕉群集上移动的虚拟机已停止并重命名为 要移动的虚拟机--已迁移