summaryrefslogtreecommitdiffstats
path: root/scripts/libvirt
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 06:48:59 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 06:48:59 +0000
commitd835b2cae8abc71958b69362162e6a70c3d7ef63 (patch)
tree81052e3d2ce3e1bcda085f73d925e9d6257dec15 /scripts/libvirt
parentInitial commit. (diff)
downloadcrmsh-upstream.tar.xz
crmsh-upstream.zip
Adding upstream version 4.6.0.upstream/4.6.0upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'scripts/libvirt')
-rw-r--r--scripts/libvirt/main.yml66
1 files changed, 66 insertions, 0 deletions
diff --git a/scripts/libvirt/main.yml b/scripts/libvirt/main.yml
new file mode 100644
index 0000000..d982d9f
--- /dev/null
+++ b/scripts/libvirt/main.yml
@@ -0,0 +1,66 @@
+# Copyright (C) 2015 Kristoffer Gronlund
+#
+# License: GNU General Public License (GPL)
+version: 2.2
+shortdesc: STONITH for libvirt (kvm / Xen)
+longdesc: >
+ Uses libvirt as a STONITH device to fence a guest node.
+ Create a separate resource for each guest node in the cluster.
+
+ Note that the recommended fencing mechanism is SBD whenever
+ a shared storage device (like a SAN) is available.
+category: Stonith
+parameters:
+ - name: id
+ shortdesc: Resource ID (Name)
+ example: stonith-libvirt
+ required: true
+ type: resource
+ - name: target
+ shortdesc: Node to Manage With STONITH Device
+ type: resource
+ required: true
+ - name: hostlist
+ shortdesc: "List of controlled hosts: hostname[:domain_id].."
+ longdesc: >
+ The optional domain_id defaults to the hostname.
+ type: string
+ required: true
+ - name: hypervisor_uri
+ longdesc: >
+ URI for connection to the hypervisor.
+ driver[+transport]://[username@][hostlist][:port]/[path][?extraparameters]
+ e.g.
+ qemu+ssh://my_kvm_server.mydomain.my/system (uses ssh for root)
+ xen://my_kvm_server.mydomain.my/ (uses TLS for client)
+
+ virsh must be installed (e.g. libvirt-client package) and access control must
+ be configured for your selected URI.
+ example: qemu+ssh://my_kvm_server.example.com/system
+ required: true
+ - name: reset_method
+ required: false
+ example: power_cycle
+ type: string
+ shortdesc: Guest Reset Method
+ longdesc: >
+ A guest reset may be done by a sequence of off and on commands
+ (power_cycle) or by the reboot command. Which method works
+ depend on the hypervisor and guest configuration management.
+ - name: install
+ shortdesc: Enable to Install Required Packages
+ type: boolean
+ required: false
+ value: false
+actions:
+ - install: cluster-glue libvirt-client
+ nodes: all
+ when: install
+ - cib: |
+ primitive {{id}}-{{target}} stonith:external/libvirt
+ params
+ hostlist="{{hostlist}}"
+ hypervisor_uri="{{hypervisor_uri}}"
+ {{#reset_method}}reset_method="{{reset_method}}"{{/reset_method}}
+ op start timeout=60s
+ location l-{{id}}-{{target}} {{id}}-{{target}} -inf: {{target}}