Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

Navigation

Setting Up the Testbed Definitions File

Populate a testbed definitions file, /opt/contrail/utils/fabfile/testbeds/testbed.py, with parameters specific to your system, then run the fab commands as provided in Installing the Contrail Packages, Part Two (CentOS or Ubuntu) — Installing on the Remaining Machines to launch the role-based provisioning script tasks.

You can view example testbed files on any node in the controller at:

  • /opt/contrail/utils/fabfile/testbeds/testbed_multibox_example.py for a multiple server system
  • /opt/contrail/utils/fabfile/testbeds/test.py

Fabric is a Python library and command-line tool that lets you execute arbitrary Python functions via the command line. For a list of all available Fabric commands, refer to the/opt/contrail/utils/README.fabric file.

For more information about using Fabric commands, see the Fabric documentation at: http://docs.fabfile.org/en/1.12/index.html .

To define the following parameters within the testbed.py file:

  1. Provide host strings for the nodes in the cluster. Replace the addresses shown in the example with the actual IP addresses of the hosts in your system.

    host1 = 'root@1.1.1.1'

    host2 = 'root@1.1.1.2'

    host3 = 'root@1.1.1.3'

    host4 = 'root@1.1.1.4'

    host5 = 'root@1.1.1.5'

  2. Define external routers (MX Series routers and the like) to which the virtual network controller control nodes are peered.

    ext_routers = [('mx1', '1.1.1.253'), ('mx2', '1.1.1.252')]

    If there are no external routers, define

    ext_routers = []

  3. Provide the BGP autonomous system number.
    • router_asn = 64512

      Note: The default ASN 64512 is a private ASN number. A private ASN should be used if an AS is only required to communicate via BGP with a single provider. As the routing policy between the AS and the provider is not visible in the Internet, a private ASN can be used for this purpose. IANA has reserved AS 64512 through to AS 65535 to be used as private ASNs. If these circumstances do not apply, you cannot use the default or any other private ASN number.

  4. Define the host on which the Fabric tasks are invoked. Replace the address shown in the example with the actual IP address of the host in your system.

    host_build = 'host@10.10.10.10'

  5. Define which hosts operate with which roles.

    For multinode setups:

    env.roledefs = {
         'all': [host1, host2, host3, host4, host5],
         ‘database’: [host1, host2, host3], 
         'cfgm': [host1, host2],
         'control': [host1, host2],
         'compute': [host4, host5],
         'collector': [host1, host2, host3],
         'webui': [host1],
         'build': [host_build],
    }

    For single node all-in-one setups:

    env.roledefs = {
         'all': [host1],
         ‘database’: [host1], 
         'cfgm': [host1],
         'control': [host1],
         'compute': [host1],
         'collector': [host1],
         'webui': [host1],
         'build': [host_build],
    }
  6. Define password credentials for each of the hosts.
    env.passwords = { 
        host1: 'secret', 
        host2: 'secret', 
        host3: 'secret', 
        host4: 'secret', 
        host5: 'secret', 
    }

    Note: Set appropriate permissions for the testbed.py file because it contains host credentials.

Note: The following notes apply to different installation scenarios:

  • If you are installing to a CentOS system, to prevent accidental renaming of CentOS interfaces, uncomment the following env.interface_rename statement if it is present in the testbed.py:

    #To disable installing contrail interface rename package

    #env.interface_rename = False

    Uncomment the statement so that it reads:

    #To disable installing contrail interface rename package

    env.interface_rename = False

  • If your system servers and nodes have multiple interfaces, refer to Supporting Multiple Interfaces on Servers and Nodes for information about setting up the testbed.py file for your system.
  • To deploy a Contrail High Available cluster, refer to Juniper OpenStack High Availability for information about setting up the testbed.py file for your system.​
  • To deploy with an existing OpenStack, refer to Testbed Definitions File Settings for Deploying Contrail with an Existing OpenStack Node for testbed.py file definitions.

When you are finished, continue on to Installing the Contrail Packages, Part Two (CentOS or Ubuntu) — Installing on the Remaining Machines.

Modified: 2017-03-10