Bug 1320904

Summary: RFE: Implement migration support with client fd
Product: Red Hat Enterprise Linux 8 Reporter: Fangge Jin <fjin>
Component: spice-gtkAssignee: Default Assignee for SPICE Bugs <rh-spice-bugs>
Status: CLOSED DEFERRED QA Contact: SPICE QE bug list <spice-qe-bugs>
Severity: medium Docs Contact:
Priority: medium    
Version: 8.1CC: dblechte, dyuan, fjin, fziglio, hhan, jjongsma, mtessun, mzhan, rbalakri, tpelka, tzheng, victortoso, xiaodwan, yafu, zpeng
Target Milestone: rc   
Target Release: 8.1   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-11-25 08:08:06 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
libvirtd log on both host and virt-viewer log
none
Debug log of virt-viewer none

Description Fangge Jin 2016-03-24 09:47:53 UTC
Created attachment 1139880 [details]
libvirtd log on both host and virt-viewer log

Description of problem:
Spice migration can't finish when running virt-viewer on a host other than the source host.

Version-Release number of selected component (if applicable):
libvirt-1.3.2-1.el7.x86_64
qemu-kvm-rhev-2.5.0-3.el7.x86_64
spice-gtk3-0.26-7.el7.x86_64
spice-gtk-python-0.26-7.el7.x86_64
spice-server-0.12.4-15.el7.x86_64
spice-gtk-0.26-7.el7.x86_64
spice-vdagent-0.14.0-10.el7.x86_64
spice-server-devel-0.12.4-15.el7.x86_64
spice-protocol-0.12.6-2.el7.noarch
spice-glib-0.26-7.el7.x86_64
virt-viewer-2.0-7.el7.x86_64

How reproducible:
90%

Steps to Reproduce:
0.
On host 10.66.6.200, start a guest with spice graphic
# virsh start rhel7.2

# virsh dumpxml rhel7.2
    <graphics type='spice' port='5900' autoport='yes' listen='0.0.0.0'>
      <listen type='address' address='0.0.0.0'/>
    </graphics>

1. 
On host 10.66.7.0:
# ssh-keygen
# ssh-copy-id 10.66.6.200
# ssh-copy-id 10.66.83.38
# virt-viewer -c qemu+ssh://10.66.6.200/system rhel7.2 --debug --spice-debug

2.
# virsh migrate rhel7.2 qemu+ssh://intel-q9550-4-2.englab.nay.redhat.com/system --live --verboseMigration: [100 %]

The memory has been migrated completely, but after a long time(more than 10mins), spice migration still doesn't finish, virsh command can't exit.


3. On target host
# virsh list
 Id    Name                           State
----------------------------------------------------
 7     rhel7.2                        running

4. On source host
# virsh list
 Id    Name                           State
----------------------------------------------------
 30    rhel7.2                        paused


5.On host 10.66.7.0, check socket connection, virt-viewer still connects to source host:
# netstat -tunap|grep ssh       
tcp        0      0 10.66.7.0:44457         10.66.6.200:22          ESTABLISHED 9183/ssh                      
tcp        0      0 10.66.7.0:44453         10.66.6.200:22          ESTABLISHED 9179/ssh            
tcp        0      0 10.66.7.0:44454         10.66.6.200:22          ESTABLISHED 9181/ssh            
tcp        0      0 10.66.7.0:44456         10.66.6.200:22          ESTABLISHED 9182/ssh            
tcp        0      0 10.66.7.0:44455         10.66.6.200:22          ESTABLISHED 9180/ssh            
tcp        0      0 10.66.7.0:44452         10.66.6.200:22          ESTABLISHED 9178/ssh            
tcp        0      0 10.66.7.0:44451         10.66.6.200:22          ESTABLISHED 9177/ssh    


6.Close virt-viewer connection, "virsh migrate" still doesn't exit.


Actual results:
Spice migration can' finish

Expected results:
Spice migration can finish

Additional info:
1. If run virt-viewer on source host(# virt-viewer rhel7.2), there is no such issue.
2. Run remote-viewer on host 10.66.7.0,there is no such issue.
3. If graphic type is vnc, "virsh migrate" can exit, but when I click inside the virt-viewer graphic, virt-viewer exits immediately.

Comment 2 Pavel Grunt 2016-06-30 15:09:56 UTC
Hi, is anything going on in the guest (like playing video) ?

May I ask you to retest it - there was a rebase of spice-gtk which contained migration related fixes (the latest version of spice-gtk is spice-gtk-0.31-3.el7).

Thanks

Comment 3 Fangge Jin 2016-07-01 05:49:17 UTC
I test again on the latest build, the behaviour is that virt-viwer process (launched by "virt-viewer -c qemu+ssh://<ip>/system <domain>") exits after migration.

Versions:
libvirt-1.3.5-1.el7.x86_64
spice-server-0.12.4-17.el7.x86_64
spice-protocol-0.12.11-1.el7.noarch
spice-gtk3-0.31-3.el7.x86_64
spice-gtk-0.31-3.el7.x86_64
spice-glib-0.31-3.el7.x86_64
virt-viewer-2.0-9.el7.x86_64

Steps:
1.Start guest with spice graphic and connect to guest via virt-viewer on another host:
# virt-viewer -c qemu+ssh://10.73.196.163/system rhel7 --debug --spice-debug

2.Do migration:
# virsh migrate rhel7 qemu+ssh://hp-dl385g7-05.lab.eng.pek2.redhat.com/system --live --verbose
Migration:[100%]

3.Check virt-viewer, it exits. The whole debug log is in the attached.

Additional info:
1) remote-viewer has no such problem
2) virt-viewer with option --direct has no such problem

Comment 4 Fangge Jin 2016-07-01 05:50:00 UTC
Created attachment 1174811 [details]
Debug log of virt-viewer

Comment 5 Pavel Grunt 2016-07-01 07:15:55 UTC
Thank you!

As stated in the logs:
(virt-viewer:12071): GSpice-WARNING **: migration with client provided fd is not supported yet

That is the reason why remote-viewer works (it doesn't connect to fd, but to the port)

(In reply to JinFangge from comment #3)
> I test again on the latest build, the behaviour is that virt-viwer process
> (launched by "virt-viewer -c qemu+ssh://<ip>/system <domain>") exits after
> migration.
> 
> Versions:
> libvirt-1.3.5-1.el7.x86_64
> spice-server-0.12.4-17.el7.x86_64
> spice-protocol-0.12.11-1.el7.noarch
> spice-gtk3-0.31-3.el7.x86_64
> spice-gtk-0.31-3.el7.x86_64
> spice-glib-0.31-3.el7.x86_64
> virt-viewer-2.0-9.el7.x86_64
> 
> Steps:
> 1.Start guest with spice graphic and connect to guest via virt-viewer on
> another host:
> # virt-viewer -c qemu+ssh://10.73.196.163/system rhel7 --debug --spice-debug

please, avoid running virt-viewer under the root superuser if possible

> 
> 2.Do migration:
> # virsh migrate rhel7
> qemu+ssh://hp-dl385g7-05.lab.eng.pek2.redhat.com/system --live --verbose
> Migration:[100%]
> 
> 3.Check virt-viewer, it exits. The whole debug log is in the attached.
> 
> Additional info:
> 1) remote-viewer has no such problem
> 2) virt-viewer with option --direct has no such problem

Do they work as expected according to the comment 1 - `remote-viewer` / `virt-viewer --direct` running on another host ?

Comment 6 Fangge Jin 2016-07-01 07:27:34 UTC
(In reply to Pavel Grunt from comment #5)
> Thank you!
> 
> As stated in the logs:
> (virt-viewer:12071): GSpice-WARNING **: migration with client provided fd is
> not supported yet
> 
> That is the reason why remote-viewer works (it doesn't connect to fd, but to
> the port)
> 
> (In reply to JinFangge from comment #3)
> > I test again on the latest build, the behaviour is that virt-viwer process
> > (launched by "virt-viewer -c qemu+ssh://<ip>/system <domain>") exits after
> > migration.
> > 
> > Versions:
> > libvirt-1.3.5-1.el7.x86_64
> > spice-server-0.12.4-17.el7.x86_64
> > spice-protocol-0.12.11-1.el7.noarch
> > spice-gtk3-0.31-3.el7.x86_64
> > spice-gtk-0.31-3.el7.x86_64
> > spice-glib-0.31-3.el7.x86_64
> > virt-viewer-2.0-9.el7.x86_64
> > 
> > Steps:
> > 1.Start guest with spice graphic and connect to guest via virt-viewer on
> > another host:
> > # virt-viewer -c qemu+ssh://10.73.196.163/system rhel7 --debug --spice-debug
> 
> please, avoid running virt-viewer under the root superuser if possible
Why ?
> 
> > 
> > 2.Do migration:
> > # virsh migrate rhel7
> > qemu+ssh://hp-dl385g7-05.lab.eng.pek2.redhat.com/system --live --verbose
> > Migration:[100%]
> > 
> > 3.Check virt-viewer, it exits. The whole debug log is in the attached.
> > 
> > Additional info:
> > 1) remote-viewer has no such problem
> > 2) virt-viewer with option --direct has no such problem
> 
> Do they work as expected according to the comment 1 - `remote-viewer` /
> `virt-viewer --direct` running on another host ?

Yes, `remote-viewer` / `virt-viewer --direct` running on another host work as expected: spice migration finishes successfully.

Comment 7 Pavel Grunt 2016-07-01 08:05:12 UTC
(In reply to JinFangge from comment #6)
> (In reply to Pavel Grunt from comment #5)
....
> > > 
> > > Steps:
> > > 1.Start guest with spice graphic and connect to guest via virt-viewer on
> > > another host:
> > > # virt-viewer -c qemu+ssh://10.73.196.163/system rhel7 --debug --spice-debug
> > 
> > please, avoid running virt-viewer under the root superuser if possible
> Why ?
It is not related to this bug, but I believe it is not a common usage and it is graphical application, we had issues (not working audio, strange resizes of the window...) because it was run under the root.

"$ virt-viewer -c qemu+ssh://10.73.196.163/system rhel7" should work without issues. 
> > 
> > > 
...
> > > 
> > > Additional info:
> > > 1) remote-viewer has no such problem
> > > 2) virt-viewer with option --direct has no such problem
> > 
> > Do they work as expected according to the comment 1 - `remote-viewer` /
> > `virt-viewer --direct` running on another host ?
> 
> Yes, `remote-viewer` / `virt-viewer --direct` running on another host work
> as expected: spice migration finishes successfully.

Thanks, so this bug is about implementing a new feature to support migration with client fd
  
Considering that there is a way to connect after the migration / keep connected during the migration, I move the bug to 7.4

Comment 8 Martin Tessun 2019-11-25 08:08:06 UTC
The workaround is to reopen the SPICE connection after the migration finishes. It cannot easily survive, as it connects to the host anyways. As such closing this RFE.