ia64/xen-unstable

changeset 18097:e126614f0def

stubdom: add example config file

Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
author Keir Fraser <keir.fraser@citrix.com>
date Fri Jul 18 11:19:17 2008 +0100 (2008-07-18)
parents a8603b2fb786
children a9b888264293
files tools/examples/stubdom-ExampleHVMDomain tools/examples/xmexample.hvm tools/examples/xmexample.hvm-stubdom
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/tools/examples/stubdom-ExampleHVMDomain	Fri Jul 18 11:19:17 2008 +0100
     1.3 @@ -0,0 +1,21 @@
     1.4 +# Not to be started directly,
     1.5 +# See xmexample.hvm-stubdom and stubdom/README for more details
     1.6 +
     1.7 +import os, re
     1.8 +arch = os.uname()[4]
     1.9 +if re.search('64', arch):
    1.10 +    arch_libdir = 'lib64'
    1.11 +else:
    1.12 +    arch_libdir = 'lib'
    1.13 +
    1.14 +kernel = "/usr/" + arch_libdir + "/xen/boot/ioemu-stubdom.gz"
    1.15 +
    1.16 +# Must be the same as in xmexample.hvm-stubdom, with a prepended vif for TCP/IP
    1.17 +# networking in the stubdomain itself, here just ''
    1.18 +vif = [ '', 'type=ioemu, bridge=xenbr0' ]
    1.19 +
    1.20 +# Set here instead of in xmexample.hvm-stubdom
    1.21 +disk = [ 'file:/var/images/min-el3-i386.img,hda,w', ',hdc:cdrom,r' ]
    1.22 +
    1.23 +# Actual output via PVFB
    1.24 +vfb = [ 'type=sdl' ]
     2.1 --- a/tools/examples/xmexample.hvm	Thu Jul 17 15:37:09 2008 +0100
     2.2 +++ b/tools/examples/xmexample.hvm	Fri Jul 18 11:19:17 2008 +0100
     2.3 @@ -15,7 +15,7 @@ else:
     2.4  
     2.5  #----------------------------------------------------------------------------
     2.6  # Kernel image file.
     2.7 -kernel = "/usr/lib/xen/boot/hvmloader"
     2.8 +kernel = "/usr/" + arch_libdir + "/xen/boot/hvmloader"
     2.9  
    2.10  # The domain build function. HVM domain uses 'hvm'.
    2.11  builder='hvm'
    2.12 @@ -119,7 +119,7 @@ disk = [ 'file:/var/images/min-el3-i386.
    2.13  
    2.14  #============================================================================
    2.15  
    2.16 -# New stuff
    2.17 +# Device Model to be used
    2.18  device_model = '/usr/' + arch_libdir + '/xen/bin/qemu-dm'
    2.19  
    2.20  #-----------------------------------------------------------------------------
     3.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.2 +++ b/tools/examples/xmexample.hvm-stubdom	Fri Jul 18 11:19:17 2008 +0100
     3.3 @@ -0,0 +1,325 @@
     3.4 +#  -*- mode: python; -*-
     3.5 +#============================================================================
     3.6 +# Python configuration setup for 'xm create'.
     3.7 +# This script sets the parameters used when a domain is created using 'xm create'.
     3.8 +# You use a separate script for each domain you want to create, or 
     3.9 +# you can set the parameters for the domain on the xm command line.
    3.10 +#============================================================================
    3.11 +#
    3.12 +# This is a version using a stubdomain for device model, see
    3.13 +# stubdom-ExampleHVMDomain and stubdom/README for more details
    3.14 +# The differences with xmexample.hvm are marked with "STUBDOM"
    3.15 +
    3.16 +import os, re
    3.17 +arch = os.uname()[4]
    3.18 +if re.search('64', arch):
    3.19 +    arch_libdir = 'lib64'
    3.20 +else:
    3.21 +    arch_libdir = 'lib'
    3.22 +
    3.23 +#----------------------------------------------------------------------------
    3.24 +# Kernel image file.
    3.25 +kernel = "/usr/" + arch_libdir + "/xen/boot/hvmloader"
    3.26 +
    3.27 +# The domain build function. HVM domain uses 'hvm'.
    3.28 +builder='hvm'
    3.29 +
    3.30 +# Initial memory allocation (in megabytes) for the new domain.
    3.31 +#
    3.32 +# WARNING: Creating a domain with insufficient memory may cause out of
    3.33 +#          memory errors. The domain needs enough memory to boot kernel
    3.34 +#          and modules. Allocating less than 32MBs is not recommended.
    3.35 +memory = 128
    3.36 +
    3.37 +# Shadow pagetable memory for the domain, in MB.
    3.38 +# If not explicictly set, xend will pick an appropriate value.  
    3.39 +# Should be at least 2KB per MB of domain memory, plus a few MB per vcpu.
    3.40 +# shadow_memory = 8
    3.41 +
    3.42 +# A name for your domain. All domains must have different names.
    3.43 +name = "ExampleHVMDomain"
    3.44 +
    3.45 +# 128-bit UUID for the domain.  The default behavior is to generate a new UUID
    3.46 +# on each call to 'xm create'.
    3.47 +#uuid = "06ed00fe-1162-4fc4-b5d8-11993ee4a8b9"
    3.48 +
    3.49 +#-----------------------------------------------------------------------------
    3.50 +# The number of cpus guest platform has, default=1
    3.51 +#vcpus=1
    3.52 +
    3.53 +# Enable/disable HVM guest PAE, default=1 (enabled)
    3.54 +#pae=1
    3.55 +
    3.56 +# Enable/disable HVM guest ACPI, default=1 (enabled)
    3.57 +#acpi=1
    3.58 +
    3.59 +# Enable/disable HVM APIC mode, default=1 (enabled)
    3.60 +# Note that this option is ignored if vcpus > 1
    3.61 +#apic=1
    3.62 +
    3.63 +# List of which CPUS this domain is allowed to use, default Xen picks
    3.64 +#cpus = ""         # leave to Xen to pick
    3.65 +#cpus = "0"        # all vcpus run on CPU0
    3.66 +#cpus = "0-3,5,^1" # all vcpus run on cpus 0,2,3,5
    3.67 +#cpus = ["2", "3"] # VCPU0 runs on CPU2, VCPU1 runs on CPU3
    3.68 +
    3.69 +# Optionally define mac and/or bridge for the network interfaces.
    3.70 +# Random MACs are assigned if not given.
    3.71 +#vif = [ 'type=ioemu, mac=00:16:3e:00:00:11, bridge=xenbr0, model=ne2k_pci' ]
    3.72 +# type=ioemu specify the NIC is an ioemu device not netfront
    3.73 +vif = [ 'type=ioemu, bridge=xenbr0' ]
    3.74 +
    3.75 +#----------------------------------------------------------------------------
    3.76 +# Define the disk devices you want the domain to have access to, and
    3.77 +# what you want them accessible as.
    3.78 +# Each disk entry is of the form phy:UNAME,DEV,MODE
    3.79 +# where UNAME is the device, DEV is the device name the domain will see,
    3.80 +# and MODE is r for read-only, w for read-write.
    3.81 +#
    3.82 +# STUBDOM: do not put it here but in stubdom-ExampleHVMDomain
    3.83 +
    3.84 +#disk = [ 'phy:hda1,hda1,r' ]
    3.85 +#disk = [ 'file:/var/images/min-el3-i386.img,hda,w', ',hdc:cdrom,r' ]
    3.86 +
    3.87 +#----------------------------------------------------------------------------
    3.88 +# Configure the behaviour when a domain exits.  There are three 'reasons'
    3.89 +# for a domain to stop: poweroff, reboot, and crash.  For each of these you
    3.90 +# may specify:
    3.91 +#
    3.92 +#   "destroy",        meaning that the domain is cleaned up as normal;
    3.93 +#   "restart",        meaning that a new domain is started in place of the old
    3.94 +#                     one;
    3.95 +#   "preserve",       meaning that no clean-up is done until the domain is
    3.96 +#                     manually destroyed (using xm destroy, for example); or
    3.97 +#   "rename-restart", meaning that the old domain is not cleaned up, but is
    3.98 +#                     renamed and a new domain started in its place.
    3.99 +#
   3.100 +# In the event a domain stops due to a crash, you have the additional options:
   3.101 +#
   3.102 +#   "coredump-destroy", meaning dump the crashed domain's core and then destroy;
   3.103 +#   "coredump-restart', meaning dump the crashed domain's core and the restart.
   3.104 +#
   3.105 +# The default is
   3.106 +#
   3.107 +#   on_poweroff = 'destroy'
   3.108 +#   on_reboot   = 'restart'
   3.109 +#   on_crash    = 'restart'
   3.110 +#
   3.111 +# For backwards compatibility we also support the deprecated option restart
   3.112 +#
   3.113 +# restart = 'onreboot' means on_poweroff = 'destroy'
   3.114 +#                            on_reboot   = 'restart'
   3.115 +#                            on_crash    = 'destroy'
   3.116 +#
   3.117 +# restart = 'always'   means on_poweroff = 'restart'
   3.118 +#                            on_reboot   = 'restart'
   3.119 +#                            on_crash    = 'restart'
   3.120 +#
   3.121 +# restart = 'never'    means on_poweroff = 'destroy'
   3.122 +#                            on_reboot   = 'destroy'
   3.123 +#                            on_crash    = 'destroy'
   3.124 +
   3.125 +#on_poweroff = 'destroy'
   3.126 +#on_reboot   = 'restart'
   3.127 +#on_crash    = 'restart'
   3.128 +
   3.129 +#============================================================================
   3.130 +
   3.131 +# Device Model to be used
   3.132 +#
   3.133 +# STUBDOM: this is a script that creates the stub domain running the device
   3.134 +# model
   3.135 +device_model = '/usr/' + arch_libdir + '/xen/bin/stubdom-dm'
   3.136 +
   3.137 +#-----------------------------------------------------------------------------
   3.138 +# boot on floppy (a), hard disk (c), Network (n) or CD-ROM (d) 
   3.139 +# default: hard disk, cd-rom, floppy
   3.140 +#boot="cda"
   3.141 +
   3.142 +#-----------------------------------------------------------------------------
   3.143 +#  write to temporary files instead of disk image files
   3.144 +#snapshot=1
   3.145 +
   3.146 +#----------------------------------------------------------------------------
   3.147 +# enable SDL library for graphics, default = 0
   3.148 +# 
   3.149 +# STUBDOM: always disable since the stub domain doesn't have direct X access
   3.150 +sdl=0
   3.151 +
   3.152 +#----------------------------------------------------------------------------
   3.153 +# enable OpenGL for texture rendering inside the SDL window, default = 1
   3.154 +# valid only if sdl is enabled.
   3.155 +# 
   3.156 +# STUBDOM: always disable for the same reason
   3.157 +opengl=0
   3.158 +
   3.159 +#----------------------------------------------------------------------------
   3.160 +# enable VNC library for graphics, default = 1
   3.161 +vnc=0
   3.162 +
   3.163 +#----------------------------------------------------------------------------
   3.164 +# address that should be listened on for the VNC server if vnc is set.
   3.165 +# default is to use 'vnc-listen' setting from /etc/xen/xend-config.sxp
   3.166 +#vnclisten="127.0.0.1"
   3.167 +
   3.168 +#----------------------------------------------------------------------------
   3.169 +# set VNC display number, default = domid
   3.170 +#vncdisplay=1
   3.171 +
   3.172 +#----------------------------------------------------------------------------
   3.173 +# try to find an unused port for the VNC server, default = 1
   3.174 +#vncunused=1
   3.175 +
   3.176 +#----------------------------------------------------------------------------
   3.177 +# enable spawning vncviewer for domain's console
   3.178 +# (only valid when vnc=1), default = 0
   3.179 +#vncconsole=0
   3.180 +
   3.181 +#----------------------------------------------------------------------------
   3.182 +# set password for domain's VNC console
   3.183 +# default is depents on vncpasswd in xend-config.sxp
   3.184 +vncpasswd=''
   3.185 +
   3.186 +#----------------------------------------------------------------------------
   3.187 +# no graphics, use serial port
   3.188 +#nographic=0
   3.189 +
   3.190 +#----------------------------------------------------------------------------
   3.191 +# enable stdvga, default = 0 (use cirrus logic device model)
   3.192 +stdvga=0
   3.193 +
   3.194 +#-----------------------------------------------------------------------------
   3.195 +#   serial port re-direct to pty deivce, /dev/pts/n 
   3.196 +#   then xm console or minicom can connect
   3.197 +# 
   3.198 +# STUBDOM: always disable as the stub domain doesn't have access to dom0's
   3.199 +# ptys
   3.200 +#serial='pty'
   3.201 +
   3.202 +
   3.203 +#-----------------------------------------------------------------------------
   3.204 +#   Qemu Monitor, default is disable
   3.205 +#   Use ctrl-alt-2 to connect
   3.206 +#monitor=1
   3.207 +
   3.208 +
   3.209 +#-----------------------------------------------------------------------------
   3.210 +#   enable sound card support, [sb16|es1370|all|..,..], default none
   3.211 +# 
   3.212 +# STUBDOM: not supported
   3.213 +#soundhw='sb16'
   3.214 +
   3.215 +
   3.216 +#-----------------------------------------------------------------------------
   3.217 +#    set the real time clock to local time [default=0 i.e. set to utc]
   3.218 +#localtime=1
   3.219 +
   3.220 +
   3.221 +#-----------------------------------------------------------------------------
   3.222 +#    set the real time clock offset in seconds [default=0 i.e. same as dom0]
   3.223 +#rtc_timeoffset=3600
   3.224 +
   3.225 +#-----------------------------------------------------------------------------
   3.226 +#    start in full screen
   3.227 +#full-screen=1   
   3.228 +
   3.229 +
   3.230 +#-----------------------------------------------------------------------------
   3.231 +#   Enable USB support (specific devices specified at runtime through the
   3.232 +#			monitor window)
   3.233 +#usb=1
   3.234 +
   3.235 +#   Enable USB mouse support (only enable one of the following, `mouse' for
   3.236 +#			      PS/2 protocol relative mouse, `tablet' for
   3.237 +#			      absolute mouse)
   3.238 +#usbdevice='mouse'
   3.239 +#usbdevice='tablet'
   3.240 +
   3.241 +#-----------------------------------------------------------------------------
   3.242 +#   Set keyboard layout, default is en-us keyboard. 
   3.243 +#keymap='ja'
   3.244 +
   3.245 +#-----------------------------------------------------------------------------
   3.246 +#   Configure guest CPUID responses:
   3.247 +#
   3.248 +#cpuid=[ '1:ecx=xxxxxxxxxxx00xxxxxxxxxxxxxxxxxxx,
   3.249 +#           eax=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' ]
   3.250 +# - Unset the SSE4 features (CPUID.1[ECX][20-19])
   3.251 +# - Default behaviour for all other bits in ECX And EAX registers.
   3.252 +# 
   3.253 +# Each successive character represent a lesser-significant bit:
   3.254 +#  '1' -> force the corresponding bit to 1
   3.255 +#  '0' -> force to 0
   3.256 +#  'x' -> Get a safe value (pass through and mask with the default policy)
   3.257 +#  'k' -> pass through the host bit value
   3.258 +#  's' -> as 'k' but preserve across save/restore and migration
   3.259 +# 
   3.260 +#   Expose to the guest multi-core cpu instead of multiple processors
   3.261 +# Example for intel, expose a 8-core processor :
   3.262 +#cpuid=['1:edx=xxx1xxxxxxxxxxxxxxxxxxxxxxxxxxxx,
   3.263 +#          ebx=xxxxxxxx00010000xxxxxxxxxxxxxxxx',
   3.264 +#     '4,0:eax=001111xxxxxxxxxxxxxxxxxxxxxxxxxx']
   3.265 +#  - CPUID.1[EDX][HT] : Enable HT
   3.266 +#  - CPUID.1[EBX] : Number of vcpus * 2
   3.267 +#  - CPUID.4,0[EAX] : Number of vcpus * 2 - 1
   3.268 +#vcpus=8
   3.269 +#
   3.270 +# Example for amd, expose a 5-core processor :
   3.271 +# cpuid = ['1:ebx=xxxxxxxx00000001xxxxxxxxxxxxxxxx,
   3.272 +#             edx=xxx1xxxxxxxxxxxxxxxxxxxxxxxxxxxx',
   3.273 +# '0x80000008:ecx=xxxxxxxxxxxxxxxx0000xxxx00001010']
   3.274 +#  - CPUID.1[EBX] : (Thread * Cores ) per processors
   3.275 +#  - CPUID.1[EDX][HT] : Enable HT
   3.276 +#  - CPUID.0x80000008[ECX] : Number of vcpus * 2
   3.277 +#vcpus=5
   3.278 +#
   3.279 +#  Downgrade the cpuid to make a better compatibility for migration :
   3.280 +# Look like a generic 686 :
   3.281 +# cpuid = [ '0:eax=0x3,ebx=0x0,ecx=0x0,edx=0x0',
   3.282 +#           '1:eax=0x06b1,
   3.283 +#              ecx=xxxxxxxxxx0000xx00xxx0000000xx0,
   3.284 +#              edx=xx00000xxxxxxx0xxxxxxxxx0xxxxxx',
   3.285 +#           '4:eax=0x3,ebx=0x0,ecx=0x0,edx=0x0',
   3.286 +#  '0x80000000:eax=0x3,ebx=0x0,ecx=0x0,edx=0x0']
   3.287 +#  with the highest leaf
   3.288 +#  - CPUID.0[EAX] : Set the highest leaf
   3.289 +#  - CPUID.1[EAX] : 686 
   3.290 +#  - CPUID.1[ECX] : Mask some features
   3.291 +#  - CPUID.1[EDX] : Mask some features
   3.292 +#  - CPUID.4 : Reply like the highest leaf, in our case CPUID.3
   3.293 +#  - CPUID.0x80000000 : No extension we are on a Pentium III, reply like the
   3.294 +#  highest leaf (CPUID.3).
   3.295 +#
   3.296 +#   Configure host CPUID consistency checks, which must be satisfied for this
   3.297 +#   VM to be allowed to run on this host's processor type:
   3.298 +#cpuid_check=[ '1:ecx=xxxxxxxxxxxxxxxxxxxxxxxxxx1xxxxx' ]
   3.299 +# - Host must have VMX feature flag set
   3.300 +#
   3.301 +# The format is similar to the above for 'cpuid':
   3.302 +#  '1' -> the bit must be '1'
   3.303 +#  '0' -> the bit must be '0'
   3.304 +#  'x' -> we don't care (do not check)
   3.305 +#  's' -> the bit must be the same as on the host that started this VM
   3.306 +
   3.307 +
   3.308 +#-----------------------------------------------------------------------------
   3.309 +#   Configure PVSCSI devices:
   3.310 +#
   3.311 +#vscsi=[ 'PDEV, VDEV' ]
   3.312 +#
   3.313 +#   PDEV   gives physical SCSI device to be attached to specified guest
   3.314 +#          domain by one of the following identifier format.
   3.315 +#          - XX:XX:XX:XX (4-tuples with decimal notation which shows
   3.316 +#                          "host:channel:target:lun")
   3.317 +#          - /dev/sdxx or sdx
   3.318 +#          - /dev/stxx or stx
   3.319 +#          - /dev/sgxx or sgx
   3.320 +#          - result of 'scsi_id -gu -s'.
   3.321 +#            ex. # scsi_id -gu -s /block/sdb
   3.322 +#                  36000b5d0006a0000006a0257004c0000
   3.323 +#
   3.324 +#   VDEV   gives virtual SCSI device by 4-tuples (XX:XX:XX:XX) as 
   3.325 +#          which the specified guest domain recognize.
   3.326 +#
   3.327 +
   3.328 +#vscsi = [ '/dev/sdx, 0:0:0:0' ]