XCP-ng
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Register
    • Login
    1. Home
    2. jcirc
    3. Posts
    J
    Offline
    • Profile
    • Following 0
    • Followers 0
    • Topics 1
    • Posts 1
    • Groups 0

    Posts

    Recent Best Controversial
    • vm.stats questions on response and parameters

      Hello

      I'm pulling stats for all VMs to understand CPU usage. We're a bit behind the curve in terms of XO versions, but these questions hopefully are still relevant.

      If using a granularity of days, the interval is set to 86400 (understandably) but the endTimestamp varies. Running this on June 9th @ ~1740 we get timestamps for both Mon Jun 8 01:00:00 AM BST 2026 and Tues Jun 9 01:00:00 AM BST 2026.

      1. Does this average across the day? Why is the timestamp 0100?
      2. Why would there be different timestamps between VMs (all are running) and does that mean that the figures are misaligned in the results?

      These are retrieved via curl and a bash script, a bit hacky, but for clarity the request is:

      ++ curl -X GET -s -H accept:application/json -b authenticationToken=[[REDACTED]] -o [[REDACTED]] 'https://[[REDACTED]]/rest/v0/vms/[[REDACTED]]/stats?granularity=days'

      1. Really keen to know if we can control the start and endtime, as well as provide a manual interval, as well as the aggregation strategy (min, max, average). Are any of these possible?

      2. Lastly, is cpuUsage the percentage as per the dashboard, but averaged over all CPUs?

      Thanks so much in advance. 😃

      James

      posted in REST API
      J
      jcirc