|
29 | 29 | import com.cloud.agent.api.CreateLogicalSwitchCommand; |
30 | 30 | import com.cloud.agent.api.DeleteLogicalSwitchAnswer; |
31 | 31 | import com.cloud.agent.api.DeleteLogicalSwitchCommand; |
| 32 | +import com.cloud.dc.DataCenter; |
32 | 33 | import com.cloud.dc.DataCenter.NetworkType; |
33 | 34 | import com.cloud.dc.dao.DataCenterDao; |
34 | 35 | import com.cloud.deploy.DeployDestination; |
@@ -119,8 +120,9 @@ public Network design(NetworkOffering offering, DeploymentPlan plan, |
119 | 120 | Network userSpecified, Account owner) { |
120 | 121 | // Check of the isolation type of the related physical network is STT |
121 | 122 | PhysicalNetworkVO physnet = _physicalNetworkDao.findById(plan.getPhysicalNetworkId()); |
122 | | - if (physnet == null || physnet.getIsolationMethods() == null || !physnet.getIsolationMethods().contains("STT")) { |
123 | | - s_logger.debug("Refusing to design this network, the physical isolation type is not STT"); |
| 123 | + DataCenter dc = _dcDao.findById(plan.getDataCenterId()); |
| 124 | + if (!canHandle(offering,dc.getNetworkType(),physnet)) { |
| 125 | + s_logger.debug("Refusing to design this network"); |
124 | 126 | return null; |
125 | 127 | } |
126 | 128 |
|
@@ -199,6 +201,7 @@ public Network implement(Network network, NetworkOffering offering, |
199 | 201 | s_logger.info("Implemented OK, network linked to = " + implemented.getBroadcastUri().toString()); |
200 | 202 | } catch (URISyntaxException e) { |
201 | 203 | s_logger.error("Unable to store logical switch id in broadcast uri, uuid = " + implemented.getUuid(), e); |
| 204 | + return null; |
202 | 205 | } |
203 | 206 |
|
204 | 207 | return implemented; |
|
0 commit comments