Bug 1637660 - Expose folders to the ems_folder service model.
Summary: Expose folders to the ems_folder service model.
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat CloudForms Management Engine
Classification: Red Hat
Component: Automate
Version: 5.8.5
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: GA
: 5.10.0
Assignee: Tina Fitzgerald
QA Contact: Niyaz Akhtar Ansari
Red Hat CloudForms Documentation
URL:
Whiteboard:
Depends On:
Blocks: 1640194 1640195
TreeView+ depends on / blocked
 
Reported: 2018-10-09 17:18 UTC by David Luong
Modified: 2019-02-12 16:51 UTC (History)
8 users (show)

Fixed In Version: 5.10.0.21
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 1640194 1640195 (view as bug list)
Environment:
Last Closed: 2019-02-12 16:51:37 UTC
Category: Bug
Cloudforms Team: CFME Core
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
dialog performance enhancement Automate domain (7.80 KB, application/zip)
2018-10-15 16:36 UTC, Tina Fitzgerald
no flags Details
simulate screen shot (50.65 KB, image/png)
2018-11-12 17:12 UTC, Tina Fitzgerald
no flags Details

Description David Luong 2018-10-09 17:18:25 UTC
Description of problem:
Service Dialogs are slow

Version-Release number of selected component (if applicable):
5.8.5 and 5.9.4 (These are reproducer env, not the customer ver)

How reproducible:


Steps to Reproduce:
1.  Chcek load times for david-test catalog items
2.
3.

Actual results:


Expected results:


Additional info:

Comment 7 Tina Fitzgerald 2018-10-15 16:36:31 UTC
Created attachment 1494090 [details]
dialog performance enhancement Automate domain

Domain contains dynamic dialog Automate methods.

Comment 9 Tina Fitzgerald 2018-10-15 17:04:18 UTC
Hi David,

I've attached an Automate domain that contains the 
/Integration/VMWare/DynamicDialogs class and folder_name_region, folder_name_site, folder_name_product instances and methods.
The methods have been modified to be more performant.

Can you compare the dialog times with the original dialog(without the LDAP fields)?

1. Order the david-test2 Service, check load and refresh times.
2. Import and enable the dialog_performance_enhancement domain.
3. Order the david-test2 Service, check load and refresh times.

I modified the dialog values for the region, site, and product to set the ID of the folder instead of the name, so the customer will have to modify the vmware_preprovision method as follows: 


/IGT/Infrastructure/VM/Provisioning/StateMachines/Methods/vmware_preprovision
around line 25:
   datacenter = @template.v_owning_datacenter
    root_directory = "Datacenters/WG/vm/"
    desired_folder = @task.get_option(:folder_path_product) <---- comment out this line
  desired_folder = $evm.vmdb('ems_folder', @task.get_option(:folder_path_product)) <------- insert this line
    desired_folder.slice!(root_directory) 

Please let me know if you have any questions,

Thanks,
Tina

Comment 10 Tina Fitzgerald 2018-10-15 17:12:29 UTC
Hi David,

I forgot to mention that the customer will need a hot fix to expose the EmsFolders folder.

Can you get the timings on the 5.8 (10.10.96.78) appliance which contains the necessary code change while I make a PR?

Thanks,
Tina

Comment 13 CFME Bot 2018-10-15 19:17:12 UTC
New commit detected on ManageIQ/manageiq-automation_engine/master:

https://github.com/ManageIQ/manageiq-automation_engine/commit/d802d5824a346243e8338eaa904a9b704705aabe
commit d802d5824a346243e8338eaa904a9b704705aabe
Author:     Tina Fitzgerald <tfitzger>
AuthorDate: Mon Oct 15 13:24:56 2018 -0400
Commit:     Tina Fitzgerald <tfitzger>
CommitDate: Mon Oct 15 13:24:56 2018 -0400

    Expose folders

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

 lib/miq_automation_engine/service_models/miq_ae_service_ems_folder.rb | 5 +-
 1 file changed, 3 insertions(+), 2 deletions(-)

Comment 14 CFME Bot 2018-10-16 13:17:19 UTC
New commit detected on ManageIQ/manageiq-automation_engine/hammer:

https://github.com/ManageIQ/manageiq-automation_engine/commit/cdbcf67c26890eebe376d89c2fc5961b0f43d0db
commit cdbcf67c26890eebe376d89c2fc5961b0f43d0db
Author:     Greg McCullough <gmccullo>
AuthorDate: Mon Oct 15 15:16:17 2018 -0400
Commit:     Greg McCullough <gmccullo>
CommitDate: Mon Oct 15 15:16:17 2018 -0400

    Merge pull request #256 from tinaafitz/expose_folder_to_emsfolder

    Expose folders to ems_folder service model.

    (cherry picked from commit 305f45fd49434ee2dab0d0402ef9a35f6fc3b1b7)

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

 lib/miq_automation_engine/service_models/miq_ae_service_ems_folder.rb | 5 +-
 1 file changed, 3 insertions(+), 2 deletions(-)

Comment 19 Tina Fitzgerald 2018-10-29 21:53:42 UTC
Hi David,

I see that the customer has a custom vmname method that uses the dialog product values to set the vm name. Since this value is now an ID instead of the product name, the vmname method needs to modified in the same way as the preprovision method.

/IGT/Infrastructure/VM/Provisioning/Naming/vmname method:

line 19:

 folder_path = dialog_options["dialog_folder_path_product"] <---- comment out this line
  folder_path = $evm.vmdb('ems_folder', dialog_options["dialog_folder_path_product"]) <------- insert this line

Let me know if you have any questions.

Thanks,
Tina

Comment 20 Tina Fitzgerald 2018-10-29 21:56:11 UTC
Hi David,

The customer also has the option to disable the performance domain, and revert the change described in comment 9.  Disabling the domain, and reverting the change will make the changes described in comment 19 unnecessary.

Thanks,
Tina

Comment 22 Tina Fitzgerald 2018-11-02 13:02:24 UTC
Hi David,

Thanks for the update. Just an fyi, they're going to have provisioning issues if they don't revert the change described in comment 9.

Thanks,
Tina

Comment 24 Tina Fitzgerald 2018-11-12 17:12:00 UTC
Hi Niyaz,

There's a lot going on in this ticket.  The only product change was to expose folders to the ems_folders service model.

None of our ManageIQ Automate domain methods use the ems_folders service model, so the best way to test this fix is to create a small Automate method to reference ems_folders folders.

Sample Automate method:

##########################################
root_folder = $evm.vmdb('ems_folder').first    
$evm.log(:info, "Root Folder  #{root_folder.inspect}")
root_folder.folders.each do |folder|
  $evm.log(:info, "Adding Folder: #{folder.name} with ID: #{folder.id}")
end
##########################################


Create a writeable domain.
Create an inline method called "test_folder" in the /System/Request class.
Create an instance called "test_folder" in the /System/Request class, setting a method entry to "test_folder" to call the method.
Use Simulate, and specify "test_folder" as the request.
(see attached screen shot)

Comment 25 Tina Fitzgerald 2018-11-12 17:12:45 UTC
Created attachment 1504817 [details]
simulate screen shot

Comment 27 Tina Fitzgerald 2018-11-13 15:38:27 UTC
Hi Niyaz,

Yes, the logging shown in comment 26 validates the fix for this issue.

Let me know if you have any questions.

Thanks,
Tina

Comment 28 Niyaz Akhtar Ansari 2018-11-13 15:50:05 UTC
Thanks Tina, I am verifying this bz

Comment 29 Niyaz Akhtar Ansari 2018-11-13 15:50:28 UTC
Verified in Version 5.10.0.23.20181106165157_92dd189


Note You need to log in before you can comment on or make changes to this bug.