mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
bug 10023: only set ip route for internal DNS
status 10023: resolved fixed
This commit is contained in:
parent
f026cd5540
commit
37e6ded80c
@ -243,17 +243,17 @@ public class ConsoleProxyResource extends ServerResourceBase implements ServerRe
|
|||||||
_proxyVmId = NumbersUtil.parseLong(value, 0);
|
_proxyVmId = NumbersUtil.parseLong(value, 0);
|
||||||
|
|
||||||
if (_localgw != null) {
|
if (_localgw != null) {
|
||||||
String internalDns1 = (String)params.get("dns1");
|
String mgmtHost = (String) params.get("host");
|
||||||
String internalDns2 = (String)params.get("dns2");
|
addRouteToInternalIpOrCidr(_localgw, _eth1ip, _eth1mask, mgmtHost);
|
||||||
|
|
||||||
|
String internalDns1 = (String) params.get("internaldns1");
|
||||||
if (internalDns1 == null) {
|
if (internalDns1 == null) {
|
||||||
s_logger.warn("No DNS entry found during configuration of NfsSecondaryStorage");
|
s_logger.warn("No DNS entry found during configuration of NfsSecondaryStorage");
|
||||||
} else {
|
} else {
|
||||||
addRouteToInternalIpOrCidr(_localgw, _eth1ip, _eth1mask, internalDns1);
|
addRouteToInternalIpOrCidr(_localgw, _eth1ip, _eth1mask, internalDns1);
|
||||||
}
|
}
|
||||||
|
|
||||||
String mgmtHost = (String)params.get("host");
|
String internalDns2 = (String) params.get("internaldns2");
|
||||||
addRouteToInternalIpOrCidr(_localgw, _eth1ip, _eth1mask, mgmtHost);
|
|
||||||
if (internalDns2 != null) {
|
if (internalDns2 != null) {
|
||||||
addRouteToInternalIpOrCidr(_localgw, _eth1ip, _eth1mask, internalDns2);
|
addRouteToInternalIpOrCidr(_localgw, _eth1ip, _eth1mask, internalDns2);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -433,6 +433,7 @@ public class NfsSecondaryStorageResource extends ServerResourceBase implements S
|
|||||||
@Override
|
@Override
|
||||||
public boolean configure(String name, Map<String, Object> params) throws ConfigurationException {
|
public boolean configure(String name, Map<String, Object> params) throws ConfigurationException {
|
||||||
_eth1ip = (String)params.get("eth1ip");
|
_eth1ip = (String)params.get("eth1ip");
|
||||||
|
_eth1mask = (String)params.get("eth1mask");
|
||||||
if (_eth1ip != null) { //can only happen inside service vm
|
if (_eth1ip != null) { //can only happen inside service vm
|
||||||
params.put("private.network.device", "eth1");
|
params.put("private.network.device", "eth1");
|
||||||
} else {
|
} else {
|
||||||
@ -505,20 +506,18 @@ public class NfsSecondaryStorageResource extends ServerResourceBase implements S
|
|||||||
if (inSystemVM == null || "true".equalsIgnoreCase(inSystemVM)) {
|
if (inSystemVM == null || "true".equalsIgnoreCase(inSystemVM)) {
|
||||||
_inSystemVM = true;
|
_inSystemVM = true;
|
||||||
_localgw = (String)params.get("localgw");
|
_localgw = (String)params.get("localgw");
|
||||||
if (_localgw != null) { //can only happen inside service vm
|
if (_localgw != null) { // can only happen inside service vm
|
||||||
_eth1mask = (String)params.get("eth1mask");
|
String mgmtHost = (String) params.get("host");
|
||||||
String internalDns1 = (String)params.get("dns1");
|
addRouteToInternalIpOrCidr(_localgw, _eth1ip, _eth1mask, mgmtHost);
|
||||||
String internalDns2 = (String)params.get("dns2");
|
|
||||||
|
|
||||||
|
String internalDns1 = (String) params.get("internaldns1");
|
||||||
if (internalDns1 == null) {
|
if (internalDns1 == null) {
|
||||||
s_logger.warn("No DNS entry found during configuration of NfsSecondaryStorage");
|
s_logger.warn("No DNS entry found during configuration of NfsSecondaryStorage");
|
||||||
} else {
|
} else {
|
||||||
addRouteToInternalIpOrCidr(_localgw, _eth1ip, _eth1mask, internalDns1);
|
addRouteToInternalIpOrCidr(_localgw, _eth1ip, _eth1mask, internalDns1);
|
||||||
}
|
}
|
||||||
|
|
||||||
String mgmtHost = (String)params.get("host");
|
String internalDns2 = (String) params.get("internaldns2");
|
||||||
|
|
||||||
addRouteToInternalIpOrCidr(_localgw, _eth1ip, _eth1mask, mgmtHost);
|
|
||||||
if (internalDns2 != null) {
|
if (internalDns2 != null) {
|
||||||
addRouteToInternalIpOrCidr(_localgw, _eth1ip, _eth1mask, internalDns2);
|
addRouteToInternalIpOrCidr(_localgw, _eth1ip, _eth1mask, internalDns2);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -203,10 +203,21 @@ setup_common() {
|
|||||||
hostname $NAME
|
hostname $NAME
|
||||||
|
|
||||||
#Nameserver
|
#Nameserver
|
||||||
|
if [ -n "$internalNS1" ]
|
||||||
|
then
|
||||||
|
echo "nameserver $internalNS1" > /etc/dnsmasq-resolv.conf
|
||||||
|
echo "nameserver $internalNS1" > /etc/resolv.conf
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -n "$internalNS2" ]
|
||||||
|
then
|
||||||
|
echo "nameserver $internalNS2" >> /etc/dnsmasq-resolv.conf
|
||||||
|
echo "nameserver $internalNS2" >> /etc/resolv.conf
|
||||||
|
fi
|
||||||
if [ -n "$NS1" ]
|
if [ -n "$NS1" ]
|
||||||
then
|
then
|
||||||
echo "nameserver $NS1" > /etc/dnsmasq-resolv.conf
|
echo "nameserver $NS1" >> /etc/dnsmasq-resolv.conf
|
||||||
echo "nameserver $NS1" > /etc/resolv.conf
|
echo "nameserver $NS1" >> /etc/resolv.conf
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -n "$NS2" ]
|
if [ -n "$NS2" ]
|
||||||
@ -453,6 +464,12 @@ for i in $CMDLINE
|
|||||||
eth2mask)
|
eth2mask)
|
||||||
ETH2_MASK=$VALUE
|
ETH2_MASK=$VALUE
|
||||||
;;
|
;;
|
||||||
|
internaldns1)
|
||||||
|
internalNS1=$VALUE
|
||||||
|
;;
|
||||||
|
internaldns2)
|
||||||
|
internalNS2=$VALUE
|
||||||
|
;;
|
||||||
dns1)
|
dns1)
|
||||||
NS1=$VALUE
|
NS1=$VALUE
|
||||||
;;
|
;;
|
||||||
|
|||||||
@ -1310,10 +1310,6 @@ public class ConsoleProxyManagerImpl implements ConsoleProxyManager, ConsoleProx
|
|||||||
|
|
||||||
if (nic.isDefaultNic()) {
|
if (nic.isDefaultNic()) {
|
||||||
buf.append(" gateway=").append(nic.getGateway());
|
buf.append(" gateway=").append(nic.getGateway());
|
||||||
buf.append(" dns1=").append(nic.getDns1());
|
|
||||||
if (nic.getDns2() != null) {
|
|
||||||
buf.append(" dns2=").append(nic.getDns2());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (nic.getTrafficType() == TrafficType.Management) {
|
if (nic.getTrafficType() == TrafficType.Management) {
|
||||||
@ -1329,6 +1325,15 @@ public class ConsoleProxyManagerImpl implements ConsoleProxyManager, ConsoleProx
|
|||||||
if (externalDhcp) {
|
if (externalDhcp) {
|
||||||
buf.append(" bootproto=dhcp");
|
buf.append(" bootproto=dhcp");
|
||||||
}
|
}
|
||||||
|
DataCenterVO dc = _dcDao.findById(profile.getVirtualMachine().getDataCenterId());
|
||||||
|
buf.append(" internaldns1=").append(dc.getInternalDns1());
|
||||||
|
if (dc.getInternalDns2() != null) {
|
||||||
|
buf.append(" internaldns2=").append(dc.getInternalDns2());
|
||||||
|
}
|
||||||
|
buf.append(" dns1=").append(dc.getDns1());
|
||||||
|
if (dc.getDns2() != null) {
|
||||||
|
buf.append(" dns2=").append(dc.getDns2());
|
||||||
|
}
|
||||||
|
|
||||||
String bootArgs = buf.toString();
|
String bootArgs = buf.toString();
|
||||||
if (s_logger.isDebugEnabled()) {
|
if (s_logger.isDebugEnabled()) {
|
||||||
|
|||||||
@ -959,7 +959,6 @@ public class SecondaryStorageManagerImpl implements SecondaryStorageVmManager, V
|
|||||||
if (NetUtils.isValidCIDR(mgmt_cidr)) {
|
if (NetUtils.isValidCIDR(mgmt_cidr)) {
|
||||||
buf.append(" mgmtcidr=").append(mgmt_cidr);
|
buf.append(" mgmtcidr=").append(mgmt_cidr);
|
||||||
}
|
}
|
||||||
|
|
||||||
buf.append(" localgw=").append(dest.getPod().getGateway());
|
buf.append(" localgw=").append(dest.getPod().getGateway());
|
||||||
buf.append(" private.network.device=").append("eth").append(deviceId);
|
buf.append(" private.network.device=").append("eth").append(deviceId);
|
||||||
} else if (nic.getTrafficType() == TrafficType.Public) {
|
} else if (nic.getTrafficType() == TrafficType.Public) {
|
||||||
@ -973,9 +972,13 @@ public class SecondaryStorageManagerImpl implements SecondaryStorageVmManager, V
|
|||||||
}
|
}
|
||||||
|
|
||||||
DataCenterVO dc = _dcDao.findById(profile.getVirtualMachine().getDataCenterId());
|
DataCenterVO dc = _dcDao.findById(profile.getVirtualMachine().getDataCenterId());
|
||||||
buf.append(" dns1=").append(dc.getInternalDns1());
|
buf.append(" internaldns1=").append(dc.getInternalDns1());
|
||||||
if (dc.getInternalDns2() != null) {
|
if (dc.getInternalDns2() != null) {
|
||||||
buf.append(" dns2=").append(dc.getInternalDns2());
|
buf.append(" internaldns2=").append(dc.getInternalDns2());
|
||||||
|
}
|
||||||
|
buf.append(" dns1=").append(dc.getDns1());
|
||||||
|
if (dc.getDns2() != null) {
|
||||||
|
buf.append(" dns2=").append(dc.getDns2());
|
||||||
}
|
}
|
||||||
|
|
||||||
String bootArgs = buf.toString();
|
String bootArgs = buf.toString();
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user