Using a playbook from the remote SDN Toolkit VM to configure multiple teams

You can configure one or more teams from your remote SDN Toolkit VM. This method is useful when you want to configure multiple teams, since all the teams can easily be configured remotely. You must have deployed the SDN Toolkit VM in order to run the playbook. For details on deploying the SDN Toolkit VM, see the HPE VAN SDN Controller Installation Guide. For details on the teaming requirements, see High Availability best practices. Alternately you can configure teaming from a local controller using a Python script, see Using a Python script from a controller to configure a team.

From your SDN Toolkit VM you can connect to multiple controllers to form multiple teams. You use an Ansible playbook (teaming.yml), a hosts file and a configuration file to configure teaming. The playbook allows the following teaming configuration actions: create team, create ALL regions, delete team, delete ALL regions.


[WARNING! ]

WARNING!

  • You cannot add or delete devices in specific regions using the playbook on your remote SDN Toolkit VM. For these actions you must ssh to a controller in the team and use the Python script.

  • The delete team action deletes all existing regions and deletes the team without any prompts.

  • You can only create ALL regions using the playbook on your remote SDN Toolkit VM. There is no prompt to allow you to choose which region to create. The regions are defined in the configuration file.

  • You can only delete ALL regions using the playbook on your remote SDN Toolkit VM. There is no prompt to allow you to select which region to delete.




On the SDN Toolkit VM, you configure the inputs you want to use when running the playbook in one or more configuration files. You also edit the hosts file to define the controller to connect to when configuring a team.

The build_team.conf file is the default configuration file. You can find the file on the SDN Toolkit VM at /home/sdn/scripts/ansible/build_team.config. You can edit this file or you can create custom configuration files with different names but the same format and in the same directory.

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

Since you run the Ansible playbook remotely from the SDN Toolkit VM, the playbook must be able to establish a connection to one of the controllers in the team you want to configure. You need to specify the ssh user name and password in the hosts file. The hosts file is where you indicate which controller to connect to for each team, along with which configuration file to use and whether to turn on debugging. The file is located on the SDN Toolkit VM at /home/sdn/scripts/ansible/hosts. You edit the hpsdn_teaming_hosts section of the hosts file.

The following is an example of this section of the hosts file:

[hpsdn_teaming_hosts]
#Controller IP
#config: conf file
#turn ON debug mode: flag=-v, turn OFF debug mode: flag=
#xxx.xxx.xxx.xxx config=<Configuration file> flag=-v ansible_ssh_user=<user name> ansible_ssh_pass=<password>

Edit the hpsdn_teaming_hosts section to indicate the following:

  • Enter the controller IP address, indicating the controller from the team you plan to configure, to connect to

  • config=<Configuration file>. You are required to enter a configuration file name. The default is build_team.conf. Or you can enter a custom configuration file name.

  • flag=-v to indicate turn on debug mode. To turn off debug mode enter flag=. You must have flag=, with or without the -v, in the hosts file or an error is returned when running the playbook.

  • Enter the user name and password for connecting by ssh to one of the controllers in the team. The following is an example:

    ansible_ssh_user=sdn

    ansible_ssh_pass=skyline

Examples:

192.0.123.5 config=build_team.conf flag=-v ansible_ssh_user=sdn ansible_ssh_pass=skyline

Connect to controller 192.0.123.5, use the default build_team.conf configuration file (located in the same directory) and turn on debug mode. Connect to the controller with ssh using the user name sdn and the password skyline.

192.0.123.5 config=abc.conf flag= ansible_ssh_user=sdn ansible_ssh_pass=skyline

Connect to controller 192.0.123.5, use the abc.conf configuration file (located in the same directory) and turn off debug mode.

192.0.123.5 config=abc.conf flag=-v ansible_ssh_user=sdn ansible_ssh_pass=skyline

192.0.123.33 config=def.conf flag=-v ansible_ssh_pass=sdn ansible_ssh_pass=skyline

Connect to controller 192.0.123.5, use the abc.conf configuration file and turn on debug mode to configure one team. And also connect to 192.0.135.33, use the def.conf configuration file and turn on debug to configure another team.

10.1.1.1 config=east.conf flag= ansible_ssh_user=sdn ansible_ssh_pass=skyline

Connect to controller 10.1.1.1, use the east.conf configuration file (located in the same directory), turn off debug mode.


[NOTE: ]

NOTE: To use Ansible to connect to any controller(s), the playbook checks the host key. If a host is reinstalled and has a different key in ‘known_hosts’, this will result in an error message until this is corrected. For details see http://docs.ansible.com/ansible/intro_getting_started.html#host-key-checking.


To run the playbook:


[NOTE: ]

NOTE: If the IP address entered in the hosts file is not valid or the other controllers in the team cannot be connected to, a fail connection error is returned and the playbook exits. If flag= is missing in the hosts file, a missing parameter error is returned and the playbook exists.


  1. Run the Ansible playbook in the /home/sdn/scripts/ansible directory:

    ansible-playbook teaming.yml —i hosts

  2. Enter the login user name and password. And when prompted, enter the password again.

  3. At the prompt, choose an option from the following

    1) Create Team
    2) Create ALL Regions
    3) Delete Team
    4) Delete ALL Regions
    X/x Exit
  4. Check for messages or errors.

  5. Select X/x to exit.