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

Don't require guest VM restart after interface hot-plug

XMLWordPrintable

    • Quality / Stability / Reliability
    • 0.42
    • False
    • Hide

      None

      Show
      None
    • False
    • CNV v4.18.5.rhel9-2
    • Moderate
    • None

      Description of problem:

      Currently, when hot-plugging an interface to a running guest VM, a `RestartRequired` condition is updated in the VM spec.
      This mostly affects the UI users, as the UI limits the ability to use the guest until this condition is filled, i.e. until the VM is restarted. 
      

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

      OCP 4.19.0-ec.3
      CNV v4.19.0 (brew.registry.redhat.io/rh-osbs/iib:935792)
      

      How reproducible:

      100%
      

      Steps to Reproduce:

      1.
      Create a new namespace to work in.
      You can apply the following ProjectRequest for that:
      apiVersion: project.openshift.io/v1
      kind: ProjectRequest
      metadata:
        name: l2-bridge-test-bridge-nic-hot-plug
      
      2.
      Create a linux-bridge on the cluster workers. This can be done by applying a NodeNetworkConfigurationPolicy like the following:
      
      apiVersion: nmstate.io/v1
      kind: NodeNetworkConfigurationPolicy
      metadata:
        name: hot-plug-br-nncp
      spec:
        desiredState:
          interfaces:
          - bridge:
              options:
                stp:
                  enabled: false
              port:
              - name: enp9s0
            ipv4:
              auto-dns: true
              dhcp: true
              enabled: true
            ipv6:
              auto-dns: true
              autoconf: false
              dhcp: false
              enabled: false
            name: hot-plug-br
            state: up
            type: linux-bridge
        nodeSelector:
          node-role.kubernetes.io/worker: ""
      
      3.
      Create a NetworkAttachmentDefinition that connects to the linux-bridge:
      apiVersion: k8s.cni.cncf.io/v1
      kind: NetworkAttachmentDefinition
      metadata:
        name: hot-plug-br-nad
        namespace: l2-bridge-test-bridge-nic-hot-plug
      spec:
        config: '{"name": "hot-plug-br", "plugins": [{"type": "bridge", "bridge": "hot-plug-br"}],
          "cniVersion": "0.3.1"}'
      
      4.
      Create a simple fedora VM. You can use the attached vm-for-hot-plug.yaml, which is created without any secondary interface.
      
      5.
      Start the created VM (virtctl start hot-plug-test-vm).
      
      6.
      After the VM is up and running - hot-plug an interface to it (the interface is supposed to be backed by the bridge node interface you created, via the NAD).
      This can be done by editing the *VM* (not VMI) spec and adding the following:
      spec:
        template:
          spec:
            domain:
              devices:
                interfaces:
                - bridge: {}
                  name: hot-plug-iface
            networks:
            - multus:                                                                                                                                                                                                                                               
                networkName: hot-plug-br-nad
              name: hot-plug-iface
      
      7.
      Check {.status.conditions} in the VM spec.
      

      Actual results:

      A `RestartRequired` condition was added:
        {
          "lastProbeTime": null,
          "lastTransitionTime": "2025-03-19T16:02:37Z",
          "message": "a non-live-updatable field was changed in the template spec",
          "status": "True",
          "type": "RestartRequired"
        }
      

      Expected results:

      Restart is not required to complete the hot-plug, thus this condition shouldn't be there.
      

      Additional info:

      For QE: For verifying - you can run the *setup* steps of `test_vmi_spec_updated_with_hot_plugged_interface`, and check the conditions in the VM spec (not VMI).
      

              omisan@redhat.com Orel Misan
              ysegev@redhat.com Yossi Segev
              Yossi Segev Yossi Segev
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: