vatesfr / xen-orchestra

The global orchestration solution to manage and backup XCP-ng and XenServer.
https://xen-orchestra.com
Other
767 stars 262 forks source link

When using load-balancer #3026

Closed txsastre closed 6 years ago

txsastre commented 6 years ago

I have this issue when using load-balancer.

vm.stats
{
  "id": "e7ca50f5-06df-6c66-6ff3-66f744955d50"
}
{
  "message": "Unable to get the true granularity: 60",
  "stack": "FaultyGranularity: Unable to get the true granularity: 60
    at /opt/xen-orchestra/packages/xo-server/src/xapi-stats.js:321:12
    at Generator.next (<anonymous>)
    at step (/opt/xen-orchestra/packages/xo-server/dist/xapi-stats.js:44:221)
    at _next (/opt/xen-orchestra/packages/xo-server/dist/xapi-stats.js:44:409)
    at run (/opt/xen-orchestra/node_modules/core-js/modules/es6.promise.js:75:22)
    at /opt/xen-orchestra/node_modules/core-js/modules/es6.promise.js:92:30
    at flush (/opt/xen-orchestra/node_modules/core-js/modules/_microtask.js:18:9)
    at _combinedTickCallback (internal/process/next_tick.js:131:7)
    at process._tickCallback (internal/process/next_tick.js:180:9)"
}
Danp2 commented 6 years ago

FWIW, additional details here

txsastre commented 6 years ago

hi. there. tested the new release, xo-server 5.20.3 xo-web 5.20.2

but now I have this othe problem. something related to " TypeError: Cannot read property 'length' of undefined"

Jun 19 09:56:00 XO xo-server[6702]: [load-balancer]Execute plans! Jun 19 09:56:00 XO xo-server[6702]: [load-balancer]No hosts to optimize. Jun 19 09:57:00 XO xo-server[6702]: [load-balancer]Execute plans! Jun 19 09:57:00 XO xo-server[6702]: [load-balancer]Try to optimize Host (b85f0655-5f7f-4e48-aae8-51e629cae9f5). Jun 19 09:57:00 XO xo-server[6702]: [WARN] scheduled function: TypeError: Cannot read property 'length' of undefined Jun 19 09:57:00 XO xo-server[6702]: at computeAverage (/opt/xen-orchestra/packages/xo-server-load-balancer/src/plan.js:30:10) Jun 19 09:57:00 XO xo-server[6702]: at computeRessourcesAverage (/opt/xen-orchestra/packages/xo-server-load-balancer/src/plan.js:57:18) Jun 19 09:57:00 XO xo-server[6702]: at PerformancePlan._callee5$ (/opt/xen-orchestra/packages/xo-server-load-balancer/src/plan.js:262:6) Jun 19 09:57:00 XO xo-server[6702]: at tryCatch (/opt/xen-orchestra/node_modules/regenerator-runtime/runtime.js:62:40) Jun 19 09:57:00 XO xo-server[6702]: at Generator.invoke [as _invoke] (/opt/xen-orchestra/node_modules/regenerator-runtime/runtime.js:296:22) Jun 19 09:57:00 XO xo-server[6702]: at Generator.prototype.(anonymous function) [as next] (/opt/xen-orchestra/node_modules/regenerator-runtime/runtime.js:114:21) Jun 19 09:57:00 XO xo-server[6702]: at step (/opt/xen-orchestra/node_modules/babel-runtime/helpers/asyncToGenerator.js:17:30) Jun 19 09:57:00 XO xo-server[6702]: at /opt/xen-orchestra/node_modules/babel-runtime/helpers/asyncToGenerator.js:28:13 Jun 19 09:57:00 XO xo-server[6702]: at run (/opt/xen-orchestra/node_modules/core-js/modules/es6.promise.js:75:22) Jun 19 09:57:00 XO xo-server[6702]: at /opt/xen-orchestra/node_modules/core-js/modules/es6.promise.js:92:30 Jun 19 09:57:00 XO xo-server[6702]: at flush (/opt/xen-orchestra/node_modules/core-js/modules/_microtask.js:18:9) Jun 19 09:57:00 XO xo-server[6702]: at _combinedTickCallback (internal/process/next_tick.js:131:7) Jun 19 09:57:00 XO xo-server[6702]: at process._tickCallback (internal/process/next_tick.js:180:9)

badrAZ commented 6 years ago

Hi! Yesterday we merged a fix for this issue. Please update your branch.

txsastre commented 6 years ago

Thanks I will try again.

txsastre commented 6 years ago

hi!, I reinstalled XOCE with this script https://github.com/Jarli01/xenorchestra_updater and changing the branch to "next-release" sudo ./xo-update -b next-release to switch to "next-release" branch

the version are xo-server 5.20.3

xo-web 5.20.2

still same bug.

badrAZ commented 6 years ago

Hi! The branch is named master. Please create another issue on this repository. Thank you!

txsastre commented 6 years ago

hi, I have now the 5.23 web and server.

actually there is no visible problems, but the balancing is not done.

all I can see on terminal is [load-balancer]Execute plans! Jul 27 08:45:01 XO xo-server[24232]: [load-balancer]No hosts to optimize.

same tests related in the forum https://xen-orchestra.com/forum/topic/1056/load-balancing-what-do-i-miss

olivierlambert commented 6 years ago

Hi,

You probably need to keep your VMs longer above the threshold.

txsastre commented 6 years ago

hi @olivierlambert

there are 2 threaholds 1 - I have now a host with only 500MB RAM remaining 2 - I have a linux VM that executes "stress" and it pulls the overall CPU host to 90-100% (I can try to make it stay longer, now its 1mn... may be not enought). Trying with 6-7minutes

seleccio_014

txsastre commented 6 years ago

well, now I can see this

Jul 27 09:15:00 XO xo-server[24232]: [load-balancer]Execute plans!
Jul 27 09:15:00 XO xo-server[24232]: [load-balancer]No hosts to optimize.
Jul 27 09:15:00 XO xo-server[24232]: [load-balancer]Try to optimize Host (d64f7775-2682-4c46-bb42-ab565fc66f37).
Jul 27 09:15:00 XO xo-server[24232]: [load-balancer]Performance mode: 0 optimizations for Host (d64f7775-2682-4c46-bb42-ab565fc66f37).

seems that it detects that there's a trigger, but it does do nothing.

olivierlambert commented 6 years ago
  1. For multiline text, please use three ``` (I edited your comment)
  2. It does nothing because there is no optimization possible in this case.
txsastre commented 6 years ago

ok then... may be I'm not understanding how the optimization is supposed to work :?

Thanks for the edition, still a little newbe here.

olivierlambert commented 6 years ago

https://xen-orchestra.com/docs/load_balancing.html

Basically, it will search a host with lower cpu usage in the same pool first (than your current host where the VM crossing the threshold was detected). In another pool if necessary.

txsastre commented 6 years ago

ok, that's it.

and that was the test. 3 hosts. 2 are empty and 1 is used to stress

the 1 is emptied of RAM and CPU usage and I thought that there should be some VM that would be moved to the 2 empty hosts.

but nothing is happening. :/