Bug 1305980

Summary: policy events do not trigger retirement with aws
Product: Red Hat CloudForms Management Engine Reporter: Colin Arnott <carnott>
Component: ControlAssignee: Greg McCullough <gmccullo>
Status: CLOSED NOTABUG QA Contact: Dave Johnson <dajohnso>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 5.5.0CC: benglish, carnott, jhardy, obarenbo
Target Milestone: GA   
Target Release: 5.6.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-02-10 14:19: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:

Description Colin Arnott 2016-02-09 17:36:52 UTC
Description of problem:
With aws as a cloud provider, events do not to trigger retirement and spawn errors. Manual retirement through the GUI is functional, can be confirmed on aws and generates no errors.

Version-Release number of selected component (if applicable):
cfme-5.5.2.4-1.el7cf.x86_64

How reproducible:
add aws as cloud provider

Steps to Reproduce:
1. add aws as cloud provider
2. provision an aws instance
3. create a policy with event add tag
4. add action "retire virtual machine"
5. add tag to instance

Actual results:
the instance has no state change, and evm.log shows errors

Expected results:
the instance should be retired

Additional info:
/var/www/miq/vmdb/log/evm.log

```
[----] E, [2016-02-09T10:14:14.783605 #23762:4d1994] ERROR -- : MIQ(miq_policy_controller-condition_edit): Description can't be blank
[----] E, [2016-02-09T10:46:22.663279 #23741:89d988] ERROR -- : MIQ(MiqQueue#m_callback) Message id: [2000000067473]: undefined method `vm_suspend' for #<ManageIQ::Providers::Amazon::CloudManager:0x000000061a14d0>
[----] E, [2016-02-09T11:09:40.609267 #23747:2e682a8] ERROR -- : <AutomationEngine> <AEMethod start_retirement> VM is in the process of being retired. Aborting current State Machine.
[----] E, [2016-02-09T11:09:40.630750 #23747:1173990] ERROR -- : <AutomationEngine> State=<StartRetirement> running  raised exception: <Method exited with rc=MIQ_ABORT>
[----] E, [2016-02-09T11:09:41.346875 #23747:1173990] ERROR -- : MIQ(MiqAeEngine.deliver) Error delivering {:event_type=>"request_vm_retire", "VmOrTemplate::vm"=>2000000000309, :vm_id=>2000000000309, :retirement_initiator=>"system", :host=>nil, :type=>"ManageIQ::Providers::Amazon::CloudManager::Vm", "MiqEvent::miq_event"=>2000000001345, :miq_event_id=>2000000001345, "EventStream::event_stream"=>2000000001345, :event_stream_id=>2000000001345} for object [ManageIQ::Providers::Amazon::CloudManager::Vm.2000000000309] with state [] to Automate: 
[----] E, [2016-02-09T11:10:10.322261 #23762:4d1994] ERROR -- : MIQ(ops_controller-ce_accept): Name must be lowercase alphanumeric characters and underscores without spaces
[----] E, [2016-02-09T11:10:57.960074 #23744:73399cc] ERROR -- : <AutomationEngine> <AEMethod start_retirement> VM is in the process of being retired. Aborting current State Machine.
[----] E, [2016-02-09T11:10:57.986927 #23744:36b988] ERROR -- : <AutomationEngine> State=<StartRetirement> running  raised exception: <Method exited with rc=MIQ_ABORT>
[----] E, [2016-02-09T11:10:58.113006 #23741:e4e3c8] ERROR -- : <AutomationEngine> <AEMethod start_retirement> VM is in the process of being retired. Aborting current State Machine.
[----] E, [2016-02-09T11:10:58.142092 #23741:89d988] ERROR -- : <AutomationEngine> State=<StartRetirement> running  raised exception: <Method exited with rc=MIQ_ABORT>
[----] E, [2016-02-09T11:10:58.867984 #23744:36b988] ERROR -- : MIQ(MiqAeEngine.deliver) Error delivering {:event_type=>"request_vm_retire", "VmOrTemplate::vm"=>2000000000309, :vm_id=>2000000000309, :retirement_initiator=>"system", :host=>nil, :type=>"ManageIQ::Providers::Amazon::CloudManager::Vm", "MiqEvent::miq_event"=>2000000001348, :miq_event_id=>2000000001348, "EventStream::event_stream"=>2000000001348, :event_stream_id=>2000000001348} for object [ManageIQ::Providers::Amazon::CloudManager::Vm.2000000000309] with state [] to Automate: 
[----] E, [2016-02-09T11:10:59.146560 #23741:89d988] ERROR -- : MIQ(MiqAeEngine.deliver) Error delivering {:event_type=>"request_vm_retire", "VmOrTemplate::vm"=>2000000000309, :vm_id=>2000000000309, :retirement_initiator=>"system", :host=>nil, :type=>"ManageIQ::Providers::Amazon::CloudManager::Vm", "MiqEvent::miq_event"=>2000000001349, :miq_event_id=>2000000001349, "EventStream::event_stream"=>2000000001349, :event_stream_id=>2000000001349} for object [ManageIQ::Providers::Amazon::CloudManager::Vm.2000000000309] with state [] to Automate: 
```

Comment 2 Greg McCullough 2016-02-10 21:23:47 UTC
Colin - Please provide some detail as to why you are closing this ticket so we have some information on what resolved your issue.

Comment 3 Colin Arnott 2016-02-11 01:21:57 UTC
Greg,

I came across these log lines while trying to setup a minimal aws policy. There seemed to be issues with policy events and actions on aws instances. However, upon further testing these symptoms disappeared, and policy actions were as expected.

Since the issue became non-reproducible, I thought it best to close the bug. Let me know if you would like more information.