diff --git a/CHANGELOG.unreleased.md b/CHANGELOG.unreleased.md index 37ed39e37..53b687bb2 100644 --- a/CHANGELOG.unreleased.md +++ b/CHANGELOG.unreleased.md @@ -12,6 +12,7 @@ > Users must be able to say: “I had this issue, happy to know it's fixed” - [Import/VMWare] Fix `(Failure \"Expected string, got 'I(0)'\")` (PR [#7361](https://github.com/vatesfr/xen-orchestra/issues/7361)) +- [Plugin/load-balancer] Fixing `TypeError: Cannot read properties of undefined (reading 'high')` happening when trying to optimize a host with performance plan [#7359](https://github.com/vatesfr/xen-orchestra/issues/7359) (PR [#7362](https://github.com/vatesfr/xen-orchestra/pull/7362)) ### Packages to release @@ -30,5 +31,6 @@ - xo-server patch +- xo-server-load-balancer patch diff --git a/packages/xo-server-load-balancer/src/performance-plan.js b/packages/xo-server-load-balancer/src/performance-plan.js index 372385cbb..7d28c93b4 100644 --- a/packages/xo-server-load-balancer/src/performance-plan.js +++ b/packages/xo-server-load-balancer/src/performance-plan.js @@ -178,7 +178,7 @@ export default class PerformancePlan extends Plan { const state = this._getThresholdState(exceededAverages) if ( destinationAverages.cpu + vmAverages.cpu >= this._thresholds.cpu.low || - destinationAverages.memoryFree - vmAverages.memory <= this._thresholds.memory.high || + destinationAverages.memoryFree - vmAverages.memory <= this._thresholds.memoryFree.high || (!state.cpu && !state.memory && (exceededAverages.cpu - vmAverages.cpu < destinationAverages.cpu + vmAverages.cpu ||