Skip to content

Commit

Permalink
fix(xo-server): invalid arguments passed to VM_destroy
Browse files Browse the repository at this point in the history
  • Loading branch information
pdonias committed Mar 16, 2022
1 parent ed09608 commit 2382dfc
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

### 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, bypassBlockedOperation: 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 2382dfc

Please sign in to comment.