network-ovn can't identify the domain name used to instead of ip_addresses

Bug #1753471 reported by Lu lei
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
networking-ovn
New
Undecided
Unassigned

Bug Description

Environment:
  CentOS7,4 CPU, 8g RAM

Problem Description:
  When I try to containerized ovn and neutron-server, I need to make all service of ovn(eg: ovnnb-db,ovnsb-db) and neutron-server as pods. Here neutron-server as pod includes networking-ovn. I
know networking-ovn needs configuration to connect ovnnb-db and ovnsb-db as follow:
  [ovn]
  ...
  ovn_nb_connection = tcp:IP_ADDRESS:6641
  ovn_sb_connection = tcp:IP_ADDRESS:6642

  And in /networking/common/config.py file,we can get this:
==============
ovn_opts = [
    cfg.StrOpt('ovsdb_connection', deprecated_for_removal=True,
               default='tcp:127.0.0.1:6640',
               help=_('The connection string for the native OVSDB backend.'
                      'This option is going to be deprecated and be replaced'
                      'by option ovn_nb_connection.')),
    cfg.StrOpt('ovn_nb_connection',
               deprecated_name='ovsdb_connection',
               default='tcp:127.0.0.1:6641',
               help=_('The connection string for the OVN_Northbound OVSDB')),
    cfg.StrOpt('ovn_sb_connection',
               default='tcp:127.0.0.1:6642',
               help=_('The connection string for the OVN_Southbound OVSDB')),
===============

  But in k8s environment, All ip will be known when all ovn pods are running. We should get configuration ips when ovn pods are running. And then puts neutron-server pod up. So we need to use domain name likes ovn-nb-db.openstack.svc.cluster.local:port instead of ip:port are more reasonable. But when I try to do this will get some errors as follows:
===============
2018-03-05 11:18:04.768 15 ERROR networking_ovn.ovsdb.impl_idl_ovn Traceback (most recent call last):
2018-03-05 11:18:04.768 15 ERROR networking_ovn.ovsdb.impl_idl_ovn File "/usr/lib/python2.7/site-packages/networking_ovn/ovsdb/impl_idl_ovn.py", line 86, in __init__
2018-03-05 11:18:04.768 15 ERROR networking_ovn.ovsdb.impl_idl_ovn OvsdbNbOvnIdl.ovsdb_connection.start()
2018-03-05 11:18:04.768 15 ERROR networking_ovn.ovsdb.impl_idl_ovn File "/usr/lib/python2.7/site-packages/neutron/agent/ovsdb/native/connection.py", line 91, in start
2018-03-05 11:18:04.768 15 ERROR networking_ovn.ovsdb.impl_idl_ovn helper = do_get_schema_helper()
2018-03-05 11:18:04.768 15 ERROR networking_ovn.ovsdb.impl_idl_ovn File "/usr/lib/python2.7/site-packages/retrying.py", line 49, in wrapped_f
2018-03-05 11:18:04.768 15 ERROR networking_ovn.ovsdb.impl_idl_ovn return Retrying(*dargs, **dkw).call(f, *args, **kw)
2018-03-05 11:18:04.768 15 ERROR networking_ovn.ovsdb.impl_idl_ovn File "/usr/lib/python2.7/site-packages/retrying.py", line 212, in call
2018-03-05 11:18:04.768 15 ERROR networking_ovn.ovsdb.impl_idl_ovn raise attempt.get()
2018-03-05 11:18:04.768 15 ERROR networking_ovn.ovsdb.impl_idl_ovn File "/usr/lib/python2.7/site-packages/retrying.py", line 247, in get
2018-03-05 11:18:04.768 15 ERROR networking_ovn.ovsdb.impl_idl_ovn six.reraise(self.value[0], self.value[1], self.value[2])
2018-03-05 11:18:04.768 15 ERROR networking_ovn.ovsdb.impl_idl_ovn File "/usr/lib/python2.7/site-packages/retrying.py", line 200, in call
2018-03-05 11:18:04.768 15 ERROR networking_ovn.ovsdb.impl_idl_ovn attempt = Attempt(fn(*args, **kwargs), attempt_number, False)
2018-03-05 11:18:04.768 15 ERROR networking_ovn.ovsdb.impl_idl_ovn File "/usr/lib/python2.7/site-packages/neutron/agent/ovsdb/native/connection.py", line 90, in do_get_schema_helper
2018-03-05 11:18:04.768 15 ERROR networking_ovn.ovsdb.impl_idl_ovn self.schema_name)
2018-03-05 11:18:04.768 15 ERROR networking_ovn.ovsdb.impl_idl_ovn File "/usr/lib/python2.7/site-packages/neutron/agent/ovsdb/native/idlutils.py", line 101, in get_schema_helper
2018-03-05 11:18:04.768 15 ERROR networking_ovn.ovsdb.impl_idl_ovn raise Exception(_("Could not connect to %s") % connection)
2018-03-05 11:18:04.768 15 ERROR networking_ovn.ovsdb.impl_idl_ovn Exception: Could not connect to tcp:ovn-nb-db.openstack.svc.cluster.local:6641
=================

Conclusion:
  I think domain name as a configuration should be supported in networking-ovn when connect ovnnb-db and ovnsb-db. Otherwise we can't containerized neutron-server when using networking-ovn.

Lu lei (lei-lu)
affects: tripleo → networking-ovn
Revision history for this message
Vadym Markov (vmarkov) wrote :

Also hit this issue with containerized setup. Investigated a bit and found 3 places where fix is possible

1. In Neutron, at conf load stage. https://github.com/openstack/neutron/blob/master/neutron/conf/plugins/ml2/drivers/ovn/ovn_conf.py#L231
Solution will be klunky: parse config string with possibly several hosts defined, resolve all addresses and re-assemble string back

2. In ovsdbapp https://github.com/openstack/ovsdbapp/blob/master/ovsdbapp/backend/ovs_idl/idlutils.py#L183
Slightly better, here we have single record to process

3. In ovs somewhere here: https://github.com/openvswitch/ovs/blame/master/python/ovs/socket_util.py#L237

Best solution probably to fix in ovs, but fix in ovsdbapp is smaller and easier to test

Revision history for this message
Vadym Markov (vmarkov) wrote :
Revision history for this message
Vasyl Saienko (vsaienko) wrote :

@vmarkov the PR is not declined, the way how it was implemented was rejected, the alternative way of implementation was suggested in PR, and is implemented by https://patchwork.ozlabs<email address hidden>/

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.