Uploaded image for project: 'OpenShift Bugs'
  1. OpenShift Bugs
  2. OCPBUGS-973

OVS-Configure doesn't iterate connection names containing spaces correctly

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Normal Normal
    • None
    • 4.10.z
    • None
    • None
    • False
    • Hide

      None

      Show
      None

      This bug ticket is requesting a backport of the fix implemented in [BZ 2101157](https://bugzilla.redhat.com/show_bug.cgi?id=2101157) to be backported to OpenShift 4.10.

      Description of problem:
      Customer is struggling to install OpenShift with a `no such connection profile.` error displayed in the `configure-ovs.sh` logs.

      The displayed connection only contains the first half of the connection name.

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

      How reproducible:
      Every time a connection name containing multiple words is used.

      Steps to Reproduce:
      1. Attempt to install OpenShift using IPI with Nodes containing default connections using names containing spaces

      Actual results:
      Failure is shown in the below logs.

      Expected results:
      OpenShift installs correctly.

      Additional info:
      The following logs can be seen throughout the opened case:
      ```
      Jun 24 17:41:53 slabnode2332.sprintlab735.netact.nsn-rdnet.net configure-ovs.sh[3472]: + local conn=System
      Jun 24 17:41:53 slabnode2332.sprintlab735.netact.nsn-rdnet.net configure-ovs.sh[3472]: ++ nmcli -g GENERAL.STATE conn show System
      Jun 24 17:41:53 slabnode2332.sprintlab735.netact.nsn-rdnet.net configure-ovs.sh[3472]: Error: System - no such connection profile.
      Jun 24 17:41:53 slabnode2332.sprintlab735.netact.nsn-rdnet.net configure-ovs.sh[3472]: + local active_state=
      Jun 24 17:41:53 slabnode2332.sprintlab735.netact.nsn-rdnet.net configure-ovs.sh[3472]: + '[' '' '!=' activated ']'
      Jun 24 17:41:53 slabnode2332.sprintlab735.netact.nsn-rdnet.net configure-ovs.sh[3472]: + for i in

      {1..10}

      Jun 24 17:41:53 slabnode2332.sprintlab735.netact.nsn-rdnet.net configure-ovs.sh[3472]: + echo 'Attempt 1 to bring up connection System'
      Jun 24 17:41:53 slabnode2332.sprintlab735.netact.nsn-rdnet.net configure-ovs.sh[3472]: Attempt 1 to bring up connection System
      Jun 24 17:41:53 slabnode2332.sprintlab735.netact.nsn-rdnet.net configure-ovs.sh[3472]: + nmcli conn up System
      Jun 24 17:41:53 slabnode2332.sprintlab735.netact.nsn-rdnet.net configure-ovs.sh[3472]: Error: unknown connection 'System'.
      Jun 24 17:41:53 slabnode2332.sprintlab735.netact.nsn-rdnet.net configure-ovs.sh[3472]: + s=10
      Jun 24 17:41:53 slabnode2332.sprintlab735.netact.nsn-rdnet.net configure-ovs.sh[3472]: + sleep 5
      Jun 24 17:41:58 slabnode2332.sprintlab735.netact.nsn-rdnet.net configure-ovs.sh[3472]: + for i in {1..10}

      Jun 24 17:41:58 slabnode2332.sprintlab735.netact.nsn-rdnet.net configure-ovs.sh[3472]: + echo 'Attempt 2 to bring up connection System'
      Jun 24 17:41:58 slabnode2332.sprintlab735.netact.nsn-rdnet.net configure-ovs.sh[3472]: Attempt 2 to bring up connection System
      Jun 24 17:41:58 slabnode2332.sprintlab735.netact.nsn-rdnet.net configure-ovs.sh[3472]: + nmcli conn up System
      Jun 24 17:41:58 slabnode2332.sprintlab735.netact.nsn-rdnet.net configure-ovs.sh[3472]: Error: unknown connection 'System'.
      ```

      Following this we can see that the expected connection to be activated should not be "System" but "System ens3f0", etc.
      ```
      [core@slabnode2332 ~]$ nmcli -g NAME c
      bond0
      System ens3f0
      System ens3f1
      Wired Connection
      ```

      Reviewing the code we can see the loop that performs this iteration:
      https://github.com/openshift/machine-config-operator/blob/master/templates/common/_base/files/configure-ovs-network.yaml#L677

      Testing the execution flow, we can see below that ' ' is used as a separator:
      ```
      $ nmcli -g NAME c | grep System
      System eth0

      $ for connection in $(nmcli -g NAME c | grep – "System") ; do echo $connection ; done
      System
      eth0
      ```

      To handle multi-word connection names, something similar to the following should be used:
      ```
      $ TMP_IFS=$IFS
      $ IFS=$"\n"

      $ for connection in $(nmcli -g NAME c | grep – "$MANAGED_NM_CONN_SUFFIX"); do
      activate_nm_conn "$connection"
      done

      $ IFS=$TMP_IFS
      ```

              rh-ee-arsen Arkadeep Sen
              rhn-support-mwasher Michael Washer (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: