Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 2182892

Summary: satellite_repo version is hardcoded in 00-rhel-registration
Product: Red Hat OpenStack Reporter: mlaniel
Component: diskimage-builderAssignee: Harald Jensås <hjensas>
Status: CLOSED ERRATA QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 16.2 (Train)CC: apevec, drosenfe, fboboc, hjensas, pweeks
Target Milestone: z6Keywords: Triaged
Target Release: 16.2 (Train on RHEL 8.4)   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: diskimage-builder-3.9.0-2.20230510205027.cb96117.el8ost Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-11-08 19:18:34 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description mlaniel 2023-03-29 21:53:08 UTC
User-Agent:       Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/111.0.0.0 Safari/537.36
Build Identifier: 

Customer is using diskimage builder to create an openstack overcloud image, but it fails due to hard coded satellite-tools version [1].

They are using a Satellite 6.10 server and keeping only this repo:

sudo subscription-manager repos --list | grep "satellite-tools"
Repo ID:   satellite-tools-6.10-for-rhel-8-x86_64-eus-rpms

Repos configuration is based on this doc [2]


[1] $ cat /usr/lib/python3.6/site-packages/diskimage_builder/elements/rhel-common/pre-install.d/00-rhel-registration | grep satellite-tools
satellite_repo="satellite-tools-6.5-for-rhel-8-${arch}-rpms"

[2] https://access.redhat.com/documentation/en-us/red_hat_openstack_platform/16.2/html-single/director_installation_and_usage/index#overcloud-repositories

- Red Hat Satellite Tools for RHEL 8 Server RPMs x86_64
- satellite-tools-<satellite_version>-for-rhel-8-x86_64-rpms
- Tools for managing hosts with Red Hat Satellite 6, where <satellite_version> is the version of Red Hat Satellite Server that you use.

Reproducible: Always

Steps to Reproduce:
1. Run the command to build the image:
openstack overcloud image build \
--image-name overcloud-hardened-uefi-full \
--config-file /home/stack/tmp/overcloud-hardened-images-uefi-python3.yaml \
--config-file /usr/share/openstack-tripleo-common/image-yaml/overcloud-hardened-images-uefi-rhel8.yaml

Actual Results:  
Build fails with:
Error: 'satellite-tools-6.5-for-rhel-8-x86_64-rpms' does not match a valid repository ID. Use "subscription-manager repos --list" to see valid repositories.

Expected Results:  
Build completes

We suspect either:
- Customer should be able to customize satellite-tools version
- Our doc could be improved to mention satellite-tools 6.5 is a requirement and does not have to match the satellite server version, if this is true.

Comment 3 Harald Jensås 2023-03-31 07:05:41 UTC
(In reply to Florin Boboc from comment #2)

> ~~~
> I would like a recommended workaround while we're waiting on a hotfix.
> 

I think the immediate workaround would be to manually patch diskimage builder, changing the hard-coded repository names.

I have opened an upstream bug to track this issue - https://bugs.launchpad.net/diskimage-builder/+bug/2013451 - and will start working on a patch.

> On a broader note, what is the recommendation for OSP 16.1 or 16.2
> deployments that use Satellite versions higher than 6.10? I don't believe
> there is a satellite-tools 6.11 [1] available. This change to "Satellite
> Client" would need to be addressed for diskimage-builder as well as OSP
> deployments in general [2].
> 
> [1] With Satellite 6.11 release, the Satellite Client repository replaces
> the Satellite Tools repository
> https://access.redhat.com/solutions/7004377
> 
> [2] Tasks run during OSP deployments using Satellite
> $ cat /usr/share/ansible/roles/redhat-subscription/tasks/satellite.yml |
> grep "Check for"
> - name: SATELLITE | Check for Satellite 5
> - name: SATELLITE | Check for Satellite 6
>     - name: SATELLITE | Check for Satellite 6.10
> ~~~ 

AFICT the playbook is checking for pulp API version to check for < 6.10 or > 6.10.
  https://opendev.org/openstack/ansible-role-redhat-subscription/src/branch/master/tasks/satellite.yml#L44
  https://opendev.org/openstack/ansible-role-redhat-subscription/src/branch/master/tasks/satellite.yml#L19

Unless the pulp version changed in 6.11 I think that code should still work?
The packages names are the same, it is just the repos that changed names AFICT.

Comment 11 Lon Hohberger 2023-10-31 16:03:14 UTC
Verified that diskimage-builder-3.9.0-2.20230510205027.cb96117.el8ost contains the relevant patch

Comment 16 errata-xmlrpc 2023-11-08 19:18:34 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.2.6 (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-2023:6307