
KVM / Libvirt UpdateVm
CertifiedUpdate KVM domain definition
KVM / Libvirt UpdateVm
Update KVM domain definition
Redefines a libvirt domain from rendered XML while preserving the existing UUID if missing in the template. Optionally restarts running or paused domains to apply changes when restart is true (default false).
type: io.kestra.plugin.kvm.UpdateVmExamples
id: update_kvm_vm_ssh
namespace: kvmtest.ssh
tasks:
- id: update_vm
type: io.kestra.plugin.kvm.UpdateVm
uri: qemu+ssh://root@167.99.104.163/system
# This is the standard Libvirt XML format
xmlDefinition: |
<domain type='kvm'>
<name>kestra-worker-nodes</name>
<memory unit='MiB'>700</memory>
<vcpu placement='static'>1</vcpu>
<os>
<type arch='x86_64' machine='pc-q35-6.2'>hvm</type>
<boot dev='hd'/>
</os>
<devices>
<disk type='volume' device='disk'>
<driver name='qemu' type='qcow2'/>
<source pool='default' volume='kestra-worker-nodes-os.qcow2'/>
<target dev='vda' bus='virtio'/>
</disk>
<disk type='volume' device='disk'>
<driver name='qemu' type='qcow2'/>
<source pool='default' volume='kestra-worker-nodes-data.qcow2'/>
<target dev='vdb' bus='virtio'/>
</disk>
</devices>
</domain>
# If true, it attempts to stop and start the VM to apply the changes
restart: true
- id: log_result
type: io.kestra.plugin.core.log.Log
message: |
VM Updated!
Name: {{outputs.update_vm.name}}
wasRestarted: {{ outputs.update_vm.wasRestarted }}
State: {{ outputs.update_vm.state }}
Properties
assets
Assets this task consumes as inputs or produces as outputs, for lineage tracking and the asset graph (Enterprise Edition). A flow declaring this property on a task is rejected in the open-source edition.
io.kestra.core.models.assets.AssetsDeclaration
IGNOREFAILWARNAsset failure behavior
Behavior applied to the task state when a declared asset fails to render, emit, or be persisted (e.g. a lock conflict): FAIL escalates it to FAILED, WARN (default) warns it if it would otherwise succeed, IGNORE leaves the state untouched.
Whether to auto-register assets referenced dynamically at runtime that are not statically declared in inputs or outputs.
The assets consumed as inputs.
io.kestra.core.models.assets.AssetIdentifier
1The assets produced as outputs.
io.kestra.plugin.ee.assets.Dataset
1150{}1150io.kestra.plugin.ee.assets.File
1150{}1150io.kestra.plugin.ee.assets.Table
1150{}1150io.kestra.plugin.ee.assets.VM
1150{}1150io.kestra.core.models.assets.External
1150{}1150io.kestra.core.models.assets.Custom
11501Custom asset type
{}1150name string
Domain name
Domain to redefine; should match the
restart booleanstring
falseRestart after update
If true, destroys then starts the domain when it is RUNNING or PAUSED to apply changes. Default false.
uri string
Libvirt URI
xmlDefinition string
Domain XML
Libvirt domain XML template rendered with flow variables before defineXML; UUID is injected when absent.
Outputs
name string
VM Name
Redefined domain name.
state string
VM State
Libvirt domain state after the update.
wasRestarted boolean
Restart performed
True when the domain was destroyed and started due to restart = true.