You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit e9e2ee3
Browse filesBrowse the repository at this point in the historyBrowse files
Marcus Sorensen
committed
CLOUDSTACK-6181: Merge of resize root feature (resize-root branch)
Copy file name to clipboardExpand all lines: api/src/org/apache/cloudstack/api/command/user/vm/DeployVMCmd.java
+6Lines changed: 6 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -121,6 +121,9 @@ public class DeployVMCmd extends BaseAsyncCreateCustomIdCmd {
121
121
@Parameter(name = ApiConstants.SIZE, type = CommandType.LONG, description = "the arbitrary size for the DATADISK volume. Mutually exclusive with diskOfferingId")
122
122
privateLongsize;
123
123
124
+
@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")
125
+
privateLongrootdisksize;
126
+
124
127
@Parameter(name = ApiConstants.GROUP, type = CommandType.STRING, description = "an optional group for the virtual machine")
125
128
privateStringgroup;
126
129
@@ -226,6 +229,9 @@ public Map<String, String> getDetails() {
226
229
}
227
230
}
228
231
}
232
+
if (rootdisksize != null && !customparameterMap.containsKey("rootdisksize")) {
s_logger.debug("Using root disk size of " + rootDisksize + " for volume " + name);
619
+
size = rootDisksize;
620
+
} else {
621
+
s_logger.debug("Using root disk size of " + size + " for volume " + name + "since specified root disk size of " + rootDisksize + " is smaller than template");
* Volumes with no hypervisor have never been assigned, and can be
706
-
* resized by recreating. perhaps in the future we can just update the
707
-
* db entry for the volume
708
-
*/
709
-
if (_volsDao.getHypervisorType(volume.getId()) == HypervisorType.None) {
710
-
thrownewInvalidParameterValueException("Can't resize a volume that has never been attached, not sure which hypervisor type. Recreate volume to resize.");
711
-
}
712
-
713
-
/* Only works for KVM/Xen for now */
714
-
if (_volsDao.getHypervisorType(volume.getId()) != HypervisorType.KVM && _volsDao.getHypervisorType(volume.getId()) != HypervisorType.XenServer
0 commit comments