Skip to content

EC2: Add EBS volume operations (CreateVolume, DescribeVolumes, AttachVolume, DetachVolume, DeleteVolume, DeleteSnapshot) #256

Closed

Description

@scttfrdmn

Summary

EBS volume operations are missing from the EC2 plugin. This blocks any workload that provisions persistent storage for EC2 instances.

Missing Operations

Operation Description
CreateVolume Provision a new EBS volume in a given AZ
DescribeVolumes List/filter volumes by ID, state, attachment status
DeleteVolume Delete a volume (must be in available state)
AttachVolume Attach a volume to a running/stopped instance
DetachVolume Detach a volume from an instance
DeleteSnapshot Delete an EBS snapshot (needed for AMI deregistration cleanup)

Expected Behavior

  • CreateVolume returns a volume in creating → available state transition
  • DescribeVolumes supports filters: volume-id, status, attachment.instance-id
  • AttachVolume transitions volume to in-use and associates it with the instance
  • DetachVolume transitions volume back to available
  • DeleteVolume fails if volume is in-use
  • State should be queryable immediately after each operation (no eventual consistency delay needed in test mode)

Motivation

Used by Prism for persistent research workspace storage. The full attach/detach lifecycle (CreateVolume → AttachVolume → DetachVolume → DeleteVolume) is exercised in integration tests. Without these, Substrate cannot replace LocalStack for Prism's test suite.

Implementation Notes

These fit naturally in ec2_plugin.go following the existing instance/security-group patterns. A simple in-memory volume store (map keyed by volume ID) with state machine transitions (creating → available → in-use → available → deleted) should be sufficient.

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

    type: feature

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions