vm_power_off
Power off a virtual machine with graceful guest shutdown via VMware Tools, or force immediate hard power-off. Handles already-off VMs and returns status results.
Instructions
[WRITE] Power off a VM — graceful guest shutdown by default, hard power-off with force=True.
Graceful mode calls VMware Tools guest shutdown and waits up to 120s; if Tools is not running or shutdown stalls, the response tells you to retry with force=True. An already-off VM returns success without change. Audited to ~/.vmware/audit.db. Use vm_power_on to start a VM; vm_delete requires the VM to be off first.
Args: vm_name: Exact VM name as shown in vCenter inventory (case-sensitive). force: False (default) = graceful guest shutdown via VMware Tools; True = immediate hard power-off (risks guest filesystem damage). target: vCenter/ESXi target name from config.yaml; omit to use the default target.
Returns: Status string: shut down, force powered off, already off, or a Tools-unavailable hint.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"vm_name": "<vm_name>"
},
"name": "vm_power_off"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| force | No | ||
| target | No | ||
| vm_name | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |