feat: add LXC container support to Proxmox extension

- Add is_lxc boolean column to ext_proxmox_nodes (default false, existing nodes unaffected)
- Add LXC checkbox to admin node creation form (disabled on edit)
- Dynamic API path selection via Node::vmType() (returns 'lxc' or 'qemu')
- LXC deployment: syncLxcSettings() for cores, memory, swap, hostname, rootfs, net config
- LXC network uses name=eth0 format with applyLxcPoolSettings() for VLAN/firewall/MTU
- All lifecycle operations LXC-aware: install, suspend, unsuspend, terminate, upgrade, reinstall
- VNC/xterm console uses correct type (lxc vs kvm)
- All 20+ Livewire components use vmType() for Proxmox API paths
- LXC user interface shows basic-only view (no advanced toggle, no KVM-specific tabs)
- Basic tabs for LXC: Overview, Network Configuration, Backups, Console
This commit is contained in:
2026-03-02 07:11:25 -05:00
parent a98bbd6d82
commit 5f2e591c6e
21 changed files with 330 additions and 140 deletions

View File

@@ -80,7 +80,7 @@ class System extends Component
{
try {
$proxmox = new Proxmox;
$config = $proxmox->request('/nodes/' . $this->server->node->name . '/qemu/' . $this->server->vm_id . '/config')->json()['data'] ?? [];
$config = $proxmox->request('/nodes/' . $this->server->node->name . '/' . $this->server->node->vmType() . '/' . $this->server->vm_id . '/config')->json()['data'] ?? [];
$this->machineType = (string) ($config['machine'] ?? '');
$this->biosType = (string) ($config['bios'] ?? $this->biosType);
@@ -350,7 +350,7 @@ class System extends Component
try {
$proxmox = new Proxmox;
$proxmox->request(
'/nodes/' . $this->server->node->name . '/qemu/' . $this->server->vm_id . '/config',
'/nodes/' . $this->server->node->name . '/' . $this->server->node->vmType() . '/' . $this->server->vm_id . '/config',
'put',
$payload
);
@@ -476,7 +476,7 @@ class System extends Component
// This will log "update VM {vmid}: -delete {deviceKey}" in Proxmox
// Note: This may create an "unused" entry if the volume still exists
$proxmox->request(
'/nodes/' . $this->server->node->name . '/qemu/' . $this->server->vm_id . '/config',
'/nodes/' . $this->server->node->name . '/' . $this->server->node->vmType() . '/' . $this->server->vm_id . '/config',
'put',
['delete' => $deviceKey]
);
@@ -538,7 +538,7 @@ class System extends Component
try {
// Get current VM config to check for unused entries
$config = $proxmox->request(
'/nodes/' . $this->server->node->name . '/qemu/' . $this->server->vm_id . '/config'
'/nodes/' . $this->server->node->name . '/' . $this->server->node->vmType() . '/' . $this->server->vm_id . '/config'
)->json()['data'] ?? [];
// Extract just the volume name part (e.g., "vm-202500014-efidisk0" from "cephpool:vm-202500014-efidisk0")
@@ -556,7 +556,7 @@ class System extends Component
// Delete the unused entry
try {
$proxmox->request(
'/nodes/' . $this->server->node->name . '/qemu/' . $this->server->vm_id . '/config',
'/nodes/' . $this->server->node->name . '/' . $this->server->node->vmType() . '/' . $this->server->vm_id . '/config',
'put',
['delete' => $key]
);
@@ -686,7 +686,7 @@ class System extends Component
try {
$proxmox = new Proxmox;
$proxmox->request(
'/nodes/' . $this->server->node->name . '/qemu/' . $this->server->vm_id . '/config',
'/nodes/' . $this->server->node->name . '/' . $this->server->node->vmType() . '/' . $this->server->vm_id . '/config',
'put',
[$slot => $definition]
);