requestAndWait( '/nodes/' . $this->server->node->name . '/qemu/' . $this->server->vm_id . '/status/stop', 'post', ['vmid' => $this->server->vm_id], $this->server->node->name ); $proxmox->requestAndWait( '/nodes/' . $this->server->node->name . '/qemu/' . $this->server->vm_id, 'delete', [], $this->server->node->name ); } catch (Exception $e) { if (!str_contains($e->getMessage(), 'does not exist')) { throw $e; } } // Generate a new password $password = Str::password(16); // Reinstall server — install() will now use the updated password $settings = array_merge(ExtensionHelper::settingsToArray($this->server->service->product->settings), ExtensionHelper::getServiceProperties($this->server->service)); $proxmox->install($this->server, $settings, $password); // Send notification to the user NotificationHelper::serverCreatedNotification( $this->server->service->user, $this->server->service, [ 'password' => $password, 'ip' => $this->server->primaryIpv4?->ip, 'ipv6' => $this->server->primaryIpv6?->ip, 'hostname' => $this->server->hostname, ] ); } }