Disable Hyperthreading on Azure Windows VM

Hyperthreading in Azure Windows VM

How to check if the VM has hyperthreading enabled?

With Hyper-threading enabled the Operating System will address each physical or virtual CPU core as two logical cores or “threads”. For example if a particular Virtual Machine has 2 virtual cores assigned this will be represented as 4 logical cores — a 2:1 ratio of logical cores to virtual cores.

Azure VM Size with Hyperthreading enabled
Check if hyperthreading is enabled or disabled

How to disable Hyperthreading on Azure VM running Windows?

As the hyper-threading is enabled by default on the select Azure VM Sizes, below are the three ways if you want to disable hyper-threading on a VM running Windows:

Azure Portal

The following tag can be added in the portal and set as true:

Tagging via Azure Portal

Azure CLI

Tagging via Bash using CLI command

Powershell

For VMs: use the –Tag flag when using New-AzureRmVm (alternatively, use the –Tags flag when creating the VM config with New-AzureRmVmConfig)

Next Steps?

Once the Tag is place, then the specific VM in Azure needs to be redeployed.

Redeploying a VM

Validate if hyperthreading has been disabled:

Access the windows command line from within the VM and type wmic to enter the interactive wmic interface. Then, you can type:

Hyperthreading disabled

How to re-enable Hyperthreading on Azure VM running Windows?

To re-enable Hyperthreading, remove the “platformsettings.host_environment.disablehyperthreading” tag and stop (deallocate) and start the VM from Azure. A Guest OS reboot is not sufficient.

About me:

--

--

Senior Cloud Engineer | 7x Microsoft Azure Certified | Solutions Architect | DevOps | AVD | Security | Former Research Scholar at Georgia Tech

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Abhi Bothera

Senior Cloud Engineer | 7x Microsoft Azure Certified | Solutions Architect | DevOps | AVD | Security | Former Research Scholar at Georgia Tech