Vcenter plugin to vrouter rest interface

Registered by Rudra Rugge

Currently vcenter plugin uses Thrift connections to each of the vrouters. This will be replaced with the new REST API provided by the vrouter agent.


Vcenter plugin will re-use the code from java-api library for interactions with both vrouter agent and Contrail's API server.

Since Thrift will be removed, vcenter-plugin will need to serialize Port objects in json.

VCenter plugin will send upon restart a special sync/connect request to vrouter agent.

Add/Delete REST requests will contain a field called "port_type=2", to indicate the client is the vcenter-plugin.

Vrouter-agent will save all the added ports info in a file, and it will read it upon its restart. From the vcenter-plugin's perspective, add/delete operations are atomic, and vrouter-agent will return success only after the port has been saved.

Vcenter plugin will implement a retry mechanism for failed REST requests.

- Vcenter plugin restart case:
After vcenter-plugin is restarted, it will send a sync/connect request. If vrouter-agent receives the sync request, it will mark all the ports as “NOT seen”. Vcenter-plugin will send “Add” requests for all ports already present. When vrouter-agent receives “Add” for a port, it will mark the port as “Seen”. After a timeout since the reception of sync request, vrouter-agent will delete all the ports for which it has not seen “Add” (Ports still in “NOT seen” state).

-Vrouter-agent restart case:
Vrouter-agent saves all the added ports info in a file, which is read upon vrouter-agent restarts.
While vrouter-agent is down, if the vcenter-plugin sends any REST request, the request will fail. Vcenter-plugin will add all the failed ports to a retry list.

Test impact
Following scenarios need to be covered by testing:
- Plugin start with empty ports
- Plugin restart with empty ports
- Add port
- Delete port
- Plugin restart with active ports
- Vrouter crash/stop, add one port, vrouter start
- Vrouter crash/stop, delete one port, vrouter start
- Vrouter crash/stop, add several ports, vrouter start
- Vrouter crash/stop, delete several ports, vrouter start
- Plugin stop, add port , plugin start
- Plugin stop, delete port , plugin start

Blueprint information

Rudra Rugge
Rudra Rugge
Andra Cismaru
Series goal:
Accepted for r3.1
Milestone target:
milestone icon r3.1.0.0-fcs
Started by
Rudra Rugge
Completed by
Rudra Rugge

Related branches




Work Items

This blueprint contains Public information 
Everyone can see this information.


No subscribers.