mirror of
https://github.com/apache/cloudstack.git
synced 2025-11-03 04:12:31 +01:00
Improve vm.allocation.algorithm global setting description (#8823)
Co-authored-by: Henrique Sato <henrique.sato@scclouds.com.br>
This commit is contained in:
parent
31f28f6516
commit
090c1e38a6
@ -57,6 +57,17 @@ public interface DeploymentClusterPlanner extends DeploymentPlanner {
|
||||
false,
|
||||
ConfigKey.Scope.Global);
|
||||
|
||||
static final ConfigKey<String> VmAllocationAlgorithm = new ConfigKey<>(
|
||||
String.class,
|
||||
"vm.allocation.algorithm",
|
||||
"Advanced",
|
||||
"random",
|
||||
"Order in which hosts within a cluster will be considered for VM/volume allocation. The value can be 'random', 'firstfit', 'userdispersing', 'userconcentratedpod_random', 'userconcentratedpod_firstfit', or 'firstfitleastconsumed'.",
|
||||
true,
|
||||
ConfigKey.Scope.Global, null, null, null, null, null,
|
||||
ConfigKey.Kind.Select,
|
||||
"random,firstfit,userdispersing,userconcentratedpod_random,userconcentratedpod_firstfit,firstfitleastconsumed");
|
||||
|
||||
/**
|
||||
* This is called to determine list of possible clusters where a virtual
|
||||
* machine can be deployed.
|
||||
|
||||
@ -918,16 +918,6 @@ public enum Config {
|
||||
"1",
|
||||
"Weight for user dispersion heuristic (as a value between 0 and 1) applied to resource allocation during vm deployment. Weight for capacity heuristic will be (1 - weight of user dispersion)",
|
||||
null),
|
||||
VmAllocationAlgorithm(
|
||||
"Advanced",
|
||||
ManagementServer.class,
|
||||
String.class,
|
||||
"vm.allocation.algorithm",
|
||||
"random",
|
||||
"'random', 'firstfit', 'userdispersing', 'userconcentratedpod_random', 'userconcentratedpod_firstfit', 'firstfitleastconsumed' : Order in which hosts within a cluster will be considered for VM/volume allocation.",
|
||||
null,
|
||||
ConfigKey.Kind.Select,
|
||||
"random,firstfit,userdispersing,userconcentratedpod_random,userconcentratedpod_firstfit,firstfitleastconsumed"),
|
||||
VmDeploymentPlanner(
|
||||
"Advanced",
|
||||
ManagementServer.class,
|
||||
|
||||
@ -567,7 +567,7 @@ public class FirstFitPlanner extends AdapterBase implements DeploymentClusterPla
|
||||
@Override
|
||||
public boolean configure(String name, Map<String, Object> params) throws ConfigurationException {
|
||||
super.configure(name, params);
|
||||
allocationAlgorithm = configDao.getValue(Config.VmAllocationAlgorithm.key());
|
||||
allocationAlgorithm = VmAllocationAlgorithm.value();
|
||||
globalDeploymentPlanner = configDao.getValue(Config.VmDeploymentPlanner.key());
|
||||
String configValue;
|
||||
if ((configValue = configDao.getValue(Config.ImplicitHostTags.key())) != null) {
|
||||
@ -594,6 +594,6 @@ public class FirstFitPlanner extends AdapterBase implements DeploymentClusterPla
|
||||
|
||||
@Override
|
||||
public ConfigKey<?>[] getConfigKeys() {
|
||||
return new ConfigKey<?>[] {ClusterCPUCapacityDisableThreshold, ClusterMemoryCapacityDisableThreshold, ClusterThresholdEnabled};
|
||||
return new ConfigKey<?>[] {ClusterCPUCapacityDisableThreshold, ClusterMemoryCapacityDisableThreshold, ClusterThresholdEnabled, VmAllocationAlgorithm};
|
||||
}
|
||||
}
|
||||
|
||||
@ -151,6 +151,7 @@ public class FirstFitPlannerTest {
|
||||
public void setUp() {
|
||||
ConfigKey.init(configDepot);
|
||||
|
||||
when(configDepot.global()).thenReturn(configDao);
|
||||
when(configDao.getValue(Mockito.anyString())).thenReturn(null);
|
||||
when(configDao.getValue(Config.ImplicitHostTags.key())).thenReturn("GPU");
|
||||
|
||||
@ -242,8 +243,6 @@ public class FirstFitPlannerTest {
|
||||
}
|
||||
|
||||
private List<Long> initializeForClusterThresholdDisabled() {
|
||||
when(configDepot.global()).thenReturn(configDao);
|
||||
|
||||
ConfigurationVO config = mock(ConfigurationVO.class);
|
||||
when(config.getValue()).thenReturn(String.valueOf(false));
|
||||
when(configDao.findById(DeploymentClusterPlanner.ClusterThresholdEnabled.key())).thenReturn(config);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user