Red Hat Enterprise Linux 6 Essentials eBook now available in PDF and ePub formats for only $9.99 RHEL 6 Essentials contains 40 chapters and over 250 pages.
18.3. Live KVM migration with virsh
A guest can be migrated to another host with the virsh command. The migrate command accepts parameters in the following format:
# virsh migrate --live GuestName DestinationURL
The GuestName parameter represents the name of the guest which you want to migrate.
The DestinationURL parameter is the URL or hostname of the destination system. The destination system must run the same version of Red Hat Enterprise Linux, be using the same hypervisor and have libvirt running.
Once the command is entered you will be prompted for the root password of the destination system.
Example: live migration with virsh
This example migrates from test1.example.com to test2.example.com. Change the host names for your environment. This example migrates a virtual machine named RHEL4test.
This example assumes you have fully configured shared storage and meet all the prerequisites (listed here: Migration requirements).
Verify the guest is running
From the source system, test1.example.com, verify RHEL4test is running:
[[email protected] ~]# virsh list
Id Name State
10 RHEL4 running
Migrate the guest
Execute the following command to live migrate the guest to the destination, test2.example.com. Append /system to the end of the destination URL to tell libvirt that you need full access.