Uh oh!
There was an error while loading. Please reload this page.
Fixing count for findHostsForMigration - #4375
Conversation
a32685e to
182af0dComparedavidjumani
commented
Oct 5, 2020
@blueorangutan package |
blueorangutan
commented
Oct 5, 2020
@davidjumani a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress. |
blueorangutan
commented
Oct 5, 2020
Packaging result: ✔centos7 ✔centos8 ✔debian. JID-2119 |
davidjumani
commented
Oct 5, 2020
@blueorangutan test |
blueorangutan
commented
Oct 5, 2020
@davidjumani a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests |
fd4cc97 to
9668193Compareblueorangutan
commented
Oct 6, 2020
Trillian test result (tid-2894)
|
davidjumani
commented
Oct 6, 2020
@blueorangutan package |
blueorangutan
commented
Oct 6, 2020
@davidjumani a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress. |
blueorangutan
commented
Oct 6, 2020
Packaging result: ✔centos7 ✔centos8 ✔debian. JID-2120 |
davidjumani
commented
Oct 6, 2020
@blueorangutan test |
sureshanaparti
commented
Oct 6, 2020
@davidjumani can you please add the root cause for the count mismatch and the fix to the PR description (and also commit msg). |
| // If the source and target storage pool is the same and it is managed, then we still have to perform a storage migration | ||
| // because we need to create a new target volume and copy the contents of the source volume into it before deleting the | ||
| // source volume. | ||
| iterator.remove(); |
There was a problem hiding this comment.
@davidjumani any reason, why unsuitable hosts are not removed from the hosts list ?
There was a problem hiding this comment.
This is so that the total count and hosts returned remain the same. Rather than removing them, they're marked as not suitable
https://github.com/apache/cloudstack/blob/master/api/src/main/java/org/apache/cloudstack/api/command/admin/host/FindHostsForMigrationCmd.java#L94
There was a problem hiding this comment.
in actual production, there can be lot of unsuitable hosts. say 60 out of 100 are unsuitable, in this case, list all these and marking unsuitable doesn't sound good. thoughts?
There was a problem hiding this comment.
@davidjumani better to update the count result from searchForServers(), when unsuitable hosts are removed, instead changing the existing code for suitable hosts, can cause regression.
There was a problem hiding this comment.
Agreed, but since we're paginating the result, we can not remove the hosts in page 2 when we've only fetched the ones in page 1. So marking it as not compatible so that the total count is not broken
There was a problem hiding this comment.
Pagination is the UI thing, may be some other alternative that can be worked upon. If someone uses the API, doesn't look good to return all hosts, marking suitable & unsuitable.
There was a problem hiding this comment.
Again I agree, but that's the way it's already being done, so just fixing the count
https://github.com/apache/cloudstack/blob/master/api/src/main/java/org/apache/cloudstack/api/command/admin/host/FindHostsForMigrationCmd.java#L92
There was a problem hiding this comment.
ok @davidjumani if possible, display the suitable hosts first in the UI.
There was a problem hiding this comment.
@sureshanaparti Sorted in the UI via apache/cloudstack-primate@a4732a3
yadvr
commented
Oct 12, 2020
@blueorangutan package |
blueorangutan
commented
Oct 12, 2020
@rhtyd a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress. |
blueorangutan
commented
Oct 12, 2020
Packaging result: ✔centos7 ✖centos8 ✔debian. JID-2160 |
DaanHoogland
commented
Oct 12, 2020
@blueorangutan test centos7 kvm-centos7 keepEnv |
blueorangutan
commented
Oct 12, 2020
@DaanHoogland a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests |
DaanHoogland
commented
Oct 13, 2020
@blueorangutan test centos7 kvm-centos7 |
DaanHoogland
commented
Oct 15, 2020
@blueorangutan test centos7 kvm-centos7 keepEnv |
blueorangutan
commented
Oct 15, 2020
@DaanHoogland a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests |
blueorangutan
commented
Oct 15, 2020
Trillian test result (tid-2964)
|
sureshanaparti
left a comment
There was a problem hiding this comment.
Changes LGTM, not tested though
yadvr
commented
Oct 17, 2020
@blueorangutan package |
blueorangutan
commented
Oct 17, 2020
@rhtyd a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress. |
blueorangutan
commented
Oct 17, 2020
Packaging result: ✔centos7 ✔centos8 ✔debian. JID-2200 |
DaanHoogland
commented
Oct 20, 2020
@blueorangutan test |
blueorangutan
commented
Oct 20, 2020
@DaanHoogland a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests |
blueorangutan
commented
Oct 21, 2020
Trillian test result (tid-3025)
|
DaanHoogland
commented
Oct 21, 2020
@davidjumani can you have a quick look at the errors above? |
davidjumani
commented
Oct 21, 2020
@DaanHoogland The host fencing errors are due to |
davidjumani
commented
Oct 23, 2020
@blueorangutan package |
blueorangutan
commented
Oct 23, 2020
@davidjumani a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress. |
blueorangutan
commented
Oct 23, 2020
Packaging result: ✔centos7 ✔centos8 ✔debian. JID-2268 |
davidjumani
commented
Oct 23, 2020
@blueorangutan test |
blueorangutan
commented
Oct 23, 2020
@davidjumani a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests |
blueorangutan
commented
Oct 23, 2020
Trillian test result (tid-3062)
|
Description
Fixes#4371
In the code, all servers, and their count belonging to the same zone are returned. Then they are filtered for suitability.
This is fine except for the point where VM volumes existing on managed storage pools or hosts on which those storage pools are not suitable. In this case it removes the hosts rather than marking them as not suitable. This messes up the count. Subtracting the non suitable hosts count does not fix this since we're paginating the response so unsuitable hosts and thier count from the current page will be removed but will not fix the total count since hosts on other pages can not be filtered.
Another place is that the source host is removed from the list but the count is not adjusted
Types of changes
How Has This Been Tested?
Before :
After :