Virtual Watchdog

Overview

The new virtual watchdog timer (vWDT) is a new virtual device introduced in vSphere 7. It enables developers and administrators to have a standard way to know whether the guest operating system (OS) and applications, running inside a virtual machine, have crashed. It is an important function for clustered applications to gain high availability. In this blog post we will introduce the virtual watchdog timer, and discuss how to configure it in vSphere 7.

A watchdog timer helps the operating system or application to recover from crashes by powering off or resetting the server if the watchdog timer has not been reset by the OS within the programmed time. When workloads run on vSphere, the virtual equivalent of the watchdog timer helps the guest OS to achieve the same goal. It does so by resetting the virtual machine if the guest OS stops responding and cannot recover on its own due insuperable operating system or application faults.

This means that if the guest operating system stops responding and cannot recover on its own due insuperable operating system or application faults, the virtual watchdog timer is not reset within the allocated time. When this happens, an virtual machine reset is issued. When the system in the virtual machine is booted again, the watchdog timer helps the guest OS to understand if the restart was caused by a crash.

The virtual watchdog device is provided by vSphere, but is configured by the guest OS. It is exposed to the guest OS through BIOS/EFI ACPI tables.

Virtual Watchdog Timer Specifications

The Watchdog Resource Table (WDRT) feature provides addresses of the following registers on the device along with information such as the maximum timer value, timer resolution and other vendor/device information which the guest OS can use to configure and operate the device. Typically, modern guest operating systems use the Watchdog Action Table (WDAT) integration. WDAT describes an abstract device and provides information such as the instructions that it offers (see below), minimum and maximum count value, timer resolution, some flags and other vendor/device information. The Guest OS uses this information to configure and operate the watchdog device.

WDAT instructions:

  • WATCHDOG_ACTION_RESET
  • WATCHDOG_ACTION_QUERY_CURRENT_COUNTDOWN_PERIOD
  • WATCHDOG_ACTION_QUERY_COUNTDOWN_PERIOD
  • WATCHDOG_ACTION_SET_COUNTDOWN_PERIOD
  • WATCHDOG_ACTION_QUERY_RUNNING_STATE
  • WATCHDOG_ACTION_SET_RUNNING_STATE
  • WATCHDOG_ACTION_QUERY_STOPPED_STATE
  • WATCHDOG_ACTION_SET_STOPPED_STATE
  • WATCHDOG_ACTION_QUERY_REBOOT
  • WATCHDOG_ACTION_SET_REBOOT
  • WATCHDOG_ACTION_QUERY_SHUTDOWN
  • WATCHDOG_ACTION_SET_SHUTDOWN
  • WATCHDOG_ACTION_QUERY_WATCHDOG_STATUS
  • WATCHDOG_ACTION_SET_WATCHDOG_STATUS

Guest OS Support

Modern server operating systems include support for watchdog timers. No additional VMware drivers are necessary on both Windows and Linux operating systems. Additional configuration may be required depending on the used guest OS. Other operating systems like FreeBSD of Mac OS X do not support a watchdog timer.

  • Windows 2003 supports a Watchdog Resource Table (WDRT)
  • Windows 2008 and later supports Watchdog Action Table (WDAT).
    • The guest OST does not require additional configurations.
  • Linux distributions, like Ubuntu 18.04 and Red Hat Enterprise Linux 7.6, based on 4.9 or later kernel support Watchdog Action Table (WDAT).
    • Verify if the wdat_wdt.ko driver is available.

How to Configure

The goal is to provide a watchdog timer that allows the guest OS to use it without the need for additional drivers. To configure a virtual machine to use a virtual watchdog timer, VM hardware version 17 (introduced with vSphere 7) and a guest operating system that supports watchdog timer devices are required.

 

Start with BIOS/EFI boot

You can enable the virtual watchdog timer to start either by the guest OS, or by the BIOS or EFI firmware. If you chose the virtual watchdog device to start by the BIOS or EFI firmware, it starts before the guest operating system boots. Be sure you meet the requirements. If the guest OS does not support watchdog devices, then virtual machine will be constantly rebooted by the watchdog device.

Verification

The vSphere Client provides information if the virtual watchdog timer is running on the virtual machine.

To Conclude

The virtual Watchdog device capability in vSphere 7 is a great addition for VI admins and developers to understand the status of their clustered applications running on vSphere.

Filter Tags

Automation Application Acceleration vSphere 7 Document Technical Overview Intermediate Deploy