Bug 1855972

Summary: Cannot create LV with cache when PV is encrypted
Product: Red Hat Enterprise Linux 7 Reporter: Renaud Métrich <rmetrich>
Component: anacondaAssignee: Anaconda Maintenance Team <anaconda-maint-list>
Status: CLOSED WONTFIX QA Contact: Release Test Team <release-test-team-automation>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.8CC: jstodola, vtrefny
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-11-11 21:51:24 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:
Attachments:
Description Flags
Kickstart for reproducing (can be used on RHEL7)
none
Screenshot of error none

Description Renaud Métrich 2020-07-11 12:19:37 UTC
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< --------

Comment 2 Renaud Métrich 2020-07-11 12:22:19 UTC
Created attachment 1700692 [details]
Kickstart for reproducing (can be used on RHEL7)

Comment 3 Renaud Métrich 2020-07-11 12:24:20 UTC
Created attachment 1700693 [details]
Screenshot of error

Comment 4 Vojtech Trefny 2020-07-13 13:03:05 UTC
Switching to anaconda, the problem is in the custom partitioning code, not in blivet (see proposed fix for 1855973).

Comment 8 Chris Williams 2020-11-11 21:51:24 UTC
Red Hat Enterprise Linux 7 shipped it's final minor release on September 29th, 2020. 7.9 was the last minor releases scheduled for RHEL 7.
From intial triage it does not appear the remaining Bugzillas meet the inclusion criteria for Maintenance Phase 2 and will now be closed. 

From the RHEL life cycle page:
https://access.redhat.com/support/policy/updates/errata#Maintenance_Support_2_Phase
"During Maintenance Support 2 Phase for Red Hat Enterprise Linux version 7,Red Hat defined Critical and Important impact Security Advisories (RHSAs) and selected (at Red Hat discretion) Urgent Priority Bug Fix Advisories (RHBAs) may be released as they become available."

If this BZ was closed in error and meets the above criteria please re-open it flag for 7.9.z, provide suitable business and technical justifications, and follow the process for Accelerated Fixes:
https://source.redhat.com/groups/public/pnt-cxno/pnt_customer_experience_and_operations_wiki/support_delivery_accelerated_fix_release_handbook  

Feature Requests can re-opened and moved to RHEL 8 if the desired functionality is not already present in the product. 

Please reach out to the applicable Product Experience Engineer[0] if you have any questions or concerns.  

[0] https://bugzilla.redhat.com/page.cgi?id=agile_component_mapping.html&product=Red+Hat+Enterprise+Linux+7