1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394
|
.TH OZ-EXAMPLES 1 "July 2013" "oz-examples"
.SH NAME
oz-examples - example TDL files for Oz.
.SH DESCRIPTION
The
.I oz-install(1)
,
.I oz-customize(1)
, and
.I oz-generate-icicle(1)
man pages explain the command-line usage of the Oz commands. One of
the required input parameters to all of the above commands is a TDL
(Template Description Language) file, which describes the OS the user
wants to install, where to get the media from, and any additional
packages or actions the user wants to take on the operating system.
This man page describes a number of TDL examples and what happens when
they are used. Since the TDL is XML, standard XPath notation is used
to describe various elements of the XML.
.SH EXAMPLE 1 - Minimal guest
Assume we want to install a minimal Fedora 13 x86_64 operating system
from a Fedora 13 DVD ISO located at http://example.org/fedora-13-x86_64.iso
To do this install we first build a TDL XML file, then feed it to
oz-install. The TDL file would look like:
.in +4n
<template>
<name>fedora13_x86_64</name>
<os>
<name>Fedora</name>
<version>13</version>
<arch>x86_64</arch>
<install type='iso'>
<iso>http://example.org/fedora-13-x86_64.iso</iso>
</install>
</os>
<description>My Fedora 13 x86_64 template</description>
</template>
.in
/template/name is a user-defined name. This can be anything the user
wants, but must be unique among all TDLs the user wants to build.
/template/os/name is the name of the operating system we want to
install, /template/os/version is the version we want, and
/template/os/arch is the architecture we want. A full list of
supported operating systems can be obtained by running:
.RS
# oz-install -h
.RE
/template/os/install tells Oz where to get the installation media
from. In this example, we set type to 'iso' which means that we need
an <iso> element in the XML pointing to the ISO install media (install
methods other than ISO are supported, and described in other examples).
/template/description is an optional, human-readable description of
the template. This can be anything the user wants, and is ignored by Oz.
That's all of the input that Oz needs. To actually do the
installation, save the above to a file (say fedora13.tdl), and then
run oz-install:
.RS
# oz-install /path/to/fedora13.tdl
.RE
Running this command will download and prepare the installation media,
then run an automated install in a KVM guest. Assuming the install
succeeds, the minimal operating system will be installed on a file in
/var/lib/libvirt/images/fedora13_x86_64.dsk (by default, the output
location can be overridden in the configuration file).
.SH EXAMPLE 2 - Guest with additional packages
Assume we want to install a Fedora 14 x86_64 operating system from a
Fedora 14 DVD ISO located at http://example.org/fedora-14-x86_64.iso
Additionally assume we want to install the postgresql-server package
on the operating system. To do this install, we first need to build a
TDL XML file and then feed that to oz-install. The TDL file would look like:
.in +4n
<template>
<name>fedora14_postgres</name>
<os>
<name>Fedora</name>
<version>14</version>
<arch>x86_64</arch>
<install type='iso'>
<iso>http://example.org/fedora-14-x86_64.iso</iso>
</install>
</os>
<description>Fedora 14 x86_64 with postgres</description>
<packages>
<package name='postgresql-server'/>
</packages>
</template>
.in
Notice that this is very similar to Example 1, except we specified an
additional package to be installed in the /packages/package portion of
the TDL. Multiple packages can be specified here, and they will all
be installed on the operating system. In this example, all packages
are downloaded and installed from the default operating system package
repositories. Running the installation is done the same way as in
Example 1, except we have to add a command-line parameter to actually
do the customization:
.RS
# oz-install -u /path/to/fedora14.tdl
.RE
Running this command will download and prepare the installation media,
then run an automated install in a KVM guest.
Assuming the initial install succeeds, Oz will then boot the operating
system and run native commands to install the additional packages.
For more information about why this approach is used, please see the
Oz Architecture document at
http://github.com/clalancette/oz/wiki/Oz-architecture.
Assuming this final step succeeds, the operating system with the
additional packages will be installed on a file in
/var/lib/libvirt/images/fedora14_postgres.dsk (by default, the output
location can be overridden in the configuration file).
.SH EXAMPLE 3 - Generate a package manifest (ICICLE) after installation
Assume we want to install a RHEL-5 x86_64 operating system from a
RHEL-5 DVD ISO located at http://example.org/rhel-5-x86_64.iso
Additionally assume we want to get a package manifest out of the
operating system after the install is done. To do this install, we
first need to build a TDL XML file and then feed that to
oz-install. The TDL file would look like:
.in +4n
<template>
<name>rhel5_x86_64</name>
<os>
<name>RHEL-5</name>
<version>U6</version>
<arch>x86_64</arch>
<install type='iso'>
<iso>http://example.org/rhel-5-x86_64.iso</iso>
</install>
</os>
<description>RHEL-5 x86_64</description>
</template>
.in
This is essentially the same as Example 1, except we want to install
RHEL-5 instead of Fedora-13.
Running the installation is done the same was as in Example 1, except
we have to add a command-line parameter to generate the manifest at the end:
.RS
# oz-install -g /path/to/rhel5.tdl
.RE
Running this command will download and prepare the installation media,
then run an automated install in a KVM guest.
Assuming the initial install succeeds, Oz will then boot the operating
system and run native commands to query all of the packages in the
system. It will then output an XML document (called an ICICLE)
describing the entire manifest.
Assuming this step succeeds, the minimal operating system will be
install on a file in /var/lib/libvirt/images/rhel5_x86_64.dsk (by
default, the output location can be overridden in the configuration file).
.SH EXAMPLE 4 - Install a package from an alternate repository
Assume we want to install a RHEL-6 x86_64 operating system from a
RHEL-6 DVD ISO located at http://example.org/rhel-6-x86_64.iso
Additionally assume that we want to install the ccache package from
the EPEL-6 repositories on the operating system. To do this install,
we first need to build a TDL XML file and then feed that to
oz-install. The TDL file would look like:
.in +4n
<template>
<name>rhel6_ccache</name>
<os>
<name>RHEL-6</name>
<version>1</version>
<arch>x86_64</arch>
<install type='iso'>
<iso>http://example.org/rhel-6-x86_64.iso</iso>
</install>
</os>
<description>RHEL-6 x86_64 with ccache</description>
<repositories>
<repository name='epel-6'>
<url>http://download.fedoraproject.org/pub/epel/6/$basearch</url>
<signed>yes</signed>
</repository>
</repositories>
<packages>
<package name='ccache'/>
</packages>
</template>
.in
Notice that this is very similar to Example 2, except we have
specified an additional repository from which to download packages.
The /repositories/repository section of the TDL specified the URL to
the package repository along with whether the packages in the
repository are signed. Running the installation is done the same way
as in Example 2:
.RS
# oz-install -u /path/to/rhel6_ccache.tdl
.RE
Running this command will download and prepare the installation media,
then run an automated install in a KVM guest.
Assuming the initial install succeeds, Oz will then boot the operating
system and run native commands to setup the additional repositories
and install the additional packages. For more information about why
this approach is used, please see the Oz Architecture document at
http://github.com/clalancette/oz/wiki/Oz-architecture.
Assuming this final step succeeds, the operating system with the
additional packages will be installed on a file in
/var/lib/libvirt/images/rhel6_ccache.dsk (by default, the output
location can be overridden in the configuration file).
.SH EXAMPLE 5 - Install a custom file from information in the TDL
Assume we want to install a RHEL-6 x86_64 operating system from a
RHEL-6 DVD ISO located at http://example.org/rhel-6-x86_64.iso
Additionally assume that we want to write some data to the file
/etc/test.out inside the guest. To do this install, we first need to
build a TDL XML file and then feed that to oz-install. The TDL file
would look like:
.in +4n
<template>
<name>rhel6_testout</name>
<os>
<name>RHEL-6</name>
<version>1</version>
<arch>x86_64</arch>
<install type='iso'>
<iso>http://example.org/rhel-6-x86_64.iso</iso>
</install>
</os>
<description>RHEL-6 x86_64 with test.out</description>
<files>
<file name='/etc/test.out'>THIS=extra_data</file>
</files>
</template>
.in
Multiple files can be specified here, and they will all be installed
on the operating system in the specified locations. Files can be
specified inline in raw text in the TDL, as base64 encoded data in the
TDL, or as URLs. We need to run the installation with customization
for this to work:
.RS
# oz-install -u /path/to/rhel6_testout.tdl
.RE
Running this command will download and prepare the installation media,
then run an automated install in a KVM guest.
Assuming the initial install succeeds, Oz will then boot the operating
system and run native commands to upload the files specified in the TDL.
For more information about why this approach is used, please see the
Oz Architecture document at
http://github.com/clalancette/oz/wiki/Oz-architecture.
Assuming this final step succeeds, the operating system with the
additional files will be installed on a file in
/var/lib/libvirt/images/rhel6_testout.dsk (by default, the output
location can be overridden in the configuration file).
.SH EXAMPLE 6 - Install a custom file from base64-encoded information in the TDL
Assume we want to install a RHEL-6 x86_64 operating system from a
RHEL-6 DVD ISO located at http://example.org/rhel-6-x86_64.iso
Additionally assume that we want to write some data to the file
/etc/test.out inside the guest. Since this data may be binary, we
want to base64 encode it first. To do this install, we first need to
build a TDL XML file and then feed that to oz-install. The TDL file
would look like:
.in +4n
<template>
<name>rhel6_testout</name>
<os>
<name>RHEL-6</name>
<version>1</version>
<arch>x86_64</arch>
<install type='iso'>
<iso>http://example.org/rhel-6-x86_64.iso</iso>
</install>
</os>
<description>RHEL-6 x86_64 with test.out</description>
<files>
<file name='/etc/test.out' type='base64'>VEhJUz1leHRyYV9kYXRhCg==</file>
</files>
</template>
.in
Multiple files can be specified here, and they will all be installed
on the operating system in the specified locations. Files can be
specified inline in raw text in the TDL, as base64 encoded data in the
TDL, or as URLs. We need to run the installation with customization
for this to work:
.RS
# oz-install -u /path/to/rhel6_testout.tdl
.RE
Running this command will download and prepare the installation media,
then run an automated install in a KVM guest.
Assuming the initial install succeeds, Oz will then boot the operating
system and run native commands to upload the files specified in the TDL.
For more information about why this approach is used, please see the
Oz Architecture document at
http://github.com/clalancette/oz/wiki/Oz-architecture.
Assuming this final step succeeds, the operating system with the
additional files will be installed on a file in
/var/lib/libvirt/images/rhel6_testout.dsk (by default, the output
location can be overridden in the configuration file).
.SH EXAMPLE 7 - Install a custom file from a URL
Assume we want to install a RHEL-6 x86_64 operating system from a
RHEL-6 DVD ISO located at http://example.org/rhel-6-x86_64.iso
Additionally assume that we want to write some data to the file
/etc/test.out inside the guest. We want to fetch this data from a URL
and upload into the guest. To do this install, we first need to
build a TDL XML file and then feed that to oz-install. The TDL file
would look like:
.in +4n
<template>
<name>rhel6_testout</name>
<os>
<name>RHEL-6</name>
<version>1</version>
<arch>x86_64</arch>
<install type='iso'>
<iso>http://example.org/rhel-6-x86_64.iso</iso>
</install>
</os>
<description>RHEL-6 x86_64 with test.out</description>
<files>
<file name='/etc/test.out' type='url'>http://example.org/orig.out</file>
</files>
</template>
.in
Multiple files can be specified here, and they will all be installed
on the operating system in the specified locations. Files can be
specified inline in raw text in the TDL, as base64 encoded data in the
TDL, or as URLs. We need to run the installation with customization
for this to work:
.RS
# oz-install -u /path/to/rhel6_testout.tdl
.RE
Running this command will download and prepare the installation media,
then run an automated install in a KVM guest.
Assuming the initial install succeeds, Oz will then boot the operating
system and run native commands to upload the files specified in the TDL.
For more information about why this approach is used, please see the
Oz Architecture document at
http://github.com/clalancette/oz/wiki/Oz-architecture.
Assuming this final step succeeds, the operating system with the
additional files will be installed on a file in
/var/lib/libvirt/images/rhel6_testout.dsk (by default, the output
location can be overridden in the configuration file).
.SH SEE ALSO
oz-install(1), oz-generate-icicle(1), oz-customize(1), oz-cleanup-cache(1)
.SH AUTHOR
Chris Lalancette <clalancette@gmail.com>
|