Skip to content

Commit 3bf4b14

Browse files
committed
server: fix scale for dummy template ingested vm
For vm import, dummy template can be used - https://docs.cloudstack.apache.org/en/latest/adminguide/virtual_machines.html#dummy-template Named as system-default-vm-import-dummy-template.iso, the template is marked as removed in the CloudStack DB. For scale operation while trying to find vm template, server needs to find in all templates including removed. Fixes #5096 Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
1 parent b258232 commit 3bf4b14

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

server/src/main/java/com/cloud/storage/VolumeApiServiceImpl.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -924,8 +924,8 @@ public VolumeVO resizeVolume(ResizeVolumeCmd cmd) throws ResourceAllocationExcep
924924
if (newDiskOffering == null) {
925925
Long templateId = volume.getTemplateId();
926926
if (templateId != null) {
927-
VMTemplateVO template = _templateDao.findById(templateId);
928-
format = template.getFormat();
927+
VMTemplateVO template = _templateDao.findByIdIncludingRemoved(templateId);
928+
format = template != null ? template.getFormat() : null;
929929
}
930930

931931
if (volume.getVolumeType().equals(Volume.Type.ROOT) && diskOffering.getDiskSize() > 0 && format != null && format != ImageFormat.ISO) {

0 commit comments

Comments
 (0)