|
26 | 26 | import javax.inject.Inject; |
27 | 27 |
|
28 | 28 | import com.cloud.event.ActionEventUtils; |
| 29 | +import com.cloud.server.ConfigurationServer; |
29 | 30 | import com.cloud.utils.Pair; |
30 | 31 | import org.apache.log4j.Logger; |
31 | 32 |
|
@@ -98,6 +99,8 @@ public abstract class GuestNetworkGuru extends AdapterBase implements NetworkGur |
98 | 99 | IPAddressDao _ipAddressDao; |
99 | 100 | @Inject |
100 | 101 | protected PhysicalNetworkDao _physicalNetworkDao; |
| 102 | + @Inject |
| 103 | + ConfigurationServer _configServer; |
101 | 104 | Random _rand = new Random(System.currentTimeMillis()); |
102 | 105 |
|
103 | 106 | private static final TrafficType[] _trafficTypes = {TrafficType.Guest}; |
@@ -155,6 +158,11 @@ public IsolationMethod[] getIsolationMethods() { |
155 | 158 | return _isolationMethods; |
156 | 159 | } |
157 | 160 |
|
| 161 | + public boolean canUseSystemGuestVlan(long accountId) { |
| 162 | + return Boolean.parseBoolean(_configServer.getConfigValue(Config.UseSystemGuestVlans.key(), |
| 163 | + Config.ConfigurationParameterScope.account.toString(), accountId)); |
| 164 | + } |
| 165 | + |
158 | 166 | protected abstract boolean canHandle(NetworkOffering offering, final NetworkType networkType, PhysicalNetwork physicalNetwork); |
159 | 167 |
|
160 | 168 | @Override |
@@ -260,7 +268,8 @@ public int getGloballyConfiguredCidrSize() { |
260 | 268 | protected void allocateVnet(Network network, NetworkVO implemented, long dcId, |
261 | 269 | long physicalNetworkId, String reservationId) throws InsufficientVirtualNetworkCapcityException { |
262 | 270 | if (network.getBroadcastUri() == null) { |
263 | | - String vnet = _dcDao.allocateVnet(dcId, physicalNetworkId, network.getAccountId(), reservationId); |
| 271 | + String vnet = _dcDao.allocateVnet(dcId, physicalNetworkId, network.getAccountId(), reservationId, |
| 272 | + canUseSystemGuestVlan(network.getAccountId())); |
264 | 273 | if (vnet == null) { |
265 | 274 | throw new InsufficientVirtualNetworkCapcityException("Unable to allocate vnet as a " + |
266 | 275 | "part of network " + network + " implement ", DataCenter.class, dcId); |
|
0 commit comments