Bug 1659042

Summary: Bootdisk does not validate media leading to Medium cannot be blank error during bootdisk provision method
Product: Red Hat Satellite Reporter: Lukas Zapletal <lzap>
Component: Bootdisk PluginAssignee: Lukas Zapletal <lzap>
Status: CLOSED ERRATA QA Contact: Jan Hutař <jhutar>
Severity: high Docs Contact:
Priority: unspecified    
Version: 6.4CC: egolov, frederic.follonier, jhutar, ldelouw, lzap, mmccune, patalber, phess, roarora, shisingh, yves.dessureault
Target Milestone: 6.5.0Keywords: Regression, Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: foreman-1.20.1.9-1,tfm-rubygem-foreman_bootdisk-14.0.0.1-1 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-05-14 12:39:36 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 Lukas Zapletal 2018-12-13 12:47:51 UTC
I was trying to create a host using newly added bootdisk provisioning method from UI. I associated all required fields and simply selected the "Boot disk based" provisioning method. All other fields on "operating system" tab were appeared same as for "network based".

Under "Media selection" -> "Synced contents" was selected and Kickstart media was auto populated. The moment I submitted the create host form, UI raised error on Media under "operating system" tab: 

Media can't be blank

Symptoms the same as in https://bugzilla.redhat.com/show_bug.cgi?id=1513327

Regression, 6.3 was fixed in BZ 1513327 but upstream was not yet properly fixed.

This is a bootdisk blocker for 6.4

Comment 4 Lukas Zapletal 2019-01-07 14:02:20 UTC
*** Bug 1663524 has been marked as a duplicate of this bug. ***

Comment 6 Lukas Zapletal 2019-01-11 14:35:40 UTC
The PRs are just about to be merged. As a workaround apply this:

https://github.com/theforeman/foreman/pull/6331/files

and this for bootdisk:

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

That will do it.

Comment 9 Bryan Kearney 2019-01-21 09:02:15 UTC
Moving this bug to POST for triage into Satellite 6 since the upstream issue https://projects.theforeman.org/issues/25680 has been resolved.

Comment 15 Jan Hutař 2019-02-25 21:31:11 UTC
Some generic info about Boot disk based provisioning method I got from lzap (thanks!):

- this was provided by community (thanks!)
- this currently works only on VmWare compute resource
- you do not need to download boot disk yourself, this happens automatically when host is created in Satellite (boot disk gets uploaded to VmWare and attached as bootable CD to the VM)
- initial discussion was here: https://community.theforeman.org/t/rfc-uefi-http-booting/8723/12

Comment 18 Lukas Zapletal 2019-04-23 11:14:06 UTC
This is a Technlogy Preview feature and this particular issue (or similar symptoms) persisted in Satellite 6.3 to 6.5. It will be fixed in Satellite 6.6. Workaround is possible, just comment out one particular line:

From f4a051a53d76d635b85a202f8d17da57bd7c4b7a Mon Sep 17 00:00:00 2001
From: Lukas Zapletal <lzap+git>
Date: Thu, 11 Jan 2018 12:47:46 +0100
Subject: [PATCH] BZ #1513327 - media is not validated

---
 app/models/concerns/foreman_bootdisk/host_ext.rb | 5 -----
 1 files changed, 0 insertion(+), 1 deletions(-)

diff --git a/app/models/concerns/foreman_bootdisk/host_ext.rb b/app/models/concerns/foreman_bootdisk/host_ext.rb
index 94ac3bd..e1f9bac 100644
--- a/app/models/concerns/foreman_bootdisk/host_ext.rb
+++ b/app/models/concerns/foreman_bootdisk/host_ext.rb
@@ -4,7 +4,6 @@ module ForemanBootdisk::HostExt
   extend ActiveSupport::Concern
 
   included do
-    alias_method_chain :validate_media?, :bootdisk
     alias_method_chain :can_be_built?, :bootdisk
   end
 
@@ -37,10 +36,6 @@ module ForemanBootdisk::HostExt
     /i.86|x86[_-]64/ =~ architecture.name
   end
-- 
2.18.1

Please report back if it helps, we might be able to do this simple change for 6.4.

Also reported as https://bugzilla.redhat.com/show_bug.cgi?id=1513327

Comment 21 errata-xmlrpc 2019-05-14 12:39:36 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