-
Notifications
You must be signed in to change notification settings - Fork 120
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use targeted refresh during transformation #381
Use targeted refresh during transformation #381
Conversation
@@ -16,27 +16,13 @@ def main | |||
destination_vm = ManageIQ::Automate::Transformation::Infrastructure::VM::RedHat::Utils.new(destination_ems).vm_find_by_name(source_vm.name) | |||
raise "VM #{source_vm.name} not found in destination provider #{destination_ems.name}" if destination_vm.nil? | |||
|
|||
finished = false | |||
|
|||
destination_vm_vmdb = @handle.vmdb(:vm).where(["ems_ref = ?", destination_vm.href.gsub(/^\/ovirt-engine/, '')]).first |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Realize this is outside of the changes in this PR but future refactorings should be:
destination_vm_vmdb = @handle.vmdb(:vm).find_by(:ems_ref => destination_vm.href.gsub(/^\/ovirt-engine/, ''))
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed. I suppose it has better performance.
Checked commits fabiendupont/manageiq-content@c8cfa2c~...7be7554 with ruby 2.3.3, rubocop 0.52.1, haml-lint 0.20.0, and yamllint 1.10.0 |
Use targeted refresh during transformation (cherry picked from commit 4a91827) https://bugzilla.redhat.com/show_bug.cgi?id=1610550
Gaprindashvili backport details:
|
Previously, during transformation, we triggered a full refresh to be sure that the VM was in the inventory for the post migration steps. But, this consumed a lot of resources compared to the single VM we want to track. And on a huge inventory with thousands of VMs, triggering a full refresh for each migration can soon be problematic.
This PR adds a new instance in the event switchboard that triggers a targeted refresh for the associated VM. The event is named
VM_IMPORT_FROM_CONFIGURATION_EXECUTED_SUCCESSFULLY
.Associated RHBZ: https://bugzilla.redhat.com/show_bug.cgi?id=1607368