[libvirt] [PATCH v8][re-send] support offline migration

Daniel P. Berrange berrange at redhat.com
Fri Sep 21 10:50:18 UTC 2012


On Thu, Sep 20, 2012 at 01:33:39PM +0800, liguang wrote:
> original migration did not aware of offline case
> so, add code to support offline migration quietly
> (did not disturb original migration) by pass
> VIR_MIGRATE_OFFLINE flag to migration APIs if only
> the domain is really inactive, and
> migration process will not puzzled by domain
> offline and exit unexpectedly.
> these changes did not take care of disk images the
> domain required, for them could be transferred by
> other APIs as suggested, then VIR_MIGRATE_OFFLINE
> should not combined with VIR_MIGRATE_NON_SHARED_*.
> so, this migration result is just make domain
> definition alive at target side.
> 
> Signed-off-by: liguang <lig.fnst at cn.fujitsu.com>

I've tested this patch and it does not appear to work at all

I have 2 hosts, avocado & mustard, and guest 'vm1' I want
to migrate from avocado to mustard:

# virsh -c avocado list --all
 Id    Name                           State
----------------------------------------------------
 -     debian6-x86_64                 shut off
 -     f13x86_64                      shut off
 -     f16_x86_64                     shut off
 -     f16x86_64                      shut off
 -     f18x86_64                      shut off
 -     freebsd-8.2-x86_64             shut off
 -     netbsd-5.1-x86_64              shut off
 -     openbsd-4.9-x86_64             shut off
 -     opensuse-11.4-x86_64           shut off
 -     rhel5x86_64                    shut off
 -     rhel6x86_64                    shut off
 -     rhel6x86_64ga                  shut off
 -     ubuntu-11.10-x86_64            shut off
 -     vm1                            shut off

# virsh -c mustard list --all
 Id    Name                           State
----------------------------------------------------
 2     instance-00000001              running
 -     rhel6x86_64                    shut off


The guest is not running:

# virsh -c avocado dominfo vm1
Id:             -
Name:           vm1
UUID:           c7b3edbd-edaf-9455-926a-d65c16db1800
OS Type:        hvm
State:          shut off
CPU(s):         1
Max memory:     219200 kB
Used memory:    219136 kB
Persistent:     yes
Autostart:      disable
Managed save:   no
Security model: selinux
Security DOI:   0


So a normal migrate fails, which is good.

  # virsh -c avocado migrate vm1 mustard
  error: Requested operation is not valid: domain is not running



Now I try your new offline migrate, which claims to succeed

  # virsh -c avocado migrate --offline vm1 mustard

We should have rejected an attempt to use --offline, unless the user
has also specified either --persistent, or --copy-storage-all


Now I repeat using --persistent which succeeds:

  # virsh -c avocado migrate --persistent --offline vm1 mustard

But it has not created the guest on the target:

  # virsh -c mustard list --all
   Id    Name                           State
  ----------------------------------------------------
   2     instance-00000001              running
   -     rhel6x86_64                    shut off


Also if I add --undefinesource it also succeeds

  # /home/berrange/src/virt/libvirt/tools/virsh -c avocado migrate --persistent --undefinesource --offline vm1 mustard


But again has not created the guest on the target

  # virsh -c mustard list --all
   Id    Name                           State
  ----------------------------------------------------
   2     instance-00000001              running
   -     rhel6x86_64                    shut off

Now has it removed it on the source

  # virsh -c avocado list --all
   Id    Name                           State
  ----------------------------------------------------
   -     debian6-x86_64                 shut off
   -     f13x86_64                      shut off
   -     f16_x86_64                     shut off
   -     f16x86_64                      shut off
   -     f18x86_64                      shut off
   -     freebsd-8.2-x86_64             shut off
   -     netbsd-5.1-x86_64              shut off
   -     openbsd-4.9-x86_64             shut off
   -     opensuse-11.4-x86_64           shut off
   -     rhel5x86_64                    shut off
   -     rhel6x86_64                    shut off
   -     rhel6x86_64ga                  shut off
   -     ubuntu-11.10-x86_64            shut off
   -     vm1                            shut off



Regards,
Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|




More information about the libvir-list mailing list