RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1910856 - Disk pool changed to be inactive after restarting libvirtd
Summary: Disk pool changed to be inactive after restarting libvirtd
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 9
Classification: Red Hat
Component: libvirt
Version: 9.0
Hardware: Unspecified
OS: Unspecified
low
low
Target Milestone: rc
: ---
Assignee: Peter Krempa
QA Contact: Meina Li
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-12-25 09:04 UTC by Meina Li
Modified: 2022-11-15 10:37 UTC (History)
5 users (show)

Fixed In Version: libvirt-8.1.0-1.el9
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-11-15 10:03:03 UTC
Type: Bug
Target Upstream Version: 8.1.0
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2022:8003 0 None None None 2022-11-15 10:03:48 UTC

Description Meina Li 2020-12-25 09:04:48 UTC
Description of problem:
Disk pool changed to be inactive after restarting libvirtd

Version-Release number of selected component (if applicable):
libvirt-6.6.0-11.module+el8.3.1+9196+74a80ca4.x86_64
qemu-kvm-5.1.0-17.module+el8.3.1+9213+7ace09c3.x86_64

How reproducible:
100%

Steps to Reproduce:
1. Define disk pool.
# cat disk-pool.xml 
<pool type='disk'>
  <name>disk-pool</name>
  <source>
    <device path='/dev/sdc'/>
    <format type='dos'/>
  </source>
  <target>
    <path>/dev</path>
  </target>
</pool>
# virsh pool-define disk-pool.xml 
Pool disk-pool defined from disk-pool.xml
# virsh pool-build disk-pool --overwrite 
Pool disk-pool built
2. Start the disk pool and check the status.
# virsh pool-start disk-pool 
Pool disk-pool started
# virsh pool-list --all
 Name         State    Autostart
----------------------------------
 disk-pool   active   yes
 images       active   yes
3. Restart libvirtd.
# systemctl restart libvirtd
4. Check the status of the disk pool.
# virsh pool-list --all
 Name         State      Autostart
------------------------------------
 disk-pool   inactive   yes
 images       active     yes


Actual results:
The disk pool change to be inactive

Expected results:
The disk pool should be in active status

Additional info:
Find an error in log:
2020-12-25 03:15:16.748+0000: 83740: error : virStoragePoolObjSourceFindDuplicate:1516 : operation failed: Storage source conflict with pool: 'disk-pool'

Comment 1 John Ferlan 2021-09-08 13:31:17 UTC
Bulk update: Move RHEL-AV bugs to RHEL9. If necessary to resolve in RHEL8, then clone to the current RHEL8 release.

Comment 2 Peter Krempa 2022-01-20 08:45:33 UTC
I can't reproduce the issue any more with current libvirt. Could you please re-try? If you manage to reproduce it please attach debug logs.

Comment 3 Peter Krempa 2022-01-20 09:32:37 UTC
I didn't notice that libvirtd doesn't autostart objects on plain restart now. So never-mind for now. I need to dig a bit deeper.

Comment 4 Peter Krempa 2022-01-20 13:48:27 UTC
Fixed upstream:

commit 9911a6f2ff888a53cc27bdca10efe31fd371dfb
Author: Peter Krempa <pkrempa>
Date:   Thu Jan 20 11:46:51 2022 +0100

    storage: Implement 'checkPool' method for 'disk' type pools
    
    If 'checkPool' is not implemented, the pool will be made inactive when
    restarting libvirtd and subsequently re-loading the state from the pool
    state XML.
    
    Base the 'checkPool' implementation on logic similar to 'startPool'.
    
    Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1910856
    Signed-off-by: Peter Krempa <pkrempa>
    Reviewed-by: Ján Tomko <jtomko>

v8.0.0-123-g9911a6f2ff

Comment 5 Meina Li 2022-03-15 01:29:13 UTC
Pre-verified Version:
libvirt-8.1.0-1.el9.x86_64
qemu-kvm-6.2.0-11.el9.x86_64

Pre-verified Steps:
S1: Create disk pool in split daemon mode.
1. Create a disk pool.
# lsscsi
[0:0:0:0]    disk    ATA      VB0250EAVER      HPG7  /dev/sda 
[1:0:0:0]    disk    ATA      VB0250EAVER      HPG7  /dev/sdb 
[5:0:0:0]    cd/dvd  HP       DV-18S-B         G.Y4  /dev/sr0 
[6:0:0:0]    disk    LIO-ORG  device.emulated  4.0   /dev/sdc 
# cat disk.pool 
<pool type='disk'>
  <name>disk-pool</name>
  <source>
    <device path='/dev/sdc'/>
    <format type='dos'/>
  </source>
  <target>
    <path>/dev</path>
  </target>
</pool>
# virsh pool-define disk.pool 
Pool disk-pool defined from disk.pool
# virsh pool-build disk-pool --overwrite
Pool disk-pool built
2. Start the disk pool and check the status.
# virsh pool-start disk-pool
Pool disk-pool started
# virsh pool-autostart disk-pool
Pool disk-pool marked as autostarted
# virsh pool-list --all
 Name        State    Autostart
---------------------------------
 disk-pool   active   yes
 images      active   yes
3. Restart the virtqemud and virtstoraged.
# systemctl restart virtstoraged;systemctl restart virtqemud
# virsh pool-list --all
 Name        State    Autostart
---------------------------------
 disk-pool   active   yes
 images      active   yes

S2: Create disk pool in libvirtd mode.
1. Repeat the above step1 ~ step2.
2. Restart the libvirtd service and check the status of disk pool.
# systemctl restart libvirtd
# virsh pool-list --all
 Name        State    Autostart
---------------------------------
 disk-pool   active   yes
 images      active   yes

Comment 9 Meina Li 2022-04-14 07:31:05 UTC
The test scenarios in Comment 5 are passed with libvirt-8.2.0-1.el9.x86_64 and
qemu-kvm-6.2.0-12.el9.x86_64.

Comment 10 Meina Li 2022-04-28 06:38:13 UTC
Hi Peter,

For disk pool, there's another regression issues: the disk pool will be active after restart virtstoraged even though we set no autostart to it. I'm not sure if it's related with this patch. Would you like to have a look? Thank you very much.

Test Version:
libvirt-8.2.0-1.el9.x86_64
qemu-kvm-7.0.0-1.el9.x86_64

Test Steps:
1. Define the inactive disk pool with autostart=no.
# virsh pool-autostart virsh_pool_test --disable
Pool virsh_pool_test unmarked as autostarted
# virsh pool-list --all
 Name              State      Autostart
-----------------------------------------
 images            active     yes
 virsh_pool_test   inactive   no

2. Restart virtstoraged.
# systemctl restart virtstoraged

3. Check the status of disk pool again.
# virsh pool-list --all
 Name              State    Autostart
---------------------------------------
 images            active   yes
 virsh_pool_test   active   no

Comment 11 Peter Krempa 2022-04-28 07:31:30 UTC
(In reply to Meina Li from comment #10)
> Hi Peter,
> 
> For disk pool, there's another regression issues: the disk pool will be
> active after restart virtstoraged even though we set no autostart to it. I'm
> not sure if it's related with this patch. Would you like to have a look?
> Thank you very much.

That is intended behaviour. The directory pool does exactly the same.

Comment 13 errata-xmlrpc 2022-11-15 10:03:03 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 (Low: libvirt security, bug fix, and enhancement update), 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/RHSA-2022:8003


Note You need to log in before you can comment on or make changes to this bug.