Hi Ajay,

Good to know about two different context for Api-Server.

For a flow:
global_vrouter_configs_http_post() -> dbe_create()-> dbe_create_publish()
-> cfgm_common/vnc_kombu.py publish()  -> _publisher() -> publishes to
producer (kombu.Producer) on fanout exchange -> self._consumer consumes it
and execute callback function _subscribe -> then call back function
_dbe_subscribe_callback()-> _dbe_create_notification() -> _publish_update()
-> _publish_to_ifmap() -> call_async_result() of cfgm_common/ifmap/client.py

The asynchronous flow will start from _consumer.


On all config nodes, all API-servers (in HA/scaleout deployment), all the
local Ifmap servers should have same data because of asynchronous context ?

the xml data <ifmap:publish> printed out in first mail, would be high-level
data?

and what we see with schema_transformer/ifmap_view.py is low-level data?

Regards,
Yatin

On Wed, Mar 11, 2015 at 7:38 AM, Hampapur Ajay <[email protected]> wrote:

>  Hi Yatin,
>
>  API-server has 2 contexts - a synchronous one (that receives a REST
> request, stores in DB, sends notification on rabbit and returns) and an
> asynchronous one(receives notification from rabbit, sends message to be
> sent to ifmap and returns). This is so that all API-servers (in HA/scaleout
> deployment) end up running same code in asynchronous context to populate
> their local ifmap.
>
>  The code that handles notifications from rabbit is at
>
> https://github.com/Juniper/contrail-controller/blob/master/src/config/api-server/vnc_cfg_ifmap.py#L929
>
>  if you haven't already gone through
>
> https://github.com/Juniper/contrail-controller/wiki/OpenContrail-Internal-Services
> might be useful.
>
>  Thanks
> ajay
>  On Mar 10, 2015, at 5:20 AM, yatin kumbhare wrote:
>
>  Hello Folks,
>
>  I'm trying to understand vnc_cfg_api_server code.
>
>  Api-server publish data to if-map server over http connection.
>
>  <ifmap:publish session-id="428807018-796627615-267532699-1939915597"
> ><update lifetime="forever" ><identity
> name="contrail:project:default-domain:demo" type="other"
> other-type-definition="extended" /><identity
> name="contrail:network-ipam:default-domain:demo:fake-ipam" type="other"
> other-type-definition="extended" /><metadata><contrail:project-network-ipam
> ifmap-cardinality="singleValue"
> ></contrail:project-network-ipam></metadata></update></ifmap:publish>
>
>  Rabbitmq does create exchange/queue:
> vnc_config.object-update / vnc_config.billy-8082
>
>  and publish data:
> {'oper': 'CREATE', 'imid':
> 'contrail:network-ipam:default-domain:demo:fake-ipam', 'uuid':
> '79e15bc3-6ed8-4572-95c0-9935c0cfddf9', 'parent_imid':
> 'contrail:project:default-domain:demo', 'request-id':
> 'req-d3b39091-12fa-4e6c-a840-8a0e29429645', 'type': 'network-ipam',
> 'obj_dict': {'fq_name': ['default-domain', 'demo', 'fake-ipam'],
> 'parent_uuid': 'e90dbf97-6d78-4dad-bbb6-dbfa3385b2c8', 'ipam_method': None,
> 'parent_type': 'project', 'network_ipam_mgmt': {'ipam_dns_method':
> 'default-dns-server', 'ipam_dns_server': {'tenant_dns_server_address': {},
> 'virtual_dns_server_name': None}}, 'id_perms': {u'enable': True, u'uuid':
> {'uuid_mslong': 8782401643285595506L, 'uuid_lslong':
> 10790793163326873081L}, u'creator': None, u'created':
> '2015-03-10T11:15:36.873492', u'user_visible': True, u'last_modified':
> '2015-03-10T11:15:36.873492', u'permissions': {u'owner': u'cloud-admin',
> u'owner_access': 7, u'other_access': 7, u'group': 'admin', u'group_access':
> 7}, u'description': None}, 'display_name': 'fake-ipam', 'virtual_DNS_refs':
> [], 'uuid': '79e15bc3-6ed8-4572-95c0-9935c0cfddf9'}}
>
>  I'm unable to locate the code, which is consumer for this rabbit message.
>
>  Can somebody please explain, the role of rabbitmq in config-node and
> reference to code?
>
>  Regards,
> Yatin
>  _______________________________________________
> Dev mailing list
> [email protected]
> http://lists.opencontrail.org/mailman/listinfo/dev_lists.opencontrail.org
>
>
>
_______________________________________________
Dev mailing list
[email protected]
http://lists.opencontrail.org/mailman/listinfo/dev_lists.opencontrail.org

Reply via email to