ia64/xen-unstable

view tools/examples/defaults @ 1372:5a6113c65ead

bitkeeper revision 1.891.1.12 (40a248b0WTGoOa9206iWkyGN0mTPNw)

Allow forcing of IRQ trigger-type to edge or level
(NB. DANGEROUS!).
author kaf24@scramble.cl.cam.ac.uk
date Wed May 12 15:54:24 2004 +0000 (2004-05-12)
parents b91c80687fb5
children 459daba5f498 b442c789c93e
line source
2 ##### Edit this python file to reflect the configuration of your system
4 ##### This example script expects a variable called 'vmid' to be set.
6 def config_usage ():
7 print >>sys.stderr,"""
8 The config file '%s' requires the following variable to be defined:
9 vmid -- Numeric identifier for the new domain, used to calculate
10 the VM's IP address and root partition. E.g. -Dvmid=1
11 """ % config_file
14 try:
15 vmid=int(vmid) # convert to integer
16 except:
17 print >>sys.stderr,"%s: This script expects 'vmid' to be set using -D vmid=X" % config_file
18 assert()
20 if vmid == 0:
21 print >>sys.stderr,"%s: 'vmid' must be greater than 0" % config_file
22 assert()
25 # STEP 1. Specify kernel image file and otional ramdisk. Can be gzip'ed.
26 image = "../../../install/boot/xenolinux.gz"
27 ramdisk = ""
28 #ramdisk = "/boot/initrd.gz"
29 builder_fn='linux' # this is a linux domain
31 # STEP 2. The initial memory allocation (in megabytes) for the new domain.
32 mem_size = 64
34 # STEP 3. A handy name for your new domain.
35 domain_name = "This is VM %d" % vmid
37 # STEP 4. Which CPU to start domain on?
38 #cpu = -1 # leave to Xen to pick
39 cpu = vmid # set based on vmid (mod number of CPUs)
42 # STEP 5. Specify IP address(es), for the new domain. You need to
43 # configure IP addrs within the domain just as you do normally. This
44 # is just to let Xen know about them so it can route packets
45 # appropriately.
47 #vfr_ipaddr = ["111.222.333.444","222.333.444.555"]
48 vfr_ipaddr = [xenctl.utils.add_offset_to_ip(xenctl.utils.get_current_ipaddr(),vmid),
49 xenctl.utils.add_offset_to_ip('169.254.1.0',vmid),]
52 # STEP 6. Identify any physcial partitions or virtual disks you want the
53 # domain to have access to, and what you want them accessible as
54 # e.g. vbd_list = [ ('phy:sda1','sda1', 'w'),
55 # ('phy:sda%d' % (3+vmid), 'hda2', 'r'),
56 # ('vd:as73gd784dh','hda1','w'),
57 # ('phy:cdrom','hdd','r')
59 vbd_list = [ ('phy:sda%d'%(7+vmid),'sda1','w' ),
60 ('phy:sda6','sda6','r') ]
64 # STEP 5b. Set the VBD expertise level. Most people should leave this
65 # on 0, at least to begin with - this script can detect most dangerous
66 # disk sharing between domains and with this set to zero it will only
67 # allow read only sharing.
69 vbd_expert = 0
72 # STEP 7. Build the command line for the new domain. Edit as req'd.
73 # You only need the ip= line if you're NFS booting or the root file system
74 # doesn't set it later e.g. in ifcfg-eth0 or via DHCP
75 # You can use 'extrabit' to set the runlevel and custom environment
76 # variables used by custom rc scripts (e.g. VMID=, usr= )
78 netmask = xenctl.utils.get_current_ipmask()
79 gateway = xenctl.utils.get_current_ipgw()
80 nfsserv = '169.254.1.0'
82 cmdline_ip = "ip="+vfr_ipaddr[0]+":"+nfsserv+":"+gateway+":"+netmask+"::eth0:off"
83 cmdline_root = "root=/dev/sda1 ro"
84 #cmdline_root = "root=/dev/nfs nfsroot=/full/path/to/root/directory"
85 cmdline_extra = "4 VMID=%d usr=/dev/sda6" % vmid
88 # STEP 8. Set according to whether you want the script to watch the domain
89 # and auto-restart it should it die or exit.
91 auto_restart = False
92 #auto_restart = True
94 # STEP 9. (Optional) Define a console port number for the new domain.
96 # console_port = 9610+vmid