Bug 2167509

Summary: [4.11] Use consistent cache mode setting logic for hotplugged disks
Product: Container Native Virtualization (CNV) Reporter: Alexander Wels <awels>
Component: StorageAssignee: Yan Du <yadu>
Status: CLOSED ERRATA QA Contact: Natalie Gavrielov <ngavrilo>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 4.11.2CC: jpeimer, yadu
Target Milestone: ---   
Target Release: 4.11.4   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: CNV v4.11.4-3 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-05-30 15:37:44 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Alexander Wels 2023-02-06 20:40:41 UTC
This bug was initially created as a copy of Bug #2167508

I am copying this bug because: Need a backport to 4.11 as well



Description of problem:

When hot plugging a disk the cache mode is not set explicitly which can result in a default cache mode being used.  We would like to use the same logic for hot plugged disks as for conventionally attached disks which is to prefer cache=none when the underlying storage supports direct IO.  


Version-Release number of selected component (if applicable): 4.10.7


How reproducible: Always


Steps to Reproduce:
1. Create VM
2. Start VM
3. Hotplug a disk
4. Use `oc rsh` to connect to the appropriate virt-launcher Pod
5. Execute `virsh dumpxml 1`

Actual results: The xml shows a cache mode other than 'none' for the hotplug disk


Expected results: The cache mode should be set to 'none'


Additional info:

Comment 1 Yan Du 2023-03-02 03:31:31 UTC
Test on CNV v4.11.4-3, cache mode is none

    <disk type='block' device='disk'>
      <driver name='qemu' type='raw' cache='none' error_policy='stop' io='native' discard='unmap'/>
      <source dev='/var/run/kubevirt/hotplug-disks/blank-dv' index='3'/>
      <backingStore/>

Comment 9 errata-xmlrpc 2023-05-30 15:37:44 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 (OpenShift Virtualization 4.11.4 Images), 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/RHEA-2023:3352