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 68406ba
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: api/src/org/apache/cloudstack/api/command/admin/systemvm/ScaleSystemVMCmd.java
+25Lines changed: 25 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -39,6 +39,11 @@
39
39
importcom.cloud.user.Account;
40
40
importcom.cloud.vm.VirtualMachine;
41
41
42
+
importjava.util.Collection;
43
+
importjava.util.HashMap;
44
+
importjava.util.Iterator;
45
+
importjava.util.Map;
46
+
42
47
@APICommand(name = "scaleSystemVm",
43
48
responseObject = SystemVmResponse.class,
44
49
description = "Scale the service offering for a system vm (console proxy or secondary storage). " + "The system vm must be in a \"Stopped\" state for "
@@ -61,6 +66,11 @@ public class ScaleSystemVMCmd extends BaseAsyncCmd {
61
66
description = "the service offering ID to apply to the system vm")
62
67
privateLongserviceOfferingId;
63
68
69
+
@Parameter(name=ApiConstants.CUSTOM_PARAMETERS,
70
+
type = CommandType.MAP,
71
+
description = "name value pairs of custom parameters for cpu, memory and cpunumber. example customparameters[i].name=value")
Copy file name to clipboardExpand all lines: api/src/org/apache/cloudstack/api/command/admin/systemvm/UpgradeSystemVMCmd.java
+25Lines changed: 25 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -34,6 +34,11 @@
34
34
importcom.cloud.user.Account;
35
35
importcom.cloud.vm.VirtualMachine;
36
36
37
+
importjava.util.Collection;
38
+
importjava.util.HashMap;
39
+
importjava.util.Iterator;
40
+
importjava.util.Map;
41
+
37
42
@APICommand(name = "changeServiceForSystemVm",
38
43
responseObject = SystemVmResponse.class,
39
44
description = "Changes the service offering for a system vm (console proxy or secondary storage). " + "The system vm must be in a \"Stopped\" state for "
@@ -56,6 +61,11 @@ public class UpgradeSystemVMCmd extends BaseCmd {
56
61
description = "the service offering ID to apply to the system vm")
57
62
privateLongserviceOfferingId;
58
63
64
+
@Parameter(name=ApiConstants.CUSTOM_PARAMETERS,
65
+
type = CommandType.MAP,
66
+
description = "name value pairs of custom parameters for cpu, memory and cpunumber. example customparameters[i].name=value")
Copy file name to clipboardExpand all lines: api/src/org/apache/cloudstack/api/command/user/vm/ScaleVMCmd.java
+29Lines changed: 29 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -39,6 +39,12 @@
39
39
importcom.cloud.user.Account;
40
40
importcom.cloud.uservm.UserVm;
41
41
42
+
importjava.util.Collection;
43
+
importjava.util.HashMap;
44
+
importjava.util.Iterator;
45
+
importjava.util.Map;
46
+
47
+
42
48
@APICommand(name = "scaleVirtualMachine", description = "Scales the virtual machine to a new service offering.", responseObject = SuccessResponse.class)
Copy file name to clipboardExpand all lines: api/src/org/apache/cloudstack/api/command/user/vm/UpgradeVMCmd.java
+25Lines changed: 25 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -34,6 +34,11 @@
34
34
importcom.cloud.user.Account;
35
35
importcom.cloud.uservm.UserVm;
36
36
37
+
importjava.util.Collection;
38
+
importjava.util.HashMap;
39
+
importjava.util.Iterator;
40
+
importjava.util.Map;
41
+
37
42
@APICommand(name = "changeServiceForVirtualMachine", responseObject = UserVmResponse.class, description = "Changes the service offering for a virtual machine. "
38
43
+ "The virtual machine must be in a \"Stopped\" state for " + "this command to take effect.")
39
44
publicclassUpgradeVMCmdextendsBaseCmd {
@@ -54,6 +59,11 @@ public class UpgradeVMCmd extends BaseCmd {
54
59
description = "the service offering ID to apply to the virtual machine")
55
60
privateLongserviceOfferingId;
56
61
62
+
@Parameter(name=ApiConstants.CUSTOM_PARAMETERS,
63
+
type = CommandType.MAP,
64
+
description = "name value pairs of custom parameters for cpu, memory and cpunumber. example customparameters[i].name=value")
thrownewInvalidParameterValueException("Unable to find a service offering with id " + newServiceOfferingId);
3016
+
thrownewInvalidParameterValueException("Unable to find a service offering with id " + newServiceOffering.getId());
3018
3017
}
3019
3018
3020
3019
// Check that the VM is stopped / running
@@ -3025,7 +3024,7 @@ public void checkIfCanUpgrade(VirtualMachine vmInstance, long newServiceOffering
3025
3024
}
3026
3025
3027
3026
// Check if the service offering being upgraded to is what the VM is already running with
3028
-
if (vmInstance.getServiceOfferingId() == newServiceOffering.getId()) {
3027
+
if (!newServiceOffering.isDynamic() && vmInstance.getServiceOfferingId() == newServiceOffering.getId()) {
3029
3028
if (s_logger.isInfoEnabled()) {
3030
3029
s_logger.info("Not upgrading vm " + vmInstance.toString() + " since it already has the requested " + "service offering (" + newServiceOffering.getName() +
3031
3030
")");
@@ -3734,7 +3733,7 @@ public VMInstanceVO orchestrateReConfigureVm(String vmUuid, ServiceOffering oldS
0 commit comments