mirror of
https://github.com/vatesfr/xen-orchestra.git
synced 2026-09-13 07:57:53 -05:00
fix(xapi/host): fix async use in a sync block for smart reboot (#10180)
* fix(xapi/host): fix async use in a sync block for smart reboot
This commit is contained in:
@@ -48,14 +48,16 @@ class Host {
|
|||||||
|
|
||||||
// check the VMs with PCI passthrough
|
// check the VMs with PCI passthrough
|
||||||
const vms = await asyncMap(residentVmRefs, ref => this.getRecord('VM', ref))
|
const vms = await asyncMap(residentVmRefs, ref => this.getRecord('VM', ref))
|
||||||
const vmsNotSuspendable = vms.filter(async vm => {
|
const vmsNotSuspendable = []
|
||||||
|
|
||||||
|
await asyncEach(vms, async vm => {
|
||||||
try {
|
try {
|
||||||
await this.call('VM.assert_operation_valid', vm.$ref, 'suspend')
|
await this.call('VM.assert_operation_valid', vm.$ref, 'suspend')
|
||||||
return false
|
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
return true
|
vmsNotSuspendable.push(vm)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
const vmsNotSuspendableRefs = new Set(vmsNotSuspendable.map(vm => vm.$ref))
|
const vmsNotSuspendableRefs = new Set(vmsNotSuspendable.map(vm => vm.$ref))
|
||||||
|
|
||||||
const vmsWithSuspendBlocked = await asyncMap(residentVmRefs, ref => this.getRecord('VM', ref)).filter(
|
const vmsWithSuspendBlocked = await asyncMap(residentVmRefs, ref => this.getRecord('VM', ref)).filter(
|
||||||
|
|||||||
@@ -30,6 +30,7 @@
|
|||||||
- [XO6] Fix the VM's VDI tab, which sometimes displays an error (PR [#10156](https://github.com/vatesfr/xen-orchestra/pull/10156))
|
- [XO6] Fix the VM's VDI tab, which sometimes displays an error (PR [#10156](https://github.com/vatesfr/xen-orchestra/pull/10156))
|
||||||
- [XO6] Reduce the number of HTTP requests when navigating between pages (PR [#10156](https://github.com/vatesfr/xen-orchestra/pull/10156))
|
- [XO6] Reduce the number of HTTP requests when navigating between pages (PR [#10156](https://github.com/vatesfr/xen-orchestra/pull/10156))
|
||||||
- [Backups] Don't hide errors during transfers (PR [#10183](https://github.com/vatesfr/xen-orchestra/pull/10183))
|
- [Backups] Don't hide errors during transfers (PR [#10183](https://github.com/vatesfr/xen-orchestra/pull/10183))
|
||||||
|
- [Smart reboot] Fix `suspendBlocked` error when no issue to suspend resident VMs (PR [#10180](https://github.com/vatesfr/xen-orchestra/pull/10180))
|
||||||
|
|
||||||
### Packages to release
|
### Packages to release
|
||||||
|
|
||||||
@@ -54,6 +55,7 @@
|
|||||||
- @xen-orchestra/rest-api minor
|
- @xen-orchestra/rest-api minor
|
||||||
- @xen-orchestra/web minor
|
- @xen-orchestra/web minor
|
||||||
- @xen-orchestra/web-core minor
|
- @xen-orchestra/web-core minor
|
||||||
|
- @xen-orchestra/xapi patch
|
||||||
- xo-server minor
|
- xo-server minor
|
||||||
- xo-server-openmetrics minor
|
- xo-server-openmetrics minor
|
||||||
- xo-web minor
|
- xo-web minor
|
||||||
|
|||||||
Reference in New Issue
Block a user