mirror of https://github.com/apache/cloudstack.git
merge domr patch kvm and patch xenserver
This commit is contained in:
parent
da522be70c
commit
3eb8ae42ee
|
|
@ -107,9 +107,6 @@
|
|||
<property name="meld.home" location="/usr/local/bin" />
|
||||
<property name="assertion" value="-da" />
|
||||
|
||||
<!-- directories for patches -->
|
||||
<property name="kvm.patch.dist.dir" location="${dist.dir}/patches/kvm" />
|
||||
<property name="xenserver.patch.dist.dir" location="${dist.dir}/patches/xenserver" />
|
||||
|
||||
<!-- directories for testing -->
|
||||
<property name="test.target.dir" location="${target.dir}/test" />
|
||||
|
|
@ -518,40 +515,18 @@
|
|||
</target>
|
||||
|
||||
|
||||
<target name="build-kvm-domr-patch" depends="-init">
|
||||
<mkdir dir="${kvm.patch.dist.dir}" />
|
||||
<tar destfile="${kvm.patch.dist.dir}/patch.tar">
|
||||
<tarfileset dir="${base.dir}/patches/kvm" filemode="755">
|
||||
<include name="**/*"/>
|
||||
<exclude name="**/.classpath" />
|
||||
<exclude name="**/.project" />
|
||||
</tarfileset>
|
||||
<tarfileset dir="${base.dir}/patches/shared" filemode="755">
|
||||
<target name="build-systemvm-patch" depends="-init">
|
||||
<mkdir dir="${dist.dir}" />
|
||||
<tar destfile="${dist.dir}/patch.tar">
|
||||
<tarfileset dir="${base.dir}/patches/systemvm" filemode="755">
|
||||
<include name="**/*"/>
|
||||
<exclude name="**/.classpath" />
|
||||
<exclude name="**/.project" />
|
||||
<exclude name="**/wscript_build" />
|
||||
</tarfileset>
|
||||
</tar>
|
||||
<gzip destfile="${kvm.patch.dist.dir}/patch.tgz" src="${kvm.patch.dist.dir}/patch.tar"/>
|
||||
<delete file="${kvm.patch.dist.dir}/patch.tar"/>
|
||||
</target>
|
||||
|
||||
<target name="build-xenserver-domr-patch" depends="-init">
|
||||
<mkdir dir="${xenserver.patch.dist.dir}" />
|
||||
<tar destfile="${xenserver.patch.dist.dir}/patch.tar">
|
||||
<tarfileset dir="${base.dir}/patches/xenserver" filemode="755">
|
||||
<include name="**/*"/>
|
||||
<exclude name="**/.classpath" />
|
||||
<exclude name="**/.project" />
|
||||
</tarfileset>
|
||||
<tarfileset dir="${base.dir}/patches/shared" filemode="755">
|
||||
<include name="**/*"/>
|
||||
<exclude name="**/.classpath" />
|
||||
<exclude name="**/.project" />
|
||||
</tarfileset>
|
||||
</tar>
|
||||
<gzip destfile="${xenserver.patch.dist.dir}/patch.tgz" src="${xenserver.patch.dist.dir}/patch.tar"/>
|
||||
<delete file="${xenserver.patch.dist.dir}/patch.tar"/>
|
||||
<gzip destfile="${dist.dir}/patch.tgz" src="${dist.dir}/patch.tar"/>
|
||||
<delete file="${dist.dir}/patch.tar"/>
|
||||
</target>
|
||||
|
||||
<target name="help">
|
||||
|
|
|
|||
|
|
@ -23,7 +23,6 @@
|
|||
<property name="docs.dist.dir" location="${dist.dir}/docs" />
|
||||
<property name="db.dist.dir" location="${dist.dir}/db" />
|
||||
<property name="usage.dist.dir" location="${dist.dir}/usage" />
|
||||
<property name="kvm.domr.patch.dir" location="${scripts.dir}/vm/hypervisor/kvm/patch" />
|
||||
|
||||
<target name="-init-package">
|
||||
<mkdir dir="${dist.dir}" />
|
||||
|
|
@ -92,9 +91,9 @@
|
|||
</target>
|
||||
|
||||
|
||||
<target name="package-agent" depends="-init-package, package-oss-systemvm, build-kvm-domr-patch, package-agent-common">
|
||||
<target name="package-agent" depends="-init-package, package-oss-systemvm, build-systemvm-patch, package-agent-common">
|
||||
<zip destfile="${dist.dir}/agent.zip" duplicate="preserve" update="true">
|
||||
<zipfileset dir="${kvm.patch.dist.dir}" prefix="scripts/vm/hypervisor/kvm">
|
||||
<zipfileset dir="${dist.dir}" prefix="vms">
|
||||
<include name="patch.tgz" />
|
||||
</zipfileset>
|
||||
<zipfileset dir="${dist.dir}" prefix="vms" filemode="555">
|
||||
|
|
@ -103,15 +102,14 @@
|
|||
</zip>
|
||||
</target>
|
||||
|
||||
<target name="package-oss-systemvm-iso" depends="-init-package, package-oss-systemvm, build-xenserver-domr-patch">
|
||||
<target name="package-oss-systemvm-iso" depends="-init-package, package-oss-systemvm, build-systemvm-patch">
|
||||
<exec executable="mkisofs" dir="${dist.dir}">
|
||||
<arg value="-quiet"/>
|
||||
<arg value="-r"/>
|
||||
<arg value="-o"/>
|
||||
<arg value="systemvm.iso"/>
|
||||
<arg value="systemvm.zip"/>
|
||||
<arg value="patches/xenserver/patch.tgz"/>
|
||||
<arg value="patches/xenserver/authorized_keys"/>
|
||||
<arg value="patch.tgz"/>
|
||||
</exec>
|
||||
</target>
|
||||
|
||||
|
|
@ -136,7 +134,7 @@
|
|||
</zip>
|
||||
</target>
|
||||
|
||||
<target name="build-all" depends="build-opensource, build-kvm-domr-patch, build-ui, build-war-oss, package-oss-systemvm-iso">
|
||||
<target name="build-all" depends="build-opensource, build-ui, build-war-oss, package-oss-systemvm-iso">
|
||||
</target>
|
||||
|
||||
<target name="build-war-oss" depends="-init-package" description="Compile the GWT client UI and builds WAR file.">
|
||||
|
|
|
|||
|
|
@ -1,223 +0,0 @@
|
|||
|
||||
|
||||
|
||||
#! /bin/bash
|
||||
# chkconfig: 35 09 90
|
||||
# description: pre-boot configuration using boot line parameters
|
||||
# This file exists in /etc/init.d/
|
||||
|
||||
replace_in_file() {
|
||||
local filename=$1
|
||||
local keyname=$2
|
||||
local value=$3
|
||||
sed -i /$keyname=/d $filename
|
||||
echo "$keyname=$value" >> $filename
|
||||
return $?
|
||||
}
|
||||
|
||||
setup_interface() {
|
||||
local intfnum=$1
|
||||
local ip=$2
|
||||
local mask=$3
|
||||
|
||||
cfg=/etc/sysconfig/network-scripts/ifcfg-eth${intfnum}
|
||||
replace_in_file ${cfg} IPADDR ${ip}
|
||||
replace_in_file ${cfg} NETMASK ${mask}
|
||||
replace_in_file ${cfg} BOOTPROTO STATIC
|
||||
if [ "$ip" == "0.0.0.0" ]
|
||||
then
|
||||
replace_in_file ${cfg} ONBOOT No
|
||||
else
|
||||
replace_in_file ${cfg} ONBOOT Yes
|
||||
fi
|
||||
}
|
||||
|
||||
setup_common() {
|
||||
setup_interface "0" $ETH0_IP $ETH0_MASK
|
||||
setup_interface "1" $ETH1_IP $ETH1_MASK
|
||||
setup_interface "2" $ETH2_IP $ETH2_MASK
|
||||
|
||||
replace_in_file /etc/sysconfig/network GATEWAY $GW
|
||||
replace_in_file /etc/sysconfig/network HOSTNAME $NAME
|
||||
echo "NOZEROCONF=yes" >> /etc/sysconfig/network
|
||||
hostname $NAME
|
||||
|
||||
#Nameserver
|
||||
if [ -n "$NS1" ]
|
||||
then
|
||||
echo "nameserver $NS1" > /etc/dnsmasq-resolv.conf
|
||||
echo "nameserver $NS1" > /etc/resolv.conf
|
||||
fi
|
||||
|
||||
if [ -n "$NS2" ]
|
||||
then
|
||||
echo "nameserver $NS2" >> /etc/dnsmasq-resolv.conf
|
||||
echo "nameserver $NS2" >> /etc/resolv.conf
|
||||
fi
|
||||
if [[ -n "$MGMTNET" && -n "$LOCAL_GW" ]]
|
||||
then
|
||||
echo "$MGMTNET via $LOCAL_GW dev eth1" > /etc/sysconfig/network-scripts/route-eth1
|
||||
fi
|
||||
}
|
||||
|
||||
setup_router() {
|
||||
setup_common
|
||||
[ -z $DHCP_RANGE ] && DHCP_RANGE=$ETH0_IP
|
||||
if [ -n "$DOMAIN" ]
|
||||
then
|
||||
#send domain name to dhcp clients
|
||||
sed -i s/[#]*dhcp-option=15.*$/dhcp-option=15,\"$DOMAIN\"/ /etc/dnsmasq.conf
|
||||
#DNS server will append $DOMAIN to local queries
|
||||
sed -r -i s/^[#]?domain=.*$/domain=$DOMAIN/ /etc/dnsmasq.conf
|
||||
#answer all local domain queries
|
||||
sed -i -e "s/^[#]*local=.*$/local=\/$DOMAIN\//" /etc/dnsmasq.conf
|
||||
fi
|
||||
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 /gateway/d /etc/hosts
|
||||
echo "$ETH0_IP $NAME" >> /etc/hosts
|
||||
[ -f /etc/httpd/conf/httpd.conf ] && sed -i -e "s/^Listen.*$/Listen $ETH0_IP:80/" /etc/httpd/conf/httpd.conf
|
||||
[ -f /etc/httpd/conf.d/ssl.conf ] && mv /etc/httpd/conf.d/ssl.conf /etc/httpd/conf.d/ssl.conf.bak
|
||||
[ -f /etc/ssh/sshd_config ] && sed -i -e "s/^[#]*ListenAddress.*$/ListenAddress $ETH1_IP/" /etc/ssh/sshd_config
|
||||
}
|
||||
|
||||
setup_dhcpsrvr() {
|
||||
setup_common
|
||||
[ -z $DHCP_RANGE ] && DHCP_RANGE=$ETH0_IP
|
||||
if [ -n "$DOMAIN" ]
|
||||
then
|
||||
#send domain name to dhcp clients
|
||||
sed -i s/[#]*dhcp-option=15.*$/dhcp-option=15,\"$DOMAIN\"/ /etc/dnsmasq.conf
|
||||
#DNS server will append $DOMAIN to local queries
|
||||
sed -r -i s/^[#]?domain=.*$/domain=$DOMAIN/ /etc/dnsmasq.conf
|
||||
#answer all local domain queries
|
||||
sed -i -e "s/^[#]*local=.*$/local=\/$DOMAIN\//" /etc/dnsmasq.conf
|
||||
else
|
||||
#delete domain option
|
||||
sed -i /^dhcp-option=15.*$/d /etc/dnsmasq.conf
|
||||
sed -i /^domain=.*$/d /etc/dnsmasq.conf
|
||||
sed -i -e "/^local=.*$/d" /etc/dnsmasq.conf
|
||||
fi
|
||||
sed -i -e "s/^dhcp-range=.*$/dhcp-range=$DHCP_RANGE,static/" /etc/dnsmasq.conf
|
||||
sed -i -e "s/^[#]*dhcp-option=option:router.*$/dhcp-option=option:router,$GW/" /etc/dnsmasq.conf
|
||||
echo "dhcp-option=6,$NS1,$NS2" >> /etc/dnsmasq.conf
|
||||
sed -i /gateway/d /etc/hosts
|
||||
echo "$ETH0_IP $NAME" >> /etc/hosts
|
||||
[ -f /etc/httpd/conf/httpd.conf ] && sed -i -e "s/^Listen.*$/Listen $ETH0_IP:80/" /etc/httpd/conf/httpd.conf
|
||||
[ -f /etc/httpd/conf.d/ssl.conf ] && mv /etc/httpd/conf.d/ssl.conf /etc/httpd/conf.d/ssl.conf.bak
|
||||
}
|
||||
|
||||
setup_secstorage() {
|
||||
setup_common
|
||||
sed -i /gateway/d /etc/hosts
|
||||
public_ip=$ETH2_IP
|
||||
[ "$ETH2_IP" == "0.0.0.0" ] && public_ip=$ETH1_IP
|
||||
echo "$public_ip $NAME" >> /etc/hosts
|
||||
[ -f /etc/httpd/conf/httpd.conf ] && sed -i -e "s/^Listen.*:80$/Listen $public_ip:80/" /etc/httpd/conf/httpd.conf
|
||||
[ -f /etc/httpd/conf/httpd.conf ] && sed -i -e "s/^Listen.*:443$/Listen $public_ip:443/" /etc/httpd/conf/httpd.conf
|
||||
}
|
||||
|
||||
setup_console_proxy() {
|
||||
setup_common
|
||||
public_ip=$ETH2_IP
|
||||
[ "$ETH2_IP" == "0.0.0.0" ] && public_ip=$ETH1_IP
|
||||
sed -i /gateway/d /etc/hosts
|
||||
echo "$public_ip $NAME" >> /etc/hosts
|
||||
}
|
||||
|
||||
if [ -f /mnt/cmdline ]
|
||||
then
|
||||
CMDLINE=$(cat /mnt/cmdline)
|
||||
else
|
||||
CMDLINE=$(cat /proc/cmdline)
|
||||
fi
|
||||
|
||||
TYPE="router"
|
||||
|
||||
for i in $CMDLINE
|
||||
do
|
||||
# search for foo=bar pattern and cut out foo
|
||||
KEY=$(echo $i | cut -d= -f1)
|
||||
VALUE=$(echo $i | cut -d= -f2)
|
||||
case $KEY in
|
||||
eth0ip)
|
||||
ETH0_IP=$VALUE
|
||||
;;
|
||||
eth1ip)
|
||||
ETH1_IP=$VALUE
|
||||
;;
|
||||
eth2ip)
|
||||
ETH2_IP=$VALUE
|
||||
;;
|
||||
gateway)
|
||||
GW=$VALUE
|
||||
;;
|
||||
eth0mask)
|
||||
ETH0_MASK=$VALUE
|
||||
;;
|
||||
eth1mask)
|
||||
ETH1_MASK=$VALUE
|
||||
;;
|
||||
eth2mask)
|
||||
ETH2_MASK=$VALUE
|
||||
;;
|
||||
dns1)
|
||||
NS1=$VALUE
|
||||
;;
|
||||
dns2)
|
||||
NS2=$VALUE
|
||||
;;
|
||||
domain)
|
||||
DOMAIN=$VALUE
|
||||
;;
|
||||
mgmtcidr)
|
||||
MGMTNET=$VALUE
|
||||
;;
|
||||
localgw)
|
||||
LOCAL_GW=$VALUE
|
||||
;;
|
||||
template)
|
||||
TEMPLATE=$VALUE
|
||||
;;
|
||||
name)
|
||||
NAME=$VALUE
|
||||
;;
|
||||
dhcprange)
|
||||
DHCP_RANGE=$(echo $VALUE | tr ':' ',')
|
||||
;;
|
||||
type)
|
||||
TYPE=$VALUE
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
case $TYPE in
|
||||
router)
|
||||
[ "$NAME" == "" ] && NAME=router
|
||||
setup_router
|
||||
;;
|
||||
dhcpsrvr)
|
||||
[ "$NAME" == "" ] && NAME=dhcpsrvr
|
||||
setup_dhcpsrvr
|
||||
;;
|
||||
secstorage)
|
||||
[ "$NAME" == "" ] && NAME=secstorage
|
||||
setup_secstorage;
|
||||
;;
|
||||
consoleproxy)
|
||||
[ "$NAME" == "" ] && NAME=consoleproxy
|
||||
setup_console_proxy;
|
||||
;;
|
||||
esac
|
||||
|
||||
if [ ! -d /root/.ssh ]
|
||||
then
|
||||
mkdir /root/.ssh
|
||||
chmod 700 /root/.ssh
|
||||
fi
|
||||
if [ -f /mnt/id_rsa.pub ]
|
||||
then
|
||||
cat /mnt/id_rsa.pub > /root/.ssh/authorized_keys
|
||||
chmod 600 /root/.ssh/authorized_keys
|
||||
fi
|
||||
|
||||
|
|
@ -1,33 +0,0 @@
|
|||
# Generated by iptables-save v1.3.8 on Thu Oct 1 18:16:05 2009
|
||||
# @VERSION@
|
||||
*nat
|
||||
:PREROUTING ACCEPT [499:70846]
|
||||
:POSTROUTING ACCEPT [1:85]
|
||||
:OUTPUT ACCEPT [1:85]
|
||||
COMMIT
|
||||
# Completed on Thu Oct 1 18:16:06 2009
|
||||
# Generated by iptables-save v1.3.8 on Thu Oct 1 18:16:06 2009
|
||||
*filter
|
||||
#:INPUT DROP [288:42467]
|
||||
:FORWARD DROP [0:0]
|
||||
:OUTPUT ACCEPT [65:9665]
|
||||
-A INPUT -i eth1 -m state --state RELATED,ESTABLISHED -j ACCEPT
|
||||
-A INPUT -i eth2 -m state --state RELATED,ESTABLISHED -j ACCEPT
|
||||
-A INPUT -p icmp -j ACCEPT
|
||||
-A INPUT -i eth0 -p udp -m udp --dport 67 -j ACCEPT
|
||||
-A INPUT -i eth0 -p udp -m udp --dport 53 -j ACCEPT
|
||||
-A INPUT -i eth0 -m state --state RELATED,ESTABLISHED -j ACCEPT
|
||||
-A INPUT -i eth1 -p tcp -m tcp --dport 3922 --tcp-flags FIN,SYN,RST,ACK SYN -j ACCEPT
|
||||
-A INPUT -i eth0 -p tcp -m tcp --dport 8080 --tcp-flags FIN,SYN,RST,ACK SYN -j ACCEPT
|
||||
-A INPUT -p tcp -m tcp --dport 8001 --tcp-flags FIN,SYN,RST,ACK SYN -j ACCEPT
|
||||
-A INPUT -p tcp -m tcp --dport 443 --tcp-flags FIN,SYN,RST,ACK SYN -j ACCEPT
|
||||
-A INPUT -p tcp -m tcp --dport 80 --tcp-flags FIN,SYN,RST,ACK SYN -j ACCEPT
|
||||
-A INPUT -i eth1 -p tcp -m state --state NEW -m tcp --dport 8001 -j ACCEPT
|
||||
-A INPUT -i eth2 -p tcp -m state --state NEW -m tcp --dport 443 -j ACCEPT
|
||||
-A INPUT -i eth2 -p tcp -m state --state NEW -m tcp --dport 80 -j ACCEPT
|
||||
-A FORWARD -i eth0 -o eth1 -j ACCEPT
|
||||
-A FORWARD -i eth0 -o eth2 -j ACCEPT
|
||||
-A FORWARD -i eth1 -o eth0 -m state --state RELATED,ESTABLISHED -j ACCEPT
|
||||
-A FORWARD -i eth2 -o eth0 -m state --state RELATED,ESTABLISHED -j ACCEPT
|
||||
COMMIT
|
||||
# Completed on Thu Oct 1 18:16:06 2009
|
||||
|
|
@ -1,48 +0,0 @@
|
|||
# Load additional iptables modules (nat helpers)
|
||||
# Default: -none-
|
||||
# Space separated list of nat helpers (e.g. 'ip_nat_ftp ip_nat_irc'), which
|
||||
# are loaded after the firewall rules are applied. Options for the helpers are
|
||||
# stored in /etc/modprobe.conf.
|
||||
IPTABLES_MODULES="ip_conntrack_ftp nf_nat_ftp"
|
||||
|
||||
# Unload modules on restart and stop
|
||||
# Value: yes|no, default: yes
|
||||
# This option has to be 'yes' to get to a sane state for a firewall
|
||||
# restart or stop. Only set to 'no' if there are problems unloading netfilter
|
||||
# modules.
|
||||
IPTABLES_MODULES_UNLOAD="yes"
|
||||
|
||||
# Save current firewall rules on stop.
|
||||
# Value: yes|no, default: no
|
||||
# Saves all firewall rules to /etc/sysconfig/iptables if firewall gets stopped
|
||||
# (e.g. on system shutdown).
|
||||
IPTABLES_SAVE_ON_STOP="no"
|
||||
|
||||
# Save current firewall rules on restart.
|
||||
# Value: yes|no, default: no
|
||||
# Saves all firewall rules to /etc/sysconfig/iptables if firewall gets
|
||||
# restarted.
|
||||
IPTABLES_SAVE_ON_RESTART="no"
|
||||
|
||||
# Save (and restore) rule and chain counter.
|
||||
# Value: yes|no, default: no
|
||||
# Save counters for rules and chains to /etc/sysconfig/iptables if
|
||||
# 'service iptables save' is called or on stop or restart if SAVE_ON_STOP or
|
||||
# SAVE_ON_RESTART is enabled.
|
||||
IPTABLES_SAVE_COUNTER="no"
|
||||
|
||||
# Numeric status output
|
||||
# Value: yes|no, default: yes
|
||||
# Print IP addresses and port numbers in numeric format in the status output.
|
||||
IPTABLES_STATUS_NUMERIC="yes"
|
||||
|
||||
# Verbose status output
|
||||
# Value: yes|no, default: yes
|
||||
# Print info about the number of packets and bytes plus the "input-" and
|
||||
# "outputdevice" in the status output.
|
||||
IPTABLES_STATUS_VERBOSE="no"
|
||||
|
||||
# Status output with numbered lines
|
||||
# Value: yes|no, default: yes
|
||||
# Print a counter/number for every rule in the status output.
|
||||
IPTABLES_STATUS_LINENUMBERS="yes"
|
||||
|
|
@ -1,18 +0,0 @@
|
|||
# @VERSION@
|
||||
*nat
|
||||
:PREROUTING ACCEPT [499:70846]
|
||||
:POSTROUTING ACCEPT [1:85]
|
||||
:OUTPUT ACCEPT [1:85]
|
||||
COMMIT
|
||||
*filter
|
||||
:INPUT DROP [288:42467]
|
||||
:FORWARD DROP [0:0]
|
||||
:OUTPUT ACCEPT [65:9665]
|
||||
-A INPUT -i lo -j ACCEPT
|
||||
-A INPUT -i eth1 -m state --state RELATED,ESTABLISHED -j ACCEPT
|
||||
-A INPUT -i eth2 -m state --state RELATED,ESTABLISHED -j ACCEPT
|
||||
-A INPUT -p icmp -j ACCEPT
|
||||
-A INPUT -i eth1 -p tcp -m state --state NEW -m tcp --dport 8001 -j ACCEPT
|
||||
-A INPUT -i eth2 -p tcp -m state --state NEW -m tcp --dport 443 -j ACCEPT
|
||||
-A INPUT -i eth2 -p tcp -m state --state NEW -m tcp --dport 80 -j ACCEPT
|
||||
COMMIT
|
||||
|
|
@ -1,23 +0,0 @@
|
|||
# @VERSION@
|
||||
*nat
|
||||
:PREROUTING ACCEPT [499:70846]
|
||||
:POSTROUTING ACCEPT [1:85]
|
||||
:OUTPUT ACCEPT [1:85]
|
||||
COMMIT
|
||||
*filter
|
||||
:INPUT DROP [288:42467]
|
||||
:FORWARD DROP [0:0]
|
||||
:OUTPUT ACCEPT [65:9665]
|
||||
-A INPUT -i eth0 -m state --state RELATED,ESTABLISHED -j ACCEPT
|
||||
-A INPUT -i eth1 -m state --state RELATED,ESTABLISHED -j ACCEPT
|
||||
-A INPUT -i eth2 -m state --state RELATED,ESTABLISHED -j ACCEPT
|
||||
-A INPUT -p icmp -j ACCEPT
|
||||
-A INPUT -i lo -j ACCEPT
|
||||
-A INPUT -i eth0 -p udp -m udp --dport 67 -j ACCEPT
|
||||
-A INPUT -i eth0 -p udp -m udp --dport 53 -j ACCEPT
|
||||
-A INPUT -i eth1 -p tcp -m state --state NEW --dport 3922 -j ACCEPT
|
||||
-A INPUT -i eth0 -p tcp -m state --state NEW --dport 8080 -j ACCEPT
|
||||
-A FORWARD -i eth0 -o eth1 -m state --state RELATED,ESTABLISHED -j ACCEPT
|
||||
-A FORWARD -i eth0 -o eth2 -j ACCEPT
|
||||
-A FORWARD -i eth2 -o eth0 -m state --state RELATED,ESTABLISHED -j ACCEPT
|
||||
COMMIT
|
||||
|
|
@ -1,27 +0,0 @@
|
|||
# Kernel sysctl configuration file for Red Hat Linux
|
||||
#
|
||||
# For binary values, 0 is disabled, 1 is enabled. See sysctl(8) and
|
||||
# sysctl.conf(5) for more details.
|
||||
# @VERSION@
|
||||
|
||||
# Controls IP packet forwarding
|
||||
net.ipv4.ip_forward = 1
|
||||
|
||||
# Controls source route verification
|
||||
net.ipv4.conf.default.rp_filter = 1
|
||||
|
||||
# Do not accept source routing
|
||||
net.ipv4.conf.default.accept_source_route = 0
|
||||
|
||||
# Controls the System Request debugging functionality of the kernel
|
||||
kernel.sysrq = 0
|
||||
|
||||
# Controls whether core dumps will append the PID to the core filename.
|
||||
# Useful for debugging multi-threaded applications.
|
||||
kernel.core_uses_pid = 1
|
||||
|
||||
# Controls the use of TCP syncookies
|
||||
net.ipv4.tcp_syncookies = 1
|
||||
|
||||
# VMOps Rudd-O increase conntrack limits, fix http://bugzilla.lab.vmops.com/show_bug.cgi?id=2008
|
||||
net.ipv4.netfilter.ip_conntrack_max=65536
|
||||
|
|
@ -1,51 +0,0 @@
|
|||
#!/usr/bin/env bash
|
||||
# $Id: edithosts.sh 9947 2010-06-25 19:34:24Z manuel $ $HeadURL: svn://svn.lab.vmops.com/repos/vmdev/java/patches/kvm/root/edithosts.sh $
|
||||
# edithosts.sh -- edit the dhcphosts file on the routing domain
|
||||
# $1 : the mac address
|
||||
# $2 : the associated ip address
|
||||
# $3 : the hostname
|
||||
# @VERSION@
|
||||
|
||||
wait_for_dnsmasq () {
|
||||
local _pid=$(/sbin/pidof dnsmasq)
|
||||
for i in 0 1 2 3 4 5 6 7 8 9 10
|
||||
do
|
||||
sleep 1
|
||||
_pid=$(/sbin/pidof dnsmasq)
|
||||
[ "$_pid" != "" ] && break;
|
||||
done
|
||||
[ "$_pid" != "" ] && return 0;
|
||||
echo "edithosts: timed out waiting for dnsmasq to start"
|
||||
return 1
|
||||
}
|
||||
|
||||
#delete any previous entries from the dhcp hosts file
|
||||
sed -i /$1/d /etc/dhcphosts.txt
|
||||
sed -i /$2,/d /etc/dhcphosts.txt
|
||||
sed -i /$3,/d /etc/dhcphosts.txt
|
||||
|
||||
#put in the new entry
|
||||
echo "$1,$2,$3,infinite" >>/etc/dhcphosts.txt
|
||||
|
||||
#delete leases to supplied mac and ip addresses
|
||||
sed -i /$1/d /var/lib/misc/dnsmasq.leases
|
||||
sed -i /"$2 "/d /var/lib/misc/dnsmasq.leases
|
||||
sed -i /"$3 "/d /var/lib/misc/dnsmasq.leases
|
||||
|
||||
#put in the new entry
|
||||
echo "0 $1 $2 $3 *" >> /var/lib/misc/dnsmasq.leases
|
||||
|
||||
#edit hosts file as well
|
||||
sed -i /"$2 "/d /etc/hosts
|
||||
sed -i /"$3"/d /etc/hosts
|
||||
echo "$2 $3" >> /etc/hosts
|
||||
|
||||
# send SIGHUP to make dnsmasq re-read files
|
||||
pid=$(/sbin/pidof dnsmasq)
|
||||
if [ "$pid" != "" ]
|
||||
then
|
||||
kill -1 $(/sbin/pidof dnsmasq)
|
||||
else
|
||||
wait_for_dnsmasq
|
||||
fi
|
||||
|
||||
|
|
@ -74,13 +74,15 @@ resolv-file=/etc/dnsmasq-resolv.conf
|
|||
interface=eth0
|
||||
# Or you can specify which interface _not_ to listen on
|
||||
except-interface=eth1
|
||||
except-interface=eth2
|
||||
# Or which to listen on by address (remember to include 127.0.0.1 if
|
||||
# you use this.)
|
||||
#listen-address=
|
||||
# If you want dnsmasq to provide only DNS service on an interface,
|
||||
# configure it as shown above, and then use the following line to
|
||||
# disable DHCP on it.
|
||||
#no-dhcp-interface=eth1
|
||||
no-dhcp-interface=eth1
|
||||
no-dhcp-interface=eth2
|
||||
|
||||
# On systems which support it, dnsmasq binds the wildcard address,
|
||||
# even when it is listening on only some interfaces. It then discards
|
||||
|
|
@ -109,7 +111,7 @@ expand-hosts
|
|||
# 2) Sets the "domain" DHCP option thereby potentially setting the
|
||||
# domain of all systems configured by DHCP
|
||||
# 3) Provides the domain part for "expand-hosts"
|
||||
domain=foo.com
|
||||
#domain=foo.com
|
||||
|
||||
# Uncomment this to enable the integrated DHCP server, you need
|
||||
# to supply the range of addresses available for lease and optionally
|
||||
|
|
@ -248,7 +250,7 @@ dhcp-hostsfile=/etc/dhcphosts.txt
|
|||
#dhcp-option=27,1
|
||||
|
||||
# Set the domain
|
||||
dhcp-option=15,"foo.com"
|
||||
#dhcp-option=15,"foo.com"
|
||||
|
||||
# Send the etherboot magic flag and then etherboot options (a string).
|
||||
#dhcp-option=128,e4:45:74:68:00:00
|
||||
|
|
@ -26,7 +26,14 @@ setup_console_proxy() {
|
|||
echo "$public_ip $NAME" >> /etc/hosts
|
||||
}
|
||||
|
||||
CMDLINE=$(cat /proc/cmdline)
|
||||
|
||||
if [ -f /mnt/cmdline ]
|
||||
then
|
||||
CMDLINE=$(cat /mnt/cmdline)
|
||||
else
|
||||
CMDLINE=$(cat /proc/cmdline)
|
||||
fi
|
||||
|
||||
TYPE="router"
|
||||
BOOTPROTO="static"
|
||||
|
||||
|
|
@ -118,7 +118,7 @@ setup_dhcpsrvr() {
|
|||
sed -i -e "s/^dhcp-range=.*$/dhcp-range=$DHCP_RANGE,static/" /etc/dnsmasq.conf
|
||||
sed -i -e "s/^[#]*dhcp-option=option:router.*$/dhcp-option=option:router,$GW/" /etc/dnsmasq.conf
|
||||
#for now set up ourself as the dns server as well
|
||||
#echo "dhcp-option=6,$NS1,$NS2" >> /etc/dnsmasq.conf
|
||||
sed -i s/[#]*dhcp-option=6.*$/dhcp-option=6,\"$NS1\",\"$NS2\"/ /etc/dnsmasq.conf
|
||||
sed -i /gateway/d /etc/hosts
|
||||
echo "$ETH0_IP $NAME" >> /etc/hosts
|
||||
[ -f /etc/httpd/conf/httpd.conf ] && sed -i -e "s/^Listen.*$/Listen $ETH0_IP:80/" /etc/httpd/conf/httpd.conf
|
||||
|
|
@ -143,7 +143,25 @@ setup_console_proxy() {
|
|||
echo "$public_ip $NAME" >> /etc/hosts
|
||||
}
|
||||
|
||||
CMDLINE=$(cat /proc/cmdline)
|
||||
if [ -f /mnt/cmdline ]
|
||||
then
|
||||
CMDLINE=$(cat /mnt/cmdline)
|
||||
else
|
||||
CMDLINE=$(cat /proc/cmdline)
|
||||
fi
|
||||
|
||||
|
||||
if [ ! -d /root/.ssh ]
|
||||
then
|
||||
mkdir /root/.ssh
|
||||
chmod 700 /root/.ssh
|
||||
fi
|
||||
if [ -f /mnt/id_rsa.pub ]
|
||||
then
|
||||
cat /mnt/id_rsa.pub > /root/.ssh/authorized_keys
|
||||
chmod 600 /root/.ssh/authorized_keys
|
||||
fi
|
||||
|
||||
TYPE="router"
|
||||
BOOTPROTO="static"
|
||||
|
||||
|
|
@ -1,48 +0,0 @@
|
|||
# Load additional iptables modules (nat helpers)
|
||||
# Default: -none-
|
||||
# Space separated list of nat helpers (e.g. 'ip_nat_ftp ip_nat_irc'), which
|
||||
# are loaded after the firewall rules are applied. Options for the helpers are
|
||||
# stored in /etc/modprobe.conf.
|
||||
IPTABLES_MODULES="ip_conntrack_ftp nf_nat_ftp"
|
||||
|
||||
# Unload modules on restart and stop
|
||||
# Value: yes|no, default: yes
|
||||
# This option has to be 'yes' to get to a sane state for a firewall
|
||||
# restart or stop. Only set to 'no' if there are problems unloading netfilter
|
||||
# modules.
|
||||
IPTABLES_MODULES_UNLOAD="yes"
|
||||
|
||||
# Save current firewall rules on stop.
|
||||
# Value: yes|no, default: no
|
||||
# Saves all firewall rules to /etc/sysconfig/iptables if firewall gets stopped
|
||||
# (e.g. on system shutdown).
|
||||
IPTABLES_SAVE_ON_STOP="no"
|
||||
|
||||
# Save current firewall rules on restart.
|
||||
# Value: yes|no, default: no
|
||||
# Saves all firewall rules to /etc/sysconfig/iptables if firewall gets
|
||||
# restarted.
|
||||
IPTABLES_SAVE_ON_RESTART="no"
|
||||
|
||||
# Save (and restore) rule and chain counter.
|
||||
# Value: yes|no, default: no
|
||||
# Save counters for rules and chains to /etc/sysconfig/iptables if
|
||||
# 'service iptables save' is called or on stop or restart if SAVE_ON_STOP or
|
||||
# SAVE_ON_RESTART is enabled.
|
||||
IPTABLES_SAVE_COUNTER="no"
|
||||
|
||||
# Numeric status output
|
||||
# Value: yes|no, default: yes
|
||||
# Print IP addresses and port numbers in numeric format in the status output.
|
||||
IPTABLES_STATUS_NUMERIC="yes"
|
||||
|
||||
# Verbose status output
|
||||
# Value: yes|no, default: yes
|
||||
# Print info about the number of packets and bytes plus the "input-" and
|
||||
# "outputdevice" in the status output.
|
||||
IPTABLES_STATUS_VERBOSE="no"
|
||||
|
||||
# Status output with numbered lines
|
||||
# Value: yes|no, default: yes
|
||||
# Print a counter/number for every rule in the status output.
|
||||
IPTABLES_STATUS_LINENUMBERS="yes"
|
||||
|
|
@ -92,6 +92,7 @@ public class LocalStoragePoolListener implements Listener {
|
|||
host.getPodId(), pInfo.getAvailableBytes(), pInfo.getCapacityBytes(), pInfo.getHost(), 0,
|
||||
pInfo.getHostPath());
|
||||
pool.setClusterId(host.getClusterId());
|
||||
pool.setStatus(Status.Up);
|
||||
_storagePoolDao.persist(pool, pInfo.getDetails());
|
||||
StoragePoolHostVO poolHost = new StoragePoolHostVO(pool.getId(), host.getId(), pInfo.getLocalPath());
|
||||
_storagePoolHostDao.persist(poolHost);
|
||||
|
|
|
|||
Loading…
Reference in New Issue