ia64/xen-unstable

view docs/src/user/start_addl_dom.tex @ 7727:d7bcc7bbf981

Fix region0 virtual accesses
Signed-off by: Dan Magenheimer <dan.magenheimer@hp.com>
author djm@kirby.fc.hp.com
date Fri Nov 11 12:51:08 2005 -0600 (2005-11-11)
parents 06d84bf87159
children 79e8991af6b4
line source
1 \chapter{Starting Additional Domains}
3 The first step in creating a new domain is to prepare a root
4 filesystem for it to boot from. Typically, this might be stored in a
5 normal partition, an LVM or other volume manager partition, a disk
6 file or on an NFS server. A simple way to do this is simply to boot
7 from your standard OS install CD and install the distribution into
8 another partition on your hard drive.
10 To start the \xend\ control daemon, type
11 \begin{quote}
12 \verb!# xend start!
13 \end{quote}
15 If you wish the daemon to start automatically, see the instructions in
16 Section~\ref{s:xend}. Once the daemon is running, you can use the
17 \path{xm} tool to monitor and maintain the domains running on your
18 system. This chapter provides only a brief tutorial. We provide full
19 details of the \path{xm} tool in the next chapter.
21 % \section{From the web interface}
22 %
23 % Boot the Xen machine and start Xensv (see Chapter~\ref{cha:xensv}
24 % for more details) using the command: \\
25 % \verb_# xensv start_ \\
26 % This will also start Xend (see Chapter~\ref{cha:xend} for more
27 % information).
28 %
29 % The domain management interface will then be available at {\tt
30 % http://your\_machine:8080/}. This provides a user friendly wizard
31 % for starting domains and functions for managing running domains.
32 %
33 % \section{From the command line}
36 \section{Creating a Domain Configuration File}
38 Before you can start an additional domain, you must create a
39 configuration file. We provide two example files which you can use as
40 a starting point:
41 \begin{itemize}
42 \item \path{/etc/xen/xmexample1} is a simple template configuration
43 file for describing a single VM.
45 \item \path{/etc/xen/xmexample2} file is a template description that
46 is intended to be reused for multiple virtual machines. Setting the
47 value of the \path{vmid} variable on the \path{xm} command line
48 fills in parts of this template.
49 \end{itemize}
51 Copy one of these files and edit it as appropriate. Typical values
52 you may wish to edit include:
54 \begin{quote}
55 \begin{description}
56 \item[kernel] Set this to the path of the kernel you compiled for use
57 with Xen (e.g.\ \path{kernel = `/boot/vmlinuz-2.6-xenU'})
58 \item[memory] Set this to the size of the domain's memory in megabytes
59 (e.g.\ \path{memory = 64})
60 \item[disk] Set the first entry in this list to calculate the offset
61 of the domain's root partition, based on the domain ID. Set the
62 second to the location of \path{/usr} if you are sharing it between
63 domains (e.g.\ \path{disk = [`phy:your\_hard\_drive\%d,sda1,w' \%
64 (base\_partition\_number + vmid),
65 `phy:your\_usr\_partition,sda6,r' ]}
66 \item[dhcp] Uncomment the dhcp variable, so that the domain will
67 receive its IP address from a DHCP server (e.g.\ \path{dhcp=`dhcp'})
68 \end{description}
69 \end{quote}
71 You may also want to edit the {\bf vif} variable in order to choose
72 the MAC address of the virtual ethernet interface yourself. For
73 example:
74 \begin{quote}
75 \verb_vif = [`mac=00:06:AA:F6:BB:B3']_
76 \end{quote}
77 If you do not set this variable, \xend\ will automatically generate a
78 random MAC address from an unused range.
81 \section{Booting the Domain}
83 The \path{xm} tool provides a variety of commands for managing
84 domains. Use the \path{create} command to start new domains. Assuming
85 you've created a configuration file \path{myvmconf} based around
86 \path{/etc/xen/xmexample2}, to start a domain with virtual machine
87 ID~1 you should type:
89 \begin{quote}
90 \begin{verbatim}
91 # xm create -c myvmconf vmid=1
92 \end{verbatim}
93 \end{quote}
95 The \path{-c} switch causes \path{xm} to turn into the domain's
96 console after creation. The \path{vmid=1} sets the \path{vmid}
97 variable used in the \path{myvmconf} file.
99 You should see the console boot messages from the new domain appearing
100 in the terminal in which you typed the command, culminating in a login
101 prompt.
104 \section{Example: ttylinux}
106 Ttylinux is a very small Linux distribution, designed to require very
107 few resources. We will use it as a concrete example of how to start a
108 Xen domain. Most users will probably want to install a full-featured
109 distribution once they have mastered the basics\footnote{ttylinux is
110 maintained by Pascal Schmidt. You can download source packages from
111 the distribution's home page: {\tt
112 http://www.minimalinux.org/ttylinux/}}.
114 \begin{enumerate}
115 \item Download and extract the ttylinux disk image from the Files
116 section of the project's SourceForge site (see
117 \path{http://sf.net/projects/xen/}).
118 \item Create a configuration file like the following:
119 \begin{verbatim}
120 kernel = "/boot/vmlinuz-2.6-xenU"
121 memory = 64
122 name = "ttylinux"
123 nics = 1
124 ip = "1.2.3.4"
125 disk = ['file:/path/to/ttylinux/rootfs,sda1,w']
126 root = "/dev/sda1 ro"
127 \end{verbatim}
128 \item Now start the domain and connect to its console:
129 \begin{verbatim}
130 xm create configfile -c
131 \end{verbatim}
132 \item Login as root, password root.
133 \end{enumerate}
136 \section{Starting / Stopping Domains Automatically}
138 It is possible to have certain domains start automatically at boot
139 time and to have dom0 wait for all running domains to shutdown before
140 it shuts down the system.
142 To specify a domain is to start at boot-time, place its configuration
143 file (or a link to it) under \path{/etc/xen/auto/}.
145 A Sys-V style init script for Red Hat and LSB-compliant systems is
146 provided and will be automatically copied to \path{/etc/init.d/}
147 during install. You can then enable it in the appropriate way for
148 your distribution.
150 For instance, on Red Hat:
152 \begin{quote}
153 \verb_# chkconfig --add xendomains_
154 \end{quote}
156 By default, this will start the boot-time domains in runlevels 3, 4
157 and 5.
159 You can also use the \path{service} command to run this script
160 manually, e.g:
162 \begin{quote}
163 \verb_# service xendomains start_
165 Starts all the domains with config files under /etc/xen/auto/.
166 \end{quote}
168 \begin{quote}
169 \verb_# service xendomains stop_
171 Shuts down ALL running Xen domains.
172 \end{quote}