Bug 1637972

Summary: [OSP14] use nova_api DB for [placement_database] -> connection setting instead of separate DB
Product: Red Hat OpenStack Reporter: Martin Schuppert <mschuppe>
Component: openstack-tripleo-heat-templatesAssignee: Martin Schuppert <mschuppe>
Status: CLOSED ERRATA QA Contact: Gurenko Alex <agurenko>
Severity: urgent Docs Contact:
Priority: urgent    
Version: 14.0 (Rocky)CC: egallen, jhakimra, mburns, mschuppe
Target Milestone: rcKeywords: Triaged
Target Release: 14.0 (Rocky)   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: openstack-tripleo-heat-templates-9.0.1-0.20181013060863.ffbe879.el7ost Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-01-11 11:53:52 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 Martin Schuppert 2018-10-10 12:34:01 UTC
Description of problem:

With OOO/Director we configure a separate DB for placement for the undercloud and overcloud since the beginning.

But the placement_database config options were reverted with [1], which means so far even if 
we have the config set it was not used. 

Now with rocky/OSP14 we have the options again:

()[root@controller-0 db]# grep placement_db_group /usr/lib/python2.7/site-packages/nova/conf/database.py
placement_db_group = cfg.OptGroup('placement_database',
    conf.register_opts(placement_db_opts, group=placement_db_group)
        placement_db_group: placement_db_opts,
and therefore its being used:
(undercloud) [stack@undercloud-0 ~]$ sudo mysql -u root nova_placement -e "select * from inventories limit 1\G;"
*************************** 1. row ***************************
          created_at: 2018-09-19 09:59:03
          updated_at: 2018-09-19 10:05:10
                  id: 1
resource_provider_id: 1
   resource_class_id: 0
               total: 8
            reserved: 0
            min_unit: 1
            max_unit: 8
           step_size: 1
    allocation_ratio: 1

which is not a problem on a fresh installed OSP14 env, but on upgrades from OSP13 to 14


We should use the same DB for both fresh deployments on and upgrades to OSP 14 before we switch to the new DB in 15 as part of the extraction of placement. 


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

How reproducible:
always

Steps to Reproduce:
1. deploy undercloud/overcloud


Actual results:
-> separate placement db

Expected results:
-> nova_api db is used for placement

Additional info:

[1] https://review.openstack.org/#/c/442762/1

Comment 6 Joe H. Rahme 2018-11-23 15:30:16 UTC
Verified on the beta puddle that tripleo configured both placement db and api db as the same mysql db:


(undercloud) [stack@undercloud-0 ~]$ sudo crudini --get /var/lib/config-data/puppet-generated/nova_placement/etc/nova/nova.conf api_database connection                      
mysql+pymysql://nova_api:XsC6yR5dwP7mmoHrAuRaKZYhW.24.3/nova_api?read_default_group=tripleo&read_default_file=/etc/my.cnf.d/tripleo.cnf

(undercloud) [stack@undercloud-0 ~]$ sudo crudini --get /var/lib/config-data/puppet-generated/nova_placement/etc/nova/nova.conf placement_database connection
mysql+pymysql://nova_api:XsC6yR5dwP7mmoHrAuRaKZYhW.24.3/nova_api?read_default_group=tripleo&read_default_file=/etc/my.cnf.d/tripleo.cnf

Comment 9 errata-xmlrpc 2019-01-11 11:53:52 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://access.redhat.com/errata/RHEA-2019:0045