Bug 1347992

Summary: Rollback during discovered host provisioning errors with ERF42-8175 and causes post_commit orchestration
Product: Red Hat Satellite Reporter: Lukas Zapletal <lzap>
Component: Discovery PluginAssignee: Lukas Zapletal <lzap>
Status: CLOSED ERRATA QA Contact: Katello QA List <katello-qa-list>
Severity: high Docs Contact:
Priority: high    
Version: 6.2.0CC: bbuckingham, cwelton, fabian, sghai, sthirugn, zhunting
Target Milestone: UnspecifiedKeywords: Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
URL: http://projects.theforeman.org/issues/12256
Whiteboard:
Fixed In Version: tfm-rubygem-katello-3.0.0.69-1 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-08-16 07:11:26 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:
Bug Depends On:    
Bug Blocks: 1212602    

Description Lukas Zapletal 2016-06-19 19:02:33 UTC
This was discovered in a foreman discovery plugin, where the controllers were
wrapped in explicit transactions (which itself should not be considered harmful).
However, trying to do this, the post_commit orchestration gets triggered
even if the pre_commit phase fails and rolls back.

I'm filling this bug in mainly for tracking the limitations of the current
orchestration that has not simple solution without rethinking the way
we do the provisioning orchestration.

Triage: Fixed upstream, we want this in 6.2.z, please ack as this can be pain when error occurs during New Host form (orchestration triggers which is unexpected).

QA: Try to provision discovered host with DNS proxy down (turn off the feature and restart proxy), it should rollback successfully.

Comment 2 Bryan Kearney 2016-06-19 22:15:52 UTC
Moving to POST since upstream bug http://projects.theforeman.org/issues/12256 has been closed

Comment 3 sthirugn@redhat.com 2016-08-12 22:20:37 UTC
Verification steps:
1. Setup satellite with livbirt CR
2. Turn off dns in proxy by:
# satellite-installer --foreman-proxy-dns false
# systemctl restart foreman-proxy
3. Provision a host in subscription-manager using PXE option

Observations/Results:
1. Discovery menu showed failed status (see screenshot)
2. Host is discovered in Satellite6 UI.  Trying to auto provision the host shows the failure as expected (see screenshot)

Comment 6 Lukas Zapletal 2016-08-15 09:04:47 UTC
That does not cover it:

1) Setup Satellite with Capsule correctly (with DNS and everything)
2) Check the PXE provisioning works (New Host, MAC, Submit, OK)
3) Discover a host
4) Disable DNS on capsule (installer or foreman-proxy/settings.d/dns.yaml set to false and restart)
5) Provision the discovered host

A standard error should be reported.

Comment 8 sthirugn@redhat.com 2016-08-15 11:30:38 UTC
Verified in satellite-6.2.1-1.2.el7sat.noarch

1) Setup Satellite with Capsule correctly (with DNS and everything)
2) Check the PXE provisioning works (New Host, MAC, Submit, OK)
3) Discover a host
4) Make sure the host is shown in Hosts -> Discovered hosts
4) Disable DNS on capsule (installer or foreman-proxy/settings.d/dns.yaml set to false and restart)
5) Provision the discovered host via UI
6) An error message is shown in the UI which is captured in the attachment `discovered host provision with no dns`

A standard error should be reported.

Comment 10 errata-xmlrpc 2016-08-16 07:11:26 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/RHBA-2016:1615

Comment 11 Lukas Zapletal 2016-09-22 11:11:53 UTC
*** Bug 1357583 has been marked as a duplicate of this bug. ***