fix(xo-server/backups-ng): delete unused snapshot on delta failure
This commit is contained in:
parent
cf11ed0830
commit
20d3faa306
@ -562,7 +562,6 @@ export default class BackupNg {
|
|||||||
// 2. next run should be a full
|
// 2. next run should be a full
|
||||||
// - [ ] add a lock on the job/VDI during merge which should prevent other merges and restoration
|
// - [ ] add a lock on the job/VDI during merge which should prevent other merges and restoration
|
||||||
// - [ ] import for delta
|
// - [ ] import for delta
|
||||||
// - [ ] do not delete rolling snapshot in case of failure!
|
|
||||||
//
|
//
|
||||||
// Low:
|
// Low:
|
||||||
// - [ ] check merge/transfert duration/size are what we want for delta
|
// - [ ] check merge/transfert duration/size are what we want for delta
|
||||||
@ -591,6 +590,7 @@ export default class BackupNg {
|
|||||||
// - [x] backups should be deletable from the API
|
// - [x] backups should be deletable from the API
|
||||||
// - [x] adding and removing VDIs should behave
|
// - [x] adding and removing VDIs should behave
|
||||||
// - [x] isolate VHD chains by job
|
// - [x] isolate VHD chains by job
|
||||||
|
// - [x] do not delete rolling snapshot in case of failure!
|
||||||
@defer
|
@defer
|
||||||
async _backupVm (
|
async _backupVm (
|
||||||
$defer: any,
|
$defer: any,
|
||||||
@ -793,6 +793,11 @@ export default class BackupNg {
|
|||||||
transferSize: xva.size,
|
transferSize: xva.size,
|
||||||
}
|
}
|
||||||
} else if (job.mode === 'delta') {
|
} else if (job.mode === 'delta') {
|
||||||
|
if (snapshotRetention === 0) {
|
||||||
|
// only keep the snapshot in case of success
|
||||||
|
$defer.onFailure.call(xapi, 'deleteVm', snapshot)
|
||||||
|
}
|
||||||
|
|
||||||
const baseSnapshot = last(snapshots)
|
const baseSnapshot = last(snapshots)
|
||||||
if (baseSnapshot !== undefined) {
|
if (baseSnapshot !== undefined) {
|
||||||
console.log(baseSnapshot.$id) // TODO: remove
|
console.log(baseSnapshot.$id) // TODO: remove
|
||||||
|
Loading…
Reference in New Issue
Block a user