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, run screen -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 of 60s.
  • 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 ✨


✨ 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