Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

 

Running Generic Device Operations Commands In Contrail Command

 

Contrail Networking Release 5.1 and later enables you to obtain device information, such as interface information, like input rate or output rate, or search for the name of an interface by providing its MAC address or IP address from the Contrail Command UI. You can run a specific generic device operations command on multiple devices at a time. A job template is defined for each generic device operations command. After you select the devices and specify the parameters defined in the job template, a job is created depending on the generic command you selected. The result of the job is then displayed for the selected device or devices.

You can select a maximum of 20 devices at a time and run a generic device operations command to view information about those devices.

You can run the following generic device operations commands:

  • show interfaces—Use this generic device operations command to show a list of all runtime interfaces. You can use the filters to select the type of interface, such as physical or logical. You can also view particular types of interfaces using the regex filter.

  • show configured interfaces—Use this generic device operations command to list all the configured interfaces. You can use the filters to select the type of interface, such as physical or logical. You can also view particular types of interfaces using the regex filter..

  • show interfaces by names—Use this generic device operations command to check whether a particular type of interface is present in one or more of the devices selected. This operation is useful when you wan to check which among the selected devices has an xe-0/0/2 interface or an lo0.0 interface. You can use the filters to select the type of interface, such as physical or logical. You can then enter the interface name you want to search for.

  • search using MAC or IP address—Use this generic device operations command to identify the interface name if you know the IP address or the MAC address of an interface. This operation is useful to locate the interface by specifying the interface name and information such as name of the originating device and its loopback IP address.

You can create a custom generic device operations command by adding a job_template object type in the opt/contrail/fabric_ansible_playbooks/conf/predef_payloads.json file. Follow these best practices when you define a new generic device operations command.

  • Make sure that template_type is set to device_operation, which identifies this template as a generic device operation job template.

  • Create a new job_template for every generic device command you need to execute. Specify the command name in the job_template_name field so that it is easy to identify the command.

  • Make sure that the generic device operation job_templates references to the playbook /opt/contrail/fabric_ansible_playbooks/operational_command.yml.

  • Any change to the predef_payloads.json requires a restart of the config_api_1_xxxx docker.

To run a generic device operations command:

  1. Navigate to Infrastructure > Fabrics > fabric name.
  2. Select the fabric devices and click the Run a Custom Action button as shown in Figure 1.
    Figure 1: Select fabric Devices
    Select fabric Devices
  3. Click the operation that you want to perform and click Next.
    Figure 2: Choose an Operation
    Choose an Operation
  4. Click an operation. Details of the devices selected are displayed as shown in Figure 3.
    Figure 3: Devices Selected for the Operation
    Devices Selected for the Operation
  5. Click Next and select the filters.
    Figure 4: Select Filters
    Select Filters
  6. Click Execute.

    Information about the selected device is displayed as shown in Figure 5.

    Figure 5: Generic Device Operation Command Results
    Generic Device Operation Command Results
  7. Click Finish to complete the operation.