KVM/Offline Migrate or move a virtual machine between two KVM servers without shared storage
Appearance
< 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_MACHINEandvirsh autostart VM_MACHINE --disable - 2. Create a configuration xml dump:
virsh dumpxml VM_MACHINE> VM_MACHINE_dump.xml - 3.
cpfiles to new server image directory:/var/lib/libvirt/imagesorvirsh 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