Allow rhel repository swtich upon upgrade

Bug #1797138 reported by Jose Luis Franco
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
tripleo
Fix Released
High
Jose Luis Franco

Bug Description

Bug based on BZ: https://bugzilla.redhat.com/show_bug.cgi?id=1522960 [which references to OSP 11 to OSP12) but I believe we're having the same issue in master right now. So we need to fix this from stable/pike to master (notice that stable/pike used the rhos-environment script, while since stable/queens we started using OS::TripleO::Service::Rhsm service.

Description of the problem:
- When registering the nodes via satellite or RH portal, the repositories do not get updated on upgrade.
- Register nodes during deployment either using rhel-registration script filling in rhel-registration/environment-rhel-registration.yaml (Pike/Queens) or passing an environment file with the corresponding values for the Rhsm service as stated in https://access.redhat.com/documentation/en-us/red_hat_openstack_platform/13/html/advanced_overcloud_customization/ansible-based-registration (Rocky/Master)

- Update rhel_reg_repos (Pike/Queens) or rhsm_repos if (Rocky/Master)
- Perform upgrade to next release
- Go into overcloud nodes and check the enabled repos via subscription-manager repos --list-enabled
- The very same repos which were enabled in deploy remain enabled and the new ones are not configured.

***This LP aims to cover multiple releases***

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix proposed to tripleo-heat-templates (stable/pike)

Related fix proposed to branch: stable/pike
Review: https://review.openstack.org/609422

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix proposed to tripleo-heat-templates (stable/queens)

Related fix proposed to branch: stable/queens
Review: https://review.openstack.org/609456

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Related fix proposed to branch: stable/queens
Review: https://review.openstack.org/609457

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix merged to tripleo-heat-templates (stable/pike)

Reviewed: https://review.openstack.org/609422
Committed: https://git.openstack.org/cgit/openstack/tripleo-heat-templates/commit/?id=610193f7fbefe325bf64ac52b176c8ef21342171
Submitter: Zuul
Branch: stable/pike

commit 610193f7fbefe325bf64ac52b176c8ef21342171
Author: Steven Hardy <email address hidden>
Date: Mon Feb 19 12:02:59 2018 +0000

    Add RHELRegistrationActions to rhel-registration template

    This can be used in the case where e.g a satellite has been added
    after the initial deployment to re-register the nodes with the
    satellite, even those nodes that already exist.

    Related-Bug: #1797138
    Change-Id: I944bc4c65b08de1ca08dd91f55764ebfe141dd9c
    (cherry picked from commit db61b37345086eacf7e997a1b5a3335368fdd313)

tags: added: in-stable-pike
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix proposed to tripleo-heat-templates (master)

Related fix proposed to branch: master
Review: https://review.openstack.org/610493

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix merged to tripleo-heat-templates (stable/queens)

Reviewed: https://review.openstack.org/609456
Committed: https://git.openstack.org/cgit/openstack/tripleo-heat-templates/commit/?id=91746c290be5fc374ad2389694779a7b57351c81
Submitter: Zuul
Branch: stable/queens

commit 91746c290be5fc374ad2389694779a7b57351c81
Author: Jose Luis Franco Arza <email address hidden>
Date: Wed Oct 10 17:36:04 2018 +0200

    [Ocata/Pike/Queens] Make rhel-registration scripts location absolute.

    This patch modifies the script files location to be executed
    during the SoftwareDeployment resources in rhel-registration.yaml.
    The main purpose of this is to ensure we are running the right
    script content related to a branch, for example, after an upgrade.

    Change-Id: If77acb78c63511054e17d553982e19e748c88992
    Related-Bug: #1797138

tags: added: in-stable-queens
Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Reviewed: https://review.openstack.org/609457
Committed: https://git.openstack.org/cgit/openstack/tripleo-heat-templates/commit/?id=18987fbe32316e3ed8c7afcc3bf6199a10d0ee8b
Submitter: Zuul
Branch: stable/queens

commit 18987fbe32316e3ed8c7afcc3bf6199a10d0ee8b
Author: Jose Luis Franco Arza <email address hidden>
Date: Wed Oct 10 17:13:56 2018 +0200

    [Queens/Pike] Re-registry with new rhel_reg parameters on upgrade.

    Currently, when the overcloud nodes were registered in Satellite
    or portal during deployment via extraconfig/pre_deploy/rhel-registration
    and an upgrade is performed passing different values for rhel_reg_repos
    these changes are not taken into account. As a consequence, we end up
    running the upgrade steps with the previous repositories configured
    during deployment.

    This patch allows us to re-register using the --force option using
    the new values inserted at the pre-upgrade step. To allow this, we
    make use of the RHELRegistrationAction parameter to change the
    action in which the RHELRegistrationDeployment resource is run.
    By setting it to UPDATE, the SoftwareDeployment resource will
    be triggered during the stack update which takes place in the
    upgrade. Passing the force option will force the re-execution
    of rhel-registration script even though it was executed previously
    during deployment (bypassing the /mnt/state/var/lib/rhsm/rhsm.ok
    guard.

    Change-Id: I51a1dad5f422756d0a8c4deff81c170be7d944d3
    Related-Bug: #1797138

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix proposed to tripleo-heat-templates (stable/pike)

Related fix proposed to branch: stable/pike
Review: https://review.openstack.org/611857

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Related fix proposed to branch: stable/pike
Review: https://review.openstack.org/611858

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix merged to tripleo-heat-templates (stable/pike)

Reviewed: https://review.openstack.org/611857
Committed: https://git.openstack.org/cgit/openstack/tripleo-heat-templates/commit/?id=521744b5476111f584302f7f9f11399624030eb3
Submitter: Zuul
Branch: stable/pike

commit 521744b5476111f584302f7f9f11399624030eb3
Author: Jose Luis Franco Arza <email address hidden>
Date: Wed Oct 10 17:36:04 2018 +0200

    [Ocata/Pike/Queens] Make rhel-registration scripts location absolute.

    This patch modifies the script files location to be executed
    during the SoftwareDeployment resources in rhel-registration.yaml.
    The main purpose of this is to ensure we are running the right
    script content related to a branch, for example, after an upgrade.

    Change-Id: If77acb78c63511054e17d553982e19e748c88992
    Related-Bug: #1797138
    (cherry picked from commit 91746c290be5fc374ad2389694779a7b57351c81)

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Reviewed: https://review.openstack.org/611858
Committed: https://git.openstack.org/cgit/openstack/tripleo-heat-templates/commit/?id=6e021da2e350db6548e216648ad5e14c4f6ab3c7
Submitter: Zuul
Branch: stable/pike

commit 6e021da2e350db6548e216648ad5e14c4f6ab3c7
Author: Jose Luis Franco Arza <email address hidden>
Date: Wed Oct 10 17:13:56 2018 +0200

    [Queens/Pike] Re-registry with new rhel_reg parameters on upgrade.

    Currently, when the overcloud nodes were registered in Satellite
    or portal during deployment via extraconfig/pre_deploy/rhel-registration
    and an upgrade is performed passing different values for rhel_reg_repos
    these changes are not taken into account. As a consequence, we end up
    running the upgrade steps with the previous repositories configured
    during deployment.

    This patch allows us to re-register using the --force option using
    the new values inserted at the pre-upgrade step. To allow this, we
    make use of the RHELRegistrationAction parameter to change the
    action in which the RHELRegistrationDeployment resource is run.
    By setting it to UPDATE, the SoftwareDeployment resource will
    be triggered during the stack update which takes place in the
    upgrade. Passing the force option will force the re-execution
    of rhel-registration script even though it was executed previously
    during deployment (bypassing the /mnt/state/var/lib/rhsm/rhsm.ok
    guard.

    Change-Id: I51a1dad5f422756d0a8c4deff81c170be7d944d3
    Related-Bug: #1797138
    (cherry picked from commit 18987fbe32316e3ed8c7afcc3bf6199a10d0ee8b)

Changed in tripleo:
milestone: stein-1 → stein-2
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix proposed to tripleo-heat-templates (stable/rocky)

Related fix proposed to branch: stable/rocky
Review: https://review.openstack.org/620953

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix merged to tripleo-heat-templates (master)

Reviewed: https://review.openstack.org/610493
Committed: https://git.openstack.org/cgit/openstack/tripleo-heat-templates/commit/?id=030442d07d7931d016044f150314a921167a31af
Submitter: Zuul
Branch: master

commit 030442d07d7931d016044f150314a921167a31af
Author: Jose Luis Franco Arza <email address hidden>
Date: Mon Oct 15 14:01:45 2018 +0200

    Invoke redhat-subscription role during upgrade.

    Before performing an upgrade, the new repositories and
    activation key should be configured. Rhsm is the service
    in charge of performing the overcloud nodes registration,
    so we need to enable the new repository/parameters in the
    upgrade_tasks to point to the right repositories during
    upgrade.
    Also, after [0] got merged, the registration is being forced
    via --force in case it fails for the first time. Plus,
    there is also a new option that allows us to enable only
    the repositories passed in rhsm_repos variable, disabling
    what is not included and was enabled. We need to pass
    this variable set to true during upgrades so we disable
    the latest version repositories.

    [0] - https://review.openstack.org/#/c/615689/

    Change-Id: I10fb84baa67275ed1f01fbb5b1236a284f2c763e
    Related-Bug: #1797138

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix merged to tripleo-heat-templates (stable/rocky)

Reviewed: https://review.openstack.org/620953
Committed: https://git.openstack.org/cgit/openstack/tripleo-heat-templates/commit/?id=8cead22781c50bc9b3767c5fe9d6ba196e3f5db3
Submitter: Zuul
Branch: stable/rocky

commit 8cead22781c50bc9b3767c5fe9d6ba196e3f5db3
Author: Jose Luis Franco Arza <email address hidden>
Date: Mon Oct 15 14:01:45 2018 +0200

    Invoke redhat-subscription role during upgrade.

    Before performing an upgrade, the new repositories and
    activation key should be configured. Rhsm is the service
    in charge of performing the overcloud nodes registration,
    so we need to enable the new repository/parameters in the
    upgrade_tasks to point to the right repositories during
    upgrade.
    Also, after [0] got merged, the registration is being forced
    via --force in case it fails for the first time. Plus,
    there is also a new option that allows us to enable only
    the repositories passed in rhsm_repos variable, disabling
    what is not included and was enabled. We need to pass
    this variable set to true during upgrades so we disable
    the latest version repositories.

    [0] - https://review.openstack.org/#/c/615689/

    Change-Id: I10fb84baa67275ed1f01fbb5b1236a284f2c763e
    Related-Bug: #1797138
    (cherry picked from commit 030442d07d7931d016044f150314a921167a31af)

tags: added: in-stable-rocky
Changed in tripleo:
milestone: stein-2 → stein-3
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on tripleo-heat-templates (stable/queens)

Change abandoned by Jose Luis Franco (<email address hidden>) on branch: stable/queens
Review: https://review.openstack.org/611879

Changed in tripleo:
milestone: stein-3 → stein-rc1
Changed in tripleo:
milestone: stein-rc1 → train-1
Changed in tripleo:
milestone: train-1 → train-2
Changed in tripleo:
milestone: train-2 → train-3
Changed in tripleo:
milestone: train-3 → ussuri-1
Changed in tripleo:
milestone: ussuri-1 → ussuri-2
wes hayutin (weshayutin)
Changed in tripleo:
milestone: ussuri-2 → ussuri-3
wes hayutin (weshayutin)
Changed in tripleo:
status: Triaged → Incomplete
wes hayutin (weshayutin)
Changed in tripleo:
milestone: ussuri-3 → ussuri-rc3
Changed in tripleo:
status: Incomplete → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.