mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
Revert " CLOUDSTACK-737,"
This reverts commit 95aef332cc851f91bafb9af7bf5f0f682bb566ce.
This commit is contained in:
parent
68c110cb18
commit
b4f3f92607
@ -1523,11 +1523,13 @@ public class ConfigurationManagerImpl extends ManagerBase implements Configurati
|
||||
// check if zone has necessary trafficTypes before enabling
|
||||
try {
|
||||
PhysicalNetwork mgmtPhyNetwork;
|
||||
// zone should have a physical network with management traffiType
|
||||
mgmtPhyNetwork = _networkModel.getDefaultPhysicalNetworkByZoneAndTrafficType(zoneId, TrafficType.Management);
|
||||
if (NetworkType.Advanced == zone.getNetworkType() && ! zone.isSecurityGroupEnabled() ) {
|
||||
// advanced zone without SG should have a physical network with public Thpe
|
||||
if (NetworkType.Advanced == zone.getNetworkType()) {
|
||||
// zone should have a physical network with public and management traffiType
|
||||
_networkModel.getDefaultPhysicalNetworkByZoneAndTrafficType(zoneId, TrafficType.Public);
|
||||
mgmtPhyNetwork = _networkModel.getDefaultPhysicalNetworkByZoneAndTrafficType(zoneId, TrafficType.Management);
|
||||
} else {
|
||||
// zone should have a physical network with management traffiType
|
||||
mgmtPhyNetwork = _networkModel.getDefaultPhysicalNetworkByZoneAndTrafficType(zoneId, TrafficType.Management);
|
||||
}
|
||||
|
||||
try {
|
||||
|
||||
@ -756,28 +756,19 @@ public class ConsoleProxyManagerImpl extends ManagerBase implements ConsoleProxy
|
||||
|
||||
DataCenterDeployment plan = new DataCenterDeployment(dataCenterId);
|
||||
|
||||
NetworkVO defaultNetwork = null;
|
||||
if (dc.getNetworkType() == NetworkType.Advanced && dc.isSecurityGroupEnabled()) {
|
||||
List<NetworkVO> networks = _networkDao.listByZoneSecurityGroup(dataCenterId);
|
||||
if (networks == null || networks.size() == 0) {
|
||||
throw new CloudRuntimeException("Can not found security enabled network in SG Zone " + dc);
|
||||
}
|
||||
defaultNetwork = networks.get(0);
|
||||
} else {
|
||||
TrafficType defaultTrafficType = TrafficType.Public;
|
||||
if (dc.getNetworkType() == NetworkType.Basic || dc.isSecurityGroupEnabled()) {
|
||||
defaultTrafficType = TrafficType.Guest;
|
||||
}
|
||||
List<NetworkVO> defaultNetworks = _networkDao.listByZoneAndTrafficType(dataCenterId, defaultTrafficType);
|
||||
|
||||
// api should never allow this situation to happen
|
||||
if (defaultNetworks.size() != 1) {
|
||||
throw new CloudRuntimeException("Found " + defaultNetworks.size() + " networks of type "
|
||||
+ defaultTrafficType + " when expect to find 1");
|
||||
}
|
||||
defaultNetwork = defaultNetworks.get(0);
|
||||
TrafficType defaultTrafficType = TrafficType.Public;
|
||||
if (dc.getNetworkType() == NetworkType.Basic || dc.isSecurityGroupEnabled()) {
|
||||
defaultTrafficType = TrafficType.Guest;
|
||||
}
|
||||
|
||||
List<NetworkVO> defaultNetworks = _networkDao.listByZoneAndTrafficType(dataCenterId, defaultTrafficType);
|
||||
|
||||
if (defaultNetworks.size() != 1) {
|
||||
throw new CloudRuntimeException("Found " + defaultNetworks.size() + " networks of type " + defaultTrafficType + " when expect to find 1");
|
||||
}
|
||||
|
||||
NetworkVO defaultNetwork = defaultNetworks.get(0);
|
||||
|
||||
List<? extends NetworkOffering> offerings = _networkModel.getSystemAccountNetworkOfferings(NetworkOffering.SystemControlNetwork, NetworkOffering.SystemManagementNetwork);
|
||||
List<Pair<NetworkVO, NicProfile>> networks = new ArrayList<Pair<NetworkVO, NicProfile>>(offerings.size() + 1);
|
||||
NicProfile defaultNic = new NicProfile();
|
||||
|
||||
@ -540,27 +540,19 @@ public class SecondaryStorageManagerImpl extends ManagerBase implements Secondar
|
||||
DataCenterDeployment plan = new DataCenterDeployment(dataCenterId);
|
||||
DataCenter dc = _dcDao.findById(plan.getDataCenterId());
|
||||
|
||||
NetworkVO defaultNetwork = null;
|
||||
if (dc.getNetworkType() == NetworkType.Advanced && dc.isSecurityGroupEnabled()) {
|
||||
List<NetworkVO> networks = _networkDao.listByZoneSecurityGroup(dataCenterId);
|
||||
if (networks == null || networks.size() == 0) {
|
||||
throw new CloudRuntimeException("Can not found security enabled network in SG Zone " + dc);
|
||||
}
|
||||
defaultNetwork = networks.get(0);
|
||||
} else {
|
||||
TrafficType defaultTrafficType = TrafficType.Public;
|
||||
|
||||
if (dc.getNetworkType() == NetworkType.Basic || dc.isSecurityGroupEnabled()) {
|
||||
defaultTrafficType = TrafficType.Guest;
|
||||
}
|
||||
List<NetworkVO> defaultNetworks = _networkDao.listByZoneAndTrafficType(dataCenterId, defaultTrafficType);
|
||||
// api should never allow this situation to happen
|
||||
if (defaultNetworks.size() != 1) {
|
||||
throw new CloudRuntimeException("Found " + defaultNetworks.size() + " networks of type "
|
||||
+ defaultTrafficType + " when expect to find 1");
|
||||
}
|
||||
defaultNetwork = defaultNetworks.get(0);
|
||||
TrafficType defaultTrafficType = TrafficType.Public;
|
||||
if (dc.getNetworkType() == NetworkType.Basic || dc.isSecurityGroupEnabled()) {
|
||||
defaultTrafficType = TrafficType.Guest;
|
||||
}
|
||||
|
||||
List<NetworkVO> defaultNetworks = _networkDao.listByZoneAndTrafficType(dataCenterId, defaultTrafficType);
|
||||
|
||||
//api should never allow this situation to happen
|
||||
if (defaultNetworks.size() != 1) {
|
||||
throw new CloudRuntimeException("Found " + defaultNetworks.size() + " networks of type " + defaultTrafficType + " when expect to find 1");
|
||||
}
|
||||
|
||||
NetworkVO defaultNetwork = defaultNetworks.get(0);
|
||||
|
||||
List<? extends NetworkOffering> offerings = _networkModel.getSystemAccountNetworkOfferings(NetworkOfferingVO.SystemControlNetwork, NetworkOfferingVO.SystemManagementNetwork, NetworkOfferingVO.SystemStorageNetwork);
|
||||
List<Pair<NetworkVO, NicProfile>> networks = new ArrayList<Pair<NetworkVO, NicProfile>>(offerings.size() + 1);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user