Contrail Analytics Troubleshooting Guide
Contrail Analytics Troubleshooting Guide
RELEASE
Published
21.4
2023-07-13
ii
Juniper Networks, the Juniper Networks logo, Juniper, and Junos are registered trademarks of Juniper Networks, Inc.
in the United States and other countries. All other trademarks, service marks, registered marks, or registered service
marks are the property of their respective owners.
Juniper Networks assumes no responsibility for any inaccuracies in this document. Juniper Networks reserves the right
to change, modify, transfer, or otherwise revise this publication without notice.
The information in this document is current as of the date on the title page.
Juniper Networks hardware and software products are Year 2000 compliant. Junos OS has no known time-related
limitations through the year 2038. However, the NTP application is known to have some difficulty in the year 2036.
The Juniper Networks product that is the subject of this technical documentation consists of (or is intended for use
with) Juniper Networks software. Use of such software is subject to the terms and conditions of the End User License
Agreement ("EULA") posted at https://support.juniper.net/support/eula/. By downloading, installing or using such
software, you agree to the terms and conditions of that EULA.
iii
Table of Contents
About This Guide | xii
Physical Topology | 11
SNMP Configuration | 12
pRouter UVEs | 15
Trace Flows | 18
Analytics Scalability | 32
Overview | 35
vif Command | 36
clear Command | 41
flow Command | 41
vrfstats Command | 43
rt Command | 44
dropstats Command | 45
mpls Command | 49
mirror Command | 51
vxlan Command | 53
nh Command | 55
dpdkinfo Command | 58
dpdkconf Command | 67
Overview | 104
v
Role- and Resource-Based Access Control for the Contrail Analytics API | 125
Setting Up Traffic Mirroring Using Configure > Networking > Services | 144
Using the Wireshark Plugin to Analyze Packets Between vRouter and vRouter Agent on pkt0
Interface | 157
Mapping VLAN Tags from a Physical NIC to a VMI (NIC-Assisted Mirroring) | 162
Viewing Telemetry KPI Alarms for Fabric Devices and Ports | 352
Adding, Editing, and Deleting sFlow Collector Nodes in Contrail Command | 362
Example | 443
Overview | 479
Contrail Analytics Application Programming Interfaces (APIs) and User-Visible Entities (UVEs) | 499
x
Incompatibilities | 525
Use this guide to understand Contrail Insights (formerly AppFormix) and Contrail Networking analytics.
Contrail Insights provides monitoring availability of the Contrail Networking control plane services.
Contrail Networking analytics nodes are responsible for the collection of system state information,
usage statistics, and debug information from all of the software modules across all of the nodes of the
system.
Contrail Networking product documentation is organized into multiple guides as shown in Table 1 on
page xii, according to the task you want to perform or the deployment scenario.
Contrail Networking Installation Provides step-by-step instructions to install and bring up Contrail and its
and Upgrade Guide various components.
Contrail Networking for Provides information about installing and using Contrail Networking in
Container Networking containerized environments using Kubernetes orchestration.
Environments User Guide
Contrail Networking Fabric Provides information about Contrail underlay management and data center
Lifecycle Management Guide automation.
Contrail Networking and Provides information about creating and orchestrating highly secure virtual
Security User Guide networks.
Contrail Networking Service Provides information about the features that are used by service providers.
Provider Focused Features
Guide
Contrail Networking Provides information about Contrail Insights and Contrail analytics.
Monitoring and
Troubleshooting Guide
xiii
RELATED DOCUMENTATION
CHAPTER 1
IN THIS CHAPTER
Contrail is a distributed system of compute nodes, control nodes, configuration nodes, database nodes,
web UI nodes, and analytics nodes.
The analytics nodes are responsible for the collection of system state information, usage statistics, and
debug information from all of the software modules across all of the nodes of the system. The analytics
nodes store the data gathered across the system in a database that is based on the Apache Cassandra
open source distributed database management system. The database is queried by means of an SQL-like
language and representational state transfer (REST) APIs.
System state information collected by the analytics nodes is aggregated across all of the nodes.
Debug information collected by the analytics nodes includes the following types:
• System log (syslog) messages—informational and debug messages generated by system software
components.
• Object log messages—records of changes made to system objects such as virtual machines, virtual
networks, service instances, virtual routers, BGP peers, routing instances, and the like.
• Trace messages—records of activities collected locally by software components and sent to analytics
nodes only on demand.
Statistics information related to flows, CPU and memory usage, and the like is also collected by the
analytics nodes and can be queried to provide historical analytics and time-series information. The
queries are performed using REST APIs.
3
Analytics data is written to a database in Contrail. The data expires after the default time-to-live (TTL)
period of 48 hours. This default TTL time can be changed as needed by changing the value of the
database_ttl value in the cluster configuration.
RELATED DOCUMENTATION
IN THIS SECTION
Contrail alerts are provided on a per-user visible entity (UVE) basis. Contrail analytics raise or clear alerts
using Python-coded rules that examine the contents of the UVE and the configuration of the object.
Some rules are built in. Others can be added using Python stevedore plugins.
For example:
GET http://<analytics-ip>:8081/analytics/alarms
{
analytics-node: [
{
name: "nodec40",
value: {
UVEAlarms: {
alarms: [
{
any_of: [
{
all_of: [
{
json_operand1_value: ""PROCESS_STATE_STOPPED"",
rule: {
oper: "!=",
operand1: {
keys: [
"NodeStatus",
"process_info",
"process_state"
]
},
operand2: {
json_value: ""PROCESS_STATE_RUNNING""
}
},
json_vars: {
NodeStatus.process_info.process_name: "contrail-
topology"
}
5
}
]
}
],
severity: 3,
ack: false,
timestamp: 1457395052889182,
token: "eyJ0aW1lc3RhbXAiOiAxNDU3Mzk1MDUyODg5MTgyLCAiaHR0cF9wb3J0I
................................... jogNTk5NSwgImhvc3RfaXAiOiAiMTAuMjA0LjIxNy4yNCJ9",
type: "ProcessStatus"
}
]
}
}
}
]
}
In the example:
• An any_of attribute contains alarm rules defined in the format [ [rule1 AND rule2 AND ... AND ruleN] ... OR
[rule11 AND rule22 AND ... AND ruleNN] ]
• Alerts are raised on a per-UVE basis and can be retrieved by a GET on a UVE.
The following examples show the API to use to display alerts and alarms and to acknowledge alarms.
• To retrieve a list of alerts raised against the control node named aXXsYY.
GET http://<analytics-ip>:<rest-api-port>/analytics/uves/control-node/aXXsYY&cfilt=UVEAlarms
GET http://<analytics-ip>:<rest-api-port>/analytics/alarms
6
• To acknowledge an alarm.
POST http://<analytics-ip>:<rest-api-port>/analytics/alarms/acknowledge
Body: {“table”: <object-type>,“name”: <key>, “type”: <alarm type>, “token”: <token>}
Acknowledged and unacknowledged alarms can be queried specifically using the following URL
query parameters along with the GET operations listed previously.
ackFilt=True
ackFilt=False
The following examples show the API to use to retrieve all or portions of SE streams.
• To retrieve an SSE-based stream of UVE updates for the control node alarms.
GET http://<analytics-ip>:<rest-api-port>/analytics/uve-stream?tablefilt=control-node
This is available for all UVE table types. If the tablefilt URL query parameter is not provided, all UVEs
are retrieved.
• To retrieve only the alerts portion of the SSE-based stream of UVE updates instead of the entire
content.
GET http://<analytics-ip>:<rest-api-port>/analytics/alarm-stream?tablefilt=control-node
This is available for all UVE table types. If the tablefilt URL query parameter is not provided, all UVEs
are retrieved.
The following built-in node alerts can be retrieved using the APIs listed in Analytics APIs for Alerts.
control‐node: {
PartialSysinfoControl: "Basic System Information is absent for this node in
BgpRouterState.build_info",
ProcessStatus: "NodeMgr reports abnormal status for process(es) in NodeStatus.process_info",
XmppConnectivity: "Not enough XMPP peers are up in BgpRouterState.num_up_bgp_peer",
7
vrouter: {
PartialSysinfoCompute: "Basic System Information is absent for this node in
VrouterAgent.build_info",
ProcessStatus: "NodeMgr reports abnormal status for process(es) in NodeStatus.process_info",
ProcessConnectivity: "Process(es) are reporting non‐functional components in
NodeStatus.process_status",
VrouterInterface: "VrouterAgent has interfaces in error state in VrouterAgent.error_intf_list”,
VrouterConfigAbsent: “Vrouter is not present in Configuration”,
},
config‐node: {
PartialSysinfoConfig: "Basic System Information is absent for this node in
ModuleCpuState.build_info",
ProcessStatus: "NodeMgr reports abnormal status for process(es) in NodeStatus.process_info",
ProcessConnectivity: "Process(es) are reporting non‐functional components in
NodeStatus.process_status"
},
analytics‐node: {
ProcessStatus: "NodeMgr reports abnormal status for process(es) in NodeStatus.process_info"
PartialSysinfoAnalytics: "Basic System Information is absent for this node in
CollectorState.build_info",
ProcessConnectivity: "Process(es) are reporting non‐functional components in
NodeStatus.process_status"
},
database‐node: {
ProcessStatus: "NodeMgr reports abnormal status for process(es) in NodeStatus.process_info",
ProcessConnectivity: "Process(es) are reporting non‐functional components in
NodeStatus.process_status"
},
8
IN THIS SECTION
Physical Topology | 11
SNMP Configuration | 12
pRouter UVEs | 15
Trace Flows | 18
NOTE: This topic applies to Contrail Networking Release 2005 and earlier. Starting in Contrail
Networking Release 2008, you can view the path a packet takes in a network. See "Viewing
Packet Path in Topology View" on page 290.
Today’s cloud data centers consist of large collections of interconnected servers that provide computing
and storage capacity to run a variety of applications. The servers are connected with redundant TOR
switches, which in turn, are connected to spine routers. The cloud deployment is typically shared by
multiple tenants, each of whom usually needs multiple isolated networks. Multiple isolated networks
can be provided by overlay networks that are created by forming tunnels (for example, gre, ip-in-ip, mac-
in-mac) over the underlay or physical connectivity.
As data flows in the overlay network, Contrail can provide statistics and visualization of the traffic in the
underlay network.
A user interface view of the physical underlay network with a drill down mechanism to show
connected servers (contrail computes) and virtual machines on the servers.
You can view details of a pRouter, vRouter, or virtual machine link between two elements. You can
also view traffic statistics in a graphical view corresponding to the selected element.
Given an overlay flow, you can get the underlay path used for that flow and map the path in the
topology view.
The SNMP collector module receives the authorizations and configurations of the physical routers
from the Contrail config module, and polls all of the physical routers, using SNMP protocol. The
collector uploads the data to the Contrail analytics collectors. The SNMP information is stored in the
pRouter UVEs (physical router user visible entities).
2. IPFIX and sFlow protocols are used to collect the flow statistics.
The physical router is configured to send flow statistics to the collector, using one of the collection
protocols: Internet Protocol Flow Information Export (IPFIX) or sFlow (an industry standard for
sampled flow of packet export at Layer 2).
3. The topology module reads the SNMP information.
The Contrail topology module reads SNMP information from the pRouter UVEs from the analytics
API, computes the neighbor list, and writes the neighbor information into the pRouter UVEs. This
neighbor list is used by the Contrail WebUI to display the physical topology.
4. The Contrail user interface reads and displays the topology and statistics.
The Contrail user interface module reads the topology information from the Contrail analytics and
displays the physical topology. It also uses information stored in the analytics to display graphs for
link statistics, and to show the map of the overlay flows on the underlay network.
The contrail-snmp-collector and the contrail-topology are new daemons that are both added to the contrail-
analytics node. The contrail-analytics package contains these new features and their associated files. The
contrail-status displays the new services.
Example: contrail-status
The following is an example of using contrail-status to show the status of the new process and service
for underlay overlay mapping.
user@host:~# contrail-status
== Contrail Control ==
supervisor-control: active
contrail-control active
== Contrail Analytics ==
supervisor-analytics: active
11
contrail-query-engine active
contrail-snmp-collector active
contrail-topology active
The service command can be used to start, stop, and restart the new services. See the following example.
Physical Topology
The typical physical topology includes:
The following is an example of how the topology is depicted in the Contrail WebUI analytics.
12
SNMP Configuration
Configure SNMP on the physical devices so that the contrail-snmp-collector can read SNMP data.
The following shows an example SNMP configuration from a Juniper Networks device.
Configure LLDP on the physical device so that the contrail-snmp-collector can read the neighbor
information of the routers.
Flow samples are sent to the contrail-collector by the physical devices. Because the contrail-collector
supports the sFlow and IPFIX protocols for receiving flow samples, the physical devices, such as MX
Series devices or ToR switches, must be configured to send samples using one of those protocols.
The following shows a sample sFlow configuration. In the sample, the IP variable <source ip>refers to
the loopback or IP that can be reachable of the device that acts as an sflow source, and the other IP
variable <collector_IP_data> is the address of the collector device.
The following is a sample IPFIX configuration from a Juniper Networks device. The IP address variable
<ip_sflow collector> represents the sflow collector (control-collector analytics node) and <source ip>
represents the source (outgoing) interface on the router/switch device used for sending flow data to the
collector. This could also be the lo0 address, if it s reachable from the Contrail cluster.
set forwarding-options sampling instance sample-ins1 family inet output flow-server <ip_sflow
collector> port 4739
set forwarding-options sampling instance sample-ins1 family inet output flow-server <ip_sflow
collector> version-ipfix template t1
set forwarding-options sampling instance sample-ins1 family inet output inline-jflow source-
address <source ip>
The physical routers are added to the contrail-config by using the Contrail user interface or by using
direct API, by means of provisioning or other scripts. Once the configuration is in the contrail-config, the
contrail-snmp-collector gets the physical router information from contrail-config. The SNMP collector uses
this list and the other configuration parameters to perform SNMP queries and to populate pRouter
UVEs.
15
pRouter UVEs
pRouter UVEs are accessed from the REST APIs on your system from contrail-analytics-api, using a URL
of the form:
http://<host ip>:8081/analytics/uves/prouters
Details of a pRouter UVE can be obtained from your system, using a URL of the following form:
16
http://<host ip>:8081/analytics/uves/prouter/a7-ex3?flat
1. Add the following lines to the /etc/contrail/config.global.js file of all the contrail-webui nodes:
config.optFeatureList = {};
config.optFeatureList.mon_infra_underlay = true;
The Physical Topology section is now available on the Contrail Web UI.
Trace Flows
Click the Trace Flows tab to see a list of active flows. To see the path of a flow, click a flow in the active
flows list, then click the Trace Flow button. The path taken in the underlay by the selected flow displays.
The following is an example.
19
Because the Trace Flow feature uses ip traceroute to determine the path between the two vRouters
involved in the flow, it has the same limitations as the ip traceroute, including that Layer 2 routers in the
path are not listed, and therefore do not appear in the topology.
http://<host ip>:8081/analytics/table/OverlayToUnderlayFlowMap/schema
{"type": "FLOW",
"columns": [
{"datatype": "string", "index": true, "name": "o_svn", "select": false, "suffixes": ["o_sip"]},
{"datatype": "string", "index": false, "name": "o_sip", "select": false, "suffixes": null},
{"datatype": "string", "index": true, "name": "o_dvn", "select": false, "suffixes": ["o_dip"]},
{"datatype": "string", "index": false, "name": "o_dip", "select": false, "suffixes": null},
21
{"datatype": "int", "index": false, "name": "o_sport", "select": false, "suffixes": null},
{"datatype": "int", "index": false, "name": "o_dport", "select": false, "suffixes": null},
{"datatype": "string", "index": true, "name": "o_vrouter", "select": false, "suffixes": null},
{"datatype": "string", "index": false, "name": "u_prouter", "select": null, "suffixes": null},
{"datatype": "int", "index": false, "name": "u_pifindex", "select": null, "suffixes": null},
{"datatype": "int", "index": false, "name": "u_vlan", "select": null, "suffixes": null},
{"datatype": "string", "index": false, "name": "u_sip", "select": null, "suffixes": null},
{"datatype": "string", "index": false, "name": "u_dip", "select": null, "suffixes": null},
{"datatype": "int", "index": false, "name": "u_sport", "select": null, "suffixes": null},
{"datatype": "int", "index": false, "name": "u_dport", "select": null, "suffixes": null},
{"datatype": "int", "index": false, "name": "u_protocol", "select": null, "suffixes": null},
{"datatype": "string", "index": false, "name": "u_flowtype", "select": null, "suffixes": null},
{"datatype": "string", "index": false, "name": "u_otherinfo", "select": null, "suffixes": null}]}
The schema for underlay data across pRouters is defined in the Contrail installation at:
http://<host ip>:8081/analytics/table/StatTable.UFlowData.flow/schema
{"type": "STAT",
"columns": [
The following is a typical query. Internally, the analytics-api performs a query into the FlowRecordTable, then
into the StatTable.UFlowData.flow, to return list of (prouter, pifindex) pairs that give the underlay path taken
for the given overlay flow.
FROM
OverlayToUnderlayFlowMap
SELECT
prouter, pifindex
WHERE
The SNMP module sleeps for some configurable period, then forks a collector process and waits for the
process to complete. The collector process goes through a list of devices to be queried. For each device,
it forks a greenlet task (Python coroutine), accumulates SNMP data, writes the summary to a JSON file,
and exits. The parent process then reads the JSON file, creates UVEs, sends the UVEs to the collector,
then goes to sleep again.
The pRouter UVE sent by the SNMP collector carries only the raw MIB information.
The definition below shows the pRouterEntry carried in the pRouterUVE. Additionally, an example LldpTable
definition is shown.
24
http://<host ip>:8081/analytics/table/StatTable.UFlowData.flow/schema
struct LldpTable {
1: LldpLocalSystemData lldpLocalSystemData
struct PRouterEntry {
1: PRouterEntry data
}
25
The pRouter UVE sent by the topology module carries the neighbor list, so the clients can put together
all of the pRouter neighbor lists to compute the full topology.
struct LinkEntry {
1: string remote_system_name
2: string local_interface_name
3: string remote_interface_name
4: RemoteType type
5: i32 local_interface_index
6: i32 remote_interface_index
struct PRouterLinkEntry {
1: PRouterLinkEntry data
}
26
The following definition shows the data stored for the statistics samples and the indices that can be
used to perform queries.
struct UFlowSample {
1: u64 pifindex
2: string sip
3: string dip
4: u16 sport
5: u16 dport
6: u16 protocol
7: u16 vlan
8: string flowtype
9: string otherinfo
struct UFlowData {
System Logs
Logs for contrail-snmp-collector and contrail-topology are in the following locations on an installed Contrail
system:
/var/log/contrail/contrail-snmp-collector-stdout.log
/var/log/contrail/contrail-topology.log
Introspect Utility
Use URLs of the following forms on your Contrail system to access the introspect utilities for SNMP
data and for topology data.
http://<host ip>:5920/Snh_SandeshUVECacheReq?x=PRouterEntry
http://<host ip>:5921/Snh_SandeshUVECacheReq?x=PRouterLinkEntry
The usual mechanism for adding pRouter objects to contrail-config is through Contrail UI. But you also
have the ability to add these objects using the Contrail vnc-api. To add one pRouter, save the file with the
name cfg-snmp.py, and then execute the command as shown:
python cfg-snmp.py
28
#!python
apr = vnc_api.gen.resource_client.PhysicalRouter(name='a7-mx80-1')
apr.set_physical_router_management_ip('ip_address')
apr.set_physical_router_dataplane_ip(''ip_address')
apr.set_physical_router_snmp_credentials(SNMPCredentials(version=2, v2_community='public'))
vnc.physical_router_create(apr)
#$ABC123
apr = vnc_api.gen.resource_client.PhysicalRouter(name='a7-mx80-2')
apr.set_physical_router_management_ip('ip_address')
apr.set_physical_router_dataplane_ip('ip_address')
apr.set_physical_router_snmp_credentials(SNMPCredentials(version=2, v2_community='public'))
vnc.physical_router_create(apr)
#$ABC123'
apr = vnc_api.gen.resource_client.PhysicalRouter(name='a7-ex3')
apr.set_physical_router_management_ip('source_ip')
apr.set_physical_router_dataplane_ip('source_ip'')
29
apr.set_physical_router_snmp_credentials(SNMPCredentials(version=2, v2_community='public'))
vnc.physical_router_create(apr)
#$ABC123'
apr = vnc_api.gen.resource_client.PhysicalRouter(name='a7-ex2')
apr.set_physical_router_management_ip('ip_address')
apr.set_physical_router_dataplane_ip('ip_address')
apr.set_physical_router_snmp_credentials(SNMPCredentials(version=2, v2_community='public'))
vnc.physical_router_create(apr)
#$ABC123'
RELATED DOCUMENTATION
Contrail Networking Release 1910 supports SSL encryption for the connection between Analytics API
servers and Client servers. The Client servers are Service Monitor and Contrail Command, which
connects to the Analytics API server through the REST API Port. In releases prior to release 1910, the
connection between Analytics API servers and the Client servers was not encrypted, which could pose a
security threat.
SSL encryption is supported in Contrail Networking Release 1910 only when Contrail Networking is
deployed with Red Hat OpenStack Platform (RHOSP). In the RHOSP deployment, a global flag is added,
which determines the status of the SSL encryption.
• You do not have to modify the configuration files as SSL encryption is automatically enabled.
• You must modify the configuration files if you want to disable SSL encryption.
30
• You do not have to modify the configuration files as SSL encryption is automatically disabled.
• You cannot enable SSL encryption, even if you modify the configuration files. The certificates are not
generated during deployment as the global flag is disabled.
analytics_api_ssl_enable Enables or disables support If the value is assigned TRUE: Support for SSL
for SSL encryption between encryption is enabled.
Analytics API server and
If the value is assigned FALSE: Support for SSL
Client server.
encryption is not enabled and the Analytics
API server does not accept HTTPS requests.
Once these parameters are configured, the Analytics API server starts using SSL certificates, which
enables SSL encryption support for connection between Analytics API servers and Client servers.
31
Release Description
1910 Contrail Networking Release 1910 supports SSL encryption for the connection between Analytics API
servers and Client servers.
32
CHAPTER 2
IN THIS CHAPTER
Analytics Scalability | 32
Role- and Resource-Based Access Control for the Contrail Analytics API | 125
Analytics Scalability
The Contrail monitoring and analytics services (collector role) collect and store data generated by
various system components and provide the data to the Contrail interface by means of representational
state transfer (REST) application program interface (API) queries.
The Contrail components are horizontally scalable to ensure consistent performance as the system
grows. Scalability is provided for the generator components (control and compute roles) and for the
REST API users (webui role).
33
This section provides a brief description of the recommended configuration of analytics in Contrail to
achieve horizontal scalability.
The following is the recommended locations for the various component roles of the Contrail system for
a 5-node configuration.
Figure 9 on page 33 illustrates scalable connections for analytics in a 5-node system, with the nodes
configured for roles as recommended above. The analytics load is distributed between the two analytics
nodes. This configuration can be extended to any number of analytics nodes.
The analytics nodes collect and store data and provide this data through various REST API queries.
Scalability is provided for the control nodes, the compute nodes, and the REST API users, with the API
output displayed in the Contrail user interface. As the number of control and compute nodes increase in
the system, the analytics nodes can also be increased.
Contrail supports multiple instances of analytics for high availability and load balancing.
• contrail-collector —Receives status, logs, and flow information from all Contrail processing elements
(for example, generators) and records them.
Every generator is connected to one of the contrail-collector instances at any given time. If an
instance fails (or is shut down), all the generators that are connected to it are automatically moved to
another functioning instance, typically in a few seconds or less. Some messages may be lost during
this movement. UVEs are resilient to message loss, so the state shown in a UVE is kept consistent to
the state in the generator.
• contrail-opserver —Provides an external API to report UVEs and to query logs and flows.
Each analytics component exposes a northbound REST API represented by the contrail-opserver
service (port 8081) so that the failure of one analytics component or one contrail-opserver service
should not impact the operation of other instances.
• Periodically poll the contrail-opserver service on a set of analytics nodes to determine the list of
functioning endpoints, then make API requests from one or more of the functioning endpoints.
• The Contrail user interface makes use of the same northbound REST API to present dashboards,
and reacts to any contrail-opserver high availability event automatically.
IN THIS SECTION
Overview | 35
35
vif Command | 36
clear Command | 41
flow Command | 41
vrfstats Command | 43
rt Command | 44
dropstats Command | 45
mpls Command | 49
mirror Command | 51
vxlan Command | 53
nh Command | 55
dpdkinfo Command | 58
dpdkconf Command | 67
Overview
vRouter is the component that takes packets from VMs and forwards them to their destinations. In this
effort, vRouter depends on the vRouter agent to make sense of the overall topology, understand the
various policies that govern the communication between VMs, and program them in vRouter in a way
vRouter understands.
vRouter has a few fundamental data structures that abstracts out the various communication paths.
There is "interface," "flow," "route," and "nexthop" that enables vRouter to push packets to their eventual
destinations. In addition, vRouter also has good statistics that can help understand and debug packet
paths. Various command line utilities provided by the vRouter can be used to display these data
structures and better understand the behavior that one sees in a compute node.
This section describes the shell prompt utilities available for examining the state of the vRouter kernel
module in Contrail.
The most useful commands for inspecting the Contrail vRouter module are summarized in the following
table.
Command Description
(Continued)
Command Description
mpls Display the input label map programmed into the vRouter.
--help Display all command options available for the current command.
vif Command
The vRouter requires vRouter interfaces (vif) to forward traffic. Use the vif command to see the
interfaces that are known by the vRouter.
37
NOTE: Having interfaces only in the OS (Linux) is not sufficient for forwarding. The relevant
interfaces must be added to vRouter. Typically, the set up of interfaces is handled by components
like nova-compute or vRouter agent.
The vif command can be used to see the interfaces that the vRouter is aware of by including the
--list option.
vif0/X The vRouter assigned name, where 0 is the router ID and X is the index allocated
to the interface within the vRouter.
OS: pkt0 The pkt0 (in this case) is the name of the actual OS (Linux) visible interface name.
For physical interfaces, the speed and the duplex settings are also displayed.
The type of interface and its IP address, as defined by vRouter. The values can
be different from what is seen in the OS. Types defined by vRouter include:
The identifier of the vrf to which the interface is assigned, the flags set on the
interface, the MTU as understood by vRouter, and a reference count of how
many individual entities actually hold reference to the interface (mainly of
debugging value).
Flag options identify that the following are enabled for the interface:
• P - Policy. All traffic that comes to vRouter from this interface are subjected
to policy.
• L3 - Layer 3 forwarding
• L2 - Layer 2 bridging
• X - Cross connect mode, only set on physical and host interfaces, indicating
that packets are moved between physical and host directly, with minimal
intervention by vRouter. Typically set when the agent is not alive or not in
good shape.
• Mt - Mirroring transmit direction. All packets that egresses this interface are
mirrored.
• Mr - Mirroring receive direction. All packets that ingresses this interface will
be mirrored.
vif Options
Use vif –-help to display all options available for the vif command. Following is a brief description of
each option.
40
NOTE: It is not recommended to use the following options unless you are very experienced with
the system utilities.
# vif --help
Usage: vif [--create <intf_name> --mac < --mac <C>]
[--add <C>> --mac <mac> --vrf <vrf>
--type [vhost|agent|physical|virtual|monitoring]
--transport [eth|pmd|virtual|socket]
--xconnect <physical interface name>
--policy, --vhost-phys, --dhcp-enable]
--vif <vif ID> --id <intf_id> --pmd --pci]
[--delete <intf_id>|<intf_name>]
[--get <intf_id>][--kernel]
[--set <intf_id> --vlan <vlan_id> --vrf <vrf_id>]
[--list][--core <core number>][--rate]
[--sock-dir <sock dir>]
[--clear][--id <intf_id>][--core <core_number>]
[--help}
Option Description
--create Creates a “host” interface with name <intf_name> and mac <mac> on the host
kernel. The vhost0 interface that you see on Linux is a typical example of
invocation of this command.
--add Adds the existing interfaces in the host OS to vRouter, with type and flag
options.
--delete Deletes the interface from vRouter. The <intf_id> i is the vRouter interface ID
as given by vif0/X, where X is the ID. So, in vif0/1, 1 is the interface index of
that vif inside the vRouter module.
--get Displays a specific interface. The <intf_id> is the vRouter interface ID, unless
the command is appended by the —kernel option, in which case the ID is the
kernel ID.
41
(Continued)
Option Description
--set Set working parameters of an interface. The ones supported are the vlan id
and the vrf. The vlan id as understood by vRouter differs from what one
typically expects and is relevant for interfaces of service instances.
--clear Clears statistics for all interfaces on all cores. For more information, see "clear
Command" on page 41.
clear Command
Contrail Networking Release 2008 supports clearing of vif statistics counters for all interfaces by using
the --clear command. For more information on --clear command options, see Table 4 on page 41.
Option Description
--clear --core <core-id> Clears statistics on a specific core for all interfaces.
--clear --id <vif-id> --core Clears statistics for a specific interface on a specific core.
<core-id>
flow Command
Example: flow -l
42
Use -l to list everything in the flow table. The -1 is the only relevant debugging option.
# flow –l
Flow table
Index Source:Port Destination:Port Proto(V)
-------------------------------------------------------------------------------------------------
Each record in the flow table listing displays the index of the record, the source IP: source port, the
destination ip: destination port, the inet protocol, and the source VRF (V) to which the flow belongs.
Each new flow has to be approved by the vRouter agent. The agent does this by setting actions for each
flow. There are three main actions associated with a flow table entry: Forward (‘F’), Drop (‘D’), and Nat
(‘N’).
For NAT, there are additional flags indicating the type of NAT to which the flow is subject, including:
SNAT (S), DNAT (D), source port translation (Ps), and destination port translation (Pd).
S(nh) indicates the source nexthop index used for the RPF check to validate that the traffic is from a
known source. If the packet must go to an ECMP destination, E:X is also displayed, where ‘X’ indicates
the destination to be used through the index within the ECMP next hop.
The Statistics field indicates the Packets/Bytes that hit this flow entry.
There is a Mirror Index field if the traffic is mirrored, listing the indices into the mirror table (which can
be dumped by using mirror –-dump).
If there is an explicit association between the forward and the reverse flows, as is the case with NAT,
you will see a double arrow in each of the records with either side of the arrow displaying the flow index
for that direction.
Example: flow -r
# flow –r
New = 2, Flow setup rate = 3 flows/sec, Flow rate = 3 flows/sec, for last 548 ms
New = 2, Flow setup rate = 3 flows/sec, Flow rate = 3 flows/sec, for last 543 ms
New = -2, Flow setup rate = -3 flows/sec, Flow rate = -3 flows/sec, for last 541 ms
43
New = 2, Flow setup rate = 3 flows/sec, Flow rate = 3 flows/sec, for last 544 ms
New = -2, Flow setup rate = -3 flows/sec, Flow rate = -3 flows/sec, for last 542 ms
Use --help to display all options available for the flow command.
# flow –-help
Usage:flow [-f flow_index][-d flow_index][-i flow_index]
[--mirror=mirror table index]
[-l]
-f <flow_index> Set forward action for flow at flow_index <flow_index>
-d <flow_index> Set drop action for flow at flow_index <flow_index>
-i <flow_index> Invalidate flow at flow_index <flow_index>
--mirror mirror index to mirror to
-l List all flows
-r Start dumping flow setup rate
--help Print this help
vrfstats Command
Use vrfstats to display statistics per next hop for a vrf. It is typically used to determine if packets are
hitting the expected next hop.
The —dump option displays the statistics for all VRFs that have seen traffic. In the following example, there
was traffic only in Vrf 0 (the public VRF). Receives shows the number of packets that came in the fabric
destined to this location. Encaps shows the number of packets destined to the fabric.
If there is VM traffic going out on the fabric, the respective tunnel counters will increment.
# vrfstats --dump
Vrf: 0
Discards 414, Resolves 3, Receives 165334
Ecmp Composites 0, L3 Mcast Composites 0, L2 Mcast Composites 0, Fabric Composites 0, Multi
Proto Composites 0
Udp Tunnels 0, Udp Mpls Tunnels 0, Gre Mpls Tunnels 0
L2 Encaps 0, Encaps 130955
# vrfstats --get 0
Vrf: 0
Discards 418, Resolves 3, Receives 166929
Ecmp Composites 0, L3 Mcast Composites 0, L2 Mcast Composites 0, Fabric Composites 0, Multi
Proto Composites 0
Udp Tunnels 0, Udp Mpls Tunnels 0, Gre Mpls Tunnels 0
L2 Encaps 0, Encaps 132179
rt Command
Use the rt command to display all routes in a VRF.
Example: rt --dump
# rt --dump 0
0.0.0.0/8 0 - 5
1.0.0.0/8 0 - 5
2.0.0.0/8 0 - 5
45
3.0.0.0/8 0 - 5
4.0.0.0/8 0 - 5
5.0.0.0/8 0 - 5
In this example output, the first line displays the routing table that is being dumped. In 0/0/unicast, the
first 0 is for the router ID, the next 0 is for the VRF ID, and unicast identifies the unicast table. The
vRouter maintains separate tables for unicast and multicast routes. By default, if the —table option is not
specified, only the unicast table is dumped.
Each record in the table output specifies the destination prefix length, the parent route prefix length
from which this route has been expanded, the flags for the route, the MPLS label if the destination is a
VM in another location, and the next hop ID. To understand the second field “PPL”, it is good to keep in
mind that the unicast routing table is internally implemented as an ‘mtrie’.
The Flags field can have two values. L indicates that the label field is valid, and H indicates that vroute
should proxy arp for this IP.
The Nexthop field indicates the next hop ID to which the route points.
To dump the multicast table, use the —table option with mcst as the argument.
(Src,Group) Nexthop
0.0.0.0,255.255.255.255
dropstats Command
Use the dropstats command to see packet drop counters in vRouter. Use the dropstats --debug command to
view the Cloned Original counters.
Example: dropstats
Invalid IF 0
Trap No IF 0
IF TX Discard 0
IF Drop 0
IF RX Discard 0
Flow Unusable 0
Flow No Memory 0
Flow Table Full 0
Flow NAT no rflow 0
Flow Action Drop 0
Flow Action Invalid 0
Flow Invalid Protocol 0
Flow Queue Limit Exceeded 0
New Flow Drops 0
Flow Unusable (Eviction) 0
Discards 0
TTL Exceeded 0
Mcast Clone Fail 0
Invalid NH 2
Invalid Label 0
Invalid Protocol 0
Etree Leaf to Leaf 0
Bmac/ISID Mismatch 0
Rewrite Fail 0
Invalid Mcast Source 0
Packet Loop 0
Push Fails 0
Pull Fails 0
Duplicated 0
Head Alloc Fails 0
PCOW fails 0
Invalid Packets 0
Misc 0
Nowhere to go 0
Checksum errors 0
No Fmd 0
47
Invalid VNID 0
Fragment errors 0
Invalid Source 0
Jumbo Mcast Pkt with DF Bit 0
No L2 Route 0
Memory Failures 0
Fragment Queueing Failures 0
No Encrypt Path Failures 0
Invalid HBS received packet 0
NOTE: Cloned Original drops are still included in the Drops section in the output of the vif --list
command.
GARP packets from VMs are dropped by vRouter, an expected behavior. In the example output, the first
counter GARP indicates how many packets were dropped.
ARP requests that are not handled by vRouter are dropped, for example, requests for a system that is
not a host. These drops are counted by ARP notme counters.
The Invalid ARPs counter is incremented when the Ethernet protocol is ARP, but the ARP operation was
neither a request nor a response.
Invalid IF counters are incremented normally during transient conditions, and should not be a concern.
Trap No IF counters are incremented when vRouter is not able to find the interface to trap the packets to
vRouter agent, and should not happen in a working system.
IF TX Discard and IF RX Discard counters are incremented when vRouter is not in a state to transmit and
receive packets, and typically happens when vRouter goes through a reset state or when the module is
unloaded.
48
IF Drop counters indicate packets that are dropped in the interface layer. The increase can typically
happen when interface settings are wrong.
When packets go through flow processing, the first packet in a flow is cached and the vRouter agent is
notified so it can take actions on the packet according to the policies configured. If more packets arrive
after the first packet but before the agent makes a decision on the first packet, then those new packets
are dropped. The dropped packets are tracked by the Flow unusable counter.
The Flow No Memory counter increments when the flow block doesn't have enough memory to perform
internal operations.
The Flow Table Full counter increments when the vRouter cannot install a new flow due to lack of
available slots. A particular flow can only go in certain slots, and if all those slots are occupied, packets
are dropped. It is possible that the flow table is not full, but the counter might increment.
The Flow NAT no rflow counter tracks packets that are dropped when there is no reverse flow associated
with a forward flow that had action set as NAT. For NAT, the vRouter needs both forward and reverse
flows to be set properly. If they are not set, packets are dropped.
The Flow Action Drop counter tracks packets that are dropped due to policies that prohibit a flow.
The Flow Action Invalid counter usually does not increment in the normal course of time, and can be
ignored.
The Flow Invalid Protocol usually does not increment in the normal course of time, and can be ignored.
The Flow Queue Limit Exceeded usually does not increment in the normal course of time, and can be ignored.
The Discard counter tracks packets that hit a discard next hop. For various reasons interpreted by the
agent and during some transient conditions, a route can point to a discard next hop. When packets hit
that route, they are dropped.
The TTL Exceeded counter increments when the MPLS time-to-live goes to zero.
The Mcast Clone Fail happens when the vRouter is not able to replicate a packet for flooding.
The Cloned Original is an internal tracking counter. It is harmless and can be ignored.
49
The Invalid NH counter tracks the number of packets that hit a next hop that was not in a state to be
used (usually in transient conditions) or a next hop that was not expected, or no next hops when there
was a next hop expected. Such increments happen rarely, and should not continuously increment.
The Invalid Label counter tracks packets with an MPLS label unusable by vRouter because the value is
not in the expected range.
The Rewrite Fail counter tracks the number of times vRouter was not able to write next hop rewrite data
to the packet.
The Invalid Mcast Source tracks the multicast packets that came from an unknown or unexpected source
and thus were dropped.
The Duplicated counter tracks the number of duplicate packets that are created after dropping the original
packets. An original packet is duplicated when generic send offload (GSO) is enabled in the vRouter or
the original packet is unable to include the header information of the vRouter agent.
The Invalid Source counter tracks the number of packets that came from an invalid or unexpected source
and thus were dropped.
mpls Command
The mpls utility command displays the input label map that has been programmed in the vRouter.
The —dump command dumps the complete label map. The output is divided into two columns. The first
field is the label and the second is the next hop corresponding to the label. When an MPLS packet with
the specified label arrives in the vRouter, it uses the next hop corresponding to the label to forward the
packet.
# mpls –dump
Label NextHop
----------------------
50
16 9
17 11
# nh --get 9
The nh output shows that the next hop directs the packet to go out on the interface with index 3 (Oif:3)
with the given rewrite data.
# vif –get 3
The -get 3 output shows that the index of 3 corresponds to a tap interface that goes to a VM.
You can also dump individual entries in the map using the —get option, as follows:
# mpls –get 16
Label NextHop
51
-----------------------
16 9
# mpls –help
mpls --help
mirror Command
The following example inspects a mirror configuration where traffic is mirrored from network vn1
(1.1.1.0/24) to network vn2 (2.2.2.0/24). A ping is run from 1.1.1.253 to 2.2.2.253, where both IPs are
valid VM IPs, then the flow table is listed:
# flow -l
Flow table
-------------------------------------------------------------------------
In the example output, Mirror Index:0 is listed, it is the index to the mirror table. The mirror table can be
dumped with the —dump option, as follows:
# mirror --dump
Mirror Table
------------------------------------------------
0 18 3
The mirror table entries point to next hops. In the example, the index 0 points to next hop 18. The
References indicate the number of flow entries that point to this entry.
# nh --get 18
Sport:58818 Dport:8099
The nh --get output shows that mirrored packets go to a system with IP 250.250.2.253. The packets are
tunneled as a UDP datagram and sent to the destination. Vrf:-1 indicates that a lookup has to be done in
the source Vrf for the destination.
53
You can also get an individual mirror table entry using the —get option, as follows:
# mirror --get 10
Mirror Table
-----------------------------------------------
10 1 1
# mirror --help
mirror --help
vxlan Command
The vxlan command can be used to dump the VXLAN table. The vxlan table maps a network ID to a next
hop, similar to an MPLS table.
If a packet comes with a VXLAN header and if the VNID is one of those in the table, the vRouter will use
the next hop identified to forward the packet.
# vxlan --dump
54
VXLAN Table
VNID NextHop
---------------------
4 16
5 16
You can use the —get option to dump a specific entry, as follows:
# vxlan --get 4
VXLAN Table
VNID NextHop
----------------------
4 16
# vxlan --help
vxlan --help
nh Command
The nh command enables you to inspect the next hops that are known by the vRouter. Next hops tell the
vRouter the next location to send a packet in the path to its final destination. The processing of the
packet differs based on the type of the next hop. The next hop types are described in the following
table.
Receive Indicates that the packet is destined for itself and the vRouter should
perform Layer 4 protocol processing. As an example, all packets
destined to the host IP will hit the receive next hop in the default VRF.
Similarly, all traffic destined to the VMs hosted by the server and
tunneled inside a GRE will hit the receive next hop in the default VRF
first, because the outer packet that carries the traffic to the VM is that
of the server.
Encap (Interface) Used only to determine the outgoing interface and the Layer 2
information. As an example, when two VMs on the same server
communicate with each other, the routes for each of them point to an
encap next hop, because the only information needed is the Layer 2
information to send the packet to the tap interface of the destination
VM. A packet destined to a VM hosted on one server from a VM on a
different server will also hit an encap next hop, after tunnel
processing.
Discard A catch-all next hop. If there is no route for a destination, the packet
hits the discard next hop, which drops the packet.
(Continued)
Composite Groups a set of next hops, called component next hops or sub next
hops. Typically used when multi-destination distribution is needed, for
example for multicast, ECMP, and so on.
Vxlan A VXLAN tunnel is used for Layer 2 traffic. A typical tunnel next hop
indicates the kind of tunnel, the rewrite information, the outgoing
interface, and the source and destination server IPs.
Example: nh --list
Ref_cnt:2 Oif:1
Vrf:1
Example: nh --get
Use the --get option to display information for a single next hop.
# nh –get 9
Example: nh --help
# nh –help
Usage: nh --list
nh --get <nh_id>
nh --help
58
dpdkinfo Command
In Contrail Networking Release 2008, the dpdkinfo command enables you to see the details of the
internal data structures of a DPDK enabled vRouter.
dpdkinfo Options
Use dpdkinfo –-help to display all options available for the dpdkinfo command. The dpdkinfo command
options are described in the following table:
Option Description
--bond Displays the bond interface information for primary and backup devices in a bond
interface.
--lacp all Displays the Link Aggregation Control Protocol (LACP) configuration for Slow and Fast
LACP timers along with port details of actor and partner interfaces in a LACP
exchange.
--mempool all Displays summary of used and available memory buffers from all memory pools.
--stats eth Displays NIC statistics information for the packets received (Rx) and transmitted (Tx)
by the vRouter.
--xstats all Displays extended NIC statistics information from NIC cards.
--xstats=<interface-id> Displays extended NIC information of the primary and backup devices for the given
interface-id ( Primary->0, Slave_0->1, Slave_1 ->2 ).
59
(Continued)
Option Description
--lcore Displays the Rx queue mapped interfaces along with Queue ID.
--app Displays the overall application information like actual physical interface name,
number of cores, VLAN, queues, and so on.
dpdkinfo --ddp list Displays the list of DDP profiles added in the vRouter.
The dpdkinfo --bond displays the following information for primary and backup devices: actor/partner
status, actor/partner key, actor/partner system priority, actor/partner MAC address, actor/partner port
priority, actor/partner port number, and so on.
dpdkinfo --bond
No. of bond slaves: 2
Bonding Mode: 802.3AD Dynamic Link Aggregation
Transmit Hash Policy: Layer 3+4 (IP Addresses + UDP Ports) transmit load balancing
MII status: UP
MII Link Speed: 1000 Mbps
MII Polling Interval (ms): 10
Up Delay (ms): 0
Down Delay (ms): 0
Driver: net_bonding
802.3ad info :
LACP Rate: slow
Aggregator selection policy (ad_select): Stable
System priority: 32512
System MAC address:00:50:00:00:00:00
Active Aggregator Info:
Aggregator ID: 0
Number of ports: 2
Actor Key: 4096
Partner Key: 0
Partner Mac Address: 00:00:80:7a:9b:05
The dpdkinfo --lacp all command displays the following information for primary devices: LACP rate and
LACP configuration details, which include Fast periodic (ms), Slow periodic (ms), Short timeout (ms), Long
timeout (ms), LACP packet statistics for Tx and Rx counters, and so on. Also, dpdkinfo --lacp all displays
actor and partner port status details of all the backup devices.
The dpdkinfo --mempool all displays a summary of the memory pool information of the primary and backup
devices, which include number of available memory pools, size of the memory pool, and so on.
The dpdk --mempool <mempool-name> displays detailed information of the memory pool you have specified in
the command.
---------------------------------------------------
Name Size Used Available
---------------------------------------------------
rss_mempool 16384 620 15765
frag_direct_mempool 4096 0 4096
frag_indirect_mempool 4096 0 4096
slave_port0_pool 8193 0 8193
packet_mbuf_pool 8192 4 8188
slave_port1_pool 8193 125 8068
The dpdkinfo --stats eth command reads Rx and Tx packets statistics from the NIC card and displays the
information.
Slave Info(0000:02:00.0):
RX Device Packets:0, Bytes:0, Errors:0, Nombufs:0
Dropped RX Packets:0
TX Device Packets:0, Bytes:0, Errors:0
Queue Rx:
Tx:
Rx Bytes:
Tx Bytes:
Errors:
---------------------------------------------------------------------
Slave Info(0000:02:00.1):
RX Device Packets:1289, Bytes:148651, Errors:0, Nombufs:0
Dropped RX Packets:0
TX Device Packets:2051, Bytes:237989, Errors:0
Queue Rx: [0]1289
Tx: [0]2051
Rx Bytes: [0]148651
Tx Bytes: [0]234429
Errors:
The dpdkinfo --xstats command reads the Rx and Tx from the NIC cards and displays the packet statistics
in detail.
dpdkinfo --xstats
Master Info:
Rx Packets:
rx_good_packets: 1459
rx_q0packets: 1459
Tx Packets:
tx_good_packets: 2316
tx_q0packets: 2316
Rx Bytes:
rx_good_bytes: 161175
rx_q0bytes: 161175
Tx Bytes:
tx_good_bytes: 265755
tx_q0bytes: 261915
Errors:
Others:
---------------------------------------------------------------------
Slave Info(0):0000:02:00.0
Rx Packets:
Tx Packets:
Rx Bytes:
Tx Bytes:
Errors:
mac_local_errors: 2
Others:
---------------------------------------------------------------------
Slave Info(1):0000:02:00.1
Rx Packets:
rx_good_packets: 1459
rx_q0packets: 1459
rx_size_64_packets: 677
rx_size_65_to_127_packets: 641
rx_size_128_to_255_packets: 54
rx_size_256_to_511_packets: 48
rx_size_512_to_1023_packets: 3
rx_size_1024_to_max_packets: 36
rx_broadcast_packets: 3
65
rx_multicast_packets: 772
rx_total_packets: 1461
Tx Packets:
tx_good_packets: 2316
tx_q0packets: 2316
tx_total_packets: 2316
tx_size_64_packets: 276
tx_size_65_to_127_packets: 582
tx_size_128_to_255_packets: 1433
tx_size_256_to_511_packets: 4
tx_size_512_to_1023_packets: 3
tx_size_1024_to_max_packets: 18
tx_multicast_packets: 1431
tx_broadcast_packets: 9
Rx Bytes:
rx_good_bytes: 161175
rx_q0bytes: 161175
rx_total_bytes: 161567
Tx Bytes:
tx_good_bytes: 265755
tx_q0bytes: 261915
Errors:
mac_local_errors: 2
Others:
out_pkts_untagged: 2316
The dpdkinfo --lcore displays Logical core (lcore) information, which includes number of forwarding lcores,
the interfaces mapped to the lcore, and queue-ID of the interfaces.
dpdkinfo --lcore
No. of forwarding lcores: 2
No. of interfaces: 4
Lcore 0:
Interface: bond0.102 Queue ID: 0
Interface: vhost0 Queue ID: 0
Lcore 1:
Interface: bond0.102 Queue ID: 1
Interface: tapd1b53efb-9e Queue ID: 0
66
dpdkinfo --app
• Application related information about number of lcores, the names of the existing backup interfaces,
and so on.
• For VLAN configured devices the command displays VLAN name, tag, and vlan_vif name.
• For bond interfaces the command displays ethdev information, which include Max rx queues, Max tx
queues, Reta size, Port id, number of ethdev slaves, Tapdev information, and so on.
• Monitoring interface names (if available) and SR-IOV information, which includes logical core, ethdev
port ID, and driver name.
dpdkinfo --app
No. of lcores: 12
No. of forwarding lcores: 2
Fabric interface: bond0.102
Slave interface(0): enp2s0f0
Slave interface(1): enp2s0f1
Vlan name: bond0
Vlan tag: 102
Vlan vif: bond0
Ethdev (Master):
Max rx queues: 128
Max tx queues: 64
Ethdev nb rx queues: 2
Ethdev nb tx queues: 64
Ethdev nb rss queues: 2
Ethdev reta size: 128
Ethdev port id: 2
Ethdev nb slaves: 2
Ethdev slaves: 0 1 0 0 0 0
Tapdev:
fd: 39 vif name: bond0
fd: 48 vif name: vhost0
In Contrail Networking Release 2011, you can use the dpdkinfo --ddp list command to display the list of
DDP profiles added in the vRouter.
The dpdkinfo --ddp list displays a summary of the DDP profile added in the vRouter. The summary of the
profile information includes tracking ID of the profile, version number, and profile name.
Profile 0:
Track id: 0x8000000c
Version: 1.0.0.0
Profile name: L2/L3 over MPLSoGRE/MPLSoUDP
dpdkconf Command
In Contrail Networking Release 2011, the dpdkconf command enables you to configure a DPDK enabled
vRouter. In release 2011, you can use the dpdkconf command to enable or delete a DDP profile in
vRouter.
Use the dpdkconf --ddp add command during runtime to enable a DDP profile in a DPDK enabled vRouter.
Use the dpdkconf --ddp delete command to delete a DDP profile, which is already loaded in the vRouter.
Release Description
2011 In Contrail Networking Release 2011, you can use the dpdkinfo --ddp list command to display the list of
DDP profiles added in the vRouter.
2011 In Contrail Networking Release 2011, the dpdkconf command enables you to configure a DPDK enabled
vRouter. In release 2011, you can use the dpdkconf command to enable or delete a DDP profile in
vRouter.
2008 Contrail Networking Release 2008 supports clearing of vif statistics counters for all interfaces by using
the --clear command.
2008 In Contrail Networking Release 2008, the dpdkinfo command enables you to see the details of the
internal data structures of a DPDK enabled vRouter.
IN THIS SECTION
Contrail Networking vRouter is the component that takes packets from virtual machines (VM)s and
forwards them to their destinations. Tracing is a useful tool for debugging the packet path.
In this topic, we trace the vRouter packet path in the following use cases:
IN THIS SECTION
This procedure steps through debugging the unicast packet path for intra-virtual network (intra-VN)
traffic from VM1 to VM2 (on same compute node) and VM3 (on different compute node). In this
example, the VMs listed are in the same subnet 10.1.1.0/24. Intra-VN traffic is within the same virtual
network.
1. Discover the vif interfaces corresponding to the virtual machine interfaces (VMI)s of the VM by using
the command:
vif --list
You can also discover the vif interfaces by entering the introspect URL.
Example:
http://10.1.1.5:8085/Snh_ItfReq?
name=&type=&uuid=&vn=&mac=&ipv4_address=&ipv6_address=&parent_uuid=&ip_active=&ip6_active=&l2_
active=
NOTE: Replace the IP address with the actual compute IP address in the introspect HTTP
URL.
70
2. Run the vif --get <index> command to verify the virtual routing and forwarding (VRF) and Policy flags
are set in the vRouter interface (VIF).
3. Run the following command to display all of the entries from the bridge table:
Example:
Highlighted in the example is the destination MAC address of the destination VM in the bridge table
and the next-hop identifier associated with it.
Example:
nh --get 25
Id:25 Type:Encap Fmly:AF_BRIDGE Rid:0 Ref_cnt:3 Vrf:2
Flags:Valid, Policy, Etree Root,
EncapFmly:0806 Oif:6 Len:14
Encap Data: 02 ae db c0 37 bf 00 00 5e 00 01 00 08 00
In the example, Oif:6 is the OIF index in the next hop which is the outgoing interface for the packet.
The Encap Data corresponds to the L2 encapsulation that is added to the IP packet before the packet is
forwarded to the outgoing interface.
Example:
vif --get 6
vif0/6 OS: tapaedbc037-bf
Type:Virtual HWaddr:00:00:5e:00:01:00 IPaddr:10.1.1.6
Vrf:2 Mcast Vrf:2 Flags:PL3L2Er QOS:-1 Ref:6
RX packets:96935 bytes:4892936 errors:0
TX packets:97235 bytes:4921004 errors:0
ISID: 0 Bmac: 02:ae:db:c0:37:bf
Drops:2
The received packet RX and transmitted packet TX counters for the corresponding VIF interfaces are
incremented when traffic is flowing through.
6. Run the flow -l command to list the flows created. If the Policy flag is enabled on the VIFs, a flow is
created as shown in the example.
flow -l
Index Source:Port/Destination:Port Proto(V)
-----------------------------------------------------------------------------------------
876<=>1020 10.1.1.6:1599 1 (2)
10.1.1.5:0
72
The statistics in the forward and reverse flow are incremented when traffic is flowing through. If
statistics are not getting incremented for a particular flow, that can indicate a potential problem in
that direction. The flow action should be F or N for the packets to be forwarded or NATed out. A flow
action of D indicates that packets will be dropped.
In an inter-compute case, the next-hop lookup points to the tunnel that takes the packet to the other
compute node. The bridge entry will also indicate the Label/VNID added to the packet during
encapsulation. Inter-compute traffic is between VMs on different compute nodes.
For Compute 1:
1. Discover the vif interfaces corresponding to the virtual machine interfaces (VMI)s of the VM by using
the command:
vif --list
You can also discover the vif interfaces by entering the introspect URL:
Example:
http://10.1.1.5:8085/Snh_ItfReq?
name=&type=&uuid=&vn=&mac=&ipv4_address=&ipv6_address=&parent_uuid=&ip_active=&ip6_active=&l2_
active=
NOTE: Replace the IP address with the actual compute IP address in the introspect HTTP
URL.
2. Run the vif --get <index> command to verify the virtual routing and forwarding (VRF) and Policy flags
are set in the vRouter interface (VIF).
73
3. Run the following command to display all of the entries from the bridge table:
Example:
In the example, 2:99:ef:64:96:e1 belongs to IP address 10.1.1.7 and label 27 is used to encapsulate the
packet.
Example:
nh --get 20
Id:20 Type:Tunnel Fmly: AF_INET Rid:0 Ref_cnt:12 Vrf:0
Flags:Valid, MPLSoGRE, Etree Root,
Oif:0 Len:14 Data:00 25 90 c5 62 1c 00 25 90 c5 58 94 08 00
Sip:10.204.217.86 Dip:10.204.217.70
In the example, the next-hop output indicates the next-hop type as Tunnel, encapsulation used as
MPLSoGRE, the outgoing interface as Oif:0, and the corresponding source and destination IP addresses of
the tunnel.
For Compute 2:
1. Run the mpls --get <label> command to see the next hop mapped to the particular incoming MPLS
table.
Example:
mpls --get 27
MPLS Input Label Map
Label NextHop
-------------------------
27 28
Example:
nh --get 28
Id:28 Type:Encap Fmly:AF_BRIDGE Rid:0 Ref_cnt:3 Vrf:2
Flags:Valid, Policy, Etree Root,
EncapFmly:0806 Oif:3 Len:14
Encap Data: 02 99 ef 64 96 e1 00 00 5e 00 01 00 08 00
Example:
vif --get 3
a. For Step "1" on page 74, instead of running the mpls --get command, run the vxlan --get
<vxlanid> command to get the mapping from VXLAN ID to the next hop.
b. With VXLAN, the next hop points to a VRF translated next hop. Use the bridge lookup in
the corresponding VRF, as shown in Step "3" on page 73 to get the final outgoing next
hop, which will point to the VIF interface.
IN THIS SECTION
The following procedure steps through debugging the packet path from VM1 to VM2 (on the same
compute node) and VM3 (on a different compute node). In this example, the virtual machines (VMs)
listed are in the same subnet 10.1.1.0/24.
NOTE: Replace the IP address with the actual compute IP address in all of the introspect URLs.
1. Discover the vif interfaces corresponding to the virtual machine interfaces (VMI)s of the VM using
the command:
vif --list
You can also discover the vif interfaces by entering the introspect URL:
Example:
http://10.1.1.5:8085/Snh_ItfReq?
name=&type=&uuid=&vn=&mac=&ipv4_address=&ipv6_address=&parent_uuid=&ip_active=&ip6_active=&l2_
active=
NOTE: Replace the IP address with the actual compute IP address in the introspect HTTP
URLs.
2. Run the vif --get <index> command to verify the virtual routing and forwarding (VRF) and Policy flags
are set in the vRouter interface (VIF).
3. Run the following command to display all of the entries from the bridge table:
Example:
In the case of inter-virtual network (VN)s, the packets are Layer 3 routed instead of Layer 2 switched.
The vRouter does a proxy ARP for the destination network providing it’s virtual MAC address
0:0:5e:0:1:0 back for the ARP request from the source. This can be seen from the rt –dump of the
source VN inet table. This results in the packet being received by the vRouter, which does the route
lookup to send the packet to the correct destination.
Example:
nh --get 3
Id:3 Type:L2 Receive Fmly: AF_INET Rid:0 Ref_cnt:8 Vrf:0
Flags:Valid, Etree Root,
5. Run rt --dump 2 --family inet | grep <ip address> to display inet family routes on the specified IP
address.
78
Example:
20.1.1.6/32 32 P - 30 -
20.1.1.60/32 0 - 0 -
20.1.1.61/32 0 - 0 -
20.1.1.62/32 0 - 0 -
20.1.1.63/32 0 - 0 -
20.1.1.64/32 0 - 0 -
20.1.1.65/32 0 - 0 -
20.1.1.66/32 0 - 0 -
20.1.1.67/32 0 - 0 -
20.1.1.68/32 0 - 0 -
20.1.1.69/32 0 - 0 -
20.1.106.0/24 0 - 0 -
Example:
nh --get 30
Id:30 Type:Encap Fmly: AF_INET Rid:0 Ref_cnt:5 Vrf:3
Flags:Valid, Policy, Etree Root,
EncapFmly:0806 Oif:3 Len:14
Encap Data: 02 60 fc 55 cb bf 00 00 5e 00 01 00 08 00
Example:
vif --get 3
vif0/3 OS: tap60fc55cb-bf
Type:Virtual HWaddr:00:00:5e:00:01:00 IPaddr:20.1.1.6
Vrf:3 Mcast Vrf:3 Flags:PL3L2Er QOS:-1 Ref:6
RX packets:356 bytes:32586 errors:0
TX packets:3930 bytes:177290 errors:0
ISID: 0 Bmac: 02:60:fc:55:cb:bf
Drops:84
79
In the case of inter-compute, the next hop looked up to send the packet out, will point to a tunnel next
hop. Depending on the encapsulation priority, the appropriate encapsulation is added and the packet is
tunneled out. Inter-compute traffic is between VMs on different compute nodes.
For Compute 1:
1. Run rt --dump 2 --family inet | grep <ip address> to display inet family routes for a specified IP address.
Example:
2. Run nh --get <nh id> to display the next-hop details, which points to a tunnel next hop.
Example:
nh --get 49
Id:49 Type:Tunnel Fmly: AF_INET Rid:0 Ref_cnt:9 Vrf:0
Flags:Valid, MPLSoUDP, Etree Root,
Oif:0 Len:14 Data:00 25 90 c5 62 1c 00 25 90 c5 58 94 08 00
Sip:10.204.217.86 Dip:10.204.217.70
For Compute 2:
1. Run the mpls --get <label> command to see the next hop mapped to the particular incoming MPLS
table.
80
Example:
mpls --get 32
MPLS Input Label Map
Label NextHop
-------------------------
32 36
Example:
nh --get 36
Id:36 Type:Encap Fmly: AF_INET Rid:0 Ref_cnt:5 Vrf:3
Flags:Valid, Policy, Etree Root,
EncapFmly:0806 Oif:4 Len:14
Encap Data: 02 f3 37 7b 53 25 00 00 5e 00 01 00 08 00
In the example, Oif:4 is the OIF index in the next hop which is the outgoing interface for the packet.
The Encap Data corresponds to the L2 encapsulation that is added to the IP packet before the packet is
forwarded to the outgoing interface.
Example:
vif --get 4
vif0/4 OS: tapf3377b53-25
Type:Virtual HWaddr:00:00:5e:00:01:00 IPaddr:20.1.1.5
Vrf:3 Mcast Vrf:3 Flags:PL3L2Er QOS:-1 Ref:6
RX packets:100 bytes:16915 errors:0
TX packets:3955 bytes:178363 errors:0
ISID: 0 Bmac: 02:f3:37:7b:53:25
Drops:78
For details about EVPN type 5 routing in Contrail Networking, see Support for EVPN Route Type 5.
The following procedure steps through debugging the packet path for broadcast, unknown unicast, and
multicast (BUM) traffic in Contrail Networking. In this example, the virtual machines (VMs) listed are in
the same subnet 70.70.70.0/24.
The ToR Service Node (TSN) actively holds the contrail-tor-agent and is responsible for:
1. Acting as a receiver of all BUM traffic coming from the ToR switch.
2. Acting as DNS/DHCP responder for the BMS connected to the ToR switch.
Contrail Networking releases earlier than 5.x, used an Open vSwitch Database (OVSDB)-managed
VXLAN environment.
• Controller1 = 10.219.94.4
• Controller2 = 10.219.94.5
• Controller3 = 10.219.94.6
• Compute1 = 10.219.94.9
• Compute2 = 19.219.94.18
1. Run the set protocols ovsdb interfaces <interface> command to configure the physical interfaces that
you want the OVSDB protocol to manage.
82
Example:
The ToR interfaces from which the BMS hangs are marked as ovsdb interfaces.
2. View packets coming into these interfaces by displaying the ovsdb mac table for the ToR switch.
Example:
{master:0}
The entry marked in red (ff:ff:ff:ff:ff:ff:ff - broadcast route) indicates the next hop for a BUM
packet coming into the ToR SW’s ovsdb interface. In this case, VTEP address 10.219.94.7 is the next
hop, which is TSN1. This changes based on which TSN has the active contrail-tor-agent for the ToR
switch in question. With this, the BUM packet is forwarded to the TSN node in a VXLAN tunnel
(local VTEP source interface is 1.1.1.229 and RVTEP source interface is 10.219.94.7).
The VXLAN encapsulated packet is sent with a VXLAN Network Identifier (VNI) that is
predetermined by Contrail Networking when logical interfaces are created. For example, when
ge-0/0/46 was configured as a logical port in Contrail Networking, the following configuration was
committed on the ToR.
Example:
As the VXLAN encapsulated packet arrives on the TSN node, let’s examine how the vRouter
handles this packet.
3. Run vxlan --dump to dump the VXLAN table. The VXLAN table maps a network ID to a next hop.
Example:
VNID NextHop
----------------
4 13
4. Run nh --get <nh id> to display the next-hop details and determine the virtual routing and forwarding
(VRF) associated.
Example:
root@contrail61:~# nh --get 13
Id:13 Type:Vrf_Translate Fmly: AF_INET Rid:0 Ref_cnt:2 Vrf:1
Flags:Valid, Vxlan,
Vrf:1
5. Run the following command to display all of the entries from the bridge table:
Example:
121160 0:1a:a0:a:b4:87 - 1
225832 40:a6:77:d8:37:1d LDf 4 19
237084 0:11:a:6c:50:d4 Df - 3
244992 aa:bb:cc:dd:3e:f4 - 1
252916 0:0:5e:0:1:0 Df - 3
256476 2:75:a1:33:65:3c LDf 20 14
In the example bridge table, since we are tracing the BUM packet path, we need to examine the
ff:ff:ff:ff:ff:ff:ff route by selecting the next hop programmed. In the example, it is 24. Note that a
series of composite next hops are programmed.
Example:
root@contrail61:~# nh --get 24
Id:24 Type:Composite Fmly:AF_BRIDGE Rid:0 Ref_cnt:4 Vrf:1
Flags:Valid, Multicast, L2,
Sub NH(label): 20(0) 22(0) 21(0)
The multicast tree in the example shows that there are two Dynamic IPs (DIP)s. The DIP where the
packet came from is ignored. Therefore, packet gets forwarded to DIP 10.219.94.18 only.
7. Run vxlan --get <vnid> to examine what DIP 10.219.94.18 does with the incoming VXLAN
encapsulated packet.
Example:
VNID NextHop
----------------
4 20
Example:
root@contrail4:~# nh --get 20
Id:20 Type:Vrf_Translate Fmly: AF_INET Rid:0 Ref_cnt:2 Vrf:1
Flags:Valid, Vxlan,
Vrf:1
9. Run the following command to display all of the entries from the bridge table:
Example:
In the example bridge table, since we are tracing the BUM packet path, we need to examine the
ff:ff:ff:ff:ff:ff:ff route by selecting the next hop programmed. In the example, it is 50.
Example:
root@contrail4:~# nh --get 50
Id:50 Type:Composite Fmly:AF_BRIDGE Rid:0 Ref_cnt:4 Vrf:1
Flags:Valid, Multicast, L2,
Sub NH(label): 43(0) 49(0)
Encap Data: 02 53 89 c4 29 1c 00 00 5e 00 01 00 08 00
In the example, you only have to inspect DIP 10.219.94.9. The remaining endpoints are either local or
the source where the BUM traffic came from. Now, let us examine, what DIP 10.219.94.9 does with
the incoming VXLAN encapsulated packet.
11. Run vxlan --get <vnid> to examine what DIP 10.219.94.9 does with the incoming VXLAN encapsulated
packet.
Example:
VNID NextHop
----------------
4 20
Example:
root@contrail101:~# nh --get 20
Id:20 Type:Vrf_Translate Fmly: AF_INET Rid:0 Ref_cnt:2 Vrf:1
Flags:Valid, Vxlan,
Vrf:1
13. Display the bridge table for the VRF by using the following command:
Example:
Example:
root@contrail101:~# nh --get 31
Id:31 Type:Composite Fmly:AF_BRIDGE Rid:0 Ref_cnt:4 Vrf:1
Flags:Valid, Multicast, L2,
Sub NH(label): 30(0) 36(0)
from.
From the above output, the only DIP that you have to further examine is 10.219.94.8. The remaining
DIPs are either local or the source where the BUM traffic came from. Now, let’s examine what DIP
10.219.94.8 does with the incoming VXLAN encapsulated packet.
15. Run vxlan --get <vnid> to examine what DIP 10.219.94.9 does with the incoming VXLAN encapsulated
packet.
Example:
VNID NextHop
----------------
4 14
Example:
root@contrail66:~# nh --get 14
Id:14 Type:Vrf_Translate Fmly: AF_INET Rid:0 Ref_cnt:2 Vrf:1
90
Flags:Valid, Vxlan,
Vrf:1
17. Display the bridge table for the VRF by using the following command:
Example:
Example:
root@contrail66:~# nh --get 24
Id:24 Type:Composite Fmly:AF_BRIDGE Rid:0 Ref_cnt:4 Vrf:1
Flags:Valid, Multicast, L2,
Sub NH(label): 23(0) 25(0) 21(0)
Now, you just have one DIP 1.1.1.230 which is the ToR SW2 in the topology. This should also be
present in the multicast tree as this ToR SW also has an end-point (which is BMS2) in the same VN
(VNI=4) as the one we are tracing.
This completes all levels of forwarding and tracing the BUM packet from one ToR switch and is
replicated to other intended receivers in the topology.
These multicast trees are programmed by the controllers that the TSN is connected to. If you want to
inspect the controller’s memory and what eventually gets programmed on all TSN computes, enter the
following introspect URL using your controller IP address:
http://<controller_ip>:8083/Snh_ShowMulticastManagerDetailReq?x=default-domain:admin:seventy-
network:seventy-network.ermvpn.0
RELATED DOCUMENTATION
Contrail-tools container provides centralized location for all the available tools and CLI commands in one
place.
Starting with Contrail Networking Release 2008, contrail-tools command will be installed by default.
contrail-tools command enables you to log in to the contrail-tools container and execute the tool.
Additionally, the command will kill the container on exit.
Table 5 on page 92 provides a list of available tools and CLI options in the contrail-tools package.
dpdkinfo Adds support to display bond, lacp, Nic, mempool, core, and app information.
mpls Displays the input label map programmed into the vRouter.
sandump Captures the Sandesh messages from the netlink connection between Agent and
vRouter.
vrftable Displays the interface mapping for each VRF for a host-based firewall feature.
For example:
[root]# contrail-tools
(contrail-tools)[root /]$ vif
Usage: vif [--create <intf_name> --mac <mac>]
[--add <intf_name> --mac <mac> --vrf <vrf>
--type [vhost|agent|physical|virtual|monitoring]
--transport [eth|pmd|virtual|socket]
--xconnect <physical interface name>
--policy, --vhost-phys, --dhcp-enable]
--vif <vif ID> --id <intf_id> --pmd --pci]
[--delete <intf_id>|<intf_name>]
[--get <intf_id>][--kernel][--core <core number>][--rate] [--get-drop-stats]
[--set <intf_id> --vlan <vlan_id> --vrf <vrf_id>]
[--list][--core <core number>][--rate]
[--sock-dir <sock dir>]
[--help]
94
For example:
2008 Starting with Contrail Networking Release 2008, contrail-tools command will be installed by default.
RELATED DOCUMENTATION
Starting with Contrail Networking Release 2008, Sandump tool is available in contrail-tools container.
You can use the Sandump tool on macOS machines.
Sandump tool captures the Sandesh messages from netlink connection between Agent and vRouter
(only DPDK mode) and provides interpretation of all the captured bytes.
Starting with Contrail Networking Release 2011, you can use Sandump tool on Windows machines.
95
Sandesh is a southbound interface protocol based on Apache Thrift, to send analytics data such as
system logs, object logs, UVEs, flow logs, and the like, to the collector service in the Contrail Insights
node.
You can analyze the captured bytes in Wireshark. The Wireshark plugin parses the hex dumps of all
Sandesh objects. You must use Wireshark Release 3.2 and later.
You must have Wireshark application installed on your machine. You can download Wireshark from the
Download Wireshark page.
1. Run the sandump command. It gives summary of each message which is being transferred between the
agent and the vRouter.
(vrouter-agent-dpdk)[root]$ ./sandump -h
Sandump - Sandesh dump utility
Usage:
./sandump -w <filename> [filename to write the sandesh packets]
./sandump -c <filename> [force cleanup]
(vrouter-agent-dpdk)[root]$
The command generates a file which contains sniffed bytes converted in to the pcap format.
3. Analyze the captured packets transferred between the agent and the vRouter.
(vrouter-agent-dpdk)[root]$ ./sandump
Running as user "root" and group "root". This could be dangerous.
Capturing on 'lo'
1 2020-08-04 09:51:01.233639252 Agent → Vrouter Vif 790 Operation: Dump
Type: Host ID: 0
96
• Follow the procedure to analyze the packets in Wireshark for Windows OS.
Create new lua folder in C:\Program Files\Wireshark\ and copy the rest of the lua files
present in sandump_wireshark_plugin folder to the newly created lua folder.
• Agent IP address—0.0.0.0
• vRouter IP address—1.1.1.1
Figure 10 on page 97 shows the host file with the required IP addresses.
e. Open the pcap file generated from Sandump tool for further debugging in Wireshark.
98
c. Un-comment the package.prepend_path(…) line in main.lua, common.lua and helpers.lua files found
in sandump_wireshark_plugin folder.
d. Navigate to Wireshark > About Wireshark > Folders > Personal configuration to edit the
configuration.
e. Create hosts file in the Personal configuration directory and add the host names with the
following details:
• Agent IP address—0.0.0.0
• vRouter IP address—1.1.1.1
Figure 12 on page 99 shows the host file with the required IP addresses.
99
f. Navigate to Wireshark > Preferences > Name Resolution and check Resolve network (IP)
addresses option.
g. Open the pcap file generated from Sandump tool for further debugging in Wireshark.
100
Release Description
2011 Starting with Contrail Networking Release 2011, you can use Sandump tool on Windows machines.
2008 Starting with Contrail Networking Release 2008, Sandump tool is available in contrail-tools container.
You can use the Sandump tool on macOS machines.
RELATED DOCUMENTATION
IN THIS SECTION
You can define a security logging object (SLO) to log sessions that match a specific policy rule or security
group. An SLO also enables selective session logging. This reduces the amount of data sent from
vRouter agent to Contrail Analytics.
• Virtual network
These topics provide information on how you can define an SLO, attach an SLO to a virtual network and
virtual machine interface, associate a policy rule or security group to SLO, and edit the name of an
existing SLO.
Defining an SLO
Follow these steps to define an SLO by using the Contrail Command user interface (UI).
These steps also describe how you can associate a network policy rule or security group to an SLO.
c. Select Up from the Admin State list to indicate the admin state of the security logging object.
d. Select the network policy you want to attach to the SLO from the Network Policies list.
This enables logging of sessions for all virtual network interfaces that the selected network policy
is attached to.
e. Select the security groups you want to attach to the SLO from the Security Group list.
This enables logging of sessions for all virtual machine interfaces that the selected security group
is attached to.
102
f. You can also define a new SLO rule for a network policy and security group from the Rules section
of the Create Security Logging Object page.
To define an SLO rule for a network policy,
ii. Select the network policy you want this SLO rule to be applied to, from the Network Policy
list.
iii. Enter the number of sessions you want logged in the Rate field.
b. Select the security group you want this SLO rule to be applied to, from the Security Groups list.
c. Enter the number of sessions you want logged in the Rate field.
IN THIS SECTION
After you have defined an SLO, you can attach the SLO to a virtual network and a virtual machine
interface.
Follow these steps to attach an SLO to a virtual machine and a virtual machine interface.
You can attach an SLO to a virtual network while creating the virtual network or after you have created
the virtual network˙.
For steps to attach an SLO while creating a virtual network, see Create Virtual Network.
103
IN THIS SECTION
Attaching an SLO to a Virtual Machine Interface while creating a Virtual Port | 103
You can attach an SLO to a virtual machine interface while creating a virtual port or after you have
created the virtual port.
IN THIS SECTION
Overview | 104
Overview
The contrail-collector process on the Contrail Analytics node can act as a system log receiver.
You can enable the contrail-collector to receive system logs by giving a valid syslog_port as a command
line option:
--DEFAULT.syslog_port <arg>
105
For nodes to send system logs to the contrail-collector, the system log configuration for the node should
be set up to direct the system logs to contrail-collector.
Example
Add the following line in /etc/rsyslog.d/50-default.conf on an Ubuntu system to redirect the system logs to
contrail-collector.
The logs can be retrieved by using Contrail tool, either by using the contrail-logs utility on the analytics
node or by using the Contrail user interface on the system log query page.
You can also export logs stored in Contrail analytics to another system log receiver by using the contrail-
logs utility.
The contrail-logs utility can take these options: --send-syslog, --syslog-server, --syslog-port, to query
Contrail analytics, then send the results as system logs to a system log server. This is an on-demand
command, one can write a cron job or a job that continuously invokes contrail-logs to achieve continuous
sending of logs to another system log server.
The common_vrouter.env can be configured to send flow logs to external syslog server. You can configure
common_vrouter.env, if you wish to recompose the docker. Update common.sh , if you do not wish to
recompose the docker.
1. Update /etc/contrail/common_vrouter.env.
SLO_DESTINATION=syslog
SAMPLE_DESTINATION=syslog
docker-compose -f /etc/contrail/vrouter/docker-compose.yaml up -d
1. Update common.sh .
SLO_DESTINATION="syslog file"
SAMPLE_DESTINATION="syslog file”
if [ -n "$XFLOW_NODE_IP" ];
Flow log sampling settings apply regardless of the flow log destination specified. If sampling is enabled,
the syslog messages will be sampled using the same rules that would apply to Contrail Analytics. If non-
sampled flow data is required, sampling must be disabled by means of configuration settings.
Flow events for termination will include both the appropriate tear-down fields and the appropriate setup
fields.
The flow messages will be sent to the syslog with a severity of INFO.
The user can configure the remote system log (rsyslog) on the compute node to send syslog messages
with facility LOCAL0, severity of INFO (and lower), to the remote syslog server. Messages with a higher
severity than INFO can be logged to a local file to allow for debugging.
Flow messages appear in the syslog in a format similar to the following log example:
May 24 14:40:13 a7s10 contrail-vrouter-agent[29930]: 2016-05-24 Tue 14:40:13:921.098 PDT a7s10 [Thread
139724471654144, Pid 29930]: [SYS_INFO]: FlowLogDataObject: flowdata= [ [ [ flowuuid = 7ea8bf8f-b827-496e-
b93e-7622a0c8eeea direction_ing = 1 sourcevn = default-domain:mock-gen-test:vn8 sourceip = 1.0.0.9 destvn =
default-domain:mock-gen-test:vn58 destip = 1.0.0.59 protocol = 1 sport = -29520 dport = 20315 setup_time =
1464125225556930 bytes = 1035611592 packets = 2024830 diff_bytes = 27240 diff_packets = 40 ], ] ]
NOTE: Several individual flow messages might be packed into a single syslog message for
improved efficiency.
107
IN THIS SECTION
An alarm configuration object can be anchored in the configuration data model under global-system-config
or project, depending on the alarm type. Under global-system-config, you should configure virtual network
system-wide alarms, such as those for the analytics node, the config node, and so on. Under project, you
should configure alarms related to project objects, such as virtual networks and similar objects.
1. Navigate to Configure > Alarms> Project, and select the desired project to access the Alarm Rules
page.
2. Click the Gear icon to add a new alarm configuration or to edit an existing alarm configuration. Use
the Edit screen to define descriptions and to set up alarm rules. See Table 6 on page 108 for field
descriptions.
108
Field Description
Severity Select the severity level of the alarm from the list.
UVE Keys Select the list of UVE types to apply to this alarm.
Rule Set up the alarm rules. Alarm rules are expressed as OR of AND terms.
Each term has operand1, operand2, and the operation. Operand1 is the
UVE attribute. Operand2 can be either another UVE attribute or a JSON
value. The rules are evaluated in the contrail-alarm-gen service and an
alarm is raised or cleared as needed on respective conditions.
3. To monitor alarms, navigate to Monitor > Alarms> Dashboard. The Dashboard screen lists the active
alarms in the system.
109
Contrail uses a statistical process control model for time-series anomaly detection that can be computed
online, in real-time. Raw metrics are sent as statistics by Sandesh generators embedded inside the UVEs.
The model uses the running average and running standard deviation for a given raw metric. The model
does not account for seasonality and linear trends in the metric.
The following example represents part of the UVE sent by the vRouter to the collector. The raw metrics
are phy_band_in_bps and phy_band_out_bps.
The derived statistics are in in_bps_ewm and out_bps_ewm, which are generated when the model’s EWM
algorithm is applied to the raw metrics. The raw metrics and the derived statistics are part of the UVE
and are sent to the collector.
struct EWMResult {
3: u64 samples
6: double mean
7: double stddev
}
The following shows part of the UVE that lists the raw metric phy_band_out_bps and the derived statistic
out_bps_ewm. The user can define an alarm based on the values in sigma or in stddev.
Contrail analytics stores all of the monitored messages in the Contrail database node, and the analytics
generates a large amount of useful information that aids in monitoring and troubleshooting the network.
With Contrail, the user-defined log statistic feature provides additional abilities for monitoring and
troubleshooting by enabling the user to set a counter on any regular Perl-type expression. Each time the
pattern is found in any system logs, UVEs, or object logs, the counter is incremented.
111
The user-defined log statistic can be configured from the Contrail UI or from the command line, using
vnc_api.
1. Navigate to Configure > Infrastructure > Global Config and select Log Statistic.
2. To create a log statistic, click the plus (+) icon to access the Create Log Statistic screen. Enter a name
for the user-defined log statistic, and in the RegExp Pattern field, enter the Perl-type expression to
look for and count.
3. To edit an existing log statistic, select the name of the statistic and click the Gear icon, then select
Edit to access the Edit Log Statistic screen.
112
4. To delete a log statistic, select the name of the statistic and click the gear icon, then select the Delete
option.
user@host:~# python
Python 2.7.6 (default, Jun 22 2015, 17:58:13)
[GCC 4.8.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
To add a counter:
>> g=GlobalSystemConfig()
>> g.add_user_defined_counter(UserDefinedLogStat('Foo', 'Ba.*r'))
>> vnc.global_system_config_update(g)
To verify an addition:
A current sample from your system can be obtained from the UVE at:
http://<analytics-ip>:8081/analytics/uves/user-defined-log-statistic/<name>
You can also use the statistics table UserDefinedLogStatTable to get historical data with all supported
aggregations such as SUM, AVG, and the like.
http://<ip>:8081/analytics/table/StatTable.UserDefinedCounter.count/schema
{
"type": "STAT",
"columns": [
{
114
"datatype": "string",
"index": true,
"name": "Source",
"suffixes": null
},
{
"datatype": "int",
"index": false,
"name": "T",
"suffixes": null
},
{
"datatype": "int",
"index": false,
"name": "CLASS(T)",
"suffixes": null
},
{
"datatype": "int",
"index": false,
"name": "T=",
"suffixes": null
},
{
"datatype": "int",
"index": false,
"name": "CLASS(T=)",
"suffixes": null
},
{
"datatype": "uuid",
"index": false,
"name": "UUID",
"suffixes": null
},
{
"datatype": "int",
"index": false,
"name": "COUNT(count)",
"suffixes": null
},
{
"datatype": "int",
115
"index": false,
"name": "count.previous",
"suffixes": null
},
{
"datatype": "int",
"index": false,
"name": "SUM(count.previous)",
"suffixes": null
},
{
"datatype": "int",
"index": false,
"name": "CLASS(count.previous)",
"suffixes": null
},
{
"datatype": "int",
"index": false,
"name": "MAX(count.previous)",
"suffixes": null
},
{
"datatype": "int",
"index": false,
"name": "MIN(count.previous)",
"suffixes": null
},
{
"datatype": "percentiles",
"index": false,
"name": "PERCENTILES(count.previous)",
"suffixes": null
},
{
"datatype": "avg",
"index": false,
"name": "AVG(count.previous)",
"suffixes": null
},
{
"datatype": "string",
"index": true,
116
"name": "name",
"suffixes": null
}
]
}
Table 7 on page 116 lists the default alarms in Contrail Networking and their severity levels.
An alarm with severity level 0 (zero) is critical, 1 (one) is major, and 2 (two) is minor.
system-defined-bottle-request- - Bottle request size limit Request Size received by API server
size-limit exceeded. is too large.
• no IP or subnet assignment
• VLAN is down
• config is missing
system-defined-core-files 0 A core file has been There is some core file in the node.
generated on the node.
system-defined-pending- 1 Pending compaction tasks This alarm is raised when disk space
cassandra- in cassandra crossed the is insufficient. Check Cassandra
compaction-tasks configured threshold. system logs to understand the
reason for pending compaction.
120
system-defined-vrouter-limit- 1 Agent resource usage This alarm is raised when the next
exceeded exceeded configured hop count or the used mpls label
watermark for resource. count crosses the high watermark.
system-defined-vrouter-table- 0 Agent resource usage This alarm is raised when the next
limit- exceeded table size for hop count reaches the nexthop count
exceeded resource in vRouter. configured in vRouter, or when the
maximum number of MPLS labels
on the compute are used.
Alarms History
IN THIS SECTION
Contrail allows you to view a history of alarms that were raised or reset. You can also view a history of
user-visible entities (UVEs) that have been changed.
122
In the Contrail Web user interface, new fields at Monitor > Alarms > Dashboard > Alarms History now
display alarms history, including alarms that were set or reset. Figure 15 on page 122 shows the alarms
history, identifying the volume and types of alarms by time and the node types in which events are
occurring. The right side panel lists by name the nodes in which active events are occurring.
You can also use a contrail-status query to view the alarms history. Additionally, the contrail-status
displays a history of added, updated, and removed information for UVEs in Contrail.
Tooltips are available on the Alarms History page. In the Events area, you can click on any node type
listed to display a tooltip showing details of the events that have been added and cleared in that node,
see Figure 16 on page 123.
123
You can expand the event log in the right side panel to display a detailed event log. Click the name of
any node in the list in the right panel, and the details of the current alarms are visible in the expanded
view, see Figure 17 on page 124.
124
RELATED DOCUMENTATION
To help in monitoring and debugging, the following statistics have been added for all node types. The
statistics are updated every 60 seconds.
You can see a current sample from the UVE in your system at:
http://<analytics-ip>:8081/analytics/uves/<node-type>/<hostname>?flat
125
You can also use the statistics tables to get historical data with all supported aggregations, such as SUM,
AVG, and so on:
• NodeStatus.process_mem_cpu_usage
• NodeStatus.system_mem_cpu_usage
The schema for the tables are at the following locations on your system:
http://<analytics-ip>:8081/analytics/table/StatTable.NodeStatus.process_mem_cpu_usage/schema
http://<analytics-ip>:8081/analytics/table/StatTable.NodeStatus.system_mem_cpu_usage/schema
RELATED DOCUMENTATION
Role- and Resource-Based Access Control for the Contrail Analytics API
In previous releases of Contrail, any user can access the Contrail analytics API by using queries to get
historical information and by using UVEs to get state information.
With Contrail, it is possible to restrict access such that only the cloud-admin user can access the Contrail
analytics API.
• An external user makes a REST API call to contrail-analytics-api, passing a token representing the user
with the HTTP header X-Auth-Token.
• Based on the user role, contrail-analytics-api will only allow access for the cloud-admin user and reject
the request (HTTPUnauthorized) for other users.
• no-auth
• cloud-admin
• cloud_admin_role—The user with this role has full access to everything. By default, this is set to "admin".
This role must be configured in Keystone.
126
RELATED DOCUMENTATION
IN THIS SECTION
Starting with Contrail 4.0, it is possible to configure Contrail Analytics as a standalone solution.
Starting with Contrail 4.0 (containerized Contrail), Contrail Analytics can be configured as a standalone
solution.
• config
• webui
• analytics
• analyticsdb
• analytics container
• analyticsdb container
The following are examples of default inventory file configurations for the controller container for
standalone Contrail analytics.
127
The following are example analytics standalone solution inventory file configurations for Contrail
controller container components.
[contrail-controllers]
10.xx.32.10 controller_components=['config','webui']
[contrail-analyticsdb]
10.xx.32.10
[contrail-analytics]
10.xx.32.10
Multi-Node Cluster
[contrail-controllers]
10.xx.32.10 controller_components=['config','webui']
10.xx.32.11 controller_components=['config','webui']
10.xx.32.12 controller_components=['config','webui']
[contrail-analyticsdb]
10.xx.32.10
10.xx.32.11
10.xx.32.12
[contrail-analytics]
10.xx.32.10
10.xx.32.11
10.xx.32.12
The following are example JSON file configurations for (server.json) for Contrail analytics standalone
solution.
128
{
"cluster_id": "cluster1",
"domain": "sm-domain.com",
"id": "server1",
"parameters" : {
"provision": {
"contrail_4": {
"controller_components": "['config',’webui']"
},
…
…
}
{
"cluster_id": "cluster1",
"domain": "sm-domain.com",
"id": "server1",
"parameters" : {
"provision": {
"contrail_4": {
"controller_components": "['config',’webui']"
},
…
…
},
{
"cluster_id": "cluster1",
"domain": "sm-domain.com",
"id": "server2",
"parameters" : {
"provision": {
"contrail_4": {
"controller_components": "['config',’webui']"
},
…
…
129
},
{
"cluster_id": "cluster1",
"domain": "sm-domain.com",
"id": "server3",
"parameters" : {
"provision": {
"contrail_4": {
"controller_components": "['config',’webui']"
},
…
…
}
RELATED DOCUMENTATION
IN THIS SECTION
Config | 131
Oper-DB | 132
Controller | 138
UVE | 140
Services | 140
130
The VNsw Agent (also called Agent) in Contrail Networking is responsible for managing the data plane
component. It is similar to any datapath agent that runs on the line cards of a network node. Agent
responsibilities include:
• Interface with contrail-controller to get the configuration. Agent receives the configuration and
translates it into a form that the datapath can understand.
• Translate the data model from IF-MAP to the data model used by datapath.
• Config
• Oper-DB
• Controller
• UVE
• Pkt
• Services
• KSync
Agent by itself is not a program or daemon. Based on the platform, daemons are built using the modules
listed above. The contrail-vxlan-agent is the port of contrail-vrouter-agent on platforms supporting VXLAN
bridges. Figure 18 on page 131 provides an overview of the different modules involved.
131
Config
Config module implements the northbound interface for Agent. Agent gets two types of configurations,
virtual machine ports and IF-MAP.
Virtual-Machine Ports
Agent opens a thrift service (name InstanceService) to listen for Port-Add/Port-Delete message. Port-
Add informs agent about a virtual machine (VM) interface created on the compute node. The Port-Add
message also contains the following information:
Once agent knows about the creation of a port, it will send a subscribe message to contrail-controller for
virtual-machine. When contrail-controller receives the subscribe message for a virtual-machine, it walks
through the IF-MAP graph and sends all configuration relevant for the virtual-machine to the Agent. The
module invoking port add message is platform dependent. In the case of OpenStack, nova-compute service
invokes the message.
IF-MAP
All of the Contrail Virtual Network Controller (VNC) configuration is stored as a Metadata Access Point
(MAP) database. The MAP database is accessed using IF-MAP protocol.
Agent does not access the MAP database directly. Instead, Agent opens an XMPP connection to
contrail-controller to get the MAP configuration. The contrail-controller works on a subscription model.
Agent must subscribe to the virtual machines of interest and contrail-controller will download all of the
configuration relevant to the virtual-machine. As a result, Agent receives only the minimal configuration
needed. Agent subscribes to a virtual-machine when it receives a port add message for a virtual-machine-
interface.
Agent uses the ifmap-agent-client library to parse the IF-MAP messages from the XMPP channel to the
contrail-controller. The ifmap-agent-client defines a DBTable for every IF-MAP node type. A special DBTable is
defined to store the IF-MAP links. The ifmap-agent-client also creates a graph for ease of navigating the
IF-MAP configuration. An IF-MAP node is vertex in the graph and links form the edges in the graph.
Configuration Management
Config module registers DBTables of interest from the ifmap-agent-client library. Any add, delete, or update
of the configuration results in a callback to the Config module. The Config module then does basic
validation on the config nodes and then triggers the operational module to process the configuration.
Redundancy
Agent connects to two different control nodes for redundancy. When the XMPP connection for one of
the control node fails, it will subscribe to the other control node for configuration. When connecting to
the new control node, Config module audits the configuration to remove stale configuration.
Oper-DB
The Oper-DB module holds the operational state of the different objects in Agent. The operational state
processes the configuration and creates different tables appropriate for Agent.
Virtual Network
Table of all virtual-networks with UUID as the key. It contains the following information:
Item Description
IPAM Data The IP Address Management (IPAM) configured for the virtual-network. It includes DHCP
configuration, DNS configuration, subnet configuration, and so on.
Network Policy Network policy access control list (ACL) for the virtual-network.
VXLAN-ID Virtual Extensible Local Area Network ID (VXLAN-ID) to be used when VXLAN
encapsulation is used.
Layer 3 Forwarding Specifies if layer3_forwarding is enabled for IPv4 and IPv6 packets.
Bridging Specifies if bridge forwarding is enabled. Even if layer3_forwarding is disabled, IPv4 and
IPv6 packets are bridge forwarded.
VRF
The virtual routing and forwarding (VRF) table represents a routing-instance in configuration. Each virtual-
network has a "native" VRF. Other than the per virtual-network VRF, there can be other internal VRFs. The
internal VRFs are used in features, such as service chaining.
Table Description
EVPN Table Table containing EVPN routes keyed with MAC address, IP address, and vxlan/
ethernet_tag.
Bridge Table Table containing MAC addresses. The bridge table is currently used only in the case of a
"native" VRF for a virtual-network.
OpenStack Agent implicitly creates a VRF for fabric-network with the name default-domain:default-
project:ip-fabric:__default__.
Xen Agent implicitly creates a VRF for fabric-network with the name default-domain:default-
project:__link_local__.
Virtual Machine
The virtual machine table stores all virtual-machines created on the compute node.
Interface
The interface table contains all of the interfaces in Agent. Based on the type of interface, the trigger to
create an interface can vary. Also, the key fields used to uniquely identify the interface and the data
fields in an interface can vary based on the type of interface.
Item Description
Physical Represents physical ports on the compute node. Physical interfaces are created based on the
Interface config-file for Agent.
Packet Interface used to exchange packets between vRouter and Agent. Typically named pkt0, this
Interface interface is automatically created in Agent.
Inet interface he layer 3 inet interfaces are managed by Agent. Agent can have one or more inet interfaces
based on the platform used.
• OpenStack: In the case of OpenStack, Agent creates the vhost0 inet-interface. vhost0 is a
layer 3 interface in host-os. Agent uses this layer 3 interface for tunnel encapsulation and
decapsulation. The interface is added into the fabric VRF.
• Xen: In the case of Xen, Agent creates the xapi0 interface. The xapi0 interface is added into
the Xen link-local VRF.
• vGW: Every vGW Virtual Gateway instance has a vGW interface created. The vGW interface
is an unnumbered interface and does not have an IP address.
VM Interface This interface represents a virtual-machine-interface. The interface is created when Agent
receives an AddPort message from the Apache Thrift service InstanceService.
An interface is in Active state if all of the necessary configuration for the interface is available and it can
be made operational.
An interface is in Inactive state if it cannot be made operational. The reason can be missing
configuration, the link-state down, and so on.
136
Routes
Every VRF has a set of routing tables for inet4 unicast routes, inet4 mulitcast routes, EVPN routes, and
bridge MAC entries.
Every route specifies the forwarding action for a destination. Agent has multiple modules that can have
different views of forwarding action for a destination. Each forwarding action is specified in the form of
a path. Each module that adds a path is identified by a peer in the path.
Route keeps the list of paths sorted. The head of this list is treated as the Active path for the route.
The unicast routing table also maintains route entries in the Patricia tree form to support longest prefix
match (LPM) on the tree.
Next Hop
Next hop describes the forwarding action for routes pointing to it. When route lookup for an address
hits the route, the forwarding action for the packet is defined by the next hop.
Type Description
Receive Packets hitting Receive next hop are destined to the host-os. The next hop has an interface on
which packets must be transmited.
Resolve Packets hitting Resolve next hop need ARP resolution. For example, if IP address 10.1.1.1/24 is
assigned to interface vhost0, the following routes and next hop are generated.
• Route 10.1.1.0/24 is added with Resolve next hop. Any packet hitting this route triggers
ARP resolution.
ARP Routes created as a result of ARP resolution, that point to ARP next hop. In the example
above, you can have routes 10.1.1.1.2/32, 10.1.1.3/32, and so on pointing to ARP next hop.
137
Type Description
Interface Specifies that packets hitting this next hop must be transmitted on the interface.
Tunnel Specifies that packets hitting this next hop must be encapsulated in a tunnel. The tunnel next
hop specifies tunnel destination IP address. The packet post tunneling is routed on the fabric
network.
Multicast Mulitcast composite next hop contains a list of component next hops. Packets hitting the
Composite multicast composite next hop are replicated and transmitted on all the component next hops.
ECMP Equal Cost Multi-Path (ECMP) composite next hop contains a list of component next hops.
Composite Packets hitting the ECMP composite next hop must be sent out on one of the component next
hops. Packet forwarding component must ensure that packets for a connection are always
transmitted on the same component next hop of a ECMP composite next hop.
ECMP composite next hop is used to load balance traffic across multiple next hops.
MPLS
The MPLS label defines the forwarding action for MPLS tunneled packets received on the fabric
network.
The label-range for multicast composite next hop is preallocated and does not overlap with other labels.
Multicast
VXLAN
Controller
This module manages the communication between Agent and contrail-controller. Agent connects to two
Contrail controllers for redundancy. Two XMPP channels are opened with each of the Contrail
controllers.
Configuration Channel
The Contrail controller uses this channel to send IF-MAP configuration to Agent. Agent subscribes to
configuration from only one of the XMPP channels at a time. If the subscribed channel fails, it will switch
subscription to the other channel.
Route Channel
This channel is used to exchange routes between Agent and Contrail controller. Agent connects to two
Contrail controllers at a time and routes are exchanged between both of the channels. Routes from each
of the channels is added with a different "Route Peer." When one of the channels fails, it only deletes
"Route Path" from the channel that failed.
Route Export
Agent exports routes for virtual-machines created on the local compute node. Agent exports the route
with the following information:
• Gateway for the route. This is implicitly derived from the XMPP channel.
The control node implicitly derives the virtual-network name for the route from the routing-instance.
139
Route Import
Agent subscribes to all routing-instances in the VRF table. The contrail-controller collects routes from all
Agents. Controller synchronizes routes in a routing-instance if Agent is subscribed to the routing-instance.
Routes are exchanged between Agent and contrail-controller over the XMPP channel in XML format.
Controller module decodes the XMPP messages and adds or deletes "Route Paths" into the routing
tables. The contrail-controller provides the following information for every route:
• MPLS label for the route if MPLSoGRE or MPLSoUDP encapsulation is being used.
• Gateway for the route. This is implicitly derived from the XMPP channel.
The contrail-controller also reflects back the routes added by Agent itself. When the route is received,
Agent looks at the gateway IP address to identify if the route is hosted on a local compute node or a
remote compute node. If the route is hosted on a remote compute node, the Controller module creates
a next hop tunnel to be used in route. If the route is hosted on a local compute node, a route pointing to
the next hop interface is added.
Headless Mode
When the XMPP channel from Agent to the Contrail controller fails, Agent flushes all of the "Route
Paths" added by the controller. If the connection to both of the Contrail controllers fail, this can result in
deleting routes distributed by the controller.
Connections to Contrail controllers can fail for many reasons including network failure, Contrail
controller node failing, and so on. Deleting paths can result in connectivity loss between virtual
machines.
Headless mode is introduced as a resilient mode of operation for Agent. When running in headless
mode, Agent retains the last "Route Path" from Contrail controller. The "Route Paths" are held until a
new stable connection is established to one of the Contrail controllers. Once the XMPP connection is up
and is stable for a predefined duration, the "Route Paths" from the old XMPP connection are flushed.
140
Agent KSync
Oper-DB in Agent contains different tables and defines the data model used in the Agent. While the
Agent data model was initially developed for Contrail vRouter agent, it is mostly independent of the
underlying forwarding platform.
The data model used by datapath can vary based on the platform being ports. Agent KSync module is
responsible to do the translation between the data model used by Agent and the datapath.
• Provide translation between the data model of Agent and the forwarding plane.
• KSync will be aware of the data model used in the data plane.
• Keeps the operational state of Agent in sync with the forwarding plane.
Ex: KSync in Contrail vRouter agent is the only module that knows which flow table is memory
mapped into the Contrail vRouter Agent memory.
UVE
UVE module is responsible for generating UVE messages to the collector. UVE module registers with
Oper-DB and also polls the flows/vrouter to generate the UVE messages to the collector.
Services
• ARP
• DHCP
• DNS
• Ping
RELATED DOCUMENTATION
IN THIS SECTION
All Contrail services use Sandesh, a southbound interface protocol based on Apache Thrift, to send
analytics data such as system logs, object logs, UVEs, flow logs, and the like, to the collector service in
the Contrail Analytics node. The Transport Layer Security (TLS) protocol is used for certificate exchange,
mutual authentication, and negotiating ciphers to secure the Sandesh connection from potential
tampering and eavesdropping.
To configure a secure Sandesh connection, configure the following parameters in all Contrail services
that connect to the collector (Sandesh clients) and the Sandesh server.
All Contrail services are embedded with a web server that can be used to query the internal state of the
data structures, view trace messages, and perform other extensive debugging. The Transport Layer
Security (TLS) protocol is used for certificate exchange, mutual authentication, and negotiating ciphers
to secure the introspect connection from potential tampering and eavesdropping.
To configure a secure introspect connection, configure the following parameters in the Contrail service,
see Table 12 on page 142.
RELATED DOCUMENTATION
CHAPTER 3
IN THIS CHAPTER
Using the Wireshark Plugin to Analyze Packets Between vRouter and vRouter Agent on pkt0 Interface | 157
Mapping VLAN Tags from a Physical NIC to a VMI (NIC-Assisted Mirroring) | 162
IN THIS SECTION
Setting Up Traffic Mirroring Using Configure > Networking > Services | 144
Contrail provides traffic mirroring so you can mirror specified traffic to a traffic analyzer where you can
perform deep traffic inspection. Traffic mirroring enables you to designate certain traffic flows to be
mirrored to a traffic analyzer, where you can view traffic flows in great detail.
This section describes how to set up packet capture to mirror traffic packets to an analyzer.
policy for the traffic analyzer, the traffic analyzer instance should always have the Mirror to field
selected in the policy, do not select the Apply Service field for a traffic analyzer.
• analyzer-vm-console-two-if qcow2—This type of traffic analyzer has two interfaces, Left and
Management. This traffic analyzer can have any name except the name analyzer, which is reserved
for the single interface analyzer.
NOTE: The analyzer-vm images are valid for all versions of Contrail. Download the images from the
Contrail 1.0 software download page: https://www.juniper.net/support/downloads/?
p=contrail#sw .
You can set up traffic mirroring using Configure > Networking > Services. For more information, see
"Setting Up Traffic Mirroring Using Configure > Networking > Services" on page 144.
Field Description
Version Select v2 from the drop-down list to indicate that this service template is based on
templates version 2, valid for Contrail 3.0 and later.
Virtualization Type Select Virtual Machine from the drop-down list to indicate the virtualization type for
mirroring for this template.
Service Mode Select Transparent from the drop-down list to indicate that this service template is for
transparent mirroring.
Service Type Select Analyzer from the drop-down list to indicate that this service template is for a
traffic analyzer.
Interface(s) From the drop-down list, click the check boxes to indicate which interface types are
used for this analyzer service template:
• Left
• Right
• Management
4. Create a service instance by clicking the Service Instances link and clicking the + icon.
The Create window appears; make sure the Service Instance tab is selected. See Figure 21 on page
147.
147
Field Description
Service Template Select from a drop-down list of available service templates the
template to use for this service instance, analyzer-service-
template in this example.
Interface Type Each interface configured in the service template for this
instance appears in a list.
Virtual Network Select from a drop-down list of available virtual networks the
network for each interface that is configured for the instance.
148
Field Description
6. To create a network policy rule for this service instance, click Configure > Networking > Policies.
The Policies window appears. Click the + icon to get to the Create window; see Figure 22 on page
148.
7.
8. Enter a name for the policy, then click the + icon in the lower portion of the screen to configure
rules for the policy, see Figure 23 on page 149.
149
9. To add policy rules, complete the fields, using the guidelines in Table 15 on page 149.
NOTE: When there is a network policy attached to the virtual network, any conflicting rules
configured for the analyzer will not take effect.
Field Description
Protocol Select the protocol for the policy rule, or select ANY.
Source Select from multiple drop-down lists the source for this rule,
including options under CIDR, Network, Policy, or Security
Group.
Ports Select from a drop-down list the source ports for the rule.
• <> (bidirectional)
• > (unidirectional)
150
Field Description
Destination Select from multiple drop-down lists the destination for this rule,
including options under CIDR, Network, Policy, or Security
Group.
Ports Select from a list the destination ports for the packets to be
captured.
check boxes Check any box that applies to this rule: Log, Services, Mirror,
QoS.
RELATED DOCUMENTATION
Contrail supports user monitoring of traffic on any guest virtual machine interface when using the
Juniper Contrail user interface.
When interface monitoring (packet capture) is selected, a default analyzer is created and all traffic from
the selected interface is mirrored and sent to the default analyzer. If a mirroring instance is already
launched, the traffic will be redirected to the selected instance. The interface traffic is only mirrored
during the time that the monitor packet capture interface is in use. When the capture screen is closed,
interface mirroring stops.
1. Select Monitor > Infrastructure > Virtual Routers, then select the vRouter that has the interface to
mirror.
2. In the list of attributes for the vRouter, select Interfaces; see Figure 25 on page 151.
3. For the interface to mirror, click the Action icon in the last column and select the option Packet
Capture; see Figure 26 on page 152.
The mirror packet capture stops when you exit this screen.
RELATED DOCUMENTATION
Mirroring Enhancements
IN THIS SECTION
Additionally, mirroring can be configured on virtual machine (VM) interfaces to send all the traffic to and
from the interface to the specified analyzer.
When a packet is mirrored, a Juniper header is added to provide additional information in the analyzer,
then the packet is encapsulated and sent to the destination.
Starting with Contrail 3.x releases, mirroring is enhanced with the following options:
• When disabled, the Juniper header is not added to the mirrored packet.
• If dynamic is selected, the next hop based on the destination is used. Packets are forwarded to
the destination based on the encapsulation priority.
• If static is chosen, the next hop is created for the specified destination with VxLAN encapsulation
using the configured VNI, destination VTEP, and MAC to transmit the mirrored packets.
The default combination and the only supported case up to Release 3.0.2
• Static next hop, without Juniper header, with the original Layer 2 packet
The Contrail vrouter agent adds a mirror entry in the vrouter and points to the next hop to be used. The
data for the Juniper header is taken from the flow entry. For interface mirroring, the Juniper header has
a TLV in the metadata to use the interface name instead of providing a destination VN.
154
RELATED DOCUMENTATION
IN THIS SECTION
The analyzer uses the PCAP format, which has these parts:
• Global header
The global header is added by the analyzer service by means of the Wireshark instance. The vRouter DP
uses the configured UDP session to send mirrored packets to the analyzer, adding the PCAP packet
header to the packet data as it sends it over the UDP socket to the analyzer.
155
The following additional information is also added to the packet data as metadata:
• Ingress or egress
• Action (Pass/Deny/...)
In the existing PCAP, a network ID is added in the global header. The metadata (additional flow
information) is added in front of the existing packet as follows.
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-++-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-++-+-+-+-+-+-+
| Global header | Packet header| Meta data |Packet data| Packet header| Meta data |Packet data|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-++-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-++-+-+-+-+-+-+
Metadata Format
1. Type: 1 Byte
2. Length: 1 Byte
3. Value: up to length
Type
2. 2 - Action field
3. 3 – Source VN
4. 4 – Destination VN
Action field
156
Length is 2 bytes. Multiple bits might be turned on, if there are more actions. Ingress or egress bit will be
present in the Action field.
Source VN or Destination VN
TLV end
A special type 255 (0xFF) is used to identify the end of TLV entries. The TLV end must be last, at the end
of the metadata.
Wireshark Changes
A plugin is added to the Wireshark code. The plugin parses the metadata and displays the packet fields;
see example in Figure 27 on page 156.
1. Use tcpdump on the tap interfaces to see if packets are going towards the analyzer VM.
2. Check introspect to see whether the flow action has mirror activity in it or not.
RELATED DOCUMENTATION
Wireshark is a an application that analyzes packets from a network and displays the packet information
in detail.
Contrail Networking Release 2008 and later supports the Wireshark agent_header.lua plugin, which
enables you to capture and analyze the packets exchanged between a vRouter data plane and vRouter
agent. You can capture the packets by executing the vifdump -i 2 and the tcpdump -i pkt0 commands in
DPDK mode and kernel mode respectively. In release 2008, the Wireshark agent_header.lua plugin is
supported on Macintosh OS computers only. .Starting from release 2011, the Wireshark
agent_header.lua plugin is supported on Macintosh OS as well as Windows OS computers. Wireshark
also enables you to add agent header information to the captured packets.
You must ensure that the Wireshark application is installed on your computer. You can download
Wireshark from the Download Wireshark page.
Configuration
Follow these steps to configure the Wireshark plugin and dissect agent header information in a packet:
3. Verify that the agent_hdr.lua plugin is loaded successfully in Wireshark. Relaunch Wireshark and
navigate to Wireshark > About Wireshark > Plugins to verify that the plugin is loaded in the Plugins
section. See Figure 28 on page 158.
4. Pass the pcap file through editcap to add a custom encapsulation type for a packet:
editcap -T user0 <pcap-file-to-be-read> <output.pcap>
5. In Wireshark, navigate to Wireshark > Preferences > Protocols > DLT_USER > Edit Encapsulation
Table. See Figure 29 on page 159.
159
6. In the Edit Encapsulation Table, add the agent_hdr as a payload protocol for the packet. See Figure 30
on page 160.
160
7. Using Wireshark, open the modified pcap file you generated in step 4. Wireshark displays the parsed
packets. See Figure 31 on page 160.
Follow these steps to configure the Wireshark plugin in a Windows OS computer and dissect agent
header information in a packet:
2. If you are using Windows 32-bit OS, copy the plugin in to the following Wireshark directory on your
computer: C:\Program Files (x86)\Wireshark\.
If you are using Windows 64-bit OS, copy the plugin in to the following Wireshark directory on your
computer: C:\Program Files\Wireshark\plugins\.
3. Verify that the agent_hdr.lua plugin is loaded successfully in Wireshark. Relaunch Wireshark and
navigate to Help > About Wireshark > Plugins to verify that the plugin is loaded in the Plugins
section.
4. Open command prompt in Run as administrator mode and navigate to C:\Program Files\Wireshark
to use editcap. Pass the pcap file through editcap to add a custom encapsulation type for a packet:
5. In Wireshark, navigate to Edit > Preferences > Protocols > DLT_USER > Edit Encapsulation Table.
6. In the Edit Encapsulation Table, add the agent_hdr as a payload protocol for the packet. See .
7. Using Wireshark, open the modified pcap file you generated in step "4" on page 161. Wireshark
displays the parsed packets.
The agent_header.lua plugin is also available in contrail-tools container. You must perform the following
steps to use the plugin from the contrail-tools container:
2. Use the following command to view the summary of eachpacket in the pcap file:
3. Use the following command to view detailed informationof the packets in the pcap file:
Release Description
2011 Starting from release 2011, the Wireshark agent_header.lua plugin is supported on Macintosh OS as
well as Windows OS computers.
162
2008 Contrail Networking Release 2008 and later supports the Wireshark agent_header.lua plugin, which
enables you to capture and analyze the packets exchanged between a vRouter data plane and vRouter
agent.
RELATED DOCUMENTATION
When mirroring is enabled, the vRouter throughput reduces because of the additional packet handling
overhead caused by cloning the packet to be mirrored, encapsulating it in the required header, and
forwarding it to the mirror destination. Impact to throughput increases in proportion to the amount of
traffic that needs to be mirrored.
A solution to avoid impact on throughput due to mirroring is to use the mirroring capabilities of an
installed Network Interface Card (NIC).
Contrail Release 4.0 has the ability to mirror specific traffic to a traffic analyzer or to a physical probe
using the Network interface card (NIC) instead of the vRouter to mirror packets. When NIC-assisted
mirroring is enabled, ingress packets to be mirrored sent from a VM are routed to the NIC with a
configured VLAN tag. The NIC is configured for VLAN port-mirroring and mirrors any packet with the
VLAN tag.
In this approach, the vRouter doesn’t mirror the packets. When NIC-assisted mirroring is enabled, the
ingress packets coming from the VM that are to be mirrored are sent to the NIC with a configured VLAN
tag.
The NIC is programmed to do VLAN port mirroring, so that iany packet with the configured VLAN is
mirrored additionally by the NIC. This change in vRouter is only for traffic coming from the VMs. Traffic
coming from the fabric is directly mirrored from the NIC itself and there is no additional mirroring need
in vRouter. The programming of the NIC itself for appropriate mirroring is outside the scope of the
current activity. An example is the Niantic 82599 10G NIC, which supports VLAN port mirroring
options.
• VM traffic sent to another VM running on the same compute node will not be mirrored when NIC-
assisted mirroring is selected.
• When a VLAN interface is used as the fabric interface, traffic will be tagged first with the NIC-
assisted mirroring VLAN, followed by the VLAN tag on the fabric interface. The NIC-assisted
mirroring VLAN will be the inner tag and the fabric interface VLAN will be the outer tag.
The NIC must be programmed for VLAN port mirroring. While configuring mirroring in Contrail, the user
can indicate NIC-assisted mirroring with the VLAN tag. The Contrail UI supports NIC-assisted mirroring
configuration in the Ports page and in the Policies page with an additional flag for NIC-assisted mirroring
and the VLAN tag to be used.
RELATED DOCUMENTATION
CHAPTER 4
IN THIS CHAPTER
The Monitor icon on the Contrail Controller provides numerous options so you can view and analyze
usage and other activity associated with all nodes of the system, through the use of reports, charts, and
detailed lists of configurations and system activities.
Use the menu options available from the Monitor icon to configure and view the statistics you need for
better understanding of the activities in your system. See Figure 32 on page 165
165
See Table 16 on page 165 for descriptions of the items available under each of the menu options from
the Monitor icon.
Option Description
Infrastructure > Dashboard Shows “at-a-glance” status view of the infrastructure components,
including the numbers of virtual routers,control nodes, analytics nodes,
and config nodes currently operational, and a bubble chart of virtual
routers showing the CPU and memory utilization, log messages, system
information, and alerts. See "Monitor > Infrastructure > Dashboard" on
page 168.
166
Option Description
Infrastructure > Control Nodes View a summary for all control nodes in the system, and for each control
node, view:
• A list of all peers with details about type, ASN, and the like.
• A list of all routes, including next hop, source, local preference, and
the like.
Infrastructure > Virtual Routers View a summary of all vRouters in the system, and for each vRouter,
view:
• A list of all active flows with source and destination details, size, and
time.
Infrastructure > Analytics Nodes View activity for the analytics nodes, including memory and CPU usage,
analytics host names, IP address, status, and more. See "Monitor >
Infrastructure > Analytics Nodes" on page 197.
Infrastructure > Config Nodes View activity for the config nodes, including memory and CPU usage,
config host names, IP address, status, and more. See "Monitor >
Infrastructure > Config Nodes" on page 205.
167
Option Description
Networking > Networks For all virtual networks for all projects in the system, view graphical
traffic statistics, including:
• The most active ports, peers, and flows for a specified duration.
Networking > Dashboard For all virtual networks for all projects in the system, view graphical
traffic statistics, including:
You can view the statistics in varying levels of granularity, for example,
for a whole project, or for a single network. See "Monitor > Networking"
on page 209.
Networking > Projects View essential information about projects in the system including name,
associated networks, and traffic in and out.
Networking > Networks View essential information about networks in the system including name
and traffic in and out.
Networking > Instances View essential information about instances in the system including
name, associated networks, interfaces, vRouters, and traffic in and out.
168
Option Description
• View a list of all packet analyzers in the system and the details of
their configurations, including source and destination networks,
ports, and IP addresses.
RELATED DOCUMENTATION
IN THIS SECTION
Use Monitor > Infrastructure > Dashboard to get an “at-a-glance” view of the system infrastructure
components, including the numbers of virtual routers, control nodes, analytics nodes, and config nodes
169
currently operational, a bubble chart of virtualrouters showing the CPU and memory utilization, log
messages, system information, and alerts.
Monitor Dashboard
Click Monitor > Infrastructure > Dashboard on the left to view the Dashboard. See Figure 33 on page
169.
Detailed information about monitoring each of the areas represented by the boxes is provided in the
links in Table 17 on page 170.
Control Nodes "Monitor > Infrastructure > Control Nodes" on page 172
Analytics Nodes "Monitor > Infrastructure > Analytics Nodes" on page 197
Config Nodes "Monitor > Infrastructure > Config Nodes" on page 205
Control Nodes
• Blue—working as configured.
vRouters
RELATED DOCUMENTATION
IN THIS SECTION
Navigate to Monitor > Infrastructure > Control Nodes to gain insight into usage statistics for control
nodes.
Field Description
Version The software version number that is installed on the control node.
CPU (%) The CPU percentage currently in use by the selected control node.
Memory The memory in MB currently in use and the total memory available for this control
node.
Total Peers The total number of peers for this control node.
Established in Sync Peers The total number of peers in sync for this control node.
Established in Sync vRouters The total number of vRouters in sync for this control node.
The Details tab provides a summary of the status and activity on the selected node, and presents
graphical displays of CPU and memory usage. See Table 19 on page 174 for descriptions of the fields on
this tab.
Field Description
Control Node Manager The operational status of the control node manager.
175
Field Description
Config Node The IP address of the configuration node associated with this control node.
Analytics Node The IP address of the node from which analytics (monitor) information is derived.
Analytics Messages The total number of analytics messages in and out from this node.
Peers The total number of peers established for this control node and how many are in
sync and of what type.
CPU The average percent of CPU load incurred by this control node.
Last Log The date and time of the last log message issued about this control node.
Control Node CPU/ A graphic display x, y chart of the average CPU load and memory usage incurred by
Memory Utilization this control node over time.
See Table 20 on page 176 for descriptions of the fields on the Console tab screen.
Field Description
Time Range Select a timeframe for which to review logging information as sent to the console. There are 11
options, ranging from the Last 5 mins through to the Last 24 hrs. The default display is for the
Last 5 mins.
1. All
2. _default_
3. XMPP
4. TCP
177
Field Description
1. SYS_EMERG
2. SYS_ALERT
3. SYS_CRIT
4. SYS_ERR
5. SYS_WARN
6. SYS_NOTICE
7. SYS_INFO
8. SYS_DEBUG
Search Enter any text string to search and display logs containing that string.
Limit Select from a list an amount to limit the number of messages displayed:
1. No Limit
2. Limit 10 messages
3. Limit 50 messages
Auto Refresh Click the check box to automatically refresh the display if more messages occur.
Display Logs Click this button to refresh the display if you change the display criteria.
178
Field Description
Reset Click this button to clear any selected display criteria and reset all criteria to their default settings.
Time This column lists the time received for each log message displayed.
Category This column lists the log category for each log message displayed.
Log Type This column lists the log type for each log message displayed.
Log This column lists the log message for each log displayed.
See Table 21 on page 179 for descriptions of the fields on the Peers tab screen.
Field Description
Field Description
Messages (Recv/Sent) The number of messages sent and received from this peer.
See Table 22 on page 181 for descriptions of the fields on the Routes tab screen.
181
Field Description
Routing Instance You can select a single routing instance from a list of all instances for which to display the
active routes.
Address Family Select an address family for which to display the active routes:
1. All (default)
2. l3vpn
3. inet
4. inetmcast
1. Limit 10 Routes
2. Limit 50 Routes
Peer Source Select from a list of available peers the peer for which to display the active routes, or select
All.
Prefix Enter a route prefix to limit the display of active routes to only those with the designated
prefix.
1. All (default)
2. XMPP
3. BGP
4. ServiceChain
5. Static
182
Field Description
Display Routes Click this button to refresh the display of routes after selecting different display criteria.
Reset Click this button to clear any selected criteria and return the display to default values.
Column Description
Routing Table The name of the routing table that stores this route.
Next hop The IP address of the next hop for each active route displayed.
IN THIS SECTION
See Table 23 on page 184 for descriptions of the fields on the vRouters Summary screen.
Field Description
Host name The name of the vRouter. Click the name of any vRouter to reveal more details.
CPU (%) The CPU percentage currently in use by the selected vRouter.
185
Field Description
Memory (MB) The memory currently in use and the total memory available for this vRouter.
• Details—similar display of information as on individual control nodes Details tab. See Figure 42 on
page 186.
• Console—similar display of information as on individual control nodes Console tab. See Figure 48 on
page 195.
Field Description
vRouter Node Manager The operational status of the vRouter node manager.
Analytics Node The IP address of the node from which analytics (monitor) information is derived.
Control Nodes The IP address of the configuration node associated with this vRouter.
Analytics Messages The total number of analytics messages in and out from this node.
XMPP Messages The total number of XMPP messages that have gone in and out of this vRouter.
Flow The number of active flows and the total flows for this vRouter.
187
Field Description
Last Log The date and time of the last log message issued about this vRouter.
vRouter CPU/Memory Graphs (x, y) displaying CPU and memory utilization averages over time for this
Utilization vRouter, in comparison to system utilization averages.
Field Description
Field Description
Field Description
ACLs The name of the access control list associated with the listed network.
VRF The identifier of the VRF associated with the listed network.
Field Description
UUID The universal unique identifier (UUID) associated with the listed ACL.
Source Network or Prefix The name or prefix of the source network associated with the listed ACL.
Source Port The source port associated with the listed ACL.
192
Field Description
Destination Network or Prefix The name or prefix of the destination network associated with the listed ACL.
Destination Port The destination port associated with the listed ACL.
Field Description
ACL UUID The default is to show All flows, however, you can select from a drop down list any single flow
to view its details.
ACL / SG UUID The universal unique identifier (UUID) associated with the listed ACL or SG.
Src Network The name of the source network associated with the listed flow.
Dest Network The name of the destination network associated with the listed flow.
Dest Port The destination port associated with the listed flow.
Bytes/Pkts The number of bytes and packets associated with the listed flow.
Setup Time The setup time associated with the listed flow.
Field Description
VRF Select from a drop down list the virtual routing and forwarding (VRF) to view.
Next hop details The next hop details for this route.
Field Description
Time Range Select a timeframe for which to review logging information as sent to the console. There are
several options, ranging from Last 5 mins through to the Last 24 hrs, plus a Custom time range.
From Time If you select Custom in Time Range, enter the start time.
To Time If you select Custom in Time Range, enter the end time.
• All
• _default_
• XMPP
• TCP
Field Description
• SYS_EMERG
• SYS_ALERT
• SYS_CRIT
• SYS_ERR
• SYS_WARN
• SYS_NOTICE
• SYS_INFO
• SYS_DEBUG
Limit Select from a list an amount to limit the number of messages displayed:
• No Limit
• Limit 10 messages
• Limit 50 messages
Auto Refresh Click the check box to automatically refresh the display if more messages occur.
Display Logs Click this button to refresh the display if you change the display criteria.
Reset Click this button to clear any selected display criteria and reset all criteria to their default settings.
Columns
197
Field Description
Time This column lists the time received for each log message displayed.
Category This column lists the log category for each log message displayed.
Log Type This column lists the log type for each log message displayed.
Log This column lists the log message for each log displayed.
IN THIS SECTION
Select Monitor> Infrastructure > Analytics Nodes to view the console logs, generators, and query
expansion (QE) queries of the analytics nodes.
Field Description
Status The current operational status of the node — Up or Down — and the length of time it is in that
state.
CPU (%) The average CPU percentage usage for this node.
See Table 32 on page 199 for descriptions of the fields on this screen.
Field Description
Overall Node Status The current operational status of the node — Up or Down — and the length of time in this
state.
Processes The current status of each analytics process, including Collector, Query Engine, and
OpServer.
200
Table 32: Monitor Analytics Individual Node Details Tab Fields (Continued)
Field Description
CPU (%) The average CPU percentage usage for this node.
Last Log The date and time of the last log message issued about this node.
Field Description
Status The current status of the peer— Up or Down — and the length of time in that state.
Messages The number of messages sent and received from this peer.
See Table 34 on page 201 for descriptions of the fields on the QE Queries tab screen.
Field Description
Enqueue Time The length of time this message has been in the queue waiting to be delivered.
Field Description
Field Description
Time Range Select a timeframe for which to review logging information as sent to the console. There are 11
options, ranging from the Last 5 mins through to the Last 24 hrs. The default display is for the
Last 5 mins.
203
Table 35: Monitor Analytics Individual Node Console Tab Fields (Continued)
Field Description
1. All
2. _default_
3. XMPP
4. TCP
1. SYS_EMERG
2. SYS_ALERT
3. SYS_CRIT
4. SYS_ERR
5. SYS_WARN
6. SYS_NOTICE
7. SYS_INFO
8. SYS_DEBUG
Keywords Enter any text string to search for and display logs containing that string.
204
Table 35: Monitor Analytics Individual Node Console Tab Fields (Continued)
Field Description
1. No Limit
2. Limit 10 messages
3. Limit 50 messages
Auto Refresh Click the check box to automatically refresh the display if more messages occur.
Display Logs Click this button to refresh the display if you change the display criteria.
Reset Click this button to clear any selected display criteria and reset all criteria to their default settings.
Time This column lists the time received for each log message displayed.
Category This column lists the log category for each log message displayed.
Log Type This column lists the log type for each log message displayed.
Log This column lists the log message for each log displayed.
205
IN THIS SECTION
Select Monitor > Infrastructure > Config Nodes to view the information about the system config nodes.
Table 36 on page 205 describes the fields in the Config Nodes summary.
Field Description
Field Description
Status The current operational status of the node — Up or Down — and the length of time it is in that
state.
CPU (%) The average CPU percentage usage for this node.
Field Description
Overall Node Status The current operational status of the node — Up or Down — and the length of time it is in
this state.
Processes The current operational status of the processes associated with the config node, including
AI Server, Schema Transformer, Service Monitor, and the like.
CPU (%) The average CPU percentage usage for this node.
See Table 38 on page 208 for descriptions of the fields on the Console tab screen.
Field Description
Time Range Select a timeframe for which to review logging information as sent to the console. Use the drop
down calendar in the fields From Time and To Time to select the date and times to include in the
time range for viewing.
Log Category Select from the drop down menu a log category to display. The option to view All is also
available.
Limit Select from a list an amount to limit the number of messages displayed:
1. All
2. Limit 10 messages
3. Limit 50 messages
Field Description
Keywords Enter any key words by which to filter the log messages displayed.
Auto Refresh Click the check box to automatically refresh the display if more messages occur.
Display Logs Click this button to refresh the display if you change the display criteria.
Reset Click this button to clear any selected display criteria and reset all criteria to their default settings.
IN THIS SECTION
The Monitor -> Networking pages give an overview of the networking traffic statistics and health of
domains, projects within domains, virtual networks within projects, and virtual machines within virtual
networks.
Table 39 on page 211 describes the fields in the Traffic Statistics for Domain window.
Field Description
Inter VN Traffic In The volume of inter-virtual network traffic into this domain.
Inter VN Traffic Out The volume of inter-virtual network traffic out of this domain.
212
Field Description
Projects This chart displays the networks and interfaces for projects with the most throughput over
the past 30 minutes. Click Projects then select Monitor > Networking > Projects, to display
more detailed statistics.
Networks This chart displays the networks for projects with the most throughput over the past 30
minutes. Click Networks then select Monitor > Networking > Networks, to display more
detailed statistics.
See Table 40 on page 213 for descriptions of the fields on this screen.
213
Field Description
Projects The name of the project. You can click the name to access details about connectivity for this project.
In the Connectivity Details window you can click the links between the virtual networks to view the
traffic statistics between the virtual networks.
214
The Traffic Statistics information is also available when you select Monitor > Networking > Networks as
shown in Figure 61 on page 214.
In the Connectivity Details window you can click the Instances tab to get a summary of details for each
of the instances in this project.
Field Description
Instance The name of the instance. Click the name then select Monitor > Networking > Instances to
display details about the traffic statistics for this instance.
Traffic (In/Out) The volume of traffic in KB or MB that is passing in and out of this instance.
Select Monitor > Networking > Instances to display instance traffic statistics as shown in Figure 63 on
page 216.
216
Field Description
Network The domain and network name of the virtual network. Click the arrow next to the name to
display more information about the network, including the number of ingress and egress
flows, the number of ACL rules, the number of interfaces, and the total traffic in and out.
Traffic (In/Out) The volume of inter-virtual network traffic in and out of this network.
Throughput (In/Out) The throughput of inter-virtual network traffic in and out of this network.
At Monitor > Networking > Networks you can click on the name of any of the listed networks to get
details about the network connectivity, traffic statistics, port distribution, instances, and other details, by
clicking the tabs across the top of the page.
Figure 65 on page 217 shows the Summary tab for an individual network, which displays connectivity
details and traffic statistics for the selected network.
Figure 66 on page 218 shows the Port Map tab for an individual network, which displays the relative
distribution of traffic for this network by protocol, by port.
Figure 67 on page 219 shows the Port Distribution tab for an individual network, which displays the
relative distribution of traffic in and out by source port and destination port.
219
Figure 68 on page 220 shows the Instances tab for an individual network, which displays details for each
instance associated with this network, including the number of interfaces, the associated vRouter, the
instance IP address, and the volume of traffic in and out.
Additionally, you can click the arrow near the instance name to reveal even more details about the
instance—the interfaces and their addresses, UUID, CPU (usage), and memory used of the total amount
available.
220
Figure 69 on page 221 shows the Details tab for an individual network, which displays the code used to
define this network -–the User Virtual Environment (UVE) code.
221
IN THIS SECTION
Select Query > Flows to perform rich and complex SQL-like queries on flows in the Contrail Controller.
You can use the query results for such things as gaining insight into the operation of applications in a
virtual network, performing historical analysis of flow issues, and pinpointing problem areas with flows.
The query fields available on the screen for the Flow Series tab are described in Table 43 on page 223.
Enter query data into the fields to create a SQL-like query to display and analyze flows.
223
Field Description
• Last 10 Mins
• Last 30 Mins
• Last 1 Hr
• Last 6 Hrs
• Last 12 Hrs
• Custom
Click Custom to enter a specific custom time range in two fields: From Time and To Time.
Select Click the edit button (pencil icon) to open a Select window (Figure 71 on page 224), where you
can click one or more boxes to select the fields to display from the flow series, such as Source
VN, Dest VN, Bytes, Packets, and more.
Where Click the edit button (pencil icon) to open a query-writing window, where you can specify query
values for variables such as sourcevn, sourceip, destvn, destip, protocol, sport, dport.
Filter Click the edit button (pencil icon) to open a Filter window (Figure 72 on page 225), where you
can select filter items to sort by, the sort order, and limits to the number of results returned.
Run Query Click Run Query to retrieve the flows that match the query you created. The flows are listed on
the lower portion of the screen in a box with columns identifying the selected fields for each
flow.
(graph buttons) When Time Granularity is selected, you have the option to view results in graph or flowchart
form. Graph buttons appear on the screen above the Export button. Click a graph button to
transform the tabular results into a graphical chart display.
224
Field Description
Export The Export button is displayed after you click Run Query. This allows you to export the list of
flows to a text .csv file.
The Select window allows you to select one or more attributes of a flow series by clicking the check box
for each attribute desired, see Figure 71 on page 224. The upper section of the Select window includes
field names, and the lower portion lets you select units. Select Time Granularity and then select
SUM(Bytes) or SUM(Packets) to aggregate bytes and packets in intervals.
Use the Filter window to refine the display of query results for flows, by defining an attribute by which
to sort the results, the sort order of the results, and any limit needed to restrict the number of results.
See Figure 72 on page 225.
225
The query returns tabular time series data, see Figure 74 on page 226, for the following combinations of
Source VN and Dest VN:
Because Time Granularity is selected, the results can also be displayed as graphical charts. Click the
graph button on the right side of the tabular results. The results are displayed in a graphical flow chart.
See Figure 75 on page 227.
227
The query fields available on the screen for the Flow Records tab are described in Table 44 on page 228.
Enter query data into the fields to create an SQL-like query to display and analyze flows.
228
Field Description
• Last 10 Mins
• Last 30 Mins
• Last 1 Hr
• Last 6 Hrs
• Last 12 Hrs
• Custom
Click Custom to enter a specified custom time range in two fields: From Time and To Time.
Select Click the edit button (pencil icon) to open a Select window (Figure 77 on page 229), where you can
click one or more boxes to select attributes to display for the flow records, including Setup Time,
Teardown Time, Aggregate Bytes, and Aggregate Packets.
Where Click the edit button (pencil icon) to open a query-writing window where you can specify query
values for sourcevn, sourceip, destvn, destip, protocol, sport, dport. .
Run Query Click Run Query to retrieve the flow records that match the query you created. The records are
listed on the lower portion of the screen in a box with columns identifying the fields for each flow.
Export The Export button is displayed after you click Run Query, allowing you to export the list of flows to
a text .csv file.
The Select window allows you to select one or more attributes to display for the flow records selected,
see Figure 77 on page 229.
229
You can restrict the query to a particular source VN and destination VN combination using the Where
section.
The Where Clause supports logical AND and logical OR operations, and is modeled as a logical OR of
multiple AND terms. For example: ( (term1 AND term2 AND term3..) OR (term4 AND term5) OR…).
The query fields available on the screen for the Flow Records tab are described in Table 45 on page 231.
Enter query data into the fields to create an SQL-like query to display and analyze flows.
Field Description
Time Taken The amount of time in seconds it has taken the query to return the matching records.
(Action icon) Click the Action icon and select View Results to view a list of the records that match the query, or
click Delete to remove the query from the queue.
RELATED DOCUMENTATION
Fat Flows
IN THIS SECTION
The Query > Logs option allows you to access the system log and object log activity of any Contrail
Controller component from one central location.
The query fields available on the Query System Logs screen are described in Table 46 on page 233.
Field Description
Time Range Select a range of time for which to see the system logs:
• Last 10 Mins
• Last 30 Mins
• Last 1 Hr
• Last 6 Hrs
• Last 12 Hrs
• Custom
If you click Custom, enter a desired time range in two new fields: From Time and To Time.
Where Click the edit button (pencil icon) to open a query-writing window, where you can specify query
values for variables such as Source, Module, MessageType, and the like, in order to retrieve specific
information.
234
Field Description
• SYS_NOTICE
• SYS_EMERG
• SYS_ALERT
• SYS_CRIT
• SYS_ERR
• SYS_WARN
• SYS_INFO
• SYS_DEBUG
Run Query Click this button to retrieve the system logs that match the query. The logs are listed in a box with
columns showing the Time, Source, Module Id, Category, Log Type, and Log message.
Export This button appears after you click Run Query, allowing you to export the list of system messages
to a text/csv file.
This section shows a sample system logs query designed to show all System Logs from ModuleId =
VRouterAgent on Source = b1s16 and filtered by Level = SYS_DEBUG.
1. At the Query System Logs screen, click in the Where field to access the Where query screen and
enter information defining the location to query in the Edit Where Clause section and click OK; see
Figure 82 on page 235.
235
2. The information you defined at the Where screen displays on the Query System Logs. Enter any
more defining information needed; see Figure 83 on page 236. When finished, click Run Query to
display the results.
236
The query fields available on the Object Logs screen are described in Table 47 on page 237.
237
Field Description
Time Range Select a range of time for which to see the logs:
• Last 10 Mins
• Last 30 Mins
• Last 1 Hr
• Last 6 Hrs
• Last 12 Hrs
• Custom
If you click Custom, enter a desired time range in two new fields: From Time and To Time.
Object Type Select the object type for which to show logs:
• Virtual Network
• Virtual Machine
• Virtual Router
• BGP Peer
• Routing Instance
• XMPP Connection
Object Id Select from a list of available identifiers the name of the object you wish to use.
Select Click the edit button (pencil icon) to open a window where you can select searchable types by
clicking a checkbox:
• ObjectLog
• SystemLog
238
Field Description
Where Click the edit button (pencil icon) to open the query-writing window, where you can specify query
values for variables such as Source, ModuleId, and MessageType, in order to retrieve information
as specific as you wish.
Run Query Click this button to retrieve the system logs that match the query. The logs are listed in a box with
columns showing the Time, Source, Module Id, Category, Log Type, and Log message.
Export This button appears after you click Run Query, allowing you to export the list of system messages
to a text/csv file.
This topic describes how to use the Sandesh infrastructure and the Contrail Introspect feature to debug
processes.
Introspect is a mechanism for taking a program object and querying information about it.
Sandesh is the name of a unified infrastructure in the Contrail Virtual Networking solution.
Sandesh is a way for the Contrail daemons to provide a request-response mechanism. Requests and
responses are defined in Sandesh format and the Sandesh compiler generates code to process the
requests and send responses.
Sandesh also provides a way to use a Web browser to send Sandesh requests to a Contrail daemon and
get the Sandesh responses. This feature is used to debug processes by looking into the operational
status of the daemons.
Each Contrail daemon starts an HTTP server, with the following page types:
• The main index.html listing all Sandesh modules and the links to them.
• Sandesh module pages that present HTML forms for each Sandesh request.
• An automatically generated page that shows all code needed for rendering and all HTTP server-client
interactions.
239
You can display the HTTP introspect of a Contrail daemon directly by accessing the following Introspect
ports:
Another way to launch the Introspect page is by browsing to a particular node page using the Contrail
Web user interface.
Figure 85 on page 240 shows the contrail-control infrastructure page. Notice the Introspect link at the
bottom of the Control Nodes Details tab window.
240
The following are the Sandesh modules for the Contrail control process (contrail-control) Introspect port.
• bgp_peer.xml
• control_node.xml
• cpuinfo.xml
• discovery_client_stats.xml
• ifmap_log.xml
• ifmap_server_show.xml
• rtarget_group.xml
241
• sandesh_trace.xml
• sandesh_uve.xml
• service_chaining.xml
• static_route.xml
• task.xml
• xmpp_server.xml
Figure 87 on page 241 shows an example of the BGP Peer (bgp_peer.xml) Introspect page.
Figure 88 on page 242 shows an example of the BGP Neighbor Summary Introspect page.
The following are the Sandesh modules for the Contrail vRouter agent (contrail-vrouter-agent)
Introspect port.
• agent.xml
• agent_stats_interval.xml
• cfg.xml
• controller.xml
• cpuinfo.xml
• diag.xml
• discovery_client_stats.xml
• flow_stats_interval.xml
• ifmap_agent.xml
• kstate.xml
• multicast.xml
• pkt.xml
• port_ipc.xml
• sandesh_trace.xml
243
• sandesh_uve.xml
• services.xml
• stats_interval.xml
• task.xml
• xmpp_server.xml
Figure 89 on page 243 shows an example of the Agent (agent.xml) Introspect page.
RELATED DOCUMENTATION
IN THIS SECTION
2. Click the instance to view Traffic Statistics for Instance. See Figure 91 on page 244.
6. Virtual Routers a3s18 and a3s19 have the ACL entries to allow connectivity between default-
domain:demo:vn0 and default-domain:demo:vn16 networks. See Figure 96 on page 246 and Figure 97 on
page 246.
7. Next, verify the routes on the control node for routing instances default-domain:demo:vn0:vn0 and
default-domain:demo:vn16:vn16. See Figure 98 on page 247 and Figure 99 on page 247.
247
8. We can see that VRF default-domain:demo:vn0:vn0 on Virtual Router a3s18 has the appropriate route and
next hop to reach VRF default-domain:demo:front-end on Virtual Router a3s19. See Figure 100 on page
248.
248
9. We can see that VRF default-domain:demo:vn16:vn16 on Virtual Router a3s19 has the appropriate route
and next hop to reach VRF default-domain:demo:vn0:vn0 on Virtual Router a3s18. See Figure 101 on
page 249.
249
10. Finally, flows between instances (IPs 192.168.0.252 and 192.168.16.253) can be verified on Virtual
Routers a3s18 and a3s19. See Figure 102 on page 249 and Figure 103 on page 250.
IN THIS SECTION
Appendix | 268
Contrail analytics is comprised of four building blocks. The last three listed are optional components.
• Analytics collector
• Analytics alarm
• Analytics SNMP
• Analytics database
251
Regardless that the alarm, SNMP, and database analytics roles have not been installed and if installed are
disabled, these components show as active when you run the Linux $sudo commands or view in Contrail
Command. For more information, see the section “TripleO Provisioning” below.
Multi-nodes Contrail controller components are split onto three servers (Contrail controller, Contrail
analytics, and Contrail analytics database). Only the first two servers are mandatory since
Contrail analytics database is an optional component. This type of topology is used in
production deployments.
$ sudo contrail-status
== Contrail control ==
control: active
nodemgr: active
named: active
dns: active
252
== Contrail config-database ==
nodemgr: active
zookeeper: active
rabbitmq: active
cassandra: active
== Contrail config ==
svc-monitor: active
nodemgr: active
device-manager: active
api: active
schema: active
== Contrail webui ==
web: active
job: active
Following is the Contrail status on Contrail analytics node when Contrail analytics SNMP and Contrail
analytics alarm have both been deployed:
$ sudo contrail-status
Pod Service Original Name
Original Version State Id Status
analytics api contrail-analytics-api rhel-
queens-1910-23 running 62980f3e6479 Up 2 weeks
analytics collector contrail-analytics-collector rhel-
queens-1910-23 running b777437946c2 Up 2 weeks
analytics nodemgr contrail-nodemgr rhel-
queens-1910-23 running aeeb744a5b5e Up 2 weeks
analytics redis contrail-external-redis rhel-
queens-1910-23 running 150b6225bd93 Up 2 weeks
analytics-alarm alarm-gen contrail-analytics-alarm-gen rhel-
queens-1910-23 running d655146cb8d0 Up 2 weeks
analytics-alarm kafka contrail-external-kafka rhel-
queens-1910-23 running 8cfa8c7da4bd Up 2 weeks
analytics-alarm nodemgr contrail-nodemgr rhel-
queens-1910-23 running 685a5f817f0b Up 2 weeks
analytics-alarm zookeeper contrail-external-zookeeper rhel-
queens-1910-23 running a41dc5658c72 Up 2 weeks
253
== Contrail analytics ==
nodemgr: active
api: active
collector: active
== Contrail analytics-alarm ==
nodemgr: active
kafka: active
alarm-gen: active
== Contrail analytics-snmp ==
snmp-collector: active
nodemgr: active
topology: active
Following is an example of the Contrail status on Contrail analytics node when Contrail analytics SNMP
and Contrail analytics alarm have not been deployed:
$ sudo contrail-status
Pod Service Original Name Original Version
State Id Status
analytics api contrail-analytics-api rhel-queens-2005-62
running 489b07cbbbef Up 18 hours
analytics collector contrail-analytics-collector rhel-queens-2005-62
running 5da4f99b045f Up 18 hours
analytics nodemgr contrail-nodemgr rhel-queens-2005-62
running 28053f64f1bc Up 18 hours
analytics provisioner contrail-provisioner rhel-queens-2005-62
running faa8de6d17e4 Up 18 hours
analytics redis contrail-external-redis rhel-queens-2005-62
running 3e29dcc475d1 Up 18 hours
254
== Contrail analytics ==
nodemgr: active
api: active
collector: active
Contrail analytics database is only deployed when the analytics database component is enabled. The
following example shows the Contrail status on the Contrail analytics database node:
$ sudo contrail-status
Pod Service Original Name Original Version
State Id Status
database cassandra contrail-external-cassandra rhel-queens-1910-
23 running ec05bd8c34c4 Up 2 weeks
database nodemgr contrail-nodemgr rhel-queens-1910-
23 running 25a6c58d5144 Up 2 weeks
database query-engine contrail-analytics-query-engine rhel-queens-1910-
23 running f90f7ae16b48 Up 2 weeks
== Contrail database ==
nodemgr: active
query-engine: active
cassandra: active
Following is the Contrail status on Contrail controller node when Contrail analytics SNMP, Contrail
analytics alarm, and Contrail analytics database have been deployed:
$ sudo contrail-status
Pod Service Original Name
Original Version State Id Status
255
== Contrail control ==
control: active
nodemgr: active
named: active
dns: active
== Contrail analytics-alarm ==
nodemgr: active
kafka: active
alarm-gen: active
== Contrail database ==
nodemgr: active
query-engine: active
cassandra: active
== Contrail analytics ==
nodemgr: active
api: active
collector: active
== Contrail config-database ==
nodemgr: active
zookeeper: active
rabbitmq: active
257
cassandra: active
== Contrail webui ==
web: active
job: active
== Contrail analytics-snmp ==
snmp-collector: active
nodemgr: active
topology: active
== Contrail config ==
svc-monitor: active
nodemgr: active
device-manager: active
api: active
schema: active
Contrail database (query), analytics alarm, and SNMP are deployed and active.
Following is an example of the Contrail status on Contrail controller node when Contrail analytics SNMP,
Contrail analytics alarm, and Contrail analytics database have not been deployed:
$ sudo contrail-status
Pod Service Original Name
Original Version State Id Status
analytics api contrail-analytics-api
rhel-queens-2005-62 running b1ddca562595 Up 10 hours
analytics collector contrail-analytics-collector
rhel-queens-2005-62 running f6860911ee16 Up 10 hours
analytics nodemgr contrail-nodemgr
rhel-queens-2005-62 running 37a0d8744e31 Up 10 hours
analytics provisioner contrail-provisioner
rhel-queens-2005-62 running e2f9a4605d63 Up 10 hours
analytics redis contrail-external-redis
rhel-queens-2005-62 running 1d0a193983b0 Up 10 hours
analytics stunnel contrail-external-stunnel
rhel-queens-2005-62 running 695d61045e63 Up 10 hours
config api contrail-controller-config-api
rhel-queens-2005-62 running 41eb0caef12d Up 10 hours
258
== Contrail control ==
control: active
nodemgr: active
named: active
dns: active
== Contrail analytics ==
nodemgr: active
259
api: active
collector: active
== Contrail config-database ==
nodemgr: active
zookeeper: active
rabbitmq: active
cassandra: active
== Contrail config ==
svc-monitor: active
nodemgr: active
device-manager: active
api: active
schema: active
== Contrail webui ==
web: active
job: active
Contrail database (query), analytics alarm, and SNMP are not deployed.
Contrail Web UI
Figure 105 on page 260 displays the Contrail Web UI dashboard with all optional analytics components
deployed.
260
Figure 107 on page 262 displays the Contrail Web UI dashboard without optional analytics components
deployed.
262
Figure 109 on page 263 displays the Monitor > Alarms menu.
Figure 110 on page 263 displays the Configure > Alarms menu.
Figure 111 on page 264 displays the dialog box which appears when Global Alarm, next to Logged in
User in the upper right, is selected.
264
If the alarm analytics component is not deployed, then Contrail Web UI should not display the following
alarm references:
There is not an appearance of Global Alarm or Alarms entry in the Monitor menu:
Figure 112: Analytics Alarm Disabled - Global Alarm and Alarm Not Available
Figure 114 on page 265 displays the Physical Topology option in the Monitor menu.
Figure 114: Analytics SNMP Feature Enabled - Physical Topology Menu Available
If the alarm analytics component is not provisioned, then Contrail Web UI does not display the Physical
Topology menu option.
266
Figure 115: Analytics SNMP Feature Disabled - Physical Topology Menu Not Available
If analytics database is provisioned, then Contrail Web UI displays the Query page.
If analytics database is not provisioned, then Contrail Web UI should not display the Query page. Query
page logo is unavailable to launch Query page.
267
Figure 117: Analytics Database Disabled - Query Page Logo Not Available
Tripleo Provisioning
In order to enable or disable the Contrail analytics optional components, TripleO templates have to be
modified.
- OS::TripleO::Services::ContrailAnalytics
- OS::TripleO::Services::ContrailAnalyticsSnmp
- OS::TripleO::Services::ContrailAnalyticsAlarm
- OS::TripleO::Services::ContrailAnalyticsDatabase
In order to enable or disable the Contrail analytics optional components, TripleO templates have to be
modified. In ContrailController role, ContrailAnalyticsSnmp, ContrailAnalyticsAlarm, and
ContrailAnalyticsDatabase resources can be removed, other contrail resources are kept:
- name: ContrailController
- OS::TripleO::Services::ContrailAnalytics
- OS::TripleO::Services::ContrailAnalyticsAlarm
268
- OS::TripleO::Services::ContrailAnalyticsDatabase
- OS::TripleO::Services::ContrailAnalyticsSnmp
- OS::TripleO::Services::ContrailCertmongerUser
- OS::TripleO::Services::ContrailConfig
- OS::TripleO::Services::ContrailConfigDatabase
- OS::TripleO::Services::ContrailControl
- OS::TripleO::Services::ContrailWebui
TripleO templates were updated in June 2020 to allow disabling the provisioning of Contrail analytics
components.
...
ANALYTICS_ALARM_ENABLE: 'False'
ANALYTICS_SNMP_ENABLE: 'True'
ANALYTICSDB_ENABLE: 'True'
...
Appendix
Contrail Command UI
The disabled roles and charts are visible on the Query page but they are not operational.
269
Regardless that the alarm, SNMP, and database analytics roles have been disabled, they are still reported
by Contrail Command.
The Alarms page displays alarms pulled from the Contrail analytics_alarm component. When the
analytics_alarm component is disabled, the Alarms page will always display no data.
Release Description
2008 TripleO templates were updated in June 2020 to allow disabling the provisioning of Contrail analytics
components.
274
CHAPTER 5
IN THIS CHAPTER
Contrail Networking Controller peers with Multi-Protocol BGP (MP-BGP) routers with both data center
devices, such as underlay switches (leaf and spine), as well as SDN gateways. The controller receives and
advertises the routes through control nodes. Starting with Contrail Networking Release 1910, you can
view, filter and search the overlay MP-BGP routes on Contrail Command.
Being able to view control node data enables you to debug and troubleshoot networking issues.
• Navigate to the Infrastructure > Cluster page. The Overview tab is displayed with an overview of the
cluster infrastructure components, including the numbers of control nodes, compute nodes, analytics
nodes, config nodes, and database nodes currently operational and also virtual networks. You can
also view charts displaying config nodes response sizes against response time as well as analytics
message sizes against time.
275
• Click Cluster Nodes to view more details on each of these nodes. The Cluster Name Nodes page
appears with lists of control nodes, compute nodes, service nodes, multicloud gateway nodes, and
baremetal servers in their separate respective tabs.
• To view more details on control nodes, select a control node on the Control Nodes tab. The
Control_Node Details page appears.
• The Summary tab provides a summary of the status and activity on the selected node. It also
displays charts detailing host CPU usage, memory usage, and so on. In the Contrail Web UI,
similar information was available under Monitor > Infrastructure > Control Nodes > Summary.
However, Contrail Command displays more details since it uses Contrail Insights to generate the
data.
• Click the Peers tab to view information about peers established for this control node. The Peers
tab displays the peers for an individual control node and their peering state. Click the ▸ icon next
to the peer name to expand, view, and copy peer information. You can use the search field on the
top right of the page to search for peers based on specified input strings.
• Click the Routes tab to view information on the routes. The Routes tab displays active routes for
this control node and lets you query the results. Click the filter icon on the top right of the page to
apply filters while searching for routes. You can also apply multiple filters.
• Click the Alarms tab to view all alarms on the control node. Click the ▸ icon next to the alarm
name to expand and view alarm details.
Release Description
1910 Starting with Contrail Networking Release 1910, you can view, filter and search the overlay MP-BGP
routes on Contrail Command.
Starting with Contrail Networking Release 1910, you can use the Contrail Command user interface (UI)
to monitor the status of primary and secondary devices that are members of a bond interface. This
feature is available for device systems configured with Data Plane Development Kit (DPDK). In releases
prior to release 1910, you could only see a bond interface in the Contrail Command UI. In release 1910,
you can view the details and receive notifications about the status of the primary as well as secondary
devices in the bond interface.
1. Click Infrastructure>Cluster.
The Overview page is displayed.
2. Click Cluster Nodes. The Cluster AIO Nodes page is displayed.
Click Compute Nodes tab. A list of nodes is displayed.
3. Click any node to view the Node Details. The Summary tab is displayed.
4. Click Interfaces tab. A list of interfaces deployed in the node is displayed.
Click on a bond interface to view and monitor the bond interface. See Figure 126 on page 276.
NOTE: In a multi-node setup, when the primary interface goes down in a DPDK enabled
device, the Contrail Command UI cannot display the status as the connection between the
controller and the primary interface is inactive. The Contrail Command UI obtains the
previous status from the cache and displays it.
You can also use vif—list command on the CLI to view the details of the bond interface members.
Executing the vif—list command gives you the following output when all interface members are UP:
Executing the vif—list command gives you the following output when all interface members are DOWN:
Executing the vif—list command gives you the following output when bond interface is not configured
and there are no secondary devices:
Release Description
1910 Starting with Contrail Networking Release 1910, you can use the Contrail Command user interface (UI)
to monitor the status of primary and secondary devices that are members of a bond interface.
279
RELATED DOCUMENTATION
This topic covers the Top N feature in the Contrail Contrail Command UI—Top N Feature | 279
Command GUI. Contrail Insights has a new Top N or Top N Filter Options | 281
“top talkers” query engine with tabular and charted
views. These Contrail Insights diagnostics enable Chart View | 284
engineers to proactively mitigate issues like network
congestion and resource contention.
In addition to the standard Top N results, you can also define custom Top N fields to group the results.
Click on the + button to group the results based on different attributes. You can add or remove the
desired attributes. The following grouping values are available:
• Packets
• Average speed
• Source IP
• Destination IP
• Source Port
• Destination Port
• Protocol
• Overlay Source IP
• Overlay Destination IP
• Overlay Protocol
• Network Device
• Source Interface
• Destination Interface
• IP Version
• IP Tos
• Source ASN
• Destination ASN
Predefined Time Select the period in the history for which data is to be
displayed.
Time range Use the calendar or type directly into the fields to select the
desired start and end time.
Additionally, you can select a time interval by dragging the
mouse.
Source Interface Filter the source interface on the selected network device
N Records Select the number of records for the top talkers of traffic 15
Include Missing Enable to see the results including traffic between physical Disabled
devices that are not related to overlay
Deduplication Enable to see the results for the actual scale of traffic Disabled
transferred between source IP and destination IP. It
eliminates counting the duplicate traffic reported by multiple
network devices.
282
(Continued)
Overlay Network
Source Virtual Network Filter data with this source virtual network
Destination Virtual Network Filter data with this destination virtual network
Source IP/Mask Filter data with the source IP or in the subnet range with
mask
Destination IP/Mask Filter data with the destination IP or in the subnet range with
mask
• ICMP
• TCP
• UDP
Underlay Network
Source IP/Mask Filter data with the source IP or in the subnet range with
mask
Destination IP/Mask Filter data with the destination IP or in the subnet range with
mask
(Continued)
• ICMP
• OSPFIGP
• TCP
• UDP
Additional filters
• IPv4
• IPv6
Source ASN Filter data with the source autonomous system number
(ASN)
Destination ASN Filter data with the destination autonomous system number
(ASN)
(Continued)
Encapsulation type Filter data with the encapsulation type Available Options:
• vxlan
• mpls
Chart View
You can also analyze the Top N results in the chart view.
• Bar Chart
• Pie Chart
• Donut Chart
• Treemap
• Bytes
• Packages
• Average Speed
You can also add heatmap for Y-axis parameters by enabling the option, Custom heatmap. It adds
another dimension to the chart view. The option will sort the colors of the chart based on the selected
heatmap parameter.
Select the desired fields from the PARAMETERS DISPLAYED list to group the results by various
parameters. You can hover your mouse over the chart to see these parameters.
RELATED DOCUMENTATION
IN THIS SECTION
Filters | 290
You can view heatmaps from the Infrastructure > Fabrics > Fabric Name > Topology View page.
The Topology View feature helps visualize the heatmaps generated based on the metrics collected
through sources such as sFlows and SNMP. You can select a time range from the Summary section on
the left panel to view the network statistics during a specific time period.
The metrics are represented in color and with a temperature scale displayed on the right of the topology
as shown in Figure 128 on page 286. The maximum numeric value retrieved for the metric among all
possible nodes or edges are represented as red on the scale. The lowest possible value, 0 (zero), is
represented as Green. The color gradation is from Red to Green with Yellow at 50%. For metrics
represented in percentages, the maximum (100%) is represented as Red, yellow is 50% and green is 0%.
For a node, the heat color is based on the maximum of the sum of either ingress or egress traffic.
286
Figure 128 on page 286 shows the Bytes/sec metric to visualize the heatmap. The temperature scale on
the right indicates that 34 Kb/sec is the maximum rate discovered among all devices and is color coded
in red. The lowest value is 0 Bytes/sec, which is shown as green. You can hover on the edge devices or
nodes to view the actual values as shown in Figure 129 on page 287.
287
The node color for a7-ex2 is based on the values of the maximum of sum of ingress versus the egress
traffic.
For example, in Figure 130 on page 288, the sum of egress traffic is 13.32 KB/sec and ingress is traffic is
12.30 KB/sec. Hence, for this node, the traffic is shown as 13.21 KB/sec and is marked red. This is
because this value is close to the maximum values obtained from all the links and the nodes.
288
Figure 131 on page 288 shows the sample traffic data collected and provided by the Contrail Insights
Flows API.
Table 48 on page 288 describes the metrics, its source, and the method of calculation.
Bytes/sec sFlow / Contrail Insights Flows Calculated by dividing the sum of bytes by time range in
seconds.
289
Packets/sec sFlow / Contrail Insights Flows Calculated by dividing the sum of packets by time range
in seconds.
Utilization sFlow / Contrail Insights Flows Utilization is % of link capacity used and is calculated
based on the link capacity. The total utilization divided by
time range in seconds is used to show average utilization
over the time range.
User SNMP Metrics Contrail Insights All the SNMP metrics collected by Contrail Insights.
Filters
Clicking on a node or edge device filters data for the selected connection, network device, host,
instance, or baremetal server. You can select the filter criteria from the Heatmap parameters section on
the right pane. You can apply multiple filters at a time.
Field Description
Source Virtual Network Filter traffic data for a particular source virtual network.
Destination Virtual Network Filter traffic data for a particular destination virtual network.
Host/Instance Filter traffic data for the selected host or node instance.
RELATED DOCUMENTATION
IN THIS SECTION
Starting in Contrail Networking Release 2008, you can view the path a packet takes in a network.
Visualizing the packet path on a topology view alongside the traffic assists the administrator when
troubleshooting. The visualization is possible by using the sFlow and topology data that a packet
consumes traveling in a network. When the node and edge details are obtained, the topology is plotted
and the path can be visualized in the topology view.
NOTE: To view the packet path, both Contrail Insights and Contrail Insights Flows must be
installed. See How to Install Contrail Command and Provision Your Contrail Cluster in the
Contrail Networking Installation and Upgrade Guide.
https://<Contrail-Command-Server-IP-Address>:9091
To change a path or create a new one, right-click to select the packet path source and destination nodes.
Predefined Time Select the period in the history for which data is to be displayed.
Time Range Use the calendar or type directly into the fields to select the desired start and end
time. Additionally, you can select a time interval by moving the selector left or
right..
Underlay
• ICMP
• OSPFIGP
• TCP
• UDP
Overlay
Source Virtual Network Filter data with the source virtual network.
Destination Virtual Network Filter data with the destination virtual network.
• ICMP
• TCP
• UDP
In fabric-only path finding, each virtual port group (VPG) is treated as a bare metal server (BMS). These
BMSs are named bms_<vpg_name>. Contrail Networking does not allocate IP addresses of the VPG. The IP
addresses are discovered by mapping the Contrail Config virtual-port-group object with the gRPC (gRPC
remote procedure calls) Sensor data, "/network-instances/network-instance/macip-table".
When a Contrail vRouter Agent is present in the path of a flow between two virtual machines that is
hosted on Contrail compute nodes, Contrail Insights Flows collector receives information from Contrail
Flows for the corresponding sFlow packet. However, when the traffic flow is between two bare metal
servers and there is no Contrail vRouter Agent, no information is received from Contrail flows. In this
scenario, the gRPC sensor is subscribed to, to determine virtual network information and connections
between leaf and BMS.
NOTE: Fabric-only path finding feature is supported on network devices that run Junos OS
Release 20.2 or later.
295
Release Description
2008 Starting in Contrail Networking Release 2008, you can view the path a packet takes in a network.
RELATED DOCUMENTATION
IN THIS SECTION
Starting with Contrail Networking Release 2011, you can assign custom names to privileged ports (for
example HTTP, HTTPs, BGP, DNS, SSH) and VXLANs in order to make them easier to identify in the
topology mapping and queries. When you make queries for traffic flows in the Topology View, the
custom name displays instead of the port number or VXLAN ID.
Field Description
Privileged Ports Select to assign the new custom name to a privileged port.
Port Number Enter a port number to rename with the new custom name.
5. Click Create.
7. In the Topology map, hover over the node, and select Set as Source node.
8. In the Overlay section in the topology sidebar, select that same Source IP from the drop-down list.
298
Locate the port number that you named, which shows the custom name.
Custom names were previously assigned to two ports and the custom names are shown for two host IP
addresses.
To map a route with custom named ports for both the source IP address and destination IP address:
4. In the Overlay section in the topology sidebar, select Source IP from the drop-down list.
4. In the Overlay section in the topology sidebar, select Source IP from the drop-down list.
Port drop-down shows only the port with the custom name.
Field Description
VXLAN ID Select to assign the new custom name to a VXLAN ID of a corresponding Virtual Network.
5. Click Create.
7. In the Topology map, hover over the node, and select Set as Source node.
8. In the Overlay section in the topology sidebar, select Source Virtual Network from the drop-down
list.
Next to the VXLAN ID in the drop-down list is the custom name you added.
301
Release Description
2011 Starting with Contrail Networking Release 2011, you can assign custom names to privileged ports (for
example HTTP, HTTPs, BGP, DNS, SSH) and VXLANs in order to make them easier to identify in the
topology mapping and queries. When you make queries for traffic flows in the Topology View, the
custom name displays instead of the port number or VXLAN ID.
RELATED DOCUMENTATION
IN THIS SECTION
The Dashboards page in Contrail Command provides an “at-a-glance” view of the system infrastructure
components, including the number of compute nodes, config nodes, analytics nodes, control nodes, and
database nodes currently operational, CPU and memory utilization for the system, active flows, and
packet drops.
Monitoring Dashboards
Across the top of the Dashboards page are tabs representing the components of the system that are
shown in the statistics. See Figure 137 on page 302. Any of the compute nodes, config nodes, analytics
nodes, control nodes, and database nodes can be monitored individually and in detail from the
Dashboards page by clicking an associated tab, and drilling down for more detail.
The charts show the latest data, updating in real-time from a stream of data from the Contrail platform.
When the cursor is positioned over the charts, a pop-up box shows the data values at that particular
time. Charts can be zoomed in or out using the mouse scroll wheel.
Select Monitoring > Dashboards > Config Nodes to view a summary of activities for the analytics nodes.
See Figure 138 on page 303. Hover over any chart axis to get summary information about the
component it represents.
303
Table 53 on page 303 describes the fields in the Config Nodes summary.
Field Description
Select Monitoring > Dashboards > Analytics Nodes to view a summary of activities for the analytics
nodes. See Figure 139 on page 304. Hover over any chart axis or bubble to get summary information
about the component it represents. See Table 54 on page 304 for descriptions of the fields on the
analytics summary.
304
Field Description
Field Description
Analytics Messages Number of analytics messages received during specific time period on represented
node.
IN THIS SECTION
Select Query > Flows to perform rich and complex SQL-like queries on flows in the Contrail Controller.
You can use the query results for such things as gaining insight into the operation of applications in a
virtual network, performing historical analysis of flow issues, and pinpointing problem areas with flows.
Select Query > Flows > Series to create queries of the flow series table. The results are in the form of
time series data for flow series. See Figure 140 on page 306.
306
The query fields available on the screen for the Series tab are described in Table 55 on page 306. Enter
query data into the fields to create a SQL-like query to display and analyze flows.
Field Description
• Last 10 Mins
• Last 30 Mins
• Last 1 Hr
• Last 6 Hrs
• Last 12 Hrs
• Custom
Click Custom to enter a specific custom time range in two fields: Start Time and End Time.
Select Terms Click the edit button (pencil icon) to open a Select Terms window (Figure 141 on page 308),
where you can click one or more fields to display from the flow series, such as Virtual Router,
Source VN, Destination VN, SUM(bytes), SUM(packets), and more.
307
Field Description
Where Click the +Add to open a query-writing window, where you can specify query values for
variables such as destvn, protocol, sourcevn, and vrouter.
Filter Click the edit button (pencil icon) to open a Filters window (Figure 140 on page 306), where
you can select filter items to sort by, the sort order, and limits to the number of results
returned.
Time Granularity When Time Granularity is selected, you have the option to view results in graph or flowchart
form. Graph buttons appear on the screen above the Export button. Click a graph button to
transform the tabular results into a graphical chart display.
Run Click Run to retrieve the flows that match the query you created. The flows are listed on the
lower portion of the screen in a box with columns identifying the selected fields for each flow.
Export The Export button is displayed after you click Run. This allows you to export the list of flows
to a text .csv file.
The Select Terms window allows you to select one or more attributes of a flow series by clicking each
attribute desired. See Figure 141 on page 308. Select SUM(Bytes) or SUM(Packets) to aggregate bytes
and packets in intervals.
308
Use the Filters window to refine the display of query results for flows, by defining an attribute by which
to sort the results, the sort order of the results, and any limit needed to restrict the number of results.
See Figure 142 on page 309.
309
Select Query > Flow > Records to create queries of individual flow records for detailed debugging of
connectivity issues between applications and virtual machines. Queries at this level return records of the
active flows within a given time period.
310
The query fields available on the screen for the Records tab are described in Table 56 on page 310. Enter
query data into the fields to create an SQL-like query to display and analyze flows.
Field Description
• Last 10 Mins
• Last 30 Mins
• Last 1 Hr
• Last 6 Hrs
• Last 12 Hrs
• Custom
Click Custom to enter a specified custom time range in two fields: Start Time and End Time.
Select Terms Click the edit button (pencil icon) to open a Select Terms window (Figure 143 on page 310), where
you can click one or more attributes to display for the flow records, including vrouter, sourcevn,
sourceip, destvn, destip, protocol, dport, and action.
311
Field Description
Where Click +Add to open a query window where you can specify query values for destvn, protocol,
sourcevn, and vrouter.
Run Click Run to retrieve the flow records that match the query you created. The records are listed on
the lower portion of the screen in a box with columns identifying the fields for each flow.
Export The Export button is displayed after you click Run, allowing you to export the list of flows to a
text .csv file.
The Select Terms window allows you to select one or more attributes to display for the flow records
selected. See Figure 144 on page 311.
The query window is available by clicking the +Add in the Where field. Use the query window to enter
query statements. See Figure 144 on page 311.
You can restrict the query to a particular source VN and destination VN combination using the Select
section.
The Where supports logical AND and logical OR operations, and is modeled as a logical OR of multiple
AND terms. For example: ( (term1 AND term2 AND term3..) OR (term4 AND term5) OR…).
See Table 57 on page 312 for descriptions of the fields in the query window.
Item Description
— Select from a list of available item types the type from which to query.
• destvn
• protocol
• sourcevn
• vrouter
AND + Click the +Add to add more elements to your query. Repeat to include additional query elements to
your query statement.
Apply Click to enter the query into the fields on the main screen.
The Where can be modeled as logical OR of multiple AND terms. ( (term1 AND term2 AND term3..) OR
(term4 AND term5) OR…).
Select Query > Flows > Query Queue to display queries that are in the queue waiting to be performed
on the data.
The query fields available on the screen for the Records tab are described in Table 58 on page 313. Enter
query data into the fields to create an SQL-like query to display and analyze flows.
Field Description
Time Taken The amount of time in seconds it has taken the query to return the matching records.
(Action icon) Click the Action icon and select View Results to view a list of the records that match the query, or
click Delete to remove the query from the queue.
RELATED DOCUMENTATION
Fat Flows
314
IN THIS SECTION
Appendix | 331
Contrail analytics is comprised of four building blocks. The last three listed are optional components.
• Analytics collector
• Analytics alarm
• Analytics SNMP
• Analytics database
Regardless that the alarm, SNMP, and database analytics roles have not been installed and if installed are
disabled, these components show as active when you run the Linux $sudo commands or view in Contrail
Command. For more information, see the section “TripleO Provisioning” below.
315
Multi-nodes Contrail controller components are split onto three servers (Contrail controller, Contrail
analytics, and Contrail analytics database). Only the first two servers are mandatory since
Contrail analytics database is an optional component. This type of topology is used in
production deployments.
$ sudo contrail-status
== Contrail control ==
control: active
nodemgr: active
named: active
dns: active
== Contrail config-database ==
nodemgr: active
zookeeper: active
rabbitmq: active
cassandra: active
== Contrail config ==
svc-monitor: active
nodemgr: active
device-manager: active
api: active
schema: active
== Contrail webui ==
web: active
job: active
316
Following is the Contrail status on Contrail analytics node when Contrail analytics SNMP and Contrail
analytics alarm have both been deployed:
$ sudo contrail-status
Pod Service Original Name
Original Version State Id Status
analytics api contrail-analytics-api rhel-
queens-1910-23 running 62980f3e6479 Up 2 weeks
analytics collector contrail-analytics-collector rhel-
queens-1910-23 running b777437946c2 Up 2 weeks
analytics nodemgr contrail-nodemgr rhel-
queens-1910-23 running aeeb744a5b5e Up 2 weeks
analytics redis contrail-external-redis rhel-
queens-1910-23 running 150b6225bd93 Up 2 weeks
analytics-alarm alarm-gen contrail-analytics-alarm-gen rhel-
queens-1910-23 running d655146cb8d0 Up 2 weeks
analytics-alarm kafka contrail-external-kafka rhel-
queens-1910-23 running 8cfa8c7da4bd Up 2 weeks
analytics-alarm nodemgr contrail-nodemgr rhel-
queens-1910-23 running 685a5f817f0b Up 2 weeks
analytics-alarm zookeeper contrail-external-zookeeper rhel-
queens-1910-23 running a41dc5658c72 Up 2 weeks
analytics-snmp nodemgr contrail-nodemgr rhel-
queens-1910-23 running 0afd301ccbd8 Up 2 weeks
analytics-snmp snmp-collector contrail-analytics-snmp-collector rhel-
queens-1910-23 running 2bde6aa39250 Up 2 weeks
analytics-snmp topology contrail-analytics-snmp-topology rhel-
queens-1910-23 running a16f983ed162 Up 2 weeks
== Contrail analytics ==
nodemgr: active
api: active
collector: active
== Contrail analytics-alarm ==
nodemgr: active
kafka: active
alarm-gen: active
== Contrail analytics-snmp ==
317
snmp-collector: active
nodemgr: active
topology: active
Following is an example of the Contrail status on Contrail analytics node when Contrail analytics SNMP
and Contrail analytics alarm have not been deployed:
$ sudo contrail-status
Pod Service Original Name Original Version
State Id Status
analytics api contrail-analytics-api rhel-queens-2005-62
running 489b07cbbbef Up 18 hours
analytics collector contrail-analytics-collector rhel-queens-2005-62
running 5da4f99b045f Up 18 hours
analytics nodemgr contrail-nodemgr rhel-queens-2005-62
running 28053f64f1bc Up 18 hours
analytics provisioner contrail-provisioner rhel-queens-2005-62
running faa8de6d17e4 Up 18 hours
analytics redis contrail-external-redis rhel-queens-2005-62
running 3e29dcc475d1 Up 18 hours
analytics stunnel contrail-external-stunnel rhel-queens-2005-62
running 11a30f0f5e3b Up 18 hours
== Contrail analytics ==
nodemgr: active
api: active
collector: active
Contrail analytics database is only deployed when the analytics database component is enabled. The
following example shows the Contrail status on the Contrail analytics database node:
$ sudo contrail-status
Pod Service Original Name Original Version
318
State Id Status
database cassandra contrail-external-cassandra rhel-queens-1910-
23 running ec05bd8c34c4 Up 2 weeks
database nodemgr contrail-nodemgr rhel-queens-1910-
23 running 25a6c58d5144 Up 2 weeks
database query-engine contrail-analytics-query-engine rhel-queens-1910-
23 running f90f7ae16b48 Up 2 weeks
== Contrail database ==
nodemgr: active
query-engine: active
cassandra: active
Following is the Contrail status on Contrail controller node when Contrail analytics SNMP, Contrail
analytics alarm, and Contrail analytics database have been deployed:
$ sudo contrail-status
Pod Service Original Name
Original Version State Id Status
analytics api contrail-analytics-api
rhel-queens-1912-46 running bf87cc51fb36 Up 8 weeks
analytics collector contrail-analytics-collector
rhel-queens-1912-46 running 0ae1ca0fb1f2 Up 8 weeks
analytics nodemgr contrail-nodemgr
rhel-queens-1912-46 running 24e9174056d0 Up 8 weeks
analytics redis contrail-external-redis
rhel-queens-1912-46 running 9d7135b6b9d8 Up 8 weeks
analytics stunnel contrail-external-stunnel
rhel-queens-1912-46 running 30d413bad4f1 Up 8 weeks
analytics-alarm alarm-gen contrail-analytics-alarm-gen
rhel-queens-1912-46 running 2f40aeb42154 Up 8 weeks
analytics-alarm kafka contrail-external-kafka
rhel-queens-1912-46 running 8cd54b9520af Up 8 weeks
analytics-alarm nodemgr contrail-nodemgr
rhel-queens-1912-46 running afeadd231273 Up 8 weeks
analytics-alarm zookeeper contrail-external-zookeeper
rhel-queens-1912-46 running 118b116b2721 Up 8 weeks
319
== Contrail control ==
control: active
nodemgr: active
named: active
dns: active
== Contrail analytics-alarm ==
nodemgr: active
kafka: active
alarm-gen: active
== Contrail database ==
nodemgr: active
query-engine: active
cassandra: active
== Contrail analytics ==
nodemgr: active
api: active
collector: active
== Contrail config-database ==
nodemgr: active
zookeeper: active
rabbitmq: active
cassandra: active
== Contrail webui ==
web: active
job: active
== Contrail analytics-snmp ==
snmp-collector: active
nodemgr: active
topology: active
== Contrail config ==
svc-monitor: active
nodemgr: active
device-manager: active
api: active
schema: active
321
Contrail database (query), analytics alarm, and SNMP are deployed and active.
Following is an example of the Contrail status on Contrail controller node when Contrail analytics SNMP,
Contrail analytics alarm, and Contrail analytics database have not been deployed:
$ sudo contrail-status
Pod Service Original Name
Original Version State Id Status
analytics api contrail-analytics-api
rhel-queens-2005-62 running b1ddca562595 Up 10 hours
analytics collector contrail-analytics-collector
rhel-queens-2005-62 running f6860911ee16 Up 10 hours
analytics nodemgr contrail-nodemgr
rhel-queens-2005-62 running 37a0d8744e31 Up 10 hours
analytics provisioner contrail-provisioner
rhel-queens-2005-62 running e2f9a4605d63 Up 10 hours
analytics redis contrail-external-redis
rhel-queens-2005-62 running 1d0a193983b0 Up 10 hours
analytics stunnel contrail-external-stunnel
rhel-queens-2005-62 running 695d61045e63 Up 10 hours
config api contrail-controller-config-api
rhel-queens-2005-62 running 41eb0caef12d Up 10 hours
config device-manager contrail-controller-config-devicemgr
rhel-queens-2005-62 running f3158c67d792 Up 10 hours
config nodemgr contrail-nodemgr
rhel-queens-2005-62 running 4138cc386e69 Up 10 hours
config provisioner contrail-provisioner
rhel-queens-2005-62 running 45aae86bb41a Up 10 hours
config schema contrail-controller-config-schema
rhel-queens-2005-62 running 2497392980d0 Up 10 hours
config svc-monitor contrail-controller-config-svcmonitor
rhel-queens-2005-62 running b2ed20209aa7 Up 10 hours
config-database cassandra contrail-external-cassandra
rhel-queens-2005-62 running abd3efad8075 Up 10 hours
config-database nodemgr contrail-nodemgr
rhel-queens-2005-62 running bcc74ecb37cc Up 10 hours
config-database provisioner contrail-provisioner
rhel-queens-2005-62 running 9de114119be5 Up 10 hours
config-database rabbitmq contrail-external-rabbitmq
rhel-queens-2005-62 running d623f5d3da79 Up 10 hours
322
== Contrail control ==
control: active
nodemgr: active
named: active
dns: active
== Contrail analytics ==
nodemgr: active
api: active
collector: active
== Contrail config-database ==
nodemgr: active
zookeeper: active
rabbitmq: active
cassandra: active
== Contrail config ==
svc-monitor: active
nodemgr: active
device-manager: active
api: active
schema: active
== Contrail webui ==
323
web: active
job: active
Contrail database (query), analytics alarm, and SNMP are not deployed.
Contrail Web UI
Figure 146 on page 323 displays the Contrail Web UI dashboard with all optional analytics components
deployed.
Figure 148 on page 325 displays the Contrail Web UI dashboard without optional analytics components
deployed.
325
Figure 150 on page 326 displays the Monitor > Alarms menu.
Figure 151 on page 326 displays the Configure > Alarms menu.
Figure 152 on page 327 displays the dialog box which appears when Global Alarm, next to Logged in
User in the upper right, is selected.
327
If the alarm analytics component is not deployed, then Contrail Web UI should not display the following
alarm references:
There is not an appearance of Global Alarm or Alarms entry in the Monitor menu:
Figure 153: Analytics Alarm Disabled - Global Alarm and Alarm Not Available
Figure 155 on page 328 displays the Physical Topology option in the Monitor menu.
Figure 155: Analytics SNMP Feature Enabled - Physical Topology Menu Available
If the alarm analytics component is not provisioned, then Contrail Web UI does not display the Physical
Topology menu option.
329
Figure 156: Analytics SNMP Feature Disabled - Physical Topology Menu Not Available
If analytics database is provisioned, then Contrail Web UI displays the Query page.
If analytics database is not provisioned, then Contrail Web UI should not display the Query page. Query
page logo is unavailable to launch Query page.
330
Figure 158: Analytics Database Disabled - Query Page Logo Not Available
Tripleo Provisioning
In order to enable or disable the Contrail analytics optional components, TripleO templates have to be
modified.
- OS::TripleO::Services::ContrailAnalytics
- OS::TripleO::Services::ContrailAnalyticsSnmp
- OS::TripleO::Services::ContrailAnalyticsAlarm
- OS::TripleO::Services::ContrailAnalyticsDatabase
In order to enable or disable the Contrail analytics optional components, TripleO templates have to be
modified. In ContrailController role, ContrailAnalyticsSnmp, ContrailAnalyticsAlarm, and
ContrailAnalyticsDatabase resources can be removed, other contrail resources are kept:
- name: ContrailController
- OS::TripleO::Services::ContrailAnalytics
- OS::TripleO::Services::ContrailAnalyticsAlarm
331
- OS::TripleO::Services::ContrailAnalyticsDatabase
- OS::TripleO::Services::ContrailAnalyticsSnmp
- OS::TripleO::Services::ContrailCertmongerUser
- OS::TripleO::Services::ContrailConfig
- OS::TripleO::Services::ContrailConfigDatabase
- OS::TripleO::Services::ContrailControl
- OS::TripleO::Services::ContrailWebui
TripleO templates were updated in June 2020 to allow disabling the provisioning of Contrail analytics
components.
...
ANALYTICS_ALARM_ENABLE: 'False'
ANALYTICS_SNMP_ENABLE: 'True'
ANALYTICSDB_ENABLE: 'True'
...
Appendix
Contrail Command UI
The disabled roles and charts are visible on the Query page but they are not operational.
332
Regardless that the alarm, SNMP, and database analytics roles have been disabled, they are still reported
by Contrail Command.
The Alarms page displays alarms pulled from the Contrail analytics_alarm component. When the
analytics_alarm component is disabled, the Alarms page will always display no data.
Release Description
2008 TripleO templates were updated in June 2020 to allow disabling the provisioning of Contrail analytics
components.
337
CHAPTER 6
IN THIS CHAPTER
Viewing Telemetry KPI Alarms for Fabric Devices and Ports | 352
Adding, Editing, and Deleting sFlow Collector Nodes in Contrail Command | 362
Contrail Insights is a cloud service optimization tool that provides advanced monitoring, scheduling, and
performance management for software-defined infrastructure, where containers and virtual machines
(VMs) can have life cycles much shorter than in traditional development environments.
Contrail Insights leverages big-data analytics and machine learning in a distributed architecture that puts
the power of self-driving infrastructure at the core of most any cloud. It redefines the state-of-the-art in
telemetry and management across software-defined infrastructure and application software layers. On
top of all of this, real-time and historic monitoring, performance visibility and dynamic optimization
features improve cloud orchestration, security, accounting and planning to users.
Starting with Contrail release 5.1, the following Contrail Insights features are supported in Contrail
Command:
NOTE: For information about installing Contrail Insights, see the Contrail Installation and
Configuration Guide. For more information about Contrail Insights, see the Contrail Insights User
Guide.
RELATED DOCUMENTATION
IN THIS SECTION
Configuring Contrail Insights Flows by Assigning Telemetry and sFlow Profiles to Devices | 340
These topics describe how to configure Contrail Insights Flows from Contrail Command.
For Contrail Networking Release 1910, the flow collector provisioning is disabled by default in the
provisioning wizard. To enable flow collector provisioning, log in to the contrail_command container and edit
the /usr/share/contrail/public/feature-list.json file. Set the value for cluster_user.xflow to true.
In Contrail Networking Release 1911 and later, the flow collector provisioning is enabled by default.
Contrail Networking Release 1911 supports provisioning of both in-band and out-of-band collectors.
You can configure Contrail Insights Flows during initial setup, during fabric onboarding, or by creating
and assigning telemetry and sFlow profiles to devices. For more information about configuring Contrail
Insights Flows during Contrail Command installation, see Installing Contrail Insights and Contrail Insights
Flows using Contrail Command in the Contrail Installation and Upgrade Guide.
When you click Next, configuration similar to the following is pushed to the device:
After fabric provisioning is complete, you can view the flow data from the Infrastructure > Fabrics >
Fabric Name > Topology View page.
The benefit of assigning telemetry profiles is that you can monitor the health of different devices and
their interfaces from Contrail Command after the telemetry profile gets configured on these devices.
341
NOTE: If telemetry profiles are not configured, there will be “No data” for the “top talkers” in the
Contrail Command Top-N-View. See "Top N View in Contrail Command" on page 279.
After Contrail Command is set up and devices are discovered, you can attach telemetry profiles to
devices. You can attach only one telemetry profile per device. Each telemetry profile is linked to sub-
profile(s). The telemetry profile can contain all types of sub-profiles but only one instance each of the
sFlow, gRPC, Netconf, or SNMP sub-profiles. You can either link a telemetry profile to an existing sub-
profile or create a new sub-profile while creating the telemetry profile.
Default sFlow profiles and telemetry profiles are predefined in the system when you bring up the cluster.
You cannot edit or delete these default profiles. However, you can create custom profiles and associate
them to the telemetry profile.
The sFlow monitoring technology collects samples of network packets and sends them to a monitoring
station called a collector. The sFlow technology implements two sampling mechanisms:
• Packet-based sampling—Samples one packet out of a specified number of packets from an interface
enabled for sFlow technology.
Contrail Networking Release 2011 supports gRPC, Netconf, and SNMP protocol-based telemetry
profiles. Contrail Insights collects key performance indicators (KPIs) from network devices using
preconfigured values to monitor the fabric health.
To view the health of your fabric devices, ports, and any alerts associated with exceeding KPI thresholds,
navigate to Infrastructure > Fabrics > <Fabric Name>.
• sflow-access-interfaces—Indicates that sFlow is enabled on all the access interfaces on the device.
• sflow-all-interfaces—Indicates that sFlow is enabled on all the interfaces on the device that has an
sFlow profile attached to it.
You can apply default profiles to network devices and generate alerts based on predefined KPIs and
preconfigured alert generation rules.
Click profile tabs (sFlow, GRPC, Netconf, SNMP) to view existing profiles.
3. Click Create to define a new telemetry profile.
You can assign one or more profiles to the telemetry profile by selecting existing profiles from the
list(s). You can create new profile(s) by clicking Create New and then assign it to the telemetry profile.
Figure 170 on page 343 shows assigning an existing sFlow profile. Mouse over the sFlow name to
view the profile details.
343
4. (Optional) Click Create New next to the profile fields to create a new profile.
Figure 172 on page 345 shows an example of creating a sFlow profile.
345
Field Description
Profile Name Enter a name for the profile you are creating.
Sample Rate The configured number of egress or ingress packets out of which one packet is
sampled. For example, with the default sample rate of 2000, meaning one packet out
of 2000, is sampled.
Polling Interval Configure the interval (in seconds) that the device waits between port statistics
(second) update messages. Default should be set to 0 (recommended).
Adaptive Sample Process of monitoring the overall incoming traffic rate on the network device and
Rate providing intelligent feedback to interfaces to dynamically adapt the sampling rates
on interfaces on the basis of traffic conditions. The default is one out of every 300
packets.
346
Field Description
Sampling Direction Packets are sampled either at the ingress or egress interfaces for a given network
path flow.
Configure a gRPC, Netconf, or SNMP profile to monitor the health of your network and generate
alarms to identify any anomalies. Alarms are generated based on the collected metrics and
preconfigured thresholds in the alarm rules.
Field Description
Profile Name Enter a name for the gRPC, Netconf, or SNMP profile you are creating.
Health Parameters Mouse over the ? to view a table listing the applicable sensors, commands, or
MIBs for physical/environmental, interface, and control plane monitoring. By
• Physical/Environmental default, all three settings are On, which is recommended. See Figure 173 on
page 346.
• Interface
• Control Plane
Allowed Client List NOTE: This field applies to grpc-default-profile only. Default value is 0.0.0.0/0.
Prepopulated subnets are from the Contrail Insights node. Add additional IP
addresses (using the CIDR format 1.1.1.1/32) and/or subnets and Enter. You can
also copy and paste entries.
6. Click Create.
Continue with the remaining steps to assign your telemetry profile to a device.
7. Click Infrastructure > Fabrics > Fabric Name to assign a telemetry profile to one or more devices in a
fabric.
8. Select the device or devices for which you want to assign telemetry profile and click Assign
Telemetry Profile as shown in Figure 176 on page 350.
350
9. Select a telemetry profile from the list and click Ok as shown in Figure 177 on page 350.
To view the health of your fabric, navigate to Infrastructure > Fabrics > <Fabric Name>.
Release Description
2011 Contrail Networking Release 2011 supports gRPC, Netconf, and SNMP protocol-based telemetry
profiles. Contrail Insights collects key performance indicators (KPIs) from network devices using
preconfigured values to monitor the fabric health.
1911 Contrail Networking Release 1911 supports provisioning of both in-band and out-of-band collectors.
352
1910 Starting with Contrail Networking Release 1910, Contrail Insights Flows is integrated in the Contrail
Command UI.
RELATED DOCUMENTATION
Adding, Editing, and Deleting sFlow Collector Nodes in Contrail Command | 362
Viewing Telemetry KPI Alarms for Fabric Devices and Ports | 352
Top N View in Contrail Command | 279
IN THIS SECTION
Ports | 356
Alarms | 357
In Contrail Networking Release 2011, the Fabrics page displays additional detail about the health of your
devices and interfaces, gathering data from telemetry metrics and profiles configured on these devices.
These pages will show if any key performance indicators (KPIs) have crossed a threshold value. You can
also configure metrics and assign telemetry profiles from the Fabrics Overview page. See Figure 189 on
page 361.
Fabric Devices
The Fabrics page displays. An error icon displays next to the fabrics name if there are critical or major
alarms present.
Column Description
NOTE: A red alert icon displays next to the fabric name if there are any active critical
or major alarms.
2. Select the <Fabric Name> to view more details about devices, ports, and alarms.
354
The Fabric Devices page displays an overview of the fabric devices and their real-time status.
Column Description
Column Description
Ports
Column Description
Operational Status Device status as Up, Down or At risk/Changed. This is based on information received
from the telemetry profiles.
Administrative Status Device status as Active, Inactive, or Changed. This status applies to the Contrail
Networking configuration component versus telemetry profiles.
357
Alarms
Column Description
Severity Alarm severity. Ranging from none to critical. Corresponds with Alarms Count at top of page.
In Alarms Count, click Critical, Error, or Warning to display only alarms with that severity level.
To return to displaying all alarms, click the Open filters icon and select the filter values or click Reset.
NOTE: The same behavior applies to the legend items next to the Ports Count pie chart.
The Device Overview page shows more detail provided by the telemetry profiles. The Alarms panel
displays up to eight alarms. Click View all critical alarms for this device to see any additional alarms.
This returns you to the Fabric page and displays device and severity dependent on your choices. Click
Open filters and select Reset to return the page to displaying all devices and alarms. See
360
In Ports Count, you can click a port name to see more detail. This launches the Port Overview page.
Overview charts are drawn specifically for the port that you are viewing. To return to full view of all
ports, click the Open filters icon and select Reset.
Figure 188: Select Fabric Port to View Alarms Specific to Selected Port
When there are no telemetry metrics configured and assigned to applicable fabric devices, you can
accomplish this from the Fabric Overview page. For more information about telemetry profiles, see
"Contrail Insights Flows in Contrail Command" on page 338.
361
Release Description
2011 In Contrail Networking Release 2011, the Fabrics page displays additional detail about the health of your
devices and interfaces, gathering data from telemetry metrics and profiles configured on these devices.
These pages will show if any key performance indicators (KPIs) have crossed a threshold value. You can
also configure metrics and assign telemetry profiles from the Fabrics Overview page.
RELATED DOCUMENTATION
IN THIS SECTION
Contrail Networking Release 2011 supports adding, removing, and reconfiguring collector nodes (also
known as sFlow nodes) after the system is up and running. Prior to this release, collector nodes could
only be added during provisioning.
1. When there are not any existing collector nodes in the deployment, you need to specify the
provisioning type (out-of-band or in-band) and the corresponding configuration parameters.
2. After specifying the provisioning type, you create server nodes if none are available or select from
the listed server nodes.
The Add Collector Nodes wizard guides you through the steps, which vary depending on the availability
of collector nodes and server nodes. See the following procedures for the add collector nodes
workflows.
An available server node is one that's not currently assigned as a Contrail Insights sFlow node.
To add an out-of-band collector node when there are not any existing collector nodes and no available
server nodes:
The Collector Nodes page displays without any collector nodes listed.
3. Click the link Add Collector Node or navigate to Add > Collector Node.
364
4. Select the Collector Node provisioning type to identify how the Insights Flows node is managed.
• Out of Band: Contrail Insights Flows nodes are managed from an out-of-band management
network by default. See Table 65 on page 364.
• In-Band: Select the in-band option if you want to manage Contrail Insights from an in-band
network interface. See Table 66 on page 364.
Field Description
Virtual IP Address Enter the virtual IP address on the Insights Flows node that connects the node to the
management network. The address is entered as a four-octet IP address with no mask;
for example, 10.1.1.20.
Retention Period Time duration in seconds that you want to keep the collected data. For example,
7200.
Max Retention Bytes Maximum size of the data to be collected. Default is 0 which indicates unlimited size.
Field Description
CIDR Enter the underlay telemetry infrastructure subnet. The in-band interface on the
Contrail Insights Flows node is assigned an IP address from this subnet.
Management Virtual IP Enter an unused IP address which will be used as the management IP Address.
Address Contrail Command uses this IP address to connect to the Contrail Insights Flows
node.
365
Field Description
Retention Period Time duration in seconds that you want to keep the collected data. For example,
7200.
Max Retention Bytes Maximum size of the data to be collected. Default is 0 which indicates unlimited
size.
AppFormix Flows
Configuration
Parameters
Key Enter a key value for a key value pair on the Contrail Insights Flows server. Key
value pairs might need to be entered to use Contrail Insights and Contrail Insights
Flows on the same server. See How to Install Contrail Command and Provision
Your Contrail Cluster. In all other scenarios, key value pairs should only be used by
expert users or by users in specialized circumstances.
Value Enter a value for a key value pair on the Contrail Insights Flows server. Key value
pairs might need to be entered to use Contrail Insights and Contrail Insights Flows
on the same server. See How to Install Contrail Command and Provision Your
Contrail Cluster. In all other scenarios, key value pairs should only be used by
expert users or by users in specialized circumstances.
5. Click Next.
Field Description
Choose Mode Options include: Express, Detailed, or Bulk Import (CSV). We recommend using the
Detailed or Bulk Import (CSV) modes in most environments to ensure all server field
data is entered and to avoid performing manual configuration tasks later in the
procedure.
• Bulk Import (CSV)—Import the physical server or VM fields from a CSV file.
Management Interface Name of the management-network facing interface on the physical server or VM.
367
Field Description
Disk Partition(s) (Optional) Specify the disk partitions that you want to use. This field is often left
blank.
7. Click Next after completing all fields to add the server or VM.
You can see the added server in the Available Servers box. Listed are the servers that can be
provisioned as Contrail Insights nodes. Contrail Insights provides end-to-end visibility into your cloud
environment to improve the operations of your network. A Contrail Insights node is needed to run
Contrail Insights.
8. Click the > icon next to a server to assign it as a Contrail Insights node. The server is moved into the
Assigned Contrail Insights Nodes table.
9. Click Provision.
The cluster provisioning begins and the page displays provisioning progress. When the provisioning is
completed, you are directed to log in to Contrail Command.
To add an out of band collector node, when there is an available server node but there are no collector
nodes:
The Collector Nodes page displays without any collector nodes listed.
4. Select the Collector Node provisioning type to identify how the Insights Flows node is managed.
• Out of Band: Contrail Insights Flows nodes are managed from an out-of-band management
network by default. See Table 68 on page 368.
• In-Band: Select the in-band option if you want to manage Contrail Insights from an in-band
network interface. See Table 69 on page 368.
Field Description
Virtual IP Address Enter the virtual IP address on the Insights Flows node that connects the node to the
management network. The address is entered as a four-octet IP address with no mask;
for example, 10.1.1.20.
Retention Period Time duration in seconds that you want to keep the collected data. For example,
7200.
Max Retention Bytes Maximum size of the data to be collected. Default is 0 which indicates unlimited size.
Field Description
CIDR Enter the underlay telemetry infrastructure subnet. The in-band interface on the
Contrail Insights Flows node is assigned an IP address from this subnet.
369
Field Description
Management Virtual IP Enter an unused IP address which will be used as the management IP Address.
Address Contrail Command uses this IP address to connect to the Contrail Insights Flows
node.
Retention Period Time duration in seconds that you want to keep the collected data. For example,
7200.
Max Retention Bytes Maximum size of the data to be collected. Default is 0 which indicates unlimited
size.
Key Enter a key value for a key value pair on the Contrail Insights Flows server. Key
value pairs might need to be entered to use Contrail Insights and Contrail Insights
Flows on the same server. See How to Install Contrail Command and Provision Your
Contrail Cluster. In all other scenarios, key value pairs should only be used by
expert users or by users in specialized circumstances.
Value Enter a value for a key value pair on the Contrail Insights Flows server. Key value
pairs might need to be entered to use Contrail Insights and Contrail Insights Flows
on the same server. See How to Install Contrail Command and Provision Your
Contrail Cluster. In all other scenarios, key value pairs should only be used by
expert users or by users in specialized circumstances.
5. Click Next.
The Available Servers table lists the servers that can be provisioned as Contrail Insights nodes.
Contrail Insights provides end-to-end visibility into your cloud environment to improve the
operations of your network. A Contrail Insights node is needed to run Contrail Insights.
370
6. Click the > icon next to a server to assign it as a Contrail Insights node. The server is moved into the
Assigned Contrail Insights Nodes table.
7. Click Provision.
The cluster provisioning begins and the page displays provisioning progress. When the provisioning is
completed, you are directed to log in to Contrail Command.
When there are existing collector nodes in the deployment, you are not required to specify the
provisioning type.
To add a collector node when there are existing collector nodes and no available server nodes:
Field Description
Field Description
Choose Mode Options include: Express, Detailed, or Bulk Import (CSV). We recommend using the
Detailed or Bulk Import (CSV) modes in most environments to ensure all server field
data is entered and to avoid performing manual configuration tasks later in the
procedure.
• Bulk Import (CSV)—Import the physical server or VM fields from a CSV file.
Management Interface Name of the management-network facing interface on the physical server or VM.
Disk Partition(s) (Optional) Specify the disk partitions that you want to use. This field is often left
blank.
5. Click Next after completing all fields to add the server or VM.
You can see the added server in the Available Servers box. Listed are the servers that can be
provisioned as Contrail Insights nodes. Contrail Insights provides end-to-end visibility into your cloud
environment to improve the operations of your network. A Contrail Insights node is needed to run
Contrail Insights.
372
6. Click the > icon next to a server to assign it as a Contrail Insights node. The server is moved into the
Assigned Contrail Insights Nodes table. If you are assigning an in-band server, you are prompted to
enter the in-band interface.
7. Click Provision.
The cluster provisioning begins and the page displays provisioning progress. When the provisioning is
completed, you are directed to log in to Contrail Command.
To add a collector node when there are existing collector nodes and an available server node:
4. Click the > icon next to a server to assign it as a Contrail Insights node. The server is moved into the
Assigned Contrail Insights Nodes table. If you are assigning an in-band server, you are prompted to
enter the in-band interface.
373
5. Click Provision.
The cluster provisioning begins and the page displays provisioning progress. When the provisioning is
completed, you are directed to log in to Contrail Command.
The Collector Nodes page displays with a message stating the new collector nodes need to be
associated to a fabric device. In the Connected Fabric column, if the collector node is connected to a
fabric the fabric name displays. When a collector node is not connected, the Connect to Fabric drop-
down list shows the unconnected nodes. Two options to connect are offered:
374
• Click Bulk Connect to connect multiple selected collector nodes to a fabric device.
3. Click Connect to Fabric, then select the unconnected node from the drop-down list.
Field Description
CIDR Enter the underlay telemetry infrastructure subnet. The in-band interface on the
Contrail Insights Flows node is assigned an IP address from this subnet.
Virtual IP Address Enter the virtual IP address on the Insights Flows node that connects the node to
the management network. The address is entered as a four-octet IP address with
no mask; for example, 10.1.1.20.
In-Band Collector All in-band configured collector nodes will display here.
Details
See "Configuring Contrail Insights Flows by Assigning Telemetry and sFlow Profiles to Devices" on
page 340.
The Collector Nodes page displays the existing flow collector nodes.
The Collector Nodes Management dialog box displays details about provisioning type and flow
parameters.
The cluster provisioning begins and the page displays provisioning progress. When the provisioning is
completed, you are directed to log in to Contrail Command.
The Collector Nodes page displays the existing flow collector nodes.
3. Click the trash can icon in the row for the flow collector node you want to remove.
4. Click Delete.
If your deletion takes the sFlow project below the thresholds, then you are alerted that this will
enable sFlow to become unstable. To continue removing the collector node, select the Unsafe Delete
check box.
5. Click Delete.
The cluster provisioning begins and the page displays provisioning progress.
The Collector Nodes page displays and confirms the node is deleted.
Release Description
2011 Contrail Networking Release 2011 supports adding, removing, and reconfiguring collector nodes (also
known as sFlow nodes) after the system is up and running. Prior to this release, collector nodes could
only be added during provisioning.
RELATED DOCUMENTATION
IN THIS SECTION
Caveats | 379
Contrail Networking Release 2011 supports adding, removing, and reconfiguring collector nodes (also
known as sFlow nodes) after the system is up and running. Prior to this release, collector nodes could
only be added during provisioning.
This topic describes adding or deleting flow collector nodes to an existing Contrail cluster by modifying
the instances.yml file, which gets generated when Contrail cluster is provisioned by using Contrail
Command UI. The instances.yml file is created inside /var/tmp/contrail_cluster/<contrail_cluster_id> in
contrail_command container.
You can:
• Add flow collector nodes to a Contrail cluster without any existing flow collector node.
• Add flow collector nodes to a Contrail cluster with existing flow collector nodes.
When a new flow collector node is added, or an existing flow collector node is deleted by modifying the
existing instances.yml file:
1. Ansible playbook will run to first cleanup the flow collector nodes which need to be deleted.
2. Then Ansible playbook will run to set up the new flow collector nodes and to rebuild the cluster.
Existing cluster details are in the instances.yml. The appformix_flows role designates Contrail Insights
Flows node. The following example shows a snippet of section for instances.yml for existing Contrail
Insights Flows node details:
instances:
host1:
ip: 10.87.3.85
provider: bms
378
roles:
appformix_bare_host:
appformix_flows:
New snippet for instances.yml to register one more node, host2, in the Contrail Insights Flows cluster:
instances:
host1:
ip: 10.87.3.85
provider: bms
roles:
appformix_flows:
host2:
ip: 10.87.3.86
provider: bms
roles:
cd /usr/share/contrail/appformix-ansible-deployer/xflow/
. venv/bin/activate
bash deploy_insights_flows.sh <instance.yml file> --cluster-id <contrail_cluster_id>
1. Modify the instances.yml file to delete flow collector nodes. The following example shows a snippet of
section for instances.yml for existing Contrail Insights Flows node details:
instances:
host1:
ip: 10.87.3.85
provider: bms
roles:
appformix_bare_host:
appformix_flows:
host2:
ip: 10.87.3.86
provider: bms
roles:
379
appformix_bare_host:
appformix_flows:
New snippet for instances.yml to deregister host2 from the Contrail Insights Flows cluster by detaching
the appformix_flows role from host2:
instances:
host1:
ip: 10.87.3.85
provider: bms
roles:
appformix_bare_host:
appformix_flows:
host2:
ip: 10.87.3.86
provider: bms
roles:
appformix_bare_host:
cd /usr/share/contrail/appformix-ansible-deployer/xflow/
. venv/bin/activate
bash deploy_insights_flows.sh <instance.yml file> -cluster-id <contrail_cluster_id>
Caveats
• You can provision the collectors only once before fabric onboarding.
• You cannot add new Contrail Insights Flows nodes to the cluster after initial provisioning.
Release Description
2011 Contrail Networking Release 2011 supports adding, removing, and reconfiguring collector nodes (also
known as sFlow nodes) after the system is up and running. Prior to this release, collector nodes could
only be added during provisioning.
380
RELATED DOCUMENTATION
Adding, Editing, and Deleting sFlow Collector Nodes in Contrail Command | 362
Contrail Insights Flows in Contrail Command | 338
IN THIS SECTION
With Contrail Insights Alarms, you can configure an alarm to be generated when a condition is met in
the infrastructure. Contrail Insights performs distributed analysis of metrics at the point of collection for
efficient and responsive detection of events that match an alarm. Contrail Insights has two types of
alarms:
NOTE: For Contrail Insights releases prior to 3.2.6: In order to configure alarms, your Contrail
Insights license subscription must be active.
For both static and dynamic alarms, Contrail Insights Agent continuously collects measurements of
metrics (see Metrics Collected by Contrail Insights) for different entities, such as hosts, instances, and
network devices. Beyond simple collection, the agent also analyzes the stream of metrics at the time of
collection to identify alarm rules that match. For a particular alarm, the agent aggregates the samples
according to a user-specified function (average, standard deviation, min, max, sum) and produces a single
measurement for each user-specified measurement interval. For a given measurement interval, the agent
381
compares each measurement to a threshold. For an alarm with a static threshold, a measurement is
compared to a fixed value using a user-specified comparison function (above, below, equal). For dynamic
thresholds, a measurement is compared with a value learned by Contrail Insights over time.
You can further configure alarm parameters that require multiple intervals to match. This allows you to
configure alarms to match sustained conditions, while also detecting performance over small time
periods. Maximum values over a wide time range can be over-exaggerate conditions. Yet, averages can
dilute the information. A balance is better achieved by measuring over small intervals and watching for
repeated matches in multiple intervals. For example, to monitor CPU usage over a three-minute period,
an alarm may be configured to compare average CPU utilization over fiveseconds intervals, yet only
raise an alarm when 36 (or some subset of 36) intervals match the alarm condition. This provides better
visibility into sustained performance conditions than a simple average or maximum over three minutes.
Dynamic thresholds enable outlier detection in resource consumption based on historical trends.
Resource consumption may vary significantly at various hours of the day and days of the week. This
makes it difficult to set a static threshold for a metric. For example, 70% CPU usage may be considered
normal for Monday mornings between 10:00 AM and 12:00 PM, but the same amount of CPU usage
may be considered abnormally high for Saturday nights between 9:00 PM and 10:00 PM.
With dynamic thresholds, Contrail Insights learns trends in metrics across all resources in scope to which
an alarm applies. For example, if an alarm is configured for a host aggregate, Contrail Insights learns a
baseline from metric values collected for hosts in that aggregate. Similarly, an alarm with a dynamic
threshold configured for a project learns a baseline from metric values collected for instances in that
project. Then, the agent generates an alarm when a measurement deviates from the baseline value
learned for a particular time period.
When creating an alarm with a dynamic threshold, you select a metric, a period of time over which to
establish a baseline, and the sensitivity to measurements that deviate from the baseline. The sensitivity
can be configured as high, medium, or low. Higher sensitivity will report smaller deviations from the
baseline and vice versa.
Contrail Insights Agent performs distributed, real-time statistical analysis on a time-series data stream.
Agent analyzes metrics over multiple measurement intervals using a configurable sliding window
mechanism. An alarm is generated when the Contrail Insights Agent determines that metric data
matches the alarm criteria over a configurable number of measurement intervals. The type of sample
aggregation and the threshold for an alarm is configurable. Two types of alarms are supported: static and
dynamic. The difference is how the threshold is determined and used to compare measured metric data.
The following sections describe the overall sliding window analysis, and explains the details of static
thresholds and dynamic baselines used by the analysis.
382
Contrail Insights Agent evaluates alarms using sliding window analysis. The sliding window analysis
compares a stream of metrics within a configurable measurement interval to a static threshold or
dynamic baseline. The length of each measurement interval is configurable to one-second granularity. In
each measurement interval, raw time-series data samples are combined using an aggregation function,
such as average, max, and min. The aggregated value is compared against the static threshold or
dynamic baseline using a configurable comparison function, such as above or below. Multiple
measurement intervals comprise a sliding window. A configurable number of intervals in the sliding
window must match the rule criteria for the agent to generate a notification for the alarm.
Figure 196 on page 382 shows an example in which the sliding window consists of six adjacent
measurement intervals (i1 to i6), as specified by the Interval Count parameter. In measurement interval
i1, the average of samples S1, S2, S3 is computed as Savg. Depending on the alarm type static or
dynamic, Savg is then compared with the configured static threshold or dynamically learned baseline
using a user-specified comparison function such as above or below. The output of the comparison
determines whether a specific measurement interval is marked as an interval with exception. This
evaluation is repeated for each measurement interval within the sliding window (for example, i1 to i6).
In the example in Figure 196 on page 382, the agent determines that two intervals, i2 and i5, are
intervals with exception by comparing the aggregate value for the measurement interval with a static
383
threshold or dynamic baseline, depending on alarm type. Assuming interval i1 is the first interval for
which the alarm is configured, the alarm becomes active at end of interval i6, when Contrail Insights
Agent determines that at least two out of the most recent six measurement intervals are marked as
exceptions. When an alarm is configured using the Dashboard, Interval Count, and Intervals with
Exception are set to 1 by default. As a result, the agent can generate an alarm after processing data for
one measurement interval.
Static Alarm
A static alarm threshold is provided at the time of alarm definition. Figure 197 on page 383 depicts an
example of a static alarm definition, followed by the equivalent JSON used for API configuration of an
alarm. The condition defined in the example is to evaluate an average of host.cpu.usage samples over a 60
second measurement interval. The measured value is compared against a static threshold of 80% to
determine if a given measurement interval matches the alarm rule. Figure 197 on page 383 identifies the
components in a static alarm definition.
Dynamic Alarm
A dynamic alarm threshold is learned by Contrail Insights using historical data for the set of entities for
which an alarm is configured. Figure 198 on page 384 shows an example of a dynamic alarm definition
and identifies the components in a dynamic alarm definition.
384
When using a dynamic threshold, you do not configure a static threshold value. Instead, you specify
three parameters that control how the learning is performed. The learning algorithm produces a baseline
across the entities. The baseline is comprised of a mean value and a standard deviation. The baseline is
updated continuously as additional metric data is collected.
Following is a list of the three learning parameters and information about how they work:
BaselineAnalysisAlgorithm Selects the machine learning algorithm used for determining the dynamic
threshold. The following algorithms are available:
LearningPeriodDuration A dynamic baseline is determined using the historical data. This parameter
determines the length of time period from which most recent historical
data is used to compute a dynamic baseline. For example, 1 hour, 1 day, or
1 week. At the time of rule configuration, Contrail Insights might not yet
have enough historical data for a given entity. In this case, learning is
performed as data becomes available. Alarm evaluation begins after one
Learning Period of data is available and baselines are generated.
Alarm Definition
Figure 197 on page 383 shows an example of a static alarm definition. Every alarm definition has the
following components shown in Table 72 on page 386.
386
Alarm Rule Type Static, Dynamic This determines the type of threshold
that alarm uses to determine if alarm
should be generated or not. Following
are the two types that are supported.
Scope Host, Instance, Network Device, Virtual Type of entity such as host, instance, or
Network network device to which the alarm
applies. For example, if scope is selected
as Instance, then you can further select
to configure rule to all instances present
in the infrastructure, or instances that
are present in a specific project or an
aggregate.
387
Service RabbitMQ, MySQL, Ceph, OpenStack, When selected, you can configure alarms
Cassandra, Contrail, ScaleIO for RabbitMQ, MySQL, Ceph, OpenStack,
Cassandra, Contrail, and ScaleIO
services.
Metric Scope Cluster, Node, Queue Select the metric scope of what you
want to monitor, such as cluster, node, or
queue and then the metric to monitor.
Generate Event, Alarm When conditions for the alarm are met,
generate an event or alarm.
When Value —
• Sensitivity
Learning Period Duration 1 week, 1 month Table 73 on page 392 describes these
options.
Severity None, information, warning, error, critical Indicates seriousness of the alarm.
Critical indicates a major alarm.
Information indicates a minor alarm.
Aggregate/Project All hosts, all instances. AggregateId, Select the set of entities an alarm will
ProjectId monitor. If Scope is Instance, then you
can configure an alarm for the set of
instances present in a specific project,
aggregate, or all instances in the
infrastructure. If Scope is Host, then you
can configure an alarm for a set of hosts
present in a specific aggregate or all
hosts in the infrastructure.
390
Aggregation Function Average, Max, Min, Sum, Std-dev Determines how data samples received
in one measurement interval are
processed to generate an aggregated
value for comparison. Agent collects
multiple samples of a metric during a
measurement interval. Agent combines
the samples according to the aggregation
function, in order to determine a single
value for comparison with the threshold
(static or dynamic) in a measurement
interval. Table 76 on page 395 lists and
describes the aggregation functions for
alarm processing.
Comparison Function Above, Below, Equal, Increasing-at-a- Determines how to compare output of
minimum-rate-of, Decreasing-at-a- the Aggregation Function with the static
minimum-rate-of or dynamic threshold. Table 77 on page
396 shows different comparison
functions supported for Contrail Insights
alarms. Figure 199 on page 398 and
Figure 200 on page 399 show examples
of the Comparison Function, showing
both increases and decreases at a
minimum rate.
Alarm Severity None, information, warning, error, critical Indicates seriousness of the alarm.
Critical indicates a major alarm.
Information indicates a minor alarm.
Intervals with Exception For example, “2” This is the minimum number of
measurement intervals within the sliding
window for which a condition for an
alarm must be met to raise the alarm. In
Figure 198 on page 384, there are two
Intervals with Exception: i2 and i5. When
configuring an alarm in the Dashboard,
Intervals with Exception is set to 1 by
default. The Interval with Exception can
be specified in the Dashboard by
selecting Monitoring > Alarms > Add
Rule. Intervals with Exception can not be
greater than the Interval Count.
Table 73 on page 392 describes the required parameters for a dynamic alarm and the supported options.
392
Learning The Learning Period Duration specifies the amount of • 1 week—Baseline is determined for
Period historical data used by the Baseline Analysis Algorithm each hour of last 1 week of data.
Duration to determine a baseline. The dynamic baseline is Next 1 week of baselines are
continuously updated using data from the most recent determined based on data of the
Learning Duration. last week.
Sensitivity The dynamic baseline provides a normal operating • Low—Any data point beyond 5 *
region of a given metric for a given scope. As seen in std-dev from the baseline mean is
Figure 201 on page 400, the dynamic baseline is a outlier.
tuple which has mean and std-dev applicable for a
specific hour of the day. • Medium—Any data point beyond 3
* std-dev from baseline mean is
The sensitivity factor determines what is the allowable
outlier.
band of operation. Measurements outside of the band
of operation cause an interval with exception. For
• High—Any data point beyond 2 *
example, if the baseline mean is 20 and std-dev is 2,
std-dev from baseline mean is
then normal operating region is between 18 and 22.
outlier.
When sensitivity is low then normal operating region
is treated as 10 (mean - 5*std-dev) and 30 (mean +
5*std-dev). In this case, if the measured average of a
metric is between 10 and 30, then no alarm is raised.
In contrast, if the average is 5 or 35, then an alarm is
raised.
Table 74 on page 393 shows all possible states for an alarm with the mode configured as alert.
State Description
Learning This is the initial state of each alarm. In this state, the alarm is processing real-time data and alarm
stays in this state until sufficient data has been processed to make the decision about if an alarm
should be generated or not. The duration of the learning period depends on the sliding window
parameters.
Active The condition specified by an alarm is met. Alarm will stay in this state as long as alarm conditions are
satisfied.
394
State Description
Inactive Condition specified by an alarm is not met. For example, after the learning state, the alarm transitions
from active to inactive state because CPU usage was below the set threshold.
Disabled Agent is not actively analyzing data for this alarm. The alarm is either deleted or temporarily disabled
by the user.
Table 75 on page 394 shows all possible states for an alarm with the mode configured as event.
State Description
Enabled This is the initial state of the alarm with the mode set to Event when a rule is configured. It stays in
this state until conditions are met to generate an alarm.
Triggered When conditions for alarm generation are satisfied, then an alarm is generated with a state of
triggered. Alarm generation is logged at the end of each measurement interval as long conditions for
alarms continue to be met.
Disabled Agent is not actively analyzing data for this alarm. The alarm is either deleted or has been temporarily
disabled by the user.
Table 76 on page 395 lists and describes the aggregation functions for alarm processing.
395
Aggregation Description
Function
Average Statistical average of all data samples received within one measurement interval.
Example: Generate Host Alert when Cpu-Usage Average during a 60 seconds interval is Above
80% of 2 of the last 3 measurement intervals.
In this example, the measurement interval is 60 seconds. An alarm is generated if the average of
the CPU usage samples exceeds 80% in any 2 measurement intervals out of 3 adjacent
measurement intervals.
Sum Sum of all data samples received within one measurement interval.
Example: Generate Host Alert when Cpu-Usage Sum during a 60 seconds interval is Above
250% of 2 of the last 3 measurement intervals.
In this example, An alarm is generated if the CPU usage sum is above 250% in any 2
measurement intervals out of 3 adjacent measurement intervals, where each measurement
interval is 60 seconds in duration.
Example: Generate Host Alert when Cpu-Usage Max during a 60 seconds interval is Above 95%
of 2 of the last 3 measurement intervals.
In this example, the alarm is generated if the maximum CPU usage is above 95% in any 2
measurement intervals out of 3 adjacent measurement intervals, where each measurement
interval is 60 seconds in duration.
Example: Generate Host Alert when Cpu-Usage Min during a 60 seconds interval is Below 5%
of 2 of the last 3 measurement intervals.
In this example, the alarm is generated if the minimum CPU usage is below 5% in any 2
measurement intervals out of 3 adjacent measurement intervals, where each measurement
interval is 60 seconds in duration.
396
Aggregation Description
Function
Std-Dev Standard Deviation of the time-series data is determined based on the samples received until
current measurement interval.
Example: Generate Host Alert when Cpu-Usage std-dev during a 60 seconds interval is Above 2
sigma of 2 of the last 3 measurement intervals.
In this example, the alarm is generated when the raw time series samples are above mean +
2*sigma in at least 2 measurement intervals out of the last 3 measurement intervals, where each
measurement interval is a duration of 60 seconds.
Figure 199 on page 398 and Figure 200 on page 399 show examples of the Comparison Function,
showing both increases and decreases at a minimum rate.
Table 77 on page 396 shows different comparison functions supported for Contrail Insights alarms.
Comparison Description
Operator
Above Determine if result of the aggregation function within a given measurement interval is above
the threshold.
NOTE: For dynamic threshold above, Contrail Insights compares whether the result of the
aggregation function is outside of the normal operating region (mean +/- sigma*sensitivity).
Below Determine if result of the aggregation function determined for a given measurement interval
is below the threshold.
NOTE: For dynamic threshold, below compares whether the result of aggregation function is
within the normal operating region (mean +/- sigma*sensitivity).
Comparison Description
Operator
Increasing-at-a- This comparison function is useful when you are interested in tracking a sudden increase in
minimum-rate- the value of a given metric instead of its absolute value. For example, if ingress or egress
of network bandwidth starts increasing within short intervals then you might want to raise an
alarm. Figure 199 on page 398 shows sudden increase in metric average between
measurement interval i1 and i2. Similarly, sudden increase is observed in metric average
between measurement intervals i4 to i5.
In the example, if the mean ingress bit rate increases by at least 25% in 2 measurement
intervals out of 3, then an alarm is raised.
Decreasing-at- This comparison function is useful when you are interested in tracking sudden decrease in the
a-minimum- value of a given metric instead of its absolute value. For example, egress network bandwidth
rate-of starts decreasing within short intervals then you might want to raise an alarm to investigate
the root cause. Figure 200 on page 399 shows sudden decrease in metric average between
measurement interval i1 and i2. Similarly, sudden decrease is observed in metric average
between measurement intervals i3 and i4.
In the example, if the mean egress bit rate decreases by at least 25% in 2 measurement
intervals out of 3, then an alarm is raised.
398
Figure 201 on page 400 shows the dynamic baseline computed by 24 hours of data and the k-means
clustering algorithm. For a given hour of the day, the blue dot is the mean; the green bar is the mean + std-
dev; the purple bar is mean - std-dev.
400
Figure 201: Dynamic Baseline Determined by Last 24 Hours of Data and K-Means Clustering Algorithm
Figure 202 on page 401 shows the dynamic baseline computed by 24 hours of historical data using the
EWMA algorithm. This baseline is used for the next 1 hour for alarm generation until it is updated again
using the most recent 24 hours of data.
401
Figure 202: Dynamic Baseline Determined by Last 24 Hours of Historical Data Using EWMA
To configure an alarm:
2. In the Alarm Rules panel, click Add Rule to create a new rule to trigger an alarm when a user-defined
condition is met on one of the selected entities in the network.
402
Figure 203: Alarm Active Alerts and Alarm Rules Panel in Contrail Command
3. For Module, select one of the following options. Based on your selection, the fields differ.
Alarms When Alarms is selected, you can configure alarms for entities such as hosts,
instances, and network devices.
Service When Service Alarms is selected, then you are able to configure alarms for services in
Alarms your environment, such as RabbitMQ, MySQL, ScaleIO, and OpenStack services.
403
• Static—When an alarm is defined as static, the rule definition should include a predefined static
threshold determined by the user.
5. Select the metric for the rule and specify interval when the rule should trigger an alarm. For other
parameters, see Table 72 on page 386 and descriptions in section "Alarm Definition."
RELATED DOCUMENTATION
IN THIS SECTION
This section describes the Instances detail screen and how to configure instances for virtual or physical
servers using Contrail Command.
NOTE: For Contrail Insights releases prior to 3.2.6: In order to view and configure instances, your
Contrail Insights license subscription must be active.
405
Table 78 on page 405 provides descriptions for the instances column headers.
Header Description
Status The lights indicate the provisioning status of an instance and has multiple states: Red indicates an
alert state, green indicates a normal state, yellow indicates warning state and grey for other
states. Spinning circle means “in progress” and solid dot means “static.” If status information is
missing (no-data), this field is empty.
State Shows the current state of the instance. Power On: Active means the instance is running.
Server Type Indicates which server type is in use, such as Baremetal Server. No LCM (lifecycle management)
means that Contrail Command is not managing the server.
Networks Displays the virtual network (VLAN) associated with the instance.
Creating Instances
A virtual network in the Contrail environment allows hosts in the same network to communicate with
each other. This is similar to assigning a VLAN to each host so that hosts on the same VLAN can reach
each other. An instance then matches the virtual network to devices and their interfaces, as shown in
Figure 205 on page 406.
1. Select Infrastructure > Workloads > Instances. All virtual machine instances and baremetal server
instances created appear on the Instances screen.
406
2. Click Create, as shown in Figure 205 on page 406, to add a new instance.
a. When either Virtual Machine or New Baremetal Server are selected, complete the following fields,
described in Table 79 on page 407, to define an instance for the selected server:
407
Figure 206: Create an Instance for a Virtual Machine or New Baremetal Server
Field Description
Instance Name Enter a name for this instance you are creating.
Select Boot Source Select an image or clone from the list as your boot source.
Table 79: Create Instance Fields—Virtual Machine or New Baremetal Server (Continued)
Field Description
Allocated Networks Network resources that can be allocated according to the demands of workloads.
Availability Zone Select an availability zone. An availability zone groups network nodes that run
services like DHCP, L3, FW, and others. This allows you to associate an availability
zone with their resources so that the resources get high availability.
Count Select a number from 1 - 10, which represents the number of instances to launch.
a. When Existing Baremetal Server is selected, complete the following fields, described in Table 80
on page 409, to define an instance for the selected server:
409
Field Description
Associate interfaces
Interface Name of the physical interface and MAC address for the server.
Field Description
5. To add other instances, click Create, as shown in Figure 205 on page 406.
RELATED DOCUMENTATION
IN THIS SECTION
Time | 411
Legend | 411
With cluster node details and host charts, you can view real-time and historical values of all metrics that
Contrail Insights monitors. Charts provide you with a way to view metrics for multiple entities across
layers and organized by physical host, project, or aggregate. The charts update with the latest data
streamed from the Contrail Insights Platform without needing to refresh. You can select which entities
to display on the charts, and select the time period that is displayed. When you hover over the charts, a
411
pop-up box shows the actual values for the selected entities at a specific point in time. Figure 209 on
page 413 shows real-time metric values streamed from Contrail Insights.
NOTE: For Contrail Insights releases prior to 3.2.6: In order to view host charts, your Contrail
Insights license subscription must be active.
Time
The Time in the Settings dialog box (see Figure 209 on page 413) provides navigation to a specific point
in time that you want to view. Use the time and date drop-down list to select a range. Using the range
selected, you can use the time slider to fine tune the time range by scaling up or down. This time range
is used to query data that will be drawn in the visualizations.
Legend
The Legend shows which entities are currently being displayed in the charts. See Figure 209 on page
413. You can select a subset of entities to display to improve the clarity of the charts and focus on
specific entities. The first five series are selected by default. The entity list is categorized and searchable
in the Settings dialog box.
The host charts show the latest data for up to four different metrics, updating in real-time from a stream
of data from the Contrail Insights Platform. When the cursor is positioned over the charts, a pop-up box
shows the data values at that particular time. Charts can be zoomed in or out by opening the Settings
dialog box and adjusting the time range. Four charts are displayed on the Dashboard at all times.
412
Figure 208: Chart Data Values Tool Tip for a Particular Time
3. In the Summary tab page, by default, basic information for the selected host is listed. Use the toggle
button to switch between the textual information list and a JSON view for further technical
processing.
413
Figure 209: Real-Time Metric Values Streamed from the Contrail Insights Platform
4. Click Edit to launch the Settings dialog box, where you can set the time range and legend. With an
active Contrail Insights subscription, you have access to the Contrail Insights data source and a
separate 4-charts dashboard will show on the right to provide visualizations of data metrics.
• Time—For time range selection, use the time/date drop-down list to select a range. Using the
range selected from the drop-down, use the time slider to fine tune (narrowing down or scaling
up) the time range at a fixed step. This time range is used to query data that will be drawn in the
visualizations.
• Legend—For legend or list of series, use the expanded list to add or remove entities drawn in a
chart.
• Peers tab—Includes JSON values, peer type, peer ASN, status, and messages count.
• Routes tab—Includes routing table JSON values, prefix, protocol, source, next hop, label, security
group, and origin virtual-network object (VN).
RELATED DOCUMENTATION
CHAPTER 7
IN THIS CHAPTER
This topic presents troubleshooting scenarios and steps for resolving reachability issues (ping failures)
when working with policy-connected virtual networks.
These are the methods used to configure reachability for a virtual network or virtual machine:
• Use a floating IP address pool to associate an IP address from a destination virtual network to virtual
machine(s) in the source virtual network.
• Use an ASN/RT configuration to exchange virtual network routes with an MX Series router gateway.
• Use a service instance static route configuration to route between service instances in two virtual
networks.
This topic focuses on troubleshooting reachability for the first method --- using network policy to
exchange routes between virtual networks.
Check the tap interface status in the http agent introspect, for example:
https://<host ip address>:8085/Snh_ItfReq?name=
When the virtual machine status is verified Up, and the tap interface is Active, you can focus on
other factors that affect traffic, including routing, network policy, security policy, and service
instances with static routes.
2. Check reachability and routing.
Use the following troubleshooting guidelines whenever you are experiencing ping failures on virtual
network routes that are connected by means of network policy.
• Each attached policy should have either an explicit rule allowing traffic from one virtual network
to the other, or an allow all traffic rule.
• Verify that the order of the actions in the policy rules is correct, because the actions are applied in
the order in which they are listed.
417
• If there are multiple policies attached to a virtual network, verify that the policies are attached in a
logical order. The first policy listed is applied first, and its rules are applied first, then the next
policy is applied.
• Finally, if either of the virtual networks does not have an explicit rule to allow traffic from the
other virtual network, the traffic flow will be treated as an UNRESOLVED or SHORT flow and all
packets will be dropped.
Use the following sequence in the Contrail UI to check policies, attachments, and traffic rules:
If a route is missing, ping fails. Flow inspection in the compute node displays Action: D(rop).
Repeated dropstats commands confirms the drop by incrementing the Flow Action Drop counter
with each iteration of dropstats.
To help in debugging flows, you can use the detailed flow query from the agent introspect page for
the compute node.
• Inputs [from flow –l output]: src/dest ip, src/dest ports, protocol, and vrf
You can also retrieve information about unresolved flows from the Contrail UI, as shown in the
following:
421
The following shows a sample query on a protocol-specific flow in the agent introspect:
The following shows that the policy action clearly displays deny as the action.
422
Summary
This topic explores one area —debugging for policy-based routing. However, in a complex system, a
virtual network might have one or more configuration methods combined that influence reachability and
routing.
For example, an environment might have a virtual network VN-X configured with policy-based routing
to another virtual network VN-Y. At the same time, there are a few virtual machines in VN-X that have a
floating IP to another virtual network VN-Z, which is connected to VN-XX via a NAT service instance.
This is a complex scenario, and you need to debug step-by-step, taking into account all of the features
working together.
Additionally, there are other considerations beyond routing and reachability that can affect traffic flow.
For example, the rules of network policies and security groups can affect traffic to the destination. Also,
if multi-path is involved, then ECMP and RPF need to be taken into account while debugging.
423
IN THIS SECTION
Use the troubleshooting steps and guidelines in this topic when you have errors with Contrail BGP
peering and route exchange.
Example Cluster
Examples in this document refer to a virtual cluster that is set up as follows:
Collector : [‘nodea22’]
WebU : nodea22
Openstack : nodea22
Use this procedure to launch various introspects to verify the setup of the BGP routers in your system.
NOTE: Throughout this procedure, replace <host ip address> with the correct location for your
system to see the setup in your system.
3. Verify the command line arguments that are passed to the control-node.
On the control-node, use ps aux | grep control-node to see the arguments that are passed to the
control-node.
Example
The hostname is the bgp-router name. Ensure that the bgp-router config can be found for the
hostname, using the procedure in Step 1.
4. Validate the BGP neighbor config and the BGP peering config object available on the control node.
The control node receives the configuration from Cassandra (starting with Contrail Networking
Release 4.0) or from IF-MAP (earlier than Contrail Networking Release 4.0).
http: //<host ip address>:8083/Snh_ShowBgpNeighborConfigReq?
426
1. Validate the presence of the routing instance for each virtual network in the sample system.
http ://<host ip address>:8083/Snh_ShowRoutingInstanceReq?name=
427
NOTE: Throughout this example, replace <host ip address> with the correct location for the
control node on your system.
In the sample output, you can see the import_target and the export_target configured on the routing
instance. Also shown are the xmpp peers (vroutes) registered to the table.
The user can click on the inet table of the required routing instance to display the routes that belong
to the instance.
In the following sample output (truncated), the user can validate the BGP paths for the protocol and
for the source of the route to verify which XMPP agent or vRouter has pushed the route. If the path
source is BGP, the route is imported to the VRF table from a BGP peer, either another control-node
or an external bgp router such as an MX Series router. BGP paths are displayed in the order of path
selection.
428
The following sample output has been scrolled horizontally to display the BGP path attributes of
each route’s. policies.
The extended community (communities column), determines the VRF table to which this VPN route
is imported. The origin_vn shows the virtual network where this route was created, information
useful for applying ACL.
The label (MPLS) and tunnel encap columns can be used for debugging data path issues.
429
1. Create a network policy to allow vn1 and vn2 traffic and associate the policy to the virtual networks.
2. Validate that the routing instances have the correct import_target configuration.
http: //<host ip address>:8083/Snh_ShowRoutingInstanceReq?name=
430
1. Set the Global AS number of the control-node for an MX Series BGP peer, using the Contrail WebUI
(eBGP).
2. Configure the eBGP peer for the MX Series router. Use the Contrail Web UI or Python provisioning.
Configuring the MX Series BGP peer with the Python provision utility:
NOTE: This example uses locations at http: //<host ip address>:. Be sure to replace <host ip
address> with the correct address for your environment.
3. Fix the families mismatch in the sample by updating the configuration on the MX Series router, using
Junos CLI:
set protocols bgp group contrail-control-nodes family inet-vpn unicast
4. After committing the CLI configuration, the peer comes up. Verify this with UVE.
http: //<host ip address>:8081/analytics/uves/bgp-peers
434
5. Verify the peer status on the MX Series router, using Junos CLI:
Local Address: <ip address> Holdtime: 90 Preference: 170 Local AS: 12345 Local System AS:
64512
Number of flaps: 0
Peer ID: <ip address> Local ID: <ip address> Active Holdtime: 90
2. Configure the MX Series IBGP peer, using Contrail WebUI or Python provisioning.
Configuring the MX Series BGP peer with the Python provision utility:
python ./provision_mx.py --router_name mx--router_ip <ip address> --router_asn 64512 --api_server_ip <ip
address> --api_server_port 8082 --oper add --admin_user admin --admin_password <password> --admin_tenant_name
admin
3. Verify the peer from UVE.
http ://<host ip address>:8081/analytics/uves/bgp-peers
437
4. You can verify the same information at the HTTP introspect page of the control node (8443 in this
example).
http: //<host ip address>:8083/Snh_BgpNeighborReq?ip_address=&domain=
4. Launch a virtual machine in the public network and verify the route in the public.inet.0 table.
439
Figure 244: Virtual Machine Routing Instance Public IPv4 Route Table
run show route table bgp.l3vpn.0 receive-protocol bgp <ip address> detail
Import Accepted
VPN Label: 16
Localpref: 100
AS path: ?
Communities: target:64512:1 target:64512:10003 unknown iana 30c unknown iana 30c unknown
type 8004 value fc00:1 unknown type 8071 value fc00:4
IN THIS SECTION
Example | 443
This document provides troubleshooting methods to use when you have errors with the floating IP
address pool when using Contrail.
Example Cluster
Examples in this document refer to a virtual cluster that is set up as follows:
WebUI : nodec7
Openstack : nodec6
The following virtual networks are used in the examples in this document:
• Subnet: 10.1.1.0/24
443
Example
A virtual machine is created in the virtual network VN1 with the name VN1_VM1 and with the IP
address 10.1.1.253. A floating IP address of 10.204.219.37 is associated to the VN1_VM1 instance.
An MX80 router is configured as a gateway to peer with control nodes nodec7 and nodec8.
444
chassis {
fpc 1 {
pic 0 {
tunnel-services;
interfaces {
ge-1/0/1 {
unit 0 {
445
family inet {
address 10.204.218.1/24;
ge-1/0/2 {
unit 0 {
family inet {
address 10.204.216.253/24;
routing-options {
static {
router-id 10.204.216.253;
route-distinguisher-id 10.204.216.253;
autonomous-system 64512;
dynamic-tunnels {
tun1 {
446
source-address 10.204.216.253;
gre;
destination-networks {
10.204.216.0/24;
10.204.217.0/24;
protocols {
bgp {
group control-nodes {
type internal;
local-address 10.204.216.253;
keep all;
family inet-vpn {
unicast;
neighbor 10.204.216.64;
neighbor 10.204.216.65;
}
447
routing-instances {
public {
instance-type vrf;
interface ge-1/0/1.0;
vrf-target target:64512:10003;
vrf-table-label;
routing-options {
static {
^C
Troubleshooting Details
The following sections show details of ways to get related information, view, troubleshoot, and validate
floating IP addresses in Contrail Networking.
+--------------------------------------+-------------------------+
| id | name |
+--------------------------------------+-------------------------+
| 43707766-75f3-4d48-80d9-1b7240fb161d | public_vn |
| 2ab7ea04-8f5f-4b8d-acbf-a7c29c9b4112 | VN1 |
| 1c59ded0-38e8-4168-b91f-4c51aba10d30 | default-virtual-network |
| 5b0a1040-91e4-47ff-bd4c-0a81e1901a1f | ip-fabric |
| 7efddf64-ff3c-44d2-aeb2-45d7472b7a64 | __link_local__ |
+--------------------------------------+-------------------------+
449
The Contrail API servers have the virtual-network public_vn object that contains floating IP pool
information. Use the following to view the floating-ip-pools object information.
curl -s -X GET -H "X-Auth-Token: $(openstack token issue | grep '| id' | awk '{print $4}')" http://<API-
Server_IP>:8082/virtual-network/<UUID_of_VN>
Example
"virtual-network": {
"floating_ip_pools": [
"href": "http://127.0.0.1:8095/floating-ip-pool/663737c1-f3ab-40ff-9442-
bdb6c225e3c3",
"to": [
"default-domain",
"admin",
"public_vn",
"public_pool"
],
"uuid": "663737c1-f3ab-40ff-9442-bdb6c225e3c3"
}
450
],
"fq_name": [
"default-domain",
"admin",
"public_vn"
],
"href": "http://127.0.0.1:8095/virtual-network/43707766-75f3-4d48-80d9-1b7240fb161d",
"id_perms": {
"created": "2014-02-07T08:58:40.892803",
"description": null,
"enable": true,
"last_modified": "2014-02-07T10:06:42.234423",
"permissions": {
"group": "admin",
"group_access": 7,
"other_access": 7,
"owner": "admin",
"owner_access": 7
},
"uuid": {
"uuid_lslong": 9284482284331406877,
451
"uuid_mslong": 4859515279882014024
},
"name": "public_vn",
"network_ipam_refs": [
"attr": {
"ipam_subnets": [
"default_gateway": "10.204.219.38",
"subnet": {
"ip_prefix": "10.204.219.32",
"ip_prefix_len": 29
},
"href": "http://127.0.0.1:8095/network-ipam/39b0e8da-
fcd4-4b35-856c-8d18570b1483",
"to": [
"default-domain",
"default-project",
452
"default-network-ipam"
],
"uuid": "39b0e8da-fcd4-4b35-856c-8d18570b1483"
],
"parent_href": "http://127.0.0.1:8095/project/deef6549-8e6c-4e3e-9cde-c9bc2b72ce6f",
"parent_type": "project",
"parent_uuid": "deef6549-8e6c-4e3e-9cde-c9bc2b72ce6f",
"route_target_list": {
"route_target": [
"target:64512:10003"
},
"routing_instances": [
"href": "http://127.0.0.1:8095/routing-instance/3c6254ac-cfde-417e-916d-
e7a1c0efad92",
"to": [
"default-domain",
"admin",
"public_vn",
"public_vn"
453
],
"uuid": "3c6254ac-cfde-417e-916d-e7a1c0efad92"
],
"uuid": "43707766-75f3-4d48-80d9-1b7240fb161d",
"virtual_network_properties": {
"extend_to_external_routers": null,
"forwarding_mode": "l2_l3",
"network_id": 4,
"vxlan_network_identifier": null
The floating-ips object should display the floating IP that is shown in the Contrail UI. The floating IP
should have a reference to the virtual machine interface (VMI) object that is bound to the floating IP.
Example
{
454
"floating-ip-pool": {
"floating_ips": [
"href": "http://127.0.0.1:8095/floating-ip/f3eec4d6-889e-46a3-a8f0-879dfaff6ca0",
"to": [
"default-domain",
"admin",
"public_vn",
"public_pool",
"f3eec4d6-889e-46a3-a8f0-879dfaff6ca0"
],
"uuid": "f3eec4d6-889e-46a3-a8f0-879dfaff6ca0"
],
"fq_name": [
"default-domain",
"admin",
"public_vn",
"public_pool"
],
"href": "http://127.0.0.1:8095/floating-ip-pool/663737c1-f3ab-40ff-9442-bdb6c225e3c3",
455
"id_perms": {
"created": "2014-02-07T08:58:41.136572",
"description": null,
"enable": true,
"last_modified": "2014-02-07T08:58:41.136572",
"permissions": {
"group": "admin",
"group_access": 7,
"other_access": 7,
"owner": "admin",
"owner_access": 7
},
"uuid": {
"uuid_lslong": 10683309858715198403,
"uuid_mslong": 7365417021744038143
},
"name": "public_pool",
"parent_href": "http://127.0.0.1:8095/virtual-network/
43707766-75f3-4d48-80d9-1b7240fb161d",
"parent_type": "virtual-network",
"parent_uuid": "43707766-75f3-4d48-80d9-1b7240fb161d",
456
"project_back_refs": [
"attr": {},
"href": "http://127.0.0.1:8095/project/deef6549-8e6c-4e3e-9cde-c9bc2b72ce6f",
"to": [
"default-domain",
"admin"
],
"uuid": "deef6549-8e6c-4e3e-9cde-c9bc2b72ce6f"
],
"uuid": "663737c1-f3ab-40ff-9442-bdb6c225e3c3"
+--------------------------------------
+-----------------------------------------------------------------------------------+
457
| id |
fixed_ips |
+--------------------------------------
+-----------------------------------------------------------------------------------+
| cdca35ce-84ad-45da-9331-7bc67b7fcca6 | {"subnet_id":
"e80f480b-98d4-43cc-847c-711e637295db", "ip_address": "10.1.1.253"} |
+--------------------------------------
+-----------------------------------------------------------------------------------+
Once you have obtained the virtual machine interface identifier, check the floating-ip objects that are
associated with the virtual machine interface.
"floating-ip": {
"floating_ip_address": "10.204.219.37",
"fq_name": [
"default-domain",
"admin",
"public_vn",
"public_pool",
"f3eec4d6-889e-46a3-a8f0-879dfaff6ca0"
],
"href": "http://127.0.0.1:8095/floating-ip/f3eec4d6-889e-46a3-a8f0-879dfaff6ca0",
"id_perms": {
"created": "2014-02-07T10:07:05.869899",
"description": null,
"enable": true,
"last_modified": "2014-02-07T10:36:36.820926",
"permissions": {
"group": "admin",
"group_access": 7,
"other_access": 7,
"owner": "admin",
459
"owner_access": 7
},
"uuid": {
"uuid_lslong": 12173378905373109408,
"uuid_mslong": 17577202821367744163
},
"name": "f3eec4d6-889e-46a3-a8f0-879dfaff6ca0",
"parent_href": "http://127.0.0.1:8095/floating-ip-pool/663737c1-f3ab-40ff-9442-
bdb6c225e3c3",
"parent_type": "floating-ip-pool",
"parent_uuid": "663737c1-f3ab-40ff-9442-bdb6c225e3c3",
"project_refs": [
"attr": null,
"href": "http://127.0.0.1:8095/project/deef6549-8e6c-4e3e-9cde-c9bc2b72ce6f",
"to": [
"default-domain",
"admin"
],
"uuid": "deef6549-8e6c-4e3e-9cde-c9bc2b72ce6f"
}
460
],
"uuid": "f3eec4d6-889e-46a3-a8f0-879dfaff6ca0",
"virtual_machine_interface_refs": [
"attr": null,
"href": "http://127.0.0.1:8095/virtual-machine-interface/
cdca35ce-84ad-45da-9331-7bc67b7fcca6",
"to": [
"54bb44e1-50e4-43d7-addd-44be809f1e40",
"cdca35ce-84ad-45da-9331-7bc67b7fcca6"
],
"uuid": "cdca35ce-84ad-45da-9331-7bc67b7fcca6"
Ensure that the BGP peering state is displayed as Established for the control nodes and the gateway
MX.
Example
http://nodec7:8083/Snh_BgpNeighborReq?ip_address=&domain=
http://nodec8:8083/Snh_BgpNeighborReq?ip_address=&domain=
In the following results, the floating IP route of 10.204.217.32 is installed by the compute node
(nodec10) that hosts that virtual machine.
Example
Example
462
http://nodec8:8083/Snh_BgpNeighborReq?ip_address=&domain=
Use the Contrail UI or the http introspect to view the public route’s corresponding BGP L3VPN routes,
as in the following example.
Example
http://nodec7:8083/Snh_ShowRouteReq?x=bgp.l3vpn.0
463
http://nodec8:8083/Snh_ShowRouteReq?x=bgp.l3vpn.0
Use the following commands from the gateway to verify that BGP sessions are established with the
control nodes nodec7 and nodec8:
From the MX80, use show route to display the routes for the virtual machine 10.204.219.37 that are
learned from both control-nodes.
In the following example, the routes learned are 10.204.216.64 and 10.204.216.65, pointing to a
dynamic GRE tunnel next hop with a label of 16 (of the virtual machine).
On the routing instance of VN1, the routes 0.0.0.0/0 and 10.204.218.0/24 should have the next hop
pointing to the MX gateway (10.204.216.253).
Example
Alternatively, from the agent introspect, you can view the next hops at the unicast route table.
First, use the following to get the unicast route table index (ucindex ) for the routing instance default-
domain:admin:public_vn:public_vn.
466
http://nodec10:8085/Snh_VrfListReq?x=default-domain:admin:public_vn:public_vn
Example
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.
http://nodec10:8085/Snh_Inet4UcRouteReq?x=2
467
A ping from the MX gateway to the virtual machine’s floating IP in the public routing-instance should
work.
Advanced Troubleshooting
If you still have reachability problems after performing all of the tests in this article, for example, a ping
between the virtual machine and the MX IP or to public addresses is failing, try the following:
• Validate that all the required Contrail processes are running by using the contrail-status command on
all of the nodes.
• On the compute node where the virtual machine is present (nodec10 in this example), perform a
tcpdump on the tap interface (tcpdump –ni tapcdca35ce-84). The output should show the incoming
packets from the virtual machine.
• Check to see if any packet drops occur in the kernel vrouter module:
http://nodec10:8085/Snh_KDropStatsReq?
In the output, scroll down to find any drops. Note: You can ignore any ds_invalid_arp increments.
• On the physical interface where packets transmit onto the compute-node, perform a tcpdump
matching the host IP of the MX to show the UDP and GRE encapsulated packets, as in the following.
<eth-port>
468
<name>p1p0p0</name>
</eth-port>
<metadata-proxy>
tcpdump: listening on p1p0p0, link-type EN10MB (Ethernet), capture size 65535 bytes
02:06:51.729941 IP (tos 0x0, ttl 64, id 57430, offset 0, flags [DF], proto GRE (47), length
112)
IP (tos 0x0, ttl 54, id 35986, offset 0, flags [none], proto ICMP (1), length 84)
172.29.227.6 > 10.204.219.37: ICMP echo request, id 53240, seq 242, length 64
02:06:51.730052 IP (tos 0x0, ttl 64, id 324, offset 0, flags [none], proto GRE (47), length
112)
IP (tos 0x0, ttl 64, id 33909, offset 0, flags [none], proto ICMP (1), length 84)
10.204.219.37 > 172.29.227.6: ICMP echo reply, id 53240, seq 242, length 64
02:06:52.732283 IP (tos 0x0, ttl 64, id 12675, offset 0, flags [DF], proto GRE (47), length
112)
IP (tos 0x0, ttl 54, id 54155, offset 0, flags [none], proto ICMP (1), length 84)
172.29.227.6 > 10.204.219.37: ICMP echo request, id 53240, seq 243, length 64
02:06:52.732355 IP (tos 0x0, ttl 64, id 325, offset 0, flags [none], proto GRE (47), length
112)
IP (tos 0x0, ttl 64, id 33910, offset 0, flags [none], proto ICMP (1), length 84)
10.204.219.37 > 172.29.227.6: ICMP echo reply, id 53240, seq 243, length 64
^C
4 packets captured
[root@nodec10 ~]#
• On the MX gateway, use the following to inspect the GRE tunnel rx/tx (received/transmitted) packet
count:
IN THIS SECTION
This topic gives examples for removing stale VMs (virtual machines) and VMIs (virtual machine
interfaces). Before you can remove a stale VM or VMI, you must first remove any back references
associated to the VM or VMI.
Problem Example
The troubleshooting examples in this topic are based on the following problem example. A net-delete of
the virtual machine 2a8120ec-bd18-49f4-aca0-acfc6e8fe74f returned the following messages that
there are two VMIs that still have back-references to the stale VM.
The two VMIs must be deleted first, then the Neutron net-delete <vm_ID> command will complete without
errors.
From neutron.log:
2014-03-10 14:18:05.208
DEBUG [urllib3.connectionpool]
471
2014-03-10 14:18:05.278
84, in resource
432, in delete
File
"/usr/lib/python2.7/dist-packages/neutron/plugins/juniper/contrail/contrail
raise e
http: //127.0.0.1:8082/virtual-machine-interface/51daf6f4-7366-4463-a819-bd1
17fe3a8c8,
http: //127.0.0.1:8082/virtual-machine-interface/30882e66-e175-4fbb-862e-354
http://<config-node-IP>:8082/virtual-machines
Example
virtual-machines:
href:"http: //example-node:8082/virtual-machine/
03443891-99cc-4784-89bb-9d1e045f8aa6",
fq_name:
"03443891-99cc-4784-89bb-9d1e045f8aa6"
],
uuid:"03443891-99cc-4784-89bb-9d1e045f8aa6"
},
When the user attempts to delete the stale VM, a message displays that children to the VM still exist:
However, when the user attempts to delete the VMI from the stale VM, they get a message that there is
still a back-reference:
root@example-node:~#
Because there is a back-reference from an instance-ip object still present, the instance-ip object must first
be deleted, as follows:
root@example-node:~#
When the instance-ip is deleted, then the VMI and the VM can be deleted.
NOTE: To prevent inconsistency, be certain that the VM is not present in the Nova database
before deleting the VM.
Delete Methods
IN THIS SECTION
Use the troubleshooting steps and guidelines in this topic when you have errors with Contrail link-local
services.
A link-local address and a service port is chosen for the specific service running on a TCP / UDP port on
a server in the fabric. With the link-local service configured, virtual machines can access the service
using the link-local address. For link-local services, Contrail uses the address range 169.254.169.x.
Link-local service can be configured using the Contrail WebUI: Configure > Infrastructure > Link Local
Services.
1. Verify the reachability of the fabric server that is hosting the link-local service from the compute
node.
2. Check the state of the virtual machine and the interface:
http://<compute-node-ip>:8085/Snh_ItfReq?name=
3. Check the link-local configuration in the vrouter agent. Make sure the configured link-local service is
displayed.
http://<compute-node-ip>:8085/Snh_LinkLocalServiceInfo?
4. Validate the BGP neighbor config and the BGP peering config object. When the virtual machine
communicates with the configured link-local service, a forward and reverse flow for the
communication is set up. Check that the flow for this communication is created and the flow action is
NAT.
http://<compute-node-ip>:8085/Snh_KFlowReq?flow_idx=
Check that all flow entries display NAT action programmed and display flags for the fields (source or
destination IP and ports) that have NAT programmed. Also shown are the number of packets and
bytes transmitted in the respective flows.
476
The forward flow displays the source IP of the virtual machine and the destination IP of the link-local
service. The reverse flow displays the source IP of the fabric host and the destination IP of the
compute node’s vhost interface. If the service is hosted on the same compute node, the destination
address of the reverse flow displays the metadata address allocated to the virtual machine.
Note that the index and rflow index for the two flows are reversed.
You can also view similar information in the vrouter agent introspect page, where you can see the
policy and security group for the flow. Check that the flow actions display as pass.
http://<compute-node-ip>:8085/Snh_FetchAllFlowRecords?
Metadata Service
OpenStack allows virtual instances to access metadata by sending an HTTP request to the link-local
address 169.254.169.254. The metadata request from the instance is proxied to Nova, with additional
HTTP header fields added, which Nova uses to identify the source instance. Then Nova responds with
appropriate metadata.
The Contrail vrouter acts as the proxy, trapping the metadata requests, adding the necessary header
fields, and sending the requests to the Nova API server.
However, for metadata service, the flow is always set up to the compute node, so the vrouter agent will
update and proxy the HTTP request. The vrouter agent listens on a local port to receive the metadata
requests. Consequently, the reverse flow has the compute node as the source IP, the local port on which
the agent is listening is the source port, and the instance’s metadata IP is the destination IP address.
After performing all of the troubleshooting procedures for link-local services, the following additional
steps can be used to further troubleshoot metadata service.
1. Check the metadata statistics for: the number of metadata requests received by the vrouter agent,
the number of proxy sessions set up with the Nova API server, and number of internal errors
encountered.
http://<compute-node-ip>:8085/Snh_MetadataInfo?
The port on which the vrouter agent listens for metadata requests is also displayed.
477
2. Check the metadata trace messages, which show the trail of metadata requests and responses.
http://<compute-node-ip>:8085/Snh_SandeshTraceRequest?x=Metadata
3. Check the Nova configuration. On the server running the OpenStack service, inspect the nova.conf
file.
service_neutron_metadata_proxy = True
neutron_metadata_proxy_shared_secret
If the shared secret is set in nova.conf, the same secret must be configured on each compute node
in the file /etc/contrail/contrail-vrouter-agent.conf, and the same shared secret must be updated in
the METADATA section as metadata_proxy_secret=<secret>.
4. Restart the vrouter agent after modifying the shared secret:
service contrail-vrouter restart
2 PART
CHAPTER 8
Contrail Commands
IN THIS CHAPTER
IN THIS SECTION
Overview | 479
Overview
This topic describes how to view the status of a Contrail node on a physical server. Contrail nodes
include config, control, analytics, compute, and so on.
480
struct NodeStatus {
// Sent by process
1: NodeStatus data
ProcessStatus
ProcessInfo
ProcessStatus
481
Also process_status, is sent by the processes corresponding to the virtual node, and displays the status
of the process and an aggregate state indicating if the process is functional or non-functional. The
process_status includes the state of the process connections (ConnectionInfo) to important services and
other information necessary for the process to be functional. Each process sends its NodeStatus
information, which is aggregated as union (aggtype="union") at the analytics node. The following is the
ProcessStatus structure:
1. struct ProcessStatus {
2. 1: string module_id
3. 2: string instance_id
4. 3: string state
7. }
8.
9. struct ConnectionInfo {
15. }
ProcessInfo
482
Sent by the node manager, /usr/bin/contrail-nodemgr. Node manager is a monitor process per contrail
virtual node that tracks the running state of the processes. The following is the ProcessInfo structure:
27. }
Example: NodeStatus
The following is an example output of NodeStatus obtained from the Rest API:
http://:8081/analytics/uves/control-...ilt=NodeStatus .
NodeStatus:
{
process_info:
[
483
process_name: "contrail-control",
process_state: "PROCESS_STATE_RUNNING",
last_stop_time: null,
start_count: 1,
core_file_list: [ ],
last_start_time: "1409002143776558",
stop_count: 0,
last_exit_time: null,
exit_count: 0
},
process_name: "contrail-control-nodemgr",
process_state: "PROCESS_STATE_RUNNING",
last_stop_time: null,
start_count: 1,
core_file_list: [ ],
last_start_time: "1409002141773481",
stop_count: 0,
last_exit_time: null,
exit_count: 0
484
},
process_name: "contrail-dns",
process_state: "PROCESS_STATE_RUNNING",
last_stop_time: null,
start_count: 1,
core_file_list: [ ],
last_start_time: "1409002145778383",
stop_count: 0,
last_exit_time: null,
exit_count: 0
},
process_name: "contrail-named",
process_state: "PROCESS_STATE_RUNNING",
last_stop_time: null,
start_count: 1,
core_file_list: [ ],
last_start_time: "1409002147780118",
stop_count: 0,
last_exit_time: null,
485
exit_count: 0
],
process_status:
[
instance_id: "0",
module_id: "ControlNode",
state: "Functional",
description: null,
connection_infos:
[
server_addrs:
[
"10.84.13.45:8443"
],
server_addrs:
[
"10.84.13.45:8086"
],
486
status: "Up",
type: "Collector",
name: null,
description: "Established"
},
server_addrs:
[
"10.84.13.45:5998"
],
status: "Up",
type: "Discovery",
name: "Collector",
description: "SubscribeResponse"
},
server_addrs:
[
"10.84.13.45:5998"
],
status: "Up",
487
type: "Discovery",
name: "IfmapServer",
description: "SubscribeResponse"
},
server_addrs:
[
"10.84.13.45:5998"
],
status: "Up",
type: "Discovery",
name: "xmpp-server",
The following is an example of the process state of contrail-control that is obtained by using
http://server-ip:8083/Snh_SandeshUVECacheReq?x=NodeStatus
NOTE: The example output is the ProcessStatus of only one process of contrail-control. It does
not show the full aggregated status of the control node through its UVE (as in the previous
example).
contrail-status script
The contrail-status script is used to give the status of the Contrail processes on a server.
The contrail-status script first checks if a process is running, and if it is, performs introspect into the
process to get its functionality status, then outputs the aggregate status.
• active - the process is running and functional; the internal state is good
• failed – the process exited too quickly and has not restarted
• initializing - the process is running, but the internal state is not yet functional.
root@a6s45:~# contrail-status
== Contrail vRouter ==
supervisor-vrouter: active
contrail-vrouter-agent active
contrail-vrouter-nodemgr active
== Contrail Control ==
supervisor-control: active
contrail-control active
contrail-control-nodemgr active
contrail-dns active
490
contrail-named active
== Contrail Analytics ==
supervisor-analytics: active
contrail-analytics-api active
contrail-analytics-nodemgr active
contrail-collector active
contrail-query-engine active
== Contrail Config ==
supervisor-config: active
contrail-api:0 active
contrail-config-nodemgr active
contrail-schema active
contrail-svc-monitor active
rabbitmq-server active
== Contrail Web UI ==
supervisor-webui: active
contrail-webui active
contrail-webui-middleware active
491
redis-webui active
== Contrail Database ==
supervisord-contrail-database:active
contrail-database active
contrail-database-nodemgr active
IN THIS SECTION
A command-line utility, contrail-logs, uses REST APIs to retrieve system log messages, object log
messages, and trace messages.
The command-line utility for accessing log file information is contrail-logs in the analytics node. The
following are the options supported at the command line for contrail-logs, as viewed using the -–help
option.
[--start-time START_TIME]
[--end-time END_TIME]
[--last LAST]
[--source SOURCE]
[--module {ControlNode, VRouterAgent, ApiServer, Schema, OpServer,
Collector, QueryEngine, ServiceMonitor, DnsAgent}]
[--category CATEGORY]
[--level LEVEL]
[--message-type MESSAGE_TYPE]
[--reverse]
[--verbose]
[--all]
[--object {ObjectVNTable, ObjectVMTable, ObjectSITable, ObjectVRouter,
ObjectBgpPeer, ObjectRoutingInstance, ObjectBgpRouter, ObjectXmppConnection,
ObjectCollectorInfo, ObjectGeneratorInfo, ObjectConfigNode}]
[--object-id OBJECT_ID]
[--object-select-field {ObjectLog,SystemLog}]
[--trace TRACE]
Option Descriptions
The following are the descriptions for each of the option arguments available for contrail-logs.
optional arguments:
-h, --help
show this help message and exit
--opserver-ip OPSERVER_IP
IP address of OpServer (default: 127.0.0.1)
--opserver-port OPSERVER_PORT
Port of OpServer (default: 8081)
--start-time START_TIME
Logs start time (format now-10m, now-1h) (default: now-10m)
--end-time END_TIME
Logs end time (default: now)
--last LAST
Logs from last time period (format 10m, 1d) (default: None)
--source SOURCE
Logs from source address (default: None)
--module {ControlNode, VRouterAgent, ApiServer, Schema, OpServer, Collector, QueryEngine,
ServiceMonitor, DnsAgent}
493
Example Uses
The following examples show how you can use the option arguments available for contrail-logs to
retrieve the information you specify.
1. View only the system log messages from all boxes for the last 10 minutes.
contrail-logs
2. View all log messages (systemlog, objectlog, uve, ...) from all boxes for the last 10 minutes.
contrail-logs --all
3. View only the control node system log messagess from all boxes for the last 10 minutes.
--module accepts the following values - ControlNode, VRouterAgent, ApiServer, Schema, ServiceMonitor,
Collector, OpServer, QueryEngine, DnsAgent
494
4. View the control node system log messages from source a6s23.contrail.juniper.net for the last 10
minutes.
5. View the XMPP category system log messages from all modules on all boxes for the last 10 minutes.
6. View the system log messages from all the boxes from the last hour.
contrail-logs --last 1h
7. View the system log messages from the VN object named demo:admin:vn1 from all boxes for the last 10
minutes.
8. View the system log messages from all boxes for the last 10 minutes in reverse chronological order:
contrail-logs --reverse
9. View the system log messages from a specific time interval and display them in a specified date
format.
IN THIS SECTION
Syntax | 495
Description | 495
Syntax
Description
Display a list of all components of a Contrail server node (such as control, configuration, database, Web-
UI, analytics, or vrouter) and report their current status of active or inactive.
admin
Sample Output
The following example usage displays on a server that is configured for the roles of vrouter, controller,
analytics, configuration, web-ui, and database.
Sample Output
root@host:~# contrail-status
== Contrail vRouter ==
supervisor-vrouter: active
contrail-vrouter-agent active
contrail-vrouter-nodemgr active
== Contrail Control ==
supervisor-control: active
contrail-control active
contrail-control-nodemgr active
contrail-dns active
contrail-named active
== Contrail Analytics ==
supervisor-analytics: active
contrail-analytics-api active
contrail-analytics-nodemgr active
contrail-collector active
contrail-query-engine active
496
== Contrail Config ==
supervisor-config: active
contrail-api:0 active
contrail-config-nodemgr active
contrail-discovery:0 active
contrail-schema active
contrail-svc-monitor active
ifmap active
rabbitmq-server active
== Contrail Web UI ==
supervisor-webui: active
contrail-webui active
contrail-webui-middleware active
redis-webui active
== Contrail Database ==
supervisord-contrail-database:active
contrail-database active
contrail-database-nodemgr active
Release Information
IN THIS SECTION
Syntax | 497
Description | 497
Syntax
[root@host]# contrail-version
Description
Display a list of all installed components with their version and build numbers.
admin
Sample Output
The following example shows version and build information for all installed components.
Sample Output
root@host> contrail-version
Package Version Build-ID | Repo | RPM Name
-------------------------------------- ----------------------- ----------------------------------
contrail-analytics 1-1309090026.el6 141
contrail-analytics-venv 0.1-1309062310.el6 141
contrail-api 0.1-1309090026.el6 141
contrail-api-lib 0.1-1309090026.el6 141
contrail-api-venv 0.1-1309080539.el6 141
contrail-control 2012.0-1309090026.el6 141
contrail-database 0.1-1309050028 141
contrail-dns 1-1309090026.el6 141
contrail-fabric-utils 1-1309090026 141
contrail-libs 1-1309090026.el6 141
contrail-nodejs 0.8.15-1309090026.el6 141
contrail-openstack-analytics 0.1-1309090026.el6 141
contrail-openstack-cfgm 0.1-1309090026.el6 141
contrail-openstack-control 0.1-1309090026.el6 141
498
Sample Output
The following example shows version and build information for only the installed contrail components.
Sample Output
Release Information
CHAPTER 9
IN THIS CHAPTER
Contrail Analytics Application Programming Interfaces (APIs) and User-Visible Entities (UVEs) | 499
IN THIS SECTION
The Contrail analytics-api server provides a REST API interface to extract the operational state of the
Contrail system.
APIs are used by the Contrail Web user interface to present the operational state to users. Other
applications might also use the server's REST APIs for analytics or other uses.
500
This section describes some of the more common APIs and their uses. To see all of the available APIs,
navigate the URL tree at the REST interface, starting at the root http://<ip>:<analytics-api-port>. You
can also view the Contrail Networking API Reference Guide.
User-Visible Entities
In Contrail, a User-Visible Entity (UVE) is an object entity that might span multiple components in
Contrail and might require aggregation before the complete information of the UVE is presented.
Examples of UVEs in Contrail are virtual network, virtual machine, vRouter, and similar objects.
Complete operational information for a virtual network might span multiple vRouters, config nodes,
control nodes, and the like. The analytics-api server aggregates all of this information through REST
APIs.
To get information about a UVE, you must have the UVE type and the UVE key. In Contrail, UVEs are
identified by type, such as virtual network, virtual machine, vRouter, and so on. A system-wide unique
key is associated with each UVE. The key type could be different, based on the UVE type. For example,
perhaps a virtual network uses its name as its UVE key, and in the same system, a virtual machine uses
its UUID as its key.
The URL /analytics/uves shows the list of all UVE types available in the system.
[
{
href: "http://<system IP>:8081/analytics/uves/xmpp-peers",
name: "xmpp-peers"
},
{
href: "http://<system IP>:8081/analytics/uves/service-instances",
name: "service-instances"
},
{
href: "http://<system IP>:8081/analytics/uves/config-nodes",
name: "config-nodes"
},
{
href: "http://<system IP>:8081/analytics/uves/virtual-machines",
name: "virtual-machines"
},
{
href: "http://<system IP>:8081/analytics/uves/bgp-routers",
name: "bgp-routers"
},
501
{
href: "http://<system IP>:8081/analytics/uves/collectors",
name: "collectors"
},
{
href: "http://<system IP>:8081/analytics/uves/service-chains",
name: "service-chains"
},
{
href: "http://<system IP>:8081/analytics/uves/generators",
name: "generators"
},
{
href: "http://<system IP>:8081/analytics/uves/bgp-peers",
name: "bgp-peers"
},
{
href: "http://<system IP>:8081/analytics/uves/virtual-networks",
name: "virtual-networks"
},
{
href: "http://<system IP>:8081/analytics/uves/vrouters",
name: "vrouters"
},
{
href: "http://<system IP>:8081/analytics/uves/dns-nodes",
name: "dns-nodes"
}
]
• list of access control lists (ACLs) associated with this virtual network
502
The REST API to get a UVE for a specific virtual network is through HTTP GET, using the URL:
/analytics/uves/virtual-network/<key>
The REST API to get UVEs for all virtual machines is through HTTP GET, using the URL:
/analytics/uves/virtual-networks
The REST API to get a UVE for a specific virtual machine is through HTTP GET, using the URL:
/analytics/uves/virtual-machine/<key>
The REST API to get UVEs for all virtual machines is through HTTP GET, using the URL:
/analytics/uves/virtual-machines
vRouter UVE
This UVE provides information associated with a vRouter, such as:
The REST API to get a UVE for a specific vRouter is through HTTP GET, using the URL:
/analytics/uves/vrouter/<key>
The REST API to get UVEs for all virtual machines is through HTTP GET, using the URL:
/analytics/uves/vrouters
503
There is a UVE for each node type. The common information associated with each node UVE includes:
• the control node UVE has information about its connectivity to the vRouter and other control nodes
• the analytics node UVE has information about the number of generators connected
The REST API to get a UVE for a specific config node is through HTTP GET, using the URL:
/analytics/uves/config-node/<key>
The REST API to get UVEs for all config nodes is through HTTP GET, using the URL:
/analytics/uves/config-nodes
NOTE: Use similar syntax to get UVES for each of the different types of nodes, substituting the
node type that you want in place of config-node.
The following HTTP GET with wildcard retrieves all virtual network UVEs:
/analytics/uves/virtual-network/*
The following HTTP GET with wildcard retrieves all virtual network UVEs with name starting with
project1:
/analytics/uves/virtual-network/project1*
3. cfilt : filter by content, useful when only part of a UVE needs to be retrieved
4. kfilt : filter by UVE keys, useful to get multiple, but not all, UVEs of a particular type
Examples
The following HTTP GET with filter retrieves information about virtual network vn1 as provided by the
source src1:
/analytics/uves/virtual-network/vn1?sfilt=src1
The following HTTP GET with filter retrieves information about virtual network vn1 as provided by all
ApiServer modules:
/analytics/uves/virtual-network/vn1?mfilt=ApiServer
"@type": "i64"
},
"in_stats": {
"@aggtype": "append",
"@type": "list",
"list": {
"@size": "3",
"@type": "struct",
"UveInterVnStats": [
{
"bytes": {
"#text": "2114516371",
"@type": "i64"
},
"other_vn": {
"#text": "default-domain:demo:back-end",
"@aggtype": "listkey",
"@type": "string"
},
"tpkts": {
"#text": "5122001",
"@type": "i64"
}
},
{
"bytes": {
"#text": "1152123",
"@type": "i64"
},
"other_vn": {
"#text": "__FABRIC__",
"@aggtype": "listkey",
"@type": "string"
},
"tpkts": {
"#text": "11323",
"@type": "i64"
}
},
{
"bytes": {
"#text": "8192",
"@type": "i64"
506
},
"other_vn": {
"#text": "default-domain:demo:front-end",
"@aggtype": "listkey",
"@type": "string"
},
"tpkts": {
"#text": "50",
"@type": "i64"
}
}
]
}
},
"in_tpkts": {
"#text": "5156342",
"@aggtype": "counter",
"@type": "i64"
},
"interface_list": {
"@aggtype": "union",
"@type": "list",
"list": {
"@size": "1",
"@type": "string",
"element": [
"tap2158f77c-ec"
]
}
},
"out_bytes": {
"#text": "2187615961",
"@aggtype": "counter",
"@type": "i64"
},
"out_stats": {
"@aggtype": "append",
"@type": "list",
"list": {
"@size": "4",
"@type": "struct",
"UveInterVnStats": [
{
507
"bytes": {
"#text": "2159083215",
"@type": "i64"
},
"other_vn": {
"#text": "default-domain:demo:back-end",
"@aggtype": "listkey",
"@type": "string"
},
"tpkts": {
"#text": "5143693",
"@type": "i64"
}
},
{
"bytes": {
"#text": "1603041",
"@type": "i64"
},
"other_vn": {
"#text": "__FABRIC__",
"@aggtype": "listkey",
"@type": "string"
},
"tpkts": {
"#text": "9595",
"@type": "i64"
}
},
{
"bytes": {
"#text": "24608",
"@type": "i64"
},
"other_vn": {
"#text": "__UNKNOWN__",
"@aggtype": "listkey",
"@type": "string"
},
"tpkts": {
"#text": "408",
"@type": "i64"
}
508
},
{
"bytes": {
"#text": "8192",
"@type": "i64"
},
"other_vn": {
"#text": "default-domain:demo:front-end",
"@aggtype": "listkey",
"@type": "string"
},
"tpkts": {
"#text": "50",
"@type": "i64"
}
}
]
}
},
"out_tpkts": {
"#text": "5134830",
"@aggtype": "counter",
"@type": "i64"
},
"virtualmachine_list": {
"@aggtype": "union",
"@type": "list",
"list": {
"@size": "1",
"@type": "string",
"element": [
"dd09f8c3-32a8-456f-b8cc-fab15189f50f"
]
} }
},
"UveVirtualNetworkConfig": {
"connected_networks": {
"@aggtype": "union",
"@type": "list",
"list": {
"@size": "1",
"@type": "string",
"element": [
509
"default-domain:demo:back-end"
]
}
},
"routing_instance_list": {
"@aggtype": "union",
"@type": "list",
"list": {
"@size": "1",
"@type": "string",
"element": [
"front-end"
]
}
},
"total_acl_rules": [
[
{
"#text": "3",
"@type": "i32"
},
":",
"a3s14:Schema"
]
]
}
}
"@type": "list",
"list": {
"@size": "1",
"@type": "struct",
"VmInterfaceAgent": [
{
"in_bytes": {
"#text": "2188895907",
"@aggtype": "counter",
"@type": "i64"
},
"in_pkts": {
"#text": "5130901",
"@aggtype": "counter",
"@type": "i64"
},
"ip_address": {
"#text": "192.168.2.253",
"@type": "string"
},
"name": {
"#text": "f38eb47e-63d2-4b39-80de-8fe68e6af1e4:ccb085a0-
c994-4034-be0f-6fd5ad08ce83",
"@type": "string"
},
"out_bytes": {
"#text": "2201821626",
"@aggtype": "counter",
"@type": "i64"
},
"out_pkts": {
"#text": "5153526",
"@aggtype": "counter",
"@type": "i64"
},
"virtual_network": {
"#text": "default-domain:demo:back-end",
"@aggtype": "listkey",
"@type": "string"
}
}
]
}
511
},
"a3s19:VRouterAgent"
]
]
}
}
[
{
"@type": "list",
"list": {
"@size": "1",
"@type": "string",
"element": [
"tap2158f77c-ec"
]
}
},
"a3s18:VRouterAgent"
]
],
"virtual_machine_list": [
[
{
"@type": "list",
"list": {
"@size": "1",
"@type": "string",
"element": [
"dd09f8c3-32a8-456f-b8cc-fab15189f50f"
]
}
},
"a3s18:VRouterAgent"
]
],
"xmpp_peer_list": [
[
{
"@type": "list",
"list": {
"@size": "2",
"@type": "string",
"element": [
"10.xx.17.2",
"10.xx.17.3"
]
}
},
"a3s18:VRouterAgent"
513
]
]
}
}
RELATED DOCUMENTATION
IN THIS SECTION
In Contrail, log and flow analytics information is collected and stored using a horizontally scalable
Contrail collector and NoSQL database. The analytics-api server provides REST APIs to extract this
information using queries. The queries use well-known SQL syntax, hiding the underlying complexity of
the NoSQL tables.
/analytics/tables -- lists the SQL-type tables available for querying, including the hrefs for each of the
tables
514
/analytics/table/<table> -- lists the APIs available to get information for a given table
2. FROM table1
4. FILTER BY ...
5. SORT BY ...
6. LIMIT n
Additionally, it is mandatory to include the start time and the end time for the data range to define the
time period for the query data. The parameters of the query are passed through POST data, using the
following fields:
The POST data is in JSON format, stored in an idl file. A sample file is displayed in the following.
/*
* Copyright (c) 2013 Juniper Networks, Inc. All rights reserved.
*/
515
/*
* query_rest.idl
*
* IDL definitions for query engine REST API
*
* PLEASE NOTE: After updating this file, do update json_parse.h
*
*/
enum match_op {
EQUAL = 1,
NOT_EQUAL = 2,
IN_RANGE = 3,
NOT_IN_RANGE = 4, // not supported currently
// following are only for numerical column fields
LEQ = 5, // column value is less than or equal to filter value
GEQ = 6, // column value is greater than or equal to filter value
PREFIX = 7, // column value has the "value" field as prefix
REGEX_MATCH = 8 // for filters only
}
enum sort_op {
ASCENDING = 1,
DESCENDING = 2,
}
struct match {
1: string name;
2: string value;
3: match_op op;
4: optional string value2; // this is for only RANGE match
}
enum flow_dir_t {
EGRESS = 0,
INGRESS = 1
}
struct query {
1: string table; // Table to query (FlowSeriesTable, MessageTable, ObjectVNTable,
ObjectVMTable, FlowRecordTable)
2: i64 start_time; // Microseconds in UTC since Epoch
516
struct flow_series_result_entry {
1: optional i64 T; // Timestamp of the flow record
2: optional string sourcevn;
3: optional string sourceip;
4: optional string destvn;
5: optional string destip;
6: optional i32 protocol;
7: optional i32 sport;
8: optional i32 dport;
9: optional flow_dir_t direction_ing;
10: optional i64 packets; // mutually exclusive to 12,13
11: optional i64 bytes; // mutually exclusive to 12,13
12: optional i64 sum_packets; // represented as "sum(packets)" in JSON
13: optional i64 sum_bytes; // represented as "sum(bytes)" in JSON
};
typedef list<flow_series_result_entry> flow_series_result;
Query Types
The analytics-api supports two types of queries. Both types use the same POST parameters as described
in POST API.
• sync — Default query mode. The results are sent inline with the query processing.
• async — To execute a query in async mode. The result is "202 Accepted." This status code indicates
the request has been accepted for processing but the processing has not been completed.
For an asynchronous query, the analytics-api responds with the code: 202 Accepted. The response contents
are a status entity href URL of the form: /analytics/query/<QueryID>. The QueryID is assigned by the
analytics-api. To view the response contents, poll the status entity by performing a GET action on the
URL. The status entity has a variable named progress, with a number between 0 and 100, representing
517
the approximate percentage completion of the query. When progress is 100, the query processing is
complete.
The status entity has an element named chunks that lists portions (chunks) of query results. Each element
of this list has three fields: start_time, end_time, href. The analytics-api determines how many chunks to
list to represent the query data. A chunk can include an empty string ("") to indicate that the data query
is not yet available. If a partial result is available, the chunk href is of the form: /analytics/query/<QueryID>/
chunk-partial/<chunk number>. When the final result of a chunk is available, the href is of the form: /
analytics/query/<QueryID>/chunk-final/<chunk number>.
"name": "ObjectRoutingInstance"
},
{
"href": "http://127.0.0.1:8081/analytics/table/ObjectXmppConnection",
"name": "ObjectXmppConnection"
},
{
"href": "http://127.0.0.1:8081/analytics/table/FlowRecordTable",
"name": "FlowRecordTable"
},
{
"href": "http://127.0.0.1:8081/analytics/table/FlowSeriesTable",
"name": "FlowSeriesTable"
}
]
The following example query lists details for the table named MessageTable.
The following example query lists the schema for the table named MessageTable.
{
"datatype": "int",
"index": "False",
"name": "MessageTS"
},
{
"datatype": "string",
"index": "True",
"name": "Source"
},
{
"datatype": "string",
"index": "True",
"name": "ModuleId"
},
{
"datatype": "string",
"index": "True",
"name": "Category"
},
{
"datatype": "int",
"index": "True",
"name": "Level"
},
{
"datatype": "int",
"index": "False",
"name": "Type"
},
{
"datatype": "string",
"index": "True",
"name": "Messagetype"
},
{
"datatype": "int",
"index": "False",
"name": "SequenceNum"
},
{
"datatype": "string",
"index": "False",
520
"name": "Context"
},
{
"datatype": "string",
"index": "False",
"name": "Xmlmessage"
}
],
"type": "LOG"
}
root@a6s45:~#
root@a6s45:~# curl -X POST --data @filename 127.0.0.1:8081/analytics/query --header "Content-
Type:application/json" | python -mjson.tool
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 9765 0 9297 100 468 9168 461 0:00:01 0:00:01 --:--:-- 9177
{
"value": [
{
"Category": null,
"InstanceId": "0",
"Level": 2147483647,
"MessageTS": 1428442589947392,
"Messagetype": "BGPRouterInfo",
"ModuleId": "contrail-control",
"NodeType": "Control",
"SequenceNum": 1302,
"Source": "a6s45",
"Type": 6,
"Xmlmessage": "<BGPRouterInfo type=""><data type=""><BgpRouterState><name type=""
>a6s45</name><cpu_info type=""><CpuLoadInfo><num_cpu type="">4</num_cpu
521
...
IN THIS SECTION
Incompatibilities | 525
OpenStack’s networking solution, Neutron, has representative elements for Contrail elements for
Network (VirtualNetwork), Port (VirtualMachineInterface), Subnet (IpamSubnets), and Security-Group.
The Neutron plugin translates the elements from one representation to another.
Data Structure
Although the actual data between Neutron and Contrail is similar, the listings of the elements differs
significantly. In the Contrail API, the networking elements list is a summary, containing only the UUID,
FQ name, and an href, however, in Neutron, all details of each resource are included in the list.
The Neutron plugin has an inefficient list retrieval operation, especially at scale, because it:
As a result, the API server spends most of the time in this type of GET operation just waiting for results
from the Cassandra database.
• An optional detail query parameter is added in the GET of collections so that the API server returns
details of all the resources in the list, instead of just a summary. This is accompanied by changes in
the Contrail API library so that a caller gets returned a list of the objects.
• The existing Contrail list API takes in an optional parent_id query parameter to return information
about the resource anchored by the parent.
• The Contrail API server reads objects from Cassandra in a multiget format into obj_uuid_cf, where
object contents are stored, instead of reading in an xget/get format. This reduces the number of
round-trips to and from the Cassandra database.
• Set the router:external attribute, when the plugin supports an external_net extension.
When a network has the shared attribute set, users in other tenants or projects, including non-admin
users, can access that network, using:
Users can also launch a virtual machine directly on that network, using:
When a network has the router:external attribute set, users in other tenants or projects, including non-
admin users, can use that network for allocating floating IPs, using:
NOTE: The VN hosting the FIP pool should be marked shared and external.
Action Command
Create a network that has the shared attribute. neutron net-create <net-name> –shared
Set the shared attribute on an existing network. neutron net-update <net-name> -shared
Create a network that has the router:externalattribute. neutron net-create <net-name> -router:external
Set the router:external attribute on an existing network. neutron net-update <net-name> -router:external
Contrail provides the following features to increase support for OpenStack Neutron:
For more information about using OpenStack Networking API v2.0 (Neutron), refer to: http://
docs.openstack.org/api/openstack-network/2.0/content/ and the OpenStack Neutron Wiki at: http://
wiki.openstack.org/wiki/Neutron.
• Network
• Subnet
• Port
• Security group
• Per-tenant quota
• Network IPAM
• Network policy
• Floating IP pools
The plugin does not implement native bulk, pagination, or sort operations and relies on emulation
provided by the Neutron common code.
DHCP Options
In Neutron commands, DHCP options can be configured using extra-dhcp-options in port-create.
Example
The opt_name and opt_value pairs that can be used are maintained in GitHub: https://github.com/
Juniper/contrail-controller/wiki/Extra-DHCP-Options .
525
Incompatibilities
In the Contrail architecture, the following are known incompatibilities with the Neutron API.
• Filtering based on any arbitrary key in the resource is not supported. The only supported filtering is
by id, name, and tenant_id.
• To use a floating IP, it is not necessary to connect the public subnet and the private subnet to a
Neutron router. Marking a public network with router:external is sufficient for a floating IP to be
created and associated, and packet forwarding to it will work.
• The default values for quotas are sourced from /etc/contrail/contrail-api.conf and not from /etc/
neutron/neutron.conf.
IN THIS SECTION
Contrail enhances its use of EC2 APIs to support the Amazon VPC APIs.
The Amazon VPC supports networking constructs such as: subnets, DHCP options, elastic IP addresses,
network ACLs, security groups, and route tables. The Amazon VPC APIs are now supported on the
Openstack Contrail distribution, so users of the Amazon EC2 APIs for their VPC can use the same
scripts to move to an Openstack Contrail solution.
Euca2ools are command-line tools for interacting with Amazon Web Services (AWS) and other AWS-
compatible web services, such as OpenStack. Euca2ools have been extended in OpenStack Contrail to
add support for the Amazon VPC, similar to the support that already exists for the Amazon EC2 CLI.
For more information about Amazon VPC and AWS EC2, see:
VPC Project
Elastic IP Floating IP
Table 81: Amazon VPC and OpenStack Contrail Feature Comparison (Continued)
In the following example, a VPC is created with a CIDR block of 10.1.0.0/16. A subnet is created within
the VPC CIDR block, with a CIDR block of 10.1.1.0/24. The VPC has a default network ACL named acl-
default.
All subnets created in the VPC are automatically associated to the default network ACL. This association
can be changed when a new network ACL is created. The last command in the list below creates a
virtual machine using the image ami-00000003 and launches with an interface in subnet-5eb34ed2.
# euca-create-vpc 10.1.0.0/16
VPC VPC:vpc-8352aa59 created
# euca-describe-vpcs
VpcId CidrBlock DhcpOptions
----- --------- -----------
vpc-8352aa59 10.1.0.0/16 None
# euca-describe-subnets
Subnet-id Vpc-id CidrBlock
--------- ------ ---------
subnet-5eb34ed2 vpc-8352aa59 10.1.1.0/24
# euca-describe-network-acls
AclId
-----
acl-default(def)
528
vpc-8352aa59
Rule Dir Action Proto Port Range Cidr
---- --- ------ ----- ---- ----- ----
100 ingress allow -1 0 65535 0.0.0.0/0
100 egress allow -1 0 65535 0.0.0.0/0
32767 ingress deny -1 0 65535 0.0.0.0/0
32767 egress deny -1 0 65535 0.0.0.0/0
The following euca2ools CLI commands are used to create, define, and delete VPCs and subnets:
• euca-create-vpc
• euca-delete-vpc
• euca-describe-vpcs
• euca-create-subnet
• euca-delete-subnet
• euca-describe-subnets
In the following example, a new ACL, acl-ba7158, is created and an existing subnet is associated to the
new ACL.
# euca-create-network-acl vpc-8352aa59
acl-ba7158c
# euca-describe-network-acls
AclId
529
-----
acl-default(def)
vpc-8352aa59
Rule Dir Action Proto Port Range Cidr
---- --- ------ ----- ---- ----- ----
100 ingress allow -1 0 65535 0.0.0.0/0
100 egress allow -1 0 65535 0.0.0.0/0
32767 ingress deny -1 0 65535 0.0.0.0/0
32767 egress deny -1 0 65535 0.0.0.0/0
# euca-describe-network-acls
AclId
-----
acl-default(def)
vpc-8352aa59
Rule Dir Action Proto Port Range Cidr
---- --- ------ ----- ---- ----- ----
100 ingress allow -1 0 65535 0.0.0.0/0
100 egress allow -1 0 65535 0.0.0.0/0
32767 ingress deny -1 0 65535 0.0.0.0/0
32767 egress deny -1 0 65535 0.0.0.0/0
AclId
-----
acl-ba7158c
vpc-8352aa59
Rule Dir Action Proto Port Range Cidr
---- --- ------ ----- ---- ----- ----
32767 ingress deny -1 0 65535 0.0.0.0/0
32767 egress deny -1 0 65535 0.0.0.0/0
The following euca2ools CLI commands are used to create, define, and delete VPCs and subnets:
• euca-create-network-acl
• euca-delete-network-acl
• euca-replace-network-acl-association
• euca-describe-network-acls
• euca-create-network-acl-entry
• euca-delete-network-acl-entry
• euca-replace-network-acl-entry
In the following example, a new security group is created. The rules can be added or removed for the
security group based on the commands listed for euca2ools. The last line launches a virtual machine using
the newly created security group.
# euca-describe-security-groups
531
# euca-describe-security-groups
The following euca2ools CLI commands are used to create, define, and delete security groups:
• euca-create-security-group
532
• euca-delete-security-group
• euca-describe-security-groups
• euca-authorize-security-group-egress
• euca-authorize-security-group-ingress
• euca-revoke-security-group-egress
• euca-revoke-security-group-ingress
In the following example, a floating IP is requested from the system and assigned to a particular virtual
machine. The prerequisite is that the provider or Contrail administrator has provisioned a network
named “public” and allocated a floating IP pool to it. This “public” floating IP pool is then internally used
by the tenants to request public IP addresses that they can use and attach to virtual machines.
The following euca2ools CLI commands are used to create, define, and delete elastic IPs:
• euca-allocate-address
• euca-release-address
533
• euca-describe-addresses
• euca-associate-address
• euca-disassociate-address
The following euca2ools CLI commands are used to create, define, and delete route tables:
• euca-create-route-table
• euca-delete-route-table
• euca-describe-route-tables
• euca-associate-route-table
• euca-disassociate-route-table
• euca-replace-route-table-association
• euca-create-route
• euca-delete-route
• euca-replace-route
Designating local next hop indicates that all subnets in the VPC are reachable for the destination
prefix.
This next hop is used for traffic destined to the Internet. All virtual machines using the Internet
gateway next hop are required to use an Elastic IP to reach the Internet, because the subnet IPs are
private IPs.
• NAT instance
To create this next hop, the user needs to launch a virtual machine that provides network address
translation (NAT) service. The virtual machine has two interfaces: one internal and one external, both
534
of which are automatically created. The only requirement here is that a “public” network should have
been provisioned by the admin, because the second interface of the virtual machine is created in the
“public” network.
The following euca2ools CLI commands are used to create, define, and delete Internet gateway next hop:
• euca-attach-internet-gateway
• euca-create-internet-gateway
• euca-delete-internet-gateway
• euca-describe-internet-gateways
• euca-detach-internet-gateway
The following euca2ools CLI commands are used to create, define, and delete NAT instance next hops:
• euca-run-instances
• euca-terminate-instances
# euca-describe-route-tables
RouteTableId Main VpcId AssociationId SubnetId
------------ ---- ----- ------------- --------
rtb-default yes vpc-8352aa59 rtbassoc-0c549d66 subnet-5eb34ed2
Prefix NextHop
------ -------
10.1.0.0/16 local
# euca-describe-images
IMAGE ami-00000003 None (ubuntu) 2c88a895fdea4461a81e9b2c35542130
IMAGE ami-00000005 None (nat-service) 2c88a895fdea4461a81e9b2c35542130
# euca-run-instances ami-00000005
# euca-describe-route-tables
RouteTableId Main VpcId AssociationId SubnetId
------------ ---- ----- ------------- --------
rtb-default yes vpc-8352aa59 rtbassoc-0c549d66 subnet-5eb34ed2
Prefix NextHop
------ -------
10.1.0.0/16 local
0.0.0.0/0 i-00000006