diff --git a/@xen-orchestra/backups/_runners/_vmRunners/_AbstractXapi.js b/@xen-orchestra/backups/_runners/_vmRunners/_AbstractXapi.js index d6e177157df..3634ac31ceb 100644 --- a/@xen-orchestra/backups/_runners/_vmRunners/_AbstractXapi.js +++ b/@xen-orchestra/backups/_runners/_vmRunners/_AbstractXapi.js @@ -79,20 +79,18 @@ class AbstractXapiVmBackupRunner extends Abstract { const targetSettings = { ...settings, ...allSettings[remoteId], - healthCheckSr, } if (targetSettings.exportRetention !== 0) { - writers.add(new BackupWriter({ backup: this, remoteId, settings: targetSettings })) + writers.add(new BackupWriter({ backup: this, remoteId, settings: targetSettings, healthCheckSr })) } }) srs.forEach(sr => { const targetSettings = { ...settings, ...allSettings[sr.uuid], - healthCheckSr, } if (targetSettings.copyRetention !== 0) { - writers.add(new ReplicationWriter({ backup: this, sr, settings: targetSettings })) + writers.add(new ReplicationWriter({ backup: this, sr, settings: targetSettings, healthCheckSr })) } }) } diff --git a/@xen-orchestra/backups/_runners/_writers/IncrementalXapiWriter.js b/@xen-orchestra/backups/_runners/_writers/IncrementalXapiWriter.js index 5bfcd67c968..bd40a4d0df4 100644 --- a/@xen-orchestra/backups/_runners/_writers/IncrementalXapiWriter.js +++ b/@xen-orchestra/backups/_runners/_writers/IncrementalXapiWriter.js @@ -49,7 +49,7 @@ exports.IncrementalXapiWriter = class IncrementalXapiWriter extends MixinXapiWri type: 'SR', }, }) - const hasHealthCheckSr = this._settings.healthCheckSr !== undefined + const hasHealthCheckSr = this._healthCheckSr !== undefined this.transfer = task.wrapFn(this.transfer) this.cleanup = task.wrapFn(this.cleanup, !hasHealthCheckSr) this.healthCheck = task.wrapFn(this.healthCheck, hasHealthCheckSr) diff --git a/@xen-orchestra/backups/_runners/_writers/_AbstractWriter.js b/@xen-orchestra/backups/_runners/_writers/_AbstractWriter.js index 47602ac9128..c5e847599bd 100644 --- a/@xen-orchestra/backups/_runners/_writers/_AbstractWriter.js +++ b/@xen-orchestra/backups/_runners/_writers/_AbstractWriter.js @@ -1,9 +1,10 @@ 'use strict' exports.AbstractWriter = class AbstractWriter { - constructor({ backup, settings }) { + constructor({ backup, settings, healthCheckSr }) { this._backup = backup this._settings = settings + this._healthCheckSr = healthCheckSr } beforeBackup() {} diff --git a/@xen-orchestra/backups/_runners/_writers/_MixinRemoteWriter.js b/@xen-orchestra/backups/_runners/_writers/_MixinRemoteWriter.js index 1e3a54660e3..df7886f9f78 100644 --- a/@xen-orchestra/backups/_runners/_writers/_MixinRemoteWriter.js +++ b/@xen-orchestra/backups/_runners/_writers/_MixinRemoteWriter.js @@ -77,7 +77,7 @@ exports.MixinRemoteWriter = (BaseClass = Object) => } healthCheck() { - const sr = this._settings.healthCheckSr + const sr = this._healthCheckSr assert.notStrictEqual(sr, undefined, 'SR should be defined before making a health check') assert.notStrictEqual( this._metadataFileName, diff --git a/@xen-orchestra/backups/_runners/_writers/_MixinXapiWriter.js b/@xen-orchestra/backups/_runners/_writers/_MixinXapiWriter.js index fd49618867c..719666f1bc7 100644 --- a/@xen-orchestra/backups/_runners/_writers/_MixinXapiWriter.js +++ b/@xen-orchestra/backups/_runners/_writers/_MixinXapiWriter.js @@ -15,7 +15,7 @@ exports.MixinXapiWriter = (BaseClass = Object) => } healthCheck() { - const sr = this._settings.healthCheckSr + const sr = this._healthCheckSr assert.notStrictEqual(sr, undefined, 'SR should be defined before making a health check') assert.notEqual(this._targetVmRef, undefined, 'A vm should have been transfered to be health checked') // copy VM