How to tell discovery ISO to use DHCP automatically

Hello,

I'm attempting to using a bootable ISO to discover hosts (vs PXE). I created a bootable ISO using https://github.com/theforeman/foreman-discovery-image, and changed my "append" line in isolinux/isolinux.cfg to say:

append initrd=initrd0.img root=live:CDLABEL=fdi rootfstype=auto ro rd.live.image acpi=force rd.luks=0 rd.md=0 rd.dm=0 ip=dhcp rd.neednet=1 nomodeset proxy.url=https://katello.my.domain proxy.type=foreman

When the host boots, though, the FDI workflow starts by asking me if I want a manual network setup or DHCP.

Is there a way to boot from a CD/ISO and automatically use DHCP and register as a discovered host (similar to how the the PXE boot discovery works)? Or, if not DHCP, a way for me to set static network configuration so that the discovery can happen without human intervention?

Thanks,

j

Okay, I was just one more document away from my answer. :smiley:

According to:

https://theforeman.org/plugins/foreman_discovery/6.0/index.html#2.Installation

The magic sauce is:

append initrd=initrd0.img root=live:CDLABEL=fdi rootfstype=auto ro rd.live.image acpi=force rd.luks=0 rd.md=0 rd.dm=0 proxy.url=https://katello.my.domain proxy.type=foreman fdi.pxip=dhcp fdi.pxauto=1

(the fdi.pxip=dhcp part isn't documented, though I guess it should be obvious)

I've run into an error:

"Unattended provisioning failed: unable to upload facts. Check your network credentials."

…but haven't researched it at all yet. The message looks pretty straightforward though I'm confused as to why credentials wouldn't have been assigned when I clicked "Provision" in the web interface (as I assume they are when you use the PXE boot option for this process).

Insight is appreciated.

Regards,

j

··· ----- Original Message ----- From: "'Jason B. Nance' via Foreman users" To: "foreman-users" Sent: Friday, October 7, 2016 3:45:50 PM Subject: [foreman-users] how to tell discovery ISO to use DHCP automatically

Hello,

I’m attempting to using a bootable ISO to discover hosts (vs PXE). I created a bootable ISO using https://github.com/theforeman/foreman-discovery-image, and changed my “append” line in isolinux/isolinux.cfg to say:

append initrd=initrd0.img root=live:CDLABEL=fdi rootfstype=auto ro rd.live.image acpi=force rd.luks=0 rd.md=0 rd.dm=0 ip=dhcp rd.neednet=1 nomodeset proxy.url=https://katello.my.domain proxy.type=foreman

When the host boots, though, the FDI workflow starts by asking me if I want a manual network setup or DHCP.

Is there a way to boot from a CD/ISO and automatically use DHCP and register as a discovered host (similar to how the the PXE boot discovery works)? Or, if not DHCP, a way for me to set static network configuration so that the discovery can happen without human intervention?

Thanks,

j


You received this message because you are subscribed to the Google Groups “Foreman users” group.
To unsubscribe from this group and stop receiving emails from it, send an email to foreman-users+unsubscribe@googlegroups.com.
To post to this group, send email to foreman-users@googlegroups.com.
Visit this group at https://groups.google.com/group/foreman-users.
For more options, visit https://groups.google.com/d/optout.

>"Unattended provisioning failed: unable to upload facts. Check your
> network credentials."

That means your network configuration is perhaps incorrect. Check logs.

LZ

>>"Unattended provisioning failed: unable to upload facts. Check your
>> network credentials."

> That means your network configuration is perhaps incorrect. Check logs.

It seems that the problem is in my process. I noticed that when I do everything with PXE that first the host boots with the default PXE configuration, which is loading the discovery image. From there I can go into the UI/API, look at my discovered hosts, and say "provision". That is creating a host-specific (well, MAC-specific) PXE configuration that includes a one-time use authentication key. So when the kexec happens and the host reboots and does the PXE the second time it gets a different configuration (one that includes the authentication key that was just created) and the installation happens.

When booting from the ISO and doing the discovery, upon reboot (from the ISO again) the host doesn't have the authentication key, so it can't upload the facts. :-\

Is it possible to do some sort of time-based whitelist by MAC or IP or just temporarily disable the auth? Or is there another process I should be following?

Regards,

j

Okay, I think I have this figured out. Where I went wrong was trying to use discovery without being able to use the integrated DHCP/PXE stuff. There are ways to integrate this with existing infrastructure but those didn't work well in my situation.

It seems that I should have been going straight to the boot disk plugin. There are multiple options there as well, but the one that seems to work best for my situation is to pre-create the host in TFM (via web UI or, even better, API call) then boot the host off the "generic" image. The generic image requires DHCP to be able to get on the network and talk to Foreman, but that's pretty much exactly what I want.

Regards,

j

··· ----- Original Message ----- From: "'Jason B. Nance' via Foreman users" To: foreman-users@googlegroups.com Sent: Saturday, October 8, 2016 4:51:38 PM Subject: Re: [foreman-users] how to tell discovery ISO to use DHCP automatically

“Unattended provisioning failed: unable to upload facts. Check your
network credentials.”

That means your network configuration is perhaps incorrect. Check logs.

It seems that the problem is in my process. I noticed that when I do everything with PXE that first the host boots with the default PXE configuration, which is loading the discovery image. From there I can go into the UI/API, look at my discovered hosts, and say “provision”. That is creating a host-specific (well, MAC-specific) PXE configuration that includes a one-time use authentication key. So when the kexec happens and the host reboots and does the PXE the second time it gets a different configuration (one that includes the authentication key that was just created) and the installation happens.

When booting from the ISO and doing the discovery, upon reboot (from the ISO again) the host doesn’t have the authentication key, so it can’t upload the facts. :-\

Is it possible to do some sort of time-based whitelist by MAC or IP or just temporarily disable the auth? Or is there another process I should be following?

Regards,

j


You received this message because you are subscribed to the Google Groups “Foreman users” group.
To unsubscribe from this group and stop receiving emails from it, send an email to foreman-users+unsubscribe@googlegroups.com.
To post to this group, send email to foreman-users@googlegroups.com.
Visit this group at https://groups.google.com/group/foreman-users.
For more options, visit https://groups.google.com/d/optout.