Updated Branches:
  refs/heads/4.2-forward 8099a6e20 -> 47fa6d956

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/47fa6d95
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/47fa6d95
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/47fa6d95

Branch: refs/heads/4.2-forward
Commit: 47fa6d95611c596d4705ffc0f422e3dab70931a5
Parents: 8099a6e
Author: Murali Reddy <[email protected]>
Authored: Wed Aug 28 00:31:15 2013 +0530
Committer: Murali Reddy <[email protected]>
Committed: Wed Aug 28 00:33:24 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/47fa6d95/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 b4577ac..ca4f068 100755
--- a/server/src/com/cloud/network/guru/DirectNetworkGuru.java
+++ b/server/src/com/cloud/network/guru/DirectNetworkGuru.java
@@ -204,6 +204,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;
     }
 

Reply via email to