fix(backups): ignore VMs created by current job
See xoa-support#4271
This commit is contained in:
parent
10ac23e265
commit
cf9f0da6e5
@ -36,6 +36,11 @@ const forkDeltaExport = deltaExport =>
|
|||||||
|
|
||||||
exports.VmBackup = class VmBackup {
|
exports.VmBackup = class VmBackup {
|
||||||
constructor({ config, getSnapshotNameLabel, job, remoteAdapters, remotes, schedule, settings, srs, vm }) {
|
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.config = config
|
||||||
this.job = job
|
this.job = job
|
||||||
this.remoteAdapters = remoteAdapters
|
this.remoteAdapters = remoteAdapters
|
||||||
|
@ -17,6 +17,7 @@
|
|||||||
|
|
||||||
- [Tables/actions] Fix collapsed actions being clickable despite being disabled (PR [#6023](https://github.com/vatesfr/xen-orchestra/pull/6023))
|
- [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`
|
- [Continuous Replication] Fix `could not find the base VM`
|
||||||
|
- [Backup/Smart mode] Always ignore replicated VMs created by the current job
|
||||||
|
|
||||||
### Packages to release
|
### Packages to release
|
||||||
|
|
||||||
@ -35,4 +36,7 @@
|
|||||||
>
|
>
|
||||||
> In case of conflict, the highest (lowest in previous list) `$version` wins.
|
> 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
|
- xo-web minor
|
||||||
|
@ -187,6 +187,15 @@ export default class BackupNg {
|
|||||||
filter: createPredicate({
|
filter: createPredicate({
|
||||||
type: 'VM',
|
type: 'VM',
|
||||||
...vmsPattern,
|
...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,
|
||||||
|
},
|
||||||
|
},
|
||||||
}),
|
}),
|
||||||
})
|
})
|
||||||
)
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user