Skip to content

feat: Add VM/LXC cloning functionality#360

Merged
michelroegl-brunner merged 1 commit intomainfrom
feat/clone_lxc_vm
Nov 29, 2025
Merged

feat: Add VM/LXC cloning functionality#360
michelroegl-brunner merged 1 commit intomainfrom
feat/clone_lxc_vm

Conversation

@michelroegl-brunner
Copy link
Copy Markdown
Member

Overview

This PR adds comprehensive VM/LXC cloning functionality to the application.

Features

  • Clone VMs and LXC containers with configurable count
  • Sequential ID retrieval (get next ID → clone → get next ID → clone, etc.)
  • Storage selection for clones (rootdir content only)
  • Hostname generation for cloned containers
  • Integration with VM/LXC detection from main branch
  • Real-time clone execution tracking via WebSocket

Changes

  • New CloneCountInputModal component for specifying clone count
  • Extended InstalledScriptsTab with clone handlers and state management
  • Added clone menu item to ScriptInstallationCard
  • Extended StorageSelectionModal to support clone storage selection
  • Added clone terminal support to Terminal component
  • Implemented startSSHCloneExecution in server.js with sequential ID retrieval
  • Added clone-related API endpoints:
    • getClusterNextId - Get single next available ID
    • getContainerType - Determine if container is VM or LXC
    • getCloneStorages - Get storages suitable for cloning (rootdir only)
    • generateCloneHostnames - Generate unique hostnames for clones
    • executeClone - Execute clone operation
    • addClonedContainerToDatabase - Add cloned container to database

Technical Details

  • Uses new VM/LXC detection logic from main branch
  • Sequential ID retrieval ensures each clone gets a unique ID
  • Storage filtering limited to rootdir content for cloning
  • Proper error handling and user feedback
  • TypeScript types and JSDoc annotations updated

Testing

  • Build passes without errors
  • All TypeScript and linting checks pass
  • Clone functionality tested with both VMs and LXC containers

- Add CloneCountInputModal component for specifying clone count
- Implement clone handlers and state management in InstalledScriptsTab
- Add clone menu item to ScriptInstallationCard
- Extend StorageSelectionModal to support clone storage selection (rootdir only)
- Add clone terminal support to Terminal component
- Implement startSSHCloneExecution in server.js with sequential ID retrieval
- Add clone-related API endpoints (getClusterNextId, getContainerType, getCloneStorages, generateCloneHostnames, executeClone, addClonedContainerToDatabase)
- Integrate with VM/LXC detection from main branch
- Fix storage fetching to use correct serverId parameter
- Fix clone execution to pass storage parameter correctly
- Remove unused eslint-disable comments
@michelroegl-brunner michelroegl-brunner requested a review from a team as a code owner November 29, 2025 15:54
@michelroegl-brunner michelroegl-brunner merged commit 07cf03a into main Nov 29, 2025
4 checks passed
@MickLesk MickLesk deleted the feat/clone_lxc_vm branch April 1, 2026 11:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant