mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
CLOUDSTACK-985: Make sure RvR would always have same MAC address
Even with newly created RvR using "restartNetwork&cleanup=false" API.
This commit is contained in:
parent
c32dbec468
commit
4f889bd426
@ -1699,6 +1699,13 @@ public class VirtualNetworkApplianceManagerImpl implements VirtualNetworkApplian
|
||||
}
|
||||
NetworkOfferingVO publicOffering = _networkMgr.getSystemAccountNetworkOfferings(NetworkOfferingVO.SystemPublicNetwork).get(0);
|
||||
List<NetworkVO> 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<NetworkVO, NicProfile>(publicNetworks.get(0), defaultNic));
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user