From e9bd0594bd4230adff1cc2edbe083aad4db982a8 Mon Sep 17 00:00:00 2001 From: abhishek Date: Thu, 4 Nov 2010 15:51:01 -0700 Subject: [PATCH] bug 7022: fixing the custom size for volumes bug status 7022: resolved fixed --- server/src/com/cloud/storage/StorageManagerImpl.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/server/src/com/cloud/storage/StorageManagerImpl.java b/server/src/com/cloud/storage/StorageManagerImpl.java index 7e87105a0d1..4268afcf330 100755 --- a/server/src/com/cloud/storage/StorageManagerImpl.java +++ b/server/src/com/cloud/storage/StorageManagerImpl.java @@ -1700,8 +1700,11 @@ public class StorageManagerImpl implements StorageManager { if ((diskOffering == null) || !DiskOfferingVO.Type.Disk.equals(diskOffering.getType())) { throw new InvalidParameterValueException("Please specify a valid disk offering."); } - size = (diskOffering.getDiskSize()*1024*1024);//the disk offering size is in MB, which needs to be converted into bytes + if(diskOffering.getDiskSize() > 0) + size = (diskOffering.getDiskSize()*1024*1024);//the disk offering size is in MB, which needs to be converted into bytes + else + size = (size*1024*1024);//custom size made consistent with disk offering size which is in MB, to be converted to bytes } } else { Long snapshotId = cmd.getSnapshotId();