Hi,
As part of an automated (vRA and vRO) datacenter migration I need to change the network adpater type of all VMs from E1000 to Vmxnet3.
I know the usual procedure of
- Recording the network config in the Guest OS
- Removing the adapater
- Adding a new Vmxnet3 adapter
- Reconfiguring the network settings in the OS
I already have Powershell scripts to do the Windows machines. My problem is with a large number of RHEL6 and RHEL7 VMs and all the UDEV changes that are needed. When the MAC address changes the Linux VMs change the network adapter name, from eth0 to eth1 for example. A script is then required to run and change it back.
A procedure I am trying would be to power down the VM after it has been migrated to the new vCenter environment and then run a PowerCLi command like:
Get-VM myVmName | Get-NetworkAdapter
Which returns:
Name Type NetworkName MacAddress WakeOnLan
Enabled
---- ---- ----------- ---------- ---------
Network adapter 1 Vmxnet3 VM Network 00:50:56:af:c2:89 True
I would then run this:
Get-VM myVmName | Get-NetworkAdapter | Set-NetworkAdapter -Type Vmxnet3
Which returns this
Name Type NetworkName MacAddress WakeOnLan
Enabled
---- ---- ----------- ---------- ---------
Network adapter 1 Vmxnet3 VM Network 00:50:56:af:c2:89 True
PRO:
The MAC Address does not change. It is still the automatically assigned one so no risk of conflicting MAC addresses.
This will remove a huge amount of complexity as it is independent of the OS type.
CON: I have tested this a few times and it seems to work fine but I cannot find anything to say that this is a supported method for changing the network adapter type.
I'd appreciate if anyone has any experience of this method to let me know if you have used it (successully/unsuccessfully) or if I'm missing some Release Notes to say it is ok to do it this way.
Thanks in advance.
I do it like this:
1. remove VM from inventory
2. edit the vmx-file directly and change
ethernet0.virtualDev = "e1000"
to
ethernet0.virtualDev = "vmxnet3"
save vmx-file
3. reregister the VM
Basically that is the same approach (by the way I assume you have a typo in the first line
Network adapter 1 | Vmxnet3 | VM Network 00:50:56:af:c2:89 | True |
and you meant to have E1000 here ?
This is supposed to work but in some really rare cases it may have obscure effects as it also changes the PCI-slot to a PCI-express Slot.
Dont do this with recent virtual hardware.
Once upon a time vmxnet3 also was a PCI-card - but nowadays it is a PCI-express card.
Ulli