<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-GB">
	<id>https://alteeve.com/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=SRSullivan</id>
	<title>Alteeve Wiki - User contributions [en-gb]</title>
	<link rel="self" type="application/atom+xml" href="https://alteeve.com/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=SRSullivan"/>
	<link rel="alternate" type="text/html" href="https://alteeve.com/w/Special:Contributions/SRSullivan"/>
	<updated>2026-06-20T04:49:49Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.42.3</generator>
	<entry>
		<id>https://alteeve.com/w/index.php?title=Setting_Up_a_PXE_Server_on_an_RPM-based_OS&amp;diff=4272</id>
		<title>Setting Up a PXE Server on an RPM-based OS</title>
		<link rel="alternate" type="text/html" href="https://alteeve.com/w/index.php?title=Setting_Up_a_PXE_Server_on_an_RPM-based_OS&amp;diff=4272"/>
		<updated>2012-03-11T22:27:06Z</updated>

		<summary type="html">&lt;p&gt;SRSullivan: /* The Configuration Files */ Description of Colour hash (#) codes had the alpha on the wrong end. Verified against syslinux docs. Please update static download file.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{howto_header}}&lt;br /&gt;
&lt;br /&gt;
= About this Tutorial =&lt;br /&gt;
&lt;br /&gt;
This tutorial covers the steps needed to make a [http://en.wikipedia.org/wiki/Preboot_Execution_Environment PXE] server. It will be used for hosting multiple [[Operating Systems]] that can be booted from a machine&#039;s network card. The main reason for this setup is to host installation media removing the requirement for have optical drives in machines. It also saves you from having a pile of optical discs kicking around.&lt;br /&gt;
&lt;br /&gt;
== Prerequisite ==&lt;br /&gt;
&lt;br /&gt;
This tutorial assumes that you have a fresh install of [[EL6]] and that the machine&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth1&amp;lt;/span&amp;gt; device has been statically set to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;10.255.255.254&amp;lt;/span&amp;gt; and is the interface and IP address machines will use to talk to the PXE server.&lt;br /&gt;
&lt;br /&gt;
== Parts Needed ==&lt;br /&gt;
&lt;br /&gt;
A PXE boot server is fairly strait forward. You need:&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;dhcp&amp;lt;/span&amp;gt;; This answers a workstation&#039;s request for an IP during the boot process.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;tftp-server&amp;lt;/span&amp;gt;; This is a PXE compliant FTP server than handles passing the core boot files to the remote machine.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;syslinux&amp;lt;/span&amp;gt;; This handles those special boot files that the remote machine needs to boot.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;httpd&amp;lt;/span&amp;gt;; Once the boot files start up the remote machine, generally you will tell it to pull the main files from a webserver. This is the Apache webserver that will server that purpose.&lt;br /&gt;
&lt;br /&gt;
= Configuring Needed Services =&lt;br /&gt;
&lt;br /&gt;
== dhcp ==&lt;br /&gt;
&lt;br /&gt;
First you will need a DHCP server. Here is a good little tutorial to follow. Come back once you finish.&lt;br /&gt;
&lt;br /&gt;
* [[DHCP on an RPM-based OS]]&lt;br /&gt;
&lt;br /&gt;
=== Addition to the DHCP Configuration File ===&lt;br /&gt;
&lt;br /&gt;
We need to add a section to the DHCP server configuration file, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;dhcpd.conf&amp;lt;/span&amp;gt;. We need to add an option to the relevant &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;subnet&amp;lt;/span&amp;gt; directive(s) indicating where interested clients can go to get the PXE boot configuration. In this example, the PXE server and DHCP server are one in the same, but this is by choice only.&lt;br /&gt;
&lt;br /&gt;
The section to add is below.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
	# These two options tell clients where to go to get the file needed to&lt;br /&gt;
	# start the boot process.&lt;br /&gt;
	next-server 192.168.1.254;&lt;br /&gt;
	filename &amp;quot;pxelinux.0&amp;quot;;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The updated &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;dhcpd.conf&amp;lt;/span&amp;gt; file should look something like the example below.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: [[EL5]] distributions store this file at &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/dhcpd.conf&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/dhcp/dhcpd.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
#&lt;br /&gt;
# DHCP Server Configuration file.&lt;br /&gt;
#   see /usr/share/doc/dhcp*/dhcpd.conf.sample&lt;br /&gt;
#   see &#039;man 5 dhcpd.conf&#039;&lt;br /&gt;
#&lt;br /&gt;
&lt;br /&gt;
### Global options&lt;br /&gt;
# General domain information&lt;br /&gt;
option domain-name &amp;quot;alteeve.com&amp;quot;;&lt;br /&gt;
option domain-name-servers 192.139.81.117, 192.139.81.1;&lt;br /&gt;
&lt;br /&gt;
# Tell the server that it&#039;s authoritive on our network.&lt;br /&gt;
authoritive;&lt;br /&gt;
&lt;br /&gt;
# This is required for EL5 operating systems but is optional on EL6 and newer&lt;br /&gt;
# Fedoras (F13+, at least). It controls how dynamic DNS updating is handled. In&lt;br /&gt;
# our case, we aren&#039;t concerned about DDNS so we&#039;ll set it to &#039;none&#039;.&lt;br /&gt;
ddns-update-style none;&lt;br /&gt;
&lt;br /&gt;
### Subnet options&lt;br /&gt;
subnet 10.255.0.0 netmask 255.255.0.0 {&lt;br /&gt;
	# These two options tell clients where to go to get the file needed to&lt;br /&gt;
	# start the boot process.&lt;br /&gt;
        next-server 10.255.255.254;&lt;br /&gt;
        filename &amp;quot;pxelinux.0&amp;quot;;&lt;br /&gt;
	&lt;br /&gt;
	# This is the DHCP server, but not the actual Internet gateway. So this&lt;br /&gt;
	# Argument points our clients to the right box.&lt;br /&gt;
        option routers 10.255.255.254;&lt;br /&gt;
	&lt;br /&gt;
	# Set our range. This can be whatever you want so long as it fits in&lt;br /&gt;
	# your netmask.&lt;br /&gt;
        range 10.255.0.10 10.255.0.250;&lt;br /&gt;
	&lt;br /&gt;
	# If clients don&#039;t ask, make the lease available for the following&lt;br /&gt;
	# number of seconds. If the client does ask, allow up to this number of&lt;br /&gt;
	# seconds. 86,400s = 24h.&lt;br /&gt;
        default-lease-time 86400;&lt;br /&gt;
        max-lease-time 86400;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Restart the DHCP server and you&#039;re done.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/dhcpd restart&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Starting dhcpd:                                            [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== tftp ==&lt;br /&gt;
&lt;br /&gt;
We will use the &#039;trivial FTP&#039; program as it is a PXE-compliant FTP program that can transfers the boot files from the PXE server to the client. It runs as an &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xinetd&amp;lt;/span&amp;gt; package, so we will need to make sure it is installed as well. All told, it lives up to it&#039;s name as it is quite trivial to setup.&lt;br /&gt;
&lt;br /&gt;
First, install them.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install tftp-server xinetd&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then edit &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/xinted.d/tftp&amp;lt;/span&amp;gt; and change &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;disable = yes&amp;lt;/span&amp;gt; to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;disable = no&amp;lt;/span&amp;gt;. The edited file should now look like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/xinetd.d/tftp&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
# default: off&lt;br /&gt;
# description: The tftp server serves files using the trivial file transfer \&lt;br /&gt;
#       protocol.  The tftp protocol is often used to boot diskless \&lt;br /&gt;
#       workstations, download configuration files to network-aware printers, \&lt;br /&gt;
#       and to start the installation process for some operating systems.&lt;br /&gt;
service tftp&lt;br /&gt;
{&lt;br /&gt;
        disable                 = no&lt;br /&gt;
        socket_type             = dgram&lt;br /&gt;
        protocol                = udp&lt;br /&gt;
        wait                    = yes&lt;br /&gt;
        user                    = root&lt;br /&gt;
        server                  = /usr/sbin/in.tftpd&lt;br /&gt;
        server_args             = -s /var/lib/tftpboot&lt;br /&gt;
        disable                 = no&lt;br /&gt;
        per_source              = 11&lt;br /&gt;
        cps                     = 100 2&lt;br /&gt;
        flags                   = IPv4&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Being an &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xinetd&amp;lt;/span&amp;gt; service, that is what we need to enable at boot time and then start.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
chkconfig xinetd on&lt;br /&gt;
/etc/init.d/xinetd restart&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Stopping xinetd:                                           [FAILED]&lt;br /&gt;
Starting xinetd:                                           [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Done!&lt;br /&gt;
&lt;br /&gt;
= pxelinux =&lt;br /&gt;
&lt;br /&gt;
In the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xintd&amp;lt;/span&amp;gt; file for &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;tftp&amp;lt;/span&amp;gt; was this line:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
        server_args             = -s /var/lib/tftpboot&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This determines where the PXE boot files will be setup. Some people like to change this to be &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/tftpboot&amp;lt;/span&amp;gt;, but we&#039;ll keep it there to keep things simple. In Fedora, this directory already exists and should be world-readable. If it isn&#039;t for some reason, create it and set the permissions to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;0755&amp;lt;/span&amp;gt; or &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;0777&amp;lt;/span&amp;gt;, depending on your security requirements.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: On [[EL5]], the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;server_args&amp;lt;/span&amp;gt; value is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;-s /tftpboot&amp;lt;/span&amp;gt;. You can leave this as-is and adapt the rest of the tutorial to this directory if you wish. Otherwise, change this to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/var/lib/tftpboot&amp;lt;/span&amp;gt;. Changing it is recommended as it will facilitate future upgrades or migrations of your configuration.&lt;br /&gt;
&lt;br /&gt;
So now we need to install a package called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;syslinux&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install syslinux&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Setting Up the Boot Environment ==&lt;br /&gt;
&lt;br /&gt;
Next up, we need to copy a couple files into the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;tftpboot&amp;lt;/span&amp;gt; directory. These files are provided by the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;syslinux&amp;lt;/span&amp;gt; package we installed earlier and can be found in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/usr/share/syslinux/&amp;lt;/span&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
The main files are:&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;pxelinux.0&amp;lt;/span&amp;gt;: This is the actual kernel that is passed to the client to begin the boot process. You&#039;ll notice this is the file specified in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;dhcpd.conf&amp;lt;/span&amp;gt; file earlier in our setup. It boots the client far enough so that it can see the boot menu, if any, and then move on to find the main system to boot. This &amp;quot;main system&amp;quot; could be a boot DVD or a full [[OS]].&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vesamenu.c32&amp;lt;/span&amp;gt;: This is the 32-bit [http://syslinux.zytor.com/wiki/index.php/SYSLINUX#COMBOOT_image comboot] file. This enables 32-bit colour images to be used for the boot menu (alpha+rr+gg+bb). This replaces the older 16-colour &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;menu.c32&amp;lt;/span&amp;gt; of earlier version that allow for very basic images.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
rsync -a /usr/share/syslinux/pxelinux.0 /var/lib/tftpboot/&lt;br /&gt;
rsync -a /usr/share/syslinux/vesamenu.c32 /var/lib/tftpboot/&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: On [[EL5]], only &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;pxelinux.0&amp;lt;/span&amp;gt; exists and it is in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/usr/lib/syslinux/&amp;lt;/span&amp;gt;. The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vesamenu.c32&amp;lt;/span&amp;gt; can be copied from an [[EL6]] machine or downloaded from this server&lt;br /&gt;
&lt;br /&gt;
For [[EL5]] users;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
rsync -a /usr/lib/syslinux/pxelinux.0 /var/lib/tftpboot/&lt;br /&gt;
wget -c https://alteeve.com/files/pxe/tftpboot/vesamenu.c32 -P /var/lib/tftpboot/&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Client Configuration Files ===&lt;br /&gt;
&lt;br /&gt;
Client configuration files will be placed in a new directory under &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;tftpboot&amp;lt;/span&amp;gt; called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;pxelinux.cfg&amp;lt;/span&amp;gt;. So to start, we need to create it:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
mkdir /var/lib/tftpboot/pxelinux.cfg&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Before we talk about the contents of the configuration files, it is important to understand how the PXE server decides which one to use for a given client.&lt;br /&gt;
&lt;br /&gt;
When a client connects, the PXE server looks at the client&#039;s [[MAC]] address and checks to see if there is a matching hyphen-separated configuration file. If that isn&#039;t found, it then looks at the client&#039;s IP address, as set by the DHCP server. It looks for configuration files matching the [[hexadecimal]] representation of the IP address. For example, If the client was given the IP address &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;192.168.1.200&amp;lt;/span&amp;gt;, the PXE server will start by looking for a configuration file called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;C0A801C8&amp;lt;/span&amp;gt;. If it doesn&#039;t find a matching file, it will then knock-off the right-most nibble and check again. It will do this until all the possible file names are checked.&lt;br /&gt;
&lt;br /&gt;
If the PXE server finds no configuration file matching the MAC address or any variant on the IP address, it falls back to a configuration file called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;default&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Let&#039;s show this series using the example of a client with MAC address &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;00:24:7e:69:6f:0e&amp;lt;/span&amp;gt; and having been assigned the IP address &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;192.168.1.200&amp;lt;/span&amp;gt;. The PXE server will then look for the following configuration file names in the following order:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
/var/lib/tftpboot/pxelinux.cfg/00-24-7E-69-6F-0E&lt;br /&gt;
/var/lib/tftpboot/pxelinux.cfg/C0A801C8&lt;br /&gt;
/var/lib/tftpboot/pxelinux.cfg/C0A801C&lt;br /&gt;
/var/lib/tftpboot/pxelinux.cfg/C0A801&lt;br /&gt;
/var/lib/tftpboot/pxelinux.cfg/C0A80&lt;br /&gt;
/var/lib/tftpboot/pxelinux.cfg/C0A8&lt;br /&gt;
/var/lib/tftpboot/pxelinux.cfg/C0A&lt;br /&gt;
/var/lib/tftpboot/pxelinux.cfg/C0&lt;br /&gt;
/var/lib/tftpboot/pxelinux.cfg/C&lt;br /&gt;
/var/lib/tftpboot/pxelinux.cfg/default&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I&#039;ve made a little script to convert decimal-type IP addresses into hexadecimal-type specifically to help in naming these configuration files. I am sure there are many others out there.&lt;br /&gt;
* [[ip_to_hex]]&lt;br /&gt;
&lt;br /&gt;
=== The Configuration Files ===&lt;br /&gt;
&lt;br /&gt;
All of the possible configuration files can be setup using the same set of options and can be setup in similar ways. There is nothing special about any given configuration file. For this reason, we will cover the contents of the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;default&amp;lt;/span&amp;gt; configuration file only.&lt;br /&gt;
&lt;br /&gt;
Below is the default configuration file we will use. Comments are embedded explaining each option.&lt;br /&gt;
&lt;br /&gt;
* Direct download: &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/var/lib/tftpboot/pxelinux.cfg/[https://alteeve.com/files/pxe/tftpboot/pxelinux.cfg/default default]&amp;lt;/span&amp;gt;&lt;br /&gt;
* Direct download: &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/var/lib/tftpboot/[https://alteeve.com/files/pxe/tftpboot/an-pxe_splash_1024_768.png an-pxe_splash_1024_768.png]&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /var/lib/tftpboot/pxelinux.cfg/default&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;perl&amp;quot;&amp;gt;&lt;br /&gt;
# Use the high-colour menu system. This file, and the low-colour &#039;menu.c32&#039;&lt;br /&gt;
# version, are provided by the syslinux package and can be found in the&lt;br /&gt;
# &#039;/var/lib/tftpboot&#039; directory. Copy it to &#039;/var/lib/tftpboot&#039;.&lt;br /&gt;
UI vesamenu.c32&lt;br /&gt;
&lt;br /&gt;
# Time out and use the default menu option. Defined as tenths of a second.&lt;br /&gt;
TIMEOUT 600&lt;br /&gt;
&lt;br /&gt;
# Prompt the user. Set to &#039;1&#039; to automatically choose the default option. This&lt;br /&gt;
# is really meant for files matched to MAC addresses.&lt;br /&gt;
PROMPT 0&lt;br /&gt;
&lt;br /&gt;
# Set the boot menu to be 1024x768 with a nice background image. Be careful to&lt;br /&gt;
# ensure that all your user&#039;s can see this resolution! Default is 640x480.&lt;br /&gt;
MENU RESOLUTION 1024 768&lt;br /&gt;
# This file must be in or under the &#039;/var/lib/tftpboot&#039; folder.&lt;br /&gt;
MENU BACKGROUND an-pxe_splash_1024_768.png&lt;br /&gt;
&lt;br /&gt;
# These do not need to be set. I set them here to show how you can customize or&lt;br /&gt;
# localize your PXE server&#039;s dialogue.&lt;br /&gt;
MENU TITLE    AN!PXE Boot Server&lt;br /&gt;
# Below, the hash (#) character is replaced with the countdown timer. The&lt;br /&gt;
# &#039;{,s}&#039; allows for pluralizing a word and is used when the value is &amp;gt;= &#039;2&#039;.&lt;br /&gt;
MENU AUTOBOOT Will boot the next device as configured in your BIOS in # second{,s}.&lt;br /&gt;
MENU TABMSG   Press the &amp;lt;tab&amp;gt; key to edit the boot parameters of the highlighted option.&lt;br /&gt;
MENU NOTABMSG Editing of this option is disabled.&lt;br /&gt;
&lt;br /&gt;
# The following options set the various colours used in the menu. All possible&lt;br /&gt;
# options are specified except for F# help options. The colour is expressed as&lt;br /&gt;
# two hex characters between &#039;00&#039; and &#039;ff&#039; for alpha, red, green and blue&lt;br /&gt;
# respectively (#AARRGGBB).&lt;br /&gt;
# Format is: MENU COLOR &amp;lt;Item&amp;gt; &amp;lt;ANSI Seq.&amp;gt; &amp;lt;foreground&amp;gt; &amp;lt;background&amp;gt; &amp;lt;shadow type&amp;gt;&lt;br /&gt;
MENU COLOR screen      0  #80ffffff #00000000 std      # background colour not covered by the splash image&lt;br /&gt;
MENU COLOR border      0  #ffffffff #ee000000 std      # The wire-frame border&lt;br /&gt;
MENU COLOR title       0  #ffff3f7f #ee000000 std      # Menu title text&lt;br /&gt;
MENU COLOR sel         0  #ff00dfdf #ee000000 std      # Selected menu option&lt;br /&gt;
MENU COLOR hotsel      0  #ff7f7fff #ee000000 std      # The selected hotkey (set with ^ in MENU LABEL)&lt;br /&gt;
MENU COLOR unsel       0  #ffffffff #ee000000 std      # Unselected menu options&lt;br /&gt;
MENU COLOR hotkey      0  #ff7f7fff #ee000000 std      # Unselected hotkeys (set with ^ in MENU LABEL)&lt;br /&gt;
MENU COLOR tabmsg      0  #c07f7fff #00000000 std      # Tab text&lt;br /&gt;
MENU COLOR timeout_msg 0  #8000dfdf #00000000 std      # Timout text&lt;br /&gt;
MENU COLOR timeout     0  #c0ff3f7f #00000000 std      # Timout counter&lt;br /&gt;
MENU COLOR disabled    0  #807f7f7f #ee000000 std      # Disabled menu options, including SEPARATORs&lt;br /&gt;
MENU COLOR cmdmark     0  #c000ffff #ee000000 std      # Command line marker - The &#039;&amp;gt; &#039; on the left when editing an option&lt;br /&gt;
MENU COLOR cmdline     0  #c0ffffff #ee000000 std      # Command line - The text being edited&lt;br /&gt;
# Options below haven&#039;t been tested, descriptions may be lacking.&lt;br /&gt;
MENU COLOR scrollbar   0  #40000000 #00000000 std      # Scroll bar&lt;br /&gt;
MENU COLOR pwdborder   0  #80ffffff #20ffffff std      # Password box wire-frame border&lt;br /&gt;
MENU COLOR pwdheader   0  #80ff8080 #20ffffff std      # Password box header&lt;br /&gt;
MENU COLOR pwdentry    0  #80ffffff #20ffffff std      # Password entry field&lt;br /&gt;
MENU COLOR help        0  #c0ffffff #00000000 std      # Help text, if set via &#039;TEXT HELP ... ENDTEXT&#039;&lt;br /&gt;
&lt;br /&gt;
## To keep the menu from getting out of hand, I like to create sub-menus.&lt;br /&gt;
## The sub-menus are simply additional files in the same directory as this&lt;br /&gt;
## file with one or more boot options or, if you wish, further sub-menus.&lt;br /&gt;
&lt;br /&gt;
# As I build a lot of clusters, I like to have a section dedicated to boot&lt;br /&gt;
# options used to build cluster nodes. These are the EL6 + RHCS 3 nodes.&lt;br /&gt;
MENU BEGIN cluster_rhel&lt;br /&gt;
        MENU TITLE Cluster 3 nodes - RHEL 6&lt;br /&gt;
        LABEL Previous&lt;br /&gt;
        MENU LABEL ^B) Previous Menu&lt;br /&gt;
        MENU EXIT&lt;br /&gt;
        MENU SEPARATOR&lt;br /&gt;
        MENU INCLUDE pxelinux.cfg/cluster3-rhel.menu&lt;br /&gt;
MENU END&lt;br /&gt;
&lt;br /&gt;
# As I build a lot of clusters, I like to have a section dedicated to boot&lt;br /&gt;
# options used to build cluster nodes. These are the EL6 + RHCS 3 nodes.&lt;br /&gt;
MENU BEGIN cluster_centos&lt;br /&gt;
        MENU TITLE Cluster 3 nodes - CentOS 6&lt;br /&gt;
        LABEL Previous&lt;br /&gt;
        MENU LABEL ^C) Previous Menu&lt;br /&gt;
        MENU EXIT&lt;br /&gt;
        MENU SEPARATOR&lt;br /&gt;
        MENU INCLUDE pxelinux.cfg/cluster3-centos.menu&lt;br /&gt;
MENU END&lt;br /&gt;
&lt;br /&gt;
# As I build a lot of clusters, I like to have a section dedicated to boot&lt;br /&gt;
# options used to build cluster nodes. These are the EL6 + RHCS 3 nodes.&lt;br /&gt;
MENU BEGIN cluster_fedora&lt;br /&gt;
        MENU TITLE Cluster 3 nodes - Fedora&lt;br /&gt;
        LABEL Previous&lt;br /&gt;
        MENU LABEL ^D) Previous Menu&lt;br /&gt;
        MENU EXIT&lt;br /&gt;
        MENU SEPARATOR&lt;br /&gt;
        MENU INCLUDE pxelinux.cfg/cluster3-fedora.menu&lt;br /&gt;
MENU END&lt;br /&gt;
&lt;br /&gt;
# This section covers base options without pre-defined kickstart (or other)&lt;br /&gt;
# automation scripts.&lt;br /&gt;
MENU BEGIN base&lt;br /&gt;
        MENU TITLE Base installations (as if booting from media)&lt;br /&gt;
        LABEL Previous&lt;br /&gt;
        MENU LABEL ^E) Previous Menu&lt;br /&gt;
        MENU EXIT&lt;br /&gt;
        MENU SEPARATOR&lt;br /&gt;
        MENU INCLUDE pxelinux.cfg/base.menu&lt;br /&gt;
MENU END&lt;br /&gt;
&lt;br /&gt;
# This section covers generic server installs&lt;br /&gt;
MENU BEGIN stock&lt;br /&gt;
        MENU TITLE Stock installations (common, generic server types)&lt;br /&gt;
        LABEL Previous&lt;br /&gt;
        MENU LABEL ^F) Previous Menu&lt;br /&gt;
        MENU EXIT&lt;br /&gt;
        MENU SEPARATOR&lt;br /&gt;
        MENU INCLUDE pxelinux.cfg/stock.menu&lt;br /&gt;
MENU END&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;default&amp;lt;span&amp;gt; file above points to four sub-menu files. How many you use, if you use any at all, is up to you. You can also use any file name you want, or any directory under &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/var/lib/tftpboot/&amp;lt;span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
To save space on this page, The sub-menu files mentioned above are their own pages and are linked below. These will hopefully act as useful references for your own sub-menu files, should you wish to use menus.&lt;br /&gt;
&lt;br /&gt;
* [[pxe_generic.menu|generic.menu]]&lt;br /&gt;
* [[pxe_cluster.menu|cluster.menu]]&lt;br /&gt;
* [[pxe_stock.menu|stock.menu]]&lt;br /&gt;
* [[pxe_live.menu|live.menu]]&lt;br /&gt;
&lt;br /&gt;
=== Options ===&lt;br /&gt;
&lt;br /&gt;
Let&#039;s now take a look at the various parts. This is an overview only, for a complete list of options please read &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/usr/share/doc/syslinux-3.84/menu.txt&amp;lt;/span&amp;gt;. Update the version number to match your installed version.&lt;br /&gt;
&lt;br /&gt;
Wherever a colour can be specified, the format is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;#AARRGGBB&amp;lt;/span&amp;gt;. That is, alpha (transparency), red, green and blue intensity expressed as a 256 range specified using two [[hexadecimal]] characters per option. &lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;UI vesamenu.c32&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This loads the 32-bit colour [http://syslinux.zytor.com/wiki/index.php/SYSLINUX#COMBOOT_image COMBOOT] image. This allows for the full colour range plus 8-bit alpha (transparency) to be available at boot time. It&#039;s what allows for a much more attractive boot menu. To read details on the innards of the COMBOOT format, read &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/usr/share/doc/syslinux-3.84/comboot.txt&amp;lt;/span&amp;gt;. Update the version number to match your installed version.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;TIMEOUT 600&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is the amount of time, in tenths of a second, that the PXE loader will wait before performing the default action. If the user navigates through the menu. the timer will stop and wait for the user to make a selection. To prevent an install from running accidentally, the default option should always be a non-damaging option.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;prompt 0&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This tells the PXE server to prompt the user to make a choice. If this is set to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt; then the PXE server will use the default option.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;MENU RESOLUTION 1024 768&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This tells the boot loader to run at the set resolution, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;1024x768&amp;lt;/span&amp;gt; in this example. The default is to run up as &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vga (640x480)&amp;lt;/span&amp;gt;. Be sure when pushing a higher resolution that all of your potential users have machines that support the given resolution.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;MENU BACKGROUND an-pxe_splash_1024_768.png&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is the background image to use. This must exist in or under the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/var/lib/tftpboot/&amp;lt;/span&amp;gt; directory. If you want to use a subdirectory, specify it as a relative path. For example, if you want to store images in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/var/lib/tftpboot/images/&amp;lt;/span&amp;gt;, then this would be set to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;images/an-pxe_splash_1024_768.png&amp;lt;/span&amp;gt;. The format of the image can be &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;JPEG&amp;lt;/span&amp;gt; or The format of the image can be &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;JPNG&amp;lt;/span&amp;gt; (other image formats may work). The image itself should match the size of the screen.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;MENU TITLE    AN!PXE Boot Server&amp;lt;/span&amp;gt;&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;MENU AUTOBOOT Will boot the next device as configured in your BIOS in # second{,s}.&amp;lt;/span&amp;gt;&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;MENU TABMSG   Press the &amp;lt;tab&amp;gt; key to edit the boot parameters of the highlighted option.&amp;lt;/span&amp;gt;&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;MENU NOTABMSG Editing of this option is disabled.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These options allow you to customize or localize the text. None need to be specified.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;AUTOBOOT&amp;lt;/span&amp;gt; option is a little special to accommodate the count-down. The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;#&amp;lt;/span&amp;gt; will be replaced by the time remaining. The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;{,s}&amp;lt;/span&amp;gt; tells the string to add an &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;s&amp;lt;/span&amp;gt; to the end of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;seconds&amp;lt;/span&amp;gt; when the time remaining is greater than one.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;MENU COLOR x&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These options control the colour and transparency of the various text-elements, borders and backgrounds. None of them need to be specified and all have sane default values. Most of the available options are shown in the example above.&lt;br /&gt;
&lt;br /&gt;
Each entry is formatted like so:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;MENU COLOR &amp;lt;type&amp;gt; &amp;lt;ansi&amp;gt; &amp;lt;foreground&amp;gt; &amp;lt;background&amp;gt; &amp;lt;shadow&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;type&amp;gt;&amp;lt;/span&amp;gt; is the name of the element you are manipulating. The only &#039;type&#039; not show in the example above is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;msgXX&amp;lt;/span&amp;gt; where &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;XX&amp;lt;/span&amp;gt; is a number between &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;12&amp;lt;/span&amp;gt;. These are used to control &amp;quot;help windows&amp;quot; that can be shown to the user when they press an &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;F[1-12]&amp;lt;/span&amp;gt; key.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;ansi&amp;gt;&amp;lt;/span&amp;gt; number(s) tell the boot loader how to format the text using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[ANSI]]&amp;lt;/span&amp;gt; code. This is set to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;0&amp;lt;/span&amp;gt;, &amp;quot;reset&amp;quot;, in our example to clear any &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ANSI&amp;lt;/span&amp;gt; formatting. You can specify multiple &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ANSI&amp;lt;/span&amp;gt; codes by separating them with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;;&amp;lt;/span&amp;gt; (semi-colons).&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;foreground&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;background&amp;gt;&amp;lt;/span&amp;gt; values are the [[hexadecimal]] notation for the transparency and colour in the format &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;#AARRGGBB&amp;lt;/span&amp;gt; as mentioned earlier.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;shadow&amp;gt;&amp;lt;/span&amp;gt; is the type of drop-shadow to render for the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;type&amp;gt;&amp;lt;/span&amp;gt;. Valid options are:&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;none&amp;lt;/span&amp;gt;: No shadowing.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;std&amp;lt;/span&amp;gt;, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;standard&amp;lt;/span&amp;gt;: Foreground pixels are raised.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;all&amp;lt;/span&amp;gt;: both foreground and background pixels are raised.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rev&amp;lt;/span&amp;gt;, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;reverse&amp;lt;/span&amp;gt;: Background pixels are raised.&lt;br /&gt;
&lt;br /&gt;
=== Labels ===&lt;br /&gt;
&lt;br /&gt;
Label blocks are the actual boot options made available within the PXE menu. There are many options available here that are not shown in this example. If you are curious, please read &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/usr/share/doc/syslinux-3.84/menu.txt&amp;lt;/span&amp;gt; which was installed on your system when you installed &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;syslinux&amp;lt;/span&amp;gt;. Of course, replace &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;3.84&amp;lt;/span&amp;gt; with the version you have installed.&lt;br /&gt;
&lt;br /&gt;
First example;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
LABEL next&lt;br /&gt;
	MENU LABEL ^A)  Boot the next device as configured in your BIOS&lt;br /&gt;
	MENU DEFAULT&lt;br /&gt;
	localboot&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This example is a good one to always use as the first, and default, option. &lt;br /&gt;
&lt;br /&gt;
The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;LABEL next&amp;lt;/span&amp;gt; defines this option group. The name &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;next&amp;lt;/span&amp;gt; has no special meaning, but can be used for more complex setups later. For now, just be sure to keep this name simple with no spaces.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;MENU LABEL ...&amp;lt;/span&amp;gt; option control two things. First, it&#039;s the text shown to the user. Second, the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;^A&amp;lt;/span&amp;gt; sets the keyboard key that the user can press to select the option. Whatever character comes immediately after the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;/span&amp;gt; (caret), &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;A&amp;lt;/span&amp;gt; in this example, becomes the mapped key. Please note that the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;^&amp;lt;/span&amp;gt; can come anywhere in the title text. Ensure that no two entries have the same character mapped!&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;MENU DEFAULT&amp;lt;/span&amp;gt; command tells the boot loader to automatically boot this option if the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;TIMEOUT&amp;lt;/span&amp;gt; expires. Only one entry may have this option.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;localboot&amp;lt;/span&amp;gt; is a special command the skips the PXE boot loader. Your BIOS should proceed to boot the next device in it&#039;s boot order list. Generally this will boot the local hard drive.&lt;br /&gt;
&lt;br /&gt;
Another example, from the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cluster3-rhel.menu&amp;lt;/span&amp;gt; file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
LABEL rhel6_an-node01&lt;br /&gt;
        MENU LABEL ^1) Install AN!Node01; Storage Node 01 - Cluster 3&lt;br /&gt;
        KERNEL boot/rhel6/x86_64/vmlinuz&lt;br /&gt;
        APPEND initrd=boot/rhel6/x86_64/initrd.img ks=http://192.168.1.254/rhel6/x86_64/ks/an-node01.ks #ksdevice=eth1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is a pretty typical entry. The two new options to note are:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;KERNEL ...&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is the path to the boot kernel used to start the OS or it&#039;s installer. Most distributions make use of a small kernel to run up their installer or Live CD/DVD environment. The PXE server will search for the kernel relative to the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;tftpboot&amp;lt;/span&amp;gt; directory. Where to get the proper boot kernel will depend on the distribution you are setting up. &lt;br /&gt;
&lt;br /&gt;
Some examples will be [[#Setting Up The Boot Environment|shown below]].&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;APPEND ...&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This argument allows you to pass arguments to the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;KERNEL&amp;lt;/span&amp;gt; specified above. Which options can be passed will, again, depend on the distribution you are setting up. In this example, an &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;initrd&amp;lt;/span&amp;gt; image is specified, a kickstart script is set and the network device to use to search for the kickstart script are defined.&lt;br /&gt;
&lt;br /&gt;
The [[Setting_Up_a_PXE_Server_in_Fedora#Making_The_Install_Files_For_An_OS_Available|Apache configuration]] section below covers in more detail how to make the kickstart and OS installation files available.&lt;br /&gt;
&lt;br /&gt;
=== Menus ===&lt;br /&gt;
&lt;br /&gt;
Menus are very useful when you have more than a few entries in your PXE server. They allow for creating groups of bootable options based on whatever given criteria works for you.&lt;br /&gt;
&lt;br /&gt;
Let&#039;s look at the &amp;quot;cluster&amp;quot; menu from above.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
MENU BEGIN cluster_rhel&lt;br /&gt;
        MENU TITLE Cluster 3 nodes - RHEL 6&lt;br /&gt;
        LABEL Previous&lt;br /&gt;
        MENU LABEL ^B) Previous Menu&lt;br /&gt;
        MENU EXIT&lt;br /&gt;
        MENU SEPARATOR&lt;br /&gt;
        MENU INCLUDE pxelinux.cfg/cluster3-rhel.menu&lt;br /&gt;
MENU END&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;MENU BEGIN ...&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This begins the section and is followed by a name that should (must?) be unique.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;MENU TITLE ...&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is the text shown at the top of the sub-menu once selected.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;LABEL ...&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is the text shown as the first option in the sub-menu that returns to the previous screen.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;MENU LABEL ...&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is the text that the user selects to descend into the sub-menu.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: I use the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;^&amp;lt;/span&amp;gt; character to enable a letter to select the menu option but it doesn&#039;t seem to work. Please let me know if you have further information on how, or if, sub-menu options are selected with a key press.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;MENU EXIT ...&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I am not sure, exactly, what this option does.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;MENU SEPARATOR ...&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I am not sure, exactly, what this option does.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;MENU INCLUDE ...&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is the path and file to include when building this sub-menu. The path is relative to the tftpboot &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;server_args&amp;lt;/span&amp;gt; directory, as set in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/xinetd.d/tftp&amp;lt;/span&amp;gt; file.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;MENU END&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This closes the sub-menu section. &lt;br /&gt;
&lt;br /&gt;
There are other options, though none seem to be well documented at the moment. I got this far thanks to [https://help.ubuntu.com/community/PXEInstallMultiDistro this page]. Any additional information on these and other options would be welcome!&lt;br /&gt;
&lt;br /&gt;
= Setting Up Apache =&lt;br /&gt;
&lt;br /&gt;
[[Image:c6_httpd_default_page_01.png|thumb|right|400px|Default Apache2 web page on CentOS 6.]]&lt;br /&gt;
&lt;br /&gt;
We will use the Apache web server to make our operating system images available. First, install the server.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install httpd&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The default install of Apache2 will work fine for us, so we won&#039;t adjust it. Let&#039;s start it now.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/httpd start&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Test access by loading [http://10.255.255.254 http://10.255.255.254] a machine on your network, replacing &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;10.255.255.254&amp;lt;/span&amp;gt; with a resolvable name or IP address of your machine. If this doesn&#039;t work, make sure [[TCP]] port 80 is open on your firewall/PXE server.&lt;br /&gt;
&lt;br /&gt;
== Setting Up The DocumentRoot ==&lt;br /&gt;
&lt;br /&gt;
Apache has a variable called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;DocumentRoot&amp;lt;/span&amp;gt; in it&#039;s main configuration file &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/httpd/conf/httpd.conf&amp;lt;/span&amp;gt;. Anything in or under the directory specified in this variable will be exposed on your web server. The default directory is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/var/www/html&amp;lt;/span&amp;gt; and this will be where we put our various kickstart files, ISO files and under which we will mount those ISO files.&lt;br /&gt;
&lt;br /&gt;
== The Default Page ==&lt;br /&gt;
&lt;br /&gt;
There is no need to create an &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;index.html&amp;lt;/span&amp;gt; page, as the image kickstart scripts and image files will be called directly. Personally though, I like to put together a simple page listing the various installations I&#039;ve made available on the PXE server. If nothing else, it helps identify the machine when you call it in a browser.&lt;br /&gt;
&lt;br /&gt;
If you decide to create one, please use whatever website tool, text editor or [[Integrated Development Environment|IDE]] you prefer. For reference, below are the very simple, probably not [[W3C]] compliant static [[HTML]] page I use along with a trivial [[CSS]] file.&lt;br /&gt;
&lt;br /&gt;
* [[PXE Server index.html]]&lt;br /&gt;
* [[PXE Server common.css]]&lt;br /&gt;
&lt;br /&gt;
Put the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;index.html&amp;lt;/span&amp;gt; (and associated files) directly in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;DocumentRoot&amp;lt;/span&amp;gt; directory. By default, Apache2 will look for a file named &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;index.html&amp;lt;/span&amp;gt; and load it if it is found.&lt;br /&gt;
&lt;br /&gt;
== Making The Install Files For An OS Available ==&lt;br /&gt;
&lt;br /&gt;
At the end of the day, the only thing that matters here is that all of the installation files and kickstart scripts are &#039;&#039;somewhere&#039;&#039; under the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;DocumentRoot&amp;lt;/span&amp;gt; directory. I will describe here the layout that I like, but feel free to adjust it however you see fit. &lt;br /&gt;
&lt;br /&gt;
Further, different operating systems will need to be configured differently. For the purpose of this tutorial, I will be showing how RPM-based [[Linux]] distributions are configured. If you are using different operating systems, you should be able to build on the steps below.&lt;br /&gt;
&lt;br /&gt;
=== Planning Your Directory Structure ===&lt;br /&gt;
&lt;br /&gt;
Under the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;DocumentRoot&amp;lt;/span&amp;gt; directory, we will need to create a set of directories to store the operating system files and associated kickstart scripts in. I&#039;ve found the following structure works well.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;DocumentRoot&amp;gt;/&amp;lt;os_name&amp;gt;/&amp;lt;architecture&amp;gt;/[ks|iso|img]&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Using [[CentOS]] v6, [[x86_64]] with the default Apache &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;DocumentRoot&amp;lt;/span&amp;gt; as an example, you would create the following directories. Note that I like to shorten Operating System names to the shortest version practical to save typing. Feel free to use the full names if you prefer verbose [[URL]]s.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/var/www/html/c6/x86_64/ks&amp;lt;/span&amp;gt;: Kickstart scripts go here&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/var/www/html/c6/x86_64/iso&amp;lt;/span&amp;gt;: The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[http://mirror.its.sfu.ca/mirror/CentOS/6.2/isos/x86_64/CentOS-6.2-x86_64-bin-DVD1.iso CentOS-6.2-x86_64-bin-DVD1.iso]&amp;lt;/span&amp;gt; file is saved here. Alternatively, you can find [http://www.centos.org/modules/tinycontent/index.php?id=30 a mirror] closer to you.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/var/www/html/c6/x86_64/img&amp;lt;/span&amp;gt;: The [[ISO]] file above is mounted here.&lt;br /&gt;
&lt;br /&gt;
If you wanted to also make the [[i386]] version of CentOS available, simply replace &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;x86_64&amp;lt;/span&amp;gt; with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;i386&amp;lt;/span&amp;gt; above.&lt;br /&gt;
&lt;br /&gt;
=== CentOS 6 x86_64 ===&lt;br /&gt;
&lt;br /&gt;
Let&#039;s walk through the actual steps needed to make CentOS 6.2 x86_64 available on Apache now.&lt;br /&gt;
&lt;br /&gt;
First, create the directory structure.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
mkdir -p /var/www/html/c6/x86_64/{iso,img,ks}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now, download the ISO if you have not yet done so. If you have, move it into place.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cd /var/www/html/c6/x86_64/iso&lt;br /&gt;
wget -c http://centos.alteeve.com/6.2/isos/x86_64/CentOS-6.2-x86_64-bin-DVD1.iso&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we mount the ISO using a [[loop-back]] device.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
mount -o loop /var/www/html/c6/x86_64/iso/CentOS-6.2-x86_64-bin-DVD1.iso /var/www/html/c6/x86_64/img&lt;br /&gt;
df -hP&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Filesystem            Size  Used Avail Use% Mounted on&lt;br /&gt;
/dev/mapper/luks-51fbeed6-2efc-4eef-a8d6-8431a4fcceb8  454G   18G  414G   5% /&lt;br /&gt;
tmpfs                 1.9G     0  1.9G   0% /dev/shm&lt;br /&gt;
/dev/sda1            1008M   92M  866M  10% /boot&lt;br /&gt;
/var/www/html/c6/x86_64/iso/CentOS-6.2-x86_64-bin-DVD1.iso  4.2G  4.2G     0 100% /var/www/html/c6/x86_64/img&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Lastly, copy any kickstart scripts into the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/var/www/html/c6/x86_64/ks/&amp;lt;/span&amp;gt; directory. These scripts will be called by the user after they select an automated install option from the PXE menu.&lt;br /&gt;
&lt;br /&gt;
That&#039;s it! You can now use make CentOS 6.2 available as a PXE boot option in your menu.&lt;br /&gt;
&lt;br /&gt;
== Mounting And Unmounting Many ISOs ==&lt;br /&gt;
&lt;br /&gt;
If you make any real use of your PXE server, you will probably find that you will have a lot of ISO files to mount and unmount. To simplify this task, I like to create a couple of bash scripts called, simply, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;mount_iso.sh&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;umount_iso.sh&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
These are simple shell scripts meant to mount and unmount all ISOs with one command. You need to be sure that you keep them up to date as you add and remove operating systems.&lt;br /&gt;
&lt;br /&gt;
You will certainly want to adjust these to suit your setup. With that said, here are my scripts that you can use as templates.&lt;br /&gt;
&lt;br /&gt;
Mount;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /root/mount_iso.sh &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
# This is used to mount the various ISO used by the PXE server on this server.&lt;br /&gt;
&lt;br /&gt;
echo -n &amp;quot;Mounting RHEL 6.2, x86_64... &amp;quot;&lt;br /&gt;
mount -o loop /var/www/html/rhel6/x86_64/iso/rhel-server-6.2-x86_64-dvd.iso /var/www/html/rhel6/x86_64/img&lt;br /&gt;
echo &amp;quot;Done!&amp;quot;&lt;br /&gt;
&lt;br /&gt;
echo -n &amp;quot;Mounting CentOS 6.2, x86_64... &amp;quot;&lt;br /&gt;
mount -o loop /var/www/html/c6/x86_64/iso/CentOS-6.2-x86_64-bin-DVD1.iso /var/www/html/c6/x86_64/img&lt;br /&gt;
echo &amp;quot;Done!&amp;quot;&lt;br /&gt;
&lt;br /&gt;
echo -n &amp;quot;Mounting Fedora 16, x86_64... &amp;quot;&lt;br /&gt;
mount -o loop /var/www/html/f16/x86_64/iso/Fedora-16-x86_64-DVD.iso /var/www/html/f16/x86_64/img&lt;br /&gt;
echo &amp;quot;Done!&amp;quot;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Unmount;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /root/umount_iso.sh &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
# This is used to unmount the various ISO used by the PXE server on this server.&lt;br /&gt;
&lt;br /&gt;
echo -n &amp;quot;Unmounting RHEL 6.2, x86_64... &amp;quot;&lt;br /&gt;
umount /var/www/html/rhel6/x86_64/img&lt;br /&gt;
echo &amp;quot;Done!&amp;quot;&lt;br /&gt;
&lt;br /&gt;
echo -n &amp;quot;Unmounting CentOS 6.2, x86_64... &amp;quot;&lt;br /&gt;
umount /var/www/html/c6/x86_64/img&lt;br /&gt;
echo &amp;quot;Done!&amp;quot;&lt;br /&gt;
&lt;br /&gt;
echo -n &amp;quot;Unmounting Fedora 16, x86_64... &amp;quot;&lt;br /&gt;
umount /var/www/html/f16/x86_64/img&lt;br /&gt;
echo &amp;quot;Done!&amp;quot;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Increasing Maximum number of Mountable ISOs ===&lt;br /&gt;
&lt;br /&gt;
By default the loop driver only creates 8 loop back devices. Each mounted [[ISO]] takes one of those and there for limits the total number of ISOs that can be mounted at any one time.&lt;br /&gt;
&lt;br /&gt;
There exist two places to change the maximum number of loop back devices.&lt;br /&gt;
The recommend method is to add max_loop option to a new config file in /etc/modprobe.d/.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/modprobe.d/loop.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
options loop max_loop=64&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The second options is to add &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;max_loop=64&amp;lt;/span&amp;gt; to the kernel boot line.&lt;br /&gt;
&lt;br /&gt;
Adjust the number after &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;max_loop=&amp;lt;/span&amp;gt; to suit your installations needs.&lt;br /&gt;
&lt;br /&gt;
= Setting Up The Boot Environment =&lt;br /&gt;
&lt;br /&gt;
All boot options, except &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;localboot&amp;lt;/span&amp;gt;, need to have a kernel made available via the PXE server. Specifically, these kernels must exist somewhere under the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/var/lib/tftpboot&amp;lt;/span&amp;gt; directory. What kernel or boot image a given operating system will need depends entirely on that operating system. For this section, we will continue to use CentOS 6 x86_64 as an example.&lt;br /&gt;
&lt;br /&gt;
== Planning Your Directory Structure, Take Two ==&lt;br /&gt;
&lt;br /&gt;
As with [[#Planning Your Directory Structure|Apache]], we&#039;re potentially going to copy a lot of boot images and other files. It makes sense to have an organized directory structure to put them all in. As before, I will share what I do, but please feel free to do what you find works best for you. &lt;br /&gt;
&lt;br /&gt;
I like to create a dedicated directory called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;boot&amp;lt;/span&amp;gt; and then mimic the layout from Apache, minus the last set of three directories.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;tftpboot&amp;gt;/boot/&amp;lt;os_name&amp;gt;/&amp;lt;architecture&amp;gt;/&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using CentOS 6 x86_64 with the default &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;tftpboot&amp;lt;/span&amp;gt; install, I will create the following directory.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
mkdir -p /var/lib/tftpboot/boot/c6/x86_64&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== The Bootable Kernel ==&lt;br /&gt;
&lt;br /&gt;
Remember in the earlier &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;LABEL c6_an-node01&amp;lt;/span&amp;gt; example there was the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;APPEND initrd=boot/c6/x86_64/initrd.img ...&amp;lt;/span&amp;gt; line? The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;boot/c6/x86_64/initrd.img&amp;lt;/span&amp;gt; is the kernel, in the directory we just created!&lt;br /&gt;
&lt;br /&gt;
The last piece of the puzzle then is; Where does the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;initrd.img&amp;lt;/span&amp;gt; file come from?&lt;br /&gt;
&lt;br /&gt;
With most Linux distributions, there is an &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;isolinux&amp;lt;/span&amp;gt; directory in the root of the installation DVD. The files needed to boot the DVD&#039;s installer (or &amp;quot;rescue mode&amp;quot;) are in this directory. These are the same files we need to boot over PXE. If you have followed this tutorial up to this point, then you should be able to see the contents of this directory in your file browser. My PXE server uses the IP address &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;192.168.1.254&amp;lt;/span&amp;gt;, so I can go to &lt;br /&gt;
&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;http://10.255.255.254/c6/x86_64/img/isolinux&amp;lt;/span&amp;gt; and see, among other files, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;initrd.img&amp;lt;/span&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
With the directory created and the ISO mounted, all that is left is to copy the contents of the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;isolinux&amp;lt;/span&amp;gt; files.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
rsync -av /var/www/html/c6/x86_64/img/isolinux/* /var/lib/tftpboot/boot/c6/x86_64/&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
sending incremental file list&lt;br /&gt;
TRANS.TBL&lt;br /&gt;
boot.cat&lt;br /&gt;
boot.msg&lt;br /&gt;
grub.conf&lt;br /&gt;
initrd.img&lt;br /&gt;
isolinux.bin&lt;br /&gt;
isolinux.cfg&lt;br /&gt;
memtest&lt;br /&gt;
splash.jpg&lt;br /&gt;
vesamenu.c32&lt;br /&gt;
vmlinuz&lt;br /&gt;
&lt;br /&gt;
sent 35199717 bytes  received 221 bytes  23466625.33 bytes/sec&lt;br /&gt;
total size is 35194744  speedup is 1.00&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And we&#039;re done! &lt;br /&gt;
&lt;br /&gt;
Now repeat the relevant steps for the rest of the operating systems you want to support via PXE.&lt;br /&gt;
&lt;br /&gt;
= Credits =&lt;br /&gt;
&lt;br /&gt;
References used:&lt;br /&gt;
* [http://linux-sxs.org/internet_serving/pxeboot.html Linux-SXS]&lt;br /&gt;
* [https://help.ubuntu.com/community/PXEInstallMultiDistro Ubuntu]&lt;br /&gt;
* [http://www.c3.hu/docs/oreilly/tcpip/tcpip/appd_03.htm O&#039;Reilly]&lt;br /&gt;
* [http://www.linuxdoc.org/HOWTO/CDServer-HOWTO/addloops.html linuxdoc.org]&lt;br /&gt;
&lt;br /&gt;
{{footer}}&lt;/div&gt;</summary>
		<author><name>SRSullivan</name></author>
	</entry>
	<entry>
		<id>https://alteeve.com/w/index.php?title=Setting_Up_a_PXE_Server_on_an_RPM-based_OS&amp;diff=3699</id>
		<title>Setting Up a PXE Server on an RPM-based OS</title>
		<link rel="alternate" type="text/html" href="https://alteeve.com/w/index.php?title=Setting_Up_a_PXE_Server_on_an_RPM-based_OS&amp;diff=3699"/>
		<updated>2011-09-29T17:32:46Z</updated>

		<summary type="html">&lt;p&gt;SRSullivan: Undo revision 3698 by SRSullivan (talk), Symlinks trying to leave tftp&amp;#039;s chroot fail.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{howto_header}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= About this Tutorial =&lt;br /&gt;
&#039;&#039;&#039;Dec. 30, 2010&#039;&#039;&#039;: This tutorial has been confirmed to work on [[RHEL]] 6.0 and Fedora 13+.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Nov. 08, 2010&#039;&#039;&#039;: This is the first draft of the final tutorial. As such, should be fairly safe to follow, though mistakes and omissions may exist. Suggestions for clarification are also appreciated.&lt;br /&gt;
&lt;br /&gt;
This tutorial covers the steps needed to make a [http://en.wikipedia.org/wiki/Preboot_Execution_Environment PXE] server. It will be used for hosting multiple [[Operating Systems]] that can be booted from a machine&#039;s network card. The main reason for this setup is to host installation media removing the requirement for have optical drives in machines. It also saves you from having a pile of optical discs kicking around.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Prerequisite ==&lt;br /&gt;
&lt;br /&gt;
This tutorial assumes that you have a fresh install of [[Fedora]] 13+ and/or RHEL 6.0 and that the machine&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth0&amp;lt;/span&amp;gt; device has been statically set to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;192.168.1.10&amp;lt;/span&amp;gt; and the subnet&#039;s router is set to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;192.168.1.1&amp;lt;/span&amp;gt;. This should be easy to adapt to other distributions and network configurations.&lt;br /&gt;
&lt;br /&gt;
== Parts Needed ==&lt;br /&gt;
&lt;br /&gt;
A PXE boot server is fairly strait forward. You need:&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;dhcp&amp;lt;/span&amp;gt;; This answers a workstation&#039;s request for an IP during the boot process.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;tftp-server&amp;lt;/span&amp;gt;; This is a PXE compliant FTP server than handles passing the core boot files to the remote machine.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;syslinux&amp;lt;/span&amp;gt;; This handles those special boot files that the remote machine needs to boot.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;httpd&amp;lt;/span&amp;gt;; Once the boot files start up the remote machine, generally you will tell it to pull the main files from a webserver. This is the Apache webserver that will server that purpose.&lt;br /&gt;
&lt;br /&gt;
= Configuring Needed Services =&lt;br /&gt;
&lt;br /&gt;
== dhcp ==&lt;br /&gt;
&lt;br /&gt;
First you will need a DHCP server. Here is a good little tutorial to follow. Come back once you finish.&lt;br /&gt;
&lt;br /&gt;
* [[DHCP on an RPM-based OS]]&lt;br /&gt;
&lt;br /&gt;
=== Addition to the DHCP Configuration File ===&lt;br /&gt;
&lt;br /&gt;
We need to add a section to the DHCP server configuration file, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;dhcpd.conf&amp;lt;/span&amp;gt;. We need to add an option to the relevant &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;subnet&amp;lt;/span&amp;gt; directive(s) indicating where interested clients can go to get the PXE boot configuration. In this example, the PXE server and DHCP server are one in the same, but this is by choice only.&lt;br /&gt;
&lt;br /&gt;
The section to add is below.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
	# These two options tell clients where to go to get the file needed to&lt;br /&gt;
	# start the boot process.&lt;br /&gt;
	next-server 192.168.1.254;&lt;br /&gt;
	filename &amp;quot;pxelinux.0&amp;quot;;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The updated &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;dhcpd.conf&amp;lt;/span&amp;gt; file should look something like the example below.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: [[EL5]] distributions store this file at &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/dhcpd.conf&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/dhcp/dhcpd.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
### Global options&lt;br /&gt;
# General domain information&lt;br /&gt;
option domain-name &amp;quot;alteeve.com&amp;quot;;&lt;br /&gt;
option domain-name-servers 192.139.81.117, 192.139.81.1;&lt;br /&gt;
&lt;br /&gt;
# Tell the server that it&#039;s authoritive on our network.&lt;br /&gt;
authoritive;&lt;br /&gt;
&lt;br /&gt;
# This is required for EL5 operating systems but is optional on EL6 and newer&lt;br /&gt;
# Fedoras (F13+, at least). It controls how dynamic DNS updating is handled. In&lt;br /&gt;
# our case, we aren&#039;t concerned about DDNS so we&#039;ll set it to &#039;none&#039;.&lt;br /&gt;
ddns-update-style none;&lt;br /&gt;
&lt;br /&gt;
### Subnet options&lt;br /&gt;
subnet 192.168.1.0 netmask 255.255.255.0 {&lt;br /&gt;
	# This is the DHCP server, but not the actual Internet gateway. So this&lt;br /&gt;
	# Argument points our clients to the right box.&lt;br /&gt;
	option routers 192.168.1.254;&lt;br /&gt;
	&lt;br /&gt;
	# Set our range. This can be whatever you want so long as it fits in&lt;br /&gt;
	# your netmask.&lt;br /&gt;
	range 192.168.1.100 192.168.1.220;&lt;br /&gt;
	&lt;br /&gt;
	# If clients don&#039;t ask, make the lease available for the following&lt;br /&gt;
	# number of seconds. If the client does ask, allow up to this number of&lt;br /&gt;
	# seconds. 86,400s = 24h.&lt;br /&gt;
	default-lease-time 86400;&lt;br /&gt;
	max-lease-time 86400;&lt;br /&gt;
&lt;br /&gt;
	# These two options tell clients where to go to get the file needed to&lt;br /&gt;
	# start the boot process.&lt;br /&gt;
	next-server 192.168.1.254;&lt;br /&gt;
	filename &amp;quot;pxelinux.0&amp;quot;;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Restart the DHCP server and you&#039;re done.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/dhcpd restart&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Starting dhcpd:                                            [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== tftp ==&lt;br /&gt;
&lt;br /&gt;
We will use the &#039;trivial FTP&#039; program as it is a PXE-compliant FTP program that can transfers the boot files from the PXE server to the client. It runs as an &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xinetd&amp;lt;/span&amp;gt; package, so we will need to make sure it is installed as well. All told, it lives up to it&#039;s name as it is quite trivial to setup.&lt;br /&gt;
&lt;br /&gt;
First, install them.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install tftp-server xinetd&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then edit &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/xinted.d/tftp&amp;lt;/span&amp;gt; and change &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;disable = yes&amp;lt;/span&amp;gt; to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;disable = no&amp;lt;/span&amp;gt;. The edited file should now look like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/xinetd.d/tftp&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# default: off&lt;br /&gt;
# description: The tftp server serves files using the trivial file transfer \&lt;br /&gt;
#       protocol.  The tftp protocol is often used to boot diskless \&lt;br /&gt;
#       workstations, download configuration files to network-aware printers, \&lt;br /&gt;
#       and to start the installation process for some operating systems.&lt;br /&gt;
service tftp&lt;br /&gt;
{&lt;br /&gt;
        disable                 = no&lt;br /&gt;
        socket_type             = dgram&lt;br /&gt;
        protocol                = udp&lt;br /&gt;
        wait                    = yes&lt;br /&gt;
        user                    = root&lt;br /&gt;
        server                  = /usr/sbin/in.tftpd&lt;br /&gt;
        server_args             = -s /var/lib/tftpboot&lt;br /&gt;
        disable                 = no&lt;br /&gt;
        per_source              = 11&lt;br /&gt;
        cps                     = 100 2&lt;br /&gt;
        flags                   = IPv4&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Being an &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xinetd&amp;lt;/span&amp;gt; service, that is what we need to enable at boot time and then start.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
chkconfig dhcpd on&lt;br /&gt;
chkconfig xinetd on&lt;br /&gt;
/etc/init.d/xinetd restart&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Stopping xinetd:                                           [FAILED]&lt;br /&gt;
Starting xinetd:                                           [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Done!&lt;br /&gt;
&lt;br /&gt;
= pxelinux =&lt;br /&gt;
&lt;br /&gt;
In the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xintd&amp;lt;/span&amp;gt; file for &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;tftp&amp;lt;/span&amp;gt; was this line:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
        server_args             = -s /var/lib/tftpboot&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This determines where the PXE boot files will be setup. Some people like to change this to be &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/tftpboot&amp;lt;/span&amp;gt;, but we&#039;ll keep it there to keep things simple. In Fedora, this directory already exists and should be world-readable. If it isn&#039;t for some reason, create it and set the permissions to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;0755&amp;lt;/span&amp;gt; or &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;0777&amp;lt;/span&amp;gt;, depending on your security requirements.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: On [[EL5]], the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;server_args&amp;lt;/span&amp;gt; value is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;-s /tftpboot&amp;lt;/span&amp;gt;. You can leave this as-is and adapt the rest of the tutorial to this directory if you wish. Otherwise, change this to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/var/lib/tftpboot&amp;lt;/span&amp;gt;. Changing it is recommended as it will facilitate future upgrades or migrations of your configuration.&lt;br /&gt;
&lt;br /&gt;
So now we need to install a package called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;syslinux&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install syslinux&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Setting Up the Boot Environment ==&lt;br /&gt;
&lt;br /&gt;
Next up, we need to copy a couple files into the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;tftpboot&amp;lt;/span&amp;gt; directory. These files are provided by the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;syslinux&amp;lt;/span&amp;gt; package we installed earlier and can be found in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/usr/share/syslinux/&amp;lt;/span&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
The main files are:&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;pxelinux.0&amp;lt;/span&amp;gt;: This is the actual kernel that is passed to the client to begin the boot process. You&#039;ll notice this is the file specified in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;dhcpd.conf&amp;lt;/span&amp;gt; file earlier in our setup. It boots the client far enough so that it can see the boot menu, if any, and then move on to find the main system to boot. This &amp;quot;main system&amp;quot; could be a boot DVD or a full [[OS]].&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vesamenu.c32&amp;lt;/span&amp;gt;: This is the 32-bit [http://syslinux.zytor.com/wiki/index.php/SYSLINUX#COMBOOT_image comboot] file. This enables 32-bit colour images to be used for the boot menu (alpha+rr+gg+bb). This replaces the older 16-colour &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;menu.c32&amp;lt;/span&amp;gt; of earlier version that allow for very basic images.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
rsync -av /usr/share/syslinux/pxelinux.0 /var/lib/tftpboot/&lt;br /&gt;
rsync -av /usr/share/syslinux/vesamenu.c32 /var/lib/tftpboot/&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: On [[EL5]], only &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;pxelinux.0&amp;lt;/span&amp;gt; exists and it is in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/usr/lib/syslinux/&amp;lt;/span&amp;gt;. The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vesamenu.c32&amp;lt;/span&amp;gt; can be copied from an [[EL6]] machine or downloaded from this server.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
rsync -av /usr/lib/syslinux/pxelinux.0 /var/lib/tftpboot/&lt;br /&gt;
wget -c https://alteeve.com/files/pxe/tftpboot/vesamenu.c32 -P /var/lib/tftpboot/&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Client Configuration Files ===&lt;br /&gt;
&lt;br /&gt;
Client configuration files will be placed in a new directory under &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;tftpboot&amp;lt;/span&amp;gt; called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;pxelinux.cfg&amp;lt;/span&amp;gt;. So to start, we need to create it:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
mkdir /var/lib/tftpboot/pxelinux.cfg&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Before we talk about the contents of the configuration files, it is important to understand how the PXE server decides which one to use for a given client.&lt;br /&gt;
&lt;br /&gt;
When a client connects, the PXE server looks at the client&#039;s [[MAC]] address and checks to see if there is a matching hyphen-separated configuration file. If that isn&#039;t found, it then looks at the client&#039;s IP address, as set by the DHCP server. It looks for configuration files matching the [[hexadecimal]] representation of the IP address. For example, If the client was given the IP address &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;192.168.1.200&amp;lt;/span&amp;gt;, the PXE server will start by looking for a configuration file called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;C0A801C8&amp;lt;/span&amp;gt;. If it doesn&#039;t find a matching file, it will then knock-off the right-most nibble and check again. It will do this until all the possible file names are checked.&lt;br /&gt;
&lt;br /&gt;
If the PXE server finds no configuration file matching the MAC address or any variant on the IP address, it falls back to a configuration file called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;default&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Let&#039;s show this series using the example of a client with MAC address &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;00:24:7e:69:6f:0e&amp;lt;/span&amp;gt; and having been assigned the IP address &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;192.168.1.200&amp;lt;/span&amp;gt;. The PXE server will then look for the following configuration file names in the following order:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
/var/lib/tftpboot/pxelinux.cfg/00-24-7E-69-6F-0E&lt;br /&gt;
/var/lib/tftpboot/pxelinux.cfg/C0A801C8&lt;br /&gt;
/var/lib/tftpboot/pxelinux.cfg/C0A801C&lt;br /&gt;
/var/lib/tftpboot/pxelinux.cfg/C0A801&lt;br /&gt;
/var/lib/tftpboot/pxelinux.cfg/C0A80&lt;br /&gt;
/var/lib/tftpboot/pxelinux.cfg/C0A8&lt;br /&gt;
/var/lib/tftpboot/pxelinux.cfg/C0A&lt;br /&gt;
/var/lib/tftpboot/pxelinux.cfg/C0&lt;br /&gt;
/var/lib/tftpboot/pxelinux.cfg/C&lt;br /&gt;
/var/lib/tftpboot/pxelinux.cfg/default&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I&#039;ve made a little script to convert decimal-type IP addresses into hexadecimal-type specifically to help in naming these configuration files. I am sure there are many others out there.&lt;br /&gt;
* [[ip_to_hex]]&lt;br /&gt;
&lt;br /&gt;
=== The Configuration Files ===&lt;br /&gt;
&lt;br /&gt;
All of the possible configuration files can be setup using the same set of options and can be setup in similar ways. There is nothing special about any given configuration file. For this reason, we will cover the contents of the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;default&amp;lt;/span&amp;gt; configuration file only.&lt;br /&gt;
&lt;br /&gt;
Below is the default configuration file we will use. Comments are embedded explaining each option.&lt;br /&gt;
&lt;br /&gt;
* Direct download: &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/var/lib/tftpboot/pxelinux.cfg/[https://alteeve.com/files/pxe/tftpboot/pxelinux.cfg/default default]&amp;lt;/span&amp;gt;&lt;br /&gt;
* Direct download: &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/var/lib/tftpboot/[https://alteeve.com/files/pxe/tftpboot/an-pxe_splash_1024_768.png an-pxe_splash_1024_768.png]&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /var/lib/tftpboot/pxelinux.cfg/default&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;perl&amp;quot;&amp;gt;&lt;br /&gt;
# Use the high-colour menu system. This file, and the low-colour &#039;menu.c32&#039;&lt;br /&gt;
# version, are provided by the syslinux package and can be found in the&lt;br /&gt;
# &#039;/var/lib/tftpboot&#039; directory. Copy it to &#039;/var/lib/tftpboot&#039;.&lt;br /&gt;
UI vesamenu.c32&lt;br /&gt;
&lt;br /&gt;
# Time out and use the default menu option. Defined as tenths of a second.&lt;br /&gt;
TIMEOUT 600&lt;br /&gt;
&lt;br /&gt;
# Prompt the user. Set to &#039;1&#039; to automatically choose the default option. This&lt;br /&gt;
# is really meant for files matched to MAC addresses.&lt;br /&gt;
PROMPT 0&lt;br /&gt;
&lt;br /&gt;
# Set the boot menu to be 1024x768 with a nice background image. Be careful to&lt;br /&gt;
# ensure that all your user&#039;s can see this resolution! Default is 640x480.&lt;br /&gt;
MENU RESOLUTION 1024 768&lt;br /&gt;
# This file must be in or under the &#039;/var/lib/tftpboot&#039; folder.&lt;br /&gt;
MENU BACKGROUND an-pxe_splash_1024_768.png&lt;br /&gt;
&lt;br /&gt;
# These do not need to be set. I set them here to show how you can customize or&lt;br /&gt;
# localize your PXE server&#039;s dialogue.&lt;br /&gt;
MENU TITLE    AN!PXE Boot Server&lt;br /&gt;
# Below, the hash (#) character is replaced with the countdown timer. The&lt;br /&gt;
# &#039;{,s}&#039; allows for pluralizing a word and is used when the value is &amp;gt;= &#039;2&#039;.&lt;br /&gt;
MENU AUTOBOOT Will boot the next device as configured in your BIOS in # second{,s}.&lt;br /&gt;
MENU TABMSG   Press the &amp;lt;tab&amp;gt; key to edit the boot parameters of the highlighted option.&lt;br /&gt;
MENU NOTABMSG Editing of this option is disabled.&lt;br /&gt;
&lt;br /&gt;
# The following options set the various colours used in the menu. All possible&lt;br /&gt;
# options are specified except for F# help options. The colour is expressed as&lt;br /&gt;
# two hex characters between &#039;00&#039; and &#039;ff&#039; for red, green, blue and alpha,&lt;br /&gt;
# respectively (#RRGGBBAA).&lt;br /&gt;
# Format is: MENU COLOR &amp;lt;Item&amp;gt; &amp;lt;ANSI Seq.&amp;gt; &amp;lt;foreground&amp;gt; &amp;lt;background&amp;gt; &amp;lt;shadow type&amp;gt;&lt;br /&gt;
MENU COLOR screen      0  #80ffffff #00000000 std      # background colour not covered by the splash image&lt;br /&gt;
MENU COLOR border      0  #ffffffff #ee000000 std      # The wire-frame border&lt;br /&gt;
MENU COLOR title       0  #ffff3f7f #ee000000 std      # Menu title text&lt;br /&gt;
MENU COLOR sel         0  #ff00dfdf #ee000000 std      # Selected menu option&lt;br /&gt;
MENU COLOR hotsel      0  #ff7f7fff #ee000000 std      # The selected hotkey (set with ^ in MENU LABEL)&lt;br /&gt;
MENU COLOR unsel       0  #ffffffff #ee000000 std      # Unselected menu options&lt;br /&gt;
MENU COLOR hotkey      0  #ff7f7fff #ee000000 std      # Unselected hotkeys (set with ^ in MENU LABEL)&lt;br /&gt;
MENU COLOR tabmsg      0  #c07f7fff #00000000 std      # Tab text&lt;br /&gt;
MENU COLOR timeout_msg 0  #8000dfdf #00000000 std      # Timout text&lt;br /&gt;
MENU COLOR timeout     0  #c0ff3f7f #00000000 std      # Timout counter&lt;br /&gt;
MENU COLOR disabled    0  #807f7f7f #ee000000 std      # Disabled menu options, including SEPARATORs&lt;br /&gt;
MENU COLOR cmdmark     0  #c000ffff #ee000000 std      # Command line marker - The &#039;&amp;gt; &#039; on the left when editing an option&lt;br /&gt;
MENU COLOR cmdline     0  #c0ffffff #ee000000 std      # Command line - The text being edited&lt;br /&gt;
# Options below haven&#039;t been tested, descriptions may be lacking.&lt;br /&gt;
MENU COLOR scrollbar   0  #40000000 #00000000 std      # Scroll bar&lt;br /&gt;
MENU COLOR pwdborder   0  #80ffffff #20ffffff std      # Password box wire-frame border&lt;br /&gt;
MENU COLOR pwdheader   0  #80ff8080 #20ffffff std      # Password box header&lt;br /&gt;
MENU COLOR pwdentry    0  #80ffffff #20ffffff std      # Password entry field&lt;br /&gt;
MENU COLOR help        0  #c0ffffff #00000000 std      # Help text, if set via &#039;TEXT HELP ... ENDTEXT&#039;&lt;br /&gt;
&lt;br /&gt;
### Now define the menu options&lt;br /&gt;
&lt;br /&gt;
# I feel it is safest to return booting to the client as the first and default&lt;br /&gt;
# option. This entry below will do just that.&lt;br /&gt;
LABEL next&lt;br /&gt;
        MENU LABEL ^A)  Boot the next device as configured in your BIOS&lt;br /&gt;
        MENU DEFAULT&lt;br /&gt;
        localboot&lt;br /&gt;
&lt;br /&gt;
## To keep the menu from getting out of hand, I like to create sub-menus.&lt;br /&gt;
## The sub-menus are simply additional files in the same directory as this&lt;br /&gt;
## file with one or more boot options or, if you wish, further sub-menus.&lt;br /&gt;
#&lt;br /&gt;
# This section covers boot options without pre-defined kickstart (or other)&lt;br /&gt;
# automation scripts.&lt;br /&gt;
MENU BEGIN generic&lt;br /&gt;
        MENU TITLE Generic installations (as if booting from media)&lt;br /&gt;
        LABEL Previous&lt;br /&gt;
        MENU LABEL ^B) Previous Menu&lt;br /&gt;
        MENU EXIT&lt;br /&gt;
        MENU SEPARATOR&lt;br /&gt;
        MENU INCLUDE pxelinux.cfg/generic.menu&lt;br /&gt;
MENU END&lt;br /&gt;
&lt;br /&gt;
# As I build a lot of clusters, I like to have a section dedicated to boot&lt;br /&gt;
# options used to build cluster nodes.&lt;br /&gt;
MENU BEGIN cluster&lt;br /&gt;
        MENU TITLE Cluster nodes&lt;br /&gt;
        LABEL Previous&lt;br /&gt;
        MENU LABEL ^C) Previous Menu&lt;br /&gt;
        MENU EXIT&lt;br /&gt;
        MENU SEPARATOR&lt;br /&gt;
        MENU INCLUDE pxelinux.cfg/cluster.menu&lt;br /&gt;
MENU END&lt;br /&gt;
&lt;br /&gt;
# This section is where I put generic automated install scripts. These&lt;br /&gt;
# generally have no specific use and are meant to create installations that&lt;br /&gt;
# can be easily adapted or built upon.&lt;br /&gt;
MENU BEGIN stock&lt;br /&gt;
        MENU TITLE Stock installs (generic kickstart-based installs)&lt;br /&gt;
        LABEL Previous&lt;br /&gt;
        MENU LABEL ^D) Previous Menu&lt;br /&gt;
        MENU EXIT&lt;br /&gt;
        MENU SEPARATOR&lt;br /&gt;
        MENU INCLUDE pxelinux.cfg/stock.menu&lt;br /&gt;
MENU END&lt;br /&gt;
&lt;br /&gt;
# Lastly, I like to make &amp;quot;Live&amp;quot; operating systems available. These are very&lt;br /&gt;
# useful for diagnostics and recovery work where you need more than a &#039;rescue&#039;&lt;br /&gt;
# boot provides and where you do not want to effect the underlying system OS.&lt;br /&gt;
MENU BEGIN live&lt;br /&gt;
        MENU TITLE Live Distros (bootable without affecting the underlying system)&lt;br /&gt;
        LABEL Previous&lt;br /&gt;
        MENU LABEL ^E) Previous Menu&lt;br /&gt;
        MENU EXIT&lt;br /&gt;
        MENU SEPARATOR&lt;br /&gt;
        MENU INCLUDE pxelinux.cfg/live.menu&lt;br /&gt;
MENU END&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;default&amp;lt;span&amp;gt; file above points to four sub-menu files. How many you use, if you use any at all, is up to you. You can also use any file name you want, or any directory under &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/var/lib/tftpboot/&amp;lt;span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
To save space on this page, The sub-menu files mentioned above are their own pages and are linked below. These will hopefully act as useful references for your own sub-menu files, should you wish to use menus.&lt;br /&gt;
&lt;br /&gt;
* [[pxe_generic.menu|generic.menu]]&lt;br /&gt;
* [[pxe_cluster.menu|cluster.menu]]&lt;br /&gt;
* [[pxe_stock.menu|stock.menu]]&lt;br /&gt;
* [[pxe_live.menu|live.menu]]&lt;br /&gt;
&lt;br /&gt;
=== Options ===&lt;br /&gt;
&lt;br /&gt;
Let&#039;s now take a look at the various parts. This is an overview only, for a complete list of options please read &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/usr/share/doc/syslinux-3.84/menu.txt&amp;lt;/span&amp;gt;. Update the version number to match your installed version.&lt;br /&gt;
&lt;br /&gt;
Wherever a colour can be specified, the format is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;#AARRGGBB&amp;lt;/span&amp;gt;. That is, alpha (transparency), red, green and blue intensity expressed as a 256 range specified using two [[hexadecimal]] characters per option. &lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;UI vesamenu.c32&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This loads the 32-bit colour [http://syslinux.zytor.com/wiki/index.php/SYSLINUX#COMBOOT_image COMBOOT] image. This allows for the full colour range plus 8-bit alpha (transparency) to be available at boot time. It&#039;s what allows for a much more attractive boot menu. To read details on the innards of the COMBOOT format, read &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/usr/share/doc/syslinux-3.84/comboot.txt&amp;lt;/span&amp;gt;. Update the version number to match your installed version.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;TIMEOUT 600&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is the amount of time, in tenths of a second, that the PXE loader will wait before performing the default action. If the user navigates through the menu. the timer will stop and wait for the user to make a selection. To prevent an install from running accidentally, the default option should always be a non-damaging option.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;prompt 0&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This tells the PXE server to prompt the user to make a choice. If this is set to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt; then the PXE server will use the default option.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;MENU RESOLUTION 1024 768&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This tells the boot loader to run at the set resolution, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;1024x768&amp;lt;/span&amp;gt; in this example. The default is to run up as &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vga (640x480)&amp;lt;/span&amp;gt;. Be sure when pushing a higher resolution that all of your potential users have machines that support the given resolution.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;MENU BACKGROUND an-pxe_splash_1024_768.png&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is the background image to use. This must exist in or under the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/var/lib/tftpboot/&amp;lt;/span&amp;gt; directory. If you want to use a subdirectory, specify it as a relative path. For example, if you want to store images in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/var/lib/tftpboot/images/&amp;lt;/span&amp;gt;, then this would be set to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;images/an-pxe_splash_1024_768.png&amp;lt;/span&amp;gt;. The format of the image can be &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;JPEG&amp;lt;/span&amp;gt; or The format of the image can be &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;JPNG&amp;lt;/span&amp;gt; (other image formats may work). The image itself should match the size of the screen.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;MENU TITLE    AN!PXE Boot Server&amp;lt;/span&amp;gt;&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;MENU AUTOBOOT Will boot the next device as configured in your BIOS in # second{,s}.&amp;lt;/span&amp;gt;&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;MENU TABMSG   Press the &amp;lt;tab&amp;gt; key to edit the boot parameters of the highlighted option.&amp;lt;/span&amp;gt;&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;MENU NOTABMSG Editing of this option is disabled.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These options allow you to customize or localize the text. None need to be specified.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;AUTOBOOT&amp;lt;/span&amp;gt; option is a little special to accommodate the count-down. The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;#&amp;lt;/span&amp;gt; will be replaced by the time remaining. The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;{,s}&amp;lt;/span&amp;gt; tells the string to add an &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;s&amp;lt;/span&amp;gt; to the end of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;seconds&amp;lt;/span&amp;gt; when the time remaining is greater than one.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;MENU COLOR x&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These options control the colour and transparency of the various text-elements, borders and backgrounds. None of them need to be specified and all have sane default values. Most of the available options are shown in the example above.&lt;br /&gt;
&lt;br /&gt;
Each entry is formatted like so:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;MENU COLOR &amp;lt;type&amp;gt; &amp;lt;ansi&amp;gt; &amp;lt;foreground&amp;gt; &amp;lt;background&amp;gt; &amp;lt;shadow&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;type&amp;gt;&amp;lt;/span&amp;gt; is the name of the element you are manipulating. The only &#039;type&#039; not show in the example above is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;msgXX&amp;lt;/span&amp;gt; where &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;XX&amp;lt;/span&amp;gt; is a number between &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;12&amp;lt;/span&amp;gt;. These are used to control &amp;quot;help windows&amp;quot; that can be shown to the user when they press an &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;F[1-12]&amp;lt;/span&amp;gt; key.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;ansi&amp;gt;&amp;lt;/span&amp;gt; number(s) tell the boot loader how to format the text using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[ANSI]]&amp;lt;/span&amp;gt; code. This is set to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;0&amp;lt;/span&amp;gt;, &amp;quot;reset&amp;quot;, in our example to clear any &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ANSI&amp;lt;/span&amp;gt; formatting. You can specify multiple &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ANSI&amp;lt;/span&amp;gt; codes by separating them with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;;&amp;lt;/span&amp;gt; (semi-colons).&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;foreground&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;background&amp;gt;&amp;lt;/span&amp;gt; values are the [[hexadecimal]] notation for the transparency and colour in the format &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;#AARRGGBB&amp;lt;/span&amp;gt; as mentioned earlier.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;shadow&amp;gt;&amp;lt;/span&amp;gt; is the type of drop-shadow to render for the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;type&amp;gt;&amp;lt;/span&amp;gt;. Valid options are:&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;none&amp;lt;/span&amp;gt;: No shadowing.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;std&amp;lt;/span&amp;gt;, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;standard&amp;lt;/span&amp;gt;: Foreground pixels are raised.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;all&amp;lt;/span&amp;gt;: both foreground and background pixels are raised.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rev&amp;lt;/span&amp;gt;, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;reverse&amp;lt;/span&amp;gt;: Background pixels are raised.&lt;br /&gt;
&lt;br /&gt;
=== Labels ===&lt;br /&gt;
&lt;br /&gt;
Label blocks are the actual boot options made available within the PXE menu. There are many options available here that are not shown in this example. If you are curious, please read &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/usr/share/doc/syslinux-3.84/menu.txt&amp;lt;/span&amp;gt; which was installed on your system when you installed &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;syslinux&amp;lt;/span&amp;gt;. Of course, replace &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;3.84&amp;lt;/span&amp;gt; with the version you have installed.&lt;br /&gt;
&lt;br /&gt;
First example;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
LABEL next&lt;br /&gt;
	MENU LABEL ^A)  Boot the next device as configured in your BIOS&lt;br /&gt;
	MENU DEFAULT&lt;br /&gt;
	localboot&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This example is a good one to always use as the first, and default, option. &lt;br /&gt;
&lt;br /&gt;
The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;LABEL next&amp;lt;/span&amp;gt; defines this option group. The name &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;next&amp;lt;/span&amp;gt; has no special meaning, but can be used for more complex setups later. For now, just be sure to keep this name simple with no spaces.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;MENU LABEL ...&amp;lt;/span&amp;gt; option control two things. First, it&#039;s the text shown to the user. Second, the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;^A&amp;lt;/span&amp;gt; sets the keyboard key that the user can press to select the option. Whatever character comes immediately after the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;/span&amp;gt; (caret), &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;A&amp;lt;/span&amp;gt; in this example, becomes the mapped key. Please note that the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;^&amp;lt;/span&amp;gt; can come anywhere in the title text. Ensure that no two entries have the same character mapped!&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;MENU DEFAULT&amp;lt;/span&amp;gt; command tells the boot loader to automatically boot this option if the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;TIMEOUT&amp;lt;/span&amp;gt; expires. Only one entry may have this option.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;localboot&amp;lt;/span&amp;gt; is a special command the skips the PXE boot loader. Your BIOS should proceed to boot the next device in it&#039;s boot order list. Generally this will boot the local hard drive.&lt;br /&gt;
&lt;br /&gt;
Another example, from the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cluster.menu&amp;lt;/span&amp;gt; file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
LABEL f14_an-node01&lt;br /&gt;
        MENU LABEL ^1) Install AN!Node01; Storage Node 01&lt;br /&gt;
        KERNEL boot/f14/x86_64/vmlinuz&lt;br /&gt;
        APPEND initrd=boot/f14/x86_64/initrd.img ks=http://192.168.1.254/f14/x86_64/ks/an-node01.ks ksdevice=eth0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is a pretty typical entry. The two new options to note are:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;KERNEL ...&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is the path to the boot kernel used to start the OS or it&#039;s installer. Most distributions make use of a small kernel to run up their installer or Live CD/DVD environment. The PXE server will search for the kernel relative to the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;tftpboot&amp;lt;/span&amp;gt; directory. Where to get the proper boot kernel will depend on the distribution you are setting up. &lt;br /&gt;
&lt;br /&gt;
Some examples will be [[#Setting Up The Boot Environment|shown below]].&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;APPEND ...&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This argument allows you to pass arguments to the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;KERNEL&amp;lt;/span&amp;gt; specified above. Which options can be passed will, again, depend on the distribution you are setting up. In this example, an &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;initrd&amp;lt;/span&amp;gt; image is specified, a kickstart script is set and the network device to use to search for the kickstart script are defined.&lt;br /&gt;
&lt;br /&gt;
The [[Setting_Up_a_PXE_Server_in_Fedora#Making_The_Install_Files_For_An_OS_Available|Apache configuration]] section below covers in more detail how to make the kickstart and OS installation files available.&lt;br /&gt;
&lt;br /&gt;
=== Menus ===&lt;br /&gt;
&lt;br /&gt;
Menus are very useful when you have more than a few entries in your PXE server. They allow for creating groups of bootable options based on whatever given criteria works for you.&lt;br /&gt;
&lt;br /&gt;
Let&#039;s look at the &amp;quot;cluster&amp;quot; menu from above.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
MENU BEGIN cluster&lt;br /&gt;
        MENU TITLE Cluster nodes&lt;br /&gt;
        LABEL Previous&lt;br /&gt;
        MENU LABEL ^C) Previous Menu&lt;br /&gt;
        MENU EXIT&lt;br /&gt;
        MENU SEPARATOR&lt;br /&gt;
        MENU INCLUDE pxelinux.cfg/cluster.menu&lt;br /&gt;
MENU END&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;MENU BEGIN ...&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This begins the section and is followed by a name that should (must?) be unique.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;MENU TITLE ...&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is the text shown at the top of the sub-menu once selected.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;LABEL ...&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is the text shown as the first option in the sub-menu that returns to the previous screen.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;MENU LABEL ...&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is the text that the user selects to descend into the sub-menu.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: I use the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;^&amp;lt;/span&amp;gt; character to enable a letter to select the menu option but it doesn&#039;t seem to work. Please let me know if you have further information on how, or if, sub-menu options are selected with a key press.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;MENU EXIT ...&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I am not sure, exactly, what this option does.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;MENU SEPARATOR ...&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I am not sure, exactly, what this option does.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;MENU INCLUDE ...&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is the path and file to include when building this sub-menu. The path is relative to the tftpboot &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;server_args&amp;lt;/span&amp;gt; directory, as set in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/xinetd.d/tftp&amp;lt;/span&amp;gt; file.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;MENU END&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This closes the sub-menu section. &lt;br /&gt;
&lt;br /&gt;
There are other options, though none seem to be well documented at the moment. I got this far thanks to [https://help.ubuntu.com/community/PXEInstallMultiDistro this page]. Any additional information on these and other options would be welcome!&lt;br /&gt;
&lt;br /&gt;
= Setting Up Apache =&lt;br /&gt;
&lt;br /&gt;
[[Image:f13_httpd_default_page_01.png|thumb|right|400px|Default Apache2.2 web page on Fedora 13]]&lt;br /&gt;
&lt;br /&gt;
We will use the Apache web server to make our operating system images available. First, install the server.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install httpd&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The default install of Apache2 will work fine for us, so we won&#039;t adjust it. Let&#039;s start it now.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/httpd start&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Test access by loading [http://localhost http://localhost] from the PXE server. If that works, then try connecting to the PXE server from another computer using it&#039;s [[IP]] address. In either case, you should see a page like the one to the right.&lt;br /&gt;
&lt;br /&gt;
== Setting Up The DocumentRoot ==&lt;br /&gt;
&lt;br /&gt;
Apache has a variable called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;DocumentRoot&amp;lt;/span&amp;gt; in it&#039;s main configuration file &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/httpd/conf/httpd.conf&amp;lt;/span&amp;gt;. Anything in or under the directory specified in this variable will be exposed on your web server. The default directory is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/var/www/html&amp;lt;/span&amp;gt; and this will be where we put our various kickstart files, ISO files and under which we will mount those ISO files.&lt;br /&gt;
&lt;br /&gt;
== The Default Page ==&lt;br /&gt;
&lt;br /&gt;
There is no need to create an &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;index.html&amp;lt;/span&amp;gt; page, as the image kickstart scripts and image files will be called directly. Personally though, I like to put together a simple page listing the various installations I&#039;ve made available on the PXE server. If nothing else, it helps identify the machine when you call it in a browser.&lt;br /&gt;
&lt;br /&gt;
If you decide to create one, please use whatever website tool, text editor or [[Integrated Development Environment|IDE]] you prefer. For reference, below are the very simple, probably not [[W3C]] compliant static [[HTML]] page I use along with a trivial [[CSS]] file.&lt;br /&gt;
&lt;br /&gt;
* [[PXE Server index.html]]&lt;br /&gt;
* [[PXE Server common.css]]&lt;br /&gt;
&lt;br /&gt;
Put the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;index.html&amp;lt;/span&amp;gt; (and associated files) directly in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;DocumentRoot&amp;lt;/span&amp;gt; directory. By default, Apache2 will look for a file named &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;index.html&amp;lt;/span&amp;gt; and load it if it is found.&lt;br /&gt;
&lt;br /&gt;
== Making The Install Files For An OS Available ==&lt;br /&gt;
&lt;br /&gt;
At the end of the day, the only thing that matters here is that all of the installation files and kickstart scripts are &#039;&#039;somewhere&#039;&#039; under the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;DocumentRoot&amp;lt;/span&amp;gt; directory. I will describe here the layout that I like, but feel free to adjust it however you see fit. &lt;br /&gt;
&lt;br /&gt;
Further, different operating systems will need to be configured differently. For the purpose of this tutorial, I will be showing how RPM-based [[Linux]] distributions are configured. If you are using different operating systems, you should be able to build on the steps below.&lt;br /&gt;
&lt;br /&gt;
=== Planning Your Directory Structure ===&lt;br /&gt;
&lt;br /&gt;
Under the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;DocumentRoot&amp;lt;/span&amp;gt; directory, we will need to create a set of directories to store the operating system files and associated kickstart scripts in. I&#039;ve found the following structure works well.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;DocumentRoot&amp;gt;/&amp;lt;os_name&amp;gt;/&amp;lt;architecture&amp;gt;/[ks|iso|img]&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Using Fedora 14 [[x86_64]] with the default Apache &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;DocumentRoot&amp;lt;/span&amp;gt; as an example, you would create the following directories. Note that I like to shorten Operating System names to the shortest version practical to save typing. Feel free to use the full names if you prefer verbose [[URL]]s.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/var/www/html/f14/x86_64/ks&amp;lt;/span&amp;gt;: Kickstart scripts go here&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/var/www/html/f14/x86_64/iso&amp;lt;/span&amp;gt;: The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[http://download.fedoraproject.org/pub/fedora/linux/releases/14/Fedora/x86_64/iso/Fedora-14-x86_64-DVD.iso Fedora-14-x86_64-DVD.iso]&amp;lt;/span&amp;gt; file is saved here&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/var/www/html/f14/x86_64/img&amp;lt;/span&amp;gt;: The [[ISO]] file above is mounted here.&lt;br /&gt;
&lt;br /&gt;
If you wanted to also make the [[i386]] version of Fedora available, simply replace &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;x86_64&amp;lt;/span&amp;gt; with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;i386&amp;lt;/span&amp;gt; above. If you want to also make the live version for Fedora 14 x86_64 available, replace &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;f13&amp;lt;/span&amp;gt; with something like &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;f13_live&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Fedora 14 x86_64 ===&lt;br /&gt;
&lt;br /&gt;
Let&#039;s walk through the actual steps needed to make Fedora 14 x86_64 available on Apache now.&lt;br /&gt;
&lt;br /&gt;
First, create the directory structure.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
mkdir -p /var/www/html/f14/x86_64/{iso,img,ks}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now, download the ISO if you have not yet done so. If you have, move it into place.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cd /var/www/html/f14/x86_64/iso&lt;br /&gt;
wget -c http://download.fedoraproject.org/pub/fedora/linux/releases/14/Fedora/x86_64/iso/Fedora-14-x86_64-DVD.iso&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we mount the ISO using a loopback device.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
mount -o loop /var/www/html/f14/x86_64/iso/Fedora-14-x86_64-DVD.iso /var/www/html/f14/x86_64/img&lt;br /&gt;
df -h&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Filesystem            Size  Used Avail Use% Mounted on&lt;br /&gt;
/dev/sda3              69G  7.1G   59G  11% /&lt;br /&gt;
tmpfs                 497M   88K  497M   1% /dev/shm&lt;br /&gt;
/dev/sda1             485M   62M  398M  14% /boot&lt;br /&gt;
/dev/sdb1             1.4T  678G  629G  52% /media/disk&lt;br /&gt;
/var/www/html/f14/x86_64/iso/Fedora-14-x86_64-DVD.iso&lt;br /&gt;
                      3.3G  3.3G     0 100% /var/www/html/f14/x86_64/img&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Lastly, copy any kickstart scripts into the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/var/www/html/f14/x86_64/ks/&amp;lt;/span&amp;gt; directory. These scripts will be called by the user after they select an automated install option from the PXE menu.&lt;br /&gt;
&lt;br /&gt;
Here is a generic Fedora 14 x86_64 kickstart I use as a server that you can adapt if you would like. It creates a quite stripped down install.&lt;br /&gt;
* [[kickstart_f14_generic_server.ks]]&lt;br /&gt;
&lt;br /&gt;
That&#039;s it! You can now use make Fedora 14 available as a PXE boot option in your menu.&lt;br /&gt;
&lt;br /&gt;
== Mounting And Unmounting Many ISOs ==&lt;br /&gt;
&lt;br /&gt;
If you make any real use of your PXE server, you will probably find that you will have a lot of ISO files to mount and unmount. To simplify this task, I like to create a couple of bash scripts called, simply, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;mount_iso.sh&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;umount_iso.sh&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
These are simple shell scripts meant to mount and unmount all ISOs with one command. You need to be sure that you keep them up to date as you add and remove operating systems.&lt;br /&gt;
&lt;br /&gt;
You will certainly want to adjust these to suit your setup. With that said, here are my scripts that you can use as templates.&lt;br /&gt;
&lt;br /&gt;
* Direct download: [https://alteeve.com/files/pxe/mount_iso.sh mount_iso.sh]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
# This is used to mount the various ISO used by the PXE server on this server.&lt;br /&gt;
&lt;br /&gt;
echo -n &amp;quot;Mounting Fedora 14, x86_64... &amp;quot;&lt;br /&gt;
mount -o loop /var/www/html/f14/x86_64/iso/Fedora-14-x86_64-DVD.iso /var/www/html/f14/x86_64/img&lt;br /&gt;
echo &amp;quot;Done!&amp;quot;&lt;br /&gt;
&lt;br /&gt;
echo -n &amp;quot;Mounting Fedora 14, i386... &amp;quot;&lt;br /&gt;
mount -o loop /var/www/html/f14/i386/iso/Fedora-14-i386-DVD.iso /var/www/html/f14/i386/img/&lt;br /&gt;
echo &amp;quot;Done!&amp;quot;&lt;br /&gt;
&lt;br /&gt;
echo -n &amp;quot;Mounting Fedora 14 Live DVD, x86_64... &amp;quot;&lt;br /&gt;
mount -o loop /var/www/html/f14_live/x86_64/iso/Fedora-14-x86_64-Live-Desktop.iso /var/www/html/f14_live/x86_64/img/&lt;br /&gt;
echo &amp;quot;Done!&amp;quot;&lt;br /&gt;
&lt;br /&gt;
echo -n &amp;quot;Mounting Fedora 14 Live DVD, i686... &amp;quot;&lt;br /&gt;
mount -o loop /var/www/html/f14_live/i686/iso/Fedora-14-i686-Live-Desktop.iso /var/www/html/f14_live/i686/img/&lt;br /&gt;
echo &amp;quot;Done!&amp;quot;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Direct download: [https://alteeve.com/files/pxe/umount_iso.sh umount_iso.sh]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
# This is used to unmount the various ISO used by the PXE server on this server.&lt;br /&gt;
&lt;br /&gt;
echo -n &amp;quot;Unmounting Fedora 14, x86_64... &amp;quot;&lt;br /&gt;
umount /var/www/html/f14/x86_64/img&lt;br /&gt;
echo &amp;quot;Done!&amp;quot;&lt;br /&gt;
&lt;br /&gt;
echo -n &amp;quot;Unmounting Fedora 14, i386... &amp;quot;&lt;br /&gt;
umount /var/www/html/f14/i386/img/&lt;br /&gt;
echo &amp;quot;Done!&amp;quot;&lt;br /&gt;
&lt;br /&gt;
echo -n &amp;quot;Unmounting Fedora 14 Live DVD, x86_64... &amp;quot;&lt;br /&gt;
umount /var/www/html/f14_live/x86_64/img/&lt;br /&gt;
echo &amp;quot;Done!&amp;quot;&lt;br /&gt;
&lt;br /&gt;
echo -n &amp;quot;Unmounting Fedora 14 Live DVD, i686... &amp;quot;&lt;br /&gt;
umount /var/www/html/f14_live/i686/img/&lt;br /&gt;
echo &amp;quot;Done!&amp;quot;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Increasing Maximum number of Mountable ISOs ===&lt;br /&gt;
&lt;br /&gt;
By default the loop driver only creates 8 loop back devices. Each mounted [[ISO]] takes one of those and there for limits the total number of ISOs that can be mounted at any one time.&lt;br /&gt;
&lt;br /&gt;
There exist two places to change the maximum number of loop back devices.&lt;br /&gt;
The recommend method is to add max_loop option to a new config file in /etc/modprobe.d/.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/modprobe.d/loop.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
options loop max_loop=64&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The second options is to add &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;max_loop=64&amp;lt;/span&amp;gt; to the kernel boot line.&lt;br /&gt;
&lt;br /&gt;
Adjust the number after &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;max_loop=&amp;lt;/span&amp;gt; to suit your installations needs.&lt;br /&gt;
&lt;br /&gt;
= Setting Up The Boot Environment =&lt;br /&gt;
&lt;br /&gt;
All boot options, except &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;localboot&amp;lt;/span&amp;gt;, need to have a kernel made available via the PXE server. Specifically, these kernels must exist somewhere under the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/var/lib/tftpboot&amp;lt;/span&amp;gt; directory. What kernel or boot image a given operating system will need depends entirely on that operating system. For this section, we will continue to use Fedora 14 x86_64 as an example.&lt;br /&gt;
&lt;br /&gt;
== Planning Your Directory Structure, Take Two ==&lt;br /&gt;
&lt;br /&gt;
As with [[#Planning Your Directory Structure|Apache]], we&#039;re potentially going to copy a lot of boot images and other files. It makes sense to have an organized directory structure to put them all in. As before, I will share what I do, but please feel free to do what you find works best for you. &lt;br /&gt;
&lt;br /&gt;
I like to create a dedicated directory called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;boot&amp;lt;/span&amp;gt; and then mimic the layout from Apache, minus the last set of three directories.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;tftpboot&amp;gt;/boot/&amp;lt;os_name&amp;gt;/&amp;lt;architecture&amp;gt;/&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using Fedora 14 x86_64 with the default tftpboot install, I will create the following directory.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
mkdir -p /var/lib/tftpboot/boot/f14/x86_64&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== The Bootable Kernel ==&lt;br /&gt;
&lt;br /&gt;
Remember in the earlier &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;LABEL f14_an-node01&amp;lt;/span&amp;gt; example there was the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;APPEND initrd=boot/f14/x86_64/initrd.img ...&amp;lt;/span&amp;gt; line? The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;boot/f14/x86_64/initrd.img&amp;lt;/span&amp;gt; is the kernel, in the directory we just created!&lt;br /&gt;
&lt;br /&gt;
The last piece of the puzzle then is; Where does the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;initrd.img&amp;lt;/span&amp;gt; file come from?&lt;br /&gt;
&lt;br /&gt;
With most Linux distributions, there is an &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;isolinux&amp;lt;/span&amp;gt; directory in the root of the installation DVD. The files needed to boot the DVD&#039;s installer (or &amp;quot;rescue mode&amp;quot;) are in this directory. These are the same files we need to boot over PXE. If you have followed this tutorial up to this point, then you should be able to see the contents of this directory in your file browser. My PXE server uses the IP address &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;192.168.1.254&amp;lt;/span&amp;gt;, so I can go to &lt;br /&gt;
&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;http://192.168.1.254/f14/x86_64/img/isolinux&amp;lt;/span&amp;gt; and see, among other files, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;initrd.img&amp;lt;/span&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
With the directory created and the ISO mounted, all that is left is to copy the contents of the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;isolinux&amp;lt;/span&amp;gt; files.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp -v /var/www/html/f14/x86_64/img/isolinux/* /var/lib/tftpboot/boot/f14/x86_64/&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
`/var/www/html/f14/x86_64/img/isolinux/boot.cat&#039; -&amp;gt; `/var/lib/tftpboot/boot/f14/x86_64/boot.cat&#039;&lt;br /&gt;
`/var/www/html/f14/x86_64/img/isolinux/boot.msg&#039; -&amp;gt; `/var/lib/tftpboot/boot/f14/x86_64/boot.msg&#039;&lt;br /&gt;
`/var/www/html/f14/x86_64/img/isolinux/grub.conf&#039; -&amp;gt; `/var/lib/tftpboot/boot/f14/x86_64/grub.conf&#039;&lt;br /&gt;
`/var/www/html/f14/x86_64/img/isolinux/initrd.img&#039; -&amp;gt; `/var/lib/tftpboot/boot/f14/x86_64/initrd.img&#039;&lt;br /&gt;
`/var/www/html/f14/x86_64/img/isolinux/isolinux.bin&#039; -&amp;gt; `/var/lib/tftpboot/boot/f14/x86_64/isolinux.bin&#039;&lt;br /&gt;
`/var/www/html/f14/x86_64/img/isolinux/isolinux.cfg&#039; -&amp;gt; `/var/lib/tftpboot/boot/f14/x86_64/isolinux.cfg&#039;&lt;br /&gt;
`/var/www/html/f14/x86_64/img/isolinux/memtest&#039; -&amp;gt; `/var/lib/tftpboot/boot/f14/x86_64/memtest&#039;&lt;br /&gt;
`/var/www/html/f14/x86_64/img/isolinux/splash.jpg&#039; -&amp;gt; `/var/lib/tftpboot/boot/f14/x86_64/splash.jpg&#039;&lt;br /&gt;
`/var/www/html/f14/x86_64/img/isolinux/splash.lss&#039; -&amp;gt; `/var/lib/tftpboot/boot/f14/x86_64/splash.lss&#039;&lt;br /&gt;
`/var/www/html/f14/x86_64/img/isolinux/syslinux-vesa-splash.jpg&#039; -&amp;gt; `/var/lib/tftpboot/boot/f14/x86_64/syslinux-vesa-splash.jpg&#039;&lt;br /&gt;
`/var/www/html/f14/x86_64/img/isolinux/TRANS.TBL&#039; -&amp;gt; `/var/lib/tftpboot/boot/f14/x86_64/TRANS.TBL&#039;&lt;br /&gt;
`/var/www/html/f14/x86_64/img/isolinux/vesamenu.c32&#039; -&amp;gt; `/var/lib/tftpboot/boot/f14/x86_64/vesamenu.c32&#039;&lt;br /&gt;
`/var/www/html/f14/x86_64/img/isolinux/vmlinuz&#039; -&amp;gt; `/var/lib/tftpboot/boot/f14/x86_64/vmlinuz&#039;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And we&#039;re done! &lt;br /&gt;
&lt;br /&gt;
Now repeat the relevant steps for the rest of the operating systems you want to support via PXE.&lt;br /&gt;
&lt;br /&gt;
= Credits =&lt;br /&gt;
&lt;br /&gt;
References used:&lt;br /&gt;
* [http://linux-sxs.org/internet_serving/pxeboot.html Linux-SXS]&lt;br /&gt;
* [https://help.ubuntu.com/community/PXEInstallMultiDistro Ubuntu]&lt;br /&gt;
* [http://www.c3.hu/docs/oreilly/tcpip/tcpip/appd_03.htm O&#039;Reilly]&lt;br /&gt;
* [http://www.linuxdoc.org/HOWTO/CDServer-HOWTO/addloops.html linuxdoc.org]&lt;br /&gt;
&lt;br /&gt;
{{footer}}&lt;/div&gt;</summary>
		<author><name>SRSullivan</name></author>
	</entry>
	<entry>
		<id>https://alteeve.com/w/index.php?title=Setting_Up_a_PXE_Server_on_an_RPM-based_OS&amp;diff=3698</id>
		<title>Setting Up a PXE Server on an RPM-based OS</title>
		<link rel="alternate" type="text/html" href="https://alteeve.com/w/index.php?title=Setting_Up_a_PXE_Server_on_an_RPM-based_OS&amp;diff=3698"/>
		<updated>2011-09-29T16:56:13Z</updated>

		<summary type="html">&lt;p&gt;SRSullivan: /* The Bootable Kernel */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{howto_header}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= About this Tutorial =&lt;br /&gt;
&#039;&#039;&#039;Dec. 30, 2010&#039;&#039;&#039;: This tutorial has been confirmed to work on [[RHEL]] 6.0 and Fedora 13+.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Nov. 08, 2010&#039;&#039;&#039;: This is the first draft of the final tutorial. As such, should be fairly safe to follow, though mistakes and omissions may exist. Suggestions for clarification are also appreciated.&lt;br /&gt;
&lt;br /&gt;
This tutorial covers the steps needed to make a [http://en.wikipedia.org/wiki/Preboot_Execution_Environment PXE] server. It will be used for hosting multiple [[Operating Systems]] that can be booted from a machine&#039;s network card. The main reason for this setup is to host installation media removing the requirement for have optical drives in machines. It also saves you from having a pile of optical discs kicking around.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Prerequisite ==&lt;br /&gt;
&lt;br /&gt;
This tutorial assumes that you have a fresh install of [[Fedora]] 13+ and/or RHEL 6.0 and that the machine&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth0&amp;lt;/span&amp;gt; device has been statically set to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;192.168.1.10&amp;lt;/span&amp;gt; and the subnet&#039;s router is set to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;192.168.1.1&amp;lt;/span&amp;gt;. This should be easy to adapt to other distributions and network configurations.&lt;br /&gt;
&lt;br /&gt;
== Parts Needed ==&lt;br /&gt;
&lt;br /&gt;
A PXE boot server is fairly strait forward. You need:&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;dhcp&amp;lt;/span&amp;gt;; This answers a workstation&#039;s request for an IP during the boot process.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;tftp-server&amp;lt;/span&amp;gt;; This is a PXE compliant FTP server than handles passing the core boot files to the remote machine.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;syslinux&amp;lt;/span&amp;gt;; This handles those special boot files that the remote machine needs to boot.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;httpd&amp;lt;/span&amp;gt;; Once the boot files start up the remote machine, generally you will tell it to pull the main files from a webserver. This is the Apache webserver that will server that purpose.&lt;br /&gt;
&lt;br /&gt;
= Configuring Needed Services =&lt;br /&gt;
&lt;br /&gt;
== dhcp ==&lt;br /&gt;
&lt;br /&gt;
First you will need a DHCP server. Here is a good little tutorial to follow. Come back once you finish.&lt;br /&gt;
&lt;br /&gt;
* [[DHCP on an RPM-based OS]]&lt;br /&gt;
&lt;br /&gt;
=== Addition to the DHCP Configuration File ===&lt;br /&gt;
&lt;br /&gt;
We need to add a section to the DHCP server configuration file, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;dhcpd.conf&amp;lt;/span&amp;gt;. We need to add an option to the relevant &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;subnet&amp;lt;/span&amp;gt; directive(s) indicating where interested clients can go to get the PXE boot configuration. In this example, the PXE server and DHCP server are one in the same, but this is by choice only.&lt;br /&gt;
&lt;br /&gt;
The section to add is below.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
	# These two options tell clients where to go to get the file needed to&lt;br /&gt;
	# start the boot process.&lt;br /&gt;
	next-server 192.168.1.254;&lt;br /&gt;
	filename &amp;quot;pxelinux.0&amp;quot;;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The updated &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;dhcpd.conf&amp;lt;/span&amp;gt; file should look something like the example below.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: [[EL5]] distributions store this file at &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/dhcpd.conf&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/dhcp/dhcpd.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
### Global options&lt;br /&gt;
# General domain information&lt;br /&gt;
option domain-name &amp;quot;alteeve.com&amp;quot;;&lt;br /&gt;
option domain-name-servers 192.139.81.117, 192.139.81.1;&lt;br /&gt;
&lt;br /&gt;
# Tell the server that it&#039;s authoritive on our network.&lt;br /&gt;
authoritive;&lt;br /&gt;
&lt;br /&gt;
# This is required for EL5 operating systems but is optional on EL6 and newer&lt;br /&gt;
# Fedoras (F13+, at least). It controls how dynamic DNS updating is handled. In&lt;br /&gt;
# our case, we aren&#039;t concerned about DDNS so we&#039;ll set it to &#039;none&#039;.&lt;br /&gt;
ddns-update-style none;&lt;br /&gt;
&lt;br /&gt;
### Subnet options&lt;br /&gt;
subnet 192.168.1.0 netmask 255.255.255.0 {&lt;br /&gt;
	# This is the DHCP server, but not the actual Internet gateway. So this&lt;br /&gt;
	# Argument points our clients to the right box.&lt;br /&gt;
	option routers 192.168.1.254;&lt;br /&gt;
	&lt;br /&gt;
	# Set our range. This can be whatever you want so long as it fits in&lt;br /&gt;
	# your netmask.&lt;br /&gt;
	range 192.168.1.100 192.168.1.220;&lt;br /&gt;
	&lt;br /&gt;
	# If clients don&#039;t ask, make the lease available for the following&lt;br /&gt;
	# number of seconds. If the client does ask, allow up to this number of&lt;br /&gt;
	# seconds. 86,400s = 24h.&lt;br /&gt;
	default-lease-time 86400;&lt;br /&gt;
	max-lease-time 86400;&lt;br /&gt;
&lt;br /&gt;
	# These two options tell clients where to go to get the file needed to&lt;br /&gt;
	# start the boot process.&lt;br /&gt;
	next-server 192.168.1.254;&lt;br /&gt;
	filename &amp;quot;pxelinux.0&amp;quot;;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Restart the DHCP server and you&#039;re done.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/dhcpd restart&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Starting dhcpd:                                            [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== tftp ==&lt;br /&gt;
&lt;br /&gt;
We will use the &#039;trivial FTP&#039; program as it is a PXE-compliant FTP program that can transfers the boot files from the PXE server to the client. It runs as an &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xinetd&amp;lt;/span&amp;gt; package, so we will need to make sure it is installed as well. All told, it lives up to it&#039;s name as it is quite trivial to setup.&lt;br /&gt;
&lt;br /&gt;
First, install them.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install tftp-server xinetd&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then edit &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/xinted.d/tftp&amp;lt;/span&amp;gt; and change &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;disable = yes&amp;lt;/span&amp;gt; to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;disable = no&amp;lt;/span&amp;gt;. The edited file should now look like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/xinetd.d/tftp&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# default: off&lt;br /&gt;
# description: The tftp server serves files using the trivial file transfer \&lt;br /&gt;
#       protocol.  The tftp protocol is often used to boot diskless \&lt;br /&gt;
#       workstations, download configuration files to network-aware printers, \&lt;br /&gt;
#       and to start the installation process for some operating systems.&lt;br /&gt;
service tftp&lt;br /&gt;
{&lt;br /&gt;
        disable                 = no&lt;br /&gt;
        socket_type             = dgram&lt;br /&gt;
        protocol                = udp&lt;br /&gt;
        wait                    = yes&lt;br /&gt;
        user                    = root&lt;br /&gt;
        server                  = /usr/sbin/in.tftpd&lt;br /&gt;
        server_args             = -s /var/lib/tftpboot&lt;br /&gt;
        disable                 = no&lt;br /&gt;
        per_source              = 11&lt;br /&gt;
        cps                     = 100 2&lt;br /&gt;
        flags                   = IPv4&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Being an &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xinetd&amp;lt;/span&amp;gt; service, that is what we need to enable at boot time and then start.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
chkconfig dhcpd on&lt;br /&gt;
chkconfig xinetd on&lt;br /&gt;
/etc/init.d/xinetd restart&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Stopping xinetd:                                           [FAILED]&lt;br /&gt;
Starting xinetd:                                           [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Done!&lt;br /&gt;
&lt;br /&gt;
= pxelinux =&lt;br /&gt;
&lt;br /&gt;
In the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xintd&amp;lt;/span&amp;gt; file for &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;tftp&amp;lt;/span&amp;gt; was this line:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
        server_args             = -s /var/lib/tftpboot&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This determines where the PXE boot files will be setup. Some people like to change this to be &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/tftpboot&amp;lt;/span&amp;gt;, but we&#039;ll keep it there to keep things simple. In Fedora, this directory already exists and should be world-readable. If it isn&#039;t for some reason, create it and set the permissions to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;0755&amp;lt;/span&amp;gt; or &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;0777&amp;lt;/span&amp;gt;, depending on your security requirements.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: On [[EL5]], the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;server_args&amp;lt;/span&amp;gt; value is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;-s /tftpboot&amp;lt;/span&amp;gt;. You can leave this as-is and adapt the rest of the tutorial to this directory if you wish. Otherwise, change this to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/var/lib/tftpboot&amp;lt;/span&amp;gt;. Changing it is recommended as it will facilitate future upgrades or migrations of your configuration.&lt;br /&gt;
&lt;br /&gt;
So now we need to install a package called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;syslinux&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install syslinux&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Setting Up the Boot Environment ==&lt;br /&gt;
&lt;br /&gt;
Next up, we need to copy a couple files into the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;tftpboot&amp;lt;/span&amp;gt; directory. These files are provided by the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;syslinux&amp;lt;/span&amp;gt; package we installed earlier and can be found in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/usr/share/syslinux/&amp;lt;/span&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
The main files are:&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;pxelinux.0&amp;lt;/span&amp;gt;: This is the actual kernel that is passed to the client to begin the boot process. You&#039;ll notice this is the file specified in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;dhcpd.conf&amp;lt;/span&amp;gt; file earlier in our setup. It boots the client far enough so that it can see the boot menu, if any, and then move on to find the main system to boot. This &amp;quot;main system&amp;quot; could be a boot DVD or a full [[OS]].&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vesamenu.c32&amp;lt;/span&amp;gt;: This is the 32-bit [http://syslinux.zytor.com/wiki/index.php/SYSLINUX#COMBOOT_image comboot] file. This enables 32-bit colour images to be used for the boot menu (alpha+rr+gg+bb). This replaces the older 16-colour &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;menu.c32&amp;lt;/span&amp;gt; of earlier version that allow for very basic images.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
rsync -av /usr/share/syslinux/pxelinux.0 /var/lib/tftpboot/&lt;br /&gt;
rsync -av /usr/share/syslinux/vesamenu.c32 /var/lib/tftpboot/&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: On [[EL5]], only &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;pxelinux.0&amp;lt;/span&amp;gt; exists and it is in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/usr/lib/syslinux/&amp;lt;/span&amp;gt;. The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vesamenu.c32&amp;lt;/span&amp;gt; can be copied from an [[EL6]] machine or downloaded from this server.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
rsync -av /usr/lib/syslinux/pxelinux.0 /var/lib/tftpboot/&lt;br /&gt;
wget -c https://alteeve.com/files/pxe/tftpboot/vesamenu.c32 -P /var/lib/tftpboot/&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Client Configuration Files ===&lt;br /&gt;
&lt;br /&gt;
Client configuration files will be placed in a new directory under &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;tftpboot&amp;lt;/span&amp;gt; called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;pxelinux.cfg&amp;lt;/span&amp;gt;. So to start, we need to create it:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
mkdir /var/lib/tftpboot/pxelinux.cfg&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Before we talk about the contents of the configuration files, it is important to understand how the PXE server decides which one to use for a given client.&lt;br /&gt;
&lt;br /&gt;
When a client connects, the PXE server looks at the client&#039;s [[MAC]] address and checks to see if there is a matching hyphen-separated configuration file. If that isn&#039;t found, it then looks at the client&#039;s IP address, as set by the DHCP server. It looks for configuration files matching the [[hexadecimal]] representation of the IP address. For example, If the client was given the IP address &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;192.168.1.200&amp;lt;/span&amp;gt;, the PXE server will start by looking for a configuration file called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;C0A801C8&amp;lt;/span&amp;gt;. If it doesn&#039;t find a matching file, it will then knock-off the right-most nibble and check again. It will do this until all the possible file names are checked.&lt;br /&gt;
&lt;br /&gt;
If the PXE server finds no configuration file matching the MAC address or any variant on the IP address, it falls back to a configuration file called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;default&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Let&#039;s show this series using the example of a client with MAC address &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;00:24:7e:69:6f:0e&amp;lt;/span&amp;gt; and having been assigned the IP address &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;192.168.1.200&amp;lt;/span&amp;gt;. The PXE server will then look for the following configuration file names in the following order:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
/var/lib/tftpboot/pxelinux.cfg/00-24-7E-69-6F-0E&lt;br /&gt;
/var/lib/tftpboot/pxelinux.cfg/C0A801C8&lt;br /&gt;
/var/lib/tftpboot/pxelinux.cfg/C0A801C&lt;br /&gt;
/var/lib/tftpboot/pxelinux.cfg/C0A801&lt;br /&gt;
/var/lib/tftpboot/pxelinux.cfg/C0A80&lt;br /&gt;
/var/lib/tftpboot/pxelinux.cfg/C0A8&lt;br /&gt;
/var/lib/tftpboot/pxelinux.cfg/C0A&lt;br /&gt;
/var/lib/tftpboot/pxelinux.cfg/C0&lt;br /&gt;
/var/lib/tftpboot/pxelinux.cfg/C&lt;br /&gt;
/var/lib/tftpboot/pxelinux.cfg/default&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I&#039;ve made a little script to convert decimal-type IP addresses into hexadecimal-type specifically to help in naming these configuration files. I am sure there are many others out there.&lt;br /&gt;
* [[ip_to_hex]]&lt;br /&gt;
&lt;br /&gt;
=== The Configuration Files ===&lt;br /&gt;
&lt;br /&gt;
All of the possible configuration files can be setup using the same set of options and can be setup in similar ways. There is nothing special about any given configuration file. For this reason, we will cover the contents of the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;default&amp;lt;/span&amp;gt; configuration file only.&lt;br /&gt;
&lt;br /&gt;
Below is the default configuration file we will use. Comments are embedded explaining each option.&lt;br /&gt;
&lt;br /&gt;
* Direct download: &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/var/lib/tftpboot/pxelinux.cfg/[https://alteeve.com/files/pxe/tftpboot/pxelinux.cfg/default default]&amp;lt;/span&amp;gt;&lt;br /&gt;
* Direct download: &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/var/lib/tftpboot/[https://alteeve.com/files/pxe/tftpboot/an-pxe_splash_1024_768.png an-pxe_splash_1024_768.png]&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /var/lib/tftpboot/pxelinux.cfg/default&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;perl&amp;quot;&amp;gt;&lt;br /&gt;
# Use the high-colour menu system. This file, and the low-colour &#039;menu.c32&#039;&lt;br /&gt;
# version, are provided by the syslinux package and can be found in the&lt;br /&gt;
# &#039;/var/lib/tftpboot&#039; directory. Copy it to &#039;/var/lib/tftpboot&#039;.&lt;br /&gt;
UI vesamenu.c32&lt;br /&gt;
&lt;br /&gt;
# Time out and use the default menu option. Defined as tenths of a second.&lt;br /&gt;
TIMEOUT 600&lt;br /&gt;
&lt;br /&gt;
# Prompt the user. Set to &#039;1&#039; to automatically choose the default option. This&lt;br /&gt;
# is really meant for files matched to MAC addresses.&lt;br /&gt;
PROMPT 0&lt;br /&gt;
&lt;br /&gt;
# Set the boot menu to be 1024x768 with a nice background image. Be careful to&lt;br /&gt;
# ensure that all your user&#039;s can see this resolution! Default is 640x480.&lt;br /&gt;
MENU RESOLUTION 1024 768&lt;br /&gt;
# This file must be in or under the &#039;/var/lib/tftpboot&#039; folder.&lt;br /&gt;
MENU BACKGROUND an-pxe_splash_1024_768.png&lt;br /&gt;
&lt;br /&gt;
# These do not need to be set. I set them here to show how you can customize or&lt;br /&gt;
# localize your PXE server&#039;s dialogue.&lt;br /&gt;
MENU TITLE    AN!PXE Boot Server&lt;br /&gt;
# Below, the hash (#) character is replaced with the countdown timer. The&lt;br /&gt;
# &#039;{,s}&#039; allows for pluralizing a word and is used when the value is &amp;gt;= &#039;2&#039;.&lt;br /&gt;
MENU AUTOBOOT Will boot the next device as configured in your BIOS in # second{,s}.&lt;br /&gt;
MENU TABMSG   Press the &amp;lt;tab&amp;gt; key to edit the boot parameters of the highlighted option.&lt;br /&gt;
MENU NOTABMSG Editing of this option is disabled.&lt;br /&gt;
&lt;br /&gt;
# The following options set the various colours used in the menu. All possible&lt;br /&gt;
# options are specified except for F# help options. The colour is expressed as&lt;br /&gt;
# two hex characters between &#039;00&#039; and &#039;ff&#039; for red, green, blue and alpha,&lt;br /&gt;
# respectively (#RRGGBBAA).&lt;br /&gt;
# Format is: MENU COLOR &amp;lt;Item&amp;gt; &amp;lt;ANSI Seq.&amp;gt; &amp;lt;foreground&amp;gt; &amp;lt;background&amp;gt; &amp;lt;shadow type&amp;gt;&lt;br /&gt;
MENU COLOR screen      0  #80ffffff #00000000 std      # background colour not covered by the splash image&lt;br /&gt;
MENU COLOR border      0  #ffffffff #ee000000 std      # The wire-frame border&lt;br /&gt;
MENU COLOR title       0  #ffff3f7f #ee000000 std      # Menu title text&lt;br /&gt;
MENU COLOR sel         0  #ff00dfdf #ee000000 std      # Selected menu option&lt;br /&gt;
MENU COLOR hotsel      0  #ff7f7fff #ee000000 std      # The selected hotkey (set with ^ in MENU LABEL)&lt;br /&gt;
MENU COLOR unsel       0  #ffffffff #ee000000 std      # Unselected menu options&lt;br /&gt;
MENU COLOR hotkey      0  #ff7f7fff #ee000000 std      # Unselected hotkeys (set with ^ in MENU LABEL)&lt;br /&gt;
MENU COLOR tabmsg      0  #c07f7fff #00000000 std      # Tab text&lt;br /&gt;
MENU COLOR timeout_msg 0  #8000dfdf #00000000 std      # Timout text&lt;br /&gt;
MENU COLOR timeout     0  #c0ff3f7f #00000000 std      # Timout counter&lt;br /&gt;
MENU COLOR disabled    0  #807f7f7f #ee000000 std      # Disabled menu options, including SEPARATORs&lt;br /&gt;
MENU COLOR cmdmark     0  #c000ffff #ee000000 std      # Command line marker - The &#039;&amp;gt; &#039; on the left when editing an option&lt;br /&gt;
MENU COLOR cmdline     0  #c0ffffff #ee000000 std      # Command line - The text being edited&lt;br /&gt;
# Options below haven&#039;t been tested, descriptions may be lacking.&lt;br /&gt;
MENU COLOR scrollbar   0  #40000000 #00000000 std      # Scroll bar&lt;br /&gt;
MENU COLOR pwdborder   0  #80ffffff #20ffffff std      # Password box wire-frame border&lt;br /&gt;
MENU COLOR pwdheader   0  #80ff8080 #20ffffff std      # Password box header&lt;br /&gt;
MENU COLOR pwdentry    0  #80ffffff #20ffffff std      # Password entry field&lt;br /&gt;
MENU COLOR help        0  #c0ffffff #00000000 std      # Help text, if set via &#039;TEXT HELP ... ENDTEXT&#039;&lt;br /&gt;
&lt;br /&gt;
### Now define the menu options&lt;br /&gt;
&lt;br /&gt;
# I feel it is safest to return booting to the client as the first and default&lt;br /&gt;
# option. This entry below will do just that.&lt;br /&gt;
LABEL next&lt;br /&gt;
        MENU LABEL ^A)  Boot the next device as configured in your BIOS&lt;br /&gt;
        MENU DEFAULT&lt;br /&gt;
        localboot&lt;br /&gt;
&lt;br /&gt;
## To keep the menu from getting out of hand, I like to create sub-menus.&lt;br /&gt;
## The sub-menus are simply additional files in the same directory as this&lt;br /&gt;
## file with one or more boot options or, if you wish, further sub-menus.&lt;br /&gt;
#&lt;br /&gt;
# This section covers boot options without pre-defined kickstart (or other)&lt;br /&gt;
# automation scripts.&lt;br /&gt;
MENU BEGIN generic&lt;br /&gt;
        MENU TITLE Generic installations (as if booting from media)&lt;br /&gt;
        LABEL Previous&lt;br /&gt;
        MENU LABEL ^B) Previous Menu&lt;br /&gt;
        MENU EXIT&lt;br /&gt;
        MENU SEPARATOR&lt;br /&gt;
        MENU INCLUDE pxelinux.cfg/generic.menu&lt;br /&gt;
MENU END&lt;br /&gt;
&lt;br /&gt;
# As I build a lot of clusters, I like to have a section dedicated to boot&lt;br /&gt;
# options used to build cluster nodes.&lt;br /&gt;
MENU BEGIN cluster&lt;br /&gt;
        MENU TITLE Cluster nodes&lt;br /&gt;
        LABEL Previous&lt;br /&gt;
        MENU LABEL ^C) Previous Menu&lt;br /&gt;
        MENU EXIT&lt;br /&gt;
        MENU SEPARATOR&lt;br /&gt;
        MENU INCLUDE pxelinux.cfg/cluster.menu&lt;br /&gt;
MENU END&lt;br /&gt;
&lt;br /&gt;
# This section is where I put generic automated install scripts. These&lt;br /&gt;
# generally have no specific use and are meant to create installations that&lt;br /&gt;
# can be easily adapted or built upon.&lt;br /&gt;
MENU BEGIN stock&lt;br /&gt;
        MENU TITLE Stock installs (generic kickstart-based installs)&lt;br /&gt;
        LABEL Previous&lt;br /&gt;
        MENU LABEL ^D) Previous Menu&lt;br /&gt;
        MENU EXIT&lt;br /&gt;
        MENU SEPARATOR&lt;br /&gt;
        MENU INCLUDE pxelinux.cfg/stock.menu&lt;br /&gt;
MENU END&lt;br /&gt;
&lt;br /&gt;
# Lastly, I like to make &amp;quot;Live&amp;quot; operating systems available. These are very&lt;br /&gt;
# useful for diagnostics and recovery work where you need more than a &#039;rescue&#039;&lt;br /&gt;
# boot provides and where you do not want to effect the underlying system OS.&lt;br /&gt;
MENU BEGIN live&lt;br /&gt;
        MENU TITLE Live Distros (bootable without affecting the underlying system)&lt;br /&gt;
        LABEL Previous&lt;br /&gt;
        MENU LABEL ^E) Previous Menu&lt;br /&gt;
        MENU EXIT&lt;br /&gt;
        MENU SEPARATOR&lt;br /&gt;
        MENU INCLUDE pxelinux.cfg/live.menu&lt;br /&gt;
MENU END&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;default&amp;lt;span&amp;gt; file above points to four sub-menu files. How many you use, if you use any at all, is up to you. You can also use any file name you want, or any directory under &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/var/lib/tftpboot/&amp;lt;span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
To save space on this page, The sub-menu files mentioned above are their own pages and are linked below. These will hopefully act as useful references for your own sub-menu files, should you wish to use menus.&lt;br /&gt;
&lt;br /&gt;
* [[pxe_generic.menu|generic.menu]]&lt;br /&gt;
* [[pxe_cluster.menu|cluster.menu]]&lt;br /&gt;
* [[pxe_stock.menu|stock.menu]]&lt;br /&gt;
* [[pxe_live.menu|live.menu]]&lt;br /&gt;
&lt;br /&gt;
=== Options ===&lt;br /&gt;
&lt;br /&gt;
Let&#039;s now take a look at the various parts. This is an overview only, for a complete list of options please read &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/usr/share/doc/syslinux-3.84/menu.txt&amp;lt;/span&amp;gt;. Update the version number to match your installed version.&lt;br /&gt;
&lt;br /&gt;
Wherever a colour can be specified, the format is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;#AARRGGBB&amp;lt;/span&amp;gt;. That is, alpha (transparency), red, green and blue intensity expressed as a 256 range specified using two [[hexadecimal]] characters per option. &lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;UI vesamenu.c32&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This loads the 32-bit colour [http://syslinux.zytor.com/wiki/index.php/SYSLINUX#COMBOOT_image COMBOOT] image. This allows for the full colour range plus 8-bit alpha (transparency) to be available at boot time. It&#039;s what allows for a much more attractive boot menu. To read details on the innards of the COMBOOT format, read &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/usr/share/doc/syslinux-3.84/comboot.txt&amp;lt;/span&amp;gt;. Update the version number to match your installed version.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;TIMEOUT 600&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is the amount of time, in tenths of a second, that the PXE loader will wait before performing the default action. If the user navigates through the menu. the timer will stop and wait for the user to make a selection. To prevent an install from running accidentally, the default option should always be a non-damaging option.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;prompt 0&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This tells the PXE server to prompt the user to make a choice. If this is set to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt; then the PXE server will use the default option.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;MENU RESOLUTION 1024 768&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This tells the boot loader to run at the set resolution, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;1024x768&amp;lt;/span&amp;gt; in this example. The default is to run up as &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vga (640x480)&amp;lt;/span&amp;gt;. Be sure when pushing a higher resolution that all of your potential users have machines that support the given resolution.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;MENU BACKGROUND an-pxe_splash_1024_768.png&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is the background image to use. This must exist in or under the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/var/lib/tftpboot/&amp;lt;/span&amp;gt; directory. If you want to use a subdirectory, specify it as a relative path. For example, if you want to store images in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/var/lib/tftpboot/images/&amp;lt;/span&amp;gt;, then this would be set to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;images/an-pxe_splash_1024_768.png&amp;lt;/span&amp;gt;. The format of the image can be &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;JPEG&amp;lt;/span&amp;gt; or The format of the image can be &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;JPNG&amp;lt;/span&amp;gt; (other image formats may work). The image itself should match the size of the screen.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;MENU TITLE    AN!PXE Boot Server&amp;lt;/span&amp;gt;&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;MENU AUTOBOOT Will boot the next device as configured in your BIOS in # second{,s}.&amp;lt;/span&amp;gt;&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;MENU TABMSG   Press the &amp;lt;tab&amp;gt; key to edit the boot parameters of the highlighted option.&amp;lt;/span&amp;gt;&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;MENU NOTABMSG Editing of this option is disabled.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These options allow you to customize or localize the text. None need to be specified.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;AUTOBOOT&amp;lt;/span&amp;gt; option is a little special to accommodate the count-down. The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;#&amp;lt;/span&amp;gt; will be replaced by the time remaining. The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;{,s}&amp;lt;/span&amp;gt; tells the string to add an &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;s&amp;lt;/span&amp;gt; to the end of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;seconds&amp;lt;/span&amp;gt; when the time remaining is greater than one.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;MENU COLOR x&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These options control the colour and transparency of the various text-elements, borders and backgrounds. None of them need to be specified and all have sane default values. Most of the available options are shown in the example above.&lt;br /&gt;
&lt;br /&gt;
Each entry is formatted like so:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;MENU COLOR &amp;lt;type&amp;gt; &amp;lt;ansi&amp;gt; &amp;lt;foreground&amp;gt; &amp;lt;background&amp;gt; &amp;lt;shadow&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;type&amp;gt;&amp;lt;/span&amp;gt; is the name of the element you are manipulating. The only &#039;type&#039; not show in the example above is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;msgXX&amp;lt;/span&amp;gt; where &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;XX&amp;lt;/span&amp;gt; is a number between &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;12&amp;lt;/span&amp;gt;. These are used to control &amp;quot;help windows&amp;quot; that can be shown to the user when they press an &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;F[1-12]&amp;lt;/span&amp;gt; key.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;ansi&amp;gt;&amp;lt;/span&amp;gt; number(s) tell the boot loader how to format the text using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[ANSI]]&amp;lt;/span&amp;gt; code. This is set to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;0&amp;lt;/span&amp;gt;, &amp;quot;reset&amp;quot;, in our example to clear any &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ANSI&amp;lt;/span&amp;gt; formatting. You can specify multiple &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ANSI&amp;lt;/span&amp;gt; codes by separating them with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;;&amp;lt;/span&amp;gt; (semi-colons).&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;foreground&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;background&amp;gt;&amp;lt;/span&amp;gt; values are the [[hexadecimal]] notation for the transparency and colour in the format &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;#AARRGGBB&amp;lt;/span&amp;gt; as mentioned earlier.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;shadow&amp;gt;&amp;lt;/span&amp;gt; is the type of drop-shadow to render for the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;type&amp;gt;&amp;lt;/span&amp;gt;. Valid options are:&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;none&amp;lt;/span&amp;gt;: No shadowing.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;std&amp;lt;/span&amp;gt;, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;standard&amp;lt;/span&amp;gt;: Foreground pixels are raised.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;all&amp;lt;/span&amp;gt;: both foreground and background pixels are raised.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rev&amp;lt;/span&amp;gt;, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;reverse&amp;lt;/span&amp;gt;: Background pixels are raised.&lt;br /&gt;
&lt;br /&gt;
=== Labels ===&lt;br /&gt;
&lt;br /&gt;
Label blocks are the actual boot options made available within the PXE menu. There are many options available here that are not shown in this example. If you are curious, please read &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/usr/share/doc/syslinux-3.84/menu.txt&amp;lt;/span&amp;gt; which was installed on your system when you installed &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;syslinux&amp;lt;/span&amp;gt;. Of course, replace &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;3.84&amp;lt;/span&amp;gt; with the version you have installed.&lt;br /&gt;
&lt;br /&gt;
First example;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
LABEL next&lt;br /&gt;
	MENU LABEL ^A)  Boot the next device as configured in your BIOS&lt;br /&gt;
	MENU DEFAULT&lt;br /&gt;
	localboot&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This example is a good one to always use as the first, and default, option. &lt;br /&gt;
&lt;br /&gt;
The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;LABEL next&amp;lt;/span&amp;gt; defines this option group. The name &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;next&amp;lt;/span&amp;gt; has no special meaning, but can be used for more complex setups later. For now, just be sure to keep this name simple with no spaces.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;MENU LABEL ...&amp;lt;/span&amp;gt; option control two things. First, it&#039;s the text shown to the user. Second, the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;^A&amp;lt;/span&amp;gt; sets the keyboard key that the user can press to select the option. Whatever character comes immediately after the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;/span&amp;gt; (caret), &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;A&amp;lt;/span&amp;gt; in this example, becomes the mapped key. Please note that the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;^&amp;lt;/span&amp;gt; can come anywhere in the title text. Ensure that no two entries have the same character mapped!&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;MENU DEFAULT&amp;lt;/span&amp;gt; command tells the boot loader to automatically boot this option if the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;TIMEOUT&amp;lt;/span&amp;gt; expires. Only one entry may have this option.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;localboot&amp;lt;/span&amp;gt; is a special command the skips the PXE boot loader. Your BIOS should proceed to boot the next device in it&#039;s boot order list. Generally this will boot the local hard drive.&lt;br /&gt;
&lt;br /&gt;
Another example, from the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cluster.menu&amp;lt;/span&amp;gt; file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
LABEL f14_an-node01&lt;br /&gt;
        MENU LABEL ^1) Install AN!Node01; Storage Node 01&lt;br /&gt;
        KERNEL boot/f14/x86_64/vmlinuz&lt;br /&gt;
        APPEND initrd=boot/f14/x86_64/initrd.img ks=http://192.168.1.254/f14/x86_64/ks/an-node01.ks ksdevice=eth0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is a pretty typical entry. The two new options to note are:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;KERNEL ...&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is the path to the boot kernel used to start the OS or it&#039;s installer. Most distributions make use of a small kernel to run up their installer or Live CD/DVD environment. The PXE server will search for the kernel relative to the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;tftpboot&amp;lt;/span&amp;gt; directory. Where to get the proper boot kernel will depend on the distribution you are setting up. &lt;br /&gt;
&lt;br /&gt;
Some examples will be [[#Setting Up The Boot Environment|shown below]].&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;APPEND ...&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This argument allows you to pass arguments to the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;KERNEL&amp;lt;/span&amp;gt; specified above. Which options can be passed will, again, depend on the distribution you are setting up. In this example, an &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;initrd&amp;lt;/span&amp;gt; image is specified, a kickstart script is set and the network device to use to search for the kickstart script are defined.&lt;br /&gt;
&lt;br /&gt;
The [[Setting_Up_a_PXE_Server_in_Fedora#Making_The_Install_Files_For_An_OS_Available|Apache configuration]] section below covers in more detail how to make the kickstart and OS installation files available.&lt;br /&gt;
&lt;br /&gt;
=== Menus ===&lt;br /&gt;
&lt;br /&gt;
Menus are very useful when you have more than a few entries in your PXE server. They allow for creating groups of bootable options based on whatever given criteria works for you.&lt;br /&gt;
&lt;br /&gt;
Let&#039;s look at the &amp;quot;cluster&amp;quot; menu from above.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
MENU BEGIN cluster&lt;br /&gt;
        MENU TITLE Cluster nodes&lt;br /&gt;
        LABEL Previous&lt;br /&gt;
        MENU LABEL ^C) Previous Menu&lt;br /&gt;
        MENU EXIT&lt;br /&gt;
        MENU SEPARATOR&lt;br /&gt;
        MENU INCLUDE pxelinux.cfg/cluster.menu&lt;br /&gt;
MENU END&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;MENU BEGIN ...&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This begins the section and is followed by a name that should (must?) be unique.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;MENU TITLE ...&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is the text shown at the top of the sub-menu once selected.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;LABEL ...&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is the text shown as the first option in the sub-menu that returns to the previous screen.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;MENU LABEL ...&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is the text that the user selects to descend into the sub-menu.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: I use the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;^&amp;lt;/span&amp;gt; character to enable a letter to select the menu option but it doesn&#039;t seem to work. Please let me know if you have further information on how, or if, sub-menu options are selected with a key press.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;MENU EXIT ...&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I am not sure, exactly, what this option does.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;MENU SEPARATOR ...&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I am not sure, exactly, what this option does.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;MENU INCLUDE ...&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is the path and file to include when building this sub-menu. The path is relative to the tftpboot &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;server_args&amp;lt;/span&amp;gt; directory, as set in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/xinetd.d/tftp&amp;lt;/span&amp;gt; file.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;MENU END&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This closes the sub-menu section. &lt;br /&gt;
&lt;br /&gt;
There are other options, though none seem to be well documented at the moment. I got this far thanks to [https://help.ubuntu.com/community/PXEInstallMultiDistro this page]. Any additional information on these and other options would be welcome!&lt;br /&gt;
&lt;br /&gt;
= Setting Up Apache =&lt;br /&gt;
&lt;br /&gt;
[[Image:f13_httpd_default_page_01.png|thumb|right|400px|Default Apache2.2 web page on Fedora 13]]&lt;br /&gt;
&lt;br /&gt;
We will use the Apache web server to make our operating system images available. First, install the server.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install httpd&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The default install of Apache2 will work fine for us, so we won&#039;t adjust it. Let&#039;s start it now.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/httpd start&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Test access by loading [http://localhost http://localhost] from the PXE server. If that works, then try connecting to the PXE server from another computer using it&#039;s [[IP]] address. In either case, you should see a page like the one to the right.&lt;br /&gt;
&lt;br /&gt;
== Setting Up The DocumentRoot ==&lt;br /&gt;
&lt;br /&gt;
Apache has a variable called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;DocumentRoot&amp;lt;/span&amp;gt; in it&#039;s main configuration file &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/httpd/conf/httpd.conf&amp;lt;/span&amp;gt;. Anything in or under the directory specified in this variable will be exposed on your web server. The default directory is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/var/www/html&amp;lt;/span&amp;gt; and this will be where we put our various kickstart files, ISO files and under which we will mount those ISO files.&lt;br /&gt;
&lt;br /&gt;
== The Default Page ==&lt;br /&gt;
&lt;br /&gt;
There is no need to create an &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;index.html&amp;lt;/span&amp;gt; page, as the image kickstart scripts and image files will be called directly. Personally though, I like to put together a simple page listing the various installations I&#039;ve made available on the PXE server. If nothing else, it helps identify the machine when you call it in a browser.&lt;br /&gt;
&lt;br /&gt;
If you decide to create one, please use whatever website tool, text editor or [[Integrated Development Environment|IDE]] you prefer. For reference, below are the very simple, probably not [[W3C]] compliant static [[HTML]] page I use along with a trivial [[CSS]] file.&lt;br /&gt;
&lt;br /&gt;
* [[PXE Server index.html]]&lt;br /&gt;
* [[PXE Server common.css]]&lt;br /&gt;
&lt;br /&gt;
Put the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;index.html&amp;lt;/span&amp;gt; (and associated files) directly in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;DocumentRoot&amp;lt;/span&amp;gt; directory. By default, Apache2 will look for a file named &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;index.html&amp;lt;/span&amp;gt; and load it if it is found.&lt;br /&gt;
&lt;br /&gt;
== Making The Install Files For An OS Available ==&lt;br /&gt;
&lt;br /&gt;
At the end of the day, the only thing that matters here is that all of the installation files and kickstart scripts are &#039;&#039;somewhere&#039;&#039; under the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;DocumentRoot&amp;lt;/span&amp;gt; directory. I will describe here the layout that I like, but feel free to adjust it however you see fit. &lt;br /&gt;
&lt;br /&gt;
Further, different operating systems will need to be configured differently. For the purpose of this tutorial, I will be showing how RPM-based [[Linux]] distributions are configured. If you are using different operating systems, you should be able to build on the steps below.&lt;br /&gt;
&lt;br /&gt;
=== Planning Your Directory Structure ===&lt;br /&gt;
&lt;br /&gt;
Under the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;DocumentRoot&amp;lt;/span&amp;gt; directory, we will need to create a set of directories to store the operating system files and associated kickstart scripts in. I&#039;ve found the following structure works well.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;DocumentRoot&amp;gt;/&amp;lt;os_name&amp;gt;/&amp;lt;architecture&amp;gt;/[ks|iso|img]&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Using Fedora 14 [[x86_64]] with the default Apache &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;DocumentRoot&amp;lt;/span&amp;gt; as an example, you would create the following directories. Note that I like to shorten Operating System names to the shortest version practical to save typing. Feel free to use the full names if you prefer verbose [[URL]]s.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/var/www/html/f14/x86_64/ks&amp;lt;/span&amp;gt;: Kickstart scripts go here&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/var/www/html/f14/x86_64/iso&amp;lt;/span&amp;gt;: The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[http://download.fedoraproject.org/pub/fedora/linux/releases/14/Fedora/x86_64/iso/Fedora-14-x86_64-DVD.iso Fedora-14-x86_64-DVD.iso]&amp;lt;/span&amp;gt; file is saved here&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/var/www/html/f14/x86_64/img&amp;lt;/span&amp;gt;: The [[ISO]] file above is mounted here.&lt;br /&gt;
&lt;br /&gt;
If you wanted to also make the [[i386]] version of Fedora available, simply replace &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;x86_64&amp;lt;/span&amp;gt; with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;i386&amp;lt;/span&amp;gt; above. If you want to also make the live version for Fedora 14 x86_64 available, replace &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;f13&amp;lt;/span&amp;gt; with something like &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;f13_live&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Fedora 14 x86_64 ===&lt;br /&gt;
&lt;br /&gt;
Let&#039;s walk through the actual steps needed to make Fedora 14 x86_64 available on Apache now.&lt;br /&gt;
&lt;br /&gt;
First, create the directory structure.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
mkdir -p /var/www/html/f14/x86_64/{iso,img,ks}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now, download the ISO if you have not yet done so. If you have, move it into place.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cd /var/www/html/f14/x86_64/iso&lt;br /&gt;
wget -c http://download.fedoraproject.org/pub/fedora/linux/releases/14/Fedora/x86_64/iso/Fedora-14-x86_64-DVD.iso&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we mount the ISO using a loopback device.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
mount -o loop /var/www/html/f14/x86_64/iso/Fedora-14-x86_64-DVD.iso /var/www/html/f14/x86_64/img&lt;br /&gt;
df -h&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Filesystem            Size  Used Avail Use% Mounted on&lt;br /&gt;
/dev/sda3              69G  7.1G   59G  11% /&lt;br /&gt;
tmpfs                 497M   88K  497M   1% /dev/shm&lt;br /&gt;
/dev/sda1             485M   62M  398M  14% /boot&lt;br /&gt;
/dev/sdb1             1.4T  678G  629G  52% /media/disk&lt;br /&gt;
/var/www/html/f14/x86_64/iso/Fedora-14-x86_64-DVD.iso&lt;br /&gt;
                      3.3G  3.3G     0 100% /var/www/html/f14/x86_64/img&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Lastly, copy any kickstart scripts into the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/var/www/html/f14/x86_64/ks/&amp;lt;/span&amp;gt; directory. These scripts will be called by the user after they select an automated install option from the PXE menu.&lt;br /&gt;
&lt;br /&gt;
Here is a generic Fedora 14 x86_64 kickstart I use as a server that you can adapt if you would like. It creates a quite stripped down install.&lt;br /&gt;
* [[kickstart_f14_generic_server.ks]]&lt;br /&gt;
&lt;br /&gt;
That&#039;s it! You can now use make Fedora 14 available as a PXE boot option in your menu.&lt;br /&gt;
&lt;br /&gt;
== Mounting And Unmounting Many ISOs ==&lt;br /&gt;
&lt;br /&gt;
If you make any real use of your PXE server, you will probably find that you will have a lot of ISO files to mount and unmount. To simplify this task, I like to create a couple of bash scripts called, simply, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;mount_iso.sh&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;umount_iso.sh&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
These are simple shell scripts meant to mount and unmount all ISOs with one command. You need to be sure that you keep them up to date as you add and remove operating systems.&lt;br /&gt;
&lt;br /&gt;
You will certainly want to adjust these to suit your setup. With that said, here are my scripts that you can use as templates.&lt;br /&gt;
&lt;br /&gt;
* Direct download: [https://alteeve.com/files/pxe/mount_iso.sh mount_iso.sh]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
# This is used to mount the various ISO used by the PXE server on this server.&lt;br /&gt;
&lt;br /&gt;
echo -n &amp;quot;Mounting Fedora 14, x86_64... &amp;quot;&lt;br /&gt;
mount -o loop /var/www/html/f14/x86_64/iso/Fedora-14-x86_64-DVD.iso /var/www/html/f14/x86_64/img&lt;br /&gt;
echo &amp;quot;Done!&amp;quot;&lt;br /&gt;
&lt;br /&gt;
echo -n &amp;quot;Mounting Fedora 14, i386... &amp;quot;&lt;br /&gt;
mount -o loop /var/www/html/f14/i386/iso/Fedora-14-i386-DVD.iso /var/www/html/f14/i386/img/&lt;br /&gt;
echo &amp;quot;Done!&amp;quot;&lt;br /&gt;
&lt;br /&gt;
echo -n &amp;quot;Mounting Fedora 14 Live DVD, x86_64... &amp;quot;&lt;br /&gt;
mount -o loop /var/www/html/f14_live/x86_64/iso/Fedora-14-x86_64-Live-Desktop.iso /var/www/html/f14_live/x86_64/img/&lt;br /&gt;
echo &amp;quot;Done!&amp;quot;&lt;br /&gt;
&lt;br /&gt;
echo -n &amp;quot;Mounting Fedora 14 Live DVD, i686... &amp;quot;&lt;br /&gt;
mount -o loop /var/www/html/f14_live/i686/iso/Fedora-14-i686-Live-Desktop.iso /var/www/html/f14_live/i686/img/&lt;br /&gt;
echo &amp;quot;Done!&amp;quot;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Direct download: [https://alteeve.com/files/pxe/umount_iso.sh umount_iso.sh]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
# This is used to unmount the various ISO used by the PXE server on this server.&lt;br /&gt;
&lt;br /&gt;
echo -n &amp;quot;Unmounting Fedora 14, x86_64... &amp;quot;&lt;br /&gt;
umount /var/www/html/f14/x86_64/img&lt;br /&gt;
echo &amp;quot;Done!&amp;quot;&lt;br /&gt;
&lt;br /&gt;
echo -n &amp;quot;Unmounting Fedora 14, i386... &amp;quot;&lt;br /&gt;
umount /var/www/html/f14/i386/img/&lt;br /&gt;
echo &amp;quot;Done!&amp;quot;&lt;br /&gt;
&lt;br /&gt;
echo -n &amp;quot;Unmounting Fedora 14 Live DVD, x86_64... &amp;quot;&lt;br /&gt;
umount /var/www/html/f14_live/x86_64/img/&lt;br /&gt;
echo &amp;quot;Done!&amp;quot;&lt;br /&gt;
&lt;br /&gt;
echo -n &amp;quot;Unmounting Fedora 14 Live DVD, i686... &amp;quot;&lt;br /&gt;
umount /var/www/html/f14_live/i686/img/&lt;br /&gt;
echo &amp;quot;Done!&amp;quot;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Increasing Maximum number of Mountable ISOs ===&lt;br /&gt;
&lt;br /&gt;
By default the loop driver only creates 8 loop back devices. Each mounted [[ISO]] takes one of those and there for limits the total number of ISOs that can be mounted at any one time.&lt;br /&gt;
&lt;br /&gt;
There exist two places to change the maximum number of loop back devices.&lt;br /&gt;
The recommend method is to add max_loop option to a new config file in /etc/modprobe.d/.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/modprobe.d/loop.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
options loop max_loop=64&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The second options is to add &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;max_loop=64&amp;lt;/span&amp;gt; to the kernel boot line.&lt;br /&gt;
&lt;br /&gt;
Adjust the number after &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;max_loop=&amp;lt;/span&amp;gt; to suit your installations needs.&lt;br /&gt;
&lt;br /&gt;
= Setting Up The Boot Environment =&lt;br /&gt;
&lt;br /&gt;
All boot options, except &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;localboot&amp;lt;/span&amp;gt;, need to have a kernel made available via the PXE server. Specifically, these kernels must exist somewhere under the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/var/lib/tftpboot&amp;lt;/span&amp;gt; directory. What kernel or boot image a given operating system will need depends entirely on that operating system. For this section, we will continue to use Fedora 14 x86_64 as an example.&lt;br /&gt;
&lt;br /&gt;
== Planning Your Directory Structure, Take Two ==&lt;br /&gt;
&lt;br /&gt;
As with [[#Planning Your Directory Structure|Apache]], we&#039;re potentially going to copy a lot of boot images and other files. It makes sense to have an organized directory structure to put them all in. As before, I will share what I do, but please feel free to do what you find works best for you. &lt;br /&gt;
&lt;br /&gt;
I like to create a dedicated directory called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;boot&amp;lt;/span&amp;gt; and then mimic the layout from Apache, minus the last set of three directories.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;tftpboot&amp;gt;/boot/&amp;lt;os_name&amp;gt;/&amp;lt;architecture&amp;gt;/&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using Fedora 14 x86_64 with the default tftpboot install, I will create the following directory.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
mkdir -p /var/lib/tftpboot/boot/f14/x86_64&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== The Bootable Kernel ==&lt;br /&gt;
&lt;br /&gt;
Remember in the earlier &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;LABEL f14_an-node01&amp;lt;/span&amp;gt; example there was the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;APPEND initrd=boot/f14/x86_64/initrd.img ...&amp;lt;/span&amp;gt; line? The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;boot/f14/x86_64/initrd.img&amp;lt;/span&amp;gt; is the kernel, in the directory we just created!&lt;br /&gt;
&lt;br /&gt;
The last piece of the puzzle then is; Where does the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;initrd.img&amp;lt;/span&amp;gt; file come from?&lt;br /&gt;
&lt;br /&gt;
With most Linux distributions, there is an &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;isolinux&amp;lt;/span&amp;gt; directory in the root of the installation DVD. The files needed to boot the DVD&#039;s installer (or &amp;quot;rescue mode&amp;quot;) are in this directory. These are the same files we need to boot over PXE. If you have followed this tutorial up to this point, then you should be able to see the contents of this directory in your file browser. My PXE server uses the IP address &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;192.168.1.254&amp;lt;/span&amp;gt;, so I can go to &lt;br /&gt;
&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;http://192.168.1.254/f14/x86_64/img/isolinux&amp;lt;/span&amp;gt; and see, among other files, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;initrd.img&amp;lt;/span&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
With the directory created and the ISO mounted, all that is left the make the contents of the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;isolinux&amp;lt;/span&amp;gt; files avaliable in the tftp &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/boot/&amp;lt;/span&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ln -s /var/www/html/f14/x86_64/img/isolinux/ /var/lib/tftpboot/boot/f14/x86_64/&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And we&#039;re done! &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The Reason we use a symlink is so that as the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;img&amp;lt;/span&amp;gt; directory is mounted with an updated ISO (eg. CentOS 5.6 instead of 5.5), the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;boot&amp;lt;/span&amp;gt; directory will always have the correct up to date files.&lt;br /&gt;
&lt;br /&gt;
Now repeat the relevant steps for the rest of the operating systems you want to support via PXE.&lt;br /&gt;
&lt;br /&gt;
= Credits =&lt;br /&gt;
&lt;br /&gt;
References used:&lt;br /&gt;
* [http://linux-sxs.org/internet_serving/pxeboot.html Linux-SXS]&lt;br /&gt;
* [https://help.ubuntu.com/community/PXEInstallMultiDistro Ubuntu]&lt;br /&gt;
* [http://www.c3.hu/docs/oreilly/tcpip/tcpip/appd_03.htm O&#039;Reilly]&lt;br /&gt;
* [http://www.linuxdoc.org/HOWTO/CDServer-HOWTO/addloops.html linuxdoc.org]&lt;br /&gt;
&lt;br /&gt;
{{footer}}&lt;/div&gt;</summary>
		<author><name>SRSullivan</name></author>
	</entry>
	<entry>
		<id>https://alteeve.com/w/index.php?title=Setting_Up_a_PXE_Server_on_an_RPM-based_OS&amp;diff=3478</id>
		<title>Setting Up a PXE Server on an RPM-based OS</title>
		<link rel="alternate" type="text/html" href="https://alteeve.com/w/index.php?title=Setting_Up_a_PXE_Server_on_an_RPM-based_OS&amp;diff=3478"/>
		<updated>2011-05-31T20:40:51Z</updated>

		<summary type="html">&lt;p&gt;SRSullivan: Added documenation on increasing maximum number of loop devices. Updates to Header to induce Section Table.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{howto_header}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= About this Tutorial =&lt;br /&gt;
&#039;&#039;&#039;Dec. 30, 2010&#039;&#039;&#039;: This tutorial has been confirmed to work on [[RHEL]] 6.0 and Fedora 13+.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Nov. 08, 2010&#039;&#039;&#039;: This is the first draft of the final tutorial. As such, should be fairly safe to follow, though mistakes and omissions may exist. Suggestions for clarification are also appreciated.&lt;br /&gt;
&lt;br /&gt;
This tutorial covers the steps needed to make a [http://en.wikipedia.org/wiki/Preboot_Execution_Environment PXE] server. It will be used for hosting multiple [[Operating Systems]] that can be booted from a machine&#039;s network card. The main reason for this setup is to host installation media removing the requirement for have optical drives in machines. It also saves you from having a pile of optical discs kicking around.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Prerequisite ==&lt;br /&gt;
&lt;br /&gt;
This tutorial assumes that you have a fresh install of [[Fedora]] 13+ and/or RHEL 6.0 and that the machine&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth0&amp;lt;/span&amp;gt; device has been statically set to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;192.168.1.10&amp;lt;/span&amp;gt; and the subnet&#039;s router is set to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;192.168.1.1&amp;lt;/span&amp;gt;. This should be easy to adapt to other distributions and network configurations.&lt;br /&gt;
&lt;br /&gt;
== Parts Needed ==&lt;br /&gt;
&lt;br /&gt;
A PXE boot server is fairly strait forward. You need:&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;dhcp&amp;lt;/span&amp;gt;; This answers a workstation&#039;s request for an IP during the boot process.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;tftp-server&amp;lt;/span&amp;gt;; This is a PXE compliant FTP server than handles passing the core boot files to the remote machine.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;syslinux&amp;lt;/span&amp;gt;; This handles those special boot files that the remote machine needs to boot.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;httpd&amp;lt;/span&amp;gt;; Once the boot files start up the remote machine, generally you will tell it to pull the main files from a webserver. This is the Apache webserver that will server that purpose.&lt;br /&gt;
&lt;br /&gt;
= Configuring Needed Services =&lt;br /&gt;
&lt;br /&gt;
== dhcp ==&lt;br /&gt;
&lt;br /&gt;
First you will need a DHCP server. Here is a good little tutorial to follow. Come back once you finish.&lt;br /&gt;
&lt;br /&gt;
* [[DHCP on an RPM-based OS]]&lt;br /&gt;
&lt;br /&gt;
=== Addition to the DHCP Configuration File ===&lt;br /&gt;
&lt;br /&gt;
We need to add a section to the DHCP server configuration file, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;dhcpd.conf&amp;lt;/span&amp;gt;. We need to add an option to the relevant &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;subnet&amp;lt;/span&amp;gt; directive(s) indicating where interested clients can go to get the PXE boot configuration. In this example, the PXE server and DHCP server are one in the same, but this is by choice only.&lt;br /&gt;
&lt;br /&gt;
The section to add is below.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
	# These two options tell clients where to go to get the file needed to&lt;br /&gt;
	# start the boot process.&lt;br /&gt;
	next-server 192.168.1.254;&lt;br /&gt;
	filename &amp;quot;pxelinux.0&amp;quot;;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The updated &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;dhcpd.conf&amp;lt;/span&amp;gt; file should look something like the example below.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: [[EL5]] distributions store this file at &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/dhcpd.conf&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/dhcp/dhcpd.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
### Global options&lt;br /&gt;
# General domain information&lt;br /&gt;
option domain-name &amp;quot;alteeve.com&amp;quot;;&lt;br /&gt;
option domain-name-servers 192.139.81.117, 192.139.81.1;&lt;br /&gt;
&lt;br /&gt;
# Tell the server that it&#039;s authoritive on our network.&lt;br /&gt;
authoritive;&lt;br /&gt;
&lt;br /&gt;
# This is required for EL5 operating systems but is optional on EL6 and newer&lt;br /&gt;
# Fedoras (F13+, at least). It controls how dynamic DNS updating is handled. In&lt;br /&gt;
# our case, we aren&#039;t concerned about DDNS so we&#039;ll set it to &#039;none&#039;.&lt;br /&gt;
ddns-update-style none;&lt;br /&gt;
&lt;br /&gt;
### Subnet options&lt;br /&gt;
subnet 192.168.1.0 netmask 255.255.255.0 {&lt;br /&gt;
	# This is the DHCP server, but not the actual Internet gateway. So this&lt;br /&gt;
	# Argument points our clients to the right box.&lt;br /&gt;
	option routers 192.168.1.254;&lt;br /&gt;
	&lt;br /&gt;
	# Set our range. This can be whatever you want so long as it fits in&lt;br /&gt;
	# your netmask.&lt;br /&gt;
	range 192.168.1.100 192.168.1.220;&lt;br /&gt;
	&lt;br /&gt;
	# If clients don&#039;t ask, make the lease available for the following&lt;br /&gt;
	# number of seconds. If the client does ask, allow up to this number of&lt;br /&gt;
	# seconds. 86,400s = 24h.&lt;br /&gt;
	default-lease-time 86400;&lt;br /&gt;
	max-lease-time 86400;&lt;br /&gt;
&lt;br /&gt;
	# These two options tell clients where to go to get the file needed to&lt;br /&gt;
	# start the boot process.&lt;br /&gt;
	next-server 192.168.1.254;&lt;br /&gt;
	filename &amp;quot;pxelinux.0&amp;quot;;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Restart the DHCP server and you&#039;re done.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/dhcpd restart&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Starting dhcpd:                                            [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== tftp ==&lt;br /&gt;
&lt;br /&gt;
We will use the &#039;trivial FTP&#039; program as it is a PXE-compliant FTP program that can transfers the boot files from the PXE server to the client. It runs as an &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xinetd&amp;lt;/span&amp;gt; package, so we will need to make sure it is installed as well. All told, it lives up to it&#039;s name as it is quite trivial to setup.&lt;br /&gt;
&lt;br /&gt;
First, install them.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install tftp-server xinetd&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then edit &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/xinted.d/tftp&amp;lt;/span&amp;gt; and change &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;disable = yes&amp;lt;/span&amp;gt; to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;disable = no&amp;lt;/span&amp;gt;. The edited file should now look like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/xinetd.d/tftp&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# default: off&lt;br /&gt;
# description: The tftp server serves files using the trivial file transfer \&lt;br /&gt;
#       protocol.  The tftp protocol is often used to boot diskless \&lt;br /&gt;
#       workstations, download configuration files to network-aware printers, \&lt;br /&gt;
#       and to start the installation process for some operating systems.&lt;br /&gt;
service tftp&lt;br /&gt;
{&lt;br /&gt;
        disable                 = no&lt;br /&gt;
        socket_type             = dgram&lt;br /&gt;
        protocol                = udp&lt;br /&gt;
        wait                    = yes&lt;br /&gt;
        user                    = root&lt;br /&gt;
        server                  = /usr/sbin/in.tftpd&lt;br /&gt;
        server_args             = -s /var/lib/tftpboot&lt;br /&gt;
        disable                 = no&lt;br /&gt;
        per_source              = 11&lt;br /&gt;
        cps                     = 100 2&lt;br /&gt;
        flags                   = IPv4&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Being an &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xinetd&amp;lt;/span&amp;gt; service, that is what we need to enable at boot time and then start.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
chkconfig dhcpd on&lt;br /&gt;
chkconfig xinetd on&lt;br /&gt;
/etc/init.d/xinetd restart&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Stopping xinetd:                                           [FAILED]&lt;br /&gt;
Starting xinetd:                                           [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Done!&lt;br /&gt;
&lt;br /&gt;
= pxelinux =&lt;br /&gt;
&lt;br /&gt;
In the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xintd&amp;lt;/span&amp;gt; file for &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;tftp&amp;lt;/span&amp;gt; was this line:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
        server_args             = -s /var/lib/tftpboot&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This determines where the PXE boot files will be setup. Some people like to change this to be &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/tftpboot&amp;lt;/span&amp;gt;, but we&#039;ll keep it there to keep things simple. In Fedora, this directory already exists and should be world-readable. If it isn&#039;t for some reason, create it and set the permissions to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;0755&amp;lt;/span&amp;gt; or &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;0777&amp;lt;/span&amp;gt;, depending on your security requirements.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: On [[EL5]], the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;server_args&amp;lt;/span&amp;gt; value is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;-s /tftpboot&amp;lt;/span&amp;gt;. You can leave this as-is and adapt the rest of the tutorial to this directory if you wish. Otherwise, change this to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/var/lib/tftpboot&amp;lt;/span&amp;gt;. Changing it is recommended as it will facilitate future upgrades or migrations of your configuration.&lt;br /&gt;
&lt;br /&gt;
So now we need to install a package called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;syslinux&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install syslinux&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Setting Up the Boot Environment ==&lt;br /&gt;
&lt;br /&gt;
Next up, we need to copy a couple files into the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;tftpboot&amp;lt;/span&amp;gt; directory. These files are provided by the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;syslinux&amp;lt;/span&amp;gt; package we installed earlier and can be found in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/usr/share/syslinux/&amp;lt;/span&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
The main files are:&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;pxelinux.0&amp;lt;/span&amp;gt;: This is the actual kernel that is passed to the client to begin the boot process. You&#039;ll notice this is the file specified in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;dhcpd.conf&amp;lt;/span&amp;gt; file earlier in our setup. It boots the client far enough so that it can see the boot menu, if any, and then move on to find the main system to boot. This &amp;quot;main system&amp;quot; could be a boot DVD or a full [[OS]].&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vesamenu.c32&amp;lt;/span&amp;gt;: This is the 32-bit [http://syslinux.zytor.com/wiki/index.php/SYSLINUX#COMBOOT_image comboot] file. This enables 32-bit colour images to be used for the boot menu (alpha+rr+gg+bb). This replaces the older 16-colour &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;menu.c32&amp;lt;/span&amp;gt; of earlier version that allow for very basic images.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
rsync -av /usr/share/syslinux/pxelinux.0 /var/lib/tftpboot/&lt;br /&gt;
rsync -av /usr/share/syslinux/vesamenu.c32 /var/lib/tftpboot/&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: On [[EL5]], only &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;pxelinux.0&amp;lt;/span&amp;gt; exists and it is in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/usr/lib/syslinux/&amp;lt;/span&amp;gt;. The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vesamenu.c32&amp;lt;/span&amp;gt; can be copied from an [[EL6]] machine or downloaded from this server.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
rsync -av /usr/lib/syslinux/pxelinux.0 /var/lib/tftpboot/&lt;br /&gt;
wget -c https://alteeve.com/files/pxe/tftpboot/vesamenu.c32 -P /var/lib/tftpboot/&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Client Configuration Files ===&lt;br /&gt;
&lt;br /&gt;
Client configuration files will be placed in a new directory under &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;tftpboot&amp;lt;/span&amp;gt; called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;pxelinux.cfg&amp;lt;/span&amp;gt;. So to start, we need to create it:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
mkdir /var/lib/tftpboot/pxelinux.cfg&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Before we talk about the contents of the configuration files, it is important to understand how the PXE server decides which one to use for a given client.&lt;br /&gt;
&lt;br /&gt;
When a client connects, the PXE server looks at the client&#039;s [[MAC]] address and checks to see if there is a matching hyphen-separated configuration file. If that isn&#039;t found, it then looks at the client&#039;s IP address, as set by the DHCP server. It looks for configuration files matching the [[hexadecimal]] representation of the IP address. For example, If the client was given the IP address &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;192.168.1.200&amp;lt;/span&amp;gt;, the PXE server will start by looking for a configuration file called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;C0A801C8&amp;lt;/span&amp;gt;. If it doesn&#039;t find a matching file, it will then knock-off the right-most nibble and check again. It will do this until all the possible file names are checked.&lt;br /&gt;
&lt;br /&gt;
If the PXE server finds no configuration file matching the MAC address or any variant on the IP address, it falls back to a configuration file called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;default&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Let&#039;s show this series using the example of a client with MAC address &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;00:24:7e:69:6f:0e&amp;lt;/span&amp;gt; and having been assigned the IP address &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;192.168.1.200&amp;lt;/span&amp;gt;. The PXE server will then look for the following configuration file names in the following order:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
/var/lib/tftpboot/pxelinux.cfg/00-24-7E-69-6F-0E&lt;br /&gt;
/var/lib/tftpboot/pxelinux.cfg/C0A801C8&lt;br /&gt;
/var/lib/tftpboot/pxelinux.cfg/C0A801C&lt;br /&gt;
/var/lib/tftpboot/pxelinux.cfg/C0A801&lt;br /&gt;
/var/lib/tftpboot/pxelinux.cfg/C0A80&lt;br /&gt;
/var/lib/tftpboot/pxelinux.cfg/C0A8&lt;br /&gt;
/var/lib/tftpboot/pxelinux.cfg/C0A&lt;br /&gt;
/var/lib/tftpboot/pxelinux.cfg/C0&lt;br /&gt;
/var/lib/tftpboot/pxelinux.cfg/C&lt;br /&gt;
/var/lib/tftpboot/pxelinux.cfg/default&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I&#039;ve made a little script to convert decimal-type IP addresses into hexadecimal-type specifically to help in naming these configuration files. I am sure there are many others out there.&lt;br /&gt;
* [[ip_to_hex]]&lt;br /&gt;
&lt;br /&gt;
=== The Configuration Files ===&lt;br /&gt;
&lt;br /&gt;
All of the possible configuration files can be setup using the same set of options and can be setup in similar ways. There is nothing special about any given configuration file. For this reason, we will cover the contents of the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;default&amp;lt;/span&amp;gt; configuration file only.&lt;br /&gt;
&lt;br /&gt;
Below is the default configuration file we will use. Comments are embedded explaining each option.&lt;br /&gt;
&lt;br /&gt;
* Direct download: &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/var/lib/tftpboot/pxelinux.cfg/[https://alteeve.com/files/pxe/tftpboot/pxelinux.cfg/default default]&amp;lt;/span&amp;gt;&lt;br /&gt;
* Direct download: &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/var/lib/tftpboot/[https://alteeve.com/files/pxe/tftpboot/an-pxe_splash_1024_768.png an-pxe_splash_1024_768.png]&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /var/lib/tftpboot/pxelinux.cfg/default&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;perl&amp;quot;&amp;gt;&lt;br /&gt;
# Use the high-colour menu system. This file, and the low-colour &#039;menu.c32&#039;&lt;br /&gt;
# version, are provided by the syslinux package and can be found in the&lt;br /&gt;
# &#039;/var/lib/tftpboot&#039; directory. Copy it to &#039;/var/lib/tftpboot&#039;.&lt;br /&gt;
UI vesamenu.c32&lt;br /&gt;
&lt;br /&gt;
# Time out and use the default menu option. Defined as tenths of a second.&lt;br /&gt;
TIMEOUT 600&lt;br /&gt;
&lt;br /&gt;
# Prompt the user. Set to &#039;1&#039; to automatically choose the default option. This&lt;br /&gt;
# is really meant for files matched to MAC addresses.&lt;br /&gt;
PROMPT 0&lt;br /&gt;
&lt;br /&gt;
# Set the boot menu to be 1024x768 with a nice background image. Be careful to&lt;br /&gt;
# ensure that all your user&#039;s can see this resolution! Default is 640x480.&lt;br /&gt;
MENU RESOLUTION 1024 768&lt;br /&gt;
# This file must be in or under the &#039;/var/lib/tftpboot&#039; folder.&lt;br /&gt;
MENU BACKGROUND an-pxe_splash_1024_768.png&lt;br /&gt;
&lt;br /&gt;
# These do not need to be set. I set them here to show how you can customize or&lt;br /&gt;
# localize your PXE server&#039;s dialogue.&lt;br /&gt;
MENU TITLE    AN!PXE Boot Server&lt;br /&gt;
# Below, the hash (#) character is replaced with the countdown timer. The&lt;br /&gt;
# &#039;{,s}&#039; allows for pluralizing a word and is used when the value is &amp;gt;= &#039;2&#039;.&lt;br /&gt;
MENU AUTOBOOT Will boot the next device as configured in your BIOS in # second{,s}.&lt;br /&gt;
MENU TABMSG   Press the &amp;lt;tab&amp;gt; key to edit the boot parameters of the highlighted option.&lt;br /&gt;
MENU NOTABMSG Editing of this option is disabled.&lt;br /&gt;
&lt;br /&gt;
# The following options set the various colours used in the menu. All possible&lt;br /&gt;
# options are specified except for F# help options. The colour is expressed as&lt;br /&gt;
# two hex characters between &#039;00&#039; and &#039;ff&#039; for red, green, blue and alpha,&lt;br /&gt;
# respectively (#RRGGBBAA).&lt;br /&gt;
# Format is: MENU COLOR &amp;lt;Item&amp;gt; &amp;lt;ANSI Seq.&amp;gt; &amp;lt;foreground&amp;gt; &amp;lt;background&amp;gt; &amp;lt;shadow type&amp;gt;&lt;br /&gt;
MENU COLOR screen      0  #80ffffff #00000000 std      # background colour not covered by the splash image&lt;br /&gt;
MENU COLOR border      0  #ffffffff #ee000000 std      # The wire-frame border&lt;br /&gt;
MENU COLOR title       0  #ffff3f7f #ee000000 std      # Menu title text&lt;br /&gt;
MENU COLOR sel         0  #ff00dfdf #ee000000 std      # Selected menu option&lt;br /&gt;
MENU COLOR hotsel      0  #ff7f7fff #ee000000 std      # The selected hotkey (set with ^ in MENU LABEL)&lt;br /&gt;
MENU COLOR unsel       0  #ffffffff #ee000000 std      # Unselected menu options&lt;br /&gt;
MENU COLOR hotkey      0  #ff7f7fff #ee000000 std      # Unselected hotkeys (set with ^ in MENU LABEL)&lt;br /&gt;
MENU COLOR tabmsg      0  #c07f7fff #00000000 std      # Tab text&lt;br /&gt;
MENU COLOR timeout_msg 0  #8000dfdf #00000000 std      # Timout text&lt;br /&gt;
MENU COLOR timeout     0  #c0ff3f7f #00000000 std      # Timout counter&lt;br /&gt;
MENU COLOR disabled    0  #807f7f7f #ee000000 std      # Disabled menu options, including SEPARATORs&lt;br /&gt;
MENU COLOR cmdmark     0  #c000ffff #ee000000 std      # Command line marker - The &#039;&amp;gt; &#039; on the left when editing an option&lt;br /&gt;
MENU COLOR cmdline     0  #c0ffffff #ee000000 std      # Command line - The text being edited&lt;br /&gt;
# Options below haven&#039;t been tested, descriptions may be lacking.&lt;br /&gt;
MENU COLOR scrollbar   0  #40000000 #00000000 std      # Scroll bar&lt;br /&gt;
MENU COLOR pwdborder   0  #80ffffff #20ffffff std      # Password box wire-frame border&lt;br /&gt;
MENU COLOR pwdheader   0  #80ff8080 #20ffffff std      # Password box header&lt;br /&gt;
MENU COLOR pwdentry    0  #80ffffff #20ffffff std      # Password entry field&lt;br /&gt;
MENU COLOR help        0  #c0ffffff #00000000 std      # Help text, if set via &#039;TEXT HELP ... ENDTEXT&#039;&lt;br /&gt;
&lt;br /&gt;
### Now define the menu options&lt;br /&gt;
&lt;br /&gt;
# I feel it is safest to return booting to the client as the first and default&lt;br /&gt;
# option. This entry below will do just that.&lt;br /&gt;
LABEL next&lt;br /&gt;
        MENU LABEL ^A)  Boot the next device as configured in your BIOS&lt;br /&gt;
        MENU DEFAULT&lt;br /&gt;
        localboot&lt;br /&gt;
&lt;br /&gt;
## To keep the menu from getting out of hand, I like to create sub-menus.&lt;br /&gt;
## The sub-menus are simply additional files in the same directory as this&lt;br /&gt;
## file with one or more boot options or, if you wish, further sub-menus.&lt;br /&gt;
#&lt;br /&gt;
# This section covers boot options without pre-defined kickstart (or other)&lt;br /&gt;
# automation scripts.&lt;br /&gt;
MENU BEGIN generic&lt;br /&gt;
        MENU TITLE Generic installations (as if booting from media)&lt;br /&gt;
        LABEL Previous&lt;br /&gt;
        MENU LABEL ^B) Previous Menu&lt;br /&gt;
        MENU EXIT&lt;br /&gt;
        MENU SEPARATOR&lt;br /&gt;
        MENU INCLUDE pxelinux.cfg/generic.menu&lt;br /&gt;
MENU END&lt;br /&gt;
&lt;br /&gt;
# As I build a lot of clusters, I like to have a section dedicated to boot&lt;br /&gt;
# options used to build cluster nodes.&lt;br /&gt;
MENU BEGIN cluster&lt;br /&gt;
        MENU TITLE Cluster nodes&lt;br /&gt;
        LABEL Previous&lt;br /&gt;
        MENU LABEL ^C) Previous Menu&lt;br /&gt;
        MENU EXIT&lt;br /&gt;
        MENU SEPARATOR&lt;br /&gt;
        MENU INCLUDE pxelinux.cfg/cluster.menu&lt;br /&gt;
MENU END&lt;br /&gt;
&lt;br /&gt;
# This section is where I put generic automated install scripts. These&lt;br /&gt;
# generally have no specific use and are meant to create installations that&lt;br /&gt;
# can be easily adapted or built upon.&lt;br /&gt;
MENU BEGIN stock&lt;br /&gt;
        MENU TITLE Stock installs (generic kickstart-based installs)&lt;br /&gt;
        LABEL Previous&lt;br /&gt;
        MENU LABEL ^D) Previous Menu&lt;br /&gt;
        MENU EXIT&lt;br /&gt;
        MENU SEPARATOR&lt;br /&gt;
        MENU INCLUDE pxelinux.cfg/stock.menu&lt;br /&gt;
MENU END&lt;br /&gt;
&lt;br /&gt;
# Lastly, I like to make &amp;quot;Live&amp;quot; operating systems available. These are very&lt;br /&gt;
# useful for diagnostics and recovery work where you need more than a &#039;rescue&#039;&lt;br /&gt;
# boot provides and where you do not want to effect the underlying system OS.&lt;br /&gt;
MENU BEGIN live&lt;br /&gt;
        MENU TITLE Live Distros (bootable without affecting the underlying system)&lt;br /&gt;
        LABEL Previous&lt;br /&gt;
        MENU LABEL ^E) Previous Menu&lt;br /&gt;
        MENU EXIT&lt;br /&gt;
        MENU SEPARATOR&lt;br /&gt;
        MENU INCLUDE pxelinux.cfg/live.menu&lt;br /&gt;
MENU END&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;default&amp;lt;span&amp;gt; file above points to four sub-menu files. How many you use, if you use any at all, is up to you. You can also use any file name you want, or any directory under &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/var/lib/tftpboot/&amp;lt;span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
To save space on this page, The sub-menu files mentioned above are their own pages and are linked below. These will hopefully act as useful references for your own sub-menu files, should you wish to use menus.&lt;br /&gt;
&lt;br /&gt;
* [[pxe_generic.menu|generic.menu]]&lt;br /&gt;
* [[pxe_cluster.menu|cluster.menu]]&lt;br /&gt;
* [[pxe_stock.menu|stock.menu]]&lt;br /&gt;
* [[pxe_live.menu|live.menu]]&lt;br /&gt;
&lt;br /&gt;
=== Options ===&lt;br /&gt;
&lt;br /&gt;
Let&#039;s now take a look at the various parts. This is an overview only, for a complete list of options please read &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/usr/share/doc/syslinux-3.84/menu.txt&amp;lt;/span&amp;gt;. Update the version number to match your installed version.&lt;br /&gt;
&lt;br /&gt;
Wherever a colour can be specified, the format is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;#AARRGGBB&amp;lt;/span&amp;gt;. That is, alpha (transparency), red, green and blue intensity expressed as a 256 range specified using two [[hexadecimal]] characters per option. &lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;UI vesamenu.c32&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This loads the 32-bit colour [http://syslinux.zytor.com/wiki/index.php/SYSLINUX#COMBOOT_image COMBOOT] image. This allows for the full colour range plus 8-bit alpha (transparency) to be available at boot time. It&#039;s what allows for a much more attractive boot menu. To read details on the innards of the COMBOOT format, read &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/usr/share/doc/syslinux-3.84/comboot.txt&amp;lt;/span&amp;gt;. Update the version number to match your installed version.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;TIMEOUT 600&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is the amount of time, in tenths of a second, that the PXE loader will wait before performing the default action. If the user navigates through the menu. the timer will stop and wait for the user to make a selection. To prevent an install from running accidentally, the default option should always be a non-damaging option.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;prompt 0&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This tells the PXE server to prompt the user to make a choice. If this is set to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt; then the PXE server will use the default option.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;MENU RESOLUTION 1024 768&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This tells the boot loader to run at the set resolution, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;1024x768&amp;lt;/span&amp;gt; in this example. The default is to run up as &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vga (640x480)&amp;lt;/span&amp;gt;. Be sure when pushing a higher resolution that all of your potential users have machines that support the given resolution.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;MENU BACKGROUND an-pxe_splash_1024_768.png&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is the background image to use. This must exist in or under the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/var/lib/tftpboot/&amp;lt;/span&amp;gt; directory. If you want to use a subdirectory, specify it as a relative path. For example, if you want to store images in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/var/lib/tftpboot/images/&amp;lt;/span&amp;gt;, then this would be set to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;images/an-pxe_splash_1024_768.png&amp;lt;/span&amp;gt;. The format of the image can be &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;JPEG&amp;lt;/span&amp;gt; or The format of the image can be &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;JPNG&amp;lt;/span&amp;gt; (other image formats may work). The image itself should match the size of the screen.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;MENU TITLE    AN!PXE Boot Server&amp;lt;/span&amp;gt;&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;MENU AUTOBOOT Will boot the next device as configured in your BIOS in # second{,s}.&amp;lt;/span&amp;gt;&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;MENU TABMSG   Press the &amp;lt;tab&amp;gt; key to edit the boot parameters of the highlighted option.&amp;lt;/span&amp;gt;&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;MENU NOTABMSG Editing of this option is disabled.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These options allow you to customize or localize the text. None need to be specified.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;AUTOBOOT&amp;lt;/span&amp;gt; option is a little special to accommodate the count-down. The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;#&amp;lt;/span&amp;gt; will be replaced by the time remaining. The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;{,s}&amp;lt;/span&amp;gt; tells the string to add an &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;s&amp;lt;/span&amp;gt; to the end of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;seconds&amp;lt;/span&amp;gt; when the time remaining is greater than one.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;MENU COLOR x&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These options control the colour and transparency of the various text-elements, borders and backgrounds. None of them need to be specified and all have sane default values. Most of the available options are shown in the example above.&lt;br /&gt;
&lt;br /&gt;
Each entry is formatted like so:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;MENU COLOR &amp;lt;type&amp;gt; &amp;lt;ansi&amp;gt; &amp;lt;foreground&amp;gt; &amp;lt;background&amp;gt; &amp;lt;shadow&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;type&amp;gt;&amp;lt;/span&amp;gt; is the name of the element you are manipulating. The only &#039;type&#039; not show in the example above is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;msgXX&amp;lt;/span&amp;gt; where &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;XX&amp;lt;/span&amp;gt; is a number between &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;12&amp;lt;/span&amp;gt;. These are used to control &amp;quot;help windows&amp;quot; that can be shown to the user when they press an &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;F[1-12]&amp;lt;/span&amp;gt; key.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;ansi&amp;gt;&amp;lt;/span&amp;gt; number(s) tell the boot loader how to format the text using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[ANSI]]&amp;lt;/span&amp;gt; code. This is set to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;0&amp;lt;/span&amp;gt;, &amp;quot;reset&amp;quot;, in our example to clear any &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ANSI&amp;lt;/span&amp;gt; formatting. You can specify multiple &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ANSI&amp;lt;/span&amp;gt; codes by separating them with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;;&amp;lt;/span&amp;gt; (semi-colons).&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;foreground&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;background&amp;gt;&amp;lt;/span&amp;gt; values are the [[hexadecimal]] notation for the transparency and colour in the format &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;#AARRGGBB&amp;lt;/span&amp;gt; as mentioned earlier.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;shadow&amp;gt;&amp;lt;/span&amp;gt; is the type of drop-shadow to render for the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;type&amp;gt;&amp;lt;/span&amp;gt;. Valid options are:&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;none&amp;lt;/span&amp;gt;: No shadowing.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;std&amp;lt;/span&amp;gt;, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;standard&amp;lt;/span&amp;gt;: Foreground pixels are raised.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;all&amp;lt;/span&amp;gt;: both foreground and background pixels are raised.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rev&amp;lt;/span&amp;gt;, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;reverse&amp;lt;/span&amp;gt;: Background pixels are raised.&lt;br /&gt;
&lt;br /&gt;
=== Labels ===&lt;br /&gt;
&lt;br /&gt;
Label blocks are the actual boot options made available within the PXE menu. There are many options available here that are not shown in this example. If you are curious, please read &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/usr/share/doc/syslinux-3.84/menu.txt&amp;lt;/span&amp;gt; which was installed on your system when you installed &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;syslinux&amp;lt;/span&amp;gt;. Of course, replace &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;3.84&amp;lt;/span&amp;gt; with the version you have installed.&lt;br /&gt;
&lt;br /&gt;
First example;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
LABEL next&lt;br /&gt;
	MENU LABEL ^A)  Boot the next device as configured in your BIOS&lt;br /&gt;
	MENU DEFAULT&lt;br /&gt;
	localboot&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This example is a good one to always use as the first, and default, option. &lt;br /&gt;
&lt;br /&gt;
The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;LABEL next&amp;lt;/span&amp;gt; defines this option group. The name &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;next&amp;lt;/span&amp;gt; has no special meaning, but can be used for more complex setups later. For now, just be sure to keep this name simple with no spaces.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;MENU LABEL ...&amp;lt;/span&amp;gt; option control two things. First, it&#039;s the text shown to the user. Second, the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;^A&amp;lt;/span&amp;gt; sets the keyboard key that the user can press to select the option. Whatever character comes immediately after the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;/span&amp;gt; (caret), &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;A&amp;lt;/span&amp;gt; in this example, becomes the mapped key. Please note that the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;^&amp;lt;/span&amp;gt; can come anywhere in the title text. Ensure that no two entries have the same character mapped!&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;MENU DEFAULT&amp;lt;/span&amp;gt; command tells the boot loader to automatically boot this option if the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;TIMEOUT&amp;lt;/span&amp;gt; expires. Only one entry may have this option.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;localboot&amp;lt;/span&amp;gt; is a special command the skips the PXE boot loader. Your BIOS should proceed to boot the next device in it&#039;s boot order list. Generally this will boot the local hard drive.&lt;br /&gt;
&lt;br /&gt;
Another example, from the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cluster.menu&amp;lt;/span&amp;gt; file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
LABEL f14_an-node01&lt;br /&gt;
        MENU LABEL ^1) Install AN!Node01; Storage Node 01&lt;br /&gt;
        KERNEL boot/f14/x86_64/vmlinuz&lt;br /&gt;
        APPEND initrd=boot/f14/x86_64/initrd.img ks=http://192.168.1.254/f14/x86_64/ks/an-node01.ks ksdevice=eth0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is a pretty typical entry. The two new options to note are:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;KERNEL ...&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is the path to the boot kernel used to start the OS or it&#039;s installer. Most distributions make use of a small kernel to run up their installer or Live CD/DVD environment. The PXE server will search for the kernel relative to the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;tftpboot&amp;lt;/span&amp;gt; directory. Where to get the proper boot kernel will depend on the distribution you are setting up. &lt;br /&gt;
&lt;br /&gt;
Some examples will be [[#Setting Up The Boot Environment|shown below]].&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;APPEND ...&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This argument allows you to pass arguments to the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;KERNEL&amp;lt;/span&amp;gt; specified above. Which options can be passed will, again, depend on the distribution you are setting up. In this example, an &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;initrd&amp;lt;/span&amp;gt; image is specified, a kickstart script is set and the network device to use to search for the kickstart script are defined.&lt;br /&gt;
&lt;br /&gt;
The [[Setting_Up_a_PXE_Server_in_Fedora#Making_The_Install_Files_For_An_OS_Available|Apache configuration]] section below covers in more detail how to make the kickstart and OS installation files available.&lt;br /&gt;
&lt;br /&gt;
=== Menus ===&lt;br /&gt;
&lt;br /&gt;
Menus are very useful when you have more than a few entries in your PXE server. They allow for creating groups of bootable options based on whatever given criteria works for you.&lt;br /&gt;
&lt;br /&gt;
Let&#039;s look at the &amp;quot;cluster&amp;quot; menu from above.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
MENU BEGIN cluster&lt;br /&gt;
        MENU TITLE Cluster nodes&lt;br /&gt;
        LABEL Previous&lt;br /&gt;
        MENU LABEL ^C) Previous Menu&lt;br /&gt;
        MENU EXIT&lt;br /&gt;
        MENU SEPARATOR&lt;br /&gt;
        MENU INCLUDE pxelinux.cfg/cluster.menu&lt;br /&gt;
MENU END&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;MENU BEGIN ...&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This begins the section and is followed by a name that should (must?) be unique.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;MENU TITLE ...&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is the text shown at the top of the sub-menu once selected.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;LABEL ...&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is the text shown as the first option in the sub-menu that returns to the previous screen.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;MENU LABEL ...&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is the text that the user selects to descend into the sub-menu.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: I use the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;^&amp;lt;/span&amp;gt; character to enable a letter to select the menu option but it doesn&#039;t seem to work. Please let me know if you have further information on how, or if, sub-menu options are selected with a key press.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;MENU EXIT ...&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I am not sure, exactly, what this option does.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;MENU SEPARATOR ...&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I am not sure, exactly, what this option does.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;MENU INCLUDE ...&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is the path and file to include when building this sub-menu. The path is relative to the tftpboot &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;server_args&amp;lt;/span&amp;gt; directory, as set in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/xinetd.d/tftp&amp;lt;/span&amp;gt; file.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;MENU END&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This closes the sub-menu section. &lt;br /&gt;
&lt;br /&gt;
There are other options, though none seem to be well documented at the moment. I got this far thanks to [https://help.ubuntu.com/community/PXEInstallMultiDistro this page]. Any additional information on these and other options would be welcome!&lt;br /&gt;
&lt;br /&gt;
= Setting Up Apache =&lt;br /&gt;
&lt;br /&gt;
[[Image:f13_httpd_default_page_01.png|thumb|right|400px|Default Apache2.2 web page on Fedora 13]]&lt;br /&gt;
&lt;br /&gt;
We will use the Apache web server to make our operating system images available. First, install the server.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install httpd&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The default install of Apache2 will work fine for us, so we won&#039;t adjust it. Let&#039;s start it now.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/httpd start&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Test access by loading [http://localhost http://localhost] from the PXE server. If that works, then try connecting to the PXE server from another computer using it&#039;s [[IP]] address. In either case, you should see a page like the one to the right.&lt;br /&gt;
&lt;br /&gt;
== Setting Up The DocumentRoot ==&lt;br /&gt;
&lt;br /&gt;
Apache has a variable called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;DocumentRoot&amp;lt;/span&amp;gt; in it&#039;s main configuration file &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/httpd/conf/httpd.conf&amp;lt;/span&amp;gt;. Anything in or under the directory specified in this variable will be exposed on your web server. The default directory is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/var/www/html&amp;lt;/span&amp;gt; and this will be where we put our various kickstart files, ISO files and under which we will mount those ISO files.&lt;br /&gt;
&lt;br /&gt;
== The Default Page ==&lt;br /&gt;
&lt;br /&gt;
There is no need to create an &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;index.html&amp;lt;/span&amp;gt; page, as the image kickstart scripts and image files will be called directly. Personally though, I like to put together a simple page listing the various installations I&#039;ve made available on the PXE server. If nothing else, it helps identify the machine when you call it in a browser.&lt;br /&gt;
&lt;br /&gt;
If you decide to create one, please use whatever website tool, text editor or [[Integrated Development Environment|IDE]] you prefer. For reference, below are the very simple, probably not [[W3C]] compliant static [[HTML]] page I use along with a trivial [[CSS]] file.&lt;br /&gt;
&lt;br /&gt;
* [[PXE Server index.html]]&lt;br /&gt;
* [[PXE Server common.css]]&lt;br /&gt;
&lt;br /&gt;
Put the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;index.html&amp;lt;/span&amp;gt; (and associated files) directly in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;DocumentRoot&amp;lt;/span&amp;gt; directory. By default, Apache2 will look for a file named &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;index.html&amp;lt;/span&amp;gt; and load it if it is found.&lt;br /&gt;
&lt;br /&gt;
== Making The Install Files For An OS Available ==&lt;br /&gt;
&lt;br /&gt;
At the end of the day, the only thing that matters here is that all of the installation files and kickstart scripts are &#039;&#039;somewhere&#039;&#039; under the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;DocumentRoot&amp;lt;/span&amp;gt; directory. I will describe here the layout that I like, but feel free to adjust it however you see fit. &lt;br /&gt;
&lt;br /&gt;
Further, different operating systems will need to be configured differently. For the purpose of this tutorial, I will be showing how RPM-based [[Linux]] distributions are configured. If you are using different operating systems, you should be able to build on the steps below.&lt;br /&gt;
&lt;br /&gt;
=== Planning Your Directory Structure ===&lt;br /&gt;
&lt;br /&gt;
Under the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;DocumentRoot&amp;lt;/span&amp;gt; directory, we will need to create a set of directories to store the operating system files and associated kickstart scripts in. I&#039;ve found the following structure works well.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;DocumentRoot&amp;gt;/&amp;lt;os_name&amp;gt;/&amp;lt;architecture&amp;gt;/[ks|iso|img]&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Using Fedora 14 [[x86_64]] with the default Apache &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;DocumentRoot&amp;lt;/span&amp;gt; as an example, you would create the following directories. Note that I like to shorten Operating System names to the shortest version practical to save typing. Feel free to use the full names if you prefer verbose [[URL]]s.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/var/www/html/f14/x86_64/ks&amp;lt;/span&amp;gt;: Kickstart scripts go here&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/var/www/html/f14/x86_64/iso&amp;lt;/span&amp;gt;: The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[http://download.fedoraproject.org/pub/fedora/linux/releases/14/Fedora/x86_64/iso/Fedora-14-x86_64-DVD.iso Fedora-14-x86_64-DVD.iso]&amp;lt;/span&amp;gt; file is saved here&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/var/www/html/f14/x86_64/img&amp;lt;/span&amp;gt;: The [[ISO]] file above is mounted here.&lt;br /&gt;
&lt;br /&gt;
If you wanted to also make the [[i386]] version of Fedora available, simply replace &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;x86_64&amp;lt;/span&amp;gt; with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;i386&amp;lt;/span&amp;gt; above. If you want to also make the live version for Fedora 14 x86_64 available, replace &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;f13&amp;lt;/span&amp;gt; with something like &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;f13_live&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Fedora 14 x86_64 ===&lt;br /&gt;
&lt;br /&gt;
Let&#039;s walk through the actual steps needed to make Fedora 14 x86_64 available on Apache now.&lt;br /&gt;
&lt;br /&gt;
First, create the directory structure.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
mkdir -p /var/www/html/f14/x86_64/{iso,img,ks}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now, download the ISO if you have not yet done so. If you have, move it into place.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cd /var/www/html/f14/x86_64/iso&lt;br /&gt;
wget -c http://download.fedoraproject.org/pub/fedora/linux/releases/14/Fedora/x86_64/iso/Fedora-14-x86_64-DVD.iso&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we mount the ISO using a loopback device.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
mount -o loop /var/www/html/f14/x86_64/iso/Fedora-14-x86_64-DVD.iso /var/www/html/f14/x86_64/img&lt;br /&gt;
df -h&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Filesystem            Size  Used Avail Use% Mounted on&lt;br /&gt;
/dev/sda3              69G  7.1G   59G  11% /&lt;br /&gt;
tmpfs                 497M   88K  497M   1% /dev/shm&lt;br /&gt;
/dev/sda1             485M   62M  398M  14% /boot&lt;br /&gt;
/dev/sdb1             1.4T  678G  629G  52% /media/disk&lt;br /&gt;
/var/www/html/f14/x86_64/iso/Fedora-14-x86_64-DVD.iso&lt;br /&gt;
                      3.3G  3.3G     0 100% /var/www/html/f14/x86_64/img&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Lastly, copy any kickstart scripts into the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/var/www/html/f14/x86_64/ks/&amp;lt;/span&amp;gt; directory. These scripts will be called by the user after they select an automated install option from the PXE menu.&lt;br /&gt;
&lt;br /&gt;
Here is a generic Fedora 14 x86_64 kickstart I use as a server that you can adapt if you would like. It creates a quite stripped down install.&lt;br /&gt;
* [[kickstart_f14_generic_server.ks]]&lt;br /&gt;
&lt;br /&gt;
That&#039;s it! You can now use make Fedora 14 available as a PXE boot option in your menu.&lt;br /&gt;
&lt;br /&gt;
== Mounting And Unmounting Many ISOs ==&lt;br /&gt;
&lt;br /&gt;
If you make any real use of your PXE server, you will probably find that you will have a lot of ISO files to mount and unmount. To simplify this task, I like to create a couple of bash scripts called, simply, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;mount_iso.sh&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;umount_iso.sh&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
These are simple shell scripts meant to mount and unmount all ISOs with one command. You need to be sure that you keep them up to date as you add and remove operating systems.&lt;br /&gt;
&lt;br /&gt;
You will certainly want to adjust these to suit your setup. With that said, here are my scripts that you can use as templates.&lt;br /&gt;
&lt;br /&gt;
* Direct download: [https://alteeve.com/files/pxe/mount_iso.sh mount_iso.sh]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
# This is used to mount the various ISO used by the PXE server on this server.&lt;br /&gt;
&lt;br /&gt;
echo -n &amp;quot;Mounting Fedora 14, x86_64... &amp;quot;&lt;br /&gt;
mount -o loop /var/www/html/f14/x86_64/iso/Fedora-14-x86_64-DVD.iso /var/www/html/f14/x86_64/img&lt;br /&gt;
echo &amp;quot;Done!&amp;quot;&lt;br /&gt;
&lt;br /&gt;
echo -n &amp;quot;Mounting Fedora 14, i386... &amp;quot;&lt;br /&gt;
mount -o loop /var/www/html/f14/i386/iso/Fedora-14-i386-DVD.iso /var/www/html/f14/i386/img/&lt;br /&gt;
echo &amp;quot;Done!&amp;quot;&lt;br /&gt;
&lt;br /&gt;
echo -n &amp;quot;Mounting Fedora 14 Live DVD, x86_64... &amp;quot;&lt;br /&gt;
mount -o loop /var/www/html/f14_live/x86_64/iso/Fedora-14-x86_64-Live-Desktop.iso /var/www/html/f14_live/x86_64/img/&lt;br /&gt;
echo &amp;quot;Done!&amp;quot;&lt;br /&gt;
&lt;br /&gt;
echo -n &amp;quot;Mounting Fedora 14 Live DVD, i686... &amp;quot;&lt;br /&gt;
mount -o loop /var/www/html/f14_live/i686/iso/Fedora-14-i686-Live-Desktop.iso /var/www/html/f14_live/i686/img/&lt;br /&gt;
echo &amp;quot;Done!&amp;quot;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Direct download: [https://alteeve.com/files/pxe/umount_iso.sh umount_iso.sh]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
# This is used to unmount the various ISO used by the PXE server on this server.&lt;br /&gt;
&lt;br /&gt;
echo -n &amp;quot;Unmounting Fedora 14, x86_64... &amp;quot;&lt;br /&gt;
umount /var/www/html/f14/x86_64/img&lt;br /&gt;
echo &amp;quot;Done!&amp;quot;&lt;br /&gt;
&lt;br /&gt;
echo -n &amp;quot;Unmounting Fedora 14, i386... &amp;quot;&lt;br /&gt;
umount /var/www/html/f14/i386/img/&lt;br /&gt;
echo &amp;quot;Done!&amp;quot;&lt;br /&gt;
&lt;br /&gt;
echo -n &amp;quot;Unmounting Fedora 14 Live DVD, x86_64... &amp;quot;&lt;br /&gt;
umount /var/www/html/f14_live/x86_64/img/&lt;br /&gt;
echo &amp;quot;Done!&amp;quot;&lt;br /&gt;
&lt;br /&gt;
echo -n &amp;quot;Unmounting Fedora 14 Live DVD, i686... &amp;quot;&lt;br /&gt;
umount /var/www/html/f14_live/i686/img/&lt;br /&gt;
echo &amp;quot;Done!&amp;quot;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Increasing Maximum number of Mountable ISOs ===&lt;br /&gt;
&lt;br /&gt;
By default the loop driver only creates 8 loop back devices. Each mounted ISO takes one of those and there for limits the total number of ISOs that can be mounted at any one time.&lt;br /&gt;
&lt;br /&gt;
There exist two places to change the maximum number of loop back devices.&lt;br /&gt;
The recommend method is to add max_loop option to a new config file in /etc/modprobe.d/.&lt;br /&gt;
&lt;br /&gt;
/etc/modprobe.d/loop.conf&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
options loop max_loop=64&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The second options is to add &amp;quot;max_loop=64&amp;quot; to the kernel boot line.&lt;br /&gt;
&lt;br /&gt;
Adjust the number after max_loop= to suit your installations needs.&lt;br /&gt;
&lt;br /&gt;
= Setting Up The Boot Environment =&lt;br /&gt;
&lt;br /&gt;
All boot options, except &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;localboot&amp;lt;/span&amp;gt;, need to have a kernel made available via the PXE server. Specifically, these kernels must exist somewhere under the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/var/lib/tftpboot&amp;lt;/span&amp;gt; directory. What kernel or boot image a given operating system will need depends entirely on that operating system. For this section, we will continue to use Fedora 14 x86_64 as an example.&lt;br /&gt;
&lt;br /&gt;
== Planning Your Directory Structure, Take Two ==&lt;br /&gt;
&lt;br /&gt;
As with [[#Planning Your Directory Structure|Apache]], we&#039;re potentially going to copy a lot of boot images and other files. It makes sense to have an organized directory structure to put them all in. As before, I will share what I do, but please feel free to do what you find works best for you. &lt;br /&gt;
&lt;br /&gt;
I like to create a dedicated directory called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;boot&amp;lt;/span&amp;gt; and then mimic the layout from Apache, minus the last set of three directories.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;tftpboot&amp;gt;/boot/&amp;lt;os_name&amp;gt;/&amp;lt;architecture&amp;gt;/&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using Fedora 14 x86_64 with the default tftpboot install, I will create the following directory.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
mkdir -p /var/lib/tftpboot/boot/f14/x86_64&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== The Bootable Kernel ==&lt;br /&gt;
&lt;br /&gt;
Remember in the earlier &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;LABEL f14_an-node01&amp;lt;/span&amp;gt; example there was the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;APPEND initrd=boot/f14/x86_64/initrd.img ...&amp;lt;/span&amp;gt; line? The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;boot/f14/x86_64/initrd.img&amp;lt;/span&amp;gt; is the kernel, in the directory we just created!&lt;br /&gt;
&lt;br /&gt;
The last piece of the puzzle then is; Where does the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;initrd.img&amp;lt;/span&amp;gt; file come from?&lt;br /&gt;
&lt;br /&gt;
With most Linux distributions, there is an &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;isolinux&amp;lt;/span&amp;gt; directory in the root of the installation DVD. The files needed to boot the DVD&#039;s installer (or &amp;quot;rescue mode&amp;quot;) are in this directory. These are the same files we need to boot over PXE. If you have followed this tutorial up to this point, then you should be able to see the contents of this directory in your file browser. My PXE server uses the IP address &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;192.168.1.254&amp;lt;/span&amp;gt;, so I can go to &lt;br /&gt;
&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;http://192.168.1.254/f14/x86_64/img/isolinux&amp;lt;/span&amp;gt; and see, among other files, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;initrd.img&amp;lt;/span&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
With the directory created and the ISO mounted, all that is left is to copy the contents of the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;isolinux&amp;lt;/span&amp;gt; files.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp -v /var/www/html/f14/x86_64/img/isolinux/* /var/lib/tftpboot/boot/f14/x86_64/&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
`/var/www/html/f14/x86_64/img/isolinux/boot.cat&#039; -&amp;gt; `/var/lib/tftpboot/boot/f14/x86_64/boot.cat&#039;&lt;br /&gt;
`/var/www/html/f14/x86_64/img/isolinux/boot.msg&#039; -&amp;gt; `/var/lib/tftpboot/boot/f14/x86_64/boot.msg&#039;&lt;br /&gt;
`/var/www/html/f14/x86_64/img/isolinux/grub.conf&#039; -&amp;gt; `/var/lib/tftpboot/boot/f14/x86_64/grub.conf&#039;&lt;br /&gt;
`/var/www/html/f14/x86_64/img/isolinux/initrd.img&#039; -&amp;gt; `/var/lib/tftpboot/boot/f14/x86_64/initrd.img&#039;&lt;br /&gt;
`/var/www/html/f14/x86_64/img/isolinux/isolinux.bin&#039; -&amp;gt; `/var/lib/tftpboot/boot/f14/x86_64/isolinux.bin&#039;&lt;br /&gt;
`/var/www/html/f14/x86_64/img/isolinux/isolinux.cfg&#039; -&amp;gt; `/var/lib/tftpboot/boot/f14/x86_64/isolinux.cfg&#039;&lt;br /&gt;
`/var/www/html/f14/x86_64/img/isolinux/memtest&#039; -&amp;gt; `/var/lib/tftpboot/boot/f14/x86_64/memtest&#039;&lt;br /&gt;
`/var/www/html/f14/x86_64/img/isolinux/splash.jpg&#039; -&amp;gt; `/var/lib/tftpboot/boot/f14/x86_64/splash.jpg&#039;&lt;br /&gt;
`/var/www/html/f14/x86_64/img/isolinux/splash.lss&#039; -&amp;gt; `/var/lib/tftpboot/boot/f14/x86_64/splash.lss&#039;&lt;br /&gt;
`/var/www/html/f14/x86_64/img/isolinux/syslinux-vesa-splash.jpg&#039; -&amp;gt; `/var/lib/tftpboot/boot/f14/x86_64/syslinux-vesa-splash.jpg&#039;&lt;br /&gt;
`/var/www/html/f14/x86_64/img/isolinux/TRANS.TBL&#039; -&amp;gt; `/var/lib/tftpboot/boot/f14/x86_64/TRANS.TBL&#039;&lt;br /&gt;
`/var/www/html/f14/x86_64/img/isolinux/vesamenu.c32&#039; -&amp;gt; `/var/lib/tftpboot/boot/f14/x86_64/vesamenu.c32&#039;&lt;br /&gt;
`/var/www/html/f14/x86_64/img/isolinux/vmlinuz&#039; -&amp;gt; `/var/lib/tftpboot/boot/f14/x86_64/vmlinuz&#039;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And we&#039;re done! &lt;br /&gt;
&lt;br /&gt;
Now repeat the relevant steps for the rest of the operating systems you want to support via PXE.&lt;br /&gt;
&lt;br /&gt;
= Credits =&lt;br /&gt;
&lt;br /&gt;
References used:&lt;br /&gt;
* [http://linux-sxs.org/internet_serving/pxeboot.html Linux-SXS]&lt;br /&gt;
* [https://help.ubuntu.com/community/PXEInstallMultiDistro Ubuntu]&lt;br /&gt;
* [http://www.c3.hu/docs/oreilly/tcpip/tcpip/appd_03.htm O&#039;Reilly]&lt;br /&gt;
* [http://www.linuxdoc.org/HOWTO/CDServer-HOWTO/addloops.html linuxdoc.org]&lt;br /&gt;
&lt;br /&gt;
{{footer}}&lt;/div&gt;</summary>
		<author><name>SRSullivan</name></author>
	</entry>
	<entry>
		<id>https://alteeve.com/w/index.php?title=Changing_the_ethX_to_Ethernet_Device_Mapping_in_EL5&amp;diff=2833</id>
		<title>Changing the ethX to Ethernet Device Mapping in EL5</title>
		<link rel="alternate" type="text/html" href="https://alteeve.com/w/index.php?title=Changing_the_ethX_to_Ethernet_Device_Mapping_in_EL5&amp;diff=2833"/>
		<updated>2011-02-28T17:38:33Z</updated>

		<summary type="html">&lt;p&gt;SRSullivan: /* The Problem */  Added note about using ethtool to ID/test ethX to Port mappings.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{howto_header}}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: This is for [[EL]]5 (CentOS 5.5, specifically). It also makes reference to [[Xen]], which you can ignore if you wish.&lt;br /&gt;
&lt;br /&gt;
When you have two or more ethernet devices in one machine, the Red Hat/CentOS install may not install them in the order you want. This document will show you how to change the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ethX&amp;lt;/span&amp;gt; to ethernet device mapping.&lt;br /&gt;
&lt;br /&gt;
= Example =&lt;br /&gt;
&lt;br /&gt;
I find it easier to follow instructions when I have an example to follow, so let me provide one here:&lt;br /&gt;
&lt;br /&gt;
== Desired Mapping ==&lt;br /&gt;
&lt;br /&gt;
Let&#039;s assume that you want this:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth0&amp;lt;/span&amp;gt;&lt;br /&gt;
** MAC: &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;00:aa:bb:cc:dd:ee&amp;lt;/span&amp;gt;&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth1&amp;lt;/span&amp;gt;&lt;br /&gt;
** MAC: &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;00:11:22:33:44:55&amp;lt;/span&amp;gt;&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth2&amp;lt;/span&amp;gt;&lt;br /&gt;
** MAC: &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;00:ff:ee:dd:88:99&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Initial Mapping ==&lt;br /&gt;
&lt;br /&gt;
Now lets assume you got this:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth0&amp;lt;/span&amp;gt;&lt;br /&gt;
** MAC: &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;00:ff:ee:dd:88:99&amp;lt;/span&amp;gt;&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth1&amp;lt;/span&amp;gt;&lt;br /&gt;
** MAC: &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;00:11:22:33:44:55&amp;lt;/span&amp;gt;&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth2&amp;lt;/span&amp;gt;&lt;br /&gt;
** MAC: &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;00:aa:bb:cc:dd:ee&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== The Problem ==&lt;br /&gt;
&lt;br /&gt;
In the above example, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth1&amp;lt;/span&amp;gt; is where we want it, so we leave it alone. The problem is that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth0&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth2&amp;lt;/span&amp;gt; are reversed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If your not sure which ethX is currently mapped to which physical port, using  &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ethtool -p ethX&amp;lt;/span&amp;gt; will make the light on the port blink. &#039;&#039;&#039;Note:&#039;&#039;&#039; This works for most, but not all hardware.&lt;br /&gt;
&lt;br /&gt;
== The Fix ==&lt;br /&gt;
&lt;br /&gt;
First, stop &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xend&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;network&amp;lt;/span&amp;gt;. This is important because if you change the MAC address to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ethX&amp;lt;/span&amp;gt; mapping while the network is still up, the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;initd&amp;lt;/span&amp;gt; script will fail to bring down the network devices. The reason for stopping &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xend&amp;lt;/span&amp;gt; is because it is also integral to networking.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/xend stop&lt;br /&gt;
/etc/init.d/network stop&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now go to the directory that contains the network configuration files and then use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cat&amp;lt;/span&amp;gt; to see the contents of the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ifcfg-ethX&amp;lt;/span&amp;gt; network configuration files:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cd /etc/sysconfig/network-scripts/&lt;br /&gt;
cat ifcfg-eth0&lt;br /&gt;
cat ifcfg-eth1&lt;br /&gt;
cat ifcfg-eth2&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will produce output something like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
root@an_san01:/etc/sysconfig/network-scripts# cat ifcfg-eth0&lt;br /&gt;
# Intel Corporation 82540EM Gigabit Ethernet Controller&lt;br /&gt;
DEVICE=eth0&lt;br /&gt;
BOOTPROTO=dhcp&lt;br /&gt;
ONBOOT=yes&lt;br /&gt;
HWADDR=00:AA:BB:CC:DD:EE&lt;br /&gt;
&lt;br /&gt;
root@an_san01:/etc/sysconfig/network-scripts# cat ifcfg-eth1&lt;br /&gt;
# Realtek Semiconductor Co., Ltd. RTL8111/8168B PCI Express Gigabit Ethernet controller&lt;br /&gt;
DEVICE=eth1&lt;br /&gt;
BOOTPROTO=dhcp&lt;br /&gt;
ONBOOT=yes&lt;br /&gt;
HWADDR=00:11:22:33:44:55&lt;br /&gt;
&lt;br /&gt;
root@an_san01:/etc/sysconfig/network-scripts# cat ifcfg-eth2&lt;br /&gt;
# D-Link System Inc DGE-560T PCI Express Gigabit Ethernet Adapter&lt;br /&gt;
DEVICE=eth2&lt;br /&gt;
BOOTPROTO=dhcp&lt;br /&gt;
ONBOOT=yes&lt;br /&gt;
HWADDR=00:FF:EE:DD:88:99&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The important lines are the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;HWADDR=...&amp;lt;/span&amp;gt; lines. Don&#039;t worry if the rest of the contents differ at this point. The above examples are intentionally generic and minimalist. For now, we are going to ignore them.&lt;br /&gt;
&lt;br /&gt;
With networking stopped, all we need to do is change the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;HWADDR=...&amp;lt;/span&amp;gt; lines in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ifcfg-eth0&amp;lt;/span&amp;gt; to have the MAC address from &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ifcfg-eth2&amp;lt;/span&amp;gt; and vice-versa.&lt;br /&gt;
&lt;br /&gt;
So then, edit &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ifcfg-eth0&amp;lt;/span&amp;gt; to look like this:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim ifcfg-eth0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
# D-Link System Inc DGE-560T PCI Express Gigabit Ethernet Adapter&lt;br /&gt;
DEVICE=eth0&lt;br /&gt;
BOOTPROTO=dhcp&lt;br /&gt;
ONBOOT=yes&lt;br /&gt;
HWADDR=00:FF:EE:DD:88:99&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And then edit &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ifcfg-eth2&amp;lt;/span&amp;gt; to look like this:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim ifcfg-eth2&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
# Intel Corporation 82540EM Gigabit Ethernet Controller&lt;br /&gt;
DEVICE=eth2&lt;br /&gt;
BOOTPROTO=dhcp&lt;br /&gt;
ONBOOT=yes&lt;br /&gt;
HWADDR=00:AA:BB:CC:DD:EE&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that I changed the comment at the top of the file to reflect the hardware description of the ethernet device. This is set by the installer and I like to keep it accurate. If you wish, you can simply delete it as it has no effect on the function of the network device.&lt;br /&gt;
&lt;br /&gt;
Once the changes are complete, simply restart networking and xend:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/xend start&lt;br /&gt;
/etc/init.d/network start&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You should be able to see that it is working by typing &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ifconfig&amp;lt;/span&amp;gt; and seeing something like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ifconfig&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
eth0      Link encap:Ethernet  HWaddr 00:FF:EE:DD:88:99&lt;br /&gt;
          inet addr:192.168.1.71  Bcast:192.168.1.255  Mask:255.255.255.0&lt;br /&gt;
          inet6 addr: fe80::92e6:baff:fe71:82d8/64 Scope:Link&lt;br /&gt;
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1&lt;br /&gt;
          RX packets:555 errors:0 dropped:0 overruns:0 frame:0&lt;br /&gt;
          TX packets:331 errors:0 dropped:0 overruns:0 carrier:0&lt;br /&gt;
          collisions:0 txqueuelen:0 &lt;br /&gt;
          RX bytes:60616 (59.1 KiB)  TX bytes:56370 (55.0 KiB)&lt;br /&gt;
&lt;br /&gt;
eth1      Link encap:Ethernet  HWaddr 00:11:22:33:44:55&lt;br /&gt;
          inet addr:10.0.0.71  Bcast:10.0.0.255  Mask:255.255.255.0&lt;br /&gt;
          inet6 addr: fe80::221:91ff:fe19:965a/64 Scope:Link&lt;br /&gt;
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1&lt;br /&gt;
          RX packets:66 errors:0 dropped:0 overruns:0 frame:0&lt;br /&gt;
          TX packets:58 errors:0 dropped:0 overruns:0 carrier:0&lt;br /&gt;
          collisions:0 txqueuelen:0 &lt;br /&gt;
          RX bytes:11802 (11.5 KiB)  TX bytes:10708 (10.4 KiB)&lt;br /&gt;
&lt;br /&gt;
eth2      Link encap:Ethernet  HWaddr 00:AA:BB:CC:DD:EE&lt;br /&gt;
          inet addr:10.0.1.71  Bcast:10.0.1.255  Mask:255.255.255.0&lt;br /&gt;
          inet6 addr: fe80::20e:cff:fe59:4578/64 Scope:Link&lt;br /&gt;
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1&lt;br /&gt;
          RX packets:65 errors:0 dropped:0 overruns:0 frame:0&lt;br /&gt;
          TX packets:58 errors:0 dropped:0 overruns:0 carrier:0&lt;br /&gt;
          collisions:0 txqueuelen:0 &lt;br /&gt;
          RX bytes:11670 (11.3 KiB)  TX bytes:10734 (10.4 KiB)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As before, don&#039;t worry if the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;inet addr:...&amp;lt;/span&amp;gt; lines are different or missing. What is important is that the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;HWaddr ...&amp;lt;/span&amp;gt; entries correspond properly to the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ethX&amp;lt;/span&amp;gt; devices. If they do, you are done! If they don&#039;t, double-check the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ifcfg-ethX&amp;lt;/span&amp;gt; files have the proper &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;HWADDR=...&amp;lt;/span&amp;gt; entries.&lt;br /&gt;
&lt;br /&gt;
== Caveat! ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;NOTE&#039;&#039;&#039;&#039;&#039;: If you are using a vlan, the device facing the vlan &#039;&#039;&#039;can not&#039;&#039;&#039; have the &#039;&#039;&#039;HWADDR=...&#039;&#039;&#039; value set! Set the others and leave this commented out. Otherwise, because of how the vlan loads, the OS will not see the physical device and will fail to bring up the interface at all.&lt;br /&gt;
&lt;br /&gt;
{{footer}}&lt;/div&gt;</summary>
		<author><name>SRSullivan</name></author>
	</entry>
	<entry>
		<id>https://alteeve.com/w/index.php?title=Talk:Setting_Up_a_PXE_Server_on_an_RPM-based_OS&amp;diff=2491</id>
		<title>Talk:Setting Up a PXE Server on an RPM-based OS</title>
		<link rel="alternate" type="text/html" href="https://alteeve.com/w/index.php?title=Talk:Setting_Up_a_PXE_Server_on_an_RPM-based_OS&amp;diff=2491"/>
		<updated>2010-11-21T06:45:08Z</updated>

		<summary type="html">&lt;p&gt;SRSullivan: reference to s/lib/share/ change.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;For your tutorial, you move pxelinux.0 from /usr/share/syslinux/ but the package syslinux-tftpboot will provide it in /tftpboot for you.&lt;br /&gt;
&lt;br /&gt;
Under CentOS 5, it&#039;s located in /usr/lib/syslinux/&lt;br /&gt;
&lt;br /&gt;
( Research shows this change here [http://syslinux.zytor.com/wiki/index.php/Syslinux_3_Changelog#Changes_in_3.70] )&lt;br /&gt;
&lt;br /&gt;
This is verifiable with a &amp;quot;yum provides */pxelinux.0&amp;quot;.&lt;br /&gt;
Since this is a actual package, it should eliminate version drift from the original copy as the syslinux package updates.&lt;br /&gt;
--[[User:SRSullivan|SRSullivan]] 05:50, 21 November 2010 (UTC)&lt;/div&gt;</summary>
		<author><name>SRSullivan</name></author>
	</entry>
	<entry>
		<id>https://alteeve.com/w/index.php?title=Talk:Setting_Up_a_PXE_Server_on_an_RPM-based_OS&amp;diff=2490</id>
		<title>Talk:Setting Up a PXE Server on an RPM-based OS</title>
		<link rel="alternate" type="text/html" href="https://alteeve.com/w/index.php?title=Talk:Setting_Up_a_PXE_Server_on_an_RPM-based_OS&amp;diff=2490"/>
		<updated>2010-11-21T05:50:19Z</updated>

		<summary type="html">&lt;p&gt;SRSullivan: Comments on simplifying setup by using an exsiting package.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;For your tutorial, you move pxelinux.0 from /usr/share/syslinux/ but the package syslinux-tftpboot will provide it in /tftpboot for you.&lt;br /&gt;
&lt;br /&gt;
Under CentOS 5, it&#039;s located in /usr/lib/syslinux/&lt;br /&gt;
&lt;br /&gt;
This is verifiable with a &amp;quot;yum provides */pxelinux.0&amp;quot;.&lt;br /&gt;
Since this is a actual package, it should eliminate version drift from the original copy as the syslinux package updates.&lt;br /&gt;
--[[User:SRSullivan|SRSullivan]] 05:50, 21 November 2010 (UTC)&lt;/div&gt;</summary>
		<author><name>SRSullivan</name></author>
	</entry>
	<entry>
		<id>https://alteeve.com/w/index.php?title=Two_Node_Fedora_13_Cluster_-_Xen-Based_Virtual_Machine_Host_on_DRBD%2BCLVM&amp;diff=2317</id>
		<title>Two Node Fedora 13 Cluster - Xen-Based Virtual Machine Host on DRBD+CLVM</title>
		<link rel="alternate" type="text/html" href="https://alteeve.com/w/index.php?title=Two_Node_Fedora_13_Cluster_-_Xen-Based_Virtual_Machine_Host_on_DRBD%2BCLVM&amp;diff=2317"/>
		<updated>2010-10-18T20:25:23Z</updated>

		<summary type="html">&lt;p&gt;SRSullivan: /* Removing Clustered Services From initd */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{howto_header}}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Warning&#039;&#039;&#039;: This is currently a dumping ground for notes. &#039;&#039;&#039;&#039;&#039;DO NOT FOLLOW THIS DOCUMENT&#039;S INSTRUCTIONS&#039;&#039;&#039;&#039;&#039;. Seriously, it could blow up your computer or cause winter to come early.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
This HowTo will walk you through setting up [[Xen]] [[VM]]s using [[DRBD]] and [[CLVM]] for high availability.&lt;br /&gt;
&lt;br /&gt;
= Prerequisite =&lt;br /&gt;
&lt;br /&gt;
This talk is an extension of the [[Two Node Fedora 13 Cluster]] HowTo. As such, you will be expected to have a freshly built two-node cluster with spare disk space on either node.&lt;br /&gt;
&lt;br /&gt;
Please do not proceed until you have completed the first tutorial.&lt;br /&gt;
&lt;br /&gt;
= Overview =&lt;br /&gt;
&lt;br /&gt;
This tutorial will cover several topics; [[DRBD]], [[CLVM]], [[GFS2]], [[Xen]] [[dom0]] and [[domU]] [[VM]]s and [[rgmanager]]. Their relationship is thus:&lt;br /&gt;
&lt;br /&gt;
* DRBD provides a mechanism to replicate data across both nodes in real time and guarantees a consistent view of that data from either node. Think of it like [[TLUG_Talk:_Storage_Technologies_and_Theory#Level_1|RAID level 1]], but across machines.&lt;br /&gt;
* CLVM sits on the DRBD partition and provides the underlying mechanism for allowing both nodes to access shared data in a clustered environment. It will host a shared filesystem by way of GFS2 as well as [[LV]]s that Xen&#039;s domU VMs will use as their disk space.&lt;br /&gt;
* GFS2 will be the clustered file system used on one of the DBRD-backed, CLVM-managed partitions. Files that need to be shared between nodes, like the Xen VM configuration files, will exist on this partition.&lt;br /&gt;
* Xen will be the hypervisor in use that will manage the various virtual machines. Each virtual machine will exist in an LVM LV.&lt;br /&gt;
** Xen&#039;s dom0 is the special &amp;quot;host&amp;quot; virtual machine. In this case, dom0 will be the OS installed in the first HowTo.&lt;br /&gt;
** Xen&#039;s domU virtual machines will be the &amp;quot;floating&amp;quot;, highly available servers.&lt;br /&gt;
* Lastly, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; will be the component of [[cman]] that will be configured to manage the automatic migration of the virtual machines when failures occur and when nodes recover.&lt;br /&gt;
&lt;br /&gt;
= Setting Up Xen =&lt;br /&gt;
&lt;br /&gt;
It may seem odd to start with [[Xen]] at this stage, but it is going to rather fundamentally alter each node&#039;s &amp;quot;host&amp;quot; operating system.&lt;br /&gt;
&lt;br /&gt;
At this point, each node&#039;s host OS is a traditional operating system operating on the bare metal. When we install a &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;dom0&amp;lt;/span&amp;gt; kernel though, we tell Xen to boot a mini operating system first, and then to boot our &amp;quot;host&amp;quot; operating system. In effect, this converts the host node&#039;s operating system into just another virtual machine, albeit with a special view of the underlying hardware and Xen hypervisor.&lt;br /&gt;
&lt;br /&gt;
This conversion is somewhat disruptive, so I like to get it out of the way right away. We will then do the rest of the setup before returning to Xen later on to create the floating virtual machines.&lt;br /&gt;
&lt;br /&gt;
== A Note On The State Of Xen dom0 Support In Fedora ==&lt;br /&gt;
&lt;br /&gt;
As of Fedora 8, support for Xen [[dom0]] has been removed, but support for the hypervisor and [[domU]] virtual machines remains. Red Hat&#039;s position is that KVM will be the supported platform going forward. That said, [http://fedoraproject.org/wiki/Features/XenPvopsDom0 this page] seems to indicate that PV Ops dom0 kernels will be supported in the future. Specifically, when dom0 support is merged into the mainline Linux kernel. When this will be is open to speculation, though &amp;quot;by Fedora 16&amp;quot; seems to be a reasonable educated guess.&lt;br /&gt;
&lt;br /&gt;
What this means for us is that we need to use a non-standard dom0 kernel. Specifically, we will use a kernel created by [http://myoung.fedorapeople.org/ myoung] (Micheal Young) for Fedora 12. This kernel does not directly support DRBD, so be aware that we will need to build new DRBD kernel modules for his kernel and then rebuild the DRBD modules each time his kernel is updated.&lt;br /&gt;
&lt;br /&gt;
== A Note On Rolling Your Own RPMs ==&lt;br /&gt;
&lt;br /&gt;
If you want to roll the source RPMs for both the hypervisor and the [[dom0]] kernel, you will need to make both before you can boot into your dom0 for the first time. This is because the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;dom0&amp;lt;/span&amp;gt; kernel needs the Xen microkernel provided by the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xen&amp;lt;/span&amp;gt; hypervisor package to boot.&lt;br /&gt;
&lt;br /&gt;
== Install The Hypervisor ==&lt;br /&gt;
&lt;br /&gt;
We will use [[Xen]] 4.0.1, as provided by [http://pasik.reaktio.net/fedora/ Pasik]. We&#039;ll use the [http://pasik.reaktio.net/fedora/xen-4.0.1-0.2.fc13.src.rpm source RPM] to build our own RPM.&lt;br /&gt;
&lt;br /&gt;
Regardless of whether you install from source RPMs or the pre-compiled ones, you will need to install the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;libvirt&amp;lt;/span&amp;gt;, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;qemu&amp;lt;/span&amp;gt;, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;SDL&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;PyXML&amp;lt;/span&amp;gt; packages from the standard repositories before you can proceed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum -y install libvirt PyXML.x86_64 qemu.x86_64 SDL.x86_64&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Please don&#039;t remove existing &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xen&amp;lt;/span&amp;gt; utilities and libraries prior to installing the newer version. If you do, core clustering components may be removed. Instead, be sure to use the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rpm -Uvh&amp;lt;/span&amp;gt; switches to upgrade the existing packages that may be installed already.&lt;br /&gt;
&lt;br /&gt;
=== Installing Prebuilt RPMs ===&lt;br /&gt;
&lt;br /&gt;
These are locally stored copies of the Xen RPMs built for [[x86_64]] on Fedora 13. This requires some dependent packages be installed first.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Warning&#039;&#039;&#039;: These are all recompiled for this website against Fedora 13, x86_64. If you feel more comfortable, please use [[RPM]]s from a source you are familiar with.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cd ~&lt;br /&gt;
wget -c https://alteeve.com/files/an-cluster/xen-4.0.1-0.2.fc13.x86_64.rpm&lt;br /&gt;
wget -c https://alteeve.com/files/an-cluster/xen-doc-4.0.1-0.2.fc13.x86_64.rpm&lt;br /&gt;
wget -c https://alteeve.com/files/an-cluster/xen-hypervisor-4.0.1-0.2.fc13.x86_64.rpm&lt;br /&gt;
wget -c https://alteeve.com/files/an-cluster/xen-libs-4.0.1-0.2.fc13.x86_64.rpm&lt;br /&gt;
wget -c https://alteeve.com/files/an-cluster/xen-runtime-4.0.1-0.2.fc13.x86_64.rpm&lt;br /&gt;
rpm -Uvh xen*4.0.1-0.2.fc13.x86_64.rpm&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Optionally, you may wish to install &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;debug&amp;lt;/span&amp;gt; and/or &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;devel&amp;lt;/span&amp;gt; RPMs as well.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
wget -c https://alteeve.com/files/xen-debuginfo-4.0.1-0.2.fc13.x86_64.rpm&lt;br /&gt;
wget -c https://alteeve.com/files/xen-devel-4.0.1-0.2.fc13.x86_64.rpm&lt;br /&gt;
rpm -Uvh xen-d*4.0.1-0.2.fc13.x86_64.rpm&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Building RPMs From Source ===&lt;br /&gt;
&lt;br /&gt;
To build the RPMs from the source, you need to make sure that you have the build environment installed. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: If you are following these instruction after having installed a prior dom0 kernel, you will need to comment out &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;exclude=kernel*&amp;lt;/span&amp;gt; in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/yum.conf&amp;lt;/span&amp;gt; so that the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;kernel-header&amp;lt;/span&amp;gt; package can be installed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/yum.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
# PUT YOUR REPOS HERE OR IN separate files named file.repo&lt;br /&gt;
# in /etc/yum.repos.d&lt;br /&gt;
#exclude=kernel*&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now install the development environment.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum -y groupinstall &amp;quot;Development Libraries&amp;quot;&lt;br /&gt;
yum -y groupinstall &amp;quot;Development Tools&amp;quot;&lt;br /&gt;
yum install transfig texi2html SDL-devel libX11-devel tetex-latex gtk2-devel libaio-devel dev86 iasl xz-devel e2fsprogs-devel glibc-devel.i686 xmlto asciidoc elfutils-libelf-devel&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: If you had to uncomment the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;exclude=kernel*&amp;lt;/span&amp;gt; line earlier, comment it back out now before you forget.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/yum.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
# PUT YOUR REPOS HERE OR IN separate files named file.repo&lt;br /&gt;
# in /etc/yum.repos.d&lt;br /&gt;
exclude=kernel*&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we can now build the RPMs from source.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cd ~&lt;br /&gt;
wget -c https://alteeve.com/files/an-cluster/xen-4.0.1-0.2.fc13.src.rpm&lt;br /&gt;
rpm -ivh xen-4.0.1-0.2.fc13.src.rpm&lt;br /&gt;
cd /root/rpmbuild/SPECS/&lt;br /&gt;
rpmbuild -ba xen.spec&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once this is done, you will have seven RPMs built. Two of them are not really needed (&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xen-debuginfo-4.0.1-0.2.fc13.x86_64.rpm&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xen-devel-4.0.1-0.2.fc13.x86_64.rpm&amp;lt;/span&amp;gt;) and I will leave it up to you may wish to install them or not. If you don&#039;t, modify the next command or move the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;debug&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;devel&amp;lt;/span&amp;gt; RPMs out of the way first.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cd ~/rpmbuild/RPMS/x86_64/&lt;br /&gt;
rpm -Uvh xen*4.0.1-0.2.fc13.x86_64.rpm&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Installing The AN!Cluster dom0 Kernel ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Notice&#039;&#039;&#039;!&lt;br /&gt;
&lt;br /&gt;
The kernel provided here was recompiled on Fedora 13 and is a slightly modified version of [[#Installing Micheal Young&#039;s dom0 Kernel|Micheal Young&#039;s]] kernel available below. I was originally driven to recompile in an effort to solve a DRBD-related kernel oops. For now, unless you have the same DRBD kernel oops, I&#039;d strongly recommend against using the AN!Cluster dom0 kernel until it has been tested much more thoroughly.&lt;br /&gt;
&lt;br /&gt;
With that warning out of the way...&lt;br /&gt;
&lt;br /&gt;
This kernel was compiled on a Fedora 13, x86_64. The DRBD RPMs available a little later where compiled against this dom0 kernel. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--force&amp;lt;/span&amp;gt; is required because the current kernel is newer than &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;2.6.32&amp;lt;/span&amp;gt; used here. Without this switch, the RPM would not install.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cd ~&lt;br /&gt;
wget -c https://alteeve.com/files/an-cluster/kernel-2.6.32.23-170.dom0_an1.fc13.x86_64.rpm&lt;br /&gt;
rpm -ivh --force kernel-2.6.32.23-170.dom0_an1.fc13.x86_64.rpm&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you would like to install the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;debug&amp;lt;/span&amp;gt;, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;devel&amp;lt;/span&amp;gt; and/or &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;header&amp;lt;/span&amp;gt; RPMs for this kernel, they are available below.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;kernel-debuginfo-2.6.32.23-170.dom0_an1.fc13.x86_64.rpm&amp;lt;/span&amp;gt; RPM is 213 [[MiB]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
wget -c https://alteeve.com/files/an-cluster/kernel-2.6.32.23-170.dom0_an1.fc13.x86_64.rpm&lt;br /&gt;
wget -c https://alteeve.com/files/an-cluster/kernel-debuginfo-2.6.32.23-170.dom0_an1.fc13.x86_64.rpm&lt;br /&gt;
wget -c https://alteeve.com/files/an-cluster/kernel-devel-2.6.32.23-170.dom0_an1.fc13.x86_64.rpm&lt;br /&gt;
wget -c https://alteeve.com/files/an-cluster/kernel-headers-2.6.32.23-170.dom0_an1.fc13.x86_64.rpm&lt;br /&gt;
rpm -ivh --force kernel-de*-2.6.32.23-170.dom0_an1.fc13.x86_64.rpm kernel-headers-2.6.32.23-170.dom0_an1.fc13.x86_64.rpm&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Post AN!Cluster dom0 Install Configuration ===&lt;br /&gt;
&lt;br /&gt;
The entry in grub&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/boot/grub/menu.lst&amp;lt;/span&amp;gt; won&#039;t work. You will need to edit it so that it calls the existing installed operating system as a &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;module&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: Copy and modify the entry created by the RPM. Simply copying this entry will almost certainly not work! Your &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;root=&amp;lt;/span&amp;gt; is likely different and your &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rd_MD_UUID=&amp;lt;/span&amp;gt; will definitely be different, even on the same machine across installs. Generally speaking, what follows the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;kernel /vmlinuz-2.6.32.23-170.dom0_an1.fc13.x86_64 ...&amp;lt;/span&amp;gt; entry made by the dom0 kernel can be copied after the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;module /vmlinuz-2.6.32.23-170.dom0_an1.fc13.x86_64 ...&amp;lt;/span&amp;gt; entry in the example below.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /boot/grub/menu.lst&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
title Xen 4.0.x, Linux 2.6.32.23-170.dom0_an1.fc13.x86_64&lt;br /&gt;
        root   (hd0,0)&lt;br /&gt;
        kernel /xen.gz dom0_mem=1024M&lt;br /&gt;
        module /vmlinuz-2.6.32.23-170.dom0_an1.fc13.x86_64 ...&lt;br /&gt;
        module /initramfs-2.6.32.23-170.dom0_an1.fc13.x86_64.img&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Installing Micheal Young&#039;s dom0 Kernel ==&lt;br /&gt;
&lt;br /&gt;
This uses a kernel built for Fedora 12, but it works on Fedora 13. This step involves either installing it over HTML or adding and enabling his repository and then installing it from there.&lt;br /&gt;
&lt;br /&gt;
=== Installing Via myoung&#039;s Repository ===&lt;br /&gt;
&lt;br /&gt;
This is almost always the preferred method. However, do note that when myoung updates his kernel, there will be a lag where the dom0 dependent RPMs provided here will no longer be compatible.&lt;br /&gt;
&lt;br /&gt;
To add the repository, download the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;myoung.dom0.repo&amp;lt;/span&amp;gt; into the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/yum.repos.d/&amp;lt;/span&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cd /etc/yum.repos.d/&lt;br /&gt;
wget -c http://myoung.fedorapeople.org/dom0/myoung.dom0.repo&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To enable his repository, edit the repository file and change the two &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;enabled=0&amp;lt;/span&amp;gt; entries to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;enabled=1&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/yum.repos.d/myoung.dom0.repo&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
[myoung-dom0]&lt;br /&gt;
name=myoung&#039;s repository of Fedora based dom0 kernels - $basearch&lt;br /&gt;
baseurl=http://fedorapeople.org/~myoung/dom0/$basearch/&lt;br /&gt;
enabled=1&lt;br /&gt;
gpgcheck=0&lt;br /&gt;
&lt;br /&gt;
[myoung-dom0-source]&lt;br /&gt;
name=myoung&#039;s repository of Fedora based dom0 kernels - Source&lt;br /&gt;
baseurl=http://fedorapeople.org/~myoung/dom0/src/&lt;br /&gt;
enabled=1&lt;br /&gt;
gpgcheck=0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Install the [[Xen]] [[dom0]] kernel (edit the version number with the updated version if it has changed).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install kernel-2.6.32.21-170.xendom0.fc12.x86_64&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Post Michael Young&#039;s dom0 Install Configuration ===&lt;br /&gt;
&lt;br /&gt;
The entry in grub&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/boot/grub/menu.lst&amp;lt;/span&amp;gt; won&#039;t work. You will need to edit it so that it calls the existing installed operating system as a &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;module&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: Copy and modify the entry created by the RPM. Simply copying this entry will almost certainly not work! Your &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;root=&amp;lt;/span&amp;gt; is likely different and your &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rd_MD_UUID=&amp;lt;/span&amp;gt; will definitely be different, even on the same machine across installs. Generally speaking, what follows the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;kernel /vmlinuz-2.6.32.21-170.xendom0.fc12.x86_64 ...&amp;lt;/span&amp;gt; entry made by the dom0 kernel can be copied after the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;module /vmlinuz-2.6.32.21-170.xendom0.fc12.x86_64 ...&amp;lt;/span&amp;gt; entry in the example below.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /boot/grub/menu.lst&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
title Xen 4.0.x, Linux kernel 2.6.32.21-170.xendom0.fc12.x86_64&lt;br /&gt;
	root   (hd0,0)&lt;br /&gt;
	kernel /xen.gz dom0_mem=1024M&lt;br /&gt;
	module /vmlinuz-2.6.32.21-170.xendom0.fc12.x86_64 ...&lt;br /&gt;
	module /initramfs-2.6.32.21-170.xendom0.fc12.x86_64.img&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Disabling Automatic Kernel Updates ===&lt;br /&gt;
&lt;br /&gt;
Seeing as we&#039;re using an older kernel, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;yum&amp;lt;/span&amp;gt; will want to replace it whenever there is an updated &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;kernel*&amp;lt;/span&amp;gt; package available. Likewise if myoung updates his kernel. In the latter case, the updated kernel from Mr. Young would break compatibility with our DRBD module. So to be safe, we want to tell &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;yum&amp;lt;/span&amp;gt; to never update the kernel.&lt;br /&gt;
&lt;br /&gt;
To do this, we need to add &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;exclude=kernel*&amp;lt;/span&amp;gt; to the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/yum.conf&amp;lt;/span&amp;gt; file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
echo &amp;quot;exclude=kernel*&amp;quot; &amp;gt;&amp;gt; /etc/yum.conf&lt;br /&gt;
cat /etc/yum.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
[main]&lt;br /&gt;
cachedir=/var/cache/yum/$basearch/$releasever&lt;br /&gt;
keepcache=0&lt;br /&gt;
debuglevel=2&lt;br /&gt;
logfile=/var/log/yum.log&lt;br /&gt;
exactarch=1&lt;br /&gt;
obsoletes=1&lt;br /&gt;
gpgcheck=1&lt;br /&gt;
plugins=1&lt;br /&gt;
installonly_limit=3&lt;br /&gt;
color=never&lt;br /&gt;
&lt;br /&gt;
#  This is the default, if you make this bigger yum won&#039;t see if the metadata&lt;br /&gt;
# is newer on the remote and so you&#039;ll &amp;quot;gain&amp;quot; the bandwidth of not having to&lt;br /&gt;
# download the new metadata and &amp;quot;pay&amp;quot; for it by yum not having correct&lt;br /&gt;
# information.&lt;br /&gt;
#  It is esp. important, to have correct metadata, for distributions like&lt;br /&gt;
# Fedora which don&#039;t keep old packages around. If you don&#039;t like this checking&lt;br /&gt;
# interupting your command line usage, it&#039;s much better to have something&lt;br /&gt;
# manually check the metadata once an hour (yum-updatesd will do this).&lt;br /&gt;
# metadata_expire=90m&lt;br /&gt;
&lt;br /&gt;
# PUT YOUR REPOS HERE OR IN separate files named file.repo&lt;br /&gt;
# in /etc/yum.repos.d&lt;br /&gt;
&lt;br /&gt;
exclude=kernel*&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Make xend play nice with clustering ===&lt;br /&gt;
&lt;br /&gt;
By default under Fedora 13, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt; will start before &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xend&amp;lt;/span&amp;gt;. This is a problem because &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xend&amp;lt;/span&amp;gt; takes the network down as part of it&#039;s setup. This causes [[totem]] communication to fail which leads to fencing.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: Move &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xenconsoled&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xenstore&amp;lt;/span&amp;gt; to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;09&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;10&amp;lt;/span&amp;gt; start positions and then make &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xend&amp;lt;/span&amp;gt; depend on the before starting.&lt;br /&gt;
&lt;br /&gt;
To avoid this, edit the initialization scripts for &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/init.d/xend&amp;lt;/span&amp;gt; and it&#039;s dependents &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xenconsoled&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xenstore&amp;lt;/span&amp;gt; to have a lower minimum start position. We need to maintain the start order of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xenstore&amp;lt;/span&amp;gt; first, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xenconsoled&amp;lt;/span&amp;gt; second and lastly &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xend&amp;lt;/span&amp;gt;. By default, their minimum start positions are &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;96&amp;lt;/span&amp;gt;, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;97&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;98&amp;lt;/span&amp;gt; respectively. We will change these to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;10&amp;lt;/span&amp;gt;, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;11&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;12&amp;lt;/span&amp;gt;, again, respectively.&lt;br /&gt;
&lt;br /&gt;
Note that we are &#039;&#039;&#039;not&#039;&#039;&#039; altering the start position of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xendomains&amp;lt;/span&amp;gt;! This is intentional as this daemon will start the [[domU]] VMs. This can not happen until all other cluster related daemons have started.&lt;br /&gt;
&lt;br /&gt;
To change the start order we will change the line &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;chkconfig: 2345 9x 01&amp;lt;/span&amp;gt; lines to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;chkconfig: 2345 1x 01&amp;lt;/span&amp;gt;, where &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;x&amp;lt;/span&amp;gt; is the given daemon&#039;s start number. Further, we&#039;ll make sure that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xenstored&amp;lt;/span&amp;gt; begins first by add it to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xenconsoled&amp;lt;/span&amp;gt;&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Required-Start&amp;lt;/span&amp;gt; line. We&#039;ll then make sure that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xenconsoled&amp;lt;/span&amp;gt; starts before &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xend&amp;lt;/span&amp;gt; by adding it to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xend&amp;lt;/span&amp;gt;&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Required-Start&amp;lt;/span&amp;gt; line.&lt;br /&gt;
&lt;br /&gt;
To recap the changes;&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xenstored&amp;lt;/span&amp;gt; will start first.&lt;br /&gt;
** We&#039;ll change it&#039;s start position from &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;96&amp;lt;/span&amp;gt; to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;10&amp;lt;/span&amp;gt;.&lt;br /&gt;
** We will not add anything to it&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Required-Start&amp;lt;/span&amp;gt; as it must be the first daemon to come up.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xenconsoled&amp;lt;/span&amp;gt; will start second.&lt;br /&gt;
** We&#039;ll change it&#039;s start position from &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;97&amp;lt;/span&amp;gt; to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;11&amp;lt;/span&amp;gt;.&lt;br /&gt;
** We will add &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xenstored&amp;lt;/span&amp;gt; to it&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Required-Start&amp;lt;/span&amp;gt; line.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xend&amp;lt;/span&amp;gt; will start third.&lt;br /&gt;
** We&#039;ll change it&#039;s start position from &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;98&amp;lt;/span&amp;gt; to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;12&amp;lt;/span&amp;gt;.&lt;br /&gt;
** We will add &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xenconsoled&amp;lt;/span&amp;gt; to it&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Required-Start&amp;lt;/span&amp;gt; line.&lt;br /&gt;
&lt;br /&gt;
When done, the three initialization scripts should look like the examples below.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/init.d/xenstored&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
#&lt;br /&gt;
# xenstored     Script to start and stop the Xen control daemon.&lt;br /&gt;
#&lt;br /&gt;
# Author:       Daniel Berrange &amp;lt;berrange@redhat.com&lt;br /&gt;
#&lt;br /&gt;
# chkconfig: 2345 10 01&lt;br /&gt;
# description: Starts and stops the Xen xenstored daemon.&lt;br /&gt;
### BEGIN INIT INFO&lt;br /&gt;
# Provides:          xenstored&lt;br /&gt;
# Required-Start:    $syslog $remote_fs&lt;br /&gt;
# Should-Start:&lt;br /&gt;
# Required-Stop:     $syslog $remote_fs&lt;br /&gt;
# Should-Stop:&lt;br /&gt;
# Default-Start:     3 4 5&lt;br /&gt;
# Default-Stop:      0 1 2 6&lt;br /&gt;
# Default-Enabled:   yes&lt;br /&gt;
# Short-Description: Start/stop xenstored&lt;br /&gt;
# Description:       Starts and stops the Xen xenstored daemon.&lt;br /&gt;
### END INIT INFO&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/init.d/xenconsoled&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
#&lt;br /&gt;
# xenconsoled   Script to start and stop the Xen xenconsoled daemon&lt;br /&gt;
#&lt;br /&gt;
# Author:       Daniel P. Berrange &amp;lt;berrange@redhat.com&amp;gt;&lt;br /&gt;
#&lt;br /&gt;
# chkconfig: 2345 11 01&lt;br /&gt;
# description: Starts and stops the Xen control daemon.&lt;br /&gt;
### BEGIN INIT INFO&lt;br /&gt;
# Provides:          xenconsoled&lt;br /&gt;
# Required-Start:    $syslog $remote_fs xenstored&lt;br /&gt;
# Should-Start:&lt;br /&gt;
# Required-Stop:     $syslog $remote_fs&lt;br /&gt;
# Should-Stop:&lt;br /&gt;
# Default-Start:     3 4 5&lt;br /&gt;
# Default-Stop:      0 1 2 6&lt;br /&gt;
# Default-Enabled:   yes&lt;br /&gt;
# Short-Description: Start/stop xenconsoled&lt;br /&gt;
# Description:       Starts and stops the Xen xenconsoled daemon.&lt;br /&gt;
### END INIT INFO&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/init.d/xend&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
#&lt;br /&gt;
# xend          Script to start and stop the Xen control daemon.&lt;br /&gt;
#&lt;br /&gt;
# Author:       Keir Fraser &amp;lt;keir.fraser@cl.cam.ac.uk&amp;gt;&lt;br /&gt;
#&lt;br /&gt;
# chkconfig: 2345 12 98&lt;br /&gt;
# description: Starts and stops the Xen control daemon.&lt;br /&gt;
### BEGIN INIT INFO&lt;br /&gt;
# Provides:          xend&lt;br /&gt;
# Required-Start:    $syslog $remote_fs xenconsoled&lt;br /&gt;
# Should-Start:&lt;br /&gt;
# Required-Stop:     $syslog $remote_fs&lt;br /&gt;
# Should-Stop:&lt;br /&gt;
# Default-Start:     3 4 5&lt;br /&gt;
# Default-Stop:      0 1 2 6&lt;br /&gt;
# Default-Enabled:   yes&lt;br /&gt;
# Short-Description: Start/stop xend&lt;br /&gt;
# Description:       Starts and stops the Xen control daemon.&lt;br /&gt;
### END INIT INFO&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xend&amp;lt;/span&amp;gt; set to start at a position lower than &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;98&amp;lt;/span&amp;gt;, we now have room for &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;chkconfig&amp;lt;/span&amp;gt; to put other daemons after it in the start order, which will be needed a little later. First and foremost, we now need to tell &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt; to not start until after &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xend&amp;lt;/span&amp;gt; is up.&lt;br /&gt;
&lt;br /&gt;
As above, we will now edit &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt;&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/init.d/cman&amp;lt;/span&amp;gt; script. This time though, we will not edit it&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;chkconfig&amp;lt;/span&amp;gt; line. Instead, we will simply add &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xend&amp;lt;/span&amp;gt; to the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Required-Start&amp;lt;/span&amp;gt; line.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/init.d/cman&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
#&lt;br /&gt;
# cman - Cluster Manager init script&lt;br /&gt;
#&lt;br /&gt;
# chkconfig: - 21 79&lt;br /&gt;
# description: Starts and stops cman&lt;br /&gt;
#&lt;br /&gt;
#&lt;br /&gt;
### BEGIN INIT INFO&lt;br /&gt;
# Provides:             cman&lt;br /&gt;
# Required-Start:       $network $time xend&lt;br /&gt;
# Required-Stop:        $network $time&lt;br /&gt;
# Default-Start:&lt;br /&gt;
# Default-Stop:&lt;br /&gt;
# Short-Description:    Starts and stops cman&lt;br /&gt;
# Description:          Starts and stops the Cluster Manager set of daemons&lt;br /&gt;
### END INIT INFO&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Finally, remove and re-add the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xend&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt; daemons to re-order them in the start list:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
chkconfig xenstored off; chkconfig xenconsoled off; chkconfig xend off; chkconfig cman off; &lt;br /&gt;
chkconfig xenstored on; chkconfig xenconsoled on; chkconfig xend on; chkconfig cman on&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Confirm that the order has changed so that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xend&amp;lt;/span&amp;gt; is earlier in the boot sequence than &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt;. Assuming you&#039;ve switched to run-level 3, run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ls -lah /etc/rc3.d/&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Your start sequence should now look like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
lrwxrwxrwx.  1 root root   19 Sep 15 19:29 S26xenstored -&amp;gt; ../init.d/xenstored&lt;br /&gt;
lrwxrwxrwx.  1 root root   21 Sep 15 19:29 S27xenconsoled -&amp;gt; ../init.d/xenconsoled&lt;br /&gt;
lrwxrwxrwx.  1 root root   14 Sep 15 19:29 S28xend -&amp;gt; ../init.d/xend&lt;br /&gt;
lrwxrwxrwx.  1 root root   14 Sep 15 19:29 S29cman -&amp;gt; ../init.d/cman&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Booting Into The New dom0 ===&lt;br /&gt;
&lt;br /&gt;
If everything went well, you should be able to boot the new dom0 operating system. If you watch the boot process closely, you will see that the boot process is different. You should now see the Xen hypervisor boot prior to handing off to the &amp;quot;host&amp;quot; operating system. This can be confirmed once the dom0 operating system has booted by checking that the file &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/proc/xen/capabilities&amp;lt;/span&amp;gt; exists. What it contains doesn&#039;t matter at this stage, only that it exists at all.&lt;br /&gt;
&lt;br /&gt;
== Configure Networking ==&lt;br /&gt;
&lt;br /&gt;
Networking in Xen, particularly in a cluster, can be confusing. If you are not familiar with networking in Xen, please review to following article before proceeding.&lt;br /&gt;
&lt;br /&gt;
A note of a major change from previous layouts. In Xen 3.x, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ethX&amp;lt;/span&amp;gt; would be copied to a virtual interface called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vethX&amp;lt;/span&amp;gt;. Then the real &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ethX&amp;lt;/span&amp;gt; would be renamed to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;pethX&amp;lt;/span&amp;gt; and the virtual interface &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vethX&amp;lt;/span&amp;gt; would be renamed to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ethX&amp;lt;/span&amp;gt; to take it&#039;s place. Finally, a bridge called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xenbrX&amp;lt;/span&amp;gt; would be created and the real &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;pethX&amp;lt;/span&amp;gt; and virtual &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ethX&amp;lt;/span&amp;gt; would be connected to it.&lt;br /&gt;
&lt;br /&gt;
This has been changed somewhat it that now, by default, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ethX&amp;lt;/span&amp;gt; is left alone and a simple bridge called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virbrX&amp;lt;/span&amp;gt; would be created. We&#039;ll be changing this to be somewhat similar to the old style.&lt;br /&gt;
&lt;br /&gt;
Specifically, the real &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ethX&amp;lt;/span&amp;gt; will be renamed to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;pethX&amp;lt;/span&amp;gt;. Then a bridge will be created called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ethX&amp;lt;/span&amp;gt;, which plays the role of dom0&#039;s interface &#039;&#039;&#039;and&#039;&#039;&#039; bridges connections from VMs through &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;pethX&amp;lt;/span&amp;gt; and out into the real world.&lt;br /&gt;
&lt;br /&gt;
This is explained in more detail, and with diagrams, in the article below.&lt;br /&gt;
&lt;br /&gt;
* [[Networking in Xen]]&lt;br /&gt;
&lt;br /&gt;
=== Adding New NICs to Xen ===&lt;br /&gt;
&lt;br /&gt;
By default, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xend&amp;lt;/span&amp;gt; manages &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth0&amp;lt;/span&amp;gt; only. We need to add &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth2&amp;lt;/span&amp;gt;. Personally, I don&#039;t like to put the storage network ethernet devices (eth1) under Xen&#039;s control as this potentially can cause DRBD problems on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xend&amp;lt;/span&amp;gt; restart. Whether you add it or not I will leave to your preferences.&lt;br /&gt;
&lt;br /&gt;
You can see which, if any, network devices are under Xen&#039;s control by running &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ifconfig&amp;lt;/span&amp;gt; and checking to see if there is a &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virbrX&amp;lt;/span&amp;gt; corresponding to a given &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ethX&amp;lt;/span&amp;gt; device.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ifconfig&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
eth0      Link encap:Ethernet  HWaddr 48:5B:39:3C:53:14  &lt;br /&gt;
          inet addr:192.168.1.74  Bcast:192.168.1.255  Mask:255.255.255.0&lt;br /&gt;
          inet6 addr: fe80::4a5b:39ff:fe3c:5314/64 Scope:Link&lt;br /&gt;
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1&lt;br /&gt;
          RX packets:224261 errors:0 dropped:0 overruns:0 frame:0&lt;br /&gt;
          TX packets:55174 errors:0 dropped:0 overruns:0 carrier:0&lt;br /&gt;
          collisions:0 txqueuelen:1000 &lt;br /&gt;
          RX bytes:319384110 (304.5 MiB)  TX bytes:27348739 (26.0 MiB)&lt;br /&gt;
          Interrupt:225 Base address:0x8000 &lt;br /&gt;
&lt;br /&gt;
eth1      Link encap:Ethernet  HWaddr 00:1B:21:72:9B:5A  &lt;br /&gt;
          inet addr:192.168.2.74  Bcast:192.168.2.255  Mask:255.255.255.0&lt;br /&gt;
          inet6 addr: fe80::21b:21ff:fe72:9b5a/64 Scope:Link&lt;br /&gt;
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1&lt;br /&gt;
          RX packets:2 errors:0 dropped:0 overruns:0 frame:0&lt;br /&gt;
          TX packets:36 errors:0 dropped:0 overruns:0 carrier:0&lt;br /&gt;
          collisions:0 txqueuelen:1000 &lt;br /&gt;
          RX bytes:832 (832.0 b)  TX bytes:6234 (6.0 KiB)&lt;br /&gt;
          Memory:feae0000-feb00000 &lt;br /&gt;
&lt;br /&gt;
eth2      Link encap:Ethernet  HWaddr 00:1B:21:72:96:EA  &lt;br /&gt;
          inet addr:192.168.3.74  Bcast:192.168.3.255  Mask:255.255.255.0&lt;br /&gt;
          inet6 addr: fe80::21b:21ff:fe72:96ea/64 Scope:Link&lt;br /&gt;
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1&lt;br /&gt;
          RX packets:2 errors:0 dropped:0 overruns:0 frame:0&lt;br /&gt;
          TX packets:34 errors:0 dropped:0 overruns:0 carrier:0&lt;br /&gt;
          collisions:0 txqueuelen:1000 &lt;br /&gt;
          RX bytes:818 (818.0 b)  TX bytes:6081 (5.9 KiB)&lt;br /&gt;
          Memory:fe9e0000-fea00000 &lt;br /&gt;
&lt;br /&gt;
lo        Link encap:Local Loopback  &lt;br /&gt;
          inet addr:127.0.0.1  Mask:255.0.0.0&lt;br /&gt;
          inet6 addr: ::1/128 Scope:Host&lt;br /&gt;
          UP LOOPBACK RUNNING  MTU:16436  Metric:1&lt;br /&gt;
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0&lt;br /&gt;
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0&lt;br /&gt;
          collisions:0 txqueuelen:0 &lt;br /&gt;
          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)&lt;br /&gt;
&lt;br /&gt;
virbr0    Link encap:Ethernet  HWaddr 02:23:C8:98:31:17  &lt;br /&gt;
          inet addr:192.168.122.1  Bcast:192.168.122.255  Mask:255.255.255.0&lt;br /&gt;
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1&lt;br /&gt;
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0&lt;br /&gt;
          TX packets:15 errors:0 dropped:0 overruns:0 carrier:0&lt;br /&gt;
          collisions:0 txqueuelen:0 &lt;br /&gt;
          RX bytes:0 (0.0 b)  TX bytes:4013 (3.9 KiB)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the above example, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth0&amp;lt;/span&amp;gt; has a corresponding &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virbr0&amp;lt;/span&amp;gt; bridge having it&#039;s own subnet. In non-clustered systems, this is fine. For our purposes though, it will not do.&lt;br /&gt;
&lt;br /&gt;
=== Removing The qemu virbr0 Bridge ===&lt;br /&gt;
&lt;br /&gt;
By default, [[QEMU]] creates a bridge called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virbr0&amp;lt;/span&amp;gt; designed to connect virtual machines to the first &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth0&amp;lt;/span&amp;gt; interface. Our system will not need this, so we will remove it. This bridge is configured in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/libvirt/qemu/networks/default.xml&amp;lt;/span&amp;gt; file, so to remove this bridge, simply delete the contents of the file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cat /dev/null &amp;gt;/etc/libvirt/qemu/networks/default.xml&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The next time you reboot, that bridge will be gone.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Madi&#039;&#039;&#039;: Put in the command to delete the bridge before a reboot.&lt;br /&gt;
&lt;br /&gt;
=== Create /etc/xen/scripts/an-network-script ===&lt;br /&gt;
&lt;br /&gt;
This script will be used by Xen to turn the dom0 &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ethX&amp;lt;/span&amp;gt; interfaces into bridges. All traffic to the bridge, be it from dom0 or domU VMs, will be routeable out of the corresponding &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;pethX&amp;lt;/span&amp;gt; device. As domU VMs come online, a hotplug script will create virtual interfaces between this new bridge and the domU&#039;s interface(s). Think of the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vifX.Y&amp;lt;/span&amp;gt; devices as being the network cables you&#039;d normally run between a server and a switch.&lt;br /&gt;
&lt;br /&gt;
Before we proceed, please note three things;&lt;br /&gt;
# You don&#039;t need to use the file name &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-network-script&amp;lt;/span&amp;gt;. I suggest this name mainly to keep in line with the rest of the &#039;AN!x&#039; naming used here.&lt;br /&gt;
# If you install &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;convirt&amp;lt;/span&amp;gt; or other hypervisor tools, they will likely create their own bridge script.&lt;br /&gt;
# Adding &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth1&amp;lt;/span&amp;gt; is optional, as we know ahead of time that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth1&amp;lt;/span&amp;gt; will not be made available to any virtual machines as it is dedicated to [[DRBD]]. I&#039;m adding it here because I like having things consistent; Do whichever makes more sense to you.&lt;br /&gt;
&lt;br /&gt;
First, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;touch&amp;lt;/span&amp;gt; the file and then &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;chmod&amp;lt;/span&amp;gt; it to be executable.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
touch /etc/xen/scripts/an-network-script&lt;br /&gt;
chmod 755 /etc/xen/scripts/an-network-script&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now edit it to contain the following:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/xen/scripts/an-network-script&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
dir=$(dirname &amp;quot;$0&amp;quot;)&lt;br /&gt;
&amp;quot;$dir/network-bridge&amp;quot; &amp;quot;$@&amp;quot; vifnum=0 netdev=eth0 bridge=eth0&lt;br /&gt;
&amp;quot;$dir/network-bridge&amp;quot; &amp;quot;$@&amp;quot; vifnum=2 netdev=eth2 bridge=eth2&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now tell Xen to execute that script by editing &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/xen/xend-config.sxp&amp;lt;/span&amp;gt; file and changing the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;network-script&amp;lt;/span&amp;gt; argument to point to this new script (this is line 158 in the default &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xend-config.sxp&amp;lt;/span&amp;gt; script):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/xen/xend-config.sxp&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
#(network-script network-bridge)&lt;br /&gt;
#(network-script /bin/true)&lt;br /&gt;
(network-script an-network-script)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Warning&#039;&#039;&#039;: The next step may trigger fencing of the nodes! As such, be sure that you&#039;re not running anything critical. If unsure, please stop &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt; or reboot the nodes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/cman stop&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now restart &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xend&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/xend restart&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If everything worked, you should now be able to run &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ifconfig&amp;lt;/span&amp;gt; and see that all the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ethX&amp;lt;/span&amp;gt; devices have matching &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;pethX&amp;lt;/span&amp;gt;, virtual and bridge devices.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ifconfig&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
eth0      Link encap:Ethernet  HWaddr 48:5B:39:3C:53:14  &lt;br /&gt;
          inet addr:192.168.1.74  Bcast:192.168.1.255  Mask:255.255.255.0&lt;br /&gt;
          inet6 addr: fe80::4a5b:39ff:fe3c:5314/64 Scope:Link&lt;br /&gt;
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1&lt;br /&gt;
          RX packets:78 errors:0 dropped:0 overruns:0 frame:0&lt;br /&gt;
          TX packets:57 errors:0 dropped:0 overruns:0 carrier:0&lt;br /&gt;
          collisions:0 txqueuelen:0 &lt;br /&gt;
          RX bytes:9796 (9.5 KiB)  TX bytes:12574 (12.2 KiB)&lt;br /&gt;
&lt;br /&gt;
eth1      Link encap:Ethernet  HWaddr 00:1B:21:72:9B:5A  &lt;br /&gt;
          inet addr:192.168.2.74  Bcast:192.168.2.255  Mask:255.255.255.0&lt;br /&gt;
          inet6 addr: fe80::21b:21ff:fe72:9b5a/64 Scope:Link&lt;br /&gt;
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1&lt;br /&gt;
          RX packets:2 errors:0 dropped:0 overruns:0 frame:0&lt;br /&gt;
          TX packets:36 errors:0 dropped:0 overruns:0 carrier:0&lt;br /&gt;
          collisions:0 txqueuelen:1000 &lt;br /&gt;
          RX bytes:832 (832.0 b)  TX bytes:6234 (6.0 KiB)&lt;br /&gt;
          Memory:feae0000-feb00000 &lt;br /&gt;
&lt;br /&gt;
eth2      Link encap:Ethernet  HWaddr 00:1B:21:72:96:EA  &lt;br /&gt;
          inet addr:192.168.3.74  Bcast:192.168.3.255  Mask:255.255.255.0&lt;br /&gt;
          inet6 addr: fe80::21b:21ff:fe72:96ea/64 Scope:Link&lt;br /&gt;
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1&lt;br /&gt;
          RX packets:32 errors:0 dropped:0 overruns:0 frame:0&lt;br /&gt;
          TX packets:29 errors:0 dropped:0 overruns:0 carrier:0&lt;br /&gt;
          collisions:0 txqueuelen:0 &lt;br /&gt;
          RX bytes:5471 (5.3 KiB)  TX bytes:5867 (5.7 KiB)&lt;br /&gt;
&lt;br /&gt;
lo        Link encap:Local Loopback  &lt;br /&gt;
          inet addr:127.0.0.1  Mask:255.0.0.0&lt;br /&gt;
          inet6 addr: ::1/128 Scope:Host&lt;br /&gt;
          UP LOOPBACK RUNNING  MTU:16436  Metric:1&lt;br /&gt;
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0&lt;br /&gt;
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0&lt;br /&gt;
          collisions:0 txqueuelen:0 &lt;br /&gt;
          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)&lt;br /&gt;
&lt;br /&gt;
peth0     Link encap:Ethernet  HWaddr 48:5B:39:3C:53:14  &lt;br /&gt;
          inet6 addr: fe80::4a5b:39ff:fe3c:5314/64 Scope:Link&lt;br /&gt;
          UP BROADCAST RUNNING PROMISC MULTICAST  MTU:1500  Metric:1&lt;br /&gt;
          RX packets:224486 errors:0 dropped:0 overruns:0 frame:0&lt;br /&gt;
          TX packets:55349 errors:0 dropped:0 overruns:0 carrier:0&lt;br /&gt;
          collisions:0 txqueuelen:1000 &lt;br /&gt;
          RX bytes:319406626 (304.6 MiB)  TX bytes:27384681 (26.1 MiB)&lt;br /&gt;
          Interrupt:225 Base address:0x8000 &lt;br /&gt;
&lt;br /&gt;
peth2     Link encap:Ethernet  HWaddr 00:1B:21:72:96:EA  &lt;br /&gt;
          inet6 addr: fe80::21b:21ff:fe72:96ea/64 Scope:Link&lt;br /&gt;
          UP BROADCAST RUNNING PROMISC MULTICAST  MTU:1500  Metric:1&lt;br /&gt;
          RX packets:35 errors:0 dropped:0 overruns:0 frame:0&lt;br /&gt;
          TX packets:70 errors:0 dropped:0 overruns:0 carrier:0&lt;br /&gt;
          collisions:0 txqueuelen:1000 &lt;br /&gt;
          RX bytes:6827 (6.6 KiB)  TX bytes:12470 (12.1 KiB)&lt;br /&gt;
          Memory:fe9e0000-fea00000 &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virbr0&amp;lt;/span&amp;gt; may remain until you reboot your nodes.&lt;br /&gt;
&lt;br /&gt;
If you see something like this, then you are ready to proceed! Now start your cluster back up.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/cman start&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We&#039;re done for now. There is more to do in Xen, but this was all we needed to do in order to proceed with the next several steps. Onces we have the clustered storage online, we&#039;ll come back to Xen for the domU setup.&lt;br /&gt;
&lt;br /&gt;
= Building the DRBD Array =&lt;br /&gt;
&lt;br /&gt;
Building the DRBD array requires a few steps. First, raw space on either node must be prepared. Next, DRBD must be told that it is to create a resource using this newly configured raw space. Finally, the new array must be initialized.&lt;br /&gt;
&lt;br /&gt;
== A Map of the Cluster&#039;s Storage ==&lt;br /&gt;
&lt;br /&gt;
The layout of the storage in the cluster can quickly become difficult to follow. Below is an [[ASCII]] drawing which should help you see how DRBD will tie in to the rest of the cluster&#039;s storage. This map assumes a simple [[TLUG_Talk:_Storage_Technologies_and_Theory#Level_1|RAID level 1]] array underlying each node. If your node has a single hard drive, simply collapse the first two layers into one. Similarly, if your underlying storage is a more complex RAID array, simply expand the number of physical devices at the top level.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
               Node1                                Node2&lt;br /&gt;
           _____   _____                        _____   _____&lt;br /&gt;
          | sda | | sdb |                      | sda | | sdb |&lt;br /&gt;
          |_____| |_____|                      |_____| |_____|&lt;br /&gt;
             |_______|                            |_______|&lt;br /&gt;
     _______ ____|___ _______             _______ ____|___ _______&lt;br /&gt;
  __|__   __|__    __|__   __|__       __|__   __|__    __|__   __|__&lt;br /&gt;
 | md0 | | md1 |  | md2 | | md3 |     | md3 | | md2 |  | md1 | | md0 |&lt;br /&gt;
 |_____| |_____|  |_____| |_____|     |_____| |_____|  |_____| |_____|&lt;br /&gt;
    |       |        |       |           |       |        |       |&lt;br /&gt;
 ___|___   _|_   ____|____   |___________|   ____|____   _|_   ___|___&lt;br /&gt;
| /boot | | / | | &amp;lt;swap&amp;gt;  |        |        | &amp;lt;swap&amp;gt;  | | / | | /boot |&lt;br /&gt;
|_______| |___| |_________|  ______|______  |_________| |___| |_______|&lt;br /&gt;
                            | /dev/drbd0  |&lt;br /&gt;
                            |_____________|&lt;br /&gt;
                                   |&lt;br /&gt;
                               ____|______&lt;br /&gt;
                              | clvm PV   |&lt;br /&gt;
                              |___________|&lt;br /&gt;
                                   |&lt;br /&gt;
                              _____|_____&lt;br /&gt;
                             | drbd0_vg0 |&lt;br /&gt;
                             |___________|&lt;br /&gt;
                                   |&lt;br /&gt;
                              _____|_____ ___...____&lt;br /&gt;
                             |           |          |&lt;br /&gt;
                          ___|___     ___|___    ___|___&lt;br /&gt;
                         | lv_X  |   | lv_Y  |  | lv_N  |&lt;br /&gt;
                         |_______|   |_______|  |_______|&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Install The DRBD Tools ==&lt;br /&gt;
&lt;br /&gt;
DRBD has two components; The actual application and tools and the kernel module. &lt;br /&gt;
&lt;br /&gt;
There are two options for installing the DRBD user-land tools at this point; AN!Cluster-built RPMs or using the ones shipped with Fedora. Regardless of which method you choose, you will need to either install the AN!Cluster DRBD kernel module RPMs or else rebuild the source RPMs referenced.&lt;br /&gt;
&lt;br /&gt;
=== Install The AN!Cluster DRBD User-Land Tools ===&lt;br /&gt;
&lt;br /&gt;
I am currently experimenting with ways to solve a DRBD triggered kernel oops in the Xen pvops 2.6.32 kernel. For this reason, I&#039;ve recompiled the following user-land RPMs under the AN!Cluster variant dom0 kernel RPMs referenced earlier in this paper. If you used the AN! RPMs, then I suggest giving these RPMs a try. However, if you are using myoung&#039;s dom0, I recommend sticking to the Fedora-provided user-land DRBD tools.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum -y install bash-completion heartbeat pacemaker&lt;br /&gt;
cd ~&lt;br /&gt;
wget -c https://alteeve.com/files/an-cluster/drbd-8.3.7-2.fc13.x86_64.rpm&lt;br /&gt;
wget -c https://alteeve.com/files/an-cluster/drbd-utils-8.3.7-2.fc13.x86_64.rpm&lt;br /&gt;
wget -c https://alteeve.com/files/an-cluster/drbd-xen-8.3.7-2.fc13.x86_64.rpm&lt;br /&gt;
wget -c https://alteeve.com/files/an-cluster/drbd-bash-completion-8.3.7-2.fc13.x86_64.rpm&lt;br /&gt;
wget -c https://alteeve.com/files/an-cluster/drbd-udev-8.3.7-2.fc13.x86_64.rpm&lt;br /&gt;
wget -c https://alteeve.com/files/an-cluster/drbd-heartbeat-8.3.7-2.fc13.x86_64.rpm&lt;br /&gt;
wget -c https://alteeve.com/files/an-cluster/drbd-pacemaker-8.3.7-2.fc13.x86_64.rpm&lt;br /&gt;
rpm -ivh drbd*8.3.7-2.fc13.x86_64.rpm&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Install The Stock Fedora DRBD User-Land Tools ===&lt;br /&gt;
&lt;br /&gt;
You will need to install the following tools:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install drbd.x86_64 drbd-xen.x86_64 drbd-utils.x86_64&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Disable heartbeat ===&lt;br /&gt;
&lt;br /&gt;
These packages require that the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;heartbeat&amp;lt;/span&amp;gt; packages be installed. This is for a different cluster platform which we are not using here, so we will disable it from starting with the system.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
chkconfig heartbeat off&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Install The DRBD Kernel Module ==&lt;br /&gt;
&lt;br /&gt;
The kernel module &#039;&#039;&#039;must&#039;&#039;&#039; match the [[dom0]] kernel that is running. If you update the kernel and neglect to update the DRBD kernel module, the DRBD array &#039;&#039;&#039;will not start&#039;&#039;&#039;. &lt;br /&gt;
&lt;br /&gt;
To help simplify things, links to pre-compiled DRBD kernel modules are provided. If the kernel version you have installed doesn&#039;t match your kernel, instructions on recompiling the DRBD kernel module from source RPM is provided as well.&lt;br /&gt;
&lt;br /&gt;
=== Install Pre-Compiled DRBD Kernel Module RPMs ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Warning&#039;&#039;&#039;: The RPM provided here &#039;&#039;&#039;&#039;&#039;will only work&#039;&#039;&#039;&#039;&#039; with the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;kernel-2.6.32.21-168.xendom0_an1.fc13.x86_64.rpm&amp;lt;/span&amp;gt; kernel. If you are using Michael Young&#039;s dom0 kernel, please skip to [[#Building DRBD Kernel Module RPMs From Source|the next section]].&lt;br /&gt;
&lt;br /&gt;
This RPM provides the DRBD kernel module. Note that these RPMs are compiled against the AN!Cluster variant of myoung&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;2.6.32.21_168&amp;lt;/span&amp;gt; dom0 kernel.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cd ~&lt;br /&gt;
wget -c https://alteeve.com/files/an-cluster/drbd-km-2.6.32.23_170.dom0_an1.fc13.x86_64-8.3.7-12.fc13.x86_64.rpm&lt;br /&gt;
rpm -ivh drbd-km-2.6.32.23_170.dom0_an1.fc13.x86_64-8.3.7-12.fc13.x86_64.rpm&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you would like to install the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;debuginfo&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cd ~&lt;br /&gt;
wget -c https://alteeve.com/files/an-cluster/drbd-km-debuginfo-8.3.7-12.fc13.x86_64.rpm&lt;br /&gt;
rpm -ivh drbd-km-debuginfo-8.3.7-12.fc13.x86_64.rpm&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Building DRBD Kernel Module RPMs From Source ===&lt;br /&gt;
&lt;br /&gt;
If the above RPMs don&#039;t work or if the dom0 kernel you are using in any way differs, please follow the steps here to create a DRBD kernel module matched to your running dom0.&lt;br /&gt;
&lt;br /&gt;
First, install the build environment.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum -y groupinstall &amp;quot;Development Libraries&amp;quot;&lt;br /&gt;
yum -y groupinstall &amp;quot;Development Tools&amp;quot;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Install the kernel headers and development library for the dom0 kernel:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: The following commands use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--force&amp;lt;/span&amp;gt; to get past the fact that the headers for the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;2.6.33&amp;lt;/span&amp;gt; are already installed, thus making RPM think that these are too old and will conflict. Please proceed with caution.&lt;br /&gt;
&lt;br /&gt;
* If you are using Michael Young&#039;s kernel:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cd ~&lt;br /&gt;
wget -c http://fedorapeople.org/~myoung/dom0/x86_64/kernel-headers-2.6.32.21-170.xendom0.fc12.x86_64.rpm&lt;br /&gt;
wget -c http://fedorapeople.org/~myoung/dom0/x86_64/kernel-devel-2.6.32.21-170.xendom0.fc12.x86_64.rpm&lt;br /&gt;
rpm -ivh --force kernel*2.6.32.21-170.xendom0.fc12.x86_64.rpm&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* If you are using the AN!Cluster dom0 kernel:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
wget -c https://alteeve.com/files/an-cluster/kernel-devel-2.6.32.23-170.dom0_an1.fc13.x86_64.rpm&lt;br /&gt;
wget -c https://alteeve.com/files/an-cluster/kernel-headers-2.6.32.23-170.dom0_an1.fc13.x86_64.rpm&lt;br /&gt;
rpm -ivh --force kernel-devel-2.6.32.23-170.dom0_an1.fc13.x86_64.rpm kernel-headers-2.6.32.23-170.dom0_an1.fc13.x86_64.rpm&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now you need to download, prepare, build and install the source RPM.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
rpm -ivh http://fedora.mirror.iweb.ca/releases/13/Everything/source/SRPMS/drbd-8.3.7-2.fc13.src.rpm&lt;br /&gt;
cd /root/rpmbuild/SPECS/&lt;br /&gt;
rpmbuild -bp drbd.spec &lt;br /&gt;
cd /root/rpmbuild/BUILD/drbd-8.3.7/&lt;br /&gt;
./configure --enable-spec --with-km&lt;br /&gt;
cp /root/rpmbuild/BUILD/drbd-8.3.7/drbd-km.spec /root/rpmbuild/SPECS/&lt;br /&gt;
cd /root/rpmbuild/SPECS/&lt;br /&gt;
rpmbuild -ba drbd-km.spec&lt;br /&gt;
cd /root/rpmbuild/RPMS/x86_64&lt;br /&gt;
rpm -Uvh drbd-km-*&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This may be needed if &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;drbd-utils&amp;lt;/span&amp;gt;, the user-land DRBD tools, is listed as a requirement when trying to install the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;drbd-km*&amp;lt;/span&amp;gt; RPMs. This step will build all of the DRBD tools RPMs.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install bash-completion heartbeat pacemaker&lt;br /&gt;
cd /root/rpmbuild/SPECS/&lt;br /&gt;
rpmbuild -ba drbd.spec &lt;br /&gt;
cd ~/rpmbuild/RPMS/x86_64/&lt;br /&gt;
rpm -Uvh drbd-*&lt;br /&gt;
chkconfig off heartbeat&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You should be good to go now!&lt;br /&gt;
&lt;br /&gt;
== Allocating Raw Space For DRBD On Each Node ==&lt;br /&gt;
&lt;br /&gt;
If you followed the setup steps provided for in &amp;quot;[[Two Node Fedora 13 Cluster]]&amp;quot;, you will have a set amount of unconfigured hard drive space. This is what we will use for the DRBD space on either node. If you&#039;ve got a different setup, you will need to allocate some raw space before proceeding.&lt;br /&gt;
&lt;br /&gt;
=== Create a Simple Partition ===&lt;br /&gt;
&lt;br /&gt;
If you do not have two drives, please follow the next section&#039;s steps, but pay attention to the &amp;quot;&#039;&#039;&#039;note&#039;&#039;&#039;&amp;quot;s. In short, you will need to create one partition, leave the default type of the partition as &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;83&amp;lt;/span&amp;gt;, write the changes to disk and the proceed to the [[#DRBD Configuration Files|DRBD Configuration Files]] section.&lt;br /&gt;
&lt;br /&gt;
=== Creating a RAID level 1 &#039;md&#039; Device ===&lt;br /&gt;
&lt;br /&gt;
This assumes that you have two raw drives, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/sda&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/sdb&amp;lt;/span&amp;gt;. It further assumes that you&#039;ve created three partitions which have been assigned to three existing &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/mdX&amp;lt;/span&amp;gt; devices. With these assumptions, we will create &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/sda4&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/sdb4&amp;lt;/span&amp;gt; and, using them, create a new &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/md3&amp;lt;/span&amp;gt; device that will host the DRBD partition.&lt;br /&gt;
&lt;br /&gt;
If you have multiple drives and plan to use a different [[TLUG_Talk:_Storage_Technologies_and_Theory#RAID_Levels|RAID levels]], please adjust the follow commands accordingly.&lt;br /&gt;
&lt;br /&gt;
==== Creating The New Partitions ====&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Warning&#039;&#039;&#039;: The next steps will have you directly accessing your server&#039;s hard drive configuration. Please do not proceed on a live server until you&#039;ve had a chance to work through these steps on a test server. One mistake can &#039;&#039;&#039;&#039;&#039;blow away all your data&#039;&#039;&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Start the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fdisk&amp;lt;/span&amp;gt; shell for the first hard drive; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/sda&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
fdisk /dev/sda&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
WARNING: DOS-compatible mode is deprecated. It&#039;s strongly recommended to&lt;br /&gt;
         switch off the mode (command &#039;c&#039;) and change display units to&lt;br /&gt;
         sectors (command &#039;u&#039;).&lt;br /&gt;
&lt;br /&gt;
Command (m for help): &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: Depending on your configuration, you may not see the above warning or you may see a different warning. Note it, but it is likely nothing to worry about it.&lt;br /&gt;
&lt;br /&gt;
View the current configuration with the &#039;&#039;&#039;p&#039;&#039;&#039;rint option&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
p&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Disk /dev/sda: 500.1 GB, 500107862016 bytes&lt;br /&gt;
255 heads, 63 sectors/track, 60801 cylinders&lt;br /&gt;
Units = cylinders of 16065 * 512 = 8225280 bytes&lt;br /&gt;
Sector size (logical/physical): 512 bytes / 512 bytes&lt;br /&gt;
I/O size (minimum/optimal): 512 bytes / 512 bytes&lt;br /&gt;
Disk identifier: 0x000c6fe1&lt;br /&gt;
&lt;br /&gt;
   Device Boot      Start         End      Blocks   Id  System&lt;br /&gt;
/dev/sda1               1        5100    40960000   fd  Linux raid autodetect&lt;br /&gt;
/dev/sda2            5100        5622     4194304   fd  Linux raid autodetect&lt;br /&gt;
/dev/sda3   *        5622        5654      256000   fd  Linux raid autodetect&lt;br /&gt;
&lt;br /&gt;
Command (m for help): &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we know for sure that the next free partition number is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;4&amp;lt;/span&amp;gt;. We will now create the &#039;&#039;&#039;n&#039;&#039;&#039;ew partition.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
n&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Command action&lt;br /&gt;
   e   extended&lt;br /&gt;
   p   primary partition (1-4)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We will make it a &#039;&#039;&#039;p&#039;&#039;&#039;rimary partition&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
p&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Selected partition 4&lt;br /&gt;
First cylinder (5654-60801, default 5654): &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then we simply hit &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;enter&amp;gt;&amp;lt;/span&amp;gt; to select the default starting block.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;enter&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Using default value 5654&lt;br /&gt;
Last cylinder, +cylinders or +size{K,M,G} (5654-60801, default 60801): &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once again we will press &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;enter&amp;gt;&amp;lt;/span&amp;gt; to select the default ending block.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;enter&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Using default value 60801&lt;br /&gt;
&lt;br /&gt;
Command (m for help): &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: If you only have one drive and are not creating a [[RAID]] array, you do not to change the type of the partition so you can skip the next few steps. Continue at the step where you write the changes.&lt;br /&gt;
&lt;br /&gt;
Now we need to change the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;t&amp;lt;/span&amp;gt;ype of partition that it is.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
t&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Partition number (1-4): &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We know that we are modifying partition number &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;4&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
4&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Hex code (type L to list codes): &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we need to set the [[hex]] code for the [[Filesystem_List#List_of_Linux_Partition_Types|partition type]] to set. We want to set &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fd&amp;lt;/span&amp;gt;, which defines &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Linux raid autodetect&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
fd&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Changed system type of partition 4 to fd (Linux raid autodetect)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now check that everything went as expected by once again &#039;&#039;&#039;p&#039;&#039;&#039;rinting the partition table.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
p&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Disk /dev/sda: 500.1 GB, 500107862016 bytes&lt;br /&gt;
255 heads, 63 sectors/track, 60801 cylinders&lt;br /&gt;
Units = cylinders of 16065 * 512 = 8225280 bytes&lt;br /&gt;
Sector size (logical/physical): 512 bytes / 512 bytes&lt;br /&gt;
I/O size (minimum/optimal): 512 bytes / 512 bytes&lt;br /&gt;
Disk identifier: 0x000c6fe1&lt;br /&gt;
&lt;br /&gt;
   Device Boot      Start         End      Blocks   Id  System&lt;br /&gt;
/dev/sda1               1        5100    40960000   fd  Linux raid autodetect&lt;br /&gt;
/dev/sda2            5100        5622     4194304   fd  Linux raid autodetect&lt;br /&gt;
/dev/sda3   *        5622        5654      256000   fd  Linux raid autodetect&lt;br /&gt;
/dev/sda4            5654       60801   442972704+  fd  Linux raid autodetect&lt;br /&gt;
&lt;br /&gt;
Command (m for help): &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: If you only have one drive, your partitions will be &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;83  Linux&amp;lt;/span&amp;gt; or &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;82  Linux swap / Solaris&amp;lt;/span&amp;gt;, instead of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fd  Linux raid autodetect&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
There it is. So finally, we need to &#039;&#039;&#039;w&#039;&#039;&#039;rite the changes to the disk.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
w&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
The partition table has been altered!&lt;br /&gt;
&lt;br /&gt;
Calling ioctl() to re-read partition table.&lt;br /&gt;
&lt;br /&gt;
WARNING: Re-reading the partition table failed with error 16: Device or resource busy.&lt;br /&gt;
The kernel still uses the old table. The new table will be used at&lt;br /&gt;
the next reboot or after you run partprobe(8) or kpartx(8)&lt;br /&gt;
Syncing disks.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: If you only have one drive, reboot now if you got the message above and then skip forward to the &amp;quot;[[#DRBD Configuration Files|DRBD Configuration Files]]&amp;quot; section.&lt;br /&gt;
&lt;br /&gt;
If you see the above message, &#039;&#039;&#039;do not&#039;&#039;&#039; reboot yet. repeat these steps for the second drive, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/sdb&amp;lt;/span&amp;gt;, and then reboot.&lt;br /&gt;
&lt;br /&gt;
==== Creating The New /dev/mdX Device ====&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;If you only have one drive, skip this step.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Now we need to use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;mdadm&amp;lt;/span&amp;gt; to create the new [[TLUG_Talk:_Storage_Technologies_and_Theory#Level_1|RAID level 1]] device. This will be used as the device that DRBD will directly access.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
mdadm --create /dev/md3 --homehost=localhost.localdomain --raid-devices=2 --level=1 /dev/sda4 /dev/sdb4&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
mdadm: Note: this array has metadata at the start and&lt;br /&gt;
    may not be suitable as a boot device.  If you plan to&lt;br /&gt;
    store &#039;/boot&#039; on this device please ensure that&lt;br /&gt;
    your boot-loader understands md/v1.x metadata, or use&lt;br /&gt;
    --metadata=0.90&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Seeing as &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/boot&amp;lt;/span&amp;gt; doesn&#039;t exist on this device, we can safely ignore this warning.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
y&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
mdadm: Defaulting to version 1.2 metadata&lt;br /&gt;
mdadm: array /dev/md/md4 started.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can now &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cat /proc/mdstat&amp;lt;/span&amp;gt; to verify that it indeed built. If you&#039;re interested, you could open a new terminal window and use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;watch cat /proc/mdstat&amp;lt;/span&amp;gt; and watch the array build.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cat /proc/mdstat&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
md3 : active raid1 sdb4[1] sda4[0]&lt;br /&gt;
      442971544 blocks super 1.2 [2/2] [UU]&lt;br /&gt;
      [&amp;gt;....................]  resync =  0.8% (3678976/442971544) finish=111.0min speed=65920K/sec&lt;br /&gt;
      &lt;br /&gt;
md2 : active raid1 sda2[0] sdb2[1]&lt;br /&gt;
      4193272 blocks super 1.1 [2/2] [UU]&lt;br /&gt;
      &lt;br /&gt;
md1 : active raid1 sda1[0] sdb1[1]&lt;br /&gt;
      40958908 blocks super 1.1 [2/2] [UU]&lt;br /&gt;
      bitmap: 1/1 pages [4KB], 65536KB chunk&lt;br /&gt;
&lt;br /&gt;
md0 : active raid1 sda3[0] sdb3[1]&lt;br /&gt;
      255988 blocks super 1.0 [2/2] [UU]&lt;br /&gt;
      &lt;br /&gt;
unused devices: &amp;lt;none&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Finally, we need to make sure that the new array will start when the system boots. To do this, we&#039;ll again use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;mdadm&amp;lt;/span&amp;gt;, but with different options that will have it output data in a format suitable for the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/mdadm.conf&amp;lt;/span&amp;gt; file. We&#039;ll redirect this output to that config file, thus updating it.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
mdadm --detail --scan | grep md3 &amp;gt;&amp;gt; /etc/mdadm.conf&lt;br /&gt;
cat /etc/mdadm.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
# mdadm.conf written out by anaconda&lt;br /&gt;
MAILADDR root&lt;br /&gt;
AUTO +imsm +1.x -all&lt;br /&gt;
ARRAY /dev/md0 level=raid1 num-devices=2 UUID=b58df6d0:d925e7bb:c156168d:47c01718&lt;br /&gt;
ARRAY /dev/md1 level=raid1 num-devices=2 UUID=ac2cf39c:77cd0314:fedb8407:9b945bb5&lt;br /&gt;
ARRAY /dev/md2 level=raid1 num-devices=2 UUID=4e513936:4a966f4e:0dd8402e:6403d10d&lt;br /&gt;
ARRAY /dev/md3 metadata=1.2 name=localhost.localdomain:3 UUID=f0b6d0c1:490d47e7:91c7e63a:f8dacc21&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You&#039;ll note that the last line, which we just added, is different from the previous lines. This isn&#039;t a concern, but you are welcome to re-write it to match the existing format if you wish.&lt;br /&gt;
&lt;br /&gt;
Before you proceed, it is strongly advised that you reboot each node and then verify that the new array did in fact start with the system. You &#039;&#039;do not&#039;&#039; need to wait for the sync to finish before rebooting. It will pick up where you left off once rebooted.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: You&#039;ll notice we did not format a file system on this raid array, this is intentional. DRBD use the raw device and does not need a file system on it.&lt;br /&gt;
&lt;br /&gt;
== DRBD Configuration Files ==&lt;br /&gt;
&lt;br /&gt;
DRBD uses a global configuration file, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/drbd.d/global_common.conf&amp;lt;/span&amp;gt;, and one or more resource files. The resource files need to be created in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/drbd.d/&amp;lt;/span&amp;gt; directory and must have the suffix &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;.res&amp;lt;/span&amp;gt;. For this example, we will create a single resource called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;r0&amp;lt;/span&amp;gt; which we will configure in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/drbd.d/r0.res&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== /etc/drbd.d/global_common.conf ===&lt;br /&gt;
&lt;br /&gt;
The stock &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/drbd.d/global_common.conf&amp;lt;/span&amp;gt; is sane, so we won&#039;t bother altering it here.&lt;br /&gt;
&lt;br /&gt;
Full details on all the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;drbd.conf&amp;lt;/span&amp;gt; configuration file directives and arguments can be found [http://www.drbd.org/users-guide/re-drbdconf.html here]. &#039;&#039;&#039;Note&#039;&#039;&#039;: That link doesn&#039;t show this new configuration format. Please see [http://www.novell.com/documentation/sle_ha/book_sleha/?page=/documentation/sle_ha/book_sleha/data/sec_ha_drbd_configure.html Novell&#039;s] link.&lt;br /&gt;
&lt;br /&gt;
=== /etc/drbd.d/r0.res ===&lt;br /&gt;
&lt;br /&gt;
This is the important part. This defines the resource to use, and must reflect the IP addresses and storage devices that DRBD will use for this resource.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/drbd.d/r0.res&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# This is the name of the resource and it&#039;s settings. Generally, &#039;r0&#039; is used&lt;br /&gt;
# as the name of the first resource. This is by convention only, though.&lt;br /&gt;
resource r0&lt;br /&gt;
{&lt;br /&gt;
        # This tells DRBD where to make the new resource available at on each&lt;br /&gt;
        # node. This is, again, by convention only.&lt;br /&gt;
        device    /dev/drbd0;&lt;br /&gt;
&lt;br /&gt;
        # The main argument here tells DRBD that we will have proper locking &lt;br /&gt;
        # and fencing, and as such, to allow both nodes to set the resource to&lt;br /&gt;
        # &#039;primary&#039; simultaneously.&lt;br /&gt;
        net&lt;br /&gt;
        {&lt;br /&gt;
                allow-two-primaries;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        # This tells DRBD to automatically set both nodes to &#039;primary&#039; when the&lt;br /&gt;
        # nodes start.&lt;br /&gt;
        startup&lt;br /&gt;
        {&lt;br /&gt;
                become-primary-on both;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        # This tells DRBD to look for and store it&#039;s meta-data on the resource&lt;br /&gt;
        # itself.&lt;br /&gt;
        meta-disk       internal;&lt;br /&gt;
&lt;br /&gt;
        # The name below must match the output from `uname -n` on each node.&lt;br /&gt;
        on an-node01.alteeve.com&lt;br /&gt;
        {&lt;br /&gt;
                # This must be the IP address of the interface on the storage &lt;br /&gt;
                # network (an-node01.sn, in this case).&lt;br /&gt;
                address         192.168.2.71:7789;&lt;br /&gt;
&lt;br /&gt;
                # This is the underlying partition to use for this resource on &lt;br /&gt;
                # this node.&lt;br /&gt;
                disk            /dev/md3;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        # Repeat as above, but for the other node.&lt;br /&gt;
        on an-node02.alteeve.com&lt;br /&gt;
        {&lt;br /&gt;
                address         192.168.2.72:7789;&lt;br /&gt;
                disk            /dev/md3;&lt;br /&gt;
        }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This file must be copied to &#039;&#039;&#039;BOTH&#039;&#039;&#039; nodes and must match before you proceed.&lt;br /&gt;
&lt;br /&gt;
== Starting The DRBD Resource ==&lt;br /&gt;
&lt;br /&gt;
From the rest of this section, pay attention to whether you see&lt;br /&gt;
* &#039;&#039;&#039;Node1&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Node2&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Both&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
These indicate which node to run the following commands on. There is no functional difference between either node, so just randomly choose one to be &#039;&#039;&#039;Node1&#039;&#039;&#039; and the other will be &#039;&#039;&#039;Node2&#039;&#039;&#039;. Once you&#039;ve chosen which is which, be consistent with which node you run the commands on. Of course, if a command block is proceeded by &#039;&#039;&#039;Both&#039;&#039;&#039;, run the following code block on both nodes.&lt;br /&gt;
&lt;br /&gt;
=== Loading the &#039;drbd&#039; Module ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Both&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Normally, we&#039;d load the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;drbd&amp;lt;/span&amp;gt; module by simply starting the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/init.d/drbd&amp;lt;/span&amp;gt; daemon. However, if we did that at this stage, we&#039;d generate errors because there isn&#039;t an &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;UpToDate&amp;lt;/span&amp;gt; disk in the array. To get around this, we&#039;ll manually load the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;drbd&amp;lt;/span&amp;gt; kernel module using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;modprobe&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
modprobe drbd&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This won&#039;t return any output, but if you check, you should now see the special &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/proc/drbd&amp;lt;/span&amp;gt; file.&lt;br /&gt;
&lt;br /&gt;
=== Monitoring Progress ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Both&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
I find it very useful to monitor DRBD while running the rest of the setup. To do this, open a second terminal on each node and use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;watch&amp;lt;/span&amp;gt; to keep an eye on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/proc/drbd&amp;lt;/span&amp;gt;. This way you will be able to monitor the progress of the array in near-real time.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Both&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
watch cat /proc/drbd&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At this stage, it should look like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
version: 8.3.7 (api:88/proto:86-91)&lt;br /&gt;
GIT-hash: ea9e28dbff98e331a62bcbcc63a6135808fe2917 build by root@xenmaster002.iplink.net, 2010-09-07 16:02:46&lt;br /&gt;
 0: cs:Unconfigured&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Initialize The Resource ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Both&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This step creates the DRBD meta-data on the new DRBD resource&#039;s backing devices. It is only needed when creating new DRBD partitions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
drbdadm create-md r0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
  --==  Thank you for participating in the global usage survey  ==--&lt;br /&gt;
The server&#039;s response is:&lt;br /&gt;
&lt;br /&gt;
you are the 9507th user to install this version&lt;br /&gt;
Writing meta data...&lt;br /&gt;
initializing activity log&lt;br /&gt;
NOT initialized bitmap&lt;br /&gt;
New drbd meta data block successfully created.&lt;br /&gt;
success&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/proc/drbd&amp;lt;/span&amp;gt; output should not have changed at this stage.&lt;br /&gt;
&lt;br /&gt;
=== Starting the Resource ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Both&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This will attach the backing device, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/md3&amp;lt;/span&amp;gt; in our case, and then start the new resource &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;r0&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
drbdadm up r0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There will be no output at the command line. If you are &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;watch&amp;lt;/span&amp;gt;ing &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/proc/drbd&amp;lt;/span&amp;gt; though, you should now see something like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
version: 8.3.7 (api:88/proto:86-91)&lt;br /&gt;
GIT-hash: ea9e28dbff98e331a62bcbcc63a6135808fe2917 build by root@xenmaster002.iplink.net, 2010-09-07 16:02:46&lt;br /&gt;
 0: cs:Connected ro:Secondary/Secondary ds:Inconsistent/Inconsistent C r----&lt;br /&gt;
    ns:0 nr:0 dw:0 dr:0 al:0 bm:0 lo:0 pe:0 ua:0 ap:0 ep:1 wo:b oos:442957988&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
That it is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Secondary/Secondary&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Inconsistent/Inconsistent&amp;lt;/span&amp;gt; is expected.&lt;br /&gt;
&lt;br /&gt;
=== Setting the First Primary Node ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Node1&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
As this is a totally new resource, DRBD doesn&#039;t know which side of the array is &amp;quot;more valid&amp;quot; than the other. In reality, neither is as there was no existing data of note on either node. This means that we now need to choose a node and tell DRBD to treat it as the &amp;quot;source&amp;quot; node. This step will also tell DRBD to make the &amp;quot;source&amp;quot; node &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;primary&amp;lt;/span&amp;gt;. Once set, DRBD will begin &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;sync&amp;lt;/span&amp;gt;&#039;ing in the background. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
drbdadm -- --overwrite-data-of-peer primary r0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As before, there will be no output at the command line, but &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/proc/drbd&amp;lt;/span&amp;gt; will change to show the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
GIT-hash: ea9e28dbff98e331a62bcbcc63a6135808fe2917 build by root@xenmaster002.iplink.net, 2010-09-07 16:02:46&lt;br /&gt;
 0: cs:SyncSource ro:Primary/Secondary ds:UpToDate/Inconsistent C r----&lt;br /&gt;
    ns:69024 nr:0 dw:0 dr:69232 al:0 bm:4 lo:0 pe:0 ua:0 ap:0 ep:1 wo:b oos:442888964&lt;br /&gt;
        [&amp;gt;....................] sync&#039;ed:  0.1% (432508/432576)M&lt;br /&gt;
        finish: 307:33:42 speed: 320 (320) K/sec&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you&#039;re watching the secondary node, the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/proc/drbd&amp;lt;/span&amp;gt; will show &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ro:Secondary/Primary ds:Inconsistent/UpToDate&amp;lt;/span&amp;gt;. This is, as you can guess, simply a reflection of it being the &amp;quot;over-written&amp;quot; node.&lt;br /&gt;
&lt;br /&gt;
=== Setting the Second Node to Primary ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Node2&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The last step to complete the array is to tell the second node to also become &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;primary&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
drbdadm primary r0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As with many &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;drbdadm&amp;lt;/span&amp;gt; commands, nothing will be printed to the console. If you&#039;re watching the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/proc/drbd&amp;lt;/span&amp;gt; though, you should see something like &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Primary/Primary ds:UpToDate/Inconsistent&amp;lt;/span&amp;gt;. The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Inconsistent&amp;lt;/span&amp;gt; flag will remain until the sync is complete.&lt;br /&gt;
&lt;br /&gt;
=== A Note On sync Speed ===&lt;br /&gt;
&lt;br /&gt;
You will notice in the previous step that the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;sync&amp;lt;/span&amp;gt; speed seems awfully slow at &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;320 (320) K/sec&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;This is not a problem!&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
As actual data is written to either side of the array, that data will be immediately copied to both nodes. As such, both nodes will always contain up to date copies of the real data. Given this, the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;syncer&amp;lt;/span&amp;gt; is intentionally set low so as to not put too much load on the underlying disks that could cause slow downs. If you still wish to increase the sync speed, you can do so with the following command.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Warning&#039;&#039;&#039;: If you set the DRBD sync speed too high and saturate your disks&#039; maximum write speed, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clvmd&amp;lt;/span&amp;gt; daemon will likely fail to start in some cases, leading to fences. For this reason, keep your sync rate to about 2/3rds of the underlying disk maximum write speed and hold off on bumping up the sync speed until you know you will have a period of low activity on your cluster.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
drbdsetup /dev/drbd0 syncer -r 35M&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The speed-up will not be instant. It will take a little while for the speed to pick up. Once the sync is finished, it is a good idea to revert to the default sync rate.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
drbdadm syncer r0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Setting Up CLVM =&lt;br /&gt;
&lt;br /&gt;
The goal of DRBD in the cluster is to provide clustered [[LVM]], referred to as [[CLVM]] to the nodes. This is done by turning the DRBD partition into an CLVM physical volume.&lt;br /&gt;
&lt;br /&gt;
So now we will create a [[PV]] on top of the new [[DRBD]] partition, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/drbd0&amp;lt;/span&amp;gt;, that we created in the previous step. Since this new LVM [[PV]] will exist on top of the shared DRBD partition, whatever get written to it&#039;s logical volumes will be immediately available on either node, regardless of which node actually initiated the write.&lt;br /&gt;
&lt;br /&gt;
This capability is the underlying reason for creating this cluster; Neither machine is truly needed so if one machine dies, anything on top of the DRBD partition will still be available. When the failed machine returns, the surviving node will have a list of what blocks changed while the other node was gone and can use this list to quickly re-sync the other server.&lt;br /&gt;
&lt;br /&gt;
== Making LVM Cluster-Aware ==&lt;br /&gt;
&lt;br /&gt;
Normally, LVM is run on a single server. This means that at any time, the LVM can write data to the underlying drive and not need to worry if any other device might change anything. In clusters, this isn&#039;t the case. The other node could try to write to the shared storage, so then nodes need to enable &amp;quot;locking&amp;quot; to prevent the two nodes from trying to work on the same bit of data at the same time. &lt;br /&gt;
&lt;br /&gt;
The process of enabling this locking is known as making LVM &amp;quot;cluster-aware&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
LVM has tool called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;lvmconf&amp;lt;/span&amp;gt; that can be used to enable LVM locking. This is provided as part of the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;lvm2-cluster&amp;lt;/span&amp;gt; package.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum -y install lvm2-cluster.x86_64&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now to enable cluster awareness in LVM, run to following command.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
lvmconf --enable-cluster&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
By default, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clvmd&amp;lt;/span&amp;gt;, the cluster lvm daemon, is stopped and not set to run on boot. Now that we&#039;ve enabled LVM locking, we need to start it:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/clvmd status&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
clvmd is stopped&lt;br /&gt;
active volumes: (none)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As expected, it is stopped, so lets start it:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: At this point cman is still set to not start a boot. Since we rebooted after creating the partitions that make up /dev/md3, cman will likely, and in my case was still off. clvmd will fail to start because the cluster manager (cman) is not started. --[[User:SRSullivan|SRSullivan]] 17:40, 18 October 2010 (UTC)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/clvmd start&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Activating VGs:   No volume groups found&lt;br /&gt;
                                                           [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: I&#039;ve seen on a few occasions where starting &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clvmd&amp;lt;/span&amp;gt; will time out and, on occasion, fences will be issued. I&#039;ve not sorted out why, but I have usually been able to resolve this by stopping &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clvmd&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt;, then restarting &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt; and, finally, restarting &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clvmd&amp;lt;/span&amp;gt;. If I can sort out a way to reliably trigger this problem, I will submit a bug report.&lt;br /&gt;
&lt;br /&gt;
== Filtering Out Devices ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;ToDo&#039;&#039;&#039;: Find a less-aggressive filter.&lt;br /&gt;
&lt;br /&gt;
With the stock &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/lvm/lvm.conf&amp;lt;/span&amp;gt; configuration, all devices on the system will be checked for LVM volumes. This can cause a problem as LVM will give preference to the LVM data on the RAID device over the DRBD device. It sees a duplicate as both are, effectively, one and the same.&lt;br /&gt;
&lt;br /&gt;
To work around this, we need to alter the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;filter = []&amp;lt;/span&amp;gt; entry. At the time of writing, simply rejecting the underlying &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/md3&amp;lt;/span&amp;gt; device as a candidate wasn&#039;t enough. So for now, we will tell LVM to accept DRBD devices and reject all other devices. To do this, we&#039;ll insert &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;quot;a|/dev/drbd*|&amp;quot;&amp;lt;/span&amp;gt; as the first array entry and change the existing entry to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;quot;r/.*/&amp;quot;&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: I would love feedback on a filter argument that successfully ignored just &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/md3&amp;lt;/span&amp;gt;, if anyone can suggest one.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/lvm/lvm.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
    # By default we accept every block device:&lt;br /&gt;
    #filter = [ &amp;quot;a/.*/&amp;quot; ]&lt;br /&gt;
    filter = [ &amp;quot;a|/dev/drbd*|&amp;quot;, &amp;quot;r/.*/&amp;quot; ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now delete the existing cache file so that LVM is forced to rescan the system.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
rm -f /etc/lvm/cache/.cache&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The changes take effect immediately.&lt;br /&gt;
&lt;br /&gt;
== Creating a new PV using the DRBD Partition ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Node1&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
We can now proceed with setting up the new DRBD-based LVM physical volume. Once the PV is created, we can create a new volume group and start allocating space to logical volumes.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: As we will be using our DRBD device, and as it is a shared block device, most of the following commands only need to be run on one node. Once the block device changes in any way, those changes will near-instantly appear on the other node. For this reason, unless explicitly stated to do so, only run the following commands on one node.&lt;br /&gt;
&lt;br /&gt;
To setup the DRBD partition as an LVM PV, run &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;pvcreate&amp;lt;/span&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
pvcreate /dev/drbd0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
  Physical volume &amp;quot;/dev/drbd0&amp;quot; successfully created&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Both&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Now, on both nodes, check that the new physical volume is visible by using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;pvdisplay&amp;lt;/span&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
pvdisplay&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;quot;/dev/drbd0&amp;quot; is a new physical volume of &amp;quot;422.44 GiB&amp;quot;&lt;br /&gt;
  --- NEW Physical volume ---&lt;br /&gt;
  PV Name               /dev/drbd0&lt;br /&gt;
  VG Name               &lt;br /&gt;
  PV Size               422.44 GiB&lt;br /&gt;
  Allocatable           NO&lt;br /&gt;
  PE Size               0   &lt;br /&gt;
  Total PE              0&lt;br /&gt;
  Free PE               0&lt;br /&gt;
  Allocated PE          0&lt;br /&gt;
  PV UUID               YHmdip-SuJN-KIEv-2tbK-BT9Q-wfOo-OuQuaW&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you see &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;PV Name /dev/drbd0&amp;lt;/span&amp;gt; (or your underlying partition) on both nodes, then your DRBD setup and LVM configuration changes are working perfectly!&lt;br /&gt;
&lt;br /&gt;
== Creating a VG on the new PV ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Node1&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Now we need to create the volume group using the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vgcreate&amp;lt;/span&amp;gt; command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vgcreate -c y drbd0_vg0 /dev/drbd0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
  Clustered volume group &amp;quot;drbd0_vg0&amp;quot; successfully created&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Both&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Now we&#039;ll check that the new VG is visible on both nodes using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vgdisplay&amp;lt;/span&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vgdisplay&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
  --- Volume group ---&lt;br /&gt;
  VG Name               drbd0_vg0&lt;br /&gt;
  System ID             &lt;br /&gt;
  Format                lvm2&lt;br /&gt;
  Metadata Areas        1&lt;br /&gt;
  Metadata Sequence No  1&lt;br /&gt;
  VG Access             read/write&lt;br /&gt;
  VG Status             resizable&lt;br /&gt;
  Clustered             yes&lt;br /&gt;
  Shared                no&lt;br /&gt;
  MAX LV                0&lt;br /&gt;
  Cur LV                0&lt;br /&gt;
  Open LV               0&lt;br /&gt;
  Max PV                0&lt;br /&gt;
  Cur PV                1&lt;br /&gt;
  Act PV                1&lt;br /&gt;
  VG Size               422.43 GiB&lt;br /&gt;
  PE Size               4.00 MiB&lt;br /&gt;
  Total PE              108143&lt;br /&gt;
  Alloc PE / Size       0 / 0   &lt;br /&gt;
  Free  PE / Size       108143 / 422.43 GiB&lt;br /&gt;
  VG UUID               Bb8l9e-es2z-PhaF-Gg3o-2is2-DZ1S-V2RsBF&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the new VG is visible on both nodes, we are ready to create our first logical volume using the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;lvcreate&amp;lt;/span&amp;gt; tool.&lt;br /&gt;
&lt;br /&gt;
== Creating the First LV on the new VG ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Node1&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Now we&#039;ll create a simple 20 GiB logical volumes. We will use it as a shared GFS2 store for shared files and to store our Xen domU config files later on.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
lvcreate -L 20G -n xen_shared drbd0_vg0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
  Logical volume &amp;quot;xen_shared&amp;quot; created&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Both&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
As before, we will check that the new logical volume is visible from both nodes by using the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;lvdisplay&amp;lt;/span&amp;gt; command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
lvdisplay&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
  --- Logical volume ---&lt;br /&gt;
  LV Name                /dev/drbd0_vg0/xen_shared&lt;br /&gt;
  VG Name                drbd0_vg0&lt;br /&gt;
  LV UUID                AqQizc-KBpX-2scN-WFLb-jIeF-QDcM-PlQW84&lt;br /&gt;
  LV Write Access        read/write&lt;br /&gt;
  LV Status              available&lt;br /&gt;
  # open                 0&lt;br /&gt;
  LV Size                20.00 GiB&lt;br /&gt;
  Current LE             5120&lt;br /&gt;
  Segments               1&lt;br /&gt;
  Allocation             inherit&lt;br /&gt;
  Read ahead sectors     auto&lt;br /&gt;
  - currently set to     256&lt;br /&gt;
  Block device           253:0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Again, if this is visible from both nodes, we&#039;re set! Repeat this process for all future LVs you will want to create. We will do this a little later to create LVs for Xen VMs.&lt;br /&gt;
&lt;br /&gt;
= Creating A Shared GFS FileSystem =&lt;br /&gt;
&lt;br /&gt;
GFS is a cluster-aware file system that can be simultaneously mounted on two or more nodes at once. We will use it as a place to store ISOs that we&#039;ll use to provision our virtual machines.&lt;br /&gt;
&lt;br /&gt;
== Install The GFS2 Utilities ==&lt;br /&gt;
&lt;br /&gt;
Start by installing the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[GFS2]]&amp;lt;/span&amp;gt; tools:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum -y install gfs2-utils.x86_64&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Format Our CLVM LV With The GFS2 File System ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Node1&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: The following example is designed for the cluster used in the prerequisite HowTo. &lt;br /&gt;
* If you have more than 2 nodes, increase the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;-j 2&amp;lt;/span&amp;gt; to the number of nodes you want to mount this file system on.&lt;br /&gt;
* If your cluster is named something other than &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-cluster&amp;lt;/span&amp;gt; (as set in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cluster.conf&amp;lt;/span&amp;gt; file), change &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;-t an-cluster:xen_shared&amp;lt;/span&amp;gt; to match you cluster&#039;s name. The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xen_shared&amp;lt;/span&amp;gt; can be whatever you like, but it must be unique in the cluster. I tend to use a name that matches the LV name, but this is my own preference and is not required.&lt;br /&gt;
&lt;br /&gt;
To format the partition run:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
mkfs.gfs2 -p lock_dlm -j 2 -t an-cluster:xen_shared /dev/drbd0_vg0/xen_shared&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
This will destroy any data on /dev/drbd0_vg0/xen_shared.&lt;br /&gt;
It appears to contain: symbolic link to `../dm-0&#039;&lt;br /&gt;
&lt;br /&gt;
Are you sure you want to proceed? [y/n] &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Acknowledge the warning, if any, and then press &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;y&amp;lt;/span&amp;gt; if you are ready to proceed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
y&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Device:                    /dev/drbd0_vg0/xen_shared&lt;br /&gt;
Blocksize:                 4096&lt;br /&gt;
Device Size                20.00 GB (5242880 blocks)&lt;br /&gt;
Filesystem Size:           20.00 GB (5242878 blocks)&lt;br /&gt;
Journals:                  2&lt;br /&gt;
Resource Groups:           80&lt;br /&gt;
Locking Protocol:          &amp;quot;lock_dlm&amp;quot;&lt;br /&gt;
Lock Table:                &amp;quot;an-cluster:xen_shared&amp;quot;&lt;br /&gt;
UUID:                      A1487063-2A3F-43B1-3A36-44936B0B4D1E&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once the format completes, you can mount &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/drbd0_vg0/xen_shared&amp;lt;/span&amp;gt; as you would a normal file system.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Both&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
To complete the example, lets mount the GFS2 partition we made just now on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/shared&amp;lt;/span&amp;gt; and then use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;df -h&amp;lt;/span&amp;gt; to verify.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
mkdir /xen_shared&lt;br /&gt;
mount /dev/drbd0_vg0/xen_shared /xen_shared&lt;br /&gt;
df -h&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Filesystem            Size  Used Avail Use% Mounted on&lt;br /&gt;
Filesystem            Size  Used Avail Use% Mounted on&lt;br /&gt;
/dev/md1               39G  2.8G   34G   8% /&lt;br /&gt;
tmpfs                 466M   29M  438M   7% /dev/shm&lt;br /&gt;
/dev/md0              243M   70M  161M  31% /boot&lt;br /&gt;
xenstore              466M   32K  466M   1% /var/lib/xenstored&lt;br /&gt;
/dev/dm-0              20G  259M   20G   2% /xen_shared&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You may have noticed that it shows &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/dm-0&amp;lt;/span&amp;gt; instead of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/drbd0_vg0/xen_shared&amp;lt;/span&amp;gt;. If you look at the later, you will see that it is simply a [[symlink]] to the former.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ls -lah /dev/drbd0_vg0/xen_shared&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
lrwxrwxrwx. 1 root root 7 Sep  9 13:24 /dev/drbd0_vg0/xen_shared -&amp;gt; ../dm-0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Add An Entry To /etc/fstab ==&lt;br /&gt;
&lt;br /&gt;
The last step is to add an entry for this new partition to each node&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/fstab&amp;lt;/span&amp;gt; file.&lt;br /&gt;
&lt;br /&gt;
=== Reference The GFS2 Partition By Device Path ===&lt;br /&gt;
&lt;br /&gt;
This is the more traditional method of referencing the GFS2 partition by using it&#039;s device path directly.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Warning&#039;&#039;&#039;: An incorrect edit of the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/fstab&amp;lt;/span&amp;gt; file can leave your system unable to boot! Please review the line generated above to make sure it is accurate and compatible with your setup before proceeding.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/fstab&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
#&lt;br /&gt;
# /etc/fstab&lt;br /&gt;
# Created by anaconda on Tue Sep  7 06:29:51 2010&lt;br /&gt;
#&lt;br /&gt;
# Accessible filesystems, by reference, are maintained under &#039;/dev/disk&#039;&lt;br /&gt;
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info&lt;br /&gt;
#&lt;br /&gt;
UUID=865690db-85d0-44c5-9f32-ffb6fdf47060 /                       ext3    defaults        1 1&lt;br /&gt;
UUID=8b9822b6-a92e-48c9-96b5-f8943142319e /boot                   ext3    defaults        1 2&lt;br /&gt;
UUID=94b03547-a7e3-45bb-b2d5-837498b370f4 swap                    swap    defaults        0 0&lt;br /&gt;
tmpfs                   /dev/shm                tmpfs   defaults        0 0&lt;br /&gt;
devpts                  /dev/pts                devpts  gid=5,mode=620  0 0&lt;br /&gt;
sysfs                   /sys                    sysfs   defaults        0 0&lt;br /&gt;
proc                    /proc                   proc    defaults        0 0&lt;br /&gt;
xenfs                   /proc/xen               xenfs   defaults        0 0&lt;br /&gt;
/dev/drbd0_vg0/xen_shared /xen_shared           gfs2    rw,suid,dev,exec,nouser,async    0 0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Reference The GFS2 Partition By UUID ===&lt;br /&gt;
&lt;br /&gt;
It is sometimes preferable to create an &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fstab&amp;lt;/span&amp;gt; entry that locates the device path via it&#039;s [[UUID]]. To do this, you can run the following command which, though a bit cryptic, will print out an &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/fstab&amp;lt;/span&amp;gt; compatible string.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Warning&#039;&#039;&#039;: The same warnings apply here as above&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
echo `gfs2_edit -p sb /dev/drbd0_vg0/xen_shared | grep sb_uuid | sed -e &amp;quot;s/.*sb_uuid  *\(.*\)/UUID=\L\1\E \/xen_shared\t\tgfs2\trw,suid,dev,exec,nouser,async\t0 0/&amp;quot;`&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
UUID=a1487063-2a3f-43b1-3a36-44936b0b4d1e /xen_shared gfs2 rw,suid,dev,exec,nouser,async 0 0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You may have noticed that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;defaults&amp;lt;/span&amp;gt; isn&#039;t used. Rather, all but the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;auto&amp;lt;/span&amp;gt; option are manually set. This is because the system will drop to single-user mode at boot if it can&#039;t mount an &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;auto&amp;lt;/span&amp;gt; partition at boot time (&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;auto&amp;lt;/span&amp;gt; being implied by &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;defaults&amp;lt;/span&amp;gt;). Given that our GFS2 partition sits on top of DRBD and the cluster, there is no way to make it available that early in the boot process.&lt;br /&gt;
&lt;br /&gt;
Further, the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;gfs2&amp;lt;/span&amp;gt; init script specifically excludes entries in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/fstab&amp;lt;/span&amp;gt; that have the &#039;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;noauto&amp;lt;/span&amp;gt; option set. For this reason, we can&#039;t simply specify that as we need the init script to see the partition so that it is mounted when GFS2 starts and unmounted when it stops.&lt;br /&gt;
&lt;br /&gt;
Now add this string to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/fstab&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/fstab&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
#&lt;br /&gt;
# /etc/fstab&lt;br /&gt;
# Created by anaconda on Tue Sep  7 06:29:51 2010&lt;br /&gt;
#&lt;br /&gt;
# Accessible filesystems, by reference, are maintained under &#039;/dev/disk&#039;&lt;br /&gt;
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info&lt;br /&gt;
#&lt;br /&gt;
UUID=865690db-85d0-44c5-9f32-ffb6fdf47060 /                       ext3    defaults        1 1&lt;br /&gt;
UUID=8b9822b6-a92e-48c9-96b5-f8943142319e /boot                   ext3    defaults        1 2&lt;br /&gt;
UUID=94b03547-a7e3-45bb-b2d5-837498b370f4 swap                    swap    defaults        0 0&lt;br /&gt;
tmpfs                   /dev/shm                tmpfs   defaults        0 0&lt;br /&gt;
devpts                  /dev/pts                devpts  gid=5,mode=620  0 0&lt;br /&gt;
sysfs                   /sys                    sysfs   defaults        0 0&lt;br /&gt;
proc                    /proc                   proc    defaults        0 0&lt;br /&gt;
xenfs                   /proc/xen               xenfs   defaults        0 0&lt;br /&gt;
UUID=a1487063-2a3f-43b1-3a36-44936b0b4d1e /xen_shared gfs2 rw,suid,dev,exec,nouser,async 0 0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Please note; At the time of writing this HowTo, there is a bug in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;findfs&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;mount&amp;lt;/span&amp;gt;. According to [http://www.ietf.org/rfc/rfc4122.txt RFC 4122], programs should accept a [[UUID]] in either upper or lower case. However, this is not currently the case, so you &#039;&#039;&#039;must&#039;&#039;&#039; pass the UUID in lower-case. Please see bugs [https://bugzilla.redhat.com/show_bug.cgi?id=632373 632373] and [https://bugzilla.redhat.com/show_bug.cgi?id=632385 632385].&lt;br /&gt;
&lt;br /&gt;
== Testing The gfs2 Initialization Script ==&lt;br /&gt;
&lt;br /&gt;
To verify that the new entry is valid, check &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;gfs2&amp;lt;/span&amp;gt;&#039;s status.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/gfs2 status&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Configured GFS2 mountpoints: &lt;br /&gt;
/xen_shared&lt;br /&gt;
Active GFS2 mountpoints: &lt;br /&gt;
/xen_shared&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now test stopping and restarting to ensure that the GFS2 partition unmounts and mounts properly.&lt;br /&gt;
&lt;br /&gt;
Stop &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;gfs2&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/gfs2 stop&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Unmounting GFS2 filesystem (/xen_shared):                   [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;df -h&amp;lt;/span&amp;gt; to ensure that the mount is gone.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
df -h&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Filesystem            Size  Used Avail Use% Mounted on&lt;br /&gt;
/dev/md1               39G  2.0G   35G   6% /&lt;br /&gt;
tmpfs                 466M   23M  444M   5% /dev/shm&lt;br /&gt;
/dev/md0              243M   70M  161M  31% /boot&lt;br /&gt;
xenstore              466M   32K  466M   1% /var/lib/xenstored&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Start &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;gfs2&amp;lt;/span&amp;gt; again.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/gfs2 start&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Mounting GFS2 filesystem (/xen_shared):                     [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Again, check with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;df -h&amp;lt;/span&amp;gt; that it has been remounted.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
df -h&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Filesystem            Size  Used Avail Use% Mounted on&lt;br /&gt;
/dev/md1               39G  2.0G   35G   6% /&lt;br /&gt;
tmpfs                 466M   29M  438M   7% /dev/shm&lt;br /&gt;
/dev/md0              243M   70M  161M  31% /boot&lt;br /&gt;
xenstore              466M   32K  466M   1% /var/lib/xenstored&lt;br /&gt;
/dev/dm-0              20G  259M   20G   2% /xen_shared&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Done!&lt;br /&gt;
&lt;br /&gt;
== Further Reading ==&lt;br /&gt;
&lt;br /&gt;
* [[Grow a GFS2 Partition]]&lt;br /&gt;
* [[Hard drive has gone bad in DRBD]]&lt;br /&gt;
&lt;br /&gt;
= Altering Daemon Start Order =&lt;br /&gt;
&lt;br /&gt;
It is important that the various daemons in use by our cluster start in the right order. Most daemons will rely on services provided by another daemon to be running, and will not start or will not operate reliably otherwise.&lt;br /&gt;
&lt;br /&gt;
We need to make sure that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xend&amp;lt;/span&amp;gt; starts so that the network is stable. Then &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt; needs to start so that [[fencing]] and [[dlm]] are available. Next, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;drbd&amp;lt;/span&amp;gt; starts so that the clustered storage is available. Then &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clvmd&amp;lt;/span&amp;gt; must start so that the data on the DRBD resource is accessible. Now &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;gfs2&amp;lt;/span&amp;gt; needs to start so that the Xen domU configuration files can be found and finally &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xendomains&amp;lt;/span&amp;gt; must start to boot up the actual domU virtual machines.&lt;br /&gt;
&lt;br /&gt;
To restate as a list, the start order must be:&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xend&amp;lt;/span&amp;gt;&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt;&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;drbd&amp;lt;/span&amp;gt;&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clvmd&amp;lt;/span&amp;gt;&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;gfs2&amp;lt;/span&amp;gt;&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xendomains&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To make sure the start order is sane then, we&#039;ll edit each of the six daemon&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;init&amp;lt;/span&amp;gt; scripts and alter their &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Required-Start&amp;lt;/span&amp;gt; lines. To make the changes take effect, we will use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;chkconfig&amp;lt;/span&amp;gt; to remove and re-add them to the various start levels.&lt;br /&gt;
&lt;br /&gt;
== Altering xend ==&lt;br /&gt;
&lt;br /&gt;
This should already be done. If it isn&#039;t, please see &amp;quot;[[#Make xend play nice with clustering|Making xend play nice with clustering]]&amp;quot; above. If you are revisiting that section, you can skip the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt; edit as we will need to make another change in the next step.&lt;br /&gt;
&lt;br /&gt;
== Altering cman ==&lt;br /&gt;
&lt;br /&gt;
This should already be done. If it isn&#039;t, please see &amp;quot;[[#Make xend play nice with clustering|Making xend play nice with clustering]]&amp;quot; above. If you are revisiting that section, you can skip the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt; edit as we will need to make another change in the next step.&lt;br /&gt;
&lt;br /&gt;
== Altering drbd ==&lt;br /&gt;
&lt;br /&gt;
Now we will tell &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;drbd&amp;lt;/span&amp;gt; to start after &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
This requires the additional step of altering the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;chkconfig: - 70 08&amp;lt;/span&amp;gt; line to instead read &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;chkconfig: - 20 08&amp;lt;/span&amp;gt;. This isn&#039;t strictly needed, but will give more room for &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;chkconfig&amp;lt;/span&amp;gt; to order the dependent daemons by allowing DRBD to be started as low as position &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;20&amp;lt;/span&amp;gt;, rather than waiting until position &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;70&amp;lt;/span&amp;gt;. This is somewhat more compatible with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clvmd&amp;lt;/span&amp;gt; which normally start at positions &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;21&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;24&amp;lt;/span&amp;gt;, respectively&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/init.d/drbd&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
#&lt;br /&gt;
# chkconfig: - 20 08&lt;br /&gt;
# description: Loads and unloads the drbd module&lt;br /&gt;
#&lt;br /&gt;
# Copright 2001-2008 LINBIT Information Technologies&lt;br /&gt;
# Philipp Reisner, Lars Ellenberg&lt;br /&gt;
#&lt;br /&gt;
### BEGIN INIT INFO&lt;br /&gt;
# Provides: drbd&lt;br /&gt;
# Required-Start: $local_fs $network $syslog cman&lt;br /&gt;
# Required-Stop:  $local_fs $network $syslog&lt;br /&gt;
# Should-Start:   sshd multipathd&lt;br /&gt;
# Should-Stop:    sshd multipathd&lt;br /&gt;
# Default-Start:&lt;br /&gt;
# Default-Stop:&lt;br /&gt;
# Short-Description:    Control drbd resources.&lt;br /&gt;
### END INIT INFO&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Altering clvmd ==&lt;br /&gt;
&lt;br /&gt;
Now we will now tell &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clvmd&amp;lt;/span&amp;gt; to start after &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;drbd&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: There is currently a minor bug with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;lvm2-cluster&amp;lt;/span&amp;gt; version &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;2.02.73-2&amp;lt;/span&amp;gt; in that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/init.d/clvmd&amp;lt;/span&amp;gt; is set by default to mode &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;0555&amp;lt;/span&amp;gt;. This is easily corrected by running the following command. Please check bug [https://bugzilla.redhat.com/show_bug.cgi?id=636066 636066] to see if this has been resolved.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
chmod u+w /etc/init.d/clvmd&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once you&#039;ve got write access, edit the file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/init.d/clvmd&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
#&lt;br /&gt;
# chkconfig: - 24 76&lt;br /&gt;
# description: Starts and stops clvmd&lt;br /&gt;
#&lt;br /&gt;
# For Red-Hat-based distributions such as Fedora, RHEL, CentOS.&lt;br /&gt;
#              &lt;br /&gt;
### BEGIN INIT INFO&lt;br /&gt;
# Provides: clvmd&lt;br /&gt;
# Required-Start: $local_fs drbd&lt;br /&gt;
# Required-Stop: $local_fs&lt;br /&gt;
# Default-Start:&lt;br /&gt;
# Default-Stop: 0 1 6&lt;br /&gt;
# Short-Description: Clustered LVM Daemon&lt;br /&gt;
### END INIT INFO&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Altering gfs2 ==&lt;br /&gt;
&lt;br /&gt;
Now we will now tell &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;gfs2&amp;lt;/span&amp;gt; to start after &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clvmd&amp;lt;/span&amp;gt;. You will notice that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt; is already listed under &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Required-Start&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Required-Stop&amp;lt;/span&amp;gt;. It&#039;s true that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt; must be started, but we&#039;ve created a chain here so we can safely replace it with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clvmd&amp;lt;/span&amp;gt; in the start line.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/init.d/gfs2&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
#&lt;br /&gt;
# gfs2 mount/unmount helper&lt;br /&gt;
#&lt;br /&gt;
# chkconfig: - 26 74&lt;br /&gt;
# description: mount/unmount gfs2 filesystems configured in /etc/fstab&lt;br /&gt;
&lt;br /&gt;
### BEGIN INIT INFO&lt;br /&gt;
# Provides:             gfs2&lt;br /&gt;
# Required-Start:       $network clvmd&lt;br /&gt;
# Required-Stop:        $network&lt;br /&gt;
# Default-Start:&lt;br /&gt;
# Default-Stop:&lt;br /&gt;
# Short-Description:    mount/unmount gfs2 filesystems configured in /etc/fstab&lt;br /&gt;
# Description:          mount/unmount gfs2 filesystems configured in /etc/fstab&lt;br /&gt;
### END INIT INFO&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Altering xendomains ==&lt;br /&gt;
&lt;br /&gt;
Finally, we will alter &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xendomains&amp;lt;/span&amp;gt; so that it starts last, after &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;gfs2&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/init.d/xendomains&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
#&lt;br /&gt;
# /etc/init.d/xendomains&lt;br /&gt;
# Start / stop domains automatically when domain 0 boots / shuts down.&lt;br /&gt;
#&lt;br /&gt;
# chkconfig: 345 99 00&lt;br /&gt;
# description: Start / stop Xen domains.&lt;br /&gt;
#&lt;br /&gt;
# This script offers fairly basic functionality.  It should work on Redhat&lt;br /&gt;
# but also on LSB-compliant SuSE releases and on Debian with the LSB package&lt;br /&gt;
# installed.  (LSB is the Linux Standard Base)&lt;br /&gt;
#&lt;br /&gt;
# Based on the example in the &amp;quot;Designing High Quality Integrated Linux&lt;br /&gt;
# Applications HOWTO&amp;quot; by Avi Alkalay&lt;br /&gt;
# &amp;lt;http://www.tldp.org/HOWTO/HighQuality-Apps-HOWTO/&amp;gt;&lt;br /&gt;
#&lt;br /&gt;
### BEGIN INIT INFO&lt;br /&gt;
# Provides:          xendomains&lt;br /&gt;
# Required-Start:    $syslog $remote_fs xend gfs2&lt;br /&gt;
# Should-Start:&lt;br /&gt;
# Required-Stop:     $syslog $remote_fs xend&lt;br /&gt;
# Should-Stop:&lt;br /&gt;
# Default-Start:     3 4 5&lt;br /&gt;
# Default-Stop:      0 1 2 6&lt;br /&gt;
# Default-Enabled:   yes&lt;br /&gt;
# Short-Description: Start/stop secondary xen domains&lt;br /&gt;
# Description:       Start / stop domains automatically when domain 0 &lt;br /&gt;
#                    boots / shuts down.&lt;br /&gt;
### END INIT INFO&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Applying The Changes ==&lt;br /&gt;
&lt;br /&gt;
Change the start order by removing and re-adding all cluster-related daemons using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;chkconfig&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
chkconfig xenstored off; chkconfig xenconsoled off; chkconfig xend off; chkconfig cman off; chkconfig drbd off; chkconfig clvmd off; chkconfig gfs2 off; chkconfig xendomains off&lt;br /&gt;
chkconfig xendomains on; chkconfig gfs2 on; chkconfig clvmd on; chkconfig drbd on; chkconfig cman on; chkconfig xend on; chkconfig xenconsoled on; chkconfig xenstored on&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now verify that the start order is as we want it. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ls -lah /etc/rc3.d/&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
lrwxrwxrwx.  1 root root   19 Sep 20 13:37 S26xenstored -&amp;gt; ../init.d/xenstored&lt;br /&gt;
lrwxrwxrwx.  1 root root   21 Sep 20 13:37 S27xenconsoled -&amp;gt; ../init.d/xenconsoled&lt;br /&gt;
lrwxrwxrwx.  1 root root   14 Sep 20 13:37 S28xend -&amp;gt; ../init.d/xend&lt;br /&gt;
lrwxrwxrwx.  1 root root   14 Sep 20 13:37 S29cman -&amp;gt; ../init.d/cman&lt;br /&gt;
lrwxrwxrwx.  1 root root   14 Sep 20 13:37 S70drbd -&amp;gt; ../init.d/drbd&lt;br /&gt;
lrwxrwxrwx.  1 root root   15 Sep 20 13:37 S71clvmd -&amp;gt; ../init.d/clvmd&lt;br /&gt;
lrwxrwxrwx.  1 root root   14 Sep 20 13:37 S72gfs2 -&amp;gt; ../init.d/gfs2&lt;br /&gt;
lrwxrwxrwx.  1 root root   20 Sep 20 13:37 S99xendomains -&amp;gt; ../init.d/xendomains&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Setting Up Xen =&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;WARNING&#039;&#039;&#039;&#039;&#039;: Everything below here is pretty &#039;&#039;&#039;seriously screwed up&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: This is not meant to be an extensive tutorial on Xen itself. It covers enough to get domU VMs provisioned in a manner that will take advantage of the cluster. As such, there is minimal explanation of configuration file options. If you need further help, please drop by the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;##xen&amp;lt;/span&amp;gt; (yes, two &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;##&amp;lt;/span&amp;gt;) [[IRC]] channel on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;freenode.org&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Install The Hypervisor Tools ==&lt;br /&gt;
&lt;br /&gt;
These tools are very useful in provisioning and managing domU VMs.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum -y install virt-install virt-viewer&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Install The HVM/KVM Tools ==&lt;br /&gt;
&lt;br /&gt;
For &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;hvm&amp;lt;/span&amp;gt; (Hardware Virtual Machines), which is required for [http://www.virtuatopia.com/index.php/Virtualizing_Windows_Server_2008_with_Xen paravirtualized Microsoft] VMs, you must install the following packages as well.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum -y install qemu-kvm.x86_64 qemu-kvm-tools.x86_64&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Ensure That Virtualization Is Enabled ==&lt;br /&gt;
&lt;br /&gt;
Many motherboards disable &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;hvm&amp;lt;/span&amp;gt; by default in their [[BIOS]]. Assuming that you&#039;ve got a dom0 kernel running at this stage, you can check if this is the case by checking the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xm info&amp;lt;/span&amp;gt; output.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
xm info&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
host                   : an-node04.alteeve.com&lt;br /&gt;
release                : 2.6.32.23-170.dom0_an1.fc13.x86_64&lt;br /&gt;
version                : #1 SMP Sun Oct 10 20:39:19 EDT 2010&lt;br /&gt;
machine                : x86_64&lt;br /&gt;
nr_cpus                : 4&lt;br /&gt;
nr_nodes               : 1&lt;br /&gt;
cores_per_socket       : 4&lt;br /&gt;
threads_per_core       : 1&lt;br /&gt;
cpu_mhz                : 2209&lt;br /&gt;
hw_caps                : 178bf3ff:efd3fbff:00000000:00001310:00802001:00000000:000037ff:00000000&lt;br /&gt;
virt_caps              : hvm&lt;br /&gt;
total_memory           : 4063&lt;br /&gt;
free_memory            : 2987&lt;br /&gt;
node_to_cpu            : node0:0-3&lt;br /&gt;
node_to_memory         : node0:2987&lt;br /&gt;
node_to_dma32_mem      : node0:2928&lt;br /&gt;
max_node_id            : 0&lt;br /&gt;
xen_major              : 4&lt;br /&gt;
xen_minor              : 0&lt;br /&gt;
xen_extra              : .1&lt;br /&gt;
xen_caps               : xen-3.0-x86_64 xen-3.0-x86_32p hvm-3.0-x86_32 hvm-3.0-x86_32p hvm-3.0-x86_64 &lt;br /&gt;
xen_scheduler          : credit&lt;br /&gt;
xen_pagesize           : 4096&lt;br /&gt;
platform_params        : virt_start=0xffff800000000000&lt;br /&gt;
xen_changeset          : unavailable&lt;br /&gt;
xen_commandline        : dom0_mem=1024M&lt;br /&gt;
cc_compiler            : gcc version 4.4.4 20100630 (Red Hat 4.4.4-10) (GCC) &lt;br /&gt;
cc_compile_by          : root&lt;br /&gt;
cc_compile_domain      : &lt;br /&gt;
cc_compile_date        : Mon Oct 11 01:10:38 EDT 2010&lt;br /&gt;
xend_config_format     : 4&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Look at the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt_caps&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xen_caps&amp;lt;/span&amp;gt; lines. Notice the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;hvm&amp;lt;/span&amp;gt; entries? This shows that HVM, also known as &amp;quot;secure virtualization&amp;quot;, has been enabled. If you do not see this, please check your mainboard manual for information on enabling this on your system.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: The next paragraph applies only when running a vanilla kernel.&lt;br /&gt;
&lt;br /&gt;
If you are running a vanilla kernel, you can check to see if your CPU has support for HVM guests but checking &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/proc/cpuinfo&amp;lt;/span&amp;gt;. What you&#039;re looking for depends on your CPU manufacturer. If you have an Intel CPU, you need to look for the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vmx&amp;lt;/span&amp;gt; flag. Likewise, with AMD CPUs, you need to look for the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;svm&amp;lt;/span&amp;gt; flag.&lt;br /&gt;
&lt;br /&gt;
For a more complete, if somewhat dated paper on this topic, please [http://fedoraproject.org/wiki/FedoraXenQuickstartFC6#Fully-virtualized_guests_.28HVM.2FIntel-VT.2FAMD-V.29 Fedora 6 Xen Quickstart Guide, System Requirements].&lt;br /&gt;
&lt;br /&gt;
== Enabling Migration ==&lt;br /&gt;
&lt;br /&gt;
By default, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xend&amp;lt;/span&amp;gt; will not allow domU VMs from being migrated onto or off of a given dom0 host. Given that we&#039;ve got a cluster though, we very much want this behaviour, so now we will enable it. This is done by making edits to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/xen/xend-config.sxp&amp;lt;/span&amp;gt;. Below is a concise list of options that must be set. Some exist already in the file and need to be commented out or altered.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Warning&#039;&#039;&#039;: The values below are &#039;&#039;&#039;very&#039;&#039;&#039; permissive. Please review each option and improve the security to fit your network before going into production!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/xen/xend-config.sxp &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
(xend-http-server yes)&lt;br /&gt;
(xend-unix-server yes)&lt;br /&gt;
(xend-tcp-xmlrpc-server yes)&lt;br /&gt;
(xend-relocation-server yes)&lt;br /&gt;
(xend-udev-event-server yes)&lt;br /&gt;
(xend-port            8000)&lt;br /&gt;
(xend-relocation-port 8002)&lt;br /&gt;
(xend-address &#039;&#039;)&lt;br /&gt;
(xend-relocation-address &#039;&#039;)&lt;br /&gt;
(xend-relocation-hosts-allow &#039;&#039;)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once done, restart &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xend&amp;lt;/span&amp;gt;. It is usually safest to stop the cluster before hand to avoid accidental fencing caused by the underlying network being reconfigured.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/gfs2 stop&lt;br /&gt;
/etc/init.d/clvmd stop&lt;br /&gt;
/etc/init.d/cman stop&lt;br /&gt;
/etc/init.d/xend restart&lt;br /&gt;
/etc/init.d/cman start&lt;br /&gt;
/etc/init.d/clvmd start&lt;br /&gt;
/etc/init.d/gfs2 start&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Virtual Machine Naming Convention ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: This section acts as a recommendation only. Feel free to alter this to fit your style and needs.&lt;br /&gt;
&lt;br /&gt;
Personally, I like to name my VMs similar to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;c5_shorewall_01&amp;lt;/span&amp;gt;. To elaborate, I like to use the format:&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;os_role_seq&amp;lt;/span&amp;gt; (&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;Operating System ID&amp;gt;_&amp;lt;Role of the VM&amp;gt;_&amp;lt;Sequence Integer&amp;gt;&amp;lt;/span&amp;gt;). &lt;br /&gt;
&lt;br /&gt;
There are no (known) restrictions on virtual machine names, so feel free to use names that made sense for you. I do strongly recommend that you match the name of your domU VM to the name of it&#039;s host LVM logical volume.&lt;br /&gt;
&lt;br /&gt;
== Provisioning domU VMs ==&lt;br /&gt;
&lt;br /&gt;
There are two ways to provision new VMs that we will cover (there are many others); Using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-install&amp;lt;/span&amp;gt; and using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xm create -f /path/to/domain.cfg&amp;lt;/span&amp;gt; where &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;domain.cfg&amp;lt;/span&amp;gt; is a hand-crafted python script.&lt;br /&gt;
&lt;br /&gt;
=== Provisioning with virt-install ===&lt;br /&gt;
&lt;br /&gt;
This uses a long command line argument that provisions the VM and loads it into &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;libvirt&amp;lt;/span&amp;gt;. Where possible, this is probably the best way to provision a domU. However, there are occasions where it may not work.&lt;br /&gt;
&lt;br /&gt;
Here is an example where a domU is provisioned for a [[Fedora]] 13, x86_64 VM with a dedicated logical volume on the clustered LVM. The command to create the LV precedes the command to provision the VM. Please review and adjust values as you need. Consult &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;man virt-install&amp;lt;/span&amp;gt; for a more complete list of available options and their uses.&lt;br /&gt;
&lt;br /&gt;
Following the provision command are two examples of how to backup the configuration to a flat file. The first directly dumps the configuration into the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;libvirt&amp;lt;/span&amp;gt; format. The second backs up the configuration to an [[XML]] file and then shows and example of how that file can be converted into a standard python script.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# Fedora 13 x86_64 RPM builder VM&lt;br /&gt;
lvcreate -L 40G -n f13_builder_01 drbd0_vg0&lt;br /&gt;
virt-install --connect xen \&lt;br /&gt;
             --name f13_builder_01 \&lt;br /&gt;
             --ram 1024 \&lt;br /&gt;
             --arch x86_64 \&lt;br /&gt;
             --vcpus 1 \&lt;br /&gt;
             --cpuset 1 \&lt;br /&gt;
             --location http://192.168.1.10/f13/x86_64/img/ \&lt;br /&gt;
             --os-type linux \&lt;br /&gt;
             --os-variant fedora13 \&lt;br /&gt;
             --disk path=/dev/drbd0_vg0/f13_builder_01 \&lt;br /&gt;
             --network bridge=eth0,mac=00:16:3e:00:10:01 \&lt;br /&gt;
             --vnc \&lt;br /&gt;
             --paravirt&lt;br /&gt;
# Backup the domU configuration to the libvirt native format.&lt;br /&gt;
xm list -l f13_builder_01 &amp;gt; /xen_shared/dom_config/f13_builder.cfg&lt;br /&gt;
# Backup the config to an XML file.&lt;br /&gt;
virsh dumpxml f13_builder_01 &amp;gt; /xen_shared/domU_config/f13_builder_01.xml&lt;br /&gt;
# Convert it to a &amp;quot;traditional&amp;quot; python script. Be sure the edit the resulting .cfg file to remove the &#039;vifname=&#039; sections.&lt;br /&gt;
virsh -c xen:/// domxml-to-native xen-xm f13_builder_01.xml &amp;gt; f13_builder_01.cfg&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The next two examples show the provisioning of a [[CentOS]] v5.5 and [[RHEL]] v6.0, beta 2 machines. The dump and backup methods above should be easily adapted to work with these VMs.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# A CentOS test server&lt;br /&gt;
lvcreate -L 40G -n c5_test_01 drbd0_vg0&lt;br /&gt;
virt-install --connect xen \&lt;br /&gt;
             --name c5_test_01 \&lt;br /&gt;
             --ram 1024 \&lt;br /&gt;
             --arch x86_64 \&lt;br /&gt;
             --vcpus 1 \&lt;br /&gt;
             --cpuset 1-3 \&lt;br /&gt;
             --location http://192.168.1.10/c5/x86_64/img/ \&lt;br /&gt;
             --os-type linux \&lt;br /&gt;
             --os-variant rhel5.4 \&lt;br /&gt;
             --disk path=/dev/drbd0_vg0/c5_test_01 \&lt;br /&gt;
             --network bridge=eth0,mac=00:16:3e:00:10:02 \&lt;br /&gt;
             --vnc \&lt;br /&gt;
             --paravirt&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# Red Hat Enterprise Linux 6 beta 2 test server&lt;br /&gt;
lvcreate -L 40G -n rh6b2_test_01 drbd0_vg0&lt;br /&gt;
virt-install --connect xen \&lt;br /&gt;
             --name rh6b2_test_01 \&lt;br /&gt;
             --ram 1024 \&lt;br /&gt;
             --arch x86_64 \&lt;br /&gt;
             --vcpus 1 \&lt;br /&gt;
             --cpuset 1 \&lt;br /&gt;
             --location http://192.168.1.10/rhel6/x86_64/img/ \&lt;br /&gt;
             --os-type linux \&lt;br /&gt;
             --os-variant rhel6 \&lt;br /&gt;
             --disk path=/dev/drbd0_vg0/rh6b2_test_01 \&lt;br /&gt;
             --network bridge=eth0,mac=00:16:3e:00:10:03 \&lt;br /&gt;
             --vnc \&lt;br /&gt;
             --paravirt&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Provisioning With &#039;xm create&#039; ===&lt;br /&gt;
&lt;br /&gt;
At the time of writing this, I could not sort out the magical incantation for provisioning a [[Windows]] VM using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-install&amp;lt;/span&amp;gt;. Instead, I used the &amp;quot;old&amp;quot; style of crafting a configuration file using a python script. This is useful to know as many templates exist on the web for various VMs. Following the steps below, you should be able to fairly easily adapt them.&lt;br /&gt;
&lt;br /&gt;
In this example, we will provision a VM using [[HVM]] from an [[ISO]] image of the Windows 2008 Server installation DBD. In this case, there is a problem with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-install&amp;lt;/span&amp;gt; finding the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;qemu-dm&amp;lt;/span&amp;gt; file.&lt;br /&gt;
&lt;br /&gt;
This configuration file will be saved in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/xen_shared/domU_config&amp;lt;/span&amp;gt; directory, which exists on the shared [[GFS2]] partition we created earlier.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
mkdir /xen_shared/domU_config&lt;br /&gt;
vim /xen_shared/domU_config/win2008_sql_01.cfg&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
# This is the Windows 2008 Enterprise Server x86_64 hosting MS SQL Server 2008 Enterprise&lt;br /&gt;
kernel = &amp;quot;/usr/lib/xen/boot/hvmloader&amp;quot;&lt;br /&gt;
builder=&#039;hvm&#039;&lt;br /&gt;
memory = 1024&lt;br /&gt;
&lt;br /&gt;
# Should be at least 2KB per MB of domain memory, plus a few MB per vcpu.&lt;br /&gt;
shadow_memory = 8&lt;br /&gt;
name = &amp;quot;win2008_sql_01&amp;quot;&lt;br /&gt;
#vif = [ &#039;type=ioemu, bridge=xenbr0&#039; ]&lt;br /&gt;
vif = [ &#039;type=ioemu, bridge=eth0,mac=00:16:3e:00:30:03&#039; ]&lt;br /&gt;
acpi = 1&lt;br /&gt;
apic = 1&lt;br /&gt;
# Remove the &#039;file:...&#039; entry (or change it to another ISO) after the install is complete.&lt;br /&gt;
disk = [ &#039;phy:/dev/drbd0_vg0/win2008_sql_01,hda,w&#039;, &#039;file:/xen_shared/iso/MS-Win2008-Ent-x86_64-SP2.iso,hdc:cdrom,r&#039; ]&lt;br /&gt;
&lt;br /&gt;
device_model = &#039;/usr/lib/xen/bin/qemu-dm&#039;&lt;br /&gt;
&lt;br /&gt;
#-----------------------------------------------------------------------------&lt;br /&gt;
# boot on floppy (a), hard disk (c) or CD-ROM (d) &lt;br /&gt;
# default: hard disk, cd-rom, floppy&lt;br /&gt;
boot=&amp;quot;dc&amp;quot;&lt;br /&gt;
sdl=0&lt;br /&gt;
vnc=1&lt;br /&gt;
vncconsole=1&lt;br /&gt;
vncpasswd=&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
serial=&#039;pty&#039;&lt;br /&gt;
usbdevice=&#039;tablet&#039;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now provision the VM using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xm create&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
xm create -f /xen_shared/domU_config/win2008_sql_01.cfg&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At this point, the VM is not loaded into &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;libvirt&amp;lt;/span&amp;gt;. This is a problem as, on boot, the node will not know that the VM exists. As a consequence, some tools like &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-manager&amp;lt;/span&amp;gt; will not see the VM until it is manually started with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xm create -f /xen_shared/domU_config/domain.cfg&amp;lt;/span&amp;gt;. Further, and perhaps more troubling, changes made to the VM&#039;s config made outside to config file will be lost when you restart from the config file.&lt;br /&gt;
&lt;br /&gt;
To fix this, we&#039;ll use a few hacks to load the config into &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;libvirt&amp;lt;/span&amp;gt;. This needs to be done while the domU is loaded and it must be done on the node currently hosting the VM.&lt;br /&gt;
&lt;br /&gt;
First, make sure that the domU&#039;s configuration is visible. Then, dump the config and filter it through &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;grep&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;sed&amp;lt;/span&amp;gt; to pull out the [[UUID]]. Once you know that you get the proper UUID, create the directory under &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/var/lib/xend/domains/&amp;lt;/span&amp;gt; and then create the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;config.sxp&amp;lt;/span&amp;gt; file with the domU&#039;s configuration.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE&#039;&#039;&#039;: Be sure to change &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;win2008_01&amp;lt;/span&amp;gt; in the examples below to match the name of the domU that you want to setup.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
xm list -l win2008_01&lt;br /&gt;
xm list -l win2008_01 | grep &#039;^    (uuid&#039; | sed -e &amp;quot;s/    (uuid \(.*\))/\1/&amp;quot;&lt;br /&gt;
mkdir /var/lib/xend/domains/`xm list -l win2008_01 | grep &#039;^    (uuid&#039; | sed -e &amp;quot;s/    (uuid \(.*\))/\1/&amp;quot;`&lt;br /&gt;
cd /var/lib/xend/domains/`xm list -l win2008_01 | grep &#039;^    (uuid&#039; | sed -e &amp;quot;s/    (uuid \(.*\))/\1/&amp;quot;`&lt;br /&gt;
xm list -l win2008_01 &amp;gt; config.sxp&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There are several &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;uuid&amp;lt;/span&amp;gt; strings in the output from &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xm list -l domain&amp;lt;/span&amp;gt;. Thankfully, the one we want is the only one indented by four spaces. This is how we can be fairly confident that the UUID returned by &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;sed&amp;lt;/span&amp;gt; above is, in fact, &lt;br /&gt;
&lt;br /&gt;
= Making VMs Highly Available =&lt;br /&gt;
&lt;br /&gt;
Now this is the point, isn&#039;t it?&lt;br /&gt;
&lt;br /&gt;
In this final step, we&#039;re going to move the startup of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;drbd&amp;lt;/span&amp;gt;, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clvmd&amp;lt;/span&amp;gt;, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;gfs2&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xendomains&amp;lt;/span&amp;gt; out of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;init.d&amp;lt;/span&amp;gt; and move them into our cluster. The reason for this is that the cluster is much wiser about how to handle clustered services. We do not want a node that is not in the cluster, that is, a node without quorum, to try and connect to shared resources. The cluster manager handles this.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: This how-to is trying to keep things simple, so we will use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; which is built in to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt;. There is a compelling argument to use [[Pacemaker]] instead. That is a bit beyond the scope of the How-To though.&lt;br /&gt;
&lt;br /&gt;
== Removing Clustered Services From initd ==&lt;br /&gt;
&lt;br /&gt;
As stated, we will now remove the cluster-related services from starting with the os.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;WARNING&#039;&#039;&#039;: Incomplete, do not proceed with these steps! --[[User:SRSullivan|SRSullivan]] 20:25, 18 October 2010 (UTC)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
chkconfig xendomains off; chkconfig gfs2 off; chkconfig clvmd off; chkconfig drbd off&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{footer}}&lt;/div&gt;</summary>
		<author><name>SRSullivan</name></author>
	</entry>
	<entry>
		<id>https://alteeve.com/w/index.php?title=Talk:Two_Node_Fedora_13_Cluster_-_Xen-Based_Virtual_Machine_Host_on_DRBD%2BCLVM&amp;diff=2316</id>
		<title>Talk:Two Node Fedora 13 Cluster - Xen-Based Virtual Machine Host on DRBD+CLVM</title>
		<link rel="alternate" type="text/html" href="https://alteeve.com/w/index.php?title=Talk:Two_Node_Fedora_13_Cluster_-_Xen-Based_Virtual_Machine_Host_on_DRBD%2BCLVM&amp;diff=2316"/>
		<updated>2010-10-18T19:21:39Z</updated>

		<summary type="html">&lt;p&gt;SRSullivan: Descrpenceis in init order. Documentation for testing.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;We&#039;ll remove the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;yum -y&amp;lt;/span&amp;gt; before the document goes live. For now, I want it there to save time while (repeatedly) rebuilding the clusters as it saves a lot of time.&lt;br /&gt;
&lt;br /&gt;
--[[User:Digimer|Digimer]] 18:58, 13 October 2010 (UTC)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Dealing with Raid 5/6 ==&lt;br /&gt;
&lt;br /&gt;
Under raid 5/6 if you follow these instruction to closely you&#039;ll end up with bad config data in mdadm.conf&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cat /proc/mdstat&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Personalities : [raid1] [raid6] [raid5] [raid4] &lt;br /&gt;
md3 : active raid5 sdd5[4] sdc5[2] sdb5[1] sda5[0]&lt;br /&gt;
      1395170304 blocks super 1.2 level 5, 512k chunk, algorithm 2 [4/3] [UUU_]&lt;br /&gt;
      [=====&amp;gt;...............]  recovery = 26.5% (123522028/465056768) finish=126.7min speed=44896K/sec&lt;br /&gt;
      &lt;br /&gt;
md2 : active raid5 sda1[0] sdd1[4] sdc1[2] sdb1[1]&lt;br /&gt;
      62909952 blocks super 1.1 level 5, 512k chunk, algorithm 2 [4/4] [UUUU]&lt;br /&gt;
      bitmap: 0/1 pages [0KB], 65536KB chunk&lt;br /&gt;
&lt;br /&gt;
md1 : active raid5 sda2[0] sdd2[4] sdc2[2] sdb2[1]&lt;br /&gt;
      6286848 blocks super 1.1 level 5, 512k chunk, algorithm 2 [4/4] [UUUU]&lt;br /&gt;
      &lt;br /&gt;
md0 : active raid1 sda3[0] sdd3[3] sdc3[2] sdb3[1]&lt;br /&gt;
      255988 blocks super 1.0 [4/4] [UUUU]&lt;br /&gt;
      &lt;br /&gt;
unused devices: &amp;lt;none&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You will notice the [UUU_]. The default, and this is not in the documentation for mdadm, is to build the array with a degraded spare and then resync it. This is faster, but produces false data for the next step if it is done before the array completes it resync.&lt;br /&gt;
&lt;br /&gt;
Ref: [http://serverfault.com/questions/43575/how-to-create-a-software-raid5-array-without-a-spare/43581#43581]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
mdadm --detail --scan | grep md3 &amp;gt;&amp;gt; /etc/mdadm.conf&lt;br /&gt;
cat /etc/mdadm.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Will produce:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;ARRAY /dev/md3 metadata=1.2 spares=1 name=localhost.localdomain:3 UUID=b4fc7771:bef0b6a5:c4c40550:ab3bff42&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Which should actually be the following (with out the spares=1)&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
ARRAY /dev/md3 metadata=1.2 name=localhost.localdomain:3 UUID=b4fc7771:bef0b6a5:c4c40550:ab3bff42&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
--[[User:SRSullivan|SRSullivan]] 20:05, 15 October 2010 (UTC)&lt;br /&gt;
&lt;br /&gt;
== Tracking when to restart cman after reboots ==&lt;br /&gt;
&lt;br /&gt;
During the creation of devices we reboot the machine, previous instructions had us turn of cman from starting on boot. For the final release document we should carefully note when cman will be down and when it should be re-enabled either manually or permanently.&lt;br /&gt;
--[[User:SRSullivan|SRSullivan]] 17:44, 18 October 2010 (UTC)&lt;br /&gt;
&lt;br /&gt;
== chkconfig ordering ==&lt;br /&gt;
chkconfig version 1.3.45&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Reverse (Madison) Order,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
chkconfig xendomains on; chkconfig gfs2 on; chkconfig clvmd on; chkconfig drbd on; chkconfig cman on; chkconfig xend on; chkconfig xenconsoled on; chkconfig xenstored on&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
lrwxrwxrwx.  1 root root   21 Oct 18 15:16 S26xenconsoled -&amp;gt; ../init.d/xenconsoled&lt;br /&gt;
lrwxrwxrwx.  1 root root   19 Oct 18 15:16 S26xenstored -&amp;gt; ../init.d/xenstored&lt;br /&gt;
lrwxrwxrwx.  1 root root   14 Oct 18 15:16 S27xend -&amp;gt; ../init.d/xend&lt;br /&gt;
lrwxrwxrwx.  1 root root   14 Oct 18 15:16 S28cman -&amp;gt; ../init.d/cman&lt;br /&gt;
lrwxrwxrwx.  1 root root   14 Oct 18 15:16 S56drbd -&amp;gt; ../init.d/drbd&lt;br /&gt;
lrwxrwxrwx.  1 root root   15 Oct 18 15:16 S57clvmd -&amp;gt; ../init.d/clvmd&lt;br /&gt;
lrwxrwxrwx.  1 root root   14 Oct 18 15:16 S58gfs2 -&amp;gt; ../init.d/gfs2&lt;br /&gt;
lrwxrwxrwx.  1 root root   20 Oct 18 15:16 S99xendomains -&amp;gt; ../init.d/xendomains&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Forward (Scott&#039;s) Order,&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
chkconfig xenstored on; chkconfig xenconsoled on; chkconfig xend on; chkconfig cman on; chkconfig drbd on; chkconfig clvmd on; chkconfig gfs2 on; chkconfig xendomains on&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
lrwxrwxrwx.  1 root root   19 Oct 18 15:20 S26xenstored -&amp;gt; ../init.d/xenstored&lt;br /&gt;
lrwxrwxrwx.  1 root root   21 Oct 18 15:20 S27xenconsoled -&amp;gt; ../init.d/xenconsoled&lt;br /&gt;
lrwxrwxrwx.  1 root root   14 Oct 18 15:20 S28xend -&amp;gt; ../init.d/xend&lt;br /&gt;
lrwxrwxrwx.  1 root root   14 Oct 18 15:20 S29cman -&amp;gt; ../init.d/cman&lt;br /&gt;
lrwxrwxrwx.  1 root root   14 Oct 18 15:20 S56drbd -&amp;gt; ../init.d/drbd&lt;br /&gt;
lrwxrwxrwx.  1 root root   15 Oct 18 15:20 S57clvmd -&amp;gt; ../init.d/clvmd&lt;br /&gt;
lrwxrwxrwx.  1 root root   14 Oct 18 15:20 S58gfs2 -&amp;gt; ../init.d/gfs2&lt;br /&gt;
lrwxrwxrwx.  1 root root   20 Oct 18 15:20 S99xendomains -&amp;gt; ../init.d/xendomains&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>SRSullivan</name></author>
	</entry>
	<entry>
		<id>https://alteeve.com/w/index.php?title=Talk:Two_Node_Fedora_13_Cluster_-_Xen-Based_Virtual_Machine_Host_on_DRBD%2BCLVM&amp;diff=2309</id>
		<title>Talk:Two Node Fedora 13 Cluster - Xen-Based Virtual Machine Host on DRBD+CLVM</title>
		<link rel="alternate" type="text/html" href="https://alteeve.com/w/index.php?title=Talk:Two_Node_Fedora_13_Cluster_-_Xen-Based_Virtual_Machine_Host_on_DRBD%2BCLVM&amp;diff=2309"/>
		<updated>2010-10-18T17:44:34Z</updated>

		<summary type="html">&lt;p&gt;SRSullivan: cman restarting notes&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;We&#039;ll remove the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;yum -y&amp;lt;/span&amp;gt; before the document goes live. For now, I want it there to save time while (repeatedly) rebuilding the clusters as it saves a lot of time.&lt;br /&gt;
&lt;br /&gt;
--[[User:Digimer|Digimer]] 18:58, 13 October 2010 (UTC)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Dealing with Raid 5/6 ==&lt;br /&gt;
&lt;br /&gt;
Under raid 5/6 if you follow these instruction to closely you&#039;ll end up with bad config data in mdadm.conf&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cat /proc/mdstat&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Personalities : [raid1] [raid6] [raid5] [raid4] &lt;br /&gt;
md3 : active raid5 sdd5[4] sdc5[2] sdb5[1] sda5[0]&lt;br /&gt;
      1395170304 blocks super 1.2 level 5, 512k chunk, algorithm 2 [4/3] [UUU_]&lt;br /&gt;
      [=====&amp;gt;...............]  recovery = 26.5% (123522028/465056768) finish=126.7min speed=44896K/sec&lt;br /&gt;
      &lt;br /&gt;
md2 : active raid5 sda1[0] sdd1[4] sdc1[2] sdb1[1]&lt;br /&gt;
      62909952 blocks super 1.1 level 5, 512k chunk, algorithm 2 [4/4] [UUUU]&lt;br /&gt;
      bitmap: 0/1 pages [0KB], 65536KB chunk&lt;br /&gt;
&lt;br /&gt;
md1 : active raid5 sda2[0] sdd2[4] sdc2[2] sdb2[1]&lt;br /&gt;
      6286848 blocks super 1.1 level 5, 512k chunk, algorithm 2 [4/4] [UUUU]&lt;br /&gt;
      &lt;br /&gt;
md0 : active raid1 sda3[0] sdd3[3] sdc3[2] sdb3[1]&lt;br /&gt;
      255988 blocks super 1.0 [4/4] [UUUU]&lt;br /&gt;
      &lt;br /&gt;
unused devices: &amp;lt;none&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You will notice the [UUU_]. The default, and this is not in the documentation for mdadm, is to build the array with a degraded spare and then resync it. This is faster, but produces false data for the next step if it is done before the array completes it resync.&lt;br /&gt;
&lt;br /&gt;
Ref: [http://serverfault.com/questions/43575/how-to-create-a-software-raid5-array-without-a-spare/43581#43581]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
mdadm --detail --scan | grep md3 &amp;gt;&amp;gt; /etc/mdadm.conf&lt;br /&gt;
cat /etc/mdadm.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Will produce:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;ARRAY /dev/md3 metadata=1.2 spares=1 name=localhost.localdomain:3 UUID=b4fc7771:bef0b6a5:c4c40550:ab3bff42&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Which should actually be the following (with out the spares=1)&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
ARRAY /dev/md3 metadata=1.2 name=localhost.localdomain:3 UUID=b4fc7771:bef0b6a5:c4c40550:ab3bff42&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
--[[User:SRSullivan|SRSullivan]] 20:05, 15 October 2010 (UTC)&lt;br /&gt;
&lt;br /&gt;
== Tracking when to restart cman after reboots ==&lt;br /&gt;
&lt;br /&gt;
During the creation of devices we reboot the machine, previous instructions had us turn of cman from starting on boot. For the final release document we should carefully note when cman will be down and when it should be re-enabled either manually or permanently.&lt;br /&gt;
--[[User:SRSullivan|SRSullivan]] 17:44, 18 October 2010 (UTC)&lt;/div&gt;</summary>
		<author><name>SRSullivan</name></author>
	</entry>
	<entry>
		<id>https://alteeve.com/w/index.php?title=Two_Node_Fedora_13_Cluster_-_Xen-Based_Virtual_Machine_Host_on_DRBD%2BCLVM&amp;diff=2308</id>
		<title>Two Node Fedora 13 Cluster - Xen-Based Virtual Machine Host on DRBD+CLVM</title>
		<link rel="alternate" type="text/html" href="https://alteeve.com/w/index.php?title=Two_Node_Fedora_13_Cluster_-_Xen-Based_Virtual_Machine_Host_on_DRBD%2BCLVM&amp;diff=2308"/>
		<updated>2010-10-18T17:40:54Z</updated>

		<summary type="html">&lt;p&gt;SRSullivan: /* Making LVM Cluster-Aware */  Oversight notice, cman still off since reboot just before creating /dev/md3.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{howto_header}}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Warning&#039;&#039;&#039;: This is currently a dumping ground for notes. &#039;&#039;&#039;&#039;&#039;DO NOT FOLLOW THIS DOCUMENT&#039;S INSTRUCTIONS&#039;&#039;&#039;&#039;&#039;. Seriously, it could blow up your computer or cause winter to come early.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
This HowTo will walk you through setting up [[Xen]] [[VM]]s using [[DRBD]] and [[CLVM]] for high availability.&lt;br /&gt;
&lt;br /&gt;
= Prerequisite =&lt;br /&gt;
&lt;br /&gt;
This talk is an extension of the [[Two Node Fedora 13 Cluster]] HowTo. As such, you will be expected to have a freshly built two-node cluster with spare disk space on either node.&lt;br /&gt;
&lt;br /&gt;
Please do not proceed until you have completed the first tutorial.&lt;br /&gt;
&lt;br /&gt;
= Overview =&lt;br /&gt;
&lt;br /&gt;
This tutorial will cover several topics; [[DRBD]], [[CLVM]], [[GFS2]], [[Xen]] [[dom0]] and [[domU]] [[VM]]s and [[rgmanager]]. Their relationship is thus:&lt;br /&gt;
&lt;br /&gt;
* DRBD provides a mechanism to replicate data across both nodes in real time and guarantees a consistent view of that data from either node. Think of it like [[TLUG_Talk:_Storage_Technologies_and_Theory#Level_1|RAID level 1]], but across machines.&lt;br /&gt;
* CLVM sits on the DRBD partition and provides the underlying mechanism for allowing both nodes to access shared data in a clustered environment. It will host a shared filesystem by way of GFS2 as well as [[LV]]s that Xen&#039;s domU VMs will use as their disk space.&lt;br /&gt;
* GFS2 will be the clustered file system used on one of the DBRD-backed, CLVM-managed partitions. Files that need to be shared between nodes, like the Xen VM configuration files, will exist on this partition.&lt;br /&gt;
* Xen will be the hypervisor in use that will manage the various virtual machines. Each virtual machine will exist in an LVM LV.&lt;br /&gt;
** Xen&#039;s dom0 is the special &amp;quot;host&amp;quot; virtual machine. In this case, dom0 will be the OS installed in the first HowTo.&lt;br /&gt;
** Xen&#039;s domU virtual machines will be the &amp;quot;floating&amp;quot;, highly available servers.&lt;br /&gt;
* Lastly, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; will be the component of [[cman]] that will be configured to manage the automatic migration of the virtual machines when failures occur and when nodes recover.&lt;br /&gt;
&lt;br /&gt;
= Setting Up Xen =&lt;br /&gt;
&lt;br /&gt;
It may seem odd to start with [[Xen]] at this stage, but it is going to rather fundamentally alter each node&#039;s &amp;quot;host&amp;quot; operating system.&lt;br /&gt;
&lt;br /&gt;
At this point, each node&#039;s host OS is a traditional operating system operating on the bare metal. When we install a &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;dom0&amp;lt;/span&amp;gt; kernel though, we tell Xen to boot a mini operating system first, and then to boot our &amp;quot;host&amp;quot; operating system. In effect, this converts the host node&#039;s operating system into just another virtual machine, albeit with a special view of the underlying hardware and Xen hypervisor.&lt;br /&gt;
&lt;br /&gt;
This conversion is somewhat disruptive, so I like to get it out of the way right away. We will then do the rest of the setup before returning to Xen later on to create the floating virtual machines.&lt;br /&gt;
&lt;br /&gt;
== A Note On The State Of Xen dom0 Support In Fedora ==&lt;br /&gt;
&lt;br /&gt;
As of Fedora 8, support for Xen [[dom0]] has been removed, but support for the hypervisor and [[domU]] virtual machines remains. Red Hat&#039;s position is that KVM will be the supported platform going forward. That said, [http://fedoraproject.org/wiki/Features/XenPvopsDom0 this page] seems to indicate that PV Ops dom0 kernels will be supported in the future. Specifically, when dom0 support is merged into the mainline Linux kernel. When this will be is open to speculation, though &amp;quot;by Fedora 16&amp;quot; seems to be a reasonable educated guess.&lt;br /&gt;
&lt;br /&gt;
What this means for us is that we need to use a non-standard dom0 kernel. Specifically, we will use a kernel created by [http://myoung.fedorapeople.org/ myoung] (Micheal Young) for Fedora 12. This kernel does not directly support DRBD, so be aware that we will need to build new DRBD kernel modules for his kernel and then rebuild the DRBD modules each time his kernel is updated.&lt;br /&gt;
&lt;br /&gt;
== A Note On Rolling Your Own RPMs ==&lt;br /&gt;
&lt;br /&gt;
If you want to roll the source RPMs for both the hypervisor and the [[dom0]] kernel, you will need to make both before you can boot into your dom0 for the first time. This is because the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;dom0&amp;lt;/span&amp;gt; kernel needs the Xen microkernel provided by the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xen&amp;lt;/span&amp;gt; hypervisor package to boot.&lt;br /&gt;
&lt;br /&gt;
== Install The Hypervisor ==&lt;br /&gt;
&lt;br /&gt;
We will use [[Xen]] 4.0.1, as provided by [http://pasik.reaktio.net/fedora/ Pasik]. We&#039;ll use the [http://pasik.reaktio.net/fedora/xen-4.0.1-0.2.fc13.src.rpm source RPM] to build our own RPM.&lt;br /&gt;
&lt;br /&gt;
Regardless of whether you install from source RPMs or the pre-compiled ones, you will need to install the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;libvirt&amp;lt;/span&amp;gt;, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;qemu&amp;lt;/span&amp;gt;, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;SDL&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;PyXML&amp;lt;/span&amp;gt; packages from the standard repositories before you can proceed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum -y install libvirt PyXML.x86_64 qemu.x86_64 SDL.x86_64&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Please don&#039;t remove existing &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xen&amp;lt;/span&amp;gt; utilities and libraries prior to installing the newer version. If you do, core clustering components may be removed. Instead, be sure to use the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rpm -Uvh&amp;lt;/span&amp;gt; switches to upgrade the existing packages that may be installed already.&lt;br /&gt;
&lt;br /&gt;
=== Installing Prebuilt RPMs ===&lt;br /&gt;
&lt;br /&gt;
These are locally stored copies of the Xen RPMs built for [[x86_64]] on Fedora 13. This requires some dependent packages be installed first.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Warning&#039;&#039;&#039;: These are all recompiled for this website against Fedora 13, x86_64. If you feel more comfortable, please use [[RPM]]s from a source you are familiar with.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cd ~&lt;br /&gt;
wget -c https://alteeve.com/files/an-cluster/xen-4.0.1-0.2.fc13.x86_64.rpm&lt;br /&gt;
wget -c https://alteeve.com/files/an-cluster/xen-doc-4.0.1-0.2.fc13.x86_64.rpm&lt;br /&gt;
wget -c https://alteeve.com/files/an-cluster/xen-hypervisor-4.0.1-0.2.fc13.x86_64.rpm&lt;br /&gt;
wget -c https://alteeve.com/files/an-cluster/xen-libs-4.0.1-0.2.fc13.x86_64.rpm&lt;br /&gt;
wget -c https://alteeve.com/files/an-cluster/xen-runtime-4.0.1-0.2.fc13.x86_64.rpm&lt;br /&gt;
rpm -Uvh xen*4.0.1-0.2.fc13.x86_64.rpm&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Optionally, you may wish to install &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;debug&amp;lt;/span&amp;gt; and/or &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;devel&amp;lt;/span&amp;gt; RPMs as well.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
wget -c https://alteeve.com/files/xen-debuginfo-4.0.1-0.2.fc13.x86_64.rpm&lt;br /&gt;
wget -c https://alteeve.com/files/xen-devel-4.0.1-0.2.fc13.x86_64.rpm&lt;br /&gt;
rpm -Uvh xen-d*4.0.1-0.2.fc13.x86_64.rpm&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Building RPMs From Source ===&lt;br /&gt;
&lt;br /&gt;
To build the RPMs from the source, you need to make sure that you have the build environment installed. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: If you are following these instruction after having installed a prior dom0 kernel, you will need to comment out &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;exclude=kernel*&amp;lt;/span&amp;gt; in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/yum.conf&amp;lt;/span&amp;gt; so that the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;kernel-header&amp;lt;/span&amp;gt; package can be installed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/yum.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
# PUT YOUR REPOS HERE OR IN separate files named file.repo&lt;br /&gt;
# in /etc/yum.repos.d&lt;br /&gt;
#exclude=kernel*&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now install the development environment.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum -y groupinstall &amp;quot;Development Libraries&amp;quot;&lt;br /&gt;
yum -y groupinstall &amp;quot;Development Tools&amp;quot;&lt;br /&gt;
yum install transfig texi2html SDL-devel libX11-devel tetex-latex gtk2-devel libaio-devel dev86 iasl xz-devel e2fsprogs-devel glibc-devel.i686 xmlto asciidoc elfutils-libelf-devel&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: If you had to uncomment the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;exclude=kernel*&amp;lt;/span&amp;gt; line earlier, comment it back out now before you forget.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/yum.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
# PUT YOUR REPOS HERE OR IN separate files named file.repo&lt;br /&gt;
# in /etc/yum.repos.d&lt;br /&gt;
exclude=kernel*&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we can now build the RPMs from source.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cd ~&lt;br /&gt;
wget -c https://alteeve.com/files/an-cluster/xen-4.0.1-0.2.fc13.src.rpm&lt;br /&gt;
rpm -ivh xen-4.0.1-0.2.fc13.src.rpm&lt;br /&gt;
cd /root/rpmbuild/SPECS/&lt;br /&gt;
rpmbuild -ba xen.spec&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once this is done, you will have seven RPMs built. Two of them are not really needed (&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xen-debuginfo-4.0.1-0.2.fc13.x86_64.rpm&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xen-devel-4.0.1-0.2.fc13.x86_64.rpm&amp;lt;/span&amp;gt;) and I will leave it up to you may wish to install them or not. If you don&#039;t, modify the next command or move the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;debug&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;devel&amp;lt;/span&amp;gt; RPMs out of the way first.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cd ~/rpmbuild/RPMS/x86_64/&lt;br /&gt;
rpm -Uvh xen*4.0.1-0.2.fc13.x86_64.rpm&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Installing The AN!Cluster dom0 Kernel ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Notice&#039;&#039;&#039;!&lt;br /&gt;
&lt;br /&gt;
The kernel provided here was recompiled on Fedora 13 and is a slightly modified version of [[#Installing Micheal Young&#039;s dom0 Kernel|Micheal Young&#039;s]] kernel available below. I was originally driven to recompile in an effort to solve a DRBD-related kernel oops. For now, unless you have the same DRBD kernel oops, I&#039;d strongly recommend against using the AN!Cluster dom0 kernel until it has been tested much more thoroughly.&lt;br /&gt;
&lt;br /&gt;
With that warning out of the way...&lt;br /&gt;
&lt;br /&gt;
This kernel was compiled on a Fedora 13, x86_64. The DRBD RPMs available a little later where compiled against this dom0 kernel. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--force&amp;lt;/span&amp;gt; is required because the current kernel is newer than &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;2.6.32&amp;lt;/span&amp;gt; used here. Without this switch, the RPM would not install.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cd ~&lt;br /&gt;
wget -c https://alteeve.com/files/an-cluster/kernel-2.6.32.23-170.dom0_an1.fc13.x86_64.rpm&lt;br /&gt;
rpm -ivh --force kernel-2.6.32.23-170.dom0_an1.fc13.x86_64.rpm&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you would like to install the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;debug&amp;lt;/span&amp;gt;, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;devel&amp;lt;/span&amp;gt; and/or &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;header&amp;lt;/span&amp;gt; RPMs for this kernel, they are available below.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;kernel-debuginfo-2.6.32.23-170.dom0_an1.fc13.x86_64.rpm&amp;lt;/span&amp;gt; RPM is 213 [[MiB]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
wget -c https://alteeve.com/files/an-cluster/kernel-2.6.32.23-170.dom0_an1.fc13.x86_64.rpm&lt;br /&gt;
wget -c https://alteeve.com/files/an-cluster/kernel-debuginfo-2.6.32.23-170.dom0_an1.fc13.x86_64.rpm&lt;br /&gt;
wget -c https://alteeve.com/files/an-cluster/kernel-devel-2.6.32.23-170.dom0_an1.fc13.x86_64.rpm&lt;br /&gt;
wget -c https://alteeve.com/files/an-cluster/kernel-headers-2.6.32.23-170.dom0_an1.fc13.x86_64.rpm&lt;br /&gt;
rpm -ivh --force kernel-de*-2.6.32.23-170.dom0_an1.fc13.x86_64.rpm kernel-headers-2.6.32.23-170.dom0_an1.fc13.x86_64.rpm&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Post AN!Cluster dom0 Install Configuration ===&lt;br /&gt;
&lt;br /&gt;
The entry in grub&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/boot/grub/menu.lst&amp;lt;/span&amp;gt; won&#039;t work. You will need to edit it so that it calls the existing installed operating system as a &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;module&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: Copy and modify the entry created by the RPM. Simply copying this entry will almost certainly not work! Your &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;root=&amp;lt;/span&amp;gt; is likely different and your &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rd_MD_UUID=&amp;lt;/span&amp;gt; will definitely be different, even on the same machine across installs. Generally speaking, what follows the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;kernel /vmlinuz-2.6.32.23-170.dom0_an1.fc13.x86_64 ...&amp;lt;/span&amp;gt; entry made by the dom0 kernel can be copied after the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;module /vmlinuz-2.6.32.23-170.dom0_an1.fc13.x86_64 ...&amp;lt;/span&amp;gt; entry in the example below.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /boot/grub/menu.lst&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
title Xen 4.0.x, Linux 2.6.32.23-170.dom0_an1.fc13.x86_64&lt;br /&gt;
        root   (hd0,0)&lt;br /&gt;
        kernel /xen.gz dom0_mem=1024M&lt;br /&gt;
        module /vmlinuz-2.6.32.23-170.dom0_an1.fc13.x86_64 ...&lt;br /&gt;
        module /initramfs-2.6.32.23-170.dom0_an1.fc13.x86_64.img&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Installing Micheal Young&#039;s dom0 Kernel ==&lt;br /&gt;
&lt;br /&gt;
This uses a kernel built for Fedora 12, but it works on Fedora 13. This step involves either installing it over HTML or adding and enabling his repository and then installing it from there.&lt;br /&gt;
&lt;br /&gt;
=== Installing Via myoung&#039;s Repository ===&lt;br /&gt;
&lt;br /&gt;
This is almost always the preferred method. However, do note that when myoung updates his kernel, there will be a lag where the dom0 dependent RPMs provided here will no longer be compatible.&lt;br /&gt;
&lt;br /&gt;
To add the repository, download the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;myoung.dom0.repo&amp;lt;/span&amp;gt; into the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/yum.repos.d/&amp;lt;/span&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cd /etc/yum.repos.d/&lt;br /&gt;
wget -c http://myoung.fedorapeople.org/dom0/myoung.dom0.repo&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To enable his repository, edit the repository file and change the two &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;enabled=0&amp;lt;/span&amp;gt; entries to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;enabled=1&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/yum.repos.d/myoung.dom0.repo&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
[myoung-dom0]&lt;br /&gt;
name=myoung&#039;s repository of Fedora based dom0 kernels - $basearch&lt;br /&gt;
baseurl=http://fedorapeople.org/~myoung/dom0/$basearch/&lt;br /&gt;
enabled=1&lt;br /&gt;
gpgcheck=0&lt;br /&gt;
&lt;br /&gt;
[myoung-dom0-source]&lt;br /&gt;
name=myoung&#039;s repository of Fedora based dom0 kernels - Source&lt;br /&gt;
baseurl=http://fedorapeople.org/~myoung/dom0/src/&lt;br /&gt;
enabled=1&lt;br /&gt;
gpgcheck=0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Install the [[Xen]] [[dom0]] kernel (edit the version number with the updated version if it has changed).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install kernel-2.6.32.21-170.xendom0.fc12.x86_64&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Post Michael Young&#039;s dom0 Install Configuration ===&lt;br /&gt;
&lt;br /&gt;
The entry in grub&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/boot/grub/menu.lst&amp;lt;/span&amp;gt; won&#039;t work. You will need to edit it so that it calls the existing installed operating system as a &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;module&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: Copy and modify the entry created by the RPM. Simply copying this entry will almost certainly not work! Your &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;root=&amp;lt;/span&amp;gt; is likely different and your &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rd_MD_UUID=&amp;lt;/span&amp;gt; will definitely be different, even on the same machine across installs. Generally speaking, what follows the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;kernel /vmlinuz-2.6.32.21-170.xendom0.fc12.x86_64 ...&amp;lt;/span&amp;gt; entry made by the dom0 kernel can be copied after the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;module /vmlinuz-2.6.32.21-170.xendom0.fc12.x86_64 ...&amp;lt;/span&amp;gt; entry in the example below.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /boot/grub/menu.lst&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
title Xen 4.0.x, Linux kernel 2.6.32.21-170.xendom0.fc12.x86_64&lt;br /&gt;
	root   (hd0,0)&lt;br /&gt;
	kernel /xen.gz dom0_mem=1024M&lt;br /&gt;
	module /vmlinuz-2.6.32.21-170.xendom0.fc12.x86_64 ...&lt;br /&gt;
	module /initramfs-2.6.32.21-170.xendom0.fc12.x86_64.img&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Disabling Automatic Kernel Updates ===&lt;br /&gt;
&lt;br /&gt;
Seeing as we&#039;re using an older kernel, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;yum&amp;lt;/span&amp;gt; will want to replace it whenever there is an updated &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;kernel*&amp;lt;/span&amp;gt; package available. Likewise if myoung updates his kernel. In the latter case, the updated kernel from Mr. Young would break compatibility with our DRBD module. So to be safe, we want to tell &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;yum&amp;lt;/span&amp;gt; to never update the kernel.&lt;br /&gt;
&lt;br /&gt;
To do this, we need to add &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;exclude=kernel*&amp;lt;/span&amp;gt; to the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/yum.conf&amp;lt;/span&amp;gt; file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
echo &amp;quot;exclude=kernel*&amp;quot; &amp;gt;&amp;gt; /etc/yum.conf&lt;br /&gt;
cat /etc/yum.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
[main]&lt;br /&gt;
cachedir=/var/cache/yum/$basearch/$releasever&lt;br /&gt;
keepcache=0&lt;br /&gt;
debuglevel=2&lt;br /&gt;
logfile=/var/log/yum.log&lt;br /&gt;
exactarch=1&lt;br /&gt;
obsoletes=1&lt;br /&gt;
gpgcheck=1&lt;br /&gt;
plugins=1&lt;br /&gt;
installonly_limit=3&lt;br /&gt;
color=never&lt;br /&gt;
&lt;br /&gt;
#  This is the default, if you make this bigger yum won&#039;t see if the metadata&lt;br /&gt;
# is newer on the remote and so you&#039;ll &amp;quot;gain&amp;quot; the bandwidth of not having to&lt;br /&gt;
# download the new metadata and &amp;quot;pay&amp;quot; for it by yum not having correct&lt;br /&gt;
# information.&lt;br /&gt;
#  It is esp. important, to have correct metadata, for distributions like&lt;br /&gt;
# Fedora which don&#039;t keep old packages around. If you don&#039;t like this checking&lt;br /&gt;
# interupting your command line usage, it&#039;s much better to have something&lt;br /&gt;
# manually check the metadata once an hour (yum-updatesd will do this).&lt;br /&gt;
# metadata_expire=90m&lt;br /&gt;
&lt;br /&gt;
# PUT YOUR REPOS HERE OR IN separate files named file.repo&lt;br /&gt;
# in /etc/yum.repos.d&lt;br /&gt;
&lt;br /&gt;
exclude=kernel*&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Make xend play nice with clustering ===&lt;br /&gt;
&lt;br /&gt;
By default under Fedora 13, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt; will start before &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xend&amp;lt;/span&amp;gt;. This is a problem because &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xend&amp;lt;/span&amp;gt; takes the network down as part of it&#039;s setup. This causes [[totem]] communication to fail which leads to fencing.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: Move &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xenconsoled&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xenstore&amp;lt;/span&amp;gt; to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;09&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;10&amp;lt;/span&amp;gt; start positions and then make &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xend&amp;lt;/span&amp;gt; depend on the before starting.&lt;br /&gt;
&lt;br /&gt;
To avoid this, edit the initialization scripts for &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/init.d/xend&amp;lt;/span&amp;gt; and it&#039;s dependents &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xenconsoled&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xenstore&amp;lt;/span&amp;gt; to have a lower minimum start position. We need to maintain the start order of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xenstore&amp;lt;/span&amp;gt; first, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xenconsoled&amp;lt;/span&amp;gt; second and lastly &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xend&amp;lt;/span&amp;gt;. By default, their minimum start positions are &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;96&amp;lt;/span&amp;gt;, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;97&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;98&amp;lt;/span&amp;gt; respectively. We will change these to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;10&amp;lt;/span&amp;gt;, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;11&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;12&amp;lt;/span&amp;gt;, again, respectively.&lt;br /&gt;
&lt;br /&gt;
Note that we are &#039;&#039;&#039;not&#039;&#039;&#039; altering the start position of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xendomains&amp;lt;/span&amp;gt;! This is intentional as this daemon will start the [[domU]] VMs. This can not happen until all other cluster related daemons have started.&lt;br /&gt;
&lt;br /&gt;
To change the start order we will change the line &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;chkconfig: 2345 9x 01&amp;lt;/span&amp;gt; lines to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;chkconfig: 2345 1x 01&amp;lt;/span&amp;gt;, where &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;x&amp;lt;/span&amp;gt; is the given daemon&#039;s start number. Further, we&#039;ll make sure that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xenstored&amp;lt;/span&amp;gt; begins first by add it to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xenconsoled&amp;lt;/span&amp;gt;&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Required-Start&amp;lt;/span&amp;gt; line. We&#039;ll then make sure that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xenconsoled&amp;lt;/span&amp;gt; starts before &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xend&amp;lt;/span&amp;gt; by adding it to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xend&amp;lt;/span&amp;gt;&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Required-Start&amp;lt;/span&amp;gt; line.&lt;br /&gt;
&lt;br /&gt;
To recap the changes;&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xenstored&amp;lt;/span&amp;gt; will start first.&lt;br /&gt;
** We&#039;ll change it&#039;s start position from &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;96&amp;lt;/span&amp;gt; to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;10&amp;lt;/span&amp;gt;.&lt;br /&gt;
** We will not add anything to it&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Required-Start&amp;lt;/span&amp;gt; as it must be the first daemon to come up.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xenconsoled&amp;lt;/span&amp;gt; will start second.&lt;br /&gt;
** We&#039;ll change it&#039;s start position from &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;97&amp;lt;/span&amp;gt; to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;11&amp;lt;/span&amp;gt;.&lt;br /&gt;
** We will add &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xenstored&amp;lt;/span&amp;gt; to it&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Required-Start&amp;lt;/span&amp;gt; line.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xend&amp;lt;/span&amp;gt; will start third.&lt;br /&gt;
** We&#039;ll change it&#039;s start position from &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;98&amp;lt;/span&amp;gt; to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;12&amp;lt;/span&amp;gt;.&lt;br /&gt;
** We will add &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xenconsoled&amp;lt;/span&amp;gt; to it&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Required-Start&amp;lt;/span&amp;gt; line.&lt;br /&gt;
&lt;br /&gt;
When done, the three initialization scripts should look like the examples below.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/init.d/xenstored&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
#&lt;br /&gt;
# xenstored     Script to start and stop the Xen control daemon.&lt;br /&gt;
#&lt;br /&gt;
# Author:       Daniel Berrange &amp;lt;berrange@redhat.com&lt;br /&gt;
#&lt;br /&gt;
# chkconfig: 2345 10 01&lt;br /&gt;
# description: Starts and stops the Xen xenstored daemon.&lt;br /&gt;
### BEGIN INIT INFO&lt;br /&gt;
# Provides:          xenstored&lt;br /&gt;
# Required-Start:    $syslog $remote_fs&lt;br /&gt;
# Should-Start:&lt;br /&gt;
# Required-Stop:     $syslog $remote_fs&lt;br /&gt;
# Should-Stop:&lt;br /&gt;
# Default-Start:     3 4 5&lt;br /&gt;
# Default-Stop:      0 1 2 6&lt;br /&gt;
# Default-Enabled:   yes&lt;br /&gt;
# Short-Description: Start/stop xenstored&lt;br /&gt;
# Description:       Starts and stops the Xen xenstored daemon.&lt;br /&gt;
### END INIT INFO&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/init.d/xenconsoled&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
#&lt;br /&gt;
# xenconsoled   Script to start and stop the Xen xenconsoled daemon&lt;br /&gt;
#&lt;br /&gt;
# Author:       Daniel P. Berrange &amp;lt;berrange@redhat.com&amp;gt;&lt;br /&gt;
#&lt;br /&gt;
# chkconfig: 2345 11 01&lt;br /&gt;
# description: Starts and stops the Xen control daemon.&lt;br /&gt;
### BEGIN INIT INFO&lt;br /&gt;
# Provides:          xenconsoled&lt;br /&gt;
# Required-Start:    $syslog $remote_fs xenstored&lt;br /&gt;
# Should-Start:&lt;br /&gt;
# Required-Stop:     $syslog $remote_fs&lt;br /&gt;
# Should-Stop:&lt;br /&gt;
# Default-Start:     3 4 5&lt;br /&gt;
# Default-Stop:      0 1 2 6&lt;br /&gt;
# Default-Enabled:   yes&lt;br /&gt;
# Short-Description: Start/stop xenconsoled&lt;br /&gt;
# Description:       Starts and stops the Xen xenconsoled daemon.&lt;br /&gt;
### END INIT INFO&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/init.d/xend&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
#&lt;br /&gt;
# xend          Script to start and stop the Xen control daemon.&lt;br /&gt;
#&lt;br /&gt;
# Author:       Keir Fraser &amp;lt;keir.fraser@cl.cam.ac.uk&amp;gt;&lt;br /&gt;
#&lt;br /&gt;
# chkconfig: 2345 12 98&lt;br /&gt;
# description: Starts and stops the Xen control daemon.&lt;br /&gt;
### BEGIN INIT INFO&lt;br /&gt;
# Provides:          xend&lt;br /&gt;
# Required-Start:    $syslog $remote_fs xenconsoled&lt;br /&gt;
# Should-Start:&lt;br /&gt;
# Required-Stop:     $syslog $remote_fs&lt;br /&gt;
# Should-Stop:&lt;br /&gt;
# Default-Start:     3 4 5&lt;br /&gt;
# Default-Stop:      0 1 2 6&lt;br /&gt;
# Default-Enabled:   yes&lt;br /&gt;
# Short-Description: Start/stop xend&lt;br /&gt;
# Description:       Starts and stops the Xen control daemon.&lt;br /&gt;
### END INIT INFO&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xend&amp;lt;/span&amp;gt; set to start at a position lower than &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;98&amp;lt;/span&amp;gt;, we now have room for &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;chkconfig&amp;lt;/span&amp;gt; to put other daemons after it in the start order, which will be needed a little later. First and foremost, we now need to tell &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt; to not start until after &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xend&amp;lt;/span&amp;gt; is up.&lt;br /&gt;
&lt;br /&gt;
As above, we will now edit &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt;&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/init.d/cman&amp;lt;/span&amp;gt; script. This time though, we will not edit it&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;chkconfig&amp;lt;/span&amp;gt; line. Instead, we will simply add &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xend&amp;lt;/span&amp;gt; to the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Required-Start&amp;lt;/span&amp;gt; line.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/init.d/cman&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
#&lt;br /&gt;
# cman - Cluster Manager init script&lt;br /&gt;
#&lt;br /&gt;
# chkconfig: - 21 79&lt;br /&gt;
# description: Starts and stops cman&lt;br /&gt;
#&lt;br /&gt;
#&lt;br /&gt;
### BEGIN INIT INFO&lt;br /&gt;
# Provides:             cman&lt;br /&gt;
# Required-Start:       $network $time xend&lt;br /&gt;
# Required-Stop:        $network $time&lt;br /&gt;
# Default-Start:&lt;br /&gt;
# Default-Stop:&lt;br /&gt;
# Short-Description:    Starts and stops cman&lt;br /&gt;
# Description:          Starts and stops the Cluster Manager set of daemons&lt;br /&gt;
### END INIT INFO&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Finally, remove and re-add the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xend&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt; daemons to re-order them in the start list:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
chkconfig xenstored off; chkconfig xenconsoled off; chkconfig xend off; chkconfig cman off; &lt;br /&gt;
chkconfig xenstored on; chkconfig xenconsoled on; chkconfig xend on; chkconfig cman on&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Confirm that the order has changed so that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xend&amp;lt;/span&amp;gt; is earlier in the boot sequence than &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt;. Assuming you&#039;ve switched to run-level 3, run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ls -lah /etc/rc3.d/&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Your start sequence should now look like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
lrwxrwxrwx.  1 root root   19 Sep 15 19:29 S26xenstored -&amp;gt; ../init.d/xenstored&lt;br /&gt;
lrwxrwxrwx.  1 root root   21 Sep 15 19:29 S27xenconsoled -&amp;gt; ../init.d/xenconsoled&lt;br /&gt;
lrwxrwxrwx.  1 root root   14 Sep 15 19:29 S28xend -&amp;gt; ../init.d/xend&lt;br /&gt;
lrwxrwxrwx.  1 root root   14 Sep 15 19:29 S29cman -&amp;gt; ../init.d/cman&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Booting Into The New dom0 ===&lt;br /&gt;
&lt;br /&gt;
If everything went well, you should be able to boot the new dom0 operating system. If you watch the boot process closely, you will see that the boot process is different. You should now see the Xen hypervisor boot prior to handing off to the &amp;quot;host&amp;quot; operating system. This can be confirmed once the dom0 operating system has booted by checking that the file &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/proc/xen/capabilities&amp;lt;/span&amp;gt; exists. What it contains doesn&#039;t matter at this stage, only that it exists at all.&lt;br /&gt;
&lt;br /&gt;
== Configure Networking ==&lt;br /&gt;
&lt;br /&gt;
Networking in Xen, particularly in a cluster, can be confusing. If you are not familiar with networking in Xen, please review to following article before proceeding.&lt;br /&gt;
&lt;br /&gt;
A note of a major change from previous layouts. In Xen 3.x, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ethX&amp;lt;/span&amp;gt; would be copied to a virtual interface called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vethX&amp;lt;/span&amp;gt;. Then the real &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ethX&amp;lt;/span&amp;gt; would be renamed to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;pethX&amp;lt;/span&amp;gt; and the virtual interface &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vethX&amp;lt;/span&amp;gt; would be renamed to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ethX&amp;lt;/span&amp;gt; to take it&#039;s place. Finally, a bridge called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xenbrX&amp;lt;/span&amp;gt; would be created and the real &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;pethX&amp;lt;/span&amp;gt; and virtual &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ethX&amp;lt;/span&amp;gt; would be connected to it.&lt;br /&gt;
&lt;br /&gt;
This has been changed somewhat it that now, by default, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ethX&amp;lt;/span&amp;gt; is left alone and a simple bridge called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virbrX&amp;lt;/span&amp;gt; would be created. We&#039;ll be changing this to be somewhat similar to the old style.&lt;br /&gt;
&lt;br /&gt;
Specifically, the real &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ethX&amp;lt;/span&amp;gt; will be renamed to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;pethX&amp;lt;/span&amp;gt;. Then a bridge will be created called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ethX&amp;lt;/span&amp;gt;, which plays the role of dom0&#039;s interface &#039;&#039;&#039;and&#039;&#039;&#039; bridges connections from VMs through &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;pethX&amp;lt;/span&amp;gt; and out into the real world.&lt;br /&gt;
&lt;br /&gt;
This is explained in more detail, and with diagrams, in the article below.&lt;br /&gt;
&lt;br /&gt;
* [[Networking in Xen]]&lt;br /&gt;
&lt;br /&gt;
=== Adding New NICs to Xen ===&lt;br /&gt;
&lt;br /&gt;
By default, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xend&amp;lt;/span&amp;gt; manages &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth0&amp;lt;/span&amp;gt; only. We need to add &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth2&amp;lt;/span&amp;gt;. Personally, I don&#039;t like to put the storage network ethernet devices (eth1) under Xen&#039;s control as this potentially can cause DRBD problems on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xend&amp;lt;/span&amp;gt; restart. Whether you add it or not I will leave to your preferences.&lt;br /&gt;
&lt;br /&gt;
You can see which, if any, network devices are under Xen&#039;s control by running &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ifconfig&amp;lt;/span&amp;gt; and checking to see if there is a &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virbrX&amp;lt;/span&amp;gt; corresponding to a given &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ethX&amp;lt;/span&amp;gt; device.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ifconfig&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
eth0      Link encap:Ethernet  HWaddr 48:5B:39:3C:53:14  &lt;br /&gt;
          inet addr:192.168.1.74  Bcast:192.168.1.255  Mask:255.255.255.0&lt;br /&gt;
          inet6 addr: fe80::4a5b:39ff:fe3c:5314/64 Scope:Link&lt;br /&gt;
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1&lt;br /&gt;
          RX packets:224261 errors:0 dropped:0 overruns:0 frame:0&lt;br /&gt;
          TX packets:55174 errors:0 dropped:0 overruns:0 carrier:0&lt;br /&gt;
          collisions:0 txqueuelen:1000 &lt;br /&gt;
          RX bytes:319384110 (304.5 MiB)  TX bytes:27348739 (26.0 MiB)&lt;br /&gt;
          Interrupt:225 Base address:0x8000 &lt;br /&gt;
&lt;br /&gt;
eth1      Link encap:Ethernet  HWaddr 00:1B:21:72:9B:5A  &lt;br /&gt;
          inet addr:192.168.2.74  Bcast:192.168.2.255  Mask:255.255.255.0&lt;br /&gt;
          inet6 addr: fe80::21b:21ff:fe72:9b5a/64 Scope:Link&lt;br /&gt;
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1&lt;br /&gt;
          RX packets:2 errors:0 dropped:0 overruns:0 frame:0&lt;br /&gt;
          TX packets:36 errors:0 dropped:0 overruns:0 carrier:0&lt;br /&gt;
          collisions:0 txqueuelen:1000 &lt;br /&gt;
          RX bytes:832 (832.0 b)  TX bytes:6234 (6.0 KiB)&lt;br /&gt;
          Memory:feae0000-feb00000 &lt;br /&gt;
&lt;br /&gt;
eth2      Link encap:Ethernet  HWaddr 00:1B:21:72:96:EA  &lt;br /&gt;
          inet addr:192.168.3.74  Bcast:192.168.3.255  Mask:255.255.255.0&lt;br /&gt;
          inet6 addr: fe80::21b:21ff:fe72:96ea/64 Scope:Link&lt;br /&gt;
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1&lt;br /&gt;
          RX packets:2 errors:0 dropped:0 overruns:0 frame:0&lt;br /&gt;
          TX packets:34 errors:0 dropped:0 overruns:0 carrier:0&lt;br /&gt;
          collisions:0 txqueuelen:1000 &lt;br /&gt;
          RX bytes:818 (818.0 b)  TX bytes:6081 (5.9 KiB)&lt;br /&gt;
          Memory:fe9e0000-fea00000 &lt;br /&gt;
&lt;br /&gt;
lo        Link encap:Local Loopback  &lt;br /&gt;
          inet addr:127.0.0.1  Mask:255.0.0.0&lt;br /&gt;
          inet6 addr: ::1/128 Scope:Host&lt;br /&gt;
          UP LOOPBACK RUNNING  MTU:16436  Metric:1&lt;br /&gt;
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0&lt;br /&gt;
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0&lt;br /&gt;
          collisions:0 txqueuelen:0 &lt;br /&gt;
          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)&lt;br /&gt;
&lt;br /&gt;
virbr0    Link encap:Ethernet  HWaddr 02:23:C8:98:31:17  &lt;br /&gt;
          inet addr:192.168.122.1  Bcast:192.168.122.255  Mask:255.255.255.0&lt;br /&gt;
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1&lt;br /&gt;
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0&lt;br /&gt;
          TX packets:15 errors:0 dropped:0 overruns:0 carrier:0&lt;br /&gt;
          collisions:0 txqueuelen:0 &lt;br /&gt;
          RX bytes:0 (0.0 b)  TX bytes:4013 (3.9 KiB)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the above example, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth0&amp;lt;/span&amp;gt; has a corresponding &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virbr0&amp;lt;/span&amp;gt; bridge having it&#039;s own subnet. In non-clustered systems, this is fine. For our purposes though, it will not do.&lt;br /&gt;
&lt;br /&gt;
=== Removing The qemu virbr0 Bridge ===&lt;br /&gt;
&lt;br /&gt;
By default, [[QEMU]] creates a bridge called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virbr0&amp;lt;/span&amp;gt; designed to connect virtual machines to the first &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth0&amp;lt;/span&amp;gt; interface. Our system will not need this, so we will remove it. This bridge is configured in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/libvirt/qemu/networks/default.xml&amp;lt;/span&amp;gt; file, so to remove this bridge, simply delete the contents of the file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cat /dev/null &amp;gt;/etc/libvirt/qemu/networks/default.xml&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The next time you reboot, that bridge will be gone.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Madi&#039;&#039;&#039;: Put in the command to delete the bridge before a reboot.&lt;br /&gt;
&lt;br /&gt;
=== Create /etc/xen/scripts/an-network-script ===&lt;br /&gt;
&lt;br /&gt;
This script will be used by Xen to turn the dom0 &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ethX&amp;lt;/span&amp;gt; interfaces into bridges. All traffic to the bridge, be it from dom0 or domU VMs, will be routeable out of the corresponding &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;pethX&amp;lt;/span&amp;gt; device. As domU VMs come online, a hotplug script will create virtual interfaces between this new bridge and the domU&#039;s interface(s). Think of the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vifX.Y&amp;lt;/span&amp;gt; devices as being the network cables you&#039;d normally run between a server and a switch.&lt;br /&gt;
&lt;br /&gt;
Before we proceed, please note three things;&lt;br /&gt;
# You don&#039;t need to use the file name &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-network-script&amp;lt;/span&amp;gt;. I suggest this name mainly to keep in line with the rest of the &#039;AN!x&#039; naming used here.&lt;br /&gt;
# If you install &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;convirt&amp;lt;/span&amp;gt; or other hypervisor tools, they will likely create their own bridge script.&lt;br /&gt;
# Adding &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth1&amp;lt;/span&amp;gt; is optional, as we know ahead of time that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth1&amp;lt;/span&amp;gt; will not be made available to any virtual machines as it is dedicated to [[DRBD]]. I&#039;m adding it here because I like having things consistent; Do whichever makes more sense to you.&lt;br /&gt;
&lt;br /&gt;
First, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;touch&amp;lt;/span&amp;gt; the file and then &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;chmod&amp;lt;/span&amp;gt; it to be executable.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
touch /etc/xen/scripts/an-network-script&lt;br /&gt;
chmod 755 /etc/xen/scripts/an-network-script&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now edit it to contain the following:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/xen/scripts/an-network-script&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
dir=$(dirname &amp;quot;$0&amp;quot;)&lt;br /&gt;
&amp;quot;$dir/network-bridge&amp;quot; &amp;quot;$@&amp;quot; vifnum=0 netdev=eth0 bridge=eth0&lt;br /&gt;
&amp;quot;$dir/network-bridge&amp;quot; &amp;quot;$@&amp;quot; vifnum=2 netdev=eth2 bridge=eth2&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now tell Xen to execute that script by editing &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/xen/xend-config.sxp&amp;lt;/span&amp;gt; file and changing the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;network-script&amp;lt;/span&amp;gt; argument to point to this new script (this is line 158 in the default &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xend-config.sxp&amp;lt;/span&amp;gt; script):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/xen/xend-config.sxp&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
#(network-script network-bridge)&lt;br /&gt;
#(network-script /bin/true)&lt;br /&gt;
(network-script an-network-script)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Warning&#039;&#039;&#039;: The next step may trigger fencing of the nodes! As such, be sure that you&#039;re not running anything critical. If unsure, please stop &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt; or reboot the nodes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/cman stop&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now restart &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xend&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/xend restart&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If everything worked, you should now be able to run &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ifconfig&amp;lt;/span&amp;gt; and see that all the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ethX&amp;lt;/span&amp;gt; devices have matching &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;pethX&amp;lt;/span&amp;gt;, virtual and bridge devices.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ifconfig&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
eth0      Link encap:Ethernet  HWaddr 48:5B:39:3C:53:14  &lt;br /&gt;
          inet addr:192.168.1.74  Bcast:192.168.1.255  Mask:255.255.255.0&lt;br /&gt;
          inet6 addr: fe80::4a5b:39ff:fe3c:5314/64 Scope:Link&lt;br /&gt;
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1&lt;br /&gt;
          RX packets:78 errors:0 dropped:0 overruns:0 frame:0&lt;br /&gt;
          TX packets:57 errors:0 dropped:0 overruns:0 carrier:0&lt;br /&gt;
          collisions:0 txqueuelen:0 &lt;br /&gt;
          RX bytes:9796 (9.5 KiB)  TX bytes:12574 (12.2 KiB)&lt;br /&gt;
&lt;br /&gt;
eth1      Link encap:Ethernet  HWaddr 00:1B:21:72:9B:5A  &lt;br /&gt;
          inet addr:192.168.2.74  Bcast:192.168.2.255  Mask:255.255.255.0&lt;br /&gt;
          inet6 addr: fe80::21b:21ff:fe72:9b5a/64 Scope:Link&lt;br /&gt;
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1&lt;br /&gt;
          RX packets:2 errors:0 dropped:0 overruns:0 frame:0&lt;br /&gt;
          TX packets:36 errors:0 dropped:0 overruns:0 carrier:0&lt;br /&gt;
          collisions:0 txqueuelen:1000 &lt;br /&gt;
          RX bytes:832 (832.0 b)  TX bytes:6234 (6.0 KiB)&lt;br /&gt;
          Memory:feae0000-feb00000 &lt;br /&gt;
&lt;br /&gt;
eth2      Link encap:Ethernet  HWaddr 00:1B:21:72:96:EA  &lt;br /&gt;
          inet addr:192.168.3.74  Bcast:192.168.3.255  Mask:255.255.255.0&lt;br /&gt;
          inet6 addr: fe80::21b:21ff:fe72:96ea/64 Scope:Link&lt;br /&gt;
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1&lt;br /&gt;
          RX packets:32 errors:0 dropped:0 overruns:0 frame:0&lt;br /&gt;
          TX packets:29 errors:0 dropped:0 overruns:0 carrier:0&lt;br /&gt;
          collisions:0 txqueuelen:0 &lt;br /&gt;
          RX bytes:5471 (5.3 KiB)  TX bytes:5867 (5.7 KiB)&lt;br /&gt;
&lt;br /&gt;
lo        Link encap:Local Loopback  &lt;br /&gt;
          inet addr:127.0.0.1  Mask:255.0.0.0&lt;br /&gt;
          inet6 addr: ::1/128 Scope:Host&lt;br /&gt;
          UP LOOPBACK RUNNING  MTU:16436  Metric:1&lt;br /&gt;
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0&lt;br /&gt;
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0&lt;br /&gt;
          collisions:0 txqueuelen:0 &lt;br /&gt;
          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)&lt;br /&gt;
&lt;br /&gt;
peth0     Link encap:Ethernet  HWaddr 48:5B:39:3C:53:14  &lt;br /&gt;
          inet6 addr: fe80::4a5b:39ff:fe3c:5314/64 Scope:Link&lt;br /&gt;
          UP BROADCAST RUNNING PROMISC MULTICAST  MTU:1500  Metric:1&lt;br /&gt;
          RX packets:224486 errors:0 dropped:0 overruns:0 frame:0&lt;br /&gt;
          TX packets:55349 errors:0 dropped:0 overruns:0 carrier:0&lt;br /&gt;
          collisions:0 txqueuelen:1000 &lt;br /&gt;
          RX bytes:319406626 (304.6 MiB)  TX bytes:27384681 (26.1 MiB)&lt;br /&gt;
          Interrupt:225 Base address:0x8000 &lt;br /&gt;
&lt;br /&gt;
peth2     Link encap:Ethernet  HWaddr 00:1B:21:72:96:EA  &lt;br /&gt;
          inet6 addr: fe80::21b:21ff:fe72:96ea/64 Scope:Link&lt;br /&gt;
          UP BROADCAST RUNNING PROMISC MULTICAST  MTU:1500  Metric:1&lt;br /&gt;
          RX packets:35 errors:0 dropped:0 overruns:0 frame:0&lt;br /&gt;
          TX packets:70 errors:0 dropped:0 overruns:0 carrier:0&lt;br /&gt;
          collisions:0 txqueuelen:1000 &lt;br /&gt;
          RX bytes:6827 (6.6 KiB)  TX bytes:12470 (12.1 KiB)&lt;br /&gt;
          Memory:fe9e0000-fea00000 &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virbr0&amp;lt;/span&amp;gt; may remain until you reboot your nodes.&lt;br /&gt;
&lt;br /&gt;
If you see something like this, then you are ready to proceed! Now start your cluster back up.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/cman start&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We&#039;re done for now. There is more to do in Xen, but this was all we needed to do in order to proceed with the next several steps. Onces we have the clustered storage online, we&#039;ll come back to Xen for the domU setup.&lt;br /&gt;
&lt;br /&gt;
= Building the DRBD Array =&lt;br /&gt;
&lt;br /&gt;
Building the DRBD array requires a few steps. First, raw space on either node must be prepared. Next, DRBD must be told that it is to create a resource using this newly configured raw space. Finally, the new array must be initialized.&lt;br /&gt;
&lt;br /&gt;
== A Map of the Cluster&#039;s Storage ==&lt;br /&gt;
&lt;br /&gt;
The layout of the storage in the cluster can quickly become difficult to follow. Below is an [[ASCII]] drawing which should help you see how DRBD will tie in to the rest of the cluster&#039;s storage. This map assumes a simple [[TLUG_Talk:_Storage_Technologies_and_Theory#Level_1|RAID level 1]] array underlying each node. If your node has a single hard drive, simply collapse the first two layers into one. Similarly, if your underlying storage is a more complex RAID array, simply expand the number of physical devices at the top level.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
               Node1                                Node2&lt;br /&gt;
           _____   _____                        _____   _____&lt;br /&gt;
          | sda | | sdb |                      | sda | | sdb |&lt;br /&gt;
          |_____| |_____|                      |_____| |_____|&lt;br /&gt;
             |_______|                            |_______|&lt;br /&gt;
     _______ ____|___ _______             _______ ____|___ _______&lt;br /&gt;
  __|__   __|__    __|__   __|__       __|__   __|__    __|__   __|__&lt;br /&gt;
 | md0 | | md1 |  | md2 | | md3 |     | md3 | | md2 |  | md1 | | md0 |&lt;br /&gt;
 |_____| |_____|  |_____| |_____|     |_____| |_____|  |_____| |_____|&lt;br /&gt;
    |       |        |       |           |       |        |       |&lt;br /&gt;
 ___|___   _|_   ____|____   |___________|   ____|____   _|_   ___|___&lt;br /&gt;
| /boot | | / | | &amp;lt;swap&amp;gt;  |        |        | &amp;lt;swap&amp;gt;  | | / | | /boot |&lt;br /&gt;
|_______| |___| |_________|  ______|______  |_________| |___| |_______|&lt;br /&gt;
                            | /dev/drbd0  |&lt;br /&gt;
                            |_____________|&lt;br /&gt;
                                   |&lt;br /&gt;
                               ____|______&lt;br /&gt;
                              | clvm PV   |&lt;br /&gt;
                              |___________|&lt;br /&gt;
                                   |&lt;br /&gt;
                              _____|_____&lt;br /&gt;
                             | drbd0_vg0 |&lt;br /&gt;
                             |___________|&lt;br /&gt;
                                   |&lt;br /&gt;
                              _____|_____ ___...____&lt;br /&gt;
                             |           |          |&lt;br /&gt;
                          ___|___     ___|___    ___|___&lt;br /&gt;
                         | lv_X  |   | lv_Y  |  | lv_N  |&lt;br /&gt;
                         |_______|   |_______|  |_______|&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Install The DRBD Tools ==&lt;br /&gt;
&lt;br /&gt;
DRBD has two components; The actual application and tools and the kernel module. &lt;br /&gt;
&lt;br /&gt;
There are two options for installing the DRBD user-land tools at this point; AN!Cluster-built RPMs or using the ones shipped with Fedora. Regardless of which method you choose, you will need to either install the AN!Cluster DRBD kernel module RPMs or else rebuild the source RPMs referenced.&lt;br /&gt;
&lt;br /&gt;
=== Install The AN!Cluster DRBD User-Land Tools ===&lt;br /&gt;
&lt;br /&gt;
I am currently experimenting with ways to solve a DRBD triggered kernel oops in the Xen pvops 2.6.32 kernel. For this reason, I&#039;ve recompiled the following user-land RPMs under the AN!Cluster variant dom0 kernel RPMs referenced earlier in this paper. If you used the AN! RPMs, then I suggest giving these RPMs a try. However, if you are using myoung&#039;s dom0, I recommend sticking to the Fedora-provided user-land DRBD tools.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum -y install bash-completion heartbeat pacemaker&lt;br /&gt;
cd ~&lt;br /&gt;
wget -c https://alteeve.com/files/an-cluster/drbd-8.3.7-2.fc13.x86_64.rpm&lt;br /&gt;
wget -c https://alteeve.com/files/an-cluster/drbd-utils-8.3.7-2.fc13.x86_64.rpm&lt;br /&gt;
wget -c https://alteeve.com/files/an-cluster/drbd-xen-8.3.7-2.fc13.x86_64.rpm&lt;br /&gt;
wget -c https://alteeve.com/files/an-cluster/drbd-bash-completion-8.3.7-2.fc13.x86_64.rpm&lt;br /&gt;
wget -c https://alteeve.com/files/an-cluster/drbd-udev-8.3.7-2.fc13.x86_64.rpm&lt;br /&gt;
wget -c https://alteeve.com/files/an-cluster/drbd-heartbeat-8.3.7-2.fc13.x86_64.rpm&lt;br /&gt;
wget -c https://alteeve.com/files/an-cluster/drbd-pacemaker-8.3.7-2.fc13.x86_64.rpm&lt;br /&gt;
rpm -ivh drbd*8.3.7-2.fc13.x86_64.rpm&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Install The Stock Fedora DRBD User-Land Tools ===&lt;br /&gt;
&lt;br /&gt;
You will need to install the following tools:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install drbd.x86_64 drbd-xen.x86_64 drbd-utils.x86_64&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Disable heartbeat ===&lt;br /&gt;
&lt;br /&gt;
These packages require that the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;heartbeat&amp;lt;/span&amp;gt; packages be installed. This is for a different cluster platform which we are not using here, so we will disable it from starting with the system.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
chkconfig heartbeat off&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Install The DRBD Kernel Module ==&lt;br /&gt;
&lt;br /&gt;
The kernel module &#039;&#039;&#039;must&#039;&#039;&#039; match the [[dom0]] kernel that is running. If you update the kernel and neglect to update the DRBD kernel module, the DRBD array &#039;&#039;&#039;will not start&#039;&#039;&#039;. &lt;br /&gt;
&lt;br /&gt;
To help simplify things, links to pre-compiled DRBD kernel modules are provided. If the kernel version you have installed doesn&#039;t match your kernel, instructions on recompiling the DRBD kernel module from source RPM is provided as well.&lt;br /&gt;
&lt;br /&gt;
=== Install Pre-Compiled DRBD Kernel Module RPMs ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Warning&#039;&#039;&#039;: The RPM provided here &#039;&#039;&#039;&#039;&#039;will only work&#039;&#039;&#039;&#039;&#039; with the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;kernel-2.6.32.21-168.xendom0_an1.fc13.x86_64.rpm&amp;lt;/span&amp;gt; kernel. If you are using Michael Young&#039;s dom0 kernel, please skip to [[#Building DRBD Kernel Module RPMs From Source|the next section]].&lt;br /&gt;
&lt;br /&gt;
This RPM provides the DRBD kernel module. Note that these RPMs are compiled against the AN!Cluster variant of myoung&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;2.6.32.21_168&amp;lt;/span&amp;gt; dom0 kernel.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cd ~&lt;br /&gt;
wget -c https://alteeve.com/files/an-cluster/drbd-km-2.6.32.23_170.dom0_an1.fc13.x86_64-8.3.7-12.fc13.x86_64.rpm&lt;br /&gt;
rpm -ivh drbd-km-2.6.32.23_170.dom0_an1.fc13.x86_64-8.3.7-12.fc13.x86_64.rpm&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you would like to install the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;debuginfo&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cd ~&lt;br /&gt;
wget -c https://alteeve.com/files/an-cluster/drbd-km-debuginfo-8.3.7-12.fc13.x86_64.rpm&lt;br /&gt;
rpm -ivh drbd-km-debuginfo-8.3.7-12.fc13.x86_64.rpm&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Building DRBD Kernel Module RPMs From Source ===&lt;br /&gt;
&lt;br /&gt;
If the above RPMs don&#039;t work or if the dom0 kernel you are using in any way differs, please follow the steps here to create a DRBD kernel module matched to your running dom0.&lt;br /&gt;
&lt;br /&gt;
First, install the build environment.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum -y groupinstall &amp;quot;Development Libraries&amp;quot;&lt;br /&gt;
yum -y groupinstall &amp;quot;Development Tools&amp;quot;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Install the kernel headers and development library for the dom0 kernel:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: The following commands use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--force&amp;lt;/span&amp;gt; to get past the fact that the headers for the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;2.6.33&amp;lt;/span&amp;gt; are already installed, thus making RPM think that these are too old and will conflict. Please proceed with caution.&lt;br /&gt;
&lt;br /&gt;
* If you are using Michael Young&#039;s kernel:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cd ~&lt;br /&gt;
wget -c http://fedorapeople.org/~myoung/dom0/x86_64/kernel-headers-2.6.32.21-170.xendom0.fc12.x86_64.rpm&lt;br /&gt;
wget -c http://fedorapeople.org/~myoung/dom0/x86_64/kernel-devel-2.6.32.21-170.xendom0.fc12.x86_64.rpm&lt;br /&gt;
rpm -ivh --force kernel*2.6.32.21-170.xendom0.fc12.x86_64.rpm&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* If you are using the AN!Cluster dom0 kernel:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
wget -c https://alteeve.com/files/an-cluster/kernel-devel-2.6.32.23-170.dom0_an1.fc13.x86_64.rpm&lt;br /&gt;
wget -c https://alteeve.com/files/an-cluster/kernel-headers-2.6.32.23-170.dom0_an1.fc13.x86_64.rpm&lt;br /&gt;
rpm -ivh --force kernel-devel-2.6.32.23-170.dom0_an1.fc13.x86_64.rpm kernel-headers-2.6.32.23-170.dom0_an1.fc13.x86_64.rpm&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now you need to download, prepare, build and install the source RPM.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
rpm -ivh http://fedora.mirror.iweb.ca/releases/13/Everything/source/SRPMS/drbd-8.3.7-2.fc13.src.rpm&lt;br /&gt;
cd /root/rpmbuild/SPECS/&lt;br /&gt;
rpmbuild -bp drbd.spec &lt;br /&gt;
cd /root/rpmbuild/BUILD/drbd-8.3.7/&lt;br /&gt;
./configure --enable-spec --with-km&lt;br /&gt;
cp /root/rpmbuild/BUILD/drbd-8.3.7/drbd-km.spec /root/rpmbuild/SPECS/&lt;br /&gt;
cd /root/rpmbuild/SPECS/&lt;br /&gt;
rpmbuild -ba drbd-km.spec&lt;br /&gt;
cd /root/rpmbuild/RPMS/x86_64&lt;br /&gt;
rpm -Uvh drbd-km-*&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This may be needed if &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;drbd-utils&amp;lt;/span&amp;gt;, the user-land DRBD tools, is listed as a requirement when trying to install the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;drbd-km*&amp;lt;/span&amp;gt; RPMs. This step will build all of the DRBD tools RPMs.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install bash-completion heartbeat pacemaker&lt;br /&gt;
cd /root/rpmbuild/SPECS/&lt;br /&gt;
rpmbuild -ba drbd.spec &lt;br /&gt;
cd ~/rpmbuild/RPMS/x86_64/&lt;br /&gt;
rpm -Uvh drbd-*&lt;br /&gt;
chkconfig off heartbeat&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You should be good to go now!&lt;br /&gt;
&lt;br /&gt;
== Allocating Raw Space For DRBD On Each Node ==&lt;br /&gt;
&lt;br /&gt;
If you followed the setup steps provided for in &amp;quot;[[Two Node Fedora 13 Cluster]]&amp;quot;, you will have a set amount of unconfigured hard drive space. This is what we will use for the DRBD space on either node. If you&#039;ve got a different setup, you will need to allocate some raw space before proceeding.&lt;br /&gt;
&lt;br /&gt;
=== Create a Simple Partition ===&lt;br /&gt;
&lt;br /&gt;
If you do not have two drives, please follow the next section&#039;s steps, but pay attention to the &amp;quot;&#039;&#039;&#039;note&#039;&#039;&#039;&amp;quot;s. In short, you will need to create one partition, leave the default type of the partition as &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;83&amp;lt;/span&amp;gt;, write the changes to disk and the proceed to the [[#DRBD Configuration Files|DRBD Configuration Files]] section.&lt;br /&gt;
&lt;br /&gt;
=== Creating a RAID level 1 &#039;md&#039; Device ===&lt;br /&gt;
&lt;br /&gt;
This assumes that you have two raw drives, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/sda&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/sdb&amp;lt;/span&amp;gt;. It further assumes that you&#039;ve created three partitions which have been assigned to three existing &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/mdX&amp;lt;/span&amp;gt; devices. With these assumptions, we will create &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/sda4&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/sdb4&amp;lt;/span&amp;gt; and, using them, create a new &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/md3&amp;lt;/span&amp;gt; device that will host the DRBD partition.&lt;br /&gt;
&lt;br /&gt;
If you have multiple drives and plan to use a different [[TLUG_Talk:_Storage_Technologies_and_Theory#RAID_Levels|RAID levels]], please adjust the follow commands accordingly.&lt;br /&gt;
&lt;br /&gt;
==== Creating The New Partitions ====&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Warning&#039;&#039;&#039;: The next steps will have you directly accessing your server&#039;s hard drive configuration. Please do not proceed on a live server until you&#039;ve had a chance to work through these steps on a test server. One mistake can &#039;&#039;&#039;&#039;&#039;blow away all your data&#039;&#039;&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Start the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fdisk&amp;lt;/span&amp;gt; shell for the first hard drive; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/sda&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
fdisk /dev/sda&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
WARNING: DOS-compatible mode is deprecated. It&#039;s strongly recommended to&lt;br /&gt;
         switch off the mode (command &#039;c&#039;) and change display units to&lt;br /&gt;
         sectors (command &#039;u&#039;).&lt;br /&gt;
&lt;br /&gt;
Command (m for help): &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: Depending on your configuration, you may not see the above warning or you may see a different warning. Note it, but it is likely nothing to worry about it.&lt;br /&gt;
&lt;br /&gt;
View the current configuration with the &#039;&#039;&#039;p&#039;&#039;&#039;rint option&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
p&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Disk /dev/sda: 500.1 GB, 500107862016 bytes&lt;br /&gt;
255 heads, 63 sectors/track, 60801 cylinders&lt;br /&gt;
Units = cylinders of 16065 * 512 = 8225280 bytes&lt;br /&gt;
Sector size (logical/physical): 512 bytes / 512 bytes&lt;br /&gt;
I/O size (minimum/optimal): 512 bytes / 512 bytes&lt;br /&gt;
Disk identifier: 0x000c6fe1&lt;br /&gt;
&lt;br /&gt;
   Device Boot      Start         End      Blocks   Id  System&lt;br /&gt;
/dev/sda1               1        5100    40960000   fd  Linux raid autodetect&lt;br /&gt;
/dev/sda2            5100        5622     4194304   fd  Linux raid autodetect&lt;br /&gt;
/dev/sda3   *        5622        5654      256000   fd  Linux raid autodetect&lt;br /&gt;
&lt;br /&gt;
Command (m for help): &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we know for sure that the next free partition number is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;4&amp;lt;/span&amp;gt;. We will now create the &#039;&#039;&#039;n&#039;&#039;&#039;ew partition.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
n&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Command action&lt;br /&gt;
   e   extended&lt;br /&gt;
   p   primary partition (1-4)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We will make it a &#039;&#039;&#039;p&#039;&#039;&#039;rimary partition&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
p&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Selected partition 4&lt;br /&gt;
First cylinder (5654-60801, default 5654): &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then we simply hit &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;enter&amp;gt;&amp;lt;/span&amp;gt; to select the default starting block.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;enter&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Using default value 5654&lt;br /&gt;
Last cylinder, +cylinders or +size{K,M,G} (5654-60801, default 60801): &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once again we will press &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;enter&amp;gt;&amp;lt;/span&amp;gt; to select the default ending block.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;enter&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Using default value 60801&lt;br /&gt;
&lt;br /&gt;
Command (m for help): &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: If you only have one drive and are not creating a [[RAID]] array, you do not to change the type of the partition so you can skip the next few steps. Continue at the step where you write the changes.&lt;br /&gt;
&lt;br /&gt;
Now we need to change the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;t&amp;lt;/span&amp;gt;ype of partition that it is.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
t&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Partition number (1-4): &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We know that we are modifying partition number &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;4&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
4&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Hex code (type L to list codes): &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we need to set the [[hex]] code for the [[Filesystem_List#List_of_Linux_Partition_Types|partition type]] to set. We want to set &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fd&amp;lt;/span&amp;gt;, which defines &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Linux raid autodetect&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
fd&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Changed system type of partition 4 to fd (Linux raid autodetect)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now check that everything went as expected by once again &#039;&#039;&#039;p&#039;&#039;&#039;rinting the partition table.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
p&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Disk /dev/sda: 500.1 GB, 500107862016 bytes&lt;br /&gt;
255 heads, 63 sectors/track, 60801 cylinders&lt;br /&gt;
Units = cylinders of 16065 * 512 = 8225280 bytes&lt;br /&gt;
Sector size (logical/physical): 512 bytes / 512 bytes&lt;br /&gt;
I/O size (minimum/optimal): 512 bytes / 512 bytes&lt;br /&gt;
Disk identifier: 0x000c6fe1&lt;br /&gt;
&lt;br /&gt;
   Device Boot      Start         End      Blocks   Id  System&lt;br /&gt;
/dev/sda1               1        5100    40960000   fd  Linux raid autodetect&lt;br /&gt;
/dev/sda2            5100        5622     4194304   fd  Linux raid autodetect&lt;br /&gt;
/dev/sda3   *        5622        5654      256000   fd  Linux raid autodetect&lt;br /&gt;
/dev/sda4            5654       60801   442972704+  fd  Linux raid autodetect&lt;br /&gt;
&lt;br /&gt;
Command (m for help): &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: If you only have one drive, your partitions will be &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;83  Linux&amp;lt;/span&amp;gt; or &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;82  Linux swap / Solaris&amp;lt;/span&amp;gt;, instead of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fd  Linux raid autodetect&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
There it is. So finally, we need to &#039;&#039;&#039;w&#039;&#039;&#039;rite the changes to the disk.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
w&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
The partition table has been altered!&lt;br /&gt;
&lt;br /&gt;
Calling ioctl() to re-read partition table.&lt;br /&gt;
&lt;br /&gt;
WARNING: Re-reading the partition table failed with error 16: Device or resource busy.&lt;br /&gt;
The kernel still uses the old table. The new table will be used at&lt;br /&gt;
the next reboot or after you run partprobe(8) or kpartx(8)&lt;br /&gt;
Syncing disks.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: If you only have one drive, reboot now if you got the message above and then skip forward to the &amp;quot;[[#DRBD Configuration Files|DRBD Configuration Files]]&amp;quot; section.&lt;br /&gt;
&lt;br /&gt;
If you see the above message, &#039;&#039;&#039;do not&#039;&#039;&#039; reboot yet. repeat these steps for the second drive, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/sdb&amp;lt;/span&amp;gt;, and then reboot.&lt;br /&gt;
&lt;br /&gt;
==== Creating The New /dev/mdX Device ====&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;If you only have one drive, skip this step.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Now we need to use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;mdadm&amp;lt;/span&amp;gt; to create the new [[TLUG_Talk:_Storage_Technologies_and_Theory#Level_1|RAID level 1]] device. This will be used as the device that DRBD will directly access.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
mdadm --create /dev/md3 --homehost=localhost.localdomain --raid-devices=2 --level=1 /dev/sda4 /dev/sdb4&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
mdadm: Note: this array has metadata at the start and&lt;br /&gt;
    may not be suitable as a boot device.  If you plan to&lt;br /&gt;
    store &#039;/boot&#039; on this device please ensure that&lt;br /&gt;
    your boot-loader understands md/v1.x metadata, or use&lt;br /&gt;
    --metadata=0.90&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Seeing as &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/boot&amp;lt;/span&amp;gt; doesn&#039;t exist on this device, we can safely ignore this warning.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
y&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
mdadm: Defaulting to version 1.2 metadata&lt;br /&gt;
mdadm: array /dev/md/md4 started.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can now &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cat /proc/mdstat&amp;lt;/span&amp;gt; to verify that it indeed built. If you&#039;re interested, you could open a new terminal window and use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;watch cat /proc/mdstat&amp;lt;/span&amp;gt; and watch the array build.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cat /proc/mdstat&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
md3 : active raid1 sdb4[1] sda4[0]&lt;br /&gt;
      442971544 blocks super 1.2 [2/2] [UU]&lt;br /&gt;
      [&amp;gt;....................]  resync =  0.8% (3678976/442971544) finish=111.0min speed=65920K/sec&lt;br /&gt;
      &lt;br /&gt;
md2 : active raid1 sda2[0] sdb2[1]&lt;br /&gt;
      4193272 blocks super 1.1 [2/2] [UU]&lt;br /&gt;
      &lt;br /&gt;
md1 : active raid1 sda1[0] sdb1[1]&lt;br /&gt;
      40958908 blocks super 1.1 [2/2] [UU]&lt;br /&gt;
      bitmap: 1/1 pages [4KB], 65536KB chunk&lt;br /&gt;
&lt;br /&gt;
md0 : active raid1 sda3[0] sdb3[1]&lt;br /&gt;
      255988 blocks super 1.0 [2/2] [UU]&lt;br /&gt;
      &lt;br /&gt;
unused devices: &amp;lt;none&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Finally, we need to make sure that the new array will start when the system boots. To do this, we&#039;ll again use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;mdadm&amp;lt;/span&amp;gt;, but with different options that will have it output data in a format suitable for the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/mdadm.conf&amp;lt;/span&amp;gt; file. We&#039;ll redirect this output to that config file, thus updating it.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
mdadm --detail --scan | grep md3 &amp;gt;&amp;gt; /etc/mdadm.conf&lt;br /&gt;
cat /etc/mdadm.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
# mdadm.conf written out by anaconda&lt;br /&gt;
MAILADDR root&lt;br /&gt;
AUTO +imsm +1.x -all&lt;br /&gt;
ARRAY /dev/md0 level=raid1 num-devices=2 UUID=b58df6d0:d925e7bb:c156168d:47c01718&lt;br /&gt;
ARRAY /dev/md1 level=raid1 num-devices=2 UUID=ac2cf39c:77cd0314:fedb8407:9b945bb5&lt;br /&gt;
ARRAY /dev/md2 level=raid1 num-devices=2 UUID=4e513936:4a966f4e:0dd8402e:6403d10d&lt;br /&gt;
ARRAY /dev/md3 metadata=1.2 name=localhost.localdomain:3 UUID=f0b6d0c1:490d47e7:91c7e63a:f8dacc21&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You&#039;ll note that the last line, which we just added, is different from the previous lines. This isn&#039;t a concern, but you are welcome to re-write it to match the existing format if you wish.&lt;br /&gt;
&lt;br /&gt;
Before you proceed, it is strongly advised that you reboot each node and then verify that the new array did in fact start with the system. You &#039;&#039;do not&#039;&#039; need to wait for the sync to finish before rebooting. It will pick up where you left off once rebooted.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: You&#039;ll notice we did not format a file system on this raid array, this is intentional. DRBD use the raw device and does not need a file system on it.&lt;br /&gt;
&lt;br /&gt;
== DRBD Configuration Files ==&lt;br /&gt;
&lt;br /&gt;
DRBD uses a global configuration file, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/drbd.d/global_common.conf&amp;lt;/span&amp;gt;, and one or more resource files. The resource files need to be created in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/drbd.d/&amp;lt;/span&amp;gt; directory and must have the suffix &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;.res&amp;lt;/span&amp;gt;. For this example, we will create a single resource called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;r0&amp;lt;/span&amp;gt; which we will configure in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/drbd.d/r0.res&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== /etc/drbd.d/global_common.conf ===&lt;br /&gt;
&lt;br /&gt;
The stock &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/drbd.d/global_common.conf&amp;lt;/span&amp;gt; is sane, so we won&#039;t bother altering it here.&lt;br /&gt;
&lt;br /&gt;
Full details on all the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;drbd.conf&amp;lt;/span&amp;gt; configuration file directives and arguments can be found [http://www.drbd.org/users-guide/re-drbdconf.html here]. &#039;&#039;&#039;Note&#039;&#039;&#039;: That link doesn&#039;t show this new configuration format. Please see [http://www.novell.com/documentation/sle_ha/book_sleha/?page=/documentation/sle_ha/book_sleha/data/sec_ha_drbd_configure.html Novell&#039;s] link.&lt;br /&gt;
&lt;br /&gt;
=== /etc/drbd.d/r0.res ===&lt;br /&gt;
&lt;br /&gt;
This is the important part. This defines the resource to use, and must reflect the IP addresses and storage devices that DRBD will use for this resource.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/drbd.d/r0.res&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# This is the name of the resource and it&#039;s settings. Generally, &#039;r0&#039; is used&lt;br /&gt;
# as the name of the first resource. This is by convention only, though.&lt;br /&gt;
resource r0&lt;br /&gt;
{&lt;br /&gt;
        # This tells DRBD where to make the new resource available at on each&lt;br /&gt;
        # node. This is, again, by convention only.&lt;br /&gt;
        device    /dev/drbd0;&lt;br /&gt;
&lt;br /&gt;
        # The main argument here tells DRBD that we will have proper locking &lt;br /&gt;
        # and fencing, and as such, to allow both nodes to set the resource to&lt;br /&gt;
        # &#039;primary&#039; simultaneously.&lt;br /&gt;
        net&lt;br /&gt;
        {&lt;br /&gt;
                allow-two-primaries;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        # This tells DRBD to automatically set both nodes to &#039;primary&#039; when the&lt;br /&gt;
        # nodes start.&lt;br /&gt;
        startup&lt;br /&gt;
        {&lt;br /&gt;
                become-primary-on both;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        # This tells DRBD to look for and store it&#039;s meta-data on the resource&lt;br /&gt;
        # itself.&lt;br /&gt;
        meta-disk       internal;&lt;br /&gt;
&lt;br /&gt;
        # The name below must match the output from `uname -n` on each node.&lt;br /&gt;
        on an-node01.alteeve.com&lt;br /&gt;
        {&lt;br /&gt;
                # This must be the IP address of the interface on the storage &lt;br /&gt;
                # network (an-node01.sn, in this case).&lt;br /&gt;
                address         192.168.2.71:7789;&lt;br /&gt;
&lt;br /&gt;
                # This is the underlying partition to use for this resource on &lt;br /&gt;
                # this node.&lt;br /&gt;
                disk            /dev/md3;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        # Repeat as above, but for the other node.&lt;br /&gt;
        on an-node02.alteeve.com&lt;br /&gt;
        {&lt;br /&gt;
                address         192.168.2.72:7789;&lt;br /&gt;
                disk            /dev/md3;&lt;br /&gt;
        }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This file must be copied to &#039;&#039;&#039;BOTH&#039;&#039;&#039; nodes and must match before you proceed.&lt;br /&gt;
&lt;br /&gt;
== Starting The DRBD Resource ==&lt;br /&gt;
&lt;br /&gt;
From the rest of this section, pay attention to whether you see&lt;br /&gt;
* &#039;&#039;&#039;Node1&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Node2&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Both&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
These indicate which node to run the following commands on. There is no functional difference between either node, so just randomly choose one to be &#039;&#039;&#039;Node1&#039;&#039;&#039; and the other will be &#039;&#039;&#039;Node2&#039;&#039;&#039;. Once you&#039;ve chosen which is which, be consistent with which node you run the commands on. Of course, if a command block is proceeded by &#039;&#039;&#039;Both&#039;&#039;&#039;, run the following code block on both nodes.&lt;br /&gt;
&lt;br /&gt;
=== Loading the &#039;drbd&#039; Module ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Both&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Normally, we&#039;d load the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;drbd&amp;lt;/span&amp;gt; module by simply starting the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/init.d/drbd&amp;lt;/span&amp;gt; daemon. However, if we did that at this stage, we&#039;d generate errors because there isn&#039;t an &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;UpToDate&amp;lt;/span&amp;gt; disk in the array. To get around this, we&#039;ll manually load the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;drbd&amp;lt;/span&amp;gt; kernel module using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;modprobe&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
modprobe drbd&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This won&#039;t return any output, but if you check, you should now see the special &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/proc/drbd&amp;lt;/span&amp;gt; file.&lt;br /&gt;
&lt;br /&gt;
=== Monitoring Progress ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Both&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
I find it very useful to monitor DRBD while running the rest of the setup. To do this, open a second terminal on each node and use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;watch&amp;lt;/span&amp;gt; to keep an eye on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/proc/drbd&amp;lt;/span&amp;gt;. This way you will be able to monitor the progress of the array in near-real time.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Both&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
watch cat /proc/drbd&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At this stage, it should look like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
version: 8.3.7 (api:88/proto:86-91)&lt;br /&gt;
GIT-hash: ea9e28dbff98e331a62bcbcc63a6135808fe2917 build by root@xenmaster002.iplink.net, 2010-09-07 16:02:46&lt;br /&gt;
 0: cs:Unconfigured&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Initialize The Resource ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Both&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This step creates the DRBD meta-data on the new DRBD resource&#039;s backing devices. It is only needed when creating new DRBD partitions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
drbdadm create-md r0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
  --==  Thank you for participating in the global usage survey  ==--&lt;br /&gt;
The server&#039;s response is:&lt;br /&gt;
&lt;br /&gt;
you are the 9507th user to install this version&lt;br /&gt;
Writing meta data...&lt;br /&gt;
initializing activity log&lt;br /&gt;
NOT initialized bitmap&lt;br /&gt;
New drbd meta data block successfully created.&lt;br /&gt;
success&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/proc/drbd&amp;lt;/span&amp;gt; output should not have changed at this stage.&lt;br /&gt;
&lt;br /&gt;
=== Starting the Resource ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Both&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This will attach the backing device, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/md3&amp;lt;/span&amp;gt; in our case, and then start the new resource &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;r0&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
drbdadm up r0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There will be no output at the command line. If you are &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;watch&amp;lt;/span&amp;gt;ing &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/proc/drbd&amp;lt;/span&amp;gt; though, you should now see something like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
version: 8.3.7 (api:88/proto:86-91)&lt;br /&gt;
GIT-hash: ea9e28dbff98e331a62bcbcc63a6135808fe2917 build by root@xenmaster002.iplink.net, 2010-09-07 16:02:46&lt;br /&gt;
 0: cs:Connected ro:Secondary/Secondary ds:Inconsistent/Inconsistent C r----&lt;br /&gt;
    ns:0 nr:0 dw:0 dr:0 al:0 bm:0 lo:0 pe:0 ua:0 ap:0 ep:1 wo:b oos:442957988&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
That it is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Secondary/Secondary&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Inconsistent/Inconsistent&amp;lt;/span&amp;gt; is expected.&lt;br /&gt;
&lt;br /&gt;
=== Setting the First Primary Node ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Node1&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
As this is a totally new resource, DRBD doesn&#039;t know which side of the array is &amp;quot;more valid&amp;quot; than the other. In reality, neither is as there was no existing data of note on either node. This means that we now need to choose a node and tell DRBD to treat it as the &amp;quot;source&amp;quot; node. This step will also tell DRBD to make the &amp;quot;source&amp;quot; node &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;primary&amp;lt;/span&amp;gt;. Once set, DRBD will begin &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;sync&amp;lt;/span&amp;gt;&#039;ing in the background. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
drbdadm -- --overwrite-data-of-peer primary r0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As before, there will be no output at the command line, but &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/proc/drbd&amp;lt;/span&amp;gt; will change to show the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
GIT-hash: ea9e28dbff98e331a62bcbcc63a6135808fe2917 build by root@xenmaster002.iplink.net, 2010-09-07 16:02:46&lt;br /&gt;
 0: cs:SyncSource ro:Primary/Secondary ds:UpToDate/Inconsistent C r----&lt;br /&gt;
    ns:69024 nr:0 dw:0 dr:69232 al:0 bm:4 lo:0 pe:0 ua:0 ap:0 ep:1 wo:b oos:442888964&lt;br /&gt;
        [&amp;gt;....................] sync&#039;ed:  0.1% (432508/432576)M&lt;br /&gt;
        finish: 307:33:42 speed: 320 (320) K/sec&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you&#039;re watching the secondary node, the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/proc/drbd&amp;lt;/span&amp;gt; will show &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ro:Secondary/Primary ds:Inconsistent/UpToDate&amp;lt;/span&amp;gt;. This is, as you can guess, simply a reflection of it being the &amp;quot;over-written&amp;quot; node.&lt;br /&gt;
&lt;br /&gt;
=== Setting the Second Node to Primary ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Node2&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The last step to complete the array is to tell the second node to also become &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;primary&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
drbdadm primary r0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As with many &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;drbdadm&amp;lt;/span&amp;gt; commands, nothing will be printed to the console. If you&#039;re watching the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/proc/drbd&amp;lt;/span&amp;gt; though, you should see something like &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Primary/Primary ds:UpToDate/Inconsistent&amp;lt;/span&amp;gt;. The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Inconsistent&amp;lt;/span&amp;gt; flag will remain until the sync is complete.&lt;br /&gt;
&lt;br /&gt;
=== A Note On sync Speed ===&lt;br /&gt;
&lt;br /&gt;
You will notice in the previous step that the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;sync&amp;lt;/span&amp;gt; speed seems awfully slow at &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;320 (320) K/sec&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;This is not a problem!&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
As actual data is written to either side of the array, that data will be immediately copied to both nodes. As such, both nodes will always contain up to date copies of the real data. Given this, the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;syncer&amp;lt;/span&amp;gt; is intentionally set low so as to not put too much load on the underlying disks that could cause slow downs. If you still wish to increase the sync speed, you can do so with the following command.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Warning&#039;&#039;&#039;: If you set the DRBD sync speed too high and saturate your disks&#039; maximum write speed, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clvmd&amp;lt;/span&amp;gt; daemon will likely fail to start in some cases, leading to fences. For this reason, keep your sync rate to about 2/3rds of the underlying disk maximum write speed and hold off on bumping up the sync speed until you know you will have a period of low activity on your cluster.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
drbdsetup /dev/drbd0 syncer -r 35M&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The speed-up will not be instant. It will take a little while for the speed to pick up. Once the sync is finished, it is a good idea to revert to the default sync rate.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
drbdadm syncer r0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Setting Up CLVM =&lt;br /&gt;
&lt;br /&gt;
The goal of DRBD in the cluster is to provide clustered [[LVM]], referred to as [[CLVM]] to the nodes. This is done by turning the DRBD partition into an CLVM physical volume.&lt;br /&gt;
&lt;br /&gt;
So now we will create a [[PV]] on top of the new [[DRBD]] partition, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/drbd0&amp;lt;/span&amp;gt;, that we created in the previous step. Since this new LVM [[PV]] will exist on top of the shared DRBD partition, whatever get written to it&#039;s logical volumes will be immediately available on either node, regardless of which node actually initiated the write.&lt;br /&gt;
&lt;br /&gt;
This capability is the underlying reason for creating this cluster; Neither machine is truly needed so if one machine dies, anything on top of the DRBD partition will still be available. When the failed machine returns, the surviving node will have a list of what blocks changed while the other node was gone and can use this list to quickly re-sync the other server.&lt;br /&gt;
&lt;br /&gt;
== Making LVM Cluster-Aware ==&lt;br /&gt;
&lt;br /&gt;
Normally, LVM is run on a single server. This means that at any time, the LVM can write data to the underlying drive and not need to worry if any other device might change anything. In clusters, this isn&#039;t the case. The other node could try to write to the shared storage, so then nodes need to enable &amp;quot;locking&amp;quot; to prevent the two nodes from trying to work on the same bit of data at the same time. &lt;br /&gt;
&lt;br /&gt;
The process of enabling this locking is known as making LVM &amp;quot;cluster-aware&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
LVM has tool called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;lvmconf&amp;lt;/span&amp;gt; that can be used to enable LVM locking. This is provided as part of the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;lvm2-cluster&amp;lt;/span&amp;gt; package.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum -y install lvm2-cluster.x86_64&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now to enable cluster awareness in LVM, run to following command.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
lvmconf --enable-cluster&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
By default, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clvmd&amp;lt;/span&amp;gt;, the cluster lvm daemon, is stopped and not set to run on boot. Now that we&#039;ve enabled LVM locking, we need to start it:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/clvmd status&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
clvmd is stopped&lt;br /&gt;
active volumes: (none)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As expected, it is stopped, so lets start it:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: At this point cman is still set to not start a boot. Since we rebooted after creating the partitions that make up /dev/md3, cman will likely, and in my case was still off. clvmd will fail to start because the cluster manager (cman) is not started. --[[User:SRSullivan|SRSullivan]] 17:40, 18 October 2010 (UTC)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/clvmd start&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Activating VGs:   No volume groups found&lt;br /&gt;
                                                           [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: I&#039;ve seen on a few occasions where starting &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clvmd&amp;lt;/span&amp;gt; will time out and, on occasion, fences will be issued. I&#039;ve not sorted out why, but I have usually been able to resolve this by stopping &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clvmd&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt;, then restarting &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt; and, finally, restarting &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clvmd&amp;lt;/span&amp;gt;. If I can sort out a way to reliably trigger this problem, I will submit a bug report.&lt;br /&gt;
&lt;br /&gt;
== Filtering Out Devices ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;ToDo&#039;&#039;&#039;: Find a less-aggressive filter.&lt;br /&gt;
&lt;br /&gt;
With the stock &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/lvm/lvm.conf&amp;lt;/span&amp;gt; configuration, all devices on the system will be checked for LVM volumes. This can cause a problem as LVM will give preference to the LVM data on the RAID device over the DRBD device. It sees a duplicate as both are, effectively, one and the same.&lt;br /&gt;
&lt;br /&gt;
To work around this, we need to alter the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;filter = []&amp;lt;/span&amp;gt; entry. At the time of writing, simply rejecting the underlying &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/md3&amp;lt;/span&amp;gt; device as a candidate wasn&#039;t enough. So for now, we will tell LVM to accept DRBD devices and reject all other devices. To do this, we&#039;ll insert &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;quot;a|/dev/drbd*|&amp;quot;&amp;lt;/span&amp;gt; as the first array entry and change the existing entry to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;quot;r/.*/&amp;quot;&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: I would love feedback on a filter argument that successfully ignored just &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/md3&amp;lt;/span&amp;gt;, if anyone can suggest one.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/lvm/lvm.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
    # By default we accept every block device:&lt;br /&gt;
    #filter = [ &amp;quot;a/.*/&amp;quot; ]&lt;br /&gt;
    filter = [ &amp;quot;a|/dev/drbd*|&amp;quot;, &amp;quot;r/.*/&amp;quot; ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now delete the existing cache file so that LVM is forced to rescan the system.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
rm -f /etc/lvm/cache/.cache&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The changes take effect immediately.&lt;br /&gt;
&lt;br /&gt;
== Creating a new PV using the DRBD Partition ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Node1&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
We can now proceed with setting up the new DRBD-based LVM physical volume. Once the PV is created, we can create a new volume group and start allocating space to logical volumes.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: As we will be using our DRBD device, and as it is a shared block device, most of the following commands only need to be run on one node. Once the block device changes in any way, those changes will near-instantly appear on the other node. For this reason, unless explicitly stated to do so, only run the following commands on one node.&lt;br /&gt;
&lt;br /&gt;
To setup the DRBD partition as an LVM PV, run &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;pvcreate&amp;lt;/span&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
pvcreate /dev/drbd0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
  Physical volume &amp;quot;/dev/drbd0&amp;quot; successfully created&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Both&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Now, on both nodes, check that the new physical volume is visible by using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;pvdisplay&amp;lt;/span&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
pvdisplay&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;quot;/dev/drbd0&amp;quot; is a new physical volume of &amp;quot;422.44 GiB&amp;quot;&lt;br /&gt;
  --- NEW Physical volume ---&lt;br /&gt;
  PV Name               /dev/drbd0&lt;br /&gt;
  VG Name               &lt;br /&gt;
  PV Size               422.44 GiB&lt;br /&gt;
  Allocatable           NO&lt;br /&gt;
  PE Size               0   &lt;br /&gt;
  Total PE              0&lt;br /&gt;
  Free PE               0&lt;br /&gt;
  Allocated PE          0&lt;br /&gt;
  PV UUID               YHmdip-SuJN-KIEv-2tbK-BT9Q-wfOo-OuQuaW&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you see &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;PV Name /dev/drbd0&amp;lt;/span&amp;gt; (or your underlying partition) on both nodes, then your DRBD setup and LVM configuration changes are working perfectly!&lt;br /&gt;
&lt;br /&gt;
== Creating a VG on the new PV ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Node1&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Now we need to create the volume group using the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vgcreate&amp;lt;/span&amp;gt; command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vgcreate -c y drbd0_vg0 /dev/drbd0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
  Clustered volume group &amp;quot;drbd0_vg0&amp;quot; successfully created&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Both&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Now we&#039;ll check that the new VG is visible on both nodes using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vgdisplay&amp;lt;/span&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vgdisplay&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
  --- Volume group ---&lt;br /&gt;
  VG Name               drbd0_vg0&lt;br /&gt;
  System ID             &lt;br /&gt;
  Format                lvm2&lt;br /&gt;
  Metadata Areas        1&lt;br /&gt;
  Metadata Sequence No  1&lt;br /&gt;
  VG Access             read/write&lt;br /&gt;
  VG Status             resizable&lt;br /&gt;
  Clustered             yes&lt;br /&gt;
  Shared                no&lt;br /&gt;
  MAX LV                0&lt;br /&gt;
  Cur LV                0&lt;br /&gt;
  Open LV               0&lt;br /&gt;
  Max PV                0&lt;br /&gt;
  Cur PV                1&lt;br /&gt;
  Act PV                1&lt;br /&gt;
  VG Size               422.43 GiB&lt;br /&gt;
  PE Size               4.00 MiB&lt;br /&gt;
  Total PE              108143&lt;br /&gt;
  Alloc PE / Size       0 / 0   &lt;br /&gt;
  Free  PE / Size       108143 / 422.43 GiB&lt;br /&gt;
  VG UUID               Bb8l9e-es2z-PhaF-Gg3o-2is2-DZ1S-V2RsBF&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the new VG is visible on both nodes, we are ready to create our first logical volume using the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;lvcreate&amp;lt;/span&amp;gt; tool.&lt;br /&gt;
&lt;br /&gt;
== Creating the First LV on the new VG ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Node1&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Now we&#039;ll create a simple 20 GiB logical volumes. We will use it as a shared GFS2 store for shared files and to store our Xen domU config files later on.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
lvcreate -L 20G -n xen_shared drbd0_vg0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
  Logical volume &amp;quot;xen_shared&amp;quot; created&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Both&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
As before, we will check that the new logical volume is visible from both nodes by using the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;lvdisplay&amp;lt;/span&amp;gt; command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
lvdisplay&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
  --- Logical volume ---&lt;br /&gt;
  LV Name                /dev/drbd0_vg0/xen_shared&lt;br /&gt;
  VG Name                drbd0_vg0&lt;br /&gt;
  LV UUID                AqQizc-KBpX-2scN-WFLb-jIeF-QDcM-PlQW84&lt;br /&gt;
  LV Write Access        read/write&lt;br /&gt;
  LV Status              available&lt;br /&gt;
  # open                 0&lt;br /&gt;
  LV Size                20.00 GiB&lt;br /&gt;
  Current LE             5120&lt;br /&gt;
  Segments               1&lt;br /&gt;
  Allocation             inherit&lt;br /&gt;
  Read ahead sectors     auto&lt;br /&gt;
  - currently set to     256&lt;br /&gt;
  Block device           253:0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Again, if this is visible from both nodes, we&#039;re set! Repeat this process for all future LVs you will want to create. We will do this a little later to create LVs for Xen VMs.&lt;br /&gt;
&lt;br /&gt;
= Creating A Shared GFS FileSystem =&lt;br /&gt;
&lt;br /&gt;
GFS is a cluster-aware file system that can be simultaneously mounted on two or more nodes at once. We will use it as a place to store ISOs that we&#039;ll use to provision our virtual machines.&lt;br /&gt;
&lt;br /&gt;
== Install The GFS2 Utilities ==&lt;br /&gt;
&lt;br /&gt;
Start by installing the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[GFS2]]&amp;lt;/span&amp;gt; tools:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum -y install gfs2-utils.x86_64&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Format Our CLVM LV With The GFS2 File System ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Node1&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: The following example is designed for the cluster used in the prerequisite HowTo. &lt;br /&gt;
* If you have more than 2 nodes, increase the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;-j 2&amp;lt;/span&amp;gt; to the number of nodes you want to mount this file system on.&lt;br /&gt;
* If your cluster is named something other than &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-cluster&amp;lt;/span&amp;gt; (as set in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cluster.conf&amp;lt;/span&amp;gt; file), change &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;-t an-cluster:xen_shared&amp;lt;/span&amp;gt; to match you cluster&#039;s name. The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xen_shared&amp;lt;/span&amp;gt; can be whatever you like, but it must be unique in the cluster. I tend to use a name that matches the LV name, but this is my own preference and is not required.&lt;br /&gt;
&lt;br /&gt;
To format the partition run:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
mkfs.gfs2 -p lock_dlm -j 2 -t an-cluster:xen_shared /dev/drbd0_vg0/xen_shared&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
This will destroy any data on /dev/drbd0_vg0/xen_shared.&lt;br /&gt;
It appears to contain: symbolic link to `../dm-0&#039;&lt;br /&gt;
&lt;br /&gt;
Are you sure you want to proceed? [y/n] &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Acknowledge the warning, if any, and then press &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;y&amp;lt;/span&amp;gt; if you are ready to proceed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
y&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Device:                    /dev/drbd0_vg0/xen_shared&lt;br /&gt;
Blocksize:                 4096&lt;br /&gt;
Device Size                20.00 GB (5242880 blocks)&lt;br /&gt;
Filesystem Size:           20.00 GB (5242878 blocks)&lt;br /&gt;
Journals:                  2&lt;br /&gt;
Resource Groups:           80&lt;br /&gt;
Locking Protocol:          &amp;quot;lock_dlm&amp;quot;&lt;br /&gt;
Lock Table:                &amp;quot;an-cluster:xen_shared&amp;quot;&lt;br /&gt;
UUID:                      A1487063-2A3F-43B1-3A36-44936B0B4D1E&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once the format completes, you can mount &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/drbd0_vg0/xen_shared&amp;lt;/span&amp;gt; as you would a normal file system.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Both&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
To complete the example, lets mount the GFS2 partition we made just now on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/shared&amp;lt;/span&amp;gt; and then use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;df -h&amp;lt;/span&amp;gt; to verify.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
mkdir /xen_shared&lt;br /&gt;
mount /dev/drbd0_vg0/xen_shared /xen_shared&lt;br /&gt;
df -h&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Filesystem            Size  Used Avail Use% Mounted on&lt;br /&gt;
Filesystem            Size  Used Avail Use% Mounted on&lt;br /&gt;
/dev/md1               39G  2.8G   34G   8% /&lt;br /&gt;
tmpfs                 466M   29M  438M   7% /dev/shm&lt;br /&gt;
/dev/md0              243M   70M  161M  31% /boot&lt;br /&gt;
xenstore              466M   32K  466M   1% /var/lib/xenstored&lt;br /&gt;
/dev/dm-0              20G  259M   20G   2% /xen_shared&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You may have noticed that it shows &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/dm-0&amp;lt;/span&amp;gt; instead of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/drbd0_vg0/xen_shared&amp;lt;/span&amp;gt;. If you look at the later, you will see that it is simply a [[symlink]] to the former.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ls -lah /dev/drbd0_vg0/xen_shared&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
lrwxrwxrwx. 1 root root 7 Sep  9 13:24 /dev/drbd0_vg0/xen_shared -&amp;gt; ../dm-0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Add An Entry To /etc/fstab ==&lt;br /&gt;
&lt;br /&gt;
The last step is to add an entry for this new partition to each node&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/fstab&amp;lt;/span&amp;gt; file.&lt;br /&gt;
&lt;br /&gt;
=== Reference The GFS2 Partition By Device Path ===&lt;br /&gt;
&lt;br /&gt;
This is the more traditional method of referencing the GFS2 partition by using it&#039;s device path directly.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Warning&#039;&#039;&#039;: An incorrect edit of the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/fstab&amp;lt;/span&amp;gt; file can leave your system unable to boot! Please review the line generated above to make sure it is accurate and compatible with your setup before proceeding.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/fstab&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
#&lt;br /&gt;
# /etc/fstab&lt;br /&gt;
# Created by anaconda on Tue Sep  7 06:29:51 2010&lt;br /&gt;
#&lt;br /&gt;
# Accessible filesystems, by reference, are maintained under &#039;/dev/disk&#039;&lt;br /&gt;
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info&lt;br /&gt;
#&lt;br /&gt;
UUID=865690db-85d0-44c5-9f32-ffb6fdf47060 /                       ext3    defaults        1 1&lt;br /&gt;
UUID=8b9822b6-a92e-48c9-96b5-f8943142319e /boot                   ext3    defaults        1 2&lt;br /&gt;
UUID=94b03547-a7e3-45bb-b2d5-837498b370f4 swap                    swap    defaults        0 0&lt;br /&gt;
tmpfs                   /dev/shm                tmpfs   defaults        0 0&lt;br /&gt;
devpts                  /dev/pts                devpts  gid=5,mode=620  0 0&lt;br /&gt;
sysfs                   /sys                    sysfs   defaults        0 0&lt;br /&gt;
proc                    /proc                   proc    defaults        0 0&lt;br /&gt;
xenfs                   /proc/xen               xenfs   defaults        0 0&lt;br /&gt;
/dev/drbd0_vg0/xen_shared /xen_shared           gfs2    rw,suid,dev,exec,nouser,async    0 0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Reference The GFS2 Partition By UUID ===&lt;br /&gt;
&lt;br /&gt;
It is sometimes preferable to create an &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fstab&amp;lt;/span&amp;gt; entry that locates the device path via it&#039;s [[UUID]]. To do this, you can run the following command which, though a bit cryptic, will print out an &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/fstab&amp;lt;/span&amp;gt; compatible string.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Warning&#039;&#039;&#039;: The same warnings apply here as above&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
echo `gfs2_edit -p sb /dev/drbd0_vg0/xen_shared | grep sb_uuid | sed -e &amp;quot;s/.*sb_uuid  *\(.*\)/UUID=\L\1\E \/xen_shared\t\tgfs2\trw,suid,dev,exec,nouser,async\t0 0/&amp;quot;`&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
UUID=a1487063-2a3f-43b1-3a36-44936b0b4d1e /xen_shared gfs2 rw,suid,dev,exec,nouser,async 0 0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You may have noticed that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;defaults&amp;lt;/span&amp;gt; isn&#039;t used. Rather, all but the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;auto&amp;lt;/span&amp;gt; option are manually set. This is because the system will drop to single-user mode at boot if it can&#039;t mount an &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;auto&amp;lt;/span&amp;gt; partition at boot time (&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;auto&amp;lt;/span&amp;gt; being implied by &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;defaults&amp;lt;/span&amp;gt;). Given that our GFS2 partition sits on top of DRBD and the cluster, there is no way to make it available that early in the boot process.&lt;br /&gt;
&lt;br /&gt;
Further, the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;gfs2&amp;lt;/span&amp;gt; init script specifically excludes entries in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/fstab&amp;lt;/span&amp;gt; that have the &#039;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;noauto&amp;lt;/span&amp;gt; option set. For this reason, we can&#039;t simply specify that as we need the init script to see the partition so that it is mounted when GFS2 starts and unmounted when it stops.&lt;br /&gt;
&lt;br /&gt;
Now add this string to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/fstab&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/fstab&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
#&lt;br /&gt;
# /etc/fstab&lt;br /&gt;
# Created by anaconda on Tue Sep  7 06:29:51 2010&lt;br /&gt;
#&lt;br /&gt;
# Accessible filesystems, by reference, are maintained under &#039;/dev/disk&#039;&lt;br /&gt;
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info&lt;br /&gt;
#&lt;br /&gt;
UUID=865690db-85d0-44c5-9f32-ffb6fdf47060 /                       ext3    defaults        1 1&lt;br /&gt;
UUID=8b9822b6-a92e-48c9-96b5-f8943142319e /boot                   ext3    defaults        1 2&lt;br /&gt;
UUID=94b03547-a7e3-45bb-b2d5-837498b370f4 swap                    swap    defaults        0 0&lt;br /&gt;
tmpfs                   /dev/shm                tmpfs   defaults        0 0&lt;br /&gt;
devpts                  /dev/pts                devpts  gid=5,mode=620  0 0&lt;br /&gt;
sysfs                   /sys                    sysfs   defaults        0 0&lt;br /&gt;
proc                    /proc                   proc    defaults        0 0&lt;br /&gt;
xenfs                   /proc/xen               xenfs   defaults        0 0&lt;br /&gt;
UUID=a1487063-2a3f-43b1-3a36-44936b0b4d1e /xen_shared gfs2 rw,suid,dev,exec,nouser,async 0 0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Please note; At the time of writing this HowTo, there is a bug in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;findfs&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;mount&amp;lt;/span&amp;gt;. According to [http://www.ietf.org/rfc/rfc4122.txt RFC 4122], programs should accept a [[UUID]] in either upper or lower case. However, this is not currently the case, so you &#039;&#039;&#039;must&#039;&#039;&#039; pass the UUID in lower-case. Please see bugs [https://bugzilla.redhat.com/show_bug.cgi?id=632373 632373] and [https://bugzilla.redhat.com/show_bug.cgi?id=632385 632385].&lt;br /&gt;
&lt;br /&gt;
== Testing The gfs2 Initialization Script ==&lt;br /&gt;
&lt;br /&gt;
To verify that the new entry is valid, check &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;gfs2&amp;lt;/span&amp;gt;&#039;s status.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/gfs2 status&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Configured GFS2 mountpoints: &lt;br /&gt;
/xen_shared&lt;br /&gt;
Active GFS2 mountpoints: &lt;br /&gt;
/xen_shared&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now test stopping and restarting to ensure that the GFS2 partition unmounts and mounts properly.&lt;br /&gt;
&lt;br /&gt;
Stop &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;gfs2&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/gfs2 stop&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Unmounting GFS2 filesystem (/xen_shared):                   [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;df -h&amp;lt;/span&amp;gt; to ensure that the mount is gone.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
df -h&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Filesystem            Size  Used Avail Use% Mounted on&lt;br /&gt;
/dev/md1               39G  2.0G   35G   6% /&lt;br /&gt;
tmpfs                 466M   23M  444M   5% /dev/shm&lt;br /&gt;
/dev/md0              243M   70M  161M  31% /boot&lt;br /&gt;
xenstore              466M   32K  466M   1% /var/lib/xenstored&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Start &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;gfs2&amp;lt;/span&amp;gt; again.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/gfs2 start&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Mounting GFS2 filesystem (/xen_shared):                     [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Again, check with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;df -h&amp;lt;/span&amp;gt; that it has been remounted.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
df -h&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Filesystem            Size  Used Avail Use% Mounted on&lt;br /&gt;
/dev/md1               39G  2.0G   35G   6% /&lt;br /&gt;
tmpfs                 466M   29M  438M   7% /dev/shm&lt;br /&gt;
/dev/md0              243M   70M  161M  31% /boot&lt;br /&gt;
xenstore              466M   32K  466M   1% /var/lib/xenstored&lt;br /&gt;
/dev/dm-0              20G  259M   20G   2% /xen_shared&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Done!&lt;br /&gt;
&lt;br /&gt;
== Further Reading ==&lt;br /&gt;
&lt;br /&gt;
* [[Grow a GFS2 Partition]]&lt;br /&gt;
* [[Hard drive has gone bad in DRBD]]&lt;br /&gt;
&lt;br /&gt;
= Altering Daemon Start Order =&lt;br /&gt;
&lt;br /&gt;
It is important that the various daemons in use by our cluster start in the right order. Most daemons will rely on services provided by another daemon to be running, and will not start or will not operate reliably otherwise.&lt;br /&gt;
&lt;br /&gt;
We need to make sure that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xend&amp;lt;/span&amp;gt; starts so that the network is stable. Then &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt; needs to start so that [[fencing]] and [[dlm]] are available. Next, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;drbd&amp;lt;/span&amp;gt; starts so that the clustered storage is available. Then &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clvmd&amp;lt;/span&amp;gt; must start so that the data on the DRBD resource is accessible. Now &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;gfs2&amp;lt;/span&amp;gt; needs to start so that the Xen domU configuration files can be found and finally &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xendomains&amp;lt;/span&amp;gt; must start to boot up the actual domU virtual machines.&lt;br /&gt;
&lt;br /&gt;
To restate as a list, the start order must be:&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xend&amp;lt;/span&amp;gt;&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt;&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;drbd&amp;lt;/span&amp;gt;&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clvmd&amp;lt;/span&amp;gt;&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;gfs2&amp;lt;/span&amp;gt;&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xendomains&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To make sure the start order is sane then, we&#039;ll edit each of the six daemon&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;init&amp;lt;/span&amp;gt; scripts and alter their &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Required-Start&amp;lt;/span&amp;gt; lines. To make the changes take effect, we will use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;chkconfig&amp;lt;/span&amp;gt; to remove and re-add them to the various start levels.&lt;br /&gt;
&lt;br /&gt;
== Altering xend ==&lt;br /&gt;
&lt;br /&gt;
This should already be done. If it isn&#039;t, please see &amp;quot;[[#Make xend play nice with clustering|Making xend play nice with clustering]]&amp;quot; above. If you are revisiting that section, you can skip the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt; edit as we will need to make another change in the next step.&lt;br /&gt;
&lt;br /&gt;
== Altering cman ==&lt;br /&gt;
&lt;br /&gt;
This should already be done. If it isn&#039;t, please see &amp;quot;[[#Make xend play nice with clustering|Making xend play nice with clustering]]&amp;quot; above. If you are revisiting that section, you can skip the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt; edit as we will need to make another change in the next step.&lt;br /&gt;
&lt;br /&gt;
== Altering drbd ==&lt;br /&gt;
&lt;br /&gt;
Now we will tell &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;drbd&amp;lt;/span&amp;gt; to start after &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
This requires the additional step of altering the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;chkconfig: - 70 08&amp;lt;/span&amp;gt; line to instead read &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;chkconfig: - 20 08&amp;lt;/span&amp;gt;. This isn&#039;t strictly needed, but will give more room for &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;chkconfig&amp;lt;/span&amp;gt; to order the dependent daemons by allowing DRBD to be started as low as position &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;20&amp;lt;/span&amp;gt;, rather than waiting until position &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;70&amp;lt;/span&amp;gt;. This is somewhat more compatible with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clvmd&amp;lt;/span&amp;gt; which normally start at positions &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;21&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;24&amp;lt;/span&amp;gt;, respectively&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/init.d/drbd&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
#&lt;br /&gt;
# chkconfig: - 20 08&lt;br /&gt;
# description: Loads and unloads the drbd module&lt;br /&gt;
#&lt;br /&gt;
# Copright 2001-2008 LINBIT Information Technologies&lt;br /&gt;
# Philipp Reisner, Lars Ellenberg&lt;br /&gt;
#&lt;br /&gt;
### BEGIN INIT INFO&lt;br /&gt;
# Provides: drbd&lt;br /&gt;
# Required-Start: $local_fs $network $syslog cman&lt;br /&gt;
# Required-Stop:  $local_fs $network $syslog&lt;br /&gt;
# Should-Start:   sshd multipathd&lt;br /&gt;
# Should-Stop:    sshd multipathd&lt;br /&gt;
# Default-Start:&lt;br /&gt;
# Default-Stop:&lt;br /&gt;
# Short-Description:    Control drbd resources.&lt;br /&gt;
### END INIT INFO&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Altering clvmd ==&lt;br /&gt;
&lt;br /&gt;
Now we will now tell &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clvmd&amp;lt;/span&amp;gt; to start after &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;drbd&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: There is currently a minor bug with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;lvm2-cluster&amp;lt;/span&amp;gt; version &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;2.02.73-2&amp;lt;/span&amp;gt; in that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/init.d/clvmd&amp;lt;/span&amp;gt; is set by default to mode &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;0555&amp;lt;/span&amp;gt;. This is easily corrected by running the following command. Please check bug [https://bugzilla.redhat.com/show_bug.cgi?id=636066 636066] to see if this has been resolved.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
chmod u+w /etc/init.d/clvmd&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once you&#039;ve got write access, edit the file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/init.d/clvmd&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
#&lt;br /&gt;
# chkconfig: - 24 76&lt;br /&gt;
# description: Starts and stops clvmd&lt;br /&gt;
#&lt;br /&gt;
# For Red-Hat-based distributions such as Fedora, RHEL, CentOS.&lt;br /&gt;
#              &lt;br /&gt;
### BEGIN INIT INFO&lt;br /&gt;
# Provides: clvmd&lt;br /&gt;
# Required-Start: $local_fs drbd&lt;br /&gt;
# Required-Stop: $local_fs&lt;br /&gt;
# Default-Start:&lt;br /&gt;
# Default-Stop: 0 1 6&lt;br /&gt;
# Short-Description: Clustered LVM Daemon&lt;br /&gt;
### END INIT INFO&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Altering gfs2 ==&lt;br /&gt;
&lt;br /&gt;
Now we will now tell &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;gfs2&amp;lt;/span&amp;gt; to start after &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clvmd&amp;lt;/span&amp;gt;. You will notice that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt; is already listed under &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Required-Start&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Required-Stop&amp;lt;/span&amp;gt;. It&#039;s true that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt; must be started, but we&#039;ve created a chain here so we can safely replace it with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clvmd&amp;lt;/span&amp;gt; in the start line.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/init.d/gfs2&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
#&lt;br /&gt;
# gfs2 mount/unmount helper&lt;br /&gt;
#&lt;br /&gt;
# chkconfig: - 26 74&lt;br /&gt;
# description: mount/unmount gfs2 filesystems configured in /etc/fstab&lt;br /&gt;
&lt;br /&gt;
### BEGIN INIT INFO&lt;br /&gt;
# Provides:             gfs2&lt;br /&gt;
# Required-Start:       $network clvmd&lt;br /&gt;
# Required-Stop:        $network&lt;br /&gt;
# Default-Start:&lt;br /&gt;
# Default-Stop:&lt;br /&gt;
# Short-Description:    mount/unmount gfs2 filesystems configured in /etc/fstab&lt;br /&gt;
# Description:          mount/unmount gfs2 filesystems configured in /etc/fstab&lt;br /&gt;
### END INIT INFO&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Altering xendomains ==&lt;br /&gt;
&lt;br /&gt;
Finally, we will alter &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xendomains&amp;lt;/span&amp;gt; so that it starts last, after &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;gfs2&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/init.d/xendomains&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
#&lt;br /&gt;
# /etc/init.d/xendomains&lt;br /&gt;
# Start / stop domains automatically when domain 0 boots / shuts down.&lt;br /&gt;
#&lt;br /&gt;
# chkconfig: 345 99 00&lt;br /&gt;
# description: Start / stop Xen domains.&lt;br /&gt;
#&lt;br /&gt;
# This script offers fairly basic functionality.  It should work on Redhat&lt;br /&gt;
# but also on LSB-compliant SuSE releases and on Debian with the LSB package&lt;br /&gt;
# installed.  (LSB is the Linux Standard Base)&lt;br /&gt;
#&lt;br /&gt;
# Based on the example in the &amp;quot;Designing High Quality Integrated Linux&lt;br /&gt;
# Applications HOWTO&amp;quot; by Avi Alkalay&lt;br /&gt;
# &amp;lt;http://www.tldp.org/HOWTO/HighQuality-Apps-HOWTO/&amp;gt;&lt;br /&gt;
#&lt;br /&gt;
### BEGIN INIT INFO&lt;br /&gt;
# Provides:          xendomains&lt;br /&gt;
# Required-Start:    $syslog $remote_fs xend gfs2&lt;br /&gt;
# Should-Start:&lt;br /&gt;
# Required-Stop:     $syslog $remote_fs xend&lt;br /&gt;
# Should-Stop:&lt;br /&gt;
# Default-Start:     3 4 5&lt;br /&gt;
# Default-Stop:      0 1 2 6&lt;br /&gt;
# Default-Enabled:   yes&lt;br /&gt;
# Short-Description: Start/stop secondary xen domains&lt;br /&gt;
# Description:       Start / stop domains automatically when domain 0 &lt;br /&gt;
#                    boots / shuts down.&lt;br /&gt;
### END INIT INFO&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Applying The Changes ==&lt;br /&gt;
&lt;br /&gt;
Change the start order by removing and re-adding all cluster-related daemons using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;chkconfig&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
chkconfig xenstored off; chkconfig xenconsoled off; chkconfig xend off; chkconfig cman off; chkconfig drbd off; chkconfig clvmd off; chkconfig gfs2 off; chkconfig xendomains off&lt;br /&gt;
chkconfig xendomains on; chkconfig gfs2 on; chkconfig clvmd on; chkconfig drbd on; chkconfig cman on; chkconfig xend on; chkconfig xenconsoled on; chkconfig xenstored on&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now verify that the start order is as we want it. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ls -lah /etc/rc3.d/&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
lrwxrwxrwx.  1 root root   19 Sep 20 13:37 S26xenstored -&amp;gt; ../init.d/xenstored&lt;br /&gt;
lrwxrwxrwx.  1 root root   21 Sep 20 13:37 S27xenconsoled -&amp;gt; ../init.d/xenconsoled&lt;br /&gt;
lrwxrwxrwx.  1 root root   14 Sep 20 13:37 S28xend -&amp;gt; ../init.d/xend&lt;br /&gt;
lrwxrwxrwx.  1 root root   14 Sep 20 13:37 S29cman -&amp;gt; ../init.d/cman&lt;br /&gt;
lrwxrwxrwx.  1 root root   14 Sep 20 13:37 S70drbd -&amp;gt; ../init.d/drbd&lt;br /&gt;
lrwxrwxrwx.  1 root root   15 Sep 20 13:37 S71clvmd -&amp;gt; ../init.d/clvmd&lt;br /&gt;
lrwxrwxrwx.  1 root root   14 Sep 20 13:37 S72gfs2 -&amp;gt; ../init.d/gfs2&lt;br /&gt;
lrwxrwxrwx.  1 root root   20 Sep 20 13:37 S99xendomains -&amp;gt; ../init.d/xendomains&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Setting Up Xen =&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;WARNING&#039;&#039;&#039;&#039;&#039;: Everything below here is pretty &#039;&#039;&#039;seriously screwed up&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: This is not meant to be an extensive tutorial on Xen itself. It covers enough to get domU VMs provisioned in a manner that will take advantage of the cluster. As such, there is minimal explanation of configuration file options. If you need further help, please drop by the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;##xen&amp;lt;/span&amp;gt; (yes, two &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;##&amp;lt;/span&amp;gt;) [[IRC]] channel on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;freenode.org&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Install The Hypervisor Tools ==&lt;br /&gt;
&lt;br /&gt;
These tools are very useful in provisioning and managing domU VMs.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum -y install virt-install virt-viewer&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Install The HVM/KVM Tools ==&lt;br /&gt;
&lt;br /&gt;
For &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;hvm&amp;lt;/span&amp;gt; (Hardware Virtual Machines), which is required for [http://www.virtuatopia.com/index.php/Virtualizing_Windows_Server_2008_with_Xen paravirtualized Microsoft] VMs, you must install the following packages as well.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum -y install qemu-kvm.x86_64 qemu-kvm-tools.x86_64&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Ensure That Virtualization Is Enabled ==&lt;br /&gt;
&lt;br /&gt;
Many motherboards disable &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;hvm&amp;lt;/span&amp;gt; by default in their [[BIOS]]. Assuming that you&#039;ve got a dom0 kernel running at this stage, you can check if this is the case by checking the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xm info&amp;lt;/span&amp;gt; output.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
xm info&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
host                   : an-node04.alteeve.com&lt;br /&gt;
release                : 2.6.32.23-170.dom0_an1.fc13.x86_64&lt;br /&gt;
version                : #1 SMP Sun Oct 10 20:39:19 EDT 2010&lt;br /&gt;
machine                : x86_64&lt;br /&gt;
nr_cpus                : 4&lt;br /&gt;
nr_nodes               : 1&lt;br /&gt;
cores_per_socket       : 4&lt;br /&gt;
threads_per_core       : 1&lt;br /&gt;
cpu_mhz                : 2209&lt;br /&gt;
hw_caps                : 178bf3ff:efd3fbff:00000000:00001310:00802001:00000000:000037ff:00000000&lt;br /&gt;
virt_caps              : hvm&lt;br /&gt;
total_memory           : 4063&lt;br /&gt;
free_memory            : 2987&lt;br /&gt;
node_to_cpu            : node0:0-3&lt;br /&gt;
node_to_memory         : node0:2987&lt;br /&gt;
node_to_dma32_mem      : node0:2928&lt;br /&gt;
max_node_id            : 0&lt;br /&gt;
xen_major              : 4&lt;br /&gt;
xen_minor              : 0&lt;br /&gt;
xen_extra              : .1&lt;br /&gt;
xen_caps               : xen-3.0-x86_64 xen-3.0-x86_32p hvm-3.0-x86_32 hvm-3.0-x86_32p hvm-3.0-x86_64 &lt;br /&gt;
xen_scheduler          : credit&lt;br /&gt;
xen_pagesize           : 4096&lt;br /&gt;
platform_params        : virt_start=0xffff800000000000&lt;br /&gt;
xen_changeset          : unavailable&lt;br /&gt;
xen_commandline        : dom0_mem=1024M&lt;br /&gt;
cc_compiler            : gcc version 4.4.4 20100630 (Red Hat 4.4.4-10) (GCC) &lt;br /&gt;
cc_compile_by          : root&lt;br /&gt;
cc_compile_domain      : &lt;br /&gt;
cc_compile_date        : Mon Oct 11 01:10:38 EDT 2010&lt;br /&gt;
xend_config_format     : 4&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Look at the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt_caps&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xen_caps&amp;lt;/span&amp;gt; lines. Notice the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;hvm&amp;lt;/span&amp;gt; entries? This shows that HVM, also known as &amp;quot;secure virtualization&amp;quot;, has been enabled. If you do not see this, please check your mainboard manual for information on enabling this on your system.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: The next paragraph applies only when running a vanilla kernel.&lt;br /&gt;
&lt;br /&gt;
If you are running a vanilla kernel, you can check to see if your CPU has support for HVM guests but checking &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/proc/cpuinfo&amp;lt;/span&amp;gt;. What you&#039;re looking for depends on your CPU manufacturer. If you have an Intel CPU, you need to look for the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vmx&amp;lt;/span&amp;gt; flag. Likewise, with AMD CPUs, you need to look for the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;svm&amp;lt;/span&amp;gt; flag.&lt;br /&gt;
&lt;br /&gt;
For a more complete, if somewhat dated paper on this topic, please [http://fedoraproject.org/wiki/FedoraXenQuickstartFC6#Fully-virtualized_guests_.28HVM.2FIntel-VT.2FAMD-V.29 Fedora 6 Xen Quickstart Guide, System Requirements].&lt;br /&gt;
&lt;br /&gt;
== Enabling Migration ==&lt;br /&gt;
&lt;br /&gt;
By default, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xend&amp;lt;/span&amp;gt; will not allow domU VMs from being migrated onto or off of a given dom0 host. Given that we&#039;ve got a cluster though, we very much want this behaviour, so now we will enable it. This is done by making edits to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/xen/xend-config.sxp&amp;lt;/span&amp;gt;. Below is a concise list of options that must be set. Some exist already in the file and need to be commented out or altered.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Warning&#039;&#039;&#039;: The values below are &#039;&#039;&#039;very&#039;&#039;&#039; permissive. Please review each option and improve the security to fit your network before going into production!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/xen/xend-config.sxp &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
(xend-http-server yes)&lt;br /&gt;
(xend-unix-server yes)&lt;br /&gt;
(xend-tcp-xmlrpc-server yes)&lt;br /&gt;
(xend-relocation-server yes)&lt;br /&gt;
(xend-udev-event-server yes)&lt;br /&gt;
(xend-port            8000)&lt;br /&gt;
(xend-relocation-port 8002)&lt;br /&gt;
(xend-address &#039;&#039;)&lt;br /&gt;
(xend-relocation-address &#039;&#039;)&lt;br /&gt;
(xend-relocation-hosts-allow &#039;&#039;)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once done, restart &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xend&amp;lt;/span&amp;gt;. It is usually safest to stop the cluster before hand to avoid accidental fencing caused by the underlying network being reconfigured.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/gfs2 stop&lt;br /&gt;
/etc/init.d/clvmd stop&lt;br /&gt;
/etc/init.d/cman stop&lt;br /&gt;
/etc/init.d/xend restart&lt;br /&gt;
/etc/init.d/cman start&lt;br /&gt;
/etc/init.d/clvmd start&lt;br /&gt;
/etc/init.d/gfs2 start&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Virtual Machine Naming Convention ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: This section acts as a recommendation only. Feel free to alter this to fit your style and needs.&lt;br /&gt;
&lt;br /&gt;
Personally, I like to name my VMs similar to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;c5_shorewall_01&amp;lt;/span&amp;gt;. To elaborate, I like to use the format:&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;os_role_seq&amp;lt;/span&amp;gt; (&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;Operating System ID&amp;gt;_&amp;lt;Role of the VM&amp;gt;_&amp;lt;Sequence Integer&amp;gt;&amp;lt;/span&amp;gt;). &lt;br /&gt;
&lt;br /&gt;
There are no (known) restrictions on virtual machine names, so feel free to use names that made sense for you. I do strongly recommend that you match the name of your domU VM to the name of it&#039;s host LVM logical volume.&lt;br /&gt;
&lt;br /&gt;
== Provisioning domU VMs ==&lt;br /&gt;
&lt;br /&gt;
There are two ways to provision new VMs that we will cover (there are many others); Using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-install&amp;lt;/span&amp;gt; and using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xm create -f /path/to/domain.cfg&amp;lt;/span&amp;gt; where &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;domain.cfg&amp;lt;/span&amp;gt; is a hand-crafted python script.&lt;br /&gt;
&lt;br /&gt;
=== Provisioning with virt-install ===&lt;br /&gt;
&lt;br /&gt;
This uses a long command line argument that provisions the VM and loads it into &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;libvirt&amp;lt;/span&amp;gt;. Where possible, this is probably the best way to provision a domU. However, there are occasions where it may not work.&lt;br /&gt;
&lt;br /&gt;
Here is an example where a domU is provisioned for a [[Fedora]] 13, x86_64 VM with a dedicated logical volume on the clustered LVM. The command to create the LV precedes the command to provision the VM. Please review and adjust values as you need. Consult &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;man virt-install&amp;lt;/span&amp;gt; for a more complete list of available options and their uses.&lt;br /&gt;
&lt;br /&gt;
Following the provision command are two examples of how to backup the configuration to a flat file. The first directly dumps the configuration into the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;libvirt&amp;lt;/span&amp;gt; format. The second backs up the configuration to an [[XML]] file and then shows and example of how that file can be converted into a standard python script.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# Fedora 13 x86_64 RPM builder VM&lt;br /&gt;
lvcreate -L 40G -n f13_builder_01 drbd0_vg0&lt;br /&gt;
virt-install --connect xen \&lt;br /&gt;
             --name f13_builder_01 \&lt;br /&gt;
             --ram 1024 \&lt;br /&gt;
             --arch x86_64 \&lt;br /&gt;
             --vcpus 1 \&lt;br /&gt;
             --cpuset 1 \&lt;br /&gt;
             --location http://192.168.1.10/f13/x86_64/img/ \&lt;br /&gt;
             --os-type linux \&lt;br /&gt;
             --os-variant fedora13 \&lt;br /&gt;
             --disk path=/dev/drbd0_vg0/f13_builder_01 \&lt;br /&gt;
             --network bridge=eth0,mac=00:16:3e:00:10:01 \&lt;br /&gt;
             --vnc \&lt;br /&gt;
             --paravirt&lt;br /&gt;
# Backup the domU configuration to the libvirt native format.&lt;br /&gt;
xm list -l f13_builder_01 &amp;gt; /xen_shared/dom_config/f13_builder.cfg&lt;br /&gt;
# Backup the config to an XML file.&lt;br /&gt;
virsh dumpxml f13_builder_01 &amp;gt; /xen_shared/domU_config/f13_builder_01.xml&lt;br /&gt;
# Convert it to a &amp;quot;traditional&amp;quot; python script. Be sure the edit the resulting .cfg file to remove the &#039;vifname=&#039; sections.&lt;br /&gt;
virsh -c xen:/// domxml-to-native xen-xm f13_builder_01.xml &amp;gt; f13_builder_01.cfg&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The next two examples show the provisioning of a [[CentOS]] v5.5 and [[RHEL]] v6.0, beta 2 machines. The dump and backup methods above should be easily adapted to work with these VMs.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# A CentOS test server&lt;br /&gt;
lvcreate -L 40G -n c5_test_01 drbd0_vg0&lt;br /&gt;
virt-install --connect xen \&lt;br /&gt;
             --name c5_test_01 \&lt;br /&gt;
             --ram 1024 \&lt;br /&gt;
             --arch x86_64 \&lt;br /&gt;
             --vcpus 1 \&lt;br /&gt;
             --cpuset 1-3 \&lt;br /&gt;
             --location http://192.168.1.10/c5/x86_64/img/ \&lt;br /&gt;
             --os-type linux \&lt;br /&gt;
             --os-variant rhel5.4 \&lt;br /&gt;
             --disk path=/dev/drbd0_vg0/c5_test_01 \&lt;br /&gt;
             --network bridge=eth0,mac=00:16:3e:00:10:02 \&lt;br /&gt;
             --vnc \&lt;br /&gt;
             --paravirt&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# Red Hat Enterprise Linux 6 beta 2 test server&lt;br /&gt;
lvcreate -L 40G -n rh6b2_test_01 drbd0_vg0&lt;br /&gt;
virt-install --connect xen \&lt;br /&gt;
             --name rh6b2_test_01 \&lt;br /&gt;
             --ram 1024 \&lt;br /&gt;
             --arch x86_64 \&lt;br /&gt;
             --vcpus 1 \&lt;br /&gt;
             --cpuset 1 \&lt;br /&gt;
             --location http://192.168.1.10/rhel6/x86_64/img/ \&lt;br /&gt;
             --os-type linux \&lt;br /&gt;
             --os-variant rhel6 \&lt;br /&gt;
             --disk path=/dev/drbd0_vg0/rh6b2_test_01 \&lt;br /&gt;
             --network bridge=eth0,mac=00:16:3e:00:10:03 \&lt;br /&gt;
             --vnc \&lt;br /&gt;
             --paravirt&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Provisioning With &#039;xm create&#039; ===&lt;br /&gt;
&lt;br /&gt;
At the time of writing this, I could not sort out the magical incantation for provisioning a [[Windows]] VM using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-install&amp;lt;/span&amp;gt;. Instead, I used the &amp;quot;old&amp;quot; style of crafting a configuration file using a python script. This is useful to know as many templates exist on the web for various VMs. Following the steps below, you should be able to fairly easily adapt them.&lt;br /&gt;
&lt;br /&gt;
In this example, we will provision a VM using [[HVM]] from an [[ISO]] image of the Windows 2008 Server installation DBD. In this case, there is a problem with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-install&amp;lt;/span&amp;gt; finding the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;qemu-dm&amp;lt;/span&amp;gt; file.&lt;br /&gt;
&lt;br /&gt;
This configuration file will be saved in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/xen_shared/domU_config&amp;lt;/span&amp;gt; directory, which exists on the shared [[GFS2]] partition we created earlier.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
mkdir /xen_shared/domU_config&lt;br /&gt;
vim /xen_shared/domU_config/win2008_sql_01.cfg&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
# This is the Windows 2008 Enterprise Server x86_64 hosting MS SQL Server 2008 Enterprise&lt;br /&gt;
kernel = &amp;quot;/usr/lib/xen/boot/hvmloader&amp;quot;&lt;br /&gt;
builder=&#039;hvm&#039;&lt;br /&gt;
memory = 1024&lt;br /&gt;
&lt;br /&gt;
# Should be at least 2KB per MB of domain memory, plus a few MB per vcpu.&lt;br /&gt;
shadow_memory = 8&lt;br /&gt;
name = &amp;quot;win2008_sql_01&amp;quot;&lt;br /&gt;
#vif = [ &#039;type=ioemu, bridge=xenbr0&#039; ]&lt;br /&gt;
vif = [ &#039;type=ioemu, bridge=eth0,mac=00:16:3e:00:30:03&#039; ]&lt;br /&gt;
acpi = 1&lt;br /&gt;
apic = 1&lt;br /&gt;
# Remove the &#039;file:...&#039; entry (or change it to another ISO) after the install is complete.&lt;br /&gt;
disk = [ &#039;phy:/dev/drbd0_vg0/win2008_sql_01,hda,w&#039;, &#039;file:/xen_shared/iso/MS-Win2008-Ent-x86_64-SP2.iso,hdc:cdrom,r&#039; ]&lt;br /&gt;
&lt;br /&gt;
device_model = &#039;/usr/lib/xen/bin/qemu-dm&#039;&lt;br /&gt;
&lt;br /&gt;
#-----------------------------------------------------------------------------&lt;br /&gt;
# boot on floppy (a), hard disk (c) or CD-ROM (d) &lt;br /&gt;
# default: hard disk, cd-rom, floppy&lt;br /&gt;
boot=&amp;quot;dc&amp;quot;&lt;br /&gt;
sdl=0&lt;br /&gt;
vnc=1&lt;br /&gt;
vncconsole=1&lt;br /&gt;
vncpasswd=&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
serial=&#039;pty&#039;&lt;br /&gt;
usbdevice=&#039;tablet&#039;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now provision the VM using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xm create&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
xm create -f /xen_shared/domU_config/win2008_sql_01.cfg&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At this point, the VM is not loaded into &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;libvirt&amp;lt;/span&amp;gt;. This is a problem as, on boot, the node will not know that the VM exists. As a consequence, some tools like &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-manager&amp;lt;/span&amp;gt; will not see the VM until it is manually started with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xm create -f /xen_shared/domU_config/domain.cfg&amp;lt;/span&amp;gt;. Further, and perhaps more troubling, changes made to the VM&#039;s config made outside to config file will be lost when you restart from the config file.&lt;br /&gt;
&lt;br /&gt;
To fix this, we&#039;ll use a few hacks to load the config into &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;libvirt&amp;lt;/span&amp;gt;. This needs to be done while the domU is loaded and it must be done on the node currently hosting the VM.&lt;br /&gt;
&lt;br /&gt;
First, make sure that the domU&#039;s configuration is visible. Then, dump the config and filter it through &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;grep&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;sed&amp;lt;/span&amp;gt; to pull out the [[UUID]]. Once you know that you get the proper UUID, create the directory under &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/var/lib/xend/domains/&amp;lt;/span&amp;gt; and then create the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;config.sxp&amp;lt;/span&amp;gt; file with the domU&#039;s configuration.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE&#039;&#039;&#039;: Be sure to change &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;win2008_01&amp;lt;/span&amp;gt; in the examples below to match the name of the domU that you want to setup.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
xm list -l win2008_01&lt;br /&gt;
xm list -l win2008_01 | grep &#039;^    (uuid&#039; | sed -e &amp;quot;s/    (uuid \(.*\))/\1/&amp;quot;&lt;br /&gt;
mkdir /var/lib/xend/domains/`xm list -l win2008_01 | grep &#039;^    (uuid&#039; | sed -e &amp;quot;s/    (uuid \(.*\))/\1/&amp;quot;`&lt;br /&gt;
cd /var/lib/xend/domains/`xm list -l win2008_01 | grep &#039;^    (uuid&#039; | sed -e &amp;quot;s/    (uuid \(.*\))/\1/&amp;quot;`&lt;br /&gt;
xm list -l win2008_01 &amp;gt; config.sxp&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There are several &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;uuid&amp;lt;/span&amp;gt; strings in the output from &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xm list -l domain&amp;lt;/span&amp;gt;. Thankfully, the one we want is the only one indented by four spaces. This is how we can be fairly confident that the UUID returned by &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;sed&amp;lt;/span&amp;gt; above is, in fact, &lt;br /&gt;
&lt;br /&gt;
&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{footer}}&lt;/div&gt;</summary>
		<author><name>SRSullivan</name></author>
	</entry>
	<entry>
		<id>https://alteeve.com/w/index.php?title=Talk:Two_Node_Fedora_13_Cluster_-_Xen-Based_Virtual_Machine_Host_on_DRBD%2BCLVM&amp;diff=2301</id>
		<title>Talk:Two Node Fedora 13 Cluster - Xen-Based Virtual Machine Host on DRBD+CLVM</title>
		<link rel="alternate" type="text/html" href="https://alteeve.com/w/index.php?title=Talk:Two_Node_Fedora_13_Cluster_-_Xen-Based_Virtual_Machine_Host_on_DRBD%2BCLVM&amp;diff=2301"/>
		<updated>2010-10-15T20:05:10Z</updated>

		<summary type="html">&lt;p&gt;SRSullivan: /* Dealing with Raid 5/6 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;We&#039;ll remove the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;yum -y&amp;lt;/span&amp;gt; before the document goes live. For now, I want it there to save time while (repeatedly) rebuilding the clusters as it saves a lot of time.&lt;br /&gt;
&lt;br /&gt;
--[[User:Digimer|Digimer]] 18:58, 13 October 2010 (UTC)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Dealing with Raid 5/6 ==&lt;br /&gt;
&lt;br /&gt;
Under raid 5/6 if you follow these instruction to closely you&#039;ll end up with bad config data in mdadm.conf&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cat /proc/mdstat&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Personalities : [raid1] [raid6] [raid5] [raid4] &lt;br /&gt;
md3 : active raid5 sdd5[4] sdc5[2] sdb5[1] sda5[0]&lt;br /&gt;
      1395170304 blocks super 1.2 level 5, 512k chunk, algorithm 2 [4/3] [UUU_]&lt;br /&gt;
      [=====&amp;gt;...............]  recovery = 26.5% (123522028/465056768) finish=126.7min speed=44896K/sec&lt;br /&gt;
      &lt;br /&gt;
md2 : active raid5 sda1[0] sdd1[4] sdc1[2] sdb1[1]&lt;br /&gt;
      62909952 blocks super 1.1 level 5, 512k chunk, algorithm 2 [4/4] [UUUU]&lt;br /&gt;
      bitmap: 0/1 pages [0KB], 65536KB chunk&lt;br /&gt;
&lt;br /&gt;
md1 : active raid5 sda2[0] sdd2[4] sdc2[2] sdb2[1]&lt;br /&gt;
      6286848 blocks super 1.1 level 5, 512k chunk, algorithm 2 [4/4] [UUUU]&lt;br /&gt;
      &lt;br /&gt;
md0 : active raid1 sda3[0] sdd3[3] sdc3[2] sdb3[1]&lt;br /&gt;
      255988 blocks super 1.0 [4/4] [UUUU]&lt;br /&gt;
      &lt;br /&gt;
unused devices: &amp;lt;none&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You will notice the [UUU_]. The default, and this is not in the documentation for mdadm, is to build the array with a degraded spare and then resync it. This is faster, but produces false data for the next step if it is done before the array completes it resync.&lt;br /&gt;
&lt;br /&gt;
Ref: [http://serverfault.com/questions/43575/how-to-create-a-software-raid5-array-without-a-spare/43581#43581]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
mdadm --detail --scan | grep md3 &amp;gt;&amp;gt; /etc/mdadm.conf&lt;br /&gt;
cat /etc/mdadm.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Will produce:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;ARRAY /dev/md3 metadata=1.2 spares=1 name=localhost.localdomain:3 UUID=b4fc7771:bef0b6a5:c4c40550:ab3bff42&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Which should actually be the following (with out the spares=1)&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
ARRAY /dev/md3 metadata=1.2 name=localhost.localdomain:3 UUID=b4fc7771:bef0b6a5:c4c40550:ab3bff42&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
--[[User:SRSullivan|SRSullivan]] 20:05, 15 October 2010 (UTC)&lt;/div&gt;</summary>
		<author><name>SRSullivan</name></author>
	</entry>
	<entry>
		<id>https://alteeve.com/w/index.php?title=Talk:Two_Node_Fedora_13_Cluster_-_Xen-Based_Virtual_Machine_Host_on_DRBD%2BCLVM&amp;diff=2300</id>
		<title>Talk:Two Node Fedora 13 Cluster - Xen-Based Virtual Machine Host on DRBD+CLVM</title>
		<link rel="alternate" type="text/html" href="https://alteeve.com/w/index.php?title=Talk:Two_Node_Fedora_13_Cluster_-_Xen-Based_Virtual_Machine_Host_on_DRBD%2BCLVM&amp;diff=2300"/>
		<updated>2010-10-15T20:04:54Z</updated>

		<summary type="html">&lt;p&gt;SRSullivan: /* Dealing with Raid 5/6 */  Sig&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;We&#039;ll remove the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;yum -y&amp;lt;/span&amp;gt; before the document goes live. For now, I want it there to save time while (repeatedly) rebuilding the clusters as it saves a lot of time.&lt;br /&gt;
&lt;br /&gt;
--[[User:Digimer|Digimer]] 18:58, 13 October 2010 (UTC)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Dealing with Raid 5/6 ==&lt;br /&gt;
&lt;br /&gt;
Under raid 5/6 if you follow these instruction to closely you&#039;ll end up with bad config data in mdadm.conf&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cat /proc/mdstat&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Personalities : [raid1] [raid6] [raid5] [raid4] &lt;br /&gt;
md3 : active raid5 sdd5[4] sdc5[2] sdb5[1] sda5[0]&lt;br /&gt;
      1395170304 blocks super 1.2 level 5, 512k chunk, algorithm 2 [4/3] [UUU_]&lt;br /&gt;
      [=====&amp;gt;...............]  recovery = 26.5% (123522028/465056768) finish=126.7min speed=44896K/sec&lt;br /&gt;
      &lt;br /&gt;
md2 : active raid5 sda1[0] sdd1[4] sdc1[2] sdb1[1]&lt;br /&gt;
      62909952 blocks super 1.1 level 5, 512k chunk, algorithm 2 [4/4] [UUUU]&lt;br /&gt;
      bitmap: 0/1 pages [0KB], 65536KB chunk&lt;br /&gt;
&lt;br /&gt;
md1 : active raid5 sda2[0] sdd2[4] sdc2[2] sdb2[1]&lt;br /&gt;
      6286848 blocks super 1.1 level 5, 512k chunk, algorithm 2 [4/4] [UUUU]&lt;br /&gt;
      &lt;br /&gt;
md0 : active raid1 sda3[0] sdd3[3] sdc3[2] sdb3[1]&lt;br /&gt;
      255988 blocks super 1.0 [4/4] [UUUU]&lt;br /&gt;
      &lt;br /&gt;
unused devices: &amp;lt;none&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You will notice the [UUU_]. The default, and this is not in the documentation for mdadm, is to build the array with a degraded spare and then resync it. This is faster, but produces false data for the next step if it is done before the array completes it resync.&lt;br /&gt;
&lt;br /&gt;
Ref: [http://serverfault.com/questions/43575/how-to-create-a-software-raid5-array-without-a-spare/43581#43581]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
mdadm --detail --scan | grep md3 &amp;gt;&amp;gt; /etc/mdadm.conf&lt;br /&gt;
cat /etc/mdadm.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Will produce:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;ARRAY /dev/md3 metadata=1.2 spares=1 name=localhost.localdomain:3 UUID=b4fc7771:bef0b6a5:c4c40550:ab3bff42&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Which should actually be the following (with out the spares=1)&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
ARRAY /dev/md3 metadata=1.2 name=localhost.localdomain:3 UUID=b4fc7771:bef0b6a5:c4c40550:ab3bff42&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;/div&gt;</summary>
		<author><name>SRSullivan</name></author>
	</entry>
	<entry>
		<id>https://alteeve.com/w/index.php?title=Talk:Two_Node_Fedora_13_Cluster_-_Xen-Based_Virtual_Machine_Host_on_DRBD%2BCLVM&amp;diff=2299</id>
		<title>Talk:Two Node Fedora 13 Cluster - Xen-Based Virtual Machine Host on DRBD+CLVM</title>
		<link rel="alternate" type="text/html" href="https://alteeve.com/w/index.php?title=Talk:Two_Node_Fedora_13_Cluster_-_Xen-Based_Virtual_Machine_Host_on_DRBD%2BCLVM&amp;diff=2299"/>
		<updated>2010-10-15T20:04:35Z</updated>

		<summary type="html">&lt;p&gt;SRSullivan: Copy Paste failure in insturctions when dealing with a non Raid 1&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;We&#039;ll remove the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;yum -y&amp;lt;/span&amp;gt; before the document goes live. For now, I want it there to save time while (repeatedly) rebuilding the clusters as it saves a lot of time.&lt;br /&gt;
&lt;br /&gt;
--[[User:Digimer|Digimer]] 18:58, 13 October 2010 (UTC)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Dealing with Raid 5/6 ==&lt;br /&gt;
&lt;br /&gt;
Under raid 5/6 if you follow these instruction to closely you&#039;ll end up with bad config data in mdadm.conf&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cat /proc/mdstat&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Personalities : [raid1] [raid6] [raid5] [raid4] &lt;br /&gt;
md3 : active raid5 sdd5[4] sdc5[2] sdb5[1] sda5[0]&lt;br /&gt;
      1395170304 blocks super 1.2 level 5, 512k chunk, algorithm 2 [4/3] [UUU_]&lt;br /&gt;
      [=====&amp;gt;...............]  recovery = 26.5% (123522028/465056768) finish=126.7min speed=44896K/sec&lt;br /&gt;
      &lt;br /&gt;
md2 : active raid5 sda1[0] sdd1[4] sdc1[2] sdb1[1]&lt;br /&gt;
      62909952 blocks super 1.1 level 5, 512k chunk, algorithm 2 [4/4] [UUUU]&lt;br /&gt;
      bitmap: 0/1 pages [0KB], 65536KB chunk&lt;br /&gt;
&lt;br /&gt;
md1 : active raid5 sda2[0] sdd2[4] sdc2[2] sdb2[1]&lt;br /&gt;
      6286848 blocks super 1.1 level 5, 512k chunk, algorithm 2 [4/4] [UUUU]&lt;br /&gt;
      &lt;br /&gt;
md0 : active raid1 sda3[0] sdd3[3] sdc3[2] sdb3[1]&lt;br /&gt;
      255988 blocks super 1.0 [4/4] [UUUU]&lt;br /&gt;
      &lt;br /&gt;
unused devices: &amp;lt;none&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You will notice the [UUU_]. The default, and this is not in the documentation for mdadm, is to build the array with a degraded spare and then resync it. This is faster, but produces false data for the next step if it is done before the array completes it resync.&lt;br /&gt;
&lt;br /&gt;
Ref: [http://serverfault.com/questions/43575/how-to-create-a-software-raid5-array-without-a-spare/43581#43581]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
mdadm --detail --scan | grep md3 &amp;gt;&amp;gt; /etc/mdadm.conf&lt;br /&gt;
cat /etc/mdadm.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Will produce:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;ARRAY /dev/md3 metadata=1.2 spares=1 name=localhost.localdomain:3 UUID=b4fc7771:bef0b6a5:c4c40550:ab3bff42&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Which should actually be the following (with out the spares=1)&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
ARRAY /dev/md3 metadata=1.2 name=localhost.localdomain:3 UUID=b4fc7771:bef0b6a5:c4c40550:ab3bff42&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>SRSullivan</name></author>
	</entry>
	<entry>
		<id>https://alteeve.com/w/index.php?title=Two_Node_Fedora_13_Cluster_-_Xen-Based_Virtual_Machine_Host_on_DRBD%2BCLVM&amp;diff=2298</id>
		<title>Two Node Fedora 13 Cluster - Xen-Based Virtual Machine Host on DRBD+CLVM</title>
		<link rel="alternate" type="text/html" href="https://alteeve.com/w/index.php?title=Two_Node_Fedora_13_Cluster_-_Xen-Based_Virtual_Machine_Host_on_DRBD%2BCLVM&amp;diff=2298"/>
		<updated>2010-10-15T17:52:33Z</updated>

		<summary type="html">&lt;p&gt;SRSullivan: /* Creating The New /dev/mdX Device */  Clarication that no file system should be made.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{howto_header}}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Warning&#039;&#039;&#039;: This is currently a dumping ground for notes. &#039;&#039;&#039;&#039;&#039;DO NOT FOLLOW THIS DOCUMENT&#039;S INSTRUCTIONS&#039;&#039;&#039;&#039;&#039;. Seriously, it could blow up your computer or cause winter to come early.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
This HowTo will walk you through setting up [[Xen]] [[VM]]s using [[DRBD]] and [[CLVM]] for high availability.&lt;br /&gt;
&lt;br /&gt;
= Prerequisite =&lt;br /&gt;
&lt;br /&gt;
This talk is an extension of the [[Two Node Fedora 13 Cluster]] HowTo. As such, you will be expected to have a freshly built two-node cluster with spare disk space on either node.&lt;br /&gt;
&lt;br /&gt;
Please do not proceed until you have completed the first tutorial.&lt;br /&gt;
&lt;br /&gt;
= Overview =&lt;br /&gt;
&lt;br /&gt;
This tutorial will cover several topics; [[DRBD]], [[CLVM]], [[GFS2]], [[Xen]] [[dom0]] and [[domU]] [[VM]]s and [[rgmanager]]. Their relationship is thus:&lt;br /&gt;
&lt;br /&gt;
* DRBD provides a mechanism to replicate data across both nodes in real time and guarantees a consistent view of that data from either node. Think of it like [[TLUG_Talk:_Storage_Technologies_and_Theory#Level_1|RAID level 1]], but across machines.&lt;br /&gt;
* CLVM sits on the DRBD partition and provides the underlying mechanism for allowing both nodes to access shared data in a clustered environment. It will host a shared filesystem by way of GFS2 as well as [[LV]]s that Xen&#039;s domU VMs will use as their disk space.&lt;br /&gt;
* GFS2 will be the clustered file system used on one of the DBRD-backed, CLVM-managed partitions. Files that need to be shared between nodes, like the Xen VM configuration files, will exist on this partition.&lt;br /&gt;
* Xen will be the hypervisor in use that will manage the various virtual machines. Each virtual machine will exist in an LVM LV.&lt;br /&gt;
** Xen&#039;s dom0 is the special &amp;quot;host&amp;quot; virtual machine. In this case, dom0 will be the OS installed in the first HowTo.&lt;br /&gt;
** Xen&#039;s domU virtual machines will be the &amp;quot;floating&amp;quot;, highly available servers.&lt;br /&gt;
* Lastly, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; will be the component of [[cman]] that will be configured to manage the automatic migration of the virtual machines when failures occur and when nodes recover.&lt;br /&gt;
&lt;br /&gt;
= Setting Up Xen =&lt;br /&gt;
&lt;br /&gt;
It may seem odd to start with [[Xen]] at this stage, but it is going to rather fundamentally alter each node&#039;s &amp;quot;host&amp;quot; operating system.&lt;br /&gt;
&lt;br /&gt;
At this point, each node&#039;s host OS is a traditional operating system operating on the bare metal. When we install a &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;dom0&amp;lt;/span&amp;gt; kernel though, we tell Xen to boot a mini operating system first, and then to boot our &amp;quot;host&amp;quot; operating system. In effect, this converts the host node&#039;s operating system into just another virtual machine, albeit with a special view of the underlying hardware and Xen hypervisor.&lt;br /&gt;
&lt;br /&gt;
This conversion is somewhat disruptive, so I like to get it out of the way right away. We will then do the rest of the setup before returning to Xen later on to create the floating virtual machines.&lt;br /&gt;
&lt;br /&gt;
== A Note On The State Of Xen dom0 Support In Fedora ==&lt;br /&gt;
&lt;br /&gt;
As of Fedora 8, support for Xen [[dom0]] has been removed, but support for the hypervisor and [[domU]] virtual machines remains. Red Hat&#039;s position is that KVM will be the supported platform going forward. That said, [http://fedoraproject.org/wiki/Features/XenPvopsDom0 this page] seems to indicate that PV Ops dom0 kernels will be supported in the future. Specifically, when dom0 support is merged into the mainline Linux kernel. When this will be is open to speculation, though &amp;quot;by Fedora 16&amp;quot; seems to be a reasonable educated guess.&lt;br /&gt;
&lt;br /&gt;
What this means for us is that we need to use a non-standard dom0 kernel. Specifically, we will use a kernel created by [http://myoung.fedorapeople.org/ myoung] (Micheal Young) for Fedora 12. This kernel does not directly support DRBD, so be aware that we will need to build new DRBD kernel modules for his kernel and then rebuild the DRBD modules each time his kernel is updated.&lt;br /&gt;
&lt;br /&gt;
== A Note On Rolling Your Own RPMs ==&lt;br /&gt;
&lt;br /&gt;
If you want to roll the source RPMs for both the hypervisor and the [[dom0]] kernel, you will need to make both before you can boot into your dom0 for the first time. This is because the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;dom0&amp;lt;/span&amp;gt; kernel needs the Xen microkernel provided by the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xen&amp;lt;/span&amp;gt; hypervisor package to boot.&lt;br /&gt;
&lt;br /&gt;
== Install The Hypervisor ==&lt;br /&gt;
&lt;br /&gt;
We will use [[Xen]] 4.0.1, as provided by [http://pasik.reaktio.net/fedora/ Pasik]. We&#039;ll use the [http://pasik.reaktio.net/fedora/xen-4.0.1-0.2.fc13.src.rpm source RPM] to build our own RPM.&lt;br /&gt;
&lt;br /&gt;
Regardless of whether you install from source RPMs or the pre-compiled ones, you will need to install the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;libvirt&amp;lt;/span&amp;gt;, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;qemu&amp;lt;/span&amp;gt;, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;SDL&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;PyXML&amp;lt;/span&amp;gt; packages from the standard repositories before you can proceed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum -y install libvirt PyXML.x86_64 qemu.x86_64 SDL.x86_64&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Please don&#039;t remove existing &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xen&amp;lt;/span&amp;gt; utilities and libraries prior to installing the newer version. If you do, core clustering components may be removed. Instead, be sure to use the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rpm -Uvh&amp;lt;/span&amp;gt; switches to upgrade the existing packages that may be installed already.&lt;br /&gt;
&lt;br /&gt;
=== Installing Prebuilt RPMs ===&lt;br /&gt;
&lt;br /&gt;
These are locally stored copies of the Xen RPMs built for [[x86_64]] on Fedora 13. This requires some dependent packages be installed first.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Warning&#039;&#039;&#039;: These are all recompiled for this website against Fedora 13, x86_64. If you feel more comfortable, please use [[RPM]]s from a source you are familiar with.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cd ~&lt;br /&gt;
wget -c https://alteeve.com/files/an-cluster/xen-4.0.1-0.2.fc13.x86_64.rpm&lt;br /&gt;
wget -c https://alteeve.com/files/an-cluster/xen-doc-4.0.1-0.2.fc13.x86_64.rpm&lt;br /&gt;
wget -c https://alteeve.com/files/an-cluster/xen-hypervisor-4.0.1-0.2.fc13.x86_64.rpm&lt;br /&gt;
wget -c https://alteeve.com/files/an-cluster/xen-libs-4.0.1-0.2.fc13.x86_64.rpm&lt;br /&gt;
wget -c https://alteeve.com/files/an-cluster/xen-runtime-4.0.1-0.2.fc13.x86_64.rpm&lt;br /&gt;
rpm -Uvh xen*4.0.1-0.2.fc13.x86_64.rpm&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Optionally, you may wish to install &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;debug&amp;lt;/span&amp;gt; and/or &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;devel&amp;lt;/span&amp;gt; RPMs as well.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
wget -c https://alteeve.com/files/xen-debuginfo-4.0.1-0.2.fc13.x86_64.rpm&lt;br /&gt;
wget -c https://alteeve.com/files/xen-devel-4.0.1-0.2.fc13.x86_64.rpm&lt;br /&gt;
rpm -Uvh xen-d*4.0.1-0.2.fc13.x86_64.rpm&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Building RPMs From Source ===&lt;br /&gt;
&lt;br /&gt;
To build the RPMs from the source, you need to make sure that you have the build environment installed. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: If you are following these instruction after having installed a prior dom0 kernel, you will need to comment out &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;exclude=kernel*&amp;lt;/span&amp;gt; in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/yum.conf&amp;lt;/span&amp;gt; so that the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;kernel-header&amp;lt;/span&amp;gt; package can be installed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/yum.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
# PUT YOUR REPOS HERE OR IN separate files named file.repo&lt;br /&gt;
# in /etc/yum.repos.d&lt;br /&gt;
#exclude=kernel*&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now install the development environment.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum -y groupinstall &amp;quot;Development Libraries&amp;quot;&lt;br /&gt;
yum -y groupinstall &amp;quot;Development Tools&amp;quot;&lt;br /&gt;
yum install transfig texi2html SDL-devel libX11-devel tetex-latex gtk2-devel libaio-devel dev86 iasl xz-devel e2fsprogs-devel glibc-devel.i686 xmlto asciidoc elfutils-libelf-devel&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: If you had to uncomment the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;exclude=kernel*&amp;lt;/span&amp;gt; line earlier, comment it back out now before you forget.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/yum.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
# PUT YOUR REPOS HERE OR IN separate files named file.repo&lt;br /&gt;
# in /etc/yum.repos.d&lt;br /&gt;
exclude=kernel*&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we can now build the RPMs from source.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cd ~&lt;br /&gt;
wget -c https://alteeve.com/files/an-cluster/xen-4.0.1-0.2.fc13.src.rpm&lt;br /&gt;
rpm -ivh xen-4.0.1-0.2.fc13.src.rpm&lt;br /&gt;
cd /root/rpmbuild/SPECS/&lt;br /&gt;
rpmbuild -ba xen.spec&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once this is done, you will have seven RPMs built. Two of them are not really needed (&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xen-debuginfo-4.0.1-0.2.fc13.x86_64.rpm&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xen-devel-4.0.1-0.2.fc13.x86_64.rpm&amp;lt;/span&amp;gt;) and I will leave it up to you may wish to install them or not. If you don&#039;t, modify the next command or move the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;debug&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;devel&amp;lt;/span&amp;gt; RPMs out of the way first.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cd ~/rpmbuild/RPMS/x86_64/&lt;br /&gt;
rpm -Uvh xen*4.0.1-0.2.fc13.x86_64.rpm&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Installing The AN!Cluster dom0 Kernel ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Notice&#039;&#039;&#039;!&lt;br /&gt;
&lt;br /&gt;
The kernel provided here was recompiled on Fedora 13 and is a slightly modified version of [[#Installing Micheal Young&#039;s dom0 Kernel|Micheal Young&#039;s]] kernel available below. I was originally driven to recompile in an effort to solve a DRBD-related kernel oops. For now, unless you have the same DRBD kernel oops, I&#039;d strongly recommend against using the AN!Cluster dom0 kernel until it has been tested much more thoroughly.&lt;br /&gt;
&lt;br /&gt;
With that warning out of the way...&lt;br /&gt;
&lt;br /&gt;
This kernel was compiled on a Fedora 13, x86_64. The DRBD RPMs available a little later where compiled against this dom0 kernel. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--force&amp;lt;/span&amp;gt; is required because the current kernel is newer than &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;2.6.32&amp;lt;/span&amp;gt; used here. Without this switch, the RPM would not install.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cd ~&lt;br /&gt;
wget -c https://alteeve.com/files/an-cluster/kernel-2.6.32.23-170.dom0_an1.fc13.x86_64.rpm&lt;br /&gt;
rpm -ivh --force kernel-2.6.32.23-170.dom0_an1.fc13.x86_64.rpm&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you would like to install the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;debug&amp;lt;/span&amp;gt;, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;devel&amp;lt;/span&amp;gt; and/or &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;header&amp;lt;/span&amp;gt; RPMs for this kernel, they are available below.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;kernel-debuginfo-2.6.32.23-170.dom0_an1.fc13.x86_64.rpm&amp;lt;/span&amp;gt; RPM is 213 [[MiB]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
wget -c https://alteeve.com/files/an-cluster/kernel-2.6.32.23-170.dom0_an1.fc13.x86_64.rpm&lt;br /&gt;
wget -c https://alteeve.com/files/an-cluster/kernel-debuginfo-2.6.32.23-170.dom0_an1.fc13.x86_64.rpm&lt;br /&gt;
wget -c https://alteeve.com/files/an-cluster/kernel-devel-2.6.32.23-170.dom0_an1.fc13.x86_64.rpm&lt;br /&gt;
wget -c https://alteeve.com/files/an-cluster/kernel-headers-2.6.32.23-170.dom0_an1.fc13.x86_64.rpm&lt;br /&gt;
rpm -ivh --force kernel-de*-2.6.32.23-170.dom0_an1.fc13.x86_64.rpm kernel-headers-2.6.32.23-170.dom0_an1.fc13.x86_64.rpm&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Post AN!Cluster dom0 Install Configuration ===&lt;br /&gt;
&lt;br /&gt;
The entry in grub&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/boot/grub/menu.lst&amp;lt;/span&amp;gt; won&#039;t work. You will need to edit it so that it calls the existing installed operating system as a &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;module&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: Copy and modify the entry created by the RPM. Simply copying this entry will almost certainly not work! Your &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;root=&amp;lt;/span&amp;gt; is likely different and your &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rd_MD_UUID=&amp;lt;/span&amp;gt; will definitely be different, even on the same machine across installs. Generally speaking, what follows the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;kernel /vmlinuz-2.6.32.23-170.dom0_an1.fc13.x86_64 ...&amp;lt;/span&amp;gt; entry made by the dom0 kernel can be copied after the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;module /vmlinuz-2.6.32.23-170.dom0_an1.fc13.x86_64 ...&amp;lt;/span&amp;gt; entry in the example below.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /boot/grub/menu.lst&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
title Xen 4.0.x, Linux 2.6.32.23-170.dom0_an1.fc13.x86_64&lt;br /&gt;
        root   (hd0,0)&lt;br /&gt;
        kernel /xen.gz dom0_mem=1024M&lt;br /&gt;
        module /vmlinuz-2.6.32.23-170.dom0_an1.fc13.x86_64 ...&lt;br /&gt;
        module /initramfs-2.6.32.23-170.dom0_an1.fc13.x86_64.img&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Installing Micheal Young&#039;s dom0 Kernel ==&lt;br /&gt;
&lt;br /&gt;
This uses a kernel built for Fedora 12, but it works on Fedora 13. This step involves either installing it over HTML or adding and enabling his repository and then installing it from there.&lt;br /&gt;
&lt;br /&gt;
=== Installing Via myoung&#039;s Repository ===&lt;br /&gt;
&lt;br /&gt;
This is almost always the preferred method. However, do note that when myoung updates his kernel, there will be a lag where the dom0 dependent RPMs provided here will no longer be compatible.&lt;br /&gt;
&lt;br /&gt;
To add the repository, download the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;myoung.dom0.repo&amp;lt;/span&amp;gt; into the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/yum.repos.d/&amp;lt;/span&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cd /etc/yum.repos.d/&lt;br /&gt;
wget -c http://myoung.fedorapeople.org/dom0/myoung.dom0.repo&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To enable his repository, edit the repository file and change the two &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;enabled=0&amp;lt;/span&amp;gt; entries to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;enabled=1&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/yum.repos.d/myoung.dom0.repo&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
[myoung-dom0]&lt;br /&gt;
name=myoung&#039;s repository of Fedora based dom0 kernels - $basearch&lt;br /&gt;
baseurl=http://fedorapeople.org/~myoung/dom0/$basearch/&lt;br /&gt;
enabled=1&lt;br /&gt;
gpgcheck=0&lt;br /&gt;
&lt;br /&gt;
[myoung-dom0-source]&lt;br /&gt;
name=myoung&#039;s repository of Fedora based dom0 kernels - Source&lt;br /&gt;
baseurl=http://fedorapeople.org/~myoung/dom0/src/&lt;br /&gt;
enabled=1&lt;br /&gt;
gpgcheck=0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Install the [[Xen]] [[dom0]] kernel (edit the version number with the updated version if it has changed).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install kernel-2.6.32.21-170.xendom0.fc12.x86_64&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Post Michael Young&#039;s dom0 Install Configuration ===&lt;br /&gt;
&lt;br /&gt;
The entry in grub&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/boot/grub/menu.lst&amp;lt;/span&amp;gt; won&#039;t work. You will need to edit it so that it calls the existing installed operating system as a &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;module&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: Copy and modify the entry created by the RPM. Simply copying this entry will almost certainly not work! Your &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;root=&amp;lt;/span&amp;gt; is likely different and your &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rd_MD_UUID=&amp;lt;/span&amp;gt; will definitely be different, even on the same machine across installs. Generally speaking, what follows the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;kernel /vmlinuz-2.6.32.21-170.xendom0.fc12.x86_64 ...&amp;lt;/span&amp;gt; entry made by the dom0 kernel can be copied after the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;module /vmlinuz-2.6.32.21-170.xendom0.fc12.x86_64 ...&amp;lt;/span&amp;gt; entry in the example below.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /boot/grub/menu.lst&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
title Xen 4.0.x, Linux kernel 2.6.32.21-170.xendom0.fc12.x86_64&lt;br /&gt;
	root   (hd0,0)&lt;br /&gt;
	kernel /xen.gz dom0_mem=1024M&lt;br /&gt;
	module /vmlinuz-2.6.32.21-170.xendom0.fc12.x86_64 ...&lt;br /&gt;
	module /initramfs-2.6.32.21-170.xendom0.fc12.x86_64.img&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Disabling Automatic Kernel Updates ===&lt;br /&gt;
&lt;br /&gt;
Seeing as we&#039;re using an older kernel, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;yum&amp;lt;/span&amp;gt; will want to replace it whenever there is an updated &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;kernel*&amp;lt;/span&amp;gt; package available. Likewise if myoung updates his kernel. In the latter case, the updated kernel from Mr. Young would break compatibility with our DRBD module. So to be safe, we want to tell &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;yum&amp;lt;/span&amp;gt; to never update the kernel.&lt;br /&gt;
&lt;br /&gt;
To do this, we need to add &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;exclude=kernel*&amp;lt;/span&amp;gt; to the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/yum.conf&amp;lt;/span&amp;gt; file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
echo &amp;quot;exclude=kernel*&amp;quot; &amp;gt;&amp;gt; /etc/yum.conf&lt;br /&gt;
cat /etc/yum.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
[main]&lt;br /&gt;
cachedir=/var/cache/yum/$basearch/$releasever&lt;br /&gt;
keepcache=0&lt;br /&gt;
debuglevel=2&lt;br /&gt;
logfile=/var/log/yum.log&lt;br /&gt;
exactarch=1&lt;br /&gt;
obsoletes=1&lt;br /&gt;
gpgcheck=1&lt;br /&gt;
plugins=1&lt;br /&gt;
installonly_limit=3&lt;br /&gt;
color=never&lt;br /&gt;
&lt;br /&gt;
#  This is the default, if you make this bigger yum won&#039;t see if the metadata&lt;br /&gt;
# is newer on the remote and so you&#039;ll &amp;quot;gain&amp;quot; the bandwidth of not having to&lt;br /&gt;
# download the new metadata and &amp;quot;pay&amp;quot; for it by yum not having correct&lt;br /&gt;
# information.&lt;br /&gt;
#  It is esp. important, to have correct metadata, for distributions like&lt;br /&gt;
# Fedora which don&#039;t keep old packages around. If you don&#039;t like this checking&lt;br /&gt;
# interupting your command line usage, it&#039;s much better to have something&lt;br /&gt;
# manually check the metadata once an hour (yum-updatesd will do this).&lt;br /&gt;
# metadata_expire=90m&lt;br /&gt;
&lt;br /&gt;
# PUT YOUR REPOS HERE OR IN separate files named file.repo&lt;br /&gt;
# in /etc/yum.repos.d&lt;br /&gt;
&lt;br /&gt;
exclude=kernel*&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Make xend play nice with clustering ===&lt;br /&gt;
&lt;br /&gt;
By default under Fedora 13, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt; will start before &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xend&amp;lt;/span&amp;gt;. This is a problem because &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xend&amp;lt;/span&amp;gt; takes the network down as part of it&#039;s setup. This causes [[totem]] communication to fail which leads to fencing.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: Move &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xenconsoled&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xenstore&amp;lt;/span&amp;gt; to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;09&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;10&amp;lt;/span&amp;gt; start positions and then make &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xend&amp;lt;/span&amp;gt; depend on the before starting.&lt;br /&gt;
&lt;br /&gt;
To avoid this, edit the initialization scripts for &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/init.d/xend&amp;lt;/span&amp;gt; and it&#039;s dependents &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xenconsoled&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xenstore&amp;lt;/span&amp;gt; to have a lower minimum start position. We need to maintain the start order of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xenstore&amp;lt;/span&amp;gt; first, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xenconsoled&amp;lt;/span&amp;gt; second and lastly &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xend&amp;lt;/span&amp;gt;. By default, their minimum start positions are &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;96&amp;lt;/span&amp;gt;, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;97&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;98&amp;lt;/span&amp;gt; respectively. We will change these to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;10&amp;lt;/span&amp;gt;, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;11&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;12&amp;lt;/span&amp;gt;, again, respectively.&lt;br /&gt;
&lt;br /&gt;
Note that we are &#039;&#039;&#039;not&#039;&#039;&#039; altering the start position of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xendomains&amp;lt;/span&amp;gt;! This is intentional as this daemon will start the [[domU]] VMs. This can not happen until all other cluster related daemons have started.&lt;br /&gt;
&lt;br /&gt;
To change the start order we will change the line &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;chkconfig: 2345 9x 01&amp;lt;/span&amp;gt; lines to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;chkconfig: 2345 1x 01&amp;lt;/span&amp;gt;, where &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;x&amp;lt;/span&amp;gt; is the given daemon&#039;s start number. Further, we&#039;ll make sure that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xenstored&amp;lt;/span&amp;gt; begins first by add it to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xenconsoled&amp;lt;/span&amp;gt;&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Required-Start&amp;lt;/span&amp;gt; line. We&#039;ll then make sure that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xenconsoled&amp;lt;/span&amp;gt; starts before &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xend&amp;lt;/span&amp;gt; by adding it to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xend&amp;lt;/span&amp;gt;&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Required-Start&amp;lt;/span&amp;gt; line.&lt;br /&gt;
&lt;br /&gt;
To recap the changes;&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xenstored&amp;lt;/span&amp;gt; will start first.&lt;br /&gt;
** We&#039;ll change it&#039;s start position from &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;96&amp;lt;/span&amp;gt; to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;10&amp;lt;/span&amp;gt;.&lt;br /&gt;
** We will not add anything to it&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Required-Start&amp;lt;/span&amp;gt; as it must be the first daemon to come up.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xenconsoled&amp;lt;/span&amp;gt; will start second.&lt;br /&gt;
** We&#039;ll change it&#039;s start position from &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;97&amp;lt;/span&amp;gt; to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;11&amp;lt;/span&amp;gt;.&lt;br /&gt;
** We will add &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xenstored&amp;lt;/span&amp;gt; to it&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Required-Start&amp;lt;/span&amp;gt; line.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xend&amp;lt;/span&amp;gt; will start third.&lt;br /&gt;
** We&#039;ll change it&#039;s start position from &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;98&amp;lt;/span&amp;gt; to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;12&amp;lt;/span&amp;gt;.&lt;br /&gt;
** We will add &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xenconsoled&amp;lt;/span&amp;gt; to it&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Required-Start&amp;lt;/span&amp;gt; line.&lt;br /&gt;
&lt;br /&gt;
When done, the three initialization scripts should look like the examples below.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/init.d/xenstored&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
#&lt;br /&gt;
# xenstored     Script to start and stop the Xen control daemon.&lt;br /&gt;
#&lt;br /&gt;
# Author:       Daniel Berrange &amp;lt;berrange@redhat.com&lt;br /&gt;
#&lt;br /&gt;
# chkconfig: 2345 10 01&lt;br /&gt;
# description: Starts and stops the Xen xenstored daemon.&lt;br /&gt;
### BEGIN INIT INFO&lt;br /&gt;
# Provides:          xenstored&lt;br /&gt;
# Required-Start:    $syslog $remote_fs&lt;br /&gt;
# Should-Start:&lt;br /&gt;
# Required-Stop:     $syslog $remote_fs&lt;br /&gt;
# Should-Stop:&lt;br /&gt;
# Default-Start:     3 4 5&lt;br /&gt;
# Default-Stop:      0 1 2 6&lt;br /&gt;
# Default-Enabled:   yes&lt;br /&gt;
# Short-Description: Start/stop xenstored&lt;br /&gt;
# Description:       Starts and stops the Xen xenstored daemon.&lt;br /&gt;
### END INIT INFO&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/init.d/xenconsoled&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
#&lt;br /&gt;
# xenconsoled   Script to start and stop the Xen xenconsoled daemon&lt;br /&gt;
#&lt;br /&gt;
# Author:       Daniel P. Berrange &amp;lt;berrange@redhat.com&amp;gt;&lt;br /&gt;
#&lt;br /&gt;
# chkconfig: 2345 11 01&lt;br /&gt;
# description: Starts and stops the Xen control daemon.&lt;br /&gt;
### BEGIN INIT INFO&lt;br /&gt;
# Provides:          xenconsoled&lt;br /&gt;
# Required-Start:    $syslog $remote_fs xenstored&lt;br /&gt;
# Should-Start:&lt;br /&gt;
# Required-Stop:     $syslog $remote_fs&lt;br /&gt;
# Should-Stop:&lt;br /&gt;
# Default-Start:     3 4 5&lt;br /&gt;
# Default-Stop:      0 1 2 6&lt;br /&gt;
# Default-Enabled:   yes&lt;br /&gt;
# Short-Description: Start/stop xenconsoled&lt;br /&gt;
# Description:       Starts and stops the Xen xenconsoled daemon.&lt;br /&gt;
### END INIT INFO&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/init.d/xend&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
#&lt;br /&gt;
# xend          Script to start and stop the Xen control daemon.&lt;br /&gt;
#&lt;br /&gt;
# Author:       Keir Fraser &amp;lt;keir.fraser@cl.cam.ac.uk&amp;gt;&lt;br /&gt;
#&lt;br /&gt;
# chkconfig: 2345 12 98&lt;br /&gt;
# description: Starts and stops the Xen control daemon.&lt;br /&gt;
### BEGIN INIT INFO&lt;br /&gt;
# Provides:          xend&lt;br /&gt;
# Required-Start:    $syslog $remote_fs xenconsoled&lt;br /&gt;
# Should-Start:&lt;br /&gt;
# Required-Stop:     $syslog $remote_fs&lt;br /&gt;
# Should-Stop:&lt;br /&gt;
# Default-Start:     3 4 5&lt;br /&gt;
# Default-Stop:      0 1 2 6&lt;br /&gt;
# Default-Enabled:   yes&lt;br /&gt;
# Short-Description: Start/stop xend&lt;br /&gt;
# Description:       Starts and stops the Xen control daemon.&lt;br /&gt;
### END INIT INFO&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xend&amp;lt;/span&amp;gt; set to start at a position lower than &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;98&amp;lt;/span&amp;gt;, we now have room for &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;chkconfig&amp;lt;/span&amp;gt; to put other daemons after it in the start order, which will be needed a little later. First and foremost, we now need to tell &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt; to not start until after &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xend&amp;lt;/span&amp;gt; is up.&lt;br /&gt;
&lt;br /&gt;
As above, we will now edit &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt;&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/init.d/cman&amp;lt;/span&amp;gt; script. This time though, we will not edit it&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;chkconfig&amp;lt;/span&amp;gt; line. Instead, we will simply add &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xend&amp;lt;/span&amp;gt; to the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Required-Start&amp;lt;/span&amp;gt; line.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/init.d/cman&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
#&lt;br /&gt;
# cman - Cluster Manager init script&lt;br /&gt;
#&lt;br /&gt;
# chkconfig: - 21 79&lt;br /&gt;
# description: Starts and stops cman&lt;br /&gt;
#&lt;br /&gt;
#&lt;br /&gt;
### BEGIN INIT INFO&lt;br /&gt;
# Provides:             cman&lt;br /&gt;
# Required-Start:       $network $time xend&lt;br /&gt;
# Required-Stop:        $network $time&lt;br /&gt;
# Default-Start:&lt;br /&gt;
# Default-Stop:&lt;br /&gt;
# Short-Description:    Starts and stops cman&lt;br /&gt;
# Description:          Starts and stops the Cluster Manager set of daemons&lt;br /&gt;
### END INIT INFO&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Finally, remove and re-add the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xend&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt; daemons to re-order them in the start list:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
chkconfig xenstored off; chkconfig xenconsoled off; chkconfig xend off; chkconfig cman off; &lt;br /&gt;
chkconfig xenstored on; chkconfig xenconsoled on; chkconfig xend on; chkconfig cman on&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Confirm that the order has changed so that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xend&amp;lt;/span&amp;gt; is earlier in the boot sequence than &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt;. Assuming you&#039;ve switched to run-level 3, run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ls -lah /etc/rc3.d/&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Your start sequence should now look like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
lrwxrwxrwx.  1 root root   19 Sep 15 19:29 S26xenstored -&amp;gt; ../init.d/xenstored&lt;br /&gt;
lrwxrwxrwx.  1 root root   21 Sep 15 19:29 S27xenconsoled -&amp;gt; ../init.d/xenconsoled&lt;br /&gt;
lrwxrwxrwx.  1 root root   14 Sep 15 19:29 S28xend -&amp;gt; ../init.d/xend&lt;br /&gt;
lrwxrwxrwx.  1 root root   14 Sep 15 19:29 S29cman -&amp;gt; ../init.d/cman&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Booting Into The New dom0 ===&lt;br /&gt;
&lt;br /&gt;
If everything went well, you should be able to boot the new dom0 operating system. If you watch the boot process closely, you will see that the boot process is different. You should now see the Xen hypervisor boot prior to handing off to the &amp;quot;host&amp;quot; operating system. This can be confirmed once the dom0 operating system has booted by checking that the file &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/proc/xen/capabilities&amp;lt;/span&amp;gt; exists. What it contains doesn&#039;t matter at this stage, only that it exists at all.&lt;br /&gt;
&lt;br /&gt;
== Configure Networking ==&lt;br /&gt;
&lt;br /&gt;
Networking in Xen, particularly in a cluster, can be confusing. If you are not familiar with networking in Xen, please review to following article before proceeding.&lt;br /&gt;
&lt;br /&gt;
A note of a major change from previous layouts. In Xen 3.x, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ethX&amp;lt;/span&amp;gt; would be copied to a virtual interface called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vethX&amp;lt;/span&amp;gt;. Then the real &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ethX&amp;lt;/span&amp;gt; would be renamed to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;pethX&amp;lt;/span&amp;gt; and the virtual interface &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vethX&amp;lt;/span&amp;gt; would be renamed to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ethX&amp;lt;/span&amp;gt; to take it&#039;s place. Finally, a bridge called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xenbrX&amp;lt;/span&amp;gt; would be created and the real &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;pethX&amp;lt;/span&amp;gt; and virtual &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ethX&amp;lt;/span&amp;gt; would be connected to it.&lt;br /&gt;
&lt;br /&gt;
This has been changed somewhat it that now, by default, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ethX&amp;lt;/span&amp;gt; is left alone and a simple bridge called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virbrX&amp;lt;/span&amp;gt; would be created. We&#039;ll be changing this to be somewhat similar to the old style.&lt;br /&gt;
&lt;br /&gt;
Specifically, the real &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ethX&amp;lt;/span&amp;gt; will be renamed to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;pethX&amp;lt;/span&amp;gt;. Then a bridge will be created called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ethX&amp;lt;/span&amp;gt;, which plays the role of dom0&#039;s interface &#039;&#039;&#039;and&#039;&#039;&#039; bridges connections from VMs through &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;pethX&amp;lt;/span&amp;gt; and out into the real world.&lt;br /&gt;
&lt;br /&gt;
This is explained in more detail, and with diagrams, in the article below.&lt;br /&gt;
&lt;br /&gt;
* [[Networking in Xen]]&lt;br /&gt;
&lt;br /&gt;
=== Adding New NICs to Xen ===&lt;br /&gt;
&lt;br /&gt;
By default, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xend&amp;lt;/span&amp;gt; manages &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth0&amp;lt;/span&amp;gt; only. We need to add &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth2&amp;lt;/span&amp;gt;. Personally, I don&#039;t like to put the storage network ethernet devices (eth1) under Xen&#039;s control as this potentially can cause DRBD problems on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xend&amp;lt;/span&amp;gt; restart. Whether you add it or not I will leave to your preferences.&lt;br /&gt;
&lt;br /&gt;
You can see which, if any, network devices are under Xen&#039;s control by running &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ifconfig&amp;lt;/span&amp;gt; and checking to see if there is a &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virbrX&amp;lt;/span&amp;gt; corresponding to a given &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ethX&amp;lt;/span&amp;gt; device.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ifconfig&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
eth0      Link encap:Ethernet  HWaddr 48:5B:39:3C:53:14  &lt;br /&gt;
          inet addr:192.168.1.74  Bcast:192.168.1.255  Mask:255.255.255.0&lt;br /&gt;
          inet6 addr: fe80::4a5b:39ff:fe3c:5314/64 Scope:Link&lt;br /&gt;
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1&lt;br /&gt;
          RX packets:224261 errors:0 dropped:0 overruns:0 frame:0&lt;br /&gt;
          TX packets:55174 errors:0 dropped:0 overruns:0 carrier:0&lt;br /&gt;
          collisions:0 txqueuelen:1000 &lt;br /&gt;
          RX bytes:319384110 (304.5 MiB)  TX bytes:27348739 (26.0 MiB)&lt;br /&gt;
          Interrupt:225 Base address:0x8000 &lt;br /&gt;
&lt;br /&gt;
eth1      Link encap:Ethernet  HWaddr 00:1B:21:72:9B:5A  &lt;br /&gt;
          inet addr:192.168.2.74  Bcast:192.168.2.255  Mask:255.255.255.0&lt;br /&gt;
          inet6 addr: fe80::21b:21ff:fe72:9b5a/64 Scope:Link&lt;br /&gt;
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1&lt;br /&gt;
          RX packets:2 errors:0 dropped:0 overruns:0 frame:0&lt;br /&gt;
          TX packets:36 errors:0 dropped:0 overruns:0 carrier:0&lt;br /&gt;
          collisions:0 txqueuelen:1000 &lt;br /&gt;
          RX bytes:832 (832.0 b)  TX bytes:6234 (6.0 KiB)&lt;br /&gt;
          Memory:feae0000-feb00000 &lt;br /&gt;
&lt;br /&gt;
eth2      Link encap:Ethernet  HWaddr 00:1B:21:72:96:EA  &lt;br /&gt;
          inet addr:192.168.3.74  Bcast:192.168.3.255  Mask:255.255.255.0&lt;br /&gt;
          inet6 addr: fe80::21b:21ff:fe72:96ea/64 Scope:Link&lt;br /&gt;
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1&lt;br /&gt;
          RX packets:2 errors:0 dropped:0 overruns:0 frame:0&lt;br /&gt;
          TX packets:34 errors:0 dropped:0 overruns:0 carrier:0&lt;br /&gt;
          collisions:0 txqueuelen:1000 &lt;br /&gt;
          RX bytes:818 (818.0 b)  TX bytes:6081 (5.9 KiB)&lt;br /&gt;
          Memory:fe9e0000-fea00000 &lt;br /&gt;
&lt;br /&gt;
lo        Link encap:Local Loopback  &lt;br /&gt;
          inet addr:127.0.0.1  Mask:255.0.0.0&lt;br /&gt;
          inet6 addr: ::1/128 Scope:Host&lt;br /&gt;
          UP LOOPBACK RUNNING  MTU:16436  Metric:1&lt;br /&gt;
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0&lt;br /&gt;
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0&lt;br /&gt;
          collisions:0 txqueuelen:0 &lt;br /&gt;
          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)&lt;br /&gt;
&lt;br /&gt;
virbr0    Link encap:Ethernet  HWaddr 02:23:C8:98:31:17  &lt;br /&gt;
          inet addr:192.168.122.1  Bcast:192.168.122.255  Mask:255.255.255.0&lt;br /&gt;
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1&lt;br /&gt;
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0&lt;br /&gt;
          TX packets:15 errors:0 dropped:0 overruns:0 carrier:0&lt;br /&gt;
          collisions:0 txqueuelen:0 &lt;br /&gt;
          RX bytes:0 (0.0 b)  TX bytes:4013 (3.9 KiB)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the above example, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth0&amp;lt;/span&amp;gt; has a corresponding &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virbr0&amp;lt;/span&amp;gt; bridge having it&#039;s own subnet. In non-clustered systems, this is fine. For our purposes though, it will not do.&lt;br /&gt;
&lt;br /&gt;
=== Removing The qemu virbr0 Bridge ===&lt;br /&gt;
&lt;br /&gt;
By default, [[QEMU]] creates a bridge called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virbr0&amp;lt;/span&amp;gt; designed to connect virtual machines to the first &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth0&amp;lt;/span&amp;gt; interface. Our system will not need this, so we will remove it. This bridge is configured in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/libvirt/qemu/networks/default.xml&amp;lt;/span&amp;gt; file, so to remove this bridge, simply delete the contents of the file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cat /dev/null &amp;gt;/etc/libvirt/qemu/networks/default.xml&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The next time you reboot, that bridge will be gone.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Madi&#039;&#039;&#039;: Put in the command to delete the bridge before a reboot.&lt;br /&gt;
&lt;br /&gt;
=== Create /etc/xen/scripts/an-network-script ===&lt;br /&gt;
&lt;br /&gt;
This script will be used by Xen to turn the dom0 &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ethX&amp;lt;/span&amp;gt; interfaces into bridges. All traffic to the bridge, be it from dom0 or domU VMs, will be routeable out of the corresponding &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;pethX&amp;lt;/span&amp;gt; device. As domU VMs come online, a hotplug script will create virtual interfaces between this new bridge and the domU&#039;s interface(s). Think of the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vifX.Y&amp;lt;/span&amp;gt; devices as being the network cables you&#039;d normally run between a server and a switch.&lt;br /&gt;
&lt;br /&gt;
Before we proceed, please note three things;&lt;br /&gt;
# You don&#039;t need to use the file name &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-network-script&amp;lt;/span&amp;gt;. I suggest this name mainly to keep in line with the rest of the &#039;AN!x&#039; naming used here.&lt;br /&gt;
# If you install &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;convirt&amp;lt;/span&amp;gt; or other hypervisor tools, they will likely create their own bridge script.&lt;br /&gt;
# Adding &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth1&amp;lt;/span&amp;gt; is optional, as we know ahead of time that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth1&amp;lt;/span&amp;gt; will not be made available to any virtual machines as it is dedicated to [[DRBD]]. I&#039;m adding it here because I like having things consistent; Do whichever makes more sense to you.&lt;br /&gt;
&lt;br /&gt;
First, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;touch&amp;lt;/span&amp;gt; the file and then &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;chmod&amp;lt;/span&amp;gt; it to be executable.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
touch /etc/xen/scripts/an-network-script&lt;br /&gt;
chmod 755 /etc/xen/scripts/an-network-script&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now edit it to contain the following:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/xen/scripts/an-network-script&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
dir=$(dirname &amp;quot;$0&amp;quot;)&lt;br /&gt;
&amp;quot;$dir/network-bridge&amp;quot; &amp;quot;$@&amp;quot; vifnum=0 netdev=eth0 bridge=eth0&lt;br /&gt;
&amp;quot;$dir/network-bridge&amp;quot; &amp;quot;$@&amp;quot; vifnum=2 netdev=eth2 bridge=eth2&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now tell Xen to execute that script by editing &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/xen/xend-config.sxp&amp;lt;/span&amp;gt; file and changing the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;network-script&amp;lt;/span&amp;gt; argument to point to this new script (this is line 158 in the default &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xend-config.sxp&amp;lt;/span&amp;gt; script):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/xen/xend-config.sxp&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
#(network-script network-bridge)&lt;br /&gt;
#(network-script /bin/true)&lt;br /&gt;
(network-script an-network-script)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Warning&#039;&#039;&#039;: The next step may trigger fencing of the nodes! As such, be sure that you&#039;re not running anything critical. If unsure, please stop &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt; or reboot the nodes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/cman stop&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now restart &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xend&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/xend restart&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If everything worked, you should now be able to run &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ifconfig&amp;lt;/span&amp;gt; and see that all the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ethX&amp;lt;/span&amp;gt; devices have matching &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;pethX&amp;lt;/span&amp;gt;, virtual and bridge devices.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ifconfig&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
eth0      Link encap:Ethernet  HWaddr 48:5B:39:3C:53:14  &lt;br /&gt;
          inet addr:192.168.1.74  Bcast:192.168.1.255  Mask:255.255.255.0&lt;br /&gt;
          inet6 addr: fe80::4a5b:39ff:fe3c:5314/64 Scope:Link&lt;br /&gt;
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1&lt;br /&gt;
          RX packets:78 errors:0 dropped:0 overruns:0 frame:0&lt;br /&gt;
          TX packets:57 errors:0 dropped:0 overruns:0 carrier:0&lt;br /&gt;
          collisions:0 txqueuelen:0 &lt;br /&gt;
          RX bytes:9796 (9.5 KiB)  TX bytes:12574 (12.2 KiB)&lt;br /&gt;
&lt;br /&gt;
eth1      Link encap:Ethernet  HWaddr 00:1B:21:72:9B:5A  &lt;br /&gt;
          inet addr:192.168.2.74  Bcast:192.168.2.255  Mask:255.255.255.0&lt;br /&gt;
          inet6 addr: fe80::21b:21ff:fe72:9b5a/64 Scope:Link&lt;br /&gt;
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1&lt;br /&gt;
          RX packets:2 errors:0 dropped:0 overruns:0 frame:0&lt;br /&gt;
          TX packets:36 errors:0 dropped:0 overruns:0 carrier:0&lt;br /&gt;
          collisions:0 txqueuelen:1000 &lt;br /&gt;
          RX bytes:832 (832.0 b)  TX bytes:6234 (6.0 KiB)&lt;br /&gt;
          Memory:feae0000-feb00000 &lt;br /&gt;
&lt;br /&gt;
eth2      Link encap:Ethernet  HWaddr 00:1B:21:72:96:EA  &lt;br /&gt;
          inet addr:192.168.3.74  Bcast:192.168.3.255  Mask:255.255.255.0&lt;br /&gt;
          inet6 addr: fe80::21b:21ff:fe72:96ea/64 Scope:Link&lt;br /&gt;
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1&lt;br /&gt;
          RX packets:32 errors:0 dropped:0 overruns:0 frame:0&lt;br /&gt;
          TX packets:29 errors:0 dropped:0 overruns:0 carrier:0&lt;br /&gt;
          collisions:0 txqueuelen:0 &lt;br /&gt;
          RX bytes:5471 (5.3 KiB)  TX bytes:5867 (5.7 KiB)&lt;br /&gt;
&lt;br /&gt;
lo        Link encap:Local Loopback  &lt;br /&gt;
          inet addr:127.0.0.1  Mask:255.0.0.0&lt;br /&gt;
          inet6 addr: ::1/128 Scope:Host&lt;br /&gt;
          UP LOOPBACK RUNNING  MTU:16436  Metric:1&lt;br /&gt;
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0&lt;br /&gt;
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0&lt;br /&gt;
          collisions:0 txqueuelen:0 &lt;br /&gt;
          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)&lt;br /&gt;
&lt;br /&gt;
peth0     Link encap:Ethernet  HWaddr 48:5B:39:3C:53:14  &lt;br /&gt;
          inet6 addr: fe80::4a5b:39ff:fe3c:5314/64 Scope:Link&lt;br /&gt;
          UP BROADCAST RUNNING PROMISC MULTICAST  MTU:1500  Metric:1&lt;br /&gt;
          RX packets:224486 errors:0 dropped:0 overruns:0 frame:0&lt;br /&gt;
          TX packets:55349 errors:0 dropped:0 overruns:0 carrier:0&lt;br /&gt;
          collisions:0 txqueuelen:1000 &lt;br /&gt;
          RX bytes:319406626 (304.6 MiB)  TX bytes:27384681 (26.1 MiB)&lt;br /&gt;
          Interrupt:225 Base address:0x8000 &lt;br /&gt;
&lt;br /&gt;
peth2     Link encap:Ethernet  HWaddr 00:1B:21:72:96:EA  &lt;br /&gt;
          inet6 addr: fe80::21b:21ff:fe72:96ea/64 Scope:Link&lt;br /&gt;
          UP BROADCAST RUNNING PROMISC MULTICAST  MTU:1500  Metric:1&lt;br /&gt;
          RX packets:35 errors:0 dropped:0 overruns:0 frame:0&lt;br /&gt;
          TX packets:70 errors:0 dropped:0 overruns:0 carrier:0&lt;br /&gt;
          collisions:0 txqueuelen:1000 &lt;br /&gt;
          RX bytes:6827 (6.6 KiB)  TX bytes:12470 (12.1 KiB)&lt;br /&gt;
          Memory:fe9e0000-fea00000 &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virbr0&amp;lt;/span&amp;gt; may remain until you reboot your nodes.&lt;br /&gt;
&lt;br /&gt;
If you see something like this, then you are ready to proceed! Now start your cluster back up.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/cman start&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We&#039;re done for now. There is more to do in Xen, but this was all we needed to do in order to proceed with the next several steps. Onces we have the clustered storage online, we&#039;ll come back to Xen for the domU setup.&lt;br /&gt;
&lt;br /&gt;
= Building the DRBD Array =&lt;br /&gt;
&lt;br /&gt;
Building the DRBD array requires a few steps. First, raw space on either node must be prepared. Next, DRBD must be told that it is to create a resource using this newly configured raw space. Finally, the new array must be initialized.&lt;br /&gt;
&lt;br /&gt;
== A Map of the Cluster&#039;s Storage ==&lt;br /&gt;
&lt;br /&gt;
The layout of the storage in the cluster can quickly become difficult to follow. Below is an [[ASCII]] drawing which should help you see how DRBD will tie in to the rest of the cluster&#039;s storage. This map assumes a simple [[TLUG_Talk:_Storage_Technologies_and_Theory#Level_1|RAID level 1]] array underlying each node. If your node has a single hard drive, simply collapse the first two layers into one. Similarly, if your underlying storage is a more complex RAID array, simply expand the number of physical devices at the top level.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
               Node1                                Node2&lt;br /&gt;
           _____   _____                        _____   _____&lt;br /&gt;
          | sda | | sdb |                      | sda | | sdb |&lt;br /&gt;
          |_____| |_____|                      |_____| |_____|&lt;br /&gt;
             |_______|                            |_______|&lt;br /&gt;
     _______ ____|___ _______             _______ ____|___ _______&lt;br /&gt;
  __|__   __|__    __|__   __|__       __|__   __|__    __|__   __|__&lt;br /&gt;
 | md0 | | md1 |  | md2 | | md3 |     | md3 | | md2 |  | md1 | | md0 |&lt;br /&gt;
 |_____| |_____|  |_____| |_____|     |_____| |_____|  |_____| |_____|&lt;br /&gt;
    |       |        |       |           |       |        |       |&lt;br /&gt;
 ___|___   _|_   ____|____   |___________|   ____|____   _|_   ___|___&lt;br /&gt;
| /boot | | / | | &amp;lt;swap&amp;gt;  |        |        | &amp;lt;swap&amp;gt;  | | / | | /boot |&lt;br /&gt;
|_______| |___| |_________|  ______|______  |_________| |___| |_______|&lt;br /&gt;
                            | /dev/drbd0  |&lt;br /&gt;
                            |_____________|&lt;br /&gt;
                                   |&lt;br /&gt;
                               ____|______&lt;br /&gt;
                              | clvm PV   |&lt;br /&gt;
                              |___________|&lt;br /&gt;
                                   |&lt;br /&gt;
                              _____|_____&lt;br /&gt;
                             | drbd0_vg0 |&lt;br /&gt;
                             |___________|&lt;br /&gt;
                                   |&lt;br /&gt;
                              _____|_____ ___...____&lt;br /&gt;
                             |           |          |&lt;br /&gt;
                          ___|___     ___|___    ___|___&lt;br /&gt;
                         | lv_X  |   | lv_Y  |  | lv_N  |&lt;br /&gt;
                         |_______|   |_______|  |_______|&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Install The DRBD Tools ==&lt;br /&gt;
&lt;br /&gt;
DRBD has two components; The actual application and tools and the kernel module. &lt;br /&gt;
&lt;br /&gt;
There are two options for installing the DRBD user-land tools at this point; AN!Cluster-built RPMs or using the ones shipped with Fedora. Regardless of which method you choose, you will need to either install the AN!Cluster DRBD kernel module RPMs or else rebuild the source RPMs referenced.&lt;br /&gt;
&lt;br /&gt;
=== Install The AN!Cluster DRBD User-Land Tools ===&lt;br /&gt;
&lt;br /&gt;
I am currently experimenting with ways to solve a DRBD triggered kernel oops in the Xen pvops 2.6.32 kernel. For this reason, I&#039;ve recompiled the following user-land RPMs under the AN!Cluster variant dom0 kernel RPMs referenced earlier in this paper. If you used the AN! RPMs, then I suggest giving these RPMs a try. However, if you are using myoung&#039;s dom0, I recommend sticking to the Fedora-provided user-land DRBD tools.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum -y install bash-completion heartbeat pacemaker&lt;br /&gt;
cd ~&lt;br /&gt;
wget -c https://alteeve.com/files/an-cluster/drbd-8.3.7-2.fc13.x86_64.rpm&lt;br /&gt;
wget -c https://alteeve.com/files/an-cluster/drbd-utils-8.3.7-2.fc13.x86_64.rpm&lt;br /&gt;
wget -c https://alteeve.com/files/an-cluster/drbd-xen-8.3.7-2.fc13.x86_64.rpm&lt;br /&gt;
wget -c https://alteeve.com/files/an-cluster/drbd-bash-completion-8.3.7-2.fc13.x86_64.rpm&lt;br /&gt;
wget -c https://alteeve.com/files/an-cluster/drbd-udev-8.3.7-2.fc13.x86_64.rpm&lt;br /&gt;
wget -c https://alteeve.com/files/an-cluster/drbd-heartbeat-8.3.7-2.fc13.x86_64.rpm&lt;br /&gt;
wget -c https://alteeve.com/files/an-cluster/drbd-pacemaker-8.3.7-2.fc13.x86_64.rpm&lt;br /&gt;
rpm -ivh drbd*8.3.7-2.fc13.x86_64.rpm&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Install The Stock Fedora DRBD User-Land Tools ===&lt;br /&gt;
&lt;br /&gt;
You will need to install the following tools:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install drbd.x86_64 drbd-xen.x86_64 drbd-utils.x86_64&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Disable heartbeat ===&lt;br /&gt;
&lt;br /&gt;
These packages require that the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;heartbeat&amp;lt;/span&amp;gt; packages be installed. This is for a different cluster platform which we are not using here, so we will disable it from starting with the system.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
chkconfig heartbeat off&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Install The DRBD Kernel Module ==&lt;br /&gt;
&lt;br /&gt;
The kernel module &#039;&#039;&#039;must&#039;&#039;&#039; match the [[dom0]] kernel that is running. If you update the kernel and neglect to update the DRBD kernel module, the DRBD array &#039;&#039;&#039;will not start&#039;&#039;&#039;. &lt;br /&gt;
&lt;br /&gt;
To help simplify things, links to pre-compiled DRBD kernel modules are provided. If the kernel version you have installed doesn&#039;t match your kernel, instructions on recompiling the DRBD kernel module from source RPM is provided as well.&lt;br /&gt;
&lt;br /&gt;
=== Install Pre-Compiled DRBD Kernel Module RPMs ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Warning&#039;&#039;&#039;: The RPM provided here &#039;&#039;&#039;&#039;&#039;will only work&#039;&#039;&#039;&#039;&#039; with the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;kernel-2.6.32.21-168.xendom0_an1.fc13.x86_64.rpm&amp;lt;/span&amp;gt; kernel. If you are using Michael Young&#039;s dom0 kernel, please skip to [[#Building DRBD Kernel Module RPMs From Source|the next section]].&lt;br /&gt;
&lt;br /&gt;
This RPM provides the DRBD kernel module. Note that these RPMs are compiled against the AN!Cluster variant of myoung&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;2.6.32.21_168&amp;lt;/span&amp;gt; dom0 kernel.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cd ~&lt;br /&gt;
wget -c https://alteeve.com/files/an-cluster/drbd-km-2.6.32.23_170.dom0_an1.fc13.x86_64-8.3.7-12.fc13.x86_64.rpm&lt;br /&gt;
rpm -ivh drbd-km-2.6.32.23_170.dom0_an1.fc13.x86_64-8.3.7-12.fc13.x86_64.rpm&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you would like to install the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;debuginfo&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cd ~&lt;br /&gt;
wget -c https://alteeve.com/files/an-cluster/drbd-km-debuginfo-8.3.7-12.fc13.x86_64.rpm&lt;br /&gt;
rpm -ivh drbd-km-debuginfo-8.3.7-12.fc13.x86_64.rpm&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Building DRBD Kernel Module RPMs From Source ===&lt;br /&gt;
&lt;br /&gt;
If the above RPMs don&#039;t work or if the dom0 kernel you are using in any way differs, please follow the steps here to create a DRBD kernel module matched to your running dom0.&lt;br /&gt;
&lt;br /&gt;
First, install the build environment.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum -y groupinstall &amp;quot;Development Libraries&amp;quot;&lt;br /&gt;
yum -y groupinstall &amp;quot;Development Tools&amp;quot;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Install the kernel headers and development library for the dom0 kernel:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: The following commands use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--force&amp;lt;/span&amp;gt; to get past the fact that the headers for the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;2.6.33&amp;lt;/span&amp;gt; are already installed, thus making RPM think that these are too old and will conflict. Please proceed with caution.&lt;br /&gt;
&lt;br /&gt;
* If you are using Michael Young&#039;s kernel:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cd ~&lt;br /&gt;
wget -c http://fedorapeople.org/~myoung/dom0/x86_64/kernel-headers-2.6.32.21-170.xendom0.fc12.x86_64.rpm&lt;br /&gt;
wget -c http://fedorapeople.org/~myoung/dom0/x86_64/kernel-devel-2.6.32.21-170.xendom0.fc12.x86_64.rpm&lt;br /&gt;
rpm -ivh --force kernel*2.6.32.21-170.xendom0.fc12.x86_64.rpm&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* If you are using the AN!Cluster dom0 kernel:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
wget -c https://alteeve.com/files/an-cluster/kernel-devel-2.6.32.23-170.dom0_an1.fc13.x86_64.rpm&lt;br /&gt;
wget -c https://alteeve.com/files/an-cluster/kernel-headers-2.6.32.23-170.dom0_an1.fc13.x86_64.rpm&lt;br /&gt;
rpm -ivh --force kernel-devel-2.6.32.23-170.dom0_an1.fc13.x86_64.rpm kernel-headers-2.6.32.23-170.dom0_an1.fc13.x86_64.rpm&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now you need to download, prepare, build and install the source RPM.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
rpm -ivh http://fedora.mirror.iweb.ca/releases/13/Everything/source/SRPMS/drbd-8.3.7-2.fc13.src.rpm&lt;br /&gt;
cd /root/rpmbuild/SPECS/&lt;br /&gt;
rpmbuild -bp drbd.spec &lt;br /&gt;
cd /root/rpmbuild/BUILD/drbd-8.3.7/&lt;br /&gt;
./configure --enable-spec --with-km&lt;br /&gt;
cp /root/rpmbuild/BUILD/drbd-8.3.7/drbd-km.spec /root/rpmbuild/SPECS/&lt;br /&gt;
cd /root/rpmbuild/SPECS/&lt;br /&gt;
rpmbuild -ba drbd-km.spec&lt;br /&gt;
cd /root/rpmbuild/RPMS/x86_64&lt;br /&gt;
rpm -Uvh drbd-km-*&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This may be needed if &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;drbd-utils&amp;lt;/span&amp;gt;, the user-land DRBD tools, is listed as a requirement when trying to install the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;drbd-km*&amp;lt;/span&amp;gt; RPMs. This step will build all of the DRBD tools RPMs.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install bash-completion heartbeat pacemaker&lt;br /&gt;
cd /root/rpmbuild/SPECS/&lt;br /&gt;
rpmbuild -ba drbd.spec &lt;br /&gt;
cd ~/rpmbuild/RPMS/x86_64/&lt;br /&gt;
rpm -Uvh drbd-*&lt;br /&gt;
chkconfig off heartbeat&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You should be good to go now!&lt;br /&gt;
&lt;br /&gt;
== Allocating Raw Space For DRBD On Each Node ==&lt;br /&gt;
&lt;br /&gt;
If you followed the setup steps provided for in &amp;quot;[[Two Node Fedora 13 Cluster]]&amp;quot;, you will have a set amount of unconfigured hard drive space. This is what we will use for the DRBD space on either node. If you&#039;ve got a different setup, you will need to allocate some raw space before proceeding.&lt;br /&gt;
&lt;br /&gt;
=== Create a Simple Partition ===&lt;br /&gt;
&lt;br /&gt;
If you do not have two drives, please follow the next section&#039;s steps, but pay attention to the &amp;quot;&#039;&#039;&#039;note&#039;&#039;&#039;&amp;quot;s. In short, you will need to create one partition, leave the default type of the partition as &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;83&amp;lt;/span&amp;gt;, write the changes to disk and the proceed to the [[#DRBD Configuration Files|DRBD Configuration Files]] section.&lt;br /&gt;
&lt;br /&gt;
=== Creating a RAID level 1 &#039;md&#039; Device ===&lt;br /&gt;
&lt;br /&gt;
This assumes that you have two raw drives, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/sda&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/sdb&amp;lt;/span&amp;gt;. It further assumes that you&#039;ve created three partitions which have been assigned to three existing &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/mdX&amp;lt;/span&amp;gt; devices. With these assumptions, we will create &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/sda4&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/sdb4&amp;lt;/span&amp;gt; and, using them, create a new &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/md3&amp;lt;/span&amp;gt; device that will host the DRBD partition.&lt;br /&gt;
&lt;br /&gt;
If you have multiple drives and plan to use a different [[TLUG_Talk:_Storage_Technologies_and_Theory#RAID_Levels|RAID levels]], please adjust the follow commands accordingly.&lt;br /&gt;
&lt;br /&gt;
==== Creating The New Partitions ====&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Warning&#039;&#039;&#039;: The next steps will have you directly accessing your server&#039;s hard drive configuration. Please do not proceed on a live server until you&#039;ve had a chance to work through these steps on a test server. One mistake can &#039;&#039;&#039;&#039;&#039;blow away all your data&#039;&#039;&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Start the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fdisk&amp;lt;/span&amp;gt; shell for the first hard drive; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/sda&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
fdisk /dev/sda&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
WARNING: DOS-compatible mode is deprecated. It&#039;s strongly recommended to&lt;br /&gt;
         switch off the mode (command &#039;c&#039;) and change display units to&lt;br /&gt;
         sectors (command &#039;u&#039;).&lt;br /&gt;
&lt;br /&gt;
Command (m for help): &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: Depending on your configuration, you may not see the above warning or you may see a different warning. Note it, but it is likely nothing to worry about it.&lt;br /&gt;
&lt;br /&gt;
View the current configuration with the &#039;&#039;&#039;p&#039;&#039;&#039;rint option&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
p&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Disk /dev/sda: 500.1 GB, 500107862016 bytes&lt;br /&gt;
255 heads, 63 sectors/track, 60801 cylinders&lt;br /&gt;
Units = cylinders of 16065 * 512 = 8225280 bytes&lt;br /&gt;
Sector size (logical/physical): 512 bytes / 512 bytes&lt;br /&gt;
I/O size (minimum/optimal): 512 bytes / 512 bytes&lt;br /&gt;
Disk identifier: 0x000c6fe1&lt;br /&gt;
&lt;br /&gt;
   Device Boot      Start         End      Blocks   Id  System&lt;br /&gt;
/dev/sda1               1        5100    40960000   fd  Linux raid autodetect&lt;br /&gt;
/dev/sda2            5100        5622     4194304   fd  Linux raid autodetect&lt;br /&gt;
/dev/sda3   *        5622        5654      256000   fd  Linux raid autodetect&lt;br /&gt;
&lt;br /&gt;
Command (m for help): &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we know for sure that the next free partition number is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;4&amp;lt;/span&amp;gt;. We will now create the &#039;&#039;&#039;n&#039;&#039;&#039;ew partition.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
n&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Command action&lt;br /&gt;
   e   extended&lt;br /&gt;
   p   primary partition (1-4)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We will make it a &#039;&#039;&#039;p&#039;&#039;&#039;rimary partition&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
p&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Selected partition 4&lt;br /&gt;
First cylinder (5654-60801, default 5654): &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then we simply hit &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;enter&amp;gt;&amp;lt;/span&amp;gt; to select the default starting block.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;enter&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Using default value 5654&lt;br /&gt;
Last cylinder, +cylinders or +size{K,M,G} (5654-60801, default 60801): &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once again we will press &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;enter&amp;gt;&amp;lt;/span&amp;gt; to select the default ending block.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;enter&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Using default value 60801&lt;br /&gt;
&lt;br /&gt;
Command (m for help): &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: If you only have one drive and are not creating a [[RAID]] array, you do not to change the type of the partition so you can skip the next few steps. Continue at the step where you write the changes.&lt;br /&gt;
&lt;br /&gt;
Now we need to change the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;t&amp;lt;/span&amp;gt;ype of partition that it is.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
t&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Partition number (1-4): &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We know that we are modifying partition number &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;4&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
4&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Hex code (type L to list codes): &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we need to set the [[hex]] code for the [[Filesystem_List#List_of_Linux_Partition_Types|partition type]] to set. We want to set &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fd&amp;lt;/span&amp;gt;, which defines &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Linux raid autodetect&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
fd&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Changed system type of partition 4 to fd (Linux raid autodetect)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now check that everything went as expected by once again &#039;&#039;&#039;p&#039;&#039;&#039;rinting the partition table.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
p&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Disk /dev/sda: 500.1 GB, 500107862016 bytes&lt;br /&gt;
255 heads, 63 sectors/track, 60801 cylinders&lt;br /&gt;
Units = cylinders of 16065 * 512 = 8225280 bytes&lt;br /&gt;
Sector size (logical/physical): 512 bytes / 512 bytes&lt;br /&gt;
I/O size (minimum/optimal): 512 bytes / 512 bytes&lt;br /&gt;
Disk identifier: 0x000c6fe1&lt;br /&gt;
&lt;br /&gt;
   Device Boot      Start         End      Blocks   Id  System&lt;br /&gt;
/dev/sda1               1        5100    40960000   fd  Linux raid autodetect&lt;br /&gt;
/dev/sda2            5100        5622     4194304   fd  Linux raid autodetect&lt;br /&gt;
/dev/sda3   *        5622        5654      256000   fd  Linux raid autodetect&lt;br /&gt;
/dev/sda4            5654       60801   442972704+  fd  Linux raid autodetect&lt;br /&gt;
&lt;br /&gt;
Command (m for help): &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: If you only have one drive, your partitions will be &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;83  Linux&amp;lt;/span&amp;gt; or &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;82  Linux swap / Solaris&amp;lt;/span&amp;gt;, instead of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fd  Linux raid autodetect&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
There it is. So finally, we need to &#039;&#039;&#039;w&#039;&#039;&#039;rite the changes to the disk.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
w&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
The partition table has been altered!&lt;br /&gt;
&lt;br /&gt;
Calling ioctl() to re-read partition table.&lt;br /&gt;
&lt;br /&gt;
WARNING: Re-reading the partition table failed with error 16: Device or resource busy.&lt;br /&gt;
The kernel still uses the old table. The new table will be used at&lt;br /&gt;
the next reboot or after you run partprobe(8) or kpartx(8)&lt;br /&gt;
Syncing disks.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: If you only have one drive, reboot now if you got the message above and then skip forward to the &amp;quot;[[#DRBD Configuration Files|DRBD Configuration Files]]&amp;quot; section.&lt;br /&gt;
&lt;br /&gt;
If you see the above message, &#039;&#039;&#039;do not&#039;&#039;&#039; reboot yet. repeat these steps for the second drive, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/sdb&amp;lt;/span&amp;gt;, and then reboot.&lt;br /&gt;
&lt;br /&gt;
==== Creating The New /dev/mdX Device ====&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;If you only have one drive, skip this step.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Now we need to use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;mdadm&amp;lt;/span&amp;gt; to create the new [[TLUG_Talk:_Storage_Technologies_and_Theory#Level_1|RAID level 1]] device. This will be used as the device that DRBD will directly access.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
mdadm --create /dev/md3 --homehost=localhost.localdomain --raid-devices=2 --level=1 /dev/sda4 /dev/sdb4&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
mdadm: Note: this array has metadata at the start and&lt;br /&gt;
    may not be suitable as a boot device.  If you plan to&lt;br /&gt;
    store &#039;/boot&#039; on this device please ensure that&lt;br /&gt;
    your boot-loader understands md/v1.x metadata, or use&lt;br /&gt;
    --metadata=0.90&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Seeing as &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/boot&amp;lt;/span&amp;gt; doesn&#039;t exist on this device, we can safely ignore this warning.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
y&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
mdadm: Defaulting to version 1.2 metadata&lt;br /&gt;
mdadm: array /dev/md/md4 started.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can now &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cat /proc/mdstat&amp;lt;/span&amp;gt; to verify that it indeed built. If you&#039;re interested, you could open a new terminal window and use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;watch cat /proc/mdstat&amp;lt;/span&amp;gt; and watch the array build.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cat /proc/mdstat&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
md3 : active raid1 sdb4[1] sda4[0]&lt;br /&gt;
      442971544 blocks super 1.2 [2/2] [UU]&lt;br /&gt;
      [&amp;gt;....................]  resync =  0.8% (3678976/442971544) finish=111.0min speed=65920K/sec&lt;br /&gt;
      &lt;br /&gt;
md2 : active raid1 sda2[0] sdb2[1]&lt;br /&gt;
      4193272 blocks super 1.1 [2/2] [UU]&lt;br /&gt;
      &lt;br /&gt;
md1 : active raid1 sda1[0] sdb1[1]&lt;br /&gt;
      40958908 blocks super 1.1 [2/2] [UU]&lt;br /&gt;
      bitmap: 1/1 pages [4KB], 65536KB chunk&lt;br /&gt;
&lt;br /&gt;
md0 : active raid1 sda3[0] sdb3[1]&lt;br /&gt;
      255988 blocks super 1.0 [2/2] [UU]&lt;br /&gt;
      &lt;br /&gt;
unused devices: &amp;lt;none&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Finally, we need to make sure that the new array will start when the system boots. To do this, we&#039;ll again use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;mdadm&amp;lt;/span&amp;gt;, but with different options that will have it output data in a format suitable for the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/mdadm.conf&amp;lt;/span&amp;gt; file. We&#039;ll redirect this output to that config file, thus updating it.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
mdadm --detail --scan | grep md3 &amp;gt;&amp;gt; /etc/mdadm.conf&lt;br /&gt;
cat /etc/mdadm.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
# mdadm.conf written out by anaconda&lt;br /&gt;
MAILADDR root&lt;br /&gt;
AUTO +imsm +1.x -all&lt;br /&gt;
ARRAY /dev/md0 level=raid1 num-devices=2 UUID=b58df6d0:d925e7bb:c156168d:47c01718&lt;br /&gt;
ARRAY /dev/md1 level=raid1 num-devices=2 UUID=ac2cf39c:77cd0314:fedb8407:9b945bb5&lt;br /&gt;
ARRAY /dev/md2 level=raid1 num-devices=2 UUID=4e513936:4a966f4e:0dd8402e:6403d10d&lt;br /&gt;
ARRAY /dev/md3 metadata=1.2 name=localhost.localdomain:3 UUID=f0b6d0c1:490d47e7:91c7e63a:f8dacc21&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You&#039;ll note that the last line, which we just added, is different from the previous lines. This isn&#039;t a concern, but you are welcome to re-write it to match the existing format if you wish.&lt;br /&gt;
&lt;br /&gt;
Before you proceed, it is strongly advised that you reboot each node and then verify that the new array did in fact start with the system. You &#039;&#039;do not&#039;&#039; need to wait for the sync to finish before rebooting. It will pick up where you left off once rebooted.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: You&#039;ll notice we did not format a file system on this raid array, this is intentional. DRBD use the raw device and does not need a file system on it.&lt;br /&gt;
&lt;br /&gt;
== DRBD Configuration Files ==&lt;br /&gt;
&lt;br /&gt;
DRBD uses a global configuration file, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/drbd.d/global_common.conf&amp;lt;/span&amp;gt;, and one or more resource files. The resource files need to be created in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/drbd.d/&amp;lt;/span&amp;gt; directory and must have the suffix &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;.res&amp;lt;/span&amp;gt;. For this example, we will create a single resource called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;r0&amp;lt;/span&amp;gt; which we will configure in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/drbd.d/r0.res&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== /etc/drbd.d/global_common.conf ===&lt;br /&gt;
&lt;br /&gt;
The stock &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/drbd.d/global_common.conf&amp;lt;/span&amp;gt; is sane, so we won&#039;t bother altering it here.&lt;br /&gt;
&lt;br /&gt;
Full details on all the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;drbd.conf&amp;lt;/span&amp;gt; configuration file directives and arguments can be found [http://www.drbd.org/users-guide/re-drbdconf.html here]. &#039;&#039;&#039;Note&#039;&#039;&#039;: That link doesn&#039;t show this new configuration format. Please see [http://www.novell.com/documentation/sle_ha/book_sleha/?page=/documentation/sle_ha/book_sleha/data/sec_ha_drbd_configure.html Novell&#039;s] link.&lt;br /&gt;
&lt;br /&gt;
=== /etc/drbd.d/r0.res ===&lt;br /&gt;
&lt;br /&gt;
This is the important part. This defines the resource to use, and must reflect the IP addresses and storage devices that DRBD will use for this resource.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/drbd.d/r0.res&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# This is the name of the resource and it&#039;s settings. Generally, &#039;r0&#039; is used&lt;br /&gt;
# as the name of the first resource. This is by convention only, though.&lt;br /&gt;
resource r0&lt;br /&gt;
{&lt;br /&gt;
        # This tells DRBD where to make the new resource available at on each&lt;br /&gt;
        # node. This is, again, by convention only.&lt;br /&gt;
        device    /dev/drbd0;&lt;br /&gt;
&lt;br /&gt;
        # The main argument here tells DRBD that we will have proper locking &lt;br /&gt;
        # and fencing, and as such, to allow both nodes to set the resource to&lt;br /&gt;
        # &#039;primary&#039; simultaneously.&lt;br /&gt;
        net&lt;br /&gt;
        {&lt;br /&gt;
                allow-two-primaries;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        # This tells DRBD to automatically set both nodes to &#039;primary&#039; when the&lt;br /&gt;
        # nodes start.&lt;br /&gt;
        startup&lt;br /&gt;
        {&lt;br /&gt;
                become-primary-on both;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        # This tells DRBD to look for and store it&#039;s meta-data on the resource&lt;br /&gt;
        # itself.&lt;br /&gt;
        meta-disk       internal;&lt;br /&gt;
&lt;br /&gt;
        # The name below must match the output from `uname -n` on each node.&lt;br /&gt;
        on an-node01.alteeve.com&lt;br /&gt;
        {&lt;br /&gt;
                # This must be the IP address of the interface on the storage &lt;br /&gt;
                # network (an-node01.sn, in this case).&lt;br /&gt;
                address         192.168.2.71:7789;&lt;br /&gt;
&lt;br /&gt;
                # This is the underlying partition to use for this resource on &lt;br /&gt;
                # this node.&lt;br /&gt;
                disk            /dev/md3;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        # Repeat as above, but for the other node.&lt;br /&gt;
        on an-node02.alteeve.com&lt;br /&gt;
        {&lt;br /&gt;
                address         192.168.2.72:7789;&lt;br /&gt;
                disk            /dev/md3;&lt;br /&gt;
        }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This file must be copied to &#039;&#039;&#039;BOTH&#039;&#039;&#039; nodes and must match before you proceed.&lt;br /&gt;
&lt;br /&gt;
== Starting The DRBD Resource ==&lt;br /&gt;
&lt;br /&gt;
From the rest of this section, pay attention to whether you see&lt;br /&gt;
* &#039;&#039;&#039;Node1&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Node2&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Both&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
These indicate which node to run the following commands on. There is no functional difference between either node, so just randomly choose one to be &#039;&#039;&#039;Node1&#039;&#039;&#039; and the other will be &#039;&#039;&#039;Node2&#039;&#039;&#039;. Once you&#039;ve chosen which is which, be consistent with which node you run the commands on. Of course, if a command block is proceeded by &#039;&#039;&#039;Both&#039;&#039;&#039;, run the following code block on both nodes.&lt;br /&gt;
&lt;br /&gt;
=== Loading the &#039;drbd&#039; Module ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Both&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Normally, we&#039;d load the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;drbd&amp;lt;/span&amp;gt; module by simply starting the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/init.d/drbd&amp;lt;/span&amp;gt; daemon. However, if we did that at this stage, we&#039;d generate errors because there isn&#039;t an &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;UpToDate&amp;lt;/span&amp;gt; disk in the array. To get around this, we&#039;ll manually load the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;drbd&amp;lt;/span&amp;gt; kernel module using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;modprobe&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
modprobe drbd&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This won&#039;t return any output, but if you check, you should now see the special &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/proc/drbd&amp;lt;/span&amp;gt; file.&lt;br /&gt;
&lt;br /&gt;
=== Monitoring Progress ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Both&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
I find it very useful to monitor DRBD while running the rest of the setup. To do this, open a second terminal on each node and use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;watch&amp;lt;/span&amp;gt; to keep an eye on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/proc/drbd&amp;lt;/span&amp;gt;. This way you will be able to monitor the progress of the array in near-real time.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Both&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
watch cat /proc/drbd&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At this stage, it should look like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
version: 8.3.7 (api:88/proto:86-91)&lt;br /&gt;
GIT-hash: ea9e28dbff98e331a62bcbcc63a6135808fe2917 build by root@xenmaster002.iplink.net, 2010-09-07 16:02:46&lt;br /&gt;
 0: cs:Unconfigured&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Initialize The Resource ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Both&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This step creates the DRBD meta-data on the new DRBD resource&#039;s backing devices. It is only needed when creating new DRBD partitions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
drbdadm create-md r0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
  --==  Thank you for participating in the global usage survey  ==--&lt;br /&gt;
The server&#039;s response is:&lt;br /&gt;
&lt;br /&gt;
you are the 9507th user to install this version&lt;br /&gt;
Writing meta data...&lt;br /&gt;
initializing activity log&lt;br /&gt;
NOT initialized bitmap&lt;br /&gt;
New drbd meta data block successfully created.&lt;br /&gt;
success&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/proc/drbd&amp;lt;/span&amp;gt; output should not have changed at this stage.&lt;br /&gt;
&lt;br /&gt;
=== Starting the Resource ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Both&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This will attach the backing device, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/md3&amp;lt;/span&amp;gt; in our case, and then start the new resource &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;r0&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
drbdadm up r0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There will be no output at the command line. If you are &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;watch&amp;lt;/span&amp;gt;ing &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/proc/drbd&amp;lt;/span&amp;gt; though, you should now see something like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
version: 8.3.7 (api:88/proto:86-91)&lt;br /&gt;
GIT-hash: ea9e28dbff98e331a62bcbcc63a6135808fe2917 build by root@xenmaster002.iplink.net, 2010-09-07 16:02:46&lt;br /&gt;
 0: cs:Connected ro:Secondary/Secondary ds:Inconsistent/Inconsistent C r----&lt;br /&gt;
    ns:0 nr:0 dw:0 dr:0 al:0 bm:0 lo:0 pe:0 ua:0 ap:0 ep:1 wo:b oos:442957988&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
That it is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Secondary/Secondary&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Inconsistent/Inconsistent&amp;lt;/span&amp;gt; is expected.&lt;br /&gt;
&lt;br /&gt;
=== Setting the First Primary Node ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Node1&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
As this is a totally new resource, DRBD doesn&#039;t know which side of the array is &amp;quot;more valid&amp;quot; than the other. In reality, neither is as there was no existing data of note on either node. This means that we now need to choose a node and tell DRBD to treat it as the &amp;quot;source&amp;quot; node. This step will also tell DRBD to make the &amp;quot;source&amp;quot; node &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;primary&amp;lt;/span&amp;gt;. Once set, DRBD will begin &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;sync&amp;lt;/span&amp;gt;&#039;ing in the background. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
drbdadm -- --overwrite-data-of-peer primary r0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As before, there will be no output at the command line, but &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/proc/drbd&amp;lt;/span&amp;gt; will change to show the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
GIT-hash: ea9e28dbff98e331a62bcbcc63a6135808fe2917 build by root@xenmaster002.iplink.net, 2010-09-07 16:02:46&lt;br /&gt;
 0: cs:SyncSource ro:Primary/Secondary ds:UpToDate/Inconsistent C r----&lt;br /&gt;
    ns:69024 nr:0 dw:0 dr:69232 al:0 bm:4 lo:0 pe:0 ua:0 ap:0 ep:1 wo:b oos:442888964&lt;br /&gt;
        [&amp;gt;....................] sync&#039;ed:  0.1% (432508/432576)M&lt;br /&gt;
        finish: 307:33:42 speed: 320 (320) K/sec&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you&#039;re watching the secondary node, the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/proc/drbd&amp;lt;/span&amp;gt; will show &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ro:Secondary/Primary ds:Inconsistent/UpToDate&amp;lt;/span&amp;gt;. This is, as you can guess, simply a reflection of it being the &amp;quot;over-written&amp;quot; node.&lt;br /&gt;
&lt;br /&gt;
=== Setting the Second Node to Primary ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Node2&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The last step to complete the array is to tell the second node to also become &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;primary&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
drbdadm primary r0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As with many &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;drbdadm&amp;lt;/span&amp;gt; commands, nothing will be printed to the console. If you&#039;re watching the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/proc/drbd&amp;lt;/span&amp;gt; though, you should see something like &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Primary/Primary ds:UpToDate/Inconsistent&amp;lt;/span&amp;gt;. The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Inconsistent&amp;lt;/span&amp;gt; flag will remain until the sync is complete.&lt;br /&gt;
&lt;br /&gt;
=== A Note On sync Speed ===&lt;br /&gt;
&lt;br /&gt;
You will notice in the previous step that the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;sync&amp;lt;/span&amp;gt; speed seems awfully slow at &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;320 (320) K/sec&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;This is not a problem!&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
As actual data is written to either side of the array, that data will be immediately copied to both nodes. As such, both nodes will always contain up to date copies of the real data. Given this, the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;syncer&amp;lt;/span&amp;gt; is intentionally set low so as to not put too much load on the underlying disks that could cause slow downs. If you still wish to increase the sync speed, you can do so with the following command.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Warning&#039;&#039;&#039;: If you set the DRBD sync speed too high and saturate your disks&#039; maximum write speed, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clvmd&amp;lt;/span&amp;gt; daemon will likely fail to start in some cases, leading to fences. For this reason, keep your sync rate to about 2/3rds of the underlying disk maximum write speed and hold off on bumping up the sync speed until you know you will have a period of low activity on your cluster.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
drbdsetup /dev/drbd0 syncer -r 35M&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The speed-up will not be instant. It will take a little while for the speed to pick up. Once the sync is finished, it is a good idea to revert to the default sync rate.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
drbdadm syncer r0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Setting Up CLVM =&lt;br /&gt;
&lt;br /&gt;
The goal of DRBD in the cluster is to provide clustered [[LVM]], referred to as [[CLVM]] to the nodes. This is done by turning the DRBD partition into an CLVM physical volume.&lt;br /&gt;
&lt;br /&gt;
So now we will create a [[PV]] on top of the new [[DRBD]] partition, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/drbd0&amp;lt;/span&amp;gt;, that we created in the previous step. Since this new LVM [[PV]] will exist on top of the shared DRBD partition, whatever get written to it&#039;s logical volumes will be immediately available on either node, regardless of which node actually initiated the write.&lt;br /&gt;
&lt;br /&gt;
This capability is the underlying reason for creating this cluster; Neither machine is truly needed so if one machine dies, anything on top of the DRBD partition will still be available. When the failed machine returns, the surviving node will have a list of what blocks changed while the other node was gone and can use this list to quickly re-sync the other server.&lt;br /&gt;
&lt;br /&gt;
== Making LVM Cluster-Aware ==&lt;br /&gt;
&lt;br /&gt;
Normally, LVM is run on a single server. This means that at any time, the LVM can write data to the underlying drive and not need to worry if any other device might change anything. In clusters, this isn&#039;t the case. The other node could try to write to the shared storage, so then nodes need to enable &amp;quot;locking&amp;quot; to prevent the two nodes from trying to work on the same bit of data at the same time. &lt;br /&gt;
&lt;br /&gt;
The process of enabling this locking is known as making LVM &amp;quot;cluster-aware&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
LVM has tool called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;lvmconf&amp;lt;/span&amp;gt; that can be used to enable LVM locking. This is provided as part of the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;lvm2-cluster&amp;lt;/span&amp;gt; package.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum -y install lvm2-cluster.x86_64&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now to enable cluster awareness in LVM, run to following command.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
lvmconf --enable-cluster&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
By default, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clvmd&amp;lt;/span&amp;gt;, the cluster lvm daemon, is stopped and not set to run on boot. Now that we&#039;ve enabled LVM locking, we need to start it:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/clvmd status&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
clvmd is stopped&lt;br /&gt;
active volumes: (none)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As expected, it is stopped, so lets start it:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/clvmd start&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Activating VGs:   No volume groups found&lt;br /&gt;
                                                           [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: I&#039;ve seen on a few occasions where starting &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clvmd&amp;lt;/span&amp;gt; will time out and, on occasion, fences will be issued. I&#039;ve not sorted out why, but I have usually been able to resolve this by stopping &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clvmd&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt;, then restarting &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt; and, finally, restarting &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clvmd&amp;lt;/span&amp;gt;. If I can sort out a way to reliably trigger this problem, I will submit a bug report.&lt;br /&gt;
&lt;br /&gt;
== Filtering Out Devices ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;ToDo&#039;&#039;&#039;: Find a less-aggressive filter.&lt;br /&gt;
&lt;br /&gt;
With the stock &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/lvm/lvm.conf&amp;lt;/span&amp;gt; configuration, all devices on the system will be checked for LVM volumes. This can cause a problem as LVM will give preference to the LVM data on the RAID device over the DRBD device. It sees a duplicate as both are, effectively, one and the same.&lt;br /&gt;
&lt;br /&gt;
To work around this, we need to alter the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;filter = []&amp;lt;/span&amp;gt; entry. At the time of writing, simply rejecting the underlying &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/md3&amp;lt;/span&amp;gt; device as a candidate wasn&#039;t enough. So for now, we will tell LVM to accept DRBD devices and reject all other devices. To do this, we&#039;ll insert &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;quot;a|/dev/drbd*|&amp;quot;&amp;lt;/span&amp;gt; as the first array entry and change the existing entry to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;quot;r/.*/&amp;quot;&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: I would love feedback on a filter argument that successfully ignored just &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/md3&amp;lt;/span&amp;gt;, if anyone can suggest one.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/lvm/lvm.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
    # By default we accept every block device:&lt;br /&gt;
    #filter = [ &amp;quot;a/.*/&amp;quot; ]&lt;br /&gt;
    filter = [ &amp;quot;a|/dev/drbd*|&amp;quot;, &amp;quot;r/.*/&amp;quot; ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now delete the existing cache file so that LVM is forced to rescan the system.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
rm -f /etc/lvm/cache/.cache&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The changes take effect immediately.&lt;br /&gt;
&lt;br /&gt;
== Creating a new PV using the DRBD Partition ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Node1&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
We can now proceed with setting up the new DRBD-based LVM physical volume. Once the PV is created, we can create a new volume group and start allocating space to logical volumes.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: As we will be using our DRBD device, and as it is a shared block device, most of the following commands only need to be run on one node. Once the block device changes in any way, those changes will near-instantly appear on the other node. For this reason, unless explicitly stated to do so, only run the following commands on one node.&lt;br /&gt;
&lt;br /&gt;
To setup the DRBD partition as an LVM PV, run &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;pvcreate&amp;lt;/span&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
pvcreate /dev/drbd0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
  Physical volume &amp;quot;/dev/drbd0&amp;quot; successfully created&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Both&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Now, on both nodes, check that the new physical volume is visible by using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;pvdisplay&amp;lt;/span&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
pvdisplay&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;quot;/dev/drbd0&amp;quot; is a new physical volume of &amp;quot;422.44 GiB&amp;quot;&lt;br /&gt;
  --- NEW Physical volume ---&lt;br /&gt;
  PV Name               /dev/drbd0&lt;br /&gt;
  VG Name               &lt;br /&gt;
  PV Size               422.44 GiB&lt;br /&gt;
  Allocatable           NO&lt;br /&gt;
  PE Size               0   &lt;br /&gt;
  Total PE              0&lt;br /&gt;
  Free PE               0&lt;br /&gt;
  Allocated PE          0&lt;br /&gt;
  PV UUID               YHmdip-SuJN-KIEv-2tbK-BT9Q-wfOo-OuQuaW&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you see &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;PV Name /dev/drbd0&amp;lt;/span&amp;gt; (or your underlying partition) on both nodes, then your DRBD setup and LVM configuration changes are working perfectly!&lt;br /&gt;
&lt;br /&gt;
== Creating a VG on the new PV ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Node1&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Now we need to create the volume group using the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vgcreate&amp;lt;/span&amp;gt; command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vgcreate -c y drbd0_vg0 /dev/drbd0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
  Clustered volume group &amp;quot;drbd0_vg0&amp;quot; successfully created&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Both&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Now we&#039;ll check that the new VG is visible on both nodes using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vgdisplay&amp;lt;/span&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vgdisplay&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
  --- Volume group ---&lt;br /&gt;
  VG Name               drbd0_vg0&lt;br /&gt;
  System ID             &lt;br /&gt;
  Format                lvm2&lt;br /&gt;
  Metadata Areas        1&lt;br /&gt;
  Metadata Sequence No  1&lt;br /&gt;
  VG Access             read/write&lt;br /&gt;
  VG Status             resizable&lt;br /&gt;
  Clustered             yes&lt;br /&gt;
  Shared                no&lt;br /&gt;
  MAX LV                0&lt;br /&gt;
  Cur LV                0&lt;br /&gt;
  Open LV               0&lt;br /&gt;
  Max PV                0&lt;br /&gt;
  Cur PV                1&lt;br /&gt;
  Act PV                1&lt;br /&gt;
  VG Size               422.43 GiB&lt;br /&gt;
  PE Size               4.00 MiB&lt;br /&gt;
  Total PE              108143&lt;br /&gt;
  Alloc PE / Size       0 / 0   &lt;br /&gt;
  Free  PE / Size       108143 / 422.43 GiB&lt;br /&gt;
  VG UUID               Bb8l9e-es2z-PhaF-Gg3o-2is2-DZ1S-V2RsBF&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the new VG is visible on both nodes, we are ready to create our first logical volume using the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;lvcreate&amp;lt;/span&amp;gt; tool.&lt;br /&gt;
&lt;br /&gt;
== Creating the First LV on the new VG ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Node1&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Now we&#039;ll create a simple 20 GiB logical volumes. We will use it as a shared GFS2 store for shared files and to store our Xen domU config files later on.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
lvcreate -L 20G -n xen_shared drbd0_vg0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
  Logical volume &amp;quot;xen_shared&amp;quot; created&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Both&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
As before, we will check that the new logical volume is visible from both nodes by using the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;lvdisplay&amp;lt;/span&amp;gt; command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
lvdisplay&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
  --- Logical volume ---&lt;br /&gt;
  LV Name                /dev/drbd0_vg0/xen_shared&lt;br /&gt;
  VG Name                drbd0_vg0&lt;br /&gt;
  LV UUID                AqQizc-KBpX-2scN-WFLb-jIeF-QDcM-PlQW84&lt;br /&gt;
  LV Write Access        read/write&lt;br /&gt;
  LV Status              available&lt;br /&gt;
  # open                 0&lt;br /&gt;
  LV Size                20.00 GiB&lt;br /&gt;
  Current LE             5120&lt;br /&gt;
  Segments               1&lt;br /&gt;
  Allocation             inherit&lt;br /&gt;
  Read ahead sectors     auto&lt;br /&gt;
  - currently set to     256&lt;br /&gt;
  Block device           253:0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Again, if this is visible from both nodes, we&#039;re set! Repeat this process for all future LVs you will want to create. We will do this a little later to create LVs for Xen VMs.&lt;br /&gt;
&lt;br /&gt;
= Creating A Shared GFS FileSystem =&lt;br /&gt;
&lt;br /&gt;
GFS is a cluster-aware file system that can be simultaneously mounted on two or more nodes at once. We will use it as a place to store ISOs that we&#039;ll use to provision our virtual machines.&lt;br /&gt;
&lt;br /&gt;
== Install The GFS2 Utilities ==&lt;br /&gt;
&lt;br /&gt;
Start by installing the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[GFS2]]&amp;lt;/span&amp;gt; tools:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum -y install gfs2-utils.x86_64&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Format Our CLVM LV With The GFS2 File System ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Node1&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: The following example is designed for the cluster used in the prerequisite HowTo. &lt;br /&gt;
* If you have more than 2 nodes, increase the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;-j 2&amp;lt;/span&amp;gt; to the number of nodes you want to mount this file system on.&lt;br /&gt;
* If your cluster is named something other than &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-cluster&amp;lt;/span&amp;gt; (as set in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cluster.conf&amp;lt;/span&amp;gt; file), change &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;-t an-cluster:xen_shared&amp;lt;/span&amp;gt; to match you cluster&#039;s name. The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xen_shared&amp;lt;/span&amp;gt; can be whatever you like, but it must be unique in the cluster. I tend to use a name that matches the LV name, but this is my own preference and is not required.&lt;br /&gt;
&lt;br /&gt;
To format the partition run:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
mkfs.gfs2 -p lock_dlm -j 2 -t an-cluster:xen_shared /dev/drbd0_vg0/xen_shared&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
This will destroy any data on /dev/drbd0_vg0/xen_shared.&lt;br /&gt;
It appears to contain: symbolic link to `../dm-0&#039;&lt;br /&gt;
&lt;br /&gt;
Are you sure you want to proceed? [y/n] &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Acknowledge the warning, if any, and then press &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;y&amp;lt;/span&amp;gt; if you are ready to proceed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
y&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Device:                    /dev/drbd0_vg0/xen_shared&lt;br /&gt;
Blocksize:                 4096&lt;br /&gt;
Device Size                20.00 GB (5242880 blocks)&lt;br /&gt;
Filesystem Size:           20.00 GB (5242878 blocks)&lt;br /&gt;
Journals:                  2&lt;br /&gt;
Resource Groups:           80&lt;br /&gt;
Locking Protocol:          &amp;quot;lock_dlm&amp;quot;&lt;br /&gt;
Lock Table:                &amp;quot;an-cluster:xen_shared&amp;quot;&lt;br /&gt;
UUID:                      A1487063-2A3F-43B1-3A36-44936B0B4D1E&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once the format completes, you can mount &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/drbd0_vg0/xen_shared&amp;lt;/span&amp;gt; as you would a normal file system.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Both&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
To complete the example, lets mount the GFS2 partition we made just now on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/shared&amp;lt;/span&amp;gt; and then use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;df -h&amp;lt;/span&amp;gt; to verify.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
mkdir /xen_shared&lt;br /&gt;
mount /dev/drbd0_vg0/xen_shared /xen_shared&lt;br /&gt;
df -h&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Filesystem            Size  Used Avail Use% Mounted on&lt;br /&gt;
Filesystem            Size  Used Avail Use% Mounted on&lt;br /&gt;
/dev/md1               39G  2.8G   34G   8% /&lt;br /&gt;
tmpfs                 466M   29M  438M   7% /dev/shm&lt;br /&gt;
/dev/md0              243M   70M  161M  31% /boot&lt;br /&gt;
xenstore              466M   32K  466M   1% /var/lib/xenstored&lt;br /&gt;
/dev/dm-0              20G  259M   20G   2% /xen_shared&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You may have noticed that it shows &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/dm-0&amp;lt;/span&amp;gt; instead of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/drbd0_vg0/xen_shared&amp;lt;/span&amp;gt;. If you look at the later, you will see that it is simply a [[symlink]] to the former.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ls -lah /dev/drbd0_vg0/xen_shared&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
lrwxrwxrwx. 1 root root 7 Sep  9 13:24 /dev/drbd0_vg0/xen_shared -&amp;gt; ../dm-0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Add An Entry To /etc/fstab ==&lt;br /&gt;
&lt;br /&gt;
The last step is to add an entry for this new partition to each node&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/fstab&amp;lt;/span&amp;gt; file.&lt;br /&gt;
&lt;br /&gt;
=== Reference The GFS2 Partition By Device Path ===&lt;br /&gt;
&lt;br /&gt;
This is the more traditional method of referencing the GFS2 partition by using it&#039;s device path directly.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Warning&#039;&#039;&#039;: An incorrect edit of the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/fstab&amp;lt;/span&amp;gt; file can leave your system unable to boot! Please review the line generated above to make sure it is accurate and compatible with your setup before proceeding.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/fstab&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
#&lt;br /&gt;
# /etc/fstab&lt;br /&gt;
# Created by anaconda on Tue Sep  7 06:29:51 2010&lt;br /&gt;
#&lt;br /&gt;
# Accessible filesystems, by reference, are maintained under &#039;/dev/disk&#039;&lt;br /&gt;
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info&lt;br /&gt;
#&lt;br /&gt;
UUID=865690db-85d0-44c5-9f32-ffb6fdf47060 /                       ext3    defaults        1 1&lt;br /&gt;
UUID=8b9822b6-a92e-48c9-96b5-f8943142319e /boot                   ext3    defaults        1 2&lt;br /&gt;
UUID=94b03547-a7e3-45bb-b2d5-837498b370f4 swap                    swap    defaults        0 0&lt;br /&gt;
tmpfs                   /dev/shm                tmpfs   defaults        0 0&lt;br /&gt;
devpts                  /dev/pts                devpts  gid=5,mode=620  0 0&lt;br /&gt;
sysfs                   /sys                    sysfs   defaults        0 0&lt;br /&gt;
proc                    /proc                   proc    defaults        0 0&lt;br /&gt;
xenfs                   /proc/xen               xenfs   defaults        0 0&lt;br /&gt;
/dev/drbd0_vg0/xen_shared /xen_shared           gfs2    rw,suid,dev,exec,nouser,async    0 0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Reference The GFS2 Partition By UUID ===&lt;br /&gt;
&lt;br /&gt;
It is sometimes preferable to create an &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fstab&amp;lt;/span&amp;gt; entry that locates the device path via it&#039;s [[UUID]]. To do this, you can run the following command which, though a bit cryptic, will print out an &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/fstab&amp;lt;/span&amp;gt; compatible string.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Warning&#039;&#039;&#039;: The same warnings apply here as above&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
echo `gfs2_edit -p sb /dev/drbd0_vg0/xen_shared | grep sb_uuid | sed -e &amp;quot;s/.*sb_uuid  *\(.*\)/UUID=\L\1\E \/xen_shared\t\tgfs2\trw,suid,dev,exec,nouser,async\t0 0/&amp;quot;`&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
UUID=a1487063-2a3f-43b1-3a36-44936b0b4d1e /xen_shared gfs2 rw,suid,dev,exec,nouser,async 0 0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You may have noticed that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;defaults&amp;lt;/span&amp;gt; isn&#039;t used. Rather, all but the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;auto&amp;lt;/span&amp;gt; option are manually set. This is because the system will drop to single-user mode at boot if it can&#039;t mount an &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;auto&amp;lt;/span&amp;gt; partition at boot time (&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;auto&amp;lt;/span&amp;gt; being implied by &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;defaults&amp;lt;/span&amp;gt;). Given that our GFS2 partition sits on top of DRBD and the cluster, there is no way to make it available that early in the boot process.&lt;br /&gt;
&lt;br /&gt;
Further, the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;gfs2&amp;lt;/span&amp;gt; init script specifically excludes entries in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/fstab&amp;lt;/span&amp;gt; that have the &#039;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;noauto&amp;lt;/span&amp;gt; option set. For this reason, we can&#039;t simply specify that as we need the init script to see the partition so that it is mounted when GFS2 starts and unmounted when it stops.&lt;br /&gt;
&lt;br /&gt;
Now add this string to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/fstab&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/fstab&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
#&lt;br /&gt;
# /etc/fstab&lt;br /&gt;
# Created by anaconda on Tue Sep  7 06:29:51 2010&lt;br /&gt;
#&lt;br /&gt;
# Accessible filesystems, by reference, are maintained under &#039;/dev/disk&#039;&lt;br /&gt;
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info&lt;br /&gt;
#&lt;br /&gt;
UUID=865690db-85d0-44c5-9f32-ffb6fdf47060 /                       ext3    defaults        1 1&lt;br /&gt;
UUID=8b9822b6-a92e-48c9-96b5-f8943142319e /boot                   ext3    defaults        1 2&lt;br /&gt;
UUID=94b03547-a7e3-45bb-b2d5-837498b370f4 swap                    swap    defaults        0 0&lt;br /&gt;
tmpfs                   /dev/shm                tmpfs   defaults        0 0&lt;br /&gt;
devpts                  /dev/pts                devpts  gid=5,mode=620  0 0&lt;br /&gt;
sysfs                   /sys                    sysfs   defaults        0 0&lt;br /&gt;
proc                    /proc                   proc    defaults        0 0&lt;br /&gt;
xenfs                   /proc/xen               xenfs   defaults        0 0&lt;br /&gt;
UUID=a1487063-2a3f-43b1-3a36-44936b0b4d1e /xen_shared gfs2 rw,suid,dev,exec,nouser,async 0 0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Please note; At the time of writing this HowTo, there is a bug in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;findfs&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;mount&amp;lt;/span&amp;gt;. According to [http://www.ietf.org/rfc/rfc4122.txt RFC 4122], programs should accept a [[UUID]] in either upper or lower case. However, this is not currently the case, so you &#039;&#039;&#039;must&#039;&#039;&#039; pass the UUID in lower-case. Please see bugs [https://bugzilla.redhat.com/show_bug.cgi?id=632373 632373] and [https://bugzilla.redhat.com/show_bug.cgi?id=632385 632385].&lt;br /&gt;
&lt;br /&gt;
== Testing The gfs2 Initialization Script ==&lt;br /&gt;
&lt;br /&gt;
To verify that the new entry is valid, check &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;gfs2&amp;lt;/span&amp;gt;&#039;s status.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/gfs2 status&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Configured GFS2 mountpoints: &lt;br /&gt;
/xen_shared&lt;br /&gt;
Active GFS2 mountpoints: &lt;br /&gt;
/xen_shared&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now test stopping and restarting to ensure that the GFS2 partition unmounts and mounts properly.&lt;br /&gt;
&lt;br /&gt;
Stop &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;gfs2&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/gfs2 stop&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Unmounting GFS2 filesystem (/xen_shared):                   [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;df -h&amp;lt;/span&amp;gt; to ensure that the mount is gone.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
df -h&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Filesystem            Size  Used Avail Use% Mounted on&lt;br /&gt;
/dev/md1               39G  2.0G   35G   6% /&lt;br /&gt;
tmpfs                 466M   23M  444M   5% /dev/shm&lt;br /&gt;
/dev/md0              243M   70M  161M  31% /boot&lt;br /&gt;
xenstore              466M   32K  466M   1% /var/lib/xenstored&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Start &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;gfs2&amp;lt;/span&amp;gt; again.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/gfs2 start&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Mounting GFS2 filesystem (/xen_shared):                     [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Again, check with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;df -h&amp;lt;/span&amp;gt; that it has been remounted.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
df -h&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Filesystem            Size  Used Avail Use% Mounted on&lt;br /&gt;
/dev/md1               39G  2.0G   35G   6% /&lt;br /&gt;
tmpfs                 466M   29M  438M   7% /dev/shm&lt;br /&gt;
/dev/md0              243M   70M  161M  31% /boot&lt;br /&gt;
xenstore              466M   32K  466M   1% /var/lib/xenstored&lt;br /&gt;
/dev/dm-0              20G  259M   20G   2% /xen_shared&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Done!&lt;br /&gt;
&lt;br /&gt;
== Further Reading ==&lt;br /&gt;
&lt;br /&gt;
* [[Grow a GFS2 Partition]]&lt;br /&gt;
* [[Hard drive has gone bad in DRBD]]&lt;br /&gt;
&lt;br /&gt;
= Altering Daemon Start Order =&lt;br /&gt;
&lt;br /&gt;
It is important that the various daemons in use by our cluster start in the right order. Most daemons will rely on services provided by another daemon to be running, and will not start or will not operate reliably otherwise.&lt;br /&gt;
&lt;br /&gt;
We need to make sure that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xend&amp;lt;/span&amp;gt; starts so that the network is stable. Then &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt; needs to start so that [[fencing]] and [[dlm]] are available. Next, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;drbd&amp;lt;/span&amp;gt; starts so that the clustered storage is available. Then &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clvmd&amp;lt;/span&amp;gt; must start so that the data on the DRBD resource is accessible. Now &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;gfs2&amp;lt;/span&amp;gt; needs to start so that the Xen domU configuration files can be found and finally &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xendomains&amp;lt;/span&amp;gt; must start to boot up the actual domU virtual machines.&lt;br /&gt;
&lt;br /&gt;
To restate as a list, the start order must be:&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xend&amp;lt;/span&amp;gt;&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt;&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;drbd&amp;lt;/span&amp;gt;&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clvmd&amp;lt;/span&amp;gt;&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;gfs2&amp;lt;/span&amp;gt;&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xendomains&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To make sure the start order is sane then, we&#039;ll edit each of the six daemon&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;init&amp;lt;/span&amp;gt; scripts and alter their &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Required-Start&amp;lt;/span&amp;gt; lines. To make the changes take effect, we will use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;chkconfig&amp;lt;/span&amp;gt; to remove and re-add them to the various start levels.&lt;br /&gt;
&lt;br /&gt;
== Altering xend ==&lt;br /&gt;
&lt;br /&gt;
This should already be done. If it isn&#039;t, please see &amp;quot;[[#Make xend play nice with clustering|Making xend play nice with clustering]]&amp;quot; above. If you are revisiting that section, you can skip the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt; edit as we will need to make another change in the next step.&lt;br /&gt;
&lt;br /&gt;
== Altering cman ==&lt;br /&gt;
&lt;br /&gt;
This should already be done. If it isn&#039;t, please see &amp;quot;[[#Make xend play nice with clustering|Making xend play nice with clustering]]&amp;quot; above. If you are revisiting that section, you can skip the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt; edit as we will need to make another change in the next step.&lt;br /&gt;
&lt;br /&gt;
== Altering drbd ==&lt;br /&gt;
&lt;br /&gt;
Now we will tell &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;drbd&amp;lt;/span&amp;gt; to start after &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
This requires the additional step of altering the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;chkconfig: - 70 08&amp;lt;/span&amp;gt; line to instead read &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;chkconfig: - 20 08&amp;lt;/span&amp;gt;. This isn&#039;t strictly needed, but will give more room for &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;chkconfig&amp;lt;/span&amp;gt; to order the dependent daemons by allowing DRBD to be started as low as position &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;20&amp;lt;/span&amp;gt;, rather than waiting until position &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;70&amp;lt;/span&amp;gt;. This is somewhat more compatible with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clvmd&amp;lt;/span&amp;gt; which normally start at positions &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;21&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;24&amp;lt;/span&amp;gt;, respectively&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/init.d/drbd&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
#&lt;br /&gt;
# chkconfig: - 20 08&lt;br /&gt;
# description: Loads and unloads the drbd module&lt;br /&gt;
#&lt;br /&gt;
# Copright 2001-2008 LINBIT Information Technologies&lt;br /&gt;
# Philipp Reisner, Lars Ellenberg&lt;br /&gt;
#&lt;br /&gt;
### BEGIN INIT INFO&lt;br /&gt;
# Provides: drbd&lt;br /&gt;
# Required-Start: $local_fs $network $syslog cman&lt;br /&gt;
# Required-Stop:  $local_fs $network $syslog&lt;br /&gt;
# Should-Start:   sshd multipathd&lt;br /&gt;
# Should-Stop:    sshd multipathd&lt;br /&gt;
# Default-Start:&lt;br /&gt;
# Default-Stop:&lt;br /&gt;
# Short-Description:    Control drbd resources.&lt;br /&gt;
### END INIT INFO&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Altering clvmd ==&lt;br /&gt;
&lt;br /&gt;
Now we will now tell &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clvmd&amp;lt;/span&amp;gt; to start after &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;drbd&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: There is currently a minor bug with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;lvm2-cluster&amp;lt;/span&amp;gt; version &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;2.02.73-2&amp;lt;/span&amp;gt; in that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/init.d/clvmd&amp;lt;/span&amp;gt; is set by default to mode &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;0555&amp;lt;/span&amp;gt;. This is easily corrected by running the following command. Please check bug [https://bugzilla.redhat.com/show_bug.cgi?id=636066 636066] to see if this has been resolved.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
chmod u+w /etc/init.d/clvmd&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once you&#039;ve got write access, edit the file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/init.d/clvmd&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
#&lt;br /&gt;
# chkconfig: - 24 76&lt;br /&gt;
# description: Starts and stops clvmd&lt;br /&gt;
#&lt;br /&gt;
# For Red-Hat-based distributions such as Fedora, RHEL, CentOS.&lt;br /&gt;
#              &lt;br /&gt;
### BEGIN INIT INFO&lt;br /&gt;
# Provides: clvmd&lt;br /&gt;
# Required-Start: $local_fs drbd&lt;br /&gt;
# Required-Stop: $local_fs&lt;br /&gt;
# Default-Start:&lt;br /&gt;
# Default-Stop: 0 1 6&lt;br /&gt;
# Short-Description: Clustered LVM Daemon&lt;br /&gt;
### END INIT INFO&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Altering gfs2 ==&lt;br /&gt;
&lt;br /&gt;
Now we will now tell &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;gfs2&amp;lt;/span&amp;gt; to start after &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clvmd&amp;lt;/span&amp;gt;. You will notice that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt; is already listed under &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Required-Start&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Required-Stop&amp;lt;/span&amp;gt;. It&#039;s true that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt; must be started, but we&#039;ve created a chain here so we can safely replace it with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clvmd&amp;lt;/span&amp;gt; in the start line.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/init.d/gfs2&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
#&lt;br /&gt;
# gfs2 mount/unmount helper&lt;br /&gt;
#&lt;br /&gt;
# chkconfig: - 26 74&lt;br /&gt;
# description: mount/unmount gfs2 filesystems configured in /etc/fstab&lt;br /&gt;
&lt;br /&gt;
### BEGIN INIT INFO&lt;br /&gt;
# Provides:             gfs2&lt;br /&gt;
# Required-Start:       $network clvmd&lt;br /&gt;
# Required-Stop:        $network&lt;br /&gt;
# Default-Start:&lt;br /&gt;
# Default-Stop:&lt;br /&gt;
# Short-Description:    mount/unmount gfs2 filesystems configured in /etc/fstab&lt;br /&gt;
# Description:          mount/unmount gfs2 filesystems configured in /etc/fstab&lt;br /&gt;
### END INIT INFO&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Altering xendomains ==&lt;br /&gt;
&lt;br /&gt;
Finally, we will alter &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xendomains&amp;lt;/span&amp;gt; so that it starts last, after &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;gfs2&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/init.d/xendomains&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
#&lt;br /&gt;
# /etc/init.d/xendomains&lt;br /&gt;
# Start / stop domains automatically when domain 0 boots / shuts down.&lt;br /&gt;
#&lt;br /&gt;
# chkconfig: 345 99 00&lt;br /&gt;
# description: Start / stop Xen domains.&lt;br /&gt;
#&lt;br /&gt;
# This script offers fairly basic functionality.  It should work on Redhat&lt;br /&gt;
# but also on LSB-compliant SuSE releases and on Debian with the LSB package&lt;br /&gt;
# installed.  (LSB is the Linux Standard Base)&lt;br /&gt;
#&lt;br /&gt;
# Based on the example in the &amp;quot;Designing High Quality Integrated Linux&lt;br /&gt;
# Applications HOWTO&amp;quot; by Avi Alkalay&lt;br /&gt;
# &amp;lt;http://www.tldp.org/HOWTO/HighQuality-Apps-HOWTO/&amp;gt;&lt;br /&gt;
#&lt;br /&gt;
### BEGIN INIT INFO&lt;br /&gt;
# Provides:          xendomains&lt;br /&gt;
# Required-Start:    $syslog $remote_fs xend gfs2&lt;br /&gt;
# Should-Start:&lt;br /&gt;
# Required-Stop:     $syslog $remote_fs xend&lt;br /&gt;
# Should-Stop:&lt;br /&gt;
# Default-Start:     3 4 5&lt;br /&gt;
# Default-Stop:      0 1 2 6&lt;br /&gt;
# Default-Enabled:   yes&lt;br /&gt;
# Short-Description: Start/stop secondary xen domains&lt;br /&gt;
# Description:       Start / stop domains automatically when domain 0 &lt;br /&gt;
#                    boots / shuts down.&lt;br /&gt;
### END INIT INFO&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Applying The Changes ==&lt;br /&gt;
&lt;br /&gt;
Change the start order by removing and re-adding all cluster-related daemons using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;chkconfig&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
chkconfig xenstored off; chkconfig xenconsoled off; chkconfig xend off; chkconfig cman off; chkconfig drbd off; chkconfig clvmd off; chkconfig gfs2 off; chkconfig xendomains off&lt;br /&gt;
chkconfig xendomains on; chkconfig gfs2 on; chkconfig clvmd on; chkconfig drbd on; chkconfig cman on; chkconfig xend on; chkconfig xenconsoled on; chkconfig xenstored on&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now verify that the start order is as we want it. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ls -lah /etc/rc3.d/&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
lrwxrwxrwx.  1 root root   19 Sep 20 13:37 S26xenstored -&amp;gt; ../init.d/xenstored&lt;br /&gt;
lrwxrwxrwx.  1 root root   21 Sep 20 13:37 S27xenconsoled -&amp;gt; ../init.d/xenconsoled&lt;br /&gt;
lrwxrwxrwx.  1 root root   14 Sep 20 13:37 S28xend -&amp;gt; ../init.d/xend&lt;br /&gt;
lrwxrwxrwx.  1 root root   14 Sep 20 13:37 S29cman -&amp;gt; ../init.d/cman&lt;br /&gt;
lrwxrwxrwx.  1 root root   14 Sep 20 13:37 S70drbd -&amp;gt; ../init.d/drbd&lt;br /&gt;
lrwxrwxrwx.  1 root root   15 Sep 20 13:37 S71clvmd -&amp;gt; ../init.d/clvmd&lt;br /&gt;
lrwxrwxrwx.  1 root root   14 Sep 20 13:37 S72gfs2 -&amp;gt; ../init.d/gfs2&lt;br /&gt;
lrwxrwxrwx.  1 root root   20 Sep 20 13:37 S99xendomains -&amp;gt; ../init.d/xendomains&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Setting Up Xen =&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;WARNING&#039;&#039;&#039;&#039;&#039;: Everything below here is pretty &#039;&#039;&#039;seriously screwed up&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: This is not meant to be an extensive tutorial on Xen itself. It covers enough to get domU VMs provisioned in a manner that will take advantage of the cluster. As such, there is minimal explanation of configuration file options. If you need further help, please drop by the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;##xen&amp;lt;/span&amp;gt; (yes, two &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;##&amp;lt;/span&amp;gt;) [[IRC]] channel on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;freenode.org&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Install The Hypervisor Tools ==&lt;br /&gt;
&lt;br /&gt;
These tools are very useful in provisioning and managing domU VMs.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum -y install virt-install virt-viewer&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Install The HVM/KVM Tools ==&lt;br /&gt;
&lt;br /&gt;
For &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;hvm&amp;lt;/span&amp;gt; (Hardware Virtual Machines), which is required for [http://www.virtuatopia.com/index.php/Virtualizing_Windows_Server_2008_with_Xen paravirtualized Microsoft] VMs, you must install the following packages as well.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum -y install qemu-kvm.x86_64 qemu-kvm-tools.x86_64&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Ensure That Virtualization Is Enabled ==&lt;br /&gt;
&lt;br /&gt;
Many motherboards disable &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;hvm&amp;lt;/span&amp;gt; by default in their [[BIOS]]. Assuming that you&#039;ve got a dom0 kernel running at this stage, you can check if this is the case by checking the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xm info&amp;lt;/span&amp;gt; output.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
xm info&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
host                   : an-node04.alteeve.com&lt;br /&gt;
release                : 2.6.32.23-170.dom0_an1.fc13.x86_64&lt;br /&gt;
version                : #1 SMP Sun Oct 10 20:39:19 EDT 2010&lt;br /&gt;
machine                : x86_64&lt;br /&gt;
nr_cpus                : 4&lt;br /&gt;
nr_nodes               : 1&lt;br /&gt;
cores_per_socket       : 4&lt;br /&gt;
threads_per_core       : 1&lt;br /&gt;
cpu_mhz                : 2209&lt;br /&gt;
hw_caps                : 178bf3ff:efd3fbff:00000000:00001310:00802001:00000000:000037ff:00000000&lt;br /&gt;
virt_caps              : hvm&lt;br /&gt;
total_memory           : 4063&lt;br /&gt;
free_memory            : 2987&lt;br /&gt;
node_to_cpu            : node0:0-3&lt;br /&gt;
node_to_memory         : node0:2987&lt;br /&gt;
node_to_dma32_mem      : node0:2928&lt;br /&gt;
max_node_id            : 0&lt;br /&gt;
xen_major              : 4&lt;br /&gt;
xen_minor              : 0&lt;br /&gt;
xen_extra              : .1&lt;br /&gt;
xen_caps               : xen-3.0-x86_64 xen-3.0-x86_32p hvm-3.0-x86_32 hvm-3.0-x86_32p hvm-3.0-x86_64 &lt;br /&gt;
xen_scheduler          : credit&lt;br /&gt;
xen_pagesize           : 4096&lt;br /&gt;
platform_params        : virt_start=0xffff800000000000&lt;br /&gt;
xen_changeset          : unavailable&lt;br /&gt;
xen_commandline        : dom0_mem=1024M&lt;br /&gt;
cc_compiler            : gcc version 4.4.4 20100630 (Red Hat 4.4.4-10) (GCC) &lt;br /&gt;
cc_compile_by          : root&lt;br /&gt;
cc_compile_domain      : &lt;br /&gt;
cc_compile_date        : Mon Oct 11 01:10:38 EDT 2010&lt;br /&gt;
xend_config_format     : 4&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Look at the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt_caps&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xen_caps&amp;lt;/span&amp;gt; lines. Notice the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;hvm&amp;lt;/span&amp;gt; entries? This shows that HVM, also known as &amp;quot;secure virtualization&amp;quot;, has been enabled. If you do not see this, please check your mainboard manual for information on enabling this on your system.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: The next paragraph applies only when running a vanilla kernel.&lt;br /&gt;
&lt;br /&gt;
If you are running a vanilla kernel, you can check to see if your CPU has support for HVM guests but checking &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/proc/cpuinfo&amp;lt;/span&amp;gt;. What you&#039;re looking for depends on your CPU manufacturer. If you have an Intel CPU, you need to look for the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vmx&amp;lt;/span&amp;gt; flag. Likewise, with AMD CPUs, you need to look for the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;svm&amp;lt;/span&amp;gt; flag.&lt;br /&gt;
&lt;br /&gt;
For a more complete, if somewhat dated paper on this topic, please [http://fedoraproject.org/wiki/FedoraXenQuickstartFC6#Fully-virtualized_guests_.28HVM.2FIntel-VT.2FAMD-V.29 Fedora 6 Xen Quickstart Guide, System Requirements].&lt;br /&gt;
&lt;br /&gt;
== Enabling Migration ==&lt;br /&gt;
&lt;br /&gt;
By default, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xend&amp;lt;/span&amp;gt; will not allow domU VMs from being migrated onto or off of a given dom0 host. Given that we&#039;ve got a cluster though, we very much want this behaviour, so now we will enable it. This is done by making edits to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/xen/xend-config.sxp&amp;lt;/span&amp;gt;. Below is a concise list of options that must be set. Some exist already in the file and need to be commented out or altered.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Warning&#039;&#039;&#039;: The values below are &#039;&#039;&#039;very&#039;&#039;&#039; permissive. Please review each option and improve the security to fit your network before going into production!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/xen/xend-config.sxp &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
(xend-http-server yes)&lt;br /&gt;
(xend-unix-server yes)&lt;br /&gt;
(xend-tcp-xmlrpc-server yes)&lt;br /&gt;
(xend-relocation-server yes)&lt;br /&gt;
(xend-udev-event-server yes)&lt;br /&gt;
(xend-port            8000)&lt;br /&gt;
(xend-relocation-port 8002)&lt;br /&gt;
(xend-address &#039;&#039;)&lt;br /&gt;
(xend-relocation-address &#039;&#039;)&lt;br /&gt;
(xend-relocation-hosts-allow &#039;&#039;)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once done, restart &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xend&amp;lt;/span&amp;gt;. It is usually safest to stop the cluster before hand to avoid accidental fencing caused by the underlying network being reconfigured.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/gfs2 stop&lt;br /&gt;
/etc/init.d/clvmd stop&lt;br /&gt;
/etc/init.d/cman stop&lt;br /&gt;
/etc/init.d/xend restart&lt;br /&gt;
/etc/init.d/cman start&lt;br /&gt;
/etc/init.d/clvmd start&lt;br /&gt;
/etc/init.d/gfs2 start&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Virtual Machine Naming Convention ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: This section acts as a recommendation only. Feel free to alter this to fit your style and needs.&lt;br /&gt;
&lt;br /&gt;
Personally, I like to name my VMs similar to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;c5_shorewall_01&amp;lt;/span&amp;gt;. To elaborate, I like to use the format:&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;os_role_seq&amp;lt;/span&amp;gt; (&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;Operating System ID&amp;gt;_&amp;lt;Role of the VM&amp;gt;_&amp;lt;Sequence Integer&amp;gt;&amp;lt;/span&amp;gt;). &lt;br /&gt;
&lt;br /&gt;
There are no (known) restrictions on virtual machine names, so feel free to use names that made sense for you. I do strongly recommend that you match the name of your domU VM to the name of it&#039;s host LVM logical volume.&lt;br /&gt;
&lt;br /&gt;
== Provisioning domU VMs ==&lt;br /&gt;
&lt;br /&gt;
There are two ways to provision new VMs. The first examples below show provisioning of VMs using the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# Fedora 13 x86_64 RPM builder VM&lt;br /&gt;
lvcreate -L 40G -n f13_builder_01 drbd0_vg0&lt;br /&gt;
virt-install --connect xen \&lt;br /&gt;
             --name f13_builder_01 \&lt;br /&gt;
             --ram 1024 \&lt;br /&gt;
             --arch x86_64 \&lt;br /&gt;
             --vcpus 1 \&lt;br /&gt;
             --cpuset 1 \&lt;br /&gt;
             --location http://192.168.1.10/f13/x86_64/img/ \&lt;br /&gt;
             --os-type linux \&lt;br /&gt;
             --os-variant fedora13 \&lt;br /&gt;
             --disk path=/dev/drbd0_vg0/f13_builder_01 \&lt;br /&gt;
             --network bridge=eth0,mac=00:16:3e:00:10:01 \&lt;br /&gt;
             --vnc \&lt;br /&gt;
             --paravirt&lt;br /&gt;
# Backup the config to an XML file.&lt;br /&gt;
virsh dumpxml f13_builder_01 &amp;gt; /xen_shared/domU_config/f13_builder_01.xml&lt;br /&gt;
# Convert it to a &amp;quot;traditional&amp;quot; python script. Be sure the edit the resulting .cfg file to remove the &#039;vifname=&#039; sections.&lt;br /&gt;
virsh -c xen:/// domxml-to-native xen-xm f13_builder_01.xml &amp;gt; f13_builder_01.cfg&lt;br /&gt;
&lt;br /&gt;
# A CentOS test server&lt;br /&gt;
lvcreate -L 40G -n c5_test_01 drbd0_vg0&lt;br /&gt;
virt-install --connect xen \&lt;br /&gt;
             --name c5_test_01 \&lt;br /&gt;
             --ram 1024 \&lt;br /&gt;
             --arch x86_64 \&lt;br /&gt;
             --vcpus 1 \&lt;br /&gt;
             --cpuset 1-3 \&lt;br /&gt;
             --location http://192.168.1.10/c5/x86_64/img/ \&lt;br /&gt;
             --os-type linux \&lt;br /&gt;
             --os-variant rhel5.4 \&lt;br /&gt;
             --disk path=/dev/drbd0_vg0/c5_test_01 \&lt;br /&gt;
             --network bridge=eth0,mac=00:16:3e:00:10:02 \&lt;br /&gt;
             --vnc \&lt;br /&gt;
             --paravirt&lt;br /&gt;
# Backup the config to an XML file.&lt;br /&gt;
virsh dumpxml c5_shorewall_01 &amp;gt; /xen_shared/domU_config/c5_shorewall_01.xml&lt;br /&gt;
&lt;br /&gt;
# Red Hat Enterprise Linux 6 beta 2 test server&lt;br /&gt;
lvcreate -L 40G -n rh6b2_test_01 drbd0_vg0&lt;br /&gt;
virt-install --connect xen \&lt;br /&gt;
             --name rh6b2_test_01 \&lt;br /&gt;
             --ram 1024 \&lt;br /&gt;
             --arch x86_64 \&lt;br /&gt;
             --vcpus 1 \&lt;br /&gt;
             --cpuset 1 \&lt;br /&gt;
             --location http://192.168.1.10/rhel6/x86_64/img/ \&lt;br /&gt;
             --os-type linux \&lt;br /&gt;
             --os-variant rhel6 \&lt;br /&gt;
             --disk path=/dev/drbd0_vg0/rh6b2_test_01 \&lt;br /&gt;
             --network bridge=eth0,mac=00:16:3e:00:10:03 \&lt;br /&gt;
             --vnc \&lt;br /&gt;
             --paravirt&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
HVM + ISO-based install of Windows 2008 Server. This uses a config file right off the bat as there is a problem with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-install&amp;lt;/span&amp;gt; finding the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;qemu-dm&amp;lt;/span&amp;gt; file. You&#039;ll not for the same reason that the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;arch_libdir&amp;lt;/span&amp;gt; variable is not used. I will try to resolve this later.&lt;br /&gt;
&lt;br /&gt;
This configuration file will be saved in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/xen_shared/domU_config&amp;lt;/span&amp;gt; directory, which exists on the shared [[GFS2]] partition we created earlier.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
mkdir /xen_shared/domU_config&lt;br /&gt;
vim /xen_shared/domU_config/win2008_sql_01.cfg&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
# This is the Windows 2008 Enterprise Server x86_64 hosting MS SQL Server 2008 Enterprise&lt;br /&gt;
kernel = &amp;quot;/usr/lib/xen/boot/hvmloader&amp;quot;&lt;br /&gt;
builder=&#039;hvm&#039;&lt;br /&gt;
memory = 1024&lt;br /&gt;
&lt;br /&gt;
# Should be at least 2KB per MB of domain memory, plus a few MB per vcpu.&lt;br /&gt;
shadow_memory = 8&lt;br /&gt;
name = &amp;quot;win2008_sql_01&amp;quot;&lt;br /&gt;
#vif = [ &#039;type=ioemu, bridge=xenbr0&#039; ]&lt;br /&gt;
vif = [ &#039;type=ioemu, bridge=eth0,mac=00:16:3e:00:30:03&#039; ]&lt;br /&gt;
acpi = 1&lt;br /&gt;
apic = 1&lt;br /&gt;
# Remove the &#039;file:...&#039; entry (or change it to another ISO) after the install is complete.&lt;br /&gt;
disk = [ &#039;phy:/dev/drbd0_vg0/win2008_sql_01,hda,w&#039;, &#039;file:/xen_shared/iso/MS-Win2008-Ent-x86_64-SP2.iso,hdc:cdrom,r&#039; ]&lt;br /&gt;
&lt;br /&gt;
device_model = &#039;/usr/lib/xen/bin/qemu-dm&#039;&lt;br /&gt;
&lt;br /&gt;
#-----------------------------------------------------------------------------&lt;br /&gt;
# boot on floppy (a), hard disk (c) or CD-ROM (d) &lt;br /&gt;
# default: hard disk, cd-rom, floppy&lt;br /&gt;
boot=&amp;quot;dc&amp;quot;&lt;br /&gt;
sdl=0&lt;br /&gt;
vnc=1&lt;br /&gt;
vncconsole=1&lt;br /&gt;
vncpasswd=&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
serial=&#039;pty&#039;&lt;br /&gt;
usbdevice=&#039;tablet&#039;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
xm create -f /xen_shared/domU_config/win2008_sql_01.cfg&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Convert the &amp;quot;traditional&amp;quot; config into an XML&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Install virt-manager ===&lt;br /&gt;
&lt;br /&gt;
We will now start using a graphical tool called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-manager&amp;lt;/span&amp;gt;. It simplifies the creation of domU VMs quite a bit.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install virt-manager&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Be sure that you&#039;ve enabled &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;X-Forwarding&amp;lt;/span&amp;gt; if you&#039;ve &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ssh&amp;lt;/span&amp;gt;&#039;ed into your nodes. This may require modifying your &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/sshd_config&amp;lt;/span&amp;gt; file and changing &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;X11Forwarding&amp;lt;/span&amp;gt; to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;yes&amp;lt;/span&amp;gt;. Then when you connect to the node, you will need to use the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ssh -X user@node&amp;lt;/span&amp;gt; switch.&lt;br /&gt;
&lt;br /&gt;
We&#039;ll come back to this program shortly.&lt;br /&gt;
&lt;br /&gt;
=== Create The CLVM LV ===&lt;br /&gt;
&lt;br /&gt;
We will create a new [[CLVM]] [[LV]] for this [[VM]]. It will act as the VM&#039;s hard drive, so it needs to have enough capacity for the OS and any data you expect the VM to need. As we&#039;re creating a hypothetical router/firewall, we will not need much space. We&#039;ll use 20 [[GiB]], which should be more than enough.&lt;br /&gt;
&lt;br /&gt;
As before, this will only need to be done on one node. Being that it is on top of the DRBD resource, it will be visible to both nodes.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Node1&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
lvcreate -L 20G -n c5_test_01 drbd0_vg0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
  Logical volume &amp;quot;c5_test_01&amp;quot; created&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Both&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Verify that the new LV is indeed visible from both nodes now.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
lvdisplay &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
  --- Logical volume ---&lt;br /&gt;
  LV Name                /dev/drbd0_vg0/xen_shared&lt;br /&gt;
  VG Name                drbd0_vg0&lt;br /&gt;
  LV UUID                yjt41B-cdc4-LGV4-Ds0m-eRVv-FIY7-3FK4Kb&lt;br /&gt;
  LV Write Access        read/write&lt;br /&gt;
  LV Status              available&lt;br /&gt;
  # open                 1&lt;br /&gt;
  LV Size                20.00 GiB&lt;br /&gt;
  Current LE             5120&lt;br /&gt;
  Segments               1&lt;br /&gt;
  Allocation             inherit&lt;br /&gt;
  Read ahead sectors     auto&lt;br /&gt;
  - currently set to     256&lt;br /&gt;
  Block device           253:0&lt;br /&gt;
   &lt;br /&gt;
  --- Logical volume ---&lt;br /&gt;
  LV Name                /dev/drbd0_vg0/c5_test_01&lt;br /&gt;
  VG Name                drbd0_vg0&lt;br /&gt;
  LV UUID                eOcBZz-nJzz-wHwg-4cBL-ZZHm-1cm6-Sf82xC&lt;br /&gt;
  LV Write Access        read/write&lt;br /&gt;
  LV Status              available&lt;br /&gt;
  # open                 0&lt;br /&gt;
  LV Size                20.00 GiB&lt;br /&gt;
  Current LE             5120&lt;br /&gt;
  Segments               1&lt;br /&gt;
  Allocation             inherit&lt;br /&gt;
  Read ahead sectors     auto&lt;br /&gt;
  - currently set to     256&lt;br /&gt;
  Block device           253:1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we&#039;ve got the space, we&#039;re ready to provision!&lt;br /&gt;
&lt;br /&gt;
=== Connecting To The Hypervisor From virt-manager ===&lt;br /&gt;
&lt;br /&gt;
At this point, we&#039;ll be using the graphical &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-manager&amp;lt;/span&amp;gt; tool. &lt;br /&gt;
&lt;br /&gt;
==== Running virt-manager Directly On a Node ====&lt;br /&gt;
&lt;br /&gt;
If you are working on the nodes directly, you can run &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-manager&amp;lt;/span&amp;gt; but you will need to have Gnome or KDE started first. The easiest way to do this is to switch to run level 5. As an unprivileged user, run the following command.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
startx&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From there, click on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Application&amp;lt;/span&amp;gt; -&amp;gt; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;System Tools&amp;lt;/span&amp;gt; -&amp;gt; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Virtual machine Manager&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Image:virt-manager_local-node_01.png|thumb|500px|center|Where to find &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-manager&amp;lt;/span&amp;gt; in Fedora 13]]&lt;br /&gt;
&lt;br /&gt;
==== Running virt-manager Remotely Over X-Forwarding ====&lt;br /&gt;
&lt;br /&gt;
Some features in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-manager&amp;lt;/span&amp;gt; don&#039;t work well unless they are run off of the local machine. The best way to accomplish this from a remote system is to use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;X-Forwarding&amp;lt;/span&amp;gt;, which was discussed in the [[#Install virt-manager|Install virt-manager]] above. &lt;br /&gt;
&lt;br /&gt;
Generally speaking, I prefer to provision VMs using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-manager&amp;lt;/span&amp;gt; directly on a cluster node. This avoids some problems, like accessing underlying LVM volumes. So to do this when you can&#039;t directly sit at a node, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ssh&amp;lt;/span&amp;gt; into your node using the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;-X&amp;lt;/span&amp;gt; switch.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ssh -X root@an-node01&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Last login: Sun Sep 19 22:02:38 2010&lt;br /&gt;
[root@an-node01 ~]# &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now start &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-manager&amp;lt;/span&amp;gt; at the command line and wait for it to open on your local workstation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
virt-manager&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: If your local workstation has a different version of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;X&amp;lt;/span&amp;gt; server or Gnome, the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-manager&amp;lt;/span&amp;gt; window could look fairly primitive. It will work just the same though, and all the icons will be in the same place.&lt;br /&gt;
&lt;br /&gt;
==== Running virt-manager Locally On a Workstation ====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-manager&amp;lt;/span&amp;gt; tool can be installed on a computer outside of the cluster and then used to connect to the hypervisor on either node. This is very useful for daily usage of your virtual machines, but isn&#039;t recommended during the provisioning stage. In some cases, running &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-manager&amp;lt;/span&amp;gt; remotely will cause it to not see the LVM volumes properly, preventing you from choosing the LV for your new VM.&lt;br /&gt;
&lt;br /&gt;
To connect to the hypervisor on the cluster nodes, click on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;File&amp;lt;/span&amp;gt; -&amp;gt; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Add Connection&amp;lt;/span&amp;gt;. Change the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Hypervison&amp;lt;/span&amp;gt; to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Xen&amp;lt;/span&amp;gt; and then change the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Connection&amp;lt;/span&amp;gt; to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Remote tunnel over SSH&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[Image:virt-manager_remote-workstation_01.png|thumb|500px|center|Adding a remote connection in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-manager&amp;lt;/span&amp;gt; from a workstation]]&lt;br /&gt;
&lt;br /&gt;
In some cases, not all of the nodes on the network will be seen. In the screen shot above, you can see that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt; can be seen, but &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt; wasn&#039;t. To add the missing one, just type &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;node-name.local&amp;lt;/span&amp;gt; (&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01.local&amp;lt;/span&amp;gt; above). Once selected, hit &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Connect&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Once the two nodes have been connected, you should see them on the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-manager&amp;lt;/span&amp;gt; main page.&lt;br /&gt;
&lt;br /&gt;
[[Image:virt-manager_remote-workstation_02.png|thumb|500px|center|Remote connection in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-manager&amp;lt;/span&amp;gt; to both nodes in the cluster]]&lt;br /&gt;
&lt;br /&gt;
Once you seen your nodes, you can proceed to use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-manager&amp;lt;/span&amp;gt; the same as if you were running it on one of the nodes directly.&lt;br /&gt;
&lt;br /&gt;
=== Using virt-manager To Provision Our VM ===&lt;br /&gt;
&lt;br /&gt;
How you use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-manager&amp;lt;/span&amp;gt; will be the same regardless of how or where you started it. The following steps will walk you through the program&#039;s use.&lt;br /&gt;
&lt;br /&gt;
With the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Virtual Machine Manager&amp;lt;/span&amp;gt; main menu connected to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;localhost (QEMU)&amp;lt;/span&amp;gt;, we can now begin the process of provisioning a new Xen domU virtual machine! The top-left icon, which looks like a monitor with the &amp;quot;play&amp;quot; button on it&#039;s screen, will be used to provision our virtual machine.&lt;br /&gt;
&lt;br /&gt;
[[Image:virt-manager_local-node_02.png|thumb|500px|center|The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-manager&amp;lt;/span&amp;gt; main menu]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Madi&#039;&#039;&#039;: You left off here.&lt;br /&gt;
&lt;br /&gt;
Once you press the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Create a new virtual machine&amp;lt;/span&amp;gt; button you will be asked to name the VM and to choose the install type. Even if you have a [[PXE]] server, choose Network Install.&lt;br /&gt;
&lt;br /&gt;
[[Image:virt-manager_provision_02.png|thumb|500px|center|Provisioning a Xen domU - Naming the VM and choosing the install source]&lt;br /&gt;
&lt;br /&gt;
=== Storing The domU Configuration Files ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;ToDo&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Node1&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
As this is our first [[domU]], we&#039;ll start by creating our shared configuration directory on the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/xen_shared&amp;lt;/span&amp;gt; [[GFS2]] partition we just created.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
mkdir /xen_shared/config&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To confirm again that the GFS2 partition is working, verify that this directory is visible from both nodes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ls -lah /xen_shared/&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
total 20K&lt;br /&gt;
drwxr-xr-x.  3 root root 3.8K Sep 13 12:57 .&lt;br /&gt;
dr-xr-xr-x. 27 root root 4.0K Sep 13 11:32 ..&lt;br /&gt;
drwxr-xr-x.  2 root root 3.8K Sep 13 12:57 config&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{footer}}&lt;/div&gt;</summary>
		<author><name>SRSullivan</name></author>
	</entry>
	<entry>
		<id>https://alteeve.com/w/index.php?title=Two_Node_Fedora_13_Cluster_-_Xen-Based_Virtual_Machine_Host_on_DRBD%2BCLVM&amp;diff=2288</id>
		<title>Two Node Fedora 13 Cluster - Xen-Based Virtual Machine Host on DRBD+CLVM</title>
		<link rel="alternate" type="text/html" href="https://alteeve.com/w/index.php?title=Two_Node_Fedora_13_Cluster_-_Xen-Based_Virtual_Machine_Host_on_DRBD%2BCLVM&amp;diff=2288"/>
		<updated>2010-10-13T19:51:14Z</updated>

		<summary type="html">&lt;p&gt;SRSullivan: /* Adding New NICs to Xen */  Clarity about eth1&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{howto_header}}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Warning&#039;&#039;&#039;: This is currently a dumping ground for notes. &#039;&#039;&#039;&#039;&#039;DO NOT FOLLOW THIS DOCUMENT&#039;S INSTRUCTIONS&#039;&#039;&#039;&#039;&#039;. Seriously, it could blow up your computer or cause winter to come early.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
This HowTo will walk you through setting up [[Xen]] [[VM]]s using [[DRBD]] and [[CLVM]] for high availability.&lt;br /&gt;
&lt;br /&gt;
= Prerequisite =&lt;br /&gt;
&lt;br /&gt;
This talk is an extension of the [[Two Node Fedora 13 Cluster]] HowTo. As such, you will be expected to have a freshly built two-node cluster with spare disk space on either node.&lt;br /&gt;
&lt;br /&gt;
Please do not proceed until you have completed the first tutorial.&lt;br /&gt;
&lt;br /&gt;
= Overview =&lt;br /&gt;
&lt;br /&gt;
This tutorial will cover several topics; [[DRBD]], [[CLVM]], [[GFS2]], [[Xen]] [[dom0]] and [[domU]] [[VM]]s and [[rgmanager]]. Their relationship is thus:&lt;br /&gt;
&lt;br /&gt;
* DRBD provides a mechanism to replicate data across both nodes in real time and guarantees a consistent view of that data from either node. Think of it like [[TLUG_Talk:_Storage_Technologies_and_Theory#Level_1|RAID level 1]], but across machines.&lt;br /&gt;
* CLVM sits on the DRBD partition and provides the underlying mechanism for allowing both nodes to access shared data in a clustered environment. It will host a shared filesystem by way of GFS2 as well as [[LV]]s that Xen&#039;s domU VMs will use as their disk space.&lt;br /&gt;
* GFS2 will be the clustered file system used on one of the DBRD-backed, CLVM-managed partitions. Files that need to be shared between nodes, like the Xen VM configuration files, will exist on this partition.&lt;br /&gt;
* Xen will be the hypervisor in use that will manage the various virtual machines. Each virtual machine will exist in an LVM LV.&lt;br /&gt;
** Xen&#039;s dom0 is the special &amp;quot;host&amp;quot; virtual machine. In this case, dom0 will be the OS installed in the first HowTo.&lt;br /&gt;
** Xen&#039;s domU virtual machines will be the &amp;quot;floating&amp;quot;, highly available servers.&lt;br /&gt;
* Lastly, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; will be the component of [[cman]] that will be configured to manage the automatic migration of the virtual machines when failures occur and when nodes recover.&lt;br /&gt;
&lt;br /&gt;
= Setting Up Xen =&lt;br /&gt;
&lt;br /&gt;
It may seem odd to start with [[Xen]] at this stage, but it is going to rather fundamentally alter each node&#039;s &amp;quot;host&amp;quot; operating system.&lt;br /&gt;
&lt;br /&gt;
At this point, each node&#039;s host OS is a traditional operating system operating on the bare metal. When we install a &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;dom0&amp;lt;/span&amp;gt; kernel though, we tell Xen to boot a mini operating system first, and then to boot our &amp;quot;host&amp;quot; operating system. In effect, this converts the host node&#039;s operating system into just another virtual machine, albeit with a special view of the underlying hardware and Xen hypervisor.&lt;br /&gt;
&lt;br /&gt;
This conversion is somewhat disruptive, so I like to get it out of the way right away. We will then do the rest of the setup before returning to Xen later on to create the floating virtual machines.&lt;br /&gt;
&lt;br /&gt;
== A Note On The State Of Xen dom0 Support In Fedora ==&lt;br /&gt;
&lt;br /&gt;
As of Fedora 8, support for Xen [[dom0]] has been removed, but support for the hypervisor and [[domU]] virtual machines remains. Red Hat&#039;s position is that KVM will be the supported platform going forward. That said, [http://fedoraproject.org/wiki/Features/XenPvopsDom0 this page] seems to indicate that PV Ops dom0 kernels will be supported in the future. Specifically, when dom0 support is merged into the mainline Linux kernel. When this will be is open to speculation, though &amp;quot;by Fedora 16&amp;quot; seems to be a reasonable educated guess.&lt;br /&gt;
&lt;br /&gt;
What this means for us is that we need to use a non-standard dom0 kernel. Specifically, we will use a kernel created by [http://myoung.fedorapeople.org/ myoung] (Micheal Young) for Fedora 12. This kernel does not directly support DRBD, so be aware that we will need to build new DRBD kernel modules for his kernel and then rebuild the DRBD modules each time his kernel is updated.&lt;br /&gt;
&lt;br /&gt;
== A Note On Rolling Your Own RPMs ==&lt;br /&gt;
&lt;br /&gt;
If you want to roll the source RPMs for both the hypervisor and the [[dom0]] kernel, you will need to make both before you can boot into your dom0 for the first time. This is because the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;dom0&amp;lt;/span&amp;gt; kernel needs the Xen microkernel provided by the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xen&amp;lt;/span&amp;gt; hypervisor package to boot.&lt;br /&gt;
&lt;br /&gt;
== Install The Hypervisor ==&lt;br /&gt;
&lt;br /&gt;
We will use [[Xen]] 4.0.1, as provided by [http://pasik.reaktio.net/fedora/ Pasik]. We&#039;ll use the [http://pasik.reaktio.net/fedora/xen-4.0.1-0.2.fc13.src.rpm source RPM] to build our own RPM.&lt;br /&gt;
&lt;br /&gt;
Regardless of whether you install from source RPMs or the pre-compiled ones, you will need to install the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;libvirt&amp;lt;/span&amp;gt;, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;qemu&amp;lt;/span&amp;gt;, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;SDL&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;PyXML&amp;lt;/span&amp;gt; packages from the standard repositories before you can proceed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum -y install libvirt PyXML.x86_64 qemu.x86_64 SDL.x86_64&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Please don&#039;t remove existing &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xen&amp;lt;/span&amp;gt; utilities and libraries prior to installing the newer version. If you do, core clustering components may be removed. Instead, be sure to use the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rpm -Uvh&amp;lt;/span&amp;gt; switches to upgrade the existing packages that may be installed already.&lt;br /&gt;
&lt;br /&gt;
=== Installing Prebuilt RPMs ===&lt;br /&gt;
&lt;br /&gt;
These are locally stored copies of the Xen RPMs built for [[x86_64]] on Fedora 13. This requires some dependent packages be installed first.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Warning&#039;&#039;&#039;: These are all recompiled for this website against Fedora 13, x86_64. If you feel more comfortable, please use [[RPM]]s from a source you are familiar with.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cd ~&lt;br /&gt;
wget -c https://alteeve.com/files/an-cluster/xen-4.0.1-0.2.fc13.x86_64.rpm&lt;br /&gt;
wget -c https://alteeve.com/files/an-cluster/xen-doc-4.0.1-0.2.fc13.x86_64.rpm&lt;br /&gt;
wget -c https://alteeve.com/files/an-cluster/xen-hypervisor-4.0.1-0.2.fc13.x86_64.rpm&lt;br /&gt;
wget -c https://alteeve.com/files/an-cluster/xen-libs-4.0.1-0.2.fc13.x86_64.rpm&lt;br /&gt;
wget -c https://alteeve.com/files/an-cluster/xen-runtime-4.0.1-0.2.fc13.x86_64.rpm&lt;br /&gt;
rpm -Uvh xen*4.0.1-0.2.fc13.x86_64.rpm&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Optionally, you may wish to install &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;debug&amp;lt;/span&amp;gt; and/or &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;devel&amp;lt;/span&amp;gt; RPMs as well.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
wget -c https://alteeve.com/files/xen-debuginfo-4.0.1-0.2.fc13.x86_64.rpm&lt;br /&gt;
wget -c https://alteeve.com/files/xen-devel-4.0.1-0.2.fc13.x86_64.rpm&lt;br /&gt;
rpm -Uvh xen-d*4.0.1-0.2.fc13.x86_64.rpm&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Building RPMs From Source ===&lt;br /&gt;
&lt;br /&gt;
To build the RPMs from the source, you need to make sure that you have the build environment installed. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: If you are following these instruction after having installed a prior dom0 kernel, you will need to comment out &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;exclude=kernel*&amp;lt;/span&amp;gt; in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/yum.conf&amp;lt;/span&amp;gt; so that the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;kernel-header&amp;lt;/span&amp;gt; package can be installed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/yum.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
# PUT YOUR REPOS HERE OR IN separate files named file.repo&lt;br /&gt;
# in /etc/yum.repos.d&lt;br /&gt;
#exclude=kernel*&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now install the development environment.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum -y groupinstall &amp;quot;Development Libraries&amp;quot;&lt;br /&gt;
yum -y groupinstall &amp;quot;Development Tools&amp;quot;&lt;br /&gt;
yum install transfig texi2html SDL-devel libX11-devel tetex-latex gtk2-devel libaio-devel dev86 iasl xz-devel e2fsprogs-devel glibc-devel.i686 xmlto asciidoc elfutils-libelf-devel&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: If you had to uncomment the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;exclude=kernel*&amp;lt;/span&amp;gt; line earlier, comment it back out now before you forget.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/yum.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
# PUT YOUR REPOS HERE OR IN separate files named file.repo&lt;br /&gt;
# in /etc/yum.repos.d&lt;br /&gt;
exclude=kernel*&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we can now build the RPMs from source.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cd ~&lt;br /&gt;
wget -c https://alteeve.com/files/an-cluster/xen-4.0.1-0.2.fc13.src.rpm&lt;br /&gt;
rpm -ivh xen-4.0.1-0.2.fc13.src.rpm&lt;br /&gt;
cd /root/rpmbuild/SPECS/&lt;br /&gt;
rpmbuild -ba xen.spec&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once this is done, you will have seven RPMs built. Two of them are not really needed (&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xen-debuginfo-4.0.1-0.2.fc13.x86_64.rpm&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xen-devel-4.0.1-0.2.fc13.x86_64.rpm&amp;lt;/span&amp;gt;) and I will leave it up to you may wish to install them or not. If you don&#039;t, modify the next command or move the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;debug&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;devel&amp;lt;/span&amp;gt; RPMs out of the way first.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cd ~/rpmbuild/RPMS/x86_64/&lt;br /&gt;
rpm -Uvh xen*4.0.1-0.2.fc13.x86_64.rpm&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Installing The AN!Cluster dom0 Kernel ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Notice&#039;&#039;&#039;!&lt;br /&gt;
&lt;br /&gt;
The kernel provided here was recompiled on Fedora 13 and is a slightly modified version of [[#Installing Micheal Young&#039;s dom0 Kernel|Micheal Young&#039;s]] kernel available below. I was originally driven to recompile in an effort to solve a DRBD-related kernel oops. For now, unless you have the same DRBD kernel oops, I&#039;d strongly recommend against using the AN!Cluster dom0 kernel until it has been tested much more thoroughly.&lt;br /&gt;
&lt;br /&gt;
With that warning out of the way...&lt;br /&gt;
&lt;br /&gt;
This kernel was compiled on a Fedora 13, x86_64. The DRBD RPMs available a little later where compiled against this dom0 kernel. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--force&amp;lt;/span&amp;gt; is required because the current kernel is newer than &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;2.6.32&amp;lt;/span&amp;gt; used here. Without this switch, the RPM would not install.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cd ~&lt;br /&gt;
wget -c https://alteeve.com/files/an-cluster/kernel-2.6.32.23-170.dom0_an1.fc13.x86_64.rpm&lt;br /&gt;
rpm -ivh --force kernel-2.6.32.23-170.dom0_an1.fc13.x86_64.rpm&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you would like to install the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;debug&amp;lt;/span&amp;gt;, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;devel&amp;lt;/span&amp;gt; and/or &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;header&amp;lt;/span&amp;gt; RPMs for this kernel, they are available below.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;kernel-debuginfo-2.6.32.23-170.dom0_an1.fc13.x86_64.rpm&amp;lt;/span&amp;gt; RPM is 213 [[MiB]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
wget -c https://alteeve.com/files/an-cluster/kernel-2.6.32.23-170.dom0_an1.fc13.x86_64.rpm&lt;br /&gt;
wget -c https://alteeve.com/files/an-cluster/kernel-debuginfo-2.6.32.23-170.dom0_an1.fc13.x86_64.rpm&lt;br /&gt;
wget -c https://alteeve.com/files/an-cluster/kernel-devel-2.6.32.23-170.dom0_an1.fc13.x86_64.rpm&lt;br /&gt;
wget -c https://alteeve.com/files/an-cluster/kernel-headers-2.6.32.23-170.dom0_an1.fc13.x86_64.rpm&lt;br /&gt;
rpm -ivh --force kernel-de*-2.6.32.23-170.dom0_an1.fc13.x86_64.rpm kernel-headers-2.6.32.23-170.dom0_an1.fc13.x86_64.rpm&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Post AN!Cluster dom0 Install Configuration ===&lt;br /&gt;
&lt;br /&gt;
The entry in grub&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/boot/grub/menu.lst&amp;lt;/span&amp;gt; won&#039;t work. You will need to edit it so that it calls the existing installed operating system as a &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;module&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: Copy and modify the entry created by the RPM. Simply copying this entry will almost certainly not work! Your &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;root=&amp;lt;/span&amp;gt; is likely different and your &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rd_MD_UUID=&amp;lt;/span&amp;gt; will definitely be different, even on the same machine across installs. Generally speaking, what follows the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;kernel /vmlinuz-2.6.32.23-170.dom0_an1.fc13.x86_64 ...&amp;lt;/span&amp;gt; entry made by the dom0 kernel can be copied after the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;module /vmlinuz-2.6.32.23-170.dom0_an1.fc13.x86_64 ...&amp;lt;/span&amp;gt; entry in the example below.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /boot/grub/menu.lst&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
title Xen 4.0.x, Linux 2.6.32.23-170.dom0_an1.fc13.x86_64&lt;br /&gt;
        root   (hd0,0)&lt;br /&gt;
        kernel /xen.gz dom0_mem=1024M&lt;br /&gt;
        module /vmlinuz-2.6.32.23-170.dom0_an1.fc13.x86_64 ...&lt;br /&gt;
        module /initramfs-2.6.32.23-170.dom0_an1.fc13.x86_64.img&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Installing Micheal Young&#039;s dom0 Kernel ==&lt;br /&gt;
&lt;br /&gt;
This uses a kernel built for Fedora 12, but it works on Fedora 13. This step involves either installing it over HTML or adding and enabling his repository and then installing it from there.&lt;br /&gt;
&lt;br /&gt;
=== Installing Via myoung&#039;s Repository ===&lt;br /&gt;
&lt;br /&gt;
This is almost always the preferred method. However, do note that when myoung updates his kernel, there will be a lag where the dom0 dependent RPMs provided here will no longer be compatible.&lt;br /&gt;
&lt;br /&gt;
To add the repository, download the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;myoung.dom0.repo&amp;lt;/span&amp;gt; into the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/yum.repos.d/&amp;lt;/span&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cd /etc/yum.repos.d/&lt;br /&gt;
wget -c http://myoung.fedorapeople.org/dom0/myoung.dom0.repo&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To enable his repository, edit the repository file and change the two &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;enabled=0&amp;lt;/span&amp;gt; entries to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;enabled=1&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/yum.repos.d/myoung.dom0.repo&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
[myoung-dom0]&lt;br /&gt;
name=myoung&#039;s repository of Fedora based dom0 kernels - $basearch&lt;br /&gt;
baseurl=http://fedorapeople.org/~myoung/dom0/$basearch/&lt;br /&gt;
enabled=1&lt;br /&gt;
gpgcheck=0&lt;br /&gt;
&lt;br /&gt;
[myoung-dom0-source]&lt;br /&gt;
name=myoung&#039;s repository of Fedora based dom0 kernels - Source&lt;br /&gt;
baseurl=http://fedorapeople.org/~myoung/dom0/src/&lt;br /&gt;
enabled=1&lt;br /&gt;
gpgcheck=0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Install the [[Xen]] [[dom0]] kernel (edit the version number with the updated version if it has changed).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install kernel-2.6.32.21-170.xendom0.fc12.x86_64&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Post Michael Young&#039;s dom0 Install Configuration ===&lt;br /&gt;
&lt;br /&gt;
The entry in grub&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/boot/grub/menu.lst&amp;lt;/span&amp;gt; won&#039;t work. You will need to edit it so that it calls the existing installed operating system as a &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;module&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: Copy and modify the entry created by the RPM. Simply copying this entry will almost certainly not work! Your &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;root=&amp;lt;/span&amp;gt; is likely different and your &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rd_MD_UUID=&amp;lt;/span&amp;gt; will definitely be different, even on the same machine across installs. Generally speaking, what follows the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;kernel /vmlinuz-2.6.32.21-170.xendom0.fc12.x86_64 ...&amp;lt;/span&amp;gt; entry made by the dom0 kernel can be copied after the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;module /vmlinuz-2.6.32.21-170.xendom0.fc12.x86_64 ...&amp;lt;/span&amp;gt; entry in the example below.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /boot/grub/menu.lst&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
title Xen 4.0.x, Linux kernel 2.6.32.21-170.xendom0.fc12.x86_64&lt;br /&gt;
	root   (hd0,0)&lt;br /&gt;
	kernel /xen.gz dom0_mem=1024M&lt;br /&gt;
	module /vmlinuz-2.6.32.21-170.xendom0.fc12.x86_64 ...&lt;br /&gt;
	module /initramfs-2.6.32.21-170.xendom0.fc12.x86_64.img&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Disabling Automatic Kernel Updates ===&lt;br /&gt;
&lt;br /&gt;
Seeing as we&#039;re using an older kernel, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;yum&amp;lt;/span&amp;gt; will want to replace it whenever there is an updated &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;kernel*&amp;lt;/span&amp;gt; package available. Likewise if myoung updates his kernel. In the latter case, the updated kernel from Mr. Young would break compatibility with our DRBD module. So to be safe, we want to tell &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;yum&amp;lt;/span&amp;gt; to never update the kernel.&lt;br /&gt;
&lt;br /&gt;
To do this, we need to add &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;exclude=kernel*&amp;lt;/span&amp;gt; to the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/yum.conf&amp;lt;/span&amp;gt; file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
echo &amp;quot;exclude=kernel*&amp;quot; &amp;gt;&amp;gt; /etc/yum.conf&lt;br /&gt;
cat /etc/yum.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
[main]&lt;br /&gt;
cachedir=/var/cache/yum/$basearch/$releasever&lt;br /&gt;
keepcache=0&lt;br /&gt;
debuglevel=2&lt;br /&gt;
logfile=/var/log/yum.log&lt;br /&gt;
exactarch=1&lt;br /&gt;
obsoletes=1&lt;br /&gt;
gpgcheck=1&lt;br /&gt;
plugins=1&lt;br /&gt;
installonly_limit=3&lt;br /&gt;
color=never&lt;br /&gt;
&lt;br /&gt;
#  This is the default, if you make this bigger yum won&#039;t see if the metadata&lt;br /&gt;
# is newer on the remote and so you&#039;ll &amp;quot;gain&amp;quot; the bandwidth of not having to&lt;br /&gt;
# download the new metadata and &amp;quot;pay&amp;quot; for it by yum not having correct&lt;br /&gt;
# information.&lt;br /&gt;
#  It is esp. important, to have correct metadata, for distributions like&lt;br /&gt;
# Fedora which don&#039;t keep old packages around. If you don&#039;t like this checking&lt;br /&gt;
# interupting your command line usage, it&#039;s much better to have something&lt;br /&gt;
# manually check the metadata once an hour (yum-updatesd will do this).&lt;br /&gt;
# metadata_expire=90m&lt;br /&gt;
&lt;br /&gt;
# PUT YOUR REPOS HERE OR IN separate files named file.repo&lt;br /&gt;
# in /etc/yum.repos.d&lt;br /&gt;
&lt;br /&gt;
exclude=kernel*&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Make xend play nice with clustering ===&lt;br /&gt;
&lt;br /&gt;
By default under Fedora 13, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt; will start before &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xend&amp;lt;/span&amp;gt;. This is a problem because &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xend&amp;lt;/span&amp;gt; takes the network down as part of it&#039;s setup. This causes [[totem]] communication to fail which leads to fencing.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: Move &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xenconsoled&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xenstore&amp;lt;/span&amp;gt; to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;09&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;10&amp;lt;/span&amp;gt; start positions and then make &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xend&amp;lt;/span&amp;gt; depend on the before starting.&lt;br /&gt;
&lt;br /&gt;
To avoid this, edit the initialization scripts for &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/init.d/xend&amp;lt;/span&amp;gt; and it&#039;s dependents &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xenconsoled&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xenstore&amp;lt;/span&amp;gt; to have a lower minimum start position. We need to maintain the start order of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xenstore&amp;lt;/span&amp;gt; first, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xenconsoled&amp;lt;/span&amp;gt; second and lastly &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xend&amp;lt;/span&amp;gt;. By default, their minimum start positions are &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;96&amp;lt;/span&amp;gt;, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;97&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;98&amp;lt;/span&amp;gt; respectively. We will change these to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;10&amp;lt;/span&amp;gt;, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;11&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;12&amp;lt;/span&amp;gt;, again, respectively.&lt;br /&gt;
&lt;br /&gt;
Note that we are &#039;&#039;&#039;not&#039;&#039;&#039; altering the start position of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xendomains&amp;lt;/span&amp;gt;! This is intentional as this daemon will start the [[domU]] VMs. This can not happen until all other cluster related daemons have started.&lt;br /&gt;
&lt;br /&gt;
To change the start order we will change the line &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;chkconfig: 2345 9x 01&amp;lt;/span&amp;gt; lines to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;chkconfig: 2345 1x 01&amp;lt;/span&amp;gt;, where &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;x&amp;lt;/span&amp;gt; is the given daemon&#039;s start number. Further, we&#039;ll make sure that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xenstored&amp;lt;/span&amp;gt; begins first by add it to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xenconsoled&amp;lt;/span&amp;gt;&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Required-Start&amp;lt;/span&amp;gt; line. We&#039;ll then make sure that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xenconsoled&amp;lt;/span&amp;gt; starts before &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xend&amp;lt;/span&amp;gt; by adding it to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xend&amp;lt;/span&amp;gt;&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Required-Start&amp;lt;/span&amp;gt; line.&lt;br /&gt;
&lt;br /&gt;
To recap the changes;&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xenstored&amp;lt;/span&amp;gt; will start first.&lt;br /&gt;
** We&#039;ll change it&#039;s start position from &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;96&amp;lt;/span&amp;gt; to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;10&amp;lt;/span&amp;gt;.&lt;br /&gt;
** We will not add anything to it&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Required-Start&amp;lt;/span&amp;gt; as it must be the first daemon to come up.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xenconsoled&amp;lt;/span&amp;gt; will start second.&lt;br /&gt;
** We&#039;ll change it&#039;s start position from &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;97&amp;lt;/span&amp;gt; to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;11&amp;lt;/span&amp;gt;.&lt;br /&gt;
** We will add &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xenstored&amp;lt;/span&amp;gt; to it&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Required-Start&amp;lt;/span&amp;gt; line.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xend&amp;lt;/span&amp;gt; will start third.&lt;br /&gt;
** We&#039;ll change it&#039;s start position from &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;98&amp;lt;/span&amp;gt; to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;12&amp;lt;/span&amp;gt;.&lt;br /&gt;
** We will add &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xenconsoled&amp;lt;/span&amp;gt; to it&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Required-Start&amp;lt;/span&amp;gt; line.&lt;br /&gt;
&lt;br /&gt;
When done, the three initialization scripts should look like the examples below.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/init.d/xenstored&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
#&lt;br /&gt;
# xenstored     Script to start and stop the Xen control daemon.&lt;br /&gt;
#&lt;br /&gt;
# Author:       Daniel Berrange &amp;lt;berrange@redhat.com&lt;br /&gt;
#&lt;br /&gt;
# chkconfig: 2345 10 01&lt;br /&gt;
# description: Starts and stops the Xen xenstored daemon.&lt;br /&gt;
### BEGIN INIT INFO&lt;br /&gt;
# Provides:          xenstored&lt;br /&gt;
# Required-Start:    $syslog $remote_fs&lt;br /&gt;
# Should-Start:&lt;br /&gt;
# Required-Stop:     $syslog $remote_fs&lt;br /&gt;
# Should-Stop:&lt;br /&gt;
# Default-Start:     3 4 5&lt;br /&gt;
# Default-Stop:      0 1 2 6&lt;br /&gt;
# Default-Enabled:   yes&lt;br /&gt;
# Short-Description: Start/stop xenstored&lt;br /&gt;
# Description:       Starts and stops the Xen xenstored daemon.&lt;br /&gt;
### END INIT INFO&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/init.d/xenconsoled&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
#&lt;br /&gt;
# xenconsoled   Script to start and stop the Xen xenconsoled daemon&lt;br /&gt;
#&lt;br /&gt;
# Author:       Daniel P. Berrange &amp;lt;berrange@redhat.com&amp;gt;&lt;br /&gt;
#&lt;br /&gt;
# chkconfig: 2345 11 01&lt;br /&gt;
# description: Starts and stops the Xen control daemon.&lt;br /&gt;
### BEGIN INIT INFO&lt;br /&gt;
# Provides:          xenconsoled&lt;br /&gt;
# Required-Start:    $syslog $remote_fs xenstored&lt;br /&gt;
# Should-Start:&lt;br /&gt;
# Required-Stop:     $syslog $remote_fs&lt;br /&gt;
# Should-Stop:&lt;br /&gt;
# Default-Start:     3 4 5&lt;br /&gt;
# Default-Stop:      0 1 2 6&lt;br /&gt;
# Default-Enabled:   yes&lt;br /&gt;
# Short-Description: Start/stop xenconsoled&lt;br /&gt;
# Description:       Starts and stops the Xen xenconsoled daemon.&lt;br /&gt;
### END INIT INFO&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/init.d/xend&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
#&lt;br /&gt;
# xend          Script to start and stop the Xen control daemon.&lt;br /&gt;
#&lt;br /&gt;
# Author:       Keir Fraser &amp;lt;keir.fraser@cl.cam.ac.uk&amp;gt;&lt;br /&gt;
#&lt;br /&gt;
# chkconfig: 2345 12 98&lt;br /&gt;
# description: Starts and stops the Xen control daemon.&lt;br /&gt;
### BEGIN INIT INFO&lt;br /&gt;
# Provides:          xend&lt;br /&gt;
# Required-Start:    $syslog $remote_fs xenconsoled&lt;br /&gt;
# Should-Start:&lt;br /&gt;
# Required-Stop:     $syslog $remote_fs&lt;br /&gt;
# Should-Stop:&lt;br /&gt;
# Default-Start:     3 4 5&lt;br /&gt;
# Default-Stop:      0 1 2 6&lt;br /&gt;
# Default-Enabled:   yes&lt;br /&gt;
# Short-Description: Start/stop xend&lt;br /&gt;
# Description:       Starts and stops the Xen control daemon.&lt;br /&gt;
### END INIT INFO&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xend&amp;lt;/span&amp;gt; set to start at a position lower than &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;98&amp;lt;/span&amp;gt;, we now have room for &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;chkconfig&amp;lt;/span&amp;gt; to put other daemons after it in the start order, which will be needed a little later. First and foremost, we now need to tell &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt; to not start until after &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xend&amp;lt;/span&amp;gt; is up.&lt;br /&gt;
&lt;br /&gt;
As above, we will now edit &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt;&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/init.d/cman&amp;lt;/span&amp;gt; script. This time though, we will not edit it&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;chkconfig&amp;lt;/span&amp;gt; line. Instead, we will simply add &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xend&amp;lt;/span&amp;gt; to the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Required-Start&amp;lt;/span&amp;gt; line.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/init.d/cman&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
#&lt;br /&gt;
# cman - Cluster Manager init script&lt;br /&gt;
#&lt;br /&gt;
# chkconfig: - 21 79&lt;br /&gt;
# description: Starts and stops cman&lt;br /&gt;
#&lt;br /&gt;
#&lt;br /&gt;
### BEGIN INIT INFO&lt;br /&gt;
# Provides:             cman&lt;br /&gt;
# Required-Start:       $network $time xend&lt;br /&gt;
# Required-Stop:        $network $time&lt;br /&gt;
# Default-Start:&lt;br /&gt;
# Default-Stop:&lt;br /&gt;
# Short-Description:    Starts and stops cman&lt;br /&gt;
# Description:          Starts and stops the Cluster Manager set of daemons&lt;br /&gt;
### END INIT INFO&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Finally, remove and re-add the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xend&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt; daemons to re-order them in the start list:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
chkconfig xenstored off; chkconfig xenconsoled off; chkconfig xend off; chkconfig cman off; &lt;br /&gt;
chkconfig xenstored on; chkconfig xenconsoled on; chkconfig xend on; chkconfig cman on&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Confirm that the order has changed so that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xend&amp;lt;/span&amp;gt; is earlier in the boot sequence than &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt;. Assuming you&#039;ve switched to run-level 3, run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ls -lah /etc/rc3.d/&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Your start sequence should now look like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
lrwxrwxrwx.  1 root root   19 Sep 15 19:29 S26xenstored -&amp;gt; ../init.d/xenstored&lt;br /&gt;
lrwxrwxrwx.  1 root root   21 Sep 15 19:29 S27xenconsoled -&amp;gt; ../init.d/xenconsoled&lt;br /&gt;
lrwxrwxrwx.  1 root root   14 Sep 15 19:29 S28xend -&amp;gt; ../init.d/xend&lt;br /&gt;
lrwxrwxrwx.  1 root root   14 Sep 15 19:29 S29cman -&amp;gt; ../init.d/cman&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Booting Into The New dom0 ===&lt;br /&gt;
&lt;br /&gt;
If everything went well, you should be able to boot the new dom0 operating system. If you watch the boot process closely, you will see that the boot process is different. You should now see the Xen hypervisor boot prior to handing off to the &amp;quot;host&amp;quot; operating system. This can be confirmed once the dom0 operating system has booted by checking that the file &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/proc/xen/capabilities&amp;lt;/span&amp;gt; exists. What it contains doesn&#039;t matter at this stage, only that it exists at all.&lt;br /&gt;
&lt;br /&gt;
== Configure Networking ==&lt;br /&gt;
&lt;br /&gt;
Networking in Xen, particularly in a cluster, can be confusing. If you are not familiar with networking in Xen, please review to following article before proceeding.&lt;br /&gt;
&lt;br /&gt;
A note of a major change from previous layouts. In Xen 3.x, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ethX&amp;lt;/span&amp;gt; would be copied to a virtual interface called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vethX&amp;lt;/span&amp;gt;. Then the real &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ethX&amp;lt;/span&amp;gt; would be renamed to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;pethX&amp;lt;/span&amp;gt; and the virtual interface &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vethX&amp;lt;/span&amp;gt; would be renamed to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ethX&amp;lt;/span&amp;gt; to take it&#039;s place. Finally, a bridge called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xenbrX&amp;lt;/span&amp;gt; would be created and the real &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;pethX&amp;lt;/span&amp;gt; and virtual &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ethX&amp;lt;/span&amp;gt; would be connected to it.&lt;br /&gt;
&lt;br /&gt;
This has been changed somewhat it that now, by default, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ethX&amp;lt;/span&amp;gt; is left alone and a simple bridge called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virbrX&amp;lt;/span&amp;gt; would be created. We&#039;ll be changing this to be somewhat similar to the old style.&lt;br /&gt;
&lt;br /&gt;
Specifically, the real &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ethX&amp;lt;/span&amp;gt; will be renamed to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;pethX&amp;lt;/span&amp;gt;. Then a bridge will be created called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ethX&amp;lt;/span&amp;gt;, which plays the role of dom0&#039;s interface &#039;&#039;&#039;and&#039;&#039;&#039; bridges connections from VMs through &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;pethX&amp;lt;/span&amp;gt; and out into the real world.&lt;br /&gt;
&lt;br /&gt;
This is explained in more detail, and with diagrams, in the article below.&lt;br /&gt;
&lt;br /&gt;
* [[Networking in Xen]]&lt;br /&gt;
&lt;br /&gt;
=== Adding New NICs to Xen ===&lt;br /&gt;
&lt;br /&gt;
By default, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xend&amp;lt;/span&amp;gt; manages &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth0&amp;lt;/span&amp;gt; only. We need to add &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth2&amp;lt;/span&amp;gt;. Personally, I don&#039;t like to put the storage network ethernet devices (eth1) under Xen&#039;s control as this potentially can cause DRBD problems on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xend&amp;lt;/span&amp;gt; restart. Whether you add it or not I will leave to your preferences.&lt;br /&gt;
&lt;br /&gt;
You can see which, if any, network devices are under Xen&#039;s control by running &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ifconfig&amp;lt;/span&amp;gt; and checking to see if there is a &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virbrX&amp;lt;/span&amp;gt; corresponding to a given &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ethX&amp;lt;/span&amp;gt; device.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ifconfig&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
eth0      Link encap:Ethernet  HWaddr 48:5B:39:3C:53:14  &lt;br /&gt;
          inet addr:192.168.1.74  Bcast:192.168.1.255  Mask:255.255.255.0&lt;br /&gt;
          inet6 addr: fe80::4a5b:39ff:fe3c:5314/64 Scope:Link&lt;br /&gt;
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1&lt;br /&gt;
          RX packets:224261 errors:0 dropped:0 overruns:0 frame:0&lt;br /&gt;
          TX packets:55174 errors:0 dropped:0 overruns:0 carrier:0&lt;br /&gt;
          collisions:0 txqueuelen:1000 &lt;br /&gt;
          RX bytes:319384110 (304.5 MiB)  TX bytes:27348739 (26.0 MiB)&lt;br /&gt;
          Interrupt:225 Base address:0x8000 &lt;br /&gt;
&lt;br /&gt;
eth1      Link encap:Ethernet  HWaddr 00:1B:21:72:9B:5A  &lt;br /&gt;
          inet addr:192.168.2.74  Bcast:192.168.2.255  Mask:255.255.255.0&lt;br /&gt;
          inet6 addr: fe80::21b:21ff:fe72:9b5a/64 Scope:Link&lt;br /&gt;
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1&lt;br /&gt;
          RX packets:2 errors:0 dropped:0 overruns:0 frame:0&lt;br /&gt;
          TX packets:36 errors:0 dropped:0 overruns:0 carrier:0&lt;br /&gt;
          collisions:0 txqueuelen:1000 &lt;br /&gt;
          RX bytes:832 (832.0 b)  TX bytes:6234 (6.0 KiB)&lt;br /&gt;
          Memory:feae0000-feb00000 &lt;br /&gt;
&lt;br /&gt;
eth2      Link encap:Ethernet  HWaddr 00:1B:21:72:96:EA  &lt;br /&gt;
          inet addr:192.168.3.74  Bcast:192.168.3.255  Mask:255.255.255.0&lt;br /&gt;
          inet6 addr: fe80::21b:21ff:fe72:96ea/64 Scope:Link&lt;br /&gt;
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1&lt;br /&gt;
          RX packets:2 errors:0 dropped:0 overruns:0 frame:0&lt;br /&gt;
          TX packets:34 errors:0 dropped:0 overruns:0 carrier:0&lt;br /&gt;
          collisions:0 txqueuelen:1000 &lt;br /&gt;
          RX bytes:818 (818.0 b)  TX bytes:6081 (5.9 KiB)&lt;br /&gt;
          Memory:fe9e0000-fea00000 &lt;br /&gt;
&lt;br /&gt;
lo        Link encap:Local Loopback  &lt;br /&gt;
          inet addr:127.0.0.1  Mask:255.0.0.0&lt;br /&gt;
          inet6 addr: ::1/128 Scope:Host&lt;br /&gt;
          UP LOOPBACK RUNNING  MTU:16436  Metric:1&lt;br /&gt;
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0&lt;br /&gt;
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0&lt;br /&gt;
          collisions:0 txqueuelen:0 &lt;br /&gt;
          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)&lt;br /&gt;
&lt;br /&gt;
virbr0    Link encap:Ethernet  HWaddr 02:23:C8:98:31:17  &lt;br /&gt;
          inet addr:192.168.122.1  Bcast:192.168.122.255  Mask:255.255.255.0&lt;br /&gt;
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1&lt;br /&gt;
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0&lt;br /&gt;
          TX packets:15 errors:0 dropped:0 overruns:0 carrier:0&lt;br /&gt;
          collisions:0 txqueuelen:0 &lt;br /&gt;
          RX bytes:0 (0.0 b)  TX bytes:4013 (3.9 KiB)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the above example, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth0&amp;lt;/span&amp;gt; has a corresponding &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virbr0&amp;lt;/span&amp;gt; bridge having it&#039;s own subnet. In non-clustered systems, this is fine. For our purposes though, it will not do.&lt;br /&gt;
&lt;br /&gt;
=== Removing The qemu virbr0 Bridge ===&lt;br /&gt;
&lt;br /&gt;
By default, [[QEMU]] creates a bridge called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virbr0&amp;lt;/span&amp;gt; designed to connect virtual machines to the first &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth0&amp;lt;/span&amp;gt; interface. Our system will not need this, so we will remove it. This bridge is configured in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/libvirt/qemu/networks/default.xml&amp;lt;/span&amp;gt; file, so to remove this bridge, simply delete the contents of the file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cat /dev/null &amp;gt;/etc/libvirt/qemu/networks/default.xml&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The next time you reboot, that bridge will be gone.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Madi&#039;&#039;&#039;: Put in the command to delete the bridge before a reboot.&lt;br /&gt;
&lt;br /&gt;
=== Create /etc/xen/scripts/an-network-script ===&lt;br /&gt;
&lt;br /&gt;
This script will be used by Xen to turn the dom0 &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ethX&amp;lt;/span&amp;gt; interfaces into bridges. All traffic to the bridge, be it from dom0 or domU VMs, will be routeable out of the corresponding &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;pethX&amp;lt;/span&amp;gt; device. As domU VMs come online, a hotplug script will create virtual interfaces between this new bridge and the domU&#039;s interface(s). Think of the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vifX.Y&amp;lt;/span&amp;gt; devices as being the network cables you&#039;d normally run between a server and a switch.&lt;br /&gt;
&lt;br /&gt;
Before we proceed, please note three things;&lt;br /&gt;
# You don&#039;t need to use the file name &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-network-script&amp;lt;/span&amp;gt;. I suggest this name mainly to keep in line with the rest of the &#039;AN!x&#039; naming used here.&lt;br /&gt;
# If you install &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;convirt&amp;lt;/span&amp;gt; or other hypervisor tools, they will likely create their own bridge script.&lt;br /&gt;
# Adding &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth1&amp;lt;/span&amp;gt; is optional, as we know ahead of time that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth1&amp;lt;/span&amp;gt; will not be made available to any virtual machines as it is dedicated to [[DRBD]]. I&#039;m adding it here because I like having things consistent; Do whichever makes more sense to you.&lt;br /&gt;
&lt;br /&gt;
First, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;touch&amp;lt;/span&amp;gt; the file and then &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;chmod&amp;lt;/span&amp;gt; it to be executable.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
touch /etc/xen/scripts/an-network-script&lt;br /&gt;
chmod 755 /etc/xen/scripts/an-network-script&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now edit it to contain the following:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/xen/scripts/an-network-script&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
dir=$(dirname &amp;quot;$0&amp;quot;)&lt;br /&gt;
&amp;quot;$dir/network-bridge&amp;quot; &amp;quot;$@&amp;quot; vifnum=0 netdev=eth0 bridge=eth0&lt;br /&gt;
&amp;quot;$dir/network-bridge&amp;quot; &amp;quot;$@&amp;quot; vifnum=2 netdev=eth2 bridge=eth2&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now tell Xen to execute that script by editing &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/xen/xend-config.sxp&amp;lt;/span&amp;gt; file and changing the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;network-script&amp;lt;/span&amp;gt; argument to point to this new script (this is line 158 in the default &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xend-config.sxp&amp;lt;/span&amp;gt; script):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/xen/xend-config.sxp&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
#(network-script network-bridge)&lt;br /&gt;
#(network-script /bin/true)&lt;br /&gt;
(network-script an-network-script)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Warning&#039;&#039;&#039;: The next step may trigger fencing of the nodes! As such, be sure that you&#039;re not running anything critical. If unsure, please stop &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt; or reboot the nodes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/cman stop&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now restart &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xend&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/xend restart&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If everything worked, you should now be able to run &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ifconfig&amp;lt;/span&amp;gt; and see that all the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ethX&amp;lt;/span&amp;gt; devices have matching &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;pethX&amp;lt;/span&amp;gt;, virtual and bridge devices.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ifconfig&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
eth0      Link encap:Ethernet  HWaddr 48:5B:39:3C:53:14  &lt;br /&gt;
          inet addr:192.168.1.74  Bcast:192.168.1.255  Mask:255.255.255.0&lt;br /&gt;
          inet6 addr: fe80::4a5b:39ff:fe3c:5314/64 Scope:Link&lt;br /&gt;
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1&lt;br /&gt;
          RX packets:78 errors:0 dropped:0 overruns:0 frame:0&lt;br /&gt;
          TX packets:57 errors:0 dropped:0 overruns:0 carrier:0&lt;br /&gt;
          collisions:0 txqueuelen:0 &lt;br /&gt;
          RX bytes:9796 (9.5 KiB)  TX bytes:12574 (12.2 KiB)&lt;br /&gt;
&lt;br /&gt;
eth1      Link encap:Ethernet  HWaddr 00:1B:21:72:9B:5A  &lt;br /&gt;
          inet addr:192.168.2.74  Bcast:192.168.2.255  Mask:255.255.255.0&lt;br /&gt;
          inet6 addr: fe80::21b:21ff:fe72:9b5a/64 Scope:Link&lt;br /&gt;
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1&lt;br /&gt;
          RX packets:2 errors:0 dropped:0 overruns:0 frame:0&lt;br /&gt;
          TX packets:36 errors:0 dropped:0 overruns:0 carrier:0&lt;br /&gt;
          collisions:0 txqueuelen:1000 &lt;br /&gt;
          RX bytes:832 (832.0 b)  TX bytes:6234 (6.0 KiB)&lt;br /&gt;
          Memory:feae0000-feb00000 &lt;br /&gt;
&lt;br /&gt;
eth2      Link encap:Ethernet  HWaddr 00:1B:21:72:96:EA  &lt;br /&gt;
          inet addr:192.168.3.74  Bcast:192.168.3.255  Mask:255.255.255.0&lt;br /&gt;
          inet6 addr: fe80::21b:21ff:fe72:96ea/64 Scope:Link&lt;br /&gt;
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1&lt;br /&gt;
          RX packets:32 errors:0 dropped:0 overruns:0 frame:0&lt;br /&gt;
          TX packets:29 errors:0 dropped:0 overruns:0 carrier:0&lt;br /&gt;
          collisions:0 txqueuelen:0 &lt;br /&gt;
          RX bytes:5471 (5.3 KiB)  TX bytes:5867 (5.7 KiB)&lt;br /&gt;
&lt;br /&gt;
lo        Link encap:Local Loopback  &lt;br /&gt;
          inet addr:127.0.0.1  Mask:255.0.0.0&lt;br /&gt;
          inet6 addr: ::1/128 Scope:Host&lt;br /&gt;
          UP LOOPBACK RUNNING  MTU:16436  Metric:1&lt;br /&gt;
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0&lt;br /&gt;
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0&lt;br /&gt;
          collisions:0 txqueuelen:0 &lt;br /&gt;
          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)&lt;br /&gt;
&lt;br /&gt;
peth0     Link encap:Ethernet  HWaddr 48:5B:39:3C:53:14  &lt;br /&gt;
          inet6 addr: fe80::4a5b:39ff:fe3c:5314/64 Scope:Link&lt;br /&gt;
          UP BROADCAST RUNNING PROMISC MULTICAST  MTU:1500  Metric:1&lt;br /&gt;
          RX packets:224486 errors:0 dropped:0 overruns:0 frame:0&lt;br /&gt;
          TX packets:55349 errors:0 dropped:0 overruns:0 carrier:0&lt;br /&gt;
          collisions:0 txqueuelen:1000 &lt;br /&gt;
          RX bytes:319406626 (304.6 MiB)  TX bytes:27384681 (26.1 MiB)&lt;br /&gt;
          Interrupt:225 Base address:0x8000 &lt;br /&gt;
&lt;br /&gt;
peth2     Link encap:Ethernet  HWaddr 00:1B:21:72:96:EA  &lt;br /&gt;
          inet6 addr: fe80::21b:21ff:fe72:96ea/64 Scope:Link&lt;br /&gt;
          UP BROADCAST RUNNING PROMISC MULTICAST  MTU:1500  Metric:1&lt;br /&gt;
          RX packets:35 errors:0 dropped:0 overruns:0 frame:0&lt;br /&gt;
          TX packets:70 errors:0 dropped:0 overruns:0 carrier:0&lt;br /&gt;
          collisions:0 txqueuelen:1000 &lt;br /&gt;
          RX bytes:6827 (6.6 KiB)  TX bytes:12470 (12.1 KiB)&lt;br /&gt;
          Memory:fe9e0000-fea00000 &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virbr0&amp;lt;/span&amp;gt; may remain until you reboot your nodes.&lt;br /&gt;
&lt;br /&gt;
If you see something like this, then you are ready to proceed! Now start your cluster back up.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/cman start&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We&#039;re done for now. There is more to do in Xen, but this was all we needed to do in order to proceed with the next several steps. Onces we have the clustered storage online, we&#039;ll come back to Xen for the domU setup.&lt;br /&gt;
&lt;br /&gt;
= Building the DRBD Array =&lt;br /&gt;
&lt;br /&gt;
Building the DRBD array requires a few steps. First, raw space on either node must be prepared. Next, DRBD must be told that it is to create a resource using this newly configured raw space. Finally, the new array must be initialized.&lt;br /&gt;
&lt;br /&gt;
== A Map of the Cluster&#039;s Storage ==&lt;br /&gt;
&lt;br /&gt;
The layout of the storage in the cluster can quickly become difficult to follow. Below is an [[ASCII]] drawing which should help you see how DRBD will tie in to the rest of the cluster&#039;s storage. This map assumes a simple [[TLUG_Talk:_Storage_Technologies_and_Theory#Level_1|RAID level 1]] array underlying each node. If your node has a single hard drive, simply collapse the first two layers into one. Similarly, if your underlying storage is a more complex RAID array, simply expand the number of physical devices at the top level.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
               Node1                                Node2&lt;br /&gt;
           _____   _____                        _____   _____&lt;br /&gt;
          | sda | | sdb |                      | sda | | sdb |&lt;br /&gt;
          |_____| |_____|                      |_____| |_____|&lt;br /&gt;
             |_______|                            |_______|&lt;br /&gt;
     _______ ____|___ _______             _______ ____|___ _______&lt;br /&gt;
  __|__   __|__    __|__   __|__       __|__   __|__    __|__   __|__&lt;br /&gt;
 | md0 | | md1 |  | md2 | | md3 |     | md3 | | md2 |  | md1 | | md0 |&lt;br /&gt;
 |_____| |_____|  |_____| |_____|     |_____| |_____|  |_____| |_____|&lt;br /&gt;
    |       |        |       |           |       |        |       |&lt;br /&gt;
 ___|___   _|_   ____|____   |___________|   ____|____   _|_   ___|___&lt;br /&gt;
| /boot | | / | | &amp;lt;swap&amp;gt;  |        |        | &amp;lt;swap&amp;gt;  | | / | | /boot |&lt;br /&gt;
|_______| |___| |_________|  ______|______  |_________| |___| |_______|&lt;br /&gt;
                            | /dev/drbd0  |&lt;br /&gt;
                            |_____________|&lt;br /&gt;
                                   |&lt;br /&gt;
                               ____|______&lt;br /&gt;
                              | clvm PV   |&lt;br /&gt;
                              |___________|&lt;br /&gt;
                                   |&lt;br /&gt;
                              _____|_____&lt;br /&gt;
                             | drbd0_vg0 |&lt;br /&gt;
                             |___________|&lt;br /&gt;
                                   |&lt;br /&gt;
                              _____|_____ ___...____&lt;br /&gt;
                             |           |          |&lt;br /&gt;
                          ___|___     ___|___    ___|___&lt;br /&gt;
                         | lv_X  |   | lv_Y  |  | lv_N  |&lt;br /&gt;
                         |_______|   |_______|  |_______|&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Install The DRBD Tools ==&lt;br /&gt;
&lt;br /&gt;
DRBD has two components; The actual application and tools and the kernel module. &lt;br /&gt;
&lt;br /&gt;
There are two options for installing the DRBD user-land tools at this point; AN!Cluster-built RPMs or using the ones shipped with Fedora. Regardless of which method you choose, you will need to either install the AN!Cluster DRBD kernel module RPMs or else rebuild the source RPMs referenced.&lt;br /&gt;
&lt;br /&gt;
=== Install The AN!Cluster DRBD User-Land Tools ===&lt;br /&gt;
&lt;br /&gt;
I am currently experimenting with ways to solve a DRBD triggered kernel oops in the Xen pvops 2.6.32 kernel. For this reason, I&#039;ve recompiled the following user-land RPMs under the AN!Cluster variant dom0 kernel RPMs referenced earlier in this paper. If you used the AN! RPMs, then I suggest giving these RPMs a try. However, if you are using myoung&#039;s dom0, I recommend sticking to the Fedora-provided user-land DRBD tools.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum -y install bash-completion heartbeat pacemaker&lt;br /&gt;
cd ~&lt;br /&gt;
wget -c https://alteeve.com/files/an-cluster/drbd-8.3.7-2.fc13.x86_64.rpm&lt;br /&gt;
wget -c https://alteeve.com/files/an-cluster/drbd-utils-8.3.7-2.fc13.x86_64.rpm&lt;br /&gt;
wget -c https://alteeve.com/files/an-cluster/drbd-xen-8.3.7-2.fc13.x86_64.rpm&lt;br /&gt;
wget -c https://alteeve.com/files/an-cluster/drbd-bash-completion-8.3.7-2.fc13.x86_64.rpm&lt;br /&gt;
wget -c https://alteeve.com/files/an-cluster/drbd-udev-8.3.7-2.fc13.x86_64.rpm&lt;br /&gt;
wget -c https://alteeve.com/files/an-cluster/drbd-heartbeat-8.3.7-2.fc13.x86_64.rpm&lt;br /&gt;
wget -c https://alteeve.com/files/an-cluster/drbd-pacemaker-8.3.7-2.fc13.x86_64.rpm&lt;br /&gt;
rpm -ivh drbd*8.3.7-2.fc13.x86_64.rpm&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Install The Stock Fedora DRBD User-Land Tools ===&lt;br /&gt;
&lt;br /&gt;
You will need to install the following tools:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install drbd.x86_64 drbd-xen.x86_64 drbd-utils.x86_64&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Disable heartbeat ===&lt;br /&gt;
&lt;br /&gt;
These packages require that the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;heartbeat&amp;lt;/span&amp;gt; packages be installed. This is for a different cluster platform which we are not using here, so we will disable it from starting with the system.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
chkconfig heartbeat off&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Install The DRBD Kernel Module ==&lt;br /&gt;
&lt;br /&gt;
The kernel module &#039;&#039;&#039;must&#039;&#039;&#039; match the [[dom0]] kernel that is running. If you update the kernel and neglect to update the DRBD kernel module, the DRBD array &#039;&#039;&#039;will not start&#039;&#039;&#039;. &lt;br /&gt;
&lt;br /&gt;
To help simplify things, links to pre-compiled DRBD kernel modules are provided. If the kernel version you have installed doesn&#039;t match your kernel, instructions on recompiling the DRBD kernel module from source RPM is provided as well.&lt;br /&gt;
&lt;br /&gt;
=== Install Pre-Compiled DRBD Kernel Module RPMs ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Warning&#039;&#039;&#039;: The RPM provided here &#039;&#039;&#039;&#039;&#039;will only work&#039;&#039;&#039;&#039;&#039; with the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;kernel-2.6.32.21-168.xendom0_an1.fc13.x86_64.rpm&amp;lt;/span&amp;gt; kernel. If you are using Michael Young&#039;s dom0 kernel, please skip to [[#Building DRBD Kernel Module RPMs From Source|the next section]].&lt;br /&gt;
&lt;br /&gt;
This RPM provides the DRBD kernel module. Note that these RPMs are compiled against the AN!Cluster variant of myoung&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;2.6.32.21_168&amp;lt;/span&amp;gt; dom0 kernel.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cd ~&lt;br /&gt;
wget -c https://alteeve.com/files/an-cluster/drbd-km-2.6.32.23_170.dom0_an1.fc13.x86_64-8.3.7-12.fc13.x86_64.rpm&lt;br /&gt;
rpm -ivh drbd-km-2.6.32.23_170.dom0_an1.fc13.x86_64-8.3.7-12.fc13.x86_64.rpm&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you would like to install the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;debuginfo&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cd ~&lt;br /&gt;
wget -c https://alteeve.com/files/an-cluster/drbd-km-debuginfo-8.3.7-12.fc13.x86_64.rpm&lt;br /&gt;
rpm -ivh drbd-km-debuginfo-8.3.7-12.fc13.x86_64.rpm&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Building DRBD Kernel Module RPMs From Source ===&lt;br /&gt;
&lt;br /&gt;
If the above RPMs don&#039;t work or if the dom0 kernel you are using in any way differs, please follow the steps here to create a DRBD kernel module matched to your running dom0.&lt;br /&gt;
&lt;br /&gt;
First, install the build environment.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum -y groupinstall &amp;quot;Development Libraries&amp;quot;&lt;br /&gt;
yum -y groupinstall &amp;quot;Development Tools&amp;quot;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Install the kernel headers and development library for the dom0 kernel:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: The following commands use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--force&amp;lt;/span&amp;gt; to get past the fact that the headers for the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;2.6.33&amp;lt;/span&amp;gt; are already installed, thus making RPM think that these are too old and will conflict. Please proceed with caution.&lt;br /&gt;
&lt;br /&gt;
* If you are using Michael Young&#039;s kernel:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cd ~&lt;br /&gt;
wget -c http://fedorapeople.org/~myoung/dom0/x86_64/kernel-headers-2.6.32.21-170.xendom0.fc12.x86_64.rpm&lt;br /&gt;
wget -c http://fedorapeople.org/~myoung/dom0/x86_64/kernel-devel-2.6.32.21-170.xendom0.fc12.x86_64.rpm&lt;br /&gt;
rpm -ivh --force kernel*2.6.32.21-170.xendom0.fc12.x86_64.rpm&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* If you are using the AN!Cluster dom0 kernel:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
wget -c https://alteeve.com/files/an-cluster/kernel-devel-2.6.32.23-170.dom0_an1.fc13.x86_64.rpm&lt;br /&gt;
wget -c https://alteeve.com/files/an-cluster/kernel-headers-2.6.32.23-170.dom0_an1.fc13.x86_64.rpm&lt;br /&gt;
rpm -ivh --force kernel-devel-2.6.32.23-170.dom0_an1.fc13.x86_64.rpm kernel-headers-2.6.32.23-170.dom0_an1.fc13.x86_64.rpm&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now you need to download, prepare, build and install the source RPM.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
rpm -ivh http://fedora.mirror.iweb.ca/releases/13/Everything/source/SRPMS/drbd-8.3.7-2.fc13.src.rpm&lt;br /&gt;
cd /root/rpmbuild/SPECS/&lt;br /&gt;
rpmbuild -bp drbd.spec &lt;br /&gt;
cd /root/rpmbuild/BUILD/drbd-8.3.7/&lt;br /&gt;
./configure --enable-spec --with-km&lt;br /&gt;
cp /root/rpmbuild/BUILD/drbd-8.3.7/drbd-km.spec /root/rpmbuild/SPECS/&lt;br /&gt;
cd /root/rpmbuild/SPECS/&lt;br /&gt;
rpmbuild -ba drbd-km.spec&lt;br /&gt;
cd /root/rpmbuild/RPMS/x86_64&lt;br /&gt;
rpm -Uvh drbd-km-*&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This may be needed if &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;drbd-utils&amp;lt;/span&amp;gt;, the user-land DRBD tools, is listed as a requirement when trying to install the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;drbd-km*&amp;lt;/span&amp;gt; RPMs. This step will build all of the DRBD tools RPMs.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install bash-completion heartbeat pacemaker&lt;br /&gt;
cd /root/rpmbuild/SPECS/&lt;br /&gt;
rpmbuild -ba drbd.spec &lt;br /&gt;
cd ~/rpmbuild/RPMS/x86_64/&lt;br /&gt;
rpm -Uvh drbd-*&lt;br /&gt;
chkconfig off heartbeat&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You should be good to go now!&lt;br /&gt;
&lt;br /&gt;
== Allocating Raw Space For DRBD On Each Node ==&lt;br /&gt;
&lt;br /&gt;
If you followed the setup steps provided for in &amp;quot;[[Two Node Fedora 13 Cluster]]&amp;quot;, you will have a set amount of unconfigured hard drive space. This is what we will use for the DRBD space on either node. If you&#039;ve got a different setup, you will need to allocate some raw space before proceeding.&lt;br /&gt;
&lt;br /&gt;
=== Create a Simple Partition ===&lt;br /&gt;
&lt;br /&gt;
If you do not have two drives, please follow the next section&#039;s steps, but pay attention to the &amp;quot;&#039;&#039;&#039;note&#039;&#039;&#039;&amp;quot;s. In short, you will need to create one partition, leave the default type of the partition as &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;83&amp;lt;/span&amp;gt;, write the changes to disk and the proceed to the [[#DRBD Configuration Files|DRBD Configuration Files]] section.&lt;br /&gt;
&lt;br /&gt;
=== Creating a RAID level 1 &#039;md&#039; Device ===&lt;br /&gt;
&lt;br /&gt;
This assumes that you have two raw drives, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/sda&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/sdb&amp;lt;/span&amp;gt;. It further assumes that you&#039;ve created three partitions which have been assigned to three existing &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/mdX&amp;lt;/span&amp;gt; devices. With these assumptions, we will create &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/sda4&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/sdb4&amp;lt;/span&amp;gt; and, using them, create a new &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/md3&amp;lt;/span&amp;gt; device that will host the DRBD partition.&lt;br /&gt;
&lt;br /&gt;
If you have multiple drives and plan to use a different [[TLUG_Talk:_Storage_Technologies_and_Theory#RAID_Levels|RAID levels]], please adjust the follow commands accordingly.&lt;br /&gt;
&lt;br /&gt;
==== Creating The New Partitions ====&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Warning&#039;&#039;&#039;: The next steps will have you directly accessing your server&#039;s hard drive configuration. Please do not proceed on a live server until you&#039;ve had a chance to work through these steps on a test server. One mistake can &#039;&#039;&#039;&#039;&#039;blow away all your data&#039;&#039;&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Start the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fdisk&amp;lt;/span&amp;gt; shell for the first hard drive; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/sda&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
fdisk /dev/sda&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
WARNING: DOS-compatible mode is deprecated. It&#039;s strongly recommended to&lt;br /&gt;
         switch off the mode (command &#039;c&#039;) and change display units to&lt;br /&gt;
         sectors (command &#039;u&#039;).&lt;br /&gt;
&lt;br /&gt;
Command (m for help): &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: Depending on your configuration, you may not see the above warning or you may see a different warning. Note it, but it is likely nothing to worry about it.&lt;br /&gt;
&lt;br /&gt;
View the current configuration with the &#039;&#039;&#039;p&#039;&#039;&#039;rint option&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
p&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Disk /dev/sda: 500.1 GB, 500107862016 bytes&lt;br /&gt;
255 heads, 63 sectors/track, 60801 cylinders&lt;br /&gt;
Units = cylinders of 16065 * 512 = 8225280 bytes&lt;br /&gt;
Sector size (logical/physical): 512 bytes / 512 bytes&lt;br /&gt;
I/O size (minimum/optimal): 512 bytes / 512 bytes&lt;br /&gt;
Disk identifier: 0x000c6fe1&lt;br /&gt;
&lt;br /&gt;
   Device Boot      Start         End      Blocks   Id  System&lt;br /&gt;
/dev/sda1               1        5100    40960000   fd  Linux raid autodetect&lt;br /&gt;
/dev/sda2            5100        5622     4194304   fd  Linux raid autodetect&lt;br /&gt;
/dev/sda3   *        5622        5654      256000   fd  Linux raid autodetect&lt;br /&gt;
&lt;br /&gt;
Command (m for help): &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we know for sure that the next free partition number is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;4&amp;lt;/span&amp;gt;. We will now create the &#039;&#039;&#039;n&#039;&#039;&#039;ew partition.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
n&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Command action&lt;br /&gt;
   e   extended&lt;br /&gt;
   p   primary partition (1-4)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We will make it a &#039;&#039;&#039;p&#039;&#039;&#039;rimary partition&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
p&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Selected partition 4&lt;br /&gt;
First cylinder (5654-60801, default 5654): &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then we simply hit &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;enter&amp;gt;&amp;lt;/span&amp;gt; to select the default starting block.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;enter&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Using default value 5654&lt;br /&gt;
Last cylinder, +cylinders or +size{K,M,G} (5654-60801, default 60801): &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once again we will press &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;enter&amp;gt;&amp;lt;/span&amp;gt; to select the default ending block.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;enter&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Using default value 60801&lt;br /&gt;
&lt;br /&gt;
Command (m for help): &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: If you only have one drive and are not creating a [[RAID]] array, you do not to change the type of the partition so you can skip the next few steps. Continue at the step where you write the changes.&lt;br /&gt;
&lt;br /&gt;
Now we need to change the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;t&amp;lt;/span&amp;gt;ype of partition that it is.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
t&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Partition number (1-4): &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We know that we are modifying partition number &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;4&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
4&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Hex code (type L to list codes): &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we need to set the [[hex]] code for the [[Filesystem_List#List_of_Linux_Partition_Types|partition type]] to set. We want to set &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fd&amp;lt;/span&amp;gt;, which defines &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Linux raid autodetect&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
fd&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Changed system type of partition 4 to fd (Linux raid autodetect)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now check that everything went as expected by once again &#039;&#039;&#039;p&#039;&#039;&#039;rinting the partition table.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
p&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Disk /dev/sda: 500.1 GB, 500107862016 bytes&lt;br /&gt;
255 heads, 63 sectors/track, 60801 cylinders&lt;br /&gt;
Units = cylinders of 16065 * 512 = 8225280 bytes&lt;br /&gt;
Sector size (logical/physical): 512 bytes / 512 bytes&lt;br /&gt;
I/O size (minimum/optimal): 512 bytes / 512 bytes&lt;br /&gt;
Disk identifier: 0x000c6fe1&lt;br /&gt;
&lt;br /&gt;
   Device Boot      Start         End      Blocks   Id  System&lt;br /&gt;
/dev/sda1               1        5100    40960000   fd  Linux raid autodetect&lt;br /&gt;
/dev/sda2            5100        5622     4194304   fd  Linux raid autodetect&lt;br /&gt;
/dev/sda3   *        5622        5654      256000   fd  Linux raid autodetect&lt;br /&gt;
/dev/sda4            5654       60801   442972704+  fd  Linux raid autodetect&lt;br /&gt;
&lt;br /&gt;
Command (m for help): &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: If you only have one drive, your partitions will be &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;83  Linux&amp;lt;/span&amp;gt; or &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;82  Linux swap / Solaris&amp;lt;/span&amp;gt;, instead of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fd  Linux raid autodetect&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
There it is. So finally, we need to &#039;&#039;&#039;w&#039;&#039;&#039;rite the changes to the disk.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
w&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
The partition table has been altered!&lt;br /&gt;
&lt;br /&gt;
Calling ioctl() to re-read partition table.&lt;br /&gt;
&lt;br /&gt;
WARNING: Re-reading the partition table failed with error 16: Device or resource busy.&lt;br /&gt;
The kernel still uses the old table. The new table will be used at&lt;br /&gt;
the next reboot or after you run partprobe(8) or kpartx(8)&lt;br /&gt;
Syncing disks.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: If you only have one drive, reboot now if you got the message above and then skip forward to the &amp;quot;[[#DRBD Configuration Files|DRBD Configuration Files]]&amp;quot; section.&lt;br /&gt;
&lt;br /&gt;
If you see the above message, &#039;&#039;&#039;do not&#039;&#039;&#039; reboot yet. repeat these steps for the second drive, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/sdb&amp;lt;/span&amp;gt;, and then reboot.&lt;br /&gt;
&lt;br /&gt;
==== Creating The New /dev/mdX Device ====&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;If you only have one drive, skip this step.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Now we need to use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;mdadm&amp;lt;/span&amp;gt; to create the new [[TLUG_Talk:_Storage_Technologies_and_Theory#Level_1|RAID level 1]] device. This will be used as the device that DRBD will directly access.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
mdadm --create /dev/md3 --homehost=localhost.localdomain --raid-devices=2 --level=1 /dev/sda4 /dev/sdb4&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
mdadm: Note: this array has metadata at the start and&lt;br /&gt;
    may not be suitable as a boot device.  If you plan to&lt;br /&gt;
    store &#039;/boot&#039; on this device please ensure that&lt;br /&gt;
    your boot-loader understands md/v1.x metadata, or use&lt;br /&gt;
    --metadata=0.90&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Seeing as &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/boot&amp;lt;/span&amp;gt; doesn&#039;t exist on this device, we can safely ignore this warning.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
y&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
mdadm: Defaulting to version 1.2 metadata&lt;br /&gt;
mdadm: array /dev/md/md4 started.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can now &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cat /proc/mdstat&amp;lt;/span&amp;gt; to verify that it indeed built. If you&#039;re interested, you could open a new terminal window and use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;watch cat /proc/mdstat&amp;lt;/span&amp;gt; and watch the array build.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cat /proc/mdstat&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
md3 : active raid1 sdb4[1] sda4[0]&lt;br /&gt;
      442971544 blocks super 1.2 [2/2] [UU]&lt;br /&gt;
      [&amp;gt;....................]  resync =  0.8% (3678976/442971544) finish=111.0min speed=65920K/sec&lt;br /&gt;
      &lt;br /&gt;
md2 : active raid1 sda2[0] sdb2[1]&lt;br /&gt;
      4193272 blocks super 1.1 [2/2] [UU]&lt;br /&gt;
      &lt;br /&gt;
md1 : active raid1 sda1[0] sdb1[1]&lt;br /&gt;
      40958908 blocks super 1.1 [2/2] [UU]&lt;br /&gt;
      bitmap: 1/1 pages [4KB], 65536KB chunk&lt;br /&gt;
&lt;br /&gt;
md0 : active raid1 sda3[0] sdb3[1]&lt;br /&gt;
      255988 blocks super 1.0 [2/2] [UU]&lt;br /&gt;
      &lt;br /&gt;
unused devices: &amp;lt;none&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Finally, we need to make sure that the new array will start when the system boots. To do this, we&#039;ll again use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;mdadm&amp;lt;/span&amp;gt;, but with different options that will have it output data in a format suitable for the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/mdadm.conf&amp;lt;/span&amp;gt; file. We&#039;ll redirect this output to that config file, thus updating it.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
mdadm --detail --scan | grep md3 &amp;gt;&amp;gt; /etc/mdadm.conf&lt;br /&gt;
cat /etc/mdadm.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
# mdadm.conf written out by anaconda&lt;br /&gt;
MAILADDR root&lt;br /&gt;
AUTO +imsm +1.x -all&lt;br /&gt;
ARRAY /dev/md0 level=raid1 num-devices=2 UUID=b58df6d0:d925e7bb:c156168d:47c01718&lt;br /&gt;
ARRAY /dev/md1 level=raid1 num-devices=2 UUID=ac2cf39c:77cd0314:fedb8407:9b945bb5&lt;br /&gt;
ARRAY /dev/md2 level=raid1 num-devices=2 UUID=4e513936:4a966f4e:0dd8402e:6403d10d&lt;br /&gt;
ARRAY /dev/md3 metadata=1.2 name=localhost.localdomain:3 UUID=f0b6d0c1:490d47e7:91c7e63a:f8dacc21&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You&#039;ll note that the last line, which we just added, is different from the previous lines. This isn&#039;t a concern, but you are welcome to re-write it to match the existing format if you wish.&lt;br /&gt;
&lt;br /&gt;
Before you proceed, it is strongly advised that you reboot each node and then verify that the new array did in fact start with the system. You &#039;&#039;do not&#039;&#039; need to wait for the sync to finish before rebooting. It will pick up where you left off once rebooted.&lt;br /&gt;
&lt;br /&gt;
== DRBD Configuration Files ==&lt;br /&gt;
&lt;br /&gt;
DRBD uses a global configuration file, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/drbd.d/global_common.conf&amp;lt;/span&amp;gt;, and one or more resource files. The resource files need to be created in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/drbd.d/&amp;lt;/span&amp;gt; directory and must have the suffix &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;.res&amp;lt;/span&amp;gt;. For this example, we will create a single resource called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;r0&amp;lt;/span&amp;gt; which we will configure in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/drbd.d/r0.res&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== /etc/drbd.d/global_common.conf ===&lt;br /&gt;
&lt;br /&gt;
The stock &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/drbd.d/global_common.conf&amp;lt;/span&amp;gt; is sane, so we won&#039;t bother altering it here.&lt;br /&gt;
&lt;br /&gt;
Full details on all the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;drbd.conf&amp;lt;/span&amp;gt; configuration file directives and arguments can be found [http://www.drbd.org/users-guide/re-drbdconf.html here]. &#039;&#039;&#039;Note&#039;&#039;&#039;: That link doesn&#039;t show this new configuration format. Please see [http://www.novell.com/documentation/sle_ha/book_sleha/?page=/documentation/sle_ha/book_sleha/data/sec_ha_drbd_configure.html Novell&#039;s] link.&lt;br /&gt;
&lt;br /&gt;
=== /etc/drbd.d/r0.res ===&lt;br /&gt;
&lt;br /&gt;
This is the important part. This defines the resource to use, and must reflect the IP addresses and storage devices that DRBD will use for this resource.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/drbd.d/r0.res&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# This is the name of the resource and it&#039;s settings. Generally, &#039;r0&#039; is used&lt;br /&gt;
# as the name of the first resource. This is by convention only, though.&lt;br /&gt;
resource r0&lt;br /&gt;
{&lt;br /&gt;
        # This tells DRBD where to make the new resource available at on each&lt;br /&gt;
        # node. This is, again, by convention only.&lt;br /&gt;
        device    /dev/drbd0;&lt;br /&gt;
&lt;br /&gt;
        # The main argument here tells DRBD that we will have proper locking &lt;br /&gt;
        # and fencing, and as such, to allow both nodes to set the resource to&lt;br /&gt;
        # &#039;primary&#039; simultaneously.&lt;br /&gt;
        net&lt;br /&gt;
        {&lt;br /&gt;
                allow-two-primaries;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        # This tells DRBD to automatically set both nodes to &#039;primary&#039; when the&lt;br /&gt;
        # nodes start.&lt;br /&gt;
        startup&lt;br /&gt;
        {&lt;br /&gt;
                become-primary-on both;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        # This tells DRBD to look for and store it&#039;s meta-data on the resource&lt;br /&gt;
        # itself.&lt;br /&gt;
        meta-disk       internal;&lt;br /&gt;
&lt;br /&gt;
        # The name below must match the output from `uname -n` on each node.&lt;br /&gt;
        on an-node01.alteeve.com&lt;br /&gt;
        {&lt;br /&gt;
                # This must be the IP address of the interface on the storage &lt;br /&gt;
                # network (an-node01.sn, in this case).&lt;br /&gt;
                address         192.168.2.71:7789;&lt;br /&gt;
&lt;br /&gt;
                # This is the underlying partition to use for this resource on &lt;br /&gt;
                # this node.&lt;br /&gt;
                disk            /dev/md3;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        # Repeat as above, but for the other node.&lt;br /&gt;
        on an-node02.alteeve.com&lt;br /&gt;
        {&lt;br /&gt;
                address         192.168.2.72:7789;&lt;br /&gt;
                disk            /dev/md3;&lt;br /&gt;
        }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This file must be copied to &#039;&#039;&#039;BOTH&#039;&#039;&#039; nodes and must match before you proceed.&lt;br /&gt;
&lt;br /&gt;
== Starting The DRBD Resource ==&lt;br /&gt;
&lt;br /&gt;
From the rest of this section, pay attention to whether you see&lt;br /&gt;
* &#039;&#039;&#039;Node1&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Node2&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Both&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
These indicate which node to run the following commands on. There is no functional difference between either node, so just randomly choose one to be &#039;&#039;&#039;Node1&#039;&#039;&#039; and the other will be &#039;&#039;&#039;Node2&#039;&#039;&#039;. Once you&#039;ve chosen which is which, be consistent with which node you run the commands on. Of course, if a command block is proceeded by &#039;&#039;&#039;Both&#039;&#039;&#039;, run the following code block on both nodes.&lt;br /&gt;
&lt;br /&gt;
=== Loading the &#039;drbd&#039; Module ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Both&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Normally, we&#039;d load the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;drbd&amp;lt;/span&amp;gt; module by simply starting the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/init.d/drbd&amp;lt;/span&amp;gt; daemon. However, if we did that at this stage, we&#039;d generate errors because there isn&#039;t an &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;UpToDate&amp;lt;/span&amp;gt; disk in the array. To get around this, we&#039;ll manually load the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;drbd&amp;lt;/span&amp;gt; kernel module using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;modprobe&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
modprobe drbd&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This won&#039;t return any output, but if you check, you should now see the special &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/proc/drbd&amp;lt;/span&amp;gt; file.&lt;br /&gt;
&lt;br /&gt;
=== Monitoring Progress ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Both&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
I find it very useful to monitor DRBD while running the rest of the setup. To do this, open a second terminal on each node and use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;watch&amp;lt;/span&amp;gt; to keep an eye on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/proc/drbd&amp;lt;/span&amp;gt;. This way you will be able to monitor the progress of the array in near-real time.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Both&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
watch cat /proc/drbd&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At this stage, it should look like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
version: 8.3.7 (api:88/proto:86-91)&lt;br /&gt;
GIT-hash: ea9e28dbff98e331a62bcbcc63a6135808fe2917 build by root@xenmaster002.iplink.net, 2010-09-07 16:02:46&lt;br /&gt;
 0: cs:Unconfigured&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Initialize The Resource ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Both&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This step creates the DRBD meta-data on the new DRBD resource&#039;s backing devices. It is only needed when creating new DRBD partitions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
drbdadm create-md r0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
  --==  Thank you for participating in the global usage survey  ==--&lt;br /&gt;
The server&#039;s response is:&lt;br /&gt;
&lt;br /&gt;
you are the 9507th user to install this version&lt;br /&gt;
Writing meta data...&lt;br /&gt;
initializing activity log&lt;br /&gt;
NOT initialized bitmap&lt;br /&gt;
New drbd meta data block successfully created.&lt;br /&gt;
success&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/proc/drbd&amp;lt;/span&amp;gt; output should not have changed at this stage.&lt;br /&gt;
&lt;br /&gt;
=== Starting the Resource ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Both&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This will attach the backing device, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/md3&amp;lt;/span&amp;gt; in our case, and then start the new resource &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;r0&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
drbdadm up r0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There will be no output at the command line. If you are &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;watch&amp;lt;/span&amp;gt;ing &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/proc/drbd&amp;lt;/span&amp;gt; though, you should now see something like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
version: 8.3.7 (api:88/proto:86-91)&lt;br /&gt;
GIT-hash: ea9e28dbff98e331a62bcbcc63a6135808fe2917 build by root@xenmaster002.iplink.net, 2010-09-07 16:02:46&lt;br /&gt;
 0: cs:Connected ro:Secondary/Secondary ds:Inconsistent/Inconsistent C r----&lt;br /&gt;
    ns:0 nr:0 dw:0 dr:0 al:0 bm:0 lo:0 pe:0 ua:0 ap:0 ep:1 wo:b oos:442957988&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
That it is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Secondary/Secondary&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Inconsistent/Inconsistent&amp;lt;/span&amp;gt; is expected.&lt;br /&gt;
&lt;br /&gt;
=== Setting the First Primary Node ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Node1&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
As this is a totally new resource, DRBD doesn&#039;t know which side of the array is &amp;quot;more valid&amp;quot; than the other. In reality, neither is as there was no existing data of note on either node. This means that we now need to choose a node and tell DRBD to treat it as the &amp;quot;source&amp;quot; node. This step will also tell DRBD to make the &amp;quot;source&amp;quot; node &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;primary&amp;lt;/span&amp;gt;. Once set, DRBD will begin &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;sync&amp;lt;/span&amp;gt;&#039;ing in the background. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
drbdadm -- --overwrite-data-of-peer primary r0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As before, there will be no output at the command line, but &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/proc/drbd&amp;lt;/span&amp;gt; will change to show the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
GIT-hash: ea9e28dbff98e331a62bcbcc63a6135808fe2917 build by root@xenmaster002.iplink.net, 2010-09-07 16:02:46&lt;br /&gt;
 0: cs:SyncSource ro:Primary/Secondary ds:UpToDate/Inconsistent C r----&lt;br /&gt;
    ns:69024 nr:0 dw:0 dr:69232 al:0 bm:4 lo:0 pe:0 ua:0 ap:0 ep:1 wo:b oos:442888964&lt;br /&gt;
        [&amp;gt;....................] sync&#039;ed:  0.1% (432508/432576)M&lt;br /&gt;
        finish: 307:33:42 speed: 320 (320) K/sec&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you&#039;re watching the secondary node, the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/proc/drbd&amp;lt;/span&amp;gt; will show &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ro:Secondary/Primary ds:Inconsistent/UpToDate&amp;lt;/span&amp;gt;. This is, as you can guess, simply a reflection of it being the &amp;quot;over-written&amp;quot; node.&lt;br /&gt;
&lt;br /&gt;
=== Setting the Second Node to Primary ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Node2&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The last step to complete the array is to tell the second node to also become &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;primary&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
drbdadm primary r0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As with many &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;drbdadm&amp;lt;/span&amp;gt; commands, nothing will be printed to the console. If you&#039;re watching the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/proc/drbd&amp;lt;/span&amp;gt; though, you should see something like &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Primary/Primary ds:UpToDate/Inconsistent&amp;lt;/span&amp;gt;. The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Inconsistent&amp;lt;/span&amp;gt; flag will remain until the sync is complete.&lt;br /&gt;
&lt;br /&gt;
=== A Note On sync Speed ===&lt;br /&gt;
&lt;br /&gt;
You will notice in the previous step that the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;sync&amp;lt;/span&amp;gt; speed seems awfully slow at &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;320 (320) K/sec&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;This is not a problem!&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
As actual data is written to either side of the array, that data will be immediately copied to both nodes. As such, both nodes will always contain up to date copies of the real data. Given this, the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;syncer&amp;lt;/span&amp;gt; is intentionally set low so as to not put too much load on the underlying disks that could cause slow downs. If you still wish to increase the sync speed, you can do so with the following command.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Warning&#039;&#039;&#039;: If you set the DRBD sync speed too high and saturate your disks&#039; maximum write speed, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clvmd&amp;lt;/span&amp;gt; daemon will likely fail to start in some cases, leading to fences. For this reason, keep your sync rate to about 2/3rds of the underlying disk maximum write speed and hold off on bumping up the sync speed until you know you will have a period of low activity on your cluster.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
drbdsetup /dev/drbd0 syncer -r 35M&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The speed-up will not be instant. It will take a little while for the speed to pick up. Once the sync is finished, it is a good idea to revert to the default sync rate.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
drbdadm syncer r0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Setting Up CLVM =&lt;br /&gt;
&lt;br /&gt;
The goal of DRBD in the cluster is to provide clustered [[LVM]], referred to as [[CLVM]] to the nodes. This is done by turning the DRBD partition into an CLVM physical volume.&lt;br /&gt;
&lt;br /&gt;
So now we will create a [[PV]] on top of the new [[DRBD]] partition, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/drbd0&amp;lt;/span&amp;gt;, that we created in the previous step. Since this new LVM [[PV]] will exist on top of the shared DRBD partition, whatever get written to it&#039;s logical volumes will be immediately available on either node, regardless of which node actually initiated the write.&lt;br /&gt;
&lt;br /&gt;
This capability is the underlying reason for creating this cluster; Neither machine is truly needed so if one machine dies, anything on top of the DRBD partition will still be available. When the failed machine returns, the surviving node will have a list of what blocks changed while the other node was gone and can use this list to quickly re-sync the other server.&lt;br /&gt;
&lt;br /&gt;
== Making LVM Cluster-Aware ==&lt;br /&gt;
&lt;br /&gt;
Normally, LVM is run on a single server. This means that at any time, the LVM can write data to the underlying drive and not need to worry if any other device might change anything. In clusters, this isn&#039;t the case. The other node could try to write to the shared storage, so then nodes need to enable &amp;quot;locking&amp;quot; to prevent the two nodes from trying to work on the same bit of data at the same time. &lt;br /&gt;
&lt;br /&gt;
The process of enabling this locking is known as making LVM &amp;quot;cluster-aware&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
LVM has tool called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;lvmconf&amp;lt;/span&amp;gt; that can be used to enable LVM locking. This is provided as part of the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;lvm2-cluster&amp;lt;/span&amp;gt; package.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum -y install lvm2-cluster.x86_64&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now to enable cluster awareness in LVM, run to following command.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
lvmconf --enable-cluster&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
By default, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clvmd&amp;lt;/span&amp;gt;, the cluster lvm daemon, is stopped and not set to run on boot. Now that we&#039;ve enabled LVM locking, we need to start it:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/clvmd status&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
clvmd is stopped&lt;br /&gt;
active volumes: (none)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As expected, it is stopped, so lets start it:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/clvmd start&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Activating VGs:   No volume groups found&lt;br /&gt;
                                                           [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: I&#039;ve seen on a few occasions where starting &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clvmd&amp;lt;/span&amp;gt; will time out and, on occasion, fences will be issued. I&#039;ve not sorted out why, but I have usually been able to resolve this by stopping &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clvmd&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt;, then restarting &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt; and, finally, restarting &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clvmd&amp;lt;/span&amp;gt;. If I can sort out a way to reliably trigger this problem, I will submit a bug report.&lt;br /&gt;
&lt;br /&gt;
== Filtering Out Devices ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;ToDo&#039;&#039;&#039;: Find a less-aggressive filter.&lt;br /&gt;
&lt;br /&gt;
With the stock &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/lvm/lvm.conf&amp;lt;/span&amp;gt; configuration, all devices on the system will be checked for LVM volumes. This can cause a problem as LVM will give preference to the LVM data on the RAID device over the DRBD device. It sees a duplicate as both are, effectively, one and the same.&lt;br /&gt;
&lt;br /&gt;
To work around this, we need to alter the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;filter = []&amp;lt;/span&amp;gt; entry. At the time of writing, simply rejecting the underlying &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/md3&amp;lt;/span&amp;gt; device as a candidate wasn&#039;t enough. So for now, we will tell LVM to accept DRBD devices and reject all other devices. To do this, we&#039;ll insert &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;quot;a|/dev/drbd*|&amp;quot;&amp;lt;/span&amp;gt; as the first array entry and change the existing entry to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;quot;r/.*/&amp;quot;&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: I would love feedback on a filter argument that successfully ignored just &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/md3&amp;lt;/span&amp;gt;, if anyone can suggest one.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/lvm/lvm.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
    # By default we accept every block device:&lt;br /&gt;
    #filter = [ &amp;quot;a/.*/&amp;quot; ]&lt;br /&gt;
    filter = [ &amp;quot;a|/dev/drbd*|&amp;quot;, &amp;quot;r/.*/&amp;quot; ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now delete the existing cache file so that LVM is forced to rescan the system.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
rm -f /etc/lvm/cache/.cache&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The changes take effect immediately.&lt;br /&gt;
&lt;br /&gt;
== Creating a new PV using the DRBD Partition ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Node1&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
We can now proceed with setting up the new DRBD-based LVM physical volume. Once the PV is created, we can create a new volume group and start allocating space to logical volumes.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: As we will be using our DRBD device, and as it is a shared block device, most of the following commands only need to be run on one node. Once the block device changes in any way, those changes will near-instantly appear on the other node. For this reason, unless explicitly stated to do so, only run the following commands on one node.&lt;br /&gt;
&lt;br /&gt;
To setup the DRBD partition as an LVM PV, run &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;pvcreate&amp;lt;/span&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
pvcreate /dev/drbd0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
  Physical volume &amp;quot;/dev/drbd0&amp;quot; successfully created&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Both&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Now, on both nodes, check that the new physical volume is visible by using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;pvdisplay&amp;lt;/span&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
pvdisplay&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;quot;/dev/drbd0&amp;quot; is a new physical volume of &amp;quot;422.44 GiB&amp;quot;&lt;br /&gt;
  --- NEW Physical volume ---&lt;br /&gt;
  PV Name               /dev/drbd0&lt;br /&gt;
  VG Name               &lt;br /&gt;
  PV Size               422.44 GiB&lt;br /&gt;
  Allocatable           NO&lt;br /&gt;
  PE Size               0   &lt;br /&gt;
  Total PE              0&lt;br /&gt;
  Free PE               0&lt;br /&gt;
  Allocated PE          0&lt;br /&gt;
  PV UUID               YHmdip-SuJN-KIEv-2tbK-BT9Q-wfOo-OuQuaW&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you see &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;PV Name /dev/drbd0&amp;lt;/span&amp;gt; (or your underlying partition) on both nodes, then your DRBD setup and LVM configuration changes are working perfectly!&lt;br /&gt;
&lt;br /&gt;
== Creating a VG on the new PV ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Node1&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Now we need to create the volume group using the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vgcreate&amp;lt;/span&amp;gt; command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vgcreate -c y drbd0_vg0 /dev/drbd0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
  Clustered volume group &amp;quot;drbd0_vg0&amp;quot; successfully created&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Both&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Now we&#039;ll check that the new VG is visible on both nodes using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vgdisplay&amp;lt;/span&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vgdisplay&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
  --- Volume group ---&lt;br /&gt;
  VG Name               drbd0_vg0&lt;br /&gt;
  System ID             &lt;br /&gt;
  Format                lvm2&lt;br /&gt;
  Metadata Areas        1&lt;br /&gt;
  Metadata Sequence No  1&lt;br /&gt;
  VG Access             read/write&lt;br /&gt;
  VG Status             resizable&lt;br /&gt;
  Clustered             yes&lt;br /&gt;
  Shared                no&lt;br /&gt;
  MAX LV                0&lt;br /&gt;
  Cur LV                0&lt;br /&gt;
  Open LV               0&lt;br /&gt;
  Max PV                0&lt;br /&gt;
  Cur PV                1&lt;br /&gt;
  Act PV                1&lt;br /&gt;
  VG Size               422.43 GiB&lt;br /&gt;
  PE Size               4.00 MiB&lt;br /&gt;
  Total PE              108143&lt;br /&gt;
  Alloc PE / Size       0 / 0   &lt;br /&gt;
  Free  PE / Size       108143 / 422.43 GiB&lt;br /&gt;
  VG UUID               Bb8l9e-es2z-PhaF-Gg3o-2is2-DZ1S-V2RsBF&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the new VG is visible on both nodes, we are ready to create our first logical volume using the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;lvcreate&amp;lt;/span&amp;gt; tool.&lt;br /&gt;
&lt;br /&gt;
== Creating the First LV on the new VG ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Node1&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Now we&#039;ll create a simple 20 GiB logical volumes. We will use it as a shared GFS2 store for shared files and to store our Xen domU config files later on.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
lvcreate -L 20G -n xen_shared drbd0_vg0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
  Logical volume &amp;quot;xen_shared&amp;quot; created&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Both&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
As before, we will check that the new logical volume is visible from both nodes by using the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;lvdisplay&amp;lt;/span&amp;gt; command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
lvdisplay&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
  --- Logical volume ---&lt;br /&gt;
  LV Name                /dev/drbd0_vg0/xen_shared&lt;br /&gt;
  VG Name                drbd0_vg0&lt;br /&gt;
  LV UUID                AqQizc-KBpX-2scN-WFLb-jIeF-QDcM-PlQW84&lt;br /&gt;
  LV Write Access        read/write&lt;br /&gt;
  LV Status              available&lt;br /&gt;
  # open                 0&lt;br /&gt;
  LV Size                20.00 GiB&lt;br /&gt;
  Current LE             5120&lt;br /&gt;
  Segments               1&lt;br /&gt;
  Allocation             inherit&lt;br /&gt;
  Read ahead sectors     auto&lt;br /&gt;
  - currently set to     256&lt;br /&gt;
  Block device           253:0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Again, if this is visible from both nodes, we&#039;re set! Repeat this process for all future LVs you will want to create. We will do this a little later to create LVs for Xen VMs.&lt;br /&gt;
&lt;br /&gt;
= Creating A Shared GFS FileSystem =&lt;br /&gt;
&lt;br /&gt;
GFS is a cluster-aware file system that can be simultaneously mounted on two or more nodes at once. We will use it as a place to store ISOs that we&#039;ll use to provision our virtual machines.&lt;br /&gt;
&lt;br /&gt;
== Install The GFS2 Utilities ==&lt;br /&gt;
&lt;br /&gt;
Start by installing the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[GFS2]]&amp;lt;/span&amp;gt; tools:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum -y install gfs2-utils.x86_64&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Format Our CLVM LV With The GFS2 File System ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Node1&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: The following example is designed for the cluster used in the prerequisite HowTo. &lt;br /&gt;
* If you have more than 2 nodes, increase the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;-j 2&amp;lt;/span&amp;gt; to the number of nodes you want to mount this file system on.&lt;br /&gt;
* If your cluster is named something other than &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-cluster&amp;lt;/span&amp;gt; (as set in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cluster.conf&amp;lt;/span&amp;gt; file), change &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;-t an-cluster:xen_shared&amp;lt;/span&amp;gt; to match you cluster&#039;s name. The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xen_shared&amp;lt;/span&amp;gt; can be whatever you like, but it must be unique in the cluster. I tend to use a name that matches the LV name, but this is my own preference and is not required.&lt;br /&gt;
&lt;br /&gt;
To format the partition run:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
mkfs.gfs2 -p lock_dlm -j 2 -t an-cluster:xen_shared /dev/drbd0_vg0/xen_shared&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
This will destroy any data on /dev/drbd0_vg0/xen_shared.&lt;br /&gt;
It appears to contain: symbolic link to `../dm-0&#039;&lt;br /&gt;
&lt;br /&gt;
Are you sure you want to proceed? [y/n] &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Acknowledge the warning, if any, and then press &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;y&amp;lt;/span&amp;gt; if you are ready to proceed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
y&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Device:                    /dev/drbd0_vg0/xen_shared&lt;br /&gt;
Blocksize:                 4096&lt;br /&gt;
Device Size                20.00 GB (5242880 blocks)&lt;br /&gt;
Filesystem Size:           20.00 GB (5242878 blocks)&lt;br /&gt;
Journals:                  2&lt;br /&gt;
Resource Groups:           80&lt;br /&gt;
Locking Protocol:          &amp;quot;lock_dlm&amp;quot;&lt;br /&gt;
Lock Table:                &amp;quot;an-cluster:xen_shared&amp;quot;&lt;br /&gt;
UUID:                      A1487063-2A3F-43B1-3A36-44936B0B4D1E&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once the format completes, you can mount &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/drbd0_vg0/xen_shared&amp;lt;/span&amp;gt; as you would a normal file system.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Both&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
To complete the example, lets mount the GFS2 partition we made just now on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/shared&amp;lt;/span&amp;gt; and then use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;df -h&amp;lt;/span&amp;gt; to verify.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
mkdir /xen_shared&lt;br /&gt;
mount /dev/drbd0_vg0/xen_shared /xen_shared&lt;br /&gt;
df -h&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Filesystem            Size  Used Avail Use% Mounted on&lt;br /&gt;
Filesystem            Size  Used Avail Use% Mounted on&lt;br /&gt;
/dev/md1               39G  2.8G   34G   8% /&lt;br /&gt;
tmpfs                 466M   29M  438M   7% /dev/shm&lt;br /&gt;
/dev/md0              243M   70M  161M  31% /boot&lt;br /&gt;
xenstore              466M   32K  466M   1% /var/lib/xenstored&lt;br /&gt;
/dev/dm-0              20G  259M   20G   2% /xen_shared&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You may have noticed that it shows &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/dm-0&amp;lt;/span&amp;gt; instead of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/drbd0_vg0/xen_shared&amp;lt;/span&amp;gt;. If you look at the later, you will see that it is simply a [[symlink]] to the former.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ls -lah /dev/drbd0_vg0/xen_shared&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
lrwxrwxrwx. 1 root root 7 Sep  9 13:24 /dev/drbd0_vg0/xen_shared -&amp;gt; ../dm-0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Add An Entry To /etc/fstab ==&lt;br /&gt;
&lt;br /&gt;
The last step is to add an entry for this new partition to each node&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/fstab&amp;lt;/span&amp;gt; file.&lt;br /&gt;
&lt;br /&gt;
=== Reference The GFS2 Partition By Device Path ===&lt;br /&gt;
&lt;br /&gt;
This is the more traditional method of referencing the GFS2 partition by using it&#039;s device path directly.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Warning&#039;&#039;&#039;: An incorrect edit of the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/fstab&amp;lt;/span&amp;gt; file can leave your system unable to boot! Please review the line generated above to make sure it is accurate and compatible with your setup before proceeding.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/fstab&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
#&lt;br /&gt;
# /etc/fstab&lt;br /&gt;
# Created by anaconda on Tue Sep  7 06:29:51 2010&lt;br /&gt;
#&lt;br /&gt;
# Accessible filesystems, by reference, are maintained under &#039;/dev/disk&#039;&lt;br /&gt;
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info&lt;br /&gt;
#&lt;br /&gt;
UUID=865690db-85d0-44c5-9f32-ffb6fdf47060 /                       ext3    defaults        1 1&lt;br /&gt;
UUID=8b9822b6-a92e-48c9-96b5-f8943142319e /boot                   ext3    defaults        1 2&lt;br /&gt;
UUID=94b03547-a7e3-45bb-b2d5-837498b370f4 swap                    swap    defaults        0 0&lt;br /&gt;
tmpfs                   /dev/shm                tmpfs   defaults        0 0&lt;br /&gt;
devpts                  /dev/pts                devpts  gid=5,mode=620  0 0&lt;br /&gt;
sysfs                   /sys                    sysfs   defaults        0 0&lt;br /&gt;
proc                    /proc                   proc    defaults        0 0&lt;br /&gt;
xenfs                   /proc/xen               xenfs   defaults        0 0&lt;br /&gt;
/dev/drbd0_vg0/xen_shared /xen_shared           gfs2    rw,suid,dev,exec,nouser,async    0 0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Reference The GFS2 Partition By UUID ===&lt;br /&gt;
&lt;br /&gt;
It is sometimes preferable to create an &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fstab&amp;lt;/span&amp;gt; entry that locates the device path via it&#039;s [[UUID]]. To do this, you can run the following command which, though a bit cryptic, will print out an &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/fstab&amp;lt;/span&amp;gt; compatible string.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Warning&#039;&#039;&#039;: The same warnings apply here as above&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
echo `gfs2_edit -p sb /dev/drbd0_vg0/xen_shared | grep sb_uuid | sed -e &amp;quot;s/.*sb_uuid  *\(.*\)/UUID=\L\1\E \/xen_shared\t\tgfs2\trw,suid,dev,exec,nouser,async\t0 0/&amp;quot;`&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
UUID=a1487063-2a3f-43b1-3a36-44936b0b4d1e /xen_shared gfs2 rw,suid,dev,exec,nouser,async 0 0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You may have noticed that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;defaults&amp;lt;/span&amp;gt; isn&#039;t used. Rather, all but the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;auto&amp;lt;/span&amp;gt; option are manually set. This is because the system will drop to single-user mode at boot if it can&#039;t mount an &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;auto&amp;lt;/span&amp;gt; partition at boot time (&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;auto&amp;lt;/span&amp;gt; being implied by &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;defaults&amp;lt;/span&amp;gt;). Given that our GFS2 partition sits on top of DRBD and the cluster, there is no way to make it available that early in the boot process.&lt;br /&gt;
&lt;br /&gt;
Further, the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;gfs2&amp;lt;/span&amp;gt; init script specifically excludes entries in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/fstab&amp;lt;/span&amp;gt; that have the &#039;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;noauto&amp;lt;/span&amp;gt; option set. For this reason, we can&#039;t simply specify that as we need the init script to see the partition so that it is mounted when GFS2 starts and unmounted when it stops.&lt;br /&gt;
&lt;br /&gt;
Now add this string to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/fstab&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/fstab&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
#&lt;br /&gt;
# /etc/fstab&lt;br /&gt;
# Created by anaconda on Tue Sep  7 06:29:51 2010&lt;br /&gt;
#&lt;br /&gt;
# Accessible filesystems, by reference, are maintained under &#039;/dev/disk&#039;&lt;br /&gt;
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info&lt;br /&gt;
#&lt;br /&gt;
UUID=865690db-85d0-44c5-9f32-ffb6fdf47060 /                       ext3    defaults        1 1&lt;br /&gt;
UUID=8b9822b6-a92e-48c9-96b5-f8943142319e /boot                   ext3    defaults        1 2&lt;br /&gt;
UUID=94b03547-a7e3-45bb-b2d5-837498b370f4 swap                    swap    defaults        0 0&lt;br /&gt;
tmpfs                   /dev/shm                tmpfs   defaults        0 0&lt;br /&gt;
devpts                  /dev/pts                devpts  gid=5,mode=620  0 0&lt;br /&gt;
sysfs                   /sys                    sysfs   defaults        0 0&lt;br /&gt;
proc                    /proc                   proc    defaults        0 0&lt;br /&gt;
xenfs                   /proc/xen               xenfs   defaults        0 0&lt;br /&gt;
UUID=a1487063-2a3f-43b1-3a36-44936b0b4d1e /xen_shared gfs2 rw,suid,dev,exec,nouser,async 0 0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Please note; At the time of writing this HowTo, there is a bug in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;findfs&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;mount&amp;lt;/span&amp;gt;. According to [http://www.ietf.org/rfc/rfc4122.txt RFC 4122], programs should accept a [[UUID]] in either upper or lower case. However, this is not currently the case, so you &#039;&#039;&#039;must&#039;&#039;&#039; pass the UUID in lower-case. Please see bugs [https://bugzilla.redhat.com/show_bug.cgi?id=632373 632373] and [https://bugzilla.redhat.com/show_bug.cgi?id=632385 632385].&lt;br /&gt;
&lt;br /&gt;
== Testing The gfs2 Initialization Script ==&lt;br /&gt;
&lt;br /&gt;
To verify that the new entry is valid, check &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;gfs2&amp;lt;/span&amp;gt;&#039;s status.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/gfs2 status&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Configured GFS2 mountpoints: &lt;br /&gt;
/xen_shared&lt;br /&gt;
Active GFS2 mountpoints: &lt;br /&gt;
/xen_shared&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now test stopping and restarting to ensure that the GFS2 partition unmounts and mounts properly.&lt;br /&gt;
&lt;br /&gt;
Stop &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;gfs2&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/gfs2 stop&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Unmounting GFS2 filesystem (/xen_shared):                   [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;df -h&amp;lt;/span&amp;gt; to ensure that the mount is gone.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
df -h&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Filesystem            Size  Used Avail Use% Mounted on&lt;br /&gt;
/dev/md1               39G  2.0G   35G   6% /&lt;br /&gt;
tmpfs                 466M   23M  444M   5% /dev/shm&lt;br /&gt;
/dev/md0              243M   70M  161M  31% /boot&lt;br /&gt;
xenstore              466M   32K  466M   1% /var/lib/xenstored&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Start &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;gfs2&amp;lt;/span&amp;gt; again.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/gfs2 start&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Mounting GFS2 filesystem (/xen_shared):                     [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Again, check with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;df -h&amp;lt;/span&amp;gt; that it has been remounted.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
df -h&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Filesystem            Size  Used Avail Use% Mounted on&lt;br /&gt;
/dev/md1               39G  2.0G   35G   6% /&lt;br /&gt;
tmpfs                 466M   29M  438M   7% /dev/shm&lt;br /&gt;
/dev/md0              243M   70M  161M  31% /boot&lt;br /&gt;
xenstore              466M   32K  466M   1% /var/lib/xenstored&lt;br /&gt;
/dev/dm-0              20G  259M   20G   2% /xen_shared&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Done!&lt;br /&gt;
&lt;br /&gt;
== Further Reading ==&lt;br /&gt;
&lt;br /&gt;
* [[Grow a GFS2 Partition]]&lt;br /&gt;
* [[Hard drive has gone bad in DRBD]]&lt;br /&gt;
&lt;br /&gt;
= Altering Daemon Start Order =&lt;br /&gt;
&lt;br /&gt;
It is important that the various daemons in use by our cluster start in the right order. Most daemons will rely on services provided by another daemon to be running, and will not start or will not operate reliably otherwise.&lt;br /&gt;
&lt;br /&gt;
We need to make sure that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xend&amp;lt;/span&amp;gt; starts so that the network is stable. Then &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt; needs to start so that [[fencing]] and [[dlm]] are available. Next, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;drbd&amp;lt;/span&amp;gt; starts so that the clustered storage is available. Then &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clvmd&amp;lt;/span&amp;gt; must start so that the data on the DRBD resource is accessible. Now &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;gfs2&amp;lt;/span&amp;gt; needs to start so that the Xen domU configuration files can be found and finally &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xendomains&amp;lt;/span&amp;gt; must start to boot up the actual domU virtual machines.&lt;br /&gt;
&lt;br /&gt;
To restate as a list, the start order must be:&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xend&amp;lt;/span&amp;gt;&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt;&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;drbd&amp;lt;/span&amp;gt;&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clvmd&amp;lt;/span&amp;gt;&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;gfs2&amp;lt;/span&amp;gt;&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xendomains&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To make sure the start order is sane then, we&#039;ll edit each of the six daemon&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;init&amp;lt;/span&amp;gt; scripts and alter their &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Required-Start&amp;lt;/span&amp;gt; lines. To make the changes take effect, we will use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;chkconfig&amp;lt;/span&amp;gt; to remove and re-add them to the various start levels.&lt;br /&gt;
&lt;br /&gt;
== Altering xend ==&lt;br /&gt;
&lt;br /&gt;
This should already be done. If it isn&#039;t, please see &amp;quot;[[#Make xend play nice with clustering|Making xend play nice with clustering]]&amp;quot; above. If you are revisiting that section, you can skip the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt; edit as we will need to make another change in the next step.&lt;br /&gt;
&lt;br /&gt;
== Altering cman ==&lt;br /&gt;
&lt;br /&gt;
This should already be done. If it isn&#039;t, please see &amp;quot;[[#Make xend play nice with clustering|Making xend play nice with clustering]]&amp;quot; above. If you are revisiting that section, you can skip the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt; edit as we will need to make another change in the next step.&lt;br /&gt;
&lt;br /&gt;
== Altering drbd ==&lt;br /&gt;
&lt;br /&gt;
Now we will tell &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;drbd&amp;lt;/span&amp;gt; to start after &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
This requires the additional step of altering the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;chkconfig: - 70 08&amp;lt;/span&amp;gt; line to instead read &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;chkconfig: - 20 08&amp;lt;/span&amp;gt;. This isn&#039;t strictly needed, but will give more room for &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;chkconfig&amp;lt;/span&amp;gt; to order the dependent daemons by allowing DRBD to be started as low as position &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;20&amp;lt;/span&amp;gt;, rather than waiting until position &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;70&amp;lt;/span&amp;gt;. This is somewhat more compatible with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clvmd&amp;lt;/span&amp;gt; which normally start at positions &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;21&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;24&amp;lt;/span&amp;gt;, respectively&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/init.d/drbd&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
#&lt;br /&gt;
# chkconfig: - 20 08&lt;br /&gt;
# description: Loads and unloads the drbd module&lt;br /&gt;
#&lt;br /&gt;
# Copright 2001-2008 LINBIT Information Technologies&lt;br /&gt;
# Philipp Reisner, Lars Ellenberg&lt;br /&gt;
#&lt;br /&gt;
### BEGIN INIT INFO&lt;br /&gt;
# Provides: drbd&lt;br /&gt;
# Required-Start: $local_fs $network $syslog cman&lt;br /&gt;
# Required-Stop:  $local_fs $network $syslog&lt;br /&gt;
# Should-Start:   sshd multipathd&lt;br /&gt;
# Should-Stop:    sshd multipathd&lt;br /&gt;
# Default-Start:&lt;br /&gt;
# Default-Stop:&lt;br /&gt;
# Short-Description:    Control drbd resources.&lt;br /&gt;
### END INIT INFO&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Altering clvmd ==&lt;br /&gt;
&lt;br /&gt;
Now we will now tell &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clvmd&amp;lt;/span&amp;gt; to start after &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;drbd&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: There is currently a minor bug with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;lvm2-cluster&amp;lt;/span&amp;gt; version &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;2.02.73-2&amp;lt;/span&amp;gt; in that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/init.d/clvmd&amp;lt;/span&amp;gt; is set by default to mode &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;0555&amp;lt;/span&amp;gt;. This is easily corrected by running the following command. Please check bug [https://bugzilla.redhat.com/show_bug.cgi?id=636066 636066] to see if this has been resolved.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
chmod u+w /etc/init.d/clvmd&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once you&#039;ve got write access, edit the file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/init.d/clvmd&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
#&lt;br /&gt;
# chkconfig: - 24 76&lt;br /&gt;
# description: Starts and stops clvmd&lt;br /&gt;
#&lt;br /&gt;
# For Red-Hat-based distributions such as Fedora, RHEL, CentOS.&lt;br /&gt;
#              &lt;br /&gt;
### BEGIN INIT INFO&lt;br /&gt;
# Provides: clvmd&lt;br /&gt;
# Required-Start: $local_fs drbd&lt;br /&gt;
# Required-Stop: $local_fs&lt;br /&gt;
# Default-Start:&lt;br /&gt;
# Default-Stop: 0 1 6&lt;br /&gt;
# Short-Description: Clustered LVM Daemon&lt;br /&gt;
### END INIT INFO&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Altering gfs2 ==&lt;br /&gt;
&lt;br /&gt;
Now we will now tell &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;gfs2&amp;lt;/span&amp;gt; to start after &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clvmd&amp;lt;/span&amp;gt;. You will notice that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt; is already listed under &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Required-Start&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Required-Stop&amp;lt;/span&amp;gt;. It&#039;s true that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt; must be started, but we&#039;ve created a chain here so we can safely replace it with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clvmd&amp;lt;/span&amp;gt; in the start line.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/init.d/gfs2&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
#&lt;br /&gt;
# gfs2 mount/unmount helper&lt;br /&gt;
#&lt;br /&gt;
# chkconfig: - 26 74&lt;br /&gt;
# description: mount/unmount gfs2 filesystems configured in /etc/fstab&lt;br /&gt;
&lt;br /&gt;
### BEGIN INIT INFO&lt;br /&gt;
# Provides:             gfs2&lt;br /&gt;
# Required-Start:       $network clvmd&lt;br /&gt;
# Required-Stop:        $network&lt;br /&gt;
# Default-Start:&lt;br /&gt;
# Default-Stop:&lt;br /&gt;
# Short-Description:    mount/unmount gfs2 filesystems configured in /etc/fstab&lt;br /&gt;
# Description:          mount/unmount gfs2 filesystems configured in /etc/fstab&lt;br /&gt;
### END INIT INFO&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Altering xendomains ==&lt;br /&gt;
&lt;br /&gt;
Finally, we will alter &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xendomains&amp;lt;/span&amp;gt; so that it starts last, after &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;gfs2&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/init.d/xendomains&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
#&lt;br /&gt;
# /etc/init.d/xendomains&lt;br /&gt;
# Start / stop domains automatically when domain 0 boots / shuts down.&lt;br /&gt;
#&lt;br /&gt;
# chkconfig: 345 99 00&lt;br /&gt;
# description: Start / stop Xen domains.&lt;br /&gt;
#&lt;br /&gt;
# This script offers fairly basic functionality.  It should work on Redhat&lt;br /&gt;
# but also on LSB-compliant SuSE releases and on Debian with the LSB package&lt;br /&gt;
# installed.  (LSB is the Linux Standard Base)&lt;br /&gt;
#&lt;br /&gt;
# Based on the example in the &amp;quot;Designing High Quality Integrated Linux&lt;br /&gt;
# Applications HOWTO&amp;quot; by Avi Alkalay&lt;br /&gt;
# &amp;lt;http://www.tldp.org/HOWTO/HighQuality-Apps-HOWTO/&amp;gt;&lt;br /&gt;
#&lt;br /&gt;
### BEGIN INIT INFO&lt;br /&gt;
# Provides:          xendomains&lt;br /&gt;
# Required-Start:    $syslog $remote_fs xend gfs2&lt;br /&gt;
# Should-Start:&lt;br /&gt;
# Required-Stop:     $syslog $remote_fs xend&lt;br /&gt;
# Should-Stop:&lt;br /&gt;
# Default-Start:     3 4 5&lt;br /&gt;
# Default-Stop:      0 1 2 6&lt;br /&gt;
# Default-Enabled:   yes&lt;br /&gt;
# Short-Description: Start/stop secondary xen domains&lt;br /&gt;
# Description:       Start / stop domains automatically when domain 0 &lt;br /&gt;
#                    boots / shuts down.&lt;br /&gt;
### END INIT INFO&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Applying The Changes ==&lt;br /&gt;
&lt;br /&gt;
Change the start order by removing and re-adding all cluster-related daemons using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;chkconfig&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
chkconfig xenstored off; chkconfig xenconsoled off; chkconfig xend off; chkconfig cman off; chkconfig drbd off; chkconfig clvmd off; chkconfig gfs2 off; chkconfig xendomains off&lt;br /&gt;
chkconfig xendomains on; chkconfig gfs2 on; chkconfig clvmd on; chkconfig drbd on; chkconfig cman on; chkconfig xend on; chkconfig xenconsoled on; chkconfig xenstored on&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now verify that the start order is as we want it. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ls -lah /etc/rc3.d/&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
lrwxrwxrwx.  1 root root   19 Sep 20 13:37 S26xenstored -&amp;gt; ../init.d/xenstored&lt;br /&gt;
lrwxrwxrwx.  1 root root   21 Sep 20 13:37 S27xenconsoled -&amp;gt; ../init.d/xenconsoled&lt;br /&gt;
lrwxrwxrwx.  1 root root   14 Sep 20 13:37 S28xend -&amp;gt; ../init.d/xend&lt;br /&gt;
lrwxrwxrwx.  1 root root   14 Sep 20 13:37 S29cman -&amp;gt; ../init.d/cman&lt;br /&gt;
lrwxrwxrwx.  1 root root   14 Sep 20 13:37 S70drbd -&amp;gt; ../init.d/drbd&lt;br /&gt;
lrwxrwxrwx.  1 root root   15 Sep 20 13:37 S71clvmd -&amp;gt; ../init.d/clvmd&lt;br /&gt;
lrwxrwxrwx.  1 root root   14 Sep 20 13:37 S72gfs2 -&amp;gt; ../init.d/gfs2&lt;br /&gt;
lrwxrwxrwx.  1 root root   20 Sep 20 13:37 S99xendomains -&amp;gt; ../init.d/xendomains&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Setting Up Xen =&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;WARNING&#039;&#039;&#039;&#039;&#039;: Everything below here is pretty &#039;&#039;&#039;seriously screwed up&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: This is not meant to be an extensive tutorial on Xen itself. It covers enough to get domU VMs provisioned in a manner that will take advantage of the cluster. As such, there is minimal explanation of configuration file options. If you need further help, please drop by the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;##xen&amp;lt;/span&amp;gt; (yes, two &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;##&amp;lt;/span&amp;gt;) [[IRC]] channel on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;freenode.org&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Install The Hypervisor Tools ==&lt;br /&gt;
&lt;br /&gt;
These tools are very useful in provisioning and managing domU VMs.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum -y install virt-install virt-viewer&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Install The HVM/KVM Tools ==&lt;br /&gt;
&lt;br /&gt;
For &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;hvm&amp;lt;/span&amp;gt; (Hardware Virtual Machines), which is required for [http://www.virtuatopia.com/index.php/Virtualizing_Windows_Server_2008_with_Xen paravirtualized Microsoft] VMs, you must install the following packages as well.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum -y install qemu-kvm.x86_64 qemu-kvm-tools.x86_64&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Ensure That Virtualization Is Enabled ==&lt;br /&gt;
&lt;br /&gt;
Many motherboards disable &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;hvm&amp;lt;/span&amp;gt; by default in their [[BIOS]]. Assuming that you&#039;ve got a dom0 kernel running at this stage, you can check if this is the case by checking the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xm info&amp;lt;/span&amp;gt; output.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
xm info&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
host                   : an-node04.alteeve.com&lt;br /&gt;
release                : 2.6.32.23-170.dom0_an1.fc13.x86_64&lt;br /&gt;
version                : #1 SMP Sun Oct 10 20:39:19 EDT 2010&lt;br /&gt;
machine                : x86_64&lt;br /&gt;
nr_cpus                : 4&lt;br /&gt;
nr_nodes               : 1&lt;br /&gt;
cores_per_socket       : 4&lt;br /&gt;
threads_per_core       : 1&lt;br /&gt;
cpu_mhz                : 2209&lt;br /&gt;
hw_caps                : 178bf3ff:efd3fbff:00000000:00001310:00802001:00000000:000037ff:00000000&lt;br /&gt;
virt_caps              : hvm&lt;br /&gt;
total_memory           : 4063&lt;br /&gt;
free_memory            : 2987&lt;br /&gt;
node_to_cpu            : node0:0-3&lt;br /&gt;
node_to_memory         : node0:2987&lt;br /&gt;
node_to_dma32_mem      : node0:2928&lt;br /&gt;
max_node_id            : 0&lt;br /&gt;
xen_major              : 4&lt;br /&gt;
xen_minor              : 0&lt;br /&gt;
xen_extra              : .1&lt;br /&gt;
xen_caps               : xen-3.0-x86_64 xen-3.0-x86_32p hvm-3.0-x86_32 hvm-3.0-x86_32p hvm-3.0-x86_64 &lt;br /&gt;
xen_scheduler          : credit&lt;br /&gt;
xen_pagesize           : 4096&lt;br /&gt;
platform_params        : virt_start=0xffff800000000000&lt;br /&gt;
xen_changeset          : unavailable&lt;br /&gt;
xen_commandline        : dom0_mem=1024M&lt;br /&gt;
cc_compiler            : gcc version 4.4.4 20100630 (Red Hat 4.4.4-10) (GCC) &lt;br /&gt;
cc_compile_by          : root&lt;br /&gt;
cc_compile_domain      : &lt;br /&gt;
cc_compile_date        : Mon Oct 11 01:10:38 EDT 2010&lt;br /&gt;
xend_config_format     : 4&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Look at the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt_caps&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xen_caps&amp;lt;/span&amp;gt; lines. Notice the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;hvm&amp;lt;/span&amp;gt; entries? This shows that HVM, also known as &amp;quot;secure virtualization&amp;quot;, has been enabled. If you do not see this, please check your mainboard manual for information on enabling this on your system.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: The next paragraph applies only when running a vanilla kernel.&lt;br /&gt;
&lt;br /&gt;
If you are running a vanilla kernel, you can check to see if your CPU has support for HVM guests but checking &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/proc/cpuinfo&amp;lt;/span&amp;gt;. What you&#039;re looking for depends on your CPU manufacturer. If you have an Intel CPU, you need to look for the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vmx&amp;lt;/span&amp;gt; flag. Likewise, with AMD CPUs, you need to look for the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;svm&amp;lt;/span&amp;gt; flag.&lt;br /&gt;
&lt;br /&gt;
For a more complete, if somewhat dated paper on this topic, please [http://fedoraproject.org/wiki/FedoraXenQuickstartFC6#Fully-virtualized_guests_.28HVM.2FIntel-VT.2FAMD-V.29 Fedora 6 Xen Quickstart Guide, System Requirements].&lt;br /&gt;
&lt;br /&gt;
== Enabling Migration ==&lt;br /&gt;
&lt;br /&gt;
By default, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xend&amp;lt;/span&amp;gt; will not allow domU VMs from being migrated onto or off of a given dom0 host. Given that we&#039;ve got a cluster though, we very much want this behaviour, so now we will enable it. This is done by making edits to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/xen/xend-config.sxp&amp;lt;/span&amp;gt;. Below is a concise list of options that must be set. Some exist already in the file and need to be commented out or altered.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Warning&#039;&#039;&#039;: The values below are &#039;&#039;&#039;very&#039;&#039;&#039; permissive. Please review each option and improve the security to fit your network before going into production!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/xen/xend-config.sxp &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
(xend-http-server yes)&lt;br /&gt;
(xend-unix-server yes)&lt;br /&gt;
(xend-tcp-xmlrpc-server yes)&lt;br /&gt;
(xend-relocation-server yes)&lt;br /&gt;
(xend-udev-event-server yes)&lt;br /&gt;
(xend-port            8000)&lt;br /&gt;
(xend-relocation-port 8002)&lt;br /&gt;
(xend-address &#039;&#039;)&lt;br /&gt;
(xend-relocation-address &#039;&#039;)&lt;br /&gt;
(xend-relocation-hosts-allow &#039;&#039;)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once done, restart &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xend&amp;lt;/span&amp;gt;. It is usually safest to stop the cluster before hand to avoid accidental fencing caused by the underlying network being reconfigured.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/gfs2 stop&lt;br /&gt;
/etc/init.d/clvmd stop&lt;br /&gt;
/etc/init.d/cman stop&lt;br /&gt;
/etc/init.d/xend restart&lt;br /&gt;
/etc/init.d/cman start&lt;br /&gt;
/etc/init.d/clvmd start&lt;br /&gt;
/etc/init.d/gfs2 start&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Provisioning domU VMs ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: Long and ugly, but it worked. Needs more testing though.&lt;br /&gt;
&lt;br /&gt;
Web-based install:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# Fedora 13 x86_64 RPM builder VM&lt;br /&gt;
lvcreate -L 40G -n f13_builder_01 drbd0_vg0&lt;br /&gt;
virt-install --connect xen \&lt;br /&gt;
             --name f13_builder_01 \&lt;br /&gt;
             --ram 1024 \&lt;br /&gt;
             --arch x86_64 \&lt;br /&gt;
             --vcpus 1 \&lt;br /&gt;
             --cpuset 1 \&lt;br /&gt;
             --location http://192.168.1.10/f13/x86_64/img/ \&lt;br /&gt;
             --os-type linux \&lt;br /&gt;
             --os-variant fedora13 \&lt;br /&gt;
             --disk path=/dev/drbd0_vg0/f13_builder_01 \&lt;br /&gt;
             --network bridge=eth0,mac=00:16:3e:00:10:01 \&lt;br /&gt;
             --vnc \&lt;br /&gt;
             --paravirt&lt;br /&gt;
&lt;br /&gt;
# A CentOS test server&lt;br /&gt;
lvcreate -L 40G -n c5_test_01 drbd0_vg0&lt;br /&gt;
virt-install --connect xen \&lt;br /&gt;
             --name c5_test_01 \&lt;br /&gt;
             --ram 1024 \&lt;br /&gt;
             --arch x86_64 \&lt;br /&gt;
             --vcpus 1 \&lt;br /&gt;
             --cpuset 1-3 \&lt;br /&gt;
             --location http://192.168.1.10/c5/x86_64/img/ \&lt;br /&gt;
             --os-type linux \&lt;br /&gt;
             --os-variant rhel5.4 \&lt;br /&gt;
             --disk path=/dev/drbd0_vg0/c5_test_01 \&lt;br /&gt;
             --network bridge=eth0,mac=00:16:3e:00:10:02 \&lt;br /&gt;
             --vnc \&lt;br /&gt;
             --paravirt&lt;br /&gt;
&lt;br /&gt;
# Red Hat Enterprise Linux 6 beta 2 test server&lt;br /&gt;
lvcreate -L 40G -n rh6b2_test_01 drbd0_vg0&lt;br /&gt;
virt-install --connect xen \&lt;br /&gt;
             --name rh6b2_test_01 \&lt;br /&gt;
             --ram 1024 \&lt;br /&gt;
             --arch x86_64 \&lt;br /&gt;
             --vcpus 1 \&lt;br /&gt;
             --cpuset 1 \&lt;br /&gt;
             --location http://192.168.1.10/rhel6/x86_64/img/ \&lt;br /&gt;
             --os-type linux \&lt;br /&gt;
             --os-variant rhel6 \&lt;br /&gt;
             --disk path=/dev/drbd0_vg0/rh6b2_test_01 \&lt;br /&gt;
             --network bridge=eth0,mac=00:16:3e:00:10:03 \&lt;br /&gt;
             --vnc \&lt;br /&gt;
             --paravirt&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
ISO-based install:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
### Still sorting this out - doesn&#039;t seem to find &#039;qemu-dm&#039; (wants to use &#039;lib64&#039; but it&#039;s in &#039;lib&#039;).&lt;br /&gt;
# Windows 2008 Business Server&lt;br /&gt;
lvcreate -L 50G -n win2008_01 drbd0_vg0&lt;br /&gt;
virt-install --connect xen \&lt;br /&gt;
             --name win2008_01 \&lt;br /&gt;
             --ram 1024 \&lt;br /&gt;
             --arch x86_64 \&lt;br /&gt;
             --vcpus 1 \&lt;br /&gt;
             --cpuset 1 \&lt;br /&gt;
             --cdrom /xen_shared/iso/Win_Server_2008_Bis_x86_64.iso \&lt;br /&gt;
             --os-type windows \&lt;br /&gt;
             --os-variant win2k8 \&lt;br /&gt;
             --disk path=/dev/drbd_vg0/win2008_01 \&lt;br /&gt;
             --network bridge=eth0,mac=00:16:3e:00:10:04 \&lt;br /&gt;
             --vnc \&lt;br /&gt;
             --hvm&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Enabling Migration ==&lt;br /&gt;
&lt;br /&gt;
We need to make some changes to the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xend-config.sxp&amp;lt;/span&amp;gt; in order to enable migrating domU VMs between the nodes.&lt;br /&gt;
&lt;br /&gt;
So start by editing the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/xen/xend-config.sxp&amp;lt;/span&amp;gt; file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/xen/xend-config.sxp&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that this is not meant to be an extensive list, nor a set of changes that maximize security. This will get you up and running, then from there you can explore the other options one at a time to improve security.&lt;br /&gt;
&lt;br /&gt;
=== xen-api-server ===&lt;br /&gt;
&lt;br /&gt;
This option allows for one or more access method definitions to your domU VMs on a given node. By default, it is set to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;(xen-api-server ((unix)))&amp;lt;/span&amp;gt; which only allows access from the local machine. We&#039;ll add a new access definition that will tell Xen to listen on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;localhost&amp;lt;/span&amp;gt; and on our back-channel on [[TCP]] port &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;9001&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
# Default:&lt;br /&gt;
#   (xen-api-server ((unix)))&lt;br /&gt;
(xen-api-server ((9001 pam &#039;^localhost$ ^10\\.0\\.1&#039;) (unix none)))&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Provision A Virtual Machine ==&lt;br /&gt;
&lt;br /&gt;
Let&#039;s walk through the creation of a simple [[CentOS]] 5.x [[domU]]. We&#039;ll call it &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;c5_test_01&amp;lt;/span&amp;gt;. Personally, I like to name my virtual machines with the format &amp;quot;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;os_role_seq&amp;lt;/span&amp;gt;&amp;quot; (&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;Operating System ID&amp;gt;_&amp;lt;Role of the VM&amp;gt;_&amp;lt;Sequence Integer&amp;gt;&amp;lt;/span&amp;gt;). There are no (known) restrictions on virtual machine names, so feel free to use names that made sense for you.&lt;br /&gt;
&lt;br /&gt;
=== Install virt-manager ===&lt;br /&gt;
&lt;br /&gt;
We will now start using a graphical tool called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-manager&amp;lt;/span&amp;gt;. It simplifies the creation of domU VMs quite a bit.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install virt-manager&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Be sure that you&#039;ve enabled &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;X-Forwarding&amp;lt;/span&amp;gt; if you&#039;ve &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ssh&amp;lt;/span&amp;gt;&#039;ed into your nodes. This may require modifying your &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/sshd_config&amp;lt;/span&amp;gt; file and changing &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;X11Forwarding&amp;lt;/span&amp;gt; to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;yes&amp;lt;/span&amp;gt;. Then when you connect to the node, you will need to use the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ssh -X user@node&amp;lt;/span&amp;gt; switch.&lt;br /&gt;
&lt;br /&gt;
We&#039;ll come back to this program shortly.&lt;br /&gt;
&lt;br /&gt;
=== Create The CLVM LV ===&lt;br /&gt;
&lt;br /&gt;
We will create a new [[CLVM]] [[LV]] for this [[VM]]. It will act as the VM&#039;s hard drive, so it needs to have enough capacity for the OS and any data you expect the VM to need. As we&#039;re creating a hypothetical router/firewall, we will not need much space. We&#039;ll use 20 [[GiB]], which should be more than enough.&lt;br /&gt;
&lt;br /&gt;
As before, this will only need to be done on one node. Being that it is on top of the DRBD resource, it will be visible to both nodes.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Node1&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
lvcreate -L 20G -n c5_test_01 drbd0_vg0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
  Logical volume &amp;quot;c5_test_01&amp;quot; created&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Both&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Verify that the new LV is indeed visible from both nodes now.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
lvdisplay &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
  --- Logical volume ---&lt;br /&gt;
  LV Name                /dev/drbd0_vg0/xen_shared&lt;br /&gt;
  VG Name                drbd0_vg0&lt;br /&gt;
  LV UUID                yjt41B-cdc4-LGV4-Ds0m-eRVv-FIY7-3FK4Kb&lt;br /&gt;
  LV Write Access        read/write&lt;br /&gt;
  LV Status              available&lt;br /&gt;
  # open                 1&lt;br /&gt;
  LV Size                20.00 GiB&lt;br /&gt;
  Current LE             5120&lt;br /&gt;
  Segments               1&lt;br /&gt;
  Allocation             inherit&lt;br /&gt;
  Read ahead sectors     auto&lt;br /&gt;
  - currently set to     256&lt;br /&gt;
  Block device           253:0&lt;br /&gt;
   &lt;br /&gt;
  --- Logical volume ---&lt;br /&gt;
  LV Name                /dev/drbd0_vg0/c5_test_01&lt;br /&gt;
  VG Name                drbd0_vg0&lt;br /&gt;
  LV UUID                eOcBZz-nJzz-wHwg-4cBL-ZZHm-1cm6-Sf82xC&lt;br /&gt;
  LV Write Access        read/write&lt;br /&gt;
  LV Status              available&lt;br /&gt;
  # open                 0&lt;br /&gt;
  LV Size                20.00 GiB&lt;br /&gt;
  Current LE             5120&lt;br /&gt;
  Segments               1&lt;br /&gt;
  Allocation             inherit&lt;br /&gt;
  Read ahead sectors     auto&lt;br /&gt;
  - currently set to     256&lt;br /&gt;
  Block device           253:1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we&#039;ve got the space, we&#039;re ready to provision!&lt;br /&gt;
&lt;br /&gt;
=== Connecting To The Hypervisor From virt-manager ===&lt;br /&gt;
&lt;br /&gt;
At this point, we&#039;ll be using the graphical &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-manager&amp;lt;/span&amp;gt; tool. &lt;br /&gt;
&lt;br /&gt;
==== Running virt-manager Directly On a Node ====&lt;br /&gt;
&lt;br /&gt;
If you are working on the nodes directly, you can run &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-manager&amp;lt;/span&amp;gt; but you will need to have Gnome or KDE started first. The easiest way to do this is to switch to run level 5. As an unprivileged user, run the following command.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
startx&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From there, click on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Application&amp;lt;/span&amp;gt; -&amp;gt; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;System Tools&amp;lt;/span&amp;gt; -&amp;gt; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Virtual machine Manager&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Image:virt-manager_local-node_01.png|thumb|500px|center|Where to find &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-manager&amp;lt;/span&amp;gt; in Fedora 13]]&lt;br /&gt;
&lt;br /&gt;
==== Running virt-manager Remotely Over X-Forwarding ====&lt;br /&gt;
&lt;br /&gt;
Some features in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-manager&amp;lt;/span&amp;gt; don&#039;t work well unless they are run off of the local machine. The best way to accomplish this from a remote system is to use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;X-Forwarding&amp;lt;/span&amp;gt;, which was discussed in the [[#Install virt-manager|Install virt-manager]] above. &lt;br /&gt;
&lt;br /&gt;
Generally speaking, I prefer to provision VMs using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-manager&amp;lt;/span&amp;gt; directly on a cluster node. This avoids some problems, like accessing underlying LVM volumes. So to do this when you can&#039;t directly sit at a node, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ssh&amp;lt;/span&amp;gt; into your node using the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;-X&amp;lt;/span&amp;gt; switch.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ssh -X root@an-node01&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Last login: Sun Sep 19 22:02:38 2010&lt;br /&gt;
[root@an-node01 ~]# &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now start &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-manager&amp;lt;/span&amp;gt; at the command line and wait for it to open on your local workstation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
virt-manager&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: If your local workstation has a different version of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;X&amp;lt;/span&amp;gt; server or Gnome, the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-manager&amp;lt;/span&amp;gt; window could look fairly primitive. It will work just the same though, and all the icons will be in the same place.&lt;br /&gt;
&lt;br /&gt;
==== Running virt-manager Locally On a Workstation ====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-manager&amp;lt;/span&amp;gt; tool can be installed on a computer outside of the cluster and then used to connect to the hypervisor on either node. This is very useful for daily usage of your virtual machines, but isn&#039;t recommended during the provisioning stage. In some cases, running &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-manager&amp;lt;/span&amp;gt; remotely will cause it to not see the LVM volumes properly, preventing you from choosing the LV for your new VM.&lt;br /&gt;
&lt;br /&gt;
To connect to the hypervisor on the cluster nodes, click on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;File&amp;lt;/span&amp;gt; -&amp;gt; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Add Connection&amp;lt;/span&amp;gt;. Change the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Hypervison&amp;lt;/span&amp;gt; to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Xen&amp;lt;/span&amp;gt; and then change the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Connection&amp;lt;/span&amp;gt; to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Remote tunnel over SSH&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[Image:virt-manager_remote-workstation_01.png|thumb|500px|center|Adding a remote connection in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-manager&amp;lt;/span&amp;gt; from a workstation]]&lt;br /&gt;
&lt;br /&gt;
In some cases, not all of the nodes on the network will be seen. In the screen shot above, you can see that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt; can be seen, but &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt; wasn&#039;t. To add the missing one, just type &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;node-name.local&amp;lt;/span&amp;gt; (&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01.local&amp;lt;/span&amp;gt; above). Once selected, hit &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Connect&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Once the two nodes have been connected, you should see them on the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-manager&amp;lt;/span&amp;gt; main page.&lt;br /&gt;
&lt;br /&gt;
[[Image:virt-manager_remote-workstation_02.png|thumb|500px|center|Remote connection in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-manager&amp;lt;/span&amp;gt; to both nodes in the cluster]]&lt;br /&gt;
&lt;br /&gt;
Once you seen your nodes, you can proceed to use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-manager&amp;lt;/span&amp;gt; the same as if you were running it on one of the nodes directly.&lt;br /&gt;
&lt;br /&gt;
=== Using virt-manager To Provision Our VM ===&lt;br /&gt;
&lt;br /&gt;
How you use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-manager&amp;lt;/span&amp;gt; will be the same regardless of how or where you started it. The following steps will walk you through the program&#039;s use.&lt;br /&gt;
&lt;br /&gt;
With the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Virtual Machine Manager&amp;lt;/span&amp;gt; main menu connected to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;localhost (QEMU)&amp;lt;/span&amp;gt;, we can now begin the process of provisioning a new Xen domU virtual machine! The top-left icon, which looks like a monitor with the &amp;quot;play&amp;quot; button on it&#039;s screen, will be used to provision our virtual machine.&lt;br /&gt;
&lt;br /&gt;
[[Image:virt-manager_local-node_02.png|thumb|500px|center|The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-manager&amp;lt;/span&amp;gt; main menu]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Madi&#039;&#039;&#039;: You left off here.&lt;br /&gt;
&lt;br /&gt;
Once you press the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Create a new virtual machine&amp;lt;/span&amp;gt; button you will be asked to name the VM and to choose the install type. Even if you have a [[PXE]] server, choose Network Install.&lt;br /&gt;
&lt;br /&gt;
[[Image:virt-manager_provision_02.png|thumb|500px|center|Provisioning a Xen domU - Naming the VM and choosing the install source]&lt;br /&gt;
&lt;br /&gt;
=== Storing The domU Configuration Files ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;ToDo&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Node1&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
As this is our first [[domU]], we&#039;ll start by creating our shared configuration directory on the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/xen_shared&amp;lt;/span&amp;gt; [[GFS2]] partition we just created.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
mkdir /xen_shared/config&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To confirm again that the GFS2 partition is working, verify that this directory is visible from both nodes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ls -lah /xen_shared/&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
total 20K&lt;br /&gt;
drwxr-xr-x.  3 root root 3.8K Sep 13 12:57 .&lt;br /&gt;
dr-xr-xr-x. 27 root root 4.0K Sep 13 11:32 ..&lt;br /&gt;
drwxr-xr-x.  2 root root 3.8K Sep 13 12:57 config&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{footer}}&lt;/div&gt;</summary>
		<author><name>SRSullivan</name></author>
	</entry>
	<entry>
		<id>https://alteeve.com/w/index.php?title=Two_Node_Fedora_13_Cluster_-_Xen-Based_Virtual_Machine_Host_on_DRBD%2BCLVM&amp;diff=2283</id>
		<title>Two Node Fedora 13 Cluster - Xen-Based Virtual Machine Host on DRBD+CLVM</title>
		<link rel="alternate" type="text/html" href="https://alteeve.com/w/index.php?title=Two_Node_Fedora_13_Cluster_-_Xen-Based_Virtual_Machine_Host_on_DRBD%2BCLVM&amp;diff=2283"/>
		<updated>2010-10-13T18:44:44Z</updated>

		<summary type="html">&lt;p&gt;SRSullivan: /* Install The Hypervisor */  &amp;quot;-y&amp;quot; on &amp;quot;yum install&amp;quot; should not be part of defualt recommended command.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{howto_header}}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Warning&#039;&#039;&#039;: This is currently a dumping ground for notes. &#039;&#039;&#039;&#039;&#039;DO NOT FOLLOW THIS DOCUMENT&#039;S INSTRUCTIONS&#039;&#039;&#039;&#039;&#039;. Seriously, it could blow up your computer or cause winter to come early.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
This HowTo will walk you through setting up [[Xen]] [[VM]]s using [[DRBD]] and [[CLVM]] for high availability.&lt;br /&gt;
&lt;br /&gt;
= Prerequisite =&lt;br /&gt;
&lt;br /&gt;
This talk is an extension of the [[Two Node Fedora 13 Cluster]] HowTo. As such, you will be expected to have a freshly built two-node cluster with spare disk space on either node.&lt;br /&gt;
&lt;br /&gt;
Please do not proceed until you have completed the first tutorial.&lt;br /&gt;
&lt;br /&gt;
= Overview =&lt;br /&gt;
&lt;br /&gt;
This tutorial will cover several topics; [[DRBD]], [[CLVM]], [[GFS2]], [[Xen]] [[dom0]] and [[domU]] [[VM]]s and [[rgmanager]]. Their relationship is thus:&lt;br /&gt;
&lt;br /&gt;
* DRBD provides a mechanism to replicate data across both nodes in real time and guarantees a consistent view of that data from either node. Think of it like [[TLUG_Talk:_Storage_Technologies_and_Theory#Level_1|RAID level 1]], but across machines.&lt;br /&gt;
* CLVM sits on the DRBD partition and provides the underlying mechanism for allowing both nodes to access shared data in a clustered environment. It will host a shared filesystem by way of GFS2 as well as [[LV]]s that Xen&#039;s domU VMs will use as their disk space.&lt;br /&gt;
* GFS2 will be the clustered file system used on one of the DBRD-backed, CLVM-managed partitions. Files that need to be shared between nodes, like the Xen VM configuration files, will exist on this partition.&lt;br /&gt;
* Xen will be the hypervisor in use that will manage the various virtual machines. Each virtual machine will exist in an LVM LV.&lt;br /&gt;
** Xen&#039;s dom0 is the special &amp;quot;host&amp;quot; virtual machine. In this case, dom0 will be the OS installed in the first HowTo.&lt;br /&gt;
** Xen&#039;s domU virtual machines will be the &amp;quot;floating&amp;quot;, highly available servers.&lt;br /&gt;
* Lastly, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; will be the component of [[cman]] that will be configured to manage the automatic migration of the virtual machines when failures occur and when nodes recover.&lt;br /&gt;
&lt;br /&gt;
= Setting Up Xen =&lt;br /&gt;
&lt;br /&gt;
It may seem odd to start with [[Xen]] at this stage, but it is going to rather fundamentally alter each node&#039;s &amp;quot;host&amp;quot; operating system.&lt;br /&gt;
&lt;br /&gt;
At this point, each node&#039;s host OS is a traditional operating system operating on the bare metal. When we install a &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;dom0&amp;lt;/span&amp;gt; kernel though, we tell Xen to boot a mini operating system first, and then to boot our &amp;quot;host&amp;quot; operating system. In effect, this converts the host node&#039;s operating system into just another virtual machine, albeit with a special view of the underlying hardware and Xen hypervisor.&lt;br /&gt;
&lt;br /&gt;
This conversion is somewhat disruptive, so I like to get it out of the way right away. We will then do the rest of the setup before returning to Xen later on to create the floating virtual machines.&lt;br /&gt;
&lt;br /&gt;
== A Note On The State Of Xen dom0 Support In Fedora ==&lt;br /&gt;
&lt;br /&gt;
As of Fedora 8, support for Xen [[dom0]] has been removed, but support for the hypervisor and [[domU]] virtual machines remains. Red Hat&#039;s position is that KVM will be the supported platform going forward. That said, [http://fedoraproject.org/wiki/Features/XenPvopsDom0 this page] seems to indicate that PV Ops dom0 kernels will be supported in the future. Specifically, when dom0 support is merged into the mainline Linux kernel. When this will be is open to speculation, though &amp;quot;by Fedora 16&amp;quot; seems to be a reasonable educated guess.&lt;br /&gt;
&lt;br /&gt;
What this means for us is that we need to use a non-standard dom0 kernel. Specifically, we will use a kernel created by [http://myoung.fedorapeople.org/ myoung] (Micheal Young) for Fedora 12. This kernel does not directly support DRBD, so be aware that we will need to build new DRBD kernel modules for his kernel and then rebuild the DRBD modules each time his kernel is updated.&lt;br /&gt;
&lt;br /&gt;
== A Note On Rolling Your Own RPMs ==&lt;br /&gt;
&lt;br /&gt;
If you want to roll the source RPMs for both the hypervisor and the [[dom0]] kernel, you will need to make both before you can boot into your dom0 for the first time. This is because the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;dom0&amp;lt;/span&amp;gt; kernel needs the Xen microkernel provided by the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xen&amp;lt;/span&amp;gt; hypervisor package to boot.&lt;br /&gt;
&lt;br /&gt;
== Install The Hypervisor ==&lt;br /&gt;
&lt;br /&gt;
We will use [[Xen]] 4.0.1, as provided by [http://pasik.reaktio.net/fedora/ Pasik]. We&#039;ll use the [http://pasik.reaktio.net/fedora/xen-4.0.1-0.2.fc13.src.rpm source RPM] to build our own RPM.&lt;br /&gt;
&lt;br /&gt;
Regardless of whether you install from source RPMs or the pre-compiled ones, you will need to install the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;libvirt&amp;lt;/span&amp;gt;, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;qemu&amp;lt;/span&amp;gt;, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;SDL&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;PyXML&amp;lt;/span&amp;gt; packages from the standard repositories before you can proceed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install libvirt PyXML.x86_64 qemu.x86_64 SDL.x86_64&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Please don&#039;t remove existing &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xen&amp;lt;/span&amp;gt; utilities and libraries prior to installing the newer version. If you do, core clustering components may be removed. Instead, be sure to use the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rpm -Uvh&amp;lt;/span&amp;gt; switches to upgrade the existing packages that may be installed already.&lt;br /&gt;
&lt;br /&gt;
=== Installing Prebuilt RPMs ===&lt;br /&gt;
&lt;br /&gt;
These are locally stored copies of the Xen RPMs built for [[x86_64]] on Fedora 13. This requires some dependent packages be installed first.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Warning&#039;&#039;&#039;: These are all recompiled for this website against Fedora 13, x86_64. If you feel more comfortable, please use [[RPM]]s from a source you are familiar with.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cd ~&lt;br /&gt;
wget -c https://alteeve.com/files/an-cluster/xen-4.0.1-0.2.fc13.x86_64.rpm&lt;br /&gt;
wget -c https://alteeve.com/files/an-cluster/xen-doc-4.0.1-0.2.fc13.x86_64.rpm&lt;br /&gt;
wget -c https://alteeve.com/files/an-cluster/xen-hypervisor-4.0.1-0.2.fc13.x86_64.rpm&lt;br /&gt;
wget -c https://alteeve.com/files/an-cluster/xen-libs-4.0.1-0.2.fc13.x86_64.rpm&lt;br /&gt;
wget -c https://alteeve.com/files/an-cluster/xen-runtime-4.0.1-0.2.fc13.x86_64.rpm&lt;br /&gt;
rpm -Uvh xen*4.0.1-0.2.fc13.x86_64.rpm&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Optionally, you may wish to install &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;debug&amp;lt;/span&amp;gt; and/or &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;devel&amp;lt;/span&amp;gt; RPMs as well.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
wget -c https://alteeve.com/files/xen-debuginfo-4.0.1-0.2.fc13.x86_64.rpm&lt;br /&gt;
wget -c https://alteeve.com/files/xen-devel-4.0.1-0.2.fc13.x86_64.rpm&lt;br /&gt;
rpm -Uvh xen-d*4.0.1-0.2.fc13.x86_64.rpm&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Building RPMs From Source ===&lt;br /&gt;
&lt;br /&gt;
To build the RPMs from the source, you need to make sure that you have the build environment installed. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: If you are following these instruction after having installed a prior dom0 kernel, you will need to comment out &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;exclude=kernel*&amp;lt;/span&amp;gt; in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/yum.conf&amp;lt;/span&amp;gt; so that the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;kernel-header&amp;lt;/span&amp;gt; package can be installed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/yum.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
# PUT YOUR REPOS HERE OR IN separate files named file.repo&lt;br /&gt;
# in /etc/yum.repos.d&lt;br /&gt;
#exclude=kernel*&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now install the development environment.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum -y groupinstall &amp;quot;Development Libraries&amp;quot;&lt;br /&gt;
yum -y groupinstall &amp;quot;Development Tools&amp;quot;&lt;br /&gt;
yum install transfig texi2html SDL-devel libX11-devel tetex-latex gtk2-devel libaio-devel dev86 iasl xz-devel e2fsprogs-devel glibc-devel.i686 xmlto asciidoc elfutils-libelf-devel&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: If you had to uncomment the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;exclude=kernel*&amp;lt;/span&amp;gt; line earlier, comment it back out now before you forget.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/yum.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
# PUT YOUR REPOS HERE OR IN separate files named file.repo&lt;br /&gt;
# in /etc/yum.repos.d&lt;br /&gt;
exclude=kernel*&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we can now build the RPMs from source.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cd ~&lt;br /&gt;
wget -c https://alteeve.com/files/an-cluster/xen-4.0.1-0.2.fc13.src.rpm&lt;br /&gt;
rpm -ivh xen-4.0.1-0.2.fc13.src.rpm&lt;br /&gt;
cd /root/rpmbuild/SPECS/&lt;br /&gt;
rpmbuild -ba xen.spec&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once this is done, you will have seven RPMs built. Two of them are not really needed (&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xen-debuginfo-4.0.1-0.2.fc13.x86_64.rpm&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xen-devel-4.0.1-0.2.fc13.x86_64.rpm&amp;lt;/span&amp;gt;) and I will leave it up to you may wish to install them or not. If you don&#039;t, modify the next command or move the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;debug&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;devel&amp;lt;/span&amp;gt; RPMs out of the way first.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cd ~/rpmbuild/RPMS/x86_64/&lt;br /&gt;
rpm -Uvh xen*4.0.1-0.2.fc13.x86_64.rpm&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Installing The AN!Cluster dom0 Kernel ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Notice&#039;&#039;&#039;!&lt;br /&gt;
&lt;br /&gt;
The kernel provided here was recompiled on Fedora 13 and is a slightly modified version of [[#Installing Micheal Young&#039;s dom0 Kernel|Micheal Young&#039;s]] kernel available below. I was originally driven to recompile in an effort to solve a DRBD-related kernel oops. For now, unless you have the same DRBD kernel oops, I&#039;d strongly recommend against using the AN!Cluster dom0 kernel until it has been tested much more thoroughly.&lt;br /&gt;
&lt;br /&gt;
With that warning out of the way...&lt;br /&gt;
&lt;br /&gt;
This kernel was compiled on a Fedora 13, x86_64. The DRBD RPMs available a little later where compiled against this dom0 kernel. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--force&amp;lt;/span&amp;gt; is required because the current kernel is newer than &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;2.6.32&amp;lt;/span&amp;gt; used here. Without this switch, the RPM would not install.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cd ~&lt;br /&gt;
wget -c https://alteeve.com/files/an-cluster/kernel-2.6.32.23-170.dom0_an1.fc13.x86_64.rpm&lt;br /&gt;
rpm -ivh --force kernel-2.6.32.23-170.dom0_an1.fc13.x86_64.rpm&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you would like to install the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;debug&amp;lt;/span&amp;gt;, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;devel&amp;lt;/span&amp;gt; and/or &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;header&amp;lt;/span&amp;gt; RPMs for this kernel, they are available below.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;kernel-debuginfo-2.6.32.23-170.dom0_an1.fc13.x86_64.rpm&amp;lt;/span&amp;gt; RPM is 213 [[MiB]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
wget -c https://alteeve.com/files/an-cluster/kernel-2.6.32.23-170.dom0_an1.fc13.x86_64.rpm&lt;br /&gt;
wget -c https://alteeve.com/files/an-cluster/kernel-debuginfo-2.6.32.23-170.dom0_an1.fc13.x86_64.rpm&lt;br /&gt;
wget -c https://alteeve.com/files/an-cluster/kernel-devel-2.6.32.23-170.dom0_an1.fc13.x86_64.rpm&lt;br /&gt;
wget -c https://alteeve.com/files/an-cluster/kernel-headers-2.6.32.23-170.dom0_an1.fc13.x86_64.rpm&lt;br /&gt;
rpm -ivh --force kernel-de*-2.6.32.23-170.dom0_an1.fc13.x86_64.rpm kernel-headers-2.6.32.23-170.dom0_an1.fc13.x86_64.rpm&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Post AN!Cluster dom0 Install Configuration ===&lt;br /&gt;
&lt;br /&gt;
The entry in grub&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/boot/grub/menu.lst&amp;lt;/span&amp;gt; won&#039;t work. You will need to edit it so that it calls the existing installed operating system as a &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;module&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: Copy and modify the entry created by the RPM. Simply copying this entry will almost certainly not work! Your &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;root=&amp;lt;/span&amp;gt; is likely different and your &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rd_MD_UUID=&amp;lt;/span&amp;gt; will definitely be different, even on the same machine across installs. Generally speaking, what follows the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;kernel /vmlinuz-2.6.32.23-170.dom0_an1.fc13.x86_64 ...&amp;lt;/span&amp;gt; entry made by the dom0 kernel can be copied after the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;module /vmlinuz-2.6.32.23-170.dom0_an1.fc13.x86_64 ...&amp;lt;/span&amp;gt; entry in the example below.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /boot/grub/menu.lst&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
title Xen 4.0.x, Linux 2.6.32.23-170.dom0_an1.fc13.x86_64&lt;br /&gt;
        root   (hd0,0)&lt;br /&gt;
        kernel /xen.gz dom0_mem=1024M&lt;br /&gt;
        module /vmlinuz-2.6.32.23-170.dom0_an1.fc13.x86_64 ...&lt;br /&gt;
        module /initramfs-2.6.32.23-170.dom0_an1.fc13.x86_64.img&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Installing Micheal Young&#039;s dom0 Kernel ==&lt;br /&gt;
&lt;br /&gt;
This uses a kernel built for Fedora 12, but it works on Fedora 13. This step involves either installing it over HTML or adding and enabling his repository and then installing it from there.&lt;br /&gt;
&lt;br /&gt;
=== Installing Via myoung&#039;s Repository ===&lt;br /&gt;
&lt;br /&gt;
This is almost always the preferred method. However, do note that when myoung updates his kernel, there will be a lag where the dom0 dependent RPMs provided here will no longer be compatible.&lt;br /&gt;
&lt;br /&gt;
To add the repository, download the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;myoung.dom0.repo&amp;lt;/span&amp;gt; into the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/yum.repos.d/&amp;lt;/span&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cd /etc/yum.repos.d/&lt;br /&gt;
wget -c http://myoung.fedorapeople.org/dom0/myoung.dom0.repo&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To enable his repository, edit the repository file and change the two &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;enabled=0&amp;lt;/span&amp;gt; entries to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;enabled=1&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/yum.repos.d/myoung.dom0.repo&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
[myoung-dom0]&lt;br /&gt;
name=myoung&#039;s repository of Fedora based dom0 kernels - $basearch&lt;br /&gt;
baseurl=http://fedorapeople.org/~myoung/dom0/$basearch/&lt;br /&gt;
enabled=1&lt;br /&gt;
gpgcheck=0&lt;br /&gt;
&lt;br /&gt;
[myoung-dom0-source]&lt;br /&gt;
name=myoung&#039;s repository of Fedora based dom0 kernels - Source&lt;br /&gt;
baseurl=http://fedorapeople.org/~myoung/dom0/src/&lt;br /&gt;
enabled=1&lt;br /&gt;
gpgcheck=0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Install the [[Xen]] [[dom0]] kernel (edit the version number with the updated version if it has changed).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install kernel-2.6.32.21-170.xendom0.fc12.x86_64&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Post Michael Young&#039;s dom0 Install Configuration ===&lt;br /&gt;
&lt;br /&gt;
The entry in grub&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/boot/grub/menu.lst&amp;lt;/span&amp;gt; won&#039;t work. You will need to edit it so that it calls the existing installed operating system as a &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;module&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: Copy and modify the entry created by the RPM. Simply copying this entry will almost certainly not work! Your &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;root=&amp;lt;/span&amp;gt; is likely different and your &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rd_MD_UUID=&amp;lt;/span&amp;gt; will definitely be different, even on the same machine across installs. Generally speaking, what follows the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;kernel /vmlinuz-2.6.32.21-170.xendom0.fc12.x86_64 ...&amp;lt;/span&amp;gt; entry made by the dom0 kernel can be copied after the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;module /vmlinuz-2.6.32.21-170.xendom0.fc12.x86_64 ...&amp;lt;/span&amp;gt; entry in the example below.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /boot/grub/menu.lst&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
title Xen 4.0.x, Linux kernel 2.6.32.21-170.xendom0.fc12.x86_64&lt;br /&gt;
	root   (hd0,0)&lt;br /&gt;
	kernel /xen.gz dom0_mem=1024M&lt;br /&gt;
	module /vmlinuz-2.6.32.21-170.xendom0.fc12.x86_64 ...&lt;br /&gt;
	module /initramfs-2.6.32.21-170.xendom0.fc12.x86_64.img&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Disabling Automatic Kernel Updates ===&lt;br /&gt;
&lt;br /&gt;
Seeing as we&#039;re using an older kernel, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;yum&amp;lt;/span&amp;gt; will want to replace it whenever there is an updated &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;kernel*&amp;lt;/span&amp;gt; package available. Likewise if myoung updates his kernel. In the latter case, the updated kernel from Mr. Young would break compatibility with our DRBD module. So to be safe, we want to tell &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;yum&amp;lt;/span&amp;gt; to never update the kernel.&lt;br /&gt;
&lt;br /&gt;
To do this, we need to add &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;exclude=kernel*&amp;lt;/span&amp;gt; to the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/yum.conf&amp;lt;/span&amp;gt; file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
echo &amp;quot;exclude=kernel*&amp;quot; &amp;gt;&amp;gt; /etc/yum.conf&lt;br /&gt;
cat /etc/yum.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
[main]&lt;br /&gt;
cachedir=/var/cache/yum/$basearch/$releasever&lt;br /&gt;
keepcache=0&lt;br /&gt;
debuglevel=2&lt;br /&gt;
logfile=/var/log/yum.log&lt;br /&gt;
exactarch=1&lt;br /&gt;
obsoletes=1&lt;br /&gt;
gpgcheck=1&lt;br /&gt;
plugins=1&lt;br /&gt;
installonly_limit=3&lt;br /&gt;
color=never&lt;br /&gt;
&lt;br /&gt;
#  This is the default, if you make this bigger yum won&#039;t see if the metadata&lt;br /&gt;
# is newer on the remote and so you&#039;ll &amp;quot;gain&amp;quot; the bandwidth of not having to&lt;br /&gt;
# download the new metadata and &amp;quot;pay&amp;quot; for it by yum not having correct&lt;br /&gt;
# information.&lt;br /&gt;
#  It is esp. important, to have correct metadata, for distributions like&lt;br /&gt;
# Fedora which don&#039;t keep old packages around. If you don&#039;t like this checking&lt;br /&gt;
# interupting your command line usage, it&#039;s much better to have something&lt;br /&gt;
# manually check the metadata once an hour (yum-updatesd will do this).&lt;br /&gt;
# metadata_expire=90m&lt;br /&gt;
&lt;br /&gt;
# PUT YOUR REPOS HERE OR IN separate files named file.repo&lt;br /&gt;
# in /etc/yum.repos.d&lt;br /&gt;
&lt;br /&gt;
exclude=kernel*&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Make xend play nice with clustering ===&lt;br /&gt;
&lt;br /&gt;
By default under Fedora 13, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt; will start before &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xend&amp;lt;/span&amp;gt;. This is a problem because &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xend&amp;lt;/span&amp;gt; takes the network down as part of it&#039;s setup. This causes [[totem]] communication to fail which leads to fencing.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: Move &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xenconsoled&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xenstore&amp;lt;/span&amp;gt; to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;09&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;10&amp;lt;/span&amp;gt; start positions and then make &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xend&amp;lt;/span&amp;gt; depend on the before starting.&lt;br /&gt;
&lt;br /&gt;
To avoid this, edit the initialization scripts for &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/init.d/xend&amp;lt;/span&amp;gt; and it&#039;s dependents &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xenconsoled&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xenstore&amp;lt;/span&amp;gt; to have a lower minimum start position. We need to maintain the start order of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xenstore&amp;lt;/span&amp;gt; first, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xenconsoled&amp;lt;/span&amp;gt; second and lastly &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xend&amp;lt;/span&amp;gt;. By default, their minimum start positions are &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;96&amp;lt;/span&amp;gt;, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;97&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;98&amp;lt;/span&amp;gt; respectively. We will change these to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;10&amp;lt;/span&amp;gt;, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;11&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;12&amp;lt;/span&amp;gt;, again, respectively.&lt;br /&gt;
&lt;br /&gt;
Note that we are &#039;&#039;&#039;not&#039;&#039;&#039; altering the start position of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xendomains&amp;lt;/span&amp;gt;! This is intentional as this daemon will start the [[domU]] VMs. This can not happen until all other cluster related daemons have started.&lt;br /&gt;
&lt;br /&gt;
To change the start order we will change the line &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;chkconfig: 2345 9x 01&amp;lt;/span&amp;gt; lines to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;chkconfig: 2345 1x 01&amp;lt;/span&amp;gt;, where &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;x&amp;lt;/span&amp;gt; is the given daemon&#039;s start number. Further, we&#039;ll make sure that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xenstored&amp;lt;/span&amp;gt; begins first by add it to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xenconsoled&amp;lt;/span&amp;gt;&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Required-Start&amp;lt;/span&amp;gt; line. We&#039;ll then make sure that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xenconsoled&amp;lt;/span&amp;gt; starts before &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xend&amp;lt;/span&amp;gt; by adding it to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xend&amp;lt;/span&amp;gt;&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Required-Start&amp;lt;/span&amp;gt; line.&lt;br /&gt;
&lt;br /&gt;
To recap the changes;&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xenstored&amp;lt;/span&amp;gt; will start first.&lt;br /&gt;
** We&#039;ll change it&#039;s start position from &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;96&amp;lt;/span&amp;gt; to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;10&amp;lt;/span&amp;gt;.&lt;br /&gt;
** We will not add anything to it&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Required-Start&amp;lt;/span&amp;gt; as it must be the first daemon to come up.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xenconsoled&amp;lt;/span&amp;gt; will start second.&lt;br /&gt;
** We&#039;ll change it&#039;s start position from &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;97&amp;lt;/span&amp;gt; to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;11&amp;lt;/span&amp;gt;.&lt;br /&gt;
** We will add &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xenstored&amp;lt;/span&amp;gt; to it&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Required-Start&amp;lt;/span&amp;gt; line.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xend&amp;lt;/span&amp;gt; will start third.&lt;br /&gt;
** We&#039;ll change it&#039;s start position from &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;98&amp;lt;/span&amp;gt; to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;12&amp;lt;/span&amp;gt;.&lt;br /&gt;
** We will add &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xenconsoled&amp;lt;/span&amp;gt; to it&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Required-Start&amp;lt;/span&amp;gt; line.&lt;br /&gt;
&lt;br /&gt;
When done, the three initialization scripts should look like the examples below.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/init.d/xenstored&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
#&lt;br /&gt;
# xenstored     Script to start and stop the Xen control daemon.&lt;br /&gt;
#&lt;br /&gt;
# Author:       Daniel Berrange &amp;lt;berrange@redhat.com&lt;br /&gt;
#&lt;br /&gt;
# chkconfig: 2345 10 01&lt;br /&gt;
# description: Starts and stops the Xen xenstored daemon.&lt;br /&gt;
### BEGIN INIT INFO&lt;br /&gt;
# Provides:          xenstored&lt;br /&gt;
# Required-Start:    $syslog $remote_fs&lt;br /&gt;
# Should-Start:&lt;br /&gt;
# Required-Stop:     $syslog $remote_fs&lt;br /&gt;
# Should-Stop:&lt;br /&gt;
# Default-Start:     3 4 5&lt;br /&gt;
# Default-Stop:      0 1 2 6&lt;br /&gt;
# Default-Enabled:   yes&lt;br /&gt;
# Short-Description: Start/stop xenstored&lt;br /&gt;
# Description:       Starts and stops the Xen xenstored daemon.&lt;br /&gt;
### END INIT INFO&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/init.d/xenconsoled&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
#&lt;br /&gt;
# xenconsoled   Script to start and stop the Xen xenconsoled daemon&lt;br /&gt;
#&lt;br /&gt;
# Author:       Daniel P. Berrange &amp;lt;berrange@redhat.com&amp;gt;&lt;br /&gt;
#&lt;br /&gt;
# chkconfig: 2345 11 01&lt;br /&gt;
# description: Starts and stops the Xen control daemon.&lt;br /&gt;
### BEGIN INIT INFO&lt;br /&gt;
# Provides:          xenconsoled&lt;br /&gt;
# Required-Start:    $syslog $remote_fs xenstored&lt;br /&gt;
# Should-Start:&lt;br /&gt;
# Required-Stop:     $syslog $remote_fs&lt;br /&gt;
# Should-Stop:&lt;br /&gt;
# Default-Start:     3 4 5&lt;br /&gt;
# Default-Stop:      0 1 2 6&lt;br /&gt;
# Default-Enabled:   yes&lt;br /&gt;
# Short-Description: Start/stop xenconsoled&lt;br /&gt;
# Description:       Starts and stops the Xen xenconsoled daemon.&lt;br /&gt;
### END INIT INFO&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/init.d/xend&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
#&lt;br /&gt;
# xend          Script to start and stop the Xen control daemon.&lt;br /&gt;
#&lt;br /&gt;
# Author:       Keir Fraser &amp;lt;keir.fraser@cl.cam.ac.uk&amp;gt;&lt;br /&gt;
#&lt;br /&gt;
# chkconfig: 2345 12 98&lt;br /&gt;
# description: Starts and stops the Xen control daemon.&lt;br /&gt;
### BEGIN INIT INFO&lt;br /&gt;
# Provides:          xend&lt;br /&gt;
# Required-Start:    $syslog $remote_fs xenconsoled&lt;br /&gt;
# Should-Start:&lt;br /&gt;
# Required-Stop:     $syslog $remote_fs&lt;br /&gt;
# Should-Stop:&lt;br /&gt;
# Default-Start:     3 4 5&lt;br /&gt;
# Default-Stop:      0 1 2 6&lt;br /&gt;
# Default-Enabled:   yes&lt;br /&gt;
# Short-Description: Start/stop xend&lt;br /&gt;
# Description:       Starts and stops the Xen control daemon.&lt;br /&gt;
### END INIT INFO&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xend&amp;lt;/span&amp;gt; set to start at a position lower than &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;98&amp;lt;/span&amp;gt;, we now have room for &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;chkconfig&amp;lt;/span&amp;gt; to put other daemons after it in the start order, which will be needed a little later. First and foremost, we now need to tell &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt; to not start until after &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xend&amp;lt;/span&amp;gt; is up.&lt;br /&gt;
&lt;br /&gt;
As above, we will now edit &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt;&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/init.d/cman&amp;lt;/span&amp;gt; script. This time though, we will not edit it&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;chkconfig&amp;lt;/span&amp;gt; line. Instead, we will simply add &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xend&amp;lt;/span&amp;gt; to the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Required-Start&amp;lt;/span&amp;gt; line.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/init.d/cman&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
#&lt;br /&gt;
# cman - Cluster Manager init script&lt;br /&gt;
#&lt;br /&gt;
# chkconfig: - 21 79&lt;br /&gt;
# description: Starts and stops cman&lt;br /&gt;
#&lt;br /&gt;
#&lt;br /&gt;
### BEGIN INIT INFO&lt;br /&gt;
# Provides:             cman&lt;br /&gt;
# Required-Start:       $network $time xend&lt;br /&gt;
# Required-Stop:        $network $time&lt;br /&gt;
# Default-Start:&lt;br /&gt;
# Default-Stop:&lt;br /&gt;
# Short-Description:    Starts and stops cman&lt;br /&gt;
# Description:          Starts and stops the Cluster Manager set of daemons&lt;br /&gt;
### END INIT INFO&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Finally, remove and re-add the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xend&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt; daemons to re-order them in the start list:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
chkconfig xenstored off; chkconfig xenconsoled off; chkconfig xend off; chkconfig cman off; &lt;br /&gt;
chkconfig xenstored on; chkconfig xenconsoled on; chkconfig xend on; chkconfig cman on&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Confirm that the order has changed so that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xend&amp;lt;/span&amp;gt; is earlier in the boot sequence than &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt;. Assuming you&#039;ve switched to run-level 3, run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ls -lah /etc/rc3.d/&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Your start sequence should now look like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
lrwxrwxrwx.  1 root root   19 Sep 15 19:29 S26xenstored -&amp;gt; ../init.d/xenstored&lt;br /&gt;
lrwxrwxrwx.  1 root root   21 Sep 15 19:29 S27xenconsoled -&amp;gt; ../init.d/xenconsoled&lt;br /&gt;
lrwxrwxrwx.  1 root root   14 Sep 15 19:29 S28xend -&amp;gt; ../init.d/xend&lt;br /&gt;
lrwxrwxrwx.  1 root root   14 Sep 15 19:29 S29cman -&amp;gt; ../init.d/cman&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Booting Into The New dom0 ===&lt;br /&gt;
&lt;br /&gt;
If everything went well, you should be able to boot the new dom0 operating system. If you watch the boot process closely, you will see that the boot process is different. You should now see the Xen hypervisor boot prior to handing off to the &amp;quot;host&amp;quot; operating system. This can be confirmed once the dom0 operating system has booted by checking that the file &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/proc/xen/capabilities&amp;lt;/span&amp;gt; exists. What it contains doesn&#039;t matter at this stage, only that it exists at all.&lt;br /&gt;
&lt;br /&gt;
== Configure Networking ==&lt;br /&gt;
&lt;br /&gt;
Networking in Xen, particularly in a cluster, can be confusing. If you are not familiar with networking in Xen, please review to following article before proceeding.&lt;br /&gt;
&lt;br /&gt;
A note of a major change from previous layouts. In Xen 3.x, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ethX&amp;lt;/span&amp;gt; would be copied to a virtual interface called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vethX&amp;lt;/span&amp;gt;. Then the real &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ethX&amp;lt;/span&amp;gt; would be renamed to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;pethX&amp;lt;/span&amp;gt; and the virtual interface &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vethX&amp;lt;/span&amp;gt; would be renamed to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ethX&amp;lt;/span&amp;gt; to take it&#039;s place. Finally, a bridge called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xenbrX&amp;lt;/span&amp;gt; would be created and the real &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;pethX&amp;lt;/span&amp;gt; and virtual &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ethX&amp;lt;/span&amp;gt; would be connected to it.&lt;br /&gt;
&lt;br /&gt;
This has been changed somewhat it that now, by default, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ethX&amp;lt;/span&amp;gt; is left alone and a simple bridge called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virbrX&amp;lt;/span&amp;gt; would be created. We&#039;ll be changing this to be somewhat similar to the old style.&lt;br /&gt;
&lt;br /&gt;
Specifically, the real &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ethX&amp;lt;/span&amp;gt; will be renamed to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;pethX&amp;lt;/span&amp;gt;. Then a bridge will be created called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ethX&amp;lt;/span&amp;gt;, which plays the role of dom0&#039;s interface &#039;&#039;&#039;and&#039;&#039;&#039; bridges connections from VMs through &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;pethX&amp;lt;/span&amp;gt; and out into the real world.&lt;br /&gt;
&lt;br /&gt;
This is explained in more detail, and with diagrams, in the article below.&lt;br /&gt;
&lt;br /&gt;
* [[Networking in Xen]]&lt;br /&gt;
&lt;br /&gt;
=== Adding New NICs to Xen ===&lt;br /&gt;
&lt;br /&gt;
By default, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xend&amp;lt;/span&amp;gt; manages &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth0&amp;lt;/span&amp;gt; only. We need to add &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth2&amp;lt;/span&amp;gt;. Personally, I don&#039;t like to put the storage network ethernet devices under Xen&#039;s control as this potentially can cause DRBD problems on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xend&amp;lt;/span&amp;gt; restart. Whether you add it or not I will leave to your preferences.&lt;br /&gt;
&lt;br /&gt;
You can see which, if any, network devices are under Xen&#039;s control by running &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ifconfig&amp;lt;/span&amp;gt; and checking to see if there is a &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virbrX&amp;lt;/span&amp;gt; corresponding to a given &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ethX&amp;lt;/span&amp;gt; device.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ifconfig&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
eth0      Link encap:Ethernet  HWaddr 48:5B:39:3C:53:14  &lt;br /&gt;
          inet addr:192.168.1.74  Bcast:192.168.1.255  Mask:255.255.255.0&lt;br /&gt;
          inet6 addr: fe80::4a5b:39ff:fe3c:5314/64 Scope:Link&lt;br /&gt;
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1&lt;br /&gt;
          RX packets:224261 errors:0 dropped:0 overruns:0 frame:0&lt;br /&gt;
          TX packets:55174 errors:0 dropped:0 overruns:0 carrier:0&lt;br /&gt;
          collisions:0 txqueuelen:1000 &lt;br /&gt;
          RX bytes:319384110 (304.5 MiB)  TX bytes:27348739 (26.0 MiB)&lt;br /&gt;
          Interrupt:225 Base address:0x8000 &lt;br /&gt;
&lt;br /&gt;
eth1      Link encap:Ethernet  HWaddr 00:1B:21:72:9B:5A  &lt;br /&gt;
          inet addr:192.168.2.74  Bcast:192.168.2.255  Mask:255.255.255.0&lt;br /&gt;
          inet6 addr: fe80::21b:21ff:fe72:9b5a/64 Scope:Link&lt;br /&gt;
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1&lt;br /&gt;
          RX packets:2 errors:0 dropped:0 overruns:0 frame:0&lt;br /&gt;
          TX packets:36 errors:0 dropped:0 overruns:0 carrier:0&lt;br /&gt;
          collisions:0 txqueuelen:1000 &lt;br /&gt;
          RX bytes:832 (832.0 b)  TX bytes:6234 (6.0 KiB)&lt;br /&gt;
          Memory:feae0000-feb00000 &lt;br /&gt;
&lt;br /&gt;
eth2      Link encap:Ethernet  HWaddr 00:1B:21:72:96:EA  &lt;br /&gt;
          inet addr:192.168.3.74  Bcast:192.168.3.255  Mask:255.255.255.0&lt;br /&gt;
          inet6 addr: fe80::21b:21ff:fe72:96ea/64 Scope:Link&lt;br /&gt;
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1&lt;br /&gt;
          RX packets:2 errors:0 dropped:0 overruns:0 frame:0&lt;br /&gt;
          TX packets:34 errors:0 dropped:0 overruns:0 carrier:0&lt;br /&gt;
          collisions:0 txqueuelen:1000 &lt;br /&gt;
          RX bytes:818 (818.0 b)  TX bytes:6081 (5.9 KiB)&lt;br /&gt;
          Memory:fe9e0000-fea00000 &lt;br /&gt;
&lt;br /&gt;
lo        Link encap:Local Loopback  &lt;br /&gt;
          inet addr:127.0.0.1  Mask:255.0.0.0&lt;br /&gt;
          inet6 addr: ::1/128 Scope:Host&lt;br /&gt;
          UP LOOPBACK RUNNING  MTU:16436  Metric:1&lt;br /&gt;
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0&lt;br /&gt;
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0&lt;br /&gt;
          collisions:0 txqueuelen:0 &lt;br /&gt;
          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)&lt;br /&gt;
&lt;br /&gt;
virbr0    Link encap:Ethernet  HWaddr 02:23:C8:98:31:17  &lt;br /&gt;
          inet addr:192.168.122.1  Bcast:192.168.122.255  Mask:255.255.255.0&lt;br /&gt;
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1&lt;br /&gt;
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0&lt;br /&gt;
          TX packets:15 errors:0 dropped:0 overruns:0 carrier:0&lt;br /&gt;
          collisions:0 txqueuelen:0 &lt;br /&gt;
          RX bytes:0 (0.0 b)  TX bytes:4013 (3.9 KiB)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the above example, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth0&amp;lt;/span&amp;gt; has a corresponding &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virbr0&amp;lt;/span&amp;gt; bridge having it&#039;s own subnet. In non-clustered systems, this is fine. For our purposes though, it will not do.&lt;br /&gt;
&lt;br /&gt;
=== Removing The qemu virbr0 Bridge ===&lt;br /&gt;
&lt;br /&gt;
By default, [[QEMU]] creates a bridge called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virbr0&amp;lt;/span&amp;gt; designed to connect virtual machines to the first &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth0&amp;lt;/span&amp;gt; interface. Our system will not need this, so we will remove it. This bridge is configured in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/libvirt/qemu/networks/default.xml&amp;lt;/span&amp;gt; file, so to remove this bridge, simply delete the contents of the file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cat /dev/null &amp;gt;/etc/libvirt/qemu/networks/default.xml&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The next time you reboot, that bridge will be gone.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Madi&#039;&#039;&#039;: Put in the command to delete the bridge before a reboot.&lt;br /&gt;
&lt;br /&gt;
=== Create /etc/xen/scripts/an-network-script ===&lt;br /&gt;
&lt;br /&gt;
This script will be used by Xen to turn the dom0 &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ethX&amp;lt;/span&amp;gt; interfaces into bridges. All traffic to the bridge, be it from dom0 or domU VMs, will be routeable out of the corresponding &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;pethX&amp;lt;/span&amp;gt; device. As domU VMs come online, a hotplug script will create virtual interfaces between this new bridge and the domU&#039;s interface(s). Think of the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vifX.Y&amp;lt;/span&amp;gt; devices as being the network cables you&#039;d normally run between a server and a switch.&lt;br /&gt;
&lt;br /&gt;
Before we proceed, please note three things;&lt;br /&gt;
# You don&#039;t need to use the file name &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-network-script&amp;lt;/span&amp;gt;. I suggest this name mainly to keep in line with the rest of the &#039;AN!x&#039; naming used here.&lt;br /&gt;
# If you install &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;convirt&amp;lt;/span&amp;gt; or other hypervisor tools, they will likely create their own bridge script.&lt;br /&gt;
# Adding &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth1&amp;lt;/span&amp;gt; is optional, as we know ahead of time that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth1&amp;lt;/span&amp;gt; will not be made available to any virtual machines as it is dedicated to [[DRBD]]. I&#039;m adding it here because I like having things consistent; Do whichever makes more sense to you.&lt;br /&gt;
&lt;br /&gt;
First, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;touch&amp;lt;/span&amp;gt; the file and then &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;chmod&amp;lt;/span&amp;gt; it to be executable.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
touch /etc/xen/scripts/an-network-script&lt;br /&gt;
chmod 755 /etc/xen/scripts/an-network-script&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now edit it to contain the following:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/xen/scripts/an-network-script&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
dir=$(dirname &amp;quot;$0&amp;quot;)&lt;br /&gt;
&amp;quot;$dir/network-bridge&amp;quot; &amp;quot;$@&amp;quot; vifnum=0 netdev=eth0 bridge=eth0&lt;br /&gt;
&amp;quot;$dir/network-bridge&amp;quot; &amp;quot;$@&amp;quot; vifnum=2 netdev=eth2 bridge=eth2&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now tell Xen to execute that script by editing &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/xen/xend-config.sxp&amp;lt;/span&amp;gt; file and changing the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;network-script&amp;lt;/span&amp;gt; argument to point to this new script (this is line 158 in the default &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xend-config.sxp&amp;lt;/span&amp;gt; script):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/xen/xend-config.sxp&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
#(network-script network-bridge)&lt;br /&gt;
#(network-script /bin/true)&lt;br /&gt;
(network-script an-network-script)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Warning&#039;&#039;&#039;: The next step may trigger fencing of the nodes! As such, be sure that you&#039;re not running anything critical. If unsure, please stop &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt; or reboot the nodes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/cman stop&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now restart &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xend&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/xend restart&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If everything worked, you should now be able to run &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ifconfig&amp;lt;/span&amp;gt; and see that all the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ethX&amp;lt;/span&amp;gt; devices have matching &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;pethX&amp;lt;/span&amp;gt;, virtual and bridge devices.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ifconfig&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
eth0      Link encap:Ethernet  HWaddr 48:5B:39:3C:53:14  &lt;br /&gt;
          inet addr:192.168.1.74  Bcast:192.168.1.255  Mask:255.255.255.0&lt;br /&gt;
          inet6 addr: fe80::4a5b:39ff:fe3c:5314/64 Scope:Link&lt;br /&gt;
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1&lt;br /&gt;
          RX packets:78 errors:0 dropped:0 overruns:0 frame:0&lt;br /&gt;
          TX packets:57 errors:0 dropped:0 overruns:0 carrier:0&lt;br /&gt;
          collisions:0 txqueuelen:0 &lt;br /&gt;
          RX bytes:9796 (9.5 KiB)  TX bytes:12574 (12.2 KiB)&lt;br /&gt;
&lt;br /&gt;
eth1      Link encap:Ethernet  HWaddr 00:1B:21:72:9B:5A  &lt;br /&gt;
          inet addr:192.168.2.74  Bcast:192.168.2.255  Mask:255.255.255.0&lt;br /&gt;
          inet6 addr: fe80::21b:21ff:fe72:9b5a/64 Scope:Link&lt;br /&gt;
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1&lt;br /&gt;
          RX packets:2 errors:0 dropped:0 overruns:0 frame:0&lt;br /&gt;
          TX packets:36 errors:0 dropped:0 overruns:0 carrier:0&lt;br /&gt;
          collisions:0 txqueuelen:1000 &lt;br /&gt;
          RX bytes:832 (832.0 b)  TX bytes:6234 (6.0 KiB)&lt;br /&gt;
          Memory:feae0000-feb00000 &lt;br /&gt;
&lt;br /&gt;
eth2      Link encap:Ethernet  HWaddr 00:1B:21:72:96:EA  &lt;br /&gt;
          inet addr:192.168.3.74  Bcast:192.168.3.255  Mask:255.255.255.0&lt;br /&gt;
          inet6 addr: fe80::21b:21ff:fe72:96ea/64 Scope:Link&lt;br /&gt;
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1&lt;br /&gt;
          RX packets:32 errors:0 dropped:0 overruns:0 frame:0&lt;br /&gt;
          TX packets:29 errors:0 dropped:0 overruns:0 carrier:0&lt;br /&gt;
          collisions:0 txqueuelen:0 &lt;br /&gt;
          RX bytes:5471 (5.3 KiB)  TX bytes:5867 (5.7 KiB)&lt;br /&gt;
&lt;br /&gt;
lo        Link encap:Local Loopback  &lt;br /&gt;
          inet addr:127.0.0.1  Mask:255.0.0.0&lt;br /&gt;
          inet6 addr: ::1/128 Scope:Host&lt;br /&gt;
          UP LOOPBACK RUNNING  MTU:16436  Metric:1&lt;br /&gt;
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0&lt;br /&gt;
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0&lt;br /&gt;
          collisions:0 txqueuelen:0 &lt;br /&gt;
          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)&lt;br /&gt;
&lt;br /&gt;
peth0     Link encap:Ethernet  HWaddr 48:5B:39:3C:53:14  &lt;br /&gt;
          inet6 addr: fe80::4a5b:39ff:fe3c:5314/64 Scope:Link&lt;br /&gt;
          UP BROADCAST RUNNING PROMISC MULTICAST  MTU:1500  Metric:1&lt;br /&gt;
          RX packets:224486 errors:0 dropped:0 overruns:0 frame:0&lt;br /&gt;
          TX packets:55349 errors:0 dropped:0 overruns:0 carrier:0&lt;br /&gt;
          collisions:0 txqueuelen:1000 &lt;br /&gt;
          RX bytes:319406626 (304.6 MiB)  TX bytes:27384681 (26.1 MiB)&lt;br /&gt;
          Interrupt:225 Base address:0x8000 &lt;br /&gt;
&lt;br /&gt;
peth2     Link encap:Ethernet  HWaddr 00:1B:21:72:96:EA  &lt;br /&gt;
          inet6 addr: fe80::21b:21ff:fe72:96ea/64 Scope:Link&lt;br /&gt;
          UP BROADCAST RUNNING PROMISC MULTICAST  MTU:1500  Metric:1&lt;br /&gt;
          RX packets:35 errors:0 dropped:0 overruns:0 frame:0&lt;br /&gt;
          TX packets:70 errors:0 dropped:0 overruns:0 carrier:0&lt;br /&gt;
          collisions:0 txqueuelen:1000 &lt;br /&gt;
          RX bytes:6827 (6.6 KiB)  TX bytes:12470 (12.1 KiB)&lt;br /&gt;
          Memory:fe9e0000-fea00000 &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virbr0&amp;lt;/span&amp;gt; may remain until you reboot your nodes.&lt;br /&gt;
&lt;br /&gt;
If you see something like this, then you are ready to proceed! Now start your cluster back up.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/cman start&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We&#039;re done for now. There is more to do in Xen, but this was all we needed to do in order to proceed with the next several steps. Onces we have the clustered storage online, we&#039;ll come back to Xen for the domU setup.&lt;br /&gt;
&lt;br /&gt;
= Building the DRBD Array =&lt;br /&gt;
&lt;br /&gt;
Building the DRBD array requires a few steps. First, raw space on either node must be prepared. Next, DRBD must be told that it is to create a resource using this newly configured raw space. Finally, the new array must be initialized.&lt;br /&gt;
&lt;br /&gt;
== A Map of the Cluster&#039;s Storage ==&lt;br /&gt;
&lt;br /&gt;
The layout of the storage in the cluster can quickly become difficult to follow. Below is an [[ASCII]] drawing which should help you see how DRBD will tie in to the rest of the cluster&#039;s storage. This map assumes a simple [[TLUG_Talk:_Storage_Technologies_and_Theory#Level_1|RAID level 1]] array underlying each node. If your node has a single hard drive, simply collapse the first two layers into one. Similarly, if your underlying storage is a more complex RAID array, simply expand the number of physical devices at the top level.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
               Node1                                Node2&lt;br /&gt;
           _____   _____                        _____   _____&lt;br /&gt;
          | sda | | sdb |                      | sda | | sdb |&lt;br /&gt;
          |_____| |_____|                      |_____| |_____|&lt;br /&gt;
             |_______|                            |_______|&lt;br /&gt;
     _______ ____|___ _______             _______ ____|___ _______&lt;br /&gt;
  __|__   __|__    __|__   __|__       __|__   __|__    __|__   __|__&lt;br /&gt;
 | md0 | | md1 |  | md2 | | md3 |     | md3 | | md2 |  | md1 | | md0 |&lt;br /&gt;
 |_____| |_____|  |_____| |_____|     |_____| |_____|  |_____| |_____|&lt;br /&gt;
    |       |        |       |           |       |        |       |&lt;br /&gt;
 ___|___   _|_   ____|____   |___________|   ____|____   _|_   ___|___&lt;br /&gt;
| /boot | | / | | &amp;lt;swap&amp;gt;  |        |        | &amp;lt;swap&amp;gt;  | | / | | /boot |&lt;br /&gt;
|_______| |___| |_________|  ______|______  |_________| |___| |_______|&lt;br /&gt;
                            | /dev/drbd0  |&lt;br /&gt;
                            |_____________|&lt;br /&gt;
                                   |&lt;br /&gt;
                               ____|______&lt;br /&gt;
                              | clvm PV   |&lt;br /&gt;
                              |___________|&lt;br /&gt;
                                   |&lt;br /&gt;
                              _____|_____&lt;br /&gt;
                             | drbd0_vg0 |&lt;br /&gt;
                             |___________|&lt;br /&gt;
                                   |&lt;br /&gt;
                              _____|_____ ___...____&lt;br /&gt;
                             |           |          |&lt;br /&gt;
                          ___|___     ___|___    ___|___&lt;br /&gt;
                         | lv_X  |   | lv_Y  |  | lv_N  |&lt;br /&gt;
                         |_______|   |_______|  |_______|&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Install The DRBD Tools ==&lt;br /&gt;
&lt;br /&gt;
DRBD has two components; The actual application and tools and the kernel module. &lt;br /&gt;
&lt;br /&gt;
There are two options for installing the DRBD user-land tools at this point; AN!Cluster-built RPMs or using the ones shipped with Fedora. Regardless of which method you choose, you will need to either install the AN!Cluster DRBD kernel module RPMs or else rebuild the source RPMs referenced.&lt;br /&gt;
&lt;br /&gt;
=== Install The AN!Cluster DRBD User-Land Tools ===&lt;br /&gt;
&lt;br /&gt;
I am currently experimenting with ways to solve a DRBD triggered kernel oops in the Xen pvops 2.6.32 kernel. For this reason, I&#039;ve recompiled the following user-land RPMs under the AN!Cluster variant dom0 kernel RPMs referenced earlier in this paper. If you used the AN! RPMs, then I suggest giving these RPMs a try. However, if you are using myoung&#039;s dom0, I recommend sticking to the Fedora-provided user-land DRBD tools.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum -y install bash-completion heartbeat pacemaker&lt;br /&gt;
cd ~&lt;br /&gt;
wget -c https://alteeve.com/files/an-cluster/drbd-8.3.7-2.fc13.x86_64.rpm&lt;br /&gt;
wget -c https://alteeve.com/files/an-cluster/drbd-utils-8.3.7-2.fc13.x86_64.rpm&lt;br /&gt;
wget -c https://alteeve.com/files/an-cluster/drbd-xen-8.3.7-2.fc13.x86_64.rpm&lt;br /&gt;
wget -c https://alteeve.com/files/an-cluster/drbd-bash-completion-8.3.7-2.fc13.x86_64.rpm&lt;br /&gt;
wget -c https://alteeve.com/files/an-cluster/drbd-udev-8.3.7-2.fc13.x86_64.rpm&lt;br /&gt;
wget -c https://alteeve.com/files/an-cluster/drbd-heartbeat-8.3.7-2.fc13.x86_64.rpm&lt;br /&gt;
wget -c https://alteeve.com/files/an-cluster/drbd-pacemaker-8.3.7-2.fc13.x86_64.rpm&lt;br /&gt;
rpm -ivh drbd*8.3.7-2.fc13.x86_64.rpm&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Install The Stock Fedora DRBD User-Land Tools ===&lt;br /&gt;
&lt;br /&gt;
You will need to install the following tools:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install drbd.x86_64 drbd-xen.x86_64 drbd-utils.x86_64&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Disable heartbeat ===&lt;br /&gt;
&lt;br /&gt;
These packages require that the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;heartbeat&amp;lt;/span&amp;gt; packages be installed. This is for a different cluster platform which we are not using here, so we will disable it from starting with the system.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
chkconfig heartbeat off&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Install The DRBD Kernel Module ==&lt;br /&gt;
&lt;br /&gt;
The kernel module &#039;&#039;&#039;must&#039;&#039;&#039; match the [[dom0]] kernel that is running. If you update the kernel and neglect to update the DRBD kernel module, the DRBD array &#039;&#039;&#039;will not start&#039;&#039;&#039;. &lt;br /&gt;
&lt;br /&gt;
To help simplify things, links to pre-compiled DRBD kernel modules are provided. If the kernel version you have installed doesn&#039;t match your kernel, instructions on recompiling the DRBD kernel module from source RPM is provided as well.&lt;br /&gt;
&lt;br /&gt;
=== Install Pre-Compiled DRBD Kernel Module RPMs ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Warning&#039;&#039;&#039;: The RPM provided here &#039;&#039;&#039;&#039;&#039;will only work&#039;&#039;&#039;&#039;&#039; with the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;kernel-2.6.32.21-168.xendom0_an1.fc13.x86_64.rpm&amp;lt;/span&amp;gt; kernel. If you are using Michael Young&#039;s dom0 kernel, please skip to [[#Building DRBD Kernel Module RPMs From Source|the next section]].&lt;br /&gt;
&lt;br /&gt;
This RPM provides the DRBD kernel module. Note that these RPMs are compiled against the AN!Cluster variant of myoung&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;2.6.32.21_168&amp;lt;/span&amp;gt; dom0 kernel.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cd ~&lt;br /&gt;
wget -c https://alteeve.com/files/an-cluster/drbd-km-2.6.32.23_170.dom0_an1.fc13.x86_64-8.3.7-12.fc13.x86_64.rpm&lt;br /&gt;
rpm -ivh drbd-km-2.6.32.23_170.dom0_an1.fc13.x86_64-8.3.7-12.fc13.x86_64.rpm&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you would like to install the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;debuginfo&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cd ~&lt;br /&gt;
wget -c https://alteeve.com/files/an-cluster/drbd-km-debuginfo-8.3.7-12.fc13.x86_64.rpm&lt;br /&gt;
rpm -ivh drbd-km-debuginfo-8.3.7-12.fc13.x86_64.rpm&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Building DRBD Kernel Module RPMs From Source ===&lt;br /&gt;
&lt;br /&gt;
If the above RPMs don&#039;t work or if the dom0 kernel you are using in any way differs, please follow the steps here to create a DRBD kernel module matched to your running dom0.&lt;br /&gt;
&lt;br /&gt;
First, install the build environment.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum -y groupinstall &amp;quot;Development Libraries&amp;quot;&lt;br /&gt;
yum -y groupinstall &amp;quot;Development Tools&amp;quot;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Install the kernel headers and development library for the dom0 kernel:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: The following commands use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--force&amp;lt;/span&amp;gt; to get past the fact that the headers for the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;2.6.33&amp;lt;/span&amp;gt; are already installed, thus making RPM think that these are too old and will conflict. Please proceed with caution.&lt;br /&gt;
&lt;br /&gt;
* If you are using Michael Young&#039;s kernel:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cd ~&lt;br /&gt;
wget -c http://fedorapeople.org/~myoung/dom0/x86_64/kernel-headers-2.6.32.21-170.xendom0.fc12.x86_64.rpm&lt;br /&gt;
wget -c http://fedorapeople.org/~myoung/dom0/x86_64/kernel-devel-2.6.32.21-170.xendom0.fc12.x86_64.rpm&lt;br /&gt;
rpm -ivh --force kernel*2.6.32.21-170.xendom0.fc12.x86_64.rpm&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* If you are using the AN!Cluster dom0 kernel:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
wget -c https://alteeve.com/files/an-cluster/kernel-devel-2.6.32.23-170.dom0_an1.fc13.x86_64.rpm&lt;br /&gt;
wget -c https://alteeve.com/files/an-cluster/kernel-headers-2.6.32.23-170.dom0_an1.fc13.x86_64.rpm&lt;br /&gt;
rpm -ivh --force kernel-devel-2.6.32.23-170.dom0_an1.fc13.x86_64.rpm kernel-headers-2.6.32.23-170.dom0_an1.fc13.x86_64.rpm&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now you need to download, prepare, build and install the source RPM.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
rpm -ivh http://fedora.mirror.iweb.ca/releases/13/Everything/source/SRPMS/drbd-8.3.7-2.fc13.src.rpm&lt;br /&gt;
cd /root/rpmbuild/SPECS/&lt;br /&gt;
rpmbuild -bp drbd.spec &lt;br /&gt;
cd /root/rpmbuild/BUILD/drbd-8.3.7/&lt;br /&gt;
./configure --enable-spec --with-km&lt;br /&gt;
cp /root/rpmbuild/BUILD/drbd-8.3.7/drbd-km.spec /root/rpmbuild/SPECS/&lt;br /&gt;
cd /root/rpmbuild/SPECS/&lt;br /&gt;
rpmbuild -ba drbd-km.spec&lt;br /&gt;
cd /root/rpmbuild/RPMS/x86_64&lt;br /&gt;
rpm -Uvh drbd-km-*&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This may be needed if &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;drbd-utils&amp;lt;/span&amp;gt;, the user-land DRBD tools, is listed as a requirement when trying to install the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;drbd-km*&amp;lt;/span&amp;gt; RPMs. This step will build all of the DRBD tools RPMs.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install bash-completion heartbeat pacemaker&lt;br /&gt;
cd /root/rpmbuild/SPECS/&lt;br /&gt;
rpmbuild -ba drbd.spec &lt;br /&gt;
cd ~/rpmbuild/RPMS/x86_64/&lt;br /&gt;
rpm -Uvh drbd-*&lt;br /&gt;
chkconfig off heartbeat&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You should be good to go now!&lt;br /&gt;
&lt;br /&gt;
== Allocating Raw Space For DRBD On Each Node ==&lt;br /&gt;
&lt;br /&gt;
If you followed the setup steps provided for in &amp;quot;[[Two Node Fedora 13 Cluster]]&amp;quot;, you will have a set amount of unconfigured hard drive space. This is what we will use for the DRBD space on either node. If you&#039;ve got a different setup, you will need to allocate some raw space before proceeding.&lt;br /&gt;
&lt;br /&gt;
=== Create a Simple Partition ===&lt;br /&gt;
&lt;br /&gt;
If you do not have two drives, please follow the next section&#039;s steps, but pay attention to the &amp;quot;&#039;&#039;&#039;note&#039;&#039;&#039;&amp;quot;s. In short, you will need to create one partition, leave the default type of the partition as &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;83&amp;lt;/span&amp;gt;, write the changes to disk and the proceed to the [[#DRBD Configuration Files|DRBD Configuration Files]] section.&lt;br /&gt;
&lt;br /&gt;
=== Creating a RAID level 1 &#039;md&#039; Device ===&lt;br /&gt;
&lt;br /&gt;
This assumes that you have two raw drives, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/sda&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/sdb&amp;lt;/span&amp;gt;. It further assumes that you&#039;ve created three partitions which have been assigned to three existing &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/mdX&amp;lt;/span&amp;gt; devices. With these assumptions, we will create &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/sda4&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/sdb4&amp;lt;/span&amp;gt; and, using them, create a new &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/md3&amp;lt;/span&amp;gt; device that will host the DRBD partition.&lt;br /&gt;
&lt;br /&gt;
If you have multiple drives and plan to use a different [[TLUG_Talk:_Storage_Technologies_and_Theory#RAID_Levels|RAID levels]], please adjust the follow commands accordingly.&lt;br /&gt;
&lt;br /&gt;
==== Creating The New Partitions ====&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Warning&#039;&#039;&#039;: The next steps will have you directly accessing your server&#039;s hard drive configuration. Please do not proceed on a live server until you&#039;ve had a chance to work through these steps on a test server. One mistake can &#039;&#039;&#039;&#039;&#039;blow away all your data&#039;&#039;&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Start the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fdisk&amp;lt;/span&amp;gt; shell for the first hard drive; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/sda&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
fdisk /dev/sda&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
WARNING: DOS-compatible mode is deprecated. It&#039;s strongly recommended to&lt;br /&gt;
         switch off the mode (command &#039;c&#039;) and change display units to&lt;br /&gt;
         sectors (command &#039;u&#039;).&lt;br /&gt;
&lt;br /&gt;
Command (m for help): &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: Depending on your configuration, you may not see the above warning or you may see a different warning. Note it, but it is likely nothing to worry about it.&lt;br /&gt;
&lt;br /&gt;
View the current configuration with the &#039;&#039;&#039;p&#039;&#039;&#039;rint option&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
p&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Disk /dev/sda: 500.1 GB, 500107862016 bytes&lt;br /&gt;
255 heads, 63 sectors/track, 60801 cylinders&lt;br /&gt;
Units = cylinders of 16065 * 512 = 8225280 bytes&lt;br /&gt;
Sector size (logical/physical): 512 bytes / 512 bytes&lt;br /&gt;
I/O size (minimum/optimal): 512 bytes / 512 bytes&lt;br /&gt;
Disk identifier: 0x000c6fe1&lt;br /&gt;
&lt;br /&gt;
   Device Boot      Start         End      Blocks   Id  System&lt;br /&gt;
/dev/sda1               1        5100    40960000   fd  Linux raid autodetect&lt;br /&gt;
/dev/sda2            5100        5622     4194304   fd  Linux raid autodetect&lt;br /&gt;
/dev/sda3   *        5622        5654      256000   fd  Linux raid autodetect&lt;br /&gt;
&lt;br /&gt;
Command (m for help): &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we know for sure that the next free partition number is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;4&amp;lt;/span&amp;gt;. We will now create the &#039;&#039;&#039;n&#039;&#039;&#039;ew partition.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
n&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Command action&lt;br /&gt;
   e   extended&lt;br /&gt;
   p   primary partition (1-4)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We will make it a &#039;&#039;&#039;p&#039;&#039;&#039;rimary partition&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
p&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Selected partition 4&lt;br /&gt;
First cylinder (5654-60801, default 5654): &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then we simply hit &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;enter&amp;gt;&amp;lt;/span&amp;gt; to select the default starting block.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;enter&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Using default value 5654&lt;br /&gt;
Last cylinder, +cylinders or +size{K,M,G} (5654-60801, default 60801): &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once again we will press &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;enter&amp;gt;&amp;lt;/span&amp;gt; to select the default ending block.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;enter&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Using default value 60801&lt;br /&gt;
&lt;br /&gt;
Command (m for help): &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: If you only have one drive and are not creating a [[RAID]] array, you do not to change the type of the partition so you can skip the next few steps. Continue at the step where you write the changes.&lt;br /&gt;
&lt;br /&gt;
Now we need to change the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;t&amp;lt;/span&amp;gt;ype of partition that it is.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
t&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Partition number (1-4): &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We know that we are modifying partition number &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;4&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
4&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Hex code (type L to list codes): &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we need to set the [[hex]] code for the [[Filesystem_List#List_of_Linux_Partition_Types|partition type]] to set. We want to set &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fd&amp;lt;/span&amp;gt;, which defines &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Linux raid autodetect&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
fd&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Changed system type of partition 4 to fd (Linux raid autodetect)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now check that everything went as expected by once again &#039;&#039;&#039;p&#039;&#039;&#039;rinting the partition table.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
p&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Disk /dev/sda: 500.1 GB, 500107862016 bytes&lt;br /&gt;
255 heads, 63 sectors/track, 60801 cylinders&lt;br /&gt;
Units = cylinders of 16065 * 512 = 8225280 bytes&lt;br /&gt;
Sector size (logical/physical): 512 bytes / 512 bytes&lt;br /&gt;
I/O size (minimum/optimal): 512 bytes / 512 bytes&lt;br /&gt;
Disk identifier: 0x000c6fe1&lt;br /&gt;
&lt;br /&gt;
   Device Boot      Start         End      Blocks   Id  System&lt;br /&gt;
/dev/sda1               1        5100    40960000   fd  Linux raid autodetect&lt;br /&gt;
/dev/sda2            5100        5622     4194304   fd  Linux raid autodetect&lt;br /&gt;
/dev/sda3   *        5622        5654      256000   fd  Linux raid autodetect&lt;br /&gt;
/dev/sda4            5654       60801   442972704+  fd  Linux raid autodetect&lt;br /&gt;
&lt;br /&gt;
Command (m for help): &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: If you only have one drive, your partitions will be &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;83  Linux&amp;lt;/span&amp;gt; or &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;82  Linux swap / Solaris&amp;lt;/span&amp;gt;, instead of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fd  Linux raid autodetect&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
There it is. So finally, we need to &#039;&#039;&#039;w&#039;&#039;&#039;rite the changes to the disk.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
w&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
The partition table has been altered!&lt;br /&gt;
&lt;br /&gt;
Calling ioctl() to re-read partition table.&lt;br /&gt;
&lt;br /&gt;
WARNING: Re-reading the partition table failed with error 16: Device or resource busy.&lt;br /&gt;
The kernel still uses the old table. The new table will be used at&lt;br /&gt;
the next reboot or after you run partprobe(8) or kpartx(8)&lt;br /&gt;
Syncing disks.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: If you only have one drive, reboot now if you got the message above and then skip forward to the &amp;quot;[[#DRBD Configuration Files|DRBD Configuration Files]]&amp;quot; section.&lt;br /&gt;
&lt;br /&gt;
If you see the above message, &#039;&#039;&#039;do not&#039;&#039;&#039; reboot yet. repeat these steps for the second drive, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/sdb&amp;lt;/span&amp;gt;, and then reboot.&lt;br /&gt;
&lt;br /&gt;
==== Creating The New /dev/mdX Device ====&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;If you only have one drive, skip this step.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Now we need to use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;mdadm&amp;lt;/span&amp;gt; to create the new [[TLUG_Talk:_Storage_Technologies_and_Theory#Level_1|RAID level 1]] device. This will be used as the device that DRBD will directly access.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
mdadm --create /dev/md3 --homehost=localhost.localdomain --raid-devices=2 --level=1 /dev/sda4 /dev/sdb4&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
mdadm: Note: this array has metadata at the start and&lt;br /&gt;
    may not be suitable as a boot device.  If you plan to&lt;br /&gt;
    store &#039;/boot&#039; on this device please ensure that&lt;br /&gt;
    your boot-loader understands md/v1.x metadata, or use&lt;br /&gt;
    --metadata=0.90&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Seeing as &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/boot&amp;lt;/span&amp;gt; doesn&#039;t exist on this device, we can safely ignore this warning.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
y&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
mdadm: Defaulting to version 1.2 metadata&lt;br /&gt;
mdadm: array /dev/md/md4 started.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can now &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cat /proc/mdstat&amp;lt;/span&amp;gt; to verify that it indeed built. If you&#039;re interested, you could open a new terminal window and use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;watch cat /proc/mdstat&amp;lt;/span&amp;gt; and watch the array build.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cat /proc/mdstat&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
md3 : active raid1 sdb4[1] sda4[0]&lt;br /&gt;
      442971544 blocks super 1.2 [2/2] [UU]&lt;br /&gt;
      [&amp;gt;....................]  resync =  0.8% (3678976/442971544) finish=111.0min speed=65920K/sec&lt;br /&gt;
      &lt;br /&gt;
md2 : active raid1 sda2[0] sdb2[1]&lt;br /&gt;
      4193272 blocks super 1.1 [2/2] [UU]&lt;br /&gt;
      &lt;br /&gt;
md1 : active raid1 sda1[0] sdb1[1]&lt;br /&gt;
      40958908 blocks super 1.1 [2/2] [UU]&lt;br /&gt;
      bitmap: 1/1 pages [4KB], 65536KB chunk&lt;br /&gt;
&lt;br /&gt;
md0 : active raid1 sda3[0] sdb3[1]&lt;br /&gt;
      255988 blocks super 1.0 [2/2] [UU]&lt;br /&gt;
      &lt;br /&gt;
unused devices: &amp;lt;none&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Finally, we need to make sure that the new array will start when the system boots. To do this, we&#039;ll again use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;mdadm&amp;lt;/span&amp;gt;, but with different options that will have it output data in a format suitable for the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/mdadm.conf&amp;lt;/span&amp;gt; file. We&#039;ll redirect this output to that config file, thus updating it.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
mdadm --detail --scan | grep md3 &amp;gt;&amp;gt; /etc/mdadm.conf&lt;br /&gt;
cat /etc/mdadm.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
# mdadm.conf written out by anaconda&lt;br /&gt;
MAILADDR root&lt;br /&gt;
AUTO +imsm +1.x -all&lt;br /&gt;
ARRAY /dev/md0 level=raid1 num-devices=2 UUID=b58df6d0:d925e7bb:c156168d:47c01718&lt;br /&gt;
ARRAY /dev/md1 level=raid1 num-devices=2 UUID=ac2cf39c:77cd0314:fedb8407:9b945bb5&lt;br /&gt;
ARRAY /dev/md2 level=raid1 num-devices=2 UUID=4e513936:4a966f4e:0dd8402e:6403d10d&lt;br /&gt;
ARRAY /dev/md3 metadata=1.2 name=localhost.localdomain:3 UUID=f0b6d0c1:490d47e7:91c7e63a:f8dacc21&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You&#039;ll note that the last line, which we just added, is different from the previous lines. This isn&#039;t a concern, but you are welcome to re-write it to match the existing format if you wish.&lt;br /&gt;
&lt;br /&gt;
Before you proceed, it is strongly advised that you reboot each node and then verify that the new array did in fact start with the system. You &#039;&#039;do not&#039;&#039; need to wait for the sync to finish before rebooting. It will pick up where you left off once rebooted.&lt;br /&gt;
&lt;br /&gt;
== DRBD Configuration Files ==&lt;br /&gt;
&lt;br /&gt;
DRBD uses a global configuration file, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/drbd.d/global_common.conf&amp;lt;/span&amp;gt;, and one or more resource files. The resource files need to be created in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/drbd.d/&amp;lt;/span&amp;gt; directory and must have the suffix &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;.res&amp;lt;/span&amp;gt;. For this example, we will create a single resource called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;r0&amp;lt;/span&amp;gt; which we will configure in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/drbd.d/r0.res&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== /etc/drbd.d/global_common.conf ===&lt;br /&gt;
&lt;br /&gt;
The stock &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/drbd.d/global_common.conf&amp;lt;/span&amp;gt; is sane, so we won&#039;t bother altering it here.&lt;br /&gt;
&lt;br /&gt;
Full details on all the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;drbd.conf&amp;lt;/span&amp;gt; configuration file directives and arguments can be found [http://www.drbd.org/users-guide/re-drbdconf.html here]. &#039;&#039;&#039;Note&#039;&#039;&#039;: That link doesn&#039;t show this new configuration format. Please see [http://www.novell.com/documentation/sle_ha/book_sleha/?page=/documentation/sle_ha/book_sleha/data/sec_ha_drbd_configure.html Novell&#039;s] link.&lt;br /&gt;
&lt;br /&gt;
=== /etc/drbd.d/r0.res ===&lt;br /&gt;
&lt;br /&gt;
This is the important part. This defines the resource to use, and must reflect the IP addresses and storage devices that DRBD will use for this resource.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/drbd.d/r0.res&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# This is the name of the resource and it&#039;s settings. Generally, &#039;r0&#039; is used&lt;br /&gt;
# as the name of the first resource. This is by convention only, though.&lt;br /&gt;
resource r0&lt;br /&gt;
{&lt;br /&gt;
        # This tells DRBD where to make the new resource available at on each&lt;br /&gt;
        # node. This is, again, by convention only.&lt;br /&gt;
        device    /dev/drbd0;&lt;br /&gt;
&lt;br /&gt;
        # The main argument here tells DRBD that we will have proper locking &lt;br /&gt;
        # and fencing, and as such, to allow both nodes to set the resource to&lt;br /&gt;
        # &#039;primary&#039; simultaneously.&lt;br /&gt;
        net&lt;br /&gt;
        {&lt;br /&gt;
                allow-two-primaries;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        # This tells DRBD to automatically set both nodes to &#039;primary&#039; when the&lt;br /&gt;
        # nodes start.&lt;br /&gt;
        startup&lt;br /&gt;
        {&lt;br /&gt;
                become-primary-on both;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        # This tells DRBD to look for and store it&#039;s meta-data on the resource&lt;br /&gt;
        # itself.&lt;br /&gt;
        meta-disk       internal;&lt;br /&gt;
&lt;br /&gt;
        # The name below must match the output from `uname -n` on each node.&lt;br /&gt;
        on an-node01.alteeve.com&lt;br /&gt;
        {&lt;br /&gt;
                # This must be the IP address of the interface on the storage &lt;br /&gt;
                # network (an-node01.sn, in this case).&lt;br /&gt;
                address         192.168.2.71:7789;&lt;br /&gt;
&lt;br /&gt;
                # This is the underlying partition to use for this resource on &lt;br /&gt;
                # this node.&lt;br /&gt;
                disk            /dev/md3;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        # Repeat as above, but for the other node.&lt;br /&gt;
        on an-node02.alteeve.com&lt;br /&gt;
        {&lt;br /&gt;
                address         192.168.2.72:7789;&lt;br /&gt;
                disk            /dev/md3;&lt;br /&gt;
        }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This file must be copied to &#039;&#039;&#039;BOTH&#039;&#039;&#039; nodes and must match before you proceed.&lt;br /&gt;
&lt;br /&gt;
== Starting The DRBD Resource ==&lt;br /&gt;
&lt;br /&gt;
From the rest of this section, pay attention to whether you see&lt;br /&gt;
* &#039;&#039;&#039;Node1&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Node2&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Both&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
These indicate which node to run the following commands on. There is no functional difference between either node, so just randomly choose one to be &#039;&#039;&#039;Node1&#039;&#039;&#039; and the other will be &#039;&#039;&#039;Node2&#039;&#039;&#039;. Once you&#039;ve chosen which is which, be consistent with which node you run the commands on. Of course, if a command block is proceeded by &#039;&#039;&#039;Both&#039;&#039;&#039;, run the following code block on both nodes.&lt;br /&gt;
&lt;br /&gt;
=== Loading the &#039;drbd&#039; Module ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Both&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Normally, we&#039;d load the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;drbd&amp;lt;/span&amp;gt; module by simply starting the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/init.d/drbd&amp;lt;/span&amp;gt; daemon. However, if we did that at this stage, we&#039;d generate errors because there isn&#039;t an &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;UpToDate&amp;lt;/span&amp;gt; disk in the array. To get around this, we&#039;ll manually load the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;drbd&amp;lt;/span&amp;gt; kernel module using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;modprobe&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
modprobe drbd&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This won&#039;t return any output, but if you check, you should now see the special &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/proc/drbd&amp;lt;/span&amp;gt; file.&lt;br /&gt;
&lt;br /&gt;
=== Monitoring Progress ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Both&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
I find it very useful to monitor DRBD while running the rest of the setup. To do this, open a second terminal on each node and use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;watch&amp;lt;/span&amp;gt; to keep an eye on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/proc/drbd&amp;lt;/span&amp;gt;. This way you will be able to monitor the progress of the array in near-real time.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Both&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
watch cat /proc/drbd&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At this stage, it should look like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
version: 8.3.7 (api:88/proto:86-91)&lt;br /&gt;
GIT-hash: ea9e28dbff98e331a62bcbcc63a6135808fe2917 build by root@xenmaster002.iplink.net, 2010-09-07 16:02:46&lt;br /&gt;
 0: cs:Unconfigured&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Initialize The Resource ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Both&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This step creates the DRBD meta-data on the new DRBD resource&#039;s backing devices. It is only needed when creating new DRBD partitions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
drbdadm create-md r0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
  --==  Thank you for participating in the global usage survey  ==--&lt;br /&gt;
The server&#039;s response is:&lt;br /&gt;
&lt;br /&gt;
you are the 9507th user to install this version&lt;br /&gt;
Writing meta data...&lt;br /&gt;
initializing activity log&lt;br /&gt;
NOT initialized bitmap&lt;br /&gt;
New drbd meta data block successfully created.&lt;br /&gt;
success&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/proc/drbd&amp;lt;/span&amp;gt; output should not have changed at this stage.&lt;br /&gt;
&lt;br /&gt;
=== Starting the Resource ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Both&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This will attach the backing device, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/md3&amp;lt;/span&amp;gt; in our case, and then start the new resource &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;r0&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
drbdadm up r0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There will be no output at the command line. If you are &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;watch&amp;lt;/span&amp;gt;ing &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/proc/drbd&amp;lt;/span&amp;gt; though, you should now see something like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
version: 8.3.7 (api:88/proto:86-91)&lt;br /&gt;
GIT-hash: ea9e28dbff98e331a62bcbcc63a6135808fe2917 build by root@xenmaster002.iplink.net, 2010-09-07 16:02:46&lt;br /&gt;
 0: cs:Connected ro:Secondary/Secondary ds:Inconsistent/Inconsistent C r----&lt;br /&gt;
    ns:0 nr:0 dw:0 dr:0 al:0 bm:0 lo:0 pe:0 ua:0 ap:0 ep:1 wo:b oos:442957988&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
That it is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Secondary/Secondary&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Inconsistent/Inconsistent&amp;lt;/span&amp;gt; is expected.&lt;br /&gt;
&lt;br /&gt;
=== Setting the First Primary Node ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Node1&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
As this is a totally new resource, DRBD doesn&#039;t know which side of the array is &amp;quot;more valid&amp;quot; than the other. In reality, neither is as there was no existing data of note on either node. This means that we now need to choose a node and tell DRBD to treat it as the &amp;quot;source&amp;quot; node. This step will also tell DRBD to make the &amp;quot;source&amp;quot; node &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;primary&amp;lt;/span&amp;gt;. Once set, DRBD will begin &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;sync&amp;lt;/span&amp;gt;&#039;ing in the background. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
drbdadm -- --overwrite-data-of-peer primary r0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As before, there will be no output at the command line, but &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/proc/drbd&amp;lt;/span&amp;gt; will change to show the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
GIT-hash: ea9e28dbff98e331a62bcbcc63a6135808fe2917 build by root@xenmaster002.iplink.net, 2010-09-07 16:02:46&lt;br /&gt;
 0: cs:SyncSource ro:Primary/Secondary ds:UpToDate/Inconsistent C r----&lt;br /&gt;
    ns:69024 nr:0 dw:0 dr:69232 al:0 bm:4 lo:0 pe:0 ua:0 ap:0 ep:1 wo:b oos:442888964&lt;br /&gt;
        [&amp;gt;....................] sync&#039;ed:  0.1% (432508/432576)M&lt;br /&gt;
        finish: 307:33:42 speed: 320 (320) K/sec&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you&#039;re watching the secondary node, the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/proc/drbd&amp;lt;/span&amp;gt; will show &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ro:Secondary/Primary ds:Inconsistent/UpToDate&amp;lt;/span&amp;gt;. This is, as you can guess, simply a reflection of it being the &amp;quot;over-written&amp;quot; node.&lt;br /&gt;
&lt;br /&gt;
=== Setting the Second Node to Primary ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Node2&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The last step to complete the array is to tell the second node to also become &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;primary&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
drbdadm primary r0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As with many &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;drbdadm&amp;lt;/span&amp;gt; commands, nothing will be printed to the console. If you&#039;re watching the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/proc/drbd&amp;lt;/span&amp;gt; though, you should see something like &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Primary/Primary ds:UpToDate/Inconsistent&amp;lt;/span&amp;gt;. The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Inconsistent&amp;lt;/span&amp;gt; flag will remain until the sync is complete.&lt;br /&gt;
&lt;br /&gt;
=== A Note On sync Speed ===&lt;br /&gt;
&lt;br /&gt;
You will notice in the previous step that the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;sync&amp;lt;/span&amp;gt; speed seems awfully slow at &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;320 (320) K/sec&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;This is not a problem!&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
As actual data is written to either side of the array, that data will be immediately copied to both nodes. As such, both nodes will always contain up to date copies of the real data. Given this, the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;syncer&amp;lt;/span&amp;gt; is intentionally set low so as to not put too much load on the underlying disks that could cause slow downs. If you still wish to increase the sync speed, you can do so with the following command.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Warning&#039;&#039;&#039;: If you set the DRBD sync speed too high and saturate your disks&#039; maximum write speed, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clvmd&amp;lt;/span&amp;gt; daemon will likely fail to start in some cases, leading to fences. For this reason, keep your sync rate to about 2/3rds of the underlying disk maximum write speed and hold off on bumping up the sync speed until you know you will have a period of low activity on your cluster.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
drbdsetup /dev/drbd0 syncer -r 35M&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The speed-up will not be instant. It will take a little while for the speed to pick up. Once the sync is finished, it is a good idea to revert to the default sync rate.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
drbdadm syncer r0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Setting Up CLVM =&lt;br /&gt;
&lt;br /&gt;
The goal of DRBD in the cluster is to provide clustered [[LVM]], referred to as [[CLVM]] to the nodes. This is done by turning the DRBD partition into an CLVM physical volume.&lt;br /&gt;
&lt;br /&gt;
So now we will create a [[PV]] on top of the new [[DRBD]] partition, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/drbd0&amp;lt;/span&amp;gt;, that we created in the previous step. Since this new LVM [[PV]] will exist on top of the shared DRBD partition, whatever get written to it&#039;s logical volumes will be immediately available on either node, regardless of which node actually initiated the write.&lt;br /&gt;
&lt;br /&gt;
This capability is the underlying reason for creating this cluster; Neither machine is truly needed so if one machine dies, anything on top of the DRBD partition will still be available. When the failed machine returns, the surviving node will have a list of what blocks changed while the other node was gone and can use this list to quickly re-sync the other server.&lt;br /&gt;
&lt;br /&gt;
== Making LVM Cluster-Aware ==&lt;br /&gt;
&lt;br /&gt;
Normally, LVM is run on a single server. This means that at any time, the LVM can write data to the underlying drive and not need to worry if any other device might change anything. In clusters, this isn&#039;t the case. The other node could try to write to the shared storage, so then nodes need to enable &amp;quot;locking&amp;quot; to prevent the two nodes from trying to work on the same bit of data at the same time. &lt;br /&gt;
&lt;br /&gt;
The process of enabling this locking is known as making LVM &amp;quot;cluster-aware&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
LVM has tool called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;lvmconf&amp;lt;/span&amp;gt; that can be used to enable LVM locking. This is provided as part of the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;lvm2-cluster&amp;lt;/span&amp;gt; package.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum -y install lvm2-cluster.x86_64&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now to enable cluster awareness in LVM, run to following command.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
lvmconf --enable-cluster&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
By default, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clvmd&amp;lt;/span&amp;gt;, the cluster lvm daemon, is stopped and not set to run on boot. Now that we&#039;ve enabled LVM locking, we need to start it:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/clvmd status&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
clvmd is stopped&lt;br /&gt;
active volumes: (none)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As expected, it is stopped, so lets start it:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/clvmd start&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Activating VGs:   No volume groups found&lt;br /&gt;
                                                           [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: I&#039;ve seen on a few occasions where starting &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clvmd&amp;lt;/span&amp;gt; will time out and, on occasion, fences will be issued. I&#039;ve not sorted out why, but I have usually been able to resolve this by stopping &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clvmd&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt;, then restarting &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt; and, finally, restarting &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clvmd&amp;lt;/span&amp;gt;. If I can sort out a way to reliably trigger this problem, I will submit a bug report.&lt;br /&gt;
&lt;br /&gt;
== Filtering Out Devices ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;ToDo&#039;&#039;&#039;: Find a less-aggressive filter.&lt;br /&gt;
&lt;br /&gt;
With the stock &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/lvm/lvm.conf&amp;lt;/span&amp;gt; configuration, all devices on the system will be checked for LVM volumes. This can cause a problem as LVM will give preference to the LVM data on the RAID device over the DRBD device. It sees a duplicate as both are, effectively, one and the same.&lt;br /&gt;
&lt;br /&gt;
To work around this, we need to alter the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;filter = []&amp;lt;/span&amp;gt; entry. At the time of writing, simply rejecting the underlying &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/md3&amp;lt;/span&amp;gt; device as a candidate wasn&#039;t enough. So for now, we will tell LVM to accept DRBD devices and reject all other devices. To do this, we&#039;ll insert &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;quot;a|/dev/drbd*|&amp;quot;&amp;lt;/span&amp;gt; as the first array entry and change the existing entry to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;quot;r/.*/&amp;quot;&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: I would love feedback on a filter argument that successfully ignored just &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/md3&amp;lt;/span&amp;gt;, if anyone can suggest one.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/lvm/lvm.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
    # By default we accept every block device:&lt;br /&gt;
    #filter = [ &amp;quot;a/.*/&amp;quot; ]&lt;br /&gt;
    filter = [ &amp;quot;a|/dev/drbd*|&amp;quot;, &amp;quot;r/.*/&amp;quot; ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now delete the existing cache file so that LVM is forced to rescan the system.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
rm -f /etc/lvm/cache/.cache&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The changes take effect immediately.&lt;br /&gt;
&lt;br /&gt;
== Creating a new PV using the DRBD Partition ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Node1&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
We can now proceed with setting up the new DRBD-based LVM physical volume. Once the PV is created, we can create a new volume group and start allocating space to logical volumes.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: As we will be using our DRBD device, and as it is a shared block device, most of the following commands only need to be run on one node. Once the block device changes in any way, those changes will near-instantly appear on the other node. For this reason, unless explicitly stated to do so, only run the following commands on one node.&lt;br /&gt;
&lt;br /&gt;
To setup the DRBD partition as an LVM PV, run &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;pvcreate&amp;lt;/span&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
pvcreate /dev/drbd0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
  Physical volume &amp;quot;/dev/drbd0&amp;quot; successfully created&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Both&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Now, on both nodes, check that the new physical volume is visible by using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;pvdisplay&amp;lt;/span&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
pvdisplay&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;quot;/dev/drbd0&amp;quot; is a new physical volume of &amp;quot;422.44 GiB&amp;quot;&lt;br /&gt;
  --- NEW Physical volume ---&lt;br /&gt;
  PV Name               /dev/drbd0&lt;br /&gt;
  VG Name               &lt;br /&gt;
  PV Size               422.44 GiB&lt;br /&gt;
  Allocatable           NO&lt;br /&gt;
  PE Size               0   &lt;br /&gt;
  Total PE              0&lt;br /&gt;
  Free PE               0&lt;br /&gt;
  Allocated PE          0&lt;br /&gt;
  PV UUID               YHmdip-SuJN-KIEv-2tbK-BT9Q-wfOo-OuQuaW&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you see &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;PV Name /dev/drbd0&amp;lt;/span&amp;gt; (or your underlying partition) on both nodes, then your DRBD setup and LVM configuration changes are working perfectly!&lt;br /&gt;
&lt;br /&gt;
== Creating a VG on the new PV ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Node1&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Now we need to create the volume group using the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vgcreate&amp;lt;/span&amp;gt; command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vgcreate -c y drbd0_vg0 /dev/drbd0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
  Clustered volume group &amp;quot;drbd0_vg0&amp;quot; successfully created&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Both&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Now we&#039;ll check that the new VG is visible on both nodes using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vgdisplay&amp;lt;/span&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vgdisplay&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
  --- Volume group ---&lt;br /&gt;
  VG Name               drbd0_vg0&lt;br /&gt;
  System ID             &lt;br /&gt;
  Format                lvm2&lt;br /&gt;
  Metadata Areas        1&lt;br /&gt;
  Metadata Sequence No  1&lt;br /&gt;
  VG Access             read/write&lt;br /&gt;
  VG Status             resizable&lt;br /&gt;
  Clustered             yes&lt;br /&gt;
  Shared                no&lt;br /&gt;
  MAX LV                0&lt;br /&gt;
  Cur LV                0&lt;br /&gt;
  Open LV               0&lt;br /&gt;
  Max PV                0&lt;br /&gt;
  Cur PV                1&lt;br /&gt;
  Act PV                1&lt;br /&gt;
  VG Size               422.43 GiB&lt;br /&gt;
  PE Size               4.00 MiB&lt;br /&gt;
  Total PE              108143&lt;br /&gt;
  Alloc PE / Size       0 / 0   &lt;br /&gt;
  Free  PE / Size       108143 / 422.43 GiB&lt;br /&gt;
  VG UUID               Bb8l9e-es2z-PhaF-Gg3o-2is2-DZ1S-V2RsBF&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the new VG is visible on both nodes, we are ready to create our first logical volume using the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;lvcreate&amp;lt;/span&amp;gt; tool.&lt;br /&gt;
&lt;br /&gt;
== Creating the First LV on the new VG ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Node1&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Now we&#039;ll create a simple 20 GiB logical volumes. We will use it as a shared GFS2 store for shared files and to store our Xen domU config files later on.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
lvcreate -L 20G -n xen_shared drbd0_vg0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
  Logical volume &amp;quot;xen_shared&amp;quot; created&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Both&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
As before, we will check that the new logical volume is visible from both nodes by using the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;lvdisplay&amp;lt;/span&amp;gt; command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
lvdisplay&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
  --- Logical volume ---&lt;br /&gt;
  LV Name                /dev/drbd0_vg0/xen_shared&lt;br /&gt;
  VG Name                drbd0_vg0&lt;br /&gt;
  LV UUID                AqQizc-KBpX-2scN-WFLb-jIeF-QDcM-PlQW84&lt;br /&gt;
  LV Write Access        read/write&lt;br /&gt;
  LV Status              available&lt;br /&gt;
  # open                 0&lt;br /&gt;
  LV Size                20.00 GiB&lt;br /&gt;
  Current LE             5120&lt;br /&gt;
  Segments               1&lt;br /&gt;
  Allocation             inherit&lt;br /&gt;
  Read ahead sectors     auto&lt;br /&gt;
  - currently set to     256&lt;br /&gt;
  Block device           253:0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Again, if this is visible from both nodes, we&#039;re set! Repeat this process for all future LVs you will want to create. We will do this a little later to create LVs for Xen VMs.&lt;br /&gt;
&lt;br /&gt;
= Creating A Shared GFS FileSystem =&lt;br /&gt;
&lt;br /&gt;
GFS is a cluster-aware file system that can be simultaneously mounted on two or more nodes at once. We will use it as a place to store ISOs that we&#039;ll use to provision our virtual machines.&lt;br /&gt;
&lt;br /&gt;
== Install The GFS2 Utilities ==&lt;br /&gt;
&lt;br /&gt;
Start by installing the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[GFS2]]&amp;lt;/span&amp;gt; tools:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum -y install gfs2-utils.x86_64&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Format Our CLVM LV With The GFS2 File System ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Node1&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: The following example is designed for the cluster used in the prerequisite HowTo. &lt;br /&gt;
* If you have more than 2 nodes, increase the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;-j 2&amp;lt;/span&amp;gt; to the number of nodes you want to mount this file system on.&lt;br /&gt;
* If your cluster is named something other than &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-cluster&amp;lt;/span&amp;gt; (as set in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cluster.conf&amp;lt;/span&amp;gt; file), change &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;-t an-cluster:xen_shared&amp;lt;/span&amp;gt; to match you cluster&#039;s name. The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xen_shared&amp;lt;/span&amp;gt; can be whatever you like, but it must be unique in the cluster. I tend to use a name that matches the LV name, but this is my own preference and is not required.&lt;br /&gt;
&lt;br /&gt;
To format the partition run:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
mkfs.gfs2 -p lock_dlm -j 2 -t an-cluster:xen_shared /dev/drbd0_vg0/xen_shared&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
This will destroy any data on /dev/drbd0_vg0/xen_shared.&lt;br /&gt;
It appears to contain: symbolic link to `../dm-0&#039;&lt;br /&gt;
&lt;br /&gt;
Are you sure you want to proceed? [y/n] &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Acknowledge the warning, if any, and then press &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;y&amp;lt;/span&amp;gt; if you are ready to proceed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
y&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Device:                    /dev/drbd0_vg0/xen_shared&lt;br /&gt;
Blocksize:                 4096&lt;br /&gt;
Device Size                20.00 GB (5242880 blocks)&lt;br /&gt;
Filesystem Size:           20.00 GB (5242878 blocks)&lt;br /&gt;
Journals:                  2&lt;br /&gt;
Resource Groups:           80&lt;br /&gt;
Locking Protocol:          &amp;quot;lock_dlm&amp;quot;&lt;br /&gt;
Lock Table:                &amp;quot;an-cluster:xen_shared&amp;quot;&lt;br /&gt;
UUID:                      A1487063-2A3F-43B1-3A36-44936B0B4D1E&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once the format completes, you can mount &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/drbd0_vg0/xen_shared&amp;lt;/span&amp;gt; as you would a normal file system.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Both&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
To complete the example, lets mount the GFS2 partition we made just now on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/shared&amp;lt;/span&amp;gt; and then use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;df -h&amp;lt;/span&amp;gt; to verify.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
mkdir /xen_shared&lt;br /&gt;
mount /dev/drbd0_vg0/xen_shared /xen_shared&lt;br /&gt;
df -h&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Filesystem            Size  Used Avail Use% Mounted on&lt;br /&gt;
Filesystem            Size  Used Avail Use% Mounted on&lt;br /&gt;
/dev/md1               39G  2.8G   34G   8% /&lt;br /&gt;
tmpfs                 466M   29M  438M   7% /dev/shm&lt;br /&gt;
/dev/md0              243M   70M  161M  31% /boot&lt;br /&gt;
xenstore              466M   32K  466M   1% /var/lib/xenstored&lt;br /&gt;
/dev/dm-0              20G  259M   20G   2% /xen_shared&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You may have noticed that it shows &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/dm-0&amp;lt;/span&amp;gt; instead of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/drbd0_vg0/xen_shared&amp;lt;/span&amp;gt;. If you look at the later, you will see that it is simply a [[symlink]] to the former.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ls -lah /dev/drbd0_vg0/xen_shared&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
lrwxrwxrwx. 1 root root 7 Sep  9 13:24 /dev/drbd0_vg0/xen_shared -&amp;gt; ../dm-0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Add An Entry To /etc/fstab ==&lt;br /&gt;
&lt;br /&gt;
The last step is to add an entry for this new partition to each node&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/fstab&amp;lt;/span&amp;gt; file.&lt;br /&gt;
&lt;br /&gt;
=== Reference The GFS2 Partition By Device Path ===&lt;br /&gt;
&lt;br /&gt;
This is the more traditional method of referencing the GFS2 partition by using it&#039;s device path directly.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Warning&#039;&#039;&#039;: An incorrect edit of the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/fstab&amp;lt;/span&amp;gt; file can leave your system unable to boot! Please review the line generated above to make sure it is accurate and compatible with your setup before proceeding.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/fstab&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
#&lt;br /&gt;
# /etc/fstab&lt;br /&gt;
# Created by anaconda on Tue Sep  7 06:29:51 2010&lt;br /&gt;
#&lt;br /&gt;
# Accessible filesystems, by reference, are maintained under &#039;/dev/disk&#039;&lt;br /&gt;
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info&lt;br /&gt;
#&lt;br /&gt;
UUID=865690db-85d0-44c5-9f32-ffb6fdf47060 /                       ext3    defaults        1 1&lt;br /&gt;
UUID=8b9822b6-a92e-48c9-96b5-f8943142319e /boot                   ext3    defaults        1 2&lt;br /&gt;
UUID=94b03547-a7e3-45bb-b2d5-837498b370f4 swap                    swap    defaults        0 0&lt;br /&gt;
tmpfs                   /dev/shm                tmpfs   defaults        0 0&lt;br /&gt;
devpts                  /dev/pts                devpts  gid=5,mode=620  0 0&lt;br /&gt;
sysfs                   /sys                    sysfs   defaults        0 0&lt;br /&gt;
proc                    /proc                   proc    defaults        0 0&lt;br /&gt;
xenfs                   /proc/xen               xenfs   defaults        0 0&lt;br /&gt;
/dev/drbd0_vg0/xen_shared /xen_shared           gfs2    rw,suid,dev,exec,nouser,async    0 0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Reference The GFS2 Partition By UUID ===&lt;br /&gt;
&lt;br /&gt;
It is sometimes preferable to create an &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fstab&amp;lt;/span&amp;gt; entry that locates the device path via it&#039;s [[UUID]]. To do this, you can run the following command which, though a bit cryptic, will print out an &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/fstab&amp;lt;/span&amp;gt; compatible string.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Warning&#039;&#039;&#039;: The same warnings apply here as above&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
echo `gfs2_edit -p sb /dev/drbd0_vg0/xen_shared | grep sb_uuid | sed -e &amp;quot;s/.*sb_uuid  *\(.*\)/UUID=\L\1\E \/xen_shared\t\tgfs2\trw,suid,dev,exec,nouser,async\t0 0/&amp;quot;`&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
UUID=a1487063-2a3f-43b1-3a36-44936b0b4d1e /xen_shared gfs2 rw,suid,dev,exec,nouser,async 0 0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You may have noticed that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;defaults&amp;lt;/span&amp;gt; isn&#039;t used. Rather, all but the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;auto&amp;lt;/span&amp;gt; option are manually set. This is because the system will drop to single-user mode at boot if it can&#039;t mount an &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;auto&amp;lt;/span&amp;gt; partition at boot time (&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;auto&amp;lt;/span&amp;gt; being implied by &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;defaults&amp;lt;/span&amp;gt;). Given that our GFS2 partition sits on top of DRBD and the cluster, there is no way to make it available that early in the boot process.&lt;br /&gt;
&lt;br /&gt;
Further, the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;gfs2&amp;lt;/span&amp;gt; init script specifically excludes entries in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/fstab&amp;lt;/span&amp;gt; that have the &#039;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;noauto&amp;lt;/span&amp;gt; option set. For this reason, we can&#039;t simply specify that as we need the init script to see the partition so that it is mounted when GFS2 starts and unmounted when it stops.&lt;br /&gt;
&lt;br /&gt;
Now add this string to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/fstab&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/fstab&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
#&lt;br /&gt;
# /etc/fstab&lt;br /&gt;
# Created by anaconda on Tue Sep  7 06:29:51 2010&lt;br /&gt;
#&lt;br /&gt;
# Accessible filesystems, by reference, are maintained under &#039;/dev/disk&#039;&lt;br /&gt;
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info&lt;br /&gt;
#&lt;br /&gt;
UUID=865690db-85d0-44c5-9f32-ffb6fdf47060 /                       ext3    defaults        1 1&lt;br /&gt;
UUID=8b9822b6-a92e-48c9-96b5-f8943142319e /boot                   ext3    defaults        1 2&lt;br /&gt;
UUID=94b03547-a7e3-45bb-b2d5-837498b370f4 swap                    swap    defaults        0 0&lt;br /&gt;
tmpfs                   /dev/shm                tmpfs   defaults        0 0&lt;br /&gt;
devpts                  /dev/pts                devpts  gid=5,mode=620  0 0&lt;br /&gt;
sysfs                   /sys                    sysfs   defaults        0 0&lt;br /&gt;
proc                    /proc                   proc    defaults        0 0&lt;br /&gt;
xenfs                   /proc/xen               xenfs   defaults        0 0&lt;br /&gt;
UUID=a1487063-2a3f-43b1-3a36-44936b0b4d1e /xen_shared gfs2 rw,suid,dev,exec,nouser,async 0 0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Please note; At the time of writing this HowTo, there is a bug in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;findfs&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;mount&amp;lt;/span&amp;gt;. According to [http://www.ietf.org/rfc/rfc4122.txt RFC 4122], programs should accept a [[UUID]] in either upper or lower case. However, this is not currently the case, so you &#039;&#039;&#039;must&#039;&#039;&#039; pass the UUID in lower-case. Please see bugs [https://bugzilla.redhat.com/show_bug.cgi?id=632373 632373] and [https://bugzilla.redhat.com/show_bug.cgi?id=632385 632385].&lt;br /&gt;
&lt;br /&gt;
== Testing The gfs2 Initialization Script ==&lt;br /&gt;
&lt;br /&gt;
To verify that the new entry is valid, check &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;gfs2&amp;lt;/span&amp;gt;&#039;s status.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/gfs2 status&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Configured GFS2 mountpoints: &lt;br /&gt;
/xen_shared&lt;br /&gt;
Active GFS2 mountpoints: &lt;br /&gt;
/xen_shared&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now test stopping and restarting to ensure that the GFS2 partition unmounts and mounts properly.&lt;br /&gt;
&lt;br /&gt;
Stop &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;gfs2&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/gfs2 stop&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Unmounting GFS2 filesystem (/xen_shared):                   [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;df -h&amp;lt;/span&amp;gt; to ensure that the mount is gone.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
df -h&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Filesystem            Size  Used Avail Use% Mounted on&lt;br /&gt;
/dev/md1               39G  2.0G   35G   6% /&lt;br /&gt;
tmpfs                 466M   23M  444M   5% /dev/shm&lt;br /&gt;
/dev/md0              243M   70M  161M  31% /boot&lt;br /&gt;
xenstore              466M   32K  466M   1% /var/lib/xenstored&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Start &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;gfs2&amp;lt;/span&amp;gt; again.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/gfs2 start&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Mounting GFS2 filesystem (/xen_shared):                     [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Again, check with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;df -h&amp;lt;/span&amp;gt; that it has been remounted.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
df -h&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Filesystem            Size  Used Avail Use% Mounted on&lt;br /&gt;
/dev/md1               39G  2.0G   35G   6% /&lt;br /&gt;
tmpfs                 466M   29M  438M   7% /dev/shm&lt;br /&gt;
/dev/md0              243M   70M  161M  31% /boot&lt;br /&gt;
xenstore              466M   32K  466M   1% /var/lib/xenstored&lt;br /&gt;
/dev/dm-0              20G  259M   20G   2% /xen_shared&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Done!&lt;br /&gt;
&lt;br /&gt;
== Further Reading ==&lt;br /&gt;
&lt;br /&gt;
* [[Grow a GFS2 Partition]]&lt;br /&gt;
* [[Hard drive has gone bad in DRBD]]&lt;br /&gt;
&lt;br /&gt;
= Altering Daemon Start Order =&lt;br /&gt;
&lt;br /&gt;
It is important that the various daemons in use by our cluster start in the right order. Most daemons will rely on services provided by another daemon to be running, and will not start or will not operate reliably otherwise.&lt;br /&gt;
&lt;br /&gt;
We need to make sure that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xend&amp;lt;/span&amp;gt; starts so that the network is stable. Then &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt; needs to start so that [[fencing]] and [[dlm]] are available. Next, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;drbd&amp;lt;/span&amp;gt; starts so that the clustered storage is available. Then &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clvmd&amp;lt;/span&amp;gt; must start so that the data on the DRBD resource is accessible. Now &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;gfs2&amp;lt;/span&amp;gt; needs to start so that the Xen domU configuration files can be found and finally &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xendomains&amp;lt;/span&amp;gt; must start to boot up the actual domU virtual machines.&lt;br /&gt;
&lt;br /&gt;
To restate as a list, the start order must be:&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xend&amp;lt;/span&amp;gt;&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt;&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;drbd&amp;lt;/span&amp;gt;&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clvmd&amp;lt;/span&amp;gt;&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;gfs2&amp;lt;/span&amp;gt;&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xendomains&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To make sure the start order is sane then, we&#039;ll edit each of the six daemon&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;init&amp;lt;/span&amp;gt; scripts and alter their &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Required-Start&amp;lt;/span&amp;gt; lines. To make the changes take effect, we will use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;chkconfig&amp;lt;/span&amp;gt; to remove and re-add them to the various start levels.&lt;br /&gt;
&lt;br /&gt;
== Altering xend ==&lt;br /&gt;
&lt;br /&gt;
This should already be done. If it isn&#039;t, please see &amp;quot;[[#Make xend play nice with clustering|Making xend play nice with clustering]]&amp;quot; above. If you are revisiting that section, you can skip the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt; edit as we will need to make another change in the next step.&lt;br /&gt;
&lt;br /&gt;
== Altering cman ==&lt;br /&gt;
&lt;br /&gt;
This should already be done. If it isn&#039;t, please see &amp;quot;[[#Make xend play nice with clustering|Making xend play nice with clustering]]&amp;quot; above. If you are revisiting that section, you can skip the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt; edit as we will need to make another change in the next step.&lt;br /&gt;
&lt;br /&gt;
== Altering drbd ==&lt;br /&gt;
&lt;br /&gt;
Now we will tell &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;drbd&amp;lt;/span&amp;gt; to start after &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
This requires the additional step of altering the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;chkconfig: - 70 08&amp;lt;/span&amp;gt; line to instead read &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;chkconfig: - 20 08&amp;lt;/span&amp;gt;. This isn&#039;t strictly needed, but will give more room for &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;chkconfig&amp;lt;/span&amp;gt; to order the dependent daemons by allowing DRBD to be started as low as position &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;20&amp;lt;/span&amp;gt;, rather than waiting until position &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;70&amp;lt;/span&amp;gt;. This is somewhat more compatible with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clvmd&amp;lt;/span&amp;gt; which normally start at positions &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;21&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;24&amp;lt;/span&amp;gt;, respectively&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/init.d/drbd&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
#&lt;br /&gt;
# chkconfig: - 20 08&lt;br /&gt;
# description: Loads and unloads the drbd module&lt;br /&gt;
#&lt;br /&gt;
# Copright 2001-2008 LINBIT Information Technologies&lt;br /&gt;
# Philipp Reisner, Lars Ellenberg&lt;br /&gt;
#&lt;br /&gt;
### BEGIN INIT INFO&lt;br /&gt;
# Provides: drbd&lt;br /&gt;
# Required-Start: $local_fs $network $syslog cman&lt;br /&gt;
# Required-Stop:  $local_fs $network $syslog&lt;br /&gt;
# Should-Start:   sshd multipathd&lt;br /&gt;
# Should-Stop:    sshd multipathd&lt;br /&gt;
# Default-Start:&lt;br /&gt;
# Default-Stop:&lt;br /&gt;
# Short-Description:    Control drbd resources.&lt;br /&gt;
### END INIT INFO&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Altering clvmd ==&lt;br /&gt;
&lt;br /&gt;
Now we will now tell &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clvmd&amp;lt;/span&amp;gt; to start after &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;drbd&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: There is currently a minor bug with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;lvm2-cluster&amp;lt;/span&amp;gt; version &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;2.02.73-2&amp;lt;/span&amp;gt; in that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/init.d/clvmd&amp;lt;/span&amp;gt; is set by default to mode &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;0555&amp;lt;/span&amp;gt;. This is easily corrected by running the following command. Please check bug [https://bugzilla.redhat.com/show_bug.cgi?id=636066 636066] to see if this has been resolved.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
chmod u+w /etc/init.d/clvmd&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once you&#039;ve got write access, edit the file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/init.d/clvmd&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
#&lt;br /&gt;
# chkconfig: - 24 76&lt;br /&gt;
# description: Starts and stops clvmd&lt;br /&gt;
#&lt;br /&gt;
# For Red-Hat-based distributions such as Fedora, RHEL, CentOS.&lt;br /&gt;
#              &lt;br /&gt;
### BEGIN INIT INFO&lt;br /&gt;
# Provides: clvmd&lt;br /&gt;
# Required-Start: $local_fs drbd&lt;br /&gt;
# Required-Stop: $local_fs&lt;br /&gt;
# Default-Start:&lt;br /&gt;
# Default-Stop: 0 1 6&lt;br /&gt;
# Short-Description: Clustered LVM Daemon&lt;br /&gt;
### END INIT INFO&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Altering gfs2 ==&lt;br /&gt;
&lt;br /&gt;
Now we will now tell &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;gfs2&amp;lt;/span&amp;gt; to start after &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clvmd&amp;lt;/span&amp;gt;. You will notice that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt; is already listed under &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Required-Start&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Required-Stop&amp;lt;/span&amp;gt;. It&#039;s true that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt; must be started, but we&#039;ve created a chain here so we can safely replace it with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clvmd&amp;lt;/span&amp;gt; in the start line.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/init.d/gfs2&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
#&lt;br /&gt;
# gfs2 mount/unmount helper&lt;br /&gt;
#&lt;br /&gt;
# chkconfig: - 26 74&lt;br /&gt;
# description: mount/unmount gfs2 filesystems configured in /etc/fstab&lt;br /&gt;
&lt;br /&gt;
### BEGIN INIT INFO&lt;br /&gt;
# Provides:             gfs2&lt;br /&gt;
# Required-Start:       $network clvmd&lt;br /&gt;
# Required-Stop:        $network&lt;br /&gt;
# Default-Start:&lt;br /&gt;
# Default-Stop:&lt;br /&gt;
# Short-Description:    mount/unmount gfs2 filesystems configured in /etc/fstab&lt;br /&gt;
# Description:          mount/unmount gfs2 filesystems configured in /etc/fstab&lt;br /&gt;
### END INIT INFO&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Altering xendomains ==&lt;br /&gt;
&lt;br /&gt;
Finally, we will alter &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xendomains&amp;lt;/span&amp;gt; so that it starts last, after &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;gfs2&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/init.d/xendomains&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
#&lt;br /&gt;
# /etc/init.d/xendomains&lt;br /&gt;
# Start / stop domains automatically when domain 0 boots / shuts down.&lt;br /&gt;
#&lt;br /&gt;
# chkconfig: 345 99 00&lt;br /&gt;
# description: Start / stop Xen domains.&lt;br /&gt;
#&lt;br /&gt;
# This script offers fairly basic functionality.  It should work on Redhat&lt;br /&gt;
# but also on LSB-compliant SuSE releases and on Debian with the LSB package&lt;br /&gt;
# installed.  (LSB is the Linux Standard Base)&lt;br /&gt;
#&lt;br /&gt;
# Based on the example in the &amp;quot;Designing High Quality Integrated Linux&lt;br /&gt;
# Applications HOWTO&amp;quot; by Avi Alkalay&lt;br /&gt;
# &amp;lt;http://www.tldp.org/HOWTO/HighQuality-Apps-HOWTO/&amp;gt;&lt;br /&gt;
#&lt;br /&gt;
### BEGIN INIT INFO&lt;br /&gt;
# Provides:          xendomains&lt;br /&gt;
# Required-Start:    $syslog $remote_fs xend gfs2&lt;br /&gt;
# Should-Start:&lt;br /&gt;
# Required-Stop:     $syslog $remote_fs xend&lt;br /&gt;
# Should-Stop:&lt;br /&gt;
# Default-Start:     3 4 5&lt;br /&gt;
# Default-Stop:      0 1 2 6&lt;br /&gt;
# Default-Enabled:   yes&lt;br /&gt;
# Short-Description: Start/stop secondary xen domains&lt;br /&gt;
# Description:       Start / stop domains automatically when domain 0 &lt;br /&gt;
#                    boots / shuts down.&lt;br /&gt;
### END INIT INFO&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Applying The Changes ==&lt;br /&gt;
&lt;br /&gt;
Change the start order by removing and re-adding all cluster-related daemons using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;chkconfig&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
chkconfig xenstored off; chkconfig xenconsoled off; chkconfig xend off; chkconfig cman off; chkconfig drbd off; chkconfig clvmd off; chkconfig gfs2 off; chkconfig xendomains off&lt;br /&gt;
chkconfig xendomains on; chkconfig gfs2 on; chkconfig clvmd on; chkconfig drbd on; chkconfig cman on; chkconfig xend on; chkconfig xenconsoled on; chkconfig xenstored on&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now verify that the start order is as we want it. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ls -lah /etc/rc3.d/&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
lrwxrwxrwx.  1 root root   19 Sep 20 13:37 S26xenstored -&amp;gt; ../init.d/xenstored&lt;br /&gt;
lrwxrwxrwx.  1 root root   21 Sep 20 13:37 S27xenconsoled -&amp;gt; ../init.d/xenconsoled&lt;br /&gt;
lrwxrwxrwx.  1 root root   14 Sep 20 13:37 S28xend -&amp;gt; ../init.d/xend&lt;br /&gt;
lrwxrwxrwx.  1 root root   14 Sep 20 13:37 S29cman -&amp;gt; ../init.d/cman&lt;br /&gt;
lrwxrwxrwx.  1 root root   14 Sep 20 13:37 S70drbd -&amp;gt; ../init.d/drbd&lt;br /&gt;
lrwxrwxrwx.  1 root root   15 Sep 20 13:37 S71clvmd -&amp;gt; ../init.d/clvmd&lt;br /&gt;
lrwxrwxrwx.  1 root root   14 Sep 20 13:37 S72gfs2 -&amp;gt; ../init.d/gfs2&lt;br /&gt;
lrwxrwxrwx.  1 root root   20 Sep 20 13:37 S99xendomains -&amp;gt; ../init.d/xendomains&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Setting Up Xen =&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;WARNING&#039;&#039;&#039;&#039;&#039;: Everything below here is pretty &#039;&#039;&#039;seriously screwed up&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: This is not meant to be an extensive tutorial on Xen itself. It covers enough to get domU VMs provisioned in a manner that will take advantage of the cluster. As such, there is minimal explanation of configuration file options. If you need further help, please drop by the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;##xen&amp;lt;/span&amp;gt; (yes, two &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;##&amp;lt;/span&amp;gt;) [[IRC]] channel on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;freenode.org&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Install The Hypervisor Tools ==&lt;br /&gt;
&lt;br /&gt;
These tools are very useful in provisioning and managing domU VMs.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum -y install virt-install virt-viewer&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Install The HVM/KVM Tools ==&lt;br /&gt;
&lt;br /&gt;
For &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;hvm&amp;lt;/span&amp;gt; (Hardware Virtual Machines), which is required for [http://www.virtuatopia.com/index.php/Virtualizing_Windows_Server_2008_with_Xen paravirtualized Microsoft] VMs, you must install the following packages as well.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum -y install qemu-kvm.x86_64 qemu-kvm-tools.x86_64&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Ensure That Virtualization Is Enabled ==&lt;br /&gt;
&lt;br /&gt;
Many motherboards disable &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;hvm&amp;lt;/span&amp;gt; by default in their [[BIOS]]. Assuming that you&#039;ve got a dom0 kernel running at this stage, you can check if this is the case by checking the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xm info&amp;lt;/span&amp;gt; output.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
xm info&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
host                   : an-node04.alteeve.com&lt;br /&gt;
release                : 2.6.32.23-170.dom0_an1.fc13.x86_64&lt;br /&gt;
version                : #1 SMP Sun Oct 10 20:39:19 EDT 2010&lt;br /&gt;
machine                : x86_64&lt;br /&gt;
nr_cpus                : 4&lt;br /&gt;
nr_nodes               : 1&lt;br /&gt;
cores_per_socket       : 4&lt;br /&gt;
threads_per_core       : 1&lt;br /&gt;
cpu_mhz                : 2209&lt;br /&gt;
hw_caps                : 178bf3ff:efd3fbff:00000000:00001310:00802001:00000000:000037ff:00000000&lt;br /&gt;
virt_caps              : hvm&lt;br /&gt;
total_memory           : 4063&lt;br /&gt;
free_memory            : 2987&lt;br /&gt;
node_to_cpu            : node0:0-3&lt;br /&gt;
node_to_memory         : node0:2987&lt;br /&gt;
node_to_dma32_mem      : node0:2928&lt;br /&gt;
max_node_id            : 0&lt;br /&gt;
xen_major              : 4&lt;br /&gt;
xen_minor              : 0&lt;br /&gt;
xen_extra              : .1&lt;br /&gt;
xen_caps               : xen-3.0-x86_64 xen-3.0-x86_32p hvm-3.0-x86_32 hvm-3.0-x86_32p hvm-3.0-x86_64 &lt;br /&gt;
xen_scheduler          : credit&lt;br /&gt;
xen_pagesize           : 4096&lt;br /&gt;
platform_params        : virt_start=0xffff800000000000&lt;br /&gt;
xen_changeset          : unavailable&lt;br /&gt;
xen_commandline        : dom0_mem=1024M&lt;br /&gt;
cc_compiler            : gcc version 4.4.4 20100630 (Red Hat 4.4.4-10) (GCC) &lt;br /&gt;
cc_compile_by          : root&lt;br /&gt;
cc_compile_domain      : &lt;br /&gt;
cc_compile_date        : Mon Oct 11 01:10:38 EDT 2010&lt;br /&gt;
xend_config_format     : 4&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Look at the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt_caps&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xen_caps&amp;lt;/span&amp;gt; lines. Notice the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;hvm&amp;lt;/span&amp;gt; entries? This shows that HVM, also known as &amp;quot;secure virtualization&amp;quot;, has been enabled. If you do not see this, please check your mainboard manual for information on enabling this on your system.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: The next paragraph applies only when running a vanilla kernel.&lt;br /&gt;
&lt;br /&gt;
If you are running a vanilla kernel, you can check to see if your CPU has support for HVM guests but checking &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/proc/cpuinfo&amp;lt;/span&amp;gt;. What you&#039;re looking for depends on your CPU manufacturer. If you have an Intel CPU, you need to look for the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vmx&amp;lt;/span&amp;gt; flag. Likewise, with AMD CPUs, you need to look for the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;svm&amp;lt;/span&amp;gt; flag.&lt;br /&gt;
&lt;br /&gt;
For a more complete, if somewhat dated paper on this topic, please [http://fedoraproject.org/wiki/FedoraXenQuickstartFC6#Fully-virtualized_guests_.28HVM.2FIntel-VT.2FAMD-V.29 Fedora 6 Xen Quickstart Guide, System Requirements].&lt;br /&gt;
&lt;br /&gt;
== Enabling Migration ==&lt;br /&gt;
&lt;br /&gt;
By default, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xend&amp;lt;/span&amp;gt; will not allow domU VMs from being migrated onto or off of a given dom0 host. Given that we&#039;ve got a cluster though, we very much want this behaviour, so now we will enable it. This is done by making edits to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/xen/xend-config.sxp&amp;lt;/span&amp;gt;. Below is a concise list of options that must be set. Some exist already in the file and need to be commented out or altered.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Warning&#039;&#039;&#039;: The values below are &#039;&#039;&#039;very&#039;&#039;&#039; permissive. Please review each option and improve the security to fit your network before going into production!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/xen/xend-config.sxp &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
(xend-http-server yes)&lt;br /&gt;
(xend-unix-server yes)&lt;br /&gt;
(xend-tcp-xmlrpc-server yes)&lt;br /&gt;
(xend-relocation-server yes)&lt;br /&gt;
(xend-udev-event-server yes)&lt;br /&gt;
(xend-port            8000)&lt;br /&gt;
(xend-relocation-port 8002)&lt;br /&gt;
(xend-address &#039;&#039;)&lt;br /&gt;
(xend-relocation-address &#039;&#039;)&lt;br /&gt;
(xend-relocation-hosts-allow &#039;&#039;)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once done, restart &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xend&amp;lt;/span&amp;gt;. It is usually safest to stop the cluster before hand to avoid accidental fencing caused by the underlying network being reconfigured.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/gfs2 stop&lt;br /&gt;
/etc/init.d/clvmd stop&lt;br /&gt;
/etc/init.d/cman stop&lt;br /&gt;
/etc/init.d/xend restart&lt;br /&gt;
/etc/init.d/cman start&lt;br /&gt;
/etc/init.d/clvmd start&lt;br /&gt;
/etc/init.d/gfs2 start&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Provisioning domU VMs ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: Long and ugly, but it worked. Needs more testing though.&lt;br /&gt;
&lt;br /&gt;
Web-based install:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# Fedora 13 x86_64 RPM builder VM&lt;br /&gt;
lvcreate -L 40G -n f13_builder_01 drbd0_vg0&lt;br /&gt;
virt-install --connect xen \&lt;br /&gt;
             --name f13_builder_01 \&lt;br /&gt;
             --ram 1024 \&lt;br /&gt;
             --arch x86_64 \&lt;br /&gt;
             --vcpus 1 \&lt;br /&gt;
             --cpuset 1 \&lt;br /&gt;
             --location http://192.168.1.10/f13/x86_64/img/ \&lt;br /&gt;
             --os-type linux \&lt;br /&gt;
             --os-variant fedora13 \&lt;br /&gt;
             --disk path=/dev/drbd0_vg0/f13_builder_01 \&lt;br /&gt;
             --network bridge=eth0,mac=00:16:3e:00:10:01 \&lt;br /&gt;
             --vnc \&lt;br /&gt;
             --paravirt&lt;br /&gt;
&lt;br /&gt;
# A CentOS test server&lt;br /&gt;
lvcreate -L 40G -n c5_test_01 drbd0_vg0&lt;br /&gt;
virt-install --connect xen \&lt;br /&gt;
             --name c5_test_01 \&lt;br /&gt;
             --ram 1024 \&lt;br /&gt;
             --arch x86_64 \&lt;br /&gt;
             --vcpus 1 \&lt;br /&gt;
             --cpuset 1-3 \&lt;br /&gt;
             --location http://192.168.1.10/c5/x86_64/img/ \&lt;br /&gt;
             --os-type linux \&lt;br /&gt;
             --os-variant rhel5.4 \&lt;br /&gt;
             --disk path=/dev/drbd0_vg0/c5_test_01 \&lt;br /&gt;
             --network bridge=eth0,mac=00:16:3e:00:10:02 \&lt;br /&gt;
             --vnc \&lt;br /&gt;
             --paravirt&lt;br /&gt;
&lt;br /&gt;
# Red Hat Enterprise Linux 6 beta 2 test server&lt;br /&gt;
lvcreate -L 40G -n rh6b2_test_01 drbd0_vg0&lt;br /&gt;
virt-install --connect xen \&lt;br /&gt;
             --name rh6b2_test_01 \&lt;br /&gt;
             --ram 1024 \&lt;br /&gt;
             --arch x86_64 \&lt;br /&gt;
             --vcpus 1 \&lt;br /&gt;
             --cpuset 1 \&lt;br /&gt;
             --location http://192.168.1.10/rhel6/x86_64/img/ \&lt;br /&gt;
             --os-type linux \&lt;br /&gt;
             --os-variant rhel6 \&lt;br /&gt;
             --disk path=/dev/drbd0_vg0/rh6b2_test_01 \&lt;br /&gt;
             --network bridge=eth0,mac=00:16:3e:00:10:03 \&lt;br /&gt;
             --vnc \&lt;br /&gt;
             --paravirt&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
ISO-based install:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
### Still sorting this out - doesn&#039;t seem to find &#039;qemu-dm&#039; (wants to use &#039;lib64&#039; but it&#039;s in &#039;lib&#039;).&lt;br /&gt;
# Windows 2008 Business Server&lt;br /&gt;
lvcreate -L 50G -n win2008_01 drbd0_vg0&lt;br /&gt;
virt-install --connect xen \&lt;br /&gt;
             --name win2008_01 \&lt;br /&gt;
             --ram 1024 \&lt;br /&gt;
             --arch x86_64 \&lt;br /&gt;
             --vcpus 1 \&lt;br /&gt;
             --cpuset 1 \&lt;br /&gt;
             --cdrom /xen_shared/iso/Win_Server_2008_Bis_x86_64.iso \&lt;br /&gt;
             --os-type windows \&lt;br /&gt;
             --os-variant win2k8 \&lt;br /&gt;
             --disk path=/dev/drbd_vg0/win2008_01 \&lt;br /&gt;
             --network bridge=eth0,mac=00:16:3e:00:10:04 \&lt;br /&gt;
             --vnc \&lt;br /&gt;
             --hvm&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Enabling Migration ==&lt;br /&gt;
&lt;br /&gt;
We need to make some changes to the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xend-config.sxp&amp;lt;/span&amp;gt; in order to enable migrating domU VMs between the nodes.&lt;br /&gt;
&lt;br /&gt;
So start by editing the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/xen/xend-config.sxp&amp;lt;/span&amp;gt; file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/xen/xend-config.sxp&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that this is not meant to be an extensive list, nor a set of changes that maximize security. This will get you up and running, then from there you can explore the other options one at a time to improve security.&lt;br /&gt;
&lt;br /&gt;
=== xen-api-server ===&lt;br /&gt;
&lt;br /&gt;
This option allows for one or more access method definitions to your domU VMs on a given node. By default, it is set to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;(xen-api-server ((unix)))&amp;lt;/span&amp;gt; which only allows access from the local machine. We&#039;ll add a new access definition that will tell Xen to listen on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;localhost&amp;lt;/span&amp;gt; and on our back-channel on [[TCP]] port &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;9001&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
# Default:&lt;br /&gt;
#   (xen-api-server ((unix)))&lt;br /&gt;
(xen-api-server ((9001 pam &#039;^localhost$ ^10\\.0\\.1&#039;) (unix none)))&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Provision A Virtual Machine ==&lt;br /&gt;
&lt;br /&gt;
Let&#039;s walk through the creation of a simple [[CentOS]] 5.x [[domU]]. We&#039;ll call it &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;c5_test_01&amp;lt;/span&amp;gt;. Personally, I like to name my virtual machines with the format &amp;quot;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;os_role_seq&amp;lt;/span&amp;gt;&amp;quot; (&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;Operating System ID&amp;gt;_&amp;lt;Role of the VM&amp;gt;_&amp;lt;Sequence Integer&amp;gt;&amp;lt;/span&amp;gt;). There are no (known) restrictions on virtual machine names, so feel free to use names that made sense for you.&lt;br /&gt;
&lt;br /&gt;
=== Install virt-manager ===&lt;br /&gt;
&lt;br /&gt;
We will now start using a graphical tool called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-manager&amp;lt;/span&amp;gt;. It simplifies the creation of domU VMs quite a bit.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install virt-manager&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Be sure that you&#039;ve enabled &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;X-Forwarding&amp;lt;/span&amp;gt; if you&#039;ve &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ssh&amp;lt;/span&amp;gt;&#039;ed into your nodes. This may require modifying your &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/sshd_config&amp;lt;/span&amp;gt; file and changing &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;X11Forwarding&amp;lt;/span&amp;gt; to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;yes&amp;lt;/span&amp;gt;. Then when you connect to the node, you will need to use the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ssh -X user@node&amp;lt;/span&amp;gt; switch.&lt;br /&gt;
&lt;br /&gt;
We&#039;ll come back to this program shortly.&lt;br /&gt;
&lt;br /&gt;
=== Create The CLVM LV ===&lt;br /&gt;
&lt;br /&gt;
We will create a new [[CLVM]] [[LV]] for this [[VM]]. It will act as the VM&#039;s hard drive, so it needs to have enough capacity for the OS and any data you expect the VM to need. As we&#039;re creating a hypothetical router/firewall, we will not need much space. We&#039;ll use 20 [[GiB]], which should be more than enough.&lt;br /&gt;
&lt;br /&gt;
As before, this will only need to be done on one node. Being that it is on top of the DRBD resource, it will be visible to both nodes.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Node1&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
lvcreate -L 20G -n c5_test_01 drbd0_vg0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
  Logical volume &amp;quot;c5_test_01&amp;quot; created&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Both&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Verify that the new LV is indeed visible from both nodes now.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
lvdisplay &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
  --- Logical volume ---&lt;br /&gt;
  LV Name                /dev/drbd0_vg0/xen_shared&lt;br /&gt;
  VG Name                drbd0_vg0&lt;br /&gt;
  LV UUID                yjt41B-cdc4-LGV4-Ds0m-eRVv-FIY7-3FK4Kb&lt;br /&gt;
  LV Write Access        read/write&lt;br /&gt;
  LV Status              available&lt;br /&gt;
  # open                 1&lt;br /&gt;
  LV Size                20.00 GiB&lt;br /&gt;
  Current LE             5120&lt;br /&gt;
  Segments               1&lt;br /&gt;
  Allocation             inherit&lt;br /&gt;
  Read ahead sectors     auto&lt;br /&gt;
  - currently set to     256&lt;br /&gt;
  Block device           253:0&lt;br /&gt;
   &lt;br /&gt;
  --- Logical volume ---&lt;br /&gt;
  LV Name                /dev/drbd0_vg0/c5_test_01&lt;br /&gt;
  VG Name                drbd0_vg0&lt;br /&gt;
  LV UUID                eOcBZz-nJzz-wHwg-4cBL-ZZHm-1cm6-Sf82xC&lt;br /&gt;
  LV Write Access        read/write&lt;br /&gt;
  LV Status              available&lt;br /&gt;
  # open                 0&lt;br /&gt;
  LV Size                20.00 GiB&lt;br /&gt;
  Current LE             5120&lt;br /&gt;
  Segments               1&lt;br /&gt;
  Allocation             inherit&lt;br /&gt;
  Read ahead sectors     auto&lt;br /&gt;
  - currently set to     256&lt;br /&gt;
  Block device           253:1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we&#039;ve got the space, we&#039;re ready to provision!&lt;br /&gt;
&lt;br /&gt;
=== Connecting To The Hypervisor From virt-manager ===&lt;br /&gt;
&lt;br /&gt;
At this point, we&#039;ll be using the graphical &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-manager&amp;lt;/span&amp;gt; tool. &lt;br /&gt;
&lt;br /&gt;
==== Running virt-manager Directly On a Node ====&lt;br /&gt;
&lt;br /&gt;
If you are working on the nodes directly, you can run &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-manager&amp;lt;/span&amp;gt; but you will need to have Gnome or KDE started first. The easiest way to do this is to switch to run level 5. As an unprivileged user, run the following command.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
startx&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From there, click on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Application&amp;lt;/span&amp;gt; -&amp;gt; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;System Tools&amp;lt;/span&amp;gt; -&amp;gt; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Virtual machine Manager&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Image:virt-manager_local-node_01.png|thumb|500px|center|Where to find &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-manager&amp;lt;/span&amp;gt; in Fedora 13]]&lt;br /&gt;
&lt;br /&gt;
==== Running virt-manager Remotely Over X-Forwarding ====&lt;br /&gt;
&lt;br /&gt;
Some features in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-manager&amp;lt;/span&amp;gt; don&#039;t work well unless they are run off of the local machine. The best way to accomplish this from a remote system is to use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;X-Forwarding&amp;lt;/span&amp;gt;, which was discussed in the [[#Install virt-manager|Install virt-manager]] above. &lt;br /&gt;
&lt;br /&gt;
Generally speaking, I prefer to provision VMs using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-manager&amp;lt;/span&amp;gt; directly on a cluster node. This avoids some problems, like accessing underlying LVM volumes. So to do this when you can&#039;t directly sit at a node, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ssh&amp;lt;/span&amp;gt; into your node using the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;-X&amp;lt;/span&amp;gt; switch.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ssh -X root@an-node01&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Last login: Sun Sep 19 22:02:38 2010&lt;br /&gt;
[root@an-node01 ~]# &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now start &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-manager&amp;lt;/span&amp;gt; at the command line and wait for it to open on your local workstation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
virt-manager&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: If your local workstation has a different version of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;X&amp;lt;/span&amp;gt; server or Gnome, the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-manager&amp;lt;/span&amp;gt; window could look fairly primitive. It will work just the same though, and all the icons will be in the same place.&lt;br /&gt;
&lt;br /&gt;
==== Running virt-manager Locally On a Workstation ====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-manager&amp;lt;/span&amp;gt; tool can be installed on a computer outside of the cluster and then used to connect to the hypervisor on either node. This is very useful for daily usage of your virtual machines, but isn&#039;t recommended during the provisioning stage. In some cases, running &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-manager&amp;lt;/span&amp;gt; remotely will cause it to not see the LVM volumes properly, preventing you from choosing the LV for your new VM.&lt;br /&gt;
&lt;br /&gt;
To connect to the hypervisor on the cluster nodes, click on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;File&amp;lt;/span&amp;gt; -&amp;gt; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Add Connection&amp;lt;/span&amp;gt;. Change the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Hypervison&amp;lt;/span&amp;gt; to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Xen&amp;lt;/span&amp;gt; and then change the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Connection&amp;lt;/span&amp;gt; to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Remote tunnel over SSH&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[Image:virt-manager_remote-workstation_01.png|thumb|500px|center|Adding a remote connection in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-manager&amp;lt;/span&amp;gt; from a workstation]]&lt;br /&gt;
&lt;br /&gt;
In some cases, not all of the nodes on the network will be seen. In the screen shot above, you can see that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt; can be seen, but &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt; wasn&#039;t. To add the missing one, just type &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;node-name.local&amp;lt;/span&amp;gt; (&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01.local&amp;lt;/span&amp;gt; above). Once selected, hit &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Connect&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Once the two nodes have been connected, you should see them on the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-manager&amp;lt;/span&amp;gt; main page.&lt;br /&gt;
&lt;br /&gt;
[[Image:virt-manager_remote-workstation_02.png|thumb|500px|center|Remote connection in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-manager&amp;lt;/span&amp;gt; to both nodes in the cluster]]&lt;br /&gt;
&lt;br /&gt;
Once you seen your nodes, you can proceed to use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-manager&amp;lt;/span&amp;gt; the same as if you were running it on one of the nodes directly.&lt;br /&gt;
&lt;br /&gt;
=== Using virt-manager To Provision Our VM ===&lt;br /&gt;
&lt;br /&gt;
How you use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-manager&amp;lt;/span&amp;gt; will be the same regardless of how or where you started it. The following steps will walk you through the program&#039;s use.&lt;br /&gt;
&lt;br /&gt;
With the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Virtual Machine Manager&amp;lt;/span&amp;gt; main menu connected to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;localhost (QEMU)&amp;lt;/span&amp;gt;, we can now begin the process of provisioning a new Xen domU virtual machine! The top-left icon, which looks like a monitor with the &amp;quot;play&amp;quot; button on it&#039;s screen, will be used to provision our virtual machine.&lt;br /&gt;
&lt;br /&gt;
[[Image:virt-manager_local-node_02.png|thumb|500px|center|The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-manager&amp;lt;/span&amp;gt; main menu]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Madi&#039;&#039;&#039;: You left off here.&lt;br /&gt;
&lt;br /&gt;
Once you press the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Create a new virtual machine&amp;lt;/span&amp;gt; button you will be asked to name the VM and to choose the install type. Even if you have a [[PXE]] server, choose Network Install.&lt;br /&gt;
&lt;br /&gt;
[[Image:virt-manager_provision_02.png|thumb|500px|center|Provisioning a Xen domU - Naming the VM and choosing the install source]&lt;br /&gt;
&lt;br /&gt;
=== Storing The domU Configuration Files ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;ToDo&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Node1&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
As this is our first [[domU]], we&#039;ll start by creating our shared configuration directory on the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/xen_shared&amp;lt;/span&amp;gt; [[GFS2]] partition we just created.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
mkdir /xen_shared/config&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To confirm again that the GFS2 partition is working, verify that this directory is visible from both nodes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ls -lah /xen_shared/&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
total 20K&lt;br /&gt;
drwxr-xr-x.  3 root root 3.8K Sep 13 12:57 .&lt;br /&gt;
dr-xr-xr-x. 27 root root 4.0K Sep 13 11:32 ..&lt;br /&gt;
drwxr-xr-x.  2 root root 3.8K Sep 13 12:57 config&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{footer}}&lt;/div&gt;</summary>
		<author><name>SRSullivan</name></author>
	</entry>
	<entry>
		<id>https://alteeve.com/w/index.php?title=Abandoned_-_Two_Node_Fedora_13_Cluster&amp;diff=2282</id>
		<title>Abandoned - Two Node Fedora 13 Cluster</title>
		<link rel="alternate" type="text/html" href="https://alteeve.com/w/index.php?title=Abandoned_-_Two_Node_Fedora_13_Cluster&amp;diff=2282"/>
		<updated>2010-10-13T17:58:58Z</updated>

		<summary type="html">&lt;p&gt;SRSullivan: /* Testing IPMI */  Added line to enable service on boot.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{howto_header}}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Notice&#039;&#039;&#039;&#039;&#039;, &#039;&#039;&#039;Sep. 08, 2010&#039;&#039;&#039; - &#039;&#039;Draft 1&#039;&#039;: This is the first draft of this HowTo. It has not been peer-reviewed yet, so please proceed with caution and on a test cluster. Any and all feedback is much appreciated.&lt;br /&gt;
&lt;br /&gt;
= Overview =&lt;br /&gt;
&lt;br /&gt;
This paper has one goal;&lt;br /&gt;
&lt;br /&gt;
# How to assemble the simplest cluster possible, a &#039;&#039;&#039;2-Node Cluster&#039;&#039;&#039;, which you can then expand on for your own needs.&lt;br /&gt;
&lt;br /&gt;
With this completed, you can then jump into &amp;quot;step 2&amp;quot; papers that will show various uses of a two node cluster:&lt;br /&gt;
&lt;br /&gt;
# How to create a &amp;quot;floating&amp;quot; virtual machine that can move between the two nodes in the event of a node failure, maximizing up time.&lt;br /&gt;
# How to create simple resources that can move between nodes. Examples will be a simple PostgreSQL database, DHCP, DNS and web servers.&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
&lt;br /&gt;
It is expected that you are already comfortable with the Linux command line, specifically &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[bash]]&amp;lt;/span&amp;gt;, and that you are familiar with general administrative tasks in Red Hat based distributions, specifically [[Fedora]]. You will also need to be comfortable using editors like [[vim]], [[nano]] or similar. This paper uses &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vim&amp;lt;/span&amp;gt; in examples. Simply substitute your favourite editor in it&#039;s place.&lt;br /&gt;
&lt;br /&gt;
You are also expected to be comfortable with networking concepts. You will be expected to understand TCP/IP, [[multicast]], broadcast, subnets and netmasks, routing and other relatively basic networking concepts. Please take the time to become familiar with these concepts before proceeding.&lt;br /&gt;
&lt;br /&gt;
This said, where feasible, as much detail as is possible will be provided. For example, all configuration file locations will be shown and functioning sample files will be provided.&lt;br /&gt;
&lt;br /&gt;
== Platform ==&lt;br /&gt;
&lt;br /&gt;
This paper will implement the [[Red Hat]] Cluster Suite using the Fedora v13 distribution. This paper uses the [[x86_64]] repositories, however, if you are on an [[i386]] (32 bit) system, you should be able to follow along fine. Simply replace &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;x86_64&amp;lt;/span&amp;gt; with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;i386&amp;lt;/span&amp;gt; or &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;i686&amp;lt;/span&amp;gt; in package names. &lt;br /&gt;
&lt;br /&gt;
You can either download the stock Fedora 13 DVD ISO, or you can try out the alpha [[#AN!Cluster Install|AN!Cluster Install]] DVD. (4.3GB iso). If you use the latter, please test it out on a development or test cluster. If you have any problems with the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;AN!Cluster&amp;lt;/span&amp;gt; variant Fedora distro, please [[Digimer|contact me]] and let me know what your trouble was.&lt;br /&gt;
&lt;br /&gt;
== Why Fedora 13? ==&lt;br /&gt;
&lt;br /&gt;
Generally speaking, I much prefer to use a server-oriented Linux distribution like [[CentOS]], [[Debian]] or similar. However, there have been many recent changes in the Linux-Clustering world that have made all of the currently available server-class distributions obsolete. With luck, once [[Red Hat]] Enterprise Linux and [[CentOS]] version 6 is released, this will change.&lt;br /&gt;
&lt;br /&gt;
Until then, [[Fedora]] version 13 provides the most up to date binary releases of the new implementation of the clustering stack available. For this reason, FC13 is the best choice in clustering, if you want to be current. To mitigate some of the issues introduced by using a workstation distribution, many packages will be stripped out of the default install.&lt;br /&gt;
&lt;br /&gt;
== Focus ==&lt;br /&gt;
&lt;br /&gt;
Clusters can serve to solve three problems; &#039;&#039;&#039;Reliability&#039;&#039;&#039;, &#039;&#039;&#039;Performance&#039;&#039;&#039; and &#039;&#039;&#039;Scalability&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
This focus of the cluster described in this paper is primarily &#039;&#039;&#039;reliability&#039;&#039;&#039;. Second to this, &#039;&#039;&#039;scalability&#039;&#039;&#039; will be the priority leaving &#039;&#039;&#039;performance&#039;&#039;&#039; to be addressed only when it does not impact the first two criteria. This is not to indicate that performance is not a valid priority, it simply isn&#039;t the priority of this paper.&lt;br /&gt;
&lt;br /&gt;
== Goal ==&lt;br /&gt;
&lt;br /&gt;
At the end of this paper, you should have a fully functioning two-node array capable of hosting a &amp;quot;floating&amp;quot; resources. That is, resources that exist on one node and can be easily moved to the other node with minimal effort and down time. This should conclude with a solid foundation for adding more virtual servers up to the limit of your cluster&#039;s resources.&lt;br /&gt;
&lt;br /&gt;
This paper should also serve to show how to build the foundation of any other cluster configuration. This paper has a core focus of introducing the main issues that come with clustering and hopes to serve as a foundation for any cluster configuration outside the scope of this paper.&lt;br /&gt;
&lt;br /&gt;
= Begin = &lt;br /&gt;
&lt;br /&gt;
Let&#039;s begin!&lt;br /&gt;
&lt;br /&gt;
== Hardware ==&lt;br /&gt;
&lt;br /&gt;
We will need two physical servers each with the following hardware:&lt;br /&gt;
* One or more multi-core [[CPU]]s with Virtualization support.&lt;br /&gt;
* Three network cards; At least one should be gigabit or faster.&lt;br /&gt;
* One or more hard drives.&lt;br /&gt;
* You will need some form of a [[fence|fence device]]. This can be an [[IPMI]]-enabled server, a [http://nodeassassin.org Node Assassin], a fenceable [http://www.apc.com/products/resource/include/techspec_index.cfm?base_sku=AP7900&amp;amp;tab=features PDU] or similar.&lt;br /&gt;
&lt;br /&gt;
This paper uses the following hardware:&lt;br /&gt;
* ASUS [http://support.asus.com/search/search.aspx?keyword=m4a78l-m&amp;amp;SLanguage=en-us M4A78L-M]&lt;br /&gt;
* AMD Athlon II x2 250 &lt;br /&gt;
* 2GB Kingston DDR2 KVR800D2N6K2/4G (4GB kit split between the two nodes)&lt;br /&gt;
* 1x Intel 82540 PCI NICs&lt;br /&gt;
* 1x D-Link DGE-560T&lt;br /&gt;
* Node Assassin&lt;br /&gt;
&lt;br /&gt;
This is not an endorsement of the above hardware. I bought what was within my budget that would serve the purposes of creating this document. What you purchase shouldn&#039;t matter, so long as the minimum requirements are met.&lt;br /&gt;
&lt;br /&gt;
== Pre-Assembly ==&lt;br /&gt;
&lt;br /&gt;
With multiple NICs, it is quite likely that the mapping of physical devices to logical &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ethX&amp;lt;/span&amp;gt; devices may not be ideal. This is a particular issue if you decide to [[Setting Up a PXE Server in Fedora|network boot]] your install media. In that case, if the wrong NIC is chosen for &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth0&amp;lt;/span&amp;gt;, you will be presented with a list of MAC addresses to attempt setup with.&lt;br /&gt;
&lt;br /&gt;
Before you assemble your servers, record their network cards&#039; [[MAC]] addresses. I like to keep simple text files like these:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cat an-node01.mac&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
90:E6:BA:71:82:EA	eth0	# Realtek Semiconductor Co., Ltd. RTL8111/8168B PCI Express Gigabit Ethernet controller&lt;br /&gt;
00:21:91:19:96:53	eth1	# D-Link System Inc DGE-560T PCI Express Gigabit Ethernet Adapter&lt;br /&gt;
00:0E:0C:59:46:E4	eth2	# Intel Corporation 82540EM Gigabit Ethernet Controller&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cat an-node02.mac&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
90:E6:BA:71:82:D8	eth0	# Realtek Semiconductor Co., Ltd. RTL8111/8168B PCI Express Gigabit Ethernet controller&lt;br /&gt;
00:21:91:19:96:5A	eth1	# D-Link System Inc DGE-560T PCI Express Gigabit Ethernet Adapter&lt;br /&gt;
00:0E:0C:59:45:78	eth2	# Intel Corporation 82540EM Gigabit Ethernet Controller&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Feel free to record the information in any way that suits you the best.&lt;br /&gt;
&lt;br /&gt;
== OS Install ==&lt;br /&gt;
&lt;br /&gt;
Start with a stock Fedora 13 install. This How-To uses Fedora 13 x86_64, however it should be fairly easy to adapt to other recent Fedora versions. This document is also attempting to be easily ported to [[CentOS]]/[[RHEL]] version 6 once it is released. This will not adapt well to CentOS/RHEL version 5 though... Much of the cluster stack has changed dramatically since it was initially released.&lt;br /&gt;
&lt;br /&gt;
These are sample kickstart script used by this paper. Be sure to set your own password string and network settings.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Warning&#039;&#039;&#039;&#039;&#039;! These kickstart scripts &#039;&#039;&#039;&#039;&#039;will erase your hard drive&#039;&#039;&#039;&#039;&#039;! Adapt them, don&#039;t blindly use them.&lt;br /&gt;
&lt;br /&gt;
Generic cluster node kickstart scripts.&lt;br /&gt;
* [[Fedora13 KS an-node01.ks|an-node01.ks]]&lt;br /&gt;
* [[Fedora13 KS an-node02.ks|an-node02.ks]]&lt;br /&gt;
&lt;br /&gt;
== AN!Cluster Install ==&lt;br /&gt;
&lt;br /&gt;
If you are feeling brave, below is a link to a custom install DVD that contains the kickstart scripts to setup nodes and an &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-cluster&amp;lt;/span&amp;gt; directory with all the configuration files.&lt;br /&gt;
&lt;br /&gt;
* Download the custom &#039;&#039;&#039;AN!Cluster v0.2.001&#039;&#039;&#039; Install DVD. (4.5[[GiB]] iso). (Currently disabled - Reworking for F13)&lt;br /&gt;
&lt;br /&gt;
== Post OS Install ==&lt;br /&gt;
&lt;br /&gt;
Once the OS is installed, we need to do a couple things; &lt;br /&gt;
&lt;br /&gt;
# Disable &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;selinux&amp;lt;/span&amp;gt;&lt;br /&gt;
# Setup networking.&lt;br /&gt;
# Change the default run-level.&lt;br /&gt;
&lt;br /&gt;
=== Disable &#039;selinux&#039; ===&lt;br /&gt;
&lt;br /&gt;
To allow this paper to focus on clustering, we will disable &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;selinux&amp;lt;/span&amp;gt;. Obviously, this introduces security issues that you may not be comfortable with. If you wish to leave &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;selinux&amp;lt;/span&amp;gt; enabled, it will be up to you to sort out issues that crop up.&lt;br /&gt;
&lt;br /&gt;
To disable &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;selinux&amp;lt;/span&amp;gt;, edit &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/selinux/config&amp;lt;/span&amp;gt; and change &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;SELINUX=enforcing&amp;lt;/span&amp;gt; to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;SELINUX=permissive&amp;lt;/span&amp;gt;. You will need to reboot in order for the changes to take effect.&lt;br /&gt;
&lt;br /&gt;
=== Change the Default Run-Level ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;This is an optional step&#039;&#039;&#039;. It improves performance only, it is not a required step.&lt;br /&gt;
&lt;br /&gt;
If you don&#039;t plan to work on your nodes directly, it makes sense to switch the default run level from &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;5&amp;lt;/span&amp;gt; to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;3&amp;lt;/span&amp;gt;. This prevents the window manager, like Gnome or KDE, from starting at boot. This frees up a fair of memory and system resources and reduces the possible attack vectors.&lt;br /&gt;
&lt;br /&gt;
To do this, edit &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/inittab&amp;lt;/span&amp;gt;, change the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;id:5:initdefault:&amp;lt;/span&amp;gt; line to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;id:3:initdefault:&amp;lt;/span&amp;gt; and then switch to run level 3:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/inittab&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
id:3:initdefault:&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
init 3&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Setup Networking ===&lt;br /&gt;
&lt;br /&gt;
We need to remove &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;NetworkManager&amp;lt;/span&amp;gt;, enable &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;network&amp;lt;/span&amp;gt;, configure the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ifcfg-eth*&amp;lt;/span&amp;gt; files and then start the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;network&amp;lt;/span&amp;gt; daemon.&lt;br /&gt;
&lt;br /&gt;
==== Managed Switch Warning ====&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;WARNING&#039;&#039;&#039;: Please pay attention to this warning. The vast majority of cluster problems end up being network related. The hardest ones to diagnose are usually multicast issues.&lt;br /&gt;
&lt;br /&gt;
If you use a managed switch, be careful about enabling [[Multicast IGMP Snooping]] or [[Spanning Tree Protocol]]! They have been known to cause problems by not allowing multicast packets to reach all nodes. This can cause somewhat random break-downs in communication between your nodes, leading to fences and DLM lock timeouts.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Ensure the [[PIM Routing]] is setup and working.&lt;br /&gt;
&lt;br /&gt;
If you have problems with your cluster not forming, or seemingly random fencing, try using an unmanaged switch or use a cross-over cable. If the problem goes away, you are most likely dealing with a managed switch configuration problem.&lt;br /&gt;
&lt;br /&gt;
==== Network Layout ====&lt;br /&gt;
&lt;br /&gt;
This setup expects you to have three physical network cards connected to three independent networks. To have a common vernacular, lets use this table to describe them:&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
!class=&amp;quot;cell_all&amp;quot;|Network Description&lt;br /&gt;
!class=&amp;quot;cell_tbr&amp;quot;|Short Name&lt;br /&gt;
!class=&amp;quot;cell_tbr&amp;quot;|Device Name&lt;br /&gt;
!class=&amp;quot;cell_tbr&amp;quot;|Suggested Subnet&lt;br /&gt;
!class=&amp;quot;cell_tbr&amp;quot;|NIC Properties&lt;br /&gt;
|-&lt;br /&gt;
|class=&amp;quot;cell_blr&amp;quot;|Back-Channel Network&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;BCN&amp;lt;/span&amp;gt;&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth0&amp;lt;/span&amp;gt;&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;192.168.1.0/24&amp;lt;/span&amp;gt;&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|NICs with [[IPMI]] piggy-back &#039;&#039;&#039;must&#039;&#039;&#039; be used here.&amp;lt;br /&amp;gt;Second-fastest NIC should be used here.&lt;br /&gt;
|-&lt;br /&gt;
|class=&amp;quot;cell_blr&amp;quot;|Storage Network&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;SN&amp;lt;/span&amp;gt;&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth1&amp;lt;/span&amp;gt;&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;192.168.2.0/24&amp;lt;/span&amp;gt;&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|Fastest NIC should be used here.&lt;br /&gt;
|-&lt;br /&gt;
|class=&amp;quot;cell_blr&amp;quot;|Internet-Facing Network&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;IFN&amp;lt;/span&amp;gt;&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth2&amp;lt;/span&amp;gt;&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;192.168.3.0/24&amp;lt;/span&amp;gt;&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|Remaining NIC should be used here.&amp;lt;br /&amp;gt;If using a [[Setting Up a PXE Server in Fedora|PXE server]], this should be a bootable NIC.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Take note of these concerns when planning which NIC to use on each subnet. These issues are presented in the order that they must be addressed in:&lt;br /&gt;
# If your nodes have [[IPMI]] piggy-backing on a normal NIC, that NIC &#039;&#039;&#039;&#039;&#039;must&#039;&#039;&#039;&#039;&#039; be used on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;BCN&amp;lt;/span&amp;gt; subnet. Having your fence device accessible on a subnet that can be remotely accessed can pose a &#039;&#039;major&#039;&#039; security risk.&lt;br /&gt;
# The fastest NIC should be used for your &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;SN&amp;lt;/span&amp;gt; subnet. Be sure to know which NICs support the largest jumbo frames when considering this.&lt;br /&gt;
# If you still have two NICs to choose from, use the fastest remaining NIC for your &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;BCN&amp;lt;/span&amp;gt; subnet. This will minimize the time it takes to perform tasks like hot-migration of live virtual machines.&lt;br /&gt;
# The final NIC should be used for the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;IFN&amp;lt;/span&amp;gt; subnet.&lt;br /&gt;
&lt;br /&gt;
==== Node IP Addresses ====&lt;br /&gt;
&lt;br /&gt;
Obviously, the IP addresses you give to your nodes should be ones that suit you best. In this example, the following IP addresses are used:&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;amp;nbsp;&lt;br /&gt;
|class=&amp;quot;cell_tbr&amp;quot;|&#039;&#039;&#039;Internet-Facing Network&#039;&#039;&#039; (&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;IFN&amp;lt;/span&amp;gt;)&lt;br /&gt;
|class=&amp;quot;cell_tbr&amp;quot;|&#039;&#039;&#039;Storage Network&#039;&#039;&#039; (&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;SN&amp;lt;/span&amp;gt;)&lt;br /&gt;
|class=&amp;quot;cell_tbr&amp;quot;|&#039;&#039;&#039;Back-Channel Network&#039;&#039;&#039; (&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;BCN&amp;lt;/span&amp;gt;)&lt;br /&gt;
|-&lt;br /&gt;
|class=&amp;quot;cell_blr&amp;quot;|&#039;&#039;&#039;an-node01&#039;&#039;&#039;&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;192.168.1.71&amp;lt;/span&amp;gt;&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;192.168.2.71&amp;lt;/span&amp;gt;&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;192.168.3.71&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|class=&amp;quot;cell_blr&amp;quot;|&#039;&#039;&#039;an-node02&#039;&#039;&#039;&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;192.168.1.72&amp;lt;/span&amp;gt;&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;192.168.2.72&amp;lt;/span&amp;gt;&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;192.168.3.72&amp;lt;/span&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Remove NetworkManager ====&lt;br /&gt;
&lt;br /&gt;
Some cluster software &#039;&#039;&#039;will not&#039;&#039;&#039; start with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;NetworkManager&amp;lt;/span&amp;gt; installed. This is because it is designed to be a highly-adaptive network system that can accommodate frequent changes in the network. To simplify these network transitions for end-users, a lot of reconfiguration of the network is done behind the scenes. &lt;br /&gt;
&lt;br /&gt;
For workstations, this is wonderful. For clustering, this can be disastrous. Transient network outages are already a risk to a cluster&#039;s stability!&lt;br /&gt;
&lt;br /&gt;
So first up, make sure that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;NetworkManager&amp;lt;/span&amp;gt; is completely removed from your system. If you used the [[#OS Install|kickstart]] scripts, then it was not installed. Otherwise, run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum remove NetworkManager NetworkManager-gnome NetworkManager-openconnect NetworkManager-openvpn NetworkManager-pptp NetworkManager-vpnc cnetworkmanager knetworkmanager knetworkmanager-openvpn knetworkmanager-pptp knetworkmanager-vpnc libproxy-networkmanager yum-NetworkManager-dispatcher&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Setup &#039;network&#039; ====&lt;br /&gt;
&lt;br /&gt;
Before proceeding with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;network&amp;lt;/span&amp;gt; configuration, check to see if your network cards are aligned to the proper &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ethX&amp;lt;/span&amp;gt; network names. If they need to be adjusted, please follow this How-To before proceeding:&lt;br /&gt;
&lt;br /&gt;
* [[Changing the ethX to Ethernet Device Mapping in Fedora]]&lt;br /&gt;
&lt;br /&gt;
There are a few ways to configure &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;network&amp;lt;/span&amp;gt; in Fedora:&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;system-config-network&amp;lt;/span&amp;gt; (graphical)&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;system-config-network-tui&amp;lt;/span&amp;gt; (ncurses)&lt;br /&gt;
* Directly editing the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/sysconfig/network-scripts/ifcfg-eth*&amp;lt;/span&amp;gt; files. (See: [http://docs.fedoraproject.org/en-US/Fedora/12/html/Deployment_Guide/s1-networkscripts-interfaces.html here] for a full list of options)&lt;br /&gt;
&lt;br /&gt;
Do not proceed until your node&#039;s networking is fully configured.&lt;br /&gt;
&lt;br /&gt;
==== Update the Hosts File ====&lt;br /&gt;
&lt;br /&gt;
Some applications expect to be able to call nodes by their name. To accommodate this, and to ensure that inter-node communication takes place on the back-channel subnet, we remove any existing hostname entries and then add the following to the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/hosts&amp;lt;/span&amp;gt; file:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: Any pre-existing entries matching the name returned by &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;uname -n&amp;lt;/span&amp;gt; must be removed from &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/hosts&amp;lt;/span&amp;gt;. There is a good chance there will be an entry that resolves to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;127.0.0.1&amp;lt;/span&amp;gt; which would cause problems later.&lt;br /&gt;
&lt;br /&gt;
Obviously, adapt the names and IPs to match your nodes and subnets. The only critical thing is to make sure that the name returned by &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;uname -n&amp;lt;/span&amp;gt; is resolvable to the back-channel subnet. I like to add a short-form name for convenience.&lt;br /&gt;
&lt;br /&gt;
The updated &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/hosts&amp;lt;/span&amp;gt; file should look something like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/hosts&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4&lt;br /&gt;
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6&lt;br /&gt;
&lt;br /&gt;
# Internet Facing Network&lt;br /&gt;
192.168.1.71    an-node01 an-node01.alteeve.com an-node01.bcn&lt;br /&gt;
192.168.1.72    an-node02 an-node02.alteeve.com an-node02.bcn&lt;br /&gt;
&lt;br /&gt;
# Storage Network&lt;br /&gt;
192.168.2.71    an-node01.sn&lt;br /&gt;
192.168.2.72    an-node02.sn&lt;br /&gt;
&lt;br /&gt;
# Back Channel Network&lt;br /&gt;
192.168.3.71    an-node01.ifn&lt;br /&gt;
192.168.3.72    an-node02.ifn&lt;br /&gt;
&lt;br /&gt;
# Node Assassins&lt;br /&gt;
192.168.3.61    batou batou.alteeve.com&lt;br /&gt;
192.168.3.62    motoko motoko.alteeve.com&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: I use Node Assassins. If you use IPMI or other fence devices, alter the entries as appropriate.&lt;br /&gt;
&lt;br /&gt;
Now to test this, ping both nodes by their name, as returned by &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;uname -n&amp;lt;/span&amp;gt;, and make sure the ping packets are sent on the back channel network (&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;192.168.1.0/24&amp;lt;/span&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ping -c 5 an-node01.alteeve.com&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
PING an-node01 (192.168.1.71) 56(84) bytes of data.&lt;br /&gt;
64 bytes from an-node01 (192.168.1.71): icmp_seq=1 ttl=64 time=0.399 ms&lt;br /&gt;
64 bytes from an-node01 (192.168.1.71): icmp_seq=2 ttl=64 time=0.403 ms&lt;br /&gt;
64 bytes from an-node01 (192.168.1.71): icmp_seq=3 ttl=64 time=0.413 ms&lt;br /&gt;
64 bytes from an-node01 (192.168.1.71): icmp_seq=4 ttl=64 time=0.365 ms&lt;br /&gt;
64 bytes from an-node01 (192.168.1.71): icmp_seq=5 ttl=64 time=0.428 ms&lt;br /&gt;
&lt;br /&gt;
--- an-node01 ping statistics ---&lt;br /&gt;
5 packets transmitted, 5 received, 0% packet loss, time 4001ms&lt;br /&gt;
rtt min/avg/max/mdev = 0.365/0.401/0.428/0.030 ms&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ping -c 5 an-node02.alteeve.com&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
PING an-node02 (192.168.1.72) 56(84) bytes of data.&lt;br /&gt;
64 bytes from an-node02 (192.168.1.72): icmp_seq=1 ttl=64 time=0.419 ms&lt;br /&gt;
64 bytes from an-node02 (192.168.1.72): icmp_seq=2 ttl=64 time=0.405 ms&lt;br /&gt;
64 bytes from an-node02 (192.168.1.72): icmp_seq=3 ttl=64 time=0.416 ms&lt;br /&gt;
64 bytes from an-node02 (192.168.1.72): icmp_seq=4 ttl=64 time=0.373 ms&lt;br /&gt;
64 bytes from an-node02 (192.168.1.72): icmp_seq=5 ttl=64 time=0.396 ms&lt;br /&gt;
&lt;br /&gt;
--- an-node02 ping statistics ---&lt;br /&gt;
5 packets transmitted, 5 received, 0% packet loss, time 4001ms&lt;br /&gt;
rtt min/avg/max/mdev = 0.373/0.401/0.419/0.030 ms&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Be sure that, if your [[fence]] device uses a name, that you include entries to resolve it as well. You can see how I&#039;ve done this with the two [[Node Assassin]] devices I use. The same applies to [[IPMI]] or other devices, if you plan to reference them by name. &lt;br /&gt;
&lt;br /&gt;
Fencing will be discussed in more detail later on in this HowTo.&lt;br /&gt;
&lt;br /&gt;
==== Disable Firewalls ====&lt;br /&gt;
&lt;br /&gt;
Be sure to flush netfilter tables and disable &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;iptables&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ip6tables&amp;lt;/span&amp;gt; from starting on our nodes.&lt;br /&gt;
&lt;br /&gt;
There will be enough potential sources of problem as it is. Disabling firewalls at this stage will minimize the chance of an errant &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;iptables&amp;lt;/span&amp;gt; rule messing up our configuration. If, before launch, you wish to implement a firewall, feel free to do so but be sure to thoroughly test your cluster to ensure no problems were introduced.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
chkconfig --level 2345 iptables off&lt;br /&gt;
/etc/init.d/iptables stop&lt;br /&gt;
chkconfig --level 2345 ip6tables off&lt;br /&gt;
/etc/init.d/ip6tables stop&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Setup SSH Shared Keys ====&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;This is an optional step&#039;&#039;&#039;. Setting up shared keys will allow your nodes to pass files between one another and execute commands remotely without needing to enter a password. This is obviously somewhat risky from a security point of view. As such, it is up to you whether you do this or not. This is not meant to be a security-focused How-To, so please independently study the risks.&lt;br /&gt;
&lt;br /&gt;
If you&#039;re a little new to [[SSH]], it can be a bit confusing keeping connections straight in you head. When you connect to a remote machine, you start the connection on your machine as the user you are logged in as. This is the source user. When you call the remote machine, you tell the machine what user you want to log in as. This is the remote user.&lt;br /&gt;
&lt;br /&gt;
You will need to create an SSH key for each source user, and then you will need to copy the newly generated public key to each remote machine&#039;s user directory that you want to connect to. In this example, we want to connect to either node, from either node, as the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;root&amp;lt;/span&amp;gt; user. So we will create a key for each node&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;root&amp;lt;/span&amp;gt; user and then copy the generated public key to the &#039;&#039;other&#039;&#039; node&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;root&amp;lt;/span&amp;gt; user&#039;s directory.&lt;br /&gt;
&lt;br /&gt;
For each user, on each machine you want to connect &#039;&#039;&#039;from&#039;&#039;&#039;, run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# The &#039;2047&#039; is just to screw with brute-forces a bit. :)&lt;br /&gt;
ssh-keygen -t rsa -N &amp;quot;&amp;quot; -b 2047 -f ~/.ssh/id_rsa&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Generating public/private rsa key pair.&lt;br /&gt;
Your identification has been saved in /root/.ssh/id_rsa.&lt;br /&gt;
Your public key has been saved in /root/.ssh/id_rsa.pub.&lt;br /&gt;
The key fingerprint is:&lt;br /&gt;
08:d8:ed:72:38:61:c5:0e:cf:bf:dc:28:e5:3c:a7:88 root@an-node01.alteeve.com&lt;br /&gt;
The key&#039;s randomart image is:&lt;br /&gt;
+--[ RSA 2047]----+&lt;br /&gt;
|     ..          |&lt;br /&gt;
|   o.o.          |&lt;br /&gt;
|  . ==.          |&lt;br /&gt;
|   . =+.         |&lt;br /&gt;
|    + +.S        |&lt;br /&gt;
|     +  o        |&lt;br /&gt;
|       = +       |&lt;br /&gt;
|     ...B o      |&lt;br /&gt;
|    E ...+       |&lt;br /&gt;
+-----------------+&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will create two files: the private key called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;~/.ssh/id_dsa&amp;lt;/span&amp;gt; and the public key called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;~/.ssh/id_dsa.pub&amp;lt;/span&amp;gt;. The private &#039;&#039;&#039;&#039;&#039;must never&#039;&#039;&#039;&#039;&#039; be group or world readable! That is, it should be set to mode &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;0600&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The two files should look like:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Private key&#039;&#039;&#039;:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cat ~/.ssh/id_rsa&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
-----BEGIN RSA PRIVATE KEY-----&lt;br /&gt;
MIIEoQIBAAKCAQBlL42DC+NJVpJ0rdrWQ1rxGEbPrDoe8j8+RQx3QYiB014R7jY5&lt;br /&gt;
EaTenThxG/cudgbLluFxq6Merfl9Tq2It3k9Koq9nV9ZC/vXBcl4MC7pGSQaUw2h&lt;br /&gt;
DVwI7OCSWtnS+awR/1d93tANXRwy7K5ic1pcviJeN66dPuuPqJEF/SKE7yEBapMq&lt;br /&gt;
sN28G4IiLdimsV+UYXPQLOiMy5stmyGhFhQGH3kxYzJPOgiwZEFPZyXinGVoV+qa&lt;br /&gt;
9ERSjSKAL+g21zbYB/XFK9jLNSJqDIPa//wz0T+73agZ0zNlxygmXcJvapEsFGDG&lt;br /&gt;
O6tcy/3XlatSxjEZvvfdOnC310gJVp0bcyWDAgMBAAECggEAMZd0y91vr+n2Laln&lt;br /&gt;
r8ujLravPekzMyeXR3Wf/nLn7HkjibYubRnwrApyNz11kBfYjL+ODqAIemjZ9kgx&lt;br /&gt;
VOhXS1smVHhk2se8zk3PyFAVLblcsGo0K9LYYKd4CULtrzEe3FNBFje10FbqEytc&lt;br /&gt;
7HOMvheR0IuJ0Reda/M54K2H1Y6VemtMbT+aTcgxOSOgflkjCTAeeOajqP5r0TRg&lt;br /&gt;
1tY6/k46hLiBka9Oaj+QHHoWp+aQkb+ReHUBcUihnz3jcw2u8HYrQIO4+v4Ud2kr&lt;br /&gt;
C9QHPW907ykQTMAzhMvZ3DIOcqTzA0r857ps6FANTM87tqpse5h2KfdIjc0Ok/AY&lt;br /&gt;
eKgYAQKBgQDm/P0RygIJl6szVhOb5EsQU0sBUoMT3oZKmPcjHSsyVFPuEDoq1FG7&lt;br /&gt;
uZYMESkVVSYKvv5hTkRuVOqNE/EKtk5bwu4mM0S3qJo99cLREKB6zNdBp9z2ACDn&lt;br /&gt;
0XIIFIalXAPwYpoFYi1YfG8tFfSDvinLI6JLDT003N47qW1cC5rmgQKBgHAkbfX9&lt;br /&gt;
8u3LiT8JqCf1I+xoBTwH64grq/7HQ+PmwRqId+HyyDCm9Y/mkAW1hYQB+cL4y3OO&lt;br /&gt;
kGL60CZJ4eFiTYrSfmVa0lTbAlEfcORK/HXZkLRRW03iuwdAbZ7DIMzTvY2HgFlU&lt;br /&gt;
L1CfemtmzEC4E6t5/nA4Ytk9kPSlzbzxfXIDAoGAY/WtaqpZ0V7iRpgEal0UIt94&lt;br /&gt;
wPy9HrcYtGWX5Yk07VXS8F3zXh99s1hv148BkWrEyLe4i9F8CacTzbOIh1M3e7xS&lt;br /&gt;
pRNgtH3xKckV4rVoTVwh9xa2p3qMwuU/jMGdNygnyDpTXusKppVK417x7qU3nuIv&lt;br /&gt;
1HzJNPwz6+u5GLEo+oECgYAs++AEKj81dkzytXv3s1UasstOvlqTv/j5dZNdKyZQ&lt;br /&gt;
72cvgsUdBwxAEhu5vov1XRmERWrPSuPOYI/4m/B5CYbTZgZ/v8PZeBTg17zgRtgo&lt;br /&gt;
qgJq4qu+fXHKweR3KAzTPSivSiiJLMTiEWb5CD5sw6pYQdJ3z5aPUCwChzQVU8Wf&lt;br /&gt;
YwKBgQCvoYG7gwx/KGn5zm5tDpeWb3GBJdCeZDaj1ulcnHR0wcuBlxkw/TcIadZ3&lt;br /&gt;
kqIHlkjll5qk5EiNGNlnpHjEU9X67OKk211QDiNkg3KAIDMKBltE2AHe8DhFsV8a&lt;br /&gt;
Mc/t6vHYZ632hZ7b0WNuudB4GHJShOumXD+NfJgzxqKJyfGkpQ==&lt;br /&gt;
-----END RSA PRIVATE KEY-----&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Public key&#039;&#039;&#039;:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cat ~/.ssh/id_rsa.pub&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAGUvjYML40lWknSt2tZDWvEYRs+sOh7yPz5FDHdBiIHTXhHuNjkRpN6dOHEb9y52BsuW4XGrox6t+X1OrYi3eT0qir2dX1kL+9cFyXgwLukZJBpTDaENXAjs4JJa2dL5rBH/V33e0A1dHDLsrmJzWly+Il43rp0+64+okQX9IoTvIQFqkyqw3bwbgiIt2KaxX5Rhc9As6IzLmy2bIaEWFAYfeTFjMk86CLBkQU9nJeKcZWhX6pr0RFKNIoAv6DbXNtgH9cUr2Ms1ImoMg9r//DPRP7vdqBnTM2XHKCZdwm9qkSwUYMY7q1zL/deVq1LGMRm+9906cLfXSAlWnRtzJYM= root@an-node01.alteeve.com&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Copy the public key and then &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ssh&amp;lt;/span&amp;gt; normally into the remote machine as the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;root&amp;lt;/span&amp;gt; user. Create a file called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;~/.ssh/authorized_keys&amp;lt;/span&amp;gt; and paste in the key.&lt;br /&gt;
&lt;br /&gt;
From &#039;&#039;&#039;an-node01&#039;&#039;&#039;, type:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ssh root@an-node02&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
The authenticity of host &#039;an-node02 (192.168.1.72)&#039; can&#039;t be established.&lt;br /&gt;
RSA key fingerprint is d4:1b:68:5f:fa:ef:0f:0c:16:e7:f9:0a:8d:69:3e:c5.&lt;br /&gt;
Are you sure you want to continue connecting (yes/no)? yes&lt;br /&gt;
Warning: Permanently added &#039;an-node02,192.168.1.72&#039; (RSA) to the list of known hosts.&lt;br /&gt;
root@an-node02&#039;s password: &lt;br /&gt;
Last login: Fri Oct  1 20:07:01 2010 from 192.168.1.102&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You will now be logged into &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt; as the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;root&amp;lt;/span&amp;gt; user. Create the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;~/.ssh/authorized_keys&amp;lt;/span&amp;gt; file and paste into it the public key from &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;. If the remote machine&#039;s user hasn&#039;t used &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ssh&amp;lt;/span&amp;gt; yet, their &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;~/.ssh&amp;lt;/span&amp;gt; directory will not exist.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cat ~/.ssh/authorized_keys&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAGUvjYML40lWknSt2tZDWvEYRs+sOh7yPz5FDHdBiIHTXhHuNjkRpN6dOHEb9y52BsuW4XGrox6t+X1OrYi3eT0qir2dX1kL+9cFyXgwLukZJBpTDaENXAjs4JJa2dL5rBH/V33e0A1dHDLsrmJzWly+Il43rp0+64+okQX9IoTvIQFqkyqw3bwbgiIt2KaxX5Rhc9As6IzLmy2bIaEWFAYfeTFjMk86CLBkQU9nJeKcZWhX6pr0RFKNIoAv6DbXNtgH9cUr2Ms1ImoMg9r//DPRP7vdqBnTM2XHKCZdwm9qkSwUYMY7q1zL/deVq1LGMRm+9906cLfXSAlWnRtzJYM= root@an-node01.alteeve.com&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now log out and then log back into the remote machine. This time, the connection should succeed without having entered a password!&lt;br /&gt;
&lt;br /&gt;
= Initial Cluster Setup =&lt;br /&gt;
&lt;br /&gt;
Before we get into specifics, let&#039;s take a minute to talk about the major components used in our cluster.&lt;br /&gt;
&lt;br /&gt;
== Core Program Overviews ==&lt;br /&gt;
&lt;br /&gt;
These are the core programs that may be new to you that we will use to build our cluster. Before we configure them, let&#039;s take a minute to understand their roles.&lt;br /&gt;
&lt;br /&gt;
=== Cluster Manager ===&lt;br /&gt;
&lt;br /&gt;
The cluster manager, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt;, takes the configuration file &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[Two-Node Fedora 13 cluster.conf|/etc/cluster/cluster.conf]]&amp;lt;/span&amp;gt; configuration file and uses it to configure and start the various cluster elements. This is where nodes are defined, fence devices are configured and various cluster tolerances are set.&lt;br /&gt;
&lt;br /&gt;
=== Corosync ===&lt;br /&gt;
&lt;br /&gt;
[http://www.corosync.org Corosync] is, essentially, the clustering kernel which provides the essential services for cluster-aware applications and other cluster services. At it&#039;s core is the [[totem]] protocol which provides cluster membership and ordered messaging. On top of this, it implements a number of core clustering services like [[#cpg; Closed Process Group|closed process group messaging]], [[quorum]] and [[confdb]] (an object database).&lt;br /&gt;
&lt;br /&gt;
It&#039;s goal is to provide a substantially simpler and more flexible set of APIs to facilitate clustering in Linux. It manages which nodes are in the cluster, it triggers error messages when something fails, manages cluster locking and so on. Most other clustered applications rely on corosync to know when something has happened or to announce when a cluster-related action has taken place.&lt;br /&gt;
&lt;br /&gt;
Please note that the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;corosync_overview&amp;lt;/span&amp;gt; man page is considered out of date at the time of this writing.&lt;br /&gt;
&lt;br /&gt;
==== cpg; Closed Process Group ====&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: Only install the following if you wish to review the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;man&amp;lt;/span&amp;gt; page.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install corosynclib-devel&lt;br /&gt;
man cpg_overview&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The closed process group is a small process layer on top of the totem protocol provided by corosync. It handles the sending and delivery of messages amongst nodes in a consistent order. It adds [[PID]]s and group names to the membership layer. Only members of the group get the messages, thus it is a &amp;quot;closed&amp;quot; group.&lt;br /&gt;
&lt;br /&gt;
=== OpenAIS ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: We will not use OpenAIS. It is included in here to explain it&#039;s role to folks coming from the Cluster stable 2 environment.&lt;br /&gt;
&lt;br /&gt;
OpenAIS is now an extension to Corosync that adds an open-source implementation of the [http://www.saforum.org/ Service Availability (SA) Forum&#039;s] &#039;Application Interface Specification&#039; ([[AIS]]). It is an [[API]] and policy designed to be used by applications concerned with maintaining services during faults. AIS implements the &#039;Availability Management Framework&#039; ([[AMF]]) which, in turn, provides for application fail over, cluster management ([[CLM]]), Checkpointing ([[CKPT]]), Eventing ([[EVT]]), Messaging ([[MSG]]), and Distributed Locking ([[DLOCK]]).&lt;br /&gt;
&lt;br /&gt;
It does this by implementing pluggable shared libraries that get loaded into corosync at runtime. These libraries then can make use of corosync&#039;s internal API. Both corosync and openais services provide [[IPC]] interfaces so that application programmers can make use of their behaviour. In short; applications can use OpenAIS to be cluster-aware. It&#039;s libraries are used by some applications, including Pacemaker. In our application, we will only be using it&#039;s libraries indirectly.&lt;br /&gt;
&lt;br /&gt;
Please note that the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;openais_overview&amp;lt;/span&amp;gt; man page is considered out of date at the time of this writing.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: Only install the following if you wish to review the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;man&amp;lt;/span&amp;gt; page.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install openais&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Setup Core Programs ==&lt;br /&gt;
&lt;br /&gt;
We now need to edit and create the configuration files for our cluster.&lt;br /&gt;
&lt;br /&gt;
=== Setup cman ===&lt;br /&gt;
&lt;br /&gt;
You may only need to configure this section.&lt;br /&gt;
&lt;br /&gt;
First, install the cluster manager:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum -y install cman&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Setting Up /etc/cluster/cluster.conf ====&lt;br /&gt;
&lt;br /&gt;
Once installed, we need to create and fill in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[Two-Node Fedora 13 cluster.conf|/etc/cluster/cluster.conf]]&amp;lt;/span&amp;gt; file. This is the core configuration file of our cluster and is an [[XML]] formatted file.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Notice&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This is, in many ways, the &amp;quot;core&amp;quot; of your cluster. This section is short, but expect to spend some time getting the right setup for your environment. Please pay careful attention to all options and thoroughly test your configuration before going into production!&lt;br /&gt;
&lt;br /&gt;
* Please see: [[Two-Node Fedora 13 cluster.conf]] for a full explanation on this file and it&#039;s options.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/cluster/cluster.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The example in that article details many of the common options you will want to use. For a more complete list, please run &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;man 5 cluster.conf&amp;lt;/span&amp;gt; for a more complete discussion on this file. Also, please be aware that some arguments can overlap between [[#Setup Corosync|corosync]] and this file.&lt;br /&gt;
&lt;br /&gt;
Here is a real-world example configuration used in the development two-node AN!Cluster. This will likely not work for you, but should act as a good base to adapt and expand on.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;cluster name=&amp;quot;an-cluster&amp;quot; config_version=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;cman two_node=&amp;quot;1&amp;quot; expected_votes=&amp;quot;1&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;totem secauth=&amp;quot;off&amp;quot; rrp_mode=&amp;quot;active&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;clusternodes&amp;gt;&lt;br /&gt;
        &amp;lt;clusternode name=&amp;quot;an-node01.alteeve.com&amp;quot; nodeid=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
            &amp;lt;fence&amp;gt;&lt;br /&gt;
                &amp;lt;method name=&amp;quot;node_assassin&amp;quot;&amp;gt;&lt;br /&gt;
                    &amp;lt;device name=&amp;quot;batou&amp;quot; port=&amp;quot;01&amp;quot; action=&amp;quot;reboot&amp;quot;/&amp;gt;&lt;br /&gt;
                &amp;lt;/method&amp;gt;&lt;br /&gt;
            &amp;lt;/fence&amp;gt;&lt;br /&gt;
        &amp;lt;/clusternode&amp;gt;&lt;br /&gt;
        &amp;lt;clusternode name=&amp;quot;an-node02.alteeve.com&amp;quot; nodeid=&amp;quot;2&amp;quot;&amp;gt;&lt;br /&gt;
            &amp;lt;fence&amp;gt;&lt;br /&gt;
                &amp;lt;method name=&amp;quot;node_assassin&amp;quot;&amp;gt;&lt;br /&gt;
                    &amp;lt;device name=&amp;quot;batou&amp;quot; port=&amp;quot;02&amp;quot; action=&amp;quot;reboot&amp;quot;/&amp;gt;&lt;br /&gt;
                &amp;lt;/method&amp;gt;&lt;br /&gt;
            &amp;lt;/fence&amp;gt;&lt;br /&gt;
        &amp;lt;/clusternode&amp;gt;&lt;br /&gt;
    &amp;lt;/clusternodes&amp;gt;&lt;br /&gt;
    &amp;lt;fencedevices&amp;gt;&lt;br /&gt;
        &amp;lt;fencedevice name=&amp;quot;batou&amp;quot; agent=&amp;quot;fence_na&amp;quot; ipaddr=&amp;quot;batou.alteeve.com&amp;quot; login=&amp;quot;username&amp;quot; passwd=&amp;quot;secret&amp;quot; quiet=&amp;quot;1&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;/fencedevices&amp;gt;&lt;br /&gt;
&amp;lt;/cluster&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once your version of the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cluster.conf&amp;lt;/span&amp;gt; is done, you need to verify it. Be sure to validate it against the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cluster.rng&amp;lt;/span&amp;gt; validation file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
xmllint --relaxng /usr/share/cluster/cluster.rng /etc/cluster/cluster.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If there are errors, fix them. Once it is formatted properly, the contents of you &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cluster.conf&amp;lt;/span&amp;gt; file will be returned followed by &amp;quot;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/cluster/cluster.conf validates&amp;lt;/span&amp;gt;&amp;quot;. Once this is the case, you can move on.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: Normally at this stage, you&#039;d use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;chkconfig&amp;lt;/span&amp;gt; to enable &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt; to start at boot. However, depending on how you use your cluster, you may need to modify the boot order. For now, let&#039;s leave it off until we&#039;re got all the components enabled. This is particularly important if you will be using [[DRBD]], [[CLVM]] or [[Xen]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
chkconfig cman off&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To see if it&#039;s working though, have a terminal open to both nodes and manually start &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt;. I suggest have two terminal windows open on each node. In one, start &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;tail&amp;lt;/span&amp;gt;ing &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/var/log/messages&amp;lt;/span&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
clear; tail -f -n 0 /var/log/messages&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now, with both log files being watched, start &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt; on both nodes.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: You MUST execute the following on both nodes withing the time limit set by &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;post_join_delay&amp;lt;/span&amp;gt; (default is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;6&amp;lt;/span&amp;gt; seconds). If you wait longer than this, the first node started will [[fence]] the other node, assuming you have fencing configured properly. If fencing is &#039;&#039;&#039;not&#039;&#039;&#039; configured properly, your first node will hang.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/cman start&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Examine the log files to verify there were no errors. If there were, fix them. If there was not, fantastic!&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Warning&#039;&#039;&#039;: This last step will forcefully reboot your nodes. Do not do this on a production cluster! If it must be done on a production server, stop all non-essential services and be sure you have a good backup, &#039;&#039;just in case&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Lastly, test that your fencing is configured and working properly. We do this by using a program called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fence_node&amp;lt;/span&amp;gt;. With both nodes up and running &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt;, call a fence against the other node. Be sure to be watching the log files.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;From&#039;&#039;&#039; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01.alteeve.com&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
fence_node an-node02.alteeve.com&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
fence an-node02.alteeve.com success&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If it worked, when the node comes back up, repeat the process from &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02.alteeve.com&amp;lt;/span&amp;gt; against &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01.alteeve.com&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Setup Corosync ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: In our cluster, we will not need to configure Corosync.&lt;br /&gt;
&lt;br /&gt;
When using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt;, as we are here, Corosync&#039;s configuration file is ignored.&lt;br /&gt;
&lt;br /&gt;
Most of the settings available in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[Two-Node Fedora 13 corosync.conf|corosync.conf]]&amp;lt;/span&amp;gt; can be found in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[Two-Node Fedora 13 cluster.conf|cluster.conf]]&amp;lt;/span&amp;gt; file. Please see the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cluster.conf&amp;lt;/span&amp;gt; article for a comprehensive list of what is and is not supported.&lt;br /&gt;
&lt;br /&gt;
If you want to configure corosync and not use cman, please see the following article:&lt;br /&gt;
&lt;br /&gt;
* [[Two-Node Fedora 13 corosync.conf]]&lt;br /&gt;
&lt;br /&gt;
= Fencing =&lt;br /&gt;
&lt;br /&gt;
Before proceeding with the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cluster.conf&amp;lt;/span&amp;gt; file, you must understand what fencing is, how it is used in Red Hat/CentOS clusters and why it is so important.&lt;br /&gt;
&lt;br /&gt;
* The Cluster Admin&#039;s Mantra:&lt;br /&gt;
** &#039;&#039;&#039;The only thing you don&#039;t know is what you don&#039;t know&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Just because one node loses communication with another node, it &#039;&#039;&#039;cannot&#039;&#039;&#039; assume that the silent node is dead!&lt;br /&gt;
&lt;br /&gt;
== What is it? ==&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Fencing&amp;quot; is the act of isolating a malfunctioning node. The goal is to prevent a &#039;&#039;&#039;split-brain&#039;&#039;&#039; condition where two nodes think the other member is dead and continue to use a shared resource. When this happens, file system corruption is almost guaranteed. Another dangerous scenario would be if one node paused while writing to a disk, the other node decides it&#039;s dead and starts to replay the journal, then the first node recovers and completes the write. The results would be equally disastrous. If you are lucky enough to not lose the shared file system, you will be faced with the task of determining what data got written to which node, merging that data and/or overwriting the node you trust the least. This &#039;best case&#039; is still pretty lousy.&lt;br /&gt;
&lt;br /&gt;
Fencing, isolating a node from altering shared disks, can be accomplished in a couple of ways:&lt;br /&gt;
&lt;br /&gt;
* Power&lt;br /&gt;
** Power fencing is where a device is used to cut the power to a malfunctioning node. This is probably the most common type.&lt;br /&gt;
* Blocking&lt;br /&gt;
** Blocking is often implemented at the network level. This type of fencing leaves the node alone, but disconnects it from the storage network. Often this is done by a switch which prevents traffic coming from the fenced node.&lt;br /&gt;
&lt;br /&gt;
Those familiar with heartbeat clusters will know &amp;quot;fencing&amp;quot; by the HA Linux term &amp;quot;STONITH&amp;quot;, literally, &#039;&#039;&#039;S&#039;&#039;&#039;hoot &#039;&#039;&#039;T&#039;&#039;&#039;he &#039;&#039;&#039;O&#039;&#039;&#039;ther &#039;&#039;&#039;N&#039;&#039;&#039;ode &#039;&#039;&#039;I&#039;&#039;&#039;n &#039;&#039;&#039;T&#039;&#039;&#039;he &#039;&#039;&#039;H&#039;&#039;&#039;ead.&lt;br /&gt;
&lt;br /&gt;
== Misconception ==&lt;br /&gt;
&lt;br /&gt;
It is a &#039;&#039;&#039;very&#039;&#039;&#039; common mistake to ignore fencing when first starting to learn about clustering. Often people think &#039;&#039;&amp;quot;It&#039;s just for production systems, I don&#039;t need to worry about it yet because I don&#039;t care what happens to my test cluster.&amp;quot;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Wrong!&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For the most practical reason; the cluster software will block all I/O transactions when it can&#039;t guarantee a fence operation succeeded. The result is that your cluster will essentially &amp;quot;lock up&amp;quot;. Likewise, [[cman]] and related daemons will fail if they can&#039;t find a fence agent to use.&lt;br /&gt;
&lt;br /&gt;
Secondly: testing our cluster will involve inducing errors. Without proper fencing, there is a high probability that our shared file system will be corrupted. That would force the need to start over, making your learning take a lot longer than it needs to.&lt;br /&gt;
&lt;br /&gt;
== Fence Devices ==&lt;br /&gt;
&lt;br /&gt;
Many major [[OEM]]s have their own remote management devices that can serve as fence devices. Examples are [http://dell.ca Dell]&#039;s &#039;DRAC&#039; (Dell Remote Access Controller), [http://hp.ca HP]&#039;s iLO (Integrate Lights Out), [http://ibm.ca IBM]&#039;s &#039;RSA&#039; (Remote Supervisor Adapter), [http://sun.ca Sun]&#039;s &#039;SSP&#039; (System Service Processor) and so on. Smaller manufacturers implement remote management via [[IPMI]], Intelligent Power Management Interface. &lt;br /&gt;
&lt;br /&gt;
In the above devices, fencing is implemented via a build in or integrated device inside the server. These devices are usually accessible even when the host server is powered off or hard locked. Via these devices, the host server can be powered off, reset and powered on remotely, regardless of the state of the host server.&lt;br /&gt;
&lt;br /&gt;
Block fencing is possible when the device connecting a node to shared resources, like a fiber-channel SAN switch, provides a method of logically &amp;quot;unplugging&amp;quot; a defective node from the shared resource, leaving the node itself alone.&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
&lt;br /&gt;
How you implement fencing depends largely on what kind of fence device(s) you have. This is where I need help from you, dear reader. I only have access to [[Node Assassin]] fence devices on my lab&#039;s cluster and [[IPMI]] at work. I will show examples below using these devices. If you have other fence devices, like [[IPMI]], addressable [[PDU]] or so on, please let me know so that I can expand this section.&lt;br /&gt;
&lt;br /&gt;
=== Using Node Assassin To Demonstrate Fencing ===&lt;br /&gt;
&lt;br /&gt;
In Red Hat&#039;s cluster software, the fence device(s) are configured in the main &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/cluster.conf&amp;lt;/span&amp;gt; cluster configuration file. This configuration is then acted on via the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fenced&amp;lt;/span&amp;gt; fence daemon.&lt;br /&gt;
&lt;br /&gt;
When the cluster determines that a node needs to be fenced, the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fenced&amp;lt;/span&amp;gt; daemon will consult the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cluster.conf&amp;lt;/span&amp;gt; file for information on how to access the fence device. Given this &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cluster.conf&amp;lt;/span&amp;gt; snippet:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;cluster name=&amp;quot;an-cluster&amp;quot; config_version=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;clusternodes&amp;gt;&lt;br /&gt;
		&amp;lt;clusternode name=&amp;quot;an-node02.alteeve.com&amp;quot; nodeid=&amp;quot;2&amp;quot;&amp;gt;&lt;br /&gt;
			&amp;lt;fence&amp;gt;&lt;br /&gt;
				&amp;lt;method name=&amp;quot;node_assassin&amp;quot;&amp;gt;&lt;br /&gt;
					&amp;lt;device name=&amp;quot;motoko&amp;quot; port=&amp;quot;02&amp;quot; action=&amp;quot;off&amp;quot;/&amp;gt;&lt;br /&gt;
				&amp;lt;/method&amp;gt;&lt;br /&gt;
			&amp;lt;/fence&amp;gt;&lt;br /&gt;
		&amp;lt;/clusternode&amp;gt;&lt;br /&gt;
	&amp;lt;/clusternodes&amp;gt;&lt;br /&gt;
	&amp;lt;fencedevices&amp;gt;&lt;br /&gt;
		&amp;lt;fencedevice name=&amp;quot;motoko&amp;quot; agent=&amp;quot;fence_na&amp;quot; quiet=&amp;quot;true&amp;quot;&lt;br /&gt;
		ipaddr=&amp;quot;motoko.alteeve.com&amp;quot; login=&amp;quot;motoko&amp;quot; passwd=&amp;quot;secret&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;/fencedevice&amp;gt;&lt;br /&gt;
	&amp;lt;/fencedevices&amp;gt;&lt;br /&gt;
&amp;lt;/cluster&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the cluster manager ([[corosync]], specifically) determines that the node &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02.alteeve.com&amp;lt;/span&amp;gt; needs to be fenced, it looks at the first (and only, in this case) &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;fence&amp;gt;&amp;lt;/span&amp;gt; entry&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;name&amp;lt;/span&amp;gt; which is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;motoko&amp;lt;/span&amp;gt; in this case. It gathers the other variables and then looks in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;fencedevices&amp;gt;&amp;lt;/span&amp;gt; section for the device with the matching &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;name&amp;lt;/span&amp;gt;. With these two sections, it now has all the variable-value pairs needed to pass to the fence agent script set in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;agent&amp;lt;/span&amp;gt; variable.&lt;br /&gt;
&lt;br /&gt;
So in this example, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fenced&amp;lt;/span&amp;gt; looks up the details on the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;motoko&amp;lt;/span&amp;gt; Node Assassin fence device. It calls the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fence_na&amp;lt;/span&amp;gt; program, called a fence agent, and passes the following arguments as a series of lines to the agent via [[STDIN]].&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ipaddr=motoko.alteeve.com&lt;br /&gt;
login=motoko&lt;br /&gt;
passwd=secret&lt;br /&gt;
quiet=true&lt;br /&gt;
port=2&lt;br /&gt;
action=off&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
How the fence agent acts on these arguments varies depending on the fence device itself. To continue using [[Node Assassin]] as an example, the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fence_na&amp;lt;/span&amp;gt; fence agent will create a connection to the device at the IP address (or resolvable name, as in this case) specified in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ipaddr&amp;lt;/span&amp;gt; argument. Once connected, it will authenticate using the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;login&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;passwd&amp;lt;/span&amp;gt; arguments. Once authenticated, it tells the device what &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;port&amp;lt;/span&amp;gt; to act on. Finally, it tells the device what &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;action&amp;lt;/span&amp;gt; to take. Here, the action is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;off&amp;lt;/span&amp;gt; which, internally, translates as hitting the reset switch, then press and hold the power switch long enough to force a power down. As a last step, it checks to see if there is power still coming from the node to determine whether the fence succeeded or not. In other devices, the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;port&amp;lt;/span&amp;gt; could be a power jack, a network switch port and so on. &lt;br /&gt;
&lt;br /&gt;
Once the device completes, it returns a success or failed message in the form of a prescribed exit code. If the first attempt fails, the fence agent will try the next &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;fence&amp;gt;&amp;lt;/span&amp;gt; method, if a second exists. It will keep trying fence devices in the order they are found in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cluster.conf&amp;lt;/span&amp;gt; file until it runs out of devices. If it fails to fence the node, most daemons will &amp;quot;block&amp;quot;, that is, lock up and stop responding until the issue is resolved. The logic for this is that a locked up cluster is better than a corrupted one.&lt;br /&gt;
&lt;br /&gt;
If any of the fence devices succeed though, the cluster will know that it is safe to proceed and will reconfigure the cluster without the defective node.&lt;br /&gt;
&lt;br /&gt;
=== An Example IPMI Configuration ===&lt;br /&gt;
&lt;br /&gt;
[[IPMI]] is perhaps the most common method used for fencing nodes in a cluster. It requires having a system board with an IPMI baseboard management controller (BMC). IPMI is often the underlying technology used by many OEM-branded remote access tools. If you don&#039;t see a specific fence agent for your server&#039;s remote access application, experiment with generic IPMI tools.&lt;br /&gt;
&lt;br /&gt;
Given the ubiquity of IPMI, I&#039;d like to take the time to walk through configuring and implementing IPMI in a cluster.&lt;br /&gt;
&lt;br /&gt;
IPMI is generally configured using tools provided by the manufacturer of your server. Often there is a web interface with a default IP address, user name and password. In many cases though, you can also configure your IPMI device from the command line using user-space tools. The next section will walk you through an example setup of an IPMI device. If you&#039;ve already configure yours though, note the IP addresses, user names and passwords that you assigned and skip down one section.&lt;br /&gt;
&lt;br /&gt;
==== Configuring IPMI From The Command Line ====&lt;br /&gt;
&lt;br /&gt;
To start, we need to install the IPMI user software.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install ipmitool freeipmi.x86_64 freeipmi-bmc-watchdog.x86_64 freeipmi-ipmidetectd.x86_64 OpenIPMI.x86_64 &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once installed, you should be able to check the local IPMI BMC using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ipmitool&amp;lt;/span&amp;gt; once you&#039;re started the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ipmi&amp;lt;/span&amp;gt; daemon.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/ipmi start&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Starting ipmi drivers:                                     [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ipmitool chassis status&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
System Power         : on&lt;br /&gt;
Power Overload       : false&lt;br /&gt;
Power Interlock      : inactive&lt;br /&gt;
Main Power Fault     : false&lt;br /&gt;
Power Control Fault  : false&lt;br /&gt;
Power Restore Policy : always-off&lt;br /&gt;
Last Power Event     : command&lt;br /&gt;
Chassis Intrusion    : inactive&lt;br /&gt;
Front-Panel Lockout  : inactive&lt;br /&gt;
Drive Fault          : false&lt;br /&gt;
Cooling/Fan Fault    : false&lt;br /&gt;
Front Panel Control  : none&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you see that, you&#039;re doing well. You can now check the current configuration using the following command.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ipmitool -I open lan print 1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Set in Progress         : Set Complete&lt;br /&gt;
Auth Type Support       : NONE MD2 MD5 OEM &lt;br /&gt;
Auth Type Enable        : Callback : NONE MD2 MD5 OEM &lt;br /&gt;
                        : User     : NONE MD2 MD5 OEM &lt;br /&gt;
                        : Operator : NONE MD2 MD5 OEM &lt;br /&gt;
                        : Admin    : NONE MD2 MD5 OEM &lt;br /&gt;
                        : OEM      : &lt;br /&gt;
IP Address Source       : Static Address&lt;br /&gt;
IP Address              : 10.255.128.1&lt;br /&gt;
Subnet Mask             : 255.255.0.0&lt;br /&gt;
MAC Address             : 00:e0:81:aa:bb:cc&lt;br /&gt;
SNMP Community String   : AMI&lt;br /&gt;
IP Header               : TTL=0x00 Flags=0x00 Precedence=0x00 TOS=0x00&lt;br /&gt;
BMC ARP Control         : ARP Responses Disabled, Gratuitous ARP Disabled&lt;br /&gt;
Gratituous ARP Intrvl   : 0.0 seconds&lt;br /&gt;
Default Gateway IP      : 192.168.1.1&lt;br /&gt;
Default Gateway MAC     : 00:00:00:00:00:00&lt;br /&gt;
Backup Gateway IP       : 0.0.0.0&lt;br /&gt;
Backup Gateway MAC      : 00:00:00:00:00:00&lt;br /&gt;
802.1q VLAN ID          : Disabled&lt;br /&gt;
802.1q VLAN Priority    : 0&lt;br /&gt;
RMCP+ Cipher Suites     : 1,2,3,6,7,8,11,12,0,0,0,0,0,0,0,0&lt;br /&gt;
Cipher Suite Priv Max   : aaaaXXaaaXXaaXX&lt;br /&gt;
                        :     X=Cipher Suite Unused&lt;br /&gt;
                        :     c=CALLBACK&lt;br /&gt;
                        :     u=USER&lt;br /&gt;
                        :     o=OPERATOR&lt;br /&gt;
                        :     a=ADMIN&lt;br /&gt;
                        :     O=OEM&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can change the MAC address, but this isn&#039;t advised without a good reason to do so without good reason. That said, here is an example set of commands that will configure, save and then check that the settings took. Adapt the values to suit your environment and preferences.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# Don&#039;t change the MAC without a good reason. If you need to though, this should work.&lt;br /&gt;
#ipmitool -I open lan set 1 macaddr 00:e0:81:aa:bb:cd&lt;br /&gt;
&lt;br /&gt;
# Set the IP to be static (instead of DHCP)&lt;br /&gt;
ipmitool -I open lan set 1 ipsrc static&lt;br /&gt;
&lt;br /&gt;
# Set the IP, default gateway and subnet mask address of the IPMI interface.&lt;br /&gt;
ipmitool -I open lan set 1 ipaddr 192.168.1.171&lt;br /&gt;
ipmitool -I open lan set 1 defgw ipaddr 192.168.1.1&lt;br /&gt;
ipmitool -I open lan set 1 netmask 255.255.255.0&lt;br /&gt;
&lt;br /&gt;
# Set the password.&lt;br /&gt;
ipmitool -I open lan set 1 password secret&lt;br /&gt;
ipmitool -I open user set password 2 secret&lt;br /&gt;
&lt;br /&gt;
# Set the snmp community string, if appropriate&lt;br /&gt;
ipmitool -I open lan set 1 snmp alteeve&lt;br /&gt;
&lt;br /&gt;
# Enable access&lt;br /&gt;
ipmitool -I open lan set 1 access on&lt;br /&gt;
&lt;br /&gt;
# Reset the IPMI BMC to make sure the changes took effect.&lt;br /&gt;
ipmitool mc reset cold&lt;br /&gt;
&lt;br /&gt;
# Wait a few seconds and then re-run the call that dumped the setup to ensure&lt;br /&gt;
# it is now what we want.&lt;br /&gt;
sleep 5&lt;br /&gt;
ipmitool -I open lan print 1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If all went well, you should see the same output as above, but now with your new configuration.&lt;br /&gt;
&lt;br /&gt;
==== Testing IPMI ====&lt;br /&gt;
&lt;br /&gt;
If you skipped the previous step and just want the minimal setup that works, you only need to install one package.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install ipmitool&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Regardless of how you configured your IPMI devices, you will want to test now that you can check the power state of your nodes using the IPMI interface.&lt;br /&gt;
&lt;br /&gt;
You can only query the status of the remote node(s) this way. You can&#039;t use the following command to check your local node.&lt;br /&gt;
&lt;br /&gt;
In the example below, we will check the state of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt; from &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt;. Note that here we use the IP address directly, but in practice I like to use a name that resolves to the IP address of the &#039;&#039;&#039;IPMI&#039;&#039;&#039; interface (denoted by a &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;.ipmi&amp;lt;/span&amp;gt; suffix).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ipmitool -I lan -H 192.168.1.171 -U admin -P secret chassis power status&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Chassis Power is on&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You could replace &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;status&amp;lt;/span&amp;gt; with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;on&amp;lt;/span&amp;gt;, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;off&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cycle&amp;lt;/span&amp;gt; to remotely boot, power off and reboot (power cycle) the node. This is, in fact, what the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fence_ipmilan&amp;lt;/span&amp;gt; fence agent does. If you can afford to stop your servers, it&#039;s a good idea to play with the various &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;power&amp;lt;/span&amp;gt; options to see how the work. There are a few more option than what I mentioned here, which you can read about in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;man ipmitool&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Once you have completely tested your IPMI settings, enable the service to start on boot.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
chkconfig ipmi on&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Configuring /etc/cluster.conf ====&lt;br /&gt;
&lt;br /&gt;
Lastly, we need to add the IPMI configuration to our &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[cluster.conf]]&amp;lt;/span&amp;gt; file. Note that, unlike with the [[#Using Node Assassin To Demonstrate Fencing |Node Assassin]] setup, there is no &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;port&amp;lt;/span&amp;gt; value in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;device&amp;lt;/span&amp;gt; tag. This is because there is only device controlled by the IPMI BMC; The node itself. The other change is that there are now two &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;fencedevice ... /&amp;gt;&amp;lt;/span&amp;gt; entries; One for each node&#039;s IPMI device. Finally, pay attention to the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;device name=&amp;quot;...&amp;quot;&amp;lt;/span&amp;gt; field. This is an example of where it matters.&lt;br /&gt;
&lt;br /&gt;
Here is an example... &lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;cluster name=&amp;quot;an-cluster&amp;quot; config_version=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;clusternodes&amp;gt;&lt;br /&gt;
        &amp;lt;clusternode name=&amp;quot;an-node01.alteeve.com&amp;quot; nodeid=&amp;quot;1&amp;quot; votes=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
            &amp;lt;fence&amp;gt;&lt;br /&gt;
                &amp;lt;method name=&amp;quot;ipmi&amp;quot;&amp;gt;&lt;br /&gt;
                    &amp;lt;device name=&amp;quot;fence_an01&amp;quot; action=&amp;quot;reboot&amp;quot; /&amp;gt;&lt;br /&gt;
                &amp;lt;/method&amp;gt;&lt;br /&gt;
            &amp;lt;/fence&amp;gt;&lt;br /&gt;
        &amp;lt;/clusternode&amp;gt;&lt;br /&gt;
        &amp;lt;clusternode name=&amp;quot;an-node02.alteeve.com&amp;quot; nodeid=&amp;quot;2&amp;quot; votes=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
            &amp;lt;fence&amp;gt;&lt;br /&gt;
                &amp;lt;method name=&amp;quot;ipmi&amp;quot;&amp;gt;&lt;br /&gt;
                    &amp;lt;device name=&amp;quot;fence_an02&amp;quot; action=&amp;quot;reboot&amp;quot; /&amp;gt;&lt;br /&gt;
                &amp;lt;/method&amp;gt;&lt;br /&gt;
            &amp;lt;/fence&amp;gt;&lt;br /&gt;
        &amp;lt;/clusternode&amp;gt;&lt;br /&gt;
    &amp;lt;/clusternodes&amp;gt;&lt;br /&gt;
    &amp;lt;fencedevices&amp;gt;&lt;br /&gt;
        &amp;lt;fencedevice name=&amp;quot;fence_an01&amp;quot; agent=&amp;quot;fence_ipmilan&amp;quot; ipaddr=&amp;quot;192.168.3.61&amp;quot; login=&amp;quot;admin&amp;quot; passwd=&amp;quot;secret&amp;quot; /&amp;gt;&lt;br /&gt;
        &amp;lt;fencedevice name=&amp;quot;fence_an02&amp;quot; agent=&amp;quot;fence_ipmilan&amp;quot; ipaddr=&amp;quot;192.168.3.62&amp;quot; login=&amp;quot;admin&amp;quot; passwd=&amp;quot;secret&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;/fencedevices&amp;gt;&lt;br /&gt;
&amp;lt;/cluster&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Node Assassin ===&lt;br /&gt;
&lt;br /&gt;
A cheap alternative is the [[Node Assassin]], an open-hardware, open source fence device. It was built to allow the use of commodity system boards that lacked remote management support found on more expensive, server class hardware.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Full Disclosure&#039;&#039;&#039;: Node Assassin was created by me, with much help from others, for this paper.&lt;br /&gt;
&lt;br /&gt;
= Clean Up =&lt;br /&gt;
&lt;br /&gt;
Some daemons may have been installed or dragged in during the setup of the cluster. Most notable is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;heartbeat&amp;lt;/span&amp;gt; which is not compatible with [[RHCS]]. The following command will disable various daemons from starting at boot. &lt;br /&gt;
&lt;br /&gt;
As for the rest of the daemons below, it is safe to run even when the daemons aren&#039;t installed or have already been removed. Of course, skip the ones you actually want to use. This assumes that the nodes have been built according to this HowTo.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
chkconfig heartbeat off; chkconfig iscsid off; chkconfig iptables off; chkconfig ip6tables off&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= So You Have a Cluster - Now What? =&lt;br /&gt;
&lt;br /&gt;
Building the cluster infrastructure was pretty easy, wasn&#039;t it?&lt;br /&gt;
&lt;br /&gt;
But what will you &#039;&#039;&#039;&#039;&#039;do&#039;&#039;&#039;&#039;&#039; with it?&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;width: 75%; text-align: center; padding: 10px; border-spacing: 15px;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!style=&amp;quot;width: 100%; border: 1px solid #dfdfdf;&amp;quot; colspan=&amp;quot;3&amp;quot;|Choose Your Own &amp;lt;span style=&amp;quot;text-decoration: line-through; color: #7f7f7f;&amp;quot;&amp;gt;Adventure&amp;lt;/span&amp;gt; Cluster&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;width: 33%; border: 1px solid #dfdfdf;&amp;quot;| &amp;amp;nbsp;&lt;br /&gt;
|style=&amp;quot;width: 34%; border: 1px solid #dfdfdf;&amp;quot;| [[Two Node Fedora 13 Cluster - Xen-Based Virtual Machine Host on DRBD+CLVM|Xen-Based Virtual Machine Host on DRBD+CLVM]]&amp;lt;br /&amp;gt;High Availability VM Host&lt;br /&gt;
|style=&amp;quot;width: 33%; border: 1px solid #dfdfdf;&amp;quot;| &amp;amp;nbsp;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Thanks =&lt;br /&gt;
&lt;br /&gt;
* A &#039;&#039;&#039;huge&#039;&#039;&#039; thanks to [http://iplink.net Interlink Connectivity]! They hire me as a contractor and have allowed me to extend these docs while working on their clusters. Development of these How-Tos would be much slower if not for them. If you need hosting or colo services, drop them a line. Their website is a bit out of date though, so disregard the prices. :)&lt;br /&gt;
* To &#039;&#039;&#039;sdake&#039;&#039;&#039; of [http://corosync.org corosync] for helping me sort out the &#039;&#039;&#039;plock&#039;&#039;&#039; component and corosync in general.&lt;br /&gt;
* To &#039;&#039;&#039;Angus Salkeld&#039;&#039;&#039; for helping me nail down the Corosync and OpenAIS differences.&lt;br /&gt;
* To [https://lists.linux-foundation.org/pipermail/openais/2010-February/013922.html HJ Lee] from the OpenAIS list for helping me understand the mechanisms controlling the Redundant Ring Protocol&#039;s failure detection types.&lt;br /&gt;
* To [https://lists.linux-foundation.org/pipermail/openais/2010-February/013925.html Steven Dake] for clarifying the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;to_x&amp;lt;/span&amp;gt; vs. &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;logoutput: x&amp;lt;/span&amp;gt; arguments in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;openais.conf&amp;lt;/span&amp;gt;.&lt;br /&gt;
* To [http://dk.linkedin.com/in/fabbione Fabio Massimo Di Nitto] for helping me get caught up with clustering and VMs.&lt;br /&gt;
&lt;br /&gt;
{{footer}}&lt;/div&gt;</summary>
		<author><name>SRSullivan</name></author>
	</entry>
	<entry>
		<id>https://alteeve.com/w/index.php?title=Abandoned_-_Two_Node_Fedora_13_Cluster&amp;diff=2281</id>
		<title>Abandoned - Two Node Fedora 13 Cluster</title>
		<link rel="alternate" type="text/html" href="https://alteeve.com/w/index.php?title=Abandoned_-_Two_Node_Fedora_13_Cluster&amp;diff=2281"/>
		<updated>2010-10-12T20:09:12Z</updated>

		<summary type="html">&lt;p&gt;SRSullivan: /* Platform */  Removed Erronious reference to CentOS 5.4 Disk Version, Does not apply to Fedora 13.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{howto_header}}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Notice&#039;&#039;&#039;&#039;&#039;, &#039;&#039;&#039;Sep. 08, 2010&#039;&#039;&#039; - &#039;&#039;Draft 1&#039;&#039;: This is the first draft of this HowTo. It has not been peer-reviewed yet, so please proceed with caution and on a test cluster. Any and all feedback is much appreciated.&lt;br /&gt;
&lt;br /&gt;
= Overview =&lt;br /&gt;
&lt;br /&gt;
This paper has one goal;&lt;br /&gt;
&lt;br /&gt;
# How to assemble the simplest cluster possible, a &#039;&#039;&#039;2-Node Cluster&#039;&#039;&#039;, which you can then expand on for your own needs.&lt;br /&gt;
&lt;br /&gt;
With this completed, you can then jump into &amp;quot;step 2&amp;quot; papers that will show various uses of a two node cluster:&lt;br /&gt;
&lt;br /&gt;
# How to create a &amp;quot;floating&amp;quot; virtual machine that can move between the two nodes in the event of a node failure, maximizing up time.&lt;br /&gt;
# How to create simple resources that can move between nodes. Examples will be a simple PostgreSQL database, DHCP, DNS and web servers.&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
&lt;br /&gt;
It is expected that you are already comfortable with the Linux command line, specifically &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[bash]]&amp;lt;/span&amp;gt;, and that you are familiar with general administrative tasks in Red Hat based distributions, specifically [[Fedora]]. You will also need to be comfortable using editors like [[vim]], [[nano]] or similar. This paper uses &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vim&amp;lt;/span&amp;gt; in examples. Simply substitute your favourite editor in it&#039;s place.&lt;br /&gt;
&lt;br /&gt;
You are also expected to be comfortable with networking concepts. You will be expected to understand TCP/IP, [[multicast]], broadcast, subnets and netmasks, routing and other relatively basic networking concepts. Please take the time to become familiar with these concepts before proceeding.&lt;br /&gt;
&lt;br /&gt;
This said, where feasible, as much detail as is possible will be provided. For example, all configuration file locations will be shown and functioning sample files will be provided.&lt;br /&gt;
&lt;br /&gt;
== Platform ==&lt;br /&gt;
&lt;br /&gt;
This paper will implement the [[Red Hat]] Cluster Suite using the Fedora v13 distribution. This paper uses the [[x86_64]] repositories, however, if you are on an [[i386]] (32 bit) system, you should be able to follow along fine. Simply replace &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;x86_64&amp;lt;/span&amp;gt; with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;i386&amp;lt;/span&amp;gt; or &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;i686&amp;lt;/span&amp;gt; in package names. &lt;br /&gt;
&lt;br /&gt;
You can either download the stock Fedora 13 DVD ISO, or you can try out the alpha [[#AN!Cluster Install|AN!Cluster Install]] DVD. (4.3GB iso). If you use the latter, please test it out on a development or test cluster. If you have any problems with the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;AN!Cluster&amp;lt;/span&amp;gt; variant Fedora distro, please [[Digimer|contact me]] and let me know what your trouble was.&lt;br /&gt;
&lt;br /&gt;
== Why Fedora 13? ==&lt;br /&gt;
&lt;br /&gt;
Generally speaking, I much prefer to use a server-oriented Linux distribution like [[CentOS]], [[Debian]] or similar. However, there have been many recent changes in the Linux-Clustering world that have made all of the currently available server-class distributions obsolete. With luck, once [[Red Hat]] Enterprise Linux and [[CentOS]] version 6 is released, this will change.&lt;br /&gt;
&lt;br /&gt;
Until then, [[Fedora]] version 13 provides the most up to date binary releases of the new implementation of the clustering stack available. For this reason, FC13 is the best choice in clustering, if you want to be current. To mitigate some of the issues introduced by using a workstation distribution, many packages will be stripped out of the default install.&lt;br /&gt;
&lt;br /&gt;
== Focus ==&lt;br /&gt;
&lt;br /&gt;
Clusters can serve to solve three problems; &#039;&#039;&#039;Reliability&#039;&#039;&#039;, &#039;&#039;&#039;Performance&#039;&#039;&#039; and &#039;&#039;&#039;Scalability&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
This focus of the cluster described in this paper is primarily &#039;&#039;&#039;reliability&#039;&#039;&#039;. Second to this, &#039;&#039;&#039;scalability&#039;&#039;&#039; will be the priority leaving &#039;&#039;&#039;performance&#039;&#039;&#039; to be addressed only when it does not impact the first two criteria. This is not to indicate that performance is not a valid priority, it simply isn&#039;t the priority of this paper.&lt;br /&gt;
&lt;br /&gt;
== Goal ==&lt;br /&gt;
&lt;br /&gt;
At the end of this paper, you should have a fully functioning two-node array capable of hosting a &amp;quot;floating&amp;quot; resources. That is, resources that exist on one node and can be easily moved to the other node with minimal effort and down time. This should conclude with a solid foundation for adding more virtual servers up to the limit of your cluster&#039;s resources.&lt;br /&gt;
&lt;br /&gt;
This paper should also serve to show how to build the foundation of any other cluster configuration. This paper has a core focus of introducing the main issues that come with clustering and hopes to serve as a foundation for any cluster configuration outside the scope of this paper.&lt;br /&gt;
&lt;br /&gt;
= Begin = &lt;br /&gt;
&lt;br /&gt;
Let&#039;s begin!&lt;br /&gt;
&lt;br /&gt;
== Hardware ==&lt;br /&gt;
&lt;br /&gt;
We will need two physical servers each with the following hardware:&lt;br /&gt;
* One or more multi-core [[CPU]]s with Virtualization support.&lt;br /&gt;
* Three network cards; At least one should be gigabit or faster.&lt;br /&gt;
* One or more hard drives.&lt;br /&gt;
* You will need some form of a [[fence|fence device]]. This can be an [[IPMI]]-enabled server, a [http://nodeassassin.org Node Assassin], a fenceable [http://www.apc.com/products/resource/include/techspec_index.cfm?base_sku=AP7900&amp;amp;tab=features PDU] or similar.&lt;br /&gt;
&lt;br /&gt;
This paper uses the following hardware:&lt;br /&gt;
* ASUS [http://support.asus.com/search/search.aspx?keyword=m4a78l-m&amp;amp;SLanguage=en-us M4A78L-M]&lt;br /&gt;
* AMD Athlon II x2 250 &lt;br /&gt;
* 2GB Kingston DDR2 KVR800D2N6K2/4G (4GB kit split between the two nodes)&lt;br /&gt;
* 1x Intel 82540 PCI NICs&lt;br /&gt;
* 1x D-Link DGE-560T&lt;br /&gt;
* Node Assassin&lt;br /&gt;
&lt;br /&gt;
This is not an endorsement of the above hardware. I bought what was within my budget that would serve the purposes of creating this document. What you purchase shouldn&#039;t matter, so long as the minimum requirements are met.&lt;br /&gt;
&lt;br /&gt;
== Pre-Assembly ==&lt;br /&gt;
&lt;br /&gt;
With multiple NICs, it is quite likely that the mapping of physical devices to logical &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ethX&amp;lt;/span&amp;gt; devices may not be ideal. This is a particular issue if you decide to [[Setting Up a PXE Server in Fedora|network boot]] your install media. In that case, if the wrong NIC is chosen for &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth0&amp;lt;/span&amp;gt;, you will be presented with a list of MAC addresses to attempt setup with.&lt;br /&gt;
&lt;br /&gt;
Before you assemble your servers, record their network cards&#039; [[MAC]] addresses. I like to keep simple text files like these:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cat an-node01.mac&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
90:E6:BA:71:82:EA	eth0	# Realtek Semiconductor Co., Ltd. RTL8111/8168B PCI Express Gigabit Ethernet controller&lt;br /&gt;
00:21:91:19:96:53	eth1	# D-Link System Inc DGE-560T PCI Express Gigabit Ethernet Adapter&lt;br /&gt;
00:0E:0C:59:46:E4	eth2	# Intel Corporation 82540EM Gigabit Ethernet Controller&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cat an-node02.mac&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
90:E6:BA:71:82:D8	eth0	# Realtek Semiconductor Co., Ltd. RTL8111/8168B PCI Express Gigabit Ethernet controller&lt;br /&gt;
00:21:91:19:96:5A	eth1	# D-Link System Inc DGE-560T PCI Express Gigabit Ethernet Adapter&lt;br /&gt;
00:0E:0C:59:45:78	eth2	# Intel Corporation 82540EM Gigabit Ethernet Controller&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Feel free to record the information in any way that suits you the best.&lt;br /&gt;
&lt;br /&gt;
== OS Install ==&lt;br /&gt;
&lt;br /&gt;
Start with a stock Fedora 13 install. This How-To uses Fedora 13 x86_64, however it should be fairly easy to adapt to other recent Fedora versions. This document is also attempting to be easily ported to [[CentOS]]/[[RHEL]] version 6 once it is released. This will not adapt well to CentOS/RHEL version 5 though... Much of the cluster stack has changed dramatically since it was initially released.&lt;br /&gt;
&lt;br /&gt;
These are sample kickstart script used by this paper. Be sure to set your own password string and network settings.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Warning&#039;&#039;&#039;&#039;&#039;! These kickstart scripts &#039;&#039;&#039;&#039;&#039;will erase your hard drive&#039;&#039;&#039;&#039;&#039;! Adapt them, don&#039;t blindly use them.&lt;br /&gt;
&lt;br /&gt;
Generic cluster node kickstart scripts.&lt;br /&gt;
* [[Fedora13 KS an-node01.ks|an-node01.ks]]&lt;br /&gt;
* [[Fedora13 KS an-node02.ks|an-node02.ks]]&lt;br /&gt;
&lt;br /&gt;
== AN!Cluster Install ==&lt;br /&gt;
&lt;br /&gt;
If you are feeling brave, below is a link to a custom install DVD that contains the kickstart scripts to setup nodes and an &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-cluster&amp;lt;/span&amp;gt; directory with all the configuration files.&lt;br /&gt;
&lt;br /&gt;
* Download the custom &#039;&#039;&#039;AN!Cluster v0.2.001&#039;&#039;&#039; Install DVD. (4.5[[GiB]] iso). (Currently disabled - Reworking for F13)&lt;br /&gt;
&lt;br /&gt;
== Post OS Install ==&lt;br /&gt;
&lt;br /&gt;
Once the OS is installed, we need to do a couple things; &lt;br /&gt;
&lt;br /&gt;
# Disable &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;selinux&amp;lt;/span&amp;gt;&lt;br /&gt;
# Setup networking.&lt;br /&gt;
# Change the default run-level.&lt;br /&gt;
&lt;br /&gt;
=== Disable &#039;selinux&#039; ===&lt;br /&gt;
&lt;br /&gt;
To allow this paper to focus on clustering, we will disable &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;selinux&amp;lt;/span&amp;gt;. Obviously, this introduces security issues that you may not be comfortable with. If you wish to leave &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;selinux&amp;lt;/span&amp;gt; enabled, it will be up to you to sort out issues that crop up.&lt;br /&gt;
&lt;br /&gt;
To disable &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;selinux&amp;lt;/span&amp;gt;, edit &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/selinux/config&amp;lt;/span&amp;gt; and change &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;SELINUX=enforcing&amp;lt;/span&amp;gt; to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;SELINUX=permissive&amp;lt;/span&amp;gt;. You will need to reboot in order for the changes to take effect.&lt;br /&gt;
&lt;br /&gt;
=== Change the Default Run-Level ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;This is an optional step&#039;&#039;&#039;. It improves performance only, it is not a required step.&lt;br /&gt;
&lt;br /&gt;
If you don&#039;t plan to work on your nodes directly, it makes sense to switch the default run level from &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;5&amp;lt;/span&amp;gt; to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;3&amp;lt;/span&amp;gt;. This prevents the window manager, like Gnome or KDE, from starting at boot. This frees up a fair of memory and system resources and reduces the possible attack vectors.&lt;br /&gt;
&lt;br /&gt;
To do this, edit &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/inittab&amp;lt;/span&amp;gt;, change the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;id:5:initdefault:&amp;lt;/span&amp;gt; line to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;id:3:initdefault:&amp;lt;/span&amp;gt; and then switch to run level 3:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/inittab&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
id:3:initdefault:&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
init 3&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Setup Networking ===&lt;br /&gt;
&lt;br /&gt;
We need to remove &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;NetworkManager&amp;lt;/span&amp;gt;, enable &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;network&amp;lt;/span&amp;gt;, configure the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ifcfg-eth*&amp;lt;/span&amp;gt; files and then start the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;network&amp;lt;/span&amp;gt; daemon.&lt;br /&gt;
&lt;br /&gt;
==== Managed Switch Warning ====&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;WARNING&#039;&#039;&#039;: Please pay attention to this warning. The vast majority of cluster problems end up being network related. The hardest ones to diagnose are usually multicast issues.&lt;br /&gt;
&lt;br /&gt;
If you use a managed switch, be careful about enabling [[Multicast IGMP Snooping]] or [[Spanning Tree Protocol]]! They have been known to cause problems by not allowing multicast packets to reach all nodes. This can cause somewhat random break-downs in communication between your nodes, leading to fences and DLM lock timeouts.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Ensure the [[PIM Routing]] is setup and working.&lt;br /&gt;
&lt;br /&gt;
If you have problems with your cluster not forming, or seemingly random fencing, try using an unmanaged switch or use a cross-over cable. If the problem goes away, you are most likely dealing with a managed switch configuration problem.&lt;br /&gt;
&lt;br /&gt;
==== Network Layout ====&lt;br /&gt;
&lt;br /&gt;
This setup expects you to have three physical network cards connected to three independent networks. To have a common vernacular, lets use this table to describe them:&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
!class=&amp;quot;cell_all&amp;quot;|Network Description&lt;br /&gt;
!class=&amp;quot;cell_tbr&amp;quot;|Short Name&lt;br /&gt;
!class=&amp;quot;cell_tbr&amp;quot;|Device Name&lt;br /&gt;
!class=&amp;quot;cell_tbr&amp;quot;|Suggested Subnet&lt;br /&gt;
!class=&amp;quot;cell_tbr&amp;quot;|NIC Properties&lt;br /&gt;
|-&lt;br /&gt;
|class=&amp;quot;cell_blr&amp;quot;|Back-Channel Network&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;BCN&amp;lt;/span&amp;gt;&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth0&amp;lt;/span&amp;gt;&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;192.168.1.0/24&amp;lt;/span&amp;gt;&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|NICs with [[IPMI]] piggy-back &#039;&#039;&#039;must&#039;&#039;&#039; be used here.&amp;lt;br /&amp;gt;Second-fastest NIC should be used here.&lt;br /&gt;
|-&lt;br /&gt;
|class=&amp;quot;cell_blr&amp;quot;|Storage Network&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;SN&amp;lt;/span&amp;gt;&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth1&amp;lt;/span&amp;gt;&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;192.168.2.0/24&amp;lt;/span&amp;gt;&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|Fastest NIC should be used here.&lt;br /&gt;
|-&lt;br /&gt;
|class=&amp;quot;cell_blr&amp;quot;|Internet-Facing Network&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;IFN&amp;lt;/span&amp;gt;&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth2&amp;lt;/span&amp;gt;&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;192.168.3.0/24&amp;lt;/span&amp;gt;&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|Remaining NIC should be used here.&amp;lt;br /&amp;gt;If using a [[Setting Up a PXE Server in Fedora|PXE server]], this should be a bootable NIC.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Take note of these concerns when planning which NIC to use on each subnet. These issues are presented in the order that they must be addressed in:&lt;br /&gt;
# If your nodes have [[IPMI]] piggy-backing on a normal NIC, that NIC &#039;&#039;&#039;&#039;&#039;must&#039;&#039;&#039;&#039;&#039; be used on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;BCN&amp;lt;/span&amp;gt; subnet. Having your fence device accessible on a subnet that can be remotely accessed can pose a &#039;&#039;major&#039;&#039; security risk.&lt;br /&gt;
# The fastest NIC should be used for your &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;SN&amp;lt;/span&amp;gt; subnet. Be sure to know which NICs support the largest jumbo frames when considering this.&lt;br /&gt;
# If you still have two NICs to choose from, use the fastest remaining NIC for your &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;BCN&amp;lt;/span&amp;gt; subnet. This will minimize the time it takes to perform tasks like hot-migration of live virtual machines.&lt;br /&gt;
# The final NIC should be used for the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;IFN&amp;lt;/span&amp;gt; subnet.&lt;br /&gt;
&lt;br /&gt;
==== Node IP Addresses ====&lt;br /&gt;
&lt;br /&gt;
Obviously, the IP addresses you give to your nodes should be ones that suit you best. In this example, the following IP addresses are used:&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;amp;nbsp;&lt;br /&gt;
|class=&amp;quot;cell_tbr&amp;quot;|&#039;&#039;&#039;Internet-Facing Network&#039;&#039;&#039; (&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;IFN&amp;lt;/span&amp;gt;)&lt;br /&gt;
|class=&amp;quot;cell_tbr&amp;quot;|&#039;&#039;&#039;Storage Network&#039;&#039;&#039; (&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;SN&amp;lt;/span&amp;gt;)&lt;br /&gt;
|class=&amp;quot;cell_tbr&amp;quot;|&#039;&#039;&#039;Back-Channel Network&#039;&#039;&#039; (&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;BCN&amp;lt;/span&amp;gt;)&lt;br /&gt;
|-&lt;br /&gt;
|class=&amp;quot;cell_blr&amp;quot;|&#039;&#039;&#039;an-node01&#039;&#039;&#039;&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;192.168.1.71&amp;lt;/span&amp;gt;&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;192.168.2.71&amp;lt;/span&amp;gt;&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;192.168.3.71&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|class=&amp;quot;cell_blr&amp;quot;|&#039;&#039;&#039;an-node02&#039;&#039;&#039;&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;192.168.1.72&amp;lt;/span&amp;gt;&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;192.168.2.72&amp;lt;/span&amp;gt;&lt;br /&gt;
|class=&amp;quot;cell_br&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;192.168.3.72&amp;lt;/span&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Remove NetworkManager ====&lt;br /&gt;
&lt;br /&gt;
Some cluster software &#039;&#039;&#039;will not&#039;&#039;&#039; start with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;NetworkManager&amp;lt;/span&amp;gt; installed. This is because it is designed to be a highly-adaptive network system that can accommodate frequent changes in the network. To simplify these network transitions for end-users, a lot of reconfiguration of the network is done behind the scenes. &lt;br /&gt;
&lt;br /&gt;
For workstations, this is wonderful. For clustering, this can be disastrous. Transient network outages are already a risk to a cluster&#039;s stability!&lt;br /&gt;
&lt;br /&gt;
So first up, make sure that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;NetworkManager&amp;lt;/span&amp;gt; is completely removed from your system. If you used the [[#OS Install|kickstart]] scripts, then it was not installed. Otherwise, run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum remove NetworkManager NetworkManager-gnome NetworkManager-openconnect NetworkManager-openvpn NetworkManager-pptp NetworkManager-vpnc cnetworkmanager knetworkmanager knetworkmanager-openvpn knetworkmanager-pptp knetworkmanager-vpnc libproxy-networkmanager yum-NetworkManager-dispatcher&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Setup &#039;network&#039; ====&lt;br /&gt;
&lt;br /&gt;
Before proceeding with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;network&amp;lt;/span&amp;gt; configuration, check to see if your network cards are aligned to the proper &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ethX&amp;lt;/span&amp;gt; network names. If they need to be adjusted, please follow this How-To before proceeding:&lt;br /&gt;
&lt;br /&gt;
* [[Changing the ethX to Ethernet Device Mapping in Fedora]]&lt;br /&gt;
&lt;br /&gt;
There are a few ways to configure &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;network&amp;lt;/span&amp;gt; in Fedora:&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;system-config-network&amp;lt;/span&amp;gt; (graphical)&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;system-config-network-tui&amp;lt;/span&amp;gt; (ncurses)&lt;br /&gt;
* Directly editing the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/sysconfig/network-scripts/ifcfg-eth*&amp;lt;/span&amp;gt; files. (See: [http://docs.fedoraproject.org/en-US/Fedora/12/html/Deployment_Guide/s1-networkscripts-interfaces.html here] for a full list of options)&lt;br /&gt;
&lt;br /&gt;
Do not proceed until your node&#039;s networking is fully configured.&lt;br /&gt;
&lt;br /&gt;
==== Update the Hosts File ====&lt;br /&gt;
&lt;br /&gt;
Some applications expect to be able to call nodes by their name. To accommodate this, and to ensure that inter-node communication takes place on the back-channel subnet, we remove any existing hostname entries and then add the following to the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/hosts&amp;lt;/span&amp;gt; file:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: Any pre-existing entries matching the name returned by &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;uname -n&amp;lt;/span&amp;gt; must be removed from &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/hosts&amp;lt;/span&amp;gt;. There is a good chance there will be an entry that resolves to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;127.0.0.1&amp;lt;/span&amp;gt; which would cause problems later.&lt;br /&gt;
&lt;br /&gt;
Obviously, adapt the names and IPs to match your nodes and subnets. The only critical thing is to make sure that the name returned by &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;uname -n&amp;lt;/span&amp;gt; is resolvable to the back-channel subnet. I like to add a short-form name for convenience.&lt;br /&gt;
&lt;br /&gt;
The updated &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/hosts&amp;lt;/span&amp;gt; file should look something like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/hosts&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4&lt;br /&gt;
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6&lt;br /&gt;
&lt;br /&gt;
# Internet Facing Network&lt;br /&gt;
192.168.1.71    an-node01 an-node01.alteeve.com an-node01.bcn&lt;br /&gt;
192.168.1.72    an-node02 an-node02.alteeve.com an-node02.bcn&lt;br /&gt;
&lt;br /&gt;
# Storage Network&lt;br /&gt;
192.168.2.71    an-node01.sn&lt;br /&gt;
192.168.2.72    an-node02.sn&lt;br /&gt;
&lt;br /&gt;
# Back Channel Network&lt;br /&gt;
192.168.3.71    an-node01.ifn&lt;br /&gt;
192.168.3.72    an-node02.ifn&lt;br /&gt;
&lt;br /&gt;
# Node Assassins&lt;br /&gt;
192.168.3.61    batou batou.alteeve.com&lt;br /&gt;
192.168.3.62    motoko motoko.alteeve.com&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: I use Node Assassins. If you use IPMI or other fence devices, alter the entries as appropriate.&lt;br /&gt;
&lt;br /&gt;
Now to test this, ping both nodes by their name, as returned by &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;uname -n&amp;lt;/span&amp;gt;, and make sure the ping packets are sent on the back channel network (&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;192.168.1.0/24&amp;lt;/span&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ping -c 5 an-node01.alteeve.com&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
PING an-node01 (192.168.1.71) 56(84) bytes of data.&lt;br /&gt;
64 bytes from an-node01 (192.168.1.71): icmp_seq=1 ttl=64 time=0.399 ms&lt;br /&gt;
64 bytes from an-node01 (192.168.1.71): icmp_seq=2 ttl=64 time=0.403 ms&lt;br /&gt;
64 bytes from an-node01 (192.168.1.71): icmp_seq=3 ttl=64 time=0.413 ms&lt;br /&gt;
64 bytes from an-node01 (192.168.1.71): icmp_seq=4 ttl=64 time=0.365 ms&lt;br /&gt;
64 bytes from an-node01 (192.168.1.71): icmp_seq=5 ttl=64 time=0.428 ms&lt;br /&gt;
&lt;br /&gt;
--- an-node01 ping statistics ---&lt;br /&gt;
5 packets transmitted, 5 received, 0% packet loss, time 4001ms&lt;br /&gt;
rtt min/avg/max/mdev = 0.365/0.401/0.428/0.030 ms&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ping -c 5 an-node02.alteeve.com&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
PING an-node02 (192.168.1.72) 56(84) bytes of data.&lt;br /&gt;
64 bytes from an-node02 (192.168.1.72): icmp_seq=1 ttl=64 time=0.419 ms&lt;br /&gt;
64 bytes from an-node02 (192.168.1.72): icmp_seq=2 ttl=64 time=0.405 ms&lt;br /&gt;
64 bytes from an-node02 (192.168.1.72): icmp_seq=3 ttl=64 time=0.416 ms&lt;br /&gt;
64 bytes from an-node02 (192.168.1.72): icmp_seq=4 ttl=64 time=0.373 ms&lt;br /&gt;
64 bytes from an-node02 (192.168.1.72): icmp_seq=5 ttl=64 time=0.396 ms&lt;br /&gt;
&lt;br /&gt;
--- an-node02 ping statistics ---&lt;br /&gt;
5 packets transmitted, 5 received, 0% packet loss, time 4001ms&lt;br /&gt;
rtt min/avg/max/mdev = 0.373/0.401/0.419/0.030 ms&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Be sure that, if your [[fence]] device uses a name, that you include entries to resolve it as well. You can see how I&#039;ve done this with the two [[Node Assassin]] devices I use. The same applies to [[IPMI]] or other devices, if you plan to reference them by name. &lt;br /&gt;
&lt;br /&gt;
Fencing will be discussed in more detail later on in this HowTo.&lt;br /&gt;
&lt;br /&gt;
==== Disable Firewalls ====&lt;br /&gt;
&lt;br /&gt;
Be sure to flush netfilter tables and disable &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;iptables&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ip6tables&amp;lt;/span&amp;gt; from starting on our nodes.&lt;br /&gt;
&lt;br /&gt;
There will be enough potential sources of problem as it is. Disabling firewalls at this stage will minimize the chance of an errant &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;iptables&amp;lt;/span&amp;gt; rule messing up our configuration. If, before launch, you wish to implement a firewall, feel free to do so but be sure to thoroughly test your cluster to ensure no problems were introduced.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
chkconfig --level 2345 iptables off&lt;br /&gt;
/etc/init.d/iptables stop&lt;br /&gt;
chkconfig --level 2345 ip6tables off&lt;br /&gt;
/etc/init.d/ip6tables stop&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Setup SSH Shared Keys ====&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;This is an optional step&#039;&#039;&#039;. Setting up shared keys will allow your nodes to pass files between one another and execute commands remotely without needing to enter a password. This is obviously somewhat risky from a security point of view. As such, it is up to you whether you do this or not. This is not meant to be a security-focused How-To, so please independently study the risks.&lt;br /&gt;
&lt;br /&gt;
If you&#039;re a little new to [[SSH]], it can be a bit confusing keeping connections straight in you head. When you connect to a remote machine, you start the connection on your machine as the user you are logged in as. This is the source user. When you call the remote machine, you tell the machine what user you want to log in as. This is the remote user.&lt;br /&gt;
&lt;br /&gt;
You will need to create an SSH key for each source user, and then you will need to copy the newly generated public key to each remote machine&#039;s user directory that you want to connect to. In this example, we want to connect to either node, from either node, as the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;root&amp;lt;/span&amp;gt; user. So we will create a key for each node&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;root&amp;lt;/span&amp;gt; user and then copy the generated public key to the &#039;&#039;other&#039;&#039; node&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;root&amp;lt;/span&amp;gt; user&#039;s directory.&lt;br /&gt;
&lt;br /&gt;
For each user, on each machine you want to connect &#039;&#039;&#039;from&#039;&#039;&#039;, run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# The &#039;2047&#039; is just to screw with brute-forces a bit. :)&lt;br /&gt;
ssh-keygen -t rsa -N &amp;quot;&amp;quot; -b 2047 -f ~/.ssh/id_rsa&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Generating public/private rsa key pair.&lt;br /&gt;
Your identification has been saved in /root/.ssh/id_rsa.&lt;br /&gt;
Your public key has been saved in /root/.ssh/id_rsa.pub.&lt;br /&gt;
The key fingerprint is:&lt;br /&gt;
08:d8:ed:72:38:61:c5:0e:cf:bf:dc:28:e5:3c:a7:88 root@an-node01.alteeve.com&lt;br /&gt;
The key&#039;s randomart image is:&lt;br /&gt;
+--[ RSA 2047]----+&lt;br /&gt;
|     ..          |&lt;br /&gt;
|   o.o.          |&lt;br /&gt;
|  . ==.          |&lt;br /&gt;
|   . =+.         |&lt;br /&gt;
|    + +.S        |&lt;br /&gt;
|     +  o        |&lt;br /&gt;
|       = +       |&lt;br /&gt;
|     ...B o      |&lt;br /&gt;
|    E ...+       |&lt;br /&gt;
+-----------------+&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will create two files: the private key called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;~/.ssh/id_dsa&amp;lt;/span&amp;gt; and the public key called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;~/.ssh/id_dsa.pub&amp;lt;/span&amp;gt;. The private &#039;&#039;&#039;&#039;&#039;must never&#039;&#039;&#039;&#039;&#039; be group or world readable! That is, it should be set to mode &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;0600&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The two files should look like:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Private key&#039;&#039;&#039;:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cat ~/.ssh/id_rsa&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
-----BEGIN RSA PRIVATE KEY-----&lt;br /&gt;
MIIEoQIBAAKCAQBlL42DC+NJVpJ0rdrWQ1rxGEbPrDoe8j8+RQx3QYiB014R7jY5&lt;br /&gt;
EaTenThxG/cudgbLluFxq6Merfl9Tq2It3k9Koq9nV9ZC/vXBcl4MC7pGSQaUw2h&lt;br /&gt;
DVwI7OCSWtnS+awR/1d93tANXRwy7K5ic1pcviJeN66dPuuPqJEF/SKE7yEBapMq&lt;br /&gt;
sN28G4IiLdimsV+UYXPQLOiMy5stmyGhFhQGH3kxYzJPOgiwZEFPZyXinGVoV+qa&lt;br /&gt;
9ERSjSKAL+g21zbYB/XFK9jLNSJqDIPa//wz0T+73agZ0zNlxygmXcJvapEsFGDG&lt;br /&gt;
O6tcy/3XlatSxjEZvvfdOnC310gJVp0bcyWDAgMBAAECggEAMZd0y91vr+n2Laln&lt;br /&gt;
r8ujLravPekzMyeXR3Wf/nLn7HkjibYubRnwrApyNz11kBfYjL+ODqAIemjZ9kgx&lt;br /&gt;
VOhXS1smVHhk2se8zk3PyFAVLblcsGo0K9LYYKd4CULtrzEe3FNBFje10FbqEytc&lt;br /&gt;
7HOMvheR0IuJ0Reda/M54K2H1Y6VemtMbT+aTcgxOSOgflkjCTAeeOajqP5r0TRg&lt;br /&gt;
1tY6/k46hLiBka9Oaj+QHHoWp+aQkb+ReHUBcUihnz3jcw2u8HYrQIO4+v4Ud2kr&lt;br /&gt;
C9QHPW907ykQTMAzhMvZ3DIOcqTzA0r857ps6FANTM87tqpse5h2KfdIjc0Ok/AY&lt;br /&gt;
eKgYAQKBgQDm/P0RygIJl6szVhOb5EsQU0sBUoMT3oZKmPcjHSsyVFPuEDoq1FG7&lt;br /&gt;
uZYMESkVVSYKvv5hTkRuVOqNE/EKtk5bwu4mM0S3qJo99cLREKB6zNdBp9z2ACDn&lt;br /&gt;
0XIIFIalXAPwYpoFYi1YfG8tFfSDvinLI6JLDT003N47qW1cC5rmgQKBgHAkbfX9&lt;br /&gt;
8u3LiT8JqCf1I+xoBTwH64grq/7HQ+PmwRqId+HyyDCm9Y/mkAW1hYQB+cL4y3OO&lt;br /&gt;
kGL60CZJ4eFiTYrSfmVa0lTbAlEfcORK/HXZkLRRW03iuwdAbZ7DIMzTvY2HgFlU&lt;br /&gt;
L1CfemtmzEC4E6t5/nA4Ytk9kPSlzbzxfXIDAoGAY/WtaqpZ0V7iRpgEal0UIt94&lt;br /&gt;
wPy9HrcYtGWX5Yk07VXS8F3zXh99s1hv148BkWrEyLe4i9F8CacTzbOIh1M3e7xS&lt;br /&gt;
pRNgtH3xKckV4rVoTVwh9xa2p3qMwuU/jMGdNygnyDpTXusKppVK417x7qU3nuIv&lt;br /&gt;
1HzJNPwz6+u5GLEo+oECgYAs++AEKj81dkzytXv3s1UasstOvlqTv/j5dZNdKyZQ&lt;br /&gt;
72cvgsUdBwxAEhu5vov1XRmERWrPSuPOYI/4m/B5CYbTZgZ/v8PZeBTg17zgRtgo&lt;br /&gt;
qgJq4qu+fXHKweR3KAzTPSivSiiJLMTiEWb5CD5sw6pYQdJ3z5aPUCwChzQVU8Wf&lt;br /&gt;
YwKBgQCvoYG7gwx/KGn5zm5tDpeWb3GBJdCeZDaj1ulcnHR0wcuBlxkw/TcIadZ3&lt;br /&gt;
kqIHlkjll5qk5EiNGNlnpHjEU9X67OKk211QDiNkg3KAIDMKBltE2AHe8DhFsV8a&lt;br /&gt;
Mc/t6vHYZ632hZ7b0WNuudB4GHJShOumXD+NfJgzxqKJyfGkpQ==&lt;br /&gt;
-----END RSA PRIVATE KEY-----&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Public key&#039;&#039;&#039;:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cat ~/.ssh/id_rsa.pub&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAGUvjYML40lWknSt2tZDWvEYRs+sOh7yPz5FDHdBiIHTXhHuNjkRpN6dOHEb9y52BsuW4XGrox6t+X1OrYi3eT0qir2dX1kL+9cFyXgwLukZJBpTDaENXAjs4JJa2dL5rBH/V33e0A1dHDLsrmJzWly+Il43rp0+64+okQX9IoTvIQFqkyqw3bwbgiIt2KaxX5Rhc9As6IzLmy2bIaEWFAYfeTFjMk86CLBkQU9nJeKcZWhX6pr0RFKNIoAv6DbXNtgH9cUr2Ms1ImoMg9r//DPRP7vdqBnTM2XHKCZdwm9qkSwUYMY7q1zL/deVq1LGMRm+9906cLfXSAlWnRtzJYM= root@an-node01.alteeve.com&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Copy the public key and then &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ssh&amp;lt;/span&amp;gt; normally into the remote machine as the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;root&amp;lt;/span&amp;gt; user. Create a file called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;~/.ssh/authorized_keys&amp;lt;/span&amp;gt; and paste in the key.&lt;br /&gt;
&lt;br /&gt;
From &#039;&#039;&#039;an-node01&#039;&#039;&#039;, type:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ssh root@an-node02&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
The authenticity of host &#039;an-node02 (192.168.1.72)&#039; can&#039;t be established.&lt;br /&gt;
RSA key fingerprint is d4:1b:68:5f:fa:ef:0f:0c:16:e7:f9:0a:8d:69:3e:c5.&lt;br /&gt;
Are you sure you want to continue connecting (yes/no)? yes&lt;br /&gt;
Warning: Permanently added &#039;an-node02,192.168.1.72&#039; (RSA) to the list of known hosts.&lt;br /&gt;
root@an-node02&#039;s password: &lt;br /&gt;
Last login: Fri Oct  1 20:07:01 2010 from 192.168.1.102&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You will now be logged into &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt; as the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;root&amp;lt;/span&amp;gt; user. Create the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;~/.ssh/authorized_keys&amp;lt;/span&amp;gt; file and paste into it the public key from &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;. If the remote machine&#039;s user hasn&#039;t used &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ssh&amp;lt;/span&amp;gt; yet, their &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;~/.ssh&amp;lt;/span&amp;gt; directory will not exist.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cat ~/.ssh/authorized_keys&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAGUvjYML40lWknSt2tZDWvEYRs+sOh7yPz5FDHdBiIHTXhHuNjkRpN6dOHEb9y52BsuW4XGrox6t+X1OrYi3eT0qir2dX1kL+9cFyXgwLukZJBpTDaENXAjs4JJa2dL5rBH/V33e0A1dHDLsrmJzWly+Il43rp0+64+okQX9IoTvIQFqkyqw3bwbgiIt2KaxX5Rhc9As6IzLmy2bIaEWFAYfeTFjMk86CLBkQU9nJeKcZWhX6pr0RFKNIoAv6DbXNtgH9cUr2Ms1ImoMg9r//DPRP7vdqBnTM2XHKCZdwm9qkSwUYMY7q1zL/deVq1LGMRm+9906cLfXSAlWnRtzJYM= root@an-node01.alteeve.com&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now log out and then log back into the remote machine. This time, the connection should succeed without having entered a password!&lt;br /&gt;
&lt;br /&gt;
= Initial Cluster Setup =&lt;br /&gt;
&lt;br /&gt;
Before we get into specifics, let&#039;s take a minute to talk about the major components used in our cluster.&lt;br /&gt;
&lt;br /&gt;
== Core Program Overviews ==&lt;br /&gt;
&lt;br /&gt;
These are the core programs that may be new to you that we will use to build our cluster. Before we configure them, let&#039;s take a minute to understand their roles.&lt;br /&gt;
&lt;br /&gt;
=== Cluster Manager ===&lt;br /&gt;
&lt;br /&gt;
The cluster manager, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt;, takes the configuration file &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[Two-Node Fedora 13 cluster.conf|/etc/cluster/cluster.conf]]&amp;lt;/span&amp;gt; configuration file and uses it to configure and start the various cluster elements. This is where nodes are defined, fence devices are configured and various cluster tolerances are set.&lt;br /&gt;
&lt;br /&gt;
=== Corosync ===&lt;br /&gt;
&lt;br /&gt;
[http://www.corosync.org Corosync] is, essentially, the clustering kernel which provides the essential services for cluster-aware applications and other cluster services. At it&#039;s core is the [[totem]] protocol which provides cluster membership and ordered messaging. On top of this, it implements a number of core clustering services like [[#cpg; Closed Process Group|closed process group messaging]], [[quorum]] and [[confdb]] (an object database).&lt;br /&gt;
&lt;br /&gt;
It&#039;s goal is to provide a substantially simpler and more flexible set of APIs to facilitate clustering in Linux. It manages which nodes are in the cluster, it triggers error messages when something fails, manages cluster locking and so on. Most other clustered applications rely on corosync to know when something has happened or to announce when a cluster-related action has taken place.&lt;br /&gt;
&lt;br /&gt;
Please note that the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;corosync_overview&amp;lt;/span&amp;gt; man page is considered out of date at the time of this writing.&lt;br /&gt;
&lt;br /&gt;
==== cpg; Closed Process Group ====&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: Only install the following if you wish to review the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;man&amp;lt;/span&amp;gt; page.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install corosynclib-devel&lt;br /&gt;
man cpg_overview&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The closed process group is a small process layer on top of the totem protocol provided by corosync. It handles the sending and delivery of messages amongst nodes in a consistent order. It adds [[PID]]s and group names to the membership layer. Only members of the group get the messages, thus it is a &amp;quot;closed&amp;quot; group.&lt;br /&gt;
&lt;br /&gt;
=== OpenAIS ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: We will not use OpenAIS. It is included in here to explain it&#039;s role to folks coming from the Cluster stable 2 environment.&lt;br /&gt;
&lt;br /&gt;
OpenAIS is now an extension to Corosync that adds an open-source implementation of the [http://www.saforum.org/ Service Availability (SA) Forum&#039;s] &#039;Application Interface Specification&#039; ([[AIS]]). It is an [[API]] and policy designed to be used by applications concerned with maintaining services during faults. AIS implements the &#039;Availability Management Framework&#039; ([[AMF]]) which, in turn, provides for application fail over, cluster management ([[CLM]]), Checkpointing ([[CKPT]]), Eventing ([[EVT]]), Messaging ([[MSG]]), and Distributed Locking ([[DLOCK]]).&lt;br /&gt;
&lt;br /&gt;
It does this by implementing pluggable shared libraries that get loaded into corosync at runtime. These libraries then can make use of corosync&#039;s internal API. Both corosync and openais services provide [[IPC]] interfaces so that application programmers can make use of their behaviour. In short; applications can use OpenAIS to be cluster-aware. It&#039;s libraries are used by some applications, including Pacemaker. In our application, we will only be using it&#039;s libraries indirectly.&lt;br /&gt;
&lt;br /&gt;
Please note that the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;openais_overview&amp;lt;/span&amp;gt; man page is considered out of date at the time of this writing.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: Only install the following if you wish to review the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;man&amp;lt;/span&amp;gt; page.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install openais&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Setup Core Programs ==&lt;br /&gt;
&lt;br /&gt;
We now need to edit and create the configuration files for our cluster.&lt;br /&gt;
&lt;br /&gt;
=== Setup cman ===&lt;br /&gt;
&lt;br /&gt;
You may only need to configure this section.&lt;br /&gt;
&lt;br /&gt;
First, install the cluster manager:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum -y install cman&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Setting Up /etc/cluster/cluster.conf ====&lt;br /&gt;
&lt;br /&gt;
Once installed, we need to create and fill in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[Two-Node Fedora 13 cluster.conf|/etc/cluster/cluster.conf]]&amp;lt;/span&amp;gt; file. This is the core configuration file of our cluster and is an [[XML]] formatted file.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Notice&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This is, in many ways, the &amp;quot;core&amp;quot; of your cluster. This section is short, but expect to spend some time getting the right setup for your environment. Please pay careful attention to all options and thoroughly test your configuration before going into production!&lt;br /&gt;
&lt;br /&gt;
* Please see: [[Two-Node Fedora 13 cluster.conf]] for a full explanation on this file and it&#039;s options.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/cluster/cluster.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The example in that article details many of the common options you will want to use. For a more complete list, please run &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;man 5 cluster.conf&amp;lt;/span&amp;gt; for a more complete discussion on this file. Also, please be aware that some arguments can overlap between [[#Setup Corosync|corosync]] and this file.&lt;br /&gt;
&lt;br /&gt;
Here is a real-world example configuration used in the development two-node AN!Cluster. This will likely not work for you, but should act as a good base to adapt and expand on.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;cluster name=&amp;quot;an-cluster&amp;quot; config_version=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;cman two_node=&amp;quot;1&amp;quot; expected_votes=&amp;quot;1&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;totem secauth=&amp;quot;off&amp;quot; rrp_mode=&amp;quot;active&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;clusternodes&amp;gt;&lt;br /&gt;
        &amp;lt;clusternode name=&amp;quot;an-node01.alteeve.com&amp;quot; nodeid=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
            &amp;lt;fence&amp;gt;&lt;br /&gt;
                &amp;lt;method name=&amp;quot;node_assassin&amp;quot;&amp;gt;&lt;br /&gt;
                    &amp;lt;device name=&amp;quot;batou&amp;quot; port=&amp;quot;01&amp;quot; action=&amp;quot;reboot&amp;quot;/&amp;gt;&lt;br /&gt;
                &amp;lt;/method&amp;gt;&lt;br /&gt;
            &amp;lt;/fence&amp;gt;&lt;br /&gt;
        &amp;lt;/clusternode&amp;gt;&lt;br /&gt;
        &amp;lt;clusternode name=&amp;quot;an-node02.alteeve.com&amp;quot; nodeid=&amp;quot;2&amp;quot;&amp;gt;&lt;br /&gt;
            &amp;lt;fence&amp;gt;&lt;br /&gt;
                &amp;lt;method name=&amp;quot;node_assassin&amp;quot;&amp;gt;&lt;br /&gt;
                    &amp;lt;device name=&amp;quot;batou&amp;quot; port=&amp;quot;02&amp;quot; action=&amp;quot;reboot&amp;quot;/&amp;gt;&lt;br /&gt;
                &amp;lt;/method&amp;gt;&lt;br /&gt;
            &amp;lt;/fence&amp;gt;&lt;br /&gt;
        &amp;lt;/clusternode&amp;gt;&lt;br /&gt;
    &amp;lt;/clusternodes&amp;gt;&lt;br /&gt;
    &amp;lt;fencedevices&amp;gt;&lt;br /&gt;
        &amp;lt;fencedevice name=&amp;quot;batou&amp;quot; agent=&amp;quot;fence_na&amp;quot; ipaddr=&amp;quot;batou.alteeve.com&amp;quot; login=&amp;quot;username&amp;quot; passwd=&amp;quot;secret&amp;quot; quiet=&amp;quot;1&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;/fencedevices&amp;gt;&lt;br /&gt;
&amp;lt;/cluster&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once your version of the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cluster.conf&amp;lt;/span&amp;gt; is done, you need to verify it. Be sure to validate it against the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cluster.rng&amp;lt;/span&amp;gt; validation file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
xmllint --relaxng /usr/share/cluster/cluster.rng /etc/cluster/cluster.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If there are errors, fix them. Once it is formatted properly, the contents of you &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cluster.conf&amp;lt;/span&amp;gt; file will be returned followed by &amp;quot;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/cluster/cluster.conf validates&amp;lt;/span&amp;gt;&amp;quot;. Once this is the case, you can move on.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: Normally at this stage, you&#039;d use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;chkconfig&amp;lt;/span&amp;gt; to enable &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt; to start at boot. However, depending on how you use your cluster, you may need to modify the boot order. For now, let&#039;s leave it off until we&#039;re got all the components enabled. This is particularly important if you will be using [[DRBD]], [[CLVM]] or [[Xen]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
chkconfig cman off&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To see if it&#039;s working though, have a terminal open to both nodes and manually start &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt;. I suggest have two terminal windows open on each node. In one, start &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;tail&amp;lt;/span&amp;gt;ing &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/var/log/messages&amp;lt;/span&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
clear; tail -f -n 0 /var/log/messages&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now, with both log files being watched, start &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt; on both nodes.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: You MUST execute the following on both nodes withing the time limit set by &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;post_join_delay&amp;lt;/span&amp;gt; (default is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;6&amp;lt;/span&amp;gt; seconds). If you wait longer than this, the first node started will [[fence]] the other node, assuming you have fencing configured properly. If fencing is &#039;&#039;&#039;not&#039;&#039;&#039; configured properly, your first node will hang.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/cman start&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Examine the log files to verify there were no errors. If there were, fix them. If there was not, fantastic!&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Warning&#039;&#039;&#039;: This last step will forcefully reboot your nodes. Do not do this on a production cluster! If it must be done on a production server, stop all non-essential services and be sure you have a good backup, &#039;&#039;just in case&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Lastly, test that your fencing is configured and working properly. We do this by using a program called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fence_node&amp;lt;/span&amp;gt;. With both nodes up and running &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt;, call a fence against the other node. Be sure to be watching the log files.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;From&#039;&#039;&#039; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01.alteeve.com&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
fence_node an-node02.alteeve.com&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
fence an-node02.alteeve.com success&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If it worked, when the node comes back up, repeat the process from &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02.alteeve.com&amp;lt;/span&amp;gt; against &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01.alteeve.com&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Setup Corosync ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: In our cluster, we will not need to configure Corosync.&lt;br /&gt;
&lt;br /&gt;
When using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt;, as we are here, Corosync&#039;s configuration file is ignored.&lt;br /&gt;
&lt;br /&gt;
Most of the settings available in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[Two-Node Fedora 13 corosync.conf|corosync.conf]]&amp;lt;/span&amp;gt; can be found in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[Two-Node Fedora 13 cluster.conf|cluster.conf]]&amp;lt;/span&amp;gt; file. Please see the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cluster.conf&amp;lt;/span&amp;gt; article for a comprehensive list of what is and is not supported.&lt;br /&gt;
&lt;br /&gt;
If you want to configure corosync and not use cman, please see the following article:&lt;br /&gt;
&lt;br /&gt;
* [[Two-Node Fedora 13 corosync.conf]]&lt;br /&gt;
&lt;br /&gt;
= Fencing =&lt;br /&gt;
&lt;br /&gt;
Before proceeding with the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cluster.conf&amp;lt;/span&amp;gt; file, you must understand what fencing is, how it is used in Red Hat/CentOS clusters and why it is so important.&lt;br /&gt;
&lt;br /&gt;
* The Cluster Admin&#039;s Mantra:&lt;br /&gt;
** &#039;&#039;&#039;The only thing you don&#039;t know is what you don&#039;t know&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Just because one node loses communication with another node, it &#039;&#039;&#039;cannot&#039;&#039;&#039; assume that the silent node is dead!&lt;br /&gt;
&lt;br /&gt;
== What is it? ==&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Fencing&amp;quot; is the act of isolating a malfunctioning node. The goal is to prevent a &#039;&#039;&#039;split-brain&#039;&#039;&#039; condition where two nodes think the other member is dead and continue to use a shared resource. When this happens, file system corruption is almost guaranteed. Another dangerous scenario would be if one node paused while writing to a disk, the other node decides it&#039;s dead and starts to replay the journal, then the first node recovers and completes the write. The results would be equally disastrous. If you are lucky enough to not lose the shared file system, you will be faced with the task of determining what data got written to which node, merging that data and/or overwriting the node you trust the least. This &#039;best case&#039; is still pretty lousy.&lt;br /&gt;
&lt;br /&gt;
Fencing, isolating a node from altering shared disks, can be accomplished in a couple of ways:&lt;br /&gt;
&lt;br /&gt;
* Power&lt;br /&gt;
** Power fencing is where a device is used to cut the power to a malfunctioning node. This is probably the most common type.&lt;br /&gt;
* Blocking&lt;br /&gt;
** Blocking is often implemented at the network level. This type of fencing leaves the node alone, but disconnects it from the storage network. Often this is done by a switch which prevents traffic coming from the fenced node.&lt;br /&gt;
&lt;br /&gt;
Those familiar with heartbeat clusters will know &amp;quot;fencing&amp;quot; by the HA Linux term &amp;quot;STONITH&amp;quot;, literally, &#039;&#039;&#039;S&#039;&#039;&#039;hoot &#039;&#039;&#039;T&#039;&#039;&#039;he &#039;&#039;&#039;O&#039;&#039;&#039;ther &#039;&#039;&#039;N&#039;&#039;&#039;ode &#039;&#039;&#039;I&#039;&#039;&#039;n &#039;&#039;&#039;T&#039;&#039;&#039;he &#039;&#039;&#039;H&#039;&#039;&#039;ead.&lt;br /&gt;
&lt;br /&gt;
== Misconception ==&lt;br /&gt;
&lt;br /&gt;
It is a &#039;&#039;&#039;very&#039;&#039;&#039; common mistake to ignore fencing when first starting to learn about clustering. Often people think &#039;&#039;&amp;quot;It&#039;s just for production systems, I don&#039;t need to worry about it yet because I don&#039;t care what happens to my test cluster.&amp;quot;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Wrong!&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For the most practical reason; the cluster software will block all I/O transactions when it can&#039;t guarantee a fence operation succeeded. The result is that your cluster will essentially &amp;quot;lock up&amp;quot;. Likewise, [[cman]] and related daemons will fail if they can&#039;t find a fence agent to use.&lt;br /&gt;
&lt;br /&gt;
Secondly: testing our cluster will involve inducing errors. Without proper fencing, there is a high probability that our shared file system will be corrupted. That would force the need to start over, making your learning take a lot longer than it needs to.&lt;br /&gt;
&lt;br /&gt;
== Fence Devices ==&lt;br /&gt;
&lt;br /&gt;
Many major [[OEM]]s have their own remote management devices that can serve as fence devices. Examples are [http://dell.ca Dell]&#039;s &#039;DRAC&#039; (Dell Remote Access Controller), [http://hp.ca HP]&#039;s iLO (Integrate Lights Out), [http://ibm.ca IBM]&#039;s &#039;RSA&#039; (Remote Supervisor Adapter), [http://sun.ca Sun]&#039;s &#039;SSP&#039; (System Service Processor) and so on. Smaller manufacturers implement remote management via [[IPMI]], Intelligent Power Management Interface. &lt;br /&gt;
&lt;br /&gt;
In the above devices, fencing is implemented via a build in or integrated device inside the server. These devices are usually accessible even when the host server is powered off or hard locked. Via these devices, the host server can be powered off, reset and powered on remotely, regardless of the state of the host server.&lt;br /&gt;
&lt;br /&gt;
Block fencing is possible when the device connecting a node to shared resources, like a fiber-channel SAN switch, provides a method of logically &amp;quot;unplugging&amp;quot; a defective node from the shared resource, leaving the node itself alone.&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
&lt;br /&gt;
How you implement fencing depends largely on what kind of fence device(s) you have. This is where I need help from you, dear reader. I only have access to [[Node Assassin]] fence devices on my lab&#039;s cluster and [[IPMI]] at work. I will show examples below using these devices. If you have other fence devices, like [[IPMI]], addressable [[PDU]] or so on, please let me know so that I can expand this section.&lt;br /&gt;
&lt;br /&gt;
=== Using Node Assassin To Demonstrate Fencing ===&lt;br /&gt;
&lt;br /&gt;
In Red Hat&#039;s cluster software, the fence device(s) are configured in the main &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/cluster.conf&amp;lt;/span&amp;gt; cluster configuration file. This configuration is then acted on via the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fenced&amp;lt;/span&amp;gt; fence daemon.&lt;br /&gt;
&lt;br /&gt;
When the cluster determines that a node needs to be fenced, the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fenced&amp;lt;/span&amp;gt; daemon will consult the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cluster.conf&amp;lt;/span&amp;gt; file for information on how to access the fence device. Given this &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cluster.conf&amp;lt;/span&amp;gt; snippet:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;cluster name=&amp;quot;an-cluster&amp;quot; config_version=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;clusternodes&amp;gt;&lt;br /&gt;
		&amp;lt;clusternode name=&amp;quot;an-node02.alteeve.com&amp;quot; nodeid=&amp;quot;2&amp;quot;&amp;gt;&lt;br /&gt;
			&amp;lt;fence&amp;gt;&lt;br /&gt;
				&amp;lt;method name=&amp;quot;node_assassin&amp;quot;&amp;gt;&lt;br /&gt;
					&amp;lt;device name=&amp;quot;motoko&amp;quot; port=&amp;quot;02&amp;quot; action=&amp;quot;off&amp;quot;/&amp;gt;&lt;br /&gt;
				&amp;lt;/method&amp;gt;&lt;br /&gt;
			&amp;lt;/fence&amp;gt;&lt;br /&gt;
		&amp;lt;/clusternode&amp;gt;&lt;br /&gt;
	&amp;lt;/clusternodes&amp;gt;&lt;br /&gt;
	&amp;lt;fencedevices&amp;gt;&lt;br /&gt;
		&amp;lt;fencedevice name=&amp;quot;motoko&amp;quot; agent=&amp;quot;fence_na&amp;quot; quiet=&amp;quot;true&amp;quot;&lt;br /&gt;
		ipaddr=&amp;quot;motoko.alteeve.com&amp;quot; login=&amp;quot;motoko&amp;quot; passwd=&amp;quot;secret&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;/fencedevice&amp;gt;&lt;br /&gt;
	&amp;lt;/fencedevices&amp;gt;&lt;br /&gt;
&amp;lt;/cluster&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the cluster manager ([[corosync]], specifically) determines that the node &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02.alteeve.com&amp;lt;/span&amp;gt; needs to be fenced, it looks at the first (and only, in this case) &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;fence&amp;gt;&amp;lt;/span&amp;gt; entry&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;name&amp;lt;/span&amp;gt; which is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;motoko&amp;lt;/span&amp;gt; in this case. It gathers the other variables and then looks in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;fencedevices&amp;gt;&amp;lt;/span&amp;gt; section for the device with the matching &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;name&amp;lt;/span&amp;gt;. With these two sections, it now has all the variable-value pairs needed to pass to the fence agent script set in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;agent&amp;lt;/span&amp;gt; variable.&lt;br /&gt;
&lt;br /&gt;
So in this example, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fenced&amp;lt;/span&amp;gt; looks up the details on the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;motoko&amp;lt;/span&amp;gt; Node Assassin fence device. It calls the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fence_na&amp;lt;/span&amp;gt; program, called a fence agent, and passes the following arguments as a series of lines to the agent via [[STDIN]].&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ipaddr=motoko.alteeve.com&lt;br /&gt;
login=motoko&lt;br /&gt;
passwd=secret&lt;br /&gt;
quiet=true&lt;br /&gt;
port=2&lt;br /&gt;
action=off&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
How the fence agent acts on these arguments varies depending on the fence device itself. To continue using [[Node Assassin]] as an example, the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fence_na&amp;lt;/span&amp;gt; fence agent will create a connection to the device at the IP address (or resolvable name, as in this case) specified in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ipaddr&amp;lt;/span&amp;gt; argument. Once connected, it will authenticate using the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;login&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;passwd&amp;lt;/span&amp;gt; arguments. Once authenticated, it tells the device what &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;port&amp;lt;/span&amp;gt; to act on. Finally, it tells the device what &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;action&amp;lt;/span&amp;gt; to take. Here, the action is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;off&amp;lt;/span&amp;gt; which, internally, translates as hitting the reset switch, then press and hold the power switch long enough to force a power down. As a last step, it checks to see if there is power still coming from the node to determine whether the fence succeeded or not. In other devices, the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;port&amp;lt;/span&amp;gt; could be a power jack, a network switch port and so on. &lt;br /&gt;
&lt;br /&gt;
Once the device completes, it returns a success or failed message in the form of a prescribed exit code. If the first attempt fails, the fence agent will try the next &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;fence&amp;gt;&amp;lt;/span&amp;gt; method, if a second exists. It will keep trying fence devices in the order they are found in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cluster.conf&amp;lt;/span&amp;gt; file until it runs out of devices. If it fails to fence the node, most daemons will &amp;quot;block&amp;quot;, that is, lock up and stop responding until the issue is resolved. The logic for this is that a locked up cluster is better than a corrupted one.&lt;br /&gt;
&lt;br /&gt;
If any of the fence devices succeed though, the cluster will know that it is safe to proceed and will reconfigure the cluster without the defective node.&lt;br /&gt;
&lt;br /&gt;
=== An Example IPMI Configuration ===&lt;br /&gt;
&lt;br /&gt;
[[IPMI]] is perhaps the most common method used for fencing nodes in a cluster. It requires having a system board with an IPMI baseboard management controller (BMC). IPMI is often the underlying technology used by many OEM-branded remote access tools. If you don&#039;t see a specific fence agent for your server&#039;s remote access application, experiment with generic IPMI tools.&lt;br /&gt;
&lt;br /&gt;
Given the ubiquity of IPMI, I&#039;d like to take the time to walk through configuring and implementing IPMI in a cluster.&lt;br /&gt;
&lt;br /&gt;
IPMI is generally configured using tools provided by the manufacturer of your server. Often there is a web interface with a default IP address, user name and password. In many cases though, you can also configure your IPMI device from the command line using user-space tools. The next section will walk you through an example setup of an IPMI device. If you&#039;ve already configure yours though, note the IP addresses, user names and passwords that you assigned and skip down one section.&lt;br /&gt;
&lt;br /&gt;
==== Configuring IPMI From The Command Line ====&lt;br /&gt;
&lt;br /&gt;
To start, we need to install the IPMI user software.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install ipmitool freeipmi.x86_64 freeipmi-bmc-watchdog.x86_64 freeipmi-ipmidetectd.x86_64 OpenIPMI.x86_64 &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once installed, you should be able to check the local IPMI BMC using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ipmitool&amp;lt;/span&amp;gt; once you&#039;re started the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ipmi&amp;lt;/span&amp;gt; daemon.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/ipmi start&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Starting ipmi drivers:                                     [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ipmitool chassis status&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
System Power         : on&lt;br /&gt;
Power Overload       : false&lt;br /&gt;
Power Interlock      : inactive&lt;br /&gt;
Main Power Fault     : false&lt;br /&gt;
Power Control Fault  : false&lt;br /&gt;
Power Restore Policy : always-off&lt;br /&gt;
Last Power Event     : command&lt;br /&gt;
Chassis Intrusion    : inactive&lt;br /&gt;
Front-Panel Lockout  : inactive&lt;br /&gt;
Drive Fault          : false&lt;br /&gt;
Cooling/Fan Fault    : false&lt;br /&gt;
Front Panel Control  : none&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you see that, you&#039;re doing well. You can now check the current configuration using the following command.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ipmitool -I open lan print 1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Set in Progress         : Set Complete&lt;br /&gt;
Auth Type Support       : NONE MD2 MD5 OEM &lt;br /&gt;
Auth Type Enable        : Callback : NONE MD2 MD5 OEM &lt;br /&gt;
                        : User     : NONE MD2 MD5 OEM &lt;br /&gt;
                        : Operator : NONE MD2 MD5 OEM &lt;br /&gt;
                        : Admin    : NONE MD2 MD5 OEM &lt;br /&gt;
                        : OEM      : &lt;br /&gt;
IP Address Source       : Static Address&lt;br /&gt;
IP Address              : 10.255.128.1&lt;br /&gt;
Subnet Mask             : 255.255.0.0&lt;br /&gt;
MAC Address             : 00:e0:81:aa:bb:cc&lt;br /&gt;
SNMP Community String   : AMI&lt;br /&gt;
IP Header               : TTL=0x00 Flags=0x00 Precedence=0x00 TOS=0x00&lt;br /&gt;
BMC ARP Control         : ARP Responses Disabled, Gratuitous ARP Disabled&lt;br /&gt;
Gratituous ARP Intrvl   : 0.0 seconds&lt;br /&gt;
Default Gateway IP      : 192.168.1.1&lt;br /&gt;
Default Gateway MAC     : 00:00:00:00:00:00&lt;br /&gt;
Backup Gateway IP       : 0.0.0.0&lt;br /&gt;
Backup Gateway MAC      : 00:00:00:00:00:00&lt;br /&gt;
802.1q VLAN ID          : Disabled&lt;br /&gt;
802.1q VLAN Priority    : 0&lt;br /&gt;
RMCP+ Cipher Suites     : 1,2,3,6,7,8,11,12,0,0,0,0,0,0,0,0&lt;br /&gt;
Cipher Suite Priv Max   : aaaaXXaaaXXaaXX&lt;br /&gt;
                        :     X=Cipher Suite Unused&lt;br /&gt;
                        :     c=CALLBACK&lt;br /&gt;
                        :     u=USER&lt;br /&gt;
                        :     o=OPERATOR&lt;br /&gt;
                        :     a=ADMIN&lt;br /&gt;
                        :     O=OEM&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can change the MAC address, but this isn&#039;t advised without a good reason to do so without good reason. That said, here is an example set of commands that will configure, save and then check that the settings took. Adapt the values to suit your environment and preferences.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# Don&#039;t change the MAC without a good reason. If you need to though, this should work.&lt;br /&gt;
#ipmitool -I open lan set 1 macaddr 00:e0:81:aa:bb:cd&lt;br /&gt;
&lt;br /&gt;
# Set the IP to be static (instead of DHCP)&lt;br /&gt;
ipmitool -I open lan set 1 ipsrc static&lt;br /&gt;
&lt;br /&gt;
# Set the IP, default gateway and subnet mask address of the IPMI interface.&lt;br /&gt;
ipmitool -I open lan set 1 ipaddr 192.168.1.171&lt;br /&gt;
ipmitool -I open lan set 1 defgw ipaddr 192.168.1.1&lt;br /&gt;
ipmitool -I open lan set 1 netmask 255.255.255.0&lt;br /&gt;
&lt;br /&gt;
# Set the password.&lt;br /&gt;
ipmitool -I open lan set 1 password secret&lt;br /&gt;
ipmitool -I open user set password 2 secret&lt;br /&gt;
&lt;br /&gt;
# Set the snmp community string, if appropriate&lt;br /&gt;
ipmitool -I open lan set 1 snmp alteeve&lt;br /&gt;
&lt;br /&gt;
# Enable access&lt;br /&gt;
ipmitool -I open lan set 1 access on&lt;br /&gt;
&lt;br /&gt;
# Reset the IPMI BMC to make sure the changes took effect.&lt;br /&gt;
ipmitool mc reset cold&lt;br /&gt;
&lt;br /&gt;
# Wait a few seconds and then re-run the call that dumped the setup to ensure&lt;br /&gt;
# it is now what we want.&lt;br /&gt;
sleep 5&lt;br /&gt;
ipmitool -I open lan print 1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If all went well, you should see the same output as above, but now with your new configuration.&lt;br /&gt;
&lt;br /&gt;
==== Testing IPMI ====&lt;br /&gt;
&lt;br /&gt;
If you skipped the previous step and just want the minimal setup that works, you only need to install one package.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install ipmitool&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Regardless of how you configured your IPMI devices, you will want to test now that you can check the power state of your nodes using the IPMI interface.&lt;br /&gt;
&lt;br /&gt;
You can only query the status of the remote node(s) this way. You can&#039;t use the following command to check your local node.&lt;br /&gt;
&lt;br /&gt;
In the example below, we will check the state of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt; from &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt;. Note that here we use the IP address directly, but in practice I like to use a name that resolves to the IP address of the &#039;&#039;&#039;IPMI&#039;&#039;&#039; interface (denoted by a &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;.ipmi&amp;lt;/span&amp;gt; suffix).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ipmitool -I lan -H 192.168.1.171 -U admin -P secret chassis power status&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Chassis Power is on&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You could replace &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;status&amp;lt;/span&amp;gt; with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;on&amp;lt;/span&amp;gt;, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;off&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cycle&amp;lt;/span&amp;gt; to remotely boot, power off and reboot (power cycle) the node. This is, in fact, what the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fence_ipmilan&amp;lt;/span&amp;gt; fence agent does. If you can afford to stop your servers, it&#039;s a good idea to play with the various &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;power&amp;lt;/span&amp;gt; options to see how the work. There are a few more option than what I mentioned here, which you can read about in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;man ipmitool&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==== Configuring /etc/cluster.conf ====&lt;br /&gt;
&lt;br /&gt;
Lastly, we need to add the IPMI configuration to our &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[cluster.conf]]&amp;lt;/span&amp;gt; file. Note that, unlike with the [[#Using Node Assassin To Demonstrate Fencing |Node Assassin]] setup, there is no &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;port&amp;lt;/span&amp;gt; value in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;device&amp;lt;/span&amp;gt; tag. This is because there is only device controlled by the IPMI BMC; The node itself. The other change is that there are now two &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;fencedevice ... /&amp;gt;&amp;lt;/span&amp;gt; entries; One for each node&#039;s IPMI device. Finally, pay attention to the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;device name=&amp;quot;...&amp;quot;&amp;lt;/span&amp;gt; field. This is an example of where it matters.&lt;br /&gt;
&lt;br /&gt;
Here is an example... &lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;cluster name=&amp;quot;an-cluster&amp;quot; config_version=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;clusternodes&amp;gt;&lt;br /&gt;
        &amp;lt;clusternode name=&amp;quot;an-node01.alteeve.com&amp;quot; nodeid=&amp;quot;1&amp;quot; votes=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
            &amp;lt;fence&amp;gt;&lt;br /&gt;
                &amp;lt;method name=&amp;quot;ipmi&amp;quot;&amp;gt;&lt;br /&gt;
                    &amp;lt;device name=&amp;quot;fence_an01&amp;quot; action=&amp;quot;reboot&amp;quot; /&amp;gt;&lt;br /&gt;
                &amp;lt;/method&amp;gt;&lt;br /&gt;
            &amp;lt;/fence&amp;gt;&lt;br /&gt;
        &amp;lt;/clusternode&amp;gt;&lt;br /&gt;
        &amp;lt;clusternode name=&amp;quot;an-node02.alteeve.com&amp;quot; nodeid=&amp;quot;2&amp;quot; votes=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
            &amp;lt;fence&amp;gt;&lt;br /&gt;
                &amp;lt;method name=&amp;quot;ipmi&amp;quot;&amp;gt;&lt;br /&gt;
                    &amp;lt;device name=&amp;quot;fence_an02&amp;quot; action=&amp;quot;reboot&amp;quot; /&amp;gt;&lt;br /&gt;
                &amp;lt;/method&amp;gt;&lt;br /&gt;
            &amp;lt;/fence&amp;gt;&lt;br /&gt;
        &amp;lt;/clusternode&amp;gt;&lt;br /&gt;
    &amp;lt;/clusternodes&amp;gt;&lt;br /&gt;
    &amp;lt;fencedevices&amp;gt;&lt;br /&gt;
        &amp;lt;fencedevice name=&amp;quot;fence_an01&amp;quot; agent=&amp;quot;fence_ipmilan&amp;quot; ipaddr=&amp;quot;192.168.3.61&amp;quot; login=&amp;quot;admin&amp;quot; passwd=&amp;quot;secret&amp;quot; /&amp;gt;&lt;br /&gt;
        &amp;lt;fencedevice name=&amp;quot;fence_an02&amp;quot; agent=&amp;quot;fence_ipmilan&amp;quot; ipaddr=&amp;quot;192.168.3.62&amp;quot; login=&amp;quot;admin&amp;quot; passwd=&amp;quot;secret&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;/fencedevices&amp;gt;&lt;br /&gt;
&amp;lt;/cluster&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Node Assassin ===&lt;br /&gt;
&lt;br /&gt;
A cheap alternative is the [[Node Assassin]], an open-hardware, open source fence device. It was built to allow the use of commodity system boards that lacked remote management support found on more expensive, server class hardware.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Full Disclosure&#039;&#039;&#039;: Node Assassin was created by me, with much help from others, for this paper.&lt;br /&gt;
&lt;br /&gt;
= Clean Up =&lt;br /&gt;
&lt;br /&gt;
Some daemons may have been installed or dragged in during the setup of the cluster. Most notable is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;heartbeat&amp;lt;/span&amp;gt; which is not compatible with [[RHCS]]. The following command will disable various daemons from starting at boot. &lt;br /&gt;
&lt;br /&gt;
As for the rest of the daemons below, it is safe to run even when the daemons aren&#039;t installed or have already been removed. Of course, skip the ones you actually want to use. This assumes that the nodes have been built according to this HowTo.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
chkconfig heartbeat off; chkconfig iscsid off; chkconfig iptables off; chkconfig ip6tables off&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= So You Have a Cluster - Now What? =&lt;br /&gt;
&lt;br /&gt;
Building the cluster infrastructure was pretty easy, wasn&#039;t it?&lt;br /&gt;
&lt;br /&gt;
But what will you &#039;&#039;&#039;&#039;&#039;do&#039;&#039;&#039;&#039;&#039; with it?&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;width: 75%; text-align: center; padding: 10px; border-spacing: 15px;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!style=&amp;quot;width: 100%; border: 1px solid #dfdfdf;&amp;quot; colspan=&amp;quot;3&amp;quot;|Choose Your Own &amp;lt;span style=&amp;quot;text-decoration: line-through; color: #7f7f7f;&amp;quot;&amp;gt;Adventure&amp;lt;/span&amp;gt; Cluster&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;width: 33%; border: 1px solid #dfdfdf;&amp;quot;| &amp;amp;nbsp;&lt;br /&gt;
|style=&amp;quot;width: 34%; border: 1px solid #dfdfdf;&amp;quot;| [[Two Node Fedora 13 Cluster - Xen-Based Virtual Machine Host on DRBD+CLVM|Xen-Based Virtual Machine Host on DRBD+CLVM]]&amp;lt;br /&amp;gt;High Availability VM Host&lt;br /&gt;
|style=&amp;quot;width: 33%; border: 1px solid #dfdfdf;&amp;quot;| &amp;amp;nbsp;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Thanks =&lt;br /&gt;
&lt;br /&gt;
* A &#039;&#039;&#039;huge&#039;&#039;&#039; thanks to [http://iplink.net Interlink Connectivity]! They hire me as a contractor and have allowed me to extend these docs while working on their clusters. Development of these How-Tos would be much slower if not for them. If you need hosting or colo services, drop them a line. Their website is a bit out of date though, so disregard the prices. :)&lt;br /&gt;
* To &#039;&#039;&#039;sdake&#039;&#039;&#039; of [http://corosync.org corosync] for helping me sort out the &#039;&#039;&#039;plock&#039;&#039;&#039; component and corosync in general.&lt;br /&gt;
* To &#039;&#039;&#039;Angus Salkeld&#039;&#039;&#039; for helping me nail down the Corosync and OpenAIS differences.&lt;br /&gt;
* To [https://lists.linux-foundation.org/pipermail/openais/2010-February/013922.html HJ Lee] from the OpenAIS list for helping me understand the mechanisms controlling the Redundant Ring Protocol&#039;s failure detection types.&lt;br /&gt;
* To [https://lists.linux-foundation.org/pipermail/openais/2010-February/013925.html Steven Dake] for clarifying the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;to_x&amp;lt;/span&amp;gt; vs. &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;logoutput: x&amp;lt;/span&amp;gt; arguments in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;openais.conf&amp;lt;/span&amp;gt;.&lt;br /&gt;
* To [http://dk.linkedin.com/in/fabbione Fabio Massimo Di Nitto] for helping me get caught up with clustering and VMs.&lt;br /&gt;
&lt;br /&gt;
{{footer}}&lt;/div&gt;</summary>
		<author><name>SRSullivan</name></author>
	</entry>
	<entry>
		<id>https://alteeve.com/w/index.php?title=User:SRSullivan&amp;diff=1984</id>
		<title>User:SRSullivan</title>
		<link rel="alternate" type="text/html" href="https://alteeve.com/w/index.php?title=User:SRSullivan&amp;diff=1984"/>
		<updated>2010-08-23T03:59:48Z</updated>

		<summary type="html">&lt;p&gt;SRSullivan: Initial Content&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Scott Sullivan =&lt;br /&gt;
[[File:Profile_Photo_Scott_Sullivan.jpg|thumb|left|Profile Photo for Scott Sullivan]]&lt;/div&gt;</summary>
		<author><name>SRSullivan</name></author>
	</entry>
	<entry>
		<id>https://alteeve.com/w/index.php?title=File:Profile_Photo_Scott_Sullivan.jpg&amp;diff=1983</id>
		<title>File:Profile Photo Scott Sullivan.jpg</title>
		<link rel="alternate" type="text/html" href="https://alteeve.com/w/index.php?title=File:Profile_Photo_Scott_Sullivan.jpg&amp;diff=1983"/>
		<updated>2010-08-23T03:55:22Z</updated>

		<summary type="html">&lt;p&gt;SRSullivan: Profile Photo for Scott Sullivan&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Profile Photo for Scott Sullivan&lt;/div&gt;</summary>
		<author><name>SRSullivan</name></author>
	</entry>
</feed>