# HG changeset patch # User igor@manas.xt.vpn # Date 1219051766 -10800 # Node ID 85165c844ac99c896f5cb92f5cf4699ac92841cf # Parent 189e42c31b6920b463e5d147431a02f034a1be32 fill only linux domains; skip all other diff -r 189e42c31b69 -r 85165c844ac9 xen-drbd-install.py --- a/xen-drbd-install.py Mon Aug 18 11:48:34 2008 +0300 +++ b/xen-drbd-install.py Mon Aug 18 12:29:26 2008 +0300 @@ -34,6 +34,11 @@ meta_disk='/dev/%s/meta'%lvm_vg_name drbd_device={} +linux_domains=[] +for dom in domains: + if domain_types[domains.index(dom)] == 'linux': + linux_domains.append(dom) + def make_drbd_hash(): for dom in domains: for disk in disk_table[dom]: @@ -50,7 +55,7 @@ print "pvcreate %s" % (lvm_pv_name) print "vgcreate /dev/%s %s" % (lvm_vg_name, lvm_pv_names) print "lvcreate -L %s -n %s /dev/%s" % (lvm_lv_drbd_meta_size, lvm_lv_drbd_meta_name, lvm_vg_name) - for dom in domains: + for dom in linux_domains: for disk in disk_table[dom]: if disk.find(":") == -1: #if do_print: @@ -160,23 +165,23 @@ print "#" print "mkdir -p /domU" - for dom in domains: + for dom in linux_domains: print "mkdir -p /domU/%s" % (dom) print "mount /dev/drbd/%s /domU/%s" % (dom,dom) def make_umount(): - for dom in domains: + for dom in linux_domains: print "umount /domU/%s" % (dom) def make_dns(): i=1 - for dom in domains: + for dom in linux_domains: print "%s A %s.%s" % (dom, ip_network, i) i+=1 def make_dns_reverse(): i=1 - for dom in domains: + for dom in linux_domains: print "%s A %s.%s." % (i, dom, domain_name) i+=1 @@ -195,7 +200,7 @@ def make_etcfstab(): i=0 - for dom in domains: + for dom in linux_domains: i+=1 print """ cat < /domU/%s/etc/fstab @@ -206,7 +211,7 @@ def make_etcnetworkinterfaces(): i=0 - for dom in domains: + for dom in linux_domains: i+=1 print """ cat < /domU/%s/etc/network/interfaces @@ -225,7 +230,7 @@ """ % (dom,ip_address_table[dom],ip_network, ip_network, ip_gateway, domain_name, ip_nameserver) def make_etcresolvconf(): - for dom in domains: + for dom in linux_domains: print """ cat < /domU/%s/etc/resolv.conf search %s @@ -234,7 +239,7 @@ """ % (dom,domain_name,ip_nameserver) def make_etchostname(): - for dom in domains: + for dom in linux_domains: print """ cat < /domU/%s/etc/hostname %s @@ -244,7 +249,7 @@ def make_etchosts(): i=0 - for dom in domains: + for dom in linux_domains: i+=1 print """ cat < /domU/%s/etc/hosts @@ -261,7 +266,7 @@ """ % (dom,ip_address_table[dom],dom,domain_name,dom) def make_rootssh(): - for dom in domains: + for dom in linux_domains: print """ mkdir -p /domU/%s/home/eb/.ssh/ chown -R 1000:1000 /domU/%s/home/eb @@ -270,7 +275,7 @@ """ % (dom,dom,dom,dom) def make_l3rc(): - for dom in domains: + for dom in linux_domains: print """ cat < /domU/%s/root/.l3rc l3cd=/users/igor/xen-drbd-dom0-setup/%s.%s/root