fix(xo-server): disable auto power on during rolling pool update/reboot (#10104)

This commit is contained in:
Mathieu
2026-07-16 14:34:50 +02:00
committed by GitHub
parent ac52f8b75e
commit 798bdeb973
2 changed files with 11 additions and 2 deletions

View File

@@ -36,7 +36,7 @@
- [Backups] Fix missing transfer size (PR [#10106](https://github.com/vatesfr/xen-orchestra/pull/10106))
- [Host/dashboard] Switch CPU and RAM panels order to match Pool dashboard layout (PR [#10059](https://github.com/vatesfr/xen-orchestra/pull/10059))
- [Plugins/Perf-alert] Update URL generation to support V6 routing (PR [#10054](https://github.com/vatesfr/xen-orchestra/pull/10054))
- [Rolling Pool Update/Reboot] Temporarily disable VMs auto power on during the run: unexpected VM starts on rebooted hosts could break the remaining host evacuations (`HOST_NOT_ENOUGH_FREE_MEMORY`) (PR [#10104](https://github.com/vatesfr/xen-orchestra/pull/10104))
### Packages to release

View File

@@ -1,4 +1,5 @@
import { cancelable, timeout } from 'promise-toolbox'
import { createLogger } from '@xen-orchestra/log'
import { decorateObject } from '@vates/decorate-with'
import { defer as deferrable } from 'golike-defer'
import { incorrectState } from 'xo-common/api-errors.js'
@@ -9,6 +10,8 @@ import filter from 'lodash/filter.js'
import groupBy from 'lodash/groupBy.js'
import mapValues from 'lodash/mapValues.js'
const log = createLogger('xo:xapi')
const PATH_DB_DUMP = '/pool/xmldbdump'
const setProgress = (task, progress) => task.set('progress', Math.round(progress))
@@ -40,6 +43,12 @@ const methods = {
$defer(() => this.call('pool.enable_ha', haSrs, haConfig))
}
if (this.pool.other_config.auto_poweron === 'true') {
log.info(`temporarily disabling auto power on during the rolling reboot of pool ${this.pool.uuid}`)
await this.pool.update_other_config('auto_poweron', 'false')
$defer(() => this.pool.update_other_config('auto_poweron', 'true'))
}
const hosts = filter(this.objects.all, { $type: 'host' })
{
@@ -272,5 +281,5 @@ const methods = {
export default decorateObject(methods, {
exportPoolMetadata: cancelable,
importPoolMetadata: cancelable,
rollingPoolReboot: deferrable,
rollingPoolReboot: deferrable.onError(log.warn),
})