mdesaive commented on issue #2540: problem adding new shared network NIC to VM "A NIC with this MAC address exits for network:" URL: https://github.com/apache/cloudstack/issues/2540#issuecomment-379193983 Stephan investigated the issue and found a temporary patch, which works for us. He gave this information: After digging into the code, I think I've found the problem, but am too bad in java to provide a sustainable fix. I've attached a patch which obviously (with own manual tests) fixes that issue by simply commenting out the respective codeblock. As far as I dug into the code, the third parameter of NicProfile is handled by NetUtils.long2Mac(NetUtils.createSequenceBasedMacAddress(ipVO.getMacAddress(), NetworkModel.MACIdentifier.value()) inside NicProfileHelperImpl.java I assume createSequenceBasedMacAddress can handle null as MAC, but doesn't get called at all if _nicDao.findByNetworkIdAndMacAddress(networkId, macAddress) results != null if macAddress is null. [cloudstack-4.11.0-stephans-duplicate-nicaddress-fix.diff.txt](https://github.com/apache/cloudstack/files/1883346/cloudstack-4.11.0-stephans-duplicate-nicaddress-fix.diff.txt)
---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services