Skip to content
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

rhv: removed the option to migrate the VMs outside of the cluster. #207

Merged
merged 1 commit into from
Jan 24, 2017

Conversation

matobet
Copy link
Contributor

@matobet matobet commented Jan 20, 2017

The support for cross cluster migrations was added to oVirt only as a
workaround for el6->el7 migrations but should not be exposed. Since the current
code in manageiq anyway did not work properly, removing the support for it
completely - it is a low level functionality, it is obsoleted and discouraged
to be used.

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

@matobet
Copy link
Contributor Author

matobet commented Jan 20, 2017

@miq-bot assign @durandom

@miq-bot
Copy link
Member

miq-bot commented Jan 20, 2017

@matobet @durandom is an invalid assignee, ignoring...

@matobet
Copy link
Contributor Author

matobet commented Jan 20, 2017

@miq-bot assign @himdel

@himdel
Copy link
Contributor

himdel commented Jan 23, 2017

OK, so.. task_supported? is probably the right method to add this to, even though this adds a special case in there, which looks a bit wrong .. but we're asking the provider instead of the record .. so.. yeah, I guess can't be helped :).

any? { |ems| ems.respond_to?(:supports_migrate_for_all?) && !ems.supports_migrate_for_all?(vms) }

But.. if none of the providers has a supports_migrate_for_all method, this doesn't do anything.
Only when a provider has that method and doesn't support all the VMs, it fails.

So .. sounds like surprisingly this lets you migrate the same VM on a provider that's less capable, but not on one that is more. Are you sure that's the correct behaviour? Or is this missing some extra condition?


Apart from that, it also feels weird that you generate a flash that it can't be done .. and then do it anyway.

@himdel
Copy link
Contributor

himdel commented Jan 23, 2017

Added pending_backend because this clearly depends on ManageIQ/manageiq#13603

@himdel himdel added the bug label Jan 23, 2017
@matobet
Copy link
Contributor Author

matobet commented Jan 23, 2017

@himdel they way I understand this, the implementation of :supports_migrate_for_all is more of a sign of incapability of a provider than one of a capability. That means "If one of the providers in question can "veto" the operation by its "incapability" the operation needs to be cancelled".

Hope that made sense :-)

@himdel
Copy link
Contributor

himdel commented Jan 23, 2017

@matobet right, makes complete sense, thanks! :) In that case, can you add a small comment explaining that please?

But a question still remains: what happens after you've created that flash message? (I mean, I would have kinda expected to see something like return javascript_render_flash((message)), not just add_flash and continue as if nothing happened, but maybe it's handled somewhere else?)

@matobet
Copy link
Contributor Author

matobet commented Jan 23, 2017

@himdel not sure how the flash infrastructure works but with with the current add_flash followed by an return statement we get the result we want: flash is displayed and the operation halted.

@himdel
Copy link
Contributor

himdel commented Jan 23, 2017

Alright, I'll assume there's a if flash array not empty, do nothing logic somewhere. :)

@matobet
Copy link
Contributor Author

matobet commented Jan 23, 2017

@miq-bot add_label euwe/yes

@@ -1790,6 +1790,15 @@ def task_supported?(typ)
end

vms = VmOrTemplate.where(:id => vm_ids)
if typ == "migrate"
if vms.map(&:ext_management_system).uniq.compact.any? do |ems|
ems.respond_to?(:supports_migrate_for_all?) && !ems.supports_migrate_for_all?(vms)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok now I see this logic could be a bit improved also. We are passing all selected vms to each individual ems to check whether they can be migrated together but IMO each ems should have only say about his own subset of vms. Of course this accidentally works since the RHV implementation checks for the same cluster id which across providers will never hold, but that I don't believe that is the robustness we want :-) Will post a fix.

if vms.group_by(&:ext_management_system).except(nil).any? do |ems, ems_vms|
ems.respond_to?(:supports_migrate_for_all?) && !ems.supports_migrate_for_all?(ems_vms)
end
add_flash(_("This VMs can not be migrated together."), :error)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This These :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@himdel I guess we could also teach @miq-bot to check grammar in strings of submitted PRs among other things xD

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

heheh, the horrors it would see.. :)

The support for cross cluster migrations was added to oVirt only as a
workaround for el6->el7 migrations but should not be exposed. Since the current
code in manageiq anyway did not work properly, removing the support for it
completely - it is a low level functionality, it is obsoleted and discouraged
to be used.

Links
https://bugzilla.redhat.com/show_bug.cgi?id=1398287
@himdel
Copy link
Contributor

himdel commented Jan 24, 2017

LGTM, merging when green :)

@himdel himdel added this to the Sprint 53 Ending Jan 30, 2017 milestone Jan 24, 2017
@miq-bot
Copy link
Member

miq-bot commented Jan 24, 2017

Checked commit matobet@926812b with ruby 2.2.6, rubocop 0.47.1, and haml-lint 0.20.0
2 files checked, 0 offenses detected
Everything looks good. 👍

@himdel himdel merged commit 9e3eb7a into ManageIQ:master Jan 24, 2017
@simaishi
Copy link
Contributor

Euwe backport (to manageiq repo) details:

$ git log -1
commit 27c5e9cbaf01ea8b03764df9f683c1017b5130e3
Author: Martin Hradil <himdel@seznam.cz>
Date:   Tue Jan 24 10:17:12 2017 +0000

    Merge pull request #207 from matobet/tomas-ccm
    
    rhv: removed the option to migrate the VMs outside of the cluster.
    (cherry picked from commit 9e3eb7a95ad8092f661c1436f2c86afc066351f0)
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1416077

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants