bug 10748: use external dnses if set thru global config (dhcp otpion 6)

This commit is contained in:
Abhinandan Prateek 2011-08-03 12:34:02 +05:30
parent 8ccfdc08de
commit 7e727be42c
4 changed files with 40 additions and 1 deletions

View File

@ -268,6 +268,20 @@ setup_dnsmasq() {
then
sed -i s/[#]*dhcp-option=119.*$/dhcp-option=119,\"$DOMAIN_SUFFIX\"/ /etc/dnsmasq.conf
fi
if [ "$USE_EXTERNAL_DNS" == "true" ]
then
sed -i -e "/^[#]*dhcp-option=6.*$/d" /etc/dnsmasq.conf
if [ -n "$NS1" ]
then
if [ -n "$NS2" ]
then
echo "dhcp-option=6,$NS1,$NS2" >> /etc/dnsmasq.conf
else
echo "dhcp-option=6,$NS1" >> /etc/dnsmasq.conf
fi
fi
fi
}
setup_sshd(){
@ -505,6 +519,9 @@ for i in $CMDLINE
domainsuffix)
DOMAIN_SUFFIX=$VALUE
;;
useextdns)
USE_EXTERNAL_DNS=$VALUE
;;
mgmtcidr)
MGMTNET=$VALUE
;;

View File

@ -245,6 +245,7 @@ public enum Config {
AgentLbEnable("Advanced", ClusterManager.class, Boolean.class, "agent.lb.enabled", "true", "If agent load balancing enabled in cluster setup", null),
SubDomainNetworkAccess("Advanced", NetworkManager.class, Boolean.class, "allow.subdomain.network.access", "true", "Allow subdomains to use networks dedicated to their parent domain(s)", null),
UseExternalDnsServers("Advanced", NetworkManager.class, Boolean.class, "use.external.dns", "false", "Bypass internal dns, use exetrnal dns1 and dns2", null),
EncodeApiResponse("Advanced", ManagementServer.class, Boolean.class, "encode.api.response", "false", "Do UTF-8 encoding for the api response, false by default", null),
ClusterMessageTimeOutSeconds("Advanced", ManagementServer.class, Integer.class, "cluster.message.timeout.seconds", "300", "Time (in seconds) to wait before a inter-management server message post times out.", null);

View File

@ -1016,6 +1016,7 @@ public class VirtualNetworkApplianceManagerImpl implements VirtualNetworkApplian
if (domain_suffix != null) {
buf.append(" domainsuffix=").append(domain_suffix);
}
if (!network.isDefault() && network.getGuestType() == GuestIpType.Direct) {
buf.append(" defaultroute=false");
@ -1034,7 +1035,12 @@ public class VirtualNetworkApplianceManagerImpl implements VirtualNetworkApplian
if (defaultDns2 != null) {
buf.append(" dns2=").append(defaultDns2);
}
String use_external_dns = _configDao.getValue("use.external.dns");
if (use_external_dns!=null && use_external_dns.equals("true")){
buf.append(" useextdns=").append(use_external_dns);
}
if (s_logger.isDebugEnabled()) {
s_logger.debug("Boot Args for " + profile + ": " + buf.toString());
}

View File

@ -7,3 +7,18 @@ ALTER TABLE `cloud`.`domain` ADD COLUMN `network_domain` varchar(255);
ALTER TABLE `cloud`.`cluster` ADD CONSTRAINT `fk_cluster__data_center_id` FOREIGN KEY (`data_center_id`) REFERENCES `cloud`.`data_center`(`id`) ON DELETE CASCADE;
INSERT IGNORE INTO configuration VALUES ('Advanced', 'DEFAULT', 'NetworkManager', 'network.dns.basiczone.updates', 'all', 'This parameter can take 2 values: all (default) and pod. It defines if DHCP/DNS requests have to be send to all dhcp servers in cloudstack, or only to the one in the same pod');
ALTER TABLE `cloud`.`op_host_capacity` DROP FOREIGN KEY `fk_op_host_capacity__pod_id`;
ALTER TABLE `cloud`.`op_host_capacity` DROP FOREIGN KEY `fk_op_host_capacity__data_center_id`;
ALTER TABLE `cloud`.`op_host_capacity` DROP FOREIGN KEY `fk_op_host_capacity__cluster_id`;
ALTER TABLE `cloud`.`firewall_rules_cidrs` ADD UNIQUE INDEX `unique_rule_cidrs` (`firewall_rule_id`, `source_cidr`);
INSERT IGNORE INTO configuration VALUES ('Advanced', 'DEFAULT', 'management-server', 'agent.load.threshold', '0.70', 'Percentage (as a value between 0 and 1) of connected agents after which agent load balancing will start happening');
INSERT IGNORE INTO configuration VALUES ('Network', 'DEFAULT', 'management-server', 'network.loadbalancer.haproxy.stats.visibility', 'global', 'Load Balancer(haproxy) stats visibilty, it can be global,guest-network,disabled');
INSERT IGNORE INTO configuration VALUES ('Network', 'DEFAULT', 'management-server', 'network.loadbalancer.haproxy.stats.uri','/admin?stats','Load Balancer(haproxy) uri.');
INSERT IGNORE INTO configuration VALUES ('Network', 'DEFAULT', 'management-server', 'network.loadbalancer.haproxy.stats.auth','admin1:AdMiN123','Load Balancer(haproxy) authetication string in the format username:password');
INSERT IGNORE INTO configuration VALUES ('Network', 'DEFAULT', 'management-server', 'network.loadbalancer.haproxy.stats.port','8081','Load Balancer(haproxy) stats port number.');
INSERT IGNORE INTO configuration VALUES ('Advanced', 'DEFAULT', 'NetworkManager', 'use.external.dns', 'false', 'Bypass internal dns, use exetrnal dns1 and dns2');