Commit 44976456 authored by Nikos Skalkotos's avatar Nikos Skalkotos
Browse files

docs: Update about the CUSTOM_TASK image property

parent 5ce75976
......@@ -214,6 +214,76 @@ like this:
``{"subtype": "error", "type": "image-helper", "messages": ["The image contains a(n) MSDOS partition table. For FreeBSD images only GUID Partition Tables are supported."], "timestamp": 1379507910.799365}``
.. _configuration-tasks-environment:
Configuration Tasks Enviroment
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
When an *snf-image-helper* configuration task runs, it expects to find the
required information in its enviroment. In the table below we describe the
enviroment variables that are present when the configuration tasks run.
+-------------------------------+---------------------------------------------+
|Name |Details |
+===============================+=============================================+
|SNF_IMAGE_DEV_COUNT |The number of the instance's disks |
+-------------------------------+---------------------------------------------+
|SNF_IMAGE_DEV_%N |The device file of the Nth disk |
+-------------------------------+---------------------------------------------+
|SNF_IMAGE_DEV |The device file of the first disk (we keep |
| |this for backward compatibility) |
+-------------------------------+---------------------------------------------+
|SNF_IMAGE_PERSONALITY |The value of the img_personality OS |
| |parameter |
+-------------------------------+---------------------------------------------+
|SNF_IMAGE_HOSTNAME |The instance's name |
+-------------------------------+---------------------------------------------+
|SNF_IMAGE_PASSWD |The value of the img_passwd OS parameter. |
+-------------------------------+---------------------------------------------+
|SNF_IMAGE_PASSWD_HASH |The value of the img_passwd_hash OS |
| |parameter. |
+-------------------------------+---------------------------------------------+
|SNF_IMAGE_PROPERTY_* |The value of a specific image property |
| |that was specified in json through the |
| |img_properties OS parameter. |
+-------------------------------+---------------------------------------------+
|SNF_IMAGE_RESIZE_PART |The number of the partition that will be |
| |enlarged. |
+-------------------------------+---------------------------------------------+
|SNF_IMAGE_TARGET |The directory the instance's file systems are|
| |mounted under. |
+-------------------------------+---------------------------------------------+
|NIC_COUNT |The number of the instance's network |
| |interfaces |
+-------------------------------+---------------------------------------------+
|NIC_%N_* |The ganeti provided environment variable |
| |for the Nth network interface. Check `here <h|
| |ttp://docs.ganeti.org/ganeti/current/man/gane|
| |ti-os-interface.html>`_ |
+-------------------------------+---------------------------------------------+
|SNF_IMAGE_DHCP_TAGS |The value of the DHCP_TAGS configuration |
| |parameter (see |
| |:ref:`Configuration Parameters |
| |<configuration-parameters>`) |
+-------------------------------+---------------------------------------------+
|SNF_IMAGE_STATEFUL_DHCPV6_TAGS |The value of the STATEFUL_DHCPV6_TAGS |
| |configuration parameter (see |
| |:ref:`Configuration Parameters |
| |<configuration-parameters>`) |
+-------------------------------+---------------------------------------------+
|SNF_IMAGE_STATELESS_DHCPV6_TAGS|The value of the STATELESS_DHCPV6_TAGS |
| |configuration parameter (see |
| |:ref:`Configuration Parameters |
| |<configuration-parameters>`) |
+-------------------------------+---------------------------------------------+
|SNF_IMAGE_UNATTEND |The value of the UNATTED configuration |
| |parameter (see |
| |:ref:`Configuration Parameters |
| |<configuration-parameters>`) |
+-------------------------------+---------------------------------------------+
.. rubric:: Footnotes
.. [#f1] http://technet.microsoft.com/en-us/library/hh824938.aspx
......@@ -215,49 +215,55 @@ will fail.
missing a warning is produced. Only *SNF_IMAGE_TARGET* is required for this
task to run.
**RunCustomTask**: Run a user-defined task specified by the
*SNF_IMAGE_PROPERTY_CUSTOM_TASK* variable. If the variable is missing or empty,
a warning is produced.
**UmountImage**: Umounts the file systems previously mounted by MountImage. The
only environment variable required is *SNF_IMAGE_TARGET*.
+-------------------------------+---+--------------------------------------------+-------------------------------------------+
| | | Dependencies | Enviromental Variables [#]_ |
+ Name | +------------------+-------------------------+-------------------------+-----------------+
| |Pr.| Run-After | Run-Before | Required | Optional |
+===============================+===+==================+=========================+=========================+=================+
|FixPartitionTable |10 | |FilesystemResizeUnmounted|DEV | |
+-------------------------------+---+------------------+-------------------------+-------------------------+-----------------+
|FilesystemResizeUnmounted |20 |FixPartitionTable |MountImage |DEV | |
+-------------------------------+---+------------------+-------------------------+-------------------------+-----------------+
|MountImage |30 | |UmountImage |DEV | |
| | | | |TARGET | |
| | | | |PROPERTY_ROOT_PARTITION | |
+-------------------------------+---+------------------+-------------------------+-------------------------+-----------------+
|AddSwap |40 |MountImage |EnforcePersonality |TARGET |PROPERTY_OSFAMILY|
| | | | | |PROPERTY_SWAP |
+-------------------------------+---+------------------+-------------------------+-------------------------+-----------------+
|DeleteSSHKeys |40 |MountImage |EnforcePersonality |TARGET |PROPERTY_OSFAMILY|
+-------------------------------+---+------------------+-------------------------+-------------------------+-----------------+
|DisableRemoteDesktopConnections|40 |EnforcePersonality|UmountImage |TARGET |PROPERTY_OSFAMILY|
+-------------------------------+---+------------------+-------------------------+-------------------------+-----------------+
|InstallUnattend |40 |MountImage |EnforcePersonality |TARGET |PROPERTY_OSFAMILY|
+-------------------------------+---+------------------+-------------------------+-------------------------+-----------------+
|SELinuxAutorelabel |40 |MountImage |EnforcePersonality |TARGET |PROPERTY_OSFAMILY|
+-------------------------------+---+------------------+-------------------------+-------------------------+-----------------+
|AssignHostname |50 |InstallUnattend |EnforcePersonality |TARGET | |
| | | | |HOSTNAME |PROPERTY_OSFAMILY|
+-------------------------------+---+------------------+-------------------------+-------------------------+-----------------+
|ChangePassword |50 |InstallUnattend |EnforcePersonality |TARGET |PROPERTY_USERS |
| | | | | |PROPERTY_OSFAMILY|
| | | | | |PASSWD |
+-------------------------------+---+------------------+-------------------------+-------------------------+-----------------+
|ConfigureNetwork |50 |InstallUnattend |EnforcePersonality |TARGET |NIC_* |
+-------------------------------+---+------------------+-------------------------+-------------------------+-----------------+
|FilesystemResizeMounted |50 |InstallUnattend |EnforcePersonality |TARGET |PROPERTY_OSFAMILY|
+-------------------------------+---+------------------+-------------------------+-------------------------+-----------------+
|EnforcePersonality |60 |MountImage |UmountImage |TARGET |PERSONALITY |
| | | | | |PROPERTY_OSFAMILY|
+-------------------------------+---+------------------+-------------------------+-------------------------+-----------------+
|UmountImage |80 |MountImage | |TARGET | |
+-------------------------------+---+------------------+-------------------------+-------------------------+-----------------+
+-------------------------------+---+--------------------------------------------+----------------------------------------------+
| | | Dependencies | Enviromental Variables [#]_ |
+ Name | +------------------+-------------------------+-------------------------+--------------------+
| |Pr.| Run-After | Run-Before | Required | Optional |
+===============================+===+==================+=========================+=========================+====================+
|FixPartitionTable |10 | |FilesystemResizeUnmounted|DEV | |
+-------------------------------+---+------------------+-------------------------+-------------------------+--------------------+
|FilesystemResizeUnmounted |20 |FixPartitionTable |MountImage |DEV | |
+-------------------------------+---+------------------+-------------------------+-------------------------+--------------------+
|MountImage |30 | |UmountImage |DEV | |
| | | | |TARGET | |
| | | | |PROPERTY_ROOT_PARTITION | |
+-------------------------------+---+------------------+-------------------------+-------------------------+--------------------+
|AddSwap |40 |MountImage |EnforcePersonality |TARGET |PROPERTY_OSFAMILY |
| | | | | |PROPERTY_SWAP |
+-------------------------------+---+------------------+-------------------------+-------------------------+--------------------+
|DeleteSSHKeys |40 |MountImage |EnforcePersonality |TARGET |PROPERTY_OSFAMILY |
+-------------------------------+---+------------------+-------------------------+-------------------------+--------------------+
|DisableRemoteDesktopConnections|40 |EnforcePersonality|UmountImage |TARGET |PROPERTY_OSFAMILY |
+-------------------------------+---+------------------+-------------------------+-------------------------+--------------------+
|InstallUnattend |40 |MountImage |EnforcePersonality |TARGET |PROPERTY_OSFAMILY |
+-------------------------------+---+------------------+-------------------------+-------------------------+--------------------+
|SELinuxAutorelabel |40 |MountImage |EnforcePersonality |TARGET |PROPERTY_OSFAMILY |
+-------------------------------+---+------------------+-------------------------+-------------------------+--------------------+
|AssignHostname |50 |InstallUnattend |EnforcePersonality |TARGET | |
| | | | |HOSTNAME |PROPERTY_OSFAMILY |
+-------------------------------+---+------------------+-------------------------+-------------------------+--------------------+
|ChangePassword |50 |InstallUnattend |EnforcePersonality |TARGET |PROPERTY_USERS |
| | | | | |PROPERTY_OSFAMILY |
| | | | | |PASSWD |
+-------------------------------+---+------------------+-------------------------+-------------------------+--------------------+
|ConfigureNetwork |50 |InstallUnattend |EnforcePersonality |TARGET |NIC_* |
+-------------------------------+---+------------------+-------------------------+-------------------------+--------------------+
|FilesystemResizeMounted |50 |InstallUnattend |EnforcePersonality |TARGET |PROPERTY_OSFAMILY |
+-------------------------------+---+------------------+-------------------------+-------------------------+--------------------+
|EnforcePersonality |60 |MountImage |UmountImage |TARGET |PERSONALITY |
| | | | | |PROPERTY_OSFAMILY |
+-------------------------------+---+------------------+-------------------------+-------------------------+--------------------+
|RunCustomTask |70 |MountImage |UmountImage |TARGET |PROPERTY_CUSTOM_TASK|
+-------------------------------+---+------------------+-------------------------+-------------------------+--------------------+
|UmountImage |80 |MountImage | |TARGET | |
+-------------------------------+---+------------------+-------------------------+-------------------------+--------------------+
.. [#] all environment variables are prefixed with *SNF_IMAGE_*
......@@ -121,6 +121,8 @@ some external programs in ``/etc/default/snf-image``:
# CURL="curl"
# TAR="tar"
.. _configuration-parameters:
Configuration parameters
^^^^^^^^^^^^^^^^^^^^^^^^
......@@ -138,6 +140,8 @@ The most common configuration parameters the user may need to overwrite are:
* **STATELESS_DHCPV6_TAGS**: To specify which Ganeti networks support SLAAC
and stateless DHCPv6
* **STATEFUL_DHCPV6_TAGS**: To specify which Ganeti networks support DHCPv6
* **UNATTEND**: To specify a custom Unattend.xml file to use on Windows
instead of the default one
Paths of external programs
^^^^^^^^^^^^^^^^^^^^^^^^^^
......
......@@ -194,6 +194,12 @@ All image formats properties
to be swap. Defining *SWAP=c* will configure the third disk of the VM to be
swap.This property only applies to Linux instances.
* **CUSTOM_TASK=<base64_encoded_content>**
This property can be used to run a user-defined configuration task. The
value of this property should host the base64-encoded body of the task. If
you want to write a custom configuration task check
:ref:`Configuration Tasks Environment<configuration-tasks-environment>`.
* **EXCLUDE_ALL_TASKS=yes**
If this property is defined with a value other than null, then during the
deployment, the image will not be configured at all. This is really handy
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment