Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
498b69b
persist and expose effective network rate for NIC, Network and comput…
sudo87 Jun 3, 2026
c8ac2a0
Merge branch 'main' into networkThrottling
sudo87 Sep 4, 2026
adbdec2
server,engine,api: persist and expose NIC network rate from nics column
sudo87 Sep 4, 2026
fb7cce0
Merge branch 'main' into networkThrottling
DaanHoogland Sep 7, 2026
b684b88
fix ui build due to merge conflict
sudo87 Sep 7, 2026
cd349f5
Merge branch 'main' into networkThrottling
sudo87 Sep 8, 2026
469d391
Merge branch 'main' into networkThrottling
sudo87 Sep 14, 2026
0a2b534
Fix network rate response inconsistency between Network, Nic and Netw…
sudo87 Sep 15, 2026
71d49b8
Apply new precedence rules for VM and VR NIC network rate
sudo87 Sep 16, 2026
4e7236c
Backfill network rate for existing NICs/networks and refresh it on mi…
sudo87 Sep 16, 2026
817c2f9
ui: show Unlimited instead of -1 for network rate
sudo87 Sep 16, 2026
4c8b4ef
Fix backfill NPE and statement auto-close bug found via e2e testing
sudo87 Sep 16, 2026
7a4e287
Support throttling a VPC's public gateway network rate
sudo87 Sep 17, 2026
cdf3135
Fix VPC public gateway rate not applied to VR public NIC, normalize n…
sudo87 Sep 17, 2026
b850965
engine-schema: upgrade path for 24.0.0
shwstppr Sep 7, 2026
18c74d3
fix CS version
shwstppr Sep 9, 2026
29b9b76
fix upgrade unit tests for cutover
shwstppr Sep 10, 2026
ec174a1
fix imports
shwstppr Sep 10, 2026
673fa86
fix template version
shwstppr Sep 15, 2026
20f686c
continue using 3 part version for sys template
shwstppr Sep 15, 2026
8720eb3
fix
shwstppr Sep 15, 2026
d4c3549
fix more
shwstppr Sep 15, 2026
0f4c5ef
use security version after cutover
shwstppr Sep 15, 2026
e1b7a2f
improvements and add tests
shwstppr Sep 15, 2026
d6198c6
fix more scripts
shwstppr Sep 16, 2026
5f8b0dc
address remaining comments
shwstppr Sep 16, 2026
dec9da9
more changes
shwstppr Sep 16, 2026
1fbbe0f
Update versioning logic in export-templates.sh
shwstppr Sep 16, 2026
29415b3
Fix export-templates.sh syntax
nvazquez Sep 17, 2026
57d4881
Align VPC public gateway rate upgrade path with the 4.23.0.0 to 24.0.…
sudo87 Sep 18, 2026
d5428f1
Merge remote-tracking branch 'apache/main' into networkThrottling
sudo87 Sep 18, 2026
8800f0c
Fix two NetworkRateBackfill migration bugs found via a real upgrade test
sudo87 Sep 18, 2026
f7d3e72
Revert incorrect guard change from the previous NetworkRateBackfill fix
sudo87 Sep 18, 2026
c9b2ce2
Store -1 directly for unlimited NIC network rate instead of NULL
sudo87 Sep 18, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions api/src/main/java/com/cloud/network/vpc/VpcOffering.java
Original file line number Diff line number Diff line change
Expand Up @@ -86,4 +86,6 @@ public enum State {
Boolean isSpecifyAsNumber();

boolean isConserveMode();

Integer getPublicNetworkRate();
}
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ VpcOffering createVpcOffering(String name, String displayText, List<String> supp
Map serviceCapabilitystList, NetUtils.InternetProtocol internetProtocol,
Long serviceOfferingId, String externalProvider, NetworkOffering.NetworkMode networkMode,
List<Long> domainIds, List<Long> zoneIds, VpcOffering.State state,
NetworkOffering.RoutingMode routingMode, boolean specifyAsNumber, boolean conserveMode);
NetworkOffering.RoutingMode routingMode, boolean specifyAsNumber, boolean conserveMode, Integer publicNetworkRate);


Pair<List<? extends VpcOffering>,Integer> listVpcOfferings(ListVPCOfferingsCmd cmd);
Expand Down
2 changes: 2 additions & 0 deletions api/src/main/java/com/cloud/vm/Nic.java
Original file line number Diff line number Diff line change
Expand Up @@ -168,5 +168,7 @@ public enum ReservationStrategy {

Integer getMtu();

Integer getNetworkRate();

boolean isEnabled();
}
Original file line number Diff line number Diff line change
Expand Up @@ -729,6 +729,7 @@ public class ApiConstants {
public static final String IS_USER_DEFINED = "isuserdefined";
public static final String AVAILABILITY = "availability";
public static final String NETWORKRATE = "networkrate";
public static final String PUBLIC_NETWORK_RATE = "publicnetworkrate";
public static final String HOST_TAGS = "hosttags";
public static final String SSH_KEYPAIR = "keypair";
public static final String SSH_KEYPAIRS = "keypairs";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,11 @@ public class CreateVPCOfferingCmd extends BaseAsyncCreateCmd {
description = "True if the VPC offering is IP conserve mode enabled, allowing public IPs to be used across multiple VPC tiers. Default value is false")
private Boolean conserveMode;

@Parameter(name = ApiConstants.PUBLIC_NETWORK_RATE, type = CommandType.INTEGER,
since = "4.24.0",
description = "Data transfer rate in megabits per second allowed for a VPC's public gateway (internet-facing network), created with this offering. Default is unlimited")
private Integer publicNetworkRate;


/////////////////////////////////////////////////////
/////////////////// Accessors ///////////////////////
Expand Down Expand Up @@ -318,6 +323,10 @@ public boolean isConserveMode() {
return BooleanUtils.toBoolean(conserveMode);
}

public Integer getPublicNetworkRate() {
return publicNetworkRate;
}

@Override
public void create() throws ResourceAllocationException {
VpcOffering vpcOff = _vpcProvSvc.createVpcOffering(this);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,11 @@ public class UpdateVPCOfferingCmd extends BaseAsyncCmd implements DomainAndZoneI
@Parameter(name = ApiConstants.SORT_KEY, type = CommandType.INTEGER, description = "Sort key of the VPC offering, integer")
private Integer sortKey;

@Parameter(name = ApiConstants.PUBLIC_NETWORK_RATE, type = CommandType.INTEGER,
since = "4.24.0",
description = "Data transfer rate in megabits per second allowed for a VPC's public gateway (internet-facing network), created with this offering. Use 0 for unlimited")
private Integer publicNetworkRate;

/////////////////////////////////////////////////////
/////////////////// Accessors ///////////////////////
/////////////////////////////////////////////////////
Expand Down Expand Up @@ -100,6 +105,10 @@ public Integer getSortKey() {
return sortKey;
}

public Integer getPublicNetworkRate() {
return publicNetworkRate;
}

/////////////////////////////////////////////////////
/////////////// API Implementation///////////////////
/////////////////////////////////////////////////////
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,10 @@ public class NetworkResponse extends BaseResponseWithAssociatedNetwork implement
@Param(description = "MTU configured on the network VR's private interfaces")
private Integer privateMtu;

@SerializedName(ApiConstants.NETWORKRATE)
@Param(description = "Network rate (in Mb/s) configured for the Guest interface of this network; -1 if unlimited", since = "4.24.0")
private Integer networkRate;

@SerializedName(ApiConstants.IP6_DNS1)
@Param(description = "The first IPv6 DNS for the network", since = "4.18.0")
private String ipv6Dns1;
Expand Down Expand Up @@ -707,6 +711,14 @@ public void setPrivateMtu(Integer privateMtu) {
this.privateMtu = privateMtu;
}

public Integer getNetworkRate() {
return networkRate;
}

public void setNetworkRate(Integer networkRate) {
this.networkRate = networkRate;
}

public void setIpv6Dns1(String ipv6Dns1) {
this.ipv6Dns1 = ipv6Dns1;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,10 @@ public class NicResponse extends BaseResponse {
@Param(description = "MTU configured on the NIC", since="4.18.0")
private Integer mtu;

@SerializedName(ApiConstants.NETWORKRATE)
@Param(description = "Network rate (in Mb/s) configured for the NIC; -1 if unlimited", since = "4.24.0")
private Integer networkRate;

@SerializedName(ApiConstants.PUBLIC_IP_ID)
@Param(description = "Public IP address ID associated with this NIC via Static NAT rule")
private String publicIpId;
Expand Down Expand Up @@ -413,6 +417,14 @@ public void setMtu(Integer mtu) {
this.mtu = mtu;
}

public Integer getNetworkRate() {
return networkRate;
}

public void setNetworkRate(Integer networkRate) {
this.networkRate = networkRate;
}

public String getVpcId() {
return vpcId;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,10 @@ public class VpcOfferingResponse extends BaseResponse {
@Param(description = "True if the VPC offering is IP conserve mode enabled, allowing public IP services to be used across multiple VPC tiers.", since = "4.23.0")
private Boolean conserveMode;

@SerializedName(ApiConstants.PUBLIC_NETWORK_RATE)
@Param(description = "Data transfer rate in megabits per second allowed for a VPC's public gateway (internet-facing network), created with this offering; null if not set (falls back to the zone/global default)", since = "4.24.0")
private Integer publicNetworkRate;

public void setId(String id) {
this.id = id;
}
Expand Down Expand Up @@ -213,4 +217,8 @@ public Boolean getConserveMode() {
public void setConserveMode(Boolean conserveMode) {
this.conserveMode = conserveMode;
}

public void setPublicNetworkRate(Integer publicNetworkRate) {
this.publicNetworkRate = publicNetworkRate;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,10 @@ public class VpcResponse extends BaseResponseWithAnnotations implements Controll
@Param(description = "true if VPC offering is ip conserve mode enabled", since = "4.23")
private Boolean vpcOfferingConserveMode;

@SerializedName(ApiConstants.PUBLIC_NETWORK_RATE)
@Param(description = "Data transfer rate in megabits per second allowed for this VPC's public gateway (internet-facing network); -1 if unlimited", since = "4.24.0")
private Integer publicNetworkRate;

@SerializedName(ApiConstants.CREATED)
@Param(description = "The date this VPC was created")
private Date created;
Expand Down Expand Up @@ -209,6 +213,10 @@ public void setVpcOfferingConserveMode(Boolean vpcOfferingConserveMode) {
this.vpcOfferingConserveMode = vpcOfferingConserveMode;
}

public void setPublicNetworkRate(Integer publicNetworkRate) {
this.publicNetworkRate = publicNetworkRate;
}

public void setCreated(final Date created) {
this.created = created;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,9 @@ public interface NetworkOrchestrationService {
ConfigKey<Integer> VmNetworkThrottlingRate = new ConfigKey<Integer>("Network", Integer.class, "vm.network.throttling.rate", "200",
"Default data transfer rate in megabits per second allowed in User vm's default network.", true, ConfigKey.Scope.Zone);

ConfigKey<Integer> VpcPublicNetworkThrottlingRate = new ConfigKey<>("Network", Integer.class, "vpc.public.network.throttling.rate", "0",
"Default data transfer rate in megabits per second allowed for a VPC's public/internet-facing network. 0 means unlimited.", true, ConfigKey.Scope.Zone);

List<? extends Network> setupNetwork(Account owner, NetworkOffering offering, DeploymentPlan plan, String name, String displayText, boolean isDefault)
throws ConcurrentOperationException;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@ public interface ConfigurationManager {

Integer getServiceOfferingNetworkRate(long serviceOfferingId, Long dataCenterId);

Integer getVpcOfferingNetworkRate(long vpcOfferingId, Long dataCenterId);

/**
* Updates a configuration entry with a new value
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -777,6 +777,11 @@ private void updateRouterIpInNetworkDetails(Long networkId, String routerIp, Str
}
}

private void saveNetworkRateInDetails(long networkId, NetworkOffering offering, long dataCenterId) {
Integer rate = _configMgr.getNetworkOfferingNetworkRate(offering.getId(), dataCenterId);
networkDetailsDao.addDetail(networkId, ApiConstants.NETWORKRATE, String.valueOf(rate), true);
}

@Override
public List<? extends Network> setupNetwork(final Account owner, final NetworkOffering offering, final DeploymentPlan plan, final String name, final String displayText, final boolean isDefault)
throws ConcurrentOperationException {
Expand Down Expand Up @@ -852,6 +857,7 @@ public void doInTransactionWithoutResult(final TransactionStatus status) {
}

updateRouterIpInNetworkDetails(networkPersisted.getId(), network.getRouterIp(), network.getRouterIpv6());
saveNetworkRateInDetails(networkPersisted.getId(), offering, plan.getDataCenterId());

if (predefined instanceof NetworkVO && guru instanceof NetworkGuruAdditionalFunctions) {
final NetworkGuruAdditionalFunctions functions = (NetworkGuruAdditionalFunctions) guru;
Expand Down Expand Up @@ -1227,14 +1233,15 @@ public Pair<NicProfile, Integer> allocateNic(final NicProfile requested, final N
NicVO vo = checkForRaceAndAllocateNic(requested, network, isDefaultNic, deviceId, vm);

final Integer networkRate = _networkModel.getNetworkRate(network.getId(), vm.getId());
vo.setNetworkRate(networkRate);
final NicProfile vmNic = new NicProfile(vo, network, vo.getBroadcastUri(), vo.getIsolationUri(), networkRate, _networkModel.isSecurityGroupSupportedInNetwork(network),
_networkModel.getNetworkTag(vm.getHypervisorType(), network));
if (vm.getType() == Type.DomainRouter) {
Pair<NetworkVO, VpcVO> networks = getGuestNetworkRouterAndVpcDetails(vm.getId());
setMtuDetailsInVRNic(networks, network, vo);
_nicDao.update(vo.getId(), vo);
setMtuInVRNicProfile(networks, network.getTrafficType(), vmNic);
}
_nicDao.update(vo.getId(), vo);
return new Pair<>(vmNic, Integer.valueOf(deviceId));
}

Expand Down Expand Up @@ -2300,6 +2307,8 @@ public NicProfile prepareNic(final VirtualMachineProfile vmProfile, final Deploy
nic.setState(Nic.State.Reserved);
}

nic.setNetworkRate(networkRate);

if (vmProfile.getType() == Type.DomainRouter) {
Pair<NetworkVO, VpcVO> networks = getGuestNetworkRouterAndVpcDetails(vmProfile.getId());
setMtuDetailsInVRNic(networks, network, nic);
Expand Down Expand Up @@ -5066,7 +5075,7 @@ public String getConfigComponentName() {
@Override
public ConfigKey<?>[] getConfigKeys() {
return new ConfigKey<?>[]{NetworkGcWait, NetworkGcInterval, NetworkLockTimeout, DeniedRoutes,
GuestDomainSuffix, NetworkThrottlingRate, VmNetworkThrottlingRate, MinVRVersion, DhcpLeaseTimeout,
GuestDomainSuffix, NetworkThrottlingRate, VmNetworkThrottlingRate, VpcPublicNetworkThrottlingRate, MinVRVersion, DhcpLeaseTimeout,
PromiscuousMode, MacAddressChanges, ForgedTransmits, MacLearning, RollingRestartEnabled,
TUNGSTEN_ENABLED, NSX_ENABLED, NETRIS_ENABLED, NETWORK_LB_HAPROXY_MAX_CONN,
NETWORK_LB_HAPROXY_IDLE_TIMEOUT};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,9 @@ public class VpcOfferingVO implements VpcOffering {
@Column(name = "conserve_mode")
private boolean conserveMode;

@Column(name = "public_nw_rate")
private Integer publicNetworkRate;

public VpcOfferingVO() {
this.uuid = UUID.randomUUID().toString();
}
Expand Down Expand Up @@ -254,4 +257,13 @@ public boolean isConserveMode() {
public void setConserveMode(boolean conserveMode) {
this.conserveMode = conserveMode;
}

@Override
public Integer getPublicNetworkRate() {
return publicNetworkRate;
}

public void setPublicNetworkRate(Integer publicNetworkRate) {
this.publicNetworkRate = publicNetworkRate;
}
}
Loading
Loading