« Previous - Version 10/15 (diff) - Next » - Current version
Nikos Skalkotos, 01/04/2012 07:24 pm


Configuration Tasks

Configuration tasks are scripts called by snf-image-helper, to accomplish various configuration steps on the newly created instance. See below for a description of each one of them:

FixPartitionTable: Enlarges the last partition in the partition table of the instance, to consume all the available space. For now, only primary partitions are supported.

FilesystemResizeUnmounted: Extends the file system of the last partition to cover up the whole partition. This only works for ext{2,3,4} file systems. Any other file system type is ignored and a warning is triggered. The task will fail if SNF_IMAGE_DEV environmental variable is missing.

MountImage: Mounts the nth partition of SNF_IMAGE_DEV, which is specified by SNF_IMAGE_PROPERTY_ROOT_PARTITION variable under the directory specified by SNF_IMAGE_TARGET. The script will fail if any of those 3 variables has a non-sane value.

DeleteSSHKeys: For linux images, this script will clear out any ssh keys found in the image and for debian, it will recreate them too. In order to find the ssh keys, the script looks in default locations (/etc/ssh/ssh_*_key) and also parses /etc/ssh/sshd_config file if present. The script will fail if SNF_IMAGE_TARGET is not set.

DisableRemoteDesktopConnections: This script temporary disables RDP connections in windows instances by changing the value fDenyTSConnection registry key. RDP connections will be enabled back during the specialize pass of the Windows setup. The task will fail if SNF_IMAGE_TARGET is not defined.

InstallUnattend: Installs the Unattend.xml files in windows images. This is needed by windows in order to perform an unattended setup. The SNF_IMAGE_TARGET variables needs to be present for this task to run.

SELinuxAutorelabel: Creates .autorelabel file in RedHat images. This is needed if SELinux is enabled to enforce an automatic file system relabeling at the next boot. The only enviromental variable required for this is SNF_IMAGE_TARGET.

AssignHostname: Assigns or changes the hostname in a Linux or Windows image. The task will fail if the Linux distribution is not supported. For now, we support debian, redhat, slackware, suse and gentoo derived distros. The hostname is read from SNF_IMAGE_HOSTNAME variable. In addition to the latter, SNF_IMAGE_TARGET is also required.

ChangePassword:
EnforcePersonality:
FilesystemResizeMounted:

Name Pr. Dependencies Enviromental Variables 1
Run-After Run-Before Required Optional
FixPartitionTable 10 FilesystemResizeUnmounted DEV
FilesystemResizeUnmounted 20 FixPartitionTable MountImage DEV
MountImage 30 UmountImage DEV
TARGET
PROPERTY_ROOT_PARTITION
DeleteSSHKeys 40 MountImage UmountImage TARGET PROPERTY_OSFAMILY
DisableRemoteDesktopConnections 40 MountImage UmountImage TARGET PROPERTY_OSFAMILY
InstallUnattend 40 MountImage UmountImage TARGET PROPERTY_OSFAMILY
SELinuxAutorelabel 40 MountImage UmountImage TARGET PROPERTY_OSFAMILY
AssignHostname 50 InstallUnattend UmountImage TARGET
HOSTNAME
PROPERTY_OSFAMILY
ChangePassword 50 InstallUnattend UmountImage TARGET
PASSWORD
PROPERTY_USERS
PROPERTY_OSFAMILY
EnforcePersonality 50 DeleteSSHKeys UmountImage TARGET PERSONALITY
PROPERTY_OSFAMILY
FilesystemResizeMounted 50 InstallUnattend UmountImage TARGET PROPERTY_OSFAMILY
UmountImage 80 MountImage TARGET

1: all enviromental variables are prefixed with SNF_IMAGE_