[Error: No valid host was found. There are not enough hosts available.].

asked 2015-12-18 18:31:09 -0600

medarz gravatar image

Hi,

I'm getting this error whenever I try to create a new instance. I tried different flavors but none works. I have also just added cinder service to my cloud cluster. Since then, I haven't been able to add new instances.

I see that cinder looks good:

mario@openstack01:/var/log/mysql$ cinder service-list
+------------------+-----------------+------+---------+-------+----------------------------+-----------------+
|      Binary      |       Host      | Zone |  Status | State |         Updated_at         | Disabled Reason |
+------------------+-----------------+------+---------+-------+----------------------------+-----------------+
| cinder-scheduler |   openstack01   | nova | enabled |   up  | 2015-12-19T00:26:30.000000 |        -        |
|  cinder-volume   | openstack04@lvm | nova | enabled |   up  | 2015-12-19T00:26:23.000000 |        -        |
+------------------+-----------------+------+---------+-------+----------------------------+-----------------+

However, I see the following errors in nova-api log:

    2015-12-18 18:12:42.743 5571 ERROR nova.api.openstack.extensions     2003, "Can't connect to MySQL server on %r (%s)" % (self.host, e))
2015-12-18 18:12:42.743 5571 ERROR nova.api.openstack.extensions DBConnectionError: (pymysql.err.OperationalError) (2003, "Can't connect to MySQL server on '14.191.111.10' ((1040, u'Too many connections'))") [SQL: u'SELECT 1']
2015-12-18 18:12:42.743 5571 ERROR nova.api.openstack.extensions 
2015-12-18 18:12:42.751 5571 INFO nova.api.openstack.wsgi [req-aea0c2db-49cb-4f31-9a35-6e0671cbdda3 fa9d7a0d30dd4beabf78b99414b9805f 16bbfc96308144a3960d0444ceae8729 - - -] HTTP exception thrown: Unexpected API Error. Please report this at http://bugs.launchpad.net/nova/ and attach the Nova API log if possible.
<class 'oslo_db.exception.DBConnectionError'>

Database is up and running:

mario@openstack01:/var/log/mysql$ sudo service mysql status
 * /usr/bin/mysqladmin  Ver 9.0 Distrib 5.5.46-MariaDB, for debian-linux-gnu on x86_64
Copyright (c) 2000, 2015, Oracle, MariaDB Corporation Ab and others.

Server version      5.5.46-MariaDB-1ubuntu0.14.04.2
Protocol version    10
Connection      Localhost via UNIX socket
UNIX socket     /var/run/mysqld/mysqld.sock
Uptime:         17 min 11 sec

Threads: 107  Questions: 7817  Slow queries: 0  Opens: 108  Flush tables: 2  Open tables: 134  Queries per second avg: 7.581

And I can add other stuff, such as networks or users.

Regards,

edit retag flag offensive close merge delete

2 answers

Sort by ยป oldest newest most voted
0

answered 2015-12-24 01:16:38 -0600

fnawaz gravatar image

updated 2015-12-24 01:16:51 -0600

since in logs the error was too many connections in db.. try modify the mysql configuration file my.cnf .... add the following "max_connections = 1000" in [mysqld] section ..

edit flag offensive delete link more
0

answered 2015-12-24 05:05:56 -0600

zekken gravatar image

Please check whether your database is populated for cinder.

<mysql>use cinder;
<mysql>show tables;

Now if you see the values it is populated, if its empty, repopulate it and check again.

edit flag offensive delete link more

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower

Stats

Asked: 2015-12-18 18:28:12 -0600

Seen: 800 times

Last updated: Dec 24 '15