Pcornel
Browse topics
Options
Recent
Favorites
Automation · Technical reference

State Drift

Direct answer

State Drift isolates divergence between authoritative desired state, automation-managed recorded state and live target state, identifying whether drift is intentional, external, stale-read or failed reconciliation.

When to use this

Use it when the symptom is “State Drift”: work through the layers in order and stop at the first one that fails.

First 30 seconds

1. State drift causes unexpected diffs.

2. Identify changed resources.

3. Decide revert vs codify.

4. Find the source (manual change, other tool).

5. Prevent recurrence.

Operational verification

actual ≠ desired → diff → resolve

Context & applicabilityCommon mistakes · platform/version boundaries
Platform / version applicability
automation troubleshooting and failure analysis
applies
Structured applicability is explicit Topic metadata; it does not infer compatibility beyond the stored rows.
At a glance

Operational reference

Fast context before you go deeper.

Platformautomation troubleshooting and failure analysis · State Drift owns generic desired/recorded/live divergence; Terraform state depth belongs to Terraform State Problems and platform-specific drift to owning branches.
Scope / prerequisiteUse it when the symptom is “State Drift”: work through the layers in order and stop at the first one that fails.
What next?3 suggested next steps
Evidence1
On this pageJump to a specific section
Operational workflow

Verification & Troubleshooting

Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.

3 steps Observe → verify → isolate → change minimally → repeat the original test.
ObservedRecord what the original test actually shows

Capture the concrete output, symptom, packet, log or counter before changing anything.

Step 1 Operational evidence path Verify boundary

desired source revision → recorded automation state → fresh live read → normalized diff → drift origin/time → reconcile/adopt/source update decision → apply/import → fresh diff → workload acceptance

Healthy evidence: desired, recorded and live states are separately captured, drift origin is known, chosen reconciliation is intentional, fresh comparison is clean and workload verifies.

Step 2 Failure modes and next checks Narrow the fault

Suspicious evidence: cached state is compared to itself, manual drift is overwritten without audit, provider-computed fields generate noise, or a clean diff replaces service acceptance.

Step 3 Common mistakes Narrow the fault
  • Manual changes reverted by the next run.
Evidence references

Evidence · 1 on this Topic

Expected observations and documentation recipes are reference material. Record actual output, device identity, scope and time before claiming a verified result.

observation · 1
Key points
  • Drift detected ≠ target is wrong; desired source may be stale.
  • No drift in cached state ≠ live target matches.
  • Manual change ≠ unauthorized change in every case.
  • Reconciliation succeeded ≠ workload behavior restored.
Key checks
  • ansible-playbook site.yml --check --diff — CM drift
  • terraform plan -refresh-only — IaC drift
  • Change audit for manual edits — source
ReferenceWhat it is1 section · depth on demand

Core model

Pin desired source revision and state snapshot; refresh/read live target; normalize comparable fields; classify external/manual change, provider default, failed apply or stale cached state; assess blast radius; choose reconcile, import/adopt or intentional source update; verify fresh plan/read-back and workload.

ReferenceImportant terms & boundaries2 sections · depth on demand

What this shows and what it does not

Drift evidence shows disagreement among compared representations; it does not by itself identify which representation is authoritative or whether the difference is harmful.

In depth

State drift as an automation problem means the real system no longer matches what the automation tool believes or intends, so plans contain unexpected changes or runs undo manual work.

ClueMeaning
terraform plan shows unrelated changesSomeone changed resources outside Terraform
Ansible reverts a fixDesired state not updated with the emergency change
Resource "not found" in stateDeleted outside the tool

Resolve by deciding which side is correct, then either update the code or let the tool revert the system — never just ignore the difference.

Source basisSource attribution states what this section is based on; it is not independent proof that the current environment matches it.
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Technical verification history

Verification history & basis

When and against what this Topic was checked. Later text edits do not count as a new check.

2026-09-14 · vendor docautomation troubleshooting and failure analysis current

Authoritative/upstream documentation reviewed for bounded claims in Automation Troubleshooting > State Drift. Documentation verification only; this is not observed lab or production Evidence.

Basis: https://learn.microsoft.com/en-us/azure/architecture/patterns/retry · confidence 94%
Terminology layer

Terms & aliases

Hover a linked term for a quick definition; click it to open its glossary entry. Aliases are other names that find this Topic in search.

Aliases that resolve here
automation state driftconfiguration drift automationdesired state drift
Embedded reference data

Quick lookup tables

State Drift troubleshooting proof-boundary map

Fast symptom/scope, first-failed-boundary, effective-outcome and recovery/closure map for State Drift.

BoundaryHealthy evidenceSuspicious evidence
Symptom / scopeTime window, immutable source/run identity, effective inputs and exact targets are explicitFloating source, changed inputs or ambiguous targets destroy reproducibility
First failed boundaryTransport/auth/dependency/render/operation evidence identifies the earliest divergenceInvestigation starts at the final error and skips earlier unproven boundaries
Effective outcomeController result is paired with target read-back and workload/service acceptanceGreen execution state or changed symptom substitutes for effective-state verification
Recovery / closureMinimal change restores the original test and regression/partial-state checks are cleanBroad retry or unrelated edits make the incident non-reproducible and hide residual state
Confirmation

Confirm action

Continue?