Skip to content
🎉 Launch sale:50% off everything over $22 — automatically applied at checkout· ends Aug 2Shop the sale →
DevOps AI ToolKit
Newsletter
All prompts
AI for HashiCorp Vault Difficulty: Advanced ClaudeChatGPT

Vault Raft Cluster Sizing and Backup Prompt

Size, deploy, and back up a HashiCorp Vault cluster on Raft integrated storage — node counts and placement, listener and cluster addressing, autopilot, snapshots, and a tested restore procedure.

Target user
Platform engineers operating HashiCorp Vault in production
Difficulty
Advanced
Tools
Claude, ChatGPT

The prompt

You are a senior platform engineer who has run Vault on Raft integrated storage through node failures, upgrades, and one real restore, and who knows that an untested snapshot is not a backup.

I will provide:
- Where the cluster runs (VMs, Kubernetes, bare metal), across how many availability zones or datacenters
- Expected request rate, secret count, and which engines are in use (dynamic secrets and PKI drive very different write volumes)
- Availability and RPO/RTO targets
- Current node count, instance sizes, and disk type if a cluster already exists
- My Vault version and edition

Your job:

1. **Size the cluster and place the nodes.** Recommend a node count — odd numbers only, with the reasoning about quorum and fault tolerance spelled out (a 3-node cluster tolerates one failure, 5 tolerates two) — and distribute nodes across failure domains so no single zone loss costs quorum. Explicitly address the two-zone trap where any placement leaves one zone holding a majority. Give CPU, memory, and disk guidance, and stress that Raft is latency-sensitive on fsync, so low-latency local SSD matters far more than raw capacity.

2. **Write the storage and listener configuration.** Give the `storage "raft"` stanza with `path`, `node_id`, and `retry_join` blocks appropriate to my platform (address-based, or cloud auto-join by tag), plus the `listener "tcp"` block with TLS configured properly. Be explicit that `api_addr` and `cluster_addr` must be set to addresses other nodes and clients can actually reach — misconfigured advertise addresses are the single most common cause of a cluster that forms but does not work.

3. **Tune Raft parameters only where justified.** Explain `performance_multiplier`, `snapshot_threshold`, `snapshot_interval`, `trailing_logs`, and `max_entry_size`, when each should be changed, and what breaks if it's changed carelessly. Default to leaving them alone unless my workload profile gives a concrete reason.

4. **Configure autopilot.** Show `vault operator raft autopilot set-config` with `cleanup_dead_servers`, `dead_server_last_contact_threshold`, `min_quorum`, and `server_stabilization_time`, and explain how these interact with autoscaling or rolling node replacement. Make the point that `min_quorum` is the guard against autopilot cleaning its way into a quorum loss. Note that automated snapshots via `sys/storage/raft/snapshot-auto/config` are an Enterprise feature, so Community deployments must schedule snapshots externally.

5. **Design the snapshot strategy.** Give the `vault operator raft snapshot save` procedure, a schedule derived from my RPO, and where snapshots go: encrypted at rest, in a separate failure domain and separate credential boundary from Vault itself, with retention and integrity checks. Cover the identity that takes snapshots — it needs a narrowly scoped policy over the snapshot path, not root — and state clearly that a snapshot contains all Vault data in encrypted form and is only usable with the corresponding seal, which is exactly why the seal and KMS key must be protected and backed up alongside it.

6. **Write the restore procedure and require a rehearsal.** Cover both `vault operator raft snapshot restore` into an existing cluster and the full rebuild path: new cluster, matching seal configuration, restore, verify. Enumerate what a restore does not bring back — anything written after the snapshot, including dynamic credentials whose leases will be inconsistent with the real backing systems — and how to reconcile that (revoke and reissue rather than hope). Mandate a scheduled restore drill into a scratch environment with a defined success test, and say that a snapshot never restored is an assumption, not a backup.

7. **Document node lifecycle operations.** Adding a node with `retry_join`, checking membership with `vault operator raft list-peers`, removing a failed node with `vault operator raft remove-peer`, stepping down a leader with `vault operator step-down`, and the correct order for a rolling upgrade (standbys first, leader last via step-down). Include the recovery path for a cluster that has lost quorum and cannot elect a leader, and be clear that this is a dangerous procedure requiring the current state to be captured first.

8. **Specify monitoring.** Track leader elections and their frequency, per-node fsync and storage latency, Raft log and applied index lag between peers, disk usage against the Raft data path, seal state, snapshot job success, and unsealed-node count. Alert on quorum at risk — that is, healthy nodes down to threshold plus one — rather than waiting for quorum to be lost.

Output as: (a) node count, sizing, and failure-domain placement with the quorum reasoning, (b) the complete storage/listener/api_addr configuration, (c) autopilot settings with values, (d) the snapshot schedule, storage location, and scoped snapshot policy, (e) the restore procedure plus the drill plan and success test, (f) node lifecycle runbooks including quorum loss, (g) monitoring and alert thresholds.

Take a snapshot before any node-membership or upgrade operation. Do not use `remove-peer` to fix a node that is merely slow, and do not treat replication as a substitute for snapshots — replication faithfully copies a bad write to every replica.

Run this prompt with AI

Test it, get an AI-improved version, or compare models — live in the Prompt Workspace. No copy-paste.

Why this prompt works

Raft sizing looks like an arithmetic problem and is actually a placement problem. Any odd node count gives you a quorum rule, but where the nodes sit decides whether losing one failure domain costs you the cluster — and the two-zone case is the trap, because no distribution of an odd number across two zones avoids putting a majority in one of them. Requiring the failure-domain layout and the quorum reasoning as a single deliverable stops the common outcome of a correctly-sized cluster with a single-zone dependency nobody noticed until the zone went away.

The configuration step targets the specific failure that wastes the most time: a cluster that forms and does not work. api_addr and cluster_addr are advertise addresses, so a value that is correct from the operator’s laptop and wrong from a peer produces nodes that join, appear healthy, and cannot serve requests through the load balancer. Pairing that with the point that Raft is fsync-latency-sensitive — local SSD matters far more than capacity — heads off the other silent misconfiguration, which is sizing the disk for volume and getting a cluster that struggles under normal write load.

The backup half of the prompt is deliberately uncomfortable about what a snapshot really is. It is encrypted data that only opens with its matching seal, so a snapshot stored without the corresponding KMS key or unseal material is not a recovery plan, and a snapshot that has never been restored is an assumption. Mandating a rehearsal with a defined success test, a scoped snapshot identity rather than root, and an explicit list of what a restore does not bring back — dynamic credentials whose leases no longer match the real backing systems — produces a backup story you can defend during the incident rather than one that reads well on a wiki page.

Related prompts

More HashiCorp Vault prompts & error guides

Browse every HashiCorp Vault prompt and troubleshooting guide in one place.

Free download · 368-page PDF

Reading prompts? Get all 500 in one free PDF

500 battle-tested, copy-paste AI prompts engineered by a senior systems engineer — every one with fill-in placeholders and safety/back-out notes. Drop your email and it's yours.

  • 500 prompts: Linux · Kubernetes · Terraform · OpenStack · GitLab · Docker · Monitoring · Incident Response
  • Instant PDF download — yours free, forever
  • Plus one practical AI-workflow email a week (no spam)

Single opt-in · unsubscribe anytime · no spam.