Description of problem: Some reports run but do not generate any data. Version-Release number of selected component (if applicable): cfme-5.5.3.4 Steps to Reproduce: 1. enable C&U roles and data collection 2. wait 48h+ 3. run either of the following reports: Cloud Intelligence → Reports → Reports → Performance by Asset Type → Virtual Machines → Top CPU Consumers (weekly) Cloud Intelligence → Reports → Reports → Performance by Asset Type → Virtual Machines → Top Memory Consumers (weekly) Actual results: [----] I, [2016-05-03T09:36:32.049208 #18752:df5994] INFO -- : MIQ(Metric::Capture.perf_capture_timer) Created task id: [1000000340157] for: [EmsCluster:1000000000023] with targets: ["ManageIQ::Providers::Redhat::InfraManager::Host:1000000000032"] for time range: [2016-05-03T12:33:33Z - 2016-05-03T12:36:31Z] [----] I, [2016-05-03T09:36:32.060885 #18752:df5994] INFO -- : MIQ(Metric::Capture.perf_capture_timer) Created task id: [1000000340158] for: [EmsCluster:1000000000031] with targets: ["ManageIQ::Providers::Redhat::InfraManager::Host:1000000000017", "ManageIQ::Providers::Redhat::InfraManager::Host:1000000000009", "ManageIQ::Providers::Redhat::InfraManager::Host:1000000000008"] for time range: [2016-05-03T12:33:33Z - 2016-05-03T12:36:31Z] [----] I, [2016-05-03T09:36:32.085841 #18752:df5994] INFO -- : MIQ(Metric::Capture.perf_capture_timer) Created task id: [1000000340159] for: [EmsCluster:1000000000032] with targets: ["ManageIQ::Providers::Redhat::InfraManager::Host:1000000000033"] for time range: [2016-05-03T12:33:33Z - 2016-05-03T12:36:31Z] [----] E, [2016-05-03T09:36:32.318121 #18752:df5994] ERROR -- : MIQ(MiqQueue#deliver) Message id: [1000005808463], Error: [undefined method `metrics_collector_queue_name' for nil:NilClass] [----] E, [2016-05-03T09:36:32.318339 #18752:df5994] ERROR -- : [NoMethodError]: undefined method `metrics_collector_queue_name' for nil:NilClass Method:[rescue in deliver] [----] E, [2016-05-03T09:36:32.318634 #18752:df5994] ERROR -- : /var/www/miq/vmdb/app/models/metric/ci_mixin/capture.rb:19:in `queue_name_for_metrics_collection' [----] I, [2016-05-03T09:36:32.319058 #18752:df5994] INFO -- : MIQ(MiqQueue#delivered) Message id: [1000005808463], State: [error], Delivered in [2.202806638] seconds [----] I, [2016-05-03T09:36:35.365243 #18752:df5994] INFO -- : MIQ(MiqPriorityWorker::Runner#message_sync_active_roles) MIQ(MiqPriorityWorker::Runner) Synchronizing active roles... [----] I, [2016-05-03T09:36:35.365671 #18752:df5994] INFO -- : MIQ(MiqPriorityWorker::Runner#message_sync_active_roles) MIQ(MiqPriorityWorker::Runner) Synchronizing active roles complete... [----] I, [2016-05-03T09:36:35.365982 #18752:df5994] INFO -- : MIQ(MiqPriorityWorker::Runner#message_sync_config) MIQ(MiqPriorityWorker::Runner) Synchronizing configuration... [----] I, [2016-05-03T09:36:35.408251 #18752:df5994] INFO -- : MIQ(MiqPriorityWorker::Runner#sync_config) ID [1000000016794], PID [18752], GUID [162cdc3c-0e36-11e6-a85f-001a4a7c4942], Zone [default], Active Roles Expected results: collection of C&U data. Additional info: this may be related to this commit: https://github.com/ManageIQ/manageiq/commit/0dbb116a2f0de33a1ac2410635e4fdbe6f95aede
This overlaps with https://bugzilla.redhat.com/show_bug.cgi?id=1331803 Looks like there is an issue with cloud providers and orphans. https://github.com/ManageIQ/manageiq/pull/8429
New commit detected on ManageIQ/manageiq/master: https://github.com/ManageIQ/manageiq/commit/db0a24629e9442b2ba754bb374c6141b9aba7430 commit db0a24629e9442b2ba754bb374c6141b9aba7430 Author: Keenan Brock <kbrock> AuthorDate: Wed May 4 22:43:34 2016 -0400 Commit: Keenan Brock <kbrock> CommitDate: Wed May 4 22:53:30 2016 -0400 Metric::Target capture_cloud_targets rewrite - only bring back vms that are on (when availability_zone.nil?) - only bring back vms that have an ems https://bugzilla.redhat.com/show_bug.cgi?id=1332579 https://bugzilla.redhat.com/show_bug.cgi?id=1331803 app/models/metric/targets.rb | 1 + 1 file changed, 1 insertion(+)
https://github.com/ManageIQ/manageiq/pull/8473
*** Bug 1335150 has been marked as a duplicate of this bug. ***
Nandini Orphaned: Vm has no ems, but has ems_cluster_id (or availability zone). 1. We've written code to prevent this from happening 2. We've written code to not blow up when this does happen (yes, overkill) 1. Create a VM on ec2 2. Assign the Vm to an availability zone and ems_cluster 3. go into the console write down the vm's availability_zone_id and ems_cluster_id 4. Go into amazon and remove the VM 5. Trigger an ems refresh before this patch: 1. you should have a Vm.where(:ems_id => nil).count 2. you should have Vm.where(:ems_id => nil).where.not(:ems_cluster_id => nil).count 3. Cap&U should blow up after this patch: 1. You should have a Vm.where(:ems_id => nil).count 2. You should NOT have Vm.where(:ems_id => nil).where.not(:ems_cluster_id => nil).count 3. Cap&U should work 4. Vm.where(:ems_id => nil).update_all(:ems_cluster_id => EmsCluster.first.id) 5. Cap&U should still work
1. Vm.where(:ems_id => nil).count 2. you should see a number higher than 0 3. Vm.where(:ems_id => nil).where.not(:ems_cluster_id => nil).count 4. you should see 0 5. Cap&U should work 4. Vm.where(:ems_id => nil).update_all(:availability_zone_id => AvailabilityZone.first.id) 5. Cap&U should still work
Thanks Keenan. Steps to reproduce: 1)Terminate an instance from the ec2 console. 2)Refresh ems. With the fix, Run these commands on the rails console 1. Vm.where(:ems_id => nil).count Output : VM count is greater than 0. 2. Vm.where(:ems_id => nil).where.not(:availability_zone_id => nil).count Output : VM count = 0 Verified that C&U continues to work after this step. 3. Vm.where(:ems_id => nil).update_all(:availability_zone_id => AvailabilityZone.first.id) Verified that C&U continues to work after this step. Verified in 5.6.0.10
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
This is all set. marked attachment so bz doesn't keep emailing me