Bug 2001968

Summary: Undercloud upgrade doesn't find the openstack-tripleo-validations playbooks
Product: Red Hat OpenStack Reporter: jpateteg
Component: python-tripleoclientAssignee: Jiri Podivin <jpodivin>
Status: CLOSED ERRATA QA Contact: nlevinki <nlevinki>
Severity: urgent Docs Contact:
Priority: urgent    
Version: 16.1 (Train)CC: apetrich, cjeanner, gchamoul, hbrock, jjoyce, jpodivin, jschluet, jslagle, kthakre, mburns, rheslop, slinaber, tvignaud
Target Milestone: z8Keywords: Triaged
Target Release: 16.1 (Train on RHEL 8.2)   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: python-tripleoclient-12.3.2-1.20210929093312.ae58329.el8ost Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 2007556 (view as bug list) Environment:
Last Closed: 2022-03-24 11:01:10 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:    
Bug Blocks: 2007556    

Description jpateteg 2021-09-07 14:59:52 UTC
Description of problem:
When attepmting a minor update on the undercloud from z1 to z5 (Train) the process will fail right after start because it cannot find the validation playbooks.

Version-Release number of selected component (if applicable):
RHOSP Train 16.1.1

How reproducible:
Always

Steps to Reproduce:
1. Prepare new packages for the minor update
2. run openstack undercloud upgrade command
3.

Actual results:
Process fails with the error:

An error occurred during configuration validation, please check your host configuration and try again. Error message: No such playbook: /usr/share/openstack-tripleo-validations/playbooks/undercloud-disk-space-pre-upgrade.yaml
Command '['openstack', 'undercloud', 'upgrade', '--skip-package-updates']' returned non-zero exit status 1.
Command '['openstack', 'undercloud', 'upgrade', '--skip-package-updates']' returned non-zero exit status 1.



Expected results:
Undercloud upgrade process should conclude successfully

Additional info:
The failed validated playbooks can be found at /usr/share/ansible/validation-playbooks/ can I just copy all (or link) of them as workaround to /usr/share/openstack-tripleo-validations/playbooks/ ?

Comment 1 jpateteg 2021-09-07 19:21:24 UTC
After checking deeper with the team we came across with this pieces of code:

[stack@director-rich tripleoclient]$ grep "\/usr\/share\/openstack-tripleo-validations" *

constants.py:DEFAULT_VALIDATIONS_LEGACY_BASEDIR = "/usr/share/openstack-tripleo-validations"

grep -A5 ANSIBLE_VALIDATION_DIR /usr/lib/python3.6/site-packages/tripleoclient/constants.py
ANSIBLE_VALIDATION_DIR = (
    os.path.join(DEFAULT_VALIDATIONS_LEGACY_BASEDIR, 'playbooks')
    if os.path.exists(os.path.join(DEFAULT_VALIDATIONS_LEGACY_BASEDIR,
                                   'playbooks'))
    else "/usr/share/ansible/validation-playbooks"
    )

So it looks like it search the validation playbooks first on the legacy directory, - which exists- but does not contain the playbooks.

Moving that directory /usr/share/openstack-tripleo-validations/playbooks to a different name fix the issue.

It is odd why that dir existed.

Comment 3 Jiri Podivin 2021-09-13 09:08:43 UTC
Proposed solution on the KB, entails removal of the '/usr/share/openstack-tripleo-validations' directory to ensure that VF is looking for the validations in the right place.
The solution is considered generally acceptable and sufficient by the VF squad, at least in cases where direct patch of the code isn't feasible.

Comment 4 Jiri Podivin 2021-09-13 12:20:55 UTC
All patches are now in review.

Comment 6 Jiri Podivin 2021-09-15 08:48:46 UTC
I believe it is. Conditional is the same in both 16.1 and 16.2. The directory '/usr/share/openstack-tripleo-validations' is also present on my 16.2 deployment. 
Therefore, I do believe it's probable that the same issue should affect both.

Comment 16 errata-xmlrpc 2022-03-24 11:01:10 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.8 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-2022:0986