Bug 1404746

Summary: Retirement state machine does not handle Ansible Tower services when part of a bundle
Product: Red Hat CloudForms Management Engine Reporter: Satoe Imaishi <simaishi>
Component: AutomateAssignee: William Fitzgerald <wfitzger>
Status: CLOSED ERRATA QA Contact: Shveta <sshveta>
Severity: medium Docs Contact:
Priority: medium    
Version: 5.6.0CC: cpelland, dajohnso, greartes, jhardy, jmarc, kmorey, mkanoor, nstephan, obarenbo, simaishi, sshveta, tfitzger, wfitzger
Target Milestone: GAKeywords: ZStream
Target Release: 5.7.1   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: tower:service
Fixed In Version: 5.7.1.0 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: 1363897 Environment:
Last Closed: 2017-02-27 19:15:27 UTC Type: ---
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: 1363897    
Bug Blocks:    

Comment 2 CFME Bot 2017-01-09 17:00:57 UTC
New commit detected on ManageIQ/manageiq/euwe:
https://github.com/ManageIQ/manageiq/commit/062660c030ebd8a5a1ab4ffc754d2b111c92eadf

commit 062660c030ebd8a5a1ab4ffc754d2b111c92eadf
Author:     Greg McCullough <gmccullo>
AuthorDate: Fri Dec 2 09:38:02 2016 -0500
Commit:     Satoe Imaishi <simaishi>
CommitDate: Mon Jan 9 11:55:26 2017 -0500

    Merge pull request #12619 from billfitzgerald0120/retire_service_generic
    
    Automate - Generic service retirement option.
    (cherry picked from commit be3f3cb96b88cef13dda291a4cad86d6fd91ad6e)
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1404746

 .../ServiceRetirement.class/generic.yaml           | 24 ++++++++++++++++++++++
 1 file changed, 24 insertions(+)
 create mode 100644 db/fixtures/ae_datastore/ManageIQ/Service/Retirement/StateMachines/ServiceRetirement.class/generic.yaml

Comment 3 Shveta 2017-01-26 19:51:25 UTC
Ansible service does not retire and logs keep on showing retry :
=========================================================
[----] I, [2017-01-26T14:51:06.573416 #11848:e63138]  INFO -- : <AEMethod [/ManageIQ/Service/Retirement/StateMachines/ServiceRetirement/update_service_retirement_status]> Starting 
[----] I, [2017-01-26T14:51:07.265063 #11848:594f3b8]  INFO -- : <AEMethod update_service_retirement_status> Server:<EVM> Ae_Result:<ok> State:<ServiceRetirement> Step:<CheckServiceRetired>
[----] I, [2017-01-26T14:51:07.267055 #11848:594f3b8]  INFO -- : <AEMethod update_service_retirement_status> Status_State:<on_entry> Status:<Checking Service retirement>
[----] I, [2017-01-26T14:51:07.307890 #11848:e63138]  INFO -- : <AEMethod [/ManageIQ/Service/Retirement/StateMachines/ServiceRetirement/update_service_retirement_status]> Ending
[----] I, [2017-01-26T14:51:07.308201 #11848:e63138]  INFO -- : Method exited with rc=MIQ_OK
[----] I, [2017-01-26T14:51:07.309183 #11848:e63138]  INFO -- : Processing State=[CheckServiceRetired]
[----] I, [2017-01-26T14:51:07.309860 #11848:e63138]  INFO -- : Following Relationship [miqaedb:/Service/Retirement/StateMachines/Methods/CheckServiceRetired#create]
[----] I, [2017-01-26T14:51:07.501876 #11848:e63138]  INFO -- : Updated namespace [miqaedb:/Service/Retirement/StateMachines/Methods/CheckServiceRetired#create  ManageIQ/Service/Retirement/StateMachines]
[----] I, [2017-01-26T14:51:07.662336 #11848:e63138]  INFO -- : Updated namespace [Service/Retirement/StateMachines/Methods/check_service_retired  ManageIQ/Service/Retirement/StateMachines]
[----] I, [2017-01-26T14:51:07.686378 #11848:e63138]  INFO -- : Invoking [inline] method [/ManageIQ/Service/Retirement/StateMachines/Methods/check_service_retired] with inputs [{}]
[----] I, [2017-01-26T14:51:07.688723 #11848:e63138]  INFO -- : <AEMethod [/ManageIQ/Service/Retirement/StateMachines/Methods/check_service_retired]> Starting 
[----] I, [2017-01-26T14:51:08.567944 #11848:e697f4]  INFO -- : <AEMethod check_service_retired> Checking if all service resources have been retired.
[----] I, [2017-01-26T14:51:08.609959 #11848:164a400]  INFO -- : <AEMethod check_service_retired> Checking if service resource for service: bundle-20170126-142521 resource ID: 66 is retired
[----] I, [2017-01-26T14:51:08.615569 #11848:164a400]  INFO -- : <AEMethod check_service_retired> resource: Gk2UBpHyTd-20170126-142545 is not retired, setting retry.
[----] I, [2017-01-26T14:51:08.625364 #11848:e697f4]  INFO -- : <AEMethod check_service_retired> Service: bundle-20170126-142521 Resource retirement check returned <retry>
[----] I, [2017-01-26T14:51:08.627593 #11848:e697f4]  INFO -- : <AEMethod check_service_retired> Service: bundle-20170126-142521 resource is not retired, setting retry.
[----] I, [2017-01-26T14:51:08.660596 #11848:e63138]  INFO -- : <AEMethod [/ManageIQ/Service/Retirement/StateMachines/Methods/check_service_retired]> Ending
[----] I, [2017-01-26T14:51:08.660724 #11848:e63138]  INFO -- : Method exited with rc=MIQ_OK

Comment 4 William Fitzgerald 2017-01-26 20:21:31 UTC
Shveta,

Can I have access to your appliance ? In order for an ansible service to be retired,
you need to use the generic retirement method. See PR: https://github.com/ManageIQ/manageiq/pull/12619

Thanks

Bill

Comment 5 Shveta 2017-01-27 00:43:02 UTC
Hi Bill , 

It works fine with the Generic retirement state.

Shveta

Comment 6 errata-xmlrpc 2017-02-27 19:15:27 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://rhn.redhat.com/errata/RHSA-2017-0320.html