docs(runbook): add guest IP discovery to §2

Document `vmrun getGuestIPAddress` (run as ci-runner) for templates and
clones as the prerequisite for `validate guest`, with the AGENTS.md #1
"Error: on stdout" gotcha. Update the validate-guest Linux example to the
live template IP.
This commit is contained in:
2026-06-08 21:26:07 +02:00
parent 0b0d5486f0
commit 7f615333b6
+23 -3
View File
@@ -91,13 +91,33 @@ ci validate host ; echo "exit=$?"
Checks vmrun, template snapshots, keyring, `/var/lib/ci` permissions, `act-runner`
unit. Exit `0` + all `[OK ]`; a `[FAIL]` line names the broken check.
### Find a running guest's IP (needed for `validate guest`)
`vmrun getGuestIPAddress` reads the IP from VMware Tools — the VM must be
**powered on** and Tools running. Run it as `ci-runner` (the VMs are started by
that user, so its `vmrun` inventory is the one that sees them):
```bash
# Linux template
sudo -u ci-runner vmrun getGuestIPAddress /var/lib/ci/templates/LinuxBuild2404/LinuxBuild2404.vmx
# Windows template
sudo -u ci-runner vmrun getGuestIPAddress /var/lib/ci/templates/WinBuild2025/WinBuild2025.vmx
# A build clone (glob the job dir)
sudo -u ci-runner vmrun getGuestIPAddress /var/lib/ci/build-vms/Clone_*/Clone_*.vmx
# List which VMs are powered on first
sudo -u ci-runner vmrun list
```
> **Gotcha (AGENTS.md #1):** `getGuestIPAddress` can exit `0` and print
> `Error: The VMware Tools are not running...` on stdout when Tools are down.
> A line starting with `Error:` means *no IP yet* — wait for boot, don't parse it.
### `validate guest` — diagnose a running guest's transport
```bash
ci validate guest --host 192.168.79.200 --ssh --guest-os linux # SSH
ci validate guest --host 192.168.79.201 --winrm --guest-os windows # WinRM
ci validate guest --host 192.168.79.128 --ssh --guest-os linux # SSH (Linux)
ci validate guest --host 192.168.79.201 --winrm --guest-os windows # WinRM (Windows)
```
Connects + runs a trivial command, printing the explicit cause on failure
(connect vs auth vs command). The guest must already be booted.
(connect vs auth vs command). The guest must already be booted — get its IP
with `getGuestIPAddress` above.
### `monitor disk` — free-space alert
```bash