From 143ec3a4c502a91e9e64559cf06da7689a9add5a Mon Sep 17 00:00:00 2001 From: Sheng Yang Date: Thu, 29 Sep 2011 16:38:00 -0700 Subject: [PATCH] Clean up priority calcuation/create new mac when create domain router They're unnecessary. --- .../router/VirtualNetworkApplianceManagerImpl.java | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java b/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java index c63cddb7931..08612bef7b8 100755 --- a/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java +++ b/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java @@ -1075,7 +1075,6 @@ public class VirtualNetworkApplianceManagerImpl implements VirtualNetworkApplian NicProfile gatewayNic = new NicProfile(); if (isRedundant) { gatewayNic.setIp4Address(_networkMgr.acquireGuestIpAddress(guestNetwork, null)); - gatewayNic.setMacAddress(_networkMgr.getNextAvailableMacAddressInNetwork(guestNetwork.getId())); } else { gatewayNic.setIp4Address(guestNetwork.getGateway()); } @@ -1094,13 +1093,8 @@ public class VirtualNetworkApplianceManagerImpl implements VirtualNetworkApplian if (routers.size() >= 5) { s_logger.error("Too much redundant routers!"); } - // Priority would be recalculated when start up the redundant router - int priority = 0; - if (isRedundant) { - priority = DEFAULT_PRIORITY; - } router = new DomainRouterVO(id, _offering.getId(), VirtualMachineName.getRouterName(id, _instance), template.getId(), template.getHypervisorType(), template.getGuestOSId(), - owner.getDomainId(), owner.getId(), guestNetwork.getId(), isRedundant, priority, false, RedundantState.UNKNOWN, _offering.getOfferHA(), false); + owner.getDomainId(), owner.getId(), guestNetwork.getId(), isRedundant, 0, false, RedundantState.UNKNOWN, _offering.getOfferHA(), false); router = _itMgr.allocate(router, template, _offering, networks, plan, null, owner); // Creating stats entry for router UserStatisticsVO stats = _userStatsDao.findBy(owner.getId(), dcId, router.getNetworkId(), null, router.getId(), router.getType().toString());