How to Configure Guest VM Shutdown Behavior
Overview
You can customize the libvirt-guests service’s behavior to choose how the guest virtual machines manage the shutdown requests received from the host server. For more information about the libvirt-guests service, read libvirt’s libvirt-guests documentation.
Configuration file and backup location
You can locate the libvirt-guests file in the following location:
| Operating System Type | File Path |
|---|---|
| Debian-Based OS | /etc/default/libvirt-guests |
| Non-Debian-Based OS | /etc/sysconfig/libvirt-guests |
If the configuration file already exists, the agent attempts to create a backup. View the following example:
/etc/default/libvirt-guests.solus.backup
If a backup file already exists, the agent does not overwrite the existing file.
How to customize shutdown behavior
You can customize the following variables:
| Variable | Description | Example |
|---|---|---|
ON_SHUTDOWN | The action taken on host shutdown. | ON_SHUTDOWN=shutdown |
PARALLEL_SHUTDOWN | The number of guests to shutdown in parallel. | PARALLEL_SHUTDOWN=5 |
SHUTDOWN_TIMEOUT | The amount of time to wait for guest VM shutdown, in seconds. | SHUTDOWN_TIMEOUT=200 |
The agent always writes the following variables and their set values. You cannot adjust them:
BYPASS_CACHE=0SYNC_TIME=1ON_BOOT=ignore
Important:
After you change the configuration, restart the SolusVM Agent service.
Example configuration file
# Managed by SolusVM
# ON_SHUTDOWN, PARALLEL_SHUTDOWN and SHUTDOWN_TIMEOUT can be changed in
# /etc/solus/agent.json with libvirt_guests_on_shutdown,
# libvirt_guests_parallel_shutdown and libvirt_guests_shutdown_timeout.
# Restart solus-agent.service to apply changes.
ON_SHUTDOWN=shutdown
PARALLEL_SHUTDOWN=5
SHUTDOWN_TIMEOUT=200
BYPASS_CACHE=0
SYNC_TIME=1
ON_BOOT=ignore