When starting a RHEL Linux virtual machine, you see the message: Cannot setup NMI watchdog on CPU (2031297)
Symptoms
•When booting a RHEL virtual machine running with any hardware version, you see these messages echoed to the console:
Cannot setup NMI watchdog on CPU 0
Cannot setup NMI watchdog on CPU 1
Cannot setup NMI watchdog on CPU 2
Cannot setup NMI watchdog on CPU 3
Cause
This issue occurs because some Linux operating systems, by default, enable support for Non Maskable Interrupt (NMI). It is a hardware dependent watchdog service which monitors the system hardware for failures. NMIs are generated periodically by system hardware to report the status to the NMI watchdog service. If the Linux kernel handler does not detect a certain NMI count in a specific period of time, it decides that the system has failed. This technology is similar to VMware Tools heartbeats for Virtual Machine monitoring in HA, except NMI runs at the kernel level whereas VMware Tools heartbeats run inside a guest operating system process.
Not all hardware support NMI. This issue is seen to occur with the latest virtual machine hardware version 8 and has been reproduced with version 7 also.
vCPUs presented to the guest operating system cannot have NMI enabled on them because they are abstracted representations of the host’s physical CPU cores.
Resolution
To resolve this issue, disable NMI if it has been enabled in the guest by default.
To disable NMI:
1.Open a vSphere console or SSH session to the Linux virtual machine.
2.Run this command inside a terminal:
vi /boot/grub/menu.lst
Note : /boot/grub/menu.lst may be a symbolic link to /boot/grub/grub.conf.
3.At the end of the kernel line, change the parameter value for nmi_watchdog from 1 to 0 (in some cases from 2 to 0).
For example: t itle Red Hat Enterprise Linux Server (2.6.18-128.el5)
root (hd0,0)
kernel /vmlinuz-2.6.18-128.el5 ro root=/dev/sda nmi_watchdog=0
initrd /initrd-2.6.18-128.el5.img
4.Save the configuration file changes using :wq. For more information, see Editing files on an ESX host using vi or nano (1020302).
5.Reboot the virtual machine.
The NMI watchdog has now been disabled and boot time messages should not be observed.
sample here:
# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE: You have a /boot partition. This means that
# all kernel and initrd paths are relative to /boot/, eg.
# root (hd0,0)
# kernel /vmlinuz-version ro root=/dev/sda3
# initrd /initrd-version.img
#boot=/dev/sda
default=0
timeout=5
splashimage=(hd0,0)/grub/splash.xpm.gz
hiddenmenu
password –md5 $1$eT3WNlvO$kv1LFclR2pVbabLX.F8JC.
title Red Hat Enterprise Linux Server (2.6.18-348.el5)
root (hd0,0)
kernel /vmlinuz-2.6.18-348.el5 ro root=LABEL=/ nmi_watchdog=0 rhgb quiet
initrd /initrd-2.6.18-348.el5.img
If NMI style guest monitoring is desired, customers can utilize the VMware Tools heartbeat in HA settings under VM monitoring
To enable VM Monitoring: 1.Choose the cluster and click Edit Settings.
2.Select VM Monitoring.
3.Select VM Monitoring Onlyfrom the dropdown
4.Under Virtual Machine Settings:
5.a.Select the virtual machine to monitor.
b.From the dropdown, select the appropriate settings for your environment. For more information, see:
•vCenter Server 4.x – VM Monitoring
•vCenter Server 5.x – VM and Application Monitoring
c.Click OK.