Migrating KVM hosts with virsh


I played around with KVM live migration over the weekend, and it worked flawlessly. When I was first getting the environment (i.e., /etc/libvirt/libvirtd.conf, /etc/sysconfig/libvirt, SASL credentials, etc.) set up to allow migrations to work, I was greeted with the following error:

virsh # **migrate --live kvmnode1 qemu+tcp://thecrue/system**
error: invalid argument in only tcp URIs are supported for KVM
migrations

This message wasn’t the most descriptive error I’ve ever read, so I turned to the libvirt source to see what was going on. I saw the following comment:

/* Prepare is the first step, and it runs on the destination host. */

And immediately fired up virsh to double check the migrate syntax I was using:

$ virsh

Welcome to virsh, the virtualization interactive terminal.

Type: 'help' for help with commands
'quit' to quit

virsh # help migrate
.....
migrate [--live] <domain> <desturi> [<migrateuri>] [<dname>]

I had accidently run the migrate command from the destination host instead of the source host. Once I knew what was going on, I fired off the migrate from the source host and everything worked flawlessly:

virsh # migrate –live kvmnode1 qemu+tcp://thecrue/system

virsh #

I really dig KVM, and have recently become somewhat smitten with openvz. Both technologies rock, and I hope to talk about my experiences with each virtualization technology sometime in the future.

This article was posted by Matty on 2009-06-15 11:53:00 -0400 -0400