Bug 1399141

Summary: Edit infra vm:able to set parent/child vm that of cloud providers
Product: Red Hat CloudForms Management Engine Reporter: Aziza Karol <akarol>
Component: ProvidersAssignee: Marcel Hild <mhild>
Status: CLOSED CURRENTRELEASE QA Contact: Antonin Pagac <apagac>
Severity: medium Docs Contact:
Priority: medium    
Version: 5.7.0CC: apagac, jfrey, jhardy, obarenbo, simaishi
Target Milestone: GAKeywords: TestOnly, ZStream
Target Release: 5.9.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: genealogy
Fixed In Version: 5.9.0.5 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1506746 1506748 (view as bug list) Environment:
Last Closed: 2018-03-06 14:57:18 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:
Bug Depends On:    
Bug Blocks: 1506746, 1506748    
Attachments:
Description Flags
genealogy tree(parent/child vm)
none
snapshot clicking on parent vm none

Description Aziza Karol 2016-11-28 11:52:50 UTC
Description of problem:


Version-Release number of selected component (if applicable):
5.7.0.12-rc2.20161123111642_a4a65ce 

How reproducible:
100%

Steps to Reproduce:
When you have two providers added say one cloud and one infra and when you try edit a infra vm, the parent vm and child selection drop down list all the cloud provider vm's also.

Vice versa while editing cloud instance too.

Actual results:


Expected results:
Only vm's related to respected provider should be displayed.

Additional info:

Comment 2 Aziza Karol 2016-11-28 12:19:03 UTC
After doing the above mentioned steps, click on the genealogy tree and access the parent/child vms. In it's summary page try clicking on the parent vm "undefined method `key_pairs' error was thrown in production.log. see attached screenshots.


production.log
[----] I, [2016-11-28T07:09:42.928354 #2979:15f877c]  INFO -- :   Rendered shared/summary/_textual.html.haml (133.3ms)
[----] I, [2016-11-28T07:09:42.928618 #2979:15f877c]  INFO -- :   Rendered vm_common/_main.html.haml (376.9ms)
[----] F, [2016-11-28T07:09:42.928988 #2979:15f877c] FATAL -- : Error caught: [ActionView::Template::Error] undefined method `key_pairs' for #<ManageIQ::Providers::Vmware::InfraManager::Vm:0x0000001fe09740>
/opt/rh/cfme-gemset/gems/activemodel-5.0.0.1/lib/active_model/attribute_methods.rb:433:in `method_missing'
/var/www/miq/vmdb/app/helpers/vm_cloud_helper/textual_summary.rb:144:in `textual_key_pairs'
/var/www/miq/vmdb/app/helpers/textual_summary_helper.rb:16:in `expand_textual_summary'
/var/www/miq/vmdb/app/helpers/textual_summary_helper.rb:39:in `block in expand_textual_group'
/var/www/miq/vmdb/app/helpers/textual_summary_helper.rb:39:in `map'
/var/www/miq/vmdb/app/helpers/textual_summary_helper.rb:39:in `expand_textual_group'
/var/www/miq/vmdb/app/views/shared/summary/_textual.html.haml:1:in `_app_views_shared_summary__textual_html_haml__2456729719472233926_212847020'
/opt/rh/cfme-gemset/gems/actionview-5.0.0.1/lib/action_view/template.rb:158:in `block in render'
/opt/rh/cfme-gemset/gems/activesupport-5.0.0.1/lib/active_support/notifications.rb:166:in `instrument'
/opt/rh/cfme-gemset/gems/actionview-5.0.0.1/lib/action_view/template.rb:348:in `instrument'
/opt/rh/cfme-gemset/gems/actionview-5.0.0.1/lib/action_view/template.rb:156:in `render'
/opt/rh/cfme-gemset/gems/actionview-5.0.0.1/lib/action_view/renderer/partial_renderer.rb:343:in `render_partial'
/opt/rh/cfme-gemset/gems/actionview-5.0.0.1/lib/action_view/renderer/partial_renderer.rb:311:in `block in render'
/opt/rh/cfme-gemset/gems/actionview-5.0.0.1/lib/action_view/renderer/abstract_renderer.rb:42:in `block in instrument'
/opt/rh/cfme-gemset/gems/activesupport-5.0.0.1/lib/active_support/notifications.rb:164:in `block in instrument'
/opt/rh/cfme-gemset/gems/activesupport-5.0.0.1/lib/active_support/notifications/instrumenter.rb:21:in `instrument'
/opt/rh/cfme-gemset/gems/activesupport-5.0.0.1/lib/active_support/notifications.rb:164:in `instrument'
/opt/rh/cfme-gemset/gems/actionview-5.0.0.1/lib/action_view/renderer/abstract_renderer.rb:41:in `instrument'
/opt/rh/cfme-gemset/gems/actionview-5.0.0.1/lib/action_view/renderer/partial_renderer.rb:310:in `render'
/opt/rh/cfme-gemset/gems/actionview-5.0.0.1/lib/action_view/renderer/renderer.rb:47:in `render_partial'
/opt/rh/cfme-gemset/gems/actionview-5.0.0.1/lib/action_view/renderer/renderer.rb:21:in `render'
/opt/rh/cfme-gemset/gems/actionview-5.0.0.1/lib/action_view/helpers/rendering_helper.rb:32:in `render'
/var/www/miq/vmdb/app/views/vm_common/_main.html.haml:16:in `_app_views_vm_common__main_html_haml__78978718896781343_215153480'
/opt/rh/cfme-gemset/gems/actionview-5.0.0.1/lib/action_view/template.rb:158:in `block in render'
/opt/rh/cfme-gemset/gems/activesupport-5.0.0.1/lib/active_support/notifications.rb:166:in `instrument'
/opt/rh/cfme-gemset/gems/actionview-5.0.0.1/lib/action_view/template.rb:348:in `instrument'
/opt/rh/cfme-gemset/gems/actionview-5.0.0.1/lib/action_view/template.rb:156:in `render'
/opt/rh/cfme-gemset/gems/actionview-5.0.0.1/lib/action_view/renderer/partial_renderer.rb:343:in `render_partial'
/opt/rh/cfme-gemset/gems/actionview-5.0.0.1/lib/action_view/renderer/partial_renderer.rb:311:in `block in render'
/opt/rh/cfme-gemset/gems/actionview-5.0.0.1/lib/action_view/renderer/abstract_renderer.rb:42:in `block in instrument'
/opt/rh/cfme-gemset/gems/activesupport-5.0.0.1/lib/active_support/notifications.rb:164:in `block in instrument'
/opt/rh/cfme-gemset/gems/activesupport-5.0.0.1/lib/active_support/notifications/instrumenter.rb:21:in `instrument'
/opt/rh/cfme-gemset/gems/activesupport-5.0.0.1/lib/active_support/notifications.rb:164:in `instrument'
/opt/rh/cfme-gemset/gems/actionview-5.0.0.1/lib/action_view/renderer/abstract_renderer.rb:41:in `instrument'
/opt/rh/cfme-gemset/gems/actionview-5.0.0.1/lib/action_view/renderer/partial_renderer.rb:310:in `render'
/opt/rh/cfme-gemset/gems/actionview-5.0.0.1/lib/action_view/renderer/renderer.rb:47:in `render_partial'
/opt/rh/cfme-gemset/gems/actionview-5.0.0.1/lib/action_view/renderer/renderer.rb:21:in `render'
/opt/rh/cfme-gemset/gems/actionview-5.0.0.1/lib/action_view/rendering.rb:103:in `_render_template'
/opt/rh/cfme-gemset/gems/actionpack-5.0.0.1/lib/action_controller/metal/streaming.rb:217:in `_render_template'
/opt/rh/cfme-gemset/gems/actionview-5.0.0.1/lib/action_view/rendering.rb:83:in `render_to_body'
/opt/rh/cfme-gemset/gems/actionpack-5.0.0.1/lib/action_controller/metal/rendering.rb:52:in `render_to_body'
/opt/rh/cfme-gemset/gems/actionpack-5.0.0.1/lib/action_controller/metal/renderers.rb:144:in `render_to_body'
/opt/rh/cfme-gemset/gems/actionpack-5.0.0.1/lib/abstract_controller/rendering.rb:48:in `render_to_string'
/opt/rh/cfme-gemset/gems/actionpack-5.0.0.1/lib/action_controller/metal/rendering.rb:41:in `render_to_string'
/var/www/miq/vmdb/app/controllers/vm_common.rb:1442:in `block in replace_right_cell'
/var/www/miq/vmdb/app/controllers/vm_common.rb:1448:in `replace_right_cell'
/var/www/miq/vmdb/app/controllers/vm_common.rb:1134:in `tree_select'
/var/www/miq/vmdb/app/controllers/vm_common.rb:190:in `block (2 levels) in x_show'
/opt/rh/cfme-gemset/gems/actionpack-5.0.0.1/lib/action_controller/metal/mime_responds.rb:201:in `respond_to'
/var/www/miq/vmdb/app/controllers/vm_common.rb:183:in `x_show'
/opt/rh/cfme-gemset/gems/actionpack-5.0.0.1/lib/action_controller/metal/basic_implicit_render.rb:4:in `send_action'
/opt/rh/cfme-gemset/gems/actionpack-5.0.0.1/lib/abstract_controller/base.rb:188:in `process_action'
/opt/rh/cfme-gemset/gems/actionpack-5.0.0.1/lib/action_controller/metal/rendering.rb:30:in `process_action'
/opt/rh/cfme-gemset/gems/actionpack-5.0.0.1/lib/abstract_controller/callbacks.rb:20:in `block in process_action'
/opt/rh/cfme-gemset/gems/activesupport-5.0.0.1/lib/active_support/callbacks.rb:126:in `call'
/opt/rh/cfme-gemset/gems/activesupport-5.0.0.1/lib/active_support/callbacks.rb:506:in `block (2 levels) in compile'
/opt/rh/cfme-gemset/gems/activesupport-5.0.0.1/lib/active_support/callbacks.rb:455:in `call'
/opt/rh/cfme-gemset/gems/activesupport-5.0.0.1/lib/active_support/callbacks.rb:101:in `__run_callbacks__'
/opt/rh/cfme-gemset/gems/activesupport-5.0.0.1/lib/active_support/callbacks.rb:750:in `_run_process_action_callbacks'
/opt/rh/cfme-gemset/gems/activesupport-5.0.0.1/lib/active_support/callbacks.rb:90:in `run_callbacks'
/opt/rh/cfme-gemset/gems/actionpack-5.0.0.1/lib/abstract_controller/callbacks.rb:19:in `process_action'
/opt/rh/cfme-gemset/gems/actionpack-5.0.0.1/lib/action_controller/metal/rescue.rb:20:in `process_action'
/opt/rh/cfme-gemset/gems/actionpack-5.0.0.1/lib/action_controller/metal/instrumentation.rb:32:in `block in process_action'
/opt/rh/cfme-gemset/gems/activesupport-5.0.0.1/lib/active_support/notifications.rb:164:in `block in instrument'
/opt/rh/cfme-gemset/gems/activesupport-5.0.0.1/lib/active_support/notifications/instrumenter.rb:21:in `instrument'
/opt/rh/cfme-gemset/gems/activesupport-5.0.0.1/lib/active_support/notifications.rb:164:in `instrument'
/opt/rh/cfme-gemset/gems/actionpack-5.0.0.1/lib/action_controller/metal/instrumentation.rb:30:in `process_action'
/opt/rh/cfme-gemset/gems/actionpack-5.0.0.1/lib/action_controller/metal/params_wrapper.rb:248:in `process_action'
/opt/rh/cfme-gemset/gems/activerecord-5.0.0.1/lib/active_record/railties/controller_runtime.rb:18:in `process_action'
/opt/rh/cfme-gemset/gems/actionpack-5.0.0.1/lib/abstract_controller/base.rb:126:in `process'
/opt/rh/cfme-gemset/gems/actionview-5.0.0.1/lib/action_view/rendering.rb:30:in `process'
/opt/rh/cfme-gemset/gems/actionpack-5.0.0.1/lib/action_controller/metal.rb:190:in `dispatch'
/opt/rh/cfme-gemset/gems/actionpack-5.0.0.1/lib/action_controller/metal.rb:262:in `dispatch'
/opt/rh/cfme-gemset/gems/actionpack-5.0.0.1/lib/action_dispatch/routing/route_set.rb:50:in `dispatch'
/opt/rh/cfme-gemset/gems/actionpack-5.0.0.1/lib/action_dispatch/routing/route_set.rb:32:in `serve'
/opt/rh/cfme-gemset/gems/actionpack-5.0.0.1/lib/action_dispatch/journey/router.rb:39:in `block in serve'
/opt/rh/cfme-gemset/gems/actionpack-5.0.0.1/lib/action_dispatch/journey/router.rb:26:in `each'
/opt/rh/cfme-gemset/gems/actionpack-5.0.0.1/lib/action_dispatch/journey/router.rb:26:in `serve'
/opt/rh/cfme-gemset/gems/actionpack-5.0.0.1/lib/action_dispatch/routing/route_set.rb:725:in `call'
/opt/rh/cfme-gemset/gems/secure_headers-3.0.3/lib/secure_headers/middleware.rb:10:in `call'
/opt/rh/cfme-gemset/gems/rack-2.0.1/lib/rack/etag.rb:25:in `call'
/opt/rh/cfme-gemset/gems/rack-2.0.1/lib/rack/conditional_get.rb:38:in `call'
/opt/rh/cfme-gemset/gems/rack-2.0.1/lib/rack/head.rb:12:in `call'
/opt/rh/cfme-gemset/gems/rack-2.0.1/lib/rack/session/abstract/id.rb:222:in `context'
/opt/rh/cfme-gemset/gems/rack-2.0.1/lib/rack/session/abstract/id.rb:216:in `call'
/opt/rh/cfme-gemset/gems/actionpack-5.0.0.1/lib/action_dispatch/middleware/cookies.rb:613:in `call'
/opt/rh/cfme-gemset/gems/actionpack-5.0.0.1/lib/action_dispatch/middleware/callbacks.rb:38:in `block in call'
/opt/rh/cfme-gemset/gems/activesupport-5.0.0.1/lib/active_support/callbacks.rb:97:in `__run_callbacks__'
/opt/rh/cfme-gemset/gems/activesupport-5.0.0.1/lib/active_support/callbacks.rb:750:in `_run_call_callbacks'
/opt/rh/cfme-gemset/gems/activesupport-5.0.0.1/lib/active_support/callbacks.rb:90:in `run_callbacks'
/opt/rh/cfme-gemset/gems/actionpack-5.0.0.1/lib/action_dispatch/middleware/callbacks.rb:36:in `call'
/opt/rh/cfme-gemset/gems/actionpack-5.0.0.1/lib/action_dispatch/middleware/remote_ip.rb:79:in `call'
/opt/rh/cfme-gemset/gems/actionpack-5.0.0.1/lib/action_dispatch/middleware/debug_exceptions.rb:49:in `call'
/opt/rh/cfme-gemset/gems/actionpack-5.0.0.1/lib/action_dispatch/middleware/show_exceptions.rb:31:in `call'
/opt/rh/cfme-gemset/gems/railties-5.0.0.1/lib/rails/rack/logger.rb:36:in `call_app'
/opt/rh/cfme-gemset/gems/railties-5.0.0.1/lib/rails/rack/logger.rb:26:in `call'
/opt/rh/cfme-gemset/gems/request_store-1.3.1/lib/request_store/middleware.rb:9:in `call'
/opt/rh/cfme-gemset/gems/actionpack-5.0.0.1/lib/action_dispatch/middleware/request_id.rb:24:in `call'
/opt/rh/cfme-gemset/gems/rack-2.0.1/lib/rack/method_override.rb:22:in `call'
/opt/rh/cfme-gemset/gems/rack-2.0.1/lib/rack/runtime.rb:22:in `call'
/opt/rh/cfme-gemset/gems/activesupport-5.0.0.1/lib/active_support/cache/strategy/local_cache_middleware.rb:28:in `call'
/opt/rh/cfme-gemset/gems/actionpack-5.0.0.1/lib/action_dispatch/middleware/executor.rb:12:in `call'
/opt/rh/cfme-gemset/gems/rack-2.0.1/lib/rack/sendfile.rb:111:in `call'
/opt/rh/cfme-gemset/gems/railties-5.0.0.1/lib/rails/engine.rb:522:in `call'
/opt/rh/rh-ruby23/root/usr/share/gems/gems/puma-3.3.0/lib/puma/configuration.rb:224:in `call'
/opt/rh/rh-ruby23/root/usr/share/gems/gems/puma-3.3.0/lib/puma/server.rb:561:in `handle_request'
/opt/rh/rh-ruby23/root/usr/share/gems/gems/puma-3.3.0/lib/puma/server.rb:406:in `process_client'
/opt/rh/rh-ruby23/root/usr/share/gems/gems/puma-3.3.0/lib/puma/server.rb:271:in `block in run'
/opt/rh/rh-ruby23/root/usr/share/gems/gems/puma-3.3.0/lib/puma/thread_pool.rb:111:in `block in spawn_thread'
[----] I, [2016-11-28T07:09:42.930604 #2979:15f877c]  INFO -- :   Rendered layouts/_exception_contents.html.haml (

Comment 3 Aziza Karol 2016-11-28 12:19:45 UTC
Created attachment 1225270 [details]
genealogy tree(parent/child vm)

Comment 4 Aziza Karol 2016-11-28 12:21:05 UTC
Created attachment 1225271 [details]
snapshot clicking on parent vm

Comment 5 Marcel Hild 2017-02-15 14:19:33 UTC
Thats because only cloud_vms have key_pairs

https://github.com/durandom/manageiq/blob/master/app/models/manageiq/providers/cloud_manager.rb#L30

Looks like the wrong helper (cloud) was called for an infra vm.

Comment 6 Antonin Pagac 2017-05-30 10:23:53 UTC
For 5.8.0.17, I can still see cloud instances while editing infrastructure VM.

Comment 7 Marcel Hild 2017-10-02 14:57:25 UTC
on_dev https://github.com/ManageIQ/manageiq-ui-classic/pull/2271

Comment 10 Antonin Pagac 2017-11-03 09:38:53 UTC
I'm now able to set parent/child relationship to a VM/instance only from respective provider. Works both with cloud and infra providers.

Verified with 5.9.0.5.