Pcornel
Browse topics
Options
Recent
Favorites
Virtualization · Technical reference

Automation

Direct answer

Virtualization automation means creating, changing and retiring VMs through APIs, scripts and declarative tools — Terraform, Ansible, PowerShell, cloud-init — instead of clicking through a console, so builds are repeatable and auditable.

When to use this

Use this when deciding how VMs should be built and changed by code — which API, tool and template — or when an automated VM job fails or produces inconsistent machines.

First 30 seconds

1. Automate provisioning, configuration and lifecycle.

2. Use APIs/IaC with version control.

3. Idempotent tools.

4. Secure API tokens.

5. Test in lab.

Operational verification

code → API → hypervisor → VMs

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 deciding how VMs should be built and changed by code — which API, tool and template — or when an automate…
What next?2 suggested next steps
Child topics (this level)10
Evidence1
On this pageJump to a specific section
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
Drill down

Subtopics

Go one level deeper into this subject.

Subtopic VM Provisioning

VM provisioning is creating a ready-to-use VM: choose host or cluster, clone or build from an image, size CPU, memory and disks, attach networks, apply guest customization, and hand it over with monitoring and backup enabled.

Subtopic Infrastructure as Code

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.

Subtopic Templates

Automation templates are reusable definitions — a VM template, a Terraform module, a cloud-init or Ansible role — with parameters for name, size and network, so many VMs can be produced from one tested pattern.

Subtopic APIs

Hypervisor APIs (vSphere API, Hyper-V WMI/PowerShell, libvirt, Proxmox REST, cloud provider APIs) expose VM, network and storage operations to scripts and tools; authenticate with a scoped service account and use the API's task status to confirm results.

Subtopic CLI Automation

CLI automation drives hypervisors from shell scripts with tools like virsh and virt-install (KVM), qm (Proxmox), govc or esxcli (vSphere) and Hyper-V PowerShell, which suits quick bulk changes and troubleshooting.

Subtopic PowerShell

PowerShell automates Hyper-V with the Hyper-V module (New-VM, Set-VMProcessor, Checkpoint-VM) and vSphere with VMware PowerCLI (Connect-VIServer, New-VM, Get-Stat), covering bulk provisioning, reporting and changes.

Subtopic Ansible

Ansible automates virtualization with agentless playbooks and modules such as community.vmware, community.libvirt and community.general.proxmox to create VMs, change hardware and configure the guest OS in one idempotent run.

Subtopic Terraform

Terraform provisions VMs declaratively with providers for vSphere, Proxmox, Hyper-V, libvirt and clouds; terraform plan shows what will change, apply makes it so, and the state file tracks what Terraform manages.

Subtopic Cloud-init

Cloud-init is the first-boot agent in most Linux cloud images: it reads user-data and meta-data from a datasource (NoCloud ISO, config drive, metadata service) to set hostname, users, SSH keys, network, packages and run commands.

Subtopic Automated Deployment

Automated deployment chains provisioning steps — clone template, set CPU/RAM/disk/network, inject identity with cloud-init or Sysprep, configure the guest, register in monitoring — into a pipeline that runs the same way every time.

Key points
  • Job finished ≠ VM is configured and reachable.
  • Template updated ≠ existing VMs changed.
  • API call accepted ≠ hypervisor task succeeded; poll the task.
Key checks
  • pvesh get /version — API reachable (Proxmox)
  • Get-Command -Module Hyper-V | measure — Hyper-V cmdlets
  • terraform plan — IaC plan
ReferenceWhy it matters1 section · depth on demand

Automation tools by platform

PlatformTools
vSpherePowerCLI, Terraform vsphere provider, Ansible community.vmware
Hyper-VPowerShell, Windows Admin Center, SCVMM
ProxmoxREST API, pvesh, Terraform (bpg/proxmox), Ansible community.general.proxmox*
KVMlibvirt API, virt-install, Ansible, OpenTofu

Combine with templates/cloud-init for guest configuration, and keep definitions in Git.

ReferenceHow it works1 section · depth on demand

In depth

Automation in virtualization covers provisioning, configuration, lifecycle and reporting. Typical toolchain:

TaskTools
Create VMs and infrastructureTerraform/OpenTofu providers, Ansible modules, PowerCLI, Proxmox API
Configure guestscloud-init, Ansible, DSC, sysprep unattend
TemplatesPacker image builds
Day-2 operationsAnsible, PowerShell, scheduled scripts, vRO/Aria
ReportingPowerCLI, API exports to CMDB/monitoring

Keep definitions in Git, run them from CI with service accounts, and treat manual console changes as drift to be reconciled.

ReferenceImportant terms & boundaries1 section · depth on demand

Examples

# PowerCLI
Get-VM | Where-Object PowerState -eq PoweredOn | Select Name,NumCpu,MemoryGB
# Proxmox API via CLI
pvesh get /cluster/resources --type vm --output-format json
# Hyper-V
Get-VM | Where-Object State -eq Running | Select Name,ProcessorCount,MemoryAssigned

Documented example, not captured output. Terraform providers (vsphere, proxmox) and Ansible collections (community.vmware, community.general.proxmox) automate provisioning.

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

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

Basis: https://libvirt.org/html/index.html · confidence 94%
Technical changelog & impact

What changed and what may be affected

Recent technical edits are separated from ordinary page timestamps. Relationship impact is advisory: it identifies nearby canonical references to review, not automatic breakage.

Related reference impactReview these references after material technical changes when their shared boundary is affected.
Confirmation

Confirm action

Continue?