Bug 1906162 - Disk Image Builder uses hardcoded non-eus repos
Summary: Disk Image Builder uses hardcoded non-eus repos
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat OpenStack
Classification: Red Hat
Component: diskimage-builder
Version: 16.1 (Train)
Hardware: x86_64
OS: Linux
low
medium
Target Milestone: z7
: 16.1 (Train on RHEL 8.2)
Assignee: Steve Baker
QA Contact:
URL:
Whiteboard:
Depends On: 1954627
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-12-09 19:28 UTC by Lukasz Pelczyk
Modified: 2021-12-16 16:35 UTC (History)
11 users (show)

Fixed In Version: diskimage-builder-3.1.0-1.20210528071816.6822090.el8ost
Doc Type: Bug Fix
Doc Text:
Before this update, the `appstream` and `baseos` repositories were always added to the repositories enabled by Red Hat Subscription Manager, with no way to override them. With this update, when you define the `$REG_REPOS` variable no base repositories are added. With this fix, you can fully control which repositories are added, but you must now include all repositories including the equivalent repository for `baseos` (and `appstream` when required).
Clone Of:
: 1945448 (view as bug list)
Environment:
Last Closed: 2021-12-09 20:17:29 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
OpenStack gerrit 779874 0 None NEW Only add rhel base repos when REG_REPOS is not set 2021-03-10 22:21:13 UTC
Red Hat Issue Tracker OSP-1695 0 None None None 2021-11-18 11:29:17 UTC
Red Hat Product Errata RHBA-2021:3762 0 None None None 2021-12-09 20:18:01 UTC

Description Lukasz Pelczyk 2020-12-09 19:28:50 UTC
Description of problem:
When building distro: rhel image diskimage-builder/elements/rhel-common/pre-install.d/00-rhel-registration file us used, where repos are hardcoded:
rhel-8-for-x86_64-appstream-rpms, rhel-8-for-x86_64-baseos-rpms and satellite-tools-6.5-for-rhel-8-x86_64-rpms.

These are not overriden by REG_REPOS variable, and builder always tries to use them. In case of local satellite these repos might not exist, or have different names (like EUS repos). 

Moreover - even after modification of 00-rhel-registration file, and cleanup of __pycache__ and pyc, diskbuilder uses old code. After failure of first run, when I perform a re-run, the new code is consumed, and build passes. 
Such behaviour breaks OpenStack deployment automation


Version-Release number of selected component (if applicable):
diskimage-builder-3.0.1-0.20200609103442.68017d0.el8ost.noarch
rhosp-director-images-16.1-20201003.1.el8ost.noarch
rhosp-director-images-x86_64-16.1-20201003.1.el8ost.noarch
rhosp-director-images-ipa-x86_64-16.1-20201003.1.el8ost.noarch
rhosp-director-images-ipa-16.1-20201003.1.el8ost.noarch

How reproducible:
Always


Steps to Reproduce:
Follow instructions as per https://access.redhat.com/documentation/en-us/red_hat_openstack_platform/16.1/html/director_installation_and_usage/creating-whole-disk-images for local satellite deployment. Provide EUS repos instead of classic ones.

Actual results:
First build failed

Expected results:
- Be able to change repos selection
- OR at least have a workaround which would work for the initial run of disk builder.

Additional info:

Comment 4 Steve Baker 2021-02-24 04:07:22 UTC
It does look like upstream needs a change where this conditional[1] is only true if REG_REPOS is not set. We can document that if REG_REPOS is used it must be a complete list, since no base repos will be added.

[1] https://opendev.org/openstack/diskimage-builder/src/branch/master/diskimage_builder/elements/rhel-common/pre-install.d/00-rhel-registration#L16

Comment 5 David Hill 2021-03-10 21:05:52 UTC
We're using a complete list but it still appends the non eus repositories ... 

export REG_REPOS=" ansible-2.9-for-rhel-8-x86_64-rpms fast-datapath-for-rhel-8-x86_64-rpms rhel-8-for-x86_64-highavailability-eus-rpms openstack-16.1-for-rhel-8-x86_64-rpms rhceph-4-tools-for-rhel-8-x86_64-rpms advanced-virt-for-rhel-8-x86_64-rpms rhel-8-for-x86_64-appstream-eus-rpms rhel-8-for-x86_64-baseos-eus-rpms ansible-2.9-for-rhel-8-x86_64-rpms fast-datapath-for-rhel-8-x86_64-rpms rhv-4-mgmt-agent-for-rhel-8-x86_64-rpms rhv-4.4-manager-for-rhel-8-x86_64-rpms advanced-virt-for-rhel-8-x86_64-rpms jb-eap-7.3-for-rhel-8-x86_64-rpms"




and it does this:

2021-03-10 20:58:25.206 | Enabling repos: repos --enable rhel-8-for-x86_64-appstream-rpms --enable rhel-8-for-x86_64-baseos-rpms --enable ansible-2.9-for-rhel-8-x86_64-rpms --enable fast-datapath-for-rhel-8-x86_64-rpms --enable rhel-8-fo
r-x86_64-highavailability-eus-rpms --enable openstack-16.1-for-rhel-8-x86_64-rpms --enable rhceph-4-tools-for-rhel-8-x86_64-rpms --enable advanced-virt-for-rhel-8-x86_64-rpms --enable rhel-8-for-x86_64-appstream-eus-rpms --enable rhel-8-
for-x86_64-baseos-eus-rpms --enable ansible-2.9-for-rhel-8-x86_64-rpms --enable fast-datapath-for-rhel-8-x86_64-rpms --enable rhv-4-mgmt-agent-for-rhel-8-x86_64-rpms --enable rhv-4.4-manager-for-rhel-8-x86_64-rpms --enable advanced-virt-
for-rhel-8-x86_64-rpms --enable jb-eap-7.3-for-rhel-8-x86_64-rpms

Comment 6 David Hill 2021-03-10 21:16:45 UTC
Looks like it is now in /usr/lib/python3.6/site-packages/diskimage_builder/elements/rhel-common/pre-install.d/00-rhel-registration instead... we were updating the wrong file.

Comment 7 Steve Baker 2021-03-10 22:21:15 UTC
I've proposed a fix for this upstream

Comment 33 Steve Baker 2021-12-07 00:19:56 UTC
Looks good, thanks

Comment 39 errata-xmlrpc 2021-12-09 20:17:29 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 (Red Hat OpenStack Platform 16.1.7 (Train) bug fix and enhancement 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://access.redhat.com/errata/RHBA-2021:3762


Note You need to log in before you can comment on or make changes to this bug.