You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by GitBox <gi...@apache.org> on 2022/02/07 05:23:49 UTC

[GitHub] [cloudstack] Pearl1594 opened a new pull request #5954: Skip systemVM template registration for Simulator

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


   ### Description
   
   This PR fixes #5936 - prevents registration of systemVM template for Simulator hypervisor
   <!-- 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
   - [ ] Critical
   - [ ] Major
   - [X] Minor
   - [ ] Trivial
   
   
   ### Screenshots (if appropriate):
   
   
   ### How Has This Been Tested?
   Deploy a simulator hypervisor with advanced zone, and observed logs during addition of secondary store - no NPE 
   
   
   <!-- 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: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] sureshanaparti commented on pull request #5954: Skip systemVM template registration for Simulator

Posted by GitBox <gi...@apache.org>.
sureshanaparti commented on pull request #5954:
URL: https://github.com/apache/cloudstack/pull/5954#issuecomment-1031422888


   @blueorangutan package


-- 
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: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] sureshanaparti commented on pull request #5954: Skip systemVM template registration for Simulator

Posted by GitBox <gi...@apache.org>.
sureshanaparti commented on pull request #5954:
URL: https://github.com/apache/cloudstack/pull/5954#issuecomment-1032286408


   @blueorangutan package


-- 
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: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] sureshanaparti commented on pull request #5954: Skip systemVM template registration for Simulator

Posted by GitBox <gi...@apache.org>.
sureshanaparti commented on pull request #5954:
URL: https://github.com/apache/cloudstack/pull/5954#issuecomment-1031102055


   Hi @Pearl1594 Is this good to go in 4.16.1 ?


-- 
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: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] blueorangutan commented on pull request #5954: Skip systemVM template registration for Simulator

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on pull request #5954:
URL: https://github.com/apache/cloudstack/pull/5954#issuecomment-1032921170


   <b>Trillian test result (tid-3228)</b>
   Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7
   Total time taken: 31389 seconds
   Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr5954-t3228-kvm-centos7.zip
   Smoke tests completed. 92 look OK, 0 have errors
   Only failed tests results shown below:
   
   
   Test | Result | Time (s) | Test File
   --- | --- | --- | ---
   


-- 
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: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] blueorangutan commented on pull request #5954: Skip systemVM template registration for Simulator

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on pull request #5954:
URL: https://github.com/apache/cloudstack/pull/5954#issuecomment-1032379151


   @rohityadavcloud a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests


-- 
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: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] weizhouapache merged pull request #5954: Skip systemVM template registration for Simulator

Posted by GitBox <gi...@apache.org>.
weizhouapache merged pull request #5954:
URL: https://github.com/apache/cloudstack/pull/5954


   


-- 
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: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] Pearl1594 commented on pull request #5954: Skip systemVM template registration for Simulator

Posted by GitBox <gi...@apache.org>.
Pearl1594 commented on pull request #5954:
URL: https://github.com/apache/cloudstack/pull/5954#issuecomment-1031104302


   yes @sureshanaparti 


-- 
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: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] blueorangutan commented on pull request #5954: Skip systemVM template registration for Simulator

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on pull request #5954:
URL: https://github.com/apache/cloudstack/pull/5954#issuecomment-1032286942


   @sureshanaparti a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress.


-- 
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: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] blueorangutan commented on pull request #5954: Skip systemVM template registration for Simulator

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on pull request #5954:
URL: https://github.com/apache/cloudstack/pull/5954#issuecomment-1031464521


   Packaging result: :heavy_multiplication_x: el7 :heavy_check_mark: el8 :heavy_check_mark: debian :heavy_check_mark: suse15. SL-JID 2500


-- 
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: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] sureshanaparti commented on pull request #5954: Skip systemVM template registration for Simulator

Posted by GitBox <gi...@apache.org>.
sureshanaparti commented on pull request #5954:
URL: https://github.com/apache/cloudstack/pull/5954#issuecomment-1031159734


   @blueorangutan package


-- 
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: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] blueorangutan commented on pull request #5954: Skip systemVM template registration for Simulator

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on pull request #5954:
URL: https://github.com/apache/cloudstack/pull/5954#issuecomment-1031423400


   @sureshanaparti a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress.


-- 
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: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] Pearl1594 edited a comment on pull request #5954: Skip systemVM template registration for Simulator

Posted by GitBox <gi...@apache.org>.
Pearl1594 edited a comment on pull request #5954:
URL: https://github.com/apache/cloudstack/pull/5954#issuecomment-1031104302


   yes @sureshanaparti  - I will address @shwstppr 's comment.


-- 
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: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] shwstppr commented on a change in pull request #5954: Skip systemVM template registration for Simulator

Posted by GitBox <gi...@apache.org>.
shwstppr commented on a change in pull request #5954:
URL: https://github.com/apache/cloudstack/pull/5954#discussion_r800324779



##########
File path: server/src/main/java/com/cloud/storage/StorageManagerImpl.java
##########
@@ -2808,30 +2808,32 @@ public void doInTransactionWithoutResult(final TransactionStatus status) {
                             Pair<String, Long> storeUrlAndId = new Pair<>(url, store.getId());
                             for (HypervisorType hypervisorType : hypSet) {
                                 try {
-                                    String templateName = getValidTemplateName(zoneId, hypervisorType);
-                                    Pair<Hypervisor.HypervisorType, String> hypervisorAndTemplateName =
-                                            new Pair<>(hypervisorType, templateName);
-                                    Long templateId = systemVmTemplateRegistration.getRegisteredTemplateId(hypervisorAndTemplateName);
-                                    VMTemplateVO vmTemplateVO = null;
-                                    TemplateDataStoreVO templateVO = null;
-                                    if (templateId != null) {
-                                        vmTemplateVO = _templateDao.findById(templateId);
-                                        templateVO = _templateStoreDao.findByTemplate(templateId, DataStoreRole.Image);
-                                        if (templateVO != null) {
-                                            try {
-                                                if (SystemVmTemplateRegistration.validateIfSeeded(url, templateVO.getInstallPath())) {
-                                                    continue;
+                                    if (HypervisorType.Simulator != hypervisorType) {

Review comment:
       @Pearl1594 nit-picking but can we use `continue` instead of wrapping everything in a new if statement




-- 
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: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] DaanHoogland commented on a change in pull request #5954: Skip systemVM template registration for Simulator

Posted by GitBox <gi...@apache.org>.
DaanHoogland commented on a change in pull request #5954:
URL: https://github.com/apache/cloudstack/pull/5954#discussion_r800669525



##########
File path: server/src/main/java/com/cloud/storage/StorageManagerImpl.java
##########
@@ -2808,6 +2808,9 @@ public void doInTransactionWithoutResult(final TransactionStatus status) {
                             Pair<String, Long> storeUrlAndId = new Pair<>(url, store.getId());
                             for (HypervisorType hypervisorType : hypSet) {
                                 try {
+                                    if (HypervisorType.Simulator == hypervisorType) {
+                                        continue;
+                                    }

Review comment:
       I don't like that simulator is referenced in production code. Not sure what the solution would be in this case. Open for suggestions.




-- 
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: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] blueorangutan commented on pull request #5954: Skip systemVM template registration for Simulator

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on pull request #5954:
URL: https://github.com/apache/cloudstack/pull/5954#issuecomment-1032315779


   Packaging result: :heavy_check_mark: el7 :heavy_check_mark: el8 :heavy_check_mark: debian :heavy_check_mark: suse15. SL-JID 2511


-- 
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: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] rohityadavcloud commented on pull request #5954: Skip systemVM template registration for Simulator

Posted by GitBox <gi...@apache.org>.
rohityadavcloud commented on pull request #5954:
URL: https://github.com/apache/cloudstack/pull/5954#issuecomment-1032378087


   @blueorangutan test
   
   


-- 
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: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org