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

[2079674] Configuring preferred node affinity in the console results in wrong yaml and unschedulable VM

XMLWordPrintable

    • Medium

      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

            aturgema Aviv Turgeman
            rhn-support-gveitmic Germano Veit Michel
            Guohua Ouyang Guohua Ouyang
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: