Bug 1286571

Summary: Reboot/kexec error should rollback
Product: Red Hat Satellite Reporter: Sachin Ghai <sghai>
Component: Discovery PluginAssignee: Lukas Zapletal <lzap>
Status: CLOSED WONTFIX QA Contact: Katello QA List <katello-qa-list>
Severity: low Docs Contact:
Priority: unspecified    
Version: 6.1.5CC: bbuckingham, bkearney, inecas
Target Milestone: UnspecifiedKeywords: Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
URL: http://projects.theforeman.org/issues/12327
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-01-05 15:58:20 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:
Attachments:
Description Flags
complete exception thrown in production.log none

Description Sachin Ghai 2015-11-30 09:25:25 UTC
Description of problem:
I was trying auto-provisioning manually. I discovered a pxe-less host with dhcp. Host was discovered successfully and then I defined a discovery-rule but accidentally I associated incorrect hostgroup to that rule which is associated to a different subnet. As soon as I selected the "auto-provision" from provision dropdown, I got notification rule is applied. And host was removed removed from discovered host page and moved to 'All host' page.

However when I checked the logs and found following error:

----
2015-11-30 04:09:05 [I] Processing by DiscoveredHostsController#auto_provision as HTML
2015-11-30 04:09:05 [I]   Parameters: {"authenticity_token"=>"71UIz3gXvym7Vohl7d//nLh8Nuqs8uZ3uwyRcMSynNU=", "id"=>"mac52540098967a"}
2015-11-30 04:09:05 [I] Match found for host mac52540098967a (26) rule rule1 (1)
2015-11-30 04:09:05 [I] Create DHCP reservation for mac52540098967a.idmqe.lab.eng.bos.redhat.com-52:54:00:98:96:7a/192.168.100.23
2015-11-30 04:09:05 [I] Add DNS A record for mac52540098967a.idmqe.lab.eng.bos.redhat.com/192.168.100.23
2015-11-30 04:09:05 [I] Add DNS PTR record for 192.168.100.23/mac52540098967a.idmqe.lab.eng.bos.redhat.com
2015-11-30 04:09:05 [I] Add the TFTP configuration for mac52540098967a.idmqe.lab.eng.bos.redhat.com
2015-11-30 04:09:11 [I] Fetching required TFTP boot files for mac52540098967a.idmqe.lab.eng.bos.redhat.com
2015-11-30 04:09:11 [I] Redirected to https://cloud-qe-15.idmqe.lab.eng.bos.redhat.com/discovered_hosts
2015-11-30 04:09:11 [W] Unable to kexec mac52540098967a:
2015-11-30 04:09:11 [W] /opt/rh/ruby193/root/usr/share/gems/gems/rest-client-1.6.7/lib/restclient/abstract_response.rb:48:in `return!'
/opt/rh/ruby193/root/usr/share/gems/gems/rest-client-1.6.7/lib/restclient/request.rb:230:in `process_result'
/opt/rh/ruby193/root/usr/share/gems/gems/rbovirt-0.0.29/lib/restclient_ext/request.rb:50:in `block in transmit'
/opt/rh/ruby193/root/usr/share/ruby/net/http.rb:746:in `start'
/opt/rh/ruby193/root/usr/share/gems/gems/rbovirt-0.0.29/lib/restclient_ext/request.rb:44:in `transmit'
/opt/rh/ruby193/root/usr/share/gems/gems/rest-client-1.6.7/lib/restclient/request.rb:64:in `execute'
/opt/rh/ruby193/root/usr/share/gems/gems/rest-client-1.6.7/lib/restclient/request.rb:33:in `execute'
/opt/rh/ruby193/root/usr/share/gems/gems/rest-client-1.6.7/lib/restclient/resource.rb:76:in `put'

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


How reproducible:
always

Steps to Reproduce:
1. discover host via pxe-less
2. define a discovery rule and associated a hostgroup which has subnet associated from a different network than discovered host
3. auto-provision

Actual results:
1. Rule was applied
2. Host entry removed from discovered host page 
3. No error on webUI
4. Got a generic error from production.log:
2015-11-30 04:09:11 [W] Unable to kexec mac52540098967a:



Expected results:

1. I think at first place user should get an error on webUI as soon as discovery rule was applied.

2. host entry shouldn't be removed from discovered host page,

3. its would be nice if user gets a proper error in production.log instead of generic warning type message as below:

like: 2015-11-30 04:09:11 [W] Unable to kexec mac52540098967a:


Additional info:

Comment 1 Sachin Ghai 2015-11-30 09:27:28 UTC
Created attachment 1100396 [details]
complete exception thrown in production.log

Comment 2 Sachin Ghai 2015-11-30 09:42:06 UTC
forgot the reproducible version:  Sat 6.1.5 compose2(Satellite-6.1.0-RHEL-7-20151125.0)

discovery image: foreman-discovery-image-3.0.5-2.iso

Comment 4 Lukas Zapletal 2015-11-30 10:23:18 UTC
By default, we do not consider error during reboot request as reason to do full provisioning rollback (due to fact that host can be rebooted manually). With kexec introduction, it might make more sense to fail. We can perhaps create a global setting "rollback_on_reboot" for this.

Taking this off the errata, not a blocker, nice to have feature.

Comment 5 Bryan Kearney 2017-01-05 15:58:20 UTC
This is an older bug which has been reported upstream. We are not going to track this bug downstream. When the upstream issue is resolved, the next build will contain the fix. Thank you.