Bug 1390522

Summary: Custom hieradata doesn't get applied on custom role config file
Product: Red Hat OpenStack Reporter: Marius Cornea <mcornea>
Component: openstack-tripleo-heat-templatesAssignee: Steven Hardy <shardy>
Status: CLOSED ERRATA QA Contact: Marius Cornea <mcornea>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 10.0 (Newton)CC: dbecker, jcoufal, jschluet, jslagle, mburns, morazi, rhel-osp-director-maint, shardy
Target Milestone: rcKeywords: Triaged
Target Release: 10.0 (Newton)   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: openstack-tripleo-heat-templates-5.0.0-1.4.el7ost Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-12-14 16:27: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:

Description Marius Cornea 2016-11-01 09:57:16 UTC
Description of problem:
I'm trying to specify custom hieradata for a custom role but it does't seem that it gets applied:

Deploy command:
source ~/stackrc
export THT=/usr/share/openstack-tripleo-heat-templates/

openstack overcloud deploy --templates $THT \
-r ~/openstack_deployment/roles/roles_data.yaml \
-e $THT/environments/network-isolation.yaml \
-e $THT/environments/network-management.yaml \
-e $THT/environments/storage-environment.yaml \
-e ~/openstack_deployment/environments/nodes.yaml \
-e ~/openstack_deployment/environments/network-environment.yaml \
-e ~/openstack_deployment/environments/disk-layout.yaml \
-e ~/openstack_deployment/environments/wipe-disk-env.yaml \
-e ~/openstack_deployment/environments/neutron-settings.yaml \
-e ~/openstack_deployment/environments/custom_nova.yaml \
--log-file overcloud_deployment.log &> overcloud_install.log

The custom role is called ServiceApi and it's running the Openstack API services:
http://paste.openstack.org/show/587524/

The custom hieradata environment file:
cat openstack_deployment/environments/custom_nova.yaml 
parameter_defaults:
  ServiceApiExtraConfig:
    'nova::scheduler::filter::ram_allocation_ratio': '2.5'

The hierdata seems to get passed to the custom role nodes but it doesn't get applied to the nova.conf file:

[root@overcloud-serviceapi-0 ~]# hiera nova::scheduler::filter::ram_allocation_ratio
2.5

[root@overcloud-serviceapi-0 ~]# grep ram_allocation_ratio /etc/nova/nova.conf; echo $?
1

Version-Release number of selected component (if applicable):
openstack-tripleo-heat-templates-5.0.0-0.9.0rc3.el7ost.noarch

How reproducible:
100%

Steps to Reproduce:
1. Deploy overcloud with custom hieradata for custom role
2. Check if the configuration gets adjusted

Actual results:
The configuration file doesn't contain the change passed via the environment file.

Expected results:
The custom hieradata should be reflected in the configuration file.  

Additional info:

Comment 1 Steven Hardy 2016-11-01 11:09:50 UTC
I think think may be broken for all roles, because puppet-nova moved this interface:

https://github.com/openstack/puppet-nova/blob/master/manifests/init.pp#L410

https://github.com/openstack/puppet-nova/blob/master/manifests/init.pp#L410

So think we need to update tripleo-heat-templates to use this new interface, and any ExtraConfig overrides will need a different key, e.g:

cat openstack_deployment/environments/custom_nova.yaml 
parameter_defaults:
  ServiceApiExtraConfig:
    'nova::ram_allocation_ratio': '2.5'

Comment 2 Steven Hardy 2016-11-01 11:12:16 UTC
Sorry first link above should be:

https://github.com/openstack/puppet-nova/blob/stable/newton/manifests/scheduler/filter.pp#L133

Comment 3 Steven Hardy 2016-11-01 11:17:23 UTC
Upstream bug raised to align t-h-t with the new interface:

https://bugs.launchpad.net/tripleo/+bug/1638254

Patch posted:

https://review.openstack.org/392108

Comment 4 Steven Hardy 2016-11-01 11:19:01 UTC
Provided Marius can confirm the nova::ram_allocation_ratio syntax above works, then I don't think this is a blocker, reduced the severity to medium.

Comment 5 Marius Cornea 2016-11-01 11:45:11 UTC
Thanks, Steve. Using the following worked fine:

parameter_defaults:
  ServiceApiExtraConfig:
    'nova::ram_allocation_ratio': '2.5'


[root@overcloud-serviceapi-0 ~]# grep ram_allocation_ratio /etc/nova/nova.conf; echo $?
ram_allocation_ratio=2.5
0

Comment 6 James Slagle 2016-11-01 15:09:48 UTC
moving to ON_DEV as a patch has been posted upstream

Comment 8 Marius Cornea 2016-11-10 17:20:58 UTC
openstack-tripleo-heat-templates-5.0.0-1.5.el7ost.noarch

Comment 10 errata-xmlrpc 2016-12-14 16:27: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, 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://rhn.redhat.com/errata/RHEA-2016-2948.html