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 47fa6d9561)

Signed-off-by: animesh <animesh@apache.org>
This commit is contained in:
Murali Reddy 2013-08-28 00:31:15 +05:30 committed by animesh
parent 4b4315ff71
commit 4a5f2dd699
1 changed files with 7 additions and 0 deletions

View File

@ -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;
}