Today I found this neat PowerCLI One-liner in my Twitter timeline:
PowerCLI Einzeiler um den Adapter-Typ einer VM auf Vmxnet3 zu ändern: Get-VM YOUR-VM |Get-NetworkAdapter |Set-NetworkAdapter -Type "Vmxnet3"
— T. Scheller (@bones44) February 28, 2014
A nice side effect of this one-liner is, that the mac-address doesn’t change, as you can see in the screenshots.
If you have ever changed the adapter type of a vNIC you will know, that this leads to a changed mac-address and a new adapter in the OS. Windows will show a “Local Area Connection 2”, Linux will show a eth1 instead of eth0. So you need to lend a hand. If you use Linux and you’ve changed the adapter type using this one-liner, everythings fine. eth0 will stay eth0, but the kernel loads another driver. No need to modify or delete the 70-persistent-net.rule file under /etc/udev/rules.d. But how does Windows handle it? Unfortunately Windows doesn’t handle it. Windows detects a new device, because the hardware ID changed.
The only way to fix this, is to delete the old, non-present adapter. In order to do that, open a CMD and enter the following command:
Then open the Device Manager, choose “View” and click “Show hidden devices”. Then delete all non-present network adapters and the newly detected VMXNET3 adapter.
After that, right click the computer icon (in my case LABLAB-V4143BPG) and select “Scan for hardware changes”. Windows will detect a new VMXNET3 adapter, which you can finally configure with the hopefully documented IP settings.
- Connecting to Exchange Online with PowerShell - February 26, 2020
- Space reclamation of VMFS 5 Datastores using esxcli - February 12, 2020
- VCAP6.5-DCV Design – Objective 2.4 Build manageability requirements into a vSphere 6.x logical design - December 31, 2019