Skip to content

Commit 78d9cb5

Browse files
gruckbitGustavo Rück
andauthored
dynamic vm.network.throttling.rate global configuration (#12567)
Co-authored-by: Gustavo Rück <gustavo.silveira@scclouds.com.br>
1 parent 4244c2c commit 78d9cb5

4 files changed

Lines changed: 5 additions & 11 deletions

File tree

engine/api/src/main/java/org/apache/cloudstack/engine/orchestration/service/NetworkOrchestrationService.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,9 @@ public interface NetworkOrchestrationService {
112112
static final ConfigKey<Boolean> NSX_ENABLED = new ConfigKey<>(Boolean.class, "nsx.plugin.enable", "Advanced", "false",
113113
"Indicates whether to enable the NSX plugin", false, ConfigKey.Scope.Zone, null);
114114

115+
ConfigKey<Integer> VmNetworkThrottlingRate = new ConfigKey<Integer>("Network", Integer.class, "vm.network.throttling.rate", "200",
116+
"Default data transfer rate in megabits per second allowed in User vm's default network.", true, ConfigKey.Scope.Zone);
117+
115118
List<? extends Network> setupNetwork(Account owner, NetworkOffering offering, DeploymentPlan plan, String name, String displayText, boolean isDefault)
116119
throws ConcurrentOperationException;
117120

engine/orchestration/src/main/java/org/apache/cloudstack/engine/orchestration/NetworkOrchestrator.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4905,7 +4905,7 @@ public String getConfigComponentName() {
49054905
@Override
49064906
public ConfigKey<?>[] getConfigKeys() {
49074907
return new ConfigKey<?>[]{NetworkGcWait, NetworkGcInterval, NetworkLockTimeout, DeniedRoutes,
4908-
GuestDomainSuffix, NetworkThrottlingRate, MinVRVersion,
4908+
GuestDomainSuffix, NetworkThrottlingRate, VmNetworkThrottlingRate, MinVRVersion,
49094909
PromiscuousMode, MacAddressChanges, ForgedTransmits, MacLearning, RollingRestartEnabled,
49104910
TUNGSTEN_ENABLED, NSX_ENABLED };
49114911
}

server/src/main/java/com/cloud/configuration/Config.java

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -299,15 +299,6 @@ public enum Config {
299299
"cloud-public",
300300
"Default network label to be used when fetching interface for GRE endpoints",
301301
null),
302-
VmNetworkThrottlingRate(
303-
"Network",
304-
ManagementServer.class,
305-
Integer.class,
306-
"vm.network.throttling.rate",
307-
"200",
308-
"Default data transfer rate in megabits per second allowed in User vm's default network.",
309-
null),
310-
311302
SecurityGroupWorkCleanupInterval(
312303
"Network",
313304
ManagementServer.class,

server/src/main/java/com/cloud/configuration/ConfigurationManagerImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7967,7 +7967,7 @@ public Integer getServiceOfferingNetworkRate(final long serviceOfferingId, final
79677967
if (offering.getVmType() != null && offering.getVmType().equalsIgnoreCase(VirtualMachine.Type.DomainRouter.toString())) {
79687968
networkRate = NetworkOrchestrationService.NetworkThrottlingRate.valueIn(dataCenterId);
79697969
} else {
7970-
networkRate = Integer.parseInt(_configDao.getValue(Config.VmNetworkThrottlingRate.key()));
7970+
networkRate = NetworkOrchestrationService.VmNetworkThrottlingRate.valueIn(dataCenterId);
79717971
}
79727972
}
79737973

0 commit comments

Comments
 (0)