mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
remove network limitation of nics on systemvms (cherry picked from commit 0227e0013ad90bb66a29e0852d9a114951b8f6fc)
This commit is contained in:
parent
958312de4c
commit
edf04a33c1
@ -941,16 +941,21 @@ public class NetworkModelImpl extends ManagerBase implements NetworkModel {
|
||||
// from the network offering
|
||||
boolean isUserVmsDefaultNetwork = false;
|
||||
boolean isDomRGuestOrPublicNetwork = false;
|
||||
boolean isSystemVmNetwork = false;
|
||||
if (vm != null) {
|
||||
Nic nic = _nicDao.findByNtwkIdAndInstanceId(networkId, vmId);
|
||||
if (vm.getType() == Type.User && nic != null && nic.isDefaultNic()) {
|
||||
isUserVmsDefaultNetwork = true;
|
||||
} else if (vm.getType() == Type.DomainRouter && ntwkOff != null && (ntwkOff.getTrafficType() == TrafficType.Public || ntwkOff.getTrafficType() == TrafficType.Guest)) {
|
||||
isDomRGuestOrPublicNetwork = true;
|
||||
} else if (vm.getType() == Type.ConsoleProxy || vm.getType() == Type.SecondaryStorageVm) {
|
||||
isSystemVmNetwork = true;
|
||||
}
|
||||
}
|
||||
if (isUserVmsDefaultNetwork || isDomRGuestOrPublicNetwork) {
|
||||
return _configMgr.getServiceOfferingNetworkRate(vm.getServiceOfferingId(), network.getDataCenterId());
|
||||
} else if (isSystemVmNetwork) {
|
||||
return -1;
|
||||
} else {
|
||||
return _configMgr.getNetworkOfferingNetworkRate(ntwkOff.getId(), network.getDataCenterId());
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user