KVM / Libvirt VmEventTrigger

KVM / Libvirt VmEventTrigger

Certified

Poll KVM domain state

Polling trigger that connects to libvirt on the given URI, reads a domain's state on each interval, and emits an execution with the name and current state. Logs and skips when lookup fails.

yaml
type: io.kestra.plugin.kvm.VmEventTrigger
yaml
id: monitor_kvm_vm
namespace: kvmtest.ssh

tasks:
  - id: alert
    type: io.kestra.plugin.core.log.Log
    message: |
        Name: {{ render(trigger.name | json) }}
        State: {{ render(trigger.state | json) }}

triggers:
  - id: watch_vm
    type: io.kestra.plugin.kvm.VmEventTrigger
    uri: qemu+ssh://root@167.99.104.163/system
    name: kestra-worker-nodes
    interval: PT1M
Installation

Our standard Docker images already include this plugin. If you use a -slim image or another setup, install it with the following command:

kestractl plugins get io.kestra.plugin:plugin-kvm --compatible-for $KESTRA_VERSION

For kestractl, use your Kestra version with --compatible-for, or specify an exact plugin version.

For Kestra CLI, replace LATEST with a specific version or version range to pin the plugin version.

Properties

Domain name

Name of the libvirt domain to monitor.

Defaultfalse

Specifies whether a trigger is allowed to start a new execution even if a previous run is still in progress.

DefaultPT1M
Formatduration

Poll interval

Time between state checks. Default PT1M.

SubTypestring
Possible Values
CREATEDSUBMITTEDRUNNINGPAUSEDRESTARTEDKILLINGSUCCESSWARNINGFAILEDKILLEDCANCELLEDQUEUEDRETRYINGRETRIEDSKIPPEDBREAKPOINTRESUBMITTED

List of execution states after which a trigger should be stopped (a.k.a. disabled).

Libvirt URI

Connection URI rendered before use; required to reach the hypervisor.

Defaulttrue

A condition that determines whether the trigger should run.

A Pebble expression evaluated at trigger time. The trigger fires only when the expression evaluates to a truthy value (true, a non-empty string, a non-zero number). Use this to gate trigger execution on dynamic runtime values such as execution labels, flow variables, or environment conditions.

VM Name

Monitored domain name.

VM State

Libvirt domain state at the time of polling.