Bug 890175 - Openstack Installer: using packstack, mysql installation should be optional.
Summary: Openstack Installer: using packstack, mysql installation should be optional.
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat OpenStack
Classification: Red Hat
Component: openstack-packstack
Version: 2.0 (Folsom)
Hardware: Unspecified
OS: Linux
medium
high
Target Milestone: beta
: 4.0
Assignee: Martin Magr
QA Contact: Nir Magnezi
URL:
Whiteboard:
Depends On:
Blocks: 890183 984878
TreeView+ depends on / blocked
 
Reported: 2012-12-25 14:10 UTC by Nir Magnezi
Modified: 2016-04-26 22:37 UTC (History)
7 users (show)

Fixed In Version: openstack-packstack-2013.2.1-0.5.dev740.el6ost
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 984878 (view as bug list)
Environment:
Last Closed: 2013-12-19 23:54:02 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
packstack answer file --> mysql only (13.71 KB, text/plain)
2013-11-14 17:35 UTC, Nir Magnezi
no flags Details
packstack answer file --> all openstack services without mysql (13.71 KB, text/plain)
2013-11-14 17:36 UTC, Nir Magnezi
no flags Details
packstack logs (DEBUG) --> resulted from 2.txt (42.56 KB, text/x-log)
2013-11-14 17:37 UTC, Nir Magnezi
no flags Details


Links
System ID Private Priority Status Summary Last Updated
OpenStack gerrit 27480 0 None None None Never
Red Hat Product Errata RHEA-2013:1859 0 normal SHIPPED_LIVE Red Hat Enterprise Linux OpenStack Platform Enhancement Advisory 2013-12-21 00:01:48 UTC

Description Nir Magnezi 2012-12-25 14:10:40 UTC
Description of problem:
=======================
packstack should ask the user whether if he would like to install mysql or not.
At the moment, There is no option for a user to install openstack using packstack with a given remote DB IP address, And prevent from packstack to install mysql.
This creates an issue when a user already have an installed DB, specifically a cluster of mysql DBs.
using packstack in such scenario will break the cluster (consulted with derekh about this one).

To conclude this:
On one hand, packstack is capable of installing a single mysql db node, which is ok for some cases.
On the other hand, packstack doesn't handle mysql cluster installation (and it shouldn't), but it should allow users to set up mysql cluster by their own and work with it.

The mysql install yes/no option should be added to the answers file as well.
In case the user choose 'no', packstack should ask the user for credentials and use CONFIG_MYSQL_HOST as a given remote DB.


Version-Release number of selected component (if applicable):
=============================================================
openstack-packstack-2012.2.2-0.1.dev262.el6.noarch


Steps to Reproduce:
===================
1.
2.
3.
 
Actual results:
===============

Expected results:
=================

Comment 4 Martin Magr 2013-04-25 11:47:07 UTC
Current solution set's nova and keystone config on host where packstack is running. Can be changed only if bug #956596 and bug #956597 will be implemented. Code for it is already implemented, but commented for now.

Comment 5 Derek Higgins 2013-04-25 14:53:40 UTC
(In reply to comment #4)
> Current solution set's nova and keystone config on host where packstack is
> running. Can be changed only if bug #956596 and bug #956597 will be
> implemented. Code for it is already implemented, but commented for now.

Can this not be done without the --sql_connection options by making sure the sql config is written to the *conf file before running db_sync ?

Comment 6 Martin Magr 2013-04-25 15:05:15 UTC
Yes this is exactly how it is now implemented. I just stated that we won't have to use config files as soon as those RFEs will be implemented. Solution is implemented in Packstack for that and the only thing needed is just uncomment it when RFEs are also implemented.

Comment 7 Derek Higgins 2013-04-25 16:09:24 UTC
ok, thanks, i misread comment 4.

Comment 8 Martin Magr 2013-05-02 13:24:37 UTC
Had to change also Cinder and Glance to use sql_connection from config files, since it seems CLI parameters are ignored even though cinder-manage and glance-manage accept it (I've reported this issue in bug #958782 and bug #958725).

Comment 10 Nir Magnezi 2013-11-14 17:19:47 UTC
Martin,

I tried to verify this fix as follows:

1. Used packstack only to install mysql server (see attached answer file 1.txt)
2. Used packstack to install all other openstack services WITHOUT mysql server (see attached answer file 2.txt)

This resulted an error:

ERROR : Error appeared during Puppet run: <IP_ADDRESS>_mysql.pp
Error: Execution of '/usr/bin/mysql --host=<IP_ADDRESS> --user=root --password=123456 -NBe create database `cinder` character set latin1' returned 1: ERROR 1045 (28000): Access denied for user 'root'@'cougar11.scl.lab.tlv.redhat.com' (using password: YES)
You will find full trace in log /var/tmp/packstack/20131114-184326-Du2ViM/manifests/<IP_ADDRESS>_mysql.pp.log

I will attached both answer files and packstack log in the following comments.
Please let me know if there is anything I did wrong, you I should just re-open the bug.

Comment 11 Nir Magnezi 2013-11-14 17:35:32 UTC
Created attachment 824077 [details]
packstack answer file --> mysql only

Comment 12 Nir Magnezi 2013-11-14 17:36:42 UTC
Created attachment 824079 [details]
packstack answer file --> all openstack services without mysql

Comment 13 Nir Magnezi 2013-11-14 17:37:23 UTC
Created attachment 824080 [details]
packstack logs (DEBUG) --> resulted from 2.txt

Comment 14 Martin Magr 2013-11-18 14:06:19 UTC
Below error is telling you that you weren't able to connect to DB running on <IP_ADDRESS> from machine where you were running packstack:
Error: Execution of '/usr/bin/mysql --host=<IP_ADDRESS> --user=root --password=123456 -NBe create database `cinder` character set latin1' returned 1: ERROR 1045 (28000): Access denied for user 'root'@'cougar11.scl.lab.tlv.redhat.com' (using password: YES)

Thinking about this. When you first installed only MySQL the installation used user root using local connection. Local root without password is by default created in MySQL. So what I would do is following:

sudo mysql
select user, host, password from mysql.user;
>> here check how many root users you have here, ideally there would be one with '%' as host and some hash as password, if not continue <<
delete from mysql.user where user='root' and host in ('localhost', 'whatever else which is not %');
set password for 'root'@'%' = PASSWORD('some password');
flush privileges;

Now you have DB set to so that root user can connect from whatever machine and now repeat your step 2.

Comment 15 Nir Magnezi 2013-12-01 11:45:25 UTC
Verified NVR: openstack-packstack-2013.2.1-0.11.dev847.el6ost.noarch

Followed your instructions (Comment #14):
===========================
1.ran packstack with an answer file, installed mysql ONLY. CONFIG_MYSQL_PW=123456
2. Modified mysql users table:
 
mysql> select user, host, password from mysql.user;
+----------------+-----------+-------------------------------------------+
| user           | host      | password                                  |
+----------------+-----------+-------------------------------------------+
| root           | localhost | *6BB4837EB74329105EE4568DDA7DC67ED2CA2AD9 |
| keystone_admin | 127.0.0.1 | *4185D59CCE34C21D1E125D64131D3FBD7712572F |
| keystone_admin | %         | *4185D59CCE34C21D1E125D64131D3FBD7712572F |
+----------------+-----------+-------------------------------------------+

mysql> UPDATE mysql.user SET host='%'  WHERE user='root';
Query OK, 1 row affected (0.00 sec)
Rows matched: 1  Changed: 1  Warnings: 0

mysql> select user, host, password from mysql.user;
+----------------+-----------+-------------------------------------------+
| user           | host      | password                                  |
+----------------+-----------+-------------------------------------------+
| root           | %         | *6BB4837EB74329105EE4568DDA7DC67ED2CA2AD9 |
| keystone_admin | 127.0.0.1 | *4185D59CCE34C21D1E125D64131D3FBD7712572F |
| keystone_admin | %         | *4185D59CCE34C21D1E125D64131D3FBD7712572F |
+----------------+-----------+-------------------------------------------+
3 rows in set (0.00 sec)

mysql> UPDATE mysql.user SET Password = PASSWORD("123456") WHERE User="root";
Query OK, 0 rows affected (0.00 sec)

> **The line you provided for changing the root password did not work here.

mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)

mysql> exit
Bye

3. Ran packstack to install all services without mysql.


Result:
=======
1. Installation ended successfully.

2. services databases were created.

mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| cinder             |
| glance             |
| heat               |
| keystone           |
| mysql              |
| nova               |
| ovs_neutron        |
| test               |
+--------------------+
9 rows in set (0.00 sec)

Verified that all databases contains tables.

Comment 18 errata-xmlrpc 2013-12-19 23:54:02 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.

http://rhn.redhat.com/errata/RHEA-2013-1859.html


Note You need to log in before you can comment on or make changes to this bug.