---
name: "ocf_heartbeat_lxc"
section: "7"
platform: "linux"
package: "resource-agents"
version: "1:4.16.0-3+deb13u2"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/ocf_heartbeat_lxc"
---

# ocf\_heartbeat\_lxc(7)

Manages LXC containers

## NAME

ocf\_heartbeat\_lxc - Manages LXC containers

## SYNOPSIS

**lxc** \[start \| stop \| monitor \| meta-data \| validate-all\]

## DESCRIPTION

Allows LXC containers to be managed by the cluster. Notes for lxc Versions before 1.0.0, where the Container is stopped using kill -PWR instead of lxc-stop: It is 'assumed' that the 'init' system will do an orderly shudown if presented with a 'kill -PWR' signal. On a 'sysvinit' this would require the container to have an inittab file containing "p0::powerfail:/sbin/init 0"

## SUPPORTED PARAMETERS

**container**

The unique name for this 'Container Instance' e.g. 'test1'.

(unique, required, string, no default)

**config**

Absolute path to the file holding the specific configuration for this container e.g. '/etc/lxc/test1/config'.

(required, string, no default)

**log**

Absolute path to the container log file

(optional, string, default "/run/resource-agents/RESOURCE\_ID.log")

**use\_screen**

Provides the option of capturing the 'root console' from the container and showing it on a separate screen. To see the screen output run 'screen -r {container name}' The default value is set to 'false', change to 'true' to activate this option

(optional, boolean, default false)

## SUPPORTED ACTIONS

This resource agent supports the following actions (operations):

**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. Suggested interval: 60s.

**validate-all**

Performs a validation of the resource configuration. Suggested minimum timeout: 20s.

**meta-data**

Retrieves resource agent metadata (internal use only). Suggested minimum timeout: 5s.

## EXAMPLE CRM SHELL

The following is an example configuration for a lxc resource using the [**crm**(8)](/crm/8.md) shell:

```
primitive p_lxc ocf:heartbeat:lxc \
  params \
    container=string \
    config=string \
  op monitor timeout="20s" interval="60s" depth="0"
```

## EXAMPLE PCS

The following is an example configuration for a lxc resource using [**pcs**(8)](/pcs/8.md)

```
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/**

## AUTHOR

**ClusterLabs contributors (see the resource agent source for information about individual authors)**
