Skip to content

Windows: create a warm/golden AMI from the imported one to skip Sysprep first-boot on every launch #98

Closed

Description

@scttfrdmn

Problem

The AMI produced by spawn image import (EC2 Image Builder import-disk-image)
pays the full Windows Sysprep Specialize + OOBE first-boot cost on EVERY
launch — observed ~20 min on t3.large and still several+ min on m7i.xlarge
("Getting ready" splash). The bottleneck is the OOBE/specialize work, not just
instance CPU, so it can't be fixed by sizing up. Every spawn launch of the
imported AMI is therefore slow.

Idea (golden/warm AMI)

Launch the imported AMI once, let it finish first-boot setup (+ SSM agent +
spored + AWS drivers all settled), then create a NEW AMI from that running
instance. The second ("warm") AMI skips the import/OOBE tax and boots like a
normal AMI.

spawn already has the building block: spawn ami create <instance> (sibling
of the ami delete/ami snapshots added in #83). So the flow becomes:
image import (one-time, slow) → launch → spawn ami create → launch the warm
AMI thereafter (fast).

Design question: generalize or not?

  • Non-generalized warm AMI boots straight to ready (fastest), but all
    instances share one machine SID — fine for spawn's ephemeral throwaway
    workers, not for domain-join/fleets.
  • Sysprep-generalized warm AMI re-specializes on launch (still much faster
    than import, safe for fleets).

Probably: default to non-generalized for spawn's single-ephemeral model, with an
option to generalize. Possibly fold a --warm/post-import step into the import
flow so spawn image import can optionally produce the warm AMI automatically
(launch → wait-ready → ami create → terminate the seed).

Acceptance

  • A documented (ideally one-command) path from the imported AMI to a warm AMI.
  • Launching the warm AMI reaches usable state in ~normal Windows boot time, not
    import-OOBE time.

Refs #83, #95.

Activity

  1. scttfrdmn commented on Jun 11, 2026

    @scttfrdmn
    ContributorAuthor

    Decision (with maintainer): the warm-AMI step should be baked into the spawn
    Windows flow
    , not just documented. Live test confirmed the need — an imported
    AMI took ~35 min to first-boot (Sysprep Specialize) before SSM registered, even
    on m7i.xlarge; the OOBE tax is per-launch on the imported image.

    Proposed: spawn image import for Windows automatically produces the fast warm
    AMI as a final stage — import (slow, one-time) → launch a seed instance →
    wait until ready (password available / SSM Online, i.e. first boot + EC2Launch
    user-data done) → spawn ami create the warm AMI → terminate the seed. The warm
    AMI is what users launch thereafter (normal boot time). Default to
    non-generalized for spawn's ephemeral model; --generalize option for fleets.
    A flag (e.g. --no-warm) can opt out for the raw import.

    This pairs with #95 (the connect work just verified): on a warm AMI, SSM/spored
    are already installed + running, so connect is fast and reliable from boot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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