Skip to content

Commit 6f28947

Browse files
author
Gustavo Silveira
committed
dynamic vm.network.throttling.rate global configuration
1 parent 7b94ccc commit 6f28947

File tree

4 files changed

+5
-11
lines changed

4 files changed

+5
-11
lines changed

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
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);
117+
115118
ConfigKey<Boolean> NETRIS_ENABLED = new ConfigKey<>(Boolean.class, "netris.plugin.enable", "Advanced", "false",
116119
"Indicates whether to enable the Netris plugin", false, ConfigKey.Scope.Zone, null);
117120
ConfigKey<Integer> NETWORK_LB_HAPROXY_MAX_CONN = new ConfigKey<>(

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
@@ -4919,6 +4919,6 @@ public ConfigKey<?>[] getConfigKeys() {
49194919
return new ConfigKey<?>[]{NetworkGcWait, NetworkGcInterval, NetworkLockTimeout, DeniedRoutes,
49204920
GuestDomainSuffix, NetworkThrottlingRate, MinVRVersion,
49214921
PromiscuousMode, MacAddressChanges, ForgedTransmits, MacLearning, RollingRestartEnabled,
4922-
TUNGSTEN_ENABLED, NSX_ENABLED, NETRIS_ENABLED, NETWORK_LB_HAPROXY_MAX_CONN};
4922+
TUNGSTEN_ENABLED, NSX_ENABLED, NETRIS_ENABLED, NETWORK_LB_HAPROXY_MAX_CONN, VmNetworkThrottlingRate};
49234923
}
49244924
}

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

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -289,14 +289,6 @@ public enum Config {
289289
"cloud-public",
290290
"Default network label to be used when fetching interface for GRE endpoints",
291291
null),
292-
VmNetworkThrottlingRate(
293-
"Network",
294-
ManagementServer.class,
295-
Integer.class,
296-
"vm.network.throttling.rate",
297-
"200",
298-
"Default data transfer rate in megabits per second allowed in User vm's default network.",
299-
null),
300292

301293
SecurityGroupWorkCleanupInterval(
302294
"Network",

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8242,8 +8242,7 @@ public Integer getServiceOfferingNetworkRate(final long serviceOfferingId, final
82428242
if (offering.getVmType() != null && offering.getVmType().equalsIgnoreCase(VirtualMachine.Type.DomainRouter.toString())) {
82438243
networkRate = NetworkOrchestrationService.NetworkThrottlingRate.valueIn(dataCenterId);
82448244
} else {
8245-
networkRate = Integer.parseInt(_configDao.getValue(Config.VmNetworkThrottlingRate.key()));
8246-
}
8245+
networkRate = NetworkOrchestrationService.VmNetworkThrottlingRate.value();}
82478246
}
82488247

82498248
// networkRate is unsigned int in serviceOffering table, and can't be

0 commit comments

Comments
 (0)