mirror of
https://github.com/apache/cloudstack.git
synced 2025-11-02 11:52:28 +01:00
bug 10812: modifying dhcp option 119 on domR as per zone config
status 10812: resolved fixed.
This commit is contained in:
parent
3951699542
commit
826a3d6ad0
@ -33,6 +33,7 @@ public class ApiConstants {
|
|||||||
public static final String CERTIFICATE = "certificate";
|
public static final String CERTIFICATE = "certificate";
|
||||||
public static final String PRIVATE_KEY = "privatekey";
|
public static final String PRIVATE_KEY = "privatekey";
|
||||||
public static final String DOMAIN_SUFFIX = "domainsuffix";
|
public static final String DOMAIN_SUFFIX = "domainsuffix";
|
||||||
|
public static final String DOMAIN_SUFFIX_LIST = "domainsuffixlist";
|
||||||
public static final String CIDR = "cidr";
|
public static final String CIDR = "cidr";
|
||||||
public static final String CIDR_LIST = "cidrlist";
|
public static final String CIDR_LIST = "cidrlist";
|
||||||
public static final String CLEANUP = "cleanup";
|
public static final String CLEANUP = "cleanup";
|
||||||
|
|||||||
@ -18,6 +18,7 @@
|
|||||||
|
|
||||||
package com.cloud.api.commands;
|
package com.cloud.api.commands;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import org.apache.log4j.Logger;
|
import org.apache.log4j.Logger;
|
||||||
@ -76,7 +77,10 @@ public class UpdateZoneCmd extends BaseCmd {
|
|||||||
private Map details;
|
private Map details;
|
||||||
|
|
||||||
@Parameter(name=ApiConstants.DHCP_PROVIDER, type=CommandType.STRING, description="the dhcp Provider for the Zone")
|
@Parameter(name=ApiConstants.DHCP_PROVIDER, type=CommandType.STRING, description="the dhcp Provider for the Zone")
|
||||||
private String dhcpProvider;
|
private String dhcpProvider;
|
||||||
|
|
||||||
|
@Parameter(name=ApiConstants.DOMAIN_SUFFIX_LIST, type=CommandType.LIST, collectionType = CommandType.STRING, description="the list of domain suffixes for dns")
|
||||||
|
private List<String> domainSuffixList;
|
||||||
|
|
||||||
/////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////
|
||||||
/////////////////// Accessors ///////////////////////
|
/////////////////// Accessors ///////////////////////
|
||||||
@ -128,7 +132,11 @@ public class UpdateZoneCmd extends BaseCmd {
|
|||||||
|
|
||||||
public String getDhcpProvider() {
|
public String getDhcpProvider() {
|
||||||
return dhcpProvider;
|
return dhcpProvider;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public List<String> getDomainSuffixList() {
|
||||||
|
return domainSuffixList;
|
||||||
|
}
|
||||||
/////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////
|
||||||
/////////////// API Implementation///////////////////
|
/////////////// API Implementation///////////////////
|
||||||
/////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////
|
||||||
|
|||||||
@ -252,6 +252,9 @@ dhcp-hostsfile=/etc/dhcphosts.txt
|
|||||||
# Set the domain
|
# Set the domain
|
||||||
dhcp-option=15,"2.vmops-test.vmops.com"
|
dhcp-option=15,"2.vmops-test.vmops.com"
|
||||||
|
|
||||||
|
# Send RFC-3397 DNS domain search DHCP option.
|
||||||
|
#dhcp-option=119,"vmops.com"
|
||||||
|
|
||||||
# Send the etherboot magic flag and then etherboot options (a string).
|
# Send the etherboot magic flag and then etherboot options (a string).
|
||||||
#dhcp-option=128,e4:45:74:68:00:00
|
#dhcp-option=128,e4:45:74:68:00:00
|
||||||
#dhcp-option=129,NIC=eepro100
|
#dhcp-option=129,NIC=eepro100
|
||||||
|
|||||||
@ -255,6 +255,7 @@ setup_dnsmasq() {
|
|||||||
fi
|
fi
|
||||||
sed -i -e "s/^dhcp-range=.*$/dhcp-range=$DHCP_RANGE,static/" /etc/dnsmasq.conf
|
sed -i -e "s/^dhcp-range=.*$/dhcp-range=$DHCP_RANGE,static/" /etc/dnsmasq.conf
|
||||||
sed -i -e "s/^[#]*listen-address=.*$/listen-address=$ETH0_IP/" /etc/dnsmasq.conf
|
sed -i -e "s/^[#]*listen-address=.*$/listen-address=$ETH0_IP/" /etc/dnsmasq.conf
|
||||||
|
sed -i s/[#]*dhcp-option=119.*$/dhcp-option=119,\"$DOMAIN_SUFFIX\"/ /etc/dnsmasq.conf
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -490,6 +491,9 @@ for i in $CMDLINE
|
|||||||
domain)
|
domain)
|
||||||
DOMAIN=$VALUE
|
DOMAIN=$VALUE
|
||||||
;;
|
;;
|
||||||
|
domainsuffix)
|
||||||
|
DOMAIN_SUFFIX=$VALUE
|
||||||
|
;;
|
||||||
mgmtcidr)
|
mgmtcidr)
|
||||||
MGMTNET=$VALUE
|
MGMTNET=$VALUE
|
||||||
;;
|
;;
|
||||||
|
|||||||
@ -120,6 +120,7 @@ import com.cloud.user.UserContext;
|
|||||||
import com.cloud.user.dao.AccountDao;
|
import com.cloud.user.dao.AccountDao;
|
||||||
import com.cloud.user.dao.UserDao;
|
import com.cloud.user.dao.UserDao;
|
||||||
import com.cloud.utils.NumbersUtil;
|
import com.cloud.utils.NumbersUtil;
|
||||||
|
import com.cloud.utils.StringUtils;
|
||||||
import com.cloud.utils.component.Adapters;
|
import com.cloud.utils.component.Adapters;
|
||||||
import com.cloud.utils.component.ComponentLocator;
|
import com.cloud.utils.component.ComponentLocator;
|
||||||
import com.cloud.utils.component.Inject;
|
import com.cloud.utils.component.Inject;
|
||||||
@ -1087,6 +1088,7 @@ public class ConfigurationManagerImpl implements ConfigurationManager, Configura
|
|||||||
String internalDns2 = cmd.getInternalDns2();
|
String internalDns2 = cmd.getInternalDns2();
|
||||||
String vnetRange = cmd.getVlan();
|
String vnetRange = cmd.getVlan();
|
||||||
String guestCidr = cmd.getGuestCidrAddress();
|
String guestCidr = cmd.getGuestCidrAddress();
|
||||||
|
List<String> domainSuffixList = cmd.getDomainSuffixList();
|
||||||
Long userId = UserContext.current().getCallerUserId();
|
Long userId = UserContext.current().getCallerUserId();
|
||||||
int startVnetRange = 0;
|
int startVnetRange = 0;
|
||||||
int stopVnetRange = 0;
|
int stopVnetRange = 0;
|
||||||
@ -1112,7 +1114,12 @@ public class ConfigurationManagerImpl implements ConfigurationManager, Configura
|
|||||||
}*/
|
}*/
|
||||||
newDetails.put(key, value);
|
newDetails.put(key, value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// add the domain prefix list to details if not null
|
||||||
|
if (domainSuffixList != null){
|
||||||
|
newDetails.put("dns.suffixes", StringUtils.join(domainSuffixList, ","));
|
||||||
|
}
|
||||||
|
|
||||||
if (userId == null) {
|
if (userId == null) {
|
||||||
userId = Long.valueOf(User.UID_SYSTEM);
|
userId = Long.valueOf(User.UID_SYSTEM);
|
||||||
|
|||||||
@ -70,6 +70,7 @@ import com.cloud.dc.DataCenterVO;
|
|||||||
import com.cloud.dc.HostPodVO;
|
import com.cloud.dc.HostPodVO;
|
||||||
import com.cloud.dc.dao.AccountVlanMapDao;
|
import com.cloud.dc.dao.AccountVlanMapDao;
|
||||||
import com.cloud.dc.dao.DataCenterDao;
|
import com.cloud.dc.dao.DataCenterDao;
|
||||||
|
import com.cloud.dc.dao.DcDetailsDaoImpl;
|
||||||
import com.cloud.dc.dao.HostPodDao;
|
import com.cloud.dc.dao.HostPodDao;
|
||||||
import com.cloud.dc.dao.VlanDao;
|
import com.cloud.dc.dao.VlanDao;
|
||||||
import com.cloud.deploy.DataCenterDeployment;
|
import com.cloud.deploy.DataCenterDeployment;
|
||||||
@ -934,6 +935,8 @@ public class VirtualNetworkApplianceManagerImpl implements VirtualNetworkApplian
|
|||||||
String dhcpRange = null;
|
String dhcpRange = null;
|
||||||
|
|
||||||
DataCenter dc = dest.getDataCenter();
|
DataCenter dc = dest.getDataCenter();
|
||||||
|
DataCenterVO dcVO = _dcDao.findById(dc.getId());
|
||||||
|
_dcDao.loadDetails(dcVO);
|
||||||
|
|
||||||
if (dc.getNetworkType() == NetworkType.Advanced) {
|
if (dc.getNetworkType() == NetworkType.Advanced) {
|
||||||
String cidr = network.getCidr();
|
String cidr = network.getCidr();
|
||||||
@ -1012,6 +1015,10 @@ public class VirtualNetworkApplianceManagerImpl implements VirtualNetworkApplian
|
|||||||
String domain = network.getNetworkDomain();
|
String domain = network.getNetworkDomain();
|
||||||
if (domain != null) {
|
if (domain != null) {
|
||||||
buf.append(" domain=" + domain);
|
buf.append(" domain=" + domain);
|
||||||
|
}
|
||||||
|
String domain_suffix = dcVO.getDetail("dns.suffixes");
|
||||||
|
if (domain != null) {
|
||||||
|
buf.append(" domainsuffix=" + domain_suffix);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!network.isDefault() && network.getGuestType() == GuestIpType.Direct) {
|
if (!network.isDefault() && network.getGuestType() == GuestIpType.Direct) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user