Bug 1308663 - MICROSOFT scvmm power off operation not working
MICROSOFT scvmm power off operation not working
Status: CLOSED ERRATA
Product: Red Hat CloudForms Management Engine
Classification: Red Hat
Component: Providers (Show other bugs)
5.5.0
Unspecified Unspecified
medium Severity unspecified
: GA
: 5.5.3
Assigned To: Bronagh Sorota
Jeff Teehan
power:provider:scvmm
: ZStream
Depends On: 1299069
Blocks:
  Show dependency treegraph
 
Reported: 2016-02-15 12:13 EST by Chris Pelland
Modified: 2016-04-13 14:43 EDT (History)
10 users (show)

See Also:
Fixed In Version: 5.5.3.2
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 1299069
Environment:
Last Closed: 2016-04-13 14:43:54 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Comment 1 CFME Bot 2016-02-15 14:31:28 EST
New commit detected on cfme/5.5.z:
https://code.engineering.redhat.com/gerrit/gitweb?p=cfme.git;a=commitdiff;h=2bc6f1bc25b2002e8813295389b63c75669ca22f

commit 2bc6f1bc25b2002e8813295389b63c75669ca22f
Author:     Bronagh Sorota <bsorota@redhat.com>
AuthorDate: Mon Feb 15 13:08:07 2016 -0500
Commit:     Bronagh Sorota <bsorota@redhat.com>
CommitDate: Mon Feb 15 13:08:07 2016 -0500

    Implementation on 5.5.z of the vm_delete method for SCVMM
    
    Upstream PR is: https://github.com/ManageIQ/manageiq/pull/6306
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1308663

 app/models/manageiq/providers/microsoft/infra_manager.rb | 7 +++++++
 1 file changed, 7 insertions(+)
Comment 2 CFME Bot 2016-02-15 14:31:32 EST
New commit detected on cfme/5.5.z:
https://code.engineering.redhat.com/gerrit/gitweb?p=cfme.git;a=commitdiff;h=81cec429b074b05e3312d030c4bddb465109622b

commit 81cec429b074b05e3312d030c4bddb465109622b
Merge: e00dc53 2bc6f1b
Author:     Greg McCullough <gmccullo@redhat.com>
AuthorDate: Mon Feb 15 14:30:32 2016 -0500
Commit:     Greg McCullough <gmccullo@redhat.com>
CommitDate: Mon Feb 15 14:30:32 2016 -0500

    Merge branch 'scvmm_delete_vm_5.5.z' into '5.5.z'
    
    Implementation on 5.5.z of the vm_delete method for SCVMM
    
    Upstream PR is: https://github.com/ManageIQ/manageiq/pull/6306
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1308663
    
    See merge request !791

 app/models/manageiq/providers/microsoft/infra_manager.rb | 7 +++++++
 1 file changed, 7 insertions(+)
Comment 4 Jeff Teehan 2016-03-22 14:21:53 EDT
It's half fixed.  It won't retire the VM if it's running (ERROR Snippet 1 below).  But after you shut it off, you can never retire it because it's being retired (ERROR Snippet 2 below).  The first error needs to clear the "being retired" flag so that the next request can go through after the remedy.

I've tried everything I could think of over a 90 minute period to reset it via the GUI but that VM is never going to be retired from CFME as near as I can tell.


ERROR Snippet 1
[----] E, [2016-03-22T12:43:10.678959 #12264:fef998] ERROR -- : <SCVMM> MIQ(Class#log_dos_error_results) Remove-SCVirtualMachine : VMM cannot remove the virtual machine because it is running

ERROR Snippet 2
[----] E, [2016-03-22T12:55:11.667320 #12267:3177638] ERROR -- : <AutomationEngine> <AEMethod start_retirement> VM is in the process of being retired. Aborting current State Machine.
[----] E, [2016-03-22T12:55:11.692265 #12267:1251998] ERROR -- : <AutomationEngine> State=<StartRetirement> running  raised exception: <Method exited with rc=MIQ_ABORT>
[----] E, [2016-03-22T12:55:12.431148 #12267:1251998] ERROR -- : MIQ(MiqAeEngine.deliver) Error delivering {:event_type=>"request_vm_retire", "VmOrTemplate::vm"=>321000000000127, :vm_id=>321000000000127, "Host::host"=>321000000000002, :host_id=>321000000000002, :retirement_initiator=>"user", :userid=>"admin", :type=>"ManageIQ::Providers::Microsoft::InfraManager::Vm", "MiqEvent::miq_event"=>321000000008113, :miq_event_id=>321000000008113, "EventStream::event_stream"=>321000000008113, :event_stream_id=>321000000008113} for object [ManageIQ::Providers::Microsoft::InfraManager::Vm.321000000000127] with state [] to Automate:
Comment 5 Bronagh Sorota 2016-03-22 16:26:51 EDT
Hi Jeff,
I tested this on the rails console with a 5.5.z server running and the VM was deleted as expected in SCVMM.
The steps I took on the rails console were:

v = Vm.where(name: "name_of_vm").first
e = ManageIQ::Providers::Microsoft::InfraManager.first
e.vm_destroy(v)
EmsRefresh.refresh(e)

As a next step I would ask the Automate team to take a look
Comment 6 Tina Fitzgerald 2016-03-23 17:15:33 EDT
Hi Jeff,

Can I have the credentials for your appliance?

Thanks,
Tina
Comment 7 Jeff Teehan 2016-03-23 17:28:23 EDT
root/smartvm
admin/smartvm

Always default
Comment 8 Tina Fitzgerald 2016-03-24 12:32:41 EDT
Hi Jeff,

Based on our tests and conversation from yesterday, it appears as though retirement works properly for the scvmm provider if the vmdb and scvmm agree on the VM power state when entering retirement.  

As a result, I believe automate is working properly here.

Let me know if you have any questions.

Regards,
Tina
Comment 9 CFME Bot 2016-04-01 14:57:17 EDT
New commit detected on cfme/5.5.z:
https://code.engineering.redhat.com/gerrit/gitweb?p=cfme.git;a=commitdiff;h=7b0d5fed9fdae10699adf68ee945fc0c7eff82c4

commit 7b0d5fed9fdae10699adf68ee945fc0c7eff82c4
Merge: 26e48f5 f7aed43
Author:     Oleg Barenboim <obarenbo@redhat.com>
AuthorDate: Fri Apr 1 14:18:02 2016 -0400
Commit:     Oleg Barenboim <obarenbo@redhat.com>
CommitDate: Fri Apr 1 14:18:02 2016 -0400

    Merge branch 'scvmm_retirement_powerstatus_bug_5.5.z' into '5.5.z'
    
    SCVMM retirements power status bug fix
    
    Power off the VM before deleting it, regardless of what the power status is.
    
    This was a clean cherry pick.
    The upstream PR is: https://github.com/ManageIQ/manageiq/pull/7633
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1308663
    
    See merge request !881

 app/models/manageiq/providers/microsoft/infra_manager.rb | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
Comment 10 CFME Bot 2016-04-01 14:57:22 EDT
New commit detected on cfme/5.5.z:
https://code.engineering.redhat.com/gerrit/gitweb?p=cfme.git;a=commitdiff;h=f7aed43260c9f5a8bb8a438e2f92e410ba598dd6

commit f7aed43260c9f5a8bb8a438e2f92e410ba598dd6
Author:     Bronagh Sorota <bsorota@redhat.com>
AuthorDate: Thu Mar 31 14:26:55 2016 -0400
Commit:     Bronagh Sorota <bsorota@redhat.com>
CommitDate: Fri Apr 1 10:17:36 2016 -0400

    SCVMM retirements power status bug fix:
    Power off the VM before deleting it, regardless of what the power status is.
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1308663

 app/models/manageiq/providers/microsoft/infra_manager.rb | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
Comment 13 Jeff Teehan 2016-04-06 19:52:32 EDT
This is so much better.  I tried every trick I could think of to trip it up.  It is possible to power it on between the time when we power it off and delete it, but we'll never be able to do anything about that.

I know it was a lot of extra work but I really think this provides a better user experience, if not for the customer, than at least me.  :)  Nice work!

Moving to verified.  Tested on 5.5.3.3 using https://10.16.6.125/vm_cloud/explorer
Comment 15 errata-xmlrpc 2016-04-13 14:43:54 EDT
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

Note You need to log in before you can comment on or make changes to this bug.