Bug 1495634

Summary: hammer bootdisk host fails when default gateway in subnet definition is not set
Product: Red Hat Satellite Reporter: daniel <dmoessne>
Component: Bootdisk PluginAssignee: Lukas Zapletal <lzap>
Status: CLOSED ERRATA QA Contact: Nikhil Kathole <nkathole>
Severity: high Docs Contact:
Priority: unspecified    
Version: 6.2.11CC: akarsale, dhlavacd, kgaikwad, lzap, mhulan, nkathole, rabajaj, tstrachota, zhunting
Target Milestone: 6.4.0Keywords: Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: foreman_bootdisk-10.0.2 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-10-16 19:33:01 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 daniel 2017-09-26 11:20:49 UTC
Description of problem:

Trying to create a boot disk via 

# hammer bootdisk host ...

fails if subnet has no default gateway set although this is flagged optional in UI (Optional: Gateway for this subnet)


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

How reproducible:


Steps to Reproduce:
1. create subnet without a default gateway as well as hostgroup:
2. create the host via hammer
3. create host bootdisk and see it fails with: 
"Failed to download host disk image:
  ERF42-2759 [Foreman::Exception]: Subnet (static-no-gw-vlan105.coe.muc.redhat.com (172.24.105.0/24)) has no gateway defined"


Actual results:
"Failed to download host disk image:
  ERF42-2759 [Foreman::Exception]: Subnet (static-no-gw-vlan105.coe.muc.redhat.com (172.24.105.0/24)) has no gateway defined"

Expected results:
boot image should be created even though there is not default gateway for the net 

Additional info:
Customer environments no necessarily do have a default gateway, i.e. think about a network just providing services in the background. Those do not need any default GW as it is sufficient the reach all services or be reached by services within the same network.

Comment 3 daniel 2017-09-26 12:28:38 UTC
Same happens when trying to download host image via UI:

~~~
Error: Failed to render boot disk template: ERF42-2759 [Foreman::Exception]: Subnet (static-no-gw-vlan105.example.com (172.24.105.0/24)) has no gateway defined
~~~

Comment 6 Lukas Zapletal 2017-10-09 12:24:55 UTC
Hello,

valid bug, thanks for report. I will fix, but workaround is easy - just modify the bootdisk template to avoid this error message, it is just one line:

https://github.com/theforeman/foreman_bootdisk/pull/44/files

Then re-download the image and it will work.

Comment 8 Lukas Zapletal 2017-12-13 09:17:22 UTC
This is actually fixed in 10.0.1, rebase needed tho.

Comment 12 Lukas Zapletal 2018-04-09 09:33:59 UTC
The bug was fixed upstream, Satellite NEXT.

Comment 13 Lukas Zapletal 2018-04-09 09:35:29 UTC
For googlers, this is just a template change, this can be fixed with any Foreman or Satellite version just by editing Bootdisk - host disk template in Templates:

https://github.com/theforeman/foreman_bootdisk/pull/44/files

Comment 14 Nikhil Kathole 2018-06-20 07:10:18 UTC
VERIFIED

Version tested:
Satellite 6.4 snap 8

# rpm -qa | grep bootdisk
tfm-rubygem-hammer_cli_foreman_bootdisk-0.1.3.3-3.el7sat.noarch
tfm-rubygem-foreman_bootdisk-12.0.0-1.el7sat.noarch

Successfully able to create bootdisk when default gateway is not set in subnet.

Comment 16 Bryan Kearney 2018-10-16 19:33:01 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:2927