Skip to content

Commit 66d1eb9

Browse files
anshulgangwardevdeep
authored andcommitted
CLOUDSTACK-6865 , CLOUDSTACK-6868: [hyperv] while attaching the volume we were changing the volume's Image format to hypervisor's default Image format, hence it was failing to find the volume with vhdx format. Now changed the behavior to set Image Format for volume only when it is not set
1 parent 8e0aba4 commit 66d1eb9

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

engine/orchestration/src/org/apache/cloudstack/engine/orchestration/VolumeOrchestrator.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -773,7 +773,9 @@ public VolumeInfo createVolumeOnPrimaryStorage(VirtualMachine vm, VolumeInfo vol
773773
throw new CloudRuntimeException("Volume shouldn't be null " + volume.getId());
774774
}
775775
VolumeVO volVO = _volsDao.findById(vol.getId());
776-
volVO.setFormat(getSupportedImageFormatForCluster(rootDiskHyperType));
776+
if (volVO.getFormat() == null) {
777+
volVO.setFormat(getSupportedImageFormatForCluster(rootDiskHyperType));
778+
}
777779
_volsDao.update(volVO.getId(), volVO);
778780
return volFactory.getVolume(volVO.getId());
779781
}

0 commit comments

Comments
 (0)