[libvirt-users] Clarification about virsh migration options

I am trying to work out what all the options are for migrating a KVM machine to another KVM machine, without using shared storage. The documentation is not quite verbose and not intuitive, so I'm hoping someone can explain this to me. The man pages show this syntax: migrate optional --live --p2p --direct --tunnelled --persistent --undefinesource --suspend --copy-storage-all --copy-storage-inc domain-id desturi migrateuri dname The 'live' and 'suspend' options are clear. The 'undefinesource' option is straightforward as well. But what does 'persistent' mean? I mean, when transferring a VM to a destination, it will be available on the destination when migration completes, so what does 'persistent' mean in this context? The p2p, direct and tunneled options are not. When migrating, I assume it is possible to let the underlying virtualisation framework handle the migration - so I assume 'direct' means Qemu-KVM gets to migrate the VM and 'tunneled' means the RPC mechanism of libvirt migrates the machine. But what does 'p2p' mean? Normally, peer-to-peer implies direct communication, but since there is a 'direct' mode, I'm clueless what this option does. On a side note: is it possible to use tunneled mode to transfer VMs from for example Xen to KVM? Then I have some questions about the non-shared storage migration. I really like this option as most of my virtualized servers are run on one or two physical systems without shared VM storage. Migrating those VMs without downtime would be awesome. If I migrate the VMs, I assume the storage of the VM is places in the libvirt default storage location. But what is the difference between 'copy-storage-all' and 'copy-storage-inc'? Incremental hints that it would save incremental changes without actually transferring the storage between hosts. But how is that possible if the storage was not shared in the first place? Lots of questions but I hope someone who has done this before can answer some of these things. Regards, Berend Dekens

于 2011年02月08日 23:29, Berend Dekens 写道:
I am trying to work out what all the options are for migrating a KVM machine to another KVM machine, without using shared storage. The documentation is not quite verbose and not intuitive, so I'm hoping someone can explain this to me. The man pages show this syntax:
migrate optional --live --p2p --direct --tunnelled --persistent --undefinesource --suspend --copy-storage-all --copy-storage-inc domain-id desturi migrateuri dname
The 'live' and 'suspend' options are clear. The 'undefinesource' option is straightforward as well.
But what does 'persistent' mean? I mean, when transferring a VM to a destination, it will be available on the destination when migration completes, so what does 'persistent' mean in this context?
It means the domain conf will be saved on your disk, e.g. /etc/libvirt/qemu/$domain.xml. Without specifying it, your domain will be disappear after destroying, that means your domain is transicient, opposite meaning of persistent.
The p2p, direct and tunneled options are not. When migrating, I assume it is possible to let the underlying virtualisation framework handle the migration - so I assume 'direct' means Qemu-KVM gets to migrate the VM and 'tunneled' means the RPC mechanism of libvirt migrates the machine. But what does 'p2p' mean? Normally, peer-to-peer implies direct communication, but since there is a 'direct' mode, I'm clueless what this option does.
It's a mess, though I known something about it, but can't explain it very well, leaving it to others who has good knownledge of it.. :-)
On a side note: is it possible to use tunneled mode to transfer VMs from for example Xen to KVM?
No, xen doesn't support tunneled and peer2peer migration.
Then I have some questions about the non-shared storage migration. I really like this option as most of my virtualized servers are run on one or two physical systems without shared VM storage. Migrating those VMs without downtime would be awesome.
If I migrate the VMs, I assume the storage of the VM is places in the libvirt default storage location. But what is the difference between 'copy-storage-all' and 'copy-storage-inc'? Incremental hints that it would save incremental changes without actually transferring the storage between hosts. But how is that possible if the storage was not shared in the first place?
The incremental migration requires you have the image on destination host for the domain. e.g. assume you need to migrate the domains from time to time, then only the first time need "copy-storage-all". Regards Osier

On 11/02/2011, at 9:04 PM, Osier Yang wrote: <snip>
But what does 'persistent' mean? I mean, when transferring a VM to a destination, it will be available on the destination when migration completes, so what does 'persistent' mean in this context?
It means the domain conf will be saved on your disk, e.g. /etc/libvirt/qemu/$domain.xml. Without specifying it, your domain will be disappear after destroying, that means your domain is transicient, opposite meaning of persistent.
This might help explain the difference as well: http://wiki.libvirt.org/page/VM_lifecycle#Transient_guest_domains_vs_Persist... There is also migration info on that page, but it's fairly basic so not sure how useful. Worth checking, just in case though. :) Regards and best wishes, Justin Clift

On 02/12/2011 09:41 AM, Justin Clift wrote:
This might help explain the difference as well:
http://wiki.libvirt.org/page/VM_lifecycle#Transient_guest_domains_vs_Persist...
There is also migration info on that page, but it's fairly basic so not sure how useful. Worth checking, just in case though. :)
Cheers for the clarifications. I've been experimenting with 2 Qemu+KVM+libvirt systems but I cannot get the block migration to work: virsh # migrate --live ISPConfig qemu+ssh://192.168.2.9/system --tunnelled --p2p --persistent --copy-storage-all error: internal error process exited while connecting to monitor: char device redirected to /dev/pts/5 qemu: could not open disk image /mnt/storage/Virtual Machines/KVM/ispconfig_drive.img: No such file or directory I run the virsh on the current host and 192.168.2.9 is the new VM host. I see the following on the current host in message output: Feb 16 14:57:54 cyberxps qemu: could not open disk image /mnt/storage/Virtual Machines/KVM/ispconfig_drive.img: No such file or directory Feb 16 15:00:56 cyberxps libvirtd: 15:00:56.999: 2850: debug : remoteIO:10438 : internal error process exited while connecting to monitor: 15:00:17.990: debug : qemudInitCpuAffinity:2459 : Setting CPU affinity Feb 16 15:00:56 cyberxps 15:00:17.991: debug : qemuSecurityDACSetProcessLabel:547 : Dropping privileges of VM to 114:123 Feb 16 15:00:56 cyberxps char device redirected to /dev/pts/5 Feb 16 15:00:56 cyberxps qemu: could not open disk image /mnt/storage/Virtual Machines/KVM/ispconfig_drive.img: No such file or directory This looks to me like at some point the block migration is failing ('internal error ... monitor'?), but why? On the target host I can only see the same error messages but no clues as to why it fails. Regards, Berend Dekens
participants (3)
-
Berend Dekens
-
Justin Clift
-
Osier Yang