Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 589989 - RFE: support for seemless SPICE migration
RFE: support for seemless SPICE migration
Status: CLOSED CURRENTRELEASE
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: libvirt (Show other bugs)
6.0
All Linux
low Severity medium
: rc
: ---
Assigned To: Daniel Veillard
Virtualization Bugs
: FutureFeature
Depends On:
Blocks: 620748 730753
  Show dependency treegraph
 
Reported: 2010-05-07 09:10 EDT by Daniel Berrange
Modified: 2011-08-15 12:27 EDT (History)
9 users (show)

See Also:
Fixed In Version: libvirt-0.8.1-2.el6
Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of:
: 620748 730753 (view as bug list)
Environment:
Last Closed: 2010-11-10 16:05:25 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
spice migration (249.38 KB, image/png)
2010-07-22 09:25 EDT, weizhang
no flags Details

  None (edit)
Description Daniel Berrange 2010-05-07 09:10:02 EDT
Description of problem:

SPICE supports seemless reconnect of clients after migration of a guest. This is done by issing the following command on the src QEMU before migration starts

   __com.redhat_spice_migrate_info hostname port tls-port cert-subject

libvirt needs to support this feature.

Version-Release number of selected component (if applicable):
libvirt-0.8.1

How reproducible:
Always

Steps to Reproduce:
1. Launch a guest using SPICE graphics, eg

    <graphics type='spice' port='5900' tlsPort='5901' autoport='yes' keymap='en-us'/>


2. Connect using  spicec client app
3. Trigger migration fo the guest to another host
  
Actual results:
The spice client disconnects after migration

Expected results:
The spice client remains connected & active throughout migration & after completion

Additional info:
Comment 2 RHEL Product and Program Management 2010-05-07 10:07:37 EDT
This request was evaluated by Red Hat Product Management for inclusion in a Red
Hat Enterprise Linux major release.  Product Management has requested further
review of this request by Red Hat Engineering, for potential inclusion in a Red
Hat Enterprise Linux Major release.  This request is not yet committed for
inclusion.
Comment 3 Daniel Veillard 2010-05-07 12:30:33 EDT
libvirt-0.8.1-2.el6 has been built in RHEL-6-candidate with the patch

Daniel
Comment 6 Daniel Berrange 2010-05-13 08:00:30 EDT
FYI the v1 patch for this RFE was found to contain a bug in PEER2PEER migration as per 

https://bugzilla.redhat.com/show_bug.cgi?id=591551
Comment 7 weizhang 2010-07-22 09:19:18 EDT
I test with the following steps:
1. #iptables -F
   #setenforce 0
and connect the remote connection 10.66.93.195 and set nfs on both side

2. define spice.xml like this
<domain type='kvm'>
  <name>spice</name>
  <uuid>6bd72aef-3661-8400-ab2c-c15c935cdd85</uuid>
  <memory>524288</memory>
  <currentMemory>524288</currentMemory>
  <vcpu>1</vcpu>
  <os>
    <type arch='x86_64' machine='rhel6.0.0'>hvm</type>
    <boot dev='hd'/>
  </os>
  <features>
    <acpi/>
    <apic/>
    <pae/>
  </features>
  <clock offset='utc'/>
  <on_poweroff>destroy</on_poweroff>
  <on_reboot>restart</on_reboot>
  <on_crash>restart</on_crash>
  <devices>
    <emulator>/usr/libexec/qemu-kvm</emulator>
    <disk type='file' device='disk'>
      <driver name='qemu' type='raw' cache='none'/>
      <source file='/var/lib/libvirt/images/netfs/RHEL55-i386.img'/>
      <target dev='hda' bus='ide'/>
      <address type='drive' controller='0' bus='0' unit='0'/>
    </disk>
    <controller type='ide' index='0'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/>
    </controller>
    <interface type='network'>
      <mac address='52:54:00:aa:da:4e'/>
      <source network='default'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
    </interface>
    <serial type='pty'>
      <target port='0'/>
    </serial>
    <console type='pty'>
      <target port='0'/>
    </console>
    <input type='mouse' bus='ps2'/>
    <graphics type='spice' port='5900' tlsPort='5901' autoport='yes' keymap='en-us'/>
    <sound model='ac97'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
    </sound>
    <video>
      <model type='cirrus' vram='9216' heads='1'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
    </video>
  </devices>
</domain>

3. #virsh define spice.xml
4. #virsh start spice
5. #/usr/libexec/spicec -h 127.0.0.1 -p 5900
6. #virsh migrate --live test-mig qemu+ssh://10.66.93.195/system

an error occured when doing migration: the spicec is stoped and the domain spice is destoried

pop-up information:

Unable to migrate guest:
 Traceback (most recent call last):
  File "/usr/share/virt-manager/virtManager/migrate.py", line 457, in _async_migrate
    vm.migrate(dstconn, migrate_uri, rate, live, secure)
  File "/usr/share/virt-manager/virtManager/domain.py", line 1387, in migrate
    self._backend.migrate(destconn.vmm, flags, newname, interface, rate)
  File "/usr/lib64/python2.6/site-packages/libvirt.py", line 511, in migrate
    if ret is None:raise libvirtError('virDomainMigrate() failed', dom=self)
libvirtError: cannot send monitor command '{"execute":"query-migrate"}': Connection reset by peer

on /var/log/messages 

Jul 22 21:08:01 dhcp-66-92-126 abrt[3955]: saved core dump of pid 3512 (/usr/libexec/qemu-kvm) to /var/spool/abrt/ccpp-1279804074-3512.new/coredump (625086464 bytes)
Jul 22 21:08:01 dhcp-66-92-126 abrtd: Directory 'ccpp-1279804074-3512' creation detected
Jul 22 21:08:01 dhcp-66-92-126 abrtd: Size of '/var/spool/abrt' >= 1000 MB, deleting 'ccpp-1279803344-18292'
Jul 22 21:08:01 dhcp-66-92-126 libvirtd: 21:08:01.286: error : qemuMonitorJSONCommandWithFd:242 : cannot send monitor command '{"execute":"query-migrate"}': Connection reset by peer
Jul 22 21:08:01 dhcp-66-92-126 avahi-daemon[1633]: Withdrawing address record for fe80::94dc:7aff:fe17:9fbc on vnet0.
Jul 22 21:08:01 dhcp-66-92-126 kernel: virbr0: port 1(vnet0) entering disabled state
Jul 22 21:08:01 dhcp-66-92-126 kernel: device vnet0 left promiscuous mode
Jul 22 21:08:01 dhcp-66-92-126 kernel: virbr0: port 1(vnet0) entering disabled state
Jul 22 21:08:01 dhcp-66-92-126 abrtd: New crash /var/spool/abrt/ccpp-1279804074-3512, processing


on /var/log/libvirt/qemu/spice.log

spice_server_migrate_start: 
handle_dev_input: stop
qemu-kvm: migration.c:295: migrate_fd_cleanup: Assertion `s->state != 2' failed.
Comment 8 Daniel Berrange 2010-07-22 09:23:03 EDT
Please provide the libvirt guest XML and the /var/log/libvirt/qemu/$GUEST.log file. QEMU crashing doesn't sound like it'll be a bug in libvirt's seemless SPICE migration  though.
Comment 9 weizhang 2010-07-22 09:25:41 EDT
Created attachment 433694 [details]
spice migration

when migration, it occured . Look at the warning.
The MaxCrashReportSize in my system is 1000
Comment 10 weizhang 2010-07-22 09:28:23 EDT
following the comment 7

[root@dhcp-66-92-126 images]# rpm -qa libvirt
libvirt-0.8.1-15.el6.x86_64
[root@dhcp-66-92-126 images]# uname -r
2.6.32-44.2.el6.x86_64
[root@dhcp-66-92-126 images]# rpm -qa qemu-kvm
qemu-kvm-0.12.1.2-2.97.el6.x86_64
[root@dhcp-66-92-126 images]# rpm -qa spice-client
spice-client-0.4.2-15.el6.x86_64
Comment 12 Chris Lalancette 2010-08-03 07:57:39 EDT
Since this looks like a bug in qemu, I'm going to clone this over to qemu and set this back to ON_QA (but note that we may not be able to VERIFY it before we figure out the qemu problem).

Chris Lalancette
Comment 13 weizhang 2010-08-06 05:10:21 EDT
I test it again with steps of comment 7 and after migration, the spice client disconnected with WARN:

[root@dhcp-66-92-126 images]# /usr/libexec/spicec -h 127.0.0.1 -p 5902
WARN    : [12952:12954] RedChannel::run: cannot resolve host address dhcp-93-195.nay.redhat.com
Comment 14 Daniel Berrange 2010-08-06 05:19:58 EDT
This does not look like a problem with libvirt impl of SPICE migration. The warning message shows you have a missing configuration with spicec being unable to resolve the hostname.
Comment 15 weizhang 2010-08-06 05:27:37 EDT
But I have already connected before migration an no problem. After migration, it stopped
Comment 16 Daniel Berrange 2010-08-06 05:30:27 EDT
That problem should be reported against the spice client, not libvirt.
Comment 19 Johnny Liu 2010-08-12 00:12:00 EDT
Verified this defect with libvirt-0.8.1-23.el6.x86_64, and PASSED.

libvirt-0.8.1-23.el6.x86_64
qemu-kvm-0.12.1.2-2.109.el6.x86_64
kernel-2.6.32-63.el6.x86_64
spice-client-0.4.2-18.el6.x86_64


1. Define a domain with spice graphic.
...
<graphics type='spice' port='5900' tlsPort='5901' autoport='yes' keymap='en-us'/>
...

2. Edit the following line in /etc/libvirt/qemu.conf:
from:
# spice_listen = "0.0.0.0"
to 
spice_listen = "0.0.0.0"

3. Restart libvirtd service

4. Start the domain on source host (10.66.93.84)
# virsh start spice

5. Use spice client to connect the domain on source host.
# /usr/libexec/spicec -h 10.66.93.84 -p 5900

6. Migrate the domain to destination host (10.66.92.185)
# virsh migrate --live spice qemu+ssh://10.66.92.185/system

7. Check the spice client on the source host during migration.

Found that the spice client remains connected & active throughout migration & after completion.

So this bug is fixed.
Comment 20 Johnny Liu 2010-08-12 01:03:32 EDT
BTW, about the warning in comment 13:
# /usr/libexec/spicec -h 127.0.0.1 -p 5902
WARN    : [12952:12954] RedChannel::run: cannot resolve host address
dhcp-93-195.nay.redhat.com    

It is because the destination host name - dhcp-93-195.nay.redhat.com, can not be resolved. I guess need add a entry in /etc/hosts on source host, such as:
10.66.93.195    dhcp-93-195.nay.redhat.com
Comment 21 releng-rhel@redhat.com 2010-11-10 16:05:25 EST
Red Hat Enterprise Linux 6.0 is now available and should resolve
the problem described in this bug report. This report is therefore being closed
with a resolution of CURRENTRELEASE. You may reopen this bug report if the
solution does not work for you.

Note You need to log in before you can comment on or make changes to this bug.