Repository navigation
Add a real SSH-reachability signal to fc/ch's List() - #1105
Merged
Merged
Conversation
Status only ever reflected "the VMM process is alive" (set once at Deploy time, checked afterward via isAlive's process-liveness check), never "the guest OS actually finished booting" -- for a Windows/ch guest in particular, that gap can be minutes wide, but any dashboard polling `onctl ls` mid-boot would already see Status=="running" and have no way to tell a genuinely usable VM apart from one that's still booting. List() now also TCP-probes (300ms timeout, concurrently across every not-yet-confirmed VM, so this doesn't meaningfully slow down `ls`) each running VM's SSH port and reports the result as a new Vm.SSHReady field, persisting a true result to that VM's metadata.json so it's never re-probed once confirmed. A deliberate TCP-connect check, not the full SSH auth handshake WaitForSSH already does at create time: reusing that would need the operator's actual private key material threaded into this package, and its passphrase-prompt fallback can block on stdin -- fine once, synchronously, in a CLI command a human is driving, but a real bug in List(), which also runs from an unattended, non-interactive periodic poll (see boxctl-vms-agent.sh). fc/ch also now persist each VM's actual SSHPort (previously implicit/hardcoded as 22 nowhere in particular) so the probe targets the right one. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012iVNj3mykz8m7QfuxWN3ae
2 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Statusonly ever reflected "the VMM process is alive" (set at Deploy time, checked afterward viaisAlive's process-liveness check), never "the guest OS actually finished booting" -- for a Windows/chguest, that gap can be minutes wide, but any consumer pollingonctl lsmid-boot has no way to tell a genuinely usable VM apart from one still booting.List()now also TCP-probes each running VM's SSH port (300ms timeout, concurrently across every not-yet-confirmed VM) and reports the result as a newVm.SSHReadyfield, persistingtrueonce confirmed so it's never re-probed again.WaitForSSH's handshake would need the operator's private key material threaded intopkg/cloud, and its passphrase-prompt fallback can block on stdin -- fine synchronously in a CLI command, a real bug inList(), which also runs unattended from a periodic poll (seeboxctl-vms-agent.sh).fc/chnow persist each VM's actualSSHPort(previously implicit/hardcoded as 22 nowhere in particular) so the probe targets the right one.Found while adding a "don't show Terminal until the VM is actually ready" indicator to the boxctl-vms dashboard -- discovered
onctl lshad no signal for that distinction at all.Test plan
go build ./...,go vet ./pkg/cloud/...,gofmt -lcleango test ./pkg/cloud/...-- new tests coverProbeTCP/ProbeSSHReadydirectly (reachable/unreachable/no-IP), andch'sList()end-to-end against a real local listener (becomesSSHReady, persists to metadata.json) and against a freshly-deployed VM with no reachable IP (staysfalse, no false positive)🤖 Generated with Claude Code