Bug 2033346 - [cnv-4.10] Add vm name label to virt-launcher pods
Summary: [cnv-4.10] Add vm name label to virt-launcher pods
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Container Native Virtualization (CNV)
Classification: Red Hat
Component: Metrics
Version: 4.10.0
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: ---
: 4.10.2
Assignee: João Vilaça
QA Contact: SATHEESARAN
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-12-16 15:12 UTC by Shirly Radco
Modified: 2022-06-14 17:43 UTC (History)
6 users (show)

Fixed In Version: hco-bundle-registry-container-v4.10.2-5
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 2078831 (view as bug list)
Environment:
Last Closed: 2022-06-14 17:42:17 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github kubevirt kubevirt pull 7102 0 None Merged Add Virtual Machine name label to virt-launcher pod 2022-02-23 20:16:59 UTC
Github kubevirt kubevirt pull 7617 0 None open [release-0.49] Add Virtual Machine name label to virt-launcher pod 2022-04-22 14:24:52 UTC
Github kubevirt kubevirt pull 7619 0 None open [release-0.50] Add Virtual Machine name label to virt-launcher pod 2022-04-22 21:51:30 UTC
Red Hat Product Errata RHSA-2022:5026 0 None None None 2022-06-14 17:43:15 UTC

Description Shirly Radco 2021-12-16 15:12:55 UTC
Description of problem:
We thought we could relay on getting the vm name for the virt-launcher pods, since we have it in the VM templates.But in case the user uses custom templates this label and others might be missing.

We need to make sure we have a label for the vm name attached to the virt-launcher pods, so that we can filter kube-state-metrics by vm-name and join the virt-launcher container metrics with it by the vm name.

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


How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:

Comment 1 Krzysztof Majcher 2022-01-14 14:32:56 UTC
It looks like something for Virt team, can you please check?

Comment 2 Yaacov Zamir 2022-01-18 10:22:21 UTC
Hi all,
This is important for UI when displaying the "Top consumer ..." metrics where we want to show users the name of the VM that consume resource and not the name of the launcher pod.
Currently in cases the VM name is missing we fall back to pod name witch is not optimal, @phillipcbailey please keep me honest here.

Comment 3 Yaacov Zamir 2022-01-18 12:25:00 UTC
Opend a BZ to track on the UI side:
https://bugzilla.redhat.com/show_bug.cgi?id=2041865

Comment 4 Phillip Bailey 2022-01-18 14:48:42 UTC
Yaacov, that's correct. =) It would be much more beneficial to the user to display the VM name, especially since we give them the option to view the results by VM. It's going to be a frustrating experience when they realize that the output isn't consistent.

Comment 5 SATHEESARAN 2022-04-22 14:20:21 UTC
Tested with CNV build v4.10.1-86[1] and the VM created with yaml file doesn't have the VM name label for virt-launcher pod.

As I discussed with Joao Vilaca, the fix is available with upstream virt-controller version v0.51,
but the CNV downstream build[1] consists of virt-controller v0.49 and the fix is not available in this build.

Because of the above said reason, this bug is marked FailedQA.
Moving this bug to ASSIGNED 

[1] - http://cnv-version-explorer.apps.cnv.engineering.redhat.com/BundleDetails?ver=v4.10.1-86

Comment 6 SATHEESARAN 2022-06-09 12:42:37 UTC
Verified with the CNV bundle 4.10.2-10 and virt-controller-v4.10.2-1

VM body was build with vm.yaml configuration without the label for VM name.
Following is the VM configuration yaml

<snip>
---
apiVersion: kubevirt.io/v1
kind: VirtualMachine
metadata:
  labels:
  name: vm-cirros
spec:
  running: true 
  template:
    spec:
      domain:
        devices:
          disks:
          - disk:
              bus: virtio
            name: containerdisk
        resources:
          requests:
            memory: 128Mi
      terminationGracePeriodSeconds: 0
      volumes:
      - containerDisk:
          image:  quay.io/kubevirt/cirros-container-disk-demo
        name: containerdisk
</snip>

When creating the vm with the above VM configuration, # oc apply -f <vm.yaml>
then the virt-launcher pod had the label with the vm name

[]$ oc get pods virt-launcher-fedora-sas-template-uptight-skink-jgchw -n openshift -ojson | jq '.metadata.labels' | grep 'vm.kubevirt.io'
  "vm.kubevirt.io/name": "vm-cirros"        <----------- VM name is available in the label

Marking this bug as VERIFIED based on the above verification

Comment 12 errata-xmlrpc 2022-06-14 17:42:17 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 (Moderate: OpenShift Virtualization 4.10.2 Images security and bug fix update), 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/RHSA-2022:5026


Note You need to log in before you can comment on or make changes to this bug.