How can I stop Azure from randomly replacing network cards on VMs?

Azure seems to have the habit of randomly changing the hardware configuration of virtual machines, without telling anything to the user.

This is of course mentioned in the documentation, although somewhat vaguely:

Can I manually assign IP addresses to NICs in virtual machines?

No. You must not change any interface properties of VMs. Any changes may lead to
potentially losing connectivity to the virtual machine.

And:

Will the MAC address remain the same for my virtual machine once it has been created?

No. A virtual machine’s MAC address can change for a few different reasons. If the
VM is put in the status Stopped (Deallocated), if you change the virtual machine size,
or if there is service healing or planned maintenance of the host server, the MAC
address is not retained.

What actually seems to happen is, anytime there is some "servicing" being done, the existing virtual NIC for a VM is removed and replaced by a new one, changing its MAC address and resetting all network configurations to defaults.

However, apart from leading to a proliferation of the infamously well known ghost NICs in the guest operating systems, this also can lead to all sort of problems.

One is, of course, if you are actually relying on the MAC address for some purpose, such as running an application which uses it for hardware-based licensing.

Another one, discussed here, is that DHCP-configured NICs on Windows systems will not register their PTR records in the DNS, unless Use this connection's DNS suffix in DNS registration is enabled in the Advanced TCP/IP settings. And, of course, Azure explicitly requires virtual NICs to use DHCP... and this option is not enabled by default, and will not be enabled when Azure decides to replace an existing NIC with a new one; thus, goodbye, PTR record.

So: is there any way to stop Azure from randomly replacing virtual NICs with new ones, losing all configuration tweaks you may have done on them, changing their MAC addresses and leaving ghost NICs hanging around in the guest systems?


Solution 1:

Nope, no can do on this, so anything depending on MAC address licensing or PTR records is something you would want to avoid if you're considering Azure.