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
While starting VM with 'considerlasthost' enabled, don't load host tags/details for the last host when it doesn't exist #9037
base: 4.18
Are you sure you want to change the base?
Conversation
…/details for the last host when it doesn't exist
@blueorangutan package |
@sureshanaparti a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress. |
@sureshanaparti
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## 4.18 #9037 +/- ##
===========================================
Coverage 12.24% 12.24%
- Complexity 9291 9293 +2
===========================================
Files 4698 4698
Lines 414259 414259
Branches 52267 50777 -1490
===========================================
+ Hits 50707 50719 +12
+ Misses 357251 357237 -14
- Partials 6301 6303 +2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Packaging result [SF]: ✔️ el7 ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 9526 |
_hostDao.loadHostTags(host); | ||
_hostDao.loadDetails(host); | ||
if (avoids.shouldAvoid(host)) { | ||
s_logger.debug("The last host of this VM is in avoid set"); | ||
} else if (plan.getClusterId() != null && host.getClusterId() != null | ||
&& !plan.getClusterId().equals(host.getClusterId())) { | ||
s_logger.debug("The last host of this VM cannot be picked as the plan specifies different clusterId: " | ||
+ plan.getClusterId()); | ||
} else if (_capacityMgr.checkIfHostReachMaxGuestLimit(host)) { | ||
s_logger.debug("The last Host, hostId: " + host.getId() + | ||
" already has max Running VMs(count includes system VMs), skipping this and trying other available hosts"); | ||
} else if ((offeringDetails = _serviceOfferingDetailsDao.findDetail(offering.getId(), GPU.Keys.vgpuType.toString())) != null) { | ||
ServiceOfferingDetailsVO groupName = _serviceOfferingDetailsDao.findDetail(offering.getId(), GPU.Keys.pciDevice.toString()); | ||
if(!_resourceMgr.isGPUDeviceAvailable(host.getId(), groupName.getValue(), offeringDetails.getValue())){ | ||
s_logger.debug("The last host of this VM does not have required GPU devices available"); | ||
} | ||
} else if (volumesRequireEncryption && !Boolean.parseBoolean(host.getDetail(Host.HOST_VOLUME_ENCRYPTION))) { | ||
s_logger.warn(String.format("The last host of this VM %s does not support volume encryption, which is required by this VM.", host)); | ||
} else { |
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.
Makes sense to load tags/details only for non-null host. Should we also consider refactoring some of the checks in separate methods?
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.
@weizhouapache I think, better to fix this issue (no backport for that refactored code). PR #7214 also doesn't fix load tags issue, needs to be fixed here - https://github.com/apache/cloudstack/pull/7214/files#r1593867688 |
@blueorangutan package |
@sureshanaparti a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress. |
@sureshanaparti |
correct @weizhouapache , separate PR for 4.20/main (will create one) |
ok , it should work @sureshanaparti |
Packaging result [SF]: ✔️ el7 ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 9575 |
PR for 4.20/main here: #9063 |
@blueorangutan test |
@sureshanaparti a [SL] Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests |
[SF] Trillian test result (tid-10196)
|
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
Description
This PR doesn't load host tags/details for the last host when it doesn't exist, while starting VM with 'considerlasthost' enabled.
Fixes #9033
Types of changes
Feature/Enhancement Scale or Bug Severity
Feature/Enhancement Scale
Bug Severity
Screenshots (if appropriate):
How Has This Been Tested?
How did you try to break this feature and the system with this change?