KVM/Offline Migrate or move a virtual machine between two KVM servers without shared storage
< KVM
How To offline Migrate or move a virtual machine between two KVM servers without shared storage [1]
Overview: virsh dumpxml
and virsh define
- 1. Stop you VMs:
virsh shutdown VM_MACHINE
andvirsh autostart VM_MACHINE --disable
- 2. Create a configuration xml dump:
virsh dumpxml VM_MACHINE
> VM_MACHINE_dump.xml - 3.
cp
files to new server image directory:/var/lib/libvirt/images
orvirsh vol-list POOL_NAME --details
(verify files owner and group) - 4. Depending on your Origin and destination host you may need to edit xml file and modify network interface and remove MAC address. (See MacVTap)
- 5. Create machine but do not start it:
virsh define VM_MACHINE_dump.xml
(virsh list --all) - 6. Configure autostart:
virsh autostart VM_MACHINE
- 7. Start Machine:
virsh start VM_MACHINE