Skip to content

Commit b1a6ef9

Browse files
committed
Veeam: get templateId from vm instance if vm is created from ISO
1 parent 8230f04 commit b1a6ef9

File tree

1 file changed

+6
-1
lines changed
  • plugins/hypervisors/vmware/src/main/java/com/cloud/hypervisor/guru

1 file changed

+6
-1
lines changed

plugins/hypervisors/vmware/src/main/java/com/cloud/hypervisor/guru/VMwareGuru.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -694,7 +694,12 @@ private Long getImportingVMTemplate(List<VirtualDisk> virtualDisks, long zoneId,
694694
updateTemplateRef(templateId, poolId, templatePath, templateSize);
695695
return templateId;
696696
} else {
697-
return volumeVO.getTemplateId();
697+
Long templateId = volumeVO.getTemplateId();
698+
if (templateId == null && volumeVO.getInstanceId() != null) {
699+
VMInstanceVO vmInstanceVO = vmDao.findByIdIncludingRemoved(volumeVO.getInstanceId());
700+
return vmInstanceVO.getTemplateId();
701+
}
702+
return templateId;
698703
}
699704
}
700705
}

0 commit comments

Comments
 (0)