-
Notifications
You must be signed in to change notification settings - Fork 897
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
Report accurate status on inactive VM #18181
Report accurate status on inactive VM #18181
Conversation
/cc @lfu @michaelkro @miq-bot add_label bug,transformation,hammer/yes |
@@ -37,7 +37,7 @@ def identify_vms | |||
conflict_list = [] | |||
|
|||
vm_names = @vm_list.collect { |row| row['name'] } | |||
vm_objects = Vm.where(:name => vm_names, :ems_cluster => mapped_clusters).includes(:lans, :storages, :host, :ext_management_system) | |||
vm_objects = Vm.where(:name => vm_names) |
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.
For better performance, we want to do the SQL query once, then look at the in-memory VM objects for selection.
Should we have here:
vm_objects = Vm.where(:name => vm_names).includes(:ems_cluster, :lans, :storages, :host, :ext_management_system)
Then later on line 55, we do:
vms = vm_objects.select { |vm| mapped_clusters.include?(vm.ems_cluster) }
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.
Thanks @lfu - made the above change
@miq-bot add_label blocker |
This master list will have no other clauses on selection apply the selection criteria just before VM validation
That being done, we don't need the `vm.active?` check in `vm_migration_status` again https://bugzilla.redhat.com/show_bug.cgi?id=1639239
0d8fdaf
to
2791ee0
Compare
Checked commits AparnaKarve/manageiq@7fda4a3~...2791ee0 with ruby 2.3.3, rubocop 0.52.1, haml-lint 0.20.0, and yamllint 1.10.0 |
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.
LGTM
@AparnaKarve was there anything else needed before this can be merged. |
@JPrause This is good to go and can be merged. |
@AparnaKarve thanks! Who can merge? Can you assign or ping someone. |
@roliveri ? ... since it's v2v related? |
…_inactive_vm Report accurate status on inactive VM (cherry picked from commit 76df3db) https://bugzilla.redhat.com/show_bug.cgi?id=1639239
Hammer backport details:
|
Currently in v2v, the VM Validator method in the CSV mode, provides incorrect status on an inactive VM -- the status reported is
not_exist
(as in, the VM does not exist)This used to work prior to the refactor done in #17364
In this PR, the VM Validator method was fixed to get the accurate
inactive
status of the VMhttps://bugzilla.redhat.com/show_bug.cgi?id=1639239