Uploaded image for project: 'OpenShift Virtualization'
  1. OpenShift Virtualization
  2. CNV-61831

Showing the VM CPU and Memory based on the kubevirt_vm_resource_requests is too complex

XMLWordPrintable

    • CNV I/U Operators Sprint 272, CNV I/U Operators Sprint 273, CNV I/U Operators Sprint 274, CNV I/U Operators Sprint 275, CNV I/U Operators Sprint 276, CNV I/U Operators Sprint 277, CNV I/U Operators Sprint 278
    • None

      Description of problem:

      Showing the VM CPU and Memory based on the kubevirt_vm_resource_requests is to complex.
      
      Currently there is no simple way to show in the dashboards the VM CPU and memory, since they report the data based on the `source` and there is a logic that determines the actual VM and Memory assigned to the VM that needs to be added to the metric.
      
      We should report this metric in a way that will be easy to visualize and calculate and that already calculated the actual memory and CPU the VM is allocated.
      
      This is how I need to do this for now:
      
      CPU:
      
      (sum by (cluster, namespace, name) (
      (kubevirt_vm_resource_requests{cluster=~"$cluster", name=~"$name", namespace=~"$namespace", resource="cpu", unit="cores", source=~"default|domain"})
      * ignoring (unit)(kubevirt_vm_resource_requests{cluster=~"$cluster", name=~"$name", namespace=~"$namespace", resource="cpu", unit="sockets", source=~"default|domain"})
      * ignoring (unit)(kubevirt_vm_resource_requests{cluster=~"$cluster", name=~"$name", namespace=~"$namespace", resource="cpu", unit="threads", source=~"default|domain"})
      ) or
      sum by (cluster, namespace, name) (
      (kubevirt_vm_resource_requests{cluster=~"$cluster", name=~"$name", namespace=~"$namespace", resource="cpu", unit="cores", source=~"default|domain"})
      * ignoring (unit)(kubevirt_vm_resource_requests{cluster=~"$cluster", name=~"$name", namespace=~"$namespace", resource="cpu", unit="sockets", source=~"default|domain"})
      )
       or
      sum by (cluster, namespace, name) (
      (kubevirt_vm_resource_requests{cluster=~"$cluster", name=~"$name", namespace=~"$namespace", resource="cpu", unit="cores", source=~"default|domain"})
      ))
      
      Memory:
      
      
      max by (cluster, namespace, name)(kubevirt_vm_resource_requests{cluster=~"$cluster", name=~"$name", namespace=~"$namespace",resource="memory"})
      
      Had to use "Max", but it is not accurate.

      Version-Release number of selected component (if applicable):

       

      How reproducible:

       

      Steps to Reproduce:

      1.
      2.
      3.
      

      Actual results:

       

      Expected results:

       

      Additional info:

       

              sradco Shirly Radco
              sradco Shirly Radco
              Krzysztof Majcher Krzysztof Majcher
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated: