Delete the dead ISO-eject step from provision-vm-from-host #20
No reviewers
Labels
No labels
bug
duplicate
enhancement
help wanted
invalid
question
wontfix
bug
duplicate
enhancement
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
allod/nexus!20
Loading…
Reference in a new issue
No description provided.
Delete branch "agent/drop-dead-iso-eject"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Deletes the two-line ISO-eject step in
scripts/provision-vm-from-hostthat could never have any effect.virsh change-mediawas passed neither--confignor--live, so against a running QEMU domain it mutated the live domain only — and that live domain is destroyed on the very next line. The persistent definition, which is exactly what the followingvirsh startboots from, was never touched. What actually makes the VM come back on the installed disk is thatvirt-install --cdromattaches the ISO for the install boot but leaves the media path empty in the persistent definition, so thedestroy/sleep 1/startsequence — deliberately left intact here — brings the domain back with no ISO in the drive.The step also swallowed its own failure twice, via
2>/dev/nulland via an[[ ... ]] && cmd || truechain that guarantees exit 0 regardless of outcome, which is theset -eanti-patternmemory/shell.mdnames and a violation ofarchitecture.mdprinciple 11. Itsawk '/cdrom/ {print $3}'also matched the wholedomblklist --detailsrecord rather than the Device column, so a Source path containing the substringcdromwould hand back a disk row's Target — harmless for--eject, a live foot-gun for anything destructive. Deleting the step removes both.The comment and echo above the restart now describe the destroy/start that actually works instead of an eject that no longer exists, and the stale
# --no-reboot: ...comment above thenixos-anywherecall is rewritten to describe the--phases disko,installselection that is genuinely in force — the invocation never passed--no-reboot; it relies on the phase list simply omitting the reboot phase.No replacement step was added. Per the issue's Scope section, a
virsh detach-diskto remove the leftover empty CD-ROM device is explicitly out of scope and not to be re-added: the device has no media path, carries no boot risk, and is not a host-to-guest data path, so a detach would arm the wrong-column targeting problem against a genuinely destructive command in order to solve a cosmetic non-problem (architecture.mdprinciples 14 and 15).The now-unreachable
*"domblklist alpha-dev --details"*)case was trimmed from the test suite'svirshstub; the stub still logs every invocation and exits 0, and the suite's only virsh assertion,grep -q 'start alpha-dev', is unchanged.Closes allod/nexus#19
Risk
R1. One host-side provisioning script; deletion only. Touches no key material, no secrets, no inventory, and no guest-facing state. Blast radius is a single host command sequence run by a human at the terminal, and any error would surface immediately and loudly at the next
virsh startduring a provisioning run — itself a destructive-and-repeatable operation on a disposable VM. Rollback is a one-commit revert.Validation
bash tests/provision-vm-from-host.sh— 8 provision-vm-from-host tests passed, 0 failures.shellcheck -x --source-path=SCRIPTDIR scripts/provision-vm-from-host tests/provision-vm-from-host.sh— clean, no findings.bash -non both changed files — clean.Host-side commands were not run:
virsh,virt-install,nixos-anywhere,nixos-rebuild, and the provisioning scripts themselves are human-gated and not installed in the dev VM. The empirical claim that a provisioned dev VM'svirsh dumpxml --inactiveshows the cdrom disk with no<source>element is carried over from the issue, which recorded it from the host.