Bug 1219196

Summary: Anaconda refuses to process a working KS file created by Anaconda on UEFI Mac Pro: "failed to find a suitable stage1 device"
Product: Red Hat Enterprise Linux 7 Reporter: Jan Kundrát <jkt>
Component: anacondaAssignee: Brian Lane <bcl>
Status: CLOSED ERRATA QA Contact: Release Test Team <release-test-team-automation>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 7.1CC: bcl, mbanas, mkovarik, vpodzime
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: anaconda-21.48.22.9-1 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-11-19 09:54:10 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
anaconda-ks.cfg
none
anaconda.log
none
storage.log
none
program.log none

Description Jan Kundrát 2015-05-06 19:39:46 UTC
The attached KS file was created by installing CentOS 7.1 on a late-213 Mac Pro (aluminium cylinder, UEFI) from a pre-made KS template (which works on another server platform) which was modified to contain no partition information. The graphical installer selected manual disk layout, removed all partitions (including the one for EFI) and created layout which (after a bunch of retries) managed to install a working system, including the bootloader. Then I took the /root/anaconda-ks.cfg from the installed system and tried to reinstall the exact same box using this KS file, but the installation failed with:

storage configuration failed: failed to find a suitable stage1 device

The only modification which was made was commenting out the "graphical" command from the KS file in order to workaround bug #1219120. Adjusting the kernel options for PXE install to avoid configuring the bond-te interface produces the same result, but my debugging is much harder due to KVM limitations of our datacenter.

Another useful modification is changing `clearpart  --initlabel --list=sda2,sda1` to `clearpart --drives=sda --all --initlabel` because at the time we try to reproduce the installation, the disk contains different partitions (sda1, sda2 and sda3 as opposed to just sda1 and sda2 when the manual installation took place. The attached log is provided from an install attempt with this modification.

This means that Anaconda produced a config file which it cannot reapply on the same HW. The validator which processes the KS file is too strict and fails to approve a working configuration.

Comment 1 Jan Kundrát 2015-05-06 19:40:42 UTC
Created attachment 1022789 [details]
anaconda-ks.cfg

Comment 2 Jan Kundrát 2015-05-06 19:41:05 UTC
Created attachment 1022790 [details]
anaconda.log

Comment 3 Jan Kundrát 2015-05-06 19:41:24 UTC
Created attachment 1022791 [details]
storage.log

Comment 4 Jan Kundrát 2015-05-06 19:41:43 UTC
Created attachment 1022792 [details]
program.log

Comment 6 Jan Kundrát 2015-05-06 20:51:43 UTC
Seems that this is caused by outdated python-blivet in the initrd. It calls itself 0.61.0.26 in blivet/__init__.py, and blivet/platform.py doesn't contain any reference to class MacEFI, isMactel() and therefore getPlatform() returns just an instance of the regular class EFI which forbids one from using HFS+ on the EFI partition.

I added some extra logging into anaconda's pyanaconda/bootloader.py (mainly to see the function invocation and to get access to the self.errors in there), and the _is_valid_format gets called as _is_valid_format(..., ['efi'], ['/boot/efi'], 'EFI System Partition'). All partitions are rejected because "efi" != "hfs+".

Comment 7 Jan Kundrát 2015-05-06 21:41:20 UTC
Thanks a lot to adamw, dlehman, bcl and pjones on IRC for their excellent feedback and pointing me into a right direction.

Patch is at https://github.com/rhinstaller/anaconda/pull/101 .

Comment 10 Michal Kovarik 2015-09-14 06:20:12 UTC
Patch is included in RHEL-7.2 Beta with anaconda-21.48.22.35-1.el7. Verifying as SanityOnly.

Comment 11 errata-xmlrpc 2015-11-19 09:54:10 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://rhn.redhat.com/errata/RHBA-2015-2284.html