Ask Your Question
0

Trove Error creating security group for instance(Newton)

asked 2016-12-09 08:41:06 -0500

yaoshenshen+1 gravatar image
**when i create database use "trove create mysql_instance_1 6 --size 5 --databases myDB     --users userA:password --datastore_version mysql-5.6     --datastore mysql"**

    my trove version is
     [root@control ~]# trove --version
    2.5.0

    my contronl  version is Centos7.2  

trove-taskmanager.log







    2016-12-09 22:22:38.473 5294 DEBUG oslo_messaging._drivers.amqpdriver [-] received message with unique_id: 6daa191c8e364f49a3e465206a4cd312 __call__ /usr/lib/python2.7/site-packages/oslo_messaging/_drivers/amqpdriver.py:196
    2016-12-09 22:22:38.509 5294 DEBUG trove.instance.models [-] Instance 9aa9c3a3-22e8-4225-8e7d-2626459abf99 service status is new. load_instance /usr/lib/python2.7/site-packages/trove/instance/models.py:526
    2016-12-09 22:22:38.517 5294 INFO trove.taskmanager.models [-] Creating instance 9aa9c3a3-22e8-4225-8e7d-2626459abf99.
    2016-12-09 22:22:38.647 5294 DEBUG trove.db.models [-] Saving SecurityGroup: {u'updated': datetime.datetime(2016, 12, 9, 14, 22, 38, 647132), '_sa_instance_state': <sqlalchemy.orm.state.InstanceState object at 0x40c3bd0>, u'description': u'Security Group for 9aa9c3a3-22e8-4225-8e7d-2626459abf99', u'created': datetime.datetime(2016, 12, 9, 14, 22, 38, 646961), u'deleted': False, u'tenant_id': u'3855a36ccf2e48be90bd63ac187977a9', 'errors': {}, u'user': u'0aeab4d682344a6b9a8c4ec17d6111db', u'id': u'3699be8b-3347-4f5c-8444-29fec138d21b', u'name': u'SecGroup_9aa9c3a3-22e8-4225-8e7d-2626459abf99'} save /usr/lib/python2.7/site-packages/trove/db/models.py:62
    2016-12-09 22:22:38.667 5294 DEBUG trove.db.models [-] Saving SecurityGroupInstanceAssociation: {u'updated': datetime.datetime(2016, 12, 9, 14, 22, 38, 667258), '_sa_instance_state': <sqlalchemy.orm.state.InstanceState object at 0x40c31d0>, u'created': datetime.datetime(2016, 12, 9, 14, 22, 38, 667141), u'deleted': False, u'security_group_id': u'3699be8b-3347-4f5c-8444-29fec138d21b', u'instance_id': u'9aa9c3a3-22e8-4225-8e7d-2626459abf99', 'errors': {}, u'id': 'b27591a1-6bd9-488c-a32a-d2996111b9d0'} save /usr/lib/python2.7/site-packages/trove/db/models.py:62
    2016-12-09 22:22:38.881 5294 DEBUG trove.db.models [-] Saving SecurityGroupRule: {u'updated': datetime.datetime(2016, 12, 9, 14, 22, 38, 881423), '_sa_instance_state': <sqlalchemy.orm.state.InstanceState object at 0x428ead0>, u'protocol': 'tcp', 'errors': {}, u'created': datetime.datetime(2016, 12, 9, 14, 22, 38, 881243), u'deleted': False, u'to_port': 3306, u'from_port': 3306, u'cidr': '0.0.0.0/0', u'group_id': u'3699be8b-3347-4f5c-8444-29fec138d21b', u'id': u'9a57180a-2813-4051-b6be-ec3a2f2662e2'} save /usr/lib/python2.7/site-packages/trove/db/models.py:62
    2016-12-09 22:22:38.901 5294 ERROR trove.taskmanager.models [-] Error creating security group for instance: 9aa9c3a3-22e8-4225-8e7d-2626459abf99
    From port must be an integer.
    Traceback (most recent call last):
      File "/usr/lib/python2.7/site-packages/trove/taskmanager/models.py", line 388, in create_instance
        security_groups = self._create_secgroup(datastore_manager)
      File "/usr/lib/python2.7/site-packages/trove/taskmanager/models.py", line 1015, in _create_secgroup
        self._create_rules(security_group, None, 'icmp')
      File "/usr/lib/python2.7/site-packages/trove/taskmanager/models.py", line 1036, in _create_rules
        cidr, self.context)
      File "/usr/lib/python2.7/site-packages/trove/extensions/security_group/models.py", line 151, in create_sec_group_rule
        context=context)
      File "/usr/lib/python2.7/site-packages/trove/extensions/security_group/models.py", line 243, in add_rule
        sec_group_id, protocol, from_port, to_port, cidr)
      File "/usr/lib/python2.7/site-packages/trove/network/nova.py", line 68, in add_security_group_rule
        cidr=cidr)
      File "/usr/lib/python2.7/site-packages/novaclient/api_versions.py", line 443, in wrapped
        return decorated(*a, **k)
      File "/usr/lib/python2.7/site-packages/novaclient/api_versions.py", line 402, in substitution ...
(more)
edit retag flag offensive close merge delete

3 answers

Sort by » oldest newest most voted
0

answered 2016-12-09 08:31:57 -0500

yaoshenshen+1 gravatar image

updated 2016-12-13 00:42:24 -0500

        The trove show mysql_instance_1   output:
+-------------------+--------------------------------------+
[root@control ~]# trove show mysql_instance_1
+-------------------+-------------------------------------------------------------------------------------------------------+
| Property          | Value                                                                                                 |
+-------------------+-------------------------------------------------------------------------------------------------------+
| created           | 2016-12-13T06:40:40                                                                                   |
| datastore         | mysql                                                                                                 |
| datastore_version | mysql-5.6                                                                                             |
| fault             | Error creating security group for instance:                                                           |
|                   |     c4fee7b7-26bc-4146-af8b-04608b32a47c                                                              |
|                   | From port must be an integer.                                                                         |
| fault_date        | 2016-12-13T06:40:41                                                                                   |
| fault_details     | Server type: taskmanager                                                                              |
|                   | Traceback (most recent call last):                                                                    |
|                   |   File "/usr/lib/python2.7/site-packages/trove/taskmanager/manager.py", line 386, in create_instance  |
|                   |     locality)                                                                                         |
|                   |   File "/usr/lib/python2.7/site-packages/trove/taskmanager/manager.py", line 366, in _create_instance |
|                   |     scheduler_hints)                                                                                  |
|                   |   File "/usr/lib/python2.7/site-packages/trove/taskmanager/models.py", line 393, in create_instance   |
|                   |     self._log_and_raise(e, msg, err)                                                                  |
|                   |   File "/usr/lib/python2.7/site-packages/trove/taskmanager/models.py", line 861, in _log_and_raise    |
|                   |     raise TroveError(message=full_message)                                                            |
|                   | TroveError:                                                                                           |
|                   |     Error creating security group for instance:                                                       |
|                   |     c4fee7b7-26bc-4146-af8b-04608b32a47c                                                              |
|                   | From port must be an integer.                                                                         |
|                   |                                                                                                       |
| flavor            | 6                                                                                                     |
| id                | c4fee7b7-26bc-4146-af8b-04608b32a47c                                                                  |
| name              | mysql_instance_1                                                                                      |
| status            | ERROR                                                                                                 |
| updated           | 2016-12-13T06:40:41                                                                                   |
| volume            | 5                                                                                                     |
+-------------------+-------------------------------------------------------------------------------------------------------+
[root@control ~]#
edit flag offensive delete link more
0

answered 2016-12-12 22:49:26 -0500

Lili Zhang gravatar image

updated 2016-12-12 22:50:18 -0500

Based on the log, the error message is "From port must be an integer". So the error points to "From port". When taking a a close look at the Traceback message, we can find that "from port" is passed to Nova by the function add_rule in the following script.

https://github.com/openstack/trove/blob/stable/liberty/trove/extensions/security_group/models.py

How about adding an LOG.info or LOG.debug to output the value of "from_port" in the above script and manually examine what it is currently?

edit flag offensive delete link more

Comments

Thanks very much,i will try adding an LOG.info

yaoshenshen+1 gravatar imageyaoshenshen+1 ( 2016-12-12 23:19:11 -0500 )edit

in /usr/lib/python2.7/site-packages/trove/extensions/security_group/models.py I insert LOG.info,but print from_port is NULL.

yaoshenshen+1 gravatar imageyaoshenshen+1 ( 2016-12-12 23:58:41 -0500 )edit

I insert log it is 149 to_port=to_port, 150 cidr=cidr, 151 context=context) 152 print from_port 153 f = open('/tmp/aaaaa', 'w') 154 f.write(from_port) 155 f.write(id,protocol,from_port,to_port,cidr,contex

yaoshenshen+1 gravatar imageyaoshenshen+1 ( 2016-12-13 00:28:47 -0500 )edit

The NULL value of from_port means there is a misconfiguraiton in trove-taskmanager.conf, because ports are read from it. See the first 3 Traceback messages.

To correct it, make sure that tcp_ports are not commented out in trove-taskmanager.conf, along with udp_ports if any.

Lili Zhang gravatar imageLili Zhang ( 2016-12-16 14:35:44 -0500 )edit

And also double check the values of tcp_ports and udp_ports in the trove taskmanager log file. For example, if you are using Vertica on your guest database image, ports values are like below. tcp_ports = 5433, 5434, 22, 5444, 5450, 4803 udp_ports = 5433, 4803, 4804, 6453

Lili Zhang gravatar imageLili Zhang ( 2016-12-16 14:40:14 -0500 )edit
0

answered 2017-03-10 08:04:43 -0500

tnowak gravatar image

It fails on self._create_rules(security_group, None, 'icmp'). To fix it just comment out ICMP in /etc/trove/trove-taskmanager.conf:

[mysql]
# Whether to permit ICMP. default is False.
# icmp = True
edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower

Stats

Asked: 2016-12-09 08:27:58 -0500

Seen: 455 times

Last updated: Mar 10 '17