diff --git a/extensions/Servers/Proxmox/Livewire/Network.php b/extensions/Servers/Proxmox/Livewire/Network.php index 6bf919bb5..5c85758ef 100644 --- a/extensions/Servers/Proxmox/Livewire/Network.php +++ b/extensions/Servers/Proxmox/Livewire/Network.php @@ -18,6 +18,8 @@ class Network extends Component public array $disconnectedConfigs = []; + public array $interfaceMultiqueues = []; + public string $interfaceType = 'virtio'; public string $selectedInterface = 'net0'; @@ -83,6 +85,7 @@ class Network extends Component $mac = null; $mtu = null; $linkdown = false; + $queues = 1; foreach ($segments as $segment) { if (!str_contains($segment, '=')) { @@ -100,6 +103,8 @@ class Network extends Component $mtu = $segmentValue; } elseif (strtolower($segmentKey) === 'link_down' || strtolower($segmentKey) === 'linkdown') { $linkdown = (bool) $segmentValue; + } elseif (strtolower($segmentKey) === 'queues') { + $queues = max(1, (int) $segmentValue); } } @@ -108,6 +113,7 @@ class Network extends Component 'mac' => $mac, 'mtu' => $mtu, 'linkdown' => $linkdown, + 'queues' => $queues, ]; } @@ -119,6 +125,7 @@ class Network extends Component $model = 'virtio'; $mac = null; $mtu = null; + $queues = 1; foreach ($segments as $segment) { if (!str_contains($segment, '=')) { @@ -134,6 +141,8 @@ class Network extends Component continue; } elseif (strtolower($segmentKey) === 'mtu') { $mtu = $segmentValue; + } elseif (strtolower($segmentKey) === 'queues') { + $queues = max(1, (int) $segmentValue); } } @@ -142,6 +151,7 @@ class Network extends Component 'mac' => $mac, 'mtu' => $mtu, 'linkdown' => true, + 'queues' => $queues, ]; } } @@ -153,6 +163,7 @@ class Network extends Component 'mac' => null, 'mtu' => null, 'linkdown' => false, + 'queues' => 1, ], ]; $configs = ['net0' => '']; @@ -171,6 +182,7 @@ class Network extends Component 'mac' => null, 'mtu' => null, 'linkdown' => false, + 'queues' => 1, ], ]; $configs = ['net0' => '']; @@ -270,6 +282,22 @@ class Network extends Component return '/' . $bits; } + public function getCpuCores(): int + { + try { + $proxmox = new Proxmox; + $config = $proxmox->request('/nodes/' . $this->server->node->name . '/qemu/' . $this->server->vm_id . '/config')->json()['data'] ?? []; + + // CPU cores can be specified with 'cores' or 'cpus' in Proxmox config + $cores = (int) ($config['cores'] ?? $config['cpus'] ?? 1); + + return max(1, $cores); + } catch (\Exception $e) { + // Fallback to 1 if unable to retrieve + return 1; + } + } + public function isPublicIp($ip, $type = 'ipv4') { if ($type === 'ipv6' || filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6)) { diff --git a/extensions/Servers/Proxmox/views/help.blade.php b/extensions/Servers/Proxmox/views/help.blade.php index 8b38d9bc3..b9342cd9c 100644 --- a/extensions/Servers/Proxmox/views/help.blade.php +++ b/extensions/Servers/Proxmox/views/help.blade.php @@ -5851,8 +5851,6 @@ filter strict_import { - -