Description of problem: During the creation of folders, there is a full refresh on the provider which is unnecessary and time consuming. Instead there should be a targeted refresh on the folders Version-Release number of selected component (if applicable): CFME 5.5.5.4 How reproducible: Always Steps to Reproduce: 1. 2. 3. Actual results: Expected results: Additional info:
Was wrong about the Version-Release, its 5.6.1.2
This is going to take a couple of steps: 1. Add EmsFolder as a new Refresh Target type 2. Update the filter_vc_data to handle filtering on a folder 3. Update the disconnect logic in EmsRefresh to handle the new target type 4. Pick out the minimal info about a new folder from a VMware Event (moref, name, parent) to create the new folder I started looking at picking the minimal amount of information out of the folder created event so that we could use the new EmsRefresh#refresh_new_target method, but I wasn't able to get anything useful so this will need more investigation.
The event does not have enough information to do anything useful (the only thing there is the parent folder's MOR) However the VimBroker does send notifications about changes in inventory (create/update/delete) that come from the WaitForUpdates thread. These notifications do have enough info (e.g.: Type and MOR) to create a basic folder record then kick a targeted refresh of that record similar to how RHV handles new VMs [0] Getting the filter for the targeted refresh will be tricky given that a folder target could potentially result in every inventory object being included or none of them depending on where that folder is located. [0] https://github.com/agrare/manageiq/blob/4a3a19d77fe0abfbaa7a799d51f97ef3f5be14d3/app/models/ems_refresh/vc_updates.rb#L353-L368
https://github.com/ManageIQ/manageiq-providers-vmware/pull/32 https://github.com/ManageIQ/manageiq/pull/14460
https://github.com/ManageIQ/manageiq-content/pull/100
All PRs have been merged, now when a new folder is created we will only do a targeted refresh of the folder and not a full refresh.
Steps to test: (note this is best done on a VC without a lot of activity) 1. Add a VMware provider and let the first refresh finish 2. Open the VM & Template view on the CFME UI (/ems_infra/1?display=ems_folders&vat=true) 3. Create a folder using the vSphere client 4. Check the evm.log for the refresh target MIQ(ManageIQ::Providers::Vmware::InfraManager::Refresher#refresh) EMS: [dev-vc65], id: [1] Refreshing targets for EMS... MIQ(ManageIQ::Providers::Vmware::InfraManager::Refresher#refresh) EMS: [dev-vc65], id: [1] EmsFolder [] id [10] Note you should see EmsFolder as the target not Vmware::InfraManager 5. Refresh the VMs & Templates view and you should see the new folder in the correct place you created it in the vSphere client
Verified in 5.9.0.2