From 0bd17e88a42a3e5e2ed2fa9d8964945232005f57 Mon Sep 17 00:00:00 2001 From: Julien Fontanet Date: Tue, 4 Jan 2022 14:33:28 +0100 Subject: [PATCH] feat(xo-server): limit VM migration concurrency Fixes #6065 --- CHANGELOG.unreleased.md | 3 +++ packages/xo-server/src/xapi/index.mjs | 2 ++ 2 files changed, 5 insertions(+) diff --git a/CHANGELOG.unreleased.md b/CHANGELOG.unreleased.md index 524e6ec0c6d..91096bae469 100644 --- a/CHANGELOG.unreleased.md +++ b/CHANGELOG.unreleased.md @@ -7,6 +7,9 @@ > Users must be able to say: “Nice enhancement, I'm eager to test it” +- Limit number of concurrent VM migrations per pool to `3` [#6065](https://github.com/vatesfr/xen-orchestra/issues/6065) (PR [#6076](https://github.com/vatesfr/xen-orchestra/pull/6076)) + Can be changed in `xo-server`'s configuration file: `xapiOptions.vmMigrationConcurrency` + ### Bug fixes > Users must be able to say: “I had this issue, happy to know it's fixed” diff --git a/packages/xo-server/src/xapi/index.mjs b/packages/xo-server/src/xapi/index.mjs index 3d1463b5294..02b812b4d41 100644 --- a/packages/xo-server/src/xapi/index.mjs +++ b/packages/xo-server/src/xapi/index.mjs @@ -82,6 +82,7 @@ export default class Xapi extends XapiBase { restartHostTimeout, vdiExportConcurrency, vmExportConcurrency, + vmMigrationConcurrency = 3, vmSnapshotConcurrency, ...opts }) { @@ -96,6 +97,7 @@ export default class Xapi extends XapiBase { this._exportVdi = limitConcurrency(vdiExportConcurrency, waitStreamEnd)(this._exportVdi) this.exportVm = limitConcurrency(vmExportConcurrency, waitStreamEnd)(this.exportVm) + this._migrateVmWithStorageMotion = limitConcurrency(vmMigrationConcurrency)(this._migrateVmWithStorageMotion) this._snapshotVm = limitConcurrency(vmSnapshotConcurrency)(this._snapshotVm) // Patch getObject to resolve _xapiId property.