Skip to content

Commit 4a5f2dd

Browse files
murali-reddychaturvedia
authored andcommitted
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 (cherry picked from commit 47fa6d9) Signed-off-by: animesh <animesh@apache.org>
1 parent 4b4315f commit 4a5f2dd

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

‎server/src/com/cloud/network/guru/DirectNetworkGuru.java‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,13 @@ public NicProfile allocate(Network network, NicProfile nic, VirtualMachineProfil
204204
allocateDirectIp(nic, network, vm, dc, nic.getRequestedIpv4(), nic.getRequestedIpv6());
205205
nic.setStrategy(ReservationStrategy.Create);
206206

207+
if (nic.getMacAddress() == null) {
208+
nic.setMacAddress(_networkModel.getNextAvailableMacAddressInNetwork(network.getId()));
209+
if (nic.getMacAddress() == null) {
210+
throw new InsufficientAddressCapacityException("Unable to allocate more mac addresses", Network.class, network.getId());
211+
}
212+
}
213+
207214
return nic;
208215
}
209216

0 commit comments

Comments
 (0)