This is an automated email from the ASF dual-hosted git repository.

dahn pushed a commit to branch 4.20
in repository https://gitbox.apache.org/repos/asf/cloudstack.git


The following commit(s) were added to refs/heads/4.20 by this push:
     new 2954e969475 Veeam: get templateId from vm instance if vm is created 
from ISO (#10705)
2954e969475 is described below

commit 2954e9694752a27837c95e09047dc3b08135a449
Author: Wei Zhou <[email protected]>
AuthorDate: Fri Nov 7 11:55:27 2025 +0100

    Veeam: get templateId from vm instance if vm is created from ISO (#10705)
---
 .../vmware/src/main/java/com/cloud/hypervisor/guru/VMwareGuru.java | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git 
a/plugins/hypervisors/vmware/src/main/java/com/cloud/hypervisor/guru/VMwareGuru.java
 
b/plugins/hypervisors/vmware/src/main/java/com/cloud/hypervisor/guru/VMwareGuru.java
index c02513f4889..efe09194467 100644
--- 
a/plugins/hypervisors/vmware/src/main/java/com/cloud/hypervisor/guru/VMwareGuru.java
+++ 
b/plugins/hypervisors/vmware/src/main/java/com/cloud/hypervisor/guru/VMwareGuru.java
@@ -694,7 +694,12 @@ public class VMwareGuru extends HypervisorGuruBase 
implements HypervisorGuru, Co
                     updateTemplateRef(templateId, poolId, templatePath, 
templateSize);
                     return templateId;
                 } else {
-                    return volumeVO.getTemplateId();
+                    Long templateId = volumeVO.getTemplateId();
+                    if (templateId == null && volumeVO.getInstanceId() != 
null) {
+                        VMInstanceVO vmInstanceVO = 
vmDao.findByIdIncludingRemoved(volumeVO.getInstanceId());
+                        return vmInstanceVO.getTemplateId();
+                    }
+                    return templateId;
                 }
             }
         }

Reply via email to