From 6aa8e0d4ce0494da4bd4ab4bb41fc8340073874e Mon Sep 17 00:00:00 2001 From: Julien Fontanet Date: Wed, 27 Feb 2019 16:36:22 +0100 Subject: [PATCH] feat(xo-server/CR): share full between schedules (#3995) Fixes #3973 --- CHANGELOG.unreleased.md | 1 + packages/xo-server/src/xo-mixins/backups-ng/index.js | 7 ++++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.unreleased.md b/CHANGELOG.unreleased.md index a4a4226ad..2e0a613b5 100644 --- a/CHANGELOG.unreleased.md +++ b/CHANGELOG.unreleased.md @@ -7,6 +7,7 @@ - [Editable fields] Unfocusing (clicking outside) submits the change instead of canceling (PR [#3980](https://github.com/vatesfr/xen-orchestra/pull/3980)) - [Network] Dedicated page for network creation [#3895](https://github.com/vatesfr/xen-orchestra/issues/3895) (PR [#3906](https://github.com/vatesfr/xen-orchestra/pull/3906)) - [Logs] Add button to download the log [#3957](https://github.com/vatesfr/xen-orchestra/issues/3957) (PR [#3985](https://github.com/vatesfr/xen-orchestra/pull/3985)) +- [Continuous Replication] Share full copy between schedules [#3973](https://github.com/vatesfr/xen-orchestra/issues/3973) (PR [#3995](https://github.com/vatesfr/xen-orchestra/pull/3995)) ### Bug fixes diff --git a/packages/xo-server/src/xo-mixins/backups-ng/index.js b/packages/xo-server/src/xo-mixins/backups-ng/index.js index d68264e1f..cfbfda7be 100644 --- a/packages/xo-server/src/xo-mixins/backups-ng/index.js +++ b/packages/xo-server/src/xo-mixins/backups-ng/index.js @@ -182,7 +182,7 @@ const getJobCompression = ({ compression: c }) => const listReplicatedVms = ( xapi: Xapi, - scheduleId: string, + scheduleOrJobId: string, srId?: string, vmUuid?: string ): Vm[] => { @@ -196,7 +196,8 @@ const listReplicatedVms = ( !object.is_a_snapshot && !object.is_a_template && 'start' in object.blocked_operations && - oc['xo:backup:schedule'] === scheduleId && + (oc['xo:backup:job'] === scheduleOrJobId || + oc['xo:backup:schedule'] === scheduleOrJobId) && oc['xo:backup:sr'] === srId && (oc['xo:backup:vm'] === vmUuid || // 2018-03-28, JFT: to catch VMs replicated before this fix @@ -1323,7 +1324,7 @@ export default class BackupNg { for (const { $id: srId, xapi } of srs) { const replicatedVm = listReplicatedVms( xapi, - scheduleId, + jobId, srId, vmUuid ).find(vm => vm.other_config[TAG_COPY_SRC] === baseSnapshot.uuid)