OCF_HEARTBEAT_MPATHP(7)

✨ ocf_heartbeat_mpathpersist ✨

okay bestie, so this is a page from the OCF resource agents manual set, and today's main character is ocf_heartbeat_mpathpersist(7). Buckle up, we're managing SCSI persistent reservations on multipath devices πŸ’…


🌸 NAME 🌸

ocf_heartbeat_mpathpersist β€” literally manages SCSI persistent reservations on multipath devices. that's the whole vibe. no cap.


πŸ¦‹ SYNOPSIS πŸ¦‹

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

πŸŽ€ DESCRIPTION πŸŽ€

so this resource agent manages SCSI persistent reservations on multipath devices. it uses "mpathpersist" from multipath-tools, so go read that documentation too, iykyk.

it should be used as a multistate (Promotable) resource. periodt.

When it's Unpromoted, it registers its node id ("crm_node -i") as the reservation key (--param-sark) on each device in the params "devs" list. When it's Promoted, it reserves all the devices from the params "devs" list using the reservation "--prout-type" value from the "reservation_type" parameter. pls go see sg_persist(8) and mpathpersist(8) for the details on reservation_type, they explain it way better than I could 🫢


πŸ’– SUPPORTED PARAMETERS πŸ’–

  • binary β€” the name of the binary that manages the resource.

(optional, string, default "mpathpersist")

  • devs β€” the device list, bestie. multiple devices can be listed with blank space as separator, and shell wildcards are allowed ✨

(required, string, no default)

  • required_devs_no β€” the minimum number of "working" devices from the device list. a device counts as "working" if 1) it exists and 2) "mpathpersist --in --read-keys <device>" works (return code 0).

for the resource actions "start", "monitor", "promote" and "validate-all", they return "OCF_ERR_INSTALLED" if the actual number of "working" devices is less than "required_devs_no".

for resource actions "stop" and "demote", they try to remove reservations and registration keys from all working devices, but they always return "OCF_SUCCESS".

(optional, string, default "1")

  • reservation_type β€” reservation type. that's it, that's the description 😌

(optional, string, default "1")

  • master_score_base β€” the "master_score_base" value, and it's used in the "master_score" calculation: master_score = master_score_base + master_score_dev_factor * working_devs. if you set a bigger value in the mpathpersist resource configuration on some node, that node becomes "preferred" for the promoted role πŸ‘‘

(optional, string, default "0")

  • master_score_dev_factor β€” the working device factor in the promoted calculation. each "working" device provides additional value to "master_score", so the node that sees more devices gets preferred for the "Promoted"-role. setting it to 0 disables this behavior.

(optional, string, default "100")

  • master_score_delay β€” promoted/unpromoted decreases/increases its master_score after a 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 disables 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 🌈

here's an example configuration for a mpathpersist resource using the crm(8) 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 πŸ’œ

and here's the same kind of thing for a mpathpersist resource using pcs(8):

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/ β€” go click, bestie πŸ¦‹


πŸ‘‘ AUTHOR πŸ‘‘

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


ngl this page is from resource-agents UNKNOWN, dated 10/01/2026 β€” and that's the whole manual, you ate that πŸ’…βœ¨
πŸ“¦ where this page comes from