[PR #360] [MERGED] feat: Add VM/LXC cloning functionality #384

Closed
opened 2026-02-26 12:41:12 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/community-scripts/ProxmoxVE-Local/pull/360
Author: @michelroegl-brunner
Created: 11/29/2025
Status: Merged
Merged: 11/29/2025
Merged by: @michelroegl-brunner

Base: mainHead: feat/clone_lxc_vm


📝 Commits (1)

  • dd17d2c feat: Add VM/LXC cloning functionality

📊 Changes

10 files changed (+1462 additions, -50 deletions)

View changed files

📝 server.js (+424 -2)
src/app/_components/CloneCountInputModal.tsx (+129 -0)
📝 src/app/_components/InstalledScriptsTab.tsx (+275 -14)
📝 src/app/_components/ScriptInstallationCard.tsx (+12 -1)
📝 src/app/_components/StorageSelectionModal.tsx (+20 -10)
📝 src/app/_components/Terminal.tsx (+40 -11)
📝 src/server/api/routers/installedScripts.ts (+562 -9)
📝 src/server/services/backupService.ts (+0 -1)
📝 src/server/services/githubJsonService.ts (+0 -1)
📝 src/server/services/storageService.ts (+0 -1)

📄 Description

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

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/community-scripts/ProxmoxVE-Local/pull/360 **Author:** [@michelroegl-brunner](https://github.com/michelroegl-brunner) **Created:** 11/29/2025 **Status:** ✅ Merged **Merged:** 11/29/2025 **Merged by:** [@michelroegl-brunner](https://github.com/michelroegl-brunner) **Base:** `main` ← **Head:** `feat/clone_lxc_vm` --- ### 📝 Commits (1) - [`dd17d2c`](https://github.com/community-scripts/ProxmoxVE-Local/commit/dd17d2cbeca901efc7e5cbd629284f7bc8f2aacb) feat: Add VM/LXC cloning functionality ### 📊 Changes **10 files changed** (+1462 additions, -50 deletions) <details> <summary>View changed files</summary> 📝 `server.js` (+424 -2) ➕ `src/app/_components/CloneCountInputModal.tsx` (+129 -0) 📝 `src/app/_components/InstalledScriptsTab.tsx` (+275 -14) 📝 `src/app/_components/ScriptInstallationCard.tsx` (+12 -1) 📝 `src/app/_components/StorageSelectionModal.tsx` (+20 -10) 📝 `src/app/_components/Terminal.tsx` (+40 -11) 📝 `src/server/api/routers/installedScripts.ts` (+562 -9) 📝 `src/server/services/backupService.ts` (+0 -1) 📝 `src/server/services/githubJsonService.ts` (+0 -1) 📝 `src/server/services/storageService.ts` (+0 -1) </details> ### 📄 Description ## 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 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-26 12:41:12 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/ProxmoxVE-Local#384
No description provided.