]> scripts.mit.edu Git - xen.git/blob - scripts-server
70265210f78fe947f6e7659594ec43009eebec5a
[xen.git] / scripts-server
1 # Xen domain configuration file for scripts.mit.edu virtualized web servers
2 #
3 # usage, e.g.:
4 #   xm create scripts-server machine_name=bees-knees
5 #   xm create scripts-server machine_name=cats-whiskers
6 # name is the name of the server (as used in the LV volumes)
7 # mac5 is the fifth octet of the MAC address: ac:de:48:00:xx:01
8 # set install=fcX if you want to run a Fedora install, where X
9 # is the version of Fedora to install
10
11 vm_host = 0
12 vm_cpus = 1
13 vm_mem  = 2
14 vm_mac5 = 3
15 machines = { 'bees-knees'     : ['david-letterman',  2, 6144, 10],
16              'cats-whiskers'  : ['david-letterman',  2, 6144, 20],
17              'not-backward'   : ['david-letterman',  2, 3072, 30],
18              'busy-beaver'    : ['conan-obrien',     2, 4096, 40],
19              'pancake-bunny'  : ['conan-obrien',     2, 4096, 50],
20              'whole-enchilada': ['conan-obrien',     1, 3072, 60],
21              'real-mccoy'     : ['jay-leno',         2, 4096, 70],
22              'sipb-server-2'  : ['jay-leno',     2, 1024, 80],
23            }
24 vm = machines[machine_name]
25
26 mac5 = vm[vm_mac5]
27
28 if 'install' in locals():
29   # Get these files from a Fedora mirror, from a path like
30   # pub/fedora/linux/releases/test/11-Preview/Fedora/x86_64/os/isolinux/
31   kernel = "/root/%s-install/vmlinuz" % install
32   ramdisk = "/root/%s-install/initrd.img" % install
33   extra = "selinux=0"
34 elif 'type' in locals() and type == 'hvm':
35   kernel = "/usr/lib/xen/boot/hvmloader"
36   builder = "hvm"
37   vnc = 1
38   vncpassword = "foobar"
39 else:
40   # Fedora installs GRUB.
41   bootloader = "/usr/bin/pygrub"
42
43 vcpus = vm[vm_cpus]
44 if 'memory' not in locals(): memory = vm[vm_mem]
45 maxmem = 16384
46 name = machine_name
47 vg = vm[vm_host]
48 disk = [i % (vg, name) for i in ['phy:/dev/%s/%s-root,hda,w',
49                                  'phy:/dev/%s/%s-swap,hdb,w']]
50 vif = [i % mac5 for i in ['bridge=eth0, mac=ac:de:48:00:%s:01',
51                           'bridge=eth1, mac=ac:de:48:00:%s:02']]
52
53 if 'builder' not in locals() or builder != "hvm":
54   # https://bugzilla.redhat.com/show_bug.cgi?id=466681
55   # pygrub uses cached and eventually outdated grub.conf, kernel and initrd
56   file('/proc/sys/vm/drop_caches', 'w').write('1')