Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(V2V/powerOff): handle queued state when stopping the VM #8328

Merged
merged 4 commits into from
Feb 14, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions @xen-orchestra/vmware-explorer/esxi.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -400,13 +400,14 @@ export default class Esxi extends EventEmitter {
const taskId = res.returnval.$value
let state = 'running'
let info
for (let i = 0; i < 60 && state === 'running'; i++) {
for (let i = 0; i < 60; i++) {
// https://developer.vmware.com/apis/1720/
info = await this.fetchProperty('Task', taskId, 'info')
state = info.state[0]
if (state === 'running') {
await new Promise(resolve => setTimeout(resolve, 1000))
if (state === 'success') {
break
}
await new Promise(resolve => setTimeout(resolve, 1000))
}
strictEqual(state, 'success', info.error ?? `fail to power off vm ${vmId}, state:${state}`)
return info
Expand Down
3 changes: 3 additions & 0 deletions CHANGELOG.unreleased.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
> Users must be able to say: “I had this issue, happy to know it's fixed”

[SDN-controller] Fix _No PIF found_ error when creating a private network [#8027](https://github.com/vatesfr/xen-orchestra/issues/8027) (PR [#8319](https://github.com/vatesfr/xen-orchestra/pull/8319))
- [V2V] Fix `fail to power off vm vm-XXXXXX, state:queued.` when powering down source VM (PR [#8328](https://github.com/vatesfr/xen-orchestra/pull/8328))


### Packages to release

Expand All @@ -41,6 +43,7 @@

- @vates/types major
- @xen-orchestra/rest-api minor
- @xen-orchestra/vmware-explorer patch
- @xen-orchestra/web minor
- @xen-orchestra/web-core minor
- xo-server minor
Expand Down
Loading