XO Tasks VS xe task-list - which is correct?
-
Large difference between xe task-list versus the xo tasks web page.
XOA "Tasks" says the task is 100% done. Has been at 100% for over two hours.
xe task-list says only about 50% done. -
So the story behind the gap in reported tasks is fun. Let me explain.
XO is using JSON-RPC to fetch data from XenServer.
XAPI is capable of doing both JSON-RPC and XML-RPC, but the latter is eating CPU a lot (parsing XML is very costly).
So Xen Orchestra switched to JSON-RPC 6 years ago (see https://xen-orchestra.com/blog/improving-xen-orchestra-performances/ for more details and this impressive graph)
In blue, XO 4.1 using XML-RPC, vs JSON-RPC in orange.Anyway, JSON-RPC implementation in XenServer 6.5 is far from perfect. Some numbers (floats) are not correctly parsed when converted in JSON by XAPI.
It means that a task with progress <= 0.5 will be returned as 0, and progress > 0.5 will be casted to...1!
So it's a XAPI bug in the end, fixed in XenServer 7.0
-
- Your XO is out of sync. Refresh the UI, or disconnect/reconnect.
- Or you are using XenServer <7.0 (like 6.5).
-
@olivierlambert
Yes, the relevant host is Citrix 6.5!, thank you. Moving more VMs to XCP-ng over-the-holidays. -
So the story behind the gap in reported tasks is fun. Let me explain.
XO is using JSON-RPC to fetch data from XenServer.
XAPI is capable of doing both JSON-RPC and XML-RPC, but the latter is eating CPU a lot (parsing XML is very costly).
So Xen Orchestra switched to JSON-RPC 6 years ago (see https://xen-orchestra.com/blog/improving-xen-orchestra-performances/ for more details and this impressive graph)
In blue, XO 4.1 using XML-RPC, vs JSON-RPC in orange.Anyway, JSON-RPC implementation in XenServer 6.5 is far from perfect. Some numbers (floats) are not correctly parsed when converted in JSON by XAPI.
It means that a task with progress <= 0.5 will be returned as 0, and progress > 0.5 will be casted to...1!
So it's a XAPI bug in the end, fixed in XenServer 7.0
-
-
-
-
@olivierlambert
So 39% on the Citrix host shows as 0% in XO,
but 51% on the Citrix host shows as 100% in XO.
Got it. Hopefully, we can put that nonsense behind us soon. -
@rjt yes exactly.