7 migration kvm-virtualization
我有一个 KVM 来宾,需要从一台主机迁移到另一台主机。迁移不需要热进行。它的存储目前由 LVM 块设备支持,带有桥接网络适配器。两台服务器具有相同的内核、libvirt 版本、qemu 等。最简单的方法是什么?
我对此的猜测是:
dd the block devices from server A to server B
export the xml VM definition on A, copy it to B
edit the xml to refer to the new physical device names
create the machine referencing that xml file
Run Code Online (Sandbox Code Playgroud)
你是对的。我已经这样做了几次。我使用netcat对网络上的驱动器进行映像。这是我使用的方法:
nc -l 1234 | dd of=/dev/<vgname>/<lvname>在目标主机上运行。这告诉netcat侦听网络端口并将所有内容通过管道传输到逻辑卷。dd if=/dev/<vgname>/<lvname> | nc <targetip> 1234在源主机上运行。这告诉netcat通过网络将所有内容通过管道传输到目标主机。/etc/libvirt/qemu/源复制到目标。/etc/init.d/libvirt-bin reload应该做的伎俩(或systemctl restart libvirtd为分布在使用systemd)KVM(自 qemu 1.3 起)现在包含存储迁移功能,因此不再需要执行旧答案中显示的任何技巧。只需像往常一样迁移 VM,例如virsh migrate "Guest Name" qemu+ssh://dest-hypervisor/system或单击您选择的 GUI 中的漂亮按钮。
| 归档时间: |
|
| 查看次数: |
31812 次 |
| 最近记录: |