mirror of https://github.com/apache/cloudstack.git
server: Restarting all networks that needs a restart in a VPC (#4007)
When a VPC is restarted, the networks in the VPC is not restarted, this PR will add the logic to restart the networks in the VPC that needs a restart when the VPC is restarted. Fixes #3816
This commit is contained in:
parent
5054766d9f
commit
88d51ce353
|
|
@ -1747,6 +1747,8 @@ public class VpcManagerImpl extends ManagerBase implements VpcManager, VpcProvis
|
|||
return true;
|
||||
}
|
||||
|
||||
restartVPCNetworks(vpcId, callerAccount, callerUser, cleanUp);
|
||||
|
||||
s_logger.debug("Starting VPC " + vpc + " as a part of VPC restart process without cleanup");
|
||||
if (!startVpc(vpcId, false)) {
|
||||
s_logger.warn("Failed to start vpc as a part of VPC " + vpc + " restart process");
|
||||
|
|
@ -1763,6 +1765,15 @@ public class VpcManagerImpl extends ManagerBase implements VpcManager, VpcProvis
|
|||
}
|
||||
}
|
||||
|
||||
private void restartVPCNetworks(long vpcId, Account callerAccount, User callerUser, boolean cleanUp) throws InsufficientCapacityException, ResourceUnavailableException {
|
||||
List<? extends Network> networks = _ntwkModel.listNetworksByVpc(vpcId);
|
||||
for (Network network: networks) {
|
||||
if (network.isRestartRequired()) {
|
||||
_ntwkMgr.restartNetwork(network.getId(), callerAccount, callerUser, cleanUp);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<PrivateGateway> getVpcPrivateGateways(final long vpcId) {
|
||||
final List<VpcGatewayVO> gateways = _vpcGatewayDao.listByVpcIdAndType(vpcId, VpcGateway.Type.Private);
|
||||
|
|
|
|||
Loading…
Reference in New Issue