Repository navigation
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## 4.22 #14855 +/- ##
==========================================
Coverage 18.34% 18.34%
- Complexity 16669 16682 +13
==========================================
Files 5939 5939
Lines 537819 538128 +309
Branches 65941 65944 +3
==========================================
+ Hits 98638 98695 +57
- Misses 427960 428207 +247
- Partials 11221 11226 +5
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
Verified working. Verified on CloudStack 4.22.1.1, packages rebuilt from patched source. KVM on Ubuntu 24.04.4 LTS, Pure FA-X20R4, Purity//FA 6.10.6, provider Flash Array, FibreChannel. Deployed a VM from a user template so it spooled to an FC pool, expunged the VM, then deleted the template: Destroyed, with no NullPointerException ... VMTemplateVO.getAccountId() in the log. On 4.22.1.1 the array object is left untouched under its original name, leaving an orphan on the array that is indistinguishable from a live template copy. |
Fixes #14854
Deleting a template never removes its copy from a FlashArray pool. The cleanup runs after the template is marked as removed, so the driver's lookup returns nothing and it crashes before contacting the array. This looks up the template, volume or snapshot including removed rows, and skips the account details if the record is gone, so the delete always reaches the array.
Test:
Register a template, deploy a VM from it on a FlashArray pool, destroy the VM with expunge, delete the template, wait for the storage cleanup job.
Before: crashes, copy left on the array under its original name.
After: no crash, the delete reaches the array and the copy is renamed for deletion.
The final destroy step on the array fails on 4.22.1.1 because of the rename and destroy being sent together. That is already fixed on 4.22 by #13049.
Also added unit tests for the lookup with removed and missing records, and for the template delete reaching the array.