Support Support Downloads Knowledge Base Juniper Support Portal Community

Knowledge Base

Search our Knowledge Base sites to find answers to your questions.

Ask All Knowledge Base Sites All Knowledge Base Sites JunosE Defect (KA)Knowledge BaseSecurity AdvisoriesTechnical BulletinsTechnotes Sign in to display secure content and recently viewed articles

[Contrail] How to check the active controller to which vRouter agent is connected to in a HA setup

0

0

Article ID: KB36176 KB Last Updated: 26 Aug 2020Version: 1.0
Summary:

A HA deployment of Contrail requires at least two control nodes, three config nodes (including analytics and webui) and three database nodes.

The protocol between the Contrail SDN Controller and the Contrail vRouters is based on XMPP.
The Contrail controller exchange routes with the vRouter agents on the compute nodes using XMPP. They also use XMPP to send configuration state such as routing instances and forwarding policy. 

Each vRouter agent connects to two or more control nodes where all control nodes are in active/active state. The vRouter agent receives all its state (routes, routing instance configuration, etc.) from each of the control nodes.

The vrouter makes a local determination about which copy of the control state to use.

This article explains how to check the active controller wrt a compute node where vrouter is running.

Solution:
To find out which is the active controller wrt a voruter agent, use the following introspect:
  • Run the curl command below from the compute node.
  • The introspect will show the controllers to which the vrouter is connected to.
  • From the output below, there is "controller_ip identifier" which is the controller IPs.
root@CFTSBM5CMP:~# curl http://127.0.0.1:8085/Snh_AgentXmppConnectionStatusReq | python -c "import sys;import xml.dom.minidom;s=sys.stdin.read();print xml.dom.minidom.parseString(s).toprettyxml()"

<?xml version="1.0" ?>
<?xml-stylesheet type="text/xsl" href="/universal_parse.xsl"?>
<AgentXmppConnectionStatus type="sandesh">
        <peer identifier="1" type="list">
                <list size="2" type="struct">
                        <AgentXmppData>
                                <controller_ip identifier="1" type="string">192.168.10.134</controller_ip>
                                <state identifier="2" type="string">Established</state>
                                <peer_name identifier="3" type="string">network-control@contrailsystems.com</peer_name>
                                <peer_address identifier="4" type="string">192.168.10.134:5269</peer_address>
                                <cfg_controller identifier="5" type="string">Yes</cfg_controller>
                                <mcast_controller identifier="6" type="string">Yes</mcast_controller>
                                <last_state identifier="7" type="string">OpenSent</last_state>
                                <last_event identifier="8" type="string">xmsm::EvXmppKeepalive</last_event>
                                <last_state_at identifier="9" type="string">2020-Jul-28 05:53:07.491759</last_state_at>
                                <flap_count identifier="10" type="u32">0</flap_count>
                                <flap_time identifier="11" type="string"/>
                                <rx_proto_stats identifier="12" type="struct">
                                        <ControllerProtoStats>
                                                <open identifier="1" type="u32">1</open>
                                                <keepalive identifier="2" type="u32">37527</keepalive>
                                                <update identifier="3" type="u32">10</update>
                                                <close identifier="4" type="u32">0</close>
                                        </ControllerProtoStats>
                                </rx_proto_stats>
                                <tx_proto_stats identifier="13" type="struct">
                                        <ControllerProtoStats>
                                                <open identifier="1" type="u32">1</open>
                                                <keepalive identifier="2" type="u32">37512</keepalive>
                                                <update identifier="3" type="u32">14</update>
                                                <close identifier="4" type="u32">0</close>
                                        </ControllerProtoStats>
                                </tx_proto_stats>
                                <xmpp_auth_type identifier="14" type="string">NIL</xmpp_auth_type>
                        </AgentXmppData>
                        <AgentXmppData>
                                <controller_ip identifier="1" type="string">192.168.10.133</controller_ip>
                                <state identifier="2" type="string">Established</state>
                                <peer_name identifier="3" type="string">network-control@contrailsystems.com</peer_name>
                                <peer_address identifier="4" type="string">192.168.10.133:5269</peer_address>
                                <cfg_controller identifier="5" type="string">No</cfg_controller>
                                <mcast_controller identifier="6" type="string">No</mcast_controller>
                                <last_state identifier="7" type="string">OpenSent</last_state>
                                <last_event identifier="8" type="string">xmsm::EvXmppKeepalive</last_event>
                                <last_state_at identifier="9" type="string">2020-Jul-28 05:53:07.503310</last_state_at>
                                <flap_count identifier="10" type="u32">0</flap_count>
                                <flap_time identifier="11" type="string"/>
                                <rx_proto_stats identifier="12" type="struct">
                                        <ControllerProtoStats>
                                                <open identifier="1" type="u32">1</open>
                                                <keepalive identifier="2" type="u32">37519</keepalive>
                                                <update identifier="3" type="u32">4</update>
                                                <close identifier="4" type="u32">0</close>
                                        </ControllerProtoStats>
                                </rx_proto_stats>
                                <tx_proto_stats identifier="13" type="struct">
                                        <ControllerProtoStats>
                                                <open identifier="1" type="u32">1</open>
                                                <keepalive identifier="2" type="u32">37512</keepalive>
                                                <update identifier="3" type="u32">10</update>
                                                <close identifier="4" type="u32">0</close>
                                        </ControllerProtoStats>
                                </tx_proto_stats>
                                <xmpp_auth_type identifier="14" type="string">NIL</xmpp_auth_type>
                        </AgentXmppData>
                </list>
        </peer>
        <more identifier="0" type="bool">false</more>
</AgentXmppConnectionStatus>

In the output above, look for variable "cfg_controller identifier". If it is "Yes" as shown below, that controller will be the active one . 

For controller 1:

<controller_ip identifier="1" type="string">192.168.10.134</controller_ip>
<cfg_controller identifier="5" type="string">Yes</cfg_controller>

For controller 2 :- <output Snip>
<controller_ip identifier="1" type="string">192.168.10.133</controller_ip>
<cfg_controller identifier="5" type="string">No</cfg_controller>

So controller 1 is the active controller for this vrouter node.

Comment on this article > Affected Products Browse the Knowledge Base for more articles related to these product categories. Select a category to begin.

Getting Up and Running with Junos

Getting Up and Running with Junos Security Alerts and Vulnerabilities Product Alerts and Software Release Notices Problem Report (PR) Search Tool EOL Notices and Bulletins JTAC User Guide Customer Care User Guide Pathfinder SRX High Availability Configurator SRX VPN Configurator Training Courses and Videos End User Licence Agreement Global Search