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 2021/11/26 12:08:49 UTC

[GitHub] [cloudstack] weizhouapache commented on a change in pull request #5721: Fix NPE on scale VM operation after the corresponding template is del…

weizhouapache commented on a change in pull request #5721:
URL: https://github.com/apache/cloudstack/pull/5721#discussion_r757450726



##########
File path: engine/orchestration/src/main/java/com/cloud/vm/VirtualMachineManagerImpl.java
##########
@@ -3808,7 +3808,7 @@ public boolean upgradeVmDb(final long vmId, final ServiceOffering newServiceOffe
         if (currentServiceOffering.isDynamic() && !newServiceOffering.isDynamic()) {
             removeCustomOfferingDetails(vmId);
         }
-        VMTemplateVO template = _templateDao.findById(vmForUpdate.getTemplateId());
+        VMTemplateVO template = _templateDao.findByIdIncludingRemoved(vmForUpdate.getTemplateId());

Review comment:
       > does a VM exists after its template got deleted?
   
   @sureshanaparti 
   yes, template can be forced deleted (from secondary storage), but the base image of template still exist on primary storage, vms are not impacted (reinstall might not work)




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