Disable Hyper-threading on Azure Instance
The instructions below are a workaround supplied by Azure. We do not know if this is officially supported by MS or if it will change in the future. The instance used were general compute instance StandardD32as V4.
Do the following to disable hyper-threading.
On the Azure instance:
-
Run the following command:
#vi /etc/default/grub
-
In /etc/default/grub, add nosmt to the end of the GRUB_CMDLINE_LINUX entry:
GRUB_CMDLINE_LINUX="console=tty1 console=ttyS0 earlyprintk=ttyS0 rootdelay=300 crashkernel=auto nosmt"
-
Set boot load kernel configuration by running:
#cp /boot/grub2/grub.cfg /boot/grub2/grub.cfg_bak //backup the grub file
#grub2-mkconfig -o /boot/grub2/grub.cfg
-
Reboot the VM.
-
Confirm the procedure worked by running:
lscpu
example results:Before and After of the VM:
CopyBefore:
[root@<machine-IP> ~]# lscpu
Architecture: x86_64
CPU op-mode(s): 32-bit, 64-bit
Byte Order: Little Endian
CPU(s): 32
On-line CPU(s) list: 0-31
Thread(s) per core: 2
Core(s) per socket: 16
Socket(s): 1
NUMA node(s): 2
Vendor ID: AuthenticAMD
CPU family: 25CopyAfter Running the above commands and successful reboot:
[root@<machine-IP> ~]# lscpu
Architecture: x86_64
CPU op-mode(s): 32-bit, 64-bit
Byte Order: Little Endian
CPU(s): 32
On-line CPU(s) list: 0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30
Off-line CPU(s) list: 1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31
Thread(s) per core: 1
Core(s) per socket: 16