mirror of https://github.com/apache/cloudstack.git
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 Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
This commit is contained in:
parent
20bbd342ce
commit
8922707076
|
|
@ -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…
Reference in New Issue