1OZ-EXAMPLES(1)              General Commands Manual             OZ-EXAMPLES(1)
2
3
4

NAME

6       oz-examples - example TDL files for Oz.
7
8

DESCRIPTION

10       The  oz-install(1)  ,  oz-customize(1)  , and oz-generate-icicle(1) man
11       pages explain the command-line usage of the Oz commands.   One  of  the
12       required  input  parameters to all of the above commands is a TDL (Tem‐
13       plate Description Language) file, which describes the OS the user wants
14       to install, where to get the media from, and any additional packages or
15       actions the user wants to take on the operating system.  This man  page
16       describes a number of TDL examples and what happens when they are used.
17       Since the TDL is XML, standard XPath notation is used to describe vari‐
18       ous elements of the XML.
19
20

EXAMPLE 1 - Minimal guest

22       Assume  we  want to install a minimal Fedora 13 x86_64 operating system
23       from   a    Fedora    13    DVD    ISO    located    at    http://exam
24       ple.org/fedora-13-x86_64.iso
25
26       To  do  this install we first build a TDL XML file, then feed it to oz-
27       install. The TDL file would look like:
28
29            <template>
30              <name>fedora13_x86_64</name>
31                <os>
32                  <name>Fedora</name>
33                  <version>13</version>
34                  <arch>x86_64</arch>
35                  <install type='iso'>
36                    <iso>http://example.org/fedora-13-x86_64.iso</iso>
37                  </install>
38                </os>
39              <description>My Fedora 13 x86_64 template</description>
40            </template>
41
42       /template/name is a user-defined name.  This can be anything  the  user
43       wants, but must be unique among all TDLs the user wants to build.
44
45       /template/os/name  is  the  name  of  the  operating  system we want to
46       install,  /template/os/version  is  the  version  we  want,  and  /tem‐
47       plate/os/arch  is  the  architecture we want.  A full list of supported
48       operating systems can be obtained by running:
49
50              # oz-install -h
51
52       /template/os/install tells Oz where to get the installation media from.
53       In this example, we set type to 'iso' which means that we need an <iso>
54       element in the XML pointing to the ISO install media  (install  methods
55       other than ISO are supported, and described in other examples).
56
57       /template/description is an optional, human-readable description of the
58       template.  This can be anything the user wants, and is ignored by Oz.
59
60       That's all of the input that Oz needs.  To actually  do  the  installa‐
61       tion,  save  the  above  to a file (say fedora13.tdl), and then run oz-
62       install:
63
64              # oz-install /path/to/fedora13.tdl
65
66       Running this command will download and prepare the installation  media,
67       then  run  an  automated  install in a KVM guest.  Assuming the install
68       succeeds, the minimal operating system will be installed on a  file  in
69       /var/lib/libvirt/images/fedora13_x86_64.dsk  (by  default,  the  output
70       location can be overridden in the configuration file).
71
72

EXAMPLE 2 - Guest with additional packages

74       Assume we want to install a Fedora 14 x86_64 operating  system  from  a
75       Fedora 14 DVD ISO located at http://example.org/fedora-14-x86_64.iso
76
77       Additionally assume we want to install the postgresql-server package on
78       the operating system.  To do this install, we first need to build a TDL
79       XML  file  and  then  feed that to oz-install.  The TDL file would look
80       like:
81
82            <template>
83              <name>fedora14_postgres</name>
84              <os>
85                <name>Fedora</name>
86                <version>14</version>
87                <arch>x86_64</arch>
88                <install type='iso'>
89                  <iso>http://example.org/fedora-14-x86_64.iso</iso>
90                </install>
91              </os>
92              <description>Fedora 14 x86_64 with postgres</description>
93              <packages>
94                <package name='postgresql-server'/>
95              </packages>
96            </template>
97
98       Notice that this is very similar to Example 1, except we  specified  an
99       additional  package to be installed in the /packages/package portion of
100       the TDL.  Multiple packages can be specified here, and they will all be
101       installed  on  the operating system.  In this example, all packages are
102       downloaded and installed from  the  default  operating  system  package
103       repositories.   Running  the  installation  is  done the same way as in
104       Example 1, except we have to add a command-line parameter  to  actually
105       do the customization:
106
107              # oz-install -u /path/to/fedora14.tdl
108
109       Running  this command will download and prepare the installation media,
110       then run an automated install in a KVM guest.
111
112       Assuming the initial install succeeds, Oz will then boot the  operating
113       system and run native commands to install the additional packages.  For
114       more information about why this approach is used,  please  see  the  Oz
115       Architecture   document   at  http://github.com/clalancette/oz/wiki/Oz-
116       architecture.
117
118       Assuming this final step succeeds, the operating system with the  addi‐
119       tional   packages   will  be  installed  on  a  file  in  /var/lib/lib‐
120       virt/images/fedora14_postgres.dsk (by default, the output location  can
121       be overridden in the configuration file).
122
123

EXAMPLE 3 - Generate a package manifest (ICICLE) after installation

125       Assume  we  want  to  install  a  RHEL-5 x86_64 operating system from a
126       RHEL-5 DVD ISO located at http://example.org/rhel-5-x86_64.iso
127
128       Additionally assume we want to get a package manifest out of the  oper‐
129       ating  system  after the install is done.  To do this install, we first
130       need to build a TDL XML file and then feed that to oz-install. The  TDL
131       file would look like:
132
133            <template>
134              <name>rhel5_x86_64</name>
135              <os>
136                <name>RHEL-5</name>
137                <version>U6</version>
138                <arch>x86_64</arch>
139                <install type='iso'>
140                  <iso>http://example.org/rhel-5-x86_64.iso</iso>
141                </install>
142              </os>
143              <description>RHEL-5 x86_64</description>
144            </template>
145
146       This  is  essentially  the same as Example 1, except we want to install
147       RHEL-5 instead of Fedora-13.
148
149       Running the installation is done the same was as in Example  1,  except
150       we have to add a command-line parameter to generate the manifest at the
151       end:
152
153              # oz-install -g /path/to/rhel5.tdl
154
155       Running this command will download and prepare the installation  media,
156       then run an automated install in a KVM guest.
157
158       Assuming  the initial install succeeds, Oz will then boot the operating
159       system and run native commands to query all of the packages in the sys‐
160       tem.  It will then output an XML document (called an ICICLE) describing
161       the entire manifest.
162
163       Assuming this step succeeds,  the  minimal  operating  system  will  be
164       install  on  a  file  in  /var/lib/libvirt/images/rhel5_x86_64.dsk  (by
165       default, the output location can be  overridden  in  the  configuration
166       file).
167
168

EXAMPLE 4 - Install a package from an alternate repository

170       Assume  we  want  to  install  a  RHEL-6 x86_64 operating system from a
171       RHEL-6 DVD ISO located at http://example.org/rhel-6-x86_64.iso
172
173       Additionally assume that we want to install the ccache package from the
174       EPEL-6  repositories  on  the operating system.  To do this install, we
175       first need to build a TDL XML file and then feed  that  to  oz-install.
176       The TDL file would look like:
177
178            <template>
179              <name>rhel6_ccache</name>
180              <os>
181                <name>RHEL-6</name>
182                <version>1</version>
183                <arch>x86_64</arch>
184                <install type='iso'>
185                  <iso>http://example.org/rhel-6-x86_64.iso</iso>
186                </install>
187              </os>
188              <description>RHEL-6 x86_64 with ccache</description>
189              <repositories>
190                <repository name='epel-6'>
191                  <url>http://download.fedorapro
192           ject.org/pub/epel/6/$basearch</url>
193                  <signed>yes</signed>
194                </repository>
195              </repositories>
196              <packages>
197                <package name='ccache'/>
198              </packages>
199            </template>
200
201       Notice that this is very similar to Example 2, except we have specified
202       an additional repository from which to download packages.  The /reposi‐
203       tories/repository section of the TDL specified the URL to  the  package
204       repository  along  with  whether  the  packages  in  the repository are
205       signed.  Running the installation is done the same way as in Example 2:
206
207              # oz-install -u /path/to/rhel6_ccache.tdl
208
209       Running this command will download and prepare the installation  media,
210       then run an automated install in a KVM guest.
211
212       Assuming  the initial install succeeds, Oz will then boot the operating
213       system and run native commands to setup the additional repositories and
214       install  the  additional packages.  For more information about why this
215       approach  is  used,  please  see  the  Oz  Architecture   document   at
216       http://github.com/clalancette/oz/wiki/Oz-architecture.
217
218       Assuming  this final step succeeds, the operating system with the addi‐
219       tional  packages  will  be  installed  on  a  file   in   /var/lib/lib‐
220       virt/images/rhel6_ccache.dsk  (by  default,  the output location can be
221       overridden in the configuration file).
222
223

EXAMPLE 5 - Install a custom file from information in the TDL

225       Assume we want to install a  RHEL-6  x86_64  operating  system  from  a
226       RHEL-6 DVD ISO located at http://example.org/rhel-6-x86_64.iso
227
228       Additionally  assume  that  we  want  to  write  some  data to the file
229       /etc/test.out inside the guest.  To do this install, we first  need  to
230       build  a  TDL  XML file and then feed that to oz-install.  The TDL file
231       would look like:
232
233            <template>
234              <name>rhel6_testout</name>
235              <os>
236                <name>RHEL-6</name>
237                <version>1</version>
238                <arch>x86_64</arch>
239                <install type='iso'>
240                  <iso>http://example.org/rhel-6-x86_64.iso</iso>
241                </install>
242              </os>
243              <description>RHEL-6 x86_64 with test.out</description>
244              <files>
245                <file name='/etc/test.out'>THIS=extra_data</file>
246              </files>
247            </template>
248
249       Multiple files can be specified here, and they will all be installed on
250       the  operating  system in the specified locations.  Files can be speci‐
251       fied inline in raw text in the TDL, as base64 encoded data in the  TDL,
252       or  as  URLs.   We  need to run the installation with customization for
253       this to work:
254
255              # oz-install -u /path/to/rhel6_testout.tdl
256
257       Running this command will download and prepare the installation  media,
258       then run an automated install in a KVM guest.
259
260       Assuming  the initial install succeeds, Oz will then boot the operating
261       system and run native commands to upload the  files  specified  in  the
262       TDL.   For more information about why this approach is used, please see
263       the           Oz           Architecture           document           at
264       http://github.com/clalancette/oz/wiki/Oz-architecture.
265
266       Assuming  this final step succeeds, the operating system with the addi‐
267       tional  files  will  be  installed   on   a   file   in   /var/lib/lib‐
268       virt/images/rhel6_testout.dsk  (by  default, the output location can be
269       overridden in the configuration file).
270
271

EXAMPLE 6 - Install a custom file from base64-encoded information in the TDL

273       Assume we want to install a  RHEL-6  x86_64  operating  system  from  a
274       RHEL-6 DVD ISO located at http://example.org/rhel-6-x86_64.iso
275
276       Additionally  assume  that  we  want  to  write  some  data to the file
277       /etc/test.out inside the guest.  Since this data may be binary, we want
278       to  base64 encode it first.  To do this install, we first need to build
279       a TDL XML file and then feed that to oz-install.  The  TDL  file  would
280       look like:
281
282            <template>
283              <name>rhel6_testout</name>
284              <os>
285                <name>RHEL-6</name>
286                <version>1</version>
287                <arch>x86_64</arch>
288                <install type='iso'>
289                  <iso>http://example.org/rhel-6-x86_64.iso</iso>
290                </install>
291              </os>
292              <description>RHEL-6 x86_64 with test.out</description>
293              <files>
294                <file                                     name='/etc/test.out'
295           type='base64'>VEhJUz1leHRyYV9kYXRhCg==</file>
296              </files>
297            </template>
298
299       Multiple files can be specified here, and they will all be installed on
300       the  operating  system in the specified locations.  Files can be speci‐
301       fied inline in raw text in the TDL, as base64 encoded data in the  TDL,
302       or  as  URLs.   We  need to run the installation with customization for
303       this to work:
304
305              # oz-install -u /path/to/rhel6_testout.tdl
306
307       Running this command will download and prepare the installation  media,
308       then run an automated install in a KVM guest.
309
310       Assuming  the initial install succeeds, Oz will then boot the operating
311       system and run native commands to upload the  files  specified  in  the
312       TDL.   For more information about why this approach is used, please see
313       the           Oz           Architecture           document           at
314       http://github.com/clalancette/oz/wiki/Oz-architecture.
315
316       Assuming  this final step succeeds, the operating system with the addi‐
317       tional  files  will  be  installed   on   a   file   in   /var/lib/lib‐
318       virt/images/rhel6_testout.dsk  (by  default, the output location can be
319       overridden in the configuration file).
320
321

EXAMPLE 7 - Install a custom file from a URL

323       Assume we want to install a  RHEL-6  x86_64  operating  system  from  a
324       RHEL-6 DVD ISO located at http://example.org/rhel-6-x86_64.iso
325
326       Additionally  assume  that  we  want  to  write  some  data to the file
327       /etc/test.out inside the guest.  We want to fetch this data from a  URL
328       and  upload into the guest.  To do this install, we first need to build
329       a TDL XML file and then feed that to oz-install.  The  TDL  file  would
330       look like:
331
332            <template>
333              <name>rhel6_testout</name>
334              <os>
335                <name>RHEL-6</name>
336                <version>1</version>
337                <arch>x86_64</arch>
338                <install type='iso'>
339                  <iso>http://example.org/rhel-6-x86_64.iso</iso>
340                </install>
341              </os>
342              <description>RHEL-6 x86_64 with test.out</description>
343              <files>
344                <file       name='/etc/test.out'       type='url'>http://exam
345           ple.org/orig.out</file>
346              </files>
347            </template>
348
349       Multiple files can be specified here, and they will all be installed on
350       the  operating  system in the specified locations.  Files can be speci‐
351       fied inline in raw text in the TDL, as base64 encoded data in the  TDL,
352       or  as  URLs.   We  need to run the installation with customization for
353       this to work:
354
355              # oz-install -u /path/to/rhel6_testout.tdl
356
357       Running this command will download and prepare the installation  media,
358       then run an automated install in a KVM guest.
359
360       Assuming  the initial install succeeds, Oz will then boot the operating
361       system and run native commands to upload the  files  specified  in  the
362       TDL.   For more information about why this approach is used, please see
363       the           Oz           Architecture           document           at
364       http://github.com/clalancette/oz/wiki/Oz-architecture.
365
366       Assuming  this final step succeeds, the operating system with the addi‐
367       tional  files  will  be  installed   on   a   file   in   /var/lib/lib‐
368       virt/images/rhel6_testout.dsk  (by  default, the output location can be
369       overridden in the configuration file).
370
371

SEE ALSO

373       oz-install(1),  oz-generate-icicle(1),   oz-customize(1),   oz-cleanup-
374       cache(1)
375
376

AUTHOR

378       Chris Lalancette <clalancette@gmail.com>
379
380
381
382oz-examples                        July 2013                    OZ-EXAMPLES(1)
Impressum