OCF_HEARTBEAT_VIRTUA(7)
π ocf_heartbeat_VirtualDomain(7) β the libvirt resource agent, explained π
okay so bestie, this is the man page for ocf_heartbeat_VirtualDomain, a.k.a. the VirtualDomain resource agent π β it lives in the OCF resource agents family and honestly it's kind of a big deal if you're running VMs in a cluster.
β¨ NAME β¨
ocf_heartbeat_VirtualDomain β manages virtual domains through the libvirt virtualization framework π¦
πΈ SYNOPSIS πΈ
VirtualDomain [start | stop | status | monitor | migrate_to |
migrate_from | meta-data | validate-all]
π DESCRIPTION π
so this is a resource agent for a virtual domain β and like, "virtual domain" can mean a domU, a virtual machine, a virtual environment, whatever your fave terminology is depending on context β the point is, it's managed by libvirtd π
and here's the cute part: this resource agent may be configured for native migration if that's available in your cluster manager. For Pacemaker specifically, the allow-migrate="true" meta attribute is what enables native migration. no cap, that's the switch π₯
π SUPPORTED PARAMETERS π
configβ absolute path to the libvirt configuration file for this virtual domain. It's unique, required, a string, and has no default β so like, you must give it πhypervisorβ hypervisor URI to connect to. Check the libvirt documentation for deets on supported URI formats bestie. The default is system dependent β you can figure out your system's default uri by runningvirsh --quiet uri. Optional, string, no default.force_stopβ always forcefully shut down ("destroy") the domain on stop. The default behavior is to resort to a forceful shutdown only after a graceful shutdown attempt has failed. Only set this to true if your virtual domain (or your virtualization backend) does not support graceful shutdown. Optional, boolean, default0.migration_transportβ the transport used to connect to the remote hypervisor while migrating. Refer to the libvirt documentation for details on which transports are available. If this parameter is omitted, the resource will use libvirt's default transport to connect to the remote hypervisor. Optional, string, no default.migration_userβ the username will be used in the remote libvirtremoteuri/migrateuri. No user will be given (which meansroot) in the username if omitted.
heads up: ifremoteuriis set,migration_userwill be ignored π
Optional, string, no default.
migration_downtimeβ define max downtime during live migration in milliseconds. Optional, integer, default0.migration_speedβ define live migration speed per resource in MiB/s. Optional, integer, default0.migration_network_suffixβ use a dedicated migration network π§. The migration URI is composed by adding this parameter's value to the end of the node name. If the node name happens to be an FQDN (as opposed to an unqualified host name), insert the suffix immediately prior to the first period (.) in the FQDN. At the moment Qemu/KVM and Xen migration via a dedicated network is supported. Note: be sure this composed host name is locally resolvable and the associated IP is reachable through the favored network. This suffix will be added to theremoteuriandmigrateuriparameters. See also themigrate_optionsparameter below β Optional, string, no default.migrateuriβ you can also specify here if the calculated migrate URI is unsuitable for your environment. Ifmigrateuriis set thenmigration_network_suffix,migrateportand--migrateuriinmigrate_optionsare effectively ignored. Use"%n"as the placeholder for the target node name. Please refer to the libvirt documentation for details on guest migration. Optional, string, no default.migrate_optionsβ extravirshoptions for the guest live migration. You can also specify here--migrateuriif the calculated migrate URI is unsuitable for your environment. If--migrateuriis set thenmigration_network_suffixandmigrateportare effectively ignored. Use"%n"as the placeholder for the target node name. Please refer to the libvirt documentation for details on guest migration. Optional, string, no default.monitor_scriptsβ to additionally monitor services within the virtual domain, add this parameter with a list of scripts to monitor. Note: when monitor scripts are used, thestartandmigrate_fromoperations will complete only when all monitor scripts have completed successfully. Be sure to set the timeout of these operations to accommodate this delay πβ³ Optional, string, no default.autoset_utilization_cpuβ if set true, the agent will detect the number of domainU's vCPUs fromvirsh, and put it into the CPU utilization of the resource when the monitor is executed. Optional, boolean, defaulttrue.autoset_utilization_host_memoryβ if set true, the agent will detect the number of Max memory fromvirsh, and put it into thehost_memoryutilization of the resource when the monitor is executed. Optional, boolean, defaulttrue.autoset_utilization_hv_memoryβ if set true, the agent will detect the number of Max memory fromvirsh, and put it into thehv_memoryutilization of the resource when the monitor is executed. Optional, boolean, defaulttrue.unset_utilization_cpuβ if set true then the agent will remove the cpu utilization resource when the monitor is executed. Optional, boolean, defaultfalse.unset_utilization_host_memoryβ if set true then the agent will remove thehost_memoryutilization resource when the monitor is executed. Optional, boolean, defaultfalse.unset_utilization_hv_memoryβ if set true then the agent will remove thehv_memoryutilization resource when the monitor is executed. Optional, boolean, defaultfalse.migrateportβ this port will be used in the qemu migrateuri. If unset, the port will be a random highport. Optional, integer, no default.remoteuriβ use this URI asvirshconnection URI to commuicate with a remote hypervisor. (yes, that's the original spelling, we keep it exactly π ) Ifremoteuriis set thenmigration_userandmigration_network_suffixare effectively ignored. Use"%n"as the placeholder for the target node name. Please refer to the libvirt documentation for details on guest migration. Optional, string, no default.save_config_on_stopβ changes to a running VM's config are normally lost on stop π. This parameter instructs the RA to save the configuration back to the xml file provided in the"config"parameter. Optional, boolean, no default.sync_config_on_stopβ setting this automatically enablessave_config_on_stop. When enabled this parameter instructs the RA to callcsync2 -xto synchronize the file to all nodes.csync2must be properly set up for this to work. Optional, boolean, no default.snapshotβ path to the snapshot directory where the virtual machine image will be stored. When this parameter is set, the virtual machine's RAM state will be saved to a file in the snapshot directory when stopped. If on start a state file is present for the domain, the domain will be restored to the same state it was in right before it stopped last. This option is incompatible with the'force_stop'option β οΈ. Optional, string, no default.backingfileβ when the VM is used in Copy-On-Write mode, this is the backing file to use (with its full path). The VM's image will be created based on this backing file. This backing file will never be changed during the life of the VM. Optional, string, no default.statelessβ if set to true andbackingfileis defined, the start of the VM will systematically create a new qcow2 based on the backing file, therefore the VM will always be stateless. If set to false, the start of the VM will use the COW (<vmname>.qcow2) file if it exists, otherwise the first start will create a new qcow2 based on the backing file given asbackingfile. Optional, boolean, defaultfalse.copyindirsβ list of directories for thevirt-copy-inbefore booting the VM. Used only in stateless mode. Optional, string, no default.shutdown_modeβvirsh shutdownmethod to use. Please verify that it is supported by yourvirshtoolsed with'virsh help shutdown'. When this parameter is set--mode shutdown_modeis passed as an additional argument to the'virsh shutdown'command. One can use this option in case default acpi method does not work. Verify that this mode is supported by your VM. By default--modeis not passed. Optional, string, no default.start_resourcesβ start the virtual storage pools and networks used by the virtual machine before starting it or before live migrating it. Optional, boolean, defaultfalse.
π¦ SUPPORTED ACTIONS π¦
this resource agent supports the following actions (operations), periodt:
startβ starts the resource. Suggested minimum timeout:90s.stopβ stops the resource. Suggested minimum timeout:90s.statusβ performs a status check. Suggested minimum timeout:30s. Suggested interval:10s.monitorβ performs a detailed status check. Suggested minimum timeout:30s. Suggested interval:10s.migrate_fromβ executes steps necessary for migrating the resource away from the node. Suggested minimum timeout:60s.migrate_toβ executes steps necessary for migrating the resource to the node. Suggested minimum timeout:120s.meta-dataβ retrieves resource agent metadata (internal use only). Suggested minimum timeout:5s.validate-allβ performs a validation of the resource configuration. Suggested minimum timeout:5s.
π EXAMPLE CRM SHELL π
here's an example config for a VirtualDomain resource using the crm(8) shell β iconic:
primitive p_VirtualDomain ocf:heartbeat:VirtualDomain \
params \
config=string \
meta allow-migrate="true" \
op monitor depth="0" timeout="30s" interval="10s"
π EXAMPLE PCS π
and here's the same vibe but for pcs(8):
pcs resource create p_VirtualDomain ocf:heartbeat:VirtualDomain \
config=string \
op monitor OCF_CHECK_LEVEL="0" timeout="30s" interval="10s"
β SEE ALSO β
π AUTHOR π
ClusterLabs contributors (see the resource agent source for information about individual authors) π«Ά
so that's the whole thing bestie, slay π
β¨ β this page came from resource-agents UNKNOWN, dated 10/01/2026, and yeah, that's the tea ππ
π¦ where this page comes from
- opensuse-leap 16.0: resource-agents 4.18.0+git105.9ea1183-160000.1.1 Β· GPL-2.0-only AND LGPL-2.1-or-later AND GPL-3.0-or-later
- opensuse-leap 16.0: resource-agents 4.18.0+git105.9ea1183-160000.1.1 Β· GPL-2.0-only AND LGPL-2.1-or-later AND GPL-3.0-or-later
- opensuse-leap 16.0: resource-agents 4.18.0+git105.9ea1183-160000.1.1 Β· GPL-2.0-only AND LGPL-2.1-or-later AND GPL-3.0-or-later
- opensuse-leap 16.0: resource-agents 4.18.0+git105.9ea1183-160000.1.1 Β· GPL-2.0-only AND LGPL-2.1-or-later AND GPL-3.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms