mirror of
https://github.com/apache/cloudstack.git
synced 2025-11-03 04:12:31 +01:00
Merge pull request #1024 from shapeblue/CLOUDSTACK-9019-master
[4.6/master] CLOUDSTACK-9019: Add storage network offering in ssvm only if storage network is defined During creation of SSVM, checks and adds NetworkOffering.SystemStorageNetwork to offerings only if storage network exists for the target datacenter. (Manually tested) * pr/1024: CLOUDSTACK-9019: Add storage network offering in ssvm only if storage network is defined Signed-off-by: Remi Bergsma <github@remi.nl>
This commit is contained in:
commit
0ba871b127
@ -92,6 +92,7 @@ import com.cloud.network.dao.IPAddressVO;
|
||||
import com.cloud.network.dao.NetworkDao;
|
||||
import com.cloud.network.dao.NetworkVO;
|
||||
import com.cloud.network.rules.RulesManager;
|
||||
import com.cloud.network.StorageNetworkManager;
|
||||
import com.cloud.offering.NetworkOffering;
|
||||
import com.cloud.offering.ServiceOffering;
|
||||
import com.cloud.offerings.dao.NetworkOfferingDao;
|
||||
@ -180,6 +181,8 @@ public class SecondaryStorageManagerImpl extends ManagerBase implements Secondar
|
||||
@Inject
|
||||
protected SecondaryStorageVmDao _secStorageVmDao;
|
||||
@Inject
|
||||
protected StorageNetworkManager _sNwMgr;
|
||||
@Inject
|
||||
private DataCenterDao _dcDao;
|
||||
@Inject
|
||||
private VMTemplateDao _templateDao;
|
||||
@ -551,9 +554,12 @@ public class SecondaryStorageManagerImpl extends ManagerBase implements Secondar
|
||||
defaultNetwork = defaultNetworks.get(0);
|
||||
}
|
||||
|
||||
List<? extends NetworkOffering> offerings =
|
||||
_networkModel.getSystemAccountNetworkOfferings(NetworkOffering.SystemControlNetwork, NetworkOffering.SystemManagementNetwork,
|
||||
NetworkOffering.SystemStorageNetwork);
|
||||
List<? extends NetworkOffering> offerings = null;
|
||||
if (_sNwMgr.isStorageIpRangeAvailable(dataCenterId)) {
|
||||
offerings = _networkModel.getSystemAccountNetworkOfferings(NetworkOffering.SystemControlNetwork, NetworkOffering.SystemManagementNetwork, NetworkOffering.SystemStorageNetwork);
|
||||
} else {
|
||||
offerings = _networkModel.getSystemAccountNetworkOfferings(NetworkOffering.SystemControlNetwork, NetworkOffering.SystemManagementNetwork);
|
||||
}
|
||||
LinkedHashMap<Network, List<? extends NicProfile>> networks = new LinkedHashMap<Network, List<? extends NicProfile>>(offerings.size() + 1);
|
||||
NicProfile defaultNic = new NicProfile();
|
||||
defaultNic.setDefaultNic(true);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user