Auto-Provisioning Discovered Bare-metal Host via PXE Issue

That's good news Lukas. Thank you.

··· On Wednesday, April 19, 2017 at 6:22:06 AM UTC-5, Lukas Zapletal wrote: > > Ok I finally reproduced. > > When domain is blank, autoprovisioning fails for no apparent reason, > logs are empty, something fails during orchestration and hosts are > getting discovered again (which fails since managed host already > exists). > > http://projects.theforeman.org/issues/19313 > > I will do my best to fix it this week, but I am on travel the week > after, crossing my fingers. > > LZ > > On Thu, Apr 13, 2017 at 4:28 PM, Garreat <jmie...@fgtsa.com > > wrote: > > I experience this issue. > > After clicking 'auto-provisioning' on a discovered host, the host entry > is > > created, the host reboots - but only to enter Foreman Discovery Image > PXE > > loop. > > My TFTP proxy is in healthy status as I can recreate PXE default no > prob. > > > > Now answering your checklist: > > - host is managed - yes - OK > > - provision method is "build" and not "image" - how to check this? I > can't > > see the 'build mode' checkbox for the newly created host > > - host has operating system set - yes (inherited from host group) - OK > > - host has pxe loader flag present (not set to blank or None) - how to > check > > this? > > - host has one provisioning NIC with valid MAC address - yes it does - > OK > > - a subnet is associated with the provisioning NIC - it is, but it's a > > subnet different than the one declared in machine's host group > > - the subnet has TFTP feature turned on - it does, and it's the same > TFTP > > proxy as in the subnet that I wanted > > > > Also, the 'domain' is blank for the fresh created host. > > The OS assigned to this host group has a valid PXElinux template > selected. > > > > Assume I'm not making any manual changes: > > - 'Build host' does nothing > > - 'Rebuild config' creates a PXE mac-template on TFTP immediatly > > > > facter -j output attached > > > > Thanks / Regards / Greetings > > > > W dniu wtorek, 11 kwietnia 2017 10:28:17 UTC+2 użytkownik Lukas Zapletal > > napisał: > >> > >> TFTP orchestration is not being triggered. It can be only performed > >> when all of these conditions are met: > >> > >> - host is managed > >> - provision method is "build" and not "image" > >> - host has operating system set > >> - host has pxe loader flag present (not set to blank or None) > >> - host has one provisioning NIC with valid MAC address > >> - a subnet is associated with the provisioning NIC > >> - the subnet has TFTP feature turned on > >> > >> Visit a host which failed provisioning and do this checklist please. > >> > >> LZ > >> > >> > > > > > > -- > Later, > Lukas @lzap Zapletal >

Here's the SQL debug log from 'successful' auto-provision (no PXE file
appears).
Please find attached.

Thanks/Regards

foreman_auto-prov_sql_log (5.87 KB)

··· On Wed, Apr 19, 2017 at 1:21 PM, Lukas Zapletal wrote:

Ok I finally reproduced.

When domain is blank, autoprovisioning fails for no apparent reason,
logs are empty, something fails during orchestration and hosts are
getting discovered again (which fails since managed host already
exists).

Bug #19313: Auto-provisioning does not orchestrate TFTP - Discovery - Foreman

I will do my best to fix it this week, but I am on travel the week
after, crossing my fingers.

LZ

On Thu, Apr 13, 2017 at 4:28 PM, Garreat jmierzwa@fgtsa.com wrote:

I experience this issue.
After clicking ‘auto-provisioning’ on a discovered host, the host entry
is
created, the host reboots - but only to enter Foreman Discovery Image PXE
loop.
My TFTP proxy is in healthy status as I can recreate PXE default no prob.

Now answering your checklist:

  • host is managed - yes - OK
  • provision method is “build” and not “image” - how to check this? I
    can’t
    see the ‘build mode’ checkbox for the newly created host
  • host has operating system set - yes (inherited from host group) - OK
  • host has pxe loader flag present (not set to blank or None) - how to
    check
    this?
  • host has one provisioning NIC with valid MAC address - yes it does - OK
  • a subnet is associated with the provisioning NIC - it is, but it’s a
    subnet different than the one declared in machine’s host group
  • the subnet has TFTP feature turned on - it does, and it’s the same TFTP
    proxy as in the subnet that I wanted

Also, the ‘domain’ is blank for the fresh created host.
The OS assigned to this host group has a valid PXElinux template
selected.

Assume I’m not making any manual changes:

  • ‘Build host’ does nothing
  • ‘Rebuild config’ creates a PXE mac-template on TFTP immediatly

facter -j output attached

Thanks / Regards / Greetings

W dniu wtorek, 11 kwietnia 2017 10:28:17 UTC+2 użytkownik Lukas Zapletal
napisał:

TFTP orchestration is not being triggered. It can be only performed
when all of these conditions are met:

  • host is managed
  • provision method is “build” and not “image”
  • host has operating system set
  • host has pxe loader flag present (not set to blank or None)
  • host has one provisioning NIC with valid MAC address
  • a subnet is associated with the provisioning NIC
  • the subnet has TFTP feature turned on

Visit a host which failed provisioning and do this checklist please.

LZ


Later,
Lukas @lzap Zapletal

Jacek Mierzwa | Systems Integration Engineer

Platform Management Division

And here is Foreman app debug-level log from 'successful' auto-provision
(no PXE file appears).

foreman_auto-prov_app_log (2.72 KB)

··· On Wed, Apr 19, 2017 at 2:13 PM, Jacek Mierzwa wrote:

Here’s the SQL debug log from ‘successful’ auto-provision (no PXE file
appears).
Please find attached.

Thanks/Regards

On Wed, Apr 19, 2017 at 1:21 PM, Lukas Zapletal lzap@redhat.com wrote:

Ok I finally reproduced.

When domain is blank, autoprovisioning fails for no apparent reason,
logs are empty, something fails during orchestration and hosts are
getting discovered again (which fails since managed host already
exists).

Bug #19313: Auto-provisioning does not orchestrate TFTP - Discovery - Foreman

I will do my best to fix it this week, but I am on travel the week
after, crossing my fingers.

LZ

On Thu, Apr 13, 2017 at 4:28 PM, Garreat jmierzwa@fgtsa.com wrote:

I experience this issue.
After clicking ‘auto-provisioning’ on a discovered host, the host entry
is
created, the host reboots - but only to enter Foreman Discovery Image
PXE
loop.
My TFTP proxy is in healthy status as I can recreate PXE default no
prob.

Now answering your checklist:

  • host is managed - yes - OK
  • provision method is “build” and not “image” - how to check this? I
    can’t
    see the ‘build mode’ checkbox for the newly created host
  • host has operating system set - yes (inherited from host group) - OK
  • host has pxe loader flag present (not set to blank or None) - how to
    check
    this?
  • host has one provisioning NIC with valid MAC address - yes it does -
    OK
  • a subnet is associated with the provisioning NIC - it is, but it’s a
    subnet different than the one declared in machine’s host group
  • the subnet has TFTP feature turned on - it does, and it’s the same
    TFTP
    proxy as in the subnet that I wanted

Also, the ‘domain’ is blank for the fresh created host.
The OS assigned to this host group has a valid PXElinux template
selected.

Assume I’m not making any manual changes:

  • ‘Build host’ does nothing
  • ‘Rebuild config’ creates a PXE mac-template on TFTP immediatly

facter -j output attached

Thanks / Regards / Greetings

W dniu wtorek, 11 kwietnia 2017 10:28:17 UTC+2 użytkownik Lukas Zapletal
napisał:

TFTP orchestration is not being triggered. It can be only performed
when all of these conditions are met:

  • host is managed
  • provision method is “build” and not “image”
  • host has operating system set
  • host has pxe loader flag present (not set to blank or None)
  • host has one provisioning NIC with valid MAC address
  • a subnet is associated with the provisioning NIC
  • the subnet has TFTP feature turned on

Visit a host which failed provisioning and do this checklist please.

LZ


Later,
Lukas @lzap Zapletal

Jacek Mierzwa | Systems Integration Engineer

Platform Management Division

Jacek Mierzwa | Systems Integration Engineer

Platform Management Division

Same as previous, with enabled Foreman SQL logger. Please see attached.

W dniu środa, 19 kwietnia 2017 14:51:06 UTC+2 użytkownik Garreat napisał:

foreman_auto-prov_sql-logger (4.68 KB)

··· > > And here is Foreman app debug-level log from 'successful' auto-provision > (no PXE file appears). > > On Wed, Apr 19, 2017 at 2:13 PM, Jacek Mierzwa wrote: > >> Here's the SQL debug log from 'successful' auto-provision (no PXE file >> appears). >> Please find attached. >> >> Thanks/Regards >> >> On Wed, Apr 19, 2017 at 1:21 PM, Lukas Zapletal wrote: >> >>> Ok I finally reproduced. >>> >>> When domain is blank, autoprovisioning fails for no apparent reason, >>> logs are empty, something fails during orchestration and hosts are >>> getting discovered again (which fails since managed host already >>> exists). >>> >>> http://projects.theforeman.org/issues/19313 >>> >>> I will do my best to fix it this week, but I am on travel the week >>> after, crossing my fingers. >>> >>> LZ >>> >>> On Thu, Apr 13, 2017 at 4:28 PM, Garreat wrote: >>> > I experience this issue. >>> > After clicking 'auto-provisioning' on a discovered host, the host >>> entry is >>> > created, the host reboots - but only to enter Foreman Discovery Image >>> PXE >>> > loop. >>> > My TFTP proxy is in healthy status as I can recreate PXE default no >>> prob. >>> > >>> > Now answering your checklist: >>> > - host is managed - yes - OK >>> > - provision method is "build" and not "image" - how to check this? I >>> can't >>> > see the 'build mode' checkbox for the newly created host >>> > - host has operating system set - yes (inherited from host group) - OK >>> > - host has pxe loader flag present (not set to blank or None) - how to >>> check >>> > this? >>> > - host has one provisioning NIC with valid MAC address - yes it does - >>> OK >>> > - a subnet is associated with the provisioning NIC - it is, but it's a >>> > subnet different than the one declared in machine's host group >>> > - the subnet has TFTP feature turned on - it does, and it's the same >>> TFTP >>> > proxy as in the subnet that I wanted >>> > >>> > Also, the 'domain' is blank for the fresh created host. >>> > The OS assigned to this host group has a valid PXElinux template >>> selected. >>> > >>> > Assume I'm not making any manual changes: >>> > - 'Build host' does nothing >>> > - 'Rebuild config' creates a PXE mac-template on TFTP immediatly >>> > >>> > facter -j output attached >>> > >>> > Thanks / Regards / Greetings >>> > >>> > W dniu wtorek, 11 kwietnia 2017 10:28:17 UTC+2 użytkownik Lukas >>> Zapletal >>> > napisał: >>> >> >>> >> TFTP orchestration is not being triggered. It can be only performed >>> >> when all of these conditions are met: >>> >> >>> >> - host is managed >>> >> - provision method is "build" and not "image" >>> >> - host has operating system set >>> >> - host has pxe loader flag present (not set to blank or None) >>> >> - host has one provisioning NIC with valid MAC address >>> >> - a subnet is associated with the provisioning NIC >>> >> - the subnet has TFTP feature turned on >>> >> >>> >> Visit a host which failed provisioning and do this checklist please. >>> >> >>> >> LZ >>> >> >>> >> >>> > >>> >>> >>> >>> -- >>> Later, >>> Lukas @lzap Zapletal >>> >> >> >> >> -- >> >> *Jacek Mierzwa* | Systems Integration Engineer >> >> Platform Management Division >> >> >> >> > > > -- > > *Jacek Mierzwa* | Systems Integration Engineer > > Platform Management Division > > > >

Jacek, I apologize but what I meant was:

http://projects.theforeman.org/projects/foreman/wiki/Troubleshooting#Enable-detailed-SQL-logger-for-orchestration-messages

Chad, it looks like setting (a fake) domain did not help to Jacek, can you
try it? Did it help in your case? Associate Subnet with a Domain and then
set it in the Hostgroup.

LZ

··· On Wed, Apr 19, 2017 at 2:51 PM, Jacek Mierzwa wrote:

And here is Foreman app debug-level log from ‘successful’ auto-provision
(no PXE file appears).

On Wed, Apr 19, 2017 at 2:13 PM, Jacek Mierzwa jmierzwa@lbisa.com wrote:

Here’s the SQL debug log from ‘successful’ auto-provision (no PXE file
appears).
Please find attached.

Thanks/Regards

On Wed, Apr 19, 2017 at 1:21 PM, Lukas Zapletal lzap@redhat.com wrote:

Ok I finally reproduced.

When domain is blank, autoprovisioning fails for no apparent reason,
logs are empty, something fails during orchestration and hosts are
getting discovered again (which fails since managed host already
exists).

Bug #19313: Auto-provisioning does not orchestrate TFTP - Discovery - Foreman

I will do my best to fix it this week, but I am on travel the week
after, crossing my fingers.

LZ

On Thu, Apr 13, 2017 at 4:28 PM, Garreat jmierzwa@fgtsa.com wrote:

I experience this issue.
After clicking ‘auto-provisioning’ on a discovered host, the host
entry is
created, the host reboots - but only to enter Foreman Discovery Image
PXE
loop.
My TFTP proxy is in healthy status as I can recreate PXE default no
prob.

Now answering your checklist:

  • host is managed - yes - OK
  • provision method is “build” and not “image” - how to check this? I
    can’t
    see the ‘build mode’ checkbox for the newly created host
  • host has operating system set - yes (inherited from host group) - OK
  • host has pxe loader flag present (not set to blank or None) - how to
    check
    this?
  • host has one provisioning NIC with valid MAC address - yes it does -
    OK
  • a subnet is associated with the provisioning NIC - it is, but it’s a
    subnet different than the one declared in machine’s host group
  • the subnet has TFTP feature turned on - it does, and it’s the same
    TFTP
    proxy as in the subnet that I wanted

Also, the ‘domain’ is blank for the fresh created host.
The OS assigned to this host group has a valid PXElinux template
selected.

Assume I’m not making any manual changes:

  • ‘Build host’ does nothing
  • ‘Rebuild config’ creates a PXE mac-template on TFTP immediatly

facter -j output attached

Thanks / Regards / Greetings

W dniu wtorek, 11 kwietnia 2017 10:28:17 UTC+2 użytkownik Lukas
Zapletal
napisał:

TFTP orchestration is not being triggered. It can be only performed
when all of these conditions are met:

  • host is managed
  • provision method is “build” and not “image”
  • host has operating system set
  • host has pxe loader flag present (not set to blank or None)
  • host has one provisioning NIC with valid MAC address
  • a subnet is associated with the provisioning NIC
  • the subnet has TFTP feature turned on

Visit a host which failed provisioning and do this checklist please.

LZ


Later,
Lukas @lzap Zapletal

Jacek Mierzwa | Systems Integration Engineer

Platform Management Division

Jacek Mierzwa | Systems Integration Engineer

Platform Management Division


Later,
Lukas @lzap Zapletal

I'm not sure I follow what your asking for Lukas.

··· On Wednesday, April 19, 2017 at 8:50:21 AM UTC-5, Lukas Zapletal wrote: > > Jacek, I apologize but what I meant was: > > > http://projects.theforeman.org/projects/foreman/wiki/Troubleshooting#Enable-detailed-SQL-logger-for-orchestration-messages > > Chad, it looks like setting (a fake) domain did not help to Jacek, can you > try it? Did it help in your case? Associate Subnet with a Domain and then > set it in the Hostgroup. > > LZ > > On Wed, Apr 19, 2017 at 2:51 PM, Jacek Mierzwa > wrote: > >> And here is Foreman app debug-level log from 'successful' auto-provision >> (no PXE file appears). >> >> On Wed, Apr 19, 2017 at 2:13 PM, Jacek Mierzwa > > wrote: >> >>> Here's the SQL debug log from 'successful' auto-provision (no PXE file >>> appears). >>> Please find attached. >>> >>> Thanks/Regards >>> >>> On Wed, Apr 19, 2017 at 1:21 PM, Lukas Zapletal >> > wrote: >>> >>>> Ok I finally reproduced. >>>> >>>> When domain is blank, autoprovisioning fails for no apparent reason, >>>> logs are empty, something fails during orchestration and hosts are >>>> getting discovered again (which fails since managed host already >>>> exists). >>>> >>>> http://projects.theforeman.org/issues/19313 >>>> >>>> I will do my best to fix it this week, but I am on travel the week >>>> after, crossing my fingers. >>>> >>>> LZ >>>> >>>> On Thu, Apr 13, 2017 at 4:28 PM, Garreat >>> > wrote: >>>> > I experience this issue. >>>> > After clicking 'auto-provisioning' on a discovered host, the host >>>> entry is >>>> > created, the host reboots - but only to enter Foreman Discovery Image >>>> PXE >>>> > loop. >>>> > My TFTP proxy is in healthy status as I can recreate PXE default no >>>> prob. >>>> > >>>> > Now answering your checklist: >>>> > - host is managed - yes - OK >>>> > - provision method is "build" and not "image" - how to check this? I >>>> can't >>>> > see the 'build mode' checkbox for the newly created host >>>> > - host has operating system set - yes (inherited from host group) - OK >>>> > - host has pxe loader flag present (not set to blank or None) - how >>>> to check >>>> > this? >>>> > - host has one provisioning NIC with valid MAC address - yes it does >>>> - OK >>>> > - a subnet is associated with the provisioning NIC - it is, but it's a >>>> > subnet different than the one declared in machine's host group >>>> > - the subnet has TFTP feature turned on - it does, and it's the same >>>> TFTP >>>> > proxy as in the subnet that I wanted >>>> > >>>> > Also, the 'domain' is blank for the fresh created host. >>>> > The OS assigned to this host group has a valid PXElinux template >>>> selected. >>>> > >>>> > Assume I'm not making any manual changes: >>>> > - 'Build host' does nothing >>>> > - 'Rebuild config' creates a PXE mac-template on TFTP immediatly >>>> > >>>> > facter -j output attached >>>> > >>>> > Thanks / Regards / Greetings >>>> > >>>> > W dniu wtorek, 11 kwietnia 2017 10:28:17 UTC+2 użytkownik Lukas >>>> Zapletal >>>> > napisał: >>>> >> >>>> >> TFTP orchestration is not being triggered. It can be only performed >>>> >> when all of these conditions are met: >>>> >> >>>> >> - host is managed >>>> >> - provision method is "build" and not "image" >>>> >> - host has operating system set >>>> >> - host has pxe loader flag present (not set to blank or None) >>>> >> - host has one provisioning NIC with valid MAC address >>>> >> - a subnet is associated with the provisioning NIC >>>> >> - the subnet has TFTP feature turned on >>>> >> >>>> >> Visit a host which failed provisioning and do this checklist please. >>>> >> >>>> >> LZ >>>> >> >>>> >> >>>> > >>>> >>>> >>>> >>>> -- >>>> Later, >>>> Lukas @lzap Zapletal >>>> >>> >>> >>> >>> -- >>> >>> *Jacek Mierzwa* | Systems Integration Engineer >>> >>> Platform Management Division >>> >>> >>> >>> >> >> >> -- >> >> *Jacek Mierzwa* | Systems Integration Engineer >> >> Platform Management Division >> >> >> >> > > > -- > Later, > Lukas @lzap Zapletal >

Ok thanks, I can see that either TFTP nor DHCP steps are not getting
orchestrated at all. I suspect that this returns false:

Maybe if you are able to break up the tftp_ready? method into multiple
lines and do some debug logger outputs of all individual statements in
there to see which does not trigger TFTP orchestration.

Strange is we should see DHCP orchestration but that does not happen as
well. Are NICs created correctly? Is there a subnet set?

Unfortunately I have engagement at customer site for whole week, I will
carry on the week after. We need to solve this.

··· On Wed, Apr 19, 2017 at 4:58 PM, Chad Schroeder < chads.finishing.strong@gmail.com> wrote:

I’m not sure I follow what your asking for Lukas.

On Wednesday, April 19, 2017 at 8:50:21 AM UTC-5, Lukas Zapletal wrote:

Jacek, I apologize but what I meant was:

http://projects.theforeman.org/projects/foreman/wiki/Trouble
shooting#Enable-detailed-SQL-logger-for-orchestration-messages

Chad, it looks like setting (a fake) domain did not help to Jacek, can
you try it? Did it help in your case? Associate Subnet with a Domain and
then set it in the Hostgroup.

LZ

On Wed, Apr 19, 2017 at 2:51 PM, Jacek Mierzwa jmie...@lbisa.com wrote:

And here is Foreman app debug-level log from ‘successful’ auto-provision
(no PXE file appears).

On Wed, Apr 19, 2017 at 2:13 PM, Jacek Mierzwa jmie...@lbisa.com >>> wrote:

Here’s the SQL debug log from ‘successful’ auto-provision (no PXE file
appears).
Please find attached.

Thanks/Regards

On Wed, Apr 19, 2017 at 1:21 PM, Lukas Zapletal lz...@redhat.com >>>> wrote:

Ok I finally reproduced.

When domain is blank, autoprovisioning fails for no apparent reason,
logs are empty, something fails during orchestration and hosts are
getting discovered again (which fails since managed host already
exists).

Bug #19313: Auto-provisioning does not orchestrate TFTP - Discovery - Foreman

I will do my best to fix it this week, but I am on travel the week
after, crossing my fingers.

LZ

On Thu, Apr 13, 2017 at 4:28 PM, Garreat jmie...@fgtsa.com wrote:

I experience this issue.
After clicking ‘auto-provisioning’ on a discovered host, the host
entry is
created, the host reboots - but only to enter Foreman Discovery
Image PXE
loop.
My TFTP proxy is in healthy status as I can recreate PXE default no
prob.

Now answering your checklist:

  • host is managed - yes - OK
  • provision method is “build” and not “image” - how to check this? I
    can’t
    see the ‘build mode’ checkbox for the newly created host
  • host has operating system set - yes (inherited from host group) -
    OK
  • host has pxe loader flag present (not set to blank or None) - how
    to check
    this?
  • host has one provisioning NIC with valid MAC address - yes it does
  • OK
  • a subnet is associated with the provisioning NIC - it is, but it’s
    a
    subnet different than the one declared in machine’s host group
  • the subnet has TFTP feature turned on - it does, and it’s the same
    TFTP
    proxy as in the subnet that I wanted

Also, the ‘domain’ is blank for the fresh created host.
The OS assigned to this host group has a valid PXElinux template
selected.

Assume I’m not making any manual changes:

  • ‘Build host’ does nothing
  • ‘Rebuild config’ creates a PXE mac-template on TFTP immediatly

facter -j output attached

Thanks / Regards / Greetings

W dniu wtorek, 11 kwietnia 2017 10:28:17 UTC+2 użytkownik Lukas
Zapletal
napisał:

TFTP orchestration is not being triggered. It can be only performed
when all of these conditions are met:

  • host is managed
  • provision method is “build” and not “image”
  • host has operating system set
  • host has pxe loader flag present (not set to blank or None)
  • host has one provisioning NIC with valid MAC address
  • a subnet is associated with the provisioning NIC
  • the subnet has TFTP feature turned on

Visit a host which failed provisioning and do this checklist please.

LZ


Later,
Lukas @lzap Zapletal

Jacek Mierzwa | Systems Integration Engineer

Platform Management Division

Jacek Mierzwa | Systems Integration Engineer

Platform Management Division


Later,
Lukas @lzap Zapletal


Later,
Lukas @lzap Zapletal

Lukas, just for the record, I don't use DHCP orchestration at all.
I have a smart-proxy DHCP instance, but it's not assigned to the subnet.
Reason behind this: Feature #2800: Ability to push DHCP settings to two servers - Foreman .

The auto-provisioned host has NICs correctly created and a subnet assigned
to the prov interface.
Just the domain left blank – that was mentioned before.

I will play with tftp.rb next week. I have a dockerized setup, so
traditional debugging includes additional steps.

Thanks for your effort and have a nice weekend!

··· On Fri, Apr 21, 2017 at 3:12 PM, Lukas Zapletal wrote:

Ok thanks, I can see that either TFTP nor DHCP steps are not getting
orchestrated at all. I suspect that this returns false:

https://github.com/theforeman/foreman/blob/develop/app/
models/concerns/orchestration/tftp.rb#L21

Maybe if you are able to break up the tftp_ready? method into multiple
lines and do some debug logger outputs of all individual statements in
there to see which does not trigger TFTP orchestration.

Strange is we should see DHCP orchestration but that does not happen as
well. Are NICs created correctly? Is there a subnet set?

Unfortunately I have engagement at customer site for whole week, I will
carry on the week after. We need to solve this.

On Wed, Apr 19, 2017 at 4:58 PM, Chad Schroeder < > chads.finishing.strong@gmail.com> wrote:

I’m not sure I follow what your asking for Lukas.

On Wednesday, April 19, 2017 at 8:50:21 AM UTC-5, Lukas Zapletal wrote:

Jacek, I apologize but what I meant was:

http://projects.theforeman.org/projects/foreman/wiki/Trouble
shooting#Enable-detailed-SQL-logger-for-orchestration-messages

Chad, it looks like setting (a fake) domain did not help to Jacek, can
you try it? Did it help in your case? Associate Subnet with a Domain and
then set it in the Hostgroup.

LZ

On Wed, Apr 19, 2017 at 2:51 PM, Jacek Mierzwa jmie...@lbisa.com >>> wrote:

And here is Foreman app debug-level log from 'successful’
auto-provision (no PXE file appears).

On Wed, Apr 19, 2017 at 2:13 PM, Jacek Mierzwa jmie...@lbisa.com >>>> wrote:

Here’s the SQL debug log from ‘successful’ auto-provision (no PXE file
appears).
Please find attached.

Thanks/Regards

On Wed, Apr 19, 2017 at 1:21 PM, Lukas Zapletal lz...@redhat.com >>>>> wrote:

Ok I finally reproduced.

When domain is blank, autoprovisioning fails for no apparent reason,
logs are empty, something fails during orchestration and hosts are
getting discovered again (which fails since managed host already
exists).

Bug #19313: Auto-provisioning does not orchestrate TFTP - Discovery - Foreman

I will do my best to fix it this week, but I am on travel the week
after, crossing my fingers.

LZ

On Thu, Apr 13, 2017 at 4:28 PM, Garreat jmie...@fgtsa.com wrote:

I experience this issue.
After clicking ‘auto-provisioning’ on a discovered host, the host
entry is
created, the host reboots - but only to enter Foreman Discovery
Image PXE
loop.
My TFTP proxy is in healthy status as I can recreate PXE default no
prob.

Now answering your checklist:

  • host is managed - yes - OK
  • provision method is “build” and not “image” - how to check this?
    I can’t
    see the ‘build mode’ checkbox for the newly created host
  • host has operating system set - yes (inherited from host group) -
    OK
  • host has pxe loader flag present (not set to blank or None) - how
    to check
    this?
  • host has one provisioning NIC with valid MAC address - yes it
    does - OK
  • a subnet is associated with the provisioning NIC - it is, but
    it’s a
    subnet different than the one declared in machine’s host group
  • the subnet has TFTP feature turned on - it does, and it’s the
    same TFTP
    proxy as in the subnet that I wanted

Also, the ‘domain’ is blank for the fresh created host.
The OS assigned to this host group has a valid PXElinux template
selected.

Assume I’m not making any manual changes:

  • ‘Build host’ does nothing
  • ‘Rebuild config’ creates a PXE mac-template on TFTP immediatly

facter -j output attached

Thanks / Regards / Greetings

W dniu wtorek, 11 kwietnia 2017 10:28:17 UTC+2 użytkownik Lukas
Zapletal
napisał:

TFTP orchestration is not being triggered. It can be only performed
when all of these conditions are met:

  • host is managed
  • provision method is “build” and not “image”
  • host has operating system set
  • host has pxe loader flag present (not set to blank or None)
  • host has one provisioning NIC with valid MAC address
  • a subnet is associated with the provisioning NIC
  • the subnet has TFTP feature turned on

Visit a host which failed provisioning and do this checklist
please.

LZ


Later,
Lukas @lzap Zapletal

Jacek Mierzwa | Systems Integration Engineer

Platform Management Division

Jacek Mierzwa | Systems Integration Engineer

Platform Management Division


Later,
Lukas @lzap Zapletal


Later,
Lukas @lzap Zapletal

Jacek Mierzwa | Systems Integration Engineer

Platform Management Division

Lukas,

Hope this helps:

On initial discovery, the results of tftp_ready? are:
host.nil: false
host.managed: false

Clicking "Auto Provision" on the discovered host in the "Discovered Hosts"
menu:
host.nil: false
host.managed: false

Clicking "Edit" on the host in "All Hosts" menu and then clicking submit:
host.nil: false
host.managed: true
managed: true
provision: true
host: mac00224d4fb56a.sub.domain.net
host.operatingsystem: CentOS 7.3.1611
host.pxe_loader.present: true
pxe_build?: true
SETTINGS[:unattended]: true

Chad

··· On Friday, April 21, 2017 at 8:13:18 AM UTC-5, Lukas Zapletal wrote: > > Ok thanks, I can see that either TFTP nor DHCP steps are not getting > orchestrated at all. I suspect that this returns false: > > > https://github.com/theforeman/foreman/blob/develop/app/models/concerns/orchestration/tftp.rb#L21 > > Maybe if you are able to break up the tftp_ready? method into multiple > lines and do some debug logger outputs of all individual statements in > there to see which does not trigger TFTP orchestration. > > Strange is we should see DHCP orchestration but that does not happen as > well. Are NICs created correctly? Is there a subnet set? > > Unfortunately I have engagement at customer site for whole week, I will > carry on the week after. We need to solve this. > > On Wed, Apr 19, 2017 at 4:58 PM, Chad Schroeder > wrote: > >> I'm not sure I follow what your asking for Lukas. >> >> On Wednesday, April 19, 2017 at 8:50:21 AM UTC-5, Lukas Zapletal wrote: >>> >>> Jacek, I apologize but what I meant was: >>> >>> >>> http://projects.theforeman.org/projects/foreman/wiki/Troubleshooting#Enable-detailed-SQL-logger-for-orchestration-messages >>> >>> Chad, it looks like setting (a fake) domain did not help to Jacek, can >>> you try it? Did it help in your case? Associate Subnet with a Domain and >>> then set it in the Hostgroup. >>> >>> LZ >>> >>> On Wed, Apr 19, 2017 at 2:51 PM, Jacek Mierzwa >>> wrote: >>> >>>> And here is Foreman app debug-level log from 'successful' >>>> auto-provision (no PXE file appears). >>>> >>>> On Wed, Apr 19, 2017 at 2:13 PM, Jacek Mierzwa >>>> wrote: >>>> >>>>> Here's the SQL debug log from 'successful' auto-provision (no PXE file >>>>> appears). >>>>> Please find attached. >>>>> >>>>> Thanks/Regards >>>>> >>>>> On Wed, Apr 19, 2017 at 1:21 PM, Lukas Zapletal >>>>> wrote: >>>>> >>>>>> Ok I finally reproduced. >>>>>> >>>>>> When domain is blank, autoprovisioning fails for no apparent reason, >>>>>> logs are empty, something fails during orchestration and hosts are >>>>>> getting discovered again (which fails since managed host already >>>>>> exists). >>>>>> >>>>>> http://projects.theforeman.org/issues/19313 >>>>>> >>>>>> I will do my best to fix it this week, but I am on travel the week >>>>>> after, crossing my fingers. >>>>>> >>>>>> LZ >>>>>> >>>>>> On Thu, Apr 13, 2017 at 4:28 PM, Garreat wrote: >>>>>> > I experience this issue. >>>>>> > After clicking 'auto-provisioning' on a discovered host, the host >>>>>> entry is >>>>>> > created, the host reboots - but only to enter Foreman Discovery >>>>>> Image PXE >>>>>> > loop. >>>>>> > My TFTP proxy is in healthy status as I can recreate PXE default no >>>>>> prob. >>>>>> > >>>>>> > Now answering your checklist: >>>>>> > - host is managed - yes - OK >>>>>> > - provision method is "build" and not "image" - how to check this? >>>>>> I can't >>>>>> > see the 'build mode' checkbox for the newly created host >>>>>> > - host has operating system set - yes (inherited from host group) - >>>>>> OK >>>>>> > - host has pxe loader flag present (not set to blank or None) - how >>>>>> to check >>>>>> > this? >>>>>> > - host has one provisioning NIC with valid MAC address - yes it >>>>>> does - OK >>>>>> > - a subnet is associated with the provisioning NIC - it is, but >>>>>> it's a >>>>>> > subnet different than the one declared in machine's host group >>>>>> > - the subnet has TFTP feature turned on - it does, and it's the >>>>>> same TFTP >>>>>> > proxy as in the subnet that I wanted >>>>>> > >>>>>> > Also, the 'domain' is blank for the fresh created host. >>>>>> > The OS assigned to this host group has a valid PXElinux template >>>>>> selected. >>>>>> > >>>>>> > Assume I'm not making any manual changes: >>>>>> > - 'Build host' does nothing >>>>>> > - 'Rebuild config' creates a PXE mac-template on TFTP immediatly >>>>>> > >>>>>> > facter -j output attached >>>>>> > >>>>>> > Thanks / Regards / Greetings >>>>>> > >>>>>> > W dniu wtorek, 11 kwietnia 2017 10:28:17 UTC+2 użytkownik Lukas >>>>>> Zapletal >>>>>> > napisał: >>>>>> >> >>>>>> >> TFTP orchestration is not being triggered. It can be only performed >>>>>> >> when all of these conditions are met: >>>>>> >> >>>>>> >> - host is managed >>>>>> >> - provision method is "build" and not "image" >>>>>> >> - host has operating system set >>>>>> >> - host has pxe loader flag present (not set to blank or None) >>>>>> >> - host has one provisioning NIC with valid MAC address >>>>>> >> - a subnet is associated with the provisioning NIC >>>>>> >> - the subnet has TFTP feature turned on >>>>>> >> >>>>>> >> Visit a host which failed provisioning and do this checklist >>>>>> please. >>>>>> >> >>>>>> >> LZ >>>>>> >> >>>>>> >> >>>>>> > >>>>>> >>>>>> >>>>>> >>>>>> -- >>>>>> Later, >>>>>> Lukas @lzap Zapletal >>>>>> >>>>> >>>>> >>>>> >>>>> -- >>>>> >>>>> *Jacek Mierzwa* | Systems Integration Engineer >>>>> >>>>> Platform Management Division >>>>> >>>>> >>>>> >>>>> >>>> >>>> >>>> -- >>>> >>>> *Jacek Mierzwa* | Systems Integration Engineer >>>> >>>> Platform Management Division >>>> >>>> >>>> >>>> >>> >>> >>> -- >>> Later, >>> Lukas @lzap Zapletal >>> >> > > > -- > Later, > Lukas @lzap Zapletal >

I have tested auto-provisioning in 1.15 RC1.
Now it also matters if hostname pattern is used in discovery rule.

No hostname in discovery rule:

  • auto-provision does NOT create PXE file
  • manually select 'Build' on auto-provisioned host = PXE file created!
  • manually select 'Rebuild config' on auto-privisioned host = nothing

Hostname pattern used in discovery rule:

  • auto-provision does NOT create PXE file
  • manually select 'Build' on auto-provisioned host = no PXE file + hostname
    reverted to default (macXXXXXXXXXX)
  • manually select 'Rebuild config' on auto-privisioned host = no PXE file +
    hostname reverted to default (macXXXXXXXXXX)
  • after the hostname is reverted to default:
    • manually select 'Build' on host = no PXE file
    • manually select 'Rebuild config' on host = PXE file created!

I think this goes beyond tftp.rb :S

··· On Tue, Apr 25, 2017 at 6:40 PM, Chad Schroeder < chads.finishing.strong@gmail.com> wrote:

Lukas,

Hope this helps:

On initial discovery, the results of tftp_ready? are:
host.nil: false
host.managed: false

Clicking “Auto Provision” on the discovered host in the "Discovered Hosts"
menu:
host.nil: false
host.managed: false

Clicking “Edit” on the host in “All Hosts” menu and then clicking submit:
host.nil: false
host.managed: true
managed: true
provision: true
host: mac00224d4fb56a.sub.domain.net
host.operatingsystem: CentOS 7.3.1611
host.pxe_loader.present: true
pxe_build?: true
SETTINGS[:unattended]: true

Chad

On Friday, April 21, 2017 at 8:13:18 AM UTC-5, Lukas Zapletal wrote:

Ok thanks, I can see that either TFTP nor DHCP steps are not getting
orchestrated at all. I suspect that this returns false:

https://github.com/theforeman/foreman/blob/develop/app/model
s/concerns/orchestration/tftp.rb#L21

Maybe if you are able to break up the tftp_ready? method into multiple
lines and do some debug logger outputs of all individual statements in
there to see which does not trigger TFTP orchestration.

Strange is we should see DHCP orchestration but that does not happen as
well. Are NICs created correctly? Is there a subnet set?

Unfortunately I have engagement at customer site for whole week, I will
carry on the week after. We need to solve this.

On Wed, Apr 19, 2017 at 4:58 PM, Chad Schroeder <chads.finis...@gmail.com >> > wrote:

I’m not sure I follow what your asking for Lukas.

On Wednesday, April 19, 2017 at 8:50:21 AM UTC-5, Lukas Zapletal wrote:

Jacek, I apologize but what I meant was:

http://projects.theforeman.org/projects/foreman/wiki/Trouble
shooting#Enable-detailed-SQL-logger-for-orchestration-messages

Chad, it looks like setting (a fake) domain did not help to Jacek, can
you try it? Did it help in your case? Associate Subnet with a Domain and
then set it in the Hostgroup.

LZ

On Wed, Apr 19, 2017 at 2:51 PM, Jacek Mierzwa jmie...@lbisa.com >>>> wrote:

And here is Foreman app debug-level log from 'successful’
auto-provision (no PXE file appears).

On Wed, Apr 19, 2017 at 2:13 PM, Jacek Mierzwa jmie...@lbisa.com >>>>> wrote:

Here’s the SQL debug log from ‘successful’ auto-provision (no PXE
file appears).
Please find attached.

Thanks/Regards

On Wed, Apr 19, 2017 at 1:21 PM, Lukas Zapletal lz...@redhat.com >>>>>> wrote:

Ok I finally reproduced.

When domain is blank, autoprovisioning fails for no apparent reason,
logs are empty, something fails during orchestration and hosts are
getting discovered again (which fails since managed host already
exists).

Bug #19313: Auto-provisioning does not orchestrate TFTP - Discovery - Foreman

I will do my best to fix it this week, but I am on travel the week
after, crossing my fingers.

LZ

On Thu, Apr 13, 2017 at 4:28 PM, Garreat jmie...@fgtsa.com wrote:

I experience this issue.
After clicking ‘auto-provisioning’ on a discovered host, the host
entry is
created, the host reboots - but only to enter Foreman Discovery
Image PXE
loop.
My TFTP proxy is in healthy status as I can recreate PXE default
no prob.

Now answering your checklist:

  • host is managed - yes - OK
  • provision method is “build” and not “image” - how to check this?
    I can’t
    see the ‘build mode’ checkbox for the newly created host
  • host has operating system set - yes (inherited from host group)
  • OK
  • host has pxe loader flag present (not set to blank or None) -
    how to check
    this?
  • host has one provisioning NIC with valid MAC address - yes it
    does - OK
  • a subnet is associated with the provisioning NIC - it is, but
    it’s a
    subnet different than the one declared in machine’s host group
  • the subnet has TFTP feature turned on - it does, and it’s the
    same TFTP
    proxy as in the subnet that I wanted

Also, the ‘domain’ is blank for the fresh created host.
The OS assigned to this host group has a valid PXElinux template
selected.

Assume I’m not making any manual changes:

  • ‘Build host’ does nothing
  • ‘Rebuild config’ creates a PXE mac-template on TFTP immediatly

facter -j output attached

Thanks / Regards / Greetings

W dniu wtorek, 11 kwietnia 2017 10:28:17 UTC+2 użytkownik Lukas
Zapletal
napisał:

TFTP orchestration is not being triggered. It can be only
performed

when all of these conditions are met:

  • host is managed
  • provision method is “build” and not “image”
  • host has operating system set
  • host has pxe loader flag present (not set to blank or None)
  • host has one provisioning NIC with valid MAC address
  • a subnet is associated with the provisioning NIC
  • the subnet has TFTP feature turned on

Visit a host which failed provisioning and do this checklist
please.

LZ


Later,
Lukas @lzap Zapletal

Jacek Mierzwa | Systems Integration Engineer

Platform Management Division

Jacek Mierzwa | Systems Integration Engineer

Platform Management Division


Later,
Lukas @lzap Zapletal


Later,
Lukas @lzap Zapletal

Jacek Mierzwa | Systems Integration Engineer

Platform Management Division

Jacek, for 1.15 there is another bug for autoprovisioning that has been
fixed in RC2:

http://projects.theforeman.org/issues/19409

Try with RC2 please. Anyway, one questions for all of you - how does
Foreman recognize your NICs after host is discovered?

Can you make screenshot of recognized NICs in the UI (discovered host
detail page)? Interested in which interface is set as primary/provisioning.

Also which subnet has been detected? Does it match primary/provisioning
NIC? Is TFTP associated with this subnet?

What version of the FDI (image) do you use? If this is a regression can you
try with older version?

Initially I thought it's caused by domain but that was wrong assumption.

··· On Fri, Apr 28, 2017 at 12:27 PM, Jacek Mierzwa wrote:

I have tested auto-provisioning in 1.15 RC1.
Now it also matters if hostname pattern is used in discovery rule.

No hostname in discovery rule:

  • auto-provision does NOT create PXE file
  • manually select ‘Build’ on auto-provisioned host = PXE file created!
  • manually select ‘Rebuild config’ on auto-privisioned host = nothing

Hostname pattern used in discovery rule:

  • auto-provision does NOT create PXE file
  • manually select ‘Build’ on auto-provisioned host = no PXE file +
    hostname reverted to default (macXXXXXXXXXX)
  • manually select ‘Rebuild config’ on auto-privisioned host = no PXE file
  • hostname reverted to default (macXXXXXXXXXX)
  • after the hostname is reverted to default:
    • manually select ‘Build’ on host = no PXE file
    • manually select ‘Rebuild config’ on host = PXE file created!

I think this goes beyond tftp.rb :S

On Tue, Apr 25, 2017 at 6:40 PM, Chad Schroeder < > chads.finishing.strong@gmail.com> wrote:

Lukas,

Hope this helps:

On initial discovery, the results of tftp_ready? are:
host.nil: false
host.managed: false

Clicking “Auto Provision” on the discovered host in the “Discovered
Hosts” menu:
host.nil: false
host.managed: false

Clicking “Edit” on the host in “All Hosts” menu and then clicking submit:
host.nil: false
host.managed: true
managed: true
provision: true
host: mac00224d4fb56a.sub.domain.net
host.operatingsystem: CentOS 7.3.1611
host.pxe_loader.present: true
pxe_build?: true
SETTINGS[:unattended]: true

Chad

On Friday, April 21, 2017 at 8:13:18 AM UTC-5, Lukas Zapletal wrote:

Ok thanks, I can see that either TFTP nor DHCP steps are not getting
orchestrated at all. I suspect that this returns false:

https://github.com/theforeman/foreman/blob/develop/app/model
s/concerns/orchestration/tftp.rb#L21

Maybe if you are able to break up the tftp_ready? method into multiple
lines and do some debug logger outputs of all individual statements in
there to see which does not trigger TFTP orchestration.

Strange is we should see DHCP orchestration but that does not happen as
well. Are NICs created correctly? Is there a subnet set?

Unfortunately I have engagement at customer site for whole week, I will
carry on the week after. We need to solve this.

On Wed, Apr 19, 2017 at 4:58 PM, Chad Schroeder < >>> chads.finis...@gmail.com> wrote:

I’m not sure I follow what your asking for Lukas.

On Wednesday, April 19, 2017 at 8:50:21 AM UTC-5, Lukas Zapletal wrote:

Jacek, I apologize but what I meant was:

http://projects.theforeman.org/projects/foreman/wiki/Trouble
shooting#Enable-detailed-SQL-logger-for-orchestration-messages

Chad, it looks like setting (a fake) domain did not help to Jacek, can
you try it? Did it help in your case? Associate Subnet with a Domain and
then set it in the Hostgroup.

LZ

On Wed, Apr 19, 2017 at 2:51 PM, Jacek Mierzwa jmie...@lbisa.com >>>>> wrote:

And here is Foreman app debug-level log from 'successful’
auto-provision (no PXE file appears).

On Wed, Apr 19, 2017 at 2:13 PM, Jacek Mierzwa jmie...@lbisa.com >>>>>> wrote:

Here’s the SQL debug log from ‘successful’ auto-provision (no PXE
file appears).
Please find attached.

Thanks/Regards

On Wed, Apr 19, 2017 at 1:21 PM, Lukas Zapletal lz...@redhat.com >>>>>>> wrote:

Ok I finally reproduced.

When domain is blank, autoprovisioning fails for no apparent reason,
logs are empty, something fails during orchestration and hosts are
getting discovered again (which fails since managed host already
exists).

Bug #19313: Auto-provisioning does not orchestrate TFTP - Discovery - Foreman

I will do my best to fix it this week, but I am on travel the week
after, crossing my fingers.

LZ

On Thu, Apr 13, 2017 at 4:28 PM, Garreat jmie...@fgtsa.com wrote:

I experience this issue.
After clicking ‘auto-provisioning’ on a discovered host, the host
entry is
created, the host reboots - but only to enter Foreman Discovery
Image PXE
loop.
My TFTP proxy is in healthy status as I can recreate PXE default
no prob.

Now answering your checklist:

  • host is managed - yes - OK
  • provision method is “build” and not “image” - how to check
    this? I can’t
    see the ‘build mode’ checkbox for the newly created host
  • host has operating system set - yes (inherited from host group)
  • OK
  • host has pxe loader flag present (not set to blank or None) -
    how to check
    this?
  • host has one provisioning NIC with valid MAC address - yes it
    does - OK
  • a subnet is associated with the provisioning NIC - it is, but
    it’s a
    subnet different than the one declared in machine’s host group
  • the subnet has TFTP feature turned on - it does, and it’s the
    same TFTP
    proxy as in the subnet that I wanted

Also, the ‘domain’ is blank for the fresh created host.
The OS assigned to this host group has a valid PXElinux template
selected.

Assume I’m not making any manual changes:

  • ‘Build host’ does nothing
  • ‘Rebuild config’ creates a PXE mac-template on TFTP immediatly

facter -j output attached

Thanks / Regards / Greetings

W dniu wtorek, 11 kwietnia 2017 10:28:17 UTC+2 użytkownik Lukas
Zapletal
napisał:

TFTP orchestration is not being triggered. It can be only
performed

when all of these conditions are met:

  • host is managed
  • provision method is “build” and not “image”
  • host has operating system set
  • host has pxe loader flag present (not set to blank or None)
  • host has one provisioning NIC with valid MAC address
  • a subnet is associated with the provisioning NIC
  • the subnet has TFTP feature turned on

Visit a host which failed provisioning and do this checklist
please.

LZ


Later,
Lukas @lzap Zapletal

Jacek Mierzwa | Systems Integration Engineer

Platform Management Division

Jacek Mierzwa | Systems Integration Engineer

Platform Management Division


Later,
Lukas @lzap Zapletal


Later,
Lukas @lzap Zapletal

Jacek Mierzwa | Systems Integration Engineer

Platform Management Division


Later,
Lukas @lzap Zapletal

Nah I cannot reproduce it in my libvirt environment, I guess this has
something to do with IPMI. Could you try to add "ipmi_*" facts into ignored
facts so IPMI NIC is not created during discovery? Does it help?

··· On Wed, May 3, 2017 at 10:54 AM, Lukas Zapletal wrote:

Jacek, for 1.15 there is another bug for autoprovisioning that has been
fixed in RC2:

Bug #19409: Auto provision does not work after taxonomy fix - Discovery - Foreman

Try with RC2 please. Anyway, one questions for all of you - how does
Foreman recognize your NICs after host is discovered?

Can you make screenshot of recognized NICs in the UI (discovered host
detail page)? Interested in which interface is set as primary/provisioning.

Also which subnet has been detected? Does it match primary/provisioning
NIC? Is TFTP associated with this subnet?

What version of the FDI (image) do you use? If this is a regression can
you try with older version?

Initially I thought it’s caused by domain but that was wrong assumption.

On Fri, Apr 28, 2017 at 12:27 PM, Jacek Mierzwa jmierzwa@lbisa.com > wrote:

I have tested auto-provisioning in 1.15 RC1.
Now it also matters if hostname pattern is used in discovery rule.

No hostname in discovery rule:

  • auto-provision does NOT create PXE file
  • manually select ‘Build’ on auto-provisioned host = PXE file created!
  • manually select ‘Rebuild config’ on auto-privisioned host = nothing

Hostname pattern used in discovery rule:

  • auto-provision does NOT create PXE file
  • manually select ‘Build’ on auto-provisioned host = no PXE file +
    hostname reverted to default (macXXXXXXXXXX)
  • manually select ‘Rebuild config’ on auto-privisioned host = no PXE file
  • hostname reverted to default (macXXXXXXXXXX)
  • after the hostname is reverted to default:
    • manually select ‘Build’ on host = no PXE file
    • manually select ‘Rebuild config’ on host = PXE file created!

I think this goes beyond tftp.rb :S

On Tue, Apr 25, 2017 at 6:40 PM, Chad Schroeder < >> chads.finishing.strong@gmail.com> wrote:

Lukas,

Hope this helps:

On initial discovery, the results of tftp_ready? are:
host.nil: false
host.managed: false

Clicking “Auto Provision” on the discovered host in the “Discovered
Hosts” menu:
host.nil: false
host.managed: false

Clicking “Edit” on the host in “All Hosts” menu and then clicking submit:
host.nil: false
host.managed: true
managed: true
provision: true
host: mac00224d4fb56a.sub.domain.net
host.operatingsystem: CentOS 7.3.1611
host.pxe_loader.present: true
pxe_build?: true
SETTINGS[:unattended]: true

Chad

On Friday, April 21, 2017 at 8:13:18 AM UTC-5, Lukas Zapletal wrote:

Ok thanks, I can see that either TFTP nor DHCP steps are not getting
orchestrated at all. I suspect that this returns false:

https://github.com/theforeman/foreman/blob/develop/app/model
s/concerns/orchestration/tftp.rb#L21

Maybe if you are able to break up the tftp_ready? method into multiple
lines and do some debug logger outputs of all individual statements in
there to see which does not trigger TFTP orchestration.

Strange is we should see DHCP orchestration but that does not happen as
well. Are NICs created correctly? Is there a subnet set?

Unfortunately I have engagement at customer site for whole week, I will
carry on the week after. We need to solve this.

On Wed, Apr 19, 2017 at 4:58 PM, Chad Schroeder < >>>> chads.finis...@gmail.com> wrote:

I’m not sure I follow what your asking for Lukas.

On Wednesday, April 19, 2017 at 8:50:21 AM UTC-5, Lukas Zapletal wrote:

Jacek, I apologize but what I meant was:

http://projects.theforeman.org/projects/foreman/wiki/Trouble
shooting#Enable-detailed-SQL-logger-for-orchestration-messages

Chad, it looks like setting (a fake) domain did not help to Jacek,
can you try it? Did it help in your case? Associate Subnet with a Domain
and then set it in the Hostgroup.

LZ

On Wed, Apr 19, 2017 at 2:51 PM, Jacek Mierzwa jmie...@lbisa.com >>>>>> wrote:

And here is Foreman app debug-level log from 'successful’
auto-provision (no PXE file appears).

On Wed, Apr 19, 2017 at 2:13 PM, Jacek Mierzwa jmie...@lbisa.com >>>>>>> wrote:

Here’s the SQL debug log from ‘successful’ auto-provision (no PXE
file appears).
Please find attached.

Thanks/Regards

On Wed, Apr 19, 2017 at 1:21 PM, Lukas Zapletal lz...@redhat.com >>>>>>>> wrote:

Ok I finally reproduced.

When domain is blank, autoprovisioning fails for no apparent
reason,
logs are empty, something fails during orchestration and hosts are
getting discovered again (which fails since managed host already
exists).

Bug #19313: Auto-provisioning does not orchestrate TFTP - Discovery - Foreman

I will do my best to fix it this week, but I am on travel the week
after, crossing my fingers.

LZ

On Thu, Apr 13, 2017 at 4:28 PM, Garreat jmie...@fgtsa.com >>>>>>>>> wrote:

I experience this issue.
After clicking ‘auto-provisioning’ on a discovered host, the
host entry is
created, the host reboots - but only to enter Foreman Discovery
Image PXE
loop.
My TFTP proxy is in healthy status as I can recreate PXE default
no prob.

Now answering your checklist:

  • host is managed - yes - OK
  • provision method is “build” and not “image” - how to check
    this? I can’t
    see the ‘build mode’ checkbox for the newly created host
  • host has operating system set - yes (inherited from host
    group) - OK
  • host has pxe loader flag present (not set to blank or None) -
    how to check
    this?
  • host has one provisioning NIC with valid MAC address - yes it
    does - OK
  • a subnet is associated with the provisioning NIC - it is, but
    it’s a
    subnet different than the one declared in machine’s host group
  • the subnet has TFTP feature turned on - it does, and it’s the
    same TFTP
    proxy as in the subnet that I wanted

Also, the ‘domain’ is blank for the fresh created host.
The OS assigned to this host group has a valid PXElinux template
selected.

Assume I’m not making any manual changes:

  • ‘Build host’ does nothing
  • ‘Rebuild config’ creates a PXE mac-template on TFTP immediatly

facter -j output attached

Thanks / Regards / Greetings

W dniu wtorek, 11 kwietnia 2017 10:28:17 UTC+2 użytkownik Lukas
Zapletal
napisał:

TFTP orchestration is not being triggered. It can be only
performed

when all of these conditions are met:

  • host is managed
  • provision method is “build” and not “image”
  • host has operating system set
  • host has pxe loader flag present (not set to blank or None)
  • host has one provisioning NIC with valid MAC address
  • a subnet is associated with the provisioning NIC
  • the subnet has TFTP feature turned on

Visit a host which failed provisioning and do this checklist
please.

LZ


Later,
Lukas @lzap Zapletal

Jacek Mierzwa | Systems Integration Engineer

Platform Management Division

Jacek Mierzwa | Systems Integration Engineer

Platform Management Division


Later,
Lukas @lzap Zapletal


Later,
Lukas @lzap Zapletal

Jacek Mierzwa | Systems Integration Engineer

Platform Management Division


Later,
Lukas @lzap Zapletal


Later,
Lukas @lzap Zapletal

Just tested on 1.15 RC2. Current state:

Hostname pattern used in discovery rule:

  • auto-provision does NOT create PXE file
  • manually select 'Build' on auto-provisioned host = no PXE file + hostname
    reverted to default (macXXXXXXXXXX)
  • manually select 'Rebuild config' on auto-privisioned host = no PXE file +
    hostname NOT reverted to default (macXXXXXXXXXX) <— only change here
    (bolded)
  • after the hostname is reverted to default:
    • manually select 'Build' on host = no PXE file
    • manually select 'Rebuild config' on host = PXE file created!

Per your screenshot request:

··· On Wed, May 3, 2017 at 11:07 AM, Lukas Zapletal wrote:

Nah I cannot reproduce it in my libvirt environment, I guess this has
something to do with IPMI. Could you try to add “ipmi_*” facts into ignored
facts so IPMI NIC is not created during discovery? Does it help?

On Wed, May 3, 2017 at 10:54 AM, Lukas Zapletal lzap@redhat.com wrote:

Jacek, for 1.15 there is another bug for autoprovisioning that has been
fixed in RC2:

Bug #19409: Auto provision does not work after taxonomy fix - Discovery - Foreman

Try with RC2 please. Anyway, one questions for all of you - how does
Foreman recognize your NICs after host is discovered?

Can you make screenshot of recognized NICs in the UI (discovered host
detail page)? Interested in which interface is set as primary/provisioning.

Also which subnet has been detected? Does it match primary/provisioning
NIC? Is TFTP associated with this subnet?

What version of the FDI (image) do you use? If this is a regression can
you try with older version?

Initially I thought it’s caused by domain but that was wrong assumption.

On Fri, Apr 28, 2017 at 12:27 PM, Jacek Mierzwa jmierzwa@lbisa.com >> wrote:

I have tested auto-provisioning in 1.15 RC1.
Now it also matters if hostname pattern is used in discovery rule.

No hostname in discovery rule:

  • auto-provision does NOT create PXE file
  • manually select ‘Build’ on auto-provisioned host = PXE file created!
  • manually select ‘Rebuild config’ on auto-privisioned host = nothing

Hostname pattern used in discovery rule:

  • auto-provision does NOT create PXE file
  • manually select ‘Build’ on auto-provisioned host = no PXE file +
    hostname reverted to default (macXXXXXXXXXX)
  • manually select ‘Rebuild config’ on auto-privisioned host = no PXE
    file + hostname reverted to default (macXXXXXXXXXX)
  • after the hostname is reverted to default:
    • manually select ‘Build’ on host = no PXE file
    • manually select ‘Rebuild config’ on host = PXE file created!

I think this goes beyond tftp.rb :S

On Tue, Apr 25, 2017 at 6:40 PM, Chad Schroeder < >>> chads.finishing.strong@gmail.com> wrote:

Lukas,

Hope this helps:

On initial discovery, the results of tftp_ready? are:
host.nil: false
host.managed: false

Clicking “Auto Provision” on the discovered host in the “Discovered
Hosts” menu:
host.nil: false
host.managed: false

Clicking “Edit” on the host in “All Hosts” menu and then clicking
submit:
host.nil: false
host.managed: true
managed: true
provision: true
host: mac00224d4fb56a.sub.domain.net
host.operatingsystem: CentOS 7.3.1611
host.pxe_loader.present: true
pxe_build?: true
SETTINGS[:unattended]: true

Chad

On Friday, April 21, 2017 at 8:13:18 AM UTC-5, Lukas Zapletal wrote:

Ok thanks, I can see that either TFTP nor DHCP steps are not getting
orchestrated at all. I suspect that this returns false:

https://github.com/theforeman/foreman/blob/develop/app/model
s/concerns/orchestration/tftp.rb#L21

Maybe if you are able to break up the tftp_ready? method into multiple
lines and do some debug logger outputs of all individual statements in
there to see which does not trigger TFTP orchestration.

Strange is we should see DHCP orchestration but that does not happen
as well. Are NICs created correctly? Is there a subnet set?

Unfortunately I have engagement at customer site for whole week, I
will carry on the week after. We need to solve this.

On Wed, Apr 19, 2017 at 4:58 PM, Chad Schroeder < >>>>> chads.finis...@gmail.com> wrote:

I’m not sure I follow what your asking for Lukas.

On Wednesday, April 19, 2017 at 8:50:21 AM UTC-5, Lukas Zapletal >>>>>> wrote:

Jacek, I apologize but what I meant was:

http://projects.theforeman.org/projects/foreman/wiki/Trouble
shooting#Enable-detailed-SQL-logger-for-orchestration-messages

Chad, it looks like setting (a fake) domain did not help to Jacek,
can you try it? Did it help in your case? Associate Subnet with a Domain
and then set it in the Hostgroup.

LZ

On Wed, Apr 19, 2017 at 2:51 PM, Jacek Mierzwa jmie...@lbisa.com >>>>>>> wrote:

And here is Foreman app debug-level log from 'successful’
auto-provision (no PXE file appears).

On Wed, Apr 19, 2017 at 2:13 PM, Jacek Mierzwa jmie...@lbisa.com >>>>>>>> wrote:

Here’s the SQL debug log from ‘successful’ auto-provision (no PXE
file appears).
Please find attached.

Thanks/Regards

On Wed, Apr 19, 2017 at 1:21 PM, Lukas Zapletal lz...@redhat.com >>>>>>>>> wrote:

Ok I finally reproduced.

When domain is blank, autoprovisioning fails for no apparent
reason,
logs are empty, something fails during orchestration and hosts are
getting discovered again (which fails since managed host already
exists).

Bug #19313: Auto-provisioning does not orchestrate TFTP - Discovery - Foreman

I will do my best to fix it this week, but I am on travel the week
after, crossing my fingers.

LZ

On Thu, Apr 13, 2017 at 4:28 PM, Garreat jmie...@fgtsa.com >>>>>>>>>> wrote:

I experience this issue.
After clicking ‘auto-provisioning’ on a discovered host, the
host entry is
created, the host reboots - but only to enter Foreman Discovery
Image PXE
loop.
My TFTP proxy is in healthy status as I can recreate PXE
default no prob.

Now answering your checklist:

  • host is managed - yes - OK
  • provision method is “build” and not “image” - how to check
    this? I can’t
    see the ‘build mode’ checkbox for the newly created host
  • host has operating system set - yes (inherited from host
    group) - OK
  • host has pxe loader flag present (not set to blank or None) -
    how to check
    this?
  • host has one provisioning NIC with valid MAC address - yes it
    does - OK
  • a subnet is associated with the provisioning NIC - it is, but
    it’s a
    subnet different than the one declared in machine’s host group
  • the subnet has TFTP feature turned on - it does, and it’s the
    same TFTP
    proxy as in the subnet that I wanted

Also, the ‘domain’ is blank for the fresh created host.
The OS assigned to this host group has a valid PXElinux
template selected.

Assume I’m not making any manual changes:

  • ‘Build host’ does nothing
  • ‘Rebuild config’ creates a PXE mac-template on TFTP immediatly

facter -j output attached

Thanks / Regards / Greetings

W dniu wtorek, 11 kwietnia 2017 10:28:17 UTC+2 użytkownik Lukas
Zapletal
napisał:

TFTP orchestration is not being triggered. It can be only
performed

when all of these conditions are met:

  • host is managed
  • provision method is “build” and not “image”
  • host has operating system set
  • host has pxe loader flag present (not set to blank or None)
  • host has one provisioning NIC with valid MAC address
  • a subnet is associated with the provisioning NIC
  • the subnet has TFTP feature turned on

Visit a host which failed provisioning and do this checklist
please.

LZ


Later,
Lukas @lzap Zapletal

Jacek Mierzwa | Systems Integration Engineer

Platform Management Division

Jacek Mierzwa | Systems Integration Engineer

Platform Management Division


Later,
Lukas @lzap Zapletal


Later,
Lukas @lzap Zapletal

Jacek Mierzwa | Systems Integration Engineer

Platform Management Division


Later,
Lukas @lzap Zapletal


Later,
Lukas @lzap Zapletal

Jacek Mierzwa | Systems Integration Engineer

Platform Management Division

Any progress to report Lukas?

··· On Wednesday, May 3, 2017 at 4:07:46 AM UTC-5, Lukas Zapletal wrote: > > Nah I cannot reproduce it in my libvirt environment, I guess this has > something to do with IPMI. Could you try to add "ipmi_*" facts into ignored > facts so IPMI NIC is not created during discovery? Does it help? > > On Wed, May 3, 2017 at 10:54 AM, Lukas Zapletal > wrote: > >> Jacek, for 1.15 there is another bug for autoprovisioning that has been >> fixed in RC2: >> >> http://projects.theforeman.org/issues/19409 >> >> Try with RC2 please. Anyway, one questions for all of you - how does >> Foreman recognize your NICs after host is discovered? >> >> Can you make screenshot of recognized NICs in the UI (discovered host >> detail page)? Interested in which interface is set as primary/provisioning. >> >> Also which subnet has been detected? Does it match primary/provisioning >> NIC? Is TFTP associated with this subnet? >> >> What version of the FDI (image) do you use? If this is a regression can >> you try with older version? >> >> Initially I thought it's caused by domain but that was wrong assumption. >> >> On Fri, Apr 28, 2017 at 12:27 PM, Jacek Mierzwa > > wrote: >> >>> I have tested auto-provisioning in 1.15 RC1. >>> Now it also matters if hostname pattern is used in discovery rule. >>> >>> No hostname in discovery rule: >>> - auto-provision does NOT create PXE file >>> - manually select 'Build' on auto-provisioned host = PXE file created! >>> - manually select 'Rebuild config' on auto-privisioned host = nothing >>> >>> Hostname pattern used in discovery rule: >>> - auto-provision does NOT create PXE file >>> - manually select 'Build' on auto-provisioned host = no PXE file + >>> hostname reverted to default (macXXXXXXXXXX) >>> - manually select 'Rebuild config' on auto-privisioned host = no PXE >>> file + hostname reverted to default (macXXXXXXXXXX) >>> - after the hostname is reverted to default: >>> - manually select 'Build' on host = no PXE file >>> - manually select 'Rebuild config' on host = PXE file created! >>> >>> >>> I think this goes beyond tftp.rb :S >>> >>> On Tue, Apr 25, 2017 at 6:40 PM, Chad Schroeder < >>> chads.finis...@gmail.com > wrote: >>> >>>> Lukas, >>>> >>>> Hope this helps: >>>> >>>> On initial discovery, the results of tftp_ready? are: >>>> host.nil: false >>>> host.managed: false >>>> >>>> Clicking "Auto Provision" on the discovered host in the "Discovered >>>> Hosts" menu: >>>> host.nil: false >>>> host.managed: false >>>> >>>> Clicking "Edit" on the host in "All Hosts" menu and then clicking >>>> submit: >>>> host.nil: false >>>> host.managed: true >>>> managed: true >>>> provision: true >>>> host: mac00224d4fb56a.sub.domain.net >>>> host.operatingsystem: CentOS 7.3.1611 >>>> host.pxe_loader.present: true >>>> pxe_build?: true >>>> SETTINGS[:unattended]: true >>>> >>>> Chad >>>> >>>> On Friday, April 21, 2017 at 8:13:18 AM UTC-5, Lukas Zapletal wrote: >>>>> >>>>> Ok thanks, I can see that either TFTP nor DHCP steps are not getting >>>>> orchestrated at all. I suspect that this returns false: >>>>> >>>>> >>>>> https://github.com/theforeman/foreman/blob/develop/app/models/concerns/orchestration/tftp.rb#L21 >>>>> >>>>> Maybe if you are able to break up the tftp_ready? method into multiple >>>>> lines and do some debug logger outputs of all individual statements in >>>>> there to see which does not trigger TFTP orchestration. >>>>> >>>>> Strange is we should see DHCP orchestration but that does not happen >>>>> as well. Are NICs created correctly? Is there a subnet set? >>>>> >>>>> Unfortunately I have engagement at customer site for whole week, I >>>>> will carry on the week after. We need to solve this. >>>>> >>>>> On Wed, Apr 19, 2017 at 4:58 PM, Chad Schroeder < >>>>> chads.finis...@gmail.com> wrote: >>>>> >>>>>> I'm not sure I follow what your asking for Lukas. >>>>>> >>>>>> On Wednesday, April 19, 2017 at 8:50:21 AM UTC-5, Lukas Zapletal >>>>>> wrote: >>>>>>> >>>>>>> Jacek, I apologize but what I meant was: >>>>>>> >>>>>>> >>>>>>> http://projects.theforeman.org/projects/foreman/wiki/Troubleshooting#Enable-detailed-SQL-logger-for-orchestration-messages >>>>>>> >>>>>>> Chad, it looks like setting (a fake) domain did not help to Jacek, >>>>>>> can you try it? Did it help in your case? Associate Subnet with a Domain >>>>>>> and then set it in the Hostgroup. >>>>>>> >>>>>>> LZ >>>>>>> >>>>>>> On Wed, Apr 19, 2017 at 2:51 PM, Jacek Mierzwa >>>>>>> wrote: >>>>>>> >>>>>>>> And here is Foreman app debug-level log from 'successful' >>>>>>>> auto-provision (no PXE file appears). >>>>>>>> >>>>>>>> On Wed, Apr 19, 2017 at 2:13 PM, Jacek Mierzwa >>>>>>>> wrote: >>>>>>>> >>>>>>>>> Here's the SQL debug log from 'successful' auto-provision (no PXE >>>>>>>>> file appears). >>>>>>>>> Please find attached. >>>>>>>>> >>>>>>>>> Thanks/Regards >>>>>>>>> >>>>>>>>> On Wed, Apr 19, 2017 at 1:21 PM, Lukas Zapletal >>>>>>>>> wrote: >>>>>>>>> >>>>>>>>>> Ok I finally reproduced. >>>>>>>>>> >>>>>>>>>> When domain is blank, autoprovisioning fails for no apparent >>>>>>>>>> reason, >>>>>>>>>> logs are empty, something fails during orchestration and hosts are >>>>>>>>>> getting discovered again (which fails since managed host already >>>>>>>>>> exists). >>>>>>>>>> >>>>>>>>>> http://projects.theforeman.org/issues/19313 >>>>>>>>>> >>>>>>>>>> I will do my best to fix it this week, but I am on travel the week >>>>>>>>>> after, crossing my fingers. >>>>>>>>>> >>>>>>>>>> LZ >>>>>>>>>> >>>>>>>>>> On Thu, Apr 13, 2017 at 4:28 PM, Garreat >>>>>>>>>> wrote: >>>>>>>>>> > I experience this issue. >>>>>>>>>> > After clicking 'auto-provisioning' on a discovered host, the >>>>>>>>>> host entry is >>>>>>>>>> > created, the host reboots - but only to enter Foreman Discovery >>>>>>>>>> Image PXE >>>>>>>>>> > loop. >>>>>>>>>> > My TFTP proxy is in healthy status as I can recreate PXE >>>>>>>>>> default no prob. >>>>>>>>>> > >>>>>>>>>> > Now answering your checklist: >>>>>>>>>> > - host is managed - yes - OK >>>>>>>>>> > - provision method is "build" and not "image" - how to check >>>>>>>>>> this? I can't >>>>>>>>>> > see the 'build mode' checkbox for the newly created host >>>>>>>>>> > - host has operating system set - yes (inherited from host >>>>>>>>>> group) - OK >>>>>>>>>> > - host has pxe loader flag present (not set to blank or None) - >>>>>>>>>> how to check >>>>>>>>>> > this? >>>>>>>>>> > - host has one provisioning NIC with valid MAC address - yes it >>>>>>>>>> does - OK >>>>>>>>>> > - a subnet is associated with the provisioning NIC - it is, but >>>>>>>>>> it's a >>>>>>>>>> > subnet different than the one declared in machine's host group >>>>>>>>>> > - the subnet has TFTP feature turned on - it does, and it's the >>>>>>>>>> same TFTP >>>>>>>>>> > proxy as in the subnet that I wanted >>>>>>>>>> > >>>>>>>>>> > Also, the 'domain' is blank for the fresh created host. >>>>>>>>>> > The OS assigned to this host group has a valid PXElinux >>>>>>>>>> template selected. >>>>>>>>>> > >>>>>>>>>> > Assume I'm not making any manual changes: >>>>>>>>>> > - 'Build host' does nothing >>>>>>>>>> > - 'Rebuild config' creates a PXE mac-template on TFTP immediatly >>>>>>>>>> > >>>>>>>>>> > facter -j output attached >>>>>>>>>> > >>>>>>>>>> > Thanks / Regards / Greetings >>>>>>>>>> > >>>>>>>>>> > W dniu wtorek, 11 kwietnia 2017 10:28:17 UTC+2 użytkownik Lukas >>>>>>>>>> Zapletal >>>>>>>>>> > napisał: >>>>>>>>>> >> >>>>>>>>>> >> TFTP orchestration is not being triggered. It can be only >>>>>>>>>> performed >>>>>>>>>> >> when all of these conditions are met: >>>>>>>>>> >> >>>>>>>>>> >> - host is managed >>>>>>>>>> >> - provision method is "build" and not "image" >>>>>>>>>> >> - host has operating system set >>>>>>>>>> >> - host has pxe loader flag present (not set to blank or None) >>>>>>>>>> >> - host has one provisioning NIC with valid MAC address >>>>>>>>>> >> - a subnet is associated with the provisioning NIC >>>>>>>>>> >> - the subnet has TFTP feature turned on >>>>>>>>>> >> >>>>>>>>>> >> Visit a host which failed provisioning and do this checklist >>>>>>>>>> please. >>>>>>>>>> >> >>>>>>>>>> >> LZ >>>>>>>>>> >> >>>>>>>>>> >> >>>>>>>>>> > >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> -- >>>>>>>>>> Later, >>>>>>>>>> Lukas @lzap Zapletal >>>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>>> -- >>>>>>>>> >>>>>>>>> *Jacek Mierzwa* | Systems Integration Engineer >>>>>>>>> >>>>>>>>> Platform Management Division >>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> -- >>>>>>>> >>>>>>>> *Jacek Mierzwa* | Systems Integration Engineer >>>>>>>> >>>>>>>> Platform Management Division >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>> >>>>>>> >>>>>>> -- >>>>>>> Later, >>>>>>> Lukas @lzap Zapletal >>>>>>> >>>>>> >>>>> >>>>> >>>>> -- >>>>> Later, >>>>> Lukas @lzap Zapletal >>>>> >>>> >>> >>> >>> -- >>> >>> *Jacek Mierzwa* | Systems Integration Engineer >>> >>> Platform Management Division >>> >>> >>> >>> >> >> >> -- >> Later, >> Lukas @lzap Zapletal >> > > > > -- > Later, > Lukas @lzap Zapletal >

Just for the record, no IPMI here.

··· On Mon, May 8, 2017 at 3:11 PM, Jacek Mierzwa wrote:

Just tested on 1.15 RC2. Current state:

Hostname pattern used in discovery rule:

  • auto-provision does NOT create PXE file
  • manually select ‘Build’ on auto-provisioned host = no PXE file +
    hostname reverted to default (macXXXXXXXXXX)
  • manually select ‘Rebuild config’ on auto-privisioned host = no PXE file
  • hostname NOT reverted to default (macXXXXXXXXXX) <— only change
    here (bolded)
  • after the hostname is reverted to default:
    • manually select ‘Build’ on host = no PXE file
    • manually select ‘Rebuild config’ on host = PXE file created!

Per your screenshot request:

On Wed, May 3, 2017 at 11:07 AM, Lukas Zapletal lzap@redhat.com wrote:

Nah I cannot reproduce it in my libvirt environment, I guess this has
something to do with IPMI. Could you try to add “ipmi_*” facts into ignored
facts so IPMI NIC is not created during discovery? Does it help?

On Wed, May 3, 2017 at 10:54 AM, Lukas Zapletal lzap@redhat.com wrote:

Jacek, for 1.15 there is another bug for autoprovisioning that has been
fixed in RC2:

Bug #19409: Auto provision does not work after taxonomy fix - Discovery - Foreman

Try with RC2 please. Anyway, one questions for all of you - how does
Foreman recognize your NICs after host is discovered?

Can you make screenshot of recognized NICs in the UI (discovered host
detail page)? Interested in which interface is set as primary/provisioning.

Also which subnet has been detected? Does it match primary/provisioning
NIC? Is TFTP associated with this subnet?

What version of the FDI (image) do you use? If this is a regression can
you try with older version?

Initially I thought it’s caused by domain but that was wrong assumption.

On Fri, Apr 28, 2017 at 12:27 PM, Jacek Mierzwa jmierzwa@lbisa.com >>> wrote:

I have tested auto-provisioning in 1.15 RC1.
Now it also matters if hostname pattern is used in discovery rule.

No hostname in discovery rule:

  • auto-provision does NOT create PXE file
  • manually select ‘Build’ on auto-provisioned host = PXE file created!
  • manually select ‘Rebuild config’ on auto-privisioned host = nothing

Hostname pattern used in discovery rule:

  • auto-provision does NOT create PXE file
  • manually select ‘Build’ on auto-provisioned host = no PXE file +
    hostname reverted to default (macXXXXXXXXXX)
  • manually select ‘Rebuild config’ on auto-privisioned host = no PXE
    file + hostname reverted to default (macXXXXXXXXXX)
  • after the hostname is reverted to default:
    • manually select ‘Build’ on host = no PXE file
    • manually select ‘Rebuild config’ on host = PXE file created!

I think this goes beyond tftp.rb :S

On Tue, Apr 25, 2017 at 6:40 PM, Chad Schroeder < >>>> chads.finishing.strong@gmail.com> wrote:

Lukas,

Hope this helps:

On initial discovery, the results of tftp_ready? are:
host.nil: false
host.managed: false

Clicking “Auto Provision” on the discovered host in the “Discovered
Hosts” menu:
host.nil: false
host.managed: false

Clicking “Edit” on the host in “All Hosts” menu and then clicking
submit:
host.nil: false
host.managed: true
managed: true
provision: true
host: mac00224d4fb56a.sub.domain.net
host.operatingsystem: CentOS 7.3.1611
host.pxe_loader.present: true
pxe_build?: true
SETTINGS[:unattended]: true

Chad

On Friday, April 21, 2017 at 8:13:18 AM UTC-5, Lukas Zapletal wrote:

Ok thanks, I can see that either TFTP nor DHCP steps are not getting
orchestrated at all. I suspect that this returns false:

https://github.com/theforeman/foreman/blob/develop/app/model
s/concerns/orchestration/tftp.rb#L21

Maybe if you are able to break up the tftp_ready? method into
multiple lines and do some debug logger outputs of all individual
statements in there to see which does not trigger TFTP orchestration.

Strange is we should see DHCP orchestration but that does not happen
as well. Are NICs created correctly? Is there a subnet set?

Unfortunately I have engagement at customer site for whole week, I
will carry on the week after. We need to solve this.

On Wed, Apr 19, 2017 at 4:58 PM, Chad Schroeder < >>>>>> chads.finis...@gmail.com> wrote:

I’m not sure I follow what your asking for Lukas.

On Wednesday, April 19, 2017 at 8:50:21 AM UTC-5, Lukas Zapletal >>>>>>> wrote:

Jacek, I apologize but what I meant was:

http://projects.theforeman.org/projects/foreman/wiki/Trouble
shooting#Enable-detailed-SQL-logger-for-orchestration-messages

Chad, it looks like setting (a fake) domain did not help to Jacek,
can you try it? Did it help in your case? Associate Subnet with a Domain
and then set it in the Hostgroup.

LZ

On Wed, Apr 19, 2017 at 2:51 PM, Jacek Mierzwa jmie...@lbisa.com >>>>>>>> wrote:

And here is Foreman app debug-level log from 'successful’
auto-provision (no PXE file appears).

On Wed, Apr 19, 2017 at 2:13 PM, Jacek Mierzwa jmie...@lbisa.com >>>>>>>>> wrote:

Here’s the SQL debug log from ‘successful’ auto-provision (no PXE
file appears).
Please find attached.

Thanks/Regards

On Wed, Apr 19, 2017 at 1:21 PM, Lukas Zapletal <lz...@redhat.com >>>>>>>>>> > wrote:

Ok I finally reproduced.

When domain is blank, autoprovisioning fails for no apparent
reason,
logs are empty, something fails during orchestration and hosts
are
getting discovered again (which fails since managed host already
exists).

Bug #19313: Auto-provisioning does not orchestrate TFTP - Discovery - Foreman

I will do my best to fix it this week, but I am on travel the
week
after, crossing my fingers.

LZ

On Thu, Apr 13, 2017 at 4:28 PM, Garreat jmie...@fgtsa.com >>>>>>>>>>> wrote:

I experience this issue.
After clicking ‘auto-provisioning’ on a discovered host, the
host entry is
created, the host reboots - but only to enter Foreman
Discovery Image PXE
loop.
My TFTP proxy is in healthy status as I can recreate PXE
default no prob.

Now answering your checklist:

  • host is managed - yes - OK
  • provision method is “build” and not “image” - how to check
    this? I can’t
    see the ‘build mode’ checkbox for the newly created host
  • host has operating system set - yes (inherited from host
    group) - OK
  • host has pxe loader flag present (not set to blank or None)
  • how to check

this?

  • host has one provisioning NIC with valid MAC address - yes
    it does - OK
  • a subnet is associated with the provisioning NIC - it is,
    but it’s a
    subnet different than the one declared in machine’s host group
  • the subnet has TFTP feature turned on - it does, and it’s
    the same TFTP
    proxy as in the subnet that I wanted

Also, the ‘domain’ is blank for the fresh created host.
The OS assigned to this host group has a valid PXElinux
template selected.

Assume I’m not making any manual changes:

  • ‘Build host’ does nothing
  • ‘Rebuild config’ creates a PXE mac-template on TFTP
    immediatly

facter -j output attached

Thanks / Regards / Greetings

W dniu wtorek, 11 kwietnia 2017 10:28:17 UTC+2 użytkownik
Lukas Zapletal
napisał:

TFTP orchestration is not being triggered. It can be only
performed

when all of these conditions are met:

  • host is managed
  • provision method is “build” and not “image”
  • host has operating system set
  • host has pxe loader flag present (not set to blank or None)
  • host has one provisioning NIC with valid MAC address
  • a subnet is associated with the provisioning NIC
  • the subnet has TFTP feature turned on

Visit a host which failed provisioning and do this checklist
please.

LZ


Later,
Lukas @lzap Zapletal

Jacek Mierzwa | Systems Integration Engineer

Platform Management Division

Jacek Mierzwa | Systems Integration Engineer

Platform Management Division


Later,
Lukas @lzap Zapletal


Later,
Lukas @lzap Zapletal

Jacek Mierzwa | Systems Integration Engineer

Platform Management Division


Later,
Lukas @lzap Zapletal


Later,
Lukas @lzap Zapletal

Jacek Mierzwa | Systems Integration Engineer

Platform Management Division

Jacek Mierzwa | Systems Integration Engineer

Platform Management Division

Working on it, no ETA but my priority for these days.

LZ

··· On Fri, May 12, 2017 at 2:21 PM, Chad Schroeder < chads.finishing.strong@gmail.com> wrote:

Any progress to report Lukas?

On Wednesday, May 3, 2017 at 4:07:46 AM UTC-5, Lukas Zapletal wrote:

Nah I cannot reproduce it in my libvirt environment, I guess this has
something to do with IPMI. Could you try to add “ipmi_*” facts into ignored
facts so IPMI NIC is not created during discovery? Does it help?

On Wed, May 3, 2017 at 10:54 AM, Lukas Zapletal lz...@redhat.com wrote:

Jacek, for 1.15 there is another bug for autoprovisioning that has been
fixed in RC2:

Bug #19409: Auto provision does not work after taxonomy fix - Discovery - Foreman

Try with RC2 please. Anyway, one questions for all of you - how does
Foreman recognize your NICs after host is discovered?

Can you make screenshot of recognized NICs in the UI (discovered host
detail page)? Interested in which interface is set as primary/provisioning.

Also which subnet has been detected? Does it match primary/provisioning
NIC? Is TFTP associated with this subnet?

What version of the FDI (image) do you use? If this is a regression can
you try with older version?

Initially I thought it’s caused by domain but that was wrong assumption.

On Fri, Apr 28, 2017 at 12:27 PM, Jacek Mierzwa jmie...@lbisa.com >>> wrote:

I have tested auto-provisioning in 1.15 RC1.
Now it also matters if hostname pattern is used in discovery rule.

No hostname in discovery rule:

  • auto-provision does NOT create PXE file
  • manually select ‘Build’ on auto-provisioned host = PXE file created!
  • manually select ‘Rebuild config’ on auto-privisioned host = nothing

Hostname pattern used in discovery rule:

  • auto-provision does NOT create PXE file
  • manually select ‘Build’ on auto-provisioned host = no PXE file +
    hostname reverted to default (macXXXXXXXXXX)
  • manually select ‘Rebuild config’ on auto-privisioned host = no PXE
    file + hostname reverted to default (macXXXXXXXXXX)
  • after the hostname is reverted to default:
    • manually select ‘Build’ on host = no PXE file
    • manually select ‘Rebuild config’ on host = PXE file created!

I think this goes beyond tftp.rb :S

On Tue, Apr 25, 2017 at 6:40 PM, Chad Schroeder < >>>> chads.finis...@gmail.com> wrote:

Lukas,

Hope this helps:

On initial discovery, the results of tftp_ready? are:
host.nil: false
host.managed: false

Clicking “Auto Provision” on the discovered host in the “Discovered
Hosts” menu:
host.nil: false
host.managed: false

Clicking “Edit” on the host in “All Hosts” menu and then clicking
submit:
host.nil: false
host.managed: true
managed: true
provision: true
host: mac00224d4fb56a.sub.domain.net
host.operatingsystem: CentOS 7.3.1611
host.pxe_loader.present: true
pxe_build?: true
SETTINGS[:unattended]: true

Chad

On Friday, April 21, 2017 at 8:13:18 AM UTC-5, Lukas Zapletal wrote:

Ok thanks, I can see that either TFTP nor DHCP steps are not getting
orchestrated at all. I suspect that this returns false:

https://github.com/theforeman/foreman/blob/develop/app/model
s/concerns/orchestration/tftp.rb#L21

Maybe if you are able to break up the tftp_ready? method into
multiple lines and do some debug logger outputs of all individual
statements in there to see which does not trigger TFTP orchestration.

Strange is we should see DHCP orchestration but that does not happen
as well. Are NICs created correctly? Is there a subnet set?

Unfortunately I have engagement at customer site for whole week, I
will carry on the week after. We need to solve this.

On Wed, Apr 19, 2017 at 4:58 PM, Chad Schroeder < >>>>>> chads.finis...@gmail.com> wrote:

I’m not sure I follow what your asking for Lukas.

On Wednesday, April 19, 2017 at 8:50:21 AM UTC-5, Lukas Zapletal >>>>>>> wrote:

Jacek, I apologize but what I meant was:

http://projects.theforeman.org/projects/foreman/wiki/Trouble
shooting#Enable-detailed-SQL-logger-for-orchestration-messages

Chad, it looks like setting (a fake) domain did not help to Jacek,
can you try it? Did it help in your case? Associate Subnet with a Domain
and then set it in the Hostgroup.

LZ

On Wed, Apr 19, 2017 at 2:51 PM, Jacek Mierzwa jmie...@lbisa.com >>>>>>>> wrote:

And here is Foreman app debug-level log from 'successful’
auto-provision (no PXE file appears).

On Wed, Apr 19, 2017 at 2:13 PM, Jacek Mierzwa jmie...@lbisa.com >>>>>>>>> wrote:

Here’s the SQL debug log from ‘successful’ auto-provision (no PXE
file appears).
Please find attached.

Thanks/Regards

On Wed, Apr 19, 2017 at 1:21 PM, Lukas Zapletal <lz...@redhat.com >>>>>>>>>> > wrote:

Ok I finally reproduced.

When domain is blank, autoprovisioning fails for no apparent
reason,
logs are empty, something fails during orchestration and hosts
are
getting discovered again (which fails since managed host already
exists).

Bug #19313: Auto-provisioning does not orchestrate TFTP - Discovery - Foreman

I will do my best to fix it this week, but I am on travel the
week
after, crossing my fingers.

LZ

On Thu, Apr 13, 2017 at 4:28 PM, Garreat jmie...@fgtsa.com >>>>>>>>>>> wrote:

I experience this issue.
After clicking ‘auto-provisioning’ on a discovered host, the
host entry is
created, the host reboots - but only to enter Foreman
Discovery Image PXE
loop.
My TFTP proxy is in healthy status as I can recreate PXE
default no prob.

Now answering your checklist:

  • host is managed - yes - OK
  • provision method is “build” and not “image” - how to check
    this? I can’t
    see the ‘build mode’ checkbox for the newly created host
  • host has operating system set - yes (inherited from host
    group) - OK
  • host has pxe loader flag present (not set to blank or None)
  • how to check

this?

  • host has one provisioning NIC with valid MAC address - yes
    it does - OK
  • a subnet is associated with the provisioning NIC - it is,
    but it’s a
    subnet different than the one declared in machine’s host group
  • the subnet has TFTP feature turned on - it does, and it’s
    the same TFTP
    proxy as in the subnet that I wanted

Also, the ‘domain’ is blank for the fresh created host.
The OS assigned to this host group has a valid PXElinux
template selected.

Assume I’m not making any manual changes:

  • ‘Build host’ does nothing
  • ‘Rebuild config’ creates a PXE mac-template on TFTP
    immediatly

facter -j output attached

Thanks / Regards / Greetings

W dniu wtorek, 11 kwietnia 2017 10:28:17 UTC+2 użytkownik
Lukas Zapletal
napisał:

TFTP orchestration is not being triggered. It can be only
performed

when all of these conditions are met:

  • host is managed
  • provision method is “build” and not “image”
  • host has operating system set
  • host has pxe loader flag present (not set to blank or None)
  • host has one provisioning NIC with valid MAC address
  • a subnet is associated with the provisioning NIC
  • the subnet has TFTP feature turned on

Visit a host which failed provisioning and do this checklist
please.

LZ


Later,
Lukas @lzap Zapletal

Jacek Mierzwa | Systems Integration Engineer

Platform Management Division

Jacek Mierzwa | Systems Integration Engineer

Platform Management Division


Later,
Lukas @lzap Zapletal


Later,
Lukas @lzap Zapletal

Jacek Mierzwa | Systems Integration Engineer

Platform Management Division


Later,
Lukas @lzap Zapletal


Later,
Lukas @lzap Zapletal


Later,
Lukas @lzap Zapletal

Chad,

when a host is discovered, it should be discovered in a subnet. This is
shown on the list of discovered hosts. Do you see those set correctly?

Workaround is to have such a subnet defined so it is assigned during
discovery.

··· On Fri, May 12, 2017 at 2:21 PM, Chad Schroeder < chads.finishing.strong@gmail.com> wrote:

Any progress to report Lukas?

On Wednesday, May 3, 2017 at 4:07:46 AM UTC-5, Lukas Zapletal wrote:

Nah I cannot reproduce it in my libvirt environment, I guess this has
something to do with IPMI. Could you try to add “ipmi_*” facts into ignored
facts so IPMI NIC is not created during discovery? Does it help?

On Wed, May 3, 2017 at 10:54 AM, Lukas Zapletal lz...@redhat.com wrote:

Jacek, for 1.15 there is another bug for autoprovisioning that has been
fixed in RC2:

Bug #19409: Auto provision does not work after taxonomy fix - Discovery - Foreman

Try with RC2 please. Anyway, one questions for all of you - how does
Foreman recognize your NICs after host is discovered?

Can you make screenshot of recognized NICs in the UI (discovered host
detail page)? Interested in which interface is set as primary/provisioning.

Also which subnet has been detected? Does it match primary/provisioning
NIC? Is TFTP associated with this subnet?

What version of the FDI (image) do you use? If this is a regression can
you try with older version?

Initially I thought it’s caused by domain but that was wrong assumption.

On Fri, Apr 28, 2017 at 12:27 PM, Jacek Mierzwa jmie...@lbisa.com >>> wrote:

I have tested auto-provisioning in 1.15 RC1.
Now it also matters if hostname pattern is used in discovery rule.

No hostname in discovery rule:

  • auto-provision does NOT create PXE file
  • manually select ‘Build’ on auto-provisioned host = PXE file created!
  • manually select ‘Rebuild config’ on auto-privisioned host = nothing

Hostname pattern used in discovery rule:

  • auto-provision does NOT create PXE file
  • manually select ‘Build’ on auto-provisioned host = no PXE file +
    hostname reverted to default (macXXXXXXXXXX)
  • manually select ‘Rebuild config’ on auto-privisioned host = no PXE
    file + hostname reverted to default (macXXXXXXXXXX)
  • after the hostname is reverted to default:
    • manually select ‘Build’ on host = no PXE file
    • manually select ‘Rebuild config’ on host = PXE file created!

I think this goes beyond tftp.rb :S

On Tue, Apr 25, 2017 at 6:40 PM, Chad Schroeder < >>>> chads.finis...@gmail.com> wrote:

Lukas,

Hope this helps:

On initial discovery, the results of tftp_ready? are:
host.nil: false
host.managed: false

Clicking “Auto Provision” on the discovered host in the “Discovered
Hosts” menu:
host.nil: false
host.managed: false

Clicking “Edit” on the host in “All Hosts” menu and then clicking
submit:
host.nil: false
host.managed: true
managed: true
provision: true
host: mac00224d4fb56a.sub.domain.net
host.operatingsystem: CentOS 7.3.1611
host.pxe_loader.present: true
pxe_build?: true
SETTINGS[:unattended]: true

Chad

On Friday, April 21, 2017 at 8:13:18 AM UTC-5, Lukas Zapletal wrote:

Ok thanks, I can see that either TFTP nor DHCP steps are not getting
orchestrated at all. I suspect that this returns false:

https://github.com/theforeman/foreman/blob/develop/app/model
s/concerns/orchestration/tftp.rb#L21

Maybe if you are able to break up the tftp_ready? method into
multiple lines and do some debug logger outputs of all individual
statements in there to see which does not trigger TFTP orchestration.

Strange is we should see DHCP orchestration but that does not happen
as well. Are NICs created correctly? Is there a subnet set?

Unfortunately I have engagement at customer site for whole week, I
will carry on the week after. We need to solve this.

On Wed, Apr 19, 2017 at 4:58 PM, Chad Schroeder < >>>>>> chads.finis...@gmail.com> wrote:

I’m not sure I follow what your asking for Lukas.

On Wednesday, April 19, 2017 at 8:50:21 AM UTC-5, Lukas Zapletal >>>>>>> wrote:

Jacek, I apologize but what I meant was:

http://projects.theforeman.org/projects/foreman/wiki/Trouble
shooting#Enable-detailed-SQL-logger-for-orchestration-messages

Chad, it looks like setting (a fake) domain did not help to Jacek,
can you try it? Did it help in your case? Associate Subnet with a Domain
and then set it in the Hostgroup.

LZ

On Wed, Apr 19, 2017 at 2:51 PM, Jacek Mierzwa jmie...@lbisa.com >>>>>>>> wrote:

And here is Foreman app debug-level log from 'successful’
auto-provision (no PXE file appears).

On Wed, Apr 19, 2017 at 2:13 PM, Jacek Mierzwa jmie...@lbisa.com >>>>>>>>> wrote:

Here’s the SQL debug log from ‘successful’ auto-provision (no PXE
file appears).
Please find attached.

Thanks/Regards

On Wed, Apr 19, 2017 at 1:21 PM, Lukas Zapletal <lz...@redhat.com >>>>>>>>>> > wrote:

Ok I finally reproduced.

When domain is blank, autoprovisioning fails for no apparent
reason,
logs are empty, something fails during orchestration and hosts
are
getting discovered again (which fails since managed host already
exists).

Bug #19313: Auto-provisioning does not orchestrate TFTP - Discovery - Foreman

I will do my best to fix it this week, but I am on travel the
week
after, crossing my fingers.

LZ

On Thu, Apr 13, 2017 at 4:28 PM, Garreat jmie...@fgtsa.com >>>>>>>>>>> wrote:

I experience this issue.
After clicking ‘auto-provisioning’ on a discovered host, the
host entry is
created, the host reboots - but only to enter Foreman
Discovery Image PXE
loop.
My TFTP proxy is in healthy status as I can recreate PXE
default no prob.

Now answering your checklist:

  • host is managed - yes - OK
  • provision method is “build” and not “image” - how to check
    this? I can’t
    see the ‘build mode’ checkbox for the newly created host
  • host has operating system set - yes (inherited from host
    group) - OK
  • host has pxe loader flag present (not set to blank or None)
  • how to check

this?

  • host has one provisioning NIC with valid MAC address - yes
    it does - OK
  • a subnet is associated with the provisioning NIC - it is,
    but it’s a
    subnet different than the one declared in machine’s host group
  • the subnet has TFTP feature turned on - it does, and it’s
    the same TFTP
    proxy as in the subnet that I wanted

Also, the ‘domain’ is blank for the fresh created host.
The OS assigned to this host group has a valid PXElinux
template selected.

Assume I’m not making any manual changes:

  • ‘Build host’ does nothing
  • ‘Rebuild config’ creates a PXE mac-template on TFTP
    immediatly

facter -j output attached

Thanks / Regards / Greetings

W dniu wtorek, 11 kwietnia 2017 10:28:17 UTC+2 użytkownik
Lukas Zapletal
napisał:

TFTP orchestration is not being triggered. It can be only
performed

when all of these conditions are met:

  • host is managed
  • provision method is “build” and not “image”
  • host has operating system set
  • host has pxe loader flag present (not set to blank or None)
  • host has one provisioning NIC with valid MAC address
  • a subnet is associated with the provisioning NIC
  • the subnet has TFTP feature turned on

Visit a host which failed provisioning and do this checklist
please.

LZ


Later,
Lukas @lzap Zapletal

Jacek Mierzwa | Systems Integration Engineer

Platform Management Division

Jacek Mierzwa | Systems Integration Engineer

Platform Management Division


Later,
Lukas @lzap Zapletal


Later,
Lukas @lzap Zapletal

Jacek Mierzwa | Systems Integration Engineer

Platform Management Division


Later,
Lukas @lzap Zapletal


Later,
Lukas @lzap Zapletal


Later,
Lukas @lzap Zapletal

FDI image 3.4.0 (4291ca7)

Sorry for multi posts…

··· On Tue, May 9, 2017 at 1:09 PM, Jacek Mierzwa wrote:

Just for the record, no IPMI here.

On Mon, May 8, 2017 at 3:11 PM, Jacek Mierzwa jmierzwa@lbisa.com wrote:

Just tested on 1.15 RC2. Current state:

Hostname pattern used in discovery rule:

  • auto-provision does NOT create PXE file
  • manually select ‘Build’ on auto-provisioned host = no PXE file +
    hostname reverted to default (macXXXXXXXXXX)
  • manually select ‘Rebuild config’ on auto-privisioned host = no PXE file
  • hostname NOT reverted to default (macXXXXXXXXXX) <— only change
    here (bolded)
  • after the hostname is reverted to default:
    • manually select ‘Build’ on host = no PXE file
    • manually select ‘Rebuild config’ on host = PXE file created!

Per your screenshot request:

On Wed, May 3, 2017 at 11:07 AM, Lukas Zapletal lzap@redhat.com wrote:

Nah I cannot reproduce it in my libvirt environment, I guess this has
something to do with IPMI. Could you try to add “ipmi_*” facts into ignored
facts so IPMI NIC is not created during discovery? Does it help?

On Wed, May 3, 2017 at 10:54 AM, Lukas Zapletal lzap@redhat.com wrote:

Jacek, for 1.15 there is another bug for autoprovisioning that has been
fixed in RC2:

Bug #19409: Auto provision does not work after taxonomy fix - Discovery - Foreman

Try with RC2 please. Anyway, one questions for all of you - how does
Foreman recognize your NICs after host is discovered?

Can you make screenshot of recognized NICs in the UI (discovered host
detail page)? Interested in which interface is set as primary/provisioning.

Also which subnet has been detected? Does it match primary/provisioning
NIC? Is TFTP associated with this subnet?

What version of the FDI (image) do you use? If this is a regression can
you try with older version?

Initially I thought it’s caused by domain but that was wrong assumption.

On Fri, Apr 28, 2017 at 12:27 PM, Jacek Mierzwa jmierzwa@lbisa.com >>>> wrote:

I have tested auto-provisioning in 1.15 RC1.
Now it also matters if hostname pattern is used in discovery rule.

No hostname in discovery rule:

  • auto-provision does NOT create PXE file
  • manually select ‘Build’ on auto-provisioned host = PXE file created!
  • manually select ‘Rebuild config’ on auto-privisioned host = nothing

Hostname pattern used in discovery rule:

  • auto-provision does NOT create PXE file
  • manually select ‘Build’ on auto-provisioned host = no PXE file +
    hostname reverted to default (macXXXXXXXXXX)
  • manually select ‘Rebuild config’ on auto-privisioned host = no PXE
    file + hostname reverted to default (macXXXXXXXXXX)
  • after the hostname is reverted to default:
    • manually select ‘Build’ on host = no PXE file
    • manually select ‘Rebuild config’ on host = PXE file created!

I think this goes beyond tftp.rb :S

On Tue, Apr 25, 2017 at 6:40 PM, Chad Schroeder < >>>>> chads.finishing.strong@gmail.com> wrote:

Lukas,

Hope this helps:

On initial discovery, the results of tftp_ready? are:
host.nil: false
host.managed: false

Clicking “Auto Provision” on the discovered host in the “Discovered
Hosts” menu:
host.nil: false
host.managed: false

Clicking “Edit” on the host in “All Hosts” menu and then clicking
submit:
host.nil: false
host.managed: true
managed: true
provision: true
host: mac00224d4fb56a.sub.domain.net
host.operatingsystem: CentOS 7.3.1611
host.pxe_loader.present: true
pxe_build?: true
SETTINGS[:unattended]: true

Chad

On Friday, April 21, 2017 at 8:13:18 AM UTC-5, Lukas Zapletal wrote:

Ok thanks, I can see that either TFTP nor DHCP steps are not getting
orchestrated at all. I suspect that this returns false:

https://github.com/theforeman/foreman/blob/develop/app/model
s/concerns/orchestration/tftp.rb#L21

Maybe if you are able to break up the tftp_ready? method into
multiple lines and do some debug logger outputs of all individual
statements in there to see which does not trigger TFTP orchestration.

Strange is we should see DHCP orchestration but that does not happen
as well. Are NICs created correctly? Is there a subnet set?

Unfortunately I have engagement at customer site for whole week, I
will carry on the week after. We need to solve this.

On Wed, Apr 19, 2017 at 4:58 PM, Chad Schroeder < >>>>>>> chads.finis...@gmail.com> wrote:

I’m not sure I follow what your asking for Lukas.

On Wednesday, April 19, 2017 at 8:50:21 AM UTC-5, Lukas Zapletal >>>>>>>> wrote:

Jacek, I apologize but what I meant was:

http://projects.theforeman.org/projects/foreman/wiki/Trouble
shooting#Enable-detailed-SQL-logger-for-orchestration-messages

Chad, it looks like setting (a fake) domain did not help to Jacek,
can you try it? Did it help in your case? Associate Subnet with a Domain
and then set it in the Hostgroup.

LZ

On Wed, Apr 19, 2017 at 2:51 PM, Jacek Mierzwa jmie...@lbisa.com >>>>>>>>> wrote:

And here is Foreman app debug-level log from 'successful’
auto-provision (no PXE file appears).

On Wed, Apr 19, 2017 at 2:13 PM, Jacek Mierzwa <jmie...@lbisa.com >>>>>>>>>> > wrote:

Here’s the SQL debug log from ‘successful’ auto-provision (no
PXE file appears).
Please find attached.

Thanks/Regards

On Wed, Apr 19, 2017 at 1:21 PM, Lukas Zapletal < >>>>>>>>>>> lz...@redhat.com> wrote:

Ok I finally reproduced.

When domain is blank, autoprovisioning fails for no apparent
reason,
logs are empty, something fails during orchestration and hosts
are
getting discovered again (which fails since managed host already
exists).

Bug #19313: Auto-provisioning does not orchestrate TFTP - Discovery - Foreman

I will do my best to fix it this week, but I am on travel the
week
after, crossing my fingers.

LZ

On Thu, Apr 13, 2017 at 4:28 PM, Garreat jmie...@fgtsa.com >>>>>>>>>>>> wrote:

I experience this issue.
After clicking ‘auto-provisioning’ on a discovered host, the
host entry is
created, the host reboots - but only to enter Foreman
Discovery Image PXE
loop.
My TFTP proxy is in healthy status as I can recreate PXE
default no prob.

Now answering your checklist:

  • host is managed - yes - OK
  • provision method is “build” and not “image” - how to check
    this? I can’t
    see the ‘build mode’ checkbox for the newly created host
  • host has operating system set - yes (inherited from host
    group) - OK
  • host has pxe loader flag present (not set to blank or None)
  • how to check

this?

  • host has one provisioning NIC with valid MAC address - yes
    it does - OK
  • a subnet is associated with the provisioning NIC - it is,
    but it’s a
    subnet different than the one declared in machine’s host group
  • the subnet has TFTP feature turned on - it does, and it’s
    the same TFTP
    proxy as in the subnet that I wanted

Also, the ‘domain’ is blank for the fresh created host.
The OS assigned to this host group has a valid PXElinux
template selected.

Assume I’m not making any manual changes:

  • ‘Build host’ does nothing
  • ‘Rebuild config’ creates a PXE mac-template on TFTP
    immediatly

facter -j output attached

Thanks / Regards / Greetings

W dniu wtorek, 11 kwietnia 2017 10:28:17 UTC+2 użytkownik
Lukas Zapletal
napisał:

TFTP orchestration is not being triggered. It can be only
performed

when all of these conditions are met:

  • host is managed
  • provision method is “build” and not “image”
  • host has operating system set
  • host has pxe loader flag present (not set to blank or None)
  • host has one provisioning NIC with valid MAC address
  • a subnet is associated with the provisioning NIC
  • the subnet has TFTP feature turned on

Visit a host which failed provisioning and do this checklist
please.

LZ


Later,
Lukas @lzap Zapletal

Jacek Mierzwa | Systems Integration Engineer

Platform Management Division

Jacek Mierzwa | Systems Integration Engineer

Platform Management Division


Later,
Lukas @lzap Zapletal


Later,
Lukas @lzap Zapletal

Jacek Mierzwa | Systems Integration Engineer

Platform Management Division


Later,
Lukas @lzap Zapletal


Later,
Lukas @lzap Zapletal

Jacek Mierzwa | Systems Integration Engineer

Platform Management Division

Jacek Mierzwa | Systems Integration Engineer

Platform Management Division

Jacek Mierzwa | Systems Integration Engineer

Platform Management Division

Chad, one more question - what subnet the primary interface of your
discovered node is connected to, what IP address it was assigned and what
subnet have you set in the hostgroup?

These three must match, can you check this?

LZ

··· On Sun, May 14, 2017 at 8:43 PM, Lukas Zapletal wrote:

Chad,

when a host is discovered, it should be discovered in a subnet. This is
shown on the list of discovered hosts. Do you see those set correctly?

Workaround is to have such a subnet defined so it is assigned during
discovery.

On Fri, May 12, 2017 at 2:21 PM, Chad Schroeder < > chads.finishing.strong@gmail.com> wrote:

Any progress to report Lukas?

On Wednesday, May 3, 2017 at 4:07:46 AM UTC-5, Lukas Zapletal wrote:

Nah I cannot reproduce it in my libvirt environment, I guess this has
something to do with IPMI. Could you try to add “ipmi_*” facts into ignored
facts so IPMI NIC is not created during discovery? Does it help?

On Wed, May 3, 2017 at 10:54 AM, Lukas Zapletal lz...@redhat.com >>> wrote:

Jacek, for 1.15 there is another bug for autoprovisioning that has been
fixed in RC2:

Bug #19409: Auto provision does not work after taxonomy fix - Discovery - Foreman

Try with RC2 please. Anyway, one questions for all of you - how does
Foreman recognize your NICs after host is discovered?

Can you make screenshot of recognized NICs in the UI (discovered host
detail page)? Interested in which interface is set as primary/provisioning.

Also which subnet has been detected? Does it match primary/provisioning
NIC? Is TFTP associated with this subnet?

What version of the FDI (image) do you use? If this is a regression can
you try with older version?

Initially I thought it’s caused by domain but that was wrong assumption.

On Fri, Apr 28, 2017 at 12:27 PM, Jacek Mierzwa jmie...@lbisa.com >>>> wrote:

I have tested auto-provisioning in 1.15 RC1.
Now it also matters if hostname pattern is used in discovery rule.

No hostname in discovery rule:

  • auto-provision does NOT create PXE file
  • manually select ‘Build’ on auto-provisioned host = PXE file created!
  • manually select ‘Rebuild config’ on auto-privisioned host = nothing

Hostname pattern used in discovery rule:

  • auto-provision does NOT create PXE file
  • manually select ‘Build’ on auto-provisioned host = no PXE file +
    hostname reverted to default (macXXXXXXXXXX)
  • manually select ‘Rebuild config’ on auto-privisioned host = no PXE
    file + hostname reverted to default (macXXXXXXXXXX)
  • after the hostname is reverted to default:
    • manually select ‘Build’ on host = no PXE file
    • manually select ‘Rebuild config’ on host = PXE file created!

I think this goes beyond tftp.rb :S

On Tue, Apr 25, 2017 at 6:40 PM, Chad Schroeder < >>>>> chads.finis...@gmail.com> wrote:

Lukas,

Hope this helps:

On initial discovery, the results of tftp_ready? are:
host.nil: false
host.managed: false

Clicking “Auto Provision” on the discovered host in the “Discovered
Hosts” menu:
host.nil: false
host.managed: false

Clicking “Edit” on the host in “All Hosts” menu and then clicking
submit:
host.nil: false
host.managed: true
managed: true
provision: true
host: mac00224d4fb56a.sub.domain.net
host.operatingsystem: CentOS 7.3.1611
host.pxe_loader.present: true
pxe_build?: true
SETTINGS[:unattended]: true

Chad

On Friday, April 21, 2017 at 8:13:18 AM UTC-5, Lukas Zapletal wrote:

Ok thanks, I can see that either TFTP nor DHCP steps are not getting
orchestrated at all. I suspect that this returns false:

https://github.com/theforeman/foreman/blob/develop/app/model
s/concerns/orchestration/tftp.rb#L21

Maybe if you are able to break up the tftp_ready? method into
multiple lines and do some debug logger outputs of all individual
statements in there to see which does not trigger TFTP orchestration.

Strange is we should see DHCP orchestration but that does not happen
as well. Are NICs created correctly? Is there a subnet set?

Unfortunately I have engagement at customer site for whole week, I
will carry on the week after. We need to solve this.

On Wed, Apr 19, 2017 at 4:58 PM, Chad Schroeder < >>>>>>> chads.finis...@gmail.com> wrote:

I’m not sure I follow what your asking for Lukas.

On Wednesday, April 19, 2017 at 8:50:21 AM UTC-5, Lukas Zapletal >>>>>>>> wrote:

Jacek, I apologize but what I meant was:

http://projects.theforeman.org/projects/foreman/wiki/Trouble
shooting#Enable-detailed-SQL-logger-for-orchestration-messages

Chad, it looks like setting (a fake) domain did not help to Jacek,
can you try it? Did it help in your case? Associate Subnet with a Domain
and then set it in the Hostgroup.

LZ

On Wed, Apr 19, 2017 at 2:51 PM, Jacek Mierzwa jmie...@lbisa.com >>>>>>>>> wrote:

And here is Foreman app debug-level log from 'successful’
auto-provision (no PXE file appears).

On Wed, Apr 19, 2017 at 2:13 PM, Jacek Mierzwa <jmie...@lbisa.com >>>>>>>>>> > wrote:

Here’s the SQL debug log from ‘successful’ auto-provision (no
PXE file appears).
Please find attached.

Thanks/Regards

On Wed, Apr 19, 2017 at 1:21 PM, Lukas Zapletal < >>>>>>>>>>> lz...@redhat.com> wrote:

Ok I finally reproduced.

When domain is blank, autoprovisioning fails for no apparent
reason,
logs are empty, something fails during orchestration and hosts
are
getting discovered again (which fails since managed host already
exists).

Bug #19313: Auto-provisioning does not orchestrate TFTP - Discovery - Foreman

I will do my best to fix it this week, but I am on travel the
week
after, crossing my fingers.

LZ

On Thu, Apr 13, 2017 at 4:28 PM, Garreat jmie...@fgtsa.com >>>>>>>>>>>> wrote:

I experience this issue.
After clicking ‘auto-provisioning’ on a discovered host, the
host entry is
created, the host reboots - but only to enter Foreman
Discovery Image PXE
loop.
My TFTP proxy is in healthy status as I can recreate PXE
default no prob.

Now answering your checklist:

  • host is managed - yes - OK
  • provision method is “build” and not “image” - how to check
    this? I can’t
    see the ‘build mode’ checkbox for the newly created host
  • host has operating system set - yes (inherited from host
    group) - OK
  • host has pxe loader flag present (not set to blank or None)
  • how to check

this?

  • host has one provisioning NIC with valid MAC address - yes
    it does - OK
  • a subnet is associated with the provisioning NIC - it is,
    but it’s a
    subnet different than the one declared in machine’s host group
  • the subnet has TFTP feature turned on - it does, and it’s
    the same TFTP
    proxy as in the subnet that I wanted

Also, the ‘domain’ is blank for the fresh created host.
The OS assigned to this host group has a valid PXElinux
template selected.

Assume I’m not making any manual changes:

  • ‘Build host’ does nothing
  • ‘Rebuild config’ creates a PXE mac-template on TFTP
    immediatly

facter -j output attached

Thanks / Regards / Greetings

W dniu wtorek, 11 kwietnia 2017 10:28:17 UTC+2 użytkownik
Lukas Zapletal
napisał:

TFTP orchestration is not being triggered. It can be only
performed

when all of these conditions are met:

  • host is managed
  • provision method is “build” and not “image”
  • host has operating system set
  • host has pxe loader flag present (not set to blank or None)
  • host has one provisioning NIC with valid MAC address
  • a subnet is associated with the provisioning NIC
  • the subnet has TFTP feature turned on

Visit a host which failed provisioning and do this checklist
please.

LZ


Later,
Lukas @lzap Zapletal

Jacek Mierzwa | Systems Integration Engineer

Platform Management Division

Jacek Mierzwa | Systems Integration Engineer

Platform Management Division


Later,
Lukas @lzap Zapletal


Later,
Lukas @lzap Zapletal

Jacek Mierzwa | Systems Integration Engineer

Platform Management Division


Later,
Lukas @lzap Zapletal


Later,
Lukas @lzap Zapletal


Later,
Lukas @lzap Zapletal


Later,
Lukas @lzap Zapletal

This is for my case:

  • subnet assigned to the host group

​- discovered host has primary NIC in the subnet (it's the only subnet I
have defined)

  • however, 'subnet' field is indeed clear:

​​

··· On Sun, May 14, 2017 at 10:14 PM, Lukas Zapletal wrote:

Chad, one more question - what subnet the primary interface of your
discovered node is connected to, what IP address it was assigned and what
subnet have you set in the hostgroup?

These three must match, can you check this?

LZ

On Sun, May 14, 2017 at 8:43 PM, Lukas Zapletal lzap@redhat.com wrote:

Chad,

when a host is discovered, it should be discovered in a subnet. This is
shown on the list of discovered hosts. Do you see those set correctly?

Workaround is to have such a subnet defined so it is assigned during
discovery.

On Fri, May 12, 2017 at 2:21 PM, Chad Schroeder < >> chads.finishing.strong@gmail.com> wrote:

Any progress to report Lukas?

On Wednesday, May 3, 2017 at 4:07:46 AM UTC-5, Lukas Zapletal wrote:

Nah I cannot reproduce it in my libvirt environment, I guess this has
something to do with IPMI. Could you try to add “ipmi_*” facts into ignored
facts so IPMI NIC is not created during discovery? Does it help?

On Wed, May 3, 2017 at 10:54 AM, Lukas Zapletal lz...@redhat.com >>>> wrote:

Jacek, for 1.15 there is another bug for autoprovisioning that has
been fixed in RC2:

Bug #19409: Auto provision does not work after taxonomy fix - Discovery - Foreman

Try with RC2 please. Anyway, one questions for all of you - how does
Foreman recognize your NICs after host is discovered?

Can you make screenshot of recognized NICs in the UI (discovered host
detail page)? Interested in which interface is set as primary/provisioning.

Also which subnet has been detected? Does it match
primary/provisioning NIC? Is TFTP associated with this subnet?

What version of the FDI (image) do you use? If this is a regression
can you try with older version?

Initially I thought it’s caused by domain but that was wrong
assumption.

On Fri, Apr 28, 2017 at 12:27 PM, Jacek Mierzwa jmie...@lbisa.com >>>>> wrote:

I have tested auto-provisioning in 1.15 RC1.
Now it also matters if hostname pattern is used in discovery rule.

No hostname in discovery rule:

  • auto-provision does NOT create PXE file
  • manually select ‘Build’ on auto-provisioned host = PXE file created!
  • manually select ‘Rebuild config’ on auto-privisioned host = nothing

Hostname pattern used in discovery rule:

  • auto-provision does NOT create PXE file
  • manually select ‘Build’ on auto-provisioned host = no PXE file +
    hostname reverted to default (macXXXXXXXXXX)
  • manually select ‘Rebuild config’ on auto-privisioned host = no PXE
    file + hostname reverted to default (macXXXXXXXXXX)
  • after the hostname is reverted to default:
    • manually select ‘Build’ on host = no PXE file
    • manually select ‘Rebuild config’ on host = PXE file created!

I think this goes beyond tftp.rb :S

On Tue, Apr 25, 2017 at 6:40 PM, Chad Schroeder < >>>>>> chads.finis...@gmail.com> wrote:

Lukas,

Hope this helps:

On initial discovery, the results of tftp_ready? are:
host.nil: false
host.managed: false

Clicking “Auto Provision” on the discovered host in the “Discovered
Hosts” menu:
host.nil: false
host.managed: false

Clicking “Edit” on the host in “All Hosts” menu and then clicking
submit:
host.nil: false
host.managed: true
managed: true
provision: true
host: mac00224d4fb56a.sub.domain.net
host.operatingsystem: CentOS 7.3.1611
host.pxe_loader.present: true
pxe_build?: true
SETTINGS[:unattended]: true

Chad

On Friday, April 21, 2017 at 8:13:18 AM UTC-5, Lukas Zapletal wrote:

Ok thanks, I can see that either TFTP nor DHCP steps are not
getting orchestrated at all. I suspect that this returns false:

https://github.com/theforeman/foreman/blob/develop/app/model
s/concerns/orchestration/tftp.rb#L21

Maybe if you are able to break up the tftp_ready? method into
multiple lines and do some debug logger outputs of all individual
statements in there to see which does not trigger TFTP orchestration.

Strange is we should see DHCP orchestration but that does not
happen as well. Are NICs created correctly? Is there a subnet set?

Unfortunately I have engagement at customer site for whole week, I
will carry on the week after. We need to solve this.

On Wed, Apr 19, 2017 at 4:58 PM, Chad Schroeder < >>>>>>>> chads.finis...@gmail.com> wrote:

I’m not sure I follow what your asking for Lukas.

On Wednesday, April 19, 2017 at 8:50:21 AM UTC-5, Lukas Zapletal >>>>>>>>> wrote:

Jacek, I apologize but what I meant was:

http://projects.theforeman.org/projects/foreman/wiki/Trouble
shooting#Enable-detailed-SQL-logger-for-orchestration-messages

Chad, it looks like setting (a fake) domain did not help to
Jacek, can you try it? Did it help in your case? Associate Subnet with a
Domain and then set it in the Hostgroup.

LZ

On Wed, Apr 19, 2017 at 2:51 PM, Jacek Mierzwa <jmie...@lbisa.com >>>>>>>>>> > wrote:

And here is Foreman app debug-level log from 'successful’
auto-provision (no PXE file appears).

On Wed, Apr 19, 2017 at 2:13 PM, Jacek Mierzwa < >>>>>>>>>>> jmie...@lbisa.com> wrote:

Here’s the SQL debug log from ‘successful’ auto-provision (no
PXE file appears).
Please find attached.

Thanks/Regards

On Wed, Apr 19, 2017 at 1:21 PM, Lukas Zapletal < >>>>>>>>>>>> lz...@redhat.com> wrote:

Ok I finally reproduced.

When domain is blank, autoprovisioning fails for no apparent
reason,
logs are empty, something fails during orchestration and hosts
are
getting discovered again (which fails since managed host
already
exists).

Bug #19313: Auto-provisioning does not orchestrate TFTP - Discovery - Foreman

I will do my best to fix it this week, but I am on travel the
week
after, crossing my fingers.

LZ

On Thu, Apr 13, 2017 at 4:28 PM, Garreat jmie...@fgtsa.com >>>>>>>>>>>>> wrote:

I experience this issue.
After clicking ‘auto-provisioning’ on a discovered host, the
host entry is
created, the host reboots - but only to enter Foreman
Discovery Image PXE
loop.
My TFTP proxy is in healthy status as I can recreate PXE
default no prob.

Now answering your checklist:

  • host is managed - yes - OK
  • provision method is “build” and not “image” - how to check
    this? I can’t
    see the ‘build mode’ checkbox for the newly created host
  • host has operating system set - yes (inherited from host
    group) - OK
  • host has pxe loader flag present (not set to blank or
    None) - how to check
    this?
  • host has one provisioning NIC with valid MAC address - yes
    it does - OK
  • a subnet is associated with the provisioning NIC - it is,
    but it’s a
    subnet different than the one declared in machine’s host
    group
  • the subnet has TFTP feature turned on - it does, and it’s
    the same TFTP
    proxy as in the subnet that I wanted

Also, the ‘domain’ is blank for the fresh created host.
The OS assigned to this host group has a valid PXElinux
template selected.

Assume I’m not making any manual changes:

  • ‘Build host’ does nothing
  • ‘Rebuild config’ creates a PXE mac-template on TFTP
    immediatly

facter -j output attached

Thanks / Regards / Greetings

W dniu wtorek, 11 kwietnia 2017 10:28:17 UTC+2 użytkownik
Lukas Zapletal
napisał:

TFTP orchestration is not being triggered. It can be only
performed

when all of these conditions are met:

  • host is managed
  • provision method is “build” and not “image”
  • host has operating system set
  • host has pxe loader flag present (not set to blank or
    None)
  • host has one provisioning NIC with valid MAC address
  • a subnet is associated with the provisioning NIC
  • the subnet has TFTP feature turned on

Visit a host which failed provisioning and do this
checklist please.

LZ


Later,
Lukas @lzap Zapletal

Jacek Mierzwa | Systems Integration Engineer

Platform Management Division

Jacek Mierzwa | Systems Integration Engineer

Platform Management Division


Later,
Lukas @lzap Zapletal


Later,
Lukas @lzap Zapletal

Jacek Mierzwa | Systems Integration Engineer

Platform Management Division


Later,
Lukas @lzap Zapletal


Later,
Lukas @lzap Zapletal


Later,
Lukas @lzap Zapletal


Later,
Lukas @lzap Zapletal

Jacek Mierzwa | Systems Integration Engineer

Platform Management Division