Bug 1358474

Summary: VMware-Cloning a template fails when the target datacenter is nested below multiple folders
Product: Red Hat CloudForms Management Engine Reporter: Thomas Hennessy <thenness>
Component: ProvisioningAssignee: Drew Bomhof <dbomhof>
Status: CLOSED CURRENTRELEASE QA Contact: Shveta <sshveta>
Severity: high Docs Contact:
Priority: high    
Version: 5.6.0CC: benglish, cpelland, jdeubel, jhardy, jocarter, mfeifer, obarenbo, simaishi
Target Milestone: GAKeywords: TestOnly, ZStream
Target Release: 5.7.0   
Hardware: x86_64   
OS: Linux   
Whiteboard: provision:vmware
Fixed In Version: 5.7.0.0 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1361174 (view as bug list) Environment:
Last Closed: 2017-01-11 20:21:24 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: 1361174    
Attachments:
Description Flags
VI Client screen capture of logical location of datacenter that is failing
none
current logs from failing appliance showing provisioning failure none

Description Thomas Hennessy 2016-07-20 19:19:28 UTC
Created attachment 1182237 [details]
VI Client screen capture of logical location of datacenter that is failing

Description of problem:Attempts to provision from a template fail with the target destination specified with '<:placement_folder_name> updated with <[nil, nil]>'.
Provision to datacenter not within any folder is successful


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


How reproducible: see attached screen image for folder hierarchy that is failing.


Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:

Comment 2 Thomas Hennessy 2016-07-20 19:23:56 UTC
Actual Results:
Provision fails with provision spec indicating that no target location was specified (ie, multiple 'nil' entries)

Expected Results:
provisioning should succeed.


Results suggest that CFME is not correctly handling the location of a data center when it is logically nested within multiple folders.

Comment 3 Thomas Hennessy 2016-07-20 19:24:45 UTC
Created attachment 1182238 [details]
current logs from failing appliance showing provisioning failure

Comment 6 CFME Bot 2016-08-15 21:30:55 UTC
New commit detected on ManageIQ/manageiq/master:
https://github.com/ManageIQ/manageiq/commit/e6acec14a1bf5a33f5b9f2fa88ca5016ffef7f1f

commit e6acec14a1bf5a33f5b9f2fa88ca5016ffef7f1f
Author:     Drew Bomhof <dbomhof>
AuthorDate: Thu Aug 4 12:42:30 2016 -0400
Commit:     Drew Bomhof <dbomhof>
CommitDate: Mon Aug 15 16:35:40 2016 -0400

    No longer default a datacenter at the root folder of a host.
    
    If a datacenter was nested logically under various folders
    We were unable to find the placement id during a vmware provision
    request.
    
    This fix always does a lookup of the folder path from the
    host datacenter instead of statically setting a possible wrong
    default value.
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1358474
    
    https://www.pivotaltracker.com/story/show/127205001

 .../vmware/infra_manager/provision/cloning.rb      |  4 +--
 .../vmware/infra_manager/provision_spec.rb         | 34 ++++++++++++++++++++--
 2 files changed, 34 insertions(+), 4 deletions(-)

Comment 7 Shveta 2016-09-19 22:25:26 UTC
"Clone this template" and 
"Provision VM from this template" worked fine with data center nested below multiple folder.

Build : 5.7.0.0.20160906172503_12f65cb