feat(xo-server/backupNg.checkBackup): add basic XO task
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
}
|
||||
)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user