RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 589989 - RFE: support for seemless SPICE migration
Summary: RFE: support for seemless SPICE migration
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: libvirt
Version: 6.0
Hardware: All
OS: Linux
low
medium
Target Milestone: rc
: ---
Assignee: Daniel Veillard
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks: 620748 730753
TreeView+ depends on / blocked
 
Reported: 2010-05-07 13:10 UTC by Daniel Berrangé
Modified: 2011-08-15 16:27 UTC (History)
9 users (show)

Fixed In Version: libvirt-0.8.1-2.el6
Doc Type: Enhancement
Doc Text:
Clone Of:
: 620748 730753 (view as bug list)
Environment:
Last Closed: 2010-11-10 21:05:25 UTC
Target Upstream Version:
Embargoed:


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

Description Daniel Berrangé 2010-05-07 13:10:02 UTC
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 Program Management 2010-05-07 14:07:37 UTC
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 16:30:33 UTC
libvirt-0.8.1-2.el6 has been built in RHEL-6-candidate with the patch

Daniel

Comment 6 Daniel Berrangé 2010-05-13 12:00:30 UTC
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 13:19:18 UTC
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 Berrangé 2010-07-22 13:23:03 UTC
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 13:25:41 UTC
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 13:28:23 UTC
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 11:57:39 UTC
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 09:10:21 UTC
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 Berrangé 2010-08-06 09:19:58 UTC
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 09:27:37 UTC
But I have already connected before migration an no problem. After migration, it stopped

Comment 16 Daniel Berrangé 2010-08-06 09:30:27 UTC
That problem should be reported against the spice client, not libvirt.

Comment 19 Johnny Liu 2010-08-12 04:12:00 UTC
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 05:03:32 UTC
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 21:05:25 UTC
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.