vm_stop
Shut down a VM via clean guest shutdown or forced power-off. Use dry-run to test before applying.
Instructions
[WRITE][risk=medium] Stop a VM (clean shutdown; hard with force). Inverse: vm_start.
A clean shutdown needs the guest tools running; force maps to a hard power-off. Captures the prior power state.
Refuses the VM declared as running Xen Orchestra (xo_self_vm_uuid on the target) — stopping XO removes the API vm_start would travel over, so recovery needs hypervisor console access. dry_run refuses it too: a preview that returns green for a call that will be refused is a wrong preview. That guard is exact and opt-in: an undeclared target is refused nothing, on either path. The dry-run adds a weaker IP-based selfVmHint (null when there is none) that is a coincidence to check, never a verdict and never a block — XO's API exposes no self endpoint, so nothing here can be certain.
Args: vm_id: VM uuid (see vm_list). force: Hard power-off instead of a clean guest shutdown. dry_run: If True, preview without stopping (no undo recorded). target: Xen Orchestra target name from config; omit for the default.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| force | No | ||
| vm_id | Yes | ||
| target | No | ||
| dry_run | No |