Provisions & event handlers
provision {} scripts run on vmlab up (failure is fatal); on "event" {} handlers react to lifecycle events (failure is logged).
Provision scripts run on vmlab up in declaration order; event handlers react to lifecycle events. Both are wscript files — see the provision block and the event handler block for the declarations.
Provision failures fail vmlab up; handler failures are logged, never fatal. A scoped provision (vms = [...]) gates depends_on on those VMs: dependents wait for the provision to finish. See the event list for every event name.
§ 1Examples
§ 1.1A crash event handler
fn handle(event, lab): screenshot the crashed VM. Failures here are logged, never fatal.
rust
use vmlab
lab.log
let Ok = lab.vm else
match vm.screenshot Ok => lab.log,
Err => lab.log,
}
}