Skip to content

Commit 338756b

Browse files
machadovilacakubevirt-bot
authored and
kubevirt-bot
committed
Alert VMStorageClassWarning only for Windows VMs
Signed-off-by: machadovilaca <[email protected]>
1 parent 47604cb commit 338756b

File tree

2 files changed

+55
-9
lines changed

2 files changed

+55
-9
lines changed

pkg/monitoring/rules/alerts/operator.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -75,10 +75,10 @@ func operatorAlerts() []promv1.Rule {
7575
},
7676
{
7777
Alert: "VMStorageClassWarning",
78-
Expr: intstr.FromString("(count(kubevirt_ssp_vm_rbd_block_volume_without_rxbounce > 0) or vector(0)) > 0"),
78+
Expr: intstr.FromString("(count(kubevirt_ssp_vm_rbd_block_volume_without_rxbounce * on(name, namespace) (kubevirt_vmi_info{guest_os_name=\"Microsoft Windows\"} > 0 or kubevirt_vmi_info{os=~\"windows.*\"} > 0) > 0) or vector(0)) > 0"),
7979
Annotations: map[string]string{
80-
"summary": "{{ $value }} Virtual Machines may cause reports of bad crc/signature errors due to certain I/O patterns.",
81-
"description": "When running VMs using ODF storage with 'rbd' mounter or 'rbd.csi.ceph.com provisioner', VMs may cause reports of bad crc/signature errors due to certain I/O patterns. Cluster performance can be severely degraded if the number of re-transmissions due to crc errors causes network saturation.",
80+
"summary": "{{ $value }} Windows Virtual Machines may cause reports of bad crc/signature errors due to certain I/O patterns.",
81+
"description": "When running Windows VMs using ODF storage with 'rbd' mounter or 'rbd.csi.ceph.com provisioner', VMs may cause reports of bad crc/signature errors due to certain I/O patterns. Cluster performance can be severely degraded if the number of re-transmissions due to crc errors causes network saturation.",
8282
},
8383
Labels: map[string]string{
8484
severityAlertLabelKey: "warning",

pkg/monitoring/rules/rules-tests.yaml

+52-6
Original file line numberDiff line numberDiff line change
@@ -170,20 +170,28 @@ tests:
170170
# VMStorageClassWarning alert tests
171171
- interval: "1m"
172172
input_series:
173-
- series: 'kubevirt_ssp_vm_rbd_block_volume_without_rxbounce'
174-
values: '0 0 1 0'
173+
- series: 'kubevirt_vmi_info{name="vm1", namespace="ns1", os="windows2k22", guest_os_name="Microsoft Windows"}'
174+
values: '1 1 1 0 _'
175+
- series: 'kubevirt_vmi_info{name="vm1", namespace="ns1", os="<none>", guest_os_name="Microsoft Windows"}'
176+
values: '_ _ _ _ 1 0 _'
177+
- series: 'kubevirt_vmi_info{name="vm1", namespace="ns1", os="windows2k22", guest_os_name="<none>"}'
178+
values: '_ _ _ _ _ _ 1 0 _'
179+
- series: 'kubevirt_vmi_info{name="vm1", namespace="ns1", os="<none>", guest_os_name="<none>"}'
180+
values: '_ _ _ _ _ _ _ _ 1 0 _'
181+
- series: 'kubevirt_ssp_vm_rbd_block_volume_without_rxbounce{name="vm1", namespace="ns1"}'
182+
values: '0 0 1 1 1 1 1 1 1 1 1'
175183

176184
alert_rule_test:
177-
- eval_time: "1m"
185+
- eval_time: "1m" # VM RDB Block Volume has rxbounce
178186
alertname: "VMStorageClassWarning"
179187
exp_alerts: []
180188

181-
- eval_time: "2m"
189+
- eval_time: "2m" # Both OS and Guest OS are set to Windows
182190
alertname: "VMStorageClassWarning"
183191
exp_alerts:
184192
- exp_annotations:
185-
summary: "1 Virtual Machines may cause reports of bad crc/signature errors due to certain I/O patterns."
186-
description: "When running VMs using ODF storage with 'rbd' mounter or 'rbd.csi.ceph.com provisioner', VMs may cause reports of bad crc/signature errors due to certain I/O patterns. Cluster performance can be severely degraded if the number of re-transmissions due to crc errors causes network saturation."
193+
summary: "1 Windows Virtual Machines may cause reports of bad crc/signature errors due to certain I/O patterns."
194+
description: "When running Windows VMs using ODF storage with 'rbd' mounter or 'rbd.csi.ceph.com provisioner', VMs may cause reports of bad crc/signature errors due to certain I/O patterns. Cluster performance can be severely degraded if the number of re-transmissions due to crc errors causes network saturation."
187195
runbook_url: "https://kubevirt.io/monitoring/runbooks/VMStorageClassWarning"
188196
exp_labels:
189197
severity: "warning"
@@ -194,3 +202,41 @@ tests:
194202
- eval_time: "3m"
195203
alertname: "VMStorageClassWarning"
196204
exp_alerts: []
205+
206+
- eval_time: "4m" # Guest OS is set to Windows
207+
alertname: "VMStorageClassWarning"
208+
exp_alerts:
209+
- exp_annotations:
210+
summary: "1 Windows Virtual Machines may cause reports of bad crc/signature errors due to certain I/O patterns."
211+
description: "When running Windows VMs using ODF storage with 'rbd' mounter or 'rbd.csi.ceph.com provisioner', VMs may cause reports of bad crc/signature errors due to certain I/O patterns. Cluster performance can be severely degraded if the number of re-transmissions due to crc errors causes network saturation."
212+
runbook_url: "https://kubevirt.io/monitoring/runbooks/VMStorageClassWarning"
213+
exp_labels:
214+
severity: "warning"
215+
operator_health_impact: "none"
216+
kubernetes_operator_part_of: "kubevirt"
217+
kubernetes_operator_component: "ssp-operator"
218+
219+
- eval_time: "5m"
220+
alertname: "VMStorageClassWarning"
221+
exp_alerts: []
222+
223+
- eval_time: "6m" # OS is set to Windows
224+
alertname: "VMStorageClassWarning"
225+
exp_alerts:
226+
- exp_annotations:
227+
summary: "1 Windows Virtual Machines may cause reports of bad crc/signature errors due to certain I/O patterns."
228+
description: "When running Windows VMs using ODF storage with 'rbd' mounter or 'rbd.csi.ceph.com provisioner', VMs may cause reports of bad crc/signature errors due to certain I/O patterns. Cluster performance can be severely degraded if the number of re-transmissions due to crc errors causes network saturation."
229+
runbook_url: "https://kubevirt.io/monitoring/runbooks/VMStorageClassWarning"
230+
exp_labels:
231+
severity: "warning"
232+
operator_health_impact: "none"
233+
kubernetes_operator_part_of: "kubevirt"
234+
kubernetes_operator_component: "ssp-operator"
235+
236+
- eval_time: "7m"
237+
alertname: "VMStorageClassWarning"
238+
exp_alerts: []
239+
240+
- eval_time: "8m" # Neither OS nor Guest OS is set to Windows
241+
alertname: "VMStorageClassWarning"
242+
exp_alerts: [ ]

0 commit comments

Comments
 (0)