Pcornel
Virtualization · Virtual Machine Lifecycle

Shutdown

Cheat sheet · https://pcornel.dk/topic.php?topic=3437

Back to the Topic

Answer

Shutting down a VM asks the guest OS to stop cleanly through guest tools or an ACPI power button event, so services and file systems close properly. It fails if the guest has no tools or ignores ACPI.

Remember

  • Needs guest tools or ACPI.
  • May hang on stuck services.
  • Use timeout then power off.

First checks

  • virsh shutdown <vm> — ACPI/agent shutdown (libvirt)
  • qm shutdown <vmid> --timeout 120 — graceful shutdown (Proxmox)
  • Stop-VM <vm> — graceful shutdown via integration services (Hyper-V)

Commands

virsh shutdown vm01
qm shutdown 101 --timeout 120

Verify in this order

shutdown request → guest agent/ACPI → OS stops → process exits

Where it usually breaks

First mismatch in management intent → host/cluster capability → hypervisor runtime/task → virtual resource/device → guest state → workload-visible read-back; preserve identity/native error/pre-state before mutation.

Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=3437

Confirmation

Confirm action

Continue?