Fix precission issue when calculating image size in GB.
When calculating imageGb, should use 1073741824.0 (Bytes in a GB) as the divisor. Closes-Bug: 1807639 Change-Id: I096dbf84826866e3e6916474157f8697b9f546ab Signed-off-by: Yan Chen <yan.chen@intel.com>
This commit is contained in:
@@ -525,7 +525,7 @@
|
||||
|
||||
if (source && ctrl.currentBootSource === bootSourceTypes.IMAGE ||
|
||||
source && ctrl.currentBootSource === bootSourceTypes.INSTANCE_SNAPSHOT ) {
|
||||
var imageGb = source.size * 1e-9;
|
||||
var imageGb = source.size / 1073741824.0;
|
||||
var imageDisk = source.min_disk;
|
||||
ctrl.minVolumeSize = Math.ceil(Math.max(imageGb, imageDisk));
|
||||
if ($scope.model.newInstanceSpec.vol_size < ctrl.minVolumeSize) {
|
||||
|
Reference in New Issue
Block a user