Return-Path: X-Original-To: apmail-incubator-cloudstack-commits-archive@minotaur.apache.org Delivered-To: apmail-incubator-cloudstack-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id F344DE4D7 for ; Wed, 16 Jan 2013 02:19:10 +0000 (UTC) Received: (qmail 18660 invoked by uid 500); 16 Jan 2013 02:19:10 -0000 Delivered-To: apmail-incubator-cloudstack-commits-archive@incubator.apache.org Received: (qmail 18587 invoked by uid 500); 16 Jan 2013 02:19:10 -0000 Mailing-List: contact cloudstack-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: cloudstack-dev@incubator.apache.org Delivered-To: mailing list cloudstack-commits@incubator.apache.org Received: (qmail 18291 invoked by uid 99); 16 Jan 2013 02:19:09 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 16 Jan 2013 02:19:09 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 9C5C61F325; Wed, 16 Jan 2013 02:19:09 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: mchen@apache.org To: cloudstack-commits@incubator.apache.org X-Mailer: ASF-Git Admin Mailer Subject: [5/9] git commit: CLOUDSTACK-985: Make sure RvR would always have same MAC address Message-Id: <20130116021909.9C5C61F325@tyr.zones.apache.org> Date: Wed, 16 Jan 2013 02:19:09 +0000 (UTC) CLOUDSTACK-985: Make sure RvR would always have same MAC address Even with newly created RvR using "restartNetwork&cleanup=false" API. Project: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/commit/4f889bd4 Tree: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/tree/4f889bd4 Diff: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/diff/4f889bd4 Branch: refs/heads/api_limit Commit: 4f889bd426ea841918b570bb008cf5e348715730 Parents: c32dbec Author: Sheng Yang Authored: Tue Jan 15 15:22:41 2013 -0800 Committer: Sheng Yang Committed: Tue Jan 15 15:22:41 2013 -0800 ---------------------------------------------------------------------- .../router/VirtualNetworkApplianceManagerImpl.java | 7 +++++++ 1 files changed, 7 insertions(+), 0 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/4f889bd4/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java ---------------------------------------------------------------------- diff --git a/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java b/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java index c8fd86e..717da05 100755 --- a/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java +++ b/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java @@ -1699,6 +1699,13 @@ public class VirtualNetworkApplianceManagerImpl implements VirtualNetworkApplian } NetworkOfferingVO publicOffering = _networkMgr.getSystemAccountNetworkOfferings(NetworkOfferingVO.SystemPublicNetwork).get(0); List publicNetworks = _networkMgr.setupNetwork(_systemAcct, publicOffering, plan, null, null, false); + String publicIp = defaultNic.getIp4Address(); + // We want to use the identical MAC address for RvR on public interface if possible + NicVO peerNic = _nicDao.findByIp4AddressAndNetworkId(publicIp, publicNetworks.get(0).getId()); + if (peerNic != null) { + s_logger.info("Use same MAC as previous RvR, the MAC is " + peerNic.getMacAddress()); + defaultNic.setMacAddress(peerNic.getMacAddress()); + } networks.add(new Pair(publicNetworks.get(0), defaultNic)); }