CLOUDSTACK-1332: Pass IPv6 DNS to VR

This commit is contained in:
Sheng Yang 2013-02-25 12:34:37 -08:00
parent 1b408509d6
commit 596e940264
6 changed files with 40 additions and 2 deletions

View File

@ -37,6 +37,10 @@ public interface DataCenter extends InfrastructureEntity, Grouping, Identity, In
String getDns2();
String getIp6Dns1();
String getIp6Dns2();
String getGuestNetworkCidr();
String getName();

View File

@ -50,6 +50,8 @@ public class NicProfile implements InternalIdentity {
Integer deviceId;
String dns1;
String dns2;
String ip6Dns1;
String ip6Dns2;
Integer networkRate;
boolean isSecurityGroupEnabled;
String name;
@ -332,4 +334,20 @@ public class NicProfile implements InternalIdentity {
this.requestedIpv6 = requestedIpv6;
}
public String getIp6Dns1() {
return ip6Dns1;
}
public void setIp6Dns1(String ip6Dns1) {
this.ip6Dns1 = ip6Dns1;
}
public String getIp6Dns2() {
return ip6Dns2;
}
public void setIp6Dns2(String ip6Dns2) {
this.ip6Dns2 = ip6Dns2;
}
}

View File

@ -440,6 +440,7 @@ public class DataCenterVO implements DataCenter {
this.macAddress = macAddress;
}
@Override
public String getIp6Dns1() {
return ip6Dns1;
}
@ -448,6 +449,7 @@ public class DataCenterVO implements DataCenter {
this.ip6Dns1 = ip6Dns1;
}
@Override
public String getIp6Dns2() {
return ip6Dns2;
}

View File

@ -3405,6 +3405,8 @@ public class NetworkManagerImpl extends ManagerBase implements NetworkManager, L
nic.setReservationId(String.valueOf(ip.getVlanTag()));
nic.setMacAddress(ip.getMacAddress());
}
nic.setDns1(dc.getDns1());
nic.setDns2(dc.getDns2());
}
if (network.getIp6Gateway() != null) {
@ -3426,10 +3428,10 @@ public class NetworkManagerImpl extends ManagerBase implements NetworkManager, L
nic.setMacAddress(ip.getMacAddress());
}
}
nic.setIp6Dns1(dc.getIp6Dns1());
nic.setIp6Dns2(dc.getIp6Dns2());
}
nic.setDns1(dc.getDns1());
nic.setDns2(dc.getDns2());
}
@Override

View File

@ -173,6 +173,8 @@ public class DirectNetworkGuru extends AdapterBase implements NetworkGuru {
if (profile != null) {
profile.setDns1(dc.getDns1());
profile.setDns2(dc.getDns2());
profile.setIp6Dns1(dc.getIp6Dns1());
profile.setIp6Dns2(dc.getIp6Dns2());
}
}

View File

@ -1922,6 +1922,8 @@ public class VirtualNetworkApplianceManagerImpl extends ManagerBase implements V
NicProfile controlNic = null;
String defaultDns1 = null;
String defaultDns2 = null;
String defaultIp6Dns1 = null;
String defaultIp6Dns2 = null;
for (NicProfile nic : profile.getNics()) {
int deviceId = nic.getDeviceId();
boolean ipv4 = false, ipv6 = false;
@ -1945,6 +1947,8 @@ public class VirtualNetworkApplianceManagerImpl extends ManagerBase implements V
}
defaultDns1 = nic.getDns1();
defaultDns2 = nic.getDns2();
defaultIp6Dns1 = nic.getIp6Dns1();
defaultIp6Dns2 = nic.getIp6Dns2();
}
if (nic.getTrafficType() == TrafficType.Management) {
@ -2040,6 +2044,12 @@ public class VirtualNetworkApplianceManagerImpl extends ManagerBase implements V
if (defaultDns2 != null) {
buf.append(" dns2=").append(defaultDns2);
}
if (defaultIp6Dns1 != null) {
buf.append(" ip6dns1=").append(defaultIp6Dns1);
}
if (defaultIp6Dns2 != null) {
buf.append(" ip6dns2=").append(defaultIp6Dns2);
}
boolean useExtDns = !dnsProvided;
/* For backward compatibility */