Bug 1935722

Summary: Selected disks have inconsistent sector sizes (anaconda part)
Product: Red Hat Enterprise Linux 8 Reporter: Jan Stodola <jstodola>
Component: anacondaAssignee: Vendula Poncova <vponcova>
Status: CLOSED ERRATA QA Contact: Release Test Team <release-test-team-automation>
Severity: high Docs Contact: Sagar Dubewar <sdubewar>
Priority: unspecified    
Version: 8.4CC: bilhar, lmanasko, mdolezel, pkotvan, rvykydal, sbarcomb, sbueno, sdubewar, sjalgaon, vponcova, vslavik, vtrefny
Target Milestone: rcKeywords: Triaged
Target Release: ---Flags: pm-rhel: mirror+
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: anaconda-33.16.5.4-1.el8 Doc Type: Known Issue
Doc Text:
.Installation with `autopart` kickstart command fails with inconsistent disk sector sizes Installing RHEL using `autopart` with multiple inconsistent disk sector sizes fails. As a workaround, use a `plain` partitioning scheme, for example `autopart --type=plain`, instead of the default `LVM` scheme. Another option is to try re-configuring sector sizes, for example by running `hdparm --set-sector-size=<SIZE> <DEVICE>`. As a workaround for kickstart installations: * Restrict the disks used for the partitioning by specifying `ignoredisk --drives=..` OR `--only-use=..`. * Specify disks to be used for each created LVM Physical Volume: `partition pv.1 --ondisk=..`. As a workaround for manual installations: * Select only the disks with the same sector size during manual installation in graphical or text mode. * When disks with inconsistent sector size are selected for the installation, restrict each created LVM Volume Group to use Physical Volumes with the same sector size. This can only be done in graphical mode in the Custom partitioning spoke.
Story Points: ---
Clone Of:
: 1955514 1955516 (view as bug list) Environment:
Last Closed: 2021-11-09 18:42:11 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: 1879091, 1955516    

Description Jan Stodola 2021-03-05 13:00:46 UTC
Description of problem:
Anaconda autopart fails on systems with inconsistent sector sizes, because LVM no longer allows creating VGs on top of PVs with different block sizes, see https://bugzilla.redhat.com/show_bug.cgi?id=1669751.


Starting automated install................... 
Saving storage configuration... 
Failed to save storage configuration      
The volume group <VGNAME> cannot be created. Selected disks have inconsistent sector sizes ({4096, 512}).


Can we change/improve anaconda behavior when "autopart" is used in the kickstart file?

Possible changes:
* Do not use LVM on systems with inconsistent sector sizes and use plain partitions instead (equivalent to "autopart --type=plain"). This behavior cannot be applied if "autopart --type=lvm/thinp" is explicitly defined in the kickstart file.
* Use only a subset of disks with consistent sector sizes for LVM.
* Create separate VGs for disks with the same sector sizes, autopart will decide what VG will be used for each LV with /, swap, /home.
* Allow to create VGs even with PVs of different block sizes (see allow_mixed_block_sizes in /etc/lvm/lvm.conf).
* Keep the current behavior, but the installer should suggest possible workarounds.
* Something else.

Version-Release number of selected component (if applicable):
RHEL-8.x

How reproducible:
Always

Steps to Reproduce:
1. dd if=/dev/null of=disk1 bs=1 count=1 seek=10G
2. dd if=/dev/null of=disk2 bs=1 count=1 seek=10G
3. virt-install --cdrom <ISO> --disk disk1,bus=virtio,blockio.physical_block_size=512,blockio.logical_block_size=512 --disk disk2,bus=virtio,blockio.physical_block_size=4096,blockio.logical_block_size=4096 --memory 2048
4. Append "inst.ks=<KS_LOCATION>" pointing to a kickstart file with the "autopart" command.

Actual results:
The installation is interrupted.

Expected results:
Better user experience.

Additional info:
The installation guide should note this problem, reported as bug 1935723.

Comment 2 Jan Stodola 2021-03-23 16:08:35 UTC
(In reply to Jan Stodola from comment #0)

> * Keep the current behavior, but the installer should suggest possible
> workarounds.

We decided to go with this option and make the error message more useful.

Comment 3 Vendula Poncova 2021-04-13 16:35:43 UTC
Just a note, this error message comes from Blivet. It can be changed in Blivet, or the error has to be raised as something else than ValueError, so Anaconda can catch it and extend it.

Comment 4 Vendula Poncova 2021-04-14 12:09:54 UTC
Honza, do you have a suggestion how the new error message could look like?

Comment 5 Vojtech Trefny 2021-04-15 08:10:33 UTC
Proposed blivet part of the fix: https://github.com/storaged-project/blivet/pull/951

We'll reword the error and add list of disks/PVs with sector sizes and also raise a special exception for this case so Anaconda can add more information like possible workarounds in kickstart. New error message will be

------
The volume group rhel cannot be created. Selected disks have inconsistent sector sizes. Following sector sizes have been detected:
512: vda5
4096: vdg1
------

Comment 13 Jan Stodola 2021-04-30 09:36:00 UTC
(In reply to Vendula Poncova from comment #4)
> Honza, do you have a suggestion how the new error message could look like?

Since the same message will be displayed for kickstart and manual installations, it should cover both cases.
The text could display the following workarounds in addition to the message from blivet:

Workarounds for manual installations:
* Select only the disks with the same sector size during manual installation in graphical or text mode.
* When disks with inconsistent sector size are selected for the installation, restrict each created LVM Volume Group to use Physical Volumes with the same sector size. This can only be done in graphical mode in the Custom partitioning spoke.

Workarounds for kickstart installations:
* Restrict what disks are used for the partitioning by specifying "ignoredisk --drives=.. OR --only-use=..".
* Specify what disks should be used for each created LVM Physical Volume: "partition pv.1 --ondisk=..".

General workarounds:
* Plain partitioning scheme can be used instead of LVM.
* Some drives support re-configuration of sector sizes, for example by running "hdparm --set-sector-size=<SIZE> <DEVICE>".

(Add more workarounds if you can think of any)

Comment 28 Vladimír Slávik 2021-08-16 11:09:38 UTC
Using compose RHEL-8.5.0-20210812.n.0 with anaconda-33.16.5.4-1.el8, anaconda stops and offers more explanations and workarounds in the error message. This appears to be as comment 2 asked.

Comment 32 errata-xmlrpc 2021-11-09 18:42:11 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 (anaconda 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/RHBA-2021:4254

Comment 33 Red Hat Bugzilla 2023-09-15 01:02:53 UTC
The needinfo request[s] on this closed bug have been removed as they have been unresolved for 500 days