Pearl1594 opened a new pull request #5598:
URL: https://github.com/apache/cloudstack/pull/5598


   ### Description
   
   This PR fixes the issue observed during upgrades, wherein, when a SystemVM 
template is already registered prior upgrade, the auto-upgrade path still gets 
invoked - which it shouldn't. The reason for this behavior is the incorrect 
name of the systemVM template placed in the metadata.ini file, which is used as 
an input during the upgrade process to identify the template names, checksums, 
download path, etc. In case of noredist builds, this would cause unnecessary 
re-registration; in case of non noredist builds, this could lead to the upgrade 
failing, as it fails to identify the registered template and invokes the 
auto-upgrade logic - which would fail(expected) due to the absence of the 
template files.
   
   For ex, a snippet of the metadata.ini file (for KVM SystemVM template 
details)
   ```
   ...
   [kvm]
   templatename = systemvm-kvm-4.16 <--- incorrect template name (should be 
systemvm-kvm-4.16.0)
   checksum = 2f3747a597396d4ee6a2605648808d1a
   downloadurl = 
https://download.cloudstack.org/systemvm/4.16/systemvmtemplate-4.16.0-kvm.qcow2.bz2
   filename = systemvmtemplate-4.16.0-kvm.qcow2.bz2
   ...
   ```
    <!--- Describe your changes in DETAIL - And how has behaviour functionally 
changed. -->
   
   <!-- For new features, provide link to FS, dev ML discussion etc. -->
   <!-- In case of bug fix, the expected and actual behaviours, steps to 
reproduce. -->
   
   <!-- When "Fixes: #<id>" is specified, the issue/PR will automatically be 
closed when this PR gets merged -->
   <!-- For addressing multiple issues/PRs, use multiple "Fixes: #<id>" -->
   <!-- Fixes: # -->
   
   <!--- 
*********************************************************************************
 -->
   <!--- NOTE: AUTOMATATION USES THE DESCRIPTIONS TO SET LABELS AND PRODUCE 
DOCUMENTATION. -->
   <!--- PLEASE PUT AN 'X' in only **ONE** box -->
   <!--- 
*********************************************************************************
 -->
   
   ### 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)
   
   ### Feature/Enhancement Scale or Bug Severity
   
   #### Bug Severity
   
   - [ ] BLOCKER
   - [X] Critical
   - [ ] Major
   - [ ] Minor
   - [ ] Trivial
   
   
   ### Screenshots (if appropriate):
   
   
   ### How Has This Been Tested?
   Upgraded the env from 4.15.2 to 4.16, by first registering the systemVM 
template - upgrade successful & doesn't re-register the template as template is 
found to be already present.
   
   Pos Fix, the snippet of metadata.ini file looks as follows:
   ```
   ...
   [kvm]
   templatename = systemvm-kvm-4.16.0
   checksum = 2f3747a597396d4ee6a2605648808d1a
   downloadurl = 
https://download.cloudstack.org/systemvm/4.16/systemvmtemplate-4.16.0-kvm.qcow2.bz2
   filename = systemvmtemplate-4.16.0-kvm.qcow2.bz2
   ...
   ```
   
   <!-- Please read the 
[CONTRIBUTING](https://github.com/apache/cloudstack/blob/main/CONTRIBUTING.md) 
document -->
   


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