VMware Cloud Community
RTmxa
Contributor
Contributor

Forcing Management Network NIC to use physical NIC

Hi,

I noticed that when I use the Customize Menu, if I unlink one nic and link a different nic for the Management network, the vmkernel nic changes to match the mac of the physical nic.

I need to achieve this in script since all my vmkernels as of now install with the same MAC.

I tried unlinking the pnics and then linking one of them but the MAC of the vmkernel is unchanged.

Any suggestions?

0 Kudos
4 Replies
golddiggie
Champion
Champion

vSwitch or dvSwitch??

I looked on my vSwitchs and all the vmkernel port groups have unique MAC addresses... One is for the Management Network (on vSwitch0) and the others are on my iSCSI vSwitch (2)... Clicking on the bubble to the left of the port group gave the different MAC addresses, as did getting properties on the vSwitch (and drilling into the correct segment)...

I've not messed around with dvSwitches yet, so I can't say (from experience) how they are supposed to, or will, behave. When I add another host, I might go that route...

VMware VCP4

Home Brewer

Consider awarding points for "helpful" and/or "correct" answers.

0 Kudos
RTmxa
Contributor
Contributor

Thanks. I see this issue in a vSwitch. It is caused in my environment due to the mechanism I use to install ESXi. I copy a disk image from a "golden machine" and use that to install esxi on other machines. So the vmk0 NIC has the MAC of the golden machine on all installations.

If I go to the Management console and unlink the vmnic interface (save the changes which forces a restart of the management network) and link it back, I see that the vmk0 NIC MAC address is changed to reflect the MAC of the physical box. I need to know the series of commands that will get this done in script so that on the customer side they do not need to manually intervene.

I have tried unlinking the vSwitch0 using esxcfg-vswitch -U vmnic0 vSwitch0 & then linking it back hoping it would recreate what is being done in the Management Console but that does not work.

0 Kudos
golddiggie
Champion
Champion

I would NEVER setup ESXi hosts (or ESX for that matter) by cloning another system no matter how 'golden' it appears to be. With how fast ESX/ESXi installs these days, it really doesn't make sense to use the clone method. Not when you factor in all the extra time you're spending messing around with the cloned hosts to get them to work properly...

You might want to try using the kickstart install method if you're not open to simply watching the install process (you can easily use the iLO and DRAC connections if your servers have either to perform the install and configuration)...

If you have the correct edition license, you can use host profiles to help in making sure all your hosts are configured as close to identical as it's possible (recommended to not have a host profile with a jumbo frame vSwitch, such as for iSCSI)... You can perform additional changes post install and applying of the host profile, via CLI tools...

I'd be interested in knowing how many host servers your administrating/managing...

VMware VCP4

Home Brewer

Consider awarding points for "helpful" and/or "correct" answers.

0 Kudos
RTmxa
Contributor
Contributor

Unfortunately I really cannot change this right now since this is kind of a last minute thing (as much as I would like to).

Considering how simple this is to accomplish from the UI there must be something simple to get this working through script as well.

I noticed that when I did this through UI and looked at the logs it seems to follow the following steps.

Delete vmk0 , add new vmk0 & do some sort of ether attach which ensures that the vmkernel and physical nic have the same address.

I also tried changing the mac using vim-cmd hostsvc/net/vnic_set --vnic-mac=<Physical MAC> , but this did not work either.

0 Kudos