~ubuntu-branches/ubuntu/utopic/xen/utopic

« back to all changes in this revision

Viewing changes to tools/examples/xmexample.hvm

  • Committer: Bazaar Package Importer
  • Author(s): Bastian Blank
  • Date: 2010-05-06 15:47:38 UTC
  • mto: (1.3.1) (15.1.1 sid) (4.1.1 experimental)
  • mto: This revision was merged to the branch mainline in revision 3.
  • Revision ID: james.westby@ubuntu.com-20100506154738-agoz0rlafrh1fnq7
Tags: upstream-4.0.0
ImportĀ upstreamĀ versionĀ 4.0.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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
#----------------------------------------------------------------------------
 
10
# Kernel image file.
 
11
kernel = "hvmloader"
 
12
 
 
13
# The domain build function. HVM domain uses 'hvm'.
 
14
builder='hvm'
 
15
 
 
16
# Initial memory allocation (in megabytes) for the new domain.
 
17
#
 
18
# WARNING: Creating a domain with insufficient memory may cause out of
 
19
#          memory errors. The domain needs enough memory to boot kernel
 
20
#          and modules. Allocating less than 32MBs is not recommended.
 
21
memory = 128
 
22
 
 
23
# Shadow pagetable memory for the domain, in MB.
 
24
# If not explicictly set, xend will pick an appropriate value.  
 
25
# Should be at least 2KB per MB of domain memory, plus a few MB per vcpu.
 
26
# shadow_memory = 8
 
27
 
 
28
# Whether to transparently share this domain's memory with other domains.
 
29
# default = 0
 
30
# memory_sharing = 0
 
31
 
 
32
# A name for your domain. All domains must have different names.
 
33
name = "ExampleHVMDomain"
 
34
 
 
35
# 128-bit UUID for the domain.  The default behavior is to generate a new UUID
 
36
# on each call to 'xm create'.
 
37
#uuid = "06ed00fe-1162-4fc4-b5d8-11993ee4a8b9"
 
38
 
 
39
#-----------------------------------------------------------------------------
 
40
# The number of cpus guest platform has, default=1
 
41
#vcpus=1
 
42
 
 
43
# Enable/disable HVM guest PAE, default=1 (enabled)
 
44
#pae=1
 
45
 
 
46
# Enable/disable HVM guest ACPI, default=1 (enabled)
 
47
#acpi=1
 
48
 
 
49
# Enable/disable HVM APIC mode, default=1 (enabled)
 
50
# Note that this option is ignored if vcpus > 1
 
51
#apic=1
 
52
 
 
53
# Enable/disable extended power management support within HVM guest, i.e., beyond
 
54
# S3, S4, S5 within guest like exposing battery meter.
 
55
# 0 (default option, extended power management support disabled)
 
56
# 1 (pass-through mode; uses pass-through as needed; efficient but limited in scope)
 
57
# 2 (non pass-through mode; extended scope, likely to work on all applicable environment
 
58
#    but comparitively less efficient than pass-through mode)
 
59
# xen_extended_power_mgmt=0
 
60
 
 
61
# List of which CPUS this domain is allowed to use, default Xen picks
 
62
#cpus = ""         # leave to Xen to pick
 
63
#cpus = "0"        # all vcpus run on CPU0
 
64
#cpus = "0-3,5,^1" # all vcpus run on cpus 0,2,3,5
 
65
#cpus = ["2", "3"] # VCPU0 runs on CPU2, VCPU1 runs on CPU3
 
66
 
 
67
# Optionally define mac and/or bridge for the network interfaces.
 
68
# Random MACs are assigned if not given.
 
69
#vif = [ 'type=ioemu, mac=00:16:3e:00:00:11, bridge=xenbr0, model=ne2k_pci' ]
 
70
# type=ioemu specify the NIC is an ioemu device not netfront
 
71
vif = [ 'type=ioemu, bridge=xenbr0' ]
 
72
 
 
73
#----------------------------------------------------------------------------
 
74
# Define the disk devices you want the domain to have access to, and
 
75
# what you want them accessible as.
 
76
# Each disk entry is of the form phy:UNAME,DEV,MODE
 
77
# where UNAME is the device, DEV is the device name the domain will see,
 
78
# and MODE is r for read-only, w for read-write.
 
79
 
 
80
#disk = [ 'phy:hda1,hda1,r' ]
 
81
disk = [ 'file:/var/images/min-el3-i386.img,hda,w', ',hdc:cdrom,r' ]
 
82
 
 
83
#----------------------------------------------------------------------------
 
84
# Configure the behaviour when a domain exits.  There are three 'reasons'
 
85
# for a domain to stop: poweroff, reboot, and crash.  For each of these you
 
86
# may specify:
 
87
#
 
88
#   "destroy",        meaning that the domain is cleaned up as normal;
 
89
#   "restart",        meaning that a new domain is started in place of the old
 
90
#                     one;
 
91
#   "preserve",       meaning that no clean-up is done until the domain is
 
92
#                     manually destroyed (using xm destroy, for example); or
 
93
#   "rename-restart", meaning that the old domain is not cleaned up, but is
 
94
#                     renamed and a new domain started in its place.
 
95
#
 
96
# In the event a domain stops due to a crash, you have the additional options:
 
97
#
 
98
#   "coredump-destroy", meaning dump the crashed domain's core and then destroy;
 
99
#   "coredump-restart', meaning dump the crashed domain's core and the restart.
 
100
#
 
101
# The default is
 
102
#
 
103
#   on_poweroff = 'destroy'
 
104
#   on_reboot   = 'restart'
 
105
#   on_crash    = 'restart'
 
106
#
 
107
# For backwards compatibility we also support the deprecated option restart
 
108
#
 
109
# restart = 'onreboot' means on_poweroff = 'destroy'
 
110
#                            on_reboot   = 'restart'
 
111
#                            on_crash    = 'destroy'
 
112
#
 
113
# restart = 'always'   means on_poweroff = 'restart'
 
114
#                            on_reboot   = 'restart'
 
115
#                            on_crash    = 'restart'
 
116
#
 
117
# restart = 'never'    means on_poweroff = 'destroy'
 
118
#                            on_reboot   = 'destroy'
 
119
#                            on_crash    = 'destroy'
 
120
 
 
121
#on_poweroff = 'destroy'
 
122
#on_reboot   = 'restart'
 
123
#on_crash    = 'restart'
 
124
 
 
125
#============================================================================
 
126
 
 
127
# Device Model to be used
 
128
device_model = 'qemu-dm'
 
129
 
 
130
#-----------------------------------------------------------------------------
 
131
# boot on floppy (a), hard disk (c), Network (n) or CD-ROM (d) 
 
132
# default: hard disk, cd-rom, floppy
 
133
#boot="cda"
 
134
 
 
135
#-----------------------------------------------------------------------------
 
136
#  write to temporary files instead of disk image files
 
137
#snapshot=1
 
138
 
 
139
#----------------------------------------------------------------------------
 
140
# enable SDL library for graphics, default = 0
 
141
sdl=0
 
142
 
 
143
#----------------------------------------------------------------------------
 
144
# enable OpenGL for texture rendering inside the SDL window, default = 1
 
145
# valid only if sdl is enabled.
 
146
opengl=1
 
147
 
 
148
#----------------------------------------------------------------------------
 
149
# enable VNC library for graphics, default = 1
 
150
vnc=1
 
151
 
 
152
#----------------------------------------------------------------------------
 
153
# address that should be listened on for the VNC server if vnc is set.
 
154
# default is to use 'vnc-listen' setting from
 
155
# auxbin.xen_configdir() + /xend-config.sxp
 
156
#vnclisten="127.0.0.1"
 
157
 
 
158
#----------------------------------------------------------------------------
 
159
# set VNC display number, default = domid
 
160
#vncdisplay=1
 
161
 
 
162
#----------------------------------------------------------------------------
 
163
# try to find an unused port for the VNC server, default = 1
 
164
#vncunused=1
 
165
 
 
166
#----------------------------------------------------------------------------
 
167
# set password for domain's VNC console
 
168
# default is depents on vncpasswd in xend-config.sxp
 
169
vncpasswd=''
 
170
 
 
171
#----------------------------------------------------------------------------
 
172
# no graphics, use serial port
 
173
#nographic=0
 
174
 
 
175
#----------------------------------------------------------------------------
 
176
# enable stdvga, default = 0 (use cirrus logic device model)
 
177
stdvga=0
 
178
 
 
179
#-----------------------------------------------------------------------------
 
180
#   serial port re-direct to pty deivce, /dev/pts/n 
 
181
#   then xm console or minicom can connect
 
182
serial='pty'
 
183
 
 
184
#----------------------------------------------------------------------------
 
185
#   tsc_mode : TSC mode (0=default, 1=native TSC, 2=never emulate, 3=pvrdtscp)
 
186
#   emulate TSC provides synced TSC for all vcpus, but lose perfomrance.
 
187
#   native TSC leverages hardware's TSC(no perf loss), but vcpu's TSC may lose
 
188
#    sync due to hardware's unreliable/unsynced TSC between CPUs.
 
189
#   default intelligently uses native TSC on machines where it is safe, but
 
190
#    switches to emulated if necessary after save/restore/migration
 
191
#   pvrdtscp is for intelligent apps that use special Xen-only paravirtualized
 
192
#    cpuid instructions to obtain offset/scaling/migration info and maximize
 
193
#    performance within pools of machines that support the rdtscp instruction
 
194
tsc_mode=0
 
195
 
 
196
#-----------------------------------------------------------------------------
 
197
#   Qemu Monitor, default is disable
 
198
#   Use ctrl-alt-2 to connect
 
199
#monitor=1
 
200
 
 
201
 
 
202
#-----------------------------------------------------------------------------
 
203
#   enable sound card support, [sb16|es1370|all|..,..], default none
 
204
#soundhw='sb16'
 
205
 
 
206
 
 
207
#-----------------------------------------------------------------------------
 
208
#    set the real time clock to local time [default=0 i.e. set to utc]
 
209
#localtime=1
 
210
 
 
211
 
 
212
#-----------------------------------------------------------------------------
 
213
#    set the real time clock offset in seconds [default=0 i.e. same as dom0]
 
214
#rtc_timeoffset=3600
 
215
 
 
216
#-----------------------------------------------------------------------------
 
217
#    start in full screen
 
218
#full-screen=1   
 
219
 
 
220
 
 
221
#-----------------------------------------------------------------------------
 
222
#   Enable USB support (specific devices specified at runtime through the
 
223
#                       monitor window)
 
224
#usb=1
 
225
 
 
226
#   Enable USB mouse support (only enable one of the following, `mouse' for
 
227
#                             PS/2 protocol relative mouse, `tablet' for
 
228
#                             absolute mouse)
 
229
#usbdevice='mouse'
 
230
#usbdevice='tablet'
 
231
 
 
232
#-----------------------------------------------------------------------------
 
233
#   Set keyboard layout, default is en-us keyboard. 
 
234
#keymap='ja'
 
235
 
 
236
#-----------------------------------------------------------------------------
 
237
#   Enable/disable xen platform PCI device, default=1 (enabled)
 
238
#xen_platform_pci=1
 
239
 
 
240
#-----------------------------------------------------------------------------
 
241
#   Configure guest CPUID responses:
 
242
#
 
243
#cpuid=[ '1:ecx=xxxxxxxxxxx00xxxxxxxxxxxxxxxxxxx,
 
244
#           eax=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' ]
 
245
# - Unset the SSE4 features (CPUID.1[ECX][20-19])
 
246
# - Default behaviour for all other bits in ECX And EAX registers.
 
247
 
248
# Each successive character represent a lesser-significant bit:
 
249
#  '1' -> force the corresponding bit to 1
 
250
#  '0' -> force to 0
 
251
#  'x' -> Get a safe value (pass through and mask with the default policy)
 
252
#  'k' -> pass through the host bit value
 
253
#  's' -> as 'k' but preserve across save/restore and migration
 
254
 
255
#   Expose to the guest multi-core cpu instead of multiple processors
 
256
# Example for intel, expose a 8-core processor :
 
257
#cpuid=['1:edx=xxx1xxxxxxxxxxxxxxxxxxxxxxxxxxxx,
 
258
#          ebx=xxxxxxxx00010000xxxxxxxxxxxxxxxx',
 
259
#     '4,0:eax=001111xxxxxxxxxxxxxxxxxxxxxxxxxx']
 
260
#  - CPUID.1[EDX][HT] : Enable HT
 
261
#  - CPUID.1[EBX] : Number of vcpus * 2
 
262
#  - CPUID.4,0[EAX] : Number of vcpus * 2 - 1
 
263
#vcpus=8
 
264
#
 
265
# Example for amd, expose a 5-core processor :
 
266
# cpuid = ['1:ebx=xxxxxxxx00001010xxxxxxxxxxxxxxxx,
 
267
#             edx=xxx1xxxxxxxxxxxxxxxxxxxxxxxxxxxx',
 
268
# '0x80000001:ecx=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx1x',
 
269
# '0x80000008:ecx=xxxxxxxxxxxxxxxxxxxxxxxxxx001001']
 
270
#   - CPUID.1[EBX] : Threads per Core * Cores per Socket (2 * #vcpus)
 
271
#   - CPUID.1[EDX][HT] : Enable HT
 
272
#   - CPUID.0x80000001[CmpLegacy] : Use legacy method
 
273
#   - CPUID.0x80000008[ECX] : #vcpus * 2 - 1
 
274
#vcpus=5
 
275
#
 
276
#  Downgrade the cpuid to make a better compatibility for migration :
 
277
# Look like a generic 686 :
 
278
# cpuid = [ '0:eax=0x3,ebx=0x0,ecx=0x0,edx=0x0',
 
279
#           '1:eax=0x06b1,
 
280
#              ecx=xxxxxxxxxxx0000xx00xxx0000000xx0,
 
281
#              edx=xxx00000xxxxxxx0xxxxxxxxx0xxxxxx',
 
282
#           '4:eax=0x3,ebx=0x0,ecx=0x0,edx=0x0',
 
283
#  '0x80000000:eax=0x3,ebx=0x0,ecx=0x0,edx=0x0']
 
284
#  with the highest leaf
 
285
#  - CPUID.0[EAX] : Set the highest leaf
 
286
#  - CPUID.1[EAX] : 686 
 
287
#  - CPUID.1[ECX] : Mask some features
 
288
#  - CPUID.1[EDX] : Mask some features
 
289
#  - CPUID.4 : Reply like the highest leaf, in our case CPUID.3
 
290
#  - CPUID.0x80000000 : No extension we are on a Pentium III, reply like the
 
291
#  highest leaf (CPUID.3).
 
292
#
 
293
#   Configure host CPUID consistency checks, which must be satisfied for this
 
294
#   VM to be allowed to run on this host's processor type:
 
295
#cpuid_check=[ '1:ecx=xxxxxxxxxxxxxxxxxxxxxxxxxx1xxxxx' ]
 
296
# - Host must have VMX feature flag set
 
297
#
 
298
# The format is similar to the above for 'cpuid':
 
299
#  '1' -> the bit must be '1'
 
300
#  '0' -> the bit must be '0'
 
301
#  'x' -> we don't care (do not check)
 
302
#  's' -> the bit must be the same as on the host that started this VM
 
303
 
 
304
#-----------------------------------------------------------------------------
 
305
#   Configure passthrough PCI{,-X,e} devices:
 
306
#
 
307
#   pci=[ '[SSSS:]BB:DD.F[,option1[,option2[...]]]', ... ]
 
308
#
 
309
#   [SSSS]:BB:DD.F  "bus segment:bus:device.function"(1) of the device to
 
310
#                   be assigned, bus segment is optional. All fields are
 
311
#                   in hexadecimal and no field should be longer than that
 
312
#                   as shown in the pattern. Successful assignment may need
 
313
#                   certain hardware support and additional configurations
 
314
#                   (e.g. VT-d, see docs/misc/vtd.txt for more details).
 
315
#
 
316
#       (1) bus segment is sometimes also referred to as the PCI "domain",
 
317
#           not to be confused with Xen domain.
 
318
#
 
319
#
 
320
#   optionN         per-device options in "key=val" format. Current
 
321
#                   available options are:
 
322
#                   - msitranslate=0|1
 
323
#                      per-device overriden of pci_msitranslate, see below
 
324
#                   - power_mgmt=0|1
 
325
#                      per-device overriden of pci_power_mgmt, see below
 
326
#
 
327
#pci=[ '07:00.0', '07:00.1' ]
 
328
 
 
329
#   MSI-INTx translation for MSI capable devices:
 
330
#
 
331
#   If it's set, Xen will enable MSI for the device that supports it even
 
332
# if the guest don't use MSI. In the case, an IO-APIC type interrupt will
 
333
# be injected to the guest every time a corresponding MSI message is
 
334
# received.
 
335
#   If the guest enables MSI or MSI-X, the translation is automatically
 
336
# turned off.
 
337
 
338
#pci_msitranslate=1
 
339
 
 
340
#   PCI Power Management:
 
341
#
 
342
#   If it's set, the guest OS will be able to program D0-D3hot states of the
 
343
# PCI device for the purpose of low power consumption.
 
344
 
345
#pci_power_mgmt=0
 
346
 
 
347
#   Enable graphics passthrough:
 
348
#
 
349
#   If it's set, and specify grapchis device BDF in pci passthrough option,
 
350
# like pci=['xx:xx.x'], it enables graphics passthrough, default=0 (disabled)
 
351
#gfx_passthru=0
 
352
 
 
353
#-----------------------------------------------------------------------------
 
354
#   Configure PVSCSI devices:
 
355
#
 
356
#vscsi=[ 'PDEV, VDEV' ]
 
357
#
 
358
#   PDEV   gives physical SCSI device to be attached to specified guest
 
359
#          domain by one of the following identifier format.
 
360
#          - XX:XX:XX:XX (4-tuples with decimal notation which shows
 
361
#                          "host:channel:target:lun")
 
362
#          - /dev/sdxx or sdx
 
363
#          - /dev/stxx or stx
 
364
#          - /dev/sgxx or sgx
 
365
#          - result of 'scsi_id -gu -s'.
 
366
#            ex. # scsi_id -gu -s /block/sdb
 
367
#                  36000b5d0006a0000006a0257004c0000
 
368
#
 
369
#   VDEV   gives virtual SCSI device by 4-tuples (XX:XX:XX:XX) as 
 
370
#          which the specified guest domain recognize.
 
371
#
 
372
 
 
373
#vscsi = [ '/dev/sdx, 0:0:0:0' ]