Virtual Node File System Management
Warewulf utilizes the concept of a Virtual Node File System for management of the node operating systems. What this means is that you can manage each node using a chroot which is a directory structure that represents a root file system. Building the VNFS image can be done on the master node or on a separate system and then imported into your Warewulf master.
Create a chrootable environment
The warewulf-vnfs subpackage provides tools to create vnfs for different node operating systems. One such tool is the program wwmkchroot which uses modules to create chroots for different architectures. Modules can be developed to make chroots for just about any operating system in a simple and manageable manner. To see what chroot modules have been developed, you can simply type the command with no options as seen below:
$ sudo wwmkchroot
/usr/bin/wwmkchroot [options] TEMPLATE_NAME PATH
OPTIONS:
-d Debug output
-h Usage summary
Context Help:
-h debian
TEMPLATE_NAME (select one of the following):
* centos-5
* centos-6
* debian7
* debian
* rhel-generic
* sl-5
* sl-6
PATH:
This is the location where the VNFS will be created
EXAMPLES:
# wwmkchroot rhel-generic /var/chroots/rhel
If you wish to create a VNFS for Scientific Linux 6 for example you can do:
$ sudo wwmkchroot sl-6 /var/chroots/sl-6
note: This requires the command YUM which will be used to generate the chroot.
Creating a chroot locally from an ISO image
NOTE: This feature currently not available for Debian. The original chroot will not be generated from the iso’s, however they will appear in its sources.list file for future package management.
By default, wwmkchroot downloads the required components for the chroot over the network, but as of Warewulf VNFS version 3.4, you can build your chroot image from the ISO/DVD images directly. Once you have downloaded the install media image(s), you can set the environment variable INSTALL_ISO to point to the media (comma deliminated if there are multiple images). For example:
# INSTALL_ISO="/var/tmp/SL-63-x86_64-2012-08-02-Everything-DVD1.iso,/var/tmp/SL-63-x86_64-2012-08-02-Everything-DVD2.iso"
# export INSTALL_ISO
# wwmkchroot sl-6 /var/chroots/sl-6
chroot Management
Package management and admin tasks can be performed nearly as easy as working on the host system. The tool that offers such convenience is wwmngchroot. Packages lists to remove and install can be issued at the same time, and a shell can be provided inside the chroot to perform manual tasks. Optionally supplying a vnfs name, can automatically (re)import a VNFS when all tasks have completed.
Only install nano:
sudo wwmngchroot -c /var/chroots/rhel-generic -i nano
Only open a shell within the chroot:
sudo wwmngchroot -c /var/chroots/centos-6 -s
Remove nano, install wget, provide a shell to work in, choose yes for prompts, automatically import into vnfs.
NOTE: All package removal will occur before instillation.
sudo wwmngchroot -y -s -c /var/chroots/debian7 -i wget -r nano -v debian7
Additional help info is available with
sudo wwmngchroot -h
Creating and importing the chroot into Warewulf as a VNFS image
While most configuration of provisioned images takes place in a simple chroot filesystem, such as that generated by wwmkchroot, these chroots cannot be directly provisioned by Warewulf. Instead, once you have configured the chroot to your satisfaction, you must use wwvnfs to encapsulate and compress this filesystem into a VNFS image which can be provisioned. The distinction is similar to that between the source and binary of a compiled program, where the chroot represents the source and the VNFS the binary.
To help improve performance and minimize consumed space in RAM, the wwvnfs tool provides a few mechanisms for excluding chroot files from the VNFS image. Excluded files remain a part of the chroot, but are not included in the compressed VNFS which will be provisioned. There are several mechanisms for specifying files to be excluded:
- The global vnfs.conf file allows you to specify an “excludes” line, which includes by default paths such as /opt and /usr/local.
- VNFS-specific configuration files can be placed in a /etc/warewulf/vnfs/[name].conf file and will be created by default if one is not present.
- Specify paths to be excluded using the –excludes option.
Optionally, the files you exclude can be hybridized. This means that rather than simply being removed from VNFS, they are replaced with a symbolic link with a prefix you specify using the –hybridpath option. For example, excluding /usr/local with a hybrid path /mnt/hybrid would replace the directory with a symbolic link to /mnt/hybrid//usr/local. This feature allows you to place some files in an alternative filesystem such as an external disk, an NFS mount, or other network filesystem. (Note, of course, that this path must be present in the fstab for your files to be accessible.) Hybridized locations can be a useful way to exclude seldom-used files from the VNFS, while still maintaining their accessibility and their presence in the chroot.
To create the VNFS image that the nodes will use to boot, here is an example usage:
$ sudo wwvnfs --chroot /var/chroots/sl-6
Using 'rhel-6' as the VNFS name
Creating VNFS image for sl-6
Building and compressing VNFS image
Creating new Vnfs Object: sl-6
Imported sl-6 into a new object
Done.
The first time this command is run on a particular chroot, it will create a configuration file at /etc/warewulf/vnfs.d/[name].conf. If the name is not explicitly defined, it is assumed to be the basename of the chroot path (e.g. in this case sl-6). Once the configuration file has been created, you can rebuild the image simply by calling the name of the VNFS:
$ sudo wwvnfs sl-6
Create a bootstrap image
When a node is provisioned using Warewulf, it initially obtains a small bootstrap image from the master during the PXE process (transferred using TFTP). This bootstrap image includes a Linux kernel, device drivers, and a minimal set of programs to complete the provisioning process. Once the bootstrap is in place, it calls back to the master, downloads the VNFS capsule, and provisions the filesystem. It then calls init for the new filesystem to bring up the desired Linux system.
Because the same kernel is used in the bootstrap and the provisioned system, it’s important to make sure that the bootstrap kernel and device drivers match the VNFS being provisioned. Warewulf therefore allows you to create bootstrap images from a specific kernel, customizing them for use with a specific VNFS and/or machine. wwbootstrap is used to create these bootstrap images, bundling the device drivers, firmware and provisioning software with the kernel. What kernel support is incorporated (kernel modules and firmware) is defined by the /etc/warewulf/bootstrap.conf.
Bootstrap images can be created using the kernels installed on the master node, or kernels present in a chroot. Using kernels from a separate chroot are especially useful if you are attempting to provision a Linux distribution different from the distro present on the master node; for example, provisioning a Debian node from a Scientific Linux master.
In short, you can build a bootstrap image using the kernel you are currently running on the master as follows:
$ sudo wwbootstrap `uname -r`
Number of drivers included in bootstrap: 410
Number of firmware images included in bootstrap: 26
Building and compressing bootstrap
Creating new Bootstrap Object: 2.6.32-71.18.2.el6.x86_64
Imported 2.6.32-71.18.2.el6.x86_64 into a new object
Integrating the Warewulf bootstrap: 2.6.32-71.18.2.el6.x86_64
Including capability: provision-adhoc
Including capability: provision-files
Including capability: provision-vnfs
Including capability: setup-filesystems
Including capability: transport-http
Compressing the initramfs
Locating the kernel object
Bootstrap image '2.6.32-71.18.2.el6.x86_64' is ready
Done.
Note: Similar to the command wwvnfs if the Warewulf provision modules are installed onto the host running this command, it will be automatically imported into Warewulf otherwise it will output the bootstrap image to a file that can be imported directly into Warewulf._