diff --git a/plugins/storage/volume/scaleio/src/main/java/org/apache/cloudstack/storage/datastore/driver/ScaleIOPrimaryDataStoreDriver.java b/plugins/storage/volume/scaleio/src/main/java/org/apache/cloudstack/storage/datastore/driver/ScaleIOPrimaryDataStoreDriver.java index 192ae4636e9c..3d2ca5b1d096 100644 --- a/plugins/storage/volume/scaleio/src/main/java/org/apache/cloudstack/storage/datastore/driver/ScaleIOPrimaryDataStoreDriver.java +++ b/plugins/storage/volume/scaleio/src/main/java/org/apache/cloudstack/storage/datastore/driver/ScaleIOPrimaryDataStoreDriver.java @@ -1230,13 +1230,13 @@ private void resizeVolume(VolumeInfo volumeInfo) { } org.apache.cloudstack.storage.datastore.api.Volume scaleIOVolume = client.getVolume(scaleIOVolumeId); - long newSizeInGB = newSizeInBytes / (1024 * 1024 * 1024); - long newSizeIn8gbBoundary = (long) (Math.ceil(newSizeInGB / 8.0) * 8.0); + double newSizeInGB = newSizeInBytes / (1024.0 * 1024 * 1024); + long newSizeIn8GBBoundary = (long) (Math.ceil(newSizeInGB / 8.0) * 8.0); - if (scaleIOVolume.getSizeInKb() == newSizeIn8gbBoundary << 20) { + if (scaleIOVolume.getSizeInKb() == newSizeIn8GBBoundary << 20) { logger.debug("No resize necessary at API"); } else { - scaleIOVolume = client.resizeVolume(scaleIOVolumeId, (int) newSizeIn8gbBoundary); + scaleIOVolume = client.resizeVolume(scaleIOVolumeId, (int) newSizeIn8GBBoundary); if (scaleIOVolume == null) { throw new CloudRuntimeException("Failed to resize volume: " + volumeInfo.getName()); } @@ -1362,12 +1362,12 @@ public void resize(DataObject dataObject, AsyncCompletionCallback