Bug 1942134

Summary: error in live ISO image creation prevents install of OS in Satellite
Product: Red Hat Enterprise Linux 7 Reporter: Gary Scarborough <gscarbor>
Component: anacondaAssignee: Anaconda Maintenance Team <anaconda-maint-list>
Status: CLOSED MIGRATED QA Contact: Release Test Team <release-test-team-automation>
Severity: high Docs Contact:
Priority: high    
Version: 7.9CC: elpereir, hartsjc, jstodola, lzap, mpagan, sbarcomb, sbueno, tbowling
Target Milestone: rcKeywords: Extras, MigratedToJIRA
Target Release: ---Flags: pm-rhel: mirror+
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-09-18 15:30:03 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.log
none
anaconda error
none
program log
none
lorax packages
none
df output
none
no bin found
none
error seen in tar file attempt
none
/tmp logs tar file none

Description Gary Scarborough 2021-03-23 18:07:22 UTC
Description of problem:

It seems that the bug 1127280 - OSError: [Errno 2] No such file or directory
is now present in RHEL 7.9.

My customer is using Composer on RHEL 7.9 fully updated to create a live image to be used by satellite 6.8 for installations.  The Live iso builds and is bootable.  However, there is an error when this live ISO is used to provision a system with satellite per:

https://access.redhat.com/documentation/en-us/red_hat_satellite/6.8/html/provisioning_guide/using-an-image-builder-image-for-provisioning

The bug opened for fedora was fixed and closed.  Is there any chance of anaconda-core getting an update for RHEL 7.9 to fix this issue?

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

RHEL 7.9
anaconda-core-21.48.22.159-1.el7.x86_64
lorax-composer-19.7.43-1.el7_9.x86_64
cockpit-composer-9-1.el7.noarch


How reproducible:
always

Steps to Reproduce:
1.  Install composer on rhel 7.9 server
2.  Create a live ISO image
3.  Move image to Satellite and try to provision with it

Actual results:

Install ends after post install with OSError: [Errno 2] No such file or directory


Expected results:

Install finishes successfully

Additional info:

Comment 3 Brian Lane 2021-03-23 21:34:02 UTC
I'm not sure that is the same problem. Please attach the logs from the installation attempt as individual text/plain attachments. They can be found in /tmp/*log

Comment 4 Gary Scarborough 2021-03-23 23:02:50 UTC
Created attachment 1765750 [details]
anaconda.log

Comment 5 Gary Scarborough 2021-03-23 23:03:26 UTC
Created attachment 1765751 [details]
anaconda error

Comment 6 Gary Scarborough 2021-03-23 23:04:29 UTC
Created attachment 1765752 [details]
program log

Comment 7 Gary Scarborough 2021-03-23 23:05:26 UTC
Logs added.  Please let me know if you need anything else.

Comment 8 Brian Lane 2021-03-24 15:38:48 UTC
You appear to be missing systemd, which provides systemd-machine-id-setup.

Comment 9 Gary Scarborough 2021-03-25 23:09:11 UTC
According to the final-kickstart file created by composer, both systemd-219-78.el7_9.3.x86_64 and systemd-libs-219-78.el7_9.3.x86_64 are in the live ISO.  Note that this error is not seen when booting straight from the ISO.  Just when the ISO is used to provision.

Comment 14 Gary Scarborough 2021-03-28 02:15:28 UTC
Created attachment 1767015 [details]
lorax packages

Comment 15 Gary Scarborough 2021-03-28 02:15:57 UTC
Created attachment 1767016 [details]
df output

Comment 19 Gary Scarborough 2021-04-01 15:47:56 UTC
Created attachment 1768294 [details]
no bin found

Comment 22 Lukas Zapletal 2021-04-06 14:09:20 UTC
Hey,

this feature was added into satellite because of oVirt Node (RHV Hypervisor). The documentation does not explicitly say that the image must be squashfs or raw image because we thought this is obvious - why would anyone provide a bootable ISO file to be deployed on a node? If you can name which image formats are supported we can list them, but last time I checked Anaconda tries to mount the file downloaded from the URL and then it performs file copy.

I do not believe this is a bug in Satellite, perhaps our documentation is unclear and we can fix this. But all what Satellite currently does is providing the "liveimg" kickstart statement. Satellite does not even support any kind of image content it must be served manually from a HTTP server.

Comment 24 Gary Scarborough 2021-04-07 00:14:13 UTC
Created attachment 1769738 [details]
error seen in tar file attempt

Comment 25 Gary Scarborough 2021-04-07 00:16:37 UTC
Created attachment 1769739 [details]
/tmp logs tar file

Comment 26 Brian Lane 2021-04-07 16:17:54 UTC
When making a tar payload you need to list the packages that Anaconda needs to finish the installation. Because a tar is meant primarily for use with containers or chroots it adds very little to the blueprint. What you are seeing here is that grub2 is missing from the tar, so Anaconda cannot finish settting up the bootloader.

The blueprint should include the @anaconda-tools group, and grub2 if it is being installed to a BIOS system. If it is also being used on UEFI then it needs:

shim
shim-ia32
grub2-efi
grub2-efi-*-cdboot
grub2-efi-ia32
efibootmgr


It is probably easier to make the live-iso like you did before and extract the squashfs.img from that and use it, since it should have all of the required utilities.

The lorax-composer templates for the various output types can be found here, these are the kickstarts used to make the image and the %packages section lists the packages that are always added to the ones listed in the blueprint.

https://github.com/weldr/lorax/tree/rhel7-extras/share/composer

Comment 27 Gary Scarborough 2021-04-07 17:23:15 UTC
It appears that packages from anaconda-tools are installed.  grub2-common, device mapper, .... Composer is suppose to add any missing dependencies. So if it isn't, then that is a composer issue as well. 

Keep in mind that the live ISO image booted just fine, it just doesn't work when used for provisioning from satellite.

Comment 28 Michael Pagan 2021-04-13 15:27:59 UTC
Per Gary Scarbofourh, on attempting to test this with .tar format images generated by Image Builder rather than .iso. Essentially the same error:

==========

"The tar image trial ended with the same error, but looking for a different file.

I think the issue is that the installer is not linking the partitions - loop-back images correctly.  For instance, the boot partition is left empty when the bug happens.

This would also explain why it cant find certain executables when it tries to run them, even though they are in the package payload."

Comment 30 Terry Bowling 2021-04-20 20:58:40 UTC
I've made some progress testing with RHEL 8 here, but still not yet completely successful.  https://bugzilla.redhat.com/show_bug.cgi?id=1949456#c11

Comment 31 Terry Bowling 2021-04-23 15:54:54 UTC
I have had success with RHEL 8.3 using a few backports from 8.4 as described in https://bugzilla.redhat.com/show_bug.cgi?id=1949456#c17.

For RHEL 7.9, I am testing now.  I've manually added the @core and @anaconda-tools package groups to the lorax-composer kickstart template file /usr/share/lorax/composer/tar.ks and am waiting on the test image build to complete.  After that, I will test as a simple network kickstart install as I did in the other BZ.

Hopefully, the RHEL 7.9 Boot DVD ISO works fine and does not have the same issues 8 had.

Comment 32 Terry Bowling 2021-04-23 21:11:52 UTC
Success!  I was able to use the same process as describe in the other bz in comment 31 with the same kickstart file but modified to point to a different liveimg URL.  I was able to use the smaller RHEL 7.9 Boot iso image.

The key to this succeeding is to add a few more package groups to either the blueprint, or lorax-composer's kickstart template that it uses to build the TAR image (note, this is very different from osbuild in RHEL 8).

Add the following package groups and packages to the %packages section of /usr/share/lorax/composer/tar.ks.  Note, that this might get overwritten in future versions.  We need to request a bugfix to add these more permanently.

@core
@anaconda-tools
authconfig


---------
Blueprint
---------
# cat RHEL_Minimal.toml
version = "0.0.10"
description = "A minimal image containing only @core"
groups = []
modules = []
name = "RHEL_Minimal"

[[packages]]
version = "*"
name = "bash-completion"

[[packages]]
version = "*"
name = "cockpit"

[[packages]]
version = "*"
name = "cockpit-packagekit"

[[packages]]
version = "*"
name = "insights-client"

[[packages]]
version = "*"
name = "vim-enhanced"

[customizations]
hostname = "rhel-min-template"

[customizations.firewall]

[customizations.firewall.services]
enabled = ["ssh", "cockpit"]

[customizations.services]
enabled = ["sshd", "cockpit.socket"]

[[customizations.user]]
description = "ansible_admin"
groups = ["wheel"]
name = "admin"
key = "ssh-rsa AAAAB3  ... snip ...  lbrPf demo"
# edge1234
password = "$6$wRWV9JxR2QLaCWJ.$.fdq50gYnHwg7/2gyx.XG/fUgSzs09dseeFDHyR7uFkGx1Wqe5zLeaoh0M.nl63nFpWhnmdRX0EXc4tJLExF9/"


---------
Kickstart
---------
#
# This kickstart template will use the RHEL 8.4+ Boot DVD ISO
# to automation installation of a TAR OS image created by
# RHEL 8 Image Builder.
#

lang en_US
keyboard us
timezone America/New_York --isUtc

install
liveimg --url="http://192.168.1.5/kicks/rhel79-gold.tar.xz"
#liveimg --url="http://192.168.1.5/kicks/rhel83-gold.tar.xz"

zerombr
clearpart --all --initlabel
#autopart --type=plain --fstype=xfs 
part /boot --fstype=xfs --size=1024 --asprimary
part pv.0 --fstype=lvmpv --ondisk=vda  --size=1 --grow  
volgroup system --pesize=4096 pv.0 
logvol / --vgname=system --name=root --fstype=xfs --percent=80
logvol /var --vgname=system --name=var --fstype=xfs --percent=10 --grow --maxsize=5000
logvol /var/log --vgname=system --name=varlog --fstype=xfs --percent=5 --grow --maxsize=5000
logvol swap  --vgname=system --name=swap --fstype="swap" --recommended

reboot
#text
# firstboot --disable
skipx
network --bootproto=dhcp
auth --passalgo=sha512 --useshadow

# Configured in Blueprint instead
# selinux --enforcing

# Configure firewall & ervices in Blueprint instead
# firewall --enabled --http --ssh

user --name=testuser --groups=wheel --gecos="test user" --iscrypted --password="$6$wx26nHNmRxsZElqd$OSof8TucuRIh.ar6wgLc/CB67KQmrxpuiU6VFuTkxHVHw8ruBn.WsHvgYoOU7Tj5XjKbgoNYj1Fc0j/V21Ayi."

sshkey --username=testuser "ssh-rsa AAAAB3  ... snip ...  lbrPf demo"

# edge1234
#rootpw --iscrypted "$6$wx26nHNmRxsZElqd$OSof8TucuRIh.ar6wgLc/CB67KQmrxpuiU6VFuTkxHVHw8ruBn.WsHvgYoOU7Tj5XjKbgoNYj1Fc0j/V21Ayi."

#sshkey --username=root "ssh-rsa AAAAB3  ... snip ...  lbrPf demo"

Comment 35 RHEL Program Management 2023-09-18 15:15:44 UTC
Issue migration from Bugzilla to Jira is in process at this time. This will be the last message in Jira copied from the Bugzilla bug.

Comment 36 RHEL Program Management 2023-09-18 15:30:03 UTC
This BZ has been automatically migrated to the issues.redhat.com Red Hat Issue Tracker. All future work related to this report will be managed there.

Due to differences in account names between systems, some fields were not replicated.  Be sure to add yourself to Jira issue's "Watchers" field to continue receiving updates and add others to the "Need Info From" field to continue requesting information.

To find the migrated issue, look in the "Links" section for a direct link to the new issue location. The issue key will have an icon of 2 footprints next to it, and begin with "RHEL-" followed by an integer.  You can also find this issue by visiting https://issues.redhat.com/issues/?jql= and searching the "Bugzilla Bug" field for this BZ's number, e.g. a search like:

"Bugzilla Bug" = 1234567

In the event you have trouble locating or viewing this issue, you can file an issue by sending mail to rh-issues. You can also visit https://access.redhat.com/articles/7032570 for general account information.