Some users when using Azure Linux virtual machine installation software, some software license and the current system's MAC address binding, then the Azure VM restart, Reszie (change size), stop and then boot, the virtual machine MAC address will not change? How does the MAC address on the Azure VM persist?
We do a test of VMS in a vnet and not in a vnet.
Test virtual machines that are not in a vNet
1. We quickly create a test Linux Ubuntu virtual machine without setting up a vnet, meaning that the virtual machine is not in a set vnet and is typically used as a test
2. Log in to the system, record the current MAC address of the system: 00:17:fa:00:4f:9b
3. Then we restart the virtual machine, reboot the system, and then get the MAC address, you can see the MAC address and the same as the original, did not change: 00:17:fa:00:4f:9b
4. The current virtual machine size is A3, so let's sit down and resize it up to a A4-sized machine:
5. After the upgrade is complete, the system restarts, then we log in to the system to check the MAC address, found that the internal IP address has changed, but the MAC address remains the same: 00:17:fa:00:4f:9b
6. The same testing process reduces the machine from A4 to A2,mac address: 00:17:fa:00:4f:9b
7. Finally test the change of MAC address in the Azure management interface, stop the virtual machine, unassign the case. Let's stop the virtual machine and select "Off":
By stopping the virtual machine in this way, you will see that the interface displays "Stopped (unassigned)", in which case the virtual machine resource is completely freed, the calculation fee is not calculated, and the storage fee is calculated.
8. Start the virtual machine, and then check the MAC address:
The virtual machine MAC address becomes: 00:17:fa:00:3a:29 differs from the previous Mac address 00:17:fa:00:4f:9b, meaning that the MAC address changes only if the virtual machine is stopped (unassigned).
Summarize
Currently Azure virtual machines in a situation where the MAC address does not change whether the VM is in a vNet or not:
1. Restart the virtual machine
2. Upgrade to a large size virtual machine (resize)
3. Downgrade to a small size virtual machine (resize)
In the following cases, the MAC address changes regardless of whether the VM is in a vNet: stopping the virtual machine through the Azure management interface, displaying the deallocation, and then starting the MAC address will change.
Note that if you are executing command Shutdown/poweroff from within a virtual machine, the virtual machine will not shut down or power down, but would continue to be billed, of course, the MAC address will not be released at this time, and when you restart the machine, it remains unchanged.
So for those who rely on MAC address to do license binding, if your virtual machine does not need to shut down, stop allocation, restart, resize, etc. will not have a problem, in the future Azure will also release new features, keep azure virtual machine in any scenario, MAC address will not change
For virtual machine testing in a vnet, interested students can click here to view.
Persistence of MAC addresses for Linux virtual machines on Azure