Accessing and Using Azure VM Unique ID

Microsoft has recently added support for Azure VM unique ID. Azure VM unique ID is a 128bits identifier that is encoded and stored in all Azure IaaS VM’ SMBIOS and can be read using platform BIOS commands.

This identifier can be used in different scenarios whether the VM is running on Azure or on-premises and can help your licensing, reporting or general tracking requirements you may have on your Azure IaaS deployments. Many independent software vendors and partners building applications and certifying them on Azure may require to identify an Azure VM throughout its lifecycle and to tell if the VM is running on Azure, on-Premises or on other cloud providers. This platform identifier can for example help detect if the software is properly licensed or help to correlate any VM data to its source such as to assist on setting the right metrics for the right platform and to track and correlate these metrics amongst other uses.

This unique identifier cannot be modified, it can only be queried. Although only new VMs created after 09/18/2014 will have this capability enabled upon creation, VMs that were created prior to 09/18/2014, will automatically get this capability upon next VM restart. Azure Unique VM ID won’t change upon reboot, shutdown (either planned for unplanned), start/stop de-allocate, service healing or restore in place. However, if the VM is a snapshot and copied to create a new instance, Azure VM ID will get changed.

If you have older VMs created and running since this new feature got rolled out (9/18/2014), please restart your VM to automatically get a unique ID which you can start using upon reset.

To access Azure VM ID from within the VM, follow these steps:

Step 1 – Create a VM (only VMs created after 9/18/2014 will have this feature enabled by default)

Follow these steps: How to Create a Custom Virtual Machine

Step 2 – Connect to the VM

Follow these steps: How to Log on to a Virtual Machine Running Windows Server or How to Log on to a Virtual Machine Running Linux

Step 3 – Query VM Unique ID

Linux VMs

Command (Ubuntu):

sudo dmidecode | grep UUID

Example Expected Results:

UUID: 090556DA-D4FA-764F-A9F1-63614EDA019A

Due to Big Endian bit ordering, the actual unique VM ID in this case will be:

DA 56 05 09  FA D4  4f 76 - A9F1-63614EDA019A

Windows VMs

Commands:

$systemEnclosure = Get-WmiObject -class Win32_SystemEnclosure -namespace root\CIMV2
$computerSystemProduct = Get-WmiObject -class Win32_ComputerSystemProduct -namespace root\CIMV2

'BIOS GUID:             "{0}"' -f $computerSystemProduct.UUID

Example expected results: BIOS GUID:

"BC5BCA47-A882-4096-BB2D-D76E6C170534"

No matter what your platform or applications requirements on Azure VM, you can now have access to an Azure VM unique identifier.

If you have older VMs created and running since this new feature got rolled out, please restart your VM to automatically get a unique ID which you can start using upon reset.

Advertisements

About Cloud 9 Infosystems

Cloud 9 Infosystems is an Azure Circle Partner specializing in building, migrating and managing applications in Cloud. We were awarded the Most Valuable Partner Award by Microsoft for our Cloud services. We are also part of Azure insider club and P-seller program at Microsoft.
This entry was posted in Uncategorized. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s