Bug 1363897

Summary: Retirement state machine does not handle Ansible Tower services when part of a bundle
Product: Red Hat CloudForms Management Engine Reporter: Jerome Marc <jmarc>
Component: AutomateAssignee: William Fitzgerald <wfitzger>
Status: CLOSED CURRENTRELEASE QA Contact: Shveta <sshveta>
Severity: medium Docs Contact:
Priority: medium    
Version: 5.6.0CC: cpelland, dajohnso, jhardy, jmarc, kmorey, mkanoor, nstephan, obarenbo, simaishi, sshveta, tfitzger, wfitzger
Target Milestone: GAKeywords: TestOnly, ZStream
Target Release: 5.8.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: tower:service
Fixed In Version: 5.8.0.0 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1404746 1404747 (view as bug list) Environment:
Last Closed: 2017-06-12 16:44:05 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: 1404746, 1404747    
Attachments:
Description Flags
Example of automation.log with loop on Ansible Tower service retirement
none
ansible job none

Description Jerome Marc 2016-08-03 21:18:22 UTC
Created attachment 1187211 [details]
Example of automation.log with loop on Ansible Tower service retirement

Description of problem:
I have a bundle setup with two services, first one is a VM provisioning, second is an Ansible Tower job template (specifying limit in the dialog). Provisioning is fine, but when retirering this service, the ServiceRetirement state machine goes in a loop at StartRetirement step (first step of the state machine) for the Ansible Type service. this causes CFME to become extremely slow and the automate.log to fill up with the same step being executed over and over (MIQ_ABORT is bot handle correctly). Example log attached.

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

How reproducible:
Always

Steps to Reproduce:
1. Create a bundle with item 1) provision a VM, item 2) run Ansible Tower job template
2. Once the service provisioned, retire the service
3. CFME never completes the service retirement as seen in automation.log (loop for the ansible tower service retirement)

Actual results:
The retirement for the Ansible Tower service results with MIQ_ABORT but re-run the same retirement state machine over and over

Expected results:
Retirement state machine should stop, either successfully or with an error

Additional info:
Deleting the services manually (Services > My Services > Configuration > Remove Service from VMDB) causes the retirement service to complete.

Comment 3 Tina Fitzgerald 2016-11-16 21:50:00 UTC
Discussed issue with Kevin Morey who recommended a retirement instance for generic service types. New "Generic" instance should be used as the retirement entry point for Ansible Tower.

Comment 5 William Fitzgerald 2016-12-14 14:23:49 UTC
Satoe,

This PR has been merged so I am moving this to 'post'.

Thanks

Comment 6 William Fitzgerald 2016-12-14 14:24:32 UTC
https://github.com/ManageIQ/manageiq/pull/12619

Comment 9 Shveta 2017-04-28 05:13:20 UTC
Created a bundle with two service 1) Vmware catalog item and 2) Ansible Tower item . Ordered the bundle. 
Two separate services (one for vmware and one for ansible tower ) are provisioned under MyService. 
On retiring each service , the ansible tower job does not retire .

Appliance : https://10.8.196.170
Service - bundle

Comment 10 William Fitzgerald 2017-05-02 13:51:08 UTC
Shveta,

I was using your appliance on Friday but its not working now.   Is it still available?

Thanks

Billy

Comment 11 Shveta 2017-05-02 16:52:39 UTC
https://10.8.198.83 
Service bundle - "retire"

Comment 12 Shveta 2017-05-02 16:54:20 UTC
The job under Automate - Ansible Tower - Job does not retire and keeps showing

Comment 13 Tina Fitzgerald 2017-05-03 13:11:05 UTC
Hi Shveta,

The Ansible Tower Service should not be shown in the UI when it is provisioned as part of a Service Bundle as reported here: 
https://bugzilla.redhat.com/show_bug.cgi?id=1446452
Once the fix for the above BZ is merged, those sub services will not be shown.

As long as the Ansible Tower job gets retired when the Bundle Service is retired, then it's not an issue.

If you can validate the Bundle retirement works properly, we can validate this ticket.

Let me know if you have any questions.

Thanks,
Tina

Comment 14 Shveta 2017-05-03 18:21:40 UTC
Created attachment 1275965 [details]
ansible job

Hi Tina , 

What I am seeing is ansible service whether part of bundle or not does not retire the job .
https://10.8.198.201 . I have created a catalog item here named ansible and retired it . The service moves to "retired" section in Myservice but the job (Under Automate-Ansible Tower- Jobs) does not retire .

See attached screenshot . Isn't the job supposed to retire with service ?

Comment 15 Tina Fitzgerald 2017-05-03 18:52:41 UTC
Hi Shveta,

No, we don't do anything to the job. 

As long as the Service is marked as Retired, the retirement process has completed successfully.

Thanks,
Tina

Comment 16 Shveta 2017-05-03 19:04:56 UTC
Verifying