mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
Fix for dynamic scaling toggle for instance (#11086)
* Fix for dynamic scaling toggle for instance * Update api/src/main/java/org/apache/cloudstack/api/response/CapabilitiesResponse.java --------- Co-authored-by: Suresh Kumar Anaparti <sureshkumar.anaparti@gmail.com>
This commit is contained in:
parent
3fc02ddd45
commit
264e404108
@ -71,6 +71,7 @@ public class ListCapabilitiesCmd extends BaseCmd {
|
||||
response.setInstancesStatsUserOnly((Boolean) capabilities.get(ApiConstants.INSTANCES_STATS_USER_ONLY));
|
||||
response.setInstancesDisksStatsRetentionEnabled((Boolean) capabilities.get(ApiConstants.INSTANCES_DISKS_STATS_RETENTION_ENABLED));
|
||||
response.setInstancesDisksStatsRetentionTime((Integer) capabilities.get(ApiConstants.INSTANCES_DISKS_STATS_RETENTION_TIME));
|
||||
response.setDynamicScalingEnabled((Boolean) capabilities.get(ApiConstants.DYNAMIC_SCALING_ENABLED));
|
||||
response.setObjectName("capability");
|
||||
response.setResponseName(getCommandName());
|
||||
this.setResponseObject(response);
|
||||
|
||||
@ -124,6 +124,10 @@ public class CapabilitiesResponse extends BaseResponse {
|
||||
@Param(description = "the retention time for Instances disks stats", since = "4.18.0")
|
||||
private Integer instancesDisksStatsRetentionTime;
|
||||
|
||||
@SerializedName(ApiConstants.DYNAMIC_SCALING_ENABLED)
|
||||
@Param(description = "true if dynamically scaling for instances is enabled", since = "4.21.0")
|
||||
private Boolean dynamicScalingEnabled;
|
||||
|
||||
public void setSecurityGroupsEnabled(boolean securityGroupsEnabled) {
|
||||
this.securityGroupsEnabled = securityGroupsEnabled;
|
||||
}
|
||||
@ -223,4 +227,8 @@ public class CapabilitiesResponse extends BaseResponse {
|
||||
public void setCustomHypervisorDisplayName(String customHypervisorDisplayName) {
|
||||
this.customHypervisorDisplayName = customHypervisorDisplayName;
|
||||
}
|
||||
|
||||
public void setDynamicScalingEnabled(Boolean dynamicScalingEnabled) {
|
||||
this.dynamicScalingEnabled = dynamicScalingEnabled;
|
||||
}
|
||||
}
|
||||
|
||||
@ -4408,6 +4408,7 @@ public class ManagementServerImpl extends ManagerBase implements ManagementServe
|
||||
capabilities.put(ApiConstants.INSTANCES_STATS_USER_ONLY, StatsCollector.vmStatsCollectUserVMOnly.value());
|
||||
capabilities.put(ApiConstants.INSTANCES_DISKS_STATS_RETENTION_ENABLED, StatsCollector.vmDiskStatsRetentionEnabled.value());
|
||||
capabilities.put(ApiConstants.INSTANCES_DISKS_STATS_RETENTION_TIME, StatsCollector.vmDiskStatsMaxRetentionTime.value());
|
||||
capabilities.put(ApiConstants.DYNAMIC_SCALING_ENABLED, UserVmManager.EnableDynamicallyScaleVm.value());
|
||||
if (apiLimitEnabled) {
|
||||
capabilities.put("apiLimitInterval", apiLimitInterval);
|
||||
capabilities.put("apiLimitMax", apiLimitMax);
|
||||
|
||||
@ -944,8 +944,7 @@ export default {
|
||||
keyboards: [],
|
||||
bootTypes: [],
|
||||
bootModes: [],
|
||||
ioPolicyTypes: [],
|
||||
dynamicScalingVmConfig: false
|
||||
ioPolicyTypes: []
|
||||
},
|
||||
rowCount: {},
|
||||
loading: {
|
||||
@ -1175,13 +1174,6 @@ export default {
|
||||
type: 'Routing'
|
||||
},
|
||||
field: 'hostid'
|
||||
},
|
||||
dynamicScalingVmConfig: {
|
||||
list: 'listConfigurations',
|
||||
options: {
|
||||
zoneid: _.get(this.zone, 'id'),
|
||||
name: 'enable.dynamic.scale.vm'
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
@ -1312,7 +1304,7 @@ export default {
|
||||
return Boolean('listUserData' in this.$store.getters.apis)
|
||||
},
|
||||
dynamicScalingVmConfigValue () {
|
||||
return this.options.dynamicScalingVmConfig?.[0]?.value === 'true'
|
||||
return this.$store.getters.features.dynamicscalingenabled
|
||||
},
|
||||
isCustomizedDiskIOPS () {
|
||||
return this.diskSelected?.iscustomizediops || false
|
||||
@ -2215,7 +2207,7 @@ export default {
|
||||
param.loading = true
|
||||
param.opts = []
|
||||
const options = param.options || {}
|
||||
if (!('listall' in options) && !['zones', 'pods', 'clusters', 'hosts', 'dynamicScalingVmConfig', 'hypervisors'].includes(name)) {
|
||||
if (!('listall' in options) && !['zones', 'pods', 'clusters', 'hosts', 'hypervisors'].includes(name)) {
|
||||
options.listall = true
|
||||
}
|
||||
api(param.list, options).then((response) => {
|
||||
|
||||
@ -960,8 +960,7 @@ export default {
|
||||
keyboards: [],
|
||||
bootTypes: [],
|
||||
bootModes: [],
|
||||
ioPolicyTypes: [],
|
||||
dynamicScalingVmConfig: false
|
||||
ioPolicyTypes: []
|
||||
},
|
||||
rowCount: {},
|
||||
loading: {
|
||||
@ -1194,13 +1193,6 @@ export default {
|
||||
type: 'Routing'
|
||||
},
|
||||
field: 'hostid'
|
||||
},
|
||||
dynamicScalingVmConfig: {
|
||||
list: 'listConfigurations',
|
||||
options: {
|
||||
zoneid: _.get(this.zone, 'id'),
|
||||
name: 'enable.dynamic.scale.vm'
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
@ -1332,7 +1324,7 @@ export default {
|
||||
return Boolean('listUserData' in this.$store.getters.apis)
|
||||
},
|
||||
dynamicScalingVmConfigValue () {
|
||||
return this.options.dynamicScalingVmConfig?.[0]?.value === 'true'
|
||||
return this.$store.getters.features.dynamicscalingenabled
|
||||
},
|
||||
isCustomizedDiskIOPS () {
|
||||
return this.diskSelected?.iscustomizediops || false
|
||||
@ -2403,7 +2395,7 @@ export default {
|
||||
param.loading = true
|
||||
param.opts = []
|
||||
const options = param.options || {}
|
||||
if (!('listall' in options) && !['zones', 'pods', 'clusters', 'hosts', 'dynamicScalingVmConfig', 'hypervisors'].includes(name)) {
|
||||
if (!('listall' in options) && !['zones', 'pods', 'clusters', 'hosts', 'hypervisors'].includes(name)) {
|
||||
options.listall = true
|
||||
}
|
||||
api(param.list, options).then((response) => {
|
||||
|
||||
@ -145,7 +145,6 @@ export default {
|
||||
template: {},
|
||||
userDataEnabled: false,
|
||||
securityGroupsEnabled: false,
|
||||
dynamicScalingVmConfig: false,
|
||||
loading: false,
|
||||
securitygroups: {
|
||||
loading: false,
|
||||
@ -189,7 +188,6 @@ export default {
|
||||
this.fetchInstaceGroups()
|
||||
this.fetchServiceOfferingData()
|
||||
this.fetchTemplateData()
|
||||
this.fetchDynamicScalingVmConfig()
|
||||
this.fetchUserData()
|
||||
},
|
||||
fetchZoneDetails () {
|
||||
@ -241,18 +239,8 @@ export default {
|
||||
this.template = templateResponses[0]
|
||||
})
|
||||
},
|
||||
fetchDynamicScalingVmConfig () {
|
||||
const params = {}
|
||||
params.name = 'enable.dynamic.scale.vm'
|
||||
params.zoneid = this.resource.zoneid
|
||||
var apiName = 'listConfigurations'
|
||||
api(apiName, params).then(json => {
|
||||
const configResponse = json.listconfigurationsresponse.configuration
|
||||
this.dynamicScalingVmConfig = configResponse[0]?.value === 'true'
|
||||
})
|
||||
},
|
||||
canDynamicScalingEnabled () {
|
||||
return this.template.isdynamicallyscalable && this.serviceOffering.dynamicscalingenabled && this.dynamicScalingVmConfig
|
||||
isDynamicScalingEnabled () {
|
||||
return this.template.isdynamicallyscalable && this.serviceOffering.dynamicscalingenabled && this.$store.getters.features.dynamicscalingenabled
|
||||
},
|
||||
fetchOsTypes () {
|
||||
this.osTypes.loading = true
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user