feat(xo-server/backupNg.checkBackup): add basic XO task

This commit is contained in:
Julien Fontanet
2023-05-30 11:03:58 +02:00
parent e2695ce327
commit 18bd2c607e
2 changed files with 9 additions and 7 deletions

View File

@@ -8,6 +8,7 @@
> Users must be able to say: “Nice enhancement, I'm eager to test it”
- [Tasks] New type of tasks created by XO ("XO Tasks" section) (PRs [#6861](https://github.com/vatesfr/xen-orchestra/pull/6861) [#6869](https://github.com/vatesfr/xen-orchestra/pull/6869))
- [Backup/Health check] Add basic XO task for manual health check
### Bug fixes

View File

@@ -604,11 +604,13 @@ export default class BackupNg {
}
async checkVmBackupNg(backupId, srId, settings) {
await Task.run(
{
name: 'health check',
},
async () => {
await this._app.tasks
.create({
name: 'VM Backup Health Check',
objectId: backupId,
type: 'backup.vm.healthCheck',
})
.run(async () => {
const app = this._app
const xapi = app.getXapi(srId)
const restoredId = await this.importVmBackupNg(backupId, srId, settings)
@@ -622,7 +624,6 @@ export default class BackupNg {
} finally {
await xapi.VM_destroy(restoredVm.$ref)
}
}
)
})
}
}