Skip to content

Prometheus integration ignores capacity_state #7000

Description

@benj-n
ISSUE TYPE
  • Bug Report
COMPONENT NAME
Prometheus integration
CLOUDSTACK VERSION
4.17.X
CONFIGURATION
OS / ENVIRONMENT

Irrelevant.

SUMMARY

The prometheus integration returns inconsistent capacity values when a host is in "maintenance" and cloudstack-management service is restarted.

STEPS TO REPRODUCE
1. Set "maintenance" status for a host
2. In database, the capacity rows are deleted in the op_host_capacity table, for the said host
3. Prometheus integration returns capacities with value=0 
4. Restart cloudstack-management service while the host is still in maintenance
5. In database, table op_host_capacity is populated, with capacity_state = Disabled
6. Prometheus integration now returns capacity values from used/total_capacity columns, ignoring the capacity_state
EXPECTED RESULTS
Prometheus integration returns capacity values=0 when the capacity is missing (eg. host is in maintenance) or when the capacity_state is set at Disabled (eg. host in maintenance and service is restarted)
ACTUAL RESULTS
Prometheus integration returns capacity values all the time as long as the used/total_capacity columns exist, ignoring when the capacity_state is Disabled.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions