xen-drbd

changeset 1:d6f7c53b085d

several changes
author eb
date Thu Sep 27 23:27:58 2007 +0300 (2007-09-27)
parents b6dc3480caae
children afe3c0992ec3
files config-example2.py default-xen-drbd init.d-xen-drbd xen-drbd.py
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/config-example2.py	Thu Sep 27 23:27:58 2007 +0300
     1.3 @@ -0,0 +1,97 @@
     1.4 +
     1.5 +node1='debian'
     1.6 +node2='mirror'
     1.7 +i_am=node1
     1.8 +
     1.9 +ip_address = {
    1.10 +	node1: '10.0.1.19',
    1.11 +	node2: '10.0.1.20',
    1.12 +}
    1.13 +
    1.14 +node1_ip=ip_address[node1]
    1.15 +node2_ip=ip_address[node2]
    1.16 +
    1.17 +domains=[ 'gw', 'igw', 'dns', 'vpn', 'apt' 'proxy', 'pgw', 'ldap', 'mail', 'uucp', 'samba', 'dozor', 'vvidd', ] 
    1.18 +
    1.19 +domain_home = {
    1.20 +		node1 : ['dozor', 'dns', 'gw', 'igw', 'pgw', 'ldap', 'mail', 'proxy', 'vpn', 'uucp', 'vvidd', 'apt'], 
    1.21 +		node2 : ['samba'], 
    1.22 +	}
    1.23 +
    1.24 +kernel = "/boot/vmlinuz-2.6.18-4-xen-686"
    1.25 +ramdisk = "/boot/initrd.img-2.6.18-4-xen-686-domU"
    1.26 +
    1.27 +mem_table={
    1.28 +	'dozor'	:256, 
    1.29 +	'dns'	:64, 
    1.30 +	'gw' 	:64, 
    1.31 +	'igw'	:128, 
    1.32 +	'pgw' 	:64, 
    1.33 +	'ldap'	:64, 
    1.34 +	'mail'	:256, 
    1.35 +	'proxy'	:256, 
    1.36 +	'samba'	:512, 
    1.37 +	'vpn'	:192,
    1.38 +	'uucp'	:128,
    1.39 +	'vvidd'	:64,
    1.40 +	'apt'   :128,
    1.41 +}
    1.42 +
    1.43 +lvm_vg_name="TURBO"
    1.44 +disk_table={
    1.45 +	'gw' 		: ['drbd1'], 
    1.46 +	'igw'		: ['drbd2'], 
    1.47 +	'dns'		: ['drbd3'], 
    1.48 +	'vpn'		: ['drbd4'],
    1.49 +	'apt'		: ['drbd5'],
    1.50 +	'proxy'		: ['drbd6'], 
    1.51 +	'pgw'		: ['drbd7'], 
    1.52 +	'ldap'		: ['drbd8'], 
    1.53 +	'mail'		: ['drbd10','drbd12:maildir'], 
    1.54 +	'samba'		: [ 
    1.55 +				'drbd18', 
    1.56 +				'drbd13:samba-home', 
    1.57 +				'drbd14:samba-nbumail', 
    1.58 +				'drbd15:samba-arm3', 
    1.59 +				'drbd16:samba-boxes', 
    1.60 +				'drbd17:samba-profiles' 
    1.61 +			  ],
    1.62 +	'dozor'		: ['drbd19'], 
    1.63 +	'vvidd'		: ['drbd20'], 
    1.64 +}
    1.65 +
    1.66 +bridges=['tagged0', 'xenbr1', 'xenbr256', 'xenbr257', 'xenbr3', 'xenbr4', 'xenbr501']
    1.67 +vlans=  ['tagged',        1,        256,        257,        3,        4,        501 ]
    1.68 +management_vlan=1
    1.69 +trunk='eth0'
    1.70 +management_ip=ip_address[i_am]
    1.71 +management_gw='10.0.1.253'
    1.72 +
    1.73 +vbridges_table={
    1.74 +	'dozor'		: ['xenbr3'], 
    1.75 +	'dns'		: ['xenbr3'], 
    1.76 +	'gw' 		: ['xenbr501', 'xenbr256', 'xenbr257'], 
    1.77 +	'igw'		: ['tagged0','xenbr3'], 
    1.78 +	'pgw'		: ['xenbr3','xenbr501'], 
    1.79 +	'ldap'		: ['xenbr3'], 
    1.80 +	'mail'		: ['xenbr3'], 
    1.81 +	'proxy'		: ['xenbr3'], 
    1.82 +	'samba'		: ['tagged0', 'xenbr3'],
    1.83 +	'vpn'		: ['xenbr3'],
    1.84 +	'vvidd'		: ['xenbr3'],
    1.85 +	'apt'		: ['xenbr3'],
    1.86 +	'uucp'		: ['xenbr3'],
    1.87 +}
    1.88 +
    1.89 +# FOR INSTALLATION ONLY
    1.90 +
    1.91 +ip_network="10.0.3"
    1.92 +domain_name="eb.co.ua"
    1.93 +ip_nameserver="10.0.3.4"
    1.94 +ip_gateway="10.0.3.3"
    1.95 +
    1.96 +debian_release="etch"
    1.97 +debian_mirror="http://debian.org.ua/debian"
    1.98 +apt_get_install="less tcpdump libpam-ldap libnss-ldap snmpd libc6-xen openssh-server"
    1.99 +
   1.100 +
     2.1 --- a/default-xen-drbd	Thu Sep 27 18:56:29 2007 +0300
     2.2 +++ b/default-xen-drbd	Thu Sep 27 23:27:58 2007 +0300
     2.3 @@ -1,4 +1,5 @@
     2.4  XEN_DRBD_PATH='/usr/local/bin'
     2.5  TOPOLOGY_NAME='eb'
     2.6  START_ACTION=nothing 	#migrate-and-start-all
     2.7 +STOP_ACTION=migrate-all-out
     2.8  
     3.1 --- a/init.d-xen-drbd	Thu Sep 27 18:56:29 2007 +0300
     3.2 +++ b/init.d-xen-drbd	Thu Sep 27 23:27:58 2007 +0300
     3.3 @@ -3,6 +3,7 @@
     3.4  XEN_DRBD_PATH='/usr/bin'
     3.5  TOPOLOGY_NAME='xen-drbd'
     3.6  START_ACTION='nothing'
     3.7 +STOP_ACTION='nothing'
     3.8  [ -e /etc/default/xen-drbd ] && . /etc/default/xen-drbd
     3.9  
    3.10  case $1 in
    3.11 @@ -16,7 +17,7 @@
    3.12  			fi
    3.13  		;;
    3.14  		stop)
    3.15 -			$XEN_DRBD_PATH/xen-drbd.py migrate-all-out
    3.16 +			$XEN_DRBD_PATH/xen-drbd.py $STOP_ACTION
    3.17  		;;
    3.18  		*)
    3.19  			echo $0 'start|stop'
     4.1 --- a/xen-drbd.py	Thu Sep 27 18:56:29 2007 +0300
     4.2 +++ b/xen-drbd.py	Thu Sep 27 23:27:58 2007 +0300
     4.3 @@ -5,6 +5,7 @@
     4.4  import sys,os
     4.5  from commands import mkarg
     4.6  
     4.7 +
     4.8  sys.path.append('/etc/xen')
     4.9  try:
    4.10          exec 'from %s import *' % (network)