如何阻止 Azure 随机更换虚拟机上的网卡?

如何阻止 Azure 随机更换虚拟机上的网卡?

Azure 似乎有这样的习惯随机改变虚拟机的硬件配置,而不向用户透露任何信息。

这当然在文档,虽然有些含糊:

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.

和:

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.

实际情况似乎是,每当进行某些“维护”时,虚拟机的现有虚拟网卡就会被移除并替换为新的虚拟网卡,更改其 MAC 地址并重置全部网络配置恢复为默认设置。

然而,除了导致臭名昭著的幽灵网卡在客户操作系统中,这也会导致各种各样的问题。

当然,一种情况是,如果您实际上依赖 MAC 地址用于某些目的,例如运行使用它进行基于硬件的许可的应用程序。

另一个,讨论这里,Windows 系统上 DHCP 配置的 NIC 将不是在 DNS 中注册其 PTR 记录,除非Use this connection's DNS suffix in DNS registration在高级 TCP/IP 设置中启用。当然,Azure 明确要求虚拟 NIC 使用 DHCP……并且此选项是不是默认启用,并且将不是当 Azure 决定用新的 NIC 替换现有 NIC 时启用;因此,再见,PTR 记录。

那么:有没有什么方法可以阻止 Azure 随机用新的虚拟 NIC 替换,丢失对它们进行的所有配置调整,更改它们的 MAC 地址,并让幽灵 NIC 留在客户系统中?

答案1

不,对此无能为力,因此如果您正在考虑 Azure,那么您会想要避免任何依赖于 MAC 地址许可或 PTR 记录的事情。

相关内容