Bug 2069654 - Creating VMs with YAML on Openshift Virtualization UI is missing labels `flavor`, `os` and `workload`
Summary: Creating VMs with YAML on Openshift Virtualization UI is missing labels `flav...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Console Kubevirt Plugin
Version: 4.10
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: ---
: 4.11.0
Assignee: Aviv Turgeman
QA Contact: Guohua Ouyang
URL:
Whiteboard:
Depends On:
Blocks: 2088255
TreeView+ depends on / blocked
 
Reported: 2022-03-29 11:54 UTC by Assaf Admi
Modified: 2022-08-10 11:02 UTC (History)
8 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 2087932 (view as bug list)
Environment:
Last Closed: 2022-08-10 11:02:32 UTC
Target Upstream Version:
Embargoed:
aadmi: needinfo-
aadmi: needinfo-
aturgema: needinfo-


Attachments (Terms of Use)
Screenshot of Prometheus UI (81.59 KB, image/png)
2022-03-29 11:54 UTC, Assaf Admi
no flags Details
Screenshot of Openshift Virtualization UI when creating VM with YAML (250.56 KB, image/png)
2022-03-29 12:53 UTC, Assaf Admi
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Github openshift console pull 11518 0 None open Bug 2069654: Adding missing annotations to create VM from YAML 2022-05-18 09:53:06 UTC
Red Hat Product Errata RHSA-2022:5069 0 None None None 2022-08-10 11:02:50 UTC

Description Assaf Admi 2022-03-29 11:54:38 UTC
Created attachment 1868950 [details]
Screenshot of Prometheus UI

Description of problem:
When creating VMs with YAML in Openshift Virtualizaion UI,labels `flavor`, `os` and `workload` are missing

Steps to Reproduce:
1.In OCP UI navigate to Virtualization/VirtualMachines
2.Create one or more VMs with YAML

Comment 1 Krzysztof Majcher 2022-03-29 12:49:03 UTC
Hi Assaf,
can you describe how you created this VM?
Please attach YAML file that you used.

Comment 2 Assaf Admi 2022-03-29 12:53:53 UTC
Created attachment 1868967 [details]
Screenshot of Openshift Virtualization UI when creating VM with YAML

Comment 3 Assaf Admi 2022-03-29 12:57:46 UTC
(In reply to Krzysztof Majcher from comment #1)
> Hi Assaf,
> can you describe how you created this VM?
> Please attach YAML file that you used.

Hi Krzysztof,
I created this VM on Openshift Virtualization UI, using YAML file. Added a screenshot of this default YAML file.

Comment 5 Yaacov Zamir 2022-05-16 11:57:14 UTC
Assaf hi, thank you for the bug,

The UI is just calling the api directly in this case, it may be a virtualization issue that is not UI related.
Can you create the VM using CLI, for example by `oc create -f vm.yaml` ?

I can't reproduce on my 4.10 cluster:
On my 4.10 cluster, the VM is created with the same labels as the YAML code I put in the create from YAML window.
 
It may be something specific to your cluster ?
If it is repeatable in the CLI we will move the correct component.
If on your cluster you can create a VM that has different YAML then the one you entered in the create from YAML, we will need your help to investigate.

can you share a screenshot of the created VM, you shared a screenshot of Prometheus UI ?
the labels in prometheus are not taken from the VM directly, and may not represent the VM you created

Comment 6 Shirly Radco 2022-05-17 07:49:17 UTC
Its a problem with the YAML default template, which by the way is completely missing in 4.11 and is a different bug.

Comment 7 Yaacov Zamir 2022-05-17 16:48:37 UTC
(In reply to Shirly Radco from comment #6)
> Its a problem with the YAML default template, which by the way is completely
> missing in 4.11 and is a different bug.

we have a bug for 4.11 missing YAML example:
https://bugzilla.redhat.com/show_bug.cgi?id=2086849

Shirly can you look at the example YAML in PR#434 ?
https://github.com/kubevirt-ui/kubevirt-plugin/pull/434/files

Comment 8 Yaacov Zamir 2022-05-17 17:22:39 UTC
Assaf hi,

do you mean that the YAML exampla is missing this labels ?
or that if you create a VM with this labels they are getting removed somehow ?

Comment 9 Yaacov Zamir 2022-05-17 17:29:39 UTC
Aviv hi,

can you make sure the YAML example is up to date:
for example this is a vm created from template on a 4.10 cluster:

apiVersion: kubevirt.io/v1
kind: VirtualMachine
metadata:
  annotations:
    name.os.template.kubevirt.io/fedora35: Fedora 35
  name: vm-example
  labels:
    app: vm-example
    flavor.template.kubevirt.io/small: 'true'
    os.template.kubevirt.io/fedora35: 'true'
    vm.kubevirt.io/template: fedora-server-small
    workload.template.kubevirt.io/server: 'true'
spec:
  template:
    metadata:
      annotations:
        vm.kubevirt.io/flavor: small
        vm.kubevirt.io/os: fedora
        vm.kubevirt.io/workload: server
      creationTimestamp: null
      labels:
        flavor.template.kubevirt.io/small: 'true'
        kubevirt.io/domain: vm-example
        kubevirt.io/size: small
        os.template.kubevirt.io/fedora35: 'true'
        vm.kubevirt.io/name: vm-example
        workload.template.kubevirt.io/server: 'true'
    spec:
      domain:
        cpu:
          cores: 1
          sockets: 1
          threads: 1
        devices:
          disks:
            - bootOrder: 1
              disk:
                bus: virtio
              name: rootdisk
            - disk:
                bus: virtio
              name: cloudinitdisk
          interfaces:
              masquerade: {}
              name: default
          networkInterfaceMultiqueue: true
          rng: {}
        machine:
          type: pc-q35-rhel8.4.0
        resources:
          requests:
            memory: 2Gi
      evictionStrategy: LiveMigrate
      hostname: vm-example
      networks:
        - name: default
          pod: {}
      terminationGracePeriodSeconds: 180
      volumes:
        - name: rootdisk
          containerDisk:
            image: 'quay.io/containerdisks/fedora:35'
        - cloudInitNoCloud:
            userData: |-
              #cloud-config
              user: fedora
              password: fedora
              chpasswd: { expire: False }
          name: cloudinitdisk

Comment 13 errata-xmlrpc 2022-08-10 11:02:32 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 (Important: OpenShift Container Platform 4.11.0 bug fix and security 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:5069


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