Bug 1131445

Summary: Could not show process info for migration at once.
Product: Red Hat Enterprise Linux 7 Reporter: zhengqin <zsong>
Component: libvirtAssignee: Ján Tomko <jtomko>
Status: CLOSED ERRATA QA Contact: Virtualization Bugs <virt-bugs>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.0CC: dyuan, jtomko, mzhan, rbalakri, zhwang, zpeng
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: libvirt-1.2.8-1.el7 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-03-05 07:42:41 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:

Description zhengqin 2014-08-19 10:18:48 UTC
Description of problem:


Version-Release number of selected component (if applicable):
libvirt-1.2.7-1.el7.x86_64
qemu-kvm-rhev-2.1.0-1.el7.x86_64
kernel-3.10.0-142.el7.x86_64


How reproducible:
100%

Steps to Reproduce:
1. Set up migration env with nfs

2. On source site, prepare a running guest (rhel6-guest), run following
command:

[root@rhel7-a /]# virsh migrate --live rhel6-guest
qemu+ssh://destEnv/system --verbose
root.4.230's password:

3. After enter password and "enter"


Actual results:
1. No info output.
2. Process info will be shown after press "enter" again.


Expected results:
1. Related info should be shown after input password at once.

Comment 1 Ján Tomko 2014-08-19 10:49:47 UTC
Fixed upstream by:
commit 7eabd5503e3de147b703c1a1e6dff81cdc46d1e7
Author:     Chunyan Liu <cyliu>
AuthorDate: 2014-08-08 16:44:36 +0800
Commit:     Ján Tomko <jtomko>
CommitDate: 2014-08-19 11:32:51 +0200

    cmdMigrate: move vshConnect before vshWatchJob
    
    A possible fix to issue:
    http://www.redhat.com/archives/libvir-list/2014-August/thread.html#00227
    
    While doing migration on KVM host, found problem sometimes:
    VM is already running on the target host and disappears from source
    host, but 'virsh migrate' command line hangs, cannot exit normally.
    If pressing "ENTER" key, it will exit.
    
    The code hangs at tools/virsh-domain.c: cmdMigrate
    ->vshWatchJob->poll():
    poll() is trying to select pipe_fd, which is used to receive message
    from doMigrate thread. In debugging, found that doMigrate finishes
    and at the end it does call safewrite() to write the retval ('0' or
    '1') to pipe_fd, and the write is completed. But cmdMigrate poll()
    cannot get the event. If pressing "ENTER" key, poll() can get the
    event and select pipe_fd, then command line can exit.
    
    In current code, authentication thread which is called by vshConnect
    will use stdin, and at the same time, in cmdMigrate main process,
    poll() is listening to stdin, that probably affect poll() to get
    pipe_fd event. Better to move authentication before vshWatchJob. With
    this change, above problem does not exist.
    
    Signed-off-by: Chunyan Liu <cyliu>

git describe: v1.2.7-155-g7eabd55

Comment 3 zhengqin 2014-09-04 05:49:54 UTC
Verified this issue with build libvirt-1.2.8-1.el7.x86_64:


Verify steps:
1. Set up migration env with nfs

2. On source site, prepare a running guest (rhel6-guest), run following
command:

[root@rhel7-a /]# virsh migrate --live rhel6-guest qemu+ssh://destEnv/system --verbose
root.4.230's password:

3. After enter password and "enter"

Result:
Migration: [100 %]


The process info for migration could show at once.

Comment 5 zhenfeng wang 2014-12-03 13:25:32 UTC
I can reproduce this bug with libvirt-1.2.7-1.el7.x86_64, the following was the verify steps with libvirt-1.2.8-10.el7.x86_64

1. Set up migration env with nfs
2.migrate the guest from the source to target, the guest could be migrated directly after input the right password

# virsh migrate --live rhel7.0 qemu+ssh://xx.xx.xx/system --verbose --unsafe
The authenticity of host 'xx.xx.xx.xx (xx.xx.xx.xx)' can't be established.
ECDSA key fingerprint is xx:49:cc:xx:64:xx:93:4a:20:xx:14:b2:xx:xx:48:a3.
Are you sure you want to continue connecting (yes/no)? yes
root.xx.xx's password: 
Migration: [ 57 %]^Cerror: operation aborted: migration job: canceled by client

# virsh migrate --live rhel7.0 qemu+ssh://xx.xx.xx.xx/system --verbose --unsafe
root.xx.xx's password: 
Migration: [ 43 %]^Cerror: operation aborted: migration job: canceled by client

# virsh migrate --live rhel7.0 qemu+ssh://xx.xx.xx.xx/system --verbose --unsafe
root.xx.xx's password: 
Migration: [100 %]

According to the upper steps , mark this bug verifed

Comment 7 errata-xmlrpc 2015-03-05 07:42:41 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHSA-2015-0323.html