Bug 2151170

Summary: [cnv-4.10] many KubeVirtComponentExceedsRequestedMemory alerts in Firing state
Product: Container Native Virtualization (CNV) Reporter: Kedar Bidarkar <kbidarka>
Component: VirtualizationAssignee: Jed Lejosne <jlejosne>
Status: CLOSED ERRATA QA Contact: zhe peng <zpeng>
Severity: high Docs Contact:
Priority: urgent    
Version: 4.10.7CC: acardace, akrgupta, dshchedr, jlejosne, kbidarka, kgordeev, mzheng, olivier.meyer, pveiga, sgott, usurse, ycui, ymotiyel
Target Milestone: ---   
Target Release: 4.10.9   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: virt-operator-container-v4.10.8-9 hco-bundle-registry-container-v4.10.8-37 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: 2078545 Environment:
Last Closed: 2023-06-13 14:59:19 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 2078545, 2166385    
Bug Blocks:    

Comment 7 Priscila 2023-02-01 19:12:12 UTC
*** Bug 2166385 has been marked as a duplicate of this bug. ***

Comment 9 Kedar Bidarkar 2023-02-08 14:40:49 UTC
Note:
1) Directly patching KubeVirt CR would get reconciled and reset to the original default values
2) We need to patch KubeVirt CR only via HCO CR, using the below command.

If needed, the command to patch virt-controller Deployment and increase the memory is, 

oc annotate --overwrite -n openshift-cnv hyperconverged kubevirt-hyperconverged \
  kubevirt.kubevirt.io/jsonpatch='[
    {
      "op": "add",
      "path": "/spec/customizeComponents/patches",
      "value": [{
          "patch": "[{\"op\":\"add\",\"path\":\"/spec/template/spec/containers/0/resources/requests\",\"value\":{\"cpu\": \"10m\",\"memory\": \"400Mi\"}}]",
          "resourceName": "virt-controller",
          "resourceType": "Deployment",
          "type": "json"
      }]
    }
  ]'

Note: We updating memory to be 400Mi here, just as an example, this does not mean that, these are the recommended values.

Comment 10 Kedar Bidarkar 2023-02-08 14:43:18 UTC
The above command would add annotations to HCO CR,

]$ oc get hyperconverged kubevirt-hyperconverged -n openshift-cnv -o yaml 
apiVersion: hco.kubevirt.io/v1beta1
kind: HyperConverged
metadata:
  annotations:
    kubevirt.kubevirt.io/jsonpatch: |-
      [
          {
            "op": "add",
            "path": "/spec/customizeComponents/patches",
            "value": [{
                "patch": "[{\"op\":\"add\",\"path\":\"/spec/template/spec/containers/0/resources/requests\",\"value\":{\"cpu\": \"10m\",\"memory\": \"400Mi\"}}]",
                "resourceName": "virt-controller",
                "resourceType": "Deployment",
                "type": "json"
            }]
          }
        ]

Comment 26 zhe peng 2023-06-05 09:33:00 UTC
verify with build: CNV-v4.10.9-53

test all virt components, requested memory is greater than the used memory, move to verified.

Comment 31 errata-xmlrpc 2023-06-13 14:59:19 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (OpenShift Virtualization 4.10.9 RPMs), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHEA-2023:3573