jmsperu opened a new pull request, #13078:
URL: https://github.com/apache/cloudstack/pull/13078

   ## Summary
   
   Two small visibility improvements to the LINSTOR template-handling path. 
Both preserve existing behaviour and only add log output that surfaces 
conditions operators have currently no easy way to detect.
   
   ## 1. \`LinstorUtil.findResourceDefinition\` — log on ambiguous fallback
   
   When clone-from-template runs, the method scans for a resource whose name 
starts with the template prefix AND whose aux properties include 
\`_cs-template-for-<rscGrpName>\`. If no exact-property match exists, the 
method falls back to the *first* matching resource by name and returns it 
silently.
   
   In setups with multiple resource groups on the same controller (or with 
legacy templates cached before the ref-count convention was added), this 
fallback can return a template that belongs to the wrong resource group, and 
the clone produces an unexpected result.
   
   This change keeps the fallback behaviour but logs a WARN naming:
   - the requested resource name and resource group
   - the fallback resource that was chosen
   - the actual \`_cs-template-for-*\` aux properties present on the fallback 
(so operators can see what RGs *do* claim it)
   
   ## 2. \`LinstorStorageAdaptor.deRefOrDeleteResource\` — log on 
legacy-template orphan cleanup
   
   The ref-count branch already deletes resources that have zero remaining 
\`_cs-template-for-\` aux properties. Two conditions reach this branch:
   - a normal resource (no template-for properties expected) — already 
commented in code
   - a *legacy template* with no template-for properties (predates the 
ref-count convention)
   
   Currently both look identical in the logs. Operators upgrading from older 
versions can't tell how many orphan legacy templates were cleaned up.
   
   This change logs an INFO line in the second case, identifying the resource 
as a legacy template and naming the resource group context. Behaviour unchanged.
   
   ## Test plan
   
   - [ ] CI build + unit tests
   - [ ] Manual: deploy a VM from template in a single-RG setup — no new logs
   - [ ] Manual: deploy a VM from template in a multi-RG setup where the 
template lacks the exact aux property — observe the new WARN
   - [ ] Manual: evict a legacy template (no aux properties) — observe the new 
INFO line during cleanup
   
   ## Why three small PRs
   
   Per the suggestion from earlier review, splitting LINSTOR plugin 
improvements into focused PRs:
   
   - This PR (template hygiene)
   - #13076 (delete-verification — addresses stuck DELETING accumulation)
   - #13077 (live-migration pre-flight — catches not-a-LINSTOR-satellite 
up-front)
   
   All three target the LINSTOR primary-storage plugin and can be reviewed 
independently.


-- 
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]

Reply via email to