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

Provide better error message when migrating to the same host #14155

Merged
merged 1 commit into from
Mar 22, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions app/models/vm_or_template/operations/relocation.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ def raw_migrate(host, pool = nil, priority = "defaultPriority", state = nil)
end
end

if host_id == host.id
raise _("The VM '#{name}' can not be migrated to the same host it is already running on.")
end

host_mor = host.ems_ref_obj
pool_mor = pool.ems_ref_obj
run_command_via_parent(:vm_migrate, :host => host_mor, :pool => pool_mor, :priority => priority, :state => state)
Expand Down