Bug 1962410

Summary: VMs Migrating are Losing ELS Subscriptions and Repos for RHEL 6
Product: Red Hat Satellite Reporter: myoder
Component: CandlepinAssignee: satellite6-bugs <satellite6-bugs>
Status: CLOSED ERRATA QA Contact: Danny Synk <dsynk>
Severity: high Docs Contact:
Priority: unspecified    
Version: 6.9.0CC: aganbat, alsouza, aperotti, gpadholi, hyu, ktordeur, kurathod, ltran, mjia, nlager, nmoumoul, pcreech, pdwyer, rdesouza, redakkan, saydas, tasander
Target Milestone: 6.11.0Keywords: Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: candlepin-4.0.16-1, candlepin-4.1.11-1 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1964376 2059375 (view as bug list) Environment:
Last Closed: 2022-07-05 14:28:57 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:
Bug Depends On: 1964376, 1964379    
Bug Blocks: 1399395    

Description myoder 2021-05-20 01:11:20 UTC
Description of problem:

VMs that are inheriting an ELS subscription from a hypervisor, are migrating frequently in an environment, sometimes several times a day.  When this happens, the subscriptions for ELS are not auto-attached, therefore the ELS repos are not available.  Running "subscription-manager refresh" will bring the subscription back, and the els repos are enabled again.  2 things that are noticed:

  - RHEL5 servers don't drop their els repositories when they migrate
  - The base RHEL6 repos don't drop when they migrate

Seems to be just an issue with RHEL6 els repositories / subscription.

Version-Release number of selected component (if applicable):
Satellite 6.9.1
Red Hat Server 6

How reproducible:
always

Steps to Reproduce:
1. Have a RHEL6 vm use an ELS subscription inherited via a VDC subscription
2. Have the host migrate to another hypervisor (that is also entitled)
3. 
 
Actual results:
RHEL6 servers drop their els repositories, but not their base rhel6 repos.

Expected results:
ELS repos shouldn't drop due to migration.

Additional info:

subscription-manager refresh fixes this issue.

currently an Ansible Role is being used to re-attach the subscriptions and repos for the RHEL6 hosts.

Comment 29 Danny Synk 2022-04-29 18:37:23 UTC
Verified on Satellite 6.11 snap 18, running on both RHEL 7 and RHEL 8 (candlepin-4.1.12-1).

Steps to Test:

0. Synchronize the "Red Hat Enterprise Linux 6 Server - Extended Life Cycle Support (RPMs)" repository to Satellite.
1. Configure a RHEL 8 system as a KVM hypervisor.
2. Deploy a RHEL 6 virtual guest on the KVM hypervisor.
3. Register both the hypervisor and the guest to Satellite 6.11.
4. Attach "Red Hat Enterprise Linux Extended Life Cycle Support (Unlimited Guests)" (SKU RH00271) and "Red Hat Enterprise Linux for Virtual Datacenters with Smart Management, Premium" (SKU RH00006) subscriptions to the hypervisor.
5. Configure virt-who to run on the hypervisor and report to the Satellite.
6. On the RHEL 6 host, add a "Red Hat Enterprise Linux Server - Extended Life Cycle Support" product certificate to /etc/pki/product.
7. On the hypervisor, force a virt-who run by stopping the virt-who service and running `virt-who -od`.
8. Verify that the RHEL 6 system is reported as a virtual guest of the hypervisor.
9. On the RHEL 6 host, run `subscription-manager attach --auto`.

Expected Results:
Guest subscriptions from the Extended Life Cycle Support and Virtual Datacenters subscriptions are attached to the RHEL 6 system. The "Red Hat Enterprise Linux 6 Server - Extended Life Cycle Support (RPMs)" repository is available to the guest. When examining the entitlement certificate for the Extended Life Cycle Support subscription on the RHEL 6 system using `rct cat-cert /etc/pki/entitlement/<entitlement serial>.pem`, the "Red Hat Enterprise Linux 6 Server - Extended Life Cycle Support (RPMs)" repository is listed in the "Content" section of the output.

Actual Results:
Guest subscriptions from the Extended Life Cycle Support and Virtual Datacenters subscriptions are attached to the RHEL 6 system. The "Red Hat Enterprise Linux 6 Server - Extended Life Cycle Support (RPMs)" repository is available to the guest. When examining the entitlement certificate for the Extended Life Cycle Support subscription on the RHEL 6 system using `rct cat-cert /etc/pki/entitlement/<entitlement serial>.pem`, the "Red Hat Enterprise Linux 6 Server - Extended Life Cycle Support (RPMs)" repository is listed in the "Content" section of the output.

Comment 33 errata-xmlrpc 2022-07-05 14:28:57 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 (Moderate: Satellite 6.11 Release), 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/RHSA-2022:5498

Comment 34 Nikos Moumoulidis 2022-09-19 12:47:27 UTC
*** Bug 2122621 has been marked as a duplicate of this bug. ***