Bug 2025644

Summary: virtstoraged.socket is 'disabled' by default if only libvirt-daemon-driver-storage-core is installed
Product: Red Hat Enterprise Linux 9 Reporter: mxie <mxie>
Component: libvirtAssignee: Peter Krempa <pkrempa>
libvirt sub component: General QA Contact: Han Han <hhan>
Status: CLOSED ERRATA Docs Contact:
Severity: medium    
Priority: unspecified CC: chhu, hhan, hongzliu, jdenemar, juzhou, mpitt, mzhan, pkrempa, rjones, smitterl, tyan, tzheng, virt-maint, vwu, xiaodwan, xuzhang, yafu
Version: 9.0Keywords: Reopened, Triaged
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Unspecified   
Whiteboard:
Fixed In Version: libvirt-8.0.0-2.el9 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 2074408 (view as bug list) Environment:
Last Closed: 2022-05-17 12:45:52 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:    
Bug Blocks: 2074408    

Description mxie@redhat.com 2021-11-22 16:29:43 UTC
Description of problem:
virtstoraged.socket is 'disabled' by default if only libvirt-daemon-driver-storage-core is installed


Version-Release number of selected component (if applicable):
redhat-release-9.0-2.9.el9.x86_64
systemd-249-4.el9.x86_64
libvirt-daemon-driver-storage-core-7.9.0-1.el9.x86_64


How reproducible:
100%

Steps to Reproduce:
1. Install below libvirt packages on rhel9 server
# rpm -qa |grep libvirt
libvirt-libs-7.9.0-1.el9.x86_64
libvirt-client-7.9.0-1.el9.x86_64
libvirt-daemon-7.9.0-1.el9.x86_64
libvirt-daemon-driver-network-7.9.0-1.el9.x86_64
libvirt-daemon-config-network-7.9.0-1.el9.x86_64
libvirt-daemon-driver-qemu-7.9.0-1.el9.x86_64
libvirt-daemon-driver-secret-7.9.0-1.el9.x86_64
libvirt-daemon-driver-storage-core-7.9.0-1.el9.x86_64

2.Reboot OS, then check virtstoraged.socket status, find virtstoraged.socket can't be started automatically after rebooting OS

# systemctl status virtstoraged.socket
○ virtstoraged.socket - Libvirt storage local socket
     Loaded: loaded (/usr/lib/systemd/system/virtstoraged.socket; disabled; vendor preset: enabled)
     Active: inactive (dead)
   Triggers: ● virtstoraged.service
     Listen: /run/libvirt/virtstoraged-sock (Stream)


Actual results:
As above description

Expected results:
virtstoraged.socket can start automatically after rebooting OS if only libvirt-daemon-driver-storage-core is installed

Additional info:
If install the other libvirt-daemon-driver-storage-* packages,virtstoraged.socket can start automatically after rebooting OS
#yum install libvirt-daemon-driver-storage -y
....
====================================================================================================================================
 Package                                           Architecture       Version                     Repository                   Size
====================================================================================================================================
Installing:
 libvirt-daemon-driver-storage                     x86_64             7.9.0-1.el9                 libvirt_ci                   13 k
Installing dependencies:
 boost-iostreams                                   x86_64             1.75.0-6.el9                rhel9-appstream              40 k
 boost-system                                      x86_64             1.75.0-6.el9                rhel9-appstream              16 k
 boost-thread                                      x86_64             1.75.0-6.el9                rhel9-appstream              58 k
 librados2                                         x86_64             2:16.2.4-5.el9              libvirt_ci                  3.4 M
 librbd1                                           x86_64             2:16.2.4-5.el9              libvirt_ci                  3.0 M
 libvirt-daemon-driver-storage-disk                x86_64             7.9.0-1.el9                 libvirt_ci                   24 k
 libvirt-daemon-driver-storage-iscsi               x86_64             7.9.0-1.el9                 libvirt_ci                   21 k
 libvirt-daemon-driver-storage-logical             x86_64             7.9.0-1.el9                 libvirt_ci                   25 k
 libvirt-daemon-driver-storage-mpath               x86_64             7.9.0-1.el9                 libvirt_ci                   18 k
 libvirt-daemon-driver-storage-rbd                 x86_64             7.9.0-1.el9                 libvirt_ci                   29 k
 libvirt-daemon-driver-storage-scsi                x86_64             7.9.0-1.el9                 libvirt_ci                   20 k

Transaction Summary
====================================================================================================================================
Install  12 Packages
.....

6.Reboot OS, then check virtstoraged.socket status, find virtstoraged.socket can start automatically after rebooting OS

# systemctl status virtstoraged.socket
● virtstoraged.socket - Libvirt storage local socket
     Loaded: loaded (/usr/lib/systemd/system/virtstoraged.socket; enabled; vendor preset: enabled)
     Active: active (listening) since Tue 2021-11-23 00:16:53 CST; 8min ago
   Triggers: ● virtstoraged.service
     Listen: /run/libvirt/virtstoraged-sock (Stream)
     CGroup: /system.slice/virtstoraged.socket

Comment 1 Han Han 2021-11-23 06:11:03 UTC
I don't think it is a bug.
From the installation process of libvirt:
  Installing       : libvirt-daemon-driver-storage-7.9.0-1.el9.x86_64                                                                                                                   62/70 
  Running scriptlet: libvirt-daemon-driver-storage-7.9.0-1.el9.x86_64                                                                                                                   62/70 
Created symlink /etc/systemd/system/sockets.target.wants/virtstoraged.socket → /usr/lib/systemd/system/virtstoraged.socket.           

the virtstoraged.socket enabling happens at installing libvirt-daemon-driver-storage. So you should install libvirt-daemon-driver-storage instead.

Comment 2 RHEL Program Management 2021-11-23 06:11:13 UTC
Quality Engineering Management has reviewed and declined this request. You may appeal this decision by reopening this request.

Comment 3 yafu 2021-11-23 08:06:02 UTC
Hi hhan,

I think this is a bug. Please refer to Please refer to https://bugzilla.redhat.com/show_bug.cgi?id=2024541#c7 for details.
(In reply to Han Han from comment #1)
> I don't think it is a bug.
> From the installation process of libvirt:
>   Installing       : libvirt-daemon-driver-storage-7.9.0-1.el9.x86_64       
> 62/70 
>   Running scriptlet: libvirt-daemon-driver-storage-7.9.0-1.el9.x86_64       
> 62/70 
> Created symlink /etc/systemd/system/sockets.target.wants/virtstoraged.socket
> → /usr/lib/systemd/system/virtstoraged.socket.           
> 
> the virtstoraged.socket enabling happens at installing
> libvirt-daemon-driver-storage. So you should install
> libvirt-daemon-driver-storage instead.

I think this is a bug. Please refer to https://bugzilla.redhat.com/show_bug.cgi?id=2024541#c7 for details. 


> Created symlink /etc/systemd/system/sockets.target.wants/virtstoraged.socket

And this may move to the installing of pkg of libvirt-daemon-driver-storage-core.

Comment 4 mxie@redhat.com 2021-11-25 02:15:43 UTC
Confirmed the bug with Daniel in https://bugzilla.redhat.com/show_bug.cgi?id=2024541#c9, so reopen the bug

Comment 6 Peter Krempa 2022-01-19 12:51:47 UTC
The problem is that the spec file mentions the wrong package for the transitions:

%pre daemon-driver-storage
%libvirt_sysconfig_pre virtstoraged

%post daemon-driver-storage
%if %{with_modular_daemons}
%libvirt_daemon_systemd_post virtstoraged
%endif
%libvirt_daemon_schedule_restart virtstoraged

%preun daemon-driver-storage
%libvirt_daemon_systemd_preun virtstoraged

%posttrans daemon-driver-storage
%libvirt_sysconfig_posttrans virtstoraged
%libvirt_daemon_perform_restart virtstoraged

All of the above should be 'daemon-driver-storage-core' for this to work properly.

Comment 7 Peter Krempa 2022-01-19 16:03:32 UTC
Fixed upstream:

commit aaec8c91aef5524e33329577d066ab4bb8dcc7dd
Author: Peter Krempa <pkrempa>
Date:   Wed Jan 19 13:41:28 2022 +0100

    spec: Run pre/post-install stuff on 'daemon-driver-storage-core'
    
    'daemon-driver-storage' is just a meta-package, the actual daemon is in
    the 'daemon-driver-storage-core' package, so without installing the meta
    package the storage daemon is not being enabled.
    
    Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2025644
    Fixes: 50eae3f8859, b8ef6255444
    Signed-off-by: Peter Krempa <pkrempa>
    Reviewed-by: Daniel P. Berrangé <berrange>
    Reviewed-by: Andrea Bolognani <abologna>

v8.0.0-111-gaaec8c91ae

Comment 9 Han Han 2022-01-20 04:13:40 UTC
Tested. Works on systemd-250.3-1.fc36.x86_64 libvirt-v8.0.0-118-g755b16d10a:
➜  ~ systemctl status virtstoraged.socket
● virtstoraged.socket - Libvirt storage local socket
     Loaded: loaded (/usr/lib/systemd/system/virtstoraged.socket; enabled; vendor preset: enabled)
     Active: active (listening) since Thu 2022-01-20 04:09:49 UTC; 2min 13s ago
      Until: Thu 2022-01-20 04:09:49 UTC; 2min 13s ago
   Triggers: ● virtstoraged.service
     Listen: /run/libvirt/virtstoraged-sock (Stream)
     CGroup: /system.slice/virtstoraged.socket

Comment 12 Han Han 2022-01-28 08:29:30 UTC
Works on libvirt-daemon-8.0.0-2.el9.x86_64
➜  ~ dnf install libvirt-daemon-driver-storage -y                                                                                                             
Failed to set locale, defaulting to C.UTF-8                                                                                                                   
Last metadata expiration check: 0:47:00 ago on Fri Jan 28 02:37:50 2022.                                                                                      
Dependencies resolved.                                                                                                                                        
==============================================================================================================================================================
 Package                                                Architecture            Version                                      Repository                  Size 
==============================================================================================================================================================
Installing:                                                                                                                                                   
 libvirt-daemon-driver-storage                          x86_64                  8.0.0-2.el9                                  AppStream                   14 k 

➜  ~ systemctl status virtstoraged.socket
○ virtstoraged.socket - Libvirt storage local socket
     Loaded: loaded (/usr/lib/systemd/system/virtstoraged.socket; enabled; vendor preset: enabled)
     Active: inactive (dead)
   Triggers: ● virtstoraged.service
     Listen: /run/libvirt/virtstoraged-sock (Stream)

virtstoraged.socket is enabled.
Work as expected.

Comment 13 Martin Pitt 2022-04-11 15:09:20 UTC
This got fixed in Fedora 36, but Fedora 35 still suffers from this. `rpm -qi --scripts libvirt-daemon-driver-storage` confirms that the unit is enabled from that meta-package only, which isn't necessarily installed. Is this planned to get fixed in F35 already, or shall I clone the bug? Thanks!

Comment 14 Peter Krempa 2022-04-12 07:31:08 UTC
(In reply to Martin Pitt from comment #13)
> This got fixed in Fedora 36, but Fedora 35 still suffers from this. `rpm -qi
> --scripts libvirt-daemon-driver-storage` confirms that the unit is enabled
> from that meta-package only, which isn't necessarily installed. Is this
> planned to get fixed in F35 already, or shall I clone the bug? Thanks!

We don't initiatively backport patches to Fedora. If you need it fixed, please open a bug and make sure to point to the patches so that fedora maintainers can backport them.

Comment 16 errata-xmlrpc 2022-05-17 12:45:52 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