From d8b5a4d45009608a9080077d090a6d73e09f307a Mon Sep 17 00:00:00 2001 From: Florent BEAUCHAMP Date: Thu, 26 Sep 2024 15:04:35 +0000 Subject: [PATCH 1/2] fix(xo-server): migration of vm with cbt enabled disk stuck introduced by commit 442dd16813a292f14673610ee250f3c827693a15 --- packages/xo-server/src/xapi/index.mjs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/xo-server/src/xapi/index.mjs b/packages/xo-server/src/xapi/index.mjs index b3d1beff03f..69e145b6a5d 100644 --- a/packages/xo-server/src/xapi/index.mjs +++ b/packages/xo-server/src/xapi/index.mjs @@ -614,16 +614,16 @@ export default class Xapi extends XapiBase { } } } - const loop = async () => { + const loop = async (_failOnCbtError = false) => { try { await this.callAsync('VM.migrate_send', ...params) } catch (err) { - if (err.code === 'VDI_CBT_ENABLED') { + if (err.code === 'VDI_CBT_ENABLED' && !_failOnCbtError) { // as of 20240619, CBT must be disabled on all disks to allow migration to go through // it will be re enabled if needed by backups // the next backup after a storage migration will be a full backup await this.VM_disableChangedBlockTracking(vm.$ref) - return loop() + return loop(true) } if (err.code === 'TOO_MANY_STORAGE_MIGRATES') { await pDelay(1e4) From d228a2a6dcb2e4a9bfd109819858113934a8b998 Mon Sep 17 00:00:00 2001 From: Florent BEAUCHAMP Date: Thu, 26 Sep 2024 16:20:39 +0000 Subject: [PATCH 2/2] changelog --- CHANGELOG.unreleased.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.unreleased.md b/CHANGELOG.unreleased.md index bcb66d38707..abef60ccffd 100644 --- a/CHANGELOG.unreleased.md +++ b/CHANGELOG.unreleased.md @@ -22,6 +22,8 @@ > Users must be able to say: “I had this issue, happy to know it's fixed” +- [Migration/CBT] Fix an infinite loop when migrating a VM with CBT enabled (PR [#8017](https://github.com/vatesfr/xen-orchestra/pull/8017)) + ### Packages to release > When modifying a package, add it here with its release type.