Skip to content

Validate ansibleHost and ctlplane fixedIP for pre-provisioned nodes - #1802

Merged
openshift-merge-bot[bot] merged 1 commit into
openstack-k8s-operators:mainfrom
rabi:ctlplane_fixed_ip
Feb 12, 2026
Merged

openshift-merge-bot[bot] merged 1 commit into
openstack-k8s-operators:mainfrom
rabi:ctlplane_fixed_ip

Conversation

@rabi

@rabi rabi commented Feb 10, 2026

Copy link
Copy Markdown
Contributor

For pre-provisioned dataplane nodes, ansibleHost must be a valid IP address. This is required because the controller defaults the ctlplane network fixedIP from ansibleHost during IPAM reservation, ensuring the reserved IP matches the already-configured node interface. Without a valid IP, IPAM could reserve a different address and break connectivity during deployment.

The validating webhook enforces that for pre-provisioned nodes:

  • ansibleHost is not empty
  • ansibleHost is a valid IP address

The controller (ipam.go) defaults the ctlplane fixedIP from ansibleHost when not already set. The ctlplane network is identified using the netServiceNetMap from NetConfig, so it works regardless of the network name.

@openshift-ci
openshift-ci Bot requested review from fultonj and slagle February 10, 2026 06:45
@rabi

rabi commented Feb 10, 2026

Copy link
Copy Markdown
Contributor Author

Probably a flaky test?

        echo "=== Checking global ApplicationCredential is enabled ==="
        global_enabled=$(oc get openstackcontrolplane openstack -n "$NS" -o jsonpath='{.spec.applicationCredential.enabled}')
        if [ "$global_enabled" != "true" ]; then
          echo "ERROR: OpenStackControlPlane.spec.applicationCredential.enabled expected 'true', got '$global_enabled'"
          exit 1
        fi
        echo "✓ OpenStackControlPlane.spec.applicationCredential.enabled = true"
        echo

@rabi

rabi commented Feb 10, 2026

Copy link
Copy Markdown
Contributor Author

/test openstack-operator-build-deploy-kuttl-4-18

@rabi
rabi force-pushed the ctlplane_fixed_ip branch from 0ed8bf0 to 496f239 Compare February 10, 2026 13:38
@softwarefactory-delete-me

Copy link
Copy Markdown

Build failed (check pipeline). Post recheck (without leading slash)
to rerun all jobs. Make sure the failure cause has been resolved before
you rerun jobs.

https://softwarefactory-project.io/zuul/t/rdoproject.org/buildset/27c287f32bb74b7e8ee5a39af21bb77a

❌ openstack-k8s-operators-content-provider NODE_FAILURE Node request 100-0008160556 failed in 0s
⚠️ podified-multinode-edpm-deployment-crc SKIPPED Skipped due to failed job openstack-k8s-operators-content-provider
⚠️ cifmw-crc-podified-edpm-baremetal SKIPPED Skipped due to failed job openstack-k8s-operators-content-provider
⚠️ openstack-operator-tempest-multinode SKIPPED Skipped due to failed job openstack-k8s-operators-content-provider

… nodes

For pre-provisioned dataplane nodes, ansibleHost must be a valid IP
address. This is required because the controller defaults the ctlplane
network fixedIP from ansibleHost during IPAM reservation, ensuring the
reserved IP matches the already-configured node interface. Without a
valid IP, IPAM could reserve a different address and break connectivity
during deployment.

The validating webhook enforces that for pre-provisioned nodes:
- ansibleHost is not empty
- ansibleHost is a valid IP address

The controller (ipam.go) defaults the ctlplane fixedIP from ansibleHost
when not already set. The ctlplane network is identified using the
netServiceNetMap from NetConfig, so it works regardless of the network
name.

Signed-off-by: rabi <ramishra@redhat.com>
@rabi
rabi force-pushed the ctlplane_fixed_ip branch from 496f239 to 3f6c604 Compare February 10, 2026 13:41
@softwarefactory-delete-me

Copy link
Copy Markdown

Build failed (check pipeline). Post recheck (without leading slash)
to rerun all jobs. Make sure the failure cause has been resolved before
you rerun jobs.

https://softwarefactory-project.io/zuul/t/rdoproject.org/buildset/4f8823cf30a84e3fa7b102deeb1cf5c8

❌ openstack-k8s-operators-content-provider NODE_FAILURE Node request 100-0008160605 failed in 0s
⚠️ podified-multinode-edpm-deployment-crc SKIPPED Skipped due to failed job openstack-k8s-operators-content-provider
⚠️ cifmw-crc-podified-edpm-baremetal SKIPPED Skipped due to failed job openstack-k8s-operators-content-provider
⚠️ openstack-operator-tempest-multinode SKIPPED Skipped due to failed job openstack-k8s-operators-content-provider

@jdandrea

jdandrea commented Feb 10, 2026 •

Copy link
Copy Markdown

Hi @rabi - thanks for filing this PR!

About this part:

The validating webhook enforces that for pre-provisioned nodes:

  • ansibleHost is not empty
  • ansibleHost is a valid IP address

The controller (ipam.go) defaults the ctlplane fixedIP from ansibleHost when not already set. The ctlplane network is identified using the netServiceNetMap from NetConfig, so it works regardless of the network name.

Will this still catch the problem in our case?

Here's what we used to have:

nodes:
    edpm-compute-1:
      hostName: compute01.srv.example.com
      ansible:
        ansibleHost: 192.168.51.31
        ansibleUser: root
      networks:
      - name: ctlplane
        subnetName: subnet1
        defaultRoute: false
        fixedIP: 172.22.0.110
      - name: internalapi
        subnetName: subnet1
      - name: storage
        subnetName: subnet1
      - name: tenant
        subnetName: subnet1
      - name: external
        subnetName: subnet1
    edpm-compute-2:
      hostName: compute02.srv.example.com
       ansible:
        ansibleHost: 192.168.51.32
        ansibleUser: root
      networks:
      - name: ctlplane
        subnetName: subnet1
        defaultRoute: false
        fixedIP: 172.22.0.111
      - name: internalapi
        subnetName: subnet1
      - name: storage
        subnetName: subnet1
      - name: tenant
        subnetName: subnet1
      - name: external
        subnetName: subnet1

Now we are using this:

nodes:
    edpm-compute-1:
      hostName: compute01.srv.example.com
      ansible:
        ansibleHost: 192.168.51.31
        ansibleUser: root
      networks:
      - name: ctlplane
        subnetName: subnet1
        defaultRoute: false
        fixedIP: 172.22.0.110
      - name: internalapi
        subnetName: subnet1
        fixedIP: 172.17.0.110
      - name: storage
        subnetName: subnet1
        fixedIP: 172.18.0.110
      - name: tenant
        subnetName: subnet1
        fixedIP: 172.19.0.110
      - name: external
        subnetName: subnet1
        fixedIP: 192.168.51.31
    edpm-compute-2:
      hostName: compute02.srv.example.com
       ansible:
        ansibleHost: 192.168.51.32
        ansibleUser: root
      networks:
      - name: ctlplane
        subnetName: subnet1
        defaultRoute: false
        fixedIP: 172.22.0.111
      - name: internalapi
        subnetName: subnet1
        fixedIP: 172.17.0.111
      - name: storage
        subnetName: subnet1
        fixedIP: 172.18.0.111
      - name: tenant
        subnetName: subnet1
        fixedIP: 172.19.0.111
      - name: external
        subnetName: subnet1
        fixedIP: 192.168.51.32

We also have this (unchanged):

        edpm_network_config_os_net_config_mappings:
          edpm-compute-1:
            nic1: "52:54:00:03:00:6e"
            nic2: "52:54:00:02:33:1f"
          edpm-compute-2:
            nic1: "52:54:00:03:00:6f"
            nic2: "52:54:00:02:33:20"

Using fixedIP in all of those spots seems to do the trick so far. I just want to be sure that this PR will prevent others from running in to the same issue we did (with 192.168.51.31 and 192.168.51.32 sometimes appearing to swap across the compute nodes).

I can share more of our osdpns via PM if that helps. Thanks again.

@rabi

rabi commented Feb 11, 2026

Copy link
Copy Markdown
Contributor Author

Will this still catch the problem in our case?

Hmm.. the issue in your case is you're using external network for ssh, which is unusual(normally ctlplane network is used for that, any reason you're not doing that?). Any network for a node that you need to use predetermined IP, you've to use fixedIP in the networks section. In your case (unless you're configuring all networks beforehand), you just need match the IP you use in ansibleHost with the fixedIP for the desired network in networks section.

    edpm-compute-1:
      hostName: compute01.srv.example.com
      ansible:
        ansibleHost: 192.168.51.31
        ansibleUser: root
      networks:
      - name: ctlplane
        subnetName: subnet1
        fixedIP: 172.22.0.110
      - name: internalapi
        subnetName: subnet1
      - name: storage
        subnetName: subnet1
      - name: tenant
        subnetName: subnet1
      - name: external
        subnetName: subnet1
        fixedIP: 192.168.51.31

This PR is to copy ansibleHost ip to ctlplane IP unless it's provided for scenarios where users forgets to set fixedIP for ctlplane network (the default network used for ssh) in pre-provisioned nodes.

@rabi

rabi commented Feb 11, 2026

Copy link
Copy Markdown
Contributor Author

recheck

@jdandrea

Copy link
Copy Markdown

... the issue in your case is you're using external network for ssh, which is unusual(normally ctlplane network is used for that, any reason you're not doing that?) ...

Thanks @rabi - that's a fair question. I do not know the origin story of this particular configuration. I've asked colleagues if they can provide insight here.

@openshift-ci

openshift-ci Bot commented Feb 11, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: rabi, slagle

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@rabi

rabi commented Feb 12, 2026

Copy link
Copy Markdown
Contributor Author

/test openstack-operator-build-deploy-kuttl-4-18

@openshift-merge-bot
openshift-merge-bot Bot merged commit f46ba0f into openstack-k8s-operators:main Feb 12, 2026
1 check passed
@rabi

rabi commented Feb 12, 2026

Copy link
Copy Markdown
Contributor Author

/cherry-pick 18.0-fr5

@openshift-cherrypick-robot

Copy link
Copy Markdown

@rabi: new pull request created: #1810

Details

In response to this:

/cherry-pick 18.0-fr5

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@jdandrea

Copy link
Copy Markdown

... the issue in your case is you're using external network for ssh, which is unusual(normally ctlplane network is used for that, any reason you're not doing that?) ...

Hi @rabi - I can answer this question now!

From our lab environment team: It makes more sense for us to use the external network (for Ansible to access the compute host) instead of ctlplane due to the lab environment's particular lab architecture.

From our dev team: "In some instances, orgs want to save as much infrastructure as possible and use the two minimal interfaces that are needed. Sometimes, they even have LACP bonds for each OSP network, independent interfaces for OBB, and another for server management (like EDPM-Ansible)." So while it might appear a bit unusual, this configuration should still be possible/supported.

My own thoughts: I see this PR is already merged (thank you!). I'd love to see a future update to this not assume ctlplane specifically. Otherwise, this could give the false impression that there is only one specific network/name that can be used for EDPM, and I don't think that's true.

Thank you again for the PR!

@rabi

rabi commented Feb 13, 2026

Copy link
Copy Markdown
Contributor Author

I see this PR is already merged (thank you!). I'd love to see a future update to this not assume ctlplane specifically.

I don't get why your lab can't you use ctlplane network for ansible (to me it's about adding routes on the virt host). This PR is not assuming anything, if you miss to match the IP for the network used for ansibleHost with the one in network section, you would end up with IPAM/os-net-config configuring a different IP and you would have issues. The only thing it's catering for is general scenario where folks don't provide any fixedIP in the network section with pre-provisioned nodes. There is no way for us to know what other network you've used in ansibleHost.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants