|
34 | 34 | import javax.naming.ConfigurationException; |
35 | 35 |
|
36 | 36 | import org.apache.cloudstack.acl.ControlledEntity.ACLType; |
| 37 | +import org.apache.cloudstack.framework.config.ConfigKey; |
| 38 | +import org.apache.cloudstack.framework.config.Configurable; |
37 | 39 | import org.apache.cloudstack.framework.config.dao.ConfigurationDao; |
38 | 40 | import org.apache.cloudstack.lb.dao.ApplicationLoadBalancerRuleDao; |
39 | 41 | import org.apache.commons.codec.binary.Base64; |
|
124 | 126 | import com.cloud.vm.dao.NicSecondaryIpDao; |
125 | 127 | import com.cloud.vm.dao.VMInstanceDao; |
126 | 128 |
|
127 | | -public class NetworkModelImpl extends ManagerBase implements NetworkModel { |
| 129 | +public class NetworkModelImpl extends ManagerBase implements NetworkModel, Configurable { |
128 | 130 | static final Logger s_logger = Logger.getLogger(NetworkModelImpl.class); |
129 | 131 | @Inject |
130 | 132 | EntityManager _entityMgr; |
@@ -561,7 +563,8 @@ public List<? extends Nic> getNics(long vmId) { |
561 | 563 |
|
562 | 564 | @Override |
563 | 565 | public String getNextAvailableMacAddressInNetwork(long networkId) throws InsufficientAddressCapacityException { |
564 | | - String mac = _networksDao.getNextAvailableMacAddress(networkId); |
| 566 | + NetworkVO network = _networksDao.findById(networkId); |
| 567 | + String mac = _networksDao.getNextAvailableMacAddress(networkId, MACIdentifier.value()); |
565 | 568 | if (mac == null) { |
566 | 569 | throw new InsufficientAddressCapacityException("Unable to create another mac address", Network.class, networkId); |
567 | 570 | } |
@@ -2359,4 +2362,14 @@ public List<String[]> generateVmData(String userData, String serviceOffering, St |
2359 | 2362 |
|
2360 | 2363 | return vmData; |
2361 | 2364 | } |
| 2365 | + |
| 2366 | + @Override |
| 2367 | + public String getConfigComponentName() { |
| 2368 | + return NetworkModel.class.getSimpleName(); |
| 2369 | + } |
| 2370 | + |
| 2371 | + @Override |
| 2372 | + public ConfigKey<?>[] getConfigKeys() { |
| 2373 | + return new ConfigKey<?>[] {MACIdentifier}; |
| 2374 | + } |
2362 | 2375 | } |
0 commit comments