Damans227 opened a new pull request, #14855:
URL: https://github.com/apache/cloudstack/pull/14855
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.
16:42:08,291 DEBUG [c.c.t.TemplateManagerImpl] Evicting
TmplPool[14-208-4-type=FIBERWWN; ... providerName=cs-prim-fc-p2::tpl-4-0-2-208;
...]
16:42:08,298 ERROR [o.a.c.s.d.d.AdaptiveDataStoreDriverImpl] Result to
volume delete failed with exception java.lang.NullPointerException: Cannot
invoke "com.cloud.storage.VMTemplateVO.getAccountId()" because "template" is
null
> purevol list --pending
cs-prim-fc-p2::tpl-4-0-2-208 8G

**After:** no crash, the delete reaches the array and the copy is renamed
for deletion.
16:55:21,164 DEBUG [c.c.t.TemplateManagerImpl] Evicting
TmplPool[15-209-3-type=FIBERWWN; ... providerName=cs-prim-fc-p1::tpl-3-0-2-209;
...]
16:55:21,169 DEBUG [o.a.c.s.d.d.AdaptiveDataStoreDriverImpl] Delete
volume started
> purevol list --pending
cs-prim-fc-p1::tpl-3-0-2-209-20261125165521 8G
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.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]