mirror of https://github.com/apache/cloudstack.git
Vpc: fixed the network shutdown happening as a part of GC thread for VPC networks
This commit is contained in:
parent
1dc3ee51f5
commit
b8f67f0249
|
|
@ -2244,7 +2244,12 @@ public class NetworkManagerImpl implements NetworkManager, NetworkService, Manag
|
|||
@Override
|
||||
public NicProfile releaseNic(VirtualMachineProfile<? extends VMInstanceVO> vmProfile, NetworkVO network, URI broadcastUri)
|
||||
throws ConcurrentOperationException, ResourceUnavailableException {
|
||||
NicVO nic = _nicDao.findByInstanceIdNetworkIdAndBroadcastUri(network.getId(), vmProfile.getId(), broadcastUri.toString());
|
||||
NicVO nic = null;
|
||||
if (broadcastUri != null) {
|
||||
nic = _nicDao.findByInstanceIdNetworkIdAndBroadcastUri(network.getId(), vmProfile.getId(), broadcastUri.toString());
|
||||
} else {
|
||||
nic = _nicDao.findByInstanceIdAndNetworkId(network.getId(), vmProfile.getId());
|
||||
}
|
||||
releaseNic(vmProfile, nic, network);
|
||||
|
||||
NicProfile profile = new NicProfile(nic, network, nic.getBroadcastUri(), nic.getIsolationUri(), null,
|
||||
|
|
|
|||
|
|
@ -504,7 +504,7 @@ public class VpcVirtualNetworkApplianceManagerImpl extends VirtualNetworkApplian
|
|||
boolean result = true;
|
||||
|
||||
Nic nic = _nicDao.findByInstanceIdAndNetworkId(network.getId(), router.getId());
|
||||
long guestVlanTag = Long.parseLong(nic.getBroadcastUri().getHost());
|
||||
long guestVlanTag = Long.parseLong(network.getBroadcastUri().getHost());
|
||||
|
||||
String brd = NetUtils.long2Ip(NetUtils.ip2Long(guestNic.getIp4Address()) | ~NetUtils.ip2Long(guestNic.getNetmask()));
|
||||
Integer priority = null;
|
||||
|
|
|
|||
|
|
@ -2457,6 +2457,11 @@ public class VirtualMachineManagerImpl implements VirtualMachineManager, Listene
|
|||
if (nicVO != null) {
|
||||
nic = _networkMgr.getNicProfile(vm, network.getId());
|
||||
}
|
||||
} else {
|
||||
NicVO nicVO = _nicsDao.findByInstanceIdAndNetworkId(network.getId(), vm.getId());
|
||||
if (nicVO != null) {
|
||||
nic = _networkMgr.getNicProfile(vm, network.getId());
|
||||
}
|
||||
}
|
||||
|
||||
if (nic == null) {
|
||||
|
|
|
|||
|
|
@ -264,7 +264,9 @@ public class DomainRouterDaoImpl extends GenericDaoBase<DomainRouterVO, Long> im
|
|||
if (guestNetworks != null && !guestNetworks.isEmpty()) {
|
||||
// 2) add router to the network
|
||||
for (Network guestNetwork : guestNetworks) {
|
||||
addRouterToGuestNetwork(router, guestNetwork);
|
||||
if (!isRouterPartOfGuestNetwork(router.getId(), guestNetwork.getId())) {
|
||||
addRouterToGuestNetwork(router, guestNetwork);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue