Bug 1428797
Summary: | some of events appear in timelines w/o "source vm" | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Product: | Red Hat CloudForms Management Engine | Reporter: | Ievgen Zapolskyi <izapolsk> | ||||||||||
Component: | Providers | Assignee: | Adam Grare <agrare> | ||||||||||
Status: | CLOSED ERRATA | QA Contact: | Ievgen Zapolskyi <izapolsk> | ||||||||||
Severity: | medium | Docs Contact: | |||||||||||
Priority: | medium | ||||||||||||
Version: | 5.7.0 | CC: | cpelland, gblomqui, jfrey, jhardy, obarenbo, simaishi | ||||||||||
Target Milestone: | GA | ||||||||||||
Target Release: | 5.10.0 | ||||||||||||
Hardware: | Unspecified | ||||||||||||
OS: | Unspecified | ||||||||||||
Whiteboard: | ui:timeline:event | ||||||||||||
Fixed In Version: | 5.10.0.0 | Doc Type: | If docs needed, set a value | ||||||||||
Doc Text: | Story Points: | --- | |||||||||||
Clone Of: | Environment: | ||||||||||||
Last Closed: | 2019-02-07 23:02:25 UTC | Type: | Bug | ||||||||||
Regression: | --- | Mount Type: | --- | ||||||||||
Documentation: | --- | CRM: | |||||||||||
Verified Versions: | Category: | Bug | |||||||||||
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||||||||
Cloudforms Team: | CFME Core | Target Upstream Version: | |||||||||||
Embargoed: | |||||||||||||
Attachments: |
|
Description
Ievgen Zapolskyi
2017-03-03 11:36:19 UTC
Created attachment 1259519 [details]
screenshot
glance at messages and pay attention on source vm field
Created attachment 1259521 [details]
event_streams table
Created attachment 1259523 [details]
vms table
Created attachment 1259526 [details]
screenshot
After an ems_refresh we run a number of "post_refresh_ems" tasks, one of which is to connect events to new VMs that came in before the VM was in our DB, https://github.com/ManageIQ/manageiq/blob/master/app/models/vm_or_template.rb#L804-L830 I was able to reproduce what you describe and from looking at that query and my events that don't have a vm_or_template_id set my guess is that the vm_location being nil in the event is causing reconnect_events to fail. I'll investigate if there is another way to find the events that will work with more event types. From my testing I don't see events linked up to new VMs when those events were delivered prior to the cached VM having a location. In this case we have no context to reconnect the VMs with. The only thing we could do to more reliably connect these events is to use the ems_ref as that is populated earlier than the location. This will require a schema change to add the vm_ems_ref to the ems_events table. New commit detected on ManageIQ/manageiq-schema/master: https://github.com/ManageIQ/manageiq-schema/commit/664d9899f8ad61eb140ab7bc2b14c7bc7f3d9be3 commit 664d9899f8ad61eb140ab7bc2b14c7bc7f3d9be3 Author: Adam Grare <agrare> AuthorDate: Tue Mar 13 10:00:13 2018 -0400 Commit: Adam Grare <agrare> CommitDate: Tue Mar 13 10:00:13 2018 -0400 Add vm_ems_ref to event_streams Early events in a VM's lifecycle don't contain the vmPathName yet which is used to connect events which were processed before the VM gets created by EmsRefresh. These events do however contain the ems_ref of the VM which can be used for more reliable event -> vm association. https://bugzilla.redhat.com/show_bug.cgi?id=1428797 db/migrate/20180313135925_add_vm_ems_ref_to_event_streams.rb | 6 + 1 file changed, 6 insertions(+) New commit detected on ManageIQ/manageiq/master: https://github.com/ManageIQ/manageiq/commit/1cfd5ebaca03cd3f6e888f3f1be57424f67d6d56 commit 1cfd5ebaca03cd3f6e888f3f1be57424f67d6d56 Author: Adam Grare <agrare> AuthorDate: Tue Mar 13 10:55:33 2018 -0400 Commit: Adam Grare <agrare> CommitDate: Tue Mar 13 10:55:33 2018 -0400 Use vm_ems_ref to reconnect events Events delivered early in a VM's lifecycle often do not contain the vmPathName yet and therefore cannot be connected to VMs which are saved after the events are processed. It is much more reliable to use the VM's ems_ref since that is available in all tasks and events except the initial CreateVM_Task/CloneVM_Task (since the target VM hasn't been created yet it isn't possible to link these to a VM anyway). Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1428797 app/models/ems_event.rb | 9 +- app/models/vm_or_template.rb | 6 +- 2 files changed, 11 insertions(+), 4 deletions(-) VERIFIED in 5.10.0.1 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:0212 |