Description

This article discusses the re-creation of vHost0 and Virtual Router entry back into the config DB of Contrail in a case where it's deleted/missing.

We will take an example, where vHost0 and Virtual Router entry got deleted from the config DB of Contrail. 

  1. vHost0 and Virtual Router entry got deleted from the config DB of Contrail.
  2. It resulted in 2 alarms (1-Critical, 1-Major) being raised for that particular Compute in the Contrail GUI.
  3. At the same time, while checking the compute node. Compute seems stable with respect to vHost0, as well as Data plane appears to be not impacted. Verified as vHost Entry is present on compute and traffic flows through the interface.
  4. The only impact that is observed is the alarms for that particular compute.
Note: This KB is tested with versions 1908,1909.30 and 2011.L2

Symptoms

Two alarms are raised for the compute whose vHost and Vrouter entries were deleted in the WEBUI. Below are the two alarms and snapshot from the WebUI:

  1. Critical - Process(es) reporting as non-functional
  2. Major - Contrail Config missing or incorrect

    image.png
Note: No alarms will be raised if only the vHost entry is deleted. Both Alarms will appear when virtual-router and vHost are both deleted. Also, without deleting vHost you cannot delete virtual-router

 

Solution

To resolve the issue, log in to the "vRouter-Agent" container, then use the script "provision_vrouter.py" to recreate the vHost0 and Virtual router entries in the config-DB for that particular compute as follows:
 

  • Environment Without TLS Enabled

python /opt/contrail/utils/provision_vrouter.py --oper add --host_name <COMPUTE-HOSTNAME> --host_ip <COMPUTE-IP-ADD> --ip_fabric_subnet <COMPUTE-IP-ADD-SUBNET> --api_server_ip <CONTROLLER-IP-OR-HOSTNAME> --api_server_port 8082 --admin_user <ADMIN-USERNAME> --admin_password <ADMIN-PASSWORD> --dpdk_enabled

Example with Values:

python /opt/contrail/utils/provision_vrouter.py --oper add --host_name test-compute-hostname --host_ip 10.10.10.10 --ip_fabric_subnet 10.10.10.0/24 --api_server_ip 10.10.11.20 --api_server_port 8082 --admin_user admin --admin_password contrail123 --dpdk_enabled
 

  • Environment WithTLS Enabled

python /opt/contrail/utils/provision_vrouter.py --oper add --host_name <COMPUTE-HOSTNAME> --host_ip <COMPUTE-IP-ADD> --ip_fabric_subnet <COMPUTE-IP-ADD-SUBNET> --api_server_ip <CONTROLLER-IP-OR-HOSTNAME> --api_server_port 8082 --admin_user <ADMIN-USERNAME> --admin_password <ADMIN-PASSWORD> --dpdk_enabled --admin_tenant_name admin --admin_user admin --api_server_use_ssl True


Example with values:

python /opt/contrail/utils/provision_vrouter.py --oper add --host_name test-compute-hostname --host_ip 10.10.10.10 --ip_fabric_subnet 10.10.10.0/24 --api_server_ip 10.10.11.20 --api_server_port 8082 --admin_user admin --admin_password contrail123 --dpdk_enabled --admin_tenant_name admin --admin_user admin --api_server_use_ssl True"

After the above command is executed successfully, we observe both vHost0 and Virtual-router entries are successfully recreated, and both alarms are also cleared. 

Note that some of the above-used values can be fetched from the node as below:

1. Hostname and Host Ip can be fetched from the compute CLI as:

[root@test-compute-hostname]# hostname
test-compute-hostname
[root@test-compute-hostname]# vif --list
Vrouter Interface Table
vif0/1      OS: vhost0
            Type:Host HWaddr:40:a6:b7:0c:43:59 IPaddr:10.10.10.10
            Vrf:0 Mcast Vrf:65535 Flags:L3DEr QOS:-1 Ref:8
            RX packets:12240  bytes:678835 errors:0
            TX packets:87569  bytes:5202428 errors:0
            Drops:0


2. The rest of the IP details can be fetched from below:

[root@test-compute-hostname]# cat /etc/contrail/common_config.env 
.
.
CONTRAIL_VERSION=1908.47-ocata
KEYSTONE_AUTH_ADMIN_PASSWORD=admin123
CONTROLLER_NODES=10.85.32.45
KEYSTONE_AUTH_ADMIN_USER=admin
KEYSTONE_AUTH_ADMIN_TENANT=admin
.
.[root@test-compute-hostname]#

Modification History

2023-04-07: Initial publication