vm_guest_provision
Execute ordered guest operations to provision a VM; preview steps before applying to avoid incomplete configurations.
Instructions
[WRITE] Provision a VM by running an ordered sequence of guest operations.
Prefer this over repeated vm_guest_exec / vm_guest_upload calls when the steps form one provisioning run. Steps stop on the first failure, so a partial run leaves the guest half-configured. Requires VMware Tools running in the guest.
Without confirm=True this only previews: blast_radius names the VM (name, instance UUID), the guest account and every step it would run, in order, with counts per type, local file sizes and any blockers; nothing runs. Show it to the user. Do not set confirm=True on your own because the user asked earlier: they have not seen the preview yet. Refused outright: VM not powered on, VMware Tools not running, an empty step list, a step with an unknown type or a missing key, an upload whose local file is missing or unreadable, a service step on a Windows guest, an unreadable identity or status, or a name that matches more than one VM.
Step types:
exec: {"type": "exec", "command": "apt-get install -y nginx"}
upload: {"type": "upload", "local_path": "...", "guest_path": "..."}
service: {"type": "service", "name": "nginx", "action": "start"}
Returns: dict with success, completed_steps, total_steps, results, error, and blast_radius.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| steps | Yes | Ordered list of step dicts (see Step types). | |
| target | No | Optional vCenter/ESXi target name from config. | |
| confirm | No | False (default) returns the blast radius and changes nothing. True applies it. | |
| timeout | No | Per-step timeout in seconds (default 300). | |
| vm_name | Yes | Target VM name. | |
| password | Yes | Guest OS password. | |
| username | Yes | Guest OS username. |