---
name: "ocf_heartbeat_mpathpersist"
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_mpathpersist"
---

# ocf\_heartbeat\_mpathpersist(7)

Manages SCSI persistent reservations on multipath devices

## NAME

ocf\_heartbeat\_mpathpersist - Manages SCSI persistent reservations on multipath devices

## SYNOPSIS

**mpathpersist** \[start \| stop \| monitor \| promote \| demote \| meta-data \| validate-all\]

## DESCRIPTION

This resource agent manages SCSI persistent reservations on multipath devices. "mpathpersist" from multipath-tools is used, please see its documentation. Should be used as multistate (Promotable) resource Unpromoted registers its node id ("crm\_node -i") as reservation key ( --param-sark ) on each device in the params "devs" list. Promoted reserves all devices from params "devs" list with reservation "--prout-type" value from "reservation\_type" parameter. Please see man [sg\_persist(8)](/sg_persist/8.md) and [mpathpersist(8)](/mpathpersist/8.md) for reservation\_type details.

## SUPPORTED PARAMETERS

**binary**

The name of the binary that manages the resource.

(optional, string, default "mpathpersist")

**devs**

Device list. Multiple devices can be listed with blank space as separator. Shell wildcards are allowed.

(required, string, no default)

**required\_devs\_no**

Minimum number of "working" devices from device list 1) existing 2) "mpathpersist --in --read-keys \<device\>" works (Return code 0) resource actions "start","monitor","promote" and "validate-all" return "OCF\_ERR\_INSTALLED" if the actual number of "working" devices is less than "required\_devs\_no". resource actions "stop" and "demote" tries to remove reservations and registration keys from all working devices, but always return "OCF\_SUCCESS"

(optional, string, default "1")

**reservation\_type**

reservation type

(optional, string, default "1")

**master\_score\_base**

master\_score\_base value "master\_score\_base" value is used in "master\_score" calculation: master\_score = master\_score\_base + master\_score\_dev\_factor \* working\_devs if set to bigger value in mpathpersist resource configuration on some node, this node will be "preferred" for promoted role.

(optional, string, default "0")

**master\_score\_dev\_factor**

Working device factor in promoted calculation each "working" device provides additional value to "master\_score", so the node that sees more devices will be preferred for the "Promoted"-role Setting it to 0 will disable this behavior.

(optional, string, default "100")

**master\_score\_delay**

promoted/unpromoted decreases/increases its master\_score after delay of "master\_score\_delay" seconds so if some device gets inaccessible, the unpromoted decreases its promoted first and the resource will no be watched and after this device reappears again the promoted increases its master\_score first this can work only if the master\_score\_delay is bigger then monitor interval on both promoted and unpromoted Setting it to 0 will disable this behavior.

(optional, string, default "30")

## SUPPORTED ACTIONS

This resource agent supports the following actions (operations):

**start**

Starts the resource. Suggested minimum timeout: 30s.

**promote**

Promotes the resource to the Master role. Suggested minimum timeout: 30s.

**demote**

Demotes the resource to the Slave role. Suggested minimum timeout: 30s.

**notify**

Suggested minimum timeout: 30s.

**stop**

Stops the resource. Suggested minimum timeout: 30s.

**monitor (Unpromoted role)**

Performs a detailed status check. Suggested minimum timeout: 20s. Suggested interval: 29s.

**monitor (Promoted role)**

Performs a detailed status check. Suggested minimum timeout: 20s. Suggested interval: 60s.

**meta-data**

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

**validate-all**

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

## EXAMPLE CRM SHELL

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

```
primitive p_mpathpersist ocf:heartbeat:mpathpersist \
  params \
    devs=string \
  op monitor depth="0" timeout="20s" interval="29s" role="Unpromoted" \
  op monitor depth="0" timeout="20s" interval="60s" role="Promoted"
```

```
ms ms_mpathpersist p_mpathpersist \
  meta notify="true" interleave="true"
```

## EXAMPLE PCS

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

```
pcs resource create p_mpathpersist ocf:heartbeat:mpathpersist \
  devs=string \
  op monitor OCF_CHECK_LEVEL="0" timeout="20s" interval="29s" role="Unpromoted" \
  op monitor OCF_CHECK_LEVEL="0" timeout="20s" interval="60s" role="Promoted" promotable
```

## SEE ALSO

**http://clusterlabs.org/**

## AUTHOR

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