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.
Virtual machines that are not in a vnet
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
Log in to the system and record the current MAC address of the system:
00:17:fa:00:4f:9b
650) this.width=650; "Src=" http://images2015.cnblogs.com/blog/845013/201603/845013-20160330234220191-15130652. PNG "style=" border:0px; "/>
Then we restart the virtual machine, reboot the system, and then get the MAC address, you can see the MAC address is the same as the original, did not change:
00:17:fa:00:4f:9b
650) this.width=650; "Src=" http://images2015.cnblogs.com/blog/845013/201603/845013-20160330234221004-1649800193. PNG "style=" border:0px; "/>
-
The current virtual machine size is A3, so let's sit down resize and raise it to a A4-sized machine:
650) this.width=650; "src="/HTTP/ Images2015.cnblogs.com/blog/845013/201603/845013-20160330234221504-1171086764.png "style=" border:0px;/>
 
650) this.width=650; "Src=" http://images2015.cnblogs.com/blog/845013/201603/ 845013-20160330234221863-271935062.png "style=" border:0px; "/>
 
- After the
-
Upgrade is complete, the system restarts, and we log in to the system to check the MAC address and find that the internal IP address has changed, but the MAC address remains the same:
00:17:fa:00:4f:9b
650) this.width=650; "src=" http:// Images2015.cnblogs.com/blog/845013/201603/845013-20160330234222316-1793660097.png "style=" border:0px;/>
 
 
650) this.width=650; "Src=" http://images2015.cnblogs.com/blog/845013/201603/ 845013-20160330234222676-766151905.png "style=" border:0px; "/>
 
-
The same test process reduces the machine from A4 to A2,
 
mac Address: 00:17:fa:00:4f:9b
650) this.width=650; "Src=" http://images2015.cnblogs.com/blog/845013/201603/ 845013-20160330234223254-53027568.png "style=" border:0px; "/>
650) this.width=650; "Src=" http://images2015.cnblogs.com/blog/845013/201603/ 845013-20160330234223629-1389730170.png "style=" border:0px; "/>
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":
650) this.width=650; "Src=" http://images2015.cnblogs.com/blog/845013/201603/845013-20160330234224019-1741013099. PNG "style=" border:0px; "/>
After you stop the virtual machine in this way, you will see the interface display "Stopped (unassigned)", in which case the virtual machine resource is completely freed, the calculation fee is not calculated, and the storage fee is calculated only
650) this.width=650; "Src=" http://images2015.cnblogs.com/blog/845013/201603/845013-20160330234224332-1754488042. PNG "style=" border:0px; "/>
Start the virtual machine, and then check the MAC address:
650) this.width=650; "Src=" http://images2015.cnblogs.com/blog/845013/201603/845013-20160330234224629-1615579386. PNG "style=" border:0px; "/>
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 only if the virtual machine is stopped (unassigned) The MAC address will not change.
Virtual Machines in a vnet
The test method is similar to a virtual machine that is not in the vnet above, except that in this test case, the virtual machine is in the vnet, as shown in:
650) this.width=650; "Src=" http://images2015.cnblogs.com/blog/845013/201603/845013-20160330234225066-1565960918. PNG "style=" border:0px; "/>
To save space, the test process is no longer listed here, as is the test process for virtual machines in a vnet, respectively:
Restarting a virtual machine
Upgrade to a large size virtual machine
Reduced to small size virtual machines
Stop (unassign), and then restart
Summarize
Currently Azure virtual machines in a situation where the MAC address does not change whether the VM is in a vnet or not:
Restarting a virtual machine
Upgrade to a large size virtual machine (resize)
Downgrade to 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.
650) this.width=650; "Src=" http://images2015.cnblogs.com/blog/845013/201603/845013-20160330234225457-1953650400. PNG "style=" border:0px; "/>
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.
Persistence of MAC addresses for Linux virtual machines on Azure