fix(xo-server/backupNg): clean metadata on VM iself (#2945)

This commit is contained in:
Julien Fontanet 2018-05-14 11:47:34 +02:00 committed by GitHub
parent 04c74dd30f
commit 3d0420dbd9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -625,6 +625,16 @@ export default class BackupNg {
const xapi = app.getXapi(vmUuid)
const vm: Vm = (xapi.getObject(vmUuid): any)
// ensure the VM itself does not have any backup metadata which would be
// copied on manual snapshots and interfere with the backup jobs
if ('xo:backup:job' in vm.other_config) {
await xapi._updateObjectMapProperty(vm, 'other_config', {
'xo:backup:job': null,
'xo:backup:schedule': null,
'xo:backup:vm': null,
})
}
const { id: jobId, settings } = job
const { id: scheduleId } = schedule