Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for TFTP-boot provisioning in IPv6 networks #3532

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion guides/common/assembly_configuring-networking.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@ include::modules/proc_optimizing-performance-by-removing-nics-from-database.adoc

include::modules/con_network-resources.adoc[leveloffset=+1]

include::modules/con_dhcp-options.adoc[leveloffset=+1]
include::modules/con_foreman-and-dhcp-configuration.adoc[leveloffset=+1]

include::modules/ref_options-in-managed-dhcpv4.adoc[leveloffset=+2]

include::modules/ref_options-in-unmanaged-dhcpv6.adoc[leveloffset=+2]

include::modules/proc_troubleshooting-dhcp-problems.adoc[leveloffset=+1]

Expand Down
4 changes: 4 additions & 0 deletions guides/common/modules/con_foreman-and-dhcp-configuration.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[id="{project-context}-and-dhcp-configuration"]
= {Project} and DHCP configuration

{Project} manages DHCP reservations through a DHCP {SmartProxy}.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
= Creating hosts with UEFI HTTP boot provisioning

You can provision hosts from {Project} using the UEFI HTTP Boot.
This is the only method with which you can provision hosts in IPv6 network.

To use the CLI instead of the {ProjectWebUI}, see the xref:cli-creating-hosts-with-uefi-http-boot-provisioning_{context}[].

Expand Down
Original file line number Diff line number Diff line change
@@ -1,23 +1,22 @@
[id="DHCP_Options_{context}"]
= {Project} and DHCP options
[id="options-in-managed-dhcpv4"]
= Options in managed DHCPv4

{Project} manages DHCP reservations through a DHCP {SmartProxy}.
{Project} also sets the `next-server` and `filename` DHCP options.
When {Project} manages the DHCP service and can update the DHCP configuration, {Project} sets the `next-server` and `filename` DHCP options.

.The next-server option
`next-server`::
The `next-server` option provides the IP address of the TFTP server to boot from.
This option is not set by default and must be set for each TFTP {SmartProxy}.
You can use the `{foreman-installer}` command with the `--foreman-proxy-tftp-servername` option to set the TFTP server in the `/etc/foreman-proxy/settings.d/tftp.yml` file:

You can use the `{foreman-installer}` command with the `--foreman-proxy-tftp-servername` argument to set the TFTP server in the `/etc/foreman-proxy/settings.d/tftp.yml` file:
+
[options="nowrap" subs="+quotes,attributes"]
----
# {foreman-installer} --foreman-proxy-tftp-servername _1.2.3.4_
----

+
Each TFTP {SmartProxy} then reports this setting through the API and {Project} can retrieve the configuration information when it creates the DHCP record.

+
When the PXE loader is set to `none`, {Project} does not populate the `next-server` option into the DHCP record.

+
If the `next-server` option remains undefined, {Project} uses reverse DNS search to find a TFTP server address to assign, but you might encounter the following problems:

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know this was already there, but this behavior has changed a long time ago. In Foreman 2.0 there was theforeman/foreman@60c03b6 which deprecated the old reverse DNS lookup for Smart Proxies incapable of a new feature (for n-1 support). In Foreman 2.5 this deprecated behavior was removed with theforeman/foreman@f3231f6.

The way it now works is:

  • It calls the Smart Proxy API to retrieve the serverName (as specified using --foreman-proxy-tftp-servername in the installer)
  • If this isn't returned, it uses the hostname of the Smart Proxy

It is up to the DHCP provider server to deal with a hostname and it depends on the implementation how this exactly works. For ISC DHCP the Smart Proxy now resolves the address:
https://github.com/theforeman/smart-proxy/blob/7060ce3e3951f070475e0c977fd3bf93e335d810/modules/dhcp_common/isc/omapi_provider.rb#L203-L215

And in reviewing this PR I've realized we should really use the option to set the tftp server name and let ISC DHCP deal with it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ekohl Thank you. I've created a separate PR so that we can cherry pick it.
Please review #3540

* DNS timeouts during provisioning
Expand All @@ -26,14 +25,15 @@ For example, authoritative rather than caching
* Errors about incorrect IP address for the TFTP server.
For example, `PTR record was invalid`

+
If you encounter these problems, check the DNS setup on both {Project} and {SmartProxy}, specifically the PTR record resolution.

.The filename option
`filename`::
The `filename` option contains the full path to the file that downloads and executes during provisioning.
The PXE loader that you select for the host or host group defines which `filename` option to use.
When the PXE loader is set to `none`, {Project} does not populate the `filename` option into the DHCP record.
Depending on the PXE loader option, the `filename` changes as follows:

+
|=======
|PXE loader option | filename entry| Notes

Expand Down
19 changes: 19 additions & 0 deletions guides/common/modules/ref_options-in-unmanaged-dhcpv6.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
[id="options-in-unmanaged-dhcpv6"]
= Options in unmanaged DHCPv6

To provision hosts over TFTP in an IPv6-only network, configure the DHCP server to respond with the `bootfile-url` DHCP option.
{Project} cannot manage the DHCPv6 service, therefore, you have to configure your DHCP server manually.

`bootfile-url`::
The URL value of this option has to point to a file on TFTP {SmartProxy} that is a first-stage boot loader, such as `pxelinux.0`.
Example configuration:
+
[options="nowrap" subs="+quotes,attributes,verbatim"]
----
"option-data": [
{
"name": "bootfile-url",
"data": "tftp://2001:db8:1::1/pxelinux.0"
}
],
----
Loading