VMware Cloud Community
DavidMcKnight
Contributor
Contributor
Jump to solution

Add-VDSwitchPhysicalNetworkAdapter

Is there a way to assign a VMHost's physical NIC to a particular VD Uplink Port?

My Virtual Distributed Switch has 4 uplinks per host.  My blade has 4 physical NICs, two are 10 gig and two are 1 gig.  I want to script a way so the 1st 10 gig NIC (the one with the lowest MAC) gets assigned to dvUplink1 the other 10 gig NIC is assigned to dvUplink2.  The 1st 1 gig NIC gets assigned to dvUplink3 and the 2nd 1 gig NIC get assigned to dvUplink4.  I know how to get a reference the appropriate physical NIC in the host, I just can't figure out how to assign it to a particular dvUplink on the DVS.

Any suggestions?

Thanks,

0 Kudos
1 Solution

Accepted Solutions
LucD
Leadership
Leadership
Jump to solution

Isn't this done in the order you specify them on the VMHostPhysicalNic parameter ?


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

View solution in original post

0 Kudos
6 Replies
LucD
Leadership
Leadership
Jump to solution

With

Get-VMHostNetworkAdapter -Physical -VMHost $esx

you can get the MAC and the DeviceName.

And you can use this DeviceName on the Add-VDSwitchPhysicalNetworkAdapter cmdlet on the VMHostPhysicalNic parameter.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
DavidMcKnight
Contributor
Contributor
Jump to solution

Yes, like I said, I know how to get a reference to a particular the Physical NIC.  I just don't know, and what I'm asking is, how do I assign that physical NIC to a particular DVuplink port.

So how would you script:  on vmHostA assign vmnic0 to dvUplink3 on dvSwitch0?

0 Kudos
LucD
Leadership
Leadership
Jump to solution

Isn't this done in the order you specify them on the VMHostPhysicalNic parameter ?


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
DavidMcKnight
Contributor
Contributor
Jump to solution

Ah, so you're suggesting I pass an array of physical NICs.  Where element 0 would get assigned to DVuplink1, element 1 would get assign to DVuplink2, etc...  Intriguing.

I'll give it a try.  Thanks!

0 Kudos
admin
Immortal
Immortal
Jump to solution

How can uplinks be left blank or the physical NICs be entered in different order?

For example, assume Uplink 1, Uplink 2, Uplink 3, and Uplink 4. How can I do the following assignment?

Uplink 1 => vmnic0

Uplink 2 => <null>

Uplink 3 => vmnic2

Uplink 4 => vmnic1

Thanks for the help.

0 Kudos
david_sjostrand
Enthusiast
Enthusiast
Jump to solution

Isn't this done in the order you specify them on the VMHostPhysicalNic parameter ?

No it isn't. Not always for some reason. On one of my hosts it starts on dvUplink5 out of 6. The same thing happens if I use the vsphere web client and choose auto-assign.

On my other host it starts with dvUplink1 though.

I would also like to know how to get a predictable result with Add-VDSwitchPhysicalNetworkAdapter.

/David Sjöstrand
0 Kudos