Bug 1368137

Summary: default placement folder name in vmware varries depending on localization
Product: Red Hat CloudForms Management Engine Reporter: Felix Dewaleyne <fdewaley>
Component: AutomateAssignee: Drew Bomhof <dbomhof>
Status: CLOSED CURRENTRELEASE QA Contact: Milan Falešník <mfalesni>
Severity: high Docs Contact:
Priority: high    
Version: 5.6.0CC: cchen, fdewaley, gmccullo, jhardy, jocarter, mfalesni, mkanoor, myoder, obarenbo, simaishi, tfitzger
Target Milestone: GAKeywords: TestOnly, ZStream
Target Release: 5.7.0   
Hardware: All   
OS: All   
Whiteboard:
Fixed In Version: 5.7.0.1 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1376145 (view as bug list) Environment:
Last Closed: 2017-01-11 19:51:20 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: VMware Target Upstream Version:
Bug Depends On:    
Bug Blocks: 1376145    

Description Felix Dewaleyne 2016-08-18 13:51:46 UTC
Description of problem:
default placement folder name in vmware varries depending on localization ; this means that the usage of ${datacenter}/Discovered VMs may not work in all cases

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

How reproducible:
all the time 

Steps to Reproduce:
1.install vmware in another language (see additonal infos)
2. run the default automate to create a vm from a template
3.

Actual results:
the provision fails at 
"""
[----] I, [2016-08-16T14:23:29.226833 #12983:9ab988]  INFO -- : Q-task_id([miq_provision_1000000001464]) Starting Phase <provision_error>
[----] E, [2016-08-16T14:23:29.273396 #12983:9ab988] ERROR -- : Q-task_id([miq_provision_1000000001464]) MIQ(ManageIQ::Providers::Vmware::InfraManager::Provision#provision_error) [[NoMethodError]: undefined method `name' for nil:NilClass] encountered during phase [start_clone_task]
[----] E, [2016-08-16T14:23:29.273538 #12983:9ab988] ERROR -- : Q-task_id([miq_provision_1000000001464]) /var/www/miq/vmdb/app/models/manageiq/providers/vmware/infra_manager/provision/cloning.rb:84:in `log_clone_options'
/var/www/miq/vmdb/app/models/manageiq/providers/vmware/infra_manager/provision/state_machine.rb:21:in `start_clone_task'
/var/www/miq/vmdb/app/models/miq_request_task/state_machine.rb:17:in `signal'
/var/www/miq/vmdb/app/models/manageiq/providers/vmware/infra_manager/provision/state_machine.rb:11:in `determine_placement'
/var/www/miq/vmdb/app/models/miq_request_task/state_machine.rb:17:in `signal'
/var/www/miq/vmdb/app/models/manageiq/providers/vmware/infra_manager/provision/state_machine.rb:3:in `create_destination'
/var/www/miq/vmdb/app/models/miq_request_task/state_machine.rb:17:in `signal'
/var/www/miq/vmdb/app/models/miq_provision/state_machine.rb:4:in `run_provision'
/var/www/miq/vmdb/app/models/miq_request_task/state_machine.rb:17:in `signal'
/var/www/miq/vmdb/app/models/miq_provision_task.rb:15:in `do_request'
/var/www/miq/vmdb/app/models/miq_request_task.rb:192:in `execute'
/var/www/miq/vmdb/app/models/miq_queue.rb:345:in `block in deliver'
/opt/rh/rh-ruby22/root/usr/share/ruby/timeout.rb:89:in `block in timeout'
/opt/rh/rh-ruby22/root/usr/share/ruby/timeout.rb:34:in `block in catch'
/opt/rh/rh-ruby22/root/usr/share/ruby/timeout.rb:34:in `catch'
/opt/rh/rh-ruby22/root/usr/share/ruby/timeout.rb:34:in `catch'
/opt/rh/rh-ruby22/root/usr/share/ruby/timeout.rb:104:in `timeout'
/var/www/miq/vmdb/app/models/miq_queue.rb:341:in `deliver'
/var/www/miq/vmdb/app/models/miq_queue_worker_base/runner.rb:106:in `deliver_queue_message'
/var/www/miq/vmdb/app/models/miq_queue_worker_base/runner.rb:134:in `deliver_message'
/var/www/miq/vmdb/app/models/miq_queue_worker_base/runner.rb:152:in `block in do_work'
/var/www/miq/vmdb/app/models/miq_queue_worker_base/runner.rb:146:in `loop'
/var/www/miq/vmdb/app/models/miq_queue_worker_base/runner.rb:146:in `do_work'
/var/www/miq/vmdb/app/models/miq_worker/runner.rb:334:in `block in do_work_loop'
/var/www/miq/vmdb/app/models/miq_worker/runner.rb:331:in `loop'
/var/www/miq/vmdb/app/models/miq_worker/runner.rb:331:in `do_work_loop'
/var/www/miq/vmdb/app/models/miq_worker/runner.rb:153:in `run'
/var/www/miq/vmdb/app/models/miq_worker/runner.rb:128:in `start'
/var/www/miq/vmdb/app/models/miq_worker/runner.rb:21:in `start_worker'
/var/www/miq/vmdb/app/models/miq_worker.rb:346:in `block in start'
/opt/rh/cfme-gemset/gems/nakayoshi_fork-0.0.3/lib/nakayoshi_fork.rb:24:in `fork'
/opt/rh/cfme-gemset/gems/nakayoshi_fork-0.0.3/lib/nakayoshi_fork.rb:24:in `fork'
/var/www/miq/vmdb/app/models/miq_worker.rb:344:in `start'
/var/www/miq/vmdb/app/models/miq_worker.rb:274:in `start_worker'
/var/www/miq/vmdb/app/models/miq_worker.rb:154:in `block in sync_workers'
/var/www/miq/vmdb/app/models/miq_worker.rb:154:in `times'
/var/www/miq/vmdb/app/models/miq_worker.rb:154:in `sync_workers'
/var/www/miq/vmdb/app/models/miq_server/worker_management/monitor.rb:52:in `block in sync_workers'
/var/www/miq/vmdb/app/models/miq_server/worker_management/monitor.rb:50:in `each'
/var/www/miq/vmdb/app/models/miq_server/worker_management/monitor.rb:50:in `sync_workers'
/var/www/miq/vmdb/app/models/miq_server.rb:173:in `start'
/var/www/miq/vmdb/app/models/miq_server.rb:265:in `start'
/var/www/miq/vmdb/lib/workers/evm_server.rb:65:in `start'
/var/www/miq/vmdb/lib/workers/evm_server.rb:92:in `start'
/var/www/miq/vmdb/lib/workers/bin/evm_server.rb:4:in `<main>'

"""

and in automation.log the only clue is 

"""
[----] I, [2016-08-16T16:45:48.025843 #12987:9ab988]  INFO -- : Q-task_id([miq_provision_1000000001491]) In State=[CheckProvisioned], invoking [on_error] method=[update_provision_status(status => '[NoMethodError]: undefined method `name' for nil:NilClass')]
"""

Expected results:
the provision passes and continues or fails with a more explicit error

Additional info:

Comment 2 Felix Dewaleyne 2016-08-18 14:00:07 UTC
Additional info :

- seen with a french install of vmware with Discovered Vms replaced by "Machine Virtuelle Détectée"

because of this the provision fails with the provision folder being set to [nil, nil]

there are two possible workarounds : 

- override line 54 of / RedHat / Infrastructure / VM / Provisioning / StateMachines / Methods / vmware_PreProvision  and use the right name for your installation

- set in the vmware_customize the folder name to not use the default - if on the provisioning object placement_folder_name is defined that will be used.

Comment 3 Greg McCullough 2016-08-29 13:45:07 UTC
*** Bug 1371007 has been marked as a duplicate of this bug. ***

Comment 4 CFME Bot 2016-09-13 13:02:50 UTC
New commit detected on cfme_productization/master:
https://code.engineering.redhat.com/gerrit/gitweb?p=cfme_productization.git;a=commit;h=2e1252ef3796a28eb1ea14dbf2e6fb4de71e24fc

commit 2e1252ef3796a28eb1ea14dbf2e6fb4de71e24fc
Author:     Drew Bomhof <dbomhof>
AuthorDate: Mon Sep 12 16:19:16 2016 -0400
Commit:     Drew Bomhof <dbomhof>
CommitDate: Mon Sep 12 16:19:16 2016 -0400

    Remove Discovered Virtual Machine as a default folder
    
    The RedHat pre provision method now defaults to the root of the
    datacenter as opposed to the Discovered Virtual Machine folder
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1368137
    
    https://www.pivotaltracker.com/story/show/130234341

 .../Methods.class/__methods__/vmware_preprovision.rb           | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

Comment 5 CFME Bot 2016-09-13 13:02:57 UTC
New commit detected on cfme_productization/master:
https://code.engineering.redhat.com/gerrit/gitweb?p=cfme_productization.git;a=commit;h=2ef3c4e8784ac830cf39208ea87128571c5fc2ed

commit 2ef3c4e8784ac830cf39208ea87128571c5fc2ed
Merge: ba64f3c 2e1252e
Author:     Greg McCullough <gmccullo>
AuthorDate: Tue Sep 13 08:59:09 2016 -0400
Commit:     Greg McCullough <gmccullo>
CommitDate: Tue Sep 13 08:59:09 2016 -0400

    Merge branch 'remove_discovered_virtual_machine' into 'master'
    
    Remove Discovered Virtual Machine as a default folder
    
    The RedHat pre provision method now defaults to the root of the
    datacenter as opposed to the Discovered Virtual Machine folder
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1368137
    
    https://www.pivotaltracker.com/story/show/130234341
    
    See merge request !334

 .../Methods.class/__methods__/vmware_preprovision.rb           | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

Comment 7 Milan Falešník 2016-09-29 12:52:17 UTC
Verified in 5.7.0.1 against 5.6.2.1

5.6 created the VMs in the Discovered Virtual Machines folder by default
5.7 does it in the root folder, therefore removing the dependence on specific localization.
I used the automatic placement selection.