Skip to content

--spot launches one-time Spot requests, which EC2 cannot stop — idle-stop, on-idle/on-complete stop, hibernate and 'spawn stop' can never work for --spot #922

Closed

Description

@scttfrdmn

Version: spawn 0.128.2 (38b2d66), us-west-2.

spawn launch demo --instance-type m8a.4xlarge --spot --ttl 1h --idle-timeout 15m -y creates a one-time Spot request with InstanceInterruptionBehavior=terminate:

$ aws ec2 describe-spot-instance-requests --spot-instance-request-ids sir-pjiznzjg \
    --query 'SpotInstanceRequests[0].[Type,InstanceInterruptionBehavior]'
one-time   terminate

EC2 refuses to stop such an instance:

$ spawn stop demo --yes
Saving remaining TTL: 22m (deadline: 2026-10-15 17:59 UTC)
failed to stop instance: ... api error UnsupportedOperation: You can't stop the Spot Instance
'i-028c23f816d2eb68e' because it is associated with a one-time Spot Instance request. You can
only stop Spot Instances associated with persistent Spot Instance requests.

So for every --spot launch, all stop-based lifecycle actions are impossible: --idle-timeout (default action stop), --on-idle stop|hibernate, --on-complete stop|hibernate, spawn stop, spawn hibernate. spawn status still promises the opposite for this instance:

Idle timeout:          15m (stops the instance when idle; never terminates)
Billable resources:
  instance  i-028c23f816d2eb68e    ~$0.9738/hr              m8a.4xlarge (spot)

(Separately, idle never triggered here because of #919. Once #919 is fixed, the idle-stop call would hit this error.)

Suggested (any of):

  1. When a stop-based action is requested with --spot, request a persistent Spot request with InstanceInterruptionBehavior=stop (and cancel the request when the instance is terminated, or it relaunches).
  2. Or validate at launch: refuse or warn on --spot + stop/hibernate actions, and treat idle as terminate for one-time Spot. Say so in the launch summary and in status ("Idle timeout: 15m — terminates (one-time Spot can't stop)").
  3. Make spawn stop explain this up front instead of printing "Saving remaining TTL" and then failing.

Context: a talk demo planned "launch → idle → stops → spawn connect restarts it" with --spot (as on the slide). That can't work as specified.

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