diff --git a/@xen-orchestra/backups/Backup.js b/@xen-orchestra/backups/Backup.js index 938aabc62..74f9af520 100644 --- a/@xen-orchestra/backups/Backup.js +++ b/@xen-orchestra/backups/Backup.js @@ -197,9 +197,43 @@ exports.Backup = class Backup { } await using( - Disposable.all(extractIdsFromSimplePattern(job.srs).map(_ => this._getRecord('SR', _))), - Disposable.all(extractIdsFromSimplePattern(job.remotes).map(id => this._getAdapter(id))), + Disposable.all( + extractIdsFromSimplePattern(job.srs).map(id => + this._getRecord('SR', id).catch(error => { + runTask( + { + name: 'get SR record', + data: { type: 'SR', id }, + }, + () => Promise.reject(error) + ) + }) + ) + ), + Disposable.all( + extractIdsFromSimplePattern(job.remotes).map(id => + this._getAdapter(id).catch(error => { + runTask( + { + name: 'get remote adapter', + data: { type: 'remote', id }, + }, + () => Promise.reject(error) + ) + }) + ) + ), async (srs, remoteAdapters) => { + // remove adapters that failed (already handled) + remoteAdapters = remoteAdapters.filter(_ => _ !== undefined) + + // remove srs that failed (already handled) + srs = srs.filter(_ => _ !== undefined) + + if (remoteAdapters.length === 0 && srs.length === 0) { + return + } + const vmIds = extractIdsFromSimplePattern(job.vms) Task.info('vms', { vms: vmIds }) diff --git a/CHANGELOG.unreleased.md b/CHANGELOG.unreleased.md index c158835de..2db4c2e41 100644 --- a/CHANGELOG.unreleased.md +++ b/CHANGELOG.unreleased.md @@ -17,6 +17,7 @@ - [Editable number] When you are trying to edit a number and it's failing, display an error (PR [#5634](https://github.com/vatesfr/xen-orchestra/pull/5634)) - [VM/Network] Fix `an error has occurred` when trying to sort the table by the network's name (PR [#5639](https://github.com/vatesfr/xen-orchestra/pull/5639)) - [Backup] Try harder to avoid orphan VDI snapshots, especially with iSCSI SRs [#4926](https://github.com/vatesfr/xen-orchestra/issues/4926) +- [Backup] Disabled or unavailable remotes and SRs don't prevent job from running [#5353](https://github.com/vatesfr/xen-orchestra/issues/5353) (PR [#5651](https://github.com/vatesfr/xen-orchestra/pull/5651)) ### Packages to release