Issue
The same problem exists on RHEL-8.8.
+++ This bug was initially created as a clone of Bug #2208375 +++
Description of problem:
When using the rhsm command in a kickstart Anaconda tries to mount the cdrom/dvd as a source first. This results in an error being logged which causes livemedia-creator to cancel the installation (see rhbz#2208340 for the livemedia-creator workaround for this).
During a normal installation this doesn't seem to be a problem, it then tears down the failed cdrom mount and falls back to using the CDN setup by rhsn.
Looking at the logs reveals that it first runs rhsm-service and actually has it all setup before trying the CDROM, so it knows it is a kickstart, has the network up, and rhsm is working. It would make more sense to try that first and fall back to CDROM if it fails.
Version-Release number of selected component (if applicable):
anaconda-38.23.4-2
How reproducible:
Always
Steps to Reproduce:
1. Make a kickstart using rhsm
2. Use livemedia-creator to try and create a disk image (or just observe the logs of a normal install)
3. lmc fails with an error. In the logs it has:
16:58:48,813 ERR anaconda:packaging: base repo (CDROM/file:///run/install/sources/mount-0000-cdrom) not valid – removing it
which triggers lmc's error handling and cancels the install.
— Additional comment from Jan Stodola on 2023-05-19 10:59:30 CEST —
This is also a problem when the full installation media (dvd.iso) is used. In such a case anaconda not only tries, but also uses the medium instead of CDN.
The cdrom source should be tried/used only when both the rhsm and cdrom kickstart commands are used.
When the user registers manually in GUI, the installation source is automatically switched to CDN, as expected and documented at https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/9/html/performing_a_standard_rhel_9_installation/assembly_installing-on-amd64-intel-64-and-64-bit-arm_installing-rhel#how-the-default-installation-repo-works-in-cdn_register-and-install-from-cdn