Bug 2213272

Summary: The metric for the alert LowKVMNodesCount cannot fired
Product: Container Native Virtualization (CNV) Reporter: Ohad <orevah>
Component: VirtualizationAssignee: sgott
Status: ASSIGNED --- QA Contact: Kedar Bidarkar <kbidarka>
Severity: high Docs Contact:
Priority: high    
Version: 4.13.0CC: aadmi, dbasunag, kmajcher, stirabos
Target Milestone: ---   
Target Release: 4.15.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Ohad 2023-06-07 17:11:02 UTC
Description of problem:
The rule for producing the alert LowKVMNodesCount will never fire the alarm because the rule for this alert: 
(kubevirt_allocatable_nodes_count > 1) and (kubevirt_kvm_available_nodes_count < 2)
the kubevirt_allocatable_nodes_count  counts all nodes as allocatable including the master nodes.
The kubevirt_kvm_available_nodes_count expression is: intstr.FromString("kubevirt_allocatable_nodes_count - count(kube_node_status_allocatable{resource=\"devices_kubevirt_io_kvm\"} == 0)")

This expression will give us 3 so the alert will never fire

Comment 1 Krzysztof Majcher 2023-06-13 12:47:26 UTC
Assaf, can you please check which component this alert belongs to?

Comment 2 Assaf Admi 2023-06-13 13:09:19 UTC
Hi Krzysztof, it is coming from kubevirt - https://github.com/kubevirt/kubevirt/blob/main/pkg/virt-operator/resource/generate/components/prometheus.go#L135.