Repository navigation
CTOR-2517-vates-host-plugin-v2 - #6449
Merged
Merged
Conversation
Evan-Adam
requested review from
jean-christophe81,
lucie-tirand and
thibaults-centreon
and removed request for
a team
September 24, 2026 11:43
omercier
reviewed
Sep 24, 2026
omercier
reviewed
Sep 24, 2026
Refs:CTOR-2517 Adds a new apps::virtualization::vates::host plugin with the 3 host service modes from the spec (status, cpu, memory) plus a discovery mode to auto-create Centreon hosts from XO's /hosts list. Extends the shared custom/api.pm with a generic get_host_info() (parameterized fields, mirroring get_vm_info but reused across the 3 modes instead of duplicated).
Refs:CTOR-2517 Covers status/cpu/memory/discovery/help against a Mockoon fixture extended with 2 hosts (one enabled+running, one disabled+halted) and a new hosts/:UUID/stats route (per-core CPU percentage series) shared with the rest of the vates suites. Full vates regression (vm, pool, xenorchestra, host) passes: 74/74.
Refs:CTOR-2517 Discovered while smoke-testing the host plugin against the real XO instance: the REST API's filter=field:value does a substring match, not an exact one (filter=name_label:vates also matches 'vates2' and 'vates3'). Every single-object lookup in this file (get_name_and_uuid, get_vm_info, get_host_info) asserts the API returns exactly one match, so any name that is a prefix of another object's name silently produced a false "no host/vm/pool found" instead of resolving the intended object. Narrows multi-match responses down to the exact match before that assertion.
… report offline Refs:CTOR-2517 manage_selection() used get_host_info() (a live, uncached call fetching enabled/power_state/CPUs) purely to pre-check the host was running before hitting /stats. Switched to get_name_and_uuid() (cached on disk per --reload-cache-time, like pool/cpuovercommit.pm already does) plus silently_fail on the /stats call itself: a disabled/halted host makes that endpoint fail with a XAPI "HOST_OFFLINE" error, which is now surfaced directly instead of being pre-empted by an extra live API call. Also drops the separate (deprecated, string-typed) CPUs.cpu_count field: the number of per-core series already counted while averaging /stats is the same live CPU count. Mockoon fixture: added a per-UUID error response on hosts/:UUID/stats, and marked the generic one as the route's default response - it turns out mockoon-server only considers rule-bearing responses in its match loop and otherwise falls back to responses[0], so an un-marked generic response happened to work by accident until a rule-bearing sibling was added.
… host Refs:CTOR-2517 A disabled host still reports a valid memory.size with usage:0, so the mode silently returned "OK: 0.00 % of the memory is used" instead of signaling the host isn't actually up. Now requests enabled/power_state alongside memory (still a single API call) and exits UNKNOWN before computing usage, matching the status and cpu modes' behavior.
Refs:CTOR-2517
Refs:CTOR-2517
Evan-Adam
force-pushed
the
CTOR-2517-vates-host-plugin-v2
branch
from
September 24, 2026 15:26
7aa3802 to
7b117c7
Compare
omercier
approved these changes
Sep 24, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
New vates Host plugin
Fixes # CTOR-2517
Type of change
How this pull request can be tested ?
see automated tests
Checklist