Bug 1624055

Summary: [OSP-12] Changes in Basic plan configuration leads to incorrect order of env files upon deployment
Product: Red Hat OpenStack Reporter: Jon Schlueter <jschluet>
Component: openstack-tripleo-commonAssignee: Ryan Brady <rbrady>
Status: CLOSED WONTFIX QA Contact: Alexander Chuzhoy <sasha>
Severity: urgent Docs Contact:
Priority: high    
Version: 13.0 (Queens)CC: flfuchs, jjoyce, jpichon, jschluet, jtomasek, mburns, opavlenk, rbrady, sasha, slinaber, tvignaud, ukalifon
Target Milestone: ---Keywords: ZStream
Target Release: 12.0 (Pike)   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: 1541721 Environment:
Last Closed: 2018-08-31 12:10:17 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: 1541721    
Bug Blocks: 1610283    

Description Jon Schlueter 2018-08-30 18:50:44 UTC
+++ This bug was initially created as a clone of Bug #1541721 +++

Description of problem:
Working with a default plan to deploy a basic overcloud deployment with 1 compute and 3 controllers. Making changes in basic deployment breaks the order of passed env files and leads to a failed deployment.

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

12   -p 2018-01-16.2
openstack-tripleo-ui-7.4.3-4.el7ost.noarch
openstack-tripleo-common-7.6.3-8.el7ost.noarch
python-tripleoclient-7.3.3-7.el7ost.noarch
openstack-tripleo-heat-templates-7.0.3-21.el7ost.noarch

How reproducible:

always

Steps to Reproduce:

1. Prepare nodes, flavors roles for deployment
2. in Deployment configuration dialog choose Containerized deployment check box, in Others section verify environments/docker-ha.yaml and  environments/containers-default-parameters.yaml are chosen, Save and Close
3. Open Plan configuration dialog again and uncheck Base Resources Configuration in General Deployment Options section, Save and close
4. Open Plan configuration dialog again and check-in back Base Resources Configuration in General Deployment Options section, Save and close
5. Attempt to deploy

Actual results:
Deployemnt fails on Resource CREATE failed: Error: resources.AllNodesDeploySteps.resources.ControllerDeployment_Step3.resources[0]: Deployment to server failed: deploy_status_code: Deployment exited with non-zero status code: 2

Env files passed incorrectly: 
environments:
- path: environments/containers-default-parameters.yaml
- path: environments/docker-ha.yaml
- path: overcloud-resource-registry-puppet.yaml
- path: environments/docker.yaml



Expected results:
Deployment succeed

Environment files passed in correct order:
environments:
- path: overcloud-resource-registry-puppet.yaml
- path: environments/docker.yaml
- path: environments/containers-default-parameters.yaml
- path: environments/docker-ha.yaml


Additional info:
correct and incorrect plan env yamls with failures list attached


--- Additional comment from Jiri Tomasek on 2018-04-16 07:51:32 EDT ---

Fixing this requires update in tripleo-common.  UpdateCapabilities class [1] logic needs to be more robust. Currently, client passes a list of environments to enable/disable and the action updates environments list in plan-environment.yaml.

The order of environments matters but we want to shield user from having to provide the ordering as it requires in depth knowledge on the contents of environment files.

UpdateCapabilities action should calculate new environments list (as does now) and then traverse the capabilities-map.yaml and order the environment files by dependency rules defined in capabilities-map, so that parent environments are first and children environments override these parents.

[1] https://github.com/openstack/tripleo-common/blob/master/tripleo_common/actions/heat_capabilities.py#L142


--- Additional comment from Ryan Brady on 2018-05-24 08:07:13 EDT ---

Patch created to meet the requirements outlined in comment 2.  @jtomasek, can you review?