From fdb5714e9321aff98bbfec3e3c00370fba34a1e5 Mon Sep 17 00:00:00 2001 From: baodev0 Date: Mon, 13 Jul 2026 12:08:42 +0700 Subject: [PATCH] Update IP reservation logic to include 'reserved' status in available IPs --- app/Jobs/VirtualMachine/Provision/AssignIpToGuestJob.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/app/Jobs/VirtualMachine/Provision/AssignIpToGuestJob.php b/app/Jobs/VirtualMachine/Provision/AssignIpToGuestJob.php index 51387aa..ca9bb50 100644 --- a/app/Jobs/VirtualMachine/Provision/AssignIpToGuestJob.php +++ b/app/Jobs/VirtualMachine/Provision/AssignIpToGuestJob.php @@ -304,9 +304,7 @@ class AssignIpToGuestJob implements ShouldQueue ->toArray(); $ipPool = IpPool::where('module_network_id', $networkId) - ->where('status', 'free') - ->whereNotNull('gateway') - ->where('gateway', '!=', '') + ->whereIn('status', ['free', 'reserved']) ->whereNotIn('ip_address', $usedIps) ->lockForUpdate() ->inRandomOrder()