engine-storage: fix errored template becomes active#7485
engine-storage: fix errored template becomes active#7485weizhouapache merged 2 commits intoapache:4.18from
Conversation
Fixes apache#7342 Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
|
@blueorangutan package |
|
@shwstppr a 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. |
|
Kudos, SonarCloud Quality Gate passed! |
|
Packaging result: ✔️ el7 ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 6007 |
|
@blueorangutan test |
|
@shwstppr a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests |
|
Trillian test result (tid-6493)
|
| import com.cloud.storage.VMTemplateVO; | ||
|
|
||
| @RunWith(MockitoJUnitRunner.class) | ||
| public class TemplateServiceImplTest { |
| } | ||
|
|
||
| protected boolean isSkipTemplateStoreDownload(VMTemplateVO template, Long zoneId) { | ||
| if (template.isPublicTemplate()) { |
There was a problem hiding this comment.
@shwstppr
if an error template is public or featured, will it become Active ?
There was a problem hiding this comment.
@weizhouapache no.
Server won't skip download if any of the following condition is true:
- Template is public
- Template is featured
- Template belongs to system
- Template is marked for the zone but not present in any of the zone secondary store
Depending upon download status template status will be set later
There was a problem hiding this comment.
it seems I misunderstood the code :-D
is there a scenario that template download is skipped but it is expected behaviour ? direct download ?
There was a problem hiding this comment.
Direct-download templates are skipped (already) at line 496
| return false; | ||
| } | ||
| if (zoneId != null && _vmTemplateStoreDao.findByTemplateZone(template.getId(), zoneId, DataStoreRole.Image) == null) { | ||
| s_logger.debug(String.format("Template %s is not present on any image store for the zone ID: %d, its download cannot be skipped", template.getUniqueName(), zoneId)); |
There was a problem hiding this comment.
what if it is a direct download template?
There was a problem hiding this comment.
Direct-download templates are skipped (already) at line 496
|
@Pearl1594 @weizhouapache are you guys okay to proceed with this? |
@shwstppr |
|
@weizhouapache it is probably taking the created date from |
great, thanks @shwstppr if @Pearl1594 is ok with this PR, we can merge it. |
* engine-storage: fix errored template becomes active Fixes apache#7342 Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com> * test Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com> --------- Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>











Description
Fixes #7342
When MS is restarted, failed non-public, non-featured, user templates are set to Active as their redownload is not attempted. This PR fixes the case.
Types of changes
Feature/Enhancement Scale or Bug Severity
Feature/Enhancement Scale
Bug Severity
Screenshots (if appropriate):
How Has This Been Tested?