Defining inputs for teaming in a configuration file

The first step in configuring teaming using a Python script or Ansible playbook is to define the inputs for teaming in a configuration file.

The default configuration file is build_team.conf. The file is on the controller system at /opt/sdn/scripts/teaming/build_team.conf. The file is on the SDN Controller Toolkit VM at /home/sdn/scripts/ansible/build_team.conf. If you cannot access the /opt/sdn path, you need to enter sudo su first in order to see this directory path.

You can edit this file to provide the input for team configuration or you can create a custom configuration file with a different name but the same format and in the same directory.

You can create any number of configuration files. When using the Ansible playbook to remotely configure large numbers of teams you specify which configuration file to use for configuring each team.

The following is an example of a build_team.conf file.

#    build_team.conf

User=<sdn_controller_username>
Password=<sdn_controller_password>
Sleep_Time=20

Team_IP=##.##.##.###
IP1=##.##.##.###
IP2=##.##.##.###
IP3=##.##.##.###

Controller_IPs=$IP1,$IP2,$IP3
#Controller_IPs=##.##.##.###,##.##.##.###,##.##.##.###

Region1_Name=RED
#Region1_Prioritized_Controller_IPs=##.##.##.###,##.##.##.###,##.##.##.###
Region1_Prioritized_Controller_IPs=$IP1,$IP2,$IP3
Region1_Device_Ranges=##.##.##.##-##,##.##.##.##-##,##.##.##.#-#
Region1_Device_IPs=##.##.##.###

Region2_Name=BLUE
#Region2_Prioritized_Controller_IPs=##.##.##.###,##.##.##.###,##.##.##.###
Region2_Prioritized_Controller_IPs=$IP2,$IP3,$IP1
Region2_Device_Ranges=##.##.##.##-##,##.##.##.##-##,##.##.##.#-#
Region2_Device_IPs=##.##.##.##,##.##.##.###,##.##.##.#

Region3_Name=GREEN
#Region3_Prioritized_Controller_IPs=##.##.##.###,##.##.##.###,##.##.##.###
Region3_Prioritized_Controller_IPs=$IP3,$IP1,$IP2
Region3_Device_Ranges=##.##.##.##-##,##.##.##.##-##,##.##.##.#-#
Region3_Device_IPs=##.##.##.##,##.##.##.##,##.##.##.#

Edit the configuration file (for example vi build_team.conf) or create a custom configuration file to include the following inputs about the team configuration. You cannot change the parameter name, such as User or Team_IP. Some entries are optional as noted in the following table.


[NOTE: ]

NOTE: You can create multiple configuration files, each for use with a different team configuration. Then you can use the same script or playbook (but with a different configuration file) to create another team.


Parameter

Value

User

(optional) The default login user name is sdn. Enter a different login user name if a user name other than sdn has been set for the controllers. Or leave the user name blank in the configuration file if you want the user to be prompted to enter it when they run the script or playbook. All controllers in the team you are configuring must have the same user name and password.

When running a playbook, it will prompt you for the login user name and password even if you have entered it in the configuration file.

Password

(optional) The default login password is skyline. Enter a different login password if a different one has been set for the controllers. Or leave the password blank if you want the user to be prompted to enter it when they run the script or playbook. All controllers in the team you are configuring must have the same user name and password.

When running a playbook, it will prompt you for the login user name and password even if you have entered it in the configuration file.

Sleep_Time

(required) The default is 30 seconds. You can change this value if you want to allow more time for the controller to propagate the changes to other controllers. You may need to do this if, for example, your network is slow. If you leave this blank, the default 30 seconds is used.

Team_IP

(required) The IP address to be assigned to the team. The team IP address is different from the individual controller IP addresses. It is used as a virtual address for connecting to the team leader. This is a required.

IP1

The IP address of the master controller. IP1, IP2 and IP3 are optional because you can enter these IP addresses under Controller_IPs instead of as IP1, IP2 and IP3.

If you enter an IP address for IP1, IP2 and IP3 you can use the notation $IP1, $IP2 and @IP3 in the Controller_IPs and Region parameters that follow. Or you can leave IP1, IP2 and IP3 blank and instead enter the IP addresses for the master controller, primary slave controller and secondary slave controller under Controller_IPs and Region parameters directly.

When running the team configuration script or playbook, it will check to verify if the IP addresses are valid.

For requirements on the IP address you enter for team configuration, see High Availability best practices.

IP2

(optional) The IP address of the primary slave controller. IP1, IP2 and IP3 are optional because you can enter these IP addresses under Controller_IPs instead of as IP1, IP2 and IP3.

IP3

(optional) The IP address of the secondary slave controller. IP1, IP2 and IP3 are optional because you can enter these IP addresses under Controller_IPs instead of as IP1, IP2 and IP3.

Controller_IPs

(required) The order of the controllers in the team from master to primary slave and secondary slave. You can either enter the full IP addresses separated by commas or you can use the notation $IPx where x is the number from the values you defined above. For example $IP1, $IP2, $IP3.

Region1_name

(required if specifying regions) User-defined name for the first region. You can specify 1, 2 or 3 regions in a team, or you can have a configuration with no regions.

Region1_Prioritized_Controller_IPs

(required if specifying regions) The prioritized order of the controllers in this region from first to last. You can either enter the full IP addresses separated by commas or you can use the notation $IPx where x is the number from the values you defined above. For example $IP1, $IP2, $IP3.

Region1_Device_Ranges

(optional but either range or device IP is required if defining devices) The ranges for devices that you want to be configured in Region1. You can either define devices by range or by individual IP address.

For requirements on the device IPs you enter for team configuration, see High Availability best practices.

Region1_Device_IPs

(optional but either range or device IP is required if defining devices)The device IPs configured in Region1. You can either define devices by range or by individual IP address.

The devices must be configured with the IPs of all three controllers in a team.

Region2, Region3

Enter inputs for other regions you want to define. You can specify 1, 2 or 3 regions in a team, or no regions. If you don’t want to define Region2 or Region3 then leave all items for that region blank.