Custom Search

Sunday, April 26, 2015

How to OpenContrail neutron enable LBaaS:Load Balancing as a Service extension

1)
How to install OpenStack with Neutron and contrail-neutron-plugin using DevStack
http://fosshelp.blogspot.com/2015/04/how-to-install-openstack-with-neutron.html

2)
Enable LBaaS:Load Balancing as a Service extension

a)
Specify OpenContrail Loadbalancer service Plugin in /ect/neutron/neutron.conf

b)
Specify 'Opencontrail' LBaaS service provider in /ect/neutron/neutron.conf and comment out all other LBaaS providers and restart neutron server

#vim /ect/neutron/neutron.conf

[DEFAULT]
service_plugins = neutron_plugin_contrail.plugins.opencontrail.loadbalancer.plugin.LoadBalancerPlugin

[service_providers]
#'Opencontrail' LBaaS provider
service_provider = LOADBALANCER:Opencontrail:neutron_plugin_contrail.plugins.opencontrail.loadbalancer.driver.OpencontrailLoadbalancerDriver:default

3)
Check whether extension is loaded or not
#neutron ext-list
+-----------------------+-------------------------------+
| alias                 | name                          |
+-----------------------+-------------------------------+
| contrail              | Contrail Extension            |
| port-security         | Port Security                 |
| security-group        | security-group                |
| ipam                  | Network IP Address Management |
| external-net          | Neutron external network      |
| binding               | Port Binding                  |
| quotas                | Quota management support      |
| agent                 | agent                         |
| route-table           | route-table                   |
| policy                | Network Policy                |
| router                | Neutron L3 Router             |
| allowed-address-pairs | Allowed Address Pairs         |
| extra_dhcp_opt        | Neutron Extra DHCP opts       |
| lbaas                 | LoadBalancing service         |
+-----------------------+-------------------------------+






How to install OpenStack with Neutron and contrail-neutron-plugin using DevStack

1)
Install OpenStack with Neutron and  Configure neutron to use Contrail
http://fosshelp.blogspot.in/2015/04/openstack-devstack-opencontrail-localrc.html

2)
Enable OpenContrail Extensions like Ipam, Policy and  Route-table
http://fosshelp.blogspot.in/2015/04/openstack-devstack-opencontrail-enable.html



OpenStack OpenContrail neutron AttributeError: 'LoadBalancerPlugin' object has no attribute 'agent_notifiers'

===How to Fix:===

Specify 'Opencontrail' LBaaS provider in /ect/neutron/neutron.conf and comment out all other LBaaS providers and restart neutron server

#vim /ect/neutron/neutron.conf

[DEFAULT]
service_plugins = neutron_plugin_contrail.plugins.opencontrail.loadbalancer.plugin.LoadBalancerPlugin
[service_providers]
#service_provider=::[:default]
#service_provider=LOADBALANCER:name:lbaas_plugin_driver_path:default


#'Opencontrail' LBaaS provider
service_provider = LOADBALANCER:Opencontrail:neutron_plugin_contrail.plugins.opencontrail.loadbalancer.driver.OpencontrailLoadbalancerDriver:default
#'Haproxy' LBaaS provider
#service_provider=LOADBALANCER:Haproxy:neutron.services.loadbalancer.drivers.haproxy.plugin_driver.HaproxyOnHostPluginDriver:default

#'Radware' LBaaS provider
#service_provider = LOADBALANCER:Radware:neutron.services.loadbalancer.drivers.radware.driver.LoadBalancerDriver:default

#'netscaler' LBaaS provider
#service_provider=LOADBALANCER:NetScaler:neutron.services.loadbalancer.drivers.netscaler.netscaler_driver.NetScalerPluginDriver

#'Embrane' LBaaS provider
#service_provider=LOADBALANCER:Embrane:neutron.services.loadbalancer.drivers.embrane.driver.EmbraneLbaas:default


===Error:===

2014-12-16 23:50:44.209 DEBUG neutron.manager [-] Loading service plugins: ['neutron_plugin_contrail.plugins.opencontrail.loadbalancer.plugin.LoadBa
lancerPlugin'] from (pid=54650) _load_service_plugins /opt/stack/neutron/neutron/manager.py:168
2014-12-16 23:50:44.209 INFO neutron.manager [-] Loading Plugin: neutron_plugin_contrail.plugins.opencontrail.loadbalancer.plugin.LoadBalancerPlugin
2014-12-16 23:50:44.210 DEBUG stevedore.extension [-] found extension EntryPoint.parse('dummy = neutron.tests.unit.dummy_plugin:DummyServicePlugin')
 from (pid=54650) _load_plugins /usr/local/lib/python2.7/dist-packages/stevedore/extension.py:156
2014-12-16 23:50:44.210 DEBUG stevedore.extension [-] found extension EntryPoint.parse('firewall = neutron.services.firewall.fwaas_plugin:FirewallPl
ugin') from (pid=54650) _load_plugins /usr/local/lib/python2.7/dist-packages/stevedore/extension.py:156
2014-12-16 23:50:44.210 DEBUG stevedore.extension [-] found extension EntryPoint.parse('metering = neutron.services.metering.metering_plugin:Meterin
gPlugin') from (pid=54650) _load_plugins /usr/local/lib/python2.7/dist-packages/stevedore/extension.py:156
2014-12-16 23:50:44.210 DEBUG stevedore.extension [-] found extension EntryPoint.parse('router = neutron.services.l3_router.l3_router_plugin:L3Route
rPlugin') from (pid=54650) _load_plugins /usr/local/lib/python2.7/dist-packages/stevedore/extension.py:156
2014-12-16 23:50:44.210 DEBUG stevedore.extension [-] found extension EntryPoint.parse('vpnaas = neutron.services.vpn.plugin:VPNDriverPlugin') from
(pid=54650) _load_plugins /usr/local/lib/python2.7/dist-packages/stevedore/extension.py:156
2014-12-16 23:50:44.210 DEBUG stevedore.extension [-] found extension EntryPoint.parse('lbaas = neutron.services.loadbalancer.plugin:LoadBalancerPlu
gin') from (pid=54650) _load_plugins /usr/local/lib/python2.7/dist-packages/stevedore/extension.py:156
2014-12-16 23:50:44.265 INFO urllib3.connectionpool [-] Starting new HTTP connection (1): 10.140.218.12

2014-12-16 23:50:44.268 DEBUG urllib3.connectionpool [-] Setting read timeout to None from (pid=54650) _make_request /usr/lib/python2.7/dist-package
s/urllib3/connectionpool.py:390
2014-12-16 23:50:44.272 DEBUG urllib3.connectionpool [-] "GET / HTTP/1.1" 200 10104 from (pid=54650) _make_request /usr/lib/python2.7/dist-packages/
urllib3/connectionpool.py:430
2014-12-16 23:50:44.296 WARNING neutron.openstack.common.db.sqlalchemy.session [-] This application has not enabled MySQL traditional mode, which me
ans silent data corruption may occur. Please encourage the application developers to enable this mode.
2014-12-16 23:50:44.419 INFO neutron.openstack.common.rpc.common [-] Connected to AMQP server on 10.140.218.21:5672
2014-12-16 23:50:44.421 DEBUG neutron.openstack.common.lockutils [-] Semaphore / lock released "_create_instance" from (pid=54650) inner /opt/stack/
neutron/neutron/openstack/common/lockutils.py:252
2014-12-16 23:50:44.421 ERROR neutron.service [-] Unrecoverable error: please check log for details.
2014-12-16 23:50:44.421 TRACE neutron.service Traceback (most recent call last):
2014-12-16 23:50:44.421 TRACE neutron.service   File "/opt/stack/neutron/neutron/service.py", line 105, in serve_wsgi
2014-12-16 23:50:44.421 TRACE neutron.service     service.start()
2014-12-16 23:50:44.421 TRACE neutron.service   File "/opt/stack/neutron/neutron/service.py", line 74, in start
2014-12-16 23:50:44.421 TRACE neutron.service     self.wsgi_app = _run_wsgi(self.app_name)
2014-12-16 23:50:44.421 TRACE neutron.service   File "/opt/stack/neutron/neutron/service.py", line 173, in _run_wsgi
2014-12-16 23:50:44.421 TRACE neutron.service     app = config.load_paste_app(app_name)
2014-12-16 23:50:44.421 TRACE neutron.service   File "/opt/stack/neutron/neutron/common/config.py", line 170, in load_paste_app
2014-12-16 23:50:44.421 TRACE neutron.service     app = deploy.loadapp("config:%s" % config_path, name=app_name)
2014-12-16 23:50:44.421 TRACE neutron.service   File "/usr/lib/python2.7/dist-packages/paste/deploy/loadwsgi.py", line 247, in loadapp
2014-12-16 23:50:44.421 TRACE neutron.service     return loadobj(APP, uri, name=name, **kw)
2014-12-16 23:50:44.421 TRACE neutron.service   File "/usr/lib/python2.7/dist-packages/paste/deploy/loadwsgi.py", line 272, in loadobj
2014-12-16 23:50:44.421 TRACE neutron.service     return context.create()
2014-12-16 23:50:44.421 TRACE neutron.service   File "/usr/lib/python2.7/dist-packages/paste/deploy/loadwsgi.py", line 710, in create
2014-12-16 23:50:44.421 TRACE neutron.service     return self.object_type.invoke(self)
2014-12-16 23:50:44.421 TRACE neutron.service   File "/usr/lib/python2.7/dist-packages/paste/deploy/loadwsgi.py", line 144, in invoke
2014-12-16 23:50:44.421 TRACE neutron.service     **context.local_conf)
2014-12-16 23:50:44.421 TRACE neutron.service   File "/usr/lib/python2.7/dist-packages/paste/deploy/util.py", line 55, in fix_call
2014-12-16 23:50:44.421 TRACE neutron.service     val = callable(*args, **kw)
2014-12-16 23:50:44.421 TRACE neutron.service   File "/usr/lib/python2.7/dist-packages/paste/urlmap.py", line 28, in urlmap_factory
2014-12-16 23:50:44.421 TRACE neutron.service     app = loader.get_app(app_name, global_conf=global_conf)
2014-12-16 23:50:44.421 TRACE neutron.service   File "/usr/lib/python2.7/dist-packages/paste/deploy/loadwsgi.py", line 350, in get_app
2014-12-16 23:50:44.421 TRACE neutron.service     name=name, global_conf=global_conf).create()
2014-12-16 23:50:44.421 TRACE neutron.service   File "/usr/lib/python2.7/dist-packages/paste/deploy/loadwsgi.py", line 710, in create
2014-12-16 23:50:44.421 TRACE neutron.service     return self.object_type.invoke(self)
2014-12-16 23:50:44.421 TRACE neutron.service   File "/usr/lib/python2.7/dist-packages/paste/deploy/loadwsgi.py", line 144, in invoke
2014-12-16 23:50:44.421 TRACE neutron.service     **context.local_conf)
2014-12-16 23:50:44.421 TRACE neutron.service   File "/usr/lib/python2.7/dist-packages/paste/deploy/util.py", line 55, in fix_call
2014-12-16 23:50:44.421 TRACE neutron.service     val = callable(*args, **kw)
2014-12-16 23:50:44.421 TRACE neutron.service   File "/opt/stack/neutron/neutron/auth.py", line 69, in pipeline_factory
2014-12-16 23:50:44.421 TRACE neutron.service     app = loader.get_app(pipeline[-1])
2014-12-16 23:50:44.421 TRACE neutron.service   File "/usr/lib/python2.7/dist-packages/paste/deploy/loadwsgi.py", line 350, in get_app
2014-12-16 23:50:44.421 TRACE neutron.service     name=name, global_conf=global_conf).create()
2014-12-16 23:50:44.421 TRACE neutron.service   File "/usr/lib/python2.7/dist-packages/paste/deploy/loadwsgi.py", line 710, in create
2014-12-16 23:50:44.421 TRACE neutron.service     return self.object_type.invoke(self)
2014-12-16 23:50:44.421 TRACE neutron.service   File "/usr/lib/python2.7/dist-packages/paste/deploy/loadwsgi.py", line 146, in invoke
2014-12-16 23:50:44.421 TRACE neutron.service     return fix_call(context.object, context.global_conf, **context.local_conf)
2014-12-16 23:50:44.421 TRACE neutron.service   File "/usr/lib/python2.7/dist-packages/paste/deploy/util.py", line 55, in fix_call
2014-12-16 23:50:44.421 TRACE neutron.service     val = callable(*args, **kw)
2014-12-16 23:50:44.421 TRACE neutron.service   File "/opt/stack/neutron/neutron/api/v2/router.py", line 72, in factory
2014-12-16 23:50:44.421 TRACE neutron.service     return cls(**local_config)
2014-12-16 23:50:44.421 TRACE neutron.service   File "/opt/stack/neutron/neutron/api/v2/router.py", line 76, in __init__
2014-12-16 23:50:44.421 TRACE neutron.service     plugin = manager.NeutronManager.get_plugin()
2014-12-16 23:50:44.421 TRACE neutron.service   File "/opt/stack/neutron/neutron/manager.py", line 222, in get_plugin
2014-12-16 23:50:44.421 TRACE neutron.service     return weakref.proxy(cls.get_instance().plugin)
2014-12-16 23:50:44.421 TRACE neutron.service   File "/opt/stack/neutron/neutron/manager.py", line 216, in get_instance
2014-12-16 23:50:44.421 TRACE neutron.service     cls._create_instance()
2014-12-16 23:50:44.421 TRACE neutron.service   File "/opt/stack/neutron/neutron/openstack/common/lockutils.py", line 249, in inner
2014-12-16 23:50:44.421 TRACE neutron.service     return f(*args, **kwargs)
2014-12-16 23:50:44.421 TRACE neutron.service   File "/opt/stack/neutron/neutron/manager.py", line 202, in _create_instance

2014-12-16 23:50:44.421 TRACE neutron.service     cls._instance = cls()
2014-12-16 23:50:44.421 TRACE neutron.service   File "/opt/stack/neutron/neutron/manager.py", line 127, in __init__
2014-12-16 23:50:44.421 TRACE neutron.service     self._load_service_plugins()
2014-12-16 23:50:44.421 TRACE neutron.service   File "/opt/stack/neutron/neutron/manager.py", line 175, in _load_service_plugins
2014-12-16 23:50:44.421 TRACE neutron.service     provider)
2014-12-16 23:50:44.421 TRACE neutron.service   File "/opt/stack/neutron/neutron/manager.py", line 142, in _get_plugin_instance
2014-12-16 23:50:44.421 TRACE neutron.service     return plugin_class()
2014-12-16 23:50:44.421 TRACE neutron.service   File "/opt/stack/neutron/neutron_plugin_contrail/plugins/opencontrail/loadbalancer/plugin.py", line
19, in __init__
2014-12-16 23:50:44.421 TRACE neutron.service     self._load_drivers()
2014-12-16 23:50:44.421 TRACE neutron.service   File "/opt/stack/neutron/neutron_plugin_contrail/plugins/opencontrail/loadbalancer/plugin.py", line
25, in _load_drivers
2014-12-16 23:50:44.421 TRACE neutron.service     constants.LOADBALANCER, self)
2014-12-16 23:50:44.421 TRACE neutron.service   File "/opt/stack/neutron/neutron/services/service_base.py", line 81, in load_drivers
2014-12-16 23:50:44.421 TRACE neutron.service     provider['driver'], plugin
2014-12-16 23:50:44.421 TRACE neutron.service   File "/opt/stack/neutron/neutron/openstack/common/importutils.py", line 38, in import_object
2014-12-16 23:50:44.421 TRACE neutron.service     return import_class(import_str)(*args, **kwargs)
2014-12-16 23:50:44.421 TRACE neutron.service   File "/opt/stack/neutron/neutron/services/loadbalancer/drivers/common/agent_driver_base.py", line 33
6, in __init__
2014-12-16 23:50:44.421 TRACE neutron.service     self.plugin.agent_notifiers.update(
2014-12-16 23:50:44.421 TRACE neutron.service AttributeError: 'LoadBalancerPlugin' object has no attribute 'agent_notifiers'
2014-12-16 23:50:44.421 TRACE neutron.service
2014-12-16 23:50:44.424 CRITICAL neutron [-] 'LoadBalancerPlugin' object has no attribute 'agent_notifiers'
2014-12-16 23:50:44.424 TRACE neutron Traceback (most recent call last):
2014-12-16 23:50:44.424 TRACE neutron   File "/usr/local/bin/neutron-server", line 10, in
2014-12-16 23:50:44.424 TRACE neutron     sys.exit(main())
2014-12-16 23:50:44.424 TRACE neutron   File "/opt/stack/neutron/neutron/server/__init__.py", line 48, in main
2014-12-16 23:50:44.424 TRACE neutron     neutron_api = service.serve_wsgi(service.NeutronApiService)
2014-12-16 23:50:44.424 TRACE neutron   File "/opt/stack/neutron/neutron/service.py", line 112, in serve_wsgi
2014-12-16 23:50:44.424 TRACE neutron     LOG.exception(_('Unrecoverable error: please check log '
2014-12-16 23:50:44.424 TRACE neutron   File "/opt/stack/neutron/neutron/openstack/common/excutils.py", line 82, in __exit__
2014-12-16 23:50:44.424 TRACE neutron     six.reraise(self.type_, self.value, self.tb)
2014-12-16 23:50:44.424 TRACE neutron   File "/opt/stack/neutron/neutron/service.py", line 105, in serve_wsgi
2014-12-16 23:50:44.424 TRACE neutron     service.start()
2014-12-16 23:50:44.424 TRACE neutron   File "/opt/stack/neutron/neutron/service.py", line 74, in start

2014-12-16 23:50:44.424 TRACE neutron     self.wsgi_app = _run_wsgi(self.app_name)
2014-12-16 23:50:44.424 TRACE neutron   File "/opt/stack/neutron/neutron/service.py", line 173, in _run_wsgi
2014-12-16 23:50:44.424 TRACE neutron     app = config.load_paste_app(app_name)
2014-12-16 23:50:44.424 TRACE neutron   File "/opt/stack/neutron/neutron/common/config.py", line 170, in load_paste_app
2014-12-16 23:50:44.424 TRACE neutron     app = deploy.loadapp("config:%s" % config_path, name=app_name)
2014-12-16 23:50:44.424 TRACE neutron   File "/usr/lib/python2.7/dist-packages/paste/deploy/loadwsgi.py", line 247, in loadapp
2014-12-16 23:50:44.424 TRACE neutron     return loadobj(APP, uri, name=name, **kw)
2014-12-16 23:50:44.424 TRACE neutron   File "/usr/lib/python2.7/dist-packages/paste/deploy/loadwsgi.py", line 272, in loadobj
2014-12-16 23:50:44.424 TRACE neutron     return context.create()
2014-12-16 23:50:44.424 TRACE neutron   File "/usr/lib/python2.7/dist-packages/paste/deploy/loadwsgi.py", line 710, in create
2014-12-16 23:50:44.424 TRACE neutron     return self.object_type.invoke(self)
2014-12-16 23:50:44.424 TRACE neutron   File "/usr/lib/python2.7/dist-packages/paste/deploy/loadwsgi.py", line 144, in invoke
2014-12-16 23:50:44.424 TRACE neutron     **context.local_conf)
2014-12-16 23:50:44.424 TRACE neutron   File "/usr/lib/python2.7/dist-packages/paste/deploy/util.py", line 55, in fix_call
2014-12-16 23:50:44.424 TRACE neutron     val = callable(*args, **kw)
2014-12-16 23:50:44.424 TRACE neutron   File "/usr/lib/python2.7/dist-packages/paste/urlmap.py", line 28, in urlmap_factory
2014-12-16 23:50:44.424 TRACE neutron     app = loader.get_app(app_name, global_conf=global_conf)
2014-12-16 23:50:44.424 TRACE neutron   File "/usr/lib/python2.7/dist-packages/paste/deploy/loadwsgi.py", line 350, in get_app
2014-12-16 23:50:44.424 TRACE neutron     name=name, global_conf=global_conf).create()
2014-12-16 23:50:44.424 TRACE neutron   File "/usr/lib/python2.7/dist-packages/paste/deploy/loadwsgi.py", line 710, in create
2014-12-16 23:50:44.424 TRACE neutron     return self.object_type.invoke(self)
2014-12-16 23:50:44.424 TRACE neutron   File "/usr/lib/python2.7/dist-packages/paste/deploy/loadwsgi.py", line 144, in invoke
2014-12-16 23:50:44.424 TRACE neutron     **context.local_conf)
2014-12-16 23:50:44.424 TRACE neutron   File "/usr/lib/python2.7/dist-packages/paste/deploy/util.py", line 55, in fix_call
2014-12-16 23:50:44.424 TRACE neutron     val = callable(*args, **kw)
2014-12-16 23:50:44.424 TRACE neutron   File "/opt/stack/neutron/neutron/auth.py", line 69, in pipeline_factory
2014-12-16 23:50:44.424 TRACE neutron     app = loader.get_app(pipeline[-1])
2014-12-16 23:50:44.424 TRACE neutron   File "/usr/lib/python2.7/dist-packages/paste/deploy/loadwsgi.py", line 350, in get_app
2014-12-16 23:50:44.424 TRACE neutron     name=name, global_conf=global_conf).create()
2014-12-16 23:50:44.424 TRACE neutron   File "/usr/lib/python2.7/dist-packages/paste/deploy/loadwsgi.py", line 710, in create
2014-12-16 23:50:44.424 TRACE neutron     return self.object_type.invoke(self)
2014-12-16 23:50:44.424 TRACE neutron   File "/usr/lib/python2.7/dist-packages/paste/deploy/loadwsgi.py", line 146, in invoke
2014-12-16 23:50:44.424 TRACE neutron     return fix_call(context.object, context.global_conf, **context.local_conf)
2014-12-16 23:50:44.424 TRACE neutron   File "/usr/lib/python2.7/dist-packages/paste/deploy/util.py", line 55, in fix_call
2014-12-16 23:50:44.424 TRACE neutron     val = callable(*args, **kw)

2014-12-16 23:50:44.424 TRACE neutron   File "/opt/stack/neutron/neutron/api/v2/router.py", line 72, in factory
2014-12-16 23:50:44.424 TRACE neutron     return cls(**local_config)
2014-12-16 23:50:44.424 TRACE neutron   File "/opt/stack/neutron/neutron/api/v2/router.py", line 76, in __init__
2014-12-16 23:50:44.424 TRACE neutron     plugin = manager.NeutronManager.get_plugin()
2014-12-16 23:50:44.424 TRACE neutron   File "/opt/stack/neutron/neutron/manager.py", line 222, in get_plugin
2014-12-16 23:50:44.424 TRACE neutron     return weakref.proxy(cls.get_instance().plugin)
2014-12-16 23:50:44.424 TRACE neutron   File "/opt/stack/neutron/neutron/manager.py", line 216, in get_instance
2014-12-16 23:50:44.424 TRACE neutron     cls._create_instance()
2014-12-16 23:50:44.424 TRACE neutron   File "/opt/stack/neutron/neutron/openstack/common/lockutils.py", line 249, in inner
2014-12-16 23:50:44.424 TRACE neutron     return f(*args, **kwargs)
2014-12-16 23:50:44.424 TRACE neutron   File "/opt/stack/neutron/neutron/manager.py", line 202, in _create_instance
2014-12-16 23:50:44.424 TRACE neutron     cls._instance = cls()
2014-12-16 23:50:44.424 TRACE neutron   File "/opt/stack/neutron/neutron/manager.py", line 127, in __init__
2014-12-16 23:50:44.424 TRACE neutron     self._load_service_plugins()
2014-12-16 23:50:44.424 TRACE neutron   File "/opt/stack/neutron/neutron/manager.py", line 175, in _load_service_plugins
2014-12-16 23:50:44.424 TRACE neutron     provider)
2014-12-16 23:50:44.424 TRACE neutron   File "/opt/stack/neutron/neutron/manager.py", line 142, in _get_plugin_instance
2014-12-16 23:50:44.424 TRACE neutron     return plugin_class()
2014-12-16 23:50:44.424 TRACE neutron   File "/opt/stack/neutron/neutron_plugin_contrail/plugins/opencontrail/loadbalancer/plugin.py", line 19, in __init__
2014-12-16 23:50:44.424 TRACE neutron     self._load_drivers()
2014-12-16 23:50:44.424 TRACE neutron   File "/opt/stack/neutron/neutron_plugin_contrail/plugins/opencontrail/loadbalancer/plugin.py", line 25, in _load_drivers
2014-12-16 23:50:44.424 TRACE neutron     constants.LOADBALANCER, self)
2014-12-16 23:50:44.424 TRACE neutron   File "/opt/stack/neutron/neutron/services/service_base.py", line 81, in load_drivers
2014-12-16 23:50:44.424 TRACE neutron     provider['driver'], plugin
2014-12-16 23:50:44.424 TRACE neutron   File "/opt/stack/neutron/neutron/openstack/common/importutils.py", line 38, in import_object
2014-12-16 23:50:44.424 TRACE neutron     return import_class(import_str)(*args, **kwargs)
2014-12-16 23:50:44.424 TRACE neutron   File "/opt/stack/neutron/neutron/services/loadbalancer/drivers/common/agent_driver_base.py", line 336, in __init__
2014-12-16 23:50:44.424 TRACE neutron     self.plugin.agent_notifiers.update(
2014-12-16 23:50:44.424 TRACE neutron AttributeError: 'LoadBalancerPlugin' object has no attribute 'agent_notifiers'
2014-12-16 23:50:44.424 TRACE neutron
q-svc failed to start


OpenStack neutron No providers specified for 'LOADBALANCER' service, exiting

===How to Fix:===




Specify LBass provider in /ect/neutron/neutron.conf
 

[DEFAULT]
service_plugins = neutron_plugin_contrail.plugins.opencontrail.loadbalancer.plugin.LoadBalancerPlugin

[service_providers]
#service_provider=::[:default]
#service_provider=LOADBALANCER:name:lbaas_plugin_driver_path:default


#'Opencontrail' LBaaS provider
service_provider = LOADBALANCER:Opencontrail:neutron_plugin_contrail.plugins.opencontrail.loadbalancer.driver.OpencontrailLoadbalancerDriver:default



===Error:==

2014-12-16 23:46:10.228 DEBUG urllib3.connectionpool [-] Setting read timeout to None from (pid=54393) _make_request /usr/lib/python2.7/dist-packages/urllib3/connectionpool.py:390
2014-12-16 23:46:10.232 DEBUG urllib3.connectionpool [-] "GET / HTTP/1.1" 200 10104 from (pid=54393) _make_request /usr/lib/python2.7/dist-packages/urllib3/connectionpool.py:430
2014-12-16 23:46:10.259 WARNING neutron.openstack.common.db.sqlalchemy.session [-] This application has not enabled MySQL traditional mode, which means silent data corruption may occur. Please encourage the application developers to enable this mode.
2014-12-16 23:46:10.292 ERROR neutron.services.service_base [-] No providers specified for 'LOADBALANCER' service, exiting
2014-12-16 23:46:10.293 DEBUG neutron.openstack.common.lockutils [-] Semaphore / lock released "_create_instance" from (pid=54393) inner /opt/stack/neutron/neutron/openstack/common/lockutils.py:252
No providers specified for 'LOADBALANCER' service, exiting
q-svc failed to start

neutron.manager ImportError: No module named vnc_api.vnc_api

How to Fox it
http://fosshelp.blogspot.in/2015/04/howto-opencontrail-install-cfgmcommon.html

===Error:===

2014-12-16 22:06:11.262 INFO neutron.manager [-] Loading Plugin: neutron_plugin_contrail.plugins.opencontrail.loadbalancer.plugin.LoadBalancerPlugin
2014-12-16 22:06:11.263 DEBUG stevedore.extension [-] found extension EntryPoint.parse('dummy = neutron.tests.unit.dummy_plugin:DummyServicePlugin')
 from (pid=49770) _load_plugins /usr/local/lib/python2.7/dist-packages/stevedore/extension.py:156
2014-12-16 22:06:11.263 DEBUG stevedore.extension [-] found extension EntryPoint.parse('firewall = neutron.services.firewall.fwaas_plugin:FirewallPl
ugin') from (pid=49770) _load_plugins /usr/local/lib/python2.7/dist-packages/stevedore/extension.py:156
2014-12-16 22:06:11.263 DEBUG stevedore.extension [-] found extension EntryPoint.parse('metering = neutron.services.metering.metering_plugin:Meterin
gPlugin') from (pid=49770) _load_plugins /usr/local/lib/python2.7/dist-packages/stevedore/extension.py:156
2014-12-16 22:06:11.263 DEBUG stevedore.extension [-] found extension EntryPoint.parse('router = neutron.services.l3_router.l3_router_plugin:L3Route
rPlugin') from (pid=49770) _load_plugins /usr/local/lib/python2.7/dist-packages/stevedore/extension.py:156
2014-12-16 22:06:11.263 DEBUG stevedore.extension [-] found extension EntryPoint.parse('vpnaas = neutron.services.vpn.plugin:VPNDriverPlugin') from
(pid=49770) _load_plugins /usr/local/lib/python2.7/dist-packages/stevedore/extension.py:156
2014-12-16 22:06:11.263 DEBUG stevedore.extension [-] found extension EntryPoint.parse('lbaas = neutron.services.loadbalancer.plugin:LoadBalancerPlu
gin') from (pid=49770) _load_plugins /usr/local/lib/python2.7/dist-packages/stevedore/extension.py:156
2014-12-16 22:06:11.271 ERROR neutron.manager [-] Error loading plugin by name, No 'neutron.service_plugins' driver found, looking for 'neutron_plug
in_contrail.plugins.opencontrail.loadbalancer.plugin.LoadBalancerPlugin'

2014-12-16 22:06:11.271 TRACE neutron.manager Traceback (most recent call last):
2014-12-16 22:06:11.271 TRACE neutron.manager   File "/opt/stack/neutron/neutron/manager.py", line 137, in _get_plugin_instance
2014-12-16 22:06:11.271 TRACE neutron.manager     plugin_class = importutils.import_class(plugin_provider)
2014-12-16 22:06:11.271 TRACE neutron.manager   File "/opt/stack/neutron/neutron/openstack/common/importutils.py", line 28, in import_class
2014-12-16 22:06:11.271 TRACE neutron.manager     __import__(mod_str)
2014-12-16 22:06:11.271 TRACE neutron.manager   File "/opt/stack/neutron/neutron_plugin_contrail/plugins/opencontrail/loadbalancer/plugin.py", line
4, in
2014-12-16 22:06:11.271 TRACE neutron.manager     from loadbalancer_db import LoadBalancerPluginDb
2014-12-16 22:06:11.271 TRACE neutron.manager   File "/opt/stack/neutron/neutron_plugin_contrail/plugins/opencontrail/loadbalancer/loadbalancer_db.p
y", line 14, in
2014-12-16 22:06:11.271 TRACE neutron.manager     from vnc_api.vnc_api import VncApi
2014-12-16 22:06:11.271 TRACE neutron.manager ImportError: No module named vnc_api.vnc_api
2014-12-16 22:06:11.271 TRACE neutron.manager
2014-12-16 22:06:11.272 ERROR neutron.manager [-] Error loading plugin by class, No module named vnc_api.vnc_api
2014-12-16 22:06:11.272 TRACE neutron.manager Traceback (most recent call last):
2014-12-16 22:06:11.272 TRACE neutron.manager   File "/opt/stack/neutron/neutron/manager.py", line 137, in _get_plugin_instance
2014-12-16 22:06:11.272 TRACE neutron.manager     plugin_class = importutils.import_class(plugin_provider)
2014-12-16 22:06:11.272 TRACE neutron.manager   File "/opt/stack/neutron/neutron/openstack/common/importutils.py", line 28, in import_class
2014-12-16 22:06:11.272 TRACE neutron.manager     __import__(mod_str)
2014-12-16 22:06:11.272 TRACE neutron.manager   File "/opt/stack/neutron/neutron_plugin_contrail/plugins/opencontrail/loadbalancer/plugin.py", line
4, in
2014-12-16 22:06:11.272 TRACE neutron.manager     from loadbalancer_db import LoadBalancerPluginDb
2014-12-16 22:06:11.272 TRACE neutron.manager   File "/opt/stack/neutron/neutron_plugin_contrail/plugins/opencontrail/loadbalancer/loadbalancer_db.p
y", line 14, in
2014-12-16 22:06:11.272 TRACE neutron.manager     from vnc_api.vnc_api import VncApi
2014-12-16 22:06:11.272 TRACE neutron.manager ImportError: No module named vnc_api.vnc_api
2014-12-16 22:06:11.272 TRACE neutron.manager

neutron.manager ImportError: No module named cfgm_common

How to Fox it
http://fosshelp.blogspot.in/2015/04/howto-opencontrail-install-cfgmcommon.html

===Error:===

2014-12-15 03:46:42.777 INFO neutron.manager [-] Loading Plugin: neutron_plugin_contrail.plugins.opencontrail.loadbalancer.plugin.LoadBalancerPlugin
2014-12-15 03:46:42.778 DEBUG stevedore.extension [-] found extension EntryPoint.parse('dummy = neutron.tests.unit.dummy_plugin:DummyServicePlugin')
 from (pid=50813) _load_plugins /usr/local/lib/python2.7/dist-packages/stevedore/extension.py:156
2014-12-15 03:46:42.778 DEBUG stevedore.extension [-] found extension EntryPoint.parse('firewall = neutron.services.firewall.fwaas_plugin:FirewallPl
ugin') from (pid=50813) _load_plugins /usr/local/lib/python2.7/dist-packages/stevedore/extension.py:156
2014-12-15 03:46:42.778 DEBUG stevedore.extension [-] found extension EntryPoint.parse('metering = neutron.services.metering.metering_plugin:Meterin
gPlugin') from (pid=50813) _load_plugins /usr/local/lib/python2.7/dist-packages/stevedore/extension.py:156
2014-12-15 03:46:42.778 DEBUG stevedore.extension [-] found extension EntryPoint.parse('router = neutron.services.l3_router.l3_router_plugin:L3Route
rPlugin') from (pid=50813) _load_plugins /usr/local/lib/python2.7/dist-packages/stevedore/extension.py:156
2014-12-15 03:46:42.778 DEBUG stevedore.extension [-] found extension EntryPoint.parse('vpnaas = neutron.services.vpn.plugin:VPNDriverPlugin') from
(pid=50813) _load_plugins /usr/local/lib/python2.7/dist-packages/stevedore/extension.py:156
2014-12-15 03:46:42.778 DEBUG stevedore.extension [-] found extension EntryPoint.parse('lbaas = neutron.services.loadbalancer.plugin:LoadBalancerPlu
gin') from (pid=50813) _load_plugins /usr/local/lib/python2.7/dist-packages/stevedore/extension.py:156
2014-12-15 03:46:42.779 ERROR neutron.manager [-] Error loading plugin by name, No 'neutron.service_plugins' driver found, looking for 'neutron_plug
in_contrail.plugins.opencontrail.loadbalancer.plugin.LoadBalancerPlugin'
2014-12-15 03:46:42.779 TRACE neutron.manager Traceback (most recent call last):
2014-12-15 03:46:42.779 TRACE neutron.manager   File "/opt/stack/neutron/neutron/manager.py", line 137, in _get_plugin_instance
2014-12-15 03:46:42.779 TRACE neutron.manager     plugin_class = importutils.import_class(plugin_provider)
2014-12-15 03:46:42.779 TRACE neutron.manager   File "/opt/stack/neutron/neutron/openstack/common/importutils.py", line 28, in import_class
2014-12-15 03:46:42.779 TRACE neutron.manager     __import__(mod_str)
2014-12-15 03:46:42.779 TRACE neutron.manager   File "/opt/stack/neutron/neutron_plugin_contrail/plugins/opencontrail/loadbalancer/plugin.py", line
4, in
2014-12-15 03:46:42.779 TRACE neutron.manager     from loadbalancer_db import LoadBalancerPluginDb
2014-12-15 03:46:42.779 TRACE neutron.manager   File "/opt/stack/neutron/neutron_plugin_contrail/plugins/opencontrail/loadbalancer/loadbalancer_db.p
y", line 10, in
2014-12-15 03:46:42.779 TRACE neutron.manager     from cfgm_common import exceptions as vnc_exc
2014-12-15 03:46:42.779 TRACE neutron.manager ImportError: No module named cfgm_common
2014-12-15 03:46:42.779 TRACE neutron.manager
2014-12-15 03:46:42.780 ERROR neutron.manager [-] Error loading plugin by class, No module named cfgm_common
2014-12-15 03:46:42.780 TRACE neutron.manager Traceback (most recent call last):
2014-12-15 03:46:42.780 TRACE neutron.manager   File "/opt/stack/neutron/neutron/manager.py", line 137, in _get_plugin_instance
2014-12-15 03:46:42.780 TRACE neutron.manager     plugin_class = importutils.import_class(plugin_provider)
2014-12-15 03:46:42.780 TRACE neutron.manager   File "/opt/stack/neutron/neutron/openstack/common/importutils.py", line 28, in import_class
2014-12-15 03:46:42.780 TRACE neutron.manager     __import__(mod_str)
2014-12-15 03:46:42.780 TRACE neutron.manager   File "/opt/stack/neutron/neutron_plugin_contrail/plugins/opencontrail/loadbalancer/plugin.py", line 4, in
2014-12-15 03:46:42.780 TRACE neutron.manager     from loadbalancer_db import LoadBalancerPluginDb
2014-12-15 03:46:42.780 TRACE neutron.manager   File "/opt/stack/neutron/neutron_plugin_contrail/plugins/opencontrail/loadbalancer/loadbalancer_db.py", line 10, in
2014-12-15 03:46:42.780 TRACE neutron.manager     from cfgm_common import exceptions as vnc_exc
2014-12-15 03:46:42.780 TRACE neutron.manager ImportError: No module named cfgm_common
2014-12-15 03:46:42.780 TRACE neutron.manager
2014-12-15 03:46:42.780 DEBUG neutron.openstack.common.lockutils [-] Semaphore / lock released "_create_instance" from (pid=50813) inner /opt/stack/neutron/neutron/openstack/common/lockutils.py:252
2014-12-15 03:46:42.781 ERROR neutron.common.config [-] Unable to load neutron from configuration file /etc/neutron/api-paste.ini.
2014-12-15 03:46:42.781 TRACE neutron.common.config Traceback (most recent call last):
2014-12-15 03:46:42.781 TRACE neutron.common.config   File "/opt/stack/neutron/neutron/common/config.py", line 170, in load_paste_app
2014-12-15 03:46:42.781 TRACE neutron.common.config     app = deploy.loadapp("config:%s" % config_path, name=app_name)
2014-12-15 03:46:42.781 TRACE neutron.common.config   File "/usr/lib/python2.7/dist-packages/paste/deploy/loadwsgi.py", line 247, in loadapp
2014-12-15 03:46:42.781 TRACE neutron.common.config     return loadobj(APP, uri, name=name, **kw)
2014-12-15 03:46:42.781 TRACE neutron.common.config   File "/usr/lib/python2.7/dist-packages/paste/deploy/loadwsgi.py", line 272, in loadobj
2014-12-15 03:46:42.781 TRACE neutron.common.config     return context.create()
2014-12-15 03:46:42.781 TRACE neutron.common.config   File "/usr/lib/python2.7/dist-packages/paste/deploy/loadwsgi.py", line 710, in create
2014-12-15 03:46:42.781 TRACE neutron.common.config     return self.object_type.invoke(self)
2014-12-15 03:46:42.781 TRACE neutron.common.config   File "/usr/lib/python2.7/dist-packages/paste/deploy/loadwsgi.py", line 144, in invoke
2014-12-15 03:46:42.781 TRACE neutron.common.config     **context.local_conf)
2014-12-15 03:46:42.781 TRACE neutron.common.config   File "/usr/lib/python2.7/dist-packages/paste/deploy/util.py", line 55, in fix_call
2014-12-15 03:46:42.781 TRACE neutron.common.config     val = callable(*args, **kw)
2014-12-15 03:46:42.781 TRACE neutron.common.config   File "/usr/lib/python2.7/dist-packages/paste/urlmap.py", line 28, in urlmap_factory
2014-12-15 03:46:42.781 TRACE neutron.common.config     app = loader.get_app(app_name, global_conf=global_conf)
2014-12-15 03:46:42.781 TRACE neutron.common.config   File "/usr/lib/python2.7/dist-packages/paste/deploy/loadwsgi.py", line 350, in get_app
2014-12-15 03:46:42.781 TRACE neutron.common.config     name=name, global_conf=global_conf).create()
2014-12-15 03:46:42.781 TRACE neutron.common.config   File "/usr/lib/python2.7/dist-packages/paste/deploy/loadwsgi.py", line 710, in create
2014-12-15 03:46:42.781 TRACE neutron.common.config     return self.object_type.invoke(self)
2014-12-15 03:46:42.781 TRACE neutron.common.config   File "/usr/lib/python2.7/dist-packages/paste/deploy/loadwsgi.py", line 144, in invoke
2014-12-15 03:46:42.781 TRACE neutron.common.config     **context.local_conf)
2014-12-15 03:46:42.781 TRACE neutron.common.config   File "/usr/lib/python2.7/dist-packages/paste/deploy/util.py", line 55, in fix_call
2014-12-15 03:46:42.781 TRACE neutron.common.config     val = callable(*args, **kw)
2014-12-15 03:46:42.781 TRACE neutron.common.config   File "/opt/stack/neutron/neutron/auth.py", line 69, in pipeline_factory
2014-12-15 03:46:42.781 TRACE neutron.common.config     app = loader.get_app(pipeline[-1])
2014-12-15 03:46:42.781 TRACE neutron.common.config   File "/usr/lib/python2.7/dist-packages/paste/deploy/loadwsgi.py", line 350, in get_app
2014-12-15 03:46:42.781 TRACE neutron.common.config     name=name, global_conf=global_conf).create()
2014-12-15 03:46:42.781 TRACE neutron.common.config   File "/usr/lib/python2.7/dist-packages/paste/deploy/loadwsgi.py", line 710, in create
2014-12-15 03:46:42.781 TRACE neutron.common.config     return self.object_type.invoke(self)
2014-12-15 03:46:42.781 TRACE neutron.common.config   File "/usr/lib/python2.7/dist-packages/paste/deploy/loadwsgi.py", line 146, in invoke
2014-12-15 03:46:42.781 TRACE neutron.common.config     return fix_call(context.object, context.global_conf, **context.local_conf)
2014-12-15 03:46:42.781 TRACE neutron.common.config   File "/usr/lib/python2.7/dist-packages/paste/deploy/util.py", line 55, in fix_call
2014-12-15 03:46:42.781 TRACE neutron.common.config     val = callable(*args, **kw)
2014-12-15 03:46:42.781 TRACE neutron.common.config   File "/opt/stack/neutron/neutron/api/v2/router.py", line 72, in factory
2014-12-15 03:46:42.781 TRACE neutron.common.config     return cls(**local_config)
2014-12-15 03:46:42.781 TRACE neutron.common.config   File "/opt/stack/neutron/neutron/api/v2/router.py", line 76, in __init__
2014-12-15 03:46:42.781 TRACE neutron.common.config     plugin = manager.NeutronManager.get_plugin()
2014-12-15 03:46:42.781 TRACE neutron.common.config   File "/opt/stack/neutron/neutron/manager.py", line 222, in get_plugin
2014-12-15 03:46:42.781 TRACE neutron.common.config     return weakref.proxy(cls.get_instance().plugin)
2014-12-15 03:46:42.781 TRACE neutron.common.config   File "/opt/stack/neutron/neutron/manager.py", line 216, in get_instance
2014-12-15 03:46:42.781 TRACE neutron.common.config     cls._create_instance()
2014-12-15 03:46:42.781 TRACE neutron.common.config   File "/opt/stack/neutron/neutron/openstack/common/lockutils.py", line 249, in inner
2014-12-15 03:46:42.781 TRACE neutron.common.config     return f(*args, **kwargs)
2014-12-15 03:46:42.781 TRACE neutron.common.config   File "/opt/stack/neutron/neutron/manager.py", line 202, in _create_instance
2014-12-15 03:46:42.781 TRACE neutron.common.config     cls._instance = cls()
2014-12-15 03:46:42.781 TRACE neutron.common.config   File "/opt/stack/neutron/neutron/manager.py", line 127, in __init__
2014-12-15 03:46:42.781 TRACE neutron.common.config     self._load_service_plugins()
2014-12-15 03:46:42.781 TRACE neutron.common.config   File "/opt/stack/neutron/neutron/manager.py", line 175, in _load_service_plugins
2014-12-15 03:46:42.781 TRACE neutron.common.config     provider)
2014-12-15 03:46:42.781 TRACE neutron.common.config   File "/opt/stack/neutron/neutron/manager.py", line 141, in _get_plugin_instance
2014-12-15 03:46:42.781 TRACE neutron.common.config     raise ImportError(_("Plugin not found."))
2014-12-15 03:46:42.781 TRACE neutron.common.config ImportError: Plugin not found.
2014-12-15 03:46:42.781 TRACE neutron.common.config
2014-12-15 03:46:42.782 ERROR neutron.service [-] Error occurred: trying old api-paste.ini.
2014-12-15 03:46:42.782 TRACE neutron.service Traceback (most recent call last):
2014-12-15 03:46:42.782 TRACE neutron.service   File "/opt/stack/neutron/neutron/service.py", line 105, in serve_wsgi
2014-12-15 03:46:42.782 TRACE neutron.service     service.start()
2014-12-15 03:46:42.782 TRACE neutron.service   File "/opt/stack/neutron/neutron/service.py", line 74, in start
2014-12-15 03:46:42.782 TRACE neutron.service     self.wsgi_app = _run_wsgi(self.app_name)
2014-12-15 03:46:42.782 TRACE neutron.service   File "/opt/stack/neutron/neutron/service.py", line 173, in _run_wsgi
2014-12-15 03:46:42.782 TRACE neutron.service     app = config.load_paste_app(app_name)
2014-12-15 03:46:42.782 TRACE neutron.service   File "/opt/stack/neutron/neutron/common/config.py", line 177, in load_paste_app
2014-12-15 03:46:42.782 TRACE neutron.service     raise RuntimeError(msg)
2014-12-15 03:46:42.782 TRACE neutron.service RuntimeError: Unable to load neutron from configuration file /etc/neutron/api-paste.ini.
2014-12-15 03:46:42.782 TRACE neutron.service
2014-12-15 03:46:42.783 INFO neutron.common.config [-] Logging enabled!



log_opt_values /usr/local/lib/python2.7/dist-packages/oslo/config/cfg.py:2002
2014-12-15 03:46:42.803 INFO neutron.common.config [-] Config paste file: /etc/neutron/api-paste.ini
2014-12-15 03:46:42.804 ERROR neutron.common.config [-] Unable to load quantum from configuration file /etc/neutron/api-paste.ini.
2014-12-15 03:46:42.804 TRACE neutron.common.config Traceback (most recent call last):
2014-12-15 03:46:42.804 TRACE neutron.common.config   File "/opt/stack/neutron/neutron/common/config.py", line 170, in load_paste_app
2014-12-15 03:46:42.804 TRACE neutron.common.config     app = deploy.loadapp("config:%s" % config_path, name=app_name)
2014-12-15 03:46:42.804 TRACE neutron.common.config   File "/usr/lib/python2.7/dist-packages/paste/deploy/loadwsgi.py", line 247, in loadapp
2014-12-15 03:46:42.804 TRACE neutron.common.config     return loadobj(APP, uri, name=name, **kw)
2014-12-15 03:46:42.804 TRACE neutron.common.config   File "/usr/lib/python2.7/dist-packages/paste/deploy/loadwsgi.py", line 271, in loadobj
2014-12-15 03:46:42.804 TRACE neutron.common.config     global_conf=global_conf)
2014-12-15 03:46:42.804 TRACE neutron.common.config   File "/usr/lib/python2.7/dist-packages/paste/deploy/loadwsgi.py", line 296, in loadcontext
2014-12-15 03:46:42.804 TRACE neutron.common.config     global_conf=global_conf)
2014-12-15 03:46:42.804 TRACE neutron.common.config   File "/usr/lib/python2.7/dist-packages/paste/deploy/loadwsgi.py", line 320, in _loadconfig
2014-12-15 03:46:42.804 TRACE neutron.common.config     return loader.get_context(object_type, name, global_conf)
2014-12-15 03:46:42.804 TRACE neutron.common.config   File "/usr/lib/python2.7/dist-packages/paste/deploy/loadwsgi.py", line 408, in get_context
2014-12-15 03:46:42.804 TRACE neutron.common.config     object_type, name=name)
2014-12-15 03:46:42.804 TRACE neutron.common.config   File "/usr/lib/python2.7/dist-packages/paste/deploy/loadwsgi.py", line 587, in find_config_section
2014-12-15 03:46:42.804 TRACE neutron.common.config     self.filename))
2014-12-15 03:46:42.804 TRACE neutron.common.config LookupError: No section 'quantum' (prefixed by 'app' or 'application' or 'composite' or 'composit' or 'pipeline' or 'filter-app') found in config /etc/neutron/api-paste.ini
2014-12-15 03:46:42.804 TRACE neutron.common.config
2014-12-15 03:46:42.804 ERROR neutron.service [-] Unrecoverable error: please check log for details.
2014-12-15 03:46:42.804 TRACE neutron.service Traceback (most recent call last):
2014-12-15 03:46:42.804 TRACE neutron.service   File "/opt/stack/neutron/neutron/service.py", line 109, in serve_wsgi
2014-12-15 03:46:42.804 TRACE neutron.service     service.start()
2014-12-15 03:46:42.804 TRACE neutron.service   File "/opt/stack/neutron/neutron/service.py", line 74, in start
2014-12-15 03:46:42.804 TRACE neutron.service     self.wsgi_app = _run_wsgi(self.app_name)
2014-12-15 03:46:42.804 TRACE neutron.service   File "/opt/stack/neutron/neutron/service.py", line 173, in _run_wsgi
2014-12-15 03:46:42.804 TRACE neutron.service     app = config.load_paste_app(app_name)
2014-12-15 03:46:42.804 TRACE neutron.service   File "/opt/stack/neutron/neutron/common/config.py", line 177, in load_paste_app
2014-12-15 03:46:42.804 TRACE neutron.service     raise RuntimeError(msg)
2014-12-15 03:46:42.804 TRACE neutron.service RuntimeError: Unable to load quantum from configuration file /etc/neutron/api-paste.ini.
2014-12-15 03:46:42.804 TRACE neutron.service
ERROR: Unable to load quantum from configuration file /etc/neutron/api-paste.ini.
q-svc failed to start


Howto OpenContrail install cfgm_common and vnc_api

First, build the packages using contrail-installer, then copy .tar.gz from /opt/stack/contrail/build directory and install it with pip command.

1)
Install cfgm_common

/opt/stack/contrail/build/production/config/common/dist/cfgm_common-0.1.dev0.tar.gz
#sudo pip install cfgm_common-0.1.dev0.tar.gz


2)
Install vnc_api

/opt/stack/contrail/build/production/api-lib/dist/vnc_api-0.1.dev0.tar.gz
#sudo pip install vnc_api-0.1.dev0.tar.gz









Thursday, April 23, 2015

Install python neutronclient from github.com/Juniper and test OpenContrail Extensions

1)
#git clone https://github.com/Juniper/python-neutronclient.git -b contrail/icehouse

2)
#cd python-neutronclient
#sudo pip install tox
#tox


3)
#vim neutron1

#!/usr/bin/python
# PBR Generated from 'console_scripts'
import sys
from neutronclient.shell import main
if __name__ == "__main__":
    sys.exit(main()
)

4)
#chmod a+x neutron1

5)

#./neutron1 net-list
#./neutron1 ipam-list
#./neutron1 policy-list
#./neutron1 route-table-list


DevStack How to Install stable OpenStack Kilo in Ubuntu

1)
Clone DevStack
#git clone https://github.com/openstack-dev/devstack.git -b stable/kilo



2)
Install OpenStack

#cd devsack
#./stack.sh



How to OpenStack DevStack OpenContrail enable Extensions

1)
First install OpenStack + OpenContrail setup using devstack
http://fosshelp.blogspot.in/2015/04/openstack-devstack-opencontrail-localrc.html

2)
Goto "/opt/stack/neutron", then clone or download "contrail-neutron-plugin"

#cd /opt/stack/neutron

#git clone https://github.com/Juniper/contrail-neutron-plugin.git
OR
#wget https://github.com/Juniper/contrail-neutron-plugin/archive/v2.01.tar.gz

3)
Configure contrail api_extensions_path  and core_plugin in /etc/neutron/neutron.conf

#vim /etc/neutron/neutron.conf

[DEFAULT]
api_extensions_path = extensions:/opt/stack/neutron/neutron_plugin_contrail/extensions

core_plugin = neutron_plugin_contrail.plugins.opencontrail.contrail_plugin.NeutronPluginContrailCoreV2

4)
Enable contrail_extensions (Example ipam) in /etc/neutron/plugins/opencontrail/ContrailPlugin.ini

#vim /etc/neutron/plugins/opencontrail/ContrailPlugin.ini

[APISERVER]
contrail_extensions=ipam:neutron_plugin_contrail.plugins.opencontrail.contrail_plugin_ipam.NeutronPluginContrailIpam

5)
Goto screen and restart neutron server "q-svc"

6)
Check ipam extension using curl
#curl -s -H "X-Auth-Token: $(keystone token-get | awk '/ id / {print $4}')" 192.168.56.102:9696/v2.0/ipams | python -mjson.tool

7)
List all extensions and check for the "ipam" extension

#curl -s -H "X-Auth-Token: $(keystone token-get | awk '/ id / {print $4}')" 192.168.56.102:9696/v2.0/extensions | python -mjson.tool

OR

#neutron ext-list

8)
Enable contrail_extensions ipam, policy and route-table in /etc/neutron/plugins/opencontrail/ContrailPlugin.ini

#contrail_extensions=ipam:neutron_plugin_contrail.plugins.opencontrail.contrail_plugin_ipam.NeutronPluginContrailIpam,policy:neutron_plugin_contrail.plugins.opencontrail.contrail_plugin_policy.NeutronPluginContrailPolicy,route-table:neutron_plugin_contrail.plugins.opencontrail.contrail_plugin_vpc.NeutronPluginContrailVpc






OpenStack Neutron API Examples using curl

1)
export OS_USERNAME=admin
export OS_PASSWORD=secret123
export OS_TENANT_NAME=admin
export OS_AUTH_URL=http://127.0.0.1:35357/v2.0


2)
You can find endpoint of neutron service with following command
#keystone service-list
#keystone endpoint-list

3)
List networks

#curl -s -H "X-Auth-Token: $(keystone token-get | awk '/ id / {print $4}')" 192.168.56.102:9696/v2.0/networks | python -mjson.tool

List subnets
#curl -s -H "X-Auth-Token: $(keystone token-get | awk '/ id / {print $4}')" 192.168.56.102:9696/v2.0/subnets | python -mjson.tool

List security-groups
#curl -s -H "X-Auth-Token: $(keystone token-get | awk '/ id / {print $4}')" 192.168.56.102:9696/v2.0/security-groups | python -mjson.tool

List ports
#curl -s -H "X-Auth-Token: $(keystone token-get | awk '/ id / {print $4}')" 192.168.56.102:9696/v2.0/ports | python -mjson.tool

List routers

#curl -s -H "X-Auth-Token: $(keystone token-get | awk '/ id / {print $4}')" 192.168.56.102:9696/v2.0/routers | python -mjson.tool

List extensions

#curl -s -H "X-Auth-Token: $(keystone token-get | awk '/ id / {print $4}')" 192.168.56.102:9696/v2.0/extensions | python -mjson.tool



OpenStack DevStack OpenContrail localrc

1)
First clone devstack from github.com/openstack-dev
#git clone https://github.com/openstack-dev/devstack.git

2)
Then download devstack opencontrail plugin installation script following link and move to clone directory "devstack/lib/neutron_plugins/"
https://github.com/Juniper/contrail-installer/blob/master/devstack/lib/neutron_plugins/opencontrail
or
https://github.com/dsetia/devstack/blob/master/lib/neutron_plugins/contrail

3)
Then add following lines in localrc

#OpenContrail API Server
APISERVER_IP=192.168.56.102
#OpenContrail Plugin
Q_PLUGIN=opencontrail
#OpenContrail nova plugin
NOVA_VIF_DRIVER=nova_contrail_vif.contrailvif.VRouterVIFDriver

4)
Optional Step

Comment/delete following line from stack.sh
create_neutron_initial_network

5)
Example localrc


STACK_DIR=$(cd $(dirname $0) && pwd)

LOG_DIR=$STACK_DIR/log/screens
LOG=True
DEBUG=True
LOGFILE=$STACK_DIR/log/stack.log
LOGDAYS=1
SCREEN_LOGDIR=$LOG_DIR

disable_service n-net
enable_service q-svc
enable_service q-meta
#enable_service neutron

# not used by contrail
disable_service q-agt
disable_service q-dhcp
disable_service q-l3

DATABASE_PASSWORD=contrail123
RABBIT_PASSWORD=contrail123
SERVICE_TOKEN=contrail123
SERVICE_PASSWORD=contrail123
ADMIN_PASSWORD=contrail123
#OpenContrail API Server
APISERVER_IP=192.168.56.102
#OpenContrail Plugin
Q_PLUGIN=opencontrail
PHYSICAL_INTERFACE=eth1

# proto for openstack bits. Use HTTPS if git is firewalled
GIT_BASE=https://git.openstack.org

#OpenContrail nova plugin
NOVA_VIF_DRIVER=nova_contrail_vif.contrailvif.VRouterVIFDriver

6)
Sample localrc files

https://github.com/Juniper/contrail-installer/blob/600d4db0ef99f570b475e5e5241ff3c746987acd/devstack/samples/localrc-all


https://raw.githubusercontent.com/Juniper/contrail-installer/4a29ccdd61c7d19a595a89031ce59601b0fed59a/devstack/samples/localrc-ci


7)
Then run ./stack.sh



Monday, April 20, 2015

[Solved] cannot verify raw.github.com's certificate, issued by

0)
First Delete/rename /etc/ssl/certs

1)
Try to download github file using wget.

ERROR: cannot verify github.com's certificate, issued by ‘/C=US/O=DigiCert Inc/OU=www.digicert.com/CN=DigiCert SHA2 Extended Validation Server CA’: Unable to locally verify the issuer's authority.

$wget https://raw.githubusercontent.com/sajuptpm/mytools/master/.gitignore
--2015-04-20 17:16:53--  https://raw.githubusercontent.com/sajuptpm/mytools/master/.gitignore
Resolving raw.githubusercontent.com (raw.githubusercontent.com)... 199.27.74.133
Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|199.27.74.133|:443... connected.
ERROR: cannot verify raw.githubusercontent.com's certificate, issued by ‘/C=US/O=DigiCert Inc/OU=www.digicert.com/CN=DigiCert SHA2 High Assurance Server CA’:
  Unable to locally verify the issuer's authority.
To connect to raw.githubusercontent.com insecurely, use `--no-check-certificate'.

2)
Download DigiCert Root Certificate "DigiCert High Assurance EV Root CA" from following site.
https://www.digicert.com/digicert-root-certificates.htm

#cd /ets/ssl
#mkdir certs
#cd /etc/ssl/certs
#sudo wget https://www.digicert.com/CACerts/DigiCertHighAssuranceEVRootCA.crt --no-check-certificate

* At this point, Try "Step-1" again and you will get same error.

2)
Unfortunately these are encoded and need to be converted into text.

#cd /etc/ssl/certs
#sudo openssl x509 -inform DES -in DigiCertHighAssuranceEVRootCA.crt -out DigiCertHighAssuranceEVRootCA.crt -text

* At this point, Try "Step-1" again and you will get same error.

3)
Check
#ls -a
.  ..  .0 DigiCertHighAssuranceEVRootCA.crt

* You can see a hidden file named ".0", you can open it in vim editor, that contains a certificate key.
* At this point, Try "Step-1" again and you will get same error.

4)
The final step is running c_rehash within "/etc/ssl/certs" to scan directories and take a hash value of each '.pem' and '.crt' file in the directory. It then creates symbolic links for each of the files named by the hash value. Programs on the system (like curl or wget) expect to find the certificates they require in this c_rehash'ed format.

#sudo c_rehash /etc/ssl/certs
OR
#cd /etc/ssl/certs
#sudo c_rehash .

* At this point, Try "Step-1" again and you will not get any error.

5)
Check
#ls -a
.  ..  .0  244b5494.0  81b9768f.0  DigiCertHighAssuranceEVRootCA.crt

* Now you can see two new files named "244b5494.0" and "81b9768f.0",  you can open it in vim editor, that contains a certificate key.


6)
$ wget https://raw.githubusercontent.com/sajuptpm/mytools/master/.gitignore
--2015-04-20 17:24:47--  https://raw.githubusercontent.com/sajuptpm/mytools/master/.gitignore
Resolving raw.githubusercontent.com (raw.githubusercontent.com)... 199.27.75.133
Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|199.27.75.133|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 15 [text/plain]
Saving to: ‘.gitignore.1’

100%[==========================================================================================================>] 15          --.-K/s   in 0s     

2015-04-20 17:24:48 (294 KB/s) - ‘.gitignore.1’ saved [15/15]


7)
Complete script
#!/bin/bash

cd /etc/ssl/certs
sudo wget https://www.digicert.com/CACerts/DigiCertHighAssuranceEVRootCA.crt --no-check-certificate
sudo openssl x509 -inform DES -in DigiCertHighAssuranceEVRootCA.crt -out DigiCertHighAssuranceEVRootCA.crt -text
sudo c_rehash .





Thursday, April 16, 2015

Citrix Receiver 13.1 on Ubuntu 14.04

1. (64-bit only) Alternative install procedure that can be added to a deployment bash script

http://mark911.wordpress.com/2014/06/27/how-to-install-citrix-receiver-icaclient-in-ubuntu-14-04-lts-64-bit-tested-and-working-using-mozilla-firefox/

2. (64-bit only) Enable i386 Multiarch

Even the Citrix Receiver for 64-bit systems has a lot of dependencies on packages from the i386 architecture. If you are using 64-bit Ubuntu and have not already configured i386 multiarch, you must configure it by running:

sudo dpkg --add-architecture i386
sudo apt-get update


3. Download the Citrix Receiver for Linux .deb package

    Go to https://www.citrix.com/downloads/citrix-receiver/linux/receiver-for-linux-131.html
    Near the bottom of the page, select either "For 64-bit Systems" or "For 32-bit Systems" as appropriate.
    Look for "File Type: .deb" under the Download buttons.
    Download the "Receiver for Linux" package.
    Optionally download the "USB Support Package". This package provides support for passing USB devices from your local Ubuntu machine into the remote Windows session (if your Citrix server is configured to allow that).

4. Install the package(s) and dependencies


sudo dpkg -i ~/Downloads/icaclient_*.deb ctxusb_*.deb
sudo apt-get -f install
  # Install dependencies and finish configuring the package(s)

OR

sudo gdebi ~/Downloads/icaclient_*.deb ctxusb_*.deb


5. Add more SSL certificates

By default, Citrix Receiver only trusts a few root CA certificates, which causes connections to many Citrix servers to fail with an SSL error. The 'ca-certificates' package (already installed on most Ubuntu systems) provides additional CA certificates in /usr/share/ca-certificates/mozilla/ that can be conveniently added to Citrix Receiver to avoid these errors:

a)
Goto mozilla's ca-certificates directory and download your certificates. We need to do this before making soft link to /opt/Citrix/ICAClient/keystore/cacerts/ and rehash it.
cd /usr/share/ca-certificates/mozilla/
wget http://mysite.jpp.com/RootCA_base64.cer
wget http://mysite.jpp.com/MYSiteCA_base64.cer


b)
Make soft link to /opt/Citrix/ICAClient/keystore/cacerts/ and rehash it.
sudo ln -s /usr/share/ca-certificates/mozilla/* /opt/Citrix/ICAClient/keystore/cacerts/
sudo c_rehash /opt/Citrix/ICAClient/keystore/cacerts/


6. Configure Citrix Receiver

Run:

/opt/Citrix/ICAClient/util/configmgr &

To map drives (to allow access to files on your local Ubuntu machine via a share drive in the remote Windows session), see the "File Access" tab.

7. (64-bit only) Fix Firefox plugin installation

Run:

sudo rm -f /usr/lib/mozilla/plugins/npwrapper.npica.so /usr/lib/firefox/plugins/npwrapper.npica.so
sudo rm -f /usr/lib/mozilla/plugins/npica.so
sudo ln -s /opt/Citrix/ICAClient/npica.so /usr/lib/mozilla/plugins/npica.so


Starting with Citrix Receiver 13.1, the 64-bit version of Citrix Receiver switched from a 32-bit plugin (using nspluginwrapper to allow it to run within a 64-bit browser) to a native 64-bit plugin. However, the install script still configures the plugin to run within nspluginwrapper, which doesn't work with a 64-bit plugin. The above will reconfigure the plugin to run without nspluginwrapper.

8. Configure Firefox

In Firefox, go to Tools -> Add-ons -> Plugins, and make sure the "Citrix Receiver for Linux" plugin is set to "Always Activate".

Starting in Firefox 32, plugins are set to "Ask to Activate" by default, but for some reason the activation prompt is never displayed for the Citrix Receiver plugin, so the plugin will not work unless it is set to "Always Activate".

9)
Open Firefox and goto your Citrix App and login, Example:https://y4gapps.cpp.com
Then click on "Enterprise-Desktop" icon.

10)
Ref : https://help.ubuntu.com/community/CitrixICAClientHowTo


Tuesday, April 14, 2015

Troubleshooting the Floating IP Address Pool in Contrail


https://techwiki.juniper.net/Documentation/Contrail/Contrail_Common_Support_Answers/Troubleshooting_the_Floating_IP_Address_Pool_in_Contrail

vRouter Command Line Utilities:
https://techwiki.juniper.net/Documentation/Contrail/Contrail_Controller_Feature_Guide/Optimizing_Contrail/vRouter_Command_Line_Utilities

1)
Create a virtual network (public) from contrail ui with following infos

Virtual network name:         public
subnet 10.204.219.0/24
Public addresses range:     10.204.219.32 to 10.204.219.37
Route Target:                      64512:10003
Floating IP pool name:         public_pool

2)
Create another virtual network (private) from contrail ui with following infos
Virtual network name:         vn1
Subnet:                                10.1.1.0/24

3)
Create a virtual machine in the virtual network VN1 with the name VN1_VM1 and with the IP address 10.1.1.253 from openstack ui.

4)
Allocate a floating ip from contrail ui
https://192.168.56.102:8143/#p=config_net_fip

A floating IP address of 10.204.219.37 is associated to the VN1_VM1 instance from openstack UI.

5)
You can see that, a router is configured in following conrail ui
https://192.168.56.102:8143/#p=config_infra_bgp

6)
Create an another vm "vm_pub" in "public" network from openstack ui.

7)
SSH to "vm_pub" using its link local address and ping/ssh to public ip of VM "VN1_VM1", this should work.

8)
View the BGP Peer Status on the Control Node
Using Contrail U
https://192.168.56.102:8143/#p=mon_infra_control&q[tab]=peers&q[node]=ubuntu

Using the control-node introspect
http://192.168.56.102:8083/Snh_BgpNeighborReq?ip_address=&domain=

9)
Query Routes in the Public Virtual Network named "public"
Using Contrail U
https://192.168.56.102:8143/#p=mon_infra_control&q[tab]=routes&q[node]=ubuntu

Using the control-node introspect
http://192.168.56.102:8083/Snh_ShowRouteReq?x=default-domain:admin:public:public.inet.0

10)
Query Routes in the Private Virtual Network named "vn1"
Using Contrail U
https://192.168.56.102:8143/#p=mon_infra_control&q[tab]=routes&q[node]=ubuntu

Using the control-node introspect
http://192.168.56.102:8083/Snh_ShowRouteReq?x=default-domain:admin:vn1:vn1.inet.0

11)
View Corresponding BGP L3VPN Routes
Using Contrail U
https://192.168.56.102:8143/#p=mon_infra_control&q[tab]=routes&q[node]=ubuntu

Using the control-node introspect
http://192.168.56.102:8083/Snh_ShowRouteReq?x=bgp.l3vpn.0

12)
View Routing Instance Next Hops
Using Contrail UI
https://192.168.56.102:8143/#p=mon_infra_vrouter&q[tab]=routes&q[node]=ubuntu
Alternatively, from the agent introspect.
http://192.168.56.102:8085/Snh_VrfListReq?x=default-domain:admin:public:public

13)
Next, perform a route request query on ucindex 2, as shown in the following. The tunnel detail indicates the source and destination endpoints of the tunnel and the MPLS label 16 (the label of the virtual machine).
The query should also show a route for 10.204.219.37 with an interface next hop of tap-interface.
From the agent introspect.
http://192.168.56.102:8085/Snh_Inet4UcRouteReq?x=2

14)
Getting Details of the tap-interface

Using Contrail UI
https://192.168.56.102:8143/#p=mon_infra_vrouter&q[tab]=interfaces&q[node]=ubuntu

Alternatively, from the agent introspect.
http://192.168.56.102:8085/Snh_ItfReq?x=tap118cdbd5-60

15)
Advanced Troubleshooting

a)

Check to see if  any packet drops occur in the kernel vrouter module:
From the agent introspect.
http://192.168.56.102:8085/Snh_KDropStatsReq?



Difference between Route-Distinguisher (RD) & Route-Target (RT)



Difference between Route Distinguisher (RD) & Route Target (RT)
http://ccieblog.co.uk/mpls/difference-between-the-rd-and-rt


Friday, April 10, 2015

Wednesday, April 8, 2015

OpenContrail vhost0 and pkt0

vhost0 is a virtual interface that is provided to the host OS; This is similar to when bridging is enabled in the linux kernel and a virtual "br0" interface is created. The physical interface is controlled by the vrouter kernel module and vhost0 is an interface that allows the host OS to access the network.

pkt0 is an interface created to deliver packets and packet headers between the vrouter and its user space agent. In normal operation, when security-groups or network policy is in use, packet headers are sent to the agent for the agent to apply ACLs. There are also several classes of packets that are delivered to the agent: ARP, DHCP, metadata-proxy, ...





Tuesday, April 7, 2015

Opencontrail Create Virtual Gateway and Access VM using Private/Fixed IP

Create Virtual Gateway dynamically by sending thrift messages to the vrouter agent

Notes:
* Floating-ip and simple gateway are two orthogonal features.

* Simple gateway let's the virtual machines access underlay network. The access is provided by selective leaking of routes between vrf for virtual network and underlay network. No NAT is involved here.

* Floating-ip allows a VM to borrow IP address from another network. 1:1 NAT is done by vrouter for communication between VM and the borrowed virtual network.

Imp Links: 
https://github.com/Juniper/contrail-controller/wiki/Simple-Gateway

vRouter Command Line Utilities:
https://techwiki.juniper.net/Documentation/Contrail/Contrail_Controller_Feature_Guide/Optimizing_Contrail/vRouter_Command_Line_Utilities

https://github.com/Juniper/contrail-controller/blob/master/src/vnsw/agent/README

0)
* I have created a virtual network named "nw1" with subnet "172.168.56.0/24".
* Then, Created a VM in network "nw1" and the VM got the private IP 172.168.56.3.
* Now I want to Ping and SSH to the VM's private IP 172.168.56.3 from the Host machine's network 192.168.56.0/24. For this we have to do following steps.

1)
Find VGW Provision script
$find /usr -name provision_vgw_interface.py
/usr/share/contrail-utils/provision_vgw_interface.py

$ls /usr/lib/python2.7/dist-packages/contrail_vrouter_api/gen_py/instance_service/

2)
login as root user

$su - root

3)
Export path
#export PYTHONPATH=/usr/lib/python2.7/dist-packages/contrail_vrouter_api/gen_py/instance_service

4)
Run VGW Provison script
#python /opt/contrail/utils/provision_vgw_interface.py --oper create --interface vgw1 --subnets 172.168.56.0/24 --routes 192.168.56.0/24 10.0.2.0/24 8.8.8.0/24 9.9.9.0/24 --vrf default-domain:admin:nw1:nw1

Creating virtual-gateway ...
/usr/bin/vif --create vgw1 --mac 00:01:00:5e:00:00
ifconfig vgw1 up
route add -net 172.168.56.0/24 dev vgw1
Done creating virtual-gateway...

----Points----

a) Here "172.168.56.0/24" is the CIDR of the subnet created in the virtual network nw1.
b) Here "192.168.56.0/24" is the network of interface "vhost0" in the compute node. I want to reach compute node from the VM, So i have given it in --routes option.
c) Here "10.0.2.0/24" is the network of interface "eth0" in the compute node. I want to reach compute node from the VM, So i have given it in --routes option.
d) IP of the "vhost0" interface in the compute node is "192.168.56.102"
e) IP of the "eth0" interface in the compute node is "10.0.2.15"
f) Option --subnets specifies list of subnets defined in virtual-network nw1
g) Option --routes specifies routes in public-network injected into nw1. In example above, the Virtual machines in nw1 can access subnets 8.8.8.0/24, 9.9.9.0/24 and 192.168.56.0/24 in the Host machine's network (public network).

5)

Test the setup.
Ping and ssh work from compute node (192.168.56.102) to VM using private IP (172.168.56.3) of the VM.
Ping and ssh work from VM to compute node (192.168.56.102)

6)
Delete the changes.
* This settings will lost, If the vrouter agent restarts or if the compute node reboots.
* You can manualy delete this settings with following command
$python /opt/contrail/utils/provision_vgw_interface.py --oper delete --interface vgw1 --subnets 172.168.56.0/24


7)
Infos from compute node (192.168.56.102)

a)
Configuration "vgw1" gateway interface from compute node

$ ifconfig
vgw1      Link encap:Ethernet  HWaddr 00:01:00:5e:00:00 
          inet6 addr: fe80::201:ff:fe5e:0/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:195 errors:0 dropped:0 overruns:0 frame:0
          TX packets:240 errors:0 dropped:5 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:22854 (22.8 KB)  TX bytes:24922 (24.9 KB)

b)
Configuration "vgw1" gateway interface from compute node

$ vif --list
vif0/5      OS: vgw1
            Type:Gateway HWaddr:00:01:00:5e:00:00 IPaddr:0
            Vrf:1 Flags:L3 MTU:1514 Ref:2
            RX packets:240  bytes:24894 errors:0
            TX packets:195  bytes:22854 errors:0

c)
Configuration "eth0", "eth1" and "vhost0" interface from compute node

$ifconfig eth0
eth0      Link encap:Ethernet  HWaddr 08:00:27:65:a3:4e 
          inet addr:10.0.2.15  Bcast:10.0.2.255  Mask:255.255.255.0
          inet6 addr: fe80::a00:27ff:fe65:a34e/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:607 errors:0 dropped:0 overruns:0 frame:0
          TX packets:693 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:57547 (57.5 KB)  TX bytes:60247 (60.2 KB)

$ifconfig eth1
eth1      Link encap:Ethernet  HWaddr 08:00:27:22:8e:16 
          inet6 addr: fe80::a00:27ff:fe22:8e16/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:19205 errors:0 dropped:0 overruns:0 frame:0
          TX packets:17793 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:1529138 (1.5 MB)  TX bytes:2711067 (2.7 MB)

$ifconfig vhost0
vhost0    Link encap:Ethernet  HWaddr 08:00:27:22:8e:16 
          inet addr:192.168.56.102  Bcast:192.168.56.255  Mask:255.255.255.0
          inet6 addr: fe80::a00:27ff:fe22:8e16/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:19497 errors:0 dropped:0 overruns:0 frame:0
          TX packets:18022 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:1557182 (1.5 MB)  TX bytes:2734972 (2.7 MB)

d)
Route table form compute node

$route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         10.0.2.2        0.0.0.0         UG    100    0        0 eth0
10.0.2.0        0.0.0.0         255.255.255.0   U     0      0        0 eth0
169.254.0.3     0.0.0.0         255.255.255.255 UH    0      0        0 vhost0
169.254.0.4     0.0.0.0         255.255.255.255 UH    0      0        0 vhost0
172.168.56.0    0.0.0.0         255.255.255.0   U     0      0        0 vgw1 <==IMP
192.168.56.0    0.0.0.0         255.255.255.0   U     0      0        0 vhost0
192.168.122.0   0.0.0.0         255.255.255.0   U     0      0        0 virbr0

e)
Search for IP 172.168.56.x routes table of VRF 0

$rt --dump 0  | grep 172.168.56
Kernel IP routing table 0/1/unicast
Destination            PPL        Flags        Label        Nexthop
172.168.56.0/24          24           HT            -              2

f)
Search for IP 172.168.56.3 and 172.168.56.4 in routes table of VRF 1

$ rt --dump 1  | grep 172.168.56.3
Kernel IP routing table 0/1/unicast
Destination            PPL        Flags        Label        Nexthop
172.168.56.3/32          32            H            -              8


$ rt --dump 1  | grep 172.168.56.4
Kernel IP routing table 0/1/unicast
Destination            PPL        Flags        Label        Nexthop
172.168.56.4/32          32            H            -             15

g)
Find Next hub info

$ nh --get 2
Id:002  Type:Receieve  Fmly: AF_INET  Flags:Valid, Policy(R),   Rid:0  Ref_cnt:5
    Oif:1

$ nh --get 8
Id:008  Type:Encap     Fmly: AF_INET  Flags:Valid, Policy,   Rid:0  Ref_cnt:4
    EncapFmly:0806 Oif:3 Len:14 Data:02 72 e3 89 8f 11 00 00 5e 00 01 00 08 00

$ nh --get 15
Id:015  Type:Encap     Fmly: AF_INET  Flags:Valid, Policy,   Rid:0  Ref_cnt:4
    EncapFmly:0806 Oif:4 Len:14 Data:02 5b a2 39 ed e1 00 00 5e 00 01 00 08 00

h)
Capture Flow table entries
From compute node Run "ping 172.168.56.3" in one terminal and Run "flow -l" in another terminal to capture the flows.

#flow -l
Flow table

 Index              Source:Port           Destination:Port        Proto(V)
-------------------------------------------------------------------------
185912               10.0.2.15:30857        172.168.56.3:0        1 (1)
    (K(nh):17, Action:F, S(nh):17,  Statistics:63/5292 UdpSrcPort 54744)

215132            172.168.56.3:30857           10.0.2.15:0        1 (1)
    (K(nh):7, Action:F, S(nh):7,  Statistics:63/5292 UdpSrcPort 51077)


Notes:
* Here we ping from compute node to VM (172.168.56.3).
* In Flow table, source is "10.0.2.15" that is actually the IP of "eth0" interface in the compute node.

i)
Flow table entries, when you SSH to VM (172.168.56.3) from Compute node
and ping to compute node's "vhost0" (192.168.56.102) interface from the VM (172.168.56.3).

$flow -l
Flow table

 Index              Source:Port           Destination:Port        Proto(V)
-------------------------------------------------------------------------
 12744            172.168.56.4:22              10.0.2.15:53308    6 (1)
    (K(nh):13, Action:F, S(nh):13,  Statistics:137/17902 UdpSrcPort 61994)

 29704            172.168.56.4:14593      192.168.56.102:0        1 (1)
    (K(nh):13, Action:F, S(nh):13,  Statistics:56/4704 UdpSrcPort 52697)

164716            192.168.56.102:14593        172.168.56.4:0        1 (1)
    (K(nh):17, Action:F, S(nh):17,  Statistics:56/4704 UdpSrcPort 61906)

496808               10.0.2.15:53308        172.168.56.4:22       6 (1)
    (K(nh):17, Action:F, S(nh):17,  Statistics:177/13837 UdpSrcPort 64809)

8)
Debugging

a)
Find "tap" interface in the host which connect VM to host.
* Name of the "tap" interface is constructed by using first 10 characters in the ID of port attached to the VM.
* You can find the ports using neutron command "#neutron port-list"
* For example: ID of port is "5ba239ed-e143-446a-ad1a-794869ccfbfe",
then you can find a "tap" interface named "tap5ba239ed-e1" in compute host. You can use "ifconfig" command to find it.

b)
Capture packets from interfaces using tshark

Capture packets from tap interface "tap5ba239ed-e1"
#sudo tshark -i tap5ba239ed-e1 -f "icmp"

Capture packets from gateway interface "vgw1"
#sudo tshark -i vgw1 -f "icmp"

Capture packets from "vhost0" inet-interface
#sudo tshark -i vhost0 -f "icmp"


========Code==========


1)
#vim /usr/share/contrail-utils/provision_vgw_interface.py

import os
import sys
import argparse
import ConfigParser

from thrift.Thrift import TApplicationException, TException
from thrift.transport import TTransport, TSocket
from thrift.protocol import TBinaryProtocol, TProtocol
from netaddr.ip import IPNetwork
import InstanceService
import ttypes

from vnc_api.vnc_api import *


class ProvisionVgwInterface(object):

    def __init__(self, args_str=None):
        self._args = None
        if not args_str:
            args_str = ' '.join(sys.argv[1:])
        self._parse_args(args_str)

        # Connect to thrift service
        try:
            socket = TSocket.TSocket("localhost", 9090)
            transport = TTransport.TFramedTransport(socket)
            transport.open()
            protocol = TBinaryProtocol.TBinaryProtocol(transport)
            service = InstanceService.Client(protocol) <===IMP
        except TApplicationException:
            print "Error connecting to agent thrift service"
            return

        if self._args.oper == "create":
            print "Creating virtual-gateway ..."

            with open("/proc/sys/net/ipv4/ip_forward", "w") as file:
                file.write("1") <===IMP

            vif_command = '/usr/bin/vif --create ' + self._args.interface <===IMP
            vif_command += ' --mac 00:01:00:5e:00:00'
            self.execute_command(vif_command)

            ifconfig_command = 'ifconfig ' + self._args.interface + ' up' <===IMP
            self.execute_command(ifconfig_command)

            for subnet in self._args.subnets:
                route_command = 'route add -net ' + subnet <===IMP
                route_command += ' dev ' + self._args.interface
                self.execute_command(route_command)

            subnet_list = []
            for subnet in self._args.subnets: <===IMP
                net = IPNetwork(subnet)
                subnet_list.append(ttypes.Subnet(str(net.ip), net.prefixlen))

            route_list = []
            for subnet in self._args.routes: <===IMP
                net = IPNetwork(subnet)
                route_list.append(ttypes.Subnet(str(net.ip), net.prefixlen))

            gw = ttypes.VirtualGatewayRequest(self._args.interface, self._args.vrf,
                                              subnet_list, route_list)
            gw_list = [ gw ]
            try:
                service.AddVirtualGateway(gw_list) <===IMP
            except TApplicationException:
                print "Error: Error adding VGW interface"
                return
            print "Done creating virtual-gateway..."


2)
#vim /usr/lib/python2.7/dist-packages/contrail_vrouter_api/gen_py/instance_service/InstanceService.py

class Client(Iface):
  def __init__(self, iprot, oprot=None):
    self._iprot = self._oprot = iprot
    if oprot is not None:
      self._oprot = oprot
    self._seqid = 0

  def AddVirtualGateway(self, vgw_list): <===IMP
    """
    Parameters:
     - vgw_list
    """
    self.send_AddVirtualGateway(vgw_list)
    return self.recv_AddVirtualGateway()

  def send_AddVirtualGateway(self, vgw_list):
    self._oprot.writeMessageBegin('AddVirtualGateway', TMessageType.CALL, self._seqid)
    args = AddVirtualGateway_args()
    args.vgw_list = vgw_list
    args.write(self._oprot)
    self._oprot.writeMessageEnd()
    self._oprot.trans.flush()

  def recv_AddVirtualGateway(self, ):
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
    if mtype == TMessageType.EXCEPTION:
      x = TApplicationException()
      x.read(self._iprot)
      self._iprot.readMessageEnd()
      raise x
    result = AddVirtualGateway_result()
    result.read(self._iprot)
    self._iprot.readMessageEnd()
    if result.success is not None:
      return result.success
    raise TApplicationException(TApplicationException.MISSING_RESULT, "AddVirtualGateway failed: unknown result");