From commits-return-30305-apmail-cloudstack-commits-archive=cloudstack.apache.org@cloudstack.apache.org Tue Aug 27 19:34:50 2013 Return-Path: X-Original-To: apmail-cloudstack-commits-archive@www.apache.org Delivered-To: apmail-cloudstack-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 05C3D10E52 for ; Tue, 27 Aug 2013 19:34:50 +0000 (UTC) Received: (qmail 89233 invoked by uid 500); 27 Aug 2013 19:34:49 -0000 Delivered-To: apmail-cloudstack-commits-archive@cloudstack.apache.org Received: (qmail 89072 invoked by uid 500); 27 Aug 2013 19:34:48 -0000 Mailing-List: contact commits-help@cloudstack.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cloudstack.apache.org Delivered-To: mailing list commits@cloudstack.apache.org Received: (qmail 89064 invoked by uid 99); 27 Aug 2013 19:34:48 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 27 Aug 2013 19:34:48 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 36758463B9; Tue, 27 Aug 2013 19:34:48 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: muralireddy@apache.org To: commits@cloudstack.apache.org Message-Id: <8bf0678a0b1e41a8abceaa6b5d868200@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: git commit: updated refs/heads/master to 5f42e29 Date: Tue, 27 Aug 2013 19:34:48 +0000 (UTC) Updated Branches: refs/heads/master c3a275fc7 -> 5f42e2937 CLOUDSTACK-3010: [VMWare] [SharedNetworkWithServices] router VM deployment fails with error "Message: Invalid configuration for device '2'." ensuring that direct network guru assigns a mac address for the nic that it designs Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/5f42e293 Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/5f42e293 Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/5f42e293 Branch: refs/heads/master Commit: 5f42e2937d5a7b32b84e1b07af49711d25504529 Parents: c3a275f Author: Murali Reddy Authored: Wed Aug 28 00:31:15 2013 +0530 Committer: Murali Reddy Committed: Wed Aug 28 00:49:38 2013 +0530 ---------------------------------------------------------------------- server/src/com/cloud/network/guru/DirectNetworkGuru.java | 7 +++++++ 1 file changed, 7 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cloudstack/blob/5f42e293/server/src/com/cloud/network/guru/DirectNetworkGuru.java ---------------------------------------------------------------------- diff --git a/server/src/com/cloud/network/guru/DirectNetworkGuru.java b/server/src/com/cloud/network/guru/DirectNetworkGuru.java index 98533a0..4657c27 100755 --- a/server/src/com/cloud/network/guru/DirectNetworkGuru.java +++ b/server/src/com/cloud/network/guru/DirectNetworkGuru.java @@ -207,6 +207,13 @@ public class DirectNetworkGuru extends AdapterBase implements NetworkGuru { allocateDirectIp(nic, network, vm, dc, nic.getRequestedIpv4(), nic.getRequestedIpv6()); nic.setStrategy(ReservationStrategy.Create); + if (nic.getMacAddress() == null) { + nic.setMacAddress(_networkModel.getNextAvailableMacAddressInNetwork(network.getId())); + if (nic.getMacAddress() == null) { + throw new InsufficientAddressCapacityException("Unable to allocate more mac addresses", Network.class, network.getId()); + } + } + return nic; }