]> scripts.mit.edu Git - xen.git/blob - scripts-server
New VM whole-enchilada.
[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_mem  = 1
13 vm_mac5 = 2
14 machines = { 'bees-knees'     : ['not-forward',  4096, 10],
15              'cats-whiskers'  : ['not-forward',  4096, 20],
16              'not-backward'   : ['not-forward',  4096, 30],
17              'busy-beaver'    : ['conan-obrien', 3072, 40],
18              'pancake-bunny'  : ['conan-obrien', 3072, 50],
19              'whole-enchilada': ['conan-obrien', 3072, 60],
20            }
21 vm = machines[machine_name]
22
23 mac5 = vm[vm_mac5]
24
25 if 'install' in locals():
26   # Get these files from a Fedora mirror, from a path like
27   # pub/fedora/linux/releases/test/11-Preview/Fedora/x86_64/os/isolinux/
28   kernel = "/root/%s-install/vmlinuz" % install
29   ramdisk = "/root/%s-install/initrd.img" % install
30   extra = "selinux=0"
31 elif 'type' in locals() and type == 'hvm':
32   kernel = "/usr/lib/xen/boot/hvmloader"
33   builder = "hvm"
34   vnc = 1
35   vncpassword = "foobar"
36 else:
37   # Fedora installs GRUB.
38   bootloader = "/usr/bin/pygrub"
39
40 vcpus = 2
41 if 'memory' not in locals(): memory = vm[vm_mem]
42 maxmem = 16384
43 name = machine_name
44 vg = vm[vm_host]
45 disk = [i % (vg, name) for i in ['phy:/dev/%s/%s-root,hda,w',
46                                  'phy:/dev/%s/%s-swap,hdb,w']]
47 vif = [i % mac5 for i in ['bridge=eth0, mac=ac:de:48:00:%s:01',
48                           'bridge=eth1, mac=ac:de:48:00:%s:02']]
49
50 if 'builder' not in locals() or builder != "hvm":
51   # https://bugzilla.redhat.com/show_bug.cgi?id=466681
52   # pygrub uses cached and eventually outdated grub.conf, kernel and initrd
53   file('/proc/sys/vm/drop_caches', 'w').write('1')