| 1 |
.. _image-profiles: |
| 2 |
|
| 3 |
Image Profiles |
| 4 |
============== |
| 5 |
|
| 6 |
A *profile* is a namespace for additional settings that can be applied by |
| 7 |
{kiwi} in addition to the default settings (or other profiles), making it possible |
| 8 |
to build multiple appliances with the same build type but with different |
| 9 |
configurations. |
| 10 |
|
| 11 |
The use of profiles is advisable to distinguish image builds of the same |
| 12 |
type but with different settings. In the following example, two virtual |
| 13 |
machine images of the `oem` type are configured: one for QEMU (using the |
| 14 |
`qcow2` format) and one for VMWare (using the `vmdk` format). |
| 15 |
|
| 16 |
.. code:: xml |
| 17 |
|
| 18 |
<image schemaversion="{schema_version}" name="{exc_image_base_name}"> |
| 19 |
<profiles> |
| 20 |
<profile name="QEMU" description="virtual machine for QEMU"/> |
| 21 |
<profile name="VMWare" description="virtual machine for VMWare"/> |
| 22 |
</profiles> |
| 23 |
<preferences> |
| 24 |
<version>15.0</version> |
| 25 |
<packagemanager>zypper</packagemanager> |
| 26 |
</preferences> |
| 27 |
<preferences profiles="QEMU"> |
| 28 |
<type image="oem" format="qcow2" filesystem="ext4"/> |
| 29 |
</preferences> |
| 30 |
<preferences profiles="VMWare"> |
| 31 |
<type image="oem" format="vmdk" filesystem="ext4"/> |
| 32 |
</preferences> |
| 33 |
</image> |
| 34 |
|
| 35 |
Each profile is declared via the element `profile` that must be a |
| 36 |
child of `profiles`, and it must contain the `name` and `description` |
| 37 |
attributes. The `description` is only present for documentation purposes; |
| 38 |
`name`, on the other hand, is used to instruct {kiwi} which profile to build |
| 39 |
via the command line. Additionally, you can provide the boolean attribute |
| 40 |
`import`, which defines whether this profile should be used by default when |
| 41 |
{kiwi} is invoked via the command line. |
| 42 |
|
| 43 |
A profile inherits the default settings that do not belong to any |
| 44 |
profile. It applies only to elements that contain the profile in their |
| 45 |
`profiles` attribute. The attribute `profiles` expects a comma-separated |
| 46 |
list of profiles for which the settings of this element apply. |
| 47 |
|
| 48 |
Profiles can furthermore inherit settings from another profile via the |
| 49 |
`requires` sub-element: |
| 50 |
|
| 51 |
.. code:: xml |
| 52 |
|
| 53 |
<profiles> |
| 54 |
<profile name="VM" description="virtual machine"/> |
| 55 |
<profile name="QEMU" description="virtual machine for QEMU"> |
| 56 |
<requires profile="VM"/> |
| 57 |
</profile> |
| 58 |
</profiles> |
| 59 |
|
| 60 |
In the above example, the profile `QEMU` inherits the settings from `VM`. |
| 61 |
|
| 62 |
For further details on the usage of *profiles*, see |
| 63 |
:ref:`building-build-with-profiles`. |