Skip to content

spawn launch: should auto-detect minimum volume size from AMI snapshot #25

Description

@scttfrdmn

Summary

When launching from a custom AMI whose root snapshot is larger than spawn's default volume size, spawn launch fails with:

api error InvalidBlockDeviceMapping: Volume of size 20GB is smaller than snapshot 'snap-0e4706350e689...', expect size >= 80GB

The user is forced to pass --volume-size 80 explicitly, even though the correct minimum is already encoded in the AMI's block device mapping.

Expected behaviour

spawn launch --ami ami-0abc... should query the AMI's BlockDeviceMappings and use max(default_size, snapshot_minimum) as the volume size automatically — the same logic that the EC2 console applies when launching from a custom AMI.

Steps to reproduce

  1. Bake a custom AMI with an 80 GB root volume (common for data science / bioinformatics AMIs with large pre-installed databases)
  2. spawn launch my-instance --ami <custom-ami-id> --instance-type t4g.small -y
  3. InvalidBlockDeviceMapping error

Workaround

Pass --volume-size 80 explicitly. This requires users to know the AMI's snapshot size out of band.

Context

https://github.com/scttfrdmn/aws-microbiome-demo — the demo bakes an AMI with 80 GB to fit Kraken2 + MetaPhlAn databases (~40 GB). Every instance launched from this AMI needs --volume-size 80, which isn't obvious and isn't documented anywhere in the AMI metadata shown to users.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions