Bug 2001997

Summary: virtlogd does not start while staring virtqemud service
Product: Red Hat Enterprise Linux 9 Reporter: John Ferlan <jferlan>
Component: libvirtAssignee: Daniel Berrangé <berrange>
libvirt sub component: General QA Contact: yafu <yafu>
Status: CLOSED ERRATA Docs Contact:
Severity: unspecified    
Priority: unspecified CC: berrange, chhu, jdenemar, jsuchane, lmen, virt-maint, xuzhang, yafu, yanqzhan
Version: 9.0Keywords: Reopened, Triaged
Target Milestone: rcFlags: pm-rhel: mirror+
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: libvirt-7.7.0-1.el9 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: 1810863 Environment:
Last Closed: 2022-05-17 12:45:32 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: 7.7.0
Embargoed:
Bug Depends On: 1810863    
Bug Blocks:    

Description John Ferlan 2021-09-07 16:11:13 UTC
+++ This bug was initially created as a clone of Bug #1810863 +++

Description of problem:
virtlogd does not start while staring virtqemud service.

Version-Release number of selected component (if applicable):
libvirt-6.0.0-7.el8.x86_64

How reproducible:
100%

Steps to Reproduce:
1.Disable libvirtd and enable virtqemud service:
  #systemctl stop libvirtd.service
  #systemctl disable libvirtd{,-ro,-admin,-tcp,-tls}.socket
  #systemctl unmask virtqemud.service
  #systemctl unmask virtqemud{,-ro,-admin}.socket
  #systemctl enable virtqemud.service
  #systemctl enable virtqemud{,-ro,-admin}.socket

2.Reboot host

3.Start a guest:
#virsh -c qemu:///system start vm
error: Failed to start domain vm
error: can't connect to virtlogd: Failed to connect socket to '/run/libvirt/virtlogd-sock': No such file or directory

4.Check virtlogd status:
# systemctl status virtlogd
● virtlogd.service - Virtual machine log manager
   Loaded: loaded (/usr/lib/systemd/system/virtlogd.service; indirect; vendor preset: disabled)
   Active: inactive (dead)
     Docs: man:virtlogd(8)
           https://libvirt.org


Actual results:
virtlogd should start while starting vritqemud service

Expected results:
vIrtlogd does not start while staring virtqemud service.

Additional info:

--- Additional comment from Daniel Berrangé on 2020-03-06 10:13:31 UTC ---

The /run/libvirt/virtlogd-sock  should be provided by the "virtlogd.socket" system unit.

That should be enabled by default on all RHEL systems.  Can you check whether that socket path actually exists on disk current.

If it does exist, then possibly something like SELinux denies access.

There was a SELinux policy update for the daemons required so check that is installed too https://bugzilla.redhat.com/show_bug.cgi?id=1745076

--- Additional comment from yafu on 2020-03-12 13:31:11 UTC ---

(In reply to Daniel Berrangé from comment #1)
> The /run/libvirt/virtlogd-sock  should be provided by the "virtlogd.socket"
> system unit.
> 
> That should be enabled by default on all RHEL systems.  Can you check
> whether that socket path actually exists on disk current.
> 
> If it does exist, then possibly something like SELinux denies access.
> 
> There was a SELinux policy update for the daemons required so check that is
> installed too https://bugzilla.redhat.com/show_bug.cgi?id=1745076

I reproduce the issue with the following steps and did not find /run/libvirt/virtlogd-sock.
#systemctl stop libvirtd.service
#systemctl stop libvirtd{,-ro,-admin,-tcp,-tls}.socket
#systemctl disable libvirtd.service        
#systemctl disable libvirtd{,-ro,-admin,-tcp,-tls}.socket
#for drv in qemu interface network nodedev nwfilter secret storage proxy; do systemctl unmask virt${drv}d.service; systemctl unmask virt${drv}d{,-ro,-admin}.socket; systemctl enable virt${drv}d.service; systemctl enable virt${drv}d{,-ro,-admin}.socket; done
#reboot

After host boot, check the socket file under /run/libvirt/
#ll /run/libvirt/ | grep -i virtlog
no output

--- Additional comment from RHEL Program Management on 2020-11-05 19:21:29 UTC ---

pm_ack is no longer used for this product. The flag has been reset.

See https://issues.redhat.com/browse/PTT-1821 for additional details or contact lmiksik if you have any questions.

--- Additional comment from RHEL Program Management on 2021-08-08 03:57:12 UTC ---

30-day auto-close warning: This bz has been open for an extended time without being approved for a release (has a release+ or zstream+ flag) .  Please consider prioritizing the work appropriately to get it approved for a release, or close the bz.  Otherwise, if it is still open on the “Stale date”, it will close automatically (CLOSED WONTFIX).

--- Additional comment from RHEL Program Management on 2021-09-06 07:27:07 UTC ---

After evaluating this issue, there are no plans to address it further or fix it in an upcoming release.  Therefore, it is being closed.  If plans change such that this issue will be fixed in an upcoming release, then the bug can be reopened.

--- Additional comment from RHEL Program Management on 2021-09-06 08:43:54 UTC ---

This bug was reopened or transitioned from a non-RHEL to RHEL product.  The stale date has been reset to +6 months.

--- Additional comment from Daniel Berrangé on 2021-09-06 08:46:34 UTC ---

Fixed upstream in 

commit 88c5b9f827779ae6fe5a6f08100a4b6184492a1c
Author: Daniel P. Berrangé <berrange>
Date:   Tue Aug 31 10:59:39 2021 +0100

    qemu, xen: add missing deps on virtlockd/virtlogd sockets
    
    The QEMU driver uses both virtlogd and virtlockd, while the Xen driver
    uses virtlockd. The libvirtd.service unit contains deps on the socket
    units for these services, but these deps were missed in the modular
    daemons. As a result the virtlockd/virtlogd sockets are not started
    when the virtqemud/virtxend daemons are started.
    
    Reviewed-by: Jiri Denemark <jdenemar>
    Signed-off-by: Daniel P. Berrangé <berrange>

Comment 6 yafu 2021-10-27 06:35:31 UTC
Verified with libvirt-7.8.0-1.el9.x86_64.

Test steps:
1.Check the socket file of virtlogd after starting virtqemud:
# ll /run/libvirt/virtlogd-sock 
srw-------. 1 root root 0 Oct 27 02:13 /run/libvirt/virtlogd-sock

2.Chcek the virtlogd.socket service status:
# systemctl status virtlogd.socket
● virtlogd.socket - Virtual machine log manager socket
     Loaded: loaded (/usr/lib/systemd/system/virtlogd.socket; en>
     Active: active (running) since Wed 2021-10-27 02:13:24 EDT;>
   Triggers: ● virtlogd.service

3.Start a guest:
# virsh start avocado-vt-vm2 
Domain 'avocado-vt-vm2' started

4.Check virtlogd service status:
# systemctl status virtlogd
● virtlogd.service - Virtual machine log manager
     Loaded: loaded (/usr/lib/systemd/system/virtlogd.service; i>
     Active: active (running) since Wed 2021-10-27 02:34:15 EDT;>
TriggeredBy: ● virtlogd.socket
             ● virtlogd-admin.socket
...

Comment 8 errata-xmlrpc 2022-05-17 12:45:32 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 (new packages: libvirt), 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://access.redhat.com/errata/RHBA-2022:2390