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

Mas*_*imo 5 virtualization nic virtual-machines 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.
Run Code Online (Sandbox Code Playgroud)

和:

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.
Run Code Online (Sandbox Code Playgroud)

实际上似乎发生的是,只要有一些“服务”正在完成,VM 的现有虚拟 NIC 就会被移除并替换为新的,更改其 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 随机替换虚拟 NIC,丢失您可能对它们所做的所有配置调整,更改它们的 MAC 地址并在来宾系统中留下幽灵 NIC?

Noo*_*ldi 4

不,没有人能做到这一点,因此如果您正在考虑使用 Azure,则需要避免任何依赖于 MAC 地址许可或 PTR 记录的事情。