Bug 1160930

Summary: The guest agent service in rhel7 guest will be stopped after run the init command
Product: Red Hat Enterprise Linux 7 Reporter: zhenfeng wang <zhwang>
Component: qemu-guest-agentAssignee: Miroslav Rezanina <mrezanin>
Status: CLOSED ERRATA QA Contact: Virtualization Bugs <virt-bugs>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 7.1CC: dyuan, huding, jen, juzhang, knoel, lhuang, mrezanin, mzhan, pkrempa, rbalakri, sghosh, xfu, xhan, yama, ydu, zsong
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: qemu-guest-agent-2.3.0-3.el7 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-11-19 07:09:36 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:
Bug Depends On: 885406, 1165176    
Bug Blocks:    

Description zhenfeng wang 2014-11-06 02:28:27 UTC
Description of problem:
The guest agent service in rhel7 guest will be stopped after run the init shell command
Version-Release number of selected component (if applicable):
host:
libvirt-1.2.8-6.el7.x86_64
qemu-kvm-rhev-2.1.2-6.el7.x86_64
kernel-3.10.0-196.el7.x86_64
systemd-208-15.el7.x86_64

guest
qemu-guest-agent-2.1.0-4.el7.x86_64

How reproducible:
100%

Steps to Reproduce:

1.Prepare a guest including the following content
#virsh dumpxml rhel7
--
  <pm>
    <suspend-to-mem enabled='yes'/>
    <suspend-to-disk enabled='yes'/>
  </pm>
--
<channel type='spicevmc'>
      <target type='virtio' name='com.redhat.spice.0'/>
      <alias name='channel1'/>
      <address type='virtio-serial' controller='0' bus='0' port='2'/>
    </channel>

 <channel type='unix'>
      <source mode='bind' path='/var/lib/libvirt/qemu/rhel7.agent'/>
      <target type='virtio' name='org.qemu.guest_agent.0'/>
      <alias name='channel2'/>
      <address type='virtio-serial' controller='0' bus='0' port='3'/>
    </channel>


2.Start the guest, then install the qemu-guest-agent service inside the guest
#virsh start rhel7
inside guest# yum install qemu-guest-agent
inside guest# systemctl start qemu-guest-agent
inside guest# systemctl status qemu-guest-agent
qemu-guest-agent.service - QEMU Guest Agent
   Loaded: loaded (/usr/lib/systemd/system/qemu-guest-agent.service; static)
   Active: active (running) since Thu 2014-10-30 07:56:48 EDT; 2min 59s ago
 Main PID: 586 (qemu-ga)
   CGroup: /system.slice/qemu-guest-agent.service
           └─586 /usr/bin/qemu-ga --method=virtio-serial --path=/dev/virtio-p...

Oct 30 07:56:48 localhost.localdomain systemd[1]: Started QEMU Guest Agent

3.Run init 3 or init 5 command inside the guest, then, recheck the guest agent status
found the guest agent has been in inactive status
inside guest#init 3
inside guest#systemctl status qemu-guest-agent
qemu-guest-agent.service - QEMU Guest Agent
   Loaded: loaded (/usr/lib/systemd/system/qemu-guest-agent.service; static)
   Active: inactive (dead) since Thu 2014-10-30 08:01:20 EDT; 5s ago
  Process: 586 ExecStart=/usr/bin/qemu-ga --method=virtio-serial --path=/dev/virtio-ports/org.qemu.guest_agent.0 --blacklist=${BLACKLIST_RPC} -F${FSFREEZE_HOOK_PATHNAME} (code=exited, status=0/SUCCESS)
 Main PID: 586 (code=exited, status=0/SUCCESS)
   CGroup: /system.slice/qemu-guest-agent.service

Oct 30 07:56:48 localhost.localdomain systemd[1]: Started QEMU Guest Agent.
Oct 30 08:01:19 localhost.localdomain systemd[1]: Stopping QEMU Guest Agent...
Oct 30 08:01:20 localhost.localdomain systemd[1]: Stopped QEMU Guest Agent.

                                          

Actual results:
The guest agent service was stopped after run init shell command

Expected results:
The service should keep in running status

Comment 2 Miroslav Rezanina 2014-11-18 13:52:46 UTC
Guest agent is not started on

Comment 3 Jeff Nelson 2014-12-16 21:52:52 UTC
Deferred to rhel-7.2 as this requires a fix in redhat-release.

Comment 9 Miroslav Rezanina 2015-08-25 14:26:25 UTC
Fix included in qemu-guest-agent-2.3.0-3.el7

Comment 11 Yanhui Ma 2015-08-27 09:43:30 UTC
reproduce the issue:

host:
qemu-kvm-rhev-2.3.0-17.el7.x86_64

guest:
qemu-guest-agent-2.3.0-2.el7

step:

1. boot a rhel7.2 guest with following cli:
/usr/libexec/qemu-kvm -S -M pc -cpu Opteron_G3 -enable-kvm -m 4096 \
-smp 4,sockets=4,cores=1,threads=1 -no-kvm-pit-reinjection -name sluo-test \
-uuid b18fdd6c-a213-4022-9ca4-5d07225e40b0 \
-rtc base=localtime,clock=host,driftfix=slew \
-device virtio-serial-pci,disable-legacy=true,disable-modern=false,id=virtio-serial0,max_ports=16,vectors=0,bus=pci.0,addr=0x3,ioeventfd=on \
-chardev spicevmc,id=charchannel0,name=vdagent \
-device virtserialport,bus=virtio-serial0.0,nr=1,chardev=charchannel0,id=channel0,name=com.redhat.spice.0 -chardev socket,id=charchannel1,path=/home/testdisk/socketfile2Gqcow2,server,nowait \
-device virtserialport,bus=virtio-serial0.0,nr=3,chardev=charchannel1,id=channel1,name=org.qemu.guest_agent.0 \
-drive file=/home/RHEL-Server-7.2-64-virtio-scsi.qcow2,if=none,id=drive-system-disk,format=qcow2,cache=none,aio=native,werror=stop,rerror=stop,serial=QEMU-DISK1 \
-device virtio-scsi-pci,id=scsi0,bus=pci.0,ioeventfd=off -device scsi-hd,bus=scsi0.0,drive=drive-system-disk,id=system-disk,channel=0,scsi-id=0,lun=0,ver=mike,serial=ababab,bootindex=1 \
-netdev tap,id=hostnet0,vhost=on,script=/etc/qemu-ifup \
-device virtio-net-pci,netdev=hostnet0,id=virtio-net-pci0,mac=08:2e:5f:0a:1d:b1,bus=pci.0,addr=0x5,bootindex=2 \
-qmp tcp:0:4444,server,nowait -k en-us -boot menu=on \
-vnc :1 -spice disable-ticketing,port=5931 -vga qxl -monitor stdio \

2.install the qemu-guest-agent service inside the guest
inside guest# yum install qemu-guest-agent
inside guest# systemctl status qemu-guest-agent
qemu-guest-agent.service - QEMU Guest Agent
   Loaded: loaded (/usr/lib/systemd/system/qemu-guest-agent.service; disabled)
   Active: active (running) since Thu 2015-08-27 17:27:27 CST; 10min ago
 Main PID: 3159 (qemu-ga)
   CGroup: /system.slice/qemu-guest-agent.service
           └─3159 /usr/bin/qemu-ga --method=virtio-serial --path=/dev/virtio-ports/org.qemu.guest_ag...

Aug 27 17:27:27 dhcp-66-106-190.nay.redhat.com systemd[1]: Started QEMU Guest Agent.

3.Run init 3 or init 5 command inside the guest, then, recheck the guest agent status
found the guest agent has been in inactive status
inside guest#init 3
inside guest#systemctl status qemu-guest-agent
qemu-guest-agent.service - QEMU Guest Agent
   Loaded: loaded (/usr/lib/systemd/system/qemu-guest-agent.service; disabled)
   Active: inactive (dead) since Thu 2015-08-27 17:38:11 CST; 2s ago
  Process: 3159 ExecStart=/usr/bin/qemu-ga --method=virtio-serial --path=/dev/virtio-ports/org.qemu.guest_agent.0 --blacklist=${BLACKLIST_RPC} -F${FSFREEZE_HOOK_PATHNAME} (code=exited, status=0/SUCCESS)
 Main PID: 3159 (code=exited, status=0/SUCCESS)

Aug 27 17:27:27 dhcp-66-106-190.nay.redhat.com systemd[1]: Started QEMU Guest Agent.
Aug 27 17:38:11 dhcp-66-106-190.nay.redhat.com systemd[1]: Stopping QEMU Guest Agent...
Aug 27 17:38:11 dhcp-66-106-190.nay.redhat.com systemd[1]: Stopped QEMU Guest Agent.

results:
The guest agent service was stopped after run init shell command

==============================================================================

verify the issue:
host:
qemu-kvm-rhev-2.3.0-17.el7.x86_64

guest:
qemu-guest-agent-2.3.0-3.el7

step:

1. boot a rhel7.2 guest with following cli:
/usr/libexec/qemu-kvm -S -M pc -cpu Opteron_G3 -enable-kvm -m 4096 \
-smp 4,sockets=4,cores=1,threads=1 -no-kvm-pit-reinjection -name sluo-test \
-uuid b18fdd6c-a213-4022-9ca4-5d07225e40b0 \
-rtc base=localtime,clock=host,driftfix=slew \
-device virtio-serial-pci,disable-legacy=true,disable-modern=false,id=virtio-serial0,max_ports=16,vectors=0,bus=pci.0,addr=0x3,ioeventfd=on \
-chardev spicevmc,id=charchannel0,name=vdagent \
-device virtserialport,bus=virtio-serial0.0,nr=1,chardev=charchannel0,id=channel0,name=com.redhat.spice.0 -chardev socket,id=charchannel1,path=/home/testdisk/socketfile2Gqcow2,server,nowait \
-device virtserialport,bus=virtio-serial0.0,nr=3,chardev=charchannel1,id=channel1,name=org.qemu.guest_agent.0 \
-drive file=/home/RHEL-Server-7.2-64-virtio-scsi.qcow2,if=none,id=drive-system-disk,format=qcow2,cache=none,aio=native,werror=stop,rerror=stop,serial=QEMU-DISK1 \
-device virtio-scsi-pci,id=scsi0,bus=pci.0,ioeventfd=off -device scsi-hd,bus=scsi0.0,drive=drive-system-disk,id=system-disk,channel=0,scsi-id=0,lun=0,ver=mike,serial=ababab,bootindex=1 \
-netdev tap,id=hostnet0,vhost=on,script=/etc/qemu-ifup \
-device virtio-net-pci,netdev=hostnet0,id=virtio-net-pci0,mac=08:2e:5f:0a:1d:b1,bus=pci.0,addr=0x5,bootindex=2 \
-qmp tcp:0:4444,server,nowait -k en-us -boot menu=on \
-vnc :1 -spice disable-ticketing,port=5931 -vga qxl -monitor stdio \

2.install the qemu-guest-agent service inside the guest
inside guest# yum install qemu-guest-agent
inside guest# systemctl status qemu-guest-agent
qemu-guest-agent.service - QEMU Guest Agent
   Loaded: loaded (/usr/lib/systemd/system/qemu-guest-agent.service; disabled)
   Active: active (running) since Thu 2015-08-27 17:27:27 CST; 10min ago
 Main PID: 3159 (qemu-ga)
   CGroup: /system.slice/qemu-guest-agent.service
           └─3159 /usr/bin/qemu-ga --method=virtio-serial --path=/dev/virtio-ports/org.qemu.guest_ag...

Aug 27 17:27:27 dhcp-66-106-190.nay.redhat.com systemd[1]: Started QEMU Guest Agent.

3.Run init 3 or init 5 command inside the guest, then, recheck the guest agent status
inside guest#init 3
inside guest#systemctl status qemu-guest-agent
qemu-guest-agent.service - QEMU Guest Agent
   Loaded: loaded (/usr/lib/systemd/system/qemu-guest-agent.service; disabled)
   Active: active (running) since Thu 2015-08-27 17:40:38 CST; 1s ago
 Main PID: 3997 (qemu-ga)
   CGroup: /system.slice/qemu-guest-agent.service
           └─3997 /usr/bin/qemu-ga --method=virtio-serial --path=/dev/virtio-ports/org.qemu.guest_ag...

Aug 27 17:40:38 dhcp-66-106-190.nay.redhat.com systemd[1]: Starting QEMU Guest Agent...
Aug 27 17:40:38 dhcp-66-106-190.nay.redhat.com systemd[1]: Started QEMU Guest Agent.

results:
The service should keep in running status

Based on the above results, the bz has been fixed.

Comment 12 juzhang 2015-08-31 03:04:36 UTC
According to comment11, set this issue as verified.

Comment 14 errata-xmlrpc 2015-11-19 07:09:36 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/RHBA-2015-2217.html