[34] | 1 | # -*- mode: python; -*- |
---|
| 2 | #============================================================================ |
---|
| 3 | # Python configuration setup for 'xm create'. |
---|
| 4 | # This script sets the parameters used when a domain is created using 'xm create'. |
---|
| 5 | # You use a separate script for each domain you want to create, or |
---|
| 6 | # you can set the parameters for the domain on the xm command line. |
---|
| 7 | #============================================================================ |
---|
| 8 | |
---|
| 9 | import os, re |
---|
| 10 | arch = os.uname()[4] |
---|
| 11 | if re.search('64', arch): |
---|
| 12 | arch_libdir = 'lib64' |
---|
| 13 | else: |
---|
| 14 | arch_libdir = 'lib' |
---|
| 15 | |
---|
| 16 | #---------------------------------------------------------------------------- |
---|
| 17 | # Kernel image file. |
---|
| 18 | kernel = "/usr/lib/xen/boot/hvmloader" |
---|
| 19 | |
---|
| 20 | # The domain build function. HVM domain uses 'hvm'. |
---|
| 21 | builder='hvm' |
---|
| 22 | |
---|
| 23 | # Initial memory allocation (in megabytes) for the new domain. |
---|
| 24 | # |
---|
| 25 | # WARNING: Creating a domain with insufficient memory may cause out of |
---|
| 26 | # memory errors. The domain needs enough memory to boot kernel |
---|
| 27 | # and modules. Allocating less than 32MBs is not recommended. |
---|
| 28 | memory = 128 |
---|
| 29 | |
---|
| 30 | # Shadow pagetable memory for the domain, in MB. |
---|
| 31 | # Should be at least 2KB per MB of domain memory, plus a few MB per vcpu. |
---|
| 32 | # shadow_memory = 8 |
---|
| 33 | |
---|
| 34 | # A name for your domain. All domains must have different names. |
---|
| 35 | name = "ExampleHVMDomain" |
---|
| 36 | |
---|
| 37 | # 128-bit UUID for the domain. The default behavior is to generate a new UUID |
---|
| 38 | # on each call to 'xm create'. |
---|
| 39 | #uuid = "06ed00fe-1162-4fc4-b5d8-11993ee4a8b9" |
---|
| 40 | |
---|
| 41 | #----------------------------------------------------------------------------- |
---|
| 42 | # The number of cpus guest platform has, default=1 |
---|
| 43 | #vcpus=1 |
---|
| 44 | |
---|
| 45 | # Enable/disable HVM guest PAE, default=1 (enabled) |
---|
| 46 | #pae=1 |
---|
| 47 | |
---|
| 48 | # Enable/disable HVM guest ACPI, default=1 (enabled) |
---|
| 49 | #acpi=1 |
---|
| 50 | |
---|
| 51 | # Enable/disable HVM APIC mode, default=1 (enabled) |
---|
| 52 | # Note that this option is ignored if vcpus > 1 |
---|
| 53 | #apic=1 |
---|
| 54 | |
---|
| 55 | # List of which CPUS this domain is allowed to use, default Xen picks |
---|
| 56 | #cpus = "" # leave to Xen to pick |
---|
| 57 | #cpus = "0" # all vcpus run on CPU0 |
---|
| 58 | #cpus = "0-3,5,^1" # run on cpus 0,2,3,5 |
---|
| 59 | |
---|
| 60 | # Optionally define mac and/or bridge for the network interfaces. |
---|
| 61 | # Random MACs are assigned if not given. |
---|
| 62 | #vif = [ 'type=ioemu, mac=00:16:3e:00:00:11, bridge=xenbr0, model=ne2k_pci' ] |
---|
| 63 | # type=ioemu specify the NIC is an ioemu device not netfront |
---|
| 64 | vif = [ 'type=ioemu, bridge=xenbr0' ] |
---|
| 65 | |
---|
| 66 | #---------------------------------------------------------------------------- |
---|
| 67 | # Define the disk devices you want the domain to have access to, and |
---|
| 68 | # what you want them accessible as. |
---|
| 69 | # Each disk entry is of the form phy:UNAME,DEV,MODE |
---|
| 70 | # where UNAME is the device, DEV is the device name the domain will see, |
---|
| 71 | # and MODE is r for read-only, w for read-write. |
---|
| 72 | |
---|
| 73 | #disk = [ 'phy:hda1,hda1,r' ] |
---|
| 74 | disk = [ 'file:/var/images/min-el3-i386.img,hda,w', ',hdc:cdrom,r' ] |
---|
| 75 | |
---|
| 76 | #---------------------------------------------------------------------------- |
---|
| 77 | # Configure the behaviour when a domain exits. There are three 'reasons' |
---|
| 78 | # for a domain to stop: poweroff, reboot, and crash. For each of these you |
---|
| 79 | # may specify: |
---|
| 80 | # |
---|
| 81 | # "destroy", meaning that the domain is cleaned up as normal; |
---|
| 82 | # "restart", meaning that a new domain is started in place of the old |
---|
| 83 | # one; |
---|
| 84 | # "preserve", meaning that no clean-up is done until the domain is |
---|
| 85 | # manually destroyed (using xm destroy, for example); or |
---|
| 86 | # "rename-restart", meaning that the old domain is not cleaned up, but is |
---|
| 87 | # renamed and a new domain started in its place. |
---|
| 88 | # |
---|
| 89 | # The default is |
---|
| 90 | # |
---|
| 91 | # on_poweroff = 'destroy' |
---|
| 92 | # on_reboot = 'restart' |
---|
| 93 | # on_crash = 'restart' |
---|
| 94 | # |
---|
| 95 | # For backwards compatibility we also support the deprecated option restart |
---|
| 96 | # |
---|
| 97 | # restart = 'onreboot' means on_poweroff = 'destroy' |
---|
| 98 | # on_reboot = 'restart' |
---|
| 99 | # on_crash = 'destroy' |
---|
| 100 | # |
---|
| 101 | # restart = 'always' means on_poweroff = 'restart' |
---|
| 102 | # on_reboot = 'restart' |
---|
| 103 | # on_crash = 'restart' |
---|
| 104 | # |
---|
| 105 | # restart = 'never' means on_poweroff = 'destroy' |
---|
| 106 | # on_reboot = 'destroy' |
---|
| 107 | # on_crash = 'destroy' |
---|
| 108 | |
---|
| 109 | #on_poweroff = 'destroy' |
---|
| 110 | #on_reboot = 'restart' |
---|
| 111 | #on_crash = 'restart' |
---|
| 112 | |
---|
| 113 | #============================================================================ |
---|
| 114 | |
---|
| 115 | # New stuff |
---|
| 116 | device_model = '/usr/' + arch_libdir + '/xen/bin/qemu-dm' |
---|
| 117 | |
---|
| 118 | #----------------------------------------------------------------------------- |
---|
| 119 | # boot on floppy (a), hard disk (c), Network (n) or CD-ROM (d) |
---|
| 120 | # default: hard disk, cd-rom, floppy |
---|
| 121 | #boot="cda" |
---|
| 122 | |
---|
| 123 | #----------------------------------------------------------------------------- |
---|
| 124 | # write to temporary files instead of disk image files |
---|
| 125 | #snapshot=1 |
---|
| 126 | |
---|
| 127 | #---------------------------------------------------------------------------- |
---|
| 128 | # enable SDL library for graphics, default = 0 |
---|
| 129 | sdl=0 |
---|
| 130 | |
---|
| 131 | #---------------------------------------------------------------------------- |
---|
| 132 | # enable VNC library for graphics, default = 1 |
---|
| 133 | vnc=1 |
---|
| 134 | |
---|
| 135 | #---------------------------------------------------------------------------- |
---|
| 136 | # address that should be listened on for the VNC server if vnc is set. |
---|
| 137 | # default is to use 'vnc-listen' setting from /etc/xen/xend-config.sxp |
---|
| 138 | #vnclisten="127.0.0.1" |
---|
| 139 | |
---|
| 140 | #---------------------------------------------------------------------------- |
---|
| 141 | # set VNC display number, default = domid |
---|
| 142 | #vncdisplay=1 |
---|
| 143 | |
---|
| 144 | #---------------------------------------------------------------------------- |
---|
| 145 | # try to find an unused port for the VNC server, default = 1 |
---|
| 146 | #vncunused=1 |
---|
| 147 | |
---|
| 148 | #---------------------------------------------------------------------------- |
---|
| 149 | # enable spawning vncviewer for domain's console |
---|
| 150 | # (only valid when vnc=1), default = 0 |
---|
| 151 | #vncconsole=0 |
---|
| 152 | |
---|
| 153 | #---------------------------------------------------------------------------- |
---|
| 154 | # set password for domain's VNC console |
---|
| 155 | # default is depents on vncpasswd in xend-config.sxp |
---|
| 156 | vncpasswd='' |
---|
| 157 | |
---|
| 158 | #---------------------------------------------------------------------------- |
---|
| 159 | # no graphics, use serial port |
---|
| 160 | #nographic=0 |
---|
| 161 | |
---|
| 162 | #---------------------------------------------------------------------------- |
---|
| 163 | # enable stdvga, default = 0 (use cirrus logic device model) |
---|
| 164 | stdvga=0 |
---|
| 165 | |
---|
| 166 | #----------------------------------------------------------------------------- |
---|
| 167 | # serial port re-direct to pty deivce, /dev/pts/n |
---|
| 168 | # then xm console or minicom can connect |
---|
| 169 | serial='pty' |
---|
| 170 | |
---|
| 171 | |
---|
| 172 | #----------------------------------------------------------------------------- |
---|
| 173 | # Qemu Monitor, default is disable |
---|
| 174 | # Use ctrl-alt-2 to connect |
---|
| 175 | #monitor=1 |
---|
| 176 | |
---|
| 177 | |
---|
| 178 | #----------------------------------------------------------------------------- |
---|
| 179 | # enable sound card support, [sb16|es1370|all|..,..], default none |
---|
| 180 | #soundhw='sb16' |
---|
| 181 | |
---|
| 182 | |
---|
| 183 | #----------------------------------------------------------------------------- |
---|
| 184 | # set the real time clock to local time [default=0 i.e. set to utc] |
---|
| 185 | #localtime=1 |
---|
| 186 | |
---|
| 187 | |
---|
| 188 | #----------------------------------------------------------------------------- |
---|
| 189 | # set the real time clock offset in seconds [default=0 i.e. same as dom0] |
---|
| 190 | #rtc_timeoffset=3600 |
---|
| 191 | |
---|
| 192 | #----------------------------------------------------------------------------- |
---|
| 193 | # start in full screen |
---|
| 194 | #full-screen=1 |
---|
| 195 | |
---|
| 196 | |
---|
| 197 | #----------------------------------------------------------------------------- |
---|
| 198 | # Enable USB support (specific devices specified at runtime through the |
---|
| 199 | # monitor window) |
---|
| 200 | #usb=1 |
---|
| 201 | |
---|
| 202 | # Enable USB mouse support (only enable one of the following, `mouse' for |
---|
| 203 | # PS/2 protocol relative mouse, `tablet' for |
---|
| 204 | # absolute mouse) |
---|
| 205 | #usbdevice='mouse' |
---|
| 206 | #usbdevice='tablet' |
---|
| 207 | |
---|
| 208 | #----------------------------------------------------------------------------- |
---|
| 209 | # Set keyboard layout, default is en-us keyboard. |
---|
| 210 | #keymap='ja' |
---|