Skip to content

Conversation

skrobul
Copy link
Collaborator

@skrobul skrobul commented Sep 24, 2025

This PR introduces a custom Nova compute driver that automatically injects storage network configuration into instance config drives when requested.

Key Changes

  • New IronicUnderstackDriver: Extends Nova's standard Ironic driver to support storage network injection
  • Nautobot integration: Queries Nautobot GraphQL API to retrieve storage interface configurations for bare metal nodes
  • Argo Workflows integration: Triggers Ansible playbooks via Argo when storage networks are needed (when user requests a server with storage=wanted property and the project is enabled for UNDERSTACK_SVM).
  • Configurable behavior: Added config options to control IP injection and playbook selection as well as credentials for dependencies
  • Kubernetes integration: Added RBAC, secrets, and service account tokens for Nova to access Argo and Nautobot

How it works

When an instance has metadata.storage=wanted, the driver:

  1. Runs the configured Ansible playbook via Argo Workflows to set up storage networking
  2. Queries Nautobot for the node's storage interface details
  3. Injects the storage network configuration into the instance's config drive

Below (simplified) diagram shows how the components interact to make this feature work:

sequenceDiagram
  actor User
  participant Nova
  participant Placement
  participant Argo
  participant Ansible

  participant Nautobot
  participant Ironic
  
  activate Nova
  User ->> Nova: create server
  Nova ->>+ Placement: select node
  Placement -->>-Nova: 
  Nova ->>+ Argo: schedule ansible-run
  Argo ->>+ Ansible: populate IPs
  Ansible ->>+ Nautobot: populate IPs for server
  Nautobot <<-->>- Ansible: exchange info
  Ansible -->>- Argo: completed
  Argo -->>- Nova: completed
  Nova ->> Nautobot: retrieve IPs
  Nautobot -->> Nova: 
  Nova ->> Nova: merge IPs into config drive
  Nova ->> Ironic: boot srv with updated configdrive
  Ironic -->> Nova: done
  Nova -->> User: server is ready
  deactivate Nova
Loading

Configuration

Most of the configuration is under [nova_understack] section of the nova-compute-ironic.

  • Storage network IP injection feature can be completely disabled via ip_injection_enabled=False
  • Ansible playbook name is configurable via ansible_playbook_filename - this can come handy if we decide to cleanup .yml extensions and name them correctly with .yaml.
  • Supports both direct API keys and Kubernetes secret-based authentication

Closes https://rackspace.atlassian.net/browse/PUC-1242
Depends on https://github.com/RSS-Engineering/undercloud-deploy/pull/771

Notes for the reviewer

If reviewing commit-by-commit, please start from c1d22b6 as the earlier commit have been reverted in f9cb501. I have purposefully included them in PR so that Ironic custom hardware manager experiment is recorded in history if we ever want to create something similar.
I have at least one idea where this may become useful, so don't want to just throw it out.

@skrobul skrobul force-pushed the ironic-inject-storage-ips branch 17 times, most recently from 695eac1 to c8cad09 Compare October 1, 2025 09:20
@skrobul skrobul force-pushed the ironic-inject-storage-ips branch 6 times, most recently from 16836b3 to ce40876 Compare October 6, 2025 17:14
@skrobul skrobul changed the title WIP - inject storage IPs to the servers feat: Nova Ironic driver with storage network IP injection Oct 6, 2025
@skrobul skrobul requested a review from a team October 6, 2025 17:45
@skrobul skrobul changed the title feat: Nova Ironic driver with storage network IP injection feat: Nova compute driver with storage network IP injection Oct 6, 2025
@skrobul skrobul marked this pull request as ready for review October 6, 2025 17:48
@skrobul skrobul force-pushed the ironic-inject-storage-ips branch from ce40876 to 761ffde Compare October 7, 2025 13:50
skrobul added 21 commits October 7, 2025 17:20
nova driver must live under nova.virt.

It cannot be external to the nova project because of this:

https://github.com/openstack/nova/blob/b99a882366251f88d145e27312b94692e0b2266f/nova/virt/driver.py#L2074
Rather than trying to intercept and rewrite whole spawn() method, we
should be able to override only the _get_network_metadata(). It's better
this way because it's much smaller and it's also used inside the
rebuild() which we'd have to override too.
In case we need to run other playbooks...
Rather than hardcoding 100.127.0.0/16, we should use side-specific
routes so both sides can be reached independently.
Running this again would be redundant since this is already triggered in
Nova (see previous commit)
Openstack uses format without dashes, Nautobot expects one with dashes.
This reverts commit c37e3fd.
This reverts commit c57b2a8.
This way our modified code is almost all in separate method and it's
clear what has been changed.
This way our modified code is almost all in separate method and it's
clear what has been changed.
@skrobul skrobul force-pushed the ironic-inject-storage-ips branch from 761ffde to ab35ff1 Compare October 7, 2025 16:22
@cardoe cardoe added this pull request to the merge queue Oct 7, 2025
Merged via the queue into main with commit cadbfc9 Oct 7, 2025
39 checks passed
@cardoe cardoe deleted the ironic-inject-storage-ips branch October 7, 2025 22:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants