Skip to content

feat(snapshot): accept instance name and auto-detect volumes#91

Merged
ivyleavedtoadflax merged 5 commits into
mainfrom
claude/review-open-issues-gIcZB
Apr 12, 2026
Merged

feat(snapshot): accept instance name and auto-detect volumes#91
ivyleavedtoadflax merged 5 commits into
mainfrom
claude/review-open-issues-gIcZB

Conversation

@ivyleavedtoadflax
Copy link
Copy Markdown
Owner

Summary

Closes #87. snapshot create now accepts an instance name to auto-detect attached volumes instead of requiring --volume-id.

  • Add positional instance_name argument to snapshot create (follows codebase convention for instance params)
  • Add --device / -D option to filter to a specific device (e.g., /dev/sdf)
  • --volume-id remains supported as the alternative single-volume path
  • When multiple volumes are found, snapshot names are auto-suffixed with the device name (e.g., backup-sda1, backup-sdf)
  • Partial failure handling: if one volume fails, remaining volumes are still snapshotted, with a summary at the end
  • Add get_volumes_for_instance utility; refactor get_volume_ids to delegate to it (DRY)

Usage

# Snapshot all volumes for an instance
remote snapshot create my-instance -n my-snapshot

# Snapshot only the data volume
remote snapshot create my-instance --device /dev/sdf -n my-snapshot

# Existing single-volume usage still works
remote snapshot create -v vol-123456 -n my-snapshot

Test plan

  • 27 snapshot tests pass (13 new, 14 existing)
  • Full suite: 1135 passed, 1 skipped
  • Ruff lint and format clean
  • Verified: single-volume path (--volume-id) unchanged
  • Verified: instance with single volume uses name as-is
  • Verified: instance with multiple volumes suffixes names with device
  • Verified: --device filters correctly
  • Verified: partial failure reports successes and failures
  • Verified: mutually exclusive options error correctly
  • Verified: instance resolution errors handled

https://claude.ai/code/session_018cz4V49XUdte4NBJfGR21S

claude added 5 commits April 12, 2026 15:59
Allow `snapshot create` to accept `--instance` to auto-detect attached
volumes instead of requiring `--volume-id`. Adds `--device` filter to
target a specific device when using `--instance`. When multiple volumes
are found, snapshot names are suffixed with the device name.

https://claude.ai/code/session_018cz4V49XUdte4NBJfGR21S
- Change --instance Option to positional Argument to match codebase
  convention (every other command uses typer.Argument for instance names)
- Add --device short flag -D for consistency with other options
- Add partial failure handling: when snapshotting multiple volumes, catch
  per-volume errors, continue with remaining volumes, and report a
  summary of successes/failures at the end
- Refactor get_volume_ids to delegate to get_volumes_for_instance (DRY)
- Fix stale test docstring (test_create_snapshot_missing_volume_id)
- Add test for instance resolution failure during create
- Add test for partial failure scenario

https://claude.ai/code/session_018cz4V49XUdte4NBJfGR21S
- Bump version 1.5.0 → 1.6.0
- Add changelog entry for snapshot create instance support
- Update README snapshot examples to show new instance-based usage
- Update CLAUDE.md CLI parameter patterns to reflect snapshot create changes

https://claude.ai/code/session_018cz4V49XUdte4NBJfGR21S
@ivyleavedtoadflax ivyleavedtoadflax merged commit cf9b0d3 into main Apr 12, 2026
0 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

snapshot create: accept instance name and auto-detect volumes

2 participants