Skip to content

Commit

Permalink
fix(xo-server): migration of vm with cbt enabled disk
Browse files Browse the repository at this point in the history
  • Loading branch information
fbeauchamp committed Sep 26, 2024
1 parent ea5358e commit e6919ba
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/xo-server/src/xapi/index.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit e6919ba

Please sign in to comment.