Bug 1734051

Summary: [Regression][VMware] Publish VM to template takes very long time to finish and then finishes with Error
Product: Red Hat CloudForms Management Engine Reporter: Kedar Kulkarni <kkulkarn>
Component: UI - OPSAssignee: Tina Fitzgerald <tfitzger>
Status: CLOSED CURRENTRELEASE QA Contact: Kedar Kulkarni <kkulkarn>
Severity: medium Docs Contact: Red Hat CloudForms Documentation <cloudforms-docs>
Priority: medium    
Version: 5.11.0CC: bmidwood, hkataria, lavenel, mpovolny, obarenbo, simaishi, tfitzger
Target Milestone: GAKeywords: Regression
Target Release: 5.11.0Flags: kkulkarn: automate_bug+
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: vmware
Fixed In Version: 5.11.0.18 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-12-13 15:00:43 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: Bug
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: VMware Target Upstream Version:
Embargoed:

Description Kedar Kulkarni 2019-07-29 14:18:03 UTC
Description of problem:
 Publish VM to template takes very long time to finish and then finishes with Error  as follows: 

"
[EVM] VM [test-pblsh-3h9o] Step [CheckProvisioned] Status [Error Creating Template] Message [Error: undefined method `last_inventory_date' for nil:NilClass]

"

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

How reproducible:
100%

Steps to Reproduce:
1.Add Vmware Provider 
2.Select a VM and publish it to a Templates
3.Watch Request

Actual results:
Request takes a long time to finish, and when it finishes, it ends up in error state. 

Expected results:
It should publish template without errors and within reasonable amount of time. 

Additional info:
1) Template was indeed created in the VMware env, its just that cloudforms didn't detect it and finish the request. 
2) Template was not big, so time it took was certainly delay from CFME side, template was published in vmware env in timely manner. 
3) It works in 5.10.7.1

Comment 4 Tina Fitzgerald 2019-07-29 14:49:26 UTC
Hi Kedar,

Can you provide a reproducer environment?

Thanks,
Tina

Comment 6 Tina Fitzgerald 2019-07-30 15:58:41 UTC
Hi Kedar,

Thanks for the reproducer.

Requests 9 and 10 fail for different reasons.
Can you make sure you can publish both of them successfully directly through vmware?
(Or, can you supply the credentials so I can do it?)

Thanks,
Tina

Comment 7 Kedar Kulkarni 2019-07-30 17:26:29 UTC
Hey Tina I will follow up with you on Chat regarding env access.
-KK.

Comment 9 CFME Bot 2019-07-30 21:06:33 UTC
New commit detected on ManageIQ/manageiq-providers-vmware/master:

https://github.com/ManageIQ/manageiq-providers-vmware/commit/683b89698c9c94f964591dec3e5949cbfd6714e3
commit 683b89698c9c94f964591dec3e5949cbfd6714e3
Author:     Adam Grare <agrare>
AuthorDate: Tue Jul 30 15:09:34 2019 -0400
Commit:     Adam Grare <agrare>
CommitDate: Tue Jul 30 15:09:34 2019 -0400

    Fix clone vm to template check_provision

    The same find_destination_in_vmdb is used when cloning a vm to a
    template, so we can't use ext_management_system.vms.find_by()

    https://bugzilla.redhat.com/show_bug.cgi?id=1734051

 app/models/manageiq/providers/vmware/infra_manager/provision/cloning.rb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comment 10 CFME Bot 2019-07-30 22:26:40 UTC
New commit detected on ManageIQ/manageiq-providers-vmware/ivanchuk:

https://github.com/ManageIQ/manageiq-providers-vmware/commit/5edf69884b5b1285c18a476dcdc5b9f39d4ae00c
commit 5edf69884b5b1285c18a476dcdc5b9f39d4ae00c
Author:     Greg McCullough <gmccullo>
AuthorDate: Tue Jul 30 17:04:36 2019 -0400
Commit:     Greg McCullough <gmccullo>
CommitDate: Tue Jul 30 17:04:36 2019 -0400

    Merge pull request #424 from agrare/fix_clone_vm_to_template_check_provision

    Fix clone vm to template check_provision

    (cherry picked from commit eb5e16231805f0857ee9bffb441c6e5ef0dc9c72)

    https://bugzilla.redhat.com/show_bug.cgi?id=1734051

 app/models/manageiq/providers/vmware/infra_manager/provision/cloning.rb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comment 11 Kedar Kulkarni 2019-08-07 18:34:34 UTC
On CFME build 5.11.0.18 I was able to create templates using feature "Publish VM to Template" without any errors.