Bug 1811728

Summary: Libvirt drops disks with startupPolicy too aggressively
Product: Red Hat Enterprise Linux Advanced Virtualization Reporter: Michal Privoznik <mprivozn>
Component: libvirtAssignee: Michal Privoznik <mprivozn>
Status: CLOSED ERRATA QA Contact: Meina Li <meili>
Severity: urgent Docs Contact:
Priority: unspecified    
Version: 8.2CC: bpelled, bugs, jdenemar, jiyan, lmen, lrotenbe, lsvaty, meili, mprivozn, mzamazal, nsimsolo, rbarry, virt-maint, xuzhang
Target Milestone: rcKeywords: Regression, Upstream
Target Release: 8.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: libvirt-6.0.0-10.el8 Doc Type: No Doc Update
Doc Text:
Story Points: ---
Clone Of: 1811425 Environment:
Last Closed: 2020-05-05 09:57:51 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: 1810416, 1811425    

Description Michal Privoznik 2020-03-09 15:49:53 UTC
+++ This bug was initially created as a clone of Bug #1811425 +++

There is a libvirt regression caused by:

  63469116cc virDomainDiskTranslateSourcePool: split code to setup one storage source

which tries to fix the bug 1804603. The problem is the referenced commit introduced a typo which caused libvirt to drop sources for all disks which have startup policy configured.

Comment 1 Michal Privoznik 2020-03-09 15:52:02 UTC
Patch posted upstream:

https://www.redhat.com/archives/libvir-list/2020-March/msg00241.html

Comment 2 Michal Privoznik 2020-03-10 07:02:03 UTC
Pushed upstream as:

  3918dbd84e virDomainDiskTranslateSourcePool: Check for disk type correctly

v6.1.0-69-g3918dbd84e

Comment 7 Meina Li 2020-03-16 10:00:46 UTC
Hi Michal,

I start domain with cdrom disk with startupPolicy='optional' failed, I think it may be a new bug, can you help to review it? Thank you in advance.

Test Version:
libvirt-6.0.0-10.el8

Test Steps:
1. Prepare a guest xml with cdrom disk with startupPolicy='optional'.
# vim lmn.xml
...
<disk type='file' device='cdrom'>
<driver name='qemu' type='raw' cache='none'/>
<source file='/var/lib/libvirt/images/non-exist.img' startupPolicy='optional'/>
<target dev='sda' bus='sata'/>
<readonly/>
</disk>
...
2. Define the guest and start it.
# virsh define lmn.xml; virsh start lmn
Domain lmn defined from lmn.xml

error: Failed to start domain lmn
error: Cannot access storage file '/var/lib/libvirt/images/non-exist.img': No such file or directory

Comment 8 Michal Privoznik 2020-03-16 11:13:01 UTC
I cannot reproduce on upstream. I will investigate further.

Comment 9 Michal Privoznik 2020-03-16 12:13:45 UTC
Well, I can't reproduce downstream neither. Can you attach debug logs please?

Comment 10 Meina Li 2020-03-17 02:55:21 UTC
Thanks for your review and test, I also cannot reproduce in other machine with the same libvirt version. 
So I think may there are some problems on my machine or guest xml, I'll check again.

Comment 13 errata-xmlrpc 2020-05-05 09:57:51 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://access.redhat.com/errata/RHBA-2020:2017