fence_virt.conf(5)
π fence_virt.conf(5) β the group chat guide to your fencing config π
okay so bestie, welcome to the File Formats Manual page for fence_virt.conf(5). this is THE file. the one that tells fence_virtd how to live its life. let's get into it π«Ά
β¨ NAME β¨
fence_virt.conf β the configuration file for fence_virtd. that's it, that's the name, periodt π
πΈ DESCRIPTION πΈ
the fence_virt.conf file holds all the configuration tea for fence_virtd, which is a fencing request routing daemon for clusters of virtual machines. yes, a daemon. very main character energy π₯
the file is tree-structured. there are parent/child relationships and sibling relationships between the nodes. think of it like a family group chat where everyone's related somehow:
foo {
bar {
baz = "1";
}
}
there are three primary sections of fence_virt.conf.
(not me counting four sections listed right below this line π we're keeping it exactly as written, bestie, no notes)
π SECTIONS π
π§ fence_virtd
this section is the global info about how fence_virtd is supposed to operate. the most important pieces of information are, as follows:
listenerβ the listener plugin for receiving fencing requests from clientsbackendβ the plugin to be used to carry out fencing requestsforegroundβ do not fork into the background.wait_for_initβ wait for the frontend and backends to become available rather than giving up immediately. this replaceswait_for_backendin0.2.x.module_pathβ the module path to search for plugins
π¦ listeners
this section contains listener-specific configuration information; see the section about listeners below. iykyk β¨
π backends
this section contains listener-specific configuration information; see the section about listeners below.
yes bestie, that's genuinely what it says π we are not fixing it, we are not touching it, we are simply reporting it with love.
π groups
this section contains static maps of which virtual machines may fence which other virtual machines; see the section about groups below.
β LISTENERS β
there are various listeners available for fence_virtd, and each one handles decoding and authentication of a given fencing request. the following configuration blocks belong in the listeners section of fence_virt.conf.
π‘ multicast
key_fileβ the shared key file to use (default:/etc/cluster/fence_xvm.key).hashβ the weakest hashing algorithm allowed for client requests. clients may send packets with stronger hashes than the one specified, but not weaker ones. (default:sha256, but could besha1,sha512, ornone)authβ the hashing algorithm to use for the simplistic challenge-response authentication (default:sha256, but could besha1,sha512, ornone)familyβ the IP family to use (default:ipv4, but may beipv6)addressβ the multicast address to listen on (default:225.0.0.12)portβ the multicast port to listen on (default:1229)interfaceβ interface to listen on. by default,fence_virtdlistens on all interfaces. however, this causes problems in some environments where the host computer is used as a gateway. π
π serial
the serial listener plugin utilizes libvirt's serial (or VMChannel) mapping to listen for requests. when using the serial listener, it is necessary to add a serial port (preferably pointing to /dev/ttyS1) or a channel (preferably pointing to 10.0.2.179:1229) to the libvirt domain description.
β οΈ note that only typeunix, modebindserial ports and channels are supported, and each VM should have a separate unique socket. no sharing, bestie, that's not the vibe.
example libvirt XML:
<serial type='unix'>
<source mode='bind' path='/sandbox/guests/fence_socket_molly'/>
<target port='1'/>
</serial>
<channel type='unix'>
<source mode='bind' path='/sandbox/guests/fence_molly_vmchannel'/>
<target type='guestfwd' address='10.0.2.179' port='1229'/>
</channel>
uriβ the URI to use when connecting to libvirt by the serial plugin (optional).pathβ the same directory that is defined for the domain serial port path (from example above:/sandbox/guests). sockets must reside in this directory in order to be considered valid. this can be used to preventfence_virtdfrom using the wrong sockets. π―modeβ this selects the type of sockets to register. valid values are"serial"(default) and"vmchannel".
π tcp
the tcp listener operates similarly to the multicast listener but uses TCP sockets for communication instead of using multicast packets.
key_fileβ the shared key file to use (default:/etc/cluster/fence_xvm.key).hashβ the hashing algorithm to use for packet signing (default:sha256, but could besha1,sha512, ornone)authβ the hashing algorithm to use for the simplistic challenge-response authentication (default:sha256, but could besha1,sha512, ornone)familyβ the IP family to use (default:ipv4, but may beipv6)addressβ the IP address to listen on (default:127.0.0.1for IPv4,::1for IPv6)portβ the TCP port to listen on (default:1229)
π§΅ vsock
the vsock listener operates similarly to the multicast listener but uses virtual machine sockets (AF_VSOCK) for communication instead of using multicast packets.
key_fileβ the shared key file to use (default:/etc/cluster/fence_xvm.key).hashβ the hashing algorithm to use for packet signing (default:sha256, but could besha1,sha512, ornone)authβ the hashing algorithm to use for the simplistic challenge-response authentication (default:sha256, but could besha1,sha512, ornone)portβ the vsock port to listen on (default:1229)
π BACKENDS π
there are various backends available for fence_virtd, and each one handles routing a fencing request to a hypervisor or management tool. the following configuration blocks belong in the backends section of fence_virt.conf.
π«Ά libvirt
the libvirt plugin is the simplest plugin. it's used in environments where routing fencing requests between multiple hosts is not required β for example, by a user running a cluster of virtual machines on a single desktop computer. cute, cozy, single-machine vibes π
uriβ the URI to use when connecting to libvirt.- all libvirt URIs are accepted and passed as-is.
- see
https://libvirt.org/uri.html#remote-urisfor examples. - NOTE: when VMs are run as non-root user the socket path must be set as part of the URI.
- example:
qemu:///session?socket=/run/user/<UID>/libvirt/virtqemud-sock
π cpg
the cpg plugin uses corosync CPG and libvirt to track virtual machines and route fencing requests to the appropriate computer.
uriβ the URI to use when connecting to libvirt by the cpg plugin.name_modeβ the cpg plugin, in order to retain compatibility withfence_xvm, stores virtual machines in a certain way. the default was to use'name'when usingfence_xvmandfence_xvmd, and so this is still the default. however, it is strongly recommended to use'uuid'instead of'name'in all cluster environments involving more than one physical host in order to avoid the potential for name collisions. do not skip this one, bestie, i'm begging π
π GROUPS π
fence_virtd supports static maps which allow grouping of VMs. the groups are arbitrary and are checked at fence time. any member of a group may fence any other member. hosts may be assigned to multiple groups if desired. it's giving chosen family π₯°
π group
this defines a group.
nameβ optionally define the name of the group. useful only for configuration readability and debugging of configuration parsing.uuidβ defines UUID as a member of a group. it can be used multiple times to specify both node name and UUID values that can be fenced. when using the serial listener, the vm uuid is required and it is recommended to add also the vm name.ipβ defines an IP which is allowed to send fencing requests for members of this group (e.g. for multicast). it can be used multiple times to allow more than 1 IP to send fencing requests to the group. it is highly recommended that this be used in conjunction with a key file. when using the vsock listener,ipshould contain the CID value assigned by libvirt to the vm. when using the serial listener,ipvalue is not used and can be omitted.
β¨ EXAMPLE β¨
here's the whole thing looking cute, fr fr:
fence_virtd {
listener = "multicast";
backend = "cpg";
}
# this is the listeners section
listeners {
multicast {
key_file = "/etc/cluster/fence_xvm.key";
}
}
backends {
libvirt {
uri = "qemu:///system";
}
}
groups {
group {
name = "cluster1";
ip = "192.168.1.1";
ip = "192.168.1.2";
uuid = "44179d3f-6c63-474f-a212-20c8b4b25b16";
uuid = "1ce02c4b-dfa1-42cb-b5b1-f0b1091ece60";
uuid = "node1";
uuid = "node2";
}
}
π SEE ALSO π
fence_virtd(8), fence_virt(8), fence_xvm(8), fence(8)
go read those too, bestie, they're the rest of the lore π
and that's the whole page!! π this little masterpiece lives in the File Formats Manual section and its page name is fence_virt.conf(5). no version or date on the footer, just the name doing its little signature β so consider this our sign-off: you ate this config file, now go fence some VMs. mwah π
π¦ where this page comes from
- centos-stream 10: fence-virtd 4.16.0-36.el10 Β· GPL-2.0-or-later AND LGPL-2.0-or-later
- debian bookworm: fence-virtd 4.12.1-1 Β· GPL-2.0-or-later
- debian trixie: fence-virtd 4.16.0-3 Β· GPL-2.0-or-later
- fedora 43: fence-virtd 4.16.0-5.fc43 Β· GPL-2.0-or-later AND LGPL-2.0-or-later
- fedora 43: fence-virtd 4.17.0-1.fc43 Β· GPL-2.0-or-later AND LGPL-2.0-or-later
- fedora 44: fence-virtd 4.17.0-2.fc44 Β· GPL-2.0-or-later AND LGPL-2.0-or-later
- ubuntu noble: fence-virtd 4.12.1-2~exp1ubuntu4 Β· GPL-2.0-or-later
- ubuntu questing: fence-virtd 4.16.0-3ubuntu1
- ubuntu resolute: fence-virtd 4.17.0-1ubuntu1 Β· GPL-2.0-or-later
- ubuntu stonking: fence-virtd 4.17.0-1ubuntu2 Β· GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms