[RFE] Dynamic boot configuration API

Bug #2044561 reported by Dmitry Tantsur
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Ironic
Triaged
Wishlist
Unassigned

Bug Description

In a standalone multi-conductor environment, where the dnsmasq configuration is static and does not use any node-specific information, there is no way for a networking booting node to learn its conductor. The conductor it will reach will probably be the one next to dnsmasq. It may or may not have the files required to boot the node.

Several approaches have been proposed to tackle this problem. https://review.opendev.org/c/openstack/ironic-specs/+/873662 proposes a coordination between conductors, but has an issue with JSON RPC multiplication: each conductor will need to notify each conductor on any provisioning actions with a node. This RFE is a revival of https://bugs.launchpad.net/ironic/+bug/1526275 with a less ambitious scope, but also slightly more generic in case we want to expand it on e.g. grub boot later on.

New unauthenticated API will be added to Ironic:

    GET /v1/boot/<MAC>/<FILE>

    where <MAC> is a valid MAC address (acceptable in several formats)
    <FILE> is a file name, only "boot.ipxe" supported initially.

The behavior will be as follows:

1. Find the node by the provided MAC addresses. We will probably need a new lightweight database API to find only the most necessary fields in the most efficient way.
2. If the node is not found, return HTTP 404.
3. If the node is invalid state (see below), return HTTP 404.
4. Else, find the correct conductor and call the new RPC get_boot_config(node_id, file) on it.

On the conductor:

5. After basic checks, the call is forwarded to driver.boot.get_boot_config(task, file) with a shared lock.

The iPXE implementation:

6. If the file name is not "boot.ipxe", raise UnsupportedDriverExtension (handled as HTTP 404 on the API side).
7. Otherwise, return the configuration with the right IP addresses. At least initially, it will be done by reading the file from the disk. This will ensure a very lean first implementation.

Ironic is currently capable of generating the root boot.pxe. This code will be updated to optionally use the new API.

The feature will be configured by these options:

* [pxe]ipxe_use_boot_config_api = true/false (default false) - enable this feature
* [pxe]ipxe_config_api_root_url = http://host:port (default empty) - configure the base URL for generated root boot.ipxe (the static one, not the one returned by this API). It is needed, for example, when the normal Ironic API uses HTTPS. In this case, a proxy needs to be established to allow HTTP connection to this specific endpoint.
* [api]restrict_boot_config = true/false (default true) - whether to reject boot configuration requests for nodes not in one of the expected states (*WAIT essentially). Operators using fast track mode may set this to false to be able to boot available nodes too.

Tags: pxe rfe
Dmitry Tantsur (divius)
description: updated
tags: added: pxe rfe
Dmitry Tantsur (divius)
description: updated
Revision history for this message
Julia Kreger (juliaashleykreger) wrote :

Is there any way to make this so it is not iPXE specific? I'm thinking GRUB based boot as well would benefit from this, and given the HTTP boot interfaces are in flight, it should all the same code under the hood anyway.

Revision history for this message
Dmitry Tantsur (divius) wrote :

> Is there any way to make this so it is not iPXE specific?

This proposal is not iPXE specific, iPXE will be the first implementation.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix proposed to ironic-specs (master)

Related fix proposed to branch: master
Review: https://review.opendev.org/c/openstack/ironic-specs/+/902574

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix merged to ironic-specs (master)

Reviewed: https://review.opendev.org/c/openstack/ironic-specs/+/902574
Committed: https://opendev.org/openstack/ironic-specs/commit/353d231b810b5192a48534e800ef99a9c4ad2efd
Submitter: "Zuul (22348)"
Branch: master

commit 353d231b810b5192a48534e800ef99a9c4ad2efd
Author: Dmitry Tantsur <email address hidden>
Date: Mon Dec 4 15:16:33 2023 +0100

    Boot configuration API

    Related-Bug: #2044561
    Change-Id: Ic85f334044025d0cd0a0510a90d57825b9c9b367

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.