Skip to content

Commit e888fbb

Browse files
authored
Merge pull request #306 from NearNodeFlash/document-fence-env-variables
Add NNF_FENCE* environment variable information and change fence_reco…
2 parents 9cbed6b + 0486cbf commit e888fbb

1 file changed

Lines changed: 43 additions & 19 deletions

File tree

docs/guides/ha-cluster/readme.md

Lines changed: 43 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ NNF software supports provisioning of Red Hat GFS2 (Global File System 2) storag
1515
- [Quorum Configuration](#quorum-configuration)
1616
- [Why the Rabbit Needs 17 Votes](#why-the-rabbit-needs-17-votes)
1717
- [Configuring Quorum Votes](#configuring-quorum-votes)
18-
- [Fencing with fence_recorder](#fencing-with-fence_recorder)
18+
- [Fencing with fence_dummy](#fencing-with-fence_dummy)
1919
- [How It Works](#how-it-works)
2020
- [Installation](#installation)
2121
- [STONITH Configuration](#stonith-configuration)
@@ -169,9 +169,9 @@ corosync-quorumtool
169169

170170
The output should show the Rabbit with 17 votes and each compute with 1 vote, for a total of 33 votes and quorum at 17.
171171

172-
## Fencing with fence_recorder
172+
## Fencing with fence_dummy
173173

174-
The `fence_recorder` agent coordinates fencing with external NNF software using a request/response file pattern. When Pacemaker decides to fence a compute node, `fence_recorder`:
174+
The [`fence_dummy`](https://github.com/ClusterLabs/fence-agents/tree/main/agents/dummy) agent coordinates fencing with external NNF software using a request/response file pattern. When Pacemaker decides to fence a compute node, `fence_dummy`:
175175

176176
1. Writes a fence request file
177177
2. Waits for the NNF software to process the request and write a response
@@ -188,10 +188,10 @@ This allows the NNF software to perform storage cleanup (detaching NVMe namespac
188188
│ Pacemaker/Corosync │
189189
│ (Cluster Manager) │
190190
└──────────┬───────────┘
191-
│ Calls fence_recorder
191+
│ Calls fence_dummy
192192
193193
┌──────────────────────┐ ┌───────────────────────────────┐
194-
fence_recorder │──────▶│ Request File │
194+
fence_dummy │──────▶│ Request File │
195195
│ (Fence Agent) │ │ requests/<node>-<uuid>.json │
196196
└──────────────────────┘ └───────────────────────────────┘
197197
│ │
@@ -218,12 +218,12 @@ This allows the NNF software to perform storage cleanup (detaching NVMe namespac
218218

219219
### Installation
220220

221-
Install `fence_recorder` on all nodes in the cluster:
221+
Install `fence_dummy` on all nodes in the cluster:
222222

223223
```bash
224224
# Copy the agent to each node
225-
sudo cp fence_recorder /usr/sbin/fence_recorder
226-
sudo chmod 755 /usr/sbin/fence_recorder
225+
sudo cp fence_dummy /usr/sbin/fence_dummy
226+
sudo chmod 755 /usr/sbin/fence_dummy
227227

228228
# Create the request/response directories on each rabbit node
229229
sudo mkdir -p /localdisk/fence-recorder/{requests,responses}
@@ -241,7 +241,7 @@ Create a STONITH resource for each compute node. Run these commands from any nod
241241
```bash
242242
# Create STONITH resources for all 16 compute nodes (1-16)
243243
for i in $(seq 1 16); do
244-
pcs stonith create compute-${i}-fence-recorder fence_recorder \
244+
pcs stonith create compute-${i}-fence-dummy fence_dummy \
245245
port=compute-${i} \
246246
pcmk_host_list=compute-${i} \
247247
request_dir=/localdisk/fence-recorder/requests \
@@ -258,7 +258,7 @@ Alternatively, create resources individually:
258258

259259
```bash
260260
# Example: Create STONITH for rabbit-compute-1
261-
pcs stonith create compute-1-fence-recorder fence_recorder \
261+
pcs stonith create compute-1-fence-dummy fence_dummy \
262262
port=rabbit-compute-1 \
263263
pcmk_host_list=compute-1 \
264264
request_dir=/localdisk/fence-recorder/requests \
@@ -273,10 +273,34 @@ pcs stonith create compute-1-fence-recorder fence_recorder \
273273
|--------|---------|-------------|
274274
| `port` | (required) | Target node name to fence |
275275
| `pcmk_host_list` | (required) | Node this STONITH resource can fence |
276-
| `request_dir` | `/var/run/fence_recorder/requests` | Directory for fence request files |
277-
| `response_dir` | `/var/run/fence_recorder/responses` | Directory for fence response files |
276+
| `request_dir` | `/var/run/fence_dummy/requests` | Directory for fence request files |
277+
| `response_dir` | `/var/run/fence_dummy/responses` | Directory for fence response files |
278278
| `log_dir` | `/var/log/cluster` | Directory for log files |
279279

280+
### NNF Software Configuration
281+
282+
The nnf-node-manager DaemonSet must be configured with the **same** request and response directories used by the `fence_dummy` agent. These are controlled by environment variables in the pod spec:
283+
284+
| Environment Variable | Default | Description |
285+
|---------------------|---------|-------------|
286+
| `NNF_FENCE_REQUEST_DIR` | `/localdisk/fence-recorder/requests` | Directory where fence agents write JSON request files |
287+
| `NNF_FENCE_RESPONSE_DIR` | `/localdisk/fence-recorder/responses` | Directory where nnf-sos writes JSON response files |
288+
289+
These variables are set in the nnf-node-manager DaemonSet manifest (`config/manager/manager.yaml`):
290+
291+
```yaml
292+
env:
293+
- name: NNF_FENCE_REQUEST_DIR
294+
value: "/localdisk/fence-recorder/requests"
295+
- name: NNF_FENCE_RESPONSE_DIR
296+
value: "/localdisk/fence-recorder/responses"
297+
```
298+
299+
When unset or empty, the defaults shown above are used. The nnf-node-manager creates the directories automatically if they do not exist.
300+
301+
!!! important
302+
The `request_dir` and `response_dir` values in the STONITH resource configuration **must match** the `NNF_FENCE_REQUEST_DIR` and `NNF_FENCE_RESPONSE_DIR` environment variables in the nnf-node-manager pod. If they differ, fence requests will not be detected.
303+
280304
### Verifying Configuration
281305

282306
```bash
@@ -286,15 +310,15 @@ pcs stonith status
286310
# View STONITH configuration
287311
pcs stonith config
288312
289-
# Test that fence_recorder can generate metadata
290-
fence_recorder --action metadata
313+
# Test that fence_dummy can generate metadata
314+
fence_dummy --action metadata
291315
```
292316

293317
## Request/Response Protocol
294318

295319
### Request File Format
296320

297-
When a fence operation is triggered, `fence_recorder` writes a JSON request file:
321+
When a fence operation is triggered, `fence_dummy` writes a JSON request file:
298322

299323
**Location**: `<request_dir>/<node>-<uuid>.json`
300324

@@ -379,21 +403,21 @@ journalctl -u pacemaker | grep -i stonith
379403
ls -la /localdisk/fence-recorder/requests/
380404
ls -la /localdisk/fence-recorder/responses/
381405
382-
# Check fence_recorder logs
406+
# Check fence_dummy logs
383407
tail -f /var/log/cluster/fence-events.log
384408
```
385409

386410
**Module not found error:**
387-
Ensure the fencing library path is correct in `/usr/sbin/fence_recorder`. The `sys.path.append` line should point to `/usr/share/fence`.
411+
Ensure the fencing library path is correct in `/usr/sbin/fence_dummy`. The `sys.path.append` line should point to `/usr/share/fence`.
388412

389413
### Testing Fence Operations
390414

391415
```bash
392416
# Test metadata generation
393-
fence_recorder --action metadata
417+
fence_dummy --action metadata
394418
395419
# Test monitor action (non-destructive)
396-
fence_recorder --action monitor -n rabbit-compute-1 \
420+
fence_dummy --action monitor -n rabbit-compute-1 \
397421
--request-dir=/localdisk/fence-recorder/requests \
398422
--response-dir=/localdisk/fence-recorder/responses
399423
```

0 commit comments

Comments
 (0)