Skip to content

Commit

Permalink
feat(V2V/powerOff): handle queued state when stopping the VM
Browse files Browse the repository at this point in the history
from #34451
  • Loading branch information
fbeauchamp committed Feb 10, 2025
1 parent f692c25 commit a7ec8f5
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions @xen-orchestra/vmware-explorer/esxi.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -404,9 +404,10 @@ export default class Esxi extends EventEmitter {
// 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

0 comments on commit a7ec8f5

Please sign in to comment.