Pcornel
Browse topics
Options
Recent
Favorites
Virtualization · Technical reference

Infrastructure as Code

Direct answer

Infrastructure as Code declares VMs, networks and storage in versioned files (Terraform, Pulumi, Bicep, Ansible), so changes are reviewed, planned and applied consistently, and drift from the declared state can be detected.

When to use this

Use this when managing VMs, networks and storage declaratively in versioned code, or when real infrastructure has drifted from the code.

First 30 seconds

1. Infrastructure as Code describes VMs, networks and storage in versioned files.

2. Plan → review → apply.

3. Remote state with locking.

4. Detect drift.

5. Secrets out of code.

Operational verification

code → plan → review → apply → state

Context & applicabilityCommon mistakes · platform/version boundaries
Platform / version applicability
virtualization
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.

Platformvirtualization
Scope / prerequisiteUse this when managing VMs, networks and storage declaratively in versioned code, or when real infrastructure has drift…
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.

2 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 Checks Verify boundary
  • terraform plan shows no drift after deployment.
  • State stored remotely with locking.
  • Credentials provided via environment/secret store, not in code.
Step 2 Common mistakes Narrow the fault
  • State files with credentials stored unprotected.
  • Manual changes in the GUI causing drift.
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
  • The plan is the review; read it.
  • Manual changes become drift.
  • State files contain secrets; protect them.
Key checks
  • terraform plan — drift and changes
  • ansible-playbook site.yml --check --diff — config drift
  • git log — reviewed changes
ReferenceWhy it matters1 section · depth on demand

Workflow

1. Write code (Terraform/OpenTofu).

2. plan in CI on pull request.

3. Review.

4. apply from the pipeline with stored state.

5. Drift checks on a schedule.

ReferenceImportant terms & boundaries2 sections · depth on demand

In depth

Infrastructure as Code describes VMs, networks and storage in versioned files and applies them through APIs. Benefits: reviews via pull requests, reproducible environments, drift detection.

Practical issues with hypervisors: provider maturity varies (vSphere provider is mature; Proxmox community providers such as bpg/proxmox are widely used), state files contain sensitive data (encrypt and lock remote state), and imported legacy VMs need careful import to avoid destroy/recreate plans. Always review plan output for replacements before apply.

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 docvirtualization current

Authoritative/upstream documentation reviewed for bounded claims in Automation → Infrastructure as Code. Documentation verification only; this is not observed lab or production Evidence.

Basis: https://libvirt.org/html/index.html · confidence 94%
Confirmation

Confirm action

Continue?