Public bug reported:

Description
===========
The behaviors of creating and updating cell0 differ. Given that the parameters 
to nova-manage did not change, I would have expected no changes made to the 
cell_mappings table other than updating updated_at.

Steps to reproduce
==================
NOTE: Be sure to replace <MUST_BE_A_VALID_NOVA_API_DB_CONNECTION_STRING> in 
api.conf with a valid db connection string.
OPTIONAL NOTE: In order to restart nova-api and run "nova service-list" 
successfully, replace 
"mysql+pymysql://nova:novapwd@vip/nova?ssl_ca=/etc/ssl/ca-bundle.pem" in 
api.conf with a valid db connection string.

controller1:~ # mkdir -p /etc/novabug
controller1:~ # cat << EOF > /etc/novabug/api.conf
[database]
backend = sqlalchemy
connection = mysql+pymysql://nova:novapwd@vip/nova?ssl_ca=/etc/ssl/ca-bundle.pem
[api_database]
connection = <MUST_BE_A_VALID_NOVA_API_DB_CONNECTION_STRING>
EOF
controller1:~ # cat << EOF > /etc/novabug/nova.conf
[DEFAULT]
transport_url = rabbit://rabbit:rabbitpwd@vip:5671/
EOF
controller1:~ # chown -R nova:nova /etc/novabug
controller1:~ # /usr/local/bin/nova-manage --config-file /etc/novabug/nova.conf 
--config-file /etc/novabug/api.conf cell_v2 map_cell0
controller1:~ # mysql -D nova_api -e "select * from cell_mappings"
+---------------------+---------------------+----+--------------------------------------+-------+------------------------------------------------------------+----------------------------------------------------------------------------------------------------------+
| created_at          | updated_at          | id | uuid                         
        | name  | transport_url                                              | 
database_connection                                                             
                         |
+---------------------+---------------------+----+--------------------------------------+-------+------------------------------------------------------------+----------------------------------------------------------------------------------------------------------+
| 2018-09-26 09:14:21 | NULL                |  1 | 
00000000-0000-0000-0000-000000000000 | cell0 | none:///                         
                          | 
mysql+pymysql://nova:novapwd@vip/nova_cell0?ssl_ca=/etc/ssl/ca-bundle.pem       
                         |
+---------------------+---------------------+----+--------------------------------------+-------+------------------------------------------------------------+----------------------------------------------------------------------------------------------------------+

controller1:~ # /usr/local/bin/nova-manage --config-file /etc/novabug/nova.conf 
--config-file /etc/novabug/api.conf cell_v2 update_cell --cell_uuid 
00000000-0000-0000-0000-000000000000
controller1:~ # mysql -D nova_api -e "select * from cell_mappings"
+---------------------+---------------------+----+--------------------------------------+-------+------------------------------------------------------------+----------------------------------------------------------------------------------------------------+
| created_at          | updated_at          | id | uuid                         
        | name  | transport_url                                              | 
database_connection                                                             
                   |
+---------------------+---------------------+----+--------------------------------------+-------+------------------------------------------------------------+----------------------------------------------------------------------------------------------------+
| 2018-09-26 09:14:21 | 2018-09-26 09:15:01 |  1 | 
00000000-0000-0000-0000-000000000000 | cell0 | 
rabbit://rabbit:rabbitpwd@vip:5671/                        | 
mysql+pymysql://nova:novapwd@vip/nova?ssl_ca=/etc/ssl/ca-bundle.pem             
                   |
+---------------------+---------------------+----+--------------------------------------+-------+------------------------------------------------------------+----------------------------------------------------------------------------------------------------+

Expected result
===============
Given that the parameters to nova-manage did not change, I would have expected 
no changes made to the transport_url and database_connection values of cell0.

Actual result
=============
After running "cell_v2 update_cell --cell_uuid 
00000000-0000-0000-0000-000000000000", the transport_url changed from the 
hardcoded "none:///" from CellV2Commands.map_cell0() to the actual transport 
URL from nova.conf and the database_connection value lost it's string "_cell0" 
previously added by the nested function 
CellV2Commands.map_cell0().cell0_default_connection(). These changes cause 
ripple effects like the duplication of all rows in the output of "nova 
service-list" [as well as in Horizon]. See below.

controller1:~ # service nova-api restart
controller1:~ # nova service-list
+----+------------------+----------------+----------+---------+-------+----------------------------+-----------------+
| Id | Binary           | Host           | Zone     | Status  | State | 
Updated_at                 | Disabled Reason |
+----+------------------+----------------+----------+---------+-------+----------------------------+-----------------+
| 1  | nova-conductor   | controller1    | internal | enabled | up    | 
2018-09-26T09:19:13.000000 | -               |
| 2  | nova-scheduler   | controller1    | internal | enabled | up    | 
2018-09-26T09:19:05.000000 | -               |
| 3  | nova-consoleauth | controller1    | internal | enabled | up    | 
2018-09-26T09:19:07.000000 | -               |
| 6  | nova-compute     | compute001     | nova     | enabled | up    | 
2018-09-26T09:19:09.000000 | -               |
| 1  | nova-conductor   | controller1    | internal | enabled | up    | 
2018-09-26T09:19:13.000000 | -               |
| 2  | nova-scheduler   | controller1    | internal | enabled | up    | 
2018-09-26T09:19:05.000000 | -               |
| 3  | nova-consoleauth | controller1    | internal | enabled | up    | 
2018-09-26T09:19:07.000000 | -               |
| 6  | nova-compute     | compute001     | nova     | enabled | up    | 
2018-09-26T09:19:09.000000 | -               |
+----+------------------+----------------+----------+---------+-------+----------------------------+-----------------+

Environment
===========
Version: Current master branch

Workaround
==========
We are having to avoid using the --config-file parameters altogether and 
duplicate the cell0 logic from nova/cmd/manage.py in our own scripts by:
1) For "cell_v2 map_cell0", specifying --database_connection containing "_cell0"
2) For "cell_v2 update_cell" of cell0, specifying --database_connection 
containing "_cell0" and --transport-url of "none:///"
3) For creating or updating cell1, specifying --database_connection not 
containing "_cell0" and the actual --transport-url

** Affects: nova
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Compute (nova).
https://bugs.launchpad.net/bugs/1794493

Title:
  The behaviors of creating and updating mapping cell0 differ

Status in OpenStack Compute (nova):
  New

Bug description:
  Description
  ===========
  The behaviors of creating and updating cell0 differ. Given that the 
parameters to nova-manage did not change, I would have expected no changes made 
to the cell_mappings table other than updating updated_at.

  Steps to reproduce
  ==================
  NOTE: Be sure to replace <MUST_BE_A_VALID_NOVA_API_DB_CONNECTION_STRING> in 
api.conf with a valid db connection string.
  OPTIONAL NOTE: In order to restart nova-api and run "nova service-list" 
successfully, replace 
"mysql+pymysql://nova:novapwd@vip/nova?ssl_ca=/etc/ssl/ca-bundle.pem" in 
api.conf with a valid db connection string.

  controller1:~ # mkdir -p /etc/novabug
  controller1:~ # cat << EOF > /etc/novabug/api.conf
  [database]
  backend = sqlalchemy
  connection = 
mysql+pymysql://nova:novapwd@vip/nova?ssl_ca=/etc/ssl/ca-bundle.pem
  [api_database]
  connection = <MUST_BE_A_VALID_NOVA_API_DB_CONNECTION_STRING>
  EOF
  controller1:~ # cat << EOF > /etc/novabug/nova.conf
  [DEFAULT]
  transport_url = rabbit://rabbit:rabbitpwd@vip:5671/
  EOF
  controller1:~ # chown -R nova:nova /etc/novabug
  controller1:~ # /usr/local/bin/nova-manage --config-file 
/etc/novabug/nova.conf --config-file /etc/novabug/api.conf cell_v2 map_cell0
  controller1:~ # mysql -D nova_api -e "select * from cell_mappings"
  
+---------------------+---------------------+----+--------------------------------------+-------+------------------------------------------------------------+----------------------------------------------------------------------------------------------------------+
  | created_at          | updated_at          | id | uuid                       
          | name  | transport_url                                              
| database_connection                                                           
                           |
  
+---------------------+---------------------+----+--------------------------------------+-------+------------------------------------------------------------+----------------------------------------------------------------------------------------------------------+
  | 2018-09-26 09:14:21 | NULL                |  1 | 
00000000-0000-0000-0000-000000000000 | cell0 | none:///                         
                          | 
mysql+pymysql://nova:novapwd@vip/nova_cell0?ssl_ca=/etc/ssl/ca-bundle.pem       
                         |
  
+---------------------+---------------------+----+--------------------------------------+-------+------------------------------------------------------------+----------------------------------------------------------------------------------------------------------+

  controller1:~ # /usr/local/bin/nova-manage --config-file 
/etc/novabug/nova.conf --config-file /etc/novabug/api.conf cell_v2 update_cell 
--cell_uuid 00000000-0000-0000-0000-000000000000
  controller1:~ # mysql -D nova_api -e "select * from cell_mappings"
  
+---------------------+---------------------+----+--------------------------------------+-------+------------------------------------------------------------+----------------------------------------------------------------------------------------------------+
  | created_at          | updated_at          | id | uuid                       
          | name  | transport_url                                              
| database_connection                                                           
                     |
  
+---------------------+---------------------+----+--------------------------------------+-------+------------------------------------------------------------+----------------------------------------------------------------------------------------------------+
  | 2018-09-26 09:14:21 | 2018-09-26 09:15:01 |  1 | 
00000000-0000-0000-0000-000000000000 | cell0 | 
rabbit://rabbit:rabbitpwd@vip:5671/                        | 
mysql+pymysql://nova:novapwd@vip/nova?ssl_ca=/etc/ssl/ca-bundle.pem             
                   |
  
+---------------------+---------------------+----+--------------------------------------+-------+------------------------------------------------------------+----------------------------------------------------------------------------------------------------+

  Expected result
  ===============
  Given that the parameters to nova-manage did not change, I would have 
expected no changes made to the transport_url and database_connection values of 
cell0.

  Actual result
  =============
  After running "cell_v2 update_cell --cell_uuid 
00000000-0000-0000-0000-000000000000", the transport_url changed from the 
hardcoded "none:///" from CellV2Commands.map_cell0() to the actual transport 
URL from nova.conf and the database_connection value lost it's string "_cell0" 
previously added by the nested function 
CellV2Commands.map_cell0().cell0_default_connection(). These changes cause 
ripple effects like the duplication of all rows in the output of "nova 
service-list" [as well as in Horizon]. See below.

  controller1:~ # service nova-api restart
  controller1:~ # nova service-list
  
+----+------------------+----------------+----------+---------+-------+----------------------------+-----------------+
  | Id | Binary           | Host           | Zone     | Status  | State | 
Updated_at                 | Disabled Reason |
  
+----+------------------+----------------+----------+---------+-------+----------------------------+-----------------+
  | 1  | nova-conductor   | controller1    | internal | enabled | up    | 
2018-09-26T09:19:13.000000 | -               |
  | 2  | nova-scheduler   | controller1    | internal | enabled | up    | 
2018-09-26T09:19:05.000000 | -               |
  | 3  | nova-consoleauth | controller1    | internal | enabled | up    | 
2018-09-26T09:19:07.000000 | -               |
  | 6  | nova-compute     | compute001     | nova     | enabled | up    | 
2018-09-26T09:19:09.000000 | -               |
  | 1  | nova-conductor   | controller1    | internal | enabled | up    | 
2018-09-26T09:19:13.000000 | -               |
  | 2  | nova-scheduler   | controller1    | internal | enabled | up    | 
2018-09-26T09:19:05.000000 | -               |
  | 3  | nova-consoleauth | controller1    | internal | enabled | up    | 
2018-09-26T09:19:07.000000 | -               |
  | 6  | nova-compute     | compute001     | nova     | enabled | up    | 
2018-09-26T09:19:09.000000 | -               |
  
+----+------------------+----------------+----------+---------+-------+----------------------------+-----------------+

  Environment
  ===========
  Version: Current master branch

  Workaround
  ==========
  We are having to avoid using the --config-file parameters altogether and 
duplicate the cell0 logic from nova/cmd/manage.py in our own scripts by:
  1) For "cell_v2 map_cell0", specifying --database_connection containing 
"_cell0"
  2) For "cell_v2 update_cell" of cell0, specifying --database_connection 
containing "_cell0" and --transport-url of "none:///"
  3) For creating or updating cell1, specifying --database_connection not 
containing "_cell0" and the actual --transport-url

To manage notifications about this bug go to:
https://bugs.launchpad.net/nova/+bug/1794493/+subscriptions

-- 
Mailing list: https://launchpad.net/~yahoo-eng-team
Post to     : yahoo-eng-team@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yahoo-eng-team
More help   : https://help.launchpad.net/ListHelp

Reply via email to