host($run); if (! $run->context('reboot_issued')) { $this->keyLogin($this->shell, $host); $this->shell->run('export DEBIAN_FRONTEND=noninteractive; apt-get -y remove linux-image-amd64 || true'); $this->shell->run('update-grub'); $run->mergeContext([ 'reboot_issued' => true, 'reboot_deadline' => now()->addMinutes(15)->toIso8601String(), ]); $this->shell->run('systemctl reboot || reboot'); return StepResult::poll(30, 'rebooting into the Proxmox kernel'); } try { $this->keyLogin($this->shell, $host); $uname = trim($this->shell->run('uname -r')->stdout); } catch (Throwable) { $uname = ''; } if (str_contains($uname, '-pve')) { return StepResult::advance(); } $deadline = $run->context('reboot_deadline'); if ($deadline !== null && now()->greaterThan(Carbon::parse($deadline))) { return StepResult::fail('Host did not return on the Proxmox kernel before the deadline.'); } return StepResult::poll(15, 'waiting for the Proxmox kernel'); } }