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.
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:
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_enabledExample 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
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]#