Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
Red Hat Satellite engineering is moving the tracking of its product development work on Satellite to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "Satellite project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs will be migrated starting at the end of May. If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "Satellite project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/SAT-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 1597968

Summary: Provisioning a new host with bond interface without domain and subnet failed with undefined method `vlanid' for nil:NilClass
Product: Red Hat Satellite Reporter: Varatharaja Perumal G <vgunasek>
Component: Provisioning TemplatesAssignee: satellite6-bugs <satellite6-bugs>
Status: CLOSED ERRATA QA Contact: Roman Plevka <rplevka>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 6.3.2CC: mhulan, pcreech, rankumar, vvasilev
Target Milestone: 6.5.0Keywords: Triaged
Target Release: Unused   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-05-14 12:37:33 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:
Embargoed:

Description Varatharaja Perumal G 2018-07-04 04:46:03 UTC
Description of problem:

Provisioning a new host with bond interface without domain and subnet failed with undefined method `vlanid' for nil:NilClass

Error when we try to render the Provisioning template:

"There was an error rendering the Satellite Kickstart Default template: ERF42-7327 [Foreman::Exception]: The snippet 'kickstart_ifcfg_generic_interface' threw an error: undefined method `vlanid' for nil:NilClass"

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

Satellite 6.3

How reproducible:


Steps to Reproduce:
1. Create host with three interface eth0, eth1 and eth2
2. eth0 will be managed, provisioning, primary and REX
3. Configure eth1 and eth2 as a managed interface.
4. Configure a managed bond0 interface with eth1 and eth2 as a slave without Subnet, Domain.
5. Once host created try to render the provisioning template of the host.

Actual results:

Provisioning template failed with below error.

"There was an error rendering the Satellite Kickstart Default template: ERF42-7327 [Foreman::Exception]: The snippet 'kickstart_ifcfg_generic_interface' threw an error: undefined method `vlanid' for nil:NilClass"

Expected results:

The host should be provisioned successfully.

Additional info:

Bond interface is considered as virtual so it's looking for a vlanid to tag VLAN information on bond0 interface as per the template.


Template: 'kickstart_ifcfg_generic_interface'
~~~
<%- if @interface.virtual? && ((!@subnet.nil? && @subnet.has_vlanid?) || @interface.vlanid.present?) -%>
<%=   "VLAN=yes" %>
~~~~

Modify the template as below helps to resolve the issue.

~~~
<%- if @interface.virtual? && (!@subnet.nil? && (@subnet.has_vlanid? || @interface.vlanid.present?)) -%>
<%=   "VLAN=yes" %>
~~~

Foreman production log trace:

~~~
2018-07-03 05:39:40 0f1f8e82 [app] [W] Error rendering the Satellite Kickstart Default template
 | Foreman::Exception: ERF42-7327 [Foreman::Exception]: The snippet 'kickstart_ifcfg_generic_interface' threw an error: undefined method `vlanid' for nil:NilClass
 | /usr/share/foreman/app/models/nic/interface.rb:26:in `vlanid'
 | /opt/theforeman/tfm/root/usr/share/gems/gems/safemode-1.3.2/lib/safemode/jail.rb:31:in `method_missing'
 | kickstart_ifcfg_generic_interface:116:in `bind'
 | /opt/theforeman/tfm/root/usr/share/gems/gems/safemode-1.3.2/lib/safemode.rb:51:in `eval'
 | /opt/theforeman/tfm/root/usr/share/gems/gems/safemode-1.3.2/lib/safemode.rb:51:in `eval'
 | /usr/share/foreman/lib/foreman/renderer.rb:56:in `render_safe'
 | /usr/share/foreman/lib/foreman/renderer.rb:175:in `unattended_render'
 | /usr/share/foreman/lib/foreman/renderer.rb:121:in `snippet'
 | /opt/theforeman/tfm/root/usr/share/gems/gems/safemode-1.3.2/lib/safemode/scope.rb:37:in `method_missing'
 | kickstart_ifcfg_bond_interface:52:in `bind'
 | /opt/theforeman/tfm/root/usr/share/gems/gems/safemode-1.3.2/lib/safemode.rb:51:in `eval'
 | /opt/theforeman/tfm/root/usr/share/gems/gems/safemode-1.3.2/lib/safemode.rb:51:in `eval'
 | /usr/share/foreman/lib/foreman/renderer.rb:56:in `render_safe'
 | /usr/share/foreman/lib/foreman/renderer.rb:175:in `unattended_render'
 | /usr/share/foreman/lib/foreman/renderer.rb:121:in `snippet'
 | /opt/theforeman/tfm/root/usr/share/gems/gems/safemode-1.3.2/lib/safemode/scope.rb:37:in `method_missing'
 | kickstart_networking_setup:58:in `block in bind'
 | /opt/rh/rh-ror42/root/usr/share/gems/gems/activerecord-4.2.6/lib/active_record/relation/delegation.rb:46:in `each'
 | /opt/rh/rh-ror42/root/usr/share/gems/gems/activerecord-4.2.6/lib/active_record/relation/delegation.rb:46:in `each'
 | /opt/theforeman/tfm/root/usr/share/gems/gems/safemode-1.3.2/lib/safemode/jail.rb:31:in `method_missing'
 | kickstart_networking_setup:53:in `bind'
~~~

Comment 2 Satellite Program 2018-08-16 22:14:22 UTC
Moving this bug to POST for triage into Satellite 6 since the upstream issue https://projects.theforeman.org/issues/24151 has been resolved.

Comment 5 Roman Plevka 2019-03-21 14:56:33 UTC
VERIFIED
on sat6.5.0 snap #20

- i created an atomic host on libvirt, added eth0 as the primary and provisioning interface, and eth1 and eth2 managed interfaces bleonging to the same subnet and domain.
The i created a bond0 interface of bond type and specified eth1,eth2 for the slave devices (it did not belong to any subnet or domain).

then I rendered the Provision template for the host using the "review" button.

the template rendered correctly with no errors thrown.

Comment 7 errata-xmlrpc 2019-05-14 12:37:33 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-2019:1222