Skip to content

Reclaim inactive image staging after failed or cancelled MicroVM creation #3953

Description

@shiju-nv

User Story

As a user cancelling or recovering a failed sandbox create, I want its preparation work and temporary files cleaned up, so that failed setup does not keep consuming disk space or interfere with another sandbox.

Problem Statement

After the recorded cold-image attempt failed, approximately 5.7 GiB of inactive staging remained and required manual removal. The source aborts an asynchronous provisioning task, while some image work runs in blocking operations whose completion and cleanup can outlive that task.

Impact / Why This Matters

Repeated failures can leave substantial temporary disk usage. Users must identify which files are abandoned before reclaiming space, with a risk of deleting data still used by a running sandbox or another preparation attempt.

Acceptance Criteria

  • Cancellation during download, extraction, formatting and cache publication reaches a bounded terminal cleanup result.
  • A restarted driver identifies inactive staging and reclaims it without deleting active sandbox data.
  • Concurrent creates using the same image retain valid shared data and complete or fail independently.
  • Retry after an interrupted cache publication uses a valid cache or rebuilds it safely.
  • Tests distinguish an aborted async task from completion of blocking operations and owned child processes.

Reproduction Steps

  1. Start an uncached VM create using the large bootstrap/image path that exceeds the current provisioning window, or inject a preparation failure at the same phase in a controlled fixture.
  2. Let the create enter its terminal error state.
  3. Inspect task-owned staging and establish that no active preparation or sandbox references it before removal.
  4. The recorded investigation found and removed 5,965,596 KiB of inactive staging while preserving the active bootstrap, workload image, overlay templates and running sandbox

Environment

  • OpenShell: v0.1.2; current-source comparison at b8ffe5244cb244a1d74a4a03d69afe3da07e5f08.
  • Platform: Apple Silicon macOS 26.7; MicroVM backend.
  • Installation: released CLI, gateway and VM driver

Logs

Activity

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

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions