Bug 2079674 - Configuring preferred node affinity in the console results in wrong yaml and unschedulable VM
Summary: Configuring preferred node affinity in the console results in wrong yaml and ...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Container Native Virtualization (CNV)
Classification: Red Hat
Component: User Experience
Version: 4.10.6
Hardware: x86_64
OS: Linux
unspecified
medium
Target Milestone: ---
: 4.11.0
Assignee: Aviv Turgeman
QA Contact: Guohua Ouyang
URL:
Whiteboard:
Depends On:
Blocks: 2090127
TreeView+ depends on / blocked
 
Reported: 2022-04-28 04:33 UTC by Germano Veit Michel
Modified: 2023-11-13 08:19 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 2090127 (view as bug list)
Environment:
Last Closed: 2022-09-14 19:31:19 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github kubevirt-ui kubevirt-plugin pull 416 0 None open Bug 2079674: Configuring preferred node affinity in the console results in wrong yaml and unschedulable VM 2022-05-15 10:55:08 UTC
Red Hat Issue Tracker CNV-17864 0 None None None 2023-11-13 08:19:19 UTC
Red Hat Product Errata RHSA-2022:6526 0 None None None 2022-09-14 19:31:34 UTC

Description Germano Veit Michel 2022-04-28 04:33:00 UTC
Description of problem:

1. Create a new VM from template, dont start it

2. Virtualization -> Virtual Machines -> VM -> Details

3. Under "Scheduling and resources requirements", click the pencil to edit Affinity Rules -> Add Affinity Rule

4. Fill the following

   Type: Node Affinity
   Condition: Preferred during scheduling (not default, change it)
   Weight: 100
   Node Labels
        Key                       Op     Values
        kubernetes.io/hostname    In     <your node hostname>

5. Click "Save Affinity Rule"

6. Click "Save"

7. Start the VM

8. Result:

Error creating pod: Pod "virt-launcher-rhel8-narrow-grasshopper-gqpln" is invalid: spec.affinity.nodeAffinity.requiredDuringSchedulingIgnoredDuringExecution.nodeSelectorTerms: Required value: must have at least one node selector term

9. Why? See what it did in the yaml...

    spec:
      affinity:
        nodeAffinity:
          preferredDuringSchedulingIgnoredDuringExecution:   <---- this is what I configured
          - preference:
              matchExpressions:
              - key: kubernetes.io/hostname
                operator: In
                values:
                - white.shift.toca.local
            weight: 100
          requiredDuringSchedulingIgnoredDuringExecution:     <--- I configured preferred only, I did not set any required rule
            nodeSelectorTerms: []                             <--- error above caused by this
        podAffinity: {}
        podAntiAffinity: {}

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

How reproducible:
Always

Steps to Reproduce:
As above

Actual results:
VM wont start

Expected results:
Vm starts

Comment 3 Guohua Ouyang 2022-04-28 05:05:15 UTC
Could reproduce this bug on 4.10.

Comment 4 Guohua Ouyang 2022-05-13 01:52:01 UTC
The bug also exists in CNV-v4.11.0-337

Comment 5 Guohua Ouyang 2022-05-25 08:17:22 UTC
verified on v4.11.0-403(OCP v4.11.0-32)

Comment 8 errata-xmlrpc 2022-09-14 19:31: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 (Important: OpenShift Virtualization 4.11.0 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:6526


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