Using a Python script from a controller to configure a team

You can configure teaming using a Python script (conf_team.py) and a configuration file on any active controller you plan to include in the team. For details on the teaming requirements, see High Availability best practices. Alternately you can configure teaming remotely from your SDN Controller Toolkit VM using the teaming.yml playbook, see Using a playbook from the remote SDN Toolkit VM to configure multiple teams.

From a controller, the script allows the following teaming configuration actions: create a team, create regions within a team, add devices to a region, disband a team, delete regions within a team, remove devices from a region.

To use the script you must ssh to one of the controllers you plan to include in the team. For example, ssh sdn@1.1.1.1 (then enter the ssh password). You do not need to ssh to the other two controllers in the team.

The Python script conf_team.py is run from the controller you ssh into. You edit a configuration file on that same controller to define the inputs you want to use when running the script. The default configuration file is build_team.conf. The file is on the controller system at /opt/sdn/scripts/teaming/build_team.conf. (The /opt/sdn path may not be visible to the ssh user. The user must be part of the sdn group to see the directory structure). You can edit this file or you can create a custom configuration file with a different name but the same format and in the same directory.

For details on using the configuration file, see Defining inputs for teaming in a configuration file.

Once you have all the inputs you want to use for team configuration in the configuration file, you run the script. There is one script /opt/sdn/scripts/teaming/conf_team.py you can run to access all the team configuration actions.

To run the script:

  1. The command to run the script is:python conf_team.py [config file name] [-v]

    [config file name]. Default is build_team.conf. If you don’t specify a configuration file the script will use the build_team.conf file in the same directory as the script. If you have created a custom configuration file you enter that configuration file name.

    -v is optional. If you want to run the script in debug mode you add -v at the end of the command.

  2. At the prompt select one of the following:

    1) Create Team
    2) Create Regions
    3) Delete Team
    4). Delete Regions
    5). Add Device to Region
    6) Remove Device From Region
    X/x. Exit
  3. If prompted enter user and password. The three controllers must have the same user name and password.

  4. Check for messages or errors and respond to any prompts.

  5. Select X/x to exit the script.