Bug 1855973

Summary: Cannot create LV with cache when PV is encrypted
Product: Red Hat Enterprise Linux 8 Reporter: Renaud Métrich <rmetrich>
Component: anacondaAssignee: Anaconda Maintenance Team <anaconda-maint-list>
Status: CLOSED CURRENTRELEASE QA Contact: Release Test Team <release-test-team-automation>
Severity: medium Docs Contact:
Priority: medium    
Version: 8.2CC: jbittner, jkonecny, jrusz, jstodola, rvykydal, sbarcomb, sbueno, vtrefny, zveleba
Target Milestone: rcKeywords: TestCaseNeeded, TestOnly, Triaged
Target Release: 8.0   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: anaconda-33.16.3.15-1 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1872695 (view as bug list) Environment:
Last Closed: 2021-05-21 13:29:49 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: 1872695    

Description Renaud Métrich 2020-07-11 12:20:57 UTC
This bug was initially created as a copy of Bug #1855972

I am copying this bug because: 

Also applies to RHEL8.2.0 (after applying the patch for BZ #1836269)


Description of problem:

Trying to install a system with a cached LV and PVs Luks encrypted, the installer complains with the following message:

  Cache PVs must belong to the same VG as the cached LV

Kickstart excerpt:
-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------
part pv.00 --ondisk=/dev/vda --size=1 --grow --encrypted --passphrase="redhat"
part pv.01 --ondisk=/dev/vdb --size=1 --grow --encrypted --passphrase="redhat"
volgroup rhel pv.00 pv.01
logvol swap --fstype="swap" --size=1024 --name=swap --vgname=rhel
logvol / --fstype="xfs" --size=8192 --name=root --vgname=rhel
logvol /data --fstype="xfs" --size=4096 --name=data --vgname=rhel --cachepvs=pv.01 --cachesize=8192 --cachemode=writeback 
-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------

In the example above, /data is hosted on rhel/data LV with cache PV pv.01 encrypted.
Even though pv.01 is building "rhel" volume group, the code doesn't detect that.

My hypothesis is that there is no code to handle the fact that "pv.01" is not the PV here, but the luks-encrypted device /dev/vdb.


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

RHEL7 and RHEL8.2.0


How reproducible:

ALWAYS


Steps to Reproduce:
1. Install a system with a kickstart having 2 disks (see attachment for kickstart)

Actual results:

"Cache PVs must belong to the same VG as the cached LV"


Expected results:

Installs fine

Additional info:

The "workaround" I found is to use encrypted filesystems instead of encrypted PVs:

-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------
part pv.00 --ondisk=/dev/vda --size=1 --grow
part pv.01 --ondisk=/dev/vdb --size=1 --grow
volgroup rhel pv.00 pv.01
logvol swap --fstype="swap" --size=1024 --name=swap --vgname=rhel --encrypted --passphrase="redhat"
logvol / --fstype="xfs" --size=8192 --name=root --vgname=rhel --encrypted --passphrase="redhat"
logvol /data --fstype="xfs" --size=4096 --name=data --vgname=rhel --cachepvs=pv.01 --cachesize=8192 --cachemode=writeback --encrypted --passphrase="redhat"
-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------