Hide Forgot
Description of problem: Packages are not updated after RHEL Registration to Satellite server in initial stack creation. This seems to be an order of operations problem (or a design choice???) UpdateDeployment stack resource is deployed before RHELRegistrationDeployment stack, therefore no packages updates are made. I have changed Compute and Controller Role YAML files as highlighted below to have all overcloud updated with all packages when overcloud is deployed. Version-Release number of selected component (if applicable): [stack@undercloud-4 rhel-registration]$ rpm -qa | grep templates | grep tripleo openstack-tripleo-heat-templates-5.2.0-3.el7ost.noarch How reproducible: Deploy stack and register to satellite Additional info: In order to work around this, we made the following change (which still needs to be tested in the environment, but it should work): Follow the documentation: https://access.redhat.com/documentation/en-us/red_hat_openstack_platform/10/html-single/advanced_overcloud_customization/#sect-Registering_the_Overcloud It suggests to copy the registration files from the Heat template collection: ~~~ $ cp -r /usr/share/openstack-tripleo-heat-templates/extraconfig/pre_deploy/rhel-registration ~/templates/. ~~~ And then include those copied files: ~~~ $ openstack overcloud deploy --templates [...] -e /home/stack/templates/rhel-registration/environment-rhel-registration.yaml -e /home/stack/templates/rhel-registration/rhel-registration-resource-registry.yaml ~~~ What you can then do is, push your modification into /home/stack/templates/rhel-registration/rhel-registration.yaml ~~~ [stack@undercloud-4 rhel-registration]$ diff -c /usr/share/openstack-tripleo-heat-templates/extraconfig/pre_deploy/rhel-registration/rhel-registration.yaml /home/stack/templates/rhel-registration/rhel-registration.yaml *** /usr/share/openstack-tripleo-heat-templates/extraconfig/pre_deploy/rhel-registration/rhel-registration.yaml 2017-01-02 19:14:26.000000000 -0500 --- /home/stack/templates/rhel-registration/rhel-registration.yaml 2017-03-23 16:09:35.659288981 -0400 *************** *** 118,123 **** --- 118,154 ---- input_values: REG_METHOD: {get_param: rhel_reg_method} + YumUpdateConfigurationAfterRHELRegistration: + type: OS::Heat::SoftwareConfig + properties: + group: script + config: | + #!/bin/bash + set -x + list_updates=$(yum list -q updates) + if [[ "$list_updates" == "" ]]; then + echo "No packages require updating" + exit 0 + fi + full_command="yum -q -y update" + echo "Running: $full_command" + result=$($full_command) + return_code=$? + echo "$result" + echo "yum return code: $return_code" + + UpdateDeploymentAfterRHELRegistration: + type: OS::Heat::SoftwareDeployment + depends_on: RHELRegistrationDeployment + properties: + name: UpdateDeploymentAfterRHELRegistration + config: {get_resource: YumUpdateConfigurationAfterRHELRegistration} + server: {get_param: server} + actions: ['CREATE'] # Only do this on CREATE + input_values: + update_identifier: + get_param: DeployIdentifier + outputs: deploy_stdout: description: Deployment reference, used to trigger puppet apply on changes ~~~ Can we add this **by default** to the RHELRegistration templates?
[stack@undercloud-4 rhel-registration]$ diff -c /usr/share/openstack-tripleo-heat-templates/extraconfig/pre_deploy/rhel-registration/rhel-registration.yaml /home/stack/templates/rhel-registration/rhel-registration.yaml *** /usr/share/openstack-tripleo-heat-templates/extraconfig/pre_deploy/rhel-registration/rhel-registration.yaml 2017-01-02 19:14:26.000000000 -0500 --- /home/stack/templates/rhel-registration/rhel-registration.yaml 2017-03-23 16:34:13.541312274 -0400 *************** *** 118,123 **** --- 118,151 ---- input_values: REG_METHOD: {get_param: rhel_reg_method} + YumUpdateConfigurationAfterRHELRegistration: + type: OS::Heat::SoftwareConfig + properties: + group: script + config: | + #!/bin/bash + set -x + list_updates=$(yum list -q updates) + if [[ "$list_updates" == "" ]]; then + echo "No packages require updating" + exit 0 + fi + full_command="yum -q -y update" + echo "Running: $full_command" + result=$($full_command) + return_code=$? + echo "$result" + echo "yum return code: $return_code" + + UpdateDeploymentAfterRHELRegistration: + type: OS::Heat::SoftwareDeployment + depends_on: RHELRegistrationDeployment + properties: + name: UpdateDeploymentAfterRHELRegistration + config: {get_resource: YumUpdateConfigurationAfterRHELRegistration} + server: {get_param: server} + actions: ['CREATE'] # Only do this on CREATE + outputs: deploy_stdout: description: Deployment reference, used to trigger puppet apply on changes
Coming to think of it, this may actually be a design decision (not to run any packet updates). If this is the case, feel free to close out this bug report.
No we have a similar bug upstream LP#1640894 which describes something similar situation so this sounds like a reasonable feature request for future releases. I'm not sure on a backport but I'll at least propose it upstream.
Looking at the upstream bug, does this mean that if we simply set a dummy value for: UpdateIdentifer ... that this will trigger an initial update?
So tracing through, it seems that if you set UpdateIdentifier it will perform a yum -y update as part of the deployment and switch to use the latest version of the packages available. So would that work for you in this case or do we need to specifically need to run a yum update immediately after registering and before doing anything else?
Verified with build 2017-12-06.2
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, 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/RHEA-2017:3462