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
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.