libvirt manual migration

Following scenario:

You have 2 servers. No shared storage.
You would like to move VMs from Server A to Server B.

If you want a clean filesystem there will be downtime.
Downtime will take as long as it needs to copy the image from one server to the other.

Step 1:

Shutdown the instance running on the source server.

Step 2:

Copy the image, usually located in /var/lib/libvirt/images/ , from source to destination.

Step 3:

Dumo the configuration xml of your vm and copy it to the destination server

This will copy to the home directory of the destination server, in this case /root/ (implied by the : after the server name)

Step 4:

Import the copied xml domain configuration on the destination server.
The MAC address probably changed, depending on your data center’s setup you’d need to edit the xml file accordingly.
The domain import command is

Step 5:
Finish it up.
Change network configuration from inside the guest.
You will need to login via spice console.
It’s best to use the great tool “Virtual Machine Manager” for this job.
Remember to keep your VM’s root password ready.

Spread the love

Leave a Reply

Your email address will not be published. Required fields are marked *