Bug 1713477

Summary: service bundle retirement requests that hit an error cannot be attempted again due to way the state is handled
Product: Red Hat CloudForms Management Engine Reporter: Satoe Imaishi <simaishi>
Component: AutomateAssignee: Tina Fitzgerald <tfitzger>
Status: CLOSED ERRATA QA Contact: Niyaz Akhtar Ansari <nansari>
Severity: urgent Docs Contact: Red Hat CloudForms Documentation <cloudforms-docs>
Priority: urgent    
Version: 5.10.2CC: dmetzger, fdewaley, gmccullo, jprause, mkanoor, mshriver, obarenbo, pvala, tfitzger, vaclav.miller, wfitzger
Target Milestone: GAKeywords: ZStream
Target Release: 5.10.5   
Hardware: All   
OS: All   
Whiteboard:
Fixed In Version: 5.10.5.1 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: 1698480 Environment:
Last Closed: 2019-06-11 05:32:47 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: 1698480    
Bug Blocks:    

Comment 2 CFME Bot 2019-05-23 20:01:32 UTC
New commit detected on ManageIQ/manageiq-content/hammer:

https://github.com/ManageIQ/manageiq-content/commit/329fa1ed9bbc2388d793ce6e2c59a6d40a11c193
commit 329fa1ed9bbc2388d793ce6e2c59a6d40a11c193
Author:     tina <tfitzger>
AuthorDate: Thu May 23 14:19:34 2019 -0400
Commit:     tina <tfitzger>
CommitDate: Thu May 23 14:19:34 2019 -0400

    Merge pull request #530 from billfitzgerald0120/retire_api

    Fix Service Retirement requests leaving the Service as 'retiring'.

    (cherry picked from commit ac0a57a8b535b4ce565beb5d51faca9acb5a50af)

    Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1713477

 content/automate/ManageIQ/Service/Retirement/StateMachines/Methods.class/__methods__/start_retirement.rb | 6 +
 content/automate/ManageIQ/Service/Retirement/StateMachines/ServiceRetirement.class/__methods__/update_service_retirement_status.rb | 2 +-
 spec/content/automate/ManageIQ/Service/Retirement/StateMachines/ServiceRetirement.class/__methods__/update_service_retirement_status_spec.rb | 21 +-
 3 files changed, 25 insertions(+), 4 deletions(-)

Comment 4 William Fitzgerald 2019-05-30 14:53:11 UTC
Niyaz,

You need to use the api calls.

1. Create a service
2. Retire the service using the older api call ("retire").  
*** note: only do this once 
3. Check the automation log for the following messages:

ERROR -- : <AEMethod start_retirement> Service retire task not found
ERROR -- : <AEMethod start_retirement> The old style retirement is incompatible with the new retirement state machine.

4. Retire the service using the new api call ("request_retire").
5. Service should retire



Let me know if you have any questions ....

Billy

Comment 5 Niyaz Akhtar Ansari 2019-05-30 18:39:59 UTC
Thanks William for steps.

I can see the the messages after calling ('retire')

I can retire the service using new api call ("request_retire")

verified in Version 5.10.5.1.20190528153822_0501085

Comment 7 errata-xmlrpc 2019-06-11 05:32:47 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:1429

Comment 8 Parthvi Vala 2019-06-17 14:56:12 UTC
This behavior is inconsistent when retiring services for the future.

I created a service and retired it with the old method(retire) and it worked just fine, no error in the log, nothing. I was also able to retire the service with the new method(request_retire).

Also, there is an attribute `request_warn` that doesn't appear when retiring the service with `request_retire`.

Service Retiring (future)
POST /api/services/:id
Query: {
  "action" : :method,
  "resource" : { "date" : "10/30/2015", "warn" : "5" }
}

Any comments on this?