host($run); $client = $this->pve->forHost($host); $nodes = $client->listNodes(); $node = $nodes[0]['node'] ?? 'pve'; $status = $client->nodeStatus($node); $storage = $client->nodeStorage($node); $cores = (int) ($status['cpuinfo']['cpus'] ?? 0); $ramMb = (int) round((int) ($status['memory']['total'] ?? 0) / 1048576); $totalGb = (int) round(array_sum(array_column($storage, 'total')) / 1073741824); $host->update([ 'cpu_cores' => $cores, 'cpu_weight' => $cores, 'total_ram_mb' => $ramMb, 'total_gb' => $totalGb, 'pve_version' => $status['pveversion'] ?? null, 'last_seen_at' => now(), ]); return StepResult::advance(); } }