Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IPv6: fix deploy vm issue in ipv6-only networks without VR #5648

Merged
merged 2 commits into from
Nov 18, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,6 @@ public interface Ipv6AddressManager extends Manager {

public String acquireGuestIpv6Address(Network network, String requestedIpv6) throws InsufficientAddressCapacityException;

public void setNicIp6Address(final NicProfile nic, final DataCenter dc, final Network network);
public void setNicIp6Address(final NicProfile nic, final DataCenter dc, final Network network) throws InsufficientAddressCapacityException;

}
Original file line number Diff line number Diff line change
Expand Up @@ -195,13 +195,23 @@ protected boolean isIp6Taken(Network network, String requestedIpv6) {
* address information.
*/
@Override
public void setNicIp6Address(final NicProfile nic, final DataCenter dc, final Network network) {
public void setNicIp6Address(final NicProfile nic, final DataCenter dc, final Network network) throws InsufficientAddressCapacityException {
if (network.getIp6Gateway() != null) {
if (nic.getIPv6Address() == null) {
s_logger.debug("Found IPv6 CIDR " + network.getIp6Cidr() + " for Network " + network);
nic.setIPv6Cidr(network.getIp6Cidr());
nic.setIPv6Gateway(network.getIp6Gateway());

if (nic.getBroadcastType() == null) {
nic.setBroadcastType(network.getBroadcastDomainType());
}
if (nic.getBroadCastUri() == null) {
nic.setBroadcastUri(network.getBroadcastUri());
}
if (nic.getMacAddress() == null) {
nic.setMacAddress(_networkModel.getNextAvailableMacAddressInNetwork(network.getId()));
}

DaanHoogland marked this conversation as resolved.
Show resolved Hide resolved
IPv6Address ipv6addr = NetUtils.EUI64Address(network.getIp6Cidr(), nic.getMacAddress());
s_logger.info("Calculated IPv6 address " + ipv6addr + " using EUI-64 for NIC " + nic.getUuid());
nic.setIPv6Address(ipv6addr.toString());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ private void setAcquireGuestIpv6AddressTest(boolean isIPAvailable, State state)
}

@Test
public void setNICIPv6AddressTest() {
public void setNICIPv6AddressTest() throws InsufficientAddressCapacityException {
NicProfile nic = new NicProfile();
Network network = mock(Network.class);
DataCenter dc = mock(DataCenter.class);
Expand Down