diff --git a/web/app/Services/Cloud/CloudAdminResourceService.php b/web/app/Services/Cloud/CloudAdminResourceService.php index d4279e88..349990f7 100644 --- a/web/app/Services/Cloud/CloudAdminResourceService.php +++ b/web/app/Services/Cloud/CloudAdminResourceService.php @@ -411,9 +411,8 @@ final class CloudAdminResourceService ->whereColumn('public_pool.host_id', 'cloud_public_ips.host_id') ->whereColumn('network_attachment.host_id', 'cloud_public_ips.host_id') - // The engine reserves a literal management IPv4 implicitly; - // never advertise a stale panel row for that address. - ->whereColumn('cloud_public_ips.address', '<>', 'eligible_host.host') + // Gateway, DNS and management addresses are disabled while + // materializing the pool's reserved_ips ledger. ->whereColumn('network_attachment.network_selector', 'eligible_host.default_network') ->where(function ($query): void { @@ -454,7 +453,6 @@ final class CloudAdminResourceService ->whereNull('cloud_public_ips.instance_id') ->whereNull('cloud_public_ips.operation_id') ->whereColumn('cloud_public_ips.host_id', 'public_pool.host_id') - ->whereColumn('cloud_public_ips.address', '<>', 'eligible_host.host') ->whereColumn('cloud_public_ips.prefix_length', 'public_pool.guest_prefix_length') ->whereColumn('network_attachment.host_id', diff --git a/web/app/Services/Cloud/CloudEngineClient.php b/web/app/Services/Cloud/CloudEngineClient.php index aca6737b..f8debc2f 100644 --- a/web/app/Services/Cloud/CloudEngineClient.php +++ b/web/app/Services/Cloud/CloudEngineClient.php @@ -110,7 +110,7 @@ final class CloudEngineClient return $result; } - private static function safeAllowlistedError(?string $path, array $result, int $status): ?string + private static function safeAllowlistedError(?string $path, array $result, ?int $status = null): ?string { if ($path === null) { return null; diff --git a/web/app/Services/Cloud/CloudPanelUsageService.php b/web/app/Services/Cloud/CloudPanelUsageService.php index 9cea4753..c729189f 100644 --- a/web/app/Services/Cloud/CloudPanelUsageService.php +++ b/web/app/Services/Cloud/CloudPanelUsageService.php @@ -13,10 +13,14 @@ use App\Models\CloudResourceReservation; */ final class CloudPanelUsageService { - /** Return a literal management IPv4 that the engine reserves implicitly. */ + /** + * The panel deliberately does not persist the engine's SSH/management + * address in cloud_hosts. Operators must put a management IPv4 in the + * public-pool reserved_ips list, which is materialized into the ledger. + */ public static function managementAddress(?CloudHost $host): ?string { - return self::managementAddressFromValue($host?->host); + return null; } public static function managementAddressFromValue($value): ?string diff --git a/web/app/Services/Cloud/CloudPlacementService.php b/web/app/Services/Cloud/CloudPlacementService.php index 52857f37..aa227d95 100644 --- a/web/app/Services/Cloud/CloudPlacementService.php +++ b/web/app/Services/Cloud/CloudPlacementService.php @@ -745,6 +745,9 @@ final class CloudPlacementService if ($lineId < 1) { return []; } + // Management, gateway, DNS and other operator-owned addresses are + // removed from the ledger when the pool's reserved_ips is materialized. + // cloud_hosts intentionally has no engine/SSH host-address column. $rows = CloudPublicIp::query()->join( 'cloud_public_ip_pools as public_pool', 'public_pool.id', '=', 'cloud_public_ips.public_ip_pool_id' @@ -760,7 +763,6 @@ final class CloudPlacementService ->whereNull('cloud_public_ips.instance_id') ->whereNull('cloud_public_ips.operation_id') ->whereColumn('cloud_public_ips.host_id', 'public_pool.host_id') - ->whereColumn('cloud_public_ips.address', '<>', 'eligible_host.host') ->whereColumn('cloud_public_ips.prefix_length', 'public_pool.guest_prefix_length') ->whereColumn('cloud_public_ips.host_id', 'network_attachment.host_id') @@ -778,15 +780,9 @@ final class CloudPlacementService ->distinct()->get([ 'cloud_public_ips.host_id', 'cloud_public_ips.address', 'public_pool.pool_key', 'public_pool.cidr', - 'eligible_host.host as management_host', ]); $available = []; foreach ($rows as $row) { - if (CloudPanelUsageService::managementAddressFromValue( - $row->management_host ?? null - ) === (string) $row->address) { - continue; - } if (preg_match('/^[a-f0-9]{32}$/D', (string) $row->pool_key) === 1 && self::ipv4BelongsToCidr( (string) $row->address, (string) $row->cidr diff --git a/web/resources/views/venix/layout_assets.tpl b/web/resources/views/venix/layout_assets.tpl index bef007a9..9c537c58 100644 --- a/web/resources/views/venix/layout_assets.tpl +++ b/web/resources/views/venix/layout_assets.tpl @@ -1,2 +1,2 @@ {* Shared Venix CSS/JS cache key. Increment whenever a shared browser asset changes. *} -{assign var=venix_asset_version value='2026100602' scope='global'} +{assign var=venix_asset_version value='2026100701' scope='global'} diff --git a/web/tests/AdminResourceSchedulingContractTest.php b/web/tests/AdminResourceSchedulingContractTest.php index 30e34a93..2e7e9e87 100644 --- a/web/tests/AdminResourceSchedulingContractTest.php +++ b/web/tests/AdminResourceSchedulingContractTest.php @@ -59,6 +59,7 @@ $assert(str_contains($feature, "CONFIG_KEY = 'cloud_network_lines_enabled'") && str_contains($service, 'CloudHostCapacityPolicy') && str_contains($service, 'CloudResourceReservation') && str_contains($service, 'CloudPanelUsageService') + && !str_contains($service, 'eligible_host.host') && !str_contains($service, 'CloudHostCapacitySnapshot') && !str_contains($service, 'CloudEngineClient'), 'Resource projections must be DB-only, use policy and reservation ledgers, and retain a disabled-by-default line feature.'); diff --git a/web/tests/CloudNetworkIpLedgerContractTest.php b/web/tests/CloudNetworkIpLedgerContractTest.php index 45bfcbf2..9ceb04d5 100644 --- a/web/tests/CloudNetworkIpLedgerContractTest.php +++ b/web/tests/CloudNetworkIpLedgerContractTest.php @@ -86,6 +86,7 @@ $assert(is_string($worker) 'Worker no longer confirms pool identity or settles every terminal/ambiguous network-change outcome.'); $assert(is_string($placement) && str_contains($placement, 'cloud_host_resource_pool_memberships as pool_membership') + && !str_contains($placement, 'eligible_host.host') && !str_contains($placement, "->where('cloud_hosts.resource_pool_id', \$poolId)") && str_contains($placement, '$reservation->network_attachment_id = $selectedAttachment->id') && str_contains($placement, '$reservation->public_ip_pool_id = $selectedPool->id')