bug 12608: NaaS: Don't shutdown elements if cleanup=false

We can use the restartNetwork mechanism to recover the disconnected redundant
router.

Also disable HA for redundant router. Admin would take responsibilty to recover
the failure router, because redundant routers themselves are one layer HA.

status 12608: resolved fixed
This commit is contained in:
Sheng Yang 2011-12-16 18:52:59 -08:00
parent a2cc66ce41
commit a269b089ae
2 changed files with 18 additions and 7 deletions

View File

@ -2820,14 +2820,19 @@ public class NetworkManagerImpl implements NetworkManager, NetworkService, Manag
s_logger.debug("Restarting network " + networkId + "...");
//shutdown the network
ReservationContext context = new ReservationContextImpl(null, null, callerUser, callerAccount);
s_logger.debug("Shutting down the network id=" + networkId + " as a part of network restart");
if (cleanup) {
//shutdown the network
s_logger.debug("Shutting down the network id=" + networkId + " as a part of network restart");
if (!shutdownNetworkElementsAndResources(context, cleanup, network)) {
s_logger.debug("Failed to shutdown the network elements and resources as a part of network restart: " + network.getState());
setRestartRequired(network, true);
return false;
if (!shutdownNetworkElementsAndResources(context, true, network)) {
s_logger.debug("Failed to shutdown the network elements and resources as a part of network restart: " + network.getState());
setRestartRequired(network, true);
return false;
}
} else {
s_logger.debug("Skip the shutting down of network id=" + networkId);
}
//implement the network elements and rules again

View File

@ -1346,9 +1346,15 @@ public class VirtualNetworkApplianceManagerImpl implements VirtualNetworkApplian
s_logger.debug(hType + " won't support system vm, skip it");
continue;
}
boolean offerHA = routerOffering.getOfferHA();
/* We don't provide HA to redundant router VMs, admin should own it all, and redundant router themselves are HA */
if (isRedundant) {
offerHA = false;
}
router = new DomainRouterVO(id, routerOffering.getId(), vrProvider.getId(), VirtualMachineName.getRouterName(id, _instance), template.getId(), template.getHypervisorType(),
template.getGuestOSId(), owner.getDomainId(), owner.getId(), guestNetwork.getId(), isRedundant, 0, false, RedundantState.UNKNOWN, routerOffering.getOfferHA(), false);
template.getGuestOSId(), owner.getDomainId(), owner.getId(), guestNetwork.getId(), isRedundant, 0, false, RedundantState.UNKNOWN, offerHA, false);
router.setRole(Role.VIRTUAL_ROUTER);
router = _itMgr.allocate(router, template, routerOffering, networks, plan, null, owner);
break;