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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
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 @@ -17,6 +17,8 @@

> Users must be able to say: “I had this issue, happy to know it's fixed”

- [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

> When modifying a package, add it here with its release type.
Expand All @@ -34,6 +36,7 @@
<!--packages-start-->

- @vates/types major
- @xen-orchestra/vmware-explorer patch
- @xen-orchestra/web-core minor
- xo-server-auth-oidc patch
- xo-server-backup-reports minor
Expand Down
Loading