feat(backups): block snapshot migration during backup

Related to zammad#16108
This commit is contained in:
Julien Fontanet
2023-09-07 08:59:08 +02:00
parent 73755e4ccf
commit b00cf13029
2 changed files with 11 additions and 1 deletions

View File

@@ -256,7 +256,15 @@ export const AbstractXapi = class AbstractXapiVmBackupRunner extends Abstract {
}
if (this._writers.size !== 0) {
await this._copy()
const { pool_migrate = null, migrate_send = null } = this._exportedVm.blocked_operations
const reason = 'VM migration is blocked during backup'
await this._exportedVm.update_blocked_operations({ pool_migrate: reason, migrate_send: reason })
try {
await this._copy()
} finally {
await this._exportedVm.update_blocked_operations({ pool_migrate, migrate_send })
}
}
} finally {
if (startAfter) {

View File

@@ -9,6 +9,7 @@
- [Host/Advanced] Display system disks health based on the _smartctl_ plugin. [#4458](https://github.com/vatesfr/xen-orchestra/issues/4458) (PR [#7060](https://github.com/vatesfr/xen-orchestra/pull/7060))
- [Authentication] Failed attempts are now logged as XO tasks (PR [#7061](https://github.com/vatesfr/xen-orchestra/pull/7061))
- [Backup] Prevent VMs from being migrated while they are backed up (PR [#7024](https://github.com/vatesfr/xen-orchestra/pull/7024))
### Bug fixes
@@ -34,6 +35,7 @@
<!--packages-start-->
- @xen-orchestra/backups minor
- @xen-orchestra/mixins minor
- @xen-orchestra/xapi minor
- vhd-lib patch