VMware Cloud Community
kri-2
Hot Shot
Hot Shot
Jump to solution

scripting the nic teaming: standby to active

Hi,

I am trying to change the standby adabter to be an active adabter. But I can't find a command or switch within the esxcfg-* commands which helps me here (optimising the unattended installation)...

For a better understanding what I want to do see the two images. Smiley Happy

Any ideas? Chris

0 Kudos
1 Solution

Accepted Solutions
M__Gieske
Enthusiast
Enthusiast
Jump to solution

Hi,

we have had the same demand, but without changing esx.conf it is not possible ( we have opened a SR for this and support told us, what to do ).

You can add pnics via esxcfg-vswitch, but only the first two will be active. The other ones are standby.

Be aware, that editing esx.conf requires a reboot after all.

Here is, what worked for us:

after creating the vswitch and adding the pnics you have to edit esx.conf

nic/vswitch/child[xxxx]/teamPolicy/maxActive="<number-of-active-pnics>"

then execute

vmware-vim-cmd internalsvc/refresh

vmware-vim-cmd hostsvc/net/refresh

for each nic:

vmware-vim-cmd hostsvc/net/vswitch_setpolicy --nicorderpolicy-active <vmnic> <vswitch>

just to make sure, everything is reloaded:

vmware-vim-cmd internalsvc/refresh

hope this helps

View solution in original post

0 Kudos
4 Replies
Dean_Holland
Enthusiast
Enthusiast
Jump to solution

Does this command work?

vimsh -n -e "hostsvc/net/vswitch_setpolicy --nicorderpolicy-active=vmnic0,vmnic1 vSwitch0"

You'll need to restart mgmt-vmware afterwards...

kri-2
Hot Shot
Hot Shot
Jump to solution

hi,

thx for your answer!

But it seems not to work.

after running:

vimsh -n -e "hostsvc/net/vswitch_setpolicy --nicorderpolicy-active=vmnic2,vmnic0 vSwitch0"

it throws: Fault Msg: "A specified parameter was not correct.

0 Kudos
Texiwill
Leadership
Leadership
Jump to solution

Hello,

Edited thread to drop -> in favor of 2.... A -> in the thread subject causes parts of the subject to be dropped.


Best regards,

Edward L. Haletky

VMware Communities User Moderator

====

Author of the book 'VMWare ESX Server in the Enterprise: Planning and Securing Virtualization Servers', Copyright 2008 Pearson Education.

CIO Virtualization Blog: http://www.cio.com/blog/index/topic/168354

As well as the Virtualization Wiki at http://www.astroarch.com/wiki/index.php/Virtualization

--
Edward L. Haletky
vExpert XIV: 2009-2023,
VMTN Community Moderator
vSphere Upgrade Saga: https://www.astroarch.com/blogs
GitHub Repo: https://github.com/Texiwill
M__Gieske
Enthusiast
Enthusiast
Jump to solution

Hi,

we have had the same demand, but without changing esx.conf it is not possible ( we have opened a SR for this and support told us, what to do ).

You can add pnics via esxcfg-vswitch, but only the first two will be active. The other ones are standby.

Be aware, that editing esx.conf requires a reboot after all.

Here is, what worked for us:

after creating the vswitch and adding the pnics you have to edit esx.conf

nic/vswitch/child[xxxx]/teamPolicy/maxActive="<number-of-active-pnics>"

then execute

vmware-vim-cmd internalsvc/refresh

vmware-vim-cmd hostsvc/net/refresh

for each nic:

vmware-vim-cmd hostsvc/net/vswitch_setpolicy --nicorderpolicy-active <vmnic> <vswitch>

just to make sure, everything is reloaded:

vmware-vim-cmd internalsvc/refresh

hope this helps

0 Kudos