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

(cherry picked from commit ebff469b46)
This commit is contained in:
Anshul Gangwar 2014-06-10 16:28:32 +05:30 committed by Daan Hoogland
parent 2c5f352e94
commit a951b51523
1 changed files with 3 additions and 1 deletions

View File

@ -746,7 +746,9 @@ public class VolumeOrchestrator extends ManagerBase implements VolumeOrchestrati
throw new CloudRuntimeException("Volume shouldn't be null " + volume.getId());
}
VolumeVO volVO = _volsDao.findById(vol.getId());
volVO.setFormat(getSupportedImageFormatForCluster(rootDiskHyperType));
if (volVO.getFormat() == null) {
volVO.setFormat(getSupportedImageFormatForCluster(rootDiskHyperType));
}
_volsDao.update(volVO.getId(), volVO);
return volFactory.getVolume(volVO.getId());
}