fix(xo-server/backup NG): delete interrupted replications (#3923)
Fixes xoa-support#1215
This commit is contained in:
parent
dfb6d1b58e
commit
1b12aa90de
@ -34,6 +34,7 @@
|
|||||||
- [Legacy Backup] Fix error when restoring a backup
|
- [Legacy Backup] Fix error when restoring a backup
|
||||||
- [Home] Fix `user.getAll` error when user is not admin [#3573](https://github.com/vatesfr/xen-orchestra/issues/3573) (PR [#3918](https://github.com/vatesfr/xen-orchestra/pull/3918))
|
- [Home] Fix `user.getAll` error when user is not admin [#3573](https://github.com/vatesfr/xen-orchestra/issues/3573) (PR [#3918](https://github.com/vatesfr/xen-orchestra/pull/3918))
|
||||||
- [Backup NG] Fix restore issue when a disk has grown [#3910](https://github.com/vatesfr/xen-orchestra/issues/3910) (PR [#3920](https://github.com/vatesfr/xen-orchestra/pull/3920))
|
- [Backup NG] Fix restore issue when a disk has grown [#3910](https://github.com/vatesfr/xen-orchestra/issues/3910) (PR [#3920](https://github.com/vatesfr/xen-orchestra/pull/3920))
|
||||||
|
- [Backup NG] Delete _importing_ VMs due to interrupted CR/DR (PR [#3923](https://github.com/vatesfr/xen-orchestra/pull/3923))
|
||||||
|
|
||||||
### Released packages
|
### Released packages
|
||||||
|
|
||||||
|
@ -183,7 +183,7 @@ const getJobCompression = ({ compression: c }) =>
|
|||||||
const listReplicatedVms = (
|
const listReplicatedVms = (
|
||||||
xapi: Xapi,
|
xapi: Xapi,
|
||||||
scheduleId: string,
|
scheduleId: string,
|
||||||
srId: string,
|
srId?: string,
|
||||||
vmUuid?: string
|
vmUuid?: string
|
||||||
): Vm[] => {
|
): Vm[] => {
|
||||||
const { all } = xapi.objects
|
const { all } = xapi.objects
|
||||||
@ -918,6 +918,7 @@ export default class BackupNg {
|
|||||||
// - [x] possibility to (re-)run a single VM in a backup?
|
// - [x] possibility to (re-)run a single VM in a backup?
|
||||||
// - [x] validate VHDs after exports and before imports, how?
|
// - [x] validate VHDs after exports and before imports, how?
|
||||||
// - [x] check merge/transfert duration/size are what we want for delta
|
// - [x] check merge/transfert duration/size are what we want for delta
|
||||||
|
// - [x] delete interrupted *importing* VMs
|
||||||
@defer
|
@defer
|
||||||
async _backupVm(
|
async _backupVm(
|
||||||
$defer: any,
|
$defer: any,
|
||||||
@ -1236,6 +1237,14 @@ export default class BackupNg {
|
|||||||
|
|
||||||
const { $id: srId, xapi } = sr
|
const { $id: srId, xapi } = sr
|
||||||
|
|
||||||
|
// delete previous interrupted copies
|
||||||
|
ignoreErrors.call(
|
||||||
|
this._deleteVms(
|
||||||
|
xapi,
|
||||||
|
listReplicatedVms(xapi, scheduleId, undefined, vmUuid)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
const oldVms = getOldEntries(
|
const oldVms = getOldEntries(
|
||||||
copyRetention - 1,
|
copyRetention - 1,
|
||||||
listReplicatedVms(xapi, scheduleId, srId, vmUuid)
|
listReplicatedVms(xapi, scheduleId, srId, vmUuid)
|
||||||
@ -1572,6 +1581,14 @@ export default class BackupNg {
|
|||||||
|
|
||||||
const { $id: srId, xapi } = sr
|
const { $id: srId, xapi } = sr
|
||||||
|
|
||||||
|
// delete previous interrupted copies
|
||||||
|
ignoreErrors.call(
|
||||||
|
this._deleteVms(
|
||||||
|
xapi,
|
||||||
|
listReplicatedVms(xapi, scheduleId, undefined, vmUuid)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
const oldVms = getOldEntries(
|
const oldVms = getOldEntries(
|
||||||
copyRetention - 1,
|
copyRetention - 1,
|
||||||
listReplicatedVms(xapi, scheduleId, srId, vmUuid)
|
listReplicatedVms(xapi, scheduleId, srId, vmUuid)
|
||||||
|
Loading…
Reference in New Issue
Block a user