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

[2218147] [Hot-plug] Hot-plug doesn't fail when no NetworkAttachmentDefinition exists

XMLWordPrintable

    • Moderate
    • None

      Description of problem:
      One of the conditions of hot-plugging an interface is the existence of a backing NetworkAttachmentDefinition, but this action succeeds even if this resource doesn't exist.

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

      How reproducible:
      Always

      Steps to Reproduce:
      1. Create and run a basic VM (no secondary NICs).
      $ oc create ns yoss-ns
      namespace/yoss-ns created
      $ oc project yoss-ns
      Now using project "yoss-ns" on server "https://api.net-ys-414o.rhos-psi.cnv-qe.rhood.us:6443".
      $ oc apply -f vm-fedora.yaml
      virtualmachine.kubevirt.io/vm-fedora created
      $ virtctl start vm-fedora
      VM vm-fedora was scheduled to start

      2. Create a bridge interface over one of the nodes secondary NICs using a NodeNetworkConfigurationPolicy.
      $ oc apply -f nncp-linux-bridge.yaml
      oc get nncp -w
      nodenetworkconfigurationpolicy.nmstate.io/hotplug-linux-bridge created
      ysegev@ysegev-fedora (hotplug) $ oc get nncp -w
      NAME STATUS REASON
      hotplug-linux-bridge
      hotplug-linux-bridge Progressing ConfigurationProgressing
      hotplug-linux-bridge Progressing ConfigurationProgressing
      ...
      hotplug-linux-bridge Available SuccessfullyConfigured

      3. Run the command to add the new interface to the VM:
      virtctl addinterface <vm-name> --network-attachment-definition-name <net-attach-def-name> --name <interface-name>
      $ virtctl addinterface vm-fedora --network-attachment-definition-name hp-br-nad --name hp2

      Actual results:
      <BUG> The action succeeds, with no failure.
      The new interface appears in the VMI spec:
      $ oc get vmi vm-fedora -o yaml
      ...
      interfaces:

      • masquerade: {}
        name: default
      • bridge: {}
        name: hp2
        ...
        networks:
      • name: default
        pod: {}
      • multus:
        networkName: hp-br-nad
        name: hp2

      Expected results:
      The action should fail with an error message.

      Additional info:

              phoracek@redhat.com Petr Horacek
              ysegev@redhat.com Yoss Segev
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: