-
Notifications
You must be signed in to change notification settings - Fork 898
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
Provide better error message when migrating to the same host #14155
Conversation
25f9fdf
to
af195ce
Compare
@jelkosz is there a test checking this functionality? I guess there are non for the error at least... |
What if we put this check to There are already similar sanity checks. What do you think? |
590b1d0
to
39d48dc
Compare
@isimluk I find it a bit too abstract place for it - I would anyway have to delegate this check to the specific provider to parse out the data they need for the check. |
39d48dc
to
90fc9b4
Compare
@isimluk you are right, it is a better place, done |
current_host_id = Host.where(:id => host_id).pluck(:uid_ems).first | ||
destination_host_id = host.uid_ems | ||
|
||
if current_host_id == destination_host_id |
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.
Just a question: do we need to use uid_ems
?
If we do just if host_id == host.id # current host equals destination host
we could avoid extra select from db.
In case the VM is migrated to the same host it is already running on, a misleading error message is shown in the Requests: "There are no hosts to use. Check that the cluster contains at least one host in Up state" Fixed by failing the migration with the better message: "Error: The VM 'vm name' can not be migrated to the same host it is already running on." The host is not filtered out from the "Migrate Virtual Machine" screen since this screen can be used to migrate more VMs at once and what is a good host for one VM is not for the other.
90fc9b4
to
f4bc176
Compare
@isimluk right, done |
Checked commit jelkosz@f4bc176 with ruby 2.2.6, rubocop 0.47.1, and haml-lint 0.20.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.
👍 Thanks @jelkosz ! This is perfect.
Provide better error message when migrating to the same host (cherry picked from commit 9764860) https://bugzilla.redhat.com/show_bug.cgi?id=1436222
Euwe backport details:
|
In case the VM is migrated to the same host it is already running on, a
misleading error message is shown in the Requests:
"There are no hosts to use. Check that the cluster contains at least one host
in Up state"
Fixed by failing the migration with the better message:
"Error: The VM 'vm name' can not be migrated to the same host it is already
running on."
The host is not filtered out from the "Migrate Virtual Machine" screen since this
screen can be used to migrate more VMs at once and what is a good host for one
VM is not for the other.