Skip to content

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

Closed

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.

Activity

  1. added
    enhancement
    on May 31, 2026
  2. scttfrdmn commented on Jun 3, 2026

    @scttfrdmn
    ContributorAuthor

    This is now also blocking nf-spawn (spore-host/nf-spawn#21): when nf-spawn dispatches tasks with --ami ami-xxx, spawn defaults to 20 GB and fails with InvalidBlockDeviceMapping: Volume of size 20GB is smaller than snapshot, expect size >= 40GB. If spawn auto-detected the minimum volume size from the AMI's BlockDeviceMappings, neither spawn users nor nf-spawn plugin authors would need to track this manually.

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

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions