VMware Cloud Community
dauphin77
Enthusiast
Enthusiast

vDS NIC Teaming and Failover Policy - How to modify with PowerCLI

Howdy all-

I have created a Distributed Virtual Switch and and am looking to modify the 'Teaming and Failover' policy to automatically assign a LAG as the 'Active' adapter versus the 'Unused' Uplinks when a new Distributed Port Group is added/created.

Is there a way to do this using PowerCLI to permanently modify the 'Teaming and Failover' policy on the vDS? I have come across the following commands but unsure if they're correct. Any advice/guidance would be appreciated.

Thanks.

get-vdswitch $vdsname | Get-VDUplinkTeamingPolicy | Set-VDUplinkTeamingPolicy -UnusedUplinkPort dvUplink1, dvUplink2, dvUplink3, dvUplink4

get-vdswitch $vdsname | Get-VDUplinkTeamingPolicy | Set-VDUplinkTeamingPolicy -ActiveUplinkPort LAG

Tags (1)
0 Kudos
2 Replies
dauphin77
Enthusiast
Enthusiast

Is there maybe a way to adjust the NIC Teaming Policy on a Distributed Switch via esxcli so that when a portgroup is created it will assign the lag port I created instead of the unassigned/unused adapters?

0 Kudos
icesatish
Enthusiast
Enthusiast

Hi,

It's very simple, take a look here :

https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Create-VDportgroup-with-specific-activ...

 

 

You can do it all in one command that creates & Edit it :

 

New-VDPortgroup -VDSwitch ntn01-dvs -Name dv_22 -NumPorts 128 -VlanId 22 -PortBinding Static | Get-VDUplinkTeamingPolicy | Set-VDUplinkTeamingPolicy -LoadBalancingPolicy LoadBalanceSrcId -UnusedUplinkPort vmnic2-vMotion-A,vmnic3-vMotion-B,vmnic4-NFS-A,vmnic5-NFS-B,vmnic8-Spare-A,vmnic9-Spare-B

 

[in the default, all of the Uplinks are active, so we just removed the unnecessary uplinks to be 'unused' ]

0 Kudos