Everytime I try to provision a discovered host with os through hammer cli, it reboots and gives me error “failed to load from any network chain interface” but when I do it from web UI, it works fine, why is this?
Host should be provisioned with desired OS.
Foreman version : 2.5
Thank you for your time!
Does anyone have any information or updates on this? Why can’t I provision a discovered host using hammer cli. When I observer the log files, everything looks fine without any errors, all returning completed 200 OK.
Hello! Would you mind sharing the command and the parameters you’re trying to use?
hammer discovery provision --id 475 --architecture “x86_64” --operatingsystem “RHEL 7u3” --medium “RHEL 7” --partition-table “Kickstart default” --pxe-loader ‘None’ --root-password rootpwd123 --location “Default Location” --organization “Default Organization” --domain “mynetwork.net” --subnet “DiscNet”
Upon running this command, it says host created and my vm basically reboots. Upon booting my vm off the network, it gives me an error saying: Failed to chainload from any network interface.
When I do this entire process from Foreman Web UI, i.e. discover my vm and provision it using above paramaters, it works completely fine and gets the initrd.img and kernl that my medium is pointing towards and RHEL 7u3 gets successfully installed.
When your host gets created - I guess it is not in the
Build mode, since you did not pass
--build true to your provision command (silly, i know).
That would cause foreman not to generate TFTP config for your host.
The other suspicious thing is
--pxe-loader None - are you sure that is supposed to be
None? Can you try to use
PXELinux BIOS or in case it is UEFI-based -
So, when I pass --build true to my provision command, I get this error:
Could not create host, resource have no errors in my command line (hammer cli)
That’s why I had to avoid using build flag so that I could at least create the host. My initial thought was as same as yours having to have build flag which would make foreman generate TFTP config for the host, but that error messed it up.
And, I am sure about --pxe-loader None, I am using discovery image and according to the documentation I have to have pxe-loader set to None otherwise it won’t work!
I am in a big confusion state at the moment and not sure if this is a bug or I am doing something wrong!
so you definitely want to keep the
--build true parameter.
That error is just masking the real root cause.
You should check your
/var/log/foreman/production.log for the traceback.
Now, if you’re using FDI, then your discovered host is most likely waiting for
kexec instead of the
reboot. (you should see this message at the discovery image screen):
If that is true and your VM reboots anyway, then the kexec operation seems to fail for some reason. The answer might be in those logs.
Also, you might want to increase the log verbosity to
DEBUG to also capture the details (
:log_level: DEBUG in
/etc/foreman-proxy/settings.yml + restart
Could you also provide the version of
Foreman Discovery Image you are using?
I can’t keep the --build parameter because with build parameter, my host wouldnot even reboot but just get this error:
I check the hammer log to see why this hammer command is not working with --build parameter on which gives me this:
So, I remove the --build parameter and provision the discovered host without it but with everything else just like above.
It agains give me failed to chainload from any network interface error.
Here is the log file with DEBUG on:
Upon observing the log, it clearly looks like it gets the IPXE template that basically has/point towards boot files for RHEL 7u3 which I am trying to install but I am not sure what happens after that! When I do all this from web UI then the OS gets installed perfectly. I compared two log files, one with hammer cli and other one with web UI, and there is literally no difference in logs. This is why I am scratching my head.
Also, when host gets discovered this is what i have:
After this stage I provision this host. Also, just to be more clear, lets say I used web UI to provision the discovered host and then my hosts gets added to all hosts tab, then if I update/reprovision the host with new OS using hammer cli with --build parameter, it works completely fine without any errors, but it is just this hammer discovery provision command which is confusing me and for my workflow I need to make this work!
Also, I really appreciate all your help here!
I believe your hammer command is missing some crucial parameters. You won’t see the server traceback in the hammer debug output.
You really want to check the server side log (production.log). It might be something with the missing interface info, etc.
Btw, if possible in your scenario, i’d suggest to define a hostgroup - you can do that using UI - it’s almost identical to the host dialog.
Then, you can simply pass
--hostgroup-id parameter to your hammer command instead of providing all the details manually.
That could move you forward for the time being.
I will try that and update you here!
Thank you for the help!
Apparently, it allows me to set build flag to true and OS installation is successful on discovered hosts when provisioned with hostgroup (does not work if host groups are nested tho). This is so weird and I strongly think this is a bug of some kind. For the time being, I am moving forward with this but I hope somebody will look into this issue soon.
Thank you for your help!
Glad this unblocked you.
Somebody will definitely happily look into this, but the logs would be really helpful.