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

@@ -48,8 +48,8 @@ class Component extends BaseComponent
return;
}
// Check storage quota before starting the VM
if ($action === 'start') {
// Check storage quota before starting the VM (KVM only)
if ($action === 'start' && !$this->server->node->is_lxc) {
$quotaCheck = $this->checkStorageQuota();
if ($quotaCheck !== true) {
$this->notify($quotaCheck, 'error');
@@ -59,8 +59,9 @@ class Component extends BaseComponent
try {
$proxmox = new Proxmox;
$vmType = $this->server->node->vmType();
$response = $proxmox->request(
'/nodes/' . $this->server->node->name . '/qemu/' . $this->server->vm_id . '/status/' . $action,
'/nodes/' . $this->server->node->name . '/' . $vmType . '/' . $this->server->vm_id . '/status/' . $action,
'post',
['vmid' => $this->server->vm_id]
);
@@ -97,8 +98,9 @@ class Component extends BaseComponent
// Get VM config to calculate total storage
$proxmox = new Proxmox;
$vmType = $this->server->node->vmType();
$configResponse = $proxmox->request(
'/nodes/' . $this->server->node->name . '/qemu/' . $this->server->vm_id . '/config'
'/nodes/' . $this->server->node->name . '/' . $vmType . '/' . $this->server->vm_id . '/config'
);
// Note: request() calls ->throw(), so response is always successful here
@@ -251,8 +253,9 @@ class Component extends BaseComponent
{
try {
$proxmox = new Proxmox;
$vmType = $this->server->node->vmType();
$response = $proxmox->request(
'/nodes/' . $this->server->node->name . '/qemu/' . $this->server->vm_id . '/status/current'
'/nodes/' . $this->server->node->name . '/' . $vmType . '/' . $this->server->vm_id . '/status/current'
);
$data = $response->json()['data'] ?? null;