Bug 2043659

Summary: [MAPO] primarySubnet on machine specs not applied
Product: OpenShift Container Platform Reporter: rlobillo
Component: Cloud ComputeAssignee: Pierre Prinetti <pprinett>
Cloud Compute sub component: OpenStack Provider QA Contact: Jon Uriarte <juriarte>
Status: CLOSED DUPLICATE Docs Contact:
Severity: low    
Priority: medium CC: aos-bugs, m.andre, mbooth, mfedosin, pprinett
Version: 4.10   
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-02-02 16:24:04 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description rlobillo 2022-01-21 17:02:35 UTC
Description of problem:

Creating a machine following the spec.providerSpec.value.ports section with two elements and setting the primarySubnet is following the port order definition instead of settings as default the subnet indicated on the primarySubnet param.

Reference: https://docs.openshift.com/container-platform/4.8/machine_management/creating_machinesets/creating-machineset-osp.html#machineset-yaml-osp-sr-iov-port-security_creating-machineset-osp

Version-Release number of selected component (if applicable): 4.10.0-0.nightly-2022-01-20-082726 with featureGate TechPreviewNoUpgrade enabled.


How reproducible: Always


Steps to Reproduce:

On a running cluster with TP enabled:

1. Create extra_network and extra_subnet:

$ openstack network create extra_network
$ openstack subnet create --network extra_network --subnet-range 10.197.0.0/16 extra_subnet


2. create a machine spec with the following section inside '.spec.providerSpec.value'

      ports:
        - networkID: 2c570ee5-c062-4aa0-a371-6057749e0cbd
          fixedIPs:
            - subnetID: 8e1d3ad8-6f8b-4949-b4e4-1347db56ff77
          securityGroups:
            - 479c2bc2-2706-4f5e-8a2c-3b4799c7953f
        - networkID: b813cbf1-27e8-4c10-9b1e-816cb9e42289
          fixedIPs:
            - subnetID: 4d70a357-4426-492a-a7ea-cb32a83f6bc2
          securityGroups:
            - 479c2bc2-2706-4f5e-8a2c-3b4799c7953f
      primarySubnet: 4d70a357-4426-492a-a7ea-cb32a83f6bc2


where: 

$ openstack subnet list
+--------------------------------------+--------------------+--------------------------------------+---------------+
| ID                                   | Name               | Network                              | Subnet        |
+--------------------------------------+--------------------+--------------------------------------+---------------+
| 4d70a357-4426-492a-a7ea-cb32a83f6bc2 | ostest-kmrdd-nodes | b813cbf1-27e8-4c10-9b1e-816cb9e42289 | 10.196.0.0/16 |
| 8e1d3ad8-6f8b-4949-b4e4-1347db56ff77 | extra_subnet       | 2c570ee5-c062-4aa0-a371-6057749e0cbd | 10.197.0.0/16 |
+--------------------------------------+--------------------+--------------------------------------+---------------+

The machine is stuck on Provisioned status, because the networking configured on the VM is setting the extra_subnet interface as primary:

$ o server list
+--------------------------------------+-----------------------------+--------+----------------------------------------------------------------+--------------------+--------+
| ID                                   | Name                        | Status | Networks                                                       | Image              | Flavor |
+--------------------------------------+-----------------------------+--------+----------------------------------------------------------------+--------------------+--------+
| 216b7b6b-e21f-4ba7-8762-76cd0e5d7272 | ostest-kmrdd-invalid-worker | ACTIVE | extra_network=10.197.1.241; ostest-kmrdd-openshift=10.196.3.48 | ostest-kmrdd-rhcos |        |
| 7aa06832-0a96-47e4-85cf-c515652d9262 | ostest-kmrdd-worker-0-hx5zh | ACTIVE | ostest-kmrdd-openshift=10.196.1.218                            | ostest-kmrdd-rhcos |        |
| 00111a9f-ec54-4ad1-bfd4-c9dd108267a1 | ostest-kmrdd-master-2       | ACTIVE | ostest-kmrdd-openshift=10.196.1.71                             | ostest-kmrdd-rhcos |        |
| 8c5e6f73-8db4-4661-9017-8f3abd5412be | ostest-kmrdd-master-1       | ACTIVE | ostest-kmrdd-openshift=10.196.3.239                            | ostest-kmrdd-rhcos |        |
| 28195fdd-8f42-4a12-8afe-f4961b571d5b | ostest-kmrdd-master-0       | ACTIVE | ostest-kmrdd-openshift=10.196.2.38                             | ostest-kmrdd-rhcos |        |
+--------------------------------------+-----------------------------+--------+----------------------------------------------------------------+--------------------+--------+

$ ssh -J core.shiftstack.com core.3.48
[...]
[core@localhost ~]$ ip r
default via 10.197.0.1 dev ens3 proto dhcp metric 100 
default via 10.196.0.1 dev ens4 proto dhcp metric 101 
10.196.0.0/16 dev ens4 proto kernel scope link src 10.196.3.48 metric 101 
10.197.0.0/16 dev ens3 proto kernel scope link src 10.197.1.241 metric 100 
169.254.169.254 via 10.197.0.2 dev ens3 proto dhcp metric 100 
169.254.169.254 via 10.196.0.10 dev ens4 proto dhcp metric 101 

If the ports are defined in the opposite order, 'ostest-kmrdd-openshift' is defined as primary and the worker is correctly added to the cluster.

Actual results: The primary Subnet is selected based on the position on the definition of the ports.


Expected results: primarySubnet should be applied.


Additional info: The same is happening with legacy CAPO as observed while verifying https://bugzilla.redhat.com/show_bug.cgi?id=2015154

Comment 2 Matthew Booth 2022-02-02 16:24:04 UTC
This is a CCM issue, not a MAPO issue.

*** This bug has been marked as a duplicate of bug 2030733 ***