# Maintenance walkthroughs Worked procedures for routine host maintenance. Each one keeps running calculations intact and leaves a record of what happened. The long-form reference for every message and setting is in [operations](../operations.md). The examples use `compute-a` for a host that runs the vq daemon; replace it with your own host alias. ## Reboot a host with running jobs (#249) Use this for a kernel update or any other planned restart. vq carries the host's running local jobs across the reboot: each one is resubmitted exactly once after boot, in the same workspace and at the same place in the queue. **1. Preview.** This changes nothing: ```sh vq host prepare-reboot compute-a --reason "kernel update" ``` ```text 86ce11b762f4 running owner=1000 elapsed=6h12m wall=24h00m mark: no checkpoint request is available; ... 7a02c41de913 suspended owner=1001 elapsed=1h03m wall=4h00m unmarked: suspended by a user; pass --include-suspended ... pending jobs stay queued: 3 update vibeqc-dev: running: admin update is already running on this host ... blocker: 1 update(s) in flight; wait for them, or pass --interrupt-updates ... verdict: refused ``` Read it line by line: - **`mark`**: the job will be resubmitted after boot, even if it was submitted without `--auto-resume`. vq cannot ask a program to checkpoint. A program that writes restart files (CRYSTAL `fort.20`, a PySCF chkfile, an ORCA `.gbw`) picks them up, because the resubmit reuses the workspace. Anything else starts from the beginning. - **`unmarked`**: the job is left alone. A suspended job is marked only with `--include-suspended`, because a user paused it on purpose. - **`unaffected`**: a scheduler job running on its cluster, which this host's reboot does not touch. - **`update`**: an admin update or build job is still running. Rebooting would interrupt it, so the apply is refused until it finishes. Administrators can see the same preview in the dashboard, under **Fleet → Host settings → Preview planned reboot**. From there they can also prepare the reboot (step 2, without `--interrupt-updates` or `--include-suspended`) and finish or cancel it (step 4). The dashboard applies only the preview the administrator reviewed: if the host's jobs or updates changed meanwhile, it applies nothing and asks for a new preview. See [host settings](../machine_keys.md). **2. Apply.** When the update has finished, or once you decide to interrupt it: ```sh vq host prepare-reboot compute-a --reason "kernel update" --apply # or: ... --apply --interrupt-updates (then `vq admin recover-update` after boot) ``` Apply holds new dispatch first, then marks the jobs. Pending jobs keep their places and wait. Reboot only once the last line reads `verdict: safe to reboot`. If the verdict names a job that was not marked (one that started a moment before the hold), run the same `--apply` command again. Re-running it is safe. **3. Reboot.** Use the host's normal procedure. **4. After boot.** On Linux the daemon finishes the plan by itself on its first start in the new boot: - it resubmits each marked job once, with `parent_jobid` pointing to the old job; - it lifts the hold it took, but only if that hold is still the one prepare set; - it writes a record under `/planned-reboot-records/`. Check the result: ```sh vq queue compute-a # the resubmitted jobs, pending or running vq host reboot-status compute-a # no plan left once the daemon finished it vq admin status compute-a --verbose # only if you interrupted an update ``` A daemon restart *without* a reboot resubmits nothing: every mark records the boot it was made in. **Hosts without a boot identity, and cancelled reboots.** macOS reports no boot identity, so the daemon cannot tell that a reboot happened. Finish by hand after the reboot, or to call off a prepared reboot: ```sh vq host finish-reboot compute-a ``` Finish clears the marks on jobs that are still running and lifts the hold prepare took. It leaves alone a drain that was in place before prepare, or that an operator changed afterwards. ## A host held for memory pressure (#263) The watchdog pauses (SIGSTOPs) running jobs when the host's memory use crosses 85% *and* something other than vq's own jobs holds at least 10% of RAM, such as a desktop session or a large sync. While jobs are paused, no new job starts on that host. **What you see:** ```text $ vq status compute-a 0123456789ab pending: dispatch is held for host memory pressure: 1 job(s) paused by the watchdog (fedcba987654) for up to 1h12m05s, past the 1h00m00s bound; ... ``` The paused job shows `suspended` in `vq queue`, and the dashboard shows a pressure banner. **What happens without you:** - The jobs resume when memory use falls to 70%. - They also resume once the other consumers shrink to 5% of RAM or less. A paused job keeps its own memory, so a single large job never waits for pressure it causes itself. - If vq's own jobs are the only real consumers, the watchdog does not pause them at all. Their per-job memory limits (`mem_mb`, cgroup `MemoryMax`, the 90% host RSS kill) govern their growth instead. **When to step in:** once a pause outlasts `[daemon] host_pressure_max_pause_minutes` (default 60), the daemon logs one warning, `vq status` of the paused job adds a `pause_bound:` line, and the banner shows the duration. Nothing is killed. When the other consumers hold less than 10% of RAM, or vq cannot measure them, the daemon resumes the largest paused job and starts the bound again for the rest. When something outside vq holds the memory, the jobs stay paused. Either free memory on the host (close the other program), or, if the pressure is acceptable, resume the job yourself: ```sh vq resume compute-a fedcba987654 ``` To change the bound, set it in the host's configuration and restart the daemon. Older vq versions refuse this key, so set it only where every reader understands it; see [version compatibility](../version_compatibility.md): ```toml [daemon] host_pressure_max_pause_minutes = 120 ``` ## Hold new work without touching running work For a shorter interruption, such as a backup or a benchmark on the host itself, a drain is enough: ```sh vq drain compute-a --reason "backup window" --duration 2h vq drain compute-a --status vq drain compute-a --release ``` Running jobs continue; only new dispatch waits. See [draining a host](../drain.md) for partial and scheduler-target drains.