Bug 2074408

Summary: virtstoraged.socket is 'disabled' by default if only libvirt-daemon-driver-storage-core is installed
Product: [Fedora] Fedora Reporter: Martin Pitt <mpitt>
Component: libvirtAssignee: Libvirt Maintainers <libvirt-maint>
Status: CLOSED CURRENTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 35CC: agedosier, berrange, chhu, clalancette, crobinso, hhan, hongzliu, jdenemar, jforbes, juzhou, laine, libvirt-maint, mpitt, mxie, mzhan, pkrempa, rjones, smitterl, tyan, tzheng, veillard, virt-maint, virt-maint, vwu, xiaodwan, xuzhang, yafu
Target Milestone: ---Keywords: Reopened, Triaged
Target Release: ---   
Hardware: x86_64   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: 2025644 Environment:
Last Closed: 2022-11-30 06:28:11 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: 2025644    
Bug Blocks:    

Description Martin Pitt 2022-04-12 08:00:35 UTC
+++ This bug was initially created as a clone of Bug #2025644 +++

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

--- Additional comment from Han Han on 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.

--- Additional comment from RHEL Program Management on 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.

--- Additional comment from yafu on 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.

--- Additional comment from mxie on 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

--- Additional comment from RHEL Program Management on 2021-11-25 02:31:34 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 Peter Krempa on 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.

--- Additional comment from Peter Krempa on 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

--- Additional comment from Peter Krempa on 2022-01-19 17:01:46 UTC ---

https://gitlab.com/redhat/rhel/src/libvirt/-/merge_requests/1

--- Additional comment from Han Han on 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

--- Additional comment from errata-xmlrpc on 2022-01-26 08:15:19 UTC ---

This bug has been added to advisory RHBA-2021:82960 by auto/ptp-jenkins (auto/ptp-jenkins)

--- Additional comment from errata-xmlrpc on 2022-01-26 08:15:19 UTC ---

Bug report changed to ON_QA status by Errata System.
A QE request has been submitted for advisory RHBA-2021:82960-01
https://errata.devel.redhat.com/advisory/82960

--- Additional comment from Han Han on 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.

--- Additional comment from Martin Pitt on 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!

--- Additional comment from Peter Krempa on 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 1 Cole Robinson 2022-06-06 15:20:15 UTC
Upstream commit:

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'

Comment 2 Ben Cotton 2022-11-29 18:44:07 UTC
This message is a reminder that Fedora Linux 35 is nearing its end of life.
Fedora will stop maintaining and issuing updates for Fedora Linux 35 on 2022-12-13.
It is Fedora's policy to close all bug reports from releases that are no longer
maintained. At that time this bug will be closed as EOL if it remains open with a
'version' of '35'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, change the 'version' 
to a later Fedora Linux version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora Linux 35 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora Linux, you are encouraged to change the 'version' to a later version
prior to this bug being closed.

Comment 3 Martin Pitt 2022-11-30 06:28:11 UTC
Fixed in F36, closing.