diff --git a/@xen-orchestra/backups/_VmBackup.js b/@xen-orchestra/backups/_VmBackup.js index d80f9301d..424eee809 100644 --- a/@xen-orchestra/backups/_VmBackup.js +++ b/@xen-orchestra/backups/_VmBackup.js @@ -36,6 +36,11 @@ const forkDeltaExport = deltaExport => exports.VmBackup = class VmBackup { constructor({ config, getSnapshotNameLabel, job, remoteAdapters, remotes, schedule, settings, srs, vm }) { + if (vm.other_config['xo:backup:job'] === job.id) { + // otherwise replicated VMs would be matched and replicated again and again + throw new Error('cannot backup a VM created by this very job') + } + this.config = config this.job = job this.remoteAdapters = remoteAdapters diff --git a/CHANGELOG.unreleased.md b/CHANGELOG.unreleased.md index 87effc19c..023dd680c 100644 --- a/CHANGELOG.unreleased.md +++ b/CHANGELOG.unreleased.md @@ -17,6 +17,7 @@ - [Tables/actions] Fix collapsed actions being clickable despite being disabled (PRĀ [#6023](https://github.com/vatesfr/xen-orchestra/pull/6023)) - [Continuous Replication] Fix `could not find the base VM` +- [Backup/Smart mode] Always ignore replicated VMs created by the current job ### Packages to release @@ -35,4 +36,7 @@ > > In case of conflict, the highest (lowest in previous list) `$version` wins. +- @xen-orchestra/backups minor +- @xen-orchestra/proxy minor +- xo-server minor - xo-web minor diff --git a/packages/xo-server/src/xo-mixins/backups-ng/index.mjs b/packages/xo-server/src/xo-mixins/backups-ng/index.mjs index 1442c1b8d..11553c020 100644 --- a/packages/xo-server/src/xo-mixins/backups-ng/index.mjs +++ b/packages/xo-server/src/xo-mixins/backups-ng/index.mjs @@ -187,6 +187,15 @@ export default class BackupNg { filter: createPredicate({ type: 'VM', ...vmsPattern, + + // don't match VMs created by this very job + // + // otherwise replicated VMs would be matched and replicated again and again + other_config: { + __not: { + 'xo:backup:job': job.id, + }, + }, }), }) )