VMware Cloud Community
skendric
Contributor
Contributor

algorithm for "route based on the originating virtual port"

What is the algorithm used to assign a vmkX port to a vmnic?

I speculate:

- Hash:  Some deterministic hashing function which considers both the vmkX port ID and the number of vmnics.

     ==> I would expect a given vmkX port to be assigned fairly reliable to the same vmnic all the time, even across disruptions (e.g. Host & Physical Switch reboots).  And all my Hosts to reflect the same mapping (assuming that they all have identical NIC counts).

- Round Robin:  Start with vmnic0 and assign vmkX ports to vmnics in whatever order they request service.

    ==> I would expect the mappings between vmkX and vmnics to differ between Hosts and then to change across Host & Physical Switch reboots.

- Something else

Why do I want to know?  Because I note that my Hosts vary as to which vmkX port maps to which vmnic  And I'm wondering if this is to be expected or not.

VMWare ESXi 6.0.  (4) pNICs in each Host.  (1) VM Port Group, (3) vmkX (vmk0/Mgmt, vmk1/Storage, vmk2/vMotion).  All vmnic0-3 configured as Active Adapters; all configured for Failback.

--sk

Reply
0 Kudos
4 Replies
martinriley
Hot Shot
Hot Shot

Hi there,

it's essentially Round Robin, the vmnic will be assigned for each VM and then that vmnic is used until the VM Virtual Port ID changes, which is as you suggest on power off/on of the VM, migration etc.  Of course it may not change the vmnic used even then, just will be recalculated based on the existing connections.

Hope this helps!

vM

-----------------------

VCAP-DCD / VCAP-DCA / VCP-CLOUD / VCP-DT / VCP5 / VCP4

-----------------------

vMustard.com

Reply
0 Kudos
skendric
Contributor
Contributor

Got it, so Round-Robin for the virtual ports associated with VMs.

How about for vmkX ports?  i.e. the 'kernel ports' which service: (a) vMotion, (b) Storage, (c) Management.

I have a suspicion that these are assigned in a more deterministic manner (most of my hosts display the same pattern) ... but perhaps I am being fooled by randomness.

--sk

Reply
0 Kudos
martinriley
Hot Shot
Hot Shot

I believe the same applies- each vmkernel port will have a Virtual Port ID and the same calculation process is conducted, however as the vmkernel ports will typically be 'up' before the VM connections to a port group (and also I'm guessing in the same order on host boot etc.) I'd suggest they would typically pick up the same vmnic each time as the calculation would produce the same assignment each time.

So I believe the vmkernel ports appear to be more deterministic but it's essentially just that they're first in the queue and typically they queue up in the same order.  Hope that makes sense!

Reply
0 Kudos
skendric
Contributor
Contributor

Yes, OK, I'm following you now.  Thank you.  If I can manage to verify your prediction (by rebooting each Host in turn), I'll post the results here.

--sk

Reply
0 Kudos