diff --git a/@xen-orchestra/xapi/host.mjs b/@xen-orchestra/xapi/host.mjs index 8de17d41b1e..3825941ceff 100644 --- a/@xen-orchestra/xapi/host.mjs +++ b/@xen-orchestra/xapi/host.mjs @@ -3,6 +3,7 @@ import { asyncMap } from '@xen-orchestra/async-map' import { decorateClass } from '@vates/decorate-with' import { defer } from 'golike-defer' import { incorrectState, operationFailed } from 'xo-common/api-errors.js' +import pRetry from 'promise-toolbox/retry' import { getCurrentVmUuid } from './_XenStore.mjs' @@ -69,7 +70,12 @@ class Host { if (await this.getField('host', ref, 'enabled')) { await this.callAsync('host.disable', ref) $defer(async () => { - await this.callAsync('host.enable', ref) + await pRetry(() => this.callAsync('host.enable', ref), { + delay: 10e3, + retries: 6, + when: { code: 'HOST_STILL_BOOTING' }, + }) + // Resuming VMs should occur after host enabling to avoid triggering a 'NO_HOSTS_AVAILABLE' error return asyncEach(suspendedVms, vmRef => this.callAsync('VM.resume', vmRef, false, false)) }) diff --git a/CHANGELOG.unreleased.md b/CHANGELOG.unreleased.md index 226ab53b857..bd01800f821 100644 --- a/CHANGELOG.unreleased.md +++ b/CHANGELOG.unreleased.md @@ -18,6 +18,7 @@ > Users must be able to say: “I had this issue, happy to know it's fixed” - [REST API] Returns a proper 404 _Not Found_ error when a job does not exist instead of _Internal Server Error_ +- [Host/Smart reboot] Automatically retries up to a minute when `HOST_STILL_BOOTING` [#7194](https://github.com/vatesfr/xen-orchestra/issues/7194) (PR [#7231](https://github.com/vatesfr/xen-orchestra/pull/7231)) ### Packages to release @@ -35,6 +36,7 @@ +- @xen-orchestra/xapi patch - xo-server minor