9001, 'name' => 'Turnkey PBX Test Appliance', 'cpuCores' => 2, 'memoryMb' => 2048, 'diskGb' => 24, 'status' => 'stopped', ], [ 'vmId' => 9002, 'name' => 'Windows Support Client', 'cpuCores' => 4, 'memoryMb' => 8192, 'diskGb' => 80, 'status' => 'stopped', ], [ 'vmId' => 9003, 'name' => 'Linux Utility VM', 'cpuCores' => 2, 'memoryMb' => 2048, 'diskGb' => 32, 'status' => 'stopped', ], ]; } public function clone_vm(array $input): array { $next_id = (int) get_option('spp_mock_next_vm_id', 10000); update_option('spp_mock_next_vm_id', $next_id + 1, false); update_option('spp_mock_vm_status_' . $next_id, 'stopped', false); update_option('spp_mock_vm_ips_' . $next_id, [sprintf('192.0.2.%d', (($next_id - 10000) % 200) + 10)], false); return ['vm_id' => $next_id]; } public function start_vm(int $vm_id): void { $this->ensure_vm($vm_id); update_option('spp_mock_vm_status_' . $vm_id, 'running', false); } public function stop_vm(int $vm_id): void { $this->ensure_vm($vm_id); update_option('spp_mock_vm_status_' . $vm_id, 'stopped', false); } public function delete_vm(int $vm_id): void { $this->ensure_vm($vm_id); delete_option('spp_mock_vm_status_' . $vm_id); delete_option('spp_mock_vm_ips_' . $vm_id); } public function get_status(int $vm_id): string { return (string) get_option('spp_mock_vm_status_' . $vm_id, 'unknown'); } public function get_ip_addresses(int $vm_id): array { $ips = get_option('spp_mock_vm_ips_' . $vm_id, []); return is_array($ips) ? array_values(array_map('strval', $ips)) : []; } private function ensure_vm(int $vm_id): void { if (get_option('spp_mock_vm_status_' . $vm_id, null) === null) { throw new RuntimeException('Mock Proxmox VM does not exist.'); } } }