Verify route target references

Verify route target references

Updating OpenContrail from version 3.1.1 to version 3.2.3 can cause inconsistencies in the OpenContrail configuration database. These inconsistencies may cause connectivity issues from or to a VM, between VMs, and so on. Verifying route target references may help to resolve such issues.

To verify route target references:

  1. Log in to any Mirantis OpenContrail controller ntw node.

  2. Start contrail-api-cli. For details, see Use the OpenContrail API client.

  3. Run the following command using the OpenContrail controller node VIP. For example, 10.167.4.20:

    contrail-api-cli --host 10.167.4.20 --port 9100 shell
    
  4. Verify whether route-target exists in more than one project:

    10.167.4.21:/> cat route-target/* | jq  -c 'if(.routing_instance_back_refs[0]? ) \
    then if ([.routing_instance_back_refs[].to[1]] | unique | length)>1 \
    then [.display_name,[.routing_instance_back_refs[].to[1]]] | \
    unique else empty end else empty end'
    

    Example of system response:

    ["target:64512:8000001",["TestingTenant","admin"]]
    ["target:64512:8000002",["admin","demo-jdc"]]
    

    In the output, the list of suspected route-targets is displayed with names of referenced projects.

  5. Identify the UUID of the suspected route-target using its name. For example:

    10.167.4.21:/> ls route-target -l | grep target:64512:8000002
    

    Example of system response:

    route-target/8ed6241c-a1e7-4abf-85c0-3afc70a0b3f0  target:64512:8000002
    
  6. Verify the status of route-target using the UUID of the suspected route-target. For example:

    10.167.4.21:/> cat route-target/8ed6241c-a1e7-4abf-85c0-3afc70a0b3f0
    

    Example of system response:

    {
    "display_name": "target:64512:8000002",
    "fq_name": [
      "target:64512:8000002"
    ],
    ...
    },
    "routing_instance_back_refs": [
      {
        "attr": {
          "import_export": null
        },
        "href": "http://10.167.4.21:9100/routing-instance/cb6a97c8-aca9-4dd1-af00-84368c46d784",
        "to": [
          "default-domain",
          "admin",
          "admin-net2",
          "admin-net2"
        ],
        "uuid": "cb6a97c8-aca9-4dd1-af00-84368c46d784"
      },
      {
        "attr": {
          "import_export": null
        },
        "href": "http://10.167.4.21:9100/routing-instance/4db24ca5-7f10-42b8-b7dc-7c2d12a9d6a3",
        "to": [
          "TestDomain",
          "demo-jdc",
          "jdc-net03",
          "jdc-net03"
        ],
        "uuid": "4db24ca5-7f10-42b8-b7dc-7c2d12a9d6a3"
      }
    ],
    "uuid": "8ed6241c-a1e7-4abf-85c0-3afc70a0b3f0"
    }
    

    In the output above, the routing_instance_back_refs section contains the route-target with to back references to different routing instances in two different projects. If you know what back reference is incorrect, delete it as described below.

To delete a back reference:

Select from the following options:

  • Edit the corresponding JSON records directly.

  • Use the ln command:

    1. Exit from contrail-api-cli.

    2. Start contrail-api-cli with the --schema-version parameter. For more information, see Use the OpenContrail API client.

    3. Remove the back reference of route-target. For example:

      10.167.4.21:/> ln -r route-target/8ed6241c-a1e7-4abf-85c0-3afc70a0b3f0 \
       routing-instance/cb6a97c8-aca9-4dd1-af00-84368c46d784
      
    4. Verify route-target again using the procedure above.