Skip to content

Commit

Permalink
fix(xo-server): invalid arguments passed to VM_destroy (#6119)
Browse files Browse the repository at this point in the history
  • Loading branch information
pdonias authored and ByScripts committed Mar 21, 2022
1 parent 302ce1b commit 19de1bd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.unreleased.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
- [Rolling Pool Update] Don't fail if `load-balancer` plugin is missing (Starter and Enterprise plans)
- [Backup/Restore] Fix missing backups on Backblaze
- [Templates] Fix "incorrect state" error when trying to delete a default template [#6124](https://github.com/vatesfr/xen-orchestra/issues/6124) (PR [#6119](https://github.com/vatesfr/xen-orchestra/pull/6119))

### Packages to release

Expand Down
4 changes: 2 additions & 2 deletions packages/xo-server/src/api/vm.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ export const create = defer(async function ($defer, params) {
}

const xapiVm = await xapi.createVm(template._xapiId, params, checkLimits)
$defer.onFailure(() => xapi.VM_destroy(xapiVm.$ref, true, true))
$defer.onFailure(() => xapi.VM_destroy(xapiVm.$ref, { deleteDisks: true, force: true }))

const vm = xapi.xo.addObject(xapiVm)

Expand Down Expand Up @@ -382,7 +382,7 @@ const delete_ = defer(async function (
}
})

return xapi.VM_destroy(vm._xapiRef, deleteDisks, force, forceDeleteDefaultTemplate)
return xapi.VM_destroy(vm._xapiRef, { deleteDisks, force, forceDeleteDefaultTemplate })
})

delete_.params = {
Expand Down

0 comments on commit 19de1bd

Please sign in to comment.