Home · About · Download · Documentation · Getting Help · Google+
wiki:Old/QuickStart/Provisioning

Recipe to use Warewulf to provision nodes

Warewulf packages to install

Follow the quick start installation? guide for the following Warewulf packages:

  • warewulf-provision: Provides the core functionality for Warewulf hosts responsible for provisioning systems
  • warewulf-provision-server: Provides the functionality for Warewulf hosts to perform provisioning
  • warewulf-vnfs: The tools needed to create, manintain VNFS images

Dependencies to install

These packages will need to be installed on any Warewulf provision master.

RPM distros

$ sudo yum install httpd dhcp tftp-server mod_perl 

Debian / Ubuntu

sudo apt-get install apache2 libapache2-mod-perl2 tftpd-hpa

Configuring the provision package

Make sure /etc/warewulf/provision.conf has "network device" set to your current network device. (The default is eth1.)

Example for /etc/warewulf/provision.conf:

...
# What is the default network device that the nodes will be used to
# communicate to the nodes?
network device = eth1  ###change to eth0 as needed
...

The Warewulf VNFS

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 scripts to create vnfs for different node operating systems. Run mkchroot-rh.sh or mkchroot-mud.sh to create a chroot environment off of which a vnfs will be based. This is where you should centrally manage your node operating system images.

mkchroot-rh.sh - Redhat

  • Run as root
  • Takes a directory as an argument
  • Uses yum to download/install packages into the directory specified
  • Sets the password for root, as well as a few other useful things.

Example:

$ sudo mkchroot-rh.sh /var/chroots/rhel-6

This chroot (/var/chroots/rhel-6) should be used and maintained as the "template" for the operating system image.

mkchroot-mud.sh - Debian / Ubuntu / Mint

  • Run as root
  • Takes a directory, distro, version number, code name, as arguments
  • Uses apt-get to download/install packages into the directory specified
  • Sets the password for root, as well as a few other useful things.
  • Supports vnfs importing into Warewulf
  • Supports bootstrap creation and importing into Warewulf
  • See --help for complete list of options
$ sudo mkchroot-mud.sh --help

Example: To create a 32 bit Ubuntu vnfs from the standard repository:

sudo mkchroot-mud.sh -U i386 -c oneiric -r 11.10 -p /var/chroots

This chroot (/var/chroots/ubuntu-11.10.i386) should be used and maintained as the "template" for the operating system image. You can chose to have mkchroot-mud.sh create and import the vnfs and bootstraps for you, or you can do them manually at a later time.

Create and import a VNFS image

Once you have your chroot environment ready you can create the VNFS image that will be used to provision the nodes itself. To do this, use the program wwvnfs which is also provided by the warewulf-vnfs subpackage. This process will create a binary VNFS image, and import it directly into Warewulf:

$ sudo wwvnfs --chroot /var/chroots/rhel-6
Using 'rhel-6' as the VNFS name
Creating VNFS image for rhel-6
Building and compressing VNFS image
Creating new Vnfs Object: rhel-6
Imported rhel-6 into a new object
Done.

You can exclude files and directories using the --excludes=... or --excludefile=... options. This will omit the given paths from the VNFS image. If the --hybridpath=... option is present it will replace the files that have been excluded with a symlink which will be prefixed with the given hybrid path.

The Warewulf bootstrap

Booting nodes in Warewulf requires two components. The VNFS image and the bootstrap. The bootstrap is actually a combination of several pieces all put together: kernel, kernel drivers, Warewulf pre-runtime environment. Building a bootstrap is a two stage process very similar to creating and then installation of VNFS images.

Creating and importing the Warewulf bootstrap image

You can create the bootstrap images on any system that has the kernel stack you wish to use. The kernel stack (kernel and drivers) can be on the local file system or within a chroot directory structure. You build the kernel dependent component using the wwbootstrap command 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.

Node management

Nodes are stored within Warewulf as data store objects of type "node". Nodes can be generally manipulated with the node Warewulf command. The Warewulf provision package also includes a helper command called provision which facilitates setting up nodes for provisioning.

To configure nodes for provisioning you need to have several parameters set:

  • vnfs: The VNFS that this node will be provisioned with
  • bootstrap: This is the bootstrap image (kernel and initrd) that the node will be booted to
  • netdevs (specifically the ipaddr and hwaddr entries): The netdev's entry is a list of sub objects each of which defines a particular network interface. Within the netdev's there needs to be an IP address and MAC address set. You can have as many netdev entries as you wish.

Here is an example for adding and configuring a node to be provisioned:

$ sudo wwsh
Warewulf> node new n0000 --netdev=eth0 --ipaddr=10.0.1.0 --hwaddr=00:00:00:00:00:00
Warewulf> provision set n0000 --vnfs=rhel-6 --bootstrap=2.6.32-71.18.2.el6.x86_64

Adding nodes to Warewulf

There are two ways to add nodes to Warewulf (at the time of this writing). The first method is to add nodes automatically as they boot up using the wwnodescan utility. The second is to add them by hand, or via a script.

Automatically adding nodes

There is a tool that is included with the Warewulf provision package called wwnodescan. This tool monitors DHCP, and adds nodes as systems make DHCP requests. To add a single node to Warewulf as it boots use the following command (changing the necessary information):

$ sudo wwnodescan --netdev=eth0 --ipaddr=10.0.1.0 --netmask=255.255.0.0 --vnfs=rhel-6 --bootstrap=2.6.32-71.18.2.el6.x86_64 n0000

You can also specify multiple nodes or a node range which will continue scanning until all nodes have been added.

note: The IP address will be incremented to support subsequent nodes.

Manually adding nodes

Use the "node" command in wwsh to create node database entries by hand:

Example:

Warewulf> node new n0000 --netdev=eth0 --hwaddr=00:00:00:00:00:00 --ipaddr=10.0.1.0 --groups=newnodes
Warewulf> node new n0001 --netdev=eth0 --hwaddr=00:00:00:00:00:01 --ipaddr=10.0.1.1 --groups=newnodes
Warewulf> node new n0002 --netdev=eth0 --hwaddr=00:00:00:00:00:02 --ipaddr=10.0.1.2 --groups=newnodes
Warewulf> provision set --lookup groups newnodes --vnfs=rhel-6 --bootstrap=2.6.32-71.18.2.el6.x86_64

The first commands will create the new node objects in the datastore and associate them to the group newnodes, and the provision command will find all nodes in the newnodes group and set their VNFS and BOOTSTRAP configurations.

Make sure apache, dhcp and tftp-server is running -- you should be ready to boot up your nodes!