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 was general compute instance Standard D32as V4.

Do the following to disable hyper-threading.

On the Azure instance:

  1. Run the following command:

    #vi /etc/default/grub
  1. 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"
  1. 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
  1. Reboot the VM.

  1. Confirm the procedure worked by running:

    lscpu