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
Could reproduce this bug on 4.10.
The bug also exists in CNV-v4.11.0-337
verified on v4.11.0-403(OCP v4.11.0-32)
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