= Configuring OS Templates = [[TracNav]] [[TOC(inline)]] This pages describes the use of QWG templates to configure the OS. These templates are not related to the middleware and can be used in other contexts. They are in charge of installing the required RPMs, based on feature groups requested, and do the base machine configuration (network, ...). They are used by middleware templates configuring a specific middleware machine type to do the base configuration of the machine. Look at nformation about [wiki:Doc/OS/Layout layout] of OS templates for more information. == Selecting OS version == === Cluster Default OS Version === A default OS version/arch can be associated with a cluster. When defined, unless specified otherwise (see next section), all machines will use this OS version. Default OS version/arch for the cluster is defined with variable `NODE_OS_VERSION_DEFAULT`, generally in cluster specific [source:templates/trunk/clusters/example/site/pro_site_cluster_info.tpl pro_site_cluster_info.tpl]. The value is the directory containing templates for this OS version. ''Note : if you need to use `sl305-i386` in your cluster, it '''must be''' defined as the default version for the cluster in [source:templates/trunk/cluster/examples/cluster.build.properties cluster.build.properties], adding `os/sl305-i386` '''after''' `os`.'' === Per Machine OS Version === Each machine in a cluster can run its own OS version/arch, different from the cluster default version. Tis done by creating a template pointed by variable `NODE_OS_VERSION_DB` in your site or cluster hierarchy. This variable is generally defined in cluster specific [source:templates/trunk/clusters/example/site/pro_site_cluster_info.tpl pro_site_cluster_info.tpl]. The template pointed to by `NODE_OS_VERSION_DB` must define variable `OS_VERSION`. This variable must contain one entry for each machine that is not using the default OS version defined for the cluster. The value is the directory containing templates for the OS version. ''Note : it is not possible to select `sl305-i386` as a node specific OS version. See previous section.`` == Selecting Kernel Version == Normally, standard templates provide an appropriate definition of the kernel number and variant (smp, hugemem...) according to hardware present (as declared in templates). If you want to override this default, you can use the following variables : * `KERNEL_VERSION_NUM` : this must contain the kernel version, as it is in the RPM name, without the architecture. * `KERNEL_VARIANT` : `smp`, `hugemem`, `largesmp`... or nothing (empty string) for non smp kernel. Proper definition of these variables is important. They are used both to select RPMs to install for kernel and kernel modules and to configure Grub. ''Note : only one version of RPMs for kernel and kernel module are present at anytime in the configuration. Be cautious when changing one of these variables on an already installed machine as it will uninstall previously used version. This will change in the future when SPMA will be able to keep the previously installed version, even if no longer part of the configuration. Grub cannot be configured to use a kernel version other than the one present in the node profile.'' == Selecting Kernel Architecture == Normally, an attempt is made to guess the OS architecture from the CPU model. But this doesn't fit all situations, in particular with processors that can be installed as 32-bit or 64-bit. You can force the architecture you want to use on a specific machine by défining variable `CPU_ARCH` to the architecture name, using standard architecture names used in RPMs (e.g. i386, x86_64...). == OS Errata and RPM Updates == QWG templates provide an easy and flexible way to deploy OS errata RPM as provided by Linux distros or site specific updates to OS RPMs. This is based on 2 templates and a few variables. There is a distinct template for standard OS RPM errata and for site specific updates to standard OS RPMs. They are : * `rpms/updates.tpl` : site specific updates to standard OS RPMs. * `PKG_OS_ERRATA_TEMPLATE` : a variable whose value is the name of the template containing errata RPMs to install. The default name is `rpms/errata.tpl` (`.tpl` must be ommited in variable value). QWG templates provide a default errata template and update it regularly based on available errata. A site is free to maintain its own list. By default, errata RPMs are not deployed. To do it, variable `PKG_DEPLOY_OS_ERRATA` must be defined to `true`.