While starting VM with 'considerlasthost' enabled, don't load host tags/details for the last host when it doesn't exist [main]
Description
This PR doesn't load host tags/details for the last host when it doesn't exist, while starting VM with 'considerlasthost' enabled. It addresses https://github.com/apache/cloudstack/issues/9033, in main
Types of changes
- [ ] Breaking change (fix or feature that would cause existing functionality to change)
- [ ] New feature (non-breaking change which adds functionality)
- [x] Bug fix (non-breaking change which fixes an issue)
- [ ] Enhancement (improves an existing feature and functionality)
- [ ] Cleanup (Code refactoring and cleanup, that may add test cases)
- [ ] build/CI
Feature/Enhancement Scale or Bug Severity
Feature/Enhancement Scale
- [x] Major
- [ ] Minor
Bug Severity
- [ ] BLOCKER
- [ ] Critical
- [ ] Major
- [ ] Minor
- [ ] Trivial
Screenshots (if appropriate):
How Has This Been Tested?
How did you try to break this feature and the system with this change?
@blueorangutan package
@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.
Codecov Report
Attention: Patch coverage is 0% with 5 lines in your changes missing coverage. Please review.
Project coverage is 16.07%. Comparing base (
3fe2b46) to head (2623565).
| Files | Patch % | Lines |
|---|---|---|
| ...n/java/com/cloud/vm/VirtualMachineManagerImpl.java | 0.00% | 2 Missing and 1 partial :warning: |
| ...om/cloud/deploy/DeploymentPlanningManagerImpl.java | 0.00% | 2 Missing :warning: |
Additional details and impacted files
@@ Coverage Diff @@
## main #9063 +/- ##
============================================
+ Coverage 15.32% 16.07% +0.75%
Complexity 11653 11653
============================================
Files 5453 5084 -369
Lines 476557 446375 -30182
Branches 60411 53297 -7114
============================================
- Hits 73012 71742 -1270
+ Misses 395477 366707 -28770
+ Partials 8068 7926 -142
| Flag | Coverage Δ | |
|---|---|---|
| uitests | ? |
|
| unittests | 16.07% <0.00%> (-0.01%) |
:arrow_down: |
Flags with carried forward coverage won't be shown. Click here to find out more.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Packaging result [SF]: ✔️ el7 ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 9580
@blueorangutan test
@DaanHoogland a [SL] Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests
[SF] Trillian Build Failed (tid-10209)
@blueorangutan package
@shwstppr 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.
Packaging result [SF]: ✔️ el7 ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 9692
@blueorangutan test
@DaanHoogland a [SL] Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests
[SF] Trillian test result (tid-10295) Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7 Total time taken: 46990 seconds Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr9063-t10295-kvm-centos7.zip Smoke tests completed. 131 look OK, 0 have errors, 0 did not run Only failed and skipped tests results shown below:
| Test | Result | Time (s) | Test File |
|---|
I'm having an error when trying to start a VM on an already deleted host with 'Consider last host' enabled, here are the exceptions in the log:
2024-06-12T09:06:20,389 ERROR [c.c.v.VmWorkJobDispatcher] (Work-Job-Executor-7:[ctx-d8af49a8, job-42/job-44]) (logid:fd3c0220) Unable to complete AsyncJobVO: {id:44, userId: 2, accountId: 2, instanceType: null, instanceId: null, cmd: com.cloud.vm.VmWorkStart, cmdInfo: rO0ABXNyABhjb20uY2xvdWQudm0uVm1Xb3JrU3RhcnR9cMGsvxz73gIAC0oABGRjSWRMAAZhdm9pZHN0ADBMY29tL2Nsb3VkL2RlcGxveS9EZXBsb3ltZW50UGxhbm5lciRFeGNsdWRlTGlzdDtMAAljbHVzdGVySWR0ABBMamF2YS9sYW5nL0xvbmc7TAAGaG9zdElkcQB-AAJMAAtqb3VybmFsTmFtZXQAEkxqYXZhL2xhbmcvU3RyaW5nO0wAEXBoeXNpY2FsTmV0d29ya0lkcQB-AAJMAAdwbGFubmVycQB-AANMAAVwb2RJZHEAfgACTAAGcG9vbElkcQB-AAJMAAlyYXdQYXJhbXN0AA9MamF2YS91dGlsL01hcDtMAA1yZXNlcnZhdGlvbklkcQB-AAN4cgATY29tLmNsb3VkLnZtLlZtV29ya5-ZtlbwJWdrAgAESgAJYWNjb3VudElkSgAGdXNlcklkSgAEdm1JZEwAC2hhbmRsZXJOYW1lcQB-AAN4cAAAAAAAAAACAAAAAAAAAAIAAAAAAAAAA3QAGVZpcnR1YWxNYWNoaW5lTWFuYWdlckltcGwAAAAAAAAAAHBwcHBwcHBwc3IAEWphdmEudXRpbC5IYXNoTWFwBQfawcMWYNEDAAJGAApsb2FkRmFjdG9ySQAJdGhyZXNob2xkeHA_QAAAAAAADHcIAAAAEAAAAAJ0ABBDb25zaWRlckxhc3RIb3N0dAAPck8wQUJYUUFCSFJ5ZFdVdAAKVm1QYXNzd29yZHQAHHJPMEFCWFFBRG5OaGRtVmtYM0JoYzNOM2IzSmt4cA, cmdVersion: 0, status: IN_PROGRESS, processStatus: 0, resultCode: 0, result: null, initMsid: 32986942669477, completeMsid: null, lastUpdated: null, lastPolled: null, created: Wed Jun 12 09:06:18 UTC 2024, removed: null}, job origin: 42 java.lang.NullPointerException: Cannot invoke "com.cloud.host.Host.getClusterId()" because "lastHost" is null
at com.cloud.vm.VirtualMachineManagerImpl.checkAndAttemptMigrateVmAcrossCluster(VirtualMachineManagerImpl.java:1080)
at com.cloud.vm.VirtualMachineManagerImpl.orchestrateStart(VirtualMachineManagerImpl.java:1254)
at com.cloud.vm.VirtualMachineManagerImpl.orchestrateStart(VirtualMachineManagerImpl.java:5419)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
2024-06-12T09:06:20,423 ERROR [c.c.a.ApiAsyncJobDispatcher] (API-Job-Executor-32:[ctx-4f25b3d9, job-42]) (logid:fd3c0220) Unexpected exception while executing org.apache.cloudstack.api.command.admin.vm.St
artVMCmdByAdmin java.lang.NullPointerException
at com.cloud.vm.VirtualMachineManagerImpl.checkAndAttemptMigrateVmAcrossCluster(VirtualMachineManagerImpl.java:1080)
at com.cloud.vm.VirtualMachineManagerImpl.orchestrateStart(VirtualMachineManagerImpl.java:1254)
at com.cloud.vm.VirtualMachineManagerImpl.orchestrateStart(VirtualMachineManagerImpl.java:5419)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
@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.
Packaging result [SF]: ✔️ el7 ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 9894