Graceful instance shutdown

Available since MOSK 24.3

Management of compute node reboots is an important Day 2 operation. Before shutting down a host, guest instances must either be migrated to other compute nodes or gracefully powered off. This ensures the integrity of disk filesystems and prevents damage to running applications.

MOSK provides the capability to automatically power off the instances during the compute node shutdown or reboot through the ACPI power event.

Graceful instance shutdown is managed using the systemd inhibit tool. When the nova-compute service starts, it creates locks. For example:

systemd-inhibit --list

Example system response:

WHO                   UID USER PID   COMM     WHAT     WHY                                    MODE
Nova Shutdown Handler 0   root 28927 python3  shutdown Handle events on shutdown notification delay

The process runs in the nova-compute-inhibit-lock container within the nova-compute pod. It intercepts systemd power event and starts graceful guest shutdown. When all guest instances are powered off, the inhibit lock is released.

To initiate a proper shutdown, use the following commands: systemctl shutdown and systemctl reboot.