Changing the default VTEP teaming policy from LACP to FAILOVER_ORDER using API calls via curl in NSX for vSphere
book
Article ID: 339049
calendar_today
Updated On:
Products
VMware NSX
Issue/Introduction
Ideally once configured , changing the teaming policy of a Virtual Tunnel EndPoint (VTEP) teaming requires removal of existing virtual wires. The purpose of this article is to explain how to use API calls to perform this task, in order to avoid unnecessary recreation of virtual wires and the associated downtime requirement.
Environment
VMware NSX for vSphere 6.x
Resolution
Firstly, this task can be achieved by un-preparing the cluster for VXLAN and re-preparing the cluster to apply the new settings from the client. However, this is not usually an option in a production environment with active production workloads. Therefore, the steps supplied utilize API calls to update the settings without redeploying the cluster.
Notes:
This does not change teaming policy of pre-existing portgroups. You will still have to manually update the teaming policy of the VXLAN portgroups which have already been deployed (vmkernel and standard virtual machine portgroups).
The output of the API query shows all distributed switches configured in NSX Manager. Copy the entries which relate to the switches you are working with to a notepad.
Now that you have the Managed Object ID (MoID) of the switch you want to perform the change on, run this query to get the configuration of the switch:
Note: If LACPv1 (LACP_PASSIVE) is in use, there are no existing entries for <uplinkPortName> tags defined, you will need to add them manually. For example, if changing the failover policy from LACP_PASSIVE to FAILOVER_ORDER you need to add <uplinkPortName> tags for all uplink names configured on the distributed switch in the order you would like them to appear for virtual wires. After the change the related virtual wires will use the Explicit Failover load balancing policy and the first uplink in the list is chosen.
With the switch information acquired in step 3, you have 2 options to change the configuration. Both options are detailed in these examples, replace the relevant credentials from your environment.
In this example you are changing the teaming policy for VDS dvs-232 from LACP_V2 to FAILOVER_ORDER. The name of the uplink also changes from <uplinkPortName>lag1</uplinkPortName> to <uplinkPortName>dvUplink1</uplinkPortName><uplinkPortName>dvUplink2</uplinkPortName>
Option 1: Inline editing with sed:
Copy and paste the relevant portions of the output acquired in step 3 and modify the relevant entries for failover mode, NSX/vShield-admin user, password, VDS name, etc to create the appropriate curl PUT command:
Note: These new settings apply to newly created wires and clusters only. To change the configuration data for existing wires you need to manually edit each VXLAN portgroup starting with vxw-***** and adjust the active uplinks, teaming policy, MTU as required.