OCF_HEARTBEAT_LXC(7)
π OCF_HEARTBEAT_LXC β bestie edition π
okay so this is ocf_heartbeat_lxc, a resource agent from the OCF resource agents family, and it's the one that lets your cluster babysit LXC containers. yes. containers. in a cluster. we love a crossover episode π«Ά
β¨ NAME β¨
ocf_heartbeat_lxc β she manages LXC containers. that's the whole job description, and she does it flawlessly π
β¨ SYNOPSIS β¨
lxc [start | stop | monitor | meta-data | validate-all]
that's it. five moves. pick one, bestie π
β¨ DESCRIPTION β¨
So this agent is what lets LXC containers be managed by the cluster. iconic behaviour honestly.
now here's the tea for anyone running lxc versions before 1.0.0 π΅ β back then the container gets stopped with kill -PWR instead of lxc-stop. And the agent is out here 'assuming' that your init system will do a nice orderly shutdown when it gets handed that kill -PWR signal. On a sysvinit setup, that assumption only holds if the container has an inittab file with this line in it:
p0::powerfail:/sbin/init 0
no inittab line, no graceful shutdown. that's not a vibe, that's just a fact π
β¨ SUPPORTED PARAMETERS β¨
these are the knobs, and we are going to turn every single one of them correctly π₯
containerβ the unique name for this 'Container Instance'. like,'test1'for example. this one is unique, required, string, and has no default β so you will be filling it in, bestie, no skipping πconfigβ the absolute path to the file that holds the specific configuration for this container. for example'/etc/lxc/test1/config'. also required, string, no default. two required params, we're thriving β¨logβ the absolute path to the container's log file. this one is optional, string, and defaults to"/run/resource-agents/RESOURCE_ID.log"if you don't say anything πuse_screenβ this gives you the option of capturing the container's 'root console' and showing it on a separate screen. to actually peek at that screen output, runscreen -r {container name}. the default is'false', so if you want this you gotta flip it to'true'β she will not do it for you π
β¨ SUPPORTED ACTIONS β¨
this resource agent supports the following actions (operations), and each one has β¨opinionsβ¨ about how long you should let it take:
startβ starts the resource. suggested minimum timeout:10s.stopβ stops the resource. suggested minimum timeout:30s.monitorβ performs a detailed status check. suggested minimum timeout:20s, and a suggested interval of60s.validate-allβ performs a validation of the resource configuration. suggested minimum timeout:20s.meta-dataβ retrieves resource agent metadata (internal use only, bestie, don't touch unless you know). suggested minimum timeout:5s.
β¨ EXAMPLE CRM SHELL β¨
here's an example config for a lxc resource using the crm(8) shell. copy it, love it, change the strings πΈ
primitive p_lxc ocf:heartbeat:lxc \
params \
container=string \
config=string \
op monitor timeout="20s" interval="60s" depth="0"
β¨ EXAMPLE PCS β¨
and here's the same energy via pcs(8) π
pcs resource create p_lxc ocf:heartbeat:lxc \
container=string \
config=string \
op monitor timeout="20s" interval="60s" OCF_CHECK_LEVEL="0"
β¨ SEE ALSO β¨
- http://clusterlabs.org/ β go say hi, they're lovely π
β¨ AUTHOR β¨
ClusterLabs contributors β and if you want to know about individual authors, go check the resource agent source, the receipts are all there π
and that's the whole page, no cap. this version of the man page is from resource-agents UNKNOWN, dated 04/08/2026. slay, stay clustered, and remember: monitor at 60s intervals is self care ππβ¨π¦
π¦ where this page comes from
- fedora 43: resource-agents 4.18.0-1.fc43 Β· GPL-2.0-or-later AND LGPL-2.1-or-later
- fedora 44: resource-agents 4.18.0-1.fc44 Β· GPL-2.0-or-later AND LGPL-2.1-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms