Bug 1238371

Summary: Remove vm discovery as an event type
Product: Red Hat CloudForms Management Engine Reporter: Josh Carter <jocarter>
Component: ControlAssignee: Bill Wei <bilwei>
Status: CLOSED ERRATA QA Contact: Jiri Stefanisin <jistefan>
Severity: medium Docs Contact:
Priority: medium    
Version: 5.4.0CC: cpelland, fdewaley, jhardy, jocarter, jprause, mfalesni, mfeifer, ncatling, obarenbo
Target Milestone: GAKeywords: ZStream
Target Release: 5.6.0Flags: mfalesni: automate_bug-
Hardware: All   
OS: All   
Whiteboard: control:policy:event:action
Fixed In Version: 5.6.0.0 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 1293737 (view as bug list) Environment:
Last Closed: 2016-06-29 14:57:50 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: 1290186, 1293737    

Description Josh Carter 2015-07-01 18:16:03 UTC
Description of problem:

vm discovery event doe not drive the custom action to apply tag if vm discovery event is replaced with vm power on or vm power off the custom action is executed and tag is applied. 

Policy is applied at the ems level. Control policy only consist of vm discovery
and custom action to apply tag. The scope of condition is not configured in the vm control policy. 



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


How reproducible:
very

Steps to Reproduce:
1. create vm control policy with event "vm discovery" action type "tag" out of the box tag "Environment: Development"
2. create new vm in ems environment 
3. refresh the ems and wait for the vm to be discovered
4. policy is scoped but tag is not applied. 
5. wait a few mins, switch the event "vm discovery" to "vm power on" and power vm on.
6. vm is now tagged 

Actual results:
vm discovery not triggering action

Expected results:


Additional info:

Comment 2 Dave Johnson 2015-07-02 19:20:09 UTC
Milan, can you make sure we have a test around this please.

Comment 3 Greg McCullough 2015-07-02 21:58:32 UTC
I think the method you want to use is vm_create (VM Create Complete).

At the moment the vm_discover event is only tied to two RHEV-M events.

  USER_ADD_VM:
  - policy:
    - src_vm
    - vm_discover
  - refresh:
    - src_ems_cluster
...
  USER_ADD_VM_TEMPLATE_FINISHED_FAILURE:
  - policy:
    - src_vm
    - vm_discover

Comment 5 Bill Wei 2015-12-22 22:02:30 UTC
Per our analysis, we should remove VM Discovery (type vm_discover) from the UI as a selection candidate for VM control policy. The summary field of this BZ has been updated accordingly.

Comment 6 Bill Wei 2015-12-22 22:06:50 UTC
*** Bug 1209538 has been marked as a duplicate of this bug. ***

Comment 8 CFME Bot 2016-01-05 14:41:08 UTC
New commit detected on ManageIQ/manageiq/master:
https://github.com/ManageIQ/manageiq/commit/713960fa36a113293c79d8878f9f0e031aaaceeb

commit 713960fa36a113293c79d8878f9f0e031aaaceeb
Author:     Bill Wei <bilwei>
AuthorDate: Tue Dec 22 16:55:50 2015 -0500
Commit:     Bill Wei <bilwei>
CommitDate: Mon Jan 4 16:56:48 2016 -0500

    Remove vm_discover event definition
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1238371

 .../Event/EmsEvent/RHEVM.class/user_add_vm.yaml    |  2 --
 .../user_add_vm_template_finished_failure.yaml     | 12 -----------
 db/fixtures/miq_event_definitions.csv              |  1 -
 ...e_vm_discover_row_from_miq_event_definitions.rb | 18 ++++++++++++++++
 ...discover_row_from_miq_event_definitions_spec.rb | 25 ++++++++++++++++++++++
 5 files changed, 43 insertions(+), 15 deletions(-)
 delete mode 100644 db/fixtures/ae_datastore/ManageIQ/System/Event/EmsEvent/RHEVM.class/user_add_vm_template_finished_failure.yaml
 create mode 100644 db/migrate/20151222152212_remove_vm_discover_row_from_miq_event_definitions.rb
 create mode 100644 spec/migrations/20151222152212_remove_vm_discover_row_from_miq_event_definitions_spec.rb

Comment 11 errata-xmlrpc 2016-06-29 14:57:50 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:1348