Skip to content

feat: add server clone functionality#71

Merged
larkly merged 10 commits intomainfrom
worktree-shimmying-shimmying-otter
Mar 28, 2026
Merged

feat: add server clone functionality#71
larkly merged 10 commits intomainfrom
worktree-shimmying-shimmying-otter

Conversation

@larkly
Copy link
Copy Markdown
Owner

@larkly larkly commented Mar 28, 2026

Summary

  • Add Horizon-style server cloning via c keybinding from server list and detail views
  • Pre-fills create form with source server config (image, flavor, network, keypair, security groups) and deduplicated name (-clone, -clone-2, etc.)
  • Optional volume cloning checkbox: clones all attached volumes via SourceVolID, polls every 3s, auto-attaches to new server after it reaches ACTIVE state
  • Progress modal with per-volume status indicators and full rollback on failure (deletes cloned volumes + server), with error modal showing the actual cause
  • Volume deletion checkbox on server delete confirmation: detaches and deletes attached volumes when deleting a server

Test plan

  • Press c on a server in list view — clone form opens pre-filled with matching config
  • Press c on a server in detail view — same behavior
  • Verify name dedup: clone same server twice, second gets -clone-2
  • Verify deleted source image leaves image field empty
  • Submit without volume clone — server created, returns to list
  • Submit with volume clone — progress modal shows, volumes clone and attach
  • Volumes wait for server to reach ACTIVE before attaching (no 409 errors)
  • Test rollback: quota-exceed or cancel mid-clone — error modal shows actual cause, server and volumes cleaned up
  • Press Esc on progress modal — modal dismisses, operations continue in background
  • Delete a server with volumes — checkbox offered to delete attached volumes
  • Confirm delete with volume checkbox checked — server and volumes both deleted
  • Help screen (?) shows c clone server in both server list and detail sections

larkly added 10 commits March 28, 2026 20:02
Add Horizon-style server cloning triggered by pressing 'c' from the
server list or detail view. Opens the create form pre-filled with the
source server's configuration (image, flavor, network, keypair, security
groups) and a deduplicated clone name. Optionally clone all attached
volumes via a checkbox, with an async progress modal showing per-volume
status, 3s polling, and full rollback (delete cloned volumes + server)
on any failure.
…immying-otter

# Conflicts:
#	src/internal/ui/help/help.go
Move volume.ListVolumes from synchronous call in Update to async in
cloneprogress Init, preventing UI blocking. Show an error modal instead
of a brief sticky hint when volume cloning fails, so the user can
actually read the error before dismissing.
Pass the original volume error through RollbackCompleteMsg so the error
modal displays the real reason (e.g. quota exceeded, permission denied)
instead of a generic "clone failed" message.
The server may still be in BUILD state when volumes finish cloning.
Poll the server status and queue volume attachments until the server
is ACTIVE, avoiding 409 conflictingRequest errors.
Show a volume deletion checkbox in the delete confirmation dialog when
the server has attached volumes. Press space to toggle. When confirmed,
volumes are detached and deleted after the server is removed.
@larkly larkly merged commit 1653c96 into main Mar 28, 2026
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.

1 participant