-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Fixed avoid set variables which is causing deployment failures #7372
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
Fixed avoid set variables which is causing deployment failures #7372
Conversation
74681d4 to
4c60621
Compare
|
This issue is in 4.17 as well, so rebased the branch to 4.17 as this is a critical issue |
|
@blueorangutan package |
|
@harikrishna-patnala a Jenkins job has been kicked to build packages. It will be bundled with SystemVM template(s). I'll keep you posted as I make progress. |
|
Packaging result: ✔️ el7 ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 5785 |
|
Kudos, SonarCloud Quality Gate passed! |
| Set<Long> originalAvoidPoolSet = new HashSet<>(); | ||
| if (avoid.getPoolsToAvoid() != null) { | ||
| originalAvoidPoolSet.addAll(avoid.getPoolsToAvoid()); | ||
| } | ||
| Set<Long> poolsToAvoidOutput = new HashSet<Long>(originalAvoidPoolSet); | ||
| Set<Long> poolsToAvoidOutput = new HashSet<>(originalAvoidPoolSet); |
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.
@harikrishna-patnala , what is the logic here? As I see it it just adds to the avoid set to remember later and doesn´t clean the pools from trying the prior cluster from the avoid set trying this cluster.
If it works it works but It doesn't read like logical to me.
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.
Logic is already down there @DaanHoogland.
cloudstack/server/src/main/java/com/cloud/deploy/DeploymentPlanningManagerImpl.java
Lines 1685 to 1715 in 4c60621
| if (avoid.getPoolsToAvoid() != null) { | |
| poolsToAvoidOutput.addAll(avoid.getPoolsToAvoid()); | |
| avoid.getPoolsToAvoid().retainAll(originalAvoidPoolSet); | |
| } | |
| if (!foundPotentialPools) { | |
| s_logger.debug("No suitable pools found for volume: " + toBeCreated + " under cluster: " + plan.getClusterId()); | |
| // No suitable storage pools found under this cluster for this | |
| // volume. - remove any suitable pools found for other volumes. | |
| // All volumes should get suitable pools under this cluster; | |
| // else we cant use this cluster. | |
| suitableVolumeStoragePools.clear(); | |
| break; | |
| } | |
| } | |
| HashSet<Long> toRemove = new HashSet<Long>(); | |
| for (List<StoragePool> lsp : suitableVolumeStoragePools.values()) { | |
| for (StoragePool sp : lsp) { | |
| toRemove.add(sp.getId()); | |
| } | |
| } | |
| poolsToAvoidOutput.removeAll(toRemove); | |
| if (avoid.getPoolsToAvoid() != null) { | |
| avoid.getPoolsToAvoid().addAll(poolsToAvoidOutput); | |
| } | |
| if (suitableVolumeStoragePools.isEmpty()) { | |
| s_logger.debug("No suitable pools found"); | |
| } |
It is just that originalAvoidPoolSet was not maintained properly because of "Set originalAvoidPoolSet = avoid.getPoolsToAvoid();". Later in the planner whenever avoid.getPoolsToAvoid() is getting updated, originalAvoidPoolSet is also getting updated.
For example with 2 volumes, during the loop for each volume, for 1st volume avoid.getPoolsToAvoid() adds p3, p4 and also in originalAvoidPoolSet. For the 2nd volume p3, p4 should not be in avoid set, but since originalAvoidPoolSet also got updated planner is avoiding p3, p4.
Yes, this is working during my testing. I've verified with the debugger too.
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 @harikrishna-patnala it still doesn´t read logical, but with your explanation it makes total sense 👍
DaanHoogland
left a comment
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.
clgtm
|
@blueorangutan test |
|
@harikrishna-patnala a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests |
rajujith
left a comment
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.
Followed the issue reproduction steps and the issue is not observed. Its LGTM.
|
Trillian test result (tid-6327)
|








Description
This PR fixes the issue #7357 where VM deployment is failing when storage tags are used in certain way with multiple clusters, though a proper cluster to deploy VM is available.
Root cause is the usage of certain variables to figure out the final avoid pools set in the deployment planner.
because of this, "originalAvoidPoolSet" is getting updated whenever avoid.getPoolsToAvoid() is updated and this should not be the case.
Types of changes
Bug Severity
Screenshots (if appropriate):
How Has This Been Tested?