Bug 1393848

Summary: Unable to preview iPXE template because of missing method bootdisk_chain_url
Product: Red Hat Satellite Reporter: Kenny Tordeurs <ktordeur>
Component: Provisioning TemplatesAssignee: Ondřej Pražák <oprazak>
Status: CLOSED ERRATA QA Contact: Sanket Jagtap <sjagtap>
Severity: medium Docs Contact:
Priority: medium    
Version: 6.2.3CC: bbuckingham, bkearney, ehelms, jcallaha, lzap, mhulan, mlele, oprazak, sjagtap, supatil, szadok, tstrachota
Target Milestone: UnspecifiedKeywords: EasyFix, Reopened, Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
URL: http://projects.theforeman.org/issues/17893
Whiteboard:
Fixed In Version: tfm-rubygem-foreman_bootdisk-10.0.2-1.fm1_14,tfm-rubygem-foreman_bootdisk-10.0.2.1-1.fm1_14 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-07-25 14:57:45 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Attachments:
Description Flags
error_template
none
Preview of the template rendered none

Description Kenny Tordeurs 2016-11-10 12:51:17 UTC
Created attachment 1219378 [details]
error_template

Description of problem: Unable to preview provisioning template "Boot disk iPXE - host"



Version-Release number of selected component (if applicable):
Satellite 6.2.3

How reproducible:
100%

Steps to Reproduce:
1. Try to preview the "Boot disk iPXE - host" for any host
2.
3.

Actual results:
Warning! There was an error rendering the Boot disk iPXE - host template: undefined method `bootdisk_chain_url' for #


Expected results:
Preview the template

Additional info:
Can be resolved by creating a clone for the "Boot disk iPXE - host"

Change the following from:
~~~
...
# Chainload from Foreman rather than embedding OS info here, so the behaviour
# is entirely dynamic.
chain <%= bootdisk_chain_url %>
exit 0
...
~~~


To:
~~~
...
# Chainload from Foreman rather than embedding OS info here, so the behaviour
# is entirely dynamic.
chain <%= foreman_url ('iPXE') %>
exit 0
...
~~~

Comment 2 chris procter 2016-11-11 10:42:57 UTC
A bit of experimenting seems to imply that the above work around is not quite complete, and to get the same output as bootdisk_chain_url you need to add the mac address to the query string:-

# Chainload from Foreman rather than embedding OS info here, so the behaviour
# is entirely dynamic.
chain <%= foreman_url ('iPXE') %>&mac=<%= interface.mac %>
exit 0
...


Can someone confirm that is going to be a complete workaround with no hidden gotchas?

Thanks

Comment 4 Lukas Zapletal 2016-11-23 10:47:50 UTC
Hello, sorry for the delay.

Bootdisk templates are not supposed to be associated with any host, therefore preview is not relevant. You may want to find or create iPXE template (regular one), but the bootdisk one is used when generating bootdisk images. It's special.

We ship one or more iPXE regular templates, please find them and associate them.

To fix this bug, please prevent associating bootdisk templates with OS objects. This requires change in the bootdisk plugin.

Comment 7 Shlomi Zadok 2017-01-02 15:43:57 UTC
Created redmine issue http://projects.theforeman.org/issues/17893 from this bug

Comment 8 Satellite Program 2017-01-20 15:01:24 UTC
Upstream bug assigned to oprazak

Comment 9 Satellite Program 2017-01-20 15:01:28 UTC
Upstream bug assigned to oprazak

Comment 10 Satellite Program 2017-02-02 11:01:33 UTC
Moving this bug to POST for triage into Satellite 6 since the upstream issue http://projects.theforeman.org/issues/17893 has been resolved.

Comment 12 Ondřej Pražák 2018-01-03 13:36:25 UTC
Connecting redmine issue http://projects.theforeman.org/issues/22136 from this bug

Comment 16 Sanket Jagtap 2018-02-02 06:06:16 UTC
Build:Satellite 6.3.0 snap 34

No error was displayed while previewing the Boot disk iPXE - host template
PFA

Comment 17 Sanket Jagtap 2018-02-02 06:07:01 UTC
Created attachment 1389925 [details]
Preview of the template rendered

Comment 18 Satellite Program 2018-02-21 16:54:17 UTC
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA.
> 
> For information on the advisory, and where to find the updated files, follow the link below.
> 
> If the solution does not work for you, open a new bug report.
> 
> https://access.redhat.com/errata/RHSA-2018:0336

Comment 19 Suraj Patil 2018-07-25 12:03:37 UTC
Hello team,

I am reopening this bug as it seems to be the regression. 

In satellite 6.3.1, tfm-rubygem-foreman_bootdisk-10.0.2.2-1.fm1_15.el7sat.noarch. 
template is still generated with the below.

======
chain <%= bootdisk_chain_url %>
======

While downloading the HOST ISO below is the error. 

Error: Failed to render boot disk template: ERF42-5290 [Foreman::Exception]: Unable to find template specified by bootdisk_host_template setting

I have cross-checked that all the templates have been added in correct organization and location. 

While trying to review the bootdisk template below error was observed. 

===============
There was an error rendering the Boot disk iPXE - host template: undefined method `bootdisk_chain_url' for #<#<Class:0x00007f3e7e17c9b0>:0x00007f3e7dd27b58>
Did you mean? bootdisk_url
===============
 
Please tell me know if you need any more inputs fro my side. 

Regards,
Suraj Patil
Red Hat

Comment 20 Marek Hulan 2018-07-25 12:14:30 UTC
Please don't reopen bugs that were verified, it would be much better to open a new one and add this one as "See also". Also please provide logs after you enabled all loggers and debug log level from a moment, the host iso is downloaded. See https://access.redhat.com/solutions/1155573 for instructions how to configure logging in that way. Don't forget to revert after you get the logs, it could produce a lot of data on production machine.

Preview can fail because of other reasons, which is why we need logs from the actual rendering.

Comment 21 Suraj Patil 2018-07-25 14:08:12 UTC
Hello,
Thank you for the response.

Ok, I will cross-check again by enabling the logs and will open the new bug if required.

You can close this again.

Comment 22 Marek Hulan 2018-07-25 14:57:45 UTC
Thanks, closing