Persistence of MAC addresses for Linux virtual machines on Azure

Source: Internet
Author: User

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

  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 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; "/>

  3. 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; "/>

  4. 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; "/>

     

  5. After the
  6. 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; "/>

     

  7. 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; "/>

  8. 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; "/>

  9. 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
    1. 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; "/>

    2. To save space, the test process is no longer listed here, as is the test process for virtual machines in a vnet, respectively:

      1. Restarting a virtual machine

      2. Upgrade to a large size virtual machine

      3. Reduced to small size virtual machines

      4. 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:

    1. Restarting a virtual machine

    2. Upgrade to a large size virtual machine (resize)

    3. 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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.