cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From milam...@apache.org
Subject git commit: updated refs/heads/4.4 to e93d356
Date Sat, 23 May 2015 17:54:35 GMT
Repository: cloudstack
Updated Branches:
  refs/heads/4.4 e63f2bdf7 -> e93d356b2


CLOUDSTACK-6181 Specify GB for the value of rootdisksize parameter. Add some Bytes/GB for
log or exception messages. Fix Gb->GB.


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/e93d356b
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/e93d356b
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/e93d356b

Branch: refs/heads/4.4
Commit: e93d356b2c170229e2a1ea67c804f53be90e8ef2
Parents: e63f2bd
Author: Milamber <milamber@apache.org>
Authored: Sat May 23 16:58:05 2015 +0100
Committer: Milamber <milamber@apache.org>
Committed: Sat May 23 18:54:23 2015 +0100

----------------------------------------------------------------------
 .../apache/cloudstack/api/command/user/vm/DeployVMCmd.java   | 2 +-
 .../cloudstack/engine/orchestration/VolumeOrchestrator.java  | 8 ++++----
 server/src/com/cloud/vm/UserVmManagerImpl.java               | 4 +++-
 3 files changed, 8 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e93d356b/api/src/org/apache/cloudstack/api/command/user/vm/DeployVMCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/vm/DeployVMCmd.java b/api/src/org/apache/cloudstack/api/command/user/vm/DeployVMCmd.java
index 1beb595..1381bfe 100755
--- a/api/src/org/apache/cloudstack/api/command/user/vm/DeployVMCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/vm/DeployVMCmd.java
@@ -121,7 +121,7 @@ public class DeployVMCmd extends BaseAsyncCreateCustomIdCmd {
 
     @Parameter(name = ApiConstants.ROOT_DISK_SIZE,
             type = CommandType.LONG,
-            description = "Optional field to resize root disk on deploy. Only applies to
template-based deployments. Analogous to details[0].rootdisksize, which takes precedence over
this parameter if both are provided",
+            description = "Optional field to resize root disk on deploy. Value is in GB.
Only applies to template-based deployments. Analogous to details[0].rootdisksize, which takes
precedence over this parameter if both are provided",
             since = "4.4")
     private Long rootdisksize;
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e93d356b/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/VolumeOrchestrator.java
----------------------------------------------------------------------
diff --git a/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/VolumeOrchestrator.java
b/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/VolumeOrchestrator.java
index 12908ba..573fdd3 100644
--- a/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/VolumeOrchestrator.java
+++ b/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/VolumeOrchestrator.java
@@ -561,9 +561,9 @@ public class VolumeOrchestrator extends ManagerBase implements VolumeOrchestrati
     @Override
     public boolean validateVolumeSizeRange(long size) {
         if (size < 0 || (size > 0 && size < (1024 * 1024 * 1024))) {
-            throw new InvalidParameterValueException("Please specify a size of at least 1
Gb.");
+            throw new InvalidParameterValueException("Please specify a size of at least 1
GB.");
         } else if (size > (MaxVolumeSize.value() * 1024 * 1024 * 1024)) {
-            throw new InvalidParameterValueException("volume size " + size + ", but the maximum
size allowed is " + MaxVolumeSize + " Gb.");
+            throw new InvalidParameterValueException("volume size " + size + ", but the maximum
size allowed is " + MaxVolumeSize + " GB.");
         }
 
         return true;
@@ -626,10 +626,10 @@ public class VolumeOrchestrator extends ManagerBase implements VolumeOrchestrati
         if (rootDisksize != null ) {
             rootDisksize = rootDisksize * 1024 * 1024 * 1024;
             if (rootDisksize > size) {
-                s_logger.debug("Using root disk size of " + rootDisksize + " for volume "
+ name);
+                s_logger.debug("Using root disk size of " + rootDisksize + " Bytes for volume
" + name);
                 size = rootDisksize;
             } else {
-                s_logger.debug("Using root disk size of " + size + " for volume " + name
+ "since specified root disk size of " + rootDisksize + " is smaller than template");
+                s_logger.debug("Using root disk size of " + size + " Bytes for volume " +
name + "since specified root disk size of " + rootDisksize + " Bytes is smaller than template");
             }
         }
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e93d356b/server/src/com/cloud/vm/UserVmManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/vm/UserVmManagerImpl.java b/server/src/com/cloud/vm/UserVmManagerImpl.java
index 148eaef..9e1aa4b 100755
--- a/server/src/com/cloud/vm/UserVmManagerImpl.java
+++ b/server/src/com/cloud/vm/UserVmManagerImpl.java
@@ -2968,7 +2968,9 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager,
Vir
                     }
 
                     if ((rootDiskSize << 30) < templateVO.getSize()) {
-                        throw new InvalidParameterValueException("unsupported: rootdisksize
override is smaller than template size " + templateVO.getSize());
+                        Long templateVOSizeGB = templateVO.getSize() / 1024 / 1024 / 1024;
+                        throw new InvalidParameterValueException("unsupported: rootdisksize
override is smaller than template size " + templateVO.getSize()
+                            + "B (" + templateVOSizeGB + "GB)");
                     } else {
                         s_logger.debug("rootdisksize of " + (rootDiskSize << 30) +
" was larger than template size of " + templateVO.getSize());
                     }


Mime
View raw message