/usr/share/resource-agents/ocft/configs/sg_persist is in resource-agents 1:3.9.7-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 | # sg_persist
# Before use sg_persist ocft test case you have to prepare to make pacemaker
# can be started successfully because sg_persist RA needs to use the result of
# `crm_node -i` as sg_persist register key.
CONFIG
Agent sg_persist
AgentRoot /usr/lib/ocf/resource.d/heartbeat
InstallPackage sg3_utils
HangTimeout 20
VARIABLE
# Please set the disk you want to test
#OCFT_DEVS="/dev/disk/by-id/scsi-14945540000000000844965720e6e555176b19461345d68d5"
OCFT_DEVS=
# please set the IP addrees of the other server.
IP_2=
SETUP-AGENT
# start pacemaker to get node_id through crm_node -i
systemctl start pacemaker
CLEANUP-AGENT
CASE-BLOCK required_args
Env HA_SBIN_DIR=""
Env OCF_RESKEY_devs="$OCFT_DEVS"
Env OCF_RESKEY_reservation_type=1
Env OCF_RESKEY_CRM_meta_notify=true
Env OCF_RESKEY_CRM_meta_master_max=1
CASE-BLOCK required_args_error
Env HA_SBIN_DIR=""
Env OCF_RESKEY_devs="$OCFT_DEVS"
Env OCF_RESKEY_reservation_type=1
Env OCF_RESKEY_CRM_meta_notify=true
Env OCF_RESKEY_CRM_meta_master_max=2
CASE-BLOCK required_args_type_5
Env HA_SBIN_DIR=""
Env OCF_RESKEY_devs="$OCFT_DEVS"
Env OCF_RESKEY_reservation_type=5
Env OCF_RESKEY_CRM_meta_notify=true
Env OCF_RESKEY_CRM_meta_master_max=1
CASE-BLOCK required_args_type_7
Env HA_SBIN_DIR=""
Env OCF_RESKEY_devs="$OCFT_DEVS"
Env OCF_RESKEY_reservation_type=7
Env OCF_RESKEY_CRM_meta_notify=true
Env OCF_RESKEY_CRM_meta_master_max=2
CASE-BLOCK default_status
AgentRun stop
CASE-BLOCK prepare
Include required_args
Include default_status
CASE-BLOCK prepare_type_5
Include required_args_type_5
Include default_status
CASE-BLOCK prepare_type_7
Include required_args_type_7
Include default_status
CASE "check base env"
Include prepare
AgentRun start OCF_SUCCESS
CASE "check base env: unset 'OCF_RESKEY_sg_persist_devs'"
Include prepare
Unenv OCF_RESKEY_devs
AgentRun start OCF_ERR_INSTALLED
CASE "validate all"
Include required_args
AgentRun validate-all OCF_SUCCESS
CASE "validate all--type:5"
Include required_args_type_5
AgentRun validate-all OCF_SUCCESS
CASE "validate all--type:7"
Include required_args_type_7
AgentRun validate-all OCF_SUCCESS
CASE "validate all--error configured"
Include required_args_error
AgentRun validate-all OCF_ERR_CONFIGURED
CASE "normal start"
Include prepare
AgentRun start OCF_SUCCESS
CASE "normal stop"
Include prepare
AgentRun start
AgentRun stop OCF_SUCCESS
CASE "double start"
Include prepare
AgentRun start
AgentRun start OCF_SUCCESS
CASE "double stop"
Include prepare
AgentRun stop
AgentRun stop OCF_SUCCESS
CASE "monitor when running"
Include prepare
AgentRun start
AgentRun monitor OCF_SUCCESS
CASE "monitor when not running"
Include prepare
AgentRun stop
AgentRun monitor OCF_NOT_RUNNING
CASE "Primary/Secondary monitor"
Include prepare
AgentRun start
AgentRun promote
AgentRun monitor OCF_RUNNING_MASTER
AgentRun demote
AgentRun monitor OCF_SUCCESS
AgentRun stop
CASE "promote/demote test in single-primary mode"
Include prepare
Include@$IP_2 prepare
# start
AgentRun start
AgentRun@$IP_2 start
# promote local first
AgentRun promote OCF_SUCCESS
# demote local prepare for remote promote
AgentRun demote
# remote promote
AgentRun@$IP_2 promote OCF_SUCCESS
AgentRun@$IP_2 monitor OCF_RUNNING_MASTER
AgentRun monitor OCF_SUCCESS
# promote local then promote(by preempt) remote, which will cause local OCF_NOT_RUNNING
AgentRun promote OCF_SUCCESS
AgentRun monitor OCF_RUNNING_MASTER
AgentRun@$IP_2 monitor OCF_NOT_RUNNING
# remove all reservation registration
AgentRun demote
AgentRun stop
AgentRun@$IP_2 stop
CASE "normal start--type 5"
Include prepare_type_5
Include@$IP_2 prepare_type_5
AgentRun start OCF_SUCCESS
AgentRun@$IP_2 start OCF_SUCCESS
CASE "promote/demote test in single-primary mode"
Include prepare_type_5
Include@$IP_2 prepare_type_5
# start
AgentRun start
AgentRun@$IP_2 start
# promote local first
AgentRun promote OCF_SUCCESS
AgentRun monitor OCF_RUNNING_MASTER
# demote local prepare for remote promote
AgentRun demote
# remote promote
AgentRun@$IP_2 promote OCF_SUCCESS
AgentRun@$IP_2 monitor OCF_RUNNING_MASTER
AgentRun monitor OCF_SUCCESS
# promote local then promote(by preempt) remote, which will cause local OCF_NOT_RUNNING
AgentRun promote OCF_SUCCESS
AgentRun monitor OCF_RUNNING_MASTER
AgentRun@$IP_2 monitor OCF_NOT_RUNNING
# remove all reservation registration
AgentRun demote
AgentRun stop
AgentRun@$IP_2 stop
CASE "normal start--type 7: 2 masters"
Include prepare_type_7
Include@$IP_2 prepare_type_7
AgentRun start OCF_SUCCESS
AgentRun@$IP_2 start OCF_SUCCESS
CASE "Primary/Primary monitor--type 7"
Include prepare_type_7
Include@$IP_2 prepare_type_7
AgentRun start OCF_SUCCESS
AgentRun@$IP_2 start OCF_SUCCESS
AgentRun promote OCF_SUCCESS
AgentRun monitor OCF_RUNNING_MASTER
AgentRun@$IP_2 promote OCF_SUCCESS
AgentRun monitor OCF_RUNNING_MASTER
AgentRun@$IP_2 monitor OCF_RUNNING_MASTER
AgentRun demote OCF_SUCCESS
AgentRun monitor OCF_NOT_RUNNING
AgentRun@$IP_2 demote OCF_SUCCESS
AgentRun@$IP_2 monitor OCF_NOT_RUNNING
AgentRun stop
AgentRun@$IP_2 stop
|