Hello all,
Needless to say I had a large issue with the vmxnet3 adapter for a customer and they requested all NICs be rolled over to the e1000e (Ugly!) but it was what they knew worked for them.
So I started to write a script using the latest PowerCLI.
This include cmdlets Net-NetworkAdapter, but this has limitation of it functionality which is not correct.
Specifically on MAC Addresses.
You see to make sure the systems which are using DHCP get back their original address so that there are no changes required to the Load Balancers we have to make sure they maintain the MAC's.
the MAC on a test system was 00:50:56:88:f7:78 which was originally auto-assigned.
Well that address is invalid if you try to pass it to the new adapter with the below error:
===============================================================================================================================================
New-NetworkAdapter : Cannot bind parameter 'MacAddress' to the target. Exception setting "MacAddress": "The MAC
address is invalid or is not in the valid range 00:50:56:00:00:00 - 00:50:56:3F:FF:FF."
At C:\SwapNics.ps1:41 char:55
+ New-NetworkAdapter -vm $VM -Type $NICType -MacAddress $MACAdd -StartConnected -N ...
+ ~~~~~~~
+ CategoryInfo : WriteError: (:) [New-NetworkAdapter], ParameterBindingException
+ FullyQualifiedErrorId : ParameterBindingFailed,VMware.VimAutomation.ViCore.Cmdlets.Commands.VirtualDevice.NewNet
workAdapter
===============================================================================================================================================
It seems that whomever created the cmdlet has incorrect validation in their code. as 00:50:56:88:f7:78 is in between 00:50:56:00:00:00 - 00:50:56:3F:FF:FF
likewise for Set-NetworkAdapter...
And with Set-NetworkAdapter you cannot go from -type:Vmxnet3 to -type:e1000 or e1000e, which would have made this whole situation so much less complicated!
Anyhow, figured I would share my fndings and if this is not corrected save someone the multiple hours trying to figure out if it was a context error or something in my code.