Skip to content

Stopped instances: 'spawn status' SSHes to ::1 (localhost) and fails; compute from earlier runs is dropped after restart; stop message says TTL pauses but it doesn't #928

Closed

Description

@scttfrdmn

Version: spawn/spored 0.128.2 (38b2d66), on-demand c8a.large, us-west-2.

spawn launch odtest --instance-type c8a.large --ttl 1h --idle-timeout 15m -y   # 17:42 UTC
spawn stop odtest --yes                                                          # stopped in 40 s
spawn status odtest          # 1 min later
spawn connect odtest -- 'uptime; sudo spored status'                             # 17:45

1. spawn status on a stopped instance fails, and tries localhost:

$ spawn status odtest
Looking up instance odtest...
Received disconnect from ::1 port 22:2: Too many authentication failures
failed to get status: exit status 255

A stopped instance has no public IP, and status appears to SSH to an empty host, which resolves to this machine's own sshd (::1), offering the user's keys to it. Expected: status works for stopped instances from EC2 data plus tags (state, stopped-since, TTL deadline, cost so far, the EBS cost accruing while stopped) without SSH. "What is this stopped box costing me?" is the main reason to run status on one. Also, never fall back to SSH to an empty or loopback host.

2. Compute from earlier boots is dropped after a restart. It ran ~1 min, was stopped ~2 min, then connect restarted it:

Elapsed:          3m 17s  (22s compute · 3m 17s boot)
Compute cost:     $0.00  (22s × $0.1078/hr)
Effective rate:   $0.0000/hr  (100% lower than continuous on-demand)

Compute should be about 1m 20s (the first run plus 22 s). It looks like spored's accounting restarts at each boot. Cumulative compute/cost should persist across stop/start (in a tag or EBS state), or "effective rate" isn't meaningful for exactly the stop/idle/restart pattern it's meant to show. Related: #896 (spot rate, frozen compute on a running instance).

3. spawn stop says the TTL pauses; it doesn't (good, but the message is wrong):

The instance will stop (EBS preserved).
TTL countdown will pause until the instance is started again.

After the restart: TTL: 56m 42s remaining (terminates 2026-10-15 18:42 UTC), which is the original launch + 1h deadline. So the deadline is fixed (as the docs and talk say, "Stop and start cannot extend it"), and the stop message should say "the TTL deadline (18:42 UTC) still applies".

What works well: spawn connect on a stopped instance printed Instance is stopped — starting it... and had a shell in 36 s. 👍

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions