Skip to content

Conversation

psafont
Copy link
Member

@psafont psafont commented Jun 27, 2025

The former should not collect any metrics, and instead only consolidate them, while the latter was already collecting memory metrics using xenctrl and xenstore, but only 2 of them.

Xapi had to be modified to be able to collect the metrics from the new source, since the file where they reside has changed.

The memory_target metric was also associated with xenopsd and an RPC call. These are no longer needed and code has been deleted.

The only functional change is that now memory_target is not reported when it's not available. The new behaviour makes it work the same as other guest-agent-reported metrics. Previously it was reported as 0 instead, which was incorrect. Since the other metrics are reported in the same way, clients already know how to cope with this behaviour.

Tests done have compared an unpatched host with a patched one:

  • Upgrade using yum update:
    • no changes apparent in xencenter, both on host and vm tabs
    • none of the metrics disappeared, and they have the same metadata. Checked with rrd2csv, xe vm-data-sources-list and xe host-data-sources-list
    • memory-target now is reported as N/A in rrd2csv, it was previously reported as 0 (expected change)
    • Host metrics are still shown in the database with correct numbers
# xe host-param-list uuid=5efc236c-f137-4df7-9902-ba8fbf9a2ac2 | grep mem
                       memory-overhead ( RO): 639635456
                          memory-total ( RO): 33849733120
                           memory-free ( RO): 26117525504
                  memory-free-computed ( RO): 26077683712
  • New host installation:
    • xencenter performance tabs look fine
    • memory-target is now missing (expected change, because this metric was never collected)
    • Host metrics are shown and total memory matches update case (same host was used, with the VMs using less memory)
# xe host-param-list uuid=b9c0e6d5-c362-469f-8147-38184125e9be | grep mem
                       memory-overhead ( RO): 639635456
                          memory-total ( RO): 33849733120
                           memory-free ( RO): 21789081600
                  memory-free-computed ( RO): 21749161984

psafont added 4 commits June 27, 2025 09:56
Previously if only some of the values was missing, the arithmetic operations
where done and they were taken into account into the host total.

When a domain's values are missing, they are not taken into the sum.

Also prepare the code to add per-VM metrics by using shared infrastructure and
using a record.

Signed-off-by: Pau Ruiz Safont <[email protected]>
The daemon was already watching the vm memory targets, so it makes sense to
make it generate the datasources directly as well.

This uses the shared xenctrl infrastructure that's needed to fetch the domains'
uuids.

This means that xcp-rrdd does not need to collect this anymore, and xenopsd
does not need to send it to xcp-rrdd.

The function in the idl is safe to delete because the only user was xenopsd,
and it was well-protected against errors. This means that if an old version of
xenopsd tries to call the function while xcp-rrdd has already been updated, it
won't interrupt xneopsd functionality.

Signed-off-by: Pau Ruiz Safont <[email protected]>
Since this daemon already uses xenstore to watch other memory keys in xenstore,
move another one in here, allows to delete quite a bit of code from xcp-rrdd
and drop dependencies as well.

Signed-off-by: Pau Ruiz Safont <[email protected]>
… file

Xapi currently reads directly from memory-mapped metrics files. Since we want
to move all the memory metrics to rrdp_squeezed, and this will output all the
metrics into a single memory-mapped file,  move the host and VM memory metrics
into a single module, and make them share a bit of code.

Signed-off-by: Pau Ruiz Safont <[email protected]>
@psafont psafont requested review from mg12 and last-genius June 27, 2025 09:58
@psafont psafont force-pushed the private/paus/numa-mem-metrics branch from c87f137 to 965df3a Compare June 27, 2025 10:08
@last-genius
Copy link
Contributor

the rrdp-squeezed: move remaining memory metrics to this plugin commit has two sign-offs from a squash

psafont added 2 commits June 27, 2025 14:17
This allows to xcp-rrdd to stop writing to memory-mapped files

This needed xapi to be adapted since it read the contents of the memory-mapped
files. Now it can get those metric from a single memory-mapped file.

Signed-off-by: Pau Ruiz Safont <[email protected]>
@psafont psafont force-pushed the private/paus/numa-mem-metrics branch from 965df3a to fa5bc72 Compare June 27, 2025 13:18
@psafont psafont enabled auto-merge June 27, 2025 13:18
@psafont psafont added this pull request to the merge queue Jun 27, 2025
Merged via the queue into xapi-project:master with commit 1b20f51 Jun 27, 2025
16 checks passed
@psafont psafont deleted the private/paus/numa-mem-metrics branch June 27, 2025 13:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants