You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add option to exclude filtered resources from cluster capacity (DataDog#22997)
* fix cluster capacity counting for hostless/filtered vms
* changelog
* fix multi cluster case, improve testing fixtures
* improve test
* address review: use ClusterCapacity for hostless VMs, extract helper, fix test style
- Replace dict[str, tuple[int, int]] with dict[str, ClusterCapacity] for
_hostless_vm_capacity_by_cluster to align with existing pattern
- Extract _extract_vm_capacity helper to eliminate duplication between
_accumulate_vm_capacity and _report_vm_capacity_metrics
- Add debug log when a hostless VM has no cluster ID
- Add comment documenting non-batch mode limitation for hostless VMs
- Convert TestMultiClusterHostlessVMCapacity class to plain test functions
- Fix misleading comment: OFF VM has a host, it is not a hostless VM
- Import HOST_NAME from constants.py instead of redefining locally
- Parametrize test_exclude_vm_by_id for both batch modes
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* address review: cleanup code, separation of concerns, and flat unit tests
* change health_check failure log message to error instead of warning
* more refactoring and code cleanup
* fix unused HOST_NAME import in test_resource_filters
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* add exclude_filtered_resources_from_cluster_capacity property + regenerate models
* separate cluster capacity computation from metrics collection + add exclude_filtered_resources_from_cluster_capacity + cleanup + added tests
* address review + more cleanup + improve tests
* Update nutanix/README.md
Co-authored-by: Rosa Trieu <107086888+rtrieu@users.noreply.github.com>
* Address review feedback: reset state before health check, consolidate VM capacity extraction
- Move reset_state() before health check to guarantee clean state on every run
- Consolidate _extract_vm_capacity to return all fields, eliminating duplicate
parsing in _report_vm_capacity_metrics
- Fix trailing whitespace and extra blank lines
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Clarify VM collection mode decoupling in docstrings
Make it explicit that _vms_by_host is populated by either batch or
non-batch mode, and that hostless VMs (the "" key) are only present
in batch mode.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Include hostless VMs in cluster capacity for all collection modes
Add _get_hostless_vms to lazily fetch and cache hostless VMs (the "" key)
in non-batch mode. Split _report_cluster_capacity_metrics into two clear
loops: hosted VMs (scoped by host_ids) and hostless VMs (scoped by
cluster_id). Parameterize hostless VM tests on batch_vm_collection.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Revert _get_hostless_vms: hostless VMs only available in batch mode
Fetching all VMs to extract hostless ones defeats the purpose of
non-batch mode. Hostless VMs are only captured via _build_vms_by_host_cache
(batch mode), which is the expected trade-off.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-authored-by: Rosa Trieu <107086888+rtrieu@users.noreply.github.com>
Copy file name to clipboardExpand all lines: nutanix/README.md
+4Lines changed: 4 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -101,6 +101,10 @@ resource_filters:
101
101
102
102
Category tags use the Nutanix category key as the tag name (e.g., `Environment:Production`). Set `prefix_category_tags: true` to prefix them with `ntnx_` (e.g., `ntnx_Environment:Production`) to avoid collisions with existing Datadog tags.
103
103
104
+
### Cluster capacity planning
105
+
106
+
Cluster-level capacity metrics (such as `cluster.cpu.total_cores`, `cluster.cpu.vcpus_allocated`, `cluster.memory.allocated_bytes`) aggregate resources from all hosts and VMs. By default, all resources contribute regardless of `resource_filters`. This gives a complete view of provisioned capacity. Set `exclude_filtered_resources_from_cluster_capacity: true` to count only resources that pass filter checks.
107
+
104
108
### Duplicate hostnames
105
109
106
110
The Nutanix API does not expose the real hostname of VMs. VM metrics use the VM name from Prism Central as the hostname. If the Datadog Agent is installed on a Nutanix VM, its auto-detected hostname may differ from the VM name, causing duplicate hosts in Datadog. To fix this, set `hostname` in `datadog.yaml` (or the `DD_HOSTNAME` environment variable) to match the VM name in Prism Central.
0 commit comments