Clean up global redundant_router config item

We would use network_offering option in 3.0 instead.
This commit is contained in:
Sheng Yang 2011-09-27 15:50:42 -07:00
parent f40cfebd97
commit 1fb5030cca
3 changed files with 4 additions and 4 deletions

View File

@ -81,7 +81,6 @@ public enum Config {
VmNetworkThrottlingRate("Network", ManagementServer.class, Integer.class, "vm.network.throttling.rate", "200", "Default data transfer rate in megabits per second allowed in User vm's default network.", null),
RedundantRouter("Network", ManagementServer.class, Boolean.class, "network.redundantrouter", "false", "enable/disable redundant virtual router", null),
SecurityGroupWorkCleanupInterval("Network", ManagementServer.class, Integer.class, "network.securitygroups.work.cleanup.interval", "120", "Time interval (seconds) in which finished work is cleaned up from the work table", null),
SecurityGroupWorkerThreads("Network", ManagementServer.class, Integer.class, "network.securitygroups.workers.pool.size", "50", "Number of worker threads processing the security group update work queue", null),
SecurityGroupWorkGlobalLockTimeout("Network", ManagementServer.class, Integer.class, "network.securitygroups.work.lock.timeout", "300", "Lock wait timeout (seconds) while updating the security group work queue", null),

View File

@ -53,6 +53,7 @@ import com.cloud.network.rules.RulesManager;
import com.cloud.network.rules.StaticNat;
import com.cloud.network.vpn.RemoteAccessVpnElement;
import com.cloud.offering.NetworkOffering;
import com.cloud.offerings.NetworkOfferingVO;
import com.cloud.offerings.dao.NetworkOfferingDao;
import com.cloud.org.Cluster;
import com.cloud.uservm.UserVm;
@ -100,7 +101,6 @@ public class VirtualRouterElement extends DhcpElement implements NetworkElement,
@Override
public boolean implement(Network guestConfig, NetworkOffering offering, DeployDestination dest, ReservationContext context) throws ResourceUnavailableException, ConcurrentOperationException, InsufficientCapacityException {
boolean isRedundant = _configDao.getValue("network.redundantrouter").equals("true");
if (!canHandle(guestConfig.getGuestType(), dest.getDataCenter())) {
return false;
}
@ -117,13 +117,14 @@ public class VirtualRouterElement extends DhcpElement implements NetworkElement,
@Override
public boolean prepare(Network network, NicProfile nic, VirtualMachineProfile<? extends VirtualMachine> vm, DeployDestination dest, ReservationContext context) throws ConcurrentOperationException, InsufficientCapacityException, ResourceUnavailableException {
if (canHandle(network.getGuestType(), dest.getDataCenter())) {
boolean isRedundant = _configDao.getValue("network.redundantrouter").equals("true");
if (vm.getType() != VirtualMachine.Type.User) {
return false;
}
@SuppressWarnings("unchecked")
VirtualMachineProfile<UserVm> uservm = (VirtualMachineProfile<UserVm>)vm;
NetworkOfferingVO offering = _networkOfferingDao.findById(network.getNetworkOfferingId());
boolean isRedundant = offering.getRedundantRouter();
List<DomainRouterVO> routers = _routerMgr.deployVirtualRouter(network, dest, _accountMgr.getAccount(network.getAccountId()), uservm.getParameters(), isRedundant);
if ((routers == null) || (routers.size() == 0)) {
throw new ResourceUnavailableException("Can't find at least one running router!", this.getClass(), 0);

View File

@ -1382,7 +1382,7 @@ public class VirtualNetworkApplianceManagerImpl implements VirtualNetworkApplian
buf.append(" template=domP type=" + type+rpFilter);
buf.append(" name=").append(profile.getHostName());
boolean isRedundant = _configDao.getValue("network.redundantrouter").equals("true");
boolean isRedundant = router.getIsRedundantRouter();
if (isRedundant) {
buf.append(" redundant_router=1");
List<DomainRouterVO> routers = _routerDao.listByNetworkAndRole(network.getId(), Role.DHCP_FIREWALL_LB_PASSWD_USERDATA);