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

MAPI/CAPI subnet ids may not match when using byo subnets

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Undefined Undefined
    • None
    • 4.18.z, 4.19.0
    • None
    • Quality / Stability / Reliability
    • False
    • Hide

      None

      Show
      None
    • None
    • None
    • None
    • None
    • None
    • Installer Sprint 270
    • 1
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      Description of problem:

      Master CAPI machine manifest is configured with a different subnet ID than MAPI machine manifest.

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

      4.19, potentially older releases

      How reproducible:

      Not always.

      Steps to Reproduce:

      1. Create an install-config.yaml file with AWS platform, and specify byo subnets with 3 zones.
      2. Build the installer from latest upstream/main of the installer repo.
      3. Run openshift-install create manifests --dir=<install-dir> --log-level=debug
      4. Observe the CAPI master machine manifest cluster-api/10_inframachine_<cluster-id>-master-{0,1,2}.yaml and MAP manifest openshift/99_openshift-cluster-api_master-machines-{0,1,2}.yaml that they sometimes have different subnet ID assigned.

      Actual results:

      CAPI and MAPI machine manifest has different assigned subnet ID.

      Expected results:

      CAPI and MAPI machine manifest has different assigned subnet ID.

      Additional info:

      From the source code:
      
      Zones for MAPI machine are extracted from keys of a map of byo subnets [0] (no stable order) and zones are iterated to distribute machines to subnets [1].
      
      Zones for CAPI machine are also extracted from keys of a map of byo subnets [2] (no stable order) and zones are iterated to distribute CAPI machines to subnets [3].
      
      The solution is to sort the zone slices extracted from map keys.

      References

      [0] https://github.com/openshift/installer/blob/ab24d7f89e55836ef512b9aa47299a95361a0375/pkg/asset/machines/master.go#L201-L204

      [1] https://github.com/openshift/installer/blob/ab24d7f89e55836ef512b9aa47299a95361a0375/pkg/asset/machines/aws/machines.go#L59

      [2] https://github.com/openshift/installer/blob/ab24d7f89e55836ef512b9aa47299a95361a0375/pkg/asset/machines/clusterapi.go#L134-L137

      [3] https://github.com/openshift/installer/blob/ab24d7f89e55836ef512b9aa47299a95361a0375/pkg/asset/machines/aws/awsmachines.go#L61

       

              rh-ee-thvo Thuan Vo
              rh-ee-thvo Thuan Vo
              None
              None
              Yunfei Jiang Yunfei Jiang
              None
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Created:
                Updated:
                Resolved: