Bug 1301149

Summary: Unable to retire VMs which are provisioned using cloudforms 3.0 version
Product: Red Hat CloudForms Management Engine Reporter: Chris Pelland <cpelland>
Component: AutomateAssignee: Tina Fitzgerald <tfitzger>
Status: CLOSED ERRATA QA Contact: Dmitry Misharov <dmisharo>
Severity: urgent Docs Contact:
Priority: unspecified    
Version: 5.4.0CC: cpelland, dajohnso, fdewaley, jhardy, jocarter, jprause, mfeifer, mkanoor, obarenbo, pmukhedk, tfitzger
Target Milestone: GAKeywords: ZStream
Target Release: 5.5.3   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: 5.5.3.2 Doc Type: Bug Fix
Doc Text:
Previously, virtual machines provisioned using a version of Red Hat CloudForms 3.0 could not be retired using Automate methods. This was caused by the retirement state machine requiring either the miq_provision parameter or tags, which were not present in all versions of CloudForms 3.0 provisioned virtual machines. This has been fixed by removing the requirement for miq_provision and tags from the remove_from_provider code in the retirement state machine.
Story Points: ---
Clone Of: 1300559 Environment:
Last Closed: 2016-04-13 18:41:45 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: Bug
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Bug Depends On: 1300559    
Bug Blocks: 1300738    

Comment 1 CFME Bot 2016-02-10 19:54:24 UTC
New commit detected on cfme/5.5.z:
https://code.engineering.redhat.com/gerrit/gitweb?p=cfme.git;a=commitdiff;h=0b8f8d758237a37a9d29998dc48da5086410c1ea

commit 0b8f8d758237a37a9d29998dc48da5086410c1ea
Merge: e0f444e ef77751
Author:     Greg McCullough <gmccullo>
AuthorDate: Wed Feb 10 14:27:40 2016 -0500
Commit:     Greg McCullough <gmccullo>
CommitDate: Wed Feb 10 14:27:40 2016 -0500

    Merge branch 'cherry_pick_retirement_tag_fix' into '5.5.z'
    
    Automate - Retirement - Remove miq_provision and tag code
    
    from the cloud/infra remove_from_provider methods.
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1301149
    
    Original:
    https://bugzilla.redhat.com/show_bug.cgi?id=1300559
    https://github.com/ManageIQ/manageiq/pull/6290
    
    Clean cherry-pick.
    
    See merge request !745

 .../Methods.class/__methods__/remove_from_provider.rb          | 10 +++-------
 .../Methods.class/__methods__/remove_from_provider.rb          | 10 +++-------
 .../unit/method_validation/remove_from_provider_spec.rb        |  1 -
 3 files changed, 6 insertions(+), 15 deletions(-)

Comment 3 Dmitry Misharov 2016-03-31 08:20:20 UTC
Tina, please help to reproduce this bug. I imported enclosed production automation_code.zip. Should I edit /ManageIQ/Infrastructure/VM/Retirement/StateMachines/Methods/RemoveFromProvider class?

Comment 4 Tina Fitzgerald 2016-03-31 15:37:43 UTC
Hi Dmitry,

To reproduce the issue:
1. Add a provider that you have provisioned a VM on from a different server.
2. Select "Refresh Relationships and Power States".
3. Select "Retire Now" on the VM that can be deleted.
4. When retirement has completed. you'll notice the VM still exists(on the provider and VMDB) and is marked as 'retired'. 

To validate the fix:
Repeat steps 1-3 above. 
You'll notice the VM has been deleted from the provider and the VMDB.
 
Let me know if you have any problems or questions. If you're having issues, provide me the IP, credentials, and VM and I'll take a look.

Regards,
Tina

Comment 5 Dmitry Misharov 2016-04-01 10:56:12 UTC
Thanks Tina. Tested and verified in 5.5.3.2.20160318152106_92d2d67.

Comment 7 errata-xmlrpc 2016-04-13 18:41:45 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:0616