'\" t
.\" Title: ocf_heartbeat_VirtualDomain
.\" Author: ClusterLabs contributors (see the resource agent source for information about individual authors)
.\" Generator: DocBook XSL Stylesheets vsnapshot
.\" Date: 03/13/2024
.\" Manual: OCF resource agents
.\" Source: resource-agents 4.13.0-1+b1
.\" Language: English
.\"
.TH "OCF_HEARTBEAT_VIRTUA" "7" "03/13/2024" "resource-agents 4.13.0-1+b1" "OCF resource agents"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.\" http://bugs.debian.org/507673
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.SH "NAME"
ocf_heartbeat_VirtualDomain \- Manages virtual domains through the libvirt virtualization framework
.SH "SYNOPSIS"
.HP \w'\fBVirtualDomain\fR\ 'u
\fBVirtualDomain\fR [start | stop | status | monitor | migrate_to | migrate_from | meta\-data | validate\-all]
.SH "DESCRIPTION"
.PP
Resource agent for a virtual domain (a\&.k\&.a\&. domU, virtual machine, virtual environment etc\&., depending on context) managed by libvirtd\&.
.PP
This resource agent may be configured for
\fInative migration\fR
if available in the cluster manager\&. For Pacemaker, the
\fIallow\-migrate="true"\fR
meta attribute enables native migration\&.
.SH "SUPPORTED PARAMETERS"
.PP
\fBconfig\fR
.RS 4
Absolute path to the libvirt configuration file, for this virtual domain\&.
.sp
(unique, required, string, no default)
.RE
.PP
\fBhypervisor\fR
.RS 4
Hypervisor URI to connect to\&. See the libvirt documentation for details on supported URI formats\&. The default is system dependent\&. Determine the system\*(Aqs default uri by running \*(Aqvirsh \-\-quiet uri\*(Aq\&.
.sp
(optional, string, no default)
.RE
.PP
\fBforce_stop\fR
.RS 4
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\&. You should only set this to true if your virtual domain (or your virtualization backend) does not support graceful shutdown\&.
.sp
(optional, boolean, default
0)
.RE
.PP
\fBmigration_transport\fR
.RS 4
Transport used to connect to the remote hypervisor while migrating\&. Please refer to the libvirt documentation for details on transports available\&. If this parameter is omitted, the resource will use libvirt\*(Aqs default transport to connect to the remote hypervisor\&.
.sp
(optional, string, no default)
.RE
.PP
\fBmigration_user\fR
.RS 4
The username will be used in the remote libvirt remoteuri/migrateuri\&. No user will be given (which means root) in the username if omitted
.sp
If remoteuri is set, migration_user will be ignored\&.
.sp
(optional, string, no default)
.RE
.PP
\fBmigration_downtime\fR
.RS 4
Define max downtime during live migration in milliseconds
.sp
(optional, integer, default
0)
.RE
.PP
\fBmigration_speed\fR
.RS 4
Define live migration speed per resource in MiB/s
.sp
(optional, integer, default
0)
.RE
.PP
\fBmigration_network_suffix\fR
.RS 4
Use a dedicated migration network\&. The migration URI is composed by adding this parameters 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\&.
.sp
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 the remoteuri and migrateuri parameters\&.
.sp
See also the migrate_options parameter below\&.
.sp
(optional, string, no default)
.RE
.PP
\fBmigrateuri\fR
.RS 4
You can also specify here if the calculated migrate URI is unsuitable for your environment\&.
.sp
If migrateuri is set then migration_network_suffix, migrateport and
.sp
\-\-migrateuri in migrate_options are effectively ignored\&. Use "%n" as the placeholder for the target node name\&.
.sp
Please refer to the libvirt documentation for details on guest migration\&.
.sp
(optional, string, no default)
.RE
.PP
\fBmigrate_options\fR
.RS 4
Extra virsh options for the guest live migration\&. You can also specify here \-\-migrateuri if the calculated migrate URI is unsuitable for your environment\&. If \-\-migrateuri is set then migration_network_suffix and migrateport are effectively ignored\&. Use "%n" as the placeholder for the target node name\&.
.sp
Please refer to the libvirt documentation for details on guest migration\&.
.sp
(optional, string, no default)
.RE
.PP
\fBmonitor_scripts\fR
.RS 4
To additionally monitor services within the virtual domain, add this parameter with a list of scripts to monitor\&.
.sp
Note: when monitor scripts are used, the start and migrate_from operations will complete only when all monitor scripts have completed successfully\&. Be sure to set the timeout of these operations to accommodate this delay\&.
.sp
(optional, string, no default)
.RE
.PP
\fBautoset_utilization_cpu\fR
.RS 4
If set true, the agent will detect the number of domainU\*(Aqs vCPUs from virsh, and put it into the CPU utilization of the resource when the monitor is executed\&.
.sp
(optional, boolean, default
true)
.RE
.PP
\fBautoset_utilization_host_memory\fR
.RS 4
If set true, the agent will detect the number of *Max memory* from virsh, and put it into the host_memory utilization of the resource when the monitor is executed\&.
.sp
(optional, boolean, default
true)
.RE
.PP
\fBautoset_utilization_hv_memory\fR
.RS 4
If set true, the agent will detect the number of *Max memory* from virsh, and put it into the hv_memory utilization of the resource when the monitor is executed\&.
.sp
(optional, boolean, default
true)
.RE
.PP
\fBunset_utilization_cpu\fR
.RS 4
If set true then the agent will remove the cpu utilization resource when the monitor is executed\&.
.sp
(optional, boolean, default
false)
.RE
.PP
\fBunset_utilization_host_memory\fR
.RS 4
If set true then the agent will remove the host_memory utilization resource when the monitor is executed\&.
.sp
(optional, boolean, default
false)
.RE
.PP
\fBunset_utilization_hv_memory\fR
.RS 4
If set true then the agent will remove the hv_memory utilization resource when the monitor is executed\&.
.sp
(optional, boolean, default
false)
.RE
.PP
\fBmigrateport\fR
.RS 4
This port will be used in the qemu migrateuri\&. If unset, the port will be a random highport\&.
.sp
(optional, integer, no default)
.RE
.PP
\fBremoteuri\fR
.RS 4
Use this URI as virsh connection URI to commuicate with a remote hypervisor\&.
.sp
If remoteuri is set then migration_user and migration_network_suffix are effectively ignored\&. Use "%n" as the placeholder for the target node name\&.
.sp
Please refer to the libvirt documentation for details on guest migration\&.
.sp
(optional, string, no default)
.RE
.PP
\fBsave_config_on_stop\fR
.RS 4
Changes to a running VM\*(Aqs 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\&.
.sp
(optional, boolean, no default)
.RE
.PP
\fBsync_config_on_stop\fR
.RS 4
Setting this automatically enables save_config_on_stop\&. When enabled this parameter instructs the RA to call csync2 \-x to synchronize the file to all nodes\&. csync2 must be properly set up for this to work\&.
.sp
(optional, boolean, no default)
.RE
.PP
\fBsnapshot\fR
.RS 4
Path to the snapshot directory where the virtual machine image will be stored\&. When this parameter is set, the virtual machine\*(Aqs 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 \*(Aqforce_stop\*(Aq option\&.
.sp
(optional, string, no default)
.RE
.PP
\fBbackingfile\fR
.RS 4
When the VM is used in Copy\-On\-Write mode, this is the backing file to use (with its full path)\&. The VMs image will be created based on this backing file\&. This backing file will never be changed during the life of the VM\&.
.sp
(optional, string, no default)
.RE
.PP
\fBstateless\fR
.RS 4
If set to true and backingfile is 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 (\&.qcow2) file if it exists, otherwise the first start will create a new qcow2 based on the backing file given as backingfile\&.
.sp
(optional, boolean, default
false)
.RE
.PP
\fBcopyindirs\fR
.RS 4
List of directories for the virt\-copy\-in before booting the VM\&. Used only in stateless mode\&.
.sp
(optional, string, no default)
.RE
.PP
\fBshutdown_mode\fR
.RS 4
virsh shutdown method to use\&. Please verify that it is supported by your virsh toolsed with \*(Aqvirsh help shutdown\*(Aq When this parameter is set \-\-mode shutdown_mode is passed as an additional argument to the \*(Aqvirsh shutdown\*(Aq 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 \-\-mode is not passed\&.
.sp
(optional, string, no default)
.RE
.PP
\fBstart_resources\fR
.RS 4
Start the virtual storage pools and networks used by the virtual machine before starting it or before live migrating it\&.
.sp
(optional, boolean, default
false)
.RE
.SH "SUPPORTED ACTIONS"
.PP
This resource agent supports the following actions (operations):
.PP
\fBstart\fR
.RS 4
Starts the resource\&. Suggested minimum timeout: 90s\&.
.RE
.PP
\fBstop\fR
.RS 4
Stops the resource\&. Suggested minimum timeout: 90s\&.
.RE
.PP
\fBstatus\fR
.RS 4
Performs a status check\&. Suggested minimum timeout: 30s\&. Suggested interval: 10s\&.
.RE
.PP
\fBmonitor\fR
.RS 4
Performs a detailed status check\&. Suggested minimum timeout: 30s\&. Suggested interval: 10s\&.
.RE
.PP
\fBmigrate_from\fR
.RS 4
Executes steps necessary for migrating the resource
\fIaway from\fR
the node\&. Suggested minimum timeout: 60s\&.
.RE
.PP
\fBmigrate_to\fR
.RS 4
Executes steps necessary for migrating the resource
\fIto\fR
the node\&. Suggested minimum timeout: 120s\&.
.RE
.PP
\fBmeta\-data\fR
.RS 4
Retrieves resource agent metadata (internal use only)\&. Suggested minimum timeout: 5s\&.
.RE
.PP
\fBvalidate\-all\fR
.RS 4
Performs a validation of the resource configuration\&. Suggested minimum timeout: 5s\&.
.RE
.SH "EXAMPLE CRM SHELL"
.PP
The following is an example configuration for a VirtualDomain resource using the
\fBcrm\fR(8)
shell:
.sp
.if n \{\
.RS 4
.\}
.nf
primitive p_VirtualDomain ocf:heartbeat:VirtualDomain \e
params \e
config=\fIstring\fR \e
meta allow\-migrate="true" \e
op monitor depth="0" timeout="30s" interval="10s"
.fi
.if n \{\
.RE
.\}
.SH "EXAMPLE PCS"
.PP
The following is an example configuration for a VirtualDomain resource using
\fBpcs\fR(8)
.sp
.if n \{\
.RS 4
.\}
.nf
pcs resource create p_VirtualDomain ocf:heartbeat:VirtualDomain \e
config=\fIstring\fR \e
op monitor OCF_CHECK_LEVEL="0" timeout="30s" interval="10s"
.fi
.if n \{\
.RE
.\}
.SH "SEE ALSO"
.PP
\m[blue]\fB\%http://clusterlabs.org/\fR\m[]
.SH "AUTHOR"
.PP
\fBClusterLabs contributors (see the resource agent source for information about individual authors)\fR