1OCF_HEARTBEAT_VIRTUA(7)       OCF resource agents      OCF_HEARTBEAT_VIRTUA(7)
2
3
4

NAME

6       ocf_heartbeat_VirtualDomain - Manages virtual domains through the
7       libvirt virtualization framework
8

SYNOPSIS

10       VirtualDomain [start | stop | status | monitor | migrate_to |
11                     migrate_from | meta-data | validate-all]
12

DESCRIPTION

14       Resource agent for a virtual domain (a.k.a. domU, virtual machine,
15       virtual environment etc., depending on context) managed by libvirtd.
16
17       This resource agent may be configured for native migration if available
18       in the cluster manager. For Pacemaker, the allow-migrate="true" meta
19       attribute enables native migration.
20

SUPPORTED PARAMETERS

22       config
23           Absolute path to the libvirt configuration file, for this virtual
24           domain.
25
26           (unique, required, string, no default)
27
28       hypervisor
29           Hypervisor URI to connect to. See the libvirt documentation for
30           details on supported URI formats. The default is system dependent.
31           Determine the system's default uri by running 'virsh --quiet uri'.
32
33           (optional, string, no default)
34
35       force_stop
36           Always forcefully shut down ("destroy") the domain on stop. The
37           default behavior is to resort to a forceful shutdown only after a
38           graceful shutdown attempt has failed. You should only set this to
39           true if your virtual domain (or your virtualization backend) does
40           not support graceful shutdown.
41
42           (optional, boolean, default 0)
43
44       migration_transport
45           Transport used to connect to the remote hypervisor while migrating.
46           Please refer to the libvirt documentation for details on transports
47           available. If this parameter is omitted, the resource will use
48           libvirt's default transport to connect to the remote hypervisor.
49
50           (optional, string, no default)
51
52       migration_user
53           The username will be used in the remote libvirt
54           remoteuri/migrateuri. No user will be given (which means root) in
55           the username if omitted
56
57           If remoteuri is set, migration_user will be ignored.
58
59           (optional, string, no default)
60
61       migration_downtime
62           Define max downtime during live migration in milliseconds
63
64           (optional, integer, default 0)
65
66       migration_speed
67           Define live migration speed per resource in MiB/s
68
69           (optional, integer, default 0)
70
71       migration_network_suffix
72           Use a dedicated migration network. The migration URI is composed by
73           adding this parameters value to the end of the node name. If the
74           node name happens to be an FQDN (as opposed to an unqualified host
75           name), insert the suffix immediately prior to the first period (.)
76           in the FQDN. At the moment Qemu/KVM and Xen migration via a
77           dedicated network is supported.
78
79           Note: Be sure this composed host name is locally resolvable and the
80           associated IP is reachable through the favored network. This suffix
81           will be added to the remoteuri and migrateuri parameters.
82
83           See also the migrate_options parameter below.
84
85           (optional, string, no default)
86
87       migrateuri
88           You can also specify here if the calculated migrate URI is
89           unsuitable for your environment.
90
91           If migrateuri is set then migration_network_suffix, migrateport and
92
93           --migrateuri in migrate_options are effectively ignored. Use "%n"
94           as the placeholder for the target node name.
95
96           Please refer to the libvirt documentation for details on guest
97           migration.
98
99           (optional, string, no default)
100
101       migrate_options
102           Extra virsh options for the guest live migration. You can also
103           specify here --migrateuri if the calculated migrate URI is
104           unsuitable for your environment. If --migrateuri is set then
105           migration_network_suffix and migrateport are effectively ignored.
106           Use "%n" as the placeholder for the target node name.
107
108           Please refer to the libvirt documentation for details on guest
109           migration.
110
111           (optional, string, no default)
112
113       monitor_scripts
114           To additionally monitor services within the virtual domain, add
115           this parameter with a list of scripts to monitor.
116
117           Note: when monitor scripts are used, the start and migrate_from
118           operations will complete only when all monitor scripts have
119           completed successfully. Be sure to set the timeout of these
120           operations to accommodate this delay.
121
122           (optional, string, no default)
123
124       autoset_utilization_cpu
125           If set true, the agent will detect the number of domainU's vCPUs
126           from virsh, and put it into the CPU utilization of the resource
127           when the monitor is executed.
128
129           (optional, boolean, default true)
130
131       autoset_utilization_hv_memory
132           If set true, the agent will detect the number of *Max memory* from
133           virsh, and put it into the hv_memory utilization of the resource
134           when the monitor is executed.
135
136           (optional, boolean, default true)
137
138       migrateport
139           This port will be used in the qemu migrateuri. If unset, the port
140           will be a random highport.
141
142           (optional, integer, no default)
143
144       remoteuri
145           Use this URI as virsh connection URI to commuicate with a remote
146           hypervisor.
147
148           If remoteuri is set then migration_user and
149           migration_network_suffix are effectively ignored. Use "%n" as the
150           placeholder for the target node name.
151
152           Please refer to the libvirt documentation for details on guest
153           migration.
154
155           (optional, string, no default)
156
157       save_config_on_stop
158           Changes to a running VM's config are normally lost on stop. This
159           parameter instructs the RA to save the configuration back to the
160           xml file provided in the "config" parameter.
161
162           (optional, boolean, no default)
163
164       sync_config_on_stop
165           Setting this automatically enables save_config_on_stop. When
166           enabled this parameter instructs the RA to call csync2 -x to
167           synchronize the file to all nodes. csync2 must be properly set up
168           for this to work.
169
170           (optional, boolean, no default)
171
172       snapshot
173           Path to the snapshot directory where the virtual machine image will
174           be stored. When this parameter is set, the virtual machine's RAM
175           state will be saved to a file in the snapshot directory when
176           stopped. If on start a state file is present for the domain, the
177           domain will be restored to the same state it was in right before it
178           stopped last. This option is incompatible with the 'force_stop'
179           option.
180
181           (optional, string, no default)
182
183       backingfile
184           When the VM is used in Copy-On-Write mode, this is the backing file
185           to use (with its full path). The VMs image will be created based on
186           this backing file. This backing file will never be changed during
187           the life of the VM.
188
189           (optional, string, no default)
190
191       stateless
192           If set to true and backingfile is defined, the start of the VM will
193           systematically create a new qcow2 based on the backing file,
194           therefore the VM will always be stateless. If set to false, the
195           start of the VM will use the COW (<vmname>.qcow2) file if it
196           exists, otherwise the first start will create a new qcow2 based on
197           the backing file given as backingfile.
198
199           (optional, boolean, default false)
200
201       copyindirs
202           List of directories for the virt-copy-in before booting the VM.
203           Used only in stateless mode.
204
205           (optional, string, no default)
206
207       shutdown_mode
208           virsh shutdown method to use. Please verify that it is supported by
209           your virsh toolsed with 'virsh help shutdown' When this parameter
210           is set --mode shutdown_mode is passed as an additional argument to
211           the 'virsh shutdown' command. One can use this option in case
212           default acpi method does not work. Verify that this mode is
213           supported by your VM. By default --mode is not passed.
214
215           (optional, string, no default)
216

SUPPORTED ACTIONS

218       This resource agent supports the following actions (operations):
219
220       start
221           Starts the resource. Suggested minimum timeout: 90s.
222
223       stop
224           Stops the resource. Suggested minimum timeout: 90s.
225
226       status
227           Performs a status check. Suggested minimum timeout: 30s. Suggested
228           interval: 10s.
229
230       monitor
231           Performs a detailed status check. Suggested minimum timeout: 30s.
232           Suggested interval: 10s.
233
234       migrate_from
235           Executes steps necessary for migrating the resource away from the
236           node. Suggested minimum timeout: 60s.
237
238       migrate_to
239           Executes steps necessary for migrating the resource to the node.
240           Suggested minimum timeout: 120s.
241
242       meta-data
243           Retrieves resource agent metadata (internal use only). Suggested
244           minimum timeout: 5s.
245
246       validate-all
247           Performs a validation of the resource configuration. Suggested
248           minimum timeout: 5s.
249

EXAMPLE CRM SHELL

251       The following is an example configuration for a VirtualDomain resource
252       using the crm(8) shell:
253
254           primitive p_VirtualDomain ocf:heartbeat:VirtualDomain \
255             params \
256               config=string \
257             meta allow-migrate="true" \
258             op monitor depth="0" timeout="30s" interval="10s"
259

EXAMPLE PCS

261       The following is an example configuration for a VirtualDomain resource
262       using pcs(8)
263
264           pcs resource create p_VirtualDomain ocf:heartbeat:VirtualDomain \
265             config=string \
266             op monitor OCF_CHECK_LEVEL="0" timeout="30s" interval="10s"
267

SEE ALSO

269       http://clusterlabs.org/
270

AUTHOR

272       ClusterLabs contributors (see the resource agent source for information
273       about individual authors)
274
275
276
277resource-agents UNKNOWN           03/25/2021           OCF_HEARTBEAT_VIRTUA(7)
Impressum