<?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=Kiwi</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=Kiwi"/>
	<link rel="alternate" type="text/html" href="https://alteeve.com/w/Special:Contributions/Kiwi"/>
	<updated>2026-04-29T14:29:51Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.42.3</generator>
	<entry>
		<id>https://alteeve.com/w/index.php?title=Red_Hat_Cluster_Service_2_Tutorial_-_Archive&amp;diff=3603</id>
		<title>Red Hat Cluster Service 2 Tutorial - Archive</title>
		<link rel="alternate" type="text/html" href="https://alteeve.com/w/index.php?title=Red_Hat_Cluster_Service_2_Tutorial_-_Archive&amp;diff=3603"/>
		<updated>2011-08-22T16:55:17Z</updated>

		<summary type="html">&lt;p&gt;Kiwi: /* Changing the Default Run-Level */ s/Simple/Simply/&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{howto_header}}&lt;br /&gt;
&lt;br /&gt;
This paper has one goal;&lt;br /&gt;
&lt;br /&gt;
* Creating a 2-node, high-availability cluster hosting [[Xen]] virtual machines using [[RHCS]] &amp;quot;stable 2&amp;quot; with [[DRBD]] and clustered [[LVM]] for synchronizing storage data.&lt;br /&gt;
&lt;br /&gt;
We&#039;ll create a dedicated firewall VM to isolate and protect the VM network, discuss provisioning and maintaining Xen VMs, explore some basics of daily administration of a VM cluster and test various failures and how to recover from them.&lt;br /&gt;
&lt;br /&gt;
Grab a coffee, a comfy chair, put on some nice music and settle in for some geekly fun.&lt;br /&gt;
&lt;br /&gt;
= The Task Ahead =&lt;br /&gt;
&lt;br /&gt;
Before we start, let&#039;s take a few minutes to discuss clustering and it&#039;s complexities.&lt;br /&gt;
&lt;br /&gt;
== Technologies We Will Use ==&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;Enterprise Linux 5&#039;&#039;; specifically we will be using [[CentOS]] v5.6.&lt;br /&gt;
* &#039;&#039;Red Hat Cluster Services&#039;&#039; &amp;quot;Stable&amp;quot; version 2. This describes the following core components:&lt;br /&gt;
** &#039;&#039;OpenAIS&#039;&#039;; Provides cluster communications using the [[totem]] protocol.&lt;br /&gt;
** &#039;&#039;Cluster Manager&#039;&#039; (&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[cman]]&amp;lt;/span&amp;gt;); Manages the starting, stopping and managing of the cluster.&lt;br /&gt;
** &#039;&#039;Resource Manager&#039;&#039; (&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[rgmanager]]&amp;lt;/span&amp;gt;); Manages cluster resources and services. Handles service recovery during failures.&lt;br /&gt;
** &#039;&#039;Cluster Logical Volume Manager&#039;&#039; (&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[clvm]]&amp;lt;/span&amp;gt;); Cluster-aware (disk) volume manager. Backs [[GFS2]] [[filesystem]]s and [[Xen]] virtual machines.&lt;br /&gt;
** &#039;&#039;Global File Systems&#039;&#039; version 2 (&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[gfs2]]&amp;lt;/span&amp;gt;); Cluster-aware, concurrently mountable file system.&lt;br /&gt;
* &#039;&#039;Distributed Redundant Block Device&#039;&#039; ([[DRBD]]); Keeps shared data synchronized across cluster nodes.&lt;br /&gt;
* &#039;&#039;Xen&#039;&#039;; [[Hypervisor]] that controls and supports virtual machines.&lt;br /&gt;
&lt;br /&gt;
== A Note on Patience ==&lt;br /&gt;
&lt;br /&gt;
There is nothing inherently hard about clustering. However, there are many components that you need to understand before you can begin. The result is that clustering has an inherently steep learning curve.&lt;br /&gt;
&lt;br /&gt;
You &#039;&#039;&#039;must&#039;&#039;&#039; have patience. Lots of it.&lt;br /&gt;
&lt;br /&gt;
Many technologies can be learned by creating a very simple base and then building on it. The classic &amp;quot;Hello, World!&amp;quot; script created when first learning a programming language is an example of this. Unfortunately, there is no real analog to this in clustering. Even the most basic cluster requires several pieces be in place and working together. If you try to rush by ignoring pieces you think are not important, you will almost certainly waste time. A good example is setting aside [[fencing]], thinking that your test cluster&#039;s data isn&#039;t important. The cluster software has no concept of &amp;quot;test&amp;quot;. It treats everything as critical all the time and &#039;&#039;will&#039;&#039; shut down if anything goes wrong.&lt;br /&gt;
&lt;br /&gt;
Take your time, work through these steps, and you will have the foundation cluster sooner than you realize. Clustering is fun &#039;&#039;&#039;because&#039;&#039;&#039; it is a challenge.&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
&lt;br /&gt;
It is assumed that you are familiar with Linux systems administration, specifically [[Red Hat]] [[EL|Enterprise Linux]] and its derivatives. You will need to have somewhat advanced networking experience as well. You should be comfortable working in a terminal (directly or over &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[ssh]]&amp;lt;/span&amp;gt;). Familiarity with [[XML]] will help, but is not terribly required as it&#039;s use here is pretty self-evident.&lt;br /&gt;
&lt;br /&gt;
If you feel a little out of depth at times, don&#039;t hesitate to set this tutorial aside. Branch over to the components you feel the need to study more, then return and continue on. Finally, and perhaps most importantly, you &#039;&#039;&#039;must&#039;&#039;&#039; have patience! If you have a manager asking you to &amp;quot;go live&amp;quot; with a cluster in a month, tell him or her that it simply won&#039;t happen. If you rush, you will skip important points and &#039;&#039;&#039;you will fail&#039;&#039;&#039;. Patience is vastly more important than any pre-existing skill. &lt;br /&gt;
&lt;br /&gt;
== Focus and Goal ==&lt;br /&gt;
&lt;br /&gt;
There is a different cluster for every problem. Generally speaking though, there are two main problems that clusters try to resolve; Performance and High Availability. Performance clusters are generally tailored to the application requiring the performance increase. There are some general tools for performance clustering, like [[Red Hat]]&#039;s [[LVS]] (Linux Virtual Server) for load-balancing common applications like the [[Apache]] web-server. &lt;br /&gt;
&lt;br /&gt;
This tutorial will focus on High Availability clustering, often shortened to simply &#039;&#039;&#039;HA&#039;&#039;&#039; and not to be confused with the [[Linux-HA]] &amp;quot;heartbeat&amp;quot; cluster suite, which we will not be using here. The cluster will provide a shared file systems and will provide for the high availability on [[Xen]]-based virtual servers. The goal will be to have the virtual servers live-migrate during planned node outages and automatically restart on a surviving node when the original host node fails.&lt;br /&gt;
&lt;br /&gt;
Below is a &#039;&#039;very&#039;&#039; brief overview;&lt;br /&gt;
&lt;br /&gt;
High Availability clusters like ours have two main parts; Cluster management and resource management.&lt;br /&gt;
&lt;br /&gt;
The cluster itself is responsible for maintaining the cluster nodes in a group. This group is part of a &amp;quot;Closed Process Group&amp;quot;, or [[CPG]]. When a node fails, the cluster manager must detect the failure, reliably eject the node from the cluster using fencing and then reform the CPG. Each time the cluster changes, or &amp;quot;re-forms&amp;quot;, the resource manager is called. The resource manager checks to see how the cluster changed, consults it&#039;s configuration and determines what to do, if anything.&lt;br /&gt;
&lt;br /&gt;
The details of all this will be discussed in detail a little later on. For now, it&#039;s sufficient to have in mind these two major roles and understand that they are somewhat independent entities.&lt;br /&gt;
&lt;br /&gt;
== Platform ==&lt;br /&gt;
&lt;br /&gt;
This tutorial was written using [[CentOS]] version 5.6, [[x86_64]]. No attempt was made to test on [[i686]] or other [[EL5]] derivatives. That said, there is no reason to believe that this tutorial will not apply to any variant. As much as possible, the language will be distro-agnostic. For reasons of memory constraints, it is advised that you use an [[x86_64]] (64-[[bit]]) platform if at all possible.&lt;br /&gt;
&lt;br /&gt;
Do note that as of [[EL5]].4 and above, significant changes were made to how [[RHCS]] handles virtual machines. It is strongly advised that you use at least version 5.4 or newer while working with this tutorial.&lt;br /&gt;
&lt;br /&gt;
== A Word On Complexity ==&lt;br /&gt;
&lt;br /&gt;
Introducing the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Fabbione Principle&amp;lt;/span&amp;gt; (aka: &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fabimer theory&amp;lt;/span&amp;gt;):&lt;br /&gt;
&lt;br /&gt;
Clustering is not inherently hard, but it is inherently complex. Consider;&lt;br /&gt;
&lt;br /&gt;
* Any given program has &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;N&amp;lt;/span&amp;gt; bugs.&lt;br /&gt;
** [[RHCS]] uses; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt;, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;openais&amp;lt;/span&amp;gt;, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;totem&amp;lt;/span&amp;gt;, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fenced&amp;lt;/span&amp;gt;, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;dlm&amp;lt;/span&amp;gt;.&lt;br /&gt;
** We will be adding &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;GFS2&amp;lt;/span&amp;gt;, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;CLVM&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Xen&amp;lt;/span&amp;gt;.&lt;br /&gt;
** Right there, we have &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;N^10&amp;lt;/span&amp;gt; possible bugs. We&#039;ll call this &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;A&amp;lt;/span&amp;gt;.&lt;br /&gt;
* A cluster has &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Y&amp;lt;/span&amp;gt; nodes.&lt;br /&gt;
** In our case, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;2&amp;lt;/span&amp;gt; nodes, each with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;3&amp;lt;/span&amp;gt; networks.&lt;br /&gt;
** The network infrastructure (Switches, routers, etc). If you use managed switches, add another layer of complexity.&lt;br /&gt;
** This gives us another &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Y^(2*3)&amp;lt;/span&amp;gt;, and then &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;^2&amp;lt;/span&amp;gt; again for managed switches. We&#039;ll call this &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;B&amp;lt;/span&amp;gt;.&lt;br /&gt;
* Let&#039;s add the human factor. Let&#039;s say that a person needs roughly 5 years of cluster experience to be considered an expert. For each year less than this, add a &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Z&amp;lt;/span&amp;gt; &amp;quot;oops&amp;quot; factor, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;(5-Z)^2&amp;lt;/span&amp;gt;. We&#039;ll call this &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;C&amp;lt;/span&amp;gt;.&lt;br /&gt;
* So, finally, add up the complexity, using this tutorial&#039;s layout, 0-years of experience and managed switches.&lt;br /&gt;
** &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;(N^10) * (Y^(2*3)^2) * ((5-0)^2) == (A * B * C)&amp;lt;/span&amp;gt; == an-unknown-but-big-number.&lt;br /&gt;
&lt;br /&gt;
This isn&#039;t meant to scare you away, but it is meant to be a sobering statement. Obviously, those numbers are somewhat artificial, but the point remains.&lt;br /&gt;
&lt;br /&gt;
Any one piece is easy to understand, thus, clustering is inherently easy. However, given the large number of variables, you must really understand all the pieces and how they work together. &#039;&#039;&#039;&#039;&#039;DO NOT&#039;&#039;&#039;&#039;&#039; think that you will have this mastered and working in a month. Certainly don&#039;t try to sell clusters as a service without a &#039;&#039;lot&#039;&#039; of internal testing.&lt;br /&gt;
&lt;br /&gt;
Clustering is kind of like chess. The rules are pretty straight forward, but the complexity can take some time to master.&lt;br /&gt;
&lt;br /&gt;
= Overview of Components =&lt;br /&gt;
&lt;br /&gt;
When looking at a cluster, there is a tendency to want to dive right into the configuration file. That is not very useful in clustering.&lt;br /&gt;
&lt;br /&gt;
* When you look at the configuration file, it is quite short.&lt;br /&gt;
&lt;br /&gt;
It isn&#039;t like most applications or technologies though. Most of us learn by taking something, like a configuration file, and tweaking it this way and that to see what happens. I tried that with clustering and learned only what it was like to bang my head against the wall.&lt;br /&gt;
&lt;br /&gt;
* Understanding the parts and how they work together is critical.&lt;br /&gt;
&lt;br /&gt;
You will find that the discussion on the components of clustering, and how those components and concepts interact, will be much longer than the initial configuration. It is true that we could talk very briefly about the actual syntax, but it would be a disservice. Please, don&#039;t rush through the next section or, worse, skip it and go right to the configuration. You will waste far more time than you will save.&lt;br /&gt;
&lt;br /&gt;
* Clustering is easy, but it has a complex web of inter-connectivity. You must grasp this network if you want to be an effective cluster administrator!&lt;br /&gt;
&lt;br /&gt;
== Component; cman ==&lt;br /&gt;
&lt;br /&gt;
This was, traditionally, the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;c&amp;lt;/span&amp;gt;luster &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;man&amp;lt;/span&amp;gt;ager. In the 3.0 series, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt; acts mainly as a [[quorum]] provider, tallying votes and deciding on a critical property of the cluster: quorum. In the 3.1 series, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt; will be removed entirely.&lt;br /&gt;
&lt;br /&gt;
== Component; openais / corosync ==&lt;br /&gt;
&lt;br /&gt;
OpenAIS is the heart of the cluster. All other computers operate though this component, and no cluster component can work without it. Further, it is shared between both Pacemaker and RHCS clusters.&lt;br /&gt;
&lt;br /&gt;
In Red Hat clusters, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;openais&amp;lt;/span&amp;gt; is configured via the central &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cluster.conf&amp;lt;/span&amp;gt; file. In Pacemaker clusters, it is configured directly in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;openais.conf&amp;lt;/span&amp;gt;. As we will be building an RHCS, we will only use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cluster.conf&amp;lt;/span&amp;gt;. That said, (almost?) all &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;openais.conf&amp;lt;/span&amp;gt; options are available in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cluster.conf&amp;lt;/span&amp;gt;. This is important to note as you will see references to both configuration files when searching the Internet.&lt;br /&gt;
&lt;br /&gt;
=== A Little History ===&lt;br /&gt;
&lt;br /&gt;
There were significant changes between [[RHCS]] version 2, which we are using, and version 3 available on [[EL6]] and recent [[Fedora]]s.&lt;br /&gt;
&lt;br /&gt;
In the RHCS version 2, there was a component called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;openais&amp;lt;/span&amp;gt; which handled &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;totem&amp;lt;/span&amp;gt;. The OpenAIS project was designed to be the heart of the cluster and was based around the [http://www.saforum.org/ Service Availability Forum]&#039;s [http://www.saforum.org/Application-Interface-Specification~217404~16627.htm Application Interface Specification]. AIS is an open [[API]] designed to provide inter-operable high availability services.&lt;br /&gt;
&lt;br /&gt;
In 2008, it was decided that the AIS specification was overkill for most clustered applications being developed in the open source community.  At that point, OpenAIS was split in to two projects: Corosync and OpenAIS. The former, Corosync, provides cluster membership, messaging, and basic APIs for use by clustered applications, while the OpenAIS project is specifically designed to act as an optional add-on to corosync for users who want AIS functionality.&lt;br /&gt;
&lt;br /&gt;
You will see a lot of references to OpenAIS while searching the web for information on clustering. Understanding it&#039;s evolution will hopefully help you avoid confusion.&lt;br /&gt;
&lt;br /&gt;
== Concept; quorum ==&lt;br /&gt;
&lt;br /&gt;
[[Quorum]] is defined as the minimum set of hosts required in order to provide service and is used to prevent split-brain situations.&lt;br /&gt;
&lt;br /&gt;
The quorum algorithm used by the RHCS cluster is called &amp;quot;simple majority quorum&amp;quot;, which means that more than half of the hosts must be online and communicating in order to provide service. While simple majority quorum a very common quorum algorithm, other quorum algorithms exist ([[grid quorum]], [[YKD Dyanamic Linear Voting]], etc.).&lt;br /&gt;
&lt;br /&gt;
The idea behind quorum is that, which ever group of machines has it, can safely start clustered services even when defined members are not accessible.&lt;br /&gt;
&lt;br /&gt;
Take this scenario;&lt;br /&gt;
&lt;br /&gt;
* You have a cluster of four nodes, each with one vote.&lt;br /&gt;
** The cluster&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;expected_votes&amp;lt;/span&amp;gt; is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;4&amp;lt;/span&amp;gt;. A clear majority, in this case, is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;3&amp;lt;/span&amp;gt; because &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;(4/2)+1&amp;lt;/span&amp;gt;, rounded down, is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;3&amp;lt;/span&amp;gt;.&lt;br /&gt;
** Now imagine that there is a failure in the network equipment and one of the nodes disconnects from the rest of the cluster.&lt;br /&gt;
** You now have two partitions; One partition contains three machines and the other partition has one.&lt;br /&gt;
** The three machines will have quorum, and the other machine will lose quorum.&lt;br /&gt;
** The partition with quorum will reconfigure and continue to provide cluster services.&lt;br /&gt;
** The partition without quorum will withdraw from the cluster and shut down all cluster services.&lt;br /&gt;
&lt;br /&gt;
When the cluster reconfigures and the partition wins quorum, it will fence the node(s) in the partition without quorum. Once the fencing hes been confirmed successful, the partition with quorum will begin accessing clustered resources, like shared filesystems, thus guaranteeing the safety of those shared resources.&lt;br /&gt;
&lt;br /&gt;
This also helps explain why an even &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;50%&amp;lt;/span&amp;gt; is not enough to have quorum, a common question for people new to clustering. Using the above scenario, imagine if the split were 2 and 2 nodes. Because either can&#039;t be sure what the other would do, neither can safely proceed. If we allowed an even 50% to have quorum, both partition might try to take over the clustered services and disaster would soon follow.&lt;br /&gt;
&lt;br /&gt;
There is one, and &#039;&#039;&#039;only&#039;&#039;&#039; one except to this rule.&lt;br /&gt;
&lt;br /&gt;
In the case of a two node cluster, as we will be building here, any failure results in a 50/50 split. If we enforced quorum in a two-node cluster, there would never be high availability because and failure would cause both nodes to withdraw. The risk with this exception is that we now place the entire safety of the cluster on [[fencing]], a concept we will cover in a second. Fencing is a second line of defense and something we are loath to rely on alone.&lt;br /&gt;
&lt;br /&gt;
Even in a two-node cluster though, proper quorum can be maintained by using a quorum disk, called a [[qdisk]]. Unfortunately, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;qdisk&amp;lt;/span&amp;gt; on a [[DRBD]] resource comes with it&#039;s own problems, so we will not be able to use it here.&lt;br /&gt;
&lt;br /&gt;
== Concept; Virtual Synchrony ==&lt;br /&gt;
&lt;br /&gt;
All cluster operations, like fencing, distributed locking and so on, have to occur in the same order across all nodes. This concept is called &amp;quot;virtual synchrony&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
This is provided by &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;openais&amp;lt;/span&amp;gt; using &amp;quot;closed process groups&amp;quot;, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[CPG]]&amp;lt;/span&amp;gt;. A closed process group is simply a private group of processes in a cluster. Within this closed group, all messages are ordered and consistent.&lt;br /&gt;
&lt;br /&gt;
Let&#039;s look at how locks are handled on clustered file systems as an example.&lt;br /&gt;
&lt;br /&gt;
* As various nodes want to work on files, they send a lock request to the cluster. When they are done, they send a lock release to the cluster.&lt;br /&gt;
** Lock and unlock messages must arrive in the same order to all nodes, regardless of the real chronological order that they were issued.&lt;br /&gt;
* Let&#039;s say one node sends out messages &amp;quot;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;a1 a2 a3 a4&amp;lt;/span&amp;gt;&amp;quot;. Meanwhile, the other node sends out &amp;quot;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;b1 b2 b3 b4&amp;lt;/span&amp;gt;&amp;quot;.&lt;br /&gt;
** All of these messages go to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;openais&amp;lt;/span&amp;gt; which gathers them up, puts them into an order and then sends them out in that order.&lt;br /&gt;
** It is totally possible that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;openais&amp;lt;/span&amp;gt; will get the messages as &amp;quot;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;a2 b1 b2 a1 b4 a3 a4 b4&amp;lt;/span&amp;gt;&amp;quot;. What order is used is not important, only that the order is consistent across all nodes.&lt;br /&gt;
** The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;openais&amp;lt;/span&amp;gt; application will then ensure that all nodes get the messages in the above order, one at a time. All nodes must confirm that they got a given message before the next message is sent to any node.&lt;br /&gt;
&lt;br /&gt;
All of this ordering, within the closed process group, is &amp;quot;virtual synchrony&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
This will tie into fencing and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;totem&amp;lt;/span&amp;gt;, as we&#039;ll see in the next sections.&lt;br /&gt;
&lt;br /&gt;
== Concept; Fencing ==&lt;br /&gt;
&lt;br /&gt;
Fencing is a &#039;&#039;&#039;absolutely critical&#039;&#039;&#039; part of clustering. Without &#039;&#039;&#039;fully&#039;&#039;&#039; working fence devices, &#039;&#039;&#039;&#039;&#039;your cluster will fail&#039;&#039;&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Was that strong enough, or should I say that again? Let&#039;s be safe:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;DO NOT BUILD A CLUSTER WITHOUT PROPER, WORKING AND TESTED FENCING&#039;&#039;&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Sorry, I promise that this will be the only time that I speak so strongly. Fencing really is critical, and explaining the need for fencing is nearly a weekly event. &lt;br /&gt;
&lt;br /&gt;
So then, let&#039;s discuss fencing.&lt;br /&gt;
&lt;br /&gt;
When a node stops responding, an internal timeout and counter start ticking away. During this time, no messages are moving through the cluster because virtual synchrony is no longer possible and the cluster is, essentially, hung. If the node responds in time, the timeout and counter reset and the cluster begins operating properly again. &lt;br /&gt;
&lt;br /&gt;
If, on the other hand, the node does not respond in time, the node will be declared dead and the process of ejecting it from the cluster begins. &lt;br /&gt;
&lt;br /&gt;
The cluster will take a &amp;quot;head count&amp;quot; to see which nodes it still has contact with and will determine then if there are enough votes from those nodes to have quorum. If you are using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[qdisk]]&amp;lt;/span&amp;gt;, it&#039;s heuristics will run and then it&#039;s votes will be added. If there is sufficient votes for quorum, the cluster will issue a &amp;quot;fence&amp;quot; against the lost node. A fence action is a call sent to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fenced&amp;lt;/span&amp;gt;, the fence daemon. &lt;br /&gt;
&lt;br /&gt;
Which physical node sends the fence call is somewhat random and irrelevant. What matters is that the call comes from the [[CPG]] which has quorum.&lt;br /&gt;
&lt;br /&gt;
The fence daemon will look at the cluster configuration and get the fence devices configured for the dead node. Then, one at a time and in the order that they appear in the configuration, the fence daemon will call those fence devices, via their fence agents, passing to the fence agent any configured arguments like username, password, port number and so on. If the first fence agent returns a failure, the next fence agent will be called. If the second fails, the third will be called, then the forth and so on. Once the last (or perhaps only) fence device fails, the fence daemon will retry again, starting back at the start of the list. It will do this indefinitely until one of the fence devices success.&lt;br /&gt;
&lt;br /&gt;
Here&#039;s the flow, in point form:&lt;br /&gt;
&lt;br /&gt;
* The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;openais&amp;lt;/span&amp;gt; program collects messages and sends them off, one at a time, to all nodes.&lt;br /&gt;
* All nodes respond, and the next message is sent. Repeat continuously during normal operation.&lt;br /&gt;
* Suddenly, one node stops responding.&lt;br /&gt;
** Communication freezes while the cluster waits for the silent node. &lt;br /&gt;
** A timeout starts (~&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;238&amp;lt;/span&amp;gt;ms by default), and each time the timeout is hit, and error counter increments.&lt;br /&gt;
** The silent node responds before the counter reaches the limit.&lt;br /&gt;
*** The counter is reset to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;0&amp;lt;/span&amp;gt;&lt;br /&gt;
*** The cluster operates normally again.&lt;br /&gt;
* Again, one node stops responding.&lt;br /&gt;
** Again, the timeout begins. As each totem packet times out, a new packet is sent and the error count increments.&lt;br /&gt;
** The error counts exceed the limit (&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;4&amp;lt;/span&amp;gt; errors is the default); Roughly one second has passed (&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;238ms * 4&amp;lt;/span&amp;gt; plus some overhead).&lt;br /&gt;
** The node is declared dead.&lt;br /&gt;
** The cluster checks which members it still has, and if that provides enough votes for quorum.&lt;br /&gt;
*** If there are too few votes for quorum, the cluster software freezes and the node(s) withdraw from the cluster.&lt;br /&gt;
*** If there are enough votes for quorum, the silent node is declared dead.&lt;br /&gt;
**** &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;openais&amp;lt;/span&amp;gt; calls &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fenced&amp;lt;/span&amp;gt;, telling it to fence the node.&lt;br /&gt;
**** Which fence device(s) to use, that is, what &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fence_agent&amp;lt;/span&amp;gt; to call and what arguments to pass, is gathered.&lt;br /&gt;
**** For each configured fence device:&lt;br /&gt;
***** The agent is called and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fenced&amp;lt;/span&amp;gt; waits for the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fence_agent&amp;lt;/span&amp;gt; to exit.&lt;br /&gt;
***** The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fence_agent&amp;lt;/span&amp;gt;&#039;s exit code is examined. If it&#039;s a success, recovery starts. If it failed, the next configured fence agent is called.&lt;br /&gt;
**** If all (or the only) configured fence fails, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fenced&amp;lt;/span&amp;gt; will start over.&lt;br /&gt;
**** &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fenced&amp;lt;/span&amp;gt; will wait and loop forever until a fence agent succeeds. During this time, &#039;&#039;&#039;the cluster is hung&#039;&#039;&#039;.&lt;br /&gt;
** Once a &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fence_agent&amp;lt;/span&amp;gt; succeeds, the cluster is reconfigured.&lt;br /&gt;
*** A new closed process group (&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cpg&amp;lt;/span&amp;gt;) is formed.&lt;br /&gt;
*** A new fence domain is formed.&lt;br /&gt;
*** Lost cluster resources are recovered as per &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt;&#039;s configuration (including file system recovery as needed).&lt;br /&gt;
*** Normal cluster operation is restored.&lt;br /&gt;
&lt;br /&gt;
This skipped a few key things, but the general flow of logic should be there.&lt;br /&gt;
&lt;br /&gt;
This is why fencing is so important. Without a properly configured and tested fence device or devices, the cluster will never successfully fence and the cluster will stay hung forever.&lt;br /&gt;
&lt;br /&gt;
== Component; totem ==&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[totem]]&amp;lt;/span&amp;gt; protocol defines message passing within the cluster and it is used by &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;openais&amp;lt;/span&amp;gt;. A token is passed around all the nodes in the cluster, and the timeout discussed in [[Red_Hat_Cluster_Service_3_Tutorial#Concept;_Fencing|fencing]] above is actually a token timeout. The counter, then, is the number of lost tokens that are allowed before a node is considered dead.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;totem&amp;lt;/span&amp;gt; protocol supports something called &#039;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rrp&amp;lt;/span&amp;gt;&#039;, &#039;&#039;&#039;R&#039;&#039;&#039;edundant &#039;&#039;&#039;R&#039;&#039;&#039;ing &#039;&#039;&#039;P&#039;&#039;&#039;rotocol. Through &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rrp&amp;lt;/span&amp;gt;, you can add a second backup ring on a separate network to take over in the event of a failure in the first ring. In RHCS, these rings are known as &amp;quot;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ring 0&amp;lt;/span&amp;gt;&amp;quot; and &amp;quot;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ring 1&amp;lt;/span&amp;gt;&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
== Component; rgmanager ==&lt;br /&gt;
&lt;br /&gt;
When the cluster membership changes, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;openais&amp;lt;/span&amp;gt; tells the cluster that it needs to recheck it&#039;s resources. This causes &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt;, the resource group manager, to run. It will examine what changed and then will start, stop, migrate or recover cluster resources as needed.&lt;br /&gt;
&lt;br /&gt;
Within &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt;, one or more &#039;&#039;resources&#039;&#039; are brought together as a &#039;&#039;service&#039;&#039;. This service is then optionally assigned to a &#039;&#039;failover domain&#039;&#039;, an subset of nodes that can have preferential ordering.&lt;br /&gt;
&lt;br /&gt;
== Component; qdisk ==&lt;br /&gt;
&lt;br /&gt;
{{note|1=&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;qdisk&amp;lt;/span&amp;gt; does not work reliably on a DRBD resource, so we will not be using it in this tutorial.}}&lt;br /&gt;
&lt;br /&gt;
A Quorum disk, known as a &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;qdisk&amp;lt;/span&amp;gt; is small partition on [[SAN]] storage used to enhance quorum. It generally carries enough votes to allow even a single node to take quorum during a cluster partition. It does this by using configured heuristics, that is custom tests, to decided which which node or partition is best suited for providing clustered services during a cluster reconfiguration. These heuristics can be simple, like testing which partition has access to a given router, or they can be as complex as the administrator wishes using custom scripts.&lt;br /&gt;
&lt;br /&gt;
Though we won&#039;t be using it here, it is well worth knowing about when you move to a cluster with [[SAN]] storage.&lt;br /&gt;
&lt;br /&gt;
== Component; DRBD ==&lt;br /&gt;
&lt;br /&gt;
[[DRBD]]; Distributed Replicating Block Device, is a technology that takes raw storage from two or more nodes and keeps their data synchronized in real time. It is sometimes described as &amp;quot;RAID 1 over Nodes&amp;quot;, and that is conceptually accurate. In this tutorial&#039;s cluster, DRBD will be used to provide that back-end storage as a cost-effective alternative to a tranditional [[SAN]] or [[iSCSI]] device.&lt;br /&gt;
&lt;br /&gt;
To help visualize DRBD&#039;s use and role, Take a look at how we will implement our [[Red Hat Cluster Service 2 Tutorial#Visualizing Storage|cluster&#039;s storage]]. Don&#039;t worry if this seems illogical at this stage. The main thing to look at are the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;drbdX&amp;lt;/span&amp;gt; devices and how they each tie back to a corresponding &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;sdaY&amp;lt;/span&amp;gt; device on either node.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
         [ an-node04 ]&lt;br /&gt;
  ______   ______    ______     __[sda4]__&lt;br /&gt;
 | sda1 | | sda2 |  | sda3 |   |  ______  |       _______    ______________    ______________________________&lt;br /&gt;
 |______| |______|  |______|   | | sda5 |-+------| drbd0 |--| drbd_sh0_vg0 |--| /dev/drbd_sh0_vg0/xen_shared |&lt;br /&gt;
     |        |         |      | |______| |   /--|_______|  |______________|  |______________________________|&lt;br /&gt;
  ___|___    _|_    ____|____  |  ______  |   |     _______    ______________    ____________________________&lt;br /&gt;
 | /boot |  | / |  | &amp;lt;swap&amp;gt;  | | | sda6 |-+---+----| drbd1 |--| drbd_an4_vg0 |--| /dev/drbd_an4_vg0/vm0001_1 |&lt;br /&gt;
 |_______|  |___|  |_________| | |______| |   | /--|_______|  |______________|  |____________________________|&lt;br /&gt;
                               |  ______  |   | |     _______    ______________    ____________________________&lt;br /&gt;
                               | | sda7 |-+---+-+----| drbd2 |--| drbd_an5_vg0 |--| /dev/drbd_an4_vg0/vm0002_1 | &lt;br /&gt;
                               | |______| |   | | /--|_______|  |______________|  |____________________________|&lt;br /&gt;
                               |  ______  |   | | |                         | |    _______________________&lt;br /&gt;
                               | | sda8 |-+---+-+-+--\                      | \---| Example LV for 2nd VM |&lt;br /&gt;
                               | |______| |   | | |  |                      |     |_______________________|&lt;br /&gt;
                               |__________|   | | |  |                      |      _______________________&lt;br /&gt;
         [ an-node05 ]                        | | |  |                      \-----| Example LV for 3rd VM |&lt;br /&gt;
  ______   ______    ______     __[sda4]__    | | |  |                            |_______________________|&lt;br /&gt;
 | sda1 | | sda2 |  | sda3 |   |  ______  |   | | |  |                   &lt;br /&gt;
 |______| |______|  |______|   | | sda5 |-+---/ | |  |   _______    __________________&lt;br /&gt;
     |        |         |      | |______| |     | |  \--| drbd3 |--| Spare PV for     |&lt;br /&gt;
  ___|___    _|_    ____|____  |  ______  |     | |  /--|_______|  | future expansion |&lt;br /&gt;
 | /boot |  | / |  | &amp;lt;swap&amp;gt;  | | | sda6 |-+-----/ |  |             |__________________|&lt;br /&gt;
 |_______|  |___|  |_________| | |______| |       |  |&lt;br /&gt;
                               |  ______  |       |  |&lt;br /&gt;
                               | | sda7 |-+-------/  |&lt;br /&gt;
                               | |______| |          |&lt;br /&gt;
                               |  ______  |          |&lt;br /&gt;
                               | | sda8 |-+----------/&lt;br /&gt;
                               | |______| |&lt;br /&gt;
                               |__________|&lt;br /&gt;
.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Component; CLVM ==&lt;br /&gt;
&lt;br /&gt;
With [[DRBD]] providing the raw storage for the cluster, we must next consider partitions. This is where Clustered [[LVM]], known as [[CLVM]], comes into play.&lt;br /&gt;
&lt;br /&gt;
CLVM is ideal in that by using [[DLM]], the distributed lock manager, it won&#039;t allow access to cluster members outside of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;openais&amp;lt;/span&amp;gt;&#039;s closed process group, which, in turn, requires quorum.&lt;br /&gt;
&lt;br /&gt;
It is ideal because it can take one or more raw devices, known as &amp;quot;physical volumes&amp;quot;, or simple as [[PV]]s, and combine their raw space into one or more &amp;quot;volume groups&amp;quot;, known as [[VG]]s. These volume groups then act just like a typical hard drive and can be &amp;quot;partitioned&amp;quot; into one or more &amp;quot;logical volumes&amp;quot;, known as [[LV]]s. These LVs are where [[Xen]]&#039;s [[domU]] virtual machines will exist and where we will create our [[GFS2]] clustered file system.&lt;br /&gt;
&lt;br /&gt;
LVM is particularly attractive because of how incredibly flexible it is. We can easily add new physical volumes later, and then grow an existing volume group to use the new space. This new space can then be given to existing logical volumes, or entirely new logical volumes can be created. This can all be done while the cluster is online offering an upgrade path with no down time.&lt;br /&gt;
&lt;br /&gt;
== Component; GFS2 ==&lt;br /&gt;
&lt;br /&gt;
With [[DRBD]] providing the clusters raw storage space, and [[CLVM|Clustered LVM]] providing the logical partitions, we can now look at the clustered file system. This is the role of the Global File System version 2, known simply as [[GFS2]].&lt;br /&gt;
&lt;br /&gt;
It works much like standard filesystem, with user-land tools like &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;mkfs.gfs2&amp;lt;/span&amp;gt;, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fsck.gfs2&amp;lt;/span&amp;gt; and so on. The major difference is that it and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clvmd&amp;lt;/span&amp;gt; use the cluster&#039;s [[DLM|distributed locking mechanism]] provided by the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;dlm_controld&amp;lt;/span&amp;gt; daemon. Once formatted, the GFS2-formatted partition can be mounted and used by any node in the cluster&#039;s [[CPG|closed process group]]. All nodes can then safely read from and write to the data on the partition simultaneously.&lt;br /&gt;
&lt;br /&gt;
== Component; DLM ==&lt;br /&gt;
&lt;br /&gt;
One of the major roles of a cluster is to provide [[DLM|distributed locking]] on clustered storage. In fact, storage software can not be clustered without using [[DLM]], as provided by the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;dlm_controld&amp;lt;/span&amp;gt; daemon and using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;openais&amp;lt;/span&amp;gt;&#039;s virtual synchrony via [[CPG]]. &lt;br /&gt;
&lt;br /&gt;
Through DLM, all nodes accessing clustered storage are guaranteed to get [[POSIX]] locks, called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;plock&amp;lt;/span&amp;gt;s, in the same order across all nodes. Both [[CLVM]] and [[GFS2]] rely on DLM, though other clustered storage, like OCFS2, use it as well.&lt;br /&gt;
&lt;br /&gt;
== Component; Xen ==&lt;br /&gt;
&lt;br /&gt;
Two of the most popular open-source virtualization platforms available in the Linux world today and [[Xen]] and [[KVM]]. The former is maintained by [http://www.citrix.com/xenserver Citrix] and the other by [http://www.redhat.com/solutions/virtualization/ Redhat]. It would be difficult to say which is &amp;quot;better&amp;quot;, as they&#039;re both very good. Xen can be argued to be more mature where KVM is the &amp;quot;official&amp;quot; solution supported by Red Hat in [[EL6]].&lt;br /&gt;
&lt;br /&gt;
We will be using the Xen [[hypervisor]] and a &amp;quot;host&amp;quot; virtual server called [[dom0]]. In Xen, every machine is a virtual server, including the system you installed when you built the server. This is possible thanks to a small Xen micro-operating system that initially boots, then starts up your original installed operating system as a virtual server with special access to the underlying hardware and hypervisor management tools.&lt;br /&gt;
&lt;br /&gt;
The rest of the virtual servers in a Xen environment are collectively called &amp;quot;[[domU]]&amp;quot; virtual servers. These will be the highly-available resource that will migrate between nodes during failure events in our cluster.&lt;br /&gt;
&lt;br /&gt;
= Base Setup =&lt;br /&gt;
&lt;br /&gt;
Before we can look at the cluster, we must first build two cluster nodes and then install the operating system.&lt;br /&gt;
&lt;br /&gt;
== Hardware Requirements ==&lt;br /&gt;
&lt;br /&gt;
The bare minimum requirements are;&lt;br /&gt;
&lt;br /&gt;
* All hardware must be supported by [[EL5]]. It is strongly recommended that you check compatibility before making any purchases.&lt;br /&gt;
* A dual-core [[CPU]] with hardware virtualization support.&lt;br /&gt;
* Three network cards; At least one should be gigabit or faster.&lt;br /&gt;
* One hard drive.&lt;br /&gt;
* 2 [[GiB]] of [[RAM]]&lt;br /&gt;
* A [[fence|fence device]]. This can be an [[IPMI]]-enabled server, a [http://nodeassassin.org Node Assassin], a [http://www.apc.com/products/resource/include/techspec_index.cfm?base_sku=AP7900 switched PDU] or similar.&lt;br /&gt;
&lt;br /&gt;
This tutorial was written using the following hardware:&lt;br /&gt;
&lt;br /&gt;
* AMD Athlon [http://products.amd.com/en-us/DesktopCPUDetail.aspx?id=610 II X4 600e Processor]&lt;br /&gt;
* ASUS [http://www.asus.com/product.aspx?P_ID=LVmksAnszmVimOOp M4A785T-M/CSM]&lt;br /&gt;
* 4GB Kingston [http://www.ec.kingston.com/ecom/configurator_new/partsinfo.asp?root=&amp;amp;LinkBack=&amp;amp;ktcpartno=KVR1333D3N9K2/4G KVR1333D3N9K2/4G], 4GB (2x2GB) DDR3-1333, Non-ECC&lt;br /&gt;
* Seagate [http://www.seagate.com/ww/v/index.jsp?vgnextoid=70f4bfafecadd110VgnVCM100000f5ee0a0aRCRD ST9500420AS] 2.5&amp;quot; SATA HDD&lt;br /&gt;
* 2x Intel [http://www.intel.com/products/desktop/adapters/gigabit-ct/gigabit-ct-overview.htm Pro/1000CT EXPI9301CT] PCIe NICs&lt;br /&gt;
* [[Node Assassin v1.1.4]]&lt;br /&gt;
&lt;br /&gt;
This is not an endorsement of the above hardware. I put a heavy emphasis on minimizing power consumption and bought what was within my budget. This hardware was never meant to be put into production, but instead was chosen to serve the purpose of my own study and for creating this tutorial. What you ultimately choose to use, provided it meets the minimum requirements, is entirely up to you and your requirements.&lt;br /&gt;
&lt;br /&gt;
{{note|1=I use three physical [[NIC]]s, but you can get away with two by merging the storage and back-channel networks, which we will discuss shortly. If you are really in a pinch, you could create three aliases on on interface and isolate them using [[VLAN]]s. If you go this route, please ensure that your VLANs are configured and working before beginning this tutorial. Pay close attention to multicast traffic.}}&lt;br /&gt;
&lt;br /&gt;
== Pre-Assembly ==&lt;br /&gt;
&lt;br /&gt;
Before you assemble your nodes, take a moment to record the [[MAC]] addresses of each network interface and then note where each interface is physically installed. This will help you later when configuring the networks. I generally create a simple text file with the MAC addresses, the interface I intend to assign to it and where it physically is located.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
-=] an-node04&lt;br /&gt;
48:5B:39:3C:53:15   # eth0 - onboard interface&lt;br /&gt;
00:1B:21:72:9B:5A   # eth1 - right-most PCIe interface&lt;br /&gt;
00:1B:21:72:96:EA   # eth2 - left-most PCIe interface&lt;br /&gt;
&lt;br /&gt;
-=] an-node05&lt;br /&gt;
48:5B:39:3C:53:13   # eth0 - onboard interface&lt;br /&gt;
00:1B:21:72:99:AB   # eth1 - right-most PCIe interface&lt;br /&gt;
00:1B:21:72:96:A6   # eth2 - left-most PCIe interface&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== OS Install ==&lt;br /&gt;
&lt;br /&gt;
Later steps will include packages to install, so the initial OS install can be minimal. I like to change the default run-level to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;3&amp;lt;/span&amp;gt;, remove &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rhgb quiet&amp;lt;/span&amp;gt; from the [[grub]] menu, disable the firewall and disable [[SELinux]]. In a production cluster, you will want to use firewalling and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;selinux&amp;lt;/span&amp;gt;, but until you finish studying, leave it off to keep things simple.&lt;br /&gt;
&lt;br /&gt;
{{note|1=Before [[EL5]].4, you could not use SELinux. It is now possible to use it, and it is recommended that you do so in any production cluster.}}&lt;br /&gt;
{{note|1=Ports and protocols to open in a firewall will be discussed later in the networking section.}}&lt;br /&gt;
&lt;br /&gt;
I like to minimize and automate my installs as much as possible. To that end, I run a little [[Setting Up a PXE Server in Fedora|PXE]] server on my network and use a [[kickstart]] script to automate the install. Here is a simple one for use on a single-drive node:&lt;br /&gt;
* [[generic_el5_node.ks]]&lt;br /&gt;
&lt;br /&gt;
If you decide to manually install [[EL5]] on your nodes, please try to keep the installation as small as possible. The fewer packages installed, the fewer sources of problems and vectors for attack.&lt;br /&gt;
&lt;br /&gt;
== Post Install OS Changes ==&lt;br /&gt;
&lt;br /&gt;
This section discusses changes I recommend, but are not required. If you wish to adapt any of the steps below, please do so but be sure to keep the changes consistent through out the implementation of this tutorial.&lt;br /&gt;
&lt;br /&gt;
=== Network Planning ===&lt;br /&gt;
&lt;br /&gt;
The most important change that is recommended is to get your nodes into a consistent networking configuration. This will prove very handy when trying to keep track of your networks and where they&#039;re physically connected. This becomes exponentially more helpful as your cluster grows.&lt;br /&gt;
&lt;br /&gt;
The first step is to understand the three networks we will be creating. Once you understand their role, you will need to decide which interface on the nodes will be used for each network.&lt;br /&gt;
&lt;br /&gt;
==== Cluster Networks ====&lt;br /&gt;
&lt;br /&gt;
The three networks are;&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Network&lt;br /&gt;
!Acronym&lt;br /&gt;
!Use&lt;br /&gt;
|-&lt;br /&gt;
|Back-Channel Network&lt;br /&gt;
|&#039;&#039;&#039;BCN&#039;&#039;&#039;&lt;br /&gt;
|Private cluster communications, virtual machine migrations, fence devices&lt;br /&gt;
|-&lt;br /&gt;
|Storage Network&lt;br /&gt;
|&#039;&#039;&#039;SN&#039;&#039;&#039;&lt;br /&gt;
|Used exclusively for storage communications. Possible to use as totem&#039;s redundant ring.&lt;br /&gt;
|-&lt;br /&gt;
|Internet-Facing Network&lt;br /&gt;
|&#039;&#039;&#039;IFN&#039;&#039;&#039;&lt;br /&gt;
|Internet-polluted network. No cluster, storage or cluster device communication.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Things To Consider ====&lt;br /&gt;
&lt;br /&gt;
When planning which interfaces to connect to each network, consider the following, in order of importance:&lt;br /&gt;
&lt;br /&gt;
* If your nodes have [[IPMI]] and an interface sharing a physical [[RJ-45]] connector, this must be on the &#039;&#039;&#039;Back-Channel Network&#039;&#039;&#039;. The reasoning is that having your fence device accessible on the &#039;&#039;&#039;Internet-Facing Network&#039;&#039;&#039; poses a &#039;&#039;major&#039;&#039; security risk. Having the IPMI interface on the &#039;&#039;&#039;Storage Network&#039;&#039;&#039; can cause problems if a fence is fired and the network is saturated with storage traffic.&lt;br /&gt;
&lt;br /&gt;
* The lowest-latency network interface should be used as the &#039;&#039;&#039;Back-Channel Network&#039;&#039;&#039;. The cluster is maintained by [[multicast]] messaging between the nodes using something called the [[totem]] protocol. Any delay in the delivery of these messages can risk causing a failure and ejection of effected nodes when no actual failure existed. This will be discussed in greater detail later.&lt;br /&gt;
&lt;br /&gt;
* The network with the most raw bandwidth should be used for the &#039;&#039;&#039;Storage Network&#039;&#039;&#039;. All disk writes must be sent across the network and committed to the remote nodes before the write is declared complete. This causes the network to become the disk I/O bottle neck. Using a network with jumbo frames and high raw throughput will help minimize this bottle neck.&lt;br /&gt;
&lt;br /&gt;
* During the live migration of virtual machines, the VM&#039;s RAM is copied to the other node using the &#039;&#039;&#039;BCN&#039;&#039;&#039;. For this reason, the second fastest network should be used for back-channel communication. However, these copies can saturate the network, so care must be taken to ensure that cluster communications get higher priority. This can be done using a managed switch. If you can not ensure priority for totem multicast, then be sure to configure Xen later to use the storage network for migrations.&lt;br /&gt;
&lt;br /&gt;
* The remain, slowest interface should be used for the &#039;&#039;&#039;IFN&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
==== Planning the Networks ====&lt;br /&gt;
&lt;br /&gt;
This paper will use the following setup. Feel free to alter the interface to network mapping and the [[IP]] [[subnet]]s used to best suit your needs. For reasons completely my own, I like to start my cluster IPs final [[octal]] at &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;71&amp;lt;/span&amp;gt; for node 1 and then increment up from there. This is entirely arbitrary, so please use what ever makes sense to you. The remainder of this tutorial will follow the convention below:&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Network&lt;br /&gt;
!Interface&lt;br /&gt;
!Subnet&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;IFN&#039;&#039;&#039;&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth0&amp;lt;/span&amp;gt;&lt;br /&gt;
|&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;
|&#039;&#039;&#039;SN&#039;&#039;&#039;&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth1&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;192.168.2.0/24&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;BCN&#039;&#039;&#039;&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth2&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;192.139.3.0/24&amp;lt;/span&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
This translates to the following per-node configuration:&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!colspan=&amp;quot;2&amp;quot;|&lt;br /&gt;
!colspan=&amp;quot;2&amp;quot;|an-node04&lt;br /&gt;
!colspan=&amp;quot;2&amp;quot;|an-node05&lt;br /&gt;
|-&lt;br /&gt;
!&lt;br /&gt;
!Interface&lt;br /&gt;
!IP Address&lt;br /&gt;
!Host Name(s)&lt;br /&gt;
!IP Address&lt;br /&gt;
!Host Name(s)&lt;br /&gt;
|-&lt;br /&gt;
!IFN&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth0&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;192.168.1.74&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04.ifn&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;192.168.1.75&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05.ifn&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!SN&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth1&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;192.168.2.74&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04.sn&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;192.168.2.75&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05.sn&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!BCN&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth2&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;192.168.3.74&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04 an-node04.alteeve.com an-node04.bcn&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;192.168.3.75&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05 an-node05.alteeve.com an-node05.bcn&amp;lt;/span&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Network Configuration ===&lt;br /&gt;
&lt;br /&gt;
So now we&#039;ve planned the network, so it is time to implement it.&lt;br /&gt;
&lt;br /&gt;
==== Warning About Managed Switches ====&lt;br /&gt;
&lt;br /&gt;
{{warning|1=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 and configuring [[Multicast IGMP Snooping]] or [[Spanning Tree Protocol]]. They have been known to cause problems by not allowing multicast packets to reach all nodes fast enough or at all. This can cause somewhat random break-downs in communication between your nodes, leading to seemingly random fences and DLM lock timeouts. If your switches support [[PIM Routing]], be sure to use it!&lt;br /&gt;
&lt;br /&gt;
If you have problems with your cluster not forming, or seemingly random fencing, try using a cheap [http://dlink.ca/products/?pid=230 unmanaged] switch. If the problem goes away, you are most likely dealing with a managed switch configuration problem.&lt;br /&gt;
&lt;br /&gt;
==== Disable Firewalling ====&lt;br /&gt;
&lt;br /&gt;
To &amp;quot;keep things simple&amp;quot;, we will disable all firewalling on the cluster nodes. This is not recommended in production environments, obviously, so below will be a table of ports and protocols to open when you do get into production. Until then, we will simply use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;chkconfig&amp;lt;/span&amp;gt; to 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;.&lt;br /&gt;
&lt;br /&gt;
{{note|1=Cluster 2 does not support [[IPv6]], so you can skip or ignore it if you wish. I like to disable it just to be certain that it can&#039;t cause issues though.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
chkconfig iptables off&lt;br /&gt;
chkconfig ip6tables off&lt;br /&gt;
/etc/init.d/iptables stop&lt;br /&gt;
/etc/init.d/ip6tables stop&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now confirm that they are off by having &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; list their rules.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
iptables -L&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Chain INPUT (policy ACCEPT)&lt;br /&gt;
target     prot opt source               destination         &lt;br /&gt;
&lt;br /&gt;
Chain FORWARD (policy ACCEPT)&lt;br /&gt;
target     prot opt source               destination         &lt;br /&gt;
&lt;br /&gt;
Chain OUTPUT (policy ACCEPT)&lt;br /&gt;
target     prot opt source               destination         &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;
ip6tables -L&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Chain INPUT (policy ACCEPT)&lt;br /&gt;
target     prot opt source               destination         &lt;br /&gt;
&lt;br /&gt;
Chain FORWARD (policy ACCEPT)&lt;br /&gt;
target     prot opt source               destination         &lt;br /&gt;
&lt;br /&gt;
Chain OUTPUT (policy ACCEPT)&lt;br /&gt;
target     prot opt source               destination         &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When you do prepare to go into production, these are the protocols and ports you need to open between cluster nodes. Remember to allow multicast communications as well!&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Port&lt;br /&gt;
!Protocol&lt;br /&gt;
!Component&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;5404&amp;lt;/span&amp;gt;, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;5405&amp;lt;/span&amp;gt;&lt;br /&gt;
|[[UDP]]&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[cman]]&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;8084&amp;lt;/span&amp;gt;, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;5405&amp;lt;/span&amp;gt;&lt;br /&gt;
|[[TCP]]&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[luci]]&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;11111&amp;lt;/span&amp;gt;&lt;br /&gt;
|[[TCP]]&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[ricci]]&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;14567&amp;lt;/span&amp;gt;&lt;br /&gt;
|[[TCP]]&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[gnbd]]&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;16851&amp;lt;/span&amp;gt;&lt;br /&gt;
|[[TCP]]&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[modclusterd]]&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;21064&amp;lt;/span&amp;gt;&lt;br /&gt;
|[[TCP]]&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[dlm]]&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;50006&amp;lt;/span&amp;gt;, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;50008&amp;lt;/span&amp;gt;, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;50009&amp;lt;/span&amp;gt;&lt;br /&gt;
|[[TCP]]&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[ccsd]]&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;50007&amp;lt;/span&amp;gt;&lt;br /&gt;
|[[UDP]]&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[ccsd]]&amp;lt;/span&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Disable NetworkManager, Enable network ====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;NetworkManager&amp;lt;/span&amp;gt; daemon is an excellent daemon in environments where a system connects to a variety of networks. The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;NetworkManager&amp;lt;/span&amp;gt; daemon handles changing the networking configuration whenever it senses a change in the network state, like when a cable is unplugged or a wireless network comes or goes. As useful as this is on laptops and workstations, it can be detrimental in a cluster.&lt;br /&gt;
&lt;br /&gt;
To prevent the networking from changing once we&#039;ve got it setup, we want to replace &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;NetworkManager&amp;lt;/span&amp;gt; daemon with the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;network&amp;lt;/span&amp;gt; initialization script. The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;network&amp;lt;/span&amp;gt; script will start and stop networking, but otherwise it will leave the configuration alone. This is ideal in servers, and doubly-so in clusters given their sensitivity to transient network issues.&lt;br /&gt;
&lt;br /&gt;
Start by removing &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;NetworkManager&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 remove NetworkManager NetworkManager-glib NetworkManager-gnome NetworkManager-devel NetworkManager-glib-devel&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now you want to ensure that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;network&amp;lt;/span&amp;gt; starts with the system.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
chkconfig network on&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Setup /etc/hosts ====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/hosts&amp;lt;/span&amp;gt; file, by default, will resolve the hostname to the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;lo&amp;lt;/span&amp;gt; (&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;127.0.0.1&amp;lt;/span&amp;gt;) interface. The cluster uses this name though for knowing which interface to use for the [[totem]] protocol (and thus all cluster communications). To this end, we will remove the hostname from &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;127.0.0.1&amp;lt;/span&amp;gt; and instead put it on the IP of our &#039;&#039;&#039;BCN&#039;&#039;&#039; interface. We will also add entries for all other networks for both nodes in the cluster along with entries for the fence device(s). &lt;br /&gt;
&lt;br /&gt;
Once done, the edited &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/hosts&amp;lt;/span&amp;gt; file should be suitable for copying to both nodes in the cluster.&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;
# Do not remove the following line, or various programs&lt;br /&gt;
# that require network functionality will fail.&lt;br /&gt;
127.0.0.1	localhost.localdomain localhost&lt;br /&gt;
::1		localhost6.localdomain6 localhost6&lt;br /&gt;
&lt;br /&gt;
192.168.1.74	an-node04.ifn&lt;br /&gt;
192.168.2.74	an-node04.sn&lt;br /&gt;
192.168.3.74	an-node04 an-node04.bcn an-node04.alteeve.com&lt;br /&gt;
&lt;br /&gt;
192.168.1.75	an-node05.ifn&lt;br /&gt;
192.168.2.75	an-node05.sn&lt;br /&gt;
192.168.3.75	an-node05 an-node05.bcn an-node05.alteeve.com&lt;br /&gt;
&lt;br /&gt;
192.168.3.61	fence_na01.alteeve.com	# Node Assassin&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Mapping Interfaces to ethX Names ====&lt;br /&gt;
&lt;br /&gt;
Chances are good that the assignment of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ethX&amp;lt;/span&amp;gt; interface names to your physical network cards is not ideal. There is no strict technical reason to change the mapping, but it will make your life a lot easier if all nodes use the same &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ethX&amp;lt;/span&amp;gt; names for the same subnets. &lt;br /&gt;
&lt;br /&gt;
The actual process of changing the mapping is a little involved. For this reason, there is a dedicated mini-tutorial which you can find below. Please jump to it and then return once your mapping is as you like it.&lt;br /&gt;
&lt;br /&gt;
* [[Changing the ethX to Ethernet Device Mapping in EL5]]&lt;br /&gt;
&lt;br /&gt;
==== Set IP Addresses ====&lt;br /&gt;
&lt;br /&gt;
The last step in setting up the network interfaces is to manually assign the IP addresses and define the subnets for the interfaces. This involves directly editing the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/sysconfig/network-scripts/ifcfg-ethX&amp;lt;/span&amp;gt; files. There are a large set of options that can be set in these configuration files, but most are outside the scope of this tutorial. To get a better understanding of the available options, please see:&lt;br /&gt;
&lt;br /&gt;
* [http://docs.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/5/html/Deployment_Guide/s1-networkscripts-interfaces.html Red Hat&#039;s Interface Configuration Guide]&lt;br /&gt;
&lt;br /&gt;
{{note|1=Later on, we will be creating two bridges, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xenbr0&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xenbr2&amp;lt;/span&amp;gt; which we will then connect [[dom0]]&#039;s &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; to. These bridges then become available to the [[Xen]]&#039;s [[domU]] VMs. Bridge options and arguments can be found in the link above.}}&lt;br /&gt;
&lt;br /&gt;
Here are the three configuration files from &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt; which you can use as guides. Please &#039;&#039;&#039;do not&#039;&#039;&#039; copy these over your files! Doing so will cause your interfaces to fail outright as every interface&#039;s [[MAC]] address is unique. Adapt these to suite your needs.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/sysconfig/network-scripts/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;
# Realtek Semiconductor Co., Ltd. RTL8111/8168B PCI Express Gigabit Ethernet controller&lt;br /&gt;
HWADDR=48:5B:39:3C:53:14&lt;br /&gt;
DEVICE=eth0&lt;br /&gt;
BOOTPROTO=static&lt;br /&gt;
ONBOOT=yes&lt;br /&gt;
IPADDR=192.168.1.74&lt;br /&gt;
NETMASK=255.255.255.0&lt;br /&gt;
GATEWAY=192.168.1.254&lt;br /&gt;
DNS1=192.139.81.117&lt;br /&gt;
DNS2=192.139.81.1&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;
vim /etc/sysconfig/network-scripts/ifcfg-eth1&lt;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 82574L Gigabit Network Connection&lt;br /&gt;
HWADDR=00:1B:21:72:9B:5A&lt;br /&gt;
DEVICE=eth1&lt;br /&gt;
BOOTPROTO=static&lt;br /&gt;
ONBOOT=yes&lt;br /&gt;
IPADDR=192.168.2.74&lt;br /&gt;
NETMASK=255.255.255.0&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;
vim /etc/sysconfig/network-scripts/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 82574L Gigabit Network Connection&lt;br /&gt;
HWADDR=00:1B:21:72:96:EA&lt;br /&gt;
DEVICE=eth2&lt;br /&gt;
BOOTPROTO=static&lt;br /&gt;
ONBOOT=yes&lt;br /&gt;
IPADDR=192.168.3.74&lt;br /&gt;
NETMASK=255.255.255.0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you do not want to use the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;DNSx=&amp;lt;/span&amp;gt; options, you will need to setup the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/resolv.conf&amp;lt;/span&amp;gt; file for [[DNS]] resolution. You can learn more about this file&#039;s purpose by reading it&#039;s [[man]] page; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;man resolv.conf&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Finally, restart &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;network&amp;lt;/span&amp;gt; and you should have you interfaces setup properly.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/network 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;
Shutting down interface eth0:                              [  OK  ]&lt;br /&gt;
Shutting down interface eth1:                              [  OK  ]&lt;br /&gt;
Shutting down interface eth2:                              [  OK  ]&lt;br /&gt;
Shutting down loopback interface:                          [  OK  ]&lt;br /&gt;
Bringing up loopback interface:                            [  OK  ]&lt;br /&gt;
Bringing up interface eth0:                                [  OK  ]&lt;br /&gt;
Bringing up interface eth1:                                [  OK  ]&lt;br /&gt;
Bringing up interface eth2:                                [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can verify your configuration using the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ifconfig&amp;lt;/span&amp;gt; tool. The output below is from &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&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;
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:3974 errors:0 dropped:0 overruns:0 frame:0&lt;br /&gt;
          TX packets:1810 errors:0 dropped:0 overruns:0 carrier:0&lt;br /&gt;
          collisions:0 txqueuelen:1000 &lt;br /&gt;
          RX bytes:1452567 (1.3 MiB)  TX bytes:237057 (231.5 KiB)&lt;br /&gt;
          Interrupt:246 Base address:0xe000 &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:117 errors:0 dropped:0 overruns:0 frame:0&lt;br /&gt;
          TX packets:62 errors:0 dropped:0 overruns:0 carrier:0&lt;br /&gt;
          collisions:0 txqueuelen:1000 &lt;br /&gt;
          RX bytes:30766 (30.0 KiB)  TX bytes:16018 (15.6 KiB)&lt;br /&gt;
          Interrupt:17 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:54 errors:0 dropped:0 overruns:0 frame:0&lt;br /&gt;
          TX packets:60 errors:0 dropped:0 overruns:0 carrier:0&lt;br /&gt;
          collisions:0 txqueuelen:1000 &lt;br /&gt;
          RX bytes:11492 (11.2 KiB)  TX bytes:15638 (15.2 KiB)&lt;br /&gt;
          Interrupt:16 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:34 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:0 &lt;br /&gt;
          RX bytes:9268 (9.0 KiB)  TX bytes:9268 (9.0 KiB)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{note|1=You may see a &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virbr0&amp;lt;/span&amp;gt; interface. You can safely ignore it, we will remove it later.}}&lt;br /&gt;
&lt;br /&gt;
=== Setting up SSH ===&lt;br /&gt;
&lt;br /&gt;
Setting up [[SSH]] shared keys will allow your nodes to pass files between one another and execute commands remotely without needing to enter a password. This will be needed later when we want to enable applications like &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;libvirtd&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-manager&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
SSH is, on it&#039;s own, a very big topic. If you are not familiar with SSH, please take some time to learn about it before proceeding. A great first step is the [http://en.wikipedia.org/wiki/Secure_Shell Wikipedia] entry on SSH, as well as the SSH [[man]] page; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;man ssh&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[SSH]] 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 on each node, 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;
Created directory &#039;/root/.ssh&#039;.&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;
a1:65:a9:50:bb:15:ae:b1:6e:06:12:4a:29:d1:68:f3 root@an-node04.alteeve.com&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_rsa&amp;lt;/span&amp;gt; and the public key called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;~/.ssh/id_rsa.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;
MIIEnwIBAAKCAQBTNg6FZyDKm4GAm7c+F2enpLWy+t8ZZjm4Z3Q7EhX09ukqk/Qm&lt;br /&gt;
MqprtI9OsiRVjce+wGx4nZ8+Z0NHduCVuwAxG0XG7FpKkUJC3Qb8KhyeIpKEcfYA&lt;br /&gt;
tsDUFnWddVF8Tsz6dDOhb61tAke77d9E01NfyHp88QBxjJ7w+ZgB2eLPBFm6j1t+&lt;br /&gt;
K50JHwdcFfxrZFywKnAQIdH0NCs8VaW91fQZBupg4OGOMpSBnVzoaz2ybI9bQtbZ&lt;br /&gt;
4GwhCghzKx7Qjz20WiqhfPMfFqAZJwn0WXfjALoioMDWavTbx+J2HM8KJ8/YkSSK&lt;br /&gt;
dDEgZCItg0Q2fC35TDX+aJGu3xNfoaAe3lL1AgEjAoIBABVlq/Zq+c2y9Wo2q3Zd&lt;br /&gt;
yjJsLrj+rmWd8ZXRdajKIuc4LVQXaqq8kjjz6lYQjQAOg9H291I3KPLKGJ1ZFS3R&lt;br /&gt;
AAygnOoCQxp9H6rLHw2kbcJDZ4Eknlf0eroxqTceKuVzWUe3ev2gX8uS3z70BjZE&lt;br /&gt;
+C6SoydxK//w9aut5UJN+H5f42p95IsUIs0oy3/3KGPHYrC2Zgc2TIhe25huie/O&lt;br /&gt;
psKhHATBzf+M7tHLGia3q682JqxXru8zhtPOpEAmU4XDtNdL+Bjv+/Q2HMRstJXe&lt;br /&gt;
2PU3IpVBkirEIE5HlyOV1T802KRsSBelxPV5Y6y5TRq+cEwn0G2le1GiFBjd0xQd&lt;br /&gt;
0csCgYEA2BWkxSXhqmeb8dzcZnnuBZbpebuPYeMtWK/MMLxvJ50UCUfVZmA+yUUX&lt;br /&gt;
K9fAUvkMLd7V8/MP7GrdmYq2XiLv6IZPUwyS8yboovwWMb+72vb5QSnN6LAfpUEk&lt;br /&gt;
NRd5JkWgqRstGaUzxeCRfwfIHuAHikP2KeiLM4TfBkXzhm+VWjECgYBilQEBHvuk&lt;br /&gt;
LlY2/1v43zYQMSZNHBSbxc7R5mnOXNFgapzJeFKvaJbVKRsEQTX5uqo83jRXC7LI&lt;br /&gt;
t14pC23tpW1dBTi9bNLzQnf/BL9vQx6KFfgrXwy8KqXuajfv1ECH6ytqdttkUGZt&lt;br /&gt;
TE/monjAmR5EVElvwMubCPuGDk9zC7iQBQKBgG8hEukMKunsJFCANtWdyt5NnKUB&lt;br /&gt;
X66vWSZLyBkQc635Av11Zm8qLusq2Ld2RacDvR7noTuhkykhBEBV92Oc8Gj0ndLw&lt;br /&gt;
hhamS8GI9Xirv7JwYu5QA377ff03cbTngCJPsbYN+e/uj6eYEE/1X5rZnXpO1l6y&lt;br /&gt;
G7QYcrLE46Q5YsCrAoGAL+H5LG4idFEFTem+9Tk3hDUhO2VpGHYFXqMdctygNiUn&lt;br /&gt;
lQ6Oj7Z1JbThPJSz0RGF4wzXl/5eJvn6iPbsQDpoUcC1KM51FxGn/4X2lSCZzgqr&lt;br /&gt;
vUtslejUQJn96YRZ254cZulF/YYjHyUQ3byhDRcr9U2CwUBi5OcbFTomlvcQgHcC&lt;br /&gt;
gYEAtIpaEWt+Akz9GDJpKM7Ojpk8wTtlz2a+S5fx3WH/IVURoAzZiXzvonVIclrH&lt;br /&gt;
5RXFiwfoXlMzIulZcrBJZfTgRO9A2v9rE/ZRm6qaDrGe9RcYfCtxGGyptMKLdbwP&lt;br /&gt;
UW1emRl5celU9ZEZRBpIVTES5ZVWqD2RkkkNNJbPf5F/x+w=&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; (wrapped to make it more readable):&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 AAAAB3NzaC1yc2EAAAABIwAAAQBTNg6FZyDKm4GAm7c+F2enpLWy+t8Z&lt;br /&gt;
Zjm4Z3Q7EhX09ukqk/QmMqprtI9OsiRVjce+wGx4nZ8+Z0NHduCVuwAxG0XG7FpK&lt;br /&gt;
kUJC3Qb8KhyeIpKEcfYAtsDUFnWddVF8Tsz6dDOhb61tAke77d9E01NfyHp88QBx&lt;br /&gt;
jJ7w+ZgB2eLPBFm6j1t+K50JHwdcFfxrZFywKnAQIdH0NCs8VaW91fQZBupg4OGO&lt;br /&gt;
MpSBnVzoaz2ybI9bQtbZ4GwhCghzKx7Qjz20WiqhfPMfFqAZJwn0WXfjALoioMDW&lt;br /&gt;
avTbx+J2HM8KJ8/YkSSKdDEgZCItg0Q2fC35TDX+aJGu3xNfoaAe3lL1 root@an&lt;br /&gt;
-node04.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-node04&#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-node05&lt;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-node05 (192.168.3.75)&#039; can&#039;t be established.&lt;br /&gt;
RSA key fingerprint is 55:58:c3:32:e4:e6:5e:32:c1:db:5c:f1:36:e2:da:4b.&lt;br /&gt;
Are you sure you want to continue connecting (yes/no)? yes&lt;br /&gt;
Warning: Permanently added &#039;an-node05,192.168.3.75&#039; (RSA) to the list of known hosts.&lt;br /&gt;
Last login: Fri Mar 11 20:45:58 2011 from 192.168.1.202&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-node05&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-node04&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;
(Wrapped to make it more readable)&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 AAAAB3NzaC1yc2EAAAABIwAAAQBTNg6FZyDKm4GAm7c+F2enpLWy+t8Z&lt;br /&gt;
Zjm4Z3Q7EhX09ukqk/QmMqprtI9OsiRVjce+wGx4nZ8+Z0NHduCVuwAxG0XG7FpK&lt;br /&gt;
kUJC3Qb8KhyeIpKEcfYAtsDUFnWddVF8Tsz6dDOhb61tAke77d9E01NfyHp88QBx&lt;br /&gt;
jJ7w+ZgB2eLPBFm6j1t+K50JHwdcFfxrZFywKnAQIdH0NCs8VaW91fQZBupg4OGO&lt;br /&gt;
MpSBnVzoaz2ybI9bQtbZ4GwhCghzKx7Qjz20WiqhfPMfFqAZJwn0WXfjALoioMDW&lt;br /&gt;
avTbx+J2HM8KJ8/YkSSKdDEgZCItg0Q2fC35TDX+aJGu3xNfoaAe3lL1 root@an&lt;br /&gt;
-node04.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;
Various applications will connect to the other node using different methods and networks. Each connection, when first established, will prompt for you to confirm that you trust the authentication, as we saw above. Many programs can&#039;t handle this prompt and will simply fail to connect. So to get around this, I will &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ssh&amp;lt;/span&amp;gt; into both nodes using all hostnames. This will populate a file called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;~/.ssh/known_hosts&amp;lt;/span&amp;gt;. Once you do this on one node, you can simply copy the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;known_hosts&amp;lt;/span&amp;gt; to the other nodes and user&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;~/.ssh/&amp;lt;/span&amp;gt; directories.&lt;br /&gt;
&lt;br /&gt;
I simply paste this into a terminal, answering &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;yes&amp;lt;/span&amp;gt; and then immediately exiting from the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ssh&amp;lt;/span&amp;gt; session. This is a bit tedious, I admit. Take the time to check the fingerprints as they are displayed to you. It is a bad habit to blindly type &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;yes&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Alter this to suit your host names.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ssh root@an-node04 &amp;amp;&amp;amp; \&lt;br /&gt;
ssh root@an-node04.alteeve.com &amp;amp;&amp;amp; \&lt;br /&gt;
ssh root@an-node04.bcn &amp;amp;&amp;amp; \&lt;br /&gt;
ssh root@an-node04.sn &amp;amp;&amp;amp; \&lt;br /&gt;
ssh root@an-node04.ifn &amp;amp;&amp;amp; \&lt;br /&gt;
ssh root@an-node05 &amp;amp;&amp;amp; \&lt;br /&gt;
ssh root@an-node05.alteeve.com &amp;amp;&amp;amp; \&lt;br /&gt;
ssh root@an-node05.bcn &amp;amp;&amp;amp; \&lt;br /&gt;
ssh root@an-node05.sn &amp;amp;&amp;amp; \&lt;br /&gt;
ssh root@an-node05.ifn&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once you&#039;ve done this on one node, you can simply copy the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;~/.ssh/known_hosts&amp;lt;/span&amp;gt; file to the other node. In my case, I ran the above commands on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt;, so I will copy the file to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&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;
rsync -av root@192.168.1.74:/root/.ssh/known_hosts ~/.ssh/&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
receiving file list ... done&lt;br /&gt;
known_hosts&lt;br /&gt;
&lt;br /&gt;
sent 96 bytes  received 2165 bytes  4522.00 bytes/sec&lt;br /&gt;
total size is 7629  speedup is 3.37&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Installing Packages We Will Use ==&lt;br /&gt;
&lt;br /&gt;
There are several packages we will need. They can all be installed in one go with the following command.&lt;br /&gt;
&lt;br /&gt;
If you have a slow or metered Internet connection, you may want to alter &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/yum.conf&amp;lt;/span&amp;gt; and change &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;keepcache=0&amp;lt;/span&amp;gt; to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;keepcache=1&amp;lt;/span&amp;gt; before installing packages. This way, you can then run your updates and installs on one node and then &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rsync&amp;lt;/span&amp;gt; the downloaded files from the first node to the second node. Once done, when you run the updates and installs on that second node, nothing more will be downloaded. To copy the cached [[RPM]]s, simply run &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rsync -av /var/cache/yum root@an-node05:/var/cache/&amp;lt;/span&amp;gt; (assuming you did the initial downloads from &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
{{note|1=If you are using [[RHEL]] 5.x proper, you will need to manually download and install the [[DRBD]] RPMs from [http://www.linbit.com/support/ Linbit].}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install cman openais rgmanager lvm2-cluster gfs2-utils xen xen-libs kmod-xenpv \&lt;br /&gt;
            drbd83 kmod-drbd83-xen virt-manager virt-viewer libvirt libvirt-python \&lt;br /&gt;
            python-virtinst luci ricci ntp bridge-utils system-config-cluster&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will drag in a good number of dependencies, which is fine.&lt;br /&gt;
&lt;br /&gt;
== Keeping Time In Sync ==&lt;br /&gt;
&lt;br /&gt;
It is very important that time on both nodes be kept in sync. The way to do this is to setup [[[NTP]], the network time protocol. I like to use the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;tick.redhat.com&amp;lt;/span&amp;gt; time server, though you are free to substitute your preferred time source.&lt;br /&gt;
&lt;br /&gt;
First, add the timeserver to the NTP configuration file by appending the following lines to the end of it. &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;
echo server tick.redhat.com$&#039;\n&#039;restrict tick.redhat.com mask 255.255.255.255 nomodify notrap noquery &amp;gt;&amp;gt; /etc/ntp.conf&lt;br /&gt;
tail -n 4 /etc/ntp.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;
# Specify the key identifier to use with the ntpq utility.&lt;br /&gt;
#controlkey 8&lt;br /&gt;
server tick.redhat.com&lt;br /&gt;
restrict tick.redhat.com mask 255.255.255.255 nomodify notrap noquery&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now make sure that the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ntpd&amp;lt;/span&amp;gt; service starts on boot, then start it manually.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
chkconfig ntpd on&lt;br /&gt;
/etc/init.d/ntpd 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 ntpd:                                             [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Altering Boot Up ==&lt;br /&gt;
&lt;br /&gt;
{{note|1=The next two steps are optional.}}&lt;br /&gt;
&lt;br /&gt;
There are two changes I like to make on my nodes. These are not required, but I find it helps to keep things as simple as possible. Particularly in the earlier learning and testing stages.&lt;br /&gt;
&lt;br /&gt;
=== Changing the Default Run-Level ===&lt;br /&gt;
&lt;br /&gt;
If you choose not to implement it, please change any referenced to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/rc3.d&amp;lt;/span&amp;gt; to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/rc5.d&amp;lt;/span&amp;gt; later in this tutorial.&lt;br /&gt;
&lt;br /&gt;
I prefer to minimize the running daemons and apps on my nodes for two reasons; Performance and security. One of the simplest ways to minimize the number of running programs is to change the run-level to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;3&amp;lt;/span&amp;gt; by editing &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/inittab&amp;lt;/span&amp;gt;. This tells the node when it boots not to start the graphical interface and instead simply boot to a &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[bash]]&amp;lt;/span&amp;gt; shell.&lt;br /&gt;
&lt;br /&gt;
This change is actually quite simple. Simply edit &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/inittab&amp;lt;/span&amp;gt; and change the line &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;id:5:initdefault:&amp;lt;/span&amp;gt; to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;id:3:initdefault:&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;
cp /etc/inittab /etc/inittab.orig&lt;br /&gt;
sed -i &#039;s/id:5:initdefault/id:3:initdefault/g&#039; /etc/inittab&lt;br /&gt;
diff -u /etc/inittab.orig /etc/inittab&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;diff&amp;quot;&amp;gt;&lt;br /&gt;
--- /etc/inittab.orig	2011-05-01 20:54:35.000000000 -0400&lt;br /&gt;
+++ /etc/inittab	2011-05-01 20:56:43.000000000 -0400&lt;br /&gt;
@@ -15,7 +15,7 @@&lt;br /&gt;
 #   5 - X11&lt;br /&gt;
 #   6 - reboot (Do NOT set initdefault to this)&lt;br /&gt;
 # &lt;br /&gt;
-id:5:initdefault:&lt;br /&gt;
+id:3:initdefault:&lt;br /&gt;
 &lt;br /&gt;
 # System initialization.&lt;br /&gt;
 si::sysinit:/etc/rc.d/rc.sysinit&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you are still in a graphical environment and want to disable the [[GUI]] without rebooting, you can run &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;init 3&amp;lt;/span&amp;gt;. Conversely, if you want to start the GUI for a certain task, you can do so my running &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;init 5&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Making Boot Messages Visible ===&lt;br /&gt;
&lt;br /&gt;
Another optional step, in-line with the change above, is to disable the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rhgb&amp;lt;/span&amp;gt; (Red Hat Graphical Boot) and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;quiet&amp;lt;/span&amp;gt; kernel arguments. These options provide the clean boot screen you normally see with [[EL5]], but they also hide a lot of boot messages that we may find helpful. &lt;br /&gt;
&lt;br /&gt;
To make this change, edit the [[grub]] boot-loader menu and remove the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rhgb quiet&amp;lt;/span&amp;gt; arguments from the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;kernel /vmlinuz...&amp;lt;/span&amp;gt; line. These arguments are usually the last ones on the line. If you leave this until later you may see two or more kernel entries. Delete these arguments where ever they are found.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /boot/grub/grub.conf /boot/grub/grub.conf.orig&lt;br /&gt;
sed -i &#039;s/root=LABEL=\//root=LABEL=\/ rhgb quiet/g&#039; /boot/grub/grub.conf&lt;br /&gt;
diff -u /boot/grub/grub.conf.orig /boot/grub/grub.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;diff&amp;quot;&amp;gt;&lt;br /&gt;
--- /boot/grub/grub.conf.orig	2011-05-01 21:01:43.000000000 -0400&lt;br /&gt;
+++ /boot/grub/grub.conf	2011-05-01 21:02:44.000000000 -0400&lt;br /&gt;
@@ -14,18 +14,18 @@&lt;br /&gt;
 title CentOS (2.6.18-238.9.1.el5xen)&lt;br /&gt;
 	root (hd0,0)&lt;br /&gt;
 	kernel /xen.gz-2.6.18-238.9.1.el5&lt;br /&gt;
-	module /vmlinuz-2.6.18-238.9.1.el5xen ro root=LABEL=/ rhgb quiet&lt;br /&gt;
+	module /vmlinuz-2.6.18-238.9.1.el5xen ro root=LABEL=/&lt;br /&gt;
 	module /initrd-2.6.18-238.9.1.el5xen.img&lt;br /&gt;
 title CentOS (2.6.18-238.9.1.el5)&lt;br /&gt;
 	root (hd0,0)&lt;br /&gt;
-	kernel /vmlinuz-2.6.18-238.9.1.el5 ro root=LABEL=/ rhgb quiet&lt;br /&gt;
+	kernel /vmlinuz-2.6.18-238.9.1.el5 ro root=LABEL=/&lt;br /&gt;
 	initrd /initrd-2.6.18-238.9.1.el5.img&lt;br /&gt;
 title CentOS (2.6.18-238.el5xen)&lt;br /&gt;
 	root (hd0,0)&lt;br /&gt;
 	kernel /xen.gz-2.6.18-238.el5 &lt;br /&gt;
-	module /vmlinuz-2.6.18-238.el5xen ro root=LABEL=/ rhgb quiet&lt;br /&gt;
+	module /vmlinuz-2.6.18-238.el5xen ro root=LABEL=/&lt;br /&gt;
 	module /initrd-2.6.18-238.el5xen.img&lt;br /&gt;
 title CentOS-base (2.6.18-238.el5)&lt;br /&gt;
 	root (hd0,0)&lt;br /&gt;
-	kernel /vmlinuz-2.6.18-238.el5 ro root=LABEL=/ rhgb quiet&lt;br /&gt;
+	kernel /vmlinuz-2.6.18-238.el5 ro root=LABEL=/&lt;br /&gt;
 	initrd /initrd-2.6.18-238.el5.img&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{note|1=If you&#039;re &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;grub.conf&amp;lt;/span&amp;gt; has been altered or doesn&#039;t have the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;root=LABEL=/&amp;lt;/span&amp;gt; text, you will need to manually add the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rhgb quiet&amp;lt;/span&amp;gt; to the end of the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/vmlinuz&amp;lt;/span&amp;gt; line(s).}}&lt;br /&gt;
&lt;br /&gt;
Now future reboots will show boot details in a terminal display rather than hiding those often-useful messages behind a splash screen.&lt;br /&gt;
&lt;br /&gt;
= Setting Up Xen =&lt;br /&gt;
&lt;br /&gt;
It may seem premature to discuss [[Xen]] before the cluster itself. The reason we need to look at it now, before the cluster, is because Xen makes some fairly significant changes to the networking. Given how changes to networking can effect the cluster, we will want to get these changes out of the way.&lt;br /&gt;
&lt;br /&gt;
We&#039;re not going to provision any virtual machines until the cluster is built.&lt;br /&gt;
&lt;br /&gt;
== A Brief Overview ==&lt;br /&gt;
&lt;br /&gt;
Xen is a [[hypervisor]] the converts the installed operating system into a virtual machine running on a small Xen kernel. This same small kernel also runs all of the virtual machines you will add later. In this way, you will always be working in a virtual machine once you switch to booting a Xen kernel. In Xen terminology, virtual machines are known as &#039;&#039;&#039;domains&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;host&amp;quot; operating system is known as [[dom0]] (domain 0) and has a special view of the hardware plus contains the configuration and control of Xen itself. All other Xen virtual machines are known as [[domU]] (domain U). This is a collective term that represents the transient ID number assigned to all virtual machines. For example, when you boot the first virtual machine, it is known as &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;dom1&amp;lt;/span&amp;gt;. The next will be &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;dom2&amp;lt;/span&amp;gt;, then &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;dom3&amp;lt;/span&amp;gt; and so on. Do note that if a [[domU]] shuts down, it&#039;s ID is &#039;&#039;not&#039;&#039; reused. So when it restarts, it will use the next free ID (ie: &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;dom4&amp;lt;/span&amp;gt; in this list, despite it having been, say, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;dom1&amp;lt;/span&amp;gt; initially).&lt;br /&gt;
&lt;br /&gt;
This makes Xen somewhat unique in the virtualization world. Most others do not touch or alter the &amp;quot;host&amp;quot; OS, instead running the guest VMs fully withing the context of the host operating system.&lt;br /&gt;
&lt;br /&gt;
== Understanding Networking in Xen ==&lt;br /&gt;
&lt;br /&gt;
Xen uses a fairly complex networking system. This is, perhaps, it&#039;s strongest point. The trade off though is that it can be a little tricky to wrap your head around. To help you become familiar, there is a short tutorial dedicated to this topic. Please read it over before proceeding in you are not familiar with Xen&#039;s networking.&lt;br /&gt;
&lt;br /&gt;
Taking the time to read and understand the mini-paper below will save you a lot of heartache in the following stages.&lt;br /&gt;
&lt;br /&gt;
* [[Networking in Xen 3.x]]&lt;br /&gt;
&lt;br /&gt;
Once built, this is what our inter-node network will look like. If you have trouble following this diagram, please do go back and read the link above before proceeding.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
 __________________________________________________________                         _________________________________________________________&lt;br /&gt;
|  ____________________                 an-node04 - (dom0) |                       | (dom0) - an-node05                 ___________________  |&lt;br /&gt;
| | vm0001_ws1   ______|                ________    _______|   _________________   |_______    ________                |______  vm0001_ws1 | |&lt;br /&gt;
| |   (domA)    | eth0 =-[vifA.0]------| xenbr0 |-=| eth0  =--| Internet-Facing |--=  eth0 |=-| xenbr0 |------[vifC.0]-= eth0 |   (domC)   | |&lt;br /&gt;
| |             |_____-|          /----|        |  |______-|  | Switch or VLAN  |  |-______|  |        |----\          |-_____|            | |&lt;br /&gt;
| |                    |          |    |        |          |  |_________________|  |          |        |    |          |                   | |&lt;br /&gt;
| |              ______|          |    |________|          |                       |          |________|    |          |______             | |&lt;br /&gt;
| |             | eth1 =-[vifA.2]-+-\                      |                       |                      /-+-[vivC.2]-= eth1 |            | |&lt;br /&gt;
| | [Active]    |_____-|          | |                      |                       |                      | |          |-_____|   [Backup] | |&lt;br /&gt;
| |____________________|          | |                      |                       |                      | |          |___________________| |&lt;br /&gt;
|                                 | |                      |                       |                      | |                                |&lt;br /&gt;
|  ____________________           | |                      |                       |                      | |           ___________________  |&lt;br /&gt;
| | vm0002_win1  ______|          | |               _______|   _________________   |_______               | |          |______ vm0002_win1 | |&lt;br /&gt;
| |   (domB)    | eth0 =-[vifB.0]-/ |              | eth1  =--|    Storage      |--=  eth1 |              | \-[vifD.0]-= eth0 |   (domD)   | |&lt;br /&gt;
| |             |_____-|            |              |______-|  | Switch or VLAN  |  |-______|              |            |-_____|            | |&lt;br /&gt;
| |                    |            |                      |  |_________________|  |                      |            |                   | |&lt;br /&gt;
| |              ______|            |                      |                       |                      |            |______             | |&lt;br /&gt;
| |             | eth1 =-[vifB.2]-\ |                      |                       |                      | /-[vifD.2]-= eth1 |            | |&lt;br /&gt;
| | [Backup]    |_____-|          | |                      |                       |                      | |          |-_____|   [Active] | |&lt;br /&gt;
| |____________________|          | |                      |                       |                      | |          |___________________| |&lt;br /&gt;
|                                 | |                      |                       |                      | |                                |&lt;br /&gt;
|                                 | |   ________    _______|   _________________   |_______    ________   | |                                |&lt;br /&gt;
|                                 | \--| xenbr2 |-=| eth2  =--|  Back-Channel   |--=  eth2 |=-| xenbr2 |--/ |                                |&lt;br /&gt;
|                                 \----|        |  |______-|  | Switch or VLAN  |  |-______|  |        |----/                                |&lt;br /&gt;
|                                      |        |          |  |_________________|  |          |        |                                     |&lt;br /&gt;
|                                      |________|          |                       |          |________|                                     |&lt;br /&gt;
|                                                          |                       |                                                         |&lt;br /&gt;
|                                                          |                       |                                                         |&lt;br /&gt;
|                                                          |                       |                                                         |&lt;br /&gt;
|                                                          |                       |                                                         |&lt;br /&gt;
|                                                          |                       |                                                         |&lt;br /&gt;
|__________________________________________________________|                       |_________________________________________________________|&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Making Network Interfaces Available To Xen Clients ==&lt;br /&gt;
&lt;br /&gt;
As discussed above, Xen makes some significant changes to the [[dom0]] network, which happens to be where the cluster will operate. These changes including shutting down and moving around the interfaces. As we will discuss later, this behaviour can trigger cluster failures. This is the main reason for dealing with Xen now. Once the changes are in place, the network is stable and safe for running the cluster on.&lt;br /&gt;
&lt;br /&gt;
=== A Brief Overview ===&lt;br /&gt;
&lt;br /&gt;
By default, Xen only makes &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth0&amp;lt;/span&amp;gt; available to the virtual machines. We will want to add &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth2&amp;lt;/span&amp;gt; as well, as we will use the &#039;&#039;Back Channel Network&#039;&#039; for inter-VM communication. We do &#039;&#039;&#039;not&#039;&#039;&#039; want to add the &#039;&#039;Storage Network&#039;&#039; to Xen though! Doing so puts the DRBD link at risk. Should &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xend&amp;lt;/span&amp;gt; get shut down, it could trigger a [[split-brain]] in DRBD.&lt;br /&gt;
&lt;br /&gt;
What Xen does, in brief, is move the &amp;quot;real&amp;quot; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth0&amp;lt;/span&amp;gt; over to a new device called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;peth0&amp;lt;/span&amp;gt;. Then it creates a virtual &amp;quot;clone&amp;quot; of the network interface called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth0&amp;lt;/span&amp;gt;. Next, Xen creates a [[bridge]] called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xenbr0&amp;lt;/span&amp;gt;. Finally, both the real &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;peth0&amp;lt;/span&amp;gt; and the new virtual &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth0&amp;lt;/span&amp;gt; are connected to the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xenbr0&amp;lt;/span&amp;gt; bridge.&lt;br /&gt;
&lt;br /&gt;
The reasoning behind all this is to separate the traffic coming to and from [[dom0]] from any traffic doing to the various [[domU]]s. Think of it sort of like the bridge being a network switch, the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;peth0&amp;lt;/span&amp;gt; being an uplink cable to the outside world and the virtual &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth0&amp;lt;/span&amp;gt; being [[dom0]]&#039;s &amp;quot;port&amp;quot; on the switch. We want the same to be done to the interface on the &#039;&#039;Back-Channel Network&#039;&#039;, too. The &#039;&#039;Storage Network&#039;&#039; will never be exposed to the [[domU]] machines, so combining the risk to the underlying storage, there is no reason to add &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth1&amp;lt;/span&amp;gt; to Xen&#039;s control.&lt;br /&gt;
&lt;br /&gt;
=== Disable the &#039;qemu&#039; Bridge ===&lt;br /&gt;
&lt;br /&gt;
By default, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[libvirtd]]&amp;lt;/span&amp;gt; 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. &lt;br /&gt;
&lt;br /&gt;
So to remove this bridge, simply delete the contents of the file, stop the bridge, delete the bridge and then stop &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;iptables&amp;lt;/span&amp;gt; to make sure any rules created for the bridge are flushed.&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;
ifconfig virbr0 down&lt;br /&gt;
brctl delbr virbr0&lt;br /&gt;
/etc/init.d/iptables stop&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Setting Up Bridges ===&lt;br /&gt;
&lt;br /&gt;
By default, Xen creates the bridges it will need when it starts. This works fine with basic configuration, but is no longer recommended.&lt;br /&gt;
&lt;br /&gt;
Bridges are very much like software network switches. Interfaces can be connected to them and then use them to pass data back and forth. As virtual machines are created, they will have a special &amp;quot;virtual&amp;quot; interface created. These &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vifX.Y&amp;lt;/span&amp;gt; devices are very much like a network cable between a normal server and a switch. In Xen, the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;X&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Y&amp;lt;/span&amp;gt; in the name &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vifX.Y&amp;lt;/span&amp;gt; corresponds to the domain ID, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;X&amp;lt;/span&amp;gt; and the bridge ID &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Y&amp;lt;/span&amp;gt;. For example, if you create a [[domU]] which is given the ID of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;5&amp;lt;/span&amp;gt; and you are connecting two interfaces within domU to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xenbr0&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xenbr2&amp;lt;/span&amp;gt;, you will see two virtual interfaces created, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vif5.0&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vif5.2&amp;lt;/span&amp;gt;, which connect the domU&#039;s &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;eth1&amp;lt;/span&amp;gt; to the bridges, respectively.&lt;br /&gt;
&lt;br /&gt;
If you found the above confusing, please take a look at the article below:&lt;br /&gt;
&lt;br /&gt;
* [[Networking in Xen 3.x]]&lt;br /&gt;
&lt;br /&gt;
We will now create bridges in each node for the &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; interfaces. We aren&#039;t bothering with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth1&amp;lt;/span&amp;gt; as it will only be used for storage traffic and thus will never need to be seen or used by any domU. To create the bridges, we need to do two things;&lt;br /&gt;
* Create the bridge configuration files; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/sysconfig/network-scripts/ifcfg-xenbr0&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/sysconfig/network-scripts/ifcfg-xenbr2&amp;lt;/span&amp;gt;&lt;br /&gt;
* Change the interface configuration files and connect the interfaces to the bridge.&lt;br /&gt;
&lt;br /&gt;
Note that when we create the bridge scripts, we will move the IP address information from the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ethX&amp;lt;/span&amp;gt; device to the corresponding &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xenbrX&amp;lt;/span&amp;gt; configuration file. This means that, after this change, you will see the IP address on the bridge, &#039;&#039;not&#039;&#039; the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ethX&amp;lt;/span&amp;gt; device. This is normal.&lt;br /&gt;
&lt;br /&gt;
{{note|1=It is not necessary to stop the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;network&amp;lt;/span&amp;gt; daemon before making these changes. Once you&#039;ve begun the edits though, do be careful though not to restart networking until you are complete. These changes will somewhat dramatically alter your network configuration. If you leave the network up, be aware that when you do restart the network, you will see a warning like: &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Shutting down interface eth0:  bridge xenbr0 does not exist!&amp;lt;/span&amp;gt;. This is ok.}}&lt;br /&gt;
&lt;br /&gt;
First, create the two bridge configuration files.&lt;br /&gt;
&lt;br /&gt;
For &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xenbr0&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/sysconfig/network-scripts/ifcfg-xenbr0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
# Bridge created for Xen&lt;br /&gt;
DEVICE=xenbr0&lt;br /&gt;
TYPE=Bridge&lt;br /&gt;
BOOTPROTO=static&lt;br /&gt;
IPADDR=192.168.1.74&lt;br /&gt;
NETMASK=255.255.255.0&lt;br /&gt;
GATEWAY=192.168.1.254&lt;br /&gt;
DNS1=192.139.81.117&lt;br /&gt;
DNS2=192.139.81.1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xenbr2&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/sysconfig/network-scripts/ifcfg-xenbr2&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
# Bridge created for Xen&lt;br /&gt;
DEVICE=xenbr2&lt;br /&gt;
TYPE=Bridge&lt;br /&gt;
BOOTPROTO=static&lt;br /&gt;
IPADDR=192.168.3.74&lt;br /&gt;
NETMASK=255.255.255.0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Next, edit the corresponding &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ethX&amp;lt;/span&amp;gt; devices. This will involve adding a &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;BRIDGE=xenbrX&amp;lt;/span&amp;gt; line and removing all of the IP address information. Below are the updated &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; devices after the changes have been made with a &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;diff&amp;lt;/span&amp;gt; showing exactly how the files changed.&lt;br /&gt;
&lt;br /&gt;
For &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth0&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;
cp /etc/sysconfig/network-scripts/ifcfg-eth0 /etc/sysconfig/network-scripts/ifcfg-eth0.orig&lt;br /&gt;
vim /etc/sysconfig/network-scripts/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;
# Realtek Semiconductor Co., Ltd. RTL8111/8168B PCI Express Gigabit Ethernet controller&lt;br /&gt;
HWADDR=48:5B:39:3C:53:14&lt;br /&gt;
DEVICE=eth0&lt;br /&gt;
BRIDGE=xenbr0&lt;br /&gt;
BOOTPROTO=static&lt;br /&gt;
ONBOOT=yes&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;
diff -u /etc/sysconfig/network-scripts/ifcfg-eth0.orig /etc/sysconfig/network-scripts/ifcfg-eth0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;diff&amp;quot;&amp;gt;&lt;br /&gt;
--- /etc/sysconfig/network-scripts/ifcfg-eth0.orig	2011-05-02 15:05:56.000000000 -0400&lt;br /&gt;
+++ /etc/sysconfig/network-scripts/ifcfg-eth0	2011-05-02 15:01:34.000000000 -0400&lt;br /&gt;
@@ -1,10 +1,6 @@&lt;br /&gt;
 # Realtek Semiconductor Co., Ltd. RTL8111/8168B PCI Express Gigabit Ethernet controller&lt;br /&gt;
 HWADDR=48:5B:39:3C:53:14&lt;br /&gt;
 DEVICE=eth0&lt;br /&gt;
+BRIDGE=xenbr0&lt;br /&gt;
 BOOTPROTO=static&lt;br /&gt;
 ONBOOT=yes&lt;br /&gt;
-IPADDR=192.168.1.74&lt;br /&gt;
-NETMASK=255.255.255.0&lt;br /&gt;
-GATEWAY=192.168.1.254&lt;br /&gt;
-DNS1=192.139.81.117&lt;br /&gt;
-DNS2=192.139.81.1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth2&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;
cp /etc/sysconfig/network-scripts/ifcfg-eth2 /etc/sysconfig/network-scripts/ifcfg-eth2.orig&lt;br /&gt;
vim /etc/sysconfig/network-scripts/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 82574L Gigabit Network Connection&lt;br /&gt;
HWADDR=00:1B:21:72:96:EA&lt;br /&gt;
DEVICE=eth2&lt;br /&gt;
BRIDGE=xenbr2&lt;br /&gt;
BOOTPROTO=static&lt;br /&gt;
ONBOOT=yes&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;
diff -u /etc/sysconfig/network-scripts/ifcfg-eth2.orig /etc/sysconfig/network-scripts/ifcfg-eth2&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;diff&amp;quot;&amp;gt;&lt;br /&gt;
--- /etc/sysconfig/network-scripts/ifcfg-eth2.orig	2011-05-02 15:08:36.000000000 -0400&lt;br /&gt;
+++ /etc/sysconfig/network-scripts/ifcfg-eth2	2011-05-02 15:08:20.000000000 -0400&lt;br /&gt;
@@ -1,7 +1,6 @@&lt;br /&gt;
 # Intel Corporation 82574L Gigabit Network Connection&lt;br /&gt;
 HWADDR=00:1B:21:72:96:EA&lt;br /&gt;
 DEVICE=eth2&lt;br /&gt;
+BRIDGE=xenbr2&lt;br /&gt;
 BOOTPROTO=static&lt;br /&gt;
 ONBOOT=yes&lt;br /&gt;
-IPADDR=192.168.3.74&lt;br /&gt;
-NETMASK=255.255.255.0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now restart the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;network&amp;lt;/span&amp;gt; daemon. As noted, do not be concerned about the shutdown warnings, they should appear only once.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/network 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;
Shutting down interface eth0:  bridge xenbr0 does not exist!&lt;br /&gt;
                                                           [  OK  ]&lt;br /&gt;
Shutting down interface eth1:                              [  OK  ]&lt;br /&gt;
Shutting down interface eth2:  bridge xenbr2 does not exist!&lt;br /&gt;
                                                           [  OK  ]&lt;br /&gt;
Shutting down loopback interface:                          [  OK  ]&lt;br /&gt;
Bringing up loopback interface:                            [  OK  ]&lt;br /&gt;
Bringing up interface eth0:                                [  OK  ]&lt;br /&gt;
Bringing up interface eth1:                                [  OK  ]&lt;br /&gt;
Bringing up interface eth2:                                [  OK  ]&lt;br /&gt;
Bringing up interface xenbr0:                              [  OK  ]&lt;br /&gt;
Bringing up interface xenbr2:                              [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can check that the bridges are up and that the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ethX&amp;lt;/span&amp;gt; interfaces are connected to them using the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;brctl&amp;lt;/span&amp;gt; tool.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
brctl show&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
bridge name	bridge id		STP enabled	interfaces&lt;br /&gt;
virbr0		8000.000000000000	yes		&lt;br /&gt;
xenbr0		8000.485b393c5314	no		eth0&lt;br /&gt;
xenbr2		8000.001b217296ea	no		eth2&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We&#039;ll see this reflected in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;iptables&amp;lt;/span&amp;gt; output as well.&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;
          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:276 errors:0 dropped:0 overruns:0 frame:0&lt;br /&gt;
          TX packets:168 errors:0 dropped:0 overruns:0 carrier:0&lt;br /&gt;
          collisions:0 txqueuelen:1000 &lt;br /&gt;
          RX bytes:47553 (46.4 KiB)  TX bytes:25555 (24.9 KiB)&lt;br /&gt;
          Interrupt:246 Base address:0xe000 &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:123 errors:0 dropped:0 overruns:0 frame:0&lt;br /&gt;
          TX packets:55 errors:0 dropped:0 overruns:0 carrier:0&lt;br /&gt;
          collisions:0 txqueuelen:1000 &lt;br /&gt;
          RX bytes:25758 (25.1 KiB)  TX bytes:9364 (9.1 KiB)&lt;br /&gt;
          Interrupt:17 Memory:feae0000-feb00000 &lt;br /&gt;
&lt;br /&gt;
eth2      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 MULTICAST  MTU:1500  Metric:1&lt;br /&gt;
          RX packets:161 errors:0 dropped:0 overruns:0 frame:0&lt;br /&gt;
          TX packets:69 errors:0 dropped:0 overruns:0 carrier:0&lt;br /&gt;
          collisions:0 txqueuelen:1000 &lt;br /&gt;
          RX bytes:31049 (30.3 KiB)  TX bytes:13329 (13.0 KiB)&lt;br /&gt;
          Interrupt:16 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:8 errors:0 dropped:0 overruns:0 frame:0&lt;br /&gt;
          TX packets:8 errors:0 dropped:0 overruns:0 carrier:0&lt;br /&gt;
          collisions:0 txqueuelen:0 &lt;br /&gt;
          RX bytes:560 (560.0 b)  TX bytes:560 (560.0 b)&lt;br /&gt;
&lt;br /&gt;
xenbr0    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:252 errors:0 dropped:0 overruns:0 frame:0&lt;br /&gt;
          TX packets:153 errors:0 dropped:0 overruns:0 carrier:0&lt;br /&gt;
          collisions:0 txqueuelen:0 &lt;br /&gt;
          RX bytes:41073 (40.1 KiB)  TX bytes:21327 (20.8 KiB)&lt;br /&gt;
&lt;br /&gt;
xenbr2    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:138 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:25913 (25.3 KiB)  TX bytes:9396 (9.1 KiB)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now let&#039;s move on to the main Xen configuration file!&lt;br /&gt;
&lt;br /&gt;
=== Editing the /etc/xen/xend-config.sxp Configuration File ===&lt;br /&gt;
&lt;br /&gt;
We need to do two things here:&lt;br /&gt;
* Tell Xen to enable it&#039;s unix socket so that external tools can manage it (if needed).&lt;br /&gt;
* Tell Xen to not handle bridge configuration.&lt;br /&gt;
* Enable Live Migration of VMs between nodes.&lt;br /&gt;
&lt;br /&gt;
Begin editing the Xen configuration file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/xen/xend-config.sxp /etc/xen/xend-config.sxp.orig&lt;br /&gt;
vim /etc/xen/xend-config.sxp&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{note|1=It would see that, by default, Xen now enables it&#039;s unix socket. As such, this step may not be needed.}}&lt;br /&gt;
&lt;br /&gt;
Configure Xen to enable it&#039;s unix socket. This is how tools like &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virsh&amp;lt;/span&amp;gt;, which we will look at later, interact with Xen. To do this, change &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xend-unix-server&amp;lt;/span&amp;gt;, which is around line &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;19&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;
(xend-unix-server yes)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Edit the &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 &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/bin/true&amp;lt;/span&amp;gt;. This let&#039;s the script succeed without actually doing anything. We want this behavious because we created the bridges ourselves outside of Xen.&lt;br /&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;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To enable live migration, we need to edit four values. Let&#039;s look at the new values, then we&#039;ll discuss what they effect and how their syntax works.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
(xend-relocation-server yes)&lt;br /&gt;
(xend-relocation-port 8002)&lt;br /&gt;
(xend-relocation-address &#039;an-node04.bcn&#039;)&lt;br /&gt;
(xend-relocation-hosts-allow &#039;&#039;)&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;xend-unix-server&amp;lt;/span&amp;gt;; When set to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;yes&amp;lt;/span&amp;gt;, this tells Xen to enable it&#039;s unix socket. This is needed by management tools like &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[virsh]]&amp;lt;/span&amp;gt;.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xend-relocation-server&amp;lt;/span&amp;gt;; When set to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;yes&amp;lt;/span&amp;gt;, this tells Xen to allow the migration of [[VM]]s.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xend-relocation-port&amp;lt;/span&amp;gt;; This controls what [[TCP]] port that Xen listens for migration requests.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xend-relocation-address&amp;lt;/span&amp;gt;; This is an IP address or resolvable name that must match an IP address of an interface on the local machine. This binds Xen&#039;s migration to the given interface. If set to just &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;amp;#39;&amp;amp;#39;&amp;lt;/span&amp;gt;, Xen will listen for connections on all interfaces.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xend-relocation-hosts-allow&amp;lt;/span&amp;gt;; This is a space-separated list of host names, IP addresses and regular expressions of hosts that are allowed to be migration sources and targets. Some examples are; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04 an-node05 ^192\.168\.*$&amp;lt;/span&amp;gt;. If set to just &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;amp;#39;&amp;amp;#39;&amp;lt;/span&amp;gt;, Xen will allow migration to or from all nodes on the network. As we&#039;ve already restricted migrate to the &#039;&#039;&#039;BCN&#039;&#039;&#039; by way of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xend-relocation-address &#039;an-node04.bcn&#039;&amp;lt;/span&amp;gt;, it&#039;s save to leave this open to any host.&lt;br /&gt;
&lt;br /&gt;
{{note|1=Be sure that you set &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xend-relocation-address&amp;lt;/span&amp;gt; is set uniquely for each node.}}&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;diff&amp;lt;/span&amp;gt; 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;
diff -u /etc/xen/xend-config.sxp.orig /etc/xen/xend-config.sxp&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;diff&amp;quot;&amp;gt;&lt;br /&gt;
--- /etc/xen/xend-config.sxp.orig	2011-05-02 15:52:27.000000000 -0400&lt;br /&gt;
+++ /etc/xen/xend-config.sxp	2011-05-02 16:01:33.000000000 -0400&lt;br /&gt;
@@ -19,6 +19,7 @@&lt;br /&gt;
 #(xend-tcp-xmlrpc-server no)&lt;br /&gt;
 #(xend-unix-xmlrpc-server yes)&lt;br /&gt;
 #(xend-relocation-server no)&lt;br /&gt;
+(xend-relocation-server yes)&lt;br /&gt;
 # The relocation server should be kept desactivated unless using a trusted&lt;br /&gt;
 # network, the domain virtual memory will be exchanged in raw form without&lt;br /&gt;
 # encryption of the communication. See also xend-relocation-hosts-allow option&lt;br /&gt;
@@ -31,6 +32,7 @@&lt;br /&gt;
 # Port xend should use for the relocation interface, if xend-relocation-server&lt;br /&gt;
 # is set.&lt;br /&gt;
 #(xend-relocation-port 8002)&lt;br /&gt;
+(xend-relocation-port 8002)&lt;br /&gt;
 &lt;br /&gt;
 # Address xend should listen on for HTTP connections, if xend-http-server is&lt;br /&gt;
 # set.&lt;br /&gt;
@@ -45,6 +47,7 @@&lt;br /&gt;
 # Also, interface name is allowed (e.g. eth0) there to get the&lt;br /&gt;
 # relocation address to be bound on.&lt;br /&gt;
 #(xend-relocation-address &#039;&#039;)&lt;br /&gt;
+(xend-relocation-address &#039;an-node04.bcn&#039;)&lt;br /&gt;
 &lt;br /&gt;
 # The hosts allowed to talk to the relocation port.  If this is empty (the&lt;br /&gt;
 # default), then all connections are allowed (assuming that the connection&lt;br /&gt;
@@ -57,8 +60,8 @@&lt;br /&gt;
 # For example:&lt;br /&gt;
 #  (xend-relocation-hosts-allow &#039;^localhost$ ^.*\.example\.org$&#039;)&lt;br /&gt;
 #&lt;br /&gt;
-#(xend-relocation-hosts-allow &#039;&#039;)&lt;br /&gt;
-(xend-relocation-hosts-allow &#039;^localhost$ ^localhost\\.localdomain$&#039;)&lt;br /&gt;
+(xend-relocation-hosts-allow &#039;&#039;)&lt;br /&gt;
+#(xend-relocation-hosts-allow &#039;^localhost$ ^localhost\\.localdomain$&#039;)&lt;br /&gt;
 &lt;br /&gt;
 # The limit (in kilobytes) on the size of the console buffer&lt;br /&gt;
 #(console-limit 1024)&lt;br /&gt;
@@ -90,7 +93,8 @@&lt;br /&gt;
 # two fake interfaces per guest domain.  To do things like this, write&lt;br /&gt;
 # yourself a wrapper script, and call network-bridge from it, as appropriate.&lt;br /&gt;
 #&lt;br /&gt;
-(network-script network-bridge)&lt;br /&gt;
+#(network-script network-bridge)&lt;br /&gt;
+(network-script /bin/true)&lt;br /&gt;
 &lt;br /&gt;
 # The script used to control virtual interfaces.  This can be overridden on a&lt;br /&gt;
 # per-vif basis when creating a domain or a configuring a new vif.  The&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Make the changes take effect by (re)starting &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;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
restart xend:                                              [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Cluster Setup =&lt;br /&gt;
&lt;br /&gt;
In [[Red Hat]] Cluster Services, the heart of the cluster is found in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[RHCS v2 cluster.conf|/etc/cluster/cluster.conf]]&amp;lt;/span&amp;gt; [[XML]] configuration file.&lt;br /&gt;
&lt;br /&gt;
There are three main ways of editing this file. Two are already well documented, so I won&#039;t bother discussing them, beyond introducing them. The third way is by directly hand-crafting the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cluster.conf&amp;lt;/span&amp;gt; file. This method is not very well documented, and directly manipulating configuration files is my preferred method. As my boss loves to say; &amp;quot;&#039;&#039;The more computers do for you, the more they do to you&#039;&#039;&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
The first two, well documented, graphical tools are:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[http://docs.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/5/html/Cluster_Administration/ch-config-scc-CA.html system-config-cluster]&amp;lt;/span&amp;gt;, older GUI tool run directly from one of the cluster nodes.&lt;br /&gt;
* [http://docs.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/5/html/Cluster_Administration/ch-config-conga-CA.html Conga], comprised of the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ricci&amp;lt;/span&amp;gt; node-side client and the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;luci&amp;lt;/span&amp;gt; web-based server (can be run on machines outside the cluster).&lt;br /&gt;
&lt;br /&gt;
I do like the tools above, but I often find issues that send me back to the command line. I&#039;d recommend setting them aside for now as well. Once you feel comfortable with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cluster.conf&amp;lt;/span&amp;gt; syntax, then by all means, go back and use them. I&#039;d recommend not relying on them though, which might be the case if you try to use them too early in your studies.&lt;br /&gt;
&lt;br /&gt;
== The First cluster.conf Foundation Configuration ==&lt;br /&gt;
&lt;br /&gt;
The very first stage of building the cluster is to create a configuration file that is as minimal as possible. To do that, we need to define a few thing;&lt;br /&gt;
&lt;br /&gt;
* The name of the cluster and the cluster file version.&lt;br /&gt;
** Define &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt; options&lt;br /&gt;
** The nodes in the cluster&lt;br /&gt;
*** The fence method for each node&lt;br /&gt;
** Define fence devices&lt;br /&gt;
** Define &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fenced&amp;lt;/span&amp;gt; options&lt;br /&gt;
&lt;br /&gt;
That&#039;s it. Once we&#039;ve defined this minimal amount, we will be able to start the cluster for the first time! So lets get to it, finally.&lt;br /&gt;
&lt;br /&gt;
=== Name the Cluster and Set The Configuration Version ===&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[RHCS_v2_cluster.conf#cluster.3B_The_Parent_Tag|cluster]]&amp;lt;/span&amp;gt; tag is the parent tag for the entire cluster configuration file.&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-cluster01&amp;quot; config_version=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/cluster&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This has two attributes that we need to set are &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;name=&amp;quot;&amp;quot;&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;config_version=&amp;quot;&amp;quot;&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[RHCS v2 cluster.conf#name|name]]=&amp;quot;&amp;quot;&amp;lt;/span&amp;gt; attribute defines the name of the cluster. It must be unique amongst the clusters on your network. It should be descriptive, but you will not want to make it too long, either. You will see this name in the various cluster tools and you will enter in, for example, when creating a [[GFS2]] partition later on. This tutorial uses the cluster name &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an_cluster&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[RHCS v2 cluster.conf#config_version|config_version]]=&amp;quot;&amp;quot;&amp;lt;/span&amp;gt; attribute is an integer marking the version of the configuration file. Whenever you make a change to the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cluster.conf&amp;lt;/span&amp;gt; file, you will need to increment this version number by 1. If you don&#039;t increment this number, then the cluster tools will not know that the file needs to be reloaded. As this is the first version of this configuration file, it will start with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt;. Note that this tutorial will increment the version after every change, regardless of whether it is explicitly pushed out to the other nodes and reloaded. The reason is to help get into the habit of always increasing this value.&lt;br /&gt;
&lt;br /&gt;
=== Configuring cman Options ===&lt;br /&gt;
&lt;br /&gt;
We are going to setup a special case for our cluster; A 2-Node cluster.&lt;br /&gt;
&lt;br /&gt;
This is a special case because traditional quorum will not be useful. With only two nodes, each having a vote of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt;, the total votes is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;2&amp;lt;/span&amp;gt;. Quorum needs &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;50% + 1&amp;lt;/span&amp;gt;, which means that a single node failure would shut down the cluster, as the remaining node&#039;s vote is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;50%&amp;lt;/span&amp;gt; exactly. That kind of defeats the purpose to having a cluster at all.&lt;br /&gt;
&lt;br /&gt;
So to account for this special case, there is a special attribute called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[RHCS_v2_cluster.conf#two_node|two_node]]=&amp;quot;1&amp;quot;&amp;lt;/span&amp;gt;. This tells the cluster manager to continue operating with only one vote. This option requires that the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[RHCS_v2_cluster.conf#expected_votes|expected_votes]]=&amp;quot;&amp;quot;&amp;lt;/span&amp;gt; attribute be set to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt;. Normally, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;expected_votes&amp;lt;/span&amp;gt; is set automatically to the total sum of the defined cluster nodes&#039; votes (which itself is a default of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt;). This is the other half of the &amp;quot;trick&amp;quot;, as a single node&#039;s vote of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt; now always provides quorum (that is, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt; meets the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;50% + 1&amp;lt;/span&amp;gt; requirement).&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-cluster01&amp;quot; config_version=&amp;quot;2&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;cman expected_votes=&amp;quot;1&amp;quot; two_node=&amp;quot;1&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/cluster&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Take note of the self-closing &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;... /&amp;gt;&amp;lt;/span&amp;gt; tag. This is an [[XML]] syntax that tells the parser not to look for any child or a closing tags.&lt;br /&gt;
&lt;br /&gt;
=== Defining Cluster Nodes ===&lt;br /&gt;
&lt;br /&gt;
This example is a little artificial, please don&#039;t load it into your cluster as we will need to add a few child tags, but one thing at a time.&lt;br /&gt;
&lt;br /&gt;
This actually introduces two tags.&lt;br /&gt;
&lt;br /&gt;
The first is parent &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[RHCS_v2_cluster.conf#clusternodes.3B_Defining_Cluster_Nodes|clusternodes]]&amp;lt;/span&amp;gt; tag, which takes no variables of it&#039;s own. It&#039;s sole purpose is to contain the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[RHCS_v2_cluster.conf#Tag.3B_clusternode|clusternode]]&amp;lt;/span&amp;gt; child tags. &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-cluster01&amp;quot; config_version=&amp;quot;3&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;cman expected_votes=&amp;quot;1&amp;quot; two_node=&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-node04.alteeve.com&amp;quot; nodeid=&amp;quot;1&amp;quot; /&amp;gt;&lt;br /&gt;
		&amp;lt;clusternode name=&amp;quot;an-node05.alteeve.com&amp;quot; nodeid=&amp;quot;2&amp;quot; /&amp;gt;&lt;br /&gt;
	&amp;lt;/clusternodes&amp;gt;&lt;br /&gt;
&amp;lt;/cluster&amp;gt;&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;[[RHCS_v2_cluster.conf#Tag.3B_clusternode|clusternode]]&amp;lt;/span&amp;gt; tag defines each cluster node. There are many attributes available, but we will look at just the two required ones. &lt;br /&gt;
&lt;br /&gt;
The first is the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[RHCS_v2_cluster.conf#clusternode.27s_name_attribute|name]]=&amp;quot;&amp;quot;&amp;lt;/span&amp;gt; attribute. This &#039;&#039;&#039;should&#039;&#039;&#039; match the name given by &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;uname -n&amp;lt;/span&amp;gt; (&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;$HOSTNAME&amp;lt;/span&amp;gt;) when run on each node. The [[IP]] address that the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;name&amp;lt;/span&amp;gt; resolves to also sets the interface and subnet that the [[totem]] ring will run on. That is, the main cluster communications, which we are calling the &#039;&#039;&#039;Back-Channel Network&#039;&#039;&#039;. This is why it is so important to setup our &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[Red_Hat_Cluster_Service_2_Tutorial#Setup_.2Fetc.2Fhosts|/etc/hosts]]&amp;lt;/span&amp;gt; file correctly. Please see the [[RHCS_v2_cluster.conf#clusternode.27s_name_attribute|clusternode&#039;s name]] attribute document for details on how name to interface mapping is resolved.&lt;br /&gt;
&lt;br /&gt;
The second attribute is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[RHCS_v2_cluster.conf#clusternode.27s_nodeid_attribute|nodeid]]=&amp;quot;&amp;quot;&amp;lt;/span&amp;gt;. This must be a unique integer amongst the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;clusternode ...&amp;gt;&amp;lt;/span&amp;gt; tags. It is used by the cluster to identify the node.&lt;br /&gt;
&lt;br /&gt;
=== Defining Fence Devices ===&lt;br /&gt;
&lt;br /&gt;
[[Red_Hat_Cluster_Service_2_Tutorial#Concept.3B_Fencing|Fencing]] devices are designed to forcible eject a node from a cluster. This is done by forcing it to power off or reboot, generally. Some [[SAN]] switches can logically disconnect a node from the shared storage device, which has the same effect of guaranteeing that the defective node can not alter the shared storage. A common, third type of fence device is one that cuts the mains power to the server.&lt;br /&gt;
&lt;br /&gt;
All fence devices are contained withing the parent &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[RHCS_v2_cluster.conf#fencedevices.3B_Defining_Fence_Devices|fencedevices]]&amp;lt;/span&amp;gt; tag. This parent tag has no attributes. Within this parent tag are one or more &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[RHCS_v2_cluster.conf#Tag.3B_fencedevice|fencedevice]]&amp;lt;/span&amp;gt; child tags.&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-cluster01&amp;quot; config_version=&amp;quot;4&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;cman expected_votes=&amp;quot;1&amp;quot; two_node=&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-node04.alteeve.com&amp;quot; nodeid=&amp;quot;1&amp;quot; /&amp;gt;&lt;br /&gt;
		&amp;lt;clusternode name=&amp;quot;an-node05.alteeve.com&amp;quot; nodeid=&amp;quot;2&amp;quot; /&amp;gt;&lt;br /&gt;
	&amp;lt;/clusternodes&amp;gt;&lt;br /&gt;
	&amp;lt;fencedevices&amp;gt;&lt;br /&gt;
		&amp;lt;fencedevice agent=&amp;quot;fence_na&amp;quot; ipaddr=&amp;quot;fence_na01.alteeve.com&amp;quot; login=&amp;quot;admin&amp;quot; name=&amp;quot;fence_na01&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;
Every fence device used in your cluster will have it&#039;s own &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[RHCS_v2_cluster.conf#Tag.3B_fencedevice|fencedevice]]&amp;lt;/span&amp;gt; tag. If you are using [[IPMI]], this means you will have a &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fencedevice&amp;lt;/span&amp;gt; entry for each node, as each physical IPMI [[BMC]] is a unique fence device.&lt;br /&gt;
&lt;br /&gt;
All &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fencedevice&amp;lt;/span&amp;gt; tags share two basic attributes; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[RHCS_v2_cluster.conf#fencedevice.27s_name_attribute|name]]=&amp;quot;&amp;quot;&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[RHCS_v2_cluster.conf#fencedevice.27s_agent_attribute|agent]]=&amp;quot;&amp;quot;&amp;lt;/span&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
* The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;name&amp;lt;/span&amp;gt; attribute must be unique among all the fence devices in your cluster. As we will see in the next step, this name will be used within the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;clusternode...&amp;gt;&amp;lt;/span&amp;gt; tag. &lt;br /&gt;
* The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;agent&amp;lt;/span&amp;gt; tag tells the cluster which [[fence agent]] to use when the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[fenced]]&amp;lt;/span&amp;gt; daemon needs to communicate with the physical fence device. A fence agent is simple a shell script that acts as a glue layer between the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fenced&amp;lt;/span&amp;gt; daemon and the fence hardware. This agent takes the arguments from the daemon, like what port to act on and what action to take, and executes the node. The agent is responsible for ensuring that the execution succeeded and returning an appropriate success or failure exit code, depending. For those curious, the full details are described in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[http://sources.redhat.com/cluster/wiki/FenceAgentAPI FenceAgentAPI]&amp;lt;/span&amp;gt;. If you have two or more of the same fence device, like IPMI, then you will use the same fence &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;agent&amp;lt;/span&amp;gt; value a corresponding number of times.&lt;br /&gt;
&lt;br /&gt;
Beyond these two attributes, each fence agent will have it&#039;s own subset of attributes. The scope of which is outside this tutorial, though we will see examples for IPMI, a switched PDU and a [[Node Assassin]]. Most, if not all, fence agents have a corresponding man page that will show you what attributes it accepts and how they are used. The two fence agents we will see here have their attributes defines in the following &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[man]]&amp;lt;/span&amp;gt; pages.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;man fence_na&amp;lt;/span&amp;gt; - Node Assassin fence agent&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;man fence_ipmilan&amp;lt;/span&amp;gt; - IPMI fence agent&lt;br /&gt;
&lt;br /&gt;
The example above is what this tutorial will use.&lt;br /&gt;
&lt;br /&gt;
==== Example &amp;lt;fencedevice...&amp;gt; Tag For Node Assassin ====&lt;br /&gt;
&lt;br /&gt;
This is the device used throughout this tutorial. It is for the open source, open hardware [[Node Assassin]] fence device that you can build yourself.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;fencedevices&amp;gt;&lt;br /&gt;
		&amp;lt;fencedevice agent=&amp;quot;fence_na&amp;quot; ipaddr=&amp;quot;fence_na01.alteeve.com&amp;quot; login=&amp;quot;admin&amp;quot; name=&amp;quot;fence_na01&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;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Being a network-attached fence device, as most fence devices are, the attributes for &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fence_na&amp;lt;/span&amp;gt; include connection information. The attribute variable names are generally the same across fence agents, and they are:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ipaddr&amp;lt;/span&amp;gt;; This is the resolvable name or [[IP]] address of the device. If you use a resolvable name, it is strongly advised that you put the name in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/hosts&amp;lt;/span&amp;gt; as [[DNS]] is another layer of abstraction which could fail.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;login&amp;lt;/span&amp;gt;; This is the login name to use when the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fenced&amp;lt;/span&amp;gt; daemon connects to the device. This is configured in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/cluster/fence_na.conf&amp;lt;/span&amp;gt;.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;passwd&amp;lt;/span&amp;gt;; This is the login password to use when the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fenced&amp;lt;/span&amp;gt; daemon connects to the device. This is also configured in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/cluster/fence_na.conf&amp;lt;/span&amp;gt;.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;name&amp;lt;/span&amp;gt;; This is the name of this particular fence device within the cluster which, as we will see shortly, is matched in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;clusternode...&amp;gt;&amp;lt;/span&amp;gt; element where appropriate.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;quiet&amp;lt;/span&amp;gt;; This is a Node Assassin specific argument. It is used to generate no output to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[STDOUT]]&amp;lt;/span&amp;gt; when run, as there is no terminal to print to or user to view it.&lt;br /&gt;
&lt;br /&gt;
==== Example &amp;lt;fencedevice...&amp;gt; Tag For IPMI ====&lt;br /&gt;
&lt;br /&gt;
Here we will show what [[IPMI]] &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;fencedevice...&amp;gt;&amp;lt;/span&amp;gt; tags look like. We won&#039;t be using it ourselves, but it is quite popular as a fence device so I wanted to show an example of it&#039;s use.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;fencedevices&amp;gt;&lt;br /&gt;
		&amp;lt;fencedevice name=&amp;quot;an01_ipmi&amp;quot; agent=&amp;quot;fence_ipmilan&amp;quot; ipaddr=&amp;quot;192.168.4.74&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;an02_ipmi&amp;quot; agent=&amp;quot;fence_ipmilan&amp;quot; ipaddr=&amp;quot;192.168.4.75&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;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ipaddr&amp;lt;/span&amp;gt;; This is the resolvable name or [[IP]] address of the device. If you use a resolvable name, it is strongly advised that you put the name in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/hosts&amp;lt;/span&amp;gt; as [[DNS]] is another layer of abstraction which could fail.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;login&amp;lt;/span&amp;gt;; This is the login name to use when the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fenced&amp;lt;/span&amp;gt; daemon connects to the device.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;passwd&amp;lt;/span&amp;gt;; This is the login password to use when the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fenced&amp;lt;/span&amp;gt; daemon connects to the device.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;name&amp;lt;/span&amp;gt;; This is the name of this particular fence device within the cluster which, as we will see shortly, is matched in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;clusternode...&amp;gt;&amp;lt;/span&amp;gt; element where appropriate.&lt;br /&gt;
&lt;br /&gt;
{{note|1=We will see shortly that, unlike switched PDUs, Node Assassin or other network fence devices, [[IPMI]] does not have ports. This is because each [[IPMI]] BMC supports just it&#039;s host system. More on that later.}}&lt;br /&gt;
&lt;br /&gt;
==== Example &amp;lt;fencedevice...&amp;gt; Tag For HP&#039;s iLO ====&lt;br /&gt;
&lt;br /&gt;
Getting [[iLO]] to work in the cluster is a little trickier as the [[RPM]]s used to enable iLO must be downloaded from [[HP]]&#039;s website and manually installed. There is a &amp;quot;quickie&amp;quot; tutorial that covers getting iLO working on [[EL5]] below.&lt;br /&gt;
&lt;br /&gt;
* [[Configuring HP iLO 2 on EL5]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;fencedevices&amp;gt;&lt;br /&gt;
		&amp;lt;fencedevice name=&amp;quot;an01_ilo&amp;quot; agent=&amp;quot;fence_ilo&amp;quot; ipaddr=&amp;quot;192.168.4.74&amp;quot; login=&amp;quot;Administrator&amp;quot; passwd=&amp;quot;secret&amp;quot; /&amp;gt;&lt;br /&gt;
		&amp;lt;fencedevice name=&amp;quot;an02_ilo&amp;quot; agent=&amp;quot;fence_ilo&amp;quot; ipaddr=&amp;quot;192.168.4.75&amp;quot; login=&amp;quot;Administrator&amp;quot; passwd=&amp;quot;secret&amp;quot; /&amp;gt;&lt;br /&gt;
	&amp;lt;/fencedevices&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Example &amp;lt;fencedevice...&amp;gt; Tag For APC Switched PDUs ====&lt;br /&gt;
&lt;br /&gt;
Here we will show how to configure APC switched [[PDU]] &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;fencedevice...&amp;gt;&amp;lt;/span&amp;gt; tags. We won&#039;t be using it in this tutorial, but in the real world, it is &#039;&#039;&#039;highly&#039;&#039;&#039; recommended as a backup fence device for [[IPMI]] and similar primary fence devices.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
	...&lt;br /&gt;
		&amp;lt;fence&amp;gt;&lt;br /&gt;
			&amp;lt;method name=&amp;quot;pdu&amp;quot;&amp;gt;&lt;br /&gt;
				&amp;lt;device name=&amp;quot;pdu001&amp;quot; action=&amp;quot;reboot&amp;quot; port=&amp;quot;1&amp;quot;/&amp;gt;&lt;br /&gt;
			&amp;lt;/method&amp;gt;&lt;br /&gt;
		&amp;lt;/fence&amp;gt;&lt;br /&gt;
	...&lt;br /&gt;
	&amp;lt;fencedevices&amp;gt;&lt;br /&gt;
		&amp;lt;fencedevice name=&amp;quot;pdu001&amp;quot; agent=&amp;quot;fence_apc&amp;quot; ipaddr=&amp;quot;192.168.3.6&amp;quot; login=&amp;quot;apc&amp;quot; passwd=&amp;quot;secret&amp;quot;/&amp;gt;&lt;br /&gt;
	&amp;lt;/fencedevices&amp;gt;&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;ipaddr&amp;lt;/span&amp;gt;; This is the resolvable name or [[IP]] address of the device. If you use a resolvable name, it is strongly advised that you put the name in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/hosts&amp;lt;/span&amp;gt; as [[DNS]] is another layer of abstraction which could fail.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;login&amp;lt;/span&amp;gt;; This is the login name to use when the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fenced&amp;lt;/span&amp;gt; daemon connects to the device.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;passwd&amp;lt;/span&amp;gt;; This is the login password to use when the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fenced&amp;lt;/span&amp;gt; daemon connects to the device.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;name&amp;lt;/span&amp;gt;; This is the name of this particular fence device within the cluster which, as we will see shortly, is matched in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;clusternode...&amp;gt;&amp;lt;/span&amp;gt; element where appropriate.&lt;br /&gt;
&lt;br /&gt;
=== Using the Fence Devices ===&lt;br /&gt;
&lt;br /&gt;
Now we have nodes and fence devices defined, we will go back and tie them together. This is done by:&lt;br /&gt;
* Defining a &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[RHCS_v2_cluster.conf#Tag.3B_fence|fence]]&amp;lt;/span&amp;gt; tag containing all fence methods and devices.&lt;br /&gt;
** Defining one or more &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[RHCS_v2_cluster.conf#Tag.3B_method|method]]&amp;lt;/span&amp;gt; tag(s) containing the device call(s) needed for each fence attempt.&lt;br /&gt;
*** Defining one or more &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[RHCS_v2_cluster.conf#Tag.3B_device|device]]&amp;lt;/span&amp;gt; tag(s) containing attributes describing how to call the fence device to kill this node.&lt;br /&gt;
&lt;br /&gt;
This tutorial will be using just a [[Node Assassin]] fence device. We&#039;ll look at an example adding [[IPMI]] in a moment though, as IPMI is a very common fence device and one you will very likely use.&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-cluster01&amp;quot; config_version=&amp;quot;5&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;cman expected_votes=&amp;quot;1&amp;quot; two_node=&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-node04.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;fence_na01&amp;quot; port=&amp;quot;04&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-node05.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;fence_na01&amp;quot; port=&amp;quot;03&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_na01&amp;quot; agent=&amp;quot;fence_na&amp;quot; ipaddr=&amp;quot;fence_na01.alteeve.com&amp;quot; login=&amp;quot;admin&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;
{{note|1=You might note that the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05.alteeve.com&amp;lt;/span&amp;gt; has it&#039;s fence port set to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;03&amp;lt;/span&amp;gt;. In my case, I fried my second Node Assassin during testing and didn&#039;t get a chance to replace it. So instead I plugged it into port &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;03&amp;lt;/span&amp;gt;, which, conveniently, also helps illustrate that the port numbers do not need to relate in any way to the node names. This is probably self-evident, I do admit.}}&lt;br /&gt;
&lt;br /&gt;
First, notice that the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[RHCS_v2_cluster.conf#Tag.3B_fence|fence]]&amp;lt;/span&amp;gt; tag has no attributes. It&#039;s merely a container for the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[RHCS_v2_cluster.conf#Tag.3B_method|method]](s)&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The next level is the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[RHCS_v2_cluster.conf#Tag.3B_method|method]]&amp;lt;/span&amp;gt; named &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;node_assassin&amp;lt;/span&amp;gt;. This name is merely a description and can be whatever you feel is most appropriate. It&#039;s purpose is simply to help you distinguish this method from other methods. The reason for &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;method&amp;lt;/span&amp;gt; tags is that some fence device calls will have two or more steps. A classic example would be a node with a redundant power supply on a switch PDU acting as the fence device. In such a case, you will need to define multiple &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[RHCS_v2_cluster.conf#Tag.3B_device|device]]&amp;lt;/span&amp;gt; tags, one for each power cable feeding the node. In such a case, the cluster will not consider the fence a success unless and until all contained &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[RHCS_v2_cluster.conf#Tag.3B_device|device]]&amp;lt;/span&amp;gt; calls execute successfully.&lt;br /&gt;
&lt;br /&gt;
The actual fence &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[RHCS_v2_cluster.conf#Tag.3B_device|device]]&amp;lt;/span&amp;gt; configuration is the final piece of the puzzle. It is here that you specify per-node configuration options and link these attributes to a given &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[RHCS_v2_cluster.conf#Tag.3B_fencedevice|fencedevice]]&amp;lt;/span&amp;gt;. Here, we see the link to the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fencedevice&amp;lt;/span&amp;gt; via the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[RHCS_v2_cluster.conf#device.27s_name_attribute|name]]&amp;lt;/span&amp;gt;, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fence_na01&amp;lt;/span&amp;gt; in this example.&lt;br /&gt;
&lt;br /&gt;
Let&#039;s step through an example fence call to help show how the per-cluster and fence device attributes are combined during a fence call.&lt;br /&gt;
&lt;br /&gt;
* The cluster manager decides that a node needs to be fenced. Let&#039;s say that the victim is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt;.&lt;br /&gt;
* The first &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;method&amp;lt;/span&amp;gt; in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fence&amp;lt;/span&amp;gt; section under &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt; is consulted. Within it there is just one &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;device&amp;lt;/span&amp;gt;, named &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fence_na01&amp;lt;/span&amp;gt; and having two attributes;&lt;br /&gt;
** &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;port&amp;lt;/span&amp;gt;; This tells the cluster that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt; is connected to the Node Assassin&#039;s port number &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;03&amp;lt;/span&amp;gt;.&lt;br /&gt;
** &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;action&amp;lt;/span&amp;gt;; This tells the cluster that the fence action to take is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;reboot&amp;lt;/span&amp;gt;. How this action is actually interpreted depends on the fence device in use, though the name certainly implies that the node will be forced off and then restarted.&lt;br /&gt;
* The cluster searches in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fencedevices&amp;lt;/span&amp;gt; for a &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fencedevice&amp;lt;/span&amp;gt; matching the name &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fence_na01&amp;lt;/span&amp;gt;. This fence device has five attributes; &lt;br /&gt;
** &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;agent&amp;lt;/span&amp;gt;; This tells the cluster to call the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fence_na&amp;lt;/span&amp;gt; fence agent script, as we discussed earlier.&lt;br /&gt;
** &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ipaddr&amp;lt;/span&amp;gt;; This tells the fence agent where on the network to find this particular Node Assassin. This is how multiple fence devices of the same type can be used in the cluster.&lt;br /&gt;
** &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;login&amp;lt;/span&amp;gt;; This is the login user name to use when authenticating against the fence device.&lt;br /&gt;
** &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;passwd&amp;lt;/span&amp;gt;; This is the password to supply along with the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;login&amp;lt;/span&amp;gt; name when authenticating against the fence device.&lt;br /&gt;
** &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;quiet&amp;lt;/span&amp;gt;; This is a device-specific argument that Node Assassin uses (see &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;man fence_na&amp;lt;/span&amp;gt; for details).&lt;br /&gt;
* With this information collected and compiled, the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fenced&amp;lt;/span&amp;gt; daemon will call the fence agent and pass it the attribute &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;variable=value&amp;lt;/span&amp;gt; pairs, one per line. Thus, the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fenced&amp;lt;/span&amp;gt; daemon will call:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/usr/sbin/fence_na&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then it will pass to that agent the following arguments:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
ipaddr=fence_na01.alteeve.com&lt;br /&gt;
login=admin&lt;br /&gt;
passwd=secret&lt;br /&gt;
quiet=1&lt;br /&gt;
port=02&lt;br /&gt;
action=reboot&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As you can see then, the first four arguments are from the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fencedevice&amp;lt;/span&amp;gt; attributes and the last two are from the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;device&amp;lt;/span&amp;gt; attributes under &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt;&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clusternode&amp;lt;/span&amp;gt;&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fence&amp;lt;/span&amp;gt; tag. &lt;br /&gt;
&lt;br /&gt;
When you have two or more &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;method&amp;lt;/span&amp;gt; tags defined, then the first in the list will be tried. If any of it&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;device&amp;lt;/span&amp;gt; tags fail, then the method is considered to have failed and the next method is consulted. This will repeat until all &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;method&amp;lt;/span&amp;gt; entries have been tried. At that point, the cluster goes back to the first &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;method&amp;lt;/span&amp;gt; and tries again, repeating the walk through of all methods. This loop will continue until one &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;method&amp;lt;/span&amp;gt; succeeds, regardless of how long that might take.&lt;br /&gt;
&lt;br /&gt;
==== An Example Showing IPMI&#039;s Use ====&lt;br /&gt;
&lt;br /&gt;
This is a full configuration file showing what it would look like if we were using [[IPMI]] and a [[Node Assassin]] for redundant fencing.&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-cluster01&amp;quot; config_version=&amp;quot;6&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;cman expected_votes=&amp;quot;1&amp;quot; two_node=&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-node04.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;fence_na01&amp;quot; port=&amp;quot;04&amp;quot; action=&amp;quot;reboot&amp;quot;/&amp;gt;&lt;br /&gt;
				&amp;lt;/method&amp;gt;&lt;br /&gt;
				&amp;lt;method name=&amp;quot;an-node04_ipmi&amp;quot;&amp;gt;&lt;br /&gt;
					&amp;lt;device name=&amp;quot;an01_ipmi&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-node05.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;fence_na01&amp;quot; port=&amp;quot;03&amp;quot; action=&amp;quot;reboot&amp;quot;/&amp;gt;&lt;br /&gt;
				&amp;lt;/method&amp;gt;&lt;br /&gt;
				&amp;lt;method name=&amp;quot;an-node05_ipmi&amp;quot;&amp;gt;&lt;br /&gt;
					&amp;lt;device name=&amp;quot;an02_ipmi&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_na01&amp;quot; agent=&amp;quot;fence_na&amp;quot; ipaddr=&amp;quot;fence_na01.alteeve.com&amp;quot; login=&amp;quot;admin&amp;quot; passwd=&amp;quot;secret&amp;quot; quiet=&amp;quot;1&amp;quot;/&amp;gt;&lt;br /&gt;
		&amp;lt;fencedevice name=&amp;quot;an01_ipmi&amp;quot; agent=&amp;quot;fence_ipmilan&amp;quot; ipaddr=&amp;quot;192.168.4.74&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;an02_ipmi&amp;quot; agent=&amp;quot;fence_ipmilan&amp;quot; ipaddr=&amp;quot;192.168.4.75&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;
We now see three elements in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fencedevices&amp;lt;/span&amp;gt;. The first is the original Node Assassin entry plus two [[IPMI]] entries, one for each node in the cluster. As we touched on earlier, this is because each node has it&#039;s own IPMI [[BMC]]. In the same vein, we also now see that the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;device&amp;lt;/span&amp;gt; entries in each node&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;method&amp;lt;/span&amp;gt; element have no &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;port&amp;lt;/span&amp;gt; setting.&lt;br /&gt;
&lt;br /&gt;
Notice that the Node Assassin&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;method&amp;lt;/span&amp;gt; is above the IPMI &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;method&amp;lt;/span&amp;gt;. This means that the Node Assassin is the primary fence device and the IPMI is the secondary. When deciding which order to assign the fence devices, consider the device&#039;s potential for failure and how that might effect cluster recovery time. For example, many IPMI BMCs rely on the node&#039;s power supply to operate. Thus, if the node&#039;s power supply fails and the IPMI is the first fence device, then recovery will be delayed as the cluster will try, and then wait until it times out, before moving on to the networked fence device, Node Assassin in this instance.&lt;br /&gt;
&lt;br /&gt;
=== Give Nodes More Time To Start ===&lt;br /&gt;
&lt;br /&gt;
Clusters with more than three nodes will have to gain quorum before they can fence other nodes. As we saw earlier though, this is not really the case when using the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[RHCS_v2_cluster.conf#two_node|two_node]]=&amp;quot;1&amp;quot;&amp;lt;/span&amp;gt; attribute in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[RHCS_v2_cluster.conf#cman.3B_The_Cluster_Manager|cman]]&amp;lt;/span&amp;gt; tag. What this means in practice is that if you start the cluster on one node and then wait too long to start the cluster on the second node, the first will fence the second.&lt;br /&gt;
&lt;br /&gt;
The logic behind this is; When the cluster starts, it will try to talk to it&#039;s fellow node and then fail. With the special &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;two_node=&amp;quot;1&amp;quot;&amp;lt;/span&amp;gt; attribute set, the cluster knows that it is allowed to start clustered services, but it has no way to say for sure what state the other node is in. It could well be online and hosting services for all it knows. So it has to proceed on the assumption that the other node is alive and using shared resources. Given that, and given that it can not talk to the other node, it&#039;s only safe option is to fence the other node. Only then can it be confident that it is safe to start providing clustered services.&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-cluster01&amp;quot; config_version=&amp;quot;7&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;cman expected_votes=&amp;quot;1&amp;quot; two_node=&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-node04.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;fence_na01&amp;quot; port=&amp;quot;04&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-node05.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;fence_na01&amp;quot; port=&amp;quot;03&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_na01&amp;quot; agent=&amp;quot;fence_na&amp;quot; ipaddr=&amp;quot;fence_na01.alteeve.com&amp;quot; login=&amp;quot;admin&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;fence_daemon post_join_delay=&amp;quot;60&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/cluster&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The new tag is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[RHCS_v2_cluster.conf#fence_daemon.3B_Fencing|fence_daemon]]&amp;lt;/span&amp;gt;, seen near the bottom if the file above. The change is made using the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[RHCS_v2_cluster.conf#post_join_delay|post_join_delay]]=&amp;quot;60&amp;quot;&amp;lt;/span&amp;gt; attribute. By default, the cluster will declare the other node dead after just &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;6&amp;lt;/span&amp;gt; seconds. The reason is that the larger this value, the slower the start-up of the cluster services will be. During testing and development though, I find this value to be far too short and frequently led to unnecessary fencing. Once your cluster is setup and working, it&#039;s not a bad idea to reduce this value to the lowest value that you are comfortable with.&lt;br /&gt;
&lt;br /&gt;
=== Configuring Totem ===&lt;br /&gt;
&lt;br /&gt;
This is almost a misnomer, as we&#039;re more or less &#039;&#039;not&#039;&#039; configuring the [[totem]] protocol in this cluster.&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-cluster01&amp;quot; config_version=&amp;quot;8&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;cman expected_votes=&amp;quot;1&amp;quot; two_node=&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-node04.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;fence_na01&amp;quot; port=&amp;quot;04&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-node05.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;fence_na01&amp;quot; port=&amp;quot;03&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_na01&amp;quot; agent=&amp;quot;fence_na&amp;quot; ipaddr=&amp;quot;fence_na01.alteeve.com&amp;quot; login=&amp;quot;admin&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;fence_daemon post_join_delay=&amp;quot;60&amp;quot;/&amp;gt;&lt;br /&gt;
        &amp;lt;totem rrp_mode=&amp;quot;none&amp;quot; secauth=&amp;quot;off&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/cluster&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the spirit of &amp;quot;keeping it simple&amp;quot;, we&#039;re not configuring [[redundant ring protocol]] in this cluster. [[RRP]] is an optional second ring that can be used for cluster communication in the case of a break down in the first ring. This is not the simplest option to setup, as recovery must be done manually. However, if you wish to explore it further, please take a look at the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clusternode&amp;lt;/span&amp;gt; element tag called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;[[RHCS_v2_cluster.conf#Tag.3B_altname|altname]]...&amp;gt;&amp;lt;/span&amp;gt;. When &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[altname]]&amp;lt;/span&amp;gt; is used though, then the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[RHCS_v2_cluster.conf#rrp_mode|rrp_mode]]&amp;lt;/span&amp;gt; attribute will need to be changed to either &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;active&amp;lt;/span&amp;gt; or &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;passive&amp;lt;/span&amp;gt; (the details of which are outside the scope of this tutorial).&lt;br /&gt;
&lt;br /&gt;
The second option we&#039;re looking at here is the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[RHCS_v2_cluster.conf#secauth|secauth]]=&amp;quot;off&amp;quot;&amp;lt;/span&amp;gt; attribute. This controls whether the cluster communications are encrypted or not. We can safely disable this because we&#039;re working on a known-private network, which yields two benefits; It&#039;s simpler to setup and it&#039;s a lot faster. If you must encrypt the cluster communications, then you can do so here. The details of which are also outside the scope of this tutorial though.&lt;br /&gt;
&lt;br /&gt;
=== Validating and Pushing the /etc/cluster/cluster.conf File ===&lt;br /&gt;
&lt;br /&gt;
The cluster software validates the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/cluster/cluster.conf&amp;lt;/span&amp;gt; file against &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/usr/share/system-config-cluster/misc/cluster.ng&amp;lt;/span&amp;gt; using the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xmllint&amp;lt;/span&amp;gt; program. If it fails to validate, the cluster will refuse to start.&lt;br /&gt;
&lt;br /&gt;
So now that we&#039;ve got the foundation of our cluster ready, the last step is to validate it. To do so, simply run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
xmllint --relaxng /usr/share/system-config-cluster/misc/cluster.ng /etc/cluster/cluster.conf&lt;br /&gt;
&amp;lt;/source&amp;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-cluster01&amp;quot; config_version=&amp;quot;8&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;cman expected_votes=&amp;quot;1&amp;quot; two_node=&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-node04.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;fence_na01&amp;quot; port=&amp;quot;04&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-node05.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;fence_na01&amp;quot; port=&amp;quot;03&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_na01&amp;quot; agent=&amp;quot;fence_na&amp;quot; ipaddr=&amp;quot;fence_na01.alteeve.com&amp;quot; login=&amp;quot;admin&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;fence_daemon post_join_delay=&amp;quot;60&amp;quot;/&amp;gt;&lt;br /&gt;
        &amp;lt;totem rrp_mode=&amp;quot;none&amp;quot; secauth=&amp;quot;off&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/cluster&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;
/etc/cluster/cluster.conf validates&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If there was a problem, you need to go back and fix it. &#039;&#039;&#039;DO NOT&#039;&#039;&#039; proceed until your configuration validates. Once it does, we&#039;re ready to move on!&lt;br /&gt;
&lt;br /&gt;
With it validated, we need to push it to the other node. As the cluster is not running yet, we will push it out using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rsync&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;
rsync -av /etc/cluster/cluster.conf root@an-node05:/etc/cluster/&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
building file list ... done&lt;br /&gt;
cluster.conf&lt;br /&gt;
&lt;br /&gt;
sent 891 bytes  received 66 bytes  638.00 bytes/sec&lt;br /&gt;
total size is 790  speedup is 0.83&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Starting the Cluster For The First Time =&lt;br /&gt;
&lt;br /&gt;
At this point, we have the foundation of the cluster in place and we can start it up!&lt;br /&gt;
&lt;br /&gt;
== Keeping an Eye on Things ==&lt;br /&gt;
&lt;br /&gt;
I&#039;ve found a layout of four terminal windows, the left ones being 80 columns wide and the right ones filling the rest of the screen, works well. I personally run a &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;tail -f -n 0 /var/log/messages&amp;lt;/span&amp;gt; in the right windows so that I can keep an eye on things.&lt;br /&gt;
&lt;br /&gt;
[[Image:2-node_cluster_terminal_layout_01.png|thumb|center|700px|The terminal layout I use to monitor and operate the two nodes in the cluster.]]&lt;br /&gt;
&lt;br /&gt;
Of course, what you use is entirely up to you, your screen real-estate and your preferences.&lt;br /&gt;
&lt;br /&gt;
== A Note on Timing ==&lt;br /&gt;
&lt;br /&gt;
Remember that you have &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;post_join_delay&amp;lt;/span&amp;gt; seconds to start both nodes, which is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;60&amp;lt;/span&amp;gt; seconds in our configuration. So be sure that you can start the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt; daemon quickly on both nodes. I generally ensure that both terminal windows have the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;start&amp;lt;/span&amp;gt; command typed in, so that I can quickly press &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;enter&amp;gt;&amp;lt;/span&amp;gt; on both nodes. Again, how you do this is entirely up to you.&lt;br /&gt;
&lt;br /&gt;
== All Systems Are Go! ==&lt;br /&gt;
&lt;br /&gt;
Time to 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;
On both nodes, run the following command:&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;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Starting cluster: &lt;br /&gt;
   Loading modules... done&lt;br /&gt;
   Mounting configfs... done&lt;br /&gt;
   Starting ccsd... done&lt;br /&gt;
   Starting cman... done&lt;br /&gt;
   Starting daemons... done&lt;br /&gt;
   Starting fencing... done&lt;br /&gt;
                                                           [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If things went well, you should see something like this in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/var/log/messages&amp;lt;/span&amp;gt; terminal on both nodes:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
May  3 22:33:15 an-node04 ccsd[5319]: Starting ccsd 2.0.115: &lt;br /&gt;
May  3 22:33:15 an-node04 ccsd[5319]:  Built: Apr 28 2011 05:36:14 &lt;br /&gt;
May  3 22:33:15 an-node04 ccsd[5319]:  Copyright (C) Red Hat, Inc.  2004  All rights reserved. &lt;br /&gt;
May  3 22:33:15 an-node04 ccsd[5319]: cluster.conf (cluster name = an-cluster01, version = 8) found. &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [MAIN ] AIS Executive Service RELEASE &#039;subrev 1887 version 0.80.6&#039; &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [MAIN ] Copyright (C) 2002-2006 MontaVista Software, Inc and contributors. &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [MAIN ] Copyright (C) 2006 Red Hat, Inc. &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [MAIN ] AIS Executive Service: started and ready to provide service. &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [MAIN ] Using default multicast address of 239.192.235.77 &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [TOTEM] Token Timeout (10000 ms) retransmit timeout (495 ms) &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [TOTEM] token hold (386 ms) retransmits before loss (20 retrans) &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [TOTEM] join (60 ms) send_join (0 ms) consensus (2000 ms) merge (200 ms) &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [TOTEM] downcheck (1000 ms) fail to recv const (2500 msgs) &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [TOTEM] seqno unchanged const (30 rotations) Maximum network MTU 1402 &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [TOTEM] window size per rotation (50 messages) maximum messages per rotation (17 messages) &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [TOTEM] missed count const (5 messages) &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [TOTEM] send threads (0 threads) &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [TOTEM] RRP token expired timeout (495 ms) &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [TOTEM] RRP token problem counter (2000 ms) &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [TOTEM] RRP threshold (10 problem count) &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [TOTEM] RRP mode set to none. &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [TOTEM] heartbeat_failures_allowed (0) &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [TOTEM] max_network_delay (50 ms) &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [TOTEM] HeartBeat is Disabled. To enable set heartbeat_failures_allowed &amp;gt; 0 &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [TOTEM] Receive multicast socket recv buffer size (262142 bytes). &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [TOTEM] Transmit multicast socket send buffer size (262142 bytes). &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [TOTEM] The network interface [192.168.3.74] is now up. &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [TOTEM] Created or loaded sequence id 8.192.168.3.74 for this ring. &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [TOTEM] entering GATHER state from 15. &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [CMAN ] CMAN 2.0.115 (built Apr 28 2011 05:36:17) started &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [MAIN ] Service initialized &#039;openais CMAN membership service 2.01&#039; &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [SERV ] Service initialized &#039;openais extended virtual synchrony service&#039; &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [SERV ] Service initialized &#039;openais cluster membership service B.01.01&#039; &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [SERV ] Service initialized &#039;openais availability management framework B.01.01&#039; &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [SERV ] Service initialized &#039;openais checkpoint service B.01.01&#039; &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [SERV ] Service initialized &#039;openais event service B.01.01&#039; &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [SERV ] Service initialized &#039;openais distributed locking service B.01.01&#039; &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [SERV ] Service initialized &#039;openais message service B.01.01&#039; &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [SERV ] Service initialized &#039;openais configuration service&#039; &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [SERV ] Service initialized &#039;openais cluster closed process group service v1.01&#039; &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [SERV ] Service initialized &#039;openais cluster config database access v1.01&#039; &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [SYNC ] Not using a virtual synchrony filter. &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [TOTEM] Creating commit token because I am the rep. &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [TOTEM] Saving state aru 0 high seq received 0 &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [TOTEM] Storing new sequence id for ring c &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [TOTEM] entering COMMIT state. &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [TOTEM] entering RECOVERY state. &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [TOTEM] position [0] member 192.168.3.74: &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [TOTEM] previous ring seq 8 rep 192.168.3.74 &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [TOTEM] aru 0 high delivered 0 received flag 1 &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [TOTEM] Did not need to originate any messages in recovery. &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [TOTEM] Sending initial ORF token &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [CLM  ] CLM CONFIGURATION CHANGE &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [CLM  ] New Configuration: &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [CLM  ] Members Left: &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [CLM  ] Members Joined: &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [CLM  ] CLM CONFIGURATION CHANGE &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [CLM  ] New Configuration: &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [CLM  ] 	r(0) ip(192.168.3.74)  &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [CLM  ] Members Left: &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [CLM  ] Members Joined: &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [CLM  ] 	r(0) ip(192.168.3.74)  &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [SYNC ] This node is within the primary component and will provide service. &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [TOTEM] entering OPERATIONAL state. &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [CMAN ] quorum regained, resuming activity &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [CLM  ] got nodejoin message 192.168.3.74 &lt;br /&gt;
May  3 22:33:17 an-node04 ccsd[5319]: Initial status:: Quorate &lt;br /&gt;
May  3 22:33:18 an-node04 openais[5325]: [TOTEM] entering GATHER state from 11. &lt;br /&gt;
May  3 22:33:18 an-node04 openais[5325]: [TOTEM] Creating commit token because I am the rep. &lt;br /&gt;
May  3 22:33:18 an-node04 openais[5325]: [TOTEM] Saving state aru c high seq received c &lt;br /&gt;
May  3 22:33:18 an-node04 openais[5325]: [TOTEM] Storing new sequence id for ring 14 &lt;br /&gt;
May  3 22:33:18 an-node04 openais[5325]: [TOTEM] entering COMMIT state. &lt;br /&gt;
May  3 22:33:18 an-node04 openais[5325]: [TOTEM] entering RECOVERY state. &lt;br /&gt;
May  3 22:33:18 an-node04 openais[5325]: [TOTEM] position [0] member 192.168.3.74: &lt;br /&gt;
May  3 22:33:18 an-node04 openais[5325]: [TOTEM] previous ring seq 12 rep 192.168.3.74 &lt;br /&gt;
May  3 22:33:18 an-node04 openais[5325]: [TOTEM] aru c high delivered c received flag 1 &lt;br /&gt;
May  3 22:33:18 an-node04 openais[5325]: [TOTEM] position [1] member 192.168.3.75: &lt;br /&gt;
May  3 22:33:18 an-node04 openais[5325]: [TOTEM] previous ring seq 16 rep 192.168.3.75 &lt;br /&gt;
May  3 22:33:18 an-node04 openais[5325]: [TOTEM] aru c high delivered c received flag 1 &lt;br /&gt;
May  3 22:33:18 an-node04 openais[5325]: [TOTEM] Did not need to originate any messages in recovery. &lt;br /&gt;
May  3 22:33:18 an-node04 openais[5325]: [TOTEM] Sending initial ORF token &lt;br /&gt;
May  3 22:33:18 an-node04 openais[5325]: [CLM  ] CLM CONFIGURATION CHANGE &lt;br /&gt;
May  3 22:33:18 an-node04 openais[5325]: [CLM  ] New Configuration: &lt;br /&gt;
May  3 22:33:18 an-node04 openais[5325]: [CLM  ] 	r(0) ip(192.168.3.74)  &lt;br /&gt;
May  3 22:33:18 an-node04 openais[5325]: [CLM  ] Members Left: &lt;br /&gt;
May  3 22:33:18 an-node04 openais[5325]: [CLM  ] Members Joined: &lt;br /&gt;
May  3 22:33:18 an-node04 openais[5325]: [CLM  ] CLM CONFIGURATION CHANGE &lt;br /&gt;
May  3 22:33:18 an-node04 openais[5325]: [CLM  ] New Configuration: &lt;br /&gt;
May  3 22:33:18 an-node04 openais[5325]: [CLM  ] 	r(0) ip(192.168.3.74)  &lt;br /&gt;
May  3 22:33:18 an-node04 openais[5325]: [CLM  ] 	r(0) ip(192.168.3.75)  &lt;br /&gt;
May  3 22:33:18 an-node04 openais[5325]: [CLM  ] Members Left: &lt;br /&gt;
May  3 22:33:18 an-node04 openais[5325]: [CLM  ] Members Joined: &lt;br /&gt;
May  3 22:33:18 an-node04 openais[5325]: [CLM  ] 	r(0) ip(192.168.3.75)  &lt;br /&gt;
May  3 22:33:18 an-node04 openais[5325]: [SYNC ] This node is within the primary component and will provide service. &lt;br /&gt;
May  3 22:33:18 an-node04 openais[5325]: [TOTEM] entering OPERATIONAL state. &lt;br /&gt;
May  3 22:33:18 an-node04 openais[5325]: [CLM  ] got nodejoin message 192.168.3.74 &lt;br /&gt;
May  3 22:33:18 an-node04 openais[5325]: [CLM  ] got nodejoin message 192.168.3.75 &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From the node you started &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt; on first, you will see:&lt;br /&gt;
* The cluster configuration system daemon, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ccsd&amp;lt;/span&amp;gt;, starts up and reads in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/cluster/cluster.conf&amp;lt;/span&amp;gt;. It reports the name of the cluster, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-cluster01&amp;lt;/span&amp;gt; and the version, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;8&amp;lt;/span&amp;gt;.&lt;br /&gt;
* OpenAIS then starts up, reports it&#039;s multicast address it will use, reports many of it&#039;s variable values and what [[IP]] address it will use for cluster communications.&lt;br /&gt;
* The Cluster Manager, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt;, starts and reports the version of various services in use.&lt;br /&gt;
* The [[totem]] protocol is started and it forms an initial configuration containing just itself. These messages have the prefix &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;CLM&amp;lt;/span&amp;gt;, CLuster Membership.&lt;br /&gt;
** Then it waits to see if the other node will join. On the other node&#039;s log, you will see it start off and immediately join with this first node. &lt;br /&gt;
* The initial configuration is sufficient to gain quorum and declares that it will provide services.&lt;br /&gt;
* The second node announces that it wants to join the first node&#039;s cluster membership and the cluster reconfigures.&lt;br /&gt;
&lt;br /&gt;
From the node you started &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt; on second, you will see mostly the same thing, except you will not see the cluster form on the one node. Instead, it will connect directly to the first node and the initial configuration will be the pair together.&lt;br /&gt;
&lt;br /&gt;
If you got this, then you&#039;re cluster is up and running, congratulations!&lt;br /&gt;
&lt;br /&gt;
== Testing Fencing ==&lt;br /&gt;
&lt;br /&gt;
Before we go any further, we want to make sure that our fence device and configuration is working from both nodes. We will test this two ways;&lt;br /&gt;
* First, we will use the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fence_node&amp;lt;/span&amp;gt; tools.&lt;br /&gt;
* Second, we will break the network connection to simulate a network failure.&lt;br /&gt;
&lt;br /&gt;
=== Fencing with the fence_node Tool ===&lt;br /&gt;
&lt;br /&gt;
Testing this is easy, thanks to the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fence_node&amp;lt;/span&amp;gt; command line tool. It&#039;s simply a matter of calling &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fence_node &amp;lt;node&amp;gt;&amp;lt;/span&amp;gt;, where &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;node&amp;gt;&amp;lt;/span&amp;gt; has to match the name set in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cluster.conf&amp;lt;/span&amp;gt; file&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clusternode name=&amp;quot;...&amp;quot;&amp;lt;/span&amp;gt; element.&lt;br /&gt;
&lt;br /&gt;
We will do this test twice; Once from &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt;, fencing &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt; and then again from the other way around. After each fence call, we will wait for the node to reboot and then rejoin it to the cluster. We&#039;ll watch &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/var/log/messages&amp;lt;/span&amp;gt; to see what&#039;s happening.&lt;br /&gt;
&lt;br /&gt;
Let&#039;s start by fencing &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05.alteeve.com&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;From &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt;&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
fence_node05.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;
May  6 00:46:26 an-node04 openais[25357]: [TOTEM] The token was lost in the OPERATIONAL state.&lt;br /&gt;
May  6 00:46:26 an-node04 openais[25357]: [TOTEM] Receive multicast socket recv buffer size (262142 bytes).&lt;br /&gt;
May  6 00:46:26 an-node04 openais[25357]: [TOTEM] Transmit multicast socket send buffer size (262142 bytes).&lt;br /&gt;
May  6 00:46:26 an-node04 openais[25357]: [TOTEM] entering GATHER state from 2.&lt;br /&gt;
May  6 00:46:28 an-node04 openais[25357]: [TOTEM] entering GATHER state from 0.&lt;br /&gt;
May  6 00:46:28 an-node04 openais[25357]: [TOTEM] Creating commit token because I am the rep.&lt;br /&gt;
May  6 00:46:28 an-node04 openais[25357]: [TOTEM] Saving state aru 22 high seq received 22&lt;br /&gt;
May  6 00:46:28 an-node04 openais[25357]: [TOTEM] Storing new sequence id for ring 5c&lt;br /&gt;
May  6 00:46:28 an-node04 openais[25357]: [TOTEM] entering COMMIT state.&lt;br /&gt;
May  6 00:46:28 an-node04 openais[25357]: [TOTEM] entering RECOVERY state.&lt;br /&gt;
May  6 00:46:28 an-node04 openais[25357]: [TOTEM] position [0] member 192.168.3.74:&lt;br /&gt;
May  6 00:46:28 an-node04 openais[25357]: [TOTEM] previous ring seq 88 rep 192.168.3.74&lt;br /&gt;
May  6 00:46:28 an-node04 openais[25357]: [TOTEM] aru 22 high delivered 22 received flag 1&lt;br /&gt;
May  6 00:46:28 an-node04 openais[25357]: [TOTEM] Did not need to originate any messages in recovery.&lt;br /&gt;
May  6 00:46:28 an-node04 openais[25357]: [TOTEM] Sending initial ORF token&lt;br /&gt;
May  6 00:46:28 an-node04 openais[25357]: [CLM  ] CLM CONFIGURATION CHANGE&lt;br /&gt;
May  6 00:46:28 an-node04 openais[25357]: [CLM  ] New Configuration:&lt;br /&gt;
May  6 00:46:28 an-node04 fenced[25376]: an-node05.alteeve.com not a cluster member after 0 sec post_fail_delay&lt;br /&gt;
May  6 00:46:28 an-node04 kernel: dlm: closing connection to node 2&lt;br /&gt;
May  6 00:46:28 an-node04 openais[25357]: [CLM  ]       r(0) ip(192.168.3.74)&lt;br /&gt;
May  6 00:46:28 an-node04 fenced[25376]: fencing node &amp;quot;an-node05.alteeve.com&amp;quot;&lt;br /&gt;
May  6 00:46:28 an-node04 openais[25357]: [CLM  ] Members Left:&lt;br /&gt;
May  6 00:46:28 an-node04 openais[25357]: [CLM  ]       r(0) ip(192.168.3.75)&lt;br /&gt;
May  6 00:46:28 an-node04 openais[25357]: [CLM  ] Members Joined:&lt;br /&gt;
May  6 00:46:28 an-node04 openais[25357]: [CLM  ] CLM CONFIGURATION CHANGE&lt;br /&gt;
May  6 00:46:28 an-node04 openais[25357]: [CLM  ] New Configuration:&lt;br /&gt;
May  6 00:46:28 an-node04 openais[25357]: [CLM  ]       r(0) ip(192.168.3.74)&lt;br /&gt;
May  6 00:46:28 an-node04 openais[25357]: [CLM  ] Members Left:&lt;br /&gt;
May  6 00:46:28 an-node04 openais[25357]: [CLM  ] Members Joined:&lt;br /&gt;
May  6 00:46:28 an-node04 openais[25357]: [SYNC ] This node is within the primary component and will provide service.&lt;br /&gt;
May  6 00:46:28 an-node04 openais[25357]: [TOTEM] entering OPERATIONAL state.&lt;br /&gt;
May  6 00:46:28 an-node04 openais[25357]: [CLM  ] got nodejoin message 192.168.3.74&lt;br /&gt;
May  6 00:46:28 an-node04 openais[25357]: [CPG  ] got joinlist message from node 1&lt;br /&gt;
May  6 00:46:29 an-node04 fence_node[26696]: Fence of &amp;quot;an-node05.alteeve.com&amp;quot; was successful&lt;br /&gt;
May  6 00:46:42 an-node04 fenced[25376]: fence &amp;quot;an-node05.alteeve.com&amp;quot; success&lt;br /&gt;
May  6 00:50:23 an-node04 fence_node[26756]: Fence of &amp;quot;an-node05.alteeve.com&amp;quot; was successful&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{note|1=You will notice that there were two fence calls; This is normal. The first was the call from the command line that killed the node. The second was a reaction to the cluster reforming.}}&lt;br /&gt;
&lt;br /&gt;
Watching syslog, we&#039;ll see the node disappear, then the called fence finish, then the second fence called by the cluster itself succeed.&lt;br /&gt;
&lt;br /&gt;
If we check the cluster status from the surviving node, we&#039;ll see that the cluster has been reduced to just the single survivor node.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cman_tool 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;
Version: 6.2.0&lt;br /&gt;
Config Version: 8&lt;br /&gt;
Cluster Name: an-cluster01&lt;br /&gt;
Cluster Id: 60257&lt;br /&gt;
Cluster Member: Yes&lt;br /&gt;
Cluster Generation: 92&lt;br /&gt;
Membership state: Cluster-Member&lt;br /&gt;
Nodes: 1&lt;br /&gt;
Expected votes: 1&lt;br /&gt;
Total votes: 1&lt;br /&gt;
Quorum: 1  &lt;br /&gt;
Active subsystems: 7&lt;br /&gt;
Flags: 2node Dirty &lt;br /&gt;
Ports Bound: 0  &lt;br /&gt;
Node name: an-node04.alteeve.com&lt;br /&gt;
Node ID: 1&lt;br /&gt;
Multicast addresses: 239.192.235.77 &lt;br /&gt;
Node addresses: 192.168.3.74 &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once the victim has rebooted, we can rejoin it to the cluster. Now that the first node is already up, there is no need to worry about timing issues. Just start &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt; at your leisure. If you watch syslog from &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt;, you&#039;ll see &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt; connect and the cluster will reform to include it.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt;&#039;&#039;&#039;:&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;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Starting cluster: &lt;br /&gt;
   Loading modules... done&lt;br /&gt;
   Mounting configfs... done&lt;br /&gt;
   Starting ccsd... done&lt;br /&gt;
   Starting cman... done&lt;br /&gt;
   Starting daemons... done&lt;br /&gt;
   Starting fencing... done&lt;br /&gt;
                                                           [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{warning|1=Please do not assume that a successful fence against one node will mean that the fence against the other will work. An improper fence agent configuration, a typo in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cluster.conf&amp;lt;/span&amp;gt; or a fault in the wiring of the fence device could all cause node-specific fence failures.}}&lt;br /&gt;
&lt;br /&gt;
Now, repeat the process, but this time fence &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04.alteeve.com&amp;lt;/span&amp;gt; from &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Simulate a Network Failure ===&lt;br /&gt;
&lt;br /&gt;
It&#039;s good to know that we can fence the nodes with the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fence_node&amp;lt;/span&amp;gt; tool, but that is a controlled situation entirely within the context of the cluster. A more &amp;quot;real-world&amp;quot; test is now needed to ensure that a external fault will be detected by the cluster and that one of the nodes will be ejected. There are many, many ways to simulate a failure, and &#039;&#039;&#039;we will test&#039;&#039;&#039; all failures later. For now though, let&#039;s use a simple &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;iptables&amp;lt;/span&amp;gt; rule to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;DROP&amp;lt;/span&amp;gt; everything leaving our &#039;&#039;&#039;BCN&#039;&#039;&#039; interface.&lt;br /&gt;
&lt;br /&gt;
{{warning|1=This next command will block &#039;&#039;&#039;all&#039;&#039;&#039; traffic leaving the server. You will lose your &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ssh&amp;lt;/span&amp;gt; connection. If the fence fails, you will need to find another way to reboot or restore the server.}}&lt;br /&gt;
&lt;br /&gt;
This time, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04.alteeve.com&amp;lt;/span&amp;gt; will be the victim, so run the following &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;iptables&amp;lt;/span&amp;gt; command on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt; directly. This will cause all outbound traffic, including cluster communications, to fail. Within a few seconds, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt; should declare &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt; as dead, eject it via a fence call and then reconfigure.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt;&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
iptables -A OUTPUT -j DROP&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After a few seconds, you should see &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt; trigger the fence.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;In &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt;&#039;s syslog&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
May  6 01:11:08 an-node04 openais[4339]: [TOTEM] The token was lost in the OPERATIONAL state. &lt;br /&gt;
May  6 01:11:08 an-node04 openais[4339]: [TOTEM] Receive multicast socket recv buffer size (262142 bytes). &lt;br /&gt;
May  6 01:11:08 an-node04 openais[4339]: [TOTEM] Transmit multicast socket send buffer size (262142 bytes). &lt;br /&gt;
May  6 01:11:08 an-node04 openais[4339]: [TOTEM] entering GATHER state from 2. &lt;br /&gt;
May  6 01:11:10 an-node04 openais[4339]: [TOTEM] entering GATHER state from 0. &lt;br /&gt;
May  6 01:11:10 an-node04 openais[4339]: [TOTEM] Creating commit token because I am the rep. &lt;br /&gt;
May  6 01:11:10 an-node04 openais[4339]: [TOTEM] Saving state aru 24 high seq received 24 &lt;br /&gt;
May  6 01:11:10 an-node04 openais[4339]: [TOTEM] Storing new sequence id for ring 70 &lt;br /&gt;
May  6 01:11:10 an-node04 openais[4339]: [TOTEM] entering COMMIT state. &lt;br /&gt;
May  6 01:11:10 an-node04 openais[4339]: [TOTEM] entering RECOVERY state. &lt;br /&gt;
May  6 01:11:10 an-node04 openais[4339]: [TOTEM] position [0] member 192.168.3.74: &lt;br /&gt;
May  6 01:11:10 an-node04 openais[4339]: [TOTEM] previous ring seq 108 rep 192.168.3.74 &lt;br /&gt;
May  6 01:11:10 an-node04 openais[4339]: [TOTEM] aru 24 high delivered 24 received flag 1 &lt;br /&gt;
May  6 01:11:10 an-node04 openais[4339]: [TOTEM] Did not need to originate any messages in recovery. &lt;br /&gt;
May  6 01:11:10 an-node04 openais[4339]: [TOTEM] Sending initial ORF token &lt;br /&gt;
May  6 01:11:10 an-node04 openais[4339]: [CLM  ] CLM CONFIGURATION CHANGE &lt;br /&gt;
May  6 01:11:10 an-node04 openais[4339]: [CLM  ] New Configuration: &lt;br /&gt;
May  6 01:11:10 an-node04 kernel: dlm: closing connection to node 2&lt;br /&gt;
May  6 01:11:10 an-node04 fenced[4358]: an-node05.alteeve.com not a cluster member after 0 sec post_fail_delay&lt;br /&gt;
May  6 01:11:10 an-node04 openais[4339]: [CLM  ] 	r(0) ip(192.168.3.74)  &lt;br /&gt;
May  6 01:11:10 an-node04 fenced[4358]: fencing node &amp;quot;an-node05.alteeve.com&amp;quot;&lt;br /&gt;
May  6 01:11:10 an-node04 openais[4339]: [CLM  ] Members Left: &lt;br /&gt;
May  6 01:11:10 an-node04 openais[4339]: [CLM  ] 	r(0) ip(192.168.3.75)  &lt;br /&gt;
May  6 01:11:10 an-node04 openais[4339]: [CLM  ] Members Joined: &lt;br /&gt;
May  6 01:11:10 an-node04 openais[4339]: [CLM  ] CLM CONFIGURATION CHANGE &lt;br /&gt;
May  6 01:11:10 an-node04 openais[4339]: [CLM  ] New Configuration: &lt;br /&gt;
May  6 01:11:10 an-node04 openais[4339]: [CLM  ] 	r(0) ip(192.168.3.74)  &lt;br /&gt;
May  6 01:11:10 an-node04 openais[4339]: [CLM  ] Members Left: &lt;br /&gt;
May  6 01:11:10 an-node04 openais[4339]: [CLM  ] Members Joined: &lt;br /&gt;
May  6 01:11:10 an-node04 openais[4339]: [SYNC ] This node is within the primary component and will provide service. &lt;br /&gt;
May  6 01:11:10 an-node04 openais[4339]: [TOTEM] entering OPERATIONAL state. &lt;br /&gt;
May  6 01:11:10 an-node04 openais[4339]: [CLM  ] got nodejoin message 192.168.3.74 &lt;br /&gt;
May  6 01:11:10 an-node04 openais[4339]: [CPG  ] got joinlist message from node 1 &lt;br /&gt;
May  6 01:11:23 an-node04 fenced[4358]: fence &amp;quot;an-node05.alteeve.com&amp;quot; success&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Success!&lt;br /&gt;
&lt;br /&gt;
Now repeat this, making &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt; the victim. &lt;br /&gt;
&lt;br /&gt;
If both fence tests succeeded against both nodes, you can be confident that fencing is working well!&lt;br /&gt;
&lt;br /&gt;
= Setting Up Clustered Storage =&lt;br /&gt;
&lt;br /&gt;
The next few steps will cover setting up the DRBD resources, using them in clustered [[LVM]] and the creating a [[GFS2]] partition. Next, we will add it all as cluster resources and then create a service for each node to start up all of the clustered storage.&lt;br /&gt;
&lt;br /&gt;
== Creating Our DRBD Resources ==&lt;br /&gt;
&lt;br /&gt;
We&#039;re going to create four DRBD resources;&lt;br /&gt;
&lt;br /&gt;
* A resource to back our shared [[GFS2]] partition which will hold shared files, like our virtual machine configuration files.&lt;br /&gt;
* A resource to back the VMs running primarily on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt;.&lt;br /&gt;
* A resource to back the VMs running primarily on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt;.&lt;br /&gt;
* A final resource that will be left alone for future expansion. This is optional, of course.&lt;br /&gt;
&lt;br /&gt;
=== The &amp;quot;Why&amp;quot; of Our Layout ===&lt;br /&gt;
&lt;br /&gt;
The reason for this is to minimize the chance of data loss in a [[split-brain]] event. &lt;br /&gt;
&lt;br /&gt;
A split-brain occurs when a [[DRBD]] resource loses it&#039;s network link while in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Primary/Primary&amp;lt;/span&amp;gt; mode. The problem is that, after the split, any write to either node is not replicated to the other node. Thus, after even one [[byte]] is written, the DRBD resource is out of sync. Once this happens, there is no real way to automate recovery. You will need to go in and manual flag one side of the resource to discard it&#039;s changes and then manually re-connect the two sides before the resource will be usable again.&lt;br /&gt;
&lt;br /&gt;
We will take steps to prevent this, but it always a possibility with shared storage.&lt;br /&gt;
&lt;br /&gt;
Given then that there is no sure way to avoid this, we&#039;re going to mitigate risk by breaking up our DRBD resources so that we can be more selective in choosing what parts to invalidate after a split brain event.&lt;br /&gt;
&lt;br /&gt;
* The small GFS2 partition will be the hardest to manage. For this reason, it is on it&#039;s own. For the same reason, we will be using it as little as we can, and copies of files we care about will be stored on each node. The main thing here are the VM configuration files. This should be written to rarely, so with luck, in a split brain condition, simply nothing will be written to either side so recovery should be arbitrary and simple.&lt;br /&gt;
* The VMs that will primarily run on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt; will get their own resource. This way we can simply invalidate the DRBD device on the node that was &#039;&#039;&#039;not&#039;&#039;&#039; running the VMs during the split brain.&lt;br /&gt;
* Likewise, the VMs primarily running on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt; will get their own resource. This way, if a split brain happens and VMs are running on both nodes, it should be easily to invalidate opposing nodes for the respective DRBD resource.&lt;br /&gt;
* The fourth DRBD resource will just contain free space. This can later be added whole to an existing LVM VG or further divided up as needed in the future.&lt;br /&gt;
&lt;br /&gt;
== Visualizing Storage ==&lt;br /&gt;
&lt;br /&gt;
The layout of our storage is, on the surface, somewhat complex. To help follow what we&#039;ll be creating, here is an [[ASCII]] drawing showing what it will look like. Note that example VMs are shown, which we will not be creating. This is to help you see where extra VMs would exist if you ran two or more VMs per node.&lt;br /&gt;
&lt;br /&gt;
If you are using [[RAID]], then you can simply replace &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;sdaX&amp;lt;/span&amp;gt; with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;mdX&amp;lt;/span&amp;gt;. You can find a tutorial on manually creating RAID devices here:&lt;br /&gt;
* [[Managing Software RAID Arrays]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
         [ an-node04 ]&lt;br /&gt;
  ______   ______    ______     __[sda4]__&lt;br /&gt;
 | sda1 | | sda2 |  | sda3 |   |  ______  |       _______    ______________    ______________________________&lt;br /&gt;
 |______| |______|  |______|   | | sda5 |-+------| drbd0 |--| drbd_sh0_vg0 |--| /dev/drbd_sh0_vg0/xen_shared |&lt;br /&gt;
     |        |         |      | |______| |   /--|_______|  |______________|  |______________________________|&lt;br /&gt;
  ___|___    _|_    ____|____  |  ______  |   |     _______    ______________    ____________________________&lt;br /&gt;
 | /boot |  | / |  | &amp;lt;swap&amp;gt;  | | | sda6 |-+---+----| drbd1 |--| drbd_an4_vg0 |--| /dev/drbd_an4_vg0/vm0001_1 |&lt;br /&gt;
 |_______|  |___|  |_________| | |______| |   | /--|_______|  |______________|  |____________________________|&lt;br /&gt;
                               |  ______  |   | |     _______    ______________    ____________________________&lt;br /&gt;
                               | | sda7 |-+---+-+----| drbd2 |--| drbd_an5_vg0 |--| /dev/drbd_an5_vg0/vm0002_1 | &lt;br /&gt;
                               | |______| |   | | /--|_______|  |______________|  |____________________________|&lt;br /&gt;
                               |  ______  |   | | |                         | |    _______________________&lt;br /&gt;
                               | | sda8 |-+---+-+-+--\                      | \---| Example LV for 2nd VM |&lt;br /&gt;
                               | |______| |   | | |  |                      |     |_______________________|&lt;br /&gt;
                               |__________|   | | |  |                      |      _______________________&lt;br /&gt;
         [ an-node05 ]                        | | |  |                      \-----| Example LV for 3rd VM |&lt;br /&gt;
  ______   ______    ______     __[sda4]__    | | |  |                            |_______________________|&lt;br /&gt;
 | sda1 | | sda2 |  | sda3 |   |  ______  |   | | |  |                   &lt;br /&gt;
 |______| |______|  |______|   | | sda5 |-+---/ | |  |   _______    __________________&lt;br /&gt;
     |        |         |      | |______| |     | |  \--| drbd3 |--| Spare PV for     |&lt;br /&gt;
  ___|___    _|_    ____|____  |  ______  |     | |  /--|_______|  | future expansion |&lt;br /&gt;
 | /boot |  | / |  | &amp;lt;swap&amp;gt;  | | | sda6 |-+-----/ |  |             |__________________|&lt;br /&gt;
 |_______|  |___|  |_________| | |______| |       |  |&lt;br /&gt;
                               |  ______  |       |  |&lt;br /&gt;
                               | | sda7 |-+-------/  |&lt;br /&gt;
                               | |______| |          |&lt;br /&gt;
                               |  ______  |          |&lt;br /&gt;
                               | | sda8 |-+----------/&lt;br /&gt;
                               | |______| |&lt;br /&gt;
                               |__________|&lt;br /&gt;
.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Modifying the Physical Storage ===&lt;br /&gt;
&lt;br /&gt;
{{warning|1=Multiple assumptions ahead. If you are comfortable &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fdisk&amp;lt;/span&amp;gt; (and possibly &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;mdadm&amp;lt;/span&amp;gt;), you can largely skip this section. You will need to create four partitions; This tutorial uses a &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;10&amp;lt;/span&amp;gt; [[GiB]] for shared files, two &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;100&amp;lt;/span&amp;gt; [[GiB]] and the remainder of the space in the last partition. These will be four extended partitions, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/sda5&amp;lt;/span&amp;gt;, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/sda6&amp;lt;/span&amp;gt;, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/sda7&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/sda8&amp;lt;/span&amp;gt; respectively.}}&lt;br /&gt;
&lt;br /&gt;
This tutorial, in the interest of simplicity and not aiming to be a disk management tutorial, uses single-disk storage on each node. If you only have one disk, or if you have hardware RAID, this is sufficient. However, if you have multiple disks and want to use software RAID on your nodes, you will need to create &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/mdX&amp;lt;/span&amp;gt; devices to match the layout we will be creating. Here is a tutorial on managing software RAID arrays, written with this tutorial in mind.&lt;br /&gt;
&lt;br /&gt;
* [[Managing Software RAID Arrays]]&lt;br /&gt;
&lt;br /&gt;
We will need four new partitions; a &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;10&amp;lt;/span&amp;gt; [[GiB]] partition for the [[GFS2]] resource, two &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;100&amp;lt;/span&amp;gt; [[GiB]] partitions for the VMs on either node and the remainder of the disk&#039;s free space for the last partition. To do this, we will use the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fdisk&amp;lt;/span&amp;gt; tool. Be aware; This tool directly edits the hard drive&#039;s geometry. This is obviously risky! All along, this tutorial has assumed that you are working on test nodes, but it bears repeating again. Do not do this on a machine with data you care about! At the very least, have a good backup.&lt;br /&gt;
&lt;br /&gt;
Finally, this assumes that you used the [[generic_el5_node.ks|kickstart script]] when setting up your nodes. More to the point, it assumes an existing fourth primary partition which we will delete, convert to an extended partition and then within that create the four usable partitions.&lt;br /&gt;
&lt;br /&gt;
{{note|1=This is no longer completely accurate. The new kickstart script above does not create the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/sda4&amp;lt;/span&amp;gt; device any longer. The example remains though to show how to delete a partition, in case it is helpful to some readers.}}&lt;br /&gt;
&lt;br /&gt;
So first, delete the fourth partition.&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;
The number of cylinders for this disk is set to 60801.&lt;br /&gt;
There is nothing wrong with that, but this is larger than 1024,&lt;br /&gt;
and could in certain setups cause problems with:&lt;br /&gt;
1) software that runs at boot time (e.g., old versions of LILO)&lt;br /&gt;
2) booting and partitioning software from other OSs&lt;br /&gt;
   (e.g., DOS FDISK, OS/2 FDISK)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Confirm that the layout is indeed four partitions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Command (m for help): 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;
&lt;br /&gt;
   Device Boot      Start         End      Blocks   Id  System&lt;br /&gt;
/dev/sda1   *           1          32      257008+  83  Linux&lt;br /&gt;
/dev/sda2              33        2643    20972857+  83  Linux&lt;br /&gt;
/dev/sda3            2644        3165     4192965   82  Linux swap / Solaris&lt;br /&gt;
/dev/sda4            3166       60801   462961170   83  Linux&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is, so let&#039;s delete &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/sda4&amp;lt;/span&amp;gt; and then confirm that it is gone.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Command (m for help): d&lt;br /&gt;
Partition number (1-4): 4&lt;br /&gt;
&lt;br /&gt;
Command (m for help): 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;
&lt;br /&gt;
   Device Boot      Start         End      Blocks   Id  System&lt;br /&gt;
/dev/sda1   *           1          32      257008+  83  Linux&lt;br /&gt;
/dev/sda2              33        2643    20972857+  83  Linux&lt;br /&gt;
/dev/sda3            2644        3165     4192965   82  Linux swap / Solaris&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is, so now we&#039;ll create the extended partition.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Command (m for help): n&lt;br /&gt;
Command action&lt;br /&gt;
   e   extended&lt;br /&gt;
   p   primary partition (1-4)&lt;br /&gt;
e&lt;br /&gt;
Selected partition 4&lt;br /&gt;
First cylinder (3166-60801, default 3166): &amp;lt;enter&amp;gt;&lt;br /&gt;
Using default value 3166&lt;br /&gt;
Last cylinder or +size or +sizeM or +sizeK (3166-60801, default 60801): &amp;lt;enter&amp;gt;&lt;br /&gt;
Using default value 60801&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Again, a quick check to make sure the extended partition is now there.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Command (m for help): 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;
&lt;br /&gt;
   Device Boot      Start         End      Blocks   Id  System&lt;br /&gt;
/dev/sda1   *           1          32      257008+  83  Linux&lt;br /&gt;
/dev/sda2              33        2643    20972857+  83  Linux&lt;br /&gt;
/dev/sda3            2644        3165     4192965   82  Linux swap / Solaris&lt;br /&gt;
/dev/sda4            3166       60801   462961170    5  Extended&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Finally, let&#039;s create the four partitions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Command (m for help): n&lt;br /&gt;
First cylinder (3166-60801, default 3166): &lt;br /&gt;
Using default value 3166&lt;br /&gt;
Last cylinder or +size or +sizeM or +sizeK (3166-60801, default 60801): +10G&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;
Command (m for help): n&lt;br /&gt;
First cylinder (4383-60801, default 4383): &amp;lt;enter&amp;gt;&lt;br /&gt;
Using default value 4383&lt;br /&gt;
Last cylinder or +size or +sizeM or +sizeK (4383-60801, default 60801): +100G&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;
Command (m for help): n&lt;br /&gt;
First cylinder (16542-60801, default 16542): &amp;lt;enter&amp;gt;&lt;br /&gt;
Using default value 16542&lt;br /&gt;
Last cylinder or +size or +sizeM or +sizeK (16542-60801, default 60801): +100G&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;
Command (m for help): n&lt;br /&gt;
First cylinder (28701-60801, default 28701): &amp;lt;enter&amp;gt;&lt;br /&gt;
Using default value 28701&lt;br /&gt;
Last cylinder or +size or +sizeM or +sizeK (28701-60801, default 60801): &amp;lt;enter&amp;gt;&lt;br /&gt;
Using default value 60801&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Finally, check that the four new partitions exist.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Command (m for help): 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;
&lt;br /&gt;
   Device Boot      Start         End      Blocks   Id  System&lt;br /&gt;
/dev/sda1   *           1          32      257008+  83  Linux&lt;br /&gt;
/dev/sda2              33        2643    20972857+  83  Linux&lt;br /&gt;
/dev/sda3            2644        3165     4192965   82  Linux swap / Solaris&lt;br /&gt;
/dev/sda4            3166       60801   462961170    5  Extended&lt;br /&gt;
/dev/sda5            3166        4382     9775521   83  Linux&lt;br /&gt;
/dev/sda6            4383       16541    97667136   83  Linux&lt;br /&gt;
/dev/sda7           16542       28700    97667136   83  Linux&lt;br /&gt;
/dev/sda8           28701       60801   257851251   83  Linux&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We do! So now we&#039;ll commit the changes to disk and exit.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Command (m for help): 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.&lt;br /&gt;
The new table will be used at the next reboot.&lt;br /&gt;
Syncing disks.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{warning|1=Repeat the steps on the other node and double-check that the output of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fdisk -l /dev/sda&amp;lt;/span&amp;gt; shows the same &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Start&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;End&amp;lt;/span&amp;gt; boundaries. &#039;&#039;If they do not match, fix it before proceeding&#039;&#039;.}}&lt;br /&gt;
&lt;br /&gt;
{{note|1=This was done on the same disk as the host OS, so we&#039;ll need to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;reboot&amp;lt;/span&amp;gt; before we can proceed.}}&lt;br /&gt;
&lt;br /&gt;
== Creating the DRBD Resources ==&lt;br /&gt;
&lt;br /&gt;
Now that we have either node&#039;s storage ready, we can configure and start the DRBD resources. DRBD has &amp;quot;resource names&amp;quot;, which is it&#039;s internal reference to the &amp;quot;array&amp;quot;. These names are used whenever you are working on the resource using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;drbdadm&amp;lt;/span&amp;gt; or similar tools. The tradition is to name the resources as &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rX&amp;lt;/span&amp;gt;, with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;X&amp;lt;/span&amp;gt; being a sequence number starting at &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;0&amp;lt;/span&amp;gt;. The resource itself is made available as a normal &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/&amp;lt;/span&amp;gt; block device. The tradition is to name this device &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/drbdX&amp;lt;/span&amp;gt; where &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;X&amp;lt;/span&amp;gt; matches the resource&#039;s sequence number.&lt;br /&gt;
&lt;br /&gt;
=== The DRBD Fence Script ===&lt;br /&gt;
&lt;br /&gt;
{{warning|1=There is a problem with the current [[Node Assassin]] fence agent where multiple simultaneous fence calls will fail to return a success after each fence call. Until this is resolved, you will need to disable &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;outdate-peer&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fencing&amp;lt;/span&amp;gt; in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/drbd.conf&amp;lt;/span&amp;gt; by commenting out the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;disk { }&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;handler { }&amp;lt;/span&amp;gt; blocks in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;common { }&amp;lt;/span&amp;gt;.}}&lt;br /&gt;
&lt;br /&gt;
Red Hat&#039;s [http://people.redhat.com/lhh/ Lon Hohberger] created a DRBD script called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[obliterate]]&amp;lt;/span&amp;gt;, which was later updated to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[obliterate-peer.sh]]&amp;lt;/span&amp;gt;, that allows DRBD to trigger a fence call through the cluster when it detects a split-brain condition. The goal behind this is to stop the resource(s) from being flagged as &amp;quot;split-brain&amp;quot; in the first place, thus avoiding manual recovery. We will be using the newer &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[obliterate-peer.sh]]&amp;lt;/span&amp;gt; script. The difference between the two scripts is that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[obliterate]]&amp;lt;/span&amp;gt; will try to fence once only, where &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[obliterate-peer.sh]]&amp;lt;/span&amp;gt; will continue to fence until it succeeds. The former will block DRBD if it fails, which is not good.&lt;br /&gt;
&lt;br /&gt;
Download the script below and save it under your &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/sbin/&amp;lt;/span&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/sbin/[[obliterate-peer.sh]]&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then ensure that it is executable.&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/sbin/obliterate-peer.sh -O /sbin/obliterate-peer.sh&lt;br /&gt;
chmod a+x /sbin/obliterate-peer.sh&lt;br /&gt;
ls -lah /sbin/obliterate-peer.sh &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
-rw-r--r-- 1 root root 2.1K May  4 14:31 /sbin/obliterate-peer.sh&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Our Desired Layout in Detail ===&lt;br /&gt;
&lt;br /&gt;
Let&#039;s review how we will bring the devices together.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt;&lt;br /&gt;
!&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt;&lt;br /&gt;
!DRBD Resource&lt;br /&gt;
!DRBD Device&lt;br /&gt;
!Size&lt;br /&gt;
!Note&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/sda5&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/sda5&amp;lt;/span&amp;gt;&lt;br /&gt;
|style=&amp;quot;text-align: center;&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;r0&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/drbd0&amp;lt;/span&amp;gt;&lt;br /&gt;
|style=&amp;quot;white-space: nowrap; text-align: center;&amp;quot;|10 [[GB]]&lt;br /&gt;
|[[GFS2]] partition for VM configurations and shared files&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/sda6&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/sda6&amp;lt;/span&amp;gt;&lt;br /&gt;
|style=&amp;quot;text-align: center;&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;r1&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/drbd1&amp;lt;/span&amp;gt;&lt;br /&gt;
|style=&amp;quot;white-space: nowrap; text-align: center;&amp;quot;|100 [[GB]]&lt;br /&gt;
|Host VMs that will primarily run on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/sda7&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/sda7&amp;lt;/span&amp;gt;&lt;br /&gt;
|style=&amp;quot;text-align: center;&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;r2&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/drbd2&amp;lt;/span&amp;gt;&lt;br /&gt;
|style=&amp;quot;white-space: nowrap; text-align: center;&amp;quot;|100 [[GB]]&lt;br /&gt;
|Host VMs that will primarily run on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/sda8&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/sda8&amp;lt;/span&amp;gt;&lt;br /&gt;
|style=&amp;quot;text-align: center;&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;r3&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/drbd3&amp;lt;/span&amp;gt;&lt;br /&gt;
|style=&amp;quot;white-space: nowrap;&amp;quot;|&lt;br /&gt;
|Free space that can later be allocated to an existing [[VG]] as-is or further divided up into two or more DRBD resources as future needs dictate.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Configuring /etc/drbd.conf ===&lt;br /&gt;
&lt;br /&gt;
With this plan then, we can now create the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/drbd.conf&amp;lt;/span&amp;gt; configuration file.&lt;br /&gt;
&lt;br /&gt;
The initial file is very sparse;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/drbd.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;
#&lt;br /&gt;
# please have a a look at the example configuration file in&lt;br /&gt;
# /usr/share/doc/drbd83/drbd.conf&lt;br /&gt;
#&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Setting up the &#039;global&#039; Directive ====&lt;br /&gt;
&lt;br /&gt;
There are a lot of options available to you, many of which are outside the scope of this tutorial. You can get a good overview of all option by reading the man page; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;man drbd.conf&amp;lt;/span&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
The first section we will add is the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;global { }&amp;lt;/span&amp;gt; directive. There is only one argument we will set, which tells DRBD that it can count our install in the Linbit user information. If you have privacy concerns, set this to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;no&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;
# The &#039;global&#039; directive covers values that apply to RBD in general.&lt;br /&gt;
global {&lt;br /&gt;
        # This tells Linbit that it&#039;s okay to count us as a DRBD user. If you&lt;br /&gt;
        # have privacy concerns, set this to &#039;no&#039;.&lt;br /&gt;
        usage-count     yes;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Setting up the &#039;common&#039; Directive ====&lt;br /&gt;
&lt;br /&gt;
The next directive is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;common { }&amp;lt;/span&amp;gt;. This sets values to be used on all DRBD resources by default. You can override &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;common&amp;lt;/span&amp;gt; values in any given resource directive later. &lt;br /&gt;
&lt;br /&gt;
The example below is well documented, so please take a moment to look at the example for &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;
# The &#039;common&#039; directive sets defaults values for all resources.&lt;br /&gt;
common {&lt;br /&gt;
        # Protocol &#039;C&#039; tells DRBD to not report a disk write as complete until&lt;br /&gt;
        # it has been confirmed written to both nodes. This is required for&lt;br /&gt;
        # Primary/Primary use.&lt;br /&gt;
        protocol C;&lt;br /&gt;
&lt;br /&gt;
        # This sets the default sync rate to 15 MiB/sec. Be careful about&lt;br /&gt;
        # setting this too high! High speed sync&#039;ing can flog your drives and&lt;br /&gt;
        # push disk I/O times very high.&lt;br /&gt;
        syncer {&lt;br /&gt;
                rate 15M;&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        # This tells DRBD what policy to use when a fence is required.&lt;br /&gt;
        disk {&lt;br /&gt;
                # This tells DRBD to block I/O (resource) and then try to fence&lt;br /&gt;
                # the other node (stonith). The &#039;stonith&#039; option requires that&lt;br /&gt;
                # we set a fence handler below. The name &#039;stonith&#039; comes from&lt;br /&gt;
                # &amp;quot;Shoot The Other Nide In The Head&amp;quot; and is a term used in&lt;br /&gt;
                # other clustering environments. It is synonomous with with&lt;br /&gt;
                # &#039;fence&#039;.&lt;br /&gt;
                fencing         resource-and-stonith;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        # We set &#039;stonith&#039; above, so here we tell DRBD how to actually fence&lt;br /&gt;
        # the other node.&lt;br /&gt;
        handlers {&lt;br /&gt;
                # The term &#039;outdate-peer&#039; comes from other scripts that flag&lt;br /&gt;
                # the other node&#039;s resource backing device as &#039;Inconsistent&#039;.&lt;br /&gt;
                # In our case though, we&#039;re flat-out fencing the other node,&lt;br /&gt;
                # which has the same effective result.&lt;br /&gt;
                outdate-peer    &amp;quot;/sbin/obliterate-peer.sh&amp;quot;;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        # Here we tell DRBD that we want to use Primary/Primary mode. It is&lt;br /&gt;
        # also where we define split-brain (sb) recovery policies. As we&#039;ll be&lt;br /&gt;
        # running all of our resources in Primary/Primary, only the&lt;br /&gt;
        # &#039;after-sb-2pri&#039; really means anything to us.&lt;br /&gt;
        net {&lt;br /&gt;
                # Tell DRBD to allow dual-primary.&lt;br /&gt;
                allow-two-primaries;&lt;br /&gt;
&lt;br /&gt;
                # Set the recover policy for split-brain recover when no device&lt;br /&gt;
                # in the resource was primary.&lt;br /&gt;
                after-sb-0pri   discard-zero-changes;&lt;br /&gt;
&lt;br /&gt;
                # Now if one device was primary.&lt;br /&gt;
                after-sb-1pri   discard-secondary;&lt;br /&gt;
&lt;br /&gt;
                # Finally, set the policy when both nodes were Primary. The&lt;br /&gt;
                # only viable option is &#039;disconnect&#039;, which tells DRBD to&lt;br /&gt;
                # simply tear-down the DRBD resource right away and wait for&lt;br /&gt;
                # the administrator to manually invalidate one side of the&lt;br /&gt;
                # resource.&lt;br /&gt;
                after-sb-2pri   disconnect;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        # This tells DRBD what to do when the resource starts.&lt;br /&gt;
        startup {&lt;br /&gt;
                # In our case, we&#039;re telling DRBD to promote both devices in&lt;br /&gt;
                # our resource to Primary on start.&lt;br /&gt;
                become-primary-on       both;&lt;br /&gt;
        }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Let&#039;s stop for a moment and talk about DRBD synchronization. &lt;br /&gt;
&lt;br /&gt;
A DRBD resource does &#039;&#039;&#039;not&#039;&#039;&#039; have to be synced before it can be made &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Primary/Primary&amp;lt;/span&amp;gt;. For this reason, the default sync rate for DRBD is very, very low (320 [[KiB]]/sec). This means that you can normally start your DRBD in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Primary/Primary&amp;lt;/span&amp;gt; on both nodes and get to work while the synchronization putters along in the background.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;However&#039;&#039;!&lt;br /&gt;
&lt;br /&gt;
If the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;UpToDate&amp;lt;/span&amp;gt; node goes down, the surviving &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Inconsistent&amp;lt;/span&amp;gt; node will demote to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Secondary&amp;lt;/span&amp;gt;, thus becoming unusable. In a high-availability environment like ours, this is pretty useless. So for this reason we will want to get the resources in sync as fast as possible. Likewise, while a node is sync&#039;ing, we will not be able to run the VMs on the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Inconsistent&amp;lt;/span&amp;gt; node.&lt;br /&gt;
&lt;br /&gt;
The temptation then is to set &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rate&amp;lt;/span&amp;gt; above to the maximum write speed of our disks. &#039;&#039;This is a bad idea&#039;&#039;!&lt;br /&gt;
&lt;br /&gt;
We will have four separate resources sharing the same underlying disks. If you drive the sync rate very high, and I/O on the other &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;UpToDate&amp;lt;/span&amp;gt; resources will be severely impacted. So much so that I&#039;ve seen crashes caused by this. So you will want to keep this value at a sane level. That is, you will want to set the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rate&amp;lt;/span&amp;gt; to as high as you can while still leaving the disks themselves sufficiently unbound that other I/O is still feasible. I&#039;ve personally found &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;15M&amp;lt;/span&amp;gt; on single-drive and simple RAID machines to be a good value. Feel free to experiment for yourself.&lt;br /&gt;
&lt;br /&gt;
==== Setting up the Resource Directives ====&lt;br /&gt;
&lt;br /&gt;
We now define the resources themselves. Each resource will be contained in a directive called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;resource x&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 actual resource name (&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;r0&amp;lt;/span&amp;gt;, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;r1&amp;lt;/span&amp;gt;, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;r2&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;r3&amp;lt;/span&amp;gt; in our case). Within this directive, all resource-specific options are set.&lt;br /&gt;
&lt;br /&gt;
The example below is well documented, so please take a moment to look at the example for &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;
# The &#039;resource&#039; directive defines a given resource and must be followed by the&lt;br /&gt;
# resource&#039;s name.&lt;br /&gt;
# This will be used as the GFS2 partition for shared files.&lt;br /&gt;
resource r0 {&lt;br /&gt;
        # This is the /dev/ device to create to make available this DRBD&lt;br /&gt;
        # resource.&lt;br /&gt;
        device          /dev/drbd0;&lt;br /&gt;
&lt;br /&gt;
        # This tells DRBD where to store it&#039;s internal state information. We&lt;br /&gt;
        # will use &#039;internal&#039;, which tells DRBD to store the information at the&lt;br /&gt;
        # end of the resource&#039;s space.&lt;br /&gt;
        meta-disk       internal;&lt;br /&gt;
&lt;br /&gt;
        # The next two &#039;on&#039; directives setup each individual node&#039;s settings.&lt;br /&gt;
        # The value after the &#039;on&#039; directive *MUST* match the output of&lt;br /&gt;
        # `uname -n` on each node.&lt;br /&gt;
        on an-node04.alteeve.com {&lt;br /&gt;
                # This is the network IP address on the network interface and&lt;br /&gt;
                # the TCP port to use for communication between the nodes. Note&lt;br /&gt;
                # that the IP address below in on our Storage Network. The TCP&lt;br /&gt;
                # port must be unique per resource, but the interface itself&lt;br /&gt;
                # can be shared. &lt;br /&gt;
                # IPv6 is usable with &#039;address ipv6 [address]:port&#039;.&lt;br /&gt;
                address         192.168.2.74:7789;&lt;br /&gt;
&lt;br /&gt;
                # This is the node&#039;s storage device that will back this&lt;br /&gt;
                # resource.&lt;br /&gt;
                disk            /dev/sda5;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        # Same as above, but altered to reflect the second node.&lt;br /&gt;
        on an-node05.alteeve.com {&lt;br /&gt;
                address         192.168.2.75:7789;&lt;br /&gt;
                disk            /dev/sda5;&lt;br /&gt;
        }&lt;br /&gt;
}&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;r1&amp;lt;/span&amp;gt;, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;r2&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;r3&amp;lt;/span&amp;gt; resources should be nearly identical to the example above. The main difference will the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;device&amp;lt;/span&amp;gt; value and within each node&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;on x { }&amp;lt;/span&amp;gt; directive. We will incrementing the [[TCP]] ports to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;7790&amp;lt;/span&amp;gt;, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;7791&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;7792&amp;lt;/span&amp;gt; respectively. Likewise, we will need to alter the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;disk&amp;lt;/span&amp;gt; to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/sda6&amp;lt;/span&amp;gt;, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/sda7&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/sda8&amp;lt;/span&amp;gt; respectively. Finally, the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;device&amp;lt;/span&amp;gt; will be incremented to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/drbd1&amp;lt;/span&amp;gt;, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/drbd2&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/drbd3&amp;lt;/span&amp;gt; respectively.&lt;br /&gt;
&lt;br /&gt;
=== Housekeeping Before Starting Our DRBD Resources ===&lt;br /&gt;
&lt;br /&gt;
Let&#039;s take a look at the complete &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/drbd.conf&amp;lt;/span&amp;gt; file, validate it for use and then push it to the second node.&lt;br /&gt;
&lt;br /&gt;
==== The Finished /etc/drbd.conf File ====&lt;br /&gt;
&lt;br /&gt;
The finished &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/drbd.conf&amp;lt;/span&amp;gt; file should look for or less like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
#&lt;br /&gt;
# please have a a look at the example configuration file in&lt;br /&gt;
# /usr/share/doc/drbd83/drbd.conf&lt;br /&gt;
#&lt;br /&gt;
&lt;br /&gt;
# The &#039;global&#039; directive covers values that apply to RBD in general.&lt;br /&gt;
global {&lt;br /&gt;
	# This tells Linbit that it&#039;s okay to count us as a DRBD user. If you&lt;br /&gt;
	# have privacy concerns, set this to &#039;no&#039;.&lt;br /&gt;
	usage-count	yes;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
# The &#039;common&#039; directive sets defaults values for all resources.&lt;br /&gt;
common {&lt;br /&gt;
	# Protocol &#039;C&#039; tells DRBD to not report a disk write as complete until&lt;br /&gt;
	# it has been confirmed written to both nodes. This is required for&lt;br /&gt;
	# Primary/Primary use.&lt;br /&gt;
        protocol	C;&lt;br /&gt;
&lt;br /&gt;
	# This sets the default sync rate to 15 MiB/sec. Be careful about&lt;br /&gt;
	# setting this too high! High speed sync&#039;ing can flog your drives and&lt;br /&gt;
	# push disk I/O times very high.&lt;br /&gt;
        syncer {&lt;br /&gt;
                rate	15M;&lt;br /&gt;
        }&lt;br /&gt;
	&lt;br /&gt;
	# This tells DRBD what policy to use when a fence is required.&lt;br /&gt;
        disk {&lt;br /&gt;
		# This tells DRBD to block I/O (resource) and then try to fence&lt;br /&gt;
		# the other node (stonith). The &#039;stonith&#039; option requires that&lt;br /&gt;
		# we set a fence handler below. The name &#039;stonith&#039; comes from&lt;br /&gt;
		# &amp;quot;Shoot The Other Nide In The Head&amp;quot; and is a term used in&lt;br /&gt;
		# other clustering environments. It is synonomous with with&lt;br /&gt;
		# &#039;fence&#039;.&lt;br /&gt;
                fencing		resource-and-stonith;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
	# We set &#039;stonith&#039; above, so here we tell DRBD how to actually fence&lt;br /&gt;
	# the other node.&lt;br /&gt;
        handlers {&lt;br /&gt;
		# The term &#039;outdate-peer&#039; comes from other scripts that flag&lt;br /&gt;
		# the other node&#039;s resource backing device as &#039;Inconsistent&#039;.&lt;br /&gt;
		# In our case though, we&#039;re flat-out fencing the other node,&lt;br /&gt;
		# which has the same effective result.&lt;br /&gt;
                outdate-peer	&amp;quot;/sbin/obliterate-peer.sh&amp;quot;;&lt;br /&gt;
        }&lt;br /&gt;
	&lt;br /&gt;
	# Here we tell DRBD that we want to use Primary/Primary mode. It is&lt;br /&gt;
	# also where we define split-brain (sb) recovery policies. As we&#039;ll be&lt;br /&gt;
	# running all of our resources in Primary/Primary, only the&lt;br /&gt;
	# &#039;after-sb-2pri&#039; really means anything to us.&lt;br /&gt;
        net {&lt;br /&gt;
		# Tell DRBD to allow dual-primary.&lt;br /&gt;
                allow-two-primaries;&lt;br /&gt;
&lt;br /&gt;
		# Set the recover policy for split-brain recover when no device&lt;br /&gt;
		# in the resource was primary.&lt;br /&gt;
                after-sb-0pri	discard-zero-changes;&lt;br /&gt;
&lt;br /&gt;
		# Now if one device was primary.&lt;br /&gt;
                after-sb-1pri	discard-secondary;&lt;br /&gt;
&lt;br /&gt;
		# Finally, set the policy when both nodes were Primary. The&lt;br /&gt;
		# only viable option is &#039;disconnect&#039;, which tells DRBD to&lt;br /&gt;
		# simply tear-down the DRBD resource right away and wait for&lt;br /&gt;
		# the administrator to manually invalidate one side of the&lt;br /&gt;
		# resource.&lt;br /&gt;
                after-sb-2pri	disconnect;&lt;br /&gt;
        }&lt;br /&gt;
	&lt;br /&gt;
	# This tells DRBD what to do when the resource starts.&lt;br /&gt;
        startup {&lt;br /&gt;
		# In our case, we&#039;re telling DRBD to promote both devices in&lt;br /&gt;
		# our resource to Primary on start.&lt;br /&gt;
                become-primary-on 	both;&lt;br /&gt;
        }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
# The &#039;resource&#039; directive defines a given resource and must be followed by the&lt;br /&gt;
# resource&#039;s name.&lt;br /&gt;
# This will be used as the GFS2 partition for shared files.&lt;br /&gt;
resource r0 {&lt;br /&gt;
	# This is the /dev/ device to create to make available this DRBD&lt;br /&gt;
	# resource.&lt;br /&gt;
        device 		/dev/drbd0;&lt;br /&gt;
	&lt;br /&gt;
	# This tells DRBD where to store it&#039;s internal state information. We&lt;br /&gt;
	# will use &#039;internal&#039;, which tells DRBD to store the information at the&lt;br /&gt;
	# end of the resource&#039;s space.&lt;br /&gt;
        meta-disk 	internal;&lt;br /&gt;
	&lt;br /&gt;
	# The next two &#039;on&#039; directives setup each individual node&#039;s settings.&lt;br /&gt;
	# The value after the &#039;on&#039; directive *MUST* match the output of&lt;br /&gt;
	# `uname -n` on each node.&lt;br /&gt;
        on an-node04.alteeve.com {&lt;br /&gt;
		# This is the network IP address on the network interface and&lt;br /&gt;
		# the TCP port to use for communication between the nodes. Note&lt;br /&gt;
		# that the IP address below in on our Storage Network. The TCP&lt;br /&gt;
		# port must be unique per resource, but the interface itself&lt;br /&gt;
		# can be shared. &lt;br /&gt;
		# IPv6 is usable with &#039;address ipv6 [address]:port&#039;.&lt;br /&gt;
                address 	192.168.2.74:7789;&lt;br /&gt;
		&lt;br /&gt;
		# This is the node&#039;s storage device that will back this&lt;br /&gt;
		# resource.&lt;br /&gt;
                disk    	/dev/sda5;&lt;br /&gt;
        }&lt;br /&gt;
	&lt;br /&gt;
	# Same as above, but altered to reflect the second node.&lt;br /&gt;
        on an-node05.alteeve.com {&lt;br /&gt;
                address 	192.168.2.75:7789;&lt;br /&gt;
                disk    	/dev/sda5;&lt;br /&gt;
        }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
# This will be used to host VMs running primarily on an-node04.&lt;br /&gt;
resource r1 {&lt;br /&gt;
        device          /dev/drbd1;&lt;br /&gt;
&lt;br /&gt;
        meta-disk       internal;&lt;br /&gt;
&lt;br /&gt;
        on an-node04.alteeve.com {&lt;br /&gt;
                address         192.168.2.74:7790;&lt;br /&gt;
                disk            /dev/sda6;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        on an-node05.alteeve.com {&lt;br /&gt;
                address         192.168.2.75:7790;&lt;br /&gt;
                disk            /dev/sda6;&lt;br /&gt;
        }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
# This will be used to host VMs running primarily on an-node05.&lt;br /&gt;
resource r2 {&lt;br /&gt;
        device          /dev/drbd2;&lt;br /&gt;
&lt;br /&gt;
        meta-disk       internal;&lt;br /&gt;
&lt;br /&gt;
        on an-node04.alteeve.com {&lt;br /&gt;
                address         192.168.2.74:7791;&lt;br /&gt;
                disk            /dev/sda7;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        on an-node05.alteeve.com {&lt;br /&gt;
                address         192.168.2.75:7791;&lt;br /&gt;
                disk            /dev/sda7;&lt;br /&gt;
        }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
# This will be set aside as free space for future expansion.&lt;br /&gt;
resource r3 {&lt;br /&gt;
        device          /dev/drbd3;&lt;br /&gt;
&lt;br /&gt;
        meta-disk       internal;&lt;br /&gt;
&lt;br /&gt;
        on an-node04.alteeve.com {&lt;br /&gt;
                address         192.168.2.74:7792;&lt;br /&gt;
                disk            /dev/sda8;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        on an-node05.alteeve.com {&lt;br /&gt;
                address         192.168.2.75:7792;&lt;br /&gt;
                disk            /dev/sda8;&lt;br /&gt;
        }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Validating the /etc/drbd.conf Syntax ====&lt;br /&gt;
&lt;br /&gt;
To check for errors, we will validate the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/drbd.conf&amp;lt;/span&amp;gt; file. To do this, run &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;drbdadm dump&amp;lt;/span&amp;gt;. If there are syntactical errors, fix them before proceeding. Once the file is correct, it will be dump it&#039;s view of the configuration to the screen with minimal commenting. Don&#039;t worry about slight differences (ie: &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;meta-disk external;&amp;lt;/span&amp;gt; being inside the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;on { }&amp;lt;/span&amp;gt; directives).&lt;br /&gt;
&lt;br /&gt;
The first time you ever do this, you will also see a note telling you that you are the &#039;&#039;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;n&amp;lt;/span&amp;gt;&#039;&#039;th DRBD user.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
drbdadm dump&lt;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 9369th user to install this version&lt;br /&gt;
# /etc/drbd.conf&lt;br /&gt;
common {&lt;br /&gt;
    protocol               C;&lt;br /&gt;
    net {&lt;br /&gt;
        allow-two-primaries;&lt;br /&gt;
        after-sb-0pri    discard-zero-changes;&lt;br /&gt;
        after-sb-1pri    discard-secondary;&lt;br /&gt;
        after-sb-2pri    disconnect;&lt;br /&gt;
    }&lt;br /&gt;
    disk {&lt;br /&gt;
        fencing          resource-and-stonith;&lt;br /&gt;
    }&lt;br /&gt;
    syncer {&lt;br /&gt;
        rate             15M;&lt;br /&gt;
    }&lt;br /&gt;
    startup {&lt;br /&gt;
        become-primary-on both;&lt;br /&gt;
    }&lt;br /&gt;
    handlers {&lt;br /&gt;
        fence-peer       /sbin/obliterate-peer.sh;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
# resource r0 on an-node04.alteeve.com: not ignored, not stacked&lt;br /&gt;
resource r0 {&lt;br /&gt;
    on an-node04.alteeve.com {&lt;br /&gt;
        device           /dev/drbd0 minor 0;&lt;br /&gt;
        disk             /dev/sda5;&lt;br /&gt;
        address          ipv4 192.168.2.74:7789;&lt;br /&gt;
        meta-disk        internal;&lt;br /&gt;
    }&lt;br /&gt;
    on an-node05.alteeve.com {&lt;br /&gt;
        device           /dev/drbd0 minor 0;&lt;br /&gt;
        disk             /dev/sda5;&lt;br /&gt;
        address          ipv4 192.168.2.75:7789;&lt;br /&gt;
        meta-disk        internal;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
# resource r1 on an-node04.alteeve.com: not ignored, not stacked&lt;br /&gt;
resource r1 {&lt;br /&gt;
    on an-node04.alteeve.com {&lt;br /&gt;
        device           /dev/drbd1 minor 1;&lt;br /&gt;
        disk             /dev/sda6;&lt;br /&gt;
        address          ipv4 192.168.2.74:7790;&lt;br /&gt;
        meta-disk        internal;&lt;br /&gt;
    }&lt;br /&gt;
    on an-node05.alteeve.com {&lt;br /&gt;
        device           /dev/drbd1 minor 1;&lt;br /&gt;
        disk             /dev/sda6;&lt;br /&gt;
        address          ipv4 192.168.2.75:7790;&lt;br /&gt;
        meta-disk        internal;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
# resource r2 on an-node04.alteeve.com: not ignored, not stacked&lt;br /&gt;
resource r2 {&lt;br /&gt;
    on an-node04.alteeve.com {&lt;br /&gt;
        device           /dev/drbd2 minor 2;&lt;br /&gt;
        disk             /dev/sda7;&lt;br /&gt;
        address          ipv4 192.168.2.74:7791;&lt;br /&gt;
        meta-disk        internal;&lt;br /&gt;
    }&lt;br /&gt;
    on an-node05.alteeve.com {&lt;br /&gt;
        device           /dev/drbd2 minor 2;&lt;br /&gt;
        disk             /dev/sda7;&lt;br /&gt;
        address          ipv4 192.168.2.75:7791;&lt;br /&gt;
        meta-disk        internal;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
# resource r3 on an-node04.alteeve.com: not ignored, not stacked&lt;br /&gt;
resource r3 {&lt;br /&gt;
    on an-node04.alteeve.com {&lt;br /&gt;
        device           /dev/drbd3 minor 3;&lt;br /&gt;
        disk             /dev/sda8;&lt;br /&gt;
        address          ipv4 192.168.2.74:7792;&lt;br /&gt;
        meta-disk        internal;&lt;br /&gt;
    }&lt;br /&gt;
    on an-node05.alteeve.com {&lt;br /&gt;
        device           /dev/drbd3 minor 3;&lt;br /&gt;
        disk             /dev/sda8;&lt;br /&gt;
        address          ipv4 192.168.2.75:7792;&lt;br /&gt;
        meta-disk        internal;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Copying The /etc/drbd.conf to the Second Node ====&lt;br /&gt;
&lt;br /&gt;
Assuming you write the first &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/drbd.conf&amp;lt;/span&amp;gt; file on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt;. So now we need to copy it to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt; before we can start things up.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
rsync -av /etc/drbd.conf root@an-node05:/etc/&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
building file list ... done&lt;br /&gt;
drbd.conf&lt;br /&gt;
&lt;br /&gt;
sent 5577 bytes  received 48 bytes  3750.00 bytes/sec&lt;br /&gt;
total size is 5479  speedup is 0.97&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Loading the DRBD Module ===&lt;br /&gt;
&lt;br /&gt;
By default, the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/init.d/drbd&amp;lt;/span&amp;gt; initialization script handles loading and unloading the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;drbd&amp;lt;/span&amp;gt; module. It&#039;s too early for us to start the DRBD resources using the initialization script, so we need to manually load the module ourselves. This will only need to be done once. After you get the DRBD resources up for the first time, you can safely use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/init.d/drbd&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
To load the module, run:&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;
You can verify that the module is loaded using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;lsmod&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;
lsmod |grep 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;
drbd                  277144  0 &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The module also creates a &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/proc&amp;lt;/span&amp;gt; file called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;drbd&amp;lt;/span&amp;gt;. By &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cat&amp;lt;/span&amp;gt;&#039;ing this, we can watch the progress of our work. I&#039;d recommend opening a terminal windows for each node and tracking it using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;watch&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;
watch cat /proc/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;
Every 2.0s: cat /proc/drbd                                                                     Tue Mar 29 13:03:44 2011&lt;br /&gt;
&lt;br /&gt;
version: 8.3.8 (api:88/proto:86-94)&lt;br /&gt;
GIT-hash: d78846e52224fd00562f7c225bcc25b2d422321d build by mockbuild@builder10.centos.org, 2010-06-04 08:04:27&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the steps ahead, I will show what the output from &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;watch&amp;lt;/span&amp;gt;&#039;ing &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/proc/drbd&amp;lt;/span&amp;gt; will be.&lt;br /&gt;
&lt;br /&gt;
=== Initializing Our Resources ===&lt;br /&gt;
&lt;br /&gt;
Before we can start each resource, we must first initialize each of the backing device. This is done by running &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;drbdadm create-md x&amp;lt;/span&amp;gt;. We&#039;ll run this on both nodes, replacing &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;x&amp;lt;/span&amp;gt; with the four resource names.&lt;br /&gt;
&lt;br /&gt;
The first time you do this, the command will execute right away.&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;
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;
If you&#039;ve ever used the partition in a DRBD device before though, you will need to confirm that you want to over-write the existing meta-data.&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;
&lt;br /&gt;
Type &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;yes&amp;lt;/span&amp;gt; when prompted.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
You want me to create a v08 style flexible-size internal meta data block.&lt;br /&gt;
There appears to be a v08 flexible-size internal meta data block&lt;br /&gt;
already in place on /dev/sda5 at byte offset 10010128384&lt;br /&gt;
Do you really want to overwrite the existing v08 meta-data?&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
[need to type &#039;yes&#039; to confirm] yes&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&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;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Repeat for all four resource names, then do the same on the other node.&lt;br /&gt;
&lt;br /&gt;
{{note|1=If you are trying to initialize a resource&#039;s backing device that has been used before, you may need to wipe out the first few blocks.}}&lt;br /&gt;
&lt;br /&gt;
If you try to initialize the resource&#039;s backing device and get an error like below, you will need to &amp;quot;zero out&amp;quot; the first bit of the resource. This is done by using the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;dd&amp;lt;/span&amp;gt; (disk duplication) program, reading in from the special &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/zero&amp;lt;/span&amp;gt; file and writing out a set number of block (usually 4096 [[KiB]]) at the start of the DRBD resource.&lt;br /&gt;
&lt;br /&gt;
If you see the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
pvs stderr:        _undo_flock /var/lock/lvm/V_drbd_sh0_vg0&lt;br /&gt;
pvs stderr:  Skipping volume group drbd_sh0_vg0&lt;br /&gt;
pvs stderr:      Unlocking /var/lock/lvm/P_global&lt;br /&gt;
pvs stderr:        _undo_flock /var/lock/lvm/P_global&lt;br /&gt;
&lt;br /&gt;
md_offset 10010128384&lt;br /&gt;
al_offset 10010095616&lt;br /&gt;
bm_offset 10009788416&lt;br /&gt;
&lt;br /&gt;
Found LVM2 physical volume signature&lt;br /&gt;
     9775184 kB left usable by current configuration&lt;br /&gt;
Could not determine the size of the actually used data area.&lt;br /&gt;
&lt;br /&gt;
Device size would be truncated, which&lt;br /&gt;
would corrupt data and result in&lt;br /&gt;
&#039;access beyond end of device&#039; errors.&lt;br /&gt;
If you want me to do this, you need to zero out the first part&lt;br /&gt;
of the device (destroy the content).&lt;br /&gt;
You should be very sure that you mean it.&lt;br /&gt;
Operation refused.&lt;br /&gt;
&lt;br /&gt;
Command &#039;drbdmeta 0 v08 /dev/sda5 internal create-md&#039; terminated with exit code 40&lt;br /&gt;
drbdadm create-md r0: exited with code 40&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then you will need to zero the start of the backing device.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
dd if=/dev/zero of=/dev/sda5 count=10000&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
10000+0 records in&lt;br /&gt;
10000+0 records out&lt;br /&gt;
5120000 bytes (5.1 MB) copied, 0.101682 seconds, 50.4 MB/s&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You should now be able to initialize the resource.&lt;br /&gt;
&lt;br /&gt;
=== Initial Connections ===&lt;br /&gt;
&lt;br /&gt;
As this is the first time that the DRBD resource will be started, neither side will be in a &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;consistent&amp;lt;/span&amp;gt; state. The effect is that we will not be able to promote either node to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Primary&amp;lt;/span&amp;gt;. So we need to tell DRBD that it must consider one side to be valid and, thus, overwrite the other node&#039;s data.&lt;br /&gt;
&lt;br /&gt;
{{note|1=This is the &#039;&#039;&#039;only&#039;&#039;&#039; time you should ever use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--overwrite-data-of-peer&amp;lt;/span&amp;gt;! Never use it to recover from a split brain.}}&lt;br /&gt;
&lt;br /&gt;
The steps we will now take for each resource are:&lt;br /&gt;
* Attach each node&#039;s backing device to the DRBD resource.&lt;br /&gt;
* Establish the network connection between the two nodes.&lt;br /&gt;
* Force one node&#039;s backing device to be considered &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;UpToDate&amp;lt;/span&amp;gt; and promote it to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Primary&amp;lt;/span&amp;gt;.&lt;br /&gt;
* Promote the second node to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Primary&amp;lt;/span&amp;gt;&lt;br /&gt;
* Bump the synchronization rate to the value specified in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/drbd.conf&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Now lets walk through these steps, taking a look at &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/proc/drbd&amp;lt;/span&amp;gt; after each step.&lt;br /&gt;
&lt;br /&gt;
{{note|1=You can save some typing with a &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;bash&amp;lt;/span&amp;gt; trick. Where you would normally call &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;r0&amp;lt;/span&amp;gt;, then &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;r1&amp;lt;/span&amp;gt;, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;r2&amp;lt;/span&amp;gt; a last &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;r3&amp;lt;/span&amp;gt;, you can call all at once by instead calling &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;command&amp;gt; r{0,1,2,3}&amp;lt;/span&amp;gt;.}}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On Both Nodes&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
Attach the resources local backing devices to their DRBD resources. That is, connect the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/sda{5,6,7,8}&amp;lt;/span&amp;gt; to their corresponding &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;r{0,1,2,3}&amp;lt;/span&amp;gt; resources.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
drbdadm attach r{0,1,2,3}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
version: 8.3.8 (api:88/proto:86-94)&lt;br /&gt;
GIT-hash: d78846e52224fd00562f7c225bcc25b2d422321d build by mockbuild@builder10.centos.org, 2010-06-04 08:04:27&lt;br /&gt;
 0: cs:StandAlone ro:Secondary/Unknown ds:Inconsistent/DUnknown   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:9775184&lt;br /&gt;
 1: cs:StandAlone ro:Secondary/Unknown ds:Inconsistent/DUnknown   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:97664116&lt;br /&gt;
 2: cs:StandAlone ro:Secondary/Unknown ds:Inconsistent/DUnknown   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:97664116&lt;br /&gt;
 3: cs:StandAlone ro:Secondary/Unknown ds:Inconsistent/DUnknown   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:257843340&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On Both Nodes&#039;&#039;&#039;: &lt;br /&gt;
&lt;br /&gt;
Now we&#039;ll connect the corresponding resource backing devices on each node together to create the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/drbdX&amp;lt;/span&amp;gt; devices. Note that while one node is connecting, it&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/proc/drbd&amp;lt;/span&amp;gt; will show the resource as being in the connection state of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;WFConnection&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 connect r{0,1,2,3}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
version: 8.3.8 (api:88/proto:86-94)&lt;br /&gt;
GIT-hash: d78846e52224fd00562f7c225bcc25b2d422321d build by mockbuild@builder10.centos.org, 2010-06-04 08:04:27&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:9775184&lt;br /&gt;
 1: 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:97664116&lt;br /&gt;
 2: 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:97664116&lt;br /&gt;
 3: 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:257843340&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On One Node Only&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
As the resource is totally new, we&#039;ll need to tell DRBD that one node&#039;s backing device is &amp;quot;more&amp;quot; valid than the other. It is entirely arbitrary which node we run this on. I run this on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt; out of habit. This step also promotes the local resource to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Primary&amp;lt;/span&amp;gt;, which means that it is usable by the local system.&lt;br /&gt;
&lt;br /&gt;
{{note|1=An alternative to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--overwrite-data-of-peer&amp;lt;/span&amp;gt; is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;drbdadm -- --clear-bitmap new-current-uuid res&amp;lt;/span&amp;gt; followed by &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;drbdadm primary res&amp;lt;/span&amp;gt;. This will instantly mark both sides of the DRBD resource as &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;UpToDate&amp;lt;/span&amp;gt; without needing to perform the initial sync.}}&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 r{0,1,2,3}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
version: 8.3.8 (api:88/proto:86-94)&lt;br /&gt;
GIT-hash: d78846e52224fd00562f7c225bcc25b2d422321d build by mockbuild@builder10.centos.org, 2010-06-04 08:04:27&lt;br /&gt;
 0: cs:SyncSource ro:Primary/Secondary ds:UpToDate/Inconsistent C r----&lt;br /&gt;
    ns:896 nr:0 dw:0 dr:896 al:0 bm:0 lo:0 pe:0 ua:0 ap:0 ep:1 wo:b oos:9774288&lt;br /&gt;
        [&amp;gt;....................] sync&#039;ed:  0.1% (9544/9544)M delay_probe: 701&lt;br /&gt;
        finish: 4:31:30 speed: 448 (448) K/sec&lt;br /&gt;
 1: cs:SyncSource ro:Primary/Secondary ds:UpToDate/Inconsistent C r----&lt;br /&gt;
    ns:736 nr:0 dw:0 dr:736 al:0 bm:0 lo:0 pe:0 ua:0 ap:0 ep:1 wo:b oos:97663380&lt;br /&gt;
        [&amp;gt;....................] sync&#039;ed:  0.1% (95372/95372)M delay_probe: 620&lt;br /&gt;
        finish: 67:49:18 speed: 368 (368) K/sec&lt;br /&gt;
 2: cs:SyncSource ro:Primary/Secondary ds:UpToDate/Inconsistent C r----&lt;br /&gt;
    ns:672 nr:0 dw:0 dr:672 al:0 bm:0 lo:0 pe:0 ua:0 ap:0 ep:1 wo:b oos:97663444&lt;br /&gt;
        [&amp;gt;....................] sync&#039;ed:  0.1% (95372/95372)M delay_probe: 556&lt;br /&gt;
        finish: 67:49:18 speed: 336 (336) K/sec&lt;br /&gt;
 3: cs:SyncSource ro:Primary/Secondary ds:UpToDate/Inconsistent C r----&lt;br /&gt;
    ns:576 nr:0 dw:0 dr:576 al:0 bm:0 lo:0 pe:0 ua:0 ap:0 ep:1 wo:b oos:257842764&lt;br /&gt;
        [&amp;gt;....................] sync&#039;ed:  0.1% (251796/251800)M delay_probe: 447&lt;br /&gt;
        finish: 89:31:43 speed: 576 (576) K/sec&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On The Other Node&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
The last required step is to promote the other node&#039;s resource to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Primary&amp;lt;/span&amp;gt; as well.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
drbdadm primary r{0,1,2,3}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
version: 8.3.8 (api:88/proto:86-94)&lt;br /&gt;
GIT-hash: d78846e52224fd00562f7c225bcc25b2d422321d build by mockbuild@builder10.centos.org, 2010-06-04 08:04:27&lt;br /&gt;
 0: cs:SyncSource ro:Primary/Primary ds:UpToDate/Inconsistent C r----&lt;br /&gt;
    ns:159008 nr:0 dw:0 dr:159008 al:0 bm:9 lo:0 pe:0 ua:0 ap:0 ep:1 wo:b oos:9616176&lt;br /&gt;
        [&amp;gt;....................] sync&#039;ed:  1.7% (9388/9544)M delay_probe: 130846&lt;br /&gt;
        finish: 6:40:40 speed: 256 (312) K/sec&lt;br /&gt;
 1: cs:SyncSource ro:Primary/Primary ds:UpToDate/Inconsistent C r----&lt;br /&gt;
    ns:161152 nr:0 dw:0 dr:161152 al:0 bm:9 lo:0 pe:0 ua:0 ap:0 ep:1 wo:b oos:97502964&lt;br /&gt;
        [&amp;gt;....................] sync&#039;ed:  0.2% (95216/95372)M delay_probe: 131004&lt;br /&gt;
        finish: 67:42:37 speed: 0 (316) K/sec&lt;br /&gt;
 2: cs:SyncSource ro:Primary/Primary ds:UpToDate/Inconsistent C r----&lt;br /&gt;
    ns:161024 nr:0 dw:0 dr:161024 al:0 bm:9 lo:0 pe:0 ua:0 ap:0 ep:1 wo:b oos:97503092&lt;br /&gt;
        [&amp;gt;....................] sync&#039;ed:  0.2% (95216/95372)M delay_probe: 130852&lt;br /&gt;
        finish: 76:10:27 speed: 348 (316) K/sec&lt;br /&gt;
 3: cs:SyncSource ro:Primary/Primary ds:UpToDate/Inconsistent C r----&lt;br /&gt;
    ns:160832 nr:0 dw:0 dr:160832 al:0 bm:9 lo:0 pe:0 ua:0 ap:0 ep:1 wo:b oos:257682508&lt;br /&gt;
        [&amp;gt;....................] sync&#039;ed:  0.1% (251640/251800)M delay_probe: 130729&lt;br /&gt;
        finish: 178:56:46 speed: 128 (316) K/sec&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{note|1=From here on in, the steps shown are not strictly needed. The first step is highly recommended, as it is needed to set the desired sync rate, but DRBD will work fine as it now is.}}&lt;br /&gt;
&lt;br /&gt;
DRBD is a bit sensitive to performance issues, so we have to handle multiple resources syncing at the same time a little carefully. The temptation to just raise the sync rate on all resources will get us into trouble.&lt;br /&gt;
&lt;br /&gt;
The safest bet to get all of the resources updated is to pause the synchronization on all but one resource, bump the sync rate up to a little under the maximum write speed of the resource, waiting for the resource to sync, resuming sync on the next resource and so on.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On One Node&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
Let&#039;s pause the synchronization on all but 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 pause-sync r{1,2,3}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
version: 8.3.8 (api:88/proto:86-94)&lt;br /&gt;
GIT-hash: d78846e52224fd00562f7c225bcc25b2d422321d build by mockbuild@builder10.centos.org, 2010-06-04 08:04:27&lt;br /&gt;
 0: cs:SyncSource ro:Primary/Primary ds:UpToDate/Inconsistent C r----&lt;br /&gt;
    ns:32288 nr:0 dw:0 dr:32288 al:0 bm:1 lo:0 pe:0 ua:0 ap:0 ep:1 wo:b oos:9742896&lt;br /&gt;
        [&amp;gt;....................] sync&#039;ed:  0.4% (9512/9544)M delay_probe: 26632&lt;br /&gt;
        finish: 6:45:57 speed: 336 (312) K/sec&lt;br /&gt;
 1: cs:PausedSyncS ro:Primary/Primary ds:UpToDate/Inconsistent C r--u-&lt;br /&gt;
    ns:13184 nr:0 dw:0 dr:13184 al:0 bm:0 lo:0 pe:0 ua:0 ap:0 ep:1 wo:b oos:97650932&lt;br /&gt;
 2: cs:PausedSyncS ro:Primary/Primary ds:UpToDate/Inconsistent C r--u-&lt;br /&gt;
    ns:12192 nr:0 dw:0 dr:12192 al:0 bm:0 lo:0 pe:0 ua:0 ap:0 ep:1 wo:b oos:97651924&lt;br /&gt;
 3: cs:PausedSyncS ro:Primary/Primary ds:UpToDate/Inconsistent C r--u-&lt;br /&gt;
    ns:30656 nr:0 dw:0 dr:30656 al:0 bm:1 lo:0 pe:0 ua:0 ap:0 ep:1 wo:b oos:257812684&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I know that on my server, I can get a maximum write speed of roughly 40 [[MiB]]/sec. So I will manually over-ride the defined sync rate of 15 MiB/sec and set it to 35 MiB/sec. This uses a new DRBD command called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;drbdsetup&amp;lt;/span&amp;gt; and takes the DRBD device instead of the resource name.&lt;br /&gt;
&lt;br /&gt;
{{note|1=The transfer speed will not instantly reach maximum. It takes some time for synchronization rate changes to ramp up and down.}}&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;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
version: 8.3.8 (api:88/proto:86-94)&lt;br /&gt;
GIT-hash: d78846e52224fd00562f7c225bcc25b2d422321d build by mockbuild@builder10.centos.org, 2010-06-04 08:04:27&lt;br /&gt;
 0: cs:SyncTarget ro:Primary/Primary ds:Inconsistent/UpToDate C r----&lt;br /&gt;
    ns:0 nr:253216 dw:252128 dr:0 al:0 bm:15 lo:35 pe:78 ua:34 ap:0 ep:1 wo:b oos:9523056&lt;br /&gt;
        [&amp;gt;....................] sync&#039;ed:  2.7% (9296/9544)M queue_delay: 4.3 ms&lt;br /&gt;
        finish: 0:04:39 speed: 34,040 (1,984) want: 35,840 K/sec&lt;br /&gt;
 1: cs:PausedSyncT ro:Primary/Primary ds:Inconsistent/UpToDate C r-p--&lt;br /&gt;
    ns:0 nr:13184 dw:13184 dr:0 al:0 bm:0 lo:0 pe:0 ua:0 ap:0 ep:1 wo:b oos:97650932&lt;br /&gt;
 2: cs:PausedSyncT ro:Primary/Primary ds:Inconsistent/UpToDate C r-p--&lt;br /&gt;
    ns:0 nr:12192 dw:12192 dr:0 al:0 bm:0 lo:0 pe:0 ua:0 ap:0 ep:1 wo:b oos:97651924&lt;br /&gt;
 3: cs:PausedSyncT ro:Primary/Primary ds:Inconsistent/UpToDate C r-p--&lt;br /&gt;
    ns:0 nr:30656 dw:30656 dr:0 al:0 bm:1 lo:0 pe:0 ua:0 ap:0 ep:1 wo:b oos:257812684&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{note|1=The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;want: 35,840 K/sec&amp;lt;/span&amp;gt; will not show up on the node that you increased the sync rate on. Also note that it will occasionally show &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;want: 0 K/sec&amp;lt;/span&amp;gt;. So long as the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;oos:x&amp;lt;/span&amp;gt; (out of sync blocks) value keeps dropping and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;speed&amp;lt;/span&amp;gt; is still reasonable, the sync is fine.}}&lt;br /&gt;
&lt;br /&gt;
After a period of time, you will see the synchronization finish and the resource will then be in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;UpToDate/UpToDate&amp;lt;/span&amp;gt; state. We&#039;ll now tell DRBD to restore the defined sync rate of 15 MiB/sec, resume synchronization of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;r1&amp;lt;/span&amp;gt; and increase the sync rate of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;r1&amp;lt;/span&amp;gt; to 35 MiB/sec.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
drbdadm syncer r0&lt;br /&gt;
drbdadm resume-sync r1&lt;br /&gt;
drbdsetup /dev/drbd1 syncer -r 35M&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
version: 8.3.8 (api:88/proto:86-94)&lt;br /&gt;
GIT-hash: d78846e52224fd00562f7c225bcc25b2d422321d build by mockbuild@builder10.centos.org, 2010-06-04 08:04:27&lt;br /&gt;
 0: cs:Connected ro:Primary/Primary ds:UpToDate/UpToDate C r----&lt;br /&gt;
    ns:0 nr:9775184 dw:9775184 dr:0 al:0 bm:597 lo:0 pe:0 ua:0 ap:0 ep:1 wo:b oos:0&lt;br /&gt;
 1: cs:SyncTarget ro:Primary/Primary ds:Inconsistent/UpToDate C r----&lt;br /&gt;
    ns:0 nr:851872 dw:851872 dr:0 al:0 bm:51 lo:0 pe:0 ua:0 ap:0 ep:1 wo:b oos:96812244&lt;br /&gt;
        [&amp;gt;....................] sync&#039;ed:  0.9% (94540/95372)M queue_delay: 0.0 ms&lt;br /&gt;
        finish: 0:24:54 speed: 64,480 (11,508) want: 35,840 K/sec&lt;br /&gt;
 2: cs:PausedSyncT ro:Primary/Primary ds:Inconsistent/UpToDate C r-p--&lt;br /&gt;
    ns:0 nr:12192 dw:12192 dr:0 al:0 bm:0 lo:0 pe:0 ua:0 ap:0 ep:1 wo:b oos:97651924&lt;br /&gt;
 3: cs:PausedSyncT ro:Primary/Primary ds:Inconsistent/UpToDate C r-p--&lt;br /&gt;
    ns:0 nr:30656 dw:30656 dr:0 al:0 bm:1 lo:0 pe:0 ua:0 ap:0 ep:1 wo:b oos:257812684&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As before, once &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;r1&amp;lt;/span&amp;gt; is finished syncing, we&#039;ll restore the defined sync rate, resume sync on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;r2&amp;lt;/span&amp;gt; and push the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;r2&amp;lt;/span&amp;gt; sync rate up. Finally, we&#039;ll do the same to the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;r3&amp;lt;/span&amp;gt; resource. Once the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;r3&amp;lt;/span&amp;gt; resource is synced, we&#039;ll restore it&#039;s sync rate and we&#039;ll be finished syncing all of the resources.&lt;br /&gt;
&lt;br /&gt;
Once all resources are synchronized, you should see this on both nodes:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
version: 8.3.8 (api:88/proto:86-94)&lt;br /&gt;
GIT-hash: d78846e52224fd00562f7c225bcc25b2d422321d build by mockbuild@builder10.centos.org, 2010-06-04 08:04:27&lt;br /&gt;
 0: cs:Connected ro:Primary/Primary ds:UpToDate/UpToDate C r----&lt;br /&gt;
    ns:9775184 nr:0 dw:0 dr:9775184 al:0 bm:597 lo:0 pe:0 ua:0 ap:0 ep:1 wo:b oos:0&lt;br /&gt;
 1: cs:Connected ro:Primary/Primary ds:UpToDate/UpToDate C r----&lt;br /&gt;
    ns:97664116 nr:0 dw:0 dr:97664116 al:0 bm:5961 lo:0 pe:0 ua:0 ap:0 ep:1 wo:b oos:0&lt;br /&gt;
 2: cs:Connected ro:Primary/Primary ds:UpToDate/UpToDate C r----&lt;br /&gt;
    ns:97664116 nr:0 dw:0 dr:97664116 al:0 bm:5961 lo:0 pe:0 ua:0 ap:0 ep:1 wo:b oos:0&lt;br /&gt;
 3: cs:Connected ro:Primary/Primary ds:UpToDate/UpToDate C r----&lt;br /&gt;
    ns:257843340 nr:0 dw:0 dr:257843340 al:0 bm:15738 lo:0 pe:0 ua:0 ap:0 ep:1 wo:b oos:0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
That&#039;s it, your resource is ready for use! You do not need to wait for the sync to complete before proceeding. However, ensure that the sync is complete before bringing up VMs on the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Inconsistent&amp;lt;/span&amp;gt; side.&lt;br /&gt;
&lt;br /&gt;
{{note|1=For the rest of the tutorial, we will be ignoring &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;r3&amp;lt;/span&amp;gt; as it&#039;s just a bank of spare disk space.}}&lt;br /&gt;
&lt;br /&gt;
==== Overdoing It ====&lt;br /&gt;
&lt;br /&gt;
If you try to sync too many resources at one or if you set the sync rate too high, you may find that one or more of the resources &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;want: 0 K/sec&amp;lt;/span&amp;gt;. This is a sign that the disks are being hit too hard, and you need to back off the sync rate or flat out pause the synchronization of some resources until the other ones have finished.&lt;br /&gt;
&lt;br /&gt;
{{note|1=In some cases, pushing DRBD too hard may cause synchronization to stall entirely. If this happens, you can try to pause, then resume the sync. If that doesn&#039;t fix it, try changing the sync speed down to a lower speed (see the next section), then pause and resume. If it is still stalling, run &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/init.d/drbd stop&amp;lt;/span&amp;gt; on both nodes, then &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/init.d/drbd start&amp;lt;/span&amp;gt;, pause all but one resource and then set the sync speed on the last resource. Start with a low value and work your way up until you find the maximum stable sync speed for your configuration.}}&lt;br /&gt;
&lt;br /&gt;
==== A Note on Synchronization Speeds ====&lt;br /&gt;
&lt;br /&gt;
As discussed earlier while configuring &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/drbd.conf&amp;lt;/span&amp;gt;, we do not want to have the sync rate set too high. However, if you know that your the disk(s) backing your DRBD resource will not be in use for a while, then you can temporarily drive up the sync rate as we saw above. This can also be used in reverse. If you expect periods of high disk I/O, you can use this same command to temporarily throttle synchronization.&lt;br /&gt;
&lt;br /&gt;
The command to raise the sync rate is below. Note that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;drbdsetup /dev/drbdX&amp;lt;/span&amp;gt; is used here.&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 40M&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To restore it back to the rate set in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/drbd.conf&amp;lt;/span&amp;gt;, run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&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 Clustered LVM ==&lt;br /&gt;
&lt;br /&gt;
This step will have us create three [[LVM]] physical volumes, one for each of the allocated DRBD resources, and then creating three separate volume groups. At this stage, the only logical volume we will create will be for the [[GFS2]] partition. The rest of the LVs will be created later when we provision virtual machines.&lt;br /&gt;
&lt;br /&gt;
=== Modifying /etc/lvm/lvm.conf ===&lt;br /&gt;
&lt;br /&gt;
There are four main things we&#039;re going to change in the LVM configuration file.&lt;br /&gt;
* Change the filter to only see &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/drbd*&amp;lt;/span&amp;gt; devices. Otherwise LVM will see signatures on the DRBD resource and the backing &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/sd*&amp;lt;/span&amp;gt; devices which will cause confusion.&lt;br /&gt;
* Change the locking type to clustered locking.&lt;br /&gt;
* Disable clustered locking from falling back to local locking.&lt;br /&gt;
* We&#039;ll be identifying our clustered VGs and LVs using LVM tags. This tag will be defined using the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;volume_list&amp;lt;/span&amp;gt; variable.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/lvm/lvm.conf /etc/lvm/lvm.conf.orig&lt;br /&gt;
vim /etc/lvm/lvm.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The first step is trivial. Simple alter &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;locking_type = 1&amp;lt;/span&amp;gt; to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;locking_type = 3&amp;lt;/span&amp;gt;.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
    # Type of locking to use. Defaults to local file-based locking (1).&lt;br /&gt;
    # Turn locking off by setting to 0 (dangerous: risks metadata corruption&lt;br /&gt;
    # if LVM2 commands get run concurrently).&lt;br /&gt;
    # Type 2 uses the external shared library locking_library.&lt;br /&gt;
    # Type 3 uses built-in clustered locking.&lt;br /&gt;
    # Type 4 uses read-only locking which forbids any operations that might &lt;br /&gt;
    # change metadata.&lt;br /&gt;
    locking_type = 3&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Next, restrict the filtering so that it only sees the DRBD resources. This is done by changing the filter variable from &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;filter = [ &amp;quot;a/.*/&amp;quot; ]&amp;lt;/span&amp;gt; to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;filter = [ &amp;quot;a|/dev/drbd*|&amp;quot;, &amp;quot;r/.*/&amp;quot; ]&amp;lt;/span&amp;gt;. What this does is tell LVM to &#039;&#039;&#039;a&#039;&#039;&#039;ccept devices matching &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/drbd*&amp;lt;/span&amp;gt; and to &#039;&#039;&#039;r&#039;&#039;&#039;eject all other devices.&lt;br /&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|/dev/drbd*|&amp;quot;, &amp;quot;r/.*/&amp;quot; ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now, we&#039;ll disable falling back to local locking. The reasoning being that if the cluster lock manager [[DLM]] is not available, then we don&#039;t want to touch the storage at all. This is done by changing &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fallback_to_local_locking&amp;lt;/span&amp;gt; from &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt; to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;0&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;
    # If an attempt to initialise type 2 or type 3 locking failed, perhaps&lt;br /&gt;
    # because cluster components such as clvmd are not running, with this set&lt;br /&gt;
    # to 1 an attempt will be made to use local file-based locking (type 1).&lt;br /&gt;
    # If this succeeds, only commands against local volume groups will proceed.&lt;br /&gt;
    # Volume Groups marked as clustered will be ignored.&lt;br /&gt;
    fallback_to_local_locking = 0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Finally, tell LVM to use volumes with our tags by setting &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;volume_list&amp;lt;/span&amp;gt; to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[&amp;quot;@an-cluster01&amp;quot;]&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;
    # If volume_list is defined, each LV is only activated if there is a&lt;br /&gt;
    # match against the list.&lt;br /&gt;
    #   &amp;quot;vgname&amp;quot; and &amp;quot;vgname/lvname&amp;quot; are matched exactly.&lt;br /&gt;
    #   &amp;quot;@tag&amp;quot; matches any tag set in the LV or VG.&lt;br /&gt;
    #   &amp;quot;@*&amp;quot; matches if any tag defined on the host is also set in the LV or VG&lt;br /&gt;
    #&lt;br /&gt;
    # volume_list = [ &amp;quot;vg1&amp;quot;, &amp;quot;vg2/lvol1&amp;quot;, &amp;quot;@tag1&amp;quot;, &amp;quot;@*&amp;quot; ]&lt;br /&gt;
    volume_list = [&amp;quot;@an-cluster01&amp;quot;]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Save the file. With these chages, the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;diff&amp;lt;/span&amp;gt; should look like what is shown below.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
diff -u /etc/lvm/lvm.conf.orig /etc/lvm/lvm.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;diff&amp;quot;&amp;gt;&lt;br /&gt;
--- /etc/lvm/lvm.conf.orig	2011-05-06 15:30:43.000000000 -0400&lt;br /&gt;
+++ /etc/lvm/lvm.conf	2011-05-06 15:34:49.000000000 -0400&lt;br /&gt;
@@ -50,7 +50,8 @@&lt;br /&gt;
 &lt;br /&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/.*/&amp;quot; ]&lt;br /&gt;
+    filter = [ &amp;quot;a|/dev/drbd*|&amp;quot;, &amp;quot;r/.*/&amp;quot; ]&lt;br /&gt;
 &lt;br /&gt;
     # Exclude the cdrom drive&lt;br /&gt;
     # filter = [ &amp;quot;r|/dev/cdrom|&amp;quot; ]&lt;br /&gt;
@@ -289,7 +290,8 @@&lt;br /&gt;
     # Type 3 uses built-in clustered locking.&lt;br /&gt;
     # Type 4 uses read-only locking which forbids any operations that might &lt;br /&gt;
     # change metadata.&lt;br /&gt;
-    locking_type = 1&lt;br /&gt;
+    #locking_type = 1&lt;br /&gt;
+    locking_type = 3&lt;br /&gt;
 &lt;br /&gt;
     # Set to 0 to fail when a lock request cannot be satisfied immediately.&lt;br /&gt;
     wait_for_locks = 1&lt;br /&gt;
@@ -305,7 +307,8 @@&lt;br /&gt;
     # to 1 an attempt will be made to use local file-based locking (type 1).&lt;br /&gt;
     # If this succeeds, only commands against local volume groups will proceed.&lt;br /&gt;
     # Volume Groups marked as clustered will be ignored.&lt;br /&gt;
-    fallback_to_local_locking = 1&lt;br /&gt;
+    #fallback_to_local_locking = 1&lt;br /&gt;
+    fallback_to_local_locking = 0&lt;br /&gt;
 &lt;br /&gt;
     # Local non-LV directory that holds file-based locks while commands are&lt;br /&gt;
     # in progress.  A directory like /tmp that may get wiped on reboot is OK.&lt;br /&gt;
@@ -378,6 +381,7 @@&lt;br /&gt;
     #   &amp;quot;@*&amp;quot; matches if any tag defined on the host is also set in the LV or VG&lt;br /&gt;
     #&lt;br /&gt;
     # volume_list = [ &amp;quot;vg1&amp;quot;, &amp;quot;vg2/lvol1&amp;quot;, &amp;quot;@tag1&amp;quot;, &amp;quot;@*&amp;quot; ]&lt;br /&gt;
+    volume_list = [&amp;quot;@an-cluster01&amp;quot;]&lt;br /&gt;
 &lt;br /&gt;
     # Size (in KB) of each copy operation when mirroring&lt;br /&gt;
     mirror_region_size = 512&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now copy the changed file to the second node.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
rsync -av /etc/lvm/lvm.conf root@an-node05:/etc/lvm/&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
building file list ... done&lt;br /&gt;
lvm.conf&lt;br /&gt;
&lt;br /&gt;
sent 3153 bytes  received 234 bytes  6774.00 bytes/sec&lt;br /&gt;
total size is 22459  speedup is 6.63&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You&#039;re done. Normally we&#039;d want to tell LVM to rescan for PVs, VGs and LVs but at this stage there are none.&lt;br /&gt;
&lt;br /&gt;
=== Starting the clvmd Daemon ===&lt;br /&gt;
&lt;br /&gt;
Before we proceed, we need to start the clustered LVM daemon, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clvmd&amp;lt;/span&amp;gt;. This requires that the cluster is already running. So if you stopped the cluster, start it on both nodes before starting &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clvmd&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;
cman_tool 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;
Version: 6.2.0&lt;br /&gt;
Config Version: 9&lt;br /&gt;
Cluster Name: an-cluster01&lt;br /&gt;
Cluster Id: 60257&lt;br /&gt;
Cluster Member: Yes&lt;br /&gt;
Cluster Generation: 120&lt;br /&gt;
Membership state: Cluster-Member&lt;br /&gt;
Nodes: 2&lt;br /&gt;
Expected votes: 1&lt;br /&gt;
Total votes: 2&lt;br /&gt;
Quorum: 1  &lt;br /&gt;
Active subsystems: 7&lt;br /&gt;
Flags: 2node Dirty &lt;br /&gt;
Ports Bound: 0  &lt;br /&gt;
Node name: an-node04.alteeve.com&lt;br /&gt;
Node ID: 1&lt;br /&gt;
Multicast addresses: 239.192.235.77 &lt;br /&gt;
Node addresses: 192.168.3.74 &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{note|1=The version incremented after the last example when I edited the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cluster.conf&amp;lt;/span&amp;gt; to have my real passwords.}}&lt;br /&gt;
&lt;br /&gt;
So now we see that the cluster is up on both nodes (&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Nodes: 2&amp;lt;/span&amp;gt;), so we can start the clustered LVM daemon.&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;
Starting clvmd: &lt;br /&gt;
Activating VG(s):   No volume groups found&lt;br /&gt;
                                                           [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{note|1=At this stage, the cluster does not start at boot, so we can&#039;t start &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clvmd&amp;lt;/span&amp;gt; at boot yet, either. We&#039;ll do this at the end of the tutorial, so for now, disable &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clvmd&amp;lt;/span&amp;gt; and start it manually after starting &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt; when you first start your cluster.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
chkconfig clvmd off&lt;br /&gt;
chkconfig --list 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;
clvmd          	0:off	1:off	2:off	3:off	4:off	5:off	6:off&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Turning Our DRBD Resources Into LVM Physical Volumes ===&lt;br /&gt;
&lt;br /&gt;
{{note|1=Now that DRBD is in use, commands will only need to be executed on one node and the changes should be immediately seen on the second node.}}&lt;br /&gt;
&lt;br /&gt;
Creating LVM physical volumes is a trivial task. Simply run &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;pvcreate /dev/drbdX&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On One Node&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
pvcreate /dev/drbd{0,1,2}&lt;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;
  Physical volume &amp;quot;/dev/drbd1&amp;quot; successfully created&lt;br /&gt;
  Physical volume &amp;quot;/dev/drbd2&amp;quot; successfully created&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On The Other Node&#039;&#039;&#039;:&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;9.32 GB&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               9.32 GB&lt;br /&gt;
  Allocatable           NO&lt;br /&gt;
  PE Size (KByte)       0&lt;br /&gt;
  Total PE              0&lt;br /&gt;
  Free PE               0&lt;br /&gt;
  Allocated PE          0&lt;br /&gt;
  PV UUID               WxTCW4-lUzL-bR53-km45-13eV-3f8B-ZA5Tb9&lt;br /&gt;
   &lt;br /&gt;
  &amp;quot;/dev/drbd1&amp;quot; is a new physical volume of &amp;quot;93.14 GB&amp;quot;&lt;br /&gt;
  --- NEW Physical volume ---&lt;br /&gt;
  PV Name               /dev/drbd1&lt;br /&gt;
  VG Name               &lt;br /&gt;
  PV Size               93.14 GB&lt;br /&gt;
  Allocatable           NO&lt;br /&gt;
  PE Size (KByte)       0&lt;br /&gt;
  Total PE              0&lt;br /&gt;
  Free PE               0&lt;br /&gt;
  Allocated PE          0&lt;br /&gt;
  PV UUID               zrwlxT-VFA4-5NiK-fwbK-z2Ez-mYxu-Ei8yZs&lt;br /&gt;
   &lt;br /&gt;
  &amp;quot;/dev/drbd2&amp;quot; is a new physical volume of &amp;quot;93.14 GB&amp;quot;&lt;br /&gt;
  --- NEW Physical volume ---&lt;br /&gt;
  PV Name               /dev/drbd2&lt;br /&gt;
  VG Name               &lt;br /&gt;
  PV Size               93.14 GB&lt;br /&gt;
  Allocatable           NO&lt;br /&gt;
  PE Size (KByte)       0&lt;br /&gt;
  Total PE              0&lt;br /&gt;
  Free PE               0&lt;br /&gt;
  Allocated PE          0&lt;br /&gt;
  PV UUID               6d4e5P-pjHE-4axT-ZRyG-lJa7-8oLa-TjkZFy&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Before proceeding, be sure to have LVM rescan for the new [[PV]]s so that it&#039;s cache is up to date. This isn&#039;t strictly needed, but I find it a useful habit to get into.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On both nodes&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
pvscan&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
  PV /dev/drbd0                      lvm2 [9.32 GB]&lt;br /&gt;
  PV /dev/drbd1                      lvm2 [93.14 GB]&lt;br /&gt;
  PV /dev/drbd2                      lvm2 [93.14 GB]&lt;br /&gt;
  Total: 3 [195.60 GB] / in use: 0 [0   ] / in no VG: 3 [195.60 GB]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{note|1=There is nothing showing in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;VG Name&amp;lt;/span&amp;gt; yet, as we&#039;ve not created any [[VG]]s. Re-run &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;pvdisplay&amp;lt;/span&amp;gt; after the VGs are created and you will see them show up. Be aware that a [[PV]] can only belong to one [[VG]] at a time.}}&lt;br /&gt;
&lt;br /&gt;
=== Creating Volume Groups ===&lt;br /&gt;
&lt;br /&gt;
LVM allows for a given VG to have multiple PVs assigned to it. In our case though, each PV has a specific purpose so we will be creating three independent VGs.&lt;br /&gt;
&lt;br /&gt;
Creating VGs is somewhat less trivial compared to creating the PVs. There are a few extra bits that need to be specified when the volume groups are created. The extra bits are:&lt;br /&gt;
* We will explicitly tell LVM that these are clustered VGs via &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;-c y&amp;lt;/span&amp;gt; (&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--clustered yes&amp;lt;/span&amp;gt;).&lt;br /&gt;
* We will create a tag that we will use to identify all clustered VGs. The tag I use is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-cluster01&amp;lt;/span&amp;gt;, thought you are free to use something else. This is applied via &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--addtag @an-cluster01&amp;lt;/span&amp;gt;&lt;br /&gt;
* Each VG needs a unique name which will become part of the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/vg_name/lv_name&amp;lt;/span&amp;gt; path. The name you choose should make sense to you. The names used in this tutorial are shown in the table below.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!VG name&lt;br /&gt;
!PV used&lt;br /&gt;
!Note&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;drbd_sh0_vg0&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/drbd0&amp;lt;/span&amp;gt;&lt;br /&gt;
|This will be used for the shared VG hosting the lone logical volume which we will create the [[GFS2]] partition on.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;drbd_an4_vg0&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/drbd1&amp;lt;/span&amp;gt;&lt;br /&gt;
|This VG will host the LVs backing the virtual machines designed to normally operate on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt;.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;drbd_an5_vg0&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/drbd2&amp;lt;/span&amp;gt;&lt;br /&gt;
|This VG will host the LVs backing the virtual machines designed to normally operate on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
So then, the commands to create these VGs will be as follows.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On One Node&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vgcreate -c y --addtag @an-cluster01 drbd_sh0_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;drbd_sh0_vg0&amp;quot; successfully created&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;
vgcreate -c y --addtag @an-cluster01 drbd_an4_vg0 /dev/drbd1&lt;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;drbd_an4_vg0&amp;quot; successfully created&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;
vgcreate -c y --addtag @an-cluster01 drbd_an5_vg0 /dev/drbd2&lt;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;drbd_an5_vg0&amp;quot; successfully created&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On The Other Node&#039;&#039;&#039;: You can verify that the VGs are visible on the second node with &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 -v&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
    Finding all volume groups&lt;br /&gt;
    Finding volume group &amp;quot;drbd_an5_vg0&amp;quot;&lt;br /&gt;
  --- Volume group ---&lt;br /&gt;
  VG Name               drbd_an5_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               93.14 GB&lt;br /&gt;
  PE Size               4.00 MB&lt;br /&gt;
  Total PE              23843&lt;br /&gt;
  Alloc PE / Size       0 / 0   &lt;br /&gt;
  Free  PE / Size       23843 / 93.14 GB&lt;br /&gt;
  VG UUID               kqhxfN-6VaV-TXlL-SYPP-4k2F-li70-rOg2wK&lt;br /&gt;
   &lt;br /&gt;
  --- Physical volumes ---&lt;br /&gt;
  PV Name               /dev/drbd2     &lt;br /&gt;
  PV UUID               6d4e5P-pjHE-4axT-ZRyG-lJa7-8oLa-TjkZFy&lt;br /&gt;
  PV Status             allocatable&lt;br /&gt;
  Total PE / Free PE    23843 / 23843&lt;br /&gt;
   &lt;br /&gt;
    Finding volume group &amp;quot;drbd_an4_vg0&amp;quot;&lt;br /&gt;
  --- Volume group ---&lt;br /&gt;
  VG Name               drbd_an4_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               93.14 GB&lt;br /&gt;
  PE Size               4.00 MB&lt;br /&gt;
  Total PE              23843&lt;br /&gt;
  Alloc PE / Size       0 / 0   &lt;br /&gt;
  Free  PE / Size       23843 / 93.14 GB&lt;br /&gt;
  VG UUID               9WBngc-SvVq-VVBd-csag-I0JP-DqLj-xV3fUf&lt;br /&gt;
   &lt;br /&gt;
  --- Physical volumes ---&lt;br /&gt;
  PV Name               /dev/drbd1     &lt;br /&gt;
  PV UUID               zrwlxT-VFA4-5NiK-fwbK-z2Ez-mYxu-Ei8yZs&lt;br /&gt;
  PV Status             allocatable&lt;br /&gt;
  Total PE / Free PE    23843 / 23843&lt;br /&gt;
   &lt;br /&gt;
    Finding volume group &amp;quot;drbd_sh0_vg0&amp;quot;&lt;br /&gt;
  --- Volume group ---&lt;br /&gt;
  VG Name               drbd_sh0_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               9.32 GB&lt;br /&gt;
  PE Size               4.00 MB&lt;br /&gt;
  Total PE              2386&lt;br /&gt;
  Alloc PE / Size       0 / 0   &lt;br /&gt;
  Free  PE / Size       2386 / 9.32 GB&lt;br /&gt;
  VG UUID               h6xZz8-G3J2-fkBF-1ZOD-DgkR-X0f4-9qaYI3&lt;br /&gt;
   &lt;br /&gt;
  --- Physical volumes ---&lt;br /&gt;
  PV Name               /dev/drbd0     &lt;br /&gt;
  PV UUID               WxTCW4-lUzL-bR53-km45-13eV-3f8B-ZA5Tb9&lt;br /&gt;
  PV Status             allocatable&lt;br /&gt;
  Total PE / Free PE    2386 / 2386&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;tag&amp;lt;/span&amp;gt; we assigned isn&#039;t displayed, this is ok. You can see the tags using a special incantation of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vgs&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;
vgs -o vg_name,vg_tags&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
  VG           VG Tags     &lt;br /&gt;
  drbd_an4_vg0 an-cluster01&lt;br /&gt;
  drbd_an5_vg0 an-cluster01&lt;br /&gt;
  drbd_sh0_vg0 an-cluster01&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It may not be pretty, but at least you can confirm that the tags exist as expected. Where tags are used will be discussed later in the trouble-shooting section.&lt;br /&gt;
&lt;br /&gt;
Before proceeding, be sure to have LVM rescan for the new [[VG]]s so that it&#039;s cache is up to date.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On both nodes&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vgscan&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
  Reading all physical volumes.  This may take a while...&lt;br /&gt;
  Found volume group &amp;quot;drbd_an5_vg0&amp;quot; using metadata type lvm2&lt;br /&gt;
  Found volume group &amp;quot;drbd_an4_vg0&amp;quot; using metadata type lvm2&lt;br /&gt;
  Found volume group &amp;quot;drbd_sh0_vg0&amp;quot; using metadata type lvm2&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Creating a Logical Volume ===&lt;br /&gt;
&lt;br /&gt;
At this point, we&#039;re only going to create a logical volume on the shared VG. This one LV will use all of the space available in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;drbd_sh0_vg0&amp;lt;/span&amp;gt; volume group. As with the VGs, we&#039;ll be assigning the same tag to our LV. We will also need to assign a name to the LV which will form the last part of the device path, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/vg_name/lv_name&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
When creating LVs, you can specify the size of the new LV in a few ways. The two way I prefer are &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;-L xxG&amp;lt;/span&amp;gt;, where &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xx&amp;lt;/span&amp;gt; is the number of [[GiB]] to make the LV. Alternatively, I like to use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;-l 100%FREE&amp;lt;/span&amp;gt; when I am creating the last partition on the VG (or the only one, as in this case). Which you use is entirely up to you.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On One Node&#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 100%FREE --addtag @an-cluster01 -n xen_shared drbd_sh0_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;On The Other Node&#039;&#039;&#039;:&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/drbd_sh0_vg0/xen_shared&lt;br /&gt;
  VG Name                drbd_sh0_vg0&lt;br /&gt;
  LV UUID                6bngyf-RSGG-17pA-g2fn-wwM3-6xsc-8yBAI5&lt;br /&gt;
  LV Write Access        read/write&lt;br /&gt;
  LV Status              available&lt;br /&gt;
  # open                 0&lt;br /&gt;
  LV Size                9.32 GB&lt;br /&gt;
  Current LE             2386&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;
As always, before proceeding, be sure to have LVM rescan for the new [[LV]]s so that it&#039;s cache is up to date.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
lvscan&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
  ACTIVE            &#039;/dev/drbd_sh0_vg0/xen_shared&#039; [9.32 GB] inherit&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As with VGs, we can confirm that the tag was set using a similar call to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;lvs&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;
lvs -o vg_name,lv_name,lv_tags&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
  VG           LV         LV Tags     &lt;br /&gt;
  drbd_sh0_vg0 xen_shared an-cluster01&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
That&#039;s it. Our clustered LVM is setup!&lt;br /&gt;
&lt;br /&gt;
== Setting Up The Shared GFS2 Partition ==&lt;br /&gt;
&lt;br /&gt;
Setting up a [[GFS2]] partition requires three steps;&lt;br /&gt;
* Formatting the block device, a logical volume in our case, using the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;mkfs.gfs2&amp;lt;/span&amp;gt; tool.&lt;br /&gt;
* Create a mount point on each node.&lt;br /&gt;
* Add an entry 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;
As mentioned earlier, we&#039;ll create a small 10 [[GB]] [[GFS2]] partition that will hold common files for the cluster. The most notable being the virtual machine definition files. These need to be centralized so that one node can restore a VM lost on another node during a failure state. It&#039;s also a decent place for things like ISOs if you&#039;re not using a [[PXE]] server of if you want to make generic VM images available. Though if you plan to do that, you will probably want a larger GFS2 partition than we are using here.&lt;br /&gt;
&lt;br /&gt;
The information you need to have on hand when formatting a [[GFS2]] partition is:&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Variable&lt;br /&gt;
!Value&lt;br /&gt;
!Note&lt;br /&gt;
|-&lt;br /&gt;
!Locking protocol&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;lock_dlm&amp;lt;/span&amp;gt;&lt;br /&gt;
|This is always &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;lock_dlm&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Journals&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;2&amp;lt;/span&amp;gt;&lt;br /&gt;
|This matches the number of nodes in the cluster.&lt;br /&gt;
|-&lt;br /&gt;
!Cluster Name&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-cluster01&amp;lt;/span&amp;gt;&lt;br /&gt;
|As set in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/cluster/cluster.conf&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Partition Name&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xen_shared&amp;lt;/span&amp;gt;&lt;br /&gt;
|Arbitrary name&lt;br /&gt;
|-&lt;br /&gt;
!Backing Device&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/drbd_sh0_vg0/xen_shared&amp;lt;/span&amp;gt;&lt;br /&gt;
|The LV we created earlier&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Putting it all together, the command becomes:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On One Node&#039;&#039;&#039;:&lt;br /&gt;
&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-cluster01:xen_shared /dev/drbd_sh0_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/drbd_sh0_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;
Are you sure you want to proceed? [y/n] y&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{note|1=It can take a bit of time for this to complete, please be patient.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Device:                    /dev/drbd_sh0_vg0/xen_shared&lt;br /&gt;
Blocksize:                 4096&lt;br /&gt;
Device Size                9.32 GB (2443264 blocks)&lt;br /&gt;
Filesystem Size:           9.32 GB (2443261 blocks)&lt;br /&gt;
Journals:                  2&lt;br /&gt;
Resource Groups:           38&lt;br /&gt;
Locking Protocol:          &amp;quot;lock_dlm&amp;quot;&lt;br /&gt;
Lock Table:                &amp;quot;an-cluster01:xen_shared&amp;quot;&lt;br /&gt;
UUID:                      764772BC-B292-1BBF-F987-AD3A2540849B&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now confirm that the partition is visible from the other node.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On The Other Node&#039;&#039;&#039;: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
gfs2_edit -p sb /dev/drbd_sh0_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;
Block #16    (0x10) of 2443264 (0x254800) (superblock)&lt;br /&gt;
&lt;br /&gt;
Superblock:&lt;br /&gt;
  mh_magic              0x01161970(hex)&lt;br /&gt;
  mh_type               1                   0x1&lt;br /&gt;
  mh_format             100                 0x64&lt;br /&gt;
  sb_fs_format          1801                0x709&lt;br /&gt;
  sb_multihost_format   1900                0x76c&lt;br /&gt;
  sb_bsize              4096                0x1000&lt;br /&gt;
  sb_bsize_shift        12                  0xc&lt;br /&gt;
  master dir:           2                   0x2&lt;br /&gt;
        addr:           22                  0x16&lt;br /&gt;
  root dir  :           1                   0x1&lt;br /&gt;
        addr:           21                  0x15&lt;br /&gt;
  sb_lockproto          lock_dlm&lt;br /&gt;
  sb_locktable          an-cluster01:xen_shared&lt;br /&gt;
  sb_uuid               764772BC-B292-1BBF-F987-AD3A2540849B&lt;br /&gt;
&lt;br /&gt;
The superblock has 2 directories&lt;br /&gt;
     1. (1). 21 (0x15): Dir     root&lt;br /&gt;
     2. (2). 22 (0x16): Dir     master&lt;br /&gt;
------------------------------------------------------&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With that, the GFS2 partition is ready for use.&lt;br /&gt;
&lt;br /&gt;
Now we need to create the mount point. The mount point you use is up to you. This tutorial will create a mount point called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/xen_shared&amp;lt;/span&amp;gt;. Once that&#039;s created, we&#039;ll actually mount the GFS2 partition. Finally, we&#039;ll use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;df&amp;lt;/span&amp;gt; to verify that it mounted successfully.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On Both Nodes&#039;&#039;&#039;:&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/drbd_sh0_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;
/dev/sda2              20G  2.9G   16G  16% /&lt;br /&gt;
/dev/sda1             244M   33M  198M  15% /boot&lt;br /&gt;
tmpfs                 1.8G     0  1.8G   0% /dev/shm&lt;br /&gt;
none                  1.8G  104K  1.8G   1% /var/lib/xenstored&lt;br /&gt;
/dev/mapper/drbd_sh0_vg0-xen_shared&lt;br /&gt;
                      9.4G  259M  9.1G   3% /xen_shared&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The last step is to add an entry to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/fstab&amp;lt;/span&amp;gt; for this GFS2 partition. This is required because the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/init.d/gfs2&amp;lt;/span&amp;gt; initialization script consults &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/fstab&amp;lt;/span&amp;gt; to see what partitions it is to manage.&lt;br /&gt;
&lt;br /&gt;
If you are familiar with GFS2 on [[EL6]], then you might be familiar with using the GFS2&#039;s [[UUID]] in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/fstab&amp;lt;/span&amp;gt;. That is not supported here on [[EL5]].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On both nodes&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/fstab /etc/fstab.orig&lt;br /&gt;
echo &amp;quot;/dev/drbd_sh0_vg0/xen_shared /xen_shared gfs2 rw,suid,dev,exec,nouser,async 0 0&amp;quot; &amp;gt;&amp;gt; /etc/fstab&lt;br /&gt;
diff -u /etc/fstab.orig /etc/fstab&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;diff&amp;quot;&amp;gt;&lt;br /&gt;
--- /etc/fstab.orig     2011-05-06 18:56:50.000000000 -0400&lt;br /&gt;
+++ /etc/fstab  2011-05-06 18:56:50.000000000 -0400&lt;br /&gt;
@@ -5,3 +5,4 @@&lt;br /&gt;
 sysfs                   /sys                    sysfs   defaults        0 0&lt;br /&gt;
 proc                    /proc                   proc    defaults        0 0&lt;br /&gt;
 LABEL=SWAP-sda3         swap                    swap    defaults        0 0&lt;br /&gt;
+/dev/drbd_sh0_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;
{{note|1=The reason that we use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rw,suid,dev,exec,nouser,async&amp;lt;/span&amp;gt; instead of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;defaults&amp;lt;/span&amp;gt;. The key option we don&#039;t want to use is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;auto&amp;lt;/span&amp;gt;, which is implied with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;defaults&amp;lt;/span&amp;gt;. The reason for avoiding this is to prevent the system from trying to mount the GFS2 partition during boot. With the cluster not running that early in the boot process, the GFS2 partition will effectively not exist at that point, so any attempt to mount it will fail.}}&lt;br /&gt;
&lt;br /&gt;
Now, to verify that everything is working, call &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;status&amp;lt;/span&amp;gt; against the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;gfs2&amp;lt;/span&amp;gt; initialization script.&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 try &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;stop&amp;lt;/span&amp;gt;&#039;ing &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;gfs2&amp;lt;/span&amp;gt;, checking the mounts with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;df&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;status&amp;lt;/span&amp;gt;, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;start&amp;lt;/span&amp;gt;&#039;ing &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;gfs2&amp;lt;/span&amp;gt; back up and doing a final &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;df&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;status&amp;lt;/span&amp;gt;. If all works well, the GFS2 volume should unmount and remount.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On Both Nodes&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
Stop:&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 filesystems:                               [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check that it has been unmounted:&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;
&amp;lt;/source&amp;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/sda2              20G  2.9G   16G  16% /&lt;br /&gt;
/dev/sda1             244M   33M  198M  15% /boot&lt;br /&gt;
tmpfs                 1.8G     0  1.8G   0% /dev/shm&lt;br /&gt;
none                  1.8G  104K  1.8G   1% /var/lib/xenstored&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now start the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;gfs2&amp;lt;/span&amp;gt; service 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 filesystems:                                 [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check that it has been re-mounted:&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;
&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/sda2              20G  2.9G   16G  16% /&lt;br /&gt;
/dev/sda1             244M   33M  198M  15% /boot&lt;br /&gt;
tmpfs                 1.8G     0  1.8G   0% /dev/shm&lt;br /&gt;
none                  1.8G  104K  1.8G   1% /var/lib/xenstored&lt;br /&gt;
/dev/mapper/drbd_sh0_vg0-xen_shared&lt;br /&gt;
                      9.4G  259M  9.1G   3% /xen_shared&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Perfect!&lt;br /&gt;
&lt;br /&gt;
= Managing Storage In The Cluster =&lt;br /&gt;
&lt;br /&gt;
The storage for the cluster is ready, but it hasn&#039;t actually been tied &#039;&#039;into&#039;&#039; the cluster. To do that, we will use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt;, within which we will add the &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; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;gfs2&amp;lt;/span&amp;gt; initialization scripts as cluster resources. We will create two failover domains, each one containing only one node. lastly, we will take those three resources and create a service tree.&lt;br /&gt;
&lt;br /&gt;
== Covering Some New Terms ==&lt;br /&gt;
&lt;br /&gt;
Now, let&#039;s back up and talk a bit about those three new terms.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Resources&#039;&#039;&#039; are items that can be used in one or more services.&lt;br /&gt;
* &#039;&#039;&#039;Services&#039;&#039;&#039; consist of one or more resources, either in series, parallel or a combination of both, that are managed by the cluster.&lt;br /&gt;
* &#039;&#039;&#039;Failover Domains&#039;&#039;&#039; are logical groups of one or more nodes. Services can run strictly within a failover group, or they can be allowed to run outside of the failover domain when no member domains are available.&lt;br /&gt;
&lt;br /&gt;
== An Overview Of How We Will Manage Storage In The Cluster ==&lt;br /&gt;
&lt;br /&gt;
So what we are going to do here is:&lt;br /&gt;
* Create three &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;script&amp;lt;/span&amp;gt; resources&lt;br /&gt;
* Create two failover domains. One containing just &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04.alteeve.com&amp;lt;/span&amp;gt; and the other containing just &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05.alteeve.com&amp;lt;/span&amp;gt;. We will restrict services within these domains to only run within this domain, effectively locking the service to the node.&lt;br /&gt;
* Within each failover domain, we will create a service with a serial resource tree. This tree will start &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;drbd&amp;lt;/span&amp;gt;, then &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clvmd&amp;lt;/span&amp;gt; and finally &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;gfs2&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The reason for this is so that when &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; starts, it will start each failover domain&#039;s service which, in turn, will start the clustered storage daemons in the proper order.&lt;br /&gt;
&lt;br /&gt;
== Why Not Start The Daemons At Boot Time? ==&lt;br /&gt;
&lt;br /&gt;
This might seem like over kill, and arguably it is. The reason I still find it worth while is that if a storage daemon like [[DRBD]] hangs on boot, you can find yourself with a node that you can not access. Many folk have their nodes in data centers so gaining direct access can be a pain, to be polite. So by moving these daemons over to the cluster, and knowing that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; itself will start late in the boot process, we are much more likely to still have remote access when things go bad.&lt;br /&gt;
&lt;br /&gt;
I used DRBD as an example on purpose. I prefer to have DRBD resources wait forever to connect to the other node when starting up. This way, if one node starts somewhat later than the other, the first node&#039;s DRBD resource won&#039;t risk split-braining. it will happily wait until it&#039;s partner node comes up and starts it&#039;s own DRBD daemon. The downside to this is that DRBD will effectively hang the boot process forever if the other node can&#039;t be started. By managing DRBD in the cluster, we leave open the option of logging in and telling DRBD to stop waiting when we know the other node will not be booting.&lt;br /&gt;
&lt;br /&gt;
== Adding rgmanager To cluster.conf ==&lt;br /&gt;
&lt;br /&gt;
Everything related to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; is an element of the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;[[RHCS_v2_cluster.conf#rm.3B_The_Resource_Manager|rm]] /&amp;gt;&amp;lt;/span&amp;gt; tag. Within that, the actual resources are themselves elements of the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;resources /&amp;gt;&amp;lt;/span&amp;gt; tag. We&#039;ll start by creating these tags, then we&#039;ll look at the actual resources.&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-cluster01&amp;quot; config_version=&amp;quot;10&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;cman expected_votes=&amp;quot;1&amp;quot; two_node=&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-node04.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;fence_na01&amp;quot; port=&amp;quot;04&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-node05.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;fence_na01&amp;quot; port=&amp;quot;03&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_na01&amp;quot; agent=&amp;quot;fence_na&amp;quot; ipaddr=&amp;quot;fence_na01.alteeve.com&amp;quot; login=&amp;quot;admin&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;fence_daemon post_join_delay=&amp;quot;60&amp;quot;/&amp;gt;&lt;br /&gt;
        &amp;lt;totem rrp_mode=&amp;quot;none&amp;quot; secauth=&amp;quot;off&amp;quot;/&amp;gt;&lt;br /&gt;
        &amp;lt;rm&amp;gt;&lt;br /&gt;
                &amp;lt;resources/&amp;gt;&lt;br /&gt;
                &amp;lt;failoverdomains /&amp;gt;&lt;br /&gt;
        &amp;lt;/rm&amp;gt;&lt;br /&gt;
&amp;lt;/cluster&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There are several attributes available for the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rm&amp;lt;/span&amp;gt;, though we don&#039;t need to worry about them now as the defaults are sane. It&#039;s primary purpose is to act as a container for &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;failoverdomains /&amp;gt;&amp;lt;/span&amp;gt;, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;resources /&amp;gt;&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;service /&amp;gt;&amp;lt;/span&amp;gt; tags. We&#039;ll be working with all three of these now. We&#039;re not putting an empty &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;service /&amp;gt;&amp;lt;/span&amp;gt; tag in because they must contain and attribute, which we are not ready to do yet.&lt;br /&gt;
&lt;br /&gt;
=== Adding Resources to cluster.conf ===&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;resources&amp;lt;/span&amp;gt; tag has no attributes of it&#039;s own. It solely acts as a container for various resource tags. There are many types of resources, but we will only be using the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;script /&amp;gt;&amp;lt;/span&amp;gt; tag in this cluster.&lt;br /&gt;
&lt;br /&gt;
Let&#039;s look at the three scripts we&#039;re going to add; &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-cluster01&amp;quot; config_version=&amp;quot;11&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;cman expected_votes=&amp;quot;1&amp;quot; two_node=&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-node04.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;fence_na01&amp;quot; port=&amp;quot;04&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-node05.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;fence_na01&amp;quot; port=&amp;quot;03&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_na01&amp;quot; agent=&amp;quot;fence_na&amp;quot; ipaddr=&amp;quot;fence_na01.alteeve.com&amp;quot; login=&amp;quot;admin&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;fence_daemon post_join_delay=&amp;quot;60&amp;quot;/&amp;gt;&lt;br /&gt;
        &amp;lt;totem rrp_mode=&amp;quot;none&amp;quot; secauth=&amp;quot;off&amp;quot;/&amp;gt;&lt;br /&gt;
        &amp;lt;rm&amp;gt;&lt;br /&gt;
                &amp;lt;resources&amp;gt;&lt;br /&gt;
                        &amp;lt;script file=&amp;quot;/etc/init.d/drbd&amp;quot; name=&amp;quot;drbd&amp;quot;/&amp;gt;&lt;br /&gt;
                        &amp;lt;script file=&amp;quot;/etc/init.d/clvmd&amp;quot; name=&amp;quot;clvmd&amp;quot;/&amp;gt;&lt;br /&gt;
                        &amp;lt;script file=&amp;quot;/etc/init.d/gfs2&amp;quot; name=&amp;quot;gfs2&amp;quot;/&amp;gt;&lt;br /&gt;
                &amp;lt;/resources&amp;gt;&lt;br /&gt;
                &amp;lt;failoverdomains /&amp;gt;&lt;br /&gt;
        &amp;lt;/rm&amp;gt;&lt;br /&gt;
&amp;lt;/cluster&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The main two attributes used by &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;script /&amp;gt;&amp;lt;/span&amp;gt; are &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;file&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;name&amp;lt;/span&amp;gt;. The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;file&amp;lt;/span&amp;gt; attribute is the path to the script and the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;name&amp;lt;/span&amp;gt; will be used to reference this script when we create our &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;service /&amp;gt;&amp;lt;/span&amp;gt; resource tree later.&lt;br /&gt;
&lt;br /&gt;
{{note|1=Scripts must work like initialization scripts. That is, they need to support being called with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;start&amp;lt;/span&amp;gt;, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;stop&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;status&amp;lt;/span&amp;gt; arguments.}}&lt;br /&gt;
&lt;br /&gt;
=== Adding Failover Domains to cluster.conf ===&lt;br /&gt;
&lt;br /&gt;
Failover domains are, at their most basic, a collection of one or more nodes in the cluster. Services can then be configured to operate within the context of a given failover domain. There are a few key options to be aware of.&lt;br /&gt;
&lt;br /&gt;
* A failover domain can be unordered or prioritized.&lt;br /&gt;
** When unordered, a service will relocate to another random node in the domain.&lt;br /&gt;
** When prioritized, a service will relocate to the highest-priority node in the domain.&lt;br /&gt;
* A failover domain can be restricted or unrestricted.&lt;br /&gt;
** When restricted, a service is &#039;&#039;&#039;only&#039;&#039;&#039; allowed to relocate to nodes in the domain. When no nodes are available, a service is stopped.&lt;br /&gt;
** When unrestricted, a service will try to relocate to a node in the domain. However, when no domain members are available, a service attempts to start on another node in the cluster.&lt;br /&gt;
* A failover domain can have a failback policy.&lt;br /&gt;
** When a domain allows for failback and the domain is ordered, a service will migrate to the highest priority node in the domain. This allows for automated restoration of services on a failed node when it rejoins the cluster.&lt;br /&gt;
** When a domain does not allow for failback, but is unrestricted, failback of services that fell out of the domain will happen anyway. However, once the service is within the domain, the service will &#039;&#039;&#039;not&#039;&#039;&#039; relocate to a higher-priority node should one become available later.&lt;br /&gt;
** When a domain does not allow for failback and is restricted, then failback of services will never occur.&lt;br /&gt;
&lt;br /&gt;
What we are going to do now is create two restricted failover domains with no relocation. Each of these will contain just one of the nodes. This will effectively lock their services to the node. This way, services assigned to each domain will be started and maintained by the cluster, but they will &#039;&#039;&#039;not&#039;&#039;&#039; be highly available. The services we will create will have local initialization scripts, so this is perfectly fine. &lt;br /&gt;
&lt;br /&gt;
This is how we will get the cluster to start and maintain out clustered storage daemons.&lt;br /&gt;
&lt;br /&gt;
The format for defining failover domains is to create a &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;failoverdomains&amp;gt;&amp;lt;/span&amp;gt; tag, which has no attributes, and acts as a container for one or more &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;failoverdomain&amp;gt;&amp;lt;/span&amp;gt; tags. Each &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;failoverdomain&amp;gt;&amp;lt;/span&amp;gt; tag has four attributes and acts as a container for one or more &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;failoverdomainnode /&amp;gt;&amp;lt;/span&amp;gt; tags.&lt;br /&gt;
&lt;br /&gt;
The only required attribute in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;failoverdomain /&amp;gt;&amp;lt;/span&amp;gt; is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;name=&amp;quot;&amp;quot;&amp;lt;/span&amp;gt;. This is the name that will be used later when we want to bind a service to a given failover domain. By default, a failover domain is unordered, thus making failback meaningless, and it is unrestricted. When ordered, the default is to allow for failback.&lt;br /&gt;
&lt;br /&gt;
The individual &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;failoverdomainnode /&amp;gt;&amp;lt;/span&amp;gt; have two attributes; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;name&amp;lt;/span&amp;gt;, which must match the given node&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;clusternode name=&amp;quot;...&amp;quot;&amp;lt;/span&amp;gt;, and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;priority=&amp;quot;x&amp;quot;&amp;lt;/span&amp;gt;, where &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;x&amp;lt;/span&amp;gt; is an integer. when only one node is defined or when a failover domain in unordered, the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;priority&amp;lt;/span&amp;gt; is ignored. When two or more nodes are defined and the domain is ordered, then nodes with the lowest number has the highest priority for hosting services. That is, a node with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;priority=&amp;quot;1&amp;quot;&amp;lt;/span&amp;gt; will be preferred to a node with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;priority=&amp;quot;2&amp;quot;&amp;lt;/span&amp;gt;.&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-cluster01&amp;quot; config_version=&amp;quot;12&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;cman expected_votes=&amp;quot;1&amp;quot; two_node=&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-node04.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;fence_na01&amp;quot; port=&amp;quot;04&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-node05.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;fence_na01&amp;quot; port=&amp;quot;03&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_na01&amp;quot; agent=&amp;quot;fence_na&amp;quot; ipaddr=&amp;quot;fence_na01.alteeve.com&amp;quot; login=&amp;quot;admin&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;fence_daemon post_join_delay=&amp;quot;60&amp;quot;/&amp;gt;&lt;br /&gt;
        &amp;lt;totem rrp_mode=&amp;quot;none&amp;quot; secauth=&amp;quot;off&amp;quot;/&amp;gt;&lt;br /&gt;
        &amp;lt;rm&amp;gt;&lt;br /&gt;
                &amp;lt;resources&amp;gt;&lt;br /&gt;
                        &amp;lt;script file=&amp;quot;/etc/init.d/drbd&amp;quot; name=&amp;quot;drbd&amp;quot;/&amp;gt;&lt;br /&gt;
                        &amp;lt;script file=&amp;quot;/etc/init.d/clvmd&amp;quot; name=&amp;quot;clvmd&amp;quot;/&amp;gt;&lt;br /&gt;
                        &amp;lt;script file=&amp;quot;/etc/init.d/gfs2&amp;quot; name=&amp;quot;gfs2&amp;quot;/&amp;gt;&lt;br /&gt;
                &amp;lt;/resources&amp;gt;&lt;br /&gt;
		&amp;lt;failoverdomains&amp;gt;&lt;br /&gt;
			&amp;lt;failoverdomain name=&amp;quot;an4_only&amp;quot; nofailback=&amp;quot;0&amp;quot; ordered=&amp;quot;0&amp;quot; restricted=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
				&amp;lt;failoverdomainnode name=&amp;quot;an-node04.alteeve.com&amp;quot; priority=&amp;quot;1&amp;quot;/&amp;gt;&lt;br /&gt;
			&amp;lt;/failoverdomain&amp;gt;&lt;br /&gt;
			&amp;lt;failoverdomain name=&amp;quot;an5_only&amp;quot; nofailback=&amp;quot;0&amp;quot; ordered=&amp;quot;0&amp;quot; restricted=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
				&amp;lt;failoverdomainnode name=&amp;quot;an-node05.alteeve.com&amp;quot; priority=&amp;quot;1&amp;quot;/&amp;gt;&lt;br /&gt;
			&amp;lt;/failoverdomain&amp;gt;&lt;br /&gt;
		&amp;lt;/failoverdomains&amp;gt;&lt;br /&gt;
        &amp;lt;/rm&amp;gt;&lt;br /&gt;
&amp;lt;/cluster&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So here we&#039;ve now created two failover domains; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an4_only&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an5_only&amp;lt;/span&amp;gt;. Both of these are &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;restricted=&amp;quot;1&amp;quot;&amp;lt;/span&amp;gt;, so services within these domains will never try to start on other nodes. Both &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;nofailback=&amp;quot;0&amp;quot;&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ordered=&amp;quot;0&amp;quot;&amp;lt;/span&amp;gt; are defined, but they have no meaning because the two domains have only one node each.&lt;br /&gt;
&lt;br /&gt;
Within each domain, the corresponding &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;failoverdomainnode /&amp;gt;&amp;lt;/span&amp;gt; is defined. Notice that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;priority=&amp;quot;1&amp;quot;&amp;lt;/span&amp;gt; is set, despite having no use. This attribute must exist regardless. The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;name=&amp;quot;an-node0x.alteeve.com&amp;lt;/span&amp;gt; links the node to it&#039;s corresponding &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;clusternode name=&amp;quot;an-node0x.alteeve.com&amp;quot;&amp;lt;/span&amp;gt; entry in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;clusternodes /&amp;gt;&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Creating the Storage Services in cluster.conf ===&lt;br /&gt;
&lt;br /&gt;
The last piece of the resource management puzzle are the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;service /&amp;gt;&amp;lt;/span&amp;gt; tags. These tags are where the actually resources are tied together, assigned to a failover domain and put under the cluster&#039;s control. The resource elements can be defined as parallel tags, a resource can be an elements of another to form dependency branches or they can be a combination of both. In our case, we want to make sure that each storage daemon successfully starts before the next service starts so we will be creating a dependency tree of resources. Specifically, we want to ensure that the start order is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;drbd&amp;lt;/span&amp;gt; -&amp;gt; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clvmd&amp;lt;/span&amp;gt; -&amp;gt; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;gfs2&amp;lt;/span&amp;gt;. The shut-down will be the reverse order.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;service /&amp;gt;&amp;lt;/span&amp;gt; tag has just one required attribute, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;name=&amp;quot;&amp;quot;&amp;lt;/span&amp;gt;, which is used in tools like Conga for identifying the service. The name can be descriptive, but it must be unique. There are several optional attributes, though we will only be looking at five of them.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;domain=&amp;quot;&amp;quot;&amp;lt;/span&amp;gt; is used to assign the given &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;service /&amp;gt;&amp;lt;/span&amp;gt; to failover domain. The name set here must match a &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;failoverdomain name=&amp;quot;&amp;quot; /&amp;gt;&amp;lt;/span&amp;gt;. Note that you &#039;&#039;do not&#039;&#039; need to define a failover domain. &lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;autostart=&amp;quot;[0|1]&amp;quot;&amp;lt;/span&amp;gt; controls whether or not the service is automatically started when &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; starts. We&#039;ll be disabling this for now, but we will come back and enable it after our initial testing is done.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;exclusive=&amp;quot;[0|1]&amp;quot;&amp;lt;/span&amp;gt; controls whether this service must run exclusively on a given node. &#039;&#039;&#039;Warning&#039;&#039;&#039;: If this is enabled, then no other service will be allowed to run on the node hosting this service.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;recover=&amp;quot;[restart|relocate|disable]&amp;quot;&amp;lt;/span&amp;gt; controls what &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; will do when this service fails. The services we&#039;re going to create now are only designed to run on one node, so &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;restart&amp;lt;/span&amp;gt; is the only policy that makes sense.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;max_restarts=&amp;quot;x&amp;quot;&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 number of times that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; will try to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;restart&amp;lt;/span&amp;gt; a given service. After &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;x&amp;lt;/span&amp;gt; failures, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; will instead &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;relocate&amp;lt;/span&amp;gt; the service based on the failover domain policy, when set. In our case, the failover domains prevent the service from running outside the domain, and the domain has only one node, so this value is effectively meaningless to us.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;restart_expire_time=&amp;quot;x&amp;quot;&amp;lt;/span&amp;gt;, where &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;x&amp;lt;/span&amp;gt; is a number of seconds. When &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;max_restarts&amp;lt;/span&amp;gt; is greater than &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;0&amp;lt;/span&amp;gt;, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; keeps a count of how many times a service has failed. These service failures &amp;quot;expire&amp;quot; after the number of seconds defined here. This is used so that the service failure count can reduce back down to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;0&amp;lt;/span&amp;gt; once things have been shown to be stable for a reasonable amount of time. As we&#039;re using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;max_restarts=&amp;quot;0&amp;quot;&amp;lt;/span&amp;gt; and the failover domain prevents relocation of the service, this value is effectively meaningless to us.&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-cluster01&amp;quot; config_version=&amp;quot;13&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;cman expected_votes=&amp;quot;1&amp;quot; two_node=&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-node04.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;fence_na01&amp;quot; port=&amp;quot;04&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-node05.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;fence_na01&amp;quot; port=&amp;quot;03&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_na01&amp;quot; agent=&amp;quot;fence_na&amp;quot; ipaddr=&amp;quot;fence_na01.alteeve.com&amp;quot; login=&amp;quot;admin&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;fence_daemon post_join_delay=&amp;quot;60&amp;quot;/&amp;gt;&lt;br /&gt;
        &amp;lt;totem rrp_mode=&amp;quot;none&amp;quot; secauth=&amp;quot;off&amp;quot;/&amp;gt;&lt;br /&gt;
	&amp;lt;rm&amp;gt;&lt;br /&gt;
		&amp;lt;resources&amp;gt;&lt;br /&gt;
			&amp;lt;script file=&amp;quot;/etc/init.d/drbd&amp;quot; name=&amp;quot;drbd&amp;quot;/&amp;gt;&lt;br /&gt;
			&amp;lt;script file=&amp;quot;/etc/init.d/clvmd&amp;quot; name=&amp;quot;clvmd&amp;quot;/&amp;gt;&lt;br /&gt;
			&amp;lt;script file=&amp;quot;/etc/init.d/gfs2&amp;quot; name=&amp;quot;gfs2&amp;quot;/&amp;gt;&lt;br /&gt;
		&amp;lt;/resources&amp;gt;&lt;br /&gt;
		&amp;lt;failoverdomains&amp;gt;&lt;br /&gt;
			&amp;lt;failoverdomain name=&amp;quot;an4_only&amp;quot; nofailback=&amp;quot;0&amp;quot; ordered=&amp;quot;0&amp;quot; restricted=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
				&amp;lt;failoverdomainnode name=&amp;quot;an-node04.alteeve.com&amp;quot; priority=&amp;quot;1&amp;quot;/&amp;gt;&lt;br /&gt;
			&amp;lt;/failoverdomain&amp;gt;&lt;br /&gt;
			&amp;lt;failoverdomain name=&amp;quot;an5_only&amp;quot; nofailback=&amp;quot;0&amp;quot; ordered=&amp;quot;0&amp;quot; restricted=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
				&amp;lt;failoverdomainnode name=&amp;quot;an-node05.alteeve.com&amp;quot; priority=&amp;quot;1&amp;quot;/&amp;gt;&lt;br /&gt;
			&amp;lt;/failoverdomain&amp;gt;&lt;br /&gt;
		&amp;lt;/failoverdomains&amp;gt;&lt;br /&gt;
		&amp;lt;service autostart=&amp;quot;0&amp;quot; domain=&amp;quot;an4_only&amp;quot; exclusive=&amp;quot;0&amp;quot; max_restarts=&amp;quot;0&amp;quot; name=&amp;quot;an4_storage&amp;quot; recovery=&amp;quot;restart&amp;quot; restart_expire_time=&amp;quot;0&amp;quot;&amp;gt;&lt;br /&gt;
			&amp;lt;script ref=&amp;quot;drbd&amp;quot;&amp;gt;&lt;br /&gt;
				&amp;lt;script ref=&amp;quot;clvmd&amp;quot;&amp;gt;&lt;br /&gt;
					&amp;lt;script ref=&amp;quot;gfs2&amp;quot;/&amp;gt;&lt;br /&gt;
				&amp;lt;/script&amp;gt;&lt;br /&gt;
			&amp;lt;/script&amp;gt;&lt;br /&gt;
		&amp;lt;/service&amp;gt;&lt;br /&gt;
		&amp;lt;service autostart=&amp;quot;0&amp;quot; domain=&amp;quot;an5_only&amp;quot; exclusive=&amp;quot;0&amp;quot; max_restarts=&amp;quot;0&amp;quot; name=&amp;quot;an5_storage&amp;quot; recovery=&amp;quot;restart&amp;quot; restart_expire_time=&amp;quot;0&amp;quot;&amp;gt;&lt;br /&gt;
			&amp;lt;script ref=&amp;quot;drbd&amp;quot;&amp;gt;&lt;br /&gt;
				&amp;lt;script ref=&amp;quot;clvmd&amp;quot;&amp;gt;&lt;br /&gt;
					&amp;lt;script ref=&amp;quot;gfs2&amp;quot;/&amp;gt;&lt;br /&gt;
				&amp;lt;/script&amp;gt;&lt;br /&gt;
			&amp;lt;/script&amp;gt;&lt;br /&gt;
		&amp;lt;/service&amp;gt;&lt;br /&gt;
	&amp;lt;/rm&amp;gt;&lt;br /&gt;
&amp;lt;/cluster&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So what we&#039;ve done here is create our two &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;service /&amp;gt;&amp;lt;/span&amp;gt; groups; One for the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an4_only&amp;lt;/span&amp;gt; failover domain and another matching service for &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an5_only&amp;lt;/span&amp;gt;. Both have their recovery policy set to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;recovery=&amp;quot;restart&amp;quot;&amp;lt;/span&amp;gt; and neither are configured to start with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Each &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;service /&amp;gt;&amp;lt;/span&amp;gt; tag&#039;s element is a collection of three &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;script /&amp;gt;&amp;lt;/span&amp;gt; resource references. The scripts are referenced using the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;script ref=&amp;quot;x&amp;quot; /&amp;gt;&amp;lt;/span&amp;gt; attribute, where &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;x&amp;lt;/span&amp;gt; must match a &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;resource name=&amp;quot;x&amp;quot; /&amp;gt;&amp;lt;/span&amp;gt; element in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;resources&amp;gt;&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
These references are embedded to form a dependency tree. The tree is formatted to start &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;drbd&amp;lt;/span&amp;gt; first, then when that starts successfully, it will start &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clvmd&amp;lt;/span&amp;gt; and then, finally, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;gfs2&amp;lt;/span&amp;gt;. When this service is disabled, this dependency tree is stopped in the reverse order. &lt;br /&gt;
&lt;br /&gt;
=== Validating the Additions to cluster.conf ===&lt;br /&gt;
&lt;br /&gt;
Seeing as we&#039;ve made some fairly significant changes to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/cluster/cluster.conf&amp;lt;/span&amp;gt;, we&#039;ll want to re-validate it before pushing it out to the other node.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
xmllint --relaxng /usr/share/system-config-cluster/misc/cluster.ng /etc/cluster/cluster.conf&lt;br /&gt;
&amp;lt;/source&amp;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-cluster01&amp;quot; config_version=&amp;quot;13&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;cman expected_votes=&amp;quot;1&amp;quot; two_node=&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-node04.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;fence_na01&amp;quot; port=&amp;quot;04&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-node05.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;fence_na01&amp;quot; port=&amp;quot;03&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_na01&amp;quot; agent=&amp;quot;fence_na&amp;quot; ipaddr=&amp;quot;fence_na01.alteeve.com&amp;quot; login=&amp;quot;admin&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;fence_daemon post_join_delay=&amp;quot;60&amp;quot;/&amp;gt;&lt;br /&gt;
        &amp;lt;totem rrp_mode=&amp;quot;none&amp;quot; secauth=&amp;quot;off&amp;quot;/&amp;gt;&lt;br /&gt;
	&amp;lt;rm&amp;gt;&lt;br /&gt;
		&amp;lt;resources&amp;gt;&lt;br /&gt;
			&amp;lt;script file=&amp;quot;/etc/init.d/drbd&amp;quot; name=&amp;quot;drbd&amp;quot;/&amp;gt;&lt;br /&gt;
			&amp;lt;script file=&amp;quot;/etc/init.d/clvmd&amp;quot; name=&amp;quot;clvmd&amp;quot;/&amp;gt;&lt;br /&gt;
			&amp;lt;script file=&amp;quot;/etc/init.d/gfs2&amp;quot; name=&amp;quot;gfs2&amp;quot;/&amp;gt;&lt;br /&gt;
		&amp;lt;/resources&amp;gt;&lt;br /&gt;
		&amp;lt;failoverdomains&amp;gt;&lt;br /&gt;
			&amp;lt;failoverdomain name=&amp;quot;an4_only&amp;quot; nofailback=&amp;quot;0&amp;quot; ordered=&amp;quot;0&amp;quot; restricted=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
				&amp;lt;failoverdomainnode name=&amp;quot;an-node04.alteeve.com&amp;quot; priority=&amp;quot;1&amp;quot;/&amp;gt;&lt;br /&gt;
			&amp;lt;/failoverdomain&amp;gt;&lt;br /&gt;
			&amp;lt;failoverdomain name=&amp;quot;an5_only&amp;quot; nofailback=&amp;quot;0&amp;quot; ordered=&amp;quot;0&amp;quot; restricted=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
				&amp;lt;failoverdomainnode name=&amp;quot;an-node05.alteeve.com&amp;quot; priority=&amp;quot;1&amp;quot;/&amp;gt;&lt;br /&gt;
			&amp;lt;/failoverdomain&amp;gt;&lt;br /&gt;
		&amp;lt;/failoverdomains&amp;gt;&lt;br /&gt;
		&amp;lt;service autostart=&amp;quot;0&amp;quot; domain=&amp;quot;an4_only&amp;quot; exclusive=&amp;quot;0&amp;quot; max_restarts=&amp;quot;0&amp;quot; name=&amp;quot;an4_storage&amp;quot; recovery=&amp;quot;restart&amp;quot; restart_expire_time=&amp;quot;0&amp;quot;&amp;gt;&lt;br /&gt;
			&amp;lt;script ref=&amp;quot;drbd&amp;quot;&amp;gt;&lt;br /&gt;
				&amp;lt;script ref=&amp;quot;clvmd&amp;quot;&amp;gt;&lt;br /&gt;
					&amp;lt;script ref=&amp;quot;gfs2&amp;quot;/&amp;gt;&lt;br /&gt;
				&amp;lt;/script&amp;gt;&lt;br /&gt;
			&amp;lt;/script&amp;gt;&lt;br /&gt;
		&amp;lt;/service&amp;gt;&lt;br /&gt;
		&amp;lt;service autostart=&amp;quot;0&amp;quot; domain=&amp;quot;an5_only&amp;quot; exclusive=&amp;quot;0&amp;quot; max_restarts=&amp;quot;0&amp;quot; name=&amp;quot;an5_storage&amp;quot; recovery=&amp;quot;restart&amp;quot; restart_expire_time=&amp;quot;0&amp;quot;&amp;gt;&lt;br /&gt;
			&amp;lt;script ref=&amp;quot;drbd&amp;quot;&amp;gt;&lt;br /&gt;
				&amp;lt;script ref=&amp;quot;clvmd&amp;quot;&amp;gt;&lt;br /&gt;
					&amp;lt;script ref=&amp;quot;gfs2&amp;quot;/&amp;gt;&lt;br /&gt;
				&amp;lt;/script&amp;gt;&lt;br /&gt;
			&amp;lt;/script&amp;gt;&lt;br /&gt;
		&amp;lt;/service&amp;gt;&lt;br /&gt;
	&amp;lt;/rm&amp;gt;&lt;br /&gt;
&amp;lt;/cluster&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;
/etc/cluster/cluster.conf validates&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If there was a problem, you need to go back and fix it. &#039;&#039;&#039;DO NOT&#039;&#039;&#039; proceed until your configuration validates. Once it does, we&#039;re ready to move on!&lt;br /&gt;
&lt;br /&gt;
With it validated, we need to push it to the other node. The cluster should be running now, so instead of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rsync&amp;lt;/span&amp;gt;, we can use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ccs_tool&amp;lt;/span&amp;gt;, the &amp;quot;cluster configuration system (tool)&amp;quot;, to push the new &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cluster.conf&amp;lt;/span&amp;gt; to the other node and upgrade the cluster&#039;s version in one shot.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ccs_tool update /etc/cluster/cluster.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;
Config file updated from version 9 to 13&lt;br /&gt;
&lt;br /&gt;
Update complete.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you tool at &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/var/log/messages&amp;lt;/span&amp;gt; on the other node, you should see something like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
May  7 20:32:08 an-node05 ccsd[4134]: Update of cluster.conf complete (version 9 -&amp;gt; 13). &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Starting rgmanager ==&lt;br /&gt;
&lt;br /&gt;
Now that we have services, we will want to manually start &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt;. We&#039;re not yet going to set it to automatically start as we&#039;re not yet automatically starting &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt;, which it depends on. This will be done later when the testing is complete.&lt;br /&gt;
&lt;br /&gt;
So make sure that the cluster is up and running.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cman_tool 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;
Version: 6.2.0&lt;br /&gt;
Config Version: 13&lt;br /&gt;
Cluster Name: an-cluster01&lt;br /&gt;
Cluster Id: 60257&lt;br /&gt;
Cluster Member: Yes&lt;br /&gt;
Cluster Generation: 140&lt;br /&gt;
Membership state: Cluster-Member&lt;br /&gt;
Nodes: 2&lt;br /&gt;
Expected votes: 1&lt;br /&gt;
Total votes: 2&lt;br /&gt;
Quorum: 1  &lt;br /&gt;
Active subsystems: 8&lt;br /&gt;
Flags: 2node Dirty &lt;br /&gt;
Ports Bound: 0 11  &lt;br /&gt;
Node name: an-node04.alteeve.com&lt;br /&gt;
Node ID: 1&lt;br /&gt;
Multicast addresses: 239.192.235.77 &lt;br /&gt;
Node addresses: 192.168.3.74 &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You will want to stop all of the storage daemons &#039;&#039;&#039;before&#039;&#039;&#039; starting &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt;. This is because &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; will always stop any services before it tries to start them itself. This includes virtual machines, as we will see in a bit.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On both nodes&#039;&#039;&#039;:&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 filesystems:                               [  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;
/etc/init.d/clvmd 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;
Deactivating clustered VG(s):   0 logical volume(s) in volume group &amp;quot;drbd_an5_vg0&amp;quot; now active&lt;br /&gt;
  0 logical volume(s) in volume group &amp;quot;drbd_an4_vg0&amp;quot; now active&lt;br /&gt;
  0 logical volume(s) in volume group &amp;quot;drbd_sh0_vg0&amp;quot; now active&lt;br /&gt;
                                                           [  OK  ]&lt;br /&gt;
Signaling clvmd to exit                                    [  OK  ]&lt;br /&gt;
clvmd terminated                                           [  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;
/etc/init.d/drbd 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;
Stopping all DRBD resources: .&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;rgmanager&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/rgmanager 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 Cluster Service Manager:                          [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Monitoring Resources ===&lt;br /&gt;
&lt;br /&gt;
We will now use a tool called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clustat&amp;lt;/span&amp;gt; that lets us see what state the cluster&#039;s resources are in. You can run it as a once-off check of the services, or you can use the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;-i x&amp;lt;/span&amp;gt; switch, where &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;x&amp;lt;/span&amp;gt; is a number of seconds to wait between re-checking the cluster service states. If you use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;-i x&amp;lt;/span&amp;gt;, you will need to use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;ctrl&amp;gt;&amp;lt;/span&amp;gt;+&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;c&amp;gt;&amp;lt;/span&amp;gt; to quit and return to the shell.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
clustat&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Cluster Status for an-cluster01 @ Sat May  7 22:30:24 2011&lt;br /&gt;
Member Status: Quorate&lt;br /&gt;
&lt;br /&gt;
 Member Name                             ID   Status&lt;br /&gt;
 ------ ----                             ---- ------&lt;br /&gt;
 an-node04.alteeve.com                       1 Online, Local, rgmanager&lt;br /&gt;
 an-node05.alteeve.com                       2 Online, rgmanager&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State         &lt;br /&gt;
 ------- ----                   ----- ------                   -----         &lt;br /&gt;
 service:an4_storage            (none)                         disabled      &lt;br /&gt;
 service:an5_storage            (none)                         disabled      &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you remember earlier, we set the services to not &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;autostart&amp;lt;/span&amp;gt;, thus, they are disabled.&lt;br /&gt;
&lt;br /&gt;
=== Managing Cluster Resources ===&lt;br /&gt;
&lt;br /&gt;
Managing services in the cluster is done with a fairly simple tool called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clusvcadm&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The main commands we&#039;re going to look at shortly are:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clusvcadm -e &amp;lt;service&amp;gt; -m &amp;lt;node&amp;gt;&amp;lt;/span&amp;gt;: Enable the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;service&amp;gt;&amp;lt;/span&amp;gt; on the specified &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;node&amp;gt;&amp;lt;/span&amp;gt;. When a &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;node&amp;gt;&amp;lt;/span&amp;gt; is not specified, the local node where the command was run is assumed.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clusvcadm -d &amp;lt;service&amp;gt; -m &amp;lt;node&amp;gt;&amp;lt;/span&amp;gt;: Disable the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;service&amp;gt;&amp;lt;/span&amp;gt;.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clusvcadm -l &amp;lt;service&amp;gt;&amp;lt;/span&amp;gt;: Locks the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;service&amp;gt;&amp;lt;/span&amp;gt; prior to a cluster shutdown. The only action allowed when a &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;service&amp;gt;&amp;lt;/span&amp;gt; is frozen is disabling it. This allows you to stop the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;service&amp;gt;&amp;lt;/span&amp;gt; so that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; doesn&#039;t try to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;recover&amp;lt;/span&amp;gt; it (&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;restart&amp;lt;/span&amp;gt;, in our two services). Once [[quorum]] is dissolved and the cluster is shut down, the service is unlocked and returns to normal operation next time the node regains quorum.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clusvcadm -u &amp;lt;service&amp;gt;&amp;lt;/span&amp;gt;: Unlocks a &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;service&amp;gt;&amp;lt;/span&amp;gt;, should you change your mind and decide not to stop the cluster.&lt;br /&gt;
&lt;br /&gt;
There are other ways to use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clusvcadm&amp;lt;/span&amp;gt; which we will look at after the virtual servers are provisioned and under cluster control.&lt;br /&gt;
&lt;br /&gt;
=== A Note On Resource Management With DRBD ===&lt;br /&gt;
&lt;br /&gt;
We have something of a unique setup here, using DRBD, that requires a brief discussion.&lt;br /&gt;
&lt;br /&gt;
When the cluster starts for the first time, where neither node&#039;s DRBD storage was up, the first node to start will wait indefinitely for the second node to start. For this reason, we want to ensure that we enable the storage resources more or less at the same time and from two different terminals. The reason for two terminals is that the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clusvcadm -e ...&amp;lt;/span&amp;gt; command won&#039;t return until all resources have started, so you need the second terminal window to start the other node&#039;s clustered storage service while the first one waits.&lt;br /&gt;
&lt;br /&gt;
Keep an eye on [[syslog]], too. If anything goes wrong in DRBD and a split-brain is declared you will see messages like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Mar 29 20:24:37 an-node04 kernel: block drbd2: helper command: /sbin/drbdadm initial-split-brain minor-2&lt;br /&gt;
Mar 29 20:24:37 an-node04 kernel: block drbd2: helper command: /sbin/drbdadm initial-split-brain minor-2 exit code 0 (0x0)&lt;br /&gt;
Mar 29 20:24:37 an-node04 kernel: block drbd2: Split-Brain detected but unresolved, dropping connection!&lt;br /&gt;
Mar 29 20:24:37 an-node04 kernel: block drbd2: helper command: /sbin/drbdadm split-brain minor-2&lt;br /&gt;
Mar 29 20:24:37 an-node04 kernel: block drbd2: helper command: /sbin/drbdadm split-brain minor-2 exit code 0 (0x0)&lt;br /&gt;
Mar 29 20:24:37 an-node04 kernel: block drbd2: conn( WFReportParams -&amp;gt; Disconnecting )&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This can happen, for example, if you stop the cluster while DRBD is still up, and then break the network connection between the two DRBD resources. Recovering from a split-brain is covered in the trouble-shooting section below. &#039;&#039;&#039;ToDo&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{{note|1=Linbit has a good tutorial on recovering from split-brain conditions here: http://www.drbd.org/users-guide/s-resolve-split-brain.html}}&lt;br /&gt;
&lt;br /&gt;
=== Starting the Storage Services ===&lt;br /&gt;
&lt;br /&gt;
Now, with a terminal window opened for each node, run:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt;&#039;&#039;&#039;:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
clusvcadm -e service:an4_storage -m an-node04.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;
Member an-node04.alteeve.com trying to enable service:an4_storage...Success&lt;br /&gt;
service:an4_storage is now running on an-node04.alteeve.com&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt;&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
clusvcadm -e service:an5_storage -m an-node05.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;
Member an-node05.alteeve.com trying to enable service:an5_storage...Success&lt;br /&gt;
service:an5_storage is now running on an-node05.alteeve.com&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The [[syslog]] on either node should show something like this (sample from &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&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;
May  7 23:29:21 an-node04 clurgmgrd[12067]: &amp;lt;notice&amp;gt; Starting disabled service service:an4_storage &lt;br /&gt;
May  7 23:29:22 an-node04 kernel: drbd: initialized. Version: 8.3.8 (api:88/proto:86-94)&lt;br /&gt;
May  7 23:29:22 an-node04 kernel: drbd: GIT-hash: d78846e52224fd00562f7c225bcc25b2d422321d build by mockbuild@builder10.centos.org, 2010-06-04 08:04:27&lt;br /&gt;
May  7 23:29:22 an-node04 kernel: drbd: registered as block device major 147&lt;br /&gt;
May  7 23:29:22 an-node04 kernel: drbd: minor_table @ 0xffff8800cde780c0&lt;br /&gt;
May  7 23:29:22 an-node04 kernel: block drbd0: Starting worker thread (from cqueue/1 [152])&lt;br /&gt;
May  7 23:29:22 an-node04 kernel: klogd 1.4.1, ---------- state change ---------- &lt;br /&gt;
May  7 23:29:22 an-node04 kernel: block drbd0: disk( Diskless -&amp;gt; Attaching ) &lt;br /&gt;
May  7 23:29:22 an-node04 kernel: block drbd0: Found 4 transactions (98 active extents) in activity log.&lt;br /&gt;
May  7 23:29:22 an-node04 kernel: block drbd0: Method to ensure write ordering: barrier&lt;br /&gt;
May  7 23:29:22 an-node04 kernel: block drbd0: max_segment_size ( = BIO size ) = 32768&lt;br /&gt;
May  7 23:29:22 an-node04 kernel: block drbd0: drbd_bm_resize called with capacity == 19550368&lt;br /&gt;
May  7 23:29:22 an-node04 kernel: block drbd0: resync bitmap: bits=2443796 words=38185&lt;br /&gt;
May  7 23:29:22 an-node04 kernel: block drbd0: size = 9546 MB (9775184 KB)&lt;br /&gt;
May  7 23:29:22 an-node04 kernel: block drbd0: recounting of set bits took additional 1 jiffies&lt;br /&gt;
May  7 23:29:22 an-node04 kernel: block drbd0: 0 KB (0 bits) marked out-of-sync by on disk bit-map.&lt;br /&gt;
May  7 23:29:22 an-node04 kernel: block drbd0: disk( Attaching -&amp;gt; Outdated ) &lt;br /&gt;
May  7 23:29:22 an-node04 kernel: block drbd1: Starting worker thread (from cqueue/1 [152])&lt;br /&gt;
May  7 23:29:22 an-node04 kernel: block drbd1: disk( Diskless -&amp;gt; Attaching ) &lt;br /&gt;
May  7 23:29:22 an-node04 kernel: block drbd1: Found 1 transactions (1 active extents) in activity log.&lt;br /&gt;
May  7 23:29:22 an-node04 kernel: block drbd1: Method to ensure write ordering: barrier&lt;br /&gt;
May  7 23:29:22 an-node04 kernel: block drbd1: max_segment_size ( = BIO size ) = 32768&lt;br /&gt;
May  7 23:29:22 an-node04 kernel: block drbd1: drbd_bm_resize called with capacity == 195328232&lt;br /&gt;
May  7 23:29:22 an-node04 kernel: block drbd1: resync bitmap: bits=24416029 words=381501&lt;br /&gt;
May  7 23:29:22 an-node04 kernel: block drbd1: size = 93 GB (97664116 KB)&lt;br /&gt;
May  7 23:29:22 an-node04 kernel: block drbd1: recounting of set bits took additional 2 jiffies&lt;br /&gt;
May  7 23:29:22 an-node04 kernel: block drbd1: 0 KB (0 bits) marked out-of-sync by on disk bit-map.&lt;br /&gt;
May  7 23:29:22 an-node04 kernel: block drbd1: disk( Attaching -&amp;gt; Outdated ) &lt;br /&gt;
May  7 23:29:22 an-node04 kernel: block drbd2: Starting worker thread (from cqueue/1 [152])&lt;br /&gt;
May  7 23:29:22 an-node04 kernel: block drbd2: disk( Diskless -&amp;gt; Attaching ) &lt;br /&gt;
May  7 23:29:22 an-node04 kernel: block drbd2: Found 1 transactions (1 active extents) in activity log.&lt;br /&gt;
May  7 23:29:22 an-node04 kernel: block drbd2: Method to ensure write ordering: barrier&lt;br /&gt;
May  7 23:29:22 an-node04 kernel: block drbd2: max_segment_size ( = BIO size ) = 32768&lt;br /&gt;
May  7 23:29:22 an-node04 kernel: block drbd2: drbd_bm_resize called with capacity == 195328232&lt;br /&gt;
May  7 23:29:22 an-node04 kernel: block drbd2: resync bitmap: bits=24416029 words=381501&lt;br /&gt;
May  7 23:29:22 an-node04 kernel: block drbd2: size = 93 GB (97664116 KB)&lt;br /&gt;
May  7 23:29:22 an-node04 kernel: block drbd2: recounting of set bits took additional 2 jiffies&lt;br /&gt;
May  7 23:29:22 an-node04 kernel: block drbd2: 0 KB (0 bits) marked out-of-sync by on disk bit-map.&lt;br /&gt;
May  7 23:29:22 an-node04 kernel: block drbd2: disk( Attaching -&amp;gt; Outdated ) &lt;br /&gt;
May  7 23:29:22 an-node04 kernel: block drbd3: Starting worker thread (from cqueue/1 [152])&lt;br /&gt;
May  7 23:29:22 an-node04 kernel: block drbd3: disk( Diskless -&amp;gt; Attaching ) &lt;br /&gt;
May  7 23:29:22 an-node04 kernel: block drbd3: No usable activity log found.&lt;br /&gt;
May  7 23:29:22 an-node04 kernel: block drbd3: Method to ensure write ordering: barrier&lt;br /&gt;
May  7 23:29:22 an-node04 kernel: block drbd3: max_segment_size ( = BIO size ) = 32768&lt;br /&gt;
May  7 23:29:22 an-node04 kernel: block drbd3: drbd_bm_resize called with capacity == 515686680&lt;br /&gt;
May  7 23:29:22 an-node04 kernel: block drbd3: resync bitmap: bits=64460835 words=1007201&lt;br /&gt;
May  7 23:29:22 an-node04 kernel: block drbd3: size = 246 GB (257843340 KB)&lt;br /&gt;
May  7 23:29:22 an-node04 kernel: block drbd3: recounting of set bits took additional 5 jiffies&lt;br /&gt;
May  7 23:29:22 an-node04 kernel: block drbd3: 0 KB (0 bits) marked out-of-sync by on disk bit-map.&lt;br /&gt;
May  7 23:29:22 an-node04 kernel: block drbd3: disk( Attaching -&amp;gt; Outdated ) &lt;br /&gt;
May  7 23:29:23 an-node04 kernel: block drbd0: conn( StandAlone -&amp;gt; Unconnected ) &lt;br /&gt;
May  7 23:29:23 an-node04 kernel: block drbd0: Starting receiver thread (from drbd0_worker [14542])&lt;br /&gt;
May  7 23:29:23 an-node04 kernel: block drbd0: receiver (re)started&lt;br /&gt;
May  7 23:29:23 an-node04 kernel: block drbd0: conn( Unconnected -&amp;gt; WFConnection ) &lt;br /&gt;
May  7 23:29:23 an-node04 kernel: block drbd1: conn( StandAlone -&amp;gt; Unconnected ) &lt;br /&gt;
May  7 23:29:23 an-node04 kernel: block drbd1: Starting receiver thread (from drbd1_worker [14556])&lt;br /&gt;
May  7 23:29:23 an-node04 kernel: block drbd1: receiver (re)started&lt;br /&gt;
May  7 23:29:23 an-node04 kernel: block drbd1: conn( Unconnected -&amp;gt; WFConnection ) &lt;br /&gt;
May  7 23:29:23 an-node04 kernel: block drbd2: conn( StandAlone -&amp;gt; Unconnected ) &lt;br /&gt;
May  7 23:29:23 an-node04 kernel: block drbd2: Starting receiver thread (from drbd2_worker [14571])&lt;br /&gt;
May  7 23:29:23 an-node04 kernel: block drbd2: receiver (re)started&lt;br /&gt;
May  7 23:29:23 an-node04 kernel: block drbd2: conn( Unconnected -&amp;gt; WFConnection ) &lt;br /&gt;
May  7 23:29:23 an-node04 kernel: block drbd3: conn( StandAlone -&amp;gt; Unconnected ) &lt;br /&gt;
May  7 23:29:23 an-node04 kernel: block drbd3: Starting receiver thread (from drbd3_worker [14590])&lt;br /&gt;
May  7 23:29:23 an-node04 kernel: block drbd3: receiver (re)started&lt;br /&gt;
May  7 23:29:23 an-node04 kernel: block drbd3: conn( Unconnected -&amp;gt; WFConnection ) &lt;br /&gt;
May  7 23:29:24 an-node04 kernel: block drbd0: Handshake successful: Agreed network protocol version 94&lt;br /&gt;
May  7 23:29:24 an-node04 kernel: block drbd0: conn( WFConnection -&amp;gt; WFReportParams ) &lt;br /&gt;
May  7 23:29:24 an-node04 kernel: block drbd0: Starting asender thread (from drbd0_receiver [14610])&lt;br /&gt;
May  7 23:29:24 an-node04 kernel: block drbd0: data-integrity-alg: &amp;lt;not-used&amp;gt;&lt;br /&gt;
May  7 23:29:24 an-node04 kernel: block drbd0: drbd_sync_handshake:&lt;br /&gt;
May  7 23:29:24 an-node04 kernel: block drbd0: self 60D1A5567634DECE:0000000000000000:49B42CE39BDB4567:2C84CA6708465E8D bits:0 flags:0&lt;br /&gt;
May  7 23:29:24 an-node04 kernel: block drbd0: peer 8033D8F146F6823A:60D1A5567634DECF:49B42CE39BDB4566:2C84CA6708465E8D bits:0 flags:0&lt;br /&gt;
May  7 23:29:24 an-node04 kernel: block drbd0: uuid_compare()=-1 by rule 50&lt;br /&gt;
May  7 23:29:24 an-node04 kernel: block drbd0: peer( Unknown -&amp;gt; Secondary ) conn( WFReportParams -&amp;gt; WFBitMapT ) pdsk( DUnknown -&amp;gt; UpToDate ) &lt;br /&gt;
May  7 23:29:24 an-node04 kernel: block drbd1: Handshake successful: Agreed network protocol version 94&lt;br /&gt;
May  7 23:29:24 an-node04 kernel: block drbd1: conn( WFConnection -&amp;gt; WFReportParams ) &lt;br /&gt;
May  7 23:29:24 an-node04 kernel: block drbd2: Handshake successful: Agreed network protocol version 94&lt;br /&gt;
May  7 23:29:24 an-node04 kernel: block drbd2: conn( WFConnection -&amp;gt; WFReportParams ) &lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd1: Starting asender thread (from drbd1_receiver [14613])&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd2: Starting asender thread (from drbd2_receiver [14616])&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd1: data-integrity-alg: &amp;lt;not-used&amp;gt;&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd1: drbd_sync_handshake:&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd1: self A6B85B6E10FC9ED4:0000000000000000:25BC8F003E8EDE15:6DE822E83F4ED721 bits:0 flags:0&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd1: peer 73B4642E7231664C:A6B85B6E10FC9ED5:25BC8F003E8EDE15:6DE822E83F4ED721 bits:0 flags:0&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd1: uuid_compare()=-1 by rule 50&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd1: peer( Unknown -&amp;gt; Secondary ) conn( WFReportParams -&amp;gt; WFBitMapT ) pdsk( DUnknown -&amp;gt; UpToDate ) &lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd2: data-integrity-alg: &amp;lt;not-used&amp;gt;&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd2: drbd_sync_handshake:&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd2: self D074F4853E9FAFE6:0000000000000000:05586D2FABD3DD12:64590F358F14E685 bits:0 flags:0&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd2: peer 399131BDEB288486:D074F4853E9FAFE7:05586D2FABD3DD13:64590F358F14E685 bits:0 flags:0&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd2: uuid_compare()=-1 by rule 50&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd2: peer( Unknown -&amp;gt; Secondary ) conn( WFReportParams -&amp;gt; WFBitMapT ) pdsk( DUnknown -&amp;gt; UpToDate ) &lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd3: Handshake successful: Agreed network protocol version 94&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd3: conn( WFConnection -&amp;gt; WFReportParams ) &lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd3: Starting asender thread (from drbd3_receiver [14619])&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd3: data-integrity-alg: &amp;lt;not-used&amp;gt;&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd3: drbd_sync_handshake:&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd3: self 5BA622DBC6DE170E:0000000000000000:0DE6667028BDEEFE:66C10BDFC06939F3 bits:0 flags:0&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd3: peer E6526E269E123D4C:5BA622DBC6DE170F:0DE6667028BDEEFF:66C10BDFC06939F3 bits:0 flags:0&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd3: uuid_compare()=-1 by rule 50&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd3: peer( Unknown -&amp;gt; Secondary ) conn( WFReportParams -&amp;gt; WFBitMapT ) pdsk( DUnknown -&amp;gt; UpToDate ) &lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd0: conn( WFBitMapT -&amp;gt; WFSyncUUID ) &lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd0: helper command: /sbin/drbdadm before-resync-target minor-0&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd1: conn( WFBitMapT -&amp;gt; WFSyncUUID ) &lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd0: role( Secondary -&amp;gt; Primary ) &lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd1: helper command: /sbin/drbdadm before-resync-target minor-1&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd1: helper command: /sbin/drbdadm before-resync-target minor-1 exit code 0 (0x0)&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd1: conn( WFSyncUUID -&amp;gt; SyncTarget ) disk( Outdated -&amp;gt; Inconsistent ) &lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd1: Began resync as SyncTarget (will sync 0 KB [0 bits set]).&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd1: Resync done (total 1 sec; paused 0 sec; 0 K/sec)&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd1: conn( SyncTarget -&amp;gt; Connected ) disk( Inconsistent -&amp;gt; UpToDate ) &lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd1: helper command: /sbin/drbdadm after-resync-target minor-1&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd2: conn( WFBitMapT -&amp;gt; WFSyncUUID ) &lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd1: helper command: /sbin/drbdadm after-resync-target minor-1 exit code 0 (0x0)&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd2: helper command: /sbin/drbdadm before-resync-target minor-2&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd2: helper command: /sbin/drbdadm before-resync-target minor-2 exit code 0 (0x0)&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd2: conn( WFSyncUUID -&amp;gt; SyncTarget ) disk( Outdated -&amp;gt; Inconsistent ) &lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd2: Began resync as SyncTarget (will sync 0 KB [0 bits set]).&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd2: Resync done (total 1 sec; paused 0 sec; 0 K/sec)&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd2: conn( SyncTarget -&amp;gt; Connected ) disk( Inconsistent -&amp;gt; UpToDate ) &lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd2: helper command: /sbin/drbdadm after-resync-target minor-2&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd0: helper command: /sbin/drbdadm before-resync-target minor-0 exit code 0 (0x0)&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd0: conn( WFSyncUUID -&amp;gt; SyncTarget ) disk( Outdated -&amp;gt; Inconsistent ) &lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd0: Began resync as SyncTarget (will sync 0 KB [0 bits set]).&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd0: Resync done (total 1 sec; paused 0 sec; 0 K/sec)&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd0: conn( SyncTarget -&amp;gt; Connected ) disk( Inconsistent -&amp;gt; UpToDate ) &lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd0: helper command: /sbin/drbdadm after-resync-target minor-0&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd2: helper command: /sbin/drbdadm after-resync-target minor-2 exit code 0 (0x0)&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd0: helper command: /sbin/drbdadm after-resync-target minor-0 exit code 0 (0x0)&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd3: conn( WFBitMapT -&amp;gt; WFSyncUUID ) &lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd1: Connected in w_make_resync_request&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd2: Connected in w_make_resync_request&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd3: helper command: /sbin/drbdadm before-resync-target minor-3&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd3: helper command: /sbin/drbdadm before-resync-target minor-3 exit code 0 (0x0)&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd3: conn( WFSyncUUID -&amp;gt; SyncTarget ) disk( Outdated -&amp;gt; Inconsistent ) &lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd3: Began resync as SyncTarget (will sync 0 KB [0 bits set]).&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd3: Resync done (total 1 sec; paused 0 sec; 0 K/sec)&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd3: conn( SyncTarget -&amp;gt; Connected ) disk( Inconsistent -&amp;gt; UpToDate ) &lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd3: helper command: /sbin/drbdadm after-resync-target minor-3&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd3: helper command: /sbin/drbdadm after-resync-target minor-3 exit code 0 (0x0)&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd0: Connected in w_make_resync_request&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd1: role( Secondary -&amp;gt; Primary ) &lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd3: Connected in w_make_resync_request&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd2: role( Secondary -&amp;gt; Primary ) &lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd3: role( Secondary -&amp;gt; Primary ) &lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd0: peer( Secondary -&amp;gt; Primary ) &lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd1: peer( Secondary -&amp;gt; Primary ) &lt;br /&gt;
May  7 23:29:26 an-node04 kernel: block drbd2: peer( Secondary -&amp;gt; Primary ) &lt;br /&gt;
May  7 23:29:26 an-node04 kernel: block drbd3: peer( Secondary -&amp;gt; Primary ) &lt;br /&gt;
May  7 23:29:26 an-node04 clvmd: Cluster LVM daemon started - connected to CMAN&lt;br /&gt;
May  7 23:29:27 an-node04 kernel: GFS2: fsid=: Trying to join cluster &amp;quot;lock_dlm&amp;quot;, &amp;quot;an-cluster01:xen_shared&amp;quot;&lt;br /&gt;
May  7 23:29:27 an-node04 kernel: GFS2: fsid=an-cluster01:xen_shared.0: Joined cluster. Now mounting FS...&lt;br /&gt;
May  7 23:29:27 an-node04 kernel: GFS2: fsid=an-cluster01:xen_shared.0: jid=0, already locked for use&lt;br /&gt;
May  7 23:29:27 an-node04 kernel: GFS2: fsid=an-cluster01:xen_shared.0: jid=0: Looking at journal...&lt;br /&gt;
May  7 23:29:27 an-node04 kernel: GFS2: fsid=an-cluster01:xen_shared.0: jid=0: Done&lt;br /&gt;
May  7 23:29:27 an-node04 kernel: GFS2: fsid=an-cluster01:xen_shared.0: jid=1: Trying to acquire journal lock...&lt;br /&gt;
May  7 23:29:27 an-node04 kernel: GFS2: fsid=an-cluster01:xen_shared.0: jid=1: Looking at journal...&lt;br /&gt;
May  7 23:29:27 an-node04 kernel: GFS2: fsid=an-cluster01:xen_shared.0: jid=1: Done&lt;br /&gt;
May  7 23:29:28 an-node04 clurgmgrd[12067]: &amp;lt;notice&amp;gt; Service service:an4_storage started &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here is what we&#039;re seeing:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clurgmgrd&amp;lt;/span&amp;gt;, the cluster &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; daemon, take the request to start the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an4_storage&amp;lt;/span&amp;gt; service.&lt;br /&gt;
* This is immediately followed by a lot of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;drbd&amp;lt;/span&amp;gt; messages showing the attachment, connection and promotion of the DRBD resources.&lt;br /&gt;
* Once the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;drbd&amp;lt;/span&amp;gt; daemon reported that it was up, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clurgmgrd&amp;lt;/span&amp;gt; started the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clvmd&amp;lt;/span&amp;gt; daemon.&lt;br /&gt;
* Next we see the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;gfs2&amp;lt;/span&amp;gt; initialization script start up.&lt;br /&gt;
* Once this last daemon returns, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clurgmgrd&amp;lt;/span&amp;gt; reports that the service started successfully.&lt;br /&gt;
&lt;br /&gt;
Now you can check &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; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;gfs2&amp;lt;/span&amp;gt; again and you will see that they are all online.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/drbd 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;
drbd driver loaded OK; device status:&lt;br /&gt;
version: 8.3.8 (api:88/proto:86-94)&lt;br /&gt;
GIT-hash: d78846e52224fd00562f7c225bcc25b2d422321d build by mockbuild@builder10.centos.org, 2010-06-04 08:04:27&lt;br /&gt;
m:res  cs         ro               ds                 p  mounted  fstype&lt;br /&gt;
0:r0   Connected  Primary/Primary  UpToDate/UpToDate  C&lt;br /&gt;
1:r1   Connected  Primary/Primary  UpToDate/UpToDate  C&lt;br /&gt;
2:r2   Connected  Primary/Primary  UpToDate/UpToDate  C&lt;br /&gt;
3:r3   Connected  Primary/Primary  UpToDate/UpToDate  C&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;
/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 (pid  14700) is running...&lt;br /&gt;
Clustered Volume Groups: drbd_an5_vg0 drbd_an4_vg0 drbd_sh0_vg0&lt;br /&gt;
Active clustered Logical Volumes: /dev/drbd_sh0_vg0/xen_shared&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;
/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;
/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, let&#039;s check &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clustat&amp;lt;/span&amp;gt; again and we&#039;ll see that the services are online.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
clustat&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Cluster Status for an-cluster01 @ Sat May  7 23:35:03 2011&lt;br /&gt;
Member Status: Quorate&lt;br /&gt;
&lt;br /&gt;
 Member Name                             ID   Status&lt;br /&gt;
 ------ ----                             ---- ------&lt;br /&gt;
 an-node04.alteeve.com                       1 Online, Local, rgmanager&lt;br /&gt;
 an-node05.alteeve.com                       2 Online, rgmanager&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State         &lt;br /&gt;
 ------- ----                   ----- ------                   -----         &lt;br /&gt;
 service:an4_storage            an-node04.alteeve.com          started       &lt;br /&gt;
 service:an5_storage            an-node05.alteeve.com          started       &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Hoozah!&lt;br /&gt;
&lt;br /&gt;
=== Stopping Clustered Services ===&lt;br /&gt;
&lt;br /&gt;
With the services we&#039;ve created, it&#039;s actually pretty simple to shut things down. Simply stopping &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; on each node will stop the services and, as they&#039;re not able to fail over, the services will stay offline. This can lead to bad habits though. So, to get into the proper habit, let&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;lock&amp;lt;/span&amp;gt; then &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;disable&amp;lt;/span&amp;gt; the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an5_storage&amp;lt;/span&amp;gt; service and then shutdown &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt;&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
clusvcadm -l service:an5_storage -m an-node05.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;
Resource groups locked&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;
clusvcadm -d service:an5_storage -m an-node05.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;
Member an-node05.alteeve.com disabling service:an5_storage...Success&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now when you try to run &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clustat&amp;lt;/span&amp;gt;, you can see that the service on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt; is disabled.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
clustat&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Cluster Status for an-cluster01 @ Sat May  7 23:43:10 2011&lt;br /&gt;
Member Status: Quorate&lt;br /&gt;
&lt;br /&gt;
 Member Name                             ID   Status&lt;br /&gt;
 ------ ----                             ---- ------&lt;br /&gt;
 an-node04.alteeve.com                       1 Online, rgmanager&lt;br /&gt;
 an-node05.alteeve.com                       2 Online, Local, rgmanager&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State         &lt;br /&gt;
 ------- ----                   ----- ------                   -----         &lt;br /&gt;
 service:an4_storage            an-node04.alteeve.com          started       &lt;br /&gt;
 service:an5_storage            (an-node05.alteeve.com)        disabled      &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we can shutdown &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; proper.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/rgmanager 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;
Shutting down Cluster Service Manager...&lt;br /&gt;
Waiting for services to stop:                              [  OK  ]&lt;br /&gt;
Cluster Service Manager is stopped.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clustat&amp;lt;/span&amp;gt; will not show any services at all when run from &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt;&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
clustat&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Cluster Status for an-cluster01 @ Sat May  7 23:57:55 2011&lt;br /&gt;
Member Status: Quorate&lt;br /&gt;
&lt;br /&gt;
 Member Name                             ID   Status&lt;br /&gt;
 ------ ----                             ---- ------&lt;br /&gt;
 an-node04.alteeve.com                       1 Online&lt;br /&gt;
 an-node05.alteeve.com                       2 Online, Local&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can still see both services from &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt; though.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt;&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
clustat&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Cluster Status for an-cluster01 @ Sat May  7 23:43:43 2011&lt;br /&gt;
Member Status: Quorate&lt;br /&gt;
&lt;br /&gt;
 Member Name                             ID   Status&lt;br /&gt;
 ------ ----                             ---- ------&lt;br /&gt;
 an-node04.alteeve.com                       1 Online, Local, rgmanager&lt;br /&gt;
 an-node05.alteeve.com                       2 Online&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State         &lt;br /&gt;
 ------- ----                   ----- ------                   -----         &lt;br /&gt;
 service:an4_storage            an-node04.alteeve.com          started       &lt;br /&gt;
 service:an5_storage            (an-node05.alteeve.com)        disabled      &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{note|1=You may notice that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; is no longer showing to the right of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05.alteeve.com&amp;lt;/span&amp;gt;. This indicates that the other node&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; daemon has stopped.}}&lt;br /&gt;
&lt;br /&gt;
Now we can go back to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt; and completely shut down the cluster.&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;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Stopping cluster: &lt;br /&gt;
   Stopping fencing... done&lt;br /&gt;
   Stopping cman... done&lt;br /&gt;
   Stopping ccsd... done&lt;br /&gt;
   Unmounting configfs... done&lt;br /&gt;
                                                           [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can check on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt; and see that the cluster is now down to just itself.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cman_tool 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;
Version: 6.2.0&lt;br /&gt;
Config Version: 13&lt;br /&gt;
Cluster Name: an-cluster01&lt;br /&gt;
Cluster Id: 60257&lt;br /&gt;
Cluster Member: Yes&lt;br /&gt;
Cluster Generation: 144&lt;br /&gt;
Membership state: Cluster-Member&lt;br /&gt;
Nodes: 1&lt;br /&gt;
Expected votes: 1&lt;br /&gt;
Total votes: 1&lt;br /&gt;
Quorum: 1  &lt;br /&gt;
Active subsystems: 9&lt;br /&gt;
Flags: 2node Dirty &lt;br /&gt;
Ports Bound: 0 11 177  &lt;br /&gt;
Node name: an-node04.alteeve.com&lt;br /&gt;
Node ID: 1&lt;br /&gt;
Multicast addresses: 239.192.235.77 &lt;br /&gt;
Node addresses: 192.168.3.74 &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At this point, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt; is totally out of the cluster and, if you wanted, you could perform any maintenance you might want to do. More on that later though.&lt;br /&gt;
&lt;br /&gt;
= Provisioning Our Virtual Servers =&lt;br /&gt;
&lt;br /&gt;
Finally, the goal of this cluster is in sight!&lt;br /&gt;
&lt;br /&gt;
We have two steps left;&lt;br /&gt;
* Provision our VMs.&lt;br /&gt;
* Add the VMs to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Provisioning&amp;quot; a virtual machine simple means to create it. This tutorial is more about clustering than Xen and virtual machine administration, so some liberties will be taken with regard to your knowledge of Xen. We&#039;ll cover all of the steps needed to provision and manage the VMs, but there will not be an in-depth discussion of the tools and their various uses.&lt;br /&gt;
&lt;br /&gt;
Please, if you are totally unfamiliar with [[Xen]], take a few minutes to review some tutorials:&lt;br /&gt;
&lt;br /&gt;
{{note|1=We are using Xen v3.0, heavily patched to be almost the same as 3.1. At the time of writing, the latest is v4.1. Please take not of the version when reading the tutorials below.}}&lt;br /&gt;
&lt;br /&gt;
* [[Networking in Xen 3.x]]; A brief overview of how networking works in our cluster.&lt;br /&gt;
* [http://wiki.xen.org/xenwiki/XenOverview Xen Overview]; Four useful [[PDF]]s in this link.&lt;br /&gt;
* [http://wiki.xen.org/xenwiki/XenFaq Xen FAQ]&lt;br /&gt;
* [http://wiki.xen.org/xenwiki/XenDocs Xen Documentation]; Includes v3 User Manual.&lt;br /&gt;
* [http://wiki.xen.org/xenwiki/HowTos Xen HowTos]; The Xen [http://wiki.xen.org/xenwiki/XenNetworking Networking] section may be particularly helpful.&lt;br /&gt;
* [http://wiki.xen.org/xenwiki/XenManagementTools Xen Management Tools]; Covers &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-manager&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;libvirtd&amp;lt;/span&amp;gt;.&lt;br /&gt;
* [http://wiki.xen.org/xenwiki/XenCommonProblems Xen Common Problems]; Somewhere between an FAQ and a troubleshooting guide.&lt;br /&gt;
&lt;br /&gt;
== Starting libvirtd On The Nodes ==&lt;br /&gt;
&lt;br /&gt;
In the following steps, we will be using a program called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virsh&amp;lt;/span&amp;gt; on the nodes and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-manager&amp;lt;/span&amp;gt; on our workstations to view the VMs. For this, we need to make sure that the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;libvirtd&amp;lt;/span&amp;gt; daemon is running on each node first. This ties in to the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;(xend-unix-server yes)&amp;lt;/span&amp;gt; value we changed in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/xen/xend-config.sxp&amp;lt;/span&amp;gt; file we set earlier, you may recall.&lt;br /&gt;
&lt;br /&gt;
Lets start the daemon now as we&#039;re going to use it very shortly.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On Both Nodes&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/libvirtd 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 libvirtd daemon:                                  [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To start &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;libvirtd&amp;lt;/span&amp;gt; on boot, run the command below.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;On Both Nodes&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
chkconfig libvirtd on&lt;br /&gt;
chkconfig --list libvirtd&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
libvirtd       	0:off	1:off	2:on	3:on	4:on	5:on	6:off&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Accessing The VMs ==&lt;br /&gt;
&lt;br /&gt;
The virtual servers we are going to create are, by definition, &amp;quot;headless&amp;quot;. There is no monitor or place to plug in a keyboard.&lt;br /&gt;
&lt;br /&gt;
The main way that you will monitor the virtual servers is through [[VNC]]. If you are running a relatively recent version of Linux on your workstation, there is a fantastic little program for connecting to and monitoring the VMs on multiple nodes using multiple [[hypervisor]]s called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-manager&amp;lt;/span&amp;gt;. It is available under many Linux distribution&#039;s package managers under the same name. &lt;br /&gt;
&lt;br /&gt;
In Fedora, [[EL]] 5 and 6 and many other [[RPM]] based distributions, you can install &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-manager&amp;lt;/span&amp;gt; on your workstation with the following command.&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;
You can then find &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-manager&amp;lt;/span&amp;gt; on you &#039;&#039;System Tools&#039;&#039; -&amp;gt; &#039;&#039;Virtual Machine Manager&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
To establish a connection to the nodes, click on &#039;&#039;File&#039;&#039; -&amp;gt; &#039;&#039;Add Connection...&#039;&#039;. Change the &#039;&#039;Hypervisor&#039;&#039; selection bar to &#039;&#039;&#039;Xen&#039;&#039;&#039;, check to select &#039;&#039;Connect to remote host&#039;&#039;, leave the default &#039;&#039;Method&#039;&#039; as &#039;&#039;&#039;SSH&#039;&#039;&#039; and &#039;&#039;Username&#039;&#039; as &#039;&#039;&#039;root&#039;&#039;&#039;. Then enter the host name or IP address of each node in the &#039;&#039;Hostname&#039;&#039; field. I always add cluster nodes to my &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/hosts&amp;lt;/span&amp;gt; file so that I can simply enter &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt;. How you handle this is up to you and your preferences.&lt;br /&gt;
&lt;br /&gt;
[[Image:virt-manager_fedora-14_01.png|thumb|340px|center|Adding a connection to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-manager&amp;lt;/span&amp;gt; on Fedora 14.]]&lt;br /&gt;
&lt;br /&gt;
Once both nodes are added, you should see that there is already a &#039;&#039;Domain-0&#039;&#039; entry. This is because, as we discussed earlier, even the &amp;quot;host&amp;quot; OS is itself a virtual machine.&lt;br /&gt;
&lt;br /&gt;
[[Image:virt-manager_fedora-14_02.png|thumb|484px|center|A view of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-manager&amp;lt;/span&amp;gt; on Fedora 14.]]&lt;br /&gt;
&lt;br /&gt;
== Limiting dom0&#039;s RAM Use ==&lt;br /&gt;
&lt;br /&gt;
Normally, [[dom0]] will claim and use memory not allocated to virtual machines. This can cause trouble if, for example, you&#039;ve migrated a [[VM]] off of a node and then want to move it or another VM back shortly after. For a period of time, dom0 will claim that there is not enough free memory for the migration. By setting a hard limit of dom0&#039;s memory usage, this scenario won&#039;t happen and you will not need to delay migrations.&lt;br /&gt;
&lt;br /&gt;
To do this, add &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;dom0_mem=1024M&amp;lt;/span&amp;gt; to the Xen kernel image&#039;s first &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;module&amp;lt;/span&amp;gt; line in [[grub]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /boot/grub/grub.conf /boot/grub/grub.conf.orig&lt;br /&gt;
vim /boot/grub/grub.conf&lt;br /&gt;
diff -u /boot/grub/grub.conf.orig /boot/grub/grub.conf&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;diff&amp;quot;&amp;gt;&lt;br /&gt;
--- /boot/grub/grub.conf.orig	2011-05-10 22:49:09.000000000 -0400&lt;br /&gt;
+++ /boot/grub/grub.conf	2011-05-10 22:54:57.000000000 -0400&lt;br /&gt;
@@ -14,11 +14,11 @@&lt;br /&gt;
 title CentOS (2.6.18-238.9.1.el5xen)&lt;br /&gt;
 	root (hd0,0)&lt;br /&gt;
 	kernel /xen.gz-2.6.18-238.9.1.el5&lt;br /&gt;
-	module /vmlinuz-2.6.18-238.9.1.el5xen ro root=LABEL=/&lt;br /&gt;
+	module /vmlinuz-2.6.18-238.9.1.el5xen ro root=LABEL=/ dom0_mem=1024M&lt;br /&gt;
 	module /initrd-2.6.18-238.9.1.el5xen.img&lt;br /&gt;
 title CentOS (2.6.18-238.9.1.el5)&lt;br /&gt;
 	root (hd0,0)&lt;br /&gt;
-	kernel /vmlinuz-2.6.18-238.9.1.el5 ro root=LABEL=/&lt;br /&gt;
+	kernel /vmlinuz-2.6.18-238.9.1.el5 ro root=LABEL=/ dom0_mem=1024M&lt;br /&gt;
 	initrd /initrd-2.6.18-238.9.1.el5.img&lt;br /&gt;
 title CentOS (2.6.18-238.el5xen)&lt;br /&gt;
 	root (hd0,0)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can change &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;1024M&amp;lt;/span&amp;gt; with the amount of RAM you want to allocate to dom0.&lt;br /&gt;
&lt;br /&gt;
{{warning|1=If you update your kernel, ensure that this kernel argument was added to the new kernel&#039;s argument list.}}&lt;br /&gt;
&lt;br /&gt;
== Our planned layout ==&lt;br /&gt;
&lt;br /&gt;
At this stage, what you will want to run is almost certainly going to be unique to you, so we will not be going into detail about what each VM does. We will cover provisioning them, manipulating them and what not. The description of the VMs is purely an example of what they might be.&lt;br /&gt;
&lt;br /&gt;
We will be creating two virtual servers.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0001_ws1&amp;lt;/span&amp;gt;; A [[CentOS]] server hosting a website.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0002_win1&amp;lt;/span&amp;gt;; A [[Microsoft]] Windows server, showing how to host non-Linux virtual machines.&lt;br /&gt;
&lt;br /&gt;
We&#039;ll assign &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0001_ws1&amp;lt;/span&amp;gt; to normally run on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0002_win1&amp;lt;/span&amp;gt; to normally run on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Before we talk about resources, there is something you must be aware of. &lt;br /&gt;
* You can have more virtual machines than CPU cores. That is, machines can share core. It&#039;s advisable to dedicate one core to just the [[dom0]] machine.&lt;br /&gt;
* RAM on dom0 and all domU VMs must not exceed the maximum amount of RAM available in a given node.&lt;br /&gt;
&lt;br /&gt;
{{warning|1=You &#039;&#039;must&#039;&#039; consider how your collection of virtual servers will run when only on node is available. As I have 4 [[GiB]] of RAM in each node, I will assign 1 [[GiB]] to dom0 and then 1 [[GiB]] to each VM, leaving 1 GiB for future expansion. How you divvy up your memory and CPU cores is ultimately up to you.}}&lt;br /&gt;
&lt;br /&gt;
So here are our two planned virtual servers, laid out in a table. Doing this before provisioning can help you visualize how your cluster&#039;s resources will be consumed, helping to ensure that you don&#039;t use too much, which is of particular note on very large installations. It&#039;s also very useful for planning your virtual machine provisioning commands in the next step.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
!&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0001_ws1&amp;lt;/span&amp;gt;&lt;br /&gt;
!&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0002_win1&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Primary Host&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!RAM&lt;br /&gt;
|1024[[MiB]]&lt;br /&gt;
|1024[[MiB]]&lt;br /&gt;
|-&lt;br /&gt;
!Storage&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/drbd_an4_vg0/vm0001_1&amp;lt;/span&amp;gt;, 50 [[GB]]&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/drbd_an5_vg0/vm0002_1&amp;lt;/span&amp;gt;, 100 [[GB]] (100%)&lt;br /&gt;
|-&lt;br /&gt;
!Network(s)&lt;br /&gt;
|IFN &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xenbr0&amp;lt;/span&amp;gt;, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;192.168.1.200&amp;lt;/span&amp;gt;/&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;255.255.255.0&amp;lt;/span&amp;gt;&lt;br /&gt;
|BCN &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xenbr0&amp;lt;/span&amp;gt;, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;192.168.1.201&amp;lt;/span&amp;gt;/&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;255.255.255.0&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Source Files&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;http://192.168.1.254/c5/x86_64/img&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/xen_shared/iso/Win_Server_2008_Bis_x86_64.iso&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Kickstart Script&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;http://192.168.1.254/c5/x86_64/ks/generic_c5.ks&amp;lt;/span&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{{warning|1=There are issues with installing VMs from [[ISO]] images. For this reason, you are advised to make the installation images available over a web server. A great way to do this is by creating a [[Setting Up a PXE Server in Fedora|PXE server]] on your network. Then you can point to it&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;img&amp;lt;/span&amp;gt; directory when running the VM installs. This tutorial assumes this is available.}}&lt;br /&gt;
&lt;br /&gt;
=== Provisioning vm0001_ws1; A Webserver ===&lt;br /&gt;
&lt;br /&gt;
So let&#039;s start with a basic web server. &lt;br /&gt;
&lt;br /&gt;
Provisioning VMs requires two steps;&lt;br /&gt;
* Creating a logical volume on the clustered LVM.&lt;br /&gt;
* Craft and execute a &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-install&amp;lt;/span&amp;gt; command.&lt;br /&gt;
&lt;br /&gt;
Before you proceed, you need to know where the installation image files are found. This tutorial uses a [[Setting Up a PXE Server in Fedora|PXE server]], so we&#039;ll be telling &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-install&amp;lt;/span&amp;gt; to pull the installation files and [[kickstart]] scripts off of it&#039;s web server. If you don&#039;t have a PXE server, simply mounting the installation image&#039;s ISO and making that available through a trivial webserver setup will be fine. How you do this, exactly, is outside the scope of this tutorial. However, there is a separate, detailed configuration tutorial for setting up a [[Setting Up a PXE Server in Fedora|PXE server]] which covers a basic [[apache]] configuration.&lt;br /&gt;
&lt;br /&gt;
Create the [[LV]] for the VM on the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/drbd_an4_vg0&amp;lt;/span&amp;gt; [[VG]], as it will primarily run on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&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;
lvcreate -L 50G -n vm0001_1 --addtag @an-cluster01 /dev/drbd_an4_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;vm0001_1&amp;quot; created&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{note|1=The example below uses the following kickstart file. Please adapt it for your use.&amp;lt;br /&amp;gt;&lt;br /&gt;
* [[generic_c5.ks]]}}&lt;br /&gt;
&lt;br /&gt;
Now, the long &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-install&amp;lt;/span&amp;gt; command to provision the VM. Let&#039;s look at it, then we&#039;ll discuss it.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
virt-install --connect xen \&lt;br /&gt;
	--name vm0001_ws1 \&lt;br /&gt;
	--ram 1048 \&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.254/c5/x86_64/img \&lt;br /&gt;
	--extra-args &amp;quot;ks=http://192.168.1.254/c5/x86_64/ks/generic_c5.ks&amp;quot; \&lt;br /&gt;
	--os-type linux \&lt;br /&gt;
	--os-variant rhel5.4 \&lt;br /&gt;
	--disk path=/dev/drbd_an4_vg0/vm0001_1 \&lt;br /&gt;
	--network bridge=xenbr0 \&lt;br /&gt;
	--vnc \&lt;br /&gt;
	--paravirt&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{note|1=If you wanted to provision a VM to act as a firewall, or for other reasons wanted a VM to access the back-channel, you could connect to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xenbr2&amp;lt;/span&amp;gt; by simply adding a second &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--network bridge=xenbr2&amp;lt;/span&amp;gt; argument.}}&lt;br /&gt;
&lt;br /&gt;
The [[man]] page for &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-install&amp;lt;/span&amp;gt; covers all of the options you can pass in good detail. We&#039;re going to discuss now the options used here, but it will only be a subset of options that you may wish to use. Please take the time to read &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;man virt-install&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--connect xen&amp;lt;/span&amp;gt;; Tells &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-install&amp;lt;/span&amp;gt; that we are provisioning a Xen [[domU]] VM.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--name vm0001_ws1&amp;lt;/span&amp;gt;; Tells &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-install&amp;lt;/span&amp;gt; to give the VM the name &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0001_ws1&amp;lt;/span&amp;gt;. This can be anything you please, but it &#039;&#039;&#039;must&#039;&#039;&#039; be unique in the cluster. Personally, I like the format &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm####_desc&amp;lt;/span&amp;gt;, where &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;####&amp;lt;/span&amp;gt; is a sequence number to ensure uniqueness and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;desc&amp;lt;/span&amp;gt; is a human-readable, short description of the VM. Please use whatever naming convention you find comfortable.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--ram 1024&amp;lt;/span&amp;gt;; This is the number of [[MiB]] to allocate to the VM. This can be adjusted post-install.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--arch x86_64&amp;lt;/span&amp;gt;; This tells &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-install&amp;lt;/span&amp;gt; to emulate a 64[[bit]] CPU/environment.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;-- vcpus 1&amp;lt;/span&amp;gt;; This controls how many CPU cores to allocate to this VM. This can not exceed the real number of CPUs, and should be &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;n-1&amp;lt;/span&amp;gt; at most, to ensure that [[dom0]] gets sole access to core 0. This can be adjusted post-install.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--cpuset 1&amp;lt;/span&amp;gt;; This tells &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;libvirt&amp;lt;/span&amp;gt; which cores it is allowed to use for this VM. This node has four cores, with CPU &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;0&amp;lt;/span&amp;gt; being pinned to [[dom0]]. So we will tell Xen to let this node use any free CPU between &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;1-3&amp;lt;/span&amp;gt; (the second, third and fourth cores). This can be a comma-separated list of value, and values can use hyphens for ranges. For example, if you have eight cores, you may specify &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--cpuset 1-7&amp;lt;/span&amp;gt; or &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--cpuset 1,3,5-7&amp;lt;/span&amp;gt;.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--location http://192.168.1.254/c5/x86_64/img&amp;lt;/span&amp;gt;; This tells the OS&#039; installer to look for installation files under the passed URL. The installation files could be local to the node (ie: with a loop-back mounted ISO), on an [[NFS]] share or over [[FTP]]. This option can be replaced with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--pxe&amp;lt;/span&amp;gt; for [[PXE]] server installs, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--import&amp;lt;/span&amp;gt; for skipping an installation and directly importing a VM image or &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--livecd&amp;lt;/span&amp;gt; for running up a live CD/DVD.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--extra-args &amp;quot;ks=http://192.168.1.254/c5/x86_64/ks/generic_c5.ks&amp;quot;&amp;lt;/span&amp;gt;; This allows us to pass special arguments to the installer&#039;s kernel. In this case, we&#039;re telling the installer to use the [[kickstart]] file at the given location. Optionally, we could have used &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--extra-args &amp;quot;ks=http://192.168.1.254/c5/x86_64/ks/generic_c5.ks ksdevice=eth0&amp;quot;&amp;lt;/span&amp;gt; to specify which interface to use when looking for the defined kickstart file. I generally avoid this as it is rather difficult to predict with physical interface will get what &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ethX&amp;lt;/span&amp;gt; name.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--os-type linux&amp;lt;/span&amp;gt;; This controls some internal optimization within Xen for handling Linux operating systems.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--os-variant rhel5.4&amp;lt;/span&amp;gt;; This further optimizes Xen for use with [[EL5]].4 (and newer) based operating systems. When this option is used, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--os-type&amp;lt;/span&amp;gt; is not strictly needed. The various supported &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--os-type&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--os-variant&amp;lt;/span&amp;gt; are found in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;man virt-install&amp;lt;/span&amp;gt;.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--disk path=/dev/drbd_an4_vg0/vm0001_1&amp;lt;/span&amp;gt;; This tells the installer to allocate the [[LV]] we just created as this VM&#039;s hard drive. There are &#039;&#039;many&#039;&#039; options for using storage for VMs, please see &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;man virt-install&amp;lt;/span&amp;gt;.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--network bridge=xenbr0&amp;lt;/span&amp;gt;; This, and the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xenbr2&amp;lt;/span&amp;gt; following it, tells &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-install&amp;lt;/span&amp;gt; to connect this VM to those two bridges. Note that inside the VM, these will show up as &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;eth1&amp;lt;/span&amp;gt;.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--vnc&amp;lt;/span&amp;gt;; This tells the VM to setup and export a VNC server. This is how we will connect to and monitor the installation of the VM.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--paravirt&amp;lt;/span&amp;gt;; This tells &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-install&amp;lt;/span&amp;gt; that we will be creating a [[paravirtual]] VM. The other option is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--hvm&amp;lt;/span&amp;gt; which specifies full virtualization.&lt;br /&gt;
&lt;br /&gt;
If things went well, you should now see you VM begin to install!&lt;br /&gt;
&lt;br /&gt;
[[Image:xen_vm0001_ws1_install_01.png|thumb|700px|center|Installation of a kickstart-based text install of CentOS 5.6 as a Xen VM.]]&lt;br /&gt;
&lt;br /&gt;
Once your VM is installed, we&#039;ll want to dump it&#039;s configuration to an [[XML]] file. This way, should the VM be accidentally undefined, we can easily redefine it. In fact, we have to define this VM on the second node to enable migration, but we&#039;ll go into details about migration later. For now though, run the following &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virsh&amp;lt;/span&amp;gt; command to write the VM&#039;s definition information to an XML file on the shared GFS2 partition. Putting it there will make is accessible to both nodes.&lt;br /&gt;
&lt;br /&gt;
{{warning|1=Do &#039;&#039;&#039;not&#039;&#039;&#039; bother dumping the configuration to an XML file until &#039;&#039;after&#039;&#039; the OS is fully installed and has rebooted. The configuration will contain arguments specific to the installation that will cause problem if used after the install is completed.}}&lt;br /&gt;
&lt;br /&gt;
Personally, I like to keep the configuration files in a subdirectory on the GFS2 share, then copy them to the local node&#039;s storage, just to be safe. Given that this is our first VM, we&#039;ll create a directory for the definition files now called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;definitions&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt;&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
mkdir /xen_shared/definitions&lt;br /&gt;
virsh dumpxml vm0001_ws1 &amp;gt; /xen_shared/definitions/vm0001_ws1.xml&lt;br /&gt;
cat /xen_shared/definitions/vm0001_ws1.xml&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;domain type=&#039;xen&#039;&amp;gt;&lt;br /&gt;
  &amp;lt;name&amp;gt;vm0001_ws1&amp;lt;/name&amp;gt;&lt;br /&gt;
  &amp;lt;uuid&amp;gt;d01c03da-8054-6590-37fd-5410c6b1a953&amp;lt;/uuid&amp;gt;&lt;br /&gt;
  &amp;lt;memory&amp;gt;1073152&amp;lt;/memory&amp;gt;&lt;br /&gt;
  &amp;lt;currentMemory&amp;gt;1073152&amp;lt;/currentMemory&amp;gt;&lt;br /&gt;
  &amp;lt;vcpu cpuset=&#039;1-3&#039;&amp;gt;1&amp;lt;/vcpu&amp;gt;&lt;br /&gt;
  &amp;lt;bootloader&amp;gt;/usr/bin/pygrub&amp;lt;/bootloader&amp;gt;&lt;br /&gt;
  &amp;lt;os&amp;gt;&lt;br /&gt;
    &amp;lt;type arch=&#039;x86_64&#039; machine=&#039;xenpv&#039;&amp;gt;linux&amp;lt;/type&amp;gt;&lt;br /&gt;
  &amp;lt;/os&amp;gt;&lt;br /&gt;
  &amp;lt;clock offset=&#039;utc&#039;/&amp;gt;&lt;br /&gt;
  &amp;lt;on_poweroff&amp;gt;destroy&amp;lt;/on_poweroff&amp;gt;&lt;br /&gt;
  &amp;lt;on_reboot&amp;gt;restart&amp;lt;/on_reboot&amp;gt;&lt;br /&gt;
  &amp;lt;on_crash&amp;gt;restart&amp;lt;/on_crash&amp;gt;&lt;br /&gt;
  &amp;lt;devices&amp;gt;&lt;br /&gt;
    &amp;lt;disk type=&#039;block&#039; device=&#039;disk&#039;&amp;gt;&lt;br /&gt;
      &amp;lt;driver name=&#039;phy&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;source dev=&#039;/dev/drbd_an4_vg0/vm0001_1&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;target dev=&#039;xvda&#039; bus=&#039;xen&#039;/&amp;gt;&lt;br /&gt;
    &amp;lt;/disk&amp;gt;&lt;br /&gt;
    &amp;lt;interface type=&#039;bridge&#039;&amp;gt;&lt;br /&gt;
      &amp;lt;mac address=&#039;00:16:36:05:6b:8c&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;source bridge=&#039;xenbr0&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;script path=&#039;vif-bridge&#039;/&amp;gt;&lt;br /&gt;
    &amp;lt;/interface&amp;gt;&lt;br /&gt;
    &amp;lt;console type=&#039;pty&#039;&amp;gt;&lt;br /&gt;
      &amp;lt;target port=&#039;0&#039;/&amp;gt;&lt;br /&gt;
    &amp;lt;/console&amp;gt;&lt;br /&gt;
    &amp;lt;input type=&#039;mouse&#039; bus=&#039;xen&#039;/&amp;gt;&lt;br /&gt;
    &amp;lt;graphics type=&#039;vnc&#039; port=&#039;-1&#039; autoport=&#039;yes&#039; keymap=&#039;en-us&#039;/&amp;gt;&lt;br /&gt;
  &amp;lt;/devices&amp;gt;&lt;br /&gt;
&amp;lt;/domain&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On Both Nodes&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
rsync -av /xen_shared/definitions ~/&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
definitions/&lt;br /&gt;
definitions/vm0001_ws1.xml&lt;br /&gt;
&lt;br /&gt;
sent 1085 bytes  received 48 bytes  755.33 bytes/sec&lt;br /&gt;
total size is 953  speedup is 0.84&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The benefit of having backups on the local storage is to protect these rarely changing but critical files in case anything ever corrupted the shared storage. We&#039;ve gone to great lengths to avoid this, but it&#039;s always possible and this is a simple precaution.&lt;br /&gt;
&lt;br /&gt;
==== Reconnecting to the VM ====&lt;br /&gt;
&lt;br /&gt;
After the install finishes, or after you close the initial minimal VNC viewer, you will need to manually reconnect to the VM. This is where &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-manager&amp;lt;/span&amp;gt; comes in so handy! &lt;br /&gt;
&lt;br /&gt;
Start it back up and double-click on the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt; host. You will now see the new &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0001_fw1&amp;lt;/span&amp;gt; VM. Double-click on it and you will be right back on the VM.&lt;br /&gt;
&lt;br /&gt;
[[Image:virt-manager_fedora-14_03.png|thumb|700px|center|A view of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-manager&amp;lt;/span&amp;gt; used to connect to the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0001_ws1&amp;lt;/span&amp;gt; VM.]]&lt;br /&gt;
&lt;br /&gt;
Pretty cool, eh!&lt;br /&gt;
&lt;br /&gt;
==== How to Stop, Define and Start the VM ====&lt;br /&gt;
&lt;br /&gt;
To stop the VM, you can connect to it as a remote server and shut it down as you would a normal VM.&lt;br /&gt;
&lt;br /&gt;
If you want to initial a clean shut down from the host node, you can use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virsh&amp;lt;/span&amp;gt; to initial a shutdown over [[ACPI]], same as if you tapped the power button on a physical server.&lt;br /&gt;
&lt;br /&gt;
Make sure the VM is on the node:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
virsh list --all&lt;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 Name                 State&lt;br /&gt;
----------------------------------&lt;br /&gt;
  0 Domain-0             running&lt;br /&gt;
  2 vm0001_ws1           idle&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell it to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;shutdown&amp;lt;/span&amp;gt;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
virsh shutdown vm0001_ws1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Domain vm0001_ws1 is being shutdown&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you had a VNC session running, you will see the VM start to gracefully shutdown.&lt;br /&gt;
&lt;br /&gt;
[[Image:xen3_vm_graceful_shutdown_1.png|thumb|center|700px|Gracefully shutting down the firewall VM via &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virsh shutdown vm0001_ws1&amp;lt;/span&amp;gt;.]]&lt;br /&gt;
&lt;br /&gt;
After a few moments, the VM should shut down. You can confirm this by again running &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virsh list --all&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;
virsh list --all&lt;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 Name                 State&lt;br /&gt;
----------------------------------&lt;br /&gt;
  0 Domain-0             running&lt;br /&gt;
  - vm0001_ws1           shut off&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Remember how we dumped this VM&#039;s configuration to an XML file on the GFS2 partition earlier? We&#039;re now going to use that to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;define&amp;lt;/span&amp;gt; the VM on the other node, then we&#039;ll start it up over there, too.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt;&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
Check that the VM isn&#039;t known by &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&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;
virsh list --all&lt;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 Name                 State&lt;br /&gt;
----------------------------------&lt;br /&gt;
  0 Domain-0             running&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It&#039;s not there, as expect. So now we&#039;ll use the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/xen_shared/definitions/vm0001_ws1.xml&amp;lt;/span&amp;gt; file we created.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
virsh define /xen_shared/definitions/vm0001_ws1.xml &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Domain vm0001_ws1 defined from /xen_shared/definitions/vm0001_ws1.xml&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now confirm that it&#039;s there.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
virsh list --all&lt;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 Name                 State&lt;br /&gt;
----------------------------------&lt;br /&gt;
  0 Domain-0             running&lt;br /&gt;
  - vm0001_ws1           shut off&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can now see &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0001_ws1&amp;lt;/span&amp;gt; on both nodes. Of course, &#039;&#039;&#039;&#039;&#039;never&#039;&#039;&#039;&#039;&#039;, &#039;&#039;&#039;&#039;&#039;ever&#039;&#039;&#039;&#039;&#039; try to start the VM on both nodes at the same time. In the previous step, we shut down &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0001_ws1&amp;lt;/span&amp;gt;, but it&#039;s safest to make sure that it&#039;s still off.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt;&#039;&#039;&#039;:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
virsh list --all&lt;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 Name                 State&lt;br /&gt;
----------------------------------&lt;br /&gt;
  0 Domain-0             running&lt;br /&gt;
  - vm0001_ws1           shut off&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So we now have &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0001_ws1&amp;lt;/span&amp;gt; shut off and it is defined on both &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt;. We can now start it on either node. Let&#039;s now start it up on the second node, just for fun.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt;&#039;&#039;&#039;:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
virsh start vm0001_ws1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Domain vm0001_ws1 started&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you look at &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-manager&amp;lt;/span&amp;gt;, you will now see &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0001_ws1&amp;lt;/span&amp;gt; up and running on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt; and shut off on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[Image:xen3_vm_running_on_second_node_1.png|thumb|center|700px|View of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0001_ws1&amp;lt;/span&amp;gt; running on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt;.]]&lt;br /&gt;
&lt;br /&gt;
There we go. We&#039;ve now seen how to stop, define and start the VM using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virsh&amp;lt;/span&amp;gt;. Nothing too fancy!&lt;br /&gt;
&lt;br /&gt;
==== Testing VM Migration ====&lt;br /&gt;
&lt;br /&gt;
One of the biggest benefits of virtual servers in clusters is that they can be migrated between nodes without needing to shut down the VM. This is useful for planned maintenance on nodes, as you can push off all of it&#039;s VMs, take it out of the cluster and do your maintenance and your VM users will see minimal or no interruption in service. &lt;br /&gt;
&lt;br /&gt;
There are two types of migration;&lt;br /&gt;
* &#039;&#039;&#039;Cold Migration&#039;&#039;&#039;; The VM is frozen, it&#039;s RAM is copied to the other node and then it is thawed on the new host. This is the fastest method of migrating, but the users will see a period where they can not interact with the VM.&lt;br /&gt;
* &#039;&#039;&#039;Live Migration&#039;&#039;&#039;; The VM continues to run during the migration. Performance will degrade a bit and the migration process will take longer to complete, but users should not see any interruption in service.&lt;br /&gt;
&lt;br /&gt;
To manually migrate the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0001_ws1&amp;lt;/span&amp;gt; VM &#039;&#039;from&#039;&#039; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt; back to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt;, run the following command. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt;&#039;&#039;&#039; (there will be no output):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
virsh migrate --live vm0001_ws1 xen+ssh://root@an-node04&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you flip over to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-manager&amp;lt;/span&amp;gt;, you will see that the node shows as &#039;&#039;Running&#039;&#039; on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt; on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt; and &#039;&#039;Shutoff&#039;&#039; on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt; right away, but there will still be CPU activity on both. This is the live migration process running. In the screen shot below, I opened a standard terminal and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ssh&amp;lt;/span&amp;gt;&#039;ed into &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0001_ws1&amp;lt;/span&amp;gt; and started a ping flood to Google &#039;&#039;&#039;before&#039;&#039;&#039; starting the live migration. Notice how the migration completed and no packets were dropped?&lt;br /&gt;
&lt;br /&gt;
[[Image:xen3_vm_live_migrating_1.png|thumb|center|700px|View of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0001_ws1&amp;lt;/span&amp;gt; being live migrated to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt; from &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt; with a ping-flood running via an &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ssh&amp;lt;/span&amp;gt; session.]]&lt;br /&gt;
&lt;br /&gt;
This should tickle your geek glands.&lt;br /&gt;
&lt;br /&gt;
==== How to &amp;quot;Pull the Power&amp;quot; on a VM ====&lt;br /&gt;
&lt;br /&gt;
If something happens to the VM and you can&#039;t shut it down, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virsh&amp;lt;/span&amp;gt; provides a command that is the equivalent of pulling the power on a physical server. This command forces the virtual server off without giving the VM a chance to react at all. For obvious reasons, you will want to be somewhat careful in using this as it has all the same potential for problems as killing the power of a real server.&lt;br /&gt;
&lt;br /&gt;
So to &amp;quot;pull the plug&amp;quot;, you can run this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
virsh destroy vm0001_ws1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Domain vm0001_ws1 destroyed&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The VM is still defined, but it&#039;s no longer running.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
virsh list --all&lt;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 Name                 State&lt;br /&gt;
----------------------------------&lt;br /&gt;
  0 Domain-0             running&lt;br /&gt;
  - vm0001_ws1           shut off&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== How to Delete a VM and Start Over ====&lt;br /&gt;
&lt;br /&gt;
{{note|1=It is &#039;&#039;very&#039;&#039; likely that you will run into problems when you first start trying to provision your VM. If you want to delete the VM and start over, the way to do it is with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virsh&amp;lt;/span&amp;gt;, the virtual shell.}}&lt;br /&gt;
&lt;br /&gt;
Check that it&#039;s there.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
virsh list --all&lt;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 Name                 State&lt;br /&gt;
----------------------------------&lt;br /&gt;
  0 Domain-0             running&lt;br /&gt;
  - vm0001_ws1           shut off&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Undefine&amp;quot; it, which deletes it from Xen.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
virsh undefine vm0001_ws1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Domain vm0001_ws1 has been undefined&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Confirm that it is gone.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
virsh list --all&lt;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 Name                 State&lt;br /&gt;
----------------------------------&lt;br /&gt;
  0 Domain-0             running&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now you can try again.&lt;br /&gt;
&lt;br /&gt;
=== Hardware Virtual Machine ===&lt;br /&gt;
&lt;br /&gt;
Most modern processors come with support for &amp;quot;hardware assisted virtualization&amp;quot;, which Xen calls &amp;quot;Hardware Virtual Machine&amp;quot; or &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;hvm&amp;lt;/span&amp;gt; or &amp;quot;Secure Virtual Machine&amp;quot; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;svm&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
HVM requires special support in the CPU in order for it to be used in Xen. Intel processors implement this under the name VT-x and AMD implements this under the name AMD-V. Some motherboards will disable this feature by default, requiring the user to edit the BIOS of their mainboard. &lt;br /&gt;
&lt;br /&gt;
If you try to provision an &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;hvm&amp;lt;/span&amp;gt; and receive an error about it not being supported by the host, consult your system board documentation for information on enabling hardware virtualization.&lt;br /&gt;
&lt;br /&gt;
To check if you have &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;hvm&amp;lt;/span&amp;gt; enabled, run &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xm info&amp;lt;/span&amp;gt; and check the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xen_caps&amp;lt;/span&amp;gt; line for entries starting with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;hvm&amp;lt;/span&amp;gt;. If you do not see any &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;hvm&amp;lt;/span&amp;gt; entries, then it is likely not enabled.&lt;br /&gt;
&lt;br /&gt;
{{note|1=The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xm info&amp;lt;/span&amp;gt; only works when running a Xen kernel. With a vanilla kernel, consult &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/proc/cpuinfo&amp;lt;/span&amp;gt;.}}&lt;br /&gt;
&lt;br /&gt;
Below is the output of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xm info&amp;lt;/span&amp;gt; with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;hvm&amp;lt;/span&amp;gt; &#039;&#039;enabled&#039;&#039; in the host BIOS.&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.18-238.9.1.el5xen&lt;br /&gt;
version                : #1 SMP Tue Apr 12 18:53:56 EDT 2011&lt;br /&gt;
machine                : x86_64&lt;br /&gt;
nr_cpus                : 4&lt;br /&gt;
nr_nodes               : 1&lt;br /&gt;
sockets_per_node       : 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                : 178bfbff:efd3fbff:00000000:00000110:00802009:00000000:000037ff&lt;br /&gt;
total_memory           : 4062&lt;br /&gt;
free_memory            : 1048&lt;br /&gt;
node_to_cpu            : node0:0-3&lt;br /&gt;
xen_major              : 3&lt;br /&gt;
xen_minor              : 1&lt;br /&gt;
xen_extra              : .2-238.9.1.el5&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_pagesize           : 4096&lt;br /&gt;
platform_params        : virt_start=0xffff800000000000&lt;br /&gt;
xen_changeset          : unavailable&lt;br /&gt;
cc_compiler            : gcc version 4.1.2 20080704 (Red Hat 4.1.2-50)&lt;br /&gt;
cc_compile_by          : mockbuild&lt;br /&gt;
cc_compile_domain      : centos.org&lt;br /&gt;
cc_compile_date        : Tue Apr 12 18:01:03 EDT 2011&lt;br /&gt;
xend_config_format     : 2&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;hvm&amp;lt;/span&amp;gt; &#039;&#039;disabled&#039;&#039; in the BIOS. Note the missing &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;hvm&amp;lt;/span&amp;gt; entries on the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xen_caps&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;
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-node05.alteeve.com&lt;br /&gt;
release                : 2.6.18-238.9.1.el5xen&lt;br /&gt;
version                : #1 SMP Tue Apr 12 18:53:56 EDT 2011&lt;br /&gt;
machine                : x86_64&lt;br /&gt;
nr_cpus                : 4&lt;br /&gt;
nr_nodes               : 1&lt;br /&gt;
sockets_per_node       : 1&lt;br /&gt;
cores_per_socket       : 4&lt;br /&gt;
threads_per_core       : 1&lt;br /&gt;
cpu_mhz                : 2200&lt;br /&gt;
hw_caps                : 178bfbff:efd3fbff:00000000:00000110:00802009:00000000:000037ff&lt;br /&gt;
total_memory           : 3838&lt;br /&gt;
free_memory            : 383&lt;br /&gt;
node_to_cpu            : node0:0-3&lt;br /&gt;
xen_major              : 3&lt;br /&gt;
xen_minor              : 1&lt;br /&gt;
xen_extra              : .2-238.9.1.el5&lt;br /&gt;
xen_caps               : xen-3.0-x86_64 xen-3.0-x86_32p &lt;br /&gt;
xen_pagesize           : 4096&lt;br /&gt;
platform_params        : virt_start=0xffff800000000000&lt;br /&gt;
xen_changeset          : unavailable&lt;br /&gt;
cc_compiler            : gcc version 4.1.2 20080704 (Red Hat 4.1.2-50)&lt;br /&gt;
cc_compile_by          : mockbuild&lt;br /&gt;
cc_compile_domain      : centos.org&lt;br /&gt;
cc_compile_date        : Tue Apr 12 18:01:03 EDT 2011&lt;br /&gt;
xend_config_format     : 2&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you try to provision an &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;hvm&amp;lt;/span&amp;gt; machine with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;hvm&amp;lt;/span&amp;gt; disabled, you will see the error below.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
virt-install --connect xen ... --hvm&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
ERROR    Host does not support virtualization type &#039;hvm&#039; for arch &#039;x86_64&#039;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{note|1=When installing from an [[ISO]], you must use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;hvm&amp;lt;/span&amp;gt; or full virtualization.}}&lt;br /&gt;
&lt;br /&gt;
=== Provisioning vm0002_win1; A Windows Server ===&lt;br /&gt;
&lt;br /&gt;
We&#039;re going to provision a [[Microsoft]] Windows 2008 server this time. This will largely be the same process as with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0001_ws1&amp;lt;/span&amp;gt;. The main differences is that we&#039;ll be installing from an [[ISO]] file which was copied into &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/xen_shared/iso/Win_Server_2008_Bis_x86_64.iso&amp;lt;/span&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
Microsoft Windows is commercial software. You will need a proper license to use it in production, but you can [http://www.microsoft.com/windowsserver2008/en/us/trial-software.aspx download a trial] version, which will be sufficient to follow along with this tutorial. &lt;br /&gt;
&lt;br /&gt;
{{note|1=You may find it useful to create an &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/xen_shared/iso&amp;lt;/span&amp;gt; folder to store ISO files in.}}&lt;br /&gt;
&lt;br /&gt;
We won&#039;t go over all the details again, but we will show all the specific commands.&lt;br /&gt;
&lt;br /&gt;
First, create the [[LV]] for this new VM.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
lvcreate -l 100%FREE -n vm0002_1 --addtag @an-cluster01 /dev/drbd_an5_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;vm0002_1&amp;quot; created&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we need to craft the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-install&amp;lt;/span&amp;gt; provision command. Some key differences are that we&#039;re going to create a &amp;quot;hardware virtualized machine&amp;quot;, known as &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;hvm&amp;lt;/span&amp;gt;, which requires support in the CPU. We&#039;ll also directly boot off of a DVD [[ISO]], as if we had put a DVD in a drive and booted from it on a real server. We also need to change the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--os-type&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--os-variant&amp;lt;/span&amp;gt; values to windows as well.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&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;
virt-install --connect xen \&lt;br /&gt;
        --name vm0002_win1 \&lt;br /&gt;
        --ram 1048 \&lt;br /&gt;
        --arch x86_64 \&lt;br /&gt;
        --vcpus 1 \&lt;br /&gt;
        --cpuset 1-3 \&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_an5_vg0/vm0002_1 \&lt;br /&gt;
        --network bridge=xenbr0 \&lt;br /&gt;
        --vnc \&lt;br /&gt;
        --hvm&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Image:Installing_Win2008_VM_01.png|thumb|700px|center|Starting the install of Windows 2008 R2 as a virtual machine]]&lt;br /&gt;
&lt;br /&gt;
I like to close the default VNC session and flip over to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-manager&amp;lt;/span&amp;gt;. This is what you should see if you do the same.&lt;br /&gt;
&lt;br /&gt;
[[Image:Installing_Win2008_VM_via_virt-manager_02.png|thumb|700px|center|Monitoring the install of Windows 2008 R2 via &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-manager&amp;lt;/span&amp;gt;.]]&lt;br /&gt;
&lt;br /&gt;
As before, let the install finish before proceeding. Once the install is completed and you&#039;ve booted for the first time, dump the configuration to an XML file, define it on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt; and update the backups on either node&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/root/&amp;lt;/span&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
Dump the XML definition.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
virsh dumpxml vm0002_win1 &amp;gt; /xen_shared/definitions/vm0002_win1.xml&lt;br /&gt;
ls -lah /xen_shared/definitions/vm0002_win1.xml&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
-rw-r--r-- 1 root root 1.5K May 14 23:27 /xen_shared/definitions/vm0002_win1.xml&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Define the VM on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&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;
virsh define /xen_shared/definitions/vm0002_win1.xml &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Domain vm0002_win1 defined from /xen_shared/definitions/vm0002_win1.xml&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Backup the new VM definition on each node.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
rsync -av /xen_shared/definitions ~/&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
building file list ... done&lt;br /&gt;
definitions/&lt;br /&gt;
definitions/vm0002_win1.xml&lt;br /&gt;
&lt;br /&gt;
sent 1646 bytes  received 48 bytes  3388.00 bytes/sec&lt;br /&gt;
total size is 2446  speedup is 1.44&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Image:Installing_Win2008_VM_via_virt-manager_03.png|thumb|700px|center|Seeing the Windows 2008 R2 on both nodes via &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-manager&amp;lt;/span&amp;gt;.]]&lt;br /&gt;
&lt;br /&gt;
Now we see both VMs defined on both nodes!&lt;br /&gt;
&lt;br /&gt;
= Making Our VMs Highly Available Cluster Services =&lt;br /&gt;
&lt;br /&gt;
We&#039;re ready to start the final step; Making our VMs highly available via cluster management! This involves two major steps:&lt;br /&gt;
* Creating two new, ordered failover Domains; One with each node as the highest priority.&lt;br /&gt;
* Adding our VMs as services, one is each new failover domain.&lt;br /&gt;
&lt;br /&gt;
== Creating the Ordered Failover Domains ==&lt;br /&gt;
&lt;br /&gt;
The idea here is that each new failover domain will have one node with a higher priority than the other. That is, one will have &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt; with the highest priority and the other will have &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt; as the highest. This way, VMs that we want to normally run on a given node will be added to the matching failover domain.&lt;br /&gt;
&lt;br /&gt;
To add the two new failover domains, we&#039;ll add the following to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/cluster/cluster.conf&amp;lt;/span&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
              &amp;lt;failoverdomains&amp;gt;&lt;br /&gt;
                        ...&lt;br /&gt;
                        &amp;lt;failoverdomain name=&amp;quot;an4_primary&amp;quot; nofailback=&amp;quot;0&amp;quot; ordered=&amp;quot;1&amp;quot; restricted=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
                                &amp;lt;failoverdomainnode name=&amp;quot;an-node04.alteeve.com&amp;quot; priority=&amp;quot;1&amp;quot;/&amp;gt;&lt;br /&gt;
                                &amp;lt;failoverdomainnode name=&amp;quot;an-node05.alteeve.com&amp;quot; priority=&amp;quot;2&amp;quot;/&amp;gt;&lt;br /&gt;
                        &amp;lt;/failoverdomain&amp;gt;&lt;br /&gt;
                        &amp;lt;failoverdomain name=&amp;quot;an5_primary&amp;quot; nofailback=&amp;quot;0&amp;quot; ordered=&amp;quot;1&amp;quot; restricted=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
                                &amp;lt;failoverdomainnode name=&amp;quot;an-node04.alteeve.com&amp;quot; priority=&amp;quot;2&amp;quot;/&amp;gt;&lt;br /&gt;
                                &amp;lt;failoverdomainnode name=&amp;quot;an-node05.alteeve.com&amp;quot; priority=&amp;quot;1&amp;quot;/&amp;gt;&lt;br /&gt;
                        &amp;lt;/failoverdomain&amp;gt;&lt;br /&gt;
              &amp;lt;/failoverdomains&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As always, validate it. We&#039;ll see here what the complete file now looks like. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
xmllint --relaxng /usr/share/system-config-cluster/misc/cluster.ng /etc/cluster/cluster.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&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-cluster01&amp;quot; config_version=&amp;quot;14&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;cman expected_votes=&amp;quot;1&amp;quot; two_node=&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-node04.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;fence_na01&amp;quot; port=&amp;quot;04&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-node05.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;fence_na01&amp;quot; port=&amp;quot;03&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 agent=&amp;quot;fence_na&amp;quot; ipaddr=&amp;quot;fence_na01.alteeve.com&amp;quot; login=&amp;quot;admin&amp;quot; name=&amp;quot;fence_na01&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;fence_daemon post_join_delay=&amp;quot;60&amp;quot;/&amp;gt;&lt;br /&gt;
        &amp;lt;totem rrp_mode=&amp;quot;none&amp;quot; secauth=&amp;quot;off&amp;quot;/&amp;gt;&lt;br /&gt;
        &amp;lt;rm&amp;gt;&lt;br /&gt;
                &amp;lt;resources&amp;gt;&lt;br /&gt;
                        &amp;lt;script file=&amp;quot;/etc/init.d/drbd&amp;quot; name=&amp;quot;drbd&amp;quot;/&amp;gt;&lt;br /&gt;
                        &amp;lt;script file=&amp;quot;/etc/init.d/clvmd&amp;quot; name=&amp;quot;clvmd&amp;quot;/&amp;gt;&lt;br /&gt;
                        &amp;lt;script file=&amp;quot;/etc/init.d/gfs2&amp;quot; name=&amp;quot;gfs2&amp;quot;/&amp;gt;&lt;br /&gt;
                &amp;lt;/resources&amp;gt;&lt;br /&gt;
		&amp;lt;failoverdomains&amp;gt;&lt;br /&gt;
			&amp;lt;failoverdomain name=&amp;quot;an4_only&amp;quot; nofailback=&amp;quot;0&amp;quot; ordered=&amp;quot;0&amp;quot; restricted=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
				&amp;lt;failoverdomainnode name=&amp;quot;an-node04.alteeve.com&amp;quot; priority=&amp;quot;1&amp;quot;/&amp;gt;&lt;br /&gt;
			&amp;lt;/failoverdomain&amp;gt;&lt;br /&gt;
			&amp;lt;failoverdomain name=&amp;quot;an5_only&amp;quot; nofailback=&amp;quot;0&amp;quot; ordered=&amp;quot;0&amp;quot; restricted=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
				&amp;lt;failoverdomainnode name=&amp;quot;an-node05.alteeve.com&amp;quot; priority=&amp;quot;1&amp;quot;/&amp;gt;&lt;br /&gt;
			&amp;lt;/failoverdomain&amp;gt;&lt;br /&gt;
			&amp;lt;failoverdomain name=&amp;quot;an4_primary&amp;quot; nofailback=&amp;quot;0&amp;quot; ordered=&amp;quot;1&amp;quot; restricted=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
				&amp;lt;failoverdomainnode name=&amp;quot;an-node04.alteeve.com&amp;quot; priority=&amp;quot;1&amp;quot;/&amp;gt;&lt;br /&gt;
				&amp;lt;failoverdomainnode name=&amp;quot;an-node05.alteeve.com&amp;quot; priority=&amp;quot;2&amp;quot;/&amp;gt;&lt;br /&gt;
			&amp;lt;/failoverdomain&amp;gt;&lt;br /&gt;
			&amp;lt;failoverdomain name=&amp;quot;an5_primary&amp;quot; nofailback=&amp;quot;0&amp;quot; ordered=&amp;quot;1&amp;quot; restricted=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
				&amp;lt;failoverdomainnode name=&amp;quot;an-node04.alteeve.com&amp;quot; priority=&amp;quot;2&amp;quot;/&amp;gt;&lt;br /&gt;
				&amp;lt;failoverdomainnode name=&amp;quot;an-node05.alteeve.com&amp;quot; priority=&amp;quot;1&amp;quot;/&amp;gt;&lt;br /&gt;
			&amp;lt;/failoverdomain&amp;gt;&lt;br /&gt;
		&amp;lt;/failoverdomains&amp;gt;&lt;br /&gt;
		&amp;lt;service autostart=&amp;quot;0&amp;quot; domain=&amp;quot;an4_only&amp;quot; exclusive=&amp;quot;0&amp;quot; max_restarts=&amp;quot;0&amp;quot; name=&amp;quot;an4_storage&amp;quot; recovery=&amp;quot;restart&amp;quot; restart_expire_time=&amp;quot;0&amp;quot;&amp;gt;&lt;br /&gt;
			&amp;lt;script ref=&amp;quot;drbd&amp;quot;&amp;gt;&lt;br /&gt;
				&amp;lt;script ref=&amp;quot;clvmd&amp;quot;&amp;gt;&lt;br /&gt;
					&amp;lt;script ref=&amp;quot;gfs2&amp;quot;/&amp;gt;&lt;br /&gt;
				&amp;lt;/script&amp;gt;&lt;br /&gt;
			&amp;lt;/script&amp;gt;&lt;br /&gt;
		&amp;lt;/service&amp;gt;&lt;br /&gt;
		&amp;lt;service autostart=&amp;quot;0&amp;quot; domain=&amp;quot;an5_only&amp;quot; exclusive=&amp;quot;0&amp;quot; max_restarts=&amp;quot;0&amp;quot; name=&amp;quot;an5_storage&amp;quot; recovery=&amp;quot;restart&amp;quot; restart_expire_time=&amp;quot;0&amp;quot;&amp;gt;&lt;br /&gt;
			&amp;lt;script ref=&amp;quot;drbd&amp;quot;&amp;gt;&lt;br /&gt;
				&amp;lt;script ref=&amp;quot;clvmd&amp;quot;&amp;gt;&lt;br /&gt;
					&amp;lt;script ref=&amp;quot;gfs2&amp;quot;/&amp;gt;&lt;br /&gt;
				&amp;lt;/script&amp;gt;&lt;br /&gt;
			&amp;lt;/script&amp;gt;&lt;br /&gt;
		&amp;lt;/service&amp;gt;&lt;br /&gt;
        &amp;lt;/rm&amp;gt;&lt;br /&gt;
&amp;lt;/cluster&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;
/etc/cluster/cluster.conf validates&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With it validating, push it to the other node.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ccs_tool update /etc/cluster/cluster.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;
Config file updated from version 13 to 14&lt;br /&gt;
&lt;br /&gt;
Update complete.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Adding The VMs To rgmanager ==&lt;br /&gt;
&lt;br /&gt;
This is where we tell &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; which VMs we want to run on which nodes when both are online.&lt;br /&gt;
&lt;br /&gt;
{{note|1=There is a bit of a trick when using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; with our cluster. There is no real way to delay the start of virtual machines until after the storage services are online. The side effect of this is that, if the VMs are set to automatically start with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt;, the VMs will fail because their underlying storage takes too long to come online. For this reason, we will not configure them to start automatically.}}&lt;br /&gt;
&lt;br /&gt;
=== Creating the vm:&amp;lt;domu&amp;gt; Resources ===&lt;br /&gt;
&lt;br /&gt;
Virtual machine services are a special-case in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt;, and have their own &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;vm .../&amp;gt;&amp;lt;/span&amp;gt; tag. Here are the two we will be adding for the two VMs we created in the previous section.&lt;br /&gt;
&lt;br /&gt;
{{warning|1=Make sure that the VMs are shut down before adding them to the cluster! Otherwise &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; will restart them when you first enable the new &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;vm /&amp;gt;&amp;lt;/span&amp;gt; resources.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;rm&amp;gt;&lt;br /&gt;
                ...&lt;br /&gt;
                &amp;lt;vm name=&amp;quot;vm0001_ws1&amp;quot; domain=&amp;quot;an4_primary&amp;quot; path=&amp;quot;/xen_shared/definitions/&amp;quot;&lt;br /&gt;
                 autostart=&amp;quot;0&amp;quot; exclusive=&amp;quot;0&amp;quot; recovery=&amp;quot;restart&amp;quot; max_restarts=&amp;quot;2&amp;quot; restart_expire_time=&amp;quot;600&amp;quot;/&amp;gt;&lt;br /&gt;
                &amp;lt;vm name=&amp;quot;vm0002_win1&amp;quot; domain=&amp;quot;an5_primary&amp;quot; path=&amp;quot;/xen_shared/definitions/&amp;quot;&lt;br /&gt;
                 autostart=&amp;quot;0&amp;quot; exclusive=&amp;quot;0&amp;quot; recovery=&amp;quot;restart&amp;quot; max_restarts=&amp;quot;2&amp;quot; restart_expire_time=&amp;quot;600&amp;quot;/&amp;gt;&lt;br /&gt;
        &amp;lt;/rm&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The attributes are:&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;name&amp;lt;/span&amp;gt;; This is the name of the VM and must match the name of the VM shown by &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virsh list&amp;lt;/span&amp;gt; as well as the definition file name, minus the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;.xml&amp;lt;/span&amp;gt; suffix.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;domain&amp;lt;/span&amp;gt;; This is the name of the failover domain that this VM will operate within.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;path&amp;lt;/span&amp;gt;; This is the full path to where the VM definition files are kept. It &#039;&#039;&#039;is not&#039;&#039;&#039; the full path to the actual definition file itself!&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;autostart&amp;lt;/span&amp;gt;; As mentioned above, we do not want the VMs to automatically start with the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt;, so we set this to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;0&amp;lt;/span&amp;gt;.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;exclusive&amp;lt;/span&amp;gt;; When set, this will prevent &#039;&#039;&#039;any&#039;&#039;&#039; other service from running on the node. This would take out the storage services, so this &#039;&#039;&#039;must&#039;&#039;&#039; be set to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;0&amp;lt;/span&amp;gt;.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;recovery&amp;lt;/span&amp;gt;; This is how the VM should be recovered after it crashes. The options are &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;restart&amp;lt;/span&amp;gt;, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;relocate&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;disable&amp;lt;/span&amp;gt;.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;max_restarts&amp;lt;/span&amp;gt;; This is how many times the VM is allowed to be restarted (from a crash) before the VM is migrated to another node in the failover domain. The idea here is that, normally, we simply want to restart the VM in-place if the VM itself crashed and the underlying node is healthy. However, once the VM restarts this number a times, we assume that there is actually a problem with the VM running on the current node, so we want to give up and move the VM to another node. We will use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;2&amp;lt;/span&amp;gt; restarts before switching to a migration.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;restart_expire_time&amp;lt;/span&amp;gt;; Whenever a VM is restarted, a counter is incremented, which is compared against &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;max_restarts&amp;lt;/span&amp;gt;. After this many seconds, that restart is &amp;quot;forgotten&amp;quot; and the restart counter is reduced by one. With our value of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;600&amp;lt;/span&amp;gt; seconds (10 minutes) and a &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;max_restarts&amp;lt;/span&amp;gt; of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;2&amp;lt;/span&amp;gt;, the VM will be relocated instead of restarted after the third crash in ten minutes.&lt;br /&gt;
&lt;br /&gt;
Again, validate it. We&#039;ll see here what the complete file now looks like. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
xmllint --relaxng /usr/share/system-config-cluster/misc/cluster.ng /etc/cluster/cluster.conf&lt;br /&gt;
&amp;lt;/source&amp;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-cluster01&amp;quot; config_version=&amp;quot;15&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;cman expected_votes=&amp;quot;1&amp;quot; two_node=&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-node04.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;fence_na01&amp;quot; port=&amp;quot;04&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-node05.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;fence_na01&amp;quot; port=&amp;quot;03&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 agent=&amp;quot;fence_na&amp;quot; ipaddr=&amp;quot;fence_na01.alteeve.com&amp;quot; login=&amp;quot;admin&amp;quot; name=&amp;quot;fence_na01&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;fence_daemon post_join_delay=&amp;quot;60&amp;quot;/&amp;gt;&lt;br /&gt;
        &amp;lt;totem rrp_mode=&amp;quot;none&amp;quot; secauth=&amp;quot;off&amp;quot;/&amp;gt;&lt;br /&gt;
        &amp;lt;rm&amp;gt;&lt;br /&gt;
                &amp;lt;resources&amp;gt;&lt;br /&gt;
                        &amp;lt;script file=&amp;quot;/etc/init.d/drbd&amp;quot; name=&amp;quot;drbd&amp;quot;/&amp;gt;&lt;br /&gt;
                        &amp;lt;script file=&amp;quot;/etc/init.d/clvmd&amp;quot; name=&amp;quot;clvmd&amp;quot;/&amp;gt;&lt;br /&gt;
                        &amp;lt;script file=&amp;quot;/etc/init.d/gfs2&amp;quot; name=&amp;quot;gfs2&amp;quot;/&amp;gt;&lt;br /&gt;
                &amp;lt;/resources&amp;gt;&lt;br /&gt;
		&amp;lt;failoverdomains&amp;gt;&lt;br /&gt;
			&amp;lt;failoverdomain name=&amp;quot;an4_only&amp;quot; nofailback=&amp;quot;0&amp;quot; ordered=&amp;quot;0&amp;quot; restricted=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
				&amp;lt;failoverdomainnode name=&amp;quot;an-node04.alteeve.com&amp;quot; priority=&amp;quot;1&amp;quot;/&amp;gt;&lt;br /&gt;
			&amp;lt;/failoverdomain&amp;gt;&lt;br /&gt;
			&amp;lt;failoverdomain name=&amp;quot;an5_only&amp;quot; nofailback=&amp;quot;0&amp;quot; ordered=&amp;quot;0&amp;quot; restricted=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
				&amp;lt;failoverdomainnode name=&amp;quot;an-node05.alteeve.com&amp;quot; priority=&amp;quot;1&amp;quot;/&amp;gt;&lt;br /&gt;
			&amp;lt;/failoverdomain&amp;gt;&lt;br /&gt;
			&amp;lt;failoverdomain name=&amp;quot;an4_primary&amp;quot; nofailback=&amp;quot;0&amp;quot; ordered=&amp;quot;1&amp;quot; restricted=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
				&amp;lt;failoverdomainnode name=&amp;quot;an-node04.alteeve.com&amp;quot; priority=&amp;quot;1&amp;quot;/&amp;gt;&lt;br /&gt;
				&amp;lt;failoverdomainnode name=&amp;quot;an-node05.alteeve.com&amp;quot; priority=&amp;quot;2&amp;quot;/&amp;gt;&lt;br /&gt;
			&amp;lt;/failoverdomain&amp;gt;&lt;br /&gt;
			&amp;lt;failoverdomain name=&amp;quot;an5_primary&amp;quot; nofailback=&amp;quot;0&amp;quot; ordered=&amp;quot;1&amp;quot; restricted=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
				&amp;lt;failoverdomainnode name=&amp;quot;an-node04.alteeve.com&amp;quot; priority=&amp;quot;2&amp;quot;/&amp;gt;&lt;br /&gt;
				&amp;lt;failoverdomainnode name=&amp;quot;an-node05.alteeve.com&amp;quot; priority=&amp;quot;1&amp;quot;/&amp;gt;&lt;br /&gt;
			&amp;lt;/failoverdomain&amp;gt;&lt;br /&gt;
		&amp;lt;/failoverdomains&amp;gt;&lt;br /&gt;
		&amp;lt;service autostart=&amp;quot;0&amp;quot; domain=&amp;quot;an4_only&amp;quot; exclusive=&amp;quot;0&amp;quot; max_restarts=&amp;quot;0&amp;quot; name=&amp;quot;an4_storage&amp;quot; recovery=&amp;quot;restart&amp;quot; restart_expire_time=&amp;quot;0&amp;quot;&amp;gt;&lt;br /&gt;
			&amp;lt;script ref=&amp;quot;drbd&amp;quot;&amp;gt;&lt;br /&gt;
				&amp;lt;script ref=&amp;quot;clvmd&amp;quot;&amp;gt;&lt;br /&gt;
					&amp;lt;script ref=&amp;quot;gfs2&amp;quot;/&amp;gt;&lt;br /&gt;
				&amp;lt;/script&amp;gt;&lt;br /&gt;
			&amp;lt;/script&amp;gt;&lt;br /&gt;
		&amp;lt;/service&amp;gt;&lt;br /&gt;
		&amp;lt;service autostart=&amp;quot;0&amp;quot; domain=&amp;quot;an5_only&amp;quot; exclusive=&amp;quot;0&amp;quot; max_restarts=&amp;quot;0&amp;quot; name=&amp;quot;an5_storage&amp;quot; recovery=&amp;quot;restart&amp;quot; restart_expire_time=&amp;quot;0&amp;quot;&amp;gt;&lt;br /&gt;
			&amp;lt;script ref=&amp;quot;drbd&amp;quot;&amp;gt;&lt;br /&gt;
				&amp;lt;script ref=&amp;quot;clvmd&amp;quot;&amp;gt;&lt;br /&gt;
					&amp;lt;script ref=&amp;quot;gfs2&amp;quot;/&amp;gt;&lt;br /&gt;
				&amp;lt;/script&amp;gt;&lt;br /&gt;
			&amp;lt;/script&amp;gt;&lt;br /&gt;
		&amp;lt;/service&amp;gt;&lt;br /&gt;
                &amp;lt;vm name=&amp;quot;vm0001_ws1&amp;quot; domain=&amp;quot;an4_primary&amp;quot; path=&amp;quot;/xen_shared/definitions/&amp;quot; autostart=&amp;quot;0&amp;quot; exclusive=&amp;quot;0&amp;quot; recovery=&amp;quot;restart&amp;quot; max_restarts=&amp;quot;2&amp;quot; restart_expire_time=&amp;quot;600&amp;quot;/&amp;gt;&lt;br /&gt;
                &amp;lt;vm name=&amp;quot;vm0002_win1&amp;quot; domain=&amp;quot;an5_primary&amp;quot; path=&amp;quot;/xen_shared/definitions/&amp;quot; autostart=&amp;quot;0&amp;quot; exclusive=&amp;quot;0&amp;quot; recovery=&amp;quot;restart&amp;quot; max_restarts=&amp;quot;2&amp;quot; restart_expire_time=&amp;quot;600&amp;quot;/&amp;gt;&lt;br /&gt;
        &amp;lt;/rm&amp;gt;&lt;br /&gt;
&amp;lt;/cluster&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;
/etc/cluster/cluster.conf validates&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now push the updated configuration out.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ccs_tool update /etc/cluster/cluster.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;
Config file updated from version 14 to 15&lt;br /&gt;
&lt;br /&gt;
Update complete.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{note|1=You can use migration mapping to map hostnames to names resolved to other interfaces on the host by adding &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;vm ... migration_mapping=&amp;quot;an-node01.alteeve.com:an-node01.bcn,an-node02.alteeve.com:an-node02.bcn&amp;quot;&amp;lt;/span&amp;gt;. Thanks to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;thomas_s&amp;lt;/span&amp;gt; on the Freenode &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;#linux-cluster&amp;lt;/span&amp;gt; IRC channel for pointing this out.}}&lt;br /&gt;
&lt;br /&gt;
=== Using the new VM Resources ===&lt;br /&gt;
&lt;br /&gt;
{{note|1=We&#039;ll be running all of the commands in this section on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt;.}}&lt;br /&gt;
&lt;br /&gt;
If you now run &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clustat&amp;lt;/span&amp;gt; on either node, you should see the new VM resources.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
clustat &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Cluster Status for an-cluster01 @ Sun May 15 12:36:10 2011&lt;br /&gt;
Member Status: Quorate&lt;br /&gt;
&lt;br /&gt;
 Member Name                             ID   Status&lt;br /&gt;
 ------ ----                             ---- ------&lt;br /&gt;
 an-node04.alteeve.com                       1 Online, Local, rgmanager&lt;br /&gt;
 an-node05.alteeve.com                       2 Online, rgmanager&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State         &lt;br /&gt;
 ------- ----                   ----- ------                   -----         &lt;br /&gt;
 service:an4_storage            an-node04.alteeve.com          started       &lt;br /&gt;
 service:an5_storage            an-node05.alteeve.com          started       &lt;br /&gt;
 vm:vm0001_ws1                  (none)                         disabled      &lt;br /&gt;
 vm:vm0002_win1                 (none)                         disabled      &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we can start the VMs using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt;!&lt;br /&gt;
&lt;br /&gt;
{{note|1=As we&#039;ll be starting a non-standard, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm&amp;lt;/span&amp;gt; service, we need to type out the full service name, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm:domu&amp;lt;/span&amp;gt;.}}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt;&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
clusvcadm -e vm:vm0001_ws1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Local machine trying to enable vm:vm0001_ws1...Success&lt;br /&gt;
vm:vm0001_ws1 is now running on an-node04.alteeve.com&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you check with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virsh&amp;lt;/span&amp;gt;, you&#039;ll see it running now.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
virsh list --all&lt;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 Name                 State&lt;br /&gt;
----------------------------------&lt;br /&gt;
  0 Domain-0             running&lt;br /&gt;
  1 vm0001_ws1           running&lt;br /&gt;
  - vm0002_win1          shut off&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Likewise, if you check &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clustat&amp;lt;/span&amp;gt; from either node, you will see the new VM service running on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&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;
clustat &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Cluster Status for an-cluster01 @ Sun May 15 12:38:38 2011&lt;br /&gt;
Member Status: Quorate&lt;br /&gt;
&lt;br /&gt;
 Member Name                             ID   Status&lt;br /&gt;
 ------ ----                             ---- ------&lt;br /&gt;
 an-node04.alteeve.com                       1 Online, Local, rgmanager&lt;br /&gt;
 an-node05.alteeve.com                       2 Online, rgmanager&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State         &lt;br /&gt;
 ------- ----                   ----- ------                   -----         &lt;br /&gt;
 service:an4_storage            an-node04.alteeve.com          started       &lt;br /&gt;
 service:an5_storage            an-node05.alteeve.com          started       &lt;br /&gt;
 vm:vm0001_ws1                  an-node04.alteeve.com          started       &lt;br /&gt;
 vm:vm0002_win1                 (none)                         disabled      &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So far, so good. Now let&#039;s start the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0002_win1&amp;lt;/span&amp;gt; VM.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt;&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
clusvcadm -e vm:vm0002_win1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Local machine trying to enable vm:vm0002_win1...Success&lt;br /&gt;
vm:vm0002_win1 is now running on an-node04.alteeve.com&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It started, but it didn&#039;t start on the node we normally want!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
clustat &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Cluster Status for an-cluster01 @ Sun May 15 12:40:21 2011&lt;br /&gt;
Member Status: Quorate&lt;br /&gt;
&lt;br /&gt;
 Member Name                             ID   Status&lt;br /&gt;
 ------ ----                             ---- ------&lt;br /&gt;
 an-node04.alteeve.com                       1 Online, Local, rgmanager&lt;br /&gt;
 an-node05.alteeve.com                       2 Online, rgmanager&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State         &lt;br /&gt;
 ------- ----                   ----- ------                   -----         &lt;br /&gt;
 service:an4_storage            an-node04.alteeve.com          started       &lt;br /&gt;
 service:an5_storage            an-node05.alteeve.com          started       &lt;br /&gt;
 vm:vm0001_ws1                  an-node04.alteeve.com          started       &lt;br /&gt;
 vm:vm0002_win1                 an-node04.alteeve.com          started       &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;vm0002_win1&amp;lt;/span&amp;gt; VM started on the node that the command was executed from. We could have added &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;-m an-node05.alteeve.com&amp;lt;/span&amp;gt; to the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clusvcadm&amp;lt;/span&amp;gt;, which we&#039;ll do later. It&#039;s already running though, so lets use this &amp;quot;mistake&amp;quot; as a chance to look at migrating the VM using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clusvcadm&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
So to tell &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; to perform a live migration from &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt; to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt;, use the special &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;-M&amp;lt;/span&amp;gt; live migration switch along with the normal &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;-m&amp;lt;/span&amp;gt; target cluster member switch. For more information on these switches, please take a few minutes to read &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;man clusvcadm&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
{{note|1=If you want to watch the VM as it migrates, you will need to use a program that connects to the server via it&#039;s IP address, as opposed to using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-manager&amp;lt;/span&amp;gt;. The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-manager&amp;lt;/span&amp;gt; connections are bound to the dom0 and will close once the VM moves to the other node. For Linux machines, you can connect using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ssh&amp;lt;/span&amp;gt; or &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vnc&amp;lt;/span&amp;gt; (by IP). For windows, you can connect using RDP (remote desktop protocol) using a program like &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;tsclient&amp;lt;/span&amp;gt; from Linux machines.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
clusvcadm -M vm:vm0002_win1 -m an-node05.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;
Trying to migrate vm:vm0002_win1 to an-node05.alteeve.com...Success&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we can use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clustat&amp;lt;/span&amp;gt; to see that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm:vm0002_win1&amp;lt;/span&amp;gt; service is now running on the proper &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05.alteeve.com&amp;lt;/span&amp;gt; node.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
clustat &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Cluster Status for an-cluster01 @ Sun May 15 12:53:30 2011&lt;br /&gt;
Member Status: Quorate&lt;br /&gt;
&lt;br /&gt;
 Member Name                             ID   Status&lt;br /&gt;
 ------ ----                             ---- ------&lt;br /&gt;
 an-node04.alteeve.com                       1 Online, Local, rgmanager&lt;br /&gt;
 an-node05.alteeve.com                       2 Online, rgmanager&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State         &lt;br /&gt;
 ------- ----                   ----- ------                   -----         &lt;br /&gt;
 service:an4_storage            an-node04.alteeve.com          started       &lt;br /&gt;
 service:an5_storage            an-node05.alteeve.com          started       &lt;br /&gt;
 vm:vm0001_ws1                  an-node04.alteeve.com          started       &lt;br /&gt;
 vm:vm0002_win1                 an-node05.alteeve.com          started       &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Before starting the migration, I logged into the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0002_win1&amp;lt;/span&amp;gt; machine and started a continuous ping against &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;google.ca&amp;lt;/span&amp;gt;. As you can see below, four packets were lost. This is the worst packet loss I was able to get in testing. Usually no packets were lost, but connections do sometimes drop for a very short period.&lt;br /&gt;
&lt;br /&gt;
[[Image:live_migration_vm0002_win2008_to_an-node05_ping.png|thumb|700px|center|Continuous ping from within the live-migrated VM against &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;google.ca&amp;lt;/span&amp;gt; using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;tsclient&amp;lt;/span&amp;gt; to monitor the connection.]]&lt;br /&gt;
&lt;br /&gt;
= Congratulations, Your Cluster Is Complete! Now, Break It! =&lt;br /&gt;
&lt;br /&gt;
You may have noticed that the two storage resources are still not set to automatically start with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt;. This is on purpose, as we now need to work through all of the possible failure modes. Until we&#039;ve done so, out cluster &#039;&#039;&#039;&#039;&#039;is not production ready&#039;&#039;&#039;&#039;&#039;! &lt;br /&gt;
&lt;br /&gt;
It&#039;s true, at this point the cluster is technically finished. As we&#039;ll soon see, we can kill a node and it&#039;s lost VMs will recover on the surviving node. &#039;&#039;&#039;However&#039;&#039;&#039;, that is only a part of this exercise.&lt;br /&gt;
&lt;br /&gt;
Remember back at the beginning how we talked about the inherent complexity of clusters? We need to now break our cluster at every point within that complexity that we can. We need to see how things go wrong so that we can learn how to resolve the problems that &#039;&#039;&#039;will&#039;&#039;&#039; arise now, while we have the luxury of time and a cluster with no real data on it. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Once you go in to production, it is too late to learn.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Backup a Second; Let&#039;s See How It&#039;s Supposed to Work ==&lt;br /&gt;
&lt;br /&gt;
Before we grab a hammer, let&#039;s go over how a clean stop and start should work.&lt;br /&gt;
&lt;br /&gt;
=== Gracefully Shutting Down the Cluster ===&lt;br /&gt;
&lt;br /&gt;
If you&#039;ve followed through this tutorial in order, you probably already have everything running, so let&#039;s start by talking about how to shut down the cluster properly.&lt;br /&gt;
&lt;br /&gt;
The stop order is:&lt;br /&gt;
* Lock &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; services that can migrate; The vm services in our case.&lt;br /&gt;
* Disable all &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; services.&lt;br /&gt;
* Stop the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; daemon.&lt;br /&gt;
* Stop the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt; daemon.&lt;br /&gt;
&lt;br /&gt;
Stopping the virtual machines is no longer a simple task. If you try to power down the VM from within the OS, the cluster will &amp;quot;recover&amp;quot; it as soon as it shuts off. Likewise if you try to stop it using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virsh shutdown &#039;&#039;domU&#039;&#039;&amp;lt;/span&amp;gt;. You can stop a VM by simple disabling it via &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt;, but that is not enough when preparing for a complete shutdown of the cluster as the VM could be restarted on another node in some cases. &lt;br /&gt;
&lt;br /&gt;
To ensure that the VM stays off, we&#039;ll &amp;quot;lock&amp;quot; the service. This will prevent all actions except for disabling (shutting down) the VM. Once quorum is lost though, this lock is lost, so you don&#039;t need to worry about unlocking it later when you restart the cluster.&lt;br /&gt;
&lt;br /&gt;
So let&#039;s take a look at the running resources.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
clustat&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Cluster Status for an-cluster01 @ Sun May 15 13:14:05 2011&lt;br /&gt;
Member Status: Quorate&lt;br /&gt;
&lt;br /&gt;
 Member Name                             ID   Status&lt;br /&gt;
 ------ ----                             ---- ------&lt;br /&gt;
 an-node04.alteeve.com                       1 Online, Local, rgmanager&lt;br /&gt;
 an-node05.alteeve.com                       2 Online, rgmanager&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State         &lt;br /&gt;
 ------- ----                   ----- ------                   -----         &lt;br /&gt;
 service:an4_storage            an-node04.alteeve.com          started       &lt;br /&gt;
 service:an5_storage            an-node05.alteeve.com          started       &lt;br /&gt;
 vm:vm0001_ws1                  an-node04.alteeve.com          started       &lt;br /&gt;
 vm:vm0002_win1                 an-node05.alteeve.com          started       &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We don&#039;t need to worry about the two storage services as they&#039;re in failover domains that, well, don&#039;t fail over anyway. Thus, we&#039;ll lock the two VMs. Note that it doesn&#039;t matter where the lock is issued.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
clusvcadm -l vm:vm0001_ws1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Resource groups locked&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;
clusvcadm -l vm:vm0002_win1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Resource groups locked&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I don&#039;t know of a way to see if a service has been locked as &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clustat&amp;lt;/span&amp;gt; will show no change. However, you can unlock a service if you decided not to shutdown the cluster by replacing the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;-l&amp;lt;/span&amp;gt; switch with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;-u&amp;lt;/span&amp;gt; in the calls above.&lt;br /&gt;
&lt;br /&gt;
[[Image:Locking_the_vm_services_01.png|center|thumb|700px|Locking the two VM services prior to cluster shutdown.]]&lt;br /&gt;
&lt;br /&gt;
Now you can disable the two VM services safely. Note that the disable call will not return until the VM has shut down, so be patient.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
clusvcadm -d vm:vm0001_ws1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Local machine disabling vm:vm0001_ws1...Success&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;
clusvcadm -d vm:vm0002_win1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Local machine disabling vm:vm0002_win1...Success&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Image:Disabling_the_vm_services_01.png|center|thumb|700px|Disabling the two VM services prior to cluster shutdown.]]&lt;br /&gt;
&lt;br /&gt;
You may notice in the screenshot above that the both VMs were disabled from &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt;, despite &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0002_win1&amp;lt;/span&amp;gt; running on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt; even without the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;-m &amp;lt;node&amp;gt;&amp;lt;/span&amp;gt; option. &lt;br /&gt;
&lt;br /&gt;
Check to confirm that the VMs are off now.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
clustat&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Cluster Status for an-cluster01 @ Sun May 15 13:38:20 2011&lt;br /&gt;
Member Status: Quorate&lt;br /&gt;
&lt;br /&gt;
 Member Name                             ID   Status&lt;br /&gt;
 ------ ----                             ---- ------&lt;br /&gt;
 an-node04.alteeve.com                       1 Online, Local, rgmanager&lt;br /&gt;
 an-node05.alteeve.com                       2 Online, rgmanager&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State         &lt;br /&gt;
 ------- ----                   ----- ------                   -----         &lt;br /&gt;
 service:an4_storage            an-node04.alteeve.com          started       &lt;br /&gt;
 service:an5_storage            an-node05.alteeve.com          started       &lt;br /&gt;
 vm:vm0001_ws1                  (an-node04.alteeve.com)        disabled      &lt;br /&gt;
 vm:vm0002_win1                 (an-node05.alteeve.com)        disabled      &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now that the VMs are down, we can stop &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; on both nodes. This will stop the storage services on each node in the process, and we don&#039;t need to worry about them being restarted as they can&#039;t fail to another node and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; will be gone before they could restart. It&#039;s a bit lazy, but it&#039;s safe.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/rgmanager 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;
Shutting down Cluster Service Manager...&lt;br /&gt;
Waiting for services to stop:                              [  OK  ]&lt;br /&gt;
Cluster Service Manager is stopped.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Image:Stopping_the_rgmanager_daemon_01.png|center|thumb|700px|Stopping the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; daemon on both nodes.]]&lt;br /&gt;
&lt;br /&gt;
Notice in the screenshot above that we can see the storage service halting after &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; is told to stop.&lt;br /&gt;
&lt;br /&gt;
We can confirm that storage is stopped simply by checking the status of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;drbd&amp;lt;/span&amp;gt;. If anything went wrong, one or more of the DRBD resources would have been held open and prevented from stopping. If the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;drbd&amp;lt;/span&amp;gt; module is unloaded, we know that the shutdown was successful.&lt;br /&gt;
&lt;br /&gt;
Check this from both nodes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/drbd 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;
drbd not loaded&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now, all that is left is to stop &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&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/cman 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;
Stopping cluster: &lt;br /&gt;
   Stopping fencing... done&lt;br /&gt;
   Stopping cman... done&lt;br /&gt;
   Stopping ccsd... done&lt;br /&gt;
   Unmounting configfs... done&lt;br /&gt;
                                                           [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
That&#039;s it, you can down safely shut down the nodes!&lt;br /&gt;
&lt;br /&gt;
=== Cold Starting the Cluster ===&lt;br /&gt;
&lt;br /&gt;
Starting the cluster from scratch is a little different from starting and joining a node to en existing cluster, as we will see later. There are two main reasons:&lt;br /&gt;
&lt;br /&gt;
* If a node doesn&#039;t hear back from the other node when &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;openais&amp;lt;/span&amp;gt; starts, it &#039;&#039;&#039;must&#039;&#039;&#039; assume that the other node has crashed and that it needs to be fenced. Remember the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;post_join_delay&amp;lt;/span&amp;gt;? That is the maximum amount of time that a node will wait on start before it fires off a fence. Thus, we must start &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt; on both nodes within &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;post_join_delay&amp;lt;/span&amp;gt; seconds of one another.&lt;br /&gt;
* DRBD will not start until both nodes can talk to each other. If you start the storage service on either node, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;drbd&amp;lt;/span&amp;gt; will hang forever waiting for the other node to show up. It is possible to change this DRBD behaviour, but doing so is an exercise for the reader. &lt;br /&gt;
&lt;br /&gt;
Once both nodes are up, you can shut one node back down and safely run of just the one node. This is because the surviving node will see the other node withdraw, and thus will confidently know that it is not going to access the clustered resources. &lt;br /&gt;
&lt;br /&gt;
With this in mind, the cold-start order is:&lt;br /&gt;
&lt;br /&gt;
# Start the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt; daemon on both nodes within &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;post_join_delay&amp;lt;/span&amp;gt; seconds.&lt;br /&gt;
# Start the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; daemon on both nodes. At this point, the storage services are not set to start with the system, so there are no timing concerns yet.&lt;br /&gt;
# Enable the storage services on both nodes. We did not enable the DRBD timeout (see &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;man drbd.conf&amp;lt;/span&amp;gt;), so we don&#039;t have timing concerns here. Be aware that the enable command on the first node will not return until the storage service has been started on the second node. For this reason, you&#039;ll want to have two terminals open; One connected to each node.&lt;br /&gt;
# Verify that the storage services are all online.&lt;br /&gt;
# Start the virtual machine resources in the order that best suits you.&lt;br /&gt;
&lt;br /&gt;
So, start &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&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/cman 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 cluster: &lt;br /&gt;
   Loading modules... done&lt;br /&gt;
   Mounting configfs... done&lt;br /&gt;
   Starting ccsd... done&lt;br /&gt;
   Starting cman... done&lt;br /&gt;
   Starting daemons... done&lt;br /&gt;
   Starting fencing... done&lt;br /&gt;
                                                           [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Image:Starting_cman_on_both_nodes_01.png|thumb|center|700px|Starting &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt; on both nodes at the same time.]]&lt;br /&gt;
&lt;br /&gt;
Now we&#039;ll start &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; on both nodes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/rgmanager 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 Cluster Service Manager:                          [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I like to make a habit of running &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clustat&amp;lt;/span&amp;gt; right after starting, just to ensure that services are or are not running, as I&#039;d expect.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
clustat&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Cluster Status for an-cluster01 @ Sun May 15 16:42:41 2011&lt;br /&gt;
Member Status: Quorate&lt;br /&gt;
&lt;br /&gt;
 Member Name                             ID   Status&lt;br /&gt;
 ------ ----                             ---- ------&lt;br /&gt;
 an-node04.alteeve.com                       1 Online, Local, rgmanager&lt;br /&gt;
 an-node05.alteeve.com                       2 Online, rgmanager&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State         &lt;br /&gt;
 ------- ----                   ----- ------                   -----         &lt;br /&gt;
 service:an4_storage            (none)                         stopped       &lt;br /&gt;
 service:an5_storage            (none)                         stopped       &lt;br /&gt;
 vm:vm0001_ws1                  (none)                         stopped       &lt;br /&gt;
 vm:vm0002_win1                 (none)                         stopped       &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Image:Starting_rgmanager_on_both_nodes_01.png|thumb|center|700px|Starting &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; on both nodes and checking service states with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clustat&amp;lt;/span&amp;gt;.]]&lt;br /&gt;
&lt;br /&gt;
If you run &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clustat&amp;lt;/span&amp;gt; immediately after &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; has started, you may see no services listed. This is not a problem, it just takes a minute for the service states to become known to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
You may notice that the log files are complaining that they could not find the VM definition files in the search path. Remember back in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; section how we talked about the delay in getting the clustered storage online? This is the problem. The definitions are on the GFS2 partition which isn&#039;t available quickly enough. Even if we started the storage resources with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt;, which we will do later, it&#039;s still not fast enough to prevent &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; from failing to find the definition files and giving up. This is why we&#039;ll need to always start the virtual machines manually. &lt;br /&gt;
&lt;br /&gt;
As an aside, this isn&#039;t a problem with [[pacemaker]], as we&#039;ll see in the [[EL6]] tutorial later.&lt;br /&gt;
&lt;br /&gt;
Let&#039;s now start the clustered storage services. As an experiment, start the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an4_storage&amp;lt;/span&amp;gt; service and then wait some time before starting the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an5_storage&amp;lt;/span&amp;gt;. You&#039;ll see that the first service will pause indefinitely, as we discussed.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt;&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
clusvcadm -e an4_storage&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Local machine trying to enable service:an4_storage...&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Image:Starting_storage_on_one_node_01.png|thumb|center|700px|Starting &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an4_storage&amp;lt;/span&amp;gt; on just &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt;.]]&lt;br /&gt;
&lt;br /&gt;
Once you start the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an5_storage&amp;lt;/span&amp;gt; service, both will complete and return to the command line. Once done, I like to run a &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;status&amp;lt;/span&amp;gt; check 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; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;gfs2&amp;lt;/span&amp;gt; to ensure that things are as I expect them.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/drbd status &amp;amp;&amp;amp; /etc/init.d/clvmd status &amp;amp;&amp;amp; /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;
drbd driver loaded OK; device status:&lt;br /&gt;
version: 8.3.8 (api:88/proto:86-94)&lt;br /&gt;
GIT-hash: d78846e52224fd00562f7c225bcc25b2d422321d build by mockbuild@builder10.centos.org, 2010-06-04 08:04:27&lt;br /&gt;
m:res  cs         ro               ds                 p  mounted  fstype&lt;br /&gt;
0:r0   Connected  Primary/Primary  UpToDate/UpToDate  C&lt;br /&gt;
1:r1   Connected  Primary/Primary  UpToDate/UpToDate  C&lt;br /&gt;
2:r2   Connected  Primary/Primary  UpToDate/UpToDate  C&lt;br /&gt;
3:r3   Connected  Primary/Primary  UpToDate/UpToDate  C&lt;br /&gt;
clvmd (pid  6283) is running...&lt;br /&gt;
Clustered Volume Groups: drbd_an5_vg0 drbd_an4_vg0 drbd_sh0_vg0&lt;br /&gt;
Active clustered Logical Volumes: /dev/drbd_an5_vg0/vm0002_1 /dev/drbd_an4_vg0/vm0001_1 /dev/drbd_sh0_vg0/xen_shared&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;
[[Image:Starting_storage_on_the_other_node_01.png|thumb|center|700px|Starting &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an5_storage&amp;lt;/span&amp;gt; on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt; and then performing the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;status&amp;lt;/span&amp;gt; checks.]]&lt;br /&gt;
&lt;br /&gt;
Everything is in place, so now we can start the virtual machines. Given that VMs can run on either node, it&#039;s a good habit to explicitly define the target node using the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;-m&amp;lt;/span&amp;gt; &amp;quot;member&amp;quot; switch.&lt;br /&gt;
&lt;br /&gt;
Start the web server:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
clusvcadm -e vm:vm0001_ws1 -m an-node04.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;
Member an-node04.alteeve.com trying to enable vm:vm0001_ws1...Success&lt;br /&gt;
vm:vm0001_ws1 is now running on an-node04.alteeve.com&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Start the windows server:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
clusvcadm -e vm:vm0002_win1 -m an-node05.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;
Member an-node05.alteeve.com trying to enable vm:vm0002_win1...Success&lt;br /&gt;
vm:vm0002_win1 is now running on an-node05.alteeve.com&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check that they are running using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clustat&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;
clustat&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Cluster Status for an-cluster01 @ Sun May 15 17:05:49 2011&lt;br /&gt;
Member Status: Quorate&lt;br /&gt;
&lt;br /&gt;
 Member Name                             ID   Status&lt;br /&gt;
 ------ ----                             ---- ------&lt;br /&gt;
 an-node04.alteeve.com                       1 Online, Local, rgmanager&lt;br /&gt;
 an-node05.alteeve.com                       2 Online, rgmanager&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State         &lt;br /&gt;
 ------- ----                   ----- ------                   -----         &lt;br /&gt;
 service:an4_storage            an-node04.alteeve.com          started       &lt;br /&gt;
 service:an5_storage            an-node05.alteeve.com          started       &lt;br /&gt;
 vm:vm0001_ws1                  an-node04.alteeve.com          started       &lt;br /&gt;
 vm:vm0002_win1                 an-node05.alteeve.com          started       &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There we have it! The cluster is up and running from a complete cold start.&lt;br /&gt;
&lt;br /&gt;
== Testing Migration and Recovery ==&lt;br /&gt;
&lt;br /&gt;
We&#039;ve already looked at live migration of VMs before they were added to the cluster, but we&#039;ve not yet looked at live migrations &#039;&#039;within&#039;&#039; the cluster.&lt;br /&gt;
&lt;br /&gt;
Our tests will cover:&lt;br /&gt;
&lt;br /&gt;
* A controlled migration, as we would do before and after planned maintenance on a node.&lt;br /&gt;
* Crashing a VM directly, and making sure that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; detects the crash and restarts the VM.&lt;br /&gt;
* Crashing a VM enough times and within enough time to trigger a relocation to the second node.&lt;br /&gt;
* Crashing the host node and checking that lost VMs restart on the surviving node.&lt;br /&gt;
&lt;br /&gt;
=== Controlled Live Migration Using clusvcadm ===&lt;br /&gt;
&lt;br /&gt;
There will be times when you will want to migrate a VM off of a node. The classic example would be to upgrade the hardware, install a new kernel or repair a RAID array. When you know that ahead of time that a node will go down, you can easily migrate the VM services off of it to another node in the cluster.&lt;br /&gt;
&lt;br /&gt;
Let&#039;s look at migrating the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0001_ws1&amp;lt;/span&amp;gt; VM from &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt; to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt;. First, confirm that it is on the source node.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
clustat&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Cluster Status for an-cluster01 @ Sun May 15 17:05:49 2011&lt;br /&gt;
Member Status: Quorate&lt;br /&gt;
&lt;br /&gt;
 Member Name                             ID   Status&lt;br /&gt;
 ------ ----                             ---- ------&lt;br /&gt;
 an-node04.alteeve.com                       1 Online, Local, rgmanager&lt;br /&gt;
 an-node05.alteeve.com                       2 Online, rgmanager&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State         &lt;br /&gt;
 ------- ----                   ----- ------                   -----         &lt;br /&gt;
 service:an4_storage            an-node04.alteeve.com          started       &lt;br /&gt;
 service:an5_storage            an-node05.alteeve.com          started       &lt;br /&gt;
 vm:vm0001_ws1                  an-node04.alteeve.com          started       &lt;br /&gt;
 vm:vm0002_win1                 an-node05.alteeve.com          started       &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now perform the actual migration. Note that we will be using the special &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;-M&amp;lt;/span&amp;gt; (live migrate) switch, rather than the usual &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;-r&amp;lt;/span&amp;gt; (relocate) switch.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
clusvcadm -M vm:vm0001_ws1 -m an-node05.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;
Trying to migrate vm:vm0001_ws1 to an-node05.alteeve.com...Success&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you then run &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clustat&amp;lt;/span&amp;gt; again, you will see the VM now running on the target node.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
clustat&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Cluster Status for an-cluster01 @ Sun May 15 17:21:31 2011&lt;br /&gt;
Member Status: Quorate&lt;br /&gt;
&lt;br /&gt;
 Member Name                             ID   Status&lt;br /&gt;
 ------ ----                             ---- ------&lt;br /&gt;
 an-node04.alteeve.com                       1 Online, Local, rgmanager&lt;br /&gt;
 an-node05.alteeve.com                       2 Online, rgmanager&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State         &lt;br /&gt;
 ------- ----                   ----- ------                   -----         &lt;br /&gt;
 service:an4_storage            an-node04.alteeve.com          started       &lt;br /&gt;
 service:an5_storage            an-node05.alteeve.com          started       &lt;br /&gt;
 vm:vm0001_ws1                  an-node05.alteeve.com          started       &lt;br /&gt;
 vm:vm0002_win1                 an-node05.alteeve.com          started       &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Image:Live_migrating_a_vm_using_clusvcadm_01.png|center|thumb|700px|Live migrating &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0001_ws1&amp;lt;/span&amp;gt; from &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt; to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt;.]]&lt;br /&gt;
&lt;br /&gt;
That was easy!&lt;br /&gt;
&lt;br /&gt;
=== Crashing the VM Itself ===&lt;br /&gt;
&lt;br /&gt;
There are many ways to crash a VM, and you can and should try crashing it all the ways that you can think of. In [[Linux]] machines, we can trigger a crash by &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;echo&amp;lt;/span&amp;gt;&#039;ing &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;c&amp;lt;/span&amp;gt; to the special &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/proc/sysrq-trigger&amp;lt;/span&amp;gt; file. This will instantly crash the server and you will not see the command return. &lt;br /&gt;
&lt;br /&gt;
Let&#039;s do this to the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0001_ws1&amp;lt;/span&amp;gt; VM. Connect to the virtual machine, either directly to it&#039;s console by running &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xm console vm0001_ws1&amp;lt;/span&amp;gt; from the host, or by &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ssh&amp;lt;/span&amp;gt;&#039;ing into the machine. Once logged in, run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
echo c &amp;gt; /proc/sysrq-trigger&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Within moments, you will see the xen &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vifX.Y&amp;lt;/span&amp;gt; interfaces disable and then a new &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vifZ.Y&amp;lt;/span&amp;gt; get created as the VM is restarted. If you are fast enough, you may see &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clustat&amp;lt;/span&amp;gt; report the VM as disabled, though it starts up very quickly so it may be hard to catch.&lt;br /&gt;
&lt;br /&gt;
[[Image:Watching_a_vm_restart_via_rgmanager_01.png|thumb|700px|center|Killing a VM internally and watching it restart.]]&lt;br /&gt;
&lt;br /&gt;
=== Crashing the VM Enough Times to Trigger a Relocation ===&lt;br /&gt;
&lt;br /&gt;
{{note|1=This doesn&#039;t seem to be working at the moment. Filed a Red Hat [https://bugzilla.redhat.com/show_bug.cgi?id=698369 bugzilla] ticket.}}&lt;br /&gt;
&lt;br /&gt;
VM always restarts on the node it was last running on.&lt;br /&gt;
&lt;br /&gt;
=== Crashing the Host Node ===&lt;br /&gt;
&lt;br /&gt;
{{Note|1=Once you crash the host node, both DRBD and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt; will trigger fence calls nearly simultaneously. Some fence devices do not handle this well and will either fail, or report a failed fence to the cluster. If this is the case with your fence device, you can use the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[RHCS_v2_cluster.conf#post_fail_delay|post_fail_delay]]&amp;lt;/span&amp;gt; option in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cluster.conf&amp;lt;/span&amp;gt;.}}&lt;br /&gt;
&lt;br /&gt;
As we did when we crashed the virtual machine, we will crash the operating system on the node currently running one of the VMs. In the case, we have &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0001_ws1&amp;lt;/span&amp;gt; running on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0002_win1&amp;lt;/span&amp;gt; running on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&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;
clustat&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Cluster Status for an-cluster01 @ Sun May 15 19:41:21 2011&lt;br /&gt;
Member Status: Quorate&lt;br /&gt;
&lt;br /&gt;
 Member Name                             ID   Status&lt;br /&gt;
 ------ ----                             ---- ------&lt;br /&gt;
 an-node04.alteeve.com                       1 Online, Local, rgmanager&lt;br /&gt;
 an-node05.alteeve.com                       2 Online, rgmanager&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State         &lt;br /&gt;
 ------- ----                   ----- ------                   -----         &lt;br /&gt;
 service:an4_storage            an-node04.alteeve.com          started       &lt;br /&gt;
 service:an5_storage            an-node05.alteeve.com          started       &lt;br /&gt;
 vm:vm0001_ws1                  an-node04.alteeve.com          started       &lt;br /&gt;
 vm:vm0002_win1                 an-node05.alteeve.com          started       &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once we crash &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt;, watch the log file in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt;. You will see DRBD lose contact with the other side, the crashed &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt; machine get fenced, the cluster will reform and finally the resource manager will restart the lost virtual machine. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt;&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
echo c &amp;gt; /proc/sysrq-trigger&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Watching &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt;, we will see the following in [[syslog]]:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
May 15 19:45:52 an-node05 kernel: block drbd3: PingAck did not arrive in time.&lt;br /&gt;
May 15 19:45:52 an-node05 kernel: block drbd3: peer( Primary -&amp;gt; Unknown ) conn( Connected -&amp;gt; NetworkFailure ) pdsk( UpToDate -&amp;gt; DUnknown ) &lt;br /&gt;
May 15 19:45:52 an-node05 kernel: block drbd3: asender terminated&lt;br /&gt;
May 15 19:45:52 an-node05 kernel: block drbd3: Terminating asender thread&lt;br /&gt;
May 15 19:45:52 an-node05 kernel: block drbd3: short read expecting header on sock: r=-512&lt;br /&gt;
May 15 19:45:52 an-node05 kernel: block drbd3: Creating new current UUID&lt;br /&gt;
May 15 19:45:52 an-node05 kernel: block drbd3: Connection closed&lt;br /&gt;
May 15 19:45:52 an-node05 kernel: block drbd3: conn( NetworkFailure -&amp;gt; Unconnected ) &lt;br /&gt;
May 15 19:45:52 an-node05 kernel: block drbd3: receiver terminated&lt;br /&gt;
May 15 19:45:52 an-node05 kernel: block drbd3: Restarting receiver thread&lt;br /&gt;
May 15 19:45:52 an-node05 kernel: block drbd3: receiver (re)started&lt;br /&gt;
May 15 19:45:52 an-node05 kernel: block drbd3: conn( Unconnected -&amp;gt; WFConnection ) &lt;br /&gt;
May 15 19:45:57 an-node05 kernel: block drbd2: PingAck did not arrive in time.&lt;br /&gt;
May 15 19:45:57 an-node05 kernel: block drbd2: peer( Primary -&amp;gt; Unknown ) conn( Connected -&amp;gt; NetworkFailure ) pdsk( UpToDate -&amp;gt; DUnknown ) &lt;br /&gt;
May 15 19:45:57 an-node05 kernel: block drbd2: asender terminated&lt;br /&gt;
May 15 19:45:57 an-node05 kernel: block drbd2: Terminating asender thread&lt;br /&gt;
May 15 19:45:57 an-node05 kernel: block drbd2: short read expecting header on sock: r=-512&lt;br /&gt;
May 15 19:45:57 an-node05 kernel: block drbd2: Creating new current UUID&lt;br /&gt;
May 15 19:45:57 an-node05 kernel: block drbd2: Connection closed&lt;br /&gt;
May 15 19:45:57 an-node05 kernel: block drbd2: conn( NetworkFailure -&amp;gt; Unconnected ) &lt;br /&gt;
May 15 19:45:57 an-node05 kernel: block drbd2: receiver terminated&lt;br /&gt;
May 15 19:45:57 an-node05 kernel: block drbd2: Restarting receiver thread&lt;br /&gt;
May 15 19:45:57 an-node05 kernel: block drbd2: receiver (re)started&lt;br /&gt;
May 15 19:45:57 an-node05 kernel: block drbd2: conn( Unconnected -&amp;gt; WFConnection ) &lt;br /&gt;
May 15 19:46:00 an-node05 kernel: block drbd0: PingAck did not arrive in time.&lt;br /&gt;
May 15 19:46:00 an-node05 kernel: block drbd0: peer( Primary -&amp;gt; Unknown ) conn( Connected -&amp;gt; NetworkFailure ) pdsk( UpToDate -&amp;gt; DUnknown ) &lt;br /&gt;
May 15 19:46:00 an-node05 kernel: block drbd0: asender terminated&lt;br /&gt;
May 15 19:46:00 an-node05 kernel: block drbd0: Terminating asender thread&lt;br /&gt;
May 15 19:46:00 an-node05 kernel: block drbd0: short read expecting header on sock: r=-512&lt;br /&gt;
May 15 19:46:00 an-node05 kernel: block drbd0: Creating new current UUID&lt;br /&gt;
May 15 19:46:00 an-node05 kernel: block drbd0: Connection closed&lt;br /&gt;
May 15 19:46:00 an-node05 kernel: block drbd0: conn( NetworkFailure -&amp;gt; Unconnected ) &lt;br /&gt;
May 15 19:46:00 an-node05 kernel: block drbd0: receiver terminated&lt;br /&gt;
May 15 19:46:00 an-node05 kernel: block drbd0: Restarting receiver thread&lt;br /&gt;
May 15 19:46:00 an-node05 kernel: block drbd0: receiver (re)started&lt;br /&gt;
May 15 19:46:00 an-node05 kernel: block drbd0: conn( Unconnected -&amp;gt; WFConnection ) &lt;br /&gt;
May 15 19:46:01 an-node05 openais[4704]: [TOTEM] The token was lost in the OPERATIONAL state. &lt;br /&gt;
May 15 19:46:01 an-node05 openais[4704]: [TOTEM] Receive multicast socket recv buffer size (320000 bytes). &lt;br /&gt;
May 15 19:46:01 an-node05 openais[4704]: [TOTEM] Transmit multicast socket send buffer size (262142 bytes). &lt;br /&gt;
May 15 19:46:01 an-node05 openais[4704]: [TOTEM] entering GATHER state from 2. &lt;br /&gt;
May 15 19:46:01 an-node05 kernel: block drbd1: PingAck did not arrive in time.&lt;br /&gt;
May 15 19:46:01 an-node05 kernel: block drbd1: peer( Primary -&amp;gt; Unknown ) conn( Connected -&amp;gt; NetworkFailure ) pdsk( UpToDate -&amp;gt; DUnknown ) &lt;br /&gt;
May 15 19:46:01 an-node05 kernel: block drbd1: asender terminated&lt;br /&gt;
May 15 19:46:01 an-node05 kernel: block drbd1: Terminating asender thread&lt;br /&gt;
May 15 19:46:01 an-node05 kernel: block drbd1: short read expecting header on sock: r=-512&lt;br /&gt;
May 15 19:46:01 an-node05 kernel: block drbd1: Creating new current UUID&lt;br /&gt;
May 15 19:46:01 an-node05 kernel: block drbd1: Connection closed&lt;br /&gt;
May 15 19:46:01 an-node05 kernel: block drbd1: conn( NetworkFailure -&amp;gt; Unconnected ) &lt;br /&gt;
May 15 19:46:01 an-node05 kernel: block drbd1: receiver terminated&lt;br /&gt;
May 15 19:46:01 an-node05 kernel: block drbd1: Restarting receiver thread&lt;br /&gt;
May 15 19:46:01 an-node05 kernel: block drbd1: receiver (re)started&lt;br /&gt;
May 15 19:46:01 an-node05 kernel: block drbd1: conn( Unconnected -&amp;gt; WFConnection ) &lt;br /&gt;
May 15 19:46:03 an-node05 openais[4704]: [TOTEM] entering GATHER state from 0. &lt;br /&gt;
May 15 19:46:03 an-node05 openais[4704]: [TOTEM] Creating commit token because I am the rep. &lt;br /&gt;
May 15 19:46:03 an-node05 openais[4704]: [TOTEM] Storing new sequence id for ring 140 &lt;br /&gt;
May 15 19:46:03 an-node05 openais[4704]: [TOTEM] entering COMMIT state. &lt;br /&gt;
May 15 19:46:03 an-node05 openais[4704]: [TOTEM] entering RECOVERY state. &lt;br /&gt;
May 15 19:46:03 an-node05 openais[4704]: [TOTEM] position [0] member 192.168.3.75: &lt;br /&gt;
May 15 19:46:03 an-node05 openais[4704]: [TOTEM] previous ring seq 316 rep 192.168.3.74 &lt;br /&gt;
May 15 19:46:03 an-node05 openais[4704]: [TOTEM] aru 7b high delivered 7b received flag 1 &lt;br /&gt;
May 15 19:46:03 an-node05 openais[4704]: [TOTEM] Did not need to originate any messages in recovery. &lt;br /&gt;
May 15 19:46:03 an-node05 openais[4704]: [TOTEM] Sending initial ORF token &lt;br /&gt;
May 15 19:46:03 an-node05 openais[4704]: [CLM  ] CLM CONFIGURATION CHANGE &lt;br /&gt;
May 15 19:46:03 an-node05 openais[4704]: [CLM  ] New Configuration: &lt;br /&gt;
May 15 19:46:03 an-node05 openais[4704]: [CLM  ] 	r(0) ip(192.168.3.75)  &lt;br /&gt;
May 15 19:46:03 an-node05 kernel: dlm: closing connection to node 1&lt;br /&gt;
May 15 19:46:03 an-node05 fenced[4724]: an-node04.alteeve.com not a cluster member after 0 sec post_fail_delay&lt;br /&gt;
May 15 19:46:03 an-node05 openais[4704]: [CLM  ] Members Left: &lt;br /&gt;
May 15 19:46:03 an-node05 fenced[4724]: fencing node &amp;quot;an-node04.alteeve.com&amp;quot;&lt;br /&gt;
May 15 19:46:03 an-node05 openais[4704]: [CLM  ] 	r(0) ip(192.168.3.74)  &lt;br /&gt;
May 15 19:46:03 an-node05 openais[4704]: [CLM  ] Members Joined: &lt;br /&gt;
May 15 19:46:03 an-node05 openais[4704]: [CLM  ] CLM CONFIGURATION CHANGE &lt;br /&gt;
May 15 19:46:03 an-node05 openais[4704]: [CLM  ] New Configuration: &lt;br /&gt;
May 15 19:46:03 an-node05 openais[4704]: [CLM  ] 	r(0) ip(192.168.3.75)  &lt;br /&gt;
May 15 19:46:03 an-node05 openais[4704]: [CLM  ] Members Left: &lt;br /&gt;
May 15 19:46:03 an-node05 openais[4704]: [CLM  ] Members Joined: &lt;br /&gt;
May 15 19:46:03 an-node05 openais[4704]: [SYNC ] This node is within the primary component and will provide service. &lt;br /&gt;
May 15 19:46:03 an-node05 openais[4704]: [TOTEM] entering OPERATIONAL state. &lt;br /&gt;
May 15 19:46:03 an-node05 openais[4704]: [CLM  ] got nodejoin message 192.168.3.75 &lt;br /&gt;
May 15 19:46:03 an-node05 openais[4704]: [CPG  ] got joinlist message from node 2 &lt;br /&gt;
May 15 19:46:16 an-node05 fenced[4724]: fence &amp;quot;an-node04.alteeve.com&amp;quot; success&lt;br /&gt;
May 15 19:46:16 an-node05 kernel: GFS2: fsid=an-cluster01:xen_shared.0: jid=1: Trying to acquire journal lock...&lt;br /&gt;
May 15 19:46:16 an-node05 kernel: GFS2: fsid=an-cluster01:xen_shared.0: jid=1: Looking at journal...&lt;br /&gt;
May 15 19:46:16 an-node05 kernel: GFS2: fsid=an-cluster01:xen_shared.0: jid=1: Acquiring the transaction lock...&lt;br /&gt;
May 15 19:46:16 an-node05 kernel: GFS2: fsid=an-cluster01:xen_shared.0: jid=1: Replaying journal...&lt;br /&gt;
May 15 19:46:16 an-node05 kernel: GFS2: fsid=an-cluster01:xen_shared.0: jid=1: Replayed 1 of 1 blocks&lt;br /&gt;
May 15 19:46:16 an-node05 kernel: GFS2: fsid=an-cluster01:xen_shared.0: jid=1: Found 0 revoke tags&lt;br /&gt;
May 15 19:46:16 an-node05 kernel: GFS2: fsid=an-cluster01:xen_shared.0: jid=1: Journal replayed in 1s&lt;br /&gt;
May 15 19:46:16 an-node05 kernel: GFS2: fsid=an-cluster01:xen_shared.0: jid=1: Done&lt;br /&gt;
May 15 19:46:16 an-node05 clurgmgrd[4302]: &amp;lt;notice&amp;gt; Marking service:an4_storage as stopped: Restricted domain unavailable &lt;br /&gt;
May 15 19:46:16 an-node05 clurgmgrd[4302]: &amp;lt;notice&amp;gt; Taking over service vm:vm0001_ws1 from down member an-node04.alteeve.com &lt;br /&gt;
May 15 19:46:18 an-node05 kernel: device vif5.0 entered promiscuous mode&lt;br /&gt;
May 15 19:46:18 an-node05 kernel: ADDRCONF(NETDEV_UP): vif5.0: link is not ready&lt;br /&gt;
May 15 19:46:18 an-node05 clurgmgrd[4302]: &amp;lt;notice&amp;gt; Service vm:vm0001_ws1 started &lt;br /&gt;
May 15 19:46:22 an-node05 kernel: blkback: ring-ref 8, event-channel 8, protocol 1 (x86_64-abi)&lt;br /&gt;
May 15 19:46:33 an-node05 kernel: ADDRCONF(NETDEV_CHANGE): vif5.0: link becomes ready&lt;br /&gt;
May 15 19:46:33 an-node05 kernel: xenbr0: port 4(vif5.0) entering learning state&lt;br /&gt;
May 15 19:46:48 an-node05 kernel: xenbr0: topology change detected, propagating&lt;br /&gt;
May 15 19:46:48 an-node05 kernel: xenbr0: port 4(vif5.0) entering forwarding state&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{note|1=Do to a bug in [[Node Assassin]], DRBD was not configured to fence the remote node on failure, so the only fence call came from &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt;.}}&lt;br /&gt;
&lt;br /&gt;
[[Image:Crashed_an-node04_vm_recovery_01.png|thumb|center|900px|VM recovery beginning on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt; after crashing &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt;.]]&lt;br /&gt;
&lt;br /&gt;
Above we can see that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04.alteeve.com&amp;lt;/span&amp;gt; is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Offline&amp;lt;/span&amp;gt; and the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm:vm0001_ws1&amp;lt;/span&amp;gt; service is automatically &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;starting&amp;lt;/span&amp;gt; on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
Success!&lt;br /&gt;
&lt;br /&gt;
Once you&#039;ve rejoined &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt; to the cluster, simply live-migrate &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0001_ws1&amp;lt;/span&amp;gt; back to it.&lt;br /&gt;
&lt;br /&gt;
=== Further Testing ===&lt;br /&gt;
&lt;br /&gt;
This tutorial could quickly overflow with failure testing scenarios. It is somewhat outside the scope of this tutorial, so we will stop here.&lt;br /&gt;
&lt;br /&gt;
As a rule of thumb, you should expect to spend &#039;&#039;at least&#039;&#039; as much time breaking and repairing your cluster as you did building it in the first place.&lt;br /&gt;
&lt;br /&gt;
A small list of things to test:&lt;br /&gt;
* Pulling each network cable, one at a time, and see how things fail and what is needed to restore the cluster.&lt;br /&gt;
* Kill the power on switch(es). See how things fail when all network connections are lost.&lt;br /&gt;
* Pull hard drives from the server (or &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;dd if=/dev/zero of=/dev/xx count=10000&amp;lt;/span&amp;gt; drives) to fail out the arrays.&lt;br /&gt;
* Reformat a node, then rebuild it from scratch and join it back with the surviving node.&lt;br /&gt;
* And so forth. Be destructively creative!&lt;br /&gt;
&lt;br /&gt;
= Testing Done - Going Into Production =&lt;br /&gt;
&lt;br /&gt;
Once you finish testing, the last thing to do is to change the storage resources to automatically start with the cluster. To do this, simply change &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;autostart=&amp;quot;0&amp;quot;&amp;lt;/span&amp;gt; to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;autostart=&amp;quot;1&amp;quot;&amp;lt;/span&amp;gt; for the two storage resources.&lt;br /&gt;
&lt;br /&gt;
{{note|1=Do &#039;&#039;not&#039;&#039; set &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;autostart=&amp;quot;1&amp;quot;&amp;lt;/span&amp;gt; for the virtual machine resources. As mentioned before, the storage does not come up fast enough and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; will give up trying to start the VMs. You will need to manually start the VM resources when you cold boot the cluster.}}&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;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;rm&amp;gt;&lt;br /&gt;
                ...&lt;br /&gt;
                &amp;lt;service autostart=&amp;quot;1&amp;quot; domain=&amp;quot;an4_only&amp;quot; exclusive=&amp;quot;0&amp;quot; max_restarts=&amp;quot;0&amp;quot; name=&amp;quot;an4_storage&amp;quot; recovery=&amp;quot;restart&amp;quot; restart_expire_time=&amp;quot;0&amp;quot;&amp;gt;&lt;br /&gt;
                        &amp;lt;script ref=&amp;quot;drbd&amp;quot;&amp;gt;&lt;br /&gt;
                                &amp;lt;script ref=&amp;quot;clvmd&amp;quot;&amp;gt;&lt;br /&gt;
                                        &amp;lt;script ref=&amp;quot;gfs2&amp;quot;/&amp;gt;&lt;br /&gt;
                                &amp;lt;/script&amp;gt;&lt;br /&gt;
                        &amp;lt;/script&amp;gt;&lt;br /&gt;
                &amp;lt;/service&amp;gt;&lt;br /&gt;
                &amp;lt;service autostart=&amp;quot;1&amp;quot; domain=&amp;quot;an5_only&amp;quot; exclusive=&amp;quot;0&amp;quot; max_restarts=&amp;quot;0&amp;quot; name=&amp;quot;an5_storage&amp;quot; recovery=&amp;quot;restart&amp;quot; restart_expire_time=&amp;quot;0&amp;quot;&amp;gt;&lt;br /&gt;
                        &amp;lt;script ref=&amp;quot;drbd&amp;quot;&amp;gt;&lt;br /&gt;
                                &amp;lt;script ref=&amp;quot;clvmd&amp;quot;&amp;gt;&lt;br /&gt;
                                        &amp;lt;script ref=&amp;quot;gfs2&amp;quot;/&amp;gt;&lt;br /&gt;
                                &amp;lt;/script&amp;gt;&lt;br /&gt;
                        &amp;lt;/script&amp;gt;&lt;br /&gt;
                &amp;lt;/service&amp;gt;&lt;br /&gt;
        &amp;lt;/rm&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Validate and push out the new configuration.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
xmllint --relaxng /usr/share/system-config-cluster/misc/cluster.ng /etc/cluster/cluster.conf&lt;br /&gt;
&amp;lt;/source&amp;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-cluster01&amp;quot; config_version=&amp;quot;16&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;cman expected_votes=&amp;quot;1&amp;quot; two_node=&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-node04.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;fence_na01&amp;quot; port=&amp;quot;04&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-node05.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;fence_na01&amp;quot; port=&amp;quot;03&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 agent=&amp;quot;fence_na&amp;quot; ipaddr=&amp;quot;fence_na01.alteeve.com&amp;quot; login=&amp;quot;admin&amp;quot; name=&amp;quot;fence_na01&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;fence_daemon post_join_delay=&amp;quot;60&amp;quot;/&amp;gt;&lt;br /&gt;
        &amp;lt;totem rrp_mode=&amp;quot;none&amp;quot; secauth=&amp;quot;off&amp;quot;/&amp;gt;&lt;br /&gt;
        &amp;lt;rm&amp;gt;&lt;br /&gt;
                &amp;lt;resources&amp;gt;&lt;br /&gt;
                        &amp;lt;script file=&amp;quot;/etc/init.d/drbd&amp;quot; name=&amp;quot;drbd&amp;quot;/&amp;gt;&lt;br /&gt;
                        &amp;lt;script file=&amp;quot;/etc/init.d/clvmd&amp;quot; name=&amp;quot;clvmd&amp;quot;/&amp;gt;&lt;br /&gt;
                        &amp;lt;script file=&amp;quot;/etc/init.d/gfs2&amp;quot; name=&amp;quot;gfs2&amp;quot;/&amp;gt;&lt;br /&gt;
                &amp;lt;/resources&amp;gt;&lt;br /&gt;
		&amp;lt;failoverdomains&amp;gt;&lt;br /&gt;
			&amp;lt;failoverdomain name=&amp;quot;an4_only&amp;quot; nofailback=&amp;quot;0&amp;quot; ordered=&amp;quot;0&amp;quot; restricted=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
				&amp;lt;failoverdomainnode name=&amp;quot;an-node04.alteeve.com&amp;quot; priority=&amp;quot;1&amp;quot;/&amp;gt;&lt;br /&gt;
			&amp;lt;/failoverdomain&amp;gt;&lt;br /&gt;
			&amp;lt;failoverdomain name=&amp;quot;an5_only&amp;quot; nofailback=&amp;quot;0&amp;quot; ordered=&amp;quot;0&amp;quot; restricted=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
				&amp;lt;failoverdomainnode name=&amp;quot;an-node05.alteeve.com&amp;quot; priority=&amp;quot;1&amp;quot;/&amp;gt;&lt;br /&gt;
			&amp;lt;/failoverdomain&amp;gt;&lt;br /&gt;
			&amp;lt;failoverdomain name=&amp;quot;an4_primary&amp;quot; nofailback=&amp;quot;0&amp;quot; ordered=&amp;quot;1&amp;quot; restricted=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
				&amp;lt;failoverdomainnode name=&amp;quot;an-node04.alteeve.com&amp;quot; priority=&amp;quot;1&amp;quot;/&amp;gt;&lt;br /&gt;
				&amp;lt;failoverdomainnode name=&amp;quot;an-node05.alteeve.com&amp;quot; priority=&amp;quot;2&amp;quot;/&amp;gt;&lt;br /&gt;
			&amp;lt;/failoverdomain&amp;gt;&lt;br /&gt;
			&amp;lt;failoverdomain name=&amp;quot;an5_primary&amp;quot; nofailback=&amp;quot;0&amp;quot; ordered=&amp;quot;1&amp;quot; restricted=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
				&amp;lt;failoverdomainnode name=&amp;quot;an-node04.alteeve.com&amp;quot; priority=&amp;quot;2&amp;quot;/&amp;gt;&lt;br /&gt;
				&amp;lt;failoverdomainnode name=&amp;quot;an-node05.alteeve.com&amp;quot; priority=&amp;quot;1&amp;quot;/&amp;gt;&lt;br /&gt;
			&amp;lt;/failoverdomain&amp;gt;&lt;br /&gt;
		&amp;lt;/failoverdomains&amp;gt;&lt;br /&gt;
		&amp;lt;service autostart=&amp;quot;1&amp;quot; domain=&amp;quot;an4_only&amp;quot; exclusive=&amp;quot;0&amp;quot; max_restarts=&amp;quot;0&amp;quot; name=&amp;quot;an4_storage&amp;quot; recovery=&amp;quot;restart&amp;quot; restart_expire_time=&amp;quot;0&amp;quot;&amp;gt;&lt;br /&gt;
			&amp;lt;script ref=&amp;quot;drbd&amp;quot;&amp;gt;&lt;br /&gt;
				&amp;lt;script ref=&amp;quot;clvmd&amp;quot;&amp;gt;&lt;br /&gt;
					&amp;lt;script ref=&amp;quot;gfs2&amp;quot;/&amp;gt;&lt;br /&gt;
				&amp;lt;/script&amp;gt;&lt;br /&gt;
			&amp;lt;/script&amp;gt;&lt;br /&gt;
		&amp;lt;/service&amp;gt;&lt;br /&gt;
		&amp;lt;service autostart=&amp;quot;1&amp;quot; domain=&amp;quot;an5_only&amp;quot; exclusive=&amp;quot;0&amp;quot; max_restarts=&amp;quot;0&amp;quot; name=&amp;quot;an5_storage&amp;quot; recovery=&amp;quot;restart&amp;quot; restart_expire_time=&amp;quot;0&amp;quot;&amp;gt;&lt;br /&gt;
			&amp;lt;script ref=&amp;quot;drbd&amp;quot;&amp;gt;&lt;br /&gt;
				&amp;lt;script ref=&amp;quot;clvmd&amp;quot;&amp;gt;&lt;br /&gt;
					&amp;lt;script ref=&amp;quot;gfs2&amp;quot;/&amp;gt;&lt;br /&gt;
				&amp;lt;/script&amp;gt;&lt;br /&gt;
			&amp;lt;/script&amp;gt;&lt;br /&gt;
		&amp;lt;/service&amp;gt;&lt;br /&gt;
                &amp;lt;vm name=&amp;quot;vm0001_ws1&amp;quot; domain=&amp;quot;an4_primary&amp;quot; path=&amp;quot;/xen_shared/definitions/&amp;quot; autostart=&amp;quot;0&amp;quot; exclusive=&amp;quot;0&amp;quot; recovery=&amp;quot;restart&amp;quot; max_restarts=&amp;quot;2&amp;quot; restart_expire_time=&amp;quot;600&amp;quot;/&amp;gt;&lt;br /&gt;
                &amp;lt;vm name=&amp;quot;vm0002_win1&amp;quot; domain=&amp;quot;an5_primary&amp;quot; path=&amp;quot;/xen_shared/definitions/&amp;quot; autostart=&amp;quot;0&amp;quot; exclusive=&amp;quot;0&amp;quot; recovery=&amp;quot;restart&amp;quot; max_restarts=&amp;quot;2&amp;quot; restart_expire_time=&amp;quot;600&amp;quot;/&amp;gt;&lt;br /&gt;
        &amp;lt;/rm&amp;gt;&lt;br /&gt;
&amp;lt;/cluster&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;
/etc/cluster/cluster.conf validates&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;
ccs_tool update /etc/cluster/cluster.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;
Config file updated from version 15 to 16&lt;br /&gt;
&lt;br /&gt;
Update complete.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now stop and then start again &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt;. When it starts, you will not need to enable the storage resources, they will start automatically.&lt;br /&gt;
&lt;br /&gt;
== Complete! ==&lt;br /&gt;
&lt;br /&gt;
We&#039;re done.&lt;br /&gt;
&lt;br /&gt;
I hope you&#039;ve found this tutorial useful. If you have any feedback, criticism, corrections or comments, please let me know.&lt;br /&gt;
&lt;br /&gt;
-- [[Digimer]]&lt;br /&gt;
&lt;br /&gt;
= Common Administrative Tasks =&lt;br /&gt;
&lt;br /&gt;
This is far from a comprehensive list!&lt;br /&gt;
&lt;br /&gt;
This section will attempt to cover some of the day to day tasks you may want to perform on you cluster of VMs.&lt;br /&gt;
&lt;br /&gt;
== Enabling MTU Sizes Over 1500 Bytes ==&lt;br /&gt;
&lt;br /&gt;
{{warning|1=This requires the use of a kernel compiled outside of the main repos. For this reason, do not apply this unless you have a particular need for jumbo frames and are willing to take on the additional risk of installing and running an unsupported kernel.}}&lt;br /&gt;
&lt;br /&gt;
Currently, enabling MTU sizes over 1500 bytes requires compiling a new kernel and replacing/patching two Xen scripts. I&#039;ve made a pre-compiled kernel and the patched scripts available on [https://alteeve.com/xen https://alteeve.com/xen]. [[Red Hat]] bugzilla bugs have been filed, but they missed the window for being added to [[EL5]].7. They will be merged in for [[EL5]].8, but that is some time off.&lt;br /&gt;
&lt;br /&gt;
You can track the bug progress below:&lt;br /&gt;
* [https://bugzilla.redhat.com/show_bug.cgi?id=697021 Patch needed to allow MTU &amp;gt;1500 on vif prior to connecting to bridge]&lt;br /&gt;
* [https://bugzilla.redhat.com/show_bug.cgi?id=697310 Patch for xen-3.0.3 to support patch in BZ 697021]&lt;br /&gt;
&lt;br /&gt;
Below is a pretty ugly [[bash]] chain of commands that will download, install and copy into place everything needed to make jumbo frames work.&lt;br /&gt;
&lt;br /&gt;
{{note|1=The debug and devel packages for the kernel used below can be found here: https://alteeve.com/xen/RPMS/x86_64/}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cd /etc/xen/ &amp;amp;&amp;amp; \&lt;br /&gt;
	mv qemu-ifup qemu-ifup.orig &amp;amp;&amp;amp; \&lt;br /&gt;
	wget https://alteeve.com/xen/qemu-ifup &amp;amp;&amp;amp; \&lt;br /&gt;
	cd scripts/ &amp;amp;&amp;amp; \&lt;br /&gt;
	mv xen-network-common.sh xen-network-common.sh.orig &amp;amp;&amp;amp; \&lt;br /&gt;
	wget https://alteeve.com/xen/xen-network-common.sh &amp;amp;&amp;amp; \&lt;br /&gt;
	mv xen-network-common-bonding.sh xen-network-common-bonding.sh.orig &amp;amp;&amp;amp; \&lt;br /&gt;
	wget https://alteeve.com/xen/xen-network-common-bonding.sh &amp;amp;&amp;amp; \&lt;br /&gt;
	cd ~ &amp;amp;&amp;amp; \&lt;br /&gt;
	wget https://alteeve.com/xen/RPMS/x86_64/kernel-xen-2.6.18-238.9.3.el5.x86_64.rpm &amp;amp;&amp;amp; \&lt;br /&gt;
	wget https://alteeve.com/xen/RPMS/x86_64/kernel-2.6.18-238.9.3.el5.x86_64.rpm &amp;amp;&amp;amp; \&lt;br /&gt;
	rpm -ivh ~/kernel-* &amp;amp;&amp;amp; \&lt;br /&gt;
	echo &amp;quot;exclude=kernel*&amp;quot; &amp;gt;&amp;gt; /etc/yum.conf &amp;amp;&amp;amp; \&lt;br /&gt;
	echo &amp;quot;exclude=xen*&amp;quot; &amp;gt;&amp;gt; /etc/yum.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{note|1=Choosing a jumbo frame size larger that what is supported by your network interfaces and switches will cause networking to fail when the first large packet is sent. Consult your hardware documentation before setting an MTU size and remember to use the lowest size supported by all of your equipment. Note that some manufacturers will claim jumbo frame support when the actually only support ~4000 [[bytes]].}}&lt;br /&gt;
&lt;br /&gt;
Once this is done, you will need to reboot the use the new kernel. Before you do though, edit your &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/sysconfig/network-scripts/ifcfg-eth*&amp;lt;/span&amp;gt; files and add &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;MTU=xxxx&amp;lt;/span&amp;gt;, where &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xxxx&amp;lt;/span&amp;gt; is the frame size you want.&lt;br /&gt;
&lt;br /&gt;
Once set, you can reboot.&lt;br /&gt;
&lt;br /&gt;
{{note|1=Do not set the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;MTU=&amp;lt;/span&amp;gt; in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ifcfg-xenbrX&amp;lt;/span&amp;gt; configuration files. The bridges will always use the MTU of the lowest MTU device connected to it.}}&lt;br /&gt;
&lt;br /&gt;
On my system, my &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth0&amp;lt;/span&amp;gt; device has a maximum MTU of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;7200&amp;lt;/span&amp;gt; [[bytes]]. The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth1&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth2&amp;lt;/span&amp;gt; devices both support &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;9000&amp;lt;/span&amp;gt; [[bytes]], as does my switch. So my configuration files will be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/sysconfig/network-scripts/ifcfg-eth0&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;
# Realtek Semiconductor Co., Ltd. RTL8111/8168B PCI Express Gigabit Ethernet controller&lt;br /&gt;
HWADDR=48:5B:39:3C:53:14&lt;br /&gt;
DEVICE=eth0&lt;br /&gt;
BRIDGE=xenbr0&lt;br /&gt;
BOOTPROTO=static&lt;br /&gt;
ONBOOT=yes&lt;br /&gt;
MTU=7200&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/sysconfig/network-scripts/ifcfg-eth1&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;
# Intel Corporation 82574L Gigabit Network Connection&lt;br /&gt;
HWADDR=00:1B:21:72:9B:5A&lt;br /&gt;
DEVICE=eth1&lt;br /&gt;
BOOTPROTO=static&lt;br /&gt;
ONBOOT=yes&lt;br /&gt;
MTU=9000&lt;br /&gt;
IPADDR=192.168.2.74&lt;br /&gt;
NETMASK=255.255.255.0&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/sysconfig/network-scripts/ifcfg-eth2&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;
# Intel Corporation 82574L Gigabit Network Connection&lt;br /&gt;
HWADDR=00:1B:21:72:96:EA&lt;br /&gt;
DEVICE=eth2&lt;br /&gt;
BRIDGE=xenbr2&lt;br /&gt;
BOOTPROTO=static&lt;br /&gt;
ONBOOT=yes&lt;br /&gt;
MTU=9000&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Confirm that the newly installed &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;2.6.18-238.9.3.el5xen&amp;lt;/span&amp;gt; is set to boot by default.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cat /boot/grub/grub.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;
# grub.conf generated by anaconda&lt;br /&gt;
#&lt;br /&gt;
# Note that you do not have to rerun grub after making changes to this file&lt;br /&gt;
# NOTICE:  You have a /boot partition.  This means that&lt;br /&gt;
#          all kernel and initrd paths are relative to /boot/, eg.&lt;br /&gt;
#          root (hd0,0)&lt;br /&gt;
#          kernel /vmlinuz-version ro root=/dev/sda2&lt;br /&gt;
#          initrd /initrd-version.img&lt;br /&gt;
#boot=/dev/sda&lt;br /&gt;
default=1&lt;br /&gt;
timeout=5&lt;br /&gt;
splashimage=(hd0,0)/grub/splash.xpm.gz&lt;br /&gt;
hiddenmenu&lt;br /&gt;
title CentOS (2.6.18-238.9.3.el5)&lt;br /&gt;
	root (hd0,0)&lt;br /&gt;
	kernel /vmlinuz-2.6.18-238.9.3.el5 ro root=LABEL=/ dom0_mem=1024M&lt;br /&gt;
	initrd /initrd-2.6.18-238.9.3.el5.img&lt;br /&gt;
title CentOS (2.6.18-238.9.3.el5xen)&lt;br /&gt;
	root (hd0,0)&lt;br /&gt;
	kernel /xen.gz-2.6.18-238.9.3.el5&lt;br /&gt;
	module /vmlinuz-2.6.18-238.9.3.el5xen ro root=LABEL=/ dom0_mem=1024M&lt;br /&gt;
	module /initrd-2.6.18-238.9.3.el5xen.img&lt;br /&gt;
title CentOS (2.6.18-238.9.1.el5xen)&lt;br /&gt;
	root (hd0,0)&lt;br /&gt;
	kernel /xen.gz-2.6.18-238.9.1.el5&lt;br /&gt;
	module /vmlinuz-2.6.18-238.9.1.el5xen ro root=LABEL=/ dom0_mem=1024M&lt;br /&gt;
	module /initrd-2.6.18-238.9.1.el5xen.img&lt;br /&gt;
title CentOS (2.6.18-238.9.1.el5)&lt;br /&gt;
	root (hd0,0)&lt;br /&gt;
	kernel /vmlinuz-2.6.18-238.9.1.el5 ro root=LABEL=/ dom0_mem=1024M&lt;br /&gt;
	initrd /initrd-2.6.18-238.9.1.el5.img&lt;br /&gt;
title CentOS (2.6.18-238.el5xen)&lt;br /&gt;
	root (hd0,0)&lt;br /&gt;
	kernel /xen.gz-2.6.18-238.el5 &lt;br /&gt;
	module /vmlinuz-2.6.18-238.el5xen ro root=LABEL=/ rhgb quiet&lt;br /&gt;
	module /initrd-2.6.18-238.el5xen.img&lt;br /&gt;
title CentOS-base (2.6.18-238.el5)&lt;br /&gt;
	root (hd0,0)&lt;br /&gt;
	kernel /vmlinuz-2.6.18-238.el5 ro root=LABEL=/ rhgb quiet&lt;br /&gt;
	initrd /initrd-2.6.18-238.el5.img&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now reboot. When the nodes come back up, we should see the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xenbr0&amp;lt;/span&amp;gt; with an MTU of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;7200&amp;lt;/span&amp;gt;, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth1&amp;lt;/span&amp;gt; should have an MTU of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;9000&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xenbr2&amp;lt;/span&amp;gt; should also be at &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;9000&amp;lt;/span&amp;gt;. Note that we did not need to new kernel for &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth1&amp;lt;/span&amp;gt; as it&#039;s outside of Xen.&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;
          inet6 addr: fe80::4a5b:39ff:fe3c:5314/64 Scope:Link&lt;br /&gt;
          UP BROADCAST RUNNING MULTICAST  MTU:7200  Metric:1&lt;br /&gt;
          RX packets:263 errors:0 dropped:0 overruns:0 frame:0&lt;br /&gt;
          TX packets:164 errors:0 dropped:0 overruns:0 carrier:0&lt;br /&gt;
          collisions:0 txqueuelen:1000 &lt;br /&gt;
          RX bytes:46333 (45.2 KiB)  TX bytes:27403 (26.7 KiB)&lt;br /&gt;
          Interrupt:246 Base address:0xe000 &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:9000  Metric:1&lt;br /&gt;
          RX packets:122 errors:0 dropped:0 overruns:0 frame:0&lt;br /&gt;
          TX packets:49 errors:0 dropped:0 overruns:0 carrier:0&lt;br /&gt;
          collisions:0 txqueuelen:1000 &lt;br /&gt;
          RX bytes:25004 (24.4 KiB)  TX bytes:8658 (8.4 KiB)&lt;br /&gt;
          Interrupt:17 Memory:feae0000-feb00000 &lt;br /&gt;
&lt;br /&gt;
eth2      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 MULTICAST  MTU:9000  Metric:1&lt;br /&gt;
          RX packets:172 errors:0 dropped:0 overruns:0 frame:0&lt;br /&gt;
          TX packets:97 errors:0 dropped:0 overruns:0 carrier:0&lt;br /&gt;
          collisions:0 txqueuelen:1000 &lt;br /&gt;
          RX bytes:42769 (41.7 KiB)  TX bytes:28487 (27.8 KiB)&lt;br /&gt;
          Interrupt:16 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:10 errors:0 dropped:0 overruns:0 frame:0&lt;br /&gt;
          TX packets:10 errors:0 dropped:0 overruns:0 carrier:0&lt;br /&gt;
          collisions:0 txqueuelen:0 &lt;br /&gt;
          RX bytes:696 (696.0 b)  TX bytes:696 (696.0 b)&lt;br /&gt;
&lt;br /&gt;
xenbr0    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:7200  Metric:1&lt;br /&gt;
          RX packets:254 errors:0 dropped:0 overruns:0 frame:0&lt;br /&gt;
          TX packets:167 errors:0 dropped:0 overruns:0 carrier:0&lt;br /&gt;
          collisions:0 txqueuelen:0 &lt;br /&gt;
          RX bytes:41271 (40.3 KiB)  TX bytes:26870 (26.2 KiB)&lt;br /&gt;
&lt;br /&gt;
xenbr2    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:9000  Metric:1&lt;br /&gt;
          RX packets:153 errors:0 dropped:0 overruns:0 frame:0&lt;br /&gt;
          TX packets:88 errors:0 dropped:0 overruns:0 carrier:0&lt;br /&gt;
          collisions:0 txqueuelen:0 &lt;br /&gt;
          RX bytes:38585 (37.6 KiB)  TX bytes:24586 (24.0 KiB)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To test that the new MTU sizes are working, we can use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ping&amp;lt;/span&amp;gt; from the source node and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;tcpdump&amp;lt;/span&amp;gt; on the target node. This works because &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ping&amp;lt;/span&amp;gt; can define the size of the message and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;tcpdump&amp;lt;/span&amp;gt; will show how many packets were sent and returned.&lt;br /&gt;
&lt;br /&gt;
Let&#039;s test &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xenbr0&amp;lt;/span&amp;gt;, which we&#039;ve set to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;7200&amp;lt;/span&amp;gt;. To do this test, we&#039;ll first use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;tcpdump&amp;lt;/span&amp;gt; on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt; to listen to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth0&amp;lt;/span&amp;gt; for [[ICMP]] packets.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
tcpdump -i xenbr0 icmp&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode&lt;br /&gt;
listening on xenbr0, link-type EN10MB (Ethernet), capture size 96 bytes&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt;, we&#039;re going to send a single ping with a payload of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;7172&amp;lt;/span&amp;gt; bytes. This is because the ICMP packet has an overhead of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;28&amp;lt;/span&amp;gt; bytes. This means the full ping size will be &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;7200&amp;lt;/span&amp;gt; bytes total. This should result in the ping taking only one packet to and from the destination node.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ping -c 1 -s 7172 an-node05.ifn&lt;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-node05.ifn (192.168.1.75) 7172(7200) bytes of data.&lt;br /&gt;
7180 bytes from an-node05.ifn (192.168.1.75): icmp_seq=1 ttl=64 time=1.53 ms&lt;br /&gt;
&lt;br /&gt;
--- an-node05.ifn ping statistics ---&lt;br /&gt;
1 packets transmitted, 1 received, 0% packet loss, time 0ms&lt;br /&gt;
rtt min/avg/max/mdev = 1.534/1.534/1.534/0.000 ms&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Going back to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt;, we&#039;ll see that indeed the ping took just one packet for each direction of travel.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
23:02:14.045744 IP an-node04.ifn &amp;gt; an-node05.ifn: ICMP echo request, id 3859, seq 1, length 7180&lt;br /&gt;
23:02:14.046601 IP an-node05.ifn &amp;gt; an-node04.ifn: ICMP echo reply, id 3859, seq 1, length 7180&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If we try again, with a payload size of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;7173&amp;lt;/span&amp;gt; bytes, for a total of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;7201&amp;lt;/span&amp;gt; packet size, we&#039;ll see on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt; that two packets were needed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
23:07:18.091292 IP an-node04.ifn &amp;gt; an-node05.ifn: ICMP echo request, id 21779, seq 1, length 7181&lt;br /&gt;
23:07:18.092199 IP an-node05.ifn &amp;gt; an-node04.ifn: ICMP echo reply, id 21779, seq 1, length 7176&lt;br /&gt;
23:07:18.092242 IP an-node05.ifn &amp;gt; an-node04.ifn: icmp&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Perfect!&lt;br /&gt;
&lt;br /&gt;
== Renaming a Virtual Machine ==&lt;br /&gt;
&lt;br /&gt;
There may be times when you want to rename a VM domain. For example, if you provision a machine and then realize that you gave it a name that didn&#039;t describe it properly.&lt;br /&gt;
&lt;br /&gt;
Things to keep in mind before starting;&lt;br /&gt;
&lt;br /&gt;
* The new name of the VM &#039;&#039;&#039;must&#039;&#039;&#039; match the name of the definition file as well as the name of the VM service in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cluster.conf&amp;lt;/span&amp;gt;&lt;br /&gt;
* The VM will need to be shut down for the renaming process to succeed.&lt;br /&gt;
&lt;br /&gt;
At this time, the only way to rename a VM is:&lt;br /&gt;
&lt;br /&gt;
# Use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virsh dumpxml old_name &amp;gt; /xen_shared/definitions/new_name.xml&amp;lt;/span&amp;gt;.&lt;br /&gt;
# Shut down the VM with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virsh shutdown old_name&amp;lt;/span&amp;gt;.&lt;br /&gt;
# Edit the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/xen_shared/definitions/new_name.xml&amp;lt;/span&amp;gt; [[XML]] definition file and change &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;name&amp;gt;old_name&amp;lt;/name&amp;gt;&amp;lt;/span&amp;gt; to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;name&amp;gt;new_name&amp;lt;/name&amp;gt;&amp;lt;/span&amp;gt;.&lt;br /&gt;
# Undefine the VM using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virsh undefine old_name&amp;lt;/span&amp;gt; on all nodes.&lt;br /&gt;
# Redefine the VM using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virsh define /xen_shared/definitions/new_name.xml&amp;lt;/span&amp;gt; on all nodes.&lt;br /&gt;
# Update the cluster service name.&lt;br /&gt;
## Edit &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/cluster/cluster.conf&amp;lt;/span&amp;gt; and change &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;vm name=&amp;quot;old_name&amp;quot; ... /&amp;gt;&amp;lt;/span&amp;gt; to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;vm name=&amp;quot;new_name&amp;quot; ... /&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
## Increment the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;cluster ... config_version=&amp;quot;x&amp;quot;&amp;gt;&amp;lt;/span&amp;gt; attribute.&lt;br /&gt;
## Push the new cluster configuration using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ccs_tool update /etc/cluster/cluster.conf&amp;lt;/span&amp;gt;.&lt;br /&gt;
# Confirm that the new name is seen by both &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virsh list --all&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clustat&amp;lt;/span&amp;gt;.&lt;br /&gt;
# Start the VM back up.&lt;br /&gt;
&lt;br /&gt;
== Adding Space to a VM ==&lt;br /&gt;
&lt;br /&gt;
Here we will see what it takes to add a new 50 [[GiB]] LV to a VM as a second virtual hard drive.&lt;br /&gt;
&lt;br /&gt;
This process requires a few steps.&lt;br /&gt;
* Setting the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/drbd3&amp;lt;/span&amp;gt; resource as a new [[LVM]] [[PV]].&lt;br /&gt;
* Create a new [[VG]] called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;drbd_an4_vg1&amp;lt;/span&amp;gt;.&lt;br /&gt;
* Carve out a 50 [[GB]] [[LV]] called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0001_xvdb&amp;lt;/span&amp;gt;. &lt;br /&gt;
* Attach it to the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0001_ws1&amp;lt;/span&amp;gt;.&lt;br /&gt;
* Dumping the VM&#039;s updated configuration to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/xen_shared/definitions/vm0001_ws1.xml&amp;lt;/span&amp;gt;.&lt;br /&gt;
* Redefining the VM on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt; (assuming that it is currently running on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt;).&lt;br /&gt;
* Logging into the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0001_ws1&amp;lt;/span&amp;gt; VM, formatting the new space and adding the partition 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;
{{note|1=It is assumed that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0001_ws1&amp;lt;/span&amp;gt; is currently running on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt;. Unless stated otherwise, all the following commands should, thus, be run from &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt;.&amp;lt;br /&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
=== Creating a new PV, VG and LV ===&lt;br /&gt;
&lt;br /&gt;
Create the new [[PV]]:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
pvcreate /dev/drbd3 &lt;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/drbd3&amp;quot; successfully created&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Create the new [[VG]]:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vgcreate -c y --addtag @an-cluster01 drbd_an4_vg1 /dev/drbd3&lt;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;drbd_an4_vg1&amp;quot; successfully created&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Create the new [[LV]]:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
lvcreate -L 50G --addtag @an-cluster01 -n vm0001_xvdb /dev/drbd_an4_vg1&lt;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;vm0001_xvdb&amp;quot; created&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Attaching the new LV to the VM ===&lt;br /&gt;
&lt;br /&gt;
Attach the new LV to the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0001_ws1&amp;lt;/span&amp;gt; VM. This is done using the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virsh attach-disk&amp;lt;/span&amp;gt;. We&#039;ll tell &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virsh&amp;lt;/span&amp;gt; to attach the new LV and to create it as &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/xvdb&amp;lt;/span&amp;gt; within the VM.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
virsh attach-disk vm0001_ws1 /dev/drbd_an4_vg1/vm0001_xvdb xvdb&lt;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 attached successfully&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{note|1=Log in to the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0001_ws1&amp;lt;/span&amp;gt; VM and run the following commands there. Note that, in this tutorial, the VM&#039;s hostname has been changed to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0001_ws1&amp;lt;/span&amp;gt; and has been statically assigned to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;192.168.1.253&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;
ssh root@192.168.1.253&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
root@192.168.1.253&#039;s password: &lt;br /&gt;
Last login: Sun Apr  3 18:18:13 2011 from 192.168.1.102&lt;br /&gt;
[root@vm0001_ws1 ~]# &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Confirm that the new &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/xvdb&amp;lt;/span&amp;gt; device now exists.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
fdisk -l&lt;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/xvda: 10.7 GB, 10737418240 bytes&lt;br /&gt;
255 heads, 63 sectors/track, 1305 cylinders&lt;br /&gt;
Units = cylinders of 16065 * 512 = 8225280 bytes&lt;br /&gt;
&lt;br /&gt;
    Device Boot      Start         End      Blocks   Id  System&lt;br /&gt;
/dev/xvda1   *           1          33      265041   83  Linux&lt;br /&gt;
/dev/xvda2              34         164     1052257+  82  Linux swap / Solaris&lt;br /&gt;
/dev/xvda3             165        1305     9165082+  83  Linux&lt;br /&gt;
&lt;br /&gt;
Disk /dev/xvdb: 53.6 GB, 53687091200 bytes&lt;br /&gt;
255 heads, 63 sectors/track, 6527 cylinders&lt;br /&gt;
Units = cylinders of 16065 * 512 = 8225280 bytes&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Configuring the new Virtual Hard Drive in the VM ===&lt;br /&gt;
&lt;br /&gt;
From here on in, we&#039;ll be proceeding exactly the same as if we had added a real hard drive to a bare-iron server.&lt;br /&gt;
&lt;br /&gt;
Create a single partition out of the new space.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
fdisk /dev/xvdb&lt;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 contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel&lt;br /&gt;
Building a new DOS disklabel. Changes will remain in memory only,&lt;br /&gt;
until you decide to write them. After that, of course, the previous&lt;br /&gt;
content won&#039;t be recoverable.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The number of cylinders for this disk is set to 6527.&lt;br /&gt;
There is nothing wrong with that, but this is larger than 1024,&lt;br /&gt;
and could in certain setups cause problems with:&lt;br /&gt;
1) software that runs at boot time (e.g., old versions of LILO)&lt;br /&gt;
2) booting and partitioning software from other OSs&lt;br /&gt;
   (e.g., DOS FDISK, OS/2 FDISK)&lt;br /&gt;
Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)&lt;br /&gt;
&lt;br /&gt;
Command (m for help): n&lt;br /&gt;
Command action&lt;br /&gt;
   e   extended&lt;br /&gt;
   p   primary partition (1-4)&lt;br /&gt;
p&lt;br /&gt;
Partition number (1-4): 1&lt;br /&gt;
First cylinder (1-6527, default 1): &lt;br /&gt;
Using default value 1&lt;br /&gt;
Last cylinder or +size or +sizeM or +sizeK (1-6527, default 6527): &lt;br /&gt;
Using default value 6527&lt;br /&gt;
&lt;br /&gt;
Command (m for help): p&lt;br /&gt;
&lt;br /&gt;
Disk /dev/xvdb: 53.6 GB, 53687091200 bytes&lt;br /&gt;
255 heads, 63 sectors/track, 6527 cylinders&lt;br /&gt;
Units = cylinders of 16065 * 512 = 8225280 bytes&lt;br /&gt;
&lt;br /&gt;
    Device Boot      Start         End      Blocks   Id  System&lt;br /&gt;
/dev/xvdb1               1        6527    52428096   83  Linux&lt;br /&gt;
&lt;br /&gt;
Command (m for help): w&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;
Syncing disks.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{note|1=Unlike when we worked on the nodes, we do not need to reboot the VM to see the changes on the disk. This is not because it&#039;s a virtual server, but rather because the new virtual disk is not used by the OS.}}&lt;br /&gt;
&lt;br /&gt;
Now, format the new &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/xvdb1&amp;lt;/span&amp;gt; partition.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
mkfs.ext3 /dev/xvdb1 &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
mke2fs 1.39 (29-May-2006)&lt;br /&gt;
Filesystem label=&lt;br /&gt;
OS type: Linux&lt;br /&gt;
Block size=4096 (log=2)&lt;br /&gt;
Fragment size=4096 (log=2)&lt;br /&gt;
6553600 inodes, 13107024 blocks&lt;br /&gt;
655351 blocks (5.00%) reserved for the super user&lt;br /&gt;
First data block=0&lt;br /&gt;
Maximum filesystem blocks=4294967296&lt;br /&gt;
400 block groups&lt;br /&gt;
32768 blocks per group, 32768 fragments per group&lt;br /&gt;
16384 inodes per group&lt;br /&gt;
Superblock backups stored on blocks: &lt;br /&gt;
	32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208, &lt;br /&gt;
	4096000, 7962624, 11239424&lt;br /&gt;
&lt;br /&gt;
Writing inode tables: done                            &lt;br /&gt;
Creating journal (32768 blocks): done&lt;br /&gt;
Writing superblocks and filesystem accounting information: done&lt;br /&gt;
&lt;br /&gt;
This filesystem will be automatically checked every 32 mounts or&lt;br /&gt;
180 days, whichever comes first.  Use tune2fs -c or -i to override.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/var/www&amp;lt;/span&amp;gt; does not yet exist. If it doesn&#039;t, create it.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ls -lah /var/www&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
ls: /var/www: No such file or directory&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;
mkdir /var/www&lt;br /&gt;
ls -lah /var/www&lt;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 12K&lt;br /&gt;
drwxr-xr-x  2 root root 4.0K Apr  3 23:01 .&lt;br /&gt;
drwxr-xr-x 21 root root 4.0K Apr  3 23:01 ..&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Mount the newly formatted partition.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
mount /dev/xvdb1 /var/www/&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/xvda3            8.5G  2.0G  6.1G  25% /&lt;br /&gt;
/dev/xvda1            251M   25M  214M  11% /boot&lt;br /&gt;
tmpfs                 524M     0  524M   0% /dev/shm&lt;br /&gt;
/dev/xvdb1             50G  180M   47G   1% /var/www&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Add the new partition to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/fstab&amp;lt;/span&amp;gt; so that the partition mounts on boot.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
echo &amp;quot;/dev/xvdb1              /var/www                ext3    defaults        1 3&amp;quot; &amp;gt;&amp;gt; /etc/fstab&lt;br /&gt;
cat /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;
LABEL=/                 /                       ext3    defaults        1 1&lt;br /&gt;
LABEL=/boot             /boot                   ext3    defaults        1 2&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;
LABEL=SWAP-xvda2        swap                    swap    defaults        0 0&lt;br /&gt;
/dev/xvdb1              /var/www                ext3    defaults        1 3&lt;br /&gt;
&amp;lt;/source&amp;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 please don&#039;t pay it too much mind. They&#039;ll be happy to talk to you directly. :)&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 &#039;&#039;&#039;Lon Hohberger&#039;&#039;&#039;, lon at fedoraproject.org, for the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; help. He also provided some excellent feedback on the first release (see [https://alteeve.com/index.php?title=Red_Hat_Cluster_Service_2_Tutorial&amp;amp;action=historysubmit&amp;amp;diff=3456&amp;amp;oldid=3455 here])&lt;br /&gt;
* To [http://dk.linkedin.com/in/fabbione Fabio Massimo Di Nitto] for helping me get caught up with clustering and VMs on FC13.&lt;br /&gt;
&lt;br /&gt;
{{footer}}&lt;/div&gt;</summary>
		<author><name>Kiwi</name></author>
	</entry>
	<entry>
		<id>https://alteeve.com/w/index.php?title=Red_Hat_Cluster_Service_2_Tutorial_-_Archive&amp;diff=3602</id>
		<title>Red Hat Cluster Service 2 Tutorial - Archive</title>
		<link rel="alternate" type="text/html" href="https://alteeve.com/w/index.php?title=Red_Hat_Cluster_Service_2_Tutorial_-_Archive&amp;diff=3602"/>
		<updated>2011-08-22T16:51:44Z</updated>

		<summary type="html">&lt;p&gt;Kiwi: /* Keeping Time In Sync */ s/the/it./&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{howto_header}}&lt;br /&gt;
&lt;br /&gt;
This paper has one goal;&lt;br /&gt;
&lt;br /&gt;
* Creating a 2-node, high-availability cluster hosting [[Xen]] virtual machines using [[RHCS]] &amp;quot;stable 2&amp;quot; with [[DRBD]] and clustered [[LVM]] for synchronizing storage data.&lt;br /&gt;
&lt;br /&gt;
We&#039;ll create a dedicated firewall VM to isolate and protect the VM network, discuss provisioning and maintaining Xen VMs, explore some basics of daily administration of a VM cluster and test various failures and how to recover from them.&lt;br /&gt;
&lt;br /&gt;
Grab a coffee, a comfy chair, put on some nice music and settle in for some geekly fun.&lt;br /&gt;
&lt;br /&gt;
= The Task Ahead =&lt;br /&gt;
&lt;br /&gt;
Before we start, let&#039;s take a few minutes to discuss clustering and it&#039;s complexities.&lt;br /&gt;
&lt;br /&gt;
== Technologies We Will Use ==&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;Enterprise Linux 5&#039;&#039;; specifically we will be using [[CentOS]] v5.6.&lt;br /&gt;
* &#039;&#039;Red Hat Cluster Services&#039;&#039; &amp;quot;Stable&amp;quot; version 2. This describes the following core components:&lt;br /&gt;
** &#039;&#039;OpenAIS&#039;&#039;; Provides cluster communications using the [[totem]] protocol.&lt;br /&gt;
** &#039;&#039;Cluster Manager&#039;&#039; (&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[cman]]&amp;lt;/span&amp;gt;); Manages the starting, stopping and managing of the cluster.&lt;br /&gt;
** &#039;&#039;Resource Manager&#039;&#039; (&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[rgmanager]]&amp;lt;/span&amp;gt;); Manages cluster resources and services. Handles service recovery during failures.&lt;br /&gt;
** &#039;&#039;Cluster Logical Volume Manager&#039;&#039; (&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[clvm]]&amp;lt;/span&amp;gt;); Cluster-aware (disk) volume manager. Backs [[GFS2]] [[filesystem]]s and [[Xen]] virtual machines.&lt;br /&gt;
** &#039;&#039;Global File Systems&#039;&#039; version 2 (&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[gfs2]]&amp;lt;/span&amp;gt;); Cluster-aware, concurrently mountable file system.&lt;br /&gt;
* &#039;&#039;Distributed Redundant Block Device&#039;&#039; ([[DRBD]]); Keeps shared data synchronized across cluster nodes.&lt;br /&gt;
* &#039;&#039;Xen&#039;&#039;; [[Hypervisor]] that controls and supports virtual machines.&lt;br /&gt;
&lt;br /&gt;
== A Note on Patience ==&lt;br /&gt;
&lt;br /&gt;
There is nothing inherently hard about clustering. However, there are many components that you need to understand before you can begin. The result is that clustering has an inherently steep learning curve.&lt;br /&gt;
&lt;br /&gt;
You &#039;&#039;&#039;must&#039;&#039;&#039; have patience. Lots of it.&lt;br /&gt;
&lt;br /&gt;
Many technologies can be learned by creating a very simple base and then building on it. The classic &amp;quot;Hello, World!&amp;quot; script created when first learning a programming language is an example of this. Unfortunately, there is no real analog to this in clustering. Even the most basic cluster requires several pieces be in place and working together. If you try to rush by ignoring pieces you think are not important, you will almost certainly waste time. A good example is setting aside [[fencing]], thinking that your test cluster&#039;s data isn&#039;t important. The cluster software has no concept of &amp;quot;test&amp;quot;. It treats everything as critical all the time and &#039;&#039;will&#039;&#039; shut down if anything goes wrong.&lt;br /&gt;
&lt;br /&gt;
Take your time, work through these steps, and you will have the foundation cluster sooner than you realize. Clustering is fun &#039;&#039;&#039;because&#039;&#039;&#039; it is a challenge.&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
&lt;br /&gt;
It is assumed that you are familiar with Linux systems administration, specifically [[Red Hat]] [[EL|Enterprise Linux]] and its derivatives. You will need to have somewhat advanced networking experience as well. You should be comfortable working in a terminal (directly or over &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[ssh]]&amp;lt;/span&amp;gt;). Familiarity with [[XML]] will help, but is not terribly required as it&#039;s use here is pretty self-evident.&lt;br /&gt;
&lt;br /&gt;
If you feel a little out of depth at times, don&#039;t hesitate to set this tutorial aside. Branch over to the components you feel the need to study more, then return and continue on. Finally, and perhaps most importantly, you &#039;&#039;&#039;must&#039;&#039;&#039; have patience! If you have a manager asking you to &amp;quot;go live&amp;quot; with a cluster in a month, tell him or her that it simply won&#039;t happen. If you rush, you will skip important points and &#039;&#039;&#039;you will fail&#039;&#039;&#039;. Patience is vastly more important than any pre-existing skill. &lt;br /&gt;
&lt;br /&gt;
== Focus and Goal ==&lt;br /&gt;
&lt;br /&gt;
There is a different cluster for every problem. Generally speaking though, there are two main problems that clusters try to resolve; Performance and High Availability. Performance clusters are generally tailored to the application requiring the performance increase. There are some general tools for performance clustering, like [[Red Hat]]&#039;s [[LVS]] (Linux Virtual Server) for load-balancing common applications like the [[Apache]] web-server. &lt;br /&gt;
&lt;br /&gt;
This tutorial will focus on High Availability clustering, often shortened to simply &#039;&#039;&#039;HA&#039;&#039;&#039; and not to be confused with the [[Linux-HA]] &amp;quot;heartbeat&amp;quot; cluster suite, which we will not be using here. The cluster will provide a shared file systems and will provide for the high availability on [[Xen]]-based virtual servers. The goal will be to have the virtual servers live-migrate during planned node outages and automatically restart on a surviving node when the original host node fails.&lt;br /&gt;
&lt;br /&gt;
Below is a &#039;&#039;very&#039;&#039; brief overview;&lt;br /&gt;
&lt;br /&gt;
High Availability clusters like ours have two main parts; Cluster management and resource management.&lt;br /&gt;
&lt;br /&gt;
The cluster itself is responsible for maintaining the cluster nodes in a group. This group is part of a &amp;quot;Closed Process Group&amp;quot;, or [[CPG]]. When a node fails, the cluster manager must detect the failure, reliably eject the node from the cluster using fencing and then reform the CPG. Each time the cluster changes, or &amp;quot;re-forms&amp;quot;, the resource manager is called. The resource manager checks to see how the cluster changed, consults it&#039;s configuration and determines what to do, if anything.&lt;br /&gt;
&lt;br /&gt;
The details of all this will be discussed in detail a little later on. For now, it&#039;s sufficient to have in mind these two major roles and understand that they are somewhat independent entities.&lt;br /&gt;
&lt;br /&gt;
== Platform ==&lt;br /&gt;
&lt;br /&gt;
This tutorial was written using [[CentOS]] version 5.6, [[x86_64]]. No attempt was made to test on [[i686]] or other [[EL5]] derivatives. That said, there is no reason to believe that this tutorial will not apply to any variant. As much as possible, the language will be distro-agnostic. For reasons of memory constraints, it is advised that you use an [[x86_64]] (64-[[bit]]) platform if at all possible.&lt;br /&gt;
&lt;br /&gt;
Do note that as of [[EL5]].4 and above, significant changes were made to how [[RHCS]] handles virtual machines. It is strongly advised that you use at least version 5.4 or newer while working with this tutorial.&lt;br /&gt;
&lt;br /&gt;
== A Word On Complexity ==&lt;br /&gt;
&lt;br /&gt;
Introducing the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Fabbione Principle&amp;lt;/span&amp;gt; (aka: &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fabimer theory&amp;lt;/span&amp;gt;):&lt;br /&gt;
&lt;br /&gt;
Clustering is not inherently hard, but it is inherently complex. Consider;&lt;br /&gt;
&lt;br /&gt;
* Any given program has &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;N&amp;lt;/span&amp;gt; bugs.&lt;br /&gt;
** [[RHCS]] uses; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt;, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;openais&amp;lt;/span&amp;gt;, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;totem&amp;lt;/span&amp;gt;, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fenced&amp;lt;/span&amp;gt;, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;dlm&amp;lt;/span&amp;gt;.&lt;br /&gt;
** We will be adding &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;GFS2&amp;lt;/span&amp;gt;, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;CLVM&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Xen&amp;lt;/span&amp;gt;.&lt;br /&gt;
** Right there, we have &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;N^10&amp;lt;/span&amp;gt; possible bugs. We&#039;ll call this &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;A&amp;lt;/span&amp;gt;.&lt;br /&gt;
* A cluster has &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Y&amp;lt;/span&amp;gt; nodes.&lt;br /&gt;
** In our case, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;2&amp;lt;/span&amp;gt; nodes, each with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;3&amp;lt;/span&amp;gt; networks.&lt;br /&gt;
** The network infrastructure (Switches, routers, etc). If you use managed switches, add another layer of complexity.&lt;br /&gt;
** This gives us another &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Y^(2*3)&amp;lt;/span&amp;gt;, and then &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;^2&amp;lt;/span&amp;gt; again for managed switches. We&#039;ll call this &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;B&amp;lt;/span&amp;gt;.&lt;br /&gt;
* Let&#039;s add the human factor. Let&#039;s say that a person needs roughly 5 years of cluster experience to be considered an expert. For each year less than this, add a &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Z&amp;lt;/span&amp;gt; &amp;quot;oops&amp;quot; factor, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;(5-Z)^2&amp;lt;/span&amp;gt;. We&#039;ll call this &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;C&amp;lt;/span&amp;gt;.&lt;br /&gt;
* So, finally, add up the complexity, using this tutorial&#039;s layout, 0-years of experience and managed switches.&lt;br /&gt;
** &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;(N^10) * (Y^(2*3)^2) * ((5-0)^2) == (A * B * C)&amp;lt;/span&amp;gt; == an-unknown-but-big-number.&lt;br /&gt;
&lt;br /&gt;
This isn&#039;t meant to scare you away, but it is meant to be a sobering statement. Obviously, those numbers are somewhat artificial, but the point remains.&lt;br /&gt;
&lt;br /&gt;
Any one piece is easy to understand, thus, clustering is inherently easy. However, given the large number of variables, you must really understand all the pieces and how they work together. &#039;&#039;&#039;&#039;&#039;DO NOT&#039;&#039;&#039;&#039;&#039; think that you will have this mastered and working in a month. Certainly don&#039;t try to sell clusters as a service without a &#039;&#039;lot&#039;&#039; of internal testing.&lt;br /&gt;
&lt;br /&gt;
Clustering is kind of like chess. The rules are pretty straight forward, but the complexity can take some time to master.&lt;br /&gt;
&lt;br /&gt;
= Overview of Components =&lt;br /&gt;
&lt;br /&gt;
When looking at a cluster, there is a tendency to want to dive right into the configuration file. That is not very useful in clustering.&lt;br /&gt;
&lt;br /&gt;
* When you look at the configuration file, it is quite short.&lt;br /&gt;
&lt;br /&gt;
It isn&#039;t like most applications or technologies though. Most of us learn by taking something, like a configuration file, and tweaking it this way and that to see what happens. I tried that with clustering and learned only what it was like to bang my head against the wall.&lt;br /&gt;
&lt;br /&gt;
* Understanding the parts and how they work together is critical.&lt;br /&gt;
&lt;br /&gt;
You will find that the discussion on the components of clustering, and how those components and concepts interact, will be much longer than the initial configuration. It is true that we could talk very briefly about the actual syntax, but it would be a disservice. Please, don&#039;t rush through the next section or, worse, skip it and go right to the configuration. You will waste far more time than you will save.&lt;br /&gt;
&lt;br /&gt;
* Clustering is easy, but it has a complex web of inter-connectivity. You must grasp this network if you want to be an effective cluster administrator!&lt;br /&gt;
&lt;br /&gt;
== Component; cman ==&lt;br /&gt;
&lt;br /&gt;
This was, traditionally, the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;c&amp;lt;/span&amp;gt;luster &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;man&amp;lt;/span&amp;gt;ager. In the 3.0 series, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt; acts mainly as a [[quorum]] provider, tallying votes and deciding on a critical property of the cluster: quorum. In the 3.1 series, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt; will be removed entirely.&lt;br /&gt;
&lt;br /&gt;
== Component; openais / corosync ==&lt;br /&gt;
&lt;br /&gt;
OpenAIS is the heart of the cluster. All other computers operate though this component, and no cluster component can work without it. Further, it is shared between both Pacemaker and RHCS clusters.&lt;br /&gt;
&lt;br /&gt;
In Red Hat clusters, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;openais&amp;lt;/span&amp;gt; is configured via the central &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cluster.conf&amp;lt;/span&amp;gt; file. In Pacemaker clusters, it is configured directly in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;openais.conf&amp;lt;/span&amp;gt;. As we will be building an RHCS, we will only use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cluster.conf&amp;lt;/span&amp;gt;. That said, (almost?) all &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;openais.conf&amp;lt;/span&amp;gt; options are available in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cluster.conf&amp;lt;/span&amp;gt;. This is important to note as you will see references to both configuration files when searching the Internet.&lt;br /&gt;
&lt;br /&gt;
=== A Little History ===&lt;br /&gt;
&lt;br /&gt;
There were significant changes between [[RHCS]] version 2, which we are using, and version 3 available on [[EL6]] and recent [[Fedora]]s.&lt;br /&gt;
&lt;br /&gt;
In the RHCS version 2, there was a component called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;openais&amp;lt;/span&amp;gt; which handled &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;totem&amp;lt;/span&amp;gt;. The OpenAIS project was designed to be the heart of the cluster and was based around the [http://www.saforum.org/ Service Availability Forum]&#039;s [http://www.saforum.org/Application-Interface-Specification~217404~16627.htm Application Interface Specification]. AIS is an open [[API]] designed to provide inter-operable high availability services.&lt;br /&gt;
&lt;br /&gt;
In 2008, it was decided that the AIS specification was overkill for most clustered applications being developed in the open source community.  At that point, OpenAIS was split in to two projects: Corosync and OpenAIS. The former, Corosync, provides cluster membership, messaging, and basic APIs for use by clustered applications, while the OpenAIS project is specifically designed to act as an optional add-on to corosync for users who want AIS functionality.&lt;br /&gt;
&lt;br /&gt;
You will see a lot of references to OpenAIS while searching the web for information on clustering. Understanding it&#039;s evolution will hopefully help you avoid confusion.&lt;br /&gt;
&lt;br /&gt;
== Concept; quorum ==&lt;br /&gt;
&lt;br /&gt;
[[Quorum]] is defined as the minimum set of hosts required in order to provide service and is used to prevent split-brain situations.&lt;br /&gt;
&lt;br /&gt;
The quorum algorithm used by the RHCS cluster is called &amp;quot;simple majority quorum&amp;quot;, which means that more than half of the hosts must be online and communicating in order to provide service. While simple majority quorum a very common quorum algorithm, other quorum algorithms exist ([[grid quorum]], [[YKD Dyanamic Linear Voting]], etc.).&lt;br /&gt;
&lt;br /&gt;
The idea behind quorum is that, which ever group of machines has it, can safely start clustered services even when defined members are not accessible.&lt;br /&gt;
&lt;br /&gt;
Take this scenario;&lt;br /&gt;
&lt;br /&gt;
* You have a cluster of four nodes, each with one vote.&lt;br /&gt;
** The cluster&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;expected_votes&amp;lt;/span&amp;gt; is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;4&amp;lt;/span&amp;gt;. A clear majority, in this case, is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;3&amp;lt;/span&amp;gt; because &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;(4/2)+1&amp;lt;/span&amp;gt;, rounded down, is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;3&amp;lt;/span&amp;gt;.&lt;br /&gt;
** Now imagine that there is a failure in the network equipment and one of the nodes disconnects from the rest of the cluster.&lt;br /&gt;
** You now have two partitions; One partition contains three machines and the other partition has one.&lt;br /&gt;
** The three machines will have quorum, and the other machine will lose quorum.&lt;br /&gt;
** The partition with quorum will reconfigure and continue to provide cluster services.&lt;br /&gt;
** The partition without quorum will withdraw from the cluster and shut down all cluster services.&lt;br /&gt;
&lt;br /&gt;
When the cluster reconfigures and the partition wins quorum, it will fence the node(s) in the partition without quorum. Once the fencing hes been confirmed successful, the partition with quorum will begin accessing clustered resources, like shared filesystems, thus guaranteeing the safety of those shared resources.&lt;br /&gt;
&lt;br /&gt;
This also helps explain why an even &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;50%&amp;lt;/span&amp;gt; is not enough to have quorum, a common question for people new to clustering. Using the above scenario, imagine if the split were 2 and 2 nodes. Because either can&#039;t be sure what the other would do, neither can safely proceed. If we allowed an even 50% to have quorum, both partition might try to take over the clustered services and disaster would soon follow.&lt;br /&gt;
&lt;br /&gt;
There is one, and &#039;&#039;&#039;only&#039;&#039;&#039; one except to this rule.&lt;br /&gt;
&lt;br /&gt;
In the case of a two node cluster, as we will be building here, any failure results in a 50/50 split. If we enforced quorum in a two-node cluster, there would never be high availability because and failure would cause both nodes to withdraw. The risk with this exception is that we now place the entire safety of the cluster on [[fencing]], a concept we will cover in a second. Fencing is a second line of defense and something we are loath to rely on alone.&lt;br /&gt;
&lt;br /&gt;
Even in a two-node cluster though, proper quorum can be maintained by using a quorum disk, called a [[qdisk]]. Unfortunately, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;qdisk&amp;lt;/span&amp;gt; on a [[DRBD]] resource comes with it&#039;s own problems, so we will not be able to use it here.&lt;br /&gt;
&lt;br /&gt;
== Concept; Virtual Synchrony ==&lt;br /&gt;
&lt;br /&gt;
All cluster operations, like fencing, distributed locking and so on, have to occur in the same order across all nodes. This concept is called &amp;quot;virtual synchrony&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
This is provided by &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;openais&amp;lt;/span&amp;gt; using &amp;quot;closed process groups&amp;quot;, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[CPG]]&amp;lt;/span&amp;gt;. A closed process group is simply a private group of processes in a cluster. Within this closed group, all messages are ordered and consistent.&lt;br /&gt;
&lt;br /&gt;
Let&#039;s look at how locks are handled on clustered file systems as an example.&lt;br /&gt;
&lt;br /&gt;
* As various nodes want to work on files, they send a lock request to the cluster. When they are done, they send a lock release to the cluster.&lt;br /&gt;
** Lock and unlock messages must arrive in the same order to all nodes, regardless of the real chronological order that they were issued.&lt;br /&gt;
* Let&#039;s say one node sends out messages &amp;quot;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;a1 a2 a3 a4&amp;lt;/span&amp;gt;&amp;quot;. Meanwhile, the other node sends out &amp;quot;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;b1 b2 b3 b4&amp;lt;/span&amp;gt;&amp;quot;.&lt;br /&gt;
** All of these messages go to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;openais&amp;lt;/span&amp;gt; which gathers them up, puts them into an order and then sends them out in that order.&lt;br /&gt;
** It is totally possible that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;openais&amp;lt;/span&amp;gt; will get the messages as &amp;quot;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;a2 b1 b2 a1 b4 a3 a4 b4&amp;lt;/span&amp;gt;&amp;quot;. What order is used is not important, only that the order is consistent across all nodes.&lt;br /&gt;
** The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;openais&amp;lt;/span&amp;gt; application will then ensure that all nodes get the messages in the above order, one at a time. All nodes must confirm that they got a given message before the next message is sent to any node.&lt;br /&gt;
&lt;br /&gt;
All of this ordering, within the closed process group, is &amp;quot;virtual synchrony&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
This will tie into fencing and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;totem&amp;lt;/span&amp;gt;, as we&#039;ll see in the next sections.&lt;br /&gt;
&lt;br /&gt;
== Concept; Fencing ==&lt;br /&gt;
&lt;br /&gt;
Fencing is a &#039;&#039;&#039;absolutely critical&#039;&#039;&#039; part of clustering. Without &#039;&#039;&#039;fully&#039;&#039;&#039; working fence devices, &#039;&#039;&#039;&#039;&#039;your cluster will fail&#039;&#039;&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Was that strong enough, or should I say that again? Let&#039;s be safe:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;DO NOT BUILD A CLUSTER WITHOUT PROPER, WORKING AND TESTED FENCING&#039;&#039;&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Sorry, I promise that this will be the only time that I speak so strongly. Fencing really is critical, and explaining the need for fencing is nearly a weekly event. &lt;br /&gt;
&lt;br /&gt;
So then, let&#039;s discuss fencing.&lt;br /&gt;
&lt;br /&gt;
When a node stops responding, an internal timeout and counter start ticking away. During this time, no messages are moving through the cluster because virtual synchrony is no longer possible and the cluster is, essentially, hung. If the node responds in time, the timeout and counter reset and the cluster begins operating properly again. &lt;br /&gt;
&lt;br /&gt;
If, on the other hand, the node does not respond in time, the node will be declared dead and the process of ejecting it from the cluster begins. &lt;br /&gt;
&lt;br /&gt;
The cluster will take a &amp;quot;head count&amp;quot; to see which nodes it still has contact with and will determine then if there are enough votes from those nodes to have quorum. If you are using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[qdisk]]&amp;lt;/span&amp;gt;, it&#039;s heuristics will run and then it&#039;s votes will be added. If there is sufficient votes for quorum, the cluster will issue a &amp;quot;fence&amp;quot; against the lost node. A fence action is a call sent to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fenced&amp;lt;/span&amp;gt;, the fence daemon. &lt;br /&gt;
&lt;br /&gt;
Which physical node sends the fence call is somewhat random and irrelevant. What matters is that the call comes from the [[CPG]] which has quorum.&lt;br /&gt;
&lt;br /&gt;
The fence daemon will look at the cluster configuration and get the fence devices configured for the dead node. Then, one at a time and in the order that they appear in the configuration, the fence daemon will call those fence devices, via their fence agents, passing to the fence agent any configured arguments like username, password, port number and so on. If the first fence agent returns a failure, the next fence agent will be called. If the second fails, the third will be called, then the forth and so on. Once the last (or perhaps only) fence device fails, the fence daemon will retry again, starting back at the start of the list. It will do this indefinitely until one of the fence devices success.&lt;br /&gt;
&lt;br /&gt;
Here&#039;s the flow, in point form:&lt;br /&gt;
&lt;br /&gt;
* The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;openais&amp;lt;/span&amp;gt; program collects messages and sends them off, one at a time, to all nodes.&lt;br /&gt;
* All nodes respond, and the next message is sent. Repeat continuously during normal operation.&lt;br /&gt;
* Suddenly, one node stops responding.&lt;br /&gt;
** Communication freezes while the cluster waits for the silent node. &lt;br /&gt;
** A timeout starts (~&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;238&amp;lt;/span&amp;gt;ms by default), and each time the timeout is hit, and error counter increments.&lt;br /&gt;
** The silent node responds before the counter reaches the limit.&lt;br /&gt;
*** The counter is reset to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;0&amp;lt;/span&amp;gt;&lt;br /&gt;
*** The cluster operates normally again.&lt;br /&gt;
* Again, one node stops responding.&lt;br /&gt;
** Again, the timeout begins. As each totem packet times out, a new packet is sent and the error count increments.&lt;br /&gt;
** The error counts exceed the limit (&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;4&amp;lt;/span&amp;gt; errors is the default); Roughly one second has passed (&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;238ms * 4&amp;lt;/span&amp;gt; plus some overhead).&lt;br /&gt;
** The node is declared dead.&lt;br /&gt;
** The cluster checks which members it still has, and if that provides enough votes for quorum.&lt;br /&gt;
*** If there are too few votes for quorum, the cluster software freezes and the node(s) withdraw from the cluster.&lt;br /&gt;
*** If there are enough votes for quorum, the silent node is declared dead.&lt;br /&gt;
**** &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;openais&amp;lt;/span&amp;gt; calls &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fenced&amp;lt;/span&amp;gt;, telling it to fence the node.&lt;br /&gt;
**** Which fence device(s) to use, that is, what &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fence_agent&amp;lt;/span&amp;gt; to call and what arguments to pass, is gathered.&lt;br /&gt;
**** For each configured fence device:&lt;br /&gt;
***** The agent is called and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fenced&amp;lt;/span&amp;gt; waits for the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fence_agent&amp;lt;/span&amp;gt; to exit.&lt;br /&gt;
***** The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fence_agent&amp;lt;/span&amp;gt;&#039;s exit code is examined. If it&#039;s a success, recovery starts. If it failed, the next configured fence agent is called.&lt;br /&gt;
**** If all (or the only) configured fence fails, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fenced&amp;lt;/span&amp;gt; will start over.&lt;br /&gt;
**** &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fenced&amp;lt;/span&amp;gt; will wait and loop forever until a fence agent succeeds. During this time, &#039;&#039;&#039;the cluster is hung&#039;&#039;&#039;.&lt;br /&gt;
** Once a &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fence_agent&amp;lt;/span&amp;gt; succeeds, the cluster is reconfigured.&lt;br /&gt;
*** A new closed process group (&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cpg&amp;lt;/span&amp;gt;) is formed.&lt;br /&gt;
*** A new fence domain is formed.&lt;br /&gt;
*** Lost cluster resources are recovered as per &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt;&#039;s configuration (including file system recovery as needed).&lt;br /&gt;
*** Normal cluster operation is restored.&lt;br /&gt;
&lt;br /&gt;
This skipped a few key things, but the general flow of logic should be there.&lt;br /&gt;
&lt;br /&gt;
This is why fencing is so important. Without a properly configured and tested fence device or devices, the cluster will never successfully fence and the cluster will stay hung forever.&lt;br /&gt;
&lt;br /&gt;
== Component; totem ==&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[totem]]&amp;lt;/span&amp;gt; protocol defines message passing within the cluster and it is used by &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;openais&amp;lt;/span&amp;gt;. A token is passed around all the nodes in the cluster, and the timeout discussed in [[Red_Hat_Cluster_Service_3_Tutorial#Concept;_Fencing|fencing]] above is actually a token timeout. The counter, then, is the number of lost tokens that are allowed before a node is considered dead.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;totem&amp;lt;/span&amp;gt; protocol supports something called &#039;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rrp&amp;lt;/span&amp;gt;&#039;, &#039;&#039;&#039;R&#039;&#039;&#039;edundant &#039;&#039;&#039;R&#039;&#039;&#039;ing &#039;&#039;&#039;P&#039;&#039;&#039;rotocol. Through &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rrp&amp;lt;/span&amp;gt;, you can add a second backup ring on a separate network to take over in the event of a failure in the first ring. In RHCS, these rings are known as &amp;quot;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ring 0&amp;lt;/span&amp;gt;&amp;quot; and &amp;quot;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ring 1&amp;lt;/span&amp;gt;&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
== Component; rgmanager ==&lt;br /&gt;
&lt;br /&gt;
When the cluster membership changes, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;openais&amp;lt;/span&amp;gt; tells the cluster that it needs to recheck it&#039;s resources. This causes &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt;, the resource group manager, to run. It will examine what changed and then will start, stop, migrate or recover cluster resources as needed.&lt;br /&gt;
&lt;br /&gt;
Within &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt;, one or more &#039;&#039;resources&#039;&#039; are brought together as a &#039;&#039;service&#039;&#039;. This service is then optionally assigned to a &#039;&#039;failover domain&#039;&#039;, an subset of nodes that can have preferential ordering.&lt;br /&gt;
&lt;br /&gt;
== Component; qdisk ==&lt;br /&gt;
&lt;br /&gt;
{{note|1=&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;qdisk&amp;lt;/span&amp;gt; does not work reliably on a DRBD resource, so we will not be using it in this tutorial.}}&lt;br /&gt;
&lt;br /&gt;
A Quorum disk, known as a &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;qdisk&amp;lt;/span&amp;gt; is small partition on [[SAN]] storage used to enhance quorum. It generally carries enough votes to allow even a single node to take quorum during a cluster partition. It does this by using configured heuristics, that is custom tests, to decided which which node or partition is best suited for providing clustered services during a cluster reconfiguration. These heuristics can be simple, like testing which partition has access to a given router, or they can be as complex as the administrator wishes using custom scripts.&lt;br /&gt;
&lt;br /&gt;
Though we won&#039;t be using it here, it is well worth knowing about when you move to a cluster with [[SAN]] storage.&lt;br /&gt;
&lt;br /&gt;
== Component; DRBD ==&lt;br /&gt;
&lt;br /&gt;
[[DRBD]]; Distributed Replicating Block Device, is a technology that takes raw storage from two or more nodes and keeps their data synchronized in real time. It is sometimes described as &amp;quot;RAID 1 over Nodes&amp;quot;, and that is conceptually accurate. In this tutorial&#039;s cluster, DRBD will be used to provide that back-end storage as a cost-effective alternative to a tranditional [[SAN]] or [[iSCSI]] device.&lt;br /&gt;
&lt;br /&gt;
To help visualize DRBD&#039;s use and role, Take a look at how we will implement our [[Red Hat Cluster Service 2 Tutorial#Visualizing Storage|cluster&#039;s storage]]. Don&#039;t worry if this seems illogical at this stage. The main thing to look at are the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;drbdX&amp;lt;/span&amp;gt; devices and how they each tie back to a corresponding &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;sdaY&amp;lt;/span&amp;gt; device on either node.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
         [ an-node04 ]&lt;br /&gt;
  ______   ______    ______     __[sda4]__&lt;br /&gt;
 | sda1 | | sda2 |  | sda3 |   |  ______  |       _______    ______________    ______________________________&lt;br /&gt;
 |______| |______|  |______|   | | sda5 |-+------| drbd0 |--| drbd_sh0_vg0 |--| /dev/drbd_sh0_vg0/xen_shared |&lt;br /&gt;
     |        |         |      | |______| |   /--|_______|  |______________|  |______________________________|&lt;br /&gt;
  ___|___    _|_    ____|____  |  ______  |   |     _______    ______________    ____________________________&lt;br /&gt;
 | /boot |  | / |  | &amp;lt;swap&amp;gt;  | | | sda6 |-+---+----| drbd1 |--| drbd_an4_vg0 |--| /dev/drbd_an4_vg0/vm0001_1 |&lt;br /&gt;
 |_______|  |___|  |_________| | |______| |   | /--|_______|  |______________|  |____________________________|&lt;br /&gt;
                               |  ______  |   | |     _______    ______________    ____________________________&lt;br /&gt;
                               | | sda7 |-+---+-+----| drbd2 |--| drbd_an5_vg0 |--| /dev/drbd_an4_vg0/vm0002_1 | &lt;br /&gt;
                               | |______| |   | | /--|_______|  |______________|  |____________________________|&lt;br /&gt;
                               |  ______  |   | | |                         | |    _______________________&lt;br /&gt;
                               | | sda8 |-+---+-+-+--\                      | \---| Example LV for 2nd VM |&lt;br /&gt;
                               | |______| |   | | |  |                      |     |_______________________|&lt;br /&gt;
                               |__________|   | | |  |                      |      _______________________&lt;br /&gt;
         [ an-node05 ]                        | | |  |                      \-----| Example LV for 3rd VM |&lt;br /&gt;
  ______   ______    ______     __[sda4]__    | | |  |                            |_______________________|&lt;br /&gt;
 | sda1 | | sda2 |  | sda3 |   |  ______  |   | | |  |                   &lt;br /&gt;
 |______| |______|  |______|   | | sda5 |-+---/ | |  |   _______    __________________&lt;br /&gt;
     |        |         |      | |______| |     | |  \--| drbd3 |--| Spare PV for     |&lt;br /&gt;
  ___|___    _|_    ____|____  |  ______  |     | |  /--|_______|  | future expansion |&lt;br /&gt;
 | /boot |  | / |  | &amp;lt;swap&amp;gt;  | | | sda6 |-+-----/ |  |             |__________________|&lt;br /&gt;
 |_______|  |___|  |_________| | |______| |       |  |&lt;br /&gt;
                               |  ______  |       |  |&lt;br /&gt;
                               | | sda7 |-+-------/  |&lt;br /&gt;
                               | |______| |          |&lt;br /&gt;
                               |  ______  |          |&lt;br /&gt;
                               | | sda8 |-+----------/&lt;br /&gt;
                               | |______| |&lt;br /&gt;
                               |__________|&lt;br /&gt;
.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Component; CLVM ==&lt;br /&gt;
&lt;br /&gt;
With [[DRBD]] providing the raw storage for the cluster, we must next consider partitions. This is where Clustered [[LVM]], known as [[CLVM]], comes into play.&lt;br /&gt;
&lt;br /&gt;
CLVM is ideal in that by using [[DLM]], the distributed lock manager, it won&#039;t allow access to cluster members outside of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;openais&amp;lt;/span&amp;gt;&#039;s closed process group, which, in turn, requires quorum.&lt;br /&gt;
&lt;br /&gt;
It is ideal because it can take one or more raw devices, known as &amp;quot;physical volumes&amp;quot;, or simple as [[PV]]s, and combine their raw space into one or more &amp;quot;volume groups&amp;quot;, known as [[VG]]s. These volume groups then act just like a typical hard drive and can be &amp;quot;partitioned&amp;quot; into one or more &amp;quot;logical volumes&amp;quot;, known as [[LV]]s. These LVs are where [[Xen]]&#039;s [[domU]] virtual machines will exist and where we will create our [[GFS2]] clustered file system.&lt;br /&gt;
&lt;br /&gt;
LVM is particularly attractive because of how incredibly flexible it is. We can easily add new physical volumes later, and then grow an existing volume group to use the new space. This new space can then be given to existing logical volumes, or entirely new logical volumes can be created. This can all be done while the cluster is online offering an upgrade path with no down time.&lt;br /&gt;
&lt;br /&gt;
== Component; GFS2 ==&lt;br /&gt;
&lt;br /&gt;
With [[DRBD]] providing the clusters raw storage space, and [[CLVM|Clustered LVM]] providing the logical partitions, we can now look at the clustered file system. This is the role of the Global File System version 2, known simply as [[GFS2]].&lt;br /&gt;
&lt;br /&gt;
It works much like standard filesystem, with user-land tools like &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;mkfs.gfs2&amp;lt;/span&amp;gt;, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fsck.gfs2&amp;lt;/span&amp;gt; and so on. The major difference is that it and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clvmd&amp;lt;/span&amp;gt; use the cluster&#039;s [[DLM|distributed locking mechanism]] provided by the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;dlm_controld&amp;lt;/span&amp;gt; daemon. Once formatted, the GFS2-formatted partition can be mounted and used by any node in the cluster&#039;s [[CPG|closed process group]]. All nodes can then safely read from and write to the data on the partition simultaneously.&lt;br /&gt;
&lt;br /&gt;
== Component; DLM ==&lt;br /&gt;
&lt;br /&gt;
One of the major roles of a cluster is to provide [[DLM|distributed locking]] on clustered storage. In fact, storage software can not be clustered without using [[DLM]], as provided by the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;dlm_controld&amp;lt;/span&amp;gt; daemon and using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;openais&amp;lt;/span&amp;gt;&#039;s virtual synchrony via [[CPG]]. &lt;br /&gt;
&lt;br /&gt;
Through DLM, all nodes accessing clustered storage are guaranteed to get [[POSIX]] locks, called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;plock&amp;lt;/span&amp;gt;s, in the same order across all nodes. Both [[CLVM]] and [[GFS2]] rely on DLM, though other clustered storage, like OCFS2, use it as well.&lt;br /&gt;
&lt;br /&gt;
== Component; Xen ==&lt;br /&gt;
&lt;br /&gt;
Two of the most popular open-source virtualization platforms available in the Linux world today and [[Xen]] and [[KVM]]. The former is maintained by [http://www.citrix.com/xenserver Citrix] and the other by [http://www.redhat.com/solutions/virtualization/ Redhat]. It would be difficult to say which is &amp;quot;better&amp;quot;, as they&#039;re both very good. Xen can be argued to be more mature where KVM is the &amp;quot;official&amp;quot; solution supported by Red Hat in [[EL6]].&lt;br /&gt;
&lt;br /&gt;
We will be using the Xen [[hypervisor]] and a &amp;quot;host&amp;quot; virtual server called [[dom0]]. In Xen, every machine is a virtual server, including the system you installed when you built the server. This is possible thanks to a small Xen micro-operating system that initially boots, then starts up your original installed operating system as a virtual server with special access to the underlying hardware and hypervisor management tools.&lt;br /&gt;
&lt;br /&gt;
The rest of the virtual servers in a Xen environment are collectively called &amp;quot;[[domU]]&amp;quot; virtual servers. These will be the highly-available resource that will migrate between nodes during failure events in our cluster.&lt;br /&gt;
&lt;br /&gt;
= Base Setup =&lt;br /&gt;
&lt;br /&gt;
Before we can look at the cluster, we must first build two cluster nodes and then install the operating system.&lt;br /&gt;
&lt;br /&gt;
== Hardware Requirements ==&lt;br /&gt;
&lt;br /&gt;
The bare minimum requirements are;&lt;br /&gt;
&lt;br /&gt;
* All hardware must be supported by [[EL5]]. It is strongly recommended that you check compatibility before making any purchases.&lt;br /&gt;
* A dual-core [[CPU]] with hardware virtualization support.&lt;br /&gt;
* Three network cards; At least one should be gigabit or faster.&lt;br /&gt;
* One hard drive.&lt;br /&gt;
* 2 [[GiB]] of [[RAM]]&lt;br /&gt;
* A [[fence|fence device]]. This can be an [[IPMI]]-enabled server, a [http://nodeassassin.org Node Assassin], a [http://www.apc.com/products/resource/include/techspec_index.cfm?base_sku=AP7900 switched PDU] or similar.&lt;br /&gt;
&lt;br /&gt;
This tutorial was written using the following hardware:&lt;br /&gt;
&lt;br /&gt;
* AMD Athlon [http://products.amd.com/en-us/DesktopCPUDetail.aspx?id=610 II X4 600e Processor]&lt;br /&gt;
* ASUS [http://www.asus.com/product.aspx?P_ID=LVmksAnszmVimOOp M4A785T-M/CSM]&lt;br /&gt;
* 4GB Kingston [http://www.ec.kingston.com/ecom/configurator_new/partsinfo.asp?root=&amp;amp;LinkBack=&amp;amp;ktcpartno=KVR1333D3N9K2/4G KVR1333D3N9K2/4G], 4GB (2x2GB) DDR3-1333, Non-ECC&lt;br /&gt;
* Seagate [http://www.seagate.com/ww/v/index.jsp?vgnextoid=70f4bfafecadd110VgnVCM100000f5ee0a0aRCRD ST9500420AS] 2.5&amp;quot; SATA HDD&lt;br /&gt;
* 2x Intel [http://www.intel.com/products/desktop/adapters/gigabit-ct/gigabit-ct-overview.htm Pro/1000CT EXPI9301CT] PCIe NICs&lt;br /&gt;
* [[Node Assassin v1.1.4]]&lt;br /&gt;
&lt;br /&gt;
This is not an endorsement of the above hardware. I put a heavy emphasis on minimizing power consumption and bought what was within my budget. This hardware was never meant to be put into production, but instead was chosen to serve the purpose of my own study and for creating this tutorial. What you ultimately choose to use, provided it meets the minimum requirements, is entirely up to you and your requirements.&lt;br /&gt;
&lt;br /&gt;
{{note|1=I use three physical [[NIC]]s, but you can get away with two by merging the storage and back-channel networks, which we will discuss shortly. If you are really in a pinch, you could create three aliases on on interface and isolate them using [[VLAN]]s. If you go this route, please ensure that your VLANs are configured and working before beginning this tutorial. Pay close attention to multicast traffic.}}&lt;br /&gt;
&lt;br /&gt;
== Pre-Assembly ==&lt;br /&gt;
&lt;br /&gt;
Before you assemble your nodes, take a moment to record the [[MAC]] addresses of each network interface and then note where each interface is physically installed. This will help you later when configuring the networks. I generally create a simple text file with the MAC addresses, the interface I intend to assign to it and where it physically is located.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
-=] an-node04&lt;br /&gt;
48:5B:39:3C:53:15   # eth0 - onboard interface&lt;br /&gt;
00:1B:21:72:9B:5A   # eth1 - right-most PCIe interface&lt;br /&gt;
00:1B:21:72:96:EA   # eth2 - left-most PCIe interface&lt;br /&gt;
&lt;br /&gt;
-=] an-node05&lt;br /&gt;
48:5B:39:3C:53:13   # eth0 - onboard interface&lt;br /&gt;
00:1B:21:72:99:AB   # eth1 - right-most PCIe interface&lt;br /&gt;
00:1B:21:72:96:A6   # eth2 - left-most PCIe interface&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== OS Install ==&lt;br /&gt;
&lt;br /&gt;
Later steps will include packages to install, so the initial OS install can be minimal. I like to change the default run-level to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;3&amp;lt;/span&amp;gt;, remove &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rhgb quiet&amp;lt;/span&amp;gt; from the [[grub]] menu, disable the firewall and disable [[SELinux]]. In a production cluster, you will want to use firewalling and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;selinux&amp;lt;/span&amp;gt;, but until you finish studying, leave it off to keep things simple.&lt;br /&gt;
&lt;br /&gt;
{{note|1=Before [[EL5]].4, you could not use SELinux. It is now possible to use it, and it is recommended that you do so in any production cluster.}}&lt;br /&gt;
{{note|1=Ports and protocols to open in a firewall will be discussed later in the networking section.}}&lt;br /&gt;
&lt;br /&gt;
I like to minimize and automate my installs as much as possible. To that end, I run a little [[Setting Up a PXE Server in Fedora|PXE]] server on my network and use a [[kickstart]] script to automate the install. Here is a simple one for use on a single-drive node:&lt;br /&gt;
* [[generic_el5_node.ks]]&lt;br /&gt;
&lt;br /&gt;
If you decide to manually install [[EL5]] on your nodes, please try to keep the installation as small as possible. The fewer packages installed, the fewer sources of problems and vectors for attack.&lt;br /&gt;
&lt;br /&gt;
== Post Install OS Changes ==&lt;br /&gt;
&lt;br /&gt;
This section discusses changes I recommend, but are not required. If you wish to adapt any of the steps below, please do so but be sure to keep the changes consistent through out the implementation of this tutorial.&lt;br /&gt;
&lt;br /&gt;
=== Network Planning ===&lt;br /&gt;
&lt;br /&gt;
The most important change that is recommended is to get your nodes into a consistent networking configuration. This will prove very handy when trying to keep track of your networks and where they&#039;re physically connected. This becomes exponentially more helpful as your cluster grows.&lt;br /&gt;
&lt;br /&gt;
The first step is to understand the three networks we will be creating. Once you understand their role, you will need to decide which interface on the nodes will be used for each network.&lt;br /&gt;
&lt;br /&gt;
==== Cluster Networks ====&lt;br /&gt;
&lt;br /&gt;
The three networks are;&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Network&lt;br /&gt;
!Acronym&lt;br /&gt;
!Use&lt;br /&gt;
|-&lt;br /&gt;
|Back-Channel Network&lt;br /&gt;
|&#039;&#039;&#039;BCN&#039;&#039;&#039;&lt;br /&gt;
|Private cluster communications, virtual machine migrations, fence devices&lt;br /&gt;
|-&lt;br /&gt;
|Storage Network&lt;br /&gt;
|&#039;&#039;&#039;SN&#039;&#039;&#039;&lt;br /&gt;
|Used exclusively for storage communications. Possible to use as totem&#039;s redundant ring.&lt;br /&gt;
|-&lt;br /&gt;
|Internet-Facing Network&lt;br /&gt;
|&#039;&#039;&#039;IFN&#039;&#039;&#039;&lt;br /&gt;
|Internet-polluted network. No cluster, storage or cluster device communication.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Things To Consider ====&lt;br /&gt;
&lt;br /&gt;
When planning which interfaces to connect to each network, consider the following, in order of importance:&lt;br /&gt;
&lt;br /&gt;
* If your nodes have [[IPMI]] and an interface sharing a physical [[RJ-45]] connector, this must be on the &#039;&#039;&#039;Back-Channel Network&#039;&#039;&#039;. The reasoning is that having your fence device accessible on the &#039;&#039;&#039;Internet-Facing Network&#039;&#039;&#039; poses a &#039;&#039;major&#039;&#039; security risk. Having the IPMI interface on the &#039;&#039;&#039;Storage Network&#039;&#039;&#039; can cause problems if a fence is fired and the network is saturated with storage traffic.&lt;br /&gt;
&lt;br /&gt;
* The lowest-latency network interface should be used as the &#039;&#039;&#039;Back-Channel Network&#039;&#039;&#039;. The cluster is maintained by [[multicast]] messaging between the nodes using something called the [[totem]] protocol. Any delay in the delivery of these messages can risk causing a failure and ejection of effected nodes when no actual failure existed. This will be discussed in greater detail later.&lt;br /&gt;
&lt;br /&gt;
* The network with the most raw bandwidth should be used for the &#039;&#039;&#039;Storage Network&#039;&#039;&#039;. All disk writes must be sent across the network and committed to the remote nodes before the write is declared complete. This causes the network to become the disk I/O bottle neck. Using a network with jumbo frames and high raw throughput will help minimize this bottle neck.&lt;br /&gt;
&lt;br /&gt;
* During the live migration of virtual machines, the VM&#039;s RAM is copied to the other node using the &#039;&#039;&#039;BCN&#039;&#039;&#039;. For this reason, the second fastest network should be used for back-channel communication. However, these copies can saturate the network, so care must be taken to ensure that cluster communications get higher priority. This can be done using a managed switch. If you can not ensure priority for totem multicast, then be sure to configure Xen later to use the storage network for migrations.&lt;br /&gt;
&lt;br /&gt;
* The remain, slowest interface should be used for the &#039;&#039;&#039;IFN&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
==== Planning the Networks ====&lt;br /&gt;
&lt;br /&gt;
This paper will use the following setup. Feel free to alter the interface to network mapping and the [[IP]] [[subnet]]s used to best suit your needs. For reasons completely my own, I like to start my cluster IPs final [[octal]] at &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;71&amp;lt;/span&amp;gt; for node 1 and then increment up from there. This is entirely arbitrary, so please use what ever makes sense to you. The remainder of this tutorial will follow the convention below:&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Network&lt;br /&gt;
!Interface&lt;br /&gt;
!Subnet&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;IFN&#039;&#039;&#039;&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth0&amp;lt;/span&amp;gt;&lt;br /&gt;
|&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;
|&#039;&#039;&#039;SN&#039;&#039;&#039;&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth1&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;192.168.2.0/24&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;BCN&#039;&#039;&#039;&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth2&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;192.139.3.0/24&amp;lt;/span&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
This translates to the following per-node configuration:&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!colspan=&amp;quot;2&amp;quot;|&lt;br /&gt;
!colspan=&amp;quot;2&amp;quot;|an-node04&lt;br /&gt;
!colspan=&amp;quot;2&amp;quot;|an-node05&lt;br /&gt;
|-&lt;br /&gt;
!&lt;br /&gt;
!Interface&lt;br /&gt;
!IP Address&lt;br /&gt;
!Host Name(s)&lt;br /&gt;
!IP Address&lt;br /&gt;
!Host Name(s)&lt;br /&gt;
|-&lt;br /&gt;
!IFN&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth0&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;192.168.1.74&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04.ifn&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;192.168.1.75&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05.ifn&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!SN&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth1&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;192.168.2.74&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04.sn&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;192.168.2.75&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05.sn&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!BCN&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth2&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;192.168.3.74&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04 an-node04.alteeve.com an-node04.bcn&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;192.168.3.75&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05 an-node05.alteeve.com an-node05.bcn&amp;lt;/span&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Network Configuration ===&lt;br /&gt;
&lt;br /&gt;
So now we&#039;ve planned the network, so it is time to implement it.&lt;br /&gt;
&lt;br /&gt;
==== Warning About Managed Switches ====&lt;br /&gt;
&lt;br /&gt;
{{warning|1=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 and configuring [[Multicast IGMP Snooping]] or [[Spanning Tree Protocol]]. They have been known to cause problems by not allowing multicast packets to reach all nodes fast enough or at all. This can cause somewhat random break-downs in communication between your nodes, leading to seemingly random fences and DLM lock timeouts. If your switches support [[PIM Routing]], be sure to use it!&lt;br /&gt;
&lt;br /&gt;
If you have problems with your cluster not forming, or seemingly random fencing, try using a cheap [http://dlink.ca/products/?pid=230 unmanaged] switch. If the problem goes away, you are most likely dealing with a managed switch configuration problem.&lt;br /&gt;
&lt;br /&gt;
==== Disable Firewalling ====&lt;br /&gt;
&lt;br /&gt;
To &amp;quot;keep things simple&amp;quot;, we will disable all firewalling on the cluster nodes. This is not recommended in production environments, obviously, so below will be a table of ports and protocols to open when you do get into production. Until then, we will simply use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;chkconfig&amp;lt;/span&amp;gt; to 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;.&lt;br /&gt;
&lt;br /&gt;
{{note|1=Cluster 2 does not support [[IPv6]], so you can skip or ignore it if you wish. I like to disable it just to be certain that it can&#039;t cause issues though.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
chkconfig iptables off&lt;br /&gt;
chkconfig ip6tables off&lt;br /&gt;
/etc/init.d/iptables stop&lt;br /&gt;
/etc/init.d/ip6tables stop&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now confirm that they are off by having &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; list their rules.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
iptables -L&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Chain INPUT (policy ACCEPT)&lt;br /&gt;
target     prot opt source               destination         &lt;br /&gt;
&lt;br /&gt;
Chain FORWARD (policy ACCEPT)&lt;br /&gt;
target     prot opt source               destination         &lt;br /&gt;
&lt;br /&gt;
Chain OUTPUT (policy ACCEPT)&lt;br /&gt;
target     prot opt source               destination         &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;
ip6tables -L&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Chain INPUT (policy ACCEPT)&lt;br /&gt;
target     prot opt source               destination         &lt;br /&gt;
&lt;br /&gt;
Chain FORWARD (policy ACCEPT)&lt;br /&gt;
target     prot opt source               destination         &lt;br /&gt;
&lt;br /&gt;
Chain OUTPUT (policy ACCEPT)&lt;br /&gt;
target     prot opt source               destination         &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When you do prepare to go into production, these are the protocols and ports you need to open between cluster nodes. Remember to allow multicast communications as well!&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Port&lt;br /&gt;
!Protocol&lt;br /&gt;
!Component&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;5404&amp;lt;/span&amp;gt;, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;5405&amp;lt;/span&amp;gt;&lt;br /&gt;
|[[UDP]]&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[cman]]&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;8084&amp;lt;/span&amp;gt;, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;5405&amp;lt;/span&amp;gt;&lt;br /&gt;
|[[TCP]]&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[luci]]&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;11111&amp;lt;/span&amp;gt;&lt;br /&gt;
|[[TCP]]&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[ricci]]&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;14567&amp;lt;/span&amp;gt;&lt;br /&gt;
|[[TCP]]&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[gnbd]]&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;16851&amp;lt;/span&amp;gt;&lt;br /&gt;
|[[TCP]]&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[modclusterd]]&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;21064&amp;lt;/span&amp;gt;&lt;br /&gt;
|[[TCP]]&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[dlm]]&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;50006&amp;lt;/span&amp;gt;, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;50008&amp;lt;/span&amp;gt;, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;50009&amp;lt;/span&amp;gt;&lt;br /&gt;
|[[TCP]]&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[ccsd]]&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;50007&amp;lt;/span&amp;gt;&lt;br /&gt;
|[[UDP]]&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[ccsd]]&amp;lt;/span&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Disable NetworkManager, Enable network ====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;NetworkManager&amp;lt;/span&amp;gt; daemon is an excellent daemon in environments where a system connects to a variety of networks. The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;NetworkManager&amp;lt;/span&amp;gt; daemon handles changing the networking configuration whenever it senses a change in the network state, like when a cable is unplugged or a wireless network comes or goes. As useful as this is on laptops and workstations, it can be detrimental in a cluster.&lt;br /&gt;
&lt;br /&gt;
To prevent the networking from changing once we&#039;ve got it setup, we want to replace &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;NetworkManager&amp;lt;/span&amp;gt; daemon with the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;network&amp;lt;/span&amp;gt; initialization script. The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;network&amp;lt;/span&amp;gt; script will start and stop networking, but otherwise it will leave the configuration alone. This is ideal in servers, and doubly-so in clusters given their sensitivity to transient network issues.&lt;br /&gt;
&lt;br /&gt;
Start by removing &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;NetworkManager&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 remove NetworkManager NetworkManager-glib NetworkManager-gnome NetworkManager-devel NetworkManager-glib-devel&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now you want to ensure that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;network&amp;lt;/span&amp;gt; starts with the system.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
chkconfig network on&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Setup /etc/hosts ====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/hosts&amp;lt;/span&amp;gt; file, by default, will resolve the hostname to the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;lo&amp;lt;/span&amp;gt; (&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;127.0.0.1&amp;lt;/span&amp;gt;) interface. The cluster uses this name though for knowing which interface to use for the [[totem]] protocol (and thus all cluster communications). To this end, we will remove the hostname from &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;127.0.0.1&amp;lt;/span&amp;gt; and instead put it on the IP of our &#039;&#039;&#039;BCN&#039;&#039;&#039; interface. We will also add entries for all other networks for both nodes in the cluster along with entries for the fence device(s). &lt;br /&gt;
&lt;br /&gt;
Once done, the edited &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/hosts&amp;lt;/span&amp;gt; file should be suitable for copying to both nodes in the cluster.&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;
# Do not remove the following line, or various programs&lt;br /&gt;
# that require network functionality will fail.&lt;br /&gt;
127.0.0.1	localhost.localdomain localhost&lt;br /&gt;
::1		localhost6.localdomain6 localhost6&lt;br /&gt;
&lt;br /&gt;
192.168.1.74	an-node04.ifn&lt;br /&gt;
192.168.2.74	an-node04.sn&lt;br /&gt;
192.168.3.74	an-node04 an-node04.bcn an-node04.alteeve.com&lt;br /&gt;
&lt;br /&gt;
192.168.1.75	an-node05.ifn&lt;br /&gt;
192.168.2.75	an-node05.sn&lt;br /&gt;
192.168.3.75	an-node05 an-node05.bcn an-node05.alteeve.com&lt;br /&gt;
&lt;br /&gt;
192.168.3.61	fence_na01.alteeve.com	# Node Assassin&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Mapping Interfaces to ethX Names ====&lt;br /&gt;
&lt;br /&gt;
Chances are good that the assignment of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ethX&amp;lt;/span&amp;gt; interface names to your physical network cards is not ideal. There is no strict technical reason to change the mapping, but it will make your life a lot easier if all nodes use the same &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ethX&amp;lt;/span&amp;gt; names for the same subnets. &lt;br /&gt;
&lt;br /&gt;
The actual process of changing the mapping is a little involved. For this reason, there is a dedicated mini-tutorial which you can find below. Please jump to it and then return once your mapping is as you like it.&lt;br /&gt;
&lt;br /&gt;
* [[Changing the ethX to Ethernet Device Mapping in EL5]]&lt;br /&gt;
&lt;br /&gt;
==== Set IP Addresses ====&lt;br /&gt;
&lt;br /&gt;
The last step in setting up the network interfaces is to manually assign the IP addresses and define the subnets for the interfaces. This involves directly editing the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/sysconfig/network-scripts/ifcfg-ethX&amp;lt;/span&amp;gt; files. There are a large set of options that can be set in these configuration files, but most are outside the scope of this tutorial. To get a better understanding of the available options, please see:&lt;br /&gt;
&lt;br /&gt;
* [http://docs.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/5/html/Deployment_Guide/s1-networkscripts-interfaces.html Red Hat&#039;s Interface Configuration Guide]&lt;br /&gt;
&lt;br /&gt;
{{note|1=Later on, we will be creating two bridges, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xenbr0&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xenbr2&amp;lt;/span&amp;gt; which we will then connect [[dom0]]&#039;s &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; to. These bridges then become available to the [[Xen]]&#039;s [[domU]] VMs. Bridge options and arguments can be found in the link above.}}&lt;br /&gt;
&lt;br /&gt;
Here are the three configuration files from &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt; which you can use as guides. Please &#039;&#039;&#039;do not&#039;&#039;&#039; copy these over your files! Doing so will cause your interfaces to fail outright as every interface&#039;s [[MAC]] address is unique. Adapt these to suite your needs.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/sysconfig/network-scripts/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;
# Realtek Semiconductor Co., Ltd. RTL8111/8168B PCI Express Gigabit Ethernet controller&lt;br /&gt;
HWADDR=48:5B:39:3C:53:14&lt;br /&gt;
DEVICE=eth0&lt;br /&gt;
BOOTPROTO=static&lt;br /&gt;
ONBOOT=yes&lt;br /&gt;
IPADDR=192.168.1.74&lt;br /&gt;
NETMASK=255.255.255.0&lt;br /&gt;
GATEWAY=192.168.1.254&lt;br /&gt;
DNS1=192.139.81.117&lt;br /&gt;
DNS2=192.139.81.1&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;
vim /etc/sysconfig/network-scripts/ifcfg-eth1&lt;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 82574L Gigabit Network Connection&lt;br /&gt;
HWADDR=00:1B:21:72:9B:5A&lt;br /&gt;
DEVICE=eth1&lt;br /&gt;
BOOTPROTO=static&lt;br /&gt;
ONBOOT=yes&lt;br /&gt;
IPADDR=192.168.2.74&lt;br /&gt;
NETMASK=255.255.255.0&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;
vim /etc/sysconfig/network-scripts/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 82574L Gigabit Network Connection&lt;br /&gt;
HWADDR=00:1B:21:72:96:EA&lt;br /&gt;
DEVICE=eth2&lt;br /&gt;
BOOTPROTO=static&lt;br /&gt;
ONBOOT=yes&lt;br /&gt;
IPADDR=192.168.3.74&lt;br /&gt;
NETMASK=255.255.255.0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you do not want to use the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;DNSx=&amp;lt;/span&amp;gt; options, you will need to setup the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/resolv.conf&amp;lt;/span&amp;gt; file for [[DNS]] resolution. You can learn more about this file&#039;s purpose by reading it&#039;s [[man]] page; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;man resolv.conf&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Finally, restart &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;network&amp;lt;/span&amp;gt; and you should have you interfaces setup properly.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/network 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;
Shutting down interface eth0:                              [  OK  ]&lt;br /&gt;
Shutting down interface eth1:                              [  OK  ]&lt;br /&gt;
Shutting down interface eth2:                              [  OK  ]&lt;br /&gt;
Shutting down loopback interface:                          [  OK  ]&lt;br /&gt;
Bringing up loopback interface:                            [  OK  ]&lt;br /&gt;
Bringing up interface eth0:                                [  OK  ]&lt;br /&gt;
Bringing up interface eth1:                                [  OK  ]&lt;br /&gt;
Bringing up interface eth2:                                [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can verify your configuration using the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ifconfig&amp;lt;/span&amp;gt; tool. The output below is from &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&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;
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:3974 errors:0 dropped:0 overruns:0 frame:0&lt;br /&gt;
          TX packets:1810 errors:0 dropped:0 overruns:0 carrier:0&lt;br /&gt;
          collisions:0 txqueuelen:1000 &lt;br /&gt;
          RX bytes:1452567 (1.3 MiB)  TX bytes:237057 (231.5 KiB)&lt;br /&gt;
          Interrupt:246 Base address:0xe000 &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:117 errors:0 dropped:0 overruns:0 frame:0&lt;br /&gt;
          TX packets:62 errors:0 dropped:0 overruns:0 carrier:0&lt;br /&gt;
          collisions:0 txqueuelen:1000 &lt;br /&gt;
          RX bytes:30766 (30.0 KiB)  TX bytes:16018 (15.6 KiB)&lt;br /&gt;
          Interrupt:17 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:54 errors:0 dropped:0 overruns:0 frame:0&lt;br /&gt;
          TX packets:60 errors:0 dropped:0 overruns:0 carrier:0&lt;br /&gt;
          collisions:0 txqueuelen:1000 &lt;br /&gt;
          RX bytes:11492 (11.2 KiB)  TX bytes:15638 (15.2 KiB)&lt;br /&gt;
          Interrupt:16 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:34 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:0 &lt;br /&gt;
          RX bytes:9268 (9.0 KiB)  TX bytes:9268 (9.0 KiB)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{note|1=You may see a &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virbr0&amp;lt;/span&amp;gt; interface. You can safely ignore it, we will remove it later.}}&lt;br /&gt;
&lt;br /&gt;
=== Setting up SSH ===&lt;br /&gt;
&lt;br /&gt;
Setting up [[SSH]] shared keys will allow your nodes to pass files between one another and execute commands remotely without needing to enter a password. This will be needed later when we want to enable applications like &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;libvirtd&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-manager&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
SSH is, on it&#039;s own, a very big topic. If you are not familiar with SSH, please take some time to learn about it before proceeding. A great first step is the [http://en.wikipedia.org/wiki/Secure_Shell Wikipedia] entry on SSH, as well as the SSH [[man]] page; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;man ssh&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[SSH]] 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 on each node, 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;
Created directory &#039;/root/.ssh&#039;.&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;
a1:65:a9:50:bb:15:ae:b1:6e:06:12:4a:29:d1:68:f3 root@an-node04.alteeve.com&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_rsa&amp;lt;/span&amp;gt; and the public key called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;~/.ssh/id_rsa.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;
MIIEnwIBAAKCAQBTNg6FZyDKm4GAm7c+F2enpLWy+t8ZZjm4Z3Q7EhX09ukqk/Qm&lt;br /&gt;
MqprtI9OsiRVjce+wGx4nZ8+Z0NHduCVuwAxG0XG7FpKkUJC3Qb8KhyeIpKEcfYA&lt;br /&gt;
tsDUFnWddVF8Tsz6dDOhb61tAke77d9E01NfyHp88QBxjJ7w+ZgB2eLPBFm6j1t+&lt;br /&gt;
K50JHwdcFfxrZFywKnAQIdH0NCs8VaW91fQZBupg4OGOMpSBnVzoaz2ybI9bQtbZ&lt;br /&gt;
4GwhCghzKx7Qjz20WiqhfPMfFqAZJwn0WXfjALoioMDWavTbx+J2HM8KJ8/YkSSK&lt;br /&gt;
dDEgZCItg0Q2fC35TDX+aJGu3xNfoaAe3lL1AgEjAoIBABVlq/Zq+c2y9Wo2q3Zd&lt;br /&gt;
yjJsLrj+rmWd8ZXRdajKIuc4LVQXaqq8kjjz6lYQjQAOg9H291I3KPLKGJ1ZFS3R&lt;br /&gt;
AAygnOoCQxp9H6rLHw2kbcJDZ4Eknlf0eroxqTceKuVzWUe3ev2gX8uS3z70BjZE&lt;br /&gt;
+C6SoydxK//w9aut5UJN+H5f42p95IsUIs0oy3/3KGPHYrC2Zgc2TIhe25huie/O&lt;br /&gt;
psKhHATBzf+M7tHLGia3q682JqxXru8zhtPOpEAmU4XDtNdL+Bjv+/Q2HMRstJXe&lt;br /&gt;
2PU3IpVBkirEIE5HlyOV1T802KRsSBelxPV5Y6y5TRq+cEwn0G2le1GiFBjd0xQd&lt;br /&gt;
0csCgYEA2BWkxSXhqmeb8dzcZnnuBZbpebuPYeMtWK/MMLxvJ50UCUfVZmA+yUUX&lt;br /&gt;
K9fAUvkMLd7V8/MP7GrdmYq2XiLv6IZPUwyS8yboovwWMb+72vb5QSnN6LAfpUEk&lt;br /&gt;
NRd5JkWgqRstGaUzxeCRfwfIHuAHikP2KeiLM4TfBkXzhm+VWjECgYBilQEBHvuk&lt;br /&gt;
LlY2/1v43zYQMSZNHBSbxc7R5mnOXNFgapzJeFKvaJbVKRsEQTX5uqo83jRXC7LI&lt;br /&gt;
t14pC23tpW1dBTi9bNLzQnf/BL9vQx6KFfgrXwy8KqXuajfv1ECH6ytqdttkUGZt&lt;br /&gt;
TE/monjAmR5EVElvwMubCPuGDk9zC7iQBQKBgG8hEukMKunsJFCANtWdyt5NnKUB&lt;br /&gt;
X66vWSZLyBkQc635Av11Zm8qLusq2Ld2RacDvR7noTuhkykhBEBV92Oc8Gj0ndLw&lt;br /&gt;
hhamS8GI9Xirv7JwYu5QA377ff03cbTngCJPsbYN+e/uj6eYEE/1X5rZnXpO1l6y&lt;br /&gt;
G7QYcrLE46Q5YsCrAoGAL+H5LG4idFEFTem+9Tk3hDUhO2VpGHYFXqMdctygNiUn&lt;br /&gt;
lQ6Oj7Z1JbThPJSz0RGF4wzXl/5eJvn6iPbsQDpoUcC1KM51FxGn/4X2lSCZzgqr&lt;br /&gt;
vUtslejUQJn96YRZ254cZulF/YYjHyUQ3byhDRcr9U2CwUBi5OcbFTomlvcQgHcC&lt;br /&gt;
gYEAtIpaEWt+Akz9GDJpKM7Ojpk8wTtlz2a+S5fx3WH/IVURoAzZiXzvonVIclrH&lt;br /&gt;
5RXFiwfoXlMzIulZcrBJZfTgRO9A2v9rE/ZRm6qaDrGe9RcYfCtxGGyptMKLdbwP&lt;br /&gt;
UW1emRl5celU9ZEZRBpIVTES5ZVWqD2RkkkNNJbPf5F/x+w=&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; (wrapped to make it more readable):&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 AAAAB3NzaC1yc2EAAAABIwAAAQBTNg6FZyDKm4GAm7c+F2enpLWy+t8Z&lt;br /&gt;
Zjm4Z3Q7EhX09ukqk/QmMqprtI9OsiRVjce+wGx4nZ8+Z0NHduCVuwAxG0XG7FpK&lt;br /&gt;
kUJC3Qb8KhyeIpKEcfYAtsDUFnWddVF8Tsz6dDOhb61tAke77d9E01NfyHp88QBx&lt;br /&gt;
jJ7w+ZgB2eLPBFm6j1t+K50JHwdcFfxrZFywKnAQIdH0NCs8VaW91fQZBupg4OGO&lt;br /&gt;
MpSBnVzoaz2ybI9bQtbZ4GwhCghzKx7Qjz20WiqhfPMfFqAZJwn0WXfjALoioMDW&lt;br /&gt;
avTbx+J2HM8KJ8/YkSSKdDEgZCItg0Q2fC35TDX+aJGu3xNfoaAe3lL1 root@an&lt;br /&gt;
-node04.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-node04&#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-node05&lt;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-node05 (192.168.3.75)&#039; can&#039;t be established.&lt;br /&gt;
RSA key fingerprint is 55:58:c3:32:e4:e6:5e:32:c1:db:5c:f1:36:e2:da:4b.&lt;br /&gt;
Are you sure you want to continue connecting (yes/no)? yes&lt;br /&gt;
Warning: Permanently added &#039;an-node05,192.168.3.75&#039; (RSA) to the list of known hosts.&lt;br /&gt;
Last login: Fri Mar 11 20:45:58 2011 from 192.168.1.202&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-node05&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-node04&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;
(Wrapped to make it more readable)&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 AAAAB3NzaC1yc2EAAAABIwAAAQBTNg6FZyDKm4GAm7c+F2enpLWy+t8Z&lt;br /&gt;
Zjm4Z3Q7EhX09ukqk/QmMqprtI9OsiRVjce+wGx4nZ8+Z0NHduCVuwAxG0XG7FpK&lt;br /&gt;
kUJC3Qb8KhyeIpKEcfYAtsDUFnWddVF8Tsz6dDOhb61tAke77d9E01NfyHp88QBx&lt;br /&gt;
jJ7w+ZgB2eLPBFm6j1t+K50JHwdcFfxrZFywKnAQIdH0NCs8VaW91fQZBupg4OGO&lt;br /&gt;
MpSBnVzoaz2ybI9bQtbZ4GwhCghzKx7Qjz20WiqhfPMfFqAZJwn0WXfjALoioMDW&lt;br /&gt;
avTbx+J2HM8KJ8/YkSSKdDEgZCItg0Q2fC35TDX+aJGu3xNfoaAe3lL1 root@an&lt;br /&gt;
-node04.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;
Various applications will connect to the other node using different methods and networks. Each connection, when first established, will prompt for you to confirm that you trust the authentication, as we saw above. Many programs can&#039;t handle this prompt and will simply fail to connect. So to get around this, I will &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ssh&amp;lt;/span&amp;gt; into both nodes using all hostnames. This will populate a file called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;~/.ssh/known_hosts&amp;lt;/span&amp;gt;. Once you do this on one node, you can simply copy the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;known_hosts&amp;lt;/span&amp;gt; to the other nodes and user&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;~/.ssh/&amp;lt;/span&amp;gt; directories.&lt;br /&gt;
&lt;br /&gt;
I simply paste this into a terminal, answering &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;yes&amp;lt;/span&amp;gt; and then immediately exiting from the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ssh&amp;lt;/span&amp;gt; session. This is a bit tedious, I admit. Take the time to check the fingerprints as they are displayed to you. It is a bad habit to blindly type &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;yes&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Alter this to suit your host names.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ssh root@an-node04 &amp;amp;&amp;amp; \&lt;br /&gt;
ssh root@an-node04.alteeve.com &amp;amp;&amp;amp; \&lt;br /&gt;
ssh root@an-node04.bcn &amp;amp;&amp;amp; \&lt;br /&gt;
ssh root@an-node04.sn &amp;amp;&amp;amp; \&lt;br /&gt;
ssh root@an-node04.ifn &amp;amp;&amp;amp; \&lt;br /&gt;
ssh root@an-node05 &amp;amp;&amp;amp; \&lt;br /&gt;
ssh root@an-node05.alteeve.com &amp;amp;&amp;amp; \&lt;br /&gt;
ssh root@an-node05.bcn &amp;amp;&amp;amp; \&lt;br /&gt;
ssh root@an-node05.sn &amp;amp;&amp;amp; \&lt;br /&gt;
ssh root@an-node05.ifn&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once you&#039;ve done this on one node, you can simply copy the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;~/.ssh/known_hosts&amp;lt;/span&amp;gt; file to the other node. In my case, I ran the above commands on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt;, so I will copy the file to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&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;
rsync -av root@192.168.1.74:/root/.ssh/known_hosts ~/.ssh/&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
receiving file list ... done&lt;br /&gt;
known_hosts&lt;br /&gt;
&lt;br /&gt;
sent 96 bytes  received 2165 bytes  4522.00 bytes/sec&lt;br /&gt;
total size is 7629  speedup is 3.37&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Installing Packages We Will Use ==&lt;br /&gt;
&lt;br /&gt;
There are several packages we will need. They can all be installed in one go with the following command.&lt;br /&gt;
&lt;br /&gt;
If you have a slow or metered Internet connection, you may want to alter &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/yum.conf&amp;lt;/span&amp;gt; and change &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;keepcache=0&amp;lt;/span&amp;gt; to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;keepcache=1&amp;lt;/span&amp;gt; before installing packages. This way, you can then run your updates and installs on one node and then &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rsync&amp;lt;/span&amp;gt; the downloaded files from the first node to the second node. Once done, when you run the updates and installs on that second node, nothing more will be downloaded. To copy the cached [[RPM]]s, simply run &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rsync -av /var/cache/yum root@an-node05:/var/cache/&amp;lt;/span&amp;gt; (assuming you did the initial downloads from &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
{{note|1=If you are using [[RHEL]] 5.x proper, you will need to manually download and install the [[DRBD]] RPMs from [http://www.linbit.com/support/ Linbit].}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install cman openais rgmanager lvm2-cluster gfs2-utils xen xen-libs kmod-xenpv \&lt;br /&gt;
            drbd83 kmod-drbd83-xen virt-manager virt-viewer libvirt libvirt-python \&lt;br /&gt;
            python-virtinst luci ricci ntp bridge-utils system-config-cluster&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will drag in a good number of dependencies, which is fine.&lt;br /&gt;
&lt;br /&gt;
== Keeping Time In Sync ==&lt;br /&gt;
&lt;br /&gt;
It is very important that time on both nodes be kept in sync. The way to do this is to setup [[[NTP]], the network time protocol. I like to use the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;tick.redhat.com&amp;lt;/span&amp;gt; time server, though you are free to substitute your preferred time source.&lt;br /&gt;
&lt;br /&gt;
First, add the timeserver to the NTP configuration file by appending the following lines to the end of it. &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;
echo server tick.redhat.com$&#039;\n&#039;restrict tick.redhat.com mask 255.255.255.255 nomodify notrap noquery &amp;gt;&amp;gt; /etc/ntp.conf&lt;br /&gt;
tail -n 4 /etc/ntp.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;
# Specify the key identifier to use with the ntpq utility.&lt;br /&gt;
#controlkey 8&lt;br /&gt;
server tick.redhat.com&lt;br /&gt;
restrict tick.redhat.com mask 255.255.255.255 nomodify notrap noquery&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now make sure that the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ntpd&amp;lt;/span&amp;gt; service starts on boot, then start it manually.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
chkconfig ntpd on&lt;br /&gt;
/etc/init.d/ntpd 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 ntpd:                                             [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Altering Boot Up ==&lt;br /&gt;
&lt;br /&gt;
{{note|1=The next two steps are optional.}}&lt;br /&gt;
&lt;br /&gt;
There are two changes I like to make on my nodes. These are not required, but I find it helps to keep things as simple as possible. Particularly in the earlier learning and testing stages.&lt;br /&gt;
&lt;br /&gt;
=== Changing the Default Run-Level ===&lt;br /&gt;
&lt;br /&gt;
If you choose not to implement it, please change any referenced to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/rc3.d&amp;lt;/span&amp;gt; to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/rc5.d&amp;lt;/span&amp;gt; later in this tutorial.&lt;br /&gt;
&lt;br /&gt;
I prefer to minimize the running daemons and apps on my nodes for two reasons; Performance and security. One of the simplest ways to minimize the number of running programs is to change the run-level to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;3&amp;lt;/span&amp;gt; by editing &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/inittab&amp;lt;/span&amp;gt;. This tells the node when it boots not to start the graphical interface and instead simply boot to a &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[bash]]&amp;lt;/span&amp;gt; shell.&lt;br /&gt;
&lt;br /&gt;
This change is actually quite simple. Simple edit &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/inittab&amp;lt;/span&amp;gt; and change the line &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;id:5:initdefault:&amp;lt;/span&amp;gt; to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;id:3:initdefault:&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;
cp /etc/inittab /etc/inittab.orig&lt;br /&gt;
sed -i &#039;s/id:5:initdefault/id:3:initdefault/g&#039; /etc/inittab&lt;br /&gt;
diff -u /etc/inittab.orig /etc/inittab&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;diff&amp;quot;&amp;gt;&lt;br /&gt;
--- /etc/inittab.orig	2011-05-01 20:54:35.000000000 -0400&lt;br /&gt;
+++ /etc/inittab	2011-05-01 20:56:43.000000000 -0400&lt;br /&gt;
@@ -15,7 +15,7 @@&lt;br /&gt;
 #   5 - X11&lt;br /&gt;
 #   6 - reboot (Do NOT set initdefault to this)&lt;br /&gt;
 # &lt;br /&gt;
-id:5:initdefault:&lt;br /&gt;
+id:3:initdefault:&lt;br /&gt;
 &lt;br /&gt;
 # System initialization.&lt;br /&gt;
 si::sysinit:/etc/rc.d/rc.sysinit&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you are still in a graphical environment and want to disable the [[GUI]] without rebooting, you can run &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;init 3&amp;lt;/span&amp;gt;. Conversely, if you want to start the GUI for a certain task, you can do so my running &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;init 5&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Making Boot Messages Visible ===&lt;br /&gt;
&lt;br /&gt;
Another optional step, in-line with the change above, is to disable the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rhgb&amp;lt;/span&amp;gt; (Red Hat Graphical Boot) and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;quiet&amp;lt;/span&amp;gt; kernel arguments. These options provide the clean boot screen you normally see with [[EL5]], but they also hide a lot of boot messages that we may find helpful. &lt;br /&gt;
&lt;br /&gt;
To make this change, edit the [[grub]] boot-loader menu and remove the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rhgb quiet&amp;lt;/span&amp;gt; arguments from the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;kernel /vmlinuz...&amp;lt;/span&amp;gt; line. These arguments are usually the last ones on the line. If you leave this until later you may see two or more kernel entries. Delete these arguments where ever they are found.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /boot/grub/grub.conf /boot/grub/grub.conf.orig&lt;br /&gt;
sed -i &#039;s/root=LABEL=\//root=LABEL=\/ rhgb quiet/g&#039; /boot/grub/grub.conf&lt;br /&gt;
diff -u /boot/grub/grub.conf.orig /boot/grub/grub.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;diff&amp;quot;&amp;gt;&lt;br /&gt;
--- /boot/grub/grub.conf.orig	2011-05-01 21:01:43.000000000 -0400&lt;br /&gt;
+++ /boot/grub/grub.conf	2011-05-01 21:02:44.000000000 -0400&lt;br /&gt;
@@ -14,18 +14,18 @@&lt;br /&gt;
 title CentOS (2.6.18-238.9.1.el5xen)&lt;br /&gt;
 	root (hd0,0)&lt;br /&gt;
 	kernel /xen.gz-2.6.18-238.9.1.el5&lt;br /&gt;
-	module /vmlinuz-2.6.18-238.9.1.el5xen ro root=LABEL=/ rhgb quiet&lt;br /&gt;
+	module /vmlinuz-2.6.18-238.9.1.el5xen ro root=LABEL=/&lt;br /&gt;
 	module /initrd-2.6.18-238.9.1.el5xen.img&lt;br /&gt;
 title CentOS (2.6.18-238.9.1.el5)&lt;br /&gt;
 	root (hd0,0)&lt;br /&gt;
-	kernel /vmlinuz-2.6.18-238.9.1.el5 ro root=LABEL=/ rhgb quiet&lt;br /&gt;
+	kernel /vmlinuz-2.6.18-238.9.1.el5 ro root=LABEL=/&lt;br /&gt;
 	initrd /initrd-2.6.18-238.9.1.el5.img&lt;br /&gt;
 title CentOS (2.6.18-238.el5xen)&lt;br /&gt;
 	root (hd0,0)&lt;br /&gt;
 	kernel /xen.gz-2.6.18-238.el5 &lt;br /&gt;
-	module /vmlinuz-2.6.18-238.el5xen ro root=LABEL=/ rhgb quiet&lt;br /&gt;
+	module /vmlinuz-2.6.18-238.el5xen ro root=LABEL=/&lt;br /&gt;
 	module /initrd-2.6.18-238.el5xen.img&lt;br /&gt;
 title CentOS-base (2.6.18-238.el5)&lt;br /&gt;
 	root (hd0,0)&lt;br /&gt;
-	kernel /vmlinuz-2.6.18-238.el5 ro root=LABEL=/ rhgb quiet&lt;br /&gt;
+	kernel /vmlinuz-2.6.18-238.el5 ro root=LABEL=/&lt;br /&gt;
 	initrd /initrd-2.6.18-238.el5.img&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{note|1=If you&#039;re &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;grub.conf&amp;lt;/span&amp;gt; has been altered or doesn&#039;t have the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;root=LABEL=/&amp;lt;/span&amp;gt; text, you will need to manually add the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rhgb quiet&amp;lt;/span&amp;gt; to the end of the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/vmlinuz&amp;lt;/span&amp;gt; line(s).}}&lt;br /&gt;
&lt;br /&gt;
Now future reboots will show boot details in a terminal display rather than hiding those often-useful messages behind a splash screen.&lt;br /&gt;
&lt;br /&gt;
= Setting Up Xen =&lt;br /&gt;
&lt;br /&gt;
It may seem premature to discuss [[Xen]] before the cluster itself. The reason we need to look at it now, before the cluster, is because Xen makes some fairly significant changes to the networking. Given how changes to networking can effect the cluster, we will want to get these changes out of the way.&lt;br /&gt;
&lt;br /&gt;
We&#039;re not going to provision any virtual machines until the cluster is built.&lt;br /&gt;
&lt;br /&gt;
== A Brief Overview ==&lt;br /&gt;
&lt;br /&gt;
Xen is a [[hypervisor]] the converts the installed operating system into a virtual machine running on a small Xen kernel. This same small kernel also runs all of the virtual machines you will add later. In this way, you will always be working in a virtual machine once you switch to booting a Xen kernel. In Xen terminology, virtual machines are known as &#039;&#039;&#039;domains&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;host&amp;quot; operating system is known as [[dom0]] (domain 0) and has a special view of the hardware plus contains the configuration and control of Xen itself. All other Xen virtual machines are known as [[domU]] (domain U). This is a collective term that represents the transient ID number assigned to all virtual machines. For example, when you boot the first virtual machine, it is known as &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;dom1&amp;lt;/span&amp;gt;. The next will be &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;dom2&amp;lt;/span&amp;gt;, then &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;dom3&amp;lt;/span&amp;gt; and so on. Do note that if a [[domU]] shuts down, it&#039;s ID is &#039;&#039;not&#039;&#039; reused. So when it restarts, it will use the next free ID (ie: &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;dom4&amp;lt;/span&amp;gt; in this list, despite it having been, say, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;dom1&amp;lt;/span&amp;gt; initially).&lt;br /&gt;
&lt;br /&gt;
This makes Xen somewhat unique in the virtualization world. Most others do not touch or alter the &amp;quot;host&amp;quot; OS, instead running the guest VMs fully withing the context of the host operating system.&lt;br /&gt;
&lt;br /&gt;
== Understanding Networking in Xen ==&lt;br /&gt;
&lt;br /&gt;
Xen uses a fairly complex networking system. This is, perhaps, it&#039;s strongest point. The trade off though is that it can be a little tricky to wrap your head around. To help you become familiar, there is a short tutorial dedicated to this topic. Please read it over before proceeding in you are not familiar with Xen&#039;s networking.&lt;br /&gt;
&lt;br /&gt;
Taking the time to read and understand the mini-paper below will save you a lot of heartache in the following stages.&lt;br /&gt;
&lt;br /&gt;
* [[Networking in Xen 3.x]]&lt;br /&gt;
&lt;br /&gt;
Once built, this is what our inter-node network will look like. If you have trouble following this diagram, please do go back and read the link above before proceeding.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
 __________________________________________________________                         _________________________________________________________&lt;br /&gt;
|  ____________________                 an-node04 - (dom0) |                       | (dom0) - an-node05                 ___________________  |&lt;br /&gt;
| | vm0001_ws1   ______|                ________    _______|   _________________   |_______    ________                |______  vm0001_ws1 | |&lt;br /&gt;
| |   (domA)    | eth0 =-[vifA.0]------| xenbr0 |-=| eth0  =--| Internet-Facing |--=  eth0 |=-| xenbr0 |------[vifC.0]-= eth0 |   (domC)   | |&lt;br /&gt;
| |             |_____-|          /----|        |  |______-|  | Switch or VLAN  |  |-______|  |        |----\          |-_____|            | |&lt;br /&gt;
| |                    |          |    |        |          |  |_________________|  |          |        |    |          |                   | |&lt;br /&gt;
| |              ______|          |    |________|          |                       |          |________|    |          |______             | |&lt;br /&gt;
| |             | eth1 =-[vifA.2]-+-\                      |                       |                      /-+-[vivC.2]-= eth1 |            | |&lt;br /&gt;
| | [Active]    |_____-|          | |                      |                       |                      | |          |-_____|   [Backup] | |&lt;br /&gt;
| |____________________|          | |                      |                       |                      | |          |___________________| |&lt;br /&gt;
|                                 | |                      |                       |                      | |                                |&lt;br /&gt;
|  ____________________           | |                      |                       |                      | |           ___________________  |&lt;br /&gt;
| | vm0002_win1  ______|          | |               _______|   _________________   |_______               | |          |______ vm0002_win1 | |&lt;br /&gt;
| |   (domB)    | eth0 =-[vifB.0]-/ |              | eth1  =--|    Storage      |--=  eth1 |              | \-[vifD.0]-= eth0 |   (domD)   | |&lt;br /&gt;
| |             |_____-|            |              |______-|  | Switch or VLAN  |  |-______|              |            |-_____|            | |&lt;br /&gt;
| |                    |            |                      |  |_________________|  |                      |            |                   | |&lt;br /&gt;
| |              ______|            |                      |                       |                      |            |______             | |&lt;br /&gt;
| |             | eth1 =-[vifB.2]-\ |                      |                       |                      | /-[vifD.2]-= eth1 |            | |&lt;br /&gt;
| | [Backup]    |_____-|          | |                      |                       |                      | |          |-_____|   [Active] | |&lt;br /&gt;
| |____________________|          | |                      |                       |                      | |          |___________________| |&lt;br /&gt;
|                                 | |                      |                       |                      | |                                |&lt;br /&gt;
|                                 | |   ________    _______|   _________________   |_______    ________   | |                                |&lt;br /&gt;
|                                 | \--| xenbr2 |-=| eth2  =--|  Back-Channel   |--=  eth2 |=-| xenbr2 |--/ |                                |&lt;br /&gt;
|                                 \----|        |  |______-|  | Switch or VLAN  |  |-______|  |        |----/                                |&lt;br /&gt;
|                                      |        |          |  |_________________|  |          |        |                                     |&lt;br /&gt;
|                                      |________|          |                       |          |________|                                     |&lt;br /&gt;
|                                                          |                       |                                                         |&lt;br /&gt;
|                                                          |                       |                                                         |&lt;br /&gt;
|                                                          |                       |                                                         |&lt;br /&gt;
|                                                          |                       |                                                         |&lt;br /&gt;
|                                                          |                       |                                                         |&lt;br /&gt;
|__________________________________________________________|                       |_________________________________________________________|&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Making Network Interfaces Available To Xen Clients ==&lt;br /&gt;
&lt;br /&gt;
As discussed above, Xen makes some significant changes to the [[dom0]] network, which happens to be where the cluster will operate. These changes including shutting down and moving around the interfaces. As we will discuss later, this behaviour can trigger cluster failures. This is the main reason for dealing with Xen now. Once the changes are in place, the network is stable and safe for running the cluster on.&lt;br /&gt;
&lt;br /&gt;
=== A Brief Overview ===&lt;br /&gt;
&lt;br /&gt;
By default, Xen only makes &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth0&amp;lt;/span&amp;gt; available to the virtual machines. We will want to add &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth2&amp;lt;/span&amp;gt; as well, as we will use the &#039;&#039;Back Channel Network&#039;&#039; for inter-VM communication. We do &#039;&#039;&#039;not&#039;&#039;&#039; want to add the &#039;&#039;Storage Network&#039;&#039; to Xen though! Doing so puts the DRBD link at risk. Should &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xend&amp;lt;/span&amp;gt; get shut down, it could trigger a [[split-brain]] in DRBD.&lt;br /&gt;
&lt;br /&gt;
What Xen does, in brief, is move the &amp;quot;real&amp;quot; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth0&amp;lt;/span&amp;gt; over to a new device called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;peth0&amp;lt;/span&amp;gt;. Then it creates a virtual &amp;quot;clone&amp;quot; of the network interface called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth0&amp;lt;/span&amp;gt;. Next, Xen creates a [[bridge]] called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xenbr0&amp;lt;/span&amp;gt;. Finally, both the real &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;peth0&amp;lt;/span&amp;gt; and the new virtual &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth0&amp;lt;/span&amp;gt; are connected to the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xenbr0&amp;lt;/span&amp;gt; bridge.&lt;br /&gt;
&lt;br /&gt;
The reasoning behind all this is to separate the traffic coming to and from [[dom0]] from any traffic doing to the various [[domU]]s. Think of it sort of like the bridge being a network switch, the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;peth0&amp;lt;/span&amp;gt; being an uplink cable to the outside world and the virtual &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth0&amp;lt;/span&amp;gt; being [[dom0]]&#039;s &amp;quot;port&amp;quot; on the switch. We want the same to be done to the interface on the &#039;&#039;Back-Channel Network&#039;&#039;, too. The &#039;&#039;Storage Network&#039;&#039; will never be exposed to the [[domU]] machines, so combining the risk to the underlying storage, there is no reason to add &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth1&amp;lt;/span&amp;gt; to Xen&#039;s control.&lt;br /&gt;
&lt;br /&gt;
=== Disable the &#039;qemu&#039; Bridge ===&lt;br /&gt;
&lt;br /&gt;
By default, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[libvirtd]]&amp;lt;/span&amp;gt; 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. &lt;br /&gt;
&lt;br /&gt;
So to remove this bridge, simply delete the contents of the file, stop the bridge, delete the bridge and then stop &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;iptables&amp;lt;/span&amp;gt; to make sure any rules created for the bridge are flushed.&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;
ifconfig virbr0 down&lt;br /&gt;
brctl delbr virbr0&lt;br /&gt;
/etc/init.d/iptables stop&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Setting Up Bridges ===&lt;br /&gt;
&lt;br /&gt;
By default, Xen creates the bridges it will need when it starts. This works fine with basic configuration, but is no longer recommended.&lt;br /&gt;
&lt;br /&gt;
Bridges are very much like software network switches. Interfaces can be connected to them and then use them to pass data back and forth. As virtual machines are created, they will have a special &amp;quot;virtual&amp;quot; interface created. These &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vifX.Y&amp;lt;/span&amp;gt; devices are very much like a network cable between a normal server and a switch. In Xen, the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;X&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Y&amp;lt;/span&amp;gt; in the name &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vifX.Y&amp;lt;/span&amp;gt; corresponds to the domain ID, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;X&amp;lt;/span&amp;gt; and the bridge ID &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Y&amp;lt;/span&amp;gt;. For example, if you create a [[domU]] which is given the ID of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;5&amp;lt;/span&amp;gt; and you are connecting two interfaces within domU to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xenbr0&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xenbr2&amp;lt;/span&amp;gt;, you will see two virtual interfaces created, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vif5.0&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vif5.2&amp;lt;/span&amp;gt;, which connect the domU&#039;s &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;eth1&amp;lt;/span&amp;gt; to the bridges, respectively.&lt;br /&gt;
&lt;br /&gt;
If you found the above confusing, please take a look at the article below:&lt;br /&gt;
&lt;br /&gt;
* [[Networking in Xen 3.x]]&lt;br /&gt;
&lt;br /&gt;
We will now create bridges in each node for the &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; interfaces. We aren&#039;t bothering with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth1&amp;lt;/span&amp;gt; as it will only be used for storage traffic and thus will never need to be seen or used by any domU. To create the bridges, we need to do two things;&lt;br /&gt;
* Create the bridge configuration files; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/sysconfig/network-scripts/ifcfg-xenbr0&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/sysconfig/network-scripts/ifcfg-xenbr2&amp;lt;/span&amp;gt;&lt;br /&gt;
* Change the interface configuration files and connect the interfaces to the bridge.&lt;br /&gt;
&lt;br /&gt;
Note that when we create the bridge scripts, we will move the IP address information from the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ethX&amp;lt;/span&amp;gt; device to the corresponding &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xenbrX&amp;lt;/span&amp;gt; configuration file. This means that, after this change, you will see the IP address on the bridge, &#039;&#039;not&#039;&#039; the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ethX&amp;lt;/span&amp;gt; device. This is normal.&lt;br /&gt;
&lt;br /&gt;
{{note|1=It is not necessary to stop the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;network&amp;lt;/span&amp;gt; daemon before making these changes. Once you&#039;ve begun the edits though, do be careful though not to restart networking until you are complete. These changes will somewhat dramatically alter your network configuration. If you leave the network up, be aware that when you do restart the network, you will see a warning like: &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Shutting down interface eth0:  bridge xenbr0 does not exist!&amp;lt;/span&amp;gt;. This is ok.}}&lt;br /&gt;
&lt;br /&gt;
First, create the two bridge configuration files.&lt;br /&gt;
&lt;br /&gt;
For &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xenbr0&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/sysconfig/network-scripts/ifcfg-xenbr0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
# Bridge created for Xen&lt;br /&gt;
DEVICE=xenbr0&lt;br /&gt;
TYPE=Bridge&lt;br /&gt;
BOOTPROTO=static&lt;br /&gt;
IPADDR=192.168.1.74&lt;br /&gt;
NETMASK=255.255.255.0&lt;br /&gt;
GATEWAY=192.168.1.254&lt;br /&gt;
DNS1=192.139.81.117&lt;br /&gt;
DNS2=192.139.81.1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xenbr2&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/sysconfig/network-scripts/ifcfg-xenbr2&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
# Bridge created for Xen&lt;br /&gt;
DEVICE=xenbr2&lt;br /&gt;
TYPE=Bridge&lt;br /&gt;
BOOTPROTO=static&lt;br /&gt;
IPADDR=192.168.3.74&lt;br /&gt;
NETMASK=255.255.255.0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Next, edit the corresponding &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ethX&amp;lt;/span&amp;gt; devices. This will involve adding a &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;BRIDGE=xenbrX&amp;lt;/span&amp;gt; line and removing all of the IP address information. Below are the updated &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; devices after the changes have been made with a &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;diff&amp;lt;/span&amp;gt; showing exactly how the files changed.&lt;br /&gt;
&lt;br /&gt;
For &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth0&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;
cp /etc/sysconfig/network-scripts/ifcfg-eth0 /etc/sysconfig/network-scripts/ifcfg-eth0.orig&lt;br /&gt;
vim /etc/sysconfig/network-scripts/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;
# Realtek Semiconductor Co., Ltd. RTL8111/8168B PCI Express Gigabit Ethernet controller&lt;br /&gt;
HWADDR=48:5B:39:3C:53:14&lt;br /&gt;
DEVICE=eth0&lt;br /&gt;
BRIDGE=xenbr0&lt;br /&gt;
BOOTPROTO=static&lt;br /&gt;
ONBOOT=yes&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;
diff -u /etc/sysconfig/network-scripts/ifcfg-eth0.orig /etc/sysconfig/network-scripts/ifcfg-eth0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;diff&amp;quot;&amp;gt;&lt;br /&gt;
--- /etc/sysconfig/network-scripts/ifcfg-eth0.orig	2011-05-02 15:05:56.000000000 -0400&lt;br /&gt;
+++ /etc/sysconfig/network-scripts/ifcfg-eth0	2011-05-02 15:01:34.000000000 -0400&lt;br /&gt;
@@ -1,10 +1,6 @@&lt;br /&gt;
 # Realtek Semiconductor Co., Ltd. RTL8111/8168B PCI Express Gigabit Ethernet controller&lt;br /&gt;
 HWADDR=48:5B:39:3C:53:14&lt;br /&gt;
 DEVICE=eth0&lt;br /&gt;
+BRIDGE=xenbr0&lt;br /&gt;
 BOOTPROTO=static&lt;br /&gt;
 ONBOOT=yes&lt;br /&gt;
-IPADDR=192.168.1.74&lt;br /&gt;
-NETMASK=255.255.255.0&lt;br /&gt;
-GATEWAY=192.168.1.254&lt;br /&gt;
-DNS1=192.139.81.117&lt;br /&gt;
-DNS2=192.139.81.1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth2&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;
cp /etc/sysconfig/network-scripts/ifcfg-eth2 /etc/sysconfig/network-scripts/ifcfg-eth2.orig&lt;br /&gt;
vim /etc/sysconfig/network-scripts/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 82574L Gigabit Network Connection&lt;br /&gt;
HWADDR=00:1B:21:72:96:EA&lt;br /&gt;
DEVICE=eth2&lt;br /&gt;
BRIDGE=xenbr2&lt;br /&gt;
BOOTPROTO=static&lt;br /&gt;
ONBOOT=yes&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;
diff -u /etc/sysconfig/network-scripts/ifcfg-eth2.orig /etc/sysconfig/network-scripts/ifcfg-eth2&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;diff&amp;quot;&amp;gt;&lt;br /&gt;
--- /etc/sysconfig/network-scripts/ifcfg-eth2.orig	2011-05-02 15:08:36.000000000 -0400&lt;br /&gt;
+++ /etc/sysconfig/network-scripts/ifcfg-eth2	2011-05-02 15:08:20.000000000 -0400&lt;br /&gt;
@@ -1,7 +1,6 @@&lt;br /&gt;
 # Intel Corporation 82574L Gigabit Network Connection&lt;br /&gt;
 HWADDR=00:1B:21:72:96:EA&lt;br /&gt;
 DEVICE=eth2&lt;br /&gt;
+BRIDGE=xenbr2&lt;br /&gt;
 BOOTPROTO=static&lt;br /&gt;
 ONBOOT=yes&lt;br /&gt;
-IPADDR=192.168.3.74&lt;br /&gt;
-NETMASK=255.255.255.0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now restart the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;network&amp;lt;/span&amp;gt; daemon. As noted, do not be concerned about the shutdown warnings, they should appear only once.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/network 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;
Shutting down interface eth0:  bridge xenbr0 does not exist!&lt;br /&gt;
                                                           [  OK  ]&lt;br /&gt;
Shutting down interface eth1:                              [  OK  ]&lt;br /&gt;
Shutting down interface eth2:  bridge xenbr2 does not exist!&lt;br /&gt;
                                                           [  OK  ]&lt;br /&gt;
Shutting down loopback interface:                          [  OK  ]&lt;br /&gt;
Bringing up loopback interface:                            [  OK  ]&lt;br /&gt;
Bringing up interface eth0:                                [  OK  ]&lt;br /&gt;
Bringing up interface eth1:                                [  OK  ]&lt;br /&gt;
Bringing up interface eth2:                                [  OK  ]&lt;br /&gt;
Bringing up interface xenbr0:                              [  OK  ]&lt;br /&gt;
Bringing up interface xenbr2:                              [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can check that the bridges are up and that the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ethX&amp;lt;/span&amp;gt; interfaces are connected to them using the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;brctl&amp;lt;/span&amp;gt; tool.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
brctl show&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
bridge name	bridge id		STP enabled	interfaces&lt;br /&gt;
virbr0		8000.000000000000	yes		&lt;br /&gt;
xenbr0		8000.485b393c5314	no		eth0&lt;br /&gt;
xenbr2		8000.001b217296ea	no		eth2&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We&#039;ll see this reflected in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;iptables&amp;lt;/span&amp;gt; output as well.&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;
          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:276 errors:0 dropped:0 overruns:0 frame:0&lt;br /&gt;
          TX packets:168 errors:0 dropped:0 overruns:0 carrier:0&lt;br /&gt;
          collisions:0 txqueuelen:1000 &lt;br /&gt;
          RX bytes:47553 (46.4 KiB)  TX bytes:25555 (24.9 KiB)&lt;br /&gt;
          Interrupt:246 Base address:0xe000 &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:123 errors:0 dropped:0 overruns:0 frame:0&lt;br /&gt;
          TX packets:55 errors:0 dropped:0 overruns:0 carrier:0&lt;br /&gt;
          collisions:0 txqueuelen:1000 &lt;br /&gt;
          RX bytes:25758 (25.1 KiB)  TX bytes:9364 (9.1 KiB)&lt;br /&gt;
          Interrupt:17 Memory:feae0000-feb00000 &lt;br /&gt;
&lt;br /&gt;
eth2      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 MULTICAST  MTU:1500  Metric:1&lt;br /&gt;
          RX packets:161 errors:0 dropped:0 overruns:0 frame:0&lt;br /&gt;
          TX packets:69 errors:0 dropped:0 overruns:0 carrier:0&lt;br /&gt;
          collisions:0 txqueuelen:1000 &lt;br /&gt;
          RX bytes:31049 (30.3 KiB)  TX bytes:13329 (13.0 KiB)&lt;br /&gt;
          Interrupt:16 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:8 errors:0 dropped:0 overruns:0 frame:0&lt;br /&gt;
          TX packets:8 errors:0 dropped:0 overruns:0 carrier:0&lt;br /&gt;
          collisions:0 txqueuelen:0 &lt;br /&gt;
          RX bytes:560 (560.0 b)  TX bytes:560 (560.0 b)&lt;br /&gt;
&lt;br /&gt;
xenbr0    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:252 errors:0 dropped:0 overruns:0 frame:0&lt;br /&gt;
          TX packets:153 errors:0 dropped:0 overruns:0 carrier:0&lt;br /&gt;
          collisions:0 txqueuelen:0 &lt;br /&gt;
          RX bytes:41073 (40.1 KiB)  TX bytes:21327 (20.8 KiB)&lt;br /&gt;
&lt;br /&gt;
xenbr2    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:138 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:25913 (25.3 KiB)  TX bytes:9396 (9.1 KiB)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now let&#039;s move on to the main Xen configuration file!&lt;br /&gt;
&lt;br /&gt;
=== Editing the /etc/xen/xend-config.sxp Configuration File ===&lt;br /&gt;
&lt;br /&gt;
We need to do two things here:&lt;br /&gt;
* Tell Xen to enable it&#039;s unix socket so that external tools can manage it (if needed).&lt;br /&gt;
* Tell Xen to not handle bridge configuration.&lt;br /&gt;
* Enable Live Migration of VMs between nodes.&lt;br /&gt;
&lt;br /&gt;
Begin editing the Xen configuration file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/xen/xend-config.sxp /etc/xen/xend-config.sxp.orig&lt;br /&gt;
vim /etc/xen/xend-config.sxp&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{note|1=It would see that, by default, Xen now enables it&#039;s unix socket. As such, this step may not be needed.}}&lt;br /&gt;
&lt;br /&gt;
Configure Xen to enable it&#039;s unix socket. This is how tools like &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virsh&amp;lt;/span&amp;gt;, which we will look at later, interact with Xen. To do this, change &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xend-unix-server&amp;lt;/span&amp;gt;, which is around line &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;19&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;
(xend-unix-server yes)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Edit the &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 &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/bin/true&amp;lt;/span&amp;gt;. This let&#039;s the script succeed without actually doing anything. We want this behavious because we created the bridges ourselves outside of Xen.&lt;br /&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;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To enable live migration, we need to edit four values. Let&#039;s look at the new values, then we&#039;ll discuss what they effect and how their syntax works.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
(xend-relocation-server yes)&lt;br /&gt;
(xend-relocation-port 8002)&lt;br /&gt;
(xend-relocation-address &#039;an-node04.bcn&#039;)&lt;br /&gt;
(xend-relocation-hosts-allow &#039;&#039;)&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;xend-unix-server&amp;lt;/span&amp;gt;; When set to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;yes&amp;lt;/span&amp;gt;, this tells Xen to enable it&#039;s unix socket. This is needed by management tools like &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[virsh]]&amp;lt;/span&amp;gt;.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xend-relocation-server&amp;lt;/span&amp;gt;; When set to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;yes&amp;lt;/span&amp;gt;, this tells Xen to allow the migration of [[VM]]s.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xend-relocation-port&amp;lt;/span&amp;gt;; This controls what [[TCP]] port that Xen listens for migration requests.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xend-relocation-address&amp;lt;/span&amp;gt;; This is an IP address or resolvable name that must match an IP address of an interface on the local machine. This binds Xen&#039;s migration to the given interface. If set to just &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;amp;#39;&amp;amp;#39;&amp;lt;/span&amp;gt;, Xen will listen for connections on all interfaces.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xend-relocation-hosts-allow&amp;lt;/span&amp;gt;; This is a space-separated list of host names, IP addresses and regular expressions of hosts that are allowed to be migration sources and targets. Some examples are; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04 an-node05 ^192\.168\.*$&amp;lt;/span&amp;gt;. If set to just &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;amp;#39;&amp;amp;#39;&amp;lt;/span&amp;gt;, Xen will allow migration to or from all nodes on the network. As we&#039;ve already restricted migrate to the &#039;&#039;&#039;BCN&#039;&#039;&#039; by way of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xend-relocation-address &#039;an-node04.bcn&#039;&amp;lt;/span&amp;gt;, it&#039;s save to leave this open to any host.&lt;br /&gt;
&lt;br /&gt;
{{note|1=Be sure that you set &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xend-relocation-address&amp;lt;/span&amp;gt; is set uniquely for each node.}}&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;diff&amp;lt;/span&amp;gt; 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;
diff -u /etc/xen/xend-config.sxp.orig /etc/xen/xend-config.sxp&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;diff&amp;quot;&amp;gt;&lt;br /&gt;
--- /etc/xen/xend-config.sxp.orig	2011-05-02 15:52:27.000000000 -0400&lt;br /&gt;
+++ /etc/xen/xend-config.sxp	2011-05-02 16:01:33.000000000 -0400&lt;br /&gt;
@@ -19,6 +19,7 @@&lt;br /&gt;
 #(xend-tcp-xmlrpc-server no)&lt;br /&gt;
 #(xend-unix-xmlrpc-server yes)&lt;br /&gt;
 #(xend-relocation-server no)&lt;br /&gt;
+(xend-relocation-server yes)&lt;br /&gt;
 # The relocation server should be kept desactivated unless using a trusted&lt;br /&gt;
 # network, the domain virtual memory will be exchanged in raw form without&lt;br /&gt;
 # encryption of the communication. See also xend-relocation-hosts-allow option&lt;br /&gt;
@@ -31,6 +32,7 @@&lt;br /&gt;
 # Port xend should use for the relocation interface, if xend-relocation-server&lt;br /&gt;
 # is set.&lt;br /&gt;
 #(xend-relocation-port 8002)&lt;br /&gt;
+(xend-relocation-port 8002)&lt;br /&gt;
 &lt;br /&gt;
 # Address xend should listen on for HTTP connections, if xend-http-server is&lt;br /&gt;
 # set.&lt;br /&gt;
@@ -45,6 +47,7 @@&lt;br /&gt;
 # Also, interface name is allowed (e.g. eth0) there to get the&lt;br /&gt;
 # relocation address to be bound on.&lt;br /&gt;
 #(xend-relocation-address &#039;&#039;)&lt;br /&gt;
+(xend-relocation-address &#039;an-node04.bcn&#039;)&lt;br /&gt;
 &lt;br /&gt;
 # The hosts allowed to talk to the relocation port.  If this is empty (the&lt;br /&gt;
 # default), then all connections are allowed (assuming that the connection&lt;br /&gt;
@@ -57,8 +60,8 @@&lt;br /&gt;
 # For example:&lt;br /&gt;
 #  (xend-relocation-hosts-allow &#039;^localhost$ ^.*\.example\.org$&#039;)&lt;br /&gt;
 #&lt;br /&gt;
-#(xend-relocation-hosts-allow &#039;&#039;)&lt;br /&gt;
-(xend-relocation-hosts-allow &#039;^localhost$ ^localhost\\.localdomain$&#039;)&lt;br /&gt;
+(xend-relocation-hosts-allow &#039;&#039;)&lt;br /&gt;
+#(xend-relocation-hosts-allow &#039;^localhost$ ^localhost\\.localdomain$&#039;)&lt;br /&gt;
 &lt;br /&gt;
 # The limit (in kilobytes) on the size of the console buffer&lt;br /&gt;
 #(console-limit 1024)&lt;br /&gt;
@@ -90,7 +93,8 @@&lt;br /&gt;
 # two fake interfaces per guest domain.  To do things like this, write&lt;br /&gt;
 # yourself a wrapper script, and call network-bridge from it, as appropriate.&lt;br /&gt;
 #&lt;br /&gt;
-(network-script network-bridge)&lt;br /&gt;
+#(network-script network-bridge)&lt;br /&gt;
+(network-script /bin/true)&lt;br /&gt;
 &lt;br /&gt;
 # The script used to control virtual interfaces.  This can be overridden on a&lt;br /&gt;
 # per-vif basis when creating a domain or a configuring a new vif.  The&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Make the changes take effect by (re)starting &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;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
restart xend:                                              [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Cluster Setup =&lt;br /&gt;
&lt;br /&gt;
In [[Red Hat]] Cluster Services, the heart of the cluster is found in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[RHCS v2 cluster.conf|/etc/cluster/cluster.conf]]&amp;lt;/span&amp;gt; [[XML]] configuration file.&lt;br /&gt;
&lt;br /&gt;
There are three main ways of editing this file. Two are already well documented, so I won&#039;t bother discussing them, beyond introducing them. The third way is by directly hand-crafting the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cluster.conf&amp;lt;/span&amp;gt; file. This method is not very well documented, and directly manipulating configuration files is my preferred method. As my boss loves to say; &amp;quot;&#039;&#039;The more computers do for you, the more they do to you&#039;&#039;&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
The first two, well documented, graphical tools are:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[http://docs.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/5/html/Cluster_Administration/ch-config-scc-CA.html system-config-cluster]&amp;lt;/span&amp;gt;, older GUI tool run directly from one of the cluster nodes.&lt;br /&gt;
* [http://docs.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/5/html/Cluster_Administration/ch-config-conga-CA.html Conga], comprised of the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ricci&amp;lt;/span&amp;gt; node-side client and the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;luci&amp;lt;/span&amp;gt; web-based server (can be run on machines outside the cluster).&lt;br /&gt;
&lt;br /&gt;
I do like the tools above, but I often find issues that send me back to the command line. I&#039;d recommend setting them aside for now as well. Once you feel comfortable with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cluster.conf&amp;lt;/span&amp;gt; syntax, then by all means, go back and use them. I&#039;d recommend not relying on them though, which might be the case if you try to use them too early in your studies.&lt;br /&gt;
&lt;br /&gt;
== The First cluster.conf Foundation Configuration ==&lt;br /&gt;
&lt;br /&gt;
The very first stage of building the cluster is to create a configuration file that is as minimal as possible. To do that, we need to define a few thing;&lt;br /&gt;
&lt;br /&gt;
* The name of the cluster and the cluster file version.&lt;br /&gt;
** Define &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt; options&lt;br /&gt;
** The nodes in the cluster&lt;br /&gt;
*** The fence method for each node&lt;br /&gt;
** Define fence devices&lt;br /&gt;
** Define &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fenced&amp;lt;/span&amp;gt; options&lt;br /&gt;
&lt;br /&gt;
That&#039;s it. Once we&#039;ve defined this minimal amount, we will be able to start the cluster for the first time! So lets get to it, finally.&lt;br /&gt;
&lt;br /&gt;
=== Name the Cluster and Set The Configuration Version ===&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[RHCS_v2_cluster.conf#cluster.3B_The_Parent_Tag|cluster]]&amp;lt;/span&amp;gt; tag is the parent tag for the entire cluster configuration file.&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-cluster01&amp;quot; config_version=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/cluster&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This has two attributes that we need to set are &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;name=&amp;quot;&amp;quot;&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;config_version=&amp;quot;&amp;quot;&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[RHCS v2 cluster.conf#name|name]]=&amp;quot;&amp;quot;&amp;lt;/span&amp;gt; attribute defines the name of the cluster. It must be unique amongst the clusters on your network. It should be descriptive, but you will not want to make it too long, either. You will see this name in the various cluster tools and you will enter in, for example, when creating a [[GFS2]] partition later on. This tutorial uses the cluster name &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an_cluster&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[RHCS v2 cluster.conf#config_version|config_version]]=&amp;quot;&amp;quot;&amp;lt;/span&amp;gt; attribute is an integer marking the version of the configuration file. Whenever you make a change to the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cluster.conf&amp;lt;/span&amp;gt; file, you will need to increment this version number by 1. If you don&#039;t increment this number, then the cluster tools will not know that the file needs to be reloaded. As this is the first version of this configuration file, it will start with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt;. Note that this tutorial will increment the version after every change, regardless of whether it is explicitly pushed out to the other nodes and reloaded. The reason is to help get into the habit of always increasing this value.&lt;br /&gt;
&lt;br /&gt;
=== Configuring cman Options ===&lt;br /&gt;
&lt;br /&gt;
We are going to setup a special case for our cluster; A 2-Node cluster.&lt;br /&gt;
&lt;br /&gt;
This is a special case because traditional quorum will not be useful. With only two nodes, each having a vote of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt;, the total votes is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;2&amp;lt;/span&amp;gt;. Quorum needs &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;50% + 1&amp;lt;/span&amp;gt;, which means that a single node failure would shut down the cluster, as the remaining node&#039;s vote is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;50%&amp;lt;/span&amp;gt; exactly. That kind of defeats the purpose to having a cluster at all.&lt;br /&gt;
&lt;br /&gt;
So to account for this special case, there is a special attribute called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[RHCS_v2_cluster.conf#two_node|two_node]]=&amp;quot;1&amp;quot;&amp;lt;/span&amp;gt;. This tells the cluster manager to continue operating with only one vote. This option requires that the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[RHCS_v2_cluster.conf#expected_votes|expected_votes]]=&amp;quot;&amp;quot;&amp;lt;/span&amp;gt; attribute be set to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt;. Normally, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;expected_votes&amp;lt;/span&amp;gt; is set automatically to the total sum of the defined cluster nodes&#039; votes (which itself is a default of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt;). This is the other half of the &amp;quot;trick&amp;quot;, as a single node&#039;s vote of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt; now always provides quorum (that is, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt; meets the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;50% + 1&amp;lt;/span&amp;gt; requirement).&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-cluster01&amp;quot; config_version=&amp;quot;2&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;cman expected_votes=&amp;quot;1&amp;quot; two_node=&amp;quot;1&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/cluster&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Take note of the self-closing &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;... /&amp;gt;&amp;lt;/span&amp;gt; tag. This is an [[XML]] syntax that tells the parser not to look for any child or a closing tags.&lt;br /&gt;
&lt;br /&gt;
=== Defining Cluster Nodes ===&lt;br /&gt;
&lt;br /&gt;
This example is a little artificial, please don&#039;t load it into your cluster as we will need to add a few child tags, but one thing at a time.&lt;br /&gt;
&lt;br /&gt;
This actually introduces two tags.&lt;br /&gt;
&lt;br /&gt;
The first is parent &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[RHCS_v2_cluster.conf#clusternodes.3B_Defining_Cluster_Nodes|clusternodes]]&amp;lt;/span&amp;gt; tag, which takes no variables of it&#039;s own. It&#039;s sole purpose is to contain the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[RHCS_v2_cluster.conf#Tag.3B_clusternode|clusternode]]&amp;lt;/span&amp;gt; child tags. &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-cluster01&amp;quot; config_version=&amp;quot;3&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;cman expected_votes=&amp;quot;1&amp;quot; two_node=&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-node04.alteeve.com&amp;quot; nodeid=&amp;quot;1&amp;quot; /&amp;gt;&lt;br /&gt;
		&amp;lt;clusternode name=&amp;quot;an-node05.alteeve.com&amp;quot; nodeid=&amp;quot;2&amp;quot; /&amp;gt;&lt;br /&gt;
	&amp;lt;/clusternodes&amp;gt;&lt;br /&gt;
&amp;lt;/cluster&amp;gt;&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;[[RHCS_v2_cluster.conf#Tag.3B_clusternode|clusternode]]&amp;lt;/span&amp;gt; tag defines each cluster node. There are many attributes available, but we will look at just the two required ones. &lt;br /&gt;
&lt;br /&gt;
The first is the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[RHCS_v2_cluster.conf#clusternode.27s_name_attribute|name]]=&amp;quot;&amp;quot;&amp;lt;/span&amp;gt; attribute. This &#039;&#039;&#039;should&#039;&#039;&#039; match the name given by &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;uname -n&amp;lt;/span&amp;gt; (&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;$HOSTNAME&amp;lt;/span&amp;gt;) when run on each node. The [[IP]] address that the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;name&amp;lt;/span&amp;gt; resolves to also sets the interface and subnet that the [[totem]] ring will run on. That is, the main cluster communications, which we are calling the &#039;&#039;&#039;Back-Channel Network&#039;&#039;&#039;. This is why it is so important to setup our &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[Red_Hat_Cluster_Service_2_Tutorial#Setup_.2Fetc.2Fhosts|/etc/hosts]]&amp;lt;/span&amp;gt; file correctly. Please see the [[RHCS_v2_cluster.conf#clusternode.27s_name_attribute|clusternode&#039;s name]] attribute document for details on how name to interface mapping is resolved.&lt;br /&gt;
&lt;br /&gt;
The second attribute is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[RHCS_v2_cluster.conf#clusternode.27s_nodeid_attribute|nodeid]]=&amp;quot;&amp;quot;&amp;lt;/span&amp;gt;. This must be a unique integer amongst the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;clusternode ...&amp;gt;&amp;lt;/span&amp;gt; tags. It is used by the cluster to identify the node.&lt;br /&gt;
&lt;br /&gt;
=== Defining Fence Devices ===&lt;br /&gt;
&lt;br /&gt;
[[Red_Hat_Cluster_Service_2_Tutorial#Concept.3B_Fencing|Fencing]] devices are designed to forcible eject a node from a cluster. This is done by forcing it to power off or reboot, generally. Some [[SAN]] switches can logically disconnect a node from the shared storage device, which has the same effect of guaranteeing that the defective node can not alter the shared storage. A common, third type of fence device is one that cuts the mains power to the server.&lt;br /&gt;
&lt;br /&gt;
All fence devices are contained withing the parent &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[RHCS_v2_cluster.conf#fencedevices.3B_Defining_Fence_Devices|fencedevices]]&amp;lt;/span&amp;gt; tag. This parent tag has no attributes. Within this parent tag are one or more &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[RHCS_v2_cluster.conf#Tag.3B_fencedevice|fencedevice]]&amp;lt;/span&amp;gt; child tags.&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-cluster01&amp;quot; config_version=&amp;quot;4&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;cman expected_votes=&amp;quot;1&amp;quot; two_node=&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-node04.alteeve.com&amp;quot; nodeid=&amp;quot;1&amp;quot; /&amp;gt;&lt;br /&gt;
		&amp;lt;clusternode name=&amp;quot;an-node05.alteeve.com&amp;quot; nodeid=&amp;quot;2&amp;quot; /&amp;gt;&lt;br /&gt;
	&amp;lt;/clusternodes&amp;gt;&lt;br /&gt;
	&amp;lt;fencedevices&amp;gt;&lt;br /&gt;
		&amp;lt;fencedevice agent=&amp;quot;fence_na&amp;quot; ipaddr=&amp;quot;fence_na01.alteeve.com&amp;quot; login=&amp;quot;admin&amp;quot; name=&amp;quot;fence_na01&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;
Every fence device used in your cluster will have it&#039;s own &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[RHCS_v2_cluster.conf#Tag.3B_fencedevice|fencedevice]]&amp;lt;/span&amp;gt; tag. If you are using [[IPMI]], this means you will have a &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fencedevice&amp;lt;/span&amp;gt; entry for each node, as each physical IPMI [[BMC]] is a unique fence device.&lt;br /&gt;
&lt;br /&gt;
All &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fencedevice&amp;lt;/span&amp;gt; tags share two basic attributes; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[RHCS_v2_cluster.conf#fencedevice.27s_name_attribute|name]]=&amp;quot;&amp;quot;&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[RHCS_v2_cluster.conf#fencedevice.27s_agent_attribute|agent]]=&amp;quot;&amp;quot;&amp;lt;/span&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
* The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;name&amp;lt;/span&amp;gt; attribute must be unique among all the fence devices in your cluster. As we will see in the next step, this name will be used within the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;clusternode...&amp;gt;&amp;lt;/span&amp;gt; tag. &lt;br /&gt;
* The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;agent&amp;lt;/span&amp;gt; tag tells the cluster which [[fence agent]] to use when the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[fenced]]&amp;lt;/span&amp;gt; daemon needs to communicate with the physical fence device. A fence agent is simple a shell script that acts as a glue layer between the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fenced&amp;lt;/span&amp;gt; daemon and the fence hardware. This agent takes the arguments from the daemon, like what port to act on and what action to take, and executes the node. The agent is responsible for ensuring that the execution succeeded and returning an appropriate success or failure exit code, depending. For those curious, the full details are described in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[http://sources.redhat.com/cluster/wiki/FenceAgentAPI FenceAgentAPI]&amp;lt;/span&amp;gt;. If you have two or more of the same fence device, like IPMI, then you will use the same fence &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;agent&amp;lt;/span&amp;gt; value a corresponding number of times.&lt;br /&gt;
&lt;br /&gt;
Beyond these two attributes, each fence agent will have it&#039;s own subset of attributes. The scope of which is outside this tutorial, though we will see examples for IPMI, a switched PDU and a [[Node Assassin]]. Most, if not all, fence agents have a corresponding man page that will show you what attributes it accepts and how they are used. The two fence agents we will see here have their attributes defines in the following &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[man]]&amp;lt;/span&amp;gt; pages.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;man fence_na&amp;lt;/span&amp;gt; - Node Assassin fence agent&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;man fence_ipmilan&amp;lt;/span&amp;gt; - IPMI fence agent&lt;br /&gt;
&lt;br /&gt;
The example above is what this tutorial will use.&lt;br /&gt;
&lt;br /&gt;
==== Example &amp;lt;fencedevice...&amp;gt; Tag For Node Assassin ====&lt;br /&gt;
&lt;br /&gt;
This is the device used throughout this tutorial. It is for the open source, open hardware [[Node Assassin]] fence device that you can build yourself.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;fencedevices&amp;gt;&lt;br /&gt;
		&amp;lt;fencedevice agent=&amp;quot;fence_na&amp;quot; ipaddr=&amp;quot;fence_na01.alteeve.com&amp;quot; login=&amp;quot;admin&amp;quot; name=&amp;quot;fence_na01&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;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Being a network-attached fence device, as most fence devices are, the attributes for &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fence_na&amp;lt;/span&amp;gt; include connection information. The attribute variable names are generally the same across fence agents, and they are:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ipaddr&amp;lt;/span&amp;gt;; This is the resolvable name or [[IP]] address of the device. If you use a resolvable name, it is strongly advised that you put the name in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/hosts&amp;lt;/span&amp;gt; as [[DNS]] is another layer of abstraction which could fail.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;login&amp;lt;/span&amp;gt;; This is the login name to use when the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fenced&amp;lt;/span&amp;gt; daemon connects to the device. This is configured in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/cluster/fence_na.conf&amp;lt;/span&amp;gt;.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;passwd&amp;lt;/span&amp;gt;; This is the login password to use when the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fenced&amp;lt;/span&amp;gt; daemon connects to the device. This is also configured in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/cluster/fence_na.conf&amp;lt;/span&amp;gt;.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;name&amp;lt;/span&amp;gt;; This is the name of this particular fence device within the cluster which, as we will see shortly, is matched in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;clusternode...&amp;gt;&amp;lt;/span&amp;gt; element where appropriate.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;quiet&amp;lt;/span&amp;gt;; This is a Node Assassin specific argument. It is used to generate no output to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[STDOUT]]&amp;lt;/span&amp;gt; when run, as there is no terminal to print to or user to view it.&lt;br /&gt;
&lt;br /&gt;
==== Example &amp;lt;fencedevice...&amp;gt; Tag For IPMI ====&lt;br /&gt;
&lt;br /&gt;
Here we will show what [[IPMI]] &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;fencedevice...&amp;gt;&amp;lt;/span&amp;gt; tags look like. We won&#039;t be using it ourselves, but it is quite popular as a fence device so I wanted to show an example of it&#039;s use.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;fencedevices&amp;gt;&lt;br /&gt;
		&amp;lt;fencedevice name=&amp;quot;an01_ipmi&amp;quot; agent=&amp;quot;fence_ipmilan&amp;quot; ipaddr=&amp;quot;192.168.4.74&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;an02_ipmi&amp;quot; agent=&amp;quot;fence_ipmilan&amp;quot; ipaddr=&amp;quot;192.168.4.75&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;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ipaddr&amp;lt;/span&amp;gt;; This is the resolvable name or [[IP]] address of the device. If you use a resolvable name, it is strongly advised that you put the name in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/hosts&amp;lt;/span&amp;gt; as [[DNS]] is another layer of abstraction which could fail.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;login&amp;lt;/span&amp;gt;; This is the login name to use when the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fenced&amp;lt;/span&amp;gt; daemon connects to the device.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;passwd&amp;lt;/span&amp;gt;; This is the login password to use when the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fenced&amp;lt;/span&amp;gt; daemon connects to the device.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;name&amp;lt;/span&amp;gt;; This is the name of this particular fence device within the cluster which, as we will see shortly, is matched in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;clusternode...&amp;gt;&amp;lt;/span&amp;gt; element where appropriate.&lt;br /&gt;
&lt;br /&gt;
{{note|1=We will see shortly that, unlike switched PDUs, Node Assassin or other network fence devices, [[IPMI]] does not have ports. This is because each [[IPMI]] BMC supports just it&#039;s host system. More on that later.}}&lt;br /&gt;
&lt;br /&gt;
==== Example &amp;lt;fencedevice...&amp;gt; Tag For HP&#039;s iLO ====&lt;br /&gt;
&lt;br /&gt;
Getting [[iLO]] to work in the cluster is a little trickier as the [[RPM]]s used to enable iLO must be downloaded from [[HP]]&#039;s website and manually installed. There is a &amp;quot;quickie&amp;quot; tutorial that covers getting iLO working on [[EL5]] below.&lt;br /&gt;
&lt;br /&gt;
* [[Configuring HP iLO 2 on EL5]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;fencedevices&amp;gt;&lt;br /&gt;
		&amp;lt;fencedevice name=&amp;quot;an01_ilo&amp;quot; agent=&amp;quot;fence_ilo&amp;quot; ipaddr=&amp;quot;192.168.4.74&amp;quot; login=&amp;quot;Administrator&amp;quot; passwd=&amp;quot;secret&amp;quot; /&amp;gt;&lt;br /&gt;
		&amp;lt;fencedevice name=&amp;quot;an02_ilo&amp;quot; agent=&amp;quot;fence_ilo&amp;quot; ipaddr=&amp;quot;192.168.4.75&amp;quot; login=&amp;quot;Administrator&amp;quot; passwd=&amp;quot;secret&amp;quot; /&amp;gt;&lt;br /&gt;
	&amp;lt;/fencedevices&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Example &amp;lt;fencedevice...&amp;gt; Tag For APC Switched PDUs ====&lt;br /&gt;
&lt;br /&gt;
Here we will show how to configure APC switched [[PDU]] &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;fencedevice...&amp;gt;&amp;lt;/span&amp;gt; tags. We won&#039;t be using it in this tutorial, but in the real world, it is &#039;&#039;&#039;highly&#039;&#039;&#039; recommended as a backup fence device for [[IPMI]] and similar primary fence devices.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
	...&lt;br /&gt;
		&amp;lt;fence&amp;gt;&lt;br /&gt;
			&amp;lt;method name=&amp;quot;pdu&amp;quot;&amp;gt;&lt;br /&gt;
				&amp;lt;device name=&amp;quot;pdu001&amp;quot; action=&amp;quot;reboot&amp;quot; port=&amp;quot;1&amp;quot;/&amp;gt;&lt;br /&gt;
			&amp;lt;/method&amp;gt;&lt;br /&gt;
		&amp;lt;/fence&amp;gt;&lt;br /&gt;
	...&lt;br /&gt;
	&amp;lt;fencedevices&amp;gt;&lt;br /&gt;
		&amp;lt;fencedevice name=&amp;quot;pdu001&amp;quot; agent=&amp;quot;fence_apc&amp;quot; ipaddr=&amp;quot;192.168.3.6&amp;quot; login=&amp;quot;apc&amp;quot; passwd=&amp;quot;secret&amp;quot;/&amp;gt;&lt;br /&gt;
	&amp;lt;/fencedevices&amp;gt;&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;ipaddr&amp;lt;/span&amp;gt;; This is the resolvable name or [[IP]] address of the device. If you use a resolvable name, it is strongly advised that you put the name in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/hosts&amp;lt;/span&amp;gt; as [[DNS]] is another layer of abstraction which could fail.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;login&amp;lt;/span&amp;gt;; This is the login name to use when the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fenced&amp;lt;/span&amp;gt; daemon connects to the device.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;passwd&amp;lt;/span&amp;gt;; This is the login password to use when the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fenced&amp;lt;/span&amp;gt; daemon connects to the device.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;name&amp;lt;/span&amp;gt;; This is the name of this particular fence device within the cluster which, as we will see shortly, is matched in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;clusternode...&amp;gt;&amp;lt;/span&amp;gt; element where appropriate.&lt;br /&gt;
&lt;br /&gt;
=== Using the Fence Devices ===&lt;br /&gt;
&lt;br /&gt;
Now we have nodes and fence devices defined, we will go back and tie them together. This is done by:&lt;br /&gt;
* Defining a &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[RHCS_v2_cluster.conf#Tag.3B_fence|fence]]&amp;lt;/span&amp;gt; tag containing all fence methods and devices.&lt;br /&gt;
** Defining one or more &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[RHCS_v2_cluster.conf#Tag.3B_method|method]]&amp;lt;/span&amp;gt; tag(s) containing the device call(s) needed for each fence attempt.&lt;br /&gt;
*** Defining one or more &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[RHCS_v2_cluster.conf#Tag.3B_device|device]]&amp;lt;/span&amp;gt; tag(s) containing attributes describing how to call the fence device to kill this node.&lt;br /&gt;
&lt;br /&gt;
This tutorial will be using just a [[Node Assassin]] fence device. We&#039;ll look at an example adding [[IPMI]] in a moment though, as IPMI is a very common fence device and one you will very likely use.&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-cluster01&amp;quot; config_version=&amp;quot;5&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;cman expected_votes=&amp;quot;1&amp;quot; two_node=&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-node04.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;fence_na01&amp;quot; port=&amp;quot;04&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-node05.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;fence_na01&amp;quot; port=&amp;quot;03&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_na01&amp;quot; agent=&amp;quot;fence_na&amp;quot; ipaddr=&amp;quot;fence_na01.alteeve.com&amp;quot; login=&amp;quot;admin&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;
{{note|1=You might note that the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05.alteeve.com&amp;lt;/span&amp;gt; has it&#039;s fence port set to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;03&amp;lt;/span&amp;gt;. In my case, I fried my second Node Assassin during testing and didn&#039;t get a chance to replace it. So instead I plugged it into port &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;03&amp;lt;/span&amp;gt;, which, conveniently, also helps illustrate that the port numbers do not need to relate in any way to the node names. This is probably self-evident, I do admit.}}&lt;br /&gt;
&lt;br /&gt;
First, notice that the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[RHCS_v2_cluster.conf#Tag.3B_fence|fence]]&amp;lt;/span&amp;gt; tag has no attributes. It&#039;s merely a container for the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[RHCS_v2_cluster.conf#Tag.3B_method|method]](s)&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The next level is the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[RHCS_v2_cluster.conf#Tag.3B_method|method]]&amp;lt;/span&amp;gt; named &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;node_assassin&amp;lt;/span&amp;gt;. This name is merely a description and can be whatever you feel is most appropriate. It&#039;s purpose is simply to help you distinguish this method from other methods. The reason for &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;method&amp;lt;/span&amp;gt; tags is that some fence device calls will have two or more steps. A classic example would be a node with a redundant power supply on a switch PDU acting as the fence device. In such a case, you will need to define multiple &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[RHCS_v2_cluster.conf#Tag.3B_device|device]]&amp;lt;/span&amp;gt; tags, one for each power cable feeding the node. In such a case, the cluster will not consider the fence a success unless and until all contained &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[RHCS_v2_cluster.conf#Tag.3B_device|device]]&amp;lt;/span&amp;gt; calls execute successfully.&lt;br /&gt;
&lt;br /&gt;
The actual fence &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[RHCS_v2_cluster.conf#Tag.3B_device|device]]&amp;lt;/span&amp;gt; configuration is the final piece of the puzzle. It is here that you specify per-node configuration options and link these attributes to a given &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[RHCS_v2_cluster.conf#Tag.3B_fencedevice|fencedevice]]&amp;lt;/span&amp;gt;. Here, we see the link to the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fencedevice&amp;lt;/span&amp;gt; via the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[RHCS_v2_cluster.conf#device.27s_name_attribute|name]]&amp;lt;/span&amp;gt;, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fence_na01&amp;lt;/span&amp;gt; in this example.&lt;br /&gt;
&lt;br /&gt;
Let&#039;s step through an example fence call to help show how the per-cluster and fence device attributes are combined during a fence call.&lt;br /&gt;
&lt;br /&gt;
* The cluster manager decides that a node needs to be fenced. Let&#039;s say that the victim is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt;.&lt;br /&gt;
* The first &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;method&amp;lt;/span&amp;gt; in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fence&amp;lt;/span&amp;gt; section under &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt; is consulted. Within it there is just one &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;device&amp;lt;/span&amp;gt;, named &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fence_na01&amp;lt;/span&amp;gt; and having two attributes;&lt;br /&gt;
** &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;port&amp;lt;/span&amp;gt;; This tells the cluster that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt; is connected to the Node Assassin&#039;s port number &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;03&amp;lt;/span&amp;gt;.&lt;br /&gt;
** &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;action&amp;lt;/span&amp;gt;; This tells the cluster that the fence action to take is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;reboot&amp;lt;/span&amp;gt;. How this action is actually interpreted depends on the fence device in use, though the name certainly implies that the node will be forced off and then restarted.&lt;br /&gt;
* The cluster searches in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fencedevices&amp;lt;/span&amp;gt; for a &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fencedevice&amp;lt;/span&amp;gt; matching the name &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fence_na01&amp;lt;/span&amp;gt;. This fence device has five attributes; &lt;br /&gt;
** &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;agent&amp;lt;/span&amp;gt;; This tells the cluster to call the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fence_na&amp;lt;/span&amp;gt; fence agent script, as we discussed earlier.&lt;br /&gt;
** &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ipaddr&amp;lt;/span&amp;gt;; This tells the fence agent where on the network to find this particular Node Assassin. This is how multiple fence devices of the same type can be used in the cluster.&lt;br /&gt;
** &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;login&amp;lt;/span&amp;gt;; This is the login user name to use when authenticating against the fence device.&lt;br /&gt;
** &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;passwd&amp;lt;/span&amp;gt;; This is the password to supply along with the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;login&amp;lt;/span&amp;gt; name when authenticating against the fence device.&lt;br /&gt;
** &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;quiet&amp;lt;/span&amp;gt;; This is a device-specific argument that Node Assassin uses (see &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;man fence_na&amp;lt;/span&amp;gt; for details).&lt;br /&gt;
* With this information collected and compiled, the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fenced&amp;lt;/span&amp;gt; daemon will call the fence agent and pass it the attribute &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;variable=value&amp;lt;/span&amp;gt; pairs, one per line. Thus, the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fenced&amp;lt;/span&amp;gt; daemon will call:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/usr/sbin/fence_na&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then it will pass to that agent the following arguments:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
ipaddr=fence_na01.alteeve.com&lt;br /&gt;
login=admin&lt;br /&gt;
passwd=secret&lt;br /&gt;
quiet=1&lt;br /&gt;
port=02&lt;br /&gt;
action=reboot&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As you can see then, the first four arguments are from the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fencedevice&amp;lt;/span&amp;gt; attributes and the last two are from the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;device&amp;lt;/span&amp;gt; attributes under &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt;&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clusternode&amp;lt;/span&amp;gt;&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fence&amp;lt;/span&amp;gt; tag. &lt;br /&gt;
&lt;br /&gt;
When you have two or more &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;method&amp;lt;/span&amp;gt; tags defined, then the first in the list will be tried. If any of it&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;device&amp;lt;/span&amp;gt; tags fail, then the method is considered to have failed and the next method is consulted. This will repeat until all &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;method&amp;lt;/span&amp;gt; entries have been tried. At that point, the cluster goes back to the first &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;method&amp;lt;/span&amp;gt; and tries again, repeating the walk through of all methods. This loop will continue until one &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;method&amp;lt;/span&amp;gt; succeeds, regardless of how long that might take.&lt;br /&gt;
&lt;br /&gt;
==== An Example Showing IPMI&#039;s Use ====&lt;br /&gt;
&lt;br /&gt;
This is a full configuration file showing what it would look like if we were using [[IPMI]] and a [[Node Assassin]] for redundant fencing.&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-cluster01&amp;quot; config_version=&amp;quot;6&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;cman expected_votes=&amp;quot;1&amp;quot; two_node=&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-node04.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;fence_na01&amp;quot; port=&amp;quot;04&amp;quot; action=&amp;quot;reboot&amp;quot;/&amp;gt;&lt;br /&gt;
				&amp;lt;/method&amp;gt;&lt;br /&gt;
				&amp;lt;method name=&amp;quot;an-node04_ipmi&amp;quot;&amp;gt;&lt;br /&gt;
					&amp;lt;device name=&amp;quot;an01_ipmi&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-node05.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;fence_na01&amp;quot; port=&amp;quot;03&amp;quot; action=&amp;quot;reboot&amp;quot;/&amp;gt;&lt;br /&gt;
				&amp;lt;/method&amp;gt;&lt;br /&gt;
				&amp;lt;method name=&amp;quot;an-node05_ipmi&amp;quot;&amp;gt;&lt;br /&gt;
					&amp;lt;device name=&amp;quot;an02_ipmi&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_na01&amp;quot; agent=&amp;quot;fence_na&amp;quot; ipaddr=&amp;quot;fence_na01.alteeve.com&amp;quot; login=&amp;quot;admin&amp;quot; passwd=&amp;quot;secret&amp;quot; quiet=&amp;quot;1&amp;quot;/&amp;gt;&lt;br /&gt;
		&amp;lt;fencedevice name=&amp;quot;an01_ipmi&amp;quot; agent=&amp;quot;fence_ipmilan&amp;quot; ipaddr=&amp;quot;192.168.4.74&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;an02_ipmi&amp;quot; agent=&amp;quot;fence_ipmilan&amp;quot; ipaddr=&amp;quot;192.168.4.75&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;
We now see three elements in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fencedevices&amp;lt;/span&amp;gt;. The first is the original Node Assassin entry plus two [[IPMI]] entries, one for each node in the cluster. As we touched on earlier, this is because each node has it&#039;s own IPMI [[BMC]]. In the same vein, we also now see that the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;device&amp;lt;/span&amp;gt; entries in each node&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;method&amp;lt;/span&amp;gt; element have no &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;port&amp;lt;/span&amp;gt; setting.&lt;br /&gt;
&lt;br /&gt;
Notice that the Node Assassin&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;method&amp;lt;/span&amp;gt; is above the IPMI &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;method&amp;lt;/span&amp;gt;. This means that the Node Assassin is the primary fence device and the IPMI is the secondary. When deciding which order to assign the fence devices, consider the device&#039;s potential for failure and how that might effect cluster recovery time. For example, many IPMI BMCs rely on the node&#039;s power supply to operate. Thus, if the node&#039;s power supply fails and the IPMI is the first fence device, then recovery will be delayed as the cluster will try, and then wait until it times out, before moving on to the networked fence device, Node Assassin in this instance.&lt;br /&gt;
&lt;br /&gt;
=== Give Nodes More Time To Start ===&lt;br /&gt;
&lt;br /&gt;
Clusters with more than three nodes will have to gain quorum before they can fence other nodes. As we saw earlier though, this is not really the case when using the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[RHCS_v2_cluster.conf#two_node|two_node]]=&amp;quot;1&amp;quot;&amp;lt;/span&amp;gt; attribute in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[RHCS_v2_cluster.conf#cman.3B_The_Cluster_Manager|cman]]&amp;lt;/span&amp;gt; tag. What this means in practice is that if you start the cluster on one node and then wait too long to start the cluster on the second node, the first will fence the second.&lt;br /&gt;
&lt;br /&gt;
The logic behind this is; When the cluster starts, it will try to talk to it&#039;s fellow node and then fail. With the special &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;two_node=&amp;quot;1&amp;quot;&amp;lt;/span&amp;gt; attribute set, the cluster knows that it is allowed to start clustered services, but it has no way to say for sure what state the other node is in. It could well be online and hosting services for all it knows. So it has to proceed on the assumption that the other node is alive and using shared resources. Given that, and given that it can not talk to the other node, it&#039;s only safe option is to fence the other node. Only then can it be confident that it is safe to start providing clustered services.&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-cluster01&amp;quot; config_version=&amp;quot;7&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;cman expected_votes=&amp;quot;1&amp;quot; two_node=&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-node04.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;fence_na01&amp;quot; port=&amp;quot;04&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-node05.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;fence_na01&amp;quot; port=&amp;quot;03&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_na01&amp;quot; agent=&amp;quot;fence_na&amp;quot; ipaddr=&amp;quot;fence_na01.alteeve.com&amp;quot; login=&amp;quot;admin&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;fence_daemon post_join_delay=&amp;quot;60&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/cluster&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The new tag is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[RHCS_v2_cluster.conf#fence_daemon.3B_Fencing|fence_daemon]]&amp;lt;/span&amp;gt;, seen near the bottom if the file above. The change is made using the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[RHCS_v2_cluster.conf#post_join_delay|post_join_delay]]=&amp;quot;60&amp;quot;&amp;lt;/span&amp;gt; attribute. By default, the cluster will declare the other node dead after just &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;6&amp;lt;/span&amp;gt; seconds. The reason is that the larger this value, the slower the start-up of the cluster services will be. During testing and development though, I find this value to be far too short and frequently led to unnecessary fencing. Once your cluster is setup and working, it&#039;s not a bad idea to reduce this value to the lowest value that you are comfortable with.&lt;br /&gt;
&lt;br /&gt;
=== Configuring Totem ===&lt;br /&gt;
&lt;br /&gt;
This is almost a misnomer, as we&#039;re more or less &#039;&#039;not&#039;&#039; configuring the [[totem]] protocol in this cluster.&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-cluster01&amp;quot; config_version=&amp;quot;8&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;cman expected_votes=&amp;quot;1&amp;quot; two_node=&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-node04.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;fence_na01&amp;quot; port=&amp;quot;04&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-node05.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;fence_na01&amp;quot; port=&amp;quot;03&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_na01&amp;quot; agent=&amp;quot;fence_na&amp;quot; ipaddr=&amp;quot;fence_na01.alteeve.com&amp;quot; login=&amp;quot;admin&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;fence_daemon post_join_delay=&amp;quot;60&amp;quot;/&amp;gt;&lt;br /&gt;
        &amp;lt;totem rrp_mode=&amp;quot;none&amp;quot; secauth=&amp;quot;off&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/cluster&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the spirit of &amp;quot;keeping it simple&amp;quot;, we&#039;re not configuring [[redundant ring protocol]] in this cluster. [[RRP]] is an optional second ring that can be used for cluster communication in the case of a break down in the first ring. This is not the simplest option to setup, as recovery must be done manually. However, if you wish to explore it further, please take a look at the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clusternode&amp;lt;/span&amp;gt; element tag called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;[[RHCS_v2_cluster.conf#Tag.3B_altname|altname]]...&amp;gt;&amp;lt;/span&amp;gt;. When &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[altname]]&amp;lt;/span&amp;gt; is used though, then the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[RHCS_v2_cluster.conf#rrp_mode|rrp_mode]]&amp;lt;/span&amp;gt; attribute will need to be changed to either &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;active&amp;lt;/span&amp;gt; or &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;passive&amp;lt;/span&amp;gt; (the details of which are outside the scope of this tutorial).&lt;br /&gt;
&lt;br /&gt;
The second option we&#039;re looking at here is the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[RHCS_v2_cluster.conf#secauth|secauth]]=&amp;quot;off&amp;quot;&amp;lt;/span&amp;gt; attribute. This controls whether the cluster communications are encrypted or not. We can safely disable this because we&#039;re working on a known-private network, which yields two benefits; It&#039;s simpler to setup and it&#039;s a lot faster. If you must encrypt the cluster communications, then you can do so here. The details of which are also outside the scope of this tutorial though.&lt;br /&gt;
&lt;br /&gt;
=== Validating and Pushing the /etc/cluster/cluster.conf File ===&lt;br /&gt;
&lt;br /&gt;
The cluster software validates the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/cluster/cluster.conf&amp;lt;/span&amp;gt; file against &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/usr/share/system-config-cluster/misc/cluster.ng&amp;lt;/span&amp;gt; using the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xmllint&amp;lt;/span&amp;gt; program. If it fails to validate, the cluster will refuse to start.&lt;br /&gt;
&lt;br /&gt;
So now that we&#039;ve got the foundation of our cluster ready, the last step is to validate it. To do so, simply run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
xmllint --relaxng /usr/share/system-config-cluster/misc/cluster.ng /etc/cluster/cluster.conf&lt;br /&gt;
&amp;lt;/source&amp;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-cluster01&amp;quot; config_version=&amp;quot;8&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;cman expected_votes=&amp;quot;1&amp;quot; two_node=&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-node04.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;fence_na01&amp;quot; port=&amp;quot;04&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-node05.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;fence_na01&amp;quot; port=&amp;quot;03&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_na01&amp;quot; agent=&amp;quot;fence_na&amp;quot; ipaddr=&amp;quot;fence_na01.alteeve.com&amp;quot; login=&amp;quot;admin&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;fence_daemon post_join_delay=&amp;quot;60&amp;quot;/&amp;gt;&lt;br /&gt;
        &amp;lt;totem rrp_mode=&amp;quot;none&amp;quot; secauth=&amp;quot;off&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/cluster&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;
/etc/cluster/cluster.conf validates&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If there was a problem, you need to go back and fix it. &#039;&#039;&#039;DO NOT&#039;&#039;&#039; proceed until your configuration validates. Once it does, we&#039;re ready to move on!&lt;br /&gt;
&lt;br /&gt;
With it validated, we need to push it to the other node. As the cluster is not running yet, we will push it out using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rsync&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;
rsync -av /etc/cluster/cluster.conf root@an-node05:/etc/cluster/&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
building file list ... done&lt;br /&gt;
cluster.conf&lt;br /&gt;
&lt;br /&gt;
sent 891 bytes  received 66 bytes  638.00 bytes/sec&lt;br /&gt;
total size is 790  speedup is 0.83&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Starting the Cluster For The First Time =&lt;br /&gt;
&lt;br /&gt;
At this point, we have the foundation of the cluster in place and we can start it up!&lt;br /&gt;
&lt;br /&gt;
== Keeping an Eye on Things ==&lt;br /&gt;
&lt;br /&gt;
I&#039;ve found a layout of four terminal windows, the left ones being 80 columns wide and the right ones filling the rest of the screen, works well. I personally run a &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;tail -f -n 0 /var/log/messages&amp;lt;/span&amp;gt; in the right windows so that I can keep an eye on things.&lt;br /&gt;
&lt;br /&gt;
[[Image:2-node_cluster_terminal_layout_01.png|thumb|center|700px|The terminal layout I use to monitor and operate the two nodes in the cluster.]]&lt;br /&gt;
&lt;br /&gt;
Of course, what you use is entirely up to you, your screen real-estate and your preferences.&lt;br /&gt;
&lt;br /&gt;
== A Note on Timing ==&lt;br /&gt;
&lt;br /&gt;
Remember that you have &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;post_join_delay&amp;lt;/span&amp;gt; seconds to start both nodes, which is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;60&amp;lt;/span&amp;gt; seconds in our configuration. So be sure that you can start the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt; daemon quickly on both nodes. I generally ensure that both terminal windows have the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;start&amp;lt;/span&amp;gt; command typed in, so that I can quickly press &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;enter&amp;gt;&amp;lt;/span&amp;gt; on both nodes. Again, how you do this is entirely up to you.&lt;br /&gt;
&lt;br /&gt;
== All Systems Are Go! ==&lt;br /&gt;
&lt;br /&gt;
Time to 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;
On both nodes, run the following command:&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;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Starting cluster: &lt;br /&gt;
   Loading modules... done&lt;br /&gt;
   Mounting configfs... done&lt;br /&gt;
   Starting ccsd... done&lt;br /&gt;
   Starting cman... done&lt;br /&gt;
   Starting daemons... done&lt;br /&gt;
   Starting fencing... done&lt;br /&gt;
                                                           [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If things went well, you should see something like this in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/var/log/messages&amp;lt;/span&amp;gt; terminal on both nodes:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
May  3 22:33:15 an-node04 ccsd[5319]: Starting ccsd 2.0.115: &lt;br /&gt;
May  3 22:33:15 an-node04 ccsd[5319]:  Built: Apr 28 2011 05:36:14 &lt;br /&gt;
May  3 22:33:15 an-node04 ccsd[5319]:  Copyright (C) Red Hat, Inc.  2004  All rights reserved. &lt;br /&gt;
May  3 22:33:15 an-node04 ccsd[5319]: cluster.conf (cluster name = an-cluster01, version = 8) found. &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [MAIN ] AIS Executive Service RELEASE &#039;subrev 1887 version 0.80.6&#039; &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [MAIN ] Copyright (C) 2002-2006 MontaVista Software, Inc and contributors. &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [MAIN ] Copyright (C) 2006 Red Hat, Inc. &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [MAIN ] AIS Executive Service: started and ready to provide service. &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [MAIN ] Using default multicast address of 239.192.235.77 &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [TOTEM] Token Timeout (10000 ms) retransmit timeout (495 ms) &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [TOTEM] token hold (386 ms) retransmits before loss (20 retrans) &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [TOTEM] join (60 ms) send_join (0 ms) consensus (2000 ms) merge (200 ms) &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [TOTEM] downcheck (1000 ms) fail to recv const (2500 msgs) &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [TOTEM] seqno unchanged const (30 rotations) Maximum network MTU 1402 &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [TOTEM] window size per rotation (50 messages) maximum messages per rotation (17 messages) &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [TOTEM] missed count const (5 messages) &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [TOTEM] send threads (0 threads) &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [TOTEM] RRP token expired timeout (495 ms) &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [TOTEM] RRP token problem counter (2000 ms) &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [TOTEM] RRP threshold (10 problem count) &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [TOTEM] RRP mode set to none. &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [TOTEM] heartbeat_failures_allowed (0) &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [TOTEM] max_network_delay (50 ms) &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [TOTEM] HeartBeat is Disabled. To enable set heartbeat_failures_allowed &amp;gt; 0 &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [TOTEM] Receive multicast socket recv buffer size (262142 bytes). &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [TOTEM] Transmit multicast socket send buffer size (262142 bytes). &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [TOTEM] The network interface [192.168.3.74] is now up. &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [TOTEM] Created or loaded sequence id 8.192.168.3.74 for this ring. &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [TOTEM] entering GATHER state from 15. &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [CMAN ] CMAN 2.0.115 (built Apr 28 2011 05:36:17) started &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [MAIN ] Service initialized &#039;openais CMAN membership service 2.01&#039; &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [SERV ] Service initialized &#039;openais extended virtual synchrony service&#039; &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [SERV ] Service initialized &#039;openais cluster membership service B.01.01&#039; &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [SERV ] Service initialized &#039;openais availability management framework B.01.01&#039; &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [SERV ] Service initialized &#039;openais checkpoint service B.01.01&#039; &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [SERV ] Service initialized &#039;openais event service B.01.01&#039; &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [SERV ] Service initialized &#039;openais distributed locking service B.01.01&#039; &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [SERV ] Service initialized &#039;openais message service B.01.01&#039; &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [SERV ] Service initialized &#039;openais configuration service&#039; &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [SERV ] Service initialized &#039;openais cluster closed process group service v1.01&#039; &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [SERV ] Service initialized &#039;openais cluster config database access v1.01&#039; &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [SYNC ] Not using a virtual synchrony filter. &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [TOTEM] Creating commit token because I am the rep. &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [TOTEM] Saving state aru 0 high seq received 0 &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [TOTEM] Storing new sequence id for ring c &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [TOTEM] entering COMMIT state. &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [TOTEM] entering RECOVERY state. &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [TOTEM] position [0] member 192.168.3.74: &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [TOTEM] previous ring seq 8 rep 192.168.3.74 &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [TOTEM] aru 0 high delivered 0 received flag 1 &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [TOTEM] Did not need to originate any messages in recovery. &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [TOTEM] Sending initial ORF token &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [CLM  ] CLM CONFIGURATION CHANGE &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [CLM  ] New Configuration: &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [CLM  ] Members Left: &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [CLM  ] Members Joined: &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [CLM  ] CLM CONFIGURATION CHANGE &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [CLM  ] New Configuration: &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [CLM  ] 	r(0) ip(192.168.3.74)  &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [CLM  ] Members Left: &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [CLM  ] Members Joined: &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [CLM  ] 	r(0) ip(192.168.3.74)  &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [SYNC ] This node is within the primary component and will provide service. &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [TOTEM] entering OPERATIONAL state. &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [CMAN ] quorum regained, resuming activity &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [CLM  ] got nodejoin message 192.168.3.74 &lt;br /&gt;
May  3 22:33:17 an-node04 ccsd[5319]: Initial status:: Quorate &lt;br /&gt;
May  3 22:33:18 an-node04 openais[5325]: [TOTEM] entering GATHER state from 11. &lt;br /&gt;
May  3 22:33:18 an-node04 openais[5325]: [TOTEM] Creating commit token because I am the rep. &lt;br /&gt;
May  3 22:33:18 an-node04 openais[5325]: [TOTEM] Saving state aru c high seq received c &lt;br /&gt;
May  3 22:33:18 an-node04 openais[5325]: [TOTEM] Storing new sequence id for ring 14 &lt;br /&gt;
May  3 22:33:18 an-node04 openais[5325]: [TOTEM] entering COMMIT state. &lt;br /&gt;
May  3 22:33:18 an-node04 openais[5325]: [TOTEM] entering RECOVERY state. &lt;br /&gt;
May  3 22:33:18 an-node04 openais[5325]: [TOTEM] position [0] member 192.168.3.74: &lt;br /&gt;
May  3 22:33:18 an-node04 openais[5325]: [TOTEM] previous ring seq 12 rep 192.168.3.74 &lt;br /&gt;
May  3 22:33:18 an-node04 openais[5325]: [TOTEM] aru c high delivered c received flag 1 &lt;br /&gt;
May  3 22:33:18 an-node04 openais[5325]: [TOTEM] position [1] member 192.168.3.75: &lt;br /&gt;
May  3 22:33:18 an-node04 openais[5325]: [TOTEM] previous ring seq 16 rep 192.168.3.75 &lt;br /&gt;
May  3 22:33:18 an-node04 openais[5325]: [TOTEM] aru c high delivered c received flag 1 &lt;br /&gt;
May  3 22:33:18 an-node04 openais[5325]: [TOTEM] Did not need to originate any messages in recovery. &lt;br /&gt;
May  3 22:33:18 an-node04 openais[5325]: [TOTEM] Sending initial ORF token &lt;br /&gt;
May  3 22:33:18 an-node04 openais[5325]: [CLM  ] CLM CONFIGURATION CHANGE &lt;br /&gt;
May  3 22:33:18 an-node04 openais[5325]: [CLM  ] New Configuration: &lt;br /&gt;
May  3 22:33:18 an-node04 openais[5325]: [CLM  ] 	r(0) ip(192.168.3.74)  &lt;br /&gt;
May  3 22:33:18 an-node04 openais[5325]: [CLM  ] Members Left: &lt;br /&gt;
May  3 22:33:18 an-node04 openais[5325]: [CLM  ] Members Joined: &lt;br /&gt;
May  3 22:33:18 an-node04 openais[5325]: [CLM  ] CLM CONFIGURATION CHANGE &lt;br /&gt;
May  3 22:33:18 an-node04 openais[5325]: [CLM  ] New Configuration: &lt;br /&gt;
May  3 22:33:18 an-node04 openais[5325]: [CLM  ] 	r(0) ip(192.168.3.74)  &lt;br /&gt;
May  3 22:33:18 an-node04 openais[5325]: [CLM  ] 	r(0) ip(192.168.3.75)  &lt;br /&gt;
May  3 22:33:18 an-node04 openais[5325]: [CLM  ] Members Left: &lt;br /&gt;
May  3 22:33:18 an-node04 openais[5325]: [CLM  ] Members Joined: &lt;br /&gt;
May  3 22:33:18 an-node04 openais[5325]: [CLM  ] 	r(0) ip(192.168.3.75)  &lt;br /&gt;
May  3 22:33:18 an-node04 openais[5325]: [SYNC ] This node is within the primary component and will provide service. &lt;br /&gt;
May  3 22:33:18 an-node04 openais[5325]: [TOTEM] entering OPERATIONAL state. &lt;br /&gt;
May  3 22:33:18 an-node04 openais[5325]: [CLM  ] got nodejoin message 192.168.3.74 &lt;br /&gt;
May  3 22:33:18 an-node04 openais[5325]: [CLM  ] got nodejoin message 192.168.3.75 &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From the node you started &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt; on first, you will see:&lt;br /&gt;
* The cluster configuration system daemon, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ccsd&amp;lt;/span&amp;gt;, starts up and reads in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/cluster/cluster.conf&amp;lt;/span&amp;gt;. It reports the name of the cluster, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-cluster01&amp;lt;/span&amp;gt; and the version, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;8&amp;lt;/span&amp;gt;.&lt;br /&gt;
* OpenAIS then starts up, reports it&#039;s multicast address it will use, reports many of it&#039;s variable values and what [[IP]] address it will use for cluster communications.&lt;br /&gt;
* The Cluster Manager, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt;, starts and reports the version of various services in use.&lt;br /&gt;
* The [[totem]] protocol is started and it forms an initial configuration containing just itself. These messages have the prefix &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;CLM&amp;lt;/span&amp;gt;, CLuster Membership.&lt;br /&gt;
** Then it waits to see if the other node will join. On the other node&#039;s log, you will see it start off and immediately join with this first node. &lt;br /&gt;
* The initial configuration is sufficient to gain quorum and declares that it will provide services.&lt;br /&gt;
* The second node announces that it wants to join the first node&#039;s cluster membership and the cluster reconfigures.&lt;br /&gt;
&lt;br /&gt;
From the node you started &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt; on second, you will see mostly the same thing, except you will not see the cluster form on the one node. Instead, it will connect directly to the first node and the initial configuration will be the pair together.&lt;br /&gt;
&lt;br /&gt;
If you got this, then you&#039;re cluster is up and running, congratulations!&lt;br /&gt;
&lt;br /&gt;
== Testing Fencing ==&lt;br /&gt;
&lt;br /&gt;
Before we go any further, we want to make sure that our fence device and configuration is working from both nodes. We will test this two ways;&lt;br /&gt;
* First, we will use the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fence_node&amp;lt;/span&amp;gt; tools.&lt;br /&gt;
* Second, we will break the network connection to simulate a network failure.&lt;br /&gt;
&lt;br /&gt;
=== Fencing with the fence_node Tool ===&lt;br /&gt;
&lt;br /&gt;
Testing this is easy, thanks to the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fence_node&amp;lt;/span&amp;gt; command line tool. It&#039;s simply a matter of calling &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fence_node &amp;lt;node&amp;gt;&amp;lt;/span&amp;gt;, where &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;node&amp;gt;&amp;lt;/span&amp;gt; has to match the name set in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cluster.conf&amp;lt;/span&amp;gt; file&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clusternode name=&amp;quot;...&amp;quot;&amp;lt;/span&amp;gt; element.&lt;br /&gt;
&lt;br /&gt;
We will do this test twice; Once from &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt;, fencing &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt; and then again from the other way around. After each fence call, we will wait for the node to reboot and then rejoin it to the cluster. We&#039;ll watch &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/var/log/messages&amp;lt;/span&amp;gt; to see what&#039;s happening.&lt;br /&gt;
&lt;br /&gt;
Let&#039;s start by fencing &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05.alteeve.com&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;From &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt;&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
fence_node05.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;
May  6 00:46:26 an-node04 openais[25357]: [TOTEM] The token was lost in the OPERATIONAL state.&lt;br /&gt;
May  6 00:46:26 an-node04 openais[25357]: [TOTEM] Receive multicast socket recv buffer size (262142 bytes).&lt;br /&gt;
May  6 00:46:26 an-node04 openais[25357]: [TOTEM] Transmit multicast socket send buffer size (262142 bytes).&lt;br /&gt;
May  6 00:46:26 an-node04 openais[25357]: [TOTEM] entering GATHER state from 2.&lt;br /&gt;
May  6 00:46:28 an-node04 openais[25357]: [TOTEM] entering GATHER state from 0.&lt;br /&gt;
May  6 00:46:28 an-node04 openais[25357]: [TOTEM] Creating commit token because I am the rep.&lt;br /&gt;
May  6 00:46:28 an-node04 openais[25357]: [TOTEM] Saving state aru 22 high seq received 22&lt;br /&gt;
May  6 00:46:28 an-node04 openais[25357]: [TOTEM] Storing new sequence id for ring 5c&lt;br /&gt;
May  6 00:46:28 an-node04 openais[25357]: [TOTEM] entering COMMIT state.&lt;br /&gt;
May  6 00:46:28 an-node04 openais[25357]: [TOTEM] entering RECOVERY state.&lt;br /&gt;
May  6 00:46:28 an-node04 openais[25357]: [TOTEM] position [0] member 192.168.3.74:&lt;br /&gt;
May  6 00:46:28 an-node04 openais[25357]: [TOTEM] previous ring seq 88 rep 192.168.3.74&lt;br /&gt;
May  6 00:46:28 an-node04 openais[25357]: [TOTEM] aru 22 high delivered 22 received flag 1&lt;br /&gt;
May  6 00:46:28 an-node04 openais[25357]: [TOTEM] Did not need to originate any messages in recovery.&lt;br /&gt;
May  6 00:46:28 an-node04 openais[25357]: [TOTEM] Sending initial ORF token&lt;br /&gt;
May  6 00:46:28 an-node04 openais[25357]: [CLM  ] CLM CONFIGURATION CHANGE&lt;br /&gt;
May  6 00:46:28 an-node04 openais[25357]: [CLM  ] New Configuration:&lt;br /&gt;
May  6 00:46:28 an-node04 fenced[25376]: an-node05.alteeve.com not a cluster member after 0 sec post_fail_delay&lt;br /&gt;
May  6 00:46:28 an-node04 kernel: dlm: closing connection to node 2&lt;br /&gt;
May  6 00:46:28 an-node04 openais[25357]: [CLM  ]       r(0) ip(192.168.3.74)&lt;br /&gt;
May  6 00:46:28 an-node04 fenced[25376]: fencing node &amp;quot;an-node05.alteeve.com&amp;quot;&lt;br /&gt;
May  6 00:46:28 an-node04 openais[25357]: [CLM  ] Members Left:&lt;br /&gt;
May  6 00:46:28 an-node04 openais[25357]: [CLM  ]       r(0) ip(192.168.3.75)&lt;br /&gt;
May  6 00:46:28 an-node04 openais[25357]: [CLM  ] Members Joined:&lt;br /&gt;
May  6 00:46:28 an-node04 openais[25357]: [CLM  ] CLM CONFIGURATION CHANGE&lt;br /&gt;
May  6 00:46:28 an-node04 openais[25357]: [CLM  ] New Configuration:&lt;br /&gt;
May  6 00:46:28 an-node04 openais[25357]: [CLM  ]       r(0) ip(192.168.3.74)&lt;br /&gt;
May  6 00:46:28 an-node04 openais[25357]: [CLM  ] Members Left:&lt;br /&gt;
May  6 00:46:28 an-node04 openais[25357]: [CLM  ] Members Joined:&lt;br /&gt;
May  6 00:46:28 an-node04 openais[25357]: [SYNC ] This node is within the primary component and will provide service.&lt;br /&gt;
May  6 00:46:28 an-node04 openais[25357]: [TOTEM] entering OPERATIONAL state.&lt;br /&gt;
May  6 00:46:28 an-node04 openais[25357]: [CLM  ] got nodejoin message 192.168.3.74&lt;br /&gt;
May  6 00:46:28 an-node04 openais[25357]: [CPG  ] got joinlist message from node 1&lt;br /&gt;
May  6 00:46:29 an-node04 fence_node[26696]: Fence of &amp;quot;an-node05.alteeve.com&amp;quot; was successful&lt;br /&gt;
May  6 00:46:42 an-node04 fenced[25376]: fence &amp;quot;an-node05.alteeve.com&amp;quot; success&lt;br /&gt;
May  6 00:50:23 an-node04 fence_node[26756]: Fence of &amp;quot;an-node05.alteeve.com&amp;quot; was successful&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{note|1=You will notice that there were two fence calls; This is normal. The first was the call from the command line that killed the node. The second was a reaction to the cluster reforming.}}&lt;br /&gt;
&lt;br /&gt;
Watching syslog, we&#039;ll see the node disappear, then the called fence finish, then the second fence called by the cluster itself succeed.&lt;br /&gt;
&lt;br /&gt;
If we check the cluster status from the surviving node, we&#039;ll see that the cluster has been reduced to just the single survivor node.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cman_tool 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;
Version: 6.2.0&lt;br /&gt;
Config Version: 8&lt;br /&gt;
Cluster Name: an-cluster01&lt;br /&gt;
Cluster Id: 60257&lt;br /&gt;
Cluster Member: Yes&lt;br /&gt;
Cluster Generation: 92&lt;br /&gt;
Membership state: Cluster-Member&lt;br /&gt;
Nodes: 1&lt;br /&gt;
Expected votes: 1&lt;br /&gt;
Total votes: 1&lt;br /&gt;
Quorum: 1  &lt;br /&gt;
Active subsystems: 7&lt;br /&gt;
Flags: 2node Dirty &lt;br /&gt;
Ports Bound: 0  &lt;br /&gt;
Node name: an-node04.alteeve.com&lt;br /&gt;
Node ID: 1&lt;br /&gt;
Multicast addresses: 239.192.235.77 &lt;br /&gt;
Node addresses: 192.168.3.74 &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once the victim has rebooted, we can rejoin it to the cluster. Now that the first node is already up, there is no need to worry about timing issues. Just start &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt; at your leisure. If you watch syslog from &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt;, you&#039;ll see &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt; connect and the cluster will reform to include it.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt;&#039;&#039;&#039;:&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;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Starting cluster: &lt;br /&gt;
   Loading modules... done&lt;br /&gt;
   Mounting configfs... done&lt;br /&gt;
   Starting ccsd... done&lt;br /&gt;
   Starting cman... done&lt;br /&gt;
   Starting daemons... done&lt;br /&gt;
   Starting fencing... done&lt;br /&gt;
                                                           [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{warning|1=Please do not assume that a successful fence against one node will mean that the fence against the other will work. An improper fence agent configuration, a typo in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cluster.conf&amp;lt;/span&amp;gt; or a fault in the wiring of the fence device could all cause node-specific fence failures.}}&lt;br /&gt;
&lt;br /&gt;
Now, repeat the process, but this time fence &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04.alteeve.com&amp;lt;/span&amp;gt; from &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Simulate a Network Failure ===&lt;br /&gt;
&lt;br /&gt;
It&#039;s good to know that we can fence the nodes with the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fence_node&amp;lt;/span&amp;gt; tool, but that is a controlled situation entirely within the context of the cluster. A more &amp;quot;real-world&amp;quot; test is now needed to ensure that a external fault will be detected by the cluster and that one of the nodes will be ejected. There are many, many ways to simulate a failure, and &#039;&#039;&#039;we will test&#039;&#039;&#039; all failures later. For now though, let&#039;s use a simple &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;iptables&amp;lt;/span&amp;gt; rule to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;DROP&amp;lt;/span&amp;gt; everything leaving our &#039;&#039;&#039;BCN&#039;&#039;&#039; interface.&lt;br /&gt;
&lt;br /&gt;
{{warning|1=This next command will block &#039;&#039;&#039;all&#039;&#039;&#039; traffic leaving the server. You will lose your &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ssh&amp;lt;/span&amp;gt; connection. If the fence fails, you will need to find another way to reboot or restore the server.}}&lt;br /&gt;
&lt;br /&gt;
This time, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04.alteeve.com&amp;lt;/span&amp;gt; will be the victim, so run the following &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;iptables&amp;lt;/span&amp;gt; command on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt; directly. This will cause all outbound traffic, including cluster communications, to fail. Within a few seconds, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt; should declare &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt; as dead, eject it via a fence call and then reconfigure.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt;&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
iptables -A OUTPUT -j DROP&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After a few seconds, you should see &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt; trigger the fence.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;In &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt;&#039;s syslog&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
May  6 01:11:08 an-node04 openais[4339]: [TOTEM] The token was lost in the OPERATIONAL state. &lt;br /&gt;
May  6 01:11:08 an-node04 openais[4339]: [TOTEM] Receive multicast socket recv buffer size (262142 bytes). &lt;br /&gt;
May  6 01:11:08 an-node04 openais[4339]: [TOTEM] Transmit multicast socket send buffer size (262142 bytes). &lt;br /&gt;
May  6 01:11:08 an-node04 openais[4339]: [TOTEM] entering GATHER state from 2. &lt;br /&gt;
May  6 01:11:10 an-node04 openais[4339]: [TOTEM] entering GATHER state from 0. &lt;br /&gt;
May  6 01:11:10 an-node04 openais[4339]: [TOTEM] Creating commit token because I am the rep. &lt;br /&gt;
May  6 01:11:10 an-node04 openais[4339]: [TOTEM] Saving state aru 24 high seq received 24 &lt;br /&gt;
May  6 01:11:10 an-node04 openais[4339]: [TOTEM] Storing new sequence id for ring 70 &lt;br /&gt;
May  6 01:11:10 an-node04 openais[4339]: [TOTEM] entering COMMIT state. &lt;br /&gt;
May  6 01:11:10 an-node04 openais[4339]: [TOTEM] entering RECOVERY state. &lt;br /&gt;
May  6 01:11:10 an-node04 openais[4339]: [TOTEM] position [0] member 192.168.3.74: &lt;br /&gt;
May  6 01:11:10 an-node04 openais[4339]: [TOTEM] previous ring seq 108 rep 192.168.3.74 &lt;br /&gt;
May  6 01:11:10 an-node04 openais[4339]: [TOTEM] aru 24 high delivered 24 received flag 1 &lt;br /&gt;
May  6 01:11:10 an-node04 openais[4339]: [TOTEM] Did not need to originate any messages in recovery. &lt;br /&gt;
May  6 01:11:10 an-node04 openais[4339]: [TOTEM] Sending initial ORF token &lt;br /&gt;
May  6 01:11:10 an-node04 openais[4339]: [CLM  ] CLM CONFIGURATION CHANGE &lt;br /&gt;
May  6 01:11:10 an-node04 openais[4339]: [CLM  ] New Configuration: &lt;br /&gt;
May  6 01:11:10 an-node04 kernel: dlm: closing connection to node 2&lt;br /&gt;
May  6 01:11:10 an-node04 fenced[4358]: an-node05.alteeve.com not a cluster member after 0 sec post_fail_delay&lt;br /&gt;
May  6 01:11:10 an-node04 openais[4339]: [CLM  ] 	r(0) ip(192.168.3.74)  &lt;br /&gt;
May  6 01:11:10 an-node04 fenced[4358]: fencing node &amp;quot;an-node05.alteeve.com&amp;quot;&lt;br /&gt;
May  6 01:11:10 an-node04 openais[4339]: [CLM  ] Members Left: &lt;br /&gt;
May  6 01:11:10 an-node04 openais[4339]: [CLM  ] 	r(0) ip(192.168.3.75)  &lt;br /&gt;
May  6 01:11:10 an-node04 openais[4339]: [CLM  ] Members Joined: &lt;br /&gt;
May  6 01:11:10 an-node04 openais[4339]: [CLM  ] CLM CONFIGURATION CHANGE &lt;br /&gt;
May  6 01:11:10 an-node04 openais[4339]: [CLM  ] New Configuration: &lt;br /&gt;
May  6 01:11:10 an-node04 openais[4339]: [CLM  ] 	r(0) ip(192.168.3.74)  &lt;br /&gt;
May  6 01:11:10 an-node04 openais[4339]: [CLM  ] Members Left: &lt;br /&gt;
May  6 01:11:10 an-node04 openais[4339]: [CLM  ] Members Joined: &lt;br /&gt;
May  6 01:11:10 an-node04 openais[4339]: [SYNC ] This node is within the primary component and will provide service. &lt;br /&gt;
May  6 01:11:10 an-node04 openais[4339]: [TOTEM] entering OPERATIONAL state. &lt;br /&gt;
May  6 01:11:10 an-node04 openais[4339]: [CLM  ] got nodejoin message 192.168.3.74 &lt;br /&gt;
May  6 01:11:10 an-node04 openais[4339]: [CPG  ] got joinlist message from node 1 &lt;br /&gt;
May  6 01:11:23 an-node04 fenced[4358]: fence &amp;quot;an-node05.alteeve.com&amp;quot; success&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Success!&lt;br /&gt;
&lt;br /&gt;
Now repeat this, making &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt; the victim. &lt;br /&gt;
&lt;br /&gt;
If both fence tests succeeded against both nodes, you can be confident that fencing is working well!&lt;br /&gt;
&lt;br /&gt;
= Setting Up Clustered Storage =&lt;br /&gt;
&lt;br /&gt;
The next few steps will cover setting up the DRBD resources, using them in clustered [[LVM]] and the creating a [[GFS2]] partition. Next, we will add it all as cluster resources and then create a service for each node to start up all of the clustered storage.&lt;br /&gt;
&lt;br /&gt;
== Creating Our DRBD Resources ==&lt;br /&gt;
&lt;br /&gt;
We&#039;re going to create four DRBD resources;&lt;br /&gt;
&lt;br /&gt;
* A resource to back our shared [[GFS2]] partition which will hold shared files, like our virtual machine configuration files.&lt;br /&gt;
* A resource to back the VMs running primarily on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt;.&lt;br /&gt;
* A resource to back the VMs running primarily on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt;.&lt;br /&gt;
* A final resource that will be left alone for future expansion. This is optional, of course.&lt;br /&gt;
&lt;br /&gt;
=== The &amp;quot;Why&amp;quot; of Our Layout ===&lt;br /&gt;
&lt;br /&gt;
The reason for this is to minimize the chance of data loss in a [[split-brain]] event. &lt;br /&gt;
&lt;br /&gt;
A split-brain occurs when a [[DRBD]] resource loses it&#039;s network link while in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Primary/Primary&amp;lt;/span&amp;gt; mode. The problem is that, after the split, any write to either node is not replicated to the other node. Thus, after even one [[byte]] is written, the DRBD resource is out of sync. Once this happens, there is no real way to automate recovery. You will need to go in and manual flag one side of the resource to discard it&#039;s changes and then manually re-connect the two sides before the resource will be usable again.&lt;br /&gt;
&lt;br /&gt;
We will take steps to prevent this, but it always a possibility with shared storage.&lt;br /&gt;
&lt;br /&gt;
Given then that there is no sure way to avoid this, we&#039;re going to mitigate risk by breaking up our DRBD resources so that we can be more selective in choosing what parts to invalidate after a split brain event.&lt;br /&gt;
&lt;br /&gt;
* The small GFS2 partition will be the hardest to manage. For this reason, it is on it&#039;s own. For the same reason, we will be using it as little as we can, and copies of files we care about will be stored on each node. The main thing here are the VM configuration files. This should be written to rarely, so with luck, in a split brain condition, simply nothing will be written to either side so recovery should be arbitrary and simple.&lt;br /&gt;
* The VMs that will primarily run on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt; will get their own resource. This way we can simply invalidate the DRBD device on the node that was &#039;&#039;&#039;not&#039;&#039;&#039; running the VMs during the split brain.&lt;br /&gt;
* Likewise, the VMs primarily running on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt; will get their own resource. This way, if a split brain happens and VMs are running on both nodes, it should be easily to invalidate opposing nodes for the respective DRBD resource.&lt;br /&gt;
* The fourth DRBD resource will just contain free space. This can later be added whole to an existing LVM VG or further divided up as needed in the future.&lt;br /&gt;
&lt;br /&gt;
== Visualizing Storage ==&lt;br /&gt;
&lt;br /&gt;
The layout of our storage is, on the surface, somewhat complex. To help follow what we&#039;ll be creating, here is an [[ASCII]] drawing showing what it will look like. Note that example VMs are shown, which we will not be creating. This is to help you see where extra VMs would exist if you ran two or more VMs per node.&lt;br /&gt;
&lt;br /&gt;
If you are using [[RAID]], then you can simply replace &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;sdaX&amp;lt;/span&amp;gt; with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;mdX&amp;lt;/span&amp;gt;. You can find a tutorial on manually creating RAID devices here:&lt;br /&gt;
* [[Managing Software RAID Arrays]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
         [ an-node04 ]&lt;br /&gt;
  ______   ______    ______     __[sda4]__&lt;br /&gt;
 | sda1 | | sda2 |  | sda3 |   |  ______  |       _______    ______________    ______________________________&lt;br /&gt;
 |______| |______|  |______|   | | sda5 |-+------| drbd0 |--| drbd_sh0_vg0 |--| /dev/drbd_sh0_vg0/xen_shared |&lt;br /&gt;
     |        |         |      | |______| |   /--|_______|  |______________|  |______________________________|&lt;br /&gt;
  ___|___    _|_    ____|____  |  ______  |   |     _______    ______________    ____________________________&lt;br /&gt;
 | /boot |  | / |  | &amp;lt;swap&amp;gt;  | | | sda6 |-+---+----| drbd1 |--| drbd_an4_vg0 |--| /dev/drbd_an4_vg0/vm0001_1 |&lt;br /&gt;
 |_______|  |___|  |_________| | |______| |   | /--|_______|  |______________|  |____________________________|&lt;br /&gt;
                               |  ______  |   | |     _______    ______________    ____________________________&lt;br /&gt;
                               | | sda7 |-+---+-+----| drbd2 |--| drbd_an5_vg0 |--| /dev/drbd_an5_vg0/vm0002_1 | &lt;br /&gt;
                               | |______| |   | | /--|_______|  |______________|  |____________________________|&lt;br /&gt;
                               |  ______  |   | | |                         | |    _______________________&lt;br /&gt;
                               | | sda8 |-+---+-+-+--\                      | \---| Example LV for 2nd VM |&lt;br /&gt;
                               | |______| |   | | |  |                      |     |_______________________|&lt;br /&gt;
                               |__________|   | | |  |                      |      _______________________&lt;br /&gt;
         [ an-node05 ]                        | | |  |                      \-----| Example LV for 3rd VM |&lt;br /&gt;
  ______   ______    ______     __[sda4]__    | | |  |                            |_______________________|&lt;br /&gt;
 | sda1 | | sda2 |  | sda3 |   |  ______  |   | | |  |                   &lt;br /&gt;
 |______| |______|  |______|   | | sda5 |-+---/ | |  |   _______    __________________&lt;br /&gt;
     |        |         |      | |______| |     | |  \--| drbd3 |--| Spare PV for     |&lt;br /&gt;
  ___|___    _|_    ____|____  |  ______  |     | |  /--|_______|  | future expansion |&lt;br /&gt;
 | /boot |  | / |  | &amp;lt;swap&amp;gt;  | | | sda6 |-+-----/ |  |             |__________________|&lt;br /&gt;
 |_______|  |___|  |_________| | |______| |       |  |&lt;br /&gt;
                               |  ______  |       |  |&lt;br /&gt;
                               | | sda7 |-+-------/  |&lt;br /&gt;
                               | |______| |          |&lt;br /&gt;
                               |  ______  |          |&lt;br /&gt;
                               | | sda8 |-+----------/&lt;br /&gt;
                               | |______| |&lt;br /&gt;
                               |__________|&lt;br /&gt;
.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Modifying the Physical Storage ===&lt;br /&gt;
&lt;br /&gt;
{{warning|1=Multiple assumptions ahead. If you are comfortable &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fdisk&amp;lt;/span&amp;gt; (and possibly &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;mdadm&amp;lt;/span&amp;gt;), you can largely skip this section. You will need to create four partitions; This tutorial uses a &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;10&amp;lt;/span&amp;gt; [[GiB]] for shared files, two &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;100&amp;lt;/span&amp;gt; [[GiB]] and the remainder of the space in the last partition. These will be four extended partitions, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/sda5&amp;lt;/span&amp;gt;, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/sda6&amp;lt;/span&amp;gt;, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/sda7&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/sda8&amp;lt;/span&amp;gt; respectively.}}&lt;br /&gt;
&lt;br /&gt;
This tutorial, in the interest of simplicity and not aiming to be a disk management tutorial, uses single-disk storage on each node. If you only have one disk, or if you have hardware RAID, this is sufficient. However, if you have multiple disks and want to use software RAID on your nodes, you will need to create &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/mdX&amp;lt;/span&amp;gt; devices to match the layout we will be creating. Here is a tutorial on managing software RAID arrays, written with this tutorial in mind.&lt;br /&gt;
&lt;br /&gt;
* [[Managing Software RAID Arrays]]&lt;br /&gt;
&lt;br /&gt;
We will need four new partitions; a &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;10&amp;lt;/span&amp;gt; [[GiB]] partition for the [[GFS2]] resource, two &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;100&amp;lt;/span&amp;gt; [[GiB]] partitions for the VMs on either node and the remainder of the disk&#039;s free space for the last partition. To do this, we will use the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fdisk&amp;lt;/span&amp;gt; tool. Be aware; This tool directly edits the hard drive&#039;s geometry. This is obviously risky! All along, this tutorial has assumed that you are working on test nodes, but it bears repeating again. Do not do this on a machine with data you care about! At the very least, have a good backup.&lt;br /&gt;
&lt;br /&gt;
Finally, this assumes that you used the [[generic_el5_node.ks|kickstart script]] when setting up your nodes. More to the point, it assumes an existing fourth primary partition which we will delete, convert to an extended partition and then within that create the four usable partitions.&lt;br /&gt;
&lt;br /&gt;
{{note|1=This is no longer completely accurate. The new kickstart script above does not create the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/sda4&amp;lt;/span&amp;gt; device any longer. The example remains though to show how to delete a partition, in case it is helpful to some readers.}}&lt;br /&gt;
&lt;br /&gt;
So first, delete the fourth partition.&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;
The number of cylinders for this disk is set to 60801.&lt;br /&gt;
There is nothing wrong with that, but this is larger than 1024,&lt;br /&gt;
and could in certain setups cause problems with:&lt;br /&gt;
1) software that runs at boot time (e.g., old versions of LILO)&lt;br /&gt;
2) booting and partitioning software from other OSs&lt;br /&gt;
   (e.g., DOS FDISK, OS/2 FDISK)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Confirm that the layout is indeed four partitions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Command (m for help): 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;
&lt;br /&gt;
   Device Boot      Start         End      Blocks   Id  System&lt;br /&gt;
/dev/sda1   *           1          32      257008+  83  Linux&lt;br /&gt;
/dev/sda2              33        2643    20972857+  83  Linux&lt;br /&gt;
/dev/sda3            2644        3165     4192965   82  Linux swap / Solaris&lt;br /&gt;
/dev/sda4            3166       60801   462961170   83  Linux&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is, so let&#039;s delete &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/sda4&amp;lt;/span&amp;gt; and then confirm that it is gone.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Command (m for help): d&lt;br /&gt;
Partition number (1-4): 4&lt;br /&gt;
&lt;br /&gt;
Command (m for help): 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;
&lt;br /&gt;
   Device Boot      Start         End      Blocks   Id  System&lt;br /&gt;
/dev/sda1   *           1          32      257008+  83  Linux&lt;br /&gt;
/dev/sda2              33        2643    20972857+  83  Linux&lt;br /&gt;
/dev/sda3            2644        3165     4192965   82  Linux swap / Solaris&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is, so now we&#039;ll create the extended partition.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Command (m for help): n&lt;br /&gt;
Command action&lt;br /&gt;
   e   extended&lt;br /&gt;
   p   primary partition (1-4)&lt;br /&gt;
e&lt;br /&gt;
Selected partition 4&lt;br /&gt;
First cylinder (3166-60801, default 3166): &amp;lt;enter&amp;gt;&lt;br /&gt;
Using default value 3166&lt;br /&gt;
Last cylinder or +size or +sizeM or +sizeK (3166-60801, default 60801): &amp;lt;enter&amp;gt;&lt;br /&gt;
Using default value 60801&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Again, a quick check to make sure the extended partition is now there.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Command (m for help): 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;
&lt;br /&gt;
   Device Boot      Start         End      Blocks   Id  System&lt;br /&gt;
/dev/sda1   *           1          32      257008+  83  Linux&lt;br /&gt;
/dev/sda2              33        2643    20972857+  83  Linux&lt;br /&gt;
/dev/sda3            2644        3165     4192965   82  Linux swap / Solaris&lt;br /&gt;
/dev/sda4            3166       60801   462961170    5  Extended&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Finally, let&#039;s create the four partitions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Command (m for help): n&lt;br /&gt;
First cylinder (3166-60801, default 3166): &lt;br /&gt;
Using default value 3166&lt;br /&gt;
Last cylinder or +size or +sizeM or +sizeK (3166-60801, default 60801): +10G&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;
Command (m for help): n&lt;br /&gt;
First cylinder (4383-60801, default 4383): &amp;lt;enter&amp;gt;&lt;br /&gt;
Using default value 4383&lt;br /&gt;
Last cylinder or +size or +sizeM or +sizeK (4383-60801, default 60801): +100G&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;
Command (m for help): n&lt;br /&gt;
First cylinder (16542-60801, default 16542): &amp;lt;enter&amp;gt;&lt;br /&gt;
Using default value 16542&lt;br /&gt;
Last cylinder or +size or +sizeM or +sizeK (16542-60801, default 60801): +100G&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;
Command (m for help): n&lt;br /&gt;
First cylinder (28701-60801, default 28701): &amp;lt;enter&amp;gt;&lt;br /&gt;
Using default value 28701&lt;br /&gt;
Last cylinder or +size or +sizeM or +sizeK (28701-60801, default 60801): &amp;lt;enter&amp;gt;&lt;br /&gt;
Using default value 60801&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Finally, check that the four new partitions exist.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Command (m for help): 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;
&lt;br /&gt;
   Device Boot      Start         End      Blocks   Id  System&lt;br /&gt;
/dev/sda1   *           1          32      257008+  83  Linux&lt;br /&gt;
/dev/sda2              33        2643    20972857+  83  Linux&lt;br /&gt;
/dev/sda3            2644        3165     4192965   82  Linux swap / Solaris&lt;br /&gt;
/dev/sda4            3166       60801   462961170    5  Extended&lt;br /&gt;
/dev/sda5            3166        4382     9775521   83  Linux&lt;br /&gt;
/dev/sda6            4383       16541    97667136   83  Linux&lt;br /&gt;
/dev/sda7           16542       28700    97667136   83  Linux&lt;br /&gt;
/dev/sda8           28701       60801   257851251   83  Linux&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We do! So now we&#039;ll commit the changes to disk and exit.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Command (m for help): 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.&lt;br /&gt;
The new table will be used at the next reboot.&lt;br /&gt;
Syncing disks.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{warning|1=Repeat the steps on the other node and double-check that the output of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fdisk -l /dev/sda&amp;lt;/span&amp;gt; shows the same &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Start&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;End&amp;lt;/span&amp;gt; boundaries. &#039;&#039;If they do not match, fix it before proceeding&#039;&#039;.}}&lt;br /&gt;
&lt;br /&gt;
{{note|1=This was done on the same disk as the host OS, so we&#039;ll need to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;reboot&amp;lt;/span&amp;gt; before we can proceed.}}&lt;br /&gt;
&lt;br /&gt;
== Creating the DRBD Resources ==&lt;br /&gt;
&lt;br /&gt;
Now that we have either node&#039;s storage ready, we can configure and start the DRBD resources. DRBD has &amp;quot;resource names&amp;quot;, which is it&#039;s internal reference to the &amp;quot;array&amp;quot;. These names are used whenever you are working on the resource using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;drbdadm&amp;lt;/span&amp;gt; or similar tools. The tradition is to name the resources as &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rX&amp;lt;/span&amp;gt;, with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;X&amp;lt;/span&amp;gt; being a sequence number starting at &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;0&amp;lt;/span&amp;gt;. The resource itself is made available as a normal &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/&amp;lt;/span&amp;gt; block device. The tradition is to name this device &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/drbdX&amp;lt;/span&amp;gt; where &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;X&amp;lt;/span&amp;gt; matches the resource&#039;s sequence number.&lt;br /&gt;
&lt;br /&gt;
=== The DRBD Fence Script ===&lt;br /&gt;
&lt;br /&gt;
{{warning|1=There is a problem with the current [[Node Assassin]] fence agent where multiple simultaneous fence calls will fail to return a success after each fence call. Until this is resolved, you will need to disable &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;outdate-peer&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fencing&amp;lt;/span&amp;gt; in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/drbd.conf&amp;lt;/span&amp;gt; by commenting out the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;disk { }&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;handler { }&amp;lt;/span&amp;gt; blocks in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;common { }&amp;lt;/span&amp;gt;.}}&lt;br /&gt;
&lt;br /&gt;
Red Hat&#039;s [http://people.redhat.com/lhh/ Lon Hohberger] created a DRBD script called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[obliterate]]&amp;lt;/span&amp;gt;, which was later updated to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[obliterate-peer.sh]]&amp;lt;/span&amp;gt;, that allows DRBD to trigger a fence call through the cluster when it detects a split-brain condition. The goal behind this is to stop the resource(s) from being flagged as &amp;quot;split-brain&amp;quot; in the first place, thus avoiding manual recovery. We will be using the newer &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[obliterate-peer.sh]]&amp;lt;/span&amp;gt; script. The difference between the two scripts is that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[obliterate]]&amp;lt;/span&amp;gt; will try to fence once only, where &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[obliterate-peer.sh]]&amp;lt;/span&amp;gt; will continue to fence until it succeeds. The former will block DRBD if it fails, which is not good.&lt;br /&gt;
&lt;br /&gt;
Download the script below and save it under your &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/sbin/&amp;lt;/span&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/sbin/[[obliterate-peer.sh]]&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then ensure that it is executable.&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/sbin/obliterate-peer.sh -O /sbin/obliterate-peer.sh&lt;br /&gt;
chmod a+x /sbin/obliterate-peer.sh&lt;br /&gt;
ls -lah /sbin/obliterate-peer.sh &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
-rw-r--r-- 1 root root 2.1K May  4 14:31 /sbin/obliterate-peer.sh&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Our Desired Layout in Detail ===&lt;br /&gt;
&lt;br /&gt;
Let&#039;s review how we will bring the devices together.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt;&lt;br /&gt;
!&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt;&lt;br /&gt;
!DRBD Resource&lt;br /&gt;
!DRBD Device&lt;br /&gt;
!Size&lt;br /&gt;
!Note&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/sda5&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/sda5&amp;lt;/span&amp;gt;&lt;br /&gt;
|style=&amp;quot;text-align: center;&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;r0&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/drbd0&amp;lt;/span&amp;gt;&lt;br /&gt;
|style=&amp;quot;white-space: nowrap; text-align: center;&amp;quot;|10 [[GB]]&lt;br /&gt;
|[[GFS2]] partition for VM configurations and shared files&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/sda6&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/sda6&amp;lt;/span&amp;gt;&lt;br /&gt;
|style=&amp;quot;text-align: center;&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;r1&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/drbd1&amp;lt;/span&amp;gt;&lt;br /&gt;
|style=&amp;quot;white-space: nowrap; text-align: center;&amp;quot;|100 [[GB]]&lt;br /&gt;
|Host VMs that will primarily run on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/sda7&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/sda7&amp;lt;/span&amp;gt;&lt;br /&gt;
|style=&amp;quot;text-align: center;&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;r2&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/drbd2&amp;lt;/span&amp;gt;&lt;br /&gt;
|style=&amp;quot;white-space: nowrap; text-align: center;&amp;quot;|100 [[GB]]&lt;br /&gt;
|Host VMs that will primarily run on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/sda8&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/sda8&amp;lt;/span&amp;gt;&lt;br /&gt;
|style=&amp;quot;text-align: center;&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;r3&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/drbd3&amp;lt;/span&amp;gt;&lt;br /&gt;
|style=&amp;quot;white-space: nowrap;&amp;quot;|&lt;br /&gt;
|Free space that can later be allocated to an existing [[VG]] as-is or further divided up into two or more DRBD resources as future needs dictate.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Configuring /etc/drbd.conf ===&lt;br /&gt;
&lt;br /&gt;
With this plan then, we can now create the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/drbd.conf&amp;lt;/span&amp;gt; configuration file.&lt;br /&gt;
&lt;br /&gt;
The initial file is very sparse;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/drbd.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;
#&lt;br /&gt;
# please have a a look at the example configuration file in&lt;br /&gt;
# /usr/share/doc/drbd83/drbd.conf&lt;br /&gt;
#&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Setting up the &#039;global&#039; Directive ====&lt;br /&gt;
&lt;br /&gt;
There are a lot of options available to you, many of which are outside the scope of this tutorial. You can get a good overview of all option by reading the man page; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;man drbd.conf&amp;lt;/span&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
The first section we will add is the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;global { }&amp;lt;/span&amp;gt; directive. There is only one argument we will set, which tells DRBD that it can count our install in the Linbit user information. If you have privacy concerns, set this to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;no&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;
# The &#039;global&#039; directive covers values that apply to RBD in general.&lt;br /&gt;
global {&lt;br /&gt;
        # This tells Linbit that it&#039;s okay to count us as a DRBD user. If you&lt;br /&gt;
        # have privacy concerns, set this to &#039;no&#039;.&lt;br /&gt;
        usage-count     yes;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Setting up the &#039;common&#039; Directive ====&lt;br /&gt;
&lt;br /&gt;
The next directive is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;common { }&amp;lt;/span&amp;gt;. This sets values to be used on all DRBD resources by default. You can override &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;common&amp;lt;/span&amp;gt; values in any given resource directive later. &lt;br /&gt;
&lt;br /&gt;
The example below is well documented, so please take a moment to look at the example for &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;
# The &#039;common&#039; directive sets defaults values for all resources.&lt;br /&gt;
common {&lt;br /&gt;
        # Protocol &#039;C&#039; tells DRBD to not report a disk write as complete until&lt;br /&gt;
        # it has been confirmed written to both nodes. This is required for&lt;br /&gt;
        # Primary/Primary use.&lt;br /&gt;
        protocol C;&lt;br /&gt;
&lt;br /&gt;
        # This sets the default sync rate to 15 MiB/sec. Be careful about&lt;br /&gt;
        # setting this too high! High speed sync&#039;ing can flog your drives and&lt;br /&gt;
        # push disk I/O times very high.&lt;br /&gt;
        syncer {&lt;br /&gt;
                rate 15M;&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        # This tells DRBD what policy to use when a fence is required.&lt;br /&gt;
        disk {&lt;br /&gt;
                # This tells DRBD to block I/O (resource) and then try to fence&lt;br /&gt;
                # the other node (stonith). The &#039;stonith&#039; option requires that&lt;br /&gt;
                # we set a fence handler below. The name &#039;stonith&#039; comes from&lt;br /&gt;
                # &amp;quot;Shoot The Other Nide In The Head&amp;quot; and is a term used in&lt;br /&gt;
                # other clustering environments. It is synonomous with with&lt;br /&gt;
                # &#039;fence&#039;.&lt;br /&gt;
                fencing         resource-and-stonith;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        # We set &#039;stonith&#039; above, so here we tell DRBD how to actually fence&lt;br /&gt;
        # the other node.&lt;br /&gt;
        handlers {&lt;br /&gt;
                # The term &#039;outdate-peer&#039; comes from other scripts that flag&lt;br /&gt;
                # the other node&#039;s resource backing device as &#039;Inconsistent&#039;.&lt;br /&gt;
                # In our case though, we&#039;re flat-out fencing the other node,&lt;br /&gt;
                # which has the same effective result.&lt;br /&gt;
                outdate-peer    &amp;quot;/sbin/obliterate-peer.sh&amp;quot;;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        # Here we tell DRBD that we want to use Primary/Primary mode. It is&lt;br /&gt;
        # also where we define split-brain (sb) recovery policies. As we&#039;ll be&lt;br /&gt;
        # running all of our resources in Primary/Primary, only the&lt;br /&gt;
        # &#039;after-sb-2pri&#039; really means anything to us.&lt;br /&gt;
        net {&lt;br /&gt;
                # Tell DRBD to allow dual-primary.&lt;br /&gt;
                allow-two-primaries;&lt;br /&gt;
&lt;br /&gt;
                # Set the recover policy for split-brain recover when no device&lt;br /&gt;
                # in the resource was primary.&lt;br /&gt;
                after-sb-0pri   discard-zero-changes;&lt;br /&gt;
&lt;br /&gt;
                # Now if one device was primary.&lt;br /&gt;
                after-sb-1pri   discard-secondary;&lt;br /&gt;
&lt;br /&gt;
                # Finally, set the policy when both nodes were Primary. The&lt;br /&gt;
                # only viable option is &#039;disconnect&#039;, which tells DRBD to&lt;br /&gt;
                # simply tear-down the DRBD resource right away and wait for&lt;br /&gt;
                # the administrator to manually invalidate one side of the&lt;br /&gt;
                # resource.&lt;br /&gt;
                after-sb-2pri   disconnect;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        # This tells DRBD what to do when the resource starts.&lt;br /&gt;
        startup {&lt;br /&gt;
                # In our case, we&#039;re telling DRBD to promote both devices in&lt;br /&gt;
                # our resource to Primary on start.&lt;br /&gt;
                become-primary-on       both;&lt;br /&gt;
        }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Let&#039;s stop for a moment and talk about DRBD synchronization. &lt;br /&gt;
&lt;br /&gt;
A DRBD resource does &#039;&#039;&#039;not&#039;&#039;&#039; have to be synced before it can be made &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Primary/Primary&amp;lt;/span&amp;gt;. For this reason, the default sync rate for DRBD is very, very low (320 [[KiB]]/sec). This means that you can normally start your DRBD in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Primary/Primary&amp;lt;/span&amp;gt; on both nodes and get to work while the synchronization putters along in the background.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;However&#039;&#039;!&lt;br /&gt;
&lt;br /&gt;
If the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;UpToDate&amp;lt;/span&amp;gt; node goes down, the surviving &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Inconsistent&amp;lt;/span&amp;gt; node will demote to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Secondary&amp;lt;/span&amp;gt;, thus becoming unusable. In a high-availability environment like ours, this is pretty useless. So for this reason we will want to get the resources in sync as fast as possible. Likewise, while a node is sync&#039;ing, we will not be able to run the VMs on the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Inconsistent&amp;lt;/span&amp;gt; node.&lt;br /&gt;
&lt;br /&gt;
The temptation then is to set &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rate&amp;lt;/span&amp;gt; above to the maximum write speed of our disks. &#039;&#039;This is a bad idea&#039;&#039;!&lt;br /&gt;
&lt;br /&gt;
We will have four separate resources sharing the same underlying disks. If you drive the sync rate very high, and I/O on the other &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;UpToDate&amp;lt;/span&amp;gt; resources will be severely impacted. So much so that I&#039;ve seen crashes caused by this. So you will want to keep this value at a sane level. That is, you will want to set the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rate&amp;lt;/span&amp;gt; to as high as you can while still leaving the disks themselves sufficiently unbound that other I/O is still feasible. I&#039;ve personally found &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;15M&amp;lt;/span&amp;gt; on single-drive and simple RAID machines to be a good value. Feel free to experiment for yourself.&lt;br /&gt;
&lt;br /&gt;
==== Setting up the Resource Directives ====&lt;br /&gt;
&lt;br /&gt;
We now define the resources themselves. Each resource will be contained in a directive called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;resource x&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 actual resource name (&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;r0&amp;lt;/span&amp;gt;, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;r1&amp;lt;/span&amp;gt;, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;r2&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;r3&amp;lt;/span&amp;gt; in our case). Within this directive, all resource-specific options are set.&lt;br /&gt;
&lt;br /&gt;
The example below is well documented, so please take a moment to look at the example for &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;
# The &#039;resource&#039; directive defines a given resource and must be followed by the&lt;br /&gt;
# resource&#039;s name.&lt;br /&gt;
# This will be used as the GFS2 partition for shared files.&lt;br /&gt;
resource r0 {&lt;br /&gt;
        # This is the /dev/ device to create to make available this DRBD&lt;br /&gt;
        # resource.&lt;br /&gt;
        device          /dev/drbd0;&lt;br /&gt;
&lt;br /&gt;
        # This tells DRBD where to store it&#039;s internal state information. We&lt;br /&gt;
        # will use &#039;internal&#039;, which tells DRBD to store the information at the&lt;br /&gt;
        # end of the resource&#039;s space.&lt;br /&gt;
        meta-disk       internal;&lt;br /&gt;
&lt;br /&gt;
        # The next two &#039;on&#039; directives setup each individual node&#039;s settings.&lt;br /&gt;
        # The value after the &#039;on&#039; directive *MUST* match the output of&lt;br /&gt;
        # `uname -n` on each node.&lt;br /&gt;
        on an-node04.alteeve.com {&lt;br /&gt;
                # This is the network IP address on the network interface and&lt;br /&gt;
                # the TCP port to use for communication between the nodes. Note&lt;br /&gt;
                # that the IP address below in on our Storage Network. The TCP&lt;br /&gt;
                # port must be unique per resource, but the interface itself&lt;br /&gt;
                # can be shared. &lt;br /&gt;
                # IPv6 is usable with &#039;address ipv6 [address]:port&#039;.&lt;br /&gt;
                address         192.168.2.74:7789;&lt;br /&gt;
&lt;br /&gt;
                # This is the node&#039;s storage device that will back this&lt;br /&gt;
                # resource.&lt;br /&gt;
                disk            /dev/sda5;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        # Same as above, but altered to reflect the second node.&lt;br /&gt;
        on an-node05.alteeve.com {&lt;br /&gt;
                address         192.168.2.75:7789;&lt;br /&gt;
                disk            /dev/sda5;&lt;br /&gt;
        }&lt;br /&gt;
}&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;r1&amp;lt;/span&amp;gt;, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;r2&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;r3&amp;lt;/span&amp;gt; resources should be nearly identical to the example above. The main difference will the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;device&amp;lt;/span&amp;gt; value and within each node&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;on x { }&amp;lt;/span&amp;gt; directive. We will incrementing the [[TCP]] ports to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;7790&amp;lt;/span&amp;gt;, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;7791&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;7792&amp;lt;/span&amp;gt; respectively. Likewise, we will need to alter the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;disk&amp;lt;/span&amp;gt; to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/sda6&amp;lt;/span&amp;gt;, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/sda7&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/sda8&amp;lt;/span&amp;gt; respectively. Finally, the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;device&amp;lt;/span&amp;gt; will be incremented to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/drbd1&amp;lt;/span&amp;gt;, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/drbd2&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/drbd3&amp;lt;/span&amp;gt; respectively.&lt;br /&gt;
&lt;br /&gt;
=== Housekeeping Before Starting Our DRBD Resources ===&lt;br /&gt;
&lt;br /&gt;
Let&#039;s take a look at the complete &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/drbd.conf&amp;lt;/span&amp;gt; file, validate it for use and then push it to the second node.&lt;br /&gt;
&lt;br /&gt;
==== The Finished /etc/drbd.conf File ====&lt;br /&gt;
&lt;br /&gt;
The finished &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/drbd.conf&amp;lt;/span&amp;gt; file should look for or less like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
#&lt;br /&gt;
# please have a a look at the example configuration file in&lt;br /&gt;
# /usr/share/doc/drbd83/drbd.conf&lt;br /&gt;
#&lt;br /&gt;
&lt;br /&gt;
# The &#039;global&#039; directive covers values that apply to RBD in general.&lt;br /&gt;
global {&lt;br /&gt;
	# This tells Linbit that it&#039;s okay to count us as a DRBD user. If you&lt;br /&gt;
	# have privacy concerns, set this to &#039;no&#039;.&lt;br /&gt;
	usage-count	yes;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
# The &#039;common&#039; directive sets defaults values for all resources.&lt;br /&gt;
common {&lt;br /&gt;
	# Protocol &#039;C&#039; tells DRBD to not report a disk write as complete until&lt;br /&gt;
	# it has been confirmed written to both nodes. This is required for&lt;br /&gt;
	# Primary/Primary use.&lt;br /&gt;
        protocol	C;&lt;br /&gt;
&lt;br /&gt;
	# This sets the default sync rate to 15 MiB/sec. Be careful about&lt;br /&gt;
	# setting this too high! High speed sync&#039;ing can flog your drives and&lt;br /&gt;
	# push disk I/O times very high.&lt;br /&gt;
        syncer {&lt;br /&gt;
                rate	15M;&lt;br /&gt;
        }&lt;br /&gt;
	&lt;br /&gt;
	# This tells DRBD what policy to use when a fence is required.&lt;br /&gt;
        disk {&lt;br /&gt;
		# This tells DRBD to block I/O (resource) and then try to fence&lt;br /&gt;
		# the other node (stonith). The &#039;stonith&#039; option requires that&lt;br /&gt;
		# we set a fence handler below. The name &#039;stonith&#039; comes from&lt;br /&gt;
		# &amp;quot;Shoot The Other Nide In The Head&amp;quot; and is a term used in&lt;br /&gt;
		# other clustering environments. It is synonomous with with&lt;br /&gt;
		# &#039;fence&#039;.&lt;br /&gt;
                fencing		resource-and-stonith;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
	# We set &#039;stonith&#039; above, so here we tell DRBD how to actually fence&lt;br /&gt;
	# the other node.&lt;br /&gt;
        handlers {&lt;br /&gt;
		# The term &#039;outdate-peer&#039; comes from other scripts that flag&lt;br /&gt;
		# the other node&#039;s resource backing device as &#039;Inconsistent&#039;.&lt;br /&gt;
		# In our case though, we&#039;re flat-out fencing the other node,&lt;br /&gt;
		# which has the same effective result.&lt;br /&gt;
                outdate-peer	&amp;quot;/sbin/obliterate-peer.sh&amp;quot;;&lt;br /&gt;
        }&lt;br /&gt;
	&lt;br /&gt;
	# Here we tell DRBD that we want to use Primary/Primary mode. It is&lt;br /&gt;
	# also where we define split-brain (sb) recovery policies. As we&#039;ll be&lt;br /&gt;
	# running all of our resources in Primary/Primary, only the&lt;br /&gt;
	# &#039;after-sb-2pri&#039; really means anything to us.&lt;br /&gt;
        net {&lt;br /&gt;
		# Tell DRBD to allow dual-primary.&lt;br /&gt;
                allow-two-primaries;&lt;br /&gt;
&lt;br /&gt;
		# Set the recover policy for split-brain recover when no device&lt;br /&gt;
		# in the resource was primary.&lt;br /&gt;
                after-sb-0pri	discard-zero-changes;&lt;br /&gt;
&lt;br /&gt;
		# Now if one device was primary.&lt;br /&gt;
                after-sb-1pri	discard-secondary;&lt;br /&gt;
&lt;br /&gt;
		# Finally, set the policy when both nodes were Primary. The&lt;br /&gt;
		# only viable option is &#039;disconnect&#039;, which tells DRBD to&lt;br /&gt;
		# simply tear-down the DRBD resource right away and wait for&lt;br /&gt;
		# the administrator to manually invalidate one side of the&lt;br /&gt;
		# resource.&lt;br /&gt;
                after-sb-2pri	disconnect;&lt;br /&gt;
        }&lt;br /&gt;
	&lt;br /&gt;
	# This tells DRBD what to do when the resource starts.&lt;br /&gt;
        startup {&lt;br /&gt;
		# In our case, we&#039;re telling DRBD to promote both devices in&lt;br /&gt;
		# our resource to Primary on start.&lt;br /&gt;
                become-primary-on 	both;&lt;br /&gt;
        }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
# The &#039;resource&#039; directive defines a given resource and must be followed by the&lt;br /&gt;
# resource&#039;s name.&lt;br /&gt;
# This will be used as the GFS2 partition for shared files.&lt;br /&gt;
resource r0 {&lt;br /&gt;
	# This is the /dev/ device to create to make available this DRBD&lt;br /&gt;
	# resource.&lt;br /&gt;
        device 		/dev/drbd0;&lt;br /&gt;
	&lt;br /&gt;
	# This tells DRBD where to store it&#039;s internal state information. We&lt;br /&gt;
	# will use &#039;internal&#039;, which tells DRBD to store the information at the&lt;br /&gt;
	# end of the resource&#039;s space.&lt;br /&gt;
        meta-disk 	internal;&lt;br /&gt;
	&lt;br /&gt;
	# The next two &#039;on&#039; directives setup each individual node&#039;s settings.&lt;br /&gt;
	# The value after the &#039;on&#039; directive *MUST* match the output of&lt;br /&gt;
	# `uname -n` on each node.&lt;br /&gt;
        on an-node04.alteeve.com {&lt;br /&gt;
		# This is the network IP address on the network interface and&lt;br /&gt;
		# the TCP port to use for communication between the nodes. Note&lt;br /&gt;
		# that the IP address below in on our Storage Network. The TCP&lt;br /&gt;
		# port must be unique per resource, but the interface itself&lt;br /&gt;
		# can be shared. &lt;br /&gt;
		# IPv6 is usable with &#039;address ipv6 [address]:port&#039;.&lt;br /&gt;
                address 	192.168.2.74:7789;&lt;br /&gt;
		&lt;br /&gt;
		# This is the node&#039;s storage device that will back this&lt;br /&gt;
		# resource.&lt;br /&gt;
                disk    	/dev/sda5;&lt;br /&gt;
        }&lt;br /&gt;
	&lt;br /&gt;
	# Same as above, but altered to reflect the second node.&lt;br /&gt;
        on an-node05.alteeve.com {&lt;br /&gt;
                address 	192.168.2.75:7789;&lt;br /&gt;
                disk    	/dev/sda5;&lt;br /&gt;
        }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
# This will be used to host VMs running primarily on an-node04.&lt;br /&gt;
resource r1 {&lt;br /&gt;
        device          /dev/drbd1;&lt;br /&gt;
&lt;br /&gt;
        meta-disk       internal;&lt;br /&gt;
&lt;br /&gt;
        on an-node04.alteeve.com {&lt;br /&gt;
                address         192.168.2.74:7790;&lt;br /&gt;
                disk            /dev/sda6;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        on an-node05.alteeve.com {&lt;br /&gt;
                address         192.168.2.75:7790;&lt;br /&gt;
                disk            /dev/sda6;&lt;br /&gt;
        }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
# This will be used to host VMs running primarily on an-node05.&lt;br /&gt;
resource r2 {&lt;br /&gt;
        device          /dev/drbd2;&lt;br /&gt;
&lt;br /&gt;
        meta-disk       internal;&lt;br /&gt;
&lt;br /&gt;
        on an-node04.alteeve.com {&lt;br /&gt;
                address         192.168.2.74:7791;&lt;br /&gt;
                disk            /dev/sda7;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        on an-node05.alteeve.com {&lt;br /&gt;
                address         192.168.2.75:7791;&lt;br /&gt;
                disk            /dev/sda7;&lt;br /&gt;
        }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
# This will be set aside as free space for future expansion.&lt;br /&gt;
resource r3 {&lt;br /&gt;
        device          /dev/drbd3;&lt;br /&gt;
&lt;br /&gt;
        meta-disk       internal;&lt;br /&gt;
&lt;br /&gt;
        on an-node04.alteeve.com {&lt;br /&gt;
                address         192.168.2.74:7792;&lt;br /&gt;
                disk            /dev/sda8;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        on an-node05.alteeve.com {&lt;br /&gt;
                address         192.168.2.75:7792;&lt;br /&gt;
                disk            /dev/sda8;&lt;br /&gt;
        }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Validating the /etc/drbd.conf Syntax ====&lt;br /&gt;
&lt;br /&gt;
To check for errors, we will validate the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/drbd.conf&amp;lt;/span&amp;gt; file. To do this, run &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;drbdadm dump&amp;lt;/span&amp;gt;. If there are syntactical errors, fix them before proceeding. Once the file is correct, it will be dump it&#039;s view of the configuration to the screen with minimal commenting. Don&#039;t worry about slight differences (ie: &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;meta-disk external;&amp;lt;/span&amp;gt; being inside the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;on { }&amp;lt;/span&amp;gt; directives).&lt;br /&gt;
&lt;br /&gt;
The first time you ever do this, you will also see a note telling you that you are the &#039;&#039;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;n&amp;lt;/span&amp;gt;&#039;&#039;th DRBD user.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
drbdadm dump&lt;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 9369th user to install this version&lt;br /&gt;
# /etc/drbd.conf&lt;br /&gt;
common {&lt;br /&gt;
    protocol               C;&lt;br /&gt;
    net {&lt;br /&gt;
        allow-two-primaries;&lt;br /&gt;
        after-sb-0pri    discard-zero-changes;&lt;br /&gt;
        after-sb-1pri    discard-secondary;&lt;br /&gt;
        after-sb-2pri    disconnect;&lt;br /&gt;
    }&lt;br /&gt;
    disk {&lt;br /&gt;
        fencing          resource-and-stonith;&lt;br /&gt;
    }&lt;br /&gt;
    syncer {&lt;br /&gt;
        rate             15M;&lt;br /&gt;
    }&lt;br /&gt;
    startup {&lt;br /&gt;
        become-primary-on both;&lt;br /&gt;
    }&lt;br /&gt;
    handlers {&lt;br /&gt;
        fence-peer       /sbin/obliterate-peer.sh;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
# resource r0 on an-node04.alteeve.com: not ignored, not stacked&lt;br /&gt;
resource r0 {&lt;br /&gt;
    on an-node04.alteeve.com {&lt;br /&gt;
        device           /dev/drbd0 minor 0;&lt;br /&gt;
        disk             /dev/sda5;&lt;br /&gt;
        address          ipv4 192.168.2.74:7789;&lt;br /&gt;
        meta-disk        internal;&lt;br /&gt;
    }&lt;br /&gt;
    on an-node05.alteeve.com {&lt;br /&gt;
        device           /dev/drbd0 minor 0;&lt;br /&gt;
        disk             /dev/sda5;&lt;br /&gt;
        address          ipv4 192.168.2.75:7789;&lt;br /&gt;
        meta-disk        internal;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
# resource r1 on an-node04.alteeve.com: not ignored, not stacked&lt;br /&gt;
resource r1 {&lt;br /&gt;
    on an-node04.alteeve.com {&lt;br /&gt;
        device           /dev/drbd1 minor 1;&lt;br /&gt;
        disk             /dev/sda6;&lt;br /&gt;
        address          ipv4 192.168.2.74:7790;&lt;br /&gt;
        meta-disk        internal;&lt;br /&gt;
    }&lt;br /&gt;
    on an-node05.alteeve.com {&lt;br /&gt;
        device           /dev/drbd1 minor 1;&lt;br /&gt;
        disk             /dev/sda6;&lt;br /&gt;
        address          ipv4 192.168.2.75:7790;&lt;br /&gt;
        meta-disk        internal;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
# resource r2 on an-node04.alteeve.com: not ignored, not stacked&lt;br /&gt;
resource r2 {&lt;br /&gt;
    on an-node04.alteeve.com {&lt;br /&gt;
        device           /dev/drbd2 minor 2;&lt;br /&gt;
        disk             /dev/sda7;&lt;br /&gt;
        address          ipv4 192.168.2.74:7791;&lt;br /&gt;
        meta-disk        internal;&lt;br /&gt;
    }&lt;br /&gt;
    on an-node05.alteeve.com {&lt;br /&gt;
        device           /dev/drbd2 minor 2;&lt;br /&gt;
        disk             /dev/sda7;&lt;br /&gt;
        address          ipv4 192.168.2.75:7791;&lt;br /&gt;
        meta-disk        internal;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
# resource r3 on an-node04.alteeve.com: not ignored, not stacked&lt;br /&gt;
resource r3 {&lt;br /&gt;
    on an-node04.alteeve.com {&lt;br /&gt;
        device           /dev/drbd3 minor 3;&lt;br /&gt;
        disk             /dev/sda8;&lt;br /&gt;
        address          ipv4 192.168.2.74:7792;&lt;br /&gt;
        meta-disk        internal;&lt;br /&gt;
    }&lt;br /&gt;
    on an-node05.alteeve.com {&lt;br /&gt;
        device           /dev/drbd3 minor 3;&lt;br /&gt;
        disk             /dev/sda8;&lt;br /&gt;
        address          ipv4 192.168.2.75:7792;&lt;br /&gt;
        meta-disk        internal;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Copying The /etc/drbd.conf to the Second Node ====&lt;br /&gt;
&lt;br /&gt;
Assuming you write the first &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/drbd.conf&amp;lt;/span&amp;gt; file on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt;. So now we need to copy it to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt; before we can start things up.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
rsync -av /etc/drbd.conf root@an-node05:/etc/&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
building file list ... done&lt;br /&gt;
drbd.conf&lt;br /&gt;
&lt;br /&gt;
sent 5577 bytes  received 48 bytes  3750.00 bytes/sec&lt;br /&gt;
total size is 5479  speedup is 0.97&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Loading the DRBD Module ===&lt;br /&gt;
&lt;br /&gt;
By default, the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/init.d/drbd&amp;lt;/span&amp;gt; initialization script handles loading and unloading the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;drbd&amp;lt;/span&amp;gt; module. It&#039;s too early for us to start the DRBD resources using the initialization script, so we need to manually load the module ourselves. This will only need to be done once. After you get the DRBD resources up for the first time, you can safely use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/init.d/drbd&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
To load the module, run:&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;
You can verify that the module is loaded using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;lsmod&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;
lsmod |grep 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;
drbd                  277144  0 &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The module also creates a &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/proc&amp;lt;/span&amp;gt; file called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;drbd&amp;lt;/span&amp;gt;. By &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cat&amp;lt;/span&amp;gt;&#039;ing this, we can watch the progress of our work. I&#039;d recommend opening a terminal windows for each node and tracking it using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;watch&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;
watch cat /proc/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;
Every 2.0s: cat /proc/drbd                                                                     Tue Mar 29 13:03:44 2011&lt;br /&gt;
&lt;br /&gt;
version: 8.3.8 (api:88/proto:86-94)&lt;br /&gt;
GIT-hash: d78846e52224fd00562f7c225bcc25b2d422321d build by mockbuild@builder10.centos.org, 2010-06-04 08:04:27&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the steps ahead, I will show what the output from &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;watch&amp;lt;/span&amp;gt;&#039;ing &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/proc/drbd&amp;lt;/span&amp;gt; will be.&lt;br /&gt;
&lt;br /&gt;
=== Initializing Our Resources ===&lt;br /&gt;
&lt;br /&gt;
Before we can start each resource, we must first initialize each of the backing device. This is done by running &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;drbdadm create-md x&amp;lt;/span&amp;gt;. We&#039;ll run this on both nodes, replacing &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;x&amp;lt;/span&amp;gt; with the four resource names.&lt;br /&gt;
&lt;br /&gt;
The first time you do this, the command will execute right away.&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;
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;
If you&#039;ve ever used the partition in a DRBD device before though, you will need to confirm that you want to over-write the existing meta-data.&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;
&lt;br /&gt;
Type &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;yes&amp;lt;/span&amp;gt; when prompted.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
You want me to create a v08 style flexible-size internal meta data block.&lt;br /&gt;
There appears to be a v08 flexible-size internal meta data block&lt;br /&gt;
already in place on /dev/sda5 at byte offset 10010128384&lt;br /&gt;
Do you really want to overwrite the existing v08 meta-data?&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
[need to type &#039;yes&#039; to confirm] yes&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&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;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Repeat for all four resource names, then do the same on the other node.&lt;br /&gt;
&lt;br /&gt;
{{note|1=If you are trying to initialize a resource&#039;s backing device that has been used before, you may need to wipe out the first few blocks.}}&lt;br /&gt;
&lt;br /&gt;
If you try to initialize the resource&#039;s backing device and get an error like below, you will need to &amp;quot;zero out&amp;quot; the first bit of the resource. This is done by using the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;dd&amp;lt;/span&amp;gt; (disk duplication) program, reading in from the special &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/zero&amp;lt;/span&amp;gt; file and writing out a set number of block (usually 4096 [[KiB]]) at the start of the DRBD resource.&lt;br /&gt;
&lt;br /&gt;
If you see the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
pvs stderr:        _undo_flock /var/lock/lvm/V_drbd_sh0_vg0&lt;br /&gt;
pvs stderr:  Skipping volume group drbd_sh0_vg0&lt;br /&gt;
pvs stderr:      Unlocking /var/lock/lvm/P_global&lt;br /&gt;
pvs stderr:        _undo_flock /var/lock/lvm/P_global&lt;br /&gt;
&lt;br /&gt;
md_offset 10010128384&lt;br /&gt;
al_offset 10010095616&lt;br /&gt;
bm_offset 10009788416&lt;br /&gt;
&lt;br /&gt;
Found LVM2 physical volume signature&lt;br /&gt;
     9775184 kB left usable by current configuration&lt;br /&gt;
Could not determine the size of the actually used data area.&lt;br /&gt;
&lt;br /&gt;
Device size would be truncated, which&lt;br /&gt;
would corrupt data and result in&lt;br /&gt;
&#039;access beyond end of device&#039; errors.&lt;br /&gt;
If you want me to do this, you need to zero out the first part&lt;br /&gt;
of the device (destroy the content).&lt;br /&gt;
You should be very sure that you mean it.&lt;br /&gt;
Operation refused.&lt;br /&gt;
&lt;br /&gt;
Command &#039;drbdmeta 0 v08 /dev/sda5 internal create-md&#039; terminated with exit code 40&lt;br /&gt;
drbdadm create-md r0: exited with code 40&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then you will need to zero the start of the backing device.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
dd if=/dev/zero of=/dev/sda5 count=10000&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
10000+0 records in&lt;br /&gt;
10000+0 records out&lt;br /&gt;
5120000 bytes (5.1 MB) copied, 0.101682 seconds, 50.4 MB/s&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You should now be able to initialize the resource.&lt;br /&gt;
&lt;br /&gt;
=== Initial Connections ===&lt;br /&gt;
&lt;br /&gt;
As this is the first time that the DRBD resource will be started, neither side will be in a &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;consistent&amp;lt;/span&amp;gt; state. The effect is that we will not be able to promote either node to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Primary&amp;lt;/span&amp;gt;. So we need to tell DRBD that it must consider one side to be valid and, thus, overwrite the other node&#039;s data.&lt;br /&gt;
&lt;br /&gt;
{{note|1=This is the &#039;&#039;&#039;only&#039;&#039;&#039; time you should ever use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--overwrite-data-of-peer&amp;lt;/span&amp;gt;! Never use it to recover from a split brain.}}&lt;br /&gt;
&lt;br /&gt;
The steps we will now take for each resource are:&lt;br /&gt;
* Attach each node&#039;s backing device to the DRBD resource.&lt;br /&gt;
* Establish the network connection between the two nodes.&lt;br /&gt;
* Force one node&#039;s backing device to be considered &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;UpToDate&amp;lt;/span&amp;gt; and promote it to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Primary&amp;lt;/span&amp;gt;.&lt;br /&gt;
* Promote the second node to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Primary&amp;lt;/span&amp;gt;&lt;br /&gt;
* Bump the synchronization rate to the value specified in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/drbd.conf&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Now lets walk through these steps, taking a look at &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/proc/drbd&amp;lt;/span&amp;gt; after each step.&lt;br /&gt;
&lt;br /&gt;
{{note|1=You can save some typing with a &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;bash&amp;lt;/span&amp;gt; trick. Where you would normally call &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;r0&amp;lt;/span&amp;gt;, then &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;r1&amp;lt;/span&amp;gt;, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;r2&amp;lt;/span&amp;gt; a last &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;r3&amp;lt;/span&amp;gt;, you can call all at once by instead calling &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;command&amp;gt; r{0,1,2,3}&amp;lt;/span&amp;gt;.}}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On Both Nodes&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
Attach the resources local backing devices to their DRBD resources. That is, connect the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/sda{5,6,7,8}&amp;lt;/span&amp;gt; to their corresponding &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;r{0,1,2,3}&amp;lt;/span&amp;gt; resources.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
drbdadm attach r{0,1,2,3}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
version: 8.3.8 (api:88/proto:86-94)&lt;br /&gt;
GIT-hash: d78846e52224fd00562f7c225bcc25b2d422321d build by mockbuild@builder10.centos.org, 2010-06-04 08:04:27&lt;br /&gt;
 0: cs:StandAlone ro:Secondary/Unknown ds:Inconsistent/DUnknown   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:9775184&lt;br /&gt;
 1: cs:StandAlone ro:Secondary/Unknown ds:Inconsistent/DUnknown   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:97664116&lt;br /&gt;
 2: cs:StandAlone ro:Secondary/Unknown ds:Inconsistent/DUnknown   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:97664116&lt;br /&gt;
 3: cs:StandAlone ro:Secondary/Unknown ds:Inconsistent/DUnknown   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:257843340&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On Both Nodes&#039;&#039;&#039;: &lt;br /&gt;
&lt;br /&gt;
Now we&#039;ll connect the corresponding resource backing devices on each node together to create the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/drbdX&amp;lt;/span&amp;gt; devices. Note that while one node is connecting, it&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/proc/drbd&amp;lt;/span&amp;gt; will show the resource as being in the connection state of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;WFConnection&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 connect r{0,1,2,3}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
version: 8.3.8 (api:88/proto:86-94)&lt;br /&gt;
GIT-hash: d78846e52224fd00562f7c225bcc25b2d422321d build by mockbuild@builder10.centos.org, 2010-06-04 08:04:27&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:9775184&lt;br /&gt;
 1: 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:97664116&lt;br /&gt;
 2: 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:97664116&lt;br /&gt;
 3: 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:257843340&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On One Node Only&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
As the resource is totally new, we&#039;ll need to tell DRBD that one node&#039;s backing device is &amp;quot;more&amp;quot; valid than the other. It is entirely arbitrary which node we run this on. I run this on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt; out of habit. This step also promotes the local resource to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Primary&amp;lt;/span&amp;gt;, which means that it is usable by the local system.&lt;br /&gt;
&lt;br /&gt;
{{note|1=An alternative to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--overwrite-data-of-peer&amp;lt;/span&amp;gt; is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;drbdadm -- --clear-bitmap new-current-uuid res&amp;lt;/span&amp;gt; followed by &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;drbdadm primary res&amp;lt;/span&amp;gt;. This will instantly mark both sides of the DRBD resource as &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;UpToDate&amp;lt;/span&amp;gt; without needing to perform the initial sync.}}&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 r{0,1,2,3}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
version: 8.3.8 (api:88/proto:86-94)&lt;br /&gt;
GIT-hash: d78846e52224fd00562f7c225bcc25b2d422321d build by mockbuild@builder10.centos.org, 2010-06-04 08:04:27&lt;br /&gt;
 0: cs:SyncSource ro:Primary/Secondary ds:UpToDate/Inconsistent C r----&lt;br /&gt;
    ns:896 nr:0 dw:0 dr:896 al:0 bm:0 lo:0 pe:0 ua:0 ap:0 ep:1 wo:b oos:9774288&lt;br /&gt;
        [&amp;gt;....................] sync&#039;ed:  0.1% (9544/9544)M delay_probe: 701&lt;br /&gt;
        finish: 4:31:30 speed: 448 (448) K/sec&lt;br /&gt;
 1: cs:SyncSource ro:Primary/Secondary ds:UpToDate/Inconsistent C r----&lt;br /&gt;
    ns:736 nr:0 dw:0 dr:736 al:0 bm:0 lo:0 pe:0 ua:0 ap:0 ep:1 wo:b oos:97663380&lt;br /&gt;
        [&amp;gt;....................] sync&#039;ed:  0.1% (95372/95372)M delay_probe: 620&lt;br /&gt;
        finish: 67:49:18 speed: 368 (368) K/sec&lt;br /&gt;
 2: cs:SyncSource ro:Primary/Secondary ds:UpToDate/Inconsistent C r----&lt;br /&gt;
    ns:672 nr:0 dw:0 dr:672 al:0 bm:0 lo:0 pe:0 ua:0 ap:0 ep:1 wo:b oos:97663444&lt;br /&gt;
        [&amp;gt;....................] sync&#039;ed:  0.1% (95372/95372)M delay_probe: 556&lt;br /&gt;
        finish: 67:49:18 speed: 336 (336) K/sec&lt;br /&gt;
 3: cs:SyncSource ro:Primary/Secondary ds:UpToDate/Inconsistent C r----&lt;br /&gt;
    ns:576 nr:0 dw:0 dr:576 al:0 bm:0 lo:0 pe:0 ua:0 ap:0 ep:1 wo:b oos:257842764&lt;br /&gt;
        [&amp;gt;....................] sync&#039;ed:  0.1% (251796/251800)M delay_probe: 447&lt;br /&gt;
        finish: 89:31:43 speed: 576 (576) K/sec&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On The Other Node&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
The last required step is to promote the other node&#039;s resource to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Primary&amp;lt;/span&amp;gt; as well.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
drbdadm primary r{0,1,2,3}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
version: 8.3.8 (api:88/proto:86-94)&lt;br /&gt;
GIT-hash: d78846e52224fd00562f7c225bcc25b2d422321d build by mockbuild@builder10.centos.org, 2010-06-04 08:04:27&lt;br /&gt;
 0: cs:SyncSource ro:Primary/Primary ds:UpToDate/Inconsistent C r----&lt;br /&gt;
    ns:159008 nr:0 dw:0 dr:159008 al:0 bm:9 lo:0 pe:0 ua:0 ap:0 ep:1 wo:b oos:9616176&lt;br /&gt;
        [&amp;gt;....................] sync&#039;ed:  1.7% (9388/9544)M delay_probe: 130846&lt;br /&gt;
        finish: 6:40:40 speed: 256 (312) K/sec&lt;br /&gt;
 1: cs:SyncSource ro:Primary/Primary ds:UpToDate/Inconsistent C r----&lt;br /&gt;
    ns:161152 nr:0 dw:0 dr:161152 al:0 bm:9 lo:0 pe:0 ua:0 ap:0 ep:1 wo:b oos:97502964&lt;br /&gt;
        [&amp;gt;....................] sync&#039;ed:  0.2% (95216/95372)M delay_probe: 131004&lt;br /&gt;
        finish: 67:42:37 speed: 0 (316) K/sec&lt;br /&gt;
 2: cs:SyncSource ro:Primary/Primary ds:UpToDate/Inconsistent C r----&lt;br /&gt;
    ns:161024 nr:0 dw:0 dr:161024 al:0 bm:9 lo:0 pe:0 ua:0 ap:0 ep:1 wo:b oos:97503092&lt;br /&gt;
        [&amp;gt;....................] sync&#039;ed:  0.2% (95216/95372)M delay_probe: 130852&lt;br /&gt;
        finish: 76:10:27 speed: 348 (316) K/sec&lt;br /&gt;
 3: cs:SyncSource ro:Primary/Primary ds:UpToDate/Inconsistent C r----&lt;br /&gt;
    ns:160832 nr:0 dw:0 dr:160832 al:0 bm:9 lo:0 pe:0 ua:0 ap:0 ep:1 wo:b oos:257682508&lt;br /&gt;
        [&amp;gt;....................] sync&#039;ed:  0.1% (251640/251800)M delay_probe: 130729&lt;br /&gt;
        finish: 178:56:46 speed: 128 (316) K/sec&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{note|1=From here on in, the steps shown are not strictly needed. The first step is highly recommended, as it is needed to set the desired sync rate, but DRBD will work fine as it now is.}}&lt;br /&gt;
&lt;br /&gt;
DRBD is a bit sensitive to performance issues, so we have to handle multiple resources syncing at the same time a little carefully. The temptation to just raise the sync rate on all resources will get us into trouble.&lt;br /&gt;
&lt;br /&gt;
The safest bet to get all of the resources updated is to pause the synchronization on all but one resource, bump the sync rate up to a little under the maximum write speed of the resource, waiting for the resource to sync, resuming sync on the next resource and so on.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On One Node&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
Let&#039;s pause the synchronization on all but 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 pause-sync r{1,2,3}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
version: 8.3.8 (api:88/proto:86-94)&lt;br /&gt;
GIT-hash: d78846e52224fd00562f7c225bcc25b2d422321d build by mockbuild@builder10.centos.org, 2010-06-04 08:04:27&lt;br /&gt;
 0: cs:SyncSource ro:Primary/Primary ds:UpToDate/Inconsistent C r----&lt;br /&gt;
    ns:32288 nr:0 dw:0 dr:32288 al:0 bm:1 lo:0 pe:0 ua:0 ap:0 ep:1 wo:b oos:9742896&lt;br /&gt;
        [&amp;gt;....................] sync&#039;ed:  0.4% (9512/9544)M delay_probe: 26632&lt;br /&gt;
        finish: 6:45:57 speed: 336 (312) K/sec&lt;br /&gt;
 1: cs:PausedSyncS ro:Primary/Primary ds:UpToDate/Inconsistent C r--u-&lt;br /&gt;
    ns:13184 nr:0 dw:0 dr:13184 al:0 bm:0 lo:0 pe:0 ua:0 ap:0 ep:1 wo:b oos:97650932&lt;br /&gt;
 2: cs:PausedSyncS ro:Primary/Primary ds:UpToDate/Inconsistent C r--u-&lt;br /&gt;
    ns:12192 nr:0 dw:0 dr:12192 al:0 bm:0 lo:0 pe:0 ua:0 ap:0 ep:1 wo:b oos:97651924&lt;br /&gt;
 3: cs:PausedSyncS ro:Primary/Primary ds:UpToDate/Inconsistent C r--u-&lt;br /&gt;
    ns:30656 nr:0 dw:0 dr:30656 al:0 bm:1 lo:0 pe:0 ua:0 ap:0 ep:1 wo:b oos:257812684&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I know that on my server, I can get a maximum write speed of roughly 40 [[MiB]]/sec. So I will manually over-ride the defined sync rate of 15 MiB/sec and set it to 35 MiB/sec. This uses a new DRBD command called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;drbdsetup&amp;lt;/span&amp;gt; and takes the DRBD device instead of the resource name.&lt;br /&gt;
&lt;br /&gt;
{{note|1=The transfer speed will not instantly reach maximum. It takes some time for synchronization rate changes to ramp up and down.}}&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;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
version: 8.3.8 (api:88/proto:86-94)&lt;br /&gt;
GIT-hash: d78846e52224fd00562f7c225bcc25b2d422321d build by mockbuild@builder10.centos.org, 2010-06-04 08:04:27&lt;br /&gt;
 0: cs:SyncTarget ro:Primary/Primary ds:Inconsistent/UpToDate C r----&lt;br /&gt;
    ns:0 nr:253216 dw:252128 dr:0 al:0 bm:15 lo:35 pe:78 ua:34 ap:0 ep:1 wo:b oos:9523056&lt;br /&gt;
        [&amp;gt;....................] sync&#039;ed:  2.7% (9296/9544)M queue_delay: 4.3 ms&lt;br /&gt;
        finish: 0:04:39 speed: 34,040 (1,984) want: 35,840 K/sec&lt;br /&gt;
 1: cs:PausedSyncT ro:Primary/Primary ds:Inconsistent/UpToDate C r-p--&lt;br /&gt;
    ns:0 nr:13184 dw:13184 dr:0 al:0 bm:0 lo:0 pe:0 ua:0 ap:0 ep:1 wo:b oos:97650932&lt;br /&gt;
 2: cs:PausedSyncT ro:Primary/Primary ds:Inconsistent/UpToDate C r-p--&lt;br /&gt;
    ns:0 nr:12192 dw:12192 dr:0 al:0 bm:0 lo:0 pe:0 ua:0 ap:0 ep:1 wo:b oos:97651924&lt;br /&gt;
 3: cs:PausedSyncT ro:Primary/Primary ds:Inconsistent/UpToDate C r-p--&lt;br /&gt;
    ns:0 nr:30656 dw:30656 dr:0 al:0 bm:1 lo:0 pe:0 ua:0 ap:0 ep:1 wo:b oos:257812684&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{note|1=The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;want: 35,840 K/sec&amp;lt;/span&amp;gt; will not show up on the node that you increased the sync rate on. Also note that it will occasionally show &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;want: 0 K/sec&amp;lt;/span&amp;gt;. So long as the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;oos:x&amp;lt;/span&amp;gt; (out of sync blocks) value keeps dropping and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;speed&amp;lt;/span&amp;gt; is still reasonable, the sync is fine.}}&lt;br /&gt;
&lt;br /&gt;
After a period of time, you will see the synchronization finish and the resource will then be in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;UpToDate/UpToDate&amp;lt;/span&amp;gt; state. We&#039;ll now tell DRBD to restore the defined sync rate of 15 MiB/sec, resume synchronization of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;r1&amp;lt;/span&amp;gt; and increase the sync rate of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;r1&amp;lt;/span&amp;gt; to 35 MiB/sec.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
drbdadm syncer r0&lt;br /&gt;
drbdadm resume-sync r1&lt;br /&gt;
drbdsetup /dev/drbd1 syncer -r 35M&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
version: 8.3.8 (api:88/proto:86-94)&lt;br /&gt;
GIT-hash: d78846e52224fd00562f7c225bcc25b2d422321d build by mockbuild@builder10.centos.org, 2010-06-04 08:04:27&lt;br /&gt;
 0: cs:Connected ro:Primary/Primary ds:UpToDate/UpToDate C r----&lt;br /&gt;
    ns:0 nr:9775184 dw:9775184 dr:0 al:0 bm:597 lo:0 pe:0 ua:0 ap:0 ep:1 wo:b oos:0&lt;br /&gt;
 1: cs:SyncTarget ro:Primary/Primary ds:Inconsistent/UpToDate C r----&lt;br /&gt;
    ns:0 nr:851872 dw:851872 dr:0 al:0 bm:51 lo:0 pe:0 ua:0 ap:0 ep:1 wo:b oos:96812244&lt;br /&gt;
        [&amp;gt;....................] sync&#039;ed:  0.9% (94540/95372)M queue_delay: 0.0 ms&lt;br /&gt;
        finish: 0:24:54 speed: 64,480 (11,508) want: 35,840 K/sec&lt;br /&gt;
 2: cs:PausedSyncT ro:Primary/Primary ds:Inconsistent/UpToDate C r-p--&lt;br /&gt;
    ns:0 nr:12192 dw:12192 dr:0 al:0 bm:0 lo:0 pe:0 ua:0 ap:0 ep:1 wo:b oos:97651924&lt;br /&gt;
 3: cs:PausedSyncT ro:Primary/Primary ds:Inconsistent/UpToDate C r-p--&lt;br /&gt;
    ns:0 nr:30656 dw:30656 dr:0 al:0 bm:1 lo:0 pe:0 ua:0 ap:0 ep:1 wo:b oos:257812684&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As before, once &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;r1&amp;lt;/span&amp;gt; is finished syncing, we&#039;ll restore the defined sync rate, resume sync on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;r2&amp;lt;/span&amp;gt; and push the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;r2&amp;lt;/span&amp;gt; sync rate up. Finally, we&#039;ll do the same to the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;r3&amp;lt;/span&amp;gt; resource. Once the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;r3&amp;lt;/span&amp;gt; resource is synced, we&#039;ll restore it&#039;s sync rate and we&#039;ll be finished syncing all of the resources.&lt;br /&gt;
&lt;br /&gt;
Once all resources are synchronized, you should see this on both nodes:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
version: 8.3.8 (api:88/proto:86-94)&lt;br /&gt;
GIT-hash: d78846e52224fd00562f7c225bcc25b2d422321d build by mockbuild@builder10.centos.org, 2010-06-04 08:04:27&lt;br /&gt;
 0: cs:Connected ro:Primary/Primary ds:UpToDate/UpToDate C r----&lt;br /&gt;
    ns:9775184 nr:0 dw:0 dr:9775184 al:0 bm:597 lo:0 pe:0 ua:0 ap:0 ep:1 wo:b oos:0&lt;br /&gt;
 1: cs:Connected ro:Primary/Primary ds:UpToDate/UpToDate C r----&lt;br /&gt;
    ns:97664116 nr:0 dw:0 dr:97664116 al:0 bm:5961 lo:0 pe:0 ua:0 ap:0 ep:1 wo:b oos:0&lt;br /&gt;
 2: cs:Connected ro:Primary/Primary ds:UpToDate/UpToDate C r----&lt;br /&gt;
    ns:97664116 nr:0 dw:0 dr:97664116 al:0 bm:5961 lo:0 pe:0 ua:0 ap:0 ep:1 wo:b oos:0&lt;br /&gt;
 3: cs:Connected ro:Primary/Primary ds:UpToDate/UpToDate C r----&lt;br /&gt;
    ns:257843340 nr:0 dw:0 dr:257843340 al:0 bm:15738 lo:0 pe:0 ua:0 ap:0 ep:1 wo:b oos:0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
That&#039;s it, your resource is ready for use! You do not need to wait for the sync to complete before proceeding. However, ensure that the sync is complete before bringing up VMs on the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Inconsistent&amp;lt;/span&amp;gt; side.&lt;br /&gt;
&lt;br /&gt;
{{note|1=For the rest of the tutorial, we will be ignoring &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;r3&amp;lt;/span&amp;gt; as it&#039;s just a bank of spare disk space.}}&lt;br /&gt;
&lt;br /&gt;
==== Overdoing It ====&lt;br /&gt;
&lt;br /&gt;
If you try to sync too many resources at one or if you set the sync rate too high, you may find that one or more of the resources &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;want: 0 K/sec&amp;lt;/span&amp;gt;. This is a sign that the disks are being hit too hard, and you need to back off the sync rate or flat out pause the synchronization of some resources until the other ones have finished.&lt;br /&gt;
&lt;br /&gt;
{{note|1=In some cases, pushing DRBD too hard may cause synchronization to stall entirely. If this happens, you can try to pause, then resume the sync. If that doesn&#039;t fix it, try changing the sync speed down to a lower speed (see the next section), then pause and resume. If it is still stalling, run &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/init.d/drbd stop&amp;lt;/span&amp;gt; on both nodes, then &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/init.d/drbd start&amp;lt;/span&amp;gt;, pause all but one resource and then set the sync speed on the last resource. Start with a low value and work your way up until you find the maximum stable sync speed for your configuration.}}&lt;br /&gt;
&lt;br /&gt;
==== A Note on Synchronization Speeds ====&lt;br /&gt;
&lt;br /&gt;
As discussed earlier while configuring &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/drbd.conf&amp;lt;/span&amp;gt;, we do not want to have the sync rate set too high. However, if you know that your the disk(s) backing your DRBD resource will not be in use for a while, then you can temporarily drive up the sync rate as we saw above. This can also be used in reverse. If you expect periods of high disk I/O, you can use this same command to temporarily throttle synchronization.&lt;br /&gt;
&lt;br /&gt;
The command to raise the sync rate is below. Note that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;drbdsetup /dev/drbdX&amp;lt;/span&amp;gt; is used here.&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 40M&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To restore it back to the rate set in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/drbd.conf&amp;lt;/span&amp;gt;, run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&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 Clustered LVM ==&lt;br /&gt;
&lt;br /&gt;
This step will have us create three [[LVM]] physical volumes, one for each of the allocated DRBD resources, and then creating three separate volume groups. At this stage, the only logical volume we will create will be for the [[GFS2]] partition. The rest of the LVs will be created later when we provision virtual machines.&lt;br /&gt;
&lt;br /&gt;
=== Modifying /etc/lvm/lvm.conf ===&lt;br /&gt;
&lt;br /&gt;
There are four main things we&#039;re going to change in the LVM configuration file.&lt;br /&gt;
* Change the filter to only see &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/drbd*&amp;lt;/span&amp;gt; devices. Otherwise LVM will see signatures on the DRBD resource and the backing &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/sd*&amp;lt;/span&amp;gt; devices which will cause confusion.&lt;br /&gt;
* Change the locking type to clustered locking.&lt;br /&gt;
* Disable clustered locking from falling back to local locking.&lt;br /&gt;
* We&#039;ll be identifying our clustered VGs and LVs using LVM tags. This tag will be defined using the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;volume_list&amp;lt;/span&amp;gt; variable.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/lvm/lvm.conf /etc/lvm/lvm.conf.orig&lt;br /&gt;
vim /etc/lvm/lvm.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The first step is trivial. Simple alter &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;locking_type = 1&amp;lt;/span&amp;gt; to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;locking_type = 3&amp;lt;/span&amp;gt;.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
    # Type of locking to use. Defaults to local file-based locking (1).&lt;br /&gt;
    # Turn locking off by setting to 0 (dangerous: risks metadata corruption&lt;br /&gt;
    # if LVM2 commands get run concurrently).&lt;br /&gt;
    # Type 2 uses the external shared library locking_library.&lt;br /&gt;
    # Type 3 uses built-in clustered locking.&lt;br /&gt;
    # Type 4 uses read-only locking which forbids any operations that might &lt;br /&gt;
    # change metadata.&lt;br /&gt;
    locking_type = 3&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Next, restrict the filtering so that it only sees the DRBD resources. This is done by changing the filter variable from &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;filter = [ &amp;quot;a/.*/&amp;quot; ]&amp;lt;/span&amp;gt; to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;filter = [ &amp;quot;a|/dev/drbd*|&amp;quot;, &amp;quot;r/.*/&amp;quot; ]&amp;lt;/span&amp;gt;. What this does is tell LVM to &#039;&#039;&#039;a&#039;&#039;&#039;ccept devices matching &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/drbd*&amp;lt;/span&amp;gt; and to &#039;&#039;&#039;r&#039;&#039;&#039;eject all other devices.&lt;br /&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|/dev/drbd*|&amp;quot;, &amp;quot;r/.*/&amp;quot; ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now, we&#039;ll disable falling back to local locking. The reasoning being that if the cluster lock manager [[DLM]] is not available, then we don&#039;t want to touch the storage at all. This is done by changing &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fallback_to_local_locking&amp;lt;/span&amp;gt; from &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt; to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;0&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;
    # If an attempt to initialise type 2 or type 3 locking failed, perhaps&lt;br /&gt;
    # because cluster components such as clvmd are not running, with this set&lt;br /&gt;
    # to 1 an attempt will be made to use local file-based locking (type 1).&lt;br /&gt;
    # If this succeeds, only commands against local volume groups will proceed.&lt;br /&gt;
    # Volume Groups marked as clustered will be ignored.&lt;br /&gt;
    fallback_to_local_locking = 0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Finally, tell LVM to use volumes with our tags by setting &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;volume_list&amp;lt;/span&amp;gt; to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[&amp;quot;@an-cluster01&amp;quot;]&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;
    # If volume_list is defined, each LV is only activated if there is a&lt;br /&gt;
    # match against the list.&lt;br /&gt;
    #   &amp;quot;vgname&amp;quot; and &amp;quot;vgname/lvname&amp;quot; are matched exactly.&lt;br /&gt;
    #   &amp;quot;@tag&amp;quot; matches any tag set in the LV or VG.&lt;br /&gt;
    #   &amp;quot;@*&amp;quot; matches if any tag defined on the host is also set in the LV or VG&lt;br /&gt;
    #&lt;br /&gt;
    # volume_list = [ &amp;quot;vg1&amp;quot;, &amp;quot;vg2/lvol1&amp;quot;, &amp;quot;@tag1&amp;quot;, &amp;quot;@*&amp;quot; ]&lt;br /&gt;
    volume_list = [&amp;quot;@an-cluster01&amp;quot;]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Save the file. With these chages, the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;diff&amp;lt;/span&amp;gt; should look like what is shown below.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
diff -u /etc/lvm/lvm.conf.orig /etc/lvm/lvm.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;diff&amp;quot;&amp;gt;&lt;br /&gt;
--- /etc/lvm/lvm.conf.orig	2011-05-06 15:30:43.000000000 -0400&lt;br /&gt;
+++ /etc/lvm/lvm.conf	2011-05-06 15:34:49.000000000 -0400&lt;br /&gt;
@@ -50,7 +50,8 @@&lt;br /&gt;
 &lt;br /&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/.*/&amp;quot; ]&lt;br /&gt;
+    filter = [ &amp;quot;a|/dev/drbd*|&amp;quot;, &amp;quot;r/.*/&amp;quot; ]&lt;br /&gt;
 &lt;br /&gt;
     # Exclude the cdrom drive&lt;br /&gt;
     # filter = [ &amp;quot;r|/dev/cdrom|&amp;quot; ]&lt;br /&gt;
@@ -289,7 +290,8 @@&lt;br /&gt;
     # Type 3 uses built-in clustered locking.&lt;br /&gt;
     # Type 4 uses read-only locking which forbids any operations that might &lt;br /&gt;
     # change metadata.&lt;br /&gt;
-    locking_type = 1&lt;br /&gt;
+    #locking_type = 1&lt;br /&gt;
+    locking_type = 3&lt;br /&gt;
 &lt;br /&gt;
     # Set to 0 to fail when a lock request cannot be satisfied immediately.&lt;br /&gt;
     wait_for_locks = 1&lt;br /&gt;
@@ -305,7 +307,8 @@&lt;br /&gt;
     # to 1 an attempt will be made to use local file-based locking (type 1).&lt;br /&gt;
     # If this succeeds, only commands against local volume groups will proceed.&lt;br /&gt;
     # Volume Groups marked as clustered will be ignored.&lt;br /&gt;
-    fallback_to_local_locking = 1&lt;br /&gt;
+    #fallback_to_local_locking = 1&lt;br /&gt;
+    fallback_to_local_locking = 0&lt;br /&gt;
 &lt;br /&gt;
     # Local non-LV directory that holds file-based locks while commands are&lt;br /&gt;
     # in progress.  A directory like /tmp that may get wiped on reboot is OK.&lt;br /&gt;
@@ -378,6 +381,7 @@&lt;br /&gt;
     #   &amp;quot;@*&amp;quot; matches if any tag defined on the host is also set in the LV or VG&lt;br /&gt;
     #&lt;br /&gt;
     # volume_list = [ &amp;quot;vg1&amp;quot;, &amp;quot;vg2/lvol1&amp;quot;, &amp;quot;@tag1&amp;quot;, &amp;quot;@*&amp;quot; ]&lt;br /&gt;
+    volume_list = [&amp;quot;@an-cluster01&amp;quot;]&lt;br /&gt;
 &lt;br /&gt;
     # Size (in KB) of each copy operation when mirroring&lt;br /&gt;
     mirror_region_size = 512&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now copy the changed file to the second node.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
rsync -av /etc/lvm/lvm.conf root@an-node05:/etc/lvm/&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
building file list ... done&lt;br /&gt;
lvm.conf&lt;br /&gt;
&lt;br /&gt;
sent 3153 bytes  received 234 bytes  6774.00 bytes/sec&lt;br /&gt;
total size is 22459  speedup is 6.63&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You&#039;re done. Normally we&#039;d want to tell LVM to rescan for PVs, VGs and LVs but at this stage there are none.&lt;br /&gt;
&lt;br /&gt;
=== Starting the clvmd Daemon ===&lt;br /&gt;
&lt;br /&gt;
Before we proceed, we need to start the clustered LVM daemon, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clvmd&amp;lt;/span&amp;gt;. This requires that the cluster is already running. So if you stopped the cluster, start it on both nodes before starting &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clvmd&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;
cman_tool 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;
Version: 6.2.0&lt;br /&gt;
Config Version: 9&lt;br /&gt;
Cluster Name: an-cluster01&lt;br /&gt;
Cluster Id: 60257&lt;br /&gt;
Cluster Member: Yes&lt;br /&gt;
Cluster Generation: 120&lt;br /&gt;
Membership state: Cluster-Member&lt;br /&gt;
Nodes: 2&lt;br /&gt;
Expected votes: 1&lt;br /&gt;
Total votes: 2&lt;br /&gt;
Quorum: 1  &lt;br /&gt;
Active subsystems: 7&lt;br /&gt;
Flags: 2node Dirty &lt;br /&gt;
Ports Bound: 0  &lt;br /&gt;
Node name: an-node04.alteeve.com&lt;br /&gt;
Node ID: 1&lt;br /&gt;
Multicast addresses: 239.192.235.77 &lt;br /&gt;
Node addresses: 192.168.3.74 &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{note|1=The version incremented after the last example when I edited the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cluster.conf&amp;lt;/span&amp;gt; to have my real passwords.}}&lt;br /&gt;
&lt;br /&gt;
So now we see that the cluster is up on both nodes (&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Nodes: 2&amp;lt;/span&amp;gt;), so we can start the clustered LVM daemon.&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;
Starting clvmd: &lt;br /&gt;
Activating VG(s):   No volume groups found&lt;br /&gt;
                                                           [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{note|1=At this stage, the cluster does not start at boot, so we can&#039;t start &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clvmd&amp;lt;/span&amp;gt; at boot yet, either. We&#039;ll do this at the end of the tutorial, so for now, disable &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clvmd&amp;lt;/span&amp;gt; and start it manually after starting &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt; when you first start your cluster.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
chkconfig clvmd off&lt;br /&gt;
chkconfig --list 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;
clvmd          	0:off	1:off	2:off	3:off	4:off	5:off	6:off&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Turning Our DRBD Resources Into LVM Physical Volumes ===&lt;br /&gt;
&lt;br /&gt;
{{note|1=Now that DRBD is in use, commands will only need to be executed on one node and the changes should be immediately seen on the second node.}}&lt;br /&gt;
&lt;br /&gt;
Creating LVM physical volumes is a trivial task. Simply run &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;pvcreate /dev/drbdX&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On One Node&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
pvcreate /dev/drbd{0,1,2}&lt;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;
  Physical volume &amp;quot;/dev/drbd1&amp;quot; successfully created&lt;br /&gt;
  Physical volume &amp;quot;/dev/drbd2&amp;quot; successfully created&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On The Other Node&#039;&#039;&#039;:&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;9.32 GB&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               9.32 GB&lt;br /&gt;
  Allocatable           NO&lt;br /&gt;
  PE Size (KByte)       0&lt;br /&gt;
  Total PE              0&lt;br /&gt;
  Free PE               0&lt;br /&gt;
  Allocated PE          0&lt;br /&gt;
  PV UUID               WxTCW4-lUzL-bR53-km45-13eV-3f8B-ZA5Tb9&lt;br /&gt;
   &lt;br /&gt;
  &amp;quot;/dev/drbd1&amp;quot; is a new physical volume of &amp;quot;93.14 GB&amp;quot;&lt;br /&gt;
  --- NEW Physical volume ---&lt;br /&gt;
  PV Name               /dev/drbd1&lt;br /&gt;
  VG Name               &lt;br /&gt;
  PV Size               93.14 GB&lt;br /&gt;
  Allocatable           NO&lt;br /&gt;
  PE Size (KByte)       0&lt;br /&gt;
  Total PE              0&lt;br /&gt;
  Free PE               0&lt;br /&gt;
  Allocated PE          0&lt;br /&gt;
  PV UUID               zrwlxT-VFA4-5NiK-fwbK-z2Ez-mYxu-Ei8yZs&lt;br /&gt;
   &lt;br /&gt;
  &amp;quot;/dev/drbd2&amp;quot; is a new physical volume of &amp;quot;93.14 GB&amp;quot;&lt;br /&gt;
  --- NEW Physical volume ---&lt;br /&gt;
  PV Name               /dev/drbd2&lt;br /&gt;
  VG Name               &lt;br /&gt;
  PV Size               93.14 GB&lt;br /&gt;
  Allocatable           NO&lt;br /&gt;
  PE Size (KByte)       0&lt;br /&gt;
  Total PE              0&lt;br /&gt;
  Free PE               0&lt;br /&gt;
  Allocated PE          0&lt;br /&gt;
  PV UUID               6d4e5P-pjHE-4axT-ZRyG-lJa7-8oLa-TjkZFy&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Before proceeding, be sure to have LVM rescan for the new [[PV]]s so that it&#039;s cache is up to date. This isn&#039;t strictly needed, but I find it a useful habit to get into.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On both nodes&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
pvscan&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
  PV /dev/drbd0                      lvm2 [9.32 GB]&lt;br /&gt;
  PV /dev/drbd1                      lvm2 [93.14 GB]&lt;br /&gt;
  PV /dev/drbd2                      lvm2 [93.14 GB]&lt;br /&gt;
  Total: 3 [195.60 GB] / in use: 0 [0   ] / in no VG: 3 [195.60 GB]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{note|1=There is nothing showing in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;VG Name&amp;lt;/span&amp;gt; yet, as we&#039;ve not created any [[VG]]s. Re-run &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;pvdisplay&amp;lt;/span&amp;gt; after the VGs are created and you will see them show up. Be aware that a [[PV]] can only belong to one [[VG]] at a time.}}&lt;br /&gt;
&lt;br /&gt;
=== Creating Volume Groups ===&lt;br /&gt;
&lt;br /&gt;
LVM allows for a given VG to have multiple PVs assigned to it. In our case though, each PV has a specific purpose so we will be creating three independent VGs.&lt;br /&gt;
&lt;br /&gt;
Creating VGs is somewhat less trivial compared to creating the PVs. There are a few extra bits that need to be specified when the volume groups are created. The extra bits are:&lt;br /&gt;
* We will explicitly tell LVM that these are clustered VGs via &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;-c y&amp;lt;/span&amp;gt; (&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--clustered yes&amp;lt;/span&amp;gt;).&lt;br /&gt;
* We will create a tag that we will use to identify all clustered VGs. The tag I use is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-cluster01&amp;lt;/span&amp;gt;, thought you are free to use something else. This is applied via &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--addtag @an-cluster01&amp;lt;/span&amp;gt;&lt;br /&gt;
* Each VG needs a unique name which will become part of the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/vg_name/lv_name&amp;lt;/span&amp;gt; path. The name you choose should make sense to you. The names used in this tutorial are shown in the table below.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!VG name&lt;br /&gt;
!PV used&lt;br /&gt;
!Note&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;drbd_sh0_vg0&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/drbd0&amp;lt;/span&amp;gt;&lt;br /&gt;
|This will be used for the shared VG hosting the lone logical volume which we will create the [[GFS2]] partition on.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;drbd_an4_vg0&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/drbd1&amp;lt;/span&amp;gt;&lt;br /&gt;
|This VG will host the LVs backing the virtual machines designed to normally operate on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt;.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;drbd_an5_vg0&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/drbd2&amp;lt;/span&amp;gt;&lt;br /&gt;
|This VG will host the LVs backing the virtual machines designed to normally operate on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
So then, the commands to create these VGs will be as follows.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On One Node&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vgcreate -c y --addtag @an-cluster01 drbd_sh0_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;drbd_sh0_vg0&amp;quot; successfully created&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;
vgcreate -c y --addtag @an-cluster01 drbd_an4_vg0 /dev/drbd1&lt;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;drbd_an4_vg0&amp;quot; successfully created&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;
vgcreate -c y --addtag @an-cluster01 drbd_an5_vg0 /dev/drbd2&lt;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;drbd_an5_vg0&amp;quot; successfully created&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On The Other Node&#039;&#039;&#039;: You can verify that the VGs are visible on the second node with &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 -v&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
    Finding all volume groups&lt;br /&gt;
    Finding volume group &amp;quot;drbd_an5_vg0&amp;quot;&lt;br /&gt;
  --- Volume group ---&lt;br /&gt;
  VG Name               drbd_an5_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               93.14 GB&lt;br /&gt;
  PE Size               4.00 MB&lt;br /&gt;
  Total PE              23843&lt;br /&gt;
  Alloc PE / Size       0 / 0   &lt;br /&gt;
  Free  PE / Size       23843 / 93.14 GB&lt;br /&gt;
  VG UUID               kqhxfN-6VaV-TXlL-SYPP-4k2F-li70-rOg2wK&lt;br /&gt;
   &lt;br /&gt;
  --- Physical volumes ---&lt;br /&gt;
  PV Name               /dev/drbd2     &lt;br /&gt;
  PV UUID               6d4e5P-pjHE-4axT-ZRyG-lJa7-8oLa-TjkZFy&lt;br /&gt;
  PV Status             allocatable&lt;br /&gt;
  Total PE / Free PE    23843 / 23843&lt;br /&gt;
   &lt;br /&gt;
    Finding volume group &amp;quot;drbd_an4_vg0&amp;quot;&lt;br /&gt;
  --- Volume group ---&lt;br /&gt;
  VG Name               drbd_an4_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               93.14 GB&lt;br /&gt;
  PE Size               4.00 MB&lt;br /&gt;
  Total PE              23843&lt;br /&gt;
  Alloc PE / Size       0 / 0   &lt;br /&gt;
  Free  PE / Size       23843 / 93.14 GB&lt;br /&gt;
  VG UUID               9WBngc-SvVq-VVBd-csag-I0JP-DqLj-xV3fUf&lt;br /&gt;
   &lt;br /&gt;
  --- Physical volumes ---&lt;br /&gt;
  PV Name               /dev/drbd1     &lt;br /&gt;
  PV UUID               zrwlxT-VFA4-5NiK-fwbK-z2Ez-mYxu-Ei8yZs&lt;br /&gt;
  PV Status             allocatable&lt;br /&gt;
  Total PE / Free PE    23843 / 23843&lt;br /&gt;
   &lt;br /&gt;
    Finding volume group &amp;quot;drbd_sh0_vg0&amp;quot;&lt;br /&gt;
  --- Volume group ---&lt;br /&gt;
  VG Name               drbd_sh0_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               9.32 GB&lt;br /&gt;
  PE Size               4.00 MB&lt;br /&gt;
  Total PE              2386&lt;br /&gt;
  Alloc PE / Size       0 / 0   &lt;br /&gt;
  Free  PE / Size       2386 / 9.32 GB&lt;br /&gt;
  VG UUID               h6xZz8-G3J2-fkBF-1ZOD-DgkR-X0f4-9qaYI3&lt;br /&gt;
   &lt;br /&gt;
  --- Physical volumes ---&lt;br /&gt;
  PV Name               /dev/drbd0     &lt;br /&gt;
  PV UUID               WxTCW4-lUzL-bR53-km45-13eV-3f8B-ZA5Tb9&lt;br /&gt;
  PV Status             allocatable&lt;br /&gt;
  Total PE / Free PE    2386 / 2386&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;tag&amp;lt;/span&amp;gt; we assigned isn&#039;t displayed, this is ok. You can see the tags using a special incantation of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vgs&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;
vgs -o vg_name,vg_tags&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
  VG           VG Tags     &lt;br /&gt;
  drbd_an4_vg0 an-cluster01&lt;br /&gt;
  drbd_an5_vg0 an-cluster01&lt;br /&gt;
  drbd_sh0_vg0 an-cluster01&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It may not be pretty, but at least you can confirm that the tags exist as expected. Where tags are used will be discussed later in the trouble-shooting section.&lt;br /&gt;
&lt;br /&gt;
Before proceeding, be sure to have LVM rescan for the new [[VG]]s so that it&#039;s cache is up to date.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On both nodes&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vgscan&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
  Reading all physical volumes.  This may take a while...&lt;br /&gt;
  Found volume group &amp;quot;drbd_an5_vg0&amp;quot; using metadata type lvm2&lt;br /&gt;
  Found volume group &amp;quot;drbd_an4_vg0&amp;quot; using metadata type lvm2&lt;br /&gt;
  Found volume group &amp;quot;drbd_sh0_vg0&amp;quot; using metadata type lvm2&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Creating a Logical Volume ===&lt;br /&gt;
&lt;br /&gt;
At this point, we&#039;re only going to create a logical volume on the shared VG. This one LV will use all of the space available in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;drbd_sh0_vg0&amp;lt;/span&amp;gt; volume group. As with the VGs, we&#039;ll be assigning the same tag to our LV. We will also need to assign a name to the LV which will form the last part of the device path, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/vg_name/lv_name&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
When creating LVs, you can specify the size of the new LV in a few ways. The two way I prefer are &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;-L xxG&amp;lt;/span&amp;gt;, where &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xx&amp;lt;/span&amp;gt; is the number of [[GiB]] to make the LV. Alternatively, I like to use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;-l 100%FREE&amp;lt;/span&amp;gt; when I am creating the last partition on the VG (or the only one, as in this case). Which you use is entirely up to you.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On One Node&#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 100%FREE --addtag @an-cluster01 -n xen_shared drbd_sh0_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;On The Other Node&#039;&#039;&#039;:&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/drbd_sh0_vg0/xen_shared&lt;br /&gt;
  VG Name                drbd_sh0_vg0&lt;br /&gt;
  LV UUID                6bngyf-RSGG-17pA-g2fn-wwM3-6xsc-8yBAI5&lt;br /&gt;
  LV Write Access        read/write&lt;br /&gt;
  LV Status              available&lt;br /&gt;
  # open                 0&lt;br /&gt;
  LV Size                9.32 GB&lt;br /&gt;
  Current LE             2386&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;
As always, before proceeding, be sure to have LVM rescan for the new [[LV]]s so that it&#039;s cache is up to date.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
lvscan&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
  ACTIVE            &#039;/dev/drbd_sh0_vg0/xen_shared&#039; [9.32 GB] inherit&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As with VGs, we can confirm that the tag was set using a similar call to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;lvs&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;
lvs -o vg_name,lv_name,lv_tags&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
  VG           LV         LV Tags     &lt;br /&gt;
  drbd_sh0_vg0 xen_shared an-cluster01&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
That&#039;s it. Our clustered LVM is setup!&lt;br /&gt;
&lt;br /&gt;
== Setting Up The Shared GFS2 Partition ==&lt;br /&gt;
&lt;br /&gt;
Setting up a [[GFS2]] partition requires three steps;&lt;br /&gt;
* Formatting the block device, a logical volume in our case, using the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;mkfs.gfs2&amp;lt;/span&amp;gt; tool.&lt;br /&gt;
* Create a mount point on each node.&lt;br /&gt;
* Add an entry 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;
As mentioned earlier, we&#039;ll create a small 10 [[GB]] [[GFS2]] partition that will hold common files for the cluster. The most notable being the virtual machine definition files. These need to be centralized so that one node can restore a VM lost on another node during a failure state. It&#039;s also a decent place for things like ISOs if you&#039;re not using a [[PXE]] server of if you want to make generic VM images available. Though if you plan to do that, you will probably want a larger GFS2 partition than we are using here.&lt;br /&gt;
&lt;br /&gt;
The information you need to have on hand when formatting a [[GFS2]] partition is:&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Variable&lt;br /&gt;
!Value&lt;br /&gt;
!Note&lt;br /&gt;
|-&lt;br /&gt;
!Locking protocol&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;lock_dlm&amp;lt;/span&amp;gt;&lt;br /&gt;
|This is always &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;lock_dlm&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Journals&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;2&amp;lt;/span&amp;gt;&lt;br /&gt;
|This matches the number of nodes in the cluster.&lt;br /&gt;
|-&lt;br /&gt;
!Cluster Name&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-cluster01&amp;lt;/span&amp;gt;&lt;br /&gt;
|As set in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/cluster/cluster.conf&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Partition Name&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xen_shared&amp;lt;/span&amp;gt;&lt;br /&gt;
|Arbitrary name&lt;br /&gt;
|-&lt;br /&gt;
!Backing Device&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/drbd_sh0_vg0/xen_shared&amp;lt;/span&amp;gt;&lt;br /&gt;
|The LV we created earlier&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Putting it all together, the command becomes:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On One Node&#039;&#039;&#039;:&lt;br /&gt;
&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-cluster01:xen_shared /dev/drbd_sh0_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/drbd_sh0_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;
Are you sure you want to proceed? [y/n] y&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{note|1=It can take a bit of time for this to complete, please be patient.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Device:                    /dev/drbd_sh0_vg0/xen_shared&lt;br /&gt;
Blocksize:                 4096&lt;br /&gt;
Device Size                9.32 GB (2443264 blocks)&lt;br /&gt;
Filesystem Size:           9.32 GB (2443261 blocks)&lt;br /&gt;
Journals:                  2&lt;br /&gt;
Resource Groups:           38&lt;br /&gt;
Locking Protocol:          &amp;quot;lock_dlm&amp;quot;&lt;br /&gt;
Lock Table:                &amp;quot;an-cluster01:xen_shared&amp;quot;&lt;br /&gt;
UUID:                      764772BC-B292-1BBF-F987-AD3A2540849B&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now confirm that the partition is visible from the other node.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On The Other Node&#039;&#039;&#039;: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
gfs2_edit -p sb /dev/drbd_sh0_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;
Block #16    (0x10) of 2443264 (0x254800) (superblock)&lt;br /&gt;
&lt;br /&gt;
Superblock:&lt;br /&gt;
  mh_magic              0x01161970(hex)&lt;br /&gt;
  mh_type               1                   0x1&lt;br /&gt;
  mh_format             100                 0x64&lt;br /&gt;
  sb_fs_format          1801                0x709&lt;br /&gt;
  sb_multihost_format   1900                0x76c&lt;br /&gt;
  sb_bsize              4096                0x1000&lt;br /&gt;
  sb_bsize_shift        12                  0xc&lt;br /&gt;
  master dir:           2                   0x2&lt;br /&gt;
        addr:           22                  0x16&lt;br /&gt;
  root dir  :           1                   0x1&lt;br /&gt;
        addr:           21                  0x15&lt;br /&gt;
  sb_lockproto          lock_dlm&lt;br /&gt;
  sb_locktable          an-cluster01:xen_shared&lt;br /&gt;
  sb_uuid               764772BC-B292-1BBF-F987-AD3A2540849B&lt;br /&gt;
&lt;br /&gt;
The superblock has 2 directories&lt;br /&gt;
     1. (1). 21 (0x15): Dir     root&lt;br /&gt;
     2. (2). 22 (0x16): Dir     master&lt;br /&gt;
------------------------------------------------------&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With that, the GFS2 partition is ready for use.&lt;br /&gt;
&lt;br /&gt;
Now we need to create the mount point. The mount point you use is up to you. This tutorial will create a mount point called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/xen_shared&amp;lt;/span&amp;gt;. Once that&#039;s created, we&#039;ll actually mount the GFS2 partition. Finally, we&#039;ll use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;df&amp;lt;/span&amp;gt; to verify that it mounted successfully.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On Both Nodes&#039;&#039;&#039;:&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/drbd_sh0_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;
/dev/sda2              20G  2.9G   16G  16% /&lt;br /&gt;
/dev/sda1             244M   33M  198M  15% /boot&lt;br /&gt;
tmpfs                 1.8G     0  1.8G   0% /dev/shm&lt;br /&gt;
none                  1.8G  104K  1.8G   1% /var/lib/xenstored&lt;br /&gt;
/dev/mapper/drbd_sh0_vg0-xen_shared&lt;br /&gt;
                      9.4G  259M  9.1G   3% /xen_shared&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The last step is to add an entry to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/fstab&amp;lt;/span&amp;gt; for this GFS2 partition. This is required because the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/init.d/gfs2&amp;lt;/span&amp;gt; initialization script consults &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/fstab&amp;lt;/span&amp;gt; to see what partitions it is to manage.&lt;br /&gt;
&lt;br /&gt;
If you are familiar with GFS2 on [[EL6]], then you might be familiar with using the GFS2&#039;s [[UUID]] in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/fstab&amp;lt;/span&amp;gt;. That is not supported here on [[EL5]].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On both nodes&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/fstab /etc/fstab.orig&lt;br /&gt;
echo &amp;quot;/dev/drbd_sh0_vg0/xen_shared /xen_shared gfs2 rw,suid,dev,exec,nouser,async 0 0&amp;quot; &amp;gt;&amp;gt; /etc/fstab&lt;br /&gt;
diff -u /etc/fstab.orig /etc/fstab&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;diff&amp;quot;&amp;gt;&lt;br /&gt;
--- /etc/fstab.orig     2011-05-06 18:56:50.000000000 -0400&lt;br /&gt;
+++ /etc/fstab  2011-05-06 18:56:50.000000000 -0400&lt;br /&gt;
@@ -5,3 +5,4 @@&lt;br /&gt;
 sysfs                   /sys                    sysfs   defaults        0 0&lt;br /&gt;
 proc                    /proc                   proc    defaults        0 0&lt;br /&gt;
 LABEL=SWAP-sda3         swap                    swap    defaults        0 0&lt;br /&gt;
+/dev/drbd_sh0_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;
{{note|1=The reason that we use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rw,suid,dev,exec,nouser,async&amp;lt;/span&amp;gt; instead of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;defaults&amp;lt;/span&amp;gt;. The key option we don&#039;t want to use is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;auto&amp;lt;/span&amp;gt;, which is implied with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;defaults&amp;lt;/span&amp;gt;. The reason for avoiding this is to prevent the system from trying to mount the GFS2 partition during boot. With the cluster not running that early in the boot process, the GFS2 partition will effectively not exist at that point, so any attempt to mount it will fail.}}&lt;br /&gt;
&lt;br /&gt;
Now, to verify that everything is working, call &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;status&amp;lt;/span&amp;gt; against the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;gfs2&amp;lt;/span&amp;gt; initialization script.&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 try &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;stop&amp;lt;/span&amp;gt;&#039;ing &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;gfs2&amp;lt;/span&amp;gt;, checking the mounts with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;df&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;status&amp;lt;/span&amp;gt;, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;start&amp;lt;/span&amp;gt;&#039;ing &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;gfs2&amp;lt;/span&amp;gt; back up and doing a final &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;df&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;status&amp;lt;/span&amp;gt;. If all works well, the GFS2 volume should unmount and remount.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On Both Nodes&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
Stop:&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 filesystems:                               [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check that it has been unmounted:&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;
&amp;lt;/source&amp;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/sda2              20G  2.9G   16G  16% /&lt;br /&gt;
/dev/sda1             244M   33M  198M  15% /boot&lt;br /&gt;
tmpfs                 1.8G     0  1.8G   0% /dev/shm&lt;br /&gt;
none                  1.8G  104K  1.8G   1% /var/lib/xenstored&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now start the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;gfs2&amp;lt;/span&amp;gt; service 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 filesystems:                                 [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check that it has been re-mounted:&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;
&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/sda2              20G  2.9G   16G  16% /&lt;br /&gt;
/dev/sda1             244M   33M  198M  15% /boot&lt;br /&gt;
tmpfs                 1.8G     0  1.8G   0% /dev/shm&lt;br /&gt;
none                  1.8G  104K  1.8G   1% /var/lib/xenstored&lt;br /&gt;
/dev/mapper/drbd_sh0_vg0-xen_shared&lt;br /&gt;
                      9.4G  259M  9.1G   3% /xen_shared&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Perfect!&lt;br /&gt;
&lt;br /&gt;
= Managing Storage In The Cluster =&lt;br /&gt;
&lt;br /&gt;
The storage for the cluster is ready, but it hasn&#039;t actually been tied &#039;&#039;into&#039;&#039; the cluster. To do that, we will use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt;, within which we will add the &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; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;gfs2&amp;lt;/span&amp;gt; initialization scripts as cluster resources. We will create two failover domains, each one containing only one node. lastly, we will take those three resources and create a service tree.&lt;br /&gt;
&lt;br /&gt;
== Covering Some New Terms ==&lt;br /&gt;
&lt;br /&gt;
Now, let&#039;s back up and talk a bit about those three new terms.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Resources&#039;&#039;&#039; are items that can be used in one or more services.&lt;br /&gt;
* &#039;&#039;&#039;Services&#039;&#039;&#039; consist of one or more resources, either in series, parallel or a combination of both, that are managed by the cluster.&lt;br /&gt;
* &#039;&#039;&#039;Failover Domains&#039;&#039;&#039; are logical groups of one or more nodes. Services can run strictly within a failover group, or they can be allowed to run outside of the failover domain when no member domains are available.&lt;br /&gt;
&lt;br /&gt;
== An Overview Of How We Will Manage Storage In The Cluster ==&lt;br /&gt;
&lt;br /&gt;
So what we are going to do here is:&lt;br /&gt;
* Create three &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;script&amp;lt;/span&amp;gt; resources&lt;br /&gt;
* Create two failover domains. One containing just &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04.alteeve.com&amp;lt;/span&amp;gt; and the other containing just &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05.alteeve.com&amp;lt;/span&amp;gt;. We will restrict services within these domains to only run within this domain, effectively locking the service to the node.&lt;br /&gt;
* Within each failover domain, we will create a service with a serial resource tree. This tree will start &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;drbd&amp;lt;/span&amp;gt;, then &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clvmd&amp;lt;/span&amp;gt; and finally &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;gfs2&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The reason for this is so that when &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; starts, it will start each failover domain&#039;s service which, in turn, will start the clustered storage daemons in the proper order.&lt;br /&gt;
&lt;br /&gt;
== Why Not Start The Daemons At Boot Time? ==&lt;br /&gt;
&lt;br /&gt;
This might seem like over kill, and arguably it is. The reason I still find it worth while is that if a storage daemon like [[DRBD]] hangs on boot, you can find yourself with a node that you can not access. Many folk have their nodes in data centers so gaining direct access can be a pain, to be polite. So by moving these daemons over to the cluster, and knowing that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; itself will start late in the boot process, we are much more likely to still have remote access when things go bad.&lt;br /&gt;
&lt;br /&gt;
I used DRBD as an example on purpose. I prefer to have DRBD resources wait forever to connect to the other node when starting up. This way, if one node starts somewhat later than the other, the first node&#039;s DRBD resource won&#039;t risk split-braining. it will happily wait until it&#039;s partner node comes up and starts it&#039;s own DRBD daemon. The downside to this is that DRBD will effectively hang the boot process forever if the other node can&#039;t be started. By managing DRBD in the cluster, we leave open the option of logging in and telling DRBD to stop waiting when we know the other node will not be booting.&lt;br /&gt;
&lt;br /&gt;
== Adding rgmanager To cluster.conf ==&lt;br /&gt;
&lt;br /&gt;
Everything related to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; is an element of the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;[[RHCS_v2_cluster.conf#rm.3B_The_Resource_Manager|rm]] /&amp;gt;&amp;lt;/span&amp;gt; tag. Within that, the actual resources are themselves elements of the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;resources /&amp;gt;&amp;lt;/span&amp;gt; tag. We&#039;ll start by creating these tags, then we&#039;ll look at the actual resources.&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-cluster01&amp;quot; config_version=&amp;quot;10&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;cman expected_votes=&amp;quot;1&amp;quot; two_node=&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-node04.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;fence_na01&amp;quot; port=&amp;quot;04&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-node05.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;fence_na01&amp;quot; port=&amp;quot;03&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_na01&amp;quot; agent=&amp;quot;fence_na&amp;quot; ipaddr=&amp;quot;fence_na01.alteeve.com&amp;quot; login=&amp;quot;admin&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;fence_daemon post_join_delay=&amp;quot;60&amp;quot;/&amp;gt;&lt;br /&gt;
        &amp;lt;totem rrp_mode=&amp;quot;none&amp;quot; secauth=&amp;quot;off&amp;quot;/&amp;gt;&lt;br /&gt;
        &amp;lt;rm&amp;gt;&lt;br /&gt;
                &amp;lt;resources/&amp;gt;&lt;br /&gt;
                &amp;lt;failoverdomains /&amp;gt;&lt;br /&gt;
        &amp;lt;/rm&amp;gt;&lt;br /&gt;
&amp;lt;/cluster&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There are several attributes available for the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rm&amp;lt;/span&amp;gt;, though we don&#039;t need to worry about them now as the defaults are sane. It&#039;s primary purpose is to act as a container for &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;failoverdomains /&amp;gt;&amp;lt;/span&amp;gt;, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;resources /&amp;gt;&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;service /&amp;gt;&amp;lt;/span&amp;gt; tags. We&#039;ll be working with all three of these now. We&#039;re not putting an empty &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;service /&amp;gt;&amp;lt;/span&amp;gt; tag in because they must contain and attribute, which we are not ready to do yet.&lt;br /&gt;
&lt;br /&gt;
=== Adding Resources to cluster.conf ===&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;resources&amp;lt;/span&amp;gt; tag has no attributes of it&#039;s own. It solely acts as a container for various resource tags. There are many types of resources, but we will only be using the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;script /&amp;gt;&amp;lt;/span&amp;gt; tag in this cluster.&lt;br /&gt;
&lt;br /&gt;
Let&#039;s look at the three scripts we&#039;re going to add; &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-cluster01&amp;quot; config_version=&amp;quot;11&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;cman expected_votes=&amp;quot;1&amp;quot; two_node=&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-node04.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;fence_na01&amp;quot; port=&amp;quot;04&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-node05.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;fence_na01&amp;quot; port=&amp;quot;03&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_na01&amp;quot; agent=&amp;quot;fence_na&amp;quot; ipaddr=&amp;quot;fence_na01.alteeve.com&amp;quot; login=&amp;quot;admin&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;fence_daemon post_join_delay=&amp;quot;60&amp;quot;/&amp;gt;&lt;br /&gt;
        &amp;lt;totem rrp_mode=&amp;quot;none&amp;quot; secauth=&amp;quot;off&amp;quot;/&amp;gt;&lt;br /&gt;
        &amp;lt;rm&amp;gt;&lt;br /&gt;
                &amp;lt;resources&amp;gt;&lt;br /&gt;
                        &amp;lt;script file=&amp;quot;/etc/init.d/drbd&amp;quot; name=&amp;quot;drbd&amp;quot;/&amp;gt;&lt;br /&gt;
                        &amp;lt;script file=&amp;quot;/etc/init.d/clvmd&amp;quot; name=&amp;quot;clvmd&amp;quot;/&amp;gt;&lt;br /&gt;
                        &amp;lt;script file=&amp;quot;/etc/init.d/gfs2&amp;quot; name=&amp;quot;gfs2&amp;quot;/&amp;gt;&lt;br /&gt;
                &amp;lt;/resources&amp;gt;&lt;br /&gt;
                &amp;lt;failoverdomains /&amp;gt;&lt;br /&gt;
        &amp;lt;/rm&amp;gt;&lt;br /&gt;
&amp;lt;/cluster&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The main two attributes used by &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;script /&amp;gt;&amp;lt;/span&amp;gt; are &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;file&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;name&amp;lt;/span&amp;gt;. The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;file&amp;lt;/span&amp;gt; attribute is the path to the script and the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;name&amp;lt;/span&amp;gt; will be used to reference this script when we create our &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;service /&amp;gt;&amp;lt;/span&amp;gt; resource tree later.&lt;br /&gt;
&lt;br /&gt;
{{note|1=Scripts must work like initialization scripts. That is, they need to support being called with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;start&amp;lt;/span&amp;gt;, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;stop&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;status&amp;lt;/span&amp;gt; arguments.}}&lt;br /&gt;
&lt;br /&gt;
=== Adding Failover Domains to cluster.conf ===&lt;br /&gt;
&lt;br /&gt;
Failover domains are, at their most basic, a collection of one or more nodes in the cluster. Services can then be configured to operate within the context of a given failover domain. There are a few key options to be aware of.&lt;br /&gt;
&lt;br /&gt;
* A failover domain can be unordered or prioritized.&lt;br /&gt;
** When unordered, a service will relocate to another random node in the domain.&lt;br /&gt;
** When prioritized, a service will relocate to the highest-priority node in the domain.&lt;br /&gt;
* A failover domain can be restricted or unrestricted.&lt;br /&gt;
** When restricted, a service is &#039;&#039;&#039;only&#039;&#039;&#039; allowed to relocate to nodes in the domain. When no nodes are available, a service is stopped.&lt;br /&gt;
** When unrestricted, a service will try to relocate to a node in the domain. However, when no domain members are available, a service attempts to start on another node in the cluster.&lt;br /&gt;
* A failover domain can have a failback policy.&lt;br /&gt;
** When a domain allows for failback and the domain is ordered, a service will migrate to the highest priority node in the domain. This allows for automated restoration of services on a failed node when it rejoins the cluster.&lt;br /&gt;
** When a domain does not allow for failback, but is unrestricted, failback of services that fell out of the domain will happen anyway. However, once the service is within the domain, the service will &#039;&#039;&#039;not&#039;&#039;&#039; relocate to a higher-priority node should one become available later.&lt;br /&gt;
** When a domain does not allow for failback and is restricted, then failback of services will never occur.&lt;br /&gt;
&lt;br /&gt;
What we are going to do now is create two restricted failover domains with no relocation. Each of these will contain just one of the nodes. This will effectively lock their services to the node. This way, services assigned to each domain will be started and maintained by the cluster, but they will &#039;&#039;&#039;not&#039;&#039;&#039; be highly available. The services we will create will have local initialization scripts, so this is perfectly fine. &lt;br /&gt;
&lt;br /&gt;
This is how we will get the cluster to start and maintain out clustered storage daemons.&lt;br /&gt;
&lt;br /&gt;
The format for defining failover domains is to create a &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;failoverdomains&amp;gt;&amp;lt;/span&amp;gt; tag, which has no attributes, and acts as a container for one or more &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;failoverdomain&amp;gt;&amp;lt;/span&amp;gt; tags. Each &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;failoverdomain&amp;gt;&amp;lt;/span&amp;gt; tag has four attributes and acts as a container for one or more &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;failoverdomainnode /&amp;gt;&amp;lt;/span&amp;gt; tags.&lt;br /&gt;
&lt;br /&gt;
The only required attribute in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;failoverdomain /&amp;gt;&amp;lt;/span&amp;gt; is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;name=&amp;quot;&amp;quot;&amp;lt;/span&amp;gt;. This is the name that will be used later when we want to bind a service to a given failover domain. By default, a failover domain is unordered, thus making failback meaningless, and it is unrestricted. When ordered, the default is to allow for failback.&lt;br /&gt;
&lt;br /&gt;
The individual &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;failoverdomainnode /&amp;gt;&amp;lt;/span&amp;gt; have two attributes; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;name&amp;lt;/span&amp;gt;, which must match the given node&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;clusternode name=&amp;quot;...&amp;quot;&amp;lt;/span&amp;gt;, and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;priority=&amp;quot;x&amp;quot;&amp;lt;/span&amp;gt;, where &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;x&amp;lt;/span&amp;gt; is an integer. when only one node is defined or when a failover domain in unordered, the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;priority&amp;lt;/span&amp;gt; is ignored. When two or more nodes are defined and the domain is ordered, then nodes with the lowest number has the highest priority for hosting services. That is, a node with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;priority=&amp;quot;1&amp;quot;&amp;lt;/span&amp;gt; will be preferred to a node with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;priority=&amp;quot;2&amp;quot;&amp;lt;/span&amp;gt;.&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-cluster01&amp;quot; config_version=&amp;quot;12&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;cman expected_votes=&amp;quot;1&amp;quot; two_node=&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-node04.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;fence_na01&amp;quot; port=&amp;quot;04&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-node05.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;fence_na01&amp;quot; port=&amp;quot;03&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_na01&amp;quot; agent=&amp;quot;fence_na&amp;quot; ipaddr=&amp;quot;fence_na01.alteeve.com&amp;quot; login=&amp;quot;admin&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;fence_daemon post_join_delay=&amp;quot;60&amp;quot;/&amp;gt;&lt;br /&gt;
        &amp;lt;totem rrp_mode=&amp;quot;none&amp;quot; secauth=&amp;quot;off&amp;quot;/&amp;gt;&lt;br /&gt;
        &amp;lt;rm&amp;gt;&lt;br /&gt;
                &amp;lt;resources&amp;gt;&lt;br /&gt;
                        &amp;lt;script file=&amp;quot;/etc/init.d/drbd&amp;quot; name=&amp;quot;drbd&amp;quot;/&amp;gt;&lt;br /&gt;
                        &amp;lt;script file=&amp;quot;/etc/init.d/clvmd&amp;quot; name=&amp;quot;clvmd&amp;quot;/&amp;gt;&lt;br /&gt;
                        &amp;lt;script file=&amp;quot;/etc/init.d/gfs2&amp;quot; name=&amp;quot;gfs2&amp;quot;/&amp;gt;&lt;br /&gt;
                &amp;lt;/resources&amp;gt;&lt;br /&gt;
		&amp;lt;failoverdomains&amp;gt;&lt;br /&gt;
			&amp;lt;failoverdomain name=&amp;quot;an4_only&amp;quot; nofailback=&amp;quot;0&amp;quot; ordered=&amp;quot;0&amp;quot; restricted=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
				&amp;lt;failoverdomainnode name=&amp;quot;an-node04.alteeve.com&amp;quot; priority=&amp;quot;1&amp;quot;/&amp;gt;&lt;br /&gt;
			&amp;lt;/failoverdomain&amp;gt;&lt;br /&gt;
			&amp;lt;failoverdomain name=&amp;quot;an5_only&amp;quot; nofailback=&amp;quot;0&amp;quot; ordered=&amp;quot;0&amp;quot; restricted=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
				&amp;lt;failoverdomainnode name=&amp;quot;an-node05.alteeve.com&amp;quot; priority=&amp;quot;1&amp;quot;/&amp;gt;&lt;br /&gt;
			&amp;lt;/failoverdomain&amp;gt;&lt;br /&gt;
		&amp;lt;/failoverdomains&amp;gt;&lt;br /&gt;
        &amp;lt;/rm&amp;gt;&lt;br /&gt;
&amp;lt;/cluster&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So here we&#039;ve now created two failover domains; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an4_only&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an5_only&amp;lt;/span&amp;gt;. Both of these are &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;restricted=&amp;quot;1&amp;quot;&amp;lt;/span&amp;gt;, so services within these domains will never try to start on other nodes. Both &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;nofailback=&amp;quot;0&amp;quot;&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ordered=&amp;quot;0&amp;quot;&amp;lt;/span&amp;gt; are defined, but they have no meaning because the two domains have only one node each.&lt;br /&gt;
&lt;br /&gt;
Within each domain, the corresponding &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;failoverdomainnode /&amp;gt;&amp;lt;/span&amp;gt; is defined. Notice that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;priority=&amp;quot;1&amp;quot;&amp;lt;/span&amp;gt; is set, despite having no use. This attribute must exist regardless. The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;name=&amp;quot;an-node0x.alteeve.com&amp;lt;/span&amp;gt; links the node to it&#039;s corresponding &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;clusternode name=&amp;quot;an-node0x.alteeve.com&amp;quot;&amp;lt;/span&amp;gt; entry in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;clusternodes /&amp;gt;&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Creating the Storage Services in cluster.conf ===&lt;br /&gt;
&lt;br /&gt;
The last piece of the resource management puzzle are the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;service /&amp;gt;&amp;lt;/span&amp;gt; tags. These tags are where the actually resources are tied together, assigned to a failover domain and put under the cluster&#039;s control. The resource elements can be defined as parallel tags, a resource can be an elements of another to form dependency branches or they can be a combination of both. In our case, we want to make sure that each storage daemon successfully starts before the next service starts so we will be creating a dependency tree of resources. Specifically, we want to ensure that the start order is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;drbd&amp;lt;/span&amp;gt; -&amp;gt; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clvmd&amp;lt;/span&amp;gt; -&amp;gt; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;gfs2&amp;lt;/span&amp;gt;. The shut-down will be the reverse order.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;service /&amp;gt;&amp;lt;/span&amp;gt; tag has just one required attribute, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;name=&amp;quot;&amp;quot;&amp;lt;/span&amp;gt;, which is used in tools like Conga for identifying the service. The name can be descriptive, but it must be unique. There are several optional attributes, though we will only be looking at five of them.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;domain=&amp;quot;&amp;quot;&amp;lt;/span&amp;gt; is used to assign the given &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;service /&amp;gt;&amp;lt;/span&amp;gt; to failover domain. The name set here must match a &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;failoverdomain name=&amp;quot;&amp;quot; /&amp;gt;&amp;lt;/span&amp;gt;. Note that you &#039;&#039;do not&#039;&#039; need to define a failover domain. &lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;autostart=&amp;quot;[0|1]&amp;quot;&amp;lt;/span&amp;gt; controls whether or not the service is automatically started when &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; starts. We&#039;ll be disabling this for now, but we will come back and enable it after our initial testing is done.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;exclusive=&amp;quot;[0|1]&amp;quot;&amp;lt;/span&amp;gt; controls whether this service must run exclusively on a given node. &#039;&#039;&#039;Warning&#039;&#039;&#039;: If this is enabled, then no other service will be allowed to run on the node hosting this service.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;recover=&amp;quot;[restart|relocate|disable]&amp;quot;&amp;lt;/span&amp;gt; controls what &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; will do when this service fails. The services we&#039;re going to create now are only designed to run on one node, so &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;restart&amp;lt;/span&amp;gt; is the only policy that makes sense.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;max_restarts=&amp;quot;x&amp;quot;&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 number of times that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; will try to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;restart&amp;lt;/span&amp;gt; a given service. After &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;x&amp;lt;/span&amp;gt; failures, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; will instead &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;relocate&amp;lt;/span&amp;gt; the service based on the failover domain policy, when set. In our case, the failover domains prevent the service from running outside the domain, and the domain has only one node, so this value is effectively meaningless to us.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;restart_expire_time=&amp;quot;x&amp;quot;&amp;lt;/span&amp;gt;, where &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;x&amp;lt;/span&amp;gt; is a number of seconds. When &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;max_restarts&amp;lt;/span&amp;gt; is greater than &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;0&amp;lt;/span&amp;gt;, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; keeps a count of how many times a service has failed. These service failures &amp;quot;expire&amp;quot; after the number of seconds defined here. This is used so that the service failure count can reduce back down to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;0&amp;lt;/span&amp;gt; once things have been shown to be stable for a reasonable amount of time. As we&#039;re using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;max_restarts=&amp;quot;0&amp;quot;&amp;lt;/span&amp;gt; and the failover domain prevents relocation of the service, this value is effectively meaningless to us.&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-cluster01&amp;quot; config_version=&amp;quot;13&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;cman expected_votes=&amp;quot;1&amp;quot; two_node=&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-node04.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;fence_na01&amp;quot; port=&amp;quot;04&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-node05.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;fence_na01&amp;quot; port=&amp;quot;03&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_na01&amp;quot; agent=&amp;quot;fence_na&amp;quot; ipaddr=&amp;quot;fence_na01.alteeve.com&amp;quot; login=&amp;quot;admin&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;fence_daemon post_join_delay=&amp;quot;60&amp;quot;/&amp;gt;&lt;br /&gt;
        &amp;lt;totem rrp_mode=&amp;quot;none&amp;quot; secauth=&amp;quot;off&amp;quot;/&amp;gt;&lt;br /&gt;
	&amp;lt;rm&amp;gt;&lt;br /&gt;
		&amp;lt;resources&amp;gt;&lt;br /&gt;
			&amp;lt;script file=&amp;quot;/etc/init.d/drbd&amp;quot; name=&amp;quot;drbd&amp;quot;/&amp;gt;&lt;br /&gt;
			&amp;lt;script file=&amp;quot;/etc/init.d/clvmd&amp;quot; name=&amp;quot;clvmd&amp;quot;/&amp;gt;&lt;br /&gt;
			&amp;lt;script file=&amp;quot;/etc/init.d/gfs2&amp;quot; name=&amp;quot;gfs2&amp;quot;/&amp;gt;&lt;br /&gt;
		&amp;lt;/resources&amp;gt;&lt;br /&gt;
		&amp;lt;failoverdomains&amp;gt;&lt;br /&gt;
			&amp;lt;failoverdomain name=&amp;quot;an4_only&amp;quot; nofailback=&amp;quot;0&amp;quot; ordered=&amp;quot;0&amp;quot; restricted=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
				&amp;lt;failoverdomainnode name=&amp;quot;an-node04.alteeve.com&amp;quot; priority=&amp;quot;1&amp;quot;/&amp;gt;&lt;br /&gt;
			&amp;lt;/failoverdomain&amp;gt;&lt;br /&gt;
			&amp;lt;failoverdomain name=&amp;quot;an5_only&amp;quot; nofailback=&amp;quot;0&amp;quot; ordered=&amp;quot;0&amp;quot; restricted=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
				&amp;lt;failoverdomainnode name=&amp;quot;an-node05.alteeve.com&amp;quot; priority=&amp;quot;1&amp;quot;/&amp;gt;&lt;br /&gt;
			&amp;lt;/failoverdomain&amp;gt;&lt;br /&gt;
		&amp;lt;/failoverdomains&amp;gt;&lt;br /&gt;
		&amp;lt;service autostart=&amp;quot;0&amp;quot; domain=&amp;quot;an4_only&amp;quot; exclusive=&amp;quot;0&amp;quot; max_restarts=&amp;quot;0&amp;quot; name=&amp;quot;an4_storage&amp;quot; recovery=&amp;quot;restart&amp;quot; restart_expire_time=&amp;quot;0&amp;quot;&amp;gt;&lt;br /&gt;
			&amp;lt;script ref=&amp;quot;drbd&amp;quot;&amp;gt;&lt;br /&gt;
				&amp;lt;script ref=&amp;quot;clvmd&amp;quot;&amp;gt;&lt;br /&gt;
					&amp;lt;script ref=&amp;quot;gfs2&amp;quot;/&amp;gt;&lt;br /&gt;
				&amp;lt;/script&amp;gt;&lt;br /&gt;
			&amp;lt;/script&amp;gt;&lt;br /&gt;
		&amp;lt;/service&amp;gt;&lt;br /&gt;
		&amp;lt;service autostart=&amp;quot;0&amp;quot; domain=&amp;quot;an5_only&amp;quot; exclusive=&amp;quot;0&amp;quot; max_restarts=&amp;quot;0&amp;quot; name=&amp;quot;an5_storage&amp;quot; recovery=&amp;quot;restart&amp;quot; restart_expire_time=&amp;quot;0&amp;quot;&amp;gt;&lt;br /&gt;
			&amp;lt;script ref=&amp;quot;drbd&amp;quot;&amp;gt;&lt;br /&gt;
				&amp;lt;script ref=&amp;quot;clvmd&amp;quot;&amp;gt;&lt;br /&gt;
					&amp;lt;script ref=&amp;quot;gfs2&amp;quot;/&amp;gt;&lt;br /&gt;
				&amp;lt;/script&amp;gt;&lt;br /&gt;
			&amp;lt;/script&amp;gt;&lt;br /&gt;
		&amp;lt;/service&amp;gt;&lt;br /&gt;
	&amp;lt;/rm&amp;gt;&lt;br /&gt;
&amp;lt;/cluster&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So what we&#039;ve done here is create our two &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;service /&amp;gt;&amp;lt;/span&amp;gt; groups; One for the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an4_only&amp;lt;/span&amp;gt; failover domain and another matching service for &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an5_only&amp;lt;/span&amp;gt;. Both have their recovery policy set to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;recovery=&amp;quot;restart&amp;quot;&amp;lt;/span&amp;gt; and neither are configured to start with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Each &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;service /&amp;gt;&amp;lt;/span&amp;gt; tag&#039;s element is a collection of three &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;script /&amp;gt;&amp;lt;/span&amp;gt; resource references. The scripts are referenced using the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;script ref=&amp;quot;x&amp;quot; /&amp;gt;&amp;lt;/span&amp;gt; attribute, where &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;x&amp;lt;/span&amp;gt; must match a &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;resource name=&amp;quot;x&amp;quot; /&amp;gt;&amp;lt;/span&amp;gt; element in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;resources&amp;gt;&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
These references are embedded to form a dependency tree. The tree is formatted to start &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;drbd&amp;lt;/span&amp;gt; first, then when that starts successfully, it will start &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clvmd&amp;lt;/span&amp;gt; and then, finally, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;gfs2&amp;lt;/span&amp;gt;. When this service is disabled, this dependency tree is stopped in the reverse order. &lt;br /&gt;
&lt;br /&gt;
=== Validating the Additions to cluster.conf ===&lt;br /&gt;
&lt;br /&gt;
Seeing as we&#039;ve made some fairly significant changes to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/cluster/cluster.conf&amp;lt;/span&amp;gt;, we&#039;ll want to re-validate it before pushing it out to the other node.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
xmllint --relaxng /usr/share/system-config-cluster/misc/cluster.ng /etc/cluster/cluster.conf&lt;br /&gt;
&amp;lt;/source&amp;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-cluster01&amp;quot; config_version=&amp;quot;13&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;cman expected_votes=&amp;quot;1&amp;quot; two_node=&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-node04.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;fence_na01&amp;quot; port=&amp;quot;04&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-node05.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;fence_na01&amp;quot; port=&amp;quot;03&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_na01&amp;quot; agent=&amp;quot;fence_na&amp;quot; ipaddr=&amp;quot;fence_na01.alteeve.com&amp;quot; login=&amp;quot;admin&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;fence_daemon post_join_delay=&amp;quot;60&amp;quot;/&amp;gt;&lt;br /&gt;
        &amp;lt;totem rrp_mode=&amp;quot;none&amp;quot; secauth=&amp;quot;off&amp;quot;/&amp;gt;&lt;br /&gt;
	&amp;lt;rm&amp;gt;&lt;br /&gt;
		&amp;lt;resources&amp;gt;&lt;br /&gt;
			&amp;lt;script file=&amp;quot;/etc/init.d/drbd&amp;quot; name=&amp;quot;drbd&amp;quot;/&amp;gt;&lt;br /&gt;
			&amp;lt;script file=&amp;quot;/etc/init.d/clvmd&amp;quot; name=&amp;quot;clvmd&amp;quot;/&amp;gt;&lt;br /&gt;
			&amp;lt;script file=&amp;quot;/etc/init.d/gfs2&amp;quot; name=&amp;quot;gfs2&amp;quot;/&amp;gt;&lt;br /&gt;
		&amp;lt;/resources&amp;gt;&lt;br /&gt;
		&amp;lt;failoverdomains&amp;gt;&lt;br /&gt;
			&amp;lt;failoverdomain name=&amp;quot;an4_only&amp;quot; nofailback=&amp;quot;0&amp;quot; ordered=&amp;quot;0&amp;quot; restricted=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
				&amp;lt;failoverdomainnode name=&amp;quot;an-node04.alteeve.com&amp;quot; priority=&amp;quot;1&amp;quot;/&amp;gt;&lt;br /&gt;
			&amp;lt;/failoverdomain&amp;gt;&lt;br /&gt;
			&amp;lt;failoverdomain name=&amp;quot;an5_only&amp;quot; nofailback=&amp;quot;0&amp;quot; ordered=&amp;quot;0&amp;quot; restricted=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
				&amp;lt;failoverdomainnode name=&amp;quot;an-node05.alteeve.com&amp;quot; priority=&amp;quot;1&amp;quot;/&amp;gt;&lt;br /&gt;
			&amp;lt;/failoverdomain&amp;gt;&lt;br /&gt;
		&amp;lt;/failoverdomains&amp;gt;&lt;br /&gt;
		&amp;lt;service autostart=&amp;quot;0&amp;quot; domain=&amp;quot;an4_only&amp;quot; exclusive=&amp;quot;0&amp;quot; max_restarts=&amp;quot;0&amp;quot; name=&amp;quot;an4_storage&amp;quot; recovery=&amp;quot;restart&amp;quot; restart_expire_time=&amp;quot;0&amp;quot;&amp;gt;&lt;br /&gt;
			&amp;lt;script ref=&amp;quot;drbd&amp;quot;&amp;gt;&lt;br /&gt;
				&amp;lt;script ref=&amp;quot;clvmd&amp;quot;&amp;gt;&lt;br /&gt;
					&amp;lt;script ref=&amp;quot;gfs2&amp;quot;/&amp;gt;&lt;br /&gt;
				&amp;lt;/script&amp;gt;&lt;br /&gt;
			&amp;lt;/script&amp;gt;&lt;br /&gt;
		&amp;lt;/service&amp;gt;&lt;br /&gt;
		&amp;lt;service autostart=&amp;quot;0&amp;quot; domain=&amp;quot;an5_only&amp;quot; exclusive=&amp;quot;0&amp;quot; max_restarts=&amp;quot;0&amp;quot; name=&amp;quot;an5_storage&amp;quot; recovery=&amp;quot;restart&amp;quot; restart_expire_time=&amp;quot;0&amp;quot;&amp;gt;&lt;br /&gt;
			&amp;lt;script ref=&amp;quot;drbd&amp;quot;&amp;gt;&lt;br /&gt;
				&amp;lt;script ref=&amp;quot;clvmd&amp;quot;&amp;gt;&lt;br /&gt;
					&amp;lt;script ref=&amp;quot;gfs2&amp;quot;/&amp;gt;&lt;br /&gt;
				&amp;lt;/script&amp;gt;&lt;br /&gt;
			&amp;lt;/script&amp;gt;&lt;br /&gt;
		&amp;lt;/service&amp;gt;&lt;br /&gt;
	&amp;lt;/rm&amp;gt;&lt;br /&gt;
&amp;lt;/cluster&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;
/etc/cluster/cluster.conf validates&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If there was a problem, you need to go back and fix it. &#039;&#039;&#039;DO NOT&#039;&#039;&#039; proceed until your configuration validates. Once it does, we&#039;re ready to move on!&lt;br /&gt;
&lt;br /&gt;
With it validated, we need to push it to the other node. The cluster should be running now, so instead of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rsync&amp;lt;/span&amp;gt;, we can use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ccs_tool&amp;lt;/span&amp;gt;, the &amp;quot;cluster configuration system (tool)&amp;quot;, to push the new &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cluster.conf&amp;lt;/span&amp;gt; to the other node and upgrade the cluster&#039;s version in one shot.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ccs_tool update /etc/cluster/cluster.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;
Config file updated from version 9 to 13&lt;br /&gt;
&lt;br /&gt;
Update complete.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you tool at &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/var/log/messages&amp;lt;/span&amp;gt; on the other node, you should see something like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
May  7 20:32:08 an-node05 ccsd[4134]: Update of cluster.conf complete (version 9 -&amp;gt; 13). &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Starting rgmanager ==&lt;br /&gt;
&lt;br /&gt;
Now that we have services, we will want to manually start &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt;. We&#039;re not yet going to set it to automatically start as we&#039;re not yet automatically starting &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt;, which it depends on. This will be done later when the testing is complete.&lt;br /&gt;
&lt;br /&gt;
So make sure that the cluster is up and running.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cman_tool 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;
Version: 6.2.0&lt;br /&gt;
Config Version: 13&lt;br /&gt;
Cluster Name: an-cluster01&lt;br /&gt;
Cluster Id: 60257&lt;br /&gt;
Cluster Member: Yes&lt;br /&gt;
Cluster Generation: 140&lt;br /&gt;
Membership state: Cluster-Member&lt;br /&gt;
Nodes: 2&lt;br /&gt;
Expected votes: 1&lt;br /&gt;
Total votes: 2&lt;br /&gt;
Quorum: 1  &lt;br /&gt;
Active subsystems: 8&lt;br /&gt;
Flags: 2node Dirty &lt;br /&gt;
Ports Bound: 0 11  &lt;br /&gt;
Node name: an-node04.alteeve.com&lt;br /&gt;
Node ID: 1&lt;br /&gt;
Multicast addresses: 239.192.235.77 &lt;br /&gt;
Node addresses: 192.168.3.74 &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You will want to stop all of the storage daemons &#039;&#039;&#039;before&#039;&#039;&#039; starting &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt;. This is because &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; will always stop any services before it tries to start them itself. This includes virtual machines, as we will see in a bit.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On both nodes&#039;&#039;&#039;:&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 filesystems:                               [  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;
/etc/init.d/clvmd 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;
Deactivating clustered VG(s):   0 logical volume(s) in volume group &amp;quot;drbd_an5_vg0&amp;quot; now active&lt;br /&gt;
  0 logical volume(s) in volume group &amp;quot;drbd_an4_vg0&amp;quot; now active&lt;br /&gt;
  0 logical volume(s) in volume group &amp;quot;drbd_sh0_vg0&amp;quot; now active&lt;br /&gt;
                                                           [  OK  ]&lt;br /&gt;
Signaling clvmd to exit                                    [  OK  ]&lt;br /&gt;
clvmd terminated                                           [  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;
/etc/init.d/drbd 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;
Stopping all DRBD resources: .&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;rgmanager&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/rgmanager 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 Cluster Service Manager:                          [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Monitoring Resources ===&lt;br /&gt;
&lt;br /&gt;
We will now use a tool called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clustat&amp;lt;/span&amp;gt; that lets us see what state the cluster&#039;s resources are in. You can run it as a once-off check of the services, or you can use the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;-i x&amp;lt;/span&amp;gt; switch, where &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;x&amp;lt;/span&amp;gt; is a number of seconds to wait between re-checking the cluster service states. If you use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;-i x&amp;lt;/span&amp;gt;, you will need to use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;ctrl&amp;gt;&amp;lt;/span&amp;gt;+&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;c&amp;gt;&amp;lt;/span&amp;gt; to quit and return to the shell.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
clustat&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Cluster Status for an-cluster01 @ Sat May  7 22:30:24 2011&lt;br /&gt;
Member Status: Quorate&lt;br /&gt;
&lt;br /&gt;
 Member Name                             ID   Status&lt;br /&gt;
 ------ ----                             ---- ------&lt;br /&gt;
 an-node04.alteeve.com                       1 Online, Local, rgmanager&lt;br /&gt;
 an-node05.alteeve.com                       2 Online, rgmanager&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State         &lt;br /&gt;
 ------- ----                   ----- ------                   -----         &lt;br /&gt;
 service:an4_storage            (none)                         disabled      &lt;br /&gt;
 service:an5_storage            (none)                         disabled      &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you remember earlier, we set the services to not &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;autostart&amp;lt;/span&amp;gt;, thus, they are disabled.&lt;br /&gt;
&lt;br /&gt;
=== Managing Cluster Resources ===&lt;br /&gt;
&lt;br /&gt;
Managing services in the cluster is done with a fairly simple tool called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clusvcadm&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The main commands we&#039;re going to look at shortly are:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clusvcadm -e &amp;lt;service&amp;gt; -m &amp;lt;node&amp;gt;&amp;lt;/span&amp;gt;: Enable the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;service&amp;gt;&amp;lt;/span&amp;gt; on the specified &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;node&amp;gt;&amp;lt;/span&amp;gt;. When a &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;node&amp;gt;&amp;lt;/span&amp;gt; is not specified, the local node where the command was run is assumed.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clusvcadm -d &amp;lt;service&amp;gt; -m &amp;lt;node&amp;gt;&amp;lt;/span&amp;gt;: Disable the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;service&amp;gt;&amp;lt;/span&amp;gt;.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clusvcadm -l &amp;lt;service&amp;gt;&amp;lt;/span&amp;gt;: Locks the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;service&amp;gt;&amp;lt;/span&amp;gt; prior to a cluster shutdown. The only action allowed when a &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;service&amp;gt;&amp;lt;/span&amp;gt; is frozen is disabling it. This allows you to stop the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;service&amp;gt;&amp;lt;/span&amp;gt; so that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; doesn&#039;t try to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;recover&amp;lt;/span&amp;gt; it (&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;restart&amp;lt;/span&amp;gt;, in our two services). Once [[quorum]] is dissolved and the cluster is shut down, the service is unlocked and returns to normal operation next time the node regains quorum.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clusvcadm -u &amp;lt;service&amp;gt;&amp;lt;/span&amp;gt;: Unlocks a &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;service&amp;gt;&amp;lt;/span&amp;gt;, should you change your mind and decide not to stop the cluster.&lt;br /&gt;
&lt;br /&gt;
There are other ways to use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clusvcadm&amp;lt;/span&amp;gt; which we will look at after the virtual servers are provisioned and under cluster control.&lt;br /&gt;
&lt;br /&gt;
=== A Note On Resource Management With DRBD ===&lt;br /&gt;
&lt;br /&gt;
We have something of a unique setup here, using DRBD, that requires a brief discussion.&lt;br /&gt;
&lt;br /&gt;
When the cluster starts for the first time, where neither node&#039;s DRBD storage was up, the first node to start will wait indefinitely for the second node to start. For this reason, we want to ensure that we enable the storage resources more or less at the same time and from two different terminals. The reason for two terminals is that the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clusvcadm -e ...&amp;lt;/span&amp;gt; command won&#039;t return until all resources have started, so you need the second terminal window to start the other node&#039;s clustered storage service while the first one waits.&lt;br /&gt;
&lt;br /&gt;
Keep an eye on [[syslog]], too. If anything goes wrong in DRBD and a split-brain is declared you will see messages like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Mar 29 20:24:37 an-node04 kernel: block drbd2: helper command: /sbin/drbdadm initial-split-brain minor-2&lt;br /&gt;
Mar 29 20:24:37 an-node04 kernel: block drbd2: helper command: /sbin/drbdadm initial-split-brain minor-2 exit code 0 (0x0)&lt;br /&gt;
Mar 29 20:24:37 an-node04 kernel: block drbd2: Split-Brain detected but unresolved, dropping connection!&lt;br /&gt;
Mar 29 20:24:37 an-node04 kernel: block drbd2: helper command: /sbin/drbdadm split-brain minor-2&lt;br /&gt;
Mar 29 20:24:37 an-node04 kernel: block drbd2: helper command: /sbin/drbdadm split-brain minor-2 exit code 0 (0x0)&lt;br /&gt;
Mar 29 20:24:37 an-node04 kernel: block drbd2: conn( WFReportParams -&amp;gt; Disconnecting )&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This can happen, for example, if you stop the cluster while DRBD is still up, and then break the network connection between the two DRBD resources. Recovering from a split-brain is covered in the trouble-shooting section below. &#039;&#039;&#039;ToDo&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{{note|1=Linbit has a good tutorial on recovering from split-brain conditions here: http://www.drbd.org/users-guide/s-resolve-split-brain.html}}&lt;br /&gt;
&lt;br /&gt;
=== Starting the Storage Services ===&lt;br /&gt;
&lt;br /&gt;
Now, with a terminal window opened for each node, run:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt;&#039;&#039;&#039;:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
clusvcadm -e service:an4_storage -m an-node04.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;
Member an-node04.alteeve.com trying to enable service:an4_storage...Success&lt;br /&gt;
service:an4_storage is now running on an-node04.alteeve.com&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt;&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
clusvcadm -e service:an5_storage -m an-node05.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;
Member an-node05.alteeve.com trying to enable service:an5_storage...Success&lt;br /&gt;
service:an5_storage is now running on an-node05.alteeve.com&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The [[syslog]] on either node should show something like this (sample from &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&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;
May  7 23:29:21 an-node04 clurgmgrd[12067]: &amp;lt;notice&amp;gt; Starting disabled service service:an4_storage &lt;br /&gt;
May  7 23:29:22 an-node04 kernel: drbd: initialized. Version: 8.3.8 (api:88/proto:86-94)&lt;br /&gt;
May  7 23:29:22 an-node04 kernel: drbd: GIT-hash: d78846e52224fd00562f7c225bcc25b2d422321d build by mockbuild@builder10.centos.org, 2010-06-04 08:04:27&lt;br /&gt;
May  7 23:29:22 an-node04 kernel: drbd: registered as block device major 147&lt;br /&gt;
May  7 23:29:22 an-node04 kernel: drbd: minor_table @ 0xffff8800cde780c0&lt;br /&gt;
May  7 23:29:22 an-node04 kernel: block drbd0: Starting worker thread (from cqueue/1 [152])&lt;br /&gt;
May  7 23:29:22 an-node04 kernel: klogd 1.4.1, ---------- state change ---------- &lt;br /&gt;
May  7 23:29:22 an-node04 kernel: block drbd0: disk( Diskless -&amp;gt; Attaching ) &lt;br /&gt;
May  7 23:29:22 an-node04 kernel: block drbd0: Found 4 transactions (98 active extents) in activity log.&lt;br /&gt;
May  7 23:29:22 an-node04 kernel: block drbd0: Method to ensure write ordering: barrier&lt;br /&gt;
May  7 23:29:22 an-node04 kernel: block drbd0: max_segment_size ( = BIO size ) = 32768&lt;br /&gt;
May  7 23:29:22 an-node04 kernel: block drbd0: drbd_bm_resize called with capacity == 19550368&lt;br /&gt;
May  7 23:29:22 an-node04 kernel: block drbd0: resync bitmap: bits=2443796 words=38185&lt;br /&gt;
May  7 23:29:22 an-node04 kernel: block drbd0: size = 9546 MB (9775184 KB)&lt;br /&gt;
May  7 23:29:22 an-node04 kernel: block drbd0: recounting of set bits took additional 1 jiffies&lt;br /&gt;
May  7 23:29:22 an-node04 kernel: block drbd0: 0 KB (0 bits) marked out-of-sync by on disk bit-map.&lt;br /&gt;
May  7 23:29:22 an-node04 kernel: block drbd0: disk( Attaching -&amp;gt; Outdated ) &lt;br /&gt;
May  7 23:29:22 an-node04 kernel: block drbd1: Starting worker thread (from cqueue/1 [152])&lt;br /&gt;
May  7 23:29:22 an-node04 kernel: block drbd1: disk( Diskless -&amp;gt; Attaching ) &lt;br /&gt;
May  7 23:29:22 an-node04 kernel: block drbd1: Found 1 transactions (1 active extents) in activity log.&lt;br /&gt;
May  7 23:29:22 an-node04 kernel: block drbd1: Method to ensure write ordering: barrier&lt;br /&gt;
May  7 23:29:22 an-node04 kernel: block drbd1: max_segment_size ( = BIO size ) = 32768&lt;br /&gt;
May  7 23:29:22 an-node04 kernel: block drbd1: drbd_bm_resize called with capacity == 195328232&lt;br /&gt;
May  7 23:29:22 an-node04 kernel: block drbd1: resync bitmap: bits=24416029 words=381501&lt;br /&gt;
May  7 23:29:22 an-node04 kernel: block drbd1: size = 93 GB (97664116 KB)&lt;br /&gt;
May  7 23:29:22 an-node04 kernel: block drbd1: recounting of set bits took additional 2 jiffies&lt;br /&gt;
May  7 23:29:22 an-node04 kernel: block drbd1: 0 KB (0 bits) marked out-of-sync by on disk bit-map.&lt;br /&gt;
May  7 23:29:22 an-node04 kernel: block drbd1: disk( Attaching -&amp;gt; Outdated ) &lt;br /&gt;
May  7 23:29:22 an-node04 kernel: block drbd2: Starting worker thread (from cqueue/1 [152])&lt;br /&gt;
May  7 23:29:22 an-node04 kernel: block drbd2: disk( Diskless -&amp;gt; Attaching ) &lt;br /&gt;
May  7 23:29:22 an-node04 kernel: block drbd2: Found 1 transactions (1 active extents) in activity log.&lt;br /&gt;
May  7 23:29:22 an-node04 kernel: block drbd2: Method to ensure write ordering: barrier&lt;br /&gt;
May  7 23:29:22 an-node04 kernel: block drbd2: max_segment_size ( = BIO size ) = 32768&lt;br /&gt;
May  7 23:29:22 an-node04 kernel: block drbd2: drbd_bm_resize called with capacity == 195328232&lt;br /&gt;
May  7 23:29:22 an-node04 kernel: block drbd2: resync bitmap: bits=24416029 words=381501&lt;br /&gt;
May  7 23:29:22 an-node04 kernel: block drbd2: size = 93 GB (97664116 KB)&lt;br /&gt;
May  7 23:29:22 an-node04 kernel: block drbd2: recounting of set bits took additional 2 jiffies&lt;br /&gt;
May  7 23:29:22 an-node04 kernel: block drbd2: 0 KB (0 bits) marked out-of-sync by on disk bit-map.&lt;br /&gt;
May  7 23:29:22 an-node04 kernel: block drbd2: disk( Attaching -&amp;gt; Outdated ) &lt;br /&gt;
May  7 23:29:22 an-node04 kernel: block drbd3: Starting worker thread (from cqueue/1 [152])&lt;br /&gt;
May  7 23:29:22 an-node04 kernel: block drbd3: disk( Diskless -&amp;gt; Attaching ) &lt;br /&gt;
May  7 23:29:22 an-node04 kernel: block drbd3: No usable activity log found.&lt;br /&gt;
May  7 23:29:22 an-node04 kernel: block drbd3: Method to ensure write ordering: barrier&lt;br /&gt;
May  7 23:29:22 an-node04 kernel: block drbd3: max_segment_size ( = BIO size ) = 32768&lt;br /&gt;
May  7 23:29:22 an-node04 kernel: block drbd3: drbd_bm_resize called with capacity == 515686680&lt;br /&gt;
May  7 23:29:22 an-node04 kernel: block drbd3: resync bitmap: bits=64460835 words=1007201&lt;br /&gt;
May  7 23:29:22 an-node04 kernel: block drbd3: size = 246 GB (257843340 KB)&lt;br /&gt;
May  7 23:29:22 an-node04 kernel: block drbd3: recounting of set bits took additional 5 jiffies&lt;br /&gt;
May  7 23:29:22 an-node04 kernel: block drbd3: 0 KB (0 bits) marked out-of-sync by on disk bit-map.&lt;br /&gt;
May  7 23:29:22 an-node04 kernel: block drbd3: disk( Attaching -&amp;gt; Outdated ) &lt;br /&gt;
May  7 23:29:23 an-node04 kernel: block drbd0: conn( StandAlone -&amp;gt; Unconnected ) &lt;br /&gt;
May  7 23:29:23 an-node04 kernel: block drbd0: Starting receiver thread (from drbd0_worker [14542])&lt;br /&gt;
May  7 23:29:23 an-node04 kernel: block drbd0: receiver (re)started&lt;br /&gt;
May  7 23:29:23 an-node04 kernel: block drbd0: conn( Unconnected -&amp;gt; WFConnection ) &lt;br /&gt;
May  7 23:29:23 an-node04 kernel: block drbd1: conn( StandAlone -&amp;gt; Unconnected ) &lt;br /&gt;
May  7 23:29:23 an-node04 kernel: block drbd1: Starting receiver thread (from drbd1_worker [14556])&lt;br /&gt;
May  7 23:29:23 an-node04 kernel: block drbd1: receiver (re)started&lt;br /&gt;
May  7 23:29:23 an-node04 kernel: block drbd1: conn( Unconnected -&amp;gt; WFConnection ) &lt;br /&gt;
May  7 23:29:23 an-node04 kernel: block drbd2: conn( StandAlone -&amp;gt; Unconnected ) &lt;br /&gt;
May  7 23:29:23 an-node04 kernel: block drbd2: Starting receiver thread (from drbd2_worker [14571])&lt;br /&gt;
May  7 23:29:23 an-node04 kernel: block drbd2: receiver (re)started&lt;br /&gt;
May  7 23:29:23 an-node04 kernel: block drbd2: conn( Unconnected -&amp;gt; WFConnection ) &lt;br /&gt;
May  7 23:29:23 an-node04 kernel: block drbd3: conn( StandAlone -&amp;gt; Unconnected ) &lt;br /&gt;
May  7 23:29:23 an-node04 kernel: block drbd3: Starting receiver thread (from drbd3_worker [14590])&lt;br /&gt;
May  7 23:29:23 an-node04 kernel: block drbd3: receiver (re)started&lt;br /&gt;
May  7 23:29:23 an-node04 kernel: block drbd3: conn( Unconnected -&amp;gt; WFConnection ) &lt;br /&gt;
May  7 23:29:24 an-node04 kernel: block drbd0: Handshake successful: Agreed network protocol version 94&lt;br /&gt;
May  7 23:29:24 an-node04 kernel: block drbd0: conn( WFConnection -&amp;gt; WFReportParams ) &lt;br /&gt;
May  7 23:29:24 an-node04 kernel: block drbd0: Starting asender thread (from drbd0_receiver [14610])&lt;br /&gt;
May  7 23:29:24 an-node04 kernel: block drbd0: data-integrity-alg: &amp;lt;not-used&amp;gt;&lt;br /&gt;
May  7 23:29:24 an-node04 kernel: block drbd0: drbd_sync_handshake:&lt;br /&gt;
May  7 23:29:24 an-node04 kernel: block drbd0: self 60D1A5567634DECE:0000000000000000:49B42CE39BDB4567:2C84CA6708465E8D bits:0 flags:0&lt;br /&gt;
May  7 23:29:24 an-node04 kernel: block drbd0: peer 8033D8F146F6823A:60D1A5567634DECF:49B42CE39BDB4566:2C84CA6708465E8D bits:0 flags:0&lt;br /&gt;
May  7 23:29:24 an-node04 kernel: block drbd0: uuid_compare()=-1 by rule 50&lt;br /&gt;
May  7 23:29:24 an-node04 kernel: block drbd0: peer( Unknown -&amp;gt; Secondary ) conn( WFReportParams -&amp;gt; WFBitMapT ) pdsk( DUnknown -&amp;gt; UpToDate ) &lt;br /&gt;
May  7 23:29:24 an-node04 kernel: block drbd1: Handshake successful: Agreed network protocol version 94&lt;br /&gt;
May  7 23:29:24 an-node04 kernel: block drbd1: conn( WFConnection -&amp;gt; WFReportParams ) &lt;br /&gt;
May  7 23:29:24 an-node04 kernel: block drbd2: Handshake successful: Agreed network protocol version 94&lt;br /&gt;
May  7 23:29:24 an-node04 kernel: block drbd2: conn( WFConnection -&amp;gt; WFReportParams ) &lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd1: Starting asender thread (from drbd1_receiver [14613])&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd2: Starting asender thread (from drbd2_receiver [14616])&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd1: data-integrity-alg: &amp;lt;not-used&amp;gt;&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd1: drbd_sync_handshake:&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd1: self A6B85B6E10FC9ED4:0000000000000000:25BC8F003E8EDE15:6DE822E83F4ED721 bits:0 flags:0&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd1: peer 73B4642E7231664C:A6B85B6E10FC9ED5:25BC8F003E8EDE15:6DE822E83F4ED721 bits:0 flags:0&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd1: uuid_compare()=-1 by rule 50&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd1: peer( Unknown -&amp;gt; Secondary ) conn( WFReportParams -&amp;gt; WFBitMapT ) pdsk( DUnknown -&amp;gt; UpToDate ) &lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd2: data-integrity-alg: &amp;lt;not-used&amp;gt;&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd2: drbd_sync_handshake:&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd2: self D074F4853E9FAFE6:0000000000000000:05586D2FABD3DD12:64590F358F14E685 bits:0 flags:0&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd2: peer 399131BDEB288486:D074F4853E9FAFE7:05586D2FABD3DD13:64590F358F14E685 bits:0 flags:0&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd2: uuid_compare()=-1 by rule 50&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd2: peer( Unknown -&amp;gt; Secondary ) conn( WFReportParams -&amp;gt; WFBitMapT ) pdsk( DUnknown -&amp;gt; UpToDate ) &lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd3: Handshake successful: Agreed network protocol version 94&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd3: conn( WFConnection -&amp;gt; WFReportParams ) &lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd3: Starting asender thread (from drbd3_receiver [14619])&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd3: data-integrity-alg: &amp;lt;not-used&amp;gt;&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd3: drbd_sync_handshake:&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd3: self 5BA622DBC6DE170E:0000000000000000:0DE6667028BDEEFE:66C10BDFC06939F3 bits:0 flags:0&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd3: peer E6526E269E123D4C:5BA622DBC6DE170F:0DE6667028BDEEFF:66C10BDFC06939F3 bits:0 flags:0&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd3: uuid_compare()=-1 by rule 50&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd3: peer( Unknown -&amp;gt; Secondary ) conn( WFReportParams -&amp;gt; WFBitMapT ) pdsk( DUnknown -&amp;gt; UpToDate ) &lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd0: conn( WFBitMapT -&amp;gt; WFSyncUUID ) &lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd0: helper command: /sbin/drbdadm before-resync-target minor-0&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd1: conn( WFBitMapT -&amp;gt; WFSyncUUID ) &lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd0: role( Secondary -&amp;gt; Primary ) &lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd1: helper command: /sbin/drbdadm before-resync-target minor-1&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd1: helper command: /sbin/drbdadm before-resync-target minor-1 exit code 0 (0x0)&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd1: conn( WFSyncUUID -&amp;gt; SyncTarget ) disk( Outdated -&amp;gt; Inconsistent ) &lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd1: Began resync as SyncTarget (will sync 0 KB [0 bits set]).&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd1: Resync done (total 1 sec; paused 0 sec; 0 K/sec)&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd1: conn( SyncTarget -&amp;gt; Connected ) disk( Inconsistent -&amp;gt; UpToDate ) &lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd1: helper command: /sbin/drbdadm after-resync-target minor-1&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd2: conn( WFBitMapT -&amp;gt; WFSyncUUID ) &lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd1: helper command: /sbin/drbdadm after-resync-target minor-1 exit code 0 (0x0)&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd2: helper command: /sbin/drbdadm before-resync-target minor-2&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd2: helper command: /sbin/drbdadm before-resync-target minor-2 exit code 0 (0x0)&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd2: conn( WFSyncUUID -&amp;gt; SyncTarget ) disk( Outdated -&amp;gt; Inconsistent ) &lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd2: Began resync as SyncTarget (will sync 0 KB [0 bits set]).&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd2: Resync done (total 1 sec; paused 0 sec; 0 K/sec)&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd2: conn( SyncTarget -&amp;gt; Connected ) disk( Inconsistent -&amp;gt; UpToDate ) &lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd2: helper command: /sbin/drbdadm after-resync-target minor-2&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd0: helper command: /sbin/drbdadm before-resync-target minor-0 exit code 0 (0x0)&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd0: conn( WFSyncUUID -&amp;gt; SyncTarget ) disk( Outdated -&amp;gt; Inconsistent ) &lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd0: Began resync as SyncTarget (will sync 0 KB [0 bits set]).&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd0: Resync done (total 1 sec; paused 0 sec; 0 K/sec)&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd0: conn( SyncTarget -&amp;gt; Connected ) disk( Inconsistent -&amp;gt; UpToDate ) &lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd0: helper command: /sbin/drbdadm after-resync-target minor-0&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd2: helper command: /sbin/drbdadm after-resync-target minor-2 exit code 0 (0x0)&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd0: helper command: /sbin/drbdadm after-resync-target minor-0 exit code 0 (0x0)&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd3: conn( WFBitMapT -&amp;gt; WFSyncUUID ) &lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd1: Connected in w_make_resync_request&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd2: Connected in w_make_resync_request&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd3: helper command: /sbin/drbdadm before-resync-target minor-3&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd3: helper command: /sbin/drbdadm before-resync-target minor-3 exit code 0 (0x0)&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd3: conn( WFSyncUUID -&amp;gt; SyncTarget ) disk( Outdated -&amp;gt; Inconsistent ) &lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd3: Began resync as SyncTarget (will sync 0 KB [0 bits set]).&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd3: Resync done (total 1 sec; paused 0 sec; 0 K/sec)&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd3: conn( SyncTarget -&amp;gt; Connected ) disk( Inconsistent -&amp;gt; UpToDate ) &lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd3: helper command: /sbin/drbdadm after-resync-target minor-3&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd3: helper command: /sbin/drbdadm after-resync-target minor-3 exit code 0 (0x0)&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd0: Connected in w_make_resync_request&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd1: role( Secondary -&amp;gt; Primary ) &lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd3: Connected in w_make_resync_request&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd2: role( Secondary -&amp;gt; Primary ) &lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd3: role( Secondary -&amp;gt; Primary ) &lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd0: peer( Secondary -&amp;gt; Primary ) &lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd1: peer( Secondary -&amp;gt; Primary ) &lt;br /&gt;
May  7 23:29:26 an-node04 kernel: block drbd2: peer( Secondary -&amp;gt; Primary ) &lt;br /&gt;
May  7 23:29:26 an-node04 kernel: block drbd3: peer( Secondary -&amp;gt; Primary ) &lt;br /&gt;
May  7 23:29:26 an-node04 clvmd: Cluster LVM daemon started - connected to CMAN&lt;br /&gt;
May  7 23:29:27 an-node04 kernel: GFS2: fsid=: Trying to join cluster &amp;quot;lock_dlm&amp;quot;, &amp;quot;an-cluster01:xen_shared&amp;quot;&lt;br /&gt;
May  7 23:29:27 an-node04 kernel: GFS2: fsid=an-cluster01:xen_shared.0: Joined cluster. Now mounting FS...&lt;br /&gt;
May  7 23:29:27 an-node04 kernel: GFS2: fsid=an-cluster01:xen_shared.0: jid=0, already locked for use&lt;br /&gt;
May  7 23:29:27 an-node04 kernel: GFS2: fsid=an-cluster01:xen_shared.0: jid=0: Looking at journal...&lt;br /&gt;
May  7 23:29:27 an-node04 kernel: GFS2: fsid=an-cluster01:xen_shared.0: jid=0: Done&lt;br /&gt;
May  7 23:29:27 an-node04 kernel: GFS2: fsid=an-cluster01:xen_shared.0: jid=1: Trying to acquire journal lock...&lt;br /&gt;
May  7 23:29:27 an-node04 kernel: GFS2: fsid=an-cluster01:xen_shared.0: jid=1: Looking at journal...&lt;br /&gt;
May  7 23:29:27 an-node04 kernel: GFS2: fsid=an-cluster01:xen_shared.0: jid=1: Done&lt;br /&gt;
May  7 23:29:28 an-node04 clurgmgrd[12067]: &amp;lt;notice&amp;gt; Service service:an4_storage started &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here is what we&#039;re seeing:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clurgmgrd&amp;lt;/span&amp;gt;, the cluster &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; daemon, take the request to start the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an4_storage&amp;lt;/span&amp;gt; service.&lt;br /&gt;
* This is immediately followed by a lot of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;drbd&amp;lt;/span&amp;gt; messages showing the attachment, connection and promotion of the DRBD resources.&lt;br /&gt;
* Once the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;drbd&amp;lt;/span&amp;gt; daemon reported that it was up, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clurgmgrd&amp;lt;/span&amp;gt; started the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clvmd&amp;lt;/span&amp;gt; daemon.&lt;br /&gt;
* Next we see the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;gfs2&amp;lt;/span&amp;gt; initialization script start up.&lt;br /&gt;
* Once this last daemon returns, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clurgmgrd&amp;lt;/span&amp;gt; reports that the service started successfully.&lt;br /&gt;
&lt;br /&gt;
Now you can check &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; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;gfs2&amp;lt;/span&amp;gt; again and you will see that they are all online.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/drbd 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;
drbd driver loaded OK; device status:&lt;br /&gt;
version: 8.3.8 (api:88/proto:86-94)&lt;br /&gt;
GIT-hash: d78846e52224fd00562f7c225bcc25b2d422321d build by mockbuild@builder10.centos.org, 2010-06-04 08:04:27&lt;br /&gt;
m:res  cs         ro               ds                 p  mounted  fstype&lt;br /&gt;
0:r0   Connected  Primary/Primary  UpToDate/UpToDate  C&lt;br /&gt;
1:r1   Connected  Primary/Primary  UpToDate/UpToDate  C&lt;br /&gt;
2:r2   Connected  Primary/Primary  UpToDate/UpToDate  C&lt;br /&gt;
3:r3   Connected  Primary/Primary  UpToDate/UpToDate  C&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;
/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 (pid  14700) is running...&lt;br /&gt;
Clustered Volume Groups: drbd_an5_vg0 drbd_an4_vg0 drbd_sh0_vg0&lt;br /&gt;
Active clustered Logical Volumes: /dev/drbd_sh0_vg0/xen_shared&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;
/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;
/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, let&#039;s check &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clustat&amp;lt;/span&amp;gt; again and we&#039;ll see that the services are online.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
clustat&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Cluster Status for an-cluster01 @ Sat May  7 23:35:03 2011&lt;br /&gt;
Member Status: Quorate&lt;br /&gt;
&lt;br /&gt;
 Member Name                             ID   Status&lt;br /&gt;
 ------ ----                             ---- ------&lt;br /&gt;
 an-node04.alteeve.com                       1 Online, Local, rgmanager&lt;br /&gt;
 an-node05.alteeve.com                       2 Online, rgmanager&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State         &lt;br /&gt;
 ------- ----                   ----- ------                   -----         &lt;br /&gt;
 service:an4_storage            an-node04.alteeve.com          started       &lt;br /&gt;
 service:an5_storage            an-node05.alteeve.com          started       &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Hoozah!&lt;br /&gt;
&lt;br /&gt;
=== Stopping Clustered Services ===&lt;br /&gt;
&lt;br /&gt;
With the services we&#039;ve created, it&#039;s actually pretty simple to shut things down. Simply stopping &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; on each node will stop the services and, as they&#039;re not able to fail over, the services will stay offline. This can lead to bad habits though. So, to get into the proper habit, let&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;lock&amp;lt;/span&amp;gt; then &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;disable&amp;lt;/span&amp;gt; the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an5_storage&amp;lt;/span&amp;gt; service and then shutdown &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt;&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
clusvcadm -l service:an5_storage -m an-node05.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;
Resource groups locked&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;
clusvcadm -d service:an5_storage -m an-node05.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;
Member an-node05.alteeve.com disabling service:an5_storage...Success&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now when you try to run &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clustat&amp;lt;/span&amp;gt;, you can see that the service on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt; is disabled.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
clustat&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Cluster Status for an-cluster01 @ Sat May  7 23:43:10 2011&lt;br /&gt;
Member Status: Quorate&lt;br /&gt;
&lt;br /&gt;
 Member Name                             ID   Status&lt;br /&gt;
 ------ ----                             ---- ------&lt;br /&gt;
 an-node04.alteeve.com                       1 Online, rgmanager&lt;br /&gt;
 an-node05.alteeve.com                       2 Online, Local, rgmanager&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State         &lt;br /&gt;
 ------- ----                   ----- ------                   -----         &lt;br /&gt;
 service:an4_storage            an-node04.alteeve.com          started       &lt;br /&gt;
 service:an5_storage            (an-node05.alteeve.com)        disabled      &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we can shutdown &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; proper.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/rgmanager 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;
Shutting down Cluster Service Manager...&lt;br /&gt;
Waiting for services to stop:                              [  OK  ]&lt;br /&gt;
Cluster Service Manager is stopped.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clustat&amp;lt;/span&amp;gt; will not show any services at all when run from &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt;&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
clustat&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Cluster Status for an-cluster01 @ Sat May  7 23:57:55 2011&lt;br /&gt;
Member Status: Quorate&lt;br /&gt;
&lt;br /&gt;
 Member Name                             ID   Status&lt;br /&gt;
 ------ ----                             ---- ------&lt;br /&gt;
 an-node04.alteeve.com                       1 Online&lt;br /&gt;
 an-node05.alteeve.com                       2 Online, Local&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can still see both services from &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt; though.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt;&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
clustat&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Cluster Status for an-cluster01 @ Sat May  7 23:43:43 2011&lt;br /&gt;
Member Status: Quorate&lt;br /&gt;
&lt;br /&gt;
 Member Name                             ID   Status&lt;br /&gt;
 ------ ----                             ---- ------&lt;br /&gt;
 an-node04.alteeve.com                       1 Online, Local, rgmanager&lt;br /&gt;
 an-node05.alteeve.com                       2 Online&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State         &lt;br /&gt;
 ------- ----                   ----- ------                   -----         &lt;br /&gt;
 service:an4_storage            an-node04.alteeve.com          started       &lt;br /&gt;
 service:an5_storage            (an-node05.alteeve.com)        disabled      &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{note|1=You may notice that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; is no longer showing to the right of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05.alteeve.com&amp;lt;/span&amp;gt;. This indicates that the other node&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; daemon has stopped.}}&lt;br /&gt;
&lt;br /&gt;
Now we can go back to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt; and completely shut down the cluster.&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;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Stopping cluster: &lt;br /&gt;
   Stopping fencing... done&lt;br /&gt;
   Stopping cman... done&lt;br /&gt;
   Stopping ccsd... done&lt;br /&gt;
   Unmounting configfs... done&lt;br /&gt;
                                                           [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can check on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt; and see that the cluster is now down to just itself.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cman_tool 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;
Version: 6.2.0&lt;br /&gt;
Config Version: 13&lt;br /&gt;
Cluster Name: an-cluster01&lt;br /&gt;
Cluster Id: 60257&lt;br /&gt;
Cluster Member: Yes&lt;br /&gt;
Cluster Generation: 144&lt;br /&gt;
Membership state: Cluster-Member&lt;br /&gt;
Nodes: 1&lt;br /&gt;
Expected votes: 1&lt;br /&gt;
Total votes: 1&lt;br /&gt;
Quorum: 1  &lt;br /&gt;
Active subsystems: 9&lt;br /&gt;
Flags: 2node Dirty &lt;br /&gt;
Ports Bound: 0 11 177  &lt;br /&gt;
Node name: an-node04.alteeve.com&lt;br /&gt;
Node ID: 1&lt;br /&gt;
Multicast addresses: 239.192.235.77 &lt;br /&gt;
Node addresses: 192.168.3.74 &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At this point, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt; is totally out of the cluster and, if you wanted, you could perform any maintenance you might want to do. More on that later though.&lt;br /&gt;
&lt;br /&gt;
= Provisioning Our Virtual Servers =&lt;br /&gt;
&lt;br /&gt;
Finally, the goal of this cluster is in sight!&lt;br /&gt;
&lt;br /&gt;
We have two steps left;&lt;br /&gt;
* Provision our VMs.&lt;br /&gt;
* Add the VMs to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Provisioning&amp;quot; a virtual machine simple means to create it. This tutorial is more about clustering than Xen and virtual machine administration, so some liberties will be taken with regard to your knowledge of Xen. We&#039;ll cover all of the steps needed to provision and manage the VMs, but there will not be an in-depth discussion of the tools and their various uses.&lt;br /&gt;
&lt;br /&gt;
Please, if you are totally unfamiliar with [[Xen]], take a few minutes to review some tutorials:&lt;br /&gt;
&lt;br /&gt;
{{note|1=We are using Xen v3.0, heavily patched to be almost the same as 3.1. At the time of writing, the latest is v4.1. Please take not of the version when reading the tutorials below.}}&lt;br /&gt;
&lt;br /&gt;
* [[Networking in Xen 3.x]]; A brief overview of how networking works in our cluster.&lt;br /&gt;
* [http://wiki.xen.org/xenwiki/XenOverview Xen Overview]; Four useful [[PDF]]s in this link.&lt;br /&gt;
* [http://wiki.xen.org/xenwiki/XenFaq Xen FAQ]&lt;br /&gt;
* [http://wiki.xen.org/xenwiki/XenDocs Xen Documentation]; Includes v3 User Manual.&lt;br /&gt;
* [http://wiki.xen.org/xenwiki/HowTos Xen HowTos]; The Xen [http://wiki.xen.org/xenwiki/XenNetworking Networking] section may be particularly helpful.&lt;br /&gt;
* [http://wiki.xen.org/xenwiki/XenManagementTools Xen Management Tools]; Covers &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-manager&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;libvirtd&amp;lt;/span&amp;gt;.&lt;br /&gt;
* [http://wiki.xen.org/xenwiki/XenCommonProblems Xen Common Problems]; Somewhere between an FAQ and a troubleshooting guide.&lt;br /&gt;
&lt;br /&gt;
== Starting libvirtd On The Nodes ==&lt;br /&gt;
&lt;br /&gt;
In the following steps, we will be using a program called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virsh&amp;lt;/span&amp;gt; on the nodes and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-manager&amp;lt;/span&amp;gt; on our workstations to view the VMs. For this, we need to make sure that the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;libvirtd&amp;lt;/span&amp;gt; daemon is running on each node first. This ties in to the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;(xend-unix-server yes)&amp;lt;/span&amp;gt; value we changed in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/xen/xend-config.sxp&amp;lt;/span&amp;gt; file we set earlier, you may recall.&lt;br /&gt;
&lt;br /&gt;
Lets start the daemon now as we&#039;re going to use it very shortly.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On Both Nodes&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/libvirtd 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 libvirtd daemon:                                  [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To start &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;libvirtd&amp;lt;/span&amp;gt; on boot, run the command below.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;On Both Nodes&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
chkconfig libvirtd on&lt;br /&gt;
chkconfig --list libvirtd&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
libvirtd       	0:off	1:off	2:on	3:on	4:on	5:on	6:off&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Accessing The VMs ==&lt;br /&gt;
&lt;br /&gt;
The virtual servers we are going to create are, by definition, &amp;quot;headless&amp;quot;. There is no monitor or place to plug in a keyboard.&lt;br /&gt;
&lt;br /&gt;
The main way that you will monitor the virtual servers is through [[VNC]]. If you are running a relatively recent version of Linux on your workstation, there is a fantastic little program for connecting to and monitoring the VMs on multiple nodes using multiple [[hypervisor]]s called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-manager&amp;lt;/span&amp;gt;. It is available under many Linux distribution&#039;s package managers under the same name. &lt;br /&gt;
&lt;br /&gt;
In Fedora, [[EL]] 5 and 6 and many other [[RPM]] based distributions, you can install &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-manager&amp;lt;/span&amp;gt; on your workstation with the following command.&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;
You can then find &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-manager&amp;lt;/span&amp;gt; on you &#039;&#039;System Tools&#039;&#039; -&amp;gt; &#039;&#039;Virtual Machine Manager&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
To establish a connection to the nodes, click on &#039;&#039;File&#039;&#039; -&amp;gt; &#039;&#039;Add Connection...&#039;&#039;. Change the &#039;&#039;Hypervisor&#039;&#039; selection bar to &#039;&#039;&#039;Xen&#039;&#039;&#039;, check to select &#039;&#039;Connect to remote host&#039;&#039;, leave the default &#039;&#039;Method&#039;&#039; as &#039;&#039;&#039;SSH&#039;&#039;&#039; and &#039;&#039;Username&#039;&#039; as &#039;&#039;&#039;root&#039;&#039;&#039;. Then enter the host name or IP address of each node in the &#039;&#039;Hostname&#039;&#039; field. I always add cluster nodes to my &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/hosts&amp;lt;/span&amp;gt; file so that I can simply enter &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt;. How you handle this is up to you and your preferences.&lt;br /&gt;
&lt;br /&gt;
[[Image:virt-manager_fedora-14_01.png|thumb|340px|center|Adding a connection to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-manager&amp;lt;/span&amp;gt; on Fedora 14.]]&lt;br /&gt;
&lt;br /&gt;
Once both nodes are added, you should see that there is already a &#039;&#039;Domain-0&#039;&#039; entry. This is because, as we discussed earlier, even the &amp;quot;host&amp;quot; OS is itself a virtual machine.&lt;br /&gt;
&lt;br /&gt;
[[Image:virt-manager_fedora-14_02.png|thumb|484px|center|A view of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-manager&amp;lt;/span&amp;gt; on Fedora 14.]]&lt;br /&gt;
&lt;br /&gt;
== Limiting dom0&#039;s RAM Use ==&lt;br /&gt;
&lt;br /&gt;
Normally, [[dom0]] will claim and use memory not allocated to virtual machines. This can cause trouble if, for example, you&#039;ve migrated a [[VM]] off of a node and then want to move it or another VM back shortly after. For a period of time, dom0 will claim that there is not enough free memory for the migration. By setting a hard limit of dom0&#039;s memory usage, this scenario won&#039;t happen and you will not need to delay migrations.&lt;br /&gt;
&lt;br /&gt;
To do this, add &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;dom0_mem=1024M&amp;lt;/span&amp;gt; to the Xen kernel image&#039;s first &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;module&amp;lt;/span&amp;gt; line in [[grub]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /boot/grub/grub.conf /boot/grub/grub.conf.orig&lt;br /&gt;
vim /boot/grub/grub.conf&lt;br /&gt;
diff -u /boot/grub/grub.conf.orig /boot/grub/grub.conf&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;diff&amp;quot;&amp;gt;&lt;br /&gt;
--- /boot/grub/grub.conf.orig	2011-05-10 22:49:09.000000000 -0400&lt;br /&gt;
+++ /boot/grub/grub.conf	2011-05-10 22:54:57.000000000 -0400&lt;br /&gt;
@@ -14,11 +14,11 @@&lt;br /&gt;
 title CentOS (2.6.18-238.9.1.el5xen)&lt;br /&gt;
 	root (hd0,0)&lt;br /&gt;
 	kernel /xen.gz-2.6.18-238.9.1.el5&lt;br /&gt;
-	module /vmlinuz-2.6.18-238.9.1.el5xen ro root=LABEL=/&lt;br /&gt;
+	module /vmlinuz-2.6.18-238.9.1.el5xen ro root=LABEL=/ dom0_mem=1024M&lt;br /&gt;
 	module /initrd-2.6.18-238.9.1.el5xen.img&lt;br /&gt;
 title CentOS (2.6.18-238.9.1.el5)&lt;br /&gt;
 	root (hd0,0)&lt;br /&gt;
-	kernel /vmlinuz-2.6.18-238.9.1.el5 ro root=LABEL=/&lt;br /&gt;
+	kernel /vmlinuz-2.6.18-238.9.1.el5 ro root=LABEL=/ dom0_mem=1024M&lt;br /&gt;
 	initrd /initrd-2.6.18-238.9.1.el5.img&lt;br /&gt;
 title CentOS (2.6.18-238.el5xen)&lt;br /&gt;
 	root (hd0,0)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can change &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;1024M&amp;lt;/span&amp;gt; with the amount of RAM you want to allocate to dom0.&lt;br /&gt;
&lt;br /&gt;
{{warning|1=If you update your kernel, ensure that this kernel argument was added to the new kernel&#039;s argument list.}}&lt;br /&gt;
&lt;br /&gt;
== Our planned layout ==&lt;br /&gt;
&lt;br /&gt;
At this stage, what you will want to run is almost certainly going to be unique to you, so we will not be going into detail about what each VM does. We will cover provisioning them, manipulating them and what not. The description of the VMs is purely an example of what they might be.&lt;br /&gt;
&lt;br /&gt;
We will be creating two virtual servers.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0001_ws1&amp;lt;/span&amp;gt;; A [[CentOS]] server hosting a website.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0002_win1&amp;lt;/span&amp;gt;; A [[Microsoft]] Windows server, showing how to host non-Linux virtual machines.&lt;br /&gt;
&lt;br /&gt;
We&#039;ll assign &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0001_ws1&amp;lt;/span&amp;gt; to normally run on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0002_win1&amp;lt;/span&amp;gt; to normally run on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Before we talk about resources, there is something you must be aware of. &lt;br /&gt;
* You can have more virtual machines than CPU cores. That is, machines can share core. It&#039;s advisable to dedicate one core to just the [[dom0]] machine.&lt;br /&gt;
* RAM on dom0 and all domU VMs must not exceed the maximum amount of RAM available in a given node.&lt;br /&gt;
&lt;br /&gt;
{{warning|1=You &#039;&#039;must&#039;&#039; consider how your collection of virtual servers will run when only on node is available. As I have 4 [[GiB]] of RAM in each node, I will assign 1 [[GiB]] to dom0 and then 1 [[GiB]] to each VM, leaving 1 GiB for future expansion. How you divvy up your memory and CPU cores is ultimately up to you.}}&lt;br /&gt;
&lt;br /&gt;
So here are our two planned virtual servers, laid out in a table. Doing this before provisioning can help you visualize how your cluster&#039;s resources will be consumed, helping to ensure that you don&#039;t use too much, which is of particular note on very large installations. It&#039;s also very useful for planning your virtual machine provisioning commands in the next step.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
!&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0001_ws1&amp;lt;/span&amp;gt;&lt;br /&gt;
!&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0002_win1&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Primary Host&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!RAM&lt;br /&gt;
|1024[[MiB]]&lt;br /&gt;
|1024[[MiB]]&lt;br /&gt;
|-&lt;br /&gt;
!Storage&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/drbd_an4_vg0/vm0001_1&amp;lt;/span&amp;gt;, 50 [[GB]]&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/drbd_an5_vg0/vm0002_1&amp;lt;/span&amp;gt;, 100 [[GB]] (100%)&lt;br /&gt;
|-&lt;br /&gt;
!Network(s)&lt;br /&gt;
|IFN &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xenbr0&amp;lt;/span&amp;gt;, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;192.168.1.200&amp;lt;/span&amp;gt;/&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;255.255.255.0&amp;lt;/span&amp;gt;&lt;br /&gt;
|BCN &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xenbr0&amp;lt;/span&amp;gt;, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;192.168.1.201&amp;lt;/span&amp;gt;/&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;255.255.255.0&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Source Files&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;http://192.168.1.254/c5/x86_64/img&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/xen_shared/iso/Win_Server_2008_Bis_x86_64.iso&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Kickstart Script&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;http://192.168.1.254/c5/x86_64/ks/generic_c5.ks&amp;lt;/span&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{{warning|1=There are issues with installing VMs from [[ISO]] images. For this reason, you are advised to make the installation images available over a web server. A great way to do this is by creating a [[Setting Up a PXE Server in Fedora|PXE server]] on your network. Then you can point to it&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;img&amp;lt;/span&amp;gt; directory when running the VM installs. This tutorial assumes this is available.}}&lt;br /&gt;
&lt;br /&gt;
=== Provisioning vm0001_ws1; A Webserver ===&lt;br /&gt;
&lt;br /&gt;
So let&#039;s start with a basic web server. &lt;br /&gt;
&lt;br /&gt;
Provisioning VMs requires two steps;&lt;br /&gt;
* Creating a logical volume on the clustered LVM.&lt;br /&gt;
* Craft and execute a &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-install&amp;lt;/span&amp;gt; command.&lt;br /&gt;
&lt;br /&gt;
Before you proceed, you need to know where the installation image files are found. This tutorial uses a [[Setting Up a PXE Server in Fedora|PXE server]], so we&#039;ll be telling &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-install&amp;lt;/span&amp;gt; to pull the installation files and [[kickstart]] scripts off of it&#039;s web server. If you don&#039;t have a PXE server, simply mounting the installation image&#039;s ISO and making that available through a trivial webserver setup will be fine. How you do this, exactly, is outside the scope of this tutorial. However, there is a separate, detailed configuration tutorial for setting up a [[Setting Up a PXE Server in Fedora|PXE server]] which covers a basic [[apache]] configuration.&lt;br /&gt;
&lt;br /&gt;
Create the [[LV]] for the VM on the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/drbd_an4_vg0&amp;lt;/span&amp;gt; [[VG]], as it will primarily run on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&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;
lvcreate -L 50G -n vm0001_1 --addtag @an-cluster01 /dev/drbd_an4_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;vm0001_1&amp;quot; created&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{note|1=The example below uses the following kickstart file. Please adapt it for your use.&amp;lt;br /&amp;gt;&lt;br /&gt;
* [[generic_c5.ks]]}}&lt;br /&gt;
&lt;br /&gt;
Now, the long &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-install&amp;lt;/span&amp;gt; command to provision the VM. Let&#039;s look at it, then we&#039;ll discuss it.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
virt-install --connect xen \&lt;br /&gt;
	--name vm0001_ws1 \&lt;br /&gt;
	--ram 1048 \&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.254/c5/x86_64/img \&lt;br /&gt;
	--extra-args &amp;quot;ks=http://192.168.1.254/c5/x86_64/ks/generic_c5.ks&amp;quot; \&lt;br /&gt;
	--os-type linux \&lt;br /&gt;
	--os-variant rhel5.4 \&lt;br /&gt;
	--disk path=/dev/drbd_an4_vg0/vm0001_1 \&lt;br /&gt;
	--network bridge=xenbr0 \&lt;br /&gt;
	--vnc \&lt;br /&gt;
	--paravirt&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{note|1=If you wanted to provision a VM to act as a firewall, or for other reasons wanted a VM to access the back-channel, you could connect to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xenbr2&amp;lt;/span&amp;gt; by simply adding a second &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--network bridge=xenbr2&amp;lt;/span&amp;gt; argument.}}&lt;br /&gt;
&lt;br /&gt;
The [[man]] page for &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-install&amp;lt;/span&amp;gt; covers all of the options you can pass in good detail. We&#039;re going to discuss now the options used here, but it will only be a subset of options that you may wish to use. Please take the time to read &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;man virt-install&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--connect xen&amp;lt;/span&amp;gt;; Tells &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-install&amp;lt;/span&amp;gt; that we are provisioning a Xen [[domU]] VM.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--name vm0001_ws1&amp;lt;/span&amp;gt;; Tells &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-install&amp;lt;/span&amp;gt; to give the VM the name &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0001_ws1&amp;lt;/span&amp;gt;. This can be anything you please, but it &#039;&#039;&#039;must&#039;&#039;&#039; be unique in the cluster. Personally, I like the format &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm####_desc&amp;lt;/span&amp;gt;, where &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;####&amp;lt;/span&amp;gt; is a sequence number to ensure uniqueness and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;desc&amp;lt;/span&amp;gt; is a human-readable, short description of the VM. Please use whatever naming convention you find comfortable.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--ram 1024&amp;lt;/span&amp;gt;; This is the number of [[MiB]] to allocate to the VM. This can be adjusted post-install.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--arch x86_64&amp;lt;/span&amp;gt;; This tells &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-install&amp;lt;/span&amp;gt; to emulate a 64[[bit]] CPU/environment.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;-- vcpus 1&amp;lt;/span&amp;gt;; This controls how many CPU cores to allocate to this VM. This can not exceed the real number of CPUs, and should be &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;n-1&amp;lt;/span&amp;gt; at most, to ensure that [[dom0]] gets sole access to core 0. This can be adjusted post-install.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--cpuset 1&amp;lt;/span&amp;gt;; This tells &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;libvirt&amp;lt;/span&amp;gt; which cores it is allowed to use for this VM. This node has four cores, with CPU &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;0&amp;lt;/span&amp;gt; being pinned to [[dom0]]. So we will tell Xen to let this node use any free CPU between &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;1-3&amp;lt;/span&amp;gt; (the second, third and fourth cores). This can be a comma-separated list of value, and values can use hyphens for ranges. For example, if you have eight cores, you may specify &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--cpuset 1-7&amp;lt;/span&amp;gt; or &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--cpuset 1,3,5-7&amp;lt;/span&amp;gt;.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--location http://192.168.1.254/c5/x86_64/img&amp;lt;/span&amp;gt;; This tells the OS&#039; installer to look for installation files under the passed URL. The installation files could be local to the node (ie: with a loop-back mounted ISO), on an [[NFS]] share or over [[FTP]]. This option can be replaced with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--pxe&amp;lt;/span&amp;gt; for [[PXE]] server installs, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--import&amp;lt;/span&amp;gt; for skipping an installation and directly importing a VM image or &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--livecd&amp;lt;/span&amp;gt; for running up a live CD/DVD.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--extra-args &amp;quot;ks=http://192.168.1.254/c5/x86_64/ks/generic_c5.ks&amp;quot;&amp;lt;/span&amp;gt;; This allows us to pass special arguments to the installer&#039;s kernel. In this case, we&#039;re telling the installer to use the [[kickstart]] file at the given location. Optionally, we could have used &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--extra-args &amp;quot;ks=http://192.168.1.254/c5/x86_64/ks/generic_c5.ks ksdevice=eth0&amp;quot;&amp;lt;/span&amp;gt; to specify which interface to use when looking for the defined kickstart file. I generally avoid this as it is rather difficult to predict with physical interface will get what &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ethX&amp;lt;/span&amp;gt; name.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--os-type linux&amp;lt;/span&amp;gt;; This controls some internal optimization within Xen for handling Linux operating systems.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--os-variant rhel5.4&amp;lt;/span&amp;gt;; This further optimizes Xen for use with [[EL5]].4 (and newer) based operating systems. When this option is used, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--os-type&amp;lt;/span&amp;gt; is not strictly needed. The various supported &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--os-type&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--os-variant&amp;lt;/span&amp;gt; are found in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;man virt-install&amp;lt;/span&amp;gt;.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--disk path=/dev/drbd_an4_vg0/vm0001_1&amp;lt;/span&amp;gt;; This tells the installer to allocate the [[LV]] we just created as this VM&#039;s hard drive. There are &#039;&#039;many&#039;&#039; options for using storage for VMs, please see &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;man virt-install&amp;lt;/span&amp;gt;.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--network bridge=xenbr0&amp;lt;/span&amp;gt;; This, and the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xenbr2&amp;lt;/span&amp;gt; following it, tells &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-install&amp;lt;/span&amp;gt; to connect this VM to those two bridges. Note that inside the VM, these will show up as &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;eth1&amp;lt;/span&amp;gt;.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--vnc&amp;lt;/span&amp;gt;; This tells the VM to setup and export a VNC server. This is how we will connect to and monitor the installation of the VM.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--paravirt&amp;lt;/span&amp;gt;; This tells &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-install&amp;lt;/span&amp;gt; that we will be creating a [[paravirtual]] VM. The other option is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--hvm&amp;lt;/span&amp;gt; which specifies full virtualization.&lt;br /&gt;
&lt;br /&gt;
If things went well, you should now see you VM begin to install!&lt;br /&gt;
&lt;br /&gt;
[[Image:xen_vm0001_ws1_install_01.png|thumb|700px|center|Installation of a kickstart-based text install of CentOS 5.6 as a Xen VM.]]&lt;br /&gt;
&lt;br /&gt;
Once your VM is installed, we&#039;ll want to dump it&#039;s configuration to an [[XML]] file. This way, should the VM be accidentally undefined, we can easily redefine it. In fact, we have to define this VM on the second node to enable migration, but we&#039;ll go into details about migration later. For now though, run the following &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virsh&amp;lt;/span&amp;gt; command to write the VM&#039;s definition information to an XML file on the shared GFS2 partition. Putting it there will make is accessible to both nodes.&lt;br /&gt;
&lt;br /&gt;
{{warning|1=Do &#039;&#039;&#039;not&#039;&#039;&#039; bother dumping the configuration to an XML file until &#039;&#039;after&#039;&#039; the OS is fully installed and has rebooted. The configuration will contain arguments specific to the installation that will cause problem if used after the install is completed.}}&lt;br /&gt;
&lt;br /&gt;
Personally, I like to keep the configuration files in a subdirectory on the GFS2 share, then copy them to the local node&#039;s storage, just to be safe. Given that this is our first VM, we&#039;ll create a directory for the definition files now called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;definitions&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt;&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
mkdir /xen_shared/definitions&lt;br /&gt;
virsh dumpxml vm0001_ws1 &amp;gt; /xen_shared/definitions/vm0001_ws1.xml&lt;br /&gt;
cat /xen_shared/definitions/vm0001_ws1.xml&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;domain type=&#039;xen&#039;&amp;gt;&lt;br /&gt;
  &amp;lt;name&amp;gt;vm0001_ws1&amp;lt;/name&amp;gt;&lt;br /&gt;
  &amp;lt;uuid&amp;gt;d01c03da-8054-6590-37fd-5410c6b1a953&amp;lt;/uuid&amp;gt;&lt;br /&gt;
  &amp;lt;memory&amp;gt;1073152&amp;lt;/memory&amp;gt;&lt;br /&gt;
  &amp;lt;currentMemory&amp;gt;1073152&amp;lt;/currentMemory&amp;gt;&lt;br /&gt;
  &amp;lt;vcpu cpuset=&#039;1-3&#039;&amp;gt;1&amp;lt;/vcpu&amp;gt;&lt;br /&gt;
  &amp;lt;bootloader&amp;gt;/usr/bin/pygrub&amp;lt;/bootloader&amp;gt;&lt;br /&gt;
  &amp;lt;os&amp;gt;&lt;br /&gt;
    &amp;lt;type arch=&#039;x86_64&#039; machine=&#039;xenpv&#039;&amp;gt;linux&amp;lt;/type&amp;gt;&lt;br /&gt;
  &amp;lt;/os&amp;gt;&lt;br /&gt;
  &amp;lt;clock offset=&#039;utc&#039;/&amp;gt;&lt;br /&gt;
  &amp;lt;on_poweroff&amp;gt;destroy&amp;lt;/on_poweroff&amp;gt;&lt;br /&gt;
  &amp;lt;on_reboot&amp;gt;restart&amp;lt;/on_reboot&amp;gt;&lt;br /&gt;
  &amp;lt;on_crash&amp;gt;restart&amp;lt;/on_crash&amp;gt;&lt;br /&gt;
  &amp;lt;devices&amp;gt;&lt;br /&gt;
    &amp;lt;disk type=&#039;block&#039; device=&#039;disk&#039;&amp;gt;&lt;br /&gt;
      &amp;lt;driver name=&#039;phy&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;source dev=&#039;/dev/drbd_an4_vg0/vm0001_1&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;target dev=&#039;xvda&#039; bus=&#039;xen&#039;/&amp;gt;&lt;br /&gt;
    &amp;lt;/disk&amp;gt;&lt;br /&gt;
    &amp;lt;interface type=&#039;bridge&#039;&amp;gt;&lt;br /&gt;
      &amp;lt;mac address=&#039;00:16:36:05:6b:8c&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;source bridge=&#039;xenbr0&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;script path=&#039;vif-bridge&#039;/&amp;gt;&lt;br /&gt;
    &amp;lt;/interface&amp;gt;&lt;br /&gt;
    &amp;lt;console type=&#039;pty&#039;&amp;gt;&lt;br /&gt;
      &amp;lt;target port=&#039;0&#039;/&amp;gt;&lt;br /&gt;
    &amp;lt;/console&amp;gt;&lt;br /&gt;
    &amp;lt;input type=&#039;mouse&#039; bus=&#039;xen&#039;/&amp;gt;&lt;br /&gt;
    &amp;lt;graphics type=&#039;vnc&#039; port=&#039;-1&#039; autoport=&#039;yes&#039; keymap=&#039;en-us&#039;/&amp;gt;&lt;br /&gt;
  &amp;lt;/devices&amp;gt;&lt;br /&gt;
&amp;lt;/domain&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On Both Nodes&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
rsync -av /xen_shared/definitions ~/&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
definitions/&lt;br /&gt;
definitions/vm0001_ws1.xml&lt;br /&gt;
&lt;br /&gt;
sent 1085 bytes  received 48 bytes  755.33 bytes/sec&lt;br /&gt;
total size is 953  speedup is 0.84&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The benefit of having backups on the local storage is to protect these rarely changing but critical files in case anything ever corrupted the shared storage. We&#039;ve gone to great lengths to avoid this, but it&#039;s always possible and this is a simple precaution.&lt;br /&gt;
&lt;br /&gt;
==== Reconnecting to the VM ====&lt;br /&gt;
&lt;br /&gt;
After the install finishes, or after you close the initial minimal VNC viewer, you will need to manually reconnect to the VM. This is where &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-manager&amp;lt;/span&amp;gt; comes in so handy! &lt;br /&gt;
&lt;br /&gt;
Start it back up and double-click on the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt; host. You will now see the new &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0001_fw1&amp;lt;/span&amp;gt; VM. Double-click on it and you will be right back on the VM.&lt;br /&gt;
&lt;br /&gt;
[[Image:virt-manager_fedora-14_03.png|thumb|700px|center|A view of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-manager&amp;lt;/span&amp;gt; used to connect to the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0001_ws1&amp;lt;/span&amp;gt; VM.]]&lt;br /&gt;
&lt;br /&gt;
Pretty cool, eh!&lt;br /&gt;
&lt;br /&gt;
==== How to Stop, Define and Start the VM ====&lt;br /&gt;
&lt;br /&gt;
To stop the VM, you can connect to it as a remote server and shut it down as you would a normal VM.&lt;br /&gt;
&lt;br /&gt;
If you want to initial a clean shut down from the host node, you can use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virsh&amp;lt;/span&amp;gt; to initial a shutdown over [[ACPI]], same as if you tapped the power button on a physical server.&lt;br /&gt;
&lt;br /&gt;
Make sure the VM is on the node:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
virsh list --all&lt;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 Name                 State&lt;br /&gt;
----------------------------------&lt;br /&gt;
  0 Domain-0             running&lt;br /&gt;
  2 vm0001_ws1           idle&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell it to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;shutdown&amp;lt;/span&amp;gt;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
virsh shutdown vm0001_ws1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Domain vm0001_ws1 is being shutdown&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you had a VNC session running, you will see the VM start to gracefully shutdown.&lt;br /&gt;
&lt;br /&gt;
[[Image:xen3_vm_graceful_shutdown_1.png|thumb|center|700px|Gracefully shutting down the firewall VM via &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virsh shutdown vm0001_ws1&amp;lt;/span&amp;gt;.]]&lt;br /&gt;
&lt;br /&gt;
After a few moments, the VM should shut down. You can confirm this by again running &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virsh list --all&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;
virsh list --all&lt;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 Name                 State&lt;br /&gt;
----------------------------------&lt;br /&gt;
  0 Domain-0             running&lt;br /&gt;
  - vm0001_ws1           shut off&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Remember how we dumped this VM&#039;s configuration to an XML file on the GFS2 partition earlier? We&#039;re now going to use that to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;define&amp;lt;/span&amp;gt; the VM on the other node, then we&#039;ll start it up over there, too.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt;&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
Check that the VM isn&#039;t known by &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&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;
virsh list --all&lt;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 Name                 State&lt;br /&gt;
----------------------------------&lt;br /&gt;
  0 Domain-0             running&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It&#039;s not there, as expect. So now we&#039;ll use the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/xen_shared/definitions/vm0001_ws1.xml&amp;lt;/span&amp;gt; file we created.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
virsh define /xen_shared/definitions/vm0001_ws1.xml &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Domain vm0001_ws1 defined from /xen_shared/definitions/vm0001_ws1.xml&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now confirm that it&#039;s there.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
virsh list --all&lt;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 Name                 State&lt;br /&gt;
----------------------------------&lt;br /&gt;
  0 Domain-0             running&lt;br /&gt;
  - vm0001_ws1           shut off&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can now see &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0001_ws1&amp;lt;/span&amp;gt; on both nodes. Of course, &#039;&#039;&#039;&#039;&#039;never&#039;&#039;&#039;&#039;&#039;, &#039;&#039;&#039;&#039;&#039;ever&#039;&#039;&#039;&#039;&#039; try to start the VM on both nodes at the same time. In the previous step, we shut down &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0001_ws1&amp;lt;/span&amp;gt;, but it&#039;s safest to make sure that it&#039;s still off.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt;&#039;&#039;&#039;:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
virsh list --all&lt;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 Name                 State&lt;br /&gt;
----------------------------------&lt;br /&gt;
  0 Domain-0             running&lt;br /&gt;
  - vm0001_ws1           shut off&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So we now have &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0001_ws1&amp;lt;/span&amp;gt; shut off and it is defined on both &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt;. We can now start it on either node. Let&#039;s now start it up on the second node, just for fun.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt;&#039;&#039;&#039;:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
virsh start vm0001_ws1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Domain vm0001_ws1 started&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you look at &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-manager&amp;lt;/span&amp;gt;, you will now see &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0001_ws1&amp;lt;/span&amp;gt; up and running on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt; and shut off on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[Image:xen3_vm_running_on_second_node_1.png|thumb|center|700px|View of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0001_ws1&amp;lt;/span&amp;gt; running on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt;.]]&lt;br /&gt;
&lt;br /&gt;
There we go. We&#039;ve now seen how to stop, define and start the VM using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virsh&amp;lt;/span&amp;gt;. Nothing too fancy!&lt;br /&gt;
&lt;br /&gt;
==== Testing VM Migration ====&lt;br /&gt;
&lt;br /&gt;
One of the biggest benefits of virtual servers in clusters is that they can be migrated between nodes without needing to shut down the VM. This is useful for planned maintenance on nodes, as you can push off all of it&#039;s VMs, take it out of the cluster and do your maintenance and your VM users will see minimal or no interruption in service. &lt;br /&gt;
&lt;br /&gt;
There are two types of migration;&lt;br /&gt;
* &#039;&#039;&#039;Cold Migration&#039;&#039;&#039;; The VM is frozen, it&#039;s RAM is copied to the other node and then it is thawed on the new host. This is the fastest method of migrating, but the users will see a period where they can not interact with the VM.&lt;br /&gt;
* &#039;&#039;&#039;Live Migration&#039;&#039;&#039;; The VM continues to run during the migration. Performance will degrade a bit and the migration process will take longer to complete, but users should not see any interruption in service.&lt;br /&gt;
&lt;br /&gt;
To manually migrate the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0001_ws1&amp;lt;/span&amp;gt; VM &#039;&#039;from&#039;&#039; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt; back to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt;, run the following command. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt;&#039;&#039;&#039; (there will be no output):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
virsh migrate --live vm0001_ws1 xen+ssh://root@an-node04&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you flip over to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-manager&amp;lt;/span&amp;gt;, you will see that the node shows as &#039;&#039;Running&#039;&#039; on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt; on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt; and &#039;&#039;Shutoff&#039;&#039; on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt; right away, but there will still be CPU activity on both. This is the live migration process running. In the screen shot below, I opened a standard terminal and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ssh&amp;lt;/span&amp;gt;&#039;ed into &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0001_ws1&amp;lt;/span&amp;gt; and started a ping flood to Google &#039;&#039;&#039;before&#039;&#039;&#039; starting the live migration. Notice how the migration completed and no packets were dropped?&lt;br /&gt;
&lt;br /&gt;
[[Image:xen3_vm_live_migrating_1.png|thumb|center|700px|View of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0001_ws1&amp;lt;/span&amp;gt; being live migrated to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt; from &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt; with a ping-flood running via an &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ssh&amp;lt;/span&amp;gt; session.]]&lt;br /&gt;
&lt;br /&gt;
This should tickle your geek glands.&lt;br /&gt;
&lt;br /&gt;
==== How to &amp;quot;Pull the Power&amp;quot; on a VM ====&lt;br /&gt;
&lt;br /&gt;
If something happens to the VM and you can&#039;t shut it down, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virsh&amp;lt;/span&amp;gt; provides a command that is the equivalent of pulling the power on a physical server. This command forces the virtual server off without giving the VM a chance to react at all. For obvious reasons, you will want to be somewhat careful in using this as it has all the same potential for problems as killing the power of a real server.&lt;br /&gt;
&lt;br /&gt;
So to &amp;quot;pull the plug&amp;quot;, you can run this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
virsh destroy vm0001_ws1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Domain vm0001_ws1 destroyed&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The VM is still defined, but it&#039;s no longer running.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
virsh list --all&lt;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 Name                 State&lt;br /&gt;
----------------------------------&lt;br /&gt;
  0 Domain-0             running&lt;br /&gt;
  - vm0001_ws1           shut off&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== How to Delete a VM and Start Over ====&lt;br /&gt;
&lt;br /&gt;
{{note|1=It is &#039;&#039;very&#039;&#039; likely that you will run into problems when you first start trying to provision your VM. If you want to delete the VM and start over, the way to do it is with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virsh&amp;lt;/span&amp;gt;, the virtual shell.}}&lt;br /&gt;
&lt;br /&gt;
Check that it&#039;s there.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
virsh list --all&lt;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 Name                 State&lt;br /&gt;
----------------------------------&lt;br /&gt;
  0 Domain-0             running&lt;br /&gt;
  - vm0001_ws1           shut off&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Undefine&amp;quot; it, which deletes it from Xen.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
virsh undefine vm0001_ws1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Domain vm0001_ws1 has been undefined&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Confirm that it is gone.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
virsh list --all&lt;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 Name                 State&lt;br /&gt;
----------------------------------&lt;br /&gt;
  0 Domain-0             running&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now you can try again.&lt;br /&gt;
&lt;br /&gt;
=== Hardware Virtual Machine ===&lt;br /&gt;
&lt;br /&gt;
Most modern processors come with support for &amp;quot;hardware assisted virtualization&amp;quot;, which Xen calls &amp;quot;Hardware Virtual Machine&amp;quot; or &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;hvm&amp;lt;/span&amp;gt; or &amp;quot;Secure Virtual Machine&amp;quot; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;svm&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
HVM requires special support in the CPU in order for it to be used in Xen. Intel processors implement this under the name VT-x and AMD implements this under the name AMD-V. Some motherboards will disable this feature by default, requiring the user to edit the BIOS of their mainboard. &lt;br /&gt;
&lt;br /&gt;
If you try to provision an &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;hvm&amp;lt;/span&amp;gt; and receive an error about it not being supported by the host, consult your system board documentation for information on enabling hardware virtualization.&lt;br /&gt;
&lt;br /&gt;
To check if you have &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;hvm&amp;lt;/span&amp;gt; enabled, run &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xm info&amp;lt;/span&amp;gt; and check the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xen_caps&amp;lt;/span&amp;gt; line for entries starting with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;hvm&amp;lt;/span&amp;gt;. If you do not see any &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;hvm&amp;lt;/span&amp;gt; entries, then it is likely not enabled.&lt;br /&gt;
&lt;br /&gt;
{{note|1=The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xm info&amp;lt;/span&amp;gt; only works when running a Xen kernel. With a vanilla kernel, consult &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/proc/cpuinfo&amp;lt;/span&amp;gt;.}}&lt;br /&gt;
&lt;br /&gt;
Below is the output of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xm info&amp;lt;/span&amp;gt; with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;hvm&amp;lt;/span&amp;gt; &#039;&#039;enabled&#039;&#039; in the host BIOS.&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.18-238.9.1.el5xen&lt;br /&gt;
version                : #1 SMP Tue Apr 12 18:53:56 EDT 2011&lt;br /&gt;
machine                : x86_64&lt;br /&gt;
nr_cpus                : 4&lt;br /&gt;
nr_nodes               : 1&lt;br /&gt;
sockets_per_node       : 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                : 178bfbff:efd3fbff:00000000:00000110:00802009:00000000:000037ff&lt;br /&gt;
total_memory           : 4062&lt;br /&gt;
free_memory            : 1048&lt;br /&gt;
node_to_cpu            : node0:0-3&lt;br /&gt;
xen_major              : 3&lt;br /&gt;
xen_minor              : 1&lt;br /&gt;
xen_extra              : .2-238.9.1.el5&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_pagesize           : 4096&lt;br /&gt;
platform_params        : virt_start=0xffff800000000000&lt;br /&gt;
xen_changeset          : unavailable&lt;br /&gt;
cc_compiler            : gcc version 4.1.2 20080704 (Red Hat 4.1.2-50)&lt;br /&gt;
cc_compile_by          : mockbuild&lt;br /&gt;
cc_compile_domain      : centos.org&lt;br /&gt;
cc_compile_date        : Tue Apr 12 18:01:03 EDT 2011&lt;br /&gt;
xend_config_format     : 2&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;hvm&amp;lt;/span&amp;gt; &#039;&#039;disabled&#039;&#039; in the BIOS. Note the missing &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;hvm&amp;lt;/span&amp;gt; entries on the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xen_caps&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;
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-node05.alteeve.com&lt;br /&gt;
release                : 2.6.18-238.9.1.el5xen&lt;br /&gt;
version                : #1 SMP Tue Apr 12 18:53:56 EDT 2011&lt;br /&gt;
machine                : x86_64&lt;br /&gt;
nr_cpus                : 4&lt;br /&gt;
nr_nodes               : 1&lt;br /&gt;
sockets_per_node       : 1&lt;br /&gt;
cores_per_socket       : 4&lt;br /&gt;
threads_per_core       : 1&lt;br /&gt;
cpu_mhz                : 2200&lt;br /&gt;
hw_caps                : 178bfbff:efd3fbff:00000000:00000110:00802009:00000000:000037ff&lt;br /&gt;
total_memory           : 3838&lt;br /&gt;
free_memory            : 383&lt;br /&gt;
node_to_cpu            : node0:0-3&lt;br /&gt;
xen_major              : 3&lt;br /&gt;
xen_minor              : 1&lt;br /&gt;
xen_extra              : .2-238.9.1.el5&lt;br /&gt;
xen_caps               : xen-3.0-x86_64 xen-3.0-x86_32p &lt;br /&gt;
xen_pagesize           : 4096&lt;br /&gt;
platform_params        : virt_start=0xffff800000000000&lt;br /&gt;
xen_changeset          : unavailable&lt;br /&gt;
cc_compiler            : gcc version 4.1.2 20080704 (Red Hat 4.1.2-50)&lt;br /&gt;
cc_compile_by          : mockbuild&lt;br /&gt;
cc_compile_domain      : centos.org&lt;br /&gt;
cc_compile_date        : Tue Apr 12 18:01:03 EDT 2011&lt;br /&gt;
xend_config_format     : 2&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you try to provision an &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;hvm&amp;lt;/span&amp;gt; machine with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;hvm&amp;lt;/span&amp;gt; disabled, you will see the error below.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
virt-install --connect xen ... --hvm&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
ERROR    Host does not support virtualization type &#039;hvm&#039; for arch &#039;x86_64&#039;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{note|1=When installing from an [[ISO]], you must use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;hvm&amp;lt;/span&amp;gt; or full virtualization.}}&lt;br /&gt;
&lt;br /&gt;
=== Provisioning vm0002_win1; A Windows Server ===&lt;br /&gt;
&lt;br /&gt;
We&#039;re going to provision a [[Microsoft]] Windows 2008 server this time. This will largely be the same process as with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0001_ws1&amp;lt;/span&amp;gt;. The main differences is that we&#039;ll be installing from an [[ISO]] file which was copied into &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/xen_shared/iso/Win_Server_2008_Bis_x86_64.iso&amp;lt;/span&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
Microsoft Windows is commercial software. You will need a proper license to use it in production, but you can [http://www.microsoft.com/windowsserver2008/en/us/trial-software.aspx download a trial] version, which will be sufficient to follow along with this tutorial. &lt;br /&gt;
&lt;br /&gt;
{{note|1=You may find it useful to create an &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/xen_shared/iso&amp;lt;/span&amp;gt; folder to store ISO files in.}}&lt;br /&gt;
&lt;br /&gt;
We won&#039;t go over all the details again, but we will show all the specific commands.&lt;br /&gt;
&lt;br /&gt;
First, create the [[LV]] for this new VM.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
lvcreate -l 100%FREE -n vm0002_1 --addtag @an-cluster01 /dev/drbd_an5_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;vm0002_1&amp;quot; created&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we need to craft the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-install&amp;lt;/span&amp;gt; provision command. Some key differences are that we&#039;re going to create a &amp;quot;hardware virtualized machine&amp;quot;, known as &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;hvm&amp;lt;/span&amp;gt;, which requires support in the CPU. We&#039;ll also directly boot off of a DVD [[ISO]], as if we had put a DVD in a drive and booted from it on a real server. We also need to change the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--os-type&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--os-variant&amp;lt;/span&amp;gt; values to windows as well.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&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;
virt-install --connect xen \&lt;br /&gt;
        --name vm0002_win1 \&lt;br /&gt;
        --ram 1048 \&lt;br /&gt;
        --arch x86_64 \&lt;br /&gt;
        --vcpus 1 \&lt;br /&gt;
        --cpuset 1-3 \&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_an5_vg0/vm0002_1 \&lt;br /&gt;
        --network bridge=xenbr0 \&lt;br /&gt;
        --vnc \&lt;br /&gt;
        --hvm&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Image:Installing_Win2008_VM_01.png|thumb|700px|center|Starting the install of Windows 2008 R2 as a virtual machine]]&lt;br /&gt;
&lt;br /&gt;
I like to close the default VNC session and flip over to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-manager&amp;lt;/span&amp;gt;. This is what you should see if you do the same.&lt;br /&gt;
&lt;br /&gt;
[[Image:Installing_Win2008_VM_via_virt-manager_02.png|thumb|700px|center|Monitoring the install of Windows 2008 R2 via &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-manager&amp;lt;/span&amp;gt;.]]&lt;br /&gt;
&lt;br /&gt;
As before, let the install finish before proceeding. Once the install is completed and you&#039;ve booted for the first time, dump the configuration to an XML file, define it on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt; and update the backups on either node&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/root/&amp;lt;/span&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
Dump the XML definition.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
virsh dumpxml vm0002_win1 &amp;gt; /xen_shared/definitions/vm0002_win1.xml&lt;br /&gt;
ls -lah /xen_shared/definitions/vm0002_win1.xml&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
-rw-r--r-- 1 root root 1.5K May 14 23:27 /xen_shared/definitions/vm0002_win1.xml&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Define the VM on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&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;
virsh define /xen_shared/definitions/vm0002_win1.xml &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Domain vm0002_win1 defined from /xen_shared/definitions/vm0002_win1.xml&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Backup the new VM definition on each node.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
rsync -av /xen_shared/definitions ~/&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
building file list ... done&lt;br /&gt;
definitions/&lt;br /&gt;
definitions/vm0002_win1.xml&lt;br /&gt;
&lt;br /&gt;
sent 1646 bytes  received 48 bytes  3388.00 bytes/sec&lt;br /&gt;
total size is 2446  speedup is 1.44&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Image:Installing_Win2008_VM_via_virt-manager_03.png|thumb|700px|center|Seeing the Windows 2008 R2 on both nodes via &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-manager&amp;lt;/span&amp;gt;.]]&lt;br /&gt;
&lt;br /&gt;
Now we see both VMs defined on both nodes!&lt;br /&gt;
&lt;br /&gt;
= Making Our VMs Highly Available Cluster Services =&lt;br /&gt;
&lt;br /&gt;
We&#039;re ready to start the final step; Making our VMs highly available via cluster management! This involves two major steps:&lt;br /&gt;
* Creating two new, ordered failover Domains; One with each node as the highest priority.&lt;br /&gt;
* Adding our VMs as services, one is each new failover domain.&lt;br /&gt;
&lt;br /&gt;
== Creating the Ordered Failover Domains ==&lt;br /&gt;
&lt;br /&gt;
The idea here is that each new failover domain will have one node with a higher priority than the other. That is, one will have &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt; with the highest priority and the other will have &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt; as the highest. This way, VMs that we want to normally run on a given node will be added to the matching failover domain.&lt;br /&gt;
&lt;br /&gt;
To add the two new failover domains, we&#039;ll add the following to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/cluster/cluster.conf&amp;lt;/span&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
              &amp;lt;failoverdomains&amp;gt;&lt;br /&gt;
                        ...&lt;br /&gt;
                        &amp;lt;failoverdomain name=&amp;quot;an4_primary&amp;quot; nofailback=&amp;quot;0&amp;quot; ordered=&amp;quot;1&amp;quot; restricted=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
                                &amp;lt;failoverdomainnode name=&amp;quot;an-node04.alteeve.com&amp;quot; priority=&amp;quot;1&amp;quot;/&amp;gt;&lt;br /&gt;
                                &amp;lt;failoverdomainnode name=&amp;quot;an-node05.alteeve.com&amp;quot; priority=&amp;quot;2&amp;quot;/&amp;gt;&lt;br /&gt;
                        &amp;lt;/failoverdomain&amp;gt;&lt;br /&gt;
                        &amp;lt;failoverdomain name=&amp;quot;an5_primary&amp;quot; nofailback=&amp;quot;0&amp;quot; ordered=&amp;quot;1&amp;quot; restricted=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
                                &amp;lt;failoverdomainnode name=&amp;quot;an-node04.alteeve.com&amp;quot; priority=&amp;quot;2&amp;quot;/&amp;gt;&lt;br /&gt;
                                &amp;lt;failoverdomainnode name=&amp;quot;an-node05.alteeve.com&amp;quot; priority=&amp;quot;1&amp;quot;/&amp;gt;&lt;br /&gt;
                        &amp;lt;/failoverdomain&amp;gt;&lt;br /&gt;
              &amp;lt;/failoverdomains&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As always, validate it. We&#039;ll see here what the complete file now looks like. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
xmllint --relaxng /usr/share/system-config-cluster/misc/cluster.ng /etc/cluster/cluster.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&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-cluster01&amp;quot; config_version=&amp;quot;14&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;cman expected_votes=&amp;quot;1&amp;quot; two_node=&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-node04.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;fence_na01&amp;quot; port=&amp;quot;04&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-node05.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;fence_na01&amp;quot; port=&amp;quot;03&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 agent=&amp;quot;fence_na&amp;quot; ipaddr=&amp;quot;fence_na01.alteeve.com&amp;quot; login=&amp;quot;admin&amp;quot; name=&amp;quot;fence_na01&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;fence_daemon post_join_delay=&amp;quot;60&amp;quot;/&amp;gt;&lt;br /&gt;
        &amp;lt;totem rrp_mode=&amp;quot;none&amp;quot; secauth=&amp;quot;off&amp;quot;/&amp;gt;&lt;br /&gt;
        &amp;lt;rm&amp;gt;&lt;br /&gt;
                &amp;lt;resources&amp;gt;&lt;br /&gt;
                        &amp;lt;script file=&amp;quot;/etc/init.d/drbd&amp;quot; name=&amp;quot;drbd&amp;quot;/&amp;gt;&lt;br /&gt;
                        &amp;lt;script file=&amp;quot;/etc/init.d/clvmd&amp;quot; name=&amp;quot;clvmd&amp;quot;/&amp;gt;&lt;br /&gt;
                        &amp;lt;script file=&amp;quot;/etc/init.d/gfs2&amp;quot; name=&amp;quot;gfs2&amp;quot;/&amp;gt;&lt;br /&gt;
                &amp;lt;/resources&amp;gt;&lt;br /&gt;
		&amp;lt;failoverdomains&amp;gt;&lt;br /&gt;
			&amp;lt;failoverdomain name=&amp;quot;an4_only&amp;quot; nofailback=&amp;quot;0&amp;quot; ordered=&amp;quot;0&amp;quot; restricted=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
				&amp;lt;failoverdomainnode name=&amp;quot;an-node04.alteeve.com&amp;quot; priority=&amp;quot;1&amp;quot;/&amp;gt;&lt;br /&gt;
			&amp;lt;/failoverdomain&amp;gt;&lt;br /&gt;
			&amp;lt;failoverdomain name=&amp;quot;an5_only&amp;quot; nofailback=&amp;quot;0&amp;quot; ordered=&amp;quot;0&amp;quot; restricted=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
				&amp;lt;failoverdomainnode name=&amp;quot;an-node05.alteeve.com&amp;quot; priority=&amp;quot;1&amp;quot;/&amp;gt;&lt;br /&gt;
			&amp;lt;/failoverdomain&amp;gt;&lt;br /&gt;
			&amp;lt;failoverdomain name=&amp;quot;an4_primary&amp;quot; nofailback=&amp;quot;0&amp;quot; ordered=&amp;quot;1&amp;quot; restricted=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
				&amp;lt;failoverdomainnode name=&amp;quot;an-node04.alteeve.com&amp;quot; priority=&amp;quot;1&amp;quot;/&amp;gt;&lt;br /&gt;
				&amp;lt;failoverdomainnode name=&amp;quot;an-node05.alteeve.com&amp;quot; priority=&amp;quot;2&amp;quot;/&amp;gt;&lt;br /&gt;
			&amp;lt;/failoverdomain&amp;gt;&lt;br /&gt;
			&amp;lt;failoverdomain name=&amp;quot;an5_primary&amp;quot; nofailback=&amp;quot;0&amp;quot; ordered=&amp;quot;1&amp;quot; restricted=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
				&amp;lt;failoverdomainnode name=&amp;quot;an-node04.alteeve.com&amp;quot; priority=&amp;quot;2&amp;quot;/&amp;gt;&lt;br /&gt;
				&amp;lt;failoverdomainnode name=&amp;quot;an-node05.alteeve.com&amp;quot; priority=&amp;quot;1&amp;quot;/&amp;gt;&lt;br /&gt;
			&amp;lt;/failoverdomain&amp;gt;&lt;br /&gt;
		&amp;lt;/failoverdomains&amp;gt;&lt;br /&gt;
		&amp;lt;service autostart=&amp;quot;0&amp;quot; domain=&amp;quot;an4_only&amp;quot; exclusive=&amp;quot;0&amp;quot; max_restarts=&amp;quot;0&amp;quot; name=&amp;quot;an4_storage&amp;quot; recovery=&amp;quot;restart&amp;quot; restart_expire_time=&amp;quot;0&amp;quot;&amp;gt;&lt;br /&gt;
			&amp;lt;script ref=&amp;quot;drbd&amp;quot;&amp;gt;&lt;br /&gt;
				&amp;lt;script ref=&amp;quot;clvmd&amp;quot;&amp;gt;&lt;br /&gt;
					&amp;lt;script ref=&amp;quot;gfs2&amp;quot;/&amp;gt;&lt;br /&gt;
				&amp;lt;/script&amp;gt;&lt;br /&gt;
			&amp;lt;/script&amp;gt;&lt;br /&gt;
		&amp;lt;/service&amp;gt;&lt;br /&gt;
		&amp;lt;service autostart=&amp;quot;0&amp;quot; domain=&amp;quot;an5_only&amp;quot; exclusive=&amp;quot;0&amp;quot; max_restarts=&amp;quot;0&amp;quot; name=&amp;quot;an5_storage&amp;quot; recovery=&amp;quot;restart&amp;quot; restart_expire_time=&amp;quot;0&amp;quot;&amp;gt;&lt;br /&gt;
			&amp;lt;script ref=&amp;quot;drbd&amp;quot;&amp;gt;&lt;br /&gt;
				&amp;lt;script ref=&amp;quot;clvmd&amp;quot;&amp;gt;&lt;br /&gt;
					&amp;lt;script ref=&amp;quot;gfs2&amp;quot;/&amp;gt;&lt;br /&gt;
				&amp;lt;/script&amp;gt;&lt;br /&gt;
			&amp;lt;/script&amp;gt;&lt;br /&gt;
		&amp;lt;/service&amp;gt;&lt;br /&gt;
        &amp;lt;/rm&amp;gt;&lt;br /&gt;
&amp;lt;/cluster&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;
/etc/cluster/cluster.conf validates&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With it validating, push it to the other node.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ccs_tool update /etc/cluster/cluster.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;
Config file updated from version 13 to 14&lt;br /&gt;
&lt;br /&gt;
Update complete.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Adding The VMs To rgmanager ==&lt;br /&gt;
&lt;br /&gt;
This is where we tell &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; which VMs we want to run on which nodes when both are online.&lt;br /&gt;
&lt;br /&gt;
{{note|1=There is a bit of a trick when using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; with our cluster. There is no real way to delay the start of virtual machines until after the storage services are online. The side effect of this is that, if the VMs are set to automatically start with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt;, the VMs will fail because their underlying storage takes too long to come online. For this reason, we will not configure them to start automatically.}}&lt;br /&gt;
&lt;br /&gt;
=== Creating the vm:&amp;lt;domu&amp;gt; Resources ===&lt;br /&gt;
&lt;br /&gt;
Virtual machine services are a special-case in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt;, and have their own &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;vm .../&amp;gt;&amp;lt;/span&amp;gt; tag. Here are the two we will be adding for the two VMs we created in the previous section.&lt;br /&gt;
&lt;br /&gt;
{{warning|1=Make sure that the VMs are shut down before adding them to the cluster! Otherwise &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; will restart them when you first enable the new &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;vm /&amp;gt;&amp;lt;/span&amp;gt; resources.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;rm&amp;gt;&lt;br /&gt;
                ...&lt;br /&gt;
                &amp;lt;vm name=&amp;quot;vm0001_ws1&amp;quot; domain=&amp;quot;an4_primary&amp;quot; path=&amp;quot;/xen_shared/definitions/&amp;quot;&lt;br /&gt;
                 autostart=&amp;quot;0&amp;quot; exclusive=&amp;quot;0&amp;quot; recovery=&amp;quot;restart&amp;quot; max_restarts=&amp;quot;2&amp;quot; restart_expire_time=&amp;quot;600&amp;quot;/&amp;gt;&lt;br /&gt;
                &amp;lt;vm name=&amp;quot;vm0002_win1&amp;quot; domain=&amp;quot;an5_primary&amp;quot; path=&amp;quot;/xen_shared/definitions/&amp;quot;&lt;br /&gt;
                 autostart=&amp;quot;0&amp;quot; exclusive=&amp;quot;0&amp;quot; recovery=&amp;quot;restart&amp;quot; max_restarts=&amp;quot;2&amp;quot; restart_expire_time=&amp;quot;600&amp;quot;/&amp;gt;&lt;br /&gt;
        &amp;lt;/rm&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The attributes are:&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;name&amp;lt;/span&amp;gt;; This is the name of the VM and must match the name of the VM shown by &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virsh list&amp;lt;/span&amp;gt; as well as the definition file name, minus the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;.xml&amp;lt;/span&amp;gt; suffix.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;domain&amp;lt;/span&amp;gt;; This is the name of the failover domain that this VM will operate within.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;path&amp;lt;/span&amp;gt;; This is the full path to where the VM definition files are kept. It &#039;&#039;&#039;is not&#039;&#039;&#039; the full path to the actual definition file itself!&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;autostart&amp;lt;/span&amp;gt;; As mentioned above, we do not want the VMs to automatically start with the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt;, so we set this to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;0&amp;lt;/span&amp;gt;.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;exclusive&amp;lt;/span&amp;gt;; When set, this will prevent &#039;&#039;&#039;any&#039;&#039;&#039; other service from running on the node. This would take out the storage services, so this &#039;&#039;&#039;must&#039;&#039;&#039; be set to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;0&amp;lt;/span&amp;gt;.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;recovery&amp;lt;/span&amp;gt;; This is how the VM should be recovered after it crashes. The options are &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;restart&amp;lt;/span&amp;gt;, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;relocate&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;disable&amp;lt;/span&amp;gt;.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;max_restarts&amp;lt;/span&amp;gt;; This is how many times the VM is allowed to be restarted (from a crash) before the VM is migrated to another node in the failover domain. The idea here is that, normally, we simply want to restart the VM in-place if the VM itself crashed and the underlying node is healthy. However, once the VM restarts this number a times, we assume that there is actually a problem with the VM running on the current node, so we want to give up and move the VM to another node. We will use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;2&amp;lt;/span&amp;gt; restarts before switching to a migration.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;restart_expire_time&amp;lt;/span&amp;gt;; Whenever a VM is restarted, a counter is incremented, which is compared against &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;max_restarts&amp;lt;/span&amp;gt;. After this many seconds, that restart is &amp;quot;forgotten&amp;quot; and the restart counter is reduced by one. With our value of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;600&amp;lt;/span&amp;gt; seconds (10 minutes) and a &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;max_restarts&amp;lt;/span&amp;gt; of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;2&amp;lt;/span&amp;gt;, the VM will be relocated instead of restarted after the third crash in ten minutes.&lt;br /&gt;
&lt;br /&gt;
Again, validate it. We&#039;ll see here what the complete file now looks like. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
xmllint --relaxng /usr/share/system-config-cluster/misc/cluster.ng /etc/cluster/cluster.conf&lt;br /&gt;
&amp;lt;/source&amp;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-cluster01&amp;quot; config_version=&amp;quot;15&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;cman expected_votes=&amp;quot;1&amp;quot; two_node=&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-node04.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;fence_na01&amp;quot; port=&amp;quot;04&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-node05.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;fence_na01&amp;quot; port=&amp;quot;03&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 agent=&amp;quot;fence_na&amp;quot; ipaddr=&amp;quot;fence_na01.alteeve.com&amp;quot; login=&amp;quot;admin&amp;quot; name=&amp;quot;fence_na01&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;fence_daemon post_join_delay=&amp;quot;60&amp;quot;/&amp;gt;&lt;br /&gt;
        &amp;lt;totem rrp_mode=&amp;quot;none&amp;quot; secauth=&amp;quot;off&amp;quot;/&amp;gt;&lt;br /&gt;
        &amp;lt;rm&amp;gt;&lt;br /&gt;
                &amp;lt;resources&amp;gt;&lt;br /&gt;
                        &amp;lt;script file=&amp;quot;/etc/init.d/drbd&amp;quot; name=&amp;quot;drbd&amp;quot;/&amp;gt;&lt;br /&gt;
                        &amp;lt;script file=&amp;quot;/etc/init.d/clvmd&amp;quot; name=&amp;quot;clvmd&amp;quot;/&amp;gt;&lt;br /&gt;
                        &amp;lt;script file=&amp;quot;/etc/init.d/gfs2&amp;quot; name=&amp;quot;gfs2&amp;quot;/&amp;gt;&lt;br /&gt;
                &amp;lt;/resources&amp;gt;&lt;br /&gt;
		&amp;lt;failoverdomains&amp;gt;&lt;br /&gt;
			&amp;lt;failoverdomain name=&amp;quot;an4_only&amp;quot; nofailback=&amp;quot;0&amp;quot; ordered=&amp;quot;0&amp;quot; restricted=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
				&amp;lt;failoverdomainnode name=&amp;quot;an-node04.alteeve.com&amp;quot; priority=&amp;quot;1&amp;quot;/&amp;gt;&lt;br /&gt;
			&amp;lt;/failoverdomain&amp;gt;&lt;br /&gt;
			&amp;lt;failoverdomain name=&amp;quot;an5_only&amp;quot; nofailback=&amp;quot;0&amp;quot; ordered=&amp;quot;0&amp;quot; restricted=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
				&amp;lt;failoverdomainnode name=&amp;quot;an-node05.alteeve.com&amp;quot; priority=&amp;quot;1&amp;quot;/&amp;gt;&lt;br /&gt;
			&amp;lt;/failoverdomain&amp;gt;&lt;br /&gt;
			&amp;lt;failoverdomain name=&amp;quot;an4_primary&amp;quot; nofailback=&amp;quot;0&amp;quot; ordered=&amp;quot;1&amp;quot; restricted=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
				&amp;lt;failoverdomainnode name=&amp;quot;an-node04.alteeve.com&amp;quot; priority=&amp;quot;1&amp;quot;/&amp;gt;&lt;br /&gt;
				&amp;lt;failoverdomainnode name=&amp;quot;an-node05.alteeve.com&amp;quot; priority=&amp;quot;2&amp;quot;/&amp;gt;&lt;br /&gt;
			&amp;lt;/failoverdomain&amp;gt;&lt;br /&gt;
			&amp;lt;failoverdomain name=&amp;quot;an5_primary&amp;quot; nofailback=&amp;quot;0&amp;quot; ordered=&amp;quot;1&amp;quot; restricted=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
				&amp;lt;failoverdomainnode name=&amp;quot;an-node04.alteeve.com&amp;quot; priority=&amp;quot;2&amp;quot;/&amp;gt;&lt;br /&gt;
				&amp;lt;failoverdomainnode name=&amp;quot;an-node05.alteeve.com&amp;quot; priority=&amp;quot;1&amp;quot;/&amp;gt;&lt;br /&gt;
			&amp;lt;/failoverdomain&amp;gt;&lt;br /&gt;
		&amp;lt;/failoverdomains&amp;gt;&lt;br /&gt;
		&amp;lt;service autostart=&amp;quot;0&amp;quot; domain=&amp;quot;an4_only&amp;quot; exclusive=&amp;quot;0&amp;quot; max_restarts=&amp;quot;0&amp;quot; name=&amp;quot;an4_storage&amp;quot; recovery=&amp;quot;restart&amp;quot; restart_expire_time=&amp;quot;0&amp;quot;&amp;gt;&lt;br /&gt;
			&amp;lt;script ref=&amp;quot;drbd&amp;quot;&amp;gt;&lt;br /&gt;
				&amp;lt;script ref=&amp;quot;clvmd&amp;quot;&amp;gt;&lt;br /&gt;
					&amp;lt;script ref=&amp;quot;gfs2&amp;quot;/&amp;gt;&lt;br /&gt;
				&amp;lt;/script&amp;gt;&lt;br /&gt;
			&amp;lt;/script&amp;gt;&lt;br /&gt;
		&amp;lt;/service&amp;gt;&lt;br /&gt;
		&amp;lt;service autostart=&amp;quot;0&amp;quot; domain=&amp;quot;an5_only&amp;quot; exclusive=&amp;quot;0&amp;quot; max_restarts=&amp;quot;0&amp;quot; name=&amp;quot;an5_storage&amp;quot; recovery=&amp;quot;restart&amp;quot; restart_expire_time=&amp;quot;0&amp;quot;&amp;gt;&lt;br /&gt;
			&amp;lt;script ref=&amp;quot;drbd&amp;quot;&amp;gt;&lt;br /&gt;
				&amp;lt;script ref=&amp;quot;clvmd&amp;quot;&amp;gt;&lt;br /&gt;
					&amp;lt;script ref=&amp;quot;gfs2&amp;quot;/&amp;gt;&lt;br /&gt;
				&amp;lt;/script&amp;gt;&lt;br /&gt;
			&amp;lt;/script&amp;gt;&lt;br /&gt;
		&amp;lt;/service&amp;gt;&lt;br /&gt;
                &amp;lt;vm name=&amp;quot;vm0001_ws1&amp;quot; domain=&amp;quot;an4_primary&amp;quot; path=&amp;quot;/xen_shared/definitions/&amp;quot; autostart=&amp;quot;0&amp;quot; exclusive=&amp;quot;0&amp;quot; recovery=&amp;quot;restart&amp;quot; max_restarts=&amp;quot;2&amp;quot; restart_expire_time=&amp;quot;600&amp;quot;/&amp;gt;&lt;br /&gt;
                &amp;lt;vm name=&amp;quot;vm0002_win1&amp;quot; domain=&amp;quot;an5_primary&amp;quot; path=&amp;quot;/xen_shared/definitions/&amp;quot; autostart=&amp;quot;0&amp;quot; exclusive=&amp;quot;0&amp;quot; recovery=&amp;quot;restart&amp;quot; max_restarts=&amp;quot;2&amp;quot; restart_expire_time=&amp;quot;600&amp;quot;/&amp;gt;&lt;br /&gt;
        &amp;lt;/rm&amp;gt;&lt;br /&gt;
&amp;lt;/cluster&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;
/etc/cluster/cluster.conf validates&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now push the updated configuration out.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ccs_tool update /etc/cluster/cluster.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;
Config file updated from version 14 to 15&lt;br /&gt;
&lt;br /&gt;
Update complete.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{note|1=You can use migration mapping to map hostnames to names resolved to other interfaces on the host by adding &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;vm ... migration_mapping=&amp;quot;an-node01.alteeve.com:an-node01.bcn,an-node02.alteeve.com:an-node02.bcn&amp;quot;&amp;lt;/span&amp;gt;. Thanks to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;thomas_s&amp;lt;/span&amp;gt; on the Freenode &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;#linux-cluster&amp;lt;/span&amp;gt; IRC channel for pointing this out.}}&lt;br /&gt;
&lt;br /&gt;
=== Using the new VM Resources ===&lt;br /&gt;
&lt;br /&gt;
{{note|1=We&#039;ll be running all of the commands in this section on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt;.}}&lt;br /&gt;
&lt;br /&gt;
If you now run &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clustat&amp;lt;/span&amp;gt; on either node, you should see the new VM resources.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
clustat &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Cluster Status for an-cluster01 @ Sun May 15 12:36:10 2011&lt;br /&gt;
Member Status: Quorate&lt;br /&gt;
&lt;br /&gt;
 Member Name                             ID   Status&lt;br /&gt;
 ------ ----                             ---- ------&lt;br /&gt;
 an-node04.alteeve.com                       1 Online, Local, rgmanager&lt;br /&gt;
 an-node05.alteeve.com                       2 Online, rgmanager&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State         &lt;br /&gt;
 ------- ----                   ----- ------                   -----         &lt;br /&gt;
 service:an4_storage            an-node04.alteeve.com          started       &lt;br /&gt;
 service:an5_storage            an-node05.alteeve.com          started       &lt;br /&gt;
 vm:vm0001_ws1                  (none)                         disabled      &lt;br /&gt;
 vm:vm0002_win1                 (none)                         disabled      &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we can start the VMs using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt;!&lt;br /&gt;
&lt;br /&gt;
{{note|1=As we&#039;ll be starting a non-standard, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm&amp;lt;/span&amp;gt; service, we need to type out the full service name, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm:domu&amp;lt;/span&amp;gt;.}}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt;&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
clusvcadm -e vm:vm0001_ws1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Local machine trying to enable vm:vm0001_ws1...Success&lt;br /&gt;
vm:vm0001_ws1 is now running on an-node04.alteeve.com&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you check with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virsh&amp;lt;/span&amp;gt;, you&#039;ll see it running now.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
virsh list --all&lt;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 Name                 State&lt;br /&gt;
----------------------------------&lt;br /&gt;
  0 Domain-0             running&lt;br /&gt;
  1 vm0001_ws1           running&lt;br /&gt;
  - vm0002_win1          shut off&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Likewise, if you check &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clustat&amp;lt;/span&amp;gt; from either node, you will see the new VM service running on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&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;
clustat &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Cluster Status for an-cluster01 @ Sun May 15 12:38:38 2011&lt;br /&gt;
Member Status: Quorate&lt;br /&gt;
&lt;br /&gt;
 Member Name                             ID   Status&lt;br /&gt;
 ------ ----                             ---- ------&lt;br /&gt;
 an-node04.alteeve.com                       1 Online, Local, rgmanager&lt;br /&gt;
 an-node05.alteeve.com                       2 Online, rgmanager&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State         &lt;br /&gt;
 ------- ----                   ----- ------                   -----         &lt;br /&gt;
 service:an4_storage            an-node04.alteeve.com          started       &lt;br /&gt;
 service:an5_storage            an-node05.alteeve.com          started       &lt;br /&gt;
 vm:vm0001_ws1                  an-node04.alteeve.com          started       &lt;br /&gt;
 vm:vm0002_win1                 (none)                         disabled      &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So far, so good. Now let&#039;s start the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0002_win1&amp;lt;/span&amp;gt; VM.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt;&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
clusvcadm -e vm:vm0002_win1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Local machine trying to enable vm:vm0002_win1...Success&lt;br /&gt;
vm:vm0002_win1 is now running on an-node04.alteeve.com&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It started, but it didn&#039;t start on the node we normally want!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
clustat &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Cluster Status for an-cluster01 @ Sun May 15 12:40:21 2011&lt;br /&gt;
Member Status: Quorate&lt;br /&gt;
&lt;br /&gt;
 Member Name                             ID   Status&lt;br /&gt;
 ------ ----                             ---- ------&lt;br /&gt;
 an-node04.alteeve.com                       1 Online, Local, rgmanager&lt;br /&gt;
 an-node05.alteeve.com                       2 Online, rgmanager&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State         &lt;br /&gt;
 ------- ----                   ----- ------                   -----         &lt;br /&gt;
 service:an4_storage            an-node04.alteeve.com          started       &lt;br /&gt;
 service:an5_storage            an-node05.alteeve.com          started       &lt;br /&gt;
 vm:vm0001_ws1                  an-node04.alteeve.com          started       &lt;br /&gt;
 vm:vm0002_win1                 an-node04.alteeve.com          started       &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;vm0002_win1&amp;lt;/span&amp;gt; VM started on the node that the command was executed from. We could have added &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;-m an-node05.alteeve.com&amp;lt;/span&amp;gt; to the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clusvcadm&amp;lt;/span&amp;gt;, which we&#039;ll do later. It&#039;s already running though, so lets use this &amp;quot;mistake&amp;quot; as a chance to look at migrating the VM using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clusvcadm&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
So to tell &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; to perform a live migration from &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt; to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt;, use the special &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;-M&amp;lt;/span&amp;gt; live migration switch along with the normal &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;-m&amp;lt;/span&amp;gt; target cluster member switch. For more information on these switches, please take a few minutes to read &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;man clusvcadm&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
{{note|1=If you want to watch the VM as it migrates, you will need to use a program that connects to the server via it&#039;s IP address, as opposed to using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-manager&amp;lt;/span&amp;gt;. The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-manager&amp;lt;/span&amp;gt; connections are bound to the dom0 and will close once the VM moves to the other node. For Linux machines, you can connect using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ssh&amp;lt;/span&amp;gt; or &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vnc&amp;lt;/span&amp;gt; (by IP). For windows, you can connect using RDP (remote desktop protocol) using a program like &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;tsclient&amp;lt;/span&amp;gt; from Linux machines.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
clusvcadm -M vm:vm0002_win1 -m an-node05.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;
Trying to migrate vm:vm0002_win1 to an-node05.alteeve.com...Success&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we can use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clustat&amp;lt;/span&amp;gt; to see that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm:vm0002_win1&amp;lt;/span&amp;gt; service is now running on the proper &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05.alteeve.com&amp;lt;/span&amp;gt; node.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
clustat &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Cluster Status for an-cluster01 @ Sun May 15 12:53:30 2011&lt;br /&gt;
Member Status: Quorate&lt;br /&gt;
&lt;br /&gt;
 Member Name                             ID   Status&lt;br /&gt;
 ------ ----                             ---- ------&lt;br /&gt;
 an-node04.alteeve.com                       1 Online, Local, rgmanager&lt;br /&gt;
 an-node05.alteeve.com                       2 Online, rgmanager&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State         &lt;br /&gt;
 ------- ----                   ----- ------                   -----         &lt;br /&gt;
 service:an4_storage            an-node04.alteeve.com          started       &lt;br /&gt;
 service:an5_storage            an-node05.alteeve.com          started       &lt;br /&gt;
 vm:vm0001_ws1                  an-node04.alteeve.com          started       &lt;br /&gt;
 vm:vm0002_win1                 an-node05.alteeve.com          started       &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Before starting the migration, I logged into the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0002_win1&amp;lt;/span&amp;gt; machine and started a continuous ping against &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;google.ca&amp;lt;/span&amp;gt;. As you can see below, four packets were lost. This is the worst packet loss I was able to get in testing. Usually no packets were lost, but connections do sometimes drop for a very short period.&lt;br /&gt;
&lt;br /&gt;
[[Image:live_migration_vm0002_win2008_to_an-node05_ping.png|thumb|700px|center|Continuous ping from within the live-migrated VM against &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;google.ca&amp;lt;/span&amp;gt; using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;tsclient&amp;lt;/span&amp;gt; to monitor the connection.]]&lt;br /&gt;
&lt;br /&gt;
= Congratulations, Your Cluster Is Complete! Now, Break It! =&lt;br /&gt;
&lt;br /&gt;
You may have noticed that the two storage resources are still not set to automatically start with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt;. This is on purpose, as we now need to work through all of the possible failure modes. Until we&#039;ve done so, out cluster &#039;&#039;&#039;&#039;&#039;is not production ready&#039;&#039;&#039;&#039;&#039;! &lt;br /&gt;
&lt;br /&gt;
It&#039;s true, at this point the cluster is technically finished. As we&#039;ll soon see, we can kill a node and it&#039;s lost VMs will recover on the surviving node. &#039;&#039;&#039;However&#039;&#039;&#039;, that is only a part of this exercise.&lt;br /&gt;
&lt;br /&gt;
Remember back at the beginning how we talked about the inherent complexity of clusters? We need to now break our cluster at every point within that complexity that we can. We need to see how things go wrong so that we can learn how to resolve the problems that &#039;&#039;&#039;will&#039;&#039;&#039; arise now, while we have the luxury of time and a cluster with no real data on it. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Once you go in to production, it is too late to learn.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Backup a Second; Let&#039;s See How It&#039;s Supposed to Work ==&lt;br /&gt;
&lt;br /&gt;
Before we grab a hammer, let&#039;s go over how a clean stop and start should work.&lt;br /&gt;
&lt;br /&gt;
=== Gracefully Shutting Down the Cluster ===&lt;br /&gt;
&lt;br /&gt;
If you&#039;ve followed through this tutorial in order, you probably already have everything running, so let&#039;s start by talking about how to shut down the cluster properly.&lt;br /&gt;
&lt;br /&gt;
The stop order is:&lt;br /&gt;
* Lock &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; services that can migrate; The vm services in our case.&lt;br /&gt;
* Disable all &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; services.&lt;br /&gt;
* Stop the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; daemon.&lt;br /&gt;
* Stop the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt; daemon.&lt;br /&gt;
&lt;br /&gt;
Stopping the virtual machines is no longer a simple task. If you try to power down the VM from within the OS, the cluster will &amp;quot;recover&amp;quot; it as soon as it shuts off. Likewise if you try to stop it using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virsh shutdown &#039;&#039;domU&#039;&#039;&amp;lt;/span&amp;gt;. You can stop a VM by simple disabling it via &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt;, but that is not enough when preparing for a complete shutdown of the cluster as the VM could be restarted on another node in some cases. &lt;br /&gt;
&lt;br /&gt;
To ensure that the VM stays off, we&#039;ll &amp;quot;lock&amp;quot; the service. This will prevent all actions except for disabling (shutting down) the VM. Once quorum is lost though, this lock is lost, so you don&#039;t need to worry about unlocking it later when you restart the cluster.&lt;br /&gt;
&lt;br /&gt;
So let&#039;s take a look at the running resources.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
clustat&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Cluster Status for an-cluster01 @ Sun May 15 13:14:05 2011&lt;br /&gt;
Member Status: Quorate&lt;br /&gt;
&lt;br /&gt;
 Member Name                             ID   Status&lt;br /&gt;
 ------ ----                             ---- ------&lt;br /&gt;
 an-node04.alteeve.com                       1 Online, Local, rgmanager&lt;br /&gt;
 an-node05.alteeve.com                       2 Online, rgmanager&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State         &lt;br /&gt;
 ------- ----                   ----- ------                   -----         &lt;br /&gt;
 service:an4_storage            an-node04.alteeve.com          started       &lt;br /&gt;
 service:an5_storage            an-node05.alteeve.com          started       &lt;br /&gt;
 vm:vm0001_ws1                  an-node04.alteeve.com          started       &lt;br /&gt;
 vm:vm0002_win1                 an-node05.alteeve.com          started       &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We don&#039;t need to worry about the two storage services as they&#039;re in failover domains that, well, don&#039;t fail over anyway. Thus, we&#039;ll lock the two VMs. Note that it doesn&#039;t matter where the lock is issued.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
clusvcadm -l vm:vm0001_ws1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Resource groups locked&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;
clusvcadm -l vm:vm0002_win1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Resource groups locked&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I don&#039;t know of a way to see if a service has been locked as &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clustat&amp;lt;/span&amp;gt; will show no change. However, you can unlock a service if you decided not to shutdown the cluster by replacing the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;-l&amp;lt;/span&amp;gt; switch with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;-u&amp;lt;/span&amp;gt; in the calls above.&lt;br /&gt;
&lt;br /&gt;
[[Image:Locking_the_vm_services_01.png|center|thumb|700px|Locking the two VM services prior to cluster shutdown.]]&lt;br /&gt;
&lt;br /&gt;
Now you can disable the two VM services safely. Note that the disable call will not return until the VM has shut down, so be patient.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
clusvcadm -d vm:vm0001_ws1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Local machine disabling vm:vm0001_ws1...Success&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;
clusvcadm -d vm:vm0002_win1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Local machine disabling vm:vm0002_win1...Success&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Image:Disabling_the_vm_services_01.png|center|thumb|700px|Disabling the two VM services prior to cluster shutdown.]]&lt;br /&gt;
&lt;br /&gt;
You may notice in the screenshot above that the both VMs were disabled from &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt;, despite &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0002_win1&amp;lt;/span&amp;gt; running on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt; even without the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;-m &amp;lt;node&amp;gt;&amp;lt;/span&amp;gt; option. &lt;br /&gt;
&lt;br /&gt;
Check to confirm that the VMs are off now.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
clustat&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Cluster Status for an-cluster01 @ Sun May 15 13:38:20 2011&lt;br /&gt;
Member Status: Quorate&lt;br /&gt;
&lt;br /&gt;
 Member Name                             ID   Status&lt;br /&gt;
 ------ ----                             ---- ------&lt;br /&gt;
 an-node04.alteeve.com                       1 Online, Local, rgmanager&lt;br /&gt;
 an-node05.alteeve.com                       2 Online, rgmanager&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State         &lt;br /&gt;
 ------- ----                   ----- ------                   -----         &lt;br /&gt;
 service:an4_storage            an-node04.alteeve.com          started       &lt;br /&gt;
 service:an5_storage            an-node05.alteeve.com          started       &lt;br /&gt;
 vm:vm0001_ws1                  (an-node04.alteeve.com)        disabled      &lt;br /&gt;
 vm:vm0002_win1                 (an-node05.alteeve.com)        disabled      &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now that the VMs are down, we can stop &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; on both nodes. This will stop the storage services on each node in the process, and we don&#039;t need to worry about them being restarted as they can&#039;t fail to another node and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; will be gone before they could restart. It&#039;s a bit lazy, but it&#039;s safe.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/rgmanager 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;
Shutting down Cluster Service Manager...&lt;br /&gt;
Waiting for services to stop:                              [  OK  ]&lt;br /&gt;
Cluster Service Manager is stopped.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Image:Stopping_the_rgmanager_daemon_01.png|center|thumb|700px|Stopping the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; daemon on both nodes.]]&lt;br /&gt;
&lt;br /&gt;
Notice in the screenshot above that we can see the storage service halting after &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; is told to stop.&lt;br /&gt;
&lt;br /&gt;
We can confirm that storage is stopped simply by checking the status of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;drbd&amp;lt;/span&amp;gt;. If anything went wrong, one or more of the DRBD resources would have been held open and prevented from stopping. If the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;drbd&amp;lt;/span&amp;gt; module is unloaded, we know that the shutdown was successful.&lt;br /&gt;
&lt;br /&gt;
Check this from both nodes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/drbd 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;
drbd not loaded&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now, all that is left is to stop &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&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/cman 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;
Stopping cluster: &lt;br /&gt;
   Stopping fencing... done&lt;br /&gt;
   Stopping cman... done&lt;br /&gt;
   Stopping ccsd... done&lt;br /&gt;
   Unmounting configfs... done&lt;br /&gt;
                                                           [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
That&#039;s it, you can down safely shut down the nodes!&lt;br /&gt;
&lt;br /&gt;
=== Cold Starting the Cluster ===&lt;br /&gt;
&lt;br /&gt;
Starting the cluster from scratch is a little different from starting and joining a node to en existing cluster, as we will see later. There are two main reasons:&lt;br /&gt;
&lt;br /&gt;
* If a node doesn&#039;t hear back from the other node when &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;openais&amp;lt;/span&amp;gt; starts, it &#039;&#039;&#039;must&#039;&#039;&#039; assume that the other node has crashed and that it needs to be fenced. Remember the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;post_join_delay&amp;lt;/span&amp;gt;? That is the maximum amount of time that a node will wait on start before it fires off a fence. Thus, we must start &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt; on both nodes within &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;post_join_delay&amp;lt;/span&amp;gt; seconds of one another.&lt;br /&gt;
* DRBD will not start until both nodes can talk to each other. If you start the storage service on either node, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;drbd&amp;lt;/span&amp;gt; will hang forever waiting for the other node to show up. It is possible to change this DRBD behaviour, but doing so is an exercise for the reader. &lt;br /&gt;
&lt;br /&gt;
Once both nodes are up, you can shut one node back down and safely run of just the one node. This is because the surviving node will see the other node withdraw, and thus will confidently know that it is not going to access the clustered resources. &lt;br /&gt;
&lt;br /&gt;
With this in mind, the cold-start order is:&lt;br /&gt;
&lt;br /&gt;
# Start the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt; daemon on both nodes within &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;post_join_delay&amp;lt;/span&amp;gt; seconds.&lt;br /&gt;
# Start the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; daemon on both nodes. At this point, the storage services are not set to start with the system, so there are no timing concerns yet.&lt;br /&gt;
# Enable the storage services on both nodes. We did not enable the DRBD timeout (see &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;man drbd.conf&amp;lt;/span&amp;gt;), so we don&#039;t have timing concerns here. Be aware that the enable command on the first node will not return until the storage service has been started on the second node. For this reason, you&#039;ll want to have two terminals open; One connected to each node.&lt;br /&gt;
# Verify that the storage services are all online.&lt;br /&gt;
# Start the virtual machine resources in the order that best suits you.&lt;br /&gt;
&lt;br /&gt;
So, start &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&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/cman 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 cluster: &lt;br /&gt;
   Loading modules... done&lt;br /&gt;
   Mounting configfs... done&lt;br /&gt;
   Starting ccsd... done&lt;br /&gt;
   Starting cman... done&lt;br /&gt;
   Starting daemons... done&lt;br /&gt;
   Starting fencing... done&lt;br /&gt;
                                                           [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Image:Starting_cman_on_both_nodes_01.png|thumb|center|700px|Starting &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt; on both nodes at the same time.]]&lt;br /&gt;
&lt;br /&gt;
Now we&#039;ll start &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; on both nodes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/rgmanager 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 Cluster Service Manager:                          [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I like to make a habit of running &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clustat&amp;lt;/span&amp;gt; right after starting, just to ensure that services are or are not running, as I&#039;d expect.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
clustat&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Cluster Status for an-cluster01 @ Sun May 15 16:42:41 2011&lt;br /&gt;
Member Status: Quorate&lt;br /&gt;
&lt;br /&gt;
 Member Name                             ID   Status&lt;br /&gt;
 ------ ----                             ---- ------&lt;br /&gt;
 an-node04.alteeve.com                       1 Online, Local, rgmanager&lt;br /&gt;
 an-node05.alteeve.com                       2 Online, rgmanager&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State         &lt;br /&gt;
 ------- ----                   ----- ------                   -----         &lt;br /&gt;
 service:an4_storage            (none)                         stopped       &lt;br /&gt;
 service:an5_storage            (none)                         stopped       &lt;br /&gt;
 vm:vm0001_ws1                  (none)                         stopped       &lt;br /&gt;
 vm:vm0002_win1                 (none)                         stopped       &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Image:Starting_rgmanager_on_both_nodes_01.png|thumb|center|700px|Starting &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; on both nodes and checking service states with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clustat&amp;lt;/span&amp;gt;.]]&lt;br /&gt;
&lt;br /&gt;
If you run &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clustat&amp;lt;/span&amp;gt; immediately after &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; has started, you may see no services listed. This is not a problem, it just takes a minute for the service states to become known to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
You may notice that the log files are complaining that they could not find the VM definition files in the search path. Remember back in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; section how we talked about the delay in getting the clustered storage online? This is the problem. The definitions are on the GFS2 partition which isn&#039;t available quickly enough. Even if we started the storage resources with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt;, which we will do later, it&#039;s still not fast enough to prevent &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; from failing to find the definition files and giving up. This is why we&#039;ll need to always start the virtual machines manually. &lt;br /&gt;
&lt;br /&gt;
As an aside, this isn&#039;t a problem with [[pacemaker]], as we&#039;ll see in the [[EL6]] tutorial later.&lt;br /&gt;
&lt;br /&gt;
Let&#039;s now start the clustered storage services. As an experiment, start the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an4_storage&amp;lt;/span&amp;gt; service and then wait some time before starting the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an5_storage&amp;lt;/span&amp;gt;. You&#039;ll see that the first service will pause indefinitely, as we discussed.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt;&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
clusvcadm -e an4_storage&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Local machine trying to enable service:an4_storage...&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Image:Starting_storage_on_one_node_01.png|thumb|center|700px|Starting &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an4_storage&amp;lt;/span&amp;gt; on just &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt;.]]&lt;br /&gt;
&lt;br /&gt;
Once you start the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an5_storage&amp;lt;/span&amp;gt; service, both will complete and return to the command line. Once done, I like to run a &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;status&amp;lt;/span&amp;gt; check 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; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;gfs2&amp;lt;/span&amp;gt; to ensure that things are as I expect them.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/drbd status &amp;amp;&amp;amp; /etc/init.d/clvmd status &amp;amp;&amp;amp; /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;
drbd driver loaded OK; device status:&lt;br /&gt;
version: 8.3.8 (api:88/proto:86-94)&lt;br /&gt;
GIT-hash: d78846e52224fd00562f7c225bcc25b2d422321d build by mockbuild@builder10.centos.org, 2010-06-04 08:04:27&lt;br /&gt;
m:res  cs         ro               ds                 p  mounted  fstype&lt;br /&gt;
0:r0   Connected  Primary/Primary  UpToDate/UpToDate  C&lt;br /&gt;
1:r1   Connected  Primary/Primary  UpToDate/UpToDate  C&lt;br /&gt;
2:r2   Connected  Primary/Primary  UpToDate/UpToDate  C&lt;br /&gt;
3:r3   Connected  Primary/Primary  UpToDate/UpToDate  C&lt;br /&gt;
clvmd (pid  6283) is running...&lt;br /&gt;
Clustered Volume Groups: drbd_an5_vg0 drbd_an4_vg0 drbd_sh0_vg0&lt;br /&gt;
Active clustered Logical Volumes: /dev/drbd_an5_vg0/vm0002_1 /dev/drbd_an4_vg0/vm0001_1 /dev/drbd_sh0_vg0/xen_shared&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;
[[Image:Starting_storage_on_the_other_node_01.png|thumb|center|700px|Starting &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an5_storage&amp;lt;/span&amp;gt; on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt; and then performing the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;status&amp;lt;/span&amp;gt; checks.]]&lt;br /&gt;
&lt;br /&gt;
Everything is in place, so now we can start the virtual machines. Given that VMs can run on either node, it&#039;s a good habit to explicitly define the target node using the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;-m&amp;lt;/span&amp;gt; &amp;quot;member&amp;quot; switch.&lt;br /&gt;
&lt;br /&gt;
Start the web server:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
clusvcadm -e vm:vm0001_ws1 -m an-node04.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;
Member an-node04.alteeve.com trying to enable vm:vm0001_ws1...Success&lt;br /&gt;
vm:vm0001_ws1 is now running on an-node04.alteeve.com&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Start the windows server:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
clusvcadm -e vm:vm0002_win1 -m an-node05.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;
Member an-node05.alteeve.com trying to enable vm:vm0002_win1...Success&lt;br /&gt;
vm:vm0002_win1 is now running on an-node05.alteeve.com&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check that they are running using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clustat&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;
clustat&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Cluster Status for an-cluster01 @ Sun May 15 17:05:49 2011&lt;br /&gt;
Member Status: Quorate&lt;br /&gt;
&lt;br /&gt;
 Member Name                             ID   Status&lt;br /&gt;
 ------ ----                             ---- ------&lt;br /&gt;
 an-node04.alteeve.com                       1 Online, Local, rgmanager&lt;br /&gt;
 an-node05.alteeve.com                       2 Online, rgmanager&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State         &lt;br /&gt;
 ------- ----                   ----- ------                   -----         &lt;br /&gt;
 service:an4_storage            an-node04.alteeve.com          started       &lt;br /&gt;
 service:an5_storage            an-node05.alteeve.com          started       &lt;br /&gt;
 vm:vm0001_ws1                  an-node04.alteeve.com          started       &lt;br /&gt;
 vm:vm0002_win1                 an-node05.alteeve.com          started       &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There we have it! The cluster is up and running from a complete cold start.&lt;br /&gt;
&lt;br /&gt;
== Testing Migration and Recovery ==&lt;br /&gt;
&lt;br /&gt;
We&#039;ve already looked at live migration of VMs before they were added to the cluster, but we&#039;ve not yet looked at live migrations &#039;&#039;within&#039;&#039; the cluster.&lt;br /&gt;
&lt;br /&gt;
Our tests will cover:&lt;br /&gt;
&lt;br /&gt;
* A controlled migration, as we would do before and after planned maintenance on a node.&lt;br /&gt;
* Crashing a VM directly, and making sure that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; detects the crash and restarts the VM.&lt;br /&gt;
* Crashing a VM enough times and within enough time to trigger a relocation to the second node.&lt;br /&gt;
* Crashing the host node and checking that lost VMs restart on the surviving node.&lt;br /&gt;
&lt;br /&gt;
=== Controlled Live Migration Using clusvcadm ===&lt;br /&gt;
&lt;br /&gt;
There will be times when you will want to migrate a VM off of a node. The classic example would be to upgrade the hardware, install a new kernel or repair a RAID array. When you know that ahead of time that a node will go down, you can easily migrate the VM services off of it to another node in the cluster.&lt;br /&gt;
&lt;br /&gt;
Let&#039;s look at migrating the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0001_ws1&amp;lt;/span&amp;gt; VM from &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt; to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt;. First, confirm that it is on the source node.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
clustat&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Cluster Status for an-cluster01 @ Sun May 15 17:05:49 2011&lt;br /&gt;
Member Status: Quorate&lt;br /&gt;
&lt;br /&gt;
 Member Name                             ID   Status&lt;br /&gt;
 ------ ----                             ---- ------&lt;br /&gt;
 an-node04.alteeve.com                       1 Online, Local, rgmanager&lt;br /&gt;
 an-node05.alteeve.com                       2 Online, rgmanager&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State         &lt;br /&gt;
 ------- ----                   ----- ------                   -----         &lt;br /&gt;
 service:an4_storage            an-node04.alteeve.com          started       &lt;br /&gt;
 service:an5_storage            an-node05.alteeve.com          started       &lt;br /&gt;
 vm:vm0001_ws1                  an-node04.alteeve.com          started       &lt;br /&gt;
 vm:vm0002_win1                 an-node05.alteeve.com          started       &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now perform the actual migration. Note that we will be using the special &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;-M&amp;lt;/span&amp;gt; (live migrate) switch, rather than the usual &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;-r&amp;lt;/span&amp;gt; (relocate) switch.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
clusvcadm -M vm:vm0001_ws1 -m an-node05.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;
Trying to migrate vm:vm0001_ws1 to an-node05.alteeve.com...Success&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you then run &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clustat&amp;lt;/span&amp;gt; again, you will see the VM now running on the target node.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
clustat&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Cluster Status for an-cluster01 @ Sun May 15 17:21:31 2011&lt;br /&gt;
Member Status: Quorate&lt;br /&gt;
&lt;br /&gt;
 Member Name                             ID   Status&lt;br /&gt;
 ------ ----                             ---- ------&lt;br /&gt;
 an-node04.alteeve.com                       1 Online, Local, rgmanager&lt;br /&gt;
 an-node05.alteeve.com                       2 Online, rgmanager&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State         &lt;br /&gt;
 ------- ----                   ----- ------                   -----         &lt;br /&gt;
 service:an4_storage            an-node04.alteeve.com          started       &lt;br /&gt;
 service:an5_storage            an-node05.alteeve.com          started       &lt;br /&gt;
 vm:vm0001_ws1                  an-node05.alteeve.com          started       &lt;br /&gt;
 vm:vm0002_win1                 an-node05.alteeve.com          started       &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Image:Live_migrating_a_vm_using_clusvcadm_01.png|center|thumb|700px|Live migrating &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0001_ws1&amp;lt;/span&amp;gt; from &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt; to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt;.]]&lt;br /&gt;
&lt;br /&gt;
That was easy!&lt;br /&gt;
&lt;br /&gt;
=== Crashing the VM Itself ===&lt;br /&gt;
&lt;br /&gt;
There are many ways to crash a VM, and you can and should try crashing it all the ways that you can think of. In [[Linux]] machines, we can trigger a crash by &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;echo&amp;lt;/span&amp;gt;&#039;ing &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;c&amp;lt;/span&amp;gt; to the special &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/proc/sysrq-trigger&amp;lt;/span&amp;gt; file. This will instantly crash the server and you will not see the command return. &lt;br /&gt;
&lt;br /&gt;
Let&#039;s do this to the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0001_ws1&amp;lt;/span&amp;gt; VM. Connect to the virtual machine, either directly to it&#039;s console by running &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xm console vm0001_ws1&amp;lt;/span&amp;gt; from the host, or by &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ssh&amp;lt;/span&amp;gt;&#039;ing into the machine. Once logged in, run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
echo c &amp;gt; /proc/sysrq-trigger&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Within moments, you will see the xen &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vifX.Y&amp;lt;/span&amp;gt; interfaces disable and then a new &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vifZ.Y&amp;lt;/span&amp;gt; get created as the VM is restarted. If you are fast enough, you may see &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clustat&amp;lt;/span&amp;gt; report the VM as disabled, though it starts up very quickly so it may be hard to catch.&lt;br /&gt;
&lt;br /&gt;
[[Image:Watching_a_vm_restart_via_rgmanager_01.png|thumb|700px|center|Killing a VM internally and watching it restart.]]&lt;br /&gt;
&lt;br /&gt;
=== Crashing the VM Enough Times to Trigger a Relocation ===&lt;br /&gt;
&lt;br /&gt;
{{note|1=This doesn&#039;t seem to be working at the moment. Filed a Red Hat [https://bugzilla.redhat.com/show_bug.cgi?id=698369 bugzilla] ticket.}}&lt;br /&gt;
&lt;br /&gt;
VM always restarts on the node it was last running on.&lt;br /&gt;
&lt;br /&gt;
=== Crashing the Host Node ===&lt;br /&gt;
&lt;br /&gt;
{{Note|1=Once you crash the host node, both DRBD and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt; will trigger fence calls nearly simultaneously. Some fence devices do not handle this well and will either fail, or report a failed fence to the cluster. If this is the case with your fence device, you can use the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[RHCS_v2_cluster.conf#post_fail_delay|post_fail_delay]]&amp;lt;/span&amp;gt; option in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cluster.conf&amp;lt;/span&amp;gt;.}}&lt;br /&gt;
&lt;br /&gt;
As we did when we crashed the virtual machine, we will crash the operating system on the node currently running one of the VMs. In the case, we have &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0001_ws1&amp;lt;/span&amp;gt; running on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0002_win1&amp;lt;/span&amp;gt; running on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&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;
clustat&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Cluster Status for an-cluster01 @ Sun May 15 19:41:21 2011&lt;br /&gt;
Member Status: Quorate&lt;br /&gt;
&lt;br /&gt;
 Member Name                             ID   Status&lt;br /&gt;
 ------ ----                             ---- ------&lt;br /&gt;
 an-node04.alteeve.com                       1 Online, Local, rgmanager&lt;br /&gt;
 an-node05.alteeve.com                       2 Online, rgmanager&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State         &lt;br /&gt;
 ------- ----                   ----- ------                   -----         &lt;br /&gt;
 service:an4_storage            an-node04.alteeve.com          started       &lt;br /&gt;
 service:an5_storage            an-node05.alteeve.com          started       &lt;br /&gt;
 vm:vm0001_ws1                  an-node04.alteeve.com          started       &lt;br /&gt;
 vm:vm0002_win1                 an-node05.alteeve.com          started       &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once we crash &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt;, watch the log file in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt;. You will see DRBD lose contact with the other side, the crashed &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt; machine get fenced, the cluster will reform and finally the resource manager will restart the lost virtual machine. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt;&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
echo c &amp;gt; /proc/sysrq-trigger&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Watching &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt;, we will see the following in [[syslog]]:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
May 15 19:45:52 an-node05 kernel: block drbd3: PingAck did not arrive in time.&lt;br /&gt;
May 15 19:45:52 an-node05 kernel: block drbd3: peer( Primary -&amp;gt; Unknown ) conn( Connected -&amp;gt; NetworkFailure ) pdsk( UpToDate -&amp;gt; DUnknown ) &lt;br /&gt;
May 15 19:45:52 an-node05 kernel: block drbd3: asender terminated&lt;br /&gt;
May 15 19:45:52 an-node05 kernel: block drbd3: Terminating asender thread&lt;br /&gt;
May 15 19:45:52 an-node05 kernel: block drbd3: short read expecting header on sock: r=-512&lt;br /&gt;
May 15 19:45:52 an-node05 kernel: block drbd3: Creating new current UUID&lt;br /&gt;
May 15 19:45:52 an-node05 kernel: block drbd3: Connection closed&lt;br /&gt;
May 15 19:45:52 an-node05 kernel: block drbd3: conn( NetworkFailure -&amp;gt; Unconnected ) &lt;br /&gt;
May 15 19:45:52 an-node05 kernel: block drbd3: receiver terminated&lt;br /&gt;
May 15 19:45:52 an-node05 kernel: block drbd3: Restarting receiver thread&lt;br /&gt;
May 15 19:45:52 an-node05 kernel: block drbd3: receiver (re)started&lt;br /&gt;
May 15 19:45:52 an-node05 kernel: block drbd3: conn( Unconnected -&amp;gt; WFConnection ) &lt;br /&gt;
May 15 19:45:57 an-node05 kernel: block drbd2: PingAck did not arrive in time.&lt;br /&gt;
May 15 19:45:57 an-node05 kernel: block drbd2: peer( Primary -&amp;gt; Unknown ) conn( Connected -&amp;gt; NetworkFailure ) pdsk( UpToDate -&amp;gt; DUnknown ) &lt;br /&gt;
May 15 19:45:57 an-node05 kernel: block drbd2: asender terminated&lt;br /&gt;
May 15 19:45:57 an-node05 kernel: block drbd2: Terminating asender thread&lt;br /&gt;
May 15 19:45:57 an-node05 kernel: block drbd2: short read expecting header on sock: r=-512&lt;br /&gt;
May 15 19:45:57 an-node05 kernel: block drbd2: Creating new current UUID&lt;br /&gt;
May 15 19:45:57 an-node05 kernel: block drbd2: Connection closed&lt;br /&gt;
May 15 19:45:57 an-node05 kernel: block drbd2: conn( NetworkFailure -&amp;gt; Unconnected ) &lt;br /&gt;
May 15 19:45:57 an-node05 kernel: block drbd2: receiver terminated&lt;br /&gt;
May 15 19:45:57 an-node05 kernel: block drbd2: Restarting receiver thread&lt;br /&gt;
May 15 19:45:57 an-node05 kernel: block drbd2: receiver (re)started&lt;br /&gt;
May 15 19:45:57 an-node05 kernel: block drbd2: conn( Unconnected -&amp;gt; WFConnection ) &lt;br /&gt;
May 15 19:46:00 an-node05 kernel: block drbd0: PingAck did not arrive in time.&lt;br /&gt;
May 15 19:46:00 an-node05 kernel: block drbd0: peer( Primary -&amp;gt; Unknown ) conn( Connected -&amp;gt; NetworkFailure ) pdsk( UpToDate -&amp;gt; DUnknown ) &lt;br /&gt;
May 15 19:46:00 an-node05 kernel: block drbd0: asender terminated&lt;br /&gt;
May 15 19:46:00 an-node05 kernel: block drbd0: Terminating asender thread&lt;br /&gt;
May 15 19:46:00 an-node05 kernel: block drbd0: short read expecting header on sock: r=-512&lt;br /&gt;
May 15 19:46:00 an-node05 kernel: block drbd0: Creating new current UUID&lt;br /&gt;
May 15 19:46:00 an-node05 kernel: block drbd0: Connection closed&lt;br /&gt;
May 15 19:46:00 an-node05 kernel: block drbd0: conn( NetworkFailure -&amp;gt; Unconnected ) &lt;br /&gt;
May 15 19:46:00 an-node05 kernel: block drbd0: receiver terminated&lt;br /&gt;
May 15 19:46:00 an-node05 kernel: block drbd0: Restarting receiver thread&lt;br /&gt;
May 15 19:46:00 an-node05 kernel: block drbd0: receiver (re)started&lt;br /&gt;
May 15 19:46:00 an-node05 kernel: block drbd0: conn( Unconnected -&amp;gt; WFConnection ) &lt;br /&gt;
May 15 19:46:01 an-node05 openais[4704]: [TOTEM] The token was lost in the OPERATIONAL state. &lt;br /&gt;
May 15 19:46:01 an-node05 openais[4704]: [TOTEM] Receive multicast socket recv buffer size (320000 bytes). &lt;br /&gt;
May 15 19:46:01 an-node05 openais[4704]: [TOTEM] Transmit multicast socket send buffer size (262142 bytes). &lt;br /&gt;
May 15 19:46:01 an-node05 openais[4704]: [TOTEM] entering GATHER state from 2. &lt;br /&gt;
May 15 19:46:01 an-node05 kernel: block drbd1: PingAck did not arrive in time.&lt;br /&gt;
May 15 19:46:01 an-node05 kernel: block drbd1: peer( Primary -&amp;gt; Unknown ) conn( Connected -&amp;gt; NetworkFailure ) pdsk( UpToDate -&amp;gt; DUnknown ) &lt;br /&gt;
May 15 19:46:01 an-node05 kernel: block drbd1: asender terminated&lt;br /&gt;
May 15 19:46:01 an-node05 kernel: block drbd1: Terminating asender thread&lt;br /&gt;
May 15 19:46:01 an-node05 kernel: block drbd1: short read expecting header on sock: r=-512&lt;br /&gt;
May 15 19:46:01 an-node05 kernel: block drbd1: Creating new current UUID&lt;br /&gt;
May 15 19:46:01 an-node05 kernel: block drbd1: Connection closed&lt;br /&gt;
May 15 19:46:01 an-node05 kernel: block drbd1: conn( NetworkFailure -&amp;gt; Unconnected ) &lt;br /&gt;
May 15 19:46:01 an-node05 kernel: block drbd1: receiver terminated&lt;br /&gt;
May 15 19:46:01 an-node05 kernel: block drbd1: Restarting receiver thread&lt;br /&gt;
May 15 19:46:01 an-node05 kernel: block drbd1: receiver (re)started&lt;br /&gt;
May 15 19:46:01 an-node05 kernel: block drbd1: conn( Unconnected -&amp;gt; WFConnection ) &lt;br /&gt;
May 15 19:46:03 an-node05 openais[4704]: [TOTEM] entering GATHER state from 0. &lt;br /&gt;
May 15 19:46:03 an-node05 openais[4704]: [TOTEM] Creating commit token because I am the rep. &lt;br /&gt;
May 15 19:46:03 an-node05 openais[4704]: [TOTEM] Storing new sequence id for ring 140 &lt;br /&gt;
May 15 19:46:03 an-node05 openais[4704]: [TOTEM] entering COMMIT state. &lt;br /&gt;
May 15 19:46:03 an-node05 openais[4704]: [TOTEM] entering RECOVERY state. &lt;br /&gt;
May 15 19:46:03 an-node05 openais[4704]: [TOTEM] position [0] member 192.168.3.75: &lt;br /&gt;
May 15 19:46:03 an-node05 openais[4704]: [TOTEM] previous ring seq 316 rep 192.168.3.74 &lt;br /&gt;
May 15 19:46:03 an-node05 openais[4704]: [TOTEM] aru 7b high delivered 7b received flag 1 &lt;br /&gt;
May 15 19:46:03 an-node05 openais[4704]: [TOTEM] Did not need to originate any messages in recovery. &lt;br /&gt;
May 15 19:46:03 an-node05 openais[4704]: [TOTEM] Sending initial ORF token &lt;br /&gt;
May 15 19:46:03 an-node05 openais[4704]: [CLM  ] CLM CONFIGURATION CHANGE &lt;br /&gt;
May 15 19:46:03 an-node05 openais[4704]: [CLM  ] New Configuration: &lt;br /&gt;
May 15 19:46:03 an-node05 openais[4704]: [CLM  ] 	r(0) ip(192.168.3.75)  &lt;br /&gt;
May 15 19:46:03 an-node05 kernel: dlm: closing connection to node 1&lt;br /&gt;
May 15 19:46:03 an-node05 fenced[4724]: an-node04.alteeve.com not a cluster member after 0 sec post_fail_delay&lt;br /&gt;
May 15 19:46:03 an-node05 openais[4704]: [CLM  ] Members Left: &lt;br /&gt;
May 15 19:46:03 an-node05 fenced[4724]: fencing node &amp;quot;an-node04.alteeve.com&amp;quot;&lt;br /&gt;
May 15 19:46:03 an-node05 openais[4704]: [CLM  ] 	r(0) ip(192.168.3.74)  &lt;br /&gt;
May 15 19:46:03 an-node05 openais[4704]: [CLM  ] Members Joined: &lt;br /&gt;
May 15 19:46:03 an-node05 openais[4704]: [CLM  ] CLM CONFIGURATION CHANGE &lt;br /&gt;
May 15 19:46:03 an-node05 openais[4704]: [CLM  ] New Configuration: &lt;br /&gt;
May 15 19:46:03 an-node05 openais[4704]: [CLM  ] 	r(0) ip(192.168.3.75)  &lt;br /&gt;
May 15 19:46:03 an-node05 openais[4704]: [CLM  ] Members Left: &lt;br /&gt;
May 15 19:46:03 an-node05 openais[4704]: [CLM  ] Members Joined: &lt;br /&gt;
May 15 19:46:03 an-node05 openais[4704]: [SYNC ] This node is within the primary component and will provide service. &lt;br /&gt;
May 15 19:46:03 an-node05 openais[4704]: [TOTEM] entering OPERATIONAL state. &lt;br /&gt;
May 15 19:46:03 an-node05 openais[4704]: [CLM  ] got nodejoin message 192.168.3.75 &lt;br /&gt;
May 15 19:46:03 an-node05 openais[4704]: [CPG  ] got joinlist message from node 2 &lt;br /&gt;
May 15 19:46:16 an-node05 fenced[4724]: fence &amp;quot;an-node04.alteeve.com&amp;quot; success&lt;br /&gt;
May 15 19:46:16 an-node05 kernel: GFS2: fsid=an-cluster01:xen_shared.0: jid=1: Trying to acquire journal lock...&lt;br /&gt;
May 15 19:46:16 an-node05 kernel: GFS2: fsid=an-cluster01:xen_shared.0: jid=1: Looking at journal...&lt;br /&gt;
May 15 19:46:16 an-node05 kernel: GFS2: fsid=an-cluster01:xen_shared.0: jid=1: Acquiring the transaction lock...&lt;br /&gt;
May 15 19:46:16 an-node05 kernel: GFS2: fsid=an-cluster01:xen_shared.0: jid=1: Replaying journal...&lt;br /&gt;
May 15 19:46:16 an-node05 kernel: GFS2: fsid=an-cluster01:xen_shared.0: jid=1: Replayed 1 of 1 blocks&lt;br /&gt;
May 15 19:46:16 an-node05 kernel: GFS2: fsid=an-cluster01:xen_shared.0: jid=1: Found 0 revoke tags&lt;br /&gt;
May 15 19:46:16 an-node05 kernel: GFS2: fsid=an-cluster01:xen_shared.0: jid=1: Journal replayed in 1s&lt;br /&gt;
May 15 19:46:16 an-node05 kernel: GFS2: fsid=an-cluster01:xen_shared.0: jid=1: Done&lt;br /&gt;
May 15 19:46:16 an-node05 clurgmgrd[4302]: &amp;lt;notice&amp;gt; Marking service:an4_storage as stopped: Restricted domain unavailable &lt;br /&gt;
May 15 19:46:16 an-node05 clurgmgrd[4302]: &amp;lt;notice&amp;gt; Taking over service vm:vm0001_ws1 from down member an-node04.alteeve.com &lt;br /&gt;
May 15 19:46:18 an-node05 kernel: device vif5.0 entered promiscuous mode&lt;br /&gt;
May 15 19:46:18 an-node05 kernel: ADDRCONF(NETDEV_UP): vif5.0: link is not ready&lt;br /&gt;
May 15 19:46:18 an-node05 clurgmgrd[4302]: &amp;lt;notice&amp;gt; Service vm:vm0001_ws1 started &lt;br /&gt;
May 15 19:46:22 an-node05 kernel: blkback: ring-ref 8, event-channel 8, protocol 1 (x86_64-abi)&lt;br /&gt;
May 15 19:46:33 an-node05 kernel: ADDRCONF(NETDEV_CHANGE): vif5.0: link becomes ready&lt;br /&gt;
May 15 19:46:33 an-node05 kernel: xenbr0: port 4(vif5.0) entering learning state&lt;br /&gt;
May 15 19:46:48 an-node05 kernel: xenbr0: topology change detected, propagating&lt;br /&gt;
May 15 19:46:48 an-node05 kernel: xenbr0: port 4(vif5.0) entering forwarding state&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{note|1=Do to a bug in [[Node Assassin]], DRBD was not configured to fence the remote node on failure, so the only fence call came from &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt;.}}&lt;br /&gt;
&lt;br /&gt;
[[Image:Crashed_an-node04_vm_recovery_01.png|thumb|center|900px|VM recovery beginning on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt; after crashing &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt;.]]&lt;br /&gt;
&lt;br /&gt;
Above we can see that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04.alteeve.com&amp;lt;/span&amp;gt; is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Offline&amp;lt;/span&amp;gt; and the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm:vm0001_ws1&amp;lt;/span&amp;gt; service is automatically &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;starting&amp;lt;/span&amp;gt; on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
Success!&lt;br /&gt;
&lt;br /&gt;
Once you&#039;ve rejoined &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt; to the cluster, simply live-migrate &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0001_ws1&amp;lt;/span&amp;gt; back to it.&lt;br /&gt;
&lt;br /&gt;
=== Further Testing ===&lt;br /&gt;
&lt;br /&gt;
This tutorial could quickly overflow with failure testing scenarios. It is somewhat outside the scope of this tutorial, so we will stop here.&lt;br /&gt;
&lt;br /&gt;
As a rule of thumb, you should expect to spend &#039;&#039;at least&#039;&#039; as much time breaking and repairing your cluster as you did building it in the first place.&lt;br /&gt;
&lt;br /&gt;
A small list of things to test:&lt;br /&gt;
* Pulling each network cable, one at a time, and see how things fail and what is needed to restore the cluster.&lt;br /&gt;
* Kill the power on switch(es). See how things fail when all network connections are lost.&lt;br /&gt;
* Pull hard drives from the server (or &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;dd if=/dev/zero of=/dev/xx count=10000&amp;lt;/span&amp;gt; drives) to fail out the arrays.&lt;br /&gt;
* Reformat a node, then rebuild it from scratch and join it back with the surviving node.&lt;br /&gt;
* And so forth. Be destructively creative!&lt;br /&gt;
&lt;br /&gt;
= Testing Done - Going Into Production =&lt;br /&gt;
&lt;br /&gt;
Once you finish testing, the last thing to do is to change the storage resources to automatically start with the cluster. To do this, simply change &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;autostart=&amp;quot;0&amp;quot;&amp;lt;/span&amp;gt; to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;autostart=&amp;quot;1&amp;quot;&amp;lt;/span&amp;gt; for the two storage resources.&lt;br /&gt;
&lt;br /&gt;
{{note|1=Do &#039;&#039;not&#039;&#039; set &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;autostart=&amp;quot;1&amp;quot;&amp;lt;/span&amp;gt; for the virtual machine resources. As mentioned before, the storage does not come up fast enough and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; will give up trying to start the VMs. You will need to manually start the VM resources when you cold boot the cluster.}}&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;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;rm&amp;gt;&lt;br /&gt;
                ...&lt;br /&gt;
                &amp;lt;service autostart=&amp;quot;1&amp;quot; domain=&amp;quot;an4_only&amp;quot; exclusive=&amp;quot;0&amp;quot; max_restarts=&amp;quot;0&amp;quot; name=&amp;quot;an4_storage&amp;quot; recovery=&amp;quot;restart&amp;quot; restart_expire_time=&amp;quot;0&amp;quot;&amp;gt;&lt;br /&gt;
                        &amp;lt;script ref=&amp;quot;drbd&amp;quot;&amp;gt;&lt;br /&gt;
                                &amp;lt;script ref=&amp;quot;clvmd&amp;quot;&amp;gt;&lt;br /&gt;
                                        &amp;lt;script ref=&amp;quot;gfs2&amp;quot;/&amp;gt;&lt;br /&gt;
                                &amp;lt;/script&amp;gt;&lt;br /&gt;
                        &amp;lt;/script&amp;gt;&lt;br /&gt;
                &amp;lt;/service&amp;gt;&lt;br /&gt;
                &amp;lt;service autostart=&amp;quot;1&amp;quot; domain=&amp;quot;an5_only&amp;quot; exclusive=&amp;quot;0&amp;quot; max_restarts=&amp;quot;0&amp;quot; name=&amp;quot;an5_storage&amp;quot; recovery=&amp;quot;restart&amp;quot; restart_expire_time=&amp;quot;0&amp;quot;&amp;gt;&lt;br /&gt;
                        &amp;lt;script ref=&amp;quot;drbd&amp;quot;&amp;gt;&lt;br /&gt;
                                &amp;lt;script ref=&amp;quot;clvmd&amp;quot;&amp;gt;&lt;br /&gt;
                                        &amp;lt;script ref=&amp;quot;gfs2&amp;quot;/&amp;gt;&lt;br /&gt;
                                &amp;lt;/script&amp;gt;&lt;br /&gt;
                        &amp;lt;/script&amp;gt;&lt;br /&gt;
                &amp;lt;/service&amp;gt;&lt;br /&gt;
        &amp;lt;/rm&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Validate and push out the new configuration.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
xmllint --relaxng /usr/share/system-config-cluster/misc/cluster.ng /etc/cluster/cluster.conf&lt;br /&gt;
&amp;lt;/source&amp;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-cluster01&amp;quot; config_version=&amp;quot;16&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;cman expected_votes=&amp;quot;1&amp;quot; two_node=&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-node04.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;fence_na01&amp;quot; port=&amp;quot;04&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-node05.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;fence_na01&amp;quot; port=&amp;quot;03&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 agent=&amp;quot;fence_na&amp;quot; ipaddr=&amp;quot;fence_na01.alteeve.com&amp;quot; login=&amp;quot;admin&amp;quot; name=&amp;quot;fence_na01&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;fence_daemon post_join_delay=&amp;quot;60&amp;quot;/&amp;gt;&lt;br /&gt;
        &amp;lt;totem rrp_mode=&amp;quot;none&amp;quot; secauth=&amp;quot;off&amp;quot;/&amp;gt;&lt;br /&gt;
        &amp;lt;rm&amp;gt;&lt;br /&gt;
                &amp;lt;resources&amp;gt;&lt;br /&gt;
                        &amp;lt;script file=&amp;quot;/etc/init.d/drbd&amp;quot; name=&amp;quot;drbd&amp;quot;/&amp;gt;&lt;br /&gt;
                        &amp;lt;script file=&amp;quot;/etc/init.d/clvmd&amp;quot; name=&amp;quot;clvmd&amp;quot;/&amp;gt;&lt;br /&gt;
                        &amp;lt;script file=&amp;quot;/etc/init.d/gfs2&amp;quot; name=&amp;quot;gfs2&amp;quot;/&amp;gt;&lt;br /&gt;
                &amp;lt;/resources&amp;gt;&lt;br /&gt;
		&amp;lt;failoverdomains&amp;gt;&lt;br /&gt;
			&amp;lt;failoverdomain name=&amp;quot;an4_only&amp;quot; nofailback=&amp;quot;0&amp;quot; ordered=&amp;quot;0&amp;quot; restricted=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
				&amp;lt;failoverdomainnode name=&amp;quot;an-node04.alteeve.com&amp;quot; priority=&amp;quot;1&amp;quot;/&amp;gt;&lt;br /&gt;
			&amp;lt;/failoverdomain&amp;gt;&lt;br /&gt;
			&amp;lt;failoverdomain name=&amp;quot;an5_only&amp;quot; nofailback=&amp;quot;0&amp;quot; ordered=&amp;quot;0&amp;quot; restricted=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
				&amp;lt;failoverdomainnode name=&amp;quot;an-node05.alteeve.com&amp;quot; priority=&amp;quot;1&amp;quot;/&amp;gt;&lt;br /&gt;
			&amp;lt;/failoverdomain&amp;gt;&lt;br /&gt;
			&amp;lt;failoverdomain name=&amp;quot;an4_primary&amp;quot; nofailback=&amp;quot;0&amp;quot; ordered=&amp;quot;1&amp;quot; restricted=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
				&amp;lt;failoverdomainnode name=&amp;quot;an-node04.alteeve.com&amp;quot; priority=&amp;quot;1&amp;quot;/&amp;gt;&lt;br /&gt;
				&amp;lt;failoverdomainnode name=&amp;quot;an-node05.alteeve.com&amp;quot; priority=&amp;quot;2&amp;quot;/&amp;gt;&lt;br /&gt;
			&amp;lt;/failoverdomain&amp;gt;&lt;br /&gt;
			&amp;lt;failoverdomain name=&amp;quot;an5_primary&amp;quot; nofailback=&amp;quot;0&amp;quot; ordered=&amp;quot;1&amp;quot; restricted=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
				&amp;lt;failoverdomainnode name=&amp;quot;an-node04.alteeve.com&amp;quot; priority=&amp;quot;2&amp;quot;/&amp;gt;&lt;br /&gt;
				&amp;lt;failoverdomainnode name=&amp;quot;an-node05.alteeve.com&amp;quot; priority=&amp;quot;1&amp;quot;/&amp;gt;&lt;br /&gt;
			&amp;lt;/failoverdomain&amp;gt;&lt;br /&gt;
		&amp;lt;/failoverdomains&amp;gt;&lt;br /&gt;
		&amp;lt;service autostart=&amp;quot;1&amp;quot; domain=&amp;quot;an4_only&amp;quot; exclusive=&amp;quot;0&amp;quot; max_restarts=&amp;quot;0&amp;quot; name=&amp;quot;an4_storage&amp;quot; recovery=&amp;quot;restart&amp;quot; restart_expire_time=&amp;quot;0&amp;quot;&amp;gt;&lt;br /&gt;
			&amp;lt;script ref=&amp;quot;drbd&amp;quot;&amp;gt;&lt;br /&gt;
				&amp;lt;script ref=&amp;quot;clvmd&amp;quot;&amp;gt;&lt;br /&gt;
					&amp;lt;script ref=&amp;quot;gfs2&amp;quot;/&amp;gt;&lt;br /&gt;
				&amp;lt;/script&amp;gt;&lt;br /&gt;
			&amp;lt;/script&amp;gt;&lt;br /&gt;
		&amp;lt;/service&amp;gt;&lt;br /&gt;
		&amp;lt;service autostart=&amp;quot;1&amp;quot; domain=&amp;quot;an5_only&amp;quot; exclusive=&amp;quot;0&amp;quot; max_restarts=&amp;quot;0&amp;quot; name=&amp;quot;an5_storage&amp;quot; recovery=&amp;quot;restart&amp;quot; restart_expire_time=&amp;quot;0&amp;quot;&amp;gt;&lt;br /&gt;
			&amp;lt;script ref=&amp;quot;drbd&amp;quot;&amp;gt;&lt;br /&gt;
				&amp;lt;script ref=&amp;quot;clvmd&amp;quot;&amp;gt;&lt;br /&gt;
					&amp;lt;script ref=&amp;quot;gfs2&amp;quot;/&amp;gt;&lt;br /&gt;
				&amp;lt;/script&amp;gt;&lt;br /&gt;
			&amp;lt;/script&amp;gt;&lt;br /&gt;
		&amp;lt;/service&amp;gt;&lt;br /&gt;
                &amp;lt;vm name=&amp;quot;vm0001_ws1&amp;quot; domain=&amp;quot;an4_primary&amp;quot; path=&amp;quot;/xen_shared/definitions/&amp;quot; autostart=&amp;quot;0&amp;quot; exclusive=&amp;quot;0&amp;quot; recovery=&amp;quot;restart&amp;quot; max_restarts=&amp;quot;2&amp;quot; restart_expire_time=&amp;quot;600&amp;quot;/&amp;gt;&lt;br /&gt;
                &amp;lt;vm name=&amp;quot;vm0002_win1&amp;quot; domain=&amp;quot;an5_primary&amp;quot; path=&amp;quot;/xen_shared/definitions/&amp;quot; autostart=&amp;quot;0&amp;quot; exclusive=&amp;quot;0&amp;quot; recovery=&amp;quot;restart&amp;quot; max_restarts=&amp;quot;2&amp;quot; restart_expire_time=&amp;quot;600&amp;quot;/&amp;gt;&lt;br /&gt;
        &amp;lt;/rm&amp;gt;&lt;br /&gt;
&amp;lt;/cluster&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;
/etc/cluster/cluster.conf validates&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;
ccs_tool update /etc/cluster/cluster.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;
Config file updated from version 15 to 16&lt;br /&gt;
&lt;br /&gt;
Update complete.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now stop and then start again &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt;. When it starts, you will not need to enable the storage resources, they will start automatically.&lt;br /&gt;
&lt;br /&gt;
== Complete! ==&lt;br /&gt;
&lt;br /&gt;
We&#039;re done.&lt;br /&gt;
&lt;br /&gt;
I hope you&#039;ve found this tutorial useful. If you have any feedback, criticism, corrections or comments, please let me know.&lt;br /&gt;
&lt;br /&gt;
-- [[Digimer]]&lt;br /&gt;
&lt;br /&gt;
= Common Administrative Tasks =&lt;br /&gt;
&lt;br /&gt;
This is far from a comprehensive list!&lt;br /&gt;
&lt;br /&gt;
This section will attempt to cover some of the day to day tasks you may want to perform on you cluster of VMs.&lt;br /&gt;
&lt;br /&gt;
== Enabling MTU Sizes Over 1500 Bytes ==&lt;br /&gt;
&lt;br /&gt;
{{warning|1=This requires the use of a kernel compiled outside of the main repos. For this reason, do not apply this unless you have a particular need for jumbo frames and are willing to take on the additional risk of installing and running an unsupported kernel.}}&lt;br /&gt;
&lt;br /&gt;
Currently, enabling MTU sizes over 1500 bytes requires compiling a new kernel and replacing/patching two Xen scripts. I&#039;ve made a pre-compiled kernel and the patched scripts available on [https://alteeve.com/xen https://alteeve.com/xen]. [[Red Hat]] bugzilla bugs have been filed, but they missed the window for being added to [[EL5]].7. They will be merged in for [[EL5]].8, but that is some time off.&lt;br /&gt;
&lt;br /&gt;
You can track the bug progress below:&lt;br /&gt;
* [https://bugzilla.redhat.com/show_bug.cgi?id=697021 Patch needed to allow MTU &amp;gt;1500 on vif prior to connecting to bridge]&lt;br /&gt;
* [https://bugzilla.redhat.com/show_bug.cgi?id=697310 Patch for xen-3.0.3 to support patch in BZ 697021]&lt;br /&gt;
&lt;br /&gt;
Below is a pretty ugly [[bash]] chain of commands that will download, install and copy into place everything needed to make jumbo frames work.&lt;br /&gt;
&lt;br /&gt;
{{note|1=The debug and devel packages for the kernel used below can be found here: https://alteeve.com/xen/RPMS/x86_64/}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cd /etc/xen/ &amp;amp;&amp;amp; \&lt;br /&gt;
	mv qemu-ifup qemu-ifup.orig &amp;amp;&amp;amp; \&lt;br /&gt;
	wget https://alteeve.com/xen/qemu-ifup &amp;amp;&amp;amp; \&lt;br /&gt;
	cd scripts/ &amp;amp;&amp;amp; \&lt;br /&gt;
	mv xen-network-common.sh xen-network-common.sh.orig &amp;amp;&amp;amp; \&lt;br /&gt;
	wget https://alteeve.com/xen/xen-network-common.sh &amp;amp;&amp;amp; \&lt;br /&gt;
	mv xen-network-common-bonding.sh xen-network-common-bonding.sh.orig &amp;amp;&amp;amp; \&lt;br /&gt;
	wget https://alteeve.com/xen/xen-network-common-bonding.sh &amp;amp;&amp;amp; \&lt;br /&gt;
	cd ~ &amp;amp;&amp;amp; \&lt;br /&gt;
	wget https://alteeve.com/xen/RPMS/x86_64/kernel-xen-2.6.18-238.9.3.el5.x86_64.rpm &amp;amp;&amp;amp; \&lt;br /&gt;
	wget https://alteeve.com/xen/RPMS/x86_64/kernel-2.6.18-238.9.3.el5.x86_64.rpm &amp;amp;&amp;amp; \&lt;br /&gt;
	rpm -ivh ~/kernel-* &amp;amp;&amp;amp; \&lt;br /&gt;
	echo &amp;quot;exclude=kernel*&amp;quot; &amp;gt;&amp;gt; /etc/yum.conf &amp;amp;&amp;amp; \&lt;br /&gt;
	echo &amp;quot;exclude=xen*&amp;quot; &amp;gt;&amp;gt; /etc/yum.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{note|1=Choosing a jumbo frame size larger that what is supported by your network interfaces and switches will cause networking to fail when the first large packet is sent. Consult your hardware documentation before setting an MTU size and remember to use the lowest size supported by all of your equipment. Note that some manufacturers will claim jumbo frame support when the actually only support ~4000 [[bytes]].}}&lt;br /&gt;
&lt;br /&gt;
Once this is done, you will need to reboot the use the new kernel. Before you do though, edit your &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/sysconfig/network-scripts/ifcfg-eth*&amp;lt;/span&amp;gt; files and add &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;MTU=xxxx&amp;lt;/span&amp;gt;, where &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xxxx&amp;lt;/span&amp;gt; is the frame size you want.&lt;br /&gt;
&lt;br /&gt;
Once set, you can reboot.&lt;br /&gt;
&lt;br /&gt;
{{note|1=Do not set the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;MTU=&amp;lt;/span&amp;gt; in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ifcfg-xenbrX&amp;lt;/span&amp;gt; configuration files. The bridges will always use the MTU of the lowest MTU device connected to it.}}&lt;br /&gt;
&lt;br /&gt;
On my system, my &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth0&amp;lt;/span&amp;gt; device has a maximum MTU of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;7200&amp;lt;/span&amp;gt; [[bytes]]. The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth1&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth2&amp;lt;/span&amp;gt; devices both support &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;9000&amp;lt;/span&amp;gt; [[bytes]], as does my switch. So my configuration files will be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/sysconfig/network-scripts/ifcfg-eth0&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;
# Realtek Semiconductor Co., Ltd. RTL8111/8168B PCI Express Gigabit Ethernet controller&lt;br /&gt;
HWADDR=48:5B:39:3C:53:14&lt;br /&gt;
DEVICE=eth0&lt;br /&gt;
BRIDGE=xenbr0&lt;br /&gt;
BOOTPROTO=static&lt;br /&gt;
ONBOOT=yes&lt;br /&gt;
MTU=7200&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/sysconfig/network-scripts/ifcfg-eth1&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;
# Intel Corporation 82574L Gigabit Network Connection&lt;br /&gt;
HWADDR=00:1B:21:72:9B:5A&lt;br /&gt;
DEVICE=eth1&lt;br /&gt;
BOOTPROTO=static&lt;br /&gt;
ONBOOT=yes&lt;br /&gt;
MTU=9000&lt;br /&gt;
IPADDR=192.168.2.74&lt;br /&gt;
NETMASK=255.255.255.0&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/sysconfig/network-scripts/ifcfg-eth2&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;
# Intel Corporation 82574L Gigabit Network Connection&lt;br /&gt;
HWADDR=00:1B:21:72:96:EA&lt;br /&gt;
DEVICE=eth2&lt;br /&gt;
BRIDGE=xenbr2&lt;br /&gt;
BOOTPROTO=static&lt;br /&gt;
ONBOOT=yes&lt;br /&gt;
MTU=9000&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Confirm that the newly installed &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;2.6.18-238.9.3.el5xen&amp;lt;/span&amp;gt; is set to boot by default.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cat /boot/grub/grub.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;
# grub.conf generated by anaconda&lt;br /&gt;
#&lt;br /&gt;
# Note that you do not have to rerun grub after making changes to this file&lt;br /&gt;
# NOTICE:  You have a /boot partition.  This means that&lt;br /&gt;
#          all kernel and initrd paths are relative to /boot/, eg.&lt;br /&gt;
#          root (hd0,0)&lt;br /&gt;
#          kernel /vmlinuz-version ro root=/dev/sda2&lt;br /&gt;
#          initrd /initrd-version.img&lt;br /&gt;
#boot=/dev/sda&lt;br /&gt;
default=1&lt;br /&gt;
timeout=5&lt;br /&gt;
splashimage=(hd0,0)/grub/splash.xpm.gz&lt;br /&gt;
hiddenmenu&lt;br /&gt;
title CentOS (2.6.18-238.9.3.el5)&lt;br /&gt;
	root (hd0,0)&lt;br /&gt;
	kernel /vmlinuz-2.6.18-238.9.3.el5 ro root=LABEL=/ dom0_mem=1024M&lt;br /&gt;
	initrd /initrd-2.6.18-238.9.3.el5.img&lt;br /&gt;
title CentOS (2.6.18-238.9.3.el5xen)&lt;br /&gt;
	root (hd0,0)&lt;br /&gt;
	kernel /xen.gz-2.6.18-238.9.3.el5&lt;br /&gt;
	module /vmlinuz-2.6.18-238.9.3.el5xen ro root=LABEL=/ dom0_mem=1024M&lt;br /&gt;
	module /initrd-2.6.18-238.9.3.el5xen.img&lt;br /&gt;
title CentOS (2.6.18-238.9.1.el5xen)&lt;br /&gt;
	root (hd0,0)&lt;br /&gt;
	kernel /xen.gz-2.6.18-238.9.1.el5&lt;br /&gt;
	module /vmlinuz-2.6.18-238.9.1.el5xen ro root=LABEL=/ dom0_mem=1024M&lt;br /&gt;
	module /initrd-2.6.18-238.9.1.el5xen.img&lt;br /&gt;
title CentOS (2.6.18-238.9.1.el5)&lt;br /&gt;
	root (hd0,0)&lt;br /&gt;
	kernel /vmlinuz-2.6.18-238.9.1.el5 ro root=LABEL=/ dom0_mem=1024M&lt;br /&gt;
	initrd /initrd-2.6.18-238.9.1.el5.img&lt;br /&gt;
title CentOS (2.6.18-238.el5xen)&lt;br /&gt;
	root (hd0,0)&lt;br /&gt;
	kernel /xen.gz-2.6.18-238.el5 &lt;br /&gt;
	module /vmlinuz-2.6.18-238.el5xen ro root=LABEL=/ rhgb quiet&lt;br /&gt;
	module /initrd-2.6.18-238.el5xen.img&lt;br /&gt;
title CentOS-base (2.6.18-238.el5)&lt;br /&gt;
	root (hd0,0)&lt;br /&gt;
	kernel /vmlinuz-2.6.18-238.el5 ro root=LABEL=/ rhgb quiet&lt;br /&gt;
	initrd /initrd-2.6.18-238.el5.img&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now reboot. When the nodes come back up, we should see the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xenbr0&amp;lt;/span&amp;gt; with an MTU of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;7200&amp;lt;/span&amp;gt;, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth1&amp;lt;/span&amp;gt; should have an MTU of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;9000&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xenbr2&amp;lt;/span&amp;gt; should also be at &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;9000&amp;lt;/span&amp;gt;. Note that we did not need to new kernel for &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth1&amp;lt;/span&amp;gt; as it&#039;s outside of Xen.&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;
          inet6 addr: fe80::4a5b:39ff:fe3c:5314/64 Scope:Link&lt;br /&gt;
          UP BROADCAST RUNNING MULTICAST  MTU:7200  Metric:1&lt;br /&gt;
          RX packets:263 errors:0 dropped:0 overruns:0 frame:0&lt;br /&gt;
          TX packets:164 errors:0 dropped:0 overruns:0 carrier:0&lt;br /&gt;
          collisions:0 txqueuelen:1000 &lt;br /&gt;
          RX bytes:46333 (45.2 KiB)  TX bytes:27403 (26.7 KiB)&lt;br /&gt;
          Interrupt:246 Base address:0xe000 &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:9000  Metric:1&lt;br /&gt;
          RX packets:122 errors:0 dropped:0 overruns:0 frame:0&lt;br /&gt;
          TX packets:49 errors:0 dropped:0 overruns:0 carrier:0&lt;br /&gt;
          collisions:0 txqueuelen:1000 &lt;br /&gt;
          RX bytes:25004 (24.4 KiB)  TX bytes:8658 (8.4 KiB)&lt;br /&gt;
          Interrupt:17 Memory:feae0000-feb00000 &lt;br /&gt;
&lt;br /&gt;
eth2      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 MULTICAST  MTU:9000  Metric:1&lt;br /&gt;
          RX packets:172 errors:0 dropped:0 overruns:0 frame:0&lt;br /&gt;
          TX packets:97 errors:0 dropped:0 overruns:0 carrier:0&lt;br /&gt;
          collisions:0 txqueuelen:1000 &lt;br /&gt;
          RX bytes:42769 (41.7 KiB)  TX bytes:28487 (27.8 KiB)&lt;br /&gt;
          Interrupt:16 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:10 errors:0 dropped:0 overruns:0 frame:0&lt;br /&gt;
          TX packets:10 errors:0 dropped:0 overruns:0 carrier:0&lt;br /&gt;
          collisions:0 txqueuelen:0 &lt;br /&gt;
          RX bytes:696 (696.0 b)  TX bytes:696 (696.0 b)&lt;br /&gt;
&lt;br /&gt;
xenbr0    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:7200  Metric:1&lt;br /&gt;
          RX packets:254 errors:0 dropped:0 overruns:0 frame:0&lt;br /&gt;
          TX packets:167 errors:0 dropped:0 overruns:0 carrier:0&lt;br /&gt;
          collisions:0 txqueuelen:0 &lt;br /&gt;
          RX bytes:41271 (40.3 KiB)  TX bytes:26870 (26.2 KiB)&lt;br /&gt;
&lt;br /&gt;
xenbr2    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:9000  Metric:1&lt;br /&gt;
          RX packets:153 errors:0 dropped:0 overruns:0 frame:0&lt;br /&gt;
          TX packets:88 errors:0 dropped:0 overruns:0 carrier:0&lt;br /&gt;
          collisions:0 txqueuelen:0 &lt;br /&gt;
          RX bytes:38585 (37.6 KiB)  TX bytes:24586 (24.0 KiB)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To test that the new MTU sizes are working, we can use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ping&amp;lt;/span&amp;gt; from the source node and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;tcpdump&amp;lt;/span&amp;gt; on the target node. This works because &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ping&amp;lt;/span&amp;gt; can define the size of the message and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;tcpdump&amp;lt;/span&amp;gt; will show how many packets were sent and returned.&lt;br /&gt;
&lt;br /&gt;
Let&#039;s test &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xenbr0&amp;lt;/span&amp;gt;, which we&#039;ve set to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;7200&amp;lt;/span&amp;gt;. To do this test, we&#039;ll first use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;tcpdump&amp;lt;/span&amp;gt; on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt; to listen to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth0&amp;lt;/span&amp;gt; for [[ICMP]] packets.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
tcpdump -i xenbr0 icmp&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode&lt;br /&gt;
listening on xenbr0, link-type EN10MB (Ethernet), capture size 96 bytes&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt;, we&#039;re going to send a single ping with a payload of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;7172&amp;lt;/span&amp;gt; bytes. This is because the ICMP packet has an overhead of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;28&amp;lt;/span&amp;gt; bytes. This means the full ping size will be &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;7200&amp;lt;/span&amp;gt; bytes total. This should result in the ping taking only one packet to and from the destination node.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ping -c 1 -s 7172 an-node05.ifn&lt;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-node05.ifn (192.168.1.75) 7172(7200) bytes of data.&lt;br /&gt;
7180 bytes from an-node05.ifn (192.168.1.75): icmp_seq=1 ttl=64 time=1.53 ms&lt;br /&gt;
&lt;br /&gt;
--- an-node05.ifn ping statistics ---&lt;br /&gt;
1 packets transmitted, 1 received, 0% packet loss, time 0ms&lt;br /&gt;
rtt min/avg/max/mdev = 1.534/1.534/1.534/0.000 ms&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Going back to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt;, we&#039;ll see that indeed the ping took just one packet for each direction of travel.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
23:02:14.045744 IP an-node04.ifn &amp;gt; an-node05.ifn: ICMP echo request, id 3859, seq 1, length 7180&lt;br /&gt;
23:02:14.046601 IP an-node05.ifn &amp;gt; an-node04.ifn: ICMP echo reply, id 3859, seq 1, length 7180&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If we try again, with a payload size of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;7173&amp;lt;/span&amp;gt; bytes, for a total of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;7201&amp;lt;/span&amp;gt; packet size, we&#039;ll see on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt; that two packets were needed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
23:07:18.091292 IP an-node04.ifn &amp;gt; an-node05.ifn: ICMP echo request, id 21779, seq 1, length 7181&lt;br /&gt;
23:07:18.092199 IP an-node05.ifn &amp;gt; an-node04.ifn: ICMP echo reply, id 21779, seq 1, length 7176&lt;br /&gt;
23:07:18.092242 IP an-node05.ifn &amp;gt; an-node04.ifn: icmp&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Perfect!&lt;br /&gt;
&lt;br /&gt;
== Renaming a Virtual Machine ==&lt;br /&gt;
&lt;br /&gt;
There may be times when you want to rename a VM domain. For example, if you provision a machine and then realize that you gave it a name that didn&#039;t describe it properly.&lt;br /&gt;
&lt;br /&gt;
Things to keep in mind before starting;&lt;br /&gt;
&lt;br /&gt;
* The new name of the VM &#039;&#039;&#039;must&#039;&#039;&#039; match the name of the definition file as well as the name of the VM service in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cluster.conf&amp;lt;/span&amp;gt;&lt;br /&gt;
* The VM will need to be shut down for the renaming process to succeed.&lt;br /&gt;
&lt;br /&gt;
At this time, the only way to rename a VM is:&lt;br /&gt;
&lt;br /&gt;
# Use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virsh dumpxml old_name &amp;gt; /xen_shared/definitions/new_name.xml&amp;lt;/span&amp;gt;.&lt;br /&gt;
# Shut down the VM with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virsh shutdown old_name&amp;lt;/span&amp;gt;.&lt;br /&gt;
# Edit the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/xen_shared/definitions/new_name.xml&amp;lt;/span&amp;gt; [[XML]] definition file and change &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;name&amp;gt;old_name&amp;lt;/name&amp;gt;&amp;lt;/span&amp;gt; to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;name&amp;gt;new_name&amp;lt;/name&amp;gt;&amp;lt;/span&amp;gt;.&lt;br /&gt;
# Undefine the VM using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virsh undefine old_name&amp;lt;/span&amp;gt; on all nodes.&lt;br /&gt;
# Redefine the VM using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virsh define /xen_shared/definitions/new_name.xml&amp;lt;/span&amp;gt; on all nodes.&lt;br /&gt;
# Update the cluster service name.&lt;br /&gt;
## Edit &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/cluster/cluster.conf&amp;lt;/span&amp;gt; and change &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;vm name=&amp;quot;old_name&amp;quot; ... /&amp;gt;&amp;lt;/span&amp;gt; to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;vm name=&amp;quot;new_name&amp;quot; ... /&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
## Increment the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;cluster ... config_version=&amp;quot;x&amp;quot;&amp;gt;&amp;lt;/span&amp;gt; attribute.&lt;br /&gt;
## Push the new cluster configuration using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ccs_tool update /etc/cluster/cluster.conf&amp;lt;/span&amp;gt;.&lt;br /&gt;
# Confirm that the new name is seen by both &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virsh list --all&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clustat&amp;lt;/span&amp;gt;.&lt;br /&gt;
# Start the VM back up.&lt;br /&gt;
&lt;br /&gt;
== Adding Space to a VM ==&lt;br /&gt;
&lt;br /&gt;
Here we will see what it takes to add a new 50 [[GiB]] LV to a VM as a second virtual hard drive.&lt;br /&gt;
&lt;br /&gt;
This process requires a few steps.&lt;br /&gt;
* Setting the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/drbd3&amp;lt;/span&amp;gt; resource as a new [[LVM]] [[PV]].&lt;br /&gt;
* Create a new [[VG]] called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;drbd_an4_vg1&amp;lt;/span&amp;gt;.&lt;br /&gt;
* Carve out a 50 [[GB]] [[LV]] called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0001_xvdb&amp;lt;/span&amp;gt;. &lt;br /&gt;
* Attach it to the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0001_ws1&amp;lt;/span&amp;gt;.&lt;br /&gt;
* Dumping the VM&#039;s updated configuration to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/xen_shared/definitions/vm0001_ws1.xml&amp;lt;/span&amp;gt;.&lt;br /&gt;
* Redefining the VM on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt; (assuming that it is currently running on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt;).&lt;br /&gt;
* Logging into the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0001_ws1&amp;lt;/span&amp;gt; VM, formatting the new space and adding the partition 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;
{{note|1=It is assumed that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0001_ws1&amp;lt;/span&amp;gt; is currently running on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt;. Unless stated otherwise, all the following commands should, thus, be run from &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt;.&amp;lt;br /&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
=== Creating a new PV, VG and LV ===&lt;br /&gt;
&lt;br /&gt;
Create the new [[PV]]:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
pvcreate /dev/drbd3 &lt;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/drbd3&amp;quot; successfully created&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Create the new [[VG]]:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vgcreate -c y --addtag @an-cluster01 drbd_an4_vg1 /dev/drbd3&lt;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;drbd_an4_vg1&amp;quot; successfully created&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Create the new [[LV]]:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
lvcreate -L 50G --addtag @an-cluster01 -n vm0001_xvdb /dev/drbd_an4_vg1&lt;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;vm0001_xvdb&amp;quot; created&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Attaching the new LV to the VM ===&lt;br /&gt;
&lt;br /&gt;
Attach the new LV to the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0001_ws1&amp;lt;/span&amp;gt; VM. This is done using the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virsh attach-disk&amp;lt;/span&amp;gt;. We&#039;ll tell &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virsh&amp;lt;/span&amp;gt; to attach the new LV and to create it as &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/xvdb&amp;lt;/span&amp;gt; within the VM.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
virsh attach-disk vm0001_ws1 /dev/drbd_an4_vg1/vm0001_xvdb xvdb&lt;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 attached successfully&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{note|1=Log in to the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0001_ws1&amp;lt;/span&amp;gt; VM and run the following commands there. Note that, in this tutorial, the VM&#039;s hostname has been changed to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0001_ws1&amp;lt;/span&amp;gt; and has been statically assigned to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;192.168.1.253&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;
ssh root@192.168.1.253&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
root@192.168.1.253&#039;s password: &lt;br /&gt;
Last login: Sun Apr  3 18:18:13 2011 from 192.168.1.102&lt;br /&gt;
[root@vm0001_ws1 ~]# &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Confirm that the new &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/xvdb&amp;lt;/span&amp;gt; device now exists.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
fdisk -l&lt;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/xvda: 10.7 GB, 10737418240 bytes&lt;br /&gt;
255 heads, 63 sectors/track, 1305 cylinders&lt;br /&gt;
Units = cylinders of 16065 * 512 = 8225280 bytes&lt;br /&gt;
&lt;br /&gt;
    Device Boot      Start         End      Blocks   Id  System&lt;br /&gt;
/dev/xvda1   *           1          33      265041   83  Linux&lt;br /&gt;
/dev/xvda2              34         164     1052257+  82  Linux swap / Solaris&lt;br /&gt;
/dev/xvda3             165        1305     9165082+  83  Linux&lt;br /&gt;
&lt;br /&gt;
Disk /dev/xvdb: 53.6 GB, 53687091200 bytes&lt;br /&gt;
255 heads, 63 sectors/track, 6527 cylinders&lt;br /&gt;
Units = cylinders of 16065 * 512 = 8225280 bytes&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Configuring the new Virtual Hard Drive in the VM ===&lt;br /&gt;
&lt;br /&gt;
From here on in, we&#039;ll be proceeding exactly the same as if we had added a real hard drive to a bare-iron server.&lt;br /&gt;
&lt;br /&gt;
Create a single partition out of the new space.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
fdisk /dev/xvdb&lt;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 contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel&lt;br /&gt;
Building a new DOS disklabel. Changes will remain in memory only,&lt;br /&gt;
until you decide to write them. After that, of course, the previous&lt;br /&gt;
content won&#039;t be recoverable.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The number of cylinders for this disk is set to 6527.&lt;br /&gt;
There is nothing wrong with that, but this is larger than 1024,&lt;br /&gt;
and could in certain setups cause problems with:&lt;br /&gt;
1) software that runs at boot time (e.g., old versions of LILO)&lt;br /&gt;
2) booting and partitioning software from other OSs&lt;br /&gt;
   (e.g., DOS FDISK, OS/2 FDISK)&lt;br /&gt;
Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)&lt;br /&gt;
&lt;br /&gt;
Command (m for help): n&lt;br /&gt;
Command action&lt;br /&gt;
   e   extended&lt;br /&gt;
   p   primary partition (1-4)&lt;br /&gt;
p&lt;br /&gt;
Partition number (1-4): 1&lt;br /&gt;
First cylinder (1-6527, default 1): &lt;br /&gt;
Using default value 1&lt;br /&gt;
Last cylinder or +size or +sizeM or +sizeK (1-6527, default 6527): &lt;br /&gt;
Using default value 6527&lt;br /&gt;
&lt;br /&gt;
Command (m for help): p&lt;br /&gt;
&lt;br /&gt;
Disk /dev/xvdb: 53.6 GB, 53687091200 bytes&lt;br /&gt;
255 heads, 63 sectors/track, 6527 cylinders&lt;br /&gt;
Units = cylinders of 16065 * 512 = 8225280 bytes&lt;br /&gt;
&lt;br /&gt;
    Device Boot      Start         End      Blocks   Id  System&lt;br /&gt;
/dev/xvdb1               1        6527    52428096   83  Linux&lt;br /&gt;
&lt;br /&gt;
Command (m for help): w&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;
Syncing disks.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{note|1=Unlike when we worked on the nodes, we do not need to reboot the VM to see the changes on the disk. This is not because it&#039;s a virtual server, but rather because the new virtual disk is not used by the OS.}}&lt;br /&gt;
&lt;br /&gt;
Now, format the new &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/xvdb1&amp;lt;/span&amp;gt; partition.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
mkfs.ext3 /dev/xvdb1 &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
mke2fs 1.39 (29-May-2006)&lt;br /&gt;
Filesystem label=&lt;br /&gt;
OS type: Linux&lt;br /&gt;
Block size=4096 (log=2)&lt;br /&gt;
Fragment size=4096 (log=2)&lt;br /&gt;
6553600 inodes, 13107024 blocks&lt;br /&gt;
655351 blocks (5.00%) reserved for the super user&lt;br /&gt;
First data block=0&lt;br /&gt;
Maximum filesystem blocks=4294967296&lt;br /&gt;
400 block groups&lt;br /&gt;
32768 blocks per group, 32768 fragments per group&lt;br /&gt;
16384 inodes per group&lt;br /&gt;
Superblock backups stored on blocks: &lt;br /&gt;
	32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208, &lt;br /&gt;
	4096000, 7962624, 11239424&lt;br /&gt;
&lt;br /&gt;
Writing inode tables: done                            &lt;br /&gt;
Creating journal (32768 blocks): done&lt;br /&gt;
Writing superblocks and filesystem accounting information: done&lt;br /&gt;
&lt;br /&gt;
This filesystem will be automatically checked every 32 mounts or&lt;br /&gt;
180 days, whichever comes first.  Use tune2fs -c or -i to override.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/var/www&amp;lt;/span&amp;gt; does not yet exist. If it doesn&#039;t, create it.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ls -lah /var/www&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
ls: /var/www: No such file or directory&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;
mkdir /var/www&lt;br /&gt;
ls -lah /var/www&lt;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 12K&lt;br /&gt;
drwxr-xr-x  2 root root 4.0K Apr  3 23:01 .&lt;br /&gt;
drwxr-xr-x 21 root root 4.0K Apr  3 23:01 ..&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Mount the newly formatted partition.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
mount /dev/xvdb1 /var/www/&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/xvda3            8.5G  2.0G  6.1G  25% /&lt;br /&gt;
/dev/xvda1            251M   25M  214M  11% /boot&lt;br /&gt;
tmpfs                 524M     0  524M   0% /dev/shm&lt;br /&gt;
/dev/xvdb1             50G  180M   47G   1% /var/www&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Add the new partition to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/fstab&amp;lt;/span&amp;gt; so that the partition mounts on boot.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
echo &amp;quot;/dev/xvdb1              /var/www                ext3    defaults        1 3&amp;quot; &amp;gt;&amp;gt; /etc/fstab&lt;br /&gt;
cat /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;
LABEL=/                 /                       ext3    defaults        1 1&lt;br /&gt;
LABEL=/boot             /boot                   ext3    defaults        1 2&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;
LABEL=SWAP-xvda2        swap                    swap    defaults        0 0&lt;br /&gt;
/dev/xvdb1              /var/www                ext3    defaults        1 3&lt;br /&gt;
&amp;lt;/source&amp;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 please don&#039;t pay it too much mind. They&#039;ll be happy to talk to you directly. :)&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 &#039;&#039;&#039;Lon Hohberger&#039;&#039;&#039;, lon at fedoraproject.org, for the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; help. He also provided some excellent feedback on the first release (see [https://alteeve.com/index.php?title=Red_Hat_Cluster_Service_2_Tutorial&amp;amp;action=historysubmit&amp;amp;diff=3456&amp;amp;oldid=3455 here])&lt;br /&gt;
* To [http://dk.linkedin.com/in/fabbione Fabio Massimo Di Nitto] for helping me get caught up with clustering and VMs on FC13.&lt;br /&gt;
&lt;br /&gt;
{{footer}}&lt;/div&gt;</summary>
		<author><name>Kiwi</name></author>
	</entry>
	<entry>
		<id>https://alteeve.com/w/index.php?title=Red_Hat_Cluster_Service_2_Tutorial_-_Archive&amp;diff=3601</id>
		<title>Red Hat Cluster Service 2 Tutorial - Archive</title>
		<link rel="alternate" type="text/html" href="https://alteeve.com/w/index.php?title=Red_Hat_Cluster_Service_2_Tutorial_-_Archive&amp;diff=3601"/>
		<updated>2011-08-22T16:41:00Z</updated>

		<summary type="html">&lt;p&gt;Kiwi: /* Installing Packages We Will Use */ s/you/your/&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{howto_header}}&lt;br /&gt;
&lt;br /&gt;
This paper has one goal;&lt;br /&gt;
&lt;br /&gt;
* Creating a 2-node, high-availability cluster hosting [[Xen]] virtual machines using [[RHCS]] &amp;quot;stable 2&amp;quot; with [[DRBD]] and clustered [[LVM]] for synchronizing storage data.&lt;br /&gt;
&lt;br /&gt;
We&#039;ll create a dedicated firewall VM to isolate and protect the VM network, discuss provisioning and maintaining Xen VMs, explore some basics of daily administration of a VM cluster and test various failures and how to recover from them.&lt;br /&gt;
&lt;br /&gt;
Grab a coffee, a comfy chair, put on some nice music and settle in for some geekly fun.&lt;br /&gt;
&lt;br /&gt;
= The Task Ahead =&lt;br /&gt;
&lt;br /&gt;
Before we start, let&#039;s take a few minutes to discuss clustering and it&#039;s complexities.&lt;br /&gt;
&lt;br /&gt;
== Technologies We Will Use ==&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;Enterprise Linux 5&#039;&#039;; specifically we will be using [[CentOS]] v5.6.&lt;br /&gt;
* &#039;&#039;Red Hat Cluster Services&#039;&#039; &amp;quot;Stable&amp;quot; version 2. This describes the following core components:&lt;br /&gt;
** &#039;&#039;OpenAIS&#039;&#039;; Provides cluster communications using the [[totem]] protocol.&lt;br /&gt;
** &#039;&#039;Cluster Manager&#039;&#039; (&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[cman]]&amp;lt;/span&amp;gt;); Manages the starting, stopping and managing of the cluster.&lt;br /&gt;
** &#039;&#039;Resource Manager&#039;&#039; (&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[rgmanager]]&amp;lt;/span&amp;gt;); Manages cluster resources and services. Handles service recovery during failures.&lt;br /&gt;
** &#039;&#039;Cluster Logical Volume Manager&#039;&#039; (&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[clvm]]&amp;lt;/span&amp;gt;); Cluster-aware (disk) volume manager. Backs [[GFS2]] [[filesystem]]s and [[Xen]] virtual machines.&lt;br /&gt;
** &#039;&#039;Global File Systems&#039;&#039; version 2 (&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[gfs2]]&amp;lt;/span&amp;gt;); Cluster-aware, concurrently mountable file system.&lt;br /&gt;
* &#039;&#039;Distributed Redundant Block Device&#039;&#039; ([[DRBD]]); Keeps shared data synchronized across cluster nodes.&lt;br /&gt;
* &#039;&#039;Xen&#039;&#039;; [[Hypervisor]] that controls and supports virtual machines.&lt;br /&gt;
&lt;br /&gt;
== A Note on Patience ==&lt;br /&gt;
&lt;br /&gt;
There is nothing inherently hard about clustering. However, there are many components that you need to understand before you can begin. The result is that clustering has an inherently steep learning curve.&lt;br /&gt;
&lt;br /&gt;
You &#039;&#039;&#039;must&#039;&#039;&#039; have patience. Lots of it.&lt;br /&gt;
&lt;br /&gt;
Many technologies can be learned by creating a very simple base and then building on it. The classic &amp;quot;Hello, World!&amp;quot; script created when first learning a programming language is an example of this. Unfortunately, there is no real analog to this in clustering. Even the most basic cluster requires several pieces be in place and working together. If you try to rush by ignoring pieces you think are not important, you will almost certainly waste time. A good example is setting aside [[fencing]], thinking that your test cluster&#039;s data isn&#039;t important. The cluster software has no concept of &amp;quot;test&amp;quot;. It treats everything as critical all the time and &#039;&#039;will&#039;&#039; shut down if anything goes wrong.&lt;br /&gt;
&lt;br /&gt;
Take your time, work through these steps, and you will have the foundation cluster sooner than you realize. Clustering is fun &#039;&#039;&#039;because&#039;&#039;&#039; it is a challenge.&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
&lt;br /&gt;
It is assumed that you are familiar with Linux systems administration, specifically [[Red Hat]] [[EL|Enterprise Linux]] and its derivatives. You will need to have somewhat advanced networking experience as well. You should be comfortable working in a terminal (directly or over &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[ssh]]&amp;lt;/span&amp;gt;). Familiarity with [[XML]] will help, but is not terribly required as it&#039;s use here is pretty self-evident.&lt;br /&gt;
&lt;br /&gt;
If you feel a little out of depth at times, don&#039;t hesitate to set this tutorial aside. Branch over to the components you feel the need to study more, then return and continue on. Finally, and perhaps most importantly, you &#039;&#039;&#039;must&#039;&#039;&#039; have patience! If you have a manager asking you to &amp;quot;go live&amp;quot; with a cluster in a month, tell him or her that it simply won&#039;t happen. If you rush, you will skip important points and &#039;&#039;&#039;you will fail&#039;&#039;&#039;. Patience is vastly more important than any pre-existing skill. &lt;br /&gt;
&lt;br /&gt;
== Focus and Goal ==&lt;br /&gt;
&lt;br /&gt;
There is a different cluster for every problem. Generally speaking though, there are two main problems that clusters try to resolve; Performance and High Availability. Performance clusters are generally tailored to the application requiring the performance increase. There are some general tools for performance clustering, like [[Red Hat]]&#039;s [[LVS]] (Linux Virtual Server) for load-balancing common applications like the [[Apache]] web-server. &lt;br /&gt;
&lt;br /&gt;
This tutorial will focus on High Availability clustering, often shortened to simply &#039;&#039;&#039;HA&#039;&#039;&#039; and not to be confused with the [[Linux-HA]] &amp;quot;heartbeat&amp;quot; cluster suite, which we will not be using here. The cluster will provide a shared file systems and will provide for the high availability on [[Xen]]-based virtual servers. The goal will be to have the virtual servers live-migrate during planned node outages and automatically restart on a surviving node when the original host node fails.&lt;br /&gt;
&lt;br /&gt;
Below is a &#039;&#039;very&#039;&#039; brief overview;&lt;br /&gt;
&lt;br /&gt;
High Availability clusters like ours have two main parts; Cluster management and resource management.&lt;br /&gt;
&lt;br /&gt;
The cluster itself is responsible for maintaining the cluster nodes in a group. This group is part of a &amp;quot;Closed Process Group&amp;quot;, or [[CPG]]. When a node fails, the cluster manager must detect the failure, reliably eject the node from the cluster using fencing and then reform the CPG. Each time the cluster changes, or &amp;quot;re-forms&amp;quot;, the resource manager is called. The resource manager checks to see how the cluster changed, consults it&#039;s configuration and determines what to do, if anything.&lt;br /&gt;
&lt;br /&gt;
The details of all this will be discussed in detail a little later on. For now, it&#039;s sufficient to have in mind these two major roles and understand that they are somewhat independent entities.&lt;br /&gt;
&lt;br /&gt;
== Platform ==&lt;br /&gt;
&lt;br /&gt;
This tutorial was written using [[CentOS]] version 5.6, [[x86_64]]. No attempt was made to test on [[i686]] or other [[EL5]] derivatives. That said, there is no reason to believe that this tutorial will not apply to any variant. As much as possible, the language will be distro-agnostic. For reasons of memory constraints, it is advised that you use an [[x86_64]] (64-[[bit]]) platform if at all possible.&lt;br /&gt;
&lt;br /&gt;
Do note that as of [[EL5]].4 and above, significant changes were made to how [[RHCS]] handles virtual machines. It is strongly advised that you use at least version 5.4 or newer while working with this tutorial.&lt;br /&gt;
&lt;br /&gt;
== A Word On Complexity ==&lt;br /&gt;
&lt;br /&gt;
Introducing the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Fabbione Principle&amp;lt;/span&amp;gt; (aka: &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fabimer theory&amp;lt;/span&amp;gt;):&lt;br /&gt;
&lt;br /&gt;
Clustering is not inherently hard, but it is inherently complex. Consider;&lt;br /&gt;
&lt;br /&gt;
* Any given program has &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;N&amp;lt;/span&amp;gt; bugs.&lt;br /&gt;
** [[RHCS]] uses; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt;, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;openais&amp;lt;/span&amp;gt;, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;totem&amp;lt;/span&amp;gt;, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fenced&amp;lt;/span&amp;gt;, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;dlm&amp;lt;/span&amp;gt;.&lt;br /&gt;
** We will be adding &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;GFS2&amp;lt;/span&amp;gt;, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;CLVM&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Xen&amp;lt;/span&amp;gt;.&lt;br /&gt;
** Right there, we have &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;N^10&amp;lt;/span&amp;gt; possible bugs. We&#039;ll call this &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;A&amp;lt;/span&amp;gt;.&lt;br /&gt;
* A cluster has &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Y&amp;lt;/span&amp;gt; nodes.&lt;br /&gt;
** In our case, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;2&amp;lt;/span&amp;gt; nodes, each with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;3&amp;lt;/span&amp;gt; networks.&lt;br /&gt;
** The network infrastructure (Switches, routers, etc). If you use managed switches, add another layer of complexity.&lt;br /&gt;
** This gives us another &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Y^(2*3)&amp;lt;/span&amp;gt;, and then &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;^2&amp;lt;/span&amp;gt; again for managed switches. We&#039;ll call this &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;B&amp;lt;/span&amp;gt;.&lt;br /&gt;
* Let&#039;s add the human factor. Let&#039;s say that a person needs roughly 5 years of cluster experience to be considered an expert. For each year less than this, add a &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Z&amp;lt;/span&amp;gt; &amp;quot;oops&amp;quot; factor, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;(5-Z)^2&amp;lt;/span&amp;gt;. We&#039;ll call this &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;C&amp;lt;/span&amp;gt;.&lt;br /&gt;
* So, finally, add up the complexity, using this tutorial&#039;s layout, 0-years of experience and managed switches.&lt;br /&gt;
** &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;(N^10) * (Y^(2*3)^2) * ((5-0)^2) == (A * B * C)&amp;lt;/span&amp;gt; == an-unknown-but-big-number.&lt;br /&gt;
&lt;br /&gt;
This isn&#039;t meant to scare you away, but it is meant to be a sobering statement. Obviously, those numbers are somewhat artificial, but the point remains.&lt;br /&gt;
&lt;br /&gt;
Any one piece is easy to understand, thus, clustering is inherently easy. However, given the large number of variables, you must really understand all the pieces and how they work together. &#039;&#039;&#039;&#039;&#039;DO NOT&#039;&#039;&#039;&#039;&#039; think that you will have this mastered and working in a month. Certainly don&#039;t try to sell clusters as a service without a &#039;&#039;lot&#039;&#039; of internal testing.&lt;br /&gt;
&lt;br /&gt;
Clustering is kind of like chess. The rules are pretty straight forward, but the complexity can take some time to master.&lt;br /&gt;
&lt;br /&gt;
= Overview of Components =&lt;br /&gt;
&lt;br /&gt;
When looking at a cluster, there is a tendency to want to dive right into the configuration file. That is not very useful in clustering.&lt;br /&gt;
&lt;br /&gt;
* When you look at the configuration file, it is quite short.&lt;br /&gt;
&lt;br /&gt;
It isn&#039;t like most applications or technologies though. Most of us learn by taking something, like a configuration file, and tweaking it this way and that to see what happens. I tried that with clustering and learned only what it was like to bang my head against the wall.&lt;br /&gt;
&lt;br /&gt;
* Understanding the parts and how they work together is critical.&lt;br /&gt;
&lt;br /&gt;
You will find that the discussion on the components of clustering, and how those components and concepts interact, will be much longer than the initial configuration. It is true that we could talk very briefly about the actual syntax, but it would be a disservice. Please, don&#039;t rush through the next section or, worse, skip it and go right to the configuration. You will waste far more time than you will save.&lt;br /&gt;
&lt;br /&gt;
* Clustering is easy, but it has a complex web of inter-connectivity. You must grasp this network if you want to be an effective cluster administrator!&lt;br /&gt;
&lt;br /&gt;
== Component; cman ==&lt;br /&gt;
&lt;br /&gt;
This was, traditionally, the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;c&amp;lt;/span&amp;gt;luster &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;man&amp;lt;/span&amp;gt;ager. In the 3.0 series, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt; acts mainly as a [[quorum]] provider, tallying votes and deciding on a critical property of the cluster: quorum. In the 3.1 series, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt; will be removed entirely.&lt;br /&gt;
&lt;br /&gt;
== Component; openais / corosync ==&lt;br /&gt;
&lt;br /&gt;
OpenAIS is the heart of the cluster. All other computers operate though this component, and no cluster component can work without it. Further, it is shared between both Pacemaker and RHCS clusters.&lt;br /&gt;
&lt;br /&gt;
In Red Hat clusters, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;openais&amp;lt;/span&amp;gt; is configured via the central &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cluster.conf&amp;lt;/span&amp;gt; file. In Pacemaker clusters, it is configured directly in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;openais.conf&amp;lt;/span&amp;gt;. As we will be building an RHCS, we will only use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cluster.conf&amp;lt;/span&amp;gt;. That said, (almost?) all &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;openais.conf&amp;lt;/span&amp;gt; options are available in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cluster.conf&amp;lt;/span&amp;gt;. This is important to note as you will see references to both configuration files when searching the Internet.&lt;br /&gt;
&lt;br /&gt;
=== A Little History ===&lt;br /&gt;
&lt;br /&gt;
There were significant changes between [[RHCS]] version 2, which we are using, and version 3 available on [[EL6]] and recent [[Fedora]]s.&lt;br /&gt;
&lt;br /&gt;
In the RHCS version 2, there was a component called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;openais&amp;lt;/span&amp;gt; which handled &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;totem&amp;lt;/span&amp;gt;. The OpenAIS project was designed to be the heart of the cluster and was based around the [http://www.saforum.org/ Service Availability Forum]&#039;s [http://www.saforum.org/Application-Interface-Specification~217404~16627.htm Application Interface Specification]. AIS is an open [[API]] designed to provide inter-operable high availability services.&lt;br /&gt;
&lt;br /&gt;
In 2008, it was decided that the AIS specification was overkill for most clustered applications being developed in the open source community.  At that point, OpenAIS was split in to two projects: Corosync and OpenAIS. The former, Corosync, provides cluster membership, messaging, and basic APIs for use by clustered applications, while the OpenAIS project is specifically designed to act as an optional add-on to corosync for users who want AIS functionality.&lt;br /&gt;
&lt;br /&gt;
You will see a lot of references to OpenAIS while searching the web for information on clustering. Understanding it&#039;s evolution will hopefully help you avoid confusion.&lt;br /&gt;
&lt;br /&gt;
== Concept; quorum ==&lt;br /&gt;
&lt;br /&gt;
[[Quorum]] is defined as the minimum set of hosts required in order to provide service and is used to prevent split-brain situations.&lt;br /&gt;
&lt;br /&gt;
The quorum algorithm used by the RHCS cluster is called &amp;quot;simple majority quorum&amp;quot;, which means that more than half of the hosts must be online and communicating in order to provide service. While simple majority quorum a very common quorum algorithm, other quorum algorithms exist ([[grid quorum]], [[YKD Dyanamic Linear Voting]], etc.).&lt;br /&gt;
&lt;br /&gt;
The idea behind quorum is that, which ever group of machines has it, can safely start clustered services even when defined members are not accessible.&lt;br /&gt;
&lt;br /&gt;
Take this scenario;&lt;br /&gt;
&lt;br /&gt;
* You have a cluster of four nodes, each with one vote.&lt;br /&gt;
** The cluster&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;expected_votes&amp;lt;/span&amp;gt; is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;4&amp;lt;/span&amp;gt;. A clear majority, in this case, is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;3&amp;lt;/span&amp;gt; because &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;(4/2)+1&amp;lt;/span&amp;gt;, rounded down, is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;3&amp;lt;/span&amp;gt;.&lt;br /&gt;
** Now imagine that there is a failure in the network equipment and one of the nodes disconnects from the rest of the cluster.&lt;br /&gt;
** You now have two partitions; One partition contains three machines and the other partition has one.&lt;br /&gt;
** The three machines will have quorum, and the other machine will lose quorum.&lt;br /&gt;
** The partition with quorum will reconfigure and continue to provide cluster services.&lt;br /&gt;
** The partition without quorum will withdraw from the cluster and shut down all cluster services.&lt;br /&gt;
&lt;br /&gt;
When the cluster reconfigures and the partition wins quorum, it will fence the node(s) in the partition without quorum. Once the fencing hes been confirmed successful, the partition with quorum will begin accessing clustered resources, like shared filesystems, thus guaranteeing the safety of those shared resources.&lt;br /&gt;
&lt;br /&gt;
This also helps explain why an even &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;50%&amp;lt;/span&amp;gt; is not enough to have quorum, a common question for people new to clustering. Using the above scenario, imagine if the split were 2 and 2 nodes. Because either can&#039;t be sure what the other would do, neither can safely proceed. If we allowed an even 50% to have quorum, both partition might try to take over the clustered services and disaster would soon follow.&lt;br /&gt;
&lt;br /&gt;
There is one, and &#039;&#039;&#039;only&#039;&#039;&#039; one except to this rule.&lt;br /&gt;
&lt;br /&gt;
In the case of a two node cluster, as we will be building here, any failure results in a 50/50 split. If we enforced quorum in a two-node cluster, there would never be high availability because and failure would cause both nodes to withdraw. The risk with this exception is that we now place the entire safety of the cluster on [[fencing]], a concept we will cover in a second. Fencing is a second line of defense and something we are loath to rely on alone.&lt;br /&gt;
&lt;br /&gt;
Even in a two-node cluster though, proper quorum can be maintained by using a quorum disk, called a [[qdisk]]. Unfortunately, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;qdisk&amp;lt;/span&amp;gt; on a [[DRBD]] resource comes with it&#039;s own problems, so we will not be able to use it here.&lt;br /&gt;
&lt;br /&gt;
== Concept; Virtual Synchrony ==&lt;br /&gt;
&lt;br /&gt;
All cluster operations, like fencing, distributed locking and so on, have to occur in the same order across all nodes. This concept is called &amp;quot;virtual synchrony&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
This is provided by &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;openais&amp;lt;/span&amp;gt; using &amp;quot;closed process groups&amp;quot;, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[CPG]]&amp;lt;/span&amp;gt;. A closed process group is simply a private group of processes in a cluster. Within this closed group, all messages are ordered and consistent.&lt;br /&gt;
&lt;br /&gt;
Let&#039;s look at how locks are handled on clustered file systems as an example.&lt;br /&gt;
&lt;br /&gt;
* As various nodes want to work on files, they send a lock request to the cluster. When they are done, they send a lock release to the cluster.&lt;br /&gt;
** Lock and unlock messages must arrive in the same order to all nodes, regardless of the real chronological order that they were issued.&lt;br /&gt;
* Let&#039;s say one node sends out messages &amp;quot;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;a1 a2 a3 a4&amp;lt;/span&amp;gt;&amp;quot;. Meanwhile, the other node sends out &amp;quot;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;b1 b2 b3 b4&amp;lt;/span&amp;gt;&amp;quot;.&lt;br /&gt;
** All of these messages go to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;openais&amp;lt;/span&amp;gt; which gathers them up, puts them into an order and then sends them out in that order.&lt;br /&gt;
** It is totally possible that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;openais&amp;lt;/span&amp;gt; will get the messages as &amp;quot;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;a2 b1 b2 a1 b4 a3 a4 b4&amp;lt;/span&amp;gt;&amp;quot;. What order is used is not important, only that the order is consistent across all nodes.&lt;br /&gt;
** The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;openais&amp;lt;/span&amp;gt; application will then ensure that all nodes get the messages in the above order, one at a time. All nodes must confirm that they got a given message before the next message is sent to any node.&lt;br /&gt;
&lt;br /&gt;
All of this ordering, within the closed process group, is &amp;quot;virtual synchrony&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
This will tie into fencing and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;totem&amp;lt;/span&amp;gt;, as we&#039;ll see in the next sections.&lt;br /&gt;
&lt;br /&gt;
== Concept; Fencing ==&lt;br /&gt;
&lt;br /&gt;
Fencing is a &#039;&#039;&#039;absolutely critical&#039;&#039;&#039; part of clustering. Without &#039;&#039;&#039;fully&#039;&#039;&#039; working fence devices, &#039;&#039;&#039;&#039;&#039;your cluster will fail&#039;&#039;&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Was that strong enough, or should I say that again? Let&#039;s be safe:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;DO NOT BUILD A CLUSTER WITHOUT PROPER, WORKING AND TESTED FENCING&#039;&#039;&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Sorry, I promise that this will be the only time that I speak so strongly. Fencing really is critical, and explaining the need for fencing is nearly a weekly event. &lt;br /&gt;
&lt;br /&gt;
So then, let&#039;s discuss fencing.&lt;br /&gt;
&lt;br /&gt;
When a node stops responding, an internal timeout and counter start ticking away. During this time, no messages are moving through the cluster because virtual synchrony is no longer possible and the cluster is, essentially, hung. If the node responds in time, the timeout and counter reset and the cluster begins operating properly again. &lt;br /&gt;
&lt;br /&gt;
If, on the other hand, the node does not respond in time, the node will be declared dead and the process of ejecting it from the cluster begins. &lt;br /&gt;
&lt;br /&gt;
The cluster will take a &amp;quot;head count&amp;quot; to see which nodes it still has contact with and will determine then if there are enough votes from those nodes to have quorum. If you are using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[qdisk]]&amp;lt;/span&amp;gt;, it&#039;s heuristics will run and then it&#039;s votes will be added. If there is sufficient votes for quorum, the cluster will issue a &amp;quot;fence&amp;quot; against the lost node. A fence action is a call sent to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fenced&amp;lt;/span&amp;gt;, the fence daemon. &lt;br /&gt;
&lt;br /&gt;
Which physical node sends the fence call is somewhat random and irrelevant. What matters is that the call comes from the [[CPG]] which has quorum.&lt;br /&gt;
&lt;br /&gt;
The fence daemon will look at the cluster configuration and get the fence devices configured for the dead node. Then, one at a time and in the order that they appear in the configuration, the fence daemon will call those fence devices, via their fence agents, passing to the fence agent any configured arguments like username, password, port number and so on. If the first fence agent returns a failure, the next fence agent will be called. If the second fails, the third will be called, then the forth and so on. Once the last (or perhaps only) fence device fails, the fence daemon will retry again, starting back at the start of the list. It will do this indefinitely until one of the fence devices success.&lt;br /&gt;
&lt;br /&gt;
Here&#039;s the flow, in point form:&lt;br /&gt;
&lt;br /&gt;
* The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;openais&amp;lt;/span&amp;gt; program collects messages and sends them off, one at a time, to all nodes.&lt;br /&gt;
* All nodes respond, and the next message is sent. Repeat continuously during normal operation.&lt;br /&gt;
* Suddenly, one node stops responding.&lt;br /&gt;
** Communication freezes while the cluster waits for the silent node. &lt;br /&gt;
** A timeout starts (~&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;238&amp;lt;/span&amp;gt;ms by default), and each time the timeout is hit, and error counter increments.&lt;br /&gt;
** The silent node responds before the counter reaches the limit.&lt;br /&gt;
*** The counter is reset to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;0&amp;lt;/span&amp;gt;&lt;br /&gt;
*** The cluster operates normally again.&lt;br /&gt;
* Again, one node stops responding.&lt;br /&gt;
** Again, the timeout begins. As each totem packet times out, a new packet is sent and the error count increments.&lt;br /&gt;
** The error counts exceed the limit (&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;4&amp;lt;/span&amp;gt; errors is the default); Roughly one second has passed (&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;238ms * 4&amp;lt;/span&amp;gt; plus some overhead).&lt;br /&gt;
** The node is declared dead.&lt;br /&gt;
** The cluster checks which members it still has, and if that provides enough votes for quorum.&lt;br /&gt;
*** If there are too few votes for quorum, the cluster software freezes and the node(s) withdraw from the cluster.&lt;br /&gt;
*** If there are enough votes for quorum, the silent node is declared dead.&lt;br /&gt;
**** &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;openais&amp;lt;/span&amp;gt; calls &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fenced&amp;lt;/span&amp;gt;, telling it to fence the node.&lt;br /&gt;
**** Which fence device(s) to use, that is, what &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fence_agent&amp;lt;/span&amp;gt; to call and what arguments to pass, is gathered.&lt;br /&gt;
**** For each configured fence device:&lt;br /&gt;
***** The agent is called and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fenced&amp;lt;/span&amp;gt; waits for the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fence_agent&amp;lt;/span&amp;gt; to exit.&lt;br /&gt;
***** The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fence_agent&amp;lt;/span&amp;gt;&#039;s exit code is examined. If it&#039;s a success, recovery starts. If it failed, the next configured fence agent is called.&lt;br /&gt;
**** If all (or the only) configured fence fails, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fenced&amp;lt;/span&amp;gt; will start over.&lt;br /&gt;
**** &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fenced&amp;lt;/span&amp;gt; will wait and loop forever until a fence agent succeeds. During this time, &#039;&#039;&#039;the cluster is hung&#039;&#039;&#039;.&lt;br /&gt;
** Once a &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fence_agent&amp;lt;/span&amp;gt; succeeds, the cluster is reconfigured.&lt;br /&gt;
*** A new closed process group (&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cpg&amp;lt;/span&amp;gt;) is formed.&lt;br /&gt;
*** A new fence domain is formed.&lt;br /&gt;
*** Lost cluster resources are recovered as per &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt;&#039;s configuration (including file system recovery as needed).&lt;br /&gt;
*** Normal cluster operation is restored.&lt;br /&gt;
&lt;br /&gt;
This skipped a few key things, but the general flow of logic should be there.&lt;br /&gt;
&lt;br /&gt;
This is why fencing is so important. Without a properly configured and tested fence device or devices, the cluster will never successfully fence and the cluster will stay hung forever.&lt;br /&gt;
&lt;br /&gt;
== Component; totem ==&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[totem]]&amp;lt;/span&amp;gt; protocol defines message passing within the cluster and it is used by &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;openais&amp;lt;/span&amp;gt;. A token is passed around all the nodes in the cluster, and the timeout discussed in [[Red_Hat_Cluster_Service_3_Tutorial#Concept;_Fencing|fencing]] above is actually a token timeout. The counter, then, is the number of lost tokens that are allowed before a node is considered dead.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;totem&amp;lt;/span&amp;gt; protocol supports something called &#039;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rrp&amp;lt;/span&amp;gt;&#039;, &#039;&#039;&#039;R&#039;&#039;&#039;edundant &#039;&#039;&#039;R&#039;&#039;&#039;ing &#039;&#039;&#039;P&#039;&#039;&#039;rotocol. Through &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rrp&amp;lt;/span&amp;gt;, you can add a second backup ring on a separate network to take over in the event of a failure in the first ring. In RHCS, these rings are known as &amp;quot;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ring 0&amp;lt;/span&amp;gt;&amp;quot; and &amp;quot;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ring 1&amp;lt;/span&amp;gt;&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
== Component; rgmanager ==&lt;br /&gt;
&lt;br /&gt;
When the cluster membership changes, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;openais&amp;lt;/span&amp;gt; tells the cluster that it needs to recheck it&#039;s resources. This causes &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt;, the resource group manager, to run. It will examine what changed and then will start, stop, migrate or recover cluster resources as needed.&lt;br /&gt;
&lt;br /&gt;
Within &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt;, one or more &#039;&#039;resources&#039;&#039; are brought together as a &#039;&#039;service&#039;&#039;. This service is then optionally assigned to a &#039;&#039;failover domain&#039;&#039;, an subset of nodes that can have preferential ordering.&lt;br /&gt;
&lt;br /&gt;
== Component; qdisk ==&lt;br /&gt;
&lt;br /&gt;
{{note|1=&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;qdisk&amp;lt;/span&amp;gt; does not work reliably on a DRBD resource, so we will not be using it in this tutorial.}}&lt;br /&gt;
&lt;br /&gt;
A Quorum disk, known as a &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;qdisk&amp;lt;/span&amp;gt; is small partition on [[SAN]] storage used to enhance quorum. It generally carries enough votes to allow even a single node to take quorum during a cluster partition. It does this by using configured heuristics, that is custom tests, to decided which which node or partition is best suited for providing clustered services during a cluster reconfiguration. These heuristics can be simple, like testing which partition has access to a given router, or they can be as complex as the administrator wishes using custom scripts.&lt;br /&gt;
&lt;br /&gt;
Though we won&#039;t be using it here, it is well worth knowing about when you move to a cluster with [[SAN]] storage.&lt;br /&gt;
&lt;br /&gt;
== Component; DRBD ==&lt;br /&gt;
&lt;br /&gt;
[[DRBD]]; Distributed Replicating Block Device, is a technology that takes raw storage from two or more nodes and keeps their data synchronized in real time. It is sometimes described as &amp;quot;RAID 1 over Nodes&amp;quot;, and that is conceptually accurate. In this tutorial&#039;s cluster, DRBD will be used to provide that back-end storage as a cost-effective alternative to a tranditional [[SAN]] or [[iSCSI]] device.&lt;br /&gt;
&lt;br /&gt;
To help visualize DRBD&#039;s use and role, Take a look at how we will implement our [[Red Hat Cluster Service 2 Tutorial#Visualizing Storage|cluster&#039;s storage]]. Don&#039;t worry if this seems illogical at this stage. The main thing to look at are the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;drbdX&amp;lt;/span&amp;gt; devices and how they each tie back to a corresponding &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;sdaY&amp;lt;/span&amp;gt; device on either node.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
         [ an-node04 ]&lt;br /&gt;
  ______   ______    ______     __[sda4]__&lt;br /&gt;
 | sda1 | | sda2 |  | sda3 |   |  ______  |       _______    ______________    ______________________________&lt;br /&gt;
 |______| |______|  |______|   | | sda5 |-+------| drbd0 |--| drbd_sh0_vg0 |--| /dev/drbd_sh0_vg0/xen_shared |&lt;br /&gt;
     |        |         |      | |______| |   /--|_______|  |______________|  |______________________________|&lt;br /&gt;
  ___|___    _|_    ____|____  |  ______  |   |     _______    ______________    ____________________________&lt;br /&gt;
 | /boot |  | / |  | &amp;lt;swap&amp;gt;  | | | sda6 |-+---+----| drbd1 |--| drbd_an4_vg0 |--| /dev/drbd_an4_vg0/vm0001_1 |&lt;br /&gt;
 |_______|  |___|  |_________| | |______| |   | /--|_______|  |______________|  |____________________________|&lt;br /&gt;
                               |  ______  |   | |     _______    ______________    ____________________________&lt;br /&gt;
                               | | sda7 |-+---+-+----| drbd2 |--| drbd_an5_vg0 |--| /dev/drbd_an4_vg0/vm0002_1 | &lt;br /&gt;
                               | |______| |   | | /--|_______|  |______________|  |____________________________|&lt;br /&gt;
                               |  ______  |   | | |                         | |    _______________________&lt;br /&gt;
                               | | sda8 |-+---+-+-+--\                      | \---| Example LV for 2nd VM |&lt;br /&gt;
                               | |______| |   | | |  |                      |     |_______________________|&lt;br /&gt;
                               |__________|   | | |  |                      |      _______________________&lt;br /&gt;
         [ an-node05 ]                        | | |  |                      \-----| Example LV for 3rd VM |&lt;br /&gt;
  ______   ______    ______     __[sda4]__    | | |  |                            |_______________________|&lt;br /&gt;
 | sda1 | | sda2 |  | sda3 |   |  ______  |   | | |  |                   &lt;br /&gt;
 |______| |______|  |______|   | | sda5 |-+---/ | |  |   _______    __________________&lt;br /&gt;
     |        |         |      | |______| |     | |  \--| drbd3 |--| Spare PV for     |&lt;br /&gt;
  ___|___    _|_    ____|____  |  ______  |     | |  /--|_______|  | future expansion |&lt;br /&gt;
 | /boot |  | / |  | &amp;lt;swap&amp;gt;  | | | sda6 |-+-----/ |  |             |__________________|&lt;br /&gt;
 |_______|  |___|  |_________| | |______| |       |  |&lt;br /&gt;
                               |  ______  |       |  |&lt;br /&gt;
                               | | sda7 |-+-------/  |&lt;br /&gt;
                               | |______| |          |&lt;br /&gt;
                               |  ______  |          |&lt;br /&gt;
                               | | sda8 |-+----------/&lt;br /&gt;
                               | |______| |&lt;br /&gt;
                               |__________|&lt;br /&gt;
.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Component; CLVM ==&lt;br /&gt;
&lt;br /&gt;
With [[DRBD]] providing the raw storage for the cluster, we must next consider partitions. This is where Clustered [[LVM]], known as [[CLVM]], comes into play.&lt;br /&gt;
&lt;br /&gt;
CLVM is ideal in that by using [[DLM]], the distributed lock manager, it won&#039;t allow access to cluster members outside of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;openais&amp;lt;/span&amp;gt;&#039;s closed process group, which, in turn, requires quorum.&lt;br /&gt;
&lt;br /&gt;
It is ideal because it can take one or more raw devices, known as &amp;quot;physical volumes&amp;quot;, or simple as [[PV]]s, and combine their raw space into one or more &amp;quot;volume groups&amp;quot;, known as [[VG]]s. These volume groups then act just like a typical hard drive and can be &amp;quot;partitioned&amp;quot; into one or more &amp;quot;logical volumes&amp;quot;, known as [[LV]]s. These LVs are where [[Xen]]&#039;s [[domU]] virtual machines will exist and where we will create our [[GFS2]] clustered file system.&lt;br /&gt;
&lt;br /&gt;
LVM is particularly attractive because of how incredibly flexible it is. We can easily add new physical volumes later, and then grow an existing volume group to use the new space. This new space can then be given to existing logical volumes, or entirely new logical volumes can be created. This can all be done while the cluster is online offering an upgrade path with no down time.&lt;br /&gt;
&lt;br /&gt;
== Component; GFS2 ==&lt;br /&gt;
&lt;br /&gt;
With [[DRBD]] providing the clusters raw storage space, and [[CLVM|Clustered LVM]] providing the logical partitions, we can now look at the clustered file system. This is the role of the Global File System version 2, known simply as [[GFS2]].&lt;br /&gt;
&lt;br /&gt;
It works much like standard filesystem, with user-land tools like &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;mkfs.gfs2&amp;lt;/span&amp;gt;, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fsck.gfs2&amp;lt;/span&amp;gt; and so on. The major difference is that it and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clvmd&amp;lt;/span&amp;gt; use the cluster&#039;s [[DLM|distributed locking mechanism]] provided by the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;dlm_controld&amp;lt;/span&amp;gt; daemon. Once formatted, the GFS2-formatted partition can be mounted and used by any node in the cluster&#039;s [[CPG|closed process group]]. All nodes can then safely read from and write to the data on the partition simultaneously.&lt;br /&gt;
&lt;br /&gt;
== Component; DLM ==&lt;br /&gt;
&lt;br /&gt;
One of the major roles of a cluster is to provide [[DLM|distributed locking]] on clustered storage. In fact, storage software can not be clustered without using [[DLM]], as provided by the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;dlm_controld&amp;lt;/span&amp;gt; daemon and using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;openais&amp;lt;/span&amp;gt;&#039;s virtual synchrony via [[CPG]]. &lt;br /&gt;
&lt;br /&gt;
Through DLM, all nodes accessing clustered storage are guaranteed to get [[POSIX]] locks, called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;plock&amp;lt;/span&amp;gt;s, in the same order across all nodes. Both [[CLVM]] and [[GFS2]] rely on DLM, though other clustered storage, like OCFS2, use it as well.&lt;br /&gt;
&lt;br /&gt;
== Component; Xen ==&lt;br /&gt;
&lt;br /&gt;
Two of the most popular open-source virtualization platforms available in the Linux world today and [[Xen]] and [[KVM]]. The former is maintained by [http://www.citrix.com/xenserver Citrix] and the other by [http://www.redhat.com/solutions/virtualization/ Redhat]. It would be difficult to say which is &amp;quot;better&amp;quot;, as they&#039;re both very good. Xen can be argued to be more mature where KVM is the &amp;quot;official&amp;quot; solution supported by Red Hat in [[EL6]].&lt;br /&gt;
&lt;br /&gt;
We will be using the Xen [[hypervisor]] and a &amp;quot;host&amp;quot; virtual server called [[dom0]]. In Xen, every machine is a virtual server, including the system you installed when you built the server. This is possible thanks to a small Xen micro-operating system that initially boots, then starts up your original installed operating system as a virtual server with special access to the underlying hardware and hypervisor management tools.&lt;br /&gt;
&lt;br /&gt;
The rest of the virtual servers in a Xen environment are collectively called &amp;quot;[[domU]]&amp;quot; virtual servers. These will be the highly-available resource that will migrate between nodes during failure events in our cluster.&lt;br /&gt;
&lt;br /&gt;
= Base Setup =&lt;br /&gt;
&lt;br /&gt;
Before we can look at the cluster, we must first build two cluster nodes and then install the operating system.&lt;br /&gt;
&lt;br /&gt;
== Hardware Requirements ==&lt;br /&gt;
&lt;br /&gt;
The bare minimum requirements are;&lt;br /&gt;
&lt;br /&gt;
* All hardware must be supported by [[EL5]]. It is strongly recommended that you check compatibility before making any purchases.&lt;br /&gt;
* A dual-core [[CPU]] with hardware virtualization support.&lt;br /&gt;
* Three network cards; At least one should be gigabit or faster.&lt;br /&gt;
* One hard drive.&lt;br /&gt;
* 2 [[GiB]] of [[RAM]]&lt;br /&gt;
* A [[fence|fence device]]. This can be an [[IPMI]]-enabled server, a [http://nodeassassin.org Node Assassin], a [http://www.apc.com/products/resource/include/techspec_index.cfm?base_sku=AP7900 switched PDU] or similar.&lt;br /&gt;
&lt;br /&gt;
This tutorial was written using the following hardware:&lt;br /&gt;
&lt;br /&gt;
* AMD Athlon [http://products.amd.com/en-us/DesktopCPUDetail.aspx?id=610 II X4 600e Processor]&lt;br /&gt;
* ASUS [http://www.asus.com/product.aspx?P_ID=LVmksAnszmVimOOp M4A785T-M/CSM]&lt;br /&gt;
* 4GB Kingston [http://www.ec.kingston.com/ecom/configurator_new/partsinfo.asp?root=&amp;amp;LinkBack=&amp;amp;ktcpartno=KVR1333D3N9K2/4G KVR1333D3N9K2/4G], 4GB (2x2GB) DDR3-1333, Non-ECC&lt;br /&gt;
* Seagate [http://www.seagate.com/ww/v/index.jsp?vgnextoid=70f4bfafecadd110VgnVCM100000f5ee0a0aRCRD ST9500420AS] 2.5&amp;quot; SATA HDD&lt;br /&gt;
* 2x Intel [http://www.intel.com/products/desktop/adapters/gigabit-ct/gigabit-ct-overview.htm Pro/1000CT EXPI9301CT] PCIe NICs&lt;br /&gt;
* [[Node Assassin v1.1.4]]&lt;br /&gt;
&lt;br /&gt;
This is not an endorsement of the above hardware. I put a heavy emphasis on minimizing power consumption and bought what was within my budget. This hardware was never meant to be put into production, but instead was chosen to serve the purpose of my own study and for creating this tutorial. What you ultimately choose to use, provided it meets the minimum requirements, is entirely up to you and your requirements.&lt;br /&gt;
&lt;br /&gt;
{{note|1=I use three physical [[NIC]]s, but you can get away with two by merging the storage and back-channel networks, which we will discuss shortly. If you are really in a pinch, you could create three aliases on on interface and isolate them using [[VLAN]]s. If you go this route, please ensure that your VLANs are configured and working before beginning this tutorial. Pay close attention to multicast traffic.}}&lt;br /&gt;
&lt;br /&gt;
== Pre-Assembly ==&lt;br /&gt;
&lt;br /&gt;
Before you assemble your nodes, take a moment to record the [[MAC]] addresses of each network interface and then note where each interface is physically installed. This will help you later when configuring the networks. I generally create a simple text file with the MAC addresses, the interface I intend to assign to it and where it physically is located.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
-=] an-node04&lt;br /&gt;
48:5B:39:3C:53:15   # eth0 - onboard interface&lt;br /&gt;
00:1B:21:72:9B:5A   # eth1 - right-most PCIe interface&lt;br /&gt;
00:1B:21:72:96:EA   # eth2 - left-most PCIe interface&lt;br /&gt;
&lt;br /&gt;
-=] an-node05&lt;br /&gt;
48:5B:39:3C:53:13   # eth0 - onboard interface&lt;br /&gt;
00:1B:21:72:99:AB   # eth1 - right-most PCIe interface&lt;br /&gt;
00:1B:21:72:96:A6   # eth2 - left-most PCIe interface&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== OS Install ==&lt;br /&gt;
&lt;br /&gt;
Later steps will include packages to install, so the initial OS install can be minimal. I like to change the default run-level to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;3&amp;lt;/span&amp;gt;, remove &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rhgb quiet&amp;lt;/span&amp;gt; from the [[grub]] menu, disable the firewall and disable [[SELinux]]. In a production cluster, you will want to use firewalling and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;selinux&amp;lt;/span&amp;gt;, but until you finish studying, leave it off to keep things simple.&lt;br /&gt;
&lt;br /&gt;
{{note|1=Before [[EL5]].4, you could not use SELinux. It is now possible to use it, and it is recommended that you do so in any production cluster.}}&lt;br /&gt;
{{note|1=Ports and protocols to open in a firewall will be discussed later in the networking section.}}&lt;br /&gt;
&lt;br /&gt;
I like to minimize and automate my installs as much as possible. To that end, I run a little [[Setting Up a PXE Server in Fedora|PXE]] server on my network and use a [[kickstart]] script to automate the install. Here is a simple one for use on a single-drive node:&lt;br /&gt;
* [[generic_el5_node.ks]]&lt;br /&gt;
&lt;br /&gt;
If you decide to manually install [[EL5]] on your nodes, please try to keep the installation as small as possible. The fewer packages installed, the fewer sources of problems and vectors for attack.&lt;br /&gt;
&lt;br /&gt;
== Post Install OS Changes ==&lt;br /&gt;
&lt;br /&gt;
This section discusses changes I recommend, but are not required. If you wish to adapt any of the steps below, please do so but be sure to keep the changes consistent through out the implementation of this tutorial.&lt;br /&gt;
&lt;br /&gt;
=== Network Planning ===&lt;br /&gt;
&lt;br /&gt;
The most important change that is recommended is to get your nodes into a consistent networking configuration. This will prove very handy when trying to keep track of your networks and where they&#039;re physically connected. This becomes exponentially more helpful as your cluster grows.&lt;br /&gt;
&lt;br /&gt;
The first step is to understand the three networks we will be creating. Once you understand their role, you will need to decide which interface on the nodes will be used for each network.&lt;br /&gt;
&lt;br /&gt;
==== Cluster Networks ====&lt;br /&gt;
&lt;br /&gt;
The three networks are;&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Network&lt;br /&gt;
!Acronym&lt;br /&gt;
!Use&lt;br /&gt;
|-&lt;br /&gt;
|Back-Channel Network&lt;br /&gt;
|&#039;&#039;&#039;BCN&#039;&#039;&#039;&lt;br /&gt;
|Private cluster communications, virtual machine migrations, fence devices&lt;br /&gt;
|-&lt;br /&gt;
|Storage Network&lt;br /&gt;
|&#039;&#039;&#039;SN&#039;&#039;&#039;&lt;br /&gt;
|Used exclusively for storage communications. Possible to use as totem&#039;s redundant ring.&lt;br /&gt;
|-&lt;br /&gt;
|Internet-Facing Network&lt;br /&gt;
|&#039;&#039;&#039;IFN&#039;&#039;&#039;&lt;br /&gt;
|Internet-polluted network. No cluster, storage or cluster device communication.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Things To Consider ====&lt;br /&gt;
&lt;br /&gt;
When planning which interfaces to connect to each network, consider the following, in order of importance:&lt;br /&gt;
&lt;br /&gt;
* If your nodes have [[IPMI]] and an interface sharing a physical [[RJ-45]] connector, this must be on the &#039;&#039;&#039;Back-Channel Network&#039;&#039;&#039;. The reasoning is that having your fence device accessible on the &#039;&#039;&#039;Internet-Facing Network&#039;&#039;&#039; poses a &#039;&#039;major&#039;&#039; security risk. Having the IPMI interface on the &#039;&#039;&#039;Storage Network&#039;&#039;&#039; can cause problems if a fence is fired and the network is saturated with storage traffic.&lt;br /&gt;
&lt;br /&gt;
* The lowest-latency network interface should be used as the &#039;&#039;&#039;Back-Channel Network&#039;&#039;&#039;. The cluster is maintained by [[multicast]] messaging between the nodes using something called the [[totem]] protocol. Any delay in the delivery of these messages can risk causing a failure and ejection of effected nodes when no actual failure existed. This will be discussed in greater detail later.&lt;br /&gt;
&lt;br /&gt;
* The network with the most raw bandwidth should be used for the &#039;&#039;&#039;Storage Network&#039;&#039;&#039;. All disk writes must be sent across the network and committed to the remote nodes before the write is declared complete. This causes the network to become the disk I/O bottle neck. Using a network with jumbo frames and high raw throughput will help minimize this bottle neck.&lt;br /&gt;
&lt;br /&gt;
* During the live migration of virtual machines, the VM&#039;s RAM is copied to the other node using the &#039;&#039;&#039;BCN&#039;&#039;&#039;. For this reason, the second fastest network should be used for back-channel communication. However, these copies can saturate the network, so care must be taken to ensure that cluster communications get higher priority. This can be done using a managed switch. If you can not ensure priority for totem multicast, then be sure to configure Xen later to use the storage network for migrations.&lt;br /&gt;
&lt;br /&gt;
* The remain, slowest interface should be used for the &#039;&#039;&#039;IFN&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
==== Planning the Networks ====&lt;br /&gt;
&lt;br /&gt;
This paper will use the following setup. Feel free to alter the interface to network mapping and the [[IP]] [[subnet]]s used to best suit your needs. For reasons completely my own, I like to start my cluster IPs final [[octal]] at &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;71&amp;lt;/span&amp;gt; for node 1 and then increment up from there. This is entirely arbitrary, so please use what ever makes sense to you. The remainder of this tutorial will follow the convention below:&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Network&lt;br /&gt;
!Interface&lt;br /&gt;
!Subnet&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;IFN&#039;&#039;&#039;&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth0&amp;lt;/span&amp;gt;&lt;br /&gt;
|&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;
|&#039;&#039;&#039;SN&#039;&#039;&#039;&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth1&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;192.168.2.0/24&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;BCN&#039;&#039;&#039;&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth2&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;192.139.3.0/24&amp;lt;/span&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
This translates to the following per-node configuration:&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!colspan=&amp;quot;2&amp;quot;|&lt;br /&gt;
!colspan=&amp;quot;2&amp;quot;|an-node04&lt;br /&gt;
!colspan=&amp;quot;2&amp;quot;|an-node05&lt;br /&gt;
|-&lt;br /&gt;
!&lt;br /&gt;
!Interface&lt;br /&gt;
!IP Address&lt;br /&gt;
!Host Name(s)&lt;br /&gt;
!IP Address&lt;br /&gt;
!Host Name(s)&lt;br /&gt;
|-&lt;br /&gt;
!IFN&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth0&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;192.168.1.74&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04.ifn&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;192.168.1.75&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05.ifn&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!SN&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth1&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;192.168.2.74&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04.sn&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;192.168.2.75&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05.sn&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!BCN&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth2&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;192.168.3.74&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04 an-node04.alteeve.com an-node04.bcn&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;192.168.3.75&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05 an-node05.alteeve.com an-node05.bcn&amp;lt;/span&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Network Configuration ===&lt;br /&gt;
&lt;br /&gt;
So now we&#039;ve planned the network, so it is time to implement it.&lt;br /&gt;
&lt;br /&gt;
==== Warning About Managed Switches ====&lt;br /&gt;
&lt;br /&gt;
{{warning|1=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 and configuring [[Multicast IGMP Snooping]] or [[Spanning Tree Protocol]]. They have been known to cause problems by not allowing multicast packets to reach all nodes fast enough or at all. This can cause somewhat random break-downs in communication between your nodes, leading to seemingly random fences and DLM lock timeouts. If your switches support [[PIM Routing]], be sure to use it!&lt;br /&gt;
&lt;br /&gt;
If you have problems with your cluster not forming, or seemingly random fencing, try using a cheap [http://dlink.ca/products/?pid=230 unmanaged] switch. If the problem goes away, you are most likely dealing with a managed switch configuration problem.&lt;br /&gt;
&lt;br /&gt;
==== Disable Firewalling ====&lt;br /&gt;
&lt;br /&gt;
To &amp;quot;keep things simple&amp;quot;, we will disable all firewalling on the cluster nodes. This is not recommended in production environments, obviously, so below will be a table of ports and protocols to open when you do get into production. Until then, we will simply use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;chkconfig&amp;lt;/span&amp;gt; to 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;.&lt;br /&gt;
&lt;br /&gt;
{{note|1=Cluster 2 does not support [[IPv6]], so you can skip or ignore it if you wish. I like to disable it just to be certain that it can&#039;t cause issues though.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
chkconfig iptables off&lt;br /&gt;
chkconfig ip6tables off&lt;br /&gt;
/etc/init.d/iptables stop&lt;br /&gt;
/etc/init.d/ip6tables stop&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now confirm that they are off by having &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; list their rules.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
iptables -L&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Chain INPUT (policy ACCEPT)&lt;br /&gt;
target     prot opt source               destination         &lt;br /&gt;
&lt;br /&gt;
Chain FORWARD (policy ACCEPT)&lt;br /&gt;
target     prot opt source               destination         &lt;br /&gt;
&lt;br /&gt;
Chain OUTPUT (policy ACCEPT)&lt;br /&gt;
target     prot opt source               destination         &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;
ip6tables -L&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Chain INPUT (policy ACCEPT)&lt;br /&gt;
target     prot opt source               destination         &lt;br /&gt;
&lt;br /&gt;
Chain FORWARD (policy ACCEPT)&lt;br /&gt;
target     prot opt source               destination         &lt;br /&gt;
&lt;br /&gt;
Chain OUTPUT (policy ACCEPT)&lt;br /&gt;
target     prot opt source               destination         &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When you do prepare to go into production, these are the protocols and ports you need to open between cluster nodes. Remember to allow multicast communications as well!&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Port&lt;br /&gt;
!Protocol&lt;br /&gt;
!Component&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;5404&amp;lt;/span&amp;gt;, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;5405&amp;lt;/span&amp;gt;&lt;br /&gt;
|[[UDP]]&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[cman]]&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;8084&amp;lt;/span&amp;gt;, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;5405&amp;lt;/span&amp;gt;&lt;br /&gt;
|[[TCP]]&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[luci]]&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;11111&amp;lt;/span&amp;gt;&lt;br /&gt;
|[[TCP]]&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[ricci]]&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;14567&amp;lt;/span&amp;gt;&lt;br /&gt;
|[[TCP]]&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[gnbd]]&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;16851&amp;lt;/span&amp;gt;&lt;br /&gt;
|[[TCP]]&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[modclusterd]]&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;21064&amp;lt;/span&amp;gt;&lt;br /&gt;
|[[TCP]]&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[dlm]]&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;50006&amp;lt;/span&amp;gt;, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;50008&amp;lt;/span&amp;gt;, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;50009&amp;lt;/span&amp;gt;&lt;br /&gt;
|[[TCP]]&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[ccsd]]&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;50007&amp;lt;/span&amp;gt;&lt;br /&gt;
|[[UDP]]&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[ccsd]]&amp;lt;/span&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Disable NetworkManager, Enable network ====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;NetworkManager&amp;lt;/span&amp;gt; daemon is an excellent daemon in environments where a system connects to a variety of networks. The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;NetworkManager&amp;lt;/span&amp;gt; daemon handles changing the networking configuration whenever it senses a change in the network state, like when a cable is unplugged or a wireless network comes or goes. As useful as this is on laptops and workstations, it can be detrimental in a cluster.&lt;br /&gt;
&lt;br /&gt;
To prevent the networking from changing once we&#039;ve got it setup, we want to replace &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;NetworkManager&amp;lt;/span&amp;gt; daemon with the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;network&amp;lt;/span&amp;gt; initialization script. The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;network&amp;lt;/span&amp;gt; script will start and stop networking, but otherwise it will leave the configuration alone. This is ideal in servers, and doubly-so in clusters given their sensitivity to transient network issues.&lt;br /&gt;
&lt;br /&gt;
Start by removing &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;NetworkManager&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 remove NetworkManager NetworkManager-glib NetworkManager-gnome NetworkManager-devel NetworkManager-glib-devel&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now you want to ensure that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;network&amp;lt;/span&amp;gt; starts with the system.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
chkconfig network on&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Setup /etc/hosts ====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/hosts&amp;lt;/span&amp;gt; file, by default, will resolve the hostname to the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;lo&amp;lt;/span&amp;gt; (&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;127.0.0.1&amp;lt;/span&amp;gt;) interface. The cluster uses this name though for knowing which interface to use for the [[totem]] protocol (and thus all cluster communications). To this end, we will remove the hostname from &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;127.0.0.1&amp;lt;/span&amp;gt; and instead put it on the IP of our &#039;&#039;&#039;BCN&#039;&#039;&#039; interface. We will also add entries for all other networks for both nodes in the cluster along with entries for the fence device(s). &lt;br /&gt;
&lt;br /&gt;
Once done, the edited &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/hosts&amp;lt;/span&amp;gt; file should be suitable for copying to both nodes in the cluster.&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;
# Do not remove the following line, or various programs&lt;br /&gt;
# that require network functionality will fail.&lt;br /&gt;
127.0.0.1	localhost.localdomain localhost&lt;br /&gt;
::1		localhost6.localdomain6 localhost6&lt;br /&gt;
&lt;br /&gt;
192.168.1.74	an-node04.ifn&lt;br /&gt;
192.168.2.74	an-node04.sn&lt;br /&gt;
192.168.3.74	an-node04 an-node04.bcn an-node04.alteeve.com&lt;br /&gt;
&lt;br /&gt;
192.168.1.75	an-node05.ifn&lt;br /&gt;
192.168.2.75	an-node05.sn&lt;br /&gt;
192.168.3.75	an-node05 an-node05.bcn an-node05.alteeve.com&lt;br /&gt;
&lt;br /&gt;
192.168.3.61	fence_na01.alteeve.com	# Node Assassin&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Mapping Interfaces to ethX Names ====&lt;br /&gt;
&lt;br /&gt;
Chances are good that the assignment of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ethX&amp;lt;/span&amp;gt; interface names to your physical network cards is not ideal. There is no strict technical reason to change the mapping, but it will make your life a lot easier if all nodes use the same &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ethX&amp;lt;/span&amp;gt; names for the same subnets. &lt;br /&gt;
&lt;br /&gt;
The actual process of changing the mapping is a little involved. For this reason, there is a dedicated mini-tutorial which you can find below. Please jump to it and then return once your mapping is as you like it.&lt;br /&gt;
&lt;br /&gt;
* [[Changing the ethX to Ethernet Device Mapping in EL5]]&lt;br /&gt;
&lt;br /&gt;
==== Set IP Addresses ====&lt;br /&gt;
&lt;br /&gt;
The last step in setting up the network interfaces is to manually assign the IP addresses and define the subnets for the interfaces. This involves directly editing the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/sysconfig/network-scripts/ifcfg-ethX&amp;lt;/span&amp;gt; files. There are a large set of options that can be set in these configuration files, but most are outside the scope of this tutorial. To get a better understanding of the available options, please see:&lt;br /&gt;
&lt;br /&gt;
* [http://docs.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/5/html/Deployment_Guide/s1-networkscripts-interfaces.html Red Hat&#039;s Interface Configuration Guide]&lt;br /&gt;
&lt;br /&gt;
{{note|1=Later on, we will be creating two bridges, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xenbr0&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xenbr2&amp;lt;/span&amp;gt; which we will then connect [[dom0]]&#039;s &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; to. These bridges then become available to the [[Xen]]&#039;s [[domU]] VMs. Bridge options and arguments can be found in the link above.}}&lt;br /&gt;
&lt;br /&gt;
Here are the three configuration files from &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt; which you can use as guides. Please &#039;&#039;&#039;do not&#039;&#039;&#039; copy these over your files! Doing so will cause your interfaces to fail outright as every interface&#039;s [[MAC]] address is unique. Adapt these to suite your needs.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/sysconfig/network-scripts/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;
# Realtek Semiconductor Co., Ltd. RTL8111/8168B PCI Express Gigabit Ethernet controller&lt;br /&gt;
HWADDR=48:5B:39:3C:53:14&lt;br /&gt;
DEVICE=eth0&lt;br /&gt;
BOOTPROTO=static&lt;br /&gt;
ONBOOT=yes&lt;br /&gt;
IPADDR=192.168.1.74&lt;br /&gt;
NETMASK=255.255.255.0&lt;br /&gt;
GATEWAY=192.168.1.254&lt;br /&gt;
DNS1=192.139.81.117&lt;br /&gt;
DNS2=192.139.81.1&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;
vim /etc/sysconfig/network-scripts/ifcfg-eth1&lt;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 82574L Gigabit Network Connection&lt;br /&gt;
HWADDR=00:1B:21:72:9B:5A&lt;br /&gt;
DEVICE=eth1&lt;br /&gt;
BOOTPROTO=static&lt;br /&gt;
ONBOOT=yes&lt;br /&gt;
IPADDR=192.168.2.74&lt;br /&gt;
NETMASK=255.255.255.0&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;
vim /etc/sysconfig/network-scripts/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 82574L Gigabit Network Connection&lt;br /&gt;
HWADDR=00:1B:21:72:96:EA&lt;br /&gt;
DEVICE=eth2&lt;br /&gt;
BOOTPROTO=static&lt;br /&gt;
ONBOOT=yes&lt;br /&gt;
IPADDR=192.168.3.74&lt;br /&gt;
NETMASK=255.255.255.0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you do not want to use the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;DNSx=&amp;lt;/span&amp;gt; options, you will need to setup the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/resolv.conf&amp;lt;/span&amp;gt; file for [[DNS]] resolution. You can learn more about this file&#039;s purpose by reading it&#039;s [[man]] page; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;man resolv.conf&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Finally, restart &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;network&amp;lt;/span&amp;gt; and you should have you interfaces setup properly.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/network 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;
Shutting down interface eth0:                              [  OK  ]&lt;br /&gt;
Shutting down interface eth1:                              [  OK  ]&lt;br /&gt;
Shutting down interface eth2:                              [  OK  ]&lt;br /&gt;
Shutting down loopback interface:                          [  OK  ]&lt;br /&gt;
Bringing up loopback interface:                            [  OK  ]&lt;br /&gt;
Bringing up interface eth0:                                [  OK  ]&lt;br /&gt;
Bringing up interface eth1:                                [  OK  ]&lt;br /&gt;
Bringing up interface eth2:                                [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can verify your configuration using the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ifconfig&amp;lt;/span&amp;gt; tool. The output below is from &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&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;
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:3974 errors:0 dropped:0 overruns:0 frame:0&lt;br /&gt;
          TX packets:1810 errors:0 dropped:0 overruns:0 carrier:0&lt;br /&gt;
          collisions:0 txqueuelen:1000 &lt;br /&gt;
          RX bytes:1452567 (1.3 MiB)  TX bytes:237057 (231.5 KiB)&lt;br /&gt;
          Interrupt:246 Base address:0xe000 &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:117 errors:0 dropped:0 overruns:0 frame:0&lt;br /&gt;
          TX packets:62 errors:0 dropped:0 overruns:0 carrier:0&lt;br /&gt;
          collisions:0 txqueuelen:1000 &lt;br /&gt;
          RX bytes:30766 (30.0 KiB)  TX bytes:16018 (15.6 KiB)&lt;br /&gt;
          Interrupt:17 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:54 errors:0 dropped:0 overruns:0 frame:0&lt;br /&gt;
          TX packets:60 errors:0 dropped:0 overruns:0 carrier:0&lt;br /&gt;
          collisions:0 txqueuelen:1000 &lt;br /&gt;
          RX bytes:11492 (11.2 KiB)  TX bytes:15638 (15.2 KiB)&lt;br /&gt;
          Interrupt:16 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:34 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:0 &lt;br /&gt;
          RX bytes:9268 (9.0 KiB)  TX bytes:9268 (9.0 KiB)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{note|1=You may see a &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virbr0&amp;lt;/span&amp;gt; interface. You can safely ignore it, we will remove it later.}}&lt;br /&gt;
&lt;br /&gt;
=== Setting up SSH ===&lt;br /&gt;
&lt;br /&gt;
Setting up [[SSH]] shared keys will allow your nodes to pass files between one another and execute commands remotely without needing to enter a password. This will be needed later when we want to enable applications like &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;libvirtd&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-manager&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
SSH is, on it&#039;s own, a very big topic. If you are not familiar with SSH, please take some time to learn about it before proceeding. A great first step is the [http://en.wikipedia.org/wiki/Secure_Shell Wikipedia] entry on SSH, as well as the SSH [[man]] page; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;man ssh&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[SSH]] 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 on each node, 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;
Created directory &#039;/root/.ssh&#039;.&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;
a1:65:a9:50:bb:15:ae:b1:6e:06:12:4a:29:d1:68:f3 root@an-node04.alteeve.com&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_rsa&amp;lt;/span&amp;gt; and the public key called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;~/.ssh/id_rsa.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;
MIIEnwIBAAKCAQBTNg6FZyDKm4GAm7c+F2enpLWy+t8ZZjm4Z3Q7EhX09ukqk/Qm&lt;br /&gt;
MqprtI9OsiRVjce+wGx4nZ8+Z0NHduCVuwAxG0XG7FpKkUJC3Qb8KhyeIpKEcfYA&lt;br /&gt;
tsDUFnWddVF8Tsz6dDOhb61tAke77d9E01NfyHp88QBxjJ7w+ZgB2eLPBFm6j1t+&lt;br /&gt;
K50JHwdcFfxrZFywKnAQIdH0NCs8VaW91fQZBupg4OGOMpSBnVzoaz2ybI9bQtbZ&lt;br /&gt;
4GwhCghzKx7Qjz20WiqhfPMfFqAZJwn0WXfjALoioMDWavTbx+J2HM8KJ8/YkSSK&lt;br /&gt;
dDEgZCItg0Q2fC35TDX+aJGu3xNfoaAe3lL1AgEjAoIBABVlq/Zq+c2y9Wo2q3Zd&lt;br /&gt;
yjJsLrj+rmWd8ZXRdajKIuc4LVQXaqq8kjjz6lYQjQAOg9H291I3KPLKGJ1ZFS3R&lt;br /&gt;
AAygnOoCQxp9H6rLHw2kbcJDZ4Eknlf0eroxqTceKuVzWUe3ev2gX8uS3z70BjZE&lt;br /&gt;
+C6SoydxK//w9aut5UJN+H5f42p95IsUIs0oy3/3KGPHYrC2Zgc2TIhe25huie/O&lt;br /&gt;
psKhHATBzf+M7tHLGia3q682JqxXru8zhtPOpEAmU4XDtNdL+Bjv+/Q2HMRstJXe&lt;br /&gt;
2PU3IpVBkirEIE5HlyOV1T802KRsSBelxPV5Y6y5TRq+cEwn0G2le1GiFBjd0xQd&lt;br /&gt;
0csCgYEA2BWkxSXhqmeb8dzcZnnuBZbpebuPYeMtWK/MMLxvJ50UCUfVZmA+yUUX&lt;br /&gt;
K9fAUvkMLd7V8/MP7GrdmYq2XiLv6IZPUwyS8yboovwWMb+72vb5QSnN6LAfpUEk&lt;br /&gt;
NRd5JkWgqRstGaUzxeCRfwfIHuAHikP2KeiLM4TfBkXzhm+VWjECgYBilQEBHvuk&lt;br /&gt;
LlY2/1v43zYQMSZNHBSbxc7R5mnOXNFgapzJeFKvaJbVKRsEQTX5uqo83jRXC7LI&lt;br /&gt;
t14pC23tpW1dBTi9bNLzQnf/BL9vQx6KFfgrXwy8KqXuajfv1ECH6ytqdttkUGZt&lt;br /&gt;
TE/monjAmR5EVElvwMubCPuGDk9zC7iQBQKBgG8hEukMKunsJFCANtWdyt5NnKUB&lt;br /&gt;
X66vWSZLyBkQc635Av11Zm8qLusq2Ld2RacDvR7noTuhkykhBEBV92Oc8Gj0ndLw&lt;br /&gt;
hhamS8GI9Xirv7JwYu5QA377ff03cbTngCJPsbYN+e/uj6eYEE/1X5rZnXpO1l6y&lt;br /&gt;
G7QYcrLE46Q5YsCrAoGAL+H5LG4idFEFTem+9Tk3hDUhO2VpGHYFXqMdctygNiUn&lt;br /&gt;
lQ6Oj7Z1JbThPJSz0RGF4wzXl/5eJvn6iPbsQDpoUcC1KM51FxGn/4X2lSCZzgqr&lt;br /&gt;
vUtslejUQJn96YRZ254cZulF/YYjHyUQ3byhDRcr9U2CwUBi5OcbFTomlvcQgHcC&lt;br /&gt;
gYEAtIpaEWt+Akz9GDJpKM7Ojpk8wTtlz2a+S5fx3WH/IVURoAzZiXzvonVIclrH&lt;br /&gt;
5RXFiwfoXlMzIulZcrBJZfTgRO9A2v9rE/ZRm6qaDrGe9RcYfCtxGGyptMKLdbwP&lt;br /&gt;
UW1emRl5celU9ZEZRBpIVTES5ZVWqD2RkkkNNJbPf5F/x+w=&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; (wrapped to make it more readable):&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 AAAAB3NzaC1yc2EAAAABIwAAAQBTNg6FZyDKm4GAm7c+F2enpLWy+t8Z&lt;br /&gt;
Zjm4Z3Q7EhX09ukqk/QmMqprtI9OsiRVjce+wGx4nZ8+Z0NHduCVuwAxG0XG7FpK&lt;br /&gt;
kUJC3Qb8KhyeIpKEcfYAtsDUFnWddVF8Tsz6dDOhb61tAke77d9E01NfyHp88QBx&lt;br /&gt;
jJ7w+ZgB2eLPBFm6j1t+K50JHwdcFfxrZFywKnAQIdH0NCs8VaW91fQZBupg4OGO&lt;br /&gt;
MpSBnVzoaz2ybI9bQtbZ4GwhCghzKx7Qjz20WiqhfPMfFqAZJwn0WXfjALoioMDW&lt;br /&gt;
avTbx+J2HM8KJ8/YkSSKdDEgZCItg0Q2fC35TDX+aJGu3xNfoaAe3lL1 root@an&lt;br /&gt;
-node04.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-node04&#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-node05&lt;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-node05 (192.168.3.75)&#039; can&#039;t be established.&lt;br /&gt;
RSA key fingerprint is 55:58:c3:32:e4:e6:5e:32:c1:db:5c:f1:36:e2:da:4b.&lt;br /&gt;
Are you sure you want to continue connecting (yes/no)? yes&lt;br /&gt;
Warning: Permanently added &#039;an-node05,192.168.3.75&#039; (RSA) to the list of known hosts.&lt;br /&gt;
Last login: Fri Mar 11 20:45:58 2011 from 192.168.1.202&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-node05&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-node04&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;
(Wrapped to make it more readable)&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 AAAAB3NzaC1yc2EAAAABIwAAAQBTNg6FZyDKm4GAm7c+F2enpLWy+t8Z&lt;br /&gt;
Zjm4Z3Q7EhX09ukqk/QmMqprtI9OsiRVjce+wGx4nZ8+Z0NHduCVuwAxG0XG7FpK&lt;br /&gt;
kUJC3Qb8KhyeIpKEcfYAtsDUFnWddVF8Tsz6dDOhb61tAke77d9E01NfyHp88QBx&lt;br /&gt;
jJ7w+ZgB2eLPBFm6j1t+K50JHwdcFfxrZFywKnAQIdH0NCs8VaW91fQZBupg4OGO&lt;br /&gt;
MpSBnVzoaz2ybI9bQtbZ4GwhCghzKx7Qjz20WiqhfPMfFqAZJwn0WXfjALoioMDW&lt;br /&gt;
avTbx+J2HM8KJ8/YkSSKdDEgZCItg0Q2fC35TDX+aJGu3xNfoaAe3lL1 root@an&lt;br /&gt;
-node04.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;
Various applications will connect to the other node using different methods and networks. Each connection, when first established, will prompt for you to confirm that you trust the authentication, as we saw above. Many programs can&#039;t handle this prompt and will simply fail to connect. So to get around this, I will &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ssh&amp;lt;/span&amp;gt; into both nodes using all hostnames. This will populate a file called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;~/.ssh/known_hosts&amp;lt;/span&amp;gt;. Once you do this on one node, you can simply copy the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;known_hosts&amp;lt;/span&amp;gt; to the other nodes and user&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;~/.ssh/&amp;lt;/span&amp;gt; directories.&lt;br /&gt;
&lt;br /&gt;
I simply paste this into a terminal, answering &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;yes&amp;lt;/span&amp;gt; and then immediately exiting from the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ssh&amp;lt;/span&amp;gt; session. This is a bit tedious, I admit. Take the time to check the fingerprints as they are displayed to you. It is a bad habit to blindly type &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;yes&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Alter this to suit your host names.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ssh root@an-node04 &amp;amp;&amp;amp; \&lt;br /&gt;
ssh root@an-node04.alteeve.com &amp;amp;&amp;amp; \&lt;br /&gt;
ssh root@an-node04.bcn &amp;amp;&amp;amp; \&lt;br /&gt;
ssh root@an-node04.sn &amp;amp;&amp;amp; \&lt;br /&gt;
ssh root@an-node04.ifn &amp;amp;&amp;amp; \&lt;br /&gt;
ssh root@an-node05 &amp;amp;&amp;amp; \&lt;br /&gt;
ssh root@an-node05.alteeve.com &amp;amp;&amp;amp; \&lt;br /&gt;
ssh root@an-node05.bcn &amp;amp;&amp;amp; \&lt;br /&gt;
ssh root@an-node05.sn &amp;amp;&amp;amp; \&lt;br /&gt;
ssh root@an-node05.ifn&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once you&#039;ve done this on one node, you can simply copy the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;~/.ssh/known_hosts&amp;lt;/span&amp;gt; file to the other node. In my case, I ran the above commands on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt;, so I will copy the file to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&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;
rsync -av root@192.168.1.74:/root/.ssh/known_hosts ~/.ssh/&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
receiving file list ... done&lt;br /&gt;
known_hosts&lt;br /&gt;
&lt;br /&gt;
sent 96 bytes  received 2165 bytes  4522.00 bytes/sec&lt;br /&gt;
total size is 7629  speedup is 3.37&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Installing Packages We Will Use ==&lt;br /&gt;
&lt;br /&gt;
There are several packages we will need. They can all be installed in one go with the following command.&lt;br /&gt;
&lt;br /&gt;
If you have a slow or metered Internet connection, you may want to alter &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/yum.conf&amp;lt;/span&amp;gt; and change &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;keepcache=0&amp;lt;/span&amp;gt; to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;keepcache=1&amp;lt;/span&amp;gt; before installing packages. This way, you can then run your updates and installs on one node and then &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rsync&amp;lt;/span&amp;gt; the downloaded files from the first node to the second node. Once done, when you run the updates and installs on that second node, nothing more will be downloaded. To copy the cached [[RPM]]s, simply run &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rsync -av /var/cache/yum root@an-node05:/var/cache/&amp;lt;/span&amp;gt; (assuming you did the initial downloads from &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
{{note|1=If you are using [[RHEL]] 5.x proper, you will need to manually download and install the [[DRBD]] RPMs from [http://www.linbit.com/support/ Linbit].}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install cman openais rgmanager lvm2-cluster gfs2-utils xen xen-libs kmod-xenpv \&lt;br /&gt;
            drbd83 kmod-drbd83-xen virt-manager virt-viewer libvirt libvirt-python \&lt;br /&gt;
            python-virtinst luci ricci ntp bridge-utils system-config-cluster&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will drag in a good number of dependencies, which is fine.&lt;br /&gt;
&lt;br /&gt;
== Keeping Time In Sync ==&lt;br /&gt;
&lt;br /&gt;
It is very important that time on both nodes be kept in sync. The way to do this is to setup [[[NTP]], the network time protocol. I like to use the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;tick.redhat.com&amp;lt;/span&amp;gt; time server, though you are free to substitute your preferred time source.&lt;br /&gt;
&lt;br /&gt;
First, add the timeserver to the NTP configuration file by appending the following lines to the end of 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;
echo server tick.redhat.com$&#039;\n&#039;restrict tick.redhat.com mask 255.255.255.255 nomodify notrap noquery &amp;gt;&amp;gt; /etc/ntp.conf&lt;br /&gt;
tail -n 4 /etc/ntp.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;
# Specify the key identifier to use with the ntpq utility.&lt;br /&gt;
#controlkey 8&lt;br /&gt;
server tick.redhat.com&lt;br /&gt;
restrict tick.redhat.com mask 255.255.255.255 nomodify notrap noquery&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now make sure that the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ntpd&amp;lt;/span&amp;gt; service starts on boot, then start it manually.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
chkconfig ntpd on&lt;br /&gt;
/etc/init.d/ntpd 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 ntpd:                                             [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Altering Boot Up ==&lt;br /&gt;
&lt;br /&gt;
{{note|1=The next two steps are optional.}}&lt;br /&gt;
&lt;br /&gt;
There are two changes I like to make on my nodes. These are not required, but I find it helps to keep things as simple as possible. Particularly in the earlier learning and testing stages.&lt;br /&gt;
&lt;br /&gt;
=== Changing the Default Run-Level ===&lt;br /&gt;
&lt;br /&gt;
If you choose not to implement it, please change any referenced to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/rc3.d&amp;lt;/span&amp;gt; to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/rc5.d&amp;lt;/span&amp;gt; later in this tutorial.&lt;br /&gt;
&lt;br /&gt;
I prefer to minimize the running daemons and apps on my nodes for two reasons; Performance and security. One of the simplest ways to minimize the number of running programs is to change the run-level to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;3&amp;lt;/span&amp;gt; by editing &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/inittab&amp;lt;/span&amp;gt;. This tells the node when it boots not to start the graphical interface and instead simply boot to a &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[bash]]&amp;lt;/span&amp;gt; shell.&lt;br /&gt;
&lt;br /&gt;
This change is actually quite simple. Simple edit &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/inittab&amp;lt;/span&amp;gt; and change the line &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;id:5:initdefault:&amp;lt;/span&amp;gt; to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;id:3:initdefault:&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;
cp /etc/inittab /etc/inittab.orig&lt;br /&gt;
sed -i &#039;s/id:5:initdefault/id:3:initdefault/g&#039; /etc/inittab&lt;br /&gt;
diff -u /etc/inittab.orig /etc/inittab&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;diff&amp;quot;&amp;gt;&lt;br /&gt;
--- /etc/inittab.orig	2011-05-01 20:54:35.000000000 -0400&lt;br /&gt;
+++ /etc/inittab	2011-05-01 20:56:43.000000000 -0400&lt;br /&gt;
@@ -15,7 +15,7 @@&lt;br /&gt;
 #   5 - X11&lt;br /&gt;
 #   6 - reboot (Do NOT set initdefault to this)&lt;br /&gt;
 # &lt;br /&gt;
-id:5:initdefault:&lt;br /&gt;
+id:3:initdefault:&lt;br /&gt;
 &lt;br /&gt;
 # System initialization.&lt;br /&gt;
 si::sysinit:/etc/rc.d/rc.sysinit&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you are still in a graphical environment and want to disable the [[GUI]] without rebooting, you can run &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;init 3&amp;lt;/span&amp;gt;. Conversely, if you want to start the GUI for a certain task, you can do so my running &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;init 5&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Making Boot Messages Visible ===&lt;br /&gt;
&lt;br /&gt;
Another optional step, in-line with the change above, is to disable the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rhgb&amp;lt;/span&amp;gt; (Red Hat Graphical Boot) and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;quiet&amp;lt;/span&amp;gt; kernel arguments. These options provide the clean boot screen you normally see with [[EL5]], but they also hide a lot of boot messages that we may find helpful. &lt;br /&gt;
&lt;br /&gt;
To make this change, edit the [[grub]] boot-loader menu and remove the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rhgb quiet&amp;lt;/span&amp;gt; arguments from the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;kernel /vmlinuz...&amp;lt;/span&amp;gt; line. These arguments are usually the last ones on the line. If you leave this until later you may see two or more kernel entries. Delete these arguments where ever they are found.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /boot/grub/grub.conf /boot/grub/grub.conf.orig&lt;br /&gt;
sed -i &#039;s/root=LABEL=\//root=LABEL=\/ rhgb quiet/g&#039; /boot/grub/grub.conf&lt;br /&gt;
diff -u /boot/grub/grub.conf.orig /boot/grub/grub.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;diff&amp;quot;&amp;gt;&lt;br /&gt;
--- /boot/grub/grub.conf.orig	2011-05-01 21:01:43.000000000 -0400&lt;br /&gt;
+++ /boot/grub/grub.conf	2011-05-01 21:02:44.000000000 -0400&lt;br /&gt;
@@ -14,18 +14,18 @@&lt;br /&gt;
 title CentOS (2.6.18-238.9.1.el5xen)&lt;br /&gt;
 	root (hd0,0)&lt;br /&gt;
 	kernel /xen.gz-2.6.18-238.9.1.el5&lt;br /&gt;
-	module /vmlinuz-2.6.18-238.9.1.el5xen ro root=LABEL=/ rhgb quiet&lt;br /&gt;
+	module /vmlinuz-2.6.18-238.9.1.el5xen ro root=LABEL=/&lt;br /&gt;
 	module /initrd-2.6.18-238.9.1.el5xen.img&lt;br /&gt;
 title CentOS (2.6.18-238.9.1.el5)&lt;br /&gt;
 	root (hd0,0)&lt;br /&gt;
-	kernel /vmlinuz-2.6.18-238.9.1.el5 ro root=LABEL=/ rhgb quiet&lt;br /&gt;
+	kernel /vmlinuz-2.6.18-238.9.1.el5 ro root=LABEL=/&lt;br /&gt;
 	initrd /initrd-2.6.18-238.9.1.el5.img&lt;br /&gt;
 title CentOS (2.6.18-238.el5xen)&lt;br /&gt;
 	root (hd0,0)&lt;br /&gt;
 	kernel /xen.gz-2.6.18-238.el5 &lt;br /&gt;
-	module /vmlinuz-2.6.18-238.el5xen ro root=LABEL=/ rhgb quiet&lt;br /&gt;
+	module /vmlinuz-2.6.18-238.el5xen ro root=LABEL=/&lt;br /&gt;
 	module /initrd-2.6.18-238.el5xen.img&lt;br /&gt;
 title CentOS-base (2.6.18-238.el5)&lt;br /&gt;
 	root (hd0,0)&lt;br /&gt;
-	kernel /vmlinuz-2.6.18-238.el5 ro root=LABEL=/ rhgb quiet&lt;br /&gt;
+	kernel /vmlinuz-2.6.18-238.el5 ro root=LABEL=/&lt;br /&gt;
 	initrd /initrd-2.6.18-238.el5.img&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{note|1=If you&#039;re &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;grub.conf&amp;lt;/span&amp;gt; has been altered or doesn&#039;t have the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;root=LABEL=/&amp;lt;/span&amp;gt; text, you will need to manually add the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rhgb quiet&amp;lt;/span&amp;gt; to the end of the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/vmlinuz&amp;lt;/span&amp;gt; line(s).}}&lt;br /&gt;
&lt;br /&gt;
Now future reboots will show boot details in a terminal display rather than hiding those often-useful messages behind a splash screen.&lt;br /&gt;
&lt;br /&gt;
= Setting Up Xen =&lt;br /&gt;
&lt;br /&gt;
It may seem premature to discuss [[Xen]] before the cluster itself. The reason we need to look at it now, before the cluster, is because Xen makes some fairly significant changes to the networking. Given how changes to networking can effect the cluster, we will want to get these changes out of the way.&lt;br /&gt;
&lt;br /&gt;
We&#039;re not going to provision any virtual machines until the cluster is built.&lt;br /&gt;
&lt;br /&gt;
== A Brief Overview ==&lt;br /&gt;
&lt;br /&gt;
Xen is a [[hypervisor]] the converts the installed operating system into a virtual machine running on a small Xen kernel. This same small kernel also runs all of the virtual machines you will add later. In this way, you will always be working in a virtual machine once you switch to booting a Xen kernel. In Xen terminology, virtual machines are known as &#039;&#039;&#039;domains&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;host&amp;quot; operating system is known as [[dom0]] (domain 0) and has a special view of the hardware plus contains the configuration and control of Xen itself. All other Xen virtual machines are known as [[domU]] (domain U). This is a collective term that represents the transient ID number assigned to all virtual machines. For example, when you boot the first virtual machine, it is known as &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;dom1&amp;lt;/span&amp;gt;. The next will be &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;dom2&amp;lt;/span&amp;gt;, then &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;dom3&amp;lt;/span&amp;gt; and so on. Do note that if a [[domU]] shuts down, it&#039;s ID is &#039;&#039;not&#039;&#039; reused. So when it restarts, it will use the next free ID (ie: &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;dom4&amp;lt;/span&amp;gt; in this list, despite it having been, say, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;dom1&amp;lt;/span&amp;gt; initially).&lt;br /&gt;
&lt;br /&gt;
This makes Xen somewhat unique in the virtualization world. Most others do not touch or alter the &amp;quot;host&amp;quot; OS, instead running the guest VMs fully withing the context of the host operating system.&lt;br /&gt;
&lt;br /&gt;
== Understanding Networking in Xen ==&lt;br /&gt;
&lt;br /&gt;
Xen uses a fairly complex networking system. This is, perhaps, it&#039;s strongest point. The trade off though is that it can be a little tricky to wrap your head around. To help you become familiar, there is a short tutorial dedicated to this topic. Please read it over before proceeding in you are not familiar with Xen&#039;s networking.&lt;br /&gt;
&lt;br /&gt;
Taking the time to read and understand the mini-paper below will save you a lot of heartache in the following stages.&lt;br /&gt;
&lt;br /&gt;
* [[Networking in Xen 3.x]]&lt;br /&gt;
&lt;br /&gt;
Once built, this is what our inter-node network will look like. If you have trouble following this diagram, please do go back and read the link above before proceeding.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
 __________________________________________________________                         _________________________________________________________&lt;br /&gt;
|  ____________________                 an-node04 - (dom0) |                       | (dom0) - an-node05                 ___________________  |&lt;br /&gt;
| | vm0001_ws1   ______|                ________    _______|   _________________   |_______    ________                |______  vm0001_ws1 | |&lt;br /&gt;
| |   (domA)    | eth0 =-[vifA.0]------| xenbr0 |-=| eth0  =--| Internet-Facing |--=  eth0 |=-| xenbr0 |------[vifC.0]-= eth0 |   (domC)   | |&lt;br /&gt;
| |             |_____-|          /----|        |  |______-|  | Switch or VLAN  |  |-______|  |        |----\          |-_____|            | |&lt;br /&gt;
| |                    |          |    |        |          |  |_________________|  |          |        |    |          |                   | |&lt;br /&gt;
| |              ______|          |    |________|          |                       |          |________|    |          |______             | |&lt;br /&gt;
| |             | eth1 =-[vifA.2]-+-\                      |                       |                      /-+-[vivC.2]-= eth1 |            | |&lt;br /&gt;
| | [Active]    |_____-|          | |                      |                       |                      | |          |-_____|   [Backup] | |&lt;br /&gt;
| |____________________|          | |                      |                       |                      | |          |___________________| |&lt;br /&gt;
|                                 | |                      |                       |                      | |                                |&lt;br /&gt;
|  ____________________           | |                      |                       |                      | |           ___________________  |&lt;br /&gt;
| | vm0002_win1  ______|          | |               _______|   _________________   |_______               | |          |______ vm0002_win1 | |&lt;br /&gt;
| |   (domB)    | eth0 =-[vifB.0]-/ |              | eth1  =--|    Storage      |--=  eth1 |              | \-[vifD.0]-= eth0 |   (domD)   | |&lt;br /&gt;
| |             |_____-|            |              |______-|  | Switch or VLAN  |  |-______|              |            |-_____|            | |&lt;br /&gt;
| |                    |            |                      |  |_________________|  |                      |            |                   | |&lt;br /&gt;
| |              ______|            |                      |                       |                      |            |______             | |&lt;br /&gt;
| |             | eth1 =-[vifB.2]-\ |                      |                       |                      | /-[vifD.2]-= eth1 |            | |&lt;br /&gt;
| | [Backup]    |_____-|          | |                      |                       |                      | |          |-_____|   [Active] | |&lt;br /&gt;
| |____________________|          | |                      |                       |                      | |          |___________________| |&lt;br /&gt;
|                                 | |                      |                       |                      | |                                |&lt;br /&gt;
|                                 | |   ________    _______|   _________________   |_______    ________   | |                                |&lt;br /&gt;
|                                 | \--| xenbr2 |-=| eth2  =--|  Back-Channel   |--=  eth2 |=-| xenbr2 |--/ |                                |&lt;br /&gt;
|                                 \----|        |  |______-|  | Switch or VLAN  |  |-______|  |        |----/                                |&lt;br /&gt;
|                                      |        |          |  |_________________|  |          |        |                                     |&lt;br /&gt;
|                                      |________|          |                       |          |________|                                     |&lt;br /&gt;
|                                                          |                       |                                                         |&lt;br /&gt;
|                                                          |                       |                                                         |&lt;br /&gt;
|                                                          |                       |                                                         |&lt;br /&gt;
|                                                          |                       |                                                         |&lt;br /&gt;
|                                                          |                       |                                                         |&lt;br /&gt;
|__________________________________________________________|                       |_________________________________________________________|&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Making Network Interfaces Available To Xen Clients ==&lt;br /&gt;
&lt;br /&gt;
As discussed above, Xen makes some significant changes to the [[dom0]] network, which happens to be where the cluster will operate. These changes including shutting down and moving around the interfaces. As we will discuss later, this behaviour can trigger cluster failures. This is the main reason for dealing with Xen now. Once the changes are in place, the network is stable and safe for running the cluster on.&lt;br /&gt;
&lt;br /&gt;
=== A Brief Overview ===&lt;br /&gt;
&lt;br /&gt;
By default, Xen only makes &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth0&amp;lt;/span&amp;gt; available to the virtual machines. We will want to add &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth2&amp;lt;/span&amp;gt; as well, as we will use the &#039;&#039;Back Channel Network&#039;&#039; for inter-VM communication. We do &#039;&#039;&#039;not&#039;&#039;&#039; want to add the &#039;&#039;Storage Network&#039;&#039; to Xen though! Doing so puts the DRBD link at risk. Should &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xend&amp;lt;/span&amp;gt; get shut down, it could trigger a [[split-brain]] in DRBD.&lt;br /&gt;
&lt;br /&gt;
What Xen does, in brief, is move the &amp;quot;real&amp;quot; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth0&amp;lt;/span&amp;gt; over to a new device called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;peth0&amp;lt;/span&amp;gt;. Then it creates a virtual &amp;quot;clone&amp;quot; of the network interface called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth0&amp;lt;/span&amp;gt;. Next, Xen creates a [[bridge]] called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xenbr0&amp;lt;/span&amp;gt;. Finally, both the real &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;peth0&amp;lt;/span&amp;gt; and the new virtual &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth0&amp;lt;/span&amp;gt; are connected to the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xenbr0&amp;lt;/span&amp;gt; bridge.&lt;br /&gt;
&lt;br /&gt;
The reasoning behind all this is to separate the traffic coming to and from [[dom0]] from any traffic doing to the various [[domU]]s. Think of it sort of like the bridge being a network switch, the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;peth0&amp;lt;/span&amp;gt; being an uplink cable to the outside world and the virtual &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth0&amp;lt;/span&amp;gt; being [[dom0]]&#039;s &amp;quot;port&amp;quot; on the switch. We want the same to be done to the interface on the &#039;&#039;Back-Channel Network&#039;&#039;, too. The &#039;&#039;Storage Network&#039;&#039; will never be exposed to the [[domU]] machines, so combining the risk to the underlying storage, there is no reason to add &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth1&amp;lt;/span&amp;gt; to Xen&#039;s control.&lt;br /&gt;
&lt;br /&gt;
=== Disable the &#039;qemu&#039; Bridge ===&lt;br /&gt;
&lt;br /&gt;
By default, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[libvirtd]]&amp;lt;/span&amp;gt; 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. &lt;br /&gt;
&lt;br /&gt;
So to remove this bridge, simply delete the contents of the file, stop the bridge, delete the bridge and then stop &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;iptables&amp;lt;/span&amp;gt; to make sure any rules created for the bridge are flushed.&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;
ifconfig virbr0 down&lt;br /&gt;
brctl delbr virbr0&lt;br /&gt;
/etc/init.d/iptables stop&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Setting Up Bridges ===&lt;br /&gt;
&lt;br /&gt;
By default, Xen creates the bridges it will need when it starts. This works fine with basic configuration, but is no longer recommended.&lt;br /&gt;
&lt;br /&gt;
Bridges are very much like software network switches. Interfaces can be connected to them and then use them to pass data back and forth. As virtual machines are created, they will have a special &amp;quot;virtual&amp;quot; interface created. These &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vifX.Y&amp;lt;/span&amp;gt; devices are very much like a network cable between a normal server and a switch. In Xen, the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;X&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Y&amp;lt;/span&amp;gt; in the name &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vifX.Y&amp;lt;/span&amp;gt; corresponds to the domain ID, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;X&amp;lt;/span&amp;gt; and the bridge ID &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Y&amp;lt;/span&amp;gt;. For example, if you create a [[domU]] which is given the ID of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;5&amp;lt;/span&amp;gt; and you are connecting two interfaces within domU to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xenbr0&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xenbr2&amp;lt;/span&amp;gt;, you will see two virtual interfaces created, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vif5.0&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vif5.2&amp;lt;/span&amp;gt;, which connect the domU&#039;s &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;eth1&amp;lt;/span&amp;gt; to the bridges, respectively.&lt;br /&gt;
&lt;br /&gt;
If you found the above confusing, please take a look at the article below:&lt;br /&gt;
&lt;br /&gt;
* [[Networking in Xen 3.x]]&lt;br /&gt;
&lt;br /&gt;
We will now create bridges in each node for the &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; interfaces. We aren&#039;t bothering with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth1&amp;lt;/span&amp;gt; as it will only be used for storage traffic and thus will never need to be seen or used by any domU. To create the bridges, we need to do two things;&lt;br /&gt;
* Create the bridge configuration files; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/sysconfig/network-scripts/ifcfg-xenbr0&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/sysconfig/network-scripts/ifcfg-xenbr2&amp;lt;/span&amp;gt;&lt;br /&gt;
* Change the interface configuration files and connect the interfaces to the bridge.&lt;br /&gt;
&lt;br /&gt;
Note that when we create the bridge scripts, we will move the IP address information from the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ethX&amp;lt;/span&amp;gt; device to the corresponding &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xenbrX&amp;lt;/span&amp;gt; configuration file. This means that, after this change, you will see the IP address on the bridge, &#039;&#039;not&#039;&#039; the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ethX&amp;lt;/span&amp;gt; device. This is normal.&lt;br /&gt;
&lt;br /&gt;
{{note|1=It is not necessary to stop the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;network&amp;lt;/span&amp;gt; daemon before making these changes. Once you&#039;ve begun the edits though, do be careful though not to restart networking until you are complete. These changes will somewhat dramatically alter your network configuration. If you leave the network up, be aware that when you do restart the network, you will see a warning like: &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Shutting down interface eth0:  bridge xenbr0 does not exist!&amp;lt;/span&amp;gt;. This is ok.}}&lt;br /&gt;
&lt;br /&gt;
First, create the two bridge configuration files.&lt;br /&gt;
&lt;br /&gt;
For &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xenbr0&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/sysconfig/network-scripts/ifcfg-xenbr0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
# Bridge created for Xen&lt;br /&gt;
DEVICE=xenbr0&lt;br /&gt;
TYPE=Bridge&lt;br /&gt;
BOOTPROTO=static&lt;br /&gt;
IPADDR=192.168.1.74&lt;br /&gt;
NETMASK=255.255.255.0&lt;br /&gt;
GATEWAY=192.168.1.254&lt;br /&gt;
DNS1=192.139.81.117&lt;br /&gt;
DNS2=192.139.81.1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xenbr2&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/sysconfig/network-scripts/ifcfg-xenbr2&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
# Bridge created for Xen&lt;br /&gt;
DEVICE=xenbr2&lt;br /&gt;
TYPE=Bridge&lt;br /&gt;
BOOTPROTO=static&lt;br /&gt;
IPADDR=192.168.3.74&lt;br /&gt;
NETMASK=255.255.255.0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Next, edit the corresponding &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ethX&amp;lt;/span&amp;gt; devices. This will involve adding a &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;BRIDGE=xenbrX&amp;lt;/span&amp;gt; line and removing all of the IP address information. Below are the updated &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; devices after the changes have been made with a &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;diff&amp;lt;/span&amp;gt; showing exactly how the files changed.&lt;br /&gt;
&lt;br /&gt;
For &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth0&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;
cp /etc/sysconfig/network-scripts/ifcfg-eth0 /etc/sysconfig/network-scripts/ifcfg-eth0.orig&lt;br /&gt;
vim /etc/sysconfig/network-scripts/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;
# Realtek Semiconductor Co., Ltd. RTL8111/8168B PCI Express Gigabit Ethernet controller&lt;br /&gt;
HWADDR=48:5B:39:3C:53:14&lt;br /&gt;
DEVICE=eth0&lt;br /&gt;
BRIDGE=xenbr0&lt;br /&gt;
BOOTPROTO=static&lt;br /&gt;
ONBOOT=yes&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;
diff -u /etc/sysconfig/network-scripts/ifcfg-eth0.orig /etc/sysconfig/network-scripts/ifcfg-eth0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;diff&amp;quot;&amp;gt;&lt;br /&gt;
--- /etc/sysconfig/network-scripts/ifcfg-eth0.orig	2011-05-02 15:05:56.000000000 -0400&lt;br /&gt;
+++ /etc/sysconfig/network-scripts/ifcfg-eth0	2011-05-02 15:01:34.000000000 -0400&lt;br /&gt;
@@ -1,10 +1,6 @@&lt;br /&gt;
 # Realtek Semiconductor Co., Ltd. RTL8111/8168B PCI Express Gigabit Ethernet controller&lt;br /&gt;
 HWADDR=48:5B:39:3C:53:14&lt;br /&gt;
 DEVICE=eth0&lt;br /&gt;
+BRIDGE=xenbr0&lt;br /&gt;
 BOOTPROTO=static&lt;br /&gt;
 ONBOOT=yes&lt;br /&gt;
-IPADDR=192.168.1.74&lt;br /&gt;
-NETMASK=255.255.255.0&lt;br /&gt;
-GATEWAY=192.168.1.254&lt;br /&gt;
-DNS1=192.139.81.117&lt;br /&gt;
-DNS2=192.139.81.1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth2&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;
cp /etc/sysconfig/network-scripts/ifcfg-eth2 /etc/sysconfig/network-scripts/ifcfg-eth2.orig&lt;br /&gt;
vim /etc/sysconfig/network-scripts/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 82574L Gigabit Network Connection&lt;br /&gt;
HWADDR=00:1B:21:72:96:EA&lt;br /&gt;
DEVICE=eth2&lt;br /&gt;
BRIDGE=xenbr2&lt;br /&gt;
BOOTPROTO=static&lt;br /&gt;
ONBOOT=yes&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;
diff -u /etc/sysconfig/network-scripts/ifcfg-eth2.orig /etc/sysconfig/network-scripts/ifcfg-eth2&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;diff&amp;quot;&amp;gt;&lt;br /&gt;
--- /etc/sysconfig/network-scripts/ifcfg-eth2.orig	2011-05-02 15:08:36.000000000 -0400&lt;br /&gt;
+++ /etc/sysconfig/network-scripts/ifcfg-eth2	2011-05-02 15:08:20.000000000 -0400&lt;br /&gt;
@@ -1,7 +1,6 @@&lt;br /&gt;
 # Intel Corporation 82574L Gigabit Network Connection&lt;br /&gt;
 HWADDR=00:1B:21:72:96:EA&lt;br /&gt;
 DEVICE=eth2&lt;br /&gt;
+BRIDGE=xenbr2&lt;br /&gt;
 BOOTPROTO=static&lt;br /&gt;
 ONBOOT=yes&lt;br /&gt;
-IPADDR=192.168.3.74&lt;br /&gt;
-NETMASK=255.255.255.0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now restart the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;network&amp;lt;/span&amp;gt; daemon. As noted, do not be concerned about the shutdown warnings, they should appear only once.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/network 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;
Shutting down interface eth0:  bridge xenbr0 does not exist!&lt;br /&gt;
                                                           [  OK  ]&lt;br /&gt;
Shutting down interface eth1:                              [  OK  ]&lt;br /&gt;
Shutting down interface eth2:  bridge xenbr2 does not exist!&lt;br /&gt;
                                                           [  OK  ]&lt;br /&gt;
Shutting down loopback interface:                          [  OK  ]&lt;br /&gt;
Bringing up loopback interface:                            [  OK  ]&lt;br /&gt;
Bringing up interface eth0:                                [  OK  ]&lt;br /&gt;
Bringing up interface eth1:                                [  OK  ]&lt;br /&gt;
Bringing up interface eth2:                                [  OK  ]&lt;br /&gt;
Bringing up interface xenbr0:                              [  OK  ]&lt;br /&gt;
Bringing up interface xenbr2:                              [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can check that the bridges are up and that the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ethX&amp;lt;/span&amp;gt; interfaces are connected to them using the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;brctl&amp;lt;/span&amp;gt; tool.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
brctl show&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
bridge name	bridge id		STP enabled	interfaces&lt;br /&gt;
virbr0		8000.000000000000	yes		&lt;br /&gt;
xenbr0		8000.485b393c5314	no		eth0&lt;br /&gt;
xenbr2		8000.001b217296ea	no		eth2&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We&#039;ll see this reflected in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;iptables&amp;lt;/span&amp;gt; output as well.&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;
          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:276 errors:0 dropped:0 overruns:0 frame:0&lt;br /&gt;
          TX packets:168 errors:0 dropped:0 overruns:0 carrier:0&lt;br /&gt;
          collisions:0 txqueuelen:1000 &lt;br /&gt;
          RX bytes:47553 (46.4 KiB)  TX bytes:25555 (24.9 KiB)&lt;br /&gt;
          Interrupt:246 Base address:0xe000 &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:123 errors:0 dropped:0 overruns:0 frame:0&lt;br /&gt;
          TX packets:55 errors:0 dropped:0 overruns:0 carrier:0&lt;br /&gt;
          collisions:0 txqueuelen:1000 &lt;br /&gt;
          RX bytes:25758 (25.1 KiB)  TX bytes:9364 (9.1 KiB)&lt;br /&gt;
          Interrupt:17 Memory:feae0000-feb00000 &lt;br /&gt;
&lt;br /&gt;
eth2      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 MULTICAST  MTU:1500  Metric:1&lt;br /&gt;
          RX packets:161 errors:0 dropped:0 overruns:0 frame:0&lt;br /&gt;
          TX packets:69 errors:0 dropped:0 overruns:0 carrier:0&lt;br /&gt;
          collisions:0 txqueuelen:1000 &lt;br /&gt;
          RX bytes:31049 (30.3 KiB)  TX bytes:13329 (13.0 KiB)&lt;br /&gt;
          Interrupt:16 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:8 errors:0 dropped:0 overruns:0 frame:0&lt;br /&gt;
          TX packets:8 errors:0 dropped:0 overruns:0 carrier:0&lt;br /&gt;
          collisions:0 txqueuelen:0 &lt;br /&gt;
          RX bytes:560 (560.0 b)  TX bytes:560 (560.0 b)&lt;br /&gt;
&lt;br /&gt;
xenbr0    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:252 errors:0 dropped:0 overruns:0 frame:0&lt;br /&gt;
          TX packets:153 errors:0 dropped:0 overruns:0 carrier:0&lt;br /&gt;
          collisions:0 txqueuelen:0 &lt;br /&gt;
          RX bytes:41073 (40.1 KiB)  TX bytes:21327 (20.8 KiB)&lt;br /&gt;
&lt;br /&gt;
xenbr2    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:138 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:25913 (25.3 KiB)  TX bytes:9396 (9.1 KiB)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now let&#039;s move on to the main Xen configuration file!&lt;br /&gt;
&lt;br /&gt;
=== Editing the /etc/xen/xend-config.sxp Configuration File ===&lt;br /&gt;
&lt;br /&gt;
We need to do two things here:&lt;br /&gt;
* Tell Xen to enable it&#039;s unix socket so that external tools can manage it (if needed).&lt;br /&gt;
* Tell Xen to not handle bridge configuration.&lt;br /&gt;
* Enable Live Migration of VMs between nodes.&lt;br /&gt;
&lt;br /&gt;
Begin editing the Xen configuration file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/xen/xend-config.sxp /etc/xen/xend-config.sxp.orig&lt;br /&gt;
vim /etc/xen/xend-config.sxp&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{note|1=It would see that, by default, Xen now enables it&#039;s unix socket. As such, this step may not be needed.}}&lt;br /&gt;
&lt;br /&gt;
Configure Xen to enable it&#039;s unix socket. This is how tools like &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virsh&amp;lt;/span&amp;gt;, which we will look at later, interact with Xen. To do this, change &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xend-unix-server&amp;lt;/span&amp;gt;, which is around line &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;19&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;
(xend-unix-server yes)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Edit the &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 &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/bin/true&amp;lt;/span&amp;gt;. This let&#039;s the script succeed without actually doing anything. We want this behavious because we created the bridges ourselves outside of Xen.&lt;br /&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;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To enable live migration, we need to edit four values. Let&#039;s look at the new values, then we&#039;ll discuss what they effect and how their syntax works.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
(xend-relocation-server yes)&lt;br /&gt;
(xend-relocation-port 8002)&lt;br /&gt;
(xend-relocation-address &#039;an-node04.bcn&#039;)&lt;br /&gt;
(xend-relocation-hosts-allow &#039;&#039;)&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;xend-unix-server&amp;lt;/span&amp;gt;; When set to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;yes&amp;lt;/span&amp;gt;, this tells Xen to enable it&#039;s unix socket. This is needed by management tools like &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[virsh]]&amp;lt;/span&amp;gt;.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xend-relocation-server&amp;lt;/span&amp;gt;; When set to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;yes&amp;lt;/span&amp;gt;, this tells Xen to allow the migration of [[VM]]s.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xend-relocation-port&amp;lt;/span&amp;gt;; This controls what [[TCP]] port that Xen listens for migration requests.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xend-relocation-address&amp;lt;/span&amp;gt;; This is an IP address or resolvable name that must match an IP address of an interface on the local machine. This binds Xen&#039;s migration to the given interface. If set to just &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;amp;#39;&amp;amp;#39;&amp;lt;/span&amp;gt;, Xen will listen for connections on all interfaces.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xend-relocation-hosts-allow&amp;lt;/span&amp;gt;; This is a space-separated list of host names, IP addresses and regular expressions of hosts that are allowed to be migration sources and targets. Some examples are; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04 an-node05 ^192\.168\.*$&amp;lt;/span&amp;gt;. If set to just &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;amp;#39;&amp;amp;#39;&amp;lt;/span&amp;gt;, Xen will allow migration to or from all nodes on the network. As we&#039;ve already restricted migrate to the &#039;&#039;&#039;BCN&#039;&#039;&#039; by way of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xend-relocation-address &#039;an-node04.bcn&#039;&amp;lt;/span&amp;gt;, it&#039;s save to leave this open to any host.&lt;br /&gt;
&lt;br /&gt;
{{note|1=Be sure that you set &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xend-relocation-address&amp;lt;/span&amp;gt; is set uniquely for each node.}}&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;diff&amp;lt;/span&amp;gt; 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;
diff -u /etc/xen/xend-config.sxp.orig /etc/xen/xend-config.sxp&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;diff&amp;quot;&amp;gt;&lt;br /&gt;
--- /etc/xen/xend-config.sxp.orig	2011-05-02 15:52:27.000000000 -0400&lt;br /&gt;
+++ /etc/xen/xend-config.sxp	2011-05-02 16:01:33.000000000 -0400&lt;br /&gt;
@@ -19,6 +19,7 @@&lt;br /&gt;
 #(xend-tcp-xmlrpc-server no)&lt;br /&gt;
 #(xend-unix-xmlrpc-server yes)&lt;br /&gt;
 #(xend-relocation-server no)&lt;br /&gt;
+(xend-relocation-server yes)&lt;br /&gt;
 # The relocation server should be kept desactivated unless using a trusted&lt;br /&gt;
 # network, the domain virtual memory will be exchanged in raw form without&lt;br /&gt;
 # encryption of the communication. See also xend-relocation-hosts-allow option&lt;br /&gt;
@@ -31,6 +32,7 @@&lt;br /&gt;
 # Port xend should use for the relocation interface, if xend-relocation-server&lt;br /&gt;
 # is set.&lt;br /&gt;
 #(xend-relocation-port 8002)&lt;br /&gt;
+(xend-relocation-port 8002)&lt;br /&gt;
 &lt;br /&gt;
 # Address xend should listen on for HTTP connections, if xend-http-server is&lt;br /&gt;
 # set.&lt;br /&gt;
@@ -45,6 +47,7 @@&lt;br /&gt;
 # Also, interface name is allowed (e.g. eth0) there to get the&lt;br /&gt;
 # relocation address to be bound on.&lt;br /&gt;
 #(xend-relocation-address &#039;&#039;)&lt;br /&gt;
+(xend-relocation-address &#039;an-node04.bcn&#039;)&lt;br /&gt;
 &lt;br /&gt;
 # The hosts allowed to talk to the relocation port.  If this is empty (the&lt;br /&gt;
 # default), then all connections are allowed (assuming that the connection&lt;br /&gt;
@@ -57,8 +60,8 @@&lt;br /&gt;
 # For example:&lt;br /&gt;
 #  (xend-relocation-hosts-allow &#039;^localhost$ ^.*\.example\.org$&#039;)&lt;br /&gt;
 #&lt;br /&gt;
-#(xend-relocation-hosts-allow &#039;&#039;)&lt;br /&gt;
-(xend-relocation-hosts-allow &#039;^localhost$ ^localhost\\.localdomain$&#039;)&lt;br /&gt;
+(xend-relocation-hosts-allow &#039;&#039;)&lt;br /&gt;
+#(xend-relocation-hosts-allow &#039;^localhost$ ^localhost\\.localdomain$&#039;)&lt;br /&gt;
 &lt;br /&gt;
 # The limit (in kilobytes) on the size of the console buffer&lt;br /&gt;
 #(console-limit 1024)&lt;br /&gt;
@@ -90,7 +93,8 @@&lt;br /&gt;
 # two fake interfaces per guest domain.  To do things like this, write&lt;br /&gt;
 # yourself a wrapper script, and call network-bridge from it, as appropriate.&lt;br /&gt;
 #&lt;br /&gt;
-(network-script network-bridge)&lt;br /&gt;
+#(network-script network-bridge)&lt;br /&gt;
+(network-script /bin/true)&lt;br /&gt;
 &lt;br /&gt;
 # The script used to control virtual interfaces.  This can be overridden on a&lt;br /&gt;
 # per-vif basis when creating a domain or a configuring a new vif.  The&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Make the changes take effect by (re)starting &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;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
restart xend:                                              [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Cluster Setup =&lt;br /&gt;
&lt;br /&gt;
In [[Red Hat]] Cluster Services, the heart of the cluster is found in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[RHCS v2 cluster.conf|/etc/cluster/cluster.conf]]&amp;lt;/span&amp;gt; [[XML]] configuration file.&lt;br /&gt;
&lt;br /&gt;
There are three main ways of editing this file. Two are already well documented, so I won&#039;t bother discussing them, beyond introducing them. The third way is by directly hand-crafting the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cluster.conf&amp;lt;/span&amp;gt; file. This method is not very well documented, and directly manipulating configuration files is my preferred method. As my boss loves to say; &amp;quot;&#039;&#039;The more computers do for you, the more they do to you&#039;&#039;&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
The first two, well documented, graphical tools are:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[http://docs.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/5/html/Cluster_Administration/ch-config-scc-CA.html system-config-cluster]&amp;lt;/span&amp;gt;, older GUI tool run directly from one of the cluster nodes.&lt;br /&gt;
* [http://docs.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/5/html/Cluster_Administration/ch-config-conga-CA.html Conga], comprised of the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ricci&amp;lt;/span&amp;gt; node-side client and the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;luci&amp;lt;/span&amp;gt; web-based server (can be run on machines outside the cluster).&lt;br /&gt;
&lt;br /&gt;
I do like the tools above, but I often find issues that send me back to the command line. I&#039;d recommend setting them aside for now as well. Once you feel comfortable with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cluster.conf&amp;lt;/span&amp;gt; syntax, then by all means, go back and use them. I&#039;d recommend not relying on them though, which might be the case if you try to use them too early in your studies.&lt;br /&gt;
&lt;br /&gt;
== The First cluster.conf Foundation Configuration ==&lt;br /&gt;
&lt;br /&gt;
The very first stage of building the cluster is to create a configuration file that is as minimal as possible. To do that, we need to define a few thing;&lt;br /&gt;
&lt;br /&gt;
* The name of the cluster and the cluster file version.&lt;br /&gt;
** Define &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt; options&lt;br /&gt;
** The nodes in the cluster&lt;br /&gt;
*** The fence method for each node&lt;br /&gt;
** Define fence devices&lt;br /&gt;
** Define &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fenced&amp;lt;/span&amp;gt; options&lt;br /&gt;
&lt;br /&gt;
That&#039;s it. Once we&#039;ve defined this minimal amount, we will be able to start the cluster for the first time! So lets get to it, finally.&lt;br /&gt;
&lt;br /&gt;
=== Name the Cluster and Set The Configuration Version ===&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[RHCS_v2_cluster.conf#cluster.3B_The_Parent_Tag|cluster]]&amp;lt;/span&amp;gt; tag is the parent tag for the entire cluster configuration file.&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-cluster01&amp;quot; config_version=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/cluster&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This has two attributes that we need to set are &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;name=&amp;quot;&amp;quot;&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;config_version=&amp;quot;&amp;quot;&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[RHCS v2 cluster.conf#name|name]]=&amp;quot;&amp;quot;&amp;lt;/span&amp;gt; attribute defines the name of the cluster. It must be unique amongst the clusters on your network. It should be descriptive, but you will not want to make it too long, either. You will see this name in the various cluster tools and you will enter in, for example, when creating a [[GFS2]] partition later on. This tutorial uses the cluster name &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an_cluster&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[RHCS v2 cluster.conf#config_version|config_version]]=&amp;quot;&amp;quot;&amp;lt;/span&amp;gt; attribute is an integer marking the version of the configuration file. Whenever you make a change to the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cluster.conf&amp;lt;/span&amp;gt; file, you will need to increment this version number by 1. If you don&#039;t increment this number, then the cluster tools will not know that the file needs to be reloaded. As this is the first version of this configuration file, it will start with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt;. Note that this tutorial will increment the version after every change, regardless of whether it is explicitly pushed out to the other nodes and reloaded. The reason is to help get into the habit of always increasing this value.&lt;br /&gt;
&lt;br /&gt;
=== Configuring cman Options ===&lt;br /&gt;
&lt;br /&gt;
We are going to setup a special case for our cluster; A 2-Node cluster.&lt;br /&gt;
&lt;br /&gt;
This is a special case because traditional quorum will not be useful. With only two nodes, each having a vote of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt;, the total votes is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;2&amp;lt;/span&amp;gt;. Quorum needs &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;50% + 1&amp;lt;/span&amp;gt;, which means that a single node failure would shut down the cluster, as the remaining node&#039;s vote is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;50%&amp;lt;/span&amp;gt; exactly. That kind of defeats the purpose to having a cluster at all.&lt;br /&gt;
&lt;br /&gt;
So to account for this special case, there is a special attribute called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[RHCS_v2_cluster.conf#two_node|two_node]]=&amp;quot;1&amp;quot;&amp;lt;/span&amp;gt;. This tells the cluster manager to continue operating with only one vote. This option requires that the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[RHCS_v2_cluster.conf#expected_votes|expected_votes]]=&amp;quot;&amp;quot;&amp;lt;/span&amp;gt; attribute be set to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt;. Normally, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;expected_votes&amp;lt;/span&amp;gt; is set automatically to the total sum of the defined cluster nodes&#039; votes (which itself is a default of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt;). This is the other half of the &amp;quot;trick&amp;quot;, as a single node&#039;s vote of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt; now always provides quorum (that is, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt; meets the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;50% + 1&amp;lt;/span&amp;gt; requirement).&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-cluster01&amp;quot; config_version=&amp;quot;2&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;cman expected_votes=&amp;quot;1&amp;quot; two_node=&amp;quot;1&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/cluster&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Take note of the self-closing &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;... /&amp;gt;&amp;lt;/span&amp;gt; tag. This is an [[XML]] syntax that tells the parser not to look for any child or a closing tags.&lt;br /&gt;
&lt;br /&gt;
=== Defining Cluster Nodes ===&lt;br /&gt;
&lt;br /&gt;
This example is a little artificial, please don&#039;t load it into your cluster as we will need to add a few child tags, but one thing at a time.&lt;br /&gt;
&lt;br /&gt;
This actually introduces two tags.&lt;br /&gt;
&lt;br /&gt;
The first is parent &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[RHCS_v2_cluster.conf#clusternodes.3B_Defining_Cluster_Nodes|clusternodes]]&amp;lt;/span&amp;gt; tag, which takes no variables of it&#039;s own. It&#039;s sole purpose is to contain the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[RHCS_v2_cluster.conf#Tag.3B_clusternode|clusternode]]&amp;lt;/span&amp;gt; child tags. &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-cluster01&amp;quot; config_version=&amp;quot;3&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;cman expected_votes=&amp;quot;1&amp;quot; two_node=&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-node04.alteeve.com&amp;quot; nodeid=&amp;quot;1&amp;quot; /&amp;gt;&lt;br /&gt;
		&amp;lt;clusternode name=&amp;quot;an-node05.alteeve.com&amp;quot; nodeid=&amp;quot;2&amp;quot; /&amp;gt;&lt;br /&gt;
	&amp;lt;/clusternodes&amp;gt;&lt;br /&gt;
&amp;lt;/cluster&amp;gt;&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;[[RHCS_v2_cluster.conf#Tag.3B_clusternode|clusternode]]&amp;lt;/span&amp;gt; tag defines each cluster node. There are many attributes available, but we will look at just the two required ones. &lt;br /&gt;
&lt;br /&gt;
The first is the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[RHCS_v2_cluster.conf#clusternode.27s_name_attribute|name]]=&amp;quot;&amp;quot;&amp;lt;/span&amp;gt; attribute. This &#039;&#039;&#039;should&#039;&#039;&#039; match the name given by &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;uname -n&amp;lt;/span&amp;gt; (&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;$HOSTNAME&amp;lt;/span&amp;gt;) when run on each node. The [[IP]] address that the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;name&amp;lt;/span&amp;gt; resolves to also sets the interface and subnet that the [[totem]] ring will run on. That is, the main cluster communications, which we are calling the &#039;&#039;&#039;Back-Channel Network&#039;&#039;&#039;. This is why it is so important to setup our &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[Red_Hat_Cluster_Service_2_Tutorial#Setup_.2Fetc.2Fhosts|/etc/hosts]]&amp;lt;/span&amp;gt; file correctly. Please see the [[RHCS_v2_cluster.conf#clusternode.27s_name_attribute|clusternode&#039;s name]] attribute document for details on how name to interface mapping is resolved.&lt;br /&gt;
&lt;br /&gt;
The second attribute is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[RHCS_v2_cluster.conf#clusternode.27s_nodeid_attribute|nodeid]]=&amp;quot;&amp;quot;&amp;lt;/span&amp;gt;. This must be a unique integer amongst the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;clusternode ...&amp;gt;&amp;lt;/span&amp;gt; tags. It is used by the cluster to identify the node.&lt;br /&gt;
&lt;br /&gt;
=== Defining Fence Devices ===&lt;br /&gt;
&lt;br /&gt;
[[Red_Hat_Cluster_Service_2_Tutorial#Concept.3B_Fencing|Fencing]] devices are designed to forcible eject a node from a cluster. This is done by forcing it to power off or reboot, generally. Some [[SAN]] switches can logically disconnect a node from the shared storage device, which has the same effect of guaranteeing that the defective node can not alter the shared storage. A common, third type of fence device is one that cuts the mains power to the server.&lt;br /&gt;
&lt;br /&gt;
All fence devices are contained withing the parent &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[RHCS_v2_cluster.conf#fencedevices.3B_Defining_Fence_Devices|fencedevices]]&amp;lt;/span&amp;gt; tag. This parent tag has no attributes. Within this parent tag are one or more &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[RHCS_v2_cluster.conf#Tag.3B_fencedevice|fencedevice]]&amp;lt;/span&amp;gt; child tags.&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-cluster01&amp;quot; config_version=&amp;quot;4&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;cman expected_votes=&amp;quot;1&amp;quot; two_node=&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-node04.alteeve.com&amp;quot; nodeid=&amp;quot;1&amp;quot; /&amp;gt;&lt;br /&gt;
		&amp;lt;clusternode name=&amp;quot;an-node05.alteeve.com&amp;quot; nodeid=&amp;quot;2&amp;quot; /&amp;gt;&lt;br /&gt;
	&amp;lt;/clusternodes&amp;gt;&lt;br /&gt;
	&amp;lt;fencedevices&amp;gt;&lt;br /&gt;
		&amp;lt;fencedevice agent=&amp;quot;fence_na&amp;quot; ipaddr=&amp;quot;fence_na01.alteeve.com&amp;quot; login=&amp;quot;admin&amp;quot; name=&amp;quot;fence_na01&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;
Every fence device used in your cluster will have it&#039;s own &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[RHCS_v2_cluster.conf#Tag.3B_fencedevice|fencedevice]]&amp;lt;/span&amp;gt; tag. If you are using [[IPMI]], this means you will have a &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fencedevice&amp;lt;/span&amp;gt; entry for each node, as each physical IPMI [[BMC]] is a unique fence device.&lt;br /&gt;
&lt;br /&gt;
All &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fencedevice&amp;lt;/span&amp;gt; tags share two basic attributes; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[RHCS_v2_cluster.conf#fencedevice.27s_name_attribute|name]]=&amp;quot;&amp;quot;&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[RHCS_v2_cluster.conf#fencedevice.27s_agent_attribute|agent]]=&amp;quot;&amp;quot;&amp;lt;/span&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
* The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;name&amp;lt;/span&amp;gt; attribute must be unique among all the fence devices in your cluster. As we will see in the next step, this name will be used within the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;clusternode...&amp;gt;&amp;lt;/span&amp;gt; tag. &lt;br /&gt;
* The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;agent&amp;lt;/span&amp;gt; tag tells the cluster which [[fence agent]] to use when the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[fenced]]&amp;lt;/span&amp;gt; daemon needs to communicate with the physical fence device. A fence agent is simple a shell script that acts as a glue layer between the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fenced&amp;lt;/span&amp;gt; daemon and the fence hardware. This agent takes the arguments from the daemon, like what port to act on and what action to take, and executes the node. The agent is responsible for ensuring that the execution succeeded and returning an appropriate success or failure exit code, depending. For those curious, the full details are described in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[http://sources.redhat.com/cluster/wiki/FenceAgentAPI FenceAgentAPI]&amp;lt;/span&amp;gt;. If you have two or more of the same fence device, like IPMI, then you will use the same fence &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;agent&amp;lt;/span&amp;gt; value a corresponding number of times.&lt;br /&gt;
&lt;br /&gt;
Beyond these two attributes, each fence agent will have it&#039;s own subset of attributes. The scope of which is outside this tutorial, though we will see examples for IPMI, a switched PDU and a [[Node Assassin]]. Most, if not all, fence agents have a corresponding man page that will show you what attributes it accepts and how they are used. The two fence agents we will see here have their attributes defines in the following &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[man]]&amp;lt;/span&amp;gt; pages.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;man fence_na&amp;lt;/span&amp;gt; - Node Assassin fence agent&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;man fence_ipmilan&amp;lt;/span&amp;gt; - IPMI fence agent&lt;br /&gt;
&lt;br /&gt;
The example above is what this tutorial will use.&lt;br /&gt;
&lt;br /&gt;
==== Example &amp;lt;fencedevice...&amp;gt; Tag For Node Assassin ====&lt;br /&gt;
&lt;br /&gt;
This is the device used throughout this tutorial. It is for the open source, open hardware [[Node Assassin]] fence device that you can build yourself.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;fencedevices&amp;gt;&lt;br /&gt;
		&amp;lt;fencedevice agent=&amp;quot;fence_na&amp;quot; ipaddr=&amp;quot;fence_na01.alteeve.com&amp;quot; login=&amp;quot;admin&amp;quot; name=&amp;quot;fence_na01&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;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Being a network-attached fence device, as most fence devices are, the attributes for &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fence_na&amp;lt;/span&amp;gt; include connection information. The attribute variable names are generally the same across fence agents, and they are:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ipaddr&amp;lt;/span&amp;gt;; This is the resolvable name or [[IP]] address of the device. If you use a resolvable name, it is strongly advised that you put the name in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/hosts&amp;lt;/span&amp;gt; as [[DNS]] is another layer of abstraction which could fail.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;login&amp;lt;/span&amp;gt;; This is the login name to use when the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fenced&amp;lt;/span&amp;gt; daemon connects to the device. This is configured in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/cluster/fence_na.conf&amp;lt;/span&amp;gt;.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;passwd&amp;lt;/span&amp;gt;; This is the login password to use when the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fenced&amp;lt;/span&amp;gt; daemon connects to the device. This is also configured in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/cluster/fence_na.conf&amp;lt;/span&amp;gt;.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;name&amp;lt;/span&amp;gt;; This is the name of this particular fence device within the cluster which, as we will see shortly, is matched in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;clusternode...&amp;gt;&amp;lt;/span&amp;gt; element where appropriate.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;quiet&amp;lt;/span&amp;gt;; This is a Node Assassin specific argument. It is used to generate no output to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[STDOUT]]&amp;lt;/span&amp;gt; when run, as there is no terminal to print to or user to view it.&lt;br /&gt;
&lt;br /&gt;
==== Example &amp;lt;fencedevice...&amp;gt; Tag For IPMI ====&lt;br /&gt;
&lt;br /&gt;
Here we will show what [[IPMI]] &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;fencedevice...&amp;gt;&amp;lt;/span&amp;gt; tags look like. We won&#039;t be using it ourselves, but it is quite popular as a fence device so I wanted to show an example of it&#039;s use.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;fencedevices&amp;gt;&lt;br /&gt;
		&amp;lt;fencedevice name=&amp;quot;an01_ipmi&amp;quot; agent=&amp;quot;fence_ipmilan&amp;quot; ipaddr=&amp;quot;192.168.4.74&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;an02_ipmi&amp;quot; agent=&amp;quot;fence_ipmilan&amp;quot; ipaddr=&amp;quot;192.168.4.75&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;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ipaddr&amp;lt;/span&amp;gt;; This is the resolvable name or [[IP]] address of the device. If you use a resolvable name, it is strongly advised that you put the name in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/hosts&amp;lt;/span&amp;gt; as [[DNS]] is another layer of abstraction which could fail.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;login&amp;lt;/span&amp;gt;; This is the login name to use when the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fenced&amp;lt;/span&amp;gt; daemon connects to the device.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;passwd&amp;lt;/span&amp;gt;; This is the login password to use when the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fenced&amp;lt;/span&amp;gt; daemon connects to the device.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;name&amp;lt;/span&amp;gt;; This is the name of this particular fence device within the cluster which, as we will see shortly, is matched in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;clusternode...&amp;gt;&amp;lt;/span&amp;gt; element where appropriate.&lt;br /&gt;
&lt;br /&gt;
{{note|1=We will see shortly that, unlike switched PDUs, Node Assassin or other network fence devices, [[IPMI]] does not have ports. This is because each [[IPMI]] BMC supports just it&#039;s host system. More on that later.}}&lt;br /&gt;
&lt;br /&gt;
==== Example &amp;lt;fencedevice...&amp;gt; Tag For HP&#039;s iLO ====&lt;br /&gt;
&lt;br /&gt;
Getting [[iLO]] to work in the cluster is a little trickier as the [[RPM]]s used to enable iLO must be downloaded from [[HP]]&#039;s website and manually installed. There is a &amp;quot;quickie&amp;quot; tutorial that covers getting iLO working on [[EL5]] below.&lt;br /&gt;
&lt;br /&gt;
* [[Configuring HP iLO 2 on EL5]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;fencedevices&amp;gt;&lt;br /&gt;
		&amp;lt;fencedevice name=&amp;quot;an01_ilo&amp;quot; agent=&amp;quot;fence_ilo&amp;quot; ipaddr=&amp;quot;192.168.4.74&amp;quot; login=&amp;quot;Administrator&amp;quot; passwd=&amp;quot;secret&amp;quot; /&amp;gt;&lt;br /&gt;
		&amp;lt;fencedevice name=&amp;quot;an02_ilo&amp;quot; agent=&amp;quot;fence_ilo&amp;quot; ipaddr=&amp;quot;192.168.4.75&amp;quot; login=&amp;quot;Administrator&amp;quot; passwd=&amp;quot;secret&amp;quot; /&amp;gt;&lt;br /&gt;
	&amp;lt;/fencedevices&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Example &amp;lt;fencedevice...&amp;gt; Tag For APC Switched PDUs ====&lt;br /&gt;
&lt;br /&gt;
Here we will show how to configure APC switched [[PDU]] &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;fencedevice...&amp;gt;&amp;lt;/span&amp;gt; tags. We won&#039;t be using it in this tutorial, but in the real world, it is &#039;&#039;&#039;highly&#039;&#039;&#039; recommended as a backup fence device for [[IPMI]] and similar primary fence devices.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
	...&lt;br /&gt;
		&amp;lt;fence&amp;gt;&lt;br /&gt;
			&amp;lt;method name=&amp;quot;pdu&amp;quot;&amp;gt;&lt;br /&gt;
				&amp;lt;device name=&amp;quot;pdu001&amp;quot; action=&amp;quot;reboot&amp;quot; port=&amp;quot;1&amp;quot;/&amp;gt;&lt;br /&gt;
			&amp;lt;/method&amp;gt;&lt;br /&gt;
		&amp;lt;/fence&amp;gt;&lt;br /&gt;
	...&lt;br /&gt;
	&amp;lt;fencedevices&amp;gt;&lt;br /&gt;
		&amp;lt;fencedevice name=&amp;quot;pdu001&amp;quot; agent=&amp;quot;fence_apc&amp;quot; ipaddr=&amp;quot;192.168.3.6&amp;quot; login=&amp;quot;apc&amp;quot; passwd=&amp;quot;secret&amp;quot;/&amp;gt;&lt;br /&gt;
	&amp;lt;/fencedevices&amp;gt;&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;ipaddr&amp;lt;/span&amp;gt;; This is the resolvable name or [[IP]] address of the device. If you use a resolvable name, it is strongly advised that you put the name in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/hosts&amp;lt;/span&amp;gt; as [[DNS]] is another layer of abstraction which could fail.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;login&amp;lt;/span&amp;gt;; This is the login name to use when the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fenced&amp;lt;/span&amp;gt; daemon connects to the device.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;passwd&amp;lt;/span&amp;gt;; This is the login password to use when the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fenced&amp;lt;/span&amp;gt; daemon connects to the device.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;name&amp;lt;/span&amp;gt;; This is the name of this particular fence device within the cluster which, as we will see shortly, is matched in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;clusternode...&amp;gt;&amp;lt;/span&amp;gt; element where appropriate.&lt;br /&gt;
&lt;br /&gt;
=== Using the Fence Devices ===&lt;br /&gt;
&lt;br /&gt;
Now we have nodes and fence devices defined, we will go back and tie them together. This is done by:&lt;br /&gt;
* Defining a &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[RHCS_v2_cluster.conf#Tag.3B_fence|fence]]&amp;lt;/span&amp;gt; tag containing all fence methods and devices.&lt;br /&gt;
** Defining one or more &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[RHCS_v2_cluster.conf#Tag.3B_method|method]]&amp;lt;/span&amp;gt; tag(s) containing the device call(s) needed for each fence attempt.&lt;br /&gt;
*** Defining one or more &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[RHCS_v2_cluster.conf#Tag.3B_device|device]]&amp;lt;/span&amp;gt; tag(s) containing attributes describing how to call the fence device to kill this node.&lt;br /&gt;
&lt;br /&gt;
This tutorial will be using just a [[Node Assassin]] fence device. We&#039;ll look at an example adding [[IPMI]] in a moment though, as IPMI is a very common fence device and one you will very likely use.&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-cluster01&amp;quot; config_version=&amp;quot;5&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;cman expected_votes=&amp;quot;1&amp;quot; two_node=&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-node04.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;fence_na01&amp;quot; port=&amp;quot;04&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-node05.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;fence_na01&amp;quot; port=&amp;quot;03&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_na01&amp;quot; agent=&amp;quot;fence_na&amp;quot; ipaddr=&amp;quot;fence_na01.alteeve.com&amp;quot; login=&amp;quot;admin&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;
{{note|1=You might note that the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05.alteeve.com&amp;lt;/span&amp;gt; has it&#039;s fence port set to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;03&amp;lt;/span&amp;gt;. In my case, I fried my second Node Assassin during testing and didn&#039;t get a chance to replace it. So instead I plugged it into port &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;03&amp;lt;/span&amp;gt;, which, conveniently, also helps illustrate that the port numbers do not need to relate in any way to the node names. This is probably self-evident, I do admit.}}&lt;br /&gt;
&lt;br /&gt;
First, notice that the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[RHCS_v2_cluster.conf#Tag.3B_fence|fence]]&amp;lt;/span&amp;gt; tag has no attributes. It&#039;s merely a container for the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[RHCS_v2_cluster.conf#Tag.3B_method|method]](s)&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The next level is the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[RHCS_v2_cluster.conf#Tag.3B_method|method]]&amp;lt;/span&amp;gt; named &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;node_assassin&amp;lt;/span&amp;gt;. This name is merely a description and can be whatever you feel is most appropriate. It&#039;s purpose is simply to help you distinguish this method from other methods. The reason for &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;method&amp;lt;/span&amp;gt; tags is that some fence device calls will have two or more steps. A classic example would be a node with a redundant power supply on a switch PDU acting as the fence device. In such a case, you will need to define multiple &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[RHCS_v2_cluster.conf#Tag.3B_device|device]]&amp;lt;/span&amp;gt; tags, one for each power cable feeding the node. In such a case, the cluster will not consider the fence a success unless and until all contained &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[RHCS_v2_cluster.conf#Tag.3B_device|device]]&amp;lt;/span&amp;gt; calls execute successfully.&lt;br /&gt;
&lt;br /&gt;
The actual fence &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[RHCS_v2_cluster.conf#Tag.3B_device|device]]&amp;lt;/span&amp;gt; configuration is the final piece of the puzzle. It is here that you specify per-node configuration options and link these attributes to a given &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[RHCS_v2_cluster.conf#Tag.3B_fencedevice|fencedevice]]&amp;lt;/span&amp;gt;. Here, we see the link to the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fencedevice&amp;lt;/span&amp;gt; via the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[RHCS_v2_cluster.conf#device.27s_name_attribute|name]]&amp;lt;/span&amp;gt;, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fence_na01&amp;lt;/span&amp;gt; in this example.&lt;br /&gt;
&lt;br /&gt;
Let&#039;s step through an example fence call to help show how the per-cluster and fence device attributes are combined during a fence call.&lt;br /&gt;
&lt;br /&gt;
* The cluster manager decides that a node needs to be fenced. Let&#039;s say that the victim is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt;.&lt;br /&gt;
* The first &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;method&amp;lt;/span&amp;gt; in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fence&amp;lt;/span&amp;gt; section under &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt; is consulted. Within it there is just one &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;device&amp;lt;/span&amp;gt;, named &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fence_na01&amp;lt;/span&amp;gt; and having two attributes;&lt;br /&gt;
** &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;port&amp;lt;/span&amp;gt;; This tells the cluster that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt; is connected to the Node Assassin&#039;s port number &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;03&amp;lt;/span&amp;gt;.&lt;br /&gt;
** &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;action&amp;lt;/span&amp;gt;; This tells the cluster that the fence action to take is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;reboot&amp;lt;/span&amp;gt;. How this action is actually interpreted depends on the fence device in use, though the name certainly implies that the node will be forced off and then restarted.&lt;br /&gt;
* The cluster searches in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fencedevices&amp;lt;/span&amp;gt; for a &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fencedevice&amp;lt;/span&amp;gt; matching the name &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fence_na01&amp;lt;/span&amp;gt;. This fence device has five attributes; &lt;br /&gt;
** &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;agent&amp;lt;/span&amp;gt;; This tells the cluster to call the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fence_na&amp;lt;/span&amp;gt; fence agent script, as we discussed earlier.&lt;br /&gt;
** &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ipaddr&amp;lt;/span&amp;gt;; This tells the fence agent where on the network to find this particular Node Assassin. This is how multiple fence devices of the same type can be used in the cluster.&lt;br /&gt;
** &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;login&amp;lt;/span&amp;gt;; This is the login user name to use when authenticating against the fence device.&lt;br /&gt;
** &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;passwd&amp;lt;/span&amp;gt;; This is the password to supply along with the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;login&amp;lt;/span&amp;gt; name when authenticating against the fence device.&lt;br /&gt;
** &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;quiet&amp;lt;/span&amp;gt;; This is a device-specific argument that Node Assassin uses (see &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;man fence_na&amp;lt;/span&amp;gt; for details).&lt;br /&gt;
* With this information collected and compiled, the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fenced&amp;lt;/span&amp;gt; daemon will call the fence agent and pass it the attribute &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;variable=value&amp;lt;/span&amp;gt; pairs, one per line. Thus, the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fenced&amp;lt;/span&amp;gt; daemon will call:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/usr/sbin/fence_na&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then it will pass to that agent the following arguments:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
ipaddr=fence_na01.alteeve.com&lt;br /&gt;
login=admin&lt;br /&gt;
passwd=secret&lt;br /&gt;
quiet=1&lt;br /&gt;
port=02&lt;br /&gt;
action=reboot&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As you can see then, the first four arguments are from the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fencedevice&amp;lt;/span&amp;gt; attributes and the last two are from the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;device&amp;lt;/span&amp;gt; attributes under &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt;&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clusternode&amp;lt;/span&amp;gt;&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fence&amp;lt;/span&amp;gt; tag. &lt;br /&gt;
&lt;br /&gt;
When you have two or more &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;method&amp;lt;/span&amp;gt; tags defined, then the first in the list will be tried. If any of it&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;device&amp;lt;/span&amp;gt; tags fail, then the method is considered to have failed and the next method is consulted. This will repeat until all &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;method&amp;lt;/span&amp;gt; entries have been tried. At that point, the cluster goes back to the first &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;method&amp;lt;/span&amp;gt; and tries again, repeating the walk through of all methods. This loop will continue until one &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;method&amp;lt;/span&amp;gt; succeeds, regardless of how long that might take.&lt;br /&gt;
&lt;br /&gt;
==== An Example Showing IPMI&#039;s Use ====&lt;br /&gt;
&lt;br /&gt;
This is a full configuration file showing what it would look like if we were using [[IPMI]] and a [[Node Assassin]] for redundant fencing.&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-cluster01&amp;quot; config_version=&amp;quot;6&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;cman expected_votes=&amp;quot;1&amp;quot; two_node=&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-node04.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;fence_na01&amp;quot; port=&amp;quot;04&amp;quot; action=&amp;quot;reboot&amp;quot;/&amp;gt;&lt;br /&gt;
				&amp;lt;/method&amp;gt;&lt;br /&gt;
				&amp;lt;method name=&amp;quot;an-node04_ipmi&amp;quot;&amp;gt;&lt;br /&gt;
					&amp;lt;device name=&amp;quot;an01_ipmi&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-node05.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;fence_na01&amp;quot; port=&amp;quot;03&amp;quot; action=&amp;quot;reboot&amp;quot;/&amp;gt;&lt;br /&gt;
				&amp;lt;/method&amp;gt;&lt;br /&gt;
				&amp;lt;method name=&amp;quot;an-node05_ipmi&amp;quot;&amp;gt;&lt;br /&gt;
					&amp;lt;device name=&amp;quot;an02_ipmi&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_na01&amp;quot; agent=&amp;quot;fence_na&amp;quot; ipaddr=&amp;quot;fence_na01.alteeve.com&amp;quot; login=&amp;quot;admin&amp;quot; passwd=&amp;quot;secret&amp;quot; quiet=&amp;quot;1&amp;quot;/&amp;gt;&lt;br /&gt;
		&amp;lt;fencedevice name=&amp;quot;an01_ipmi&amp;quot; agent=&amp;quot;fence_ipmilan&amp;quot; ipaddr=&amp;quot;192.168.4.74&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;an02_ipmi&amp;quot; agent=&amp;quot;fence_ipmilan&amp;quot; ipaddr=&amp;quot;192.168.4.75&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;
We now see three elements in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fencedevices&amp;lt;/span&amp;gt;. The first is the original Node Assassin entry plus two [[IPMI]] entries, one for each node in the cluster. As we touched on earlier, this is because each node has it&#039;s own IPMI [[BMC]]. In the same vein, we also now see that the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;device&amp;lt;/span&amp;gt; entries in each node&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;method&amp;lt;/span&amp;gt; element have no &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;port&amp;lt;/span&amp;gt; setting.&lt;br /&gt;
&lt;br /&gt;
Notice that the Node Assassin&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;method&amp;lt;/span&amp;gt; is above the IPMI &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;method&amp;lt;/span&amp;gt;. This means that the Node Assassin is the primary fence device and the IPMI is the secondary. When deciding which order to assign the fence devices, consider the device&#039;s potential for failure and how that might effect cluster recovery time. For example, many IPMI BMCs rely on the node&#039;s power supply to operate. Thus, if the node&#039;s power supply fails and the IPMI is the first fence device, then recovery will be delayed as the cluster will try, and then wait until it times out, before moving on to the networked fence device, Node Assassin in this instance.&lt;br /&gt;
&lt;br /&gt;
=== Give Nodes More Time To Start ===&lt;br /&gt;
&lt;br /&gt;
Clusters with more than three nodes will have to gain quorum before they can fence other nodes. As we saw earlier though, this is not really the case when using the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[RHCS_v2_cluster.conf#two_node|two_node]]=&amp;quot;1&amp;quot;&amp;lt;/span&amp;gt; attribute in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[RHCS_v2_cluster.conf#cman.3B_The_Cluster_Manager|cman]]&amp;lt;/span&amp;gt; tag. What this means in practice is that if you start the cluster on one node and then wait too long to start the cluster on the second node, the first will fence the second.&lt;br /&gt;
&lt;br /&gt;
The logic behind this is; When the cluster starts, it will try to talk to it&#039;s fellow node and then fail. With the special &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;two_node=&amp;quot;1&amp;quot;&amp;lt;/span&amp;gt; attribute set, the cluster knows that it is allowed to start clustered services, but it has no way to say for sure what state the other node is in. It could well be online and hosting services for all it knows. So it has to proceed on the assumption that the other node is alive and using shared resources. Given that, and given that it can not talk to the other node, it&#039;s only safe option is to fence the other node. Only then can it be confident that it is safe to start providing clustered services.&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-cluster01&amp;quot; config_version=&amp;quot;7&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;cman expected_votes=&amp;quot;1&amp;quot; two_node=&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-node04.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;fence_na01&amp;quot; port=&amp;quot;04&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-node05.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;fence_na01&amp;quot; port=&amp;quot;03&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_na01&amp;quot; agent=&amp;quot;fence_na&amp;quot; ipaddr=&amp;quot;fence_na01.alteeve.com&amp;quot; login=&amp;quot;admin&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;fence_daemon post_join_delay=&amp;quot;60&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/cluster&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The new tag is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[RHCS_v2_cluster.conf#fence_daemon.3B_Fencing|fence_daemon]]&amp;lt;/span&amp;gt;, seen near the bottom if the file above. The change is made using the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[RHCS_v2_cluster.conf#post_join_delay|post_join_delay]]=&amp;quot;60&amp;quot;&amp;lt;/span&amp;gt; attribute. By default, the cluster will declare the other node dead after just &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;6&amp;lt;/span&amp;gt; seconds. The reason is that the larger this value, the slower the start-up of the cluster services will be. During testing and development though, I find this value to be far too short and frequently led to unnecessary fencing. Once your cluster is setup and working, it&#039;s not a bad idea to reduce this value to the lowest value that you are comfortable with.&lt;br /&gt;
&lt;br /&gt;
=== Configuring Totem ===&lt;br /&gt;
&lt;br /&gt;
This is almost a misnomer, as we&#039;re more or less &#039;&#039;not&#039;&#039; configuring the [[totem]] protocol in this cluster.&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-cluster01&amp;quot; config_version=&amp;quot;8&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;cman expected_votes=&amp;quot;1&amp;quot; two_node=&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-node04.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;fence_na01&amp;quot; port=&amp;quot;04&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-node05.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;fence_na01&amp;quot; port=&amp;quot;03&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_na01&amp;quot; agent=&amp;quot;fence_na&amp;quot; ipaddr=&amp;quot;fence_na01.alteeve.com&amp;quot; login=&amp;quot;admin&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;fence_daemon post_join_delay=&amp;quot;60&amp;quot;/&amp;gt;&lt;br /&gt;
        &amp;lt;totem rrp_mode=&amp;quot;none&amp;quot; secauth=&amp;quot;off&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/cluster&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the spirit of &amp;quot;keeping it simple&amp;quot;, we&#039;re not configuring [[redundant ring protocol]] in this cluster. [[RRP]] is an optional second ring that can be used for cluster communication in the case of a break down in the first ring. This is not the simplest option to setup, as recovery must be done manually. However, if you wish to explore it further, please take a look at the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clusternode&amp;lt;/span&amp;gt; element tag called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;[[RHCS_v2_cluster.conf#Tag.3B_altname|altname]]...&amp;gt;&amp;lt;/span&amp;gt;. When &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[altname]]&amp;lt;/span&amp;gt; is used though, then the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[RHCS_v2_cluster.conf#rrp_mode|rrp_mode]]&amp;lt;/span&amp;gt; attribute will need to be changed to either &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;active&amp;lt;/span&amp;gt; or &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;passive&amp;lt;/span&amp;gt; (the details of which are outside the scope of this tutorial).&lt;br /&gt;
&lt;br /&gt;
The second option we&#039;re looking at here is the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[RHCS_v2_cluster.conf#secauth|secauth]]=&amp;quot;off&amp;quot;&amp;lt;/span&amp;gt; attribute. This controls whether the cluster communications are encrypted or not. We can safely disable this because we&#039;re working on a known-private network, which yields two benefits; It&#039;s simpler to setup and it&#039;s a lot faster. If you must encrypt the cluster communications, then you can do so here. The details of which are also outside the scope of this tutorial though.&lt;br /&gt;
&lt;br /&gt;
=== Validating and Pushing the /etc/cluster/cluster.conf File ===&lt;br /&gt;
&lt;br /&gt;
The cluster software validates the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/cluster/cluster.conf&amp;lt;/span&amp;gt; file against &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/usr/share/system-config-cluster/misc/cluster.ng&amp;lt;/span&amp;gt; using the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xmllint&amp;lt;/span&amp;gt; program. If it fails to validate, the cluster will refuse to start.&lt;br /&gt;
&lt;br /&gt;
So now that we&#039;ve got the foundation of our cluster ready, the last step is to validate it. To do so, simply run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
xmllint --relaxng /usr/share/system-config-cluster/misc/cluster.ng /etc/cluster/cluster.conf&lt;br /&gt;
&amp;lt;/source&amp;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-cluster01&amp;quot; config_version=&amp;quot;8&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;cman expected_votes=&amp;quot;1&amp;quot; two_node=&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-node04.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;fence_na01&amp;quot; port=&amp;quot;04&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-node05.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;fence_na01&amp;quot; port=&amp;quot;03&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_na01&amp;quot; agent=&amp;quot;fence_na&amp;quot; ipaddr=&amp;quot;fence_na01.alteeve.com&amp;quot; login=&amp;quot;admin&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;fence_daemon post_join_delay=&amp;quot;60&amp;quot;/&amp;gt;&lt;br /&gt;
        &amp;lt;totem rrp_mode=&amp;quot;none&amp;quot; secauth=&amp;quot;off&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/cluster&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;
/etc/cluster/cluster.conf validates&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If there was a problem, you need to go back and fix it. &#039;&#039;&#039;DO NOT&#039;&#039;&#039; proceed until your configuration validates. Once it does, we&#039;re ready to move on!&lt;br /&gt;
&lt;br /&gt;
With it validated, we need to push it to the other node. As the cluster is not running yet, we will push it out using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rsync&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;
rsync -av /etc/cluster/cluster.conf root@an-node05:/etc/cluster/&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
building file list ... done&lt;br /&gt;
cluster.conf&lt;br /&gt;
&lt;br /&gt;
sent 891 bytes  received 66 bytes  638.00 bytes/sec&lt;br /&gt;
total size is 790  speedup is 0.83&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Starting the Cluster For The First Time =&lt;br /&gt;
&lt;br /&gt;
At this point, we have the foundation of the cluster in place and we can start it up!&lt;br /&gt;
&lt;br /&gt;
== Keeping an Eye on Things ==&lt;br /&gt;
&lt;br /&gt;
I&#039;ve found a layout of four terminal windows, the left ones being 80 columns wide and the right ones filling the rest of the screen, works well. I personally run a &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;tail -f -n 0 /var/log/messages&amp;lt;/span&amp;gt; in the right windows so that I can keep an eye on things.&lt;br /&gt;
&lt;br /&gt;
[[Image:2-node_cluster_terminal_layout_01.png|thumb|center|700px|The terminal layout I use to monitor and operate the two nodes in the cluster.]]&lt;br /&gt;
&lt;br /&gt;
Of course, what you use is entirely up to you, your screen real-estate and your preferences.&lt;br /&gt;
&lt;br /&gt;
== A Note on Timing ==&lt;br /&gt;
&lt;br /&gt;
Remember that you have &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;post_join_delay&amp;lt;/span&amp;gt; seconds to start both nodes, which is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;60&amp;lt;/span&amp;gt; seconds in our configuration. So be sure that you can start the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt; daemon quickly on both nodes. I generally ensure that both terminal windows have the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;start&amp;lt;/span&amp;gt; command typed in, so that I can quickly press &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;enter&amp;gt;&amp;lt;/span&amp;gt; on both nodes. Again, how you do this is entirely up to you.&lt;br /&gt;
&lt;br /&gt;
== All Systems Are Go! ==&lt;br /&gt;
&lt;br /&gt;
Time to 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;
On both nodes, run the following command:&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;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Starting cluster: &lt;br /&gt;
   Loading modules... done&lt;br /&gt;
   Mounting configfs... done&lt;br /&gt;
   Starting ccsd... done&lt;br /&gt;
   Starting cman... done&lt;br /&gt;
   Starting daemons... done&lt;br /&gt;
   Starting fencing... done&lt;br /&gt;
                                                           [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If things went well, you should see something like this in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/var/log/messages&amp;lt;/span&amp;gt; terminal on both nodes:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
May  3 22:33:15 an-node04 ccsd[5319]: Starting ccsd 2.0.115: &lt;br /&gt;
May  3 22:33:15 an-node04 ccsd[5319]:  Built: Apr 28 2011 05:36:14 &lt;br /&gt;
May  3 22:33:15 an-node04 ccsd[5319]:  Copyright (C) Red Hat, Inc.  2004  All rights reserved. &lt;br /&gt;
May  3 22:33:15 an-node04 ccsd[5319]: cluster.conf (cluster name = an-cluster01, version = 8) found. &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [MAIN ] AIS Executive Service RELEASE &#039;subrev 1887 version 0.80.6&#039; &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [MAIN ] Copyright (C) 2002-2006 MontaVista Software, Inc and contributors. &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [MAIN ] Copyright (C) 2006 Red Hat, Inc. &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [MAIN ] AIS Executive Service: started and ready to provide service. &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [MAIN ] Using default multicast address of 239.192.235.77 &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [TOTEM] Token Timeout (10000 ms) retransmit timeout (495 ms) &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [TOTEM] token hold (386 ms) retransmits before loss (20 retrans) &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [TOTEM] join (60 ms) send_join (0 ms) consensus (2000 ms) merge (200 ms) &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [TOTEM] downcheck (1000 ms) fail to recv const (2500 msgs) &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [TOTEM] seqno unchanged const (30 rotations) Maximum network MTU 1402 &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [TOTEM] window size per rotation (50 messages) maximum messages per rotation (17 messages) &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [TOTEM] missed count const (5 messages) &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [TOTEM] send threads (0 threads) &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [TOTEM] RRP token expired timeout (495 ms) &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [TOTEM] RRP token problem counter (2000 ms) &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [TOTEM] RRP threshold (10 problem count) &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [TOTEM] RRP mode set to none. &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [TOTEM] heartbeat_failures_allowed (0) &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [TOTEM] max_network_delay (50 ms) &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [TOTEM] HeartBeat is Disabled. To enable set heartbeat_failures_allowed &amp;gt; 0 &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [TOTEM] Receive multicast socket recv buffer size (262142 bytes). &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [TOTEM] Transmit multicast socket send buffer size (262142 bytes). &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [TOTEM] The network interface [192.168.3.74] is now up. &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [TOTEM] Created or loaded sequence id 8.192.168.3.74 for this ring. &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [TOTEM] entering GATHER state from 15. &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [CMAN ] CMAN 2.0.115 (built Apr 28 2011 05:36:17) started &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [MAIN ] Service initialized &#039;openais CMAN membership service 2.01&#039; &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [SERV ] Service initialized &#039;openais extended virtual synchrony service&#039; &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [SERV ] Service initialized &#039;openais cluster membership service B.01.01&#039; &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [SERV ] Service initialized &#039;openais availability management framework B.01.01&#039; &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [SERV ] Service initialized &#039;openais checkpoint service B.01.01&#039; &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [SERV ] Service initialized &#039;openais event service B.01.01&#039; &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [SERV ] Service initialized &#039;openais distributed locking service B.01.01&#039; &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [SERV ] Service initialized &#039;openais message service B.01.01&#039; &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [SERV ] Service initialized &#039;openais configuration service&#039; &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [SERV ] Service initialized &#039;openais cluster closed process group service v1.01&#039; &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [SERV ] Service initialized &#039;openais cluster config database access v1.01&#039; &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [SYNC ] Not using a virtual synchrony filter. &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [TOTEM] Creating commit token because I am the rep. &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [TOTEM] Saving state aru 0 high seq received 0 &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [TOTEM] Storing new sequence id for ring c &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [TOTEM] entering COMMIT state. &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [TOTEM] entering RECOVERY state. &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [TOTEM] position [0] member 192.168.3.74: &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [TOTEM] previous ring seq 8 rep 192.168.3.74 &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [TOTEM] aru 0 high delivered 0 received flag 1 &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [TOTEM] Did not need to originate any messages in recovery. &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [TOTEM] Sending initial ORF token &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [CLM  ] CLM CONFIGURATION CHANGE &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [CLM  ] New Configuration: &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [CLM  ] Members Left: &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [CLM  ] Members Joined: &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [CLM  ] CLM CONFIGURATION CHANGE &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [CLM  ] New Configuration: &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [CLM  ] 	r(0) ip(192.168.3.74)  &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [CLM  ] Members Left: &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [CLM  ] Members Joined: &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [CLM  ] 	r(0) ip(192.168.3.74)  &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [SYNC ] This node is within the primary component and will provide service. &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [TOTEM] entering OPERATIONAL state. &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [CMAN ] quorum regained, resuming activity &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [CLM  ] got nodejoin message 192.168.3.74 &lt;br /&gt;
May  3 22:33:17 an-node04 ccsd[5319]: Initial status:: Quorate &lt;br /&gt;
May  3 22:33:18 an-node04 openais[5325]: [TOTEM] entering GATHER state from 11. &lt;br /&gt;
May  3 22:33:18 an-node04 openais[5325]: [TOTEM] Creating commit token because I am the rep. &lt;br /&gt;
May  3 22:33:18 an-node04 openais[5325]: [TOTEM] Saving state aru c high seq received c &lt;br /&gt;
May  3 22:33:18 an-node04 openais[5325]: [TOTEM] Storing new sequence id for ring 14 &lt;br /&gt;
May  3 22:33:18 an-node04 openais[5325]: [TOTEM] entering COMMIT state. &lt;br /&gt;
May  3 22:33:18 an-node04 openais[5325]: [TOTEM] entering RECOVERY state. &lt;br /&gt;
May  3 22:33:18 an-node04 openais[5325]: [TOTEM] position [0] member 192.168.3.74: &lt;br /&gt;
May  3 22:33:18 an-node04 openais[5325]: [TOTEM] previous ring seq 12 rep 192.168.3.74 &lt;br /&gt;
May  3 22:33:18 an-node04 openais[5325]: [TOTEM] aru c high delivered c received flag 1 &lt;br /&gt;
May  3 22:33:18 an-node04 openais[5325]: [TOTEM] position [1] member 192.168.3.75: &lt;br /&gt;
May  3 22:33:18 an-node04 openais[5325]: [TOTEM] previous ring seq 16 rep 192.168.3.75 &lt;br /&gt;
May  3 22:33:18 an-node04 openais[5325]: [TOTEM] aru c high delivered c received flag 1 &lt;br /&gt;
May  3 22:33:18 an-node04 openais[5325]: [TOTEM] Did not need to originate any messages in recovery. &lt;br /&gt;
May  3 22:33:18 an-node04 openais[5325]: [TOTEM] Sending initial ORF token &lt;br /&gt;
May  3 22:33:18 an-node04 openais[5325]: [CLM  ] CLM CONFIGURATION CHANGE &lt;br /&gt;
May  3 22:33:18 an-node04 openais[5325]: [CLM  ] New Configuration: &lt;br /&gt;
May  3 22:33:18 an-node04 openais[5325]: [CLM  ] 	r(0) ip(192.168.3.74)  &lt;br /&gt;
May  3 22:33:18 an-node04 openais[5325]: [CLM  ] Members Left: &lt;br /&gt;
May  3 22:33:18 an-node04 openais[5325]: [CLM  ] Members Joined: &lt;br /&gt;
May  3 22:33:18 an-node04 openais[5325]: [CLM  ] CLM CONFIGURATION CHANGE &lt;br /&gt;
May  3 22:33:18 an-node04 openais[5325]: [CLM  ] New Configuration: &lt;br /&gt;
May  3 22:33:18 an-node04 openais[5325]: [CLM  ] 	r(0) ip(192.168.3.74)  &lt;br /&gt;
May  3 22:33:18 an-node04 openais[5325]: [CLM  ] 	r(0) ip(192.168.3.75)  &lt;br /&gt;
May  3 22:33:18 an-node04 openais[5325]: [CLM  ] Members Left: &lt;br /&gt;
May  3 22:33:18 an-node04 openais[5325]: [CLM  ] Members Joined: &lt;br /&gt;
May  3 22:33:18 an-node04 openais[5325]: [CLM  ] 	r(0) ip(192.168.3.75)  &lt;br /&gt;
May  3 22:33:18 an-node04 openais[5325]: [SYNC ] This node is within the primary component and will provide service. &lt;br /&gt;
May  3 22:33:18 an-node04 openais[5325]: [TOTEM] entering OPERATIONAL state. &lt;br /&gt;
May  3 22:33:18 an-node04 openais[5325]: [CLM  ] got nodejoin message 192.168.3.74 &lt;br /&gt;
May  3 22:33:18 an-node04 openais[5325]: [CLM  ] got nodejoin message 192.168.3.75 &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From the node you started &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt; on first, you will see:&lt;br /&gt;
* The cluster configuration system daemon, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ccsd&amp;lt;/span&amp;gt;, starts up and reads in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/cluster/cluster.conf&amp;lt;/span&amp;gt;. It reports the name of the cluster, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-cluster01&amp;lt;/span&amp;gt; and the version, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;8&amp;lt;/span&amp;gt;.&lt;br /&gt;
* OpenAIS then starts up, reports it&#039;s multicast address it will use, reports many of it&#039;s variable values and what [[IP]] address it will use for cluster communications.&lt;br /&gt;
* The Cluster Manager, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt;, starts and reports the version of various services in use.&lt;br /&gt;
* The [[totem]] protocol is started and it forms an initial configuration containing just itself. These messages have the prefix &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;CLM&amp;lt;/span&amp;gt;, CLuster Membership.&lt;br /&gt;
** Then it waits to see if the other node will join. On the other node&#039;s log, you will see it start off and immediately join with this first node. &lt;br /&gt;
* The initial configuration is sufficient to gain quorum and declares that it will provide services.&lt;br /&gt;
* The second node announces that it wants to join the first node&#039;s cluster membership and the cluster reconfigures.&lt;br /&gt;
&lt;br /&gt;
From the node you started &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt; on second, you will see mostly the same thing, except you will not see the cluster form on the one node. Instead, it will connect directly to the first node and the initial configuration will be the pair together.&lt;br /&gt;
&lt;br /&gt;
If you got this, then you&#039;re cluster is up and running, congratulations!&lt;br /&gt;
&lt;br /&gt;
== Testing Fencing ==&lt;br /&gt;
&lt;br /&gt;
Before we go any further, we want to make sure that our fence device and configuration is working from both nodes. We will test this two ways;&lt;br /&gt;
* First, we will use the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fence_node&amp;lt;/span&amp;gt; tools.&lt;br /&gt;
* Second, we will break the network connection to simulate a network failure.&lt;br /&gt;
&lt;br /&gt;
=== Fencing with the fence_node Tool ===&lt;br /&gt;
&lt;br /&gt;
Testing this is easy, thanks to the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fence_node&amp;lt;/span&amp;gt; command line tool. It&#039;s simply a matter of calling &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fence_node &amp;lt;node&amp;gt;&amp;lt;/span&amp;gt;, where &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;node&amp;gt;&amp;lt;/span&amp;gt; has to match the name set in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cluster.conf&amp;lt;/span&amp;gt; file&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clusternode name=&amp;quot;...&amp;quot;&amp;lt;/span&amp;gt; element.&lt;br /&gt;
&lt;br /&gt;
We will do this test twice; Once from &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt;, fencing &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt; and then again from the other way around. After each fence call, we will wait for the node to reboot and then rejoin it to the cluster. We&#039;ll watch &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/var/log/messages&amp;lt;/span&amp;gt; to see what&#039;s happening.&lt;br /&gt;
&lt;br /&gt;
Let&#039;s start by fencing &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05.alteeve.com&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;From &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt;&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
fence_node05.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;
May  6 00:46:26 an-node04 openais[25357]: [TOTEM] The token was lost in the OPERATIONAL state.&lt;br /&gt;
May  6 00:46:26 an-node04 openais[25357]: [TOTEM] Receive multicast socket recv buffer size (262142 bytes).&lt;br /&gt;
May  6 00:46:26 an-node04 openais[25357]: [TOTEM] Transmit multicast socket send buffer size (262142 bytes).&lt;br /&gt;
May  6 00:46:26 an-node04 openais[25357]: [TOTEM] entering GATHER state from 2.&lt;br /&gt;
May  6 00:46:28 an-node04 openais[25357]: [TOTEM] entering GATHER state from 0.&lt;br /&gt;
May  6 00:46:28 an-node04 openais[25357]: [TOTEM] Creating commit token because I am the rep.&lt;br /&gt;
May  6 00:46:28 an-node04 openais[25357]: [TOTEM] Saving state aru 22 high seq received 22&lt;br /&gt;
May  6 00:46:28 an-node04 openais[25357]: [TOTEM] Storing new sequence id for ring 5c&lt;br /&gt;
May  6 00:46:28 an-node04 openais[25357]: [TOTEM] entering COMMIT state.&lt;br /&gt;
May  6 00:46:28 an-node04 openais[25357]: [TOTEM] entering RECOVERY state.&lt;br /&gt;
May  6 00:46:28 an-node04 openais[25357]: [TOTEM] position [0] member 192.168.3.74:&lt;br /&gt;
May  6 00:46:28 an-node04 openais[25357]: [TOTEM] previous ring seq 88 rep 192.168.3.74&lt;br /&gt;
May  6 00:46:28 an-node04 openais[25357]: [TOTEM] aru 22 high delivered 22 received flag 1&lt;br /&gt;
May  6 00:46:28 an-node04 openais[25357]: [TOTEM] Did not need to originate any messages in recovery.&lt;br /&gt;
May  6 00:46:28 an-node04 openais[25357]: [TOTEM] Sending initial ORF token&lt;br /&gt;
May  6 00:46:28 an-node04 openais[25357]: [CLM  ] CLM CONFIGURATION CHANGE&lt;br /&gt;
May  6 00:46:28 an-node04 openais[25357]: [CLM  ] New Configuration:&lt;br /&gt;
May  6 00:46:28 an-node04 fenced[25376]: an-node05.alteeve.com not a cluster member after 0 sec post_fail_delay&lt;br /&gt;
May  6 00:46:28 an-node04 kernel: dlm: closing connection to node 2&lt;br /&gt;
May  6 00:46:28 an-node04 openais[25357]: [CLM  ]       r(0) ip(192.168.3.74)&lt;br /&gt;
May  6 00:46:28 an-node04 fenced[25376]: fencing node &amp;quot;an-node05.alteeve.com&amp;quot;&lt;br /&gt;
May  6 00:46:28 an-node04 openais[25357]: [CLM  ] Members Left:&lt;br /&gt;
May  6 00:46:28 an-node04 openais[25357]: [CLM  ]       r(0) ip(192.168.3.75)&lt;br /&gt;
May  6 00:46:28 an-node04 openais[25357]: [CLM  ] Members Joined:&lt;br /&gt;
May  6 00:46:28 an-node04 openais[25357]: [CLM  ] CLM CONFIGURATION CHANGE&lt;br /&gt;
May  6 00:46:28 an-node04 openais[25357]: [CLM  ] New Configuration:&lt;br /&gt;
May  6 00:46:28 an-node04 openais[25357]: [CLM  ]       r(0) ip(192.168.3.74)&lt;br /&gt;
May  6 00:46:28 an-node04 openais[25357]: [CLM  ] Members Left:&lt;br /&gt;
May  6 00:46:28 an-node04 openais[25357]: [CLM  ] Members Joined:&lt;br /&gt;
May  6 00:46:28 an-node04 openais[25357]: [SYNC ] This node is within the primary component and will provide service.&lt;br /&gt;
May  6 00:46:28 an-node04 openais[25357]: [TOTEM] entering OPERATIONAL state.&lt;br /&gt;
May  6 00:46:28 an-node04 openais[25357]: [CLM  ] got nodejoin message 192.168.3.74&lt;br /&gt;
May  6 00:46:28 an-node04 openais[25357]: [CPG  ] got joinlist message from node 1&lt;br /&gt;
May  6 00:46:29 an-node04 fence_node[26696]: Fence of &amp;quot;an-node05.alteeve.com&amp;quot; was successful&lt;br /&gt;
May  6 00:46:42 an-node04 fenced[25376]: fence &amp;quot;an-node05.alteeve.com&amp;quot; success&lt;br /&gt;
May  6 00:50:23 an-node04 fence_node[26756]: Fence of &amp;quot;an-node05.alteeve.com&amp;quot; was successful&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{note|1=You will notice that there were two fence calls; This is normal. The first was the call from the command line that killed the node. The second was a reaction to the cluster reforming.}}&lt;br /&gt;
&lt;br /&gt;
Watching syslog, we&#039;ll see the node disappear, then the called fence finish, then the second fence called by the cluster itself succeed.&lt;br /&gt;
&lt;br /&gt;
If we check the cluster status from the surviving node, we&#039;ll see that the cluster has been reduced to just the single survivor node.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cman_tool 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;
Version: 6.2.0&lt;br /&gt;
Config Version: 8&lt;br /&gt;
Cluster Name: an-cluster01&lt;br /&gt;
Cluster Id: 60257&lt;br /&gt;
Cluster Member: Yes&lt;br /&gt;
Cluster Generation: 92&lt;br /&gt;
Membership state: Cluster-Member&lt;br /&gt;
Nodes: 1&lt;br /&gt;
Expected votes: 1&lt;br /&gt;
Total votes: 1&lt;br /&gt;
Quorum: 1  &lt;br /&gt;
Active subsystems: 7&lt;br /&gt;
Flags: 2node Dirty &lt;br /&gt;
Ports Bound: 0  &lt;br /&gt;
Node name: an-node04.alteeve.com&lt;br /&gt;
Node ID: 1&lt;br /&gt;
Multicast addresses: 239.192.235.77 &lt;br /&gt;
Node addresses: 192.168.3.74 &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once the victim has rebooted, we can rejoin it to the cluster. Now that the first node is already up, there is no need to worry about timing issues. Just start &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt; at your leisure. If you watch syslog from &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt;, you&#039;ll see &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt; connect and the cluster will reform to include it.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt;&#039;&#039;&#039;:&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;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Starting cluster: &lt;br /&gt;
   Loading modules... done&lt;br /&gt;
   Mounting configfs... done&lt;br /&gt;
   Starting ccsd... done&lt;br /&gt;
   Starting cman... done&lt;br /&gt;
   Starting daemons... done&lt;br /&gt;
   Starting fencing... done&lt;br /&gt;
                                                           [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{warning|1=Please do not assume that a successful fence against one node will mean that the fence against the other will work. An improper fence agent configuration, a typo in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cluster.conf&amp;lt;/span&amp;gt; or a fault in the wiring of the fence device could all cause node-specific fence failures.}}&lt;br /&gt;
&lt;br /&gt;
Now, repeat the process, but this time fence &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04.alteeve.com&amp;lt;/span&amp;gt; from &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Simulate a Network Failure ===&lt;br /&gt;
&lt;br /&gt;
It&#039;s good to know that we can fence the nodes with the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fence_node&amp;lt;/span&amp;gt; tool, but that is a controlled situation entirely within the context of the cluster. A more &amp;quot;real-world&amp;quot; test is now needed to ensure that a external fault will be detected by the cluster and that one of the nodes will be ejected. There are many, many ways to simulate a failure, and &#039;&#039;&#039;we will test&#039;&#039;&#039; all failures later. For now though, let&#039;s use a simple &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;iptables&amp;lt;/span&amp;gt; rule to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;DROP&amp;lt;/span&amp;gt; everything leaving our &#039;&#039;&#039;BCN&#039;&#039;&#039; interface.&lt;br /&gt;
&lt;br /&gt;
{{warning|1=This next command will block &#039;&#039;&#039;all&#039;&#039;&#039; traffic leaving the server. You will lose your &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ssh&amp;lt;/span&amp;gt; connection. If the fence fails, you will need to find another way to reboot or restore the server.}}&lt;br /&gt;
&lt;br /&gt;
This time, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04.alteeve.com&amp;lt;/span&amp;gt; will be the victim, so run the following &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;iptables&amp;lt;/span&amp;gt; command on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt; directly. This will cause all outbound traffic, including cluster communications, to fail. Within a few seconds, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt; should declare &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt; as dead, eject it via a fence call and then reconfigure.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt;&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
iptables -A OUTPUT -j DROP&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After a few seconds, you should see &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt; trigger the fence.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;In &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt;&#039;s syslog&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
May  6 01:11:08 an-node04 openais[4339]: [TOTEM] The token was lost in the OPERATIONAL state. &lt;br /&gt;
May  6 01:11:08 an-node04 openais[4339]: [TOTEM] Receive multicast socket recv buffer size (262142 bytes). &lt;br /&gt;
May  6 01:11:08 an-node04 openais[4339]: [TOTEM] Transmit multicast socket send buffer size (262142 bytes). &lt;br /&gt;
May  6 01:11:08 an-node04 openais[4339]: [TOTEM] entering GATHER state from 2. &lt;br /&gt;
May  6 01:11:10 an-node04 openais[4339]: [TOTEM] entering GATHER state from 0. &lt;br /&gt;
May  6 01:11:10 an-node04 openais[4339]: [TOTEM] Creating commit token because I am the rep. &lt;br /&gt;
May  6 01:11:10 an-node04 openais[4339]: [TOTEM] Saving state aru 24 high seq received 24 &lt;br /&gt;
May  6 01:11:10 an-node04 openais[4339]: [TOTEM] Storing new sequence id for ring 70 &lt;br /&gt;
May  6 01:11:10 an-node04 openais[4339]: [TOTEM] entering COMMIT state. &lt;br /&gt;
May  6 01:11:10 an-node04 openais[4339]: [TOTEM] entering RECOVERY state. &lt;br /&gt;
May  6 01:11:10 an-node04 openais[4339]: [TOTEM] position [0] member 192.168.3.74: &lt;br /&gt;
May  6 01:11:10 an-node04 openais[4339]: [TOTEM] previous ring seq 108 rep 192.168.3.74 &lt;br /&gt;
May  6 01:11:10 an-node04 openais[4339]: [TOTEM] aru 24 high delivered 24 received flag 1 &lt;br /&gt;
May  6 01:11:10 an-node04 openais[4339]: [TOTEM] Did not need to originate any messages in recovery. &lt;br /&gt;
May  6 01:11:10 an-node04 openais[4339]: [TOTEM] Sending initial ORF token &lt;br /&gt;
May  6 01:11:10 an-node04 openais[4339]: [CLM  ] CLM CONFIGURATION CHANGE &lt;br /&gt;
May  6 01:11:10 an-node04 openais[4339]: [CLM  ] New Configuration: &lt;br /&gt;
May  6 01:11:10 an-node04 kernel: dlm: closing connection to node 2&lt;br /&gt;
May  6 01:11:10 an-node04 fenced[4358]: an-node05.alteeve.com not a cluster member after 0 sec post_fail_delay&lt;br /&gt;
May  6 01:11:10 an-node04 openais[4339]: [CLM  ] 	r(0) ip(192.168.3.74)  &lt;br /&gt;
May  6 01:11:10 an-node04 fenced[4358]: fencing node &amp;quot;an-node05.alteeve.com&amp;quot;&lt;br /&gt;
May  6 01:11:10 an-node04 openais[4339]: [CLM  ] Members Left: &lt;br /&gt;
May  6 01:11:10 an-node04 openais[4339]: [CLM  ] 	r(0) ip(192.168.3.75)  &lt;br /&gt;
May  6 01:11:10 an-node04 openais[4339]: [CLM  ] Members Joined: &lt;br /&gt;
May  6 01:11:10 an-node04 openais[4339]: [CLM  ] CLM CONFIGURATION CHANGE &lt;br /&gt;
May  6 01:11:10 an-node04 openais[4339]: [CLM  ] New Configuration: &lt;br /&gt;
May  6 01:11:10 an-node04 openais[4339]: [CLM  ] 	r(0) ip(192.168.3.74)  &lt;br /&gt;
May  6 01:11:10 an-node04 openais[4339]: [CLM  ] Members Left: &lt;br /&gt;
May  6 01:11:10 an-node04 openais[4339]: [CLM  ] Members Joined: &lt;br /&gt;
May  6 01:11:10 an-node04 openais[4339]: [SYNC ] This node is within the primary component and will provide service. &lt;br /&gt;
May  6 01:11:10 an-node04 openais[4339]: [TOTEM] entering OPERATIONAL state. &lt;br /&gt;
May  6 01:11:10 an-node04 openais[4339]: [CLM  ] got nodejoin message 192.168.3.74 &lt;br /&gt;
May  6 01:11:10 an-node04 openais[4339]: [CPG  ] got joinlist message from node 1 &lt;br /&gt;
May  6 01:11:23 an-node04 fenced[4358]: fence &amp;quot;an-node05.alteeve.com&amp;quot; success&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Success!&lt;br /&gt;
&lt;br /&gt;
Now repeat this, making &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt; the victim. &lt;br /&gt;
&lt;br /&gt;
If both fence tests succeeded against both nodes, you can be confident that fencing is working well!&lt;br /&gt;
&lt;br /&gt;
= Setting Up Clustered Storage =&lt;br /&gt;
&lt;br /&gt;
The next few steps will cover setting up the DRBD resources, using them in clustered [[LVM]] and the creating a [[GFS2]] partition. Next, we will add it all as cluster resources and then create a service for each node to start up all of the clustered storage.&lt;br /&gt;
&lt;br /&gt;
== Creating Our DRBD Resources ==&lt;br /&gt;
&lt;br /&gt;
We&#039;re going to create four DRBD resources;&lt;br /&gt;
&lt;br /&gt;
* A resource to back our shared [[GFS2]] partition which will hold shared files, like our virtual machine configuration files.&lt;br /&gt;
* A resource to back the VMs running primarily on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt;.&lt;br /&gt;
* A resource to back the VMs running primarily on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt;.&lt;br /&gt;
* A final resource that will be left alone for future expansion. This is optional, of course.&lt;br /&gt;
&lt;br /&gt;
=== The &amp;quot;Why&amp;quot; of Our Layout ===&lt;br /&gt;
&lt;br /&gt;
The reason for this is to minimize the chance of data loss in a [[split-brain]] event. &lt;br /&gt;
&lt;br /&gt;
A split-brain occurs when a [[DRBD]] resource loses it&#039;s network link while in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Primary/Primary&amp;lt;/span&amp;gt; mode. The problem is that, after the split, any write to either node is not replicated to the other node. Thus, after even one [[byte]] is written, the DRBD resource is out of sync. Once this happens, there is no real way to automate recovery. You will need to go in and manual flag one side of the resource to discard it&#039;s changes and then manually re-connect the two sides before the resource will be usable again.&lt;br /&gt;
&lt;br /&gt;
We will take steps to prevent this, but it always a possibility with shared storage.&lt;br /&gt;
&lt;br /&gt;
Given then that there is no sure way to avoid this, we&#039;re going to mitigate risk by breaking up our DRBD resources so that we can be more selective in choosing what parts to invalidate after a split brain event.&lt;br /&gt;
&lt;br /&gt;
* The small GFS2 partition will be the hardest to manage. For this reason, it is on it&#039;s own. For the same reason, we will be using it as little as we can, and copies of files we care about will be stored on each node. The main thing here are the VM configuration files. This should be written to rarely, so with luck, in a split brain condition, simply nothing will be written to either side so recovery should be arbitrary and simple.&lt;br /&gt;
* The VMs that will primarily run on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt; will get their own resource. This way we can simply invalidate the DRBD device on the node that was &#039;&#039;&#039;not&#039;&#039;&#039; running the VMs during the split brain.&lt;br /&gt;
* Likewise, the VMs primarily running on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt; will get their own resource. This way, if a split brain happens and VMs are running on both nodes, it should be easily to invalidate opposing nodes for the respective DRBD resource.&lt;br /&gt;
* The fourth DRBD resource will just contain free space. This can later be added whole to an existing LVM VG or further divided up as needed in the future.&lt;br /&gt;
&lt;br /&gt;
== Visualizing Storage ==&lt;br /&gt;
&lt;br /&gt;
The layout of our storage is, on the surface, somewhat complex. To help follow what we&#039;ll be creating, here is an [[ASCII]] drawing showing what it will look like. Note that example VMs are shown, which we will not be creating. This is to help you see where extra VMs would exist if you ran two or more VMs per node.&lt;br /&gt;
&lt;br /&gt;
If you are using [[RAID]], then you can simply replace &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;sdaX&amp;lt;/span&amp;gt; with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;mdX&amp;lt;/span&amp;gt;. You can find a tutorial on manually creating RAID devices here:&lt;br /&gt;
* [[Managing Software RAID Arrays]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
         [ an-node04 ]&lt;br /&gt;
  ______   ______    ______     __[sda4]__&lt;br /&gt;
 | sda1 | | sda2 |  | sda3 |   |  ______  |       _______    ______________    ______________________________&lt;br /&gt;
 |______| |______|  |______|   | | sda5 |-+------| drbd0 |--| drbd_sh0_vg0 |--| /dev/drbd_sh0_vg0/xen_shared |&lt;br /&gt;
     |        |         |      | |______| |   /--|_______|  |______________|  |______________________________|&lt;br /&gt;
  ___|___    _|_    ____|____  |  ______  |   |     _______    ______________    ____________________________&lt;br /&gt;
 | /boot |  | / |  | &amp;lt;swap&amp;gt;  | | | sda6 |-+---+----| drbd1 |--| drbd_an4_vg0 |--| /dev/drbd_an4_vg0/vm0001_1 |&lt;br /&gt;
 |_______|  |___|  |_________| | |______| |   | /--|_______|  |______________|  |____________________________|&lt;br /&gt;
                               |  ______  |   | |     _______    ______________    ____________________________&lt;br /&gt;
                               | | sda7 |-+---+-+----| drbd2 |--| drbd_an5_vg0 |--| /dev/drbd_an5_vg0/vm0002_1 | &lt;br /&gt;
                               | |______| |   | | /--|_______|  |______________|  |____________________________|&lt;br /&gt;
                               |  ______  |   | | |                         | |    _______________________&lt;br /&gt;
                               | | sda8 |-+---+-+-+--\                      | \---| Example LV for 2nd VM |&lt;br /&gt;
                               | |______| |   | | |  |                      |     |_______________________|&lt;br /&gt;
                               |__________|   | | |  |                      |      _______________________&lt;br /&gt;
         [ an-node05 ]                        | | |  |                      \-----| Example LV for 3rd VM |&lt;br /&gt;
  ______   ______    ______     __[sda4]__    | | |  |                            |_______________________|&lt;br /&gt;
 | sda1 | | sda2 |  | sda3 |   |  ______  |   | | |  |                   &lt;br /&gt;
 |______| |______|  |______|   | | sda5 |-+---/ | |  |   _______    __________________&lt;br /&gt;
     |        |         |      | |______| |     | |  \--| drbd3 |--| Spare PV for     |&lt;br /&gt;
  ___|___    _|_    ____|____  |  ______  |     | |  /--|_______|  | future expansion |&lt;br /&gt;
 | /boot |  | / |  | &amp;lt;swap&amp;gt;  | | | sda6 |-+-----/ |  |             |__________________|&lt;br /&gt;
 |_______|  |___|  |_________| | |______| |       |  |&lt;br /&gt;
                               |  ______  |       |  |&lt;br /&gt;
                               | | sda7 |-+-------/  |&lt;br /&gt;
                               | |______| |          |&lt;br /&gt;
                               |  ______  |          |&lt;br /&gt;
                               | | sda8 |-+----------/&lt;br /&gt;
                               | |______| |&lt;br /&gt;
                               |__________|&lt;br /&gt;
.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Modifying the Physical Storage ===&lt;br /&gt;
&lt;br /&gt;
{{warning|1=Multiple assumptions ahead. If you are comfortable &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fdisk&amp;lt;/span&amp;gt; (and possibly &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;mdadm&amp;lt;/span&amp;gt;), you can largely skip this section. You will need to create four partitions; This tutorial uses a &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;10&amp;lt;/span&amp;gt; [[GiB]] for shared files, two &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;100&amp;lt;/span&amp;gt; [[GiB]] and the remainder of the space in the last partition. These will be four extended partitions, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/sda5&amp;lt;/span&amp;gt;, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/sda6&amp;lt;/span&amp;gt;, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/sda7&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/sda8&amp;lt;/span&amp;gt; respectively.}}&lt;br /&gt;
&lt;br /&gt;
This tutorial, in the interest of simplicity and not aiming to be a disk management tutorial, uses single-disk storage on each node. If you only have one disk, or if you have hardware RAID, this is sufficient. However, if you have multiple disks and want to use software RAID on your nodes, you will need to create &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/mdX&amp;lt;/span&amp;gt; devices to match the layout we will be creating. Here is a tutorial on managing software RAID arrays, written with this tutorial in mind.&lt;br /&gt;
&lt;br /&gt;
* [[Managing Software RAID Arrays]]&lt;br /&gt;
&lt;br /&gt;
We will need four new partitions; a &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;10&amp;lt;/span&amp;gt; [[GiB]] partition for the [[GFS2]] resource, two &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;100&amp;lt;/span&amp;gt; [[GiB]] partitions for the VMs on either node and the remainder of the disk&#039;s free space for the last partition. To do this, we will use the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fdisk&amp;lt;/span&amp;gt; tool. Be aware; This tool directly edits the hard drive&#039;s geometry. This is obviously risky! All along, this tutorial has assumed that you are working on test nodes, but it bears repeating again. Do not do this on a machine with data you care about! At the very least, have a good backup.&lt;br /&gt;
&lt;br /&gt;
Finally, this assumes that you used the [[generic_el5_node.ks|kickstart script]] when setting up your nodes. More to the point, it assumes an existing fourth primary partition which we will delete, convert to an extended partition and then within that create the four usable partitions.&lt;br /&gt;
&lt;br /&gt;
{{note|1=This is no longer completely accurate. The new kickstart script above does not create the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/sda4&amp;lt;/span&amp;gt; device any longer. The example remains though to show how to delete a partition, in case it is helpful to some readers.}}&lt;br /&gt;
&lt;br /&gt;
So first, delete the fourth partition.&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;
The number of cylinders for this disk is set to 60801.&lt;br /&gt;
There is nothing wrong with that, but this is larger than 1024,&lt;br /&gt;
and could in certain setups cause problems with:&lt;br /&gt;
1) software that runs at boot time (e.g., old versions of LILO)&lt;br /&gt;
2) booting and partitioning software from other OSs&lt;br /&gt;
   (e.g., DOS FDISK, OS/2 FDISK)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Confirm that the layout is indeed four partitions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Command (m for help): 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;
&lt;br /&gt;
   Device Boot      Start         End      Blocks   Id  System&lt;br /&gt;
/dev/sda1   *           1          32      257008+  83  Linux&lt;br /&gt;
/dev/sda2              33        2643    20972857+  83  Linux&lt;br /&gt;
/dev/sda3            2644        3165     4192965   82  Linux swap / Solaris&lt;br /&gt;
/dev/sda4            3166       60801   462961170   83  Linux&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is, so let&#039;s delete &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/sda4&amp;lt;/span&amp;gt; and then confirm that it is gone.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Command (m for help): d&lt;br /&gt;
Partition number (1-4): 4&lt;br /&gt;
&lt;br /&gt;
Command (m for help): 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;
&lt;br /&gt;
   Device Boot      Start         End      Blocks   Id  System&lt;br /&gt;
/dev/sda1   *           1          32      257008+  83  Linux&lt;br /&gt;
/dev/sda2              33        2643    20972857+  83  Linux&lt;br /&gt;
/dev/sda3            2644        3165     4192965   82  Linux swap / Solaris&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is, so now we&#039;ll create the extended partition.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Command (m for help): n&lt;br /&gt;
Command action&lt;br /&gt;
   e   extended&lt;br /&gt;
   p   primary partition (1-4)&lt;br /&gt;
e&lt;br /&gt;
Selected partition 4&lt;br /&gt;
First cylinder (3166-60801, default 3166): &amp;lt;enter&amp;gt;&lt;br /&gt;
Using default value 3166&lt;br /&gt;
Last cylinder or +size or +sizeM or +sizeK (3166-60801, default 60801): &amp;lt;enter&amp;gt;&lt;br /&gt;
Using default value 60801&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Again, a quick check to make sure the extended partition is now there.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Command (m for help): 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;
&lt;br /&gt;
   Device Boot      Start         End      Blocks   Id  System&lt;br /&gt;
/dev/sda1   *           1          32      257008+  83  Linux&lt;br /&gt;
/dev/sda2              33        2643    20972857+  83  Linux&lt;br /&gt;
/dev/sda3            2644        3165     4192965   82  Linux swap / Solaris&lt;br /&gt;
/dev/sda4            3166       60801   462961170    5  Extended&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Finally, let&#039;s create the four partitions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Command (m for help): n&lt;br /&gt;
First cylinder (3166-60801, default 3166): &lt;br /&gt;
Using default value 3166&lt;br /&gt;
Last cylinder or +size or +sizeM or +sizeK (3166-60801, default 60801): +10G&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;
Command (m for help): n&lt;br /&gt;
First cylinder (4383-60801, default 4383): &amp;lt;enter&amp;gt;&lt;br /&gt;
Using default value 4383&lt;br /&gt;
Last cylinder or +size or +sizeM or +sizeK (4383-60801, default 60801): +100G&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;
Command (m for help): n&lt;br /&gt;
First cylinder (16542-60801, default 16542): &amp;lt;enter&amp;gt;&lt;br /&gt;
Using default value 16542&lt;br /&gt;
Last cylinder or +size or +sizeM or +sizeK (16542-60801, default 60801): +100G&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;
Command (m for help): n&lt;br /&gt;
First cylinder (28701-60801, default 28701): &amp;lt;enter&amp;gt;&lt;br /&gt;
Using default value 28701&lt;br /&gt;
Last cylinder or +size or +sizeM or +sizeK (28701-60801, default 60801): &amp;lt;enter&amp;gt;&lt;br /&gt;
Using default value 60801&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Finally, check that the four new partitions exist.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Command (m for help): 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;
&lt;br /&gt;
   Device Boot      Start         End      Blocks   Id  System&lt;br /&gt;
/dev/sda1   *           1          32      257008+  83  Linux&lt;br /&gt;
/dev/sda2              33        2643    20972857+  83  Linux&lt;br /&gt;
/dev/sda3            2644        3165     4192965   82  Linux swap / Solaris&lt;br /&gt;
/dev/sda4            3166       60801   462961170    5  Extended&lt;br /&gt;
/dev/sda5            3166        4382     9775521   83  Linux&lt;br /&gt;
/dev/sda6            4383       16541    97667136   83  Linux&lt;br /&gt;
/dev/sda7           16542       28700    97667136   83  Linux&lt;br /&gt;
/dev/sda8           28701       60801   257851251   83  Linux&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We do! So now we&#039;ll commit the changes to disk and exit.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Command (m for help): 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.&lt;br /&gt;
The new table will be used at the next reboot.&lt;br /&gt;
Syncing disks.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{warning|1=Repeat the steps on the other node and double-check that the output of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fdisk -l /dev/sda&amp;lt;/span&amp;gt; shows the same &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Start&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;End&amp;lt;/span&amp;gt; boundaries. &#039;&#039;If they do not match, fix it before proceeding&#039;&#039;.}}&lt;br /&gt;
&lt;br /&gt;
{{note|1=This was done on the same disk as the host OS, so we&#039;ll need to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;reboot&amp;lt;/span&amp;gt; before we can proceed.}}&lt;br /&gt;
&lt;br /&gt;
== Creating the DRBD Resources ==&lt;br /&gt;
&lt;br /&gt;
Now that we have either node&#039;s storage ready, we can configure and start the DRBD resources. DRBD has &amp;quot;resource names&amp;quot;, which is it&#039;s internal reference to the &amp;quot;array&amp;quot;. These names are used whenever you are working on the resource using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;drbdadm&amp;lt;/span&amp;gt; or similar tools. The tradition is to name the resources as &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rX&amp;lt;/span&amp;gt;, with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;X&amp;lt;/span&amp;gt; being a sequence number starting at &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;0&amp;lt;/span&amp;gt;. The resource itself is made available as a normal &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/&amp;lt;/span&amp;gt; block device. The tradition is to name this device &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/drbdX&amp;lt;/span&amp;gt; where &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;X&amp;lt;/span&amp;gt; matches the resource&#039;s sequence number.&lt;br /&gt;
&lt;br /&gt;
=== The DRBD Fence Script ===&lt;br /&gt;
&lt;br /&gt;
{{warning|1=There is a problem with the current [[Node Assassin]] fence agent where multiple simultaneous fence calls will fail to return a success after each fence call. Until this is resolved, you will need to disable &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;outdate-peer&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fencing&amp;lt;/span&amp;gt; in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/drbd.conf&amp;lt;/span&amp;gt; by commenting out the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;disk { }&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;handler { }&amp;lt;/span&amp;gt; blocks in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;common { }&amp;lt;/span&amp;gt;.}}&lt;br /&gt;
&lt;br /&gt;
Red Hat&#039;s [http://people.redhat.com/lhh/ Lon Hohberger] created a DRBD script called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[obliterate]]&amp;lt;/span&amp;gt;, which was later updated to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[obliterate-peer.sh]]&amp;lt;/span&amp;gt;, that allows DRBD to trigger a fence call through the cluster when it detects a split-brain condition. The goal behind this is to stop the resource(s) from being flagged as &amp;quot;split-brain&amp;quot; in the first place, thus avoiding manual recovery. We will be using the newer &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[obliterate-peer.sh]]&amp;lt;/span&amp;gt; script. The difference between the two scripts is that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[obliterate]]&amp;lt;/span&amp;gt; will try to fence once only, where &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[obliterate-peer.sh]]&amp;lt;/span&amp;gt; will continue to fence until it succeeds. The former will block DRBD if it fails, which is not good.&lt;br /&gt;
&lt;br /&gt;
Download the script below and save it under your &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/sbin/&amp;lt;/span&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/sbin/[[obliterate-peer.sh]]&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then ensure that it is executable.&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/sbin/obliterate-peer.sh -O /sbin/obliterate-peer.sh&lt;br /&gt;
chmod a+x /sbin/obliterate-peer.sh&lt;br /&gt;
ls -lah /sbin/obliterate-peer.sh &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
-rw-r--r-- 1 root root 2.1K May  4 14:31 /sbin/obliterate-peer.sh&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Our Desired Layout in Detail ===&lt;br /&gt;
&lt;br /&gt;
Let&#039;s review how we will bring the devices together.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt;&lt;br /&gt;
!&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt;&lt;br /&gt;
!DRBD Resource&lt;br /&gt;
!DRBD Device&lt;br /&gt;
!Size&lt;br /&gt;
!Note&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/sda5&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/sda5&amp;lt;/span&amp;gt;&lt;br /&gt;
|style=&amp;quot;text-align: center;&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;r0&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/drbd0&amp;lt;/span&amp;gt;&lt;br /&gt;
|style=&amp;quot;white-space: nowrap; text-align: center;&amp;quot;|10 [[GB]]&lt;br /&gt;
|[[GFS2]] partition for VM configurations and shared files&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/sda6&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/sda6&amp;lt;/span&amp;gt;&lt;br /&gt;
|style=&amp;quot;text-align: center;&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;r1&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/drbd1&amp;lt;/span&amp;gt;&lt;br /&gt;
|style=&amp;quot;white-space: nowrap; text-align: center;&amp;quot;|100 [[GB]]&lt;br /&gt;
|Host VMs that will primarily run on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/sda7&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/sda7&amp;lt;/span&amp;gt;&lt;br /&gt;
|style=&amp;quot;text-align: center;&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;r2&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/drbd2&amp;lt;/span&amp;gt;&lt;br /&gt;
|style=&amp;quot;white-space: nowrap; text-align: center;&amp;quot;|100 [[GB]]&lt;br /&gt;
|Host VMs that will primarily run on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/sda8&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/sda8&amp;lt;/span&amp;gt;&lt;br /&gt;
|style=&amp;quot;text-align: center;&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;r3&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/drbd3&amp;lt;/span&amp;gt;&lt;br /&gt;
|style=&amp;quot;white-space: nowrap;&amp;quot;|&lt;br /&gt;
|Free space that can later be allocated to an existing [[VG]] as-is or further divided up into two or more DRBD resources as future needs dictate.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Configuring /etc/drbd.conf ===&lt;br /&gt;
&lt;br /&gt;
With this plan then, we can now create the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/drbd.conf&amp;lt;/span&amp;gt; configuration file.&lt;br /&gt;
&lt;br /&gt;
The initial file is very sparse;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/drbd.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;
#&lt;br /&gt;
# please have a a look at the example configuration file in&lt;br /&gt;
# /usr/share/doc/drbd83/drbd.conf&lt;br /&gt;
#&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Setting up the &#039;global&#039; Directive ====&lt;br /&gt;
&lt;br /&gt;
There are a lot of options available to you, many of which are outside the scope of this tutorial. You can get a good overview of all option by reading the man page; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;man drbd.conf&amp;lt;/span&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
The first section we will add is the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;global { }&amp;lt;/span&amp;gt; directive. There is only one argument we will set, which tells DRBD that it can count our install in the Linbit user information. If you have privacy concerns, set this to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;no&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;
# The &#039;global&#039; directive covers values that apply to RBD in general.&lt;br /&gt;
global {&lt;br /&gt;
        # This tells Linbit that it&#039;s okay to count us as a DRBD user. If you&lt;br /&gt;
        # have privacy concerns, set this to &#039;no&#039;.&lt;br /&gt;
        usage-count     yes;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Setting up the &#039;common&#039; Directive ====&lt;br /&gt;
&lt;br /&gt;
The next directive is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;common { }&amp;lt;/span&amp;gt;. This sets values to be used on all DRBD resources by default. You can override &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;common&amp;lt;/span&amp;gt; values in any given resource directive later. &lt;br /&gt;
&lt;br /&gt;
The example below is well documented, so please take a moment to look at the example for &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;
# The &#039;common&#039; directive sets defaults values for all resources.&lt;br /&gt;
common {&lt;br /&gt;
        # Protocol &#039;C&#039; tells DRBD to not report a disk write as complete until&lt;br /&gt;
        # it has been confirmed written to both nodes. This is required for&lt;br /&gt;
        # Primary/Primary use.&lt;br /&gt;
        protocol C;&lt;br /&gt;
&lt;br /&gt;
        # This sets the default sync rate to 15 MiB/sec. Be careful about&lt;br /&gt;
        # setting this too high! High speed sync&#039;ing can flog your drives and&lt;br /&gt;
        # push disk I/O times very high.&lt;br /&gt;
        syncer {&lt;br /&gt;
                rate 15M;&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        # This tells DRBD what policy to use when a fence is required.&lt;br /&gt;
        disk {&lt;br /&gt;
                # This tells DRBD to block I/O (resource) and then try to fence&lt;br /&gt;
                # the other node (stonith). The &#039;stonith&#039; option requires that&lt;br /&gt;
                # we set a fence handler below. The name &#039;stonith&#039; comes from&lt;br /&gt;
                # &amp;quot;Shoot The Other Nide In The Head&amp;quot; and is a term used in&lt;br /&gt;
                # other clustering environments. It is synonomous with with&lt;br /&gt;
                # &#039;fence&#039;.&lt;br /&gt;
                fencing         resource-and-stonith;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        # We set &#039;stonith&#039; above, so here we tell DRBD how to actually fence&lt;br /&gt;
        # the other node.&lt;br /&gt;
        handlers {&lt;br /&gt;
                # The term &#039;outdate-peer&#039; comes from other scripts that flag&lt;br /&gt;
                # the other node&#039;s resource backing device as &#039;Inconsistent&#039;.&lt;br /&gt;
                # In our case though, we&#039;re flat-out fencing the other node,&lt;br /&gt;
                # which has the same effective result.&lt;br /&gt;
                outdate-peer    &amp;quot;/sbin/obliterate-peer.sh&amp;quot;;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        # Here we tell DRBD that we want to use Primary/Primary mode. It is&lt;br /&gt;
        # also where we define split-brain (sb) recovery policies. As we&#039;ll be&lt;br /&gt;
        # running all of our resources in Primary/Primary, only the&lt;br /&gt;
        # &#039;after-sb-2pri&#039; really means anything to us.&lt;br /&gt;
        net {&lt;br /&gt;
                # Tell DRBD to allow dual-primary.&lt;br /&gt;
                allow-two-primaries;&lt;br /&gt;
&lt;br /&gt;
                # Set the recover policy for split-brain recover when no device&lt;br /&gt;
                # in the resource was primary.&lt;br /&gt;
                after-sb-0pri   discard-zero-changes;&lt;br /&gt;
&lt;br /&gt;
                # Now if one device was primary.&lt;br /&gt;
                after-sb-1pri   discard-secondary;&lt;br /&gt;
&lt;br /&gt;
                # Finally, set the policy when both nodes were Primary. The&lt;br /&gt;
                # only viable option is &#039;disconnect&#039;, which tells DRBD to&lt;br /&gt;
                # simply tear-down the DRBD resource right away and wait for&lt;br /&gt;
                # the administrator to manually invalidate one side of the&lt;br /&gt;
                # resource.&lt;br /&gt;
                after-sb-2pri   disconnect;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        # This tells DRBD what to do when the resource starts.&lt;br /&gt;
        startup {&lt;br /&gt;
                # In our case, we&#039;re telling DRBD to promote both devices in&lt;br /&gt;
                # our resource to Primary on start.&lt;br /&gt;
                become-primary-on       both;&lt;br /&gt;
        }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Let&#039;s stop for a moment and talk about DRBD synchronization. &lt;br /&gt;
&lt;br /&gt;
A DRBD resource does &#039;&#039;&#039;not&#039;&#039;&#039; have to be synced before it can be made &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Primary/Primary&amp;lt;/span&amp;gt;. For this reason, the default sync rate for DRBD is very, very low (320 [[KiB]]/sec). This means that you can normally start your DRBD in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Primary/Primary&amp;lt;/span&amp;gt; on both nodes and get to work while the synchronization putters along in the background.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;However&#039;&#039;!&lt;br /&gt;
&lt;br /&gt;
If the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;UpToDate&amp;lt;/span&amp;gt; node goes down, the surviving &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Inconsistent&amp;lt;/span&amp;gt; node will demote to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Secondary&amp;lt;/span&amp;gt;, thus becoming unusable. In a high-availability environment like ours, this is pretty useless. So for this reason we will want to get the resources in sync as fast as possible. Likewise, while a node is sync&#039;ing, we will not be able to run the VMs on the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Inconsistent&amp;lt;/span&amp;gt; node.&lt;br /&gt;
&lt;br /&gt;
The temptation then is to set &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rate&amp;lt;/span&amp;gt; above to the maximum write speed of our disks. &#039;&#039;This is a bad idea&#039;&#039;!&lt;br /&gt;
&lt;br /&gt;
We will have four separate resources sharing the same underlying disks. If you drive the sync rate very high, and I/O on the other &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;UpToDate&amp;lt;/span&amp;gt; resources will be severely impacted. So much so that I&#039;ve seen crashes caused by this. So you will want to keep this value at a sane level. That is, you will want to set the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rate&amp;lt;/span&amp;gt; to as high as you can while still leaving the disks themselves sufficiently unbound that other I/O is still feasible. I&#039;ve personally found &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;15M&amp;lt;/span&amp;gt; on single-drive and simple RAID machines to be a good value. Feel free to experiment for yourself.&lt;br /&gt;
&lt;br /&gt;
==== Setting up the Resource Directives ====&lt;br /&gt;
&lt;br /&gt;
We now define the resources themselves. Each resource will be contained in a directive called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;resource x&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 actual resource name (&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;r0&amp;lt;/span&amp;gt;, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;r1&amp;lt;/span&amp;gt;, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;r2&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;r3&amp;lt;/span&amp;gt; in our case). Within this directive, all resource-specific options are set.&lt;br /&gt;
&lt;br /&gt;
The example below is well documented, so please take a moment to look at the example for &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;
# The &#039;resource&#039; directive defines a given resource and must be followed by the&lt;br /&gt;
# resource&#039;s name.&lt;br /&gt;
# This will be used as the GFS2 partition for shared files.&lt;br /&gt;
resource r0 {&lt;br /&gt;
        # This is the /dev/ device to create to make available this DRBD&lt;br /&gt;
        # resource.&lt;br /&gt;
        device          /dev/drbd0;&lt;br /&gt;
&lt;br /&gt;
        # This tells DRBD where to store it&#039;s internal state information. We&lt;br /&gt;
        # will use &#039;internal&#039;, which tells DRBD to store the information at the&lt;br /&gt;
        # end of the resource&#039;s space.&lt;br /&gt;
        meta-disk       internal;&lt;br /&gt;
&lt;br /&gt;
        # The next two &#039;on&#039; directives setup each individual node&#039;s settings.&lt;br /&gt;
        # The value after the &#039;on&#039; directive *MUST* match the output of&lt;br /&gt;
        # `uname -n` on each node.&lt;br /&gt;
        on an-node04.alteeve.com {&lt;br /&gt;
                # This is the network IP address on the network interface and&lt;br /&gt;
                # the TCP port to use for communication between the nodes. Note&lt;br /&gt;
                # that the IP address below in on our Storage Network. The TCP&lt;br /&gt;
                # port must be unique per resource, but the interface itself&lt;br /&gt;
                # can be shared. &lt;br /&gt;
                # IPv6 is usable with &#039;address ipv6 [address]:port&#039;.&lt;br /&gt;
                address         192.168.2.74:7789;&lt;br /&gt;
&lt;br /&gt;
                # This is the node&#039;s storage device that will back this&lt;br /&gt;
                # resource.&lt;br /&gt;
                disk            /dev/sda5;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        # Same as above, but altered to reflect the second node.&lt;br /&gt;
        on an-node05.alteeve.com {&lt;br /&gt;
                address         192.168.2.75:7789;&lt;br /&gt;
                disk            /dev/sda5;&lt;br /&gt;
        }&lt;br /&gt;
}&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;r1&amp;lt;/span&amp;gt;, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;r2&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;r3&amp;lt;/span&amp;gt; resources should be nearly identical to the example above. The main difference will the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;device&amp;lt;/span&amp;gt; value and within each node&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;on x { }&amp;lt;/span&amp;gt; directive. We will incrementing the [[TCP]] ports to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;7790&amp;lt;/span&amp;gt;, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;7791&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;7792&amp;lt;/span&amp;gt; respectively. Likewise, we will need to alter the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;disk&amp;lt;/span&amp;gt; to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/sda6&amp;lt;/span&amp;gt;, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/sda7&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/sda8&amp;lt;/span&amp;gt; respectively. Finally, the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;device&amp;lt;/span&amp;gt; will be incremented to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/drbd1&amp;lt;/span&amp;gt;, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/drbd2&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/drbd3&amp;lt;/span&amp;gt; respectively.&lt;br /&gt;
&lt;br /&gt;
=== Housekeeping Before Starting Our DRBD Resources ===&lt;br /&gt;
&lt;br /&gt;
Let&#039;s take a look at the complete &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/drbd.conf&amp;lt;/span&amp;gt; file, validate it for use and then push it to the second node.&lt;br /&gt;
&lt;br /&gt;
==== The Finished /etc/drbd.conf File ====&lt;br /&gt;
&lt;br /&gt;
The finished &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/drbd.conf&amp;lt;/span&amp;gt; file should look for or less like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
#&lt;br /&gt;
# please have a a look at the example configuration file in&lt;br /&gt;
# /usr/share/doc/drbd83/drbd.conf&lt;br /&gt;
#&lt;br /&gt;
&lt;br /&gt;
# The &#039;global&#039; directive covers values that apply to RBD in general.&lt;br /&gt;
global {&lt;br /&gt;
	# This tells Linbit that it&#039;s okay to count us as a DRBD user. If you&lt;br /&gt;
	# have privacy concerns, set this to &#039;no&#039;.&lt;br /&gt;
	usage-count	yes;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
# The &#039;common&#039; directive sets defaults values for all resources.&lt;br /&gt;
common {&lt;br /&gt;
	# Protocol &#039;C&#039; tells DRBD to not report a disk write as complete until&lt;br /&gt;
	# it has been confirmed written to both nodes. This is required for&lt;br /&gt;
	# Primary/Primary use.&lt;br /&gt;
        protocol	C;&lt;br /&gt;
&lt;br /&gt;
	# This sets the default sync rate to 15 MiB/sec. Be careful about&lt;br /&gt;
	# setting this too high! High speed sync&#039;ing can flog your drives and&lt;br /&gt;
	# push disk I/O times very high.&lt;br /&gt;
        syncer {&lt;br /&gt;
                rate	15M;&lt;br /&gt;
        }&lt;br /&gt;
	&lt;br /&gt;
	# This tells DRBD what policy to use when a fence is required.&lt;br /&gt;
        disk {&lt;br /&gt;
		# This tells DRBD to block I/O (resource) and then try to fence&lt;br /&gt;
		# the other node (stonith). The &#039;stonith&#039; option requires that&lt;br /&gt;
		# we set a fence handler below. The name &#039;stonith&#039; comes from&lt;br /&gt;
		# &amp;quot;Shoot The Other Nide In The Head&amp;quot; and is a term used in&lt;br /&gt;
		# other clustering environments. It is synonomous with with&lt;br /&gt;
		# &#039;fence&#039;.&lt;br /&gt;
                fencing		resource-and-stonith;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
	# We set &#039;stonith&#039; above, so here we tell DRBD how to actually fence&lt;br /&gt;
	# the other node.&lt;br /&gt;
        handlers {&lt;br /&gt;
		# The term &#039;outdate-peer&#039; comes from other scripts that flag&lt;br /&gt;
		# the other node&#039;s resource backing device as &#039;Inconsistent&#039;.&lt;br /&gt;
		# In our case though, we&#039;re flat-out fencing the other node,&lt;br /&gt;
		# which has the same effective result.&lt;br /&gt;
                outdate-peer	&amp;quot;/sbin/obliterate-peer.sh&amp;quot;;&lt;br /&gt;
        }&lt;br /&gt;
	&lt;br /&gt;
	# Here we tell DRBD that we want to use Primary/Primary mode. It is&lt;br /&gt;
	# also where we define split-brain (sb) recovery policies. As we&#039;ll be&lt;br /&gt;
	# running all of our resources in Primary/Primary, only the&lt;br /&gt;
	# &#039;after-sb-2pri&#039; really means anything to us.&lt;br /&gt;
        net {&lt;br /&gt;
		# Tell DRBD to allow dual-primary.&lt;br /&gt;
                allow-two-primaries;&lt;br /&gt;
&lt;br /&gt;
		# Set the recover policy for split-brain recover when no device&lt;br /&gt;
		# in the resource was primary.&lt;br /&gt;
                after-sb-0pri	discard-zero-changes;&lt;br /&gt;
&lt;br /&gt;
		# Now if one device was primary.&lt;br /&gt;
                after-sb-1pri	discard-secondary;&lt;br /&gt;
&lt;br /&gt;
		# Finally, set the policy when both nodes were Primary. The&lt;br /&gt;
		# only viable option is &#039;disconnect&#039;, which tells DRBD to&lt;br /&gt;
		# simply tear-down the DRBD resource right away and wait for&lt;br /&gt;
		# the administrator to manually invalidate one side of the&lt;br /&gt;
		# resource.&lt;br /&gt;
                after-sb-2pri	disconnect;&lt;br /&gt;
        }&lt;br /&gt;
	&lt;br /&gt;
	# This tells DRBD what to do when the resource starts.&lt;br /&gt;
        startup {&lt;br /&gt;
		# In our case, we&#039;re telling DRBD to promote both devices in&lt;br /&gt;
		# our resource to Primary on start.&lt;br /&gt;
                become-primary-on 	both;&lt;br /&gt;
        }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
# The &#039;resource&#039; directive defines a given resource and must be followed by the&lt;br /&gt;
# resource&#039;s name.&lt;br /&gt;
# This will be used as the GFS2 partition for shared files.&lt;br /&gt;
resource r0 {&lt;br /&gt;
	# This is the /dev/ device to create to make available this DRBD&lt;br /&gt;
	# resource.&lt;br /&gt;
        device 		/dev/drbd0;&lt;br /&gt;
	&lt;br /&gt;
	# This tells DRBD where to store it&#039;s internal state information. We&lt;br /&gt;
	# will use &#039;internal&#039;, which tells DRBD to store the information at the&lt;br /&gt;
	# end of the resource&#039;s space.&lt;br /&gt;
        meta-disk 	internal;&lt;br /&gt;
	&lt;br /&gt;
	# The next two &#039;on&#039; directives setup each individual node&#039;s settings.&lt;br /&gt;
	# The value after the &#039;on&#039; directive *MUST* match the output of&lt;br /&gt;
	# `uname -n` on each node.&lt;br /&gt;
        on an-node04.alteeve.com {&lt;br /&gt;
		# This is the network IP address on the network interface and&lt;br /&gt;
		# the TCP port to use for communication between the nodes. Note&lt;br /&gt;
		# that the IP address below in on our Storage Network. The TCP&lt;br /&gt;
		# port must be unique per resource, but the interface itself&lt;br /&gt;
		# can be shared. &lt;br /&gt;
		# IPv6 is usable with &#039;address ipv6 [address]:port&#039;.&lt;br /&gt;
                address 	192.168.2.74:7789;&lt;br /&gt;
		&lt;br /&gt;
		# This is the node&#039;s storage device that will back this&lt;br /&gt;
		# resource.&lt;br /&gt;
                disk    	/dev/sda5;&lt;br /&gt;
        }&lt;br /&gt;
	&lt;br /&gt;
	# Same as above, but altered to reflect the second node.&lt;br /&gt;
        on an-node05.alteeve.com {&lt;br /&gt;
                address 	192.168.2.75:7789;&lt;br /&gt;
                disk    	/dev/sda5;&lt;br /&gt;
        }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
# This will be used to host VMs running primarily on an-node04.&lt;br /&gt;
resource r1 {&lt;br /&gt;
        device          /dev/drbd1;&lt;br /&gt;
&lt;br /&gt;
        meta-disk       internal;&lt;br /&gt;
&lt;br /&gt;
        on an-node04.alteeve.com {&lt;br /&gt;
                address         192.168.2.74:7790;&lt;br /&gt;
                disk            /dev/sda6;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        on an-node05.alteeve.com {&lt;br /&gt;
                address         192.168.2.75:7790;&lt;br /&gt;
                disk            /dev/sda6;&lt;br /&gt;
        }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
# This will be used to host VMs running primarily on an-node05.&lt;br /&gt;
resource r2 {&lt;br /&gt;
        device          /dev/drbd2;&lt;br /&gt;
&lt;br /&gt;
        meta-disk       internal;&lt;br /&gt;
&lt;br /&gt;
        on an-node04.alteeve.com {&lt;br /&gt;
                address         192.168.2.74:7791;&lt;br /&gt;
                disk            /dev/sda7;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        on an-node05.alteeve.com {&lt;br /&gt;
                address         192.168.2.75:7791;&lt;br /&gt;
                disk            /dev/sda7;&lt;br /&gt;
        }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
# This will be set aside as free space for future expansion.&lt;br /&gt;
resource r3 {&lt;br /&gt;
        device          /dev/drbd3;&lt;br /&gt;
&lt;br /&gt;
        meta-disk       internal;&lt;br /&gt;
&lt;br /&gt;
        on an-node04.alteeve.com {&lt;br /&gt;
                address         192.168.2.74:7792;&lt;br /&gt;
                disk            /dev/sda8;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        on an-node05.alteeve.com {&lt;br /&gt;
                address         192.168.2.75:7792;&lt;br /&gt;
                disk            /dev/sda8;&lt;br /&gt;
        }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Validating the /etc/drbd.conf Syntax ====&lt;br /&gt;
&lt;br /&gt;
To check for errors, we will validate the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/drbd.conf&amp;lt;/span&amp;gt; file. To do this, run &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;drbdadm dump&amp;lt;/span&amp;gt;. If there are syntactical errors, fix them before proceeding. Once the file is correct, it will be dump it&#039;s view of the configuration to the screen with minimal commenting. Don&#039;t worry about slight differences (ie: &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;meta-disk external;&amp;lt;/span&amp;gt; being inside the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;on { }&amp;lt;/span&amp;gt; directives).&lt;br /&gt;
&lt;br /&gt;
The first time you ever do this, you will also see a note telling you that you are the &#039;&#039;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;n&amp;lt;/span&amp;gt;&#039;&#039;th DRBD user.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
drbdadm dump&lt;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 9369th user to install this version&lt;br /&gt;
# /etc/drbd.conf&lt;br /&gt;
common {&lt;br /&gt;
    protocol               C;&lt;br /&gt;
    net {&lt;br /&gt;
        allow-two-primaries;&lt;br /&gt;
        after-sb-0pri    discard-zero-changes;&lt;br /&gt;
        after-sb-1pri    discard-secondary;&lt;br /&gt;
        after-sb-2pri    disconnect;&lt;br /&gt;
    }&lt;br /&gt;
    disk {&lt;br /&gt;
        fencing          resource-and-stonith;&lt;br /&gt;
    }&lt;br /&gt;
    syncer {&lt;br /&gt;
        rate             15M;&lt;br /&gt;
    }&lt;br /&gt;
    startup {&lt;br /&gt;
        become-primary-on both;&lt;br /&gt;
    }&lt;br /&gt;
    handlers {&lt;br /&gt;
        fence-peer       /sbin/obliterate-peer.sh;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
# resource r0 on an-node04.alteeve.com: not ignored, not stacked&lt;br /&gt;
resource r0 {&lt;br /&gt;
    on an-node04.alteeve.com {&lt;br /&gt;
        device           /dev/drbd0 minor 0;&lt;br /&gt;
        disk             /dev/sda5;&lt;br /&gt;
        address          ipv4 192.168.2.74:7789;&lt;br /&gt;
        meta-disk        internal;&lt;br /&gt;
    }&lt;br /&gt;
    on an-node05.alteeve.com {&lt;br /&gt;
        device           /dev/drbd0 minor 0;&lt;br /&gt;
        disk             /dev/sda5;&lt;br /&gt;
        address          ipv4 192.168.2.75:7789;&lt;br /&gt;
        meta-disk        internal;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
# resource r1 on an-node04.alteeve.com: not ignored, not stacked&lt;br /&gt;
resource r1 {&lt;br /&gt;
    on an-node04.alteeve.com {&lt;br /&gt;
        device           /dev/drbd1 minor 1;&lt;br /&gt;
        disk             /dev/sda6;&lt;br /&gt;
        address          ipv4 192.168.2.74:7790;&lt;br /&gt;
        meta-disk        internal;&lt;br /&gt;
    }&lt;br /&gt;
    on an-node05.alteeve.com {&lt;br /&gt;
        device           /dev/drbd1 minor 1;&lt;br /&gt;
        disk             /dev/sda6;&lt;br /&gt;
        address          ipv4 192.168.2.75:7790;&lt;br /&gt;
        meta-disk        internal;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
# resource r2 on an-node04.alteeve.com: not ignored, not stacked&lt;br /&gt;
resource r2 {&lt;br /&gt;
    on an-node04.alteeve.com {&lt;br /&gt;
        device           /dev/drbd2 minor 2;&lt;br /&gt;
        disk             /dev/sda7;&lt;br /&gt;
        address          ipv4 192.168.2.74:7791;&lt;br /&gt;
        meta-disk        internal;&lt;br /&gt;
    }&lt;br /&gt;
    on an-node05.alteeve.com {&lt;br /&gt;
        device           /dev/drbd2 minor 2;&lt;br /&gt;
        disk             /dev/sda7;&lt;br /&gt;
        address          ipv4 192.168.2.75:7791;&lt;br /&gt;
        meta-disk        internal;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
# resource r3 on an-node04.alteeve.com: not ignored, not stacked&lt;br /&gt;
resource r3 {&lt;br /&gt;
    on an-node04.alteeve.com {&lt;br /&gt;
        device           /dev/drbd3 minor 3;&lt;br /&gt;
        disk             /dev/sda8;&lt;br /&gt;
        address          ipv4 192.168.2.74:7792;&lt;br /&gt;
        meta-disk        internal;&lt;br /&gt;
    }&lt;br /&gt;
    on an-node05.alteeve.com {&lt;br /&gt;
        device           /dev/drbd3 minor 3;&lt;br /&gt;
        disk             /dev/sda8;&lt;br /&gt;
        address          ipv4 192.168.2.75:7792;&lt;br /&gt;
        meta-disk        internal;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Copying The /etc/drbd.conf to the Second Node ====&lt;br /&gt;
&lt;br /&gt;
Assuming you write the first &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/drbd.conf&amp;lt;/span&amp;gt; file on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt;. So now we need to copy it to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt; before we can start things up.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
rsync -av /etc/drbd.conf root@an-node05:/etc/&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
building file list ... done&lt;br /&gt;
drbd.conf&lt;br /&gt;
&lt;br /&gt;
sent 5577 bytes  received 48 bytes  3750.00 bytes/sec&lt;br /&gt;
total size is 5479  speedup is 0.97&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Loading the DRBD Module ===&lt;br /&gt;
&lt;br /&gt;
By default, the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/init.d/drbd&amp;lt;/span&amp;gt; initialization script handles loading and unloading the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;drbd&amp;lt;/span&amp;gt; module. It&#039;s too early for us to start the DRBD resources using the initialization script, so we need to manually load the module ourselves. This will only need to be done once. After you get the DRBD resources up for the first time, you can safely use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/init.d/drbd&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
To load the module, run:&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;
You can verify that the module is loaded using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;lsmod&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;
lsmod |grep 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;
drbd                  277144  0 &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The module also creates a &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/proc&amp;lt;/span&amp;gt; file called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;drbd&amp;lt;/span&amp;gt;. By &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cat&amp;lt;/span&amp;gt;&#039;ing this, we can watch the progress of our work. I&#039;d recommend opening a terminal windows for each node and tracking it using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;watch&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;
watch cat /proc/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;
Every 2.0s: cat /proc/drbd                                                                     Tue Mar 29 13:03:44 2011&lt;br /&gt;
&lt;br /&gt;
version: 8.3.8 (api:88/proto:86-94)&lt;br /&gt;
GIT-hash: d78846e52224fd00562f7c225bcc25b2d422321d build by mockbuild@builder10.centos.org, 2010-06-04 08:04:27&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the steps ahead, I will show what the output from &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;watch&amp;lt;/span&amp;gt;&#039;ing &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/proc/drbd&amp;lt;/span&amp;gt; will be.&lt;br /&gt;
&lt;br /&gt;
=== Initializing Our Resources ===&lt;br /&gt;
&lt;br /&gt;
Before we can start each resource, we must first initialize each of the backing device. This is done by running &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;drbdadm create-md x&amp;lt;/span&amp;gt;. We&#039;ll run this on both nodes, replacing &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;x&amp;lt;/span&amp;gt; with the four resource names.&lt;br /&gt;
&lt;br /&gt;
The first time you do this, the command will execute right away.&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;
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;
If you&#039;ve ever used the partition in a DRBD device before though, you will need to confirm that you want to over-write the existing meta-data.&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;
&lt;br /&gt;
Type &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;yes&amp;lt;/span&amp;gt; when prompted.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
You want me to create a v08 style flexible-size internal meta data block.&lt;br /&gt;
There appears to be a v08 flexible-size internal meta data block&lt;br /&gt;
already in place on /dev/sda5 at byte offset 10010128384&lt;br /&gt;
Do you really want to overwrite the existing v08 meta-data?&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
[need to type &#039;yes&#039; to confirm] yes&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&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;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Repeat for all four resource names, then do the same on the other node.&lt;br /&gt;
&lt;br /&gt;
{{note|1=If you are trying to initialize a resource&#039;s backing device that has been used before, you may need to wipe out the first few blocks.}}&lt;br /&gt;
&lt;br /&gt;
If you try to initialize the resource&#039;s backing device and get an error like below, you will need to &amp;quot;zero out&amp;quot; the first bit of the resource. This is done by using the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;dd&amp;lt;/span&amp;gt; (disk duplication) program, reading in from the special &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/zero&amp;lt;/span&amp;gt; file and writing out a set number of block (usually 4096 [[KiB]]) at the start of the DRBD resource.&lt;br /&gt;
&lt;br /&gt;
If you see the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
pvs stderr:        _undo_flock /var/lock/lvm/V_drbd_sh0_vg0&lt;br /&gt;
pvs stderr:  Skipping volume group drbd_sh0_vg0&lt;br /&gt;
pvs stderr:      Unlocking /var/lock/lvm/P_global&lt;br /&gt;
pvs stderr:        _undo_flock /var/lock/lvm/P_global&lt;br /&gt;
&lt;br /&gt;
md_offset 10010128384&lt;br /&gt;
al_offset 10010095616&lt;br /&gt;
bm_offset 10009788416&lt;br /&gt;
&lt;br /&gt;
Found LVM2 physical volume signature&lt;br /&gt;
     9775184 kB left usable by current configuration&lt;br /&gt;
Could not determine the size of the actually used data area.&lt;br /&gt;
&lt;br /&gt;
Device size would be truncated, which&lt;br /&gt;
would corrupt data and result in&lt;br /&gt;
&#039;access beyond end of device&#039; errors.&lt;br /&gt;
If you want me to do this, you need to zero out the first part&lt;br /&gt;
of the device (destroy the content).&lt;br /&gt;
You should be very sure that you mean it.&lt;br /&gt;
Operation refused.&lt;br /&gt;
&lt;br /&gt;
Command &#039;drbdmeta 0 v08 /dev/sda5 internal create-md&#039; terminated with exit code 40&lt;br /&gt;
drbdadm create-md r0: exited with code 40&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then you will need to zero the start of the backing device.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
dd if=/dev/zero of=/dev/sda5 count=10000&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
10000+0 records in&lt;br /&gt;
10000+0 records out&lt;br /&gt;
5120000 bytes (5.1 MB) copied, 0.101682 seconds, 50.4 MB/s&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You should now be able to initialize the resource.&lt;br /&gt;
&lt;br /&gt;
=== Initial Connections ===&lt;br /&gt;
&lt;br /&gt;
As this is the first time that the DRBD resource will be started, neither side will be in a &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;consistent&amp;lt;/span&amp;gt; state. The effect is that we will not be able to promote either node to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Primary&amp;lt;/span&amp;gt;. So we need to tell DRBD that it must consider one side to be valid and, thus, overwrite the other node&#039;s data.&lt;br /&gt;
&lt;br /&gt;
{{note|1=This is the &#039;&#039;&#039;only&#039;&#039;&#039; time you should ever use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--overwrite-data-of-peer&amp;lt;/span&amp;gt;! Never use it to recover from a split brain.}}&lt;br /&gt;
&lt;br /&gt;
The steps we will now take for each resource are:&lt;br /&gt;
* Attach each node&#039;s backing device to the DRBD resource.&lt;br /&gt;
* Establish the network connection between the two nodes.&lt;br /&gt;
* Force one node&#039;s backing device to be considered &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;UpToDate&amp;lt;/span&amp;gt; and promote it to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Primary&amp;lt;/span&amp;gt;.&lt;br /&gt;
* Promote the second node to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Primary&amp;lt;/span&amp;gt;&lt;br /&gt;
* Bump the synchronization rate to the value specified in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/drbd.conf&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Now lets walk through these steps, taking a look at &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/proc/drbd&amp;lt;/span&amp;gt; after each step.&lt;br /&gt;
&lt;br /&gt;
{{note|1=You can save some typing with a &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;bash&amp;lt;/span&amp;gt; trick. Where you would normally call &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;r0&amp;lt;/span&amp;gt;, then &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;r1&amp;lt;/span&amp;gt;, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;r2&amp;lt;/span&amp;gt; a last &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;r3&amp;lt;/span&amp;gt;, you can call all at once by instead calling &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;command&amp;gt; r{0,1,2,3}&amp;lt;/span&amp;gt;.}}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On Both Nodes&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
Attach the resources local backing devices to their DRBD resources. That is, connect the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/sda{5,6,7,8}&amp;lt;/span&amp;gt; to their corresponding &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;r{0,1,2,3}&amp;lt;/span&amp;gt; resources.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
drbdadm attach r{0,1,2,3}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
version: 8.3.8 (api:88/proto:86-94)&lt;br /&gt;
GIT-hash: d78846e52224fd00562f7c225bcc25b2d422321d build by mockbuild@builder10.centos.org, 2010-06-04 08:04:27&lt;br /&gt;
 0: cs:StandAlone ro:Secondary/Unknown ds:Inconsistent/DUnknown   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:9775184&lt;br /&gt;
 1: cs:StandAlone ro:Secondary/Unknown ds:Inconsistent/DUnknown   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:97664116&lt;br /&gt;
 2: cs:StandAlone ro:Secondary/Unknown ds:Inconsistent/DUnknown   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:97664116&lt;br /&gt;
 3: cs:StandAlone ro:Secondary/Unknown ds:Inconsistent/DUnknown   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:257843340&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On Both Nodes&#039;&#039;&#039;: &lt;br /&gt;
&lt;br /&gt;
Now we&#039;ll connect the corresponding resource backing devices on each node together to create the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/drbdX&amp;lt;/span&amp;gt; devices. Note that while one node is connecting, it&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/proc/drbd&amp;lt;/span&amp;gt; will show the resource as being in the connection state of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;WFConnection&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 connect r{0,1,2,3}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
version: 8.3.8 (api:88/proto:86-94)&lt;br /&gt;
GIT-hash: d78846e52224fd00562f7c225bcc25b2d422321d build by mockbuild@builder10.centos.org, 2010-06-04 08:04:27&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:9775184&lt;br /&gt;
 1: 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:97664116&lt;br /&gt;
 2: 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:97664116&lt;br /&gt;
 3: 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:257843340&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On One Node Only&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
As the resource is totally new, we&#039;ll need to tell DRBD that one node&#039;s backing device is &amp;quot;more&amp;quot; valid than the other. It is entirely arbitrary which node we run this on. I run this on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt; out of habit. This step also promotes the local resource to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Primary&amp;lt;/span&amp;gt;, which means that it is usable by the local system.&lt;br /&gt;
&lt;br /&gt;
{{note|1=An alternative to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--overwrite-data-of-peer&amp;lt;/span&amp;gt; is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;drbdadm -- --clear-bitmap new-current-uuid res&amp;lt;/span&amp;gt; followed by &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;drbdadm primary res&amp;lt;/span&amp;gt;. This will instantly mark both sides of the DRBD resource as &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;UpToDate&amp;lt;/span&amp;gt; without needing to perform the initial sync.}}&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 r{0,1,2,3}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
version: 8.3.8 (api:88/proto:86-94)&lt;br /&gt;
GIT-hash: d78846e52224fd00562f7c225bcc25b2d422321d build by mockbuild@builder10.centos.org, 2010-06-04 08:04:27&lt;br /&gt;
 0: cs:SyncSource ro:Primary/Secondary ds:UpToDate/Inconsistent C r----&lt;br /&gt;
    ns:896 nr:0 dw:0 dr:896 al:0 bm:0 lo:0 pe:0 ua:0 ap:0 ep:1 wo:b oos:9774288&lt;br /&gt;
        [&amp;gt;....................] sync&#039;ed:  0.1% (9544/9544)M delay_probe: 701&lt;br /&gt;
        finish: 4:31:30 speed: 448 (448) K/sec&lt;br /&gt;
 1: cs:SyncSource ro:Primary/Secondary ds:UpToDate/Inconsistent C r----&lt;br /&gt;
    ns:736 nr:0 dw:0 dr:736 al:0 bm:0 lo:0 pe:0 ua:0 ap:0 ep:1 wo:b oos:97663380&lt;br /&gt;
        [&amp;gt;....................] sync&#039;ed:  0.1% (95372/95372)M delay_probe: 620&lt;br /&gt;
        finish: 67:49:18 speed: 368 (368) K/sec&lt;br /&gt;
 2: cs:SyncSource ro:Primary/Secondary ds:UpToDate/Inconsistent C r----&lt;br /&gt;
    ns:672 nr:0 dw:0 dr:672 al:0 bm:0 lo:0 pe:0 ua:0 ap:0 ep:1 wo:b oos:97663444&lt;br /&gt;
        [&amp;gt;....................] sync&#039;ed:  0.1% (95372/95372)M delay_probe: 556&lt;br /&gt;
        finish: 67:49:18 speed: 336 (336) K/sec&lt;br /&gt;
 3: cs:SyncSource ro:Primary/Secondary ds:UpToDate/Inconsistent C r----&lt;br /&gt;
    ns:576 nr:0 dw:0 dr:576 al:0 bm:0 lo:0 pe:0 ua:0 ap:0 ep:1 wo:b oos:257842764&lt;br /&gt;
        [&amp;gt;....................] sync&#039;ed:  0.1% (251796/251800)M delay_probe: 447&lt;br /&gt;
        finish: 89:31:43 speed: 576 (576) K/sec&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On The Other Node&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
The last required step is to promote the other node&#039;s resource to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Primary&amp;lt;/span&amp;gt; as well.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
drbdadm primary r{0,1,2,3}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
version: 8.3.8 (api:88/proto:86-94)&lt;br /&gt;
GIT-hash: d78846e52224fd00562f7c225bcc25b2d422321d build by mockbuild@builder10.centos.org, 2010-06-04 08:04:27&lt;br /&gt;
 0: cs:SyncSource ro:Primary/Primary ds:UpToDate/Inconsistent C r----&lt;br /&gt;
    ns:159008 nr:0 dw:0 dr:159008 al:0 bm:9 lo:0 pe:0 ua:0 ap:0 ep:1 wo:b oos:9616176&lt;br /&gt;
        [&amp;gt;....................] sync&#039;ed:  1.7% (9388/9544)M delay_probe: 130846&lt;br /&gt;
        finish: 6:40:40 speed: 256 (312) K/sec&lt;br /&gt;
 1: cs:SyncSource ro:Primary/Primary ds:UpToDate/Inconsistent C r----&lt;br /&gt;
    ns:161152 nr:0 dw:0 dr:161152 al:0 bm:9 lo:0 pe:0 ua:0 ap:0 ep:1 wo:b oos:97502964&lt;br /&gt;
        [&amp;gt;....................] sync&#039;ed:  0.2% (95216/95372)M delay_probe: 131004&lt;br /&gt;
        finish: 67:42:37 speed: 0 (316) K/sec&lt;br /&gt;
 2: cs:SyncSource ro:Primary/Primary ds:UpToDate/Inconsistent C r----&lt;br /&gt;
    ns:161024 nr:0 dw:0 dr:161024 al:0 bm:9 lo:0 pe:0 ua:0 ap:0 ep:1 wo:b oos:97503092&lt;br /&gt;
        [&amp;gt;....................] sync&#039;ed:  0.2% (95216/95372)M delay_probe: 130852&lt;br /&gt;
        finish: 76:10:27 speed: 348 (316) K/sec&lt;br /&gt;
 3: cs:SyncSource ro:Primary/Primary ds:UpToDate/Inconsistent C r----&lt;br /&gt;
    ns:160832 nr:0 dw:0 dr:160832 al:0 bm:9 lo:0 pe:0 ua:0 ap:0 ep:1 wo:b oos:257682508&lt;br /&gt;
        [&amp;gt;....................] sync&#039;ed:  0.1% (251640/251800)M delay_probe: 130729&lt;br /&gt;
        finish: 178:56:46 speed: 128 (316) K/sec&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{note|1=From here on in, the steps shown are not strictly needed. The first step is highly recommended, as it is needed to set the desired sync rate, but DRBD will work fine as it now is.}}&lt;br /&gt;
&lt;br /&gt;
DRBD is a bit sensitive to performance issues, so we have to handle multiple resources syncing at the same time a little carefully. The temptation to just raise the sync rate on all resources will get us into trouble.&lt;br /&gt;
&lt;br /&gt;
The safest bet to get all of the resources updated is to pause the synchronization on all but one resource, bump the sync rate up to a little under the maximum write speed of the resource, waiting for the resource to sync, resuming sync on the next resource and so on.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On One Node&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
Let&#039;s pause the synchronization on all but 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 pause-sync r{1,2,3}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
version: 8.3.8 (api:88/proto:86-94)&lt;br /&gt;
GIT-hash: d78846e52224fd00562f7c225bcc25b2d422321d build by mockbuild@builder10.centos.org, 2010-06-04 08:04:27&lt;br /&gt;
 0: cs:SyncSource ro:Primary/Primary ds:UpToDate/Inconsistent C r----&lt;br /&gt;
    ns:32288 nr:0 dw:0 dr:32288 al:0 bm:1 lo:0 pe:0 ua:0 ap:0 ep:1 wo:b oos:9742896&lt;br /&gt;
        [&amp;gt;....................] sync&#039;ed:  0.4% (9512/9544)M delay_probe: 26632&lt;br /&gt;
        finish: 6:45:57 speed: 336 (312) K/sec&lt;br /&gt;
 1: cs:PausedSyncS ro:Primary/Primary ds:UpToDate/Inconsistent C r--u-&lt;br /&gt;
    ns:13184 nr:0 dw:0 dr:13184 al:0 bm:0 lo:0 pe:0 ua:0 ap:0 ep:1 wo:b oos:97650932&lt;br /&gt;
 2: cs:PausedSyncS ro:Primary/Primary ds:UpToDate/Inconsistent C r--u-&lt;br /&gt;
    ns:12192 nr:0 dw:0 dr:12192 al:0 bm:0 lo:0 pe:0 ua:0 ap:0 ep:1 wo:b oos:97651924&lt;br /&gt;
 3: cs:PausedSyncS ro:Primary/Primary ds:UpToDate/Inconsistent C r--u-&lt;br /&gt;
    ns:30656 nr:0 dw:0 dr:30656 al:0 bm:1 lo:0 pe:0 ua:0 ap:0 ep:1 wo:b oos:257812684&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I know that on my server, I can get a maximum write speed of roughly 40 [[MiB]]/sec. So I will manually over-ride the defined sync rate of 15 MiB/sec and set it to 35 MiB/sec. This uses a new DRBD command called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;drbdsetup&amp;lt;/span&amp;gt; and takes the DRBD device instead of the resource name.&lt;br /&gt;
&lt;br /&gt;
{{note|1=The transfer speed will not instantly reach maximum. It takes some time for synchronization rate changes to ramp up and down.}}&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;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
version: 8.3.8 (api:88/proto:86-94)&lt;br /&gt;
GIT-hash: d78846e52224fd00562f7c225bcc25b2d422321d build by mockbuild@builder10.centos.org, 2010-06-04 08:04:27&lt;br /&gt;
 0: cs:SyncTarget ro:Primary/Primary ds:Inconsistent/UpToDate C r----&lt;br /&gt;
    ns:0 nr:253216 dw:252128 dr:0 al:0 bm:15 lo:35 pe:78 ua:34 ap:0 ep:1 wo:b oos:9523056&lt;br /&gt;
        [&amp;gt;....................] sync&#039;ed:  2.7% (9296/9544)M queue_delay: 4.3 ms&lt;br /&gt;
        finish: 0:04:39 speed: 34,040 (1,984) want: 35,840 K/sec&lt;br /&gt;
 1: cs:PausedSyncT ro:Primary/Primary ds:Inconsistent/UpToDate C r-p--&lt;br /&gt;
    ns:0 nr:13184 dw:13184 dr:0 al:0 bm:0 lo:0 pe:0 ua:0 ap:0 ep:1 wo:b oos:97650932&lt;br /&gt;
 2: cs:PausedSyncT ro:Primary/Primary ds:Inconsistent/UpToDate C r-p--&lt;br /&gt;
    ns:0 nr:12192 dw:12192 dr:0 al:0 bm:0 lo:0 pe:0 ua:0 ap:0 ep:1 wo:b oos:97651924&lt;br /&gt;
 3: cs:PausedSyncT ro:Primary/Primary ds:Inconsistent/UpToDate C r-p--&lt;br /&gt;
    ns:0 nr:30656 dw:30656 dr:0 al:0 bm:1 lo:0 pe:0 ua:0 ap:0 ep:1 wo:b oos:257812684&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{note|1=The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;want: 35,840 K/sec&amp;lt;/span&amp;gt; will not show up on the node that you increased the sync rate on. Also note that it will occasionally show &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;want: 0 K/sec&amp;lt;/span&amp;gt;. So long as the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;oos:x&amp;lt;/span&amp;gt; (out of sync blocks) value keeps dropping and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;speed&amp;lt;/span&amp;gt; is still reasonable, the sync is fine.}}&lt;br /&gt;
&lt;br /&gt;
After a period of time, you will see the synchronization finish and the resource will then be in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;UpToDate/UpToDate&amp;lt;/span&amp;gt; state. We&#039;ll now tell DRBD to restore the defined sync rate of 15 MiB/sec, resume synchronization of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;r1&amp;lt;/span&amp;gt; and increase the sync rate of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;r1&amp;lt;/span&amp;gt; to 35 MiB/sec.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
drbdadm syncer r0&lt;br /&gt;
drbdadm resume-sync r1&lt;br /&gt;
drbdsetup /dev/drbd1 syncer -r 35M&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
version: 8.3.8 (api:88/proto:86-94)&lt;br /&gt;
GIT-hash: d78846e52224fd00562f7c225bcc25b2d422321d build by mockbuild@builder10.centos.org, 2010-06-04 08:04:27&lt;br /&gt;
 0: cs:Connected ro:Primary/Primary ds:UpToDate/UpToDate C r----&lt;br /&gt;
    ns:0 nr:9775184 dw:9775184 dr:0 al:0 bm:597 lo:0 pe:0 ua:0 ap:0 ep:1 wo:b oos:0&lt;br /&gt;
 1: cs:SyncTarget ro:Primary/Primary ds:Inconsistent/UpToDate C r----&lt;br /&gt;
    ns:0 nr:851872 dw:851872 dr:0 al:0 bm:51 lo:0 pe:0 ua:0 ap:0 ep:1 wo:b oos:96812244&lt;br /&gt;
        [&amp;gt;....................] sync&#039;ed:  0.9% (94540/95372)M queue_delay: 0.0 ms&lt;br /&gt;
        finish: 0:24:54 speed: 64,480 (11,508) want: 35,840 K/sec&lt;br /&gt;
 2: cs:PausedSyncT ro:Primary/Primary ds:Inconsistent/UpToDate C r-p--&lt;br /&gt;
    ns:0 nr:12192 dw:12192 dr:0 al:0 bm:0 lo:0 pe:0 ua:0 ap:0 ep:1 wo:b oos:97651924&lt;br /&gt;
 3: cs:PausedSyncT ro:Primary/Primary ds:Inconsistent/UpToDate C r-p--&lt;br /&gt;
    ns:0 nr:30656 dw:30656 dr:0 al:0 bm:1 lo:0 pe:0 ua:0 ap:0 ep:1 wo:b oos:257812684&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As before, once &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;r1&amp;lt;/span&amp;gt; is finished syncing, we&#039;ll restore the defined sync rate, resume sync on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;r2&amp;lt;/span&amp;gt; and push the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;r2&amp;lt;/span&amp;gt; sync rate up. Finally, we&#039;ll do the same to the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;r3&amp;lt;/span&amp;gt; resource. Once the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;r3&amp;lt;/span&amp;gt; resource is synced, we&#039;ll restore it&#039;s sync rate and we&#039;ll be finished syncing all of the resources.&lt;br /&gt;
&lt;br /&gt;
Once all resources are synchronized, you should see this on both nodes:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
version: 8.3.8 (api:88/proto:86-94)&lt;br /&gt;
GIT-hash: d78846e52224fd00562f7c225bcc25b2d422321d build by mockbuild@builder10.centos.org, 2010-06-04 08:04:27&lt;br /&gt;
 0: cs:Connected ro:Primary/Primary ds:UpToDate/UpToDate C r----&lt;br /&gt;
    ns:9775184 nr:0 dw:0 dr:9775184 al:0 bm:597 lo:0 pe:0 ua:0 ap:0 ep:1 wo:b oos:0&lt;br /&gt;
 1: cs:Connected ro:Primary/Primary ds:UpToDate/UpToDate C r----&lt;br /&gt;
    ns:97664116 nr:0 dw:0 dr:97664116 al:0 bm:5961 lo:0 pe:0 ua:0 ap:0 ep:1 wo:b oos:0&lt;br /&gt;
 2: cs:Connected ro:Primary/Primary ds:UpToDate/UpToDate C r----&lt;br /&gt;
    ns:97664116 nr:0 dw:0 dr:97664116 al:0 bm:5961 lo:0 pe:0 ua:0 ap:0 ep:1 wo:b oos:0&lt;br /&gt;
 3: cs:Connected ro:Primary/Primary ds:UpToDate/UpToDate C r----&lt;br /&gt;
    ns:257843340 nr:0 dw:0 dr:257843340 al:0 bm:15738 lo:0 pe:0 ua:0 ap:0 ep:1 wo:b oos:0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
That&#039;s it, your resource is ready for use! You do not need to wait for the sync to complete before proceeding. However, ensure that the sync is complete before bringing up VMs on the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Inconsistent&amp;lt;/span&amp;gt; side.&lt;br /&gt;
&lt;br /&gt;
{{note|1=For the rest of the tutorial, we will be ignoring &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;r3&amp;lt;/span&amp;gt; as it&#039;s just a bank of spare disk space.}}&lt;br /&gt;
&lt;br /&gt;
==== Overdoing It ====&lt;br /&gt;
&lt;br /&gt;
If you try to sync too many resources at one or if you set the sync rate too high, you may find that one or more of the resources &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;want: 0 K/sec&amp;lt;/span&amp;gt;. This is a sign that the disks are being hit too hard, and you need to back off the sync rate or flat out pause the synchronization of some resources until the other ones have finished.&lt;br /&gt;
&lt;br /&gt;
{{note|1=In some cases, pushing DRBD too hard may cause synchronization to stall entirely. If this happens, you can try to pause, then resume the sync. If that doesn&#039;t fix it, try changing the sync speed down to a lower speed (see the next section), then pause and resume. If it is still stalling, run &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/init.d/drbd stop&amp;lt;/span&amp;gt; on both nodes, then &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/init.d/drbd start&amp;lt;/span&amp;gt;, pause all but one resource and then set the sync speed on the last resource. Start with a low value and work your way up until you find the maximum stable sync speed for your configuration.}}&lt;br /&gt;
&lt;br /&gt;
==== A Note on Synchronization Speeds ====&lt;br /&gt;
&lt;br /&gt;
As discussed earlier while configuring &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/drbd.conf&amp;lt;/span&amp;gt;, we do not want to have the sync rate set too high. However, if you know that your the disk(s) backing your DRBD resource will not be in use for a while, then you can temporarily drive up the sync rate as we saw above. This can also be used in reverse. If you expect periods of high disk I/O, you can use this same command to temporarily throttle synchronization.&lt;br /&gt;
&lt;br /&gt;
The command to raise the sync rate is below. Note that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;drbdsetup /dev/drbdX&amp;lt;/span&amp;gt; is used here.&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 40M&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To restore it back to the rate set in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/drbd.conf&amp;lt;/span&amp;gt;, run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&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 Clustered LVM ==&lt;br /&gt;
&lt;br /&gt;
This step will have us create three [[LVM]] physical volumes, one for each of the allocated DRBD resources, and then creating three separate volume groups. At this stage, the only logical volume we will create will be for the [[GFS2]] partition. The rest of the LVs will be created later when we provision virtual machines.&lt;br /&gt;
&lt;br /&gt;
=== Modifying /etc/lvm/lvm.conf ===&lt;br /&gt;
&lt;br /&gt;
There are four main things we&#039;re going to change in the LVM configuration file.&lt;br /&gt;
* Change the filter to only see &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/drbd*&amp;lt;/span&amp;gt; devices. Otherwise LVM will see signatures on the DRBD resource and the backing &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/sd*&amp;lt;/span&amp;gt; devices which will cause confusion.&lt;br /&gt;
* Change the locking type to clustered locking.&lt;br /&gt;
* Disable clustered locking from falling back to local locking.&lt;br /&gt;
* We&#039;ll be identifying our clustered VGs and LVs using LVM tags. This tag will be defined using the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;volume_list&amp;lt;/span&amp;gt; variable.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/lvm/lvm.conf /etc/lvm/lvm.conf.orig&lt;br /&gt;
vim /etc/lvm/lvm.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The first step is trivial. Simple alter &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;locking_type = 1&amp;lt;/span&amp;gt; to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;locking_type = 3&amp;lt;/span&amp;gt;.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
    # Type of locking to use. Defaults to local file-based locking (1).&lt;br /&gt;
    # Turn locking off by setting to 0 (dangerous: risks metadata corruption&lt;br /&gt;
    # if LVM2 commands get run concurrently).&lt;br /&gt;
    # Type 2 uses the external shared library locking_library.&lt;br /&gt;
    # Type 3 uses built-in clustered locking.&lt;br /&gt;
    # Type 4 uses read-only locking which forbids any operations that might &lt;br /&gt;
    # change metadata.&lt;br /&gt;
    locking_type = 3&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Next, restrict the filtering so that it only sees the DRBD resources. This is done by changing the filter variable from &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;filter = [ &amp;quot;a/.*/&amp;quot; ]&amp;lt;/span&amp;gt; to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;filter = [ &amp;quot;a|/dev/drbd*|&amp;quot;, &amp;quot;r/.*/&amp;quot; ]&amp;lt;/span&amp;gt;. What this does is tell LVM to &#039;&#039;&#039;a&#039;&#039;&#039;ccept devices matching &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/drbd*&amp;lt;/span&amp;gt; and to &#039;&#039;&#039;r&#039;&#039;&#039;eject all other devices.&lt;br /&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|/dev/drbd*|&amp;quot;, &amp;quot;r/.*/&amp;quot; ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now, we&#039;ll disable falling back to local locking. The reasoning being that if the cluster lock manager [[DLM]] is not available, then we don&#039;t want to touch the storage at all. This is done by changing &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fallback_to_local_locking&amp;lt;/span&amp;gt; from &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt; to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;0&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;
    # If an attempt to initialise type 2 or type 3 locking failed, perhaps&lt;br /&gt;
    # because cluster components such as clvmd are not running, with this set&lt;br /&gt;
    # to 1 an attempt will be made to use local file-based locking (type 1).&lt;br /&gt;
    # If this succeeds, only commands against local volume groups will proceed.&lt;br /&gt;
    # Volume Groups marked as clustered will be ignored.&lt;br /&gt;
    fallback_to_local_locking = 0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Finally, tell LVM to use volumes with our tags by setting &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;volume_list&amp;lt;/span&amp;gt; to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[&amp;quot;@an-cluster01&amp;quot;]&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;
    # If volume_list is defined, each LV is only activated if there is a&lt;br /&gt;
    # match against the list.&lt;br /&gt;
    #   &amp;quot;vgname&amp;quot; and &amp;quot;vgname/lvname&amp;quot; are matched exactly.&lt;br /&gt;
    #   &amp;quot;@tag&amp;quot; matches any tag set in the LV or VG.&lt;br /&gt;
    #   &amp;quot;@*&amp;quot; matches if any tag defined on the host is also set in the LV or VG&lt;br /&gt;
    #&lt;br /&gt;
    # volume_list = [ &amp;quot;vg1&amp;quot;, &amp;quot;vg2/lvol1&amp;quot;, &amp;quot;@tag1&amp;quot;, &amp;quot;@*&amp;quot; ]&lt;br /&gt;
    volume_list = [&amp;quot;@an-cluster01&amp;quot;]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Save the file. With these chages, the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;diff&amp;lt;/span&amp;gt; should look like what is shown below.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
diff -u /etc/lvm/lvm.conf.orig /etc/lvm/lvm.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;diff&amp;quot;&amp;gt;&lt;br /&gt;
--- /etc/lvm/lvm.conf.orig	2011-05-06 15:30:43.000000000 -0400&lt;br /&gt;
+++ /etc/lvm/lvm.conf	2011-05-06 15:34:49.000000000 -0400&lt;br /&gt;
@@ -50,7 +50,8 @@&lt;br /&gt;
 &lt;br /&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/.*/&amp;quot; ]&lt;br /&gt;
+    filter = [ &amp;quot;a|/dev/drbd*|&amp;quot;, &amp;quot;r/.*/&amp;quot; ]&lt;br /&gt;
 &lt;br /&gt;
     # Exclude the cdrom drive&lt;br /&gt;
     # filter = [ &amp;quot;r|/dev/cdrom|&amp;quot; ]&lt;br /&gt;
@@ -289,7 +290,8 @@&lt;br /&gt;
     # Type 3 uses built-in clustered locking.&lt;br /&gt;
     # Type 4 uses read-only locking which forbids any operations that might &lt;br /&gt;
     # change metadata.&lt;br /&gt;
-    locking_type = 1&lt;br /&gt;
+    #locking_type = 1&lt;br /&gt;
+    locking_type = 3&lt;br /&gt;
 &lt;br /&gt;
     # Set to 0 to fail when a lock request cannot be satisfied immediately.&lt;br /&gt;
     wait_for_locks = 1&lt;br /&gt;
@@ -305,7 +307,8 @@&lt;br /&gt;
     # to 1 an attempt will be made to use local file-based locking (type 1).&lt;br /&gt;
     # If this succeeds, only commands against local volume groups will proceed.&lt;br /&gt;
     # Volume Groups marked as clustered will be ignored.&lt;br /&gt;
-    fallback_to_local_locking = 1&lt;br /&gt;
+    #fallback_to_local_locking = 1&lt;br /&gt;
+    fallback_to_local_locking = 0&lt;br /&gt;
 &lt;br /&gt;
     # Local non-LV directory that holds file-based locks while commands are&lt;br /&gt;
     # in progress.  A directory like /tmp that may get wiped on reboot is OK.&lt;br /&gt;
@@ -378,6 +381,7 @@&lt;br /&gt;
     #   &amp;quot;@*&amp;quot; matches if any tag defined on the host is also set in the LV or VG&lt;br /&gt;
     #&lt;br /&gt;
     # volume_list = [ &amp;quot;vg1&amp;quot;, &amp;quot;vg2/lvol1&amp;quot;, &amp;quot;@tag1&amp;quot;, &amp;quot;@*&amp;quot; ]&lt;br /&gt;
+    volume_list = [&amp;quot;@an-cluster01&amp;quot;]&lt;br /&gt;
 &lt;br /&gt;
     # Size (in KB) of each copy operation when mirroring&lt;br /&gt;
     mirror_region_size = 512&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now copy the changed file to the second node.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
rsync -av /etc/lvm/lvm.conf root@an-node05:/etc/lvm/&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
building file list ... done&lt;br /&gt;
lvm.conf&lt;br /&gt;
&lt;br /&gt;
sent 3153 bytes  received 234 bytes  6774.00 bytes/sec&lt;br /&gt;
total size is 22459  speedup is 6.63&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You&#039;re done. Normally we&#039;d want to tell LVM to rescan for PVs, VGs and LVs but at this stage there are none.&lt;br /&gt;
&lt;br /&gt;
=== Starting the clvmd Daemon ===&lt;br /&gt;
&lt;br /&gt;
Before we proceed, we need to start the clustered LVM daemon, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clvmd&amp;lt;/span&amp;gt;. This requires that the cluster is already running. So if you stopped the cluster, start it on both nodes before starting &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clvmd&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;
cman_tool 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;
Version: 6.2.0&lt;br /&gt;
Config Version: 9&lt;br /&gt;
Cluster Name: an-cluster01&lt;br /&gt;
Cluster Id: 60257&lt;br /&gt;
Cluster Member: Yes&lt;br /&gt;
Cluster Generation: 120&lt;br /&gt;
Membership state: Cluster-Member&lt;br /&gt;
Nodes: 2&lt;br /&gt;
Expected votes: 1&lt;br /&gt;
Total votes: 2&lt;br /&gt;
Quorum: 1  &lt;br /&gt;
Active subsystems: 7&lt;br /&gt;
Flags: 2node Dirty &lt;br /&gt;
Ports Bound: 0  &lt;br /&gt;
Node name: an-node04.alteeve.com&lt;br /&gt;
Node ID: 1&lt;br /&gt;
Multicast addresses: 239.192.235.77 &lt;br /&gt;
Node addresses: 192.168.3.74 &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{note|1=The version incremented after the last example when I edited the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cluster.conf&amp;lt;/span&amp;gt; to have my real passwords.}}&lt;br /&gt;
&lt;br /&gt;
So now we see that the cluster is up on both nodes (&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Nodes: 2&amp;lt;/span&amp;gt;), so we can start the clustered LVM daemon.&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;
Starting clvmd: &lt;br /&gt;
Activating VG(s):   No volume groups found&lt;br /&gt;
                                                           [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{note|1=At this stage, the cluster does not start at boot, so we can&#039;t start &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clvmd&amp;lt;/span&amp;gt; at boot yet, either. We&#039;ll do this at the end of the tutorial, so for now, disable &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clvmd&amp;lt;/span&amp;gt; and start it manually after starting &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt; when you first start your cluster.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
chkconfig clvmd off&lt;br /&gt;
chkconfig --list 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;
clvmd          	0:off	1:off	2:off	3:off	4:off	5:off	6:off&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Turning Our DRBD Resources Into LVM Physical Volumes ===&lt;br /&gt;
&lt;br /&gt;
{{note|1=Now that DRBD is in use, commands will only need to be executed on one node and the changes should be immediately seen on the second node.}}&lt;br /&gt;
&lt;br /&gt;
Creating LVM physical volumes is a trivial task. Simply run &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;pvcreate /dev/drbdX&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On One Node&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
pvcreate /dev/drbd{0,1,2}&lt;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;
  Physical volume &amp;quot;/dev/drbd1&amp;quot; successfully created&lt;br /&gt;
  Physical volume &amp;quot;/dev/drbd2&amp;quot; successfully created&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On The Other Node&#039;&#039;&#039;:&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;9.32 GB&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               9.32 GB&lt;br /&gt;
  Allocatable           NO&lt;br /&gt;
  PE Size (KByte)       0&lt;br /&gt;
  Total PE              0&lt;br /&gt;
  Free PE               0&lt;br /&gt;
  Allocated PE          0&lt;br /&gt;
  PV UUID               WxTCW4-lUzL-bR53-km45-13eV-3f8B-ZA5Tb9&lt;br /&gt;
   &lt;br /&gt;
  &amp;quot;/dev/drbd1&amp;quot; is a new physical volume of &amp;quot;93.14 GB&amp;quot;&lt;br /&gt;
  --- NEW Physical volume ---&lt;br /&gt;
  PV Name               /dev/drbd1&lt;br /&gt;
  VG Name               &lt;br /&gt;
  PV Size               93.14 GB&lt;br /&gt;
  Allocatable           NO&lt;br /&gt;
  PE Size (KByte)       0&lt;br /&gt;
  Total PE              0&lt;br /&gt;
  Free PE               0&lt;br /&gt;
  Allocated PE          0&lt;br /&gt;
  PV UUID               zrwlxT-VFA4-5NiK-fwbK-z2Ez-mYxu-Ei8yZs&lt;br /&gt;
   &lt;br /&gt;
  &amp;quot;/dev/drbd2&amp;quot; is a new physical volume of &amp;quot;93.14 GB&amp;quot;&lt;br /&gt;
  --- NEW Physical volume ---&lt;br /&gt;
  PV Name               /dev/drbd2&lt;br /&gt;
  VG Name               &lt;br /&gt;
  PV Size               93.14 GB&lt;br /&gt;
  Allocatable           NO&lt;br /&gt;
  PE Size (KByte)       0&lt;br /&gt;
  Total PE              0&lt;br /&gt;
  Free PE               0&lt;br /&gt;
  Allocated PE          0&lt;br /&gt;
  PV UUID               6d4e5P-pjHE-4axT-ZRyG-lJa7-8oLa-TjkZFy&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Before proceeding, be sure to have LVM rescan for the new [[PV]]s so that it&#039;s cache is up to date. This isn&#039;t strictly needed, but I find it a useful habit to get into.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On both nodes&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
pvscan&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
  PV /dev/drbd0                      lvm2 [9.32 GB]&lt;br /&gt;
  PV /dev/drbd1                      lvm2 [93.14 GB]&lt;br /&gt;
  PV /dev/drbd2                      lvm2 [93.14 GB]&lt;br /&gt;
  Total: 3 [195.60 GB] / in use: 0 [0   ] / in no VG: 3 [195.60 GB]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{note|1=There is nothing showing in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;VG Name&amp;lt;/span&amp;gt; yet, as we&#039;ve not created any [[VG]]s. Re-run &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;pvdisplay&amp;lt;/span&amp;gt; after the VGs are created and you will see them show up. Be aware that a [[PV]] can only belong to one [[VG]] at a time.}}&lt;br /&gt;
&lt;br /&gt;
=== Creating Volume Groups ===&lt;br /&gt;
&lt;br /&gt;
LVM allows for a given VG to have multiple PVs assigned to it. In our case though, each PV has a specific purpose so we will be creating three independent VGs.&lt;br /&gt;
&lt;br /&gt;
Creating VGs is somewhat less trivial compared to creating the PVs. There are a few extra bits that need to be specified when the volume groups are created. The extra bits are:&lt;br /&gt;
* We will explicitly tell LVM that these are clustered VGs via &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;-c y&amp;lt;/span&amp;gt; (&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--clustered yes&amp;lt;/span&amp;gt;).&lt;br /&gt;
* We will create a tag that we will use to identify all clustered VGs. The tag I use is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-cluster01&amp;lt;/span&amp;gt;, thought you are free to use something else. This is applied via &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--addtag @an-cluster01&amp;lt;/span&amp;gt;&lt;br /&gt;
* Each VG needs a unique name which will become part of the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/vg_name/lv_name&amp;lt;/span&amp;gt; path. The name you choose should make sense to you. The names used in this tutorial are shown in the table below.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!VG name&lt;br /&gt;
!PV used&lt;br /&gt;
!Note&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;drbd_sh0_vg0&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/drbd0&amp;lt;/span&amp;gt;&lt;br /&gt;
|This will be used for the shared VG hosting the lone logical volume which we will create the [[GFS2]] partition on.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;drbd_an4_vg0&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/drbd1&amp;lt;/span&amp;gt;&lt;br /&gt;
|This VG will host the LVs backing the virtual machines designed to normally operate on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt;.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;drbd_an5_vg0&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/drbd2&amp;lt;/span&amp;gt;&lt;br /&gt;
|This VG will host the LVs backing the virtual machines designed to normally operate on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
So then, the commands to create these VGs will be as follows.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On One Node&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vgcreate -c y --addtag @an-cluster01 drbd_sh0_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;drbd_sh0_vg0&amp;quot; successfully created&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;
vgcreate -c y --addtag @an-cluster01 drbd_an4_vg0 /dev/drbd1&lt;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;drbd_an4_vg0&amp;quot; successfully created&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;
vgcreate -c y --addtag @an-cluster01 drbd_an5_vg0 /dev/drbd2&lt;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;drbd_an5_vg0&amp;quot; successfully created&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On The Other Node&#039;&#039;&#039;: You can verify that the VGs are visible on the second node with &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 -v&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
    Finding all volume groups&lt;br /&gt;
    Finding volume group &amp;quot;drbd_an5_vg0&amp;quot;&lt;br /&gt;
  --- Volume group ---&lt;br /&gt;
  VG Name               drbd_an5_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               93.14 GB&lt;br /&gt;
  PE Size               4.00 MB&lt;br /&gt;
  Total PE              23843&lt;br /&gt;
  Alloc PE / Size       0 / 0   &lt;br /&gt;
  Free  PE / Size       23843 / 93.14 GB&lt;br /&gt;
  VG UUID               kqhxfN-6VaV-TXlL-SYPP-4k2F-li70-rOg2wK&lt;br /&gt;
   &lt;br /&gt;
  --- Physical volumes ---&lt;br /&gt;
  PV Name               /dev/drbd2     &lt;br /&gt;
  PV UUID               6d4e5P-pjHE-4axT-ZRyG-lJa7-8oLa-TjkZFy&lt;br /&gt;
  PV Status             allocatable&lt;br /&gt;
  Total PE / Free PE    23843 / 23843&lt;br /&gt;
   &lt;br /&gt;
    Finding volume group &amp;quot;drbd_an4_vg0&amp;quot;&lt;br /&gt;
  --- Volume group ---&lt;br /&gt;
  VG Name               drbd_an4_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               93.14 GB&lt;br /&gt;
  PE Size               4.00 MB&lt;br /&gt;
  Total PE              23843&lt;br /&gt;
  Alloc PE / Size       0 / 0   &lt;br /&gt;
  Free  PE / Size       23843 / 93.14 GB&lt;br /&gt;
  VG UUID               9WBngc-SvVq-VVBd-csag-I0JP-DqLj-xV3fUf&lt;br /&gt;
   &lt;br /&gt;
  --- Physical volumes ---&lt;br /&gt;
  PV Name               /dev/drbd1     &lt;br /&gt;
  PV UUID               zrwlxT-VFA4-5NiK-fwbK-z2Ez-mYxu-Ei8yZs&lt;br /&gt;
  PV Status             allocatable&lt;br /&gt;
  Total PE / Free PE    23843 / 23843&lt;br /&gt;
   &lt;br /&gt;
    Finding volume group &amp;quot;drbd_sh0_vg0&amp;quot;&lt;br /&gt;
  --- Volume group ---&lt;br /&gt;
  VG Name               drbd_sh0_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               9.32 GB&lt;br /&gt;
  PE Size               4.00 MB&lt;br /&gt;
  Total PE              2386&lt;br /&gt;
  Alloc PE / Size       0 / 0   &lt;br /&gt;
  Free  PE / Size       2386 / 9.32 GB&lt;br /&gt;
  VG UUID               h6xZz8-G3J2-fkBF-1ZOD-DgkR-X0f4-9qaYI3&lt;br /&gt;
   &lt;br /&gt;
  --- Physical volumes ---&lt;br /&gt;
  PV Name               /dev/drbd0     &lt;br /&gt;
  PV UUID               WxTCW4-lUzL-bR53-km45-13eV-3f8B-ZA5Tb9&lt;br /&gt;
  PV Status             allocatable&lt;br /&gt;
  Total PE / Free PE    2386 / 2386&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;tag&amp;lt;/span&amp;gt; we assigned isn&#039;t displayed, this is ok. You can see the tags using a special incantation of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vgs&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;
vgs -o vg_name,vg_tags&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
  VG           VG Tags     &lt;br /&gt;
  drbd_an4_vg0 an-cluster01&lt;br /&gt;
  drbd_an5_vg0 an-cluster01&lt;br /&gt;
  drbd_sh0_vg0 an-cluster01&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It may not be pretty, but at least you can confirm that the tags exist as expected. Where tags are used will be discussed later in the trouble-shooting section.&lt;br /&gt;
&lt;br /&gt;
Before proceeding, be sure to have LVM rescan for the new [[VG]]s so that it&#039;s cache is up to date.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On both nodes&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vgscan&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
  Reading all physical volumes.  This may take a while...&lt;br /&gt;
  Found volume group &amp;quot;drbd_an5_vg0&amp;quot; using metadata type lvm2&lt;br /&gt;
  Found volume group &amp;quot;drbd_an4_vg0&amp;quot; using metadata type lvm2&lt;br /&gt;
  Found volume group &amp;quot;drbd_sh0_vg0&amp;quot; using metadata type lvm2&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Creating a Logical Volume ===&lt;br /&gt;
&lt;br /&gt;
At this point, we&#039;re only going to create a logical volume on the shared VG. This one LV will use all of the space available in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;drbd_sh0_vg0&amp;lt;/span&amp;gt; volume group. As with the VGs, we&#039;ll be assigning the same tag to our LV. We will also need to assign a name to the LV which will form the last part of the device path, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/vg_name/lv_name&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
When creating LVs, you can specify the size of the new LV in a few ways. The two way I prefer are &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;-L xxG&amp;lt;/span&amp;gt;, where &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xx&amp;lt;/span&amp;gt; is the number of [[GiB]] to make the LV. Alternatively, I like to use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;-l 100%FREE&amp;lt;/span&amp;gt; when I am creating the last partition on the VG (or the only one, as in this case). Which you use is entirely up to you.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On One Node&#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 100%FREE --addtag @an-cluster01 -n xen_shared drbd_sh0_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;On The Other Node&#039;&#039;&#039;:&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/drbd_sh0_vg0/xen_shared&lt;br /&gt;
  VG Name                drbd_sh0_vg0&lt;br /&gt;
  LV UUID                6bngyf-RSGG-17pA-g2fn-wwM3-6xsc-8yBAI5&lt;br /&gt;
  LV Write Access        read/write&lt;br /&gt;
  LV Status              available&lt;br /&gt;
  # open                 0&lt;br /&gt;
  LV Size                9.32 GB&lt;br /&gt;
  Current LE             2386&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;
As always, before proceeding, be sure to have LVM rescan for the new [[LV]]s so that it&#039;s cache is up to date.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
lvscan&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
  ACTIVE            &#039;/dev/drbd_sh0_vg0/xen_shared&#039; [9.32 GB] inherit&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As with VGs, we can confirm that the tag was set using a similar call to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;lvs&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;
lvs -o vg_name,lv_name,lv_tags&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
  VG           LV         LV Tags     &lt;br /&gt;
  drbd_sh0_vg0 xen_shared an-cluster01&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
That&#039;s it. Our clustered LVM is setup!&lt;br /&gt;
&lt;br /&gt;
== Setting Up The Shared GFS2 Partition ==&lt;br /&gt;
&lt;br /&gt;
Setting up a [[GFS2]] partition requires three steps;&lt;br /&gt;
* Formatting the block device, a logical volume in our case, using the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;mkfs.gfs2&amp;lt;/span&amp;gt; tool.&lt;br /&gt;
* Create a mount point on each node.&lt;br /&gt;
* Add an entry 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;
As mentioned earlier, we&#039;ll create a small 10 [[GB]] [[GFS2]] partition that will hold common files for the cluster. The most notable being the virtual machine definition files. These need to be centralized so that one node can restore a VM lost on another node during a failure state. It&#039;s also a decent place for things like ISOs if you&#039;re not using a [[PXE]] server of if you want to make generic VM images available. Though if you plan to do that, you will probably want a larger GFS2 partition than we are using here.&lt;br /&gt;
&lt;br /&gt;
The information you need to have on hand when formatting a [[GFS2]] partition is:&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Variable&lt;br /&gt;
!Value&lt;br /&gt;
!Note&lt;br /&gt;
|-&lt;br /&gt;
!Locking protocol&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;lock_dlm&amp;lt;/span&amp;gt;&lt;br /&gt;
|This is always &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;lock_dlm&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Journals&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;2&amp;lt;/span&amp;gt;&lt;br /&gt;
|This matches the number of nodes in the cluster.&lt;br /&gt;
|-&lt;br /&gt;
!Cluster Name&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-cluster01&amp;lt;/span&amp;gt;&lt;br /&gt;
|As set in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/cluster/cluster.conf&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Partition Name&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xen_shared&amp;lt;/span&amp;gt;&lt;br /&gt;
|Arbitrary name&lt;br /&gt;
|-&lt;br /&gt;
!Backing Device&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/drbd_sh0_vg0/xen_shared&amp;lt;/span&amp;gt;&lt;br /&gt;
|The LV we created earlier&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Putting it all together, the command becomes:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On One Node&#039;&#039;&#039;:&lt;br /&gt;
&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-cluster01:xen_shared /dev/drbd_sh0_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/drbd_sh0_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;
Are you sure you want to proceed? [y/n] y&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{note|1=It can take a bit of time for this to complete, please be patient.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Device:                    /dev/drbd_sh0_vg0/xen_shared&lt;br /&gt;
Blocksize:                 4096&lt;br /&gt;
Device Size                9.32 GB (2443264 blocks)&lt;br /&gt;
Filesystem Size:           9.32 GB (2443261 blocks)&lt;br /&gt;
Journals:                  2&lt;br /&gt;
Resource Groups:           38&lt;br /&gt;
Locking Protocol:          &amp;quot;lock_dlm&amp;quot;&lt;br /&gt;
Lock Table:                &amp;quot;an-cluster01:xen_shared&amp;quot;&lt;br /&gt;
UUID:                      764772BC-B292-1BBF-F987-AD3A2540849B&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now confirm that the partition is visible from the other node.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On The Other Node&#039;&#039;&#039;: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
gfs2_edit -p sb /dev/drbd_sh0_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;
Block #16    (0x10) of 2443264 (0x254800) (superblock)&lt;br /&gt;
&lt;br /&gt;
Superblock:&lt;br /&gt;
  mh_magic              0x01161970(hex)&lt;br /&gt;
  mh_type               1                   0x1&lt;br /&gt;
  mh_format             100                 0x64&lt;br /&gt;
  sb_fs_format          1801                0x709&lt;br /&gt;
  sb_multihost_format   1900                0x76c&lt;br /&gt;
  sb_bsize              4096                0x1000&lt;br /&gt;
  sb_bsize_shift        12                  0xc&lt;br /&gt;
  master dir:           2                   0x2&lt;br /&gt;
        addr:           22                  0x16&lt;br /&gt;
  root dir  :           1                   0x1&lt;br /&gt;
        addr:           21                  0x15&lt;br /&gt;
  sb_lockproto          lock_dlm&lt;br /&gt;
  sb_locktable          an-cluster01:xen_shared&lt;br /&gt;
  sb_uuid               764772BC-B292-1BBF-F987-AD3A2540849B&lt;br /&gt;
&lt;br /&gt;
The superblock has 2 directories&lt;br /&gt;
     1. (1). 21 (0x15): Dir     root&lt;br /&gt;
     2. (2). 22 (0x16): Dir     master&lt;br /&gt;
------------------------------------------------------&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With that, the GFS2 partition is ready for use.&lt;br /&gt;
&lt;br /&gt;
Now we need to create the mount point. The mount point you use is up to you. This tutorial will create a mount point called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/xen_shared&amp;lt;/span&amp;gt;. Once that&#039;s created, we&#039;ll actually mount the GFS2 partition. Finally, we&#039;ll use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;df&amp;lt;/span&amp;gt; to verify that it mounted successfully.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On Both Nodes&#039;&#039;&#039;:&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/drbd_sh0_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;
/dev/sda2              20G  2.9G   16G  16% /&lt;br /&gt;
/dev/sda1             244M   33M  198M  15% /boot&lt;br /&gt;
tmpfs                 1.8G     0  1.8G   0% /dev/shm&lt;br /&gt;
none                  1.8G  104K  1.8G   1% /var/lib/xenstored&lt;br /&gt;
/dev/mapper/drbd_sh0_vg0-xen_shared&lt;br /&gt;
                      9.4G  259M  9.1G   3% /xen_shared&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The last step is to add an entry to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/fstab&amp;lt;/span&amp;gt; for this GFS2 partition. This is required because the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/init.d/gfs2&amp;lt;/span&amp;gt; initialization script consults &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/fstab&amp;lt;/span&amp;gt; to see what partitions it is to manage.&lt;br /&gt;
&lt;br /&gt;
If you are familiar with GFS2 on [[EL6]], then you might be familiar with using the GFS2&#039;s [[UUID]] in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/fstab&amp;lt;/span&amp;gt;. That is not supported here on [[EL5]].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On both nodes&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/fstab /etc/fstab.orig&lt;br /&gt;
echo &amp;quot;/dev/drbd_sh0_vg0/xen_shared /xen_shared gfs2 rw,suid,dev,exec,nouser,async 0 0&amp;quot; &amp;gt;&amp;gt; /etc/fstab&lt;br /&gt;
diff -u /etc/fstab.orig /etc/fstab&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;diff&amp;quot;&amp;gt;&lt;br /&gt;
--- /etc/fstab.orig     2011-05-06 18:56:50.000000000 -0400&lt;br /&gt;
+++ /etc/fstab  2011-05-06 18:56:50.000000000 -0400&lt;br /&gt;
@@ -5,3 +5,4 @@&lt;br /&gt;
 sysfs                   /sys                    sysfs   defaults        0 0&lt;br /&gt;
 proc                    /proc                   proc    defaults        0 0&lt;br /&gt;
 LABEL=SWAP-sda3         swap                    swap    defaults        0 0&lt;br /&gt;
+/dev/drbd_sh0_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;
{{note|1=The reason that we use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rw,suid,dev,exec,nouser,async&amp;lt;/span&amp;gt; instead of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;defaults&amp;lt;/span&amp;gt;. The key option we don&#039;t want to use is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;auto&amp;lt;/span&amp;gt;, which is implied with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;defaults&amp;lt;/span&amp;gt;. The reason for avoiding this is to prevent the system from trying to mount the GFS2 partition during boot. With the cluster not running that early in the boot process, the GFS2 partition will effectively not exist at that point, so any attempt to mount it will fail.}}&lt;br /&gt;
&lt;br /&gt;
Now, to verify that everything is working, call &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;status&amp;lt;/span&amp;gt; against the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;gfs2&amp;lt;/span&amp;gt; initialization script.&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 try &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;stop&amp;lt;/span&amp;gt;&#039;ing &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;gfs2&amp;lt;/span&amp;gt;, checking the mounts with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;df&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;status&amp;lt;/span&amp;gt;, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;start&amp;lt;/span&amp;gt;&#039;ing &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;gfs2&amp;lt;/span&amp;gt; back up and doing a final &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;df&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;status&amp;lt;/span&amp;gt;. If all works well, the GFS2 volume should unmount and remount.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On Both Nodes&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
Stop:&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 filesystems:                               [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check that it has been unmounted:&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;
&amp;lt;/source&amp;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/sda2              20G  2.9G   16G  16% /&lt;br /&gt;
/dev/sda1             244M   33M  198M  15% /boot&lt;br /&gt;
tmpfs                 1.8G     0  1.8G   0% /dev/shm&lt;br /&gt;
none                  1.8G  104K  1.8G   1% /var/lib/xenstored&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now start the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;gfs2&amp;lt;/span&amp;gt; service 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 filesystems:                                 [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check that it has been re-mounted:&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;
&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/sda2              20G  2.9G   16G  16% /&lt;br /&gt;
/dev/sda1             244M   33M  198M  15% /boot&lt;br /&gt;
tmpfs                 1.8G     0  1.8G   0% /dev/shm&lt;br /&gt;
none                  1.8G  104K  1.8G   1% /var/lib/xenstored&lt;br /&gt;
/dev/mapper/drbd_sh0_vg0-xen_shared&lt;br /&gt;
                      9.4G  259M  9.1G   3% /xen_shared&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Perfect!&lt;br /&gt;
&lt;br /&gt;
= Managing Storage In The Cluster =&lt;br /&gt;
&lt;br /&gt;
The storage for the cluster is ready, but it hasn&#039;t actually been tied &#039;&#039;into&#039;&#039; the cluster. To do that, we will use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt;, within which we will add the &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; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;gfs2&amp;lt;/span&amp;gt; initialization scripts as cluster resources. We will create two failover domains, each one containing only one node. lastly, we will take those three resources and create a service tree.&lt;br /&gt;
&lt;br /&gt;
== Covering Some New Terms ==&lt;br /&gt;
&lt;br /&gt;
Now, let&#039;s back up and talk a bit about those three new terms.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Resources&#039;&#039;&#039; are items that can be used in one or more services.&lt;br /&gt;
* &#039;&#039;&#039;Services&#039;&#039;&#039; consist of one or more resources, either in series, parallel or a combination of both, that are managed by the cluster.&lt;br /&gt;
* &#039;&#039;&#039;Failover Domains&#039;&#039;&#039; are logical groups of one or more nodes. Services can run strictly within a failover group, or they can be allowed to run outside of the failover domain when no member domains are available.&lt;br /&gt;
&lt;br /&gt;
== An Overview Of How We Will Manage Storage In The Cluster ==&lt;br /&gt;
&lt;br /&gt;
So what we are going to do here is:&lt;br /&gt;
* Create three &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;script&amp;lt;/span&amp;gt; resources&lt;br /&gt;
* Create two failover domains. One containing just &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04.alteeve.com&amp;lt;/span&amp;gt; and the other containing just &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05.alteeve.com&amp;lt;/span&amp;gt;. We will restrict services within these domains to only run within this domain, effectively locking the service to the node.&lt;br /&gt;
* Within each failover domain, we will create a service with a serial resource tree. This tree will start &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;drbd&amp;lt;/span&amp;gt;, then &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clvmd&amp;lt;/span&amp;gt; and finally &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;gfs2&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The reason for this is so that when &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; starts, it will start each failover domain&#039;s service which, in turn, will start the clustered storage daemons in the proper order.&lt;br /&gt;
&lt;br /&gt;
== Why Not Start The Daemons At Boot Time? ==&lt;br /&gt;
&lt;br /&gt;
This might seem like over kill, and arguably it is. The reason I still find it worth while is that if a storage daemon like [[DRBD]] hangs on boot, you can find yourself with a node that you can not access. Many folk have their nodes in data centers so gaining direct access can be a pain, to be polite. So by moving these daemons over to the cluster, and knowing that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; itself will start late in the boot process, we are much more likely to still have remote access when things go bad.&lt;br /&gt;
&lt;br /&gt;
I used DRBD as an example on purpose. I prefer to have DRBD resources wait forever to connect to the other node when starting up. This way, if one node starts somewhat later than the other, the first node&#039;s DRBD resource won&#039;t risk split-braining. it will happily wait until it&#039;s partner node comes up and starts it&#039;s own DRBD daemon. The downside to this is that DRBD will effectively hang the boot process forever if the other node can&#039;t be started. By managing DRBD in the cluster, we leave open the option of logging in and telling DRBD to stop waiting when we know the other node will not be booting.&lt;br /&gt;
&lt;br /&gt;
== Adding rgmanager To cluster.conf ==&lt;br /&gt;
&lt;br /&gt;
Everything related to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; is an element of the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;[[RHCS_v2_cluster.conf#rm.3B_The_Resource_Manager|rm]] /&amp;gt;&amp;lt;/span&amp;gt; tag. Within that, the actual resources are themselves elements of the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;resources /&amp;gt;&amp;lt;/span&amp;gt; tag. We&#039;ll start by creating these tags, then we&#039;ll look at the actual resources.&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-cluster01&amp;quot; config_version=&amp;quot;10&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;cman expected_votes=&amp;quot;1&amp;quot; two_node=&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-node04.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;fence_na01&amp;quot; port=&amp;quot;04&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-node05.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;fence_na01&amp;quot; port=&amp;quot;03&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_na01&amp;quot; agent=&amp;quot;fence_na&amp;quot; ipaddr=&amp;quot;fence_na01.alteeve.com&amp;quot; login=&amp;quot;admin&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;fence_daemon post_join_delay=&amp;quot;60&amp;quot;/&amp;gt;&lt;br /&gt;
        &amp;lt;totem rrp_mode=&amp;quot;none&amp;quot; secauth=&amp;quot;off&amp;quot;/&amp;gt;&lt;br /&gt;
        &amp;lt;rm&amp;gt;&lt;br /&gt;
                &amp;lt;resources/&amp;gt;&lt;br /&gt;
                &amp;lt;failoverdomains /&amp;gt;&lt;br /&gt;
        &amp;lt;/rm&amp;gt;&lt;br /&gt;
&amp;lt;/cluster&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There are several attributes available for the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rm&amp;lt;/span&amp;gt;, though we don&#039;t need to worry about them now as the defaults are sane. It&#039;s primary purpose is to act as a container for &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;failoverdomains /&amp;gt;&amp;lt;/span&amp;gt;, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;resources /&amp;gt;&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;service /&amp;gt;&amp;lt;/span&amp;gt; tags. We&#039;ll be working with all three of these now. We&#039;re not putting an empty &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;service /&amp;gt;&amp;lt;/span&amp;gt; tag in because they must contain and attribute, which we are not ready to do yet.&lt;br /&gt;
&lt;br /&gt;
=== Adding Resources to cluster.conf ===&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;resources&amp;lt;/span&amp;gt; tag has no attributes of it&#039;s own. It solely acts as a container for various resource tags. There are many types of resources, but we will only be using the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;script /&amp;gt;&amp;lt;/span&amp;gt; tag in this cluster.&lt;br /&gt;
&lt;br /&gt;
Let&#039;s look at the three scripts we&#039;re going to add; &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-cluster01&amp;quot; config_version=&amp;quot;11&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;cman expected_votes=&amp;quot;1&amp;quot; two_node=&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-node04.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;fence_na01&amp;quot; port=&amp;quot;04&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-node05.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;fence_na01&amp;quot; port=&amp;quot;03&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_na01&amp;quot; agent=&amp;quot;fence_na&amp;quot; ipaddr=&amp;quot;fence_na01.alteeve.com&amp;quot; login=&amp;quot;admin&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;fence_daemon post_join_delay=&amp;quot;60&amp;quot;/&amp;gt;&lt;br /&gt;
        &amp;lt;totem rrp_mode=&amp;quot;none&amp;quot; secauth=&amp;quot;off&amp;quot;/&amp;gt;&lt;br /&gt;
        &amp;lt;rm&amp;gt;&lt;br /&gt;
                &amp;lt;resources&amp;gt;&lt;br /&gt;
                        &amp;lt;script file=&amp;quot;/etc/init.d/drbd&amp;quot; name=&amp;quot;drbd&amp;quot;/&amp;gt;&lt;br /&gt;
                        &amp;lt;script file=&amp;quot;/etc/init.d/clvmd&amp;quot; name=&amp;quot;clvmd&amp;quot;/&amp;gt;&lt;br /&gt;
                        &amp;lt;script file=&amp;quot;/etc/init.d/gfs2&amp;quot; name=&amp;quot;gfs2&amp;quot;/&amp;gt;&lt;br /&gt;
                &amp;lt;/resources&amp;gt;&lt;br /&gt;
                &amp;lt;failoverdomains /&amp;gt;&lt;br /&gt;
        &amp;lt;/rm&amp;gt;&lt;br /&gt;
&amp;lt;/cluster&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The main two attributes used by &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;script /&amp;gt;&amp;lt;/span&amp;gt; are &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;file&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;name&amp;lt;/span&amp;gt;. The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;file&amp;lt;/span&amp;gt; attribute is the path to the script and the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;name&amp;lt;/span&amp;gt; will be used to reference this script when we create our &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;service /&amp;gt;&amp;lt;/span&amp;gt; resource tree later.&lt;br /&gt;
&lt;br /&gt;
{{note|1=Scripts must work like initialization scripts. That is, they need to support being called with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;start&amp;lt;/span&amp;gt;, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;stop&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;status&amp;lt;/span&amp;gt; arguments.}}&lt;br /&gt;
&lt;br /&gt;
=== Adding Failover Domains to cluster.conf ===&lt;br /&gt;
&lt;br /&gt;
Failover domains are, at their most basic, a collection of one or more nodes in the cluster. Services can then be configured to operate within the context of a given failover domain. There are a few key options to be aware of.&lt;br /&gt;
&lt;br /&gt;
* A failover domain can be unordered or prioritized.&lt;br /&gt;
** When unordered, a service will relocate to another random node in the domain.&lt;br /&gt;
** When prioritized, a service will relocate to the highest-priority node in the domain.&lt;br /&gt;
* A failover domain can be restricted or unrestricted.&lt;br /&gt;
** When restricted, a service is &#039;&#039;&#039;only&#039;&#039;&#039; allowed to relocate to nodes in the domain. When no nodes are available, a service is stopped.&lt;br /&gt;
** When unrestricted, a service will try to relocate to a node in the domain. However, when no domain members are available, a service attempts to start on another node in the cluster.&lt;br /&gt;
* A failover domain can have a failback policy.&lt;br /&gt;
** When a domain allows for failback and the domain is ordered, a service will migrate to the highest priority node in the domain. This allows for automated restoration of services on a failed node when it rejoins the cluster.&lt;br /&gt;
** When a domain does not allow for failback, but is unrestricted, failback of services that fell out of the domain will happen anyway. However, once the service is within the domain, the service will &#039;&#039;&#039;not&#039;&#039;&#039; relocate to a higher-priority node should one become available later.&lt;br /&gt;
** When a domain does not allow for failback and is restricted, then failback of services will never occur.&lt;br /&gt;
&lt;br /&gt;
What we are going to do now is create two restricted failover domains with no relocation. Each of these will contain just one of the nodes. This will effectively lock their services to the node. This way, services assigned to each domain will be started and maintained by the cluster, but they will &#039;&#039;&#039;not&#039;&#039;&#039; be highly available. The services we will create will have local initialization scripts, so this is perfectly fine. &lt;br /&gt;
&lt;br /&gt;
This is how we will get the cluster to start and maintain out clustered storage daemons.&lt;br /&gt;
&lt;br /&gt;
The format for defining failover domains is to create a &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;failoverdomains&amp;gt;&amp;lt;/span&amp;gt; tag, which has no attributes, and acts as a container for one or more &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;failoverdomain&amp;gt;&amp;lt;/span&amp;gt; tags. Each &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;failoverdomain&amp;gt;&amp;lt;/span&amp;gt; tag has four attributes and acts as a container for one or more &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;failoverdomainnode /&amp;gt;&amp;lt;/span&amp;gt; tags.&lt;br /&gt;
&lt;br /&gt;
The only required attribute in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;failoverdomain /&amp;gt;&amp;lt;/span&amp;gt; is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;name=&amp;quot;&amp;quot;&amp;lt;/span&amp;gt;. This is the name that will be used later when we want to bind a service to a given failover domain. By default, a failover domain is unordered, thus making failback meaningless, and it is unrestricted. When ordered, the default is to allow for failback.&lt;br /&gt;
&lt;br /&gt;
The individual &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;failoverdomainnode /&amp;gt;&amp;lt;/span&amp;gt; have two attributes; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;name&amp;lt;/span&amp;gt;, which must match the given node&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;clusternode name=&amp;quot;...&amp;quot;&amp;lt;/span&amp;gt;, and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;priority=&amp;quot;x&amp;quot;&amp;lt;/span&amp;gt;, where &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;x&amp;lt;/span&amp;gt; is an integer. when only one node is defined or when a failover domain in unordered, the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;priority&amp;lt;/span&amp;gt; is ignored. When two or more nodes are defined and the domain is ordered, then nodes with the lowest number has the highest priority for hosting services. That is, a node with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;priority=&amp;quot;1&amp;quot;&amp;lt;/span&amp;gt; will be preferred to a node with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;priority=&amp;quot;2&amp;quot;&amp;lt;/span&amp;gt;.&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-cluster01&amp;quot; config_version=&amp;quot;12&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;cman expected_votes=&amp;quot;1&amp;quot; two_node=&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-node04.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;fence_na01&amp;quot; port=&amp;quot;04&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-node05.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;fence_na01&amp;quot; port=&amp;quot;03&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_na01&amp;quot; agent=&amp;quot;fence_na&amp;quot; ipaddr=&amp;quot;fence_na01.alteeve.com&amp;quot; login=&amp;quot;admin&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;fence_daemon post_join_delay=&amp;quot;60&amp;quot;/&amp;gt;&lt;br /&gt;
        &amp;lt;totem rrp_mode=&amp;quot;none&amp;quot; secauth=&amp;quot;off&amp;quot;/&amp;gt;&lt;br /&gt;
        &amp;lt;rm&amp;gt;&lt;br /&gt;
                &amp;lt;resources&amp;gt;&lt;br /&gt;
                        &amp;lt;script file=&amp;quot;/etc/init.d/drbd&amp;quot; name=&amp;quot;drbd&amp;quot;/&amp;gt;&lt;br /&gt;
                        &amp;lt;script file=&amp;quot;/etc/init.d/clvmd&amp;quot; name=&amp;quot;clvmd&amp;quot;/&amp;gt;&lt;br /&gt;
                        &amp;lt;script file=&amp;quot;/etc/init.d/gfs2&amp;quot; name=&amp;quot;gfs2&amp;quot;/&amp;gt;&lt;br /&gt;
                &amp;lt;/resources&amp;gt;&lt;br /&gt;
		&amp;lt;failoverdomains&amp;gt;&lt;br /&gt;
			&amp;lt;failoverdomain name=&amp;quot;an4_only&amp;quot; nofailback=&amp;quot;0&amp;quot; ordered=&amp;quot;0&amp;quot; restricted=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
				&amp;lt;failoverdomainnode name=&amp;quot;an-node04.alteeve.com&amp;quot; priority=&amp;quot;1&amp;quot;/&amp;gt;&lt;br /&gt;
			&amp;lt;/failoverdomain&amp;gt;&lt;br /&gt;
			&amp;lt;failoverdomain name=&amp;quot;an5_only&amp;quot; nofailback=&amp;quot;0&amp;quot; ordered=&amp;quot;0&amp;quot; restricted=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
				&amp;lt;failoverdomainnode name=&amp;quot;an-node05.alteeve.com&amp;quot; priority=&amp;quot;1&amp;quot;/&amp;gt;&lt;br /&gt;
			&amp;lt;/failoverdomain&amp;gt;&lt;br /&gt;
		&amp;lt;/failoverdomains&amp;gt;&lt;br /&gt;
        &amp;lt;/rm&amp;gt;&lt;br /&gt;
&amp;lt;/cluster&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So here we&#039;ve now created two failover domains; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an4_only&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an5_only&amp;lt;/span&amp;gt;. Both of these are &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;restricted=&amp;quot;1&amp;quot;&amp;lt;/span&amp;gt;, so services within these domains will never try to start on other nodes. Both &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;nofailback=&amp;quot;0&amp;quot;&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ordered=&amp;quot;0&amp;quot;&amp;lt;/span&amp;gt; are defined, but they have no meaning because the two domains have only one node each.&lt;br /&gt;
&lt;br /&gt;
Within each domain, the corresponding &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;failoverdomainnode /&amp;gt;&amp;lt;/span&amp;gt; is defined. Notice that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;priority=&amp;quot;1&amp;quot;&amp;lt;/span&amp;gt; is set, despite having no use. This attribute must exist regardless. The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;name=&amp;quot;an-node0x.alteeve.com&amp;lt;/span&amp;gt; links the node to it&#039;s corresponding &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;clusternode name=&amp;quot;an-node0x.alteeve.com&amp;quot;&amp;lt;/span&amp;gt; entry in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;clusternodes /&amp;gt;&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Creating the Storage Services in cluster.conf ===&lt;br /&gt;
&lt;br /&gt;
The last piece of the resource management puzzle are the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;service /&amp;gt;&amp;lt;/span&amp;gt; tags. These tags are where the actually resources are tied together, assigned to a failover domain and put under the cluster&#039;s control. The resource elements can be defined as parallel tags, a resource can be an elements of another to form dependency branches or they can be a combination of both. In our case, we want to make sure that each storage daemon successfully starts before the next service starts so we will be creating a dependency tree of resources. Specifically, we want to ensure that the start order is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;drbd&amp;lt;/span&amp;gt; -&amp;gt; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clvmd&amp;lt;/span&amp;gt; -&amp;gt; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;gfs2&amp;lt;/span&amp;gt;. The shut-down will be the reverse order.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;service /&amp;gt;&amp;lt;/span&amp;gt; tag has just one required attribute, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;name=&amp;quot;&amp;quot;&amp;lt;/span&amp;gt;, which is used in tools like Conga for identifying the service. The name can be descriptive, but it must be unique. There are several optional attributes, though we will only be looking at five of them.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;domain=&amp;quot;&amp;quot;&amp;lt;/span&amp;gt; is used to assign the given &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;service /&amp;gt;&amp;lt;/span&amp;gt; to failover domain. The name set here must match a &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;failoverdomain name=&amp;quot;&amp;quot; /&amp;gt;&amp;lt;/span&amp;gt;. Note that you &#039;&#039;do not&#039;&#039; need to define a failover domain. &lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;autostart=&amp;quot;[0|1]&amp;quot;&amp;lt;/span&amp;gt; controls whether or not the service is automatically started when &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; starts. We&#039;ll be disabling this for now, but we will come back and enable it after our initial testing is done.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;exclusive=&amp;quot;[0|1]&amp;quot;&amp;lt;/span&amp;gt; controls whether this service must run exclusively on a given node. &#039;&#039;&#039;Warning&#039;&#039;&#039;: If this is enabled, then no other service will be allowed to run on the node hosting this service.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;recover=&amp;quot;[restart|relocate|disable]&amp;quot;&amp;lt;/span&amp;gt; controls what &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; will do when this service fails. The services we&#039;re going to create now are only designed to run on one node, so &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;restart&amp;lt;/span&amp;gt; is the only policy that makes sense.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;max_restarts=&amp;quot;x&amp;quot;&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 number of times that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; will try to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;restart&amp;lt;/span&amp;gt; a given service. After &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;x&amp;lt;/span&amp;gt; failures, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; will instead &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;relocate&amp;lt;/span&amp;gt; the service based on the failover domain policy, when set. In our case, the failover domains prevent the service from running outside the domain, and the domain has only one node, so this value is effectively meaningless to us.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;restart_expire_time=&amp;quot;x&amp;quot;&amp;lt;/span&amp;gt;, where &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;x&amp;lt;/span&amp;gt; is a number of seconds. When &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;max_restarts&amp;lt;/span&amp;gt; is greater than &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;0&amp;lt;/span&amp;gt;, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; keeps a count of how many times a service has failed. These service failures &amp;quot;expire&amp;quot; after the number of seconds defined here. This is used so that the service failure count can reduce back down to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;0&amp;lt;/span&amp;gt; once things have been shown to be stable for a reasonable amount of time. As we&#039;re using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;max_restarts=&amp;quot;0&amp;quot;&amp;lt;/span&amp;gt; and the failover domain prevents relocation of the service, this value is effectively meaningless to us.&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-cluster01&amp;quot; config_version=&amp;quot;13&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;cman expected_votes=&amp;quot;1&amp;quot; two_node=&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-node04.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;fence_na01&amp;quot; port=&amp;quot;04&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-node05.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;fence_na01&amp;quot; port=&amp;quot;03&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_na01&amp;quot; agent=&amp;quot;fence_na&amp;quot; ipaddr=&amp;quot;fence_na01.alteeve.com&amp;quot; login=&amp;quot;admin&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;fence_daemon post_join_delay=&amp;quot;60&amp;quot;/&amp;gt;&lt;br /&gt;
        &amp;lt;totem rrp_mode=&amp;quot;none&amp;quot; secauth=&amp;quot;off&amp;quot;/&amp;gt;&lt;br /&gt;
	&amp;lt;rm&amp;gt;&lt;br /&gt;
		&amp;lt;resources&amp;gt;&lt;br /&gt;
			&amp;lt;script file=&amp;quot;/etc/init.d/drbd&amp;quot; name=&amp;quot;drbd&amp;quot;/&amp;gt;&lt;br /&gt;
			&amp;lt;script file=&amp;quot;/etc/init.d/clvmd&amp;quot; name=&amp;quot;clvmd&amp;quot;/&amp;gt;&lt;br /&gt;
			&amp;lt;script file=&amp;quot;/etc/init.d/gfs2&amp;quot; name=&amp;quot;gfs2&amp;quot;/&amp;gt;&lt;br /&gt;
		&amp;lt;/resources&amp;gt;&lt;br /&gt;
		&amp;lt;failoverdomains&amp;gt;&lt;br /&gt;
			&amp;lt;failoverdomain name=&amp;quot;an4_only&amp;quot; nofailback=&amp;quot;0&amp;quot; ordered=&amp;quot;0&amp;quot; restricted=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
				&amp;lt;failoverdomainnode name=&amp;quot;an-node04.alteeve.com&amp;quot; priority=&amp;quot;1&amp;quot;/&amp;gt;&lt;br /&gt;
			&amp;lt;/failoverdomain&amp;gt;&lt;br /&gt;
			&amp;lt;failoverdomain name=&amp;quot;an5_only&amp;quot; nofailback=&amp;quot;0&amp;quot; ordered=&amp;quot;0&amp;quot; restricted=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
				&amp;lt;failoverdomainnode name=&amp;quot;an-node05.alteeve.com&amp;quot; priority=&amp;quot;1&amp;quot;/&amp;gt;&lt;br /&gt;
			&amp;lt;/failoverdomain&amp;gt;&lt;br /&gt;
		&amp;lt;/failoverdomains&amp;gt;&lt;br /&gt;
		&amp;lt;service autostart=&amp;quot;0&amp;quot; domain=&amp;quot;an4_only&amp;quot; exclusive=&amp;quot;0&amp;quot; max_restarts=&amp;quot;0&amp;quot; name=&amp;quot;an4_storage&amp;quot; recovery=&amp;quot;restart&amp;quot; restart_expire_time=&amp;quot;0&amp;quot;&amp;gt;&lt;br /&gt;
			&amp;lt;script ref=&amp;quot;drbd&amp;quot;&amp;gt;&lt;br /&gt;
				&amp;lt;script ref=&amp;quot;clvmd&amp;quot;&amp;gt;&lt;br /&gt;
					&amp;lt;script ref=&amp;quot;gfs2&amp;quot;/&amp;gt;&lt;br /&gt;
				&amp;lt;/script&amp;gt;&lt;br /&gt;
			&amp;lt;/script&amp;gt;&lt;br /&gt;
		&amp;lt;/service&amp;gt;&lt;br /&gt;
		&amp;lt;service autostart=&amp;quot;0&amp;quot; domain=&amp;quot;an5_only&amp;quot; exclusive=&amp;quot;0&amp;quot; max_restarts=&amp;quot;0&amp;quot; name=&amp;quot;an5_storage&amp;quot; recovery=&amp;quot;restart&amp;quot; restart_expire_time=&amp;quot;0&amp;quot;&amp;gt;&lt;br /&gt;
			&amp;lt;script ref=&amp;quot;drbd&amp;quot;&amp;gt;&lt;br /&gt;
				&amp;lt;script ref=&amp;quot;clvmd&amp;quot;&amp;gt;&lt;br /&gt;
					&amp;lt;script ref=&amp;quot;gfs2&amp;quot;/&amp;gt;&lt;br /&gt;
				&amp;lt;/script&amp;gt;&lt;br /&gt;
			&amp;lt;/script&amp;gt;&lt;br /&gt;
		&amp;lt;/service&amp;gt;&lt;br /&gt;
	&amp;lt;/rm&amp;gt;&lt;br /&gt;
&amp;lt;/cluster&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So what we&#039;ve done here is create our two &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;service /&amp;gt;&amp;lt;/span&amp;gt; groups; One for the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an4_only&amp;lt;/span&amp;gt; failover domain and another matching service for &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an5_only&amp;lt;/span&amp;gt;. Both have their recovery policy set to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;recovery=&amp;quot;restart&amp;quot;&amp;lt;/span&amp;gt; and neither are configured to start with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Each &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;service /&amp;gt;&amp;lt;/span&amp;gt; tag&#039;s element is a collection of three &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;script /&amp;gt;&amp;lt;/span&amp;gt; resource references. The scripts are referenced using the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;script ref=&amp;quot;x&amp;quot; /&amp;gt;&amp;lt;/span&amp;gt; attribute, where &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;x&amp;lt;/span&amp;gt; must match a &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;resource name=&amp;quot;x&amp;quot; /&amp;gt;&amp;lt;/span&amp;gt; element in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;resources&amp;gt;&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
These references are embedded to form a dependency tree. The tree is formatted to start &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;drbd&amp;lt;/span&amp;gt; first, then when that starts successfully, it will start &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clvmd&amp;lt;/span&amp;gt; and then, finally, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;gfs2&amp;lt;/span&amp;gt;. When this service is disabled, this dependency tree is stopped in the reverse order. &lt;br /&gt;
&lt;br /&gt;
=== Validating the Additions to cluster.conf ===&lt;br /&gt;
&lt;br /&gt;
Seeing as we&#039;ve made some fairly significant changes to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/cluster/cluster.conf&amp;lt;/span&amp;gt;, we&#039;ll want to re-validate it before pushing it out to the other node.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
xmllint --relaxng /usr/share/system-config-cluster/misc/cluster.ng /etc/cluster/cluster.conf&lt;br /&gt;
&amp;lt;/source&amp;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-cluster01&amp;quot; config_version=&amp;quot;13&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;cman expected_votes=&amp;quot;1&amp;quot; two_node=&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-node04.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;fence_na01&amp;quot; port=&amp;quot;04&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-node05.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;fence_na01&amp;quot; port=&amp;quot;03&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_na01&amp;quot; agent=&amp;quot;fence_na&amp;quot; ipaddr=&amp;quot;fence_na01.alteeve.com&amp;quot; login=&amp;quot;admin&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;fence_daemon post_join_delay=&amp;quot;60&amp;quot;/&amp;gt;&lt;br /&gt;
        &amp;lt;totem rrp_mode=&amp;quot;none&amp;quot; secauth=&amp;quot;off&amp;quot;/&amp;gt;&lt;br /&gt;
	&amp;lt;rm&amp;gt;&lt;br /&gt;
		&amp;lt;resources&amp;gt;&lt;br /&gt;
			&amp;lt;script file=&amp;quot;/etc/init.d/drbd&amp;quot; name=&amp;quot;drbd&amp;quot;/&amp;gt;&lt;br /&gt;
			&amp;lt;script file=&amp;quot;/etc/init.d/clvmd&amp;quot; name=&amp;quot;clvmd&amp;quot;/&amp;gt;&lt;br /&gt;
			&amp;lt;script file=&amp;quot;/etc/init.d/gfs2&amp;quot; name=&amp;quot;gfs2&amp;quot;/&amp;gt;&lt;br /&gt;
		&amp;lt;/resources&amp;gt;&lt;br /&gt;
		&amp;lt;failoverdomains&amp;gt;&lt;br /&gt;
			&amp;lt;failoverdomain name=&amp;quot;an4_only&amp;quot; nofailback=&amp;quot;0&amp;quot; ordered=&amp;quot;0&amp;quot; restricted=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
				&amp;lt;failoverdomainnode name=&amp;quot;an-node04.alteeve.com&amp;quot; priority=&amp;quot;1&amp;quot;/&amp;gt;&lt;br /&gt;
			&amp;lt;/failoverdomain&amp;gt;&lt;br /&gt;
			&amp;lt;failoverdomain name=&amp;quot;an5_only&amp;quot; nofailback=&amp;quot;0&amp;quot; ordered=&amp;quot;0&amp;quot; restricted=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
				&amp;lt;failoverdomainnode name=&amp;quot;an-node05.alteeve.com&amp;quot; priority=&amp;quot;1&amp;quot;/&amp;gt;&lt;br /&gt;
			&amp;lt;/failoverdomain&amp;gt;&lt;br /&gt;
		&amp;lt;/failoverdomains&amp;gt;&lt;br /&gt;
		&amp;lt;service autostart=&amp;quot;0&amp;quot; domain=&amp;quot;an4_only&amp;quot; exclusive=&amp;quot;0&amp;quot; max_restarts=&amp;quot;0&amp;quot; name=&amp;quot;an4_storage&amp;quot; recovery=&amp;quot;restart&amp;quot; restart_expire_time=&amp;quot;0&amp;quot;&amp;gt;&lt;br /&gt;
			&amp;lt;script ref=&amp;quot;drbd&amp;quot;&amp;gt;&lt;br /&gt;
				&amp;lt;script ref=&amp;quot;clvmd&amp;quot;&amp;gt;&lt;br /&gt;
					&amp;lt;script ref=&amp;quot;gfs2&amp;quot;/&amp;gt;&lt;br /&gt;
				&amp;lt;/script&amp;gt;&lt;br /&gt;
			&amp;lt;/script&amp;gt;&lt;br /&gt;
		&amp;lt;/service&amp;gt;&lt;br /&gt;
		&amp;lt;service autostart=&amp;quot;0&amp;quot; domain=&amp;quot;an5_only&amp;quot; exclusive=&amp;quot;0&amp;quot; max_restarts=&amp;quot;0&amp;quot; name=&amp;quot;an5_storage&amp;quot; recovery=&amp;quot;restart&amp;quot; restart_expire_time=&amp;quot;0&amp;quot;&amp;gt;&lt;br /&gt;
			&amp;lt;script ref=&amp;quot;drbd&amp;quot;&amp;gt;&lt;br /&gt;
				&amp;lt;script ref=&amp;quot;clvmd&amp;quot;&amp;gt;&lt;br /&gt;
					&amp;lt;script ref=&amp;quot;gfs2&amp;quot;/&amp;gt;&lt;br /&gt;
				&amp;lt;/script&amp;gt;&lt;br /&gt;
			&amp;lt;/script&amp;gt;&lt;br /&gt;
		&amp;lt;/service&amp;gt;&lt;br /&gt;
	&amp;lt;/rm&amp;gt;&lt;br /&gt;
&amp;lt;/cluster&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;
/etc/cluster/cluster.conf validates&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If there was a problem, you need to go back and fix it. &#039;&#039;&#039;DO NOT&#039;&#039;&#039; proceed until your configuration validates. Once it does, we&#039;re ready to move on!&lt;br /&gt;
&lt;br /&gt;
With it validated, we need to push it to the other node. The cluster should be running now, so instead of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rsync&amp;lt;/span&amp;gt;, we can use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ccs_tool&amp;lt;/span&amp;gt;, the &amp;quot;cluster configuration system (tool)&amp;quot;, to push the new &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cluster.conf&amp;lt;/span&amp;gt; to the other node and upgrade the cluster&#039;s version in one shot.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ccs_tool update /etc/cluster/cluster.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;
Config file updated from version 9 to 13&lt;br /&gt;
&lt;br /&gt;
Update complete.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you tool at &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/var/log/messages&amp;lt;/span&amp;gt; on the other node, you should see something like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
May  7 20:32:08 an-node05 ccsd[4134]: Update of cluster.conf complete (version 9 -&amp;gt; 13). &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Starting rgmanager ==&lt;br /&gt;
&lt;br /&gt;
Now that we have services, we will want to manually start &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt;. We&#039;re not yet going to set it to automatically start as we&#039;re not yet automatically starting &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt;, which it depends on. This will be done later when the testing is complete.&lt;br /&gt;
&lt;br /&gt;
So make sure that the cluster is up and running.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cman_tool 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;
Version: 6.2.0&lt;br /&gt;
Config Version: 13&lt;br /&gt;
Cluster Name: an-cluster01&lt;br /&gt;
Cluster Id: 60257&lt;br /&gt;
Cluster Member: Yes&lt;br /&gt;
Cluster Generation: 140&lt;br /&gt;
Membership state: Cluster-Member&lt;br /&gt;
Nodes: 2&lt;br /&gt;
Expected votes: 1&lt;br /&gt;
Total votes: 2&lt;br /&gt;
Quorum: 1  &lt;br /&gt;
Active subsystems: 8&lt;br /&gt;
Flags: 2node Dirty &lt;br /&gt;
Ports Bound: 0 11  &lt;br /&gt;
Node name: an-node04.alteeve.com&lt;br /&gt;
Node ID: 1&lt;br /&gt;
Multicast addresses: 239.192.235.77 &lt;br /&gt;
Node addresses: 192.168.3.74 &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You will want to stop all of the storage daemons &#039;&#039;&#039;before&#039;&#039;&#039; starting &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt;. This is because &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; will always stop any services before it tries to start them itself. This includes virtual machines, as we will see in a bit.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On both nodes&#039;&#039;&#039;:&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 filesystems:                               [  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;
/etc/init.d/clvmd 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;
Deactivating clustered VG(s):   0 logical volume(s) in volume group &amp;quot;drbd_an5_vg0&amp;quot; now active&lt;br /&gt;
  0 logical volume(s) in volume group &amp;quot;drbd_an4_vg0&amp;quot; now active&lt;br /&gt;
  0 logical volume(s) in volume group &amp;quot;drbd_sh0_vg0&amp;quot; now active&lt;br /&gt;
                                                           [  OK  ]&lt;br /&gt;
Signaling clvmd to exit                                    [  OK  ]&lt;br /&gt;
clvmd terminated                                           [  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;
/etc/init.d/drbd 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;
Stopping all DRBD resources: .&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;rgmanager&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/rgmanager 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 Cluster Service Manager:                          [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Monitoring Resources ===&lt;br /&gt;
&lt;br /&gt;
We will now use a tool called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clustat&amp;lt;/span&amp;gt; that lets us see what state the cluster&#039;s resources are in. You can run it as a once-off check of the services, or you can use the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;-i x&amp;lt;/span&amp;gt; switch, where &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;x&amp;lt;/span&amp;gt; is a number of seconds to wait between re-checking the cluster service states. If you use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;-i x&amp;lt;/span&amp;gt;, you will need to use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;ctrl&amp;gt;&amp;lt;/span&amp;gt;+&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;c&amp;gt;&amp;lt;/span&amp;gt; to quit and return to the shell.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
clustat&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Cluster Status for an-cluster01 @ Sat May  7 22:30:24 2011&lt;br /&gt;
Member Status: Quorate&lt;br /&gt;
&lt;br /&gt;
 Member Name                             ID   Status&lt;br /&gt;
 ------ ----                             ---- ------&lt;br /&gt;
 an-node04.alteeve.com                       1 Online, Local, rgmanager&lt;br /&gt;
 an-node05.alteeve.com                       2 Online, rgmanager&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State         &lt;br /&gt;
 ------- ----                   ----- ------                   -----         &lt;br /&gt;
 service:an4_storage            (none)                         disabled      &lt;br /&gt;
 service:an5_storage            (none)                         disabled      &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you remember earlier, we set the services to not &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;autostart&amp;lt;/span&amp;gt;, thus, they are disabled.&lt;br /&gt;
&lt;br /&gt;
=== Managing Cluster Resources ===&lt;br /&gt;
&lt;br /&gt;
Managing services in the cluster is done with a fairly simple tool called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clusvcadm&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The main commands we&#039;re going to look at shortly are:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clusvcadm -e &amp;lt;service&amp;gt; -m &amp;lt;node&amp;gt;&amp;lt;/span&amp;gt;: Enable the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;service&amp;gt;&amp;lt;/span&amp;gt; on the specified &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;node&amp;gt;&amp;lt;/span&amp;gt;. When a &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;node&amp;gt;&amp;lt;/span&amp;gt; is not specified, the local node where the command was run is assumed.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clusvcadm -d &amp;lt;service&amp;gt; -m &amp;lt;node&amp;gt;&amp;lt;/span&amp;gt;: Disable the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;service&amp;gt;&amp;lt;/span&amp;gt;.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clusvcadm -l &amp;lt;service&amp;gt;&amp;lt;/span&amp;gt;: Locks the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;service&amp;gt;&amp;lt;/span&amp;gt; prior to a cluster shutdown. The only action allowed when a &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;service&amp;gt;&amp;lt;/span&amp;gt; is frozen is disabling it. This allows you to stop the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;service&amp;gt;&amp;lt;/span&amp;gt; so that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; doesn&#039;t try to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;recover&amp;lt;/span&amp;gt; it (&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;restart&amp;lt;/span&amp;gt;, in our two services). Once [[quorum]] is dissolved and the cluster is shut down, the service is unlocked and returns to normal operation next time the node regains quorum.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clusvcadm -u &amp;lt;service&amp;gt;&amp;lt;/span&amp;gt;: Unlocks a &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;service&amp;gt;&amp;lt;/span&amp;gt;, should you change your mind and decide not to stop the cluster.&lt;br /&gt;
&lt;br /&gt;
There are other ways to use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clusvcadm&amp;lt;/span&amp;gt; which we will look at after the virtual servers are provisioned and under cluster control.&lt;br /&gt;
&lt;br /&gt;
=== A Note On Resource Management With DRBD ===&lt;br /&gt;
&lt;br /&gt;
We have something of a unique setup here, using DRBD, that requires a brief discussion.&lt;br /&gt;
&lt;br /&gt;
When the cluster starts for the first time, where neither node&#039;s DRBD storage was up, the first node to start will wait indefinitely for the second node to start. For this reason, we want to ensure that we enable the storage resources more or less at the same time and from two different terminals. The reason for two terminals is that the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clusvcadm -e ...&amp;lt;/span&amp;gt; command won&#039;t return until all resources have started, so you need the second terminal window to start the other node&#039;s clustered storage service while the first one waits.&lt;br /&gt;
&lt;br /&gt;
Keep an eye on [[syslog]], too. If anything goes wrong in DRBD and a split-brain is declared you will see messages like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Mar 29 20:24:37 an-node04 kernel: block drbd2: helper command: /sbin/drbdadm initial-split-brain minor-2&lt;br /&gt;
Mar 29 20:24:37 an-node04 kernel: block drbd2: helper command: /sbin/drbdadm initial-split-brain minor-2 exit code 0 (0x0)&lt;br /&gt;
Mar 29 20:24:37 an-node04 kernel: block drbd2: Split-Brain detected but unresolved, dropping connection!&lt;br /&gt;
Mar 29 20:24:37 an-node04 kernel: block drbd2: helper command: /sbin/drbdadm split-brain minor-2&lt;br /&gt;
Mar 29 20:24:37 an-node04 kernel: block drbd2: helper command: /sbin/drbdadm split-brain minor-2 exit code 0 (0x0)&lt;br /&gt;
Mar 29 20:24:37 an-node04 kernel: block drbd2: conn( WFReportParams -&amp;gt; Disconnecting )&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This can happen, for example, if you stop the cluster while DRBD is still up, and then break the network connection between the two DRBD resources. Recovering from a split-brain is covered in the trouble-shooting section below. &#039;&#039;&#039;ToDo&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{{note|1=Linbit has a good tutorial on recovering from split-brain conditions here: http://www.drbd.org/users-guide/s-resolve-split-brain.html}}&lt;br /&gt;
&lt;br /&gt;
=== Starting the Storage Services ===&lt;br /&gt;
&lt;br /&gt;
Now, with a terminal window opened for each node, run:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt;&#039;&#039;&#039;:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
clusvcadm -e service:an4_storage -m an-node04.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;
Member an-node04.alteeve.com trying to enable service:an4_storage...Success&lt;br /&gt;
service:an4_storage is now running on an-node04.alteeve.com&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt;&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
clusvcadm -e service:an5_storage -m an-node05.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;
Member an-node05.alteeve.com trying to enable service:an5_storage...Success&lt;br /&gt;
service:an5_storage is now running on an-node05.alteeve.com&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The [[syslog]] on either node should show something like this (sample from &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&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;
May  7 23:29:21 an-node04 clurgmgrd[12067]: &amp;lt;notice&amp;gt; Starting disabled service service:an4_storage &lt;br /&gt;
May  7 23:29:22 an-node04 kernel: drbd: initialized. Version: 8.3.8 (api:88/proto:86-94)&lt;br /&gt;
May  7 23:29:22 an-node04 kernel: drbd: GIT-hash: d78846e52224fd00562f7c225bcc25b2d422321d build by mockbuild@builder10.centos.org, 2010-06-04 08:04:27&lt;br /&gt;
May  7 23:29:22 an-node04 kernel: drbd: registered as block device major 147&lt;br /&gt;
May  7 23:29:22 an-node04 kernel: drbd: minor_table @ 0xffff8800cde780c0&lt;br /&gt;
May  7 23:29:22 an-node04 kernel: block drbd0: Starting worker thread (from cqueue/1 [152])&lt;br /&gt;
May  7 23:29:22 an-node04 kernel: klogd 1.4.1, ---------- state change ---------- &lt;br /&gt;
May  7 23:29:22 an-node04 kernel: block drbd0: disk( Diskless -&amp;gt; Attaching ) &lt;br /&gt;
May  7 23:29:22 an-node04 kernel: block drbd0: Found 4 transactions (98 active extents) in activity log.&lt;br /&gt;
May  7 23:29:22 an-node04 kernel: block drbd0: Method to ensure write ordering: barrier&lt;br /&gt;
May  7 23:29:22 an-node04 kernel: block drbd0: max_segment_size ( = BIO size ) = 32768&lt;br /&gt;
May  7 23:29:22 an-node04 kernel: block drbd0: drbd_bm_resize called with capacity == 19550368&lt;br /&gt;
May  7 23:29:22 an-node04 kernel: block drbd0: resync bitmap: bits=2443796 words=38185&lt;br /&gt;
May  7 23:29:22 an-node04 kernel: block drbd0: size = 9546 MB (9775184 KB)&lt;br /&gt;
May  7 23:29:22 an-node04 kernel: block drbd0: recounting of set bits took additional 1 jiffies&lt;br /&gt;
May  7 23:29:22 an-node04 kernel: block drbd0: 0 KB (0 bits) marked out-of-sync by on disk bit-map.&lt;br /&gt;
May  7 23:29:22 an-node04 kernel: block drbd0: disk( Attaching -&amp;gt; Outdated ) &lt;br /&gt;
May  7 23:29:22 an-node04 kernel: block drbd1: Starting worker thread (from cqueue/1 [152])&lt;br /&gt;
May  7 23:29:22 an-node04 kernel: block drbd1: disk( Diskless -&amp;gt; Attaching ) &lt;br /&gt;
May  7 23:29:22 an-node04 kernel: block drbd1: Found 1 transactions (1 active extents) in activity log.&lt;br /&gt;
May  7 23:29:22 an-node04 kernel: block drbd1: Method to ensure write ordering: barrier&lt;br /&gt;
May  7 23:29:22 an-node04 kernel: block drbd1: max_segment_size ( = BIO size ) = 32768&lt;br /&gt;
May  7 23:29:22 an-node04 kernel: block drbd1: drbd_bm_resize called with capacity == 195328232&lt;br /&gt;
May  7 23:29:22 an-node04 kernel: block drbd1: resync bitmap: bits=24416029 words=381501&lt;br /&gt;
May  7 23:29:22 an-node04 kernel: block drbd1: size = 93 GB (97664116 KB)&lt;br /&gt;
May  7 23:29:22 an-node04 kernel: block drbd1: recounting of set bits took additional 2 jiffies&lt;br /&gt;
May  7 23:29:22 an-node04 kernel: block drbd1: 0 KB (0 bits) marked out-of-sync by on disk bit-map.&lt;br /&gt;
May  7 23:29:22 an-node04 kernel: block drbd1: disk( Attaching -&amp;gt; Outdated ) &lt;br /&gt;
May  7 23:29:22 an-node04 kernel: block drbd2: Starting worker thread (from cqueue/1 [152])&lt;br /&gt;
May  7 23:29:22 an-node04 kernel: block drbd2: disk( Diskless -&amp;gt; Attaching ) &lt;br /&gt;
May  7 23:29:22 an-node04 kernel: block drbd2: Found 1 transactions (1 active extents) in activity log.&lt;br /&gt;
May  7 23:29:22 an-node04 kernel: block drbd2: Method to ensure write ordering: barrier&lt;br /&gt;
May  7 23:29:22 an-node04 kernel: block drbd2: max_segment_size ( = BIO size ) = 32768&lt;br /&gt;
May  7 23:29:22 an-node04 kernel: block drbd2: drbd_bm_resize called with capacity == 195328232&lt;br /&gt;
May  7 23:29:22 an-node04 kernel: block drbd2: resync bitmap: bits=24416029 words=381501&lt;br /&gt;
May  7 23:29:22 an-node04 kernel: block drbd2: size = 93 GB (97664116 KB)&lt;br /&gt;
May  7 23:29:22 an-node04 kernel: block drbd2: recounting of set bits took additional 2 jiffies&lt;br /&gt;
May  7 23:29:22 an-node04 kernel: block drbd2: 0 KB (0 bits) marked out-of-sync by on disk bit-map.&lt;br /&gt;
May  7 23:29:22 an-node04 kernel: block drbd2: disk( Attaching -&amp;gt; Outdated ) &lt;br /&gt;
May  7 23:29:22 an-node04 kernel: block drbd3: Starting worker thread (from cqueue/1 [152])&lt;br /&gt;
May  7 23:29:22 an-node04 kernel: block drbd3: disk( Diskless -&amp;gt; Attaching ) &lt;br /&gt;
May  7 23:29:22 an-node04 kernel: block drbd3: No usable activity log found.&lt;br /&gt;
May  7 23:29:22 an-node04 kernel: block drbd3: Method to ensure write ordering: barrier&lt;br /&gt;
May  7 23:29:22 an-node04 kernel: block drbd3: max_segment_size ( = BIO size ) = 32768&lt;br /&gt;
May  7 23:29:22 an-node04 kernel: block drbd3: drbd_bm_resize called with capacity == 515686680&lt;br /&gt;
May  7 23:29:22 an-node04 kernel: block drbd3: resync bitmap: bits=64460835 words=1007201&lt;br /&gt;
May  7 23:29:22 an-node04 kernel: block drbd3: size = 246 GB (257843340 KB)&lt;br /&gt;
May  7 23:29:22 an-node04 kernel: block drbd3: recounting of set bits took additional 5 jiffies&lt;br /&gt;
May  7 23:29:22 an-node04 kernel: block drbd3: 0 KB (0 bits) marked out-of-sync by on disk bit-map.&lt;br /&gt;
May  7 23:29:22 an-node04 kernel: block drbd3: disk( Attaching -&amp;gt; Outdated ) &lt;br /&gt;
May  7 23:29:23 an-node04 kernel: block drbd0: conn( StandAlone -&amp;gt; Unconnected ) &lt;br /&gt;
May  7 23:29:23 an-node04 kernel: block drbd0: Starting receiver thread (from drbd0_worker [14542])&lt;br /&gt;
May  7 23:29:23 an-node04 kernel: block drbd0: receiver (re)started&lt;br /&gt;
May  7 23:29:23 an-node04 kernel: block drbd0: conn( Unconnected -&amp;gt; WFConnection ) &lt;br /&gt;
May  7 23:29:23 an-node04 kernel: block drbd1: conn( StandAlone -&amp;gt; Unconnected ) &lt;br /&gt;
May  7 23:29:23 an-node04 kernel: block drbd1: Starting receiver thread (from drbd1_worker [14556])&lt;br /&gt;
May  7 23:29:23 an-node04 kernel: block drbd1: receiver (re)started&lt;br /&gt;
May  7 23:29:23 an-node04 kernel: block drbd1: conn( Unconnected -&amp;gt; WFConnection ) &lt;br /&gt;
May  7 23:29:23 an-node04 kernel: block drbd2: conn( StandAlone -&amp;gt; Unconnected ) &lt;br /&gt;
May  7 23:29:23 an-node04 kernel: block drbd2: Starting receiver thread (from drbd2_worker [14571])&lt;br /&gt;
May  7 23:29:23 an-node04 kernel: block drbd2: receiver (re)started&lt;br /&gt;
May  7 23:29:23 an-node04 kernel: block drbd2: conn( Unconnected -&amp;gt; WFConnection ) &lt;br /&gt;
May  7 23:29:23 an-node04 kernel: block drbd3: conn( StandAlone -&amp;gt; Unconnected ) &lt;br /&gt;
May  7 23:29:23 an-node04 kernel: block drbd3: Starting receiver thread (from drbd3_worker [14590])&lt;br /&gt;
May  7 23:29:23 an-node04 kernel: block drbd3: receiver (re)started&lt;br /&gt;
May  7 23:29:23 an-node04 kernel: block drbd3: conn( Unconnected -&amp;gt; WFConnection ) &lt;br /&gt;
May  7 23:29:24 an-node04 kernel: block drbd0: Handshake successful: Agreed network protocol version 94&lt;br /&gt;
May  7 23:29:24 an-node04 kernel: block drbd0: conn( WFConnection -&amp;gt; WFReportParams ) &lt;br /&gt;
May  7 23:29:24 an-node04 kernel: block drbd0: Starting asender thread (from drbd0_receiver [14610])&lt;br /&gt;
May  7 23:29:24 an-node04 kernel: block drbd0: data-integrity-alg: &amp;lt;not-used&amp;gt;&lt;br /&gt;
May  7 23:29:24 an-node04 kernel: block drbd0: drbd_sync_handshake:&lt;br /&gt;
May  7 23:29:24 an-node04 kernel: block drbd0: self 60D1A5567634DECE:0000000000000000:49B42CE39BDB4567:2C84CA6708465E8D bits:0 flags:0&lt;br /&gt;
May  7 23:29:24 an-node04 kernel: block drbd0: peer 8033D8F146F6823A:60D1A5567634DECF:49B42CE39BDB4566:2C84CA6708465E8D bits:0 flags:0&lt;br /&gt;
May  7 23:29:24 an-node04 kernel: block drbd0: uuid_compare()=-1 by rule 50&lt;br /&gt;
May  7 23:29:24 an-node04 kernel: block drbd0: peer( Unknown -&amp;gt; Secondary ) conn( WFReportParams -&amp;gt; WFBitMapT ) pdsk( DUnknown -&amp;gt; UpToDate ) &lt;br /&gt;
May  7 23:29:24 an-node04 kernel: block drbd1: Handshake successful: Agreed network protocol version 94&lt;br /&gt;
May  7 23:29:24 an-node04 kernel: block drbd1: conn( WFConnection -&amp;gt; WFReportParams ) &lt;br /&gt;
May  7 23:29:24 an-node04 kernel: block drbd2: Handshake successful: Agreed network protocol version 94&lt;br /&gt;
May  7 23:29:24 an-node04 kernel: block drbd2: conn( WFConnection -&amp;gt; WFReportParams ) &lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd1: Starting asender thread (from drbd1_receiver [14613])&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd2: Starting asender thread (from drbd2_receiver [14616])&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd1: data-integrity-alg: &amp;lt;not-used&amp;gt;&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd1: drbd_sync_handshake:&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd1: self A6B85B6E10FC9ED4:0000000000000000:25BC8F003E8EDE15:6DE822E83F4ED721 bits:0 flags:0&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd1: peer 73B4642E7231664C:A6B85B6E10FC9ED5:25BC8F003E8EDE15:6DE822E83F4ED721 bits:0 flags:0&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd1: uuid_compare()=-1 by rule 50&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd1: peer( Unknown -&amp;gt; Secondary ) conn( WFReportParams -&amp;gt; WFBitMapT ) pdsk( DUnknown -&amp;gt; UpToDate ) &lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd2: data-integrity-alg: &amp;lt;not-used&amp;gt;&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd2: drbd_sync_handshake:&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd2: self D074F4853E9FAFE6:0000000000000000:05586D2FABD3DD12:64590F358F14E685 bits:0 flags:0&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd2: peer 399131BDEB288486:D074F4853E9FAFE7:05586D2FABD3DD13:64590F358F14E685 bits:0 flags:0&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd2: uuid_compare()=-1 by rule 50&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd2: peer( Unknown -&amp;gt; Secondary ) conn( WFReportParams -&amp;gt; WFBitMapT ) pdsk( DUnknown -&amp;gt; UpToDate ) &lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd3: Handshake successful: Agreed network protocol version 94&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd3: conn( WFConnection -&amp;gt; WFReportParams ) &lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd3: Starting asender thread (from drbd3_receiver [14619])&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd3: data-integrity-alg: &amp;lt;not-used&amp;gt;&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd3: drbd_sync_handshake:&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd3: self 5BA622DBC6DE170E:0000000000000000:0DE6667028BDEEFE:66C10BDFC06939F3 bits:0 flags:0&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd3: peer E6526E269E123D4C:5BA622DBC6DE170F:0DE6667028BDEEFF:66C10BDFC06939F3 bits:0 flags:0&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd3: uuid_compare()=-1 by rule 50&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd3: peer( Unknown -&amp;gt; Secondary ) conn( WFReportParams -&amp;gt; WFBitMapT ) pdsk( DUnknown -&amp;gt; UpToDate ) &lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd0: conn( WFBitMapT -&amp;gt; WFSyncUUID ) &lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd0: helper command: /sbin/drbdadm before-resync-target minor-0&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd1: conn( WFBitMapT -&amp;gt; WFSyncUUID ) &lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd0: role( Secondary -&amp;gt; Primary ) &lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd1: helper command: /sbin/drbdadm before-resync-target minor-1&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd1: helper command: /sbin/drbdadm before-resync-target minor-1 exit code 0 (0x0)&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd1: conn( WFSyncUUID -&amp;gt; SyncTarget ) disk( Outdated -&amp;gt; Inconsistent ) &lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd1: Began resync as SyncTarget (will sync 0 KB [0 bits set]).&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd1: Resync done (total 1 sec; paused 0 sec; 0 K/sec)&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd1: conn( SyncTarget -&amp;gt; Connected ) disk( Inconsistent -&amp;gt; UpToDate ) &lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd1: helper command: /sbin/drbdadm after-resync-target minor-1&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd2: conn( WFBitMapT -&amp;gt; WFSyncUUID ) &lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd1: helper command: /sbin/drbdadm after-resync-target minor-1 exit code 0 (0x0)&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd2: helper command: /sbin/drbdadm before-resync-target minor-2&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd2: helper command: /sbin/drbdadm before-resync-target minor-2 exit code 0 (0x0)&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd2: conn( WFSyncUUID -&amp;gt; SyncTarget ) disk( Outdated -&amp;gt; Inconsistent ) &lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd2: Began resync as SyncTarget (will sync 0 KB [0 bits set]).&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd2: Resync done (total 1 sec; paused 0 sec; 0 K/sec)&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd2: conn( SyncTarget -&amp;gt; Connected ) disk( Inconsistent -&amp;gt; UpToDate ) &lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd2: helper command: /sbin/drbdadm after-resync-target minor-2&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd0: helper command: /sbin/drbdadm before-resync-target minor-0 exit code 0 (0x0)&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd0: conn( WFSyncUUID -&amp;gt; SyncTarget ) disk( Outdated -&amp;gt; Inconsistent ) &lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd0: Began resync as SyncTarget (will sync 0 KB [0 bits set]).&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd0: Resync done (total 1 sec; paused 0 sec; 0 K/sec)&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd0: conn( SyncTarget -&amp;gt; Connected ) disk( Inconsistent -&amp;gt; UpToDate ) &lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd0: helper command: /sbin/drbdadm after-resync-target minor-0&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd2: helper command: /sbin/drbdadm after-resync-target minor-2 exit code 0 (0x0)&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd0: helper command: /sbin/drbdadm after-resync-target minor-0 exit code 0 (0x0)&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd3: conn( WFBitMapT -&amp;gt; WFSyncUUID ) &lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd1: Connected in w_make_resync_request&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd2: Connected in w_make_resync_request&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd3: helper command: /sbin/drbdadm before-resync-target minor-3&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd3: helper command: /sbin/drbdadm before-resync-target minor-3 exit code 0 (0x0)&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd3: conn( WFSyncUUID -&amp;gt; SyncTarget ) disk( Outdated -&amp;gt; Inconsistent ) &lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd3: Began resync as SyncTarget (will sync 0 KB [0 bits set]).&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd3: Resync done (total 1 sec; paused 0 sec; 0 K/sec)&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd3: conn( SyncTarget -&amp;gt; Connected ) disk( Inconsistent -&amp;gt; UpToDate ) &lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd3: helper command: /sbin/drbdadm after-resync-target minor-3&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd3: helper command: /sbin/drbdadm after-resync-target minor-3 exit code 0 (0x0)&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd0: Connected in w_make_resync_request&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd1: role( Secondary -&amp;gt; Primary ) &lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd3: Connected in w_make_resync_request&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd2: role( Secondary -&amp;gt; Primary ) &lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd3: role( Secondary -&amp;gt; Primary ) &lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd0: peer( Secondary -&amp;gt; Primary ) &lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd1: peer( Secondary -&amp;gt; Primary ) &lt;br /&gt;
May  7 23:29:26 an-node04 kernel: block drbd2: peer( Secondary -&amp;gt; Primary ) &lt;br /&gt;
May  7 23:29:26 an-node04 kernel: block drbd3: peer( Secondary -&amp;gt; Primary ) &lt;br /&gt;
May  7 23:29:26 an-node04 clvmd: Cluster LVM daemon started - connected to CMAN&lt;br /&gt;
May  7 23:29:27 an-node04 kernel: GFS2: fsid=: Trying to join cluster &amp;quot;lock_dlm&amp;quot;, &amp;quot;an-cluster01:xen_shared&amp;quot;&lt;br /&gt;
May  7 23:29:27 an-node04 kernel: GFS2: fsid=an-cluster01:xen_shared.0: Joined cluster. Now mounting FS...&lt;br /&gt;
May  7 23:29:27 an-node04 kernel: GFS2: fsid=an-cluster01:xen_shared.0: jid=0, already locked for use&lt;br /&gt;
May  7 23:29:27 an-node04 kernel: GFS2: fsid=an-cluster01:xen_shared.0: jid=0: Looking at journal...&lt;br /&gt;
May  7 23:29:27 an-node04 kernel: GFS2: fsid=an-cluster01:xen_shared.0: jid=0: Done&lt;br /&gt;
May  7 23:29:27 an-node04 kernel: GFS2: fsid=an-cluster01:xen_shared.0: jid=1: Trying to acquire journal lock...&lt;br /&gt;
May  7 23:29:27 an-node04 kernel: GFS2: fsid=an-cluster01:xen_shared.0: jid=1: Looking at journal...&lt;br /&gt;
May  7 23:29:27 an-node04 kernel: GFS2: fsid=an-cluster01:xen_shared.0: jid=1: Done&lt;br /&gt;
May  7 23:29:28 an-node04 clurgmgrd[12067]: &amp;lt;notice&amp;gt; Service service:an4_storage started &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here is what we&#039;re seeing:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clurgmgrd&amp;lt;/span&amp;gt;, the cluster &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; daemon, take the request to start the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an4_storage&amp;lt;/span&amp;gt; service.&lt;br /&gt;
* This is immediately followed by a lot of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;drbd&amp;lt;/span&amp;gt; messages showing the attachment, connection and promotion of the DRBD resources.&lt;br /&gt;
* Once the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;drbd&amp;lt;/span&amp;gt; daemon reported that it was up, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clurgmgrd&amp;lt;/span&amp;gt; started the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clvmd&amp;lt;/span&amp;gt; daemon.&lt;br /&gt;
* Next we see the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;gfs2&amp;lt;/span&amp;gt; initialization script start up.&lt;br /&gt;
* Once this last daemon returns, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clurgmgrd&amp;lt;/span&amp;gt; reports that the service started successfully.&lt;br /&gt;
&lt;br /&gt;
Now you can check &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; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;gfs2&amp;lt;/span&amp;gt; again and you will see that they are all online.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/drbd 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;
drbd driver loaded OK; device status:&lt;br /&gt;
version: 8.3.8 (api:88/proto:86-94)&lt;br /&gt;
GIT-hash: d78846e52224fd00562f7c225bcc25b2d422321d build by mockbuild@builder10.centos.org, 2010-06-04 08:04:27&lt;br /&gt;
m:res  cs         ro               ds                 p  mounted  fstype&lt;br /&gt;
0:r0   Connected  Primary/Primary  UpToDate/UpToDate  C&lt;br /&gt;
1:r1   Connected  Primary/Primary  UpToDate/UpToDate  C&lt;br /&gt;
2:r2   Connected  Primary/Primary  UpToDate/UpToDate  C&lt;br /&gt;
3:r3   Connected  Primary/Primary  UpToDate/UpToDate  C&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;
/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 (pid  14700) is running...&lt;br /&gt;
Clustered Volume Groups: drbd_an5_vg0 drbd_an4_vg0 drbd_sh0_vg0&lt;br /&gt;
Active clustered Logical Volumes: /dev/drbd_sh0_vg0/xen_shared&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;
/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;
/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, let&#039;s check &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clustat&amp;lt;/span&amp;gt; again and we&#039;ll see that the services are online.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
clustat&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Cluster Status for an-cluster01 @ Sat May  7 23:35:03 2011&lt;br /&gt;
Member Status: Quorate&lt;br /&gt;
&lt;br /&gt;
 Member Name                             ID   Status&lt;br /&gt;
 ------ ----                             ---- ------&lt;br /&gt;
 an-node04.alteeve.com                       1 Online, Local, rgmanager&lt;br /&gt;
 an-node05.alteeve.com                       2 Online, rgmanager&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State         &lt;br /&gt;
 ------- ----                   ----- ------                   -----         &lt;br /&gt;
 service:an4_storage            an-node04.alteeve.com          started       &lt;br /&gt;
 service:an5_storage            an-node05.alteeve.com          started       &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Hoozah!&lt;br /&gt;
&lt;br /&gt;
=== Stopping Clustered Services ===&lt;br /&gt;
&lt;br /&gt;
With the services we&#039;ve created, it&#039;s actually pretty simple to shut things down. Simply stopping &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; on each node will stop the services and, as they&#039;re not able to fail over, the services will stay offline. This can lead to bad habits though. So, to get into the proper habit, let&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;lock&amp;lt;/span&amp;gt; then &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;disable&amp;lt;/span&amp;gt; the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an5_storage&amp;lt;/span&amp;gt; service and then shutdown &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt;&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
clusvcadm -l service:an5_storage -m an-node05.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;
Resource groups locked&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;
clusvcadm -d service:an5_storage -m an-node05.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;
Member an-node05.alteeve.com disabling service:an5_storage...Success&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now when you try to run &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clustat&amp;lt;/span&amp;gt;, you can see that the service on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt; is disabled.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
clustat&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Cluster Status for an-cluster01 @ Sat May  7 23:43:10 2011&lt;br /&gt;
Member Status: Quorate&lt;br /&gt;
&lt;br /&gt;
 Member Name                             ID   Status&lt;br /&gt;
 ------ ----                             ---- ------&lt;br /&gt;
 an-node04.alteeve.com                       1 Online, rgmanager&lt;br /&gt;
 an-node05.alteeve.com                       2 Online, Local, rgmanager&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State         &lt;br /&gt;
 ------- ----                   ----- ------                   -----         &lt;br /&gt;
 service:an4_storage            an-node04.alteeve.com          started       &lt;br /&gt;
 service:an5_storage            (an-node05.alteeve.com)        disabled      &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we can shutdown &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; proper.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/rgmanager 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;
Shutting down Cluster Service Manager...&lt;br /&gt;
Waiting for services to stop:                              [  OK  ]&lt;br /&gt;
Cluster Service Manager is stopped.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clustat&amp;lt;/span&amp;gt; will not show any services at all when run from &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt;&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
clustat&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Cluster Status for an-cluster01 @ Sat May  7 23:57:55 2011&lt;br /&gt;
Member Status: Quorate&lt;br /&gt;
&lt;br /&gt;
 Member Name                             ID   Status&lt;br /&gt;
 ------ ----                             ---- ------&lt;br /&gt;
 an-node04.alteeve.com                       1 Online&lt;br /&gt;
 an-node05.alteeve.com                       2 Online, Local&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can still see both services from &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt; though.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt;&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
clustat&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Cluster Status for an-cluster01 @ Sat May  7 23:43:43 2011&lt;br /&gt;
Member Status: Quorate&lt;br /&gt;
&lt;br /&gt;
 Member Name                             ID   Status&lt;br /&gt;
 ------ ----                             ---- ------&lt;br /&gt;
 an-node04.alteeve.com                       1 Online, Local, rgmanager&lt;br /&gt;
 an-node05.alteeve.com                       2 Online&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State         &lt;br /&gt;
 ------- ----                   ----- ------                   -----         &lt;br /&gt;
 service:an4_storage            an-node04.alteeve.com          started       &lt;br /&gt;
 service:an5_storage            (an-node05.alteeve.com)        disabled      &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{note|1=You may notice that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; is no longer showing to the right of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05.alteeve.com&amp;lt;/span&amp;gt;. This indicates that the other node&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; daemon has stopped.}}&lt;br /&gt;
&lt;br /&gt;
Now we can go back to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt; and completely shut down the cluster.&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;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Stopping cluster: &lt;br /&gt;
   Stopping fencing... done&lt;br /&gt;
   Stopping cman... done&lt;br /&gt;
   Stopping ccsd... done&lt;br /&gt;
   Unmounting configfs... done&lt;br /&gt;
                                                           [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can check on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt; and see that the cluster is now down to just itself.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cman_tool 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;
Version: 6.2.0&lt;br /&gt;
Config Version: 13&lt;br /&gt;
Cluster Name: an-cluster01&lt;br /&gt;
Cluster Id: 60257&lt;br /&gt;
Cluster Member: Yes&lt;br /&gt;
Cluster Generation: 144&lt;br /&gt;
Membership state: Cluster-Member&lt;br /&gt;
Nodes: 1&lt;br /&gt;
Expected votes: 1&lt;br /&gt;
Total votes: 1&lt;br /&gt;
Quorum: 1  &lt;br /&gt;
Active subsystems: 9&lt;br /&gt;
Flags: 2node Dirty &lt;br /&gt;
Ports Bound: 0 11 177  &lt;br /&gt;
Node name: an-node04.alteeve.com&lt;br /&gt;
Node ID: 1&lt;br /&gt;
Multicast addresses: 239.192.235.77 &lt;br /&gt;
Node addresses: 192.168.3.74 &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At this point, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt; is totally out of the cluster and, if you wanted, you could perform any maintenance you might want to do. More on that later though.&lt;br /&gt;
&lt;br /&gt;
= Provisioning Our Virtual Servers =&lt;br /&gt;
&lt;br /&gt;
Finally, the goal of this cluster is in sight!&lt;br /&gt;
&lt;br /&gt;
We have two steps left;&lt;br /&gt;
* Provision our VMs.&lt;br /&gt;
* Add the VMs to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Provisioning&amp;quot; a virtual machine simple means to create it. This tutorial is more about clustering than Xen and virtual machine administration, so some liberties will be taken with regard to your knowledge of Xen. We&#039;ll cover all of the steps needed to provision and manage the VMs, but there will not be an in-depth discussion of the tools and their various uses.&lt;br /&gt;
&lt;br /&gt;
Please, if you are totally unfamiliar with [[Xen]], take a few minutes to review some tutorials:&lt;br /&gt;
&lt;br /&gt;
{{note|1=We are using Xen v3.0, heavily patched to be almost the same as 3.1. At the time of writing, the latest is v4.1. Please take not of the version when reading the tutorials below.}}&lt;br /&gt;
&lt;br /&gt;
* [[Networking in Xen 3.x]]; A brief overview of how networking works in our cluster.&lt;br /&gt;
* [http://wiki.xen.org/xenwiki/XenOverview Xen Overview]; Four useful [[PDF]]s in this link.&lt;br /&gt;
* [http://wiki.xen.org/xenwiki/XenFaq Xen FAQ]&lt;br /&gt;
* [http://wiki.xen.org/xenwiki/XenDocs Xen Documentation]; Includes v3 User Manual.&lt;br /&gt;
* [http://wiki.xen.org/xenwiki/HowTos Xen HowTos]; The Xen [http://wiki.xen.org/xenwiki/XenNetworking Networking] section may be particularly helpful.&lt;br /&gt;
* [http://wiki.xen.org/xenwiki/XenManagementTools Xen Management Tools]; Covers &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-manager&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;libvirtd&amp;lt;/span&amp;gt;.&lt;br /&gt;
* [http://wiki.xen.org/xenwiki/XenCommonProblems Xen Common Problems]; Somewhere between an FAQ and a troubleshooting guide.&lt;br /&gt;
&lt;br /&gt;
== Starting libvirtd On The Nodes ==&lt;br /&gt;
&lt;br /&gt;
In the following steps, we will be using a program called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virsh&amp;lt;/span&amp;gt; on the nodes and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-manager&amp;lt;/span&amp;gt; on our workstations to view the VMs. For this, we need to make sure that the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;libvirtd&amp;lt;/span&amp;gt; daemon is running on each node first. This ties in to the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;(xend-unix-server yes)&amp;lt;/span&amp;gt; value we changed in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/xen/xend-config.sxp&amp;lt;/span&amp;gt; file we set earlier, you may recall.&lt;br /&gt;
&lt;br /&gt;
Lets start the daemon now as we&#039;re going to use it very shortly.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On Both Nodes&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/libvirtd 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 libvirtd daemon:                                  [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To start &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;libvirtd&amp;lt;/span&amp;gt; on boot, run the command below.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;On Both Nodes&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
chkconfig libvirtd on&lt;br /&gt;
chkconfig --list libvirtd&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
libvirtd       	0:off	1:off	2:on	3:on	4:on	5:on	6:off&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Accessing The VMs ==&lt;br /&gt;
&lt;br /&gt;
The virtual servers we are going to create are, by definition, &amp;quot;headless&amp;quot;. There is no monitor or place to plug in a keyboard.&lt;br /&gt;
&lt;br /&gt;
The main way that you will monitor the virtual servers is through [[VNC]]. If you are running a relatively recent version of Linux on your workstation, there is a fantastic little program for connecting to and monitoring the VMs on multiple nodes using multiple [[hypervisor]]s called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-manager&amp;lt;/span&amp;gt;. It is available under many Linux distribution&#039;s package managers under the same name. &lt;br /&gt;
&lt;br /&gt;
In Fedora, [[EL]] 5 and 6 and many other [[RPM]] based distributions, you can install &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-manager&amp;lt;/span&amp;gt; on your workstation with the following command.&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;
You can then find &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-manager&amp;lt;/span&amp;gt; on you &#039;&#039;System Tools&#039;&#039; -&amp;gt; &#039;&#039;Virtual Machine Manager&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
To establish a connection to the nodes, click on &#039;&#039;File&#039;&#039; -&amp;gt; &#039;&#039;Add Connection...&#039;&#039;. Change the &#039;&#039;Hypervisor&#039;&#039; selection bar to &#039;&#039;&#039;Xen&#039;&#039;&#039;, check to select &#039;&#039;Connect to remote host&#039;&#039;, leave the default &#039;&#039;Method&#039;&#039; as &#039;&#039;&#039;SSH&#039;&#039;&#039; and &#039;&#039;Username&#039;&#039; as &#039;&#039;&#039;root&#039;&#039;&#039;. Then enter the host name or IP address of each node in the &#039;&#039;Hostname&#039;&#039; field. I always add cluster nodes to my &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/hosts&amp;lt;/span&amp;gt; file so that I can simply enter &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt;. How you handle this is up to you and your preferences.&lt;br /&gt;
&lt;br /&gt;
[[Image:virt-manager_fedora-14_01.png|thumb|340px|center|Adding a connection to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-manager&amp;lt;/span&amp;gt; on Fedora 14.]]&lt;br /&gt;
&lt;br /&gt;
Once both nodes are added, you should see that there is already a &#039;&#039;Domain-0&#039;&#039; entry. This is because, as we discussed earlier, even the &amp;quot;host&amp;quot; OS is itself a virtual machine.&lt;br /&gt;
&lt;br /&gt;
[[Image:virt-manager_fedora-14_02.png|thumb|484px|center|A view of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-manager&amp;lt;/span&amp;gt; on Fedora 14.]]&lt;br /&gt;
&lt;br /&gt;
== Limiting dom0&#039;s RAM Use ==&lt;br /&gt;
&lt;br /&gt;
Normally, [[dom0]] will claim and use memory not allocated to virtual machines. This can cause trouble if, for example, you&#039;ve migrated a [[VM]] off of a node and then want to move it or another VM back shortly after. For a period of time, dom0 will claim that there is not enough free memory for the migration. By setting a hard limit of dom0&#039;s memory usage, this scenario won&#039;t happen and you will not need to delay migrations.&lt;br /&gt;
&lt;br /&gt;
To do this, add &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;dom0_mem=1024M&amp;lt;/span&amp;gt; to the Xen kernel image&#039;s first &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;module&amp;lt;/span&amp;gt; line in [[grub]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /boot/grub/grub.conf /boot/grub/grub.conf.orig&lt;br /&gt;
vim /boot/grub/grub.conf&lt;br /&gt;
diff -u /boot/grub/grub.conf.orig /boot/grub/grub.conf&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;diff&amp;quot;&amp;gt;&lt;br /&gt;
--- /boot/grub/grub.conf.orig	2011-05-10 22:49:09.000000000 -0400&lt;br /&gt;
+++ /boot/grub/grub.conf	2011-05-10 22:54:57.000000000 -0400&lt;br /&gt;
@@ -14,11 +14,11 @@&lt;br /&gt;
 title CentOS (2.6.18-238.9.1.el5xen)&lt;br /&gt;
 	root (hd0,0)&lt;br /&gt;
 	kernel /xen.gz-2.6.18-238.9.1.el5&lt;br /&gt;
-	module /vmlinuz-2.6.18-238.9.1.el5xen ro root=LABEL=/&lt;br /&gt;
+	module /vmlinuz-2.6.18-238.9.1.el5xen ro root=LABEL=/ dom0_mem=1024M&lt;br /&gt;
 	module /initrd-2.6.18-238.9.1.el5xen.img&lt;br /&gt;
 title CentOS (2.6.18-238.9.1.el5)&lt;br /&gt;
 	root (hd0,0)&lt;br /&gt;
-	kernel /vmlinuz-2.6.18-238.9.1.el5 ro root=LABEL=/&lt;br /&gt;
+	kernel /vmlinuz-2.6.18-238.9.1.el5 ro root=LABEL=/ dom0_mem=1024M&lt;br /&gt;
 	initrd /initrd-2.6.18-238.9.1.el5.img&lt;br /&gt;
 title CentOS (2.6.18-238.el5xen)&lt;br /&gt;
 	root (hd0,0)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can change &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;1024M&amp;lt;/span&amp;gt; with the amount of RAM you want to allocate to dom0.&lt;br /&gt;
&lt;br /&gt;
{{warning|1=If you update your kernel, ensure that this kernel argument was added to the new kernel&#039;s argument list.}}&lt;br /&gt;
&lt;br /&gt;
== Our planned layout ==&lt;br /&gt;
&lt;br /&gt;
At this stage, what you will want to run is almost certainly going to be unique to you, so we will not be going into detail about what each VM does. We will cover provisioning them, manipulating them and what not. The description of the VMs is purely an example of what they might be.&lt;br /&gt;
&lt;br /&gt;
We will be creating two virtual servers.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0001_ws1&amp;lt;/span&amp;gt;; A [[CentOS]] server hosting a website.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0002_win1&amp;lt;/span&amp;gt;; A [[Microsoft]] Windows server, showing how to host non-Linux virtual machines.&lt;br /&gt;
&lt;br /&gt;
We&#039;ll assign &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0001_ws1&amp;lt;/span&amp;gt; to normally run on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0002_win1&amp;lt;/span&amp;gt; to normally run on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Before we talk about resources, there is something you must be aware of. &lt;br /&gt;
* You can have more virtual machines than CPU cores. That is, machines can share core. It&#039;s advisable to dedicate one core to just the [[dom0]] machine.&lt;br /&gt;
* RAM on dom0 and all domU VMs must not exceed the maximum amount of RAM available in a given node.&lt;br /&gt;
&lt;br /&gt;
{{warning|1=You &#039;&#039;must&#039;&#039; consider how your collection of virtual servers will run when only on node is available. As I have 4 [[GiB]] of RAM in each node, I will assign 1 [[GiB]] to dom0 and then 1 [[GiB]] to each VM, leaving 1 GiB for future expansion. How you divvy up your memory and CPU cores is ultimately up to you.}}&lt;br /&gt;
&lt;br /&gt;
So here are our two planned virtual servers, laid out in a table. Doing this before provisioning can help you visualize how your cluster&#039;s resources will be consumed, helping to ensure that you don&#039;t use too much, which is of particular note on very large installations. It&#039;s also very useful for planning your virtual machine provisioning commands in the next step.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
!&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0001_ws1&amp;lt;/span&amp;gt;&lt;br /&gt;
!&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0002_win1&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Primary Host&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!RAM&lt;br /&gt;
|1024[[MiB]]&lt;br /&gt;
|1024[[MiB]]&lt;br /&gt;
|-&lt;br /&gt;
!Storage&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/drbd_an4_vg0/vm0001_1&amp;lt;/span&amp;gt;, 50 [[GB]]&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/drbd_an5_vg0/vm0002_1&amp;lt;/span&amp;gt;, 100 [[GB]] (100%)&lt;br /&gt;
|-&lt;br /&gt;
!Network(s)&lt;br /&gt;
|IFN &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xenbr0&amp;lt;/span&amp;gt;, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;192.168.1.200&amp;lt;/span&amp;gt;/&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;255.255.255.0&amp;lt;/span&amp;gt;&lt;br /&gt;
|BCN &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xenbr0&amp;lt;/span&amp;gt;, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;192.168.1.201&amp;lt;/span&amp;gt;/&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;255.255.255.0&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Source Files&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;http://192.168.1.254/c5/x86_64/img&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/xen_shared/iso/Win_Server_2008_Bis_x86_64.iso&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Kickstart Script&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;http://192.168.1.254/c5/x86_64/ks/generic_c5.ks&amp;lt;/span&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{{warning|1=There are issues with installing VMs from [[ISO]] images. For this reason, you are advised to make the installation images available over a web server. A great way to do this is by creating a [[Setting Up a PXE Server in Fedora|PXE server]] on your network. Then you can point to it&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;img&amp;lt;/span&amp;gt; directory when running the VM installs. This tutorial assumes this is available.}}&lt;br /&gt;
&lt;br /&gt;
=== Provisioning vm0001_ws1; A Webserver ===&lt;br /&gt;
&lt;br /&gt;
So let&#039;s start with a basic web server. &lt;br /&gt;
&lt;br /&gt;
Provisioning VMs requires two steps;&lt;br /&gt;
* Creating a logical volume on the clustered LVM.&lt;br /&gt;
* Craft and execute a &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-install&amp;lt;/span&amp;gt; command.&lt;br /&gt;
&lt;br /&gt;
Before you proceed, you need to know where the installation image files are found. This tutorial uses a [[Setting Up a PXE Server in Fedora|PXE server]], so we&#039;ll be telling &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-install&amp;lt;/span&amp;gt; to pull the installation files and [[kickstart]] scripts off of it&#039;s web server. If you don&#039;t have a PXE server, simply mounting the installation image&#039;s ISO and making that available through a trivial webserver setup will be fine. How you do this, exactly, is outside the scope of this tutorial. However, there is a separate, detailed configuration tutorial for setting up a [[Setting Up a PXE Server in Fedora|PXE server]] which covers a basic [[apache]] configuration.&lt;br /&gt;
&lt;br /&gt;
Create the [[LV]] for the VM on the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/drbd_an4_vg0&amp;lt;/span&amp;gt; [[VG]], as it will primarily run on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&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;
lvcreate -L 50G -n vm0001_1 --addtag @an-cluster01 /dev/drbd_an4_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;vm0001_1&amp;quot; created&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{note|1=The example below uses the following kickstart file. Please adapt it for your use.&amp;lt;br /&amp;gt;&lt;br /&gt;
* [[generic_c5.ks]]}}&lt;br /&gt;
&lt;br /&gt;
Now, the long &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-install&amp;lt;/span&amp;gt; command to provision the VM. Let&#039;s look at it, then we&#039;ll discuss it.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
virt-install --connect xen \&lt;br /&gt;
	--name vm0001_ws1 \&lt;br /&gt;
	--ram 1048 \&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.254/c5/x86_64/img \&lt;br /&gt;
	--extra-args &amp;quot;ks=http://192.168.1.254/c5/x86_64/ks/generic_c5.ks&amp;quot; \&lt;br /&gt;
	--os-type linux \&lt;br /&gt;
	--os-variant rhel5.4 \&lt;br /&gt;
	--disk path=/dev/drbd_an4_vg0/vm0001_1 \&lt;br /&gt;
	--network bridge=xenbr0 \&lt;br /&gt;
	--vnc \&lt;br /&gt;
	--paravirt&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{note|1=If you wanted to provision a VM to act as a firewall, or for other reasons wanted a VM to access the back-channel, you could connect to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xenbr2&amp;lt;/span&amp;gt; by simply adding a second &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--network bridge=xenbr2&amp;lt;/span&amp;gt; argument.}}&lt;br /&gt;
&lt;br /&gt;
The [[man]] page for &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-install&amp;lt;/span&amp;gt; covers all of the options you can pass in good detail. We&#039;re going to discuss now the options used here, but it will only be a subset of options that you may wish to use. Please take the time to read &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;man virt-install&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--connect xen&amp;lt;/span&amp;gt;; Tells &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-install&amp;lt;/span&amp;gt; that we are provisioning a Xen [[domU]] VM.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--name vm0001_ws1&amp;lt;/span&amp;gt;; Tells &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-install&amp;lt;/span&amp;gt; to give the VM the name &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0001_ws1&amp;lt;/span&amp;gt;. This can be anything you please, but it &#039;&#039;&#039;must&#039;&#039;&#039; be unique in the cluster. Personally, I like the format &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm####_desc&amp;lt;/span&amp;gt;, where &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;####&amp;lt;/span&amp;gt; is a sequence number to ensure uniqueness and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;desc&amp;lt;/span&amp;gt; is a human-readable, short description of the VM. Please use whatever naming convention you find comfortable.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--ram 1024&amp;lt;/span&amp;gt;; This is the number of [[MiB]] to allocate to the VM. This can be adjusted post-install.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--arch x86_64&amp;lt;/span&amp;gt;; This tells &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-install&amp;lt;/span&amp;gt; to emulate a 64[[bit]] CPU/environment.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;-- vcpus 1&amp;lt;/span&amp;gt;; This controls how many CPU cores to allocate to this VM. This can not exceed the real number of CPUs, and should be &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;n-1&amp;lt;/span&amp;gt; at most, to ensure that [[dom0]] gets sole access to core 0. This can be adjusted post-install.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--cpuset 1&amp;lt;/span&amp;gt;; This tells &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;libvirt&amp;lt;/span&amp;gt; which cores it is allowed to use for this VM. This node has four cores, with CPU &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;0&amp;lt;/span&amp;gt; being pinned to [[dom0]]. So we will tell Xen to let this node use any free CPU between &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;1-3&amp;lt;/span&amp;gt; (the second, third and fourth cores). This can be a comma-separated list of value, and values can use hyphens for ranges. For example, if you have eight cores, you may specify &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--cpuset 1-7&amp;lt;/span&amp;gt; or &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--cpuset 1,3,5-7&amp;lt;/span&amp;gt;.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--location http://192.168.1.254/c5/x86_64/img&amp;lt;/span&amp;gt;; This tells the OS&#039; installer to look for installation files under the passed URL. The installation files could be local to the node (ie: with a loop-back mounted ISO), on an [[NFS]] share or over [[FTP]]. This option can be replaced with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--pxe&amp;lt;/span&amp;gt; for [[PXE]] server installs, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--import&amp;lt;/span&amp;gt; for skipping an installation and directly importing a VM image or &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--livecd&amp;lt;/span&amp;gt; for running up a live CD/DVD.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--extra-args &amp;quot;ks=http://192.168.1.254/c5/x86_64/ks/generic_c5.ks&amp;quot;&amp;lt;/span&amp;gt;; This allows us to pass special arguments to the installer&#039;s kernel. In this case, we&#039;re telling the installer to use the [[kickstart]] file at the given location. Optionally, we could have used &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--extra-args &amp;quot;ks=http://192.168.1.254/c5/x86_64/ks/generic_c5.ks ksdevice=eth0&amp;quot;&amp;lt;/span&amp;gt; to specify which interface to use when looking for the defined kickstart file. I generally avoid this as it is rather difficult to predict with physical interface will get what &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ethX&amp;lt;/span&amp;gt; name.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--os-type linux&amp;lt;/span&amp;gt;; This controls some internal optimization within Xen for handling Linux operating systems.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--os-variant rhel5.4&amp;lt;/span&amp;gt;; This further optimizes Xen for use with [[EL5]].4 (and newer) based operating systems. When this option is used, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--os-type&amp;lt;/span&amp;gt; is not strictly needed. The various supported &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--os-type&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--os-variant&amp;lt;/span&amp;gt; are found in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;man virt-install&amp;lt;/span&amp;gt;.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--disk path=/dev/drbd_an4_vg0/vm0001_1&amp;lt;/span&amp;gt;; This tells the installer to allocate the [[LV]] we just created as this VM&#039;s hard drive. There are &#039;&#039;many&#039;&#039; options for using storage for VMs, please see &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;man virt-install&amp;lt;/span&amp;gt;.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--network bridge=xenbr0&amp;lt;/span&amp;gt;; This, and the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xenbr2&amp;lt;/span&amp;gt; following it, tells &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-install&amp;lt;/span&amp;gt; to connect this VM to those two bridges. Note that inside the VM, these will show up as &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;eth1&amp;lt;/span&amp;gt;.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--vnc&amp;lt;/span&amp;gt;; This tells the VM to setup and export a VNC server. This is how we will connect to and monitor the installation of the VM.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--paravirt&amp;lt;/span&amp;gt;; This tells &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-install&amp;lt;/span&amp;gt; that we will be creating a [[paravirtual]] VM. The other option is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--hvm&amp;lt;/span&amp;gt; which specifies full virtualization.&lt;br /&gt;
&lt;br /&gt;
If things went well, you should now see you VM begin to install!&lt;br /&gt;
&lt;br /&gt;
[[Image:xen_vm0001_ws1_install_01.png|thumb|700px|center|Installation of a kickstart-based text install of CentOS 5.6 as a Xen VM.]]&lt;br /&gt;
&lt;br /&gt;
Once your VM is installed, we&#039;ll want to dump it&#039;s configuration to an [[XML]] file. This way, should the VM be accidentally undefined, we can easily redefine it. In fact, we have to define this VM on the second node to enable migration, but we&#039;ll go into details about migration later. For now though, run the following &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virsh&amp;lt;/span&amp;gt; command to write the VM&#039;s definition information to an XML file on the shared GFS2 partition. Putting it there will make is accessible to both nodes.&lt;br /&gt;
&lt;br /&gt;
{{warning|1=Do &#039;&#039;&#039;not&#039;&#039;&#039; bother dumping the configuration to an XML file until &#039;&#039;after&#039;&#039; the OS is fully installed and has rebooted. The configuration will contain arguments specific to the installation that will cause problem if used after the install is completed.}}&lt;br /&gt;
&lt;br /&gt;
Personally, I like to keep the configuration files in a subdirectory on the GFS2 share, then copy them to the local node&#039;s storage, just to be safe. Given that this is our first VM, we&#039;ll create a directory for the definition files now called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;definitions&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt;&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
mkdir /xen_shared/definitions&lt;br /&gt;
virsh dumpxml vm0001_ws1 &amp;gt; /xen_shared/definitions/vm0001_ws1.xml&lt;br /&gt;
cat /xen_shared/definitions/vm0001_ws1.xml&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;domain type=&#039;xen&#039;&amp;gt;&lt;br /&gt;
  &amp;lt;name&amp;gt;vm0001_ws1&amp;lt;/name&amp;gt;&lt;br /&gt;
  &amp;lt;uuid&amp;gt;d01c03da-8054-6590-37fd-5410c6b1a953&amp;lt;/uuid&amp;gt;&lt;br /&gt;
  &amp;lt;memory&amp;gt;1073152&amp;lt;/memory&amp;gt;&lt;br /&gt;
  &amp;lt;currentMemory&amp;gt;1073152&amp;lt;/currentMemory&amp;gt;&lt;br /&gt;
  &amp;lt;vcpu cpuset=&#039;1-3&#039;&amp;gt;1&amp;lt;/vcpu&amp;gt;&lt;br /&gt;
  &amp;lt;bootloader&amp;gt;/usr/bin/pygrub&amp;lt;/bootloader&amp;gt;&lt;br /&gt;
  &amp;lt;os&amp;gt;&lt;br /&gt;
    &amp;lt;type arch=&#039;x86_64&#039; machine=&#039;xenpv&#039;&amp;gt;linux&amp;lt;/type&amp;gt;&lt;br /&gt;
  &amp;lt;/os&amp;gt;&lt;br /&gt;
  &amp;lt;clock offset=&#039;utc&#039;/&amp;gt;&lt;br /&gt;
  &amp;lt;on_poweroff&amp;gt;destroy&amp;lt;/on_poweroff&amp;gt;&lt;br /&gt;
  &amp;lt;on_reboot&amp;gt;restart&amp;lt;/on_reboot&amp;gt;&lt;br /&gt;
  &amp;lt;on_crash&amp;gt;restart&amp;lt;/on_crash&amp;gt;&lt;br /&gt;
  &amp;lt;devices&amp;gt;&lt;br /&gt;
    &amp;lt;disk type=&#039;block&#039; device=&#039;disk&#039;&amp;gt;&lt;br /&gt;
      &amp;lt;driver name=&#039;phy&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;source dev=&#039;/dev/drbd_an4_vg0/vm0001_1&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;target dev=&#039;xvda&#039; bus=&#039;xen&#039;/&amp;gt;&lt;br /&gt;
    &amp;lt;/disk&amp;gt;&lt;br /&gt;
    &amp;lt;interface type=&#039;bridge&#039;&amp;gt;&lt;br /&gt;
      &amp;lt;mac address=&#039;00:16:36:05:6b:8c&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;source bridge=&#039;xenbr0&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;script path=&#039;vif-bridge&#039;/&amp;gt;&lt;br /&gt;
    &amp;lt;/interface&amp;gt;&lt;br /&gt;
    &amp;lt;console type=&#039;pty&#039;&amp;gt;&lt;br /&gt;
      &amp;lt;target port=&#039;0&#039;/&amp;gt;&lt;br /&gt;
    &amp;lt;/console&amp;gt;&lt;br /&gt;
    &amp;lt;input type=&#039;mouse&#039; bus=&#039;xen&#039;/&amp;gt;&lt;br /&gt;
    &amp;lt;graphics type=&#039;vnc&#039; port=&#039;-1&#039; autoport=&#039;yes&#039; keymap=&#039;en-us&#039;/&amp;gt;&lt;br /&gt;
  &amp;lt;/devices&amp;gt;&lt;br /&gt;
&amp;lt;/domain&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On Both Nodes&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
rsync -av /xen_shared/definitions ~/&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
definitions/&lt;br /&gt;
definitions/vm0001_ws1.xml&lt;br /&gt;
&lt;br /&gt;
sent 1085 bytes  received 48 bytes  755.33 bytes/sec&lt;br /&gt;
total size is 953  speedup is 0.84&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The benefit of having backups on the local storage is to protect these rarely changing but critical files in case anything ever corrupted the shared storage. We&#039;ve gone to great lengths to avoid this, but it&#039;s always possible and this is a simple precaution.&lt;br /&gt;
&lt;br /&gt;
==== Reconnecting to the VM ====&lt;br /&gt;
&lt;br /&gt;
After the install finishes, or after you close the initial minimal VNC viewer, you will need to manually reconnect to the VM. This is where &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-manager&amp;lt;/span&amp;gt; comes in so handy! &lt;br /&gt;
&lt;br /&gt;
Start it back up and double-click on the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt; host. You will now see the new &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0001_fw1&amp;lt;/span&amp;gt; VM. Double-click on it and you will be right back on the VM.&lt;br /&gt;
&lt;br /&gt;
[[Image:virt-manager_fedora-14_03.png|thumb|700px|center|A view of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-manager&amp;lt;/span&amp;gt; used to connect to the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0001_ws1&amp;lt;/span&amp;gt; VM.]]&lt;br /&gt;
&lt;br /&gt;
Pretty cool, eh!&lt;br /&gt;
&lt;br /&gt;
==== How to Stop, Define and Start the VM ====&lt;br /&gt;
&lt;br /&gt;
To stop the VM, you can connect to it as a remote server and shut it down as you would a normal VM.&lt;br /&gt;
&lt;br /&gt;
If you want to initial a clean shut down from the host node, you can use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virsh&amp;lt;/span&amp;gt; to initial a shutdown over [[ACPI]], same as if you tapped the power button on a physical server.&lt;br /&gt;
&lt;br /&gt;
Make sure the VM is on the node:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
virsh list --all&lt;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 Name                 State&lt;br /&gt;
----------------------------------&lt;br /&gt;
  0 Domain-0             running&lt;br /&gt;
  2 vm0001_ws1           idle&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell it to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;shutdown&amp;lt;/span&amp;gt;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
virsh shutdown vm0001_ws1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Domain vm0001_ws1 is being shutdown&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you had a VNC session running, you will see the VM start to gracefully shutdown.&lt;br /&gt;
&lt;br /&gt;
[[Image:xen3_vm_graceful_shutdown_1.png|thumb|center|700px|Gracefully shutting down the firewall VM via &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virsh shutdown vm0001_ws1&amp;lt;/span&amp;gt;.]]&lt;br /&gt;
&lt;br /&gt;
After a few moments, the VM should shut down. You can confirm this by again running &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virsh list --all&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;
virsh list --all&lt;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 Name                 State&lt;br /&gt;
----------------------------------&lt;br /&gt;
  0 Domain-0             running&lt;br /&gt;
  - vm0001_ws1           shut off&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Remember how we dumped this VM&#039;s configuration to an XML file on the GFS2 partition earlier? We&#039;re now going to use that to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;define&amp;lt;/span&amp;gt; the VM on the other node, then we&#039;ll start it up over there, too.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt;&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
Check that the VM isn&#039;t known by &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&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;
virsh list --all&lt;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 Name                 State&lt;br /&gt;
----------------------------------&lt;br /&gt;
  0 Domain-0             running&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It&#039;s not there, as expect. So now we&#039;ll use the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/xen_shared/definitions/vm0001_ws1.xml&amp;lt;/span&amp;gt; file we created.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
virsh define /xen_shared/definitions/vm0001_ws1.xml &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Domain vm0001_ws1 defined from /xen_shared/definitions/vm0001_ws1.xml&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now confirm that it&#039;s there.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
virsh list --all&lt;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 Name                 State&lt;br /&gt;
----------------------------------&lt;br /&gt;
  0 Domain-0             running&lt;br /&gt;
  - vm0001_ws1           shut off&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can now see &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0001_ws1&amp;lt;/span&amp;gt; on both nodes. Of course, &#039;&#039;&#039;&#039;&#039;never&#039;&#039;&#039;&#039;&#039;, &#039;&#039;&#039;&#039;&#039;ever&#039;&#039;&#039;&#039;&#039; try to start the VM on both nodes at the same time. In the previous step, we shut down &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0001_ws1&amp;lt;/span&amp;gt;, but it&#039;s safest to make sure that it&#039;s still off.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt;&#039;&#039;&#039;:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
virsh list --all&lt;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 Name                 State&lt;br /&gt;
----------------------------------&lt;br /&gt;
  0 Domain-0             running&lt;br /&gt;
  - vm0001_ws1           shut off&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So we now have &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0001_ws1&amp;lt;/span&amp;gt; shut off and it is defined on both &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt;. We can now start it on either node. Let&#039;s now start it up on the second node, just for fun.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt;&#039;&#039;&#039;:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
virsh start vm0001_ws1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Domain vm0001_ws1 started&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you look at &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-manager&amp;lt;/span&amp;gt;, you will now see &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0001_ws1&amp;lt;/span&amp;gt; up and running on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt; and shut off on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[Image:xen3_vm_running_on_second_node_1.png|thumb|center|700px|View of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0001_ws1&amp;lt;/span&amp;gt; running on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt;.]]&lt;br /&gt;
&lt;br /&gt;
There we go. We&#039;ve now seen how to stop, define and start the VM using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virsh&amp;lt;/span&amp;gt;. Nothing too fancy!&lt;br /&gt;
&lt;br /&gt;
==== Testing VM Migration ====&lt;br /&gt;
&lt;br /&gt;
One of the biggest benefits of virtual servers in clusters is that they can be migrated between nodes without needing to shut down the VM. This is useful for planned maintenance on nodes, as you can push off all of it&#039;s VMs, take it out of the cluster and do your maintenance and your VM users will see minimal or no interruption in service. &lt;br /&gt;
&lt;br /&gt;
There are two types of migration;&lt;br /&gt;
* &#039;&#039;&#039;Cold Migration&#039;&#039;&#039;; The VM is frozen, it&#039;s RAM is copied to the other node and then it is thawed on the new host. This is the fastest method of migrating, but the users will see a period where they can not interact with the VM.&lt;br /&gt;
* &#039;&#039;&#039;Live Migration&#039;&#039;&#039;; The VM continues to run during the migration. Performance will degrade a bit and the migration process will take longer to complete, but users should not see any interruption in service.&lt;br /&gt;
&lt;br /&gt;
To manually migrate the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0001_ws1&amp;lt;/span&amp;gt; VM &#039;&#039;from&#039;&#039; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt; back to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt;, run the following command. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt;&#039;&#039;&#039; (there will be no output):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
virsh migrate --live vm0001_ws1 xen+ssh://root@an-node04&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you flip over to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-manager&amp;lt;/span&amp;gt;, you will see that the node shows as &#039;&#039;Running&#039;&#039; on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt; on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt; and &#039;&#039;Shutoff&#039;&#039; on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt; right away, but there will still be CPU activity on both. This is the live migration process running. In the screen shot below, I opened a standard terminal and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ssh&amp;lt;/span&amp;gt;&#039;ed into &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0001_ws1&amp;lt;/span&amp;gt; and started a ping flood to Google &#039;&#039;&#039;before&#039;&#039;&#039; starting the live migration. Notice how the migration completed and no packets were dropped?&lt;br /&gt;
&lt;br /&gt;
[[Image:xen3_vm_live_migrating_1.png|thumb|center|700px|View of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0001_ws1&amp;lt;/span&amp;gt; being live migrated to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt; from &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt; with a ping-flood running via an &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ssh&amp;lt;/span&amp;gt; session.]]&lt;br /&gt;
&lt;br /&gt;
This should tickle your geek glands.&lt;br /&gt;
&lt;br /&gt;
==== How to &amp;quot;Pull the Power&amp;quot; on a VM ====&lt;br /&gt;
&lt;br /&gt;
If something happens to the VM and you can&#039;t shut it down, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virsh&amp;lt;/span&amp;gt; provides a command that is the equivalent of pulling the power on a physical server. This command forces the virtual server off without giving the VM a chance to react at all. For obvious reasons, you will want to be somewhat careful in using this as it has all the same potential for problems as killing the power of a real server.&lt;br /&gt;
&lt;br /&gt;
So to &amp;quot;pull the plug&amp;quot;, you can run this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
virsh destroy vm0001_ws1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Domain vm0001_ws1 destroyed&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The VM is still defined, but it&#039;s no longer running.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
virsh list --all&lt;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 Name                 State&lt;br /&gt;
----------------------------------&lt;br /&gt;
  0 Domain-0             running&lt;br /&gt;
  - vm0001_ws1           shut off&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== How to Delete a VM and Start Over ====&lt;br /&gt;
&lt;br /&gt;
{{note|1=It is &#039;&#039;very&#039;&#039; likely that you will run into problems when you first start trying to provision your VM. If you want to delete the VM and start over, the way to do it is with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virsh&amp;lt;/span&amp;gt;, the virtual shell.}}&lt;br /&gt;
&lt;br /&gt;
Check that it&#039;s there.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
virsh list --all&lt;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 Name                 State&lt;br /&gt;
----------------------------------&lt;br /&gt;
  0 Domain-0             running&lt;br /&gt;
  - vm0001_ws1           shut off&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Undefine&amp;quot; it, which deletes it from Xen.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
virsh undefine vm0001_ws1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Domain vm0001_ws1 has been undefined&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Confirm that it is gone.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
virsh list --all&lt;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 Name                 State&lt;br /&gt;
----------------------------------&lt;br /&gt;
  0 Domain-0             running&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now you can try again.&lt;br /&gt;
&lt;br /&gt;
=== Hardware Virtual Machine ===&lt;br /&gt;
&lt;br /&gt;
Most modern processors come with support for &amp;quot;hardware assisted virtualization&amp;quot;, which Xen calls &amp;quot;Hardware Virtual Machine&amp;quot; or &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;hvm&amp;lt;/span&amp;gt; or &amp;quot;Secure Virtual Machine&amp;quot; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;svm&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
HVM requires special support in the CPU in order for it to be used in Xen. Intel processors implement this under the name VT-x and AMD implements this under the name AMD-V. Some motherboards will disable this feature by default, requiring the user to edit the BIOS of their mainboard. &lt;br /&gt;
&lt;br /&gt;
If you try to provision an &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;hvm&amp;lt;/span&amp;gt; and receive an error about it not being supported by the host, consult your system board documentation for information on enabling hardware virtualization.&lt;br /&gt;
&lt;br /&gt;
To check if you have &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;hvm&amp;lt;/span&amp;gt; enabled, run &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xm info&amp;lt;/span&amp;gt; and check the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xen_caps&amp;lt;/span&amp;gt; line for entries starting with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;hvm&amp;lt;/span&amp;gt;. If you do not see any &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;hvm&amp;lt;/span&amp;gt; entries, then it is likely not enabled.&lt;br /&gt;
&lt;br /&gt;
{{note|1=The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xm info&amp;lt;/span&amp;gt; only works when running a Xen kernel. With a vanilla kernel, consult &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/proc/cpuinfo&amp;lt;/span&amp;gt;.}}&lt;br /&gt;
&lt;br /&gt;
Below is the output of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xm info&amp;lt;/span&amp;gt; with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;hvm&amp;lt;/span&amp;gt; &#039;&#039;enabled&#039;&#039; in the host BIOS.&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.18-238.9.1.el5xen&lt;br /&gt;
version                : #1 SMP Tue Apr 12 18:53:56 EDT 2011&lt;br /&gt;
machine                : x86_64&lt;br /&gt;
nr_cpus                : 4&lt;br /&gt;
nr_nodes               : 1&lt;br /&gt;
sockets_per_node       : 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                : 178bfbff:efd3fbff:00000000:00000110:00802009:00000000:000037ff&lt;br /&gt;
total_memory           : 4062&lt;br /&gt;
free_memory            : 1048&lt;br /&gt;
node_to_cpu            : node0:0-3&lt;br /&gt;
xen_major              : 3&lt;br /&gt;
xen_minor              : 1&lt;br /&gt;
xen_extra              : .2-238.9.1.el5&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_pagesize           : 4096&lt;br /&gt;
platform_params        : virt_start=0xffff800000000000&lt;br /&gt;
xen_changeset          : unavailable&lt;br /&gt;
cc_compiler            : gcc version 4.1.2 20080704 (Red Hat 4.1.2-50)&lt;br /&gt;
cc_compile_by          : mockbuild&lt;br /&gt;
cc_compile_domain      : centos.org&lt;br /&gt;
cc_compile_date        : Tue Apr 12 18:01:03 EDT 2011&lt;br /&gt;
xend_config_format     : 2&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;hvm&amp;lt;/span&amp;gt; &#039;&#039;disabled&#039;&#039; in the BIOS. Note the missing &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;hvm&amp;lt;/span&amp;gt; entries on the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xen_caps&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;
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-node05.alteeve.com&lt;br /&gt;
release                : 2.6.18-238.9.1.el5xen&lt;br /&gt;
version                : #1 SMP Tue Apr 12 18:53:56 EDT 2011&lt;br /&gt;
machine                : x86_64&lt;br /&gt;
nr_cpus                : 4&lt;br /&gt;
nr_nodes               : 1&lt;br /&gt;
sockets_per_node       : 1&lt;br /&gt;
cores_per_socket       : 4&lt;br /&gt;
threads_per_core       : 1&lt;br /&gt;
cpu_mhz                : 2200&lt;br /&gt;
hw_caps                : 178bfbff:efd3fbff:00000000:00000110:00802009:00000000:000037ff&lt;br /&gt;
total_memory           : 3838&lt;br /&gt;
free_memory            : 383&lt;br /&gt;
node_to_cpu            : node0:0-3&lt;br /&gt;
xen_major              : 3&lt;br /&gt;
xen_minor              : 1&lt;br /&gt;
xen_extra              : .2-238.9.1.el5&lt;br /&gt;
xen_caps               : xen-3.0-x86_64 xen-3.0-x86_32p &lt;br /&gt;
xen_pagesize           : 4096&lt;br /&gt;
platform_params        : virt_start=0xffff800000000000&lt;br /&gt;
xen_changeset          : unavailable&lt;br /&gt;
cc_compiler            : gcc version 4.1.2 20080704 (Red Hat 4.1.2-50)&lt;br /&gt;
cc_compile_by          : mockbuild&lt;br /&gt;
cc_compile_domain      : centos.org&lt;br /&gt;
cc_compile_date        : Tue Apr 12 18:01:03 EDT 2011&lt;br /&gt;
xend_config_format     : 2&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you try to provision an &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;hvm&amp;lt;/span&amp;gt; machine with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;hvm&amp;lt;/span&amp;gt; disabled, you will see the error below.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
virt-install --connect xen ... --hvm&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
ERROR    Host does not support virtualization type &#039;hvm&#039; for arch &#039;x86_64&#039;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{note|1=When installing from an [[ISO]], you must use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;hvm&amp;lt;/span&amp;gt; or full virtualization.}}&lt;br /&gt;
&lt;br /&gt;
=== Provisioning vm0002_win1; A Windows Server ===&lt;br /&gt;
&lt;br /&gt;
We&#039;re going to provision a [[Microsoft]] Windows 2008 server this time. This will largely be the same process as with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0001_ws1&amp;lt;/span&amp;gt;. The main differences is that we&#039;ll be installing from an [[ISO]] file which was copied into &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/xen_shared/iso/Win_Server_2008_Bis_x86_64.iso&amp;lt;/span&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
Microsoft Windows is commercial software. You will need a proper license to use it in production, but you can [http://www.microsoft.com/windowsserver2008/en/us/trial-software.aspx download a trial] version, which will be sufficient to follow along with this tutorial. &lt;br /&gt;
&lt;br /&gt;
{{note|1=You may find it useful to create an &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/xen_shared/iso&amp;lt;/span&amp;gt; folder to store ISO files in.}}&lt;br /&gt;
&lt;br /&gt;
We won&#039;t go over all the details again, but we will show all the specific commands.&lt;br /&gt;
&lt;br /&gt;
First, create the [[LV]] for this new VM.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
lvcreate -l 100%FREE -n vm0002_1 --addtag @an-cluster01 /dev/drbd_an5_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;vm0002_1&amp;quot; created&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we need to craft the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-install&amp;lt;/span&amp;gt; provision command. Some key differences are that we&#039;re going to create a &amp;quot;hardware virtualized machine&amp;quot;, known as &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;hvm&amp;lt;/span&amp;gt;, which requires support in the CPU. We&#039;ll also directly boot off of a DVD [[ISO]], as if we had put a DVD in a drive and booted from it on a real server. We also need to change the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--os-type&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--os-variant&amp;lt;/span&amp;gt; values to windows as well.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&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;
virt-install --connect xen \&lt;br /&gt;
        --name vm0002_win1 \&lt;br /&gt;
        --ram 1048 \&lt;br /&gt;
        --arch x86_64 \&lt;br /&gt;
        --vcpus 1 \&lt;br /&gt;
        --cpuset 1-3 \&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_an5_vg0/vm0002_1 \&lt;br /&gt;
        --network bridge=xenbr0 \&lt;br /&gt;
        --vnc \&lt;br /&gt;
        --hvm&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Image:Installing_Win2008_VM_01.png|thumb|700px|center|Starting the install of Windows 2008 R2 as a virtual machine]]&lt;br /&gt;
&lt;br /&gt;
I like to close the default VNC session and flip over to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-manager&amp;lt;/span&amp;gt;. This is what you should see if you do the same.&lt;br /&gt;
&lt;br /&gt;
[[Image:Installing_Win2008_VM_via_virt-manager_02.png|thumb|700px|center|Monitoring the install of Windows 2008 R2 via &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-manager&amp;lt;/span&amp;gt;.]]&lt;br /&gt;
&lt;br /&gt;
As before, let the install finish before proceeding. Once the install is completed and you&#039;ve booted for the first time, dump the configuration to an XML file, define it on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt; and update the backups on either node&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/root/&amp;lt;/span&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
Dump the XML definition.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
virsh dumpxml vm0002_win1 &amp;gt; /xen_shared/definitions/vm0002_win1.xml&lt;br /&gt;
ls -lah /xen_shared/definitions/vm0002_win1.xml&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
-rw-r--r-- 1 root root 1.5K May 14 23:27 /xen_shared/definitions/vm0002_win1.xml&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Define the VM on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&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;
virsh define /xen_shared/definitions/vm0002_win1.xml &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Domain vm0002_win1 defined from /xen_shared/definitions/vm0002_win1.xml&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Backup the new VM definition on each node.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
rsync -av /xen_shared/definitions ~/&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
building file list ... done&lt;br /&gt;
definitions/&lt;br /&gt;
definitions/vm0002_win1.xml&lt;br /&gt;
&lt;br /&gt;
sent 1646 bytes  received 48 bytes  3388.00 bytes/sec&lt;br /&gt;
total size is 2446  speedup is 1.44&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Image:Installing_Win2008_VM_via_virt-manager_03.png|thumb|700px|center|Seeing the Windows 2008 R2 on both nodes via &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-manager&amp;lt;/span&amp;gt;.]]&lt;br /&gt;
&lt;br /&gt;
Now we see both VMs defined on both nodes!&lt;br /&gt;
&lt;br /&gt;
= Making Our VMs Highly Available Cluster Services =&lt;br /&gt;
&lt;br /&gt;
We&#039;re ready to start the final step; Making our VMs highly available via cluster management! This involves two major steps:&lt;br /&gt;
* Creating two new, ordered failover Domains; One with each node as the highest priority.&lt;br /&gt;
* Adding our VMs as services, one is each new failover domain.&lt;br /&gt;
&lt;br /&gt;
== Creating the Ordered Failover Domains ==&lt;br /&gt;
&lt;br /&gt;
The idea here is that each new failover domain will have one node with a higher priority than the other. That is, one will have &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt; with the highest priority and the other will have &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt; as the highest. This way, VMs that we want to normally run on a given node will be added to the matching failover domain.&lt;br /&gt;
&lt;br /&gt;
To add the two new failover domains, we&#039;ll add the following to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/cluster/cluster.conf&amp;lt;/span&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
              &amp;lt;failoverdomains&amp;gt;&lt;br /&gt;
                        ...&lt;br /&gt;
                        &amp;lt;failoverdomain name=&amp;quot;an4_primary&amp;quot; nofailback=&amp;quot;0&amp;quot; ordered=&amp;quot;1&amp;quot; restricted=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
                                &amp;lt;failoverdomainnode name=&amp;quot;an-node04.alteeve.com&amp;quot; priority=&amp;quot;1&amp;quot;/&amp;gt;&lt;br /&gt;
                                &amp;lt;failoverdomainnode name=&amp;quot;an-node05.alteeve.com&amp;quot; priority=&amp;quot;2&amp;quot;/&amp;gt;&lt;br /&gt;
                        &amp;lt;/failoverdomain&amp;gt;&lt;br /&gt;
                        &amp;lt;failoverdomain name=&amp;quot;an5_primary&amp;quot; nofailback=&amp;quot;0&amp;quot; ordered=&amp;quot;1&amp;quot; restricted=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
                                &amp;lt;failoverdomainnode name=&amp;quot;an-node04.alteeve.com&amp;quot; priority=&amp;quot;2&amp;quot;/&amp;gt;&lt;br /&gt;
                                &amp;lt;failoverdomainnode name=&amp;quot;an-node05.alteeve.com&amp;quot; priority=&amp;quot;1&amp;quot;/&amp;gt;&lt;br /&gt;
                        &amp;lt;/failoverdomain&amp;gt;&lt;br /&gt;
              &amp;lt;/failoverdomains&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As always, validate it. We&#039;ll see here what the complete file now looks like. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
xmllint --relaxng /usr/share/system-config-cluster/misc/cluster.ng /etc/cluster/cluster.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&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-cluster01&amp;quot; config_version=&amp;quot;14&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;cman expected_votes=&amp;quot;1&amp;quot; two_node=&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-node04.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;fence_na01&amp;quot; port=&amp;quot;04&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-node05.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;fence_na01&amp;quot; port=&amp;quot;03&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 agent=&amp;quot;fence_na&amp;quot; ipaddr=&amp;quot;fence_na01.alteeve.com&amp;quot; login=&amp;quot;admin&amp;quot; name=&amp;quot;fence_na01&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;fence_daemon post_join_delay=&amp;quot;60&amp;quot;/&amp;gt;&lt;br /&gt;
        &amp;lt;totem rrp_mode=&amp;quot;none&amp;quot; secauth=&amp;quot;off&amp;quot;/&amp;gt;&lt;br /&gt;
        &amp;lt;rm&amp;gt;&lt;br /&gt;
                &amp;lt;resources&amp;gt;&lt;br /&gt;
                        &amp;lt;script file=&amp;quot;/etc/init.d/drbd&amp;quot; name=&amp;quot;drbd&amp;quot;/&amp;gt;&lt;br /&gt;
                        &amp;lt;script file=&amp;quot;/etc/init.d/clvmd&amp;quot; name=&amp;quot;clvmd&amp;quot;/&amp;gt;&lt;br /&gt;
                        &amp;lt;script file=&amp;quot;/etc/init.d/gfs2&amp;quot; name=&amp;quot;gfs2&amp;quot;/&amp;gt;&lt;br /&gt;
                &amp;lt;/resources&amp;gt;&lt;br /&gt;
		&amp;lt;failoverdomains&amp;gt;&lt;br /&gt;
			&amp;lt;failoverdomain name=&amp;quot;an4_only&amp;quot; nofailback=&amp;quot;0&amp;quot; ordered=&amp;quot;0&amp;quot; restricted=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
				&amp;lt;failoverdomainnode name=&amp;quot;an-node04.alteeve.com&amp;quot; priority=&amp;quot;1&amp;quot;/&amp;gt;&lt;br /&gt;
			&amp;lt;/failoverdomain&amp;gt;&lt;br /&gt;
			&amp;lt;failoverdomain name=&amp;quot;an5_only&amp;quot; nofailback=&amp;quot;0&amp;quot; ordered=&amp;quot;0&amp;quot; restricted=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
				&amp;lt;failoverdomainnode name=&amp;quot;an-node05.alteeve.com&amp;quot; priority=&amp;quot;1&amp;quot;/&amp;gt;&lt;br /&gt;
			&amp;lt;/failoverdomain&amp;gt;&lt;br /&gt;
			&amp;lt;failoverdomain name=&amp;quot;an4_primary&amp;quot; nofailback=&amp;quot;0&amp;quot; ordered=&amp;quot;1&amp;quot; restricted=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
				&amp;lt;failoverdomainnode name=&amp;quot;an-node04.alteeve.com&amp;quot; priority=&amp;quot;1&amp;quot;/&amp;gt;&lt;br /&gt;
				&amp;lt;failoverdomainnode name=&amp;quot;an-node05.alteeve.com&amp;quot; priority=&amp;quot;2&amp;quot;/&amp;gt;&lt;br /&gt;
			&amp;lt;/failoverdomain&amp;gt;&lt;br /&gt;
			&amp;lt;failoverdomain name=&amp;quot;an5_primary&amp;quot; nofailback=&amp;quot;0&amp;quot; ordered=&amp;quot;1&amp;quot; restricted=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
				&amp;lt;failoverdomainnode name=&amp;quot;an-node04.alteeve.com&amp;quot; priority=&amp;quot;2&amp;quot;/&amp;gt;&lt;br /&gt;
				&amp;lt;failoverdomainnode name=&amp;quot;an-node05.alteeve.com&amp;quot; priority=&amp;quot;1&amp;quot;/&amp;gt;&lt;br /&gt;
			&amp;lt;/failoverdomain&amp;gt;&lt;br /&gt;
		&amp;lt;/failoverdomains&amp;gt;&lt;br /&gt;
		&amp;lt;service autostart=&amp;quot;0&amp;quot; domain=&amp;quot;an4_only&amp;quot; exclusive=&amp;quot;0&amp;quot; max_restarts=&amp;quot;0&amp;quot; name=&amp;quot;an4_storage&amp;quot; recovery=&amp;quot;restart&amp;quot; restart_expire_time=&amp;quot;0&amp;quot;&amp;gt;&lt;br /&gt;
			&amp;lt;script ref=&amp;quot;drbd&amp;quot;&amp;gt;&lt;br /&gt;
				&amp;lt;script ref=&amp;quot;clvmd&amp;quot;&amp;gt;&lt;br /&gt;
					&amp;lt;script ref=&amp;quot;gfs2&amp;quot;/&amp;gt;&lt;br /&gt;
				&amp;lt;/script&amp;gt;&lt;br /&gt;
			&amp;lt;/script&amp;gt;&lt;br /&gt;
		&amp;lt;/service&amp;gt;&lt;br /&gt;
		&amp;lt;service autostart=&amp;quot;0&amp;quot; domain=&amp;quot;an5_only&amp;quot; exclusive=&amp;quot;0&amp;quot; max_restarts=&amp;quot;0&amp;quot; name=&amp;quot;an5_storage&amp;quot; recovery=&amp;quot;restart&amp;quot; restart_expire_time=&amp;quot;0&amp;quot;&amp;gt;&lt;br /&gt;
			&amp;lt;script ref=&amp;quot;drbd&amp;quot;&amp;gt;&lt;br /&gt;
				&amp;lt;script ref=&amp;quot;clvmd&amp;quot;&amp;gt;&lt;br /&gt;
					&amp;lt;script ref=&amp;quot;gfs2&amp;quot;/&amp;gt;&lt;br /&gt;
				&amp;lt;/script&amp;gt;&lt;br /&gt;
			&amp;lt;/script&amp;gt;&lt;br /&gt;
		&amp;lt;/service&amp;gt;&lt;br /&gt;
        &amp;lt;/rm&amp;gt;&lt;br /&gt;
&amp;lt;/cluster&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;
/etc/cluster/cluster.conf validates&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With it validating, push it to the other node.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ccs_tool update /etc/cluster/cluster.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;
Config file updated from version 13 to 14&lt;br /&gt;
&lt;br /&gt;
Update complete.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Adding The VMs To rgmanager ==&lt;br /&gt;
&lt;br /&gt;
This is where we tell &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; which VMs we want to run on which nodes when both are online.&lt;br /&gt;
&lt;br /&gt;
{{note|1=There is a bit of a trick when using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; with our cluster. There is no real way to delay the start of virtual machines until after the storage services are online. The side effect of this is that, if the VMs are set to automatically start with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt;, the VMs will fail because their underlying storage takes too long to come online. For this reason, we will not configure them to start automatically.}}&lt;br /&gt;
&lt;br /&gt;
=== Creating the vm:&amp;lt;domu&amp;gt; Resources ===&lt;br /&gt;
&lt;br /&gt;
Virtual machine services are a special-case in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt;, and have their own &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;vm .../&amp;gt;&amp;lt;/span&amp;gt; tag. Here are the two we will be adding for the two VMs we created in the previous section.&lt;br /&gt;
&lt;br /&gt;
{{warning|1=Make sure that the VMs are shut down before adding them to the cluster! Otherwise &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; will restart them when you first enable the new &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;vm /&amp;gt;&amp;lt;/span&amp;gt; resources.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;rm&amp;gt;&lt;br /&gt;
                ...&lt;br /&gt;
                &amp;lt;vm name=&amp;quot;vm0001_ws1&amp;quot; domain=&amp;quot;an4_primary&amp;quot; path=&amp;quot;/xen_shared/definitions/&amp;quot;&lt;br /&gt;
                 autostart=&amp;quot;0&amp;quot; exclusive=&amp;quot;0&amp;quot; recovery=&amp;quot;restart&amp;quot; max_restarts=&amp;quot;2&amp;quot; restart_expire_time=&amp;quot;600&amp;quot;/&amp;gt;&lt;br /&gt;
                &amp;lt;vm name=&amp;quot;vm0002_win1&amp;quot; domain=&amp;quot;an5_primary&amp;quot; path=&amp;quot;/xen_shared/definitions/&amp;quot;&lt;br /&gt;
                 autostart=&amp;quot;0&amp;quot; exclusive=&amp;quot;0&amp;quot; recovery=&amp;quot;restart&amp;quot; max_restarts=&amp;quot;2&amp;quot; restart_expire_time=&amp;quot;600&amp;quot;/&amp;gt;&lt;br /&gt;
        &amp;lt;/rm&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The attributes are:&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;name&amp;lt;/span&amp;gt;; This is the name of the VM and must match the name of the VM shown by &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virsh list&amp;lt;/span&amp;gt; as well as the definition file name, minus the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;.xml&amp;lt;/span&amp;gt; suffix.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;domain&amp;lt;/span&amp;gt;; This is the name of the failover domain that this VM will operate within.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;path&amp;lt;/span&amp;gt;; This is the full path to where the VM definition files are kept. It &#039;&#039;&#039;is not&#039;&#039;&#039; the full path to the actual definition file itself!&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;autostart&amp;lt;/span&amp;gt;; As mentioned above, we do not want the VMs to automatically start with the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt;, so we set this to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;0&amp;lt;/span&amp;gt;.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;exclusive&amp;lt;/span&amp;gt;; When set, this will prevent &#039;&#039;&#039;any&#039;&#039;&#039; other service from running on the node. This would take out the storage services, so this &#039;&#039;&#039;must&#039;&#039;&#039; be set to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;0&amp;lt;/span&amp;gt;.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;recovery&amp;lt;/span&amp;gt;; This is how the VM should be recovered after it crashes. The options are &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;restart&amp;lt;/span&amp;gt;, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;relocate&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;disable&amp;lt;/span&amp;gt;.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;max_restarts&amp;lt;/span&amp;gt;; This is how many times the VM is allowed to be restarted (from a crash) before the VM is migrated to another node in the failover domain. The idea here is that, normally, we simply want to restart the VM in-place if the VM itself crashed and the underlying node is healthy. However, once the VM restarts this number a times, we assume that there is actually a problem with the VM running on the current node, so we want to give up and move the VM to another node. We will use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;2&amp;lt;/span&amp;gt; restarts before switching to a migration.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;restart_expire_time&amp;lt;/span&amp;gt;; Whenever a VM is restarted, a counter is incremented, which is compared against &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;max_restarts&amp;lt;/span&amp;gt;. After this many seconds, that restart is &amp;quot;forgotten&amp;quot; and the restart counter is reduced by one. With our value of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;600&amp;lt;/span&amp;gt; seconds (10 minutes) and a &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;max_restarts&amp;lt;/span&amp;gt; of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;2&amp;lt;/span&amp;gt;, the VM will be relocated instead of restarted after the third crash in ten minutes.&lt;br /&gt;
&lt;br /&gt;
Again, validate it. We&#039;ll see here what the complete file now looks like. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
xmllint --relaxng /usr/share/system-config-cluster/misc/cluster.ng /etc/cluster/cluster.conf&lt;br /&gt;
&amp;lt;/source&amp;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-cluster01&amp;quot; config_version=&amp;quot;15&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;cman expected_votes=&amp;quot;1&amp;quot; two_node=&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-node04.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;fence_na01&amp;quot; port=&amp;quot;04&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-node05.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;fence_na01&amp;quot; port=&amp;quot;03&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 agent=&amp;quot;fence_na&amp;quot; ipaddr=&amp;quot;fence_na01.alteeve.com&amp;quot; login=&amp;quot;admin&amp;quot; name=&amp;quot;fence_na01&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;fence_daemon post_join_delay=&amp;quot;60&amp;quot;/&amp;gt;&lt;br /&gt;
        &amp;lt;totem rrp_mode=&amp;quot;none&amp;quot; secauth=&amp;quot;off&amp;quot;/&amp;gt;&lt;br /&gt;
        &amp;lt;rm&amp;gt;&lt;br /&gt;
                &amp;lt;resources&amp;gt;&lt;br /&gt;
                        &amp;lt;script file=&amp;quot;/etc/init.d/drbd&amp;quot; name=&amp;quot;drbd&amp;quot;/&amp;gt;&lt;br /&gt;
                        &amp;lt;script file=&amp;quot;/etc/init.d/clvmd&amp;quot; name=&amp;quot;clvmd&amp;quot;/&amp;gt;&lt;br /&gt;
                        &amp;lt;script file=&amp;quot;/etc/init.d/gfs2&amp;quot; name=&amp;quot;gfs2&amp;quot;/&amp;gt;&lt;br /&gt;
                &amp;lt;/resources&amp;gt;&lt;br /&gt;
		&amp;lt;failoverdomains&amp;gt;&lt;br /&gt;
			&amp;lt;failoverdomain name=&amp;quot;an4_only&amp;quot; nofailback=&amp;quot;0&amp;quot; ordered=&amp;quot;0&amp;quot; restricted=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
				&amp;lt;failoverdomainnode name=&amp;quot;an-node04.alteeve.com&amp;quot; priority=&amp;quot;1&amp;quot;/&amp;gt;&lt;br /&gt;
			&amp;lt;/failoverdomain&amp;gt;&lt;br /&gt;
			&amp;lt;failoverdomain name=&amp;quot;an5_only&amp;quot; nofailback=&amp;quot;0&amp;quot; ordered=&amp;quot;0&amp;quot; restricted=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
				&amp;lt;failoverdomainnode name=&amp;quot;an-node05.alteeve.com&amp;quot; priority=&amp;quot;1&amp;quot;/&amp;gt;&lt;br /&gt;
			&amp;lt;/failoverdomain&amp;gt;&lt;br /&gt;
			&amp;lt;failoverdomain name=&amp;quot;an4_primary&amp;quot; nofailback=&amp;quot;0&amp;quot; ordered=&amp;quot;1&amp;quot; restricted=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
				&amp;lt;failoverdomainnode name=&amp;quot;an-node04.alteeve.com&amp;quot; priority=&amp;quot;1&amp;quot;/&amp;gt;&lt;br /&gt;
				&amp;lt;failoverdomainnode name=&amp;quot;an-node05.alteeve.com&amp;quot; priority=&amp;quot;2&amp;quot;/&amp;gt;&lt;br /&gt;
			&amp;lt;/failoverdomain&amp;gt;&lt;br /&gt;
			&amp;lt;failoverdomain name=&amp;quot;an5_primary&amp;quot; nofailback=&amp;quot;0&amp;quot; ordered=&amp;quot;1&amp;quot; restricted=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
				&amp;lt;failoverdomainnode name=&amp;quot;an-node04.alteeve.com&amp;quot; priority=&amp;quot;2&amp;quot;/&amp;gt;&lt;br /&gt;
				&amp;lt;failoverdomainnode name=&amp;quot;an-node05.alteeve.com&amp;quot; priority=&amp;quot;1&amp;quot;/&amp;gt;&lt;br /&gt;
			&amp;lt;/failoverdomain&amp;gt;&lt;br /&gt;
		&amp;lt;/failoverdomains&amp;gt;&lt;br /&gt;
		&amp;lt;service autostart=&amp;quot;0&amp;quot; domain=&amp;quot;an4_only&amp;quot; exclusive=&amp;quot;0&amp;quot; max_restarts=&amp;quot;0&amp;quot; name=&amp;quot;an4_storage&amp;quot; recovery=&amp;quot;restart&amp;quot; restart_expire_time=&amp;quot;0&amp;quot;&amp;gt;&lt;br /&gt;
			&amp;lt;script ref=&amp;quot;drbd&amp;quot;&amp;gt;&lt;br /&gt;
				&amp;lt;script ref=&amp;quot;clvmd&amp;quot;&amp;gt;&lt;br /&gt;
					&amp;lt;script ref=&amp;quot;gfs2&amp;quot;/&amp;gt;&lt;br /&gt;
				&amp;lt;/script&amp;gt;&lt;br /&gt;
			&amp;lt;/script&amp;gt;&lt;br /&gt;
		&amp;lt;/service&amp;gt;&lt;br /&gt;
		&amp;lt;service autostart=&amp;quot;0&amp;quot; domain=&amp;quot;an5_only&amp;quot; exclusive=&amp;quot;0&amp;quot; max_restarts=&amp;quot;0&amp;quot; name=&amp;quot;an5_storage&amp;quot; recovery=&amp;quot;restart&amp;quot; restart_expire_time=&amp;quot;0&amp;quot;&amp;gt;&lt;br /&gt;
			&amp;lt;script ref=&amp;quot;drbd&amp;quot;&amp;gt;&lt;br /&gt;
				&amp;lt;script ref=&amp;quot;clvmd&amp;quot;&amp;gt;&lt;br /&gt;
					&amp;lt;script ref=&amp;quot;gfs2&amp;quot;/&amp;gt;&lt;br /&gt;
				&amp;lt;/script&amp;gt;&lt;br /&gt;
			&amp;lt;/script&amp;gt;&lt;br /&gt;
		&amp;lt;/service&amp;gt;&lt;br /&gt;
                &amp;lt;vm name=&amp;quot;vm0001_ws1&amp;quot; domain=&amp;quot;an4_primary&amp;quot; path=&amp;quot;/xen_shared/definitions/&amp;quot; autostart=&amp;quot;0&amp;quot; exclusive=&amp;quot;0&amp;quot; recovery=&amp;quot;restart&amp;quot; max_restarts=&amp;quot;2&amp;quot; restart_expire_time=&amp;quot;600&amp;quot;/&amp;gt;&lt;br /&gt;
                &amp;lt;vm name=&amp;quot;vm0002_win1&amp;quot; domain=&amp;quot;an5_primary&amp;quot; path=&amp;quot;/xen_shared/definitions/&amp;quot; autostart=&amp;quot;0&amp;quot; exclusive=&amp;quot;0&amp;quot; recovery=&amp;quot;restart&amp;quot; max_restarts=&amp;quot;2&amp;quot; restart_expire_time=&amp;quot;600&amp;quot;/&amp;gt;&lt;br /&gt;
        &amp;lt;/rm&amp;gt;&lt;br /&gt;
&amp;lt;/cluster&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;
/etc/cluster/cluster.conf validates&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now push the updated configuration out.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ccs_tool update /etc/cluster/cluster.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;
Config file updated from version 14 to 15&lt;br /&gt;
&lt;br /&gt;
Update complete.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{note|1=You can use migration mapping to map hostnames to names resolved to other interfaces on the host by adding &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;vm ... migration_mapping=&amp;quot;an-node01.alteeve.com:an-node01.bcn,an-node02.alteeve.com:an-node02.bcn&amp;quot;&amp;lt;/span&amp;gt;. Thanks to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;thomas_s&amp;lt;/span&amp;gt; on the Freenode &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;#linux-cluster&amp;lt;/span&amp;gt; IRC channel for pointing this out.}}&lt;br /&gt;
&lt;br /&gt;
=== Using the new VM Resources ===&lt;br /&gt;
&lt;br /&gt;
{{note|1=We&#039;ll be running all of the commands in this section on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt;.}}&lt;br /&gt;
&lt;br /&gt;
If you now run &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clustat&amp;lt;/span&amp;gt; on either node, you should see the new VM resources.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
clustat &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Cluster Status for an-cluster01 @ Sun May 15 12:36:10 2011&lt;br /&gt;
Member Status: Quorate&lt;br /&gt;
&lt;br /&gt;
 Member Name                             ID   Status&lt;br /&gt;
 ------ ----                             ---- ------&lt;br /&gt;
 an-node04.alteeve.com                       1 Online, Local, rgmanager&lt;br /&gt;
 an-node05.alteeve.com                       2 Online, rgmanager&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State         &lt;br /&gt;
 ------- ----                   ----- ------                   -----         &lt;br /&gt;
 service:an4_storage            an-node04.alteeve.com          started       &lt;br /&gt;
 service:an5_storage            an-node05.alteeve.com          started       &lt;br /&gt;
 vm:vm0001_ws1                  (none)                         disabled      &lt;br /&gt;
 vm:vm0002_win1                 (none)                         disabled      &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we can start the VMs using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt;!&lt;br /&gt;
&lt;br /&gt;
{{note|1=As we&#039;ll be starting a non-standard, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm&amp;lt;/span&amp;gt; service, we need to type out the full service name, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm:domu&amp;lt;/span&amp;gt;.}}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt;&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
clusvcadm -e vm:vm0001_ws1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Local machine trying to enable vm:vm0001_ws1...Success&lt;br /&gt;
vm:vm0001_ws1 is now running on an-node04.alteeve.com&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you check with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virsh&amp;lt;/span&amp;gt;, you&#039;ll see it running now.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
virsh list --all&lt;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 Name                 State&lt;br /&gt;
----------------------------------&lt;br /&gt;
  0 Domain-0             running&lt;br /&gt;
  1 vm0001_ws1           running&lt;br /&gt;
  - vm0002_win1          shut off&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Likewise, if you check &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clustat&amp;lt;/span&amp;gt; from either node, you will see the new VM service running on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&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;
clustat &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Cluster Status for an-cluster01 @ Sun May 15 12:38:38 2011&lt;br /&gt;
Member Status: Quorate&lt;br /&gt;
&lt;br /&gt;
 Member Name                             ID   Status&lt;br /&gt;
 ------ ----                             ---- ------&lt;br /&gt;
 an-node04.alteeve.com                       1 Online, Local, rgmanager&lt;br /&gt;
 an-node05.alteeve.com                       2 Online, rgmanager&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State         &lt;br /&gt;
 ------- ----                   ----- ------                   -----         &lt;br /&gt;
 service:an4_storage            an-node04.alteeve.com          started       &lt;br /&gt;
 service:an5_storage            an-node05.alteeve.com          started       &lt;br /&gt;
 vm:vm0001_ws1                  an-node04.alteeve.com          started       &lt;br /&gt;
 vm:vm0002_win1                 (none)                         disabled      &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So far, so good. Now let&#039;s start the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0002_win1&amp;lt;/span&amp;gt; VM.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt;&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
clusvcadm -e vm:vm0002_win1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Local machine trying to enable vm:vm0002_win1...Success&lt;br /&gt;
vm:vm0002_win1 is now running on an-node04.alteeve.com&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It started, but it didn&#039;t start on the node we normally want!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
clustat &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Cluster Status for an-cluster01 @ Sun May 15 12:40:21 2011&lt;br /&gt;
Member Status: Quorate&lt;br /&gt;
&lt;br /&gt;
 Member Name                             ID   Status&lt;br /&gt;
 ------ ----                             ---- ------&lt;br /&gt;
 an-node04.alteeve.com                       1 Online, Local, rgmanager&lt;br /&gt;
 an-node05.alteeve.com                       2 Online, rgmanager&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State         &lt;br /&gt;
 ------- ----                   ----- ------                   -----         &lt;br /&gt;
 service:an4_storage            an-node04.alteeve.com          started       &lt;br /&gt;
 service:an5_storage            an-node05.alteeve.com          started       &lt;br /&gt;
 vm:vm0001_ws1                  an-node04.alteeve.com          started       &lt;br /&gt;
 vm:vm0002_win1                 an-node04.alteeve.com          started       &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;vm0002_win1&amp;lt;/span&amp;gt; VM started on the node that the command was executed from. We could have added &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;-m an-node05.alteeve.com&amp;lt;/span&amp;gt; to the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clusvcadm&amp;lt;/span&amp;gt;, which we&#039;ll do later. It&#039;s already running though, so lets use this &amp;quot;mistake&amp;quot; as a chance to look at migrating the VM using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clusvcadm&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
So to tell &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; to perform a live migration from &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt; to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt;, use the special &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;-M&amp;lt;/span&amp;gt; live migration switch along with the normal &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;-m&amp;lt;/span&amp;gt; target cluster member switch. For more information on these switches, please take a few minutes to read &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;man clusvcadm&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
{{note|1=If you want to watch the VM as it migrates, you will need to use a program that connects to the server via it&#039;s IP address, as opposed to using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-manager&amp;lt;/span&amp;gt;. The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-manager&amp;lt;/span&amp;gt; connections are bound to the dom0 and will close once the VM moves to the other node. For Linux machines, you can connect using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ssh&amp;lt;/span&amp;gt; or &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vnc&amp;lt;/span&amp;gt; (by IP). For windows, you can connect using RDP (remote desktop protocol) using a program like &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;tsclient&amp;lt;/span&amp;gt; from Linux machines.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
clusvcadm -M vm:vm0002_win1 -m an-node05.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;
Trying to migrate vm:vm0002_win1 to an-node05.alteeve.com...Success&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we can use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clustat&amp;lt;/span&amp;gt; to see that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm:vm0002_win1&amp;lt;/span&amp;gt; service is now running on the proper &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05.alteeve.com&amp;lt;/span&amp;gt; node.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
clustat &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Cluster Status for an-cluster01 @ Sun May 15 12:53:30 2011&lt;br /&gt;
Member Status: Quorate&lt;br /&gt;
&lt;br /&gt;
 Member Name                             ID   Status&lt;br /&gt;
 ------ ----                             ---- ------&lt;br /&gt;
 an-node04.alteeve.com                       1 Online, Local, rgmanager&lt;br /&gt;
 an-node05.alteeve.com                       2 Online, rgmanager&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State         &lt;br /&gt;
 ------- ----                   ----- ------                   -----         &lt;br /&gt;
 service:an4_storage            an-node04.alteeve.com          started       &lt;br /&gt;
 service:an5_storage            an-node05.alteeve.com          started       &lt;br /&gt;
 vm:vm0001_ws1                  an-node04.alteeve.com          started       &lt;br /&gt;
 vm:vm0002_win1                 an-node05.alteeve.com          started       &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Before starting the migration, I logged into the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0002_win1&amp;lt;/span&amp;gt; machine and started a continuous ping against &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;google.ca&amp;lt;/span&amp;gt;. As you can see below, four packets were lost. This is the worst packet loss I was able to get in testing. Usually no packets were lost, but connections do sometimes drop for a very short period.&lt;br /&gt;
&lt;br /&gt;
[[Image:live_migration_vm0002_win2008_to_an-node05_ping.png|thumb|700px|center|Continuous ping from within the live-migrated VM against &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;google.ca&amp;lt;/span&amp;gt; using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;tsclient&amp;lt;/span&amp;gt; to monitor the connection.]]&lt;br /&gt;
&lt;br /&gt;
= Congratulations, Your Cluster Is Complete! Now, Break It! =&lt;br /&gt;
&lt;br /&gt;
You may have noticed that the two storage resources are still not set to automatically start with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt;. This is on purpose, as we now need to work through all of the possible failure modes. Until we&#039;ve done so, out cluster &#039;&#039;&#039;&#039;&#039;is not production ready&#039;&#039;&#039;&#039;&#039;! &lt;br /&gt;
&lt;br /&gt;
It&#039;s true, at this point the cluster is technically finished. As we&#039;ll soon see, we can kill a node and it&#039;s lost VMs will recover on the surviving node. &#039;&#039;&#039;However&#039;&#039;&#039;, that is only a part of this exercise.&lt;br /&gt;
&lt;br /&gt;
Remember back at the beginning how we talked about the inherent complexity of clusters? We need to now break our cluster at every point within that complexity that we can. We need to see how things go wrong so that we can learn how to resolve the problems that &#039;&#039;&#039;will&#039;&#039;&#039; arise now, while we have the luxury of time and a cluster with no real data on it. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Once you go in to production, it is too late to learn.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Backup a Second; Let&#039;s See How It&#039;s Supposed to Work ==&lt;br /&gt;
&lt;br /&gt;
Before we grab a hammer, let&#039;s go over how a clean stop and start should work.&lt;br /&gt;
&lt;br /&gt;
=== Gracefully Shutting Down the Cluster ===&lt;br /&gt;
&lt;br /&gt;
If you&#039;ve followed through this tutorial in order, you probably already have everything running, so let&#039;s start by talking about how to shut down the cluster properly.&lt;br /&gt;
&lt;br /&gt;
The stop order is:&lt;br /&gt;
* Lock &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; services that can migrate; The vm services in our case.&lt;br /&gt;
* Disable all &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; services.&lt;br /&gt;
* Stop the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; daemon.&lt;br /&gt;
* Stop the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt; daemon.&lt;br /&gt;
&lt;br /&gt;
Stopping the virtual machines is no longer a simple task. If you try to power down the VM from within the OS, the cluster will &amp;quot;recover&amp;quot; it as soon as it shuts off. Likewise if you try to stop it using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virsh shutdown &#039;&#039;domU&#039;&#039;&amp;lt;/span&amp;gt;. You can stop a VM by simple disabling it via &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt;, but that is not enough when preparing for a complete shutdown of the cluster as the VM could be restarted on another node in some cases. &lt;br /&gt;
&lt;br /&gt;
To ensure that the VM stays off, we&#039;ll &amp;quot;lock&amp;quot; the service. This will prevent all actions except for disabling (shutting down) the VM. Once quorum is lost though, this lock is lost, so you don&#039;t need to worry about unlocking it later when you restart the cluster.&lt;br /&gt;
&lt;br /&gt;
So let&#039;s take a look at the running resources.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
clustat&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Cluster Status for an-cluster01 @ Sun May 15 13:14:05 2011&lt;br /&gt;
Member Status: Quorate&lt;br /&gt;
&lt;br /&gt;
 Member Name                             ID   Status&lt;br /&gt;
 ------ ----                             ---- ------&lt;br /&gt;
 an-node04.alteeve.com                       1 Online, Local, rgmanager&lt;br /&gt;
 an-node05.alteeve.com                       2 Online, rgmanager&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State         &lt;br /&gt;
 ------- ----                   ----- ------                   -----         &lt;br /&gt;
 service:an4_storage            an-node04.alteeve.com          started       &lt;br /&gt;
 service:an5_storage            an-node05.alteeve.com          started       &lt;br /&gt;
 vm:vm0001_ws1                  an-node04.alteeve.com          started       &lt;br /&gt;
 vm:vm0002_win1                 an-node05.alteeve.com          started       &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We don&#039;t need to worry about the two storage services as they&#039;re in failover domains that, well, don&#039;t fail over anyway. Thus, we&#039;ll lock the two VMs. Note that it doesn&#039;t matter where the lock is issued.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
clusvcadm -l vm:vm0001_ws1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Resource groups locked&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;
clusvcadm -l vm:vm0002_win1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Resource groups locked&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I don&#039;t know of a way to see if a service has been locked as &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clustat&amp;lt;/span&amp;gt; will show no change. However, you can unlock a service if you decided not to shutdown the cluster by replacing the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;-l&amp;lt;/span&amp;gt; switch with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;-u&amp;lt;/span&amp;gt; in the calls above.&lt;br /&gt;
&lt;br /&gt;
[[Image:Locking_the_vm_services_01.png|center|thumb|700px|Locking the two VM services prior to cluster shutdown.]]&lt;br /&gt;
&lt;br /&gt;
Now you can disable the two VM services safely. Note that the disable call will not return until the VM has shut down, so be patient.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
clusvcadm -d vm:vm0001_ws1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Local machine disabling vm:vm0001_ws1...Success&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;
clusvcadm -d vm:vm0002_win1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Local machine disabling vm:vm0002_win1...Success&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Image:Disabling_the_vm_services_01.png|center|thumb|700px|Disabling the two VM services prior to cluster shutdown.]]&lt;br /&gt;
&lt;br /&gt;
You may notice in the screenshot above that the both VMs were disabled from &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt;, despite &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0002_win1&amp;lt;/span&amp;gt; running on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt; even without the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;-m &amp;lt;node&amp;gt;&amp;lt;/span&amp;gt; option. &lt;br /&gt;
&lt;br /&gt;
Check to confirm that the VMs are off now.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
clustat&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Cluster Status for an-cluster01 @ Sun May 15 13:38:20 2011&lt;br /&gt;
Member Status: Quorate&lt;br /&gt;
&lt;br /&gt;
 Member Name                             ID   Status&lt;br /&gt;
 ------ ----                             ---- ------&lt;br /&gt;
 an-node04.alteeve.com                       1 Online, Local, rgmanager&lt;br /&gt;
 an-node05.alteeve.com                       2 Online, rgmanager&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State         &lt;br /&gt;
 ------- ----                   ----- ------                   -----         &lt;br /&gt;
 service:an4_storage            an-node04.alteeve.com          started       &lt;br /&gt;
 service:an5_storage            an-node05.alteeve.com          started       &lt;br /&gt;
 vm:vm0001_ws1                  (an-node04.alteeve.com)        disabled      &lt;br /&gt;
 vm:vm0002_win1                 (an-node05.alteeve.com)        disabled      &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now that the VMs are down, we can stop &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; on both nodes. This will stop the storage services on each node in the process, and we don&#039;t need to worry about them being restarted as they can&#039;t fail to another node and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; will be gone before they could restart. It&#039;s a bit lazy, but it&#039;s safe.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/rgmanager 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;
Shutting down Cluster Service Manager...&lt;br /&gt;
Waiting for services to stop:                              [  OK  ]&lt;br /&gt;
Cluster Service Manager is stopped.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Image:Stopping_the_rgmanager_daemon_01.png|center|thumb|700px|Stopping the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; daemon on both nodes.]]&lt;br /&gt;
&lt;br /&gt;
Notice in the screenshot above that we can see the storage service halting after &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; is told to stop.&lt;br /&gt;
&lt;br /&gt;
We can confirm that storage is stopped simply by checking the status of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;drbd&amp;lt;/span&amp;gt;. If anything went wrong, one or more of the DRBD resources would have been held open and prevented from stopping. If the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;drbd&amp;lt;/span&amp;gt; module is unloaded, we know that the shutdown was successful.&lt;br /&gt;
&lt;br /&gt;
Check this from both nodes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/drbd 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;
drbd not loaded&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now, all that is left is to stop &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&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/cman 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;
Stopping cluster: &lt;br /&gt;
   Stopping fencing... done&lt;br /&gt;
   Stopping cman... done&lt;br /&gt;
   Stopping ccsd... done&lt;br /&gt;
   Unmounting configfs... done&lt;br /&gt;
                                                           [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
That&#039;s it, you can down safely shut down the nodes!&lt;br /&gt;
&lt;br /&gt;
=== Cold Starting the Cluster ===&lt;br /&gt;
&lt;br /&gt;
Starting the cluster from scratch is a little different from starting and joining a node to en existing cluster, as we will see later. There are two main reasons:&lt;br /&gt;
&lt;br /&gt;
* If a node doesn&#039;t hear back from the other node when &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;openais&amp;lt;/span&amp;gt; starts, it &#039;&#039;&#039;must&#039;&#039;&#039; assume that the other node has crashed and that it needs to be fenced. Remember the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;post_join_delay&amp;lt;/span&amp;gt;? That is the maximum amount of time that a node will wait on start before it fires off a fence. Thus, we must start &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt; on both nodes within &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;post_join_delay&amp;lt;/span&amp;gt; seconds of one another.&lt;br /&gt;
* DRBD will not start until both nodes can talk to each other. If you start the storage service on either node, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;drbd&amp;lt;/span&amp;gt; will hang forever waiting for the other node to show up. It is possible to change this DRBD behaviour, but doing so is an exercise for the reader. &lt;br /&gt;
&lt;br /&gt;
Once both nodes are up, you can shut one node back down and safely run of just the one node. This is because the surviving node will see the other node withdraw, and thus will confidently know that it is not going to access the clustered resources. &lt;br /&gt;
&lt;br /&gt;
With this in mind, the cold-start order is:&lt;br /&gt;
&lt;br /&gt;
# Start the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt; daemon on both nodes within &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;post_join_delay&amp;lt;/span&amp;gt; seconds.&lt;br /&gt;
# Start the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; daemon on both nodes. At this point, the storage services are not set to start with the system, so there are no timing concerns yet.&lt;br /&gt;
# Enable the storage services on both nodes. We did not enable the DRBD timeout (see &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;man drbd.conf&amp;lt;/span&amp;gt;), so we don&#039;t have timing concerns here. Be aware that the enable command on the first node will not return until the storage service has been started on the second node. For this reason, you&#039;ll want to have two terminals open; One connected to each node.&lt;br /&gt;
# Verify that the storage services are all online.&lt;br /&gt;
# Start the virtual machine resources in the order that best suits you.&lt;br /&gt;
&lt;br /&gt;
So, start &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&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/cman 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 cluster: &lt;br /&gt;
   Loading modules... done&lt;br /&gt;
   Mounting configfs... done&lt;br /&gt;
   Starting ccsd... done&lt;br /&gt;
   Starting cman... done&lt;br /&gt;
   Starting daemons... done&lt;br /&gt;
   Starting fencing... done&lt;br /&gt;
                                                           [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Image:Starting_cman_on_both_nodes_01.png|thumb|center|700px|Starting &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt; on both nodes at the same time.]]&lt;br /&gt;
&lt;br /&gt;
Now we&#039;ll start &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; on both nodes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/rgmanager 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 Cluster Service Manager:                          [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I like to make a habit of running &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clustat&amp;lt;/span&amp;gt; right after starting, just to ensure that services are or are not running, as I&#039;d expect.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
clustat&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Cluster Status for an-cluster01 @ Sun May 15 16:42:41 2011&lt;br /&gt;
Member Status: Quorate&lt;br /&gt;
&lt;br /&gt;
 Member Name                             ID   Status&lt;br /&gt;
 ------ ----                             ---- ------&lt;br /&gt;
 an-node04.alteeve.com                       1 Online, Local, rgmanager&lt;br /&gt;
 an-node05.alteeve.com                       2 Online, rgmanager&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State         &lt;br /&gt;
 ------- ----                   ----- ------                   -----         &lt;br /&gt;
 service:an4_storage            (none)                         stopped       &lt;br /&gt;
 service:an5_storage            (none)                         stopped       &lt;br /&gt;
 vm:vm0001_ws1                  (none)                         stopped       &lt;br /&gt;
 vm:vm0002_win1                 (none)                         stopped       &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Image:Starting_rgmanager_on_both_nodes_01.png|thumb|center|700px|Starting &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; on both nodes and checking service states with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clustat&amp;lt;/span&amp;gt;.]]&lt;br /&gt;
&lt;br /&gt;
If you run &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clustat&amp;lt;/span&amp;gt; immediately after &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; has started, you may see no services listed. This is not a problem, it just takes a minute for the service states to become known to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
You may notice that the log files are complaining that they could not find the VM definition files in the search path. Remember back in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; section how we talked about the delay in getting the clustered storage online? This is the problem. The definitions are on the GFS2 partition which isn&#039;t available quickly enough. Even if we started the storage resources with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt;, which we will do later, it&#039;s still not fast enough to prevent &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; from failing to find the definition files and giving up. This is why we&#039;ll need to always start the virtual machines manually. &lt;br /&gt;
&lt;br /&gt;
As an aside, this isn&#039;t a problem with [[pacemaker]], as we&#039;ll see in the [[EL6]] tutorial later.&lt;br /&gt;
&lt;br /&gt;
Let&#039;s now start the clustered storage services. As an experiment, start the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an4_storage&amp;lt;/span&amp;gt; service and then wait some time before starting the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an5_storage&amp;lt;/span&amp;gt;. You&#039;ll see that the first service will pause indefinitely, as we discussed.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt;&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
clusvcadm -e an4_storage&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Local machine trying to enable service:an4_storage...&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Image:Starting_storage_on_one_node_01.png|thumb|center|700px|Starting &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an4_storage&amp;lt;/span&amp;gt; on just &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt;.]]&lt;br /&gt;
&lt;br /&gt;
Once you start the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an5_storage&amp;lt;/span&amp;gt; service, both will complete and return to the command line. Once done, I like to run a &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;status&amp;lt;/span&amp;gt; check 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; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;gfs2&amp;lt;/span&amp;gt; to ensure that things are as I expect them.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/drbd status &amp;amp;&amp;amp; /etc/init.d/clvmd status &amp;amp;&amp;amp; /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;
drbd driver loaded OK; device status:&lt;br /&gt;
version: 8.3.8 (api:88/proto:86-94)&lt;br /&gt;
GIT-hash: d78846e52224fd00562f7c225bcc25b2d422321d build by mockbuild@builder10.centos.org, 2010-06-04 08:04:27&lt;br /&gt;
m:res  cs         ro               ds                 p  mounted  fstype&lt;br /&gt;
0:r0   Connected  Primary/Primary  UpToDate/UpToDate  C&lt;br /&gt;
1:r1   Connected  Primary/Primary  UpToDate/UpToDate  C&lt;br /&gt;
2:r2   Connected  Primary/Primary  UpToDate/UpToDate  C&lt;br /&gt;
3:r3   Connected  Primary/Primary  UpToDate/UpToDate  C&lt;br /&gt;
clvmd (pid  6283) is running...&lt;br /&gt;
Clustered Volume Groups: drbd_an5_vg0 drbd_an4_vg0 drbd_sh0_vg0&lt;br /&gt;
Active clustered Logical Volumes: /dev/drbd_an5_vg0/vm0002_1 /dev/drbd_an4_vg0/vm0001_1 /dev/drbd_sh0_vg0/xen_shared&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;
[[Image:Starting_storage_on_the_other_node_01.png|thumb|center|700px|Starting &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an5_storage&amp;lt;/span&amp;gt; on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt; and then performing the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;status&amp;lt;/span&amp;gt; checks.]]&lt;br /&gt;
&lt;br /&gt;
Everything is in place, so now we can start the virtual machines. Given that VMs can run on either node, it&#039;s a good habit to explicitly define the target node using the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;-m&amp;lt;/span&amp;gt; &amp;quot;member&amp;quot; switch.&lt;br /&gt;
&lt;br /&gt;
Start the web server:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
clusvcadm -e vm:vm0001_ws1 -m an-node04.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;
Member an-node04.alteeve.com trying to enable vm:vm0001_ws1...Success&lt;br /&gt;
vm:vm0001_ws1 is now running on an-node04.alteeve.com&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Start the windows server:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
clusvcadm -e vm:vm0002_win1 -m an-node05.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;
Member an-node05.alteeve.com trying to enable vm:vm0002_win1...Success&lt;br /&gt;
vm:vm0002_win1 is now running on an-node05.alteeve.com&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check that they are running using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clustat&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;
clustat&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Cluster Status for an-cluster01 @ Sun May 15 17:05:49 2011&lt;br /&gt;
Member Status: Quorate&lt;br /&gt;
&lt;br /&gt;
 Member Name                             ID   Status&lt;br /&gt;
 ------ ----                             ---- ------&lt;br /&gt;
 an-node04.alteeve.com                       1 Online, Local, rgmanager&lt;br /&gt;
 an-node05.alteeve.com                       2 Online, rgmanager&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State         &lt;br /&gt;
 ------- ----                   ----- ------                   -----         &lt;br /&gt;
 service:an4_storage            an-node04.alteeve.com          started       &lt;br /&gt;
 service:an5_storage            an-node05.alteeve.com          started       &lt;br /&gt;
 vm:vm0001_ws1                  an-node04.alteeve.com          started       &lt;br /&gt;
 vm:vm0002_win1                 an-node05.alteeve.com          started       &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There we have it! The cluster is up and running from a complete cold start.&lt;br /&gt;
&lt;br /&gt;
== Testing Migration and Recovery ==&lt;br /&gt;
&lt;br /&gt;
We&#039;ve already looked at live migration of VMs before they were added to the cluster, but we&#039;ve not yet looked at live migrations &#039;&#039;within&#039;&#039; the cluster.&lt;br /&gt;
&lt;br /&gt;
Our tests will cover:&lt;br /&gt;
&lt;br /&gt;
* A controlled migration, as we would do before and after planned maintenance on a node.&lt;br /&gt;
* Crashing a VM directly, and making sure that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; detects the crash and restarts the VM.&lt;br /&gt;
* Crashing a VM enough times and within enough time to trigger a relocation to the second node.&lt;br /&gt;
* Crashing the host node and checking that lost VMs restart on the surviving node.&lt;br /&gt;
&lt;br /&gt;
=== Controlled Live Migration Using clusvcadm ===&lt;br /&gt;
&lt;br /&gt;
There will be times when you will want to migrate a VM off of a node. The classic example would be to upgrade the hardware, install a new kernel or repair a RAID array. When you know that ahead of time that a node will go down, you can easily migrate the VM services off of it to another node in the cluster.&lt;br /&gt;
&lt;br /&gt;
Let&#039;s look at migrating the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0001_ws1&amp;lt;/span&amp;gt; VM from &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt; to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt;. First, confirm that it is on the source node.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
clustat&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Cluster Status for an-cluster01 @ Sun May 15 17:05:49 2011&lt;br /&gt;
Member Status: Quorate&lt;br /&gt;
&lt;br /&gt;
 Member Name                             ID   Status&lt;br /&gt;
 ------ ----                             ---- ------&lt;br /&gt;
 an-node04.alteeve.com                       1 Online, Local, rgmanager&lt;br /&gt;
 an-node05.alteeve.com                       2 Online, rgmanager&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State         &lt;br /&gt;
 ------- ----                   ----- ------                   -----         &lt;br /&gt;
 service:an4_storage            an-node04.alteeve.com          started       &lt;br /&gt;
 service:an5_storage            an-node05.alteeve.com          started       &lt;br /&gt;
 vm:vm0001_ws1                  an-node04.alteeve.com          started       &lt;br /&gt;
 vm:vm0002_win1                 an-node05.alteeve.com          started       &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now perform the actual migration. Note that we will be using the special &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;-M&amp;lt;/span&amp;gt; (live migrate) switch, rather than the usual &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;-r&amp;lt;/span&amp;gt; (relocate) switch.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
clusvcadm -M vm:vm0001_ws1 -m an-node05.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;
Trying to migrate vm:vm0001_ws1 to an-node05.alteeve.com...Success&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you then run &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clustat&amp;lt;/span&amp;gt; again, you will see the VM now running on the target node.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
clustat&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Cluster Status for an-cluster01 @ Sun May 15 17:21:31 2011&lt;br /&gt;
Member Status: Quorate&lt;br /&gt;
&lt;br /&gt;
 Member Name                             ID   Status&lt;br /&gt;
 ------ ----                             ---- ------&lt;br /&gt;
 an-node04.alteeve.com                       1 Online, Local, rgmanager&lt;br /&gt;
 an-node05.alteeve.com                       2 Online, rgmanager&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State         &lt;br /&gt;
 ------- ----                   ----- ------                   -----         &lt;br /&gt;
 service:an4_storage            an-node04.alteeve.com          started       &lt;br /&gt;
 service:an5_storage            an-node05.alteeve.com          started       &lt;br /&gt;
 vm:vm0001_ws1                  an-node05.alteeve.com          started       &lt;br /&gt;
 vm:vm0002_win1                 an-node05.alteeve.com          started       &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Image:Live_migrating_a_vm_using_clusvcadm_01.png|center|thumb|700px|Live migrating &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0001_ws1&amp;lt;/span&amp;gt; from &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt; to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt;.]]&lt;br /&gt;
&lt;br /&gt;
That was easy!&lt;br /&gt;
&lt;br /&gt;
=== Crashing the VM Itself ===&lt;br /&gt;
&lt;br /&gt;
There are many ways to crash a VM, and you can and should try crashing it all the ways that you can think of. In [[Linux]] machines, we can trigger a crash by &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;echo&amp;lt;/span&amp;gt;&#039;ing &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;c&amp;lt;/span&amp;gt; to the special &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/proc/sysrq-trigger&amp;lt;/span&amp;gt; file. This will instantly crash the server and you will not see the command return. &lt;br /&gt;
&lt;br /&gt;
Let&#039;s do this to the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0001_ws1&amp;lt;/span&amp;gt; VM. Connect to the virtual machine, either directly to it&#039;s console by running &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xm console vm0001_ws1&amp;lt;/span&amp;gt; from the host, or by &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ssh&amp;lt;/span&amp;gt;&#039;ing into the machine. Once logged in, run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
echo c &amp;gt; /proc/sysrq-trigger&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Within moments, you will see the xen &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vifX.Y&amp;lt;/span&amp;gt; interfaces disable and then a new &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vifZ.Y&amp;lt;/span&amp;gt; get created as the VM is restarted. If you are fast enough, you may see &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clustat&amp;lt;/span&amp;gt; report the VM as disabled, though it starts up very quickly so it may be hard to catch.&lt;br /&gt;
&lt;br /&gt;
[[Image:Watching_a_vm_restart_via_rgmanager_01.png|thumb|700px|center|Killing a VM internally and watching it restart.]]&lt;br /&gt;
&lt;br /&gt;
=== Crashing the VM Enough Times to Trigger a Relocation ===&lt;br /&gt;
&lt;br /&gt;
{{note|1=This doesn&#039;t seem to be working at the moment. Filed a Red Hat [https://bugzilla.redhat.com/show_bug.cgi?id=698369 bugzilla] ticket.}}&lt;br /&gt;
&lt;br /&gt;
VM always restarts on the node it was last running on.&lt;br /&gt;
&lt;br /&gt;
=== Crashing the Host Node ===&lt;br /&gt;
&lt;br /&gt;
{{Note|1=Once you crash the host node, both DRBD and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt; will trigger fence calls nearly simultaneously. Some fence devices do not handle this well and will either fail, or report a failed fence to the cluster. If this is the case with your fence device, you can use the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[RHCS_v2_cluster.conf#post_fail_delay|post_fail_delay]]&amp;lt;/span&amp;gt; option in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cluster.conf&amp;lt;/span&amp;gt;.}}&lt;br /&gt;
&lt;br /&gt;
As we did when we crashed the virtual machine, we will crash the operating system on the node currently running one of the VMs. In the case, we have &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0001_ws1&amp;lt;/span&amp;gt; running on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0002_win1&amp;lt;/span&amp;gt; running on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&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;
clustat&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Cluster Status for an-cluster01 @ Sun May 15 19:41:21 2011&lt;br /&gt;
Member Status: Quorate&lt;br /&gt;
&lt;br /&gt;
 Member Name                             ID   Status&lt;br /&gt;
 ------ ----                             ---- ------&lt;br /&gt;
 an-node04.alteeve.com                       1 Online, Local, rgmanager&lt;br /&gt;
 an-node05.alteeve.com                       2 Online, rgmanager&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State         &lt;br /&gt;
 ------- ----                   ----- ------                   -----         &lt;br /&gt;
 service:an4_storage            an-node04.alteeve.com          started       &lt;br /&gt;
 service:an5_storage            an-node05.alteeve.com          started       &lt;br /&gt;
 vm:vm0001_ws1                  an-node04.alteeve.com          started       &lt;br /&gt;
 vm:vm0002_win1                 an-node05.alteeve.com          started       &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once we crash &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt;, watch the log file in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt;. You will see DRBD lose contact with the other side, the crashed &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt; machine get fenced, the cluster will reform and finally the resource manager will restart the lost virtual machine. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt;&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
echo c &amp;gt; /proc/sysrq-trigger&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Watching &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt;, we will see the following in [[syslog]]:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
May 15 19:45:52 an-node05 kernel: block drbd3: PingAck did not arrive in time.&lt;br /&gt;
May 15 19:45:52 an-node05 kernel: block drbd3: peer( Primary -&amp;gt; Unknown ) conn( Connected -&amp;gt; NetworkFailure ) pdsk( UpToDate -&amp;gt; DUnknown ) &lt;br /&gt;
May 15 19:45:52 an-node05 kernel: block drbd3: asender terminated&lt;br /&gt;
May 15 19:45:52 an-node05 kernel: block drbd3: Terminating asender thread&lt;br /&gt;
May 15 19:45:52 an-node05 kernel: block drbd3: short read expecting header on sock: r=-512&lt;br /&gt;
May 15 19:45:52 an-node05 kernel: block drbd3: Creating new current UUID&lt;br /&gt;
May 15 19:45:52 an-node05 kernel: block drbd3: Connection closed&lt;br /&gt;
May 15 19:45:52 an-node05 kernel: block drbd3: conn( NetworkFailure -&amp;gt; Unconnected ) &lt;br /&gt;
May 15 19:45:52 an-node05 kernel: block drbd3: receiver terminated&lt;br /&gt;
May 15 19:45:52 an-node05 kernel: block drbd3: Restarting receiver thread&lt;br /&gt;
May 15 19:45:52 an-node05 kernel: block drbd3: receiver (re)started&lt;br /&gt;
May 15 19:45:52 an-node05 kernel: block drbd3: conn( Unconnected -&amp;gt; WFConnection ) &lt;br /&gt;
May 15 19:45:57 an-node05 kernel: block drbd2: PingAck did not arrive in time.&lt;br /&gt;
May 15 19:45:57 an-node05 kernel: block drbd2: peer( Primary -&amp;gt; Unknown ) conn( Connected -&amp;gt; NetworkFailure ) pdsk( UpToDate -&amp;gt; DUnknown ) &lt;br /&gt;
May 15 19:45:57 an-node05 kernel: block drbd2: asender terminated&lt;br /&gt;
May 15 19:45:57 an-node05 kernel: block drbd2: Terminating asender thread&lt;br /&gt;
May 15 19:45:57 an-node05 kernel: block drbd2: short read expecting header on sock: r=-512&lt;br /&gt;
May 15 19:45:57 an-node05 kernel: block drbd2: Creating new current UUID&lt;br /&gt;
May 15 19:45:57 an-node05 kernel: block drbd2: Connection closed&lt;br /&gt;
May 15 19:45:57 an-node05 kernel: block drbd2: conn( NetworkFailure -&amp;gt; Unconnected ) &lt;br /&gt;
May 15 19:45:57 an-node05 kernel: block drbd2: receiver terminated&lt;br /&gt;
May 15 19:45:57 an-node05 kernel: block drbd2: Restarting receiver thread&lt;br /&gt;
May 15 19:45:57 an-node05 kernel: block drbd2: receiver (re)started&lt;br /&gt;
May 15 19:45:57 an-node05 kernel: block drbd2: conn( Unconnected -&amp;gt; WFConnection ) &lt;br /&gt;
May 15 19:46:00 an-node05 kernel: block drbd0: PingAck did not arrive in time.&lt;br /&gt;
May 15 19:46:00 an-node05 kernel: block drbd0: peer( Primary -&amp;gt; Unknown ) conn( Connected -&amp;gt; NetworkFailure ) pdsk( UpToDate -&amp;gt; DUnknown ) &lt;br /&gt;
May 15 19:46:00 an-node05 kernel: block drbd0: asender terminated&lt;br /&gt;
May 15 19:46:00 an-node05 kernel: block drbd0: Terminating asender thread&lt;br /&gt;
May 15 19:46:00 an-node05 kernel: block drbd0: short read expecting header on sock: r=-512&lt;br /&gt;
May 15 19:46:00 an-node05 kernel: block drbd0: Creating new current UUID&lt;br /&gt;
May 15 19:46:00 an-node05 kernel: block drbd0: Connection closed&lt;br /&gt;
May 15 19:46:00 an-node05 kernel: block drbd0: conn( NetworkFailure -&amp;gt; Unconnected ) &lt;br /&gt;
May 15 19:46:00 an-node05 kernel: block drbd0: receiver terminated&lt;br /&gt;
May 15 19:46:00 an-node05 kernel: block drbd0: Restarting receiver thread&lt;br /&gt;
May 15 19:46:00 an-node05 kernel: block drbd0: receiver (re)started&lt;br /&gt;
May 15 19:46:00 an-node05 kernel: block drbd0: conn( Unconnected -&amp;gt; WFConnection ) &lt;br /&gt;
May 15 19:46:01 an-node05 openais[4704]: [TOTEM] The token was lost in the OPERATIONAL state. &lt;br /&gt;
May 15 19:46:01 an-node05 openais[4704]: [TOTEM] Receive multicast socket recv buffer size (320000 bytes). &lt;br /&gt;
May 15 19:46:01 an-node05 openais[4704]: [TOTEM] Transmit multicast socket send buffer size (262142 bytes). &lt;br /&gt;
May 15 19:46:01 an-node05 openais[4704]: [TOTEM] entering GATHER state from 2. &lt;br /&gt;
May 15 19:46:01 an-node05 kernel: block drbd1: PingAck did not arrive in time.&lt;br /&gt;
May 15 19:46:01 an-node05 kernel: block drbd1: peer( Primary -&amp;gt; Unknown ) conn( Connected -&amp;gt; NetworkFailure ) pdsk( UpToDate -&amp;gt; DUnknown ) &lt;br /&gt;
May 15 19:46:01 an-node05 kernel: block drbd1: asender terminated&lt;br /&gt;
May 15 19:46:01 an-node05 kernel: block drbd1: Terminating asender thread&lt;br /&gt;
May 15 19:46:01 an-node05 kernel: block drbd1: short read expecting header on sock: r=-512&lt;br /&gt;
May 15 19:46:01 an-node05 kernel: block drbd1: Creating new current UUID&lt;br /&gt;
May 15 19:46:01 an-node05 kernel: block drbd1: Connection closed&lt;br /&gt;
May 15 19:46:01 an-node05 kernel: block drbd1: conn( NetworkFailure -&amp;gt; Unconnected ) &lt;br /&gt;
May 15 19:46:01 an-node05 kernel: block drbd1: receiver terminated&lt;br /&gt;
May 15 19:46:01 an-node05 kernel: block drbd1: Restarting receiver thread&lt;br /&gt;
May 15 19:46:01 an-node05 kernel: block drbd1: receiver (re)started&lt;br /&gt;
May 15 19:46:01 an-node05 kernel: block drbd1: conn( Unconnected -&amp;gt; WFConnection ) &lt;br /&gt;
May 15 19:46:03 an-node05 openais[4704]: [TOTEM] entering GATHER state from 0. &lt;br /&gt;
May 15 19:46:03 an-node05 openais[4704]: [TOTEM] Creating commit token because I am the rep. &lt;br /&gt;
May 15 19:46:03 an-node05 openais[4704]: [TOTEM] Storing new sequence id for ring 140 &lt;br /&gt;
May 15 19:46:03 an-node05 openais[4704]: [TOTEM] entering COMMIT state. &lt;br /&gt;
May 15 19:46:03 an-node05 openais[4704]: [TOTEM] entering RECOVERY state. &lt;br /&gt;
May 15 19:46:03 an-node05 openais[4704]: [TOTEM] position [0] member 192.168.3.75: &lt;br /&gt;
May 15 19:46:03 an-node05 openais[4704]: [TOTEM] previous ring seq 316 rep 192.168.3.74 &lt;br /&gt;
May 15 19:46:03 an-node05 openais[4704]: [TOTEM] aru 7b high delivered 7b received flag 1 &lt;br /&gt;
May 15 19:46:03 an-node05 openais[4704]: [TOTEM] Did not need to originate any messages in recovery. &lt;br /&gt;
May 15 19:46:03 an-node05 openais[4704]: [TOTEM] Sending initial ORF token &lt;br /&gt;
May 15 19:46:03 an-node05 openais[4704]: [CLM  ] CLM CONFIGURATION CHANGE &lt;br /&gt;
May 15 19:46:03 an-node05 openais[4704]: [CLM  ] New Configuration: &lt;br /&gt;
May 15 19:46:03 an-node05 openais[4704]: [CLM  ] 	r(0) ip(192.168.3.75)  &lt;br /&gt;
May 15 19:46:03 an-node05 kernel: dlm: closing connection to node 1&lt;br /&gt;
May 15 19:46:03 an-node05 fenced[4724]: an-node04.alteeve.com not a cluster member after 0 sec post_fail_delay&lt;br /&gt;
May 15 19:46:03 an-node05 openais[4704]: [CLM  ] Members Left: &lt;br /&gt;
May 15 19:46:03 an-node05 fenced[4724]: fencing node &amp;quot;an-node04.alteeve.com&amp;quot;&lt;br /&gt;
May 15 19:46:03 an-node05 openais[4704]: [CLM  ] 	r(0) ip(192.168.3.74)  &lt;br /&gt;
May 15 19:46:03 an-node05 openais[4704]: [CLM  ] Members Joined: &lt;br /&gt;
May 15 19:46:03 an-node05 openais[4704]: [CLM  ] CLM CONFIGURATION CHANGE &lt;br /&gt;
May 15 19:46:03 an-node05 openais[4704]: [CLM  ] New Configuration: &lt;br /&gt;
May 15 19:46:03 an-node05 openais[4704]: [CLM  ] 	r(0) ip(192.168.3.75)  &lt;br /&gt;
May 15 19:46:03 an-node05 openais[4704]: [CLM  ] Members Left: &lt;br /&gt;
May 15 19:46:03 an-node05 openais[4704]: [CLM  ] Members Joined: &lt;br /&gt;
May 15 19:46:03 an-node05 openais[4704]: [SYNC ] This node is within the primary component and will provide service. &lt;br /&gt;
May 15 19:46:03 an-node05 openais[4704]: [TOTEM] entering OPERATIONAL state. &lt;br /&gt;
May 15 19:46:03 an-node05 openais[4704]: [CLM  ] got nodejoin message 192.168.3.75 &lt;br /&gt;
May 15 19:46:03 an-node05 openais[4704]: [CPG  ] got joinlist message from node 2 &lt;br /&gt;
May 15 19:46:16 an-node05 fenced[4724]: fence &amp;quot;an-node04.alteeve.com&amp;quot; success&lt;br /&gt;
May 15 19:46:16 an-node05 kernel: GFS2: fsid=an-cluster01:xen_shared.0: jid=1: Trying to acquire journal lock...&lt;br /&gt;
May 15 19:46:16 an-node05 kernel: GFS2: fsid=an-cluster01:xen_shared.0: jid=1: Looking at journal...&lt;br /&gt;
May 15 19:46:16 an-node05 kernel: GFS2: fsid=an-cluster01:xen_shared.0: jid=1: Acquiring the transaction lock...&lt;br /&gt;
May 15 19:46:16 an-node05 kernel: GFS2: fsid=an-cluster01:xen_shared.0: jid=1: Replaying journal...&lt;br /&gt;
May 15 19:46:16 an-node05 kernel: GFS2: fsid=an-cluster01:xen_shared.0: jid=1: Replayed 1 of 1 blocks&lt;br /&gt;
May 15 19:46:16 an-node05 kernel: GFS2: fsid=an-cluster01:xen_shared.0: jid=1: Found 0 revoke tags&lt;br /&gt;
May 15 19:46:16 an-node05 kernel: GFS2: fsid=an-cluster01:xen_shared.0: jid=1: Journal replayed in 1s&lt;br /&gt;
May 15 19:46:16 an-node05 kernel: GFS2: fsid=an-cluster01:xen_shared.0: jid=1: Done&lt;br /&gt;
May 15 19:46:16 an-node05 clurgmgrd[4302]: &amp;lt;notice&amp;gt; Marking service:an4_storage as stopped: Restricted domain unavailable &lt;br /&gt;
May 15 19:46:16 an-node05 clurgmgrd[4302]: &amp;lt;notice&amp;gt; Taking over service vm:vm0001_ws1 from down member an-node04.alteeve.com &lt;br /&gt;
May 15 19:46:18 an-node05 kernel: device vif5.0 entered promiscuous mode&lt;br /&gt;
May 15 19:46:18 an-node05 kernel: ADDRCONF(NETDEV_UP): vif5.0: link is not ready&lt;br /&gt;
May 15 19:46:18 an-node05 clurgmgrd[4302]: &amp;lt;notice&amp;gt; Service vm:vm0001_ws1 started &lt;br /&gt;
May 15 19:46:22 an-node05 kernel: blkback: ring-ref 8, event-channel 8, protocol 1 (x86_64-abi)&lt;br /&gt;
May 15 19:46:33 an-node05 kernel: ADDRCONF(NETDEV_CHANGE): vif5.0: link becomes ready&lt;br /&gt;
May 15 19:46:33 an-node05 kernel: xenbr0: port 4(vif5.0) entering learning state&lt;br /&gt;
May 15 19:46:48 an-node05 kernel: xenbr0: topology change detected, propagating&lt;br /&gt;
May 15 19:46:48 an-node05 kernel: xenbr0: port 4(vif5.0) entering forwarding state&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{note|1=Do to a bug in [[Node Assassin]], DRBD was not configured to fence the remote node on failure, so the only fence call came from &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt;.}}&lt;br /&gt;
&lt;br /&gt;
[[Image:Crashed_an-node04_vm_recovery_01.png|thumb|center|900px|VM recovery beginning on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt; after crashing &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt;.]]&lt;br /&gt;
&lt;br /&gt;
Above we can see that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04.alteeve.com&amp;lt;/span&amp;gt; is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Offline&amp;lt;/span&amp;gt; and the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm:vm0001_ws1&amp;lt;/span&amp;gt; service is automatically &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;starting&amp;lt;/span&amp;gt; on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
Success!&lt;br /&gt;
&lt;br /&gt;
Once you&#039;ve rejoined &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt; to the cluster, simply live-migrate &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0001_ws1&amp;lt;/span&amp;gt; back to it.&lt;br /&gt;
&lt;br /&gt;
=== Further Testing ===&lt;br /&gt;
&lt;br /&gt;
This tutorial could quickly overflow with failure testing scenarios. It is somewhat outside the scope of this tutorial, so we will stop here.&lt;br /&gt;
&lt;br /&gt;
As a rule of thumb, you should expect to spend &#039;&#039;at least&#039;&#039; as much time breaking and repairing your cluster as you did building it in the first place.&lt;br /&gt;
&lt;br /&gt;
A small list of things to test:&lt;br /&gt;
* Pulling each network cable, one at a time, and see how things fail and what is needed to restore the cluster.&lt;br /&gt;
* Kill the power on switch(es). See how things fail when all network connections are lost.&lt;br /&gt;
* Pull hard drives from the server (or &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;dd if=/dev/zero of=/dev/xx count=10000&amp;lt;/span&amp;gt; drives) to fail out the arrays.&lt;br /&gt;
* Reformat a node, then rebuild it from scratch and join it back with the surviving node.&lt;br /&gt;
* And so forth. Be destructively creative!&lt;br /&gt;
&lt;br /&gt;
= Testing Done - Going Into Production =&lt;br /&gt;
&lt;br /&gt;
Once you finish testing, the last thing to do is to change the storage resources to automatically start with the cluster. To do this, simply change &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;autostart=&amp;quot;0&amp;quot;&amp;lt;/span&amp;gt; to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;autostart=&amp;quot;1&amp;quot;&amp;lt;/span&amp;gt; for the two storage resources.&lt;br /&gt;
&lt;br /&gt;
{{note|1=Do &#039;&#039;not&#039;&#039; set &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;autostart=&amp;quot;1&amp;quot;&amp;lt;/span&amp;gt; for the virtual machine resources. As mentioned before, the storage does not come up fast enough and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; will give up trying to start the VMs. You will need to manually start the VM resources when you cold boot the cluster.}}&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;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;rm&amp;gt;&lt;br /&gt;
                ...&lt;br /&gt;
                &amp;lt;service autostart=&amp;quot;1&amp;quot; domain=&amp;quot;an4_only&amp;quot; exclusive=&amp;quot;0&amp;quot; max_restarts=&amp;quot;0&amp;quot; name=&amp;quot;an4_storage&amp;quot; recovery=&amp;quot;restart&amp;quot; restart_expire_time=&amp;quot;0&amp;quot;&amp;gt;&lt;br /&gt;
                        &amp;lt;script ref=&amp;quot;drbd&amp;quot;&amp;gt;&lt;br /&gt;
                                &amp;lt;script ref=&amp;quot;clvmd&amp;quot;&amp;gt;&lt;br /&gt;
                                        &amp;lt;script ref=&amp;quot;gfs2&amp;quot;/&amp;gt;&lt;br /&gt;
                                &amp;lt;/script&amp;gt;&lt;br /&gt;
                        &amp;lt;/script&amp;gt;&lt;br /&gt;
                &amp;lt;/service&amp;gt;&lt;br /&gt;
                &amp;lt;service autostart=&amp;quot;1&amp;quot; domain=&amp;quot;an5_only&amp;quot; exclusive=&amp;quot;0&amp;quot; max_restarts=&amp;quot;0&amp;quot; name=&amp;quot;an5_storage&amp;quot; recovery=&amp;quot;restart&amp;quot; restart_expire_time=&amp;quot;0&amp;quot;&amp;gt;&lt;br /&gt;
                        &amp;lt;script ref=&amp;quot;drbd&amp;quot;&amp;gt;&lt;br /&gt;
                                &amp;lt;script ref=&amp;quot;clvmd&amp;quot;&amp;gt;&lt;br /&gt;
                                        &amp;lt;script ref=&amp;quot;gfs2&amp;quot;/&amp;gt;&lt;br /&gt;
                                &amp;lt;/script&amp;gt;&lt;br /&gt;
                        &amp;lt;/script&amp;gt;&lt;br /&gt;
                &amp;lt;/service&amp;gt;&lt;br /&gt;
        &amp;lt;/rm&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Validate and push out the new configuration.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
xmllint --relaxng /usr/share/system-config-cluster/misc/cluster.ng /etc/cluster/cluster.conf&lt;br /&gt;
&amp;lt;/source&amp;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-cluster01&amp;quot; config_version=&amp;quot;16&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;cman expected_votes=&amp;quot;1&amp;quot; two_node=&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-node04.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;fence_na01&amp;quot; port=&amp;quot;04&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-node05.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;fence_na01&amp;quot; port=&amp;quot;03&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 agent=&amp;quot;fence_na&amp;quot; ipaddr=&amp;quot;fence_na01.alteeve.com&amp;quot; login=&amp;quot;admin&amp;quot; name=&amp;quot;fence_na01&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;fence_daemon post_join_delay=&amp;quot;60&amp;quot;/&amp;gt;&lt;br /&gt;
        &amp;lt;totem rrp_mode=&amp;quot;none&amp;quot; secauth=&amp;quot;off&amp;quot;/&amp;gt;&lt;br /&gt;
        &amp;lt;rm&amp;gt;&lt;br /&gt;
                &amp;lt;resources&amp;gt;&lt;br /&gt;
                        &amp;lt;script file=&amp;quot;/etc/init.d/drbd&amp;quot; name=&amp;quot;drbd&amp;quot;/&amp;gt;&lt;br /&gt;
                        &amp;lt;script file=&amp;quot;/etc/init.d/clvmd&amp;quot; name=&amp;quot;clvmd&amp;quot;/&amp;gt;&lt;br /&gt;
                        &amp;lt;script file=&amp;quot;/etc/init.d/gfs2&amp;quot; name=&amp;quot;gfs2&amp;quot;/&amp;gt;&lt;br /&gt;
                &amp;lt;/resources&amp;gt;&lt;br /&gt;
		&amp;lt;failoverdomains&amp;gt;&lt;br /&gt;
			&amp;lt;failoverdomain name=&amp;quot;an4_only&amp;quot; nofailback=&amp;quot;0&amp;quot; ordered=&amp;quot;0&amp;quot; restricted=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
				&amp;lt;failoverdomainnode name=&amp;quot;an-node04.alteeve.com&amp;quot; priority=&amp;quot;1&amp;quot;/&amp;gt;&lt;br /&gt;
			&amp;lt;/failoverdomain&amp;gt;&lt;br /&gt;
			&amp;lt;failoverdomain name=&amp;quot;an5_only&amp;quot; nofailback=&amp;quot;0&amp;quot; ordered=&amp;quot;0&amp;quot; restricted=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
				&amp;lt;failoverdomainnode name=&amp;quot;an-node05.alteeve.com&amp;quot; priority=&amp;quot;1&amp;quot;/&amp;gt;&lt;br /&gt;
			&amp;lt;/failoverdomain&amp;gt;&lt;br /&gt;
			&amp;lt;failoverdomain name=&amp;quot;an4_primary&amp;quot; nofailback=&amp;quot;0&amp;quot; ordered=&amp;quot;1&amp;quot; restricted=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
				&amp;lt;failoverdomainnode name=&amp;quot;an-node04.alteeve.com&amp;quot; priority=&amp;quot;1&amp;quot;/&amp;gt;&lt;br /&gt;
				&amp;lt;failoverdomainnode name=&amp;quot;an-node05.alteeve.com&amp;quot; priority=&amp;quot;2&amp;quot;/&amp;gt;&lt;br /&gt;
			&amp;lt;/failoverdomain&amp;gt;&lt;br /&gt;
			&amp;lt;failoverdomain name=&amp;quot;an5_primary&amp;quot; nofailback=&amp;quot;0&amp;quot; ordered=&amp;quot;1&amp;quot; restricted=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
				&amp;lt;failoverdomainnode name=&amp;quot;an-node04.alteeve.com&amp;quot; priority=&amp;quot;2&amp;quot;/&amp;gt;&lt;br /&gt;
				&amp;lt;failoverdomainnode name=&amp;quot;an-node05.alteeve.com&amp;quot; priority=&amp;quot;1&amp;quot;/&amp;gt;&lt;br /&gt;
			&amp;lt;/failoverdomain&amp;gt;&lt;br /&gt;
		&amp;lt;/failoverdomains&amp;gt;&lt;br /&gt;
		&amp;lt;service autostart=&amp;quot;1&amp;quot; domain=&amp;quot;an4_only&amp;quot; exclusive=&amp;quot;0&amp;quot; max_restarts=&amp;quot;0&amp;quot; name=&amp;quot;an4_storage&amp;quot; recovery=&amp;quot;restart&amp;quot; restart_expire_time=&amp;quot;0&amp;quot;&amp;gt;&lt;br /&gt;
			&amp;lt;script ref=&amp;quot;drbd&amp;quot;&amp;gt;&lt;br /&gt;
				&amp;lt;script ref=&amp;quot;clvmd&amp;quot;&amp;gt;&lt;br /&gt;
					&amp;lt;script ref=&amp;quot;gfs2&amp;quot;/&amp;gt;&lt;br /&gt;
				&amp;lt;/script&amp;gt;&lt;br /&gt;
			&amp;lt;/script&amp;gt;&lt;br /&gt;
		&amp;lt;/service&amp;gt;&lt;br /&gt;
		&amp;lt;service autostart=&amp;quot;1&amp;quot; domain=&amp;quot;an5_only&amp;quot; exclusive=&amp;quot;0&amp;quot; max_restarts=&amp;quot;0&amp;quot; name=&amp;quot;an5_storage&amp;quot; recovery=&amp;quot;restart&amp;quot; restart_expire_time=&amp;quot;0&amp;quot;&amp;gt;&lt;br /&gt;
			&amp;lt;script ref=&amp;quot;drbd&amp;quot;&amp;gt;&lt;br /&gt;
				&amp;lt;script ref=&amp;quot;clvmd&amp;quot;&amp;gt;&lt;br /&gt;
					&amp;lt;script ref=&amp;quot;gfs2&amp;quot;/&amp;gt;&lt;br /&gt;
				&amp;lt;/script&amp;gt;&lt;br /&gt;
			&amp;lt;/script&amp;gt;&lt;br /&gt;
		&amp;lt;/service&amp;gt;&lt;br /&gt;
                &amp;lt;vm name=&amp;quot;vm0001_ws1&amp;quot; domain=&amp;quot;an4_primary&amp;quot; path=&amp;quot;/xen_shared/definitions/&amp;quot; autostart=&amp;quot;0&amp;quot; exclusive=&amp;quot;0&amp;quot; recovery=&amp;quot;restart&amp;quot; max_restarts=&amp;quot;2&amp;quot; restart_expire_time=&amp;quot;600&amp;quot;/&amp;gt;&lt;br /&gt;
                &amp;lt;vm name=&amp;quot;vm0002_win1&amp;quot; domain=&amp;quot;an5_primary&amp;quot; path=&amp;quot;/xen_shared/definitions/&amp;quot; autostart=&amp;quot;0&amp;quot; exclusive=&amp;quot;0&amp;quot; recovery=&amp;quot;restart&amp;quot; max_restarts=&amp;quot;2&amp;quot; restart_expire_time=&amp;quot;600&amp;quot;/&amp;gt;&lt;br /&gt;
        &amp;lt;/rm&amp;gt;&lt;br /&gt;
&amp;lt;/cluster&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;
/etc/cluster/cluster.conf validates&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;
ccs_tool update /etc/cluster/cluster.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;
Config file updated from version 15 to 16&lt;br /&gt;
&lt;br /&gt;
Update complete.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now stop and then start again &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt;. When it starts, you will not need to enable the storage resources, they will start automatically.&lt;br /&gt;
&lt;br /&gt;
== Complete! ==&lt;br /&gt;
&lt;br /&gt;
We&#039;re done.&lt;br /&gt;
&lt;br /&gt;
I hope you&#039;ve found this tutorial useful. If you have any feedback, criticism, corrections or comments, please let me know.&lt;br /&gt;
&lt;br /&gt;
-- [[Digimer]]&lt;br /&gt;
&lt;br /&gt;
= Common Administrative Tasks =&lt;br /&gt;
&lt;br /&gt;
This is far from a comprehensive list!&lt;br /&gt;
&lt;br /&gt;
This section will attempt to cover some of the day to day tasks you may want to perform on you cluster of VMs.&lt;br /&gt;
&lt;br /&gt;
== Enabling MTU Sizes Over 1500 Bytes ==&lt;br /&gt;
&lt;br /&gt;
{{warning|1=This requires the use of a kernel compiled outside of the main repos. For this reason, do not apply this unless you have a particular need for jumbo frames and are willing to take on the additional risk of installing and running an unsupported kernel.}}&lt;br /&gt;
&lt;br /&gt;
Currently, enabling MTU sizes over 1500 bytes requires compiling a new kernel and replacing/patching two Xen scripts. I&#039;ve made a pre-compiled kernel and the patched scripts available on [https://alteeve.com/xen https://alteeve.com/xen]. [[Red Hat]] bugzilla bugs have been filed, but they missed the window for being added to [[EL5]].7. They will be merged in for [[EL5]].8, but that is some time off.&lt;br /&gt;
&lt;br /&gt;
You can track the bug progress below:&lt;br /&gt;
* [https://bugzilla.redhat.com/show_bug.cgi?id=697021 Patch needed to allow MTU &amp;gt;1500 on vif prior to connecting to bridge]&lt;br /&gt;
* [https://bugzilla.redhat.com/show_bug.cgi?id=697310 Patch for xen-3.0.3 to support patch in BZ 697021]&lt;br /&gt;
&lt;br /&gt;
Below is a pretty ugly [[bash]] chain of commands that will download, install and copy into place everything needed to make jumbo frames work.&lt;br /&gt;
&lt;br /&gt;
{{note|1=The debug and devel packages for the kernel used below can be found here: https://alteeve.com/xen/RPMS/x86_64/}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cd /etc/xen/ &amp;amp;&amp;amp; \&lt;br /&gt;
	mv qemu-ifup qemu-ifup.orig &amp;amp;&amp;amp; \&lt;br /&gt;
	wget https://alteeve.com/xen/qemu-ifup &amp;amp;&amp;amp; \&lt;br /&gt;
	cd scripts/ &amp;amp;&amp;amp; \&lt;br /&gt;
	mv xen-network-common.sh xen-network-common.sh.orig &amp;amp;&amp;amp; \&lt;br /&gt;
	wget https://alteeve.com/xen/xen-network-common.sh &amp;amp;&amp;amp; \&lt;br /&gt;
	mv xen-network-common-bonding.sh xen-network-common-bonding.sh.orig &amp;amp;&amp;amp; \&lt;br /&gt;
	wget https://alteeve.com/xen/xen-network-common-bonding.sh &amp;amp;&amp;amp; \&lt;br /&gt;
	cd ~ &amp;amp;&amp;amp; \&lt;br /&gt;
	wget https://alteeve.com/xen/RPMS/x86_64/kernel-xen-2.6.18-238.9.3.el5.x86_64.rpm &amp;amp;&amp;amp; \&lt;br /&gt;
	wget https://alteeve.com/xen/RPMS/x86_64/kernel-2.6.18-238.9.3.el5.x86_64.rpm &amp;amp;&amp;amp; \&lt;br /&gt;
	rpm -ivh ~/kernel-* &amp;amp;&amp;amp; \&lt;br /&gt;
	echo &amp;quot;exclude=kernel*&amp;quot; &amp;gt;&amp;gt; /etc/yum.conf &amp;amp;&amp;amp; \&lt;br /&gt;
	echo &amp;quot;exclude=xen*&amp;quot; &amp;gt;&amp;gt; /etc/yum.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{note|1=Choosing a jumbo frame size larger that what is supported by your network interfaces and switches will cause networking to fail when the first large packet is sent. Consult your hardware documentation before setting an MTU size and remember to use the lowest size supported by all of your equipment. Note that some manufacturers will claim jumbo frame support when the actually only support ~4000 [[bytes]].}}&lt;br /&gt;
&lt;br /&gt;
Once this is done, you will need to reboot the use the new kernel. Before you do though, edit your &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/sysconfig/network-scripts/ifcfg-eth*&amp;lt;/span&amp;gt; files and add &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;MTU=xxxx&amp;lt;/span&amp;gt;, where &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xxxx&amp;lt;/span&amp;gt; is the frame size you want.&lt;br /&gt;
&lt;br /&gt;
Once set, you can reboot.&lt;br /&gt;
&lt;br /&gt;
{{note|1=Do not set the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;MTU=&amp;lt;/span&amp;gt; in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ifcfg-xenbrX&amp;lt;/span&amp;gt; configuration files. The bridges will always use the MTU of the lowest MTU device connected to it.}}&lt;br /&gt;
&lt;br /&gt;
On my system, my &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth0&amp;lt;/span&amp;gt; device has a maximum MTU of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;7200&amp;lt;/span&amp;gt; [[bytes]]. The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth1&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth2&amp;lt;/span&amp;gt; devices both support &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;9000&amp;lt;/span&amp;gt; [[bytes]], as does my switch. So my configuration files will be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/sysconfig/network-scripts/ifcfg-eth0&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;
# Realtek Semiconductor Co., Ltd. RTL8111/8168B PCI Express Gigabit Ethernet controller&lt;br /&gt;
HWADDR=48:5B:39:3C:53:14&lt;br /&gt;
DEVICE=eth0&lt;br /&gt;
BRIDGE=xenbr0&lt;br /&gt;
BOOTPROTO=static&lt;br /&gt;
ONBOOT=yes&lt;br /&gt;
MTU=7200&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/sysconfig/network-scripts/ifcfg-eth1&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;
# Intel Corporation 82574L Gigabit Network Connection&lt;br /&gt;
HWADDR=00:1B:21:72:9B:5A&lt;br /&gt;
DEVICE=eth1&lt;br /&gt;
BOOTPROTO=static&lt;br /&gt;
ONBOOT=yes&lt;br /&gt;
MTU=9000&lt;br /&gt;
IPADDR=192.168.2.74&lt;br /&gt;
NETMASK=255.255.255.0&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/sysconfig/network-scripts/ifcfg-eth2&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;
# Intel Corporation 82574L Gigabit Network Connection&lt;br /&gt;
HWADDR=00:1B:21:72:96:EA&lt;br /&gt;
DEVICE=eth2&lt;br /&gt;
BRIDGE=xenbr2&lt;br /&gt;
BOOTPROTO=static&lt;br /&gt;
ONBOOT=yes&lt;br /&gt;
MTU=9000&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Confirm that the newly installed &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;2.6.18-238.9.3.el5xen&amp;lt;/span&amp;gt; is set to boot by default.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cat /boot/grub/grub.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;
# grub.conf generated by anaconda&lt;br /&gt;
#&lt;br /&gt;
# Note that you do not have to rerun grub after making changes to this file&lt;br /&gt;
# NOTICE:  You have a /boot partition.  This means that&lt;br /&gt;
#          all kernel and initrd paths are relative to /boot/, eg.&lt;br /&gt;
#          root (hd0,0)&lt;br /&gt;
#          kernel /vmlinuz-version ro root=/dev/sda2&lt;br /&gt;
#          initrd /initrd-version.img&lt;br /&gt;
#boot=/dev/sda&lt;br /&gt;
default=1&lt;br /&gt;
timeout=5&lt;br /&gt;
splashimage=(hd0,0)/grub/splash.xpm.gz&lt;br /&gt;
hiddenmenu&lt;br /&gt;
title CentOS (2.6.18-238.9.3.el5)&lt;br /&gt;
	root (hd0,0)&lt;br /&gt;
	kernel /vmlinuz-2.6.18-238.9.3.el5 ro root=LABEL=/ dom0_mem=1024M&lt;br /&gt;
	initrd /initrd-2.6.18-238.9.3.el5.img&lt;br /&gt;
title CentOS (2.6.18-238.9.3.el5xen)&lt;br /&gt;
	root (hd0,0)&lt;br /&gt;
	kernel /xen.gz-2.6.18-238.9.3.el5&lt;br /&gt;
	module /vmlinuz-2.6.18-238.9.3.el5xen ro root=LABEL=/ dom0_mem=1024M&lt;br /&gt;
	module /initrd-2.6.18-238.9.3.el5xen.img&lt;br /&gt;
title CentOS (2.6.18-238.9.1.el5xen)&lt;br /&gt;
	root (hd0,0)&lt;br /&gt;
	kernel /xen.gz-2.6.18-238.9.1.el5&lt;br /&gt;
	module /vmlinuz-2.6.18-238.9.1.el5xen ro root=LABEL=/ dom0_mem=1024M&lt;br /&gt;
	module /initrd-2.6.18-238.9.1.el5xen.img&lt;br /&gt;
title CentOS (2.6.18-238.9.1.el5)&lt;br /&gt;
	root (hd0,0)&lt;br /&gt;
	kernel /vmlinuz-2.6.18-238.9.1.el5 ro root=LABEL=/ dom0_mem=1024M&lt;br /&gt;
	initrd /initrd-2.6.18-238.9.1.el5.img&lt;br /&gt;
title CentOS (2.6.18-238.el5xen)&lt;br /&gt;
	root (hd0,0)&lt;br /&gt;
	kernel /xen.gz-2.6.18-238.el5 &lt;br /&gt;
	module /vmlinuz-2.6.18-238.el5xen ro root=LABEL=/ rhgb quiet&lt;br /&gt;
	module /initrd-2.6.18-238.el5xen.img&lt;br /&gt;
title CentOS-base (2.6.18-238.el5)&lt;br /&gt;
	root (hd0,0)&lt;br /&gt;
	kernel /vmlinuz-2.6.18-238.el5 ro root=LABEL=/ rhgb quiet&lt;br /&gt;
	initrd /initrd-2.6.18-238.el5.img&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now reboot. When the nodes come back up, we should see the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xenbr0&amp;lt;/span&amp;gt; with an MTU of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;7200&amp;lt;/span&amp;gt;, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth1&amp;lt;/span&amp;gt; should have an MTU of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;9000&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xenbr2&amp;lt;/span&amp;gt; should also be at &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;9000&amp;lt;/span&amp;gt;. Note that we did not need to new kernel for &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth1&amp;lt;/span&amp;gt; as it&#039;s outside of Xen.&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;
          inet6 addr: fe80::4a5b:39ff:fe3c:5314/64 Scope:Link&lt;br /&gt;
          UP BROADCAST RUNNING MULTICAST  MTU:7200  Metric:1&lt;br /&gt;
          RX packets:263 errors:0 dropped:0 overruns:0 frame:0&lt;br /&gt;
          TX packets:164 errors:0 dropped:0 overruns:0 carrier:0&lt;br /&gt;
          collisions:0 txqueuelen:1000 &lt;br /&gt;
          RX bytes:46333 (45.2 KiB)  TX bytes:27403 (26.7 KiB)&lt;br /&gt;
          Interrupt:246 Base address:0xe000 &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:9000  Metric:1&lt;br /&gt;
          RX packets:122 errors:0 dropped:0 overruns:0 frame:0&lt;br /&gt;
          TX packets:49 errors:0 dropped:0 overruns:0 carrier:0&lt;br /&gt;
          collisions:0 txqueuelen:1000 &lt;br /&gt;
          RX bytes:25004 (24.4 KiB)  TX bytes:8658 (8.4 KiB)&lt;br /&gt;
          Interrupt:17 Memory:feae0000-feb00000 &lt;br /&gt;
&lt;br /&gt;
eth2      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 MULTICAST  MTU:9000  Metric:1&lt;br /&gt;
          RX packets:172 errors:0 dropped:0 overruns:0 frame:0&lt;br /&gt;
          TX packets:97 errors:0 dropped:0 overruns:0 carrier:0&lt;br /&gt;
          collisions:0 txqueuelen:1000 &lt;br /&gt;
          RX bytes:42769 (41.7 KiB)  TX bytes:28487 (27.8 KiB)&lt;br /&gt;
          Interrupt:16 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:10 errors:0 dropped:0 overruns:0 frame:0&lt;br /&gt;
          TX packets:10 errors:0 dropped:0 overruns:0 carrier:0&lt;br /&gt;
          collisions:0 txqueuelen:0 &lt;br /&gt;
          RX bytes:696 (696.0 b)  TX bytes:696 (696.0 b)&lt;br /&gt;
&lt;br /&gt;
xenbr0    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:7200  Metric:1&lt;br /&gt;
          RX packets:254 errors:0 dropped:0 overruns:0 frame:0&lt;br /&gt;
          TX packets:167 errors:0 dropped:0 overruns:0 carrier:0&lt;br /&gt;
          collisions:0 txqueuelen:0 &lt;br /&gt;
          RX bytes:41271 (40.3 KiB)  TX bytes:26870 (26.2 KiB)&lt;br /&gt;
&lt;br /&gt;
xenbr2    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:9000  Metric:1&lt;br /&gt;
          RX packets:153 errors:0 dropped:0 overruns:0 frame:0&lt;br /&gt;
          TX packets:88 errors:0 dropped:0 overruns:0 carrier:0&lt;br /&gt;
          collisions:0 txqueuelen:0 &lt;br /&gt;
          RX bytes:38585 (37.6 KiB)  TX bytes:24586 (24.0 KiB)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To test that the new MTU sizes are working, we can use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ping&amp;lt;/span&amp;gt; from the source node and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;tcpdump&amp;lt;/span&amp;gt; on the target node. This works because &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ping&amp;lt;/span&amp;gt; can define the size of the message and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;tcpdump&amp;lt;/span&amp;gt; will show how many packets were sent and returned.&lt;br /&gt;
&lt;br /&gt;
Let&#039;s test &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xenbr0&amp;lt;/span&amp;gt;, which we&#039;ve set to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;7200&amp;lt;/span&amp;gt;. To do this test, we&#039;ll first use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;tcpdump&amp;lt;/span&amp;gt; on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt; to listen to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth0&amp;lt;/span&amp;gt; for [[ICMP]] packets.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
tcpdump -i xenbr0 icmp&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode&lt;br /&gt;
listening on xenbr0, link-type EN10MB (Ethernet), capture size 96 bytes&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt;, we&#039;re going to send a single ping with a payload of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;7172&amp;lt;/span&amp;gt; bytes. This is because the ICMP packet has an overhead of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;28&amp;lt;/span&amp;gt; bytes. This means the full ping size will be &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;7200&amp;lt;/span&amp;gt; bytes total. This should result in the ping taking only one packet to and from the destination node.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ping -c 1 -s 7172 an-node05.ifn&lt;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-node05.ifn (192.168.1.75) 7172(7200) bytes of data.&lt;br /&gt;
7180 bytes from an-node05.ifn (192.168.1.75): icmp_seq=1 ttl=64 time=1.53 ms&lt;br /&gt;
&lt;br /&gt;
--- an-node05.ifn ping statistics ---&lt;br /&gt;
1 packets transmitted, 1 received, 0% packet loss, time 0ms&lt;br /&gt;
rtt min/avg/max/mdev = 1.534/1.534/1.534/0.000 ms&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Going back to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt;, we&#039;ll see that indeed the ping took just one packet for each direction of travel.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
23:02:14.045744 IP an-node04.ifn &amp;gt; an-node05.ifn: ICMP echo request, id 3859, seq 1, length 7180&lt;br /&gt;
23:02:14.046601 IP an-node05.ifn &amp;gt; an-node04.ifn: ICMP echo reply, id 3859, seq 1, length 7180&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If we try again, with a payload size of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;7173&amp;lt;/span&amp;gt; bytes, for a total of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;7201&amp;lt;/span&amp;gt; packet size, we&#039;ll see on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt; that two packets were needed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
23:07:18.091292 IP an-node04.ifn &amp;gt; an-node05.ifn: ICMP echo request, id 21779, seq 1, length 7181&lt;br /&gt;
23:07:18.092199 IP an-node05.ifn &amp;gt; an-node04.ifn: ICMP echo reply, id 21779, seq 1, length 7176&lt;br /&gt;
23:07:18.092242 IP an-node05.ifn &amp;gt; an-node04.ifn: icmp&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Perfect!&lt;br /&gt;
&lt;br /&gt;
== Renaming a Virtual Machine ==&lt;br /&gt;
&lt;br /&gt;
There may be times when you want to rename a VM domain. For example, if you provision a machine and then realize that you gave it a name that didn&#039;t describe it properly.&lt;br /&gt;
&lt;br /&gt;
Things to keep in mind before starting;&lt;br /&gt;
&lt;br /&gt;
* The new name of the VM &#039;&#039;&#039;must&#039;&#039;&#039; match the name of the definition file as well as the name of the VM service in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cluster.conf&amp;lt;/span&amp;gt;&lt;br /&gt;
* The VM will need to be shut down for the renaming process to succeed.&lt;br /&gt;
&lt;br /&gt;
At this time, the only way to rename a VM is:&lt;br /&gt;
&lt;br /&gt;
# Use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virsh dumpxml old_name &amp;gt; /xen_shared/definitions/new_name.xml&amp;lt;/span&amp;gt;.&lt;br /&gt;
# Shut down the VM with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virsh shutdown old_name&amp;lt;/span&amp;gt;.&lt;br /&gt;
# Edit the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/xen_shared/definitions/new_name.xml&amp;lt;/span&amp;gt; [[XML]] definition file and change &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;name&amp;gt;old_name&amp;lt;/name&amp;gt;&amp;lt;/span&amp;gt; to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;name&amp;gt;new_name&amp;lt;/name&amp;gt;&amp;lt;/span&amp;gt;.&lt;br /&gt;
# Undefine the VM using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virsh undefine old_name&amp;lt;/span&amp;gt; on all nodes.&lt;br /&gt;
# Redefine the VM using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virsh define /xen_shared/definitions/new_name.xml&amp;lt;/span&amp;gt; on all nodes.&lt;br /&gt;
# Update the cluster service name.&lt;br /&gt;
## Edit &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/cluster/cluster.conf&amp;lt;/span&amp;gt; and change &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;vm name=&amp;quot;old_name&amp;quot; ... /&amp;gt;&amp;lt;/span&amp;gt; to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;vm name=&amp;quot;new_name&amp;quot; ... /&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
## Increment the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;cluster ... config_version=&amp;quot;x&amp;quot;&amp;gt;&amp;lt;/span&amp;gt; attribute.&lt;br /&gt;
## Push the new cluster configuration using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ccs_tool update /etc/cluster/cluster.conf&amp;lt;/span&amp;gt;.&lt;br /&gt;
# Confirm that the new name is seen by both &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virsh list --all&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clustat&amp;lt;/span&amp;gt;.&lt;br /&gt;
# Start the VM back up.&lt;br /&gt;
&lt;br /&gt;
== Adding Space to a VM ==&lt;br /&gt;
&lt;br /&gt;
Here we will see what it takes to add a new 50 [[GiB]] LV to a VM as a second virtual hard drive.&lt;br /&gt;
&lt;br /&gt;
This process requires a few steps.&lt;br /&gt;
* Setting the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/drbd3&amp;lt;/span&amp;gt; resource as a new [[LVM]] [[PV]].&lt;br /&gt;
* Create a new [[VG]] called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;drbd_an4_vg1&amp;lt;/span&amp;gt;.&lt;br /&gt;
* Carve out a 50 [[GB]] [[LV]] called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0001_xvdb&amp;lt;/span&amp;gt;. &lt;br /&gt;
* Attach it to the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0001_ws1&amp;lt;/span&amp;gt;.&lt;br /&gt;
* Dumping the VM&#039;s updated configuration to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/xen_shared/definitions/vm0001_ws1.xml&amp;lt;/span&amp;gt;.&lt;br /&gt;
* Redefining the VM on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt; (assuming that it is currently running on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt;).&lt;br /&gt;
* Logging into the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0001_ws1&amp;lt;/span&amp;gt; VM, formatting the new space and adding the partition 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;
{{note|1=It is assumed that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0001_ws1&amp;lt;/span&amp;gt; is currently running on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt;. Unless stated otherwise, all the following commands should, thus, be run from &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt;.&amp;lt;br /&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
=== Creating a new PV, VG and LV ===&lt;br /&gt;
&lt;br /&gt;
Create the new [[PV]]:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
pvcreate /dev/drbd3 &lt;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/drbd3&amp;quot; successfully created&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Create the new [[VG]]:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vgcreate -c y --addtag @an-cluster01 drbd_an4_vg1 /dev/drbd3&lt;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;drbd_an4_vg1&amp;quot; successfully created&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Create the new [[LV]]:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
lvcreate -L 50G --addtag @an-cluster01 -n vm0001_xvdb /dev/drbd_an4_vg1&lt;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;vm0001_xvdb&amp;quot; created&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Attaching the new LV to the VM ===&lt;br /&gt;
&lt;br /&gt;
Attach the new LV to the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0001_ws1&amp;lt;/span&amp;gt; VM. This is done using the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virsh attach-disk&amp;lt;/span&amp;gt;. We&#039;ll tell &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virsh&amp;lt;/span&amp;gt; to attach the new LV and to create it as &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/xvdb&amp;lt;/span&amp;gt; within the VM.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
virsh attach-disk vm0001_ws1 /dev/drbd_an4_vg1/vm0001_xvdb xvdb&lt;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 attached successfully&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{note|1=Log in to the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0001_ws1&amp;lt;/span&amp;gt; VM and run the following commands there. Note that, in this tutorial, the VM&#039;s hostname has been changed to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0001_ws1&amp;lt;/span&amp;gt; and has been statically assigned to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;192.168.1.253&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;
ssh root@192.168.1.253&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
root@192.168.1.253&#039;s password: &lt;br /&gt;
Last login: Sun Apr  3 18:18:13 2011 from 192.168.1.102&lt;br /&gt;
[root@vm0001_ws1 ~]# &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Confirm that the new &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/xvdb&amp;lt;/span&amp;gt; device now exists.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
fdisk -l&lt;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/xvda: 10.7 GB, 10737418240 bytes&lt;br /&gt;
255 heads, 63 sectors/track, 1305 cylinders&lt;br /&gt;
Units = cylinders of 16065 * 512 = 8225280 bytes&lt;br /&gt;
&lt;br /&gt;
    Device Boot      Start         End      Blocks   Id  System&lt;br /&gt;
/dev/xvda1   *           1          33      265041   83  Linux&lt;br /&gt;
/dev/xvda2              34         164     1052257+  82  Linux swap / Solaris&lt;br /&gt;
/dev/xvda3             165        1305     9165082+  83  Linux&lt;br /&gt;
&lt;br /&gt;
Disk /dev/xvdb: 53.6 GB, 53687091200 bytes&lt;br /&gt;
255 heads, 63 sectors/track, 6527 cylinders&lt;br /&gt;
Units = cylinders of 16065 * 512 = 8225280 bytes&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Configuring the new Virtual Hard Drive in the VM ===&lt;br /&gt;
&lt;br /&gt;
From here on in, we&#039;ll be proceeding exactly the same as if we had added a real hard drive to a bare-iron server.&lt;br /&gt;
&lt;br /&gt;
Create a single partition out of the new space.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
fdisk /dev/xvdb&lt;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 contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel&lt;br /&gt;
Building a new DOS disklabel. Changes will remain in memory only,&lt;br /&gt;
until you decide to write them. After that, of course, the previous&lt;br /&gt;
content won&#039;t be recoverable.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The number of cylinders for this disk is set to 6527.&lt;br /&gt;
There is nothing wrong with that, but this is larger than 1024,&lt;br /&gt;
and could in certain setups cause problems with:&lt;br /&gt;
1) software that runs at boot time (e.g., old versions of LILO)&lt;br /&gt;
2) booting and partitioning software from other OSs&lt;br /&gt;
   (e.g., DOS FDISK, OS/2 FDISK)&lt;br /&gt;
Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)&lt;br /&gt;
&lt;br /&gt;
Command (m for help): n&lt;br /&gt;
Command action&lt;br /&gt;
   e   extended&lt;br /&gt;
   p   primary partition (1-4)&lt;br /&gt;
p&lt;br /&gt;
Partition number (1-4): 1&lt;br /&gt;
First cylinder (1-6527, default 1): &lt;br /&gt;
Using default value 1&lt;br /&gt;
Last cylinder or +size or +sizeM or +sizeK (1-6527, default 6527): &lt;br /&gt;
Using default value 6527&lt;br /&gt;
&lt;br /&gt;
Command (m for help): p&lt;br /&gt;
&lt;br /&gt;
Disk /dev/xvdb: 53.6 GB, 53687091200 bytes&lt;br /&gt;
255 heads, 63 sectors/track, 6527 cylinders&lt;br /&gt;
Units = cylinders of 16065 * 512 = 8225280 bytes&lt;br /&gt;
&lt;br /&gt;
    Device Boot      Start         End      Blocks   Id  System&lt;br /&gt;
/dev/xvdb1               1        6527    52428096   83  Linux&lt;br /&gt;
&lt;br /&gt;
Command (m for help): w&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;
Syncing disks.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{note|1=Unlike when we worked on the nodes, we do not need to reboot the VM to see the changes on the disk. This is not because it&#039;s a virtual server, but rather because the new virtual disk is not used by the OS.}}&lt;br /&gt;
&lt;br /&gt;
Now, format the new &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/xvdb1&amp;lt;/span&amp;gt; partition.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
mkfs.ext3 /dev/xvdb1 &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
mke2fs 1.39 (29-May-2006)&lt;br /&gt;
Filesystem label=&lt;br /&gt;
OS type: Linux&lt;br /&gt;
Block size=4096 (log=2)&lt;br /&gt;
Fragment size=4096 (log=2)&lt;br /&gt;
6553600 inodes, 13107024 blocks&lt;br /&gt;
655351 blocks (5.00%) reserved for the super user&lt;br /&gt;
First data block=0&lt;br /&gt;
Maximum filesystem blocks=4294967296&lt;br /&gt;
400 block groups&lt;br /&gt;
32768 blocks per group, 32768 fragments per group&lt;br /&gt;
16384 inodes per group&lt;br /&gt;
Superblock backups stored on blocks: &lt;br /&gt;
	32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208, &lt;br /&gt;
	4096000, 7962624, 11239424&lt;br /&gt;
&lt;br /&gt;
Writing inode tables: done                            &lt;br /&gt;
Creating journal (32768 blocks): done&lt;br /&gt;
Writing superblocks and filesystem accounting information: done&lt;br /&gt;
&lt;br /&gt;
This filesystem will be automatically checked every 32 mounts or&lt;br /&gt;
180 days, whichever comes first.  Use tune2fs -c or -i to override.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/var/www&amp;lt;/span&amp;gt; does not yet exist. If it doesn&#039;t, create it.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ls -lah /var/www&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
ls: /var/www: No such file or directory&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;
mkdir /var/www&lt;br /&gt;
ls -lah /var/www&lt;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 12K&lt;br /&gt;
drwxr-xr-x  2 root root 4.0K Apr  3 23:01 .&lt;br /&gt;
drwxr-xr-x 21 root root 4.0K Apr  3 23:01 ..&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Mount the newly formatted partition.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
mount /dev/xvdb1 /var/www/&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/xvda3            8.5G  2.0G  6.1G  25% /&lt;br /&gt;
/dev/xvda1            251M   25M  214M  11% /boot&lt;br /&gt;
tmpfs                 524M     0  524M   0% /dev/shm&lt;br /&gt;
/dev/xvdb1             50G  180M   47G   1% /var/www&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Add the new partition to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/fstab&amp;lt;/span&amp;gt; so that the partition mounts on boot.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
echo &amp;quot;/dev/xvdb1              /var/www                ext3    defaults        1 3&amp;quot; &amp;gt;&amp;gt; /etc/fstab&lt;br /&gt;
cat /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;
LABEL=/                 /                       ext3    defaults        1 1&lt;br /&gt;
LABEL=/boot             /boot                   ext3    defaults        1 2&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;
LABEL=SWAP-xvda2        swap                    swap    defaults        0 0&lt;br /&gt;
/dev/xvdb1              /var/www                ext3    defaults        1 3&lt;br /&gt;
&amp;lt;/source&amp;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 please don&#039;t pay it too much mind. They&#039;ll be happy to talk to you directly. :)&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 &#039;&#039;&#039;Lon Hohberger&#039;&#039;&#039;, lon at fedoraproject.org, for the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; help. He also provided some excellent feedback on the first release (see [https://alteeve.com/index.php?title=Red_Hat_Cluster_Service_2_Tutorial&amp;amp;action=historysubmit&amp;amp;diff=3456&amp;amp;oldid=3455 here])&lt;br /&gt;
* To [http://dk.linkedin.com/in/fabbione Fabio Massimo Di Nitto] for helping me get caught up with clustering and VMs on FC13.&lt;br /&gt;
&lt;br /&gt;
{{footer}}&lt;/div&gt;</summary>
		<author><name>Kiwi</name></author>
	</entry>
	<entry>
		<id>https://alteeve.com/w/index.php?title=Red_Hat_Cluster_Service_2_Tutorial_-_Archive&amp;diff=3600</id>
		<title>Red Hat Cluster Service 2 Tutorial - Archive</title>
		<link rel="alternate" type="text/html" href="https://alteeve.com/w/index.php?title=Red_Hat_Cluster_Service_2_Tutorial_-_Archive&amp;diff=3600"/>
		<updated>2011-08-22T16:25:00Z</updated>

		<summary type="html">&lt;p&gt;Kiwi: /* Mapping Interfaces to ethX Names */ s/you/your/&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{howto_header}}&lt;br /&gt;
&lt;br /&gt;
This paper has one goal;&lt;br /&gt;
&lt;br /&gt;
* Creating a 2-node, high-availability cluster hosting [[Xen]] virtual machines using [[RHCS]] &amp;quot;stable 2&amp;quot; with [[DRBD]] and clustered [[LVM]] for synchronizing storage data.&lt;br /&gt;
&lt;br /&gt;
We&#039;ll create a dedicated firewall VM to isolate and protect the VM network, discuss provisioning and maintaining Xen VMs, explore some basics of daily administration of a VM cluster and test various failures and how to recover from them.&lt;br /&gt;
&lt;br /&gt;
Grab a coffee, a comfy chair, put on some nice music and settle in for some geekly fun.&lt;br /&gt;
&lt;br /&gt;
= The Task Ahead =&lt;br /&gt;
&lt;br /&gt;
Before we start, let&#039;s take a few minutes to discuss clustering and it&#039;s complexities.&lt;br /&gt;
&lt;br /&gt;
== Technologies We Will Use ==&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;Enterprise Linux 5&#039;&#039;; specifically we will be using [[CentOS]] v5.6.&lt;br /&gt;
* &#039;&#039;Red Hat Cluster Services&#039;&#039; &amp;quot;Stable&amp;quot; version 2. This describes the following core components:&lt;br /&gt;
** &#039;&#039;OpenAIS&#039;&#039;; Provides cluster communications using the [[totem]] protocol.&lt;br /&gt;
** &#039;&#039;Cluster Manager&#039;&#039; (&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[cman]]&amp;lt;/span&amp;gt;); Manages the starting, stopping and managing of the cluster.&lt;br /&gt;
** &#039;&#039;Resource Manager&#039;&#039; (&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[rgmanager]]&amp;lt;/span&amp;gt;); Manages cluster resources and services. Handles service recovery during failures.&lt;br /&gt;
** &#039;&#039;Cluster Logical Volume Manager&#039;&#039; (&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[clvm]]&amp;lt;/span&amp;gt;); Cluster-aware (disk) volume manager. Backs [[GFS2]] [[filesystem]]s and [[Xen]] virtual machines.&lt;br /&gt;
** &#039;&#039;Global File Systems&#039;&#039; version 2 (&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[gfs2]]&amp;lt;/span&amp;gt;); Cluster-aware, concurrently mountable file system.&lt;br /&gt;
* &#039;&#039;Distributed Redundant Block Device&#039;&#039; ([[DRBD]]); Keeps shared data synchronized across cluster nodes.&lt;br /&gt;
* &#039;&#039;Xen&#039;&#039;; [[Hypervisor]] that controls and supports virtual machines.&lt;br /&gt;
&lt;br /&gt;
== A Note on Patience ==&lt;br /&gt;
&lt;br /&gt;
There is nothing inherently hard about clustering. However, there are many components that you need to understand before you can begin. The result is that clustering has an inherently steep learning curve.&lt;br /&gt;
&lt;br /&gt;
You &#039;&#039;&#039;must&#039;&#039;&#039; have patience. Lots of it.&lt;br /&gt;
&lt;br /&gt;
Many technologies can be learned by creating a very simple base and then building on it. The classic &amp;quot;Hello, World!&amp;quot; script created when first learning a programming language is an example of this. Unfortunately, there is no real analog to this in clustering. Even the most basic cluster requires several pieces be in place and working together. If you try to rush by ignoring pieces you think are not important, you will almost certainly waste time. A good example is setting aside [[fencing]], thinking that your test cluster&#039;s data isn&#039;t important. The cluster software has no concept of &amp;quot;test&amp;quot;. It treats everything as critical all the time and &#039;&#039;will&#039;&#039; shut down if anything goes wrong.&lt;br /&gt;
&lt;br /&gt;
Take your time, work through these steps, and you will have the foundation cluster sooner than you realize. Clustering is fun &#039;&#039;&#039;because&#039;&#039;&#039; it is a challenge.&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
&lt;br /&gt;
It is assumed that you are familiar with Linux systems administration, specifically [[Red Hat]] [[EL|Enterprise Linux]] and its derivatives. You will need to have somewhat advanced networking experience as well. You should be comfortable working in a terminal (directly or over &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[ssh]]&amp;lt;/span&amp;gt;). Familiarity with [[XML]] will help, but is not terribly required as it&#039;s use here is pretty self-evident.&lt;br /&gt;
&lt;br /&gt;
If you feel a little out of depth at times, don&#039;t hesitate to set this tutorial aside. Branch over to the components you feel the need to study more, then return and continue on. Finally, and perhaps most importantly, you &#039;&#039;&#039;must&#039;&#039;&#039; have patience! If you have a manager asking you to &amp;quot;go live&amp;quot; with a cluster in a month, tell him or her that it simply won&#039;t happen. If you rush, you will skip important points and &#039;&#039;&#039;you will fail&#039;&#039;&#039;. Patience is vastly more important than any pre-existing skill. &lt;br /&gt;
&lt;br /&gt;
== Focus and Goal ==&lt;br /&gt;
&lt;br /&gt;
There is a different cluster for every problem. Generally speaking though, there are two main problems that clusters try to resolve; Performance and High Availability. Performance clusters are generally tailored to the application requiring the performance increase. There are some general tools for performance clustering, like [[Red Hat]]&#039;s [[LVS]] (Linux Virtual Server) for load-balancing common applications like the [[Apache]] web-server. &lt;br /&gt;
&lt;br /&gt;
This tutorial will focus on High Availability clustering, often shortened to simply &#039;&#039;&#039;HA&#039;&#039;&#039; and not to be confused with the [[Linux-HA]] &amp;quot;heartbeat&amp;quot; cluster suite, which we will not be using here. The cluster will provide a shared file systems and will provide for the high availability on [[Xen]]-based virtual servers. The goal will be to have the virtual servers live-migrate during planned node outages and automatically restart on a surviving node when the original host node fails.&lt;br /&gt;
&lt;br /&gt;
Below is a &#039;&#039;very&#039;&#039; brief overview;&lt;br /&gt;
&lt;br /&gt;
High Availability clusters like ours have two main parts; Cluster management and resource management.&lt;br /&gt;
&lt;br /&gt;
The cluster itself is responsible for maintaining the cluster nodes in a group. This group is part of a &amp;quot;Closed Process Group&amp;quot;, or [[CPG]]. When a node fails, the cluster manager must detect the failure, reliably eject the node from the cluster using fencing and then reform the CPG. Each time the cluster changes, or &amp;quot;re-forms&amp;quot;, the resource manager is called. The resource manager checks to see how the cluster changed, consults it&#039;s configuration and determines what to do, if anything.&lt;br /&gt;
&lt;br /&gt;
The details of all this will be discussed in detail a little later on. For now, it&#039;s sufficient to have in mind these two major roles and understand that they are somewhat independent entities.&lt;br /&gt;
&lt;br /&gt;
== Platform ==&lt;br /&gt;
&lt;br /&gt;
This tutorial was written using [[CentOS]] version 5.6, [[x86_64]]. No attempt was made to test on [[i686]] or other [[EL5]] derivatives. That said, there is no reason to believe that this tutorial will not apply to any variant. As much as possible, the language will be distro-agnostic. For reasons of memory constraints, it is advised that you use an [[x86_64]] (64-[[bit]]) platform if at all possible.&lt;br /&gt;
&lt;br /&gt;
Do note that as of [[EL5]].4 and above, significant changes were made to how [[RHCS]] handles virtual machines. It is strongly advised that you use at least version 5.4 or newer while working with this tutorial.&lt;br /&gt;
&lt;br /&gt;
== A Word On Complexity ==&lt;br /&gt;
&lt;br /&gt;
Introducing the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Fabbione Principle&amp;lt;/span&amp;gt; (aka: &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fabimer theory&amp;lt;/span&amp;gt;):&lt;br /&gt;
&lt;br /&gt;
Clustering is not inherently hard, but it is inherently complex. Consider;&lt;br /&gt;
&lt;br /&gt;
* Any given program has &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;N&amp;lt;/span&amp;gt; bugs.&lt;br /&gt;
** [[RHCS]] uses; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt;, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;openais&amp;lt;/span&amp;gt;, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;totem&amp;lt;/span&amp;gt;, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fenced&amp;lt;/span&amp;gt;, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;dlm&amp;lt;/span&amp;gt;.&lt;br /&gt;
** We will be adding &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;GFS2&amp;lt;/span&amp;gt;, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;CLVM&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Xen&amp;lt;/span&amp;gt;.&lt;br /&gt;
** Right there, we have &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;N^10&amp;lt;/span&amp;gt; possible bugs. We&#039;ll call this &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;A&amp;lt;/span&amp;gt;.&lt;br /&gt;
* A cluster has &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Y&amp;lt;/span&amp;gt; nodes.&lt;br /&gt;
** In our case, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;2&amp;lt;/span&amp;gt; nodes, each with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;3&amp;lt;/span&amp;gt; networks.&lt;br /&gt;
** The network infrastructure (Switches, routers, etc). If you use managed switches, add another layer of complexity.&lt;br /&gt;
** This gives us another &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Y^(2*3)&amp;lt;/span&amp;gt;, and then &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;^2&amp;lt;/span&amp;gt; again for managed switches. We&#039;ll call this &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;B&amp;lt;/span&amp;gt;.&lt;br /&gt;
* Let&#039;s add the human factor. Let&#039;s say that a person needs roughly 5 years of cluster experience to be considered an expert. For each year less than this, add a &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Z&amp;lt;/span&amp;gt; &amp;quot;oops&amp;quot; factor, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;(5-Z)^2&amp;lt;/span&amp;gt;. We&#039;ll call this &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;C&amp;lt;/span&amp;gt;.&lt;br /&gt;
* So, finally, add up the complexity, using this tutorial&#039;s layout, 0-years of experience and managed switches.&lt;br /&gt;
** &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;(N^10) * (Y^(2*3)^2) * ((5-0)^2) == (A * B * C)&amp;lt;/span&amp;gt; == an-unknown-but-big-number.&lt;br /&gt;
&lt;br /&gt;
This isn&#039;t meant to scare you away, but it is meant to be a sobering statement. Obviously, those numbers are somewhat artificial, but the point remains.&lt;br /&gt;
&lt;br /&gt;
Any one piece is easy to understand, thus, clustering is inherently easy. However, given the large number of variables, you must really understand all the pieces and how they work together. &#039;&#039;&#039;&#039;&#039;DO NOT&#039;&#039;&#039;&#039;&#039; think that you will have this mastered and working in a month. Certainly don&#039;t try to sell clusters as a service without a &#039;&#039;lot&#039;&#039; of internal testing.&lt;br /&gt;
&lt;br /&gt;
Clustering is kind of like chess. The rules are pretty straight forward, but the complexity can take some time to master.&lt;br /&gt;
&lt;br /&gt;
= Overview of Components =&lt;br /&gt;
&lt;br /&gt;
When looking at a cluster, there is a tendency to want to dive right into the configuration file. That is not very useful in clustering.&lt;br /&gt;
&lt;br /&gt;
* When you look at the configuration file, it is quite short.&lt;br /&gt;
&lt;br /&gt;
It isn&#039;t like most applications or technologies though. Most of us learn by taking something, like a configuration file, and tweaking it this way and that to see what happens. I tried that with clustering and learned only what it was like to bang my head against the wall.&lt;br /&gt;
&lt;br /&gt;
* Understanding the parts and how they work together is critical.&lt;br /&gt;
&lt;br /&gt;
You will find that the discussion on the components of clustering, and how those components and concepts interact, will be much longer than the initial configuration. It is true that we could talk very briefly about the actual syntax, but it would be a disservice. Please, don&#039;t rush through the next section or, worse, skip it and go right to the configuration. You will waste far more time than you will save.&lt;br /&gt;
&lt;br /&gt;
* Clustering is easy, but it has a complex web of inter-connectivity. You must grasp this network if you want to be an effective cluster administrator!&lt;br /&gt;
&lt;br /&gt;
== Component; cman ==&lt;br /&gt;
&lt;br /&gt;
This was, traditionally, the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;c&amp;lt;/span&amp;gt;luster &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;man&amp;lt;/span&amp;gt;ager. In the 3.0 series, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt; acts mainly as a [[quorum]] provider, tallying votes and deciding on a critical property of the cluster: quorum. In the 3.1 series, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt; will be removed entirely.&lt;br /&gt;
&lt;br /&gt;
== Component; openais / corosync ==&lt;br /&gt;
&lt;br /&gt;
OpenAIS is the heart of the cluster. All other computers operate though this component, and no cluster component can work without it. Further, it is shared between both Pacemaker and RHCS clusters.&lt;br /&gt;
&lt;br /&gt;
In Red Hat clusters, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;openais&amp;lt;/span&amp;gt; is configured via the central &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cluster.conf&amp;lt;/span&amp;gt; file. In Pacemaker clusters, it is configured directly in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;openais.conf&amp;lt;/span&amp;gt;. As we will be building an RHCS, we will only use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cluster.conf&amp;lt;/span&amp;gt;. That said, (almost?) all &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;openais.conf&amp;lt;/span&amp;gt; options are available in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cluster.conf&amp;lt;/span&amp;gt;. This is important to note as you will see references to both configuration files when searching the Internet.&lt;br /&gt;
&lt;br /&gt;
=== A Little History ===&lt;br /&gt;
&lt;br /&gt;
There were significant changes between [[RHCS]] version 2, which we are using, and version 3 available on [[EL6]] and recent [[Fedora]]s.&lt;br /&gt;
&lt;br /&gt;
In the RHCS version 2, there was a component called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;openais&amp;lt;/span&amp;gt; which handled &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;totem&amp;lt;/span&amp;gt;. The OpenAIS project was designed to be the heart of the cluster and was based around the [http://www.saforum.org/ Service Availability Forum]&#039;s [http://www.saforum.org/Application-Interface-Specification~217404~16627.htm Application Interface Specification]. AIS is an open [[API]] designed to provide inter-operable high availability services.&lt;br /&gt;
&lt;br /&gt;
In 2008, it was decided that the AIS specification was overkill for most clustered applications being developed in the open source community.  At that point, OpenAIS was split in to two projects: Corosync and OpenAIS. The former, Corosync, provides cluster membership, messaging, and basic APIs for use by clustered applications, while the OpenAIS project is specifically designed to act as an optional add-on to corosync for users who want AIS functionality.&lt;br /&gt;
&lt;br /&gt;
You will see a lot of references to OpenAIS while searching the web for information on clustering. Understanding it&#039;s evolution will hopefully help you avoid confusion.&lt;br /&gt;
&lt;br /&gt;
== Concept; quorum ==&lt;br /&gt;
&lt;br /&gt;
[[Quorum]] is defined as the minimum set of hosts required in order to provide service and is used to prevent split-brain situations.&lt;br /&gt;
&lt;br /&gt;
The quorum algorithm used by the RHCS cluster is called &amp;quot;simple majority quorum&amp;quot;, which means that more than half of the hosts must be online and communicating in order to provide service. While simple majority quorum a very common quorum algorithm, other quorum algorithms exist ([[grid quorum]], [[YKD Dyanamic Linear Voting]], etc.).&lt;br /&gt;
&lt;br /&gt;
The idea behind quorum is that, which ever group of machines has it, can safely start clustered services even when defined members are not accessible.&lt;br /&gt;
&lt;br /&gt;
Take this scenario;&lt;br /&gt;
&lt;br /&gt;
* You have a cluster of four nodes, each with one vote.&lt;br /&gt;
** The cluster&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;expected_votes&amp;lt;/span&amp;gt; is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;4&amp;lt;/span&amp;gt;. A clear majority, in this case, is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;3&amp;lt;/span&amp;gt; because &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;(4/2)+1&amp;lt;/span&amp;gt;, rounded down, is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;3&amp;lt;/span&amp;gt;.&lt;br /&gt;
** Now imagine that there is a failure in the network equipment and one of the nodes disconnects from the rest of the cluster.&lt;br /&gt;
** You now have two partitions; One partition contains three machines and the other partition has one.&lt;br /&gt;
** The three machines will have quorum, and the other machine will lose quorum.&lt;br /&gt;
** The partition with quorum will reconfigure and continue to provide cluster services.&lt;br /&gt;
** The partition without quorum will withdraw from the cluster and shut down all cluster services.&lt;br /&gt;
&lt;br /&gt;
When the cluster reconfigures and the partition wins quorum, it will fence the node(s) in the partition without quorum. Once the fencing hes been confirmed successful, the partition with quorum will begin accessing clustered resources, like shared filesystems, thus guaranteeing the safety of those shared resources.&lt;br /&gt;
&lt;br /&gt;
This also helps explain why an even &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;50%&amp;lt;/span&amp;gt; is not enough to have quorum, a common question for people new to clustering. Using the above scenario, imagine if the split were 2 and 2 nodes. Because either can&#039;t be sure what the other would do, neither can safely proceed. If we allowed an even 50% to have quorum, both partition might try to take over the clustered services and disaster would soon follow.&lt;br /&gt;
&lt;br /&gt;
There is one, and &#039;&#039;&#039;only&#039;&#039;&#039; one except to this rule.&lt;br /&gt;
&lt;br /&gt;
In the case of a two node cluster, as we will be building here, any failure results in a 50/50 split. If we enforced quorum in a two-node cluster, there would never be high availability because and failure would cause both nodes to withdraw. The risk with this exception is that we now place the entire safety of the cluster on [[fencing]], a concept we will cover in a second. Fencing is a second line of defense and something we are loath to rely on alone.&lt;br /&gt;
&lt;br /&gt;
Even in a two-node cluster though, proper quorum can be maintained by using a quorum disk, called a [[qdisk]]. Unfortunately, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;qdisk&amp;lt;/span&amp;gt; on a [[DRBD]] resource comes with it&#039;s own problems, so we will not be able to use it here.&lt;br /&gt;
&lt;br /&gt;
== Concept; Virtual Synchrony ==&lt;br /&gt;
&lt;br /&gt;
All cluster operations, like fencing, distributed locking and so on, have to occur in the same order across all nodes. This concept is called &amp;quot;virtual synchrony&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
This is provided by &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;openais&amp;lt;/span&amp;gt; using &amp;quot;closed process groups&amp;quot;, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[CPG]]&amp;lt;/span&amp;gt;. A closed process group is simply a private group of processes in a cluster. Within this closed group, all messages are ordered and consistent.&lt;br /&gt;
&lt;br /&gt;
Let&#039;s look at how locks are handled on clustered file systems as an example.&lt;br /&gt;
&lt;br /&gt;
* As various nodes want to work on files, they send a lock request to the cluster. When they are done, they send a lock release to the cluster.&lt;br /&gt;
** Lock and unlock messages must arrive in the same order to all nodes, regardless of the real chronological order that they were issued.&lt;br /&gt;
* Let&#039;s say one node sends out messages &amp;quot;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;a1 a2 a3 a4&amp;lt;/span&amp;gt;&amp;quot;. Meanwhile, the other node sends out &amp;quot;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;b1 b2 b3 b4&amp;lt;/span&amp;gt;&amp;quot;.&lt;br /&gt;
** All of these messages go to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;openais&amp;lt;/span&amp;gt; which gathers them up, puts them into an order and then sends them out in that order.&lt;br /&gt;
** It is totally possible that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;openais&amp;lt;/span&amp;gt; will get the messages as &amp;quot;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;a2 b1 b2 a1 b4 a3 a4 b4&amp;lt;/span&amp;gt;&amp;quot;. What order is used is not important, only that the order is consistent across all nodes.&lt;br /&gt;
** The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;openais&amp;lt;/span&amp;gt; application will then ensure that all nodes get the messages in the above order, one at a time. All nodes must confirm that they got a given message before the next message is sent to any node.&lt;br /&gt;
&lt;br /&gt;
All of this ordering, within the closed process group, is &amp;quot;virtual synchrony&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
This will tie into fencing and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;totem&amp;lt;/span&amp;gt;, as we&#039;ll see in the next sections.&lt;br /&gt;
&lt;br /&gt;
== Concept; Fencing ==&lt;br /&gt;
&lt;br /&gt;
Fencing is a &#039;&#039;&#039;absolutely critical&#039;&#039;&#039; part of clustering. Without &#039;&#039;&#039;fully&#039;&#039;&#039; working fence devices, &#039;&#039;&#039;&#039;&#039;your cluster will fail&#039;&#039;&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Was that strong enough, or should I say that again? Let&#039;s be safe:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;DO NOT BUILD A CLUSTER WITHOUT PROPER, WORKING AND TESTED FENCING&#039;&#039;&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Sorry, I promise that this will be the only time that I speak so strongly. Fencing really is critical, and explaining the need for fencing is nearly a weekly event. &lt;br /&gt;
&lt;br /&gt;
So then, let&#039;s discuss fencing.&lt;br /&gt;
&lt;br /&gt;
When a node stops responding, an internal timeout and counter start ticking away. During this time, no messages are moving through the cluster because virtual synchrony is no longer possible and the cluster is, essentially, hung. If the node responds in time, the timeout and counter reset and the cluster begins operating properly again. &lt;br /&gt;
&lt;br /&gt;
If, on the other hand, the node does not respond in time, the node will be declared dead and the process of ejecting it from the cluster begins. &lt;br /&gt;
&lt;br /&gt;
The cluster will take a &amp;quot;head count&amp;quot; to see which nodes it still has contact with and will determine then if there are enough votes from those nodes to have quorum. If you are using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[qdisk]]&amp;lt;/span&amp;gt;, it&#039;s heuristics will run and then it&#039;s votes will be added. If there is sufficient votes for quorum, the cluster will issue a &amp;quot;fence&amp;quot; against the lost node. A fence action is a call sent to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fenced&amp;lt;/span&amp;gt;, the fence daemon. &lt;br /&gt;
&lt;br /&gt;
Which physical node sends the fence call is somewhat random and irrelevant. What matters is that the call comes from the [[CPG]] which has quorum.&lt;br /&gt;
&lt;br /&gt;
The fence daemon will look at the cluster configuration and get the fence devices configured for the dead node. Then, one at a time and in the order that they appear in the configuration, the fence daemon will call those fence devices, via their fence agents, passing to the fence agent any configured arguments like username, password, port number and so on. If the first fence agent returns a failure, the next fence agent will be called. If the second fails, the third will be called, then the forth and so on. Once the last (or perhaps only) fence device fails, the fence daemon will retry again, starting back at the start of the list. It will do this indefinitely until one of the fence devices success.&lt;br /&gt;
&lt;br /&gt;
Here&#039;s the flow, in point form:&lt;br /&gt;
&lt;br /&gt;
* The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;openais&amp;lt;/span&amp;gt; program collects messages and sends them off, one at a time, to all nodes.&lt;br /&gt;
* All nodes respond, and the next message is sent. Repeat continuously during normal operation.&lt;br /&gt;
* Suddenly, one node stops responding.&lt;br /&gt;
** Communication freezes while the cluster waits for the silent node. &lt;br /&gt;
** A timeout starts (~&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;238&amp;lt;/span&amp;gt;ms by default), and each time the timeout is hit, and error counter increments.&lt;br /&gt;
** The silent node responds before the counter reaches the limit.&lt;br /&gt;
*** The counter is reset to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;0&amp;lt;/span&amp;gt;&lt;br /&gt;
*** The cluster operates normally again.&lt;br /&gt;
* Again, one node stops responding.&lt;br /&gt;
** Again, the timeout begins. As each totem packet times out, a new packet is sent and the error count increments.&lt;br /&gt;
** The error counts exceed the limit (&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;4&amp;lt;/span&amp;gt; errors is the default); Roughly one second has passed (&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;238ms * 4&amp;lt;/span&amp;gt; plus some overhead).&lt;br /&gt;
** The node is declared dead.&lt;br /&gt;
** The cluster checks which members it still has, and if that provides enough votes for quorum.&lt;br /&gt;
*** If there are too few votes for quorum, the cluster software freezes and the node(s) withdraw from the cluster.&lt;br /&gt;
*** If there are enough votes for quorum, the silent node is declared dead.&lt;br /&gt;
**** &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;openais&amp;lt;/span&amp;gt; calls &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fenced&amp;lt;/span&amp;gt;, telling it to fence the node.&lt;br /&gt;
**** Which fence device(s) to use, that is, what &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fence_agent&amp;lt;/span&amp;gt; to call and what arguments to pass, is gathered.&lt;br /&gt;
**** For each configured fence device:&lt;br /&gt;
***** The agent is called and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fenced&amp;lt;/span&amp;gt; waits for the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fence_agent&amp;lt;/span&amp;gt; to exit.&lt;br /&gt;
***** The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fence_agent&amp;lt;/span&amp;gt;&#039;s exit code is examined. If it&#039;s a success, recovery starts. If it failed, the next configured fence agent is called.&lt;br /&gt;
**** If all (or the only) configured fence fails, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fenced&amp;lt;/span&amp;gt; will start over.&lt;br /&gt;
**** &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fenced&amp;lt;/span&amp;gt; will wait and loop forever until a fence agent succeeds. During this time, &#039;&#039;&#039;the cluster is hung&#039;&#039;&#039;.&lt;br /&gt;
** Once a &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fence_agent&amp;lt;/span&amp;gt; succeeds, the cluster is reconfigured.&lt;br /&gt;
*** A new closed process group (&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cpg&amp;lt;/span&amp;gt;) is formed.&lt;br /&gt;
*** A new fence domain is formed.&lt;br /&gt;
*** Lost cluster resources are recovered as per &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt;&#039;s configuration (including file system recovery as needed).&lt;br /&gt;
*** Normal cluster operation is restored.&lt;br /&gt;
&lt;br /&gt;
This skipped a few key things, but the general flow of logic should be there.&lt;br /&gt;
&lt;br /&gt;
This is why fencing is so important. Without a properly configured and tested fence device or devices, the cluster will never successfully fence and the cluster will stay hung forever.&lt;br /&gt;
&lt;br /&gt;
== Component; totem ==&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[totem]]&amp;lt;/span&amp;gt; protocol defines message passing within the cluster and it is used by &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;openais&amp;lt;/span&amp;gt;. A token is passed around all the nodes in the cluster, and the timeout discussed in [[Red_Hat_Cluster_Service_3_Tutorial#Concept;_Fencing|fencing]] above is actually a token timeout. The counter, then, is the number of lost tokens that are allowed before a node is considered dead.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;totem&amp;lt;/span&amp;gt; protocol supports something called &#039;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rrp&amp;lt;/span&amp;gt;&#039;, &#039;&#039;&#039;R&#039;&#039;&#039;edundant &#039;&#039;&#039;R&#039;&#039;&#039;ing &#039;&#039;&#039;P&#039;&#039;&#039;rotocol. Through &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rrp&amp;lt;/span&amp;gt;, you can add a second backup ring on a separate network to take over in the event of a failure in the first ring. In RHCS, these rings are known as &amp;quot;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ring 0&amp;lt;/span&amp;gt;&amp;quot; and &amp;quot;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ring 1&amp;lt;/span&amp;gt;&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
== Component; rgmanager ==&lt;br /&gt;
&lt;br /&gt;
When the cluster membership changes, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;openais&amp;lt;/span&amp;gt; tells the cluster that it needs to recheck it&#039;s resources. This causes &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt;, the resource group manager, to run. It will examine what changed and then will start, stop, migrate or recover cluster resources as needed.&lt;br /&gt;
&lt;br /&gt;
Within &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt;, one or more &#039;&#039;resources&#039;&#039; are brought together as a &#039;&#039;service&#039;&#039;. This service is then optionally assigned to a &#039;&#039;failover domain&#039;&#039;, an subset of nodes that can have preferential ordering.&lt;br /&gt;
&lt;br /&gt;
== Component; qdisk ==&lt;br /&gt;
&lt;br /&gt;
{{note|1=&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;qdisk&amp;lt;/span&amp;gt; does not work reliably on a DRBD resource, so we will not be using it in this tutorial.}}&lt;br /&gt;
&lt;br /&gt;
A Quorum disk, known as a &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;qdisk&amp;lt;/span&amp;gt; is small partition on [[SAN]] storage used to enhance quorum. It generally carries enough votes to allow even a single node to take quorum during a cluster partition. It does this by using configured heuristics, that is custom tests, to decided which which node or partition is best suited for providing clustered services during a cluster reconfiguration. These heuristics can be simple, like testing which partition has access to a given router, or they can be as complex as the administrator wishes using custom scripts.&lt;br /&gt;
&lt;br /&gt;
Though we won&#039;t be using it here, it is well worth knowing about when you move to a cluster with [[SAN]] storage.&lt;br /&gt;
&lt;br /&gt;
== Component; DRBD ==&lt;br /&gt;
&lt;br /&gt;
[[DRBD]]; Distributed Replicating Block Device, is a technology that takes raw storage from two or more nodes and keeps their data synchronized in real time. It is sometimes described as &amp;quot;RAID 1 over Nodes&amp;quot;, and that is conceptually accurate. In this tutorial&#039;s cluster, DRBD will be used to provide that back-end storage as a cost-effective alternative to a tranditional [[SAN]] or [[iSCSI]] device.&lt;br /&gt;
&lt;br /&gt;
To help visualize DRBD&#039;s use and role, Take a look at how we will implement our [[Red Hat Cluster Service 2 Tutorial#Visualizing Storage|cluster&#039;s storage]]. Don&#039;t worry if this seems illogical at this stage. The main thing to look at are the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;drbdX&amp;lt;/span&amp;gt; devices and how they each tie back to a corresponding &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;sdaY&amp;lt;/span&amp;gt; device on either node.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
         [ an-node04 ]&lt;br /&gt;
  ______   ______    ______     __[sda4]__&lt;br /&gt;
 | sda1 | | sda2 |  | sda3 |   |  ______  |       _______    ______________    ______________________________&lt;br /&gt;
 |______| |______|  |______|   | | sda5 |-+------| drbd0 |--| drbd_sh0_vg0 |--| /dev/drbd_sh0_vg0/xen_shared |&lt;br /&gt;
     |        |         |      | |______| |   /--|_______|  |______________|  |______________________________|&lt;br /&gt;
  ___|___    _|_    ____|____  |  ______  |   |     _______    ______________    ____________________________&lt;br /&gt;
 | /boot |  | / |  | &amp;lt;swap&amp;gt;  | | | sda6 |-+---+----| drbd1 |--| drbd_an4_vg0 |--| /dev/drbd_an4_vg0/vm0001_1 |&lt;br /&gt;
 |_______|  |___|  |_________| | |______| |   | /--|_______|  |______________|  |____________________________|&lt;br /&gt;
                               |  ______  |   | |     _______    ______________    ____________________________&lt;br /&gt;
                               | | sda7 |-+---+-+----| drbd2 |--| drbd_an5_vg0 |--| /dev/drbd_an4_vg0/vm0002_1 | &lt;br /&gt;
                               | |______| |   | | /--|_______|  |______________|  |____________________________|&lt;br /&gt;
                               |  ______  |   | | |                         | |    _______________________&lt;br /&gt;
                               | | sda8 |-+---+-+-+--\                      | \---| Example LV for 2nd VM |&lt;br /&gt;
                               | |______| |   | | |  |                      |     |_______________________|&lt;br /&gt;
                               |__________|   | | |  |                      |      _______________________&lt;br /&gt;
         [ an-node05 ]                        | | |  |                      \-----| Example LV for 3rd VM |&lt;br /&gt;
  ______   ______    ______     __[sda4]__    | | |  |                            |_______________________|&lt;br /&gt;
 | sda1 | | sda2 |  | sda3 |   |  ______  |   | | |  |                   &lt;br /&gt;
 |______| |______|  |______|   | | sda5 |-+---/ | |  |   _______    __________________&lt;br /&gt;
     |        |         |      | |______| |     | |  \--| drbd3 |--| Spare PV for     |&lt;br /&gt;
  ___|___    _|_    ____|____  |  ______  |     | |  /--|_______|  | future expansion |&lt;br /&gt;
 | /boot |  | / |  | &amp;lt;swap&amp;gt;  | | | sda6 |-+-----/ |  |             |__________________|&lt;br /&gt;
 |_______|  |___|  |_________| | |______| |       |  |&lt;br /&gt;
                               |  ______  |       |  |&lt;br /&gt;
                               | | sda7 |-+-------/  |&lt;br /&gt;
                               | |______| |          |&lt;br /&gt;
                               |  ______  |          |&lt;br /&gt;
                               | | sda8 |-+----------/&lt;br /&gt;
                               | |______| |&lt;br /&gt;
                               |__________|&lt;br /&gt;
.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Component; CLVM ==&lt;br /&gt;
&lt;br /&gt;
With [[DRBD]] providing the raw storage for the cluster, we must next consider partitions. This is where Clustered [[LVM]], known as [[CLVM]], comes into play.&lt;br /&gt;
&lt;br /&gt;
CLVM is ideal in that by using [[DLM]], the distributed lock manager, it won&#039;t allow access to cluster members outside of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;openais&amp;lt;/span&amp;gt;&#039;s closed process group, which, in turn, requires quorum.&lt;br /&gt;
&lt;br /&gt;
It is ideal because it can take one or more raw devices, known as &amp;quot;physical volumes&amp;quot;, or simple as [[PV]]s, and combine their raw space into one or more &amp;quot;volume groups&amp;quot;, known as [[VG]]s. These volume groups then act just like a typical hard drive and can be &amp;quot;partitioned&amp;quot; into one or more &amp;quot;logical volumes&amp;quot;, known as [[LV]]s. These LVs are where [[Xen]]&#039;s [[domU]] virtual machines will exist and where we will create our [[GFS2]] clustered file system.&lt;br /&gt;
&lt;br /&gt;
LVM is particularly attractive because of how incredibly flexible it is. We can easily add new physical volumes later, and then grow an existing volume group to use the new space. This new space can then be given to existing logical volumes, or entirely new logical volumes can be created. This can all be done while the cluster is online offering an upgrade path with no down time.&lt;br /&gt;
&lt;br /&gt;
== Component; GFS2 ==&lt;br /&gt;
&lt;br /&gt;
With [[DRBD]] providing the clusters raw storage space, and [[CLVM|Clustered LVM]] providing the logical partitions, we can now look at the clustered file system. This is the role of the Global File System version 2, known simply as [[GFS2]].&lt;br /&gt;
&lt;br /&gt;
It works much like standard filesystem, with user-land tools like &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;mkfs.gfs2&amp;lt;/span&amp;gt;, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fsck.gfs2&amp;lt;/span&amp;gt; and so on. The major difference is that it and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clvmd&amp;lt;/span&amp;gt; use the cluster&#039;s [[DLM|distributed locking mechanism]] provided by the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;dlm_controld&amp;lt;/span&amp;gt; daemon. Once formatted, the GFS2-formatted partition can be mounted and used by any node in the cluster&#039;s [[CPG|closed process group]]. All nodes can then safely read from and write to the data on the partition simultaneously.&lt;br /&gt;
&lt;br /&gt;
== Component; DLM ==&lt;br /&gt;
&lt;br /&gt;
One of the major roles of a cluster is to provide [[DLM|distributed locking]] on clustered storage. In fact, storage software can not be clustered without using [[DLM]], as provided by the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;dlm_controld&amp;lt;/span&amp;gt; daemon and using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;openais&amp;lt;/span&amp;gt;&#039;s virtual synchrony via [[CPG]]. &lt;br /&gt;
&lt;br /&gt;
Through DLM, all nodes accessing clustered storage are guaranteed to get [[POSIX]] locks, called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;plock&amp;lt;/span&amp;gt;s, in the same order across all nodes. Both [[CLVM]] and [[GFS2]] rely on DLM, though other clustered storage, like OCFS2, use it as well.&lt;br /&gt;
&lt;br /&gt;
== Component; Xen ==&lt;br /&gt;
&lt;br /&gt;
Two of the most popular open-source virtualization platforms available in the Linux world today and [[Xen]] and [[KVM]]. The former is maintained by [http://www.citrix.com/xenserver Citrix] and the other by [http://www.redhat.com/solutions/virtualization/ Redhat]. It would be difficult to say which is &amp;quot;better&amp;quot;, as they&#039;re both very good. Xen can be argued to be more mature where KVM is the &amp;quot;official&amp;quot; solution supported by Red Hat in [[EL6]].&lt;br /&gt;
&lt;br /&gt;
We will be using the Xen [[hypervisor]] and a &amp;quot;host&amp;quot; virtual server called [[dom0]]. In Xen, every machine is a virtual server, including the system you installed when you built the server. This is possible thanks to a small Xen micro-operating system that initially boots, then starts up your original installed operating system as a virtual server with special access to the underlying hardware and hypervisor management tools.&lt;br /&gt;
&lt;br /&gt;
The rest of the virtual servers in a Xen environment are collectively called &amp;quot;[[domU]]&amp;quot; virtual servers. These will be the highly-available resource that will migrate between nodes during failure events in our cluster.&lt;br /&gt;
&lt;br /&gt;
= Base Setup =&lt;br /&gt;
&lt;br /&gt;
Before we can look at the cluster, we must first build two cluster nodes and then install the operating system.&lt;br /&gt;
&lt;br /&gt;
== Hardware Requirements ==&lt;br /&gt;
&lt;br /&gt;
The bare minimum requirements are;&lt;br /&gt;
&lt;br /&gt;
* All hardware must be supported by [[EL5]]. It is strongly recommended that you check compatibility before making any purchases.&lt;br /&gt;
* A dual-core [[CPU]] with hardware virtualization support.&lt;br /&gt;
* Three network cards; At least one should be gigabit or faster.&lt;br /&gt;
* One hard drive.&lt;br /&gt;
* 2 [[GiB]] of [[RAM]]&lt;br /&gt;
* A [[fence|fence device]]. This can be an [[IPMI]]-enabled server, a [http://nodeassassin.org Node Assassin], a [http://www.apc.com/products/resource/include/techspec_index.cfm?base_sku=AP7900 switched PDU] or similar.&lt;br /&gt;
&lt;br /&gt;
This tutorial was written using the following hardware:&lt;br /&gt;
&lt;br /&gt;
* AMD Athlon [http://products.amd.com/en-us/DesktopCPUDetail.aspx?id=610 II X4 600e Processor]&lt;br /&gt;
* ASUS [http://www.asus.com/product.aspx?P_ID=LVmksAnszmVimOOp M4A785T-M/CSM]&lt;br /&gt;
* 4GB Kingston [http://www.ec.kingston.com/ecom/configurator_new/partsinfo.asp?root=&amp;amp;LinkBack=&amp;amp;ktcpartno=KVR1333D3N9K2/4G KVR1333D3N9K2/4G], 4GB (2x2GB) DDR3-1333, Non-ECC&lt;br /&gt;
* Seagate [http://www.seagate.com/ww/v/index.jsp?vgnextoid=70f4bfafecadd110VgnVCM100000f5ee0a0aRCRD ST9500420AS] 2.5&amp;quot; SATA HDD&lt;br /&gt;
* 2x Intel [http://www.intel.com/products/desktop/adapters/gigabit-ct/gigabit-ct-overview.htm Pro/1000CT EXPI9301CT] PCIe NICs&lt;br /&gt;
* [[Node Assassin v1.1.4]]&lt;br /&gt;
&lt;br /&gt;
This is not an endorsement of the above hardware. I put a heavy emphasis on minimizing power consumption and bought what was within my budget. This hardware was never meant to be put into production, but instead was chosen to serve the purpose of my own study and for creating this tutorial. What you ultimately choose to use, provided it meets the minimum requirements, is entirely up to you and your requirements.&lt;br /&gt;
&lt;br /&gt;
{{note|1=I use three physical [[NIC]]s, but you can get away with two by merging the storage and back-channel networks, which we will discuss shortly. If you are really in a pinch, you could create three aliases on on interface and isolate them using [[VLAN]]s. If you go this route, please ensure that your VLANs are configured and working before beginning this tutorial. Pay close attention to multicast traffic.}}&lt;br /&gt;
&lt;br /&gt;
== Pre-Assembly ==&lt;br /&gt;
&lt;br /&gt;
Before you assemble your nodes, take a moment to record the [[MAC]] addresses of each network interface and then note where each interface is physically installed. This will help you later when configuring the networks. I generally create a simple text file with the MAC addresses, the interface I intend to assign to it and where it physically is located.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
-=] an-node04&lt;br /&gt;
48:5B:39:3C:53:15   # eth0 - onboard interface&lt;br /&gt;
00:1B:21:72:9B:5A   # eth1 - right-most PCIe interface&lt;br /&gt;
00:1B:21:72:96:EA   # eth2 - left-most PCIe interface&lt;br /&gt;
&lt;br /&gt;
-=] an-node05&lt;br /&gt;
48:5B:39:3C:53:13   # eth0 - onboard interface&lt;br /&gt;
00:1B:21:72:99:AB   # eth1 - right-most PCIe interface&lt;br /&gt;
00:1B:21:72:96:A6   # eth2 - left-most PCIe interface&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== OS Install ==&lt;br /&gt;
&lt;br /&gt;
Later steps will include packages to install, so the initial OS install can be minimal. I like to change the default run-level to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;3&amp;lt;/span&amp;gt;, remove &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rhgb quiet&amp;lt;/span&amp;gt; from the [[grub]] menu, disable the firewall and disable [[SELinux]]. In a production cluster, you will want to use firewalling and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;selinux&amp;lt;/span&amp;gt;, but until you finish studying, leave it off to keep things simple.&lt;br /&gt;
&lt;br /&gt;
{{note|1=Before [[EL5]].4, you could not use SELinux. It is now possible to use it, and it is recommended that you do so in any production cluster.}}&lt;br /&gt;
{{note|1=Ports and protocols to open in a firewall will be discussed later in the networking section.}}&lt;br /&gt;
&lt;br /&gt;
I like to minimize and automate my installs as much as possible. To that end, I run a little [[Setting Up a PXE Server in Fedora|PXE]] server on my network and use a [[kickstart]] script to automate the install. Here is a simple one for use on a single-drive node:&lt;br /&gt;
* [[generic_el5_node.ks]]&lt;br /&gt;
&lt;br /&gt;
If you decide to manually install [[EL5]] on your nodes, please try to keep the installation as small as possible. The fewer packages installed, the fewer sources of problems and vectors for attack.&lt;br /&gt;
&lt;br /&gt;
== Post Install OS Changes ==&lt;br /&gt;
&lt;br /&gt;
This section discusses changes I recommend, but are not required. If you wish to adapt any of the steps below, please do so but be sure to keep the changes consistent through out the implementation of this tutorial.&lt;br /&gt;
&lt;br /&gt;
=== Network Planning ===&lt;br /&gt;
&lt;br /&gt;
The most important change that is recommended is to get your nodes into a consistent networking configuration. This will prove very handy when trying to keep track of your networks and where they&#039;re physically connected. This becomes exponentially more helpful as your cluster grows.&lt;br /&gt;
&lt;br /&gt;
The first step is to understand the three networks we will be creating. Once you understand their role, you will need to decide which interface on the nodes will be used for each network.&lt;br /&gt;
&lt;br /&gt;
==== Cluster Networks ====&lt;br /&gt;
&lt;br /&gt;
The three networks are;&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Network&lt;br /&gt;
!Acronym&lt;br /&gt;
!Use&lt;br /&gt;
|-&lt;br /&gt;
|Back-Channel Network&lt;br /&gt;
|&#039;&#039;&#039;BCN&#039;&#039;&#039;&lt;br /&gt;
|Private cluster communications, virtual machine migrations, fence devices&lt;br /&gt;
|-&lt;br /&gt;
|Storage Network&lt;br /&gt;
|&#039;&#039;&#039;SN&#039;&#039;&#039;&lt;br /&gt;
|Used exclusively for storage communications. Possible to use as totem&#039;s redundant ring.&lt;br /&gt;
|-&lt;br /&gt;
|Internet-Facing Network&lt;br /&gt;
|&#039;&#039;&#039;IFN&#039;&#039;&#039;&lt;br /&gt;
|Internet-polluted network. No cluster, storage or cluster device communication.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Things To Consider ====&lt;br /&gt;
&lt;br /&gt;
When planning which interfaces to connect to each network, consider the following, in order of importance:&lt;br /&gt;
&lt;br /&gt;
* If your nodes have [[IPMI]] and an interface sharing a physical [[RJ-45]] connector, this must be on the &#039;&#039;&#039;Back-Channel Network&#039;&#039;&#039;. The reasoning is that having your fence device accessible on the &#039;&#039;&#039;Internet-Facing Network&#039;&#039;&#039; poses a &#039;&#039;major&#039;&#039; security risk. Having the IPMI interface on the &#039;&#039;&#039;Storage Network&#039;&#039;&#039; can cause problems if a fence is fired and the network is saturated with storage traffic.&lt;br /&gt;
&lt;br /&gt;
* The lowest-latency network interface should be used as the &#039;&#039;&#039;Back-Channel Network&#039;&#039;&#039;. The cluster is maintained by [[multicast]] messaging between the nodes using something called the [[totem]] protocol. Any delay in the delivery of these messages can risk causing a failure and ejection of effected nodes when no actual failure existed. This will be discussed in greater detail later.&lt;br /&gt;
&lt;br /&gt;
* The network with the most raw bandwidth should be used for the &#039;&#039;&#039;Storage Network&#039;&#039;&#039;. All disk writes must be sent across the network and committed to the remote nodes before the write is declared complete. This causes the network to become the disk I/O bottle neck. Using a network with jumbo frames and high raw throughput will help minimize this bottle neck.&lt;br /&gt;
&lt;br /&gt;
* During the live migration of virtual machines, the VM&#039;s RAM is copied to the other node using the &#039;&#039;&#039;BCN&#039;&#039;&#039;. For this reason, the second fastest network should be used for back-channel communication. However, these copies can saturate the network, so care must be taken to ensure that cluster communications get higher priority. This can be done using a managed switch. If you can not ensure priority for totem multicast, then be sure to configure Xen later to use the storage network for migrations.&lt;br /&gt;
&lt;br /&gt;
* The remain, slowest interface should be used for the &#039;&#039;&#039;IFN&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
==== Planning the Networks ====&lt;br /&gt;
&lt;br /&gt;
This paper will use the following setup. Feel free to alter the interface to network mapping and the [[IP]] [[subnet]]s used to best suit your needs. For reasons completely my own, I like to start my cluster IPs final [[octal]] at &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;71&amp;lt;/span&amp;gt; for node 1 and then increment up from there. This is entirely arbitrary, so please use what ever makes sense to you. The remainder of this tutorial will follow the convention below:&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Network&lt;br /&gt;
!Interface&lt;br /&gt;
!Subnet&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;IFN&#039;&#039;&#039;&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth0&amp;lt;/span&amp;gt;&lt;br /&gt;
|&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;
|&#039;&#039;&#039;SN&#039;&#039;&#039;&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth1&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;192.168.2.0/24&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;BCN&#039;&#039;&#039;&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth2&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;192.139.3.0/24&amp;lt;/span&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
This translates to the following per-node configuration:&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!colspan=&amp;quot;2&amp;quot;|&lt;br /&gt;
!colspan=&amp;quot;2&amp;quot;|an-node04&lt;br /&gt;
!colspan=&amp;quot;2&amp;quot;|an-node05&lt;br /&gt;
|-&lt;br /&gt;
!&lt;br /&gt;
!Interface&lt;br /&gt;
!IP Address&lt;br /&gt;
!Host Name(s)&lt;br /&gt;
!IP Address&lt;br /&gt;
!Host Name(s)&lt;br /&gt;
|-&lt;br /&gt;
!IFN&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth0&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;192.168.1.74&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04.ifn&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;192.168.1.75&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05.ifn&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!SN&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth1&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;192.168.2.74&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04.sn&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;192.168.2.75&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05.sn&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!BCN&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth2&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;192.168.3.74&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04 an-node04.alteeve.com an-node04.bcn&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;192.168.3.75&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05 an-node05.alteeve.com an-node05.bcn&amp;lt;/span&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Network Configuration ===&lt;br /&gt;
&lt;br /&gt;
So now we&#039;ve planned the network, so it is time to implement it.&lt;br /&gt;
&lt;br /&gt;
==== Warning About Managed Switches ====&lt;br /&gt;
&lt;br /&gt;
{{warning|1=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 and configuring [[Multicast IGMP Snooping]] or [[Spanning Tree Protocol]]. They have been known to cause problems by not allowing multicast packets to reach all nodes fast enough or at all. This can cause somewhat random break-downs in communication between your nodes, leading to seemingly random fences and DLM lock timeouts. If your switches support [[PIM Routing]], be sure to use it!&lt;br /&gt;
&lt;br /&gt;
If you have problems with your cluster not forming, or seemingly random fencing, try using a cheap [http://dlink.ca/products/?pid=230 unmanaged] switch. If the problem goes away, you are most likely dealing with a managed switch configuration problem.&lt;br /&gt;
&lt;br /&gt;
==== Disable Firewalling ====&lt;br /&gt;
&lt;br /&gt;
To &amp;quot;keep things simple&amp;quot;, we will disable all firewalling on the cluster nodes. This is not recommended in production environments, obviously, so below will be a table of ports and protocols to open when you do get into production. Until then, we will simply use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;chkconfig&amp;lt;/span&amp;gt; to 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;.&lt;br /&gt;
&lt;br /&gt;
{{note|1=Cluster 2 does not support [[IPv6]], so you can skip or ignore it if you wish. I like to disable it just to be certain that it can&#039;t cause issues though.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
chkconfig iptables off&lt;br /&gt;
chkconfig ip6tables off&lt;br /&gt;
/etc/init.d/iptables stop&lt;br /&gt;
/etc/init.d/ip6tables stop&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now confirm that they are off by having &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; list their rules.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
iptables -L&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Chain INPUT (policy ACCEPT)&lt;br /&gt;
target     prot opt source               destination         &lt;br /&gt;
&lt;br /&gt;
Chain FORWARD (policy ACCEPT)&lt;br /&gt;
target     prot opt source               destination         &lt;br /&gt;
&lt;br /&gt;
Chain OUTPUT (policy ACCEPT)&lt;br /&gt;
target     prot opt source               destination         &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;
ip6tables -L&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Chain INPUT (policy ACCEPT)&lt;br /&gt;
target     prot opt source               destination         &lt;br /&gt;
&lt;br /&gt;
Chain FORWARD (policy ACCEPT)&lt;br /&gt;
target     prot opt source               destination         &lt;br /&gt;
&lt;br /&gt;
Chain OUTPUT (policy ACCEPT)&lt;br /&gt;
target     prot opt source               destination         &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When you do prepare to go into production, these are the protocols and ports you need to open between cluster nodes. Remember to allow multicast communications as well!&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Port&lt;br /&gt;
!Protocol&lt;br /&gt;
!Component&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;5404&amp;lt;/span&amp;gt;, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;5405&amp;lt;/span&amp;gt;&lt;br /&gt;
|[[UDP]]&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[cman]]&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;8084&amp;lt;/span&amp;gt;, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;5405&amp;lt;/span&amp;gt;&lt;br /&gt;
|[[TCP]]&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[luci]]&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;11111&amp;lt;/span&amp;gt;&lt;br /&gt;
|[[TCP]]&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[ricci]]&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;14567&amp;lt;/span&amp;gt;&lt;br /&gt;
|[[TCP]]&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[gnbd]]&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;16851&amp;lt;/span&amp;gt;&lt;br /&gt;
|[[TCP]]&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[modclusterd]]&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;21064&amp;lt;/span&amp;gt;&lt;br /&gt;
|[[TCP]]&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[dlm]]&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;50006&amp;lt;/span&amp;gt;, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;50008&amp;lt;/span&amp;gt;, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;50009&amp;lt;/span&amp;gt;&lt;br /&gt;
|[[TCP]]&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[ccsd]]&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;50007&amp;lt;/span&amp;gt;&lt;br /&gt;
|[[UDP]]&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[ccsd]]&amp;lt;/span&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Disable NetworkManager, Enable network ====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;NetworkManager&amp;lt;/span&amp;gt; daemon is an excellent daemon in environments where a system connects to a variety of networks. The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;NetworkManager&amp;lt;/span&amp;gt; daemon handles changing the networking configuration whenever it senses a change in the network state, like when a cable is unplugged or a wireless network comes or goes. As useful as this is on laptops and workstations, it can be detrimental in a cluster.&lt;br /&gt;
&lt;br /&gt;
To prevent the networking from changing once we&#039;ve got it setup, we want to replace &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;NetworkManager&amp;lt;/span&amp;gt; daemon with the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;network&amp;lt;/span&amp;gt; initialization script. The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;network&amp;lt;/span&amp;gt; script will start and stop networking, but otherwise it will leave the configuration alone. This is ideal in servers, and doubly-so in clusters given their sensitivity to transient network issues.&lt;br /&gt;
&lt;br /&gt;
Start by removing &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;NetworkManager&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 remove NetworkManager NetworkManager-glib NetworkManager-gnome NetworkManager-devel NetworkManager-glib-devel&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now you want to ensure that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;network&amp;lt;/span&amp;gt; starts with the system.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
chkconfig network on&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Setup /etc/hosts ====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/hosts&amp;lt;/span&amp;gt; file, by default, will resolve the hostname to the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;lo&amp;lt;/span&amp;gt; (&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;127.0.0.1&amp;lt;/span&amp;gt;) interface. The cluster uses this name though for knowing which interface to use for the [[totem]] protocol (and thus all cluster communications). To this end, we will remove the hostname from &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;127.0.0.1&amp;lt;/span&amp;gt; and instead put it on the IP of our &#039;&#039;&#039;BCN&#039;&#039;&#039; interface. We will also add entries for all other networks for both nodes in the cluster along with entries for the fence device(s). &lt;br /&gt;
&lt;br /&gt;
Once done, the edited &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/hosts&amp;lt;/span&amp;gt; file should be suitable for copying to both nodes in the cluster.&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;
# Do not remove the following line, or various programs&lt;br /&gt;
# that require network functionality will fail.&lt;br /&gt;
127.0.0.1	localhost.localdomain localhost&lt;br /&gt;
::1		localhost6.localdomain6 localhost6&lt;br /&gt;
&lt;br /&gt;
192.168.1.74	an-node04.ifn&lt;br /&gt;
192.168.2.74	an-node04.sn&lt;br /&gt;
192.168.3.74	an-node04 an-node04.bcn an-node04.alteeve.com&lt;br /&gt;
&lt;br /&gt;
192.168.1.75	an-node05.ifn&lt;br /&gt;
192.168.2.75	an-node05.sn&lt;br /&gt;
192.168.3.75	an-node05 an-node05.bcn an-node05.alteeve.com&lt;br /&gt;
&lt;br /&gt;
192.168.3.61	fence_na01.alteeve.com	# Node Assassin&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Mapping Interfaces to ethX Names ====&lt;br /&gt;
&lt;br /&gt;
Chances are good that the assignment of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ethX&amp;lt;/span&amp;gt; interface names to your physical network cards is not ideal. There is no strict technical reason to change the mapping, but it will make your life a lot easier if all nodes use the same &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ethX&amp;lt;/span&amp;gt; names for the same subnets. &lt;br /&gt;
&lt;br /&gt;
The actual process of changing the mapping is a little involved. For this reason, there is a dedicated mini-tutorial which you can find below. Please jump to it and then return once your mapping is as you like it.&lt;br /&gt;
&lt;br /&gt;
* [[Changing the ethX to Ethernet Device Mapping in EL5]]&lt;br /&gt;
&lt;br /&gt;
==== Set IP Addresses ====&lt;br /&gt;
&lt;br /&gt;
The last step in setting up the network interfaces is to manually assign the IP addresses and define the subnets for the interfaces. This involves directly editing the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/sysconfig/network-scripts/ifcfg-ethX&amp;lt;/span&amp;gt; files. There are a large set of options that can be set in these configuration files, but most are outside the scope of this tutorial. To get a better understanding of the available options, please see:&lt;br /&gt;
&lt;br /&gt;
* [http://docs.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/5/html/Deployment_Guide/s1-networkscripts-interfaces.html Red Hat&#039;s Interface Configuration Guide]&lt;br /&gt;
&lt;br /&gt;
{{note|1=Later on, we will be creating two bridges, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xenbr0&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xenbr2&amp;lt;/span&amp;gt; which we will then connect [[dom0]]&#039;s &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; to. These bridges then become available to the [[Xen]]&#039;s [[domU]] VMs. Bridge options and arguments can be found in the link above.}}&lt;br /&gt;
&lt;br /&gt;
Here are the three configuration files from &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt; which you can use as guides. Please &#039;&#039;&#039;do not&#039;&#039;&#039; copy these over your files! Doing so will cause your interfaces to fail outright as every interface&#039;s [[MAC]] address is unique. Adapt these to suite your needs.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/sysconfig/network-scripts/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;
# Realtek Semiconductor Co., Ltd. RTL8111/8168B PCI Express Gigabit Ethernet controller&lt;br /&gt;
HWADDR=48:5B:39:3C:53:14&lt;br /&gt;
DEVICE=eth0&lt;br /&gt;
BOOTPROTO=static&lt;br /&gt;
ONBOOT=yes&lt;br /&gt;
IPADDR=192.168.1.74&lt;br /&gt;
NETMASK=255.255.255.0&lt;br /&gt;
GATEWAY=192.168.1.254&lt;br /&gt;
DNS1=192.139.81.117&lt;br /&gt;
DNS2=192.139.81.1&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;
vim /etc/sysconfig/network-scripts/ifcfg-eth1&lt;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 82574L Gigabit Network Connection&lt;br /&gt;
HWADDR=00:1B:21:72:9B:5A&lt;br /&gt;
DEVICE=eth1&lt;br /&gt;
BOOTPROTO=static&lt;br /&gt;
ONBOOT=yes&lt;br /&gt;
IPADDR=192.168.2.74&lt;br /&gt;
NETMASK=255.255.255.0&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;
vim /etc/sysconfig/network-scripts/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 82574L Gigabit Network Connection&lt;br /&gt;
HWADDR=00:1B:21:72:96:EA&lt;br /&gt;
DEVICE=eth2&lt;br /&gt;
BOOTPROTO=static&lt;br /&gt;
ONBOOT=yes&lt;br /&gt;
IPADDR=192.168.3.74&lt;br /&gt;
NETMASK=255.255.255.0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you do not want to use the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;DNSx=&amp;lt;/span&amp;gt; options, you will need to setup the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/resolv.conf&amp;lt;/span&amp;gt; file for [[DNS]] resolution. You can learn more about this file&#039;s purpose by reading it&#039;s [[man]] page; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;man resolv.conf&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Finally, restart &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;network&amp;lt;/span&amp;gt; and you should have you interfaces setup properly.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/network 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;
Shutting down interface eth0:                              [  OK  ]&lt;br /&gt;
Shutting down interface eth1:                              [  OK  ]&lt;br /&gt;
Shutting down interface eth2:                              [  OK  ]&lt;br /&gt;
Shutting down loopback interface:                          [  OK  ]&lt;br /&gt;
Bringing up loopback interface:                            [  OK  ]&lt;br /&gt;
Bringing up interface eth0:                                [  OK  ]&lt;br /&gt;
Bringing up interface eth1:                                [  OK  ]&lt;br /&gt;
Bringing up interface eth2:                                [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can verify your configuration using the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ifconfig&amp;lt;/span&amp;gt; tool. The output below is from &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&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;
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:3974 errors:0 dropped:0 overruns:0 frame:0&lt;br /&gt;
          TX packets:1810 errors:0 dropped:0 overruns:0 carrier:0&lt;br /&gt;
          collisions:0 txqueuelen:1000 &lt;br /&gt;
          RX bytes:1452567 (1.3 MiB)  TX bytes:237057 (231.5 KiB)&lt;br /&gt;
          Interrupt:246 Base address:0xe000 &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:117 errors:0 dropped:0 overruns:0 frame:0&lt;br /&gt;
          TX packets:62 errors:0 dropped:0 overruns:0 carrier:0&lt;br /&gt;
          collisions:0 txqueuelen:1000 &lt;br /&gt;
          RX bytes:30766 (30.0 KiB)  TX bytes:16018 (15.6 KiB)&lt;br /&gt;
          Interrupt:17 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:54 errors:0 dropped:0 overruns:0 frame:0&lt;br /&gt;
          TX packets:60 errors:0 dropped:0 overruns:0 carrier:0&lt;br /&gt;
          collisions:0 txqueuelen:1000 &lt;br /&gt;
          RX bytes:11492 (11.2 KiB)  TX bytes:15638 (15.2 KiB)&lt;br /&gt;
          Interrupt:16 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:34 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:0 &lt;br /&gt;
          RX bytes:9268 (9.0 KiB)  TX bytes:9268 (9.0 KiB)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{note|1=You may see a &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virbr0&amp;lt;/span&amp;gt; interface. You can safely ignore it, we will remove it later.}}&lt;br /&gt;
&lt;br /&gt;
=== Setting up SSH ===&lt;br /&gt;
&lt;br /&gt;
Setting up [[SSH]] shared keys will allow your nodes to pass files between one another and execute commands remotely without needing to enter a password. This will be needed later when we want to enable applications like &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;libvirtd&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-manager&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
SSH is, on it&#039;s own, a very big topic. If you are not familiar with SSH, please take some time to learn about it before proceeding. A great first step is the [http://en.wikipedia.org/wiki/Secure_Shell Wikipedia] entry on SSH, as well as the SSH [[man]] page; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;man ssh&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[SSH]] 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 on each node, 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;
Created directory &#039;/root/.ssh&#039;.&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;
a1:65:a9:50:bb:15:ae:b1:6e:06:12:4a:29:d1:68:f3 root@an-node04.alteeve.com&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_rsa&amp;lt;/span&amp;gt; and the public key called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;~/.ssh/id_rsa.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;
MIIEnwIBAAKCAQBTNg6FZyDKm4GAm7c+F2enpLWy+t8ZZjm4Z3Q7EhX09ukqk/Qm&lt;br /&gt;
MqprtI9OsiRVjce+wGx4nZ8+Z0NHduCVuwAxG0XG7FpKkUJC3Qb8KhyeIpKEcfYA&lt;br /&gt;
tsDUFnWddVF8Tsz6dDOhb61tAke77d9E01NfyHp88QBxjJ7w+ZgB2eLPBFm6j1t+&lt;br /&gt;
K50JHwdcFfxrZFywKnAQIdH0NCs8VaW91fQZBupg4OGOMpSBnVzoaz2ybI9bQtbZ&lt;br /&gt;
4GwhCghzKx7Qjz20WiqhfPMfFqAZJwn0WXfjALoioMDWavTbx+J2HM8KJ8/YkSSK&lt;br /&gt;
dDEgZCItg0Q2fC35TDX+aJGu3xNfoaAe3lL1AgEjAoIBABVlq/Zq+c2y9Wo2q3Zd&lt;br /&gt;
yjJsLrj+rmWd8ZXRdajKIuc4LVQXaqq8kjjz6lYQjQAOg9H291I3KPLKGJ1ZFS3R&lt;br /&gt;
AAygnOoCQxp9H6rLHw2kbcJDZ4Eknlf0eroxqTceKuVzWUe3ev2gX8uS3z70BjZE&lt;br /&gt;
+C6SoydxK//w9aut5UJN+H5f42p95IsUIs0oy3/3KGPHYrC2Zgc2TIhe25huie/O&lt;br /&gt;
psKhHATBzf+M7tHLGia3q682JqxXru8zhtPOpEAmU4XDtNdL+Bjv+/Q2HMRstJXe&lt;br /&gt;
2PU3IpVBkirEIE5HlyOV1T802KRsSBelxPV5Y6y5TRq+cEwn0G2le1GiFBjd0xQd&lt;br /&gt;
0csCgYEA2BWkxSXhqmeb8dzcZnnuBZbpebuPYeMtWK/MMLxvJ50UCUfVZmA+yUUX&lt;br /&gt;
K9fAUvkMLd7V8/MP7GrdmYq2XiLv6IZPUwyS8yboovwWMb+72vb5QSnN6LAfpUEk&lt;br /&gt;
NRd5JkWgqRstGaUzxeCRfwfIHuAHikP2KeiLM4TfBkXzhm+VWjECgYBilQEBHvuk&lt;br /&gt;
LlY2/1v43zYQMSZNHBSbxc7R5mnOXNFgapzJeFKvaJbVKRsEQTX5uqo83jRXC7LI&lt;br /&gt;
t14pC23tpW1dBTi9bNLzQnf/BL9vQx6KFfgrXwy8KqXuajfv1ECH6ytqdttkUGZt&lt;br /&gt;
TE/monjAmR5EVElvwMubCPuGDk9zC7iQBQKBgG8hEukMKunsJFCANtWdyt5NnKUB&lt;br /&gt;
X66vWSZLyBkQc635Av11Zm8qLusq2Ld2RacDvR7noTuhkykhBEBV92Oc8Gj0ndLw&lt;br /&gt;
hhamS8GI9Xirv7JwYu5QA377ff03cbTngCJPsbYN+e/uj6eYEE/1X5rZnXpO1l6y&lt;br /&gt;
G7QYcrLE46Q5YsCrAoGAL+H5LG4idFEFTem+9Tk3hDUhO2VpGHYFXqMdctygNiUn&lt;br /&gt;
lQ6Oj7Z1JbThPJSz0RGF4wzXl/5eJvn6iPbsQDpoUcC1KM51FxGn/4X2lSCZzgqr&lt;br /&gt;
vUtslejUQJn96YRZ254cZulF/YYjHyUQ3byhDRcr9U2CwUBi5OcbFTomlvcQgHcC&lt;br /&gt;
gYEAtIpaEWt+Akz9GDJpKM7Ojpk8wTtlz2a+S5fx3WH/IVURoAzZiXzvonVIclrH&lt;br /&gt;
5RXFiwfoXlMzIulZcrBJZfTgRO9A2v9rE/ZRm6qaDrGe9RcYfCtxGGyptMKLdbwP&lt;br /&gt;
UW1emRl5celU9ZEZRBpIVTES5ZVWqD2RkkkNNJbPf5F/x+w=&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; (wrapped to make it more readable):&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 AAAAB3NzaC1yc2EAAAABIwAAAQBTNg6FZyDKm4GAm7c+F2enpLWy+t8Z&lt;br /&gt;
Zjm4Z3Q7EhX09ukqk/QmMqprtI9OsiRVjce+wGx4nZ8+Z0NHduCVuwAxG0XG7FpK&lt;br /&gt;
kUJC3Qb8KhyeIpKEcfYAtsDUFnWddVF8Tsz6dDOhb61tAke77d9E01NfyHp88QBx&lt;br /&gt;
jJ7w+ZgB2eLPBFm6j1t+K50JHwdcFfxrZFywKnAQIdH0NCs8VaW91fQZBupg4OGO&lt;br /&gt;
MpSBnVzoaz2ybI9bQtbZ4GwhCghzKx7Qjz20WiqhfPMfFqAZJwn0WXfjALoioMDW&lt;br /&gt;
avTbx+J2HM8KJ8/YkSSKdDEgZCItg0Q2fC35TDX+aJGu3xNfoaAe3lL1 root@an&lt;br /&gt;
-node04.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-node04&#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-node05&lt;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-node05 (192.168.3.75)&#039; can&#039;t be established.&lt;br /&gt;
RSA key fingerprint is 55:58:c3:32:e4:e6:5e:32:c1:db:5c:f1:36:e2:da:4b.&lt;br /&gt;
Are you sure you want to continue connecting (yes/no)? yes&lt;br /&gt;
Warning: Permanently added &#039;an-node05,192.168.3.75&#039; (RSA) to the list of known hosts.&lt;br /&gt;
Last login: Fri Mar 11 20:45:58 2011 from 192.168.1.202&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-node05&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-node04&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;
(Wrapped to make it more readable)&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 AAAAB3NzaC1yc2EAAAABIwAAAQBTNg6FZyDKm4GAm7c+F2enpLWy+t8Z&lt;br /&gt;
Zjm4Z3Q7EhX09ukqk/QmMqprtI9OsiRVjce+wGx4nZ8+Z0NHduCVuwAxG0XG7FpK&lt;br /&gt;
kUJC3Qb8KhyeIpKEcfYAtsDUFnWddVF8Tsz6dDOhb61tAke77d9E01NfyHp88QBx&lt;br /&gt;
jJ7w+ZgB2eLPBFm6j1t+K50JHwdcFfxrZFywKnAQIdH0NCs8VaW91fQZBupg4OGO&lt;br /&gt;
MpSBnVzoaz2ybI9bQtbZ4GwhCghzKx7Qjz20WiqhfPMfFqAZJwn0WXfjALoioMDW&lt;br /&gt;
avTbx+J2HM8KJ8/YkSSKdDEgZCItg0Q2fC35TDX+aJGu3xNfoaAe3lL1 root@an&lt;br /&gt;
-node04.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;
Various applications will connect to the other node using different methods and networks. Each connection, when first established, will prompt for you to confirm that you trust the authentication, as we saw above. Many programs can&#039;t handle this prompt and will simply fail to connect. So to get around this, I will &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ssh&amp;lt;/span&amp;gt; into both nodes using all hostnames. This will populate a file called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;~/.ssh/known_hosts&amp;lt;/span&amp;gt;. Once you do this on one node, you can simply copy the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;known_hosts&amp;lt;/span&amp;gt; to the other nodes and user&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;~/.ssh/&amp;lt;/span&amp;gt; directories.&lt;br /&gt;
&lt;br /&gt;
I simply paste this into a terminal, answering &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;yes&amp;lt;/span&amp;gt; and then immediately exiting from the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ssh&amp;lt;/span&amp;gt; session. This is a bit tedious, I admit. Take the time to check the fingerprints as they are displayed to you. It is a bad habit to blindly type &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;yes&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Alter this to suit your host names.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ssh root@an-node04 &amp;amp;&amp;amp; \&lt;br /&gt;
ssh root@an-node04.alteeve.com &amp;amp;&amp;amp; \&lt;br /&gt;
ssh root@an-node04.bcn &amp;amp;&amp;amp; \&lt;br /&gt;
ssh root@an-node04.sn &amp;amp;&amp;amp; \&lt;br /&gt;
ssh root@an-node04.ifn &amp;amp;&amp;amp; \&lt;br /&gt;
ssh root@an-node05 &amp;amp;&amp;amp; \&lt;br /&gt;
ssh root@an-node05.alteeve.com &amp;amp;&amp;amp; \&lt;br /&gt;
ssh root@an-node05.bcn &amp;amp;&amp;amp; \&lt;br /&gt;
ssh root@an-node05.sn &amp;amp;&amp;amp; \&lt;br /&gt;
ssh root@an-node05.ifn&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once you&#039;ve done this on one node, you can simply copy the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;~/.ssh/known_hosts&amp;lt;/span&amp;gt; file to the other node. In my case, I ran the above commands on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt;, so I will copy the file to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&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;
rsync -av root@192.168.1.74:/root/.ssh/known_hosts ~/.ssh/&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
receiving file list ... done&lt;br /&gt;
known_hosts&lt;br /&gt;
&lt;br /&gt;
sent 96 bytes  received 2165 bytes  4522.00 bytes/sec&lt;br /&gt;
total size is 7629  speedup is 3.37&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Installing Packages We Will Use ==&lt;br /&gt;
&lt;br /&gt;
There are several packages we will need. They can all be installed in one go with the following command.&lt;br /&gt;
&lt;br /&gt;
If you have a slow or metered Internet connection, you may want to alter &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/yum.conf&amp;lt;/span&amp;gt; and change &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;keepcache=0&amp;lt;/span&amp;gt; to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;keepcache=1&amp;lt;/span&amp;gt; before installing packages. This way, you can then run you updates and installs on one node and then &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rsync&amp;lt;/span&amp;gt; the downloaded files from the first node to the second node. Once done, when you run the updates and installs on that second node, nothing more will be downloaded. To copy the cached [[RPM]]s, simply run &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rsync -av /var/cache/yum root@an-node05:/var/cache/&amp;lt;/span&amp;gt; (assuming you did the initial downloads from &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
{{note|1=If you are using [[RHEL]] 5.x proper, you will need to manually download and install the [[DRBD]] RPMs from [http://www.linbit.com/support/ Linbit].}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install cman openais rgmanager lvm2-cluster gfs2-utils xen xen-libs kmod-xenpv \&lt;br /&gt;
            drbd83 kmod-drbd83-xen virt-manager virt-viewer libvirt libvirt-python \&lt;br /&gt;
            python-virtinst luci ricci ntp bridge-utils system-config-cluster&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will drag in a good number of dependencies, which is fine.&lt;br /&gt;
&lt;br /&gt;
== Keeping Time In Sync ==&lt;br /&gt;
&lt;br /&gt;
It is very important that time on both nodes be kept in sync. The way to do this is to setup [[[NTP]], the network time protocol. I like to use the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;tick.redhat.com&amp;lt;/span&amp;gt; time server, though you are free to substitute your preferred time source.&lt;br /&gt;
&lt;br /&gt;
First, add the timeserver to the NTP configuration file by appending the following lines to the end of 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;
echo server tick.redhat.com$&#039;\n&#039;restrict tick.redhat.com mask 255.255.255.255 nomodify notrap noquery &amp;gt;&amp;gt; /etc/ntp.conf&lt;br /&gt;
tail -n 4 /etc/ntp.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;
# Specify the key identifier to use with the ntpq utility.&lt;br /&gt;
#controlkey 8&lt;br /&gt;
server tick.redhat.com&lt;br /&gt;
restrict tick.redhat.com mask 255.255.255.255 nomodify notrap noquery&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now make sure that the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ntpd&amp;lt;/span&amp;gt; service starts on boot, then start it manually.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
chkconfig ntpd on&lt;br /&gt;
/etc/init.d/ntpd 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 ntpd:                                             [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Altering Boot Up ==&lt;br /&gt;
&lt;br /&gt;
{{note|1=The next two steps are optional.}}&lt;br /&gt;
&lt;br /&gt;
There are two changes I like to make on my nodes. These are not required, but I find it helps to keep things as simple as possible. Particularly in the earlier learning and testing stages.&lt;br /&gt;
&lt;br /&gt;
=== Changing the Default Run-Level ===&lt;br /&gt;
&lt;br /&gt;
If you choose not to implement it, please change any referenced to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/rc3.d&amp;lt;/span&amp;gt; to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/rc5.d&amp;lt;/span&amp;gt; later in this tutorial.&lt;br /&gt;
&lt;br /&gt;
I prefer to minimize the running daemons and apps on my nodes for two reasons; Performance and security. One of the simplest ways to minimize the number of running programs is to change the run-level to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;3&amp;lt;/span&amp;gt; by editing &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/inittab&amp;lt;/span&amp;gt;. This tells the node when it boots not to start the graphical interface and instead simply boot to a &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[bash]]&amp;lt;/span&amp;gt; shell.&lt;br /&gt;
&lt;br /&gt;
This change is actually quite simple. Simple edit &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/inittab&amp;lt;/span&amp;gt; and change the line &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;id:5:initdefault:&amp;lt;/span&amp;gt; to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;id:3:initdefault:&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;
cp /etc/inittab /etc/inittab.orig&lt;br /&gt;
sed -i &#039;s/id:5:initdefault/id:3:initdefault/g&#039; /etc/inittab&lt;br /&gt;
diff -u /etc/inittab.orig /etc/inittab&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;diff&amp;quot;&amp;gt;&lt;br /&gt;
--- /etc/inittab.orig	2011-05-01 20:54:35.000000000 -0400&lt;br /&gt;
+++ /etc/inittab	2011-05-01 20:56:43.000000000 -0400&lt;br /&gt;
@@ -15,7 +15,7 @@&lt;br /&gt;
 #   5 - X11&lt;br /&gt;
 #   6 - reboot (Do NOT set initdefault to this)&lt;br /&gt;
 # &lt;br /&gt;
-id:5:initdefault:&lt;br /&gt;
+id:3:initdefault:&lt;br /&gt;
 &lt;br /&gt;
 # System initialization.&lt;br /&gt;
 si::sysinit:/etc/rc.d/rc.sysinit&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you are still in a graphical environment and want to disable the [[GUI]] without rebooting, you can run &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;init 3&amp;lt;/span&amp;gt;. Conversely, if you want to start the GUI for a certain task, you can do so my running &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;init 5&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Making Boot Messages Visible ===&lt;br /&gt;
&lt;br /&gt;
Another optional step, in-line with the change above, is to disable the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rhgb&amp;lt;/span&amp;gt; (Red Hat Graphical Boot) and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;quiet&amp;lt;/span&amp;gt; kernel arguments. These options provide the clean boot screen you normally see with [[EL5]], but they also hide a lot of boot messages that we may find helpful. &lt;br /&gt;
&lt;br /&gt;
To make this change, edit the [[grub]] boot-loader menu and remove the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rhgb quiet&amp;lt;/span&amp;gt; arguments from the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;kernel /vmlinuz...&amp;lt;/span&amp;gt; line. These arguments are usually the last ones on the line. If you leave this until later you may see two or more kernel entries. Delete these arguments where ever they are found.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /boot/grub/grub.conf /boot/grub/grub.conf.orig&lt;br /&gt;
sed -i &#039;s/root=LABEL=\//root=LABEL=\/ rhgb quiet/g&#039; /boot/grub/grub.conf&lt;br /&gt;
diff -u /boot/grub/grub.conf.orig /boot/grub/grub.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;diff&amp;quot;&amp;gt;&lt;br /&gt;
--- /boot/grub/grub.conf.orig	2011-05-01 21:01:43.000000000 -0400&lt;br /&gt;
+++ /boot/grub/grub.conf	2011-05-01 21:02:44.000000000 -0400&lt;br /&gt;
@@ -14,18 +14,18 @@&lt;br /&gt;
 title CentOS (2.6.18-238.9.1.el5xen)&lt;br /&gt;
 	root (hd0,0)&lt;br /&gt;
 	kernel /xen.gz-2.6.18-238.9.1.el5&lt;br /&gt;
-	module /vmlinuz-2.6.18-238.9.1.el5xen ro root=LABEL=/ rhgb quiet&lt;br /&gt;
+	module /vmlinuz-2.6.18-238.9.1.el5xen ro root=LABEL=/&lt;br /&gt;
 	module /initrd-2.6.18-238.9.1.el5xen.img&lt;br /&gt;
 title CentOS (2.6.18-238.9.1.el5)&lt;br /&gt;
 	root (hd0,0)&lt;br /&gt;
-	kernel /vmlinuz-2.6.18-238.9.1.el5 ro root=LABEL=/ rhgb quiet&lt;br /&gt;
+	kernel /vmlinuz-2.6.18-238.9.1.el5 ro root=LABEL=/&lt;br /&gt;
 	initrd /initrd-2.6.18-238.9.1.el5.img&lt;br /&gt;
 title CentOS (2.6.18-238.el5xen)&lt;br /&gt;
 	root (hd0,0)&lt;br /&gt;
 	kernel /xen.gz-2.6.18-238.el5 &lt;br /&gt;
-	module /vmlinuz-2.6.18-238.el5xen ro root=LABEL=/ rhgb quiet&lt;br /&gt;
+	module /vmlinuz-2.6.18-238.el5xen ro root=LABEL=/&lt;br /&gt;
 	module /initrd-2.6.18-238.el5xen.img&lt;br /&gt;
 title CentOS-base (2.6.18-238.el5)&lt;br /&gt;
 	root (hd0,0)&lt;br /&gt;
-	kernel /vmlinuz-2.6.18-238.el5 ro root=LABEL=/ rhgb quiet&lt;br /&gt;
+	kernel /vmlinuz-2.6.18-238.el5 ro root=LABEL=/&lt;br /&gt;
 	initrd /initrd-2.6.18-238.el5.img&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{note|1=If you&#039;re &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;grub.conf&amp;lt;/span&amp;gt; has been altered or doesn&#039;t have the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;root=LABEL=/&amp;lt;/span&amp;gt; text, you will need to manually add the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rhgb quiet&amp;lt;/span&amp;gt; to the end of the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/vmlinuz&amp;lt;/span&amp;gt; line(s).}}&lt;br /&gt;
&lt;br /&gt;
Now future reboots will show boot details in a terminal display rather than hiding those often-useful messages behind a splash screen.&lt;br /&gt;
&lt;br /&gt;
= Setting Up Xen =&lt;br /&gt;
&lt;br /&gt;
It may seem premature to discuss [[Xen]] before the cluster itself. The reason we need to look at it now, before the cluster, is because Xen makes some fairly significant changes to the networking. Given how changes to networking can effect the cluster, we will want to get these changes out of the way.&lt;br /&gt;
&lt;br /&gt;
We&#039;re not going to provision any virtual machines until the cluster is built.&lt;br /&gt;
&lt;br /&gt;
== A Brief Overview ==&lt;br /&gt;
&lt;br /&gt;
Xen is a [[hypervisor]] the converts the installed operating system into a virtual machine running on a small Xen kernel. This same small kernel also runs all of the virtual machines you will add later. In this way, you will always be working in a virtual machine once you switch to booting a Xen kernel. In Xen terminology, virtual machines are known as &#039;&#039;&#039;domains&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;host&amp;quot; operating system is known as [[dom0]] (domain 0) and has a special view of the hardware plus contains the configuration and control of Xen itself. All other Xen virtual machines are known as [[domU]] (domain U). This is a collective term that represents the transient ID number assigned to all virtual machines. For example, when you boot the first virtual machine, it is known as &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;dom1&amp;lt;/span&amp;gt;. The next will be &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;dom2&amp;lt;/span&amp;gt;, then &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;dom3&amp;lt;/span&amp;gt; and so on. Do note that if a [[domU]] shuts down, it&#039;s ID is &#039;&#039;not&#039;&#039; reused. So when it restarts, it will use the next free ID (ie: &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;dom4&amp;lt;/span&amp;gt; in this list, despite it having been, say, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;dom1&amp;lt;/span&amp;gt; initially).&lt;br /&gt;
&lt;br /&gt;
This makes Xen somewhat unique in the virtualization world. Most others do not touch or alter the &amp;quot;host&amp;quot; OS, instead running the guest VMs fully withing the context of the host operating system.&lt;br /&gt;
&lt;br /&gt;
== Understanding Networking in Xen ==&lt;br /&gt;
&lt;br /&gt;
Xen uses a fairly complex networking system. This is, perhaps, it&#039;s strongest point. The trade off though is that it can be a little tricky to wrap your head around. To help you become familiar, there is a short tutorial dedicated to this topic. Please read it over before proceeding in you are not familiar with Xen&#039;s networking.&lt;br /&gt;
&lt;br /&gt;
Taking the time to read and understand the mini-paper below will save you a lot of heartache in the following stages.&lt;br /&gt;
&lt;br /&gt;
* [[Networking in Xen 3.x]]&lt;br /&gt;
&lt;br /&gt;
Once built, this is what our inter-node network will look like. If you have trouble following this diagram, please do go back and read the link above before proceeding.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
 __________________________________________________________                         _________________________________________________________&lt;br /&gt;
|  ____________________                 an-node04 - (dom0) |                       | (dom0) - an-node05                 ___________________  |&lt;br /&gt;
| | vm0001_ws1   ______|                ________    _______|   _________________   |_______    ________                |______  vm0001_ws1 | |&lt;br /&gt;
| |   (domA)    | eth0 =-[vifA.0]------| xenbr0 |-=| eth0  =--| Internet-Facing |--=  eth0 |=-| xenbr0 |------[vifC.0]-= eth0 |   (domC)   | |&lt;br /&gt;
| |             |_____-|          /----|        |  |______-|  | Switch or VLAN  |  |-______|  |        |----\          |-_____|            | |&lt;br /&gt;
| |                    |          |    |        |          |  |_________________|  |          |        |    |          |                   | |&lt;br /&gt;
| |              ______|          |    |________|          |                       |          |________|    |          |______             | |&lt;br /&gt;
| |             | eth1 =-[vifA.2]-+-\                      |                       |                      /-+-[vivC.2]-= eth1 |            | |&lt;br /&gt;
| | [Active]    |_____-|          | |                      |                       |                      | |          |-_____|   [Backup] | |&lt;br /&gt;
| |____________________|          | |                      |                       |                      | |          |___________________| |&lt;br /&gt;
|                                 | |                      |                       |                      | |                                |&lt;br /&gt;
|  ____________________           | |                      |                       |                      | |           ___________________  |&lt;br /&gt;
| | vm0002_win1  ______|          | |               _______|   _________________   |_______               | |          |______ vm0002_win1 | |&lt;br /&gt;
| |   (domB)    | eth0 =-[vifB.0]-/ |              | eth1  =--|    Storage      |--=  eth1 |              | \-[vifD.0]-= eth0 |   (domD)   | |&lt;br /&gt;
| |             |_____-|            |              |______-|  | Switch or VLAN  |  |-______|              |            |-_____|            | |&lt;br /&gt;
| |                    |            |                      |  |_________________|  |                      |            |                   | |&lt;br /&gt;
| |              ______|            |                      |                       |                      |            |______             | |&lt;br /&gt;
| |             | eth1 =-[vifB.2]-\ |                      |                       |                      | /-[vifD.2]-= eth1 |            | |&lt;br /&gt;
| | [Backup]    |_____-|          | |                      |                       |                      | |          |-_____|   [Active] | |&lt;br /&gt;
| |____________________|          | |                      |                       |                      | |          |___________________| |&lt;br /&gt;
|                                 | |                      |                       |                      | |                                |&lt;br /&gt;
|                                 | |   ________    _______|   _________________   |_______    ________   | |                                |&lt;br /&gt;
|                                 | \--| xenbr2 |-=| eth2  =--|  Back-Channel   |--=  eth2 |=-| xenbr2 |--/ |                                |&lt;br /&gt;
|                                 \----|        |  |______-|  | Switch or VLAN  |  |-______|  |        |----/                                |&lt;br /&gt;
|                                      |        |          |  |_________________|  |          |        |                                     |&lt;br /&gt;
|                                      |________|          |                       |          |________|                                     |&lt;br /&gt;
|                                                          |                       |                                                         |&lt;br /&gt;
|                                                          |                       |                                                         |&lt;br /&gt;
|                                                          |                       |                                                         |&lt;br /&gt;
|                                                          |                       |                                                         |&lt;br /&gt;
|                                                          |                       |                                                         |&lt;br /&gt;
|__________________________________________________________|                       |_________________________________________________________|&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Making Network Interfaces Available To Xen Clients ==&lt;br /&gt;
&lt;br /&gt;
As discussed above, Xen makes some significant changes to the [[dom0]] network, which happens to be where the cluster will operate. These changes including shutting down and moving around the interfaces. As we will discuss later, this behaviour can trigger cluster failures. This is the main reason for dealing with Xen now. Once the changes are in place, the network is stable and safe for running the cluster on.&lt;br /&gt;
&lt;br /&gt;
=== A Brief Overview ===&lt;br /&gt;
&lt;br /&gt;
By default, Xen only makes &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth0&amp;lt;/span&amp;gt; available to the virtual machines. We will want to add &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth2&amp;lt;/span&amp;gt; as well, as we will use the &#039;&#039;Back Channel Network&#039;&#039; for inter-VM communication. We do &#039;&#039;&#039;not&#039;&#039;&#039; want to add the &#039;&#039;Storage Network&#039;&#039; to Xen though! Doing so puts the DRBD link at risk. Should &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xend&amp;lt;/span&amp;gt; get shut down, it could trigger a [[split-brain]] in DRBD.&lt;br /&gt;
&lt;br /&gt;
What Xen does, in brief, is move the &amp;quot;real&amp;quot; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth0&amp;lt;/span&amp;gt; over to a new device called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;peth0&amp;lt;/span&amp;gt;. Then it creates a virtual &amp;quot;clone&amp;quot; of the network interface called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth0&amp;lt;/span&amp;gt;. Next, Xen creates a [[bridge]] called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xenbr0&amp;lt;/span&amp;gt;. Finally, both the real &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;peth0&amp;lt;/span&amp;gt; and the new virtual &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth0&amp;lt;/span&amp;gt; are connected to the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xenbr0&amp;lt;/span&amp;gt; bridge.&lt;br /&gt;
&lt;br /&gt;
The reasoning behind all this is to separate the traffic coming to and from [[dom0]] from any traffic doing to the various [[domU]]s. Think of it sort of like the bridge being a network switch, the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;peth0&amp;lt;/span&amp;gt; being an uplink cable to the outside world and the virtual &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth0&amp;lt;/span&amp;gt; being [[dom0]]&#039;s &amp;quot;port&amp;quot; on the switch. We want the same to be done to the interface on the &#039;&#039;Back-Channel Network&#039;&#039;, too. The &#039;&#039;Storage Network&#039;&#039; will never be exposed to the [[domU]] machines, so combining the risk to the underlying storage, there is no reason to add &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth1&amp;lt;/span&amp;gt; to Xen&#039;s control.&lt;br /&gt;
&lt;br /&gt;
=== Disable the &#039;qemu&#039; Bridge ===&lt;br /&gt;
&lt;br /&gt;
By default, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[libvirtd]]&amp;lt;/span&amp;gt; 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. &lt;br /&gt;
&lt;br /&gt;
So to remove this bridge, simply delete the contents of the file, stop the bridge, delete the bridge and then stop &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;iptables&amp;lt;/span&amp;gt; to make sure any rules created for the bridge are flushed.&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;
ifconfig virbr0 down&lt;br /&gt;
brctl delbr virbr0&lt;br /&gt;
/etc/init.d/iptables stop&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Setting Up Bridges ===&lt;br /&gt;
&lt;br /&gt;
By default, Xen creates the bridges it will need when it starts. This works fine with basic configuration, but is no longer recommended.&lt;br /&gt;
&lt;br /&gt;
Bridges are very much like software network switches. Interfaces can be connected to them and then use them to pass data back and forth. As virtual machines are created, they will have a special &amp;quot;virtual&amp;quot; interface created. These &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vifX.Y&amp;lt;/span&amp;gt; devices are very much like a network cable between a normal server and a switch. In Xen, the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;X&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Y&amp;lt;/span&amp;gt; in the name &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vifX.Y&amp;lt;/span&amp;gt; corresponds to the domain ID, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;X&amp;lt;/span&amp;gt; and the bridge ID &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Y&amp;lt;/span&amp;gt;. For example, if you create a [[domU]] which is given the ID of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;5&amp;lt;/span&amp;gt; and you are connecting two interfaces within domU to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xenbr0&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xenbr2&amp;lt;/span&amp;gt;, you will see two virtual interfaces created, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vif5.0&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vif5.2&amp;lt;/span&amp;gt;, which connect the domU&#039;s &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;eth1&amp;lt;/span&amp;gt; to the bridges, respectively.&lt;br /&gt;
&lt;br /&gt;
If you found the above confusing, please take a look at the article below:&lt;br /&gt;
&lt;br /&gt;
* [[Networking in Xen 3.x]]&lt;br /&gt;
&lt;br /&gt;
We will now create bridges in each node for the &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; interfaces. We aren&#039;t bothering with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth1&amp;lt;/span&amp;gt; as it will only be used for storage traffic and thus will never need to be seen or used by any domU. To create the bridges, we need to do two things;&lt;br /&gt;
* Create the bridge configuration files; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/sysconfig/network-scripts/ifcfg-xenbr0&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/sysconfig/network-scripts/ifcfg-xenbr2&amp;lt;/span&amp;gt;&lt;br /&gt;
* Change the interface configuration files and connect the interfaces to the bridge.&lt;br /&gt;
&lt;br /&gt;
Note that when we create the bridge scripts, we will move the IP address information from the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ethX&amp;lt;/span&amp;gt; device to the corresponding &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xenbrX&amp;lt;/span&amp;gt; configuration file. This means that, after this change, you will see the IP address on the bridge, &#039;&#039;not&#039;&#039; the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ethX&amp;lt;/span&amp;gt; device. This is normal.&lt;br /&gt;
&lt;br /&gt;
{{note|1=It is not necessary to stop the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;network&amp;lt;/span&amp;gt; daemon before making these changes. Once you&#039;ve begun the edits though, do be careful though not to restart networking until you are complete. These changes will somewhat dramatically alter your network configuration. If you leave the network up, be aware that when you do restart the network, you will see a warning like: &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Shutting down interface eth0:  bridge xenbr0 does not exist!&amp;lt;/span&amp;gt;. This is ok.}}&lt;br /&gt;
&lt;br /&gt;
First, create the two bridge configuration files.&lt;br /&gt;
&lt;br /&gt;
For &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xenbr0&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/sysconfig/network-scripts/ifcfg-xenbr0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
# Bridge created for Xen&lt;br /&gt;
DEVICE=xenbr0&lt;br /&gt;
TYPE=Bridge&lt;br /&gt;
BOOTPROTO=static&lt;br /&gt;
IPADDR=192.168.1.74&lt;br /&gt;
NETMASK=255.255.255.0&lt;br /&gt;
GATEWAY=192.168.1.254&lt;br /&gt;
DNS1=192.139.81.117&lt;br /&gt;
DNS2=192.139.81.1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xenbr2&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/sysconfig/network-scripts/ifcfg-xenbr2&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
# Bridge created for Xen&lt;br /&gt;
DEVICE=xenbr2&lt;br /&gt;
TYPE=Bridge&lt;br /&gt;
BOOTPROTO=static&lt;br /&gt;
IPADDR=192.168.3.74&lt;br /&gt;
NETMASK=255.255.255.0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Next, edit the corresponding &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ethX&amp;lt;/span&amp;gt; devices. This will involve adding a &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;BRIDGE=xenbrX&amp;lt;/span&amp;gt; line and removing all of the IP address information. Below are the updated &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; devices after the changes have been made with a &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;diff&amp;lt;/span&amp;gt; showing exactly how the files changed.&lt;br /&gt;
&lt;br /&gt;
For &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth0&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;
cp /etc/sysconfig/network-scripts/ifcfg-eth0 /etc/sysconfig/network-scripts/ifcfg-eth0.orig&lt;br /&gt;
vim /etc/sysconfig/network-scripts/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;
# Realtek Semiconductor Co., Ltd. RTL8111/8168B PCI Express Gigabit Ethernet controller&lt;br /&gt;
HWADDR=48:5B:39:3C:53:14&lt;br /&gt;
DEVICE=eth0&lt;br /&gt;
BRIDGE=xenbr0&lt;br /&gt;
BOOTPROTO=static&lt;br /&gt;
ONBOOT=yes&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;
diff -u /etc/sysconfig/network-scripts/ifcfg-eth0.orig /etc/sysconfig/network-scripts/ifcfg-eth0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;diff&amp;quot;&amp;gt;&lt;br /&gt;
--- /etc/sysconfig/network-scripts/ifcfg-eth0.orig	2011-05-02 15:05:56.000000000 -0400&lt;br /&gt;
+++ /etc/sysconfig/network-scripts/ifcfg-eth0	2011-05-02 15:01:34.000000000 -0400&lt;br /&gt;
@@ -1,10 +1,6 @@&lt;br /&gt;
 # Realtek Semiconductor Co., Ltd. RTL8111/8168B PCI Express Gigabit Ethernet controller&lt;br /&gt;
 HWADDR=48:5B:39:3C:53:14&lt;br /&gt;
 DEVICE=eth0&lt;br /&gt;
+BRIDGE=xenbr0&lt;br /&gt;
 BOOTPROTO=static&lt;br /&gt;
 ONBOOT=yes&lt;br /&gt;
-IPADDR=192.168.1.74&lt;br /&gt;
-NETMASK=255.255.255.0&lt;br /&gt;
-GATEWAY=192.168.1.254&lt;br /&gt;
-DNS1=192.139.81.117&lt;br /&gt;
-DNS2=192.139.81.1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth2&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;
cp /etc/sysconfig/network-scripts/ifcfg-eth2 /etc/sysconfig/network-scripts/ifcfg-eth2.orig&lt;br /&gt;
vim /etc/sysconfig/network-scripts/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 82574L Gigabit Network Connection&lt;br /&gt;
HWADDR=00:1B:21:72:96:EA&lt;br /&gt;
DEVICE=eth2&lt;br /&gt;
BRIDGE=xenbr2&lt;br /&gt;
BOOTPROTO=static&lt;br /&gt;
ONBOOT=yes&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;
diff -u /etc/sysconfig/network-scripts/ifcfg-eth2.orig /etc/sysconfig/network-scripts/ifcfg-eth2&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;diff&amp;quot;&amp;gt;&lt;br /&gt;
--- /etc/sysconfig/network-scripts/ifcfg-eth2.orig	2011-05-02 15:08:36.000000000 -0400&lt;br /&gt;
+++ /etc/sysconfig/network-scripts/ifcfg-eth2	2011-05-02 15:08:20.000000000 -0400&lt;br /&gt;
@@ -1,7 +1,6 @@&lt;br /&gt;
 # Intel Corporation 82574L Gigabit Network Connection&lt;br /&gt;
 HWADDR=00:1B:21:72:96:EA&lt;br /&gt;
 DEVICE=eth2&lt;br /&gt;
+BRIDGE=xenbr2&lt;br /&gt;
 BOOTPROTO=static&lt;br /&gt;
 ONBOOT=yes&lt;br /&gt;
-IPADDR=192.168.3.74&lt;br /&gt;
-NETMASK=255.255.255.0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now restart the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;network&amp;lt;/span&amp;gt; daemon. As noted, do not be concerned about the shutdown warnings, they should appear only once.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/network 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;
Shutting down interface eth0:  bridge xenbr0 does not exist!&lt;br /&gt;
                                                           [  OK  ]&lt;br /&gt;
Shutting down interface eth1:                              [  OK  ]&lt;br /&gt;
Shutting down interface eth2:  bridge xenbr2 does not exist!&lt;br /&gt;
                                                           [  OK  ]&lt;br /&gt;
Shutting down loopback interface:                          [  OK  ]&lt;br /&gt;
Bringing up loopback interface:                            [  OK  ]&lt;br /&gt;
Bringing up interface eth0:                                [  OK  ]&lt;br /&gt;
Bringing up interface eth1:                                [  OK  ]&lt;br /&gt;
Bringing up interface eth2:                                [  OK  ]&lt;br /&gt;
Bringing up interface xenbr0:                              [  OK  ]&lt;br /&gt;
Bringing up interface xenbr2:                              [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can check that the bridges are up and that the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ethX&amp;lt;/span&amp;gt; interfaces are connected to them using the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;brctl&amp;lt;/span&amp;gt; tool.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
brctl show&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
bridge name	bridge id		STP enabled	interfaces&lt;br /&gt;
virbr0		8000.000000000000	yes		&lt;br /&gt;
xenbr0		8000.485b393c5314	no		eth0&lt;br /&gt;
xenbr2		8000.001b217296ea	no		eth2&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We&#039;ll see this reflected in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;iptables&amp;lt;/span&amp;gt; output as well.&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;
          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:276 errors:0 dropped:0 overruns:0 frame:0&lt;br /&gt;
          TX packets:168 errors:0 dropped:0 overruns:0 carrier:0&lt;br /&gt;
          collisions:0 txqueuelen:1000 &lt;br /&gt;
          RX bytes:47553 (46.4 KiB)  TX bytes:25555 (24.9 KiB)&lt;br /&gt;
          Interrupt:246 Base address:0xe000 &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:123 errors:0 dropped:0 overruns:0 frame:0&lt;br /&gt;
          TX packets:55 errors:0 dropped:0 overruns:0 carrier:0&lt;br /&gt;
          collisions:0 txqueuelen:1000 &lt;br /&gt;
          RX bytes:25758 (25.1 KiB)  TX bytes:9364 (9.1 KiB)&lt;br /&gt;
          Interrupt:17 Memory:feae0000-feb00000 &lt;br /&gt;
&lt;br /&gt;
eth2      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 MULTICAST  MTU:1500  Metric:1&lt;br /&gt;
          RX packets:161 errors:0 dropped:0 overruns:0 frame:0&lt;br /&gt;
          TX packets:69 errors:0 dropped:0 overruns:0 carrier:0&lt;br /&gt;
          collisions:0 txqueuelen:1000 &lt;br /&gt;
          RX bytes:31049 (30.3 KiB)  TX bytes:13329 (13.0 KiB)&lt;br /&gt;
          Interrupt:16 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:8 errors:0 dropped:0 overruns:0 frame:0&lt;br /&gt;
          TX packets:8 errors:0 dropped:0 overruns:0 carrier:0&lt;br /&gt;
          collisions:0 txqueuelen:0 &lt;br /&gt;
          RX bytes:560 (560.0 b)  TX bytes:560 (560.0 b)&lt;br /&gt;
&lt;br /&gt;
xenbr0    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:252 errors:0 dropped:0 overruns:0 frame:0&lt;br /&gt;
          TX packets:153 errors:0 dropped:0 overruns:0 carrier:0&lt;br /&gt;
          collisions:0 txqueuelen:0 &lt;br /&gt;
          RX bytes:41073 (40.1 KiB)  TX bytes:21327 (20.8 KiB)&lt;br /&gt;
&lt;br /&gt;
xenbr2    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:138 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:25913 (25.3 KiB)  TX bytes:9396 (9.1 KiB)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now let&#039;s move on to the main Xen configuration file!&lt;br /&gt;
&lt;br /&gt;
=== Editing the /etc/xen/xend-config.sxp Configuration File ===&lt;br /&gt;
&lt;br /&gt;
We need to do two things here:&lt;br /&gt;
* Tell Xen to enable it&#039;s unix socket so that external tools can manage it (if needed).&lt;br /&gt;
* Tell Xen to not handle bridge configuration.&lt;br /&gt;
* Enable Live Migration of VMs between nodes.&lt;br /&gt;
&lt;br /&gt;
Begin editing the Xen configuration file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/xen/xend-config.sxp /etc/xen/xend-config.sxp.orig&lt;br /&gt;
vim /etc/xen/xend-config.sxp&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{note|1=It would see that, by default, Xen now enables it&#039;s unix socket. As such, this step may not be needed.}}&lt;br /&gt;
&lt;br /&gt;
Configure Xen to enable it&#039;s unix socket. This is how tools like &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virsh&amp;lt;/span&amp;gt;, which we will look at later, interact with Xen. To do this, change &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xend-unix-server&amp;lt;/span&amp;gt;, which is around line &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;19&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;
(xend-unix-server yes)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Edit the &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 &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/bin/true&amp;lt;/span&amp;gt;. This let&#039;s the script succeed without actually doing anything. We want this behavious because we created the bridges ourselves outside of Xen.&lt;br /&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;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To enable live migration, we need to edit four values. Let&#039;s look at the new values, then we&#039;ll discuss what they effect and how their syntax works.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
(xend-relocation-server yes)&lt;br /&gt;
(xend-relocation-port 8002)&lt;br /&gt;
(xend-relocation-address &#039;an-node04.bcn&#039;)&lt;br /&gt;
(xend-relocation-hosts-allow &#039;&#039;)&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;xend-unix-server&amp;lt;/span&amp;gt;; When set to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;yes&amp;lt;/span&amp;gt;, this tells Xen to enable it&#039;s unix socket. This is needed by management tools like &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[virsh]]&amp;lt;/span&amp;gt;.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xend-relocation-server&amp;lt;/span&amp;gt;; When set to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;yes&amp;lt;/span&amp;gt;, this tells Xen to allow the migration of [[VM]]s.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xend-relocation-port&amp;lt;/span&amp;gt;; This controls what [[TCP]] port that Xen listens for migration requests.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xend-relocation-address&amp;lt;/span&amp;gt;; This is an IP address or resolvable name that must match an IP address of an interface on the local machine. This binds Xen&#039;s migration to the given interface. If set to just &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;amp;#39;&amp;amp;#39;&amp;lt;/span&amp;gt;, Xen will listen for connections on all interfaces.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xend-relocation-hosts-allow&amp;lt;/span&amp;gt;; This is a space-separated list of host names, IP addresses and regular expressions of hosts that are allowed to be migration sources and targets. Some examples are; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04 an-node05 ^192\.168\.*$&amp;lt;/span&amp;gt;. If set to just &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;amp;#39;&amp;amp;#39;&amp;lt;/span&amp;gt;, Xen will allow migration to or from all nodes on the network. As we&#039;ve already restricted migrate to the &#039;&#039;&#039;BCN&#039;&#039;&#039; by way of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xend-relocation-address &#039;an-node04.bcn&#039;&amp;lt;/span&amp;gt;, it&#039;s save to leave this open to any host.&lt;br /&gt;
&lt;br /&gt;
{{note|1=Be sure that you set &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xend-relocation-address&amp;lt;/span&amp;gt; is set uniquely for each node.}}&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;diff&amp;lt;/span&amp;gt; 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;
diff -u /etc/xen/xend-config.sxp.orig /etc/xen/xend-config.sxp&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;diff&amp;quot;&amp;gt;&lt;br /&gt;
--- /etc/xen/xend-config.sxp.orig	2011-05-02 15:52:27.000000000 -0400&lt;br /&gt;
+++ /etc/xen/xend-config.sxp	2011-05-02 16:01:33.000000000 -0400&lt;br /&gt;
@@ -19,6 +19,7 @@&lt;br /&gt;
 #(xend-tcp-xmlrpc-server no)&lt;br /&gt;
 #(xend-unix-xmlrpc-server yes)&lt;br /&gt;
 #(xend-relocation-server no)&lt;br /&gt;
+(xend-relocation-server yes)&lt;br /&gt;
 # The relocation server should be kept desactivated unless using a trusted&lt;br /&gt;
 # network, the domain virtual memory will be exchanged in raw form without&lt;br /&gt;
 # encryption of the communication. See also xend-relocation-hosts-allow option&lt;br /&gt;
@@ -31,6 +32,7 @@&lt;br /&gt;
 # Port xend should use for the relocation interface, if xend-relocation-server&lt;br /&gt;
 # is set.&lt;br /&gt;
 #(xend-relocation-port 8002)&lt;br /&gt;
+(xend-relocation-port 8002)&lt;br /&gt;
 &lt;br /&gt;
 # Address xend should listen on for HTTP connections, if xend-http-server is&lt;br /&gt;
 # set.&lt;br /&gt;
@@ -45,6 +47,7 @@&lt;br /&gt;
 # Also, interface name is allowed (e.g. eth0) there to get the&lt;br /&gt;
 # relocation address to be bound on.&lt;br /&gt;
 #(xend-relocation-address &#039;&#039;)&lt;br /&gt;
+(xend-relocation-address &#039;an-node04.bcn&#039;)&lt;br /&gt;
 &lt;br /&gt;
 # The hosts allowed to talk to the relocation port.  If this is empty (the&lt;br /&gt;
 # default), then all connections are allowed (assuming that the connection&lt;br /&gt;
@@ -57,8 +60,8 @@&lt;br /&gt;
 # For example:&lt;br /&gt;
 #  (xend-relocation-hosts-allow &#039;^localhost$ ^.*\.example\.org$&#039;)&lt;br /&gt;
 #&lt;br /&gt;
-#(xend-relocation-hosts-allow &#039;&#039;)&lt;br /&gt;
-(xend-relocation-hosts-allow &#039;^localhost$ ^localhost\\.localdomain$&#039;)&lt;br /&gt;
+(xend-relocation-hosts-allow &#039;&#039;)&lt;br /&gt;
+#(xend-relocation-hosts-allow &#039;^localhost$ ^localhost\\.localdomain$&#039;)&lt;br /&gt;
 &lt;br /&gt;
 # The limit (in kilobytes) on the size of the console buffer&lt;br /&gt;
 #(console-limit 1024)&lt;br /&gt;
@@ -90,7 +93,8 @@&lt;br /&gt;
 # two fake interfaces per guest domain.  To do things like this, write&lt;br /&gt;
 # yourself a wrapper script, and call network-bridge from it, as appropriate.&lt;br /&gt;
 #&lt;br /&gt;
-(network-script network-bridge)&lt;br /&gt;
+#(network-script network-bridge)&lt;br /&gt;
+(network-script /bin/true)&lt;br /&gt;
 &lt;br /&gt;
 # The script used to control virtual interfaces.  This can be overridden on a&lt;br /&gt;
 # per-vif basis when creating a domain or a configuring a new vif.  The&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Make the changes take effect by (re)starting &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;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
restart xend:                                              [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Cluster Setup =&lt;br /&gt;
&lt;br /&gt;
In [[Red Hat]] Cluster Services, the heart of the cluster is found in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[RHCS v2 cluster.conf|/etc/cluster/cluster.conf]]&amp;lt;/span&amp;gt; [[XML]] configuration file.&lt;br /&gt;
&lt;br /&gt;
There are three main ways of editing this file. Two are already well documented, so I won&#039;t bother discussing them, beyond introducing them. The third way is by directly hand-crafting the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cluster.conf&amp;lt;/span&amp;gt; file. This method is not very well documented, and directly manipulating configuration files is my preferred method. As my boss loves to say; &amp;quot;&#039;&#039;The more computers do for you, the more they do to you&#039;&#039;&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
The first two, well documented, graphical tools are:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[http://docs.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/5/html/Cluster_Administration/ch-config-scc-CA.html system-config-cluster]&amp;lt;/span&amp;gt;, older GUI tool run directly from one of the cluster nodes.&lt;br /&gt;
* [http://docs.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/5/html/Cluster_Administration/ch-config-conga-CA.html Conga], comprised of the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ricci&amp;lt;/span&amp;gt; node-side client and the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;luci&amp;lt;/span&amp;gt; web-based server (can be run on machines outside the cluster).&lt;br /&gt;
&lt;br /&gt;
I do like the tools above, but I often find issues that send me back to the command line. I&#039;d recommend setting them aside for now as well. Once you feel comfortable with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cluster.conf&amp;lt;/span&amp;gt; syntax, then by all means, go back and use them. I&#039;d recommend not relying on them though, which might be the case if you try to use them too early in your studies.&lt;br /&gt;
&lt;br /&gt;
== The First cluster.conf Foundation Configuration ==&lt;br /&gt;
&lt;br /&gt;
The very first stage of building the cluster is to create a configuration file that is as minimal as possible. To do that, we need to define a few thing;&lt;br /&gt;
&lt;br /&gt;
* The name of the cluster and the cluster file version.&lt;br /&gt;
** Define &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt; options&lt;br /&gt;
** The nodes in the cluster&lt;br /&gt;
*** The fence method for each node&lt;br /&gt;
** Define fence devices&lt;br /&gt;
** Define &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fenced&amp;lt;/span&amp;gt; options&lt;br /&gt;
&lt;br /&gt;
That&#039;s it. Once we&#039;ve defined this minimal amount, we will be able to start the cluster for the first time! So lets get to it, finally.&lt;br /&gt;
&lt;br /&gt;
=== Name the Cluster and Set The Configuration Version ===&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[RHCS_v2_cluster.conf#cluster.3B_The_Parent_Tag|cluster]]&amp;lt;/span&amp;gt; tag is the parent tag for the entire cluster configuration file.&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-cluster01&amp;quot; config_version=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/cluster&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This has two attributes that we need to set are &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;name=&amp;quot;&amp;quot;&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;config_version=&amp;quot;&amp;quot;&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[RHCS v2 cluster.conf#name|name]]=&amp;quot;&amp;quot;&amp;lt;/span&amp;gt; attribute defines the name of the cluster. It must be unique amongst the clusters on your network. It should be descriptive, but you will not want to make it too long, either. You will see this name in the various cluster tools and you will enter in, for example, when creating a [[GFS2]] partition later on. This tutorial uses the cluster name &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an_cluster&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[RHCS v2 cluster.conf#config_version|config_version]]=&amp;quot;&amp;quot;&amp;lt;/span&amp;gt; attribute is an integer marking the version of the configuration file. Whenever you make a change to the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cluster.conf&amp;lt;/span&amp;gt; file, you will need to increment this version number by 1. If you don&#039;t increment this number, then the cluster tools will not know that the file needs to be reloaded. As this is the first version of this configuration file, it will start with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt;. Note that this tutorial will increment the version after every change, regardless of whether it is explicitly pushed out to the other nodes and reloaded. The reason is to help get into the habit of always increasing this value.&lt;br /&gt;
&lt;br /&gt;
=== Configuring cman Options ===&lt;br /&gt;
&lt;br /&gt;
We are going to setup a special case for our cluster; A 2-Node cluster.&lt;br /&gt;
&lt;br /&gt;
This is a special case because traditional quorum will not be useful. With only two nodes, each having a vote of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt;, the total votes is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;2&amp;lt;/span&amp;gt;. Quorum needs &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;50% + 1&amp;lt;/span&amp;gt;, which means that a single node failure would shut down the cluster, as the remaining node&#039;s vote is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;50%&amp;lt;/span&amp;gt; exactly. That kind of defeats the purpose to having a cluster at all.&lt;br /&gt;
&lt;br /&gt;
So to account for this special case, there is a special attribute called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[RHCS_v2_cluster.conf#two_node|two_node]]=&amp;quot;1&amp;quot;&amp;lt;/span&amp;gt;. This tells the cluster manager to continue operating with only one vote. This option requires that the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[RHCS_v2_cluster.conf#expected_votes|expected_votes]]=&amp;quot;&amp;quot;&amp;lt;/span&amp;gt; attribute be set to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt;. Normally, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;expected_votes&amp;lt;/span&amp;gt; is set automatically to the total sum of the defined cluster nodes&#039; votes (which itself is a default of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt;). This is the other half of the &amp;quot;trick&amp;quot;, as a single node&#039;s vote of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt; now always provides quorum (that is, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt; meets the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;50% + 1&amp;lt;/span&amp;gt; requirement).&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-cluster01&amp;quot; config_version=&amp;quot;2&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;cman expected_votes=&amp;quot;1&amp;quot; two_node=&amp;quot;1&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/cluster&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Take note of the self-closing &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;... /&amp;gt;&amp;lt;/span&amp;gt; tag. This is an [[XML]] syntax that tells the parser not to look for any child or a closing tags.&lt;br /&gt;
&lt;br /&gt;
=== Defining Cluster Nodes ===&lt;br /&gt;
&lt;br /&gt;
This example is a little artificial, please don&#039;t load it into your cluster as we will need to add a few child tags, but one thing at a time.&lt;br /&gt;
&lt;br /&gt;
This actually introduces two tags.&lt;br /&gt;
&lt;br /&gt;
The first is parent &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[RHCS_v2_cluster.conf#clusternodes.3B_Defining_Cluster_Nodes|clusternodes]]&amp;lt;/span&amp;gt; tag, which takes no variables of it&#039;s own. It&#039;s sole purpose is to contain the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[RHCS_v2_cluster.conf#Tag.3B_clusternode|clusternode]]&amp;lt;/span&amp;gt; child tags. &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-cluster01&amp;quot; config_version=&amp;quot;3&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;cman expected_votes=&amp;quot;1&amp;quot; two_node=&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-node04.alteeve.com&amp;quot; nodeid=&amp;quot;1&amp;quot; /&amp;gt;&lt;br /&gt;
		&amp;lt;clusternode name=&amp;quot;an-node05.alteeve.com&amp;quot; nodeid=&amp;quot;2&amp;quot; /&amp;gt;&lt;br /&gt;
	&amp;lt;/clusternodes&amp;gt;&lt;br /&gt;
&amp;lt;/cluster&amp;gt;&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;[[RHCS_v2_cluster.conf#Tag.3B_clusternode|clusternode]]&amp;lt;/span&amp;gt; tag defines each cluster node. There are many attributes available, but we will look at just the two required ones. &lt;br /&gt;
&lt;br /&gt;
The first is the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[RHCS_v2_cluster.conf#clusternode.27s_name_attribute|name]]=&amp;quot;&amp;quot;&amp;lt;/span&amp;gt; attribute. This &#039;&#039;&#039;should&#039;&#039;&#039; match the name given by &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;uname -n&amp;lt;/span&amp;gt; (&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;$HOSTNAME&amp;lt;/span&amp;gt;) when run on each node. The [[IP]] address that the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;name&amp;lt;/span&amp;gt; resolves to also sets the interface and subnet that the [[totem]] ring will run on. That is, the main cluster communications, which we are calling the &#039;&#039;&#039;Back-Channel Network&#039;&#039;&#039;. This is why it is so important to setup our &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[Red_Hat_Cluster_Service_2_Tutorial#Setup_.2Fetc.2Fhosts|/etc/hosts]]&amp;lt;/span&amp;gt; file correctly. Please see the [[RHCS_v2_cluster.conf#clusternode.27s_name_attribute|clusternode&#039;s name]] attribute document for details on how name to interface mapping is resolved.&lt;br /&gt;
&lt;br /&gt;
The second attribute is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[RHCS_v2_cluster.conf#clusternode.27s_nodeid_attribute|nodeid]]=&amp;quot;&amp;quot;&amp;lt;/span&amp;gt;. This must be a unique integer amongst the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;clusternode ...&amp;gt;&amp;lt;/span&amp;gt; tags. It is used by the cluster to identify the node.&lt;br /&gt;
&lt;br /&gt;
=== Defining Fence Devices ===&lt;br /&gt;
&lt;br /&gt;
[[Red_Hat_Cluster_Service_2_Tutorial#Concept.3B_Fencing|Fencing]] devices are designed to forcible eject a node from a cluster. This is done by forcing it to power off or reboot, generally. Some [[SAN]] switches can logically disconnect a node from the shared storage device, which has the same effect of guaranteeing that the defective node can not alter the shared storage. A common, third type of fence device is one that cuts the mains power to the server.&lt;br /&gt;
&lt;br /&gt;
All fence devices are contained withing the parent &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[RHCS_v2_cluster.conf#fencedevices.3B_Defining_Fence_Devices|fencedevices]]&amp;lt;/span&amp;gt; tag. This parent tag has no attributes. Within this parent tag are one or more &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[RHCS_v2_cluster.conf#Tag.3B_fencedevice|fencedevice]]&amp;lt;/span&amp;gt; child tags.&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-cluster01&amp;quot; config_version=&amp;quot;4&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;cman expected_votes=&amp;quot;1&amp;quot; two_node=&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-node04.alteeve.com&amp;quot; nodeid=&amp;quot;1&amp;quot; /&amp;gt;&lt;br /&gt;
		&amp;lt;clusternode name=&amp;quot;an-node05.alteeve.com&amp;quot; nodeid=&amp;quot;2&amp;quot; /&amp;gt;&lt;br /&gt;
	&amp;lt;/clusternodes&amp;gt;&lt;br /&gt;
	&amp;lt;fencedevices&amp;gt;&lt;br /&gt;
		&amp;lt;fencedevice agent=&amp;quot;fence_na&amp;quot; ipaddr=&amp;quot;fence_na01.alteeve.com&amp;quot; login=&amp;quot;admin&amp;quot; name=&amp;quot;fence_na01&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;
Every fence device used in your cluster will have it&#039;s own &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[RHCS_v2_cluster.conf#Tag.3B_fencedevice|fencedevice]]&amp;lt;/span&amp;gt; tag. If you are using [[IPMI]], this means you will have a &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fencedevice&amp;lt;/span&amp;gt; entry for each node, as each physical IPMI [[BMC]] is a unique fence device.&lt;br /&gt;
&lt;br /&gt;
All &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fencedevice&amp;lt;/span&amp;gt; tags share two basic attributes; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[RHCS_v2_cluster.conf#fencedevice.27s_name_attribute|name]]=&amp;quot;&amp;quot;&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[RHCS_v2_cluster.conf#fencedevice.27s_agent_attribute|agent]]=&amp;quot;&amp;quot;&amp;lt;/span&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
* The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;name&amp;lt;/span&amp;gt; attribute must be unique among all the fence devices in your cluster. As we will see in the next step, this name will be used within the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;clusternode...&amp;gt;&amp;lt;/span&amp;gt; tag. &lt;br /&gt;
* The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;agent&amp;lt;/span&amp;gt; tag tells the cluster which [[fence agent]] to use when the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[fenced]]&amp;lt;/span&amp;gt; daemon needs to communicate with the physical fence device. A fence agent is simple a shell script that acts as a glue layer between the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fenced&amp;lt;/span&amp;gt; daemon and the fence hardware. This agent takes the arguments from the daemon, like what port to act on and what action to take, and executes the node. The agent is responsible for ensuring that the execution succeeded and returning an appropriate success or failure exit code, depending. For those curious, the full details are described in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[http://sources.redhat.com/cluster/wiki/FenceAgentAPI FenceAgentAPI]&amp;lt;/span&amp;gt;. If you have two or more of the same fence device, like IPMI, then you will use the same fence &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;agent&amp;lt;/span&amp;gt; value a corresponding number of times.&lt;br /&gt;
&lt;br /&gt;
Beyond these two attributes, each fence agent will have it&#039;s own subset of attributes. The scope of which is outside this tutorial, though we will see examples for IPMI, a switched PDU and a [[Node Assassin]]. Most, if not all, fence agents have a corresponding man page that will show you what attributes it accepts and how they are used. The two fence agents we will see here have their attributes defines in the following &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[man]]&amp;lt;/span&amp;gt; pages.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;man fence_na&amp;lt;/span&amp;gt; - Node Assassin fence agent&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;man fence_ipmilan&amp;lt;/span&amp;gt; - IPMI fence agent&lt;br /&gt;
&lt;br /&gt;
The example above is what this tutorial will use.&lt;br /&gt;
&lt;br /&gt;
==== Example &amp;lt;fencedevice...&amp;gt; Tag For Node Assassin ====&lt;br /&gt;
&lt;br /&gt;
This is the device used throughout this tutorial. It is for the open source, open hardware [[Node Assassin]] fence device that you can build yourself.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;fencedevices&amp;gt;&lt;br /&gt;
		&amp;lt;fencedevice agent=&amp;quot;fence_na&amp;quot; ipaddr=&amp;quot;fence_na01.alteeve.com&amp;quot; login=&amp;quot;admin&amp;quot; name=&amp;quot;fence_na01&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;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Being a network-attached fence device, as most fence devices are, the attributes for &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fence_na&amp;lt;/span&amp;gt; include connection information. The attribute variable names are generally the same across fence agents, and they are:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ipaddr&amp;lt;/span&amp;gt;; This is the resolvable name or [[IP]] address of the device. If you use a resolvable name, it is strongly advised that you put the name in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/hosts&amp;lt;/span&amp;gt; as [[DNS]] is another layer of abstraction which could fail.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;login&amp;lt;/span&amp;gt;; This is the login name to use when the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fenced&amp;lt;/span&amp;gt; daemon connects to the device. This is configured in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/cluster/fence_na.conf&amp;lt;/span&amp;gt;.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;passwd&amp;lt;/span&amp;gt;; This is the login password to use when the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fenced&amp;lt;/span&amp;gt; daemon connects to the device. This is also configured in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/cluster/fence_na.conf&amp;lt;/span&amp;gt;.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;name&amp;lt;/span&amp;gt;; This is the name of this particular fence device within the cluster which, as we will see shortly, is matched in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;clusternode...&amp;gt;&amp;lt;/span&amp;gt; element where appropriate.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;quiet&amp;lt;/span&amp;gt;; This is a Node Assassin specific argument. It is used to generate no output to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[STDOUT]]&amp;lt;/span&amp;gt; when run, as there is no terminal to print to or user to view it.&lt;br /&gt;
&lt;br /&gt;
==== Example &amp;lt;fencedevice...&amp;gt; Tag For IPMI ====&lt;br /&gt;
&lt;br /&gt;
Here we will show what [[IPMI]] &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;fencedevice...&amp;gt;&amp;lt;/span&amp;gt; tags look like. We won&#039;t be using it ourselves, but it is quite popular as a fence device so I wanted to show an example of it&#039;s use.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;fencedevices&amp;gt;&lt;br /&gt;
		&amp;lt;fencedevice name=&amp;quot;an01_ipmi&amp;quot; agent=&amp;quot;fence_ipmilan&amp;quot; ipaddr=&amp;quot;192.168.4.74&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;an02_ipmi&amp;quot; agent=&amp;quot;fence_ipmilan&amp;quot; ipaddr=&amp;quot;192.168.4.75&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;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ipaddr&amp;lt;/span&amp;gt;; This is the resolvable name or [[IP]] address of the device. If you use a resolvable name, it is strongly advised that you put the name in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/hosts&amp;lt;/span&amp;gt; as [[DNS]] is another layer of abstraction which could fail.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;login&amp;lt;/span&amp;gt;; This is the login name to use when the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fenced&amp;lt;/span&amp;gt; daemon connects to the device.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;passwd&amp;lt;/span&amp;gt;; This is the login password to use when the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fenced&amp;lt;/span&amp;gt; daemon connects to the device.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;name&amp;lt;/span&amp;gt;; This is the name of this particular fence device within the cluster which, as we will see shortly, is matched in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;clusternode...&amp;gt;&amp;lt;/span&amp;gt; element where appropriate.&lt;br /&gt;
&lt;br /&gt;
{{note|1=We will see shortly that, unlike switched PDUs, Node Assassin or other network fence devices, [[IPMI]] does not have ports. This is because each [[IPMI]] BMC supports just it&#039;s host system. More on that later.}}&lt;br /&gt;
&lt;br /&gt;
==== Example &amp;lt;fencedevice...&amp;gt; Tag For HP&#039;s iLO ====&lt;br /&gt;
&lt;br /&gt;
Getting [[iLO]] to work in the cluster is a little trickier as the [[RPM]]s used to enable iLO must be downloaded from [[HP]]&#039;s website and manually installed. There is a &amp;quot;quickie&amp;quot; tutorial that covers getting iLO working on [[EL5]] below.&lt;br /&gt;
&lt;br /&gt;
* [[Configuring HP iLO 2 on EL5]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;fencedevices&amp;gt;&lt;br /&gt;
		&amp;lt;fencedevice name=&amp;quot;an01_ilo&amp;quot; agent=&amp;quot;fence_ilo&amp;quot; ipaddr=&amp;quot;192.168.4.74&amp;quot; login=&amp;quot;Administrator&amp;quot; passwd=&amp;quot;secret&amp;quot; /&amp;gt;&lt;br /&gt;
		&amp;lt;fencedevice name=&amp;quot;an02_ilo&amp;quot; agent=&amp;quot;fence_ilo&amp;quot; ipaddr=&amp;quot;192.168.4.75&amp;quot; login=&amp;quot;Administrator&amp;quot; passwd=&amp;quot;secret&amp;quot; /&amp;gt;&lt;br /&gt;
	&amp;lt;/fencedevices&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Example &amp;lt;fencedevice...&amp;gt; Tag For APC Switched PDUs ====&lt;br /&gt;
&lt;br /&gt;
Here we will show how to configure APC switched [[PDU]] &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;fencedevice...&amp;gt;&amp;lt;/span&amp;gt; tags. We won&#039;t be using it in this tutorial, but in the real world, it is &#039;&#039;&#039;highly&#039;&#039;&#039; recommended as a backup fence device for [[IPMI]] and similar primary fence devices.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
	...&lt;br /&gt;
		&amp;lt;fence&amp;gt;&lt;br /&gt;
			&amp;lt;method name=&amp;quot;pdu&amp;quot;&amp;gt;&lt;br /&gt;
				&amp;lt;device name=&amp;quot;pdu001&amp;quot; action=&amp;quot;reboot&amp;quot; port=&amp;quot;1&amp;quot;/&amp;gt;&lt;br /&gt;
			&amp;lt;/method&amp;gt;&lt;br /&gt;
		&amp;lt;/fence&amp;gt;&lt;br /&gt;
	...&lt;br /&gt;
	&amp;lt;fencedevices&amp;gt;&lt;br /&gt;
		&amp;lt;fencedevice name=&amp;quot;pdu001&amp;quot; agent=&amp;quot;fence_apc&amp;quot; ipaddr=&amp;quot;192.168.3.6&amp;quot; login=&amp;quot;apc&amp;quot; passwd=&amp;quot;secret&amp;quot;/&amp;gt;&lt;br /&gt;
	&amp;lt;/fencedevices&amp;gt;&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;ipaddr&amp;lt;/span&amp;gt;; This is the resolvable name or [[IP]] address of the device. If you use a resolvable name, it is strongly advised that you put the name in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/hosts&amp;lt;/span&amp;gt; as [[DNS]] is another layer of abstraction which could fail.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;login&amp;lt;/span&amp;gt;; This is the login name to use when the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fenced&amp;lt;/span&amp;gt; daemon connects to the device.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;passwd&amp;lt;/span&amp;gt;; This is the login password to use when the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fenced&amp;lt;/span&amp;gt; daemon connects to the device.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;name&amp;lt;/span&amp;gt;; This is the name of this particular fence device within the cluster which, as we will see shortly, is matched in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;clusternode...&amp;gt;&amp;lt;/span&amp;gt; element where appropriate.&lt;br /&gt;
&lt;br /&gt;
=== Using the Fence Devices ===&lt;br /&gt;
&lt;br /&gt;
Now we have nodes and fence devices defined, we will go back and tie them together. This is done by:&lt;br /&gt;
* Defining a &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[RHCS_v2_cluster.conf#Tag.3B_fence|fence]]&amp;lt;/span&amp;gt; tag containing all fence methods and devices.&lt;br /&gt;
** Defining one or more &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[RHCS_v2_cluster.conf#Tag.3B_method|method]]&amp;lt;/span&amp;gt; tag(s) containing the device call(s) needed for each fence attempt.&lt;br /&gt;
*** Defining one or more &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[RHCS_v2_cluster.conf#Tag.3B_device|device]]&amp;lt;/span&amp;gt; tag(s) containing attributes describing how to call the fence device to kill this node.&lt;br /&gt;
&lt;br /&gt;
This tutorial will be using just a [[Node Assassin]] fence device. We&#039;ll look at an example adding [[IPMI]] in a moment though, as IPMI is a very common fence device and one you will very likely use.&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-cluster01&amp;quot; config_version=&amp;quot;5&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;cman expected_votes=&amp;quot;1&amp;quot; two_node=&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-node04.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;fence_na01&amp;quot; port=&amp;quot;04&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-node05.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;fence_na01&amp;quot; port=&amp;quot;03&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_na01&amp;quot; agent=&amp;quot;fence_na&amp;quot; ipaddr=&amp;quot;fence_na01.alteeve.com&amp;quot; login=&amp;quot;admin&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;
{{note|1=You might note that the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05.alteeve.com&amp;lt;/span&amp;gt; has it&#039;s fence port set to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;03&amp;lt;/span&amp;gt;. In my case, I fried my second Node Assassin during testing and didn&#039;t get a chance to replace it. So instead I plugged it into port &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;03&amp;lt;/span&amp;gt;, which, conveniently, also helps illustrate that the port numbers do not need to relate in any way to the node names. This is probably self-evident, I do admit.}}&lt;br /&gt;
&lt;br /&gt;
First, notice that the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[RHCS_v2_cluster.conf#Tag.3B_fence|fence]]&amp;lt;/span&amp;gt; tag has no attributes. It&#039;s merely a container for the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[RHCS_v2_cluster.conf#Tag.3B_method|method]](s)&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The next level is the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[RHCS_v2_cluster.conf#Tag.3B_method|method]]&amp;lt;/span&amp;gt; named &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;node_assassin&amp;lt;/span&amp;gt;. This name is merely a description and can be whatever you feel is most appropriate. It&#039;s purpose is simply to help you distinguish this method from other methods. The reason for &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;method&amp;lt;/span&amp;gt; tags is that some fence device calls will have two or more steps. A classic example would be a node with a redundant power supply on a switch PDU acting as the fence device. In such a case, you will need to define multiple &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[RHCS_v2_cluster.conf#Tag.3B_device|device]]&amp;lt;/span&amp;gt; tags, one for each power cable feeding the node. In such a case, the cluster will not consider the fence a success unless and until all contained &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[RHCS_v2_cluster.conf#Tag.3B_device|device]]&amp;lt;/span&amp;gt; calls execute successfully.&lt;br /&gt;
&lt;br /&gt;
The actual fence &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[RHCS_v2_cluster.conf#Tag.3B_device|device]]&amp;lt;/span&amp;gt; configuration is the final piece of the puzzle. It is here that you specify per-node configuration options and link these attributes to a given &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[RHCS_v2_cluster.conf#Tag.3B_fencedevice|fencedevice]]&amp;lt;/span&amp;gt;. Here, we see the link to the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fencedevice&amp;lt;/span&amp;gt; via the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[RHCS_v2_cluster.conf#device.27s_name_attribute|name]]&amp;lt;/span&amp;gt;, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fence_na01&amp;lt;/span&amp;gt; in this example.&lt;br /&gt;
&lt;br /&gt;
Let&#039;s step through an example fence call to help show how the per-cluster and fence device attributes are combined during a fence call.&lt;br /&gt;
&lt;br /&gt;
* The cluster manager decides that a node needs to be fenced. Let&#039;s say that the victim is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt;.&lt;br /&gt;
* The first &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;method&amp;lt;/span&amp;gt; in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fence&amp;lt;/span&amp;gt; section under &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt; is consulted. Within it there is just one &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;device&amp;lt;/span&amp;gt;, named &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fence_na01&amp;lt;/span&amp;gt; and having two attributes;&lt;br /&gt;
** &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;port&amp;lt;/span&amp;gt;; This tells the cluster that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt; is connected to the Node Assassin&#039;s port number &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;03&amp;lt;/span&amp;gt;.&lt;br /&gt;
** &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;action&amp;lt;/span&amp;gt;; This tells the cluster that the fence action to take is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;reboot&amp;lt;/span&amp;gt;. How this action is actually interpreted depends on the fence device in use, though the name certainly implies that the node will be forced off and then restarted.&lt;br /&gt;
* The cluster searches in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fencedevices&amp;lt;/span&amp;gt; for a &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fencedevice&amp;lt;/span&amp;gt; matching the name &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fence_na01&amp;lt;/span&amp;gt;. This fence device has five attributes; &lt;br /&gt;
** &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;agent&amp;lt;/span&amp;gt;; This tells the cluster to call the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fence_na&amp;lt;/span&amp;gt; fence agent script, as we discussed earlier.&lt;br /&gt;
** &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ipaddr&amp;lt;/span&amp;gt;; This tells the fence agent where on the network to find this particular Node Assassin. This is how multiple fence devices of the same type can be used in the cluster.&lt;br /&gt;
** &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;login&amp;lt;/span&amp;gt;; This is the login user name to use when authenticating against the fence device.&lt;br /&gt;
** &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;passwd&amp;lt;/span&amp;gt;; This is the password to supply along with the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;login&amp;lt;/span&amp;gt; name when authenticating against the fence device.&lt;br /&gt;
** &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;quiet&amp;lt;/span&amp;gt;; This is a device-specific argument that Node Assassin uses (see &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;man fence_na&amp;lt;/span&amp;gt; for details).&lt;br /&gt;
* With this information collected and compiled, the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fenced&amp;lt;/span&amp;gt; daemon will call the fence agent and pass it the attribute &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;variable=value&amp;lt;/span&amp;gt; pairs, one per line. Thus, the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fenced&amp;lt;/span&amp;gt; daemon will call:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/usr/sbin/fence_na&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then it will pass to that agent the following arguments:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
ipaddr=fence_na01.alteeve.com&lt;br /&gt;
login=admin&lt;br /&gt;
passwd=secret&lt;br /&gt;
quiet=1&lt;br /&gt;
port=02&lt;br /&gt;
action=reboot&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As you can see then, the first four arguments are from the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fencedevice&amp;lt;/span&amp;gt; attributes and the last two are from the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;device&amp;lt;/span&amp;gt; attributes under &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt;&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clusternode&amp;lt;/span&amp;gt;&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fence&amp;lt;/span&amp;gt; tag. &lt;br /&gt;
&lt;br /&gt;
When you have two or more &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;method&amp;lt;/span&amp;gt; tags defined, then the first in the list will be tried. If any of it&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;device&amp;lt;/span&amp;gt; tags fail, then the method is considered to have failed and the next method is consulted. This will repeat until all &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;method&amp;lt;/span&amp;gt; entries have been tried. At that point, the cluster goes back to the first &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;method&amp;lt;/span&amp;gt; and tries again, repeating the walk through of all methods. This loop will continue until one &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;method&amp;lt;/span&amp;gt; succeeds, regardless of how long that might take.&lt;br /&gt;
&lt;br /&gt;
==== An Example Showing IPMI&#039;s Use ====&lt;br /&gt;
&lt;br /&gt;
This is a full configuration file showing what it would look like if we were using [[IPMI]] and a [[Node Assassin]] for redundant fencing.&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-cluster01&amp;quot; config_version=&amp;quot;6&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;cman expected_votes=&amp;quot;1&amp;quot; two_node=&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-node04.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;fence_na01&amp;quot; port=&amp;quot;04&amp;quot; action=&amp;quot;reboot&amp;quot;/&amp;gt;&lt;br /&gt;
				&amp;lt;/method&amp;gt;&lt;br /&gt;
				&amp;lt;method name=&amp;quot;an-node04_ipmi&amp;quot;&amp;gt;&lt;br /&gt;
					&amp;lt;device name=&amp;quot;an01_ipmi&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-node05.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;fence_na01&amp;quot; port=&amp;quot;03&amp;quot; action=&amp;quot;reboot&amp;quot;/&amp;gt;&lt;br /&gt;
				&amp;lt;/method&amp;gt;&lt;br /&gt;
				&amp;lt;method name=&amp;quot;an-node05_ipmi&amp;quot;&amp;gt;&lt;br /&gt;
					&amp;lt;device name=&amp;quot;an02_ipmi&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_na01&amp;quot; agent=&amp;quot;fence_na&amp;quot; ipaddr=&amp;quot;fence_na01.alteeve.com&amp;quot; login=&amp;quot;admin&amp;quot; passwd=&amp;quot;secret&amp;quot; quiet=&amp;quot;1&amp;quot;/&amp;gt;&lt;br /&gt;
		&amp;lt;fencedevice name=&amp;quot;an01_ipmi&amp;quot; agent=&amp;quot;fence_ipmilan&amp;quot; ipaddr=&amp;quot;192.168.4.74&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;an02_ipmi&amp;quot; agent=&amp;quot;fence_ipmilan&amp;quot; ipaddr=&amp;quot;192.168.4.75&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;
We now see three elements in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fencedevices&amp;lt;/span&amp;gt;. The first is the original Node Assassin entry plus two [[IPMI]] entries, one for each node in the cluster. As we touched on earlier, this is because each node has it&#039;s own IPMI [[BMC]]. In the same vein, we also now see that the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;device&amp;lt;/span&amp;gt; entries in each node&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;method&amp;lt;/span&amp;gt; element have no &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;port&amp;lt;/span&amp;gt; setting.&lt;br /&gt;
&lt;br /&gt;
Notice that the Node Assassin&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;method&amp;lt;/span&amp;gt; is above the IPMI &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;method&amp;lt;/span&amp;gt;. This means that the Node Assassin is the primary fence device and the IPMI is the secondary. When deciding which order to assign the fence devices, consider the device&#039;s potential for failure and how that might effect cluster recovery time. For example, many IPMI BMCs rely on the node&#039;s power supply to operate. Thus, if the node&#039;s power supply fails and the IPMI is the first fence device, then recovery will be delayed as the cluster will try, and then wait until it times out, before moving on to the networked fence device, Node Assassin in this instance.&lt;br /&gt;
&lt;br /&gt;
=== Give Nodes More Time To Start ===&lt;br /&gt;
&lt;br /&gt;
Clusters with more than three nodes will have to gain quorum before they can fence other nodes. As we saw earlier though, this is not really the case when using the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[RHCS_v2_cluster.conf#two_node|two_node]]=&amp;quot;1&amp;quot;&amp;lt;/span&amp;gt; attribute in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[RHCS_v2_cluster.conf#cman.3B_The_Cluster_Manager|cman]]&amp;lt;/span&amp;gt; tag. What this means in practice is that if you start the cluster on one node and then wait too long to start the cluster on the second node, the first will fence the second.&lt;br /&gt;
&lt;br /&gt;
The logic behind this is; When the cluster starts, it will try to talk to it&#039;s fellow node and then fail. With the special &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;two_node=&amp;quot;1&amp;quot;&amp;lt;/span&amp;gt; attribute set, the cluster knows that it is allowed to start clustered services, but it has no way to say for sure what state the other node is in. It could well be online and hosting services for all it knows. So it has to proceed on the assumption that the other node is alive and using shared resources. Given that, and given that it can not talk to the other node, it&#039;s only safe option is to fence the other node. Only then can it be confident that it is safe to start providing clustered services.&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-cluster01&amp;quot; config_version=&amp;quot;7&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;cman expected_votes=&amp;quot;1&amp;quot; two_node=&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-node04.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;fence_na01&amp;quot; port=&amp;quot;04&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-node05.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;fence_na01&amp;quot; port=&amp;quot;03&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_na01&amp;quot; agent=&amp;quot;fence_na&amp;quot; ipaddr=&amp;quot;fence_na01.alteeve.com&amp;quot; login=&amp;quot;admin&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;fence_daemon post_join_delay=&amp;quot;60&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/cluster&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The new tag is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[RHCS_v2_cluster.conf#fence_daemon.3B_Fencing|fence_daemon]]&amp;lt;/span&amp;gt;, seen near the bottom if the file above. The change is made using the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[RHCS_v2_cluster.conf#post_join_delay|post_join_delay]]=&amp;quot;60&amp;quot;&amp;lt;/span&amp;gt; attribute. By default, the cluster will declare the other node dead after just &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;6&amp;lt;/span&amp;gt; seconds. The reason is that the larger this value, the slower the start-up of the cluster services will be. During testing and development though, I find this value to be far too short and frequently led to unnecessary fencing. Once your cluster is setup and working, it&#039;s not a bad idea to reduce this value to the lowest value that you are comfortable with.&lt;br /&gt;
&lt;br /&gt;
=== Configuring Totem ===&lt;br /&gt;
&lt;br /&gt;
This is almost a misnomer, as we&#039;re more or less &#039;&#039;not&#039;&#039; configuring the [[totem]] protocol in this cluster.&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-cluster01&amp;quot; config_version=&amp;quot;8&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;cman expected_votes=&amp;quot;1&amp;quot; two_node=&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-node04.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;fence_na01&amp;quot; port=&amp;quot;04&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-node05.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;fence_na01&amp;quot; port=&amp;quot;03&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_na01&amp;quot; agent=&amp;quot;fence_na&amp;quot; ipaddr=&amp;quot;fence_na01.alteeve.com&amp;quot; login=&amp;quot;admin&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;fence_daemon post_join_delay=&amp;quot;60&amp;quot;/&amp;gt;&lt;br /&gt;
        &amp;lt;totem rrp_mode=&amp;quot;none&amp;quot; secauth=&amp;quot;off&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/cluster&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the spirit of &amp;quot;keeping it simple&amp;quot;, we&#039;re not configuring [[redundant ring protocol]] in this cluster. [[RRP]] is an optional second ring that can be used for cluster communication in the case of a break down in the first ring. This is not the simplest option to setup, as recovery must be done manually. However, if you wish to explore it further, please take a look at the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clusternode&amp;lt;/span&amp;gt; element tag called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;[[RHCS_v2_cluster.conf#Tag.3B_altname|altname]]...&amp;gt;&amp;lt;/span&amp;gt;. When &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[altname]]&amp;lt;/span&amp;gt; is used though, then the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[RHCS_v2_cluster.conf#rrp_mode|rrp_mode]]&amp;lt;/span&amp;gt; attribute will need to be changed to either &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;active&amp;lt;/span&amp;gt; or &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;passive&amp;lt;/span&amp;gt; (the details of which are outside the scope of this tutorial).&lt;br /&gt;
&lt;br /&gt;
The second option we&#039;re looking at here is the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[RHCS_v2_cluster.conf#secauth|secauth]]=&amp;quot;off&amp;quot;&amp;lt;/span&amp;gt; attribute. This controls whether the cluster communications are encrypted or not. We can safely disable this because we&#039;re working on a known-private network, which yields two benefits; It&#039;s simpler to setup and it&#039;s a lot faster. If you must encrypt the cluster communications, then you can do so here. The details of which are also outside the scope of this tutorial though.&lt;br /&gt;
&lt;br /&gt;
=== Validating and Pushing the /etc/cluster/cluster.conf File ===&lt;br /&gt;
&lt;br /&gt;
The cluster software validates the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/cluster/cluster.conf&amp;lt;/span&amp;gt; file against &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/usr/share/system-config-cluster/misc/cluster.ng&amp;lt;/span&amp;gt; using the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xmllint&amp;lt;/span&amp;gt; program. If it fails to validate, the cluster will refuse to start.&lt;br /&gt;
&lt;br /&gt;
So now that we&#039;ve got the foundation of our cluster ready, the last step is to validate it. To do so, simply run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
xmllint --relaxng /usr/share/system-config-cluster/misc/cluster.ng /etc/cluster/cluster.conf&lt;br /&gt;
&amp;lt;/source&amp;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-cluster01&amp;quot; config_version=&amp;quot;8&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;cman expected_votes=&amp;quot;1&amp;quot; two_node=&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-node04.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;fence_na01&amp;quot; port=&amp;quot;04&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-node05.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;fence_na01&amp;quot; port=&amp;quot;03&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_na01&amp;quot; agent=&amp;quot;fence_na&amp;quot; ipaddr=&amp;quot;fence_na01.alteeve.com&amp;quot; login=&amp;quot;admin&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;fence_daemon post_join_delay=&amp;quot;60&amp;quot;/&amp;gt;&lt;br /&gt;
        &amp;lt;totem rrp_mode=&amp;quot;none&amp;quot; secauth=&amp;quot;off&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/cluster&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;
/etc/cluster/cluster.conf validates&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If there was a problem, you need to go back and fix it. &#039;&#039;&#039;DO NOT&#039;&#039;&#039; proceed until your configuration validates. Once it does, we&#039;re ready to move on!&lt;br /&gt;
&lt;br /&gt;
With it validated, we need to push it to the other node. As the cluster is not running yet, we will push it out using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rsync&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;
rsync -av /etc/cluster/cluster.conf root@an-node05:/etc/cluster/&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
building file list ... done&lt;br /&gt;
cluster.conf&lt;br /&gt;
&lt;br /&gt;
sent 891 bytes  received 66 bytes  638.00 bytes/sec&lt;br /&gt;
total size is 790  speedup is 0.83&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Starting the Cluster For The First Time =&lt;br /&gt;
&lt;br /&gt;
At this point, we have the foundation of the cluster in place and we can start it up!&lt;br /&gt;
&lt;br /&gt;
== Keeping an Eye on Things ==&lt;br /&gt;
&lt;br /&gt;
I&#039;ve found a layout of four terminal windows, the left ones being 80 columns wide and the right ones filling the rest of the screen, works well. I personally run a &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;tail -f -n 0 /var/log/messages&amp;lt;/span&amp;gt; in the right windows so that I can keep an eye on things.&lt;br /&gt;
&lt;br /&gt;
[[Image:2-node_cluster_terminal_layout_01.png|thumb|center|700px|The terminal layout I use to monitor and operate the two nodes in the cluster.]]&lt;br /&gt;
&lt;br /&gt;
Of course, what you use is entirely up to you, your screen real-estate and your preferences.&lt;br /&gt;
&lt;br /&gt;
== A Note on Timing ==&lt;br /&gt;
&lt;br /&gt;
Remember that you have &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;post_join_delay&amp;lt;/span&amp;gt; seconds to start both nodes, which is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;60&amp;lt;/span&amp;gt; seconds in our configuration. So be sure that you can start the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt; daemon quickly on both nodes. I generally ensure that both terminal windows have the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;start&amp;lt;/span&amp;gt; command typed in, so that I can quickly press &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;enter&amp;gt;&amp;lt;/span&amp;gt; on both nodes. Again, how you do this is entirely up to you.&lt;br /&gt;
&lt;br /&gt;
== All Systems Are Go! ==&lt;br /&gt;
&lt;br /&gt;
Time to 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;
On both nodes, run the following command:&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;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Starting cluster: &lt;br /&gt;
   Loading modules... done&lt;br /&gt;
   Mounting configfs... done&lt;br /&gt;
   Starting ccsd... done&lt;br /&gt;
   Starting cman... done&lt;br /&gt;
   Starting daemons... done&lt;br /&gt;
   Starting fencing... done&lt;br /&gt;
                                                           [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If things went well, you should see something like this in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/var/log/messages&amp;lt;/span&amp;gt; terminal on both nodes:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
May  3 22:33:15 an-node04 ccsd[5319]: Starting ccsd 2.0.115: &lt;br /&gt;
May  3 22:33:15 an-node04 ccsd[5319]:  Built: Apr 28 2011 05:36:14 &lt;br /&gt;
May  3 22:33:15 an-node04 ccsd[5319]:  Copyright (C) Red Hat, Inc.  2004  All rights reserved. &lt;br /&gt;
May  3 22:33:15 an-node04 ccsd[5319]: cluster.conf (cluster name = an-cluster01, version = 8) found. &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [MAIN ] AIS Executive Service RELEASE &#039;subrev 1887 version 0.80.6&#039; &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [MAIN ] Copyright (C) 2002-2006 MontaVista Software, Inc and contributors. &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [MAIN ] Copyright (C) 2006 Red Hat, Inc. &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [MAIN ] AIS Executive Service: started and ready to provide service. &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [MAIN ] Using default multicast address of 239.192.235.77 &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [TOTEM] Token Timeout (10000 ms) retransmit timeout (495 ms) &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [TOTEM] token hold (386 ms) retransmits before loss (20 retrans) &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [TOTEM] join (60 ms) send_join (0 ms) consensus (2000 ms) merge (200 ms) &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [TOTEM] downcheck (1000 ms) fail to recv const (2500 msgs) &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [TOTEM] seqno unchanged const (30 rotations) Maximum network MTU 1402 &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [TOTEM] window size per rotation (50 messages) maximum messages per rotation (17 messages) &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [TOTEM] missed count const (5 messages) &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [TOTEM] send threads (0 threads) &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [TOTEM] RRP token expired timeout (495 ms) &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [TOTEM] RRP token problem counter (2000 ms) &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [TOTEM] RRP threshold (10 problem count) &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [TOTEM] RRP mode set to none. &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [TOTEM] heartbeat_failures_allowed (0) &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [TOTEM] max_network_delay (50 ms) &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [TOTEM] HeartBeat is Disabled. To enable set heartbeat_failures_allowed &amp;gt; 0 &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [TOTEM] Receive multicast socket recv buffer size (262142 bytes). &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [TOTEM] Transmit multicast socket send buffer size (262142 bytes). &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [TOTEM] The network interface [192.168.3.74] is now up. &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [TOTEM] Created or loaded sequence id 8.192.168.3.74 for this ring. &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [TOTEM] entering GATHER state from 15. &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [CMAN ] CMAN 2.0.115 (built Apr 28 2011 05:36:17) started &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [MAIN ] Service initialized &#039;openais CMAN membership service 2.01&#039; &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [SERV ] Service initialized &#039;openais extended virtual synchrony service&#039; &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [SERV ] Service initialized &#039;openais cluster membership service B.01.01&#039; &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [SERV ] Service initialized &#039;openais availability management framework B.01.01&#039; &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [SERV ] Service initialized &#039;openais checkpoint service B.01.01&#039; &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [SERV ] Service initialized &#039;openais event service B.01.01&#039; &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [SERV ] Service initialized &#039;openais distributed locking service B.01.01&#039; &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [SERV ] Service initialized &#039;openais message service B.01.01&#039; &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [SERV ] Service initialized &#039;openais configuration service&#039; &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [SERV ] Service initialized &#039;openais cluster closed process group service v1.01&#039; &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [SERV ] Service initialized &#039;openais cluster config database access v1.01&#039; &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [SYNC ] Not using a virtual synchrony filter. &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [TOTEM] Creating commit token because I am the rep. &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [TOTEM] Saving state aru 0 high seq received 0 &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [TOTEM] Storing new sequence id for ring c &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [TOTEM] entering COMMIT state. &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [TOTEM] entering RECOVERY state. &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [TOTEM] position [0] member 192.168.3.74: &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [TOTEM] previous ring seq 8 rep 192.168.3.74 &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [TOTEM] aru 0 high delivered 0 received flag 1 &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [TOTEM] Did not need to originate any messages in recovery. &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [TOTEM] Sending initial ORF token &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [CLM  ] CLM CONFIGURATION CHANGE &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [CLM  ] New Configuration: &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [CLM  ] Members Left: &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [CLM  ] Members Joined: &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [CLM  ] CLM CONFIGURATION CHANGE &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [CLM  ] New Configuration: &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [CLM  ] 	r(0) ip(192.168.3.74)  &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [CLM  ] Members Left: &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [CLM  ] Members Joined: &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [CLM  ] 	r(0) ip(192.168.3.74)  &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [SYNC ] This node is within the primary component and will provide service. &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [TOTEM] entering OPERATIONAL state. &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [CMAN ] quorum regained, resuming activity &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [CLM  ] got nodejoin message 192.168.3.74 &lt;br /&gt;
May  3 22:33:17 an-node04 ccsd[5319]: Initial status:: Quorate &lt;br /&gt;
May  3 22:33:18 an-node04 openais[5325]: [TOTEM] entering GATHER state from 11. &lt;br /&gt;
May  3 22:33:18 an-node04 openais[5325]: [TOTEM] Creating commit token because I am the rep. &lt;br /&gt;
May  3 22:33:18 an-node04 openais[5325]: [TOTEM] Saving state aru c high seq received c &lt;br /&gt;
May  3 22:33:18 an-node04 openais[5325]: [TOTEM] Storing new sequence id for ring 14 &lt;br /&gt;
May  3 22:33:18 an-node04 openais[5325]: [TOTEM] entering COMMIT state. &lt;br /&gt;
May  3 22:33:18 an-node04 openais[5325]: [TOTEM] entering RECOVERY state. &lt;br /&gt;
May  3 22:33:18 an-node04 openais[5325]: [TOTEM] position [0] member 192.168.3.74: &lt;br /&gt;
May  3 22:33:18 an-node04 openais[5325]: [TOTEM] previous ring seq 12 rep 192.168.3.74 &lt;br /&gt;
May  3 22:33:18 an-node04 openais[5325]: [TOTEM] aru c high delivered c received flag 1 &lt;br /&gt;
May  3 22:33:18 an-node04 openais[5325]: [TOTEM] position [1] member 192.168.3.75: &lt;br /&gt;
May  3 22:33:18 an-node04 openais[5325]: [TOTEM] previous ring seq 16 rep 192.168.3.75 &lt;br /&gt;
May  3 22:33:18 an-node04 openais[5325]: [TOTEM] aru c high delivered c received flag 1 &lt;br /&gt;
May  3 22:33:18 an-node04 openais[5325]: [TOTEM] Did not need to originate any messages in recovery. &lt;br /&gt;
May  3 22:33:18 an-node04 openais[5325]: [TOTEM] Sending initial ORF token &lt;br /&gt;
May  3 22:33:18 an-node04 openais[5325]: [CLM  ] CLM CONFIGURATION CHANGE &lt;br /&gt;
May  3 22:33:18 an-node04 openais[5325]: [CLM  ] New Configuration: &lt;br /&gt;
May  3 22:33:18 an-node04 openais[5325]: [CLM  ] 	r(0) ip(192.168.3.74)  &lt;br /&gt;
May  3 22:33:18 an-node04 openais[5325]: [CLM  ] Members Left: &lt;br /&gt;
May  3 22:33:18 an-node04 openais[5325]: [CLM  ] Members Joined: &lt;br /&gt;
May  3 22:33:18 an-node04 openais[5325]: [CLM  ] CLM CONFIGURATION CHANGE &lt;br /&gt;
May  3 22:33:18 an-node04 openais[5325]: [CLM  ] New Configuration: &lt;br /&gt;
May  3 22:33:18 an-node04 openais[5325]: [CLM  ] 	r(0) ip(192.168.3.74)  &lt;br /&gt;
May  3 22:33:18 an-node04 openais[5325]: [CLM  ] 	r(0) ip(192.168.3.75)  &lt;br /&gt;
May  3 22:33:18 an-node04 openais[5325]: [CLM  ] Members Left: &lt;br /&gt;
May  3 22:33:18 an-node04 openais[5325]: [CLM  ] Members Joined: &lt;br /&gt;
May  3 22:33:18 an-node04 openais[5325]: [CLM  ] 	r(0) ip(192.168.3.75)  &lt;br /&gt;
May  3 22:33:18 an-node04 openais[5325]: [SYNC ] This node is within the primary component and will provide service. &lt;br /&gt;
May  3 22:33:18 an-node04 openais[5325]: [TOTEM] entering OPERATIONAL state. &lt;br /&gt;
May  3 22:33:18 an-node04 openais[5325]: [CLM  ] got nodejoin message 192.168.3.74 &lt;br /&gt;
May  3 22:33:18 an-node04 openais[5325]: [CLM  ] got nodejoin message 192.168.3.75 &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From the node you started &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt; on first, you will see:&lt;br /&gt;
* The cluster configuration system daemon, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ccsd&amp;lt;/span&amp;gt;, starts up and reads in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/cluster/cluster.conf&amp;lt;/span&amp;gt;. It reports the name of the cluster, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-cluster01&amp;lt;/span&amp;gt; and the version, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;8&amp;lt;/span&amp;gt;.&lt;br /&gt;
* OpenAIS then starts up, reports it&#039;s multicast address it will use, reports many of it&#039;s variable values and what [[IP]] address it will use for cluster communications.&lt;br /&gt;
* The Cluster Manager, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt;, starts and reports the version of various services in use.&lt;br /&gt;
* The [[totem]] protocol is started and it forms an initial configuration containing just itself. These messages have the prefix &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;CLM&amp;lt;/span&amp;gt;, CLuster Membership.&lt;br /&gt;
** Then it waits to see if the other node will join. On the other node&#039;s log, you will see it start off and immediately join with this first node. &lt;br /&gt;
* The initial configuration is sufficient to gain quorum and declares that it will provide services.&lt;br /&gt;
* The second node announces that it wants to join the first node&#039;s cluster membership and the cluster reconfigures.&lt;br /&gt;
&lt;br /&gt;
From the node you started &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt; on second, you will see mostly the same thing, except you will not see the cluster form on the one node. Instead, it will connect directly to the first node and the initial configuration will be the pair together.&lt;br /&gt;
&lt;br /&gt;
If you got this, then you&#039;re cluster is up and running, congratulations!&lt;br /&gt;
&lt;br /&gt;
== Testing Fencing ==&lt;br /&gt;
&lt;br /&gt;
Before we go any further, we want to make sure that our fence device and configuration is working from both nodes. We will test this two ways;&lt;br /&gt;
* First, we will use the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fence_node&amp;lt;/span&amp;gt; tools.&lt;br /&gt;
* Second, we will break the network connection to simulate a network failure.&lt;br /&gt;
&lt;br /&gt;
=== Fencing with the fence_node Tool ===&lt;br /&gt;
&lt;br /&gt;
Testing this is easy, thanks to the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fence_node&amp;lt;/span&amp;gt; command line tool. It&#039;s simply a matter of calling &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fence_node &amp;lt;node&amp;gt;&amp;lt;/span&amp;gt;, where &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;node&amp;gt;&amp;lt;/span&amp;gt; has to match the name set in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cluster.conf&amp;lt;/span&amp;gt; file&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clusternode name=&amp;quot;...&amp;quot;&amp;lt;/span&amp;gt; element.&lt;br /&gt;
&lt;br /&gt;
We will do this test twice; Once from &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt;, fencing &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt; and then again from the other way around. After each fence call, we will wait for the node to reboot and then rejoin it to the cluster. We&#039;ll watch &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/var/log/messages&amp;lt;/span&amp;gt; to see what&#039;s happening.&lt;br /&gt;
&lt;br /&gt;
Let&#039;s start by fencing &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05.alteeve.com&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;From &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt;&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
fence_node05.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;
May  6 00:46:26 an-node04 openais[25357]: [TOTEM] The token was lost in the OPERATIONAL state.&lt;br /&gt;
May  6 00:46:26 an-node04 openais[25357]: [TOTEM] Receive multicast socket recv buffer size (262142 bytes).&lt;br /&gt;
May  6 00:46:26 an-node04 openais[25357]: [TOTEM] Transmit multicast socket send buffer size (262142 bytes).&lt;br /&gt;
May  6 00:46:26 an-node04 openais[25357]: [TOTEM] entering GATHER state from 2.&lt;br /&gt;
May  6 00:46:28 an-node04 openais[25357]: [TOTEM] entering GATHER state from 0.&lt;br /&gt;
May  6 00:46:28 an-node04 openais[25357]: [TOTEM] Creating commit token because I am the rep.&lt;br /&gt;
May  6 00:46:28 an-node04 openais[25357]: [TOTEM] Saving state aru 22 high seq received 22&lt;br /&gt;
May  6 00:46:28 an-node04 openais[25357]: [TOTEM] Storing new sequence id for ring 5c&lt;br /&gt;
May  6 00:46:28 an-node04 openais[25357]: [TOTEM] entering COMMIT state.&lt;br /&gt;
May  6 00:46:28 an-node04 openais[25357]: [TOTEM] entering RECOVERY state.&lt;br /&gt;
May  6 00:46:28 an-node04 openais[25357]: [TOTEM] position [0] member 192.168.3.74:&lt;br /&gt;
May  6 00:46:28 an-node04 openais[25357]: [TOTEM] previous ring seq 88 rep 192.168.3.74&lt;br /&gt;
May  6 00:46:28 an-node04 openais[25357]: [TOTEM] aru 22 high delivered 22 received flag 1&lt;br /&gt;
May  6 00:46:28 an-node04 openais[25357]: [TOTEM] Did not need to originate any messages in recovery.&lt;br /&gt;
May  6 00:46:28 an-node04 openais[25357]: [TOTEM] Sending initial ORF token&lt;br /&gt;
May  6 00:46:28 an-node04 openais[25357]: [CLM  ] CLM CONFIGURATION CHANGE&lt;br /&gt;
May  6 00:46:28 an-node04 openais[25357]: [CLM  ] New Configuration:&lt;br /&gt;
May  6 00:46:28 an-node04 fenced[25376]: an-node05.alteeve.com not a cluster member after 0 sec post_fail_delay&lt;br /&gt;
May  6 00:46:28 an-node04 kernel: dlm: closing connection to node 2&lt;br /&gt;
May  6 00:46:28 an-node04 openais[25357]: [CLM  ]       r(0) ip(192.168.3.74)&lt;br /&gt;
May  6 00:46:28 an-node04 fenced[25376]: fencing node &amp;quot;an-node05.alteeve.com&amp;quot;&lt;br /&gt;
May  6 00:46:28 an-node04 openais[25357]: [CLM  ] Members Left:&lt;br /&gt;
May  6 00:46:28 an-node04 openais[25357]: [CLM  ]       r(0) ip(192.168.3.75)&lt;br /&gt;
May  6 00:46:28 an-node04 openais[25357]: [CLM  ] Members Joined:&lt;br /&gt;
May  6 00:46:28 an-node04 openais[25357]: [CLM  ] CLM CONFIGURATION CHANGE&lt;br /&gt;
May  6 00:46:28 an-node04 openais[25357]: [CLM  ] New Configuration:&lt;br /&gt;
May  6 00:46:28 an-node04 openais[25357]: [CLM  ]       r(0) ip(192.168.3.74)&lt;br /&gt;
May  6 00:46:28 an-node04 openais[25357]: [CLM  ] Members Left:&lt;br /&gt;
May  6 00:46:28 an-node04 openais[25357]: [CLM  ] Members Joined:&lt;br /&gt;
May  6 00:46:28 an-node04 openais[25357]: [SYNC ] This node is within the primary component and will provide service.&lt;br /&gt;
May  6 00:46:28 an-node04 openais[25357]: [TOTEM] entering OPERATIONAL state.&lt;br /&gt;
May  6 00:46:28 an-node04 openais[25357]: [CLM  ] got nodejoin message 192.168.3.74&lt;br /&gt;
May  6 00:46:28 an-node04 openais[25357]: [CPG  ] got joinlist message from node 1&lt;br /&gt;
May  6 00:46:29 an-node04 fence_node[26696]: Fence of &amp;quot;an-node05.alteeve.com&amp;quot; was successful&lt;br /&gt;
May  6 00:46:42 an-node04 fenced[25376]: fence &amp;quot;an-node05.alteeve.com&amp;quot; success&lt;br /&gt;
May  6 00:50:23 an-node04 fence_node[26756]: Fence of &amp;quot;an-node05.alteeve.com&amp;quot; was successful&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{note|1=You will notice that there were two fence calls; This is normal. The first was the call from the command line that killed the node. The second was a reaction to the cluster reforming.}}&lt;br /&gt;
&lt;br /&gt;
Watching syslog, we&#039;ll see the node disappear, then the called fence finish, then the second fence called by the cluster itself succeed.&lt;br /&gt;
&lt;br /&gt;
If we check the cluster status from the surviving node, we&#039;ll see that the cluster has been reduced to just the single survivor node.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cman_tool 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;
Version: 6.2.0&lt;br /&gt;
Config Version: 8&lt;br /&gt;
Cluster Name: an-cluster01&lt;br /&gt;
Cluster Id: 60257&lt;br /&gt;
Cluster Member: Yes&lt;br /&gt;
Cluster Generation: 92&lt;br /&gt;
Membership state: Cluster-Member&lt;br /&gt;
Nodes: 1&lt;br /&gt;
Expected votes: 1&lt;br /&gt;
Total votes: 1&lt;br /&gt;
Quorum: 1  &lt;br /&gt;
Active subsystems: 7&lt;br /&gt;
Flags: 2node Dirty &lt;br /&gt;
Ports Bound: 0  &lt;br /&gt;
Node name: an-node04.alteeve.com&lt;br /&gt;
Node ID: 1&lt;br /&gt;
Multicast addresses: 239.192.235.77 &lt;br /&gt;
Node addresses: 192.168.3.74 &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once the victim has rebooted, we can rejoin it to the cluster. Now that the first node is already up, there is no need to worry about timing issues. Just start &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt; at your leisure. If you watch syslog from &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt;, you&#039;ll see &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt; connect and the cluster will reform to include it.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt;&#039;&#039;&#039;:&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;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Starting cluster: &lt;br /&gt;
   Loading modules... done&lt;br /&gt;
   Mounting configfs... done&lt;br /&gt;
   Starting ccsd... done&lt;br /&gt;
   Starting cman... done&lt;br /&gt;
   Starting daemons... done&lt;br /&gt;
   Starting fencing... done&lt;br /&gt;
                                                           [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{warning|1=Please do not assume that a successful fence against one node will mean that the fence against the other will work. An improper fence agent configuration, a typo in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cluster.conf&amp;lt;/span&amp;gt; or a fault in the wiring of the fence device could all cause node-specific fence failures.}}&lt;br /&gt;
&lt;br /&gt;
Now, repeat the process, but this time fence &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04.alteeve.com&amp;lt;/span&amp;gt; from &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Simulate a Network Failure ===&lt;br /&gt;
&lt;br /&gt;
It&#039;s good to know that we can fence the nodes with the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fence_node&amp;lt;/span&amp;gt; tool, but that is a controlled situation entirely within the context of the cluster. A more &amp;quot;real-world&amp;quot; test is now needed to ensure that a external fault will be detected by the cluster and that one of the nodes will be ejected. There are many, many ways to simulate a failure, and &#039;&#039;&#039;we will test&#039;&#039;&#039; all failures later. For now though, let&#039;s use a simple &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;iptables&amp;lt;/span&amp;gt; rule to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;DROP&amp;lt;/span&amp;gt; everything leaving our &#039;&#039;&#039;BCN&#039;&#039;&#039; interface.&lt;br /&gt;
&lt;br /&gt;
{{warning|1=This next command will block &#039;&#039;&#039;all&#039;&#039;&#039; traffic leaving the server. You will lose your &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ssh&amp;lt;/span&amp;gt; connection. If the fence fails, you will need to find another way to reboot or restore the server.}}&lt;br /&gt;
&lt;br /&gt;
This time, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04.alteeve.com&amp;lt;/span&amp;gt; will be the victim, so run the following &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;iptables&amp;lt;/span&amp;gt; command on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt; directly. This will cause all outbound traffic, including cluster communications, to fail. Within a few seconds, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt; should declare &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt; as dead, eject it via a fence call and then reconfigure.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt;&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
iptables -A OUTPUT -j DROP&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After a few seconds, you should see &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt; trigger the fence.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;In &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt;&#039;s syslog&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
May  6 01:11:08 an-node04 openais[4339]: [TOTEM] The token was lost in the OPERATIONAL state. &lt;br /&gt;
May  6 01:11:08 an-node04 openais[4339]: [TOTEM] Receive multicast socket recv buffer size (262142 bytes). &lt;br /&gt;
May  6 01:11:08 an-node04 openais[4339]: [TOTEM] Transmit multicast socket send buffer size (262142 bytes). &lt;br /&gt;
May  6 01:11:08 an-node04 openais[4339]: [TOTEM] entering GATHER state from 2. &lt;br /&gt;
May  6 01:11:10 an-node04 openais[4339]: [TOTEM] entering GATHER state from 0. &lt;br /&gt;
May  6 01:11:10 an-node04 openais[4339]: [TOTEM] Creating commit token because I am the rep. &lt;br /&gt;
May  6 01:11:10 an-node04 openais[4339]: [TOTEM] Saving state aru 24 high seq received 24 &lt;br /&gt;
May  6 01:11:10 an-node04 openais[4339]: [TOTEM] Storing new sequence id for ring 70 &lt;br /&gt;
May  6 01:11:10 an-node04 openais[4339]: [TOTEM] entering COMMIT state. &lt;br /&gt;
May  6 01:11:10 an-node04 openais[4339]: [TOTEM] entering RECOVERY state. &lt;br /&gt;
May  6 01:11:10 an-node04 openais[4339]: [TOTEM] position [0] member 192.168.3.74: &lt;br /&gt;
May  6 01:11:10 an-node04 openais[4339]: [TOTEM] previous ring seq 108 rep 192.168.3.74 &lt;br /&gt;
May  6 01:11:10 an-node04 openais[4339]: [TOTEM] aru 24 high delivered 24 received flag 1 &lt;br /&gt;
May  6 01:11:10 an-node04 openais[4339]: [TOTEM] Did not need to originate any messages in recovery. &lt;br /&gt;
May  6 01:11:10 an-node04 openais[4339]: [TOTEM] Sending initial ORF token &lt;br /&gt;
May  6 01:11:10 an-node04 openais[4339]: [CLM  ] CLM CONFIGURATION CHANGE &lt;br /&gt;
May  6 01:11:10 an-node04 openais[4339]: [CLM  ] New Configuration: &lt;br /&gt;
May  6 01:11:10 an-node04 kernel: dlm: closing connection to node 2&lt;br /&gt;
May  6 01:11:10 an-node04 fenced[4358]: an-node05.alteeve.com not a cluster member after 0 sec post_fail_delay&lt;br /&gt;
May  6 01:11:10 an-node04 openais[4339]: [CLM  ] 	r(0) ip(192.168.3.74)  &lt;br /&gt;
May  6 01:11:10 an-node04 fenced[4358]: fencing node &amp;quot;an-node05.alteeve.com&amp;quot;&lt;br /&gt;
May  6 01:11:10 an-node04 openais[4339]: [CLM  ] Members Left: &lt;br /&gt;
May  6 01:11:10 an-node04 openais[4339]: [CLM  ] 	r(0) ip(192.168.3.75)  &lt;br /&gt;
May  6 01:11:10 an-node04 openais[4339]: [CLM  ] Members Joined: &lt;br /&gt;
May  6 01:11:10 an-node04 openais[4339]: [CLM  ] CLM CONFIGURATION CHANGE &lt;br /&gt;
May  6 01:11:10 an-node04 openais[4339]: [CLM  ] New Configuration: &lt;br /&gt;
May  6 01:11:10 an-node04 openais[4339]: [CLM  ] 	r(0) ip(192.168.3.74)  &lt;br /&gt;
May  6 01:11:10 an-node04 openais[4339]: [CLM  ] Members Left: &lt;br /&gt;
May  6 01:11:10 an-node04 openais[4339]: [CLM  ] Members Joined: &lt;br /&gt;
May  6 01:11:10 an-node04 openais[4339]: [SYNC ] This node is within the primary component and will provide service. &lt;br /&gt;
May  6 01:11:10 an-node04 openais[4339]: [TOTEM] entering OPERATIONAL state. &lt;br /&gt;
May  6 01:11:10 an-node04 openais[4339]: [CLM  ] got nodejoin message 192.168.3.74 &lt;br /&gt;
May  6 01:11:10 an-node04 openais[4339]: [CPG  ] got joinlist message from node 1 &lt;br /&gt;
May  6 01:11:23 an-node04 fenced[4358]: fence &amp;quot;an-node05.alteeve.com&amp;quot; success&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Success!&lt;br /&gt;
&lt;br /&gt;
Now repeat this, making &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt; the victim. &lt;br /&gt;
&lt;br /&gt;
If both fence tests succeeded against both nodes, you can be confident that fencing is working well!&lt;br /&gt;
&lt;br /&gt;
= Setting Up Clustered Storage =&lt;br /&gt;
&lt;br /&gt;
The next few steps will cover setting up the DRBD resources, using them in clustered [[LVM]] and the creating a [[GFS2]] partition. Next, we will add it all as cluster resources and then create a service for each node to start up all of the clustered storage.&lt;br /&gt;
&lt;br /&gt;
== Creating Our DRBD Resources ==&lt;br /&gt;
&lt;br /&gt;
We&#039;re going to create four DRBD resources;&lt;br /&gt;
&lt;br /&gt;
* A resource to back our shared [[GFS2]] partition which will hold shared files, like our virtual machine configuration files.&lt;br /&gt;
* A resource to back the VMs running primarily on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt;.&lt;br /&gt;
* A resource to back the VMs running primarily on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt;.&lt;br /&gt;
* A final resource that will be left alone for future expansion. This is optional, of course.&lt;br /&gt;
&lt;br /&gt;
=== The &amp;quot;Why&amp;quot; of Our Layout ===&lt;br /&gt;
&lt;br /&gt;
The reason for this is to minimize the chance of data loss in a [[split-brain]] event. &lt;br /&gt;
&lt;br /&gt;
A split-brain occurs when a [[DRBD]] resource loses it&#039;s network link while in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Primary/Primary&amp;lt;/span&amp;gt; mode. The problem is that, after the split, any write to either node is not replicated to the other node. Thus, after even one [[byte]] is written, the DRBD resource is out of sync. Once this happens, there is no real way to automate recovery. You will need to go in and manual flag one side of the resource to discard it&#039;s changes and then manually re-connect the two sides before the resource will be usable again.&lt;br /&gt;
&lt;br /&gt;
We will take steps to prevent this, but it always a possibility with shared storage.&lt;br /&gt;
&lt;br /&gt;
Given then that there is no sure way to avoid this, we&#039;re going to mitigate risk by breaking up our DRBD resources so that we can be more selective in choosing what parts to invalidate after a split brain event.&lt;br /&gt;
&lt;br /&gt;
* The small GFS2 partition will be the hardest to manage. For this reason, it is on it&#039;s own. For the same reason, we will be using it as little as we can, and copies of files we care about will be stored on each node. The main thing here are the VM configuration files. This should be written to rarely, so with luck, in a split brain condition, simply nothing will be written to either side so recovery should be arbitrary and simple.&lt;br /&gt;
* The VMs that will primarily run on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt; will get their own resource. This way we can simply invalidate the DRBD device on the node that was &#039;&#039;&#039;not&#039;&#039;&#039; running the VMs during the split brain.&lt;br /&gt;
* Likewise, the VMs primarily running on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt; will get their own resource. This way, if a split brain happens and VMs are running on both nodes, it should be easily to invalidate opposing nodes for the respective DRBD resource.&lt;br /&gt;
* The fourth DRBD resource will just contain free space. This can later be added whole to an existing LVM VG or further divided up as needed in the future.&lt;br /&gt;
&lt;br /&gt;
== Visualizing Storage ==&lt;br /&gt;
&lt;br /&gt;
The layout of our storage is, on the surface, somewhat complex. To help follow what we&#039;ll be creating, here is an [[ASCII]] drawing showing what it will look like. Note that example VMs are shown, which we will not be creating. This is to help you see where extra VMs would exist if you ran two or more VMs per node.&lt;br /&gt;
&lt;br /&gt;
If you are using [[RAID]], then you can simply replace &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;sdaX&amp;lt;/span&amp;gt; with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;mdX&amp;lt;/span&amp;gt;. You can find a tutorial on manually creating RAID devices here:&lt;br /&gt;
* [[Managing Software RAID Arrays]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
         [ an-node04 ]&lt;br /&gt;
  ______   ______    ______     __[sda4]__&lt;br /&gt;
 | sda1 | | sda2 |  | sda3 |   |  ______  |       _______    ______________    ______________________________&lt;br /&gt;
 |______| |______|  |______|   | | sda5 |-+------| drbd0 |--| drbd_sh0_vg0 |--| /dev/drbd_sh0_vg0/xen_shared |&lt;br /&gt;
     |        |         |      | |______| |   /--|_______|  |______________|  |______________________________|&lt;br /&gt;
  ___|___    _|_    ____|____  |  ______  |   |     _______    ______________    ____________________________&lt;br /&gt;
 | /boot |  | / |  | &amp;lt;swap&amp;gt;  | | | sda6 |-+---+----| drbd1 |--| drbd_an4_vg0 |--| /dev/drbd_an4_vg0/vm0001_1 |&lt;br /&gt;
 |_______|  |___|  |_________| | |______| |   | /--|_______|  |______________|  |____________________________|&lt;br /&gt;
                               |  ______  |   | |     _______    ______________    ____________________________&lt;br /&gt;
                               | | sda7 |-+---+-+----| drbd2 |--| drbd_an5_vg0 |--| /dev/drbd_an5_vg0/vm0002_1 | &lt;br /&gt;
                               | |______| |   | | /--|_______|  |______________|  |____________________________|&lt;br /&gt;
                               |  ______  |   | | |                         | |    _______________________&lt;br /&gt;
                               | | sda8 |-+---+-+-+--\                      | \---| Example LV for 2nd VM |&lt;br /&gt;
                               | |______| |   | | |  |                      |     |_______________________|&lt;br /&gt;
                               |__________|   | | |  |                      |      _______________________&lt;br /&gt;
         [ an-node05 ]                        | | |  |                      \-----| Example LV for 3rd VM |&lt;br /&gt;
  ______   ______    ______     __[sda4]__    | | |  |                            |_______________________|&lt;br /&gt;
 | sda1 | | sda2 |  | sda3 |   |  ______  |   | | |  |                   &lt;br /&gt;
 |______| |______|  |______|   | | sda5 |-+---/ | |  |   _______    __________________&lt;br /&gt;
     |        |         |      | |______| |     | |  \--| drbd3 |--| Spare PV for     |&lt;br /&gt;
  ___|___    _|_    ____|____  |  ______  |     | |  /--|_______|  | future expansion |&lt;br /&gt;
 | /boot |  | / |  | &amp;lt;swap&amp;gt;  | | | sda6 |-+-----/ |  |             |__________________|&lt;br /&gt;
 |_______|  |___|  |_________| | |______| |       |  |&lt;br /&gt;
                               |  ______  |       |  |&lt;br /&gt;
                               | | sda7 |-+-------/  |&lt;br /&gt;
                               | |______| |          |&lt;br /&gt;
                               |  ______  |          |&lt;br /&gt;
                               | | sda8 |-+----------/&lt;br /&gt;
                               | |______| |&lt;br /&gt;
                               |__________|&lt;br /&gt;
.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Modifying the Physical Storage ===&lt;br /&gt;
&lt;br /&gt;
{{warning|1=Multiple assumptions ahead. If you are comfortable &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fdisk&amp;lt;/span&amp;gt; (and possibly &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;mdadm&amp;lt;/span&amp;gt;), you can largely skip this section. You will need to create four partitions; This tutorial uses a &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;10&amp;lt;/span&amp;gt; [[GiB]] for shared files, two &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;100&amp;lt;/span&amp;gt; [[GiB]] and the remainder of the space in the last partition. These will be four extended partitions, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/sda5&amp;lt;/span&amp;gt;, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/sda6&amp;lt;/span&amp;gt;, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/sda7&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/sda8&amp;lt;/span&amp;gt; respectively.}}&lt;br /&gt;
&lt;br /&gt;
This tutorial, in the interest of simplicity and not aiming to be a disk management tutorial, uses single-disk storage on each node. If you only have one disk, or if you have hardware RAID, this is sufficient. However, if you have multiple disks and want to use software RAID on your nodes, you will need to create &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/mdX&amp;lt;/span&amp;gt; devices to match the layout we will be creating. Here is a tutorial on managing software RAID arrays, written with this tutorial in mind.&lt;br /&gt;
&lt;br /&gt;
* [[Managing Software RAID Arrays]]&lt;br /&gt;
&lt;br /&gt;
We will need four new partitions; a &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;10&amp;lt;/span&amp;gt; [[GiB]] partition for the [[GFS2]] resource, two &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;100&amp;lt;/span&amp;gt; [[GiB]] partitions for the VMs on either node and the remainder of the disk&#039;s free space for the last partition. To do this, we will use the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fdisk&amp;lt;/span&amp;gt; tool. Be aware; This tool directly edits the hard drive&#039;s geometry. This is obviously risky! All along, this tutorial has assumed that you are working on test nodes, but it bears repeating again. Do not do this on a machine with data you care about! At the very least, have a good backup.&lt;br /&gt;
&lt;br /&gt;
Finally, this assumes that you used the [[generic_el5_node.ks|kickstart script]] when setting up your nodes. More to the point, it assumes an existing fourth primary partition which we will delete, convert to an extended partition and then within that create the four usable partitions.&lt;br /&gt;
&lt;br /&gt;
{{note|1=This is no longer completely accurate. The new kickstart script above does not create the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/sda4&amp;lt;/span&amp;gt; device any longer. The example remains though to show how to delete a partition, in case it is helpful to some readers.}}&lt;br /&gt;
&lt;br /&gt;
So first, delete the fourth partition.&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;
The number of cylinders for this disk is set to 60801.&lt;br /&gt;
There is nothing wrong with that, but this is larger than 1024,&lt;br /&gt;
and could in certain setups cause problems with:&lt;br /&gt;
1) software that runs at boot time (e.g., old versions of LILO)&lt;br /&gt;
2) booting and partitioning software from other OSs&lt;br /&gt;
   (e.g., DOS FDISK, OS/2 FDISK)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Confirm that the layout is indeed four partitions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Command (m for help): 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;
&lt;br /&gt;
   Device Boot      Start         End      Blocks   Id  System&lt;br /&gt;
/dev/sda1   *           1          32      257008+  83  Linux&lt;br /&gt;
/dev/sda2              33        2643    20972857+  83  Linux&lt;br /&gt;
/dev/sda3            2644        3165     4192965   82  Linux swap / Solaris&lt;br /&gt;
/dev/sda4            3166       60801   462961170   83  Linux&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is, so let&#039;s delete &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/sda4&amp;lt;/span&amp;gt; and then confirm that it is gone.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Command (m for help): d&lt;br /&gt;
Partition number (1-4): 4&lt;br /&gt;
&lt;br /&gt;
Command (m for help): 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;
&lt;br /&gt;
   Device Boot      Start         End      Blocks   Id  System&lt;br /&gt;
/dev/sda1   *           1          32      257008+  83  Linux&lt;br /&gt;
/dev/sda2              33        2643    20972857+  83  Linux&lt;br /&gt;
/dev/sda3            2644        3165     4192965   82  Linux swap / Solaris&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is, so now we&#039;ll create the extended partition.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Command (m for help): n&lt;br /&gt;
Command action&lt;br /&gt;
   e   extended&lt;br /&gt;
   p   primary partition (1-4)&lt;br /&gt;
e&lt;br /&gt;
Selected partition 4&lt;br /&gt;
First cylinder (3166-60801, default 3166): &amp;lt;enter&amp;gt;&lt;br /&gt;
Using default value 3166&lt;br /&gt;
Last cylinder or +size or +sizeM or +sizeK (3166-60801, default 60801): &amp;lt;enter&amp;gt;&lt;br /&gt;
Using default value 60801&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Again, a quick check to make sure the extended partition is now there.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Command (m for help): 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;
&lt;br /&gt;
   Device Boot      Start         End      Blocks   Id  System&lt;br /&gt;
/dev/sda1   *           1          32      257008+  83  Linux&lt;br /&gt;
/dev/sda2              33        2643    20972857+  83  Linux&lt;br /&gt;
/dev/sda3            2644        3165     4192965   82  Linux swap / Solaris&lt;br /&gt;
/dev/sda4            3166       60801   462961170    5  Extended&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Finally, let&#039;s create the four partitions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Command (m for help): n&lt;br /&gt;
First cylinder (3166-60801, default 3166): &lt;br /&gt;
Using default value 3166&lt;br /&gt;
Last cylinder or +size or +sizeM or +sizeK (3166-60801, default 60801): +10G&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;
Command (m for help): n&lt;br /&gt;
First cylinder (4383-60801, default 4383): &amp;lt;enter&amp;gt;&lt;br /&gt;
Using default value 4383&lt;br /&gt;
Last cylinder or +size or +sizeM or +sizeK (4383-60801, default 60801): +100G&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;
Command (m for help): n&lt;br /&gt;
First cylinder (16542-60801, default 16542): &amp;lt;enter&amp;gt;&lt;br /&gt;
Using default value 16542&lt;br /&gt;
Last cylinder or +size or +sizeM or +sizeK (16542-60801, default 60801): +100G&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;
Command (m for help): n&lt;br /&gt;
First cylinder (28701-60801, default 28701): &amp;lt;enter&amp;gt;&lt;br /&gt;
Using default value 28701&lt;br /&gt;
Last cylinder or +size or +sizeM or +sizeK (28701-60801, default 60801): &amp;lt;enter&amp;gt;&lt;br /&gt;
Using default value 60801&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Finally, check that the four new partitions exist.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Command (m for help): 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;
&lt;br /&gt;
   Device Boot      Start         End      Blocks   Id  System&lt;br /&gt;
/dev/sda1   *           1          32      257008+  83  Linux&lt;br /&gt;
/dev/sda2              33        2643    20972857+  83  Linux&lt;br /&gt;
/dev/sda3            2644        3165     4192965   82  Linux swap / Solaris&lt;br /&gt;
/dev/sda4            3166       60801   462961170    5  Extended&lt;br /&gt;
/dev/sda5            3166        4382     9775521   83  Linux&lt;br /&gt;
/dev/sda6            4383       16541    97667136   83  Linux&lt;br /&gt;
/dev/sda7           16542       28700    97667136   83  Linux&lt;br /&gt;
/dev/sda8           28701       60801   257851251   83  Linux&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We do! So now we&#039;ll commit the changes to disk and exit.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Command (m for help): 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.&lt;br /&gt;
The new table will be used at the next reboot.&lt;br /&gt;
Syncing disks.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{warning|1=Repeat the steps on the other node and double-check that the output of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fdisk -l /dev/sda&amp;lt;/span&amp;gt; shows the same &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Start&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;End&amp;lt;/span&amp;gt; boundaries. &#039;&#039;If they do not match, fix it before proceeding&#039;&#039;.}}&lt;br /&gt;
&lt;br /&gt;
{{note|1=This was done on the same disk as the host OS, so we&#039;ll need to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;reboot&amp;lt;/span&amp;gt; before we can proceed.}}&lt;br /&gt;
&lt;br /&gt;
== Creating the DRBD Resources ==&lt;br /&gt;
&lt;br /&gt;
Now that we have either node&#039;s storage ready, we can configure and start the DRBD resources. DRBD has &amp;quot;resource names&amp;quot;, which is it&#039;s internal reference to the &amp;quot;array&amp;quot;. These names are used whenever you are working on the resource using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;drbdadm&amp;lt;/span&amp;gt; or similar tools. The tradition is to name the resources as &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rX&amp;lt;/span&amp;gt;, with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;X&amp;lt;/span&amp;gt; being a sequence number starting at &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;0&amp;lt;/span&amp;gt;. The resource itself is made available as a normal &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/&amp;lt;/span&amp;gt; block device. The tradition is to name this device &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/drbdX&amp;lt;/span&amp;gt; where &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;X&amp;lt;/span&amp;gt; matches the resource&#039;s sequence number.&lt;br /&gt;
&lt;br /&gt;
=== The DRBD Fence Script ===&lt;br /&gt;
&lt;br /&gt;
{{warning|1=There is a problem with the current [[Node Assassin]] fence agent where multiple simultaneous fence calls will fail to return a success after each fence call. Until this is resolved, you will need to disable &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;outdate-peer&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fencing&amp;lt;/span&amp;gt; in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/drbd.conf&amp;lt;/span&amp;gt; by commenting out the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;disk { }&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;handler { }&amp;lt;/span&amp;gt; blocks in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;common { }&amp;lt;/span&amp;gt;.}}&lt;br /&gt;
&lt;br /&gt;
Red Hat&#039;s [http://people.redhat.com/lhh/ Lon Hohberger] created a DRBD script called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[obliterate]]&amp;lt;/span&amp;gt;, which was later updated to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[obliterate-peer.sh]]&amp;lt;/span&amp;gt;, that allows DRBD to trigger a fence call through the cluster when it detects a split-brain condition. The goal behind this is to stop the resource(s) from being flagged as &amp;quot;split-brain&amp;quot; in the first place, thus avoiding manual recovery. We will be using the newer &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[obliterate-peer.sh]]&amp;lt;/span&amp;gt; script. The difference between the two scripts is that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[obliterate]]&amp;lt;/span&amp;gt; will try to fence once only, where &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[obliterate-peer.sh]]&amp;lt;/span&amp;gt; will continue to fence until it succeeds. The former will block DRBD if it fails, which is not good.&lt;br /&gt;
&lt;br /&gt;
Download the script below and save it under your &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/sbin/&amp;lt;/span&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/sbin/[[obliterate-peer.sh]]&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then ensure that it is executable.&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/sbin/obliterate-peer.sh -O /sbin/obliterate-peer.sh&lt;br /&gt;
chmod a+x /sbin/obliterate-peer.sh&lt;br /&gt;
ls -lah /sbin/obliterate-peer.sh &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
-rw-r--r-- 1 root root 2.1K May  4 14:31 /sbin/obliterate-peer.sh&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Our Desired Layout in Detail ===&lt;br /&gt;
&lt;br /&gt;
Let&#039;s review how we will bring the devices together.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt;&lt;br /&gt;
!&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt;&lt;br /&gt;
!DRBD Resource&lt;br /&gt;
!DRBD Device&lt;br /&gt;
!Size&lt;br /&gt;
!Note&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/sda5&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/sda5&amp;lt;/span&amp;gt;&lt;br /&gt;
|style=&amp;quot;text-align: center;&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;r0&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/drbd0&amp;lt;/span&amp;gt;&lt;br /&gt;
|style=&amp;quot;white-space: nowrap; text-align: center;&amp;quot;|10 [[GB]]&lt;br /&gt;
|[[GFS2]] partition for VM configurations and shared files&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/sda6&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/sda6&amp;lt;/span&amp;gt;&lt;br /&gt;
|style=&amp;quot;text-align: center;&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;r1&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/drbd1&amp;lt;/span&amp;gt;&lt;br /&gt;
|style=&amp;quot;white-space: nowrap; text-align: center;&amp;quot;|100 [[GB]]&lt;br /&gt;
|Host VMs that will primarily run on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/sda7&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/sda7&amp;lt;/span&amp;gt;&lt;br /&gt;
|style=&amp;quot;text-align: center;&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;r2&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/drbd2&amp;lt;/span&amp;gt;&lt;br /&gt;
|style=&amp;quot;white-space: nowrap; text-align: center;&amp;quot;|100 [[GB]]&lt;br /&gt;
|Host VMs that will primarily run on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/sda8&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/sda8&amp;lt;/span&amp;gt;&lt;br /&gt;
|style=&amp;quot;text-align: center;&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;r3&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/drbd3&amp;lt;/span&amp;gt;&lt;br /&gt;
|style=&amp;quot;white-space: nowrap;&amp;quot;|&lt;br /&gt;
|Free space that can later be allocated to an existing [[VG]] as-is or further divided up into two or more DRBD resources as future needs dictate.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Configuring /etc/drbd.conf ===&lt;br /&gt;
&lt;br /&gt;
With this plan then, we can now create the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/drbd.conf&amp;lt;/span&amp;gt; configuration file.&lt;br /&gt;
&lt;br /&gt;
The initial file is very sparse;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/drbd.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;
#&lt;br /&gt;
# please have a a look at the example configuration file in&lt;br /&gt;
# /usr/share/doc/drbd83/drbd.conf&lt;br /&gt;
#&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Setting up the &#039;global&#039; Directive ====&lt;br /&gt;
&lt;br /&gt;
There are a lot of options available to you, many of which are outside the scope of this tutorial. You can get a good overview of all option by reading the man page; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;man drbd.conf&amp;lt;/span&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
The first section we will add is the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;global { }&amp;lt;/span&amp;gt; directive. There is only one argument we will set, which tells DRBD that it can count our install in the Linbit user information. If you have privacy concerns, set this to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;no&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;
# The &#039;global&#039; directive covers values that apply to RBD in general.&lt;br /&gt;
global {&lt;br /&gt;
        # This tells Linbit that it&#039;s okay to count us as a DRBD user. If you&lt;br /&gt;
        # have privacy concerns, set this to &#039;no&#039;.&lt;br /&gt;
        usage-count     yes;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Setting up the &#039;common&#039; Directive ====&lt;br /&gt;
&lt;br /&gt;
The next directive is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;common { }&amp;lt;/span&amp;gt;. This sets values to be used on all DRBD resources by default. You can override &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;common&amp;lt;/span&amp;gt; values in any given resource directive later. &lt;br /&gt;
&lt;br /&gt;
The example below is well documented, so please take a moment to look at the example for &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;
# The &#039;common&#039; directive sets defaults values for all resources.&lt;br /&gt;
common {&lt;br /&gt;
        # Protocol &#039;C&#039; tells DRBD to not report a disk write as complete until&lt;br /&gt;
        # it has been confirmed written to both nodes. This is required for&lt;br /&gt;
        # Primary/Primary use.&lt;br /&gt;
        protocol C;&lt;br /&gt;
&lt;br /&gt;
        # This sets the default sync rate to 15 MiB/sec. Be careful about&lt;br /&gt;
        # setting this too high! High speed sync&#039;ing can flog your drives and&lt;br /&gt;
        # push disk I/O times very high.&lt;br /&gt;
        syncer {&lt;br /&gt;
                rate 15M;&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        # This tells DRBD what policy to use when a fence is required.&lt;br /&gt;
        disk {&lt;br /&gt;
                # This tells DRBD to block I/O (resource) and then try to fence&lt;br /&gt;
                # the other node (stonith). The &#039;stonith&#039; option requires that&lt;br /&gt;
                # we set a fence handler below. The name &#039;stonith&#039; comes from&lt;br /&gt;
                # &amp;quot;Shoot The Other Nide In The Head&amp;quot; and is a term used in&lt;br /&gt;
                # other clustering environments. It is synonomous with with&lt;br /&gt;
                # &#039;fence&#039;.&lt;br /&gt;
                fencing         resource-and-stonith;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        # We set &#039;stonith&#039; above, so here we tell DRBD how to actually fence&lt;br /&gt;
        # the other node.&lt;br /&gt;
        handlers {&lt;br /&gt;
                # The term &#039;outdate-peer&#039; comes from other scripts that flag&lt;br /&gt;
                # the other node&#039;s resource backing device as &#039;Inconsistent&#039;.&lt;br /&gt;
                # In our case though, we&#039;re flat-out fencing the other node,&lt;br /&gt;
                # which has the same effective result.&lt;br /&gt;
                outdate-peer    &amp;quot;/sbin/obliterate-peer.sh&amp;quot;;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        # Here we tell DRBD that we want to use Primary/Primary mode. It is&lt;br /&gt;
        # also where we define split-brain (sb) recovery policies. As we&#039;ll be&lt;br /&gt;
        # running all of our resources in Primary/Primary, only the&lt;br /&gt;
        # &#039;after-sb-2pri&#039; really means anything to us.&lt;br /&gt;
        net {&lt;br /&gt;
                # Tell DRBD to allow dual-primary.&lt;br /&gt;
                allow-two-primaries;&lt;br /&gt;
&lt;br /&gt;
                # Set the recover policy for split-brain recover when no device&lt;br /&gt;
                # in the resource was primary.&lt;br /&gt;
                after-sb-0pri   discard-zero-changes;&lt;br /&gt;
&lt;br /&gt;
                # Now if one device was primary.&lt;br /&gt;
                after-sb-1pri   discard-secondary;&lt;br /&gt;
&lt;br /&gt;
                # Finally, set the policy when both nodes were Primary. The&lt;br /&gt;
                # only viable option is &#039;disconnect&#039;, which tells DRBD to&lt;br /&gt;
                # simply tear-down the DRBD resource right away and wait for&lt;br /&gt;
                # the administrator to manually invalidate one side of the&lt;br /&gt;
                # resource.&lt;br /&gt;
                after-sb-2pri   disconnect;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        # This tells DRBD what to do when the resource starts.&lt;br /&gt;
        startup {&lt;br /&gt;
                # In our case, we&#039;re telling DRBD to promote both devices in&lt;br /&gt;
                # our resource to Primary on start.&lt;br /&gt;
                become-primary-on       both;&lt;br /&gt;
        }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Let&#039;s stop for a moment and talk about DRBD synchronization. &lt;br /&gt;
&lt;br /&gt;
A DRBD resource does &#039;&#039;&#039;not&#039;&#039;&#039; have to be synced before it can be made &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Primary/Primary&amp;lt;/span&amp;gt;. For this reason, the default sync rate for DRBD is very, very low (320 [[KiB]]/sec). This means that you can normally start your DRBD in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Primary/Primary&amp;lt;/span&amp;gt; on both nodes and get to work while the synchronization putters along in the background.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;However&#039;&#039;!&lt;br /&gt;
&lt;br /&gt;
If the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;UpToDate&amp;lt;/span&amp;gt; node goes down, the surviving &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Inconsistent&amp;lt;/span&amp;gt; node will demote to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Secondary&amp;lt;/span&amp;gt;, thus becoming unusable. In a high-availability environment like ours, this is pretty useless. So for this reason we will want to get the resources in sync as fast as possible. Likewise, while a node is sync&#039;ing, we will not be able to run the VMs on the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Inconsistent&amp;lt;/span&amp;gt; node.&lt;br /&gt;
&lt;br /&gt;
The temptation then is to set &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rate&amp;lt;/span&amp;gt; above to the maximum write speed of our disks. &#039;&#039;This is a bad idea&#039;&#039;!&lt;br /&gt;
&lt;br /&gt;
We will have four separate resources sharing the same underlying disks. If you drive the sync rate very high, and I/O on the other &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;UpToDate&amp;lt;/span&amp;gt; resources will be severely impacted. So much so that I&#039;ve seen crashes caused by this. So you will want to keep this value at a sane level. That is, you will want to set the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rate&amp;lt;/span&amp;gt; to as high as you can while still leaving the disks themselves sufficiently unbound that other I/O is still feasible. I&#039;ve personally found &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;15M&amp;lt;/span&amp;gt; on single-drive and simple RAID machines to be a good value. Feel free to experiment for yourself.&lt;br /&gt;
&lt;br /&gt;
==== Setting up the Resource Directives ====&lt;br /&gt;
&lt;br /&gt;
We now define the resources themselves. Each resource will be contained in a directive called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;resource x&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 actual resource name (&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;r0&amp;lt;/span&amp;gt;, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;r1&amp;lt;/span&amp;gt;, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;r2&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;r3&amp;lt;/span&amp;gt; in our case). Within this directive, all resource-specific options are set.&lt;br /&gt;
&lt;br /&gt;
The example below is well documented, so please take a moment to look at the example for &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;
# The &#039;resource&#039; directive defines a given resource and must be followed by the&lt;br /&gt;
# resource&#039;s name.&lt;br /&gt;
# This will be used as the GFS2 partition for shared files.&lt;br /&gt;
resource r0 {&lt;br /&gt;
        # This is the /dev/ device to create to make available this DRBD&lt;br /&gt;
        # resource.&lt;br /&gt;
        device          /dev/drbd0;&lt;br /&gt;
&lt;br /&gt;
        # This tells DRBD where to store it&#039;s internal state information. We&lt;br /&gt;
        # will use &#039;internal&#039;, which tells DRBD to store the information at the&lt;br /&gt;
        # end of the resource&#039;s space.&lt;br /&gt;
        meta-disk       internal;&lt;br /&gt;
&lt;br /&gt;
        # The next two &#039;on&#039; directives setup each individual node&#039;s settings.&lt;br /&gt;
        # The value after the &#039;on&#039; directive *MUST* match the output of&lt;br /&gt;
        # `uname -n` on each node.&lt;br /&gt;
        on an-node04.alteeve.com {&lt;br /&gt;
                # This is the network IP address on the network interface and&lt;br /&gt;
                # the TCP port to use for communication between the nodes. Note&lt;br /&gt;
                # that the IP address below in on our Storage Network. The TCP&lt;br /&gt;
                # port must be unique per resource, but the interface itself&lt;br /&gt;
                # can be shared. &lt;br /&gt;
                # IPv6 is usable with &#039;address ipv6 [address]:port&#039;.&lt;br /&gt;
                address         192.168.2.74:7789;&lt;br /&gt;
&lt;br /&gt;
                # This is the node&#039;s storage device that will back this&lt;br /&gt;
                # resource.&lt;br /&gt;
                disk            /dev/sda5;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        # Same as above, but altered to reflect the second node.&lt;br /&gt;
        on an-node05.alteeve.com {&lt;br /&gt;
                address         192.168.2.75:7789;&lt;br /&gt;
                disk            /dev/sda5;&lt;br /&gt;
        }&lt;br /&gt;
}&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;r1&amp;lt;/span&amp;gt;, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;r2&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;r3&amp;lt;/span&amp;gt; resources should be nearly identical to the example above. The main difference will the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;device&amp;lt;/span&amp;gt; value and within each node&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;on x { }&amp;lt;/span&amp;gt; directive. We will incrementing the [[TCP]] ports to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;7790&amp;lt;/span&amp;gt;, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;7791&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;7792&amp;lt;/span&amp;gt; respectively. Likewise, we will need to alter the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;disk&amp;lt;/span&amp;gt; to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/sda6&amp;lt;/span&amp;gt;, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/sda7&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/sda8&amp;lt;/span&amp;gt; respectively. Finally, the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;device&amp;lt;/span&amp;gt; will be incremented to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/drbd1&amp;lt;/span&amp;gt;, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/drbd2&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/drbd3&amp;lt;/span&amp;gt; respectively.&lt;br /&gt;
&lt;br /&gt;
=== Housekeeping Before Starting Our DRBD Resources ===&lt;br /&gt;
&lt;br /&gt;
Let&#039;s take a look at the complete &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/drbd.conf&amp;lt;/span&amp;gt; file, validate it for use and then push it to the second node.&lt;br /&gt;
&lt;br /&gt;
==== The Finished /etc/drbd.conf File ====&lt;br /&gt;
&lt;br /&gt;
The finished &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/drbd.conf&amp;lt;/span&amp;gt; file should look for or less like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
#&lt;br /&gt;
# please have a a look at the example configuration file in&lt;br /&gt;
# /usr/share/doc/drbd83/drbd.conf&lt;br /&gt;
#&lt;br /&gt;
&lt;br /&gt;
# The &#039;global&#039; directive covers values that apply to RBD in general.&lt;br /&gt;
global {&lt;br /&gt;
	# This tells Linbit that it&#039;s okay to count us as a DRBD user. If you&lt;br /&gt;
	# have privacy concerns, set this to &#039;no&#039;.&lt;br /&gt;
	usage-count	yes;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
# The &#039;common&#039; directive sets defaults values for all resources.&lt;br /&gt;
common {&lt;br /&gt;
	# Protocol &#039;C&#039; tells DRBD to not report a disk write as complete until&lt;br /&gt;
	# it has been confirmed written to both nodes. This is required for&lt;br /&gt;
	# Primary/Primary use.&lt;br /&gt;
        protocol	C;&lt;br /&gt;
&lt;br /&gt;
	# This sets the default sync rate to 15 MiB/sec. Be careful about&lt;br /&gt;
	# setting this too high! High speed sync&#039;ing can flog your drives and&lt;br /&gt;
	# push disk I/O times very high.&lt;br /&gt;
        syncer {&lt;br /&gt;
                rate	15M;&lt;br /&gt;
        }&lt;br /&gt;
	&lt;br /&gt;
	# This tells DRBD what policy to use when a fence is required.&lt;br /&gt;
        disk {&lt;br /&gt;
		# This tells DRBD to block I/O (resource) and then try to fence&lt;br /&gt;
		# the other node (stonith). The &#039;stonith&#039; option requires that&lt;br /&gt;
		# we set a fence handler below. The name &#039;stonith&#039; comes from&lt;br /&gt;
		# &amp;quot;Shoot The Other Nide In The Head&amp;quot; and is a term used in&lt;br /&gt;
		# other clustering environments. It is synonomous with with&lt;br /&gt;
		# &#039;fence&#039;.&lt;br /&gt;
                fencing		resource-and-stonith;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
	# We set &#039;stonith&#039; above, so here we tell DRBD how to actually fence&lt;br /&gt;
	# the other node.&lt;br /&gt;
        handlers {&lt;br /&gt;
		# The term &#039;outdate-peer&#039; comes from other scripts that flag&lt;br /&gt;
		# the other node&#039;s resource backing device as &#039;Inconsistent&#039;.&lt;br /&gt;
		# In our case though, we&#039;re flat-out fencing the other node,&lt;br /&gt;
		# which has the same effective result.&lt;br /&gt;
                outdate-peer	&amp;quot;/sbin/obliterate-peer.sh&amp;quot;;&lt;br /&gt;
        }&lt;br /&gt;
	&lt;br /&gt;
	# Here we tell DRBD that we want to use Primary/Primary mode. It is&lt;br /&gt;
	# also where we define split-brain (sb) recovery policies. As we&#039;ll be&lt;br /&gt;
	# running all of our resources in Primary/Primary, only the&lt;br /&gt;
	# &#039;after-sb-2pri&#039; really means anything to us.&lt;br /&gt;
        net {&lt;br /&gt;
		# Tell DRBD to allow dual-primary.&lt;br /&gt;
                allow-two-primaries;&lt;br /&gt;
&lt;br /&gt;
		# Set the recover policy for split-brain recover when no device&lt;br /&gt;
		# in the resource was primary.&lt;br /&gt;
                after-sb-0pri	discard-zero-changes;&lt;br /&gt;
&lt;br /&gt;
		# Now if one device was primary.&lt;br /&gt;
                after-sb-1pri	discard-secondary;&lt;br /&gt;
&lt;br /&gt;
		# Finally, set the policy when both nodes were Primary. The&lt;br /&gt;
		# only viable option is &#039;disconnect&#039;, which tells DRBD to&lt;br /&gt;
		# simply tear-down the DRBD resource right away and wait for&lt;br /&gt;
		# the administrator to manually invalidate one side of the&lt;br /&gt;
		# resource.&lt;br /&gt;
                after-sb-2pri	disconnect;&lt;br /&gt;
        }&lt;br /&gt;
	&lt;br /&gt;
	# This tells DRBD what to do when the resource starts.&lt;br /&gt;
        startup {&lt;br /&gt;
		# In our case, we&#039;re telling DRBD to promote both devices in&lt;br /&gt;
		# our resource to Primary on start.&lt;br /&gt;
                become-primary-on 	both;&lt;br /&gt;
        }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
# The &#039;resource&#039; directive defines a given resource and must be followed by the&lt;br /&gt;
# resource&#039;s name.&lt;br /&gt;
# This will be used as the GFS2 partition for shared files.&lt;br /&gt;
resource r0 {&lt;br /&gt;
	# This is the /dev/ device to create to make available this DRBD&lt;br /&gt;
	# resource.&lt;br /&gt;
        device 		/dev/drbd0;&lt;br /&gt;
	&lt;br /&gt;
	# This tells DRBD where to store it&#039;s internal state information. We&lt;br /&gt;
	# will use &#039;internal&#039;, which tells DRBD to store the information at the&lt;br /&gt;
	# end of the resource&#039;s space.&lt;br /&gt;
        meta-disk 	internal;&lt;br /&gt;
	&lt;br /&gt;
	# The next two &#039;on&#039; directives setup each individual node&#039;s settings.&lt;br /&gt;
	# The value after the &#039;on&#039; directive *MUST* match the output of&lt;br /&gt;
	# `uname -n` on each node.&lt;br /&gt;
        on an-node04.alteeve.com {&lt;br /&gt;
		# This is the network IP address on the network interface and&lt;br /&gt;
		# the TCP port to use for communication between the nodes. Note&lt;br /&gt;
		# that the IP address below in on our Storage Network. The TCP&lt;br /&gt;
		# port must be unique per resource, but the interface itself&lt;br /&gt;
		# can be shared. &lt;br /&gt;
		# IPv6 is usable with &#039;address ipv6 [address]:port&#039;.&lt;br /&gt;
                address 	192.168.2.74:7789;&lt;br /&gt;
		&lt;br /&gt;
		# This is the node&#039;s storage device that will back this&lt;br /&gt;
		# resource.&lt;br /&gt;
                disk    	/dev/sda5;&lt;br /&gt;
        }&lt;br /&gt;
	&lt;br /&gt;
	# Same as above, but altered to reflect the second node.&lt;br /&gt;
        on an-node05.alteeve.com {&lt;br /&gt;
                address 	192.168.2.75:7789;&lt;br /&gt;
                disk    	/dev/sda5;&lt;br /&gt;
        }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
# This will be used to host VMs running primarily on an-node04.&lt;br /&gt;
resource r1 {&lt;br /&gt;
        device          /dev/drbd1;&lt;br /&gt;
&lt;br /&gt;
        meta-disk       internal;&lt;br /&gt;
&lt;br /&gt;
        on an-node04.alteeve.com {&lt;br /&gt;
                address         192.168.2.74:7790;&lt;br /&gt;
                disk            /dev/sda6;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        on an-node05.alteeve.com {&lt;br /&gt;
                address         192.168.2.75:7790;&lt;br /&gt;
                disk            /dev/sda6;&lt;br /&gt;
        }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
# This will be used to host VMs running primarily on an-node05.&lt;br /&gt;
resource r2 {&lt;br /&gt;
        device          /dev/drbd2;&lt;br /&gt;
&lt;br /&gt;
        meta-disk       internal;&lt;br /&gt;
&lt;br /&gt;
        on an-node04.alteeve.com {&lt;br /&gt;
                address         192.168.2.74:7791;&lt;br /&gt;
                disk            /dev/sda7;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        on an-node05.alteeve.com {&lt;br /&gt;
                address         192.168.2.75:7791;&lt;br /&gt;
                disk            /dev/sda7;&lt;br /&gt;
        }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
# This will be set aside as free space for future expansion.&lt;br /&gt;
resource r3 {&lt;br /&gt;
        device          /dev/drbd3;&lt;br /&gt;
&lt;br /&gt;
        meta-disk       internal;&lt;br /&gt;
&lt;br /&gt;
        on an-node04.alteeve.com {&lt;br /&gt;
                address         192.168.2.74:7792;&lt;br /&gt;
                disk            /dev/sda8;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        on an-node05.alteeve.com {&lt;br /&gt;
                address         192.168.2.75:7792;&lt;br /&gt;
                disk            /dev/sda8;&lt;br /&gt;
        }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Validating the /etc/drbd.conf Syntax ====&lt;br /&gt;
&lt;br /&gt;
To check for errors, we will validate the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/drbd.conf&amp;lt;/span&amp;gt; file. To do this, run &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;drbdadm dump&amp;lt;/span&amp;gt;. If there are syntactical errors, fix them before proceeding. Once the file is correct, it will be dump it&#039;s view of the configuration to the screen with minimal commenting. Don&#039;t worry about slight differences (ie: &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;meta-disk external;&amp;lt;/span&amp;gt; being inside the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;on { }&amp;lt;/span&amp;gt; directives).&lt;br /&gt;
&lt;br /&gt;
The first time you ever do this, you will also see a note telling you that you are the &#039;&#039;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;n&amp;lt;/span&amp;gt;&#039;&#039;th DRBD user.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
drbdadm dump&lt;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 9369th user to install this version&lt;br /&gt;
# /etc/drbd.conf&lt;br /&gt;
common {&lt;br /&gt;
    protocol               C;&lt;br /&gt;
    net {&lt;br /&gt;
        allow-two-primaries;&lt;br /&gt;
        after-sb-0pri    discard-zero-changes;&lt;br /&gt;
        after-sb-1pri    discard-secondary;&lt;br /&gt;
        after-sb-2pri    disconnect;&lt;br /&gt;
    }&lt;br /&gt;
    disk {&lt;br /&gt;
        fencing          resource-and-stonith;&lt;br /&gt;
    }&lt;br /&gt;
    syncer {&lt;br /&gt;
        rate             15M;&lt;br /&gt;
    }&lt;br /&gt;
    startup {&lt;br /&gt;
        become-primary-on both;&lt;br /&gt;
    }&lt;br /&gt;
    handlers {&lt;br /&gt;
        fence-peer       /sbin/obliterate-peer.sh;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
# resource r0 on an-node04.alteeve.com: not ignored, not stacked&lt;br /&gt;
resource r0 {&lt;br /&gt;
    on an-node04.alteeve.com {&lt;br /&gt;
        device           /dev/drbd0 minor 0;&lt;br /&gt;
        disk             /dev/sda5;&lt;br /&gt;
        address          ipv4 192.168.2.74:7789;&lt;br /&gt;
        meta-disk        internal;&lt;br /&gt;
    }&lt;br /&gt;
    on an-node05.alteeve.com {&lt;br /&gt;
        device           /dev/drbd0 minor 0;&lt;br /&gt;
        disk             /dev/sda5;&lt;br /&gt;
        address          ipv4 192.168.2.75:7789;&lt;br /&gt;
        meta-disk        internal;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
# resource r1 on an-node04.alteeve.com: not ignored, not stacked&lt;br /&gt;
resource r1 {&lt;br /&gt;
    on an-node04.alteeve.com {&lt;br /&gt;
        device           /dev/drbd1 minor 1;&lt;br /&gt;
        disk             /dev/sda6;&lt;br /&gt;
        address          ipv4 192.168.2.74:7790;&lt;br /&gt;
        meta-disk        internal;&lt;br /&gt;
    }&lt;br /&gt;
    on an-node05.alteeve.com {&lt;br /&gt;
        device           /dev/drbd1 minor 1;&lt;br /&gt;
        disk             /dev/sda6;&lt;br /&gt;
        address          ipv4 192.168.2.75:7790;&lt;br /&gt;
        meta-disk        internal;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
# resource r2 on an-node04.alteeve.com: not ignored, not stacked&lt;br /&gt;
resource r2 {&lt;br /&gt;
    on an-node04.alteeve.com {&lt;br /&gt;
        device           /dev/drbd2 minor 2;&lt;br /&gt;
        disk             /dev/sda7;&lt;br /&gt;
        address          ipv4 192.168.2.74:7791;&lt;br /&gt;
        meta-disk        internal;&lt;br /&gt;
    }&lt;br /&gt;
    on an-node05.alteeve.com {&lt;br /&gt;
        device           /dev/drbd2 minor 2;&lt;br /&gt;
        disk             /dev/sda7;&lt;br /&gt;
        address          ipv4 192.168.2.75:7791;&lt;br /&gt;
        meta-disk        internal;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
# resource r3 on an-node04.alteeve.com: not ignored, not stacked&lt;br /&gt;
resource r3 {&lt;br /&gt;
    on an-node04.alteeve.com {&lt;br /&gt;
        device           /dev/drbd3 minor 3;&lt;br /&gt;
        disk             /dev/sda8;&lt;br /&gt;
        address          ipv4 192.168.2.74:7792;&lt;br /&gt;
        meta-disk        internal;&lt;br /&gt;
    }&lt;br /&gt;
    on an-node05.alteeve.com {&lt;br /&gt;
        device           /dev/drbd3 minor 3;&lt;br /&gt;
        disk             /dev/sda8;&lt;br /&gt;
        address          ipv4 192.168.2.75:7792;&lt;br /&gt;
        meta-disk        internal;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Copying The /etc/drbd.conf to the Second Node ====&lt;br /&gt;
&lt;br /&gt;
Assuming you write the first &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/drbd.conf&amp;lt;/span&amp;gt; file on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt;. So now we need to copy it to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt; before we can start things up.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
rsync -av /etc/drbd.conf root@an-node05:/etc/&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
building file list ... done&lt;br /&gt;
drbd.conf&lt;br /&gt;
&lt;br /&gt;
sent 5577 bytes  received 48 bytes  3750.00 bytes/sec&lt;br /&gt;
total size is 5479  speedup is 0.97&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Loading the DRBD Module ===&lt;br /&gt;
&lt;br /&gt;
By default, the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/init.d/drbd&amp;lt;/span&amp;gt; initialization script handles loading and unloading the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;drbd&amp;lt;/span&amp;gt; module. It&#039;s too early for us to start the DRBD resources using the initialization script, so we need to manually load the module ourselves. This will only need to be done once. After you get the DRBD resources up for the first time, you can safely use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/init.d/drbd&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
To load the module, run:&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;
You can verify that the module is loaded using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;lsmod&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;
lsmod |grep 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;
drbd                  277144  0 &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The module also creates a &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/proc&amp;lt;/span&amp;gt; file called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;drbd&amp;lt;/span&amp;gt;. By &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cat&amp;lt;/span&amp;gt;&#039;ing this, we can watch the progress of our work. I&#039;d recommend opening a terminal windows for each node and tracking it using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;watch&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;
watch cat /proc/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;
Every 2.0s: cat /proc/drbd                                                                     Tue Mar 29 13:03:44 2011&lt;br /&gt;
&lt;br /&gt;
version: 8.3.8 (api:88/proto:86-94)&lt;br /&gt;
GIT-hash: d78846e52224fd00562f7c225bcc25b2d422321d build by mockbuild@builder10.centos.org, 2010-06-04 08:04:27&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the steps ahead, I will show what the output from &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;watch&amp;lt;/span&amp;gt;&#039;ing &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/proc/drbd&amp;lt;/span&amp;gt; will be.&lt;br /&gt;
&lt;br /&gt;
=== Initializing Our Resources ===&lt;br /&gt;
&lt;br /&gt;
Before we can start each resource, we must first initialize each of the backing device. This is done by running &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;drbdadm create-md x&amp;lt;/span&amp;gt;. We&#039;ll run this on both nodes, replacing &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;x&amp;lt;/span&amp;gt; with the four resource names.&lt;br /&gt;
&lt;br /&gt;
The first time you do this, the command will execute right away.&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;
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;
If you&#039;ve ever used the partition in a DRBD device before though, you will need to confirm that you want to over-write the existing meta-data.&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;
&lt;br /&gt;
Type &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;yes&amp;lt;/span&amp;gt; when prompted.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
You want me to create a v08 style flexible-size internal meta data block.&lt;br /&gt;
There appears to be a v08 flexible-size internal meta data block&lt;br /&gt;
already in place on /dev/sda5 at byte offset 10010128384&lt;br /&gt;
Do you really want to overwrite the existing v08 meta-data?&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
[need to type &#039;yes&#039; to confirm] yes&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&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;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Repeat for all four resource names, then do the same on the other node.&lt;br /&gt;
&lt;br /&gt;
{{note|1=If you are trying to initialize a resource&#039;s backing device that has been used before, you may need to wipe out the first few blocks.}}&lt;br /&gt;
&lt;br /&gt;
If you try to initialize the resource&#039;s backing device and get an error like below, you will need to &amp;quot;zero out&amp;quot; the first bit of the resource. This is done by using the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;dd&amp;lt;/span&amp;gt; (disk duplication) program, reading in from the special &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/zero&amp;lt;/span&amp;gt; file and writing out a set number of block (usually 4096 [[KiB]]) at the start of the DRBD resource.&lt;br /&gt;
&lt;br /&gt;
If you see the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
pvs stderr:        _undo_flock /var/lock/lvm/V_drbd_sh0_vg0&lt;br /&gt;
pvs stderr:  Skipping volume group drbd_sh0_vg0&lt;br /&gt;
pvs stderr:      Unlocking /var/lock/lvm/P_global&lt;br /&gt;
pvs stderr:        _undo_flock /var/lock/lvm/P_global&lt;br /&gt;
&lt;br /&gt;
md_offset 10010128384&lt;br /&gt;
al_offset 10010095616&lt;br /&gt;
bm_offset 10009788416&lt;br /&gt;
&lt;br /&gt;
Found LVM2 physical volume signature&lt;br /&gt;
     9775184 kB left usable by current configuration&lt;br /&gt;
Could not determine the size of the actually used data area.&lt;br /&gt;
&lt;br /&gt;
Device size would be truncated, which&lt;br /&gt;
would corrupt data and result in&lt;br /&gt;
&#039;access beyond end of device&#039; errors.&lt;br /&gt;
If you want me to do this, you need to zero out the first part&lt;br /&gt;
of the device (destroy the content).&lt;br /&gt;
You should be very sure that you mean it.&lt;br /&gt;
Operation refused.&lt;br /&gt;
&lt;br /&gt;
Command &#039;drbdmeta 0 v08 /dev/sda5 internal create-md&#039; terminated with exit code 40&lt;br /&gt;
drbdadm create-md r0: exited with code 40&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then you will need to zero the start of the backing device.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
dd if=/dev/zero of=/dev/sda5 count=10000&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
10000+0 records in&lt;br /&gt;
10000+0 records out&lt;br /&gt;
5120000 bytes (5.1 MB) copied, 0.101682 seconds, 50.4 MB/s&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You should now be able to initialize the resource.&lt;br /&gt;
&lt;br /&gt;
=== Initial Connections ===&lt;br /&gt;
&lt;br /&gt;
As this is the first time that the DRBD resource will be started, neither side will be in a &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;consistent&amp;lt;/span&amp;gt; state. The effect is that we will not be able to promote either node to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Primary&amp;lt;/span&amp;gt;. So we need to tell DRBD that it must consider one side to be valid and, thus, overwrite the other node&#039;s data.&lt;br /&gt;
&lt;br /&gt;
{{note|1=This is the &#039;&#039;&#039;only&#039;&#039;&#039; time you should ever use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--overwrite-data-of-peer&amp;lt;/span&amp;gt;! Never use it to recover from a split brain.}}&lt;br /&gt;
&lt;br /&gt;
The steps we will now take for each resource are:&lt;br /&gt;
* Attach each node&#039;s backing device to the DRBD resource.&lt;br /&gt;
* Establish the network connection between the two nodes.&lt;br /&gt;
* Force one node&#039;s backing device to be considered &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;UpToDate&amp;lt;/span&amp;gt; and promote it to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Primary&amp;lt;/span&amp;gt;.&lt;br /&gt;
* Promote the second node to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Primary&amp;lt;/span&amp;gt;&lt;br /&gt;
* Bump the synchronization rate to the value specified in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/drbd.conf&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Now lets walk through these steps, taking a look at &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/proc/drbd&amp;lt;/span&amp;gt; after each step.&lt;br /&gt;
&lt;br /&gt;
{{note|1=You can save some typing with a &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;bash&amp;lt;/span&amp;gt; trick. Where you would normally call &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;r0&amp;lt;/span&amp;gt;, then &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;r1&amp;lt;/span&amp;gt;, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;r2&amp;lt;/span&amp;gt; a last &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;r3&amp;lt;/span&amp;gt;, you can call all at once by instead calling &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;command&amp;gt; r{0,1,2,3}&amp;lt;/span&amp;gt;.}}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On Both Nodes&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
Attach the resources local backing devices to their DRBD resources. That is, connect the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/sda{5,6,7,8}&amp;lt;/span&amp;gt; to their corresponding &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;r{0,1,2,3}&amp;lt;/span&amp;gt; resources.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
drbdadm attach r{0,1,2,3}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
version: 8.3.8 (api:88/proto:86-94)&lt;br /&gt;
GIT-hash: d78846e52224fd00562f7c225bcc25b2d422321d build by mockbuild@builder10.centos.org, 2010-06-04 08:04:27&lt;br /&gt;
 0: cs:StandAlone ro:Secondary/Unknown ds:Inconsistent/DUnknown   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:9775184&lt;br /&gt;
 1: cs:StandAlone ro:Secondary/Unknown ds:Inconsistent/DUnknown   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:97664116&lt;br /&gt;
 2: cs:StandAlone ro:Secondary/Unknown ds:Inconsistent/DUnknown   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:97664116&lt;br /&gt;
 3: cs:StandAlone ro:Secondary/Unknown ds:Inconsistent/DUnknown   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:257843340&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On Both Nodes&#039;&#039;&#039;: &lt;br /&gt;
&lt;br /&gt;
Now we&#039;ll connect the corresponding resource backing devices on each node together to create the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/drbdX&amp;lt;/span&amp;gt; devices. Note that while one node is connecting, it&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/proc/drbd&amp;lt;/span&amp;gt; will show the resource as being in the connection state of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;WFConnection&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 connect r{0,1,2,3}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
version: 8.3.8 (api:88/proto:86-94)&lt;br /&gt;
GIT-hash: d78846e52224fd00562f7c225bcc25b2d422321d build by mockbuild@builder10.centos.org, 2010-06-04 08:04:27&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:9775184&lt;br /&gt;
 1: 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:97664116&lt;br /&gt;
 2: 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:97664116&lt;br /&gt;
 3: 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:257843340&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On One Node Only&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
As the resource is totally new, we&#039;ll need to tell DRBD that one node&#039;s backing device is &amp;quot;more&amp;quot; valid than the other. It is entirely arbitrary which node we run this on. I run this on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt; out of habit. This step also promotes the local resource to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Primary&amp;lt;/span&amp;gt;, which means that it is usable by the local system.&lt;br /&gt;
&lt;br /&gt;
{{note|1=An alternative to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--overwrite-data-of-peer&amp;lt;/span&amp;gt; is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;drbdadm -- --clear-bitmap new-current-uuid res&amp;lt;/span&amp;gt; followed by &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;drbdadm primary res&amp;lt;/span&amp;gt;. This will instantly mark both sides of the DRBD resource as &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;UpToDate&amp;lt;/span&amp;gt; without needing to perform the initial sync.}}&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 r{0,1,2,3}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
version: 8.3.8 (api:88/proto:86-94)&lt;br /&gt;
GIT-hash: d78846e52224fd00562f7c225bcc25b2d422321d build by mockbuild@builder10.centos.org, 2010-06-04 08:04:27&lt;br /&gt;
 0: cs:SyncSource ro:Primary/Secondary ds:UpToDate/Inconsistent C r----&lt;br /&gt;
    ns:896 nr:0 dw:0 dr:896 al:0 bm:0 lo:0 pe:0 ua:0 ap:0 ep:1 wo:b oos:9774288&lt;br /&gt;
        [&amp;gt;....................] sync&#039;ed:  0.1% (9544/9544)M delay_probe: 701&lt;br /&gt;
        finish: 4:31:30 speed: 448 (448) K/sec&lt;br /&gt;
 1: cs:SyncSource ro:Primary/Secondary ds:UpToDate/Inconsistent C r----&lt;br /&gt;
    ns:736 nr:0 dw:0 dr:736 al:0 bm:0 lo:0 pe:0 ua:0 ap:0 ep:1 wo:b oos:97663380&lt;br /&gt;
        [&amp;gt;....................] sync&#039;ed:  0.1% (95372/95372)M delay_probe: 620&lt;br /&gt;
        finish: 67:49:18 speed: 368 (368) K/sec&lt;br /&gt;
 2: cs:SyncSource ro:Primary/Secondary ds:UpToDate/Inconsistent C r----&lt;br /&gt;
    ns:672 nr:0 dw:0 dr:672 al:0 bm:0 lo:0 pe:0 ua:0 ap:0 ep:1 wo:b oos:97663444&lt;br /&gt;
        [&amp;gt;....................] sync&#039;ed:  0.1% (95372/95372)M delay_probe: 556&lt;br /&gt;
        finish: 67:49:18 speed: 336 (336) K/sec&lt;br /&gt;
 3: cs:SyncSource ro:Primary/Secondary ds:UpToDate/Inconsistent C r----&lt;br /&gt;
    ns:576 nr:0 dw:0 dr:576 al:0 bm:0 lo:0 pe:0 ua:0 ap:0 ep:1 wo:b oos:257842764&lt;br /&gt;
        [&amp;gt;....................] sync&#039;ed:  0.1% (251796/251800)M delay_probe: 447&lt;br /&gt;
        finish: 89:31:43 speed: 576 (576) K/sec&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On The Other Node&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
The last required step is to promote the other node&#039;s resource to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Primary&amp;lt;/span&amp;gt; as well.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
drbdadm primary r{0,1,2,3}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
version: 8.3.8 (api:88/proto:86-94)&lt;br /&gt;
GIT-hash: d78846e52224fd00562f7c225bcc25b2d422321d build by mockbuild@builder10.centos.org, 2010-06-04 08:04:27&lt;br /&gt;
 0: cs:SyncSource ro:Primary/Primary ds:UpToDate/Inconsistent C r----&lt;br /&gt;
    ns:159008 nr:0 dw:0 dr:159008 al:0 bm:9 lo:0 pe:0 ua:0 ap:0 ep:1 wo:b oos:9616176&lt;br /&gt;
        [&amp;gt;....................] sync&#039;ed:  1.7% (9388/9544)M delay_probe: 130846&lt;br /&gt;
        finish: 6:40:40 speed: 256 (312) K/sec&lt;br /&gt;
 1: cs:SyncSource ro:Primary/Primary ds:UpToDate/Inconsistent C r----&lt;br /&gt;
    ns:161152 nr:0 dw:0 dr:161152 al:0 bm:9 lo:0 pe:0 ua:0 ap:0 ep:1 wo:b oos:97502964&lt;br /&gt;
        [&amp;gt;....................] sync&#039;ed:  0.2% (95216/95372)M delay_probe: 131004&lt;br /&gt;
        finish: 67:42:37 speed: 0 (316) K/sec&lt;br /&gt;
 2: cs:SyncSource ro:Primary/Primary ds:UpToDate/Inconsistent C r----&lt;br /&gt;
    ns:161024 nr:0 dw:0 dr:161024 al:0 bm:9 lo:0 pe:0 ua:0 ap:0 ep:1 wo:b oos:97503092&lt;br /&gt;
        [&amp;gt;....................] sync&#039;ed:  0.2% (95216/95372)M delay_probe: 130852&lt;br /&gt;
        finish: 76:10:27 speed: 348 (316) K/sec&lt;br /&gt;
 3: cs:SyncSource ro:Primary/Primary ds:UpToDate/Inconsistent C r----&lt;br /&gt;
    ns:160832 nr:0 dw:0 dr:160832 al:0 bm:9 lo:0 pe:0 ua:0 ap:0 ep:1 wo:b oos:257682508&lt;br /&gt;
        [&amp;gt;....................] sync&#039;ed:  0.1% (251640/251800)M delay_probe: 130729&lt;br /&gt;
        finish: 178:56:46 speed: 128 (316) K/sec&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{note|1=From here on in, the steps shown are not strictly needed. The first step is highly recommended, as it is needed to set the desired sync rate, but DRBD will work fine as it now is.}}&lt;br /&gt;
&lt;br /&gt;
DRBD is a bit sensitive to performance issues, so we have to handle multiple resources syncing at the same time a little carefully. The temptation to just raise the sync rate on all resources will get us into trouble.&lt;br /&gt;
&lt;br /&gt;
The safest bet to get all of the resources updated is to pause the synchronization on all but one resource, bump the sync rate up to a little under the maximum write speed of the resource, waiting for the resource to sync, resuming sync on the next resource and so on.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On One Node&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
Let&#039;s pause the synchronization on all but 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 pause-sync r{1,2,3}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
version: 8.3.8 (api:88/proto:86-94)&lt;br /&gt;
GIT-hash: d78846e52224fd00562f7c225bcc25b2d422321d build by mockbuild@builder10.centos.org, 2010-06-04 08:04:27&lt;br /&gt;
 0: cs:SyncSource ro:Primary/Primary ds:UpToDate/Inconsistent C r----&lt;br /&gt;
    ns:32288 nr:0 dw:0 dr:32288 al:0 bm:1 lo:0 pe:0 ua:0 ap:0 ep:1 wo:b oos:9742896&lt;br /&gt;
        [&amp;gt;....................] sync&#039;ed:  0.4% (9512/9544)M delay_probe: 26632&lt;br /&gt;
        finish: 6:45:57 speed: 336 (312) K/sec&lt;br /&gt;
 1: cs:PausedSyncS ro:Primary/Primary ds:UpToDate/Inconsistent C r--u-&lt;br /&gt;
    ns:13184 nr:0 dw:0 dr:13184 al:0 bm:0 lo:0 pe:0 ua:0 ap:0 ep:1 wo:b oos:97650932&lt;br /&gt;
 2: cs:PausedSyncS ro:Primary/Primary ds:UpToDate/Inconsistent C r--u-&lt;br /&gt;
    ns:12192 nr:0 dw:0 dr:12192 al:0 bm:0 lo:0 pe:0 ua:0 ap:0 ep:1 wo:b oos:97651924&lt;br /&gt;
 3: cs:PausedSyncS ro:Primary/Primary ds:UpToDate/Inconsistent C r--u-&lt;br /&gt;
    ns:30656 nr:0 dw:0 dr:30656 al:0 bm:1 lo:0 pe:0 ua:0 ap:0 ep:1 wo:b oos:257812684&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I know that on my server, I can get a maximum write speed of roughly 40 [[MiB]]/sec. So I will manually over-ride the defined sync rate of 15 MiB/sec and set it to 35 MiB/sec. This uses a new DRBD command called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;drbdsetup&amp;lt;/span&amp;gt; and takes the DRBD device instead of the resource name.&lt;br /&gt;
&lt;br /&gt;
{{note|1=The transfer speed will not instantly reach maximum. It takes some time for synchronization rate changes to ramp up and down.}}&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;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
version: 8.3.8 (api:88/proto:86-94)&lt;br /&gt;
GIT-hash: d78846e52224fd00562f7c225bcc25b2d422321d build by mockbuild@builder10.centos.org, 2010-06-04 08:04:27&lt;br /&gt;
 0: cs:SyncTarget ro:Primary/Primary ds:Inconsistent/UpToDate C r----&lt;br /&gt;
    ns:0 nr:253216 dw:252128 dr:0 al:0 bm:15 lo:35 pe:78 ua:34 ap:0 ep:1 wo:b oos:9523056&lt;br /&gt;
        [&amp;gt;....................] sync&#039;ed:  2.7% (9296/9544)M queue_delay: 4.3 ms&lt;br /&gt;
        finish: 0:04:39 speed: 34,040 (1,984) want: 35,840 K/sec&lt;br /&gt;
 1: cs:PausedSyncT ro:Primary/Primary ds:Inconsistent/UpToDate C r-p--&lt;br /&gt;
    ns:0 nr:13184 dw:13184 dr:0 al:0 bm:0 lo:0 pe:0 ua:0 ap:0 ep:1 wo:b oos:97650932&lt;br /&gt;
 2: cs:PausedSyncT ro:Primary/Primary ds:Inconsistent/UpToDate C r-p--&lt;br /&gt;
    ns:0 nr:12192 dw:12192 dr:0 al:0 bm:0 lo:0 pe:0 ua:0 ap:0 ep:1 wo:b oos:97651924&lt;br /&gt;
 3: cs:PausedSyncT ro:Primary/Primary ds:Inconsistent/UpToDate C r-p--&lt;br /&gt;
    ns:0 nr:30656 dw:30656 dr:0 al:0 bm:1 lo:0 pe:0 ua:0 ap:0 ep:1 wo:b oos:257812684&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{note|1=The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;want: 35,840 K/sec&amp;lt;/span&amp;gt; will not show up on the node that you increased the sync rate on. Also note that it will occasionally show &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;want: 0 K/sec&amp;lt;/span&amp;gt;. So long as the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;oos:x&amp;lt;/span&amp;gt; (out of sync blocks) value keeps dropping and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;speed&amp;lt;/span&amp;gt; is still reasonable, the sync is fine.}}&lt;br /&gt;
&lt;br /&gt;
After a period of time, you will see the synchronization finish and the resource will then be in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;UpToDate/UpToDate&amp;lt;/span&amp;gt; state. We&#039;ll now tell DRBD to restore the defined sync rate of 15 MiB/sec, resume synchronization of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;r1&amp;lt;/span&amp;gt; and increase the sync rate of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;r1&amp;lt;/span&amp;gt; to 35 MiB/sec.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
drbdadm syncer r0&lt;br /&gt;
drbdadm resume-sync r1&lt;br /&gt;
drbdsetup /dev/drbd1 syncer -r 35M&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
version: 8.3.8 (api:88/proto:86-94)&lt;br /&gt;
GIT-hash: d78846e52224fd00562f7c225bcc25b2d422321d build by mockbuild@builder10.centos.org, 2010-06-04 08:04:27&lt;br /&gt;
 0: cs:Connected ro:Primary/Primary ds:UpToDate/UpToDate C r----&lt;br /&gt;
    ns:0 nr:9775184 dw:9775184 dr:0 al:0 bm:597 lo:0 pe:0 ua:0 ap:0 ep:1 wo:b oos:0&lt;br /&gt;
 1: cs:SyncTarget ro:Primary/Primary ds:Inconsistent/UpToDate C r----&lt;br /&gt;
    ns:0 nr:851872 dw:851872 dr:0 al:0 bm:51 lo:0 pe:0 ua:0 ap:0 ep:1 wo:b oos:96812244&lt;br /&gt;
        [&amp;gt;....................] sync&#039;ed:  0.9% (94540/95372)M queue_delay: 0.0 ms&lt;br /&gt;
        finish: 0:24:54 speed: 64,480 (11,508) want: 35,840 K/sec&lt;br /&gt;
 2: cs:PausedSyncT ro:Primary/Primary ds:Inconsistent/UpToDate C r-p--&lt;br /&gt;
    ns:0 nr:12192 dw:12192 dr:0 al:0 bm:0 lo:0 pe:0 ua:0 ap:0 ep:1 wo:b oos:97651924&lt;br /&gt;
 3: cs:PausedSyncT ro:Primary/Primary ds:Inconsistent/UpToDate C r-p--&lt;br /&gt;
    ns:0 nr:30656 dw:30656 dr:0 al:0 bm:1 lo:0 pe:0 ua:0 ap:0 ep:1 wo:b oos:257812684&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As before, once &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;r1&amp;lt;/span&amp;gt; is finished syncing, we&#039;ll restore the defined sync rate, resume sync on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;r2&amp;lt;/span&amp;gt; and push the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;r2&amp;lt;/span&amp;gt; sync rate up. Finally, we&#039;ll do the same to the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;r3&amp;lt;/span&amp;gt; resource. Once the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;r3&amp;lt;/span&amp;gt; resource is synced, we&#039;ll restore it&#039;s sync rate and we&#039;ll be finished syncing all of the resources.&lt;br /&gt;
&lt;br /&gt;
Once all resources are synchronized, you should see this on both nodes:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
version: 8.3.8 (api:88/proto:86-94)&lt;br /&gt;
GIT-hash: d78846e52224fd00562f7c225bcc25b2d422321d build by mockbuild@builder10.centos.org, 2010-06-04 08:04:27&lt;br /&gt;
 0: cs:Connected ro:Primary/Primary ds:UpToDate/UpToDate C r----&lt;br /&gt;
    ns:9775184 nr:0 dw:0 dr:9775184 al:0 bm:597 lo:0 pe:0 ua:0 ap:0 ep:1 wo:b oos:0&lt;br /&gt;
 1: cs:Connected ro:Primary/Primary ds:UpToDate/UpToDate C r----&lt;br /&gt;
    ns:97664116 nr:0 dw:0 dr:97664116 al:0 bm:5961 lo:0 pe:0 ua:0 ap:0 ep:1 wo:b oos:0&lt;br /&gt;
 2: cs:Connected ro:Primary/Primary ds:UpToDate/UpToDate C r----&lt;br /&gt;
    ns:97664116 nr:0 dw:0 dr:97664116 al:0 bm:5961 lo:0 pe:0 ua:0 ap:0 ep:1 wo:b oos:0&lt;br /&gt;
 3: cs:Connected ro:Primary/Primary ds:UpToDate/UpToDate C r----&lt;br /&gt;
    ns:257843340 nr:0 dw:0 dr:257843340 al:0 bm:15738 lo:0 pe:0 ua:0 ap:0 ep:1 wo:b oos:0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
That&#039;s it, your resource is ready for use! You do not need to wait for the sync to complete before proceeding. However, ensure that the sync is complete before bringing up VMs on the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Inconsistent&amp;lt;/span&amp;gt; side.&lt;br /&gt;
&lt;br /&gt;
{{note|1=For the rest of the tutorial, we will be ignoring &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;r3&amp;lt;/span&amp;gt; as it&#039;s just a bank of spare disk space.}}&lt;br /&gt;
&lt;br /&gt;
==== Overdoing It ====&lt;br /&gt;
&lt;br /&gt;
If you try to sync too many resources at one or if you set the sync rate too high, you may find that one or more of the resources &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;want: 0 K/sec&amp;lt;/span&amp;gt;. This is a sign that the disks are being hit too hard, and you need to back off the sync rate or flat out pause the synchronization of some resources until the other ones have finished.&lt;br /&gt;
&lt;br /&gt;
{{note|1=In some cases, pushing DRBD too hard may cause synchronization to stall entirely. If this happens, you can try to pause, then resume the sync. If that doesn&#039;t fix it, try changing the sync speed down to a lower speed (see the next section), then pause and resume. If it is still stalling, run &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/init.d/drbd stop&amp;lt;/span&amp;gt; on both nodes, then &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/init.d/drbd start&amp;lt;/span&amp;gt;, pause all but one resource and then set the sync speed on the last resource. Start with a low value and work your way up until you find the maximum stable sync speed for your configuration.}}&lt;br /&gt;
&lt;br /&gt;
==== A Note on Synchronization Speeds ====&lt;br /&gt;
&lt;br /&gt;
As discussed earlier while configuring &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/drbd.conf&amp;lt;/span&amp;gt;, we do not want to have the sync rate set too high. However, if you know that your the disk(s) backing your DRBD resource will not be in use for a while, then you can temporarily drive up the sync rate as we saw above. This can also be used in reverse. If you expect periods of high disk I/O, you can use this same command to temporarily throttle synchronization.&lt;br /&gt;
&lt;br /&gt;
The command to raise the sync rate is below. Note that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;drbdsetup /dev/drbdX&amp;lt;/span&amp;gt; is used here.&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 40M&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To restore it back to the rate set in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/drbd.conf&amp;lt;/span&amp;gt;, run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&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 Clustered LVM ==&lt;br /&gt;
&lt;br /&gt;
This step will have us create three [[LVM]] physical volumes, one for each of the allocated DRBD resources, and then creating three separate volume groups. At this stage, the only logical volume we will create will be for the [[GFS2]] partition. The rest of the LVs will be created later when we provision virtual machines.&lt;br /&gt;
&lt;br /&gt;
=== Modifying /etc/lvm/lvm.conf ===&lt;br /&gt;
&lt;br /&gt;
There are four main things we&#039;re going to change in the LVM configuration file.&lt;br /&gt;
* Change the filter to only see &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/drbd*&amp;lt;/span&amp;gt; devices. Otherwise LVM will see signatures on the DRBD resource and the backing &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/sd*&amp;lt;/span&amp;gt; devices which will cause confusion.&lt;br /&gt;
* Change the locking type to clustered locking.&lt;br /&gt;
* Disable clustered locking from falling back to local locking.&lt;br /&gt;
* We&#039;ll be identifying our clustered VGs and LVs using LVM tags. This tag will be defined using the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;volume_list&amp;lt;/span&amp;gt; variable.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/lvm/lvm.conf /etc/lvm/lvm.conf.orig&lt;br /&gt;
vim /etc/lvm/lvm.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The first step is trivial. Simple alter &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;locking_type = 1&amp;lt;/span&amp;gt; to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;locking_type = 3&amp;lt;/span&amp;gt;.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
    # Type of locking to use. Defaults to local file-based locking (1).&lt;br /&gt;
    # Turn locking off by setting to 0 (dangerous: risks metadata corruption&lt;br /&gt;
    # if LVM2 commands get run concurrently).&lt;br /&gt;
    # Type 2 uses the external shared library locking_library.&lt;br /&gt;
    # Type 3 uses built-in clustered locking.&lt;br /&gt;
    # Type 4 uses read-only locking which forbids any operations that might &lt;br /&gt;
    # change metadata.&lt;br /&gt;
    locking_type = 3&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Next, restrict the filtering so that it only sees the DRBD resources. This is done by changing the filter variable from &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;filter = [ &amp;quot;a/.*/&amp;quot; ]&amp;lt;/span&amp;gt; to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;filter = [ &amp;quot;a|/dev/drbd*|&amp;quot;, &amp;quot;r/.*/&amp;quot; ]&amp;lt;/span&amp;gt;. What this does is tell LVM to &#039;&#039;&#039;a&#039;&#039;&#039;ccept devices matching &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/drbd*&amp;lt;/span&amp;gt; and to &#039;&#039;&#039;r&#039;&#039;&#039;eject all other devices.&lt;br /&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|/dev/drbd*|&amp;quot;, &amp;quot;r/.*/&amp;quot; ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now, we&#039;ll disable falling back to local locking. The reasoning being that if the cluster lock manager [[DLM]] is not available, then we don&#039;t want to touch the storage at all. This is done by changing &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fallback_to_local_locking&amp;lt;/span&amp;gt; from &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt; to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;0&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;
    # If an attempt to initialise type 2 or type 3 locking failed, perhaps&lt;br /&gt;
    # because cluster components such as clvmd are not running, with this set&lt;br /&gt;
    # to 1 an attempt will be made to use local file-based locking (type 1).&lt;br /&gt;
    # If this succeeds, only commands against local volume groups will proceed.&lt;br /&gt;
    # Volume Groups marked as clustered will be ignored.&lt;br /&gt;
    fallback_to_local_locking = 0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Finally, tell LVM to use volumes with our tags by setting &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;volume_list&amp;lt;/span&amp;gt; to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[&amp;quot;@an-cluster01&amp;quot;]&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;
    # If volume_list is defined, each LV is only activated if there is a&lt;br /&gt;
    # match against the list.&lt;br /&gt;
    #   &amp;quot;vgname&amp;quot; and &amp;quot;vgname/lvname&amp;quot; are matched exactly.&lt;br /&gt;
    #   &amp;quot;@tag&amp;quot; matches any tag set in the LV or VG.&lt;br /&gt;
    #   &amp;quot;@*&amp;quot; matches if any tag defined on the host is also set in the LV or VG&lt;br /&gt;
    #&lt;br /&gt;
    # volume_list = [ &amp;quot;vg1&amp;quot;, &amp;quot;vg2/lvol1&amp;quot;, &amp;quot;@tag1&amp;quot;, &amp;quot;@*&amp;quot; ]&lt;br /&gt;
    volume_list = [&amp;quot;@an-cluster01&amp;quot;]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Save the file. With these chages, the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;diff&amp;lt;/span&amp;gt; should look like what is shown below.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
diff -u /etc/lvm/lvm.conf.orig /etc/lvm/lvm.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;diff&amp;quot;&amp;gt;&lt;br /&gt;
--- /etc/lvm/lvm.conf.orig	2011-05-06 15:30:43.000000000 -0400&lt;br /&gt;
+++ /etc/lvm/lvm.conf	2011-05-06 15:34:49.000000000 -0400&lt;br /&gt;
@@ -50,7 +50,8 @@&lt;br /&gt;
 &lt;br /&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/.*/&amp;quot; ]&lt;br /&gt;
+    filter = [ &amp;quot;a|/dev/drbd*|&amp;quot;, &amp;quot;r/.*/&amp;quot; ]&lt;br /&gt;
 &lt;br /&gt;
     # Exclude the cdrom drive&lt;br /&gt;
     # filter = [ &amp;quot;r|/dev/cdrom|&amp;quot; ]&lt;br /&gt;
@@ -289,7 +290,8 @@&lt;br /&gt;
     # Type 3 uses built-in clustered locking.&lt;br /&gt;
     # Type 4 uses read-only locking which forbids any operations that might &lt;br /&gt;
     # change metadata.&lt;br /&gt;
-    locking_type = 1&lt;br /&gt;
+    #locking_type = 1&lt;br /&gt;
+    locking_type = 3&lt;br /&gt;
 &lt;br /&gt;
     # Set to 0 to fail when a lock request cannot be satisfied immediately.&lt;br /&gt;
     wait_for_locks = 1&lt;br /&gt;
@@ -305,7 +307,8 @@&lt;br /&gt;
     # to 1 an attempt will be made to use local file-based locking (type 1).&lt;br /&gt;
     # If this succeeds, only commands against local volume groups will proceed.&lt;br /&gt;
     # Volume Groups marked as clustered will be ignored.&lt;br /&gt;
-    fallback_to_local_locking = 1&lt;br /&gt;
+    #fallback_to_local_locking = 1&lt;br /&gt;
+    fallback_to_local_locking = 0&lt;br /&gt;
 &lt;br /&gt;
     # Local non-LV directory that holds file-based locks while commands are&lt;br /&gt;
     # in progress.  A directory like /tmp that may get wiped on reboot is OK.&lt;br /&gt;
@@ -378,6 +381,7 @@&lt;br /&gt;
     #   &amp;quot;@*&amp;quot; matches if any tag defined on the host is also set in the LV or VG&lt;br /&gt;
     #&lt;br /&gt;
     # volume_list = [ &amp;quot;vg1&amp;quot;, &amp;quot;vg2/lvol1&amp;quot;, &amp;quot;@tag1&amp;quot;, &amp;quot;@*&amp;quot; ]&lt;br /&gt;
+    volume_list = [&amp;quot;@an-cluster01&amp;quot;]&lt;br /&gt;
 &lt;br /&gt;
     # Size (in KB) of each copy operation when mirroring&lt;br /&gt;
     mirror_region_size = 512&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now copy the changed file to the second node.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
rsync -av /etc/lvm/lvm.conf root@an-node05:/etc/lvm/&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
building file list ... done&lt;br /&gt;
lvm.conf&lt;br /&gt;
&lt;br /&gt;
sent 3153 bytes  received 234 bytes  6774.00 bytes/sec&lt;br /&gt;
total size is 22459  speedup is 6.63&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You&#039;re done. Normally we&#039;d want to tell LVM to rescan for PVs, VGs and LVs but at this stage there are none.&lt;br /&gt;
&lt;br /&gt;
=== Starting the clvmd Daemon ===&lt;br /&gt;
&lt;br /&gt;
Before we proceed, we need to start the clustered LVM daemon, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clvmd&amp;lt;/span&amp;gt;. This requires that the cluster is already running. So if you stopped the cluster, start it on both nodes before starting &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clvmd&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;
cman_tool 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;
Version: 6.2.0&lt;br /&gt;
Config Version: 9&lt;br /&gt;
Cluster Name: an-cluster01&lt;br /&gt;
Cluster Id: 60257&lt;br /&gt;
Cluster Member: Yes&lt;br /&gt;
Cluster Generation: 120&lt;br /&gt;
Membership state: Cluster-Member&lt;br /&gt;
Nodes: 2&lt;br /&gt;
Expected votes: 1&lt;br /&gt;
Total votes: 2&lt;br /&gt;
Quorum: 1  &lt;br /&gt;
Active subsystems: 7&lt;br /&gt;
Flags: 2node Dirty &lt;br /&gt;
Ports Bound: 0  &lt;br /&gt;
Node name: an-node04.alteeve.com&lt;br /&gt;
Node ID: 1&lt;br /&gt;
Multicast addresses: 239.192.235.77 &lt;br /&gt;
Node addresses: 192.168.3.74 &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{note|1=The version incremented after the last example when I edited the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cluster.conf&amp;lt;/span&amp;gt; to have my real passwords.}}&lt;br /&gt;
&lt;br /&gt;
So now we see that the cluster is up on both nodes (&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Nodes: 2&amp;lt;/span&amp;gt;), so we can start the clustered LVM daemon.&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;
Starting clvmd: &lt;br /&gt;
Activating VG(s):   No volume groups found&lt;br /&gt;
                                                           [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{note|1=At this stage, the cluster does not start at boot, so we can&#039;t start &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clvmd&amp;lt;/span&amp;gt; at boot yet, either. We&#039;ll do this at the end of the tutorial, so for now, disable &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clvmd&amp;lt;/span&amp;gt; and start it manually after starting &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt; when you first start your cluster.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
chkconfig clvmd off&lt;br /&gt;
chkconfig --list 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;
clvmd          	0:off	1:off	2:off	3:off	4:off	5:off	6:off&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Turning Our DRBD Resources Into LVM Physical Volumes ===&lt;br /&gt;
&lt;br /&gt;
{{note|1=Now that DRBD is in use, commands will only need to be executed on one node and the changes should be immediately seen on the second node.}}&lt;br /&gt;
&lt;br /&gt;
Creating LVM physical volumes is a trivial task. Simply run &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;pvcreate /dev/drbdX&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On One Node&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
pvcreate /dev/drbd{0,1,2}&lt;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;
  Physical volume &amp;quot;/dev/drbd1&amp;quot; successfully created&lt;br /&gt;
  Physical volume &amp;quot;/dev/drbd2&amp;quot; successfully created&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On The Other Node&#039;&#039;&#039;:&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;9.32 GB&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               9.32 GB&lt;br /&gt;
  Allocatable           NO&lt;br /&gt;
  PE Size (KByte)       0&lt;br /&gt;
  Total PE              0&lt;br /&gt;
  Free PE               0&lt;br /&gt;
  Allocated PE          0&lt;br /&gt;
  PV UUID               WxTCW4-lUzL-bR53-km45-13eV-3f8B-ZA5Tb9&lt;br /&gt;
   &lt;br /&gt;
  &amp;quot;/dev/drbd1&amp;quot; is a new physical volume of &amp;quot;93.14 GB&amp;quot;&lt;br /&gt;
  --- NEW Physical volume ---&lt;br /&gt;
  PV Name               /dev/drbd1&lt;br /&gt;
  VG Name               &lt;br /&gt;
  PV Size               93.14 GB&lt;br /&gt;
  Allocatable           NO&lt;br /&gt;
  PE Size (KByte)       0&lt;br /&gt;
  Total PE              0&lt;br /&gt;
  Free PE               0&lt;br /&gt;
  Allocated PE          0&lt;br /&gt;
  PV UUID               zrwlxT-VFA4-5NiK-fwbK-z2Ez-mYxu-Ei8yZs&lt;br /&gt;
   &lt;br /&gt;
  &amp;quot;/dev/drbd2&amp;quot; is a new physical volume of &amp;quot;93.14 GB&amp;quot;&lt;br /&gt;
  --- NEW Physical volume ---&lt;br /&gt;
  PV Name               /dev/drbd2&lt;br /&gt;
  VG Name               &lt;br /&gt;
  PV Size               93.14 GB&lt;br /&gt;
  Allocatable           NO&lt;br /&gt;
  PE Size (KByte)       0&lt;br /&gt;
  Total PE              0&lt;br /&gt;
  Free PE               0&lt;br /&gt;
  Allocated PE          0&lt;br /&gt;
  PV UUID               6d4e5P-pjHE-4axT-ZRyG-lJa7-8oLa-TjkZFy&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Before proceeding, be sure to have LVM rescan for the new [[PV]]s so that it&#039;s cache is up to date. This isn&#039;t strictly needed, but I find it a useful habit to get into.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On both nodes&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
pvscan&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
  PV /dev/drbd0                      lvm2 [9.32 GB]&lt;br /&gt;
  PV /dev/drbd1                      lvm2 [93.14 GB]&lt;br /&gt;
  PV /dev/drbd2                      lvm2 [93.14 GB]&lt;br /&gt;
  Total: 3 [195.60 GB] / in use: 0 [0   ] / in no VG: 3 [195.60 GB]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{note|1=There is nothing showing in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;VG Name&amp;lt;/span&amp;gt; yet, as we&#039;ve not created any [[VG]]s. Re-run &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;pvdisplay&amp;lt;/span&amp;gt; after the VGs are created and you will see them show up. Be aware that a [[PV]] can only belong to one [[VG]] at a time.}}&lt;br /&gt;
&lt;br /&gt;
=== Creating Volume Groups ===&lt;br /&gt;
&lt;br /&gt;
LVM allows for a given VG to have multiple PVs assigned to it. In our case though, each PV has a specific purpose so we will be creating three independent VGs.&lt;br /&gt;
&lt;br /&gt;
Creating VGs is somewhat less trivial compared to creating the PVs. There are a few extra bits that need to be specified when the volume groups are created. The extra bits are:&lt;br /&gt;
* We will explicitly tell LVM that these are clustered VGs via &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;-c y&amp;lt;/span&amp;gt; (&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--clustered yes&amp;lt;/span&amp;gt;).&lt;br /&gt;
* We will create a tag that we will use to identify all clustered VGs. The tag I use is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-cluster01&amp;lt;/span&amp;gt;, thought you are free to use something else. This is applied via &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--addtag @an-cluster01&amp;lt;/span&amp;gt;&lt;br /&gt;
* Each VG needs a unique name which will become part of the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/vg_name/lv_name&amp;lt;/span&amp;gt; path. The name you choose should make sense to you. The names used in this tutorial are shown in the table below.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!VG name&lt;br /&gt;
!PV used&lt;br /&gt;
!Note&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;drbd_sh0_vg0&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/drbd0&amp;lt;/span&amp;gt;&lt;br /&gt;
|This will be used for the shared VG hosting the lone logical volume which we will create the [[GFS2]] partition on.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;drbd_an4_vg0&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/drbd1&amp;lt;/span&amp;gt;&lt;br /&gt;
|This VG will host the LVs backing the virtual machines designed to normally operate on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt;.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;drbd_an5_vg0&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/drbd2&amp;lt;/span&amp;gt;&lt;br /&gt;
|This VG will host the LVs backing the virtual machines designed to normally operate on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
So then, the commands to create these VGs will be as follows.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On One Node&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vgcreate -c y --addtag @an-cluster01 drbd_sh0_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;drbd_sh0_vg0&amp;quot; successfully created&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;
vgcreate -c y --addtag @an-cluster01 drbd_an4_vg0 /dev/drbd1&lt;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;drbd_an4_vg0&amp;quot; successfully created&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;
vgcreate -c y --addtag @an-cluster01 drbd_an5_vg0 /dev/drbd2&lt;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;drbd_an5_vg0&amp;quot; successfully created&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On The Other Node&#039;&#039;&#039;: You can verify that the VGs are visible on the second node with &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 -v&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
    Finding all volume groups&lt;br /&gt;
    Finding volume group &amp;quot;drbd_an5_vg0&amp;quot;&lt;br /&gt;
  --- Volume group ---&lt;br /&gt;
  VG Name               drbd_an5_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               93.14 GB&lt;br /&gt;
  PE Size               4.00 MB&lt;br /&gt;
  Total PE              23843&lt;br /&gt;
  Alloc PE / Size       0 / 0   &lt;br /&gt;
  Free  PE / Size       23843 / 93.14 GB&lt;br /&gt;
  VG UUID               kqhxfN-6VaV-TXlL-SYPP-4k2F-li70-rOg2wK&lt;br /&gt;
   &lt;br /&gt;
  --- Physical volumes ---&lt;br /&gt;
  PV Name               /dev/drbd2     &lt;br /&gt;
  PV UUID               6d4e5P-pjHE-4axT-ZRyG-lJa7-8oLa-TjkZFy&lt;br /&gt;
  PV Status             allocatable&lt;br /&gt;
  Total PE / Free PE    23843 / 23843&lt;br /&gt;
   &lt;br /&gt;
    Finding volume group &amp;quot;drbd_an4_vg0&amp;quot;&lt;br /&gt;
  --- Volume group ---&lt;br /&gt;
  VG Name               drbd_an4_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               93.14 GB&lt;br /&gt;
  PE Size               4.00 MB&lt;br /&gt;
  Total PE              23843&lt;br /&gt;
  Alloc PE / Size       0 / 0   &lt;br /&gt;
  Free  PE / Size       23843 / 93.14 GB&lt;br /&gt;
  VG UUID               9WBngc-SvVq-VVBd-csag-I0JP-DqLj-xV3fUf&lt;br /&gt;
   &lt;br /&gt;
  --- Physical volumes ---&lt;br /&gt;
  PV Name               /dev/drbd1     &lt;br /&gt;
  PV UUID               zrwlxT-VFA4-5NiK-fwbK-z2Ez-mYxu-Ei8yZs&lt;br /&gt;
  PV Status             allocatable&lt;br /&gt;
  Total PE / Free PE    23843 / 23843&lt;br /&gt;
   &lt;br /&gt;
    Finding volume group &amp;quot;drbd_sh0_vg0&amp;quot;&lt;br /&gt;
  --- Volume group ---&lt;br /&gt;
  VG Name               drbd_sh0_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               9.32 GB&lt;br /&gt;
  PE Size               4.00 MB&lt;br /&gt;
  Total PE              2386&lt;br /&gt;
  Alloc PE / Size       0 / 0   &lt;br /&gt;
  Free  PE / Size       2386 / 9.32 GB&lt;br /&gt;
  VG UUID               h6xZz8-G3J2-fkBF-1ZOD-DgkR-X0f4-9qaYI3&lt;br /&gt;
   &lt;br /&gt;
  --- Physical volumes ---&lt;br /&gt;
  PV Name               /dev/drbd0     &lt;br /&gt;
  PV UUID               WxTCW4-lUzL-bR53-km45-13eV-3f8B-ZA5Tb9&lt;br /&gt;
  PV Status             allocatable&lt;br /&gt;
  Total PE / Free PE    2386 / 2386&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;tag&amp;lt;/span&amp;gt; we assigned isn&#039;t displayed, this is ok. You can see the tags using a special incantation of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vgs&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;
vgs -o vg_name,vg_tags&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
  VG           VG Tags     &lt;br /&gt;
  drbd_an4_vg0 an-cluster01&lt;br /&gt;
  drbd_an5_vg0 an-cluster01&lt;br /&gt;
  drbd_sh0_vg0 an-cluster01&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It may not be pretty, but at least you can confirm that the tags exist as expected. Where tags are used will be discussed later in the trouble-shooting section.&lt;br /&gt;
&lt;br /&gt;
Before proceeding, be sure to have LVM rescan for the new [[VG]]s so that it&#039;s cache is up to date.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On both nodes&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vgscan&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
  Reading all physical volumes.  This may take a while...&lt;br /&gt;
  Found volume group &amp;quot;drbd_an5_vg0&amp;quot; using metadata type lvm2&lt;br /&gt;
  Found volume group &amp;quot;drbd_an4_vg0&amp;quot; using metadata type lvm2&lt;br /&gt;
  Found volume group &amp;quot;drbd_sh0_vg0&amp;quot; using metadata type lvm2&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Creating a Logical Volume ===&lt;br /&gt;
&lt;br /&gt;
At this point, we&#039;re only going to create a logical volume on the shared VG. This one LV will use all of the space available in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;drbd_sh0_vg0&amp;lt;/span&amp;gt; volume group. As with the VGs, we&#039;ll be assigning the same tag to our LV. We will also need to assign a name to the LV which will form the last part of the device path, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/vg_name/lv_name&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
When creating LVs, you can specify the size of the new LV in a few ways. The two way I prefer are &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;-L xxG&amp;lt;/span&amp;gt;, where &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xx&amp;lt;/span&amp;gt; is the number of [[GiB]] to make the LV. Alternatively, I like to use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;-l 100%FREE&amp;lt;/span&amp;gt; when I am creating the last partition on the VG (or the only one, as in this case). Which you use is entirely up to you.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On One Node&#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 100%FREE --addtag @an-cluster01 -n xen_shared drbd_sh0_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;On The Other Node&#039;&#039;&#039;:&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/drbd_sh0_vg0/xen_shared&lt;br /&gt;
  VG Name                drbd_sh0_vg0&lt;br /&gt;
  LV UUID                6bngyf-RSGG-17pA-g2fn-wwM3-6xsc-8yBAI5&lt;br /&gt;
  LV Write Access        read/write&lt;br /&gt;
  LV Status              available&lt;br /&gt;
  # open                 0&lt;br /&gt;
  LV Size                9.32 GB&lt;br /&gt;
  Current LE             2386&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;
As always, before proceeding, be sure to have LVM rescan for the new [[LV]]s so that it&#039;s cache is up to date.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
lvscan&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
  ACTIVE            &#039;/dev/drbd_sh0_vg0/xen_shared&#039; [9.32 GB] inherit&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As with VGs, we can confirm that the tag was set using a similar call to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;lvs&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;
lvs -o vg_name,lv_name,lv_tags&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
  VG           LV         LV Tags     &lt;br /&gt;
  drbd_sh0_vg0 xen_shared an-cluster01&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
That&#039;s it. Our clustered LVM is setup!&lt;br /&gt;
&lt;br /&gt;
== Setting Up The Shared GFS2 Partition ==&lt;br /&gt;
&lt;br /&gt;
Setting up a [[GFS2]] partition requires three steps;&lt;br /&gt;
* Formatting the block device, a logical volume in our case, using the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;mkfs.gfs2&amp;lt;/span&amp;gt; tool.&lt;br /&gt;
* Create a mount point on each node.&lt;br /&gt;
* Add an entry 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;
As mentioned earlier, we&#039;ll create a small 10 [[GB]] [[GFS2]] partition that will hold common files for the cluster. The most notable being the virtual machine definition files. These need to be centralized so that one node can restore a VM lost on another node during a failure state. It&#039;s also a decent place for things like ISOs if you&#039;re not using a [[PXE]] server of if you want to make generic VM images available. Though if you plan to do that, you will probably want a larger GFS2 partition than we are using here.&lt;br /&gt;
&lt;br /&gt;
The information you need to have on hand when formatting a [[GFS2]] partition is:&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Variable&lt;br /&gt;
!Value&lt;br /&gt;
!Note&lt;br /&gt;
|-&lt;br /&gt;
!Locking protocol&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;lock_dlm&amp;lt;/span&amp;gt;&lt;br /&gt;
|This is always &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;lock_dlm&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Journals&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;2&amp;lt;/span&amp;gt;&lt;br /&gt;
|This matches the number of nodes in the cluster.&lt;br /&gt;
|-&lt;br /&gt;
!Cluster Name&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-cluster01&amp;lt;/span&amp;gt;&lt;br /&gt;
|As set in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/cluster/cluster.conf&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Partition Name&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xen_shared&amp;lt;/span&amp;gt;&lt;br /&gt;
|Arbitrary name&lt;br /&gt;
|-&lt;br /&gt;
!Backing Device&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/drbd_sh0_vg0/xen_shared&amp;lt;/span&amp;gt;&lt;br /&gt;
|The LV we created earlier&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Putting it all together, the command becomes:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On One Node&#039;&#039;&#039;:&lt;br /&gt;
&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-cluster01:xen_shared /dev/drbd_sh0_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/drbd_sh0_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;
Are you sure you want to proceed? [y/n] y&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{note|1=It can take a bit of time for this to complete, please be patient.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Device:                    /dev/drbd_sh0_vg0/xen_shared&lt;br /&gt;
Blocksize:                 4096&lt;br /&gt;
Device Size                9.32 GB (2443264 blocks)&lt;br /&gt;
Filesystem Size:           9.32 GB (2443261 blocks)&lt;br /&gt;
Journals:                  2&lt;br /&gt;
Resource Groups:           38&lt;br /&gt;
Locking Protocol:          &amp;quot;lock_dlm&amp;quot;&lt;br /&gt;
Lock Table:                &amp;quot;an-cluster01:xen_shared&amp;quot;&lt;br /&gt;
UUID:                      764772BC-B292-1BBF-F987-AD3A2540849B&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now confirm that the partition is visible from the other node.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On The Other Node&#039;&#039;&#039;: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
gfs2_edit -p sb /dev/drbd_sh0_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;
Block #16    (0x10) of 2443264 (0x254800) (superblock)&lt;br /&gt;
&lt;br /&gt;
Superblock:&lt;br /&gt;
  mh_magic              0x01161970(hex)&lt;br /&gt;
  mh_type               1                   0x1&lt;br /&gt;
  mh_format             100                 0x64&lt;br /&gt;
  sb_fs_format          1801                0x709&lt;br /&gt;
  sb_multihost_format   1900                0x76c&lt;br /&gt;
  sb_bsize              4096                0x1000&lt;br /&gt;
  sb_bsize_shift        12                  0xc&lt;br /&gt;
  master dir:           2                   0x2&lt;br /&gt;
        addr:           22                  0x16&lt;br /&gt;
  root dir  :           1                   0x1&lt;br /&gt;
        addr:           21                  0x15&lt;br /&gt;
  sb_lockproto          lock_dlm&lt;br /&gt;
  sb_locktable          an-cluster01:xen_shared&lt;br /&gt;
  sb_uuid               764772BC-B292-1BBF-F987-AD3A2540849B&lt;br /&gt;
&lt;br /&gt;
The superblock has 2 directories&lt;br /&gt;
     1. (1). 21 (0x15): Dir     root&lt;br /&gt;
     2. (2). 22 (0x16): Dir     master&lt;br /&gt;
------------------------------------------------------&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With that, the GFS2 partition is ready for use.&lt;br /&gt;
&lt;br /&gt;
Now we need to create the mount point. The mount point you use is up to you. This tutorial will create a mount point called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/xen_shared&amp;lt;/span&amp;gt;. Once that&#039;s created, we&#039;ll actually mount the GFS2 partition. Finally, we&#039;ll use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;df&amp;lt;/span&amp;gt; to verify that it mounted successfully.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On Both Nodes&#039;&#039;&#039;:&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/drbd_sh0_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;
/dev/sda2              20G  2.9G   16G  16% /&lt;br /&gt;
/dev/sda1             244M   33M  198M  15% /boot&lt;br /&gt;
tmpfs                 1.8G     0  1.8G   0% /dev/shm&lt;br /&gt;
none                  1.8G  104K  1.8G   1% /var/lib/xenstored&lt;br /&gt;
/dev/mapper/drbd_sh0_vg0-xen_shared&lt;br /&gt;
                      9.4G  259M  9.1G   3% /xen_shared&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The last step is to add an entry to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/fstab&amp;lt;/span&amp;gt; for this GFS2 partition. This is required because the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/init.d/gfs2&amp;lt;/span&amp;gt; initialization script consults &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/fstab&amp;lt;/span&amp;gt; to see what partitions it is to manage.&lt;br /&gt;
&lt;br /&gt;
If you are familiar with GFS2 on [[EL6]], then you might be familiar with using the GFS2&#039;s [[UUID]] in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/fstab&amp;lt;/span&amp;gt;. That is not supported here on [[EL5]].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On both nodes&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/fstab /etc/fstab.orig&lt;br /&gt;
echo &amp;quot;/dev/drbd_sh0_vg0/xen_shared /xen_shared gfs2 rw,suid,dev,exec,nouser,async 0 0&amp;quot; &amp;gt;&amp;gt; /etc/fstab&lt;br /&gt;
diff -u /etc/fstab.orig /etc/fstab&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;diff&amp;quot;&amp;gt;&lt;br /&gt;
--- /etc/fstab.orig     2011-05-06 18:56:50.000000000 -0400&lt;br /&gt;
+++ /etc/fstab  2011-05-06 18:56:50.000000000 -0400&lt;br /&gt;
@@ -5,3 +5,4 @@&lt;br /&gt;
 sysfs                   /sys                    sysfs   defaults        0 0&lt;br /&gt;
 proc                    /proc                   proc    defaults        0 0&lt;br /&gt;
 LABEL=SWAP-sda3         swap                    swap    defaults        0 0&lt;br /&gt;
+/dev/drbd_sh0_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;
{{note|1=The reason that we use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rw,suid,dev,exec,nouser,async&amp;lt;/span&amp;gt; instead of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;defaults&amp;lt;/span&amp;gt;. The key option we don&#039;t want to use is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;auto&amp;lt;/span&amp;gt;, which is implied with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;defaults&amp;lt;/span&amp;gt;. The reason for avoiding this is to prevent the system from trying to mount the GFS2 partition during boot. With the cluster not running that early in the boot process, the GFS2 partition will effectively not exist at that point, so any attempt to mount it will fail.}}&lt;br /&gt;
&lt;br /&gt;
Now, to verify that everything is working, call &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;status&amp;lt;/span&amp;gt; against the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;gfs2&amp;lt;/span&amp;gt; initialization script.&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 try &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;stop&amp;lt;/span&amp;gt;&#039;ing &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;gfs2&amp;lt;/span&amp;gt;, checking the mounts with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;df&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;status&amp;lt;/span&amp;gt;, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;start&amp;lt;/span&amp;gt;&#039;ing &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;gfs2&amp;lt;/span&amp;gt; back up and doing a final &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;df&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;status&amp;lt;/span&amp;gt;. If all works well, the GFS2 volume should unmount and remount.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On Both Nodes&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
Stop:&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 filesystems:                               [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check that it has been unmounted:&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;
&amp;lt;/source&amp;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/sda2              20G  2.9G   16G  16% /&lt;br /&gt;
/dev/sda1             244M   33M  198M  15% /boot&lt;br /&gt;
tmpfs                 1.8G     0  1.8G   0% /dev/shm&lt;br /&gt;
none                  1.8G  104K  1.8G   1% /var/lib/xenstored&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now start the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;gfs2&amp;lt;/span&amp;gt; service 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 filesystems:                                 [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check that it has been re-mounted:&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;
&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/sda2              20G  2.9G   16G  16% /&lt;br /&gt;
/dev/sda1             244M   33M  198M  15% /boot&lt;br /&gt;
tmpfs                 1.8G     0  1.8G   0% /dev/shm&lt;br /&gt;
none                  1.8G  104K  1.8G   1% /var/lib/xenstored&lt;br /&gt;
/dev/mapper/drbd_sh0_vg0-xen_shared&lt;br /&gt;
                      9.4G  259M  9.1G   3% /xen_shared&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Perfect!&lt;br /&gt;
&lt;br /&gt;
= Managing Storage In The Cluster =&lt;br /&gt;
&lt;br /&gt;
The storage for the cluster is ready, but it hasn&#039;t actually been tied &#039;&#039;into&#039;&#039; the cluster. To do that, we will use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt;, within which we will add the &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; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;gfs2&amp;lt;/span&amp;gt; initialization scripts as cluster resources. We will create two failover domains, each one containing only one node. lastly, we will take those three resources and create a service tree.&lt;br /&gt;
&lt;br /&gt;
== Covering Some New Terms ==&lt;br /&gt;
&lt;br /&gt;
Now, let&#039;s back up and talk a bit about those three new terms.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Resources&#039;&#039;&#039; are items that can be used in one or more services.&lt;br /&gt;
* &#039;&#039;&#039;Services&#039;&#039;&#039; consist of one or more resources, either in series, parallel or a combination of both, that are managed by the cluster.&lt;br /&gt;
* &#039;&#039;&#039;Failover Domains&#039;&#039;&#039; are logical groups of one or more nodes. Services can run strictly within a failover group, or they can be allowed to run outside of the failover domain when no member domains are available.&lt;br /&gt;
&lt;br /&gt;
== An Overview Of How We Will Manage Storage In The Cluster ==&lt;br /&gt;
&lt;br /&gt;
So what we are going to do here is:&lt;br /&gt;
* Create three &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;script&amp;lt;/span&amp;gt; resources&lt;br /&gt;
* Create two failover domains. One containing just &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04.alteeve.com&amp;lt;/span&amp;gt; and the other containing just &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05.alteeve.com&amp;lt;/span&amp;gt;. We will restrict services within these domains to only run within this domain, effectively locking the service to the node.&lt;br /&gt;
* Within each failover domain, we will create a service with a serial resource tree. This tree will start &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;drbd&amp;lt;/span&amp;gt;, then &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clvmd&amp;lt;/span&amp;gt; and finally &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;gfs2&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The reason for this is so that when &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; starts, it will start each failover domain&#039;s service which, in turn, will start the clustered storage daemons in the proper order.&lt;br /&gt;
&lt;br /&gt;
== Why Not Start The Daemons At Boot Time? ==&lt;br /&gt;
&lt;br /&gt;
This might seem like over kill, and arguably it is. The reason I still find it worth while is that if a storage daemon like [[DRBD]] hangs on boot, you can find yourself with a node that you can not access. Many folk have their nodes in data centers so gaining direct access can be a pain, to be polite. So by moving these daemons over to the cluster, and knowing that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; itself will start late in the boot process, we are much more likely to still have remote access when things go bad.&lt;br /&gt;
&lt;br /&gt;
I used DRBD as an example on purpose. I prefer to have DRBD resources wait forever to connect to the other node when starting up. This way, if one node starts somewhat later than the other, the first node&#039;s DRBD resource won&#039;t risk split-braining. it will happily wait until it&#039;s partner node comes up and starts it&#039;s own DRBD daemon. The downside to this is that DRBD will effectively hang the boot process forever if the other node can&#039;t be started. By managing DRBD in the cluster, we leave open the option of logging in and telling DRBD to stop waiting when we know the other node will not be booting.&lt;br /&gt;
&lt;br /&gt;
== Adding rgmanager To cluster.conf ==&lt;br /&gt;
&lt;br /&gt;
Everything related to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; is an element of the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;[[RHCS_v2_cluster.conf#rm.3B_The_Resource_Manager|rm]] /&amp;gt;&amp;lt;/span&amp;gt; tag. Within that, the actual resources are themselves elements of the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;resources /&amp;gt;&amp;lt;/span&amp;gt; tag. We&#039;ll start by creating these tags, then we&#039;ll look at the actual resources.&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-cluster01&amp;quot; config_version=&amp;quot;10&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;cman expected_votes=&amp;quot;1&amp;quot; two_node=&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-node04.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;fence_na01&amp;quot; port=&amp;quot;04&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-node05.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;fence_na01&amp;quot; port=&amp;quot;03&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_na01&amp;quot; agent=&amp;quot;fence_na&amp;quot; ipaddr=&amp;quot;fence_na01.alteeve.com&amp;quot; login=&amp;quot;admin&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;fence_daemon post_join_delay=&amp;quot;60&amp;quot;/&amp;gt;&lt;br /&gt;
        &amp;lt;totem rrp_mode=&amp;quot;none&amp;quot; secauth=&amp;quot;off&amp;quot;/&amp;gt;&lt;br /&gt;
        &amp;lt;rm&amp;gt;&lt;br /&gt;
                &amp;lt;resources/&amp;gt;&lt;br /&gt;
                &amp;lt;failoverdomains /&amp;gt;&lt;br /&gt;
        &amp;lt;/rm&amp;gt;&lt;br /&gt;
&amp;lt;/cluster&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There are several attributes available for the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rm&amp;lt;/span&amp;gt;, though we don&#039;t need to worry about them now as the defaults are sane. It&#039;s primary purpose is to act as a container for &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;failoverdomains /&amp;gt;&amp;lt;/span&amp;gt;, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;resources /&amp;gt;&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;service /&amp;gt;&amp;lt;/span&amp;gt; tags. We&#039;ll be working with all three of these now. We&#039;re not putting an empty &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;service /&amp;gt;&amp;lt;/span&amp;gt; tag in because they must contain and attribute, which we are not ready to do yet.&lt;br /&gt;
&lt;br /&gt;
=== Adding Resources to cluster.conf ===&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;resources&amp;lt;/span&amp;gt; tag has no attributes of it&#039;s own. It solely acts as a container for various resource tags. There are many types of resources, but we will only be using the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;script /&amp;gt;&amp;lt;/span&amp;gt; tag in this cluster.&lt;br /&gt;
&lt;br /&gt;
Let&#039;s look at the three scripts we&#039;re going to add; &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-cluster01&amp;quot; config_version=&amp;quot;11&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;cman expected_votes=&amp;quot;1&amp;quot; two_node=&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-node04.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;fence_na01&amp;quot; port=&amp;quot;04&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-node05.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;fence_na01&amp;quot; port=&amp;quot;03&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_na01&amp;quot; agent=&amp;quot;fence_na&amp;quot; ipaddr=&amp;quot;fence_na01.alteeve.com&amp;quot; login=&amp;quot;admin&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;fence_daemon post_join_delay=&amp;quot;60&amp;quot;/&amp;gt;&lt;br /&gt;
        &amp;lt;totem rrp_mode=&amp;quot;none&amp;quot; secauth=&amp;quot;off&amp;quot;/&amp;gt;&lt;br /&gt;
        &amp;lt;rm&amp;gt;&lt;br /&gt;
                &amp;lt;resources&amp;gt;&lt;br /&gt;
                        &amp;lt;script file=&amp;quot;/etc/init.d/drbd&amp;quot; name=&amp;quot;drbd&amp;quot;/&amp;gt;&lt;br /&gt;
                        &amp;lt;script file=&amp;quot;/etc/init.d/clvmd&amp;quot; name=&amp;quot;clvmd&amp;quot;/&amp;gt;&lt;br /&gt;
                        &amp;lt;script file=&amp;quot;/etc/init.d/gfs2&amp;quot; name=&amp;quot;gfs2&amp;quot;/&amp;gt;&lt;br /&gt;
                &amp;lt;/resources&amp;gt;&lt;br /&gt;
                &amp;lt;failoverdomains /&amp;gt;&lt;br /&gt;
        &amp;lt;/rm&amp;gt;&lt;br /&gt;
&amp;lt;/cluster&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The main two attributes used by &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;script /&amp;gt;&amp;lt;/span&amp;gt; are &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;file&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;name&amp;lt;/span&amp;gt;. The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;file&amp;lt;/span&amp;gt; attribute is the path to the script and the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;name&amp;lt;/span&amp;gt; will be used to reference this script when we create our &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;service /&amp;gt;&amp;lt;/span&amp;gt; resource tree later.&lt;br /&gt;
&lt;br /&gt;
{{note|1=Scripts must work like initialization scripts. That is, they need to support being called with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;start&amp;lt;/span&amp;gt;, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;stop&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;status&amp;lt;/span&amp;gt; arguments.}}&lt;br /&gt;
&lt;br /&gt;
=== Adding Failover Domains to cluster.conf ===&lt;br /&gt;
&lt;br /&gt;
Failover domains are, at their most basic, a collection of one or more nodes in the cluster. Services can then be configured to operate within the context of a given failover domain. There are a few key options to be aware of.&lt;br /&gt;
&lt;br /&gt;
* A failover domain can be unordered or prioritized.&lt;br /&gt;
** When unordered, a service will relocate to another random node in the domain.&lt;br /&gt;
** When prioritized, a service will relocate to the highest-priority node in the domain.&lt;br /&gt;
* A failover domain can be restricted or unrestricted.&lt;br /&gt;
** When restricted, a service is &#039;&#039;&#039;only&#039;&#039;&#039; allowed to relocate to nodes in the domain. When no nodes are available, a service is stopped.&lt;br /&gt;
** When unrestricted, a service will try to relocate to a node in the domain. However, when no domain members are available, a service attempts to start on another node in the cluster.&lt;br /&gt;
* A failover domain can have a failback policy.&lt;br /&gt;
** When a domain allows for failback and the domain is ordered, a service will migrate to the highest priority node in the domain. This allows for automated restoration of services on a failed node when it rejoins the cluster.&lt;br /&gt;
** When a domain does not allow for failback, but is unrestricted, failback of services that fell out of the domain will happen anyway. However, once the service is within the domain, the service will &#039;&#039;&#039;not&#039;&#039;&#039; relocate to a higher-priority node should one become available later.&lt;br /&gt;
** When a domain does not allow for failback and is restricted, then failback of services will never occur.&lt;br /&gt;
&lt;br /&gt;
What we are going to do now is create two restricted failover domains with no relocation. Each of these will contain just one of the nodes. This will effectively lock their services to the node. This way, services assigned to each domain will be started and maintained by the cluster, but they will &#039;&#039;&#039;not&#039;&#039;&#039; be highly available. The services we will create will have local initialization scripts, so this is perfectly fine. &lt;br /&gt;
&lt;br /&gt;
This is how we will get the cluster to start and maintain out clustered storage daemons.&lt;br /&gt;
&lt;br /&gt;
The format for defining failover domains is to create a &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;failoverdomains&amp;gt;&amp;lt;/span&amp;gt; tag, which has no attributes, and acts as a container for one or more &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;failoverdomain&amp;gt;&amp;lt;/span&amp;gt; tags. Each &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;failoverdomain&amp;gt;&amp;lt;/span&amp;gt; tag has four attributes and acts as a container for one or more &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;failoverdomainnode /&amp;gt;&amp;lt;/span&amp;gt; tags.&lt;br /&gt;
&lt;br /&gt;
The only required attribute in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;failoverdomain /&amp;gt;&amp;lt;/span&amp;gt; is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;name=&amp;quot;&amp;quot;&amp;lt;/span&amp;gt;. This is the name that will be used later when we want to bind a service to a given failover domain. By default, a failover domain is unordered, thus making failback meaningless, and it is unrestricted. When ordered, the default is to allow for failback.&lt;br /&gt;
&lt;br /&gt;
The individual &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;failoverdomainnode /&amp;gt;&amp;lt;/span&amp;gt; have two attributes; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;name&amp;lt;/span&amp;gt;, which must match the given node&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;clusternode name=&amp;quot;...&amp;quot;&amp;lt;/span&amp;gt;, and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;priority=&amp;quot;x&amp;quot;&amp;lt;/span&amp;gt;, where &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;x&amp;lt;/span&amp;gt; is an integer. when only one node is defined or when a failover domain in unordered, the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;priority&amp;lt;/span&amp;gt; is ignored. When two or more nodes are defined and the domain is ordered, then nodes with the lowest number has the highest priority for hosting services. That is, a node with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;priority=&amp;quot;1&amp;quot;&amp;lt;/span&amp;gt; will be preferred to a node with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;priority=&amp;quot;2&amp;quot;&amp;lt;/span&amp;gt;.&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-cluster01&amp;quot; config_version=&amp;quot;12&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;cman expected_votes=&amp;quot;1&amp;quot; two_node=&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-node04.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;fence_na01&amp;quot; port=&amp;quot;04&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-node05.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;fence_na01&amp;quot; port=&amp;quot;03&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_na01&amp;quot; agent=&amp;quot;fence_na&amp;quot; ipaddr=&amp;quot;fence_na01.alteeve.com&amp;quot; login=&amp;quot;admin&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;fence_daemon post_join_delay=&amp;quot;60&amp;quot;/&amp;gt;&lt;br /&gt;
        &amp;lt;totem rrp_mode=&amp;quot;none&amp;quot; secauth=&amp;quot;off&amp;quot;/&amp;gt;&lt;br /&gt;
        &amp;lt;rm&amp;gt;&lt;br /&gt;
                &amp;lt;resources&amp;gt;&lt;br /&gt;
                        &amp;lt;script file=&amp;quot;/etc/init.d/drbd&amp;quot; name=&amp;quot;drbd&amp;quot;/&amp;gt;&lt;br /&gt;
                        &amp;lt;script file=&amp;quot;/etc/init.d/clvmd&amp;quot; name=&amp;quot;clvmd&amp;quot;/&amp;gt;&lt;br /&gt;
                        &amp;lt;script file=&amp;quot;/etc/init.d/gfs2&amp;quot; name=&amp;quot;gfs2&amp;quot;/&amp;gt;&lt;br /&gt;
                &amp;lt;/resources&amp;gt;&lt;br /&gt;
		&amp;lt;failoverdomains&amp;gt;&lt;br /&gt;
			&amp;lt;failoverdomain name=&amp;quot;an4_only&amp;quot; nofailback=&amp;quot;0&amp;quot; ordered=&amp;quot;0&amp;quot; restricted=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
				&amp;lt;failoverdomainnode name=&amp;quot;an-node04.alteeve.com&amp;quot; priority=&amp;quot;1&amp;quot;/&amp;gt;&lt;br /&gt;
			&amp;lt;/failoverdomain&amp;gt;&lt;br /&gt;
			&amp;lt;failoverdomain name=&amp;quot;an5_only&amp;quot; nofailback=&amp;quot;0&amp;quot; ordered=&amp;quot;0&amp;quot; restricted=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
				&amp;lt;failoverdomainnode name=&amp;quot;an-node05.alteeve.com&amp;quot; priority=&amp;quot;1&amp;quot;/&amp;gt;&lt;br /&gt;
			&amp;lt;/failoverdomain&amp;gt;&lt;br /&gt;
		&amp;lt;/failoverdomains&amp;gt;&lt;br /&gt;
        &amp;lt;/rm&amp;gt;&lt;br /&gt;
&amp;lt;/cluster&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So here we&#039;ve now created two failover domains; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an4_only&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an5_only&amp;lt;/span&amp;gt;. Both of these are &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;restricted=&amp;quot;1&amp;quot;&amp;lt;/span&amp;gt;, so services within these domains will never try to start on other nodes. Both &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;nofailback=&amp;quot;0&amp;quot;&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ordered=&amp;quot;0&amp;quot;&amp;lt;/span&amp;gt; are defined, but they have no meaning because the two domains have only one node each.&lt;br /&gt;
&lt;br /&gt;
Within each domain, the corresponding &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;failoverdomainnode /&amp;gt;&amp;lt;/span&amp;gt; is defined. Notice that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;priority=&amp;quot;1&amp;quot;&amp;lt;/span&amp;gt; is set, despite having no use. This attribute must exist regardless. The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;name=&amp;quot;an-node0x.alteeve.com&amp;lt;/span&amp;gt; links the node to it&#039;s corresponding &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;clusternode name=&amp;quot;an-node0x.alteeve.com&amp;quot;&amp;lt;/span&amp;gt; entry in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;clusternodes /&amp;gt;&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Creating the Storage Services in cluster.conf ===&lt;br /&gt;
&lt;br /&gt;
The last piece of the resource management puzzle are the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;service /&amp;gt;&amp;lt;/span&amp;gt; tags. These tags are where the actually resources are tied together, assigned to a failover domain and put under the cluster&#039;s control. The resource elements can be defined as parallel tags, a resource can be an elements of another to form dependency branches or they can be a combination of both. In our case, we want to make sure that each storage daemon successfully starts before the next service starts so we will be creating a dependency tree of resources. Specifically, we want to ensure that the start order is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;drbd&amp;lt;/span&amp;gt; -&amp;gt; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clvmd&amp;lt;/span&amp;gt; -&amp;gt; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;gfs2&amp;lt;/span&amp;gt;. The shut-down will be the reverse order.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;service /&amp;gt;&amp;lt;/span&amp;gt; tag has just one required attribute, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;name=&amp;quot;&amp;quot;&amp;lt;/span&amp;gt;, which is used in tools like Conga for identifying the service. The name can be descriptive, but it must be unique. There are several optional attributes, though we will only be looking at five of them.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;domain=&amp;quot;&amp;quot;&amp;lt;/span&amp;gt; is used to assign the given &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;service /&amp;gt;&amp;lt;/span&amp;gt; to failover domain. The name set here must match a &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;failoverdomain name=&amp;quot;&amp;quot; /&amp;gt;&amp;lt;/span&amp;gt;. Note that you &#039;&#039;do not&#039;&#039; need to define a failover domain. &lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;autostart=&amp;quot;[0|1]&amp;quot;&amp;lt;/span&amp;gt; controls whether or not the service is automatically started when &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; starts. We&#039;ll be disabling this for now, but we will come back and enable it after our initial testing is done.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;exclusive=&amp;quot;[0|1]&amp;quot;&amp;lt;/span&amp;gt; controls whether this service must run exclusively on a given node. &#039;&#039;&#039;Warning&#039;&#039;&#039;: If this is enabled, then no other service will be allowed to run on the node hosting this service.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;recover=&amp;quot;[restart|relocate|disable]&amp;quot;&amp;lt;/span&amp;gt; controls what &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; will do when this service fails. The services we&#039;re going to create now are only designed to run on one node, so &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;restart&amp;lt;/span&amp;gt; is the only policy that makes sense.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;max_restarts=&amp;quot;x&amp;quot;&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 number of times that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; will try to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;restart&amp;lt;/span&amp;gt; a given service. After &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;x&amp;lt;/span&amp;gt; failures, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; will instead &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;relocate&amp;lt;/span&amp;gt; the service based on the failover domain policy, when set. In our case, the failover domains prevent the service from running outside the domain, and the domain has only one node, so this value is effectively meaningless to us.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;restart_expire_time=&amp;quot;x&amp;quot;&amp;lt;/span&amp;gt;, where &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;x&amp;lt;/span&amp;gt; is a number of seconds. When &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;max_restarts&amp;lt;/span&amp;gt; is greater than &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;0&amp;lt;/span&amp;gt;, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; keeps a count of how many times a service has failed. These service failures &amp;quot;expire&amp;quot; after the number of seconds defined here. This is used so that the service failure count can reduce back down to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;0&amp;lt;/span&amp;gt; once things have been shown to be stable for a reasonable amount of time. As we&#039;re using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;max_restarts=&amp;quot;0&amp;quot;&amp;lt;/span&amp;gt; and the failover domain prevents relocation of the service, this value is effectively meaningless to us.&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-cluster01&amp;quot; config_version=&amp;quot;13&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;cman expected_votes=&amp;quot;1&amp;quot; two_node=&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-node04.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;fence_na01&amp;quot; port=&amp;quot;04&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-node05.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;fence_na01&amp;quot; port=&amp;quot;03&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_na01&amp;quot; agent=&amp;quot;fence_na&amp;quot; ipaddr=&amp;quot;fence_na01.alteeve.com&amp;quot; login=&amp;quot;admin&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;fence_daemon post_join_delay=&amp;quot;60&amp;quot;/&amp;gt;&lt;br /&gt;
        &amp;lt;totem rrp_mode=&amp;quot;none&amp;quot; secauth=&amp;quot;off&amp;quot;/&amp;gt;&lt;br /&gt;
	&amp;lt;rm&amp;gt;&lt;br /&gt;
		&amp;lt;resources&amp;gt;&lt;br /&gt;
			&amp;lt;script file=&amp;quot;/etc/init.d/drbd&amp;quot; name=&amp;quot;drbd&amp;quot;/&amp;gt;&lt;br /&gt;
			&amp;lt;script file=&amp;quot;/etc/init.d/clvmd&amp;quot; name=&amp;quot;clvmd&amp;quot;/&amp;gt;&lt;br /&gt;
			&amp;lt;script file=&amp;quot;/etc/init.d/gfs2&amp;quot; name=&amp;quot;gfs2&amp;quot;/&amp;gt;&lt;br /&gt;
		&amp;lt;/resources&amp;gt;&lt;br /&gt;
		&amp;lt;failoverdomains&amp;gt;&lt;br /&gt;
			&amp;lt;failoverdomain name=&amp;quot;an4_only&amp;quot; nofailback=&amp;quot;0&amp;quot; ordered=&amp;quot;0&amp;quot; restricted=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
				&amp;lt;failoverdomainnode name=&amp;quot;an-node04.alteeve.com&amp;quot; priority=&amp;quot;1&amp;quot;/&amp;gt;&lt;br /&gt;
			&amp;lt;/failoverdomain&amp;gt;&lt;br /&gt;
			&amp;lt;failoverdomain name=&amp;quot;an5_only&amp;quot; nofailback=&amp;quot;0&amp;quot; ordered=&amp;quot;0&amp;quot; restricted=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
				&amp;lt;failoverdomainnode name=&amp;quot;an-node05.alteeve.com&amp;quot; priority=&amp;quot;1&amp;quot;/&amp;gt;&lt;br /&gt;
			&amp;lt;/failoverdomain&amp;gt;&lt;br /&gt;
		&amp;lt;/failoverdomains&amp;gt;&lt;br /&gt;
		&amp;lt;service autostart=&amp;quot;0&amp;quot; domain=&amp;quot;an4_only&amp;quot; exclusive=&amp;quot;0&amp;quot; max_restarts=&amp;quot;0&amp;quot; name=&amp;quot;an4_storage&amp;quot; recovery=&amp;quot;restart&amp;quot; restart_expire_time=&amp;quot;0&amp;quot;&amp;gt;&lt;br /&gt;
			&amp;lt;script ref=&amp;quot;drbd&amp;quot;&amp;gt;&lt;br /&gt;
				&amp;lt;script ref=&amp;quot;clvmd&amp;quot;&amp;gt;&lt;br /&gt;
					&amp;lt;script ref=&amp;quot;gfs2&amp;quot;/&amp;gt;&lt;br /&gt;
				&amp;lt;/script&amp;gt;&lt;br /&gt;
			&amp;lt;/script&amp;gt;&lt;br /&gt;
		&amp;lt;/service&amp;gt;&lt;br /&gt;
		&amp;lt;service autostart=&amp;quot;0&amp;quot; domain=&amp;quot;an5_only&amp;quot; exclusive=&amp;quot;0&amp;quot; max_restarts=&amp;quot;0&amp;quot; name=&amp;quot;an5_storage&amp;quot; recovery=&amp;quot;restart&amp;quot; restart_expire_time=&amp;quot;0&amp;quot;&amp;gt;&lt;br /&gt;
			&amp;lt;script ref=&amp;quot;drbd&amp;quot;&amp;gt;&lt;br /&gt;
				&amp;lt;script ref=&amp;quot;clvmd&amp;quot;&amp;gt;&lt;br /&gt;
					&amp;lt;script ref=&amp;quot;gfs2&amp;quot;/&amp;gt;&lt;br /&gt;
				&amp;lt;/script&amp;gt;&lt;br /&gt;
			&amp;lt;/script&amp;gt;&lt;br /&gt;
		&amp;lt;/service&amp;gt;&lt;br /&gt;
	&amp;lt;/rm&amp;gt;&lt;br /&gt;
&amp;lt;/cluster&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So what we&#039;ve done here is create our two &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;service /&amp;gt;&amp;lt;/span&amp;gt; groups; One for the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an4_only&amp;lt;/span&amp;gt; failover domain and another matching service for &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an5_only&amp;lt;/span&amp;gt;. Both have their recovery policy set to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;recovery=&amp;quot;restart&amp;quot;&amp;lt;/span&amp;gt; and neither are configured to start with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Each &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;service /&amp;gt;&amp;lt;/span&amp;gt; tag&#039;s element is a collection of three &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;script /&amp;gt;&amp;lt;/span&amp;gt; resource references. The scripts are referenced using the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;script ref=&amp;quot;x&amp;quot; /&amp;gt;&amp;lt;/span&amp;gt; attribute, where &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;x&amp;lt;/span&amp;gt; must match a &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;resource name=&amp;quot;x&amp;quot; /&amp;gt;&amp;lt;/span&amp;gt; element in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;resources&amp;gt;&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
These references are embedded to form a dependency tree. The tree is formatted to start &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;drbd&amp;lt;/span&amp;gt; first, then when that starts successfully, it will start &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clvmd&amp;lt;/span&amp;gt; and then, finally, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;gfs2&amp;lt;/span&amp;gt;. When this service is disabled, this dependency tree is stopped in the reverse order. &lt;br /&gt;
&lt;br /&gt;
=== Validating the Additions to cluster.conf ===&lt;br /&gt;
&lt;br /&gt;
Seeing as we&#039;ve made some fairly significant changes to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/cluster/cluster.conf&amp;lt;/span&amp;gt;, we&#039;ll want to re-validate it before pushing it out to the other node.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
xmllint --relaxng /usr/share/system-config-cluster/misc/cluster.ng /etc/cluster/cluster.conf&lt;br /&gt;
&amp;lt;/source&amp;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-cluster01&amp;quot; config_version=&amp;quot;13&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;cman expected_votes=&amp;quot;1&amp;quot; two_node=&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-node04.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;fence_na01&amp;quot; port=&amp;quot;04&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-node05.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;fence_na01&amp;quot; port=&amp;quot;03&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_na01&amp;quot; agent=&amp;quot;fence_na&amp;quot; ipaddr=&amp;quot;fence_na01.alteeve.com&amp;quot; login=&amp;quot;admin&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;fence_daemon post_join_delay=&amp;quot;60&amp;quot;/&amp;gt;&lt;br /&gt;
        &amp;lt;totem rrp_mode=&amp;quot;none&amp;quot; secauth=&amp;quot;off&amp;quot;/&amp;gt;&lt;br /&gt;
	&amp;lt;rm&amp;gt;&lt;br /&gt;
		&amp;lt;resources&amp;gt;&lt;br /&gt;
			&amp;lt;script file=&amp;quot;/etc/init.d/drbd&amp;quot; name=&amp;quot;drbd&amp;quot;/&amp;gt;&lt;br /&gt;
			&amp;lt;script file=&amp;quot;/etc/init.d/clvmd&amp;quot; name=&amp;quot;clvmd&amp;quot;/&amp;gt;&lt;br /&gt;
			&amp;lt;script file=&amp;quot;/etc/init.d/gfs2&amp;quot; name=&amp;quot;gfs2&amp;quot;/&amp;gt;&lt;br /&gt;
		&amp;lt;/resources&amp;gt;&lt;br /&gt;
		&amp;lt;failoverdomains&amp;gt;&lt;br /&gt;
			&amp;lt;failoverdomain name=&amp;quot;an4_only&amp;quot; nofailback=&amp;quot;0&amp;quot; ordered=&amp;quot;0&amp;quot; restricted=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
				&amp;lt;failoverdomainnode name=&amp;quot;an-node04.alteeve.com&amp;quot; priority=&amp;quot;1&amp;quot;/&amp;gt;&lt;br /&gt;
			&amp;lt;/failoverdomain&amp;gt;&lt;br /&gt;
			&amp;lt;failoverdomain name=&amp;quot;an5_only&amp;quot; nofailback=&amp;quot;0&amp;quot; ordered=&amp;quot;0&amp;quot; restricted=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
				&amp;lt;failoverdomainnode name=&amp;quot;an-node05.alteeve.com&amp;quot; priority=&amp;quot;1&amp;quot;/&amp;gt;&lt;br /&gt;
			&amp;lt;/failoverdomain&amp;gt;&lt;br /&gt;
		&amp;lt;/failoverdomains&amp;gt;&lt;br /&gt;
		&amp;lt;service autostart=&amp;quot;0&amp;quot; domain=&amp;quot;an4_only&amp;quot; exclusive=&amp;quot;0&amp;quot; max_restarts=&amp;quot;0&amp;quot; name=&amp;quot;an4_storage&amp;quot; recovery=&amp;quot;restart&amp;quot; restart_expire_time=&amp;quot;0&amp;quot;&amp;gt;&lt;br /&gt;
			&amp;lt;script ref=&amp;quot;drbd&amp;quot;&amp;gt;&lt;br /&gt;
				&amp;lt;script ref=&amp;quot;clvmd&amp;quot;&amp;gt;&lt;br /&gt;
					&amp;lt;script ref=&amp;quot;gfs2&amp;quot;/&amp;gt;&lt;br /&gt;
				&amp;lt;/script&amp;gt;&lt;br /&gt;
			&amp;lt;/script&amp;gt;&lt;br /&gt;
		&amp;lt;/service&amp;gt;&lt;br /&gt;
		&amp;lt;service autostart=&amp;quot;0&amp;quot; domain=&amp;quot;an5_only&amp;quot; exclusive=&amp;quot;0&amp;quot; max_restarts=&amp;quot;0&amp;quot; name=&amp;quot;an5_storage&amp;quot; recovery=&amp;quot;restart&amp;quot; restart_expire_time=&amp;quot;0&amp;quot;&amp;gt;&lt;br /&gt;
			&amp;lt;script ref=&amp;quot;drbd&amp;quot;&amp;gt;&lt;br /&gt;
				&amp;lt;script ref=&amp;quot;clvmd&amp;quot;&amp;gt;&lt;br /&gt;
					&amp;lt;script ref=&amp;quot;gfs2&amp;quot;/&amp;gt;&lt;br /&gt;
				&amp;lt;/script&amp;gt;&lt;br /&gt;
			&amp;lt;/script&amp;gt;&lt;br /&gt;
		&amp;lt;/service&amp;gt;&lt;br /&gt;
	&amp;lt;/rm&amp;gt;&lt;br /&gt;
&amp;lt;/cluster&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;
/etc/cluster/cluster.conf validates&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If there was a problem, you need to go back and fix it. &#039;&#039;&#039;DO NOT&#039;&#039;&#039; proceed until your configuration validates. Once it does, we&#039;re ready to move on!&lt;br /&gt;
&lt;br /&gt;
With it validated, we need to push it to the other node. The cluster should be running now, so instead of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rsync&amp;lt;/span&amp;gt;, we can use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ccs_tool&amp;lt;/span&amp;gt;, the &amp;quot;cluster configuration system (tool)&amp;quot;, to push the new &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cluster.conf&amp;lt;/span&amp;gt; to the other node and upgrade the cluster&#039;s version in one shot.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ccs_tool update /etc/cluster/cluster.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;
Config file updated from version 9 to 13&lt;br /&gt;
&lt;br /&gt;
Update complete.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you tool at &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/var/log/messages&amp;lt;/span&amp;gt; on the other node, you should see something like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
May  7 20:32:08 an-node05 ccsd[4134]: Update of cluster.conf complete (version 9 -&amp;gt; 13). &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Starting rgmanager ==&lt;br /&gt;
&lt;br /&gt;
Now that we have services, we will want to manually start &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt;. We&#039;re not yet going to set it to automatically start as we&#039;re not yet automatically starting &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt;, which it depends on. This will be done later when the testing is complete.&lt;br /&gt;
&lt;br /&gt;
So make sure that the cluster is up and running.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cman_tool 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;
Version: 6.2.0&lt;br /&gt;
Config Version: 13&lt;br /&gt;
Cluster Name: an-cluster01&lt;br /&gt;
Cluster Id: 60257&lt;br /&gt;
Cluster Member: Yes&lt;br /&gt;
Cluster Generation: 140&lt;br /&gt;
Membership state: Cluster-Member&lt;br /&gt;
Nodes: 2&lt;br /&gt;
Expected votes: 1&lt;br /&gt;
Total votes: 2&lt;br /&gt;
Quorum: 1  &lt;br /&gt;
Active subsystems: 8&lt;br /&gt;
Flags: 2node Dirty &lt;br /&gt;
Ports Bound: 0 11  &lt;br /&gt;
Node name: an-node04.alteeve.com&lt;br /&gt;
Node ID: 1&lt;br /&gt;
Multicast addresses: 239.192.235.77 &lt;br /&gt;
Node addresses: 192.168.3.74 &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You will want to stop all of the storage daemons &#039;&#039;&#039;before&#039;&#039;&#039; starting &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt;. This is because &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; will always stop any services before it tries to start them itself. This includes virtual machines, as we will see in a bit.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On both nodes&#039;&#039;&#039;:&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 filesystems:                               [  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;
/etc/init.d/clvmd 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;
Deactivating clustered VG(s):   0 logical volume(s) in volume group &amp;quot;drbd_an5_vg0&amp;quot; now active&lt;br /&gt;
  0 logical volume(s) in volume group &amp;quot;drbd_an4_vg0&amp;quot; now active&lt;br /&gt;
  0 logical volume(s) in volume group &amp;quot;drbd_sh0_vg0&amp;quot; now active&lt;br /&gt;
                                                           [  OK  ]&lt;br /&gt;
Signaling clvmd to exit                                    [  OK  ]&lt;br /&gt;
clvmd terminated                                           [  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;
/etc/init.d/drbd 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;
Stopping all DRBD resources: .&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;rgmanager&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/rgmanager 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 Cluster Service Manager:                          [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Monitoring Resources ===&lt;br /&gt;
&lt;br /&gt;
We will now use a tool called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clustat&amp;lt;/span&amp;gt; that lets us see what state the cluster&#039;s resources are in. You can run it as a once-off check of the services, or you can use the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;-i x&amp;lt;/span&amp;gt; switch, where &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;x&amp;lt;/span&amp;gt; is a number of seconds to wait between re-checking the cluster service states. If you use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;-i x&amp;lt;/span&amp;gt;, you will need to use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;ctrl&amp;gt;&amp;lt;/span&amp;gt;+&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;c&amp;gt;&amp;lt;/span&amp;gt; to quit and return to the shell.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
clustat&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Cluster Status for an-cluster01 @ Sat May  7 22:30:24 2011&lt;br /&gt;
Member Status: Quorate&lt;br /&gt;
&lt;br /&gt;
 Member Name                             ID   Status&lt;br /&gt;
 ------ ----                             ---- ------&lt;br /&gt;
 an-node04.alteeve.com                       1 Online, Local, rgmanager&lt;br /&gt;
 an-node05.alteeve.com                       2 Online, rgmanager&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State         &lt;br /&gt;
 ------- ----                   ----- ------                   -----         &lt;br /&gt;
 service:an4_storage            (none)                         disabled      &lt;br /&gt;
 service:an5_storage            (none)                         disabled      &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you remember earlier, we set the services to not &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;autostart&amp;lt;/span&amp;gt;, thus, they are disabled.&lt;br /&gt;
&lt;br /&gt;
=== Managing Cluster Resources ===&lt;br /&gt;
&lt;br /&gt;
Managing services in the cluster is done with a fairly simple tool called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clusvcadm&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The main commands we&#039;re going to look at shortly are:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clusvcadm -e &amp;lt;service&amp;gt; -m &amp;lt;node&amp;gt;&amp;lt;/span&amp;gt;: Enable the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;service&amp;gt;&amp;lt;/span&amp;gt; on the specified &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;node&amp;gt;&amp;lt;/span&amp;gt;. When a &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;node&amp;gt;&amp;lt;/span&amp;gt; is not specified, the local node where the command was run is assumed.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clusvcadm -d &amp;lt;service&amp;gt; -m &amp;lt;node&amp;gt;&amp;lt;/span&amp;gt;: Disable the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;service&amp;gt;&amp;lt;/span&amp;gt;.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clusvcadm -l &amp;lt;service&amp;gt;&amp;lt;/span&amp;gt;: Locks the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;service&amp;gt;&amp;lt;/span&amp;gt; prior to a cluster shutdown. The only action allowed when a &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;service&amp;gt;&amp;lt;/span&amp;gt; is frozen is disabling it. This allows you to stop the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;service&amp;gt;&amp;lt;/span&amp;gt; so that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; doesn&#039;t try to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;recover&amp;lt;/span&amp;gt; it (&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;restart&amp;lt;/span&amp;gt;, in our two services). Once [[quorum]] is dissolved and the cluster is shut down, the service is unlocked and returns to normal operation next time the node regains quorum.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clusvcadm -u &amp;lt;service&amp;gt;&amp;lt;/span&amp;gt;: Unlocks a &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;service&amp;gt;&amp;lt;/span&amp;gt;, should you change your mind and decide not to stop the cluster.&lt;br /&gt;
&lt;br /&gt;
There are other ways to use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clusvcadm&amp;lt;/span&amp;gt; which we will look at after the virtual servers are provisioned and under cluster control.&lt;br /&gt;
&lt;br /&gt;
=== A Note On Resource Management With DRBD ===&lt;br /&gt;
&lt;br /&gt;
We have something of a unique setup here, using DRBD, that requires a brief discussion.&lt;br /&gt;
&lt;br /&gt;
When the cluster starts for the first time, where neither node&#039;s DRBD storage was up, the first node to start will wait indefinitely for the second node to start. For this reason, we want to ensure that we enable the storage resources more or less at the same time and from two different terminals. The reason for two terminals is that the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clusvcadm -e ...&amp;lt;/span&amp;gt; command won&#039;t return until all resources have started, so you need the second terminal window to start the other node&#039;s clustered storage service while the first one waits.&lt;br /&gt;
&lt;br /&gt;
Keep an eye on [[syslog]], too. If anything goes wrong in DRBD and a split-brain is declared you will see messages like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Mar 29 20:24:37 an-node04 kernel: block drbd2: helper command: /sbin/drbdadm initial-split-brain minor-2&lt;br /&gt;
Mar 29 20:24:37 an-node04 kernel: block drbd2: helper command: /sbin/drbdadm initial-split-brain minor-2 exit code 0 (0x0)&lt;br /&gt;
Mar 29 20:24:37 an-node04 kernel: block drbd2: Split-Brain detected but unresolved, dropping connection!&lt;br /&gt;
Mar 29 20:24:37 an-node04 kernel: block drbd2: helper command: /sbin/drbdadm split-brain minor-2&lt;br /&gt;
Mar 29 20:24:37 an-node04 kernel: block drbd2: helper command: /sbin/drbdadm split-brain minor-2 exit code 0 (0x0)&lt;br /&gt;
Mar 29 20:24:37 an-node04 kernel: block drbd2: conn( WFReportParams -&amp;gt; Disconnecting )&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This can happen, for example, if you stop the cluster while DRBD is still up, and then break the network connection between the two DRBD resources. Recovering from a split-brain is covered in the trouble-shooting section below. &#039;&#039;&#039;ToDo&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{{note|1=Linbit has a good tutorial on recovering from split-brain conditions here: http://www.drbd.org/users-guide/s-resolve-split-brain.html}}&lt;br /&gt;
&lt;br /&gt;
=== Starting the Storage Services ===&lt;br /&gt;
&lt;br /&gt;
Now, with a terminal window opened for each node, run:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt;&#039;&#039;&#039;:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
clusvcadm -e service:an4_storage -m an-node04.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;
Member an-node04.alteeve.com trying to enable service:an4_storage...Success&lt;br /&gt;
service:an4_storage is now running on an-node04.alteeve.com&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt;&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
clusvcadm -e service:an5_storage -m an-node05.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;
Member an-node05.alteeve.com trying to enable service:an5_storage...Success&lt;br /&gt;
service:an5_storage is now running on an-node05.alteeve.com&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The [[syslog]] on either node should show something like this (sample from &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&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;
May  7 23:29:21 an-node04 clurgmgrd[12067]: &amp;lt;notice&amp;gt; Starting disabled service service:an4_storage &lt;br /&gt;
May  7 23:29:22 an-node04 kernel: drbd: initialized. Version: 8.3.8 (api:88/proto:86-94)&lt;br /&gt;
May  7 23:29:22 an-node04 kernel: drbd: GIT-hash: d78846e52224fd00562f7c225bcc25b2d422321d build by mockbuild@builder10.centos.org, 2010-06-04 08:04:27&lt;br /&gt;
May  7 23:29:22 an-node04 kernel: drbd: registered as block device major 147&lt;br /&gt;
May  7 23:29:22 an-node04 kernel: drbd: minor_table @ 0xffff8800cde780c0&lt;br /&gt;
May  7 23:29:22 an-node04 kernel: block drbd0: Starting worker thread (from cqueue/1 [152])&lt;br /&gt;
May  7 23:29:22 an-node04 kernel: klogd 1.4.1, ---------- state change ---------- &lt;br /&gt;
May  7 23:29:22 an-node04 kernel: block drbd0: disk( Diskless -&amp;gt; Attaching ) &lt;br /&gt;
May  7 23:29:22 an-node04 kernel: block drbd0: Found 4 transactions (98 active extents) in activity log.&lt;br /&gt;
May  7 23:29:22 an-node04 kernel: block drbd0: Method to ensure write ordering: barrier&lt;br /&gt;
May  7 23:29:22 an-node04 kernel: block drbd0: max_segment_size ( = BIO size ) = 32768&lt;br /&gt;
May  7 23:29:22 an-node04 kernel: block drbd0: drbd_bm_resize called with capacity == 19550368&lt;br /&gt;
May  7 23:29:22 an-node04 kernel: block drbd0: resync bitmap: bits=2443796 words=38185&lt;br /&gt;
May  7 23:29:22 an-node04 kernel: block drbd0: size = 9546 MB (9775184 KB)&lt;br /&gt;
May  7 23:29:22 an-node04 kernel: block drbd0: recounting of set bits took additional 1 jiffies&lt;br /&gt;
May  7 23:29:22 an-node04 kernel: block drbd0: 0 KB (0 bits) marked out-of-sync by on disk bit-map.&lt;br /&gt;
May  7 23:29:22 an-node04 kernel: block drbd0: disk( Attaching -&amp;gt; Outdated ) &lt;br /&gt;
May  7 23:29:22 an-node04 kernel: block drbd1: Starting worker thread (from cqueue/1 [152])&lt;br /&gt;
May  7 23:29:22 an-node04 kernel: block drbd1: disk( Diskless -&amp;gt; Attaching ) &lt;br /&gt;
May  7 23:29:22 an-node04 kernel: block drbd1: Found 1 transactions (1 active extents) in activity log.&lt;br /&gt;
May  7 23:29:22 an-node04 kernel: block drbd1: Method to ensure write ordering: barrier&lt;br /&gt;
May  7 23:29:22 an-node04 kernel: block drbd1: max_segment_size ( = BIO size ) = 32768&lt;br /&gt;
May  7 23:29:22 an-node04 kernel: block drbd1: drbd_bm_resize called with capacity == 195328232&lt;br /&gt;
May  7 23:29:22 an-node04 kernel: block drbd1: resync bitmap: bits=24416029 words=381501&lt;br /&gt;
May  7 23:29:22 an-node04 kernel: block drbd1: size = 93 GB (97664116 KB)&lt;br /&gt;
May  7 23:29:22 an-node04 kernel: block drbd1: recounting of set bits took additional 2 jiffies&lt;br /&gt;
May  7 23:29:22 an-node04 kernel: block drbd1: 0 KB (0 bits) marked out-of-sync by on disk bit-map.&lt;br /&gt;
May  7 23:29:22 an-node04 kernel: block drbd1: disk( Attaching -&amp;gt; Outdated ) &lt;br /&gt;
May  7 23:29:22 an-node04 kernel: block drbd2: Starting worker thread (from cqueue/1 [152])&lt;br /&gt;
May  7 23:29:22 an-node04 kernel: block drbd2: disk( Diskless -&amp;gt; Attaching ) &lt;br /&gt;
May  7 23:29:22 an-node04 kernel: block drbd2: Found 1 transactions (1 active extents) in activity log.&lt;br /&gt;
May  7 23:29:22 an-node04 kernel: block drbd2: Method to ensure write ordering: barrier&lt;br /&gt;
May  7 23:29:22 an-node04 kernel: block drbd2: max_segment_size ( = BIO size ) = 32768&lt;br /&gt;
May  7 23:29:22 an-node04 kernel: block drbd2: drbd_bm_resize called with capacity == 195328232&lt;br /&gt;
May  7 23:29:22 an-node04 kernel: block drbd2: resync bitmap: bits=24416029 words=381501&lt;br /&gt;
May  7 23:29:22 an-node04 kernel: block drbd2: size = 93 GB (97664116 KB)&lt;br /&gt;
May  7 23:29:22 an-node04 kernel: block drbd2: recounting of set bits took additional 2 jiffies&lt;br /&gt;
May  7 23:29:22 an-node04 kernel: block drbd2: 0 KB (0 bits) marked out-of-sync by on disk bit-map.&lt;br /&gt;
May  7 23:29:22 an-node04 kernel: block drbd2: disk( Attaching -&amp;gt; Outdated ) &lt;br /&gt;
May  7 23:29:22 an-node04 kernel: block drbd3: Starting worker thread (from cqueue/1 [152])&lt;br /&gt;
May  7 23:29:22 an-node04 kernel: block drbd3: disk( Diskless -&amp;gt; Attaching ) &lt;br /&gt;
May  7 23:29:22 an-node04 kernel: block drbd3: No usable activity log found.&lt;br /&gt;
May  7 23:29:22 an-node04 kernel: block drbd3: Method to ensure write ordering: barrier&lt;br /&gt;
May  7 23:29:22 an-node04 kernel: block drbd3: max_segment_size ( = BIO size ) = 32768&lt;br /&gt;
May  7 23:29:22 an-node04 kernel: block drbd3: drbd_bm_resize called with capacity == 515686680&lt;br /&gt;
May  7 23:29:22 an-node04 kernel: block drbd3: resync bitmap: bits=64460835 words=1007201&lt;br /&gt;
May  7 23:29:22 an-node04 kernel: block drbd3: size = 246 GB (257843340 KB)&lt;br /&gt;
May  7 23:29:22 an-node04 kernel: block drbd3: recounting of set bits took additional 5 jiffies&lt;br /&gt;
May  7 23:29:22 an-node04 kernel: block drbd3: 0 KB (0 bits) marked out-of-sync by on disk bit-map.&lt;br /&gt;
May  7 23:29:22 an-node04 kernel: block drbd3: disk( Attaching -&amp;gt; Outdated ) &lt;br /&gt;
May  7 23:29:23 an-node04 kernel: block drbd0: conn( StandAlone -&amp;gt; Unconnected ) &lt;br /&gt;
May  7 23:29:23 an-node04 kernel: block drbd0: Starting receiver thread (from drbd0_worker [14542])&lt;br /&gt;
May  7 23:29:23 an-node04 kernel: block drbd0: receiver (re)started&lt;br /&gt;
May  7 23:29:23 an-node04 kernel: block drbd0: conn( Unconnected -&amp;gt; WFConnection ) &lt;br /&gt;
May  7 23:29:23 an-node04 kernel: block drbd1: conn( StandAlone -&amp;gt; Unconnected ) &lt;br /&gt;
May  7 23:29:23 an-node04 kernel: block drbd1: Starting receiver thread (from drbd1_worker [14556])&lt;br /&gt;
May  7 23:29:23 an-node04 kernel: block drbd1: receiver (re)started&lt;br /&gt;
May  7 23:29:23 an-node04 kernel: block drbd1: conn( Unconnected -&amp;gt; WFConnection ) &lt;br /&gt;
May  7 23:29:23 an-node04 kernel: block drbd2: conn( StandAlone -&amp;gt; Unconnected ) &lt;br /&gt;
May  7 23:29:23 an-node04 kernel: block drbd2: Starting receiver thread (from drbd2_worker [14571])&lt;br /&gt;
May  7 23:29:23 an-node04 kernel: block drbd2: receiver (re)started&lt;br /&gt;
May  7 23:29:23 an-node04 kernel: block drbd2: conn( Unconnected -&amp;gt; WFConnection ) &lt;br /&gt;
May  7 23:29:23 an-node04 kernel: block drbd3: conn( StandAlone -&amp;gt; Unconnected ) &lt;br /&gt;
May  7 23:29:23 an-node04 kernel: block drbd3: Starting receiver thread (from drbd3_worker [14590])&lt;br /&gt;
May  7 23:29:23 an-node04 kernel: block drbd3: receiver (re)started&lt;br /&gt;
May  7 23:29:23 an-node04 kernel: block drbd3: conn( Unconnected -&amp;gt; WFConnection ) &lt;br /&gt;
May  7 23:29:24 an-node04 kernel: block drbd0: Handshake successful: Agreed network protocol version 94&lt;br /&gt;
May  7 23:29:24 an-node04 kernel: block drbd0: conn( WFConnection -&amp;gt; WFReportParams ) &lt;br /&gt;
May  7 23:29:24 an-node04 kernel: block drbd0: Starting asender thread (from drbd0_receiver [14610])&lt;br /&gt;
May  7 23:29:24 an-node04 kernel: block drbd0: data-integrity-alg: &amp;lt;not-used&amp;gt;&lt;br /&gt;
May  7 23:29:24 an-node04 kernel: block drbd0: drbd_sync_handshake:&lt;br /&gt;
May  7 23:29:24 an-node04 kernel: block drbd0: self 60D1A5567634DECE:0000000000000000:49B42CE39BDB4567:2C84CA6708465E8D bits:0 flags:0&lt;br /&gt;
May  7 23:29:24 an-node04 kernel: block drbd0: peer 8033D8F146F6823A:60D1A5567634DECF:49B42CE39BDB4566:2C84CA6708465E8D bits:0 flags:0&lt;br /&gt;
May  7 23:29:24 an-node04 kernel: block drbd0: uuid_compare()=-1 by rule 50&lt;br /&gt;
May  7 23:29:24 an-node04 kernel: block drbd0: peer( Unknown -&amp;gt; Secondary ) conn( WFReportParams -&amp;gt; WFBitMapT ) pdsk( DUnknown -&amp;gt; UpToDate ) &lt;br /&gt;
May  7 23:29:24 an-node04 kernel: block drbd1: Handshake successful: Agreed network protocol version 94&lt;br /&gt;
May  7 23:29:24 an-node04 kernel: block drbd1: conn( WFConnection -&amp;gt; WFReportParams ) &lt;br /&gt;
May  7 23:29:24 an-node04 kernel: block drbd2: Handshake successful: Agreed network protocol version 94&lt;br /&gt;
May  7 23:29:24 an-node04 kernel: block drbd2: conn( WFConnection -&amp;gt; WFReportParams ) &lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd1: Starting asender thread (from drbd1_receiver [14613])&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd2: Starting asender thread (from drbd2_receiver [14616])&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd1: data-integrity-alg: &amp;lt;not-used&amp;gt;&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd1: drbd_sync_handshake:&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd1: self A6B85B6E10FC9ED4:0000000000000000:25BC8F003E8EDE15:6DE822E83F4ED721 bits:0 flags:0&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd1: peer 73B4642E7231664C:A6B85B6E10FC9ED5:25BC8F003E8EDE15:6DE822E83F4ED721 bits:0 flags:0&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd1: uuid_compare()=-1 by rule 50&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd1: peer( Unknown -&amp;gt; Secondary ) conn( WFReportParams -&amp;gt; WFBitMapT ) pdsk( DUnknown -&amp;gt; UpToDate ) &lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd2: data-integrity-alg: &amp;lt;not-used&amp;gt;&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd2: drbd_sync_handshake:&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd2: self D074F4853E9FAFE6:0000000000000000:05586D2FABD3DD12:64590F358F14E685 bits:0 flags:0&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd2: peer 399131BDEB288486:D074F4853E9FAFE7:05586D2FABD3DD13:64590F358F14E685 bits:0 flags:0&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd2: uuid_compare()=-1 by rule 50&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd2: peer( Unknown -&amp;gt; Secondary ) conn( WFReportParams -&amp;gt; WFBitMapT ) pdsk( DUnknown -&amp;gt; UpToDate ) &lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd3: Handshake successful: Agreed network protocol version 94&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd3: conn( WFConnection -&amp;gt; WFReportParams ) &lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd3: Starting asender thread (from drbd3_receiver [14619])&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd3: data-integrity-alg: &amp;lt;not-used&amp;gt;&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd3: drbd_sync_handshake:&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd3: self 5BA622DBC6DE170E:0000000000000000:0DE6667028BDEEFE:66C10BDFC06939F3 bits:0 flags:0&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd3: peer E6526E269E123D4C:5BA622DBC6DE170F:0DE6667028BDEEFF:66C10BDFC06939F3 bits:0 flags:0&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd3: uuid_compare()=-1 by rule 50&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd3: peer( Unknown -&amp;gt; Secondary ) conn( WFReportParams -&amp;gt; WFBitMapT ) pdsk( DUnknown -&amp;gt; UpToDate ) &lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd0: conn( WFBitMapT -&amp;gt; WFSyncUUID ) &lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd0: helper command: /sbin/drbdadm before-resync-target minor-0&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd1: conn( WFBitMapT -&amp;gt; WFSyncUUID ) &lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd0: role( Secondary -&amp;gt; Primary ) &lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd1: helper command: /sbin/drbdadm before-resync-target minor-1&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd1: helper command: /sbin/drbdadm before-resync-target minor-1 exit code 0 (0x0)&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd1: conn( WFSyncUUID -&amp;gt; SyncTarget ) disk( Outdated -&amp;gt; Inconsistent ) &lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd1: Began resync as SyncTarget (will sync 0 KB [0 bits set]).&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd1: Resync done (total 1 sec; paused 0 sec; 0 K/sec)&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd1: conn( SyncTarget -&amp;gt; Connected ) disk( Inconsistent -&amp;gt; UpToDate ) &lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd1: helper command: /sbin/drbdadm after-resync-target minor-1&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd2: conn( WFBitMapT -&amp;gt; WFSyncUUID ) &lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd1: helper command: /sbin/drbdadm after-resync-target minor-1 exit code 0 (0x0)&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd2: helper command: /sbin/drbdadm before-resync-target minor-2&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd2: helper command: /sbin/drbdadm before-resync-target minor-2 exit code 0 (0x0)&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd2: conn( WFSyncUUID -&amp;gt; SyncTarget ) disk( Outdated -&amp;gt; Inconsistent ) &lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd2: Began resync as SyncTarget (will sync 0 KB [0 bits set]).&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd2: Resync done (total 1 sec; paused 0 sec; 0 K/sec)&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd2: conn( SyncTarget -&amp;gt; Connected ) disk( Inconsistent -&amp;gt; UpToDate ) &lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd2: helper command: /sbin/drbdadm after-resync-target minor-2&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd0: helper command: /sbin/drbdadm before-resync-target minor-0 exit code 0 (0x0)&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd0: conn( WFSyncUUID -&amp;gt; SyncTarget ) disk( Outdated -&amp;gt; Inconsistent ) &lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd0: Began resync as SyncTarget (will sync 0 KB [0 bits set]).&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd0: Resync done (total 1 sec; paused 0 sec; 0 K/sec)&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd0: conn( SyncTarget -&amp;gt; Connected ) disk( Inconsistent -&amp;gt; UpToDate ) &lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd0: helper command: /sbin/drbdadm after-resync-target minor-0&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd2: helper command: /sbin/drbdadm after-resync-target minor-2 exit code 0 (0x0)&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd0: helper command: /sbin/drbdadm after-resync-target minor-0 exit code 0 (0x0)&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd3: conn( WFBitMapT -&amp;gt; WFSyncUUID ) &lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd1: Connected in w_make_resync_request&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd2: Connected in w_make_resync_request&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd3: helper command: /sbin/drbdadm before-resync-target minor-3&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd3: helper command: /sbin/drbdadm before-resync-target minor-3 exit code 0 (0x0)&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd3: conn( WFSyncUUID -&amp;gt; SyncTarget ) disk( Outdated -&amp;gt; Inconsistent ) &lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd3: Began resync as SyncTarget (will sync 0 KB [0 bits set]).&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd3: Resync done (total 1 sec; paused 0 sec; 0 K/sec)&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd3: conn( SyncTarget -&amp;gt; Connected ) disk( Inconsistent -&amp;gt; UpToDate ) &lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd3: helper command: /sbin/drbdadm after-resync-target minor-3&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd3: helper command: /sbin/drbdadm after-resync-target minor-3 exit code 0 (0x0)&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd0: Connected in w_make_resync_request&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd1: role( Secondary -&amp;gt; Primary ) &lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd3: Connected in w_make_resync_request&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd2: role( Secondary -&amp;gt; Primary ) &lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd3: role( Secondary -&amp;gt; Primary ) &lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd0: peer( Secondary -&amp;gt; Primary ) &lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd1: peer( Secondary -&amp;gt; Primary ) &lt;br /&gt;
May  7 23:29:26 an-node04 kernel: block drbd2: peer( Secondary -&amp;gt; Primary ) &lt;br /&gt;
May  7 23:29:26 an-node04 kernel: block drbd3: peer( Secondary -&amp;gt; Primary ) &lt;br /&gt;
May  7 23:29:26 an-node04 clvmd: Cluster LVM daemon started - connected to CMAN&lt;br /&gt;
May  7 23:29:27 an-node04 kernel: GFS2: fsid=: Trying to join cluster &amp;quot;lock_dlm&amp;quot;, &amp;quot;an-cluster01:xen_shared&amp;quot;&lt;br /&gt;
May  7 23:29:27 an-node04 kernel: GFS2: fsid=an-cluster01:xen_shared.0: Joined cluster. Now mounting FS...&lt;br /&gt;
May  7 23:29:27 an-node04 kernel: GFS2: fsid=an-cluster01:xen_shared.0: jid=0, already locked for use&lt;br /&gt;
May  7 23:29:27 an-node04 kernel: GFS2: fsid=an-cluster01:xen_shared.0: jid=0: Looking at journal...&lt;br /&gt;
May  7 23:29:27 an-node04 kernel: GFS2: fsid=an-cluster01:xen_shared.0: jid=0: Done&lt;br /&gt;
May  7 23:29:27 an-node04 kernel: GFS2: fsid=an-cluster01:xen_shared.0: jid=1: Trying to acquire journal lock...&lt;br /&gt;
May  7 23:29:27 an-node04 kernel: GFS2: fsid=an-cluster01:xen_shared.0: jid=1: Looking at journal...&lt;br /&gt;
May  7 23:29:27 an-node04 kernel: GFS2: fsid=an-cluster01:xen_shared.0: jid=1: Done&lt;br /&gt;
May  7 23:29:28 an-node04 clurgmgrd[12067]: &amp;lt;notice&amp;gt; Service service:an4_storage started &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here is what we&#039;re seeing:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clurgmgrd&amp;lt;/span&amp;gt;, the cluster &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; daemon, take the request to start the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an4_storage&amp;lt;/span&amp;gt; service.&lt;br /&gt;
* This is immediately followed by a lot of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;drbd&amp;lt;/span&amp;gt; messages showing the attachment, connection and promotion of the DRBD resources.&lt;br /&gt;
* Once the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;drbd&amp;lt;/span&amp;gt; daemon reported that it was up, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clurgmgrd&amp;lt;/span&amp;gt; started the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clvmd&amp;lt;/span&amp;gt; daemon.&lt;br /&gt;
* Next we see the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;gfs2&amp;lt;/span&amp;gt; initialization script start up.&lt;br /&gt;
* Once this last daemon returns, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clurgmgrd&amp;lt;/span&amp;gt; reports that the service started successfully.&lt;br /&gt;
&lt;br /&gt;
Now you can check &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; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;gfs2&amp;lt;/span&amp;gt; again and you will see that they are all online.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/drbd 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;
drbd driver loaded OK; device status:&lt;br /&gt;
version: 8.3.8 (api:88/proto:86-94)&lt;br /&gt;
GIT-hash: d78846e52224fd00562f7c225bcc25b2d422321d build by mockbuild@builder10.centos.org, 2010-06-04 08:04:27&lt;br /&gt;
m:res  cs         ro               ds                 p  mounted  fstype&lt;br /&gt;
0:r0   Connected  Primary/Primary  UpToDate/UpToDate  C&lt;br /&gt;
1:r1   Connected  Primary/Primary  UpToDate/UpToDate  C&lt;br /&gt;
2:r2   Connected  Primary/Primary  UpToDate/UpToDate  C&lt;br /&gt;
3:r3   Connected  Primary/Primary  UpToDate/UpToDate  C&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;
/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 (pid  14700) is running...&lt;br /&gt;
Clustered Volume Groups: drbd_an5_vg0 drbd_an4_vg0 drbd_sh0_vg0&lt;br /&gt;
Active clustered Logical Volumes: /dev/drbd_sh0_vg0/xen_shared&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;
/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;
/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, let&#039;s check &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clustat&amp;lt;/span&amp;gt; again and we&#039;ll see that the services are online.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
clustat&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Cluster Status for an-cluster01 @ Sat May  7 23:35:03 2011&lt;br /&gt;
Member Status: Quorate&lt;br /&gt;
&lt;br /&gt;
 Member Name                             ID   Status&lt;br /&gt;
 ------ ----                             ---- ------&lt;br /&gt;
 an-node04.alteeve.com                       1 Online, Local, rgmanager&lt;br /&gt;
 an-node05.alteeve.com                       2 Online, rgmanager&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State         &lt;br /&gt;
 ------- ----                   ----- ------                   -----         &lt;br /&gt;
 service:an4_storage            an-node04.alteeve.com          started       &lt;br /&gt;
 service:an5_storage            an-node05.alteeve.com          started       &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Hoozah!&lt;br /&gt;
&lt;br /&gt;
=== Stopping Clustered Services ===&lt;br /&gt;
&lt;br /&gt;
With the services we&#039;ve created, it&#039;s actually pretty simple to shut things down. Simply stopping &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; on each node will stop the services and, as they&#039;re not able to fail over, the services will stay offline. This can lead to bad habits though. So, to get into the proper habit, let&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;lock&amp;lt;/span&amp;gt; then &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;disable&amp;lt;/span&amp;gt; the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an5_storage&amp;lt;/span&amp;gt; service and then shutdown &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt;&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
clusvcadm -l service:an5_storage -m an-node05.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;
Resource groups locked&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;
clusvcadm -d service:an5_storage -m an-node05.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;
Member an-node05.alteeve.com disabling service:an5_storage...Success&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now when you try to run &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clustat&amp;lt;/span&amp;gt;, you can see that the service on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt; is disabled.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
clustat&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Cluster Status for an-cluster01 @ Sat May  7 23:43:10 2011&lt;br /&gt;
Member Status: Quorate&lt;br /&gt;
&lt;br /&gt;
 Member Name                             ID   Status&lt;br /&gt;
 ------ ----                             ---- ------&lt;br /&gt;
 an-node04.alteeve.com                       1 Online, rgmanager&lt;br /&gt;
 an-node05.alteeve.com                       2 Online, Local, rgmanager&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State         &lt;br /&gt;
 ------- ----                   ----- ------                   -----         &lt;br /&gt;
 service:an4_storage            an-node04.alteeve.com          started       &lt;br /&gt;
 service:an5_storage            (an-node05.alteeve.com)        disabled      &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we can shutdown &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; proper.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/rgmanager 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;
Shutting down Cluster Service Manager...&lt;br /&gt;
Waiting for services to stop:                              [  OK  ]&lt;br /&gt;
Cluster Service Manager is stopped.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clustat&amp;lt;/span&amp;gt; will not show any services at all when run from &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt;&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
clustat&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Cluster Status for an-cluster01 @ Sat May  7 23:57:55 2011&lt;br /&gt;
Member Status: Quorate&lt;br /&gt;
&lt;br /&gt;
 Member Name                             ID   Status&lt;br /&gt;
 ------ ----                             ---- ------&lt;br /&gt;
 an-node04.alteeve.com                       1 Online&lt;br /&gt;
 an-node05.alteeve.com                       2 Online, Local&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can still see both services from &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt; though.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt;&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
clustat&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Cluster Status for an-cluster01 @ Sat May  7 23:43:43 2011&lt;br /&gt;
Member Status: Quorate&lt;br /&gt;
&lt;br /&gt;
 Member Name                             ID   Status&lt;br /&gt;
 ------ ----                             ---- ------&lt;br /&gt;
 an-node04.alteeve.com                       1 Online, Local, rgmanager&lt;br /&gt;
 an-node05.alteeve.com                       2 Online&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State         &lt;br /&gt;
 ------- ----                   ----- ------                   -----         &lt;br /&gt;
 service:an4_storage            an-node04.alteeve.com          started       &lt;br /&gt;
 service:an5_storage            (an-node05.alteeve.com)        disabled      &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{note|1=You may notice that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; is no longer showing to the right of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05.alteeve.com&amp;lt;/span&amp;gt;. This indicates that the other node&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; daemon has stopped.}}&lt;br /&gt;
&lt;br /&gt;
Now we can go back to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt; and completely shut down the cluster.&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;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Stopping cluster: &lt;br /&gt;
   Stopping fencing... done&lt;br /&gt;
   Stopping cman... done&lt;br /&gt;
   Stopping ccsd... done&lt;br /&gt;
   Unmounting configfs... done&lt;br /&gt;
                                                           [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can check on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt; and see that the cluster is now down to just itself.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cman_tool 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;
Version: 6.2.0&lt;br /&gt;
Config Version: 13&lt;br /&gt;
Cluster Name: an-cluster01&lt;br /&gt;
Cluster Id: 60257&lt;br /&gt;
Cluster Member: Yes&lt;br /&gt;
Cluster Generation: 144&lt;br /&gt;
Membership state: Cluster-Member&lt;br /&gt;
Nodes: 1&lt;br /&gt;
Expected votes: 1&lt;br /&gt;
Total votes: 1&lt;br /&gt;
Quorum: 1  &lt;br /&gt;
Active subsystems: 9&lt;br /&gt;
Flags: 2node Dirty &lt;br /&gt;
Ports Bound: 0 11 177  &lt;br /&gt;
Node name: an-node04.alteeve.com&lt;br /&gt;
Node ID: 1&lt;br /&gt;
Multicast addresses: 239.192.235.77 &lt;br /&gt;
Node addresses: 192.168.3.74 &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At this point, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt; is totally out of the cluster and, if you wanted, you could perform any maintenance you might want to do. More on that later though.&lt;br /&gt;
&lt;br /&gt;
= Provisioning Our Virtual Servers =&lt;br /&gt;
&lt;br /&gt;
Finally, the goal of this cluster is in sight!&lt;br /&gt;
&lt;br /&gt;
We have two steps left;&lt;br /&gt;
* Provision our VMs.&lt;br /&gt;
* Add the VMs to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Provisioning&amp;quot; a virtual machine simple means to create it. This tutorial is more about clustering than Xen and virtual machine administration, so some liberties will be taken with regard to your knowledge of Xen. We&#039;ll cover all of the steps needed to provision and manage the VMs, but there will not be an in-depth discussion of the tools and their various uses.&lt;br /&gt;
&lt;br /&gt;
Please, if you are totally unfamiliar with [[Xen]], take a few minutes to review some tutorials:&lt;br /&gt;
&lt;br /&gt;
{{note|1=We are using Xen v3.0, heavily patched to be almost the same as 3.1. At the time of writing, the latest is v4.1. Please take not of the version when reading the tutorials below.}}&lt;br /&gt;
&lt;br /&gt;
* [[Networking in Xen 3.x]]; A brief overview of how networking works in our cluster.&lt;br /&gt;
* [http://wiki.xen.org/xenwiki/XenOverview Xen Overview]; Four useful [[PDF]]s in this link.&lt;br /&gt;
* [http://wiki.xen.org/xenwiki/XenFaq Xen FAQ]&lt;br /&gt;
* [http://wiki.xen.org/xenwiki/XenDocs Xen Documentation]; Includes v3 User Manual.&lt;br /&gt;
* [http://wiki.xen.org/xenwiki/HowTos Xen HowTos]; The Xen [http://wiki.xen.org/xenwiki/XenNetworking Networking] section may be particularly helpful.&lt;br /&gt;
* [http://wiki.xen.org/xenwiki/XenManagementTools Xen Management Tools]; Covers &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-manager&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;libvirtd&amp;lt;/span&amp;gt;.&lt;br /&gt;
* [http://wiki.xen.org/xenwiki/XenCommonProblems Xen Common Problems]; Somewhere between an FAQ and a troubleshooting guide.&lt;br /&gt;
&lt;br /&gt;
== Starting libvirtd On The Nodes ==&lt;br /&gt;
&lt;br /&gt;
In the following steps, we will be using a program called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virsh&amp;lt;/span&amp;gt; on the nodes and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-manager&amp;lt;/span&amp;gt; on our workstations to view the VMs. For this, we need to make sure that the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;libvirtd&amp;lt;/span&amp;gt; daemon is running on each node first. This ties in to the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;(xend-unix-server yes)&amp;lt;/span&amp;gt; value we changed in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/xen/xend-config.sxp&amp;lt;/span&amp;gt; file we set earlier, you may recall.&lt;br /&gt;
&lt;br /&gt;
Lets start the daemon now as we&#039;re going to use it very shortly.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On Both Nodes&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/libvirtd 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 libvirtd daemon:                                  [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To start &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;libvirtd&amp;lt;/span&amp;gt; on boot, run the command below.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;On Both Nodes&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
chkconfig libvirtd on&lt;br /&gt;
chkconfig --list libvirtd&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
libvirtd       	0:off	1:off	2:on	3:on	4:on	5:on	6:off&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Accessing The VMs ==&lt;br /&gt;
&lt;br /&gt;
The virtual servers we are going to create are, by definition, &amp;quot;headless&amp;quot;. There is no monitor or place to plug in a keyboard.&lt;br /&gt;
&lt;br /&gt;
The main way that you will monitor the virtual servers is through [[VNC]]. If you are running a relatively recent version of Linux on your workstation, there is a fantastic little program for connecting to and monitoring the VMs on multiple nodes using multiple [[hypervisor]]s called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-manager&amp;lt;/span&amp;gt;. It is available under many Linux distribution&#039;s package managers under the same name. &lt;br /&gt;
&lt;br /&gt;
In Fedora, [[EL]] 5 and 6 and many other [[RPM]] based distributions, you can install &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-manager&amp;lt;/span&amp;gt; on your workstation with the following command.&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;
You can then find &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-manager&amp;lt;/span&amp;gt; on you &#039;&#039;System Tools&#039;&#039; -&amp;gt; &#039;&#039;Virtual Machine Manager&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
To establish a connection to the nodes, click on &#039;&#039;File&#039;&#039; -&amp;gt; &#039;&#039;Add Connection...&#039;&#039;. Change the &#039;&#039;Hypervisor&#039;&#039; selection bar to &#039;&#039;&#039;Xen&#039;&#039;&#039;, check to select &#039;&#039;Connect to remote host&#039;&#039;, leave the default &#039;&#039;Method&#039;&#039; as &#039;&#039;&#039;SSH&#039;&#039;&#039; and &#039;&#039;Username&#039;&#039; as &#039;&#039;&#039;root&#039;&#039;&#039;. Then enter the host name or IP address of each node in the &#039;&#039;Hostname&#039;&#039; field. I always add cluster nodes to my &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/hosts&amp;lt;/span&amp;gt; file so that I can simply enter &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt;. How you handle this is up to you and your preferences.&lt;br /&gt;
&lt;br /&gt;
[[Image:virt-manager_fedora-14_01.png|thumb|340px|center|Adding a connection to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-manager&amp;lt;/span&amp;gt; on Fedora 14.]]&lt;br /&gt;
&lt;br /&gt;
Once both nodes are added, you should see that there is already a &#039;&#039;Domain-0&#039;&#039; entry. This is because, as we discussed earlier, even the &amp;quot;host&amp;quot; OS is itself a virtual machine.&lt;br /&gt;
&lt;br /&gt;
[[Image:virt-manager_fedora-14_02.png|thumb|484px|center|A view of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-manager&amp;lt;/span&amp;gt; on Fedora 14.]]&lt;br /&gt;
&lt;br /&gt;
== Limiting dom0&#039;s RAM Use ==&lt;br /&gt;
&lt;br /&gt;
Normally, [[dom0]] will claim and use memory not allocated to virtual machines. This can cause trouble if, for example, you&#039;ve migrated a [[VM]] off of a node and then want to move it or another VM back shortly after. For a period of time, dom0 will claim that there is not enough free memory for the migration. By setting a hard limit of dom0&#039;s memory usage, this scenario won&#039;t happen and you will not need to delay migrations.&lt;br /&gt;
&lt;br /&gt;
To do this, add &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;dom0_mem=1024M&amp;lt;/span&amp;gt; to the Xen kernel image&#039;s first &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;module&amp;lt;/span&amp;gt; line in [[grub]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /boot/grub/grub.conf /boot/grub/grub.conf.orig&lt;br /&gt;
vim /boot/grub/grub.conf&lt;br /&gt;
diff -u /boot/grub/grub.conf.orig /boot/grub/grub.conf&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;diff&amp;quot;&amp;gt;&lt;br /&gt;
--- /boot/grub/grub.conf.orig	2011-05-10 22:49:09.000000000 -0400&lt;br /&gt;
+++ /boot/grub/grub.conf	2011-05-10 22:54:57.000000000 -0400&lt;br /&gt;
@@ -14,11 +14,11 @@&lt;br /&gt;
 title CentOS (2.6.18-238.9.1.el5xen)&lt;br /&gt;
 	root (hd0,0)&lt;br /&gt;
 	kernel /xen.gz-2.6.18-238.9.1.el5&lt;br /&gt;
-	module /vmlinuz-2.6.18-238.9.1.el5xen ro root=LABEL=/&lt;br /&gt;
+	module /vmlinuz-2.6.18-238.9.1.el5xen ro root=LABEL=/ dom0_mem=1024M&lt;br /&gt;
 	module /initrd-2.6.18-238.9.1.el5xen.img&lt;br /&gt;
 title CentOS (2.6.18-238.9.1.el5)&lt;br /&gt;
 	root (hd0,0)&lt;br /&gt;
-	kernel /vmlinuz-2.6.18-238.9.1.el5 ro root=LABEL=/&lt;br /&gt;
+	kernel /vmlinuz-2.6.18-238.9.1.el5 ro root=LABEL=/ dom0_mem=1024M&lt;br /&gt;
 	initrd /initrd-2.6.18-238.9.1.el5.img&lt;br /&gt;
 title CentOS (2.6.18-238.el5xen)&lt;br /&gt;
 	root (hd0,0)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can change &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;1024M&amp;lt;/span&amp;gt; with the amount of RAM you want to allocate to dom0.&lt;br /&gt;
&lt;br /&gt;
{{warning|1=If you update your kernel, ensure that this kernel argument was added to the new kernel&#039;s argument list.}}&lt;br /&gt;
&lt;br /&gt;
== Our planned layout ==&lt;br /&gt;
&lt;br /&gt;
At this stage, what you will want to run is almost certainly going to be unique to you, so we will not be going into detail about what each VM does. We will cover provisioning them, manipulating them and what not. The description of the VMs is purely an example of what they might be.&lt;br /&gt;
&lt;br /&gt;
We will be creating two virtual servers.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0001_ws1&amp;lt;/span&amp;gt;; A [[CentOS]] server hosting a website.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0002_win1&amp;lt;/span&amp;gt;; A [[Microsoft]] Windows server, showing how to host non-Linux virtual machines.&lt;br /&gt;
&lt;br /&gt;
We&#039;ll assign &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0001_ws1&amp;lt;/span&amp;gt; to normally run on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0002_win1&amp;lt;/span&amp;gt; to normally run on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Before we talk about resources, there is something you must be aware of. &lt;br /&gt;
* You can have more virtual machines than CPU cores. That is, machines can share core. It&#039;s advisable to dedicate one core to just the [[dom0]] machine.&lt;br /&gt;
* RAM on dom0 and all domU VMs must not exceed the maximum amount of RAM available in a given node.&lt;br /&gt;
&lt;br /&gt;
{{warning|1=You &#039;&#039;must&#039;&#039; consider how your collection of virtual servers will run when only on node is available. As I have 4 [[GiB]] of RAM in each node, I will assign 1 [[GiB]] to dom0 and then 1 [[GiB]] to each VM, leaving 1 GiB for future expansion. How you divvy up your memory and CPU cores is ultimately up to you.}}&lt;br /&gt;
&lt;br /&gt;
So here are our two planned virtual servers, laid out in a table. Doing this before provisioning can help you visualize how your cluster&#039;s resources will be consumed, helping to ensure that you don&#039;t use too much, which is of particular note on very large installations. It&#039;s also very useful for planning your virtual machine provisioning commands in the next step.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
!&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0001_ws1&amp;lt;/span&amp;gt;&lt;br /&gt;
!&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0002_win1&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Primary Host&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!RAM&lt;br /&gt;
|1024[[MiB]]&lt;br /&gt;
|1024[[MiB]]&lt;br /&gt;
|-&lt;br /&gt;
!Storage&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/drbd_an4_vg0/vm0001_1&amp;lt;/span&amp;gt;, 50 [[GB]]&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/drbd_an5_vg0/vm0002_1&amp;lt;/span&amp;gt;, 100 [[GB]] (100%)&lt;br /&gt;
|-&lt;br /&gt;
!Network(s)&lt;br /&gt;
|IFN &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xenbr0&amp;lt;/span&amp;gt;, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;192.168.1.200&amp;lt;/span&amp;gt;/&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;255.255.255.0&amp;lt;/span&amp;gt;&lt;br /&gt;
|BCN &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xenbr0&amp;lt;/span&amp;gt;, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;192.168.1.201&amp;lt;/span&amp;gt;/&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;255.255.255.0&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Source Files&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;http://192.168.1.254/c5/x86_64/img&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/xen_shared/iso/Win_Server_2008_Bis_x86_64.iso&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Kickstart Script&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;http://192.168.1.254/c5/x86_64/ks/generic_c5.ks&amp;lt;/span&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{{warning|1=There are issues with installing VMs from [[ISO]] images. For this reason, you are advised to make the installation images available over a web server. A great way to do this is by creating a [[Setting Up a PXE Server in Fedora|PXE server]] on your network. Then you can point to it&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;img&amp;lt;/span&amp;gt; directory when running the VM installs. This tutorial assumes this is available.}}&lt;br /&gt;
&lt;br /&gt;
=== Provisioning vm0001_ws1; A Webserver ===&lt;br /&gt;
&lt;br /&gt;
So let&#039;s start with a basic web server. &lt;br /&gt;
&lt;br /&gt;
Provisioning VMs requires two steps;&lt;br /&gt;
* Creating a logical volume on the clustered LVM.&lt;br /&gt;
* Craft and execute a &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-install&amp;lt;/span&amp;gt; command.&lt;br /&gt;
&lt;br /&gt;
Before you proceed, you need to know where the installation image files are found. This tutorial uses a [[Setting Up a PXE Server in Fedora|PXE server]], so we&#039;ll be telling &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-install&amp;lt;/span&amp;gt; to pull the installation files and [[kickstart]] scripts off of it&#039;s web server. If you don&#039;t have a PXE server, simply mounting the installation image&#039;s ISO and making that available through a trivial webserver setup will be fine. How you do this, exactly, is outside the scope of this tutorial. However, there is a separate, detailed configuration tutorial for setting up a [[Setting Up a PXE Server in Fedora|PXE server]] which covers a basic [[apache]] configuration.&lt;br /&gt;
&lt;br /&gt;
Create the [[LV]] for the VM on the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/drbd_an4_vg0&amp;lt;/span&amp;gt; [[VG]], as it will primarily run on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&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;
lvcreate -L 50G -n vm0001_1 --addtag @an-cluster01 /dev/drbd_an4_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;vm0001_1&amp;quot; created&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{note|1=The example below uses the following kickstart file. Please adapt it for your use.&amp;lt;br /&amp;gt;&lt;br /&gt;
* [[generic_c5.ks]]}}&lt;br /&gt;
&lt;br /&gt;
Now, the long &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-install&amp;lt;/span&amp;gt; command to provision the VM. Let&#039;s look at it, then we&#039;ll discuss it.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
virt-install --connect xen \&lt;br /&gt;
	--name vm0001_ws1 \&lt;br /&gt;
	--ram 1048 \&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.254/c5/x86_64/img \&lt;br /&gt;
	--extra-args &amp;quot;ks=http://192.168.1.254/c5/x86_64/ks/generic_c5.ks&amp;quot; \&lt;br /&gt;
	--os-type linux \&lt;br /&gt;
	--os-variant rhel5.4 \&lt;br /&gt;
	--disk path=/dev/drbd_an4_vg0/vm0001_1 \&lt;br /&gt;
	--network bridge=xenbr0 \&lt;br /&gt;
	--vnc \&lt;br /&gt;
	--paravirt&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{note|1=If you wanted to provision a VM to act as a firewall, or for other reasons wanted a VM to access the back-channel, you could connect to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xenbr2&amp;lt;/span&amp;gt; by simply adding a second &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--network bridge=xenbr2&amp;lt;/span&amp;gt; argument.}}&lt;br /&gt;
&lt;br /&gt;
The [[man]] page for &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-install&amp;lt;/span&amp;gt; covers all of the options you can pass in good detail. We&#039;re going to discuss now the options used here, but it will only be a subset of options that you may wish to use. Please take the time to read &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;man virt-install&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--connect xen&amp;lt;/span&amp;gt;; Tells &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-install&amp;lt;/span&amp;gt; that we are provisioning a Xen [[domU]] VM.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--name vm0001_ws1&amp;lt;/span&amp;gt;; Tells &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-install&amp;lt;/span&amp;gt; to give the VM the name &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0001_ws1&amp;lt;/span&amp;gt;. This can be anything you please, but it &#039;&#039;&#039;must&#039;&#039;&#039; be unique in the cluster. Personally, I like the format &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm####_desc&amp;lt;/span&amp;gt;, where &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;####&amp;lt;/span&amp;gt; is a sequence number to ensure uniqueness and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;desc&amp;lt;/span&amp;gt; is a human-readable, short description of the VM. Please use whatever naming convention you find comfortable.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--ram 1024&amp;lt;/span&amp;gt;; This is the number of [[MiB]] to allocate to the VM. This can be adjusted post-install.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--arch x86_64&amp;lt;/span&amp;gt;; This tells &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-install&amp;lt;/span&amp;gt; to emulate a 64[[bit]] CPU/environment.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;-- vcpus 1&amp;lt;/span&amp;gt;; This controls how many CPU cores to allocate to this VM. This can not exceed the real number of CPUs, and should be &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;n-1&amp;lt;/span&amp;gt; at most, to ensure that [[dom0]] gets sole access to core 0. This can be adjusted post-install.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--cpuset 1&amp;lt;/span&amp;gt;; This tells &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;libvirt&amp;lt;/span&amp;gt; which cores it is allowed to use for this VM. This node has four cores, with CPU &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;0&amp;lt;/span&amp;gt; being pinned to [[dom0]]. So we will tell Xen to let this node use any free CPU between &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;1-3&amp;lt;/span&amp;gt; (the second, third and fourth cores). This can be a comma-separated list of value, and values can use hyphens for ranges. For example, if you have eight cores, you may specify &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--cpuset 1-7&amp;lt;/span&amp;gt; or &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--cpuset 1,3,5-7&amp;lt;/span&amp;gt;.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--location http://192.168.1.254/c5/x86_64/img&amp;lt;/span&amp;gt;; This tells the OS&#039; installer to look for installation files under the passed URL. The installation files could be local to the node (ie: with a loop-back mounted ISO), on an [[NFS]] share or over [[FTP]]. This option can be replaced with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--pxe&amp;lt;/span&amp;gt; for [[PXE]] server installs, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--import&amp;lt;/span&amp;gt; for skipping an installation and directly importing a VM image or &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--livecd&amp;lt;/span&amp;gt; for running up a live CD/DVD.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--extra-args &amp;quot;ks=http://192.168.1.254/c5/x86_64/ks/generic_c5.ks&amp;quot;&amp;lt;/span&amp;gt;; This allows us to pass special arguments to the installer&#039;s kernel. In this case, we&#039;re telling the installer to use the [[kickstart]] file at the given location. Optionally, we could have used &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--extra-args &amp;quot;ks=http://192.168.1.254/c5/x86_64/ks/generic_c5.ks ksdevice=eth0&amp;quot;&amp;lt;/span&amp;gt; to specify which interface to use when looking for the defined kickstart file. I generally avoid this as it is rather difficult to predict with physical interface will get what &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ethX&amp;lt;/span&amp;gt; name.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--os-type linux&amp;lt;/span&amp;gt;; This controls some internal optimization within Xen for handling Linux operating systems.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--os-variant rhel5.4&amp;lt;/span&amp;gt;; This further optimizes Xen for use with [[EL5]].4 (and newer) based operating systems. When this option is used, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--os-type&amp;lt;/span&amp;gt; is not strictly needed. The various supported &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--os-type&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--os-variant&amp;lt;/span&amp;gt; are found in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;man virt-install&amp;lt;/span&amp;gt;.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--disk path=/dev/drbd_an4_vg0/vm0001_1&amp;lt;/span&amp;gt;; This tells the installer to allocate the [[LV]] we just created as this VM&#039;s hard drive. There are &#039;&#039;many&#039;&#039; options for using storage for VMs, please see &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;man virt-install&amp;lt;/span&amp;gt;.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--network bridge=xenbr0&amp;lt;/span&amp;gt;; This, and the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xenbr2&amp;lt;/span&amp;gt; following it, tells &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-install&amp;lt;/span&amp;gt; to connect this VM to those two bridges. Note that inside the VM, these will show up as &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;eth1&amp;lt;/span&amp;gt;.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--vnc&amp;lt;/span&amp;gt;; This tells the VM to setup and export a VNC server. This is how we will connect to and monitor the installation of the VM.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--paravirt&amp;lt;/span&amp;gt;; This tells &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-install&amp;lt;/span&amp;gt; that we will be creating a [[paravirtual]] VM. The other option is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--hvm&amp;lt;/span&amp;gt; which specifies full virtualization.&lt;br /&gt;
&lt;br /&gt;
If things went well, you should now see you VM begin to install!&lt;br /&gt;
&lt;br /&gt;
[[Image:xen_vm0001_ws1_install_01.png|thumb|700px|center|Installation of a kickstart-based text install of CentOS 5.6 as a Xen VM.]]&lt;br /&gt;
&lt;br /&gt;
Once your VM is installed, we&#039;ll want to dump it&#039;s configuration to an [[XML]] file. This way, should the VM be accidentally undefined, we can easily redefine it. In fact, we have to define this VM on the second node to enable migration, but we&#039;ll go into details about migration later. For now though, run the following &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virsh&amp;lt;/span&amp;gt; command to write the VM&#039;s definition information to an XML file on the shared GFS2 partition. Putting it there will make is accessible to both nodes.&lt;br /&gt;
&lt;br /&gt;
{{warning|1=Do &#039;&#039;&#039;not&#039;&#039;&#039; bother dumping the configuration to an XML file until &#039;&#039;after&#039;&#039; the OS is fully installed and has rebooted. The configuration will contain arguments specific to the installation that will cause problem if used after the install is completed.}}&lt;br /&gt;
&lt;br /&gt;
Personally, I like to keep the configuration files in a subdirectory on the GFS2 share, then copy them to the local node&#039;s storage, just to be safe. Given that this is our first VM, we&#039;ll create a directory for the definition files now called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;definitions&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt;&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
mkdir /xen_shared/definitions&lt;br /&gt;
virsh dumpxml vm0001_ws1 &amp;gt; /xen_shared/definitions/vm0001_ws1.xml&lt;br /&gt;
cat /xen_shared/definitions/vm0001_ws1.xml&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;domain type=&#039;xen&#039;&amp;gt;&lt;br /&gt;
  &amp;lt;name&amp;gt;vm0001_ws1&amp;lt;/name&amp;gt;&lt;br /&gt;
  &amp;lt;uuid&amp;gt;d01c03da-8054-6590-37fd-5410c6b1a953&amp;lt;/uuid&amp;gt;&lt;br /&gt;
  &amp;lt;memory&amp;gt;1073152&amp;lt;/memory&amp;gt;&lt;br /&gt;
  &amp;lt;currentMemory&amp;gt;1073152&amp;lt;/currentMemory&amp;gt;&lt;br /&gt;
  &amp;lt;vcpu cpuset=&#039;1-3&#039;&amp;gt;1&amp;lt;/vcpu&amp;gt;&lt;br /&gt;
  &amp;lt;bootloader&amp;gt;/usr/bin/pygrub&amp;lt;/bootloader&amp;gt;&lt;br /&gt;
  &amp;lt;os&amp;gt;&lt;br /&gt;
    &amp;lt;type arch=&#039;x86_64&#039; machine=&#039;xenpv&#039;&amp;gt;linux&amp;lt;/type&amp;gt;&lt;br /&gt;
  &amp;lt;/os&amp;gt;&lt;br /&gt;
  &amp;lt;clock offset=&#039;utc&#039;/&amp;gt;&lt;br /&gt;
  &amp;lt;on_poweroff&amp;gt;destroy&amp;lt;/on_poweroff&amp;gt;&lt;br /&gt;
  &amp;lt;on_reboot&amp;gt;restart&amp;lt;/on_reboot&amp;gt;&lt;br /&gt;
  &amp;lt;on_crash&amp;gt;restart&amp;lt;/on_crash&amp;gt;&lt;br /&gt;
  &amp;lt;devices&amp;gt;&lt;br /&gt;
    &amp;lt;disk type=&#039;block&#039; device=&#039;disk&#039;&amp;gt;&lt;br /&gt;
      &amp;lt;driver name=&#039;phy&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;source dev=&#039;/dev/drbd_an4_vg0/vm0001_1&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;target dev=&#039;xvda&#039; bus=&#039;xen&#039;/&amp;gt;&lt;br /&gt;
    &amp;lt;/disk&amp;gt;&lt;br /&gt;
    &amp;lt;interface type=&#039;bridge&#039;&amp;gt;&lt;br /&gt;
      &amp;lt;mac address=&#039;00:16:36:05:6b:8c&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;source bridge=&#039;xenbr0&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;script path=&#039;vif-bridge&#039;/&amp;gt;&lt;br /&gt;
    &amp;lt;/interface&amp;gt;&lt;br /&gt;
    &amp;lt;console type=&#039;pty&#039;&amp;gt;&lt;br /&gt;
      &amp;lt;target port=&#039;0&#039;/&amp;gt;&lt;br /&gt;
    &amp;lt;/console&amp;gt;&lt;br /&gt;
    &amp;lt;input type=&#039;mouse&#039; bus=&#039;xen&#039;/&amp;gt;&lt;br /&gt;
    &amp;lt;graphics type=&#039;vnc&#039; port=&#039;-1&#039; autoport=&#039;yes&#039; keymap=&#039;en-us&#039;/&amp;gt;&lt;br /&gt;
  &amp;lt;/devices&amp;gt;&lt;br /&gt;
&amp;lt;/domain&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On Both Nodes&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
rsync -av /xen_shared/definitions ~/&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
definitions/&lt;br /&gt;
definitions/vm0001_ws1.xml&lt;br /&gt;
&lt;br /&gt;
sent 1085 bytes  received 48 bytes  755.33 bytes/sec&lt;br /&gt;
total size is 953  speedup is 0.84&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The benefit of having backups on the local storage is to protect these rarely changing but critical files in case anything ever corrupted the shared storage. We&#039;ve gone to great lengths to avoid this, but it&#039;s always possible and this is a simple precaution.&lt;br /&gt;
&lt;br /&gt;
==== Reconnecting to the VM ====&lt;br /&gt;
&lt;br /&gt;
After the install finishes, or after you close the initial minimal VNC viewer, you will need to manually reconnect to the VM. This is where &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-manager&amp;lt;/span&amp;gt; comes in so handy! &lt;br /&gt;
&lt;br /&gt;
Start it back up and double-click on the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt; host. You will now see the new &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0001_fw1&amp;lt;/span&amp;gt; VM. Double-click on it and you will be right back on the VM.&lt;br /&gt;
&lt;br /&gt;
[[Image:virt-manager_fedora-14_03.png|thumb|700px|center|A view of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-manager&amp;lt;/span&amp;gt; used to connect to the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0001_ws1&amp;lt;/span&amp;gt; VM.]]&lt;br /&gt;
&lt;br /&gt;
Pretty cool, eh!&lt;br /&gt;
&lt;br /&gt;
==== How to Stop, Define and Start the VM ====&lt;br /&gt;
&lt;br /&gt;
To stop the VM, you can connect to it as a remote server and shut it down as you would a normal VM.&lt;br /&gt;
&lt;br /&gt;
If you want to initial a clean shut down from the host node, you can use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virsh&amp;lt;/span&amp;gt; to initial a shutdown over [[ACPI]], same as if you tapped the power button on a physical server.&lt;br /&gt;
&lt;br /&gt;
Make sure the VM is on the node:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
virsh list --all&lt;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 Name                 State&lt;br /&gt;
----------------------------------&lt;br /&gt;
  0 Domain-0             running&lt;br /&gt;
  2 vm0001_ws1           idle&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell it to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;shutdown&amp;lt;/span&amp;gt;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
virsh shutdown vm0001_ws1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Domain vm0001_ws1 is being shutdown&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you had a VNC session running, you will see the VM start to gracefully shutdown.&lt;br /&gt;
&lt;br /&gt;
[[Image:xen3_vm_graceful_shutdown_1.png|thumb|center|700px|Gracefully shutting down the firewall VM via &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virsh shutdown vm0001_ws1&amp;lt;/span&amp;gt;.]]&lt;br /&gt;
&lt;br /&gt;
After a few moments, the VM should shut down. You can confirm this by again running &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virsh list --all&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;
virsh list --all&lt;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 Name                 State&lt;br /&gt;
----------------------------------&lt;br /&gt;
  0 Domain-0             running&lt;br /&gt;
  - vm0001_ws1           shut off&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Remember how we dumped this VM&#039;s configuration to an XML file on the GFS2 partition earlier? We&#039;re now going to use that to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;define&amp;lt;/span&amp;gt; the VM on the other node, then we&#039;ll start it up over there, too.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt;&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
Check that the VM isn&#039;t known by &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&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;
virsh list --all&lt;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 Name                 State&lt;br /&gt;
----------------------------------&lt;br /&gt;
  0 Domain-0             running&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It&#039;s not there, as expect. So now we&#039;ll use the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/xen_shared/definitions/vm0001_ws1.xml&amp;lt;/span&amp;gt; file we created.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
virsh define /xen_shared/definitions/vm0001_ws1.xml &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Domain vm0001_ws1 defined from /xen_shared/definitions/vm0001_ws1.xml&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now confirm that it&#039;s there.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
virsh list --all&lt;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 Name                 State&lt;br /&gt;
----------------------------------&lt;br /&gt;
  0 Domain-0             running&lt;br /&gt;
  - vm0001_ws1           shut off&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can now see &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0001_ws1&amp;lt;/span&amp;gt; on both nodes. Of course, &#039;&#039;&#039;&#039;&#039;never&#039;&#039;&#039;&#039;&#039;, &#039;&#039;&#039;&#039;&#039;ever&#039;&#039;&#039;&#039;&#039; try to start the VM on both nodes at the same time. In the previous step, we shut down &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0001_ws1&amp;lt;/span&amp;gt;, but it&#039;s safest to make sure that it&#039;s still off.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt;&#039;&#039;&#039;:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
virsh list --all&lt;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 Name                 State&lt;br /&gt;
----------------------------------&lt;br /&gt;
  0 Domain-0             running&lt;br /&gt;
  - vm0001_ws1           shut off&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So we now have &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0001_ws1&amp;lt;/span&amp;gt; shut off and it is defined on both &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt;. We can now start it on either node. Let&#039;s now start it up on the second node, just for fun.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt;&#039;&#039;&#039;:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
virsh start vm0001_ws1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Domain vm0001_ws1 started&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you look at &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-manager&amp;lt;/span&amp;gt;, you will now see &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0001_ws1&amp;lt;/span&amp;gt; up and running on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt; and shut off on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[Image:xen3_vm_running_on_second_node_1.png|thumb|center|700px|View of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0001_ws1&amp;lt;/span&amp;gt; running on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt;.]]&lt;br /&gt;
&lt;br /&gt;
There we go. We&#039;ve now seen how to stop, define and start the VM using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virsh&amp;lt;/span&amp;gt;. Nothing too fancy!&lt;br /&gt;
&lt;br /&gt;
==== Testing VM Migration ====&lt;br /&gt;
&lt;br /&gt;
One of the biggest benefits of virtual servers in clusters is that they can be migrated between nodes without needing to shut down the VM. This is useful for planned maintenance on nodes, as you can push off all of it&#039;s VMs, take it out of the cluster and do your maintenance and your VM users will see minimal or no interruption in service. &lt;br /&gt;
&lt;br /&gt;
There are two types of migration;&lt;br /&gt;
* &#039;&#039;&#039;Cold Migration&#039;&#039;&#039;; The VM is frozen, it&#039;s RAM is copied to the other node and then it is thawed on the new host. This is the fastest method of migrating, but the users will see a period where they can not interact with the VM.&lt;br /&gt;
* &#039;&#039;&#039;Live Migration&#039;&#039;&#039;; The VM continues to run during the migration. Performance will degrade a bit and the migration process will take longer to complete, but users should not see any interruption in service.&lt;br /&gt;
&lt;br /&gt;
To manually migrate the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0001_ws1&amp;lt;/span&amp;gt; VM &#039;&#039;from&#039;&#039; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt; back to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt;, run the following command. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt;&#039;&#039;&#039; (there will be no output):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
virsh migrate --live vm0001_ws1 xen+ssh://root@an-node04&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you flip over to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-manager&amp;lt;/span&amp;gt;, you will see that the node shows as &#039;&#039;Running&#039;&#039; on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt; on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt; and &#039;&#039;Shutoff&#039;&#039; on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt; right away, but there will still be CPU activity on both. This is the live migration process running. In the screen shot below, I opened a standard terminal and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ssh&amp;lt;/span&amp;gt;&#039;ed into &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0001_ws1&amp;lt;/span&amp;gt; and started a ping flood to Google &#039;&#039;&#039;before&#039;&#039;&#039; starting the live migration. Notice how the migration completed and no packets were dropped?&lt;br /&gt;
&lt;br /&gt;
[[Image:xen3_vm_live_migrating_1.png|thumb|center|700px|View of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0001_ws1&amp;lt;/span&amp;gt; being live migrated to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt; from &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt; with a ping-flood running via an &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ssh&amp;lt;/span&amp;gt; session.]]&lt;br /&gt;
&lt;br /&gt;
This should tickle your geek glands.&lt;br /&gt;
&lt;br /&gt;
==== How to &amp;quot;Pull the Power&amp;quot; on a VM ====&lt;br /&gt;
&lt;br /&gt;
If something happens to the VM and you can&#039;t shut it down, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virsh&amp;lt;/span&amp;gt; provides a command that is the equivalent of pulling the power on a physical server. This command forces the virtual server off without giving the VM a chance to react at all. For obvious reasons, you will want to be somewhat careful in using this as it has all the same potential for problems as killing the power of a real server.&lt;br /&gt;
&lt;br /&gt;
So to &amp;quot;pull the plug&amp;quot;, you can run this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
virsh destroy vm0001_ws1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Domain vm0001_ws1 destroyed&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The VM is still defined, but it&#039;s no longer running.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
virsh list --all&lt;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 Name                 State&lt;br /&gt;
----------------------------------&lt;br /&gt;
  0 Domain-0             running&lt;br /&gt;
  - vm0001_ws1           shut off&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== How to Delete a VM and Start Over ====&lt;br /&gt;
&lt;br /&gt;
{{note|1=It is &#039;&#039;very&#039;&#039; likely that you will run into problems when you first start trying to provision your VM. If you want to delete the VM and start over, the way to do it is with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virsh&amp;lt;/span&amp;gt;, the virtual shell.}}&lt;br /&gt;
&lt;br /&gt;
Check that it&#039;s there.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
virsh list --all&lt;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 Name                 State&lt;br /&gt;
----------------------------------&lt;br /&gt;
  0 Domain-0             running&lt;br /&gt;
  - vm0001_ws1           shut off&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Undefine&amp;quot; it, which deletes it from Xen.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
virsh undefine vm0001_ws1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Domain vm0001_ws1 has been undefined&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Confirm that it is gone.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
virsh list --all&lt;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 Name                 State&lt;br /&gt;
----------------------------------&lt;br /&gt;
  0 Domain-0             running&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now you can try again.&lt;br /&gt;
&lt;br /&gt;
=== Hardware Virtual Machine ===&lt;br /&gt;
&lt;br /&gt;
Most modern processors come with support for &amp;quot;hardware assisted virtualization&amp;quot;, which Xen calls &amp;quot;Hardware Virtual Machine&amp;quot; or &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;hvm&amp;lt;/span&amp;gt; or &amp;quot;Secure Virtual Machine&amp;quot; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;svm&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
HVM requires special support in the CPU in order for it to be used in Xen. Intel processors implement this under the name VT-x and AMD implements this under the name AMD-V. Some motherboards will disable this feature by default, requiring the user to edit the BIOS of their mainboard. &lt;br /&gt;
&lt;br /&gt;
If you try to provision an &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;hvm&amp;lt;/span&amp;gt; and receive an error about it not being supported by the host, consult your system board documentation for information on enabling hardware virtualization.&lt;br /&gt;
&lt;br /&gt;
To check if you have &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;hvm&amp;lt;/span&amp;gt; enabled, run &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xm info&amp;lt;/span&amp;gt; and check the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xen_caps&amp;lt;/span&amp;gt; line for entries starting with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;hvm&amp;lt;/span&amp;gt;. If you do not see any &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;hvm&amp;lt;/span&amp;gt; entries, then it is likely not enabled.&lt;br /&gt;
&lt;br /&gt;
{{note|1=The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xm info&amp;lt;/span&amp;gt; only works when running a Xen kernel. With a vanilla kernel, consult &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/proc/cpuinfo&amp;lt;/span&amp;gt;.}}&lt;br /&gt;
&lt;br /&gt;
Below is the output of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xm info&amp;lt;/span&amp;gt; with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;hvm&amp;lt;/span&amp;gt; &#039;&#039;enabled&#039;&#039; in the host BIOS.&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.18-238.9.1.el5xen&lt;br /&gt;
version                : #1 SMP Tue Apr 12 18:53:56 EDT 2011&lt;br /&gt;
machine                : x86_64&lt;br /&gt;
nr_cpus                : 4&lt;br /&gt;
nr_nodes               : 1&lt;br /&gt;
sockets_per_node       : 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                : 178bfbff:efd3fbff:00000000:00000110:00802009:00000000:000037ff&lt;br /&gt;
total_memory           : 4062&lt;br /&gt;
free_memory            : 1048&lt;br /&gt;
node_to_cpu            : node0:0-3&lt;br /&gt;
xen_major              : 3&lt;br /&gt;
xen_minor              : 1&lt;br /&gt;
xen_extra              : .2-238.9.1.el5&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_pagesize           : 4096&lt;br /&gt;
platform_params        : virt_start=0xffff800000000000&lt;br /&gt;
xen_changeset          : unavailable&lt;br /&gt;
cc_compiler            : gcc version 4.1.2 20080704 (Red Hat 4.1.2-50)&lt;br /&gt;
cc_compile_by          : mockbuild&lt;br /&gt;
cc_compile_domain      : centos.org&lt;br /&gt;
cc_compile_date        : Tue Apr 12 18:01:03 EDT 2011&lt;br /&gt;
xend_config_format     : 2&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;hvm&amp;lt;/span&amp;gt; &#039;&#039;disabled&#039;&#039; in the BIOS. Note the missing &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;hvm&amp;lt;/span&amp;gt; entries on the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xen_caps&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;
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-node05.alteeve.com&lt;br /&gt;
release                : 2.6.18-238.9.1.el5xen&lt;br /&gt;
version                : #1 SMP Tue Apr 12 18:53:56 EDT 2011&lt;br /&gt;
machine                : x86_64&lt;br /&gt;
nr_cpus                : 4&lt;br /&gt;
nr_nodes               : 1&lt;br /&gt;
sockets_per_node       : 1&lt;br /&gt;
cores_per_socket       : 4&lt;br /&gt;
threads_per_core       : 1&lt;br /&gt;
cpu_mhz                : 2200&lt;br /&gt;
hw_caps                : 178bfbff:efd3fbff:00000000:00000110:00802009:00000000:000037ff&lt;br /&gt;
total_memory           : 3838&lt;br /&gt;
free_memory            : 383&lt;br /&gt;
node_to_cpu            : node0:0-3&lt;br /&gt;
xen_major              : 3&lt;br /&gt;
xen_minor              : 1&lt;br /&gt;
xen_extra              : .2-238.9.1.el5&lt;br /&gt;
xen_caps               : xen-3.0-x86_64 xen-3.0-x86_32p &lt;br /&gt;
xen_pagesize           : 4096&lt;br /&gt;
platform_params        : virt_start=0xffff800000000000&lt;br /&gt;
xen_changeset          : unavailable&lt;br /&gt;
cc_compiler            : gcc version 4.1.2 20080704 (Red Hat 4.1.2-50)&lt;br /&gt;
cc_compile_by          : mockbuild&lt;br /&gt;
cc_compile_domain      : centos.org&lt;br /&gt;
cc_compile_date        : Tue Apr 12 18:01:03 EDT 2011&lt;br /&gt;
xend_config_format     : 2&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you try to provision an &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;hvm&amp;lt;/span&amp;gt; machine with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;hvm&amp;lt;/span&amp;gt; disabled, you will see the error below.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
virt-install --connect xen ... --hvm&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
ERROR    Host does not support virtualization type &#039;hvm&#039; for arch &#039;x86_64&#039;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{note|1=When installing from an [[ISO]], you must use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;hvm&amp;lt;/span&amp;gt; or full virtualization.}}&lt;br /&gt;
&lt;br /&gt;
=== Provisioning vm0002_win1; A Windows Server ===&lt;br /&gt;
&lt;br /&gt;
We&#039;re going to provision a [[Microsoft]] Windows 2008 server this time. This will largely be the same process as with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0001_ws1&amp;lt;/span&amp;gt;. The main differences is that we&#039;ll be installing from an [[ISO]] file which was copied into &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/xen_shared/iso/Win_Server_2008_Bis_x86_64.iso&amp;lt;/span&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
Microsoft Windows is commercial software. You will need a proper license to use it in production, but you can [http://www.microsoft.com/windowsserver2008/en/us/trial-software.aspx download a trial] version, which will be sufficient to follow along with this tutorial. &lt;br /&gt;
&lt;br /&gt;
{{note|1=You may find it useful to create an &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/xen_shared/iso&amp;lt;/span&amp;gt; folder to store ISO files in.}}&lt;br /&gt;
&lt;br /&gt;
We won&#039;t go over all the details again, but we will show all the specific commands.&lt;br /&gt;
&lt;br /&gt;
First, create the [[LV]] for this new VM.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
lvcreate -l 100%FREE -n vm0002_1 --addtag @an-cluster01 /dev/drbd_an5_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;vm0002_1&amp;quot; created&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we need to craft the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-install&amp;lt;/span&amp;gt; provision command. Some key differences are that we&#039;re going to create a &amp;quot;hardware virtualized machine&amp;quot;, known as &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;hvm&amp;lt;/span&amp;gt;, which requires support in the CPU. We&#039;ll also directly boot off of a DVD [[ISO]], as if we had put a DVD in a drive and booted from it on a real server. We also need to change the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--os-type&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--os-variant&amp;lt;/span&amp;gt; values to windows as well.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&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;
virt-install --connect xen \&lt;br /&gt;
        --name vm0002_win1 \&lt;br /&gt;
        --ram 1048 \&lt;br /&gt;
        --arch x86_64 \&lt;br /&gt;
        --vcpus 1 \&lt;br /&gt;
        --cpuset 1-3 \&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_an5_vg0/vm0002_1 \&lt;br /&gt;
        --network bridge=xenbr0 \&lt;br /&gt;
        --vnc \&lt;br /&gt;
        --hvm&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Image:Installing_Win2008_VM_01.png|thumb|700px|center|Starting the install of Windows 2008 R2 as a virtual machine]]&lt;br /&gt;
&lt;br /&gt;
I like to close the default VNC session and flip over to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-manager&amp;lt;/span&amp;gt;. This is what you should see if you do the same.&lt;br /&gt;
&lt;br /&gt;
[[Image:Installing_Win2008_VM_via_virt-manager_02.png|thumb|700px|center|Monitoring the install of Windows 2008 R2 via &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-manager&amp;lt;/span&amp;gt;.]]&lt;br /&gt;
&lt;br /&gt;
As before, let the install finish before proceeding. Once the install is completed and you&#039;ve booted for the first time, dump the configuration to an XML file, define it on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt; and update the backups on either node&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/root/&amp;lt;/span&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
Dump the XML definition.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
virsh dumpxml vm0002_win1 &amp;gt; /xen_shared/definitions/vm0002_win1.xml&lt;br /&gt;
ls -lah /xen_shared/definitions/vm0002_win1.xml&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
-rw-r--r-- 1 root root 1.5K May 14 23:27 /xen_shared/definitions/vm0002_win1.xml&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Define the VM on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&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;
virsh define /xen_shared/definitions/vm0002_win1.xml &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Domain vm0002_win1 defined from /xen_shared/definitions/vm0002_win1.xml&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Backup the new VM definition on each node.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
rsync -av /xen_shared/definitions ~/&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
building file list ... done&lt;br /&gt;
definitions/&lt;br /&gt;
definitions/vm0002_win1.xml&lt;br /&gt;
&lt;br /&gt;
sent 1646 bytes  received 48 bytes  3388.00 bytes/sec&lt;br /&gt;
total size is 2446  speedup is 1.44&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Image:Installing_Win2008_VM_via_virt-manager_03.png|thumb|700px|center|Seeing the Windows 2008 R2 on both nodes via &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-manager&amp;lt;/span&amp;gt;.]]&lt;br /&gt;
&lt;br /&gt;
Now we see both VMs defined on both nodes!&lt;br /&gt;
&lt;br /&gt;
= Making Our VMs Highly Available Cluster Services =&lt;br /&gt;
&lt;br /&gt;
We&#039;re ready to start the final step; Making our VMs highly available via cluster management! This involves two major steps:&lt;br /&gt;
* Creating two new, ordered failover Domains; One with each node as the highest priority.&lt;br /&gt;
* Adding our VMs as services, one is each new failover domain.&lt;br /&gt;
&lt;br /&gt;
== Creating the Ordered Failover Domains ==&lt;br /&gt;
&lt;br /&gt;
The idea here is that each new failover domain will have one node with a higher priority than the other. That is, one will have &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt; with the highest priority and the other will have &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt; as the highest. This way, VMs that we want to normally run on a given node will be added to the matching failover domain.&lt;br /&gt;
&lt;br /&gt;
To add the two new failover domains, we&#039;ll add the following to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/cluster/cluster.conf&amp;lt;/span&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
              &amp;lt;failoverdomains&amp;gt;&lt;br /&gt;
                        ...&lt;br /&gt;
                        &amp;lt;failoverdomain name=&amp;quot;an4_primary&amp;quot; nofailback=&amp;quot;0&amp;quot; ordered=&amp;quot;1&amp;quot; restricted=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
                                &amp;lt;failoverdomainnode name=&amp;quot;an-node04.alteeve.com&amp;quot; priority=&amp;quot;1&amp;quot;/&amp;gt;&lt;br /&gt;
                                &amp;lt;failoverdomainnode name=&amp;quot;an-node05.alteeve.com&amp;quot; priority=&amp;quot;2&amp;quot;/&amp;gt;&lt;br /&gt;
                        &amp;lt;/failoverdomain&amp;gt;&lt;br /&gt;
                        &amp;lt;failoverdomain name=&amp;quot;an5_primary&amp;quot; nofailback=&amp;quot;0&amp;quot; ordered=&amp;quot;1&amp;quot; restricted=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
                                &amp;lt;failoverdomainnode name=&amp;quot;an-node04.alteeve.com&amp;quot; priority=&amp;quot;2&amp;quot;/&amp;gt;&lt;br /&gt;
                                &amp;lt;failoverdomainnode name=&amp;quot;an-node05.alteeve.com&amp;quot; priority=&amp;quot;1&amp;quot;/&amp;gt;&lt;br /&gt;
                        &amp;lt;/failoverdomain&amp;gt;&lt;br /&gt;
              &amp;lt;/failoverdomains&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As always, validate it. We&#039;ll see here what the complete file now looks like. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
xmllint --relaxng /usr/share/system-config-cluster/misc/cluster.ng /etc/cluster/cluster.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&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-cluster01&amp;quot; config_version=&amp;quot;14&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;cman expected_votes=&amp;quot;1&amp;quot; two_node=&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-node04.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;fence_na01&amp;quot; port=&amp;quot;04&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-node05.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;fence_na01&amp;quot; port=&amp;quot;03&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 agent=&amp;quot;fence_na&amp;quot; ipaddr=&amp;quot;fence_na01.alteeve.com&amp;quot; login=&amp;quot;admin&amp;quot; name=&amp;quot;fence_na01&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;fence_daemon post_join_delay=&amp;quot;60&amp;quot;/&amp;gt;&lt;br /&gt;
        &amp;lt;totem rrp_mode=&amp;quot;none&amp;quot; secauth=&amp;quot;off&amp;quot;/&amp;gt;&lt;br /&gt;
        &amp;lt;rm&amp;gt;&lt;br /&gt;
                &amp;lt;resources&amp;gt;&lt;br /&gt;
                        &amp;lt;script file=&amp;quot;/etc/init.d/drbd&amp;quot; name=&amp;quot;drbd&amp;quot;/&amp;gt;&lt;br /&gt;
                        &amp;lt;script file=&amp;quot;/etc/init.d/clvmd&amp;quot; name=&amp;quot;clvmd&amp;quot;/&amp;gt;&lt;br /&gt;
                        &amp;lt;script file=&amp;quot;/etc/init.d/gfs2&amp;quot; name=&amp;quot;gfs2&amp;quot;/&amp;gt;&lt;br /&gt;
                &amp;lt;/resources&amp;gt;&lt;br /&gt;
		&amp;lt;failoverdomains&amp;gt;&lt;br /&gt;
			&amp;lt;failoverdomain name=&amp;quot;an4_only&amp;quot; nofailback=&amp;quot;0&amp;quot; ordered=&amp;quot;0&amp;quot; restricted=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
				&amp;lt;failoverdomainnode name=&amp;quot;an-node04.alteeve.com&amp;quot; priority=&amp;quot;1&amp;quot;/&amp;gt;&lt;br /&gt;
			&amp;lt;/failoverdomain&amp;gt;&lt;br /&gt;
			&amp;lt;failoverdomain name=&amp;quot;an5_only&amp;quot; nofailback=&amp;quot;0&amp;quot; ordered=&amp;quot;0&amp;quot; restricted=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
				&amp;lt;failoverdomainnode name=&amp;quot;an-node05.alteeve.com&amp;quot; priority=&amp;quot;1&amp;quot;/&amp;gt;&lt;br /&gt;
			&amp;lt;/failoverdomain&amp;gt;&lt;br /&gt;
			&amp;lt;failoverdomain name=&amp;quot;an4_primary&amp;quot; nofailback=&amp;quot;0&amp;quot; ordered=&amp;quot;1&amp;quot; restricted=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
				&amp;lt;failoverdomainnode name=&amp;quot;an-node04.alteeve.com&amp;quot; priority=&amp;quot;1&amp;quot;/&amp;gt;&lt;br /&gt;
				&amp;lt;failoverdomainnode name=&amp;quot;an-node05.alteeve.com&amp;quot; priority=&amp;quot;2&amp;quot;/&amp;gt;&lt;br /&gt;
			&amp;lt;/failoverdomain&amp;gt;&lt;br /&gt;
			&amp;lt;failoverdomain name=&amp;quot;an5_primary&amp;quot; nofailback=&amp;quot;0&amp;quot; ordered=&amp;quot;1&amp;quot; restricted=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
				&amp;lt;failoverdomainnode name=&amp;quot;an-node04.alteeve.com&amp;quot; priority=&amp;quot;2&amp;quot;/&amp;gt;&lt;br /&gt;
				&amp;lt;failoverdomainnode name=&amp;quot;an-node05.alteeve.com&amp;quot; priority=&amp;quot;1&amp;quot;/&amp;gt;&lt;br /&gt;
			&amp;lt;/failoverdomain&amp;gt;&lt;br /&gt;
		&amp;lt;/failoverdomains&amp;gt;&lt;br /&gt;
		&amp;lt;service autostart=&amp;quot;0&amp;quot; domain=&amp;quot;an4_only&amp;quot; exclusive=&amp;quot;0&amp;quot; max_restarts=&amp;quot;0&amp;quot; name=&amp;quot;an4_storage&amp;quot; recovery=&amp;quot;restart&amp;quot; restart_expire_time=&amp;quot;0&amp;quot;&amp;gt;&lt;br /&gt;
			&amp;lt;script ref=&amp;quot;drbd&amp;quot;&amp;gt;&lt;br /&gt;
				&amp;lt;script ref=&amp;quot;clvmd&amp;quot;&amp;gt;&lt;br /&gt;
					&amp;lt;script ref=&amp;quot;gfs2&amp;quot;/&amp;gt;&lt;br /&gt;
				&amp;lt;/script&amp;gt;&lt;br /&gt;
			&amp;lt;/script&amp;gt;&lt;br /&gt;
		&amp;lt;/service&amp;gt;&lt;br /&gt;
		&amp;lt;service autostart=&amp;quot;0&amp;quot; domain=&amp;quot;an5_only&amp;quot; exclusive=&amp;quot;0&amp;quot; max_restarts=&amp;quot;0&amp;quot; name=&amp;quot;an5_storage&amp;quot; recovery=&amp;quot;restart&amp;quot; restart_expire_time=&amp;quot;0&amp;quot;&amp;gt;&lt;br /&gt;
			&amp;lt;script ref=&amp;quot;drbd&amp;quot;&amp;gt;&lt;br /&gt;
				&amp;lt;script ref=&amp;quot;clvmd&amp;quot;&amp;gt;&lt;br /&gt;
					&amp;lt;script ref=&amp;quot;gfs2&amp;quot;/&amp;gt;&lt;br /&gt;
				&amp;lt;/script&amp;gt;&lt;br /&gt;
			&amp;lt;/script&amp;gt;&lt;br /&gt;
		&amp;lt;/service&amp;gt;&lt;br /&gt;
        &amp;lt;/rm&amp;gt;&lt;br /&gt;
&amp;lt;/cluster&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;
/etc/cluster/cluster.conf validates&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With it validating, push it to the other node.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ccs_tool update /etc/cluster/cluster.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;
Config file updated from version 13 to 14&lt;br /&gt;
&lt;br /&gt;
Update complete.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Adding The VMs To rgmanager ==&lt;br /&gt;
&lt;br /&gt;
This is where we tell &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; which VMs we want to run on which nodes when both are online.&lt;br /&gt;
&lt;br /&gt;
{{note|1=There is a bit of a trick when using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; with our cluster. There is no real way to delay the start of virtual machines until after the storage services are online. The side effect of this is that, if the VMs are set to automatically start with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt;, the VMs will fail because their underlying storage takes too long to come online. For this reason, we will not configure them to start automatically.}}&lt;br /&gt;
&lt;br /&gt;
=== Creating the vm:&amp;lt;domu&amp;gt; Resources ===&lt;br /&gt;
&lt;br /&gt;
Virtual machine services are a special-case in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt;, and have their own &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;vm .../&amp;gt;&amp;lt;/span&amp;gt; tag. Here are the two we will be adding for the two VMs we created in the previous section.&lt;br /&gt;
&lt;br /&gt;
{{warning|1=Make sure that the VMs are shut down before adding them to the cluster! Otherwise &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; will restart them when you first enable the new &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;vm /&amp;gt;&amp;lt;/span&amp;gt; resources.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;rm&amp;gt;&lt;br /&gt;
                ...&lt;br /&gt;
                &amp;lt;vm name=&amp;quot;vm0001_ws1&amp;quot; domain=&amp;quot;an4_primary&amp;quot; path=&amp;quot;/xen_shared/definitions/&amp;quot;&lt;br /&gt;
                 autostart=&amp;quot;0&amp;quot; exclusive=&amp;quot;0&amp;quot; recovery=&amp;quot;restart&amp;quot; max_restarts=&amp;quot;2&amp;quot; restart_expire_time=&amp;quot;600&amp;quot;/&amp;gt;&lt;br /&gt;
                &amp;lt;vm name=&amp;quot;vm0002_win1&amp;quot; domain=&amp;quot;an5_primary&amp;quot; path=&amp;quot;/xen_shared/definitions/&amp;quot;&lt;br /&gt;
                 autostart=&amp;quot;0&amp;quot; exclusive=&amp;quot;0&amp;quot; recovery=&amp;quot;restart&amp;quot; max_restarts=&amp;quot;2&amp;quot; restart_expire_time=&amp;quot;600&amp;quot;/&amp;gt;&lt;br /&gt;
        &amp;lt;/rm&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The attributes are:&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;name&amp;lt;/span&amp;gt;; This is the name of the VM and must match the name of the VM shown by &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virsh list&amp;lt;/span&amp;gt; as well as the definition file name, minus the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;.xml&amp;lt;/span&amp;gt; suffix.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;domain&amp;lt;/span&amp;gt;; This is the name of the failover domain that this VM will operate within.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;path&amp;lt;/span&amp;gt;; This is the full path to where the VM definition files are kept. It &#039;&#039;&#039;is not&#039;&#039;&#039; the full path to the actual definition file itself!&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;autostart&amp;lt;/span&amp;gt;; As mentioned above, we do not want the VMs to automatically start with the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt;, so we set this to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;0&amp;lt;/span&amp;gt;.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;exclusive&amp;lt;/span&amp;gt;; When set, this will prevent &#039;&#039;&#039;any&#039;&#039;&#039; other service from running on the node. This would take out the storage services, so this &#039;&#039;&#039;must&#039;&#039;&#039; be set to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;0&amp;lt;/span&amp;gt;.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;recovery&amp;lt;/span&amp;gt;; This is how the VM should be recovered after it crashes. The options are &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;restart&amp;lt;/span&amp;gt;, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;relocate&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;disable&amp;lt;/span&amp;gt;.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;max_restarts&amp;lt;/span&amp;gt;; This is how many times the VM is allowed to be restarted (from a crash) before the VM is migrated to another node in the failover domain. The idea here is that, normally, we simply want to restart the VM in-place if the VM itself crashed and the underlying node is healthy. However, once the VM restarts this number a times, we assume that there is actually a problem with the VM running on the current node, so we want to give up and move the VM to another node. We will use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;2&amp;lt;/span&amp;gt; restarts before switching to a migration.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;restart_expire_time&amp;lt;/span&amp;gt;; Whenever a VM is restarted, a counter is incremented, which is compared against &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;max_restarts&amp;lt;/span&amp;gt;. After this many seconds, that restart is &amp;quot;forgotten&amp;quot; and the restart counter is reduced by one. With our value of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;600&amp;lt;/span&amp;gt; seconds (10 minutes) and a &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;max_restarts&amp;lt;/span&amp;gt; of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;2&amp;lt;/span&amp;gt;, the VM will be relocated instead of restarted after the third crash in ten minutes.&lt;br /&gt;
&lt;br /&gt;
Again, validate it. We&#039;ll see here what the complete file now looks like. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
xmllint --relaxng /usr/share/system-config-cluster/misc/cluster.ng /etc/cluster/cluster.conf&lt;br /&gt;
&amp;lt;/source&amp;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-cluster01&amp;quot; config_version=&amp;quot;15&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;cman expected_votes=&amp;quot;1&amp;quot; two_node=&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-node04.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;fence_na01&amp;quot; port=&amp;quot;04&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-node05.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;fence_na01&amp;quot; port=&amp;quot;03&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 agent=&amp;quot;fence_na&amp;quot; ipaddr=&amp;quot;fence_na01.alteeve.com&amp;quot; login=&amp;quot;admin&amp;quot; name=&amp;quot;fence_na01&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;fence_daemon post_join_delay=&amp;quot;60&amp;quot;/&amp;gt;&lt;br /&gt;
        &amp;lt;totem rrp_mode=&amp;quot;none&amp;quot; secauth=&amp;quot;off&amp;quot;/&amp;gt;&lt;br /&gt;
        &amp;lt;rm&amp;gt;&lt;br /&gt;
                &amp;lt;resources&amp;gt;&lt;br /&gt;
                        &amp;lt;script file=&amp;quot;/etc/init.d/drbd&amp;quot; name=&amp;quot;drbd&amp;quot;/&amp;gt;&lt;br /&gt;
                        &amp;lt;script file=&amp;quot;/etc/init.d/clvmd&amp;quot; name=&amp;quot;clvmd&amp;quot;/&amp;gt;&lt;br /&gt;
                        &amp;lt;script file=&amp;quot;/etc/init.d/gfs2&amp;quot; name=&amp;quot;gfs2&amp;quot;/&amp;gt;&lt;br /&gt;
                &amp;lt;/resources&amp;gt;&lt;br /&gt;
		&amp;lt;failoverdomains&amp;gt;&lt;br /&gt;
			&amp;lt;failoverdomain name=&amp;quot;an4_only&amp;quot; nofailback=&amp;quot;0&amp;quot; ordered=&amp;quot;0&amp;quot; restricted=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
				&amp;lt;failoverdomainnode name=&amp;quot;an-node04.alteeve.com&amp;quot; priority=&amp;quot;1&amp;quot;/&amp;gt;&lt;br /&gt;
			&amp;lt;/failoverdomain&amp;gt;&lt;br /&gt;
			&amp;lt;failoverdomain name=&amp;quot;an5_only&amp;quot; nofailback=&amp;quot;0&amp;quot; ordered=&amp;quot;0&amp;quot; restricted=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
				&amp;lt;failoverdomainnode name=&amp;quot;an-node05.alteeve.com&amp;quot; priority=&amp;quot;1&amp;quot;/&amp;gt;&lt;br /&gt;
			&amp;lt;/failoverdomain&amp;gt;&lt;br /&gt;
			&amp;lt;failoverdomain name=&amp;quot;an4_primary&amp;quot; nofailback=&amp;quot;0&amp;quot; ordered=&amp;quot;1&amp;quot; restricted=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
				&amp;lt;failoverdomainnode name=&amp;quot;an-node04.alteeve.com&amp;quot; priority=&amp;quot;1&amp;quot;/&amp;gt;&lt;br /&gt;
				&amp;lt;failoverdomainnode name=&amp;quot;an-node05.alteeve.com&amp;quot; priority=&amp;quot;2&amp;quot;/&amp;gt;&lt;br /&gt;
			&amp;lt;/failoverdomain&amp;gt;&lt;br /&gt;
			&amp;lt;failoverdomain name=&amp;quot;an5_primary&amp;quot; nofailback=&amp;quot;0&amp;quot; ordered=&amp;quot;1&amp;quot; restricted=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
				&amp;lt;failoverdomainnode name=&amp;quot;an-node04.alteeve.com&amp;quot; priority=&amp;quot;2&amp;quot;/&amp;gt;&lt;br /&gt;
				&amp;lt;failoverdomainnode name=&amp;quot;an-node05.alteeve.com&amp;quot; priority=&amp;quot;1&amp;quot;/&amp;gt;&lt;br /&gt;
			&amp;lt;/failoverdomain&amp;gt;&lt;br /&gt;
		&amp;lt;/failoverdomains&amp;gt;&lt;br /&gt;
		&amp;lt;service autostart=&amp;quot;0&amp;quot; domain=&amp;quot;an4_only&amp;quot; exclusive=&amp;quot;0&amp;quot; max_restarts=&amp;quot;0&amp;quot; name=&amp;quot;an4_storage&amp;quot; recovery=&amp;quot;restart&amp;quot; restart_expire_time=&amp;quot;0&amp;quot;&amp;gt;&lt;br /&gt;
			&amp;lt;script ref=&amp;quot;drbd&amp;quot;&amp;gt;&lt;br /&gt;
				&amp;lt;script ref=&amp;quot;clvmd&amp;quot;&amp;gt;&lt;br /&gt;
					&amp;lt;script ref=&amp;quot;gfs2&amp;quot;/&amp;gt;&lt;br /&gt;
				&amp;lt;/script&amp;gt;&lt;br /&gt;
			&amp;lt;/script&amp;gt;&lt;br /&gt;
		&amp;lt;/service&amp;gt;&lt;br /&gt;
		&amp;lt;service autostart=&amp;quot;0&amp;quot; domain=&amp;quot;an5_only&amp;quot; exclusive=&amp;quot;0&amp;quot; max_restarts=&amp;quot;0&amp;quot; name=&amp;quot;an5_storage&amp;quot; recovery=&amp;quot;restart&amp;quot; restart_expire_time=&amp;quot;0&amp;quot;&amp;gt;&lt;br /&gt;
			&amp;lt;script ref=&amp;quot;drbd&amp;quot;&amp;gt;&lt;br /&gt;
				&amp;lt;script ref=&amp;quot;clvmd&amp;quot;&amp;gt;&lt;br /&gt;
					&amp;lt;script ref=&amp;quot;gfs2&amp;quot;/&amp;gt;&lt;br /&gt;
				&amp;lt;/script&amp;gt;&lt;br /&gt;
			&amp;lt;/script&amp;gt;&lt;br /&gt;
		&amp;lt;/service&amp;gt;&lt;br /&gt;
                &amp;lt;vm name=&amp;quot;vm0001_ws1&amp;quot; domain=&amp;quot;an4_primary&amp;quot; path=&amp;quot;/xen_shared/definitions/&amp;quot; autostart=&amp;quot;0&amp;quot; exclusive=&amp;quot;0&amp;quot; recovery=&amp;quot;restart&amp;quot; max_restarts=&amp;quot;2&amp;quot; restart_expire_time=&amp;quot;600&amp;quot;/&amp;gt;&lt;br /&gt;
                &amp;lt;vm name=&amp;quot;vm0002_win1&amp;quot; domain=&amp;quot;an5_primary&amp;quot; path=&amp;quot;/xen_shared/definitions/&amp;quot; autostart=&amp;quot;0&amp;quot; exclusive=&amp;quot;0&amp;quot; recovery=&amp;quot;restart&amp;quot; max_restarts=&amp;quot;2&amp;quot; restart_expire_time=&amp;quot;600&amp;quot;/&amp;gt;&lt;br /&gt;
        &amp;lt;/rm&amp;gt;&lt;br /&gt;
&amp;lt;/cluster&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;
/etc/cluster/cluster.conf validates&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now push the updated configuration out.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ccs_tool update /etc/cluster/cluster.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;
Config file updated from version 14 to 15&lt;br /&gt;
&lt;br /&gt;
Update complete.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{note|1=You can use migration mapping to map hostnames to names resolved to other interfaces on the host by adding &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;vm ... migration_mapping=&amp;quot;an-node01.alteeve.com:an-node01.bcn,an-node02.alteeve.com:an-node02.bcn&amp;quot;&amp;lt;/span&amp;gt;. Thanks to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;thomas_s&amp;lt;/span&amp;gt; on the Freenode &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;#linux-cluster&amp;lt;/span&amp;gt; IRC channel for pointing this out.}}&lt;br /&gt;
&lt;br /&gt;
=== Using the new VM Resources ===&lt;br /&gt;
&lt;br /&gt;
{{note|1=We&#039;ll be running all of the commands in this section on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt;.}}&lt;br /&gt;
&lt;br /&gt;
If you now run &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clustat&amp;lt;/span&amp;gt; on either node, you should see the new VM resources.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
clustat &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Cluster Status for an-cluster01 @ Sun May 15 12:36:10 2011&lt;br /&gt;
Member Status: Quorate&lt;br /&gt;
&lt;br /&gt;
 Member Name                             ID   Status&lt;br /&gt;
 ------ ----                             ---- ------&lt;br /&gt;
 an-node04.alteeve.com                       1 Online, Local, rgmanager&lt;br /&gt;
 an-node05.alteeve.com                       2 Online, rgmanager&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State         &lt;br /&gt;
 ------- ----                   ----- ------                   -----         &lt;br /&gt;
 service:an4_storage            an-node04.alteeve.com          started       &lt;br /&gt;
 service:an5_storage            an-node05.alteeve.com          started       &lt;br /&gt;
 vm:vm0001_ws1                  (none)                         disabled      &lt;br /&gt;
 vm:vm0002_win1                 (none)                         disabled      &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we can start the VMs using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt;!&lt;br /&gt;
&lt;br /&gt;
{{note|1=As we&#039;ll be starting a non-standard, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm&amp;lt;/span&amp;gt; service, we need to type out the full service name, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm:domu&amp;lt;/span&amp;gt;.}}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt;&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
clusvcadm -e vm:vm0001_ws1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Local machine trying to enable vm:vm0001_ws1...Success&lt;br /&gt;
vm:vm0001_ws1 is now running on an-node04.alteeve.com&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you check with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virsh&amp;lt;/span&amp;gt;, you&#039;ll see it running now.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
virsh list --all&lt;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 Name                 State&lt;br /&gt;
----------------------------------&lt;br /&gt;
  0 Domain-0             running&lt;br /&gt;
  1 vm0001_ws1           running&lt;br /&gt;
  - vm0002_win1          shut off&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Likewise, if you check &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clustat&amp;lt;/span&amp;gt; from either node, you will see the new VM service running on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&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;
clustat &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Cluster Status for an-cluster01 @ Sun May 15 12:38:38 2011&lt;br /&gt;
Member Status: Quorate&lt;br /&gt;
&lt;br /&gt;
 Member Name                             ID   Status&lt;br /&gt;
 ------ ----                             ---- ------&lt;br /&gt;
 an-node04.alteeve.com                       1 Online, Local, rgmanager&lt;br /&gt;
 an-node05.alteeve.com                       2 Online, rgmanager&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State         &lt;br /&gt;
 ------- ----                   ----- ------                   -----         &lt;br /&gt;
 service:an4_storage            an-node04.alteeve.com          started       &lt;br /&gt;
 service:an5_storage            an-node05.alteeve.com          started       &lt;br /&gt;
 vm:vm0001_ws1                  an-node04.alteeve.com          started       &lt;br /&gt;
 vm:vm0002_win1                 (none)                         disabled      &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So far, so good. Now let&#039;s start the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0002_win1&amp;lt;/span&amp;gt; VM.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt;&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
clusvcadm -e vm:vm0002_win1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Local machine trying to enable vm:vm0002_win1...Success&lt;br /&gt;
vm:vm0002_win1 is now running on an-node04.alteeve.com&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It started, but it didn&#039;t start on the node we normally want!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
clustat &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Cluster Status for an-cluster01 @ Sun May 15 12:40:21 2011&lt;br /&gt;
Member Status: Quorate&lt;br /&gt;
&lt;br /&gt;
 Member Name                             ID   Status&lt;br /&gt;
 ------ ----                             ---- ------&lt;br /&gt;
 an-node04.alteeve.com                       1 Online, Local, rgmanager&lt;br /&gt;
 an-node05.alteeve.com                       2 Online, rgmanager&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State         &lt;br /&gt;
 ------- ----                   ----- ------                   -----         &lt;br /&gt;
 service:an4_storage            an-node04.alteeve.com          started       &lt;br /&gt;
 service:an5_storage            an-node05.alteeve.com          started       &lt;br /&gt;
 vm:vm0001_ws1                  an-node04.alteeve.com          started       &lt;br /&gt;
 vm:vm0002_win1                 an-node04.alteeve.com          started       &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;vm0002_win1&amp;lt;/span&amp;gt; VM started on the node that the command was executed from. We could have added &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;-m an-node05.alteeve.com&amp;lt;/span&amp;gt; to the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clusvcadm&amp;lt;/span&amp;gt;, which we&#039;ll do later. It&#039;s already running though, so lets use this &amp;quot;mistake&amp;quot; as a chance to look at migrating the VM using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clusvcadm&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
So to tell &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; to perform a live migration from &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt; to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt;, use the special &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;-M&amp;lt;/span&amp;gt; live migration switch along with the normal &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;-m&amp;lt;/span&amp;gt; target cluster member switch. For more information on these switches, please take a few minutes to read &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;man clusvcadm&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
{{note|1=If you want to watch the VM as it migrates, you will need to use a program that connects to the server via it&#039;s IP address, as opposed to using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-manager&amp;lt;/span&amp;gt;. The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-manager&amp;lt;/span&amp;gt; connections are bound to the dom0 and will close once the VM moves to the other node. For Linux machines, you can connect using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ssh&amp;lt;/span&amp;gt; or &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vnc&amp;lt;/span&amp;gt; (by IP). For windows, you can connect using RDP (remote desktop protocol) using a program like &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;tsclient&amp;lt;/span&amp;gt; from Linux machines.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
clusvcadm -M vm:vm0002_win1 -m an-node05.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;
Trying to migrate vm:vm0002_win1 to an-node05.alteeve.com...Success&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we can use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clustat&amp;lt;/span&amp;gt; to see that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm:vm0002_win1&amp;lt;/span&amp;gt; service is now running on the proper &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05.alteeve.com&amp;lt;/span&amp;gt; node.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
clustat &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Cluster Status for an-cluster01 @ Sun May 15 12:53:30 2011&lt;br /&gt;
Member Status: Quorate&lt;br /&gt;
&lt;br /&gt;
 Member Name                             ID   Status&lt;br /&gt;
 ------ ----                             ---- ------&lt;br /&gt;
 an-node04.alteeve.com                       1 Online, Local, rgmanager&lt;br /&gt;
 an-node05.alteeve.com                       2 Online, rgmanager&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State         &lt;br /&gt;
 ------- ----                   ----- ------                   -----         &lt;br /&gt;
 service:an4_storage            an-node04.alteeve.com          started       &lt;br /&gt;
 service:an5_storage            an-node05.alteeve.com          started       &lt;br /&gt;
 vm:vm0001_ws1                  an-node04.alteeve.com          started       &lt;br /&gt;
 vm:vm0002_win1                 an-node05.alteeve.com          started       &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Before starting the migration, I logged into the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0002_win1&amp;lt;/span&amp;gt; machine and started a continuous ping against &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;google.ca&amp;lt;/span&amp;gt;. As you can see below, four packets were lost. This is the worst packet loss I was able to get in testing. Usually no packets were lost, but connections do sometimes drop for a very short period.&lt;br /&gt;
&lt;br /&gt;
[[Image:live_migration_vm0002_win2008_to_an-node05_ping.png|thumb|700px|center|Continuous ping from within the live-migrated VM against &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;google.ca&amp;lt;/span&amp;gt; using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;tsclient&amp;lt;/span&amp;gt; to monitor the connection.]]&lt;br /&gt;
&lt;br /&gt;
= Congratulations, Your Cluster Is Complete! Now, Break It! =&lt;br /&gt;
&lt;br /&gt;
You may have noticed that the two storage resources are still not set to automatically start with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt;. This is on purpose, as we now need to work through all of the possible failure modes. Until we&#039;ve done so, out cluster &#039;&#039;&#039;&#039;&#039;is not production ready&#039;&#039;&#039;&#039;&#039;! &lt;br /&gt;
&lt;br /&gt;
It&#039;s true, at this point the cluster is technically finished. As we&#039;ll soon see, we can kill a node and it&#039;s lost VMs will recover on the surviving node. &#039;&#039;&#039;However&#039;&#039;&#039;, that is only a part of this exercise.&lt;br /&gt;
&lt;br /&gt;
Remember back at the beginning how we talked about the inherent complexity of clusters? We need to now break our cluster at every point within that complexity that we can. We need to see how things go wrong so that we can learn how to resolve the problems that &#039;&#039;&#039;will&#039;&#039;&#039; arise now, while we have the luxury of time and a cluster with no real data on it. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Once you go in to production, it is too late to learn.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Backup a Second; Let&#039;s See How It&#039;s Supposed to Work ==&lt;br /&gt;
&lt;br /&gt;
Before we grab a hammer, let&#039;s go over how a clean stop and start should work.&lt;br /&gt;
&lt;br /&gt;
=== Gracefully Shutting Down the Cluster ===&lt;br /&gt;
&lt;br /&gt;
If you&#039;ve followed through this tutorial in order, you probably already have everything running, so let&#039;s start by talking about how to shut down the cluster properly.&lt;br /&gt;
&lt;br /&gt;
The stop order is:&lt;br /&gt;
* Lock &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; services that can migrate; The vm services in our case.&lt;br /&gt;
* Disable all &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; services.&lt;br /&gt;
* Stop the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; daemon.&lt;br /&gt;
* Stop the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt; daemon.&lt;br /&gt;
&lt;br /&gt;
Stopping the virtual machines is no longer a simple task. If you try to power down the VM from within the OS, the cluster will &amp;quot;recover&amp;quot; it as soon as it shuts off. Likewise if you try to stop it using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virsh shutdown &#039;&#039;domU&#039;&#039;&amp;lt;/span&amp;gt;. You can stop a VM by simple disabling it via &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt;, but that is not enough when preparing for a complete shutdown of the cluster as the VM could be restarted on another node in some cases. &lt;br /&gt;
&lt;br /&gt;
To ensure that the VM stays off, we&#039;ll &amp;quot;lock&amp;quot; the service. This will prevent all actions except for disabling (shutting down) the VM. Once quorum is lost though, this lock is lost, so you don&#039;t need to worry about unlocking it later when you restart the cluster.&lt;br /&gt;
&lt;br /&gt;
So let&#039;s take a look at the running resources.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
clustat&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Cluster Status for an-cluster01 @ Sun May 15 13:14:05 2011&lt;br /&gt;
Member Status: Quorate&lt;br /&gt;
&lt;br /&gt;
 Member Name                             ID   Status&lt;br /&gt;
 ------ ----                             ---- ------&lt;br /&gt;
 an-node04.alteeve.com                       1 Online, Local, rgmanager&lt;br /&gt;
 an-node05.alteeve.com                       2 Online, rgmanager&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State         &lt;br /&gt;
 ------- ----                   ----- ------                   -----         &lt;br /&gt;
 service:an4_storage            an-node04.alteeve.com          started       &lt;br /&gt;
 service:an5_storage            an-node05.alteeve.com          started       &lt;br /&gt;
 vm:vm0001_ws1                  an-node04.alteeve.com          started       &lt;br /&gt;
 vm:vm0002_win1                 an-node05.alteeve.com          started       &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We don&#039;t need to worry about the two storage services as they&#039;re in failover domains that, well, don&#039;t fail over anyway. Thus, we&#039;ll lock the two VMs. Note that it doesn&#039;t matter where the lock is issued.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
clusvcadm -l vm:vm0001_ws1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Resource groups locked&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;
clusvcadm -l vm:vm0002_win1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Resource groups locked&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I don&#039;t know of a way to see if a service has been locked as &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clustat&amp;lt;/span&amp;gt; will show no change. However, you can unlock a service if you decided not to shutdown the cluster by replacing the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;-l&amp;lt;/span&amp;gt; switch with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;-u&amp;lt;/span&amp;gt; in the calls above.&lt;br /&gt;
&lt;br /&gt;
[[Image:Locking_the_vm_services_01.png|center|thumb|700px|Locking the two VM services prior to cluster shutdown.]]&lt;br /&gt;
&lt;br /&gt;
Now you can disable the two VM services safely. Note that the disable call will not return until the VM has shut down, so be patient.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
clusvcadm -d vm:vm0001_ws1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Local machine disabling vm:vm0001_ws1...Success&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;
clusvcadm -d vm:vm0002_win1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Local machine disabling vm:vm0002_win1...Success&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Image:Disabling_the_vm_services_01.png|center|thumb|700px|Disabling the two VM services prior to cluster shutdown.]]&lt;br /&gt;
&lt;br /&gt;
You may notice in the screenshot above that the both VMs were disabled from &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt;, despite &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0002_win1&amp;lt;/span&amp;gt; running on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt; even without the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;-m &amp;lt;node&amp;gt;&amp;lt;/span&amp;gt; option. &lt;br /&gt;
&lt;br /&gt;
Check to confirm that the VMs are off now.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
clustat&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Cluster Status for an-cluster01 @ Sun May 15 13:38:20 2011&lt;br /&gt;
Member Status: Quorate&lt;br /&gt;
&lt;br /&gt;
 Member Name                             ID   Status&lt;br /&gt;
 ------ ----                             ---- ------&lt;br /&gt;
 an-node04.alteeve.com                       1 Online, Local, rgmanager&lt;br /&gt;
 an-node05.alteeve.com                       2 Online, rgmanager&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State         &lt;br /&gt;
 ------- ----                   ----- ------                   -----         &lt;br /&gt;
 service:an4_storage            an-node04.alteeve.com          started       &lt;br /&gt;
 service:an5_storage            an-node05.alteeve.com          started       &lt;br /&gt;
 vm:vm0001_ws1                  (an-node04.alteeve.com)        disabled      &lt;br /&gt;
 vm:vm0002_win1                 (an-node05.alteeve.com)        disabled      &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now that the VMs are down, we can stop &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; on both nodes. This will stop the storage services on each node in the process, and we don&#039;t need to worry about them being restarted as they can&#039;t fail to another node and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; will be gone before they could restart. It&#039;s a bit lazy, but it&#039;s safe.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/rgmanager 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;
Shutting down Cluster Service Manager...&lt;br /&gt;
Waiting for services to stop:                              [  OK  ]&lt;br /&gt;
Cluster Service Manager is stopped.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Image:Stopping_the_rgmanager_daemon_01.png|center|thumb|700px|Stopping the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; daemon on both nodes.]]&lt;br /&gt;
&lt;br /&gt;
Notice in the screenshot above that we can see the storage service halting after &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; is told to stop.&lt;br /&gt;
&lt;br /&gt;
We can confirm that storage is stopped simply by checking the status of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;drbd&amp;lt;/span&amp;gt;. If anything went wrong, one or more of the DRBD resources would have been held open and prevented from stopping. If the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;drbd&amp;lt;/span&amp;gt; module is unloaded, we know that the shutdown was successful.&lt;br /&gt;
&lt;br /&gt;
Check this from both nodes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/drbd 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;
drbd not loaded&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now, all that is left is to stop &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&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/cman 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;
Stopping cluster: &lt;br /&gt;
   Stopping fencing... done&lt;br /&gt;
   Stopping cman... done&lt;br /&gt;
   Stopping ccsd... done&lt;br /&gt;
   Unmounting configfs... done&lt;br /&gt;
                                                           [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
That&#039;s it, you can down safely shut down the nodes!&lt;br /&gt;
&lt;br /&gt;
=== Cold Starting the Cluster ===&lt;br /&gt;
&lt;br /&gt;
Starting the cluster from scratch is a little different from starting and joining a node to en existing cluster, as we will see later. There are two main reasons:&lt;br /&gt;
&lt;br /&gt;
* If a node doesn&#039;t hear back from the other node when &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;openais&amp;lt;/span&amp;gt; starts, it &#039;&#039;&#039;must&#039;&#039;&#039; assume that the other node has crashed and that it needs to be fenced. Remember the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;post_join_delay&amp;lt;/span&amp;gt;? That is the maximum amount of time that a node will wait on start before it fires off a fence. Thus, we must start &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt; on both nodes within &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;post_join_delay&amp;lt;/span&amp;gt; seconds of one another.&lt;br /&gt;
* DRBD will not start until both nodes can talk to each other. If you start the storage service on either node, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;drbd&amp;lt;/span&amp;gt; will hang forever waiting for the other node to show up. It is possible to change this DRBD behaviour, but doing so is an exercise for the reader. &lt;br /&gt;
&lt;br /&gt;
Once both nodes are up, you can shut one node back down and safely run of just the one node. This is because the surviving node will see the other node withdraw, and thus will confidently know that it is not going to access the clustered resources. &lt;br /&gt;
&lt;br /&gt;
With this in mind, the cold-start order is:&lt;br /&gt;
&lt;br /&gt;
# Start the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt; daemon on both nodes within &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;post_join_delay&amp;lt;/span&amp;gt; seconds.&lt;br /&gt;
# Start the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; daemon on both nodes. At this point, the storage services are not set to start with the system, so there are no timing concerns yet.&lt;br /&gt;
# Enable the storage services on both nodes. We did not enable the DRBD timeout (see &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;man drbd.conf&amp;lt;/span&amp;gt;), so we don&#039;t have timing concerns here. Be aware that the enable command on the first node will not return until the storage service has been started on the second node. For this reason, you&#039;ll want to have two terminals open; One connected to each node.&lt;br /&gt;
# Verify that the storage services are all online.&lt;br /&gt;
# Start the virtual machine resources in the order that best suits you.&lt;br /&gt;
&lt;br /&gt;
So, start &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&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/cman 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 cluster: &lt;br /&gt;
   Loading modules... done&lt;br /&gt;
   Mounting configfs... done&lt;br /&gt;
   Starting ccsd... done&lt;br /&gt;
   Starting cman... done&lt;br /&gt;
   Starting daemons... done&lt;br /&gt;
   Starting fencing... done&lt;br /&gt;
                                                           [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Image:Starting_cman_on_both_nodes_01.png|thumb|center|700px|Starting &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt; on both nodes at the same time.]]&lt;br /&gt;
&lt;br /&gt;
Now we&#039;ll start &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; on both nodes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/rgmanager 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 Cluster Service Manager:                          [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I like to make a habit of running &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clustat&amp;lt;/span&amp;gt; right after starting, just to ensure that services are or are not running, as I&#039;d expect.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
clustat&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Cluster Status for an-cluster01 @ Sun May 15 16:42:41 2011&lt;br /&gt;
Member Status: Quorate&lt;br /&gt;
&lt;br /&gt;
 Member Name                             ID   Status&lt;br /&gt;
 ------ ----                             ---- ------&lt;br /&gt;
 an-node04.alteeve.com                       1 Online, Local, rgmanager&lt;br /&gt;
 an-node05.alteeve.com                       2 Online, rgmanager&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State         &lt;br /&gt;
 ------- ----                   ----- ------                   -----         &lt;br /&gt;
 service:an4_storage            (none)                         stopped       &lt;br /&gt;
 service:an5_storage            (none)                         stopped       &lt;br /&gt;
 vm:vm0001_ws1                  (none)                         stopped       &lt;br /&gt;
 vm:vm0002_win1                 (none)                         stopped       &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Image:Starting_rgmanager_on_both_nodes_01.png|thumb|center|700px|Starting &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; on both nodes and checking service states with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clustat&amp;lt;/span&amp;gt;.]]&lt;br /&gt;
&lt;br /&gt;
If you run &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clustat&amp;lt;/span&amp;gt; immediately after &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; has started, you may see no services listed. This is not a problem, it just takes a minute for the service states to become known to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
You may notice that the log files are complaining that they could not find the VM definition files in the search path. Remember back in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; section how we talked about the delay in getting the clustered storage online? This is the problem. The definitions are on the GFS2 partition which isn&#039;t available quickly enough. Even if we started the storage resources with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt;, which we will do later, it&#039;s still not fast enough to prevent &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; from failing to find the definition files and giving up. This is why we&#039;ll need to always start the virtual machines manually. &lt;br /&gt;
&lt;br /&gt;
As an aside, this isn&#039;t a problem with [[pacemaker]], as we&#039;ll see in the [[EL6]] tutorial later.&lt;br /&gt;
&lt;br /&gt;
Let&#039;s now start the clustered storage services. As an experiment, start the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an4_storage&amp;lt;/span&amp;gt; service and then wait some time before starting the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an5_storage&amp;lt;/span&amp;gt;. You&#039;ll see that the first service will pause indefinitely, as we discussed.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt;&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
clusvcadm -e an4_storage&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Local machine trying to enable service:an4_storage...&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Image:Starting_storage_on_one_node_01.png|thumb|center|700px|Starting &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an4_storage&amp;lt;/span&amp;gt; on just &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt;.]]&lt;br /&gt;
&lt;br /&gt;
Once you start the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an5_storage&amp;lt;/span&amp;gt; service, both will complete and return to the command line. Once done, I like to run a &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;status&amp;lt;/span&amp;gt; check 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; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;gfs2&amp;lt;/span&amp;gt; to ensure that things are as I expect them.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/drbd status &amp;amp;&amp;amp; /etc/init.d/clvmd status &amp;amp;&amp;amp; /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;
drbd driver loaded OK; device status:&lt;br /&gt;
version: 8.3.8 (api:88/proto:86-94)&lt;br /&gt;
GIT-hash: d78846e52224fd00562f7c225bcc25b2d422321d build by mockbuild@builder10.centos.org, 2010-06-04 08:04:27&lt;br /&gt;
m:res  cs         ro               ds                 p  mounted  fstype&lt;br /&gt;
0:r0   Connected  Primary/Primary  UpToDate/UpToDate  C&lt;br /&gt;
1:r1   Connected  Primary/Primary  UpToDate/UpToDate  C&lt;br /&gt;
2:r2   Connected  Primary/Primary  UpToDate/UpToDate  C&lt;br /&gt;
3:r3   Connected  Primary/Primary  UpToDate/UpToDate  C&lt;br /&gt;
clvmd (pid  6283) is running...&lt;br /&gt;
Clustered Volume Groups: drbd_an5_vg0 drbd_an4_vg0 drbd_sh0_vg0&lt;br /&gt;
Active clustered Logical Volumes: /dev/drbd_an5_vg0/vm0002_1 /dev/drbd_an4_vg0/vm0001_1 /dev/drbd_sh0_vg0/xen_shared&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;
[[Image:Starting_storage_on_the_other_node_01.png|thumb|center|700px|Starting &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an5_storage&amp;lt;/span&amp;gt; on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt; and then performing the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;status&amp;lt;/span&amp;gt; checks.]]&lt;br /&gt;
&lt;br /&gt;
Everything is in place, so now we can start the virtual machines. Given that VMs can run on either node, it&#039;s a good habit to explicitly define the target node using the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;-m&amp;lt;/span&amp;gt; &amp;quot;member&amp;quot; switch.&lt;br /&gt;
&lt;br /&gt;
Start the web server:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
clusvcadm -e vm:vm0001_ws1 -m an-node04.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;
Member an-node04.alteeve.com trying to enable vm:vm0001_ws1...Success&lt;br /&gt;
vm:vm0001_ws1 is now running on an-node04.alteeve.com&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Start the windows server:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
clusvcadm -e vm:vm0002_win1 -m an-node05.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;
Member an-node05.alteeve.com trying to enable vm:vm0002_win1...Success&lt;br /&gt;
vm:vm0002_win1 is now running on an-node05.alteeve.com&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check that they are running using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clustat&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;
clustat&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Cluster Status for an-cluster01 @ Sun May 15 17:05:49 2011&lt;br /&gt;
Member Status: Quorate&lt;br /&gt;
&lt;br /&gt;
 Member Name                             ID   Status&lt;br /&gt;
 ------ ----                             ---- ------&lt;br /&gt;
 an-node04.alteeve.com                       1 Online, Local, rgmanager&lt;br /&gt;
 an-node05.alteeve.com                       2 Online, rgmanager&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State         &lt;br /&gt;
 ------- ----                   ----- ------                   -----         &lt;br /&gt;
 service:an4_storage            an-node04.alteeve.com          started       &lt;br /&gt;
 service:an5_storage            an-node05.alteeve.com          started       &lt;br /&gt;
 vm:vm0001_ws1                  an-node04.alteeve.com          started       &lt;br /&gt;
 vm:vm0002_win1                 an-node05.alteeve.com          started       &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There we have it! The cluster is up and running from a complete cold start.&lt;br /&gt;
&lt;br /&gt;
== Testing Migration and Recovery ==&lt;br /&gt;
&lt;br /&gt;
We&#039;ve already looked at live migration of VMs before they were added to the cluster, but we&#039;ve not yet looked at live migrations &#039;&#039;within&#039;&#039; the cluster.&lt;br /&gt;
&lt;br /&gt;
Our tests will cover:&lt;br /&gt;
&lt;br /&gt;
* A controlled migration, as we would do before and after planned maintenance on a node.&lt;br /&gt;
* Crashing a VM directly, and making sure that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; detects the crash and restarts the VM.&lt;br /&gt;
* Crashing a VM enough times and within enough time to trigger a relocation to the second node.&lt;br /&gt;
* Crashing the host node and checking that lost VMs restart on the surviving node.&lt;br /&gt;
&lt;br /&gt;
=== Controlled Live Migration Using clusvcadm ===&lt;br /&gt;
&lt;br /&gt;
There will be times when you will want to migrate a VM off of a node. The classic example would be to upgrade the hardware, install a new kernel or repair a RAID array. When you know that ahead of time that a node will go down, you can easily migrate the VM services off of it to another node in the cluster.&lt;br /&gt;
&lt;br /&gt;
Let&#039;s look at migrating the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0001_ws1&amp;lt;/span&amp;gt; VM from &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt; to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt;. First, confirm that it is on the source node.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
clustat&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Cluster Status for an-cluster01 @ Sun May 15 17:05:49 2011&lt;br /&gt;
Member Status: Quorate&lt;br /&gt;
&lt;br /&gt;
 Member Name                             ID   Status&lt;br /&gt;
 ------ ----                             ---- ------&lt;br /&gt;
 an-node04.alteeve.com                       1 Online, Local, rgmanager&lt;br /&gt;
 an-node05.alteeve.com                       2 Online, rgmanager&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State         &lt;br /&gt;
 ------- ----                   ----- ------                   -----         &lt;br /&gt;
 service:an4_storage            an-node04.alteeve.com          started       &lt;br /&gt;
 service:an5_storage            an-node05.alteeve.com          started       &lt;br /&gt;
 vm:vm0001_ws1                  an-node04.alteeve.com          started       &lt;br /&gt;
 vm:vm0002_win1                 an-node05.alteeve.com          started       &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now perform the actual migration. Note that we will be using the special &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;-M&amp;lt;/span&amp;gt; (live migrate) switch, rather than the usual &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;-r&amp;lt;/span&amp;gt; (relocate) switch.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
clusvcadm -M vm:vm0001_ws1 -m an-node05.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;
Trying to migrate vm:vm0001_ws1 to an-node05.alteeve.com...Success&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you then run &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clustat&amp;lt;/span&amp;gt; again, you will see the VM now running on the target node.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
clustat&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Cluster Status for an-cluster01 @ Sun May 15 17:21:31 2011&lt;br /&gt;
Member Status: Quorate&lt;br /&gt;
&lt;br /&gt;
 Member Name                             ID   Status&lt;br /&gt;
 ------ ----                             ---- ------&lt;br /&gt;
 an-node04.alteeve.com                       1 Online, Local, rgmanager&lt;br /&gt;
 an-node05.alteeve.com                       2 Online, rgmanager&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State         &lt;br /&gt;
 ------- ----                   ----- ------                   -----         &lt;br /&gt;
 service:an4_storage            an-node04.alteeve.com          started       &lt;br /&gt;
 service:an5_storage            an-node05.alteeve.com          started       &lt;br /&gt;
 vm:vm0001_ws1                  an-node05.alteeve.com          started       &lt;br /&gt;
 vm:vm0002_win1                 an-node05.alteeve.com          started       &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Image:Live_migrating_a_vm_using_clusvcadm_01.png|center|thumb|700px|Live migrating &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0001_ws1&amp;lt;/span&amp;gt; from &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt; to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt;.]]&lt;br /&gt;
&lt;br /&gt;
That was easy!&lt;br /&gt;
&lt;br /&gt;
=== Crashing the VM Itself ===&lt;br /&gt;
&lt;br /&gt;
There are many ways to crash a VM, and you can and should try crashing it all the ways that you can think of. In [[Linux]] machines, we can trigger a crash by &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;echo&amp;lt;/span&amp;gt;&#039;ing &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;c&amp;lt;/span&amp;gt; to the special &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/proc/sysrq-trigger&amp;lt;/span&amp;gt; file. This will instantly crash the server and you will not see the command return. &lt;br /&gt;
&lt;br /&gt;
Let&#039;s do this to the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0001_ws1&amp;lt;/span&amp;gt; VM. Connect to the virtual machine, either directly to it&#039;s console by running &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xm console vm0001_ws1&amp;lt;/span&amp;gt; from the host, or by &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ssh&amp;lt;/span&amp;gt;&#039;ing into the machine. Once logged in, run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
echo c &amp;gt; /proc/sysrq-trigger&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Within moments, you will see the xen &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vifX.Y&amp;lt;/span&amp;gt; interfaces disable and then a new &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vifZ.Y&amp;lt;/span&amp;gt; get created as the VM is restarted. If you are fast enough, you may see &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clustat&amp;lt;/span&amp;gt; report the VM as disabled, though it starts up very quickly so it may be hard to catch.&lt;br /&gt;
&lt;br /&gt;
[[Image:Watching_a_vm_restart_via_rgmanager_01.png|thumb|700px|center|Killing a VM internally and watching it restart.]]&lt;br /&gt;
&lt;br /&gt;
=== Crashing the VM Enough Times to Trigger a Relocation ===&lt;br /&gt;
&lt;br /&gt;
{{note|1=This doesn&#039;t seem to be working at the moment. Filed a Red Hat [https://bugzilla.redhat.com/show_bug.cgi?id=698369 bugzilla] ticket.}}&lt;br /&gt;
&lt;br /&gt;
VM always restarts on the node it was last running on.&lt;br /&gt;
&lt;br /&gt;
=== Crashing the Host Node ===&lt;br /&gt;
&lt;br /&gt;
{{Note|1=Once you crash the host node, both DRBD and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt; will trigger fence calls nearly simultaneously. Some fence devices do not handle this well and will either fail, or report a failed fence to the cluster. If this is the case with your fence device, you can use the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[RHCS_v2_cluster.conf#post_fail_delay|post_fail_delay]]&amp;lt;/span&amp;gt; option in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cluster.conf&amp;lt;/span&amp;gt;.}}&lt;br /&gt;
&lt;br /&gt;
As we did when we crashed the virtual machine, we will crash the operating system on the node currently running one of the VMs. In the case, we have &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0001_ws1&amp;lt;/span&amp;gt; running on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0002_win1&amp;lt;/span&amp;gt; running on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&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;
clustat&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Cluster Status for an-cluster01 @ Sun May 15 19:41:21 2011&lt;br /&gt;
Member Status: Quorate&lt;br /&gt;
&lt;br /&gt;
 Member Name                             ID   Status&lt;br /&gt;
 ------ ----                             ---- ------&lt;br /&gt;
 an-node04.alteeve.com                       1 Online, Local, rgmanager&lt;br /&gt;
 an-node05.alteeve.com                       2 Online, rgmanager&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State         &lt;br /&gt;
 ------- ----                   ----- ------                   -----         &lt;br /&gt;
 service:an4_storage            an-node04.alteeve.com          started       &lt;br /&gt;
 service:an5_storage            an-node05.alteeve.com          started       &lt;br /&gt;
 vm:vm0001_ws1                  an-node04.alteeve.com          started       &lt;br /&gt;
 vm:vm0002_win1                 an-node05.alteeve.com          started       &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once we crash &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt;, watch the log file in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt;. You will see DRBD lose contact with the other side, the crashed &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt; machine get fenced, the cluster will reform and finally the resource manager will restart the lost virtual machine. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt;&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
echo c &amp;gt; /proc/sysrq-trigger&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Watching &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt;, we will see the following in [[syslog]]:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
May 15 19:45:52 an-node05 kernel: block drbd3: PingAck did not arrive in time.&lt;br /&gt;
May 15 19:45:52 an-node05 kernel: block drbd3: peer( Primary -&amp;gt; Unknown ) conn( Connected -&amp;gt; NetworkFailure ) pdsk( UpToDate -&amp;gt; DUnknown ) &lt;br /&gt;
May 15 19:45:52 an-node05 kernel: block drbd3: asender terminated&lt;br /&gt;
May 15 19:45:52 an-node05 kernel: block drbd3: Terminating asender thread&lt;br /&gt;
May 15 19:45:52 an-node05 kernel: block drbd3: short read expecting header on sock: r=-512&lt;br /&gt;
May 15 19:45:52 an-node05 kernel: block drbd3: Creating new current UUID&lt;br /&gt;
May 15 19:45:52 an-node05 kernel: block drbd3: Connection closed&lt;br /&gt;
May 15 19:45:52 an-node05 kernel: block drbd3: conn( NetworkFailure -&amp;gt; Unconnected ) &lt;br /&gt;
May 15 19:45:52 an-node05 kernel: block drbd3: receiver terminated&lt;br /&gt;
May 15 19:45:52 an-node05 kernel: block drbd3: Restarting receiver thread&lt;br /&gt;
May 15 19:45:52 an-node05 kernel: block drbd3: receiver (re)started&lt;br /&gt;
May 15 19:45:52 an-node05 kernel: block drbd3: conn( Unconnected -&amp;gt; WFConnection ) &lt;br /&gt;
May 15 19:45:57 an-node05 kernel: block drbd2: PingAck did not arrive in time.&lt;br /&gt;
May 15 19:45:57 an-node05 kernel: block drbd2: peer( Primary -&amp;gt; Unknown ) conn( Connected -&amp;gt; NetworkFailure ) pdsk( UpToDate -&amp;gt; DUnknown ) &lt;br /&gt;
May 15 19:45:57 an-node05 kernel: block drbd2: asender terminated&lt;br /&gt;
May 15 19:45:57 an-node05 kernel: block drbd2: Terminating asender thread&lt;br /&gt;
May 15 19:45:57 an-node05 kernel: block drbd2: short read expecting header on sock: r=-512&lt;br /&gt;
May 15 19:45:57 an-node05 kernel: block drbd2: Creating new current UUID&lt;br /&gt;
May 15 19:45:57 an-node05 kernel: block drbd2: Connection closed&lt;br /&gt;
May 15 19:45:57 an-node05 kernel: block drbd2: conn( NetworkFailure -&amp;gt; Unconnected ) &lt;br /&gt;
May 15 19:45:57 an-node05 kernel: block drbd2: receiver terminated&lt;br /&gt;
May 15 19:45:57 an-node05 kernel: block drbd2: Restarting receiver thread&lt;br /&gt;
May 15 19:45:57 an-node05 kernel: block drbd2: receiver (re)started&lt;br /&gt;
May 15 19:45:57 an-node05 kernel: block drbd2: conn( Unconnected -&amp;gt; WFConnection ) &lt;br /&gt;
May 15 19:46:00 an-node05 kernel: block drbd0: PingAck did not arrive in time.&lt;br /&gt;
May 15 19:46:00 an-node05 kernel: block drbd0: peer( Primary -&amp;gt; Unknown ) conn( Connected -&amp;gt; NetworkFailure ) pdsk( UpToDate -&amp;gt; DUnknown ) &lt;br /&gt;
May 15 19:46:00 an-node05 kernel: block drbd0: asender terminated&lt;br /&gt;
May 15 19:46:00 an-node05 kernel: block drbd0: Terminating asender thread&lt;br /&gt;
May 15 19:46:00 an-node05 kernel: block drbd0: short read expecting header on sock: r=-512&lt;br /&gt;
May 15 19:46:00 an-node05 kernel: block drbd0: Creating new current UUID&lt;br /&gt;
May 15 19:46:00 an-node05 kernel: block drbd0: Connection closed&lt;br /&gt;
May 15 19:46:00 an-node05 kernel: block drbd0: conn( NetworkFailure -&amp;gt; Unconnected ) &lt;br /&gt;
May 15 19:46:00 an-node05 kernel: block drbd0: receiver terminated&lt;br /&gt;
May 15 19:46:00 an-node05 kernel: block drbd0: Restarting receiver thread&lt;br /&gt;
May 15 19:46:00 an-node05 kernel: block drbd0: receiver (re)started&lt;br /&gt;
May 15 19:46:00 an-node05 kernel: block drbd0: conn( Unconnected -&amp;gt; WFConnection ) &lt;br /&gt;
May 15 19:46:01 an-node05 openais[4704]: [TOTEM] The token was lost in the OPERATIONAL state. &lt;br /&gt;
May 15 19:46:01 an-node05 openais[4704]: [TOTEM] Receive multicast socket recv buffer size (320000 bytes). &lt;br /&gt;
May 15 19:46:01 an-node05 openais[4704]: [TOTEM] Transmit multicast socket send buffer size (262142 bytes). &lt;br /&gt;
May 15 19:46:01 an-node05 openais[4704]: [TOTEM] entering GATHER state from 2. &lt;br /&gt;
May 15 19:46:01 an-node05 kernel: block drbd1: PingAck did not arrive in time.&lt;br /&gt;
May 15 19:46:01 an-node05 kernel: block drbd1: peer( Primary -&amp;gt; Unknown ) conn( Connected -&amp;gt; NetworkFailure ) pdsk( UpToDate -&amp;gt; DUnknown ) &lt;br /&gt;
May 15 19:46:01 an-node05 kernel: block drbd1: asender terminated&lt;br /&gt;
May 15 19:46:01 an-node05 kernel: block drbd1: Terminating asender thread&lt;br /&gt;
May 15 19:46:01 an-node05 kernel: block drbd1: short read expecting header on sock: r=-512&lt;br /&gt;
May 15 19:46:01 an-node05 kernel: block drbd1: Creating new current UUID&lt;br /&gt;
May 15 19:46:01 an-node05 kernel: block drbd1: Connection closed&lt;br /&gt;
May 15 19:46:01 an-node05 kernel: block drbd1: conn( NetworkFailure -&amp;gt; Unconnected ) &lt;br /&gt;
May 15 19:46:01 an-node05 kernel: block drbd1: receiver terminated&lt;br /&gt;
May 15 19:46:01 an-node05 kernel: block drbd1: Restarting receiver thread&lt;br /&gt;
May 15 19:46:01 an-node05 kernel: block drbd1: receiver (re)started&lt;br /&gt;
May 15 19:46:01 an-node05 kernel: block drbd1: conn( Unconnected -&amp;gt; WFConnection ) &lt;br /&gt;
May 15 19:46:03 an-node05 openais[4704]: [TOTEM] entering GATHER state from 0. &lt;br /&gt;
May 15 19:46:03 an-node05 openais[4704]: [TOTEM] Creating commit token because I am the rep. &lt;br /&gt;
May 15 19:46:03 an-node05 openais[4704]: [TOTEM] Storing new sequence id for ring 140 &lt;br /&gt;
May 15 19:46:03 an-node05 openais[4704]: [TOTEM] entering COMMIT state. &lt;br /&gt;
May 15 19:46:03 an-node05 openais[4704]: [TOTEM] entering RECOVERY state. &lt;br /&gt;
May 15 19:46:03 an-node05 openais[4704]: [TOTEM] position [0] member 192.168.3.75: &lt;br /&gt;
May 15 19:46:03 an-node05 openais[4704]: [TOTEM] previous ring seq 316 rep 192.168.3.74 &lt;br /&gt;
May 15 19:46:03 an-node05 openais[4704]: [TOTEM] aru 7b high delivered 7b received flag 1 &lt;br /&gt;
May 15 19:46:03 an-node05 openais[4704]: [TOTEM] Did not need to originate any messages in recovery. &lt;br /&gt;
May 15 19:46:03 an-node05 openais[4704]: [TOTEM] Sending initial ORF token &lt;br /&gt;
May 15 19:46:03 an-node05 openais[4704]: [CLM  ] CLM CONFIGURATION CHANGE &lt;br /&gt;
May 15 19:46:03 an-node05 openais[4704]: [CLM  ] New Configuration: &lt;br /&gt;
May 15 19:46:03 an-node05 openais[4704]: [CLM  ] 	r(0) ip(192.168.3.75)  &lt;br /&gt;
May 15 19:46:03 an-node05 kernel: dlm: closing connection to node 1&lt;br /&gt;
May 15 19:46:03 an-node05 fenced[4724]: an-node04.alteeve.com not a cluster member after 0 sec post_fail_delay&lt;br /&gt;
May 15 19:46:03 an-node05 openais[4704]: [CLM  ] Members Left: &lt;br /&gt;
May 15 19:46:03 an-node05 fenced[4724]: fencing node &amp;quot;an-node04.alteeve.com&amp;quot;&lt;br /&gt;
May 15 19:46:03 an-node05 openais[4704]: [CLM  ] 	r(0) ip(192.168.3.74)  &lt;br /&gt;
May 15 19:46:03 an-node05 openais[4704]: [CLM  ] Members Joined: &lt;br /&gt;
May 15 19:46:03 an-node05 openais[4704]: [CLM  ] CLM CONFIGURATION CHANGE &lt;br /&gt;
May 15 19:46:03 an-node05 openais[4704]: [CLM  ] New Configuration: &lt;br /&gt;
May 15 19:46:03 an-node05 openais[4704]: [CLM  ] 	r(0) ip(192.168.3.75)  &lt;br /&gt;
May 15 19:46:03 an-node05 openais[4704]: [CLM  ] Members Left: &lt;br /&gt;
May 15 19:46:03 an-node05 openais[4704]: [CLM  ] Members Joined: &lt;br /&gt;
May 15 19:46:03 an-node05 openais[4704]: [SYNC ] This node is within the primary component and will provide service. &lt;br /&gt;
May 15 19:46:03 an-node05 openais[4704]: [TOTEM] entering OPERATIONAL state. &lt;br /&gt;
May 15 19:46:03 an-node05 openais[4704]: [CLM  ] got nodejoin message 192.168.3.75 &lt;br /&gt;
May 15 19:46:03 an-node05 openais[4704]: [CPG  ] got joinlist message from node 2 &lt;br /&gt;
May 15 19:46:16 an-node05 fenced[4724]: fence &amp;quot;an-node04.alteeve.com&amp;quot; success&lt;br /&gt;
May 15 19:46:16 an-node05 kernel: GFS2: fsid=an-cluster01:xen_shared.0: jid=1: Trying to acquire journal lock...&lt;br /&gt;
May 15 19:46:16 an-node05 kernel: GFS2: fsid=an-cluster01:xen_shared.0: jid=1: Looking at journal...&lt;br /&gt;
May 15 19:46:16 an-node05 kernel: GFS2: fsid=an-cluster01:xen_shared.0: jid=1: Acquiring the transaction lock...&lt;br /&gt;
May 15 19:46:16 an-node05 kernel: GFS2: fsid=an-cluster01:xen_shared.0: jid=1: Replaying journal...&lt;br /&gt;
May 15 19:46:16 an-node05 kernel: GFS2: fsid=an-cluster01:xen_shared.0: jid=1: Replayed 1 of 1 blocks&lt;br /&gt;
May 15 19:46:16 an-node05 kernel: GFS2: fsid=an-cluster01:xen_shared.0: jid=1: Found 0 revoke tags&lt;br /&gt;
May 15 19:46:16 an-node05 kernel: GFS2: fsid=an-cluster01:xen_shared.0: jid=1: Journal replayed in 1s&lt;br /&gt;
May 15 19:46:16 an-node05 kernel: GFS2: fsid=an-cluster01:xen_shared.0: jid=1: Done&lt;br /&gt;
May 15 19:46:16 an-node05 clurgmgrd[4302]: &amp;lt;notice&amp;gt; Marking service:an4_storage as stopped: Restricted domain unavailable &lt;br /&gt;
May 15 19:46:16 an-node05 clurgmgrd[4302]: &amp;lt;notice&amp;gt; Taking over service vm:vm0001_ws1 from down member an-node04.alteeve.com &lt;br /&gt;
May 15 19:46:18 an-node05 kernel: device vif5.0 entered promiscuous mode&lt;br /&gt;
May 15 19:46:18 an-node05 kernel: ADDRCONF(NETDEV_UP): vif5.0: link is not ready&lt;br /&gt;
May 15 19:46:18 an-node05 clurgmgrd[4302]: &amp;lt;notice&amp;gt; Service vm:vm0001_ws1 started &lt;br /&gt;
May 15 19:46:22 an-node05 kernel: blkback: ring-ref 8, event-channel 8, protocol 1 (x86_64-abi)&lt;br /&gt;
May 15 19:46:33 an-node05 kernel: ADDRCONF(NETDEV_CHANGE): vif5.0: link becomes ready&lt;br /&gt;
May 15 19:46:33 an-node05 kernel: xenbr0: port 4(vif5.0) entering learning state&lt;br /&gt;
May 15 19:46:48 an-node05 kernel: xenbr0: topology change detected, propagating&lt;br /&gt;
May 15 19:46:48 an-node05 kernel: xenbr0: port 4(vif5.0) entering forwarding state&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{note|1=Do to a bug in [[Node Assassin]], DRBD was not configured to fence the remote node on failure, so the only fence call came from &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt;.}}&lt;br /&gt;
&lt;br /&gt;
[[Image:Crashed_an-node04_vm_recovery_01.png|thumb|center|900px|VM recovery beginning on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt; after crashing &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt;.]]&lt;br /&gt;
&lt;br /&gt;
Above we can see that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04.alteeve.com&amp;lt;/span&amp;gt; is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Offline&amp;lt;/span&amp;gt; and the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm:vm0001_ws1&amp;lt;/span&amp;gt; service is automatically &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;starting&amp;lt;/span&amp;gt; on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
Success!&lt;br /&gt;
&lt;br /&gt;
Once you&#039;ve rejoined &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt; to the cluster, simply live-migrate &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0001_ws1&amp;lt;/span&amp;gt; back to it.&lt;br /&gt;
&lt;br /&gt;
=== Further Testing ===&lt;br /&gt;
&lt;br /&gt;
This tutorial could quickly overflow with failure testing scenarios. It is somewhat outside the scope of this tutorial, so we will stop here.&lt;br /&gt;
&lt;br /&gt;
As a rule of thumb, you should expect to spend &#039;&#039;at least&#039;&#039; as much time breaking and repairing your cluster as you did building it in the first place.&lt;br /&gt;
&lt;br /&gt;
A small list of things to test:&lt;br /&gt;
* Pulling each network cable, one at a time, and see how things fail and what is needed to restore the cluster.&lt;br /&gt;
* Kill the power on switch(es). See how things fail when all network connections are lost.&lt;br /&gt;
* Pull hard drives from the server (or &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;dd if=/dev/zero of=/dev/xx count=10000&amp;lt;/span&amp;gt; drives) to fail out the arrays.&lt;br /&gt;
* Reformat a node, then rebuild it from scratch and join it back with the surviving node.&lt;br /&gt;
* And so forth. Be destructively creative!&lt;br /&gt;
&lt;br /&gt;
= Testing Done - Going Into Production =&lt;br /&gt;
&lt;br /&gt;
Once you finish testing, the last thing to do is to change the storage resources to automatically start with the cluster. To do this, simply change &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;autostart=&amp;quot;0&amp;quot;&amp;lt;/span&amp;gt; to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;autostart=&amp;quot;1&amp;quot;&amp;lt;/span&amp;gt; for the two storage resources.&lt;br /&gt;
&lt;br /&gt;
{{note|1=Do &#039;&#039;not&#039;&#039; set &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;autostart=&amp;quot;1&amp;quot;&amp;lt;/span&amp;gt; for the virtual machine resources. As mentioned before, the storage does not come up fast enough and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; will give up trying to start the VMs. You will need to manually start the VM resources when you cold boot the cluster.}}&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;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;rm&amp;gt;&lt;br /&gt;
                ...&lt;br /&gt;
                &amp;lt;service autostart=&amp;quot;1&amp;quot; domain=&amp;quot;an4_only&amp;quot; exclusive=&amp;quot;0&amp;quot; max_restarts=&amp;quot;0&amp;quot; name=&amp;quot;an4_storage&amp;quot; recovery=&amp;quot;restart&amp;quot; restart_expire_time=&amp;quot;0&amp;quot;&amp;gt;&lt;br /&gt;
                        &amp;lt;script ref=&amp;quot;drbd&amp;quot;&amp;gt;&lt;br /&gt;
                                &amp;lt;script ref=&amp;quot;clvmd&amp;quot;&amp;gt;&lt;br /&gt;
                                        &amp;lt;script ref=&amp;quot;gfs2&amp;quot;/&amp;gt;&lt;br /&gt;
                                &amp;lt;/script&amp;gt;&lt;br /&gt;
                        &amp;lt;/script&amp;gt;&lt;br /&gt;
                &amp;lt;/service&amp;gt;&lt;br /&gt;
                &amp;lt;service autostart=&amp;quot;1&amp;quot; domain=&amp;quot;an5_only&amp;quot; exclusive=&amp;quot;0&amp;quot; max_restarts=&amp;quot;0&amp;quot; name=&amp;quot;an5_storage&amp;quot; recovery=&amp;quot;restart&amp;quot; restart_expire_time=&amp;quot;0&amp;quot;&amp;gt;&lt;br /&gt;
                        &amp;lt;script ref=&amp;quot;drbd&amp;quot;&amp;gt;&lt;br /&gt;
                                &amp;lt;script ref=&amp;quot;clvmd&amp;quot;&amp;gt;&lt;br /&gt;
                                        &amp;lt;script ref=&amp;quot;gfs2&amp;quot;/&amp;gt;&lt;br /&gt;
                                &amp;lt;/script&amp;gt;&lt;br /&gt;
                        &amp;lt;/script&amp;gt;&lt;br /&gt;
                &amp;lt;/service&amp;gt;&lt;br /&gt;
        &amp;lt;/rm&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Validate and push out the new configuration.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
xmllint --relaxng /usr/share/system-config-cluster/misc/cluster.ng /etc/cluster/cluster.conf&lt;br /&gt;
&amp;lt;/source&amp;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-cluster01&amp;quot; config_version=&amp;quot;16&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;cman expected_votes=&amp;quot;1&amp;quot; two_node=&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-node04.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;fence_na01&amp;quot; port=&amp;quot;04&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-node05.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;fence_na01&amp;quot; port=&amp;quot;03&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 agent=&amp;quot;fence_na&amp;quot; ipaddr=&amp;quot;fence_na01.alteeve.com&amp;quot; login=&amp;quot;admin&amp;quot; name=&amp;quot;fence_na01&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;fence_daemon post_join_delay=&amp;quot;60&amp;quot;/&amp;gt;&lt;br /&gt;
        &amp;lt;totem rrp_mode=&amp;quot;none&amp;quot; secauth=&amp;quot;off&amp;quot;/&amp;gt;&lt;br /&gt;
        &amp;lt;rm&amp;gt;&lt;br /&gt;
                &amp;lt;resources&amp;gt;&lt;br /&gt;
                        &amp;lt;script file=&amp;quot;/etc/init.d/drbd&amp;quot; name=&amp;quot;drbd&amp;quot;/&amp;gt;&lt;br /&gt;
                        &amp;lt;script file=&amp;quot;/etc/init.d/clvmd&amp;quot; name=&amp;quot;clvmd&amp;quot;/&amp;gt;&lt;br /&gt;
                        &amp;lt;script file=&amp;quot;/etc/init.d/gfs2&amp;quot; name=&amp;quot;gfs2&amp;quot;/&amp;gt;&lt;br /&gt;
                &amp;lt;/resources&amp;gt;&lt;br /&gt;
		&amp;lt;failoverdomains&amp;gt;&lt;br /&gt;
			&amp;lt;failoverdomain name=&amp;quot;an4_only&amp;quot; nofailback=&amp;quot;0&amp;quot; ordered=&amp;quot;0&amp;quot; restricted=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
				&amp;lt;failoverdomainnode name=&amp;quot;an-node04.alteeve.com&amp;quot; priority=&amp;quot;1&amp;quot;/&amp;gt;&lt;br /&gt;
			&amp;lt;/failoverdomain&amp;gt;&lt;br /&gt;
			&amp;lt;failoverdomain name=&amp;quot;an5_only&amp;quot; nofailback=&amp;quot;0&amp;quot; ordered=&amp;quot;0&amp;quot; restricted=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
				&amp;lt;failoverdomainnode name=&amp;quot;an-node05.alteeve.com&amp;quot; priority=&amp;quot;1&amp;quot;/&amp;gt;&lt;br /&gt;
			&amp;lt;/failoverdomain&amp;gt;&lt;br /&gt;
			&amp;lt;failoverdomain name=&amp;quot;an4_primary&amp;quot; nofailback=&amp;quot;0&amp;quot; ordered=&amp;quot;1&amp;quot; restricted=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
				&amp;lt;failoverdomainnode name=&amp;quot;an-node04.alteeve.com&amp;quot; priority=&amp;quot;1&amp;quot;/&amp;gt;&lt;br /&gt;
				&amp;lt;failoverdomainnode name=&amp;quot;an-node05.alteeve.com&amp;quot; priority=&amp;quot;2&amp;quot;/&amp;gt;&lt;br /&gt;
			&amp;lt;/failoverdomain&amp;gt;&lt;br /&gt;
			&amp;lt;failoverdomain name=&amp;quot;an5_primary&amp;quot; nofailback=&amp;quot;0&amp;quot; ordered=&amp;quot;1&amp;quot; restricted=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
				&amp;lt;failoverdomainnode name=&amp;quot;an-node04.alteeve.com&amp;quot; priority=&amp;quot;2&amp;quot;/&amp;gt;&lt;br /&gt;
				&amp;lt;failoverdomainnode name=&amp;quot;an-node05.alteeve.com&amp;quot; priority=&amp;quot;1&amp;quot;/&amp;gt;&lt;br /&gt;
			&amp;lt;/failoverdomain&amp;gt;&lt;br /&gt;
		&amp;lt;/failoverdomains&amp;gt;&lt;br /&gt;
		&amp;lt;service autostart=&amp;quot;1&amp;quot; domain=&amp;quot;an4_only&amp;quot; exclusive=&amp;quot;0&amp;quot; max_restarts=&amp;quot;0&amp;quot; name=&amp;quot;an4_storage&amp;quot; recovery=&amp;quot;restart&amp;quot; restart_expire_time=&amp;quot;0&amp;quot;&amp;gt;&lt;br /&gt;
			&amp;lt;script ref=&amp;quot;drbd&amp;quot;&amp;gt;&lt;br /&gt;
				&amp;lt;script ref=&amp;quot;clvmd&amp;quot;&amp;gt;&lt;br /&gt;
					&amp;lt;script ref=&amp;quot;gfs2&amp;quot;/&amp;gt;&lt;br /&gt;
				&amp;lt;/script&amp;gt;&lt;br /&gt;
			&amp;lt;/script&amp;gt;&lt;br /&gt;
		&amp;lt;/service&amp;gt;&lt;br /&gt;
		&amp;lt;service autostart=&amp;quot;1&amp;quot; domain=&amp;quot;an5_only&amp;quot; exclusive=&amp;quot;0&amp;quot; max_restarts=&amp;quot;0&amp;quot; name=&amp;quot;an5_storage&amp;quot; recovery=&amp;quot;restart&amp;quot; restart_expire_time=&amp;quot;0&amp;quot;&amp;gt;&lt;br /&gt;
			&amp;lt;script ref=&amp;quot;drbd&amp;quot;&amp;gt;&lt;br /&gt;
				&amp;lt;script ref=&amp;quot;clvmd&amp;quot;&amp;gt;&lt;br /&gt;
					&amp;lt;script ref=&amp;quot;gfs2&amp;quot;/&amp;gt;&lt;br /&gt;
				&amp;lt;/script&amp;gt;&lt;br /&gt;
			&amp;lt;/script&amp;gt;&lt;br /&gt;
		&amp;lt;/service&amp;gt;&lt;br /&gt;
                &amp;lt;vm name=&amp;quot;vm0001_ws1&amp;quot; domain=&amp;quot;an4_primary&amp;quot; path=&amp;quot;/xen_shared/definitions/&amp;quot; autostart=&amp;quot;0&amp;quot; exclusive=&amp;quot;0&amp;quot; recovery=&amp;quot;restart&amp;quot; max_restarts=&amp;quot;2&amp;quot; restart_expire_time=&amp;quot;600&amp;quot;/&amp;gt;&lt;br /&gt;
                &amp;lt;vm name=&amp;quot;vm0002_win1&amp;quot; domain=&amp;quot;an5_primary&amp;quot; path=&amp;quot;/xen_shared/definitions/&amp;quot; autostart=&amp;quot;0&amp;quot; exclusive=&amp;quot;0&amp;quot; recovery=&amp;quot;restart&amp;quot; max_restarts=&amp;quot;2&amp;quot; restart_expire_time=&amp;quot;600&amp;quot;/&amp;gt;&lt;br /&gt;
        &amp;lt;/rm&amp;gt;&lt;br /&gt;
&amp;lt;/cluster&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;
/etc/cluster/cluster.conf validates&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;
ccs_tool update /etc/cluster/cluster.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;
Config file updated from version 15 to 16&lt;br /&gt;
&lt;br /&gt;
Update complete.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now stop and then start again &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt;. When it starts, you will not need to enable the storage resources, they will start automatically.&lt;br /&gt;
&lt;br /&gt;
== Complete! ==&lt;br /&gt;
&lt;br /&gt;
We&#039;re done.&lt;br /&gt;
&lt;br /&gt;
I hope you&#039;ve found this tutorial useful. If you have any feedback, criticism, corrections or comments, please let me know.&lt;br /&gt;
&lt;br /&gt;
-- [[Digimer]]&lt;br /&gt;
&lt;br /&gt;
= Common Administrative Tasks =&lt;br /&gt;
&lt;br /&gt;
This is far from a comprehensive list!&lt;br /&gt;
&lt;br /&gt;
This section will attempt to cover some of the day to day tasks you may want to perform on you cluster of VMs.&lt;br /&gt;
&lt;br /&gt;
== Enabling MTU Sizes Over 1500 Bytes ==&lt;br /&gt;
&lt;br /&gt;
{{warning|1=This requires the use of a kernel compiled outside of the main repos. For this reason, do not apply this unless you have a particular need for jumbo frames and are willing to take on the additional risk of installing and running an unsupported kernel.}}&lt;br /&gt;
&lt;br /&gt;
Currently, enabling MTU sizes over 1500 bytes requires compiling a new kernel and replacing/patching two Xen scripts. I&#039;ve made a pre-compiled kernel and the patched scripts available on [https://alteeve.com/xen https://alteeve.com/xen]. [[Red Hat]] bugzilla bugs have been filed, but they missed the window for being added to [[EL5]].7. They will be merged in for [[EL5]].8, but that is some time off.&lt;br /&gt;
&lt;br /&gt;
You can track the bug progress below:&lt;br /&gt;
* [https://bugzilla.redhat.com/show_bug.cgi?id=697021 Patch needed to allow MTU &amp;gt;1500 on vif prior to connecting to bridge]&lt;br /&gt;
* [https://bugzilla.redhat.com/show_bug.cgi?id=697310 Patch for xen-3.0.3 to support patch in BZ 697021]&lt;br /&gt;
&lt;br /&gt;
Below is a pretty ugly [[bash]] chain of commands that will download, install and copy into place everything needed to make jumbo frames work.&lt;br /&gt;
&lt;br /&gt;
{{note|1=The debug and devel packages for the kernel used below can be found here: https://alteeve.com/xen/RPMS/x86_64/}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cd /etc/xen/ &amp;amp;&amp;amp; \&lt;br /&gt;
	mv qemu-ifup qemu-ifup.orig &amp;amp;&amp;amp; \&lt;br /&gt;
	wget https://alteeve.com/xen/qemu-ifup &amp;amp;&amp;amp; \&lt;br /&gt;
	cd scripts/ &amp;amp;&amp;amp; \&lt;br /&gt;
	mv xen-network-common.sh xen-network-common.sh.orig &amp;amp;&amp;amp; \&lt;br /&gt;
	wget https://alteeve.com/xen/xen-network-common.sh &amp;amp;&amp;amp; \&lt;br /&gt;
	mv xen-network-common-bonding.sh xen-network-common-bonding.sh.orig &amp;amp;&amp;amp; \&lt;br /&gt;
	wget https://alteeve.com/xen/xen-network-common-bonding.sh &amp;amp;&amp;amp; \&lt;br /&gt;
	cd ~ &amp;amp;&amp;amp; \&lt;br /&gt;
	wget https://alteeve.com/xen/RPMS/x86_64/kernel-xen-2.6.18-238.9.3.el5.x86_64.rpm &amp;amp;&amp;amp; \&lt;br /&gt;
	wget https://alteeve.com/xen/RPMS/x86_64/kernel-2.6.18-238.9.3.el5.x86_64.rpm &amp;amp;&amp;amp; \&lt;br /&gt;
	rpm -ivh ~/kernel-* &amp;amp;&amp;amp; \&lt;br /&gt;
	echo &amp;quot;exclude=kernel*&amp;quot; &amp;gt;&amp;gt; /etc/yum.conf &amp;amp;&amp;amp; \&lt;br /&gt;
	echo &amp;quot;exclude=xen*&amp;quot; &amp;gt;&amp;gt; /etc/yum.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{note|1=Choosing a jumbo frame size larger that what is supported by your network interfaces and switches will cause networking to fail when the first large packet is sent. Consult your hardware documentation before setting an MTU size and remember to use the lowest size supported by all of your equipment. Note that some manufacturers will claim jumbo frame support when the actually only support ~4000 [[bytes]].}}&lt;br /&gt;
&lt;br /&gt;
Once this is done, you will need to reboot the use the new kernel. Before you do though, edit your &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/sysconfig/network-scripts/ifcfg-eth*&amp;lt;/span&amp;gt; files and add &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;MTU=xxxx&amp;lt;/span&amp;gt;, where &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xxxx&amp;lt;/span&amp;gt; is the frame size you want.&lt;br /&gt;
&lt;br /&gt;
Once set, you can reboot.&lt;br /&gt;
&lt;br /&gt;
{{note|1=Do not set the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;MTU=&amp;lt;/span&amp;gt; in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ifcfg-xenbrX&amp;lt;/span&amp;gt; configuration files. The bridges will always use the MTU of the lowest MTU device connected to it.}}&lt;br /&gt;
&lt;br /&gt;
On my system, my &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth0&amp;lt;/span&amp;gt; device has a maximum MTU of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;7200&amp;lt;/span&amp;gt; [[bytes]]. The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth1&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth2&amp;lt;/span&amp;gt; devices both support &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;9000&amp;lt;/span&amp;gt; [[bytes]], as does my switch. So my configuration files will be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/sysconfig/network-scripts/ifcfg-eth0&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;
# Realtek Semiconductor Co., Ltd. RTL8111/8168B PCI Express Gigabit Ethernet controller&lt;br /&gt;
HWADDR=48:5B:39:3C:53:14&lt;br /&gt;
DEVICE=eth0&lt;br /&gt;
BRIDGE=xenbr0&lt;br /&gt;
BOOTPROTO=static&lt;br /&gt;
ONBOOT=yes&lt;br /&gt;
MTU=7200&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/sysconfig/network-scripts/ifcfg-eth1&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;
# Intel Corporation 82574L Gigabit Network Connection&lt;br /&gt;
HWADDR=00:1B:21:72:9B:5A&lt;br /&gt;
DEVICE=eth1&lt;br /&gt;
BOOTPROTO=static&lt;br /&gt;
ONBOOT=yes&lt;br /&gt;
MTU=9000&lt;br /&gt;
IPADDR=192.168.2.74&lt;br /&gt;
NETMASK=255.255.255.0&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/sysconfig/network-scripts/ifcfg-eth2&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;
# Intel Corporation 82574L Gigabit Network Connection&lt;br /&gt;
HWADDR=00:1B:21:72:96:EA&lt;br /&gt;
DEVICE=eth2&lt;br /&gt;
BRIDGE=xenbr2&lt;br /&gt;
BOOTPROTO=static&lt;br /&gt;
ONBOOT=yes&lt;br /&gt;
MTU=9000&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Confirm that the newly installed &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;2.6.18-238.9.3.el5xen&amp;lt;/span&amp;gt; is set to boot by default.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cat /boot/grub/grub.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;
# grub.conf generated by anaconda&lt;br /&gt;
#&lt;br /&gt;
# Note that you do not have to rerun grub after making changes to this file&lt;br /&gt;
# NOTICE:  You have a /boot partition.  This means that&lt;br /&gt;
#          all kernel and initrd paths are relative to /boot/, eg.&lt;br /&gt;
#          root (hd0,0)&lt;br /&gt;
#          kernel /vmlinuz-version ro root=/dev/sda2&lt;br /&gt;
#          initrd /initrd-version.img&lt;br /&gt;
#boot=/dev/sda&lt;br /&gt;
default=1&lt;br /&gt;
timeout=5&lt;br /&gt;
splashimage=(hd0,0)/grub/splash.xpm.gz&lt;br /&gt;
hiddenmenu&lt;br /&gt;
title CentOS (2.6.18-238.9.3.el5)&lt;br /&gt;
	root (hd0,0)&lt;br /&gt;
	kernel /vmlinuz-2.6.18-238.9.3.el5 ro root=LABEL=/ dom0_mem=1024M&lt;br /&gt;
	initrd /initrd-2.6.18-238.9.3.el5.img&lt;br /&gt;
title CentOS (2.6.18-238.9.3.el5xen)&lt;br /&gt;
	root (hd0,0)&lt;br /&gt;
	kernel /xen.gz-2.6.18-238.9.3.el5&lt;br /&gt;
	module /vmlinuz-2.6.18-238.9.3.el5xen ro root=LABEL=/ dom0_mem=1024M&lt;br /&gt;
	module /initrd-2.6.18-238.9.3.el5xen.img&lt;br /&gt;
title CentOS (2.6.18-238.9.1.el5xen)&lt;br /&gt;
	root (hd0,0)&lt;br /&gt;
	kernel /xen.gz-2.6.18-238.9.1.el5&lt;br /&gt;
	module /vmlinuz-2.6.18-238.9.1.el5xen ro root=LABEL=/ dom0_mem=1024M&lt;br /&gt;
	module /initrd-2.6.18-238.9.1.el5xen.img&lt;br /&gt;
title CentOS (2.6.18-238.9.1.el5)&lt;br /&gt;
	root (hd0,0)&lt;br /&gt;
	kernel /vmlinuz-2.6.18-238.9.1.el5 ro root=LABEL=/ dom0_mem=1024M&lt;br /&gt;
	initrd /initrd-2.6.18-238.9.1.el5.img&lt;br /&gt;
title CentOS (2.6.18-238.el5xen)&lt;br /&gt;
	root (hd0,0)&lt;br /&gt;
	kernel /xen.gz-2.6.18-238.el5 &lt;br /&gt;
	module /vmlinuz-2.6.18-238.el5xen ro root=LABEL=/ rhgb quiet&lt;br /&gt;
	module /initrd-2.6.18-238.el5xen.img&lt;br /&gt;
title CentOS-base (2.6.18-238.el5)&lt;br /&gt;
	root (hd0,0)&lt;br /&gt;
	kernel /vmlinuz-2.6.18-238.el5 ro root=LABEL=/ rhgb quiet&lt;br /&gt;
	initrd /initrd-2.6.18-238.el5.img&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now reboot. When the nodes come back up, we should see the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xenbr0&amp;lt;/span&amp;gt; with an MTU of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;7200&amp;lt;/span&amp;gt;, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth1&amp;lt;/span&amp;gt; should have an MTU of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;9000&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xenbr2&amp;lt;/span&amp;gt; should also be at &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;9000&amp;lt;/span&amp;gt;. Note that we did not need to new kernel for &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth1&amp;lt;/span&amp;gt; as it&#039;s outside of Xen.&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;
          inet6 addr: fe80::4a5b:39ff:fe3c:5314/64 Scope:Link&lt;br /&gt;
          UP BROADCAST RUNNING MULTICAST  MTU:7200  Metric:1&lt;br /&gt;
          RX packets:263 errors:0 dropped:0 overruns:0 frame:0&lt;br /&gt;
          TX packets:164 errors:0 dropped:0 overruns:0 carrier:0&lt;br /&gt;
          collisions:0 txqueuelen:1000 &lt;br /&gt;
          RX bytes:46333 (45.2 KiB)  TX bytes:27403 (26.7 KiB)&lt;br /&gt;
          Interrupt:246 Base address:0xe000 &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:9000  Metric:1&lt;br /&gt;
          RX packets:122 errors:0 dropped:0 overruns:0 frame:0&lt;br /&gt;
          TX packets:49 errors:0 dropped:0 overruns:0 carrier:0&lt;br /&gt;
          collisions:0 txqueuelen:1000 &lt;br /&gt;
          RX bytes:25004 (24.4 KiB)  TX bytes:8658 (8.4 KiB)&lt;br /&gt;
          Interrupt:17 Memory:feae0000-feb00000 &lt;br /&gt;
&lt;br /&gt;
eth2      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 MULTICAST  MTU:9000  Metric:1&lt;br /&gt;
          RX packets:172 errors:0 dropped:0 overruns:0 frame:0&lt;br /&gt;
          TX packets:97 errors:0 dropped:0 overruns:0 carrier:0&lt;br /&gt;
          collisions:0 txqueuelen:1000 &lt;br /&gt;
          RX bytes:42769 (41.7 KiB)  TX bytes:28487 (27.8 KiB)&lt;br /&gt;
          Interrupt:16 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:10 errors:0 dropped:0 overruns:0 frame:0&lt;br /&gt;
          TX packets:10 errors:0 dropped:0 overruns:0 carrier:0&lt;br /&gt;
          collisions:0 txqueuelen:0 &lt;br /&gt;
          RX bytes:696 (696.0 b)  TX bytes:696 (696.0 b)&lt;br /&gt;
&lt;br /&gt;
xenbr0    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:7200  Metric:1&lt;br /&gt;
          RX packets:254 errors:0 dropped:0 overruns:0 frame:0&lt;br /&gt;
          TX packets:167 errors:0 dropped:0 overruns:0 carrier:0&lt;br /&gt;
          collisions:0 txqueuelen:0 &lt;br /&gt;
          RX bytes:41271 (40.3 KiB)  TX bytes:26870 (26.2 KiB)&lt;br /&gt;
&lt;br /&gt;
xenbr2    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:9000  Metric:1&lt;br /&gt;
          RX packets:153 errors:0 dropped:0 overruns:0 frame:0&lt;br /&gt;
          TX packets:88 errors:0 dropped:0 overruns:0 carrier:0&lt;br /&gt;
          collisions:0 txqueuelen:0 &lt;br /&gt;
          RX bytes:38585 (37.6 KiB)  TX bytes:24586 (24.0 KiB)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To test that the new MTU sizes are working, we can use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ping&amp;lt;/span&amp;gt; from the source node and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;tcpdump&amp;lt;/span&amp;gt; on the target node. This works because &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ping&amp;lt;/span&amp;gt; can define the size of the message and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;tcpdump&amp;lt;/span&amp;gt; will show how many packets were sent and returned.&lt;br /&gt;
&lt;br /&gt;
Let&#039;s test &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xenbr0&amp;lt;/span&amp;gt;, which we&#039;ve set to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;7200&amp;lt;/span&amp;gt;. To do this test, we&#039;ll first use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;tcpdump&amp;lt;/span&amp;gt; on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt; to listen to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth0&amp;lt;/span&amp;gt; for [[ICMP]] packets.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
tcpdump -i xenbr0 icmp&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode&lt;br /&gt;
listening on xenbr0, link-type EN10MB (Ethernet), capture size 96 bytes&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt;, we&#039;re going to send a single ping with a payload of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;7172&amp;lt;/span&amp;gt; bytes. This is because the ICMP packet has an overhead of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;28&amp;lt;/span&amp;gt; bytes. This means the full ping size will be &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;7200&amp;lt;/span&amp;gt; bytes total. This should result in the ping taking only one packet to and from the destination node.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ping -c 1 -s 7172 an-node05.ifn&lt;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-node05.ifn (192.168.1.75) 7172(7200) bytes of data.&lt;br /&gt;
7180 bytes from an-node05.ifn (192.168.1.75): icmp_seq=1 ttl=64 time=1.53 ms&lt;br /&gt;
&lt;br /&gt;
--- an-node05.ifn ping statistics ---&lt;br /&gt;
1 packets transmitted, 1 received, 0% packet loss, time 0ms&lt;br /&gt;
rtt min/avg/max/mdev = 1.534/1.534/1.534/0.000 ms&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Going back to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt;, we&#039;ll see that indeed the ping took just one packet for each direction of travel.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
23:02:14.045744 IP an-node04.ifn &amp;gt; an-node05.ifn: ICMP echo request, id 3859, seq 1, length 7180&lt;br /&gt;
23:02:14.046601 IP an-node05.ifn &amp;gt; an-node04.ifn: ICMP echo reply, id 3859, seq 1, length 7180&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If we try again, with a payload size of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;7173&amp;lt;/span&amp;gt; bytes, for a total of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;7201&amp;lt;/span&amp;gt; packet size, we&#039;ll see on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt; that two packets were needed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
23:07:18.091292 IP an-node04.ifn &amp;gt; an-node05.ifn: ICMP echo request, id 21779, seq 1, length 7181&lt;br /&gt;
23:07:18.092199 IP an-node05.ifn &amp;gt; an-node04.ifn: ICMP echo reply, id 21779, seq 1, length 7176&lt;br /&gt;
23:07:18.092242 IP an-node05.ifn &amp;gt; an-node04.ifn: icmp&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Perfect!&lt;br /&gt;
&lt;br /&gt;
== Renaming a Virtual Machine ==&lt;br /&gt;
&lt;br /&gt;
There may be times when you want to rename a VM domain. For example, if you provision a machine and then realize that you gave it a name that didn&#039;t describe it properly.&lt;br /&gt;
&lt;br /&gt;
Things to keep in mind before starting;&lt;br /&gt;
&lt;br /&gt;
* The new name of the VM &#039;&#039;&#039;must&#039;&#039;&#039; match the name of the definition file as well as the name of the VM service in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cluster.conf&amp;lt;/span&amp;gt;&lt;br /&gt;
* The VM will need to be shut down for the renaming process to succeed.&lt;br /&gt;
&lt;br /&gt;
At this time, the only way to rename a VM is:&lt;br /&gt;
&lt;br /&gt;
# Use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virsh dumpxml old_name &amp;gt; /xen_shared/definitions/new_name.xml&amp;lt;/span&amp;gt;.&lt;br /&gt;
# Shut down the VM with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virsh shutdown old_name&amp;lt;/span&amp;gt;.&lt;br /&gt;
# Edit the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/xen_shared/definitions/new_name.xml&amp;lt;/span&amp;gt; [[XML]] definition file and change &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;name&amp;gt;old_name&amp;lt;/name&amp;gt;&amp;lt;/span&amp;gt; to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;name&amp;gt;new_name&amp;lt;/name&amp;gt;&amp;lt;/span&amp;gt;.&lt;br /&gt;
# Undefine the VM using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virsh undefine old_name&amp;lt;/span&amp;gt; on all nodes.&lt;br /&gt;
# Redefine the VM using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virsh define /xen_shared/definitions/new_name.xml&amp;lt;/span&amp;gt; on all nodes.&lt;br /&gt;
# Update the cluster service name.&lt;br /&gt;
## Edit &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/cluster/cluster.conf&amp;lt;/span&amp;gt; and change &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;vm name=&amp;quot;old_name&amp;quot; ... /&amp;gt;&amp;lt;/span&amp;gt; to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;vm name=&amp;quot;new_name&amp;quot; ... /&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
## Increment the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;cluster ... config_version=&amp;quot;x&amp;quot;&amp;gt;&amp;lt;/span&amp;gt; attribute.&lt;br /&gt;
## Push the new cluster configuration using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ccs_tool update /etc/cluster/cluster.conf&amp;lt;/span&amp;gt;.&lt;br /&gt;
# Confirm that the new name is seen by both &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virsh list --all&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clustat&amp;lt;/span&amp;gt;.&lt;br /&gt;
# Start the VM back up.&lt;br /&gt;
&lt;br /&gt;
== Adding Space to a VM ==&lt;br /&gt;
&lt;br /&gt;
Here we will see what it takes to add a new 50 [[GiB]] LV to a VM as a second virtual hard drive.&lt;br /&gt;
&lt;br /&gt;
This process requires a few steps.&lt;br /&gt;
* Setting the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/drbd3&amp;lt;/span&amp;gt; resource as a new [[LVM]] [[PV]].&lt;br /&gt;
* Create a new [[VG]] called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;drbd_an4_vg1&amp;lt;/span&amp;gt;.&lt;br /&gt;
* Carve out a 50 [[GB]] [[LV]] called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0001_xvdb&amp;lt;/span&amp;gt;. &lt;br /&gt;
* Attach it to the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0001_ws1&amp;lt;/span&amp;gt;.&lt;br /&gt;
* Dumping the VM&#039;s updated configuration to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/xen_shared/definitions/vm0001_ws1.xml&amp;lt;/span&amp;gt;.&lt;br /&gt;
* Redefining the VM on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt; (assuming that it is currently running on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt;).&lt;br /&gt;
* Logging into the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0001_ws1&amp;lt;/span&amp;gt; VM, formatting the new space and adding the partition 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;
{{note|1=It is assumed that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0001_ws1&amp;lt;/span&amp;gt; is currently running on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt;. Unless stated otherwise, all the following commands should, thus, be run from &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt;.&amp;lt;br /&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
=== Creating a new PV, VG and LV ===&lt;br /&gt;
&lt;br /&gt;
Create the new [[PV]]:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
pvcreate /dev/drbd3 &lt;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/drbd3&amp;quot; successfully created&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Create the new [[VG]]:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vgcreate -c y --addtag @an-cluster01 drbd_an4_vg1 /dev/drbd3&lt;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;drbd_an4_vg1&amp;quot; successfully created&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Create the new [[LV]]:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
lvcreate -L 50G --addtag @an-cluster01 -n vm0001_xvdb /dev/drbd_an4_vg1&lt;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;vm0001_xvdb&amp;quot; created&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Attaching the new LV to the VM ===&lt;br /&gt;
&lt;br /&gt;
Attach the new LV to the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0001_ws1&amp;lt;/span&amp;gt; VM. This is done using the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virsh attach-disk&amp;lt;/span&amp;gt;. We&#039;ll tell &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virsh&amp;lt;/span&amp;gt; to attach the new LV and to create it as &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/xvdb&amp;lt;/span&amp;gt; within the VM.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
virsh attach-disk vm0001_ws1 /dev/drbd_an4_vg1/vm0001_xvdb xvdb&lt;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 attached successfully&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{note|1=Log in to the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0001_ws1&amp;lt;/span&amp;gt; VM and run the following commands there. Note that, in this tutorial, the VM&#039;s hostname has been changed to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0001_ws1&amp;lt;/span&amp;gt; and has been statically assigned to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;192.168.1.253&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;
ssh root@192.168.1.253&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
root@192.168.1.253&#039;s password: &lt;br /&gt;
Last login: Sun Apr  3 18:18:13 2011 from 192.168.1.102&lt;br /&gt;
[root@vm0001_ws1 ~]# &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Confirm that the new &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/xvdb&amp;lt;/span&amp;gt; device now exists.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
fdisk -l&lt;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/xvda: 10.7 GB, 10737418240 bytes&lt;br /&gt;
255 heads, 63 sectors/track, 1305 cylinders&lt;br /&gt;
Units = cylinders of 16065 * 512 = 8225280 bytes&lt;br /&gt;
&lt;br /&gt;
    Device Boot      Start         End      Blocks   Id  System&lt;br /&gt;
/dev/xvda1   *           1          33      265041   83  Linux&lt;br /&gt;
/dev/xvda2              34         164     1052257+  82  Linux swap / Solaris&lt;br /&gt;
/dev/xvda3             165        1305     9165082+  83  Linux&lt;br /&gt;
&lt;br /&gt;
Disk /dev/xvdb: 53.6 GB, 53687091200 bytes&lt;br /&gt;
255 heads, 63 sectors/track, 6527 cylinders&lt;br /&gt;
Units = cylinders of 16065 * 512 = 8225280 bytes&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Configuring the new Virtual Hard Drive in the VM ===&lt;br /&gt;
&lt;br /&gt;
From here on in, we&#039;ll be proceeding exactly the same as if we had added a real hard drive to a bare-iron server.&lt;br /&gt;
&lt;br /&gt;
Create a single partition out of the new space.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
fdisk /dev/xvdb&lt;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 contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel&lt;br /&gt;
Building a new DOS disklabel. Changes will remain in memory only,&lt;br /&gt;
until you decide to write them. After that, of course, the previous&lt;br /&gt;
content won&#039;t be recoverable.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The number of cylinders for this disk is set to 6527.&lt;br /&gt;
There is nothing wrong with that, but this is larger than 1024,&lt;br /&gt;
and could in certain setups cause problems with:&lt;br /&gt;
1) software that runs at boot time (e.g., old versions of LILO)&lt;br /&gt;
2) booting and partitioning software from other OSs&lt;br /&gt;
   (e.g., DOS FDISK, OS/2 FDISK)&lt;br /&gt;
Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)&lt;br /&gt;
&lt;br /&gt;
Command (m for help): n&lt;br /&gt;
Command action&lt;br /&gt;
   e   extended&lt;br /&gt;
   p   primary partition (1-4)&lt;br /&gt;
p&lt;br /&gt;
Partition number (1-4): 1&lt;br /&gt;
First cylinder (1-6527, default 1): &lt;br /&gt;
Using default value 1&lt;br /&gt;
Last cylinder or +size or +sizeM or +sizeK (1-6527, default 6527): &lt;br /&gt;
Using default value 6527&lt;br /&gt;
&lt;br /&gt;
Command (m for help): p&lt;br /&gt;
&lt;br /&gt;
Disk /dev/xvdb: 53.6 GB, 53687091200 bytes&lt;br /&gt;
255 heads, 63 sectors/track, 6527 cylinders&lt;br /&gt;
Units = cylinders of 16065 * 512 = 8225280 bytes&lt;br /&gt;
&lt;br /&gt;
    Device Boot      Start         End      Blocks   Id  System&lt;br /&gt;
/dev/xvdb1               1        6527    52428096   83  Linux&lt;br /&gt;
&lt;br /&gt;
Command (m for help): w&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;
Syncing disks.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{note|1=Unlike when we worked on the nodes, we do not need to reboot the VM to see the changes on the disk. This is not because it&#039;s a virtual server, but rather because the new virtual disk is not used by the OS.}}&lt;br /&gt;
&lt;br /&gt;
Now, format the new &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/xvdb1&amp;lt;/span&amp;gt; partition.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
mkfs.ext3 /dev/xvdb1 &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
mke2fs 1.39 (29-May-2006)&lt;br /&gt;
Filesystem label=&lt;br /&gt;
OS type: Linux&lt;br /&gt;
Block size=4096 (log=2)&lt;br /&gt;
Fragment size=4096 (log=2)&lt;br /&gt;
6553600 inodes, 13107024 blocks&lt;br /&gt;
655351 blocks (5.00%) reserved for the super user&lt;br /&gt;
First data block=0&lt;br /&gt;
Maximum filesystem blocks=4294967296&lt;br /&gt;
400 block groups&lt;br /&gt;
32768 blocks per group, 32768 fragments per group&lt;br /&gt;
16384 inodes per group&lt;br /&gt;
Superblock backups stored on blocks: &lt;br /&gt;
	32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208, &lt;br /&gt;
	4096000, 7962624, 11239424&lt;br /&gt;
&lt;br /&gt;
Writing inode tables: done                            &lt;br /&gt;
Creating journal (32768 blocks): done&lt;br /&gt;
Writing superblocks and filesystem accounting information: done&lt;br /&gt;
&lt;br /&gt;
This filesystem will be automatically checked every 32 mounts or&lt;br /&gt;
180 days, whichever comes first.  Use tune2fs -c or -i to override.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/var/www&amp;lt;/span&amp;gt; does not yet exist. If it doesn&#039;t, create it.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ls -lah /var/www&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
ls: /var/www: No such file or directory&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;
mkdir /var/www&lt;br /&gt;
ls -lah /var/www&lt;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 12K&lt;br /&gt;
drwxr-xr-x  2 root root 4.0K Apr  3 23:01 .&lt;br /&gt;
drwxr-xr-x 21 root root 4.0K Apr  3 23:01 ..&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Mount the newly formatted partition.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
mount /dev/xvdb1 /var/www/&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/xvda3            8.5G  2.0G  6.1G  25% /&lt;br /&gt;
/dev/xvda1            251M   25M  214M  11% /boot&lt;br /&gt;
tmpfs                 524M     0  524M   0% /dev/shm&lt;br /&gt;
/dev/xvdb1             50G  180M   47G   1% /var/www&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Add the new partition to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/fstab&amp;lt;/span&amp;gt; so that the partition mounts on boot.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
echo &amp;quot;/dev/xvdb1              /var/www                ext3    defaults        1 3&amp;quot; &amp;gt;&amp;gt; /etc/fstab&lt;br /&gt;
cat /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;
LABEL=/                 /                       ext3    defaults        1 1&lt;br /&gt;
LABEL=/boot             /boot                   ext3    defaults        1 2&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;
LABEL=SWAP-xvda2        swap                    swap    defaults        0 0&lt;br /&gt;
/dev/xvdb1              /var/www                ext3    defaults        1 3&lt;br /&gt;
&amp;lt;/source&amp;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 please don&#039;t pay it too much mind. They&#039;ll be happy to talk to you directly. :)&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 &#039;&#039;&#039;Lon Hohberger&#039;&#039;&#039;, lon at fedoraproject.org, for the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; help. He also provided some excellent feedback on the first release (see [https://alteeve.com/index.php?title=Red_Hat_Cluster_Service_2_Tutorial&amp;amp;action=historysubmit&amp;amp;diff=3456&amp;amp;oldid=3455 here])&lt;br /&gt;
* To [http://dk.linkedin.com/in/fabbione Fabio Massimo Di Nitto] for helping me get caught up with clustering and VMs on FC13.&lt;br /&gt;
&lt;br /&gt;
{{footer}}&lt;/div&gt;</summary>
		<author><name>Kiwi</name></author>
	</entry>
	<entry>
		<id>https://alteeve.com/w/index.php?title=Red_Hat_Cluster_Service_2_Tutorial_-_Archive&amp;diff=3598</id>
		<title>Red Hat Cluster Service 2 Tutorial - Archive</title>
		<link rel="alternate" type="text/html" href="https://alteeve.com/w/index.php?title=Red_Hat_Cluster_Service_2_Tutorial_-_Archive&amp;diff=3598"/>
		<updated>2011-08-22T15:03:07Z</updated>

		<summary type="html">&lt;p&gt;Kiwi: /* Component; CLVM */ s/out/our/&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{howto_header}}&lt;br /&gt;
&lt;br /&gt;
This paper has one goal;&lt;br /&gt;
&lt;br /&gt;
* Creating a 2-node, high-availability cluster hosting [[Xen]] virtual machines using [[RHCS]] &amp;quot;stable 2&amp;quot; with [[DRBD]] and clustered [[LVM]] for synchronizing storage data.&lt;br /&gt;
&lt;br /&gt;
We&#039;ll create a dedicated firewall VM to isolate and protect the VM network, discuss provisioning and maintaining Xen VMs, explore some basics of daily administration of a VM cluster and test various failures and how to recover from them.&lt;br /&gt;
&lt;br /&gt;
Grab a coffee, a comfy chair, put on some nice music and settle in for some geekly fun.&lt;br /&gt;
&lt;br /&gt;
= The Task Ahead =&lt;br /&gt;
&lt;br /&gt;
Before we start, let&#039;s take a few minutes to discuss clustering and it&#039;s complexities.&lt;br /&gt;
&lt;br /&gt;
== Technologies We Will Use ==&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;Enterprise Linux 5&#039;&#039;; specifically we will be using [[CentOS]] v5.6.&lt;br /&gt;
* &#039;&#039;Red Hat Cluster Services&#039;&#039; &amp;quot;Stable&amp;quot; version 2. This describes the following core components:&lt;br /&gt;
** &#039;&#039;OpenAIS&#039;&#039;; Provides cluster communications using the [[totem]] protocol.&lt;br /&gt;
** &#039;&#039;Cluster Manager&#039;&#039; (&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[cman]]&amp;lt;/span&amp;gt;); Manages the starting, stopping and managing of the cluster.&lt;br /&gt;
** &#039;&#039;Resource Manager&#039;&#039; (&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[rgmanager]]&amp;lt;/span&amp;gt;); Manages cluster resources and services. Handles service recovery during failures.&lt;br /&gt;
** &#039;&#039;Cluster Logical Volume Manager&#039;&#039; (&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[clvm]]&amp;lt;/span&amp;gt;); Cluster-aware (disk) volume manager. Backs [[GFS2]] [[filesystem]]s and [[Xen]] virtual machines.&lt;br /&gt;
** &#039;&#039;Global File Systems&#039;&#039; version 2 (&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[gfs2]]&amp;lt;/span&amp;gt;); Cluster-aware, concurrently mountable file system.&lt;br /&gt;
* &#039;&#039;Distributed Redundant Block Device&#039;&#039; ([[DRBD]]); Keeps shared data synchronized across cluster nodes.&lt;br /&gt;
* &#039;&#039;Xen&#039;&#039;; [[Hypervisor]] that controls and supports virtual machines.&lt;br /&gt;
&lt;br /&gt;
== A Note on Patience ==&lt;br /&gt;
&lt;br /&gt;
There is nothing inherently hard about clustering. However, there are many components that you need to understand before you can begin. The result is that clustering has an inherently steep learning curve.&lt;br /&gt;
&lt;br /&gt;
You &#039;&#039;&#039;must&#039;&#039;&#039; have patience. Lots of it.&lt;br /&gt;
&lt;br /&gt;
Many technologies can be learned by creating a very simple base and then building on it. The classic &amp;quot;Hello, World!&amp;quot; script created when first learning a programming language is an example of this. Unfortunately, there is no real analog to this in clustering. Even the most basic cluster requires several pieces be in place and working together. If you try to rush by ignoring pieces you think are not important, you will almost certainly waste time. A good example is setting aside [[fencing]], thinking that your test cluster&#039;s data isn&#039;t important. The cluster software has no concept of &amp;quot;test&amp;quot;. It treats everything as critical all the time and &#039;&#039;will&#039;&#039; shut down if anything goes wrong.&lt;br /&gt;
&lt;br /&gt;
Take your time, work through these steps, and you will have the foundation cluster sooner than you realize. Clustering is fun &#039;&#039;&#039;because&#039;&#039;&#039; it is a challenge.&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
&lt;br /&gt;
It is assumed that you are familiar with Linux systems administration, specifically [[Red Hat]] [[EL|Enterprise Linux]] and its derivatives. You will need to have somewhat advanced networking experience as well. You should be comfortable working in a terminal (directly or over &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[ssh]]&amp;lt;/span&amp;gt;). Familiarity with [[XML]] will help, but is not terribly required as it&#039;s use here is pretty self-evident.&lt;br /&gt;
&lt;br /&gt;
If you feel a little out of depth at times, don&#039;t hesitate to set this tutorial aside. Branch over to the components you feel the need to study more, then return and continue on. Finally, and perhaps most importantly, you &#039;&#039;&#039;must&#039;&#039;&#039; have patience! If you have a manager asking you to &amp;quot;go live&amp;quot; with a cluster in a month, tell him or her that it simply won&#039;t happen. If you rush, you will skip important points and &#039;&#039;&#039;you will fail&#039;&#039;&#039;. Patience is vastly more important than any pre-existing skill. &lt;br /&gt;
&lt;br /&gt;
== Focus and Goal ==&lt;br /&gt;
&lt;br /&gt;
There is a different cluster for every problem. Generally speaking though, there are two main problems that clusters try to resolve; Performance and High Availability. Performance clusters are generally tailored to the application requiring the performance increase. There are some general tools for performance clustering, like [[Red Hat]]&#039;s [[LVS]] (Linux Virtual Server) for load-balancing common applications like the [[Apache]] web-server. &lt;br /&gt;
&lt;br /&gt;
This tutorial will focus on High Availability clustering, often shortened to simply &#039;&#039;&#039;HA&#039;&#039;&#039; and not to be confused with the [[Linux-HA]] &amp;quot;heartbeat&amp;quot; cluster suite, which we will not be using here. The cluster will provide a shared file systems and will provide for the high availability on [[Xen]]-based virtual servers. The goal will be to have the virtual servers live-migrate during planned node outages and automatically restart on a surviving node when the original host node fails.&lt;br /&gt;
&lt;br /&gt;
Below is a &#039;&#039;very&#039;&#039; brief overview;&lt;br /&gt;
&lt;br /&gt;
High Availability clusters like ours have two main parts; Cluster management and resource management.&lt;br /&gt;
&lt;br /&gt;
The cluster itself is responsible for maintaining the cluster nodes in a group. This group is part of a &amp;quot;Closed Process Group&amp;quot;, or [[CPG]]. When a node fails, the cluster manager must detect the failure, reliably eject the node from the cluster using fencing and then reform the CPG. Each time the cluster changes, or &amp;quot;re-forms&amp;quot;, the resource manager is called. The resource manager checks to see how the cluster changed, consults it&#039;s configuration and determines what to do, if anything.&lt;br /&gt;
&lt;br /&gt;
The details of all this will be discussed in detail a little later on. For now, it&#039;s sufficient to have in mind these two major roles and understand that they are somewhat independent entities.&lt;br /&gt;
&lt;br /&gt;
== Platform ==&lt;br /&gt;
&lt;br /&gt;
This tutorial was written using [[CentOS]] version 5.6, [[x86_64]]. No attempt was made to test on [[i686]] or other [[EL5]] derivatives. That said, there is no reason to believe that this tutorial will not apply to any variant. As much as possible, the language will be distro-agnostic. For reasons of memory constraints, it is advised that you use an [[x86_64]] (64-[[bit]]) platform if at all possible.&lt;br /&gt;
&lt;br /&gt;
Do note that as of [[EL5]].4 and above, significant changes were made to how [[RHCS]] handles virtual machines. It is strongly advised that you use at least version 5.4 or newer while working with this tutorial.&lt;br /&gt;
&lt;br /&gt;
== A Word On Complexity ==&lt;br /&gt;
&lt;br /&gt;
Introducing the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Fabbione Principle&amp;lt;/span&amp;gt; (aka: &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fabimer theory&amp;lt;/span&amp;gt;):&lt;br /&gt;
&lt;br /&gt;
Clustering is not inherently hard, but it is inherently complex. Consider;&lt;br /&gt;
&lt;br /&gt;
* Any given program has &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;N&amp;lt;/span&amp;gt; bugs.&lt;br /&gt;
** [[RHCS]] uses; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt;, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;openais&amp;lt;/span&amp;gt;, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;totem&amp;lt;/span&amp;gt;, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fenced&amp;lt;/span&amp;gt;, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;dlm&amp;lt;/span&amp;gt;.&lt;br /&gt;
** We will be adding &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;GFS2&amp;lt;/span&amp;gt;, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;CLVM&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Xen&amp;lt;/span&amp;gt;.&lt;br /&gt;
** Right there, we have &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;N^10&amp;lt;/span&amp;gt; possible bugs. We&#039;ll call this &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;A&amp;lt;/span&amp;gt;.&lt;br /&gt;
* A cluster has &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Y&amp;lt;/span&amp;gt; nodes.&lt;br /&gt;
** In our case, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;2&amp;lt;/span&amp;gt; nodes, each with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;3&amp;lt;/span&amp;gt; networks.&lt;br /&gt;
** The network infrastructure (Switches, routers, etc). If you use managed switches, add another layer of complexity.&lt;br /&gt;
** This gives us another &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Y^(2*3)&amp;lt;/span&amp;gt;, and then &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;^2&amp;lt;/span&amp;gt; again for managed switches. We&#039;ll call this &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;B&amp;lt;/span&amp;gt;.&lt;br /&gt;
* Let&#039;s add the human factor. Let&#039;s say that a person needs roughly 5 years of cluster experience to be considered an expert. For each year less than this, add a &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Z&amp;lt;/span&amp;gt; &amp;quot;oops&amp;quot; factor, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;(5-Z)^2&amp;lt;/span&amp;gt;. We&#039;ll call this &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;C&amp;lt;/span&amp;gt;.&lt;br /&gt;
* So, finally, add up the complexity, using this tutorial&#039;s layout, 0-years of experience and managed switches.&lt;br /&gt;
** &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;(N^10) * (Y^(2*3)^2) * ((5-0)^2) == (A * B * C)&amp;lt;/span&amp;gt; == an-unknown-but-big-number.&lt;br /&gt;
&lt;br /&gt;
This isn&#039;t meant to scare you away, but it is meant to be a sobering statement. Obviously, those numbers are somewhat artificial, but the point remains.&lt;br /&gt;
&lt;br /&gt;
Any one piece is easy to understand, thus, clustering is inherently easy. However, given the large number of variables, you must really understand all the pieces and how they work together. &#039;&#039;&#039;&#039;&#039;DO NOT&#039;&#039;&#039;&#039;&#039; think that you will have this mastered and working in a month. Certainly don&#039;t try to sell clusters as a service without a &#039;&#039;lot&#039;&#039; of internal testing.&lt;br /&gt;
&lt;br /&gt;
Clustering is kind of like chess. The rules are pretty straight forward, but the complexity can take some time to master.&lt;br /&gt;
&lt;br /&gt;
= Overview of Components =&lt;br /&gt;
&lt;br /&gt;
When looking at a cluster, there is a tendency to want to dive right into the configuration file. That is not very useful in clustering.&lt;br /&gt;
&lt;br /&gt;
* When you look at the configuration file, it is quite short.&lt;br /&gt;
&lt;br /&gt;
It isn&#039;t like most applications or technologies though. Most of us learn by taking something, like a configuration file, and tweaking it this way and that to see what happens. I tried that with clustering and learned only what it was like to bang my head against the wall.&lt;br /&gt;
&lt;br /&gt;
* Understanding the parts and how they work together is critical.&lt;br /&gt;
&lt;br /&gt;
You will find that the discussion on the components of clustering, and how those components and concepts interact, will be much longer than the initial configuration. It is true that we could talk very briefly about the actual syntax, but it would be a disservice. Please, don&#039;t rush through the next section or, worse, skip it and go right to the configuration. You will waste far more time than you will save.&lt;br /&gt;
&lt;br /&gt;
* Clustering is easy, but it has a complex web of inter-connectivity. You must grasp this network if you want to be an effective cluster administrator!&lt;br /&gt;
&lt;br /&gt;
== Component; cman ==&lt;br /&gt;
&lt;br /&gt;
This was, traditionally, the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;c&amp;lt;/span&amp;gt;luster &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;man&amp;lt;/span&amp;gt;ager. In the 3.0 series, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt; acts mainly as a [[quorum]] provider, tallying votes and deciding on a critical property of the cluster: quorum. In the 3.1 series, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt; will be removed entirely.&lt;br /&gt;
&lt;br /&gt;
== Component; openais / corosync ==&lt;br /&gt;
&lt;br /&gt;
OpenAIS is the heart of the cluster. All other computers operate though this component, and no cluster component can work without it. Further, it is shared between both Pacemaker and RHCS clusters.&lt;br /&gt;
&lt;br /&gt;
In Red Hat clusters, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;openais&amp;lt;/span&amp;gt; is configured via the central &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cluster.conf&amp;lt;/span&amp;gt; file. In Pacemaker clusters, it is configured directly in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;openais.conf&amp;lt;/span&amp;gt;. As we will be building an RHCS, we will only use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cluster.conf&amp;lt;/span&amp;gt;. That said, (almost?) all &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;openais.conf&amp;lt;/span&amp;gt; options are available in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cluster.conf&amp;lt;/span&amp;gt;. This is important to note as you will see references to both configuration files when searching the Internet.&lt;br /&gt;
&lt;br /&gt;
=== A Little History ===&lt;br /&gt;
&lt;br /&gt;
There were significant changes between [[RHCS]] version 2, which we are using, and version 3 available on [[EL6]] and recent [[Fedora]]s.&lt;br /&gt;
&lt;br /&gt;
In the RHCS version 2, there was a component called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;openais&amp;lt;/span&amp;gt; which handled &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;totem&amp;lt;/span&amp;gt;. The OpenAIS project was designed to be the heart of the cluster and was based around the [http://www.saforum.org/ Service Availability Forum]&#039;s [http://www.saforum.org/Application-Interface-Specification~217404~16627.htm Application Interface Specification]. AIS is an open [[API]] designed to provide inter-operable high availability services.&lt;br /&gt;
&lt;br /&gt;
In 2008, it was decided that the AIS specification was overkill for most clustered applications being developed in the open source community.  At that point, OpenAIS was split in to two projects: Corosync and OpenAIS. The former, Corosync, provides cluster membership, messaging, and basic APIs for use by clustered applications, while the OpenAIS project is specifically designed to act as an optional add-on to corosync for users who want AIS functionality.&lt;br /&gt;
&lt;br /&gt;
You will see a lot of references to OpenAIS while searching the web for information on clustering. Understanding it&#039;s evolution will hopefully help you avoid confusion.&lt;br /&gt;
&lt;br /&gt;
== Concept; quorum ==&lt;br /&gt;
&lt;br /&gt;
[[Quorum]] is defined as the minimum set of hosts required in order to provide service and is used to prevent split-brain situations.&lt;br /&gt;
&lt;br /&gt;
The quorum algorithm used by the RHCS cluster is called &amp;quot;simple majority quorum&amp;quot;, which means that more than half of the hosts must be online and communicating in order to provide service. While simple majority quorum a very common quorum algorithm, other quorum algorithms exist ([[grid quorum]], [[YKD Dyanamic Linear Voting]], etc.).&lt;br /&gt;
&lt;br /&gt;
The idea behind quorum is that, which ever group of machines has it, can safely start clustered services even when defined members are not accessible.&lt;br /&gt;
&lt;br /&gt;
Take this scenario;&lt;br /&gt;
&lt;br /&gt;
* You have a cluster of four nodes, each with one vote.&lt;br /&gt;
** The cluster&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;expected_votes&amp;lt;/span&amp;gt; is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;4&amp;lt;/span&amp;gt;. A clear majority, in this case, is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;3&amp;lt;/span&amp;gt; because &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;(4/2)+1&amp;lt;/span&amp;gt;, rounded down, is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;3&amp;lt;/span&amp;gt;.&lt;br /&gt;
** Now imagine that there is a failure in the network equipment and one of the nodes disconnects from the rest of the cluster.&lt;br /&gt;
** You now have two partitions; One partition contains three machines and the other partition has one.&lt;br /&gt;
** The three machines will have quorum, and the other machine will lose quorum.&lt;br /&gt;
** The partition with quorum will reconfigure and continue to provide cluster services.&lt;br /&gt;
** The partition without quorum will withdraw from the cluster and shut down all cluster services.&lt;br /&gt;
&lt;br /&gt;
When the cluster reconfigures and the partition wins quorum, it will fence the node(s) in the partition without quorum. Once the fencing hes been confirmed successful, the partition with quorum will begin accessing clustered resources, like shared filesystems, thus guaranteeing the safety of those shared resources.&lt;br /&gt;
&lt;br /&gt;
This also helps explain why an even &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;50%&amp;lt;/span&amp;gt; is not enough to have quorum, a common question for people new to clustering. Using the above scenario, imagine if the split were 2 and 2 nodes. Because either can&#039;t be sure what the other would do, neither can safely proceed. If we allowed an even 50% to have quorum, both partition might try to take over the clustered services and disaster would soon follow.&lt;br /&gt;
&lt;br /&gt;
There is one, and &#039;&#039;&#039;only&#039;&#039;&#039; one except to this rule.&lt;br /&gt;
&lt;br /&gt;
In the case of a two node cluster, as we will be building here, any failure results in a 50/50 split. If we enforced quorum in a two-node cluster, there would never be high availability because and failure would cause both nodes to withdraw. The risk with this exception is that we now place the entire safety of the cluster on [[fencing]], a concept we will cover in a second. Fencing is a second line of defense and something we are loath to rely on alone.&lt;br /&gt;
&lt;br /&gt;
Even in a two-node cluster though, proper quorum can be maintained by using a quorum disk, called a [[qdisk]]. Unfortunately, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;qdisk&amp;lt;/span&amp;gt; on a [[DRBD]] resource comes with it&#039;s own problems, so we will not be able to use it here.&lt;br /&gt;
&lt;br /&gt;
== Concept; Virtual Synchrony ==&lt;br /&gt;
&lt;br /&gt;
All cluster operations, like fencing, distributed locking and so on, have to occur in the same order across all nodes. This concept is called &amp;quot;virtual synchrony&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
This is provided by &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;openais&amp;lt;/span&amp;gt; using &amp;quot;closed process groups&amp;quot;, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[CPG]]&amp;lt;/span&amp;gt;. A closed process group is simply a private group of processes in a cluster. Within this closed group, all messages are ordered and consistent.&lt;br /&gt;
&lt;br /&gt;
Let&#039;s look at how locks are handled on clustered file systems as an example.&lt;br /&gt;
&lt;br /&gt;
* As various nodes want to work on files, they send a lock request to the cluster. When they are done, they send a lock release to the cluster.&lt;br /&gt;
** Lock and unlock messages must arrive in the same order to all nodes, regardless of the real chronological order that they were issued.&lt;br /&gt;
* Let&#039;s say one node sends out messages &amp;quot;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;a1 a2 a3 a4&amp;lt;/span&amp;gt;&amp;quot;. Meanwhile, the other node sends out &amp;quot;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;b1 b2 b3 b4&amp;lt;/span&amp;gt;&amp;quot;.&lt;br /&gt;
** All of these messages go to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;openais&amp;lt;/span&amp;gt; which gathers them up, puts them into an order and then sends them out in that order.&lt;br /&gt;
** It is totally possible that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;openais&amp;lt;/span&amp;gt; will get the messages as &amp;quot;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;a2 b1 b2 a1 b4 a3 a4 b4&amp;lt;/span&amp;gt;&amp;quot;. What order is used is not important, only that the order is consistent across all nodes.&lt;br /&gt;
** The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;openais&amp;lt;/span&amp;gt; application will then ensure that all nodes get the messages in the above order, one at a time. All nodes must confirm that they got a given message before the next message is sent to any node.&lt;br /&gt;
&lt;br /&gt;
All of this ordering, within the closed process group, is &amp;quot;virtual synchrony&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
This will tie into fencing and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;totem&amp;lt;/span&amp;gt;, as we&#039;ll see in the next sections.&lt;br /&gt;
&lt;br /&gt;
== Concept; Fencing ==&lt;br /&gt;
&lt;br /&gt;
Fencing is a &#039;&#039;&#039;absolutely critical&#039;&#039;&#039; part of clustering. Without &#039;&#039;&#039;fully&#039;&#039;&#039; working fence devices, &#039;&#039;&#039;&#039;&#039;your cluster will fail&#039;&#039;&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Was that strong enough, or should I say that again? Let&#039;s be safe:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;DO NOT BUILD A CLUSTER WITHOUT PROPER, WORKING AND TESTED FENCING&#039;&#039;&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Sorry, I promise that this will be the only time that I speak so strongly. Fencing really is critical, and explaining the need for fencing is nearly a weekly event. &lt;br /&gt;
&lt;br /&gt;
So then, let&#039;s discuss fencing.&lt;br /&gt;
&lt;br /&gt;
When a node stops responding, an internal timeout and counter start ticking away. During this time, no messages are moving through the cluster because virtual synchrony is no longer possible and the cluster is, essentially, hung. If the node responds in time, the timeout and counter reset and the cluster begins operating properly again. &lt;br /&gt;
&lt;br /&gt;
If, on the other hand, the node does not respond in time, the node will be declared dead and the process of ejecting it from the cluster begins. &lt;br /&gt;
&lt;br /&gt;
The cluster will take a &amp;quot;head count&amp;quot; to see which nodes it still has contact with and will determine then if there are enough votes from those nodes to have quorum. If you are using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[qdisk]]&amp;lt;/span&amp;gt;, it&#039;s heuristics will run and then it&#039;s votes will be added. If there is sufficient votes for quorum, the cluster will issue a &amp;quot;fence&amp;quot; against the lost node. A fence action is a call sent to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fenced&amp;lt;/span&amp;gt;, the fence daemon. &lt;br /&gt;
&lt;br /&gt;
Which physical node sends the fence call is somewhat random and irrelevant. What matters is that the call comes from the [[CPG]] which has quorum.&lt;br /&gt;
&lt;br /&gt;
The fence daemon will look at the cluster configuration and get the fence devices configured for the dead node. Then, one at a time and in the order that they appear in the configuration, the fence daemon will call those fence devices, via their fence agents, passing to the fence agent any configured arguments like username, password, port number and so on. If the first fence agent returns a failure, the next fence agent will be called. If the second fails, the third will be called, then the forth and so on. Once the last (or perhaps only) fence device fails, the fence daemon will retry again, starting back at the start of the list. It will do this indefinitely until one of the fence devices success.&lt;br /&gt;
&lt;br /&gt;
Here&#039;s the flow, in point form:&lt;br /&gt;
&lt;br /&gt;
* The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;openais&amp;lt;/span&amp;gt; program collects messages and sends them off, one at a time, to all nodes.&lt;br /&gt;
* All nodes respond, and the next message is sent. Repeat continuously during normal operation.&lt;br /&gt;
* Suddenly, one node stops responding.&lt;br /&gt;
** Communication freezes while the cluster waits for the silent node. &lt;br /&gt;
** A timeout starts (~&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;238&amp;lt;/span&amp;gt;ms by default), and each time the timeout is hit, and error counter increments.&lt;br /&gt;
** The silent node responds before the counter reaches the limit.&lt;br /&gt;
*** The counter is reset to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;0&amp;lt;/span&amp;gt;&lt;br /&gt;
*** The cluster operates normally again.&lt;br /&gt;
* Again, one node stops responding.&lt;br /&gt;
** Again, the timeout begins. As each totem packet times out, a new packet is sent and the error count increments.&lt;br /&gt;
** The error counts exceed the limit (&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;4&amp;lt;/span&amp;gt; errors is the default); Roughly one second has passed (&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;238ms * 4&amp;lt;/span&amp;gt; plus some overhead).&lt;br /&gt;
** The node is declared dead.&lt;br /&gt;
** The cluster checks which members it still has, and if that provides enough votes for quorum.&lt;br /&gt;
*** If there are too few votes for quorum, the cluster software freezes and the node(s) withdraw from the cluster.&lt;br /&gt;
*** If there are enough votes for quorum, the silent node is declared dead.&lt;br /&gt;
**** &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;openais&amp;lt;/span&amp;gt; calls &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fenced&amp;lt;/span&amp;gt;, telling it to fence the node.&lt;br /&gt;
**** Which fence device(s) to use, that is, what &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fence_agent&amp;lt;/span&amp;gt; to call and what arguments to pass, is gathered.&lt;br /&gt;
**** For each configured fence device:&lt;br /&gt;
***** The agent is called and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fenced&amp;lt;/span&amp;gt; waits for the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fence_agent&amp;lt;/span&amp;gt; to exit.&lt;br /&gt;
***** The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fence_agent&amp;lt;/span&amp;gt;&#039;s exit code is examined. If it&#039;s a success, recovery starts. If it failed, the next configured fence agent is called.&lt;br /&gt;
**** If all (or the only) configured fence fails, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fenced&amp;lt;/span&amp;gt; will start over.&lt;br /&gt;
**** &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fenced&amp;lt;/span&amp;gt; will wait and loop forever until a fence agent succeeds. During this time, &#039;&#039;&#039;the cluster is hung&#039;&#039;&#039;.&lt;br /&gt;
** Once a &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fence_agent&amp;lt;/span&amp;gt; succeeds, the cluster is reconfigured.&lt;br /&gt;
*** A new closed process group (&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cpg&amp;lt;/span&amp;gt;) is formed.&lt;br /&gt;
*** A new fence domain is formed.&lt;br /&gt;
*** Lost cluster resources are recovered as per &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt;&#039;s configuration (including file system recovery as needed).&lt;br /&gt;
*** Normal cluster operation is restored.&lt;br /&gt;
&lt;br /&gt;
This skipped a few key things, but the general flow of logic should be there.&lt;br /&gt;
&lt;br /&gt;
This is why fencing is so important. Without a properly configured and tested fence device or devices, the cluster will never successfully fence and the cluster will stay hung forever.&lt;br /&gt;
&lt;br /&gt;
== Component; totem ==&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[totem]]&amp;lt;/span&amp;gt; protocol defines message passing within the cluster and it is used by &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;openais&amp;lt;/span&amp;gt;. A token is passed around all the nodes in the cluster, and the timeout discussed in [[Red_Hat_Cluster_Service_3_Tutorial#Concept;_Fencing|fencing]] above is actually a token timeout. The counter, then, is the number of lost tokens that are allowed before a node is considered dead.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;totem&amp;lt;/span&amp;gt; protocol supports something called &#039;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rrp&amp;lt;/span&amp;gt;&#039;, &#039;&#039;&#039;R&#039;&#039;&#039;edundant &#039;&#039;&#039;R&#039;&#039;&#039;ing &#039;&#039;&#039;P&#039;&#039;&#039;rotocol. Through &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rrp&amp;lt;/span&amp;gt;, you can add a second backup ring on a separate network to take over in the event of a failure in the first ring. In RHCS, these rings are known as &amp;quot;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ring 0&amp;lt;/span&amp;gt;&amp;quot; and &amp;quot;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ring 1&amp;lt;/span&amp;gt;&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
== Component; rgmanager ==&lt;br /&gt;
&lt;br /&gt;
When the cluster membership changes, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;openais&amp;lt;/span&amp;gt; tells the cluster that it needs to recheck it&#039;s resources. This causes &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt;, the resource group manager, to run. It will examine what changed and then will start, stop, migrate or recover cluster resources as needed.&lt;br /&gt;
&lt;br /&gt;
Within &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt;, one or more &#039;&#039;resources&#039;&#039; are brought together as a &#039;&#039;service&#039;&#039;. This service is then optionally assigned to a &#039;&#039;failover domain&#039;&#039;, an subset of nodes that can have preferential ordering.&lt;br /&gt;
&lt;br /&gt;
== Component; qdisk ==&lt;br /&gt;
&lt;br /&gt;
{{note|1=&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;qdisk&amp;lt;/span&amp;gt; does not work reliably on a DRBD resource, so we will not be using it in this tutorial.}}&lt;br /&gt;
&lt;br /&gt;
A Quorum disk, known as a &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;qdisk&amp;lt;/span&amp;gt; is small partition on [[SAN]] storage used to enhance quorum. It generally carries enough votes to allow even a single node to take quorum during a cluster partition. It does this by using configured heuristics, that is custom tests, to decided which which node or partition is best suited for providing clustered services during a cluster reconfiguration. These heuristics can be simple, like testing which partition has access to a given router, or they can be as complex as the administrator wishes using custom scripts.&lt;br /&gt;
&lt;br /&gt;
Though we won&#039;t be using it here, it is well worth knowing about when you move to a cluster with [[SAN]] storage.&lt;br /&gt;
&lt;br /&gt;
== Component; DRBD ==&lt;br /&gt;
&lt;br /&gt;
[[DRBD]]; Distributed Replicating Block Device, is a technology that takes raw storage from two or more nodes and keeps their data synchronized in real time. It is sometimes described as &amp;quot;RAID 1 over Nodes&amp;quot;, and that is conceptually accurate. In this tutorial&#039;s cluster, DRBD will be used to provide that back-end storage as a cost-effective alternative to a tranditional [[SAN]] or [[iSCSI]] device.&lt;br /&gt;
&lt;br /&gt;
To help visualize DRBD&#039;s use and role, Take a look at how we will implement our [[Red Hat Cluster Service 2 Tutorial#Visualizing Storage|cluster&#039;s storage]]. Don&#039;t worry if this seems illogical at this stage. The main thing to look at are the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;drbdX&amp;lt;/span&amp;gt; devices and how they each tie back to a corresponding &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;sdaY&amp;lt;/span&amp;gt; device on either node.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
         [ an-node04 ]&lt;br /&gt;
  ______   ______    ______     __[sda4]__&lt;br /&gt;
 | sda1 | | sda2 |  | sda3 |   |  ______  |       _______    ______________    ______________________________&lt;br /&gt;
 |______| |______|  |______|   | | sda5 |-+------| drbd0 |--| drbd_sh0_vg0 |--| /dev/drbd_sh0_vg0/xen_shared |&lt;br /&gt;
     |        |         |      | |______| |   /--|_______|  |______________|  |______________________________|&lt;br /&gt;
  ___|___    _|_    ____|____  |  ______  |   |     _______    ______________    ____________________________&lt;br /&gt;
 | /boot |  | / |  | &amp;lt;swap&amp;gt;  | | | sda6 |-+---+----| drbd1 |--| drbd_an4_vg0 |--| /dev/drbd_an4_vg0/vm0001_1 |&lt;br /&gt;
 |_______|  |___|  |_________| | |______| |   | /--|_______|  |______________|  |____________________________|&lt;br /&gt;
                               |  ______  |   | |     _______    ______________    ____________________________&lt;br /&gt;
                               | | sda7 |-+---+-+----| drbd2 |--| drbd_an5_vg0 |--| /dev/drbd_an4_vg0/vm0002_1 | &lt;br /&gt;
                               | |______| |   | | /--|_______|  |______________|  |____________________________|&lt;br /&gt;
                               |  ______  |   | | |                         | |    _______________________&lt;br /&gt;
                               | | sda8 |-+---+-+-+--\                      | \---| Example LV for 2nd VM |&lt;br /&gt;
                               | |______| |   | | |  |                      |     |_______________________|&lt;br /&gt;
                               |__________|   | | |  |                      |      _______________________&lt;br /&gt;
         [ an-node05 ]                        | | |  |                      \-----| Example LV for 3rd VM |&lt;br /&gt;
  ______   ______    ______     __[sda4]__    | | |  |                            |_______________________|&lt;br /&gt;
 | sda1 | | sda2 |  | sda3 |   |  ______  |   | | |  |                   &lt;br /&gt;
 |______| |______|  |______|   | | sda5 |-+---/ | |  |   _______    __________________&lt;br /&gt;
     |        |         |      | |______| |     | |  \--| drbd3 |--| Spare PV for     |&lt;br /&gt;
  ___|___    _|_    ____|____  |  ______  |     | |  /--|_______|  | future expansion |&lt;br /&gt;
 | /boot |  | / |  | &amp;lt;swap&amp;gt;  | | | sda6 |-+-----/ |  |             |__________________|&lt;br /&gt;
 |_______|  |___|  |_________| | |______| |       |  |&lt;br /&gt;
                               |  ______  |       |  |&lt;br /&gt;
                               | | sda7 |-+-------/  |&lt;br /&gt;
                               | |______| |          |&lt;br /&gt;
                               |  ______  |          |&lt;br /&gt;
                               | | sda8 |-+----------/&lt;br /&gt;
                               | |______| |&lt;br /&gt;
                               |__________|&lt;br /&gt;
.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Component; CLVM ==&lt;br /&gt;
&lt;br /&gt;
With [[DRBD]] providing the raw storage for the cluster, we must next consider partitions. This is where Clustered [[LVM]], known as [[CLVM]], comes into play.&lt;br /&gt;
&lt;br /&gt;
CLVM is ideal in that by using [[DLM]], the distributed lock manager, it won&#039;t allow access to cluster members outside of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;openais&amp;lt;/span&amp;gt;&#039;s closed process group, which, in turn, requires quorum.&lt;br /&gt;
&lt;br /&gt;
It is ideal because it can take one or more raw devices, known as &amp;quot;physical volumes&amp;quot;, or simple as [[PV]]s, and combine their raw space into one or more &amp;quot;volume groups&amp;quot;, known as [[VG]]s. These volume groups then act just like a typical hard drive and can be &amp;quot;partitioned&amp;quot; into one or more &amp;quot;logical volumes&amp;quot;, known as [[LV]]s. These LVs are where [[Xen]]&#039;s [[domU]] virtual machines will exist and where we will create our [[GFS2]] clustered file system.&lt;br /&gt;
&lt;br /&gt;
LVM is particularly attractive because of how incredibly flexible it is. We can easily add new physical volumes later, and then grow an existing volume group to use the new space. This new space can then be given to existing logical volumes, or entirely new logical volumes can be created. This can all be done while the cluster is online offering an upgrade path with no down time.&lt;br /&gt;
&lt;br /&gt;
== Component; GFS2 ==&lt;br /&gt;
&lt;br /&gt;
With [[DRBD]] providing the clusters raw storage space, and [[CLVM|Clustered LVM]] providing the logical partitions, we can now look at the clustered file system. This is the role of the Global File System version 2, known simply as [[GFS2]].&lt;br /&gt;
&lt;br /&gt;
It works much like standard filesystem, with user-land tools like &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;mkfs.gfs2&amp;lt;/span&amp;gt;, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fsck.gfs2&amp;lt;/span&amp;gt; and so on. The major difference is that it and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clvmd&amp;lt;/span&amp;gt; use the cluster&#039;s [[DLM|distributed locking mechanism]] provided by the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;dlm_controld&amp;lt;/span&amp;gt; daemon. Once formatted, the GFS2-formatted partition can be mounted and used by any node in the cluster&#039;s [[CPG|closed process group]]. All nodes can then safely read from and write to the data on the partition simultaneously.&lt;br /&gt;
&lt;br /&gt;
== Component; DLM ==&lt;br /&gt;
&lt;br /&gt;
One of the major roles of a cluster is to provide [[DLM|distributed locking]] on clustered storage. In fact, storage software can not be clustered without using [[DLM]], as provided by the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;dlm_controld&amp;lt;/span&amp;gt; daemon and using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;openais&amp;lt;/span&amp;gt;&#039;s virtual synchrony via [[CPG]]. &lt;br /&gt;
&lt;br /&gt;
Through DLM, all nodes accessing clustered storage are guaranteed to get [[POSIX]] locks, called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;plock&amp;lt;/span&amp;gt;s, in the same order across all nodes. Both [[CLVM]] and [[GFS2]] rely on DLM, though other clustered storage, like OCFS2, use it as well.&lt;br /&gt;
&lt;br /&gt;
== Component; Xen ==&lt;br /&gt;
&lt;br /&gt;
Two of the most popular open-source virtualization platforms available in the Linux world today and [[Xen]] and [[KVM]]. The former is maintained by [http://www.citrix.com/xenserver Citrix] and the other by [http://www.redhat.com/solutions/virtualization/ Redhat]. It would be difficult to say which is &amp;quot;better&amp;quot;, as they&#039;re both very good. Xen can be argued to be more mature where KVM is the &amp;quot;official&amp;quot; solution supported by Red Hat in [[EL6]].&lt;br /&gt;
&lt;br /&gt;
We will be using the Xen [[hypervisor]] and a &amp;quot;host&amp;quot; virtual server called [[dom0]]. In Xen, every machine is a virtual server, including the system you installed when you built the server. This is possible thanks to a small Xen micro-operating system that initially boots, then starts up your original installed operating system as a virtual server with special access to the underlying hardware and hypervisor management tools.&lt;br /&gt;
&lt;br /&gt;
The rest of the virtual servers in a Xen environment are collectively called &amp;quot;[[domU]]&amp;quot; virtual servers. These will be the highly-available resource that will migrate between nodes during failure events in our cluster.&lt;br /&gt;
&lt;br /&gt;
= Base Setup =&lt;br /&gt;
&lt;br /&gt;
Before we can look at the cluster, we must first build two cluster nodes and then install the operating system.&lt;br /&gt;
&lt;br /&gt;
== Hardware Requirements ==&lt;br /&gt;
&lt;br /&gt;
The bare minimum requirements are;&lt;br /&gt;
&lt;br /&gt;
* All hardware must be supported by [[EL5]]. It is strongly recommended that you check compatibility before making any purchases.&lt;br /&gt;
* A dual-core [[CPU]] with hardware virtualization support.&lt;br /&gt;
* Three network cards; At least one should be gigabit or faster.&lt;br /&gt;
* One hard drive.&lt;br /&gt;
* 2 [[GiB]] of [[RAM]]&lt;br /&gt;
* A [[fence|fence device]]. This can be an [[IPMI]]-enabled server, a [http://nodeassassin.org Node Assassin], a [http://www.apc.com/products/resource/include/techspec_index.cfm?base_sku=AP7900 switched PDU] or similar.&lt;br /&gt;
&lt;br /&gt;
This tutorial was written using the following hardware:&lt;br /&gt;
&lt;br /&gt;
* AMD Athlon [http://products.amd.com/en-us/DesktopCPUDetail.aspx?id=610 II X4 600e Processor]&lt;br /&gt;
* ASUS [http://www.asus.com/product.aspx?P_ID=LVmksAnszmVimOOp M4A785T-M/CSM]&lt;br /&gt;
* 4GB Kingston [http://www.ec.kingston.com/ecom/configurator_new/partsinfo.asp?root=&amp;amp;LinkBack=&amp;amp;ktcpartno=KVR1333D3N9K2/4G KVR1333D3N9K2/4G], 4GB (2x2GB) DDR3-1333, Non-ECC&lt;br /&gt;
* Seagate [http://www.seagate.com/ww/v/index.jsp?vgnextoid=70f4bfafecadd110VgnVCM100000f5ee0a0aRCRD ST9500420AS] 2.5&amp;quot; SATA HDD&lt;br /&gt;
* 2x Intel [http://www.intel.com/products/desktop/adapters/gigabit-ct/gigabit-ct-overview.htm Pro/1000CT EXPI9301CT] PCIe NICs&lt;br /&gt;
* [[Node Assassin v1.1.4]]&lt;br /&gt;
&lt;br /&gt;
This is not an endorsement of the above hardware. I put a heavy emphasis on minimizing power consumption and bought what was within my budget. This hardware was never meant to be put into production, but instead was chosen to serve the purpose of my own study and for creating this tutorial. What you ultimately choose to use, provided it meets the minimum requirements, is entirely up to you and your requirements.&lt;br /&gt;
&lt;br /&gt;
{{note|1=I use three physical [[NIC]]s, but you can get away with two by merging the storage and back-channel networks, which we will discuss shortly. If you are really in a pinch, you could create three aliases on on interface and isolate them using [[VLAN]]s. If you go this route, please ensure that your VLANs are configured and working before beginning this tutorial. Pay close attention to multicast traffic.}}&lt;br /&gt;
&lt;br /&gt;
== Pre-Assembly ==&lt;br /&gt;
&lt;br /&gt;
Before you assemble your nodes, take a moment to record the [[MAC]] addresses of each network interface and then note where each interface is physically installed. This will help you later when configuring the networks. I generally create a simple text file with the MAC addresses, the interface I intend to assign to it and where it physically is located.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
-=] an-node04&lt;br /&gt;
48:5B:39:3C:53:15   # eth0 - onboard interface&lt;br /&gt;
00:1B:21:72:9B:5A   # eth1 - right-most PCIe interface&lt;br /&gt;
00:1B:21:72:96:EA   # eth2 - left-most PCIe interface&lt;br /&gt;
&lt;br /&gt;
-=] an-node05&lt;br /&gt;
48:5B:39:3C:53:13   # eth0 - onboard interface&lt;br /&gt;
00:1B:21:72:99:AB   # eth1 - right-most PCIe interface&lt;br /&gt;
00:1B:21:72:96:A6   # eth2 - left-most PCIe interface&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== OS Install ==&lt;br /&gt;
&lt;br /&gt;
Later steps will include packages to install, so the initial OS install can be minimal. I like to change the default run-level to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;3&amp;lt;/span&amp;gt;, remove &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rhgb quiet&amp;lt;/span&amp;gt; from the [[grub]] menu, disable the firewall and disable [[SELinux]]. In a production cluster, you will want to use firewalling and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;selinux&amp;lt;/span&amp;gt;, but until you finish studying, leave it off to keep things simple.&lt;br /&gt;
&lt;br /&gt;
{{note|1=Before [[EL5]].4, you could not use SELinux. It is now possible to use it, and it is recommended that you do so in any production cluster.}}&lt;br /&gt;
{{note|1=Ports and protocols to open in a firewall will be discussed later in the networking section.}}&lt;br /&gt;
&lt;br /&gt;
I like to minimize and automate my installs as much as possible. To that end, I run a little [[Setting Up a PXE Server in Fedora|PXE]] server on my network and use a [[kickstart]] script to automate the install. Here is a simple one for use on a single-drive node:&lt;br /&gt;
* [[generic_el5_node.ks]]&lt;br /&gt;
&lt;br /&gt;
If you decide to manually install [[EL5]] on your nodes, please try to keep the installation as small as possible. The fewer packages installed, the fewer sources of problems and vectors for attack.&lt;br /&gt;
&lt;br /&gt;
== Post Install OS Changes ==&lt;br /&gt;
&lt;br /&gt;
This section discusses changes I recommend, but are not required. If you wish to adapt any of the steps below, please do so but be sure to keep the changes consistent through out the implementation of this tutorial.&lt;br /&gt;
&lt;br /&gt;
=== Network Planning ===&lt;br /&gt;
&lt;br /&gt;
The most important change that is recommended is to get your nodes into a consistent networking configuration. This will prove very handy when trying to keep track of your networks and where they&#039;re physically connected. This becomes exponentially more helpful as your cluster grows.&lt;br /&gt;
&lt;br /&gt;
The first step is to understand the three networks we will be creating. Once you understand their role, you will need to decide which interface on the nodes will be used for each network.&lt;br /&gt;
&lt;br /&gt;
==== Cluster Networks ====&lt;br /&gt;
&lt;br /&gt;
The three networks are;&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Network&lt;br /&gt;
!Acronym&lt;br /&gt;
!Use&lt;br /&gt;
|-&lt;br /&gt;
|Back-Channel Network&lt;br /&gt;
|&#039;&#039;&#039;BCN&#039;&#039;&#039;&lt;br /&gt;
|Private cluster communications, virtual machine migrations, fence devices&lt;br /&gt;
|-&lt;br /&gt;
|Storage Network&lt;br /&gt;
|&#039;&#039;&#039;SN&#039;&#039;&#039;&lt;br /&gt;
|Used exclusively for storage communications. Possible to use as totem&#039;s redundant ring.&lt;br /&gt;
|-&lt;br /&gt;
|Internet-Facing Network&lt;br /&gt;
|&#039;&#039;&#039;IFN&#039;&#039;&#039;&lt;br /&gt;
|Internet-polluted network. No cluster, storage or cluster device communication.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Things To Consider ====&lt;br /&gt;
&lt;br /&gt;
When planning which interfaces to connect to each network, consider the following, in order of importance:&lt;br /&gt;
&lt;br /&gt;
* If your nodes have [[IPMI]] and an interface sharing a physical [[RJ-45]] connector, this must be on the &#039;&#039;&#039;Back-Channel Network&#039;&#039;&#039;. The reasoning is that having your fence device accessible on the &#039;&#039;&#039;Internet-Facing Network&#039;&#039;&#039; poses a &#039;&#039;major&#039;&#039; security risk. Having the IPMI interface on the &#039;&#039;&#039;Storage Network&#039;&#039;&#039; can cause problems if a fence is fired and the network is saturated with storage traffic.&lt;br /&gt;
&lt;br /&gt;
* The lowest-latency network interface should be used as the &#039;&#039;&#039;Back-Channel Network&#039;&#039;&#039;. The cluster is maintained by [[multicast]] messaging between the nodes using something called the [[totem]] protocol. Any delay in the delivery of these messages can risk causing a failure and ejection of effected nodes when no actual failure existed. This will be discussed in greater detail later.&lt;br /&gt;
&lt;br /&gt;
* The network with the most raw bandwidth should be used for the &#039;&#039;&#039;Storage Network&#039;&#039;&#039;. All disk writes must be sent across the network and committed to the remote nodes before the write is declared complete. This causes the network to become the disk I/O bottle neck. Using a network with jumbo frames and high raw throughput will help minimize this bottle neck.&lt;br /&gt;
&lt;br /&gt;
* During the live migration of virtual machines, the VM&#039;s RAM is copied to the other node using the &#039;&#039;&#039;BCN&#039;&#039;&#039;. For this reason, the second fastest network should be used for back-channel communication. However, these copies can saturate the network, so care must be taken to ensure that cluster communications get higher priority. This can be done using a managed switch. If you can not ensure priority for totem multicast, then be sure to configure Xen later to use the storage network for migrations.&lt;br /&gt;
&lt;br /&gt;
* The remain, slowest interface should be used for the &#039;&#039;&#039;IFN&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
==== Planning the Networks ====&lt;br /&gt;
&lt;br /&gt;
This paper will use the following setup. Feel free to alter the interface to network mapping and the [[IP]] [[subnet]]s used to best suit your needs. For reasons completely my own, I like to start my cluster IPs final [[octal]] at &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;71&amp;lt;/span&amp;gt; for node 1 and then increment up from there. This is entirely arbitrary, so please use what ever makes sense to you. The remainder of this tutorial will follow the convention below:&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Network&lt;br /&gt;
!Interface&lt;br /&gt;
!Subnet&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;IFN&#039;&#039;&#039;&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth0&amp;lt;/span&amp;gt;&lt;br /&gt;
|&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;
|&#039;&#039;&#039;SN&#039;&#039;&#039;&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth1&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;192.168.2.0/24&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;BCN&#039;&#039;&#039;&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth2&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;192.139.3.0/24&amp;lt;/span&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
This translates to the following per-node configuration:&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!colspan=&amp;quot;2&amp;quot;|&lt;br /&gt;
!colspan=&amp;quot;2&amp;quot;|an-node04&lt;br /&gt;
!colspan=&amp;quot;2&amp;quot;|an-node05&lt;br /&gt;
|-&lt;br /&gt;
!&lt;br /&gt;
!Interface&lt;br /&gt;
!IP Address&lt;br /&gt;
!Host Name(s)&lt;br /&gt;
!IP Address&lt;br /&gt;
!Host Name(s)&lt;br /&gt;
|-&lt;br /&gt;
!IFN&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth0&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;192.168.1.74&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04.ifn&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;192.168.1.75&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05.ifn&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!SN&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth1&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;192.168.2.74&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04.sn&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;192.168.2.75&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05.sn&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!BCN&lt;br /&gt;
|align=&amp;quot;center&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth2&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;192.168.3.74&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04 an-node04.alteeve.com an-node04.bcn&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;192.168.3.75&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05 an-node05.alteeve.com an-node05.bcn&amp;lt;/span&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Network Configuration ===&lt;br /&gt;
&lt;br /&gt;
So now we&#039;ve planned the network, so it is time to implement it.&lt;br /&gt;
&lt;br /&gt;
==== Warning About Managed Switches ====&lt;br /&gt;
&lt;br /&gt;
{{warning|1=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 and configuring [[Multicast IGMP Snooping]] or [[Spanning Tree Protocol]]. They have been known to cause problems by not allowing multicast packets to reach all nodes fast enough or at all. This can cause somewhat random break-downs in communication between your nodes, leading to seemingly random fences and DLM lock timeouts. If your switches support [[PIM Routing]], be sure to use it!&lt;br /&gt;
&lt;br /&gt;
If you have problems with your cluster not forming, or seemingly random fencing, try using a cheap [http://dlink.ca/products/?pid=230 unmanaged] switch. If the problem goes away, you are most likely dealing with a managed switch configuration problem.&lt;br /&gt;
&lt;br /&gt;
==== Disable Firewalling ====&lt;br /&gt;
&lt;br /&gt;
To &amp;quot;keep things simple&amp;quot;, we will disable all firewalling on the cluster nodes. This is not recommended in production environments, obviously, so below will be a table of ports and protocols to open when you do get into production. Until then, we will simply use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;chkconfig&amp;lt;/span&amp;gt; to 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;.&lt;br /&gt;
&lt;br /&gt;
{{note|1=Cluster 2 does not support [[IPv6]], so you can skip or ignore it if you wish. I like to disable it just to be certain that it can&#039;t cause issues though.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
chkconfig iptables off&lt;br /&gt;
chkconfig ip6tables off&lt;br /&gt;
/etc/init.d/iptables stop&lt;br /&gt;
/etc/init.d/ip6tables stop&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now confirm that they are off by having &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; list their rules.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
iptables -L&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Chain INPUT (policy ACCEPT)&lt;br /&gt;
target     prot opt source               destination         &lt;br /&gt;
&lt;br /&gt;
Chain FORWARD (policy ACCEPT)&lt;br /&gt;
target     prot opt source               destination         &lt;br /&gt;
&lt;br /&gt;
Chain OUTPUT (policy ACCEPT)&lt;br /&gt;
target     prot opt source               destination         &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;
ip6tables -L&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Chain INPUT (policy ACCEPT)&lt;br /&gt;
target     prot opt source               destination         &lt;br /&gt;
&lt;br /&gt;
Chain FORWARD (policy ACCEPT)&lt;br /&gt;
target     prot opt source               destination         &lt;br /&gt;
&lt;br /&gt;
Chain OUTPUT (policy ACCEPT)&lt;br /&gt;
target     prot opt source               destination         &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When you do prepare to go into production, these are the protocols and ports you need to open between cluster nodes. Remember to allow multicast communications as well!&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Port&lt;br /&gt;
!Protocol&lt;br /&gt;
!Component&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;5404&amp;lt;/span&amp;gt;, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;5405&amp;lt;/span&amp;gt;&lt;br /&gt;
|[[UDP]]&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[cman]]&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;8084&amp;lt;/span&amp;gt;, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;5405&amp;lt;/span&amp;gt;&lt;br /&gt;
|[[TCP]]&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[luci]]&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;11111&amp;lt;/span&amp;gt;&lt;br /&gt;
|[[TCP]]&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[ricci]]&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;14567&amp;lt;/span&amp;gt;&lt;br /&gt;
|[[TCP]]&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[gnbd]]&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;16851&amp;lt;/span&amp;gt;&lt;br /&gt;
|[[TCP]]&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[modclusterd]]&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;21064&amp;lt;/span&amp;gt;&lt;br /&gt;
|[[TCP]]&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[dlm]]&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;50006&amp;lt;/span&amp;gt;, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;50008&amp;lt;/span&amp;gt;, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;50009&amp;lt;/span&amp;gt;&lt;br /&gt;
|[[TCP]]&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[ccsd]]&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;50007&amp;lt;/span&amp;gt;&lt;br /&gt;
|[[UDP]]&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[ccsd]]&amp;lt;/span&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Disable NetworkManager, Enable network ====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;NetworkManager&amp;lt;/span&amp;gt; daemon is an excellent daemon in environments where a system connects to a variety of networks. The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;NetworkManager&amp;lt;/span&amp;gt; daemon handles changing the networking configuration whenever it senses a change in the network state, like when a cable is unplugged or a wireless network comes or goes. As useful as this is on laptops and workstations, it can be detrimental in a cluster.&lt;br /&gt;
&lt;br /&gt;
To prevent the networking from changing once we&#039;ve got it setup, we want to replace &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;NetworkManager&amp;lt;/span&amp;gt; daemon with the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;network&amp;lt;/span&amp;gt; initialization script. The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;network&amp;lt;/span&amp;gt; script will start and stop networking, but otherwise it will leave the configuration alone. This is ideal in servers, and doubly-so in clusters given their sensitivity to transient network issues.&lt;br /&gt;
&lt;br /&gt;
Start by removing &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;NetworkManager&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 remove NetworkManager NetworkManager-glib NetworkManager-gnome NetworkManager-devel NetworkManager-glib-devel&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now you want to ensure that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;network&amp;lt;/span&amp;gt; starts with the system.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
chkconfig network on&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Setup /etc/hosts ====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/hosts&amp;lt;/span&amp;gt; file, by default, will resolve the hostname to the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;lo&amp;lt;/span&amp;gt; (&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;127.0.0.1&amp;lt;/span&amp;gt;) interface. The cluster uses this name though for knowing which interface to use for the [[totem]] protocol (and thus all cluster communications). To this end, we will remove the hostname from &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;127.0.0.1&amp;lt;/span&amp;gt; and instead put it on the IP of our &#039;&#039;&#039;BCN&#039;&#039;&#039; interface. We will also add entries for all other networks for both nodes in the cluster along with entries for the fence device(s). &lt;br /&gt;
&lt;br /&gt;
Once done, the edited &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/hosts&amp;lt;/span&amp;gt; file should be suitable for copying to both nodes in the cluster.&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;
# Do not remove the following line, or various programs&lt;br /&gt;
# that require network functionality will fail.&lt;br /&gt;
127.0.0.1	localhost.localdomain localhost&lt;br /&gt;
::1		localhost6.localdomain6 localhost6&lt;br /&gt;
&lt;br /&gt;
192.168.1.74	an-node04.ifn&lt;br /&gt;
192.168.2.74	an-node04.sn&lt;br /&gt;
192.168.3.74	an-node04 an-node04.bcn an-node04.alteeve.com&lt;br /&gt;
&lt;br /&gt;
192.168.1.75	an-node05.ifn&lt;br /&gt;
192.168.2.75	an-node05.sn&lt;br /&gt;
192.168.3.75	an-node05 an-node05.bcn an-node05.alteeve.com&lt;br /&gt;
&lt;br /&gt;
192.168.3.61	fence_na01.alteeve.com	# Node Assassin&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Mapping Interfaces to ethX Names ====&lt;br /&gt;
&lt;br /&gt;
Chances are good that the assignment of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ethX&amp;lt;/span&amp;gt; interface names to your physical network cards is not ideal. There is no strict technical reason to change the mapping, but it will make you life a lot easier if all nodes use the same &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ethX&amp;lt;/span&amp;gt; names for the same subnets. &lt;br /&gt;
&lt;br /&gt;
The actual process of changing the mapping is a little involved. For this reason, there is a dedicated mini-tutorial which you can find below. Please jump to it and then return once your mapping is as you like it.&lt;br /&gt;
&lt;br /&gt;
* [[Changing the ethX to Ethernet Device Mapping in EL5]]&lt;br /&gt;
&lt;br /&gt;
==== Set IP Addresses ====&lt;br /&gt;
&lt;br /&gt;
The last step in setting up the network interfaces is to manually assign the IP addresses and define the subnets for the interfaces. This involves directly editing the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/sysconfig/network-scripts/ifcfg-ethX&amp;lt;/span&amp;gt; files. There are a large set of options that can be set in these configuration files, but most are outside the scope of this tutorial. To get a better understanding of the available options, please see:&lt;br /&gt;
&lt;br /&gt;
* [http://docs.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/5/html/Deployment_Guide/s1-networkscripts-interfaces.html Red Hat&#039;s Interface Configuration Guide]&lt;br /&gt;
&lt;br /&gt;
{{note|1=Later on, we will be creating two bridges, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xenbr0&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xenbr2&amp;lt;/span&amp;gt; which we will then connect [[dom0]]&#039;s &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; to. These bridges then become available to the [[Xen]]&#039;s [[domU]] VMs. Bridge options and arguments can be found in the link above.}}&lt;br /&gt;
&lt;br /&gt;
Here are the three configuration files from &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt; which you can use as guides. Please &#039;&#039;&#039;do not&#039;&#039;&#039; copy these over your files! Doing so will cause your interfaces to fail outright as every interface&#039;s [[MAC]] address is unique. Adapt these to suite your needs.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/sysconfig/network-scripts/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;
# Realtek Semiconductor Co., Ltd. RTL8111/8168B PCI Express Gigabit Ethernet controller&lt;br /&gt;
HWADDR=48:5B:39:3C:53:14&lt;br /&gt;
DEVICE=eth0&lt;br /&gt;
BOOTPROTO=static&lt;br /&gt;
ONBOOT=yes&lt;br /&gt;
IPADDR=192.168.1.74&lt;br /&gt;
NETMASK=255.255.255.0&lt;br /&gt;
GATEWAY=192.168.1.254&lt;br /&gt;
DNS1=192.139.81.117&lt;br /&gt;
DNS2=192.139.81.1&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;
vim /etc/sysconfig/network-scripts/ifcfg-eth1&lt;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 82574L Gigabit Network Connection&lt;br /&gt;
HWADDR=00:1B:21:72:9B:5A&lt;br /&gt;
DEVICE=eth1&lt;br /&gt;
BOOTPROTO=static&lt;br /&gt;
ONBOOT=yes&lt;br /&gt;
IPADDR=192.168.2.74&lt;br /&gt;
NETMASK=255.255.255.0&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;
vim /etc/sysconfig/network-scripts/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 82574L Gigabit Network Connection&lt;br /&gt;
HWADDR=00:1B:21:72:96:EA&lt;br /&gt;
DEVICE=eth2&lt;br /&gt;
BOOTPROTO=static&lt;br /&gt;
ONBOOT=yes&lt;br /&gt;
IPADDR=192.168.3.74&lt;br /&gt;
NETMASK=255.255.255.0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you do not want to use the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;DNSx=&amp;lt;/span&amp;gt; options, you will need to setup the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/resolv.conf&amp;lt;/span&amp;gt; file for [[DNS]] resolution. You can learn more about this file&#039;s purpose by reading it&#039;s [[man]] page; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;man resolv.conf&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Finally, restart &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;network&amp;lt;/span&amp;gt; and you should have you interfaces setup properly.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/network 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;
Shutting down interface eth0:                              [  OK  ]&lt;br /&gt;
Shutting down interface eth1:                              [  OK  ]&lt;br /&gt;
Shutting down interface eth2:                              [  OK  ]&lt;br /&gt;
Shutting down loopback interface:                          [  OK  ]&lt;br /&gt;
Bringing up loopback interface:                            [  OK  ]&lt;br /&gt;
Bringing up interface eth0:                                [  OK  ]&lt;br /&gt;
Bringing up interface eth1:                                [  OK  ]&lt;br /&gt;
Bringing up interface eth2:                                [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can verify your configuration using the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ifconfig&amp;lt;/span&amp;gt; tool. The output below is from &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&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;
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:3974 errors:0 dropped:0 overruns:0 frame:0&lt;br /&gt;
          TX packets:1810 errors:0 dropped:0 overruns:0 carrier:0&lt;br /&gt;
          collisions:0 txqueuelen:1000 &lt;br /&gt;
          RX bytes:1452567 (1.3 MiB)  TX bytes:237057 (231.5 KiB)&lt;br /&gt;
          Interrupt:246 Base address:0xe000 &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:117 errors:0 dropped:0 overruns:0 frame:0&lt;br /&gt;
          TX packets:62 errors:0 dropped:0 overruns:0 carrier:0&lt;br /&gt;
          collisions:0 txqueuelen:1000 &lt;br /&gt;
          RX bytes:30766 (30.0 KiB)  TX bytes:16018 (15.6 KiB)&lt;br /&gt;
          Interrupt:17 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:54 errors:0 dropped:0 overruns:0 frame:0&lt;br /&gt;
          TX packets:60 errors:0 dropped:0 overruns:0 carrier:0&lt;br /&gt;
          collisions:0 txqueuelen:1000 &lt;br /&gt;
          RX bytes:11492 (11.2 KiB)  TX bytes:15638 (15.2 KiB)&lt;br /&gt;
          Interrupt:16 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:34 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:0 &lt;br /&gt;
          RX bytes:9268 (9.0 KiB)  TX bytes:9268 (9.0 KiB)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{note|1=You may see a &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virbr0&amp;lt;/span&amp;gt; interface. You can safely ignore it, we will remove it later.}}&lt;br /&gt;
&lt;br /&gt;
=== Setting up SSH ===&lt;br /&gt;
&lt;br /&gt;
Setting up [[SSH]] shared keys will allow your nodes to pass files between one another and execute commands remotely without needing to enter a password. This will be needed later when we want to enable applications like &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;libvirtd&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-manager&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
SSH is, on it&#039;s own, a very big topic. If you are not familiar with SSH, please take some time to learn about it before proceeding. A great first step is the [http://en.wikipedia.org/wiki/Secure_Shell Wikipedia] entry on SSH, as well as the SSH [[man]] page; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;man ssh&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[SSH]] 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 on each node, 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;
Created directory &#039;/root/.ssh&#039;.&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;
a1:65:a9:50:bb:15:ae:b1:6e:06:12:4a:29:d1:68:f3 root@an-node04.alteeve.com&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_rsa&amp;lt;/span&amp;gt; and the public key called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;~/.ssh/id_rsa.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;
MIIEnwIBAAKCAQBTNg6FZyDKm4GAm7c+F2enpLWy+t8ZZjm4Z3Q7EhX09ukqk/Qm&lt;br /&gt;
MqprtI9OsiRVjce+wGx4nZ8+Z0NHduCVuwAxG0XG7FpKkUJC3Qb8KhyeIpKEcfYA&lt;br /&gt;
tsDUFnWddVF8Tsz6dDOhb61tAke77d9E01NfyHp88QBxjJ7w+ZgB2eLPBFm6j1t+&lt;br /&gt;
K50JHwdcFfxrZFywKnAQIdH0NCs8VaW91fQZBupg4OGOMpSBnVzoaz2ybI9bQtbZ&lt;br /&gt;
4GwhCghzKx7Qjz20WiqhfPMfFqAZJwn0WXfjALoioMDWavTbx+J2HM8KJ8/YkSSK&lt;br /&gt;
dDEgZCItg0Q2fC35TDX+aJGu3xNfoaAe3lL1AgEjAoIBABVlq/Zq+c2y9Wo2q3Zd&lt;br /&gt;
yjJsLrj+rmWd8ZXRdajKIuc4LVQXaqq8kjjz6lYQjQAOg9H291I3KPLKGJ1ZFS3R&lt;br /&gt;
AAygnOoCQxp9H6rLHw2kbcJDZ4Eknlf0eroxqTceKuVzWUe3ev2gX8uS3z70BjZE&lt;br /&gt;
+C6SoydxK//w9aut5UJN+H5f42p95IsUIs0oy3/3KGPHYrC2Zgc2TIhe25huie/O&lt;br /&gt;
psKhHATBzf+M7tHLGia3q682JqxXru8zhtPOpEAmU4XDtNdL+Bjv+/Q2HMRstJXe&lt;br /&gt;
2PU3IpVBkirEIE5HlyOV1T802KRsSBelxPV5Y6y5TRq+cEwn0G2le1GiFBjd0xQd&lt;br /&gt;
0csCgYEA2BWkxSXhqmeb8dzcZnnuBZbpebuPYeMtWK/MMLxvJ50UCUfVZmA+yUUX&lt;br /&gt;
K9fAUvkMLd7V8/MP7GrdmYq2XiLv6IZPUwyS8yboovwWMb+72vb5QSnN6LAfpUEk&lt;br /&gt;
NRd5JkWgqRstGaUzxeCRfwfIHuAHikP2KeiLM4TfBkXzhm+VWjECgYBilQEBHvuk&lt;br /&gt;
LlY2/1v43zYQMSZNHBSbxc7R5mnOXNFgapzJeFKvaJbVKRsEQTX5uqo83jRXC7LI&lt;br /&gt;
t14pC23tpW1dBTi9bNLzQnf/BL9vQx6KFfgrXwy8KqXuajfv1ECH6ytqdttkUGZt&lt;br /&gt;
TE/monjAmR5EVElvwMubCPuGDk9zC7iQBQKBgG8hEukMKunsJFCANtWdyt5NnKUB&lt;br /&gt;
X66vWSZLyBkQc635Av11Zm8qLusq2Ld2RacDvR7noTuhkykhBEBV92Oc8Gj0ndLw&lt;br /&gt;
hhamS8GI9Xirv7JwYu5QA377ff03cbTngCJPsbYN+e/uj6eYEE/1X5rZnXpO1l6y&lt;br /&gt;
G7QYcrLE46Q5YsCrAoGAL+H5LG4idFEFTem+9Tk3hDUhO2VpGHYFXqMdctygNiUn&lt;br /&gt;
lQ6Oj7Z1JbThPJSz0RGF4wzXl/5eJvn6iPbsQDpoUcC1KM51FxGn/4X2lSCZzgqr&lt;br /&gt;
vUtslejUQJn96YRZ254cZulF/YYjHyUQ3byhDRcr9U2CwUBi5OcbFTomlvcQgHcC&lt;br /&gt;
gYEAtIpaEWt+Akz9GDJpKM7Ojpk8wTtlz2a+S5fx3WH/IVURoAzZiXzvonVIclrH&lt;br /&gt;
5RXFiwfoXlMzIulZcrBJZfTgRO9A2v9rE/ZRm6qaDrGe9RcYfCtxGGyptMKLdbwP&lt;br /&gt;
UW1emRl5celU9ZEZRBpIVTES5ZVWqD2RkkkNNJbPf5F/x+w=&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; (wrapped to make it more readable):&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 AAAAB3NzaC1yc2EAAAABIwAAAQBTNg6FZyDKm4GAm7c+F2enpLWy+t8Z&lt;br /&gt;
Zjm4Z3Q7EhX09ukqk/QmMqprtI9OsiRVjce+wGx4nZ8+Z0NHduCVuwAxG0XG7FpK&lt;br /&gt;
kUJC3Qb8KhyeIpKEcfYAtsDUFnWddVF8Tsz6dDOhb61tAke77d9E01NfyHp88QBx&lt;br /&gt;
jJ7w+ZgB2eLPBFm6j1t+K50JHwdcFfxrZFywKnAQIdH0NCs8VaW91fQZBupg4OGO&lt;br /&gt;
MpSBnVzoaz2ybI9bQtbZ4GwhCghzKx7Qjz20WiqhfPMfFqAZJwn0WXfjALoioMDW&lt;br /&gt;
avTbx+J2HM8KJ8/YkSSKdDEgZCItg0Q2fC35TDX+aJGu3xNfoaAe3lL1 root@an&lt;br /&gt;
-node04.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-node04&#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-node05&lt;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-node05 (192.168.3.75)&#039; can&#039;t be established.&lt;br /&gt;
RSA key fingerprint is 55:58:c3:32:e4:e6:5e:32:c1:db:5c:f1:36:e2:da:4b.&lt;br /&gt;
Are you sure you want to continue connecting (yes/no)? yes&lt;br /&gt;
Warning: Permanently added &#039;an-node05,192.168.3.75&#039; (RSA) to the list of known hosts.&lt;br /&gt;
Last login: Fri Mar 11 20:45:58 2011 from 192.168.1.202&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-node05&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-node04&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;
(Wrapped to make it more readable)&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 AAAAB3NzaC1yc2EAAAABIwAAAQBTNg6FZyDKm4GAm7c+F2enpLWy+t8Z&lt;br /&gt;
Zjm4Z3Q7EhX09ukqk/QmMqprtI9OsiRVjce+wGx4nZ8+Z0NHduCVuwAxG0XG7FpK&lt;br /&gt;
kUJC3Qb8KhyeIpKEcfYAtsDUFnWddVF8Tsz6dDOhb61tAke77d9E01NfyHp88QBx&lt;br /&gt;
jJ7w+ZgB2eLPBFm6j1t+K50JHwdcFfxrZFywKnAQIdH0NCs8VaW91fQZBupg4OGO&lt;br /&gt;
MpSBnVzoaz2ybI9bQtbZ4GwhCghzKx7Qjz20WiqhfPMfFqAZJwn0WXfjALoioMDW&lt;br /&gt;
avTbx+J2HM8KJ8/YkSSKdDEgZCItg0Q2fC35TDX+aJGu3xNfoaAe3lL1 root@an&lt;br /&gt;
-node04.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;
Various applications will connect to the other node using different methods and networks. Each connection, when first established, will prompt for you to confirm that you trust the authentication, as we saw above. Many programs can&#039;t handle this prompt and will simply fail to connect. So to get around this, I will &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ssh&amp;lt;/span&amp;gt; into both nodes using all hostnames. This will populate a file called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;~/.ssh/known_hosts&amp;lt;/span&amp;gt;. Once you do this on one node, you can simply copy the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;known_hosts&amp;lt;/span&amp;gt; to the other nodes and user&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;~/.ssh/&amp;lt;/span&amp;gt; directories.&lt;br /&gt;
&lt;br /&gt;
I simply paste this into a terminal, answering &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;yes&amp;lt;/span&amp;gt; and then immediately exiting from the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ssh&amp;lt;/span&amp;gt; session. This is a bit tedious, I admit. Take the time to check the fingerprints as they are displayed to you. It is a bad habit to blindly type &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;yes&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Alter this to suit your host names.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ssh root@an-node04 &amp;amp;&amp;amp; \&lt;br /&gt;
ssh root@an-node04.alteeve.com &amp;amp;&amp;amp; \&lt;br /&gt;
ssh root@an-node04.bcn &amp;amp;&amp;amp; \&lt;br /&gt;
ssh root@an-node04.sn &amp;amp;&amp;amp; \&lt;br /&gt;
ssh root@an-node04.ifn &amp;amp;&amp;amp; \&lt;br /&gt;
ssh root@an-node05 &amp;amp;&amp;amp; \&lt;br /&gt;
ssh root@an-node05.alteeve.com &amp;amp;&amp;amp; \&lt;br /&gt;
ssh root@an-node05.bcn &amp;amp;&amp;amp; \&lt;br /&gt;
ssh root@an-node05.sn &amp;amp;&amp;amp; \&lt;br /&gt;
ssh root@an-node05.ifn&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once you&#039;ve done this on one node, you can simply copy the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;~/.ssh/known_hosts&amp;lt;/span&amp;gt; file to the other node. In my case, I ran the above commands on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt;, so I will copy the file to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&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;
rsync -av root@192.168.1.74:/root/.ssh/known_hosts ~/.ssh/&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
receiving file list ... done&lt;br /&gt;
known_hosts&lt;br /&gt;
&lt;br /&gt;
sent 96 bytes  received 2165 bytes  4522.00 bytes/sec&lt;br /&gt;
total size is 7629  speedup is 3.37&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Installing Packages We Will Use ==&lt;br /&gt;
&lt;br /&gt;
There are several packages we will need. They can all be installed in one go with the following command.&lt;br /&gt;
&lt;br /&gt;
If you have a slow or metered Internet connection, you may want to alter &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/yum.conf&amp;lt;/span&amp;gt; and change &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;keepcache=0&amp;lt;/span&amp;gt; to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;keepcache=1&amp;lt;/span&amp;gt; before installing packages. This way, you can then run you updates and installs on one node and then &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rsync&amp;lt;/span&amp;gt; the downloaded files from the first node to the second node. Once done, when you run the updates and installs on that second node, nothing more will be downloaded. To copy the cached [[RPM]]s, simply run &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rsync -av /var/cache/yum root@an-node05:/var/cache/&amp;lt;/span&amp;gt; (assuming you did the initial downloads from &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
{{note|1=If you are using [[RHEL]] 5.x proper, you will need to manually download and install the [[DRBD]] RPMs from [http://www.linbit.com/support/ Linbit].}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install cman openais rgmanager lvm2-cluster gfs2-utils xen xen-libs kmod-xenpv \&lt;br /&gt;
            drbd83 kmod-drbd83-xen virt-manager virt-viewer libvirt libvirt-python \&lt;br /&gt;
            python-virtinst luci ricci ntp bridge-utils system-config-cluster&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will drag in a good number of dependencies, which is fine.&lt;br /&gt;
&lt;br /&gt;
== Keeping Time In Sync ==&lt;br /&gt;
&lt;br /&gt;
It is very important that time on both nodes be kept in sync. The way to do this is to setup [[[NTP]], the network time protocol. I like to use the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;tick.redhat.com&amp;lt;/span&amp;gt; time server, though you are free to substitute your preferred time source.&lt;br /&gt;
&lt;br /&gt;
First, add the timeserver to the NTP configuration file by appending the following lines to the end of 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;
echo server tick.redhat.com$&#039;\n&#039;restrict tick.redhat.com mask 255.255.255.255 nomodify notrap noquery &amp;gt;&amp;gt; /etc/ntp.conf&lt;br /&gt;
tail -n 4 /etc/ntp.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;
# Specify the key identifier to use with the ntpq utility.&lt;br /&gt;
#controlkey 8&lt;br /&gt;
server tick.redhat.com&lt;br /&gt;
restrict tick.redhat.com mask 255.255.255.255 nomodify notrap noquery&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now make sure that the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ntpd&amp;lt;/span&amp;gt; service starts on boot, then start it manually.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
chkconfig ntpd on&lt;br /&gt;
/etc/init.d/ntpd 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 ntpd:                                             [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Altering Boot Up ==&lt;br /&gt;
&lt;br /&gt;
{{note|1=The next two steps are optional.}}&lt;br /&gt;
&lt;br /&gt;
There are two changes I like to make on my nodes. These are not required, but I find it helps to keep things as simple as possible. Particularly in the earlier learning and testing stages.&lt;br /&gt;
&lt;br /&gt;
=== Changing the Default Run-Level ===&lt;br /&gt;
&lt;br /&gt;
If you choose not to implement it, please change any referenced to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/rc3.d&amp;lt;/span&amp;gt; to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/rc5.d&amp;lt;/span&amp;gt; later in this tutorial.&lt;br /&gt;
&lt;br /&gt;
I prefer to minimize the running daemons and apps on my nodes for two reasons; Performance and security. One of the simplest ways to minimize the number of running programs is to change the run-level to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;3&amp;lt;/span&amp;gt; by editing &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/inittab&amp;lt;/span&amp;gt;. This tells the node when it boots not to start the graphical interface and instead simply boot to a &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[bash]]&amp;lt;/span&amp;gt; shell.&lt;br /&gt;
&lt;br /&gt;
This change is actually quite simple. Simple edit &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/inittab&amp;lt;/span&amp;gt; and change the line &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;id:5:initdefault:&amp;lt;/span&amp;gt; to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;id:3:initdefault:&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;
cp /etc/inittab /etc/inittab.orig&lt;br /&gt;
sed -i &#039;s/id:5:initdefault/id:3:initdefault/g&#039; /etc/inittab&lt;br /&gt;
diff -u /etc/inittab.orig /etc/inittab&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;diff&amp;quot;&amp;gt;&lt;br /&gt;
--- /etc/inittab.orig	2011-05-01 20:54:35.000000000 -0400&lt;br /&gt;
+++ /etc/inittab	2011-05-01 20:56:43.000000000 -0400&lt;br /&gt;
@@ -15,7 +15,7 @@&lt;br /&gt;
 #   5 - X11&lt;br /&gt;
 #   6 - reboot (Do NOT set initdefault to this)&lt;br /&gt;
 # &lt;br /&gt;
-id:5:initdefault:&lt;br /&gt;
+id:3:initdefault:&lt;br /&gt;
 &lt;br /&gt;
 # System initialization.&lt;br /&gt;
 si::sysinit:/etc/rc.d/rc.sysinit&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you are still in a graphical environment and want to disable the [[GUI]] without rebooting, you can run &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;init 3&amp;lt;/span&amp;gt;. Conversely, if you want to start the GUI for a certain task, you can do so my running &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;init 5&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Making Boot Messages Visible ===&lt;br /&gt;
&lt;br /&gt;
Another optional step, in-line with the change above, is to disable the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rhgb&amp;lt;/span&amp;gt; (Red Hat Graphical Boot) and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;quiet&amp;lt;/span&amp;gt; kernel arguments. These options provide the clean boot screen you normally see with [[EL5]], but they also hide a lot of boot messages that we may find helpful. &lt;br /&gt;
&lt;br /&gt;
To make this change, edit the [[grub]] boot-loader menu and remove the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rhgb quiet&amp;lt;/span&amp;gt; arguments from the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;kernel /vmlinuz...&amp;lt;/span&amp;gt; line. These arguments are usually the last ones on the line. If you leave this until later you may see two or more kernel entries. Delete these arguments where ever they are found.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /boot/grub/grub.conf /boot/grub/grub.conf.orig&lt;br /&gt;
sed -i &#039;s/root=LABEL=\//root=LABEL=\/ rhgb quiet/g&#039; /boot/grub/grub.conf&lt;br /&gt;
diff -u /boot/grub/grub.conf.orig /boot/grub/grub.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;diff&amp;quot;&amp;gt;&lt;br /&gt;
--- /boot/grub/grub.conf.orig	2011-05-01 21:01:43.000000000 -0400&lt;br /&gt;
+++ /boot/grub/grub.conf	2011-05-01 21:02:44.000000000 -0400&lt;br /&gt;
@@ -14,18 +14,18 @@&lt;br /&gt;
 title CentOS (2.6.18-238.9.1.el5xen)&lt;br /&gt;
 	root (hd0,0)&lt;br /&gt;
 	kernel /xen.gz-2.6.18-238.9.1.el5&lt;br /&gt;
-	module /vmlinuz-2.6.18-238.9.1.el5xen ro root=LABEL=/ rhgb quiet&lt;br /&gt;
+	module /vmlinuz-2.6.18-238.9.1.el5xen ro root=LABEL=/&lt;br /&gt;
 	module /initrd-2.6.18-238.9.1.el5xen.img&lt;br /&gt;
 title CentOS (2.6.18-238.9.1.el5)&lt;br /&gt;
 	root (hd0,0)&lt;br /&gt;
-	kernel /vmlinuz-2.6.18-238.9.1.el5 ro root=LABEL=/ rhgb quiet&lt;br /&gt;
+	kernel /vmlinuz-2.6.18-238.9.1.el5 ro root=LABEL=/&lt;br /&gt;
 	initrd /initrd-2.6.18-238.9.1.el5.img&lt;br /&gt;
 title CentOS (2.6.18-238.el5xen)&lt;br /&gt;
 	root (hd0,0)&lt;br /&gt;
 	kernel /xen.gz-2.6.18-238.el5 &lt;br /&gt;
-	module /vmlinuz-2.6.18-238.el5xen ro root=LABEL=/ rhgb quiet&lt;br /&gt;
+	module /vmlinuz-2.6.18-238.el5xen ro root=LABEL=/&lt;br /&gt;
 	module /initrd-2.6.18-238.el5xen.img&lt;br /&gt;
 title CentOS-base (2.6.18-238.el5)&lt;br /&gt;
 	root (hd0,0)&lt;br /&gt;
-	kernel /vmlinuz-2.6.18-238.el5 ro root=LABEL=/ rhgb quiet&lt;br /&gt;
+	kernel /vmlinuz-2.6.18-238.el5 ro root=LABEL=/&lt;br /&gt;
 	initrd /initrd-2.6.18-238.el5.img&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{note|1=If you&#039;re &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;grub.conf&amp;lt;/span&amp;gt; has been altered or doesn&#039;t have the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;root=LABEL=/&amp;lt;/span&amp;gt; text, you will need to manually add the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rhgb quiet&amp;lt;/span&amp;gt; to the end of the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/vmlinuz&amp;lt;/span&amp;gt; line(s).}}&lt;br /&gt;
&lt;br /&gt;
Now future reboots will show boot details in a terminal display rather than hiding those often-useful messages behind a splash screen.&lt;br /&gt;
&lt;br /&gt;
= Setting Up Xen =&lt;br /&gt;
&lt;br /&gt;
It may seem premature to discuss [[Xen]] before the cluster itself. The reason we need to look at it now, before the cluster, is because Xen makes some fairly significant changes to the networking. Given how changes to networking can effect the cluster, we will want to get these changes out of the way.&lt;br /&gt;
&lt;br /&gt;
We&#039;re not going to provision any virtual machines until the cluster is built.&lt;br /&gt;
&lt;br /&gt;
== A Brief Overview ==&lt;br /&gt;
&lt;br /&gt;
Xen is a [[hypervisor]] the converts the installed operating system into a virtual machine running on a small Xen kernel. This same small kernel also runs all of the virtual machines you will add later. In this way, you will always be working in a virtual machine once you switch to booting a Xen kernel. In Xen terminology, virtual machines are known as &#039;&#039;&#039;domains&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;host&amp;quot; operating system is known as [[dom0]] (domain 0) and has a special view of the hardware plus contains the configuration and control of Xen itself. All other Xen virtual machines are known as [[domU]] (domain U). This is a collective term that represents the transient ID number assigned to all virtual machines. For example, when you boot the first virtual machine, it is known as &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;dom1&amp;lt;/span&amp;gt;. The next will be &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;dom2&amp;lt;/span&amp;gt;, then &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;dom3&amp;lt;/span&amp;gt; and so on. Do note that if a [[domU]] shuts down, it&#039;s ID is &#039;&#039;not&#039;&#039; reused. So when it restarts, it will use the next free ID (ie: &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;dom4&amp;lt;/span&amp;gt; in this list, despite it having been, say, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;dom1&amp;lt;/span&amp;gt; initially).&lt;br /&gt;
&lt;br /&gt;
This makes Xen somewhat unique in the virtualization world. Most others do not touch or alter the &amp;quot;host&amp;quot; OS, instead running the guest VMs fully withing the context of the host operating system.&lt;br /&gt;
&lt;br /&gt;
== Understanding Networking in Xen ==&lt;br /&gt;
&lt;br /&gt;
Xen uses a fairly complex networking system. This is, perhaps, it&#039;s strongest point. The trade off though is that it can be a little tricky to wrap your head around. To help you become familiar, there is a short tutorial dedicated to this topic. Please read it over before proceeding in you are not familiar with Xen&#039;s networking.&lt;br /&gt;
&lt;br /&gt;
Taking the time to read and understand the mini-paper below will save you a lot of heartache in the following stages.&lt;br /&gt;
&lt;br /&gt;
* [[Networking in Xen 3.x]]&lt;br /&gt;
&lt;br /&gt;
Once built, this is what our inter-node network will look like. If you have trouble following this diagram, please do go back and read the link above before proceeding.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
 __________________________________________________________                         _________________________________________________________&lt;br /&gt;
|  ____________________                 an-node04 - (dom0) |                       | (dom0) - an-node05                 ___________________  |&lt;br /&gt;
| | vm0001_ws1   ______|                ________    _______|   _________________   |_______    ________                |______  vm0001_ws1 | |&lt;br /&gt;
| |   (domA)    | eth0 =-[vifA.0]------| xenbr0 |-=| eth0  =--| Internet-Facing |--=  eth0 |=-| xenbr0 |------[vifC.0]-= eth0 |   (domC)   | |&lt;br /&gt;
| |             |_____-|          /----|        |  |______-|  | Switch or VLAN  |  |-______|  |        |----\          |-_____|            | |&lt;br /&gt;
| |                    |          |    |        |          |  |_________________|  |          |        |    |          |                   | |&lt;br /&gt;
| |              ______|          |    |________|          |                       |          |________|    |          |______             | |&lt;br /&gt;
| |             | eth1 =-[vifA.2]-+-\                      |                       |                      /-+-[vivC.2]-= eth1 |            | |&lt;br /&gt;
| | [Active]    |_____-|          | |                      |                       |                      | |          |-_____|   [Backup] | |&lt;br /&gt;
| |____________________|          | |                      |                       |                      | |          |___________________| |&lt;br /&gt;
|                                 | |                      |                       |                      | |                                |&lt;br /&gt;
|  ____________________           | |                      |                       |                      | |           ___________________  |&lt;br /&gt;
| | vm0002_win1  ______|          | |               _______|   _________________   |_______               | |          |______ vm0002_win1 | |&lt;br /&gt;
| |   (domB)    | eth0 =-[vifB.0]-/ |              | eth1  =--|    Storage      |--=  eth1 |              | \-[vifD.0]-= eth0 |   (domD)   | |&lt;br /&gt;
| |             |_____-|            |              |______-|  | Switch or VLAN  |  |-______|              |            |-_____|            | |&lt;br /&gt;
| |                    |            |                      |  |_________________|  |                      |            |                   | |&lt;br /&gt;
| |              ______|            |                      |                       |                      |            |______             | |&lt;br /&gt;
| |             | eth1 =-[vifB.2]-\ |                      |                       |                      | /-[vifD.2]-= eth1 |            | |&lt;br /&gt;
| | [Backup]    |_____-|          | |                      |                       |                      | |          |-_____|   [Active] | |&lt;br /&gt;
| |____________________|          | |                      |                       |                      | |          |___________________| |&lt;br /&gt;
|                                 | |                      |                       |                      | |                                |&lt;br /&gt;
|                                 | |   ________    _______|   _________________   |_______    ________   | |                                |&lt;br /&gt;
|                                 | \--| xenbr2 |-=| eth2  =--|  Back-Channel   |--=  eth2 |=-| xenbr2 |--/ |                                |&lt;br /&gt;
|                                 \----|        |  |______-|  | Switch or VLAN  |  |-______|  |        |----/                                |&lt;br /&gt;
|                                      |        |          |  |_________________|  |          |        |                                     |&lt;br /&gt;
|                                      |________|          |                       |          |________|                                     |&lt;br /&gt;
|                                                          |                       |                                                         |&lt;br /&gt;
|                                                          |                       |                                                         |&lt;br /&gt;
|                                                          |                       |                                                         |&lt;br /&gt;
|                                                          |                       |                                                         |&lt;br /&gt;
|                                                          |                       |                                                         |&lt;br /&gt;
|__________________________________________________________|                       |_________________________________________________________|&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Making Network Interfaces Available To Xen Clients ==&lt;br /&gt;
&lt;br /&gt;
As discussed above, Xen makes some significant changes to the [[dom0]] network, which happens to be where the cluster will operate. These changes including shutting down and moving around the interfaces. As we will discuss later, this behaviour can trigger cluster failures. This is the main reason for dealing with Xen now. Once the changes are in place, the network is stable and safe for running the cluster on.&lt;br /&gt;
&lt;br /&gt;
=== A Brief Overview ===&lt;br /&gt;
&lt;br /&gt;
By default, Xen only makes &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth0&amp;lt;/span&amp;gt; available to the virtual machines. We will want to add &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth2&amp;lt;/span&amp;gt; as well, as we will use the &#039;&#039;Back Channel Network&#039;&#039; for inter-VM communication. We do &#039;&#039;&#039;not&#039;&#039;&#039; want to add the &#039;&#039;Storage Network&#039;&#039; to Xen though! Doing so puts the DRBD link at risk. Should &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xend&amp;lt;/span&amp;gt; get shut down, it could trigger a [[split-brain]] in DRBD.&lt;br /&gt;
&lt;br /&gt;
What Xen does, in brief, is move the &amp;quot;real&amp;quot; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth0&amp;lt;/span&amp;gt; over to a new device called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;peth0&amp;lt;/span&amp;gt;. Then it creates a virtual &amp;quot;clone&amp;quot; of the network interface called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth0&amp;lt;/span&amp;gt;. Next, Xen creates a [[bridge]] called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xenbr0&amp;lt;/span&amp;gt;. Finally, both the real &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;peth0&amp;lt;/span&amp;gt; and the new virtual &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth0&amp;lt;/span&amp;gt; are connected to the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xenbr0&amp;lt;/span&amp;gt; bridge.&lt;br /&gt;
&lt;br /&gt;
The reasoning behind all this is to separate the traffic coming to and from [[dom0]] from any traffic doing to the various [[domU]]s. Think of it sort of like the bridge being a network switch, the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;peth0&amp;lt;/span&amp;gt; being an uplink cable to the outside world and the virtual &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth0&amp;lt;/span&amp;gt; being [[dom0]]&#039;s &amp;quot;port&amp;quot; on the switch. We want the same to be done to the interface on the &#039;&#039;Back-Channel Network&#039;&#039;, too. The &#039;&#039;Storage Network&#039;&#039; will never be exposed to the [[domU]] machines, so combining the risk to the underlying storage, there is no reason to add &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth1&amp;lt;/span&amp;gt; to Xen&#039;s control.&lt;br /&gt;
&lt;br /&gt;
=== Disable the &#039;qemu&#039; Bridge ===&lt;br /&gt;
&lt;br /&gt;
By default, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[libvirtd]]&amp;lt;/span&amp;gt; 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. &lt;br /&gt;
&lt;br /&gt;
So to remove this bridge, simply delete the contents of the file, stop the bridge, delete the bridge and then stop &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;iptables&amp;lt;/span&amp;gt; to make sure any rules created for the bridge are flushed.&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;
ifconfig virbr0 down&lt;br /&gt;
brctl delbr virbr0&lt;br /&gt;
/etc/init.d/iptables stop&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Setting Up Bridges ===&lt;br /&gt;
&lt;br /&gt;
By default, Xen creates the bridges it will need when it starts. This works fine with basic configuration, but is no longer recommended.&lt;br /&gt;
&lt;br /&gt;
Bridges are very much like software network switches. Interfaces can be connected to them and then use them to pass data back and forth. As virtual machines are created, they will have a special &amp;quot;virtual&amp;quot; interface created. These &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vifX.Y&amp;lt;/span&amp;gt; devices are very much like a network cable between a normal server and a switch. In Xen, the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;X&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Y&amp;lt;/span&amp;gt; in the name &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vifX.Y&amp;lt;/span&amp;gt; corresponds to the domain ID, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;X&amp;lt;/span&amp;gt; and the bridge ID &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Y&amp;lt;/span&amp;gt;. For example, if you create a [[domU]] which is given the ID of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;5&amp;lt;/span&amp;gt; and you are connecting two interfaces within domU to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xenbr0&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xenbr2&amp;lt;/span&amp;gt;, you will see two virtual interfaces created, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vif5.0&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vif5.2&amp;lt;/span&amp;gt;, which connect the domU&#039;s &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;eth1&amp;lt;/span&amp;gt; to the bridges, respectively.&lt;br /&gt;
&lt;br /&gt;
If you found the above confusing, please take a look at the article below:&lt;br /&gt;
&lt;br /&gt;
* [[Networking in Xen 3.x]]&lt;br /&gt;
&lt;br /&gt;
We will now create bridges in each node for the &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; interfaces. We aren&#039;t bothering with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth1&amp;lt;/span&amp;gt; as it will only be used for storage traffic and thus will never need to be seen or used by any domU. To create the bridges, we need to do two things;&lt;br /&gt;
* Create the bridge configuration files; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/sysconfig/network-scripts/ifcfg-xenbr0&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/sysconfig/network-scripts/ifcfg-xenbr2&amp;lt;/span&amp;gt;&lt;br /&gt;
* Change the interface configuration files and connect the interfaces to the bridge.&lt;br /&gt;
&lt;br /&gt;
Note that when we create the bridge scripts, we will move the IP address information from the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ethX&amp;lt;/span&amp;gt; device to the corresponding &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xenbrX&amp;lt;/span&amp;gt; configuration file. This means that, after this change, you will see the IP address on the bridge, &#039;&#039;not&#039;&#039; the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ethX&amp;lt;/span&amp;gt; device. This is normal.&lt;br /&gt;
&lt;br /&gt;
{{note|1=It is not necessary to stop the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;network&amp;lt;/span&amp;gt; daemon before making these changes. Once you&#039;ve begun the edits though, do be careful though not to restart networking until you are complete. These changes will somewhat dramatically alter your network configuration. If you leave the network up, be aware that when you do restart the network, you will see a warning like: &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Shutting down interface eth0:  bridge xenbr0 does not exist!&amp;lt;/span&amp;gt;. This is ok.}}&lt;br /&gt;
&lt;br /&gt;
First, create the two bridge configuration files.&lt;br /&gt;
&lt;br /&gt;
For &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xenbr0&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/sysconfig/network-scripts/ifcfg-xenbr0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
# Bridge created for Xen&lt;br /&gt;
DEVICE=xenbr0&lt;br /&gt;
TYPE=Bridge&lt;br /&gt;
BOOTPROTO=static&lt;br /&gt;
IPADDR=192.168.1.74&lt;br /&gt;
NETMASK=255.255.255.0&lt;br /&gt;
GATEWAY=192.168.1.254&lt;br /&gt;
DNS1=192.139.81.117&lt;br /&gt;
DNS2=192.139.81.1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xenbr2&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/sysconfig/network-scripts/ifcfg-xenbr2&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
# Bridge created for Xen&lt;br /&gt;
DEVICE=xenbr2&lt;br /&gt;
TYPE=Bridge&lt;br /&gt;
BOOTPROTO=static&lt;br /&gt;
IPADDR=192.168.3.74&lt;br /&gt;
NETMASK=255.255.255.0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Next, edit the corresponding &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ethX&amp;lt;/span&amp;gt; devices. This will involve adding a &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;BRIDGE=xenbrX&amp;lt;/span&amp;gt; line and removing all of the IP address information. Below are the updated &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; devices after the changes have been made with a &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;diff&amp;lt;/span&amp;gt; showing exactly how the files changed.&lt;br /&gt;
&lt;br /&gt;
For &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth0&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;
cp /etc/sysconfig/network-scripts/ifcfg-eth0 /etc/sysconfig/network-scripts/ifcfg-eth0.orig&lt;br /&gt;
vim /etc/sysconfig/network-scripts/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;
# Realtek Semiconductor Co., Ltd. RTL8111/8168B PCI Express Gigabit Ethernet controller&lt;br /&gt;
HWADDR=48:5B:39:3C:53:14&lt;br /&gt;
DEVICE=eth0&lt;br /&gt;
BRIDGE=xenbr0&lt;br /&gt;
BOOTPROTO=static&lt;br /&gt;
ONBOOT=yes&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;
diff -u /etc/sysconfig/network-scripts/ifcfg-eth0.orig /etc/sysconfig/network-scripts/ifcfg-eth0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;diff&amp;quot;&amp;gt;&lt;br /&gt;
--- /etc/sysconfig/network-scripts/ifcfg-eth0.orig	2011-05-02 15:05:56.000000000 -0400&lt;br /&gt;
+++ /etc/sysconfig/network-scripts/ifcfg-eth0	2011-05-02 15:01:34.000000000 -0400&lt;br /&gt;
@@ -1,10 +1,6 @@&lt;br /&gt;
 # Realtek Semiconductor Co., Ltd. RTL8111/8168B PCI Express Gigabit Ethernet controller&lt;br /&gt;
 HWADDR=48:5B:39:3C:53:14&lt;br /&gt;
 DEVICE=eth0&lt;br /&gt;
+BRIDGE=xenbr0&lt;br /&gt;
 BOOTPROTO=static&lt;br /&gt;
 ONBOOT=yes&lt;br /&gt;
-IPADDR=192.168.1.74&lt;br /&gt;
-NETMASK=255.255.255.0&lt;br /&gt;
-GATEWAY=192.168.1.254&lt;br /&gt;
-DNS1=192.139.81.117&lt;br /&gt;
-DNS2=192.139.81.1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth2&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;
cp /etc/sysconfig/network-scripts/ifcfg-eth2 /etc/sysconfig/network-scripts/ifcfg-eth2.orig&lt;br /&gt;
vim /etc/sysconfig/network-scripts/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 82574L Gigabit Network Connection&lt;br /&gt;
HWADDR=00:1B:21:72:96:EA&lt;br /&gt;
DEVICE=eth2&lt;br /&gt;
BRIDGE=xenbr2&lt;br /&gt;
BOOTPROTO=static&lt;br /&gt;
ONBOOT=yes&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;
diff -u /etc/sysconfig/network-scripts/ifcfg-eth2.orig /etc/sysconfig/network-scripts/ifcfg-eth2&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;diff&amp;quot;&amp;gt;&lt;br /&gt;
--- /etc/sysconfig/network-scripts/ifcfg-eth2.orig	2011-05-02 15:08:36.000000000 -0400&lt;br /&gt;
+++ /etc/sysconfig/network-scripts/ifcfg-eth2	2011-05-02 15:08:20.000000000 -0400&lt;br /&gt;
@@ -1,7 +1,6 @@&lt;br /&gt;
 # Intel Corporation 82574L Gigabit Network Connection&lt;br /&gt;
 HWADDR=00:1B:21:72:96:EA&lt;br /&gt;
 DEVICE=eth2&lt;br /&gt;
+BRIDGE=xenbr2&lt;br /&gt;
 BOOTPROTO=static&lt;br /&gt;
 ONBOOT=yes&lt;br /&gt;
-IPADDR=192.168.3.74&lt;br /&gt;
-NETMASK=255.255.255.0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now restart the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;network&amp;lt;/span&amp;gt; daemon. As noted, do not be concerned about the shutdown warnings, they should appear only once.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/network 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;
Shutting down interface eth0:  bridge xenbr0 does not exist!&lt;br /&gt;
                                                           [  OK  ]&lt;br /&gt;
Shutting down interface eth1:                              [  OK  ]&lt;br /&gt;
Shutting down interface eth2:  bridge xenbr2 does not exist!&lt;br /&gt;
                                                           [  OK  ]&lt;br /&gt;
Shutting down loopback interface:                          [  OK  ]&lt;br /&gt;
Bringing up loopback interface:                            [  OK  ]&lt;br /&gt;
Bringing up interface eth0:                                [  OK  ]&lt;br /&gt;
Bringing up interface eth1:                                [  OK  ]&lt;br /&gt;
Bringing up interface eth2:                                [  OK  ]&lt;br /&gt;
Bringing up interface xenbr0:                              [  OK  ]&lt;br /&gt;
Bringing up interface xenbr2:                              [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can check that the bridges are up and that the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ethX&amp;lt;/span&amp;gt; interfaces are connected to them using the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;brctl&amp;lt;/span&amp;gt; tool.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
brctl show&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
bridge name	bridge id		STP enabled	interfaces&lt;br /&gt;
virbr0		8000.000000000000	yes		&lt;br /&gt;
xenbr0		8000.485b393c5314	no		eth0&lt;br /&gt;
xenbr2		8000.001b217296ea	no		eth2&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We&#039;ll see this reflected in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;iptables&amp;lt;/span&amp;gt; output as well.&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;
          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:276 errors:0 dropped:0 overruns:0 frame:0&lt;br /&gt;
          TX packets:168 errors:0 dropped:0 overruns:0 carrier:0&lt;br /&gt;
          collisions:0 txqueuelen:1000 &lt;br /&gt;
          RX bytes:47553 (46.4 KiB)  TX bytes:25555 (24.9 KiB)&lt;br /&gt;
          Interrupt:246 Base address:0xe000 &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:123 errors:0 dropped:0 overruns:0 frame:0&lt;br /&gt;
          TX packets:55 errors:0 dropped:0 overruns:0 carrier:0&lt;br /&gt;
          collisions:0 txqueuelen:1000 &lt;br /&gt;
          RX bytes:25758 (25.1 KiB)  TX bytes:9364 (9.1 KiB)&lt;br /&gt;
          Interrupt:17 Memory:feae0000-feb00000 &lt;br /&gt;
&lt;br /&gt;
eth2      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 MULTICAST  MTU:1500  Metric:1&lt;br /&gt;
          RX packets:161 errors:0 dropped:0 overruns:0 frame:0&lt;br /&gt;
          TX packets:69 errors:0 dropped:0 overruns:0 carrier:0&lt;br /&gt;
          collisions:0 txqueuelen:1000 &lt;br /&gt;
          RX bytes:31049 (30.3 KiB)  TX bytes:13329 (13.0 KiB)&lt;br /&gt;
          Interrupt:16 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:8 errors:0 dropped:0 overruns:0 frame:0&lt;br /&gt;
          TX packets:8 errors:0 dropped:0 overruns:0 carrier:0&lt;br /&gt;
          collisions:0 txqueuelen:0 &lt;br /&gt;
          RX bytes:560 (560.0 b)  TX bytes:560 (560.0 b)&lt;br /&gt;
&lt;br /&gt;
xenbr0    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:252 errors:0 dropped:0 overruns:0 frame:0&lt;br /&gt;
          TX packets:153 errors:0 dropped:0 overruns:0 carrier:0&lt;br /&gt;
          collisions:0 txqueuelen:0 &lt;br /&gt;
          RX bytes:41073 (40.1 KiB)  TX bytes:21327 (20.8 KiB)&lt;br /&gt;
&lt;br /&gt;
xenbr2    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:138 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:25913 (25.3 KiB)  TX bytes:9396 (9.1 KiB)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now let&#039;s move on to the main Xen configuration file!&lt;br /&gt;
&lt;br /&gt;
=== Editing the /etc/xen/xend-config.sxp Configuration File ===&lt;br /&gt;
&lt;br /&gt;
We need to do two things here:&lt;br /&gt;
* Tell Xen to enable it&#039;s unix socket so that external tools can manage it (if needed).&lt;br /&gt;
* Tell Xen to not handle bridge configuration.&lt;br /&gt;
* Enable Live Migration of VMs between nodes.&lt;br /&gt;
&lt;br /&gt;
Begin editing the Xen configuration file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/xen/xend-config.sxp /etc/xen/xend-config.sxp.orig&lt;br /&gt;
vim /etc/xen/xend-config.sxp&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{note|1=It would see that, by default, Xen now enables it&#039;s unix socket. As such, this step may not be needed.}}&lt;br /&gt;
&lt;br /&gt;
Configure Xen to enable it&#039;s unix socket. This is how tools like &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virsh&amp;lt;/span&amp;gt;, which we will look at later, interact with Xen. To do this, change &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xend-unix-server&amp;lt;/span&amp;gt;, which is around line &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;19&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;
(xend-unix-server yes)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Edit the &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 &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/bin/true&amp;lt;/span&amp;gt;. This let&#039;s the script succeed without actually doing anything. We want this behavious because we created the bridges ourselves outside of Xen.&lt;br /&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;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To enable live migration, we need to edit four values. Let&#039;s look at the new values, then we&#039;ll discuss what they effect and how their syntax works.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
(xend-relocation-server yes)&lt;br /&gt;
(xend-relocation-port 8002)&lt;br /&gt;
(xend-relocation-address &#039;an-node04.bcn&#039;)&lt;br /&gt;
(xend-relocation-hosts-allow &#039;&#039;)&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;xend-unix-server&amp;lt;/span&amp;gt;; When set to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;yes&amp;lt;/span&amp;gt;, this tells Xen to enable it&#039;s unix socket. This is needed by management tools like &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[virsh]]&amp;lt;/span&amp;gt;.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xend-relocation-server&amp;lt;/span&amp;gt;; When set to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;yes&amp;lt;/span&amp;gt;, this tells Xen to allow the migration of [[VM]]s.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xend-relocation-port&amp;lt;/span&amp;gt;; This controls what [[TCP]] port that Xen listens for migration requests.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xend-relocation-address&amp;lt;/span&amp;gt;; This is an IP address or resolvable name that must match an IP address of an interface on the local machine. This binds Xen&#039;s migration to the given interface. If set to just &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;amp;#39;&amp;amp;#39;&amp;lt;/span&amp;gt;, Xen will listen for connections on all interfaces.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xend-relocation-hosts-allow&amp;lt;/span&amp;gt;; This is a space-separated list of host names, IP addresses and regular expressions of hosts that are allowed to be migration sources and targets. Some examples are; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04 an-node05 ^192\.168\.*$&amp;lt;/span&amp;gt;. If set to just &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;amp;#39;&amp;amp;#39;&amp;lt;/span&amp;gt;, Xen will allow migration to or from all nodes on the network. As we&#039;ve already restricted migrate to the &#039;&#039;&#039;BCN&#039;&#039;&#039; by way of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xend-relocation-address &#039;an-node04.bcn&#039;&amp;lt;/span&amp;gt;, it&#039;s save to leave this open to any host.&lt;br /&gt;
&lt;br /&gt;
{{note|1=Be sure that you set &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xend-relocation-address&amp;lt;/span&amp;gt; is set uniquely for each node.}}&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;diff&amp;lt;/span&amp;gt; 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;
diff -u /etc/xen/xend-config.sxp.orig /etc/xen/xend-config.sxp&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;diff&amp;quot;&amp;gt;&lt;br /&gt;
--- /etc/xen/xend-config.sxp.orig	2011-05-02 15:52:27.000000000 -0400&lt;br /&gt;
+++ /etc/xen/xend-config.sxp	2011-05-02 16:01:33.000000000 -0400&lt;br /&gt;
@@ -19,6 +19,7 @@&lt;br /&gt;
 #(xend-tcp-xmlrpc-server no)&lt;br /&gt;
 #(xend-unix-xmlrpc-server yes)&lt;br /&gt;
 #(xend-relocation-server no)&lt;br /&gt;
+(xend-relocation-server yes)&lt;br /&gt;
 # The relocation server should be kept desactivated unless using a trusted&lt;br /&gt;
 # network, the domain virtual memory will be exchanged in raw form without&lt;br /&gt;
 # encryption of the communication. See also xend-relocation-hosts-allow option&lt;br /&gt;
@@ -31,6 +32,7 @@&lt;br /&gt;
 # Port xend should use for the relocation interface, if xend-relocation-server&lt;br /&gt;
 # is set.&lt;br /&gt;
 #(xend-relocation-port 8002)&lt;br /&gt;
+(xend-relocation-port 8002)&lt;br /&gt;
 &lt;br /&gt;
 # Address xend should listen on for HTTP connections, if xend-http-server is&lt;br /&gt;
 # set.&lt;br /&gt;
@@ -45,6 +47,7 @@&lt;br /&gt;
 # Also, interface name is allowed (e.g. eth0) there to get the&lt;br /&gt;
 # relocation address to be bound on.&lt;br /&gt;
 #(xend-relocation-address &#039;&#039;)&lt;br /&gt;
+(xend-relocation-address &#039;an-node04.bcn&#039;)&lt;br /&gt;
 &lt;br /&gt;
 # The hosts allowed to talk to the relocation port.  If this is empty (the&lt;br /&gt;
 # default), then all connections are allowed (assuming that the connection&lt;br /&gt;
@@ -57,8 +60,8 @@&lt;br /&gt;
 # For example:&lt;br /&gt;
 #  (xend-relocation-hosts-allow &#039;^localhost$ ^.*\.example\.org$&#039;)&lt;br /&gt;
 #&lt;br /&gt;
-#(xend-relocation-hosts-allow &#039;&#039;)&lt;br /&gt;
-(xend-relocation-hosts-allow &#039;^localhost$ ^localhost\\.localdomain$&#039;)&lt;br /&gt;
+(xend-relocation-hosts-allow &#039;&#039;)&lt;br /&gt;
+#(xend-relocation-hosts-allow &#039;^localhost$ ^localhost\\.localdomain$&#039;)&lt;br /&gt;
 &lt;br /&gt;
 # The limit (in kilobytes) on the size of the console buffer&lt;br /&gt;
 #(console-limit 1024)&lt;br /&gt;
@@ -90,7 +93,8 @@&lt;br /&gt;
 # two fake interfaces per guest domain.  To do things like this, write&lt;br /&gt;
 # yourself a wrapper script, and call network-bridge from it, as appropriate.&lt;br /&gt;
 #&lt;br /&gt;
-(network-script network-bridge)&lt;br /&gt;
+#(network-script network-bridge)&lt;br /&gt;
+(network-script /bin/true)&lt;br /&gt;
 &lt;br /&gt;
 # The script used to control virtual interfaces.  This can be overridden on a&lt;br /&gt;
 # per-vif basis when creating a domain or a configuring a new vif.  The&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Make the changes take effect by (re)starting &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;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
restart xend:                                              [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Cluster Setup =&lt;br /&gt;
&lt;br /&gt;
In [[Red Hat]] Cluster Services, the heart of the cluster is found in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[RHCS v2 cluster.conf|/etc/cluster/cluster.conf]]&amp;lt;/span&amp;gt; [[XML]] configuration file.&lt;br /&gt;
&lt;br /&gt;
There are three main ways of editing this file. Two are already well documented, so I won&#039;t bother discussing them, beyond introducing them. The third way is by directly hand-crafting the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cluster.conf&amp;lt;/span&amp;gt; file. This method is not very well documented, and directly manipulating configuration files is my preferred method. As my boss loves to say; &amp;quot;&#039;&#039;The more computers do for you, the more they do to you&#039;&#039;&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
The first two, well documented, graphical tools are:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[http://docs.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/5/html/Cluster_Administration/ch-config-scc-CA.html system-config-cluster]&amp;lt;/span&amp;gt;, older GUI tool run directly from one of the cluster nodes.&lt;br /&gt;
* [http://docs.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/5/html/Cluster_Administration/ch-config-conga-CA.html Conga], comprised of the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ricci&amp;lt;/span&amp;gt; node-side client and the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;luci&amp;lt;/span&amp;gt; web-based server (can be run on machines outside the cluster).&lt;br /&gt;
&lt;br /&gt;
I do like the tools above, but I often find issues that send me back to the command line. I&#039;d recommend setting them aside for now as well. Once you feel comfortable with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cluster.conf&amp;lt;/span&amp;gt; syntax, then by all means, go back and use them. I&#039;d recommend not relying on them though, which might be the case if you try to use them too early in your studies.&lt;br /&gt;
&lt;br /&gt;
== The First cluster.conf Foundation Configuration ==&lt;br /&gt;
&lt;br /&gt;
The very first stage of building the cluster is to create a configuration file that is as minimal as possible. To do that, we need to define a few thing;&lt;br /&gt;
&lt;br /&gt;
* The name of the cluster and the cluster file version.&lt;br /&gt;
** Define &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt; options&lt;br /&gt;
** The nodes in the cluster&lt;br /&gt;
*** The fence method for each node&lt;br /&gt;
** Define fence devices&lt;br /&gt;
** Define &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fenced&amp;lt;/span&amp;gt; options&lt;br /&gt;
&lt;br /&gt;
That&#039;s it. Once we&#039;ve defined this minimal amount, we will be able to start the cluster for the first time! So lets get to it, finally.&lt;br /&gt;
&lt;br /&gt;
=== Name the Cluster and Set The Configuration Version ===&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[RHCS_v2_cluster.conf#cluster.3B_The_Parent_Tag|cluster]]&amp;lt;/span&amp;gt; tag is the parent tag for the entire cluster configuration file.&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-cluster01&amp;quot; config_version=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/cluster&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This has two attributes that we need to set are &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;name=&amp;quot;&amp;quot;&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;config_version=&amp;quot;&amp;quot;&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[RHCS v2 cluster.conf#name|name]]=&amp;quot;&amp;quot;&amp;lt;/span&amp;gt; attribute defines the name of the cluster. It must be unique amongst the clusters on your network. It should be descriptive, but you will not want to make it too long, either. You will see this name in the various cluster tools and you will enter in, for example, when creating a [[GFS2]] partition later on. This tutorial uses the cluster name &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an_cluster&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[RHCS v2 cluster.conf#config_version|config_version]]=&amp;quot;&amp;quot;&amp;lt;/span&amp;gt; attribute is an integer marking the version of the configuration file. Whenever you make a change to the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cluster.conf&amp;lt;/span&amp;gt; file, you will need to increment this version number by 1. If you don&#039;t increment this number, then the cluster tools will not know that the file needs to be reloaded. As this is the first version of this configuration file, it will start with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt;. Note that this tutorial will increment the version after every change, regardless of whether it is explicitly pushed out to the other nodes and reloaded. The reason is to help get into the habit of always increasing this value.&lt;br /&gt;
&lt;br /&gt;
=== Configuring cman Options ===&lt;br /&gt;
&lt;br /&gt;
We are going to setup a special case for our cluster; A 2-Node cluster.&lt;br /&gt;
&lt;br /&gt;
This is a special case because traditional quorum will not be useful. With only two nodes, each having a vote of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt;, the total votes is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;2&amp;lt;/span&amp;gt;. Quorum needs &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;50% + 1&amp;lt;/span&amp;gt;, which means that a single node failure would shut down the cluster, as the remaining node&#039;s vote is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;50%&amp;lt;/span&amp;gt; exactly. That kind of defeats the purpose to having a cluster at all.&lt;br /&gt;
&lt;br /&gt;
So to account for this special case, there is a special attribute called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[RHCS_v2_cluster.conf#two_node|two_node]]=&amp;quot;1&amp;quot;&amp;lt;/span&amp;gt;. This tells the cluster manager to continue operating with only one vote. This option requires that the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[RHCS_v2_cluster.conf#expected_votes|expected_votes]]=&amp;quot;&amp;quot;&amp;lt;/span&amp;gt; attribute be set to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt;. Normally, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;expected_votes&amp;lt;/span&amp;gt; is set automatically to the total sum of the defined cluster nodes&#039; votes (which itself is a default of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt;). This is the other half of the &amp;quot;trick&amp;quot;, as a single node&#039;s vote of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt; now always provides quorum (that is, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt; meets the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;50% + 1&amp;lt;/span&amp;gt; requirement).&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-cluster01&amp;quot; config_version=&amp;quot;2&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;cman expected_votes=&amp;quot;1&amp;quot; two_node=&amp;quot;1&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/cluster&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Take note of the self-closing &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;... /&amp;gt;&amp;lt;/span&amp;gt; tag. This is an [[XML]] syntax that tells the parser not to look for any child or a closing tags.&lt;br /&gt;
&lt;br /&gt;
=== Defining Cluster Nodes ===&lt;br /&gt;
&lt;br /&gt;
This example is a little artificial, please don&#039;t load it into your cluster as we will need to add a few child tags, but one thing at a time.&lt;br /&gt;
&lt;br /&gt;
This actually introduces two tags.&lt;br /&gt;
&lt;br /&gt;
The first is parent &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[RHCS_v2_cluster.conf#clusternodes.3B_Defining_Cluster_Nodes|clusternodes]]&amp;lt;/span&amp;gt; tag, which takes no variables of it&#039;s own. It&#039;s sole purpose is to contain the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[RHCS_v2_cluster.conf#Tag.3B_clusternode|clusternode]]&amp;lt;/span&amp;gt; child tags. &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-cluster01&amp;quot; config_version=&amp;quot;3&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;cman expected_votes=&amp;quot;1&amp;quot; two_node=&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-node04.alteeve.com&amp;quot; nodeid=&amp;quot;1&amp;quot; /&amp;gt;&lt;br /&gt;
		&amp;lt;clusternode name=&amp;quot;an-node05.alteeve.com&amp;quot; nodeid=&amp;quot;2&amp;quot; /&amp;gt;&lt;br /&gt;
	&amp;lt;/clusternodes&amp;gt;&lt;br /&gt;
&amp;lt;/cluster&amp;gt;&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;[[RHCS_v2_cluster.conf#Tag.3B_clusternode|clusternode]]&amp;lt;/span&amp;gt; tag defines each cluster node. There are many attributes available, but we will look at just the two required ones. &lt;br /&gt;
&lt;br /&gt;
The first is the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[RHCS_v2_cluster.conf#clusternode.27s_name_attribute|name]]=&amp;quot;&amp;quot;&amp;lt;/span&amp;gt; attribute. This &#039;&#039;&#039;should&#039;&#039;&#039; match the name given by &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;uname -n&amp;lt;/span&amp;gt; (&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;$HOSTNAME&amp;lt;/span&amp;gt;) when run on each node. The [[IP]] address that the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;name&amp;lt;/span&amp;gt; resolves to also sets the interface and subnet that the [[totem]] ring will run on. That is, the main cluster communications, which we are calling the &#039;&#039;&#039;Back-Channel Network&#039;&#039;&#039;. This is why it is so important to setup our &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[Red_Hat_Cluster_Service_2_Tutorial#Setup_.2Fetc.2Fhosts|/etc/hosts]]&amp;lt;/span&amp;gt; file correctly. Please see the [[RHCS_v2_cluster.conf#clusternode.27s_name_attribute|clusternode&#039;s name]] attribute document for details on how name to interface mapping is resolved.&lt;br /&gt;
&lt;br /&gt;
The second attribute is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[RHCS_v2_cluster.conf#clusternode.27s_nodeid_attribute|nodeid]]=&amp;quot;&amp;quot;&amp;lt;/span&amp;gt;. This must be a unique integer amongst the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;clusternode ...&amp;gt;&amp;lt;/span&amp;gt; tags. It is used by the cluster to identify the node.&lt;br /&gt;
&lt;br /&gt;
=== Defining Fence Devices ===&lt;br /&gt;
&lt;br /&gt;
[[Red_Hat_Cluster_Service_2_Tutorial#Concept.3B_Fencing|Fencing]] devices are designed to forcible eject a node from a cluster. This is done by forcing it to power off or reboot, generally. Some [[SAN]] switches can logically disconnect a node from the shared storage device, which has the same effect of guaranteeing that the defective node can not alter the shared storage. A common, third type of fence device is one that cuts the mains power to the server.&lt;br /&gt;
&lt;br /&gt;
All fence devices are contained withing the parent &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[RHCS_v2_cluster.conf#fencedevices.3B_Defining_Fence_Devices|fencedevices]]&amp;lt;/span&amp;gt; tag. This parent tag has no attributes. Within this parent tag are one or more &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[RHCS_v2_cluster.conf#Tag.3B_fencedevice|fencedevice]]&amp;lt;/span&amp;gt; child tags.&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-cluster01&amp;quot; config_version=&amp;quot;4&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;cman expected_votes=&amp;quot;1&amp;quot; two_node=&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-node04.alteeve.com&amp;quot; nodeid=&amp;quot;1&amp;quot; /&amp;gt;&lt;br /&gt;
		&amp;lt;clusternode name=&amp;quot;an-node05.alteeve.com&amp;quot; nodeid=&amp;quot;2&amp;quot; /&amp;gt;&lt;br /&gt;
	&amp;lt;/clusternodes&amp;gt;&lt;br /&gt;
	&amp;lt;fencedevices&amp;gt;&lt;br /&gt;
		&amp;lt;fencedevice agent=&amp;quot;fence_na&amp;quot; ipaddr=&amp;quot;fence_na01.alteeve.com&amp;quot; login=&amp;quot;admin&amp;quot; name=&amp;quot;fence_na01&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;
Every fence device used in your cluster will have it&#039;s own &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[RHCS_v2_cluster.conf#Tag.3B_fencedevice|fencedevice]]&amp;lt;/span&amp;gt; tag. If you are using [[IPMI]], this means you will have a &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fencedevice&amp;lt;/span&amp;gt; entry for each node, as each physical IPMI [[BMC]] is a unique fence device.&lt;br /&gt;
&lt;br /&gt;
All &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fencedevice&amp;lt;/span&amp;gt; tags share two basic attributes; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[RHCS_v2_cluster.conf#fencedevice.27s_name_attribute|name]]=&amp;quot;&amp;quot;&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[RHCS_v2_cluster.conf#fencedevice.27s_agent_attribute|agent]]=&amp;quot;&amp;quot;&amp;lt;/span&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
* The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;name&amp;lt;/span&amp;gt; attribute must be unique among all the fence devices in your cluster. As we will see in the next step, this name will be used within the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;clusternode...&amp;gt;&amp;lt;/span&amp;gt; tag. &lt;br /&gt;
* The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;agent&amp;lt;/span&amp;gt; tag tells the cluster which [[fence agent]] to use when the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[fenced]]&amp;lt;/span&amp;gt; daemon needs to communicate with the physical fence device. A fence agent is simple a shell script that acts as a glue layer between the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fenced&amp;lt;/span&amp;gt; daemon and the fence hardware. This agent takes the arguments from the daemon, like what port to act on and what action to take, and executes the node. The agent is responsible for ensuring that the execution succeeded and returning an appropriate success or failure exit code, depending. For those curious, the full details are described in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[http://sources.redhat.com/cluster/wiki/FenceAgentAPI FenceAgentAPI]&amp;lt;/span&amp;gt;. If you have two or more of the same fence device, like IPMI, then you will use the same fence &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;agent&amp;lt;/span&amp;gt; value a corresponding number of times.&lt;br /&gt;
&lt;br /&gt;
Beyond these two attributes, each fence agent will have it&#039;s own subset of attributes. The scope of which is outside this tutorial, though we will see examples for IPMI, a switched PDU and a [[Node Assassin]]. Most, if not all, fence agents have a corresponding man page that will show you what attributes it accepts and how they are used. The two fence agents we will see here have their attributes defines in the following &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[man]]&amp;lt;/span&amp;gt; pages.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;man fence_na&amp;lt;/span&amp;gt; - Node Assassin fence agent&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;man fence_ipmilan&amp;lt;/span&amp;gt; - IPMI fence agent&lt;br /&gt;
&lt;br /&gt;
The example above is what this tutorial will use.&lt;br /&gt;
&lt;br /&gt;
==== Example &amp;lt;fencedevice...&amp;gt; Tag For Node Assassin ====&lt;br /&gt;
&lt;br /&gt;
This is the device used throughout this tutorial. It is for the open source, open hardware [[Node Assassin]] fence device that you can build yourself.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;fencedevices&amp;gt;&lt;br /&gt;
		&amp;lt;fencedevice agent=&amp;quot;fence_na&amp;quot; ipaddr=&amp;quot;fence_na01.alteeve.com&amp;quot; login=&amp;quot;admin&amp;quot; name=&amp;quot;fence_na01&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;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Being a network-attached fence device, as most fence devices are, the attributes for &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fence_na&amp;lt;/span&amp;gt; include connection information. The attribute variable names are generally the same across fence agents, and they are:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ipaddr&amp;lt;/span&amp;gt;; This is the resolvable name or [[IP]] address of the device. If you use a resolvable name, it is strongly advised that you put the name in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/hosts&amp;lt;/span&amp;gt; as [[DNS]] is another layer of abstraction which could fail.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;login&amp;lt;/span&amp;gt;; This is the login name to use when the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fenced&amp;lt;/span&amp;gt; daemon connects to the device. This is configured in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/cluster/fence_na.conf&amp;lt;/span&amp;gt;.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;passwd&amp;lt;/span&amp;gt;; This is the login password to use when the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fenced&amp;lt;/span&amp;gt; daemon connects to the device. This is also configured in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/cluster/fence_na.conf&amp;lt;/span&amp;gt;.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;name&amp;lt;/span&amp;gt;; This is the name of this particular fence device within the cluster which, as we will see shortly, is matched in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;clusternode...&amp;gt;&amp;lt;/span&amp;gt; element where appropriate.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;quiet&amp;lt;/span&amp;gt;; This is a Node Assassin specific argument. It is used to generate no output to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[STDOUT]]&amp;lt;/span&amp;gt; when run, as there is no terminal to print to or user to view it.&lt;br /&gt;
&lt;br /&gt;
==== Example &amp;lt;fencedevice...&amp;gt; Tag For IPMI ====&lt;br /&gt;
&lt;br /&gt;
Here we will show what [[IPMI]] &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;fencedevice...&amp;gt;&amp;lt;/span&amp;gt; tags look like. We won&#039;t be using it ourselves, but it is quite popular as a fence device so I wanted to show an example of it&#039;s use.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;fencedevices&amp;gt;&lt;br /&gt;
		&amp;lt;fencedevice name=&amp;quot;an01_ipmi&amp;quot; agent=&amp;quot;fence_ipmilan&amp;quot; ipaddr=&amp;quot;192.168.4.74&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;an02_ipmi&amp;quot; agent=&amp;quot;fence_ipmilan&amp;quot; ipaddr=&amp;quot;192.168.4.75&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;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ipaddr&amp;lt;/span&amp;gt;; This is the resolvable name or [[IP]] address of the device. If you use a resolvable name, it is strongly advised that you put the name in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/hosts&amp;lt;/span&amp;gt; as [[DNS]] is another layer of abstraction which could fail.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;login&amp;lt;/span&amp;gt;; This is the login name to use when the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fenced&amp;lt;/span&amp;gt; daemon connects to the device.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;passwd&amp;lt;/span&amp;gt;; This is the login password to use when the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fenced&amp;lt;/span&amp;gt; daemon connects to the device.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;name&amp;lt;/span&amp;gt;; This is the name of this particular fence device within the cluster which, as we will see shortly, is matched in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;clusternode...&amp;gt;&amp;lt;/span&amp;gt; element where appropriate.&lt;br /&gt;
&lt;br /&gt;
{{note|1=We will see shortly that, unlike switched PDUs, Node Assassin or other network fence devices, [[IPMI]] does not have ports. This is because each [[IPMI]] BMC supports just it&#039;s host system. More on that later.}}&lt;br /&gt;
&lt;br /&gt;
==== Example &amp;lt;fencedevice...&amp;gt; Tag For HP&#039;s iLO ====&lt;br /&gt;
&lt;br /&gt;
Getting [[iLO]] to work in the cluster is a little trickier as the [[RPM]]s used to enable iLO must be downloaded from [[HP]]&#039;s website and manually installed. There is a &amp;quot;quickie&amp;quot; tutorial that covers getting iLO working on [[EL5]] below.&lt;br /&gt;
&lt;br /&gt;
* [[Configuring HP iLO 2 on EL5]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;fencedevices&amp;gt;&lt;br /&gt;
		&amp;lt;fencedevice name=&amp;quot;an01_ilo&amp;quot; agent=&amp;quot;fence_ilo&amp;quot; ipaddr=&amp;quot;192.168.4.74&amp;quot; login=&amp;quot;Administrator&amp;quot; passwd=&amp;quot;secret&amp;quot; /&amp;gt;&lt;br /&gt;
		&amp;lt;fencedevice name=&amp;quot;an02_ilo&amp;quot; agent=&amp;quot;fence_ilo&amp;quot; ipaddr=&amp;quot;192.168.4.75&amp;quot; login=&amp;quot;Administrator&amp;quot; passwd=&amp;quot;secret&amp;quot; /&amp;gt;&lt;br /&gt;
	&amp;lt;/fencedevices&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Example &amp;lt;fencedevice...&amp;gt; Tag For APC Switched PDUs ====&lt;br /&gt;
&lt;br /&gt;
Here we will show how to configure APC switched [[PDU]] &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;fencedevice...&amp;gt;&amp;lt;/span&amp;gt; tags. We won&#039;t be using it in this tutorial, but in the real world, it is &#039;&#039;&#039;highly&#039;&#039;&#039; recommended as a backup fence device for [[IMPI]] and similar primary fence devices.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
	...&lt;br /&gt;
		&amp;lt;fence&amp;gt;&lt;br /&gt;
			&amp;lt;method name=&amp;quot;pdu&amp;quot;&amp;gt;&lt;br /&gt;
				&amp;lt;device name=&amp;quot;pdu001&amp;quot; action=&amp;quot;reboot&amp;quot; port=&amp;quot;1&amp;quot;/&amp;gt;&lt;br /&gt;
			&amp;lt;/method&amp;gt;&lt;br /&gt;
		&amp;lt;/fence&amp;gt;&lt;br /&gt;
	...&lt;br /&gt;
	&amp;lt;fencedevices&amp;gt;&lt;br /&gt;
		&amp;lt;fencedevice name=&amp;quot;pdu001&amp;quot; agent=&amp;quot;fence_apc&amp;quot; ipaddr=&amp;quot;192.168.3.6&amp;quot; login=&amp;quot;apc&amp;quot; passwd=&amp;quot;secret&amp;quot;/&amp;gt;&lt;br /&gt;
	&amp;lt;/fencedevices&amp;gt;&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;ipaddr&amp;lt;/span&amp;gt;; This is the resolvable name or [[IP]] address of the device. If you use a resolvable name, it is strongly advised that you put the name in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/hosts&amp;lt;/span&amp;gt; as [[DNS]] is another layer of abstraction which could fail.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;login&amp;lt;/span&amp;gt;; This is the login name to use when the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fenced&amp;lt;/span&amp;gt; daemon connects to the device.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;passwd&amp;lt;/span&amp;gt;; This is the login password to use when the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fenced&amp;lt;/span&amp;gt; daemon connects to the device.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;name&amp;lt;/span&amp;gt;; This is the name of this particular fence device within the cluster which, as we will see shortly, is matched in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;clusternode...&amp;gt;&amp;lt;/span&amp;gt; element where appropriate.&lt;br /&gt;
&lt;br /&gt;
=== Using the Fence Devices ===&lt;br /&gt;
&lt;br /&gt;
Now we have nodes and fence devices defined, we will go back and tie them together. This is done by:&lt;br /&gt;
* Defining a &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[RHCS_v2_cluster.conf#Tag.3B_fence|fence]]&amp;lt;/span&amp;gt; tag containing all fence methods and devices.&lt;br /&gt;
** Defining one or more &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[RHCS_v2_cluster.conf#Tag.3B_method|method]]&amp;lt;/span&amp;gt; tag(s) containing the device call(s) needed for each fence attempt.&lt;br /&gt;
*** Defining one or more &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[RHCS_v2_cluster.conf#Tag.3B_device|device]]&amp;lt;/span&amp;gt; tag(s) containing attributes describing how to call the fence device to kill this node.&lt;br /&gt;
&lt;br /&gt;
This tutorial will be using just a [[Node Assassin]] fence device. We&#039;ll look at an example adding [[IPMI]] in a moment though, as IPMI is a very common fence device and one you will very likely use.&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-cluster01&amp;quot; config_version=&amp;quot;5&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;cman expected_votes=&amp;quot;1&amp;quot; two_node=&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-node04.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;fence_na01&amp;quot; port=&amp;quot;04&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-node05.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;fence_na01&amp;quot; port=&amp;quot;03&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_na01&amp;quot; agent=&amp;quot;fence_na&amp;quot; ipaddr=&amp;quot;fence_na01.alteeve.com&amp;quot; login=&amp;quot;admin&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;
{{note|1=You might note that the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05.alteeve.com&amp;lt;/span&amp;gt; has it&#039;s fence port set to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;03&amp;lt;/span&amp;gt;. In my case, I fried my second Node Assassin during testing and didn&#039;t get a chance to replace it. So instead I plugged it into port &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;03&amp;lt;/span&amp;gt;, which, conveniently, also helps illustrate that the port numbers do not need to relate in any way to the node names. This is probably self-evident, I do admit.}}&lt;br /&gt;
&lt;br /&gt;
First, notice that the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[RHCS_v2_cluster.conf#Tag.3B_fence|fence]]&amp;lt;/span&amp;gt; tag has no attributes. It&#039;s merely a container for the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[RHCS_v2_cluster.conf#Tag.3B_method|method]](s)&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The next level is the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[RHCS_v2_cluster.conf#Tag.3B_method|method]]&amp;lt;/span&amp;gt; named &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;node_assassin&amp;lt;/span&amp;gt;. This name is merely a description and can be whatever you feel is most appropriate. It&#039;s purpose is simply to help you distinguish this method from other methods. The reason for &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;method&amp;lt;/span&amp;gt; tags is that some fence device calls will have two or more steps. A classic example would be a node with a redundant power supply on a switch PDU acting as the fence device. In such a case, you will need to define multiple &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[RHCS_v2_cluster.conf#Tag.3B_device|device]]&amp;lt;/span&amp;gt; tags, one for each power cable feeding the node. In such a case, the cluster will not consider the fence a success unless and until all contained &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[RHCS_v2_cluster.conf#Tag.3B_device|device]]&amp;lt;/span&amp;gt; calls execute successfully.&lt;br /&gt;
&lt;br /&gt;
The actual fence &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[RHCS_v2_cluster.conf#Tag.3B_device|device]]&amp;lt;/span&amp;gt; configuration is the final piece of the puzzle. It is here that you specify per-node configuration options and link these attributes to a given &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[RHCS_v2_cluster.conf#Tag.3B_fencedevice|fencedevice]]&amp;lt;/span&amp;gt;. Here, we see the link to the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fencedevice&amp;lt;/span&amp;gt; via the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[RHCS_v2_cluster.conf#device.27s_name_attribute|name]]&amp;lt;/span&amp;gt;, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fence_na01&amp;lt;/span&amp;gt; in this example.&lt;br /&gt;
&lt;br /&gt;
Let&#039;s step through an example fence call to help show how the per-cluster and fence device attributes are combined during a fence call.&lt;br /&gt;
&lt;br /&gt;
* The cluster manager decides that a node needs to be fenced. Let&#039;s say that the victim is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt;.&lt;br /&gt;
* The first &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;method&amp;lt;/span&amp;gt; in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fence&amp;lt;/span&amp;gt; section under &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt; is consulted. Within it there is just one &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;device&amp;lt;/span&amp;gt;, named &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fence_na01&amp;lt;/span&amp;gt; and having two attributes;&lt;br /&gt;
** &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;port&amp;lt;/span&amp;gt;; This tells the cluster that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt; is connected to the Node Assassin&#039;s port number &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;03&amp;lt;/span&amp;gt;.&lt;br /&gt;
** &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;action&amp;lt;/span&amp;gt;; This tells the cluster that the fence action to take is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;reboot&amp;lt;/span&amp;gt;. How this action is actually interpreted depends on the fence device in use, though the name certainly implies that the node will be forced off and then restarted.&lt;br /&gt;
* The cluster searches in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fencedevices&amp;lt;/span&amp;gt; for a &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fencedevice&amp;lt;/span&amp;gt; matching the name &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fence_na01&amp;lt;/span&amp;gt;. This fence device has five attributes; &lt;br /&gt;
** &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;agent&amp;lt;/span&amp;gt;; This tells the cluster to call the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fence_na&amp;lt;/span&amp;gt; fence agent script, as we discussed earlier.&lt;br /&gt;
** &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ipaddr&amp;lt;/span&amp;gt;; This tells the fence agent where on the network to find this particular Node Assassin. This is how multiple fence devices of the same type can be used in the cluster.&lt;br /&gt;
** &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;login&amp;lt;/span&amp;gt;; This is the login user name to use when authenticating against the fence device.&lt;br /&gt;
** &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;passwd&amp;lt;/span&amp;gt;; This is the password to supply along with the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;login&amp;lt;/span&amp;gt; name when authenticating against the fence device.&lt;br /&gt;
** &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;quiet&amp;lt;/span&amp;gt;; This is a device-specific argument that Node Assassin uses (see &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;man fence_na&amp;lt;/span&amp;gt; for details).&lt;br /&gt;
* With this information collected and compiled, the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fenced&amp;lt;/span&amp;gt; daemon will call the fence agent and pass it the attribute &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;variable=value&amp;lt;/span&amp;gt; pairs, one per line. Thus, the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fenced&amp;lt;/span&amp;gt; daemon will call:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/usr/sbin/fence_na&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then it will pass to that agent the following arguments:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
ipaddr=fence_na01.alteeve.com&lt;br /&gt;
login=admin&lt;br /&gt;
passwd=secret&lt;br /&gt;
quiet=1&lt;br /&gt;
port=02&lt;br /&gt;
action=reboot&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As you can see then, the first four arguments are from the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fencedevice&amp;lt;/span&amp;gt; attributes and the last two are from the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;device&amp;lt;/span&amp;gt; attributes under &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt;&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clusternode&amp;lt;/span&amp;gt;&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fence&amp;lt;/span&amp;gt; tag. &lt;br /&gt;
&lt;br /&gt;
When you have two or more &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;method&amp;lt;/span&amp;gt; tags defined, then the first in the list will be tried. If any of it&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;device&amp;lt;/span&amp;gt; tags fail, then the method is considered to have failed and the next method is consulted. This will repeat until all &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;method&amp;lt;/span&amp;gt; entries have been tried. At that point, the cluster goes back to the first &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;method&amp;lt;/span&amp;gt; and tries again, repeating the walk through of all methods. This loop will continue until one &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;method&amp;lt;/span&amp;gt; succeeds, regardless of how long that might take.&lt;br /&gt;
&lt;br /&gt;
==== An Example Showing IPMI&#039;s Use ====&lt;br /&gt;
&lt;br /&gt;
This is a full configuration file showing what it would look like if we were using [[IPMI]] and a [[Node Assassin]] for redundant fencing.&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-cluster01&amp;quot; config_version=&amp;quot;6&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;cman expected_votes=&amp;quot;1&amp;quot; two_node=&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-node04.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;fence_na01&amp;quot; port=&amp;quot;04&amp;quot; action=&amp;quot;reboot&amp;quot;/&amp;gt;&lt;br /&gt;
				&amp;lt;/method&amp;gt;&lt;br /&gt;
				&amp;lt;method name=&amp;quot;an-node04_ipmi&amp;quot;&amp;gt;&lt;br /&gt;
					&amp;lt;device name=&amp;quot;an01_ipmi&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-node05.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;fence_na01&amp;quot; port=&amp;quot;03&amp;quot; action=&amp;quot;reboot&amp;quot;/&amp;gt;&lt;br /&gt;
				&amp;lt;/method&amp;gt;&lt;br /&gt;
				&amp;lt;method name=&amp;quot;an-node05_ipmi&amp;quot;&amp;gt;&lt;br /&gt;
					&amp;lt;device name=&amp;quot;an02_ipmi&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_na01&amp;quot; agent=&amp;quot;fence_na&amp;quot; ipaddr=&amp;quot;fence_na01.alteeve.com&amp;quot; login=&amp;quot;admin&amp;quot; passwd=&amp;quot;secret&amp;quot; quiet=&amp;quot;1&amp;quot;/&amp;gt;&lt;br /&gt;
		&amp;lt;fencedevice name=&amp;quot;an01_ipmi&amp;quot; agent=&amp;quot;fence_ipmilan&amp;quot; ipaddr=&amp;quot;192.168.4.74&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;an02_ipmi&amp;quot; agent=&amp;quot;fence_ipmilan&amp;quot; ipaddr=&amp;quot;192.168.4.75&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;
We now see three elements in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fencedevices&amp;lt;/span&amp;gt;. The first is the original Node Assassin entry plus two [[IPMI]] entries, one for each node in the cluster. As we touched on earlier, this is because each node has it&#039;s own IPMI [[BMC]]. In the same vein, we also now see that the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;device&amp;lt;/span&amp;gt; entries in each node&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;method&amp;lt;/span&amp;gt; element have no &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;port&amp;lt;/span&amp;gt; setting.&lt;br /&gt;
&lt;br /&gt;
Notice that the Node Assassin&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;method&amp;lt;/span&amp;gt; is above the IPMI &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;method&amp;lt;/span&amp;gt;. This means that the Node Assassin is the primary fence device and the IPMI is the secondary. When deciding which order to assign the fence devices, consider the device&#039;s potential for failure and how that might effect cluster recovery time. For example, many IPMI BMCs rely on the node&#039;s power supply to operate. Thus, if the node&#039;s power supply fails and the IPMI is the first fence device, then recovery will be delayed as the cluster will try, and then wait until it times out, before moving on to the networked fence device, Node Assassin in this instance.&lt;br /&gt;
&lt;br /&gt;
=== Give Nodes More Time To Start ===&lt;br /&gt;
&lt;br /&gt;
Clusters with more than three nodes will have to gain quorum before they can fence other nodes. As we saw earlier though, this is not really the case when using the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[RHCS_v2_cluster.conf#two_node|two_node]]=&amp;quot;1&amp;quot;&amp;lt;/span&amp;gt; attribute in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[RHCS_v2_cluster.conf#cman.3B_The_Cluster_Manager|cman]]&amp;lt;/span&amp;gt; tag. What this means in practice is that if you start the cluster on one node and then wait too long to start the cluster on the second node, the first will fence the second.&lt;br /&gt;
&lt;br /&gt;
The logic behind this is; When the cluster starts, it will try to talk to it&#039;s fellow node and then fail. With the special &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;two_node=&amp;quot;1&amp;quot;&amp;lt;/span&amp;gt; attribute set, the cluster knows that it is allowed to start clustered services, but it has no way to say for sure what state the other node is in. It could well be online and hosting services for all it knows. So it has to proceed on the assumption that the other node is alive and using shared resources. Given that, and given that it can not talk to the other node, it&#039;s only safe option is to fence the other node. Only then can it be confident that it is safe to start providing clustered services.&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-cluster01&amp;quot; config_version=&amp;quot;7&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;cman expected_votes=&amp;quot;1&amp;quot; two_node=&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-node04.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;fence_na01&amp;quot; port=&amp;quot;04&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-node05.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;fence_na01&amp;quot; port=&amp;quot;03&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_na01&amp;quot; agent=&amp;quot;fence_na&amp;quot; ipaddr=&amp;quot;fence_na01.alteeve.com&amp;quot; login=&amp;quot;admin&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;fence_daemon post_join_delay=&amp;quot;60&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/cluster&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The new tag is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[RHCS_v2_cluster.conf#fence_daemon.3B_Fencing|fence_daemon]]&amp;lt;/span&amp;gt;, seen near the bottom if the file above. The change is made using the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[RHCS_v2_cluster.conf#post_join_delay|post_join_delay]]=&amp;quot;60&amp;quot;&amp;lt;/span&amp;gt; attribute. By default, the cluster will declare the other node dead after just &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;6&amp;lt;/span&amp;gt; seconds. The reason is that the larger this value, the slower the start-up of the cluster services will be. During testing and development though, I find this value to be far too short and frequently led to unnecessary fencing. Once your cluster is setup and working, it&#039;s not a bad idea to reduce this value to the lowest value that you are comfortable with.&lt;br /&gt;
&lt;br /&gt;
=== Configuring Totem ===&lt;br /&gt;
&lt;br /&gt;
This is almost a misnomer, as we&#039;re more or less &#039;&#039;not&#039;&#039; configuring the [[totem]] protocol in this cluster.&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-cluster01&amp;quot; config_version=&amp;quot;8&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;cman expected_votes=&amp;quot;1&amp;quot; two_node=&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-node04.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;fence_na01&amp;quot; port=&amp;quot;04&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-node05.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;fence_na01&amp;quot; port=&amp;quot;03&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_na01&amp;quot; agent=&amp;quot;fence_na&amp;quot; ipaddr=&amp;quot;fence_na01.alteeve.com&amp;quot; login=&amp;quot;admin&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;fence_daemon post_join_delay=&amp;quot;60&amp;quot;/&amp;gt;&lt;br /&gt;
        &amp;lt;totem rrp_mode=&amp;quot;none&amp;quot; secauth=&amp;quot;off&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/cluster&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the spirit of &amp;quot;keeping it simple&amp;quot;, we&#039;re not configuring [[redundant ring protocol]] in this cluster. [[RRP]] is an optional second ring that can be used for cluster communication in the case of a break down in the first ring. This is not the simplest option to setup, as recovery must be done manually. However, if you wish to explore it further, please take a look at the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clusternode&amp;lt;/span&amp;gt; element tag called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;[[RHCS_v2_cluster.conf#Tag.3B_altname|altname]]...&amp;gt;&amp;lt;/span&amp;gt;. When &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[altname]]&amp;lt;/span&amp;gt; is used though, then the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[RHCS_v2_cluster.conf#rrp_mode|rrp_mode]]&amp;lt;/span&amp;gt; attribute will need to be changed to either &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;active&amp;lt;/span&amp;gt; or &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;passive&amp;lt;/span&amp;gt; (the details of which are outside the scope of this tutorial).&lt;br /&gt;
&lt;br /&gt;
The second option we&#039;re looking at here is the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[RHCS_v2_cluster.conf#secauth|secauth]]=&amp;quot;off&amp;quot;&amp;lt;/span&amp;gt; attribute. This controls whether the cluster communications are encrypted or not. We can safely disable this because we&#039;re working on a known-private network, which yields two benefits; It&#039;s simpler to setup and it&#039;s a lot faster. If you must encrypt the cluster communications, then you can do so here. The details of which are also outside the scope of this tutorial though.&lt;br /&gt;
&lt;br /&gt;
=== Validating and Pushing the /etc/cluster/cluster.conf File ===&lt;br /&gt;
&lt;br /&gt;
The cluster software validates the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/cluster/cluster.conf&amp;lt;/span&amp;gt; file against &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/usr/share/system-config-cluster/misc/cluster.ng&amp;lt;/span&amp;gt; using the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xmllint&amp;lt;/span&amp;gt; program. If it fails to validate, the cluster will refuse to start.&lt;br /&gt;
&lt;br /&gt;
So now that we&#039;ve got the foundation of our cluster ready, the last step is to validate it. To do so, simply run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
xmllint --relaxng /usr/share/system-config-cluster/misc/cluster.ng /etc/cluster/cluster.conf&lt;br /&gt;
&amp;lt;/source&amp;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-cluster01&amp;quot; config_version=&amp;quot;8&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;cman expected_votes=&amp;quot;1&amp;quot; two_node=&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-node04.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;fence_na01&amp;quot; port=&amp;quot;04&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-node05.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;fence_na01&amp;quot; port=&amp;quot;03&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_na01&amp;quot; agent=&amp;quot;fence_na&amp;quot; ipaddr=&amp;quot;fence_na01.alteeve.com&amp;quot; login=&amp;quot;admin&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;fence_daemon post_join_delay=&amp;quot;60&amp;quot;/&amp;gt;&lt;br /&gt;
        &amp;lt;totem rrp_mode=&amp;quot;none&amp;quot; secauth=&amp;quot;off&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/cluster&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;
/etc/cluster/cluster.conf validates&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If there was a problem, you need to go back and fix it. &#039;&#039;&#039;DO NOT&#039;&#039;&#039; proceed until your configuration validates. Once it does, we&#039;re ready to move on!&lt;br /&gt;
&lt;br /&gt;
With it validated, we need to push it to the other node. As the cluster is not running yet, we will push it out using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rsync&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;
rsync -av /etc/cluster/cluster.conf root@an-node05:/etc/cluster/&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
building file list ... done&lt;br /&gt;
cluster.conf&lt;br /&gt;
&lt;br /&gt;
sent 891 bytes  received 66 bytes  638.00 bytes/sec&lt;br /&gt;
total size is 790  speedup is 0.83&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Starting the Cluster For The First Time =&lt;br /&gt;
&lt;br /&gt;
At this point, we have the foundation of the cluster in place and we can start it up!&lt;br /&gt;
&lt;br /&gt;
== Keeping an Eye on Things ==&lt;br /&gt;
&lt;br /&gt;
I&#039;ve found a layout of four terminal windows, the left ones being 80 columns wide and the right ones filling the rest of the screen, works well. I personally run a &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;tail -f -n 0 /var/log/messages&amp;lt;/span&amp;gt; in the right windows so that I can keep an eye on things.&lt;br /&gt;
&lt;br /&gt;
[[Image:2-node_cluster_terminal_layout_01.png|thumb|center|700px|The terminal layout I use to monitor and operate the two nodes in the cluster.]]&lt;br /&gt;
&lt;br /&gt;
Of course, what you use is entirely up to you, your screen real-estate and your preferences.&lt;br /&gt;
&lt;br /&gt;
== A Note on Timing ==&lt;br /&gt;
&lt;br /&gt;
Remember that you have &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;post_join_delay&amp;lt;/span&amp;gt; seconds to start both nodes, which is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;60&amp;lt;/span&amp;gt; seconds in our configuration. So be sure that you can start the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt; daemon quickly on both nodes. I generally ensure that both terminal windows have the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;start&amp;lt;/span&amp;gt; command typed in, so that I can quickly press &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;enter&amp;gt;&amp;lt;/span&amp;gt; on both nodes. Again, how you do this is entirely up to you.&lt;br /&gt;
&lt;br /&gt;
== All Systems Are Go! ==&lt;br /&gt;
&lt;br /&gt;
Time to 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;
On both nodes, run the following command:&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;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Starting cluster: &lt;br /&gt;
   Loading modules... done&lt;br /&gt;
   Mounting configfs... done&lt;br /&gt;
   Starting ccsd... done&lt;br /&gt;
   Starting cman... done&lt;br /&gt;
   Starting daemons... done&lt;br /&gt;
   Starting fencing... done&lt;br /&gt;
                                                           [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If things went well, you should see something like this in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/var/log/messages&amp;lt;/span&amp;gt; terminal on both nodes:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
May  3 22:33:15 an-node04 ccsd[5319]: Starting ccsd 2.0.115: &lt;br /&gt;
May  3 22:33:15 an-node04 ccsd[5319]:  Built: Apr 28 2011 05:36:14 &lt;br /&gt;
May  3 22:33:15 an-node04 ccsd[5319]:  Copyright (C) Red Hat, Inc.  2004  All rights reserved. &lt;br /&gt;
May  3 22:33:15 an-node04 ccsd[5319]: cluster.conf (cluster name = an-cluster01, version = 8) found. &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [MAIN ] AIS Executive Service RELEASE &#039;subrev 1887 version 0.80.6&#039; &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [MAIN ] Copyright (C) 2002-2006 MontaVista Software, Inc and contributors. &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [MAIN ] Copyright (C) 2006 Red Hat, Inc. &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [MAIN ] AIS Executive Service: started and ready to provide service. &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [MAIN ] Using default multicast address of 239.192.235.77 &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [TOTEM] Token Timeout (10000 ms) retransmit timeout (495 ms) &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [TOTEM] token hold (386 ms) retransmits before loss (20 retrans) &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [TOTEM] join (60 ms) send_join (0 ms) consensus (2000 ms) merge (200 ms) &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [TOTEM] downcheck (1000 ms) fail to recv const (2500 msgs) &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [TOTEM] seqno unchanged const (30 rotations) Maximum network MTU 1402 &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [TOTEM] window size per rotation (50 messages) maximum messages per rotation (17 messages) &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [TOTEM] missed count const (5 messages) &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [TOTEM] send threads (0 threads) &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [TOTEM] RRP token expired timeout (495 ms) &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [TOTEM] RRP token problem counter (2000 ms) &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [TOTEM] RRP threshold (10 problem count) &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [TOTEM] RRP mode set to none. &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [TOTEM] heartbeat_failures_allowed (0) &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [TOTEM] max_network_delay (50 ms) &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [TOTEM] HeartBeat is Disabled. To enable set heartbeat_failures_allowed &amp;gt; 0 &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [TOTEM] Receive multicast socket recv buffer size (262142 bytes). &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [TOTEM] Transmit multicast socket send buffer size (262142 bytes). &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [TOTEM] The network interface [192.168.3.74] is now up. &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [TOTEM] Created or loaded sequence id 8.192.168.3.74 for this ring. &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [TOTEM] entering GATHER state from 15. &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [CMAN ] CMAN 2.0.115 (built Apr 28 2011 05:36:17) started &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [MAIN ] Service initialized &#039;openais CMAN membership service 2.01&#039; &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [SERV ] Service initialized &#039;openais extended virtual synchrony service&#039; &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [SERV ] Service initialized &#039;openais cluster membership service B.01.01&#039; &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [SERV ] Service initialized &#039;openais availability management framework B.01.01&#039; &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [SERV ] Service initialized &#039;openais checkpoint service B.01.01&#039; &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [SERV ] Service initialized &#039;openais event service B.01.01&#039; &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [SERV ] Service initialized &#039;openais distributed locking service B.01.01&#039; &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [SERV ] Service initialized &#039;openais message service B.01.01&#039; &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [SERV ] Service initialized &#039;openais configuration service&#039; &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [SERV ] Service initialized &#039;openais cluster closed process group service v1.01&#039; &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [SERV ] Service initialized &#039;openais cluster config database access v1.01&#039; &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [SYNC ] Not using a virtual synchrony filter. &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [TOTEM] Creating commit token because I am the rep. &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [TOTEM] Saving state aru 0 high seq received 0 &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [TOTEM] Storing new sequence id for ring c &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [TOTEM] entering COMMIT state. &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [TOTEM] entering RECOVERY state. &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [TOTEM] position [0] member 192.168.3.74: &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [TOTEM] previous ring seq 8 rep 192.168.3.74 &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [TOTEM] aru 0 high delivered 0 received flag 1 &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [TOTEM] Did not need to originate any messages in recovery. &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [TOTEM] Sending initial ORF token &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [CLM  ] CLM CONFIGURATION CHANGE &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [CLM  ] New Configuration: &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [CLM  ] Members Left: &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [CLM  ] Members Joined: &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [CLM  ] CLM CONFIGURATION CHANGE &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [CLM  ] New Configuration: &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [CLM  ] 	r(0) ip(192.168.3.74)  &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [CLM  ] Members Left: &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [CLM  ] Members Joined: &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [CLM  ] 	r(0) ip(192.168.3.74)  &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [SYNC ] This node is within the primary component and will provide service. &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [TOTEM] entering OPERATIONAL state. &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [CMAN ] quorum regained, resuming activity &lt;br /&gt;
May  3 22:33:17 an-node04 openais[5325]: [CLM  ] got nodejoin message 192.168.3.74 &lt;br /&gt;
May  3 22:33:17 an-node04 ccsd[5319]: Initial status:: Quorate &lt;br /&gt;
May  3 22:33:18 an-node04 openais[5325]: [TOTEM] entering GATHER state from 11. &lt;br /&gt;
May  3 22:33:18 an-node04 openais[5325]: [TOTEM] Creating commit token because I am the rep. &lt;br /&gt;
May  3 22:33:18 an-node04 openais[5325]: [TOTEM] Saving state aru c high seq received c &lt;br /&gt;
May  3 22:33:18 an-node04 openais[5325]: [TOTEM] Storing new sequence id for ring 14 &lt;br /&gt;
May  3 22:33:18 an-node04 openais[5325]: [TOTEM] entering COMMIT state. &lt;br /&gt;
May  3 22:33:18 an-node04 openais[5325]: [TOTEM] entering RECOVERY state. &lt;br /&gt;
May  3 22:33:18 an-node04 openais[5325]: [TOTEM] position [0] member 192.168.3.74: &lt;br /&gt;
May  3 22:33:18 an-node04 openais[5325]: [TOTEM] previous ring seq 12 rep 192.168.3.74 &lt;br /&gt;
May  3 22:33:18 an-node04 openais[5325]: [TOTEM] aru c high delivered c received flag 1 &lt;br /&gt;
May  3 22:33:18 an-node04 openais[5325]: [TOTEM] position [1] member 192.168.3.75: &lt;br /&gt;
May  3 22:33:18 an-node04 openais[5325]: [TOTEM] previous ring seq 16 rep 192.168.3.75 &lt;br /&gt;
May  3 22:33:18 an-node04 openais[5325]: [TOTEM] aru c high delivered c received flag 1 &lt;br /&gt;
May  3 22:33:18 an-node04 openais[5325]: [TOTEM] Did not need to originate any messages in recovery. &lt;br /&gt;
May  3 22:33:18 an-node04 openais[5325]: [TOTEM] Sending initial ORF token &lt;br /&gt;
May  3 22:33:18 an-node04 openais[5325]: [CLM  ] CLM CONFIGURATION CHANGE &lt;br /&gt;
May  3 22:33:18 an-node04 openais[5325]: [CLM  ] New Configuration: &lt;br /&gt;
May  3 22:33:18 an-node04 openais[5325]: [CLM  ] 	r(0) ip(192.168.3.74)  &lt;br /&gt;
May  3 22:33:18 an-node04 openais[5325]: [CLM  ] Members Left: &lt;br /&gt;
May  3 22:33:18 an-node04 openais[5325]: [CLM  ] Members Joined: &lt;br /&gt;
May  3 22:33:18 an-node04 openais[5325]: [CLM  ] CLM CONFIGURATION CHANGE &lt;br /&gt;
May  3 22:33:18 an-node04 openais[5325]: [CLM  ] New Configuration: &lt;br /&gt;
May  3 22:33:18 an-node04 openais[5325]: [CLM  ] 	r(0) ip(192.168.3.74)  &lt;br /&gt;
May  3 22:33:18 an-node04 openais[5325]: [CLM  ] 	r(0) ip(192.168.3.75)  &lt;br /&gt;
May  3 22:33:18 an-node04 openais[5325]: [CLM  ] Members Left: &lt;br /&gt;
May  3 22:33:18 an-node04 openais[5325]: [CLM  ] Members Joined: &lt;br /&gt;
May  3 22:33:18 an-node04 openais[5325]: [CLM  ] 	r(0) ip(192.168.3.75)  &lt;br /&gt;
May  3 22:33:18 an-node04 openais[5325]: [SYNC ] This node is within the primary component and will provide service. &lt;br /&gt;
May  3 22:33:18 an-node04 openais[5325]: [TOTEM] entering OPERATIONAL state. &lt;br /&gt;
May  3 22:33:18 an-node04 openais[5325]: [CLM  ] got nodejoin message 192.168.3.74 &lt;br /&gt;
May  3 22:33:18 an-node04 openais[5325]: [CLM  ] got nodejoin message 192.168.3.75 &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From the node you started &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt; on first, you will see:&lt;br /&gt;
* The cluster configuration system daemon, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ccsd&amp;lt;/span&amp;gt;, starts up and reads in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/cluster/cluster.conf&amp;lt;/span&amp;gt;. It reports the name of the cluster, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-cluster01&amp;lt;/span&amp;gt; and the version, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;8&amp;lt;/span&amp;gt;.&lt;br /&gt;
* OpenAIS then starts up, reports it&#039;s multicast address it will use, reports many of it&#039;s variable values and what [[IP]] address it will use for cluster communications.&lt;br /&gt;
* The Cluster Manager, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt;, starts and reports the version of various services in use.&lt;br /&gt;
* The [[totem]] protocol is started and it forms an initial configuration containing just itself. These messages have the prefix &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;CLM&amp;lt;/span&amp;gt;, CLuster Membership.&lt;br /&gt;
** Then it waits to see if the other node will join. On the other node&#039;s log, you will see it start off and immediately join with this first node. &lt;br /&gt;
* The initial configuration is sufficient to gain quorum and declares that it will provide services.&lt;br /&gt;
* The second node announces that it wants to join the first node&#039;s cluster membership and the cluster reconfigures.&lt;br /&gt;
&lt;br /&gt;
From the node you started &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt; on second, you will see mostly the same thing, except you will not see the cluster form on the one node. Instead, it will connect directly to the first node and the initial configuration will be the pair together.&lt;br /&gt;
&lt;br /&gt;
If you got this, then you&#039;re cluster is up and running, congratulations!&lt;br /&gt;
&lt;br /&gt;
== Testing Fencing ==&lt;br /&gt;
&lt;br /&gt;
Before we go any further, we want to make sure that our fence device and configuration is working from both nodes. We will test this two ways;&lt;br /&gt;
* First, we will use the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fence_node&amp;lt;/span&amp;gt; tools.&lt;br /&gt;
* Second, we will break the network connection to simulate a network failure.&lt;br /&gt;
&lt;br /&gt;
=== Fencing with the fence_node Tool ===&lt;br /&gt;
&lt;br /&gt;
Testing this is easy, thanks to the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fence_node&amp;lt;/span&amp;gt; command line tool. It&#039;s simply a matter of calling &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fence_node &amp;lt;node&amp;gt;&amp;lt;/span&amp;gt;, where &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;node&amp;gt;&amp;lt;/span&amp;gt; has to match the name set in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cluster.conf&amp;lt;/span&amp;gt; file&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clusternode name=&amp;quot;...&amp;quot;&amp;lt;/span&amp;gt; element.&lt;br /&gt;
&lt;br /&gt;
We will do this test twice; Once from &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt;, fencing &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt; and then again from the other way around. After each fence call, we will wait for the node to reboot and then rejoin it to the cluster. We&#039;ll watch &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/var/log/messages&amp;lt;/span&amp;gt; to see what&#039;s happening.&lt;br /&gt;
&lt;br /&gt;
Let&#039;s start by fencing &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05.alteeve.com&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;From &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt;&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
fence_node05.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;
May  6 00:46:26 an-node04 openais[25357]: [TOTEM] The token was lost in the OPERATIONAL state.&lt;br /&gt;
May  6 00:46:26 an-node04 openais[25357]: [TOTEM] Receive multicast socket recv buffer size (262142 bytes).&lt;br /&gt;
May  6 00:46:26 an-node04 openais[25357]: [TOTEM] Transmit multicast socket send buffer size (262142 bytes).&lt;br /&gt;
May  6 00:46:26 an-node04 openais[25357]: [TOTEM] entering GATHER state from 2.&lt;br /&gt;
May  6 00:46:28 an-node04 openais[25357]: [TOTEM] entering GATHER state from 0.&lt;br /&gt;
May  6 00:46:28 an-node04 openais[25357]: [TOTEM] Creating commit token because I am the rep.&lt;br /&gt;
May  6 00:46:28 an-node04 openais[25357]: [TOTEM] Saving state aru 22 high seq received 22&lt;br /&gt;
May  6 00:46:28 an-node04 openais[25357]: [TOTEM] Storing new sequence id for ring 5c&lt;br /&gt;
May  6 00:46:28 an-node04 openais[25357]: [TOTEM] entering COMMIT state.&lt;br /&gt;
May  6 00:46:28 an-node04 openais[25357]: [TOTEM] entering RECOVERY state.&lt;br /&gt;
May  6 00:46:28 an-node04 openais[25357]: [TOTEM] position [0] member 192.168.3.74:&lt;br /&gt;
May  6 00:46:28 an-node04 openais[25357]: [TOTEM] previous ring seq 88 rep 192.168.3.74&lt;br /&gt;
May  6 00:46:28 an-node04 openais[25357]: [TOTEM] aru 22 high delivered 22 received flag 1&lt;br /&gt;
May  6 00:46:28 an-node04 openais[25357]: [TOTEM] Did not need to originate any messages in recovery.&lt;br /&gt;
May  6 00:46:28 an-node04 openais[25357]: [TOTEM] Sending initial ORF token&lt;br /&gt;
May  6 00:46:28 an-node04 openais[25357]: [CLM  ] CLM CONFIGURATION CHANGE&lt;br /&gt;
May  6 00:46:28 an-node04 openais[25357]: [CLM  ] New Configuration:&lt;br /&gt;
May  6 00:46:28 an-node04 fenced[25376]: an-node05.alteeve.com not a cluster member after 0 sec post_fail_delay&lt;br /&gt;
May  6 00:46:28 an-node04 kernel: dlm: closing connection to node 2&lt;br /&gt;
May  6 00:46:28 an-node04 openais[25357]: [CLM  ]       r(0) ip(192.168.3.74)&lt;br /&gt;
May  6 00:46:28 an-node04 fenced[25376]: fencing node &amp;quot;an-node05.alteeve.com&amp;quot;&lt;br /&gt;
May  6 00:46:28 an-node04 openais[25357]: [CLM  ] Members Left:&lt;br /&gt;
May  6 00:46:28 an-node04 openais[25357]: [CLM  ]       r(0) ip(192.168.3.75)&lt;br /&gt;
May  6 00:46:28 an-node04 openais[25357]: [CLM  ] Members Joined:&lt;br /&gt;
May  6 00:46:28 an-node04 openais[25357]: [CLM  ] CLM CONFIGURATION CHANGE&lt;br /&gt;
May  6 00:46:28 an-node04 openais[25357]: [CLM  ] New Configuration:&lt;br /&gt;
May  6 00:46:28 an-node04 openais[25357]: [CLM  ]       r(0) ip(192.168.3.74)&lt;br /&gt;
May  6 00:46:28 an-node04 openais[25357]: [CLM  ] Members Left:&lt;br /&gt;
May  6 00:46:28 an-node04 openais[25357]: [CLM  ] Members Joined:&lt;br /&gt;
May  6 00:46:28 an-node04 openais[25357]: [SYNC ] This node is within the primary component and will provide service.&lt;br /&gt;
May  6 00:46:28 an-node04 openais[25357]: [TOTEM] entering OPERATIONAL state.&lt;br /&gt;
May  6 00:46:28 an-node04 openais[25357]: [CLM  ] got nodejoin message 192.168.3.74&lt;br /&gt;
May  6 00:46:28 an-node04 openais[25357]: [CPG  ] got joinlist message from node 1&lt;br /&gt;
May  6 00:46:29 an-node04 fence_node[26696]: Fence of &amp;quot;an-node05.alteeve.com&amp;quot; was successful&lt;br /&gt;
May  6 00:46:42 an-node04 fenced[25376]: fence &amp;quot;an-node05.alteeve.com&amp;quot; success&lt;br /&gt;
May  6 00:50:23 an-node04 fence_node[26756]: Fence of &amp;quot;an-node05.alteeve.com&amp;quot; was successful&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{note|1=You will notice that there were two fence calls; This is normal. The first was the call from the command line that killed the node. The second was a reaction to the cluster reforming.}}&lt;br /&gt;
&lt;br /&gt;
Watching syslog, we&#039;ll see the node disappear, then the called fence finish, then the second fence called by the cluster itself succeed.&lt;br /&gt;
&lt;br /&gt;
If we check the cluster status from the surviving node, we&#039;ll see that the cluster has been reduced to just the single survivor node.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cman_tool 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;
Version: 6.2.0&lt;br /&gt;
Config Version: 8&lt;br /&gt;
Cluster Name: an-cluster01&lt;br /&gt;
Cluster Id: 60257&lt;br /&gt;
Cluster Member: Yes&lt;br /&gt;
Cluster Generation: 92&lt;br /&gt;
Membership state: Cluster-Member&lt;br /&gt;
Nodes: 1&lt;br /&gt;
Expected votes: 1&lt;br /&gt;
Total votes: 1&lt;br /&gt;
Quorum: 1  &lt;br /&gt;
Active subsystems: 7&lt;br /&gt;
Flags: 2node Dirty &lt;br /&gt;
Ports Bound: 0  &lt;br /&gt;
Node name: an-node04.alteeve.com&lt;br /&gt;
Node ID: 1&lt;br /&gt;
Multicast addresses: 239.192.235.77 &lt;br /&gt;
Node addresses: 192.168.3.74 &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once the victim has rebooted, we can rejoin it to the cluster. Now that the first node is already up, there is no need to worry about timing issues. Just start &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt; at your leisure. If you watch syslog from &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt;, you&#039;ll see &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt; connect and the cluster will reform to include it.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt;&#039;&#039;&#039;:&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;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Starting cluster: &lt;br /&gt;
   Loading modules... done&lt;br /&gt;
   Mounting configfs... done&lt;br /&gt;
   Starting ccsd... done&lt;br /&gt;
   Starting cman... done&lt;br /&gt;
   Starting daemons... done&lt;br /&gt;
   Starting fencing... done&lt;br /&gt;
                                                           [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{warning|1=Please do not assume that a successful fence against one node will mean that the fence against the other will work. An improper fence agent configuration, a typo in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cluster.conf&amp;lt;/span&amp;gt; or a fault in the wiring of the fence device could all cause node-specific fence failures.}}&lt;br /&gt;
&lt;br /&gt;
Now, repeat the process, but this time fence &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04.alteeve.com&amp;lt;/span&amp;gt; from &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Simulate a Network Failure ===&lt;br /&gt;
&lt;br /&gt;
It&#039;s good to know that we can fence the nodes with the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fence_node&amp;lt;/span&amp;gt; tool, but that is a controlled situation entirely within the context of the cluster. A more &amp;quot;real-world&amp;quot; test is now needed to ensure that a external fault will be detected by the cluster and that one of the nodes will be ejected. There are many, many ways to simulate a failure, and &#039;&#039;&#039;we will test&#039;&#039;&#039; all failures later. For now though, let&#039;s use a simple &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;iptables&amp;lt;/span&amp;gt; rule to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;DROP&amp;lt;/span&amp;gt; everything leaving our &#039;&#039;&#039;BCN&#039;&#039;&#039; interface.&lt;br /&gt;
&lt;br /&gt;
{{warning|1=This next command will block &#039;&#039;&#039;all&#039;&#039;&#039; traffic leaving the server. You will lose your &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ssh&amp;lt;/span&amp;gt; connection. If the fence fails, you will need to find another way to reboot or restore the server.}}&lt;br /&gt;
&lt;br /&gt;
This time, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04.alteeve.com&amp;lt;/span&amp;gt; will be the victim, so run the following &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;iptables&amp;lt;/span&amp;gt; command on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt; directly. This will cause all outbound traffic, including cluster communications, to fail. Within a few seconds, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt; should declare &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt; as dead, eject it via a fence call and then reconfigure.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt;&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
iptables -A OUTPUT -j DROP&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After a few seconds, you should see &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt; trigger the fence.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;In &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt;&#039;s syslog&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
May  6 01:11:08 an-node04 openais[4339]: [TOTEM] The token was lost in the OPERATIONAL state. &lt;br /&gt;
May  6 01:11:08 an-node04 openais[4339]: [TOTEM] Receive multicast socket recv buffer size (262142 bytes). &lt;br /&gt;
May  6 01:11:08 an-node04 openais[4339]: [TOTEM] Transmit multicast socket send buffer size (262142 bytes). &lt;br /&gt;
May  6 01:11:08 an-node04 openais[4339]: [TOTEM] entering GATHER state from 2. &lt;br /&gt;
May  6 01:11:10 an-node04 openais[4339]: [TOTEM] entering GATHER state from 0. &lt;br /&gt;
May  6 01:11:10 an-node04 openais[4339]: [TOTEM] Creating commit token because I am the rep. &lt;br /&gt;
May  6 01:11:10 an-node04 openais[4339]: [TOTEM] Saving state aru 24 high seq received 24 &lt;br /&gt;
May  6 01:11:10 an-node04 openais[4339]: [TOTEM] Storing new sequence id for ring 70 &lt;br /&gt;
May  6 01:11:10 an-node04 openais[4339]: [TOTEM] entering COMMIT state. &lt;br /&gt;
May  6 01:11:10 an-node04 openais[4339]: [TOTEM] entering RECOVERY state. &lt;br /&gt;
May  6 01:11:10 an-node04 openais[4339]: [TOTEM] position [0] member 192.168.3.74: &lt;br /&gt;
May  6 01:11:10 an-node04 openais[4339]: [TOTEM] previous ring seq 108 rep 192.168.3.74 &lt;br /&gt;
May  6 01:11:10 an-node04 openais[4339]: [TOTEM] aru 24 high delivered 24 received flag 1 &lt;br /&gt;
May  6 01:11:10 an-node04 openais[4339]: [TOTEM] Did not need to originate any messages in recovery. &lt;br /&gt;
May  6 01:11:10 an-node04 openais[4339]: [TOTEM] Sending initial ORF token &lt;br /&gt;
May  6 01:11:10 an-node04 openais[4339]: [CLM  ] CLM CONFIGURATION CHANGE &lt;br /&gt;
May  6 01:11:10 an-node04 openais[4339]: [CLM  ] New Configuration: &lt;br /&gt;
May  6 01:11:10 an-node04 kernel: dlm: closing connection to node 2&lt;br /&gt;
May  6 01:11:10 an-node04 fenced[4358]: an-node05.alteeve.com not a cluster member after 0 sec post_fail_delay&lt;br /&gt;
May  6 01:11:10 an-node04 openais[4339]: [CLM  ] 	r(0) ip(192.168.3.74)  &lt;br /&gt;
May  6 01:11:10 an-node04 fenced[4358]: fencing node &amp;quot;an-node05.alteeve.com&amp;quot;&lt;br /&gt;
May  6 01:11:10 an-node04 openais[4339]: [CLM  ] Members Left: &lt;br /&gt;
May  6 01:11:10 an-node04 openais[4339]: [CLM  ] 	r(0) ip(192.168.3.75)  &lt;br /&gt;
May  6 01:11:10 an-node04 openais[4339]: [CLM  ] Members Joined: &lt;br /&gt;
May  6 01:11:10 an-node04 openais[4339]: [CLM  ] CLM CONFIGURATION CHANGE &lt;br /&gt;
May  6 01:11:10 an-node04 openais[4339]: [CLM  ] New Configuration: &lt;br /&gt;
May  6 01:11:10 an-node04 openais[4339]: [CLM  ] 	r(0) ip(192.168.3.74)  &lt;br /&gt;
May  6 01:11:10 an-node04 openais[4339]: [CLM  ] Members Left: &lt;br /&gt;
May  6 01:11:10 an-node04 openais[4339]: [CLM  ] Members Joined: &lt;br /&gt;
May  6 01:11:10 an-node04 openais[4339]: [SYNC ] This node is within the primary component and will provide service. &lt;br /&gt;
May  6 01:11:10 an-node04 openais[4339]: [TOTEM] entering OPERATIONAL state. &lt;br /&gt;
May  6 01:11:10 an-node04 openais[4339]: [CLM  ] got nodejoin message 192.168.3.74 &lt;br /&gt;
May  6 01:11:10 an-node04 openais[4339]: [CPG  ] got joinlist message from node 1 &lt;br /&gt;
May  6 01:11:23 an-node04 fenced[4358]: fence &amp;quot;an-node05.alteeve.com&amp;quot; success&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Success!&lt;br /&gt;
&lt;br /&gt;
Now repeat this, making &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt; the victim. &lt;br /&gt;
&lt;br /&gt;
If both fence tests succeeded against both nodes, you can be confident that fencing is working well!&lt;br /&gt;
&lt;br /&gt;
= Setting Up Clustered Storage =&lt;br /&gt;
&lt;br /&gt;
The next few steps will cover setting up the DRBD resources, using them in clustered [[LVM]] and the creating a [[GFS2]] partition. Next, we will add it all as cluster resources and then create a service for each node to start up all of the clustered storage.&lt;br /&gt;
&lt;br /&gt;
== Creating Our DRBD Resources ==&lt;br /&gt;
&lt;br /&gt;
We&#039;re going to create four DRBD resources;&lt;br /&gt;
&lt;br /&gt;
* A resource to back our shared [[GFS2]] partition which will hold shared files, like our virtual machine configuration files.&lt;br /&gt;
* A resource to back the VMs running primarily on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt;.&lt;br /&gt;
* A resource to back the VMs running primarily on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt;.&lt;br /&gt;
* A final resource that will be left alone for future expansion. This is optional, of course.&lt;br /&gt;
&lt;br /&gt;
=== The &amp;quot;Why&amp;quot; of Our Layout ===&lt;br /&gt;
&lt;br /&gt;
The reason for this is to minimize the chance of data loss in a [[split-brain]] event. &lt;br /&gt;
&lt;br /&gt;
A split-brain occurs when a [[DRBD]] resource loses it&#039;s network link while in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Primary/Primary&amp;lt;/span&amp;gt; mode. The problem is that, after the split, any write to either node is not replicated to the other node. Thus, after even one [[byte]] is written, the DRBD resource is out of sync. Once this happens, there is no real way to automate recovery. You will need to go in and manual flag one side of the resource to discard it&#039;s changes and then manually re-connect the two sides before the resource will be usable again.&lt;br /&gt;
&lt;br /&gt;
We will take steps to prevent this, but it always a possibility with shared storage.&lt;br /&gt;
&lt;br /&gt;
Given then that there is no sure way to avoid this, we&#039;re going to mitigate risk by breaking up our DRBD resources so that we can be more selective in choosing what parts to invalidate after a split brain event.&lt;br /&gt;
&lt;br /&gt;
* The small GFS2 partition will be the hardest to manage. For this reason, it is on it&#039;s own. For the same reason, we will be using it as little as we can, and copies of files we care about will be stored on each node. The main thing here are the VM configuration files. This should be written to rarely, so with luck, in a split brain condition, simply nothing will be written to either side so recovery should be arbitrary and simple.&lt;br /&gt;
* The VMs that will primarily run on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt; will get their own resource. This way we can simply invalidate the DRBD device on the node that was &#039;&#039;&#039;not&#039;&#039;&#039; running the VMs during the split brain.&lt;br /&gt;
* Likewise, the VMs primarily running on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt; will get their own resource. This way, if a split brain happens and VMs are running on both nodes, it should be easily to invalidate opposing nodes for the respective DRBD resource.&lt;br /&gt;
* The fourth DRBD resource will just contain free space. This can later be added whole to an existing LVM VG or further divided up as needed in the future.&lt;br /&gt;
&lt;br /&gt;
== Visualizing Storage ==&lt;br /&gt;
&lt;br /&gt;
The layout of our storage is, on the surface, somewhat complex. To help follow what we&#039;ll be creating, here is an [[ASCII]] drawing showing what it will look like. Note that example VMs are shown, which we will not be creating. This is to help you see where extra VMs would exist if you ran two or more VMs per node.&lt;br /&gt;
&lt;br /&gt;
If you are using [[RAID]], then you can simply replace &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;sdaX&amp;lt;/span&amp;gt; with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;mdX&amp;lt;/span&amp;gt;. You can find a tutorial on manually creating RAID devices here:&lt;br /&gt;
* [[Managing Software RAID Arrays]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
         [ an-node04 ]&lt;br /&gt;
  ______   ______    ______     __[sda4]__&lt;br /&gt;
 | sda1 | | sda2 |  | sda3 |   |  ______  |       _______    ______________    ______________________________&lt;br /&gt;
 |______| |______|  |______|   | | sda5 |-+------| drbd0 |--| drbd_sh0_vg0 |--| /dev/drbd_sh0_vg0/xen_shared |&lt;br /&gt;
     |        |         |      | |______| |   /--|_______|  |______________|  |______________________________|&lt;br /&gt;
  ___|___    _|_    ____|____  |  ______  |   |     _______    ______________    ____________________________&lt;br /&gt;
 | /boot |  | / |  | &amp;lt;swap&amp;gt;  | | | sda6 |-+---+----| drbd1 |--| drbd_an4_vg0 |--| /dev/drbd_an4_vg0/vm0001_1 |&lt;br /&gt;
 |_______|  |___|  |_________| | |______| |   | /--|_______|  |______________|  |____________________________|&lt;br /&gt;
                               |  ______  |   | |     _______    ______________    ____________________________&lt;br /&gt;
                               | | sda7 |-+---+-+----| drbd2 |--| drbd_an5_vg0 |--| /dev/drbd_an5_vg0/vm0002_1 | &lt;br /&gt;
                               | |______| |   | | /--|_______|  |______________|  |____________________________|&lt;br /&gt;
                               |  ______  |   | | |                         | |    _______________________&lt;br /&gt;
                               | | sda8 |-+---+-+-+--\                      | \---| Example LV for 2nd VM |&lt;br /&gt;
                               | |______| |   | | |  |                      |     |_______________________|&lt;br /&gt;
                               |__________|   | | |  |                      |      _______________________&lt;br /&gt;
         [ an-node05 ]                        | | |  |                      \-----| Example LV for 3rd VM |&lt;br /&gt;
  ______   ______    ______     __[sda4]__    | | |  |                            |_______________________|&lt;br /&gt;
 | sda1 | | sda2 |  | sda3 |   |  ______  |   | | |  |                   &lt;br /&gt;
 |______| |______|  |______|   | | sda5 |-+---/ | |  |   _______    __________________&lt;br /&gt;
     |        |         |      | |______| |     | |  \--| drbd3 |--| Spare PV for     |&lt;br /&gt;
  ___|___    _|_    ____|____  |  ______  |     | |  /--|_______|  | future expansion |&lt;br /&gt;
 | /boot |  | / |  | &amp;lt;swap&amp;gt;  | | | sda6 |-+-----/ |  |             |__________________|&lt;br /&gt;
 |_______|  |___|  |_________| | |______| |       |  |&lt;br /&gt;
                               |  ______  |       |  |&lt;br /&gt;
                               | | sda7 |-+-------/  |&lt;br /&gt;
                               | |______| |          |&lt;br /&gt;
                               |  ______  |          |&lt;br /&gt;
                               | | sda8 |-+----------/&lt;br /&gt;
                               | |______| |&lt;br /&gt;
                               |__________|&lt;br /&gt;
.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Modifying the Physical Storage ===&lt;br /&gt;
&lt;br /&gt;
{{warning|1=Multiple assumptions ahead. If you are comfortable &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fdisk&amp;lt;/span&amp;gt; (and possibly &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;mdadm&amp;lt;/span&amp;gt;), you can largely skip this section. You will need to create four partitions; This tutorial uses a &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;10&amp;lt;/span&amp;gt; [[GiB]] for shared files, two &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;100&amp;lt;/span&amp;gt; [[GiB]] and the remainder of the space in the last partition. These will be four extended partitions, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/sda5&amp;lt;/span&amp;gt;, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/sda6&amp;lt;/span&amp;gt;, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/sda7&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/sda8&amp;lt;/span&amp;gt; respectively.}}&lt;br /&gt;
&lt;br /&gt;
This tutorial, in the interest of simplicity and not aiming to be a disk management tutorial, uses single-disk storage on each node. If you only have one disk, or if you have hardware RAID, this is sufficient. However, if you have multiple disks and want to use software RAID on your nodes, you will need to create &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/mdX&amp;lt;/span&amp;gt; devices to match the layout we will be creating. Here is a tutorial on managing software RAID arrays, written with this tutorial in mind.&lt;br /&gt;
&lt;br /&gt;
* [[Managing Software RAID Arrays]]&lt;br /&gt;
&lt;br /&gt;
We will need four new partitions; a &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;10&amp;lt;/span&amp;gt; [[GiB]] partition for the [[GFS2]] resource, two &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;100&amp;lt;/span&amp;gt; [[GiB]] partitions for the VMs on either node and the remainder of the disk&#039;s free space for the last partition. To do this, we will use the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fdisk&amp;lt;/span&amp;gt; tool. Be aware; This tool directly edits the hard drive&#039;s geometry. This is obviously risky! All along, this tutorial has assumed that you are working on test nodes, but it bears repeating again. Do not do this on a machine with data you care about! At the very least, have a good backup.&lt;br /&gt;
&lt;br /&gt;
Finally, this assumes that you used the [[generic_el5_node.ks|kickstart script]] when setting up your nodes. More to the point, it assumes an existing fourth primary partition which we will delete, convert to an extended partition and then within that create the four usable partitions.&lt;br /&gt;
&lt;br /&gt;
{{note|1=This is no longer completely accurate. The new kickstart script above does not create the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/sda4&amp;lt;/span&amp;gt; device any longer. The example remains though to show how to delete a partition, in case it is helpful to some readers.}}&lt;br /&gt;
&lt;br /&gt;
So first, delete the fourth partition.&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;
The number of cylinders for this disk is set to 60801.&lt;br /&gt;
There is nothing wrong with that, but this is larger than 1024,&lt;br /&gt;
and could in certain setups cause problems with:&lt;br /&gt;
1) software that runs at boot time (e.g., old versions of LILO)&lt;br /&gt;
2) booting and partitioning software from other OSs&lt;br /&gt;
   (e.g., DOS FDISK, OS/2 FDISK)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Confirm that the layout is indeed four partitions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Command (m for help): 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;
&lt;br /&gt;
   Device Boot      Start         End      Blocks   Id  System&lt;br /&gt;
/dev/sda1   *           1          32      257008+  83  Linux&lt;br /&gt;
/dev/sda2              33        2643    20972857+  83  Linux&lt;br /&gt;
/dev/sda3            2644        3165     4192965   82  Linux swap / Solaris&lt;br /&gt;
/dev/sda4            3166       60801   462961170   83  Linux&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is, so let&#039;s delete &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/sda4&amp;lt;/span&amp;gt; and then confirm that it is gone.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Command (m for help): d&lt;br /&gt;
Partition number (1-4): 4&lt;br /&gt;
&lt;br /&gt;
Command (m for help): 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;
&lt;br /&gt;
   Device Boot      Start         End      Blocks   Id  System&lt;br /&gt;
/dev/sda1   *           1          32      257008+  83  Linux&lt;br /&gt;
/dev/sda2              33        2643    20972857+  83  Linux&lt;br /&gt;
/dev/sda3            2644        3165     4192965   82  Linux swap / Solaris&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is, so now we&#039;ll create the extended partition.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Command (m for help): n&lt;br /&gt;
Command action&lt;br /&gt;
   e   extended&lt;br /&gt;
   p   primary partition (1-4)&lt;br /&gt;
e&lt;br /&gt;
Selected partition 4&lt;br /&gt;
First cylinder (3166-60801, default 3166): &amp;lt;enter&amp;gt;&lt;br /&gt;
Using default value 3166&lt;br /&gt;
Last cylinder or +size or +sizeM or +sizeK (3166-60801, default 60801): &amp;lt;enter&amp;gt;&lt;br /&gt;
Using default value 60801&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Again, a quick check to make sure the extended partition is now there.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Command (m for help): 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;
&lt;br /&gt;
   Device Boot      Start         End      Blocks   Id  System&lt;br /&gt;
/dev/sda1   *           1          32      257008+  83  Linux&lt;br /&gt;
/dev/sda2              33        2643    20972857+  83  Linux&lt;br /&gt;
/dev/sda3            2644        3165     4192965   82  Linux swap / Solaris&lt;br /&gt;
/dev/sda4            3166       60801   462961170    5  Extended&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Finally, let&#039;s create the four partitions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Command (m for help): n&lt;br /&gt;
First cylinder (3166-60801, default 3166): &lt;br /&gt;
Using default value 3166&lt;br /&gt;
Last cylinder or +size or +sizeM or +sizeK (3166-60801, default 60801): +10G&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;
Command (m for help): n&lt;br /&gt;
First cylinder (4383-60801, default 4383): &amp;lt;enter&amp;gt;&lt;br /&gt;
Using default value 4383&lt;br /&gt;
Last cylinder or +size or +sizeM or +sizeK (4383-60801, default 60801): +100G&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;
Command (m for help): n&lt;br /&gt;
First cylinder (16542-60801, default 16542): &amp;lt;enter&amp;gt;&lt;br /&gt;
Using default value 16542&lt;br /&gt;
Last cylinder or +size or +sizeM or +sizeK (16542-60801, default 60801): +100G&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;
Command (m for help): n&lt;br /&gt;
First cylinder (28701-60801, default 28701): &amp;lt;enter&amp;gt;&lt;br /&gt;
Using default value 28701&lt;br /&gt;
Last cylinder or +size or +sizeM or +sizeK (28701-60801, default 60801): &amp;lt;enter&amp;gt;&lt;br /&gt;
Using default value 60801&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Finally, check that the four new partitions exist.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Command (m for help): 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;
&lt;br /&gt;
   Device Boot      Start         End      Blocks   Id  System&lt;br /&gt;
/dev/sda1   *           1          32      257008+  83  Linux&lt;br /&gt;
/dev/sda2              33        2643    20972857+  83  Linux&lt;br /&gt;
/dev/sda3            2644        3165     4192965   82  Linux swap / Solaris&lt;br /&gt;
/dev/sda4            3166       60801   462961170    5  Extended&lt;br /&gt;
/dev/sda5            3166        4382     9775521   83  Linux&lt;br /&gt;
/dev/sda6            4383       16541    97667136   83  Linux&lt;br /&gt;
/dev/sda7           16542       28700    97667136   83  Linux&lt;br /&gt;
/dev/sda8           28701       60801   257851251   83  Linux&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We do! So now we&#039;ll commit the changes to disk and exit.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Command (m for help): 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.&lt;br /&gt;
The new table will be used at the next reboot.&lt;br /&gt;
Syncing disks.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{warning|1=Repeat the steps on the other node and double-check that the output of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fdisk -l /dev/sda&amp;lt;/span&amp;gt; shows the same &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Start&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;End&amp;lt;/span&amp;gt; boundaries. &#039;&#039;If they do not match, fix it before proceeding&#039;&#039;.}}&lt;br /&gt;
&lt;br /&gt;
{{note|1=This was done on the same disk as the host OS, so we&#039;ll need to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;reboot&amp;lt;/span&amp;gt; before we can proceed.}}&lt;br /&gt;
&lt;br /&gt;
== Creating the DRBD Resources ==&lt;br /&gt;
&lt;br /&gt;
Now that we have either node&#039;s storage ready, we can configure and start the DRBD resources. DRBD has &amp;quot;resource names&amp;quot;, which is it&#039;s internal reference to the &amp;quot;array&amp;quot;. These names are used whenever you are working on the resource using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;drbdadm&amp;lt;/span&amp;gt; or similar tools. The tradition is to name the resources as &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rX&amp;lt;/span&amp;gt;, with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;X&amp;lt;/span&amp;gt; being a sequence number starting at &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;0&amp;lt;/span&amp;gt;. The resource itself is made available as a normal &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/&amp;lt;/span&amp;gt; block device. The tradition is to name this device &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/drbdX&amp;lt;/span&amp;gt; where &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;X&amp;lt;/span&amp;gt; matches the resource&#039;s sequence number.&lt;br /&gt;
&lt;br /&gt;
=== The DRBD Fence Script ===&lt;br /&gt;
&lt;br /&gt;
{{warning|1=There is a problem with the current [[Node Assassin]] fence agent where multiple simultaneous fence calls will fail to return a success after each fence call. Until this is resolved, you will need to disable &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;outdate-peer&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fencing&amp;lt;/span&amp;gt; in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/drbd.conf&amp;lt;/span&amp;gt; by commenting out the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;disk { }&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;handler { }&amp;lt;/span&amp;gt; blocks in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;common { }&amp;lt;/span&amp;gt;.}}&lt;br /&gt;
&lt;br /&gt;
Red Hat&#039;s [http://people.redhat.com/lhh/ Lon Hohberger] created a DRBD script called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[obliterate]]&amp;lt;/span&amp;gt;, which was later updated to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[obliterate-peer.sh]]&amp;lt;/span&amp;gt;, that allows DRBD to trigger a fence call through the cluster when it detects a split-brain condition. The goal behind this is to stop the resource(s) from being flagged as &amp;quot;split-brain&amp;quot; in the first place, thus avoiding manual recovery. We will be using the newer &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[obliterate-peer.sh]]&amp;lt;/span&amp;gt; script. The difference between the two scripts is that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[obliterate]]&amp;lt;/span&amp;gt; will try to fence once only, where &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[obliterate-peer.sh]]&amp;lt;/span&amp;gt; will continue to fence until it succeeds. The former will block DRBD if it fails, which is not good.&lt;br /&gt;
&lt;br /&gt;
Download the script below and save it under your &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/sbin/&amp;lt;/span&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/sbin/[[obliterate-peer.sh]]&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then ensure that it is executable.&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/sbin/obliterate-peer.sh -O /sbin/obliterate-peer.sh&lt;br /&gt;
chmod a+x /sbin/obliterate-peer.sh&lt;br /&gt;
ls -lah /sbin/obliterate-peer.sh &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
-rw-r--r-- 1 root root 2.1K May  4 14:31 /sbin/obliterate-peer.sh&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Our Desired Layout in Detail ===&lt;br /&gt;
&lt;br /&gt;
Let&#039;s review how we will bring the devices together.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt;&lt;br /&gt;
!&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt;&lt;br /&gt;
!DRBD Resource&lt;br /&gt;
!DRBD Device&lt;br /&gt;
!Size&lt;br /&gt;
!Note&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/sda5&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/sda5&amp;lt;/span&amp;gt;&lt;br /&gt;
|style=&amp;quot;text-align: center;&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;r0&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/drbd0&amp;lt;/span&amp;gt;&lt;br /&gt;
|style=&amp;quot;white-space: nowrap; text-align: center;&amp;quot;|10 [[GB]]&lt;br /&gt;
|[[GFS2]] partition for VM configurations and shared files&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/sda6&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/sda6&amp;lt;/span&amp;gt;&lt;br /&gt;
|style=&amp;quot;text-align: center;&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;r1&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/drbd1&amp;lt;/span&amp;gt;&lt;br /&gt;
|style=&amp;quot;white-space: nowrap; text-align: center;&amp;quot;|100 [[GB]]&lt;br /&gt;
|Host VMs that will primarily run on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/sda7&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/sda7&amp;lt;/span&amp;gt;&lt;br /&gt;
|style=&amp;quot;text-align: center;&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;r2&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/drbd2&amp;lt;/span&amp;gt;&lt;br /&gt;
|style=&amp;quot;white-space: nowrap; text-align: center;&amp;quot;|100 [[GB]]&lt;br /&gt;
|Host VMs that will primarily run on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/sda8&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/sda8&amp;lt;/span&amp;gt;&lt;br /&gt;
|style=&amp;quot;text-align: center;&amp;quot;|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;r3&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/drbd3&amp;lt;/span&amp;gt;&lt;br /&gt;
|style=&amp;quot;white-space: nowrap;&amp;quot;|&lt;br /&gt;
|Free space that can later be allocated to an existing [[VG]] as-is or further divided up into two or more DRBD resources as future needs dictate.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Configuring /etc/drbd.conf ===&lt;br /&gt;
&lt;br /&gt;
With this plan then, we can now create the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/drbd.conf&amp;lt;/span&amp;gt; configuration file.&lt;br /&gt;
&lt;br /&gt;
The initial file is very sparse;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/drbd.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;
#&lt;br /&gt;
# please have a a look at the example configuration file in&lt;br /&gt;
# /usr/share/doc/drbd83/drbd.conf&lt;br /&gt;
#&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Setting up the &#039;global&#039; Directive ====&lt;br /&gt;
&lt;br /&gt;
There are a lot of options available to you, many of which are outside the scope of this tutorial. You can get a good overview of all option by reading the man page; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;man drbd.conf&amp;lt;/span&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
The first section we will add is the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;global { }&amp;lt;/span&amp;gt; directive. There is only one argument we will set, which tells DRBD that it can count our install in the Linbit user information. If you have privacy concerns, set this to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;no&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;
# The &#039;global&#039; directive covers values that apply to RBD in general.&lt;br /&gt;
global {&lt;br /&gt;
        # This tells Linbit that it&#039;s okay to count us as a DRBD user. If you&lt;br /&gt;
        # have privacy concerns, set this to &#039;no&#039;.&lt;br /&gt;
        usage-count     yes;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Setting up the &#039;common&#039; Directive ====&lt;br /&gt;
&lt;br /&gt;
The next directive is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;common { }&amp;lt;/span&amp;gt;. This sets values to be used on all DRBD resources by default. You can override &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;common&amp;lt;/span&amp;gt; values in any given resource directive later. &lt;br /&gt;
&lt;br /&gt;
The example below is well documented, so please take a moment to look at the example for &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;
# The &#039;common&#039; directive sets defaults values for all resources.&lt;br /&gt;
common {&lt;br /&gt;
        # Protocol &#039;C&#039; tells DRBD to not report a disk write as complete until&lt;br /&gt;
        # it has been confirmed written to both nodes. This is required for&lt;br /&gt;
        # Primary/Primary use.&lt;br /&gt;
        protocol C;&lt;br /&gt;
&lt;br /&gt;
        # This sets the default sync rate to 15 MiB/sec. Be careful about&lt;br /&gt;
        # setting this too high! High speed sync&#039;ing can flog your drives and&lt;br /&gt;
        # push disk I/O times very high.&lt;br /&gt;
        syncer {&lt;br /&gt;
                rate 15M;&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        # This tells DRBD what policy to use when a fence is required.&lt;br /&gt;
        disk {&lt;br /&gt;
                # This tells DRBD to block I/O (resource) and then try to fence&lt;br /&gt;
                # the other node (stonith). The &#039;stonith&#039; option requires that&lt;br /&gt;
                # we set a fence handler below. The name &#039;stonith&#039; comes from&lt;br /&gt;
                # &amp;quot;Shoot The Other Nide In The Head&amp;quot; and is a term used in&lt;br /&gt;
                # other clustering environments. It is synonomous with with&lt;br /&gt;
                # &#039;fence&#039;.&lt;br /&gt;
                fencing         resource-and-stonith;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        # We set &#039;stonith&#039; above, so here we tell DRBD how to actually fence&lt;br /&gt;
        # the other node.&lt;br /&gt;
        handlers {&lt;br /&gt;
                # The term &#039;outdate-peer&#039; comes from other scripts that flag&lt;br /&gt;
                # the other node&#039;s resource backing device as &#039;Inconsistent&#039;.&lt;br /&gt;
                # In our case though, we&#039;re flat-out fencing the other node,&lt;br /&gt;
                # which has the same effective result.&lt;br /&gt;
                outdate-peer    &amp;quot;/sbin/obliterate-peer.sh&amp;quot;;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        # Here we tell DRBD that we want to use Primary/Primary mode. It is&lt;br /&gt;
        # also where we define split-brain (sb) recovery policies. As we&#039;ll be&lt;br /&gt;
        # running all of our resources in Primary/Primary, only the&lt;br /&gt;
        # &#039;after-sb-2pri&#039; really means anything to us.&lt;br /&gt;
        net {&lt;br /&gt;
                # Tell DRBD to allow dual-primary.&lt;br /&gt;
                allow-two-primaries;&lt;br /&gt;
&lt;br /&gt;
                # Set the recover policy for split-brain recover when no device&lt;br /&gt;
                # in the resource was primary.&lt;br /&gt;
                after-sb-0pri   discard-zero-changes;&lt;br /&gt;
&lt;br /&gt;
                # Now if one device was primary.&lt;br /&gt;
                after-sb-1pri   discard-secondary;&lt;br /&gt;
&lt;br /&gt;
                # Finally, set the policy when both nodes were Primary. The&lt;br /&gt;
                # only viable option is &#039;disconnect&#039;, which tells DRBD to&lt;br /&gt;
                # simply tear-down the DRBD resource right away and wait for&lt;br /&gt;
                # the administrator to manually invalidate one side of the&lt;br /&gt;
                # resource.&lt;br /&gt;
                after-sb-2pri   disconnect;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        # This tells DRBD what to do when the resource starts.&lt;br /&gt;
        startup {&lt;br /&gt;
                # In our case, we&#039;re telling DRBD to promote both devices in&lt;br /&gt;
                # our resource to Primary on start.&lt;br /&gt;
                become-primary-on       both;&lt;br /&gt;
        }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Let&#039;s stop for a moment and talk about DRBD synchronization. &lt;br /&gt;
&lt;br /&gt;
A DRBD resource does &#039;&#039;&#039;not&#039;&#039;&#039; have to be synced before it can be made &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Primary/Primary&amp;lt;/span&amp;gt;. For this reason, the default sync rate for DRBD is very, very low (320 [[KiB]]/sec). This means that you can normally start your DRBD in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Primary/Primary&amp;lt;/span&amp;gt; on both nodes and get to work while the synchronization putters along in the background.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;However&#039;&#039;!&lt;br /&gt;
&lt;br /&gt;
If the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;UpToDate&amp;lt;/span&amp;gt; node goes down, the surviving &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Inconsistent&amp;lt;/span&amp;gt; node will demote to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Secondary&amp;lt;/span&amp;gt;, thus becoming unusable. In a high-availability environment like ours, this is pretty useless. So for this reason we will want to get the resources in sync as fast as possible. Likewise, while a node is sync&#039;ing, we will not be able to run the VMs on the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Inconsistent&amp;lt;/span&amp;gt; node.&lt;br /&gt;
&lt;br /&gt;
The temptation then is to set &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rate&amp;lt;/span&amp;gt; above to the maximum write speed of our disks. &#039;&#039;This is a bad idea&#039;&#039;!&lt;br /&gt;
&lt;br /&gt;
We will have four separate resources sharing the same underlying disks. If you drive the sync rate very high, and I/O on the other &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;UpToDate&amp;lt;/span&amp;gt; resources will be severely impacted. So much so that I&#039;ve seen crashes caused by this. So you will want to keep this value at a sane level. That is, you will want to set the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rate&amp;lt;/span&amp;gt; to as high as you can while still leaving the disks themselves sufficiently unbound that other I/O is still feasible. I&#039;ve personally found &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;15M&amp;lt;/span&amp;gt; on single-drive and simple RAID machines to be a good value. Feel free to experiment for yourself.&lt;br /&gt;
&lt;br /&gt;
==== Setting up the Resource Directives ====&lt;br /&gt;
&lt;br /&gt;
We now define the resources themselves. Each resource will be contained in a directive called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;resource x&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 actual resource name (&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;r0&amp;lt;/span&amp;gt;, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;r1&amp;lt;/span&amp;gt;, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;r2&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;r3&amp;lt;/span&amp;gt; in our case). Within this directive, all resource-specific options are set.&lt;br /&gt;
&lt;br /&gt;
The example below is well documented, so please take a moment to look at the example for &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;
# The &#039;resource&#039; directive defines a given resource and must be followed by the&lt;br /&gt;
# resource&#039;s name.&lt;br /&gt;
# This will be used as the GFS2 partition for shared files.&lt;br /&gt;
resource r0 {&lt;br /&gt;
        # This is the /dev/ device to create to make available this DRBD&lt;br /&gt;
        # resource.&lt;br /&gt;
        device          /dev/drbd0;&lt;br /&gt;
&lt;br /&gt;
        # This tells DRBD where to store it&#039;s internal state information. We&lt;br /&gt;
        # will use &#039;internal&#039;, which tells DRBD to store the information at the&lt;br /&gt;
        # end of the resource&#039;s space.&lt;br /&gt;
        meta-disk       internal;&lt;br /&gt;
&lt;br /&gt;
        # The next two &#039;on&#039; directives setup each individual node&#039;s settings.&lt;br /&gt;
        # The value after the &#039;on&#039; directive *MUST* match the output of&lt;br /&gt;
        # `uname -n` on each node.&lt;br /&gt;
        on an-node04.alteeve.com {&lt;br /&gt;
                # This is the network IP address on the network interface and&lt;br /&gt;
                # the TCP port to use for communication between the nodes. Note&lt;br /&gt;
                # that the IP address below in on our Storage Network. The TCP&lt;br /&gt;
                # port must be unique per resource, but the interface itself&lt;br /&gt;
                # can be shared. &lt;br /&gt;
                # IPv6 is usable with &#039;address ipv6 [address]:port&#039;.&lt;br /&gt;
                address         192.168.2.74:7789;&lt;br /&gt;
&lt;br /&gt;
                # This is the node&#039;s storage device that will back this&lt;br /&gt;
                # resource.&lt;br /&gt;
                disk            /dev/sda5;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        # Same as above, but altered to reflect the second node.&lt;br /&gt;
        on an-node05.alteeve.com {&lt;br /&gt;
                address         192.168.2.75:7789;&lt;br /&gt;
                disk            /dev/sda5;&lt;br /&gt;
        }&lt;br /&gt;
}&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;r1&amp;lt;/span&amp;gt;, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;r2&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;r3&amp;lt;/span&amp;gt; resources should be nearly identical to the example above. The main difference will the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;device&amp;lt;/span&amp;gt; value and within each node&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;on x { }&amp;lt;/span&amp;gt; directive. We will incrementing the [[TCP]] ports to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;7790&amp;lt;/span&amp;gt;, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;7791&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;7792&amp;lt;/span&amp;gt; respectively. Likewise, we will need to alter the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;disk&amp;lt;/span&amp;gt; to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/sda6&amp;lt;/span&amp;gt;, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/sda7&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/sda8&amp;lt;/span&amp;gt; respectively. Finally, the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;device&amp;lt;/span&amp;gt; will be incremented to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/drbd1&amp;lt;/span&amp;gt;, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/drbd2&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/drbd3&amp;lt;/span&amp;gt; respectively.&lt;br /&gt;
&lt;br /&gt;
=== Housekeeping Before Starting Our DRBD Resources ===&lt;br /&gt;
&lt;br /&gt;
Let&#039;s take a look at the complete &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/drbd.conf&amp;lt;/span&amp;gt; file, validate it for use and then push it to the second node.&lt;br /&gt;
&lt;br /&gt;
==== The Finished /etc/drbd.conf File ====&lt;br /&gt;
&lt;br /&gt;
The finished &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/drbd.conf&amp;lt;/span&amp;gt; file should look for or less like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
#&lt;br /&gt;
# please have a a look at the example configuration file in&lt;br /&gt;
# /usr/share/doc/drbd83/drbd.conf&lt;br /&gt;
#&lt;br /&gt;
&lt;br /&gt;
# The &#039;global&#039; directive covers values that apply to RBD in general.&lt;br /&gt;
global {&lt;br /&gt;
	# This tells Linbit that it&#039;s okay to count us as a DRBD user. If you&lt;br /&gt;
	# have privacy concerns, set this to &#039;no&#039;.&lt;br /&gt;
	usage-count	yes;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
# The &#039;common&#039; directive sets defaults values for all resources.&lt;br /&gt;
common {&lt;br /&gt;
	# Protocol &#039;C&#039; tells DRBD to not report a disk write as complete until&lt;br /&gt;
	# it has been confirmed written to both nodes. This is required for&lt;br /&gt;
	# Primary/Primary use.&lt;br /&gt;
        protocol	C;&lt;br /&gt;
&lt;br /&gt;
	# This sets the default sync rate to 15 MiB/sec. Be careful about&lt;br /&gt;
	# setting this too high! High speed sync&#039;ing can flog your drives and&lt;br /&gt;
	# push disk I/O times very high.&lt;br /&gt;
        syncer {&lt;br /&gt;
                rate	15M;&lt;br /&gt;
        }&lt;br /&gt;
	&lt;br /&gt;
	# This tells DRBD what policy to use when a fence is required.&lt;br /&gt;
        disk {&lt;br /&gt;
		# This tells DRBD to block I/O (resource) and then try to fence&lt;br /&gt;
		# the other node (stonith). The &#039;stonith&#039; option requires that&lt;br /&gt;
		# we set a fence handler below. The name &#039;stonith&#039; comes from&lt;br /&gt;
		# &amp;quot;Shoot The Other Nide In The Head&amp;quot; and is a term used in&lt;br /&gt;
		# other clustering environments. It is synonomous with with&lt;br /&gt;
		# &#039;fence&#039;.&lt;br /&gt;
                fencing		resource-and-stonith;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
	# We set &#039;stonith&#039; above, so here we tell DRBD how to actually fence&lt;br /&gt;
	# the other node.&lt;br /&gt;
        handlers {&lt;br /&gt;
		# The term &#039;outdate-peer&#039; comes from other scripts that flag&lt;br /&gt;
		# the other node&#039;s resource backing device as &#039;Inconsistent&#039;.&lt;br /&gt;
		# In our case though, we&#039;re flat-out fencing the other node,&lt;br /&gt;
		# which has the same effective result.&lt;br /&gt;
                outdate-peer	&amp;quot;/sbin/obliterate-peer.sh&amp;quot;;&lt;br /&gt;
        }&lt;br /&gt;
	&lt;br /&gt;
	# Here we tell DRBD that we want to use Primary/Primary mode. It is&lt;br /&gt;
	# also where we define split-brain (sb) recovery policies. As we&#039;ll be&lt;br /&gt;
	# running all of our resources in Primary/Primary, only the&lt;br /&gt;
	# &#039;after-sb-2pri&#039; really means anything to us.&lt;br /&gt;
        net {&lt;br /&gt;
		# Tell DRBD to allow dual-primary.&lt;br /&gt;
                allow-two-primaries;&lt;br /&gt;
&lt;br /&gt;
		# Set the recover policy for split-brain recover when no device&lt;br /&gt;
		# in the resource was primary.&lt;br /&gt;
                after-sb-0pri	discard-zero-changes;&lt;br /&gt;
&lt;br /&gt;
		# Now if one device was primary.&lt;br /&gt;
                after-sb-1pri	discard-secondary;&lt;br /&gt;
&lt;br /&gt;
		# Finally, set the policy when both nodes were Primary. The&lt;br /&gt;
		# only viable option is &#039;disconnect&#039;, which tells DRBD to&lt;br /&gt;
		# simply tear-down the DRBD resource right away and wait for&lt;br /&gt;
		# the administrator to manually invalidate one side of the&lt;br /&gt;
		# resource.&lt;br /&gt;
                after-sb-2pri	disconnect;&lt;br /&gt;
        }&lt;br /&gt;
	&lt;br /&gt;
	# This tells DRBD what to do when the resource starts.&lt;br /&gt;
        startup {&lt;br /&gt;
		# In our case, we&#039;re telling DRBD to promote both devices in&lt;br /&gt;
		# our resource to Primary on start.&lt;br /&gt;
                become-primary-on 	both;&lt;br /&gt;
        }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
# The &#039;resource&#039; directive defines a given resource and must be followed by the&lt;br /&gt;
# resource&#039;s name.&lt;br /&gt;
# This will be used as the GFS2 partition for shared files.&lt;br /&gt;
resource r0 {&lt;br /&gt;
	# This is the /dev/ device to create to make available this DRBD&lt;br /&gt;
	# resource.&lt;br /&gt;
        device 		/dev/drbd0;&lt;br /&gt;
	&lt;br /&gt;
	# This tells DRBD where to store it&#039;s internal state information. We&lt;br /&gt;
	# will use &#039;internal&#039;, which tells DRBD to store the information at the&lt;br /&gt;
	# end of the resource&#039;s space.&lt;br /&gt;
        meta-disk 	internal;&lt;br /&gt;
	&lt;br /&gt;
	# The next two &#039;on&#039; directives setup each individual node&#039;s settings.&lt;br /&gt;
	# The value after the &#039;on&#039; directive *MUST* match the output of&lt;br /&gt;
	# `uname -n` on each node.&lt;br /&gt;
        on an-node04.alteeve.com {&lt;br /&gt;
		# This is the network IP address on the network interface and&lt;br /&gt;
		# the TCP port to use for communication between the nodes. Note&lt;br /&gt;
		# that the IP address below in on our Storage Network. The TCP&lt;br /&gt;
		# port must be unique per resource, but the interface itself&lt;br /&gt;
		# can be shared. &lt;br /&gt;
		# IPv6 is usable with &#039;address ipv6 [address]:port&#039;.&lt;br /&gt;
                address 	192.168.2.74:7789;&lt;br /&gt;
		&lt;br /&gt;
		# This is the node&#039;s storage device that will back this&lt;br /&gt;
		# resource.&lt;br /&gt;
                disk    	/dev/sda5;&lt;br /&gt;
        }&lt;br /&gt;
	&lt;br /&gt;
	# Same as above, but altered to reflect the second node.&lt;br /&gt;
        on an-node05.alteeve.com {&lt;br /&gt;
                address 	192.168.2.75:7789;&lt;br /&gt;
                disk    	/dev/sda5;&lt;br /&gt;
        }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
# This will be used to host VMs running primarily on an-node04.&lt;br /&gt;
resource r1 {&lt;br /&gt;
        device          /dev/drbd1;&lt;br /&gt;
&lt;br /&gt;
        meta-disk       internal;&lt;br /&gt;
&lt;br /&gt;
        on an-node04.alteeve.com {&lt;br /&gt;
                address         192.168.2.74:7790;&lt;br /&gt;
                disk            /dev/sda6;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        on an-node05.alteeve.com {&lt;br /&gt;
                address         192.168.2.75:7790;&lt;br /&gt;
                disk            /dev/sda6;&lt;br /&gt;
        }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
# This will be used to host VMs running primarily on an-node05.&lt;br /&gt;
resource r2 {&lt;br /&gt;
        device          /dev/drbd2;&lt;br /&gt;
&lt;br /&gt;
        meta-disk       internal;&lt;br /&gt;
&lt;br /&gt;
        on an-node04.alteeve.com {&lt;br /&gt;
                address         192.168.2.74:7791;&lt;br /&gt;
                disk            /dev/sda7;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        on an-node05.alteeve.com {&lt;br /&gt;
                address         192.168.2.75:7791;&lt;br /&gt;
                disk            /dev/sda7;&lt;br /&gt;
        }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
# This will be set aside as free space for future expansion.&lt;br /&gt;
resource r3 {&lt;br /&gt;
        device          /dev/drbd3;&lt;br /&gt;
&lt;br /&gt;
        meta-disk       internal;&lt;br /&gt;
&lt;br /&gt;
        on an-node04.alteeve.com {&lt;br /&gt;
                address         192.168.2.74:7792;&lt;br /&gt;
                disk            /dev/sda8;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        on an-node05.alteeve.com {&lt;br /&gt;
                address         192.168.2.75:7792;&lt;br /&gt;
                disk            /dev/sda8;&lt;br /&gt;
        }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Validating the /etc/drbd.conf Syntax ====&lt;br /&gt;
&lt;br /&gt;
To check for errors, we will validate the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/drbd.conf&amp;lt;/span&amp;gt; file. To do this, run &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;drbdadm dump&amp;lt;/span&amp;gt;. If there are syntactical errors, fix them before proceeding. Once the file is correct, it will be dump it&#039;s view of the configuration to the screen with minimal commenting. Don&#039;t worry about slight differences (ie: &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;meta-disk external;&amp;lt;/span&amp;gt; being inside the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;on { }&amp;lt;/span&amp;gt; directives).&lt;br /&gt;
&lt;br /&gt;
The first time you ever do this, you will also see a note telling you that you are the &#039;&#039;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;n&amp;lt;/span&amp;gt;&#039;&#039;th DRBD user.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
drbdadm dump&lt;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 9369th user to install this version&lt;br /&gt;
# /etc/drbd.conf&lt;br /&gt;
common {&lt;br /&gt;
    protocol               C;&lt;br /&gt;
    net {&lt;br /&gt;
        allow-two-primaries;&lt;br /&gt;
        after-sb-0pri    discard-zero-changes;&lt;br /&gt;
        after-sb-1pri    discard-secondary;&lt;br /&gt;
        after-sb-2pri    disconnect;&lt;br /&gt;
    }&lt;br /&gt;
    disk {&lt;br /&gt;
        fencing          resource-and-stonith;&lt;br /&gt;
    }&lt;br /&gt;
    syncer {&lt;br /&gt;
        rate             15M;&lt;br /&gt;
    }&lt;br /&gt;
    startup {&lt;br /&gt;
        become-primary-on both;&lt;br /&gt;
    }&lt;br /&gt;
    handlers {&lt;br /&gt;
        fence-peer       /sbin/obliterate-peer.sh;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
# resource r0 on an-node04.alteeve.com: not ignored, not stacked&lt;br /&gt;
resource r0 {&lt;br /&gt;
    on an-node04.alteeve.com {&lt;br /&gt;
        device           /dev/drbd0 minor 0;&lt;br /&gt;
        disk             /dev/sda5;&lt;br /&gt;
        address          ipv4 192.168.2.74:7789;&lt;br /&gt;
        meta-disk        internal;&lt;br /&gt;
    }&lt;br /&gt;
    on an-node05.alteeve.com {&lt;br /&gt;
        device           /dev/drbd0 minor 0;&lt;br /&gt;
        disk             /dev/sda5;&lt;br /&gt;
        address          ipv4 192.168.2.75:7789;&lt;br /&gt;
        meta-disk        internal;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
# resource r1 on an-node04.alteeve.com: not ignored, not stacked&lt;br /&gt;
resource r1 {&lt;br /&gt;
    on an-node04.alteeve.com {&lt;br /&gt;
        device           /dev/drbd1 minor 1;&lt;br /&gt;
        disk             /dev/sda6;&lt;br /&gt;
        address          ipv4 192.168.2.74:7790;&lt;br /&gt;
        meta-disk        internal;&lt;br /&gt;
    }&lt;br /&gt;
    on an-node05.alteeve.com {&lt;br /&gt;
        device           /dev/drbd1 minor 1;&lt;br /&gt;
        disk             /dev/sda6;&lt;br /&gt;
        address          ipv4 192.168.2.75:7790;&lt;br /&gt;
        meta-disk        internal;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
# resource r2 on an-node04.alteeve.com: not ignored, not stacked&lt;br /&gt;
resource r2 {&lt;br /&gt;
    on an-node04.alteeve.com {&lt;br /&gt;
        device           /dev/drbd2 minor 2;&lt;br /&gt;
        disk             /dev/sda7;&lt;br /&gt;
        address          ipv4 192.168.2.74:7791;&lt;br /&gt;
        meta-disk        internal;&lt;br /&gt;
    }&lt;br /&gt;
    on an-node05.alteeve.com {&lt;br /&gt;
        device           /dev/drbd2 minor 2;&lt;br /&gt;
        disk             /dev/sda7;&lt;br /&gt;
        address          ipv4 192.168.2.75:7791;&lt;br /&gt;
        meta-disk        internal;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
# resource r3 on an-node04.alteeve.com: not ignored, not stacked&lt;br /&gt;
resource r3 {&lt;br /&gt;
    on an-node04.alteeve.com {&lt;br /&gt;
        device           /dev/drbd3 minor 3;&lt;br /&gt;
        disk             /dev/sda8;&lt;br /&gt;
        address          ipv4 192.168.2.74:7792;&lt;br /&gt;
        meta-disk        internal;&lt;br /&gt;
    }&lt;br /&gt;
    on an-node05.alteeve.com {&lt;br /&gt;
        device           /dev/drbd3 minor 3;&lt;br /&gt;
        disk             /dev/sda8;&lt;br /&gt;
        address          ipv4 192.168.2.75:7792;&lt;br /&gt;
        meta-disk        internal;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Copying The /etc/drbd.conf to the Second Node ====&lt;br /&gt;
&lt;br /&gt;
Assuming you write the first &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/drbd.conf&amp;lt;/span&amp;gt; file on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt;. So now we need to copy it to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt; before we can start things up.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
rsync -av /etc/drbd.conf root@an-node05:/etc/&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
building file list ... done&lt;br /&gt;
drbd.conf&lt;br /&gt;
&lt;br /&gt;
sent 5577 bytes  received 48 bytes  3750.00 bytes/sec&lt;br /&gt;
total size is 5479  speedup is 0.97&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Loading the DRBD Module ===&lt;br /&gt;
&lt;br /&gt;
By default, the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/init.d/drbd&amp;lt;/span&amp;gt; initialization script handles loading and unloading the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;drbd&amp;lt;/span&amp;gt; module. It&#039;s too early for us to start the DRBD resources using the initialization script, so we need to manually load the module ourselves. This will only need to be done once. After you get the DRBD resources up for the first time, you can safely use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/init.d/drbd&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
To load the module, run:&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;
You can verify that the module is loaded using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;lsmod&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;
lsmod |grep 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;
drbd                  277144  0 &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The module also creates a &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/proc&amp;lt;/span&amp;gt; file called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;drbd&amp;lt;/span&amp;gt;. By &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cat&amp;lt;/span&amp;gt;&#039;ing this, we can watch the progress of our work. I&#039;d recommend opening a terminal windows for each node and tracking it using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;watch&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;
watch cat /proc/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;
Every 2.0s: cat /proc/drbd                                                                     Tue Mar 29 13:03:44 2011&lt;br /&gt;
&lt;br /&gt;
version: 8.3.8 (api:88/proto:86-94)&lt;br /&gt;
GIT-hash: d78846e52224fd00562f7c225bcc25b2d422321d build by mockbuild@builder10.centos.org, 2010-06-04 08:04:27&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the steps ahead, I will show what the output from &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;watch&amp;lt;/span&amp;gt;&#039;ing &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/proc/drbd&amp;lt;/span&amp;gt; will be.&lt;br /&gt;
&lt;br /&gt;
=== Initializing Our Resources ===&lt;br /&gt;
&lt;br /&gt;
Before we can start each resource, we must first initialize each of the backing device. This is done by running &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;drbdadm create-md x&amp;lt;/span&amp;gt;. We&#039;ll run this on both nodes, replacing &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;x&amp;lt;/span&amp;gt; with the four resource names.&lt;br /&gt;
&lt;br /&gt;
The first time you do this, the command will execute right away.&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;
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;
If you&#039;ve ever used the partition in a DRBD device before though, you will need to confirm that you want to over-write the existing meta-data.&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;
&lt;br /&gt;
Type &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;yes&amp;lt;/span&amp;gt; when prompted.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
You want me to create a v08 style flexible-size internal meta data block.&lt;br /&gt;
There appears to be a v08 flexible-size internal meta data block&lt;br /&gt;
already in place on /dev/sda5 at byte offset 10010128384&lt;br /&gt;
Do you really want to overwrite the existing v08 meta-data?&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
[need to type &#039;yes&#039; to confirm] yes&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&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;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Repeat for all four resource names, then do the same on the other node.&lt;br /&gt;
&lt;br /&gt;
{{note|1=If you are trying to initialize a resource&#039;s backing device that has been used before, you may need to wipe out the first few blocks.}}&lt;br /&gt;
&lt;br /&gt;
If you try to initialize the resource&#039;s backing device and get an error like below, you will need to &amp;quot;zero out&amp;quot; the first bit of the resource. This is done by using the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;dd&amp;lt;/span&amp;gt; (disk duplication) program, reading in from the special &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/zero&amp;lt;/span&amp;gt; file and writing out a set number of block (usually 4096 [[KiB]]) at the start of the DRBD resource.&lt;br /&gt;
&lt;br /&gt;
If you see the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
pvs stderr:        _undo_flock /var/lock/lvm/V_drbd_sh0_vg0&lt;br /&gt;
pvs stderr:  Skipping volume group drbd_sh0_vg0&lt;br /&gt;
pvs stderr:      Unlocking /var/lock/lvm/P_global&lt;br /&gt;
pvs stderr:        _undo_flock /var/lock/lvm/P_global&lt;br /&gt;
&lt;br /&gt;
md_offset 10010128384&lt;br /&gt;
al_offset 10010095616&lt;br /&gt;
bm_offset 10009788416&lt;br /&gt;
&lt;br /&gt;
Found LVM2 physical volume signature&lt;br /&gt;
     9775184 kB left usable by current configuration&lt;br /&gt;
Could not determine the size of the actually used data area.&lt;br /&gt;
&lt;br /&gt;
Device size would be truncated, which&lt;br /&gt;
would corrupt data and result in&lt;br /&gt;
&#039;access beyond end of device&#039; errors.&lt;br /&gt;
If you want me to do this, you need to zero out the first part&lt;br /&gt;
of the device (destroy the content).&lt;br /&gt;
You should be very sure that you mean it.&lt;br /&gt;
Operation refused.&lt;br /&gt;
&lt;br /&gt;
Command &#039;drbdmeta 0 v08 /dev/sda5 internal create-md&#039; terminated with exit code 40&lt;br /&gt;
drbdadm create-md r0: exited with code 40&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then you will need to zero the start of the backing device.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
dd if=/dev/zero of=/dev/sda5 count=10000&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
10000+0 records in&lt;br /&gt;
10000+0 records out&lt;br /&gt;
5120000 bytes (5.1 MB) copied, 0.101682 seconds, 50.4 MB/s&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You should now be able to initialize the resource.&lt;br /&gt;
&lt;br /&gt;
=== Initial Connections ===&lt;br /&gt;
&lt;br /&gt;
As this is the first time that the DRBD resource will be started, neither side will be in a &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;consistent&amp;lt;/span&amp;gt; state. The effect is that we will not be able to promote either node to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Primary&amp;lt;/span&amp;gt;. So we need to tell DRBD that it must consider one side to be valid and, thus, overwrite the other node&#039;s data.&lt;br /&gt;
&lt;br /&gt;
{{note|1=This is the &#039;&#039;&#039;only&#039;&#039;&#039; time you should ever use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--overwrite-data-of-peer&amp;lt;/span&amp;gt;! Never use it to recover from a split brain.}}&lt;br /&gt;
&lt;br /&gt;
The steps we will now take for each resource are:&lt;br /&gt;
* Attach each node&#039;s backing device to the DRBD resource.&lt;br /&gt;
* Establish the network connection between the two nodes.&lt;br /&gt;
* Force one node&#039;s backing device to be considered &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;UpToDate&amp;lt;/span&amp;gt; and promote it to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Primary&amp;lt;/span&amp;gt;.&lt;br /&gt;
* Promote the second node to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Primary&amp;lt;/span&amp;gt;&lt;br /&gt;
* Bump the synchronization rate to the value specified in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/drbd.conf&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Now lets walk through these steps, taking a look at &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/proc/drbd&amp;lt;/span&amp;gt; after each step.&lt;br /&gt;
&lt;br /&gt;
{{note|1=You can save some typing with a &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;bash&amp;lt;/span&amp;gt; trick. Where you would normally call &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;r0&amp;lt;/span&amp;gt;, then &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;r1&amp;lt;/span&amp;gt;, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;r2&amp;lt;/span&amp;gt; a last &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;r3&amp;lt;/span&amp;gt;, you can call all at once by instead calling &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;command&amp;gt; r{0,1,2,3}&amp;lt;/span&amp;gt;.}}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On Both Nodes&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
Attach the resources local backing devices to their DRBD resources. That is, connect the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/sda{5,6,7,8}&amp;lt;/span&amp;gt; to their corresponding &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;r{0,1,2,3}&amp;lt;/span&amp;gt; resources.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
drbdadm attach r{0,1,2,3}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
version: 8.3.8 (api:88/proto:86-94)&lt;br /&gt;
GIT-hash: d78846e52224fd00562f7c225bcc25b2d422321d build by mockbuild@builder10.centos.org, 2010-06-04 08:04:27&lt;br /&gt;
 0: cs:StandAlone ro:Secondary/Unknown ds:Inconsistent/DUnknown   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:9775184&lt;br /&gt;
 1: cs:StandAlone ro:Secondary/Unknown ds:Inconsistent/DUnknown   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:97664116&lt;br /&gt;
 2: cs:StandAlone ro:Secondary/Unknown ds:Inconsistent/DUnknown   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:97664116&lt;br /&gt;
 3: cs:StandAlone ro:Secondary/Unknown ds:Inconsistent/DUnknown   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:257843340&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On Both Nodes&#039;&#039;&#039;: &lt;br /&gt;
&lt;br /&gt;
Now we&#039;ll connect the corresponding resource backing devices on each node together to create the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/drbdX&amp;lt;/span&amp;gt; devices. Note that while one node is connecting, it&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/proc/drbd&amp;lt;/span&amp;gt; will show the resource as being in the connection state of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;WFConnection&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 connect r{0,1,2,3}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
version: 8.3.8 (api:88/proto:86-94)&lt;br /&gt;
GIT-hash: d78846e52224fd00562f7c225bcc25b2d422321d build by mockbuild@builder10.centos.org, 2010-06-04 08:04:27&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:9775184&lt;br /&gt;
 1: 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:97664116&lt;br /&gt;
 2: 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:97664116&lt;br /&gt;
 3: 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:257843340&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On One Node Only&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
As the resource is totally new, we&#039;ll need to tell DRBD that one node&#039;s backing device is &amp;quot;more&amp;quot; valid than the other. It is entirely arbitrary which node we run this on. I run this on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt; out of habit. This step also promotes the local resource to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Primary&amp;lt;/span&amp;gt;, which means that it is usable by the local system.&lt;br /&gt;
&lt;br /&gt;
{{note|1=An alternative to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--overwrite-data-of-peer&amp;lt;/span&amp;gt; is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;drbdadm -- --clear-bitmap new-current-uuid res&amp;lt;/span&amp;gt; followed by &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;drbdadm primary res&amp;lt;/span&amp;gt;. This will instantly mark both sides of the DRBD resource as &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;UpToDate&amp;lt;/span&amp;gt; without needing to perform the initial sync.}}&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 r{0,1,2,3}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
version: 8.3.8 (api:88/proto:86-94)&lt;br /&gt;
GIT-hash: d78846e52224fd00562f7c225bcc25b2d422321d build by mockbuild@builder10.centos.org, 2010-06-04 08:04:27&lt;br /&gt;
 0: cs:SyncSource ro:Primary/Secondary ds:UpToDate/Inconsistent C r----&lt;br /&gt;
    ns:896 nr:0 dw:0 dr:896 al:0 bm:0 lo:0 pe:0 ua:0 ap:0 ep:1 wo:b oos:9774288&lt;br /&gt;
        [&amp;gt;....................] sync&#039;ed:  0.1% (9544/9544)M delay_probe: 701&lt;br /&gt;
        finish: 4:31:30 speed: 448 (448) K/sec&lt;br /&gt;
 1: cs:SyncSource ro:Primary/Secondary ds:UpToDate/Inconsistent C r----&lt;br /&gt;
    ns:736 nr:0 dw:0 dr:736 al:0 bm:0 lo:0 pe:0 ua:0 ap:0 ep:1 wo:b oos:97663380&lt;br /&gt;
        [&amp;gt;....................] sync&#039;ed:  0.1% (95372/95372)M delay_probe: 620&lt;br /&gt;
        finish: 67:49:18 speed: 368 (368) K/sec&lt;br /&gt;
 2: cs:SyncSource ro:Primary/Secondary ds:UpToDate/Inconsistent C r----&lt;br /&gt;
    ns:672 nr:0 dw:0 dr:672 al:0 bm:0 lo:0 pe:0 ua:0 ap:0 ep:1 wo:b oos:97663444&lt;br /&gt;
        [&amp;gt;....................] sync&#039;ed:  0.1% (95372/95372)M delay_probe: 556&lt;br /&gt;
        finish: 67:49:18 speed: 336 (336) K/sec&lt;br /&gt;
 3: cs:SyncSource ro:Primary/Secondary ds:UpToDate/Inconsistent C r----&lt;br /&gt;
    ns:576 nr:0 dw:0 dr:576 al:0 bm:0 lo:0 pe:0 ua:0 ap:0 ep:1 wo:b oos:257842764&lt;br /&gt;
        [&amp;gt;....................] sync&#039;ed:  0.1% (251796/251800)M delay_probe: 447&lt;br /&gt;
        finish: 89:31:43 speed: 576 (576) K/sec&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On The Other Node&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
The last required step is to promote the other node&#039;s resource to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Primary&amp;lt;/span&amp;gt; as well.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
drbdadm primary r{0,1,2,3}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
version: 8.3.8 (api:88/proto:86-94)&lt;br /&gt;
GIT-hash: d78846e52224fd00562f7c225bcc25b2d422321d build by mockbuild@builder10.centos.org, 2010-06-04 08:04:27&lt;br /&gt;
 0: cs:SyncSource ro:Primary/Primary ds:UpToDate/Inconsistent C r----&lt;br /&gt;
    ns:159008 nr:0 dw:0 dr:159008 al:0 bm:9 lo:0 pe:0 ua:0 ap:0 ep:1 wo:b oos:9616176&lt;br /&gt;
        [&amp;gt;....................] sync&#039;ed:  1.7% (9388/9544)M delay_probe: 130846&lt;br /&gt;
        finish: 6:40:40 speed: 256 (312) K/sec&lt;br /&gt;
 1: cs:SyncSource ro:Primary/Primary ds:UpToDate/Inconsistent C r----&lt;br /&gt;
    ns:161152 nr:0 dw:0 dr:161152 al:0 bm:9 lo:0 pe:0 ua:0 ap:0 ep:1 wo:b oos:97502964&lt;br /&gt;
        [&amp;gt;....................] sync&#039;ed:  0.2% (95216/95372)M delay_probe: 131004&lt;br /&gt;
        finish: 67:42:37 speed: 0 (316) K/sec&lt;br /&gt;
 2: cs:SyncSource ro:Primary/Primary ds:UpToDate/Inconsistent C r----&lt;br /&gt;
    ns:161024 nr:0 dw:0 dr:161024 al:0 bm:9 lo:0 pe:0 ua:0 ap:0 ep:1 wo:b oos:97503092&lt;br /&gt;
        [&amp;gt;....................] sync&#039;ed:  0.2% (95216/95372)M delay_probe: 130852&lt;br /&gt;
        finish: 76:10:27 speed: 348 (316) K/sec&lt;br /&gt;
 3: cs:SyncSource ro:Primary/Primary ds:UpToDate/Inconsistent C r----&lt;br /&gt;
    ns:160832 nr:0 dw:0 dr:160832 al:0 bm:9 lo:0 pe:0 ua:0 ap:0 ep:1 wo:b oos:257682508&lt;br /&gt;
        [&amp;gt;....................] sync&#039;ed:  0.1% (251640/251800)M delay_probe: 130729&lt;br /&gt;
        finish: 178:56:46 speed: 128 (316) K/sec&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{note|1=From here on in, the steps shown are not strictly needed. The first step is highly recommended, as it is needed to set the desired sync rate, but DRBD will work fine as it now is.}}&lt;br /&gt;
&lt;br /&gt;
DRBD is a bit sensitive to performance issues, so we have to handle multiple resources syncing at the same time a little carefully. The temptation to just raise the sync rate on all resources will get us into trouble.&lt;br /&gt;
&lt;br /&gt;
The safest bet to get all of the resources updated is to pause the synchronization on all but one resource, bump the sync rate up to a little under the maximum write speed of the resource, waiting for the resource to sync, resuming sync on the next resource and so on.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On One Node&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
Let&#039;s pause the synchronization on all but 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 pause-sync r{1,2,3}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
version: 8.3.8 (api:88/proto:86-94)&lt;br /&gt;
GIT-hash: d78846e52224fd00562f7c225bcc25b2d422321d build by mockbuild@builder10.centos.org, 2010-06-04 08:04:27&lt;br /&gt;
 0: cs:SyncSource ro:Primary/Primary ds:UpToDate/Inconsistent C r----&lt;br /&gt;
    ns:32288 nr:0 dw:0 dr:32288 al:0 bm:1 lo:0 pe:0 ua:0 ap:0 ep:1 wo:b oos:9742896&lt;br /&gt;
        [&amp;gt;....................] sync&#039;ed:  0.4% (9512/9544)M delay_probe: 26632&lt;br /&gt;
        finish: 6:45:57 speed: 336 (312) K/sec&lt;br /&gt;
 1: cs:PausedSyncS ro:Primary/Primary ds:UpToDate/Inconsistent C r--u-&lt;br /&gt;
    ns:13184 nr:0 dw:0 dr:13184 al:0 bm:0 lo:0 pe:0 ua:0 ap:0 ep:1 wo:b oos:97650932&lt;br /&gt;
 2: cs:PausedSyncS ro:Primary/Primary ds:UpToDate/Inconsistent C r--u-&lt;br /&gt;
    ns:12192 nr:0 dw:0 dr:12192 al:0 bm:0 lo:0 pe:0 ua:0 ap:0 ep:1 wo:b oos:97651924&lt;br /&gt;
 3: cs:PausedSyncS ro:Primary/Primary ds:UpToDate/Inconsistent C r--u-&lt;br /&gt;
    ns:30656 nr:0 dw:0 dr:30656 al:0 bm:1 lo:0 pe:0 ua:0 ap:0 ep:1 wo:b oos:257812684&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I know that on my server, I can get a maximum write speed of roughly 40 [[MiB]]/sec. So I will manually over-ride the defined sync rate of 15 MiB/sec and set it to 35 MiB/sec. This uses a new DRBD command called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;drbdsetup&amp;lt;/span&amp;gt; and takes the DRBD device instead of the resource name.&lt;br /&gt;
&lt;br /&gt;
{{note|1=The transfer speed will not instantly reach maximum. It takes some time for synchronization rate changes to ramp up and down.}}&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;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
version: 8.3.8 (api:88/proto:86-94)&lt;br /&gt;
GIT-hash: d78846e52224fd00562f7c225bcc25b2d422321d build by mockbuild@builder10.centos.org, 2010-06-04 08:04:27&lt;br /&gt;
 0: cs:SyncTarget ro:Primary/Primary ds:Inconsistent/UpToDate C r----&lt;br /&gt;
    ns:0 nr:253216 dw:252128 dr:0 al:0 bm:15 lo:35 pe:78 ua:34 ap:0 ep:1 wo:b oos:9523056&lt;br /&gt;
        [&amp;gt;....................] sync&#039;ed:  2.7% (9296/9544)M queue_delay: 4.3 ms&lt;br /&gt;
        finish: 0:04:39 speed: 34,040 (1,984) want: 35,840 K/sec&lt;br /&gt;
 1: cs:PausedSyncT ro:Primary/Primary ds:Inconsistent/UpToDate C r-p--&lt;br /&gt;
    ns:0 nr:13184 dw:13184 dr:0 al:0 bm:0 lo:0 pe:0 ua:0 ap:0 ep:1 wo:b oos:97650932&lt;br /&gt;
 2: cs:PausedSyncT ro:Primary/Primary ds:Inconsistent/UpToDate C r-p--&lt;br /&gt;
    ns:0 nr:12192 dw:12192 dr:0 al:0 bm:0 lo:0 pe:0 ua:0 ap:0 ep:1 wo:b oos:97651924&lt;br /&gt;
 3: cs:PausedSyncT ro:Primary/Primary ds:Inconsistent/UpToDate C r-p--&lt;br /&gt;
    ns:0 nr:30656 dw:30656 dr:0 al:0 bm:1 lo:0 pe:0 ua:0 ap:0 ep:1 wo:b oos:257812684&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{note|1=The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;want: 35,840 K/sec&amp;lt;/span&amp;gt; will not show up on the node that you increased the sync rate on. Also note that it will occasionally show &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;want: 0 K/sec&amp;lt;/span&amp;gt;. So long as the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;oos:x&amp;lt;/span&amp;gt; (out of sync blocks) value keeps dropping and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;speed&amp;lt;/span&amp;gt; is still reasonable, the sync is fine.}}&lt;br /&gt;
&lt;br /&gt;
After a period of time, you will see the synchronization finish and the resource will then be in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;UpToDate/UpToDate&amp;lt;/span&amp;gt; state. We&#039;ll now tell DRBD to restore the defined sync rate of 15 MiB/sec, resume synchronization of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;r1&amp;lt;/span&amp;gt; and increase the sync rate of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;r1&amp;lt;/span&amp;gt; to 35 MiB/sec.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
drbdadm syncer r0&lt;br /&gt;
drbdadm resume-sync r1&lt;br /&gt;
drbdsetup /dev/drbd1 syncer -r 35M&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
version: 8.3.8 (api:88/proto:86-94)&lt;br /&gt;
GIT-hash: d78846e52224fd00562f7c225bcc25b2d422321d build by mockbuild@builder10.centos.org, 2010-06-04 08:04:27&lt;br /&gt;
 0: cs:Connected ro:Primary/Primary ds:UpToDate/UpToDate C r----&lt;br /&gt;
    ns:0 nr:9775184 dw:9775184 dr:0 al:0 bm:597 lo:0 pe:0 ua:0 ap:0 ep:1 wo:b oos:0&lt;br /&gt;
 1: cs:SyncTarget ro:Primary/Primary ds:Inconsistent/UpToDate C r----&lt;br /&gt;
    ns:0 nr:851872 dw:851872 dr:0 al:0 bm:51 lo:0 pe:0 ua:0 ap:0 ep:1 wo:b oos:96812244&lt;br /&gt;
        [&amp;gt;....................] sync&#039;ed:  0.9% (94540/95372)M queue_delay: 0.0 ms&lt;br /&gt;
        finish: 0:24:54 speed: 64,480 (11,508) want: 35,840 K/sec&lt;br /&gt;
 2: cs:PausedSyncT ro:Primary/Primary ds:Inconsistent/UpToDate C r-p--&lt;br /&gt;
    ns:0 nr:12192 dw:12192 dr:0 al:0 bm:0 lo:0 pe:0 ua:0 ap:0 ep:1 wo:b oos:97651924&lt;br /&gt;
 3: cs:PausedSyncT ro:Primary/Primary ds:Inconsistent/UpToDate C r-p--&lt;br /&gt;
    ns:0 nr:30656 dw:30656 dr:0 al:0 bm:1 lo:0 pe:0 ua:0 ap:0 ep:1 wo:b oos:257812684&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As before, once &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;r1&amp;lt;/span&amp;gt; is finished syncing, we&#039;ll restore the defined sync rate, resume sync on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;r2&amp;lt;/span&amp;gt; and push the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;r2&amp;lt;/span&amp;gt; sync rate up. Finally, we&#039;ll do the same to the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;r3&amp;lt;/span&amp;gt; resource. Once the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;r3&amp;lt;/span&amp;gt; resource is synced, we&#039;ll restore it&#039;s sync rate and we&#039;ll be finished syncing all of the resources.&lt;br /&gt;
&lt;br /&gt;
Once all resources are synchronized, you should see this on both nodes:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
version: 8.3.8 (api:88/proto:86-94)&lt;br /&gt;
GIT-hash: d78846e52224fd00562f7c225bcc25b2d422321d build by mockbuild@builder10.centos.org, 2010-06-04 08:04:27&lt;br /&gt;
 0: cs:Connected ro:Primary/Primary ds:UpToDate/UpToDate C r----&lt;br /&gt;
    ns:9775184 nr:0 dw:0 dr:9775184 al:0 bm:597 lo:0 pe:0 ua:0 ap:0 ep:1 wo:b oos:0&lt;br /&gt;
 1: cs:Connected ro:Primary/Primary ds:UpToDate/UpToDate C r----&lt;br /&gt;
    ns:97664116 nr:0 dw:0 dr:97664116 al:0 bm:5961 lo:0 pe:0 ua:0 ap:0 ep:1 wo:b oos:0&lt;br /&gt;
 2: cs:Connected ro:Primary/Primary ds:UpToDate/UpToDate C r----&lt;br /&gt;
    ns:97664116 nr:0 dw:0 dr:97664116 al:0 bm:5961 lo:0 pe:0 ua:0 ap:0 ep:1 wo:b oos:0&lt;br /&gt;
 3: cs:Connected ro:Primary/Primary ds:UpToDate/UpToDate C r----&lt;br /&gt;
    ns:257843340 nr:0 dw:0 dr:257843340 al:0 bm:15738 lo:0 pe:0 ua:0 ap:0 ep:1 wo:b oos:0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
That&#039;s it, your resource is ready for use! You do not need to wait for the sync to complete before proceeding. However, ensure that the sync is complete before bringing up VMs on the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Inconsistent&amp;lt;/span&amp;gt; side.&lt;br /&gt;
&lt;br /&gt;
{{note|1=For the rest of the tutorial, we will be ignoring &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;r3&amp;lt;/span&amp;gt; as it&#039;s just a bank of spare disk space.}}&lt;br /&gt;
&lt;br /&gt;
==== Overdoing It ====&lt;br /&gt;
&lt;br /&gt;
If you try to sync too many resources at one or if you set the sync rate too high, you may find that one or more of the resources &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;want: 0 K/sec&amp;lt;/span&amp;gt;. This is a sign that the disks are being hit too hard, and you need to back off the sync rate or flat out pause the synchronization of some resources until the other ones have finished.&lt;br /&gt;
&lt;br /&gt;
{{note|1=In some cases, pushing DRBD too hard may cause synchronization to stall entirely. If this happens, you can try to pause, then resume the sync. If that doesn&#039;t fix it, try changing the sync speed down to a lower speed (see the next section), then pause and resume. If it is still stalling, run &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/init.d/drbd stop&amp;lt;/span&amp;gt; on both nodes, then &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/init.d/drbd start&amp;lt;/span&amp;gt;, pause all but one resource and then set the sync speed on the last resource. Start with a low value and work your way up until you find the maximum stable sync speed for your configuration.}}&lt;br /&gt;
&lt;br /&gt;
==== A Note on Synchronization Speeds ====&lt;br /&gt;
&lt;br /&gt;
As discussed earlier while configuring &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/drbd.conf&amp;lt;/span&amp;gt;, we do not want to have the sync rate set too high. However, if you know that your the disk(s) backing your DRBD resource will not be in use for a while, then you can temporarily drive up the sync rate as we saw above. This can also be used in reverse. If you expect periods of high disk I/O, you can use this same command to temporarily throttle synchronization.&lt;br /&gt;
&lt;br /&gt;
The command to raise the sync rate is below. Note that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;drbdsetup /dev/drbdX&amp;lt;/span&amp;gt; is used here.&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 40M&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To restore it back to the rate set in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/drbd.conf&amp;lt;/span&amp;gt;, run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&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 Clustered LVM ==&lt;br /&gt;
&lt;br /&gt;
This step will have us create three [[LVM]] physical volumes, one for each of the allocated DRBD resources, and then creating three separate volume groups. At this stage, the only logical volume we will create will be for the [[GFS2]] partition. The rest of the LVs will be created later when we provision virtual machines.&lt;br /&gt;
&lt;br /&gt;
=== Modifying /etc/lvm/lvm.conf ===&lt;br /&gt;
&lt;br /&gt;
There are four main things we&#039;re going to change in the LVM configuration file.&lt;br /&gt;
* Change the filter to only see &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/drbd*&amp;lt;/span&amp;gt; devices. Otherwise LVM will see signatures on the DRBD resource and the backing &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/sd*&amp;lt;/span&amp;gt; devices which will cause confusion.&lt;br /&gt;
* Change the locking type to clustered locking.&lt;br /&gt;
* Disable clustered locking from falling back to local locking.&lt;br /&gt;
* We&#039;ll be identifying our clustered VGs and LVs using LVM tags. This tag will be defined using the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;volume_list&amp;lt;/span&amp;gt; variable.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/lvm/lvm.conf /etc/lvm/lvm.conf.orig&lt;br /&gt;
vim /etc/lvm/lvm.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The first step is trivial. Simple alter &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;locking_type = 1&amp;lt;/span&amp;gt; to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;locking_type = 3&amp;lt;/span&amp;gt;.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
    # Type of locking to use. Defaults to local file-based locking (1).&lt;br /&gt;
    # Turn locking off by setting to 0 (dangerous: risks metadata corruption&lt;br /&gt;
    # if LVM2 commands get run concurrently).&lt;br /&gt;
    # Type 2 uses the external shared library locking_library.&lt;br /&gt;
    # Type 3 uses built-in clustered locking.&lt;br /&gt;
    # Type 4 uses read-only locking which forbids any operations that might &lt;br /&gt;
    # change metadata.&lt;br /&gt;
    locking_type = 3&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Next, restrict the filtering so that it only sees the DRBD resources. This is done by changing the filter variable from &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;filter = [ &amp;quot;a/.*/&amp;quot; ]&amp;lt;/span&amp;gt; to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;filter = [ &amp;quot;a|/dev/drbd*|&amp;quot;, &amp;quot;r/.*/&amp;quot; ]&amp;lt;/span&amp;gt;. What this does is tell LVM to &#039;&#039;&#039;a&#039;&#039;&#039;ccept devices matching &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/drbd*&amp;lt;/span&amp;gt; and to &#039;&#039;&#039;r&#039;&#039;&#039;eject all other devices.&lt;br /&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|/dev/drbd*|&amp;quot;, &amp;quot;r/.*/&amp;quot; ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now, we&#039;ll disable falling back to local locking. The reasoning being that if the cluster lock manager [[DLM]] is not available, then we don&#039;t want to touch the storage at all. This is done by changing &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fallback_to_local_locking&amp;lt;/span&amp;gt; from &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt; to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;0&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;
    # If an attempt to initialise type 2 or type 3 locking failed, perhaps&lt;br /&gt;
    # because cluster components such as clvmd are not running, with this set&lt;br /&gt;
    # to 1 an attempt will be made to use local file-based locking (type 1).&lt;br /&gt;
    # If this succeeds, only commands against local volume groups will proceed.&lt;br /&gt;
    # Volume Groups marked as clustered will be ignored.&lt;br /&gt;
    fallback_to_local_locking = 0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Finally, tell LVM to use volumes with our tags by setting &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;volume_list&amp;lt;/span&amp;gt; to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[&amp;quot;@an-cluster01&amp;quot;]&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;
    # If volume_list is defined, each LV is only activated if there is a&lt;br /&gt;
    # match against the list.&lt;br /&gt;
    #   &amp;quot;vgname&amp;quot; and &amp;quot;vgname/lvname&amp;quot; are matched exactly.&lt;br /&gt;
    #   &amp;quot;@tag&amp;quot; matches any tag set in the LV or VG.&lt;br /&gt;
    #   &amp;quot;@*&amp;quot; matches if any tag defined on the host is also set in the LV or VG&lt;br /&gt;
    #&lt;br /&gt;
    # volume_list = [ &amp;quot;vg1&amp;quot;, &amp;quot;vg2/lvol1&amp;quot;, &amp;quot;@tag1&amp;quot;, &amp;quot;@*&amp;quot; ]&lt;br /&gt;
    volume_list = [&amp;quot;@an-cluster01&amp;quot;]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Save the file. With these chages, the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;diff&amp;lt;/span&amp;gt; should look like what is shown below.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
diff -u /etc/lvm/lvm.conf.orig /etc/lvm/lvm.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;diff&amp;quot;&amp;gt;&lt;br /&gt;
--- /etc/lvm/lvm.conf.orig	2011-05-06 15:30:43.000000000 -0400&lt;br /&gt;
+++ /etc/lvm/lvm.conf	2011-05-06 15:34:49.000000000 -0400&lt;br /&gt;
@@ -50,7 +50,8 @@&lt;br /&gt;
 &lt;br /&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/.*/&amp;quot; ]&lt;br /&gt;
+    filter = [ &amp;quot;a|/dev/drbd*|&amp;quot;, &amp;quot;r/.*/&amp;quot; ]&lt;br /&gt;
 &lt;br /&gt;
     # Exclude the cdrom drive&lt;br /&gt;
     # filter = [ &amp;quot;r|/dev/cdrom|&amp;quot; ]&lt;br /&gt;
@@ -289,7 +290,8 @@&lt;br /&gt;
     # Type 3 uses built-in clustered locking.&lt;br /&gt;
     # Type 4 uses read-only locking which forbids any operations that might &lt;br /&gt;
     # change metadata.&lt;br /&gt;
-    locking_type = 1&lt;br /&gt;
+    #locking_type = 1&lt;br /&gt;
+    locking_type = 3&lt;br /&gt;
 &lt;br /&gt;
     # Set to 0 to fail when a lock request cannot be satisfied immediately.&lt;br /&gt;
     wait_for_locks = 1&lt;br /&gt;
@@ -305,7 +307,8 @@&lt;br /&gt;
     # to 1 an attempt will be made to use local file-based locking (type 1).&lt;br /&gt;
     # If this succeeds, only commands against local volume groups will proceed.&lt;br /&gt;
     # Volume Groups marked as clustered will be ignored.&lt;br /&gt;
-    fallback_to_local_locking = 1&lt;br /&gt;
+    #fallback_to_local_locking = 1&lt;br /&gt;
+    fallback_to_local_locking = 0&lt;br /&gt;
 &lt;br /&gt;
     # Local non-LV directory that holds file-based locks while commands are&lt;br /&gt;
     # in progress.  A directory like /tmp that may get wiped on reboot is OK.&lt;br /&gt;
@@ -378,6 +381,7 @@&lt;br /&gt;
     #   &amp;quot;@*&amp;quot; matches if any tag defined on the host is also set in the LV or VG&lt;br /&gt;
     #&lt;br /&gt;
     # volume_list = [ &amp;quot;vg1&amp;quot;, &amp;quot;vg2/lvol1&amp;quot;, &amp;quot;@tag1&amp;quot;, &amp;quot;@*&amp;quot; ]&lt;br /&gt;
+    volume_list = [&amp;quot;@an-cluster01&amp;quot;]&lt;br /&gt;
 &lt;br /&gt;
     # Size (in KB) of each copy operation when mirroring&lt;br /&gt;
     mirror_region_size = 512&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now copy the changed file to the second node.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
rsync -av /etc/lvm/lvm.conf root@an-node05:/etc/lvm/&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
building file list ... done&lt;br /&gt;
lvm.conf&lt;br /&gt;
&lt;br /&gt;
sent 3153 bytes  received 234 bytes  6774.00 bytes/sec&lt;br /&gt;
total size is 22459  speedup is 6.63&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You&#039;re done. Normally we&#039;d want to tell LVM to rescan for PVs, VGs and LVs but at this stage there are none.&lt;br /&gt;
&lt;br /&gt;
=== Starting the clvmd Daemon ===&lt;br /&gt;
&lt;br /&gt;
Before we proceed, we need to start the clustered LVM daemon, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clvmd&amp;lt;/span&amp;gt;. This requires that the cluster is already running. So if you stopped the cluster, start it on both nodes before starting &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clvmd&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;
cman_tool 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;
Version: 6.2.0&lt;br /&gt;
Config Version: 9&lt;br /&gt;
Cluster Name: an-cluster01&lt;br /&gt;
Cluster Id: 60257&lt;br /&gt;
Cluster Member: Yes&lt;br /&gt;
Cluster Generation: 120&lt;br /&gt;
Membership state: Cluster-Member&lt;br /&gt;
Nodes: 2&lt;br /&gt;
Expected votes: 1&lt;br /&gt;
Total votes: 2&lt;br /&gt;
Quorum: 1  &lt;br /&gt;
Active subsystems: 7&lt;br /&gt;
Flags: 2node Dirty &lt;br /&gt;
Ports Bound: 0  &lt;br /&gt;
Node name: an-node04.alteeve.com&lt;br /&gt;
Node ID: 1&lt;br /&gt;
Multicast addresses: 239.192.235.77 &lt;br /&gt;
Node addresses: 192.168.3.74 &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{note|1=The version incremented after the last example when I edited the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cluster.conf&amp;lt;/span&amp;gt; to have my real passwords.}}&lt;br /&gt;
&lt;br /&gt;
So now we see that the cluster is up on both nodes (&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Nodes: 2&amp;lt;/span&amp;gt;), so we can start the clustered LVM daemon.&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;
Starting clvmd: &lt;br /&gt;
Activating VG(s):   No volume groups found&lt;br /&gt;
                                                           [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{note|1=At this stage, the cluster does not start at boot, so we can&#039;t start &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clvmd&amp;lt;/span&amp;gt; at boot yet, either. We&#039;ll do this at the end of the tutorial, so for now, disable &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clvmd&amp;lt;/span&amp;gt; and start it manually after starting &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt; when you first start your cluster.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
chkconfig clvmd off&lt;br /&gt;
chkconfig --list 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;
clvmd          	0:off	1:off	2:off	3:off	4:off	5:off	6:off&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Turning Our DRBD Resources Into LVM Physical Volumes ===&lt;br /&gt;
&lt;br /&gt;
{{note|1=Now that DRBD is in use, commands will only need to be executed on one node and the changes should be immediately seen on the second node.}}&lt;br /&gt;
&lt;br /&gt;
Creating LVM physical volumes is a trivial task. Simply run &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;pvcreate /dev/drbdX&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On One Node&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
pvcreate /dev/drbd{0,1,2}&lt;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;
  Physical volume &amp;quot;/dev/drbd1&amp;quot; successfully created&lt;br /&gt;
  Physical volume &amp;quot;/dev/drbd2&amp;quot; successfully created&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On The Other Node&#039;&#039;&#039;:&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;9.32 GB&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               9.32 GB&lt;br /&gt;
  Allocatable           NO&lt;br /&gt;
  PE Size (KByte)       0&lt;br /&gt;
  Total PE              0&lt;br /&gt;
  Free PE               0&lt;br /&gt;
  Allocated PE          0&lt;br /&gt;
  PV UUID               WxTCW4-lUzL-bR53-km45-13eV-3f8B-ZA5Tb9&lt;br /&gt;
   &lt;br /&gt;
  &amp;quot;/dev/drbd1&amp;quot; is a new physical volume of &amp;quot;93.14 GB&amp;quot;&lt;br /&gt;
  --- NEW Physical volume ---&lt;br /&gt;
  PV Name               /dev/drbd1&lt;br /&gt;
  VG Name               &lt;br /&gt;
  PV Size               93.14 GB&lt;br /&gt;
  Allocatable           NO&lt;br /&gt;
  PE Size (KByte)       0&lt;br /&gt;
  Total PE              0&lt;br /&gt;
  Free PE               0&lt;br /&gt;
  Allocated PE          0&lt;br /&gt;
  PV UUID               zrwlxT-VFA4-5NiK-fwbK-z2Ez-mYxu-Ei8yZs&lt;br /&gt;
   &lt;br /&gt;
  &amp;quot;/dev/drbd2&amp;quot; is a new physical volume of &amp;quot;93.14 GB&amp;quot;&lt;br /&gt;
  --- NEW Physical volume ---&lt;br /&gt;
  PV Name               /dev/drbd2&lt;br /&gt;
  VG Name               &lt;br /&gt;
  PV Size               93.14 GB&lt;br /&gt;
  Allocatable           NO&lt;br /&gt;
  PE Size (KByte)       0&lt;br /&gt;
  Total PE              0&lt;br /&gt;
  Free PE               0&lt;br /&gt;
  Allocated PE          0&lt;br /&gt;
  PV UUID               6d4e5P-pjHE-4axT-ZRyG-lJa7-8oLa-TjkZFy&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Before proceeding, be sure to have LVM rescan for the new [[PV]]s so that it&#039;s cache is up to date. This isn&#039;t strictly needed, but I find it a useful habit to get into.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On both nodes&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
pvscan&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
  PV /dev/drbd0                      lvm2 [9.32 GB]&lt;br /&gt;
  PV /dev/drbd1                      lvm2 [93.14 GB]&lt;br /&gt;
  PV /dev/drbd2                      lvm2 [93.14 GB]&lt;br /&gt;
  Total: 3 [195.60 GB] / in use: 0 [0   ] / in no VG: 3 [195.60 GB]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{note|1=There is nothing showing in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;VG Name&amp;lt;/span&amp;gt; yet, as we&#039;ve not created any [[VG]]s. Re-run &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;pvdisplay&amp;lt;/span&amp;gt; after the VGs are created and you will see them show up. Be aware that a [[PV]] can only belong to one [[VG]] at a time.}}&lt;br /&gt;
&lt;br /&gt;
=== Creating Volume Groups ===&lt;br /&gt;
&lt;br /&gt;
LVM allows for a given VG to have multiple PVs assigned to it. In our case though, each PV has a specific purpose so we will be creating three independent VGs.&lt;br /&gt;
&lt;br /&gt;
Creating VGs is somewhat less trivial compared to creating the PVs. There are a few extra bits that need to be specified when the volume groups are created. The extra bits are:&lt;br /&gt;
* We will explicitly tell LVM that these are clustered VGs via &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;-c y&amp;lt;/span&amp;gt; (&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--clustered yes&amp;lt;/span&amp;gt;).&lt;br /&gt;
* We will create a tag that we will use to identify all clustered VGs. The tag I use is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-cluster01&amp;lt;/span&amp;gt;, thought you are free to use something else. This is applied via &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--addtag @an-cluster01&amp;lt;/span&amp;gt;&lt;br /&gt;
* Each VG needs a unique name which will become part of the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/vg_name/lv_name&amp;lt;/span&amp;gt; path. The name you choose should make sense to you. The names used in this tutorial are shown in the table below.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!VG name&lt;br /&gt;
!PV used&lt;br /&gt;
!Note&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;drbd_sh0_vg0&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/drbd0&amp;lt;/span&amp;gt;&lt;br /&gt;
|This will be used for the shared VG hosting the lone logical volume which we will create the [[GFS2]] partition on.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;drbd_an4_vg0&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/drbd1&amp;lt;/span&amp;gt;&lt;br /&gt;
|This VG will host the LVs backing the virtual machines designed to normally operate on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt;.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;drbd_an5_vg0&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/drbd2&amp;lt;/span&amp;gt;&lt;br /&gt;
|This VG will host the LVs backing the virtual machines designed to normally operate on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
So then, the commands to create these VGs will be as follows.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On One Node&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vgcreate -c y --addtag @an-cluster01 drbd_sh0_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;drbd_sh0_vg0&amp;quot; successfully created&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;
vgcreate -c y --addtag @an-cluster01 drbd_an4_vg0 /dev/drbd1&lt;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;drbd_an4_vg0&amp;quot; successfully created&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;
vgcreate -c y --addtag @an-cluster01 drbd_an5_vg0 /dev/drbd2&lt;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;drbd_an5_vg0&amp;quot; successfully created&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On The Other Node&#039;&#039;&#039;: You can verify that the VGs are visible on the second node with &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 -v&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
    Finding all volume groups&lt;br /&gt;
    Finding volume group &amp;quot;drbd_an5_vg0&amp;quot;&lt;br /&gt;
  --- Volume group ---&lt;br /&gt;
  VG Name               drbd_an5_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               93.14 GB&lt;br /&gt;
  PE Size               4.00 MB&lt;br /&gt;
  Total PE              23843&lt;br /&gt;
  Alloc PE / Size       0 / 0   &lt;br /&gt;
  Free  PE / Size       23843 / 93.14 GB&lt;br /&gt;
  VG UUID               kqhxfN-6VaV-TXlL-SYPP-4k2F-li70-rOg2wK&lt;br /&gt;
   &lt;br /&gt;
  --- Physical volumes ---&lt;br /&gt;
  PV Name               /dev/drbd2     &lt;br /&gt;
  PV UUID               6d4e5P-pjHE-4axT-ZRyG-lJa7-8oLa-TjkZFy&lt;br /&gt;
  PV Status             allocatable&lt;br /&gt;
  Total PE / Free PE    23843 / 23843&lt;br /&gt;
   &lt;br /&gt;
    Finding volume group &amp;quot;drbd_an4_vg0&amp;quot;&lt;br /&gt;
  --- Volume group ---&lt;br /&gt;
  VG Name               drbd_an4_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               93.14 GB&lt;br /&gt;
  PE Size               4.00 MB&lt;br /&gt;
  Total PE              23843&lt;br /&gt;
  Alloc PE / Size       0 / 0   &lt;br /&gt;
  Free  PE / Size       23843 / 93.14 GB&lt;br /&gt;
  VG UUID               9WBngc-SvVq-VVBd-csag-I0JP-DqLj-xV3fUf&lt;br /&gt;
   &lt;br /&gt;
  --- Physical volumes ---&lt;br /&gt;
  PV Name               /dev/drbd1     &lt;br /&gt;
  PV UUID               zrwlxT-VFA4-5NiK-fwbK-z2Ez-mYxu-Ei8yZs&lt;br /&gt;
  PV Status             allocatable&lt;br /&gt;
  Total PE / Free PE    23843 / 23843&lt;br /&gt;
   &lt;br /&gt;
    Finding volume group &amp;quot;drbd_sh0_vg0&amp;quot;&lt;br /&gt;
  --- Volume group ---&lt;br /&gt;
  VG Name               drbd_sh0_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               9.32 GB&lt;br /&gt;
  PE Size               4.00 MB&lt;br /&gt;
  Total PE              2386&lt;br /&gt;
  Alloc PE / Size       0 / 0   &lt;br /&gt;
  Free  PE / Size       2386 / 9.32 GB&lt;br /&gt;
  VG UUID               h6xZz8-G3J2-fkBF-1ZOD-DgkR-X0f4-9qaYI3&lt;br /&gt;
   &lt;br /&gt;
  --- Physical volumes ---&lt;br /&gt;
  PV Name               /dev/drbd0     &lt;br /&gt;
  PV UUID               WxTCW4-lUzL-bR53-km45-13eV-3f8B-ZA5Tb9&lt;br /&gt;
  PV Status             allocatable&lt;br /&gt;
  Total PE / Free PE    2386 / 2386&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;tag&amp;lt;/span&amp;gt; we assigned isn&#039;t displayed, this is ok. You can see the tags using a special incantation of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vgs&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;
vgs -o vg_name,vg_tags&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
  VG           VG Tags     &lt;br /&gt;
  drbd_an4_vg0 an-cluster01&lt;br /&gt;
  drbd_an5_vg0 an-cluster01&lt;br /&gt;
  drbd_sh0_vg0 an-cluster01&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It may not be pretty, but at least you can confirm that the tags exist as expected. Where tags are used will be discussed later in the trouble-shooting section.&lt;br /&gt;
&lt;br /&gt;
Before proceeding, be sure to have LVM rescan for the new [[VG]]s so that it&#039;s cache is up to date.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On both nodes&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vgscan&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
  Reading all physical volumes.  This may take a while...&lt;br /&gt;
  Found volume group &amp;quot;drbd_an5_vg0&amp;quot; using metadata type lvm2&lt;br /&gt;
  Found volume group &amp;quot;drbd_an4_vg0&amp;quot; using metadata type lvm2&lt;br /&gt;
  Found volume group &amp;quot;drbd_sh0_vg0&amp;quot; using metadata type lvm2&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Creating a Logical Volume ===&lt;br /&gt;
&lt;br /&gt;
At this point, we&#039;re only going to create a logical volume on the shared VG. This one LV will use all of the space available in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;drbd_sh0_vg0&amp;lt;/span&amp;gt; volume group. As with the VGs, we&#039;ll be assigning the same tag to our LV. We will also need to assign a name to the LV which will form the last part of the device path, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/vg_name/lv_name&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
When creating LVs, you can specify the size of the new LV in a few ways. The two way I prefer are &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;-L xxG&amp;lt;/span&amp;gt;, where &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xx&amp;lt;/span&amp;gt; is the number of [[GiB]] to make the LV. Alternatively, I like to use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;-l 100%FREE&amp;lt;/span&amp;gt; when I am creating the last partition on the VG (or the only one, as in this case). Which you use is entirely up to you.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On One Node&#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 100%FREE --addtag @an-cluster01 -n xen_shared drbd_sh0_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;On The Other Node&#039;&#039;&#039;:&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/drbd_sh0_vg0/xen_shared&lt;br /&gt;
  VG Name                drbd_sh0_vg0&lt;br /&gt;
  LV UUID                6bngyf-RSGG-17pA-g2fn-wwM3-6xsc-8yBAI5&lt;br /&gt;
  LV Write Access        read/write&lt;br /&gt;
  LV Status              available&lt;br /&gt;
  # open                 0&lt;br /&gt;
  LV Size                9.32 GB&lt;br /&gt;
  Current LE             2386&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;
As always, before proceeding, be sure to have LVM rescan for the new [[LV]]s so that it&#039;s cache is up to date.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
lvscan&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
  ACTIVE            &#039;/dev/drbd_sh0_vg0/xen_shared&#039; [9.32 GB] inherit&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As with VGs, we can confirm that the tag was set using a similar call to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;lvs&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;
lvs -o vg_name,lv_name,lv_tags&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
  VG           LV         LV Tags     &lt;br /&gt;
  drbd_sh0_vg0 xen_shared an-cluster01&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
That&#039;s it. Our clustered LVM is setup!&lt;br /&gt;
&lt;br /&gt;
== Setting Up The Shared GFS2 Partition ==&lt;br /&gt;
&lt;br /&gt;
Setting up a [[GFS2]] partition requires three steps;&lt;br /&gt;
* Formatting the block device, a logical volume in our case, using the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;mkfs.gfs2&amp;lt;/span&amp;gt; tool.&lt;br /&gt;
* Create a mount point on each node.&lt;br /&gt;
* Add an entry 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;
As mentioned earlier, we&#039;ll create a small 10 [[GB]] [[GFS2]] partition that will hold common files for the cluster. The most notable being the virtual machine definition files. These need to be centralized so that one node can restore a VM lost on another node during a failure state. It&#039;s also a decent place for things like ISOs if you&#039;re not using a [[PXE]] server of if you want to make generic VM images available. Though if you plan to do that, you will probably want a larger GFS2 partition than we are using here.&lt;br /&gt;
&lt;br /&gt;
The information you need to have on hand when formatting a [[GFS2]] partition is:&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Variable&lt;br /&gt;
!Value&lt;br /&gt;
!Note&lt;br /&gt;
|-&lt;br /&gt;
!Locking protocol&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;lock_dlm&amp;lt;/span&amp;gt;&lt;br /&gt;
|This is always &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;lock_dlm&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Journals&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;2&amp;lt;/span&amp;gt;&lt;br /&gt;
|This matches the number of nodes in the cluster.&lt;br /&gt;
|-&lt;br /&gt;
!Cluster Name&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-cluster01&amp;lt;/span&amp;gt;&lt;br /&gt;
|As set in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/cluster/cluster.conf&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Partition Name&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xen_shared&amp;lt;/span&amp;gt;&lt;br /&gt;
|Arbitrary name&lt;br /&gt;
|-&lt;br /&gt;
!Backing Device&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/drbd_sh0_vg0/xen_shared&amp;lt;/span&amp;gt;&lt;br /&gt;
|The LV we created earlier&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Putting it all together, the command becomes:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On One Node&#039;&#039;&#039;:&lt;br /&gt;
&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-cluster01:xen_shared /dev/drbd_sh0_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/drbd_sh0_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;
Are you sure you want to proceed? [y/n] y&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{note|1=It can take a bit of time for this to complete, please be patient.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Device:                    /dev/drbd_sh0_vg0/xen_shared&lt;br /&gt;
Blocksize:                 4096&lt;br /&gt;
Device Size                9.32 GB (2443264 blocks)&lt;br /&gt;
Filesystem Size:           9.32 GB (2443261 blocks)&lt;br /&gt;
Journals:                  2&lt;br /&gt;
Resource Groups:           38&lt;br /&gt;
Locking Protocol:          &amp;quot;lock_dlm&amp;quot;&lt;br /&gt;
Lock Table:                &amp;quot;an-cluster01:xen_shared&amp;quot;&lt;br /&gt;
UUID:                      764772BC-B292-1BBF-F987-AD3A2540849B&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now confirm that the partition is visible from the other node.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On The Other Node&#039;&#039;&#039;: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
gfs2_edit -p sb /dev/drbd_sh0_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;
Block #16    (0x10) of 2443264 (0x254800) (superblock)&lt;br /&gt;
&lt;br /&gt;
Superblock:&lt;br /&gt;
  mh_magic              0x01161970(hex)&lt;br /&gt;
  mh_type               1                   0x1&lt;br /&gt;
  mh_format             100                 0x64&lt;br /&gt;
  sb_fs_format          1801                0x709&lt;br /&gt;
  sb_multihost_format   1900                0x76c&lt;br /&gt;
  sb_bsize              4096                0x1000&lt;br /&gt;
  sb_bsize_shift        12                  0xc&lt;br /&gt;
  master dir:           2                   0x2&lt;br /&gt;
        addr:           22                  0x16&lt;br /&gt;
  root dir  :           1                   0x1&lt;br /&gt;
        addr:           21                  0x15&lt;br /&gt;
  sb_lockproto          lock_dlm&lt;br /&gt;
  sb_locktable          an-cluster01:xen_shared&lt;br /&gt;
  sb_uuid               764772BC-B292-1BBF-F987-AD3A2540849B&lt;br /&gt;
&lt;br /&gt;
The superblock has 2 directories&lt;br /&gt;
     1. (1). 21 (0x15): Dir     root&lt;br /&gt;
     2. (2). 22 (0x16): Dir     master&lt;br /&gt;
------------------------------------------------------&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With that, the GFS2 partition is ready for use.&lt;br /&gt;
&lt;br /&gt;
Now we need to create the mount point. The mount point you use is up to you. This tutorial will create a mount point called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/xen_shared&amp;lt;/span&amp;gt;. Once that&#039;s created, we&#039;ll actually mount the GFS2 partition. Finally, we&#039;ll use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;df&amp;lt;/span&amp;gt; to verify that it mounted successfully.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On Both Nodes&#039;&#039;&#039;:&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/drbd_sh0_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;
/dev/sda2              20G  2.9G   16G  16% /&lt;br /&gt;
/dev/sda1             244M   33M  198M  15% /boot&lt;br /&gt;
tmpfs                 1.8G     0  1.8G   0% /dev/shm&lt;br /&gt;
none                  1.8G  104K  1.8G   1% /var/lib/xenstored&lt;br /&gt;
/dev/mapper/drbd_sh0_vg0-xen_shared&lt;br /&gt;
                      9.4G  259M  9.1G   3% /xen_shared&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The last step is to add an entry to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/fstab&amp;lt;/span&amp;gt; for this GFS2 partition. This is required because the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/init.d/gfs2&amp;lt;/span&amp;gt; initialization script consults &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/fstab&amp;lt;/span&amp;gt; to see what partitions it is to manage.&lt;br /&gt;
&lt;br /&gt;
If you are familiar with GFS2 on [[EL6]], then you might be familiar with using the GFS2&#039;s [[UUID]] in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/fstab&amp;lt;/span&amp;gt;. That is not supported here on [[EL5]].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On both nodes&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/fstab /etc/fstab.orig&lt;br /&gt;
echo &amp;quot;/dev/drbd_sh0_vg0/xen_shared /xen_shared gfs2 rw,suid,dev,exec,nouser,async 0 0&amp;quot; &amp;gt;&amp;gt; /etc/fstab&lt;br /&gt;
diff -u /etc/fstab.orig /etc/fstab&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;diff&amp;quot;&amp;gt;&lt;br /&gt;
--- /etc/fstab.orig     2011-05-06 18:56:50.000000000 -0400&lt;br /&gt;
+++ /etc/fstab  2011-05-06 18:56:50.000000000 -0400&lt;br /&gt;
@@ -5,3 +5,4 @@&lt;br /&gt;
 sysfs                   /sys                    sysfs   defaults        0 0&lt;br /&gt;
 proc                    /proc                   proc    defaults        0 0&lt;br /&gt;
 LABEL=SWAP-sda3         swap                    swap    defaults        0 0&lt;br /&gt;
+/dev/drbd_sh0_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;
{{note|1=The reason that we use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rw,suid,dev,exec,nouser,async&amp;lt;/span&amp;gt; instead of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;defaults&amp;lt;/span&amp;gt;. The key option we don&#039;t want to use is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;auto&amp;lt;/span&amp;gt;, which is implied with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;defaults&amp;lt;/span&amp;gt;. The reason for avoiding this is to prevent the system from trying to mount the GFS2 partition during boot. With the cluster not running that early in the boot process, the GFS2 partition will effectively not exist at that point, so any attempt to mount it will fail.}}&lt;br /&gt;
&lt;br /&gt;
Now, to verify that everything is working, call &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;status&amp;lt;/span&amp;gt; against the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;gfs2&amp;lt;/span&amp;gt; initialization script.&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 try &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;stop&amp;lt;/span&amp;gt;&#039;ing &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;gfs2&amp;lt;/span&amp;gt;, checking the mounts with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;df&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;status&amp;lt;/span&amp;gt;, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;start&amp;lt;/span&amp;gt;&#039;ing &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;gfs2&amp;lt;/span&amp;gt; back up and doing a final &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;df&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;status&amp;lt;/span&amp;gt;. If all works well, the GFS2 volume should unmount and remount.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On Both Nodes&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
Stop:&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 filesystems:                               [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check that it has been unmounted:&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;
&amp;lt;/source&amp;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/sda2              20G  2.9G   16G  16% /&lt;br /&gt;
/dev/sda1             244M   33M  198M  15% /boot&lt;br /&gt;
tmpfs                 1.8G     0  1.8G   0% /dev/shm&lt;br /&gt;
none                  1.8G  104K  1.8G   1% /var/lib/xenstored&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now start the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;gfs2&amp;lt;/span&amp;gt; service 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 filesystems:                                 [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check that it has been re-mounted:&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;
&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/sda2              20G  2.9G   16G  16% /&lt;br /&gt;
/dev/sda1             244M   33M  198M  15% /boot&lt;br /&gt;
tmpfs                 1.8G     0  1.8G   0% /dev/shm&lt;br /&gt;
none                  1.8G  104K  1.8G   1% /var/lib/xenstored&lt;br /&gt;
/dev/mapper/drbd_sh0_vg0-xen_shared&lt;br /&gt;
                      9.4G  259M  9.1G   3% /xen_shared&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Perfect!&lt;br /&gt;
&lt;br /&gt;
= Managing Storage In The Cluster =&lt;br /&gt;
&lt;br /&gt;
The storage for the cluster is ready, but it hasn&#039;t actually been tied &#039;&#039;into&#039;&#039; the cluster. To do that, we will use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt;, within which we will add the &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; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;gfs2&amp;lt;/span&amp;gt; initialization scripts as cluster resources. We will create two failover domains, each one containing only one node. lastly, we will take those three resources and create a service tree.&lt;br /&gt;
&lt;br /&gt;
== Covering Some New Terms ==&lt;br /&gt;
&lt;br /&gt;
Now, let&#039;s back up and talk a bit about those three new terms.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Resources&#039;&#039;&#039; are items that can be used in one or more services.&lt;br /&gt;
* &#039;&#039;&#039;Services&#039;&#039;&#039; consist of one or more resources, either in series, parallel or a combination of both, that are managed by the cluster.&lt;br /&gt;
* &#039;&#039;&#039;Failover Domains&#039;&#039;&#039; are logical groups of one or more nodes. Services can run strictly within a failover group, or they can be allowed to run outside of the failover domain when no member domains are available.&lt;br /&gt;
&lt;br /&gt;
== An Overview Of How We Will Manage Storage In The Cluster ==&lt;br /&gt;
&lt;br /&gt;
So what we are going to do here is:&lt;br /&gt;
* Create three &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;script&amp;lt;/span&amp;gt; resources&lt;br /&gt;
* Create two failover domains. One containing just &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04.alteeve.com&amp;lt;/span&amp;gt; and the other containing just &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05.alteeve.com&amp;lt;/span&amp;gt;. We will restrict services within these domains to only run within this domain, effectively locking the service to the node.&lt;br /&gt;
* Within each failover domain, we will create a service with a serial resource tree. This tree will start &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;drbd&amp;lt;/span&amp;gt;, then &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clvmd&amp;lt;/span&amp;gt; and finally &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;gfs2&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The reason for this is so that when &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; starts, it will start each failover domain&#039;s service which, in turn, will start the clustered storage daemons in the proper order.&lt;br /&gt;
&lt;br /&gt;
== Why Not Start The Daemons At Boot Time? ==&lt;br /&gt;
&lt;br /&gt;
This might seem like over kill, and arguably it is. The reason I still find it worth while is that if a storage daemon like [[DRBD]] hangs on boot, you can find yourself with a node that you can not access. Many folk have their nodes in data centers so gaining direct access can be a pain, to be polite. So by moving these daemons over to the cluster, and knowing that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; itself will start late in the boot process, we are much more likely to still have remote access when things go bad.&lt;br /&gt;
&lt;br /&gt;
I used DRBD as an example on purpose. I prefer to have DRBD resources wait forever to connect to the other node when starting up. This way, if one node starts somewhat later than the other, the first node&#039;s DRBD resource won&#039;t risk split-braining. it will happily wait until it&#039;s partner node comes up and starts it&#039;s own DRBD daemon. The downside to this is that DRBD will effectively hang the boot process forever if the other node can&#039;t be started. By managing DRBD in the cluster, we leave open the option of logging in and telling DRBD to stop waiting when we know the other node will not be booting.&lt;br /&gt;
&lt;br /&gt;
== Adding rgmanager To cluster.conf ==&lt;br /&gt;
&lt;br /&gt;
Everything related to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; is an element of the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;[[RHCS_v2_cluster.conf#rm.3B_The_Resource_Manager|rm]] /&amp;gt;&amp;lt;/span&amp;gt; tag. Within that, the actual resources are themselves elements of the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;resources /&amp;gt;&amp;lt;/span&amp;gt; tag. We&#039;ll start by creating these tags, then we&#039;ll look at the actual resources.&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-cluster01&amp;quot; config_version=&amp;quot;10&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;cman expected_votes=&amp;quot;1&amp;quot; two_node=&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-node04.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;fence_na01&amp;quot; port=&amp;quot;04&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-node05.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;fence_na01&amp;quot; port=&amp;quot;03&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_na01&amp;quot; agent=&amp;quot;fence_na&amp;quot; ipaddr=&amp;quot;fence_na01.alteeve.com&amp;quot; login=&amp;quot;admin&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;fence_daemon post_join_delay=&amp;quot;60&amp;quot;/&amp;gt;&lt;br /&gt;
        &amp;lt;totem rrp_mode=&amp;quot;none&amp;quot; secauth=&amp;quot;off&amp;quot;/&amp;gt;&lt;br /&gt;
        &amp;lt;rm&amp;gt;&lt;br /&gt;
                &amp;lt;resources/&amp;gt;&lt;br /&gt;
                &amp;lt;failoverdomains /&amp;gt;&lt;br /&gt;
        &amp;lt;/rm&amp;gt;&lt;br /&gt;
&amp;lt;/cluster&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There are several attributes available for the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rm&amp;lt;/span&amp;gt;, though we don&#039;t need to worry about them now as the defaults are sane. It&#039;s primary purpose is to act as a container for &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;failoverdomains /&amp;gt;&amp;lt;/span&amp;gt;, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;resources /&amp;gt;&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;service /&amp;gt;&amp;lt;/span&amp;gt; tags. We&#039;ll be working with all three of these now. We&#039;re not putting an empty &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;service /&amp;gt;&amp;lt;/span&amp;gt; tag in because they must contain and attribute, which we are not ready to do yet.&lt;br /&gt;
&lt;br /&gt;
=== Adding Resources to cluster.conf ===&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;resources&amp;lt;/span&amp;gt; tag has no attributes of it&#039;s own. It solely acts as a container for various resource tags. There are many types of resources, but we will only be using the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;script /&amp;gt;&amp;lt;/span&amp;gt; tag in this cluster.&lt;br /&gt;
&lt;br /&gt;
Let&#039;s look at the three scripts we&#039;re going to add; &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-cluster01&amp;quot; config_version=&amp;quot;11&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;cman expected_votes=&amp;quot;1&amp;quot; two_node=&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-node04.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;fence_na01&amp;quot; port=&amp;quot;04&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-node05.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;fence_na01&amp;quot; port=&amp;quot;03&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_na01&amp;quot; agent=&amp;quot;fence_na&amp;quot; ipaddr=&amp;quot;fence_na01.alteeve.com&amp;quot; login=&amp;quot;admin&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;fence_daemon post_join_delay=&amp;quot;60&amp;quot;/&amp;gt;&lt;br /&gt;
        &amp;lt;totem rrp_mode=&amp;quot;none&amp;quot; secauth=&amp;quot;off&amp;quot;/&amp;gt;&lt;br /&gt;
        &amp;lt;rm&amp;gt;&lt;br /&gt;
                &amp;lt;resources&amp;gt;&lt;br /&gt;
                        &amp;lt;script file=&amp;quot;/etc/init.d/drbd&amp;quot; name=&amp;quot;drbd&amp;quot;/&amp;gt;&lt;br /&gt;
                        &amp;lt;script file=&amp;quot;/etc/init.d/clvmd&amp;quot; name=&amp;quot;clvmd&amp;quot;/&amp;gt;&lt;br /&gt;
                        &amp;lt;script file=&amp;quot;/etc/init.d/gfs2&amp;quot; name=&amp;quot;gfs2&amp;quot;/&amp;gt;&lt;br /&gt;
                &amp;lt;/resources&amp;gt;&lt;br /&gt;
                &amp;lt;failoverdomains /&amp;gt;&lt;br /&gt;
        &amp;lt;/rm&amp;gt;&lt;br /&gt;
&amp;lt;/cluster&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The main two attributes used by &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;script /&amp;gt;&amp;lt;/span&amp;gt; are &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;file&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;name&amp;lt;/span&amp;gt;. The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;file&amp;lt;/span&amp;gt; attribute is the path to the script and the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;name&amp;lt;/span&amp;gt; will be used to reference this script when we create our &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;service /&amp;gt;&amp;lt;/span&amp;gt; resource tree later.&lt;br /&gt;
&lt;br /&gt;
{{note|1=Scripts must work like initialization scripts. That is, they need to support being called with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;start&amp;lt;/span&amp;gt;, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;stop&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;status&amp;lt;/span&amp;gt; arguments.}}&lt;br /&gt;
&lt;br /&gt;
=== Adding Failover Domains to cluster.conf ===&lt;br /&gt;
&lt;br /&gt;
Failover domains are, at their most basic, a collection of one or more nodes in the cluster. Services can then be configured to operate within the context of a given failover domain. There are a few key options to be aware of.&lt;br /&gt;
&lt;br /&gt;
* A failover domain can be unordered or prioritized.&lt;br /&gt;
** When unordered, a service will relocate to another random node in the domain.&lt;br /&gt;
** When prioritized, a service will relocate to the highest-priority node in the domain.&lt;br /&gt;
* A failover domain can be restricted or unrestricted.&lt;br /&gt;
** When restricted, a service is &#039;&#039;&#039;only&#039;&#039;&#039; allowed to relocate to nodes in the domain. When no nodes are available, a service is stopped.&lt;br /&gt;
** When unrestricted, a service will try to relocate to a node in the domain. However, when no domain members are available, a service attempts to start on another node in the cluster.&lt;br /&gt;
* A failover domain can have a failback policy.&lt;br /&gt;
** When a domain allows for failback and the domain is ordered, a service will migrate to the highest priority node in the domain. This allows for automated restoration of services on a failed node when it rejoins the cluster.&lt;br /&gt;
** When a domain does not allow for failback, but is unrestricted, failback of services that fell out of the domain will happen anyway. However, once the service is within the domain, the service will &#039;&#039;&#039;not&#039;&#039;&#039; relocate to a higher-priority node should one become available later.&lt;br /&gt;
** When a domain does not allow for failback and is restricted, then failback of services will never occur.&lt;br /&gt;
&lt;br /&gt;
What we are going to do now is create two restricted failover domains with no relocation. Each of these will contain just one of the nodes. This will effectively lock their services to the node. This way, services assigned to each domain will be started and maintained by the cluster, but they will &#039;&#039;&#039;not&#039;&#039;&#039; be highly available. The services we will create will have local initialization scripts, so this is perfectly fine. &lt;br /&gt;
&lt;br /&gt;
This is how we will get the cluster to start and maintain out clustered storage daemons.&lt;br /&gt;
&lt;br /&gt;
The format for defining failover domains is to create a &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;failoverdomains&amp;gt;&amp;lt;/span&amp;gt; tag, which has no attributes, and acts as a container for one or more &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;failoverdomain&amp;gt;&amp;lt;/span&amp;gt; tags. Each &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;failoverdomain&amp;gt;&amp;lt;/span&amp;gt; tag has four attributes and acts as a container for one or more &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;failoverdomainnode /&amp;gt;&amp;lt;/span&amp;gt; tags.&lt;br /&gt;
&lt;br /&gt;
The only required attribute in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;failoverdomain /&amp;gt;&amp;lt;/span&amp;gt; is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;name=&amp;quot;&amp;quot;&amp;lt;/span&amp;gt;. This is the name that will be used later when we want to bind a service to a given failover domain. By default, a failover domain is unordered, thus making failback meaningless, and it is unrestricted. When ordered, the default is to allow for failback.&lt;br /&gt;
&lt;br /&gt;
The individual &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;failoverdomainnode /&amp;gt;&amp;lt;/span&amp;gt; have two attributes; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;name&amp;lt;/span&amp;gt;, which must match the given node&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;clusternode name=&amp;quot;...&amp;quot;&amp;lt;/span&amp;gt;, and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;priority=&amp;quot;x&amp;quot;&amp;lt;/span&amp;gt;, where &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;x&amp;lt;/span&amp;gt; is an integer. when only one node is defined or when a failover domain in unordered, the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;priority&amp;lt;/span&amp;gt; is ignored. When two or more nodes are defined and the domain is ordered, then nodes with the lowest number has the highest priority for hosting services. That is, a node with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;priority=&amp;quot;1&amp;quot;&amp;lt;/span&amp;gt; will be preferred to a node with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;priority=&amp;quot;2&amp;quot;&amp;lt;/span&amp;gt;.&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-cluster01&amp;quot; config_version=&amp;quot;12&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;cman expected_votes=&amp;quot;1&amp;quot; two_node=&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-node04.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;fence_na01&amp;quot; port=&amp;quot;04&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-node05.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;fence_na01&amp;quot; port=&amp;quot;03&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_na01&amp;quot; agent=&amp;quot;fence_na&amp;quot; ipaddr=&amp;quot;fence_na01.alteeve.com&amp;quot; login=&amp;quot;admin&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;fence_daemon post_join_delay=&amp;quot;60&amp;quot;/&amp;gt;&lt;br /&gt;
        &amp;lt;totem rrp_mode=&amp;quot;none&amp;quot; secauth=&amp;quot;off&amp;quot;/&amp;gt;&lt;br /&gt;
        &amp;lt;rm&amp;gt;&lt;br /&gt;
                &amp;lt;resources&amp;gt;&lt;br /&gt;
                        &amp;lt;script file=&amp;quot;/etc/init.d/drbd&amp;quot; name=&amp;quot;drbd&amp;quot;/&amp;gt;&lt;br /&gt;
                        &amp;lt;script file=&amp;quot;/etc/init.d/clvmd&amp;quot; name=&amp;quot;clvmd&amp;quot;/&amp;gt;&lt;br /&gt;
                        &amp;lt;script file=&amp;quot;/etc/init.d/gfs2&amp;quot; name=&amp;quot;gfs2&amp;quot;/&amp;gt;&lt;br /&gt;
                &amp;lt;/resources&amp;gt;&lt;br /&gt;
		&amp;lt;failoverdomains&amp;gt;&lt;br /&gt;
			&amp;lt;failoverdomain name=&amp;quot;an4_only&amp;quot; nofailback=&amp;quot;0&amp;quot; ordered=&amp;quot;0&amp;quot; restricted=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
				&amp;lt;failoverdomainnode name=&amp;quot;an-node04.alteeve.com&amp;quot; priority=&amp;quot;1&amp;quot;/&amp;gt;&lt;br /&gt;
			&amp;lt;/failoverdomain&amp;gt;&lt;br /&gt;
			&amp;lt;failoverdomain name=&amp;quot;an5_only&amp;quot; nofailback=&amp;quot;0&amp;quot; ordered=&amp;quot;0&amp;quot; restricted=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
				&amp;lt;failoverdomainnode name=&amp;quot;an-node05.alteeve.com&amp;quot; priority=&amp;quot;1&amp;quot;/&amp;gt;&lt;br /&gt;
			&amp;lt;/failoverdomain&amp;gt;&lt;br /&gt;
		&amp;lt;/failoverdomains&amp;gt;&lt;br /&gt;
        &amp;lt;/rm&amp;gt;&lt;br /&gt;
&amp;lt;/cluster&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So here we&#039;ve now created two failover domains; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an4_only&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an5_only&amp;lt;/span&amp;gt;. Both of these are &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;restricted=&amp;quot;1&amp;quot;&amp;lt;/span&amp;gt;, so services within these domains will never try to start on other nodes. Both &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;nofailback=&amp;quot;0&amp;quot;&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ordered=&amp;quot;0&amp;quot;&amp;lt;/span&amp;gt; are defined, but they have no meaning because the two domains have only one node each.&lt;br /&gt;
&lt;br /&gt;
Within each domain, the corresponding &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;failoverdomainnode /&amp;gt;&amp;lt;/span&amp;gt; is defined. Notice that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;priority=&amp;quot;1&amp;quot;&amp;lt;/span&amp;gt; is set, despite having no use. This attribute must exist regardless. The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;name=&amp;quot;an-node0x.alteeve.com&amp;lt;/span&amp;gt; links the node to it&#039;s corresponding &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;clusternode name=&amp;quot;an-node0x.alteeve.com&amp;quot;&amp;lt;/span&amp;gt; entry in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;clusternodes /&amp;gt;&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Creating the Storage Services in cluster.conf ===&lt;br /&gt;
&lt;br /&gt;
The last piece of the resource management puzzle are the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;service /&amp;gt;&amp;lt;/span&amp;gt; tags. These tags are where the actually resources are tied together, assigned to a failover domain and put under the cluster&#039;s control. The resource elements can be defined as parallel tags, a resource can be an elements of another to form dependency branches or they can be a combination of both. In our case, we want to make sure that each storage daemon successfully starts before the next service starts so we will be creating a dependency tree of resources. Specifically, we want to ensure that the start order is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;drbd&amp;lt;/span&amp;gt; -&amp;gt; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clvmd&amp;lt;/span&amp;gt; -&amp;gt; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;gfs2&amp;lt;/span&amp;gt;. The shut-down will be the reverse order.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;service /&amp;gt;&amp;lt;/span&amp;gt; tag has just one required attribute, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;name=&amp;quot;&amp;quot;&amp;lt;/span&amp;gt;, which is used in tools like Conga for identifying the service. The name can be descriptive, but it must be unique. There are several optional attributes, though we will only be looking at five of them.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;domain=&amp;quot;&amp;quot;&amp;lt;/span&amp;gt; is used to assign the given &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;service /&amp;gt;&amp;lt;/span&amp;gt; to failover domain. The name set here must match a &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;failoverdomain name=&amp;quot;&amp;quot; /&amp;gt;&amp;lt;/span&amp;gt;. Note that you &#039;&#039;do not&#039;&#039; need to define a failover domain. &lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;autostart=&amp;quot;[0|1]&amp;quot;&amp;lt;/span&amp;gt; controls whether or not the service is automatically started when &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; starts. We&#039;ll be disabling this for now, but we will come back and enable it after our initial testing is done.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;exclusive=&amp;quot;[0|1]&amp;quot;&amp;lt;/span&amp;gt; controls whether this service must run exclusively on a given node. &#039;&#039;&#039;Warning&#039;&#039;&#039;: If this is enabled, then no other service will be allowed to run on the node hosting this service.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;recover=&amp;quot;[restart|relocate|disable]&amp;quot;&amp;lt;/span&amp;gt; controls what &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; will do when this service fails. The services we&#039;re going to create now are only designed to run on one node, so &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;restart&amp;lt;/span&amp;gt; is the only policy that makes sense.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;max_restarts=&amp;quot;x&amp;quot;&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 number of times that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; will try to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;restart&amp;lt;/span&amp;gt; a given service. After &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;x&amp;lt;/span&amp;gt; failures, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; will instead &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;relocate&amp;lt;/span&amp;gt; the service based on the failover domain policy, when set. In our case, the failover domains prevent the service from running outside the domain, and the domain has only one node, so this value is effectively meaningless to us.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;restart_expire_time=&amp;quot;x&amp;quot;&amp;lt;/span&amp;gt;, where &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;x&amp;lt;/span&amp;gt; is a number of seconds. When &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;max_restarts&amp;lt;/span&amp;gt; is greater than &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;0&amp;lt;/span&amp;gt;, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; keeps a count of how many times a service has failed. These service failures &amp;quot;expire&amp;quot; after the number of seconds defined here. This is used so that the service failure count can reduce back down to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;0&amp;lt;/span&amp;gt; once things have been shown to be stable for a reasonable amount of time. As we&#039;re using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;max_restarts=&amp;quot;0&amp;quot;&amp;lt;/span&amp;gt; and the failover domain prevents relocation of the service, this value is effectively meaningless to us.&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-cluster01&amp;quot; config_version=&amp;quot;13&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;cman expected_votes=&amp;quot;1&amp;quot; two_node=&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-node04.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;fence_na01&amp;quot; port=&amp;quot;04&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-node05.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;fence_na01&amp;quot; port=&amp;quot;03&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_na01&amp;quot; agent=&amp;quot;fence_na&amp;quot; ipaddr=&amp;quot;fence_na01.alteeve.com&amp;quot; login=&amp;quot;admin&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;fence_daemon post_join_delay=&amp;quot;60&amp;quot;/&amp;gt;&lt;br /&gt;
        &amp;lt;totem rrp_mode=&amp;quot;none&amp;quot; secauth=&amp;quot;off&amp;quot;/&amp;gt;&lt;br /&gt;
	&amp;lt;rm&amp;gt;&lt;br /&gt;
		&amp;lt;resources&amp;gt;&lt;br /&gt;
			&amp;lt;script file=&amp;quot;/etc/init.d/drbd&amp;quot; name=&amp;quot;drbd&amp;quot;/&amp;gt;&lt;br /&gt;
			&amp;lt;script file=&amp;quot;/etc/init.d/clvmd&amp;quot; name=&amp;quot;clvmd&amp;quot;/&amp;gt;&lt;br /&gt;
			&amp;lt;script file=&amp;quot;/etc/init.d/gfs2&amp;quot; name=&amp;quot;gfs2&amp;quot;/&amp;gt;&lt;br /&gt;
		&amp;lt;/resources&amp;gt;&lt;br /&gt;
		&amp;lt;failoverdomains&amp;gt;&lt;br /&gt;
			&amp;lt;failoverdomain name=&amp;quot;an4_only&amp;quot; nofailback=&amp;quot;0&amp;quot; ordered=&amp;quot;0&amp;quot; restricted=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
				&amp;lt;failoverdomainnode name=&amp;quot;an-node04.alteeve.com&amp;quot; priority=&amp;quot;1&amp;quot;/&amp;gt;&lt;br /&gt;
			&amp;lt;/failoverdomain&amp;gt;&lt;br /&gt;
			&amp;lt;failoverdomain name=&amp;quot;an5_only&amp;quot; nofailback=&amp;quot;0&amp;quot; ordered=&amp;quot;0&amp;quot; restricted=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
				&amp;lt;failoverdomainnode name=&amp;quot;an-node05.alteeve.com&amp;quot; priority=&amp;quot;1&amp;quot;/&amp;gt;&lt;br /&gt;
			&amp;lt;/failoverdomain&amp;gt;&lt;br /&gt;
		&amp;lt;/failoverdomains&amp;gt;&lt;br /&gt;
		&amp;lt;service autostart=&amp;quot;0&amp;quot; domain=&amp;quot;an4_only&amp;quot; exclusive=&amp;quot;0&amp;quot; max_restarts=&amp;quot;0&amp;quot; name=&amp;quot;an4_storage&amp;quot; recovery=&amp;quot;restart&amp;quot; restart_expire_time=&amp;quot;0&amp;quot;&amp;gt;&lt;br /&gt;
			&amp;lt;script ref=&amp;quot;drbd&amp;quot;&amp;gt;&lt;br /&gt;
				&amp;lt;script ref=&amp;quot;clvmd&amp;quot;&amp;gt;&lt;br /&gt;
					&amp;lt;script ref=&amp;quot;gfs2&amp;quot;/&amp;gt;&lt;br /&gt;
				&amp;lt;/script&amp;gt;&lt;br /&gt;
			&amp;lt;/script&amp;gt;&lt;br /&gt;
		&amp;lt;/service&amp;gt;&lt;br /&gt;
		&amp;lt;service autostart=&amp;quot;0&amp;quot; domain=&amp;quot;an5_only&amp;quot; exclusive=&amp;quot;0&amp;quot; max_restarts=&amp;quot;0&amp;quot; name=&amp;quot;an5_storage&amp;quot; recovery=&amp;quot;restart&amp;quot; restart_expire_time=&amp;quot;0&amp;quot;&amp;gt;&lt;br /&gt;
			&amp;lt;script ref=&amp;quot;drbd&amp;quot;&amp;gt;&lt;br /&gt;
				&amp;lt;script ref=&amp;quot;clvmd&amp;quot;&amp;gt;&lt;br /&gt;
					&amp;lt;script ref=&amp;quot;gfs2&amp;quot;/&amp;gt;&lt;br /&gt;
				&amp;lt;/script&amp;gt;&lt;br /&gt;
			&amp;lt;/script&amp;gt;&lt;br /&gt;
		&amp;lt;/service&amp;gt;&lt;br /&gt;
	&amp;lt;/rm&amp;gt;&lt;br /&gt;
&amp;lt;/cluster&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So what we&#039;ve done here is create our two &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;service /&amp;gt;&amp;lt;/span&amp;gt; groups; One for the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an4_only&amp;lt;/span&amp;gt; failover domain and another matching service for &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an5_only&amp;lt;/span&amp;gt;. Both have their recovery policy set to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;recovery=&amp;quot;restart&amp;quot;&amp;lt;/span&amp;gt; and neither are configured to start with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Each &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;service /&amp;gt;&amp;lt;/span&amp;gt; tag&#039;s element is a collection of three &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;script /&amp;gt;&amp;lt;/span&amp;gt; resource references. The scripts are referenced using the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;script ref=&amp;quot;x&amp;quot; /&amp;gt;&amp;lt;/span&amp;gt; attribute, where &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;x&amp;lt;/span&amp;gt; must match a &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;resource name=&amp;quot;x&amp;quot; /&amp;gt;&amp;lt;/span&amp;gt; element in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;resources&amp;gt;&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
These references are embedded to form a dependency tree. The tree is formatted to start &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;drbd&amp;lt;/span&amp;gt; first, then when that starts successfully, it will start &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clvmd&amp;lt;/span&amp;gt; and then, finally, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;gfs2&amp;lt;/span&amp;gt;. When this service is disabled, this dependency tree is stopped in the reverse order. &lt;br /&gt;
&lt;br /&gt;
=== Validating the Additions to cluster.conf ===&lt;br /&gt;
&lt;br /&gt;
Seeing as we&#039;ve made some fairly significant changes to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/cluster/cluster.conf&amp;lt;/span&amp;gt;, we&#039;ll want to re-validate it before pushing it out to the other node.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
xmllint --relaxng /usr/share/system-config-cluster/misc/cluster.ng /etc/cluster/cluster.conf&lt;br /&gt;
&amp;lt;/source&amp;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-cluster01&amp;quot; config_version=&amp;quot;13&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;cman expected_votes=&amp;quot;1&amp;quot; two_node=&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-node04.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;fence_na01&amp;quot; port=&amp;quot;04&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-node05.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;fence_na01&amp;quot; port=&amp;quot;03&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_na01&amp;quot; agent=&amp;quot;fence_na&amp;quot; ipaddr=&amp;quot;fence_na01.alteeve.com&amp;quot; login=&amp;quot;admin&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;fence_daemon post_join_delay=&amp;quot;60&amp;quot;/&amp;gt;&lt;br /&gt;
        &amp;lt;totem rrp_mode=&amp;quot;none&amp;quot; secauth=&amp;quot;off&amp;quot;/&amp;gt;&lt;br /&gt;
	&amp;lt;rm&amp;gt;&lt;br /&gt;
		&amp;lt;resources&amp;gt;&lt;br /&gt;
			&amp;lt;script file=&amp;quot;/etc/init.d/drbd&amp;quot; name=&amp;quot;drbd&amp;quot;/&amp;gt;&lt;br /&gt;
			&amp;lt;script file=&amp;quot;/etc/init.d/clvmd&amp;quot; name=&amp;quot;clvmd&amp;quot;/&amp;gt;&lt;br /&gt;
			&amp;lt;script file=&amp;quot;/etc/init.d/gfs2&amp;quot; name=&amp;quot;gfs2&amp;quot;/&amp;gt;&lt;br /&gt;
		&amp;lt;/resources&amp;gt;&lt;br /&gt;
		&amp;lt;failoverdomains&amp;gt;&lt;br /&gt;
			&amp;lt;failoverdomain name=&amp;quot;an4_only&amp;quot; nofailback=&amp;quot;0&amp;quot; ordered=&amp;quot;0&amp;quot; restricted=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
				&amp;lt;failoverdomainnode name=&amp;quot;an-node04.alteeve.com&amp;quot; priority=&amp;quot;1&amp;quot;/&amp;gt;&lt;br /&gt;
			&amp;lt;/failoverdomain&amp;gt;&lt;br /&gt;
			&amp;lt;failoverdomain name=&amp;quot;an5_only&amp;quot; nofailback=&amp;quot;0&amp;quot; ordered=&amp;quot;0&amp;quot; restricted=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
				&amp;lt;failoverdomainnode name=&amp;quot;an-node05.alteeve.com&amp;quot; priority=&amp;quot;1&amp;quot;/&amp;gt;&lt;br /&gt;
			&amp;lt;/failoverdomain&amp;gt;&lt;br /&gt;
		&amp;lt;/failoverdomains&amp;gt;&lt;br /&gt;
		&amp;lt;service autostart=&amp;quot;0&amp;quot; domain=&amp;quot;an4_only&amp;quot; exclusive=&amp;quot;0&amp;quot; max_restarts=&amp;quot;0&amp;quot; name=&amp;quot;an4_storage&amp;quot; recovery=&amp;quot;restart&amp;quot; restart_expire_time=&amp;quot;0&amp;quot;&amp;gt;&lt;br /&gt;
			&amp;lt;script ref=&amp;quot;drbd&amp;quot;&amp;gt;&lt;br /&gt;
				&amp;lt;script ref=&amp;quot;clvmd&amp;quot;&amp;gt;&lt;br /&gt;
					&amp;lt;script ref=&amp;quot;gfs2&amp;quot;/&amp;gt;&lt;br /&gt;
				&amp;lt;/script&amp;gt;&lt;br /&gt;
			&amp;lt;/script&amp;gt;&lt;br /&gt;
		&amp;lt;/service&amp;gt;&lt;br /&gt;
		&amp;lt;service autostart=&amp;quot;0&amp;quot; domain=&amp;quot;an5_only&amp;quot; exclusive=&amp;quot;0&amp;quot; max_restarts=&amp;quot;0&amp;quot; name=&amp;quot;an5_storage&amp;quot; recovery=&amp;quot;restart&amp;quot; restart_expire_time=&amp;quot;0&amp;quot;&amp;gt;&lt;br /&gt;
			&amp;lt;script ref=&amp;quot;drbd&amp;quot;&amp;gt;&lt;br /&gt;
				&amp;lt;script ref=&amp;quot;clvmd&amp;quot;&amp;gt;&lt;br /&gt;
					&amp;lt;script ref=&amp;quot;gfs2&amp;quot;/&amp;gt;&lt;br /&gt;
				&amp;lt;/script&amp;gt;&lt;br /&gt;
			&amp;lt;/script&amp;gt;&lt;br /&gt;
		&amp;lt;/service&amp;gt;&lt;br /&gt;
	&amp;lt;/rm&amp;gt;&lt;br /&gt;
&amp;lt;/cluster&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;
/etc/cluster/cluster.conf validates&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If there was a problem, you need to go back and fix it. &#039;&#039;&#039;DO NOT&#039;&#039;&#039; proceed until your configuration validates. Once it does, we&#039;re ready to move on!&lt;br /&gt;
&lt;br /&gt;
With it validated, we need to push it to the other node. The cluster should be running now, so instead of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rsync&amp;lt;/span&amp;gt;, we can use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ccs_tool&amp;lt;/span&amp;gt;, the &amp;quot;cluster configuration system (tool)&amp;quot;, to push the new &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cluster.conf&amp;lt;/span&amp;gt; to the other node and upgrade the cluster&#039;s version in one shot.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ccs_tool update /etc/cluster/cluster.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;
Config file updated from version 9 to 13&lt;br /&gt;
&lt;br /&gt;
Update complete.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you tool at &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/var/log/messages&amp;lt;/span&amp;gt; on the other node, you should see something like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
May  7 20:32:08 an-node05 ccsd[4134]: Update of cluster.conf complete (version 9 -&amp;gt; 13). &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Starting rgmanager ==&lt;br /&gt;
&lt;br /&gt;
Now that we have services, we will want to manually start &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt;. We&#039;re not yet going to set it to automatically start as we&#039;re not yet automatically starting &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt;, which it depends on. This will be done later when the testing is complete.&lt;br /&gt;
&lt;br /&gt;
So make sure that the cluster is up and running.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cman_tool 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;
Version: 6.2.0&lt;br /&gt;
Config Version: 13&lt;br /&gt;
Cluster Name: an-cluster01&lt;br /&gt;
Cluster Id: 60257&lt;br /&gt;
Cluster Member: Yes&lt;br /&gt;
Cluster Generation: 140&lt;br /&gt;
Membership state: Cluster-Member&lt;br /&gt;
Nodes: 2&lt;br /&gt;
Expected votes: 1&lt;br /&gt;
Total votes: 2&lt;br /&gt;
Quorum: 1  &lt;br /&gt;
Active subsystems: 8&lt;br /&gt;
Flags: 2node Dirty &lt;br /&gt;
Ports Bound: 0 11  &lt;br /&gt;
Node name: an-node04.alteeve.com&lt;br /&gt;
Node ID: 1&lt;br /&gt;
Multicast addresses: 239.192.235.77 &lt;br /&gt;
Node addresses: 192.168.3.74 &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You will want to stop all of the storage daemons &#039;&#039;&#039;before&#039;&#039;&#039; starting &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt;. This is because &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; will always stop any services before it tries to start them itself. This includes virtual machines, as we will see in a bit.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On both nodes&#039;&#039;&#039;:&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 filesystems:                               [  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;
/etc/init.d/clvmd 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;
Deactivating clustered VG(s):   0 logical volume(s) in volume group &amp;quot;drbd_an5_vg0&amp;quot; now active&lt;br /&gt;
  0 logical volume(s) in volume group &amp;quot;drbd_an4_vg0&amp;quot; now active&lt;br /&gt;
  0 logical volume(s) in volume group &amp;quot;drbd_sh0_vg0&amp;quot; now active&lt;br /&gt;
                                                           [  OK  ]&lt;br /&gt;
Signaling clvmd to exit                                    [  OK  ]&lt;br /&gt;
clvmd terminated                                           [  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;
/etc/init.d/drbd 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;
Stopping all DRBD resources: .&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;rgmanager&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/rgmanager 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 Cluster Service Manager:                          [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Monitoring Resources ===&lt;br /&gt;
&lt;br /&gt;
We will now use a tool called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clustat&amp;lt;/span&amp;gt; that lets us see what state the cluster&#039;s resources are in. You can run it as a once-off check of the services, or you can use the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;-i x&amp;lt;/span&amp;gt; switch, where &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;x&amp;lt;/span&amp;gt; is a number of seconds to wait between re-checking the cluster service states. If you use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;-i x&amp;lt;/span&amp;gt;, you will need to use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;ctrl&amp;gt;&amp;lt;/span&amp;gt;+&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;c&amp;gt;&amp;lt;/span&amp;gt; to quit and return to the shell.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
clustat&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Cluster Status for an-cluster01 @ Sat May  7 22:30:24 2011&lt;br /&gt;
Member Status: Quorate&lt;br /&gt;
&lt;br /&gt;
 Member Name                             ID   Status&lt;br /&gt;
 ------ ----                             ---- ------&lt;br /&gt;
 an-node04.alteeve.com                       1 Online, Local, rgmanager&lt;br /&gt;
 an-node05.alteeve.com                       2 Online, rgmanager&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State         &lt;br /&gt;
 ------- ----                   ----- ------                   -----         &lt;br /&gt;
 service:an4_storage            (none)                         disabled      &lt;br /&gt;
 service:an5_storage            (none)                         disabled      &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you remember earlier, we set the services to not &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;autostart&amp;lt;/span&amp;gt;, thus, they are disabled.&lt;br /&gt;
&lt;br /&gt;
=== Managing Cluster Resources ===&lt;br /&gt;
&lt;br /&gt;
Managing services in the cluster is done with a fairly simple tool called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clusvcadm&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The main commands we&#039;re going to look at shortly are:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clusvcadm -e &amp;lt;service&amp;gt; -m &amp;lt;node&amp;gt;&amp;lt;/span&amp;gt;: Enable the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;service&amp;gt;&amp;lt;/span&amp;gt; on the specified &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;node&amp;gt;&amp;lt;/span&amp;gt;. When a &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;node&amp;gt;&amp;lt;/span&amp;gt; is not specified, the local node where the command was run is assumed.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clusvcadm -d &amp;lt;service&amp;gt; -m &amp;lt;node&amp;gt;&amp;lt;/span&amp;gt;: Disable the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;service&amp;gt;&amp;lt;/span&amp;gt;.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clusvcadm -l &amp;lt;service&amp;gt;&amp;lt;/span&amp;gt;: Locks the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;service&amp;gt;&amp;lt;/span&amp;gt; prior to a cluster shutdown. The only action allowed when a &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;service&amp;gt;&amp;lt;/span&amp;gt; is frozen is disabling it. This allows you to stop the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;service&amp;gt;&amp;lt;/span&amp;gt; so that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; doesn&#039;t try to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;recover&amp;lt;/span&amp;gt; it (&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;restart&amp;lt;/span&amp;gt;, in our two services). Once [[quorum]] is dissolved and the cluster is shut down, the service is unlocked and returns to normal operation next time the node regains quorum.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clusvcadm -u &amp;lt;service&amp;gt;&amp;lt;/span&amp;gt;: Unlocks a &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;service&amp;gt;&amp;lt;/span&amp;gt;, should you change your mind and decide not to stop the cluster.&lt;br /&gt;
&lt;br /&gt;
There are other ways to use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clusvcadm&amp;lt;/span&amp;gt; which we will look at after the virtual servers are provisioned and under cluster control.&lt;br /&gt;
&lt;br /&gt;
=== A Note On Resource Management With DRBD ===&lt;br /&gt;
&lt;br /&gt;
We have something of a unique setup here, using DRBD, that requires a brief discussion.&lt;br /&gt;
&lt;br /&gt;
When the cluster starts for the first time, where neither node&#039;s DRBD storage was up, the first node to start will wait indefinitely for the second node to start. For this reason, we want to ensure that we enable the storage resources more or less at the same time and from two different terminals. The reason for two terminals is that the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clusvcadm -e ...&amp;lt;/span&amp;gt; command won&#039;t return until all resources have started, so you need the second terminal window to start the other node&#039;s clustered storage service while the first one waits.&lt;br /&gt;
&lt;br /&gt;
Keep an eye on [[syslog]], too. If anything goes wrong in DRBD and a split-brain is declared you will see messages like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Mar 29 20:24:37 an-node04 kernel: block drbd2: helper command: /sbin/drbdadm initial-split-brain minor-2&lt;br /&gt;
Mar 29 20:24:37 an-node04 kernel: block drbd2: helper command: /sbin/drbdadm initial-split-brain minor-2 exit code 0 (0x0)&lt;br /&gt;
Mar 29 20:24:37 an-node04 kernel: block drbd2: Split-Brain detected but unresolved, dropping connection!&lt;br /&gt;
Mar 29 20:24:37 an-node04 kernel: block drbd2: helper command: /sbin/drbdadm split-brain minor-2&lt;br /&gt;
Mar 29 20:24:37 an-node04 kernel: block drbd2: helper command: /sbin/drbdadm split-brain minor-2 exit code 0 (0x0)&lt;br /&gt;
Mar 29 20:24:37 an-node04 kernel: block drbd2: conn( WFReportParams -&amp;gt; Disconnecting )&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This can happen, for example, if you stop the cluster while DRBD is still up, and then break the network connection between the two DRBD resources. Recovering from a split-brain is covered in the trouble-shooting section below. &#039;&#039;&#039;ToDo&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{{note|1=Linbit has a good tutorial on recovering from split-brain conditions here: http://www.drbd.org/users-guide/s-resolve-split-brain.html}}&lt;br /&gt;
&lt;br /&gt;
=== Starting the Storage Services ===&lt;br /&gt;
&lt;br /&gt;
Now, with a terminal window opened for each node, run:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt;&#039;&#039;&#039;:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
clusvcadm -e service:an4_storage -m an-node04.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;
Member an-node04.alteeve.com trying to enable service:an4_storage...Success&lt;br /&gt;
service:an4_storage is now running on an-node04.alteeve.com&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt;&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
clusvcadm -e service:an5_storage -m an-node05.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;
Member an-node05.alteeve.com trying to enable service:an5_storage...Success&lt;br /&gt;
service:an5_storage is now running on an-node05.alteeve.com&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The [[syslog]] on either node should show something like this (sample from &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&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;
May  7 23:29:21 an-node04 clurgmgrd[12067]: &amp;lt;notice&amp;gt; Starting disabled service service:an4_storage &lt;br /&gt;
May  7 23:29:22 an-node04 kernel: drbd: initialized. Version: 8.3.8 (api:88/proto:86-94)&lt;br /&gt;
May  7 23:29:22 an-node04 kernel: drbd: GIT-hash: d78846e52224fd00562f7c225bcc25b2d422321d build by mockbuild@builder10.centos.org, 2010-06-04 08:04:27&lt;br /&gt;
May  7 23:29:22 an-node04 kernel: drbd: registered as block device major 147&lt;br /&gt;
May  7 23:29:22 an-node04 kernel: drbd: minor_table @ 0xffff8800cde780c0&lt;br /&gt;
May  7 23:29:22 an-node04 kernel: block drbd0: Starting worker thread (from cqueue/1 [152])&lt;br /&gt;
May  7 23:29:22 an-node04 kernel: klogd 1.4.1, ---------- state change ---------- &lt;br /&gt;
May  7 23:29:22 an-node04 kernel: block drbd0: disk( Diskless -&amp;gt; Attaching ) &lt;br /&gt;
May  7 23:29:22 an-node04 kernel: block drbd0: Found 4 transactions (98 active extents) in activity log.&lt;br /&gt;
May  7 23:29:22 an-node04 kernel: block drbd0: Method to ensure write ordering: barrier&lt;br /&gt;
May  7 23:29:22 an-node04 kernel: block drbd0: max_segment_size ( = BIO size ) = 32768&lt;br /&gt;
May  7 23:29:22 an-node04 kernel: block drbd0: drbd_bm_resize called with capacity == 19550368&lt;br /&gt;
May  7 23:29:22 an-node04 kernel: block drbd0: resync bitmap: bits=2443796 words=38185&lt;br /&gt;
May  7 23:29:22 an-node04 kernel: block drbd0: size = 9546 MB (9775184 KB)&lt;br /&gt;
May  7 23:29:22 an-node04 kernel: block drbd0: recounting of set bits took additional 1 jiffies&lt;br /&gt;
May  7 23:29:22 an-node04 kernel: block drbd0: 0 KB (0 bits) marked out-of-sync by on disk bit-map.&lt;br /&gt;
May  7 23:29:22 an-node04 kernel: block drbd0: disk( Attaching -&amp;gt; Outdated ) &lt;br /&gt;
May  7 23:29:22 an-node04 kernel: block drbd1: Starting worker thread (from cqueue/1 [152])&lt;br /&gt;
May  7 23:29:22 an-node04 kernel: block drbd1: disk( Diskless -&amp;gt; Attaching ) &lt;br /&gt;
May  7 23:29:22 an-node04 kernel: block drbd1: Found 1 transactions (1 active extents) in activity log.&lt;br /&gt;
May  7 23:29:22 an-node04 kernel: block drbd1: Method to ensure write ordering: barrier&lt;br /&gt;
May  7 23:29:22 an-node04 kernel: block drbd1: max_segment_size ( = BIO size ) = 32768&lt;br /&gt;
May  7 23:29:22 an-node04 kernel: block drbd1: drbd_bm_resize called with capacity == 195328232&lt;br /&gt;
May  7 23:29:22 an-node04 kernel: block drbd1: resync bitmap: bits=24416029 words=381501&lt;br /&gt;
May  7 23:29:22 an-node04 kernel: block drbd1: size = 93 GB (97664116 KB)&lt;br /&gt;
May  7 23:29:22 an-node04 kernel: block drbd1: recounting of set bits took additional 2 jiffies&lt;br /&gt;
May  7 23:29:22 an-node04 kernel: block drbd1: 0 KB (0 bits) marked out-of-sync by on disk bit-map.&lt;br /&gt;
May  7 23:29:22 an-node04 kernel: block drbd1: disk( Attaching -&amp;gt; Outdated ) &lt;br /&gt;
May  7 23:29:22 an-node04 kernel: block drbd2: Starting worker thread (from cqueue/1 [152])&lt;br /&gt;
May  7 23:29:22 an-node04 kernel: block drbd2: disk( Diskless -&amp;gt; Attaching ) &lt;br /&gt;
May  7 23:29:22 an-node04 kernel: block drbd2: Found 1 transactions (1 active extents) in activity log.&lt;br /&gt;
May  7 23:29:22 an-node04 kernel: block drbd2: Method to ensure write ordering: barrier&lt;br /&gt;
May  7 23:29:22 an-node04 kernel: block drbd2: max_segment_size ( = BIO size ) = 32768&lt;br /&gt;
May  7 23:29:22 an-node04 kernel: block drbd2: drbd_bm_resize called with capacity == 195328232&lt;br /&gt;
May  7 23:29:22 an-node04 kernel: block drbd2: resync bitmap: bits=24416029 words=381501&lt;br /&gt;
May  7 23:29:22 an-node04 kernel: block drbd2: size = 93 GB (97664116 KB)&lt;br /&gt;
May  7 23:29:22 an-node04 kernel: block drbd2: recounting of set bits took additional 2 jiffies&lt;br /&gt;
May  7 23:29:22 an-node04 kernel: block drbd2: 0 KB (0 bits) marked out-of-sync by on disk bit-map.&lt;br /&gt;
May  7 23:29:22 an-node04 kernel: block drbd2: disk( Attaching -&amp;gt; Outdated ) &lt;br /&gt;
May  7 23:29:22 an-node04 kernel: block drbd3: Starting worker thread (from cqueue/1 [152])&lt;br /&gt;
May  7 23:29:22 an-node04 kernel: block drbd3: disk( Diskless -&amp;gt; Attaching ) &lt;br /&gt;
May  7 23:29:22 an-node04 kernel: block drbd3: No usable activity log found.&lt;br /&gt;
May  7 23:29:22 an-node04 kernel: block drbd3: Method to ensure write ordering: barrier&lt;br /&gt;
May  7 23:29:22 an-node04 kernel: block drbd3: max_segment_size ( = BIO size ) = 32768&lt;br /&gt;
May  7 23:29:22 an-node04 kernel: block drbd3: drbd_bm_resize called with capacity == 515686680&lt;br /&gt;
May  7 23:29:22 an-node04 kernel: block drbd3: resync bitmap: bits=64460835 words=1007201&lt;br /&gt;
May  7 23:29:22 an-node04 kernel: block drbd3: size = 246 GB (257843340 KB)&lt;br /&gt;
May  7 23:29:22 an-node04 kernel: block drbd3: recounting of set bits took additional 5 jiffies&lt;br /&gt;
May  7 23:29:22 an-node04 kernel: block drbd3: 0 KB (0 bits) marked out-of-sync by on disk bit-map.&lt;br /&gt;
May  7 23:29:22 an-node04 kernel: block drbd3: disk( Attaching -&amp;gt; Outdated ) &lt;br /&gt;
May  7 23:29:23 an-node04 kernel: block drbd0: conn( StandAlone -&amp;gt; Unconnected ) &lt;br /&gt;
May  7 23:29:23 an-node04 kernel: block drbd0: Starting receiver thread (from drbd0_worker [14542])&lt;br /&gt;
May  7 23:29:23 an-node04 kernel: block drbd0: receiver (re)started&lt;br /&gt;
May  7 23:29:23 an-node04 kernel: block drbd0: conn( Unconnected -&amp;gt; WFConnection ) &lt;br /&gt;
May  7 23:29:23 an-node04 kernel: block drbd1: conn( StandAlone -&amp;gt; Unconnected ) &lt;br /&gt;
May  7 23:29:23 an-node04 kernel: block drbd1: Starting receiver thread (from drbd1_worker [14556])&lt;br /&gt;
May  7 23:29:23 an-node04 kernel: block drbd1: receiver (re)started&lt;br /&gt;
May  7 23:29:23 an-node04 kernel: block drbd1: conn( Unconnected -&amp;gt; WFConnection ) &lt;br /&gt;
May  7 23:29:23 an-node04 kernel: block drbd2: conn( StandAlone -&amp;gt; Unconnected ) &lt;br /&gt;
May  7 23:29:23 an-node04 kernel: block drbd2: Starting receiver thread (from drbd2_worker [14571])&lt;br /&gt;
May  7 23:29:23 an-node04 kernel: block drbd2: receiver (re)started&lt;br /&gt;
May  7 23:29:23 an-node04 kernel: block drbd2: conn( Unconnected -&amp;gt; WFConnection ) &lt;br /&gt;
May  7 23:29:23 an-node04 kernel: block drbd3: conn( StandAlone -&amp;gt; Unconnected ) &lt;br /&gt;
May  7 23:29:23 an-node04 kernel: block drbd3: Starting receiver thread (from drbd3_worker [14590])&lt;br /&gt;
May  7 23:29:23 an-node04 kernel: block drbd3: receiver (re)started&lt;br /&gt;
May  7 23:29:23 an-node04 kernel: block drbd3: conn( Unconnected -&amp;gt; WFConnection ) &lt;br /&gt;
May  7 23:29:24 an-node04 kernel: block drbd0: Handshake successful: Agreed network protocol version 94&lt;br /&gt;
May  7 23:29:24 an-node04 kernel: block drbd0: conn( WFConnection -&amp;gt; WFReportParams ) &lt;br /&gt;
May  7 23:29:24 an-node04 kernel: block drbd0: Starting asender thread (from drbd0_receiver [14610])&lt;br /&gt;
May  7 23:29:24 an-node04 kernel: block drbd0: data-integrity-alg: &amp;lt;not-used&amp;gt;&lt;br /&gt;
May  7 23:29:24 an-node04 kernel: block drbd0: drbd_sync_handshake:&lt;br /&gt;
May  7 23:29:24 an-node04 kernel: block drbd0: self 60D1A5567634DECE:0000000000000000:49B42CE39BDB4567:2C84CA6708465E8D bits:0 flags:0&lt;br /&gt;
May  7 23:29:24 an-node04 kernel: block drbd0: peer 8033D8F146F6823A:60D1A5567634DECF:49B42CE39BDB4566:2C84CA6708465E8D bits:0 flags:0&lt;br /&gt;
May  7 23:29:24 an-node04 kernel: block drbd0: uuid_compare()=-1 by rule 50&lt;br /&gt;
May  7 23:29:24 an-node04 kernel: block drbd0: peer( Unknown -&amp;gt; Secondary ) conn( WFReportParams -&amp;gt; WFBitMapT ) pdsk( DUnknown -&amp;gt; UpToDate ) &lt;br /&gt;
May  7 23:29:24 an-node04 kernel: block drbd1: Handshake successful: Agreed network protocol version 94&lt;br /&gt;
May  7 23:29:24 an-node04 kernel: block drbd1: conn( WFConnection -&amp;gt; WFReportParams ) &lt;br /&gt;
May  7 23:29:24 an-node04 kernel: block drbd2: Handshake successful: Agreed network protocol version 94&lt;br /&gt;
May  7 23:29:24 an-node04 kernel: block drbd2: conn( WFConnection -&amp;gt; WFReportParams ) &lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd1: Starting asender thread (from drbd1_receiver [14613])&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd2: Starting asender thread (from drbd2_receiver [14616])&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd1: data-integrity-alg: &amp;lt;not-used&amp;gt;&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd1: drbd_sync_handshake:&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd1: self A6B85B6E10FC9ED4:0000000000000000:25BC8F003E8EDE15:6DE822E83F4ED721 bits:0 flags:0&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd1: peer 73B4642E7231664C:A6B85B6E10FC9ED5:25BC8F003E8EDE15:6DE822E83F4ED721 bits:0 flags:0&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd1: uuid_compare()=-1 by rule 50&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd1: peer( Unknown -&amp;gt; Secondary ) conn( WFReportParams -&amp;gt; WFBitMapT ) pdsk( DUnknown -&amp;gt; UpToDate ) &lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd2: data-integrity-alg: &amp;lt;not-used&amp;gt;&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd2: drbd_sync_handshake:&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd2: self D074F4853E9FAFE6:0000000000000000:05586D2FABD3DD12:64590F358F14E685 bits:0 flags:0&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd2: peer 399131BDEB288486:D074F4853E9FAFE7:05586D2FABD3DD13:64590F358F14E685 bits:0 flags:0&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd2: uuid_compare()=-1 by rule 50&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd2: peer( Unknown -&amp;gt; Secondary ) conn( WFReportParams -&amp;gt; WFBitMapT ) pdsk( DUnknown -&amp;gt; UpToDate ) &lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd3: Handshake successful: Agreed network protocol version 94&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd3: conn( WFConnection -&amp;gt; WFReportParams ) &lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd3: Starting asender thread (from drbd3_receiver [14619])&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd3: data-integrity-alg: &amp;lt;not-used&amp;gt;&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd3: drbd_sync_handshake:&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd3: self 5BA622DBC6DE170E:0000000000000000:0DE6667028BDEEFE:66C10BDFC06939F3 bits:0 flags:0&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd3: peer E6526E269E123D4C:5BA622DBC6DE170F:0DE6667028BDEEFF:66C10BDFC06939F3 bits:0 flags:0&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd3: uuid_compare()=-1 by rule 50&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd3: peer( Unknown -&amp;gt; Secondary ) conn( WFReportParams -&amp;gt; WFBitMapT ) pdsk( DUnknown -&amp;gt; UpToDate ) &lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd0: conn( WFBitMapT -&amp;gt; WFSyncUUID ) &lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd0: helper command: /sbin/drbdadm before-resync-target minor-0&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd1: conn( WFBitMapT -&amp;gt; WFSyncUUID ) &lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd0: role( Secondary -&amp;gt; Primary ) &lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd1: helper command: /sbin/drbdadm before-resync-target minor-1&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd1: helper command: /sbin/drbdadm before-resync-target minor-1 exit code 0 (0x0)&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd1: conn( WFSyncUUID -&amp;gt; SyncTarget ) disk( Outdated -&amp;gt; Inconsistent ) &lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd1: Began resync as SyncTarget (will sync 0 KB [0 bits set]).&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd1: Resync done (total 1 sec; paused 0 sec; 0 K/sec)&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd1: conn( SyncTarget -&amp;gt; Connected ) disk( Inconsistent -&amp;gt; UpToDate ) &lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd1: helper command: /sbin/drbdadm after-resync-target minor-1&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd2: conn( WFBitMapT -&amp;gt; WFSyncUUID ) &lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd1: helper command: /sbin/drbdadm after-resync-target minor-1 exit code 0 (0x0)&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd2: helper command: /sbin/drbdadm before-resync-target minor-2&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd2: helper command: /sbin/drbdadm before-resync-target minor-2 exit code 0 (0x0)&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd2: conn( WFSyncUUID -&amp;gt; SyncTarget ) disk( Outdated -&amp;gt; Inconsistent ) &lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd2: Began resync as SyncTarget (will sync 0 KB [0 bits set]).&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd2: Resync done (total 1 sec; paused 0 sec; 0 K/sec)&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd2: conn( SyncTarget -&amp;gt; Connected ) disk( Inconsistent -&amp;gt; UpToDate ) &lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd2: helper command: /sbin/drbdadm after-resync-target minor-2&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd0: helper command: /sbin/drbdadm before-resync-target minor-0 exit code 0 (0x0)&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd0: conn( WFSyncUUID -&amp;gt; SyncTarget ) disk( Outdated -&amp;gt; Inconsistent ) &lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd0: Began resync as SyncTarget (will sync 0 KB [0 bits set]).&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd0: Resync done (total 1 sec; paused 0 sec; 0 K/sec)&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd0: conn( SyncTarget -&amp;gt; Connected ) disk( Inconsistent -&amp;gt; UpToDate ) &lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd0: helper command: /sbin/drbdadm after-resync-target minor-0&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd2: helper command: /sbin/drbdadm after-resync-target minor-2 exit code 0 (0x0)&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd0: helper command: /sbin/drbdadm after-resync-target minor-0 exit code 0 (0x0)&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd3: conn( WFBitMapT -&amp;gt; WFSyncUUID ) &lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd1: Connected in w_make_resync_request&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd2: Connected in w_make_resync_request&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd3: helper command: /sbin/drbdadm before-resync-target minor-3&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd3: helper command: /sbin/drbdadm before-resync-target minor-3 exit code 0 (0x0)&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd3: conn( WFSyncUUID -&amp;gt; SyncTarget ) disk( Outdated -&amp;gt; Inconsistent ) &lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd3: Began resync as SyncTarget (will sync 0 KB [0 bits set]).&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd3: Resync done (total 1 sec; paused 0 sec; 0 K/sec)&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd3: conn( SyncTarget -&amp;gt; Connected ) disk( Inconsistent -&amp;gt; UpToDate ) &lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd3: helper command: /sbin/drbdadm after-resync-target minor-3&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd3: helper command: /sbin/drbdadm after-resync-target minor-3 exit code 0 (0x0)&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd0: Connected in w_make_resync_request&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd1: role( Secondary -&amp;gt; Primary ) &lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd3: Connected in w_make_resync_request&lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd2: role( Secondary -&amp;gt; Primary ) &lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd3: role( Secondary -&amp;gt; Primary ) &lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd0: peer( Secondary -&amp;gt; Primary ) &lt;br /&gt;
May  7 23:29:25 an-node04 kernel: block drbd1: peer( Secondary -&amp;gt; Primary ) &lt;br /&gt;
May  7 23:29:26 an-node04 kernel: block drbd2: peer( Secondary -&amp;gt; Primary ) &lt;br /&gt;
May  7 23:29:26 an-node04 kernel: block drbd3: peer( Secondary -&amp;gt; Primary ) &lt;br /&gt;
May  7 23:29:26 an-node04 clvmd: Cluster LVM daemon started - connected to CMAN&lt;br /&gt;
May  7 23:29:27 an-node04 kernel: GFS2: fsid=: Trying to join cluster &amp;quot;lock_dlm&amp;quot;, &amp;quot;an-cluster01:xen_shared&amp;quot;&lt;br /&gt;
May  7 23:29:27 an-node04 kernel: GFS2: fsid=an-cluster01:xen_shared.0: Joined cluster. Now mounting FS...&lt;br /&gt;
May  7 23:29:27 an-node04 kernel: GFS2: fsid=an-cluster01:xen_shared.0: jid=0, already locked for use&lt;br /&gt;
May  7 23:29:27 an-node04 kernel: GFS2: fsid=an-cluster01:xen_shared.0: jid=0: Looking at journal...&lt;br /&gt;
May  7 23:29:27 an-node04 kernel: GFS2: fsid=an-cluster01:xen_shared.0: jid=0: Done&lt;br /&gt;
May  7 23:29:27 an-node04 kernel: GFS2: fsid=an-cluster01:xen_shared.0: jid=1: Trying to acquire journal lock...&lt;br /&gt;
May  7 23:29:27 an-node04 kernel: GFS2: fsid=an-cluster01:xen_shared.0: jid=1: Looking at journal...&lt;br /&gt;
May  7 23:29:27 an-node04 kernel: GFS2: fsid=an-cluster01:xen_shared.0: jid=1: Done&lt;br /&gt;
May  7 23:29:28 an-node04 clurgmgrd[12067]: &amp;lt;notice&amp;gt; Service service:an4_storage started &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here is what we&#039;re seeing:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clurgmgrd&amp;lt;/span&amp;gt;, the cluster &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; daemon, take the request to start the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an4_storage&amp;lt;/span&amp;gt; service.&lt;br /&gt;
* This is immediately followed by a lot of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;drbd&amp;lt;/span&amp;gt; messages showing the attachment, connection and promotion of the DRBD resources.&lt;br /&gt;
* Once the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;drbd&amp;lt;/span&amp;gt; daemon reported that it was up, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clurgmgrd&amp;lt;/span&amp;gt; started the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clvmd&amp;lt;/span&amp;gt; daemon.&lt;br /&gt;
* Next we see the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;gfs2&amp;lt;/span&amp;gt; initialization script start up.&lt;br /&gt;
* Once this last daemon returns, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clurgmgrd&amp;lt;/span&amp;gt; reports that the service started successfully.&lt;br /&gt;
&lt;br /&gt;
Now you can check &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; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;gfs2&amp;lt;/span&amp;gt; again and you will see that they are all online.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/drbd 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;
drbd driver loaded OK; device status:&lt;br /&gt;
version: 8.3.8 (api:88/proto:86-94)&lt;br /&gt;
GIT-hash: d78846e52224fd00562f7c225bcc25b2d422321d build by mockbuild@builder10.centos.org, 2010-06-04 08:04:27&lt;br /&gt;
m:res  cs         ro               ds                 p  mounted  fstype&lt;br /&gt;
0:r0   Connected  Primary/Primary  UpToDate/UpToDate  C&lt;br /&gt;
1:r1   Connected  Primary/Primary  UpToDate/UpToDate  C&lt;br /&gt;
2:r2   Connected  Primary/Primary  UpToDate/UpToDate  C&lt;br /&gt;
3:r3   Connected  Primary/Primary  UpToDate/UpToDate  C&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;
/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 (pid  14700) is running...&lt;br /&gt;
Clustered Volume Groups: drbd_an5_vg0 drbd_an4_vg0 drbd_sh0_vg0&lt;br /&gt;
Active clustered Logical Volumes: /dev/drbd_sh0_vg0/xen_shared&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;
/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;
/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, let&#039;s check &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clustat&amp;lt;/span&amp;gt; again and we&#039;ll see that the services are online.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
clustat&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Cluster Status for an-cluster01 @ Sat May  7 23:35:03 2011&lt;br /&gt;
Member Status: Quorate&lt;br /&gt;
&lt;br /&gt;
 Member Name                             ID   Status&lt;br /&gt;
 ------ ----                             ---- ------&lt;br /&gt;
 an-node04.alteeve.com                       1 Online, Local, rgmanager&lt;br /&gt;
 an-node05.alteeve.com                       2 Online, rgmanager&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State         &lt;br /&gt;
 ------- ----                   ----- ------                   -----         &lt;br /&gt;
 service:an4_storage            an-node04.alteeve.com          started       &lt;br /&gt;
 service:an5_storage            an-node05.alteeve.com          started       &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Hoozah!&lt;br /&gt;
&lt;br /&gt;
=== Stopping Clustered Services ===&lt;br /&gt;
&lt;br /&gt;
With the services we&#039;ve created, it&#039;s actually pretty simple to shut things down. Simply stopping &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; on each node will stop the services and, as they&#039;re not able to fail over, the services will stay offline. This can lead to bad habits though. So, to get into the proper habit, let&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;lock&amp;lt;/span&amp;gt; then &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;disable&amp;lt;/span&amp;gt; the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an5_storage&amp;lt;/span&amp;gt; service and then shutdown &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt;&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
clusvcadm -l service:an5_storage -m an-node05.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;
Resource groups locked&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;
clusvcadm -d service:an5_storage -m an-node05.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;
Member an-node05.alteeve.com disabling service:an5_storage...Success&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now when you try to run &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clustat&amp;lt;/span&amp;gt;, you can see that the service on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt; is disabled.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
clustat&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Cluster Status for an-cluster01 @ Sat May  7 23:43:10 2011&lt;br /&gt;
Member Status: Quorate&lt;br /&gt;
&lt;br /&gt;
 Member Name                             ID   Status&lt;br /&gt;
 ------ ----                             ---- ------&lt;br /&gt;
 an-node04.alteeve.com                       1 Online, rgmanager&lt;br /&gt;
 an-node05.alteeve.com                       2 Online, Local, rgmanager&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State         &lt;br /&gt;
 ------- ----                   ----- ------                   -----         &lt;br /&gt;
 service:an4_storage            an-node04.alteeve.com          started       &lt;br /&gt;
 service:an5_storage            (an-node05.alteeve.com)        disabled      &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we can shutdown &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; proper.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/rgmanager 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;
Shutting down Cluster Service Manager...&lt;br /&gt;
Waiting for services to stop:                              [  OK  ]&lt;br /&gt;
Cluster Service Manager is stopped.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clustat&amp;lt;/span&amp;gt; will not show any services at all when run from &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt;&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
clustat&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Cluster Status for an-cluster01 @ Sat May  7 23:57:55 2011&lt;br /&gt;
Member Status: Quorate&lt;br /&gt;
&lt;br /&gt;
 Member Name                             ID   Status&lt;br /&gt;
 ------ ----                             ---- ------&lt;br /&gt;
 an-node04.alteeve.com                       1 Online&lt;br /&gt;
 an-node05.alteeve.com                       2 Online, Local&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can still see both services from &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt; though.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt;&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
clustat&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Cluster Status for an-cluster01 @ Sat May  7 23:43:43 2011&lt;br /&gt;
Member Status: Quorate&lt;br /&gt;
&lt;br /&gt;
 Member Name                             ID   Status&lt;br /&gt;
 ------ ----                             ---- ------&lt;br /&gt;
 an-node04.alteeve.com                       1 Online, Local, rgmanager&lt;br /&gt;
 an-node05.alteeve.com                       2 Online&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State         &lt;br /&gt;
 ------- ----                   ----- ------                   -----         &lt;br /&gt;
 service:an4_storage            an-node04.alteeve.com          started       &lt;br /&gt;
 service:an5_storage            (an-node05.alteeve.com)        disabled      &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{note|1=You may notice that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; is no longer showing to the right of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05.alteeve.com&amp;lt;/span&amp;gt;. This indicates that the other node&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; daemon has stopped.}}&lt;br /&gt;
&lt;br /&gt;
Now we can go back to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt; and completely shut down the cluster.&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;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Stopping cluster: &lt;br /&gt;
   Stopping fencing... done&lt;br /&gt;
   Stopping cman... done&lt;br /&gt;
   Stopping ccsd... done&lt;br /&gt;
   Unmounting configfs... done&lt;br /&gt;
                                                           [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can check on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt; and see that the cluster is now down to just itself.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cman_tool 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;
Version: 6.2.0&lt;br /&gt;
Config Version: 13&lt;br /&gt;
Cluster Name: an-cluster01&lt;br /&gt;
Cluster Id: 60257&lt;br /&gt;
Cluster Member: Yes&lt;br /&gt;
Cluster Generation: 144&lt;br /&gt;
Membership state: Cluster-Member&lt;br /&gt;
Nodes: 1&lt;br /&gt;
Expected votes: 1&lt;br /&gt;
Total votes: 1&lt;br /&gt;
Quorum: 1  &lt;br /&gt;
Active subsystems: 9&lt;br /&gt;
Flags: 2node Dirty &lt;br /&gt;
Ports Bound: 0 11 177  &lt;br /&gt;
Node name: an-node04.alteeve.com&lt;br /&gt;
Node ID: 1&lt;br /&gt;
Multicast addresses: 239.192.235.77 &lt;br /&gt;
Node addresses: 192.168.3.74 &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At this point, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt; is totally out of the cluster and, if you wanted, you could perform any maintenance you might want to do. More on that later though.&lt;br /&gt;
&lt;br /&gt;
= Provisioning Our Virtual Servers =&lt;br /&gt;
&lt;br /&gt;
Finally, the goal of this cluster is in sight!&lt;br /&gt;
&lt;br /&gt;
We have two steps left;&lt;br /&gt;
* Provision our VMs.&lt;br /&gt;
* Add the VMs to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Provisioning&amp;quot; a virtual machine simple means to create it. This tutorial is more about clustering than Xen and virtual machine administration, so some liberties will be taken with regard to your knowledge of Xen. We&#039;ll cover all of the steps needed to provision and manage the VMs, but there will not be an in-depth discussion of the tools and their various uses.&lt;br /&gt;
&lt;br /&gt;
Please, if you are totally unfamiliar with [[Xen]], take a few minutes to review some tutorials:&lt;br /&gt;
&lt;br /&gt;
{{note|1=We are using Xen v3.0, heavily patched to be almost the same as 3.1. At the time of writing, the latest is v4.1. Please take not of the version when reading the tutorials below.}}&lt;br /&gt;
&lt;br /&gt;
* [[Networking in Xen 3.x]]; A brief overview of how networking works in our cluster.&lt;br /&gt;
* [http://wiki.xen.org/xenwiki/XenOverview Xen Overview]; Four useful [[PDF]]s in this link.&lt;br /&gt;
* [http://wiki.xen.org/xenwiki/XenFaq Xen FAQ]&lt;br /&gt;
* [http://wiki.xen.org/xenwiki/XenDocs Xen Documentation]; Includes v3 User Manual.&lt;br /&gt;
* [http://wiki.xen.org/xenwiki/HowTos Xen HowTos]; The Xen [http://wiki.xen.org/xenwiki/XenNetworking Networking] section may be particularly helpful.&lt;br /&gt;
* [http://wiki.xen.org/xenwiki/XenManagementTools Xen Management Tools]; Covers &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-manager&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;libvirtd&amp;lt;/span&amp;gt;.&lt;br /&gt;
* [http://wiki.xen.org/xenwiki/XenCommonProblems Xen Common Problems]; Somewhere between an FAQ and a troubleshooting guide.&lt;br /&gt;
&lt;br /&gt;
== Starting libvirtd On The Nodes ==&lt;br /&gt;
&lt;br /&gt;
In the following steps, we will be using a program called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virsh&amp;lt;/span&amp;gt; on the nodes and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-manager&amp;lt;/span&amp;gt; on our workstations to view the VMs. For this, we need to make sure that the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;libvirtd&amp;lt;/span&amp;gt; daemon is running on each node first. This ties in to the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;(xend-unix-server yes)&amp;lt;/span&amp;gt; value we changed in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/xen/xend-config.sxp&amp;lt;/span&amp;gt; file we set earlier, you may recall.&lt;br /&gt;
&lt;br /&gt;
Lets start the daemon now as we&#039;re going to use it very shortly.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On Both Nodes&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/libvirtd 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 libvirtd daemon:                                  [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To start &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;libvirtd&amp;lt;/span&amp;gt; on boot, run the command below.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;On Both Nodes&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
chkconfig libvirtd on&lt;br /&gt;
chkconfig --list libvirtd&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
libvirtd       	0:off	1:off	2:on	3:on	4:on	5:on	6:off&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Accessing The VMs ==&lt;br /&gt;
&lt;br /&gt;
The virtual servers we are going to create are, by definition, &amp;quot;headless&amp;quot;. There is no monitor or place to plug in a keyboard.&lt;br /&gt;
&lt;br /&gt;
The main way that you will monitor the virtual servers is through [[VNC]]. If you are running a relatively recent version of Linux on your workstation, there is a fantastic little program for connecting to and monitoring the VMs on multiple nodes using multiple [[hypervisor]]s called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-manager&amp;lt;/span&amp;gt;. It is available under many Linux distribution&#039;s package managers under the same name. &lt;br /&gt;
&lt;br /&gt;
In Fedora, [[EL]] 5 and 6 and many other [[RPM]] based distributions, you can install &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-manager&amp;lt;/span&amp;gt; on your workstation with the following command.&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;
You can then find &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-manager&amp;lt;/span&amp;gt; on you &#039;&#039;System Tools&#039;&#039; -&amp;gt; &#039;&#039;Virtual Machine Manager&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
To establish a connection to the nodes, click on &#039;&#039;File&#039;&#039; -&amp;gt; &#039;&#039;Add Connection...&#039;&#039;. Change the &#039;&#039;Hypervisor&#039;&#039; selection bar to &#039;&#039;&#039;Xen&#039;&#039;&#039;, check to select &#039;&#039;Connect to remote host&#039;&#039;, leave the default &#039;&#039;Method&#039;&#039; as &#039;&#039;&#039;SSH&#039;&#039;&#039; and &#039;&#039;Username&#039;&#039; as &#039;&#039;&#039;root&#039;&#039;&#039;. Then enter the host name or IP address of each node in the &#039;&#039;Hostname&#039;&#039; field. I always add cluster nodes to my &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/hosts&amp;lt;/span&amp;gt; file so that I can simply enter &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt;. How you handle this is up to you and your preferences.&lt;br /&gt;
&lt;br /&gt;
[[Image:virt-manager_fedora-14_01.png|thumb|340px|center|Adding a connection to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-manager&amp;lt;/span&amp;gt; on Fedora 14.]]&lt;br /&gt;
&lt;br /&gt;
Once both nodes are added, you should see that there is already a &#039;&#039;Domain-0&#039;&#039; entry. This is because, as we discussed earlier, even the &amp;quot;host&amp;quot; OS is itself a virtual machine.&lt;br /&gt;
&lt;br /&gt;
[[Image:virt-manager_fedora-14_02.png|thumb|484px|center|A view of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-manager&amp;lt;/span&amp;gt; on Fedora 14.]]&lt;br /&gt;
&lt;br /&gt;
== Limiting dom0&#039;s RAM Use ==&lt;br /&gt;
&lt;br /&gt;
Normally, [[dom0]] will claim and use memory not allocated to virtual machines. This can cause trouble if, for example, you&#039;ve migrated a [[VM]] off of a node and then want to move it or another VM back shortly after. For a period of time, dom0 will claim that there is not enough free memory for the migration. By setting a hard limit of dom0&#039;s memory usage, this scenario won&#039;t happen and you will not need to delay migrations.&lt;br /&gt;
&lt;br /&gt;
To do this, add &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;dom0_mem=1024M&amp;lt;/span&amp;gt; to the Xen kernel image&#039;s first &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;module&amp;lt;/span&amp;gt; line in [[grub]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /boot/grub/grub.conf /boot/grub/grub.conf.orig&lt;br /&gt;
vim /boot/grub/grub.conf&lt;br /&gt;
diff -u /boot/grub/grub.conf.orig /boot/grub/grub.conf&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;diff&amp;quot;&amp;gt;&lt;br /&gt;
--- /boot/grub/grub.conf.orig	2011-05-10 22:49:09.000000000 -0400&lt;br /&gt;
+++ /boot/grub/grub.conf	2011-05-10 22:54:57.000000000 -0400&lt;br /&gt;
@@ -14,11 +14,11 @@&lt;br /&gt;
 title CentOS (2.6.18-238.9.1.el5xen)&lt;br /&gt;
 	root (hd0,0)&lt;br /&gt;
 	kernel /xen.gz-2.6.18-238.9.1.el5&lt;br /&gt;
-	module /vmlinuz-2.6.18-238.9.1.el5xen ro root=LABEL=/&lt;br /&gt;
+	module /vmlinuz-2.6.18-238.9.1.el5xen ro root=LABEL=/ dom0_mem=1024M&lt;br /&gt;
 	module /initrd-2.6.18-238.9.1.el5xen.img&lt;br /&gt;
 title CentOS (2.6.18-238.9.1.el5)&lt;br /&gt;
 	root (hd0,0)&lt;br /&gt;
-	kernel /vmlinuz-2.6.18-238.9.1.el5 ro root=LABEL=/&lt;br /&gt;
+	kernel /vmlinuz-2.6.18-238.9.1.el5 ro root=LABEL=/ dom0_mem=1024M&lt;br /&gt;
 	initrd /initrd-2.6.18-238.9.1.el5.img&lt;br /&gt;
 title CentOS (2.6.18-238.el5xen)&lt;br /&gt;
 	root (hd0,0)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can change &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;1024M&amp;lt;/span&amp;gt; with the amount of RAM you want to allocate to dom0.&lt;br /&gt;
&lt;br /&gt;
{{warning|1=If you update your kernel, ensure that this kernel argument was added to the new kernel&#039;s argument list.}}&lt;br /&gt;
&lt;br /&gt;
== Our planned layout ==&lt;br /&gt;
&lt;br /&gt;
At this stage, what you will want to run is almost certainly going to be unique to you, so we will not be going into detail about what each VM does. We will cover provisioning them, manipulating them and what not. The description of the VMs is purely an example of what they might be.&lt;br /&gt;
&lt;br /&gt;
We will be creating two virtual servers.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0001_ws1&amp;lt;/span&amp;gt;; A [[CentOS]] server hosting a website.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0002_win1&amp;lt;/span&amp;gt;; A [[Microsoft]] Windows server, showing how to host non-Linux virtual machines.&lt;br /&gt;
&lt;br /&gt;
We&#039;ll assign &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0001_ws1&amp;lt;/span&amp;gt; to normally run on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0002_win1&amp;lt;/span&amp;gt; to normally run on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Before we talk about resources, there is something you must be aware of. &lt;br /&gt;
* You can have more virtual machines than CPU cores. That is, machines can share core. It&#039;s advisable to dedicate one core to just the [[dom0]] machine.&lt;br /&gt;
* RAM on dom0 and all domU VMs must not exceed the maximum amount of RAM available in a given node.&lt;br /&gt;
&lt;br /&gt;
{{warning|1=You &#039;&#039;must&#039;&#039; consider how your collection of virtual servers will run when only on node is available. As I have 4 [[GiB]] of RAM in each node, I will assign 1 [[GiB]] to dom0 and then 1 [[GiB]] to each VM, leaving 1 GiB for future expansion. How you divvy up your memory and CPU cores is ultimately up to you.}}&lt;br /&gt;
&lt;br /&gt;
So here are our two planned virtual servers, laid out in a table. Doing this before provisioning can help you visualize how your cluster&#039;s resources will be consumed, helping to ensure that you don&#039;t use too much, which is of particular note on very large installations. It&#039;s also very useful for planning your virtual machine provisioning commands in the next step.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
!&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0001_ws1&amp;lt;/span&amp;gt;&lt;br /&gt;
!&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0002_win1&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Primary Host&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!RAM&lt;br /&gt;
|1024[[MiB]]&lt;br /&gt;
|1024[[MiB]]&lt;br /&gt;
|-&lt;br /&gt;
!Storage&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/drbd_an4_vg0/vm0001_1&amp;lt;/span&amp;gt;, 50 [[GB]]&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/drbd_an5_vg0/vm0002_1&amp;lt;/span&amp;gt;, 100 [[GB]] (100%)&lt;br /&gt;
|-&lt;br /&gt;
!Network(s)&lt;br /&gt;
|IFN &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xenbr0&amp;lt;/span&amp;gt;, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;192.168.1.200&amp;lt;/span&amp;gt;/&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;255.255.255.0&amp;lt;/span&amp;gt;&lt;br /&gt;
|BCN &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xenbr0&amp;lt;/span&amp;gt;, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;192.168.1.201&amp;lt;/span&amp;gt;/&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;255.255.255.0&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Source Files&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;http://192.168.1.254/c5/x86_64/img&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/xen_shared/iso/Win_Server_2008_Bis_x86_64.iso&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
!Kickstart Script&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;http://192.168.1.254/c5/x86_64/ks/generic_c5.ks&amp;lt;/span&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{{warning|1=There are issues with installing VMs from [[ISO]] images. For this reason, you are advised to make the installation images available over a web server. A great way to do this is by creating a [[Setting Up a PXE Server in Fedora|PXE server]] on your network. Then you can point to it&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;img&amp;lt;/span&amp;gt; directory when running the VM installs. This tutorial assumes this is available.}}&lt;br /&gt;
&lt;br /&gt;
=== Provisioning vm0001_ws1; A Webserver ===&lt;br /&gt;
&lt;br /&gt;
So let&#039;s start with a basic web server. &lt;br /&gt;
&lt;br /&gt;
Provisioning VMs requires two steps;&lt;br /&gt;
* Creating a logical volume on the clustered LVM.&lt;br /&gt;
* Craft and execute a &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-install&amp;lt;/span&amp;gt; command.&lt;br /&gt;
&lt;br /&gt;
Before you proceed, you need to know where the installation image files are found. This tutorial uses a [[Setting Up a PXE Server in Fedora|PXE server]], so we&#039;ll be telling &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-install&amp;lt;/span&amp;gt; to pull the installation files and [[kickstart]] scripts off of it&#039;s web server. If you don&#039;t have a PXE server, simply mounting the installation image&#039;s ISO and making that available through a trivial webserver setup will be fine. How you do this, exactly, is outside the scope of this tutorial. However, there is a separate, detailed configuration tutorial for setting up a [[Setting Up a PXE Server in Fedora|PXE server]] which covers a basic [[apache]] configuration.&lt;br /&gt;
&lt;br /&gt;
Create the [[LV]] for the VM on the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/drbd_an4_vg0&amp;lt;/span&amp;gt; [[VG]], as it will primarily run on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&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;
lvcreate -L 50G -n vm0001_1 --addtag @an-cluster01 /dev/drbd_an4_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;vm0001_1&amp;quot; created&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{note|1=The example below uses the following kickstart file. Please adapt it for your use.&amp;lt;br /&amp;gt;&lt;br /&gt;
* [[generic_c5.ks]]}}&lt;br /&gt;
&lt;br /&gt;
Now, the long &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-install&amp;lt;/span&amp;gt; command to provision the VM. Let&#039;s look at it, then we&#039;ll discuss it.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
virt-install --connect xen \&lt;br /&gt;
	--name vm0001_ws1 \&lt;br /&gt;
	--ram 1048 \&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.254/c5/x86_64/img \&lt;br /&gt;
	--extra-args &amp;quot;ks=http://192.168.1.254/c5/x86_64/ks/generic_c5.ks&amp;quot; \&lt;br /&gt;
	--os-type linux \&lt;br /&gt;
	--os-variant rhel5.4 \&lt;br /&gt;
	--disk path=/dev/drbd_an4_vg0/vm0001_1 \&lt;br /&gt;
	--network bridge=xenbr0 \&lt;br /&gt;
	--vnc \&lt;br /&gt;
	--paravirt&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{note|1=If you wanted to provision a VM to act as a firewall, or for other reasons wanted a VM to access the back-channel, you could connect to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xenbr2&amp;lt;/span&amp;gt; by simply adding a second &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--network bridge=xenbr2&amp;lt;/span&amp;gt; argument.}}&lt;br /&gt;
&lt;br /&gt;
The [[man]] page for &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-install&amp;lt;/span&amp;gt; covers all of the options you can pass in good detail. We&#039;re going to discuss now the options used here, but it will only be a subset of options that you may wish to use. Please take the time to read &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;man virt-install&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--connect xen&amp;lt;/span&amp;gt;; Tells &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-install&amp;lt;/span&amp;gt; that we are provisioning a Xen [[domU]] VM.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--name vm0001_ws1&amp;lt;/span&amp;gt;; Tells &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-install&amp;lt;/span&amp;gt; to give the VM the name &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0001_ws1&amp;lt;/span&amp;gt;. This can be anything you please, but it &#039;&#039;&#039;must&#039;&#039;&#039; be unique in the cluster. Personally, I like the format &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm####_desc&amp;lt;/span&amp;gt;, where &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;####&amp;lt;/span&amp;gt; is a sequence number to ensure uniqueness and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;desc&amp;lt;/span&amp;gt; is a human-readable, short description of the VM. Please use whatever naming convention you find comfortable.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--ram 1024&amp;lt;/span&amp;gt;; This is the number of [[MiB]] to allocate to the VM. This can be adjusted post-install.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--arch x86_64&amp;lt;/span&amp;gt;; This tells &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-install&amp;lt;/span&amp;gt; to emulate a 64[[bit]] CPU/environment.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;-- vcpus 1&amp;lt;/span&amp;gt;; This controls how many CPU cores to allocate to this VM. This can not exceed the real number of CPUs, and should be &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;n-1&amp;lt;/span&amp;gt; at most, to ensure that [[dom0]] gets sole access to core 0. This can be adjusted post-install.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--cpuset 1&amp;lt;/span&amp;gt;; This tells &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;libvirt&amp;lt;/span&amp;gt; which cores it is allowed to use for this VM. This node has four cores, with CPU &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;0&amp;lt;/span&amp;gt; being pinned to [[dom0]]. So we will tell Xen to let this node use any free CPU between &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;1-3&amp;lt;/span&amp;gt; (the second, third and fourth cores). This can be a comma-separated list of value, and values can use hyphens for ranges. For example, if you have eight cores, you may specify &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--cpuset 1-7&amp;lt;/span&amp;gt; or &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--cpuset 1,3,5-7&amp;lt;/span&amp;gt;.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--location http://192.168.1.254/c5/x86_64/img&amp;lt;/span&amp;gt;; This tells the OS&#039; installer to look for installation files under the passed URL. The installation files could be local to the node (ie: with a loop-back mounted ISO), on an [[NFS]] share or over [[FTP]]. This option can be replaced with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--pxe&amp;lt;/span&amp;gt; for [[PXE]] server installs, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--import&amp;lt;/span&amp;gt; for skipping an installation and directly importing a VM image or &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--livecd&amp;lt;/span&amp;gt; for running up a live CD/DVD.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--extra-args &amp;quot;ks=http://192.168.1.254/c5/x86_64/ks/generic_c5.ks&amp;quot;&amp;lt;/span&amp;gt;; This allows us to pass special arguments to the installer&#039;s kernel. In this case, we&#039;re telling the installer to use the [[kickstart]] file at the given location. Optionally, we could have used &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--extra-args &amp;quot;ks=http://192.168.1.254/c5/x86_64/ks/generic_c5.ks ksdevice=eth0&amp;quot;&amp;lt;/span&amp;gt; to specify which interface to use when looking for the defined kickstart file. I generally avoid this as it is rather difficult to predict with physical interface will get what &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ethX&amp;lt;/span&amp;gt; name.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--os-type linux&amp;lt;/span&amp;gt;; This controls some internal optimization within Xen for handling Linux operating systems.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--os-variant rhel5.4&amp;lt;/span&amp;gt;; This further optimizes Xen for use with [[EL5]].4 (and newer) based operating systems. When this option is used, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--os-type&amp;lt;/span&amp;gt; is not strictly needed. The various supported &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--os-type&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--os-variant&amp;lt;/span&amp;gt; are found in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;man virt-install&amp;lt;/span&amp;gt;.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--disk path=/dev/drbd_an4_vg0/vm0001_1&amp;lt;/span&amp;gt;; This tells the installer to allocate the [[LV]] we just created as this VM&#039;s hard drive. There are &#039;&#039;many&#039;&#039; options for using storage for VMs, please see &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;man virt-install&amp;lt;/span&amp;gt;.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--network bridge=xenbr0&amp;lt;/span&amp;gt;; This, and the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xenbr2&amp;lt;/span&amp;gt; following it, tells &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-install&amp;lt;/span&amp;gt; to connect this VM to those two bridges. Note that inside the VM, these will show up as &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;eth1&amp;lt;/span&amp;gt;.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--vnc&amp;lt;/span&amp;gt;; This tells the VM to setup and export a VNC server. This is how we will connect to and monitor the installation of the VM.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--paravirt&amp;lt;/span&amp;gt;; This tells &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-install&amp;lt;/span&amp;gt; that we will be creating a [[paravirtual]] VM. The other option is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--hvm&amp;lt;/span&amp;gt; which specifies full virtualization.&lt;br /&gt;
&lt;br /&gt;
If things went well, you should now see you VM begin to install!&lt;br /&gt;
&lt;br /&gt;
[[Image:xen_vm0001_ws1_install_01.png|thumb|700px|center|Installation of a kickstart-based text install of CentOS 5.6 as a Xen VM.]]&lt;br /&gt;
&lt;br /&gt;
Once your VM is installed, we&#039;ll want to dump it&#039;s configuration to an [[XML]] file. This way, should the VM be accidentally undefined, we can easily redefine it. In fact, we have to define this VM on the second node to enable migration, but we&#039;ll go into details about migration later. For now though, run the following &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virsh&amp;lt;/span&amp;gt; command to write the VM&#039;s definition information to an XML file on the shared GFS2 partition. Putting it there will make is accessible to both nodes.&lt;br /&gt;
&lt;br /&gt;
{{warning|1=Do &#039;&#039;&#039;not&#039;&#039;&#039; bother dumping the configuration to an XML file until &#039;&#039;after&#039;&#039; the OS is fully installed and has rebooted. The configuration will contain arguments specific to the installation that will cause problem if used after the install is completed.}}&lt;br /&gt;
&lt;br /&gt;
Personally, I like to keep the configuration files in a subdirectory on the GFS2 share, then copy them to the local node&#039;s storage, just to be safe. Given that this is our first VM, we&#039;ll create a directory for the definition files now called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;definitions&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt;&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
mkdir /xen_shared/definitions&lt;br /&gt;
virsh dumpxml vm0001_ws1 &amp;gt; /xen_shared/definitions/vm0001_ws1.xml&lt;br /&gt;
cat /xen_shared/definitions/vm0001_ws1.xml&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;domain type=&#039;xen&#039;&amp;gt;&lt;br /&gt;
  &amp;lt;name&amp;gt;vm0001_ws1&amp;lt;/name&amp;gt;&lt;br /&gt;
  &amp;lt;uuid&amp;gt;d01c03da-8054-6590-37fd-5410c6b1a953&amp;lt;/uuid&amp;gt;&lt;br /&gt;
  &amp;lt;memory&amp;gt;1073152&amp;lt;/memory&amp;gt;&lt;br /&gt;
  &amp;lt;currentMemory&amp;gt;1073152&amp;lt;/currentMemory&amp;gt;&lt;br /&gt;
  &amp;lt;vcpu cpuset=&#039;1-3&#039;&amp;gt;1&amp;lt;/vcpu&amp;gt;&lt;br /&gt;
  &amp;lt;bootloader&amp;gt;/usr/bin/pygrub&amp;lt;/bootloader&amp;gt;&lt;br /&gt;
  &amp;lt;os&amp;gt;&lt;br /&gt;
    &amp;lt;type arch=&#039;x86_64&#039; machine=&#039;xenpv&#039;&amp;gt;linux&amp;lt;/type&amp;gt;&lt;br /&gt;
  &amp;lt;/os&amp;gt;&lt;br /&gt;
  &amp;lt;clock offset=&#039;utc&#039;/&amp;gt;&lt;br /&gt;
  &amp;lt;on_poweroff&amp;gt;destroy&amp;lt;/on_poweroff&amp;gt;&lt;br /&gt;
  &amp;lt;on_reboot&amp;gt;restart&amp;lt;/on_reboot&amp;gt;&lt;br /&gt;
  &amp;lt;on_crash&amp;gt;restart&amp;lt;/on_crash&amp;gt;&lt;br /&gt;
  &amp;lt;devices&amp;gt;&lt;br /&gt;
    &amp;lt;disk type=&#039;block&#039; device=&#039;disk&#039;&amp;gt;&lt;br /&gt;
      &amp;lt;driver name=&#039;phy&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;source dev=&#039;/dev/drbd_an4_vg0/vm0001_1&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;target dev=&#039;xvda&#039; bus=&#039;xen&#039;/&amp;gt;&lt;br /&gt;
    &amp;lt;/disk&amp;gt;&lt;br /&gt;
    &amp;lt;interface type=&#039;bridge&#039;&amp;gt;&lt;br /&gt;
      &amp;lt;mac address=&#039;00:16:36:05:6b:8c&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;source bridge=&#039;xenbr0&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;script path=&#039;vif-bridge&#039;/&amp;gt;&lt;br /&gt;
    &amp;lt;/interface&amp;gt;&lt;br /&gt;
    &amp;lt;console type=&#039;pty&#039;&amp;gt;&lt;br /&gt;
      &amp;lt;target port=&#039;0&#039;/&amp;gt;&lt;br /&gt;
    &amp;lt;/console&amp;gt;&lt;br /&gt;
    &amp;lt;input type=&#039;mouse&#039; bus=&#039;xen&#039;/&amp;gt;&lt;br /&gt;
    &amp;lt;graphics type=&#039;vnc&#039; port=&#039;-1&#039; autoport=&#039;yes&#039; keymap=&#039;en-us&#039;/&amp;gt;&lt;br /&gt;
  &amp;lt;/devices&amp;gt;&lt;br /&gt;
&amp;lt;/domain&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On Both Nodes&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
rsync -av /xen_shared/definitions ~/&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
definitions/&lt;br /&gt;
definitions/vm0001_ws1.xml&lt;br /&gt;
&lt;br /&gt;
sent 1085 bytes  received 48 bytes  755.33 bytes/sec&lt;br /&gt;
total size is 953  speedup is 0.84&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The benefit of having backups on the local storage is to protect these rarely changing but critical files in case anything ever corrupted the shared storage. We&#039;ve gone to great lengths to avoid this, but it&#039;s always possible and this is a simple precaution.&lt;br /&gt;
&lt;br /&gt;
==== Reconnecting to the VM ====&lt;br /&gt;
&lt;br /&gt;
After the install finishes, or after you close the initial minimal VNC viewer, you will need to manually reconnect to the VM. This is where &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-manager&amp;lt;/span&amp;gt; comes in so handy! &lt;br /&gt;
&lt;br /&gt;
Start it back up and double-click on the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt; host. You will now see the new &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0001_fw1&amp;lt;/span&amp;gt; VM. Double-click on it and you will be right back on the VM.&lt;br /&gt;
&lt;br /&gt;
[[Image:virt-manager_fedora-14_03.png|thumb|700px|center|A view of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-manager&amp;lt;/span&amp;gt; used to connect to the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0001_ws1&amp;lt;/span&amp;gt; VM.]]&lt;br /&gt;
&lt;br /&gt;
Pretty cool, eh!&lt;br /&gt;
&lt;br /&gt;
==== How to Stop, Define and Start the VM ====&lt;br /&gt;
&lt;br /&gt;
To stop the VM, you can connect to it as a remote server and shut it down as you would a normal VM.&lt;br /&gt;
&lt;br /&gt;
If you want to initial a clean shut down from the host node, you can use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virsh&amp;lt;/span&amp;gt; to initial a shutdown over [[ACPI]], same as if you tapped the power button on a physical server.&lt;br /&gt;
&lt;br /&gt;
Make sure the VM is on the node:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
virsh list --all&lt;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 Name                 State&lt;br /&gt;
----------------------------------&lt;br /&gt;
  0 Domain-0             running&lt;br /&gt;
  2 vm0001_ws1           idle&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tell it to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;shutdown&amp;lt;/span&amp;gt;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
virsh shutdown vm0001_ws1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Domain vm0001_ws1 is being shutdown&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you had a VNC session running, you will see the VM start to gracefully shutdown.&lt;br /&gt;
&lt;br /&gt;
[[Image:xen3_vm_graceful_shutdown_1.png|thumb|center|700px|Gracefully shutting down the firewall VM via &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virsh shutdown vm0001_ws1&amp;lt;/span&amp;gt;.]]&lt;br /&gt;
&lt;br /&gt;
After a few moments, the VM should shut down. You can confirm this by again running &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virsh list --all&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;
virsh list --all&lt;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 Name                 State&lt;br /&gt;
----------------------------------&lt;br /&gt;
  0 Domain-0             running&lt;br /&gt;
  - vm0001_ws1           shut off&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Remember how we dumped this VM&#039;s configuration to an XML file on the GFS2 partition earlier? We&#039;re now going to use that to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;define&amp;lt;/span&amp;gt; the VM on the other node, then we&#039;ll start it up over there, too.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt;&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
Check that the VM isn&#039;t known by &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&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;
virsh list --all&lt;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 Name                 State&lt;br /&gt;
----------------------------------&lt;br /&gt;
  0 Domain-0             running&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It&#039;s not there, as expect. So now we&#039;ll use the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/xen_shared/definitions/vm0001_ws1.xml&amp;lt;/span&amp;gt; file we created.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
virsh define /xen_shared/definitions/vm0001_ws1.xml &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Domain vm0001_ws1 defined from /xen_shared/definitions/vm0001_ws1.xml&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now confirm that it&#039;s there.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
virsh list --all&lt;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 Name                 State&lt;br /&gt;
----------------------------------&lt;br /&gt;
  0 Domain-0             running&lt;br /&gt;
  - vm0001_ws1           shut off&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can now see &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0001_ws1&amp;lt;/span&amp;gt; on both nodes. Of course, &#039;&#039;&#039;&#039;&#039;never&#039;&#039;&#039;&#039;&#039;, &#039;&#039;&#039;&#039;&#039;ever&#039;&#039;&#039;&#039;&#039; try to start the VM on both nodes at the same time. In the previous step, we shut down &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0001_ws1&amp;lt;/span&amp;gt;, but it&#039;s safest to make sure that it&#039;s still off.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt;&#039;&#039;&#039;:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
virsh list --all&lt;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 Name                 State&lt;br /&gt;
----------------------------------&lt;br /&gt;
  0 Domain-0             running&lt;br /&gt;
  - vm0001_ws1           shut off&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So we now have &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0001_ws1&amp;lt;/span&amp;gt; shut off and it is defined on both &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt;. We can now start it on either node. Let&#039;s now start it up on the second node, just for fun.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt;&#039;&#039;&#039;:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
virsh start vm0001_ws1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Domain vm0001_ws1 started&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you look at &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-manager&amp;lt;/span&amp;gt;, you will now see &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0001_ws1&amp;lt;/span&amp;gt; up and running on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt; and shut off on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[Image:xen3_vm_running_on_second_node_1.png|thumb|center|700px|View of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0001_ws1&amp;lt;/span&amp;gt; running on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt;.]]&lt;br /&gt;
&lt;br /&gt;
There we go. We&#039;ve now seen how to stop, define and start the VM using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virsh&amp;lt;/span&amp;gt;. Nothing too fancy!&lt;br /&gt;
&lt;br /&gt;
==== Testing VM Migration ====&lt;br /&gt;
&lt;br /&gt;
One of the biggest benefits of virtual servers in clusters is that they can be migrated between nodes without needing to shut down the VM. This is useful for planned maintenance on nodes, as you can push off all of it&#039;s VMs, take it out of the cluster and do your maintenance and your VM users will see minimal or no interruption in service. &lt;br /&gt;
&lt;br /&gt;
There are two types of migration;&lt;br /&gt;
* &#039;&#039;&#039;Cold Migration&#039;&#039;&#039;; The VM is frozen, it&#039;s RAM is copied to the other node and then it is thawed on the new host. This is the fastest method of migrating, but the users will see a period where they can not interact with the VM.&lt;br /&gt;
* &#039;&#039;&#039;Live Migration&#039;&#039;&#039;; The VM continues to run during the migration. Performance will degrade a bit and the migration process will take longer to complete, but users should not see any interruption in service.&lt;br /&gt;
&lt;br /&gt;
To manually migrate the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0001_ws1&amp;lt;/span&amp;gt; VM &#039;&#039;from&#039;&#039; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt; back to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt;, run the following command. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt;&#039;&#039;&#039; (there will be no output):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
virsh migrate --live vm0001_ws1 xen+ssh://root@an-node04&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you flip over to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-manager&amp;lt;/span&amp;gt;, you will see that the node shows as &#039;&#039;Running&#039;&#039; on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt; on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt; and &#039;&#039;Shutoff&#039;&#039; on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt; right away, but there will still be CPU activity on both. This is the live migration process running. In the screen shot below, I opened a standard terminal and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ssh&amp;lt;/span&amp;gt;&#039;ed into &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0001_ws1&amp;lt;/span&amp;gt; and started a ping flood to Google &#039;&#039;&#039;before&#039;&#039;&#039; starting the live migration. Notice how the migration completed and no packets were dropped?&lt;br /&gt;
&lt;br /&gt;
[[Image:xen3_vm_live_migrating_1.png|thumb|center|700px|View of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0001_ws1&amp;lt;/span&amp;gt; being live migrated to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt; from &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt; with a ping-flood running via an &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ssh&amp;lt;/span&amp;gt; session.]]&lt;br /&gt;
&lt;br /&gt;
This should tickle your geek glands.&lt;br /&gt;
&lt;br /&gt;
==== How to &amp;quot;Pull the Power&amp;quot; on a VM ====&lt;br /&gt;
&lt;br /&gt;
If something happens to the VM and you can&#039;t shut it down, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virsh&amp;lt;/span&amp;gt; provides a command that is the equivalent of pulling the power on a physical server. This command forces the virtual server off without giving the VM a chance to react at all. For obvious reasons, you will want to be somewhat careful in using this as it has all the same potential for problems as killing the power of a real server.&lt;br /&gt;
&lt;br /&gt;
So to &amp;quot;pull the plug&amp;quot;, you can run this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
virsh destroy vm0001_ws1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Domain vm0001_ws1 destroyed&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The VM is still defined, but it&#039;s no longer running.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
virsh list --all&lt;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 Name                 State&lt;br /&gt;
----------------------------------&lt;br /&gt;
  0 Domain-0             running&lt;br /&gt;
  - vm0001_ws1           shut off&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== How to Delete a VM and Start Over ====&lt;br /&gt;
&lt;br /&gt;
{{note|1=It is &#039;&#039;very&#039;&#039; likely that you will run into problems when you first start trying to provision your VM. If you want to delete the VM and start over, the way to do it is with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virsh&amp;lt;/span&amp;gt;, the virtual shell.}}&lt;br /&gt;
&lt;br /&gt;
Check that it&#039;s there.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
virsh list --all&lt;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 Name                 State&lt;br /&gt;
----------------------------------&lt;br /&gt;
  0 Domain-0             running&lt;br /&gt;
  - vm0001_ws1           shut off&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Undefine&amp;quot; it, which deletes it from Xen.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
virsh undefine vm0001_ws1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Domain vm0001_ws1 has been undefined&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Confirm that it is gone.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
virsh list --all&lt;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 Name                 State&lt;br /&gt;
----------------------------------&lt;br /&gt;
  0 Domain-0             running&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now you can try again.&lt;br /&gt;
&lt;br /&gt;
=== Hardware Virtual Machine ===&lt;br /&gt;
&lt;br /&gt;
Most modern processors come with support for &amp;quot;hardware assisted virtualization&amp;quot;, which Xen calls &amp;quot;Hardware Virtual Machine&amp;quot; or &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;hvm&amp;lt;/span&amp;gt; or &amp;quot;Secure Virtual Machine&amp;quot; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;svm&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
HVM requires special support in the CPU in order for it to be used in Xen. Intel processors implement this under the name VT-x and AMD implements this under the name AMD-V. Some motherboards will disable this feature by default, requiring the user to edit the BIOS of their mainboard. &lt;br /&gt;
&lt;br /&gt;
If you try to provision an &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;hvm&amp;lt;/span&amp;gt; and receive an error about it not being supported by the host, consult your system board documentation for information on enabling hardware virtualization.&lt;br /&gt;
&lt;br /&gt;
To check if you have &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;hvm&amp;lt;/span&amp;gt; enabled, run &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xm info&amp;lt;/span&amp;gt; and check the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xen_caps&amp;lt;/span&amp;gt; line for entries starting with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;hvm&amp;lt;/span&amp;gt;. If you do not see any &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;hvm&amp;lt;/span&amp;gt; entries, then it is likely not enabled.&lt;br /&gt;
&lt;br /&gt;
{{note|1=The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xm info&amp;lt;/span&amp;gt; only works when running a Xen kernel. With a vanilla kernel, consult &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/proc/cpuinfo&amp;lt;/span&amp;gt;.}}&lt;br /&gt;
&lt;br /&gt;
Below is the output of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xm info&amp;lt;/span&amp;gt; with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;hvm&amp;lt;/span&amp;gt; &#039;&#039;enabled&#039;&#039; in the host BIOS.&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.18-238.9.1.el5xen&lt;br /&gt;
version                : #1 SMP Tue Apr 12 18:53:56 EDT 2011&lt;br /&gt;
machine                : x86_64&lt;br /&gt;
nr_cpus                : 4&lt;br /&gt;
nr_nodes               : 1&lt;br /&gt;
sockets_per_node       : 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                : 178bfbff:efd3fbff:00000000:00000110:00802009:00000000:000037ff&lt;br /&gt;
total_memory           : 4062&lt;br /&gt;
free_memory            : 1048&lt;br /&gt;
node_to_cpu            : node0:0-3&lt;br /&gt;
xen_major              : 3&lt;br /&gt;
xen_minor              : 1&lt;br /&gt;
xen_extra              : .2-238.9.1.el5&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_pagesize           : 4096&lt;br /&gt;
platform_params        : virt_start=0xffff800000000000&lt;br /&gt;
xen_changeset          : unavailable&lt;br /&gt;
cc_compiler            : gcc version 4.1.2 20080704 (Red Hat 4.1.2-50)&lt;br /&gt;
cc_compile_by          : mockbuild&lt;br /&gt;
cc_compile_domain      : centos.org&lt;br /&gt;
cc_compile_date        : Tue Apr 12 18:01:03 EDT 2011&lt;br /&gt;
xend_config_format     : 2&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;hvm&amp;lt;/span&amp;gt; &#039;&#039;disabled&#039;&#039; in the BIOS. Note the missing &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;hvm&amp;lt;/span&amp;gt; entries on the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xen_caps&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;
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-node05.alteeve.com&lt;br /&gt;
release                : 2.6.18-238.9.1.el5xen&lt;br /&gt;
version                : #1 SMP Tue Apr 12 18:53:56 EDT 2011&lt;br /&gt;
machine                : x86_64&lt;br /&gt;
nr_cpus                : 4&lt;br /&gt;
nr_nodes               : 1&lt;br /&gt;
sockets_per_node       : 1&lt;br /&gt;
cores_per_socket       : 4&lt;br /&gt;
threads_per_core       : 1&lt;br /&gt;
cpu_mhz                : 2200&lt;br /&gt;
hw_caps                : 178bfbff:efd3fbff:00000000:00000110:00802009:00000000:000037ff&lt;br /&gt;
total_memory           : 3838&lt;br /&gt;
free_memory            : 383&lt;br /&gt;
node_to_cpu            : node0:0-3&lt;br /&gt;
xen_major              : 3&lt;br /&gt;
xen_minor              : 1&lt;br /&gt;
xen_extra              : .2-238.9.1.el5&lt;br /&gt;
xen_caps               : xen-3.0-x86_64 xen-3.0-x86_32p &lt;br /&gt;
xen_pagesize           : 4096&lt;br /&gt;
platform_params        : virt_start=0xffff800000000000&lt;br /&gt;
xen_changeset          : unavailable&lt;br /&gt;
cc_compiler            : gcc version 4.1.2 20080704 (Red Hat 4.1.2-50)&lt;br /&gt;
cc_compile_by          : mockbuild&lt;br /&gt;
cc_compile_domain      : centos.org&lt;br /&gt;
cc_compile_date        : Tue Apr 12 18:01:03 EDT 2011&lt;br /&gt;
xend_config_format     : 2&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you try to provision an &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;hvm&amp;lt;/span&amp;gt; machine with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;hvm&amp;lt;/span&amp;gt; disabled, you will see the error below.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
virt-install --connect xen ... --hvm&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
ERROR    Host does not support virtualization type &#039;hvm&#039; for arch &#039;x86_64&#039;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{note|1=When installing from an [[ISO]], you must use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;hvm&amp;lt;/span&amp;gt; or full virtualization.}}&lt;br /&gt;
&lt;br /&gt;
=== Provisioning vm0002_win1; A Windows Server ===&lt;br /&gt;
&lt;br /&gt;
We&#039;re going to provision a [[Microsoft]] Windows 2008 server this time. This will largely be the same process as with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0001_ws1&amp;lt;/span&amp;gt;. The main differences is that we&#039;ll be installing from an [[ISO]] file which was copied into &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/xen_shared/iso/Win_Server_2008_Bis_x86_64.iso&amp;lt;/span&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
Microsoft Windows is commercial software. You will need a proper license to use it in production, but you can [http://www.microsoft.com/windowsserver2008/en/us/trial-software.aspx download a trial] version, which will be sufficient to follow along with this tutorial. &lt;br /&gt;
&lt;br /&gt;
{{note|1=You may find it useful to create an &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/xen_shared/iso&amp;lt;/span&amp;gt; folder to store ISO files in.}}&lt;br /&gt;
&lt;br /&gt;
We won&#039;t go over all the details again, but we will show all the specific commands.&lt;br /&gt;
&lt;br /&gt;
First, create the [[LV]] for this new VM.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
lvcreate -l 100%FREE -n vm0002_1 --addtag @an-cluster01 /dev/drbd_an5_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;vm0002_1&amp;quot; created&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we need to craft the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-install&amp;lt;/span&amp;gt; provision command. Some key differences are that we&#039;re going to create a &amp;quot;hardware virtualized machine&amp;quot;, known as &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;hvm&amp;lt;/span&amp;gt;, which requires support in the CPU. We&#039;ll also directly boot off of a DVD [[ISO]], as if we had put a DVD in a drive and booted from it on a real server. We also need to change the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--os-type&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--os-variant&amp;lt;/span&amp;gt; values to windows as well.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&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;
virt-install --connect xen \&lt;br /&gt;
        --name vm0002_win1 \&lt;br /&gt;
        --ram 1048 \&lt;br /&gt;
        --arch x86_64 \&lt;br /&gt;
        --vcpus 1 \&lt;br /&gt;
        --cpuset 1-3 \&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_an5_vg0/vm0002_1 \&lt;br /&gt;
        --network bridge=xenbr0 \&lt;br /&gt;
        --vnc \&lt;br /&gt;
        --hvm&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Image:Installing_Win2008_VM_01.png|thumb|700px|center|Starting the install of Windows 2008 R2 as a virtual machine]]&lt;br /&gt;
&lt;br /&gt;
I like to close the default VNC session and flip over to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-manager&amp;lt;/span&amp;gt;. This is what you should see if you do the same.&lt;br /&gt;
&lt;br /&gt;
[[Image:Installing_Win2008_VM_via_virt-manager_02.png|thumb|700px|center|Monitoring the install of Windows 2008 R2 via &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-manager&amp;lt;/span&amp;gt;.]]&lt;br /&gt;
&lt;br /&gt;
As before, let the install finish before proceeding. Once the install is completed and you&#039;ve booted for the first time, dump the configuration to an XML file, define it on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt; and update the backups on either node&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/root/&amp;lt;/span&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
Dump the XML definition.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
virsh dumpxml vm0002_win1 &amp;gt; /xen_shared/definitions/vm0002_win1.xml&lt;br /&gt;
ls -lah /xen_shared/definitions/vm0002_win1.xml&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
-rw-r--r-- 1 root root 1.5K May 14 23:27 /xen_shared/definitions/vm0002_win1.xml&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Define the VM on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&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;
virsh define /xen_shared/definitions/vm0002_win1.xml &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Domain vm0002_win1 defined from /xen_shared/definitions/vm0002_win1.xml&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Backup the new VM definition on each node.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
rsync -av /xen_shared/definitions ~/&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
building file list ... done&lt;br /&gt;
definitions/&lt;br /&gt;
definitions/vm0002_win1.xml&lt;br /&gt;
&lt;br /&gt;
sent 1646 bytes  received 48 bytes  3388.00 bytes/sec&lt;br /&gt;
total size is 2446  speedup is 1.44&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Image:Installing_Win2008_VM_via_virt-manager_03.png|thumb|700px|center|Seeing the Windows 2008 R2 on both nodes via &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-manager&amp;lt;/span&amp;gt;.]]&lt;br /&gt;
&lt;br /&gt;
Now we see both VMs defined on both nodes!&lt;br /&gt;
&lt;br /&gt;
= Making Our VMs Highly Available Cluster Services =&lt;br /&gt;
&lt;br /&gt;
We&#039;re ready to start the final step; Making our VMs highly available via cluster management! This involves two major steps:&lt;br /&gt;
* Creating two new, ordered failover Domains; One with each node as the highest priority.&lt;br /&gt;
* Adding our VMs as services, one is each new failover domain.&lt;br /&gt;
&lt;br /&gt;
== Creating the Ordered Failover Domains ==&lt;br /&gt;
&lt;br /&gt;
The idea here is that each new failover domain will have one node with a higher priority than the other. That is, one will have &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt; with the highest priority and the other will have &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt; as the highest. This way, VMs that we want to normally run on a given node will be added to the matching failover domain.&lt;br /&gt;
&lt;br /&gt;
To add the two new failover domains, we&#039;ll add the following to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/cluster/cluster.conf&amp;lt;/span&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
              &amp;lt;failoverdomains&amp;gt;&lt;br /&gt;
                        ...&lt;br /&gt;
                        &amp;lt;failoverdomain name=&amp;quot;an4_primary&amp;quot; nofailback=&amp;quot;0&amp;quot; ordered=&amp;quot;1&amp;quot; restricted=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
                                &amp;lt;failoverdomainnode name=&amp;quot;an-node04.alteeve.com&amp;quot; priority=&amp;quot;1&amp;quot;/&amp;gt;&lt;br /&gt;
                                &amp;lt;failoverdomainnode name=&amp;quot;an-node05.alteeve.com&amp;quot; priority=&amp;quot;2&amp;quot;/&amp;gt;&lt;br /&gt;
                        &amp;lt;/failoverdomain&amp;gt;&lt;br /&gt;
                        &amp;lt;failoverdomain name=&amp;quot;an5_primary&amp;quot; nofailback=&amp;quot;0&amp;quot; ordered=&amp;quot;1&amp;quot; restricted=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
                                &amp;lt;failoverdomainnode name=&amp;quot;an-node04.alteeve.com&amp;quot; priority=&amp;quot;2&amp;quot;/&amp;gt;&lt;br /&gt;
                                &amp;lt;failoverdomainnode name=&amp;quot;an-node05.alteeve.com&amp;quot; priority=&amp;quot;1&amp;quot;/&amp;gt;&lt;br /&gt;
                        &amp;lt;/failoverdomain&amp;gt;&lt;br /&gt;
              &amp;lt;/failoverdomains&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As always, validate it. We&#039;ll see here what the complete file now looks like. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
xmllint --relaxng /usr/share/system-config-cluster/misc/cluster.ng /etc/cluster/cluster.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&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-cluster01&amp;quot; config_version=&amp;quot;14&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;cman expected_votes=&amp;quot;1&amp;quot; two_node=&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-node04.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;fence_na01&amp;quot; port=&amp;quot;04&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-node05.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;fence_na01&amp;quot; port=&amp;quot;03&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 agent=&amp;quot;fence_na&amp;quot; ipaddr=&amp;quot;fence_na01.alteeve.com&amp;quot; login=&amp;quot;admin&amp;quot; name=&amp;quot;fence_na01&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;fence_daemon post_join_delay=&amp;quot;60&amp;quot;/&amp;gt;&lt;br /&gt;
        &amp;lt;totem rrp_mode=&amp;quot;none&amp;quot; secauth=&amp;quot;off&amp;quot;/&amp;gt;&lt;br /&gt;
        &amp;lt;rm&amp;gt;&lt;br /&gt;
                &amp;lt;resources&amp;gt;&lt;br /&gt;
                        &amp;lt;script file=&amp;quot;/etc/init.d/drbd&amp;quot; name=&amp;quot;drbd&amp;quot;/&amp;gt;&lt;br /&gt;
                        &amp;lt;script file=&amp;quot;/etc/init.d/clvmd&amp;quot; name=&amp;quot;clvmd&amp;quot;/&amp;gt;&lt;br /&gt;
                        &amp;lt;script file=&amp;quot;/etc/init.d/gfs2&amp;quot; name=&amp;quot;gfs2&amp;quot;/&amp;gt;&lt;br /&gt;
                &amp;lt;/resources&amp;gt;&lt;br /&gt;
		&amp;lt;failoverdomains&amp;gt;&lt;br /&gt;
			&amp;lt;failoverdomain name=&amp;quot;an4_only&amp;quot; nofailback=&amp;quot;0&amp;quot; ordered=&amp;quot;0&amp;quot; restricted=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
				&amp;lt;failoverdomainnode name=&amp;quot;an-node04.alteeve.com&amp;quot; priority=&amp;quot;1&amp;quot;/&amp;gt;&lt;br /&gt;
			&amp;lt;/failoverdomain&amp;gt;&lt;br /&gt;
			&amp;lt;failoverdomain name=&amp;quot;an5_only&amp;quot; nofailback=&amp;quot;0&amp;quot; ordered=&amp;quot;0&amp;quot; restricted=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
				&amp;lt;failoverdomainnode name=&amp;quot;an-node05.alteeve.com&amp;quot; priority=&amp;quot;1&amp;quot;/&amp;gt;&lt;br /&gt;
			&amp;lt;/failoverdomain&amp;gt;&lt;br /&gt;
			&amp;lt;failoverdomain name=&amp;quot;an4_primary&amp;quot; nofailback=&amp;quot;0&amp;quot; ordered=&amp;quot;1&amp;quot; restricted=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
				&amp;lt;failoverdomainnode name=&amp;quot;an-node04.alteeve.com&amp;quot; priority=&amp;quot;1&amp;quot;/&amp;gt;&lt;br /&gt;
				&amp;lt;failoverdomainnode name=&amp;quot;an-node05.alteeve.com&amp;quot; priority=&amp;quot;2&amp;quot;/&amp;gt;&lt;br /&gt;
			&amp;lt;/failoverdomain&amp;gt;&lt;br /&gt;
			&amp;lt;failoverdomain name=&amp;quot;an5_primary&amp;quot; nofailback=&amp;quot;0&amp;quot; ordered=&amp;quot;1&amp;quot; restricted=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
				&amp;lt;failoverdomainnode name=&amp;quot;an-node04.alteeve.com&amp;quot; priority=&amp;quot;2&amp;quot;/&amp;gt;&lt;br /&gt;
				&amp;lt;failoverdomainnode name=&amp;quot;an-node05.alteeve.com&amp;quot; priority=&amp;quot;1&amp;quot;/&amp;gt;&lt;br /&gt;
			&amp;lt;/failoverdomain&amp;gt;&lt;br /&gt;
		&amp;lt;/failoverdomains&amp;gt;&lt;br /&gt;
		&amp;lt;service autostart=&amp;quot;0&amp;quot; domain=&amp;quot;an4_only&amp;quot; exclusive=&amp;quot;0&amp;quot; max_restarts=&amp;quot;0&amp;quot; name=&amp;quot;an4_storage&amp;quot; recovery=&amp;quot;restart&amp;quot; restart_expire_time=&amp;quot;0&amp;quot;&amp;gt;&lt;br /&gt;
			&amp;lt;script ref=&amp;quot;drbd&amp;quot;&amp;gt;&lt;br /&gt;
				&amp;lt;script ref=&amp;quot;clvmd&amp;quot;&amp;gt;&lt;br /&gt;
					&amp;lt;script ref=&amp;quot;gfs2&amp;quot;/&amp;gt;&lt;br /&gt;
				&amp;lt;/script&amp;gt;&lt;br /&gt;
			&amp;lt;/script&amp;gt;&lt;br /&gt;
		&amp;lt;/service&amp;gt;&lt;br /&gt;
		&amp;lt;service autostart=&amp;quot;0&amp;quot; domain=&amp;quot;an5_only&amp;quot; exclusive=&amp;quot;0&amp;quot; max_restarts=&amp;quot;0&amp;quot; name=&amp;quot;an5_storage&amp;quot; recovery=&amp;quot;restart&amp;quot; restart_expire_time=&amp;quot;0&amp;quot;&amp;gt;&lt;br /&gt;
			&amp;lt;script ref=&amp;quot;drbd&amp;quot;&amp;gt;&lt;br /&gt;
				&amp;lt;script ref=&amp;quot;clvmd&amp;quot;&amp;gt;&lt;br /&gt;
					&amp;lt;script ref=&amp;quot;gfs2&amp;quot;/&amp;gt;&lt;br /&gt;
				&amp;lt;/script&amp;gt;&lt;br /&gt;
			&amp;lt;/script&amp;gt;&lt;br /&gt;
		&amp;lt;/service&amp;gt;&lt;br /&gt;
        &amp;lt;/rm&amp;gt;&lt;br /&gt;
&amp;lt;/cluster&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;
/etc/cluster/cluster.conf validates&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With it validating, push it to the other node.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ccs_tool update /etc/cluster/cluster.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;
Config file updated from version 13 to 14&lt;br /&gt;
&lt;br /&gt;
Update complete.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Adding The VMs To rgmanager ==&lt;br /&gt;
&lt;br /&gt;
This is where we tell &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; which VMs we want to run on which nodes when both are online.&lt;br /&gt;
&lt;br /&gt;
{{note|1=There is a bit of a trick when using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; with our cluster. There is no real way to delay the start of virtual machines until after the storage services are online. The side effect of this is that, if the VMs are set to automatically start with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt;, the VMs will fail because their underlying storage takes too long to come online. For this reason, we will not configure them to start automatically.}}&lt;br /&gt;
&lt;br /&gt;
=== Creating the vm:&amp;lt;domu&amp;gt; Resources ===&lt;br /&gt;
&lt;br /&gt;
Virtual machine services are a special-case in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt;, and have their own &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;vm .../&amp;gt;&amp;lt;/span&amp;gt; tag. Here are the two we will be adding for the two VMs we created in the previous section.&lt;br /&gt;
&lt;br /&gt;
{{warning|1=Make sure that the VMs are shut down before adding them to the cluster! Otherwise &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; will restart them when you first enable the new &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;vm /&amp;gt;&amp;lt;/span&amp;gt; resources.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;rm&amp;gt;&lt;br /&gt;
                ...&lt;br /&gt;
                &amp;lt;vm name=&amp;quot;vm0001_ws1&amp;quot; domain=&amp;quot;an4_primary&amp;quot; path=&amp;quot;/xen_shared/definitions/&amp;quot;&lt;br /&gt;
                 autostart=&amp;quot;0&amp;quot; exclusive=&amp;quot;0&amp;quot; recovery=&amp;quot;restart&amp;quot; max_restarts=&amp;quot;2&amp;quot; restart_expire_time=&amp;quot;600&amp;quot;/&amp;gt;&lt;br /&gt;
                &amp;lt;vm name=&amp;quot;vm0002_win1&amp;quot; domain=&amp;quot;an5_primary&amp;quot; path=&amp;quot;/xen_shared/definitions/&amp;quot;&lt;br /&gt;
                 autostart=&amp;quot;0&amp;quot; exclusive=&amp;quot;0&amp;quot; recovery=&amp;quot;restart&amp;quot; max_restarts=&amp;quot;2&amp;quot; restart_expire_time=&amp;quot;600&amp;quot;/&amp;gt;&lt;br /&gt;
        &amp;lt;/rm&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The attributes are:&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;name&amp;lt;/span&amp;gt;; This is the name of the VM and must match the name of the VM shown by &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virsh list&amp;lt;/span&amp;gt; as well as the definition file name, minus the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;.xml&amp;lt;/span&amp;gt; suffix.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;domain&amp;lt;/span&amp;gt;; This is the name of the failover domain that this VM will operate within.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;path&amp;lt;/span&amp;gt;; This is the full path to where the VM definition files are kept. It &#039;&#039;&#039;is not&#039;&#039;&#039; the full path to the actual definition file itself!&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;autostart&amp;lt;/span&amp;gt;; As mentioned above, we do not want the VMs to automatically start with the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt;, so we set this to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;0&amp;lt;/span&amp;gt;.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;exclusive&amp;lt;/span&amp;gt;; When set, this will prevent &#039;&#039;&#039;any&#039;&#039;&#039; other service from running on the node. This would take out the storage services, so this &#039;&#039;&#039;must&#039;&#039;&#039; be set to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;0&amp;lt;/span&amp;gt;.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;recovery&amp;lt;/span&amp;gt;; This is how the VM should be recovered after it crashes. The options are &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;restart&amp;lt;/span&amp;gt;, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;relocate&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;disable&amp;lt;/span&amp;gt;.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;max_restarts&amp;lt;/span&amp;gt;; This is how many times the VM is allowed to be restarted (from a crash) before the VM is migrated to another node in the failover domain. The idea here is that, normally, we simply want to restart the VM in-place if the VM itself crashed and the underlying node is healthy. However, once the VM restarts this number a times, we assume that there is actually a problem with the VM running on the current node, so we want to give up and move the VM to another node. We will use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;2&amp;lt;/span&amp;gt; restarts before switching to a migration.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;restart_expire_time&amp;lt;/span&amp;gt;; Whenever a VM is restarted, a counter is incremented, which is compared against &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;max_restarts&amp;lt;/span&amp;gt;. After this many seconds, that restart is &amp;quot;forgotten&amp;quot; and the restart counter is reduced by one. With our value of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;600&amp;lt;/span&amp;gt; seconds (10 minutes) and a &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;max_restarts&amp;lt;/span&amp;gt; of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;2&amp;lt;/span&amp;gt;, the VM will be relocated instead of restarted after the third crash in ten minutes.&lt;br /&gt;
&lt;br /&gt;
Again, validate it. We&#039;ll see here what the complete file now looks like. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
xmllint --relaxng /usr/share/system-config-cluster/misc/cluster.ng /etc/cluster/cluster.conf&lt;br /&gt;
&amp;lt;/source&amp;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-cluster01&amp;quot; config_version=&amp;quot;15&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;cman expected_votes=&amp;quot;1&amp;quot; two_node=&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-node04.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;fence_na01&amp;quot; port=&amp;quot;04&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-node05.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;fence_na01&amp;quot; port=&amp;quot;03&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 agent=&amp;quot;fence_na&amp;quot; ipaddr=&amp;quot;fence_na01.alteeve.com&amp;quot; login=&amp;quot;admin&amp;quot; name=&amp;quot;fence_na01&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;fence_daemon post_join_delay=&amp;quot;60&amp;quot;/&amp;gt;&lt;br /&gt;
        &amp;lt;totem rrp_mode=&amp;quot;none&amp;quot; secauth=&amp;quot;off&amp;quot;/&amp;gt;&lt;br /&gt;
        &amp;lt;rm&amp;gt;&lt;br /&gt;
                &amp;lt;resources&amp;gt;&lt;br /&gt;
                        &amp;lt;script file=&amp;quot;/etc/init.d/drbd&amp;quot; name=&amp;quot;drbd&amp;quot;/&amp;gt;&lt;br /&gt;
                        &amp;lt;script file=&amp;quot;/etc/init.d/clvmd&amp;quot; name=&amp;quot;clvmd&amp;quot;/&amp;gt;&lt;br /&gt;
                        &amp;lt;script file=&amp;quot;/etc/init.d/gfs2&amp;quot; name=&amp;quot;gfs2&amp;quot;/&amp;gt;&lt;br /&gt;
                &amp;lt;/resources&amp;gt;&lt;br /&gt;
		&amp;lt;failoverdomains&amp;gt;&lt;br /&gt;
			&amp;lt;failoverdomain name=&amp;quot;an4_only&amp;quot; nofailback=&amp;quot;0&amp;quot; ordered=&amp;quot;0&amp;quot; restricted=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
				&amp;lt;failoverdomainnode name=&amp;quot;an-node04.alteeve.com&amp;quot; priority=&amp;quot;1&amp;quot;/&amp;gt;&lt;br /&gt;
			&amp;lt;/failoverdomain&amp;gt;&lt;br /&gt;
			&amp;lt;failoverdomain name=&amp;quot;an5_only&amp;quot; nofailback=&amp;quot;0&amp;quot; ordered=&amp;quot;0&amp;quot; restricted=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
				&amp;lt;failoverdomainnode name=&amp;quot;an-node05.alteeve.com&amp;quot; priority=&amp;quot;1&amp;quot;/&amp;gt;&lt;br /&gt;
			&amp;lt;/failoverdomain&amp;gt;&lt;br /&gt;
			&amp;lt;failoverdomain name=&amp;quot;an4_primary&amp;quot; nofailback=&amp;quot;0&amp;quot; ordered=&amp;quot;1&amp;quot; restricted=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
				&amp;lt;failoverdomainnode name=&amp;quot;an-node04.alteeve.com&amp;quot; priority=&amp;quot;1&amp;quot;/&amp;gt;&lt;br /&gt;
				&amp;lt;failoverdomainnode name=&amp;quot;an-node05.alteeve.com&amp;quot; priority=&amp;quot;2&amp;quot;/&amp;gt;&lt;br /&gt;
			&amp;lt;/failoverdomain&amp;gt;&lt;br /&gt;
			&amp;lt;failoverdomain name=&amp;quot;an5_primary&amp;quot; nofailback=&amp;quot;0&amp;quot; ordered=&amp;quot;1&amp;quot; restricted=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
				&amp;lt;failoverdomainnode name=&amp;quot;an-node04.alteeve.com&amp;quot; priority=&amp;quot;2&amp;quot;/&amp;gt;&lt;br /&gt;
				&amp;lt;failoverdomainnode name=&amp;quot;an-node05.alteeve.com&amp;quot; priority=&amp;quot;1&amp;quot;/&amp;gt;&lt;br /&gt;
			&amp;lt;/failoverdomain&amp;gt;&lt;br /&gt;
		&amp;lt;/failoverdomains&amp;gt;&lt;br /&gt;
		&amp;lt;service autostart=&amp;quot;0&amp;quot; domain=&amp;quot;an4_only&amp;quot; exclusive=&amp;quot;0&amp;quot; max_restarts=&amp;quot;0&amp;quot; name=&amp;quot;an4_storage&amp;quot; recovery=&amp;quot;restart&amp;quot; restart_expire_time=&amp;quot;0&amp;quot;&amp;gt;&lt;br /&gt;
			&amp;lt;script ref=&amp;quot;drbd&amp;quot;&amp;gt;&lt;br /&gt;
				&amp;lt;script ref=&amp;quot;clvmd&amp;quot;&amp;gt;&lt;br /&gt;
					&amp;lt;script ref=&amp;quot;gfs2&amp;quot;/&amp;gt;&lt;br /&gt;
				&amp;lt;/script&amp;gt;&lt;br /&gt;
			&amp;lt;/script&amp;gt;&lt;br /&gt;
		&amp;lt;/service&amp;gt;&lt;br /&gt;
		&amp;lt;service autostart=&amp;quot;0&amp;quot; domain=&amp;quot;an5_only&amp;quot; exclusive=&amp;quot;0&amp;quot; max_restarts=&amp;quot;0&amp;quot; name=&amp;quot;an5_storage&amp;quot; recovery=&amp;quot;restart&amp;quot; restart_expire_time=&amp;quot;0&amp;quot;&amp;gt;&lt;br /&gt;
			&amp;lt;script ref=&amp;quot;drbd&amp;quot;&amp;gt;&lt;br /&gt;
				&amp;lt;script ref=&amp;quot;clvmd&amp;quot;&amp;gt;&lt;br /&gt;
					&amp;lt;script ref=&amp;quot;gfs2&amp;quot;/&amp;gt;&lt;br /&gt;
				&amp;lt;/script&amp;gt;&lt;br /&gt;
			&amp;lt;/script&amp;gt;&lt;br /&gt;
		&amp;lt;/service&amp;gt;&lt;br /&gt;
                &amp;lt;vm name=&amp;quot;vm0001_ws1&amp;quot; domain=&amp;quot;an4_primary&amp;quot; path=&amp;quot;/xen_shared/definitions/&amp;quot; autostart=&amp;quot;0&amp;quot; exclusive=&amp;quot;0&amp;quot; recovery=&amp;quot;restart&amp;quot; max_restarts=&amp;quot;2&amp;quot; restart_expire_time=&amp;quot;600&amp;quot;/&amp;gt;&lt;br /&gt;
                &amp;lt;vm name=&amp;quot;vm0002_win1&amp;quot; domain=&amp;quot;an5_primary&amp;quot; path=&amp;quot;/xen_shared/definitions/&amp;quot; autostart=&amp;quot;0&amp;quot; exclusive=&amp;quot;0&amp;quot; recovery=&amp;quot;restart&amp;quot; max_restarts=&amp;quot;2&amp;quot; restart_expire_time=&amp;quot;600&amp;quot;/&amp;gt;&lt;br /&gt;
        &amp;lt;/rm&amp;gt;&lt;br /&gt;
&amp;lt;/cluster&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;
/etc/cluster/cluster.conf validates&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now push the updated configuration out.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ccs_tool update /etc/cluster/cluster.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;
Config file updated from version 14 to 15&lt;br /&gt;
&lt;br /&gt;
Update complete.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{note|1=You can use migration mapping to map hostnames to names resolved to other interfaces on the host by adding &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;vm ... migration_mapping=&amp;quot;an-node01.alteeve.com:an-node01.bcn,an-node02.alteeve.com:an-node02.bcn&amp;quot;&amp;lt;/span&amp;gt;. Thanks to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;thomas_s&amp;lt;/span&amp;gt; on the Freenode &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;#linux-cluster&amp;lt;/span&amp;gt; IRC channel for pointing this out.}}&lt;br /&gt;
&lt;br /&gt;
=== Using the new VM Resources ===&lt;br /&gt;
&lt;br /&gt;
{{note|1=We&#039;ll be running all of the commands in this section on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt;.}}&lt;br /&gt;
&lt;br /&gt;
If you now run &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clustat&amp;lt;/span&amp;gt; on either node, you should see the new VM resources.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
clustat &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Cluster Status for an-cluster01 @ Sun May 15 12:36:10 2011&lt;br /&gt;
Member Status: Quorate&lt;br /&gt;
&lt;br /&gt;
 Member Name                             ID   Status&lt;br /&gt;
 ------ ----                             ---- ------&lt;br /&gt;
 an-node04.alteeve.com                       1 Online, Local, rgmanager&lt;br /&gt;
 an-node05.alteeve.com                       2 Online, rgmanager&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State         &lt;br /&gt;
 ------- ----                   ----- ------                   -----         &lt;br /&gt;
 service:an4_storage            an-node04.alteeve.com          started       &lt;br /&gt;
 service:an5_storage            an-node05.alteeve.com          started       &lt;br /&gt;
 vm:vm0001_ws1                  (none)                         disabled      &lt;br /&gt;
 vm:vm0002_win1                 (none)                         disabled      &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we can start the VMs using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt;!&lt;br /&gt;
&lt;br /&gt;
{{note|1=As we&#039;ll be starting a non-standard, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm&amp;lt;/span&amp;gt; service, we need to type out the full service name, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm:domu&amp;lt;/span&amp;gt;.}}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt;&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
clusvcadm -e vm:vm0001_ws1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Local machine trying to enable vm:vm0001_ws1...Success&lt;br /&gt;
vm:vm0001_ws1 is now running on an-node04.alteeve.com&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you check with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virsh&amp;lt;/span&amp;gt;, you&#039;ll see it running now.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
virsh list --all&lt;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 Name                 State&lt;br /&gt;
----------------------------------&lt;br /&gt;
  0 Domain-0             running&lt;br /&gt;
  1 vm0001_ws1           running&lt;br /&gt;
  - vm0002_win1          shut off&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Likewise, if you check &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clustat&amp;lt;/span&amp;gt; from either node, you will see the new VM service running on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&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;
clustat &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Cluster Status for an-cluster01 @ Sun May 15 12:38:38 2011&lt;br /&gt;
Member Status: Quorate&lt;br /&gt;
&lt;br /&gt;
 Member Name                             ID   Status&lt;br /&gt;
 ------ ----                             ---- ------&lt;br /&gt;
 an-node04.alteeve.com                       1 Online, Local, rgmanager&lt;br /&gt;
 an-node05.alteeve.com                       2 Online, rgmanager&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State         &lt;br /&gt;
 ------- ----                   ----- ------                   -----         &lt;br /&gt;
 service:an4_storage            an-node04.alteeve.com          started       &lt;br /&gt;
 service:an5_storage            an-node05.alteeve.com          started       &lt;br /&gt;
 vm:vm0001_ws1                  an-node04.alteeve.com          started       &lt;br /&gt;
 vm:vm0002_win1                 (none)                         disabled      &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So far, so good. Now let&#039;s start the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0002_win1&amp;lt;/span&amp;gt; VM.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt;&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
clusvcadm -e vm:vm0002_win1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Local machine trying to enable vm:vm0002_win1...Success&lt;br /&gt;
vm:vm0002_win1 is now running on an-node04.alteeve.com&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It started, but it didn&#039;t start on the node we normally want!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
clustat &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Cluster Status for an-cluster01 @ Sun May 15 12:40:21 2011&lt;br /&gt;
Member Status: Quorate&lt;br /&gt;
&lt;br /&gt;
 Member Name                             ID   Status&lt;br /&gt;
 ------ ----                             ---- ------&lt;br /&gt;
 an-node04.alteeve.com                       1 Online, Local, rgmanager&lt;br /&gt;
 an-node05.alteeve.com                       2 Online, rgmanager&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State         &lt;br /&gt;
 ------- ----                   ----- ------                   -----         &lt;br /&gt;
 service:an4_storage            an-node04.alteeve.com          started       &lt;br /&gt;
 service:an5_storage            an-node05.alteeve.com          started       &lt;br /&gt;
 vm:vm0001_ws1                  an-node04.alteeve.com          started       &lt;br /&gt;
 vm:vm0002_win1                 an-node04.alteeve.com          started       &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;vm0002_win1&amp;lt;/span&amp;gt; VM started on the node that the command was executed from. We could have added &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;-m an-node05.alteeve.com&amp;lt;/span&amp;gt; to the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clusvcadm&amp;lt;/span&amp;gt;, which we&#039;ll do later. It&#039;s already running though, so lets use this &amp;quot;mistake&amp;quot; as a chance to look at migrating the VM using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clusvcadm&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
So to tell &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; to perform a live migration from &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt; to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt;, use the special &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;-M&amp;lt;/span&amp;gt; live migration switch along with the normal &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;-m&amp;lt;/span&amp;gt; target cluster member switch. For more information on these switches, please take a few minutes to read &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;man clusvcadm&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
{{note|1=If you want to watch the VM as it migrates, you will need to use a program that connects to the server via it&#039;s IP address, as opposed to using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-manager&amp;lt;/span&amp;gt;. The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-manager&amp;lt;/span&amp;gt; connections are bound to the dom0 and will close once the VM moves to the other node. For Linux machines, you can connect using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ssh&amp;lt;/span&amp;gt; or &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vnc&amp;lt;/span&amp;gt; (by IP). For windows, you can connect using RDP (remote desktop protocol) using a program like &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;tsclient&amp;lt;/span&amp;gt; from Linux machines.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
clusvcadm -M vm:vm0002_win1 -m an-node05.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;
Trying to migrate vm:vm0002_win1 to an-node05.alteeve.com...Success&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we can use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clustat&amp;lt;/span&amp;gt; to see that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm:vm0002_win1&amp;lt;/span&amp;gt; service is now running on the proper &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05.alteeve.com&amp;lt;/span&amp;gt; node.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
clustat &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Cluster Status for an-cluster01 @ Sun May 15 12:53:30 2011&lt;br /&gt;
Member Status: Quorate&lt;br /&gt;
&lt;br /&gt;
 Member Name                             ID   Status&lt;br /&gt;
 ------ ----                             ---- ------&lt;br /&gt;
 an-node04.alteeve.com                       1 Online, Local, rgmanager&lt;br /&gt;
 an-node05.alteeve.com                       2 Online, rgmanager&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State         &lt;br /&gt;
 ------- ----                   ----- ------                   -----         &lt;br /&gt;
 service:an4_storage            an-node04.alteeve.com          started       &lt;br /&gt;
 service:an5_storage            an-node05.alteeve.com          started       &lt;br /&gt;
 vm:vm0001_ws1                  an-node04.alteeve.com          started       &lt;br /&gt;
 vm:vm0002_win1                 an-node05.alteeve.com          started       &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Before starting the migration, I logged into the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0002_win1&amp;lt;/span&amp;gt; machine and started a continuous ping against &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;google.ca&amp;lt;/span&amp;gt;. As you can see below, four packets were lost. This is the worst packet loss I was able to get in testing. Usually no packets were lost, but connections do sometimes drop for a very short period.&lt;br /&gt;
&lt;br /&gt;
[[Image:live_migration_vm0002_win2008_to_an-node05_ping.png|thumb|700px|center|Continuous ping from within the live-migrated VM against &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;google.ca&amp;lt;/span&amp;gt; using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;tsclient&amp;lt;/span&amp;gt; to monitor the connection.]]&lt;br /&gt;
&lt;br /&gt;
= Congratulations, Your Cluster Is Complete! Now, Break It! =&lt;br /&gt;
&lt;br /&gt;
You may have noticed that the two storage resources are still not set to automatically start with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt;. This is on purpose, as we now need to work through all of the possible failure modes. Until we&#039;ve done so, out cluster &#039;&#039;&#039;&#039;&#039;is not production ready&#039;&#039;&#039;&#039;&#039;! &lt;br /&gt;
&lt;br /&gt;
It&#039;s true, at this point the cluster is technically finished. As we&#039;ll soon see, we can kill a node and it&#039;s lost VMs will recover on the surviving node. &#039;&#039;&#039;However&#039;&#039;&#039;, that is only a part of this exercise.&lt;br /&gt;
&lt;br /&gt;
Remember back at the beginning how we talked about the inherent complexity of clusters? We need to now break our cluster at every point within that complexity that we can. We need to see how things go wrong so that we can learn how to resolve the problems that &#039;&#039;&#039;will&#039;&#039;&#039; arise now, while we have the luxury of time and a cluster with no real data on it. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Once you go in to production, it is too late to learn.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Backup a Second; Let&#039;s See How It&#039;s Supposed to Work ==&lt;br /&gt;
&lt;br /&gt;
Before we grab a hammer, let&#039;s go over how a clean stop and start should work.&lt;br /&gt;
&lt;br /&gt;
=== Gracefully Shutting Down the Cluster ===&lt;br /&gt;
&lt;br /&gt;
If you&#039;ve followed through this tutorial in order, you probably already have everything running, so let&#039;s start by talking about how to shut down the cluster properly.&lt;br /&gt;
&lt;br /&gt;
The stop order is:&lt;br /&gt;
* Lock &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; services that can migrate; The vm services in our case.&lt;br /&gt;
* Disable all &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; services.&lt;br /&gt;
* Stop the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; daemon.&lt;br /&gt;
* Stop the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt; daemon.&lt;br /&gt;
&lt;br /&gt;
Stopping the virtual machines is no longer a simple task. If you try to power down the VM from within the OS, the cluster will &amp;quot;recover&amp;quot; it as soon as it shuts off. Likewise if you try to stop it using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virsh shutdown &#039;&#039;domU&#039;&#039;&amp;lt;/span&amp;gt;. You can stop a VM by simple disabling it via &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt;, but that is not enough when preparing for a complete shutdown of the cluster as the VM could be restarted on another node in some cases. &lt;br /&gt;
&lt;br /&gt;
To ensure that the VM stays off, we&#039;ll &amp;quot;lock&amp;quot; the service. This will prevent all actions except for disabling (shutting down) the VM. Once quorum is lost though, this lock is lost, so you don&#039;t need to worry about unlocking it later when you restart the cluster.&lt;br /&gt;
&lt;br /&gt;
So let&#039;s take a look at the running resources.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
clustat&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Cluster Status for an-cluster01 @ Sun May 15 13:14:05 2011&lt;br /&gt;
Member Status: Quorate&lt;br /&gt;
&lt;br /&gt;
 Member Name                             ID   Status&lt;br /&gt;
 ------ ----                             ---- ------&lt;br /&gt;
 an-node04.alteeve.com                       1 Online, Local, rgmanager&lt;br /&gt;
 an-node05.alteeve.com                       2 Online, rgmanager&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State         &lt;br /&gt;
 ------- ----                   ----- ------                   -----         &lt;br /&gt;
 service:an4_storage            an-node04.alteeve.com          started       &lt;br /&gt;
 service:an5_storage            an-node05.alteeve.com          started       &lt;br /&gt;
 vm:vm0001_ws1                  an-node04.alteeve.com          started       &lt;br /&gt;
 vm:vm0002_win1                 an-node05.alteeve.com          started       &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We don&#039;t need to worry about the two storage services as they&#039;re in failover domains that, well, don&#039;t fail over anyway. Thus, we&#039;ll lock the two VMs. Note that it doesn&#039;t matter where the lock is issued.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
clusvcadm -l vm:vm0001_ws1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Resource groups locked&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;
clusvcadm -l vm:vm0002_win1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Resource groups locked&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I don&#039;t know of a way to see if a service has been locked as &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clustat&amp;lt;/span&amp;gt; will show no change. However, you can unlock a service if you decided not to shutdown the cluster by replacing the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;-l&amp;lt;/span&amp;gt; switch with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;-u&amp;lt;/span&amp;gt; in the calls above.&lt;br /&gt;
&lt;br /&gt;
[[Image:Locking_the_vm_services_01.png|center|thumb|700px|Locking the two VM services prior to cluster shutdown.]]&lt;br /&gt;
&lt;br /&gt;
Now you can disable the two VM services safely. Note that the disable call will not return until the VM has shut down, so be patient.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
clusvcadm -d vm:vm0001_ws1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Local machine disabling vm:vm0001_ws1...Success&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;
clusvcadm -d vm:vm0002_win1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Local machine disabling vm:vm0002_win1...Success&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Image:Disabling_the_vm_services_01.png|center|thumb|700px|Disabling the two VM services prior to cluster shutdown.]]&lt;br /&gt;
&lt;br /&gt;
You may notice in the screenshot above that the both VMs were disabled from &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt;, despite &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0002_win1&amp;lt;/span&amp;gt; running on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt; even without the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;-m &amp;lt;node&amp;gt;&amp;lt;/span&amp;gt; option. &lt;br /&gt;
&lt;br /&gt;
Check to confirm that the VMs are off now.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
clustat&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Cluster Status for an-cluster01 @ Sun May 15 13:38:20 2011&lt;br /&gt;
Member Status: Quorate&lt;br /&gt;
&lt;br /&gt;
 Member Name                             ID   Status&lt;br /&gt;
 ------ ----                             ---- ------&lt;br /&gt;
 an-node04.alteeve.com                       1 Online, Local, rgmanager&lt;br /&gt;
 an-node05.alteeve.com                       2 Online, rgmanager&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State         &lt;br /&gt;
 ------- ----                   ----- ------                   -----         &lt;br /&gt;
 service:an4_storage            an-node04.alteeve.com          started       &lt;br /&gt;
 service:an5_storage            an-node05.alteeve.com          started       &lt;br /&gt;
 vm:vm0001_ws1                  (an-node04.alteeve.com)        disabled      &lt;br /&gt;
 vm:vm0002_win1                 (an-node05.alteeve.com)        disabled      &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now that the VMs are down, we can stop &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; on both nodes. This will stop the storage services on each node in the process, and we don&#039;t need to worry about them being restarted as they can&#039;t fail to another node and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; will be gone before they could restart. It&#039;s a bit lazy, but it&#039;s safe.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/rgmanager 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;
Shutting down Cluster Service Manager...&lt;br /&gt;
Waiting for services to stop:                              [  OK  ]&lt;br /&gt;
Cluster Service Manager is stopped.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Image:Stopping_the_rgmanager_daemon_01.png|center|thumb|700px|Stopping the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; daemon on both nodes.]]&lt;br /&gt;
&lt;br /&gt;
Notice in the screenshot above that we can see the storage service halting after &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; is told to stop.&lt;br /&gt;
&lt;br /&gt;
We can confirm that storage is stopped simply by checking the status of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;drbd&amp;lt;/span&amp;gt;. If anything went wrong, one or more of the DRBD resources would have been held open and prevented from stopping. If the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;drbd&amp;lt;/span&amp;gt; module is unloaded, we know that the shutdown was successful.&lt;br /&gt;
&lt;br /&gt;
Check this from both nodes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/drbd 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;
drbd not loaded&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now, all that is left is to stop &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&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/cman 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;
Stopping cluster: &lt;br /&gt;
   Stopping fencing... done&lt;br /&gt;
   Stopping cman... done&lt;br /&gt;
   Stopping ccsd... done&lt;br /&gt;
   Unmounting configfs... done&lt;br /&gt;
                                                           [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
That&#039;s it, you can down safely shut down the nodes!&lt;br /&gt;
&lt;br /&gt;
=== Cold Starting the Cluster ===&lt;br /&gt;
&lt;br /&gt;
Starting the cluster from scratch is a little different from starting and joining a node to en existing cluster, as we will see later. There are two main reasons:&lt;br /&gt;
&lt;br /&gt;
* If a node doesn&#039;t hear back from the other node when &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;openais&amp;lt;/span&amp;gt; starts, it &#039;&#039;&#039;must&#039;&#039;&#039; assume that the other node has crashed and that it needs to be fenced. Remember the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;post_join_delay&amp;lt;/span&amp;gt;? That is the maximum amount of time that a node will wait on start before it fires off a fence. Thus, we must start &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt; on both nodes within &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;post_join_delay&amp;lt;/span&amp;gt; seconds of one another.&lt;br /&gt;
* DRBD will not start until both nodes can talk to each other. If you start the storage service on either node, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;drbd&amp;lt;/span&amp;gt; will hang forever waiting for the other node to show up. It is possible to change this DRBD behaviour, but doing so is an exercise for the reader. &lt;br /&gt;
&lt;br /&gt;
Once both nodes are up, you can shut one node back down and safely run of just the one node. This is because the surviving node will see the other node withdraw, and thus will confidently know that it is not going to access the clustered resources. &lt;br /&gt;
&lt;br /&gt;
With this in mind, the cold-start order is:&lt;br /&gt;
&lt;br /&gt;
# Start the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt; daemon on both nodes within &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;post_join_delay&amp;lt;/span&amp;gt; seconds.&lt;br /&gt;
# Start the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; daemon on both nodes. At this point, the storage services are not set to start with the system, so there are no timing concerns yet.&lt;br /&gt;
# Enable the storage services on both nodes. We did not enable the DRBD timeout (see &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;man drbd.conf&amp;lt;/span&amp;gt;), so we don&#039;t have timing concerns here. Be aware that the enable command on the first node will not return until the storage service has been started on the second node. For this reason, you&#039;ll want to have two terminals open; One connected to each node.&lt;br /&gt;
# Verify that the storage services are all online.&lt;br /&gt;
# Start the virtual machine resources in the order that best suits you.&lt;br /&gt;
&lt;br /&gt;
So, start &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&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/cman 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 cluster: &lt;br /&gt;
   Loading modules... done&lt;br /&gt;
   Mounting configfs... done&lt;br /&gt;
   Starting ccsd... done&lt;br /&gt;
   Starting cman... done&lt;br /&gt;
   Starting daemons... done&lt;br /&gt;
   Starting fencing... done&lt;br /&gt;
                                                           [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Image:Starting_cman_on_both_nodes_01.png|thumb|center|700px|Starting &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt; on both nodes at the same time.]]&lt;br /&gt;
&lt;br /&gt;
Now we&#039;ll start &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; on both nodes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/rgmanager 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 Cluster Service Manager:                          [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I like to make a habit of running &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clustat&amp;lt;/span&amp;gt; right after starting, just to ensure that services are or are not running, as I&#039;d expect.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
clustat&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Cluster Status for an-cluster01 @ Sun May 15 16:42:41 2011&lt;br /&gt;
Member Status: Quorate&lt;br /&gt;
&lt;br /&gt;
 Member Name                             ID   Status&lt;br /&gt;
 ------ ----                             ---- ------&lt;br /&gt;
 an-node04.alteeve.com                       1 Online, Local, rgmanager&lt;br /&gt;
 an-node05.alteeve.com                       2 Online, rgmanager&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State         &lt;br /&gt;
 ------- ----                   ----- ------                   -----         &lt;br /&gt;
 service:an4_storage            (none)                         stopped       &lt;br /&gt;
 service:an5_storage            (none)                         stopped       &lt;br /&gt;
 vm:vm0001_ws1                  (none)                         stopped       &lt;br /&gt;
 vm:vm0002_win1                 (none)                         stopped       &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Image:Starting_rgmanager_on_both_nodes_01.png|thumb|center|700px|Starting &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; on both nodes and checking service states with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clustat&amp;lt;/span&amp;gt;.]]&lt;br /&gt;
&lt;br /&gt;
If you run &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clustat&amp;lt;/span&amp;gt; immediately after &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; has started, you may see no services listed. This is not a problem, it just takes a minute for the service states to become known to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
You may notice that the log files are complaining that they could not find the VM definition files in the search path. Remember back in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; section how we talked about the delay in getting the clustered storage online? This is the problem. The definitions are on the GFS2 partition which isn&#039;t available quickly enough. Even if we started the storage resources with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt;, which we will do later, it&#039;s still not fast enough to prevent &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; from failing to find the definition files and giving up. This is why we&#039;ll need to always start the virtual machines manually. &lt;br /&gt;
&lt;br /&gt;
As an aside, this isn&#039;t a problem with [[pacemaker]], as we&#039;ll see in the [[EL6]] tutorial later.&lt;br /&gt;
&lt;br /&gt;
Let&#039;s now start the clustered storage services. As an experiment, start the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an4_storage&amp;lt;/span&amp;gt; service and then wait some time before starting the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an5_storage&amp;lt;/span&amp;gt;. You&#039;ll see that the first service will pause indefinitely, as we discussed.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt;&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
clusvcadm -e an4_storage&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Local machine trying to enable service:an4_storage...&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Image:Starting_storage_on_one_node_01.png|thumb|center|700px|Starting &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an4_storage&amp;lt;/span&amp;gt; on just &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt;.]]&lt;br /&gt;
&lt;br /&gt;
Once you start the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an5_storage&amp;lt;/span&amp;gt; service, both will complete and return to the command line. Once done, I like to run a &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;status&amp;lt;/span&amp;gt; check 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; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;gfs2&amp;lt;/span&amp;gt; to ensure that things are as I expect them.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/drbd status &amp;amp;&amp;amp; /etc/init.d/clvmd status &amp;amp;&amp;amp; /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;
drbd driver loaded OK; device status:&lt;br /&gt;
version: 8.3.8 (api:88/proto:86-94)&lt;br /&gt;
GIT-hash: d78846e52224fd00562f7c225bcc25b2d422321d build by mockbuild@builder10.centos.org, 2010-06-04 08:04:27&lt;br /&gt;
m:res  cs         ro               ds                 p  mounted  fstype&lt;br /&gt;
0:r0   Connected  Primary/Primary  UpToDate/UpToDate  C&lt;br /&gt;
1:r1   Connected  Primary/Primary  UpToDate/UpToDate  C&lt;br /&gt;
2:r2   Connected  Primary/Primary  UpToDate/UpToDate  C&lt;br /&gt;
3:r3   Connected  Primary/Primary  UpToDate/UpToDate  C&lt;br /&gt;
clvmd (pid  6283) is running...&lt;br /&gt;
Clustered Volume Groups: drbd_an5_vg0 drbd_an4_vg0 drbd_sh0_vg0&lt;br /&gt;
Active clustered Logical Volumes: /dev/drbd_an5_vg0/vm0002_1 /dev/drbd_an4_vg0/vm0001_1 /dev/drbd_sh0_vg0/xen_shared&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;
[[Image:Starting_storage_on_the_other_node_01.png|thumb|center|700px|Starting &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an5_storage&amp;lt;/span&amp;gt; on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt; and then performing the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;status&amp;lt;/span&amp;gt; checks.]]&lt;br /&gt;
&lt;br /&gt;
Everything is in place, so now we can start the virtual machines. Given that VMs can run on either node, it&#039;s a good habit to explicitly define the target node using the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;-m&amp;lt;/span&amp;gt; &amp;quot;member&amp;quot; switch.&lt;br /&gt;
&lt;br /&gt;
Start the web server:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
clusvcadm -e vm:vm0001_ws1 -m an-node04.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;
Member an-node04.alteeve.com trying to enable vm:vm0001_ws1...Success&lt;br /&gt;
vm:vm0001_ws1 is now running on an-node04.alteeve.com&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Start the windows server:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
clusvcadm -e vm:vm0002_win1 -m an-node05.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;
Member an-node05.alteeve.com trying to enable vm:vm0002_win1...Success&lt;br /&gt;
vm:vm0002_win1 is now running on an-node05.alteeve.com&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check that they are running using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clustat&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;
clustat&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Cluster Status for an-cluster01 @ Sun May 15 17:05:49 2011&lt;br /&gt;
Member Status: Quorate&lt;br /&gt;
&lt;br /&gt;
 Member Name                             ID   Status&lt;br /&gt;
 ------ ----                             ---- ------&lt;br /&gt;
 an-node04.alteeve.com                       1 Online, Local, rgmanager&lt;br /&gt;
 an-node05.alteeve.com                       2 Online, rgmanager&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State         &lt;br /&gt;
 ------- ----                   ----- ------                   -----         &lt;br /&gt;
 service:an4_storage            an-node04.alteeve.com          started       &lt;br /&gt;
 service:an5_storage            an-node05.alteeve.com          started       &lt;br /&gt;
 vm:vm0001_ws1                  an-node04.alteeve.com          started       &lt;br /&gt;
 vm:vm0002_win1                 an-node05.alteeve.com          started       &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There we have it! The cluster is up and running from a complete cold start.&lt;br /&gt;
&lt;br /&gt;
== Testing Migration and Recovery ==&lt;br /&gt;
&lt;br /&gt;
We&#039;ve already looked at live migration of VMs before they were added to the cluster, but we&#039;ve not yet looked at live migrations &#039;&#039;within&#039;&#039; the cluster.&lt;br /&gt;
&lt;br /&gt;
Our tests will cover:&lt;br /&gt;
&lt;br /&gt;
* A controlled migration, as we would do before and after planned maintenance on a node.&lt;br /&gt;
* Crashing a VM directly, and making sure that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; detects the crash and restarts the VM.&lt;br /&gt;
* Crashing a VM enough times and within enough time to trigger a relocation to the second node.&lt;br /&gt;
* Crashing the host node and checking that lost VMs restart on the surviving node.&lt;br /&gt;
&lt;br /&gt;
=== Controlled Live Migration Using clusvcadm ===&lt;br /&gt;
&lt;br /&gt;
There will be times when you will want to migrate a VM off of a node. The classic example would be to upgrade the hardware, install a new kernel or repair a RAID array. When you know that ahead of time that a node will go down, you can easily migrate the VM services off of it to another node in the cluster.&lt;br /&gt;
&lt;br /&gt;
Let&#039;s look at migrating the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0001_ws1&amp;lt;/span&amp;gt; VM from &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt; to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt;. First, confirm that it is on the source node.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
clustat&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Cluster Status for an-cluster01 @ Sun May 15 17:05:49 2011&lt;br /&gt;
Member Status: Quorate&lt;br /&gt;
&lt;br /&gt;
 Member Name                             ID   Status&lt;br /&gt;
 ------ ----                             ---- ------&lt;br /&gt;
 an-node04.alteeve.com                       1 Online, Local, rgmanager&lt;br /&gt;
 an-node05.alteeve.com                       2 Online, rgmanager&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State         &lt;br /&gt;
 ------- ----                   ----- ------                   -----         &lt;br /&gt;
 service:an4_storage            an-node04.alteeve.com          started       &lt;br /&gt;
 service:an5_storage            an-node05.alteeve.com          started       &lt;br /&gt;
 vm:vm0001_ws1                  an-node04.alteeve.com          started       &lt;br /&gt;
 vm:vm0002_win1                 an-node05.alteeve.com          started       &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now perform the actual migration. Note that we will be using the special &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;-M&amp;lt;/span&amp;gt; (live migrate) switch, rather than the usual &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;-r&amp;lt;/span&amp;gt; (relocate) switch.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
clusvcadm -M vm:vm0001_ws1 -m an-node05.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;
Trying to migrate vm:vm0001_ws1 to an-node05.alteeve.com...Success&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you then run &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clustat&amp;lt;/span&amp;gt; again, you will see the VM now running on the target node.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
clustat&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Cluster Status for an-cluster01 @ Sun May 15 17:21:31 2011&lt;br /&gt;
Member Status: Quorate&lt;br /&gt;
&lt;br /&gt;
 Member Name                             ID   Status&lt;br /&gt;
 ------ ----                             ---- ------&lt;br /&gt;
 an-node04.alteeve.com                       1 Online, Local, rgmanager&lt;br /&gt;
 an-node05.alteeve.com                       2 Online, rgmanager&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State         &lt;br /&gt;
 ------- ----                   ----- ------                   -----         &lt;br /&gt;
 service:an4_storage            an-node04.alteeve.com          started       &lt;br /&gt;
 service:an5_storage            an-node05.alteeve.com          started       &lt;br /&gt;
 vm:vm0001_ws1                  an-node05.alteeve.com          started       &lt;br /&gt;
 vm:vm0002_win1                 an-node05.alteeve.com          started       &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Image:Live_migrating_a_vm_using_clusvcadm_01.png|center|thumb|700px|Live migrating &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0001_ws1&amp;lt;/span&amp;gt; from &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt; to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt;.]]&lt;br /&gt;
&lt;br /&gt;
That was easy!&lt;br /&gt;
&lt;br /&gt;
=== Crashing the VM Itself ===&lt;br /&gt;
&lt;br /&gt;
There are many ways to crash a VM, and you can and should try crashing it all the ways that you can think of. In [[Linux]] machines, we can trigger a crash by &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;echo&amp;lt;/span&amp;gt;&#039;ing &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;c&amp;lt;/span&amp;gt; to the special &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/proc/sysrq-trigger&amp;lt;/span&amp;gt; file. This will instantly crash the server and you will not see the command return. &lt;br /&gt;
&lt;br /&gt;
Let&#039;s do this to the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0001_ws1&amp;lt;/span&amp;gt; VM. Connect to the virtual machine, either directly to it&#039;s console by running &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xm console vm0001_ws1&amp;lt;/span&amp;gt; from the host, or by &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ssh&amp;lt;/span&amp;gt;&#039;ing into the machine. Once logged in, run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
echo c &amp;gt; /proc/sysrq-trigger&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Within moments, you will see the xen &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vifX.Y&amp;lt;/span&amp;gt; interfaces disable and then a new &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vifZ.Y&amp;lt;/span&amp;gt; get created as the VM is restarted. If you are fast enough, you may see &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clustat&amp;lt;/span&amp;gt; report the VM as disabled, though it starts up very quickly so it may be hard to catch.&lt;br /&gt;
&lt;br /&gt;
[[Image:Watching_a_vm_restart_via_rgmanager_01.png|thumb|700px|center|Killing a VM internally and watching it restart.]]&lt;br /&gt;
&lt;br /&gt;
=== Crashing the VM Enough Times to Trigger a Relocation ===&lt;br /&gt;
&lt;br /&gt;
{{note|1=This doesn&#039;t seem to be working at the moment. Filed a Red Hat [https://bugzilla.redhat.com/show_bug.cgi?id=698369 bugzilla] ticket.}}&lt;br /&gt;
&lt;br /&gt;
VM always restarts on the node it was last running on.&lt;br /&gt;
&lt;br /&gt;
=== Crashing the Host Node ===&lt;br /&gt;
&lt;br /&gt;
{{Note|1=Once you crash the host node, both DRBD and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt; will trigger fence calls nearly simultaneously. Some fence devices do not handle this well and will either fail, or report a failed fence to the cluster. If this is the case with your fence device, you can use the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[RHCS_v2_cluster.conf#post_fail_delay|post_fail_delay]]&amp;lt;/span&amp;gt; option in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cluster.conf&amp;lt;/span&amp;gt;.}}&lt;br /&gt;
&lt;br /&gt;
As we did when we crashed the virtual machine, we will crash the operating system on the node currently running one of the VMs. In the case, we have &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0001_ws1&amp;lt;/span&amp;gt; running on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0002_win1&amp;lt;/span&amp;gt; running on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&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;
clustat&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Cluster Status for an-cluster01 @ Sun May 15 19:41:21 2011&lt;br /&gt;
Member Status: Quorate&lt;br /&gt;
&lt;br /&gt;
 Member Name                             ID   Status&lt;br /&gt;
 ------ ----                             ---- ------&lt;br /&gt;
 an-node04.alteeve.com                       1 Online, Local, rgmanager&lt;br /&gt;
 an-node05.alteeve.com                       2 Online, rgmanager&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State         &lt;br /&gt;
 ------- ----                   ----- ------                   -----         &lt;br /&gt;
 service:an4_storage            an-node04.alteeve.com          started       &lt;br /&gt;
 service:an5_storage            an-node05.alteeve.com          started       &lt;br /&gt;
 vm:vm0001_ws1                  an-node04.alteeve.com          started       &lt;br /&gt;
 vm:vm0002_win1                 an-node05.alteeve.com          started       &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once we crash &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt;, watch the log file in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt;. You will see DRBD lose contact with the other side, the crashed &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt; machine get fenced, the cluster will reform and finally the resource manager will restart the lost virtual machine. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt;&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
echo c &amp;gt; /proc/sysrq-trigger&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Watching &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt;, we will see the following in [[syslog]]:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
May 15 19:45:52 an-node05 kernel: block drbd3: PingAck did not arrive in time.&lt;br /&gt;
May 15 19:45:52 an-node05 kernel: block drbd3: peer( Primary -&amp;gt; Unknown ) conn( Connected -&amp;gt; NetworkFailure ) pdsk( UpToDate -&amp;gt; DUnknown ) &lt;br /&gt;
May 15 19:45:52 an-node05 kernel: block drbd3: asender terminated&lt;br /&gt;
May 15 19:45:52 an-node05 kernel: block drbd3: Terminating asender thread&lt;br /&gt;
May 15 19:45:52 an-node05 kernel: block drbd3: short read expecting header on sock: r=-512&lt;br /&gt;
May 15 19:45:52 an-node05 kernel: block drbd3: Creating new current UUID&lt;br /&gt;
May 15 19:45:52 an-node05 kernel: block drbd3: Connection closed&lt;br /&gt;
May 15 19:45:52 an-node05 kernel: block drbd3: conn( NetworkFailure -&amp;gt; Unconnected ) &lt;br /&gt;
May 15 19:45:52 an-node05 kernel: block drbd3: receiver terminated&lt;br /&gt;
May 15 19:45:52 an-node05 kernel: block drbd3: Restarting receiver thread&lt;br /&gt;
May 15 19:45:52 an-node05 kernel: block drbd3: receiver (re)started&lt;br /&gt;
May 15 19:45:52 an-node05 kernel: block drbd3: conn( Unconnected -&amp;gt; WFConnection ) &lt;br /&gt;
May 15 19:45:57 an-node05 kernel: block drbd2: PingAck did not arrive in time.&lt;br /&gt;
May 15 19:45:57 an-node05 kernel: block drbd2: peer( Primary -&amp;gt; Unknown ) conn( Connected -&amp;gt; NetworkFailure ) pdsk( UpToDate -&amp;gt; DUnknown ) &lt;br /&gt;
May 15 19:45:57 an-node05 kernel: block drbd2: asender terminated&lt;br /&gt;
May 15 19:45:57 an-node05 kernel: block drbd2: Terminating asender thread&lt;br /&gt;
May 15 19:45:57 an-node05 kernel: block drbd2: short read expecting header on sock: r=-512&lt;br /&gt;
May 15 19:45:57 an-node05 kernel: block drbd2: Creating new current UUID&lt;br /&gt;
May 15 19:45:57 an-node05 kernel: block drbd2: Connection closed&lt;br /&gt;
May 15 19:45:57 an-node05 kernel: block drbd2: conn( NetworkFailure -&amp;gt; Unconnected ) &lt;br /&gt;
May 15 19:45:57 an-node05 kernel: block drbd2: receiver terminated&lt;br /&gt;
May 15 19:45:57 an-node05 kernel: block drbd2: Restarting receiver thread&lt;br /&gt;
May 15 19:45:57 an-node05 kernel: block drbd2: receiver (re)started&lt;br /&gt;
May 15 19:45:57 an-node05 kernel: block drbd2: conn( Unconnected -&amp;gt; WFConnection ) &lt;br /&gt;
May 15 19:46:00 an-node05 kernel: block drbd0: PingAck did not arrive in time.&lt;br /&gt;
May 15 19:46:00 an-node05 kernel: block drbd0: peer( Primary -&amp;gt; Unknown ) conn( Connected -&amp;gt; NetworkFailure ) pdsk( UpToDate -&amp;gt; DUnknown ) &lt;br /&gt;
May 15 19:46:00 an-node05 kernel: block drbd0: asender terminated&lt;br /&gt;
May 15 19:46:00 an-node05 kernel: block drbd0: Terminating asender thread&lt;br /&gt;
May 15 19:46:00 an-node05 kernel: block drbd0: short read expecting header on sock: r=-512&lt;br /&gt;
May 15 19:46:00 an-node05 kernel: block drbd0: Creating new current UUID&lt;br /&gt;
May 15 19:46:00 an-node05 kernel: block drbd0: Connection closed&lt;br /&gt;
May 15 19:46:00 an-node05 kernel: block drbd0: conn( NetworkFailure -&amp;gt; Unconnected ) &lt;br /&gt;
May 15 19:46:00 an-node05 kernel: block drbd0: receiver terminated&lt;br /&gt;
May 15 19:46:00 an-node05 kernel: block drbd0: Restarting receiver thread&lt;br /&gt;
May 15 19:46:00 an-node05 kernel: block drbd0: receiver (re)started&lt;br /&gt;
May 15 19:46:00 an-node05 kernel: block drbd0: conn( Unconnected -&amp;gt; WFConnection ) &lt;br /&gt;
May 15 19:46:01 an-node05 openais[4704]: [TOTEM] The token was lost in the OPERATIONAL state. &lt;br /&gt;
May 15 19:46:01 an-node05 openais[4704]: [TOTEM] Receive multicast socket recv buffer size (320000 bytes). &lt;br /&gt;
May 15 19:46:01 an-node05 openais[4704]: [TOTEM] Transmit multicast socket send buffer size (262142 bytes). &lt;br /&gt;
May 15 19:46:01 an-node05 openais[4704]: [TOTEM] entering GATHER state from 2. &lt;br /&gt;
May 15 19:46:01 an-node05 kernel: block drbd1: PingAck did not arrive in time.&lt;br /&gt;
May 15 19:46:01 an-node05 kernel: block drbd1: peer( Primary -&amp;gt; Unknown ) conn( Connected -&amp;gt; NetworkFailure ) pdsk( UpToDate -&amp;gt; DUnknown ) &lt;br /&gt;
May 15 19:46:01 an-node05 kernel: block drbd1: asender terminated&lt;br /&gt;
May 15 19:46:01 an-node05 kernel: block drbd1: Terminating asender thread&lt;br /&gt;
May 15 19:46:01 an-node05 kernel: block drbd1: short read expecting header on sock: r=-512&lt;br /&gt;
May 15 19:46:01 an-node05 kernel: block drbd1: Creating new current UUID&lt;br /&gt;
May 15 19:46:01 an-node05 kernel: block drbd1: Connection closed&lt;br /&gt;
May 15 19:46:01 an-node05 kernel: block drbd1: conn( NetworkFailure -&amp;gt; Unconnected ) &lt;br /&gt;
May 15 19:46:01 an-node05 kernel: block drbd1: receiver terminated&lt;br /&gt;
May 15 19:46:01 an-node05 kernel: block drbd1: Restarting receiver thread&lt;br /&gt;
May 15 19:46:01 an-node05 kernel: block drbd1: receiver (re)started&lt;br /&gt;
May 15 19:46:01 an-node05 kernel: block drbd1: conn( Unconnected -&amp;gt; WFConnection ) &lt;br /&gt;
May 15 19:46:03 an-node05 openais[4704]: [TOTEM] entering GATHER state from 0. &lt;br /&gt;
May 15 19:46:03 an-node05 openais[4704]: [TOTEM] Creating commit token because I am the rep. &lt;br /&gt;
May 15 19:46:03 an-node05 openais[4704]: [TOTEM] Storing new sequence id for ring 140 &lt;br /&gt;
May 15 19:46:03 an-node05 openais[4704]: [TOTEM] entering COMMIT state. &lt;br /&gt;
May 15 19:46:03 an-node05 openais[4704]: [TOTEM] entering RECOVERY state. &lt;br /&gt;
May 15 19:46:03 an-node05 openais[4704]: [TOTEM] position [0] member 192.168.3.75: &lt;br /&gt;
May 15 19:46:03 an-node05 openais[4704]: [TOTEM] previous ring seq 316 rep 192.168.3.74 &lt;br /&gt;
May 15 19:46:03 an-node05 openais[4704]: [TOTEM] aru 7b high delivered 7b received flag 1 &lt;br /&gt;
May 15 19:46:03 an-node05 openais[4704]: [TOTEM] Did not need to originate any messages in recovery. &lt;br /&gt;
May 15 19:46:03 an-node05 openais[4704]: [TOTEM] Sending initial ORF token &lt;br /&gt;
May 15 19:46:03 an-node05 openais[4704]: [CLM  ] CLM CONFIGURATION CHANGE &lt;br /&gt;
May 15 19:46:03 an-node05 openais[4704]: [CLM  ] New Configuration: &lt;br /&gt;
May 15 19:46:03 an-node05 openais[4704]: [CLM  ] 	r(0) ip(192.168.3.75)  &lt;br /&gt;
May 15 19:46:03 an-node05 kernel: dlm: closing connection to node 1&lt;br /&gt;
May 15 19:46:03 an-node05 fenced[4724]: an-node04.alteeve.com not a cluster member after 0 sec post_fail_delay&lt;br /&gt;
May 15 19:46:03 an-node05 openais[4704]: [CLM  ] Members Left: &lt;br /&gt;
May 15 19:46:03 an-node05 fenced[4724]: fencing node &amp;quot;an-node04.alteeve.com&amp;quot;&lt;br /&gt;
May 15 19:46:03 an-node05 openais[4704]: [CLM  ] 	r(0) ip(192.168.3.74)  &lt;br /&gt;
May 15 19:46:03 an-node05 openais[4704]: [CLM  ] Members Joined: &lt;br /&gt;
May 15 19:46:03 an-node05 openais[4704]: [CLM  ] CLM CONFIGURATION CHANGE &lt;br /&gt;
May 15 19:46:03 an-node05 openais[4704]: [CLM  ] New Configuration: &lt;br /&gt;
May 15 19:46:03 an-node05 openais[4704]: [CLM  ] 	r(0) ip(192.168.3.75)  &lt;br /&gt;
May 15 19:46:03 an-node05 openais[4704]: [CLM  ] Members Left: &lt;br /&gt;
May 15 19:46:03 an-node05 openais[4704]: [CLM  ] Members Joined: &lt;br /&gt;
May 15 19:46:03 an-node05 openais[4704]: [SYNC ] This node is within the primary component and will provide service. &lt;br /&gt;
May 15 19:46:03 an-node05 openais[4704]: [TOTEM] entering OPERATIONAL state. &lt;br /&gt;
May 15 19:46:03 an-node05 openais[4704]: [CLM  ] got nodejoin message 192.168.3.75 &lt;br /&gt;
May 15 19:46:03 an-node05 openais[4704]: [CPG  ] got joinlist message from node 2 &lt;br /&gt;
May 15 19:46:16 an-node05 fenced[4724]: fence &amp;quot;an-node04.alteeve.com&amp;quot; success&lt;br /&gt;
May 15 19:46:16 an-node05 kernel: GFS2: fsid=an-cluster01:xen_shared.0: jid=1: Trying to acquire journal lock...&lt;br /&gt;
May 15 19:46:16 an-node05 kernel: GFS2: fsid=an-cluster01:xen_shared.0: jid=1: Looking at journal...&lt;br /&gt;
May 15 19:46:16 an-node05 kernel: GFS2: fsid=an-cluster01:xen_shared.0: jid=1: Acquiring the transaction lock...&lt;br /&gt;
May 15 19:46:16 an-node05 kernel: GFS2: fsid=an-cluster01:xen_shared.0: jid=1: Replaying journal...&lt;br /&gt;
May 15 19:46:16 an-node05 kernel: GFS2: fsid=an-cluster01:xen_shared.0: jid=1: Replayed 1 of 1 blocks&lt;br /&gt;
May 15 19:46:16 an-node05 kernel: GFS2: fsid=an-cluster01:xen_shared.0: jid=1: Found 0 revoke tags&lt;br /&gt;
May 15 19:46:16 an-node05 kernel: GFS2: fsid=an-cluster01:xen_shared.0: jid=1: Journal replayed in 1s&lt;br /&gt;
May 15 19:46:16 an-node05 kernel: GFS2: fsid=an-cluster01:xen_shared.0: jid=1: Done&lt;br /&gt;
May 15 19:46:16 an-node05 clurgmgrd[4302]: &amp;lt;notice&amp;gt; Marking service:an4_storage as stopped: Restricted domain unavailable &lt;br /&gt;
May 15 19:46:16 an-node05 clurgmgrd[4302]: &amp;lt;notice&amp;gt; Taking over service vm:vm0001_ws1 from down member an-node04.alteeve.com &lt;br /&gt;
May 15 19:46:18 an-node05 kernel: device vif5.0 entered promiscuous mode&lt;br /&gt;
May 15 19:46:18 an-node05 kernel: ADDRCONF(NETDEV_UP): vif5.0: link is not ready&lt;br /&gt;
May 15 19:46:18 an-node05 clurgmgrd[4302]: &amp;lt;notice&amp;gt; Service vm:vm0001_ws1 started &lt;br /&gt;
May 15 19:46:22 an-node05 kernel: blkback: ring-ref 8, event-channel 8, protocol 1 (x86_64-abi)&lt;br /&gt;
May 15 19:46:33 an-node05 kernel: ADDRCONF(NETDEV_CHANGE): vif5.0: link becomes ready&lt;br /&gt;
May 15 19:46:33 an-node05 kernel: xenbr0: port 4(vif5.0) entering learning state&lt;br /&gt;
May 15 19:46:48 an-node05 kernel: xenbr0: topology change detected, propagating&lt;br /&gt;
May 15 19:46:48 an-node05 kernel: xenbr0: port 4(vif5.0) entering forwarding state&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{note|1=Do to a bug in [[Node Assassin]], DRBD was not configured to fence the remote node on failure, so the only fence call came from &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt;.}}&lt;br /&gt;
&lt;br /&gt;
[[Image:Crashed_an-node04_vm_recovery_01.png|thumb|center|900px|VM recovery beginning on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt; after crashing &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt;.]]&lt;br /&gt;
&lt;br /&gt;
Above we can see that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04.alteeve.com&amp;lt;/span&amp;gt; is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Offline&amp;lt;/span&amp;gt; and the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm:vm0001_ws1&amp;lt;/span&amp;gt; service is automatically &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;starting&amp;lt;/span&amp;gt; on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
Success!&lt;br /&gt;
&lt;br /&gt;
Once you&#039;ve rejoined &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt; to the cluster, simply live-migrate &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0001_ws1&amp;lt;/span&amp;gt; back to it.&lt;br /&gt;
&lt;br /&gt;
=== Further Testing ===&lt;br /&gt;
&lt;br /&gt;
This tutorial could quickly overflow with failure testing scenarios. It is somewhat outside the scope of this tutorial, so we will stop here.&lt;br /&gt;
&lt;br /&gt;
As a rule of thumb, you should expect to spend &#039;&#039;at least&#039;&#039; as much time breaking and repairing your cluster as you did building it in the first place.&lt;br /&gt;
&lt;br /&gt;
A small list of things to test:&lt;br /&gt;
* Pulling each network cable, one at a time, and see how things fail and what is needed to restore the cluster.&lt;br /&gt;
* Kill the power on switch(es). See how things fail when all network connections are lost.&lt;br /&gt;
* Pull hard drives from the server (or &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;dd if=/dev/zero of=/dev/xx count=10000&amp;lt;/span&amp;gt; drives) to fail out the arrays.&lt;br /&gt;
* Reformat a node, then rebuild it from scratch and join it back with the surviving node.&lt;br /&gt;
* And so forth. Be destructively creative!&lt;br /&gt;
&lt;br /&gt;
= Testing Done - Going Into Production =&lt;br /&gt;
&lt;br /&gt;
Once you finish testing, the last thing to do is to change the storage resources to automatically start with the cluster. To do this, simply change &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;autostart=&amp;quot;0&amp;quot;&amp;lt;/span&amp;gt; to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;autostart=&amp;quot;1&amp;quot;&amp;lt;/span&amp;gt; for the two storage resources.&lt;br /&gt;
&lt;br /&gt;
{{note|1=Do &#039;&#039;not&#039;&#039; set &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;autostart=&amp;quot;1&amp;quot;&amp;lt;/span&amp;gt; for the virtual machine resources. As mentioned before, the storage does not come up fast enough and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; will give up trying to start the VMs. You will need to manually start the VM resources when you cold boot the cluster.}}&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;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;rm&amp;gt;&lt;br /&gt;
                ...&lt;br /&gt;
                &amp;lt;service autostart=&amp;quot;1&amp;quot; domain=&amp;quot;an4_only&amp;quot; exclusive=&amp;quot;0&amp;quot; max_restarts=&amp;quot;0&amp;quot; name=&amp;quot;an4_storage&amp;quot; recovery=&amp;quot;restart&amp;quot; restart_expire_time=&amp;quot;0&amp;quot;&amp;gt;&lt;br /&gt;
                        &amp;lt;script ref=&amp;quot;drbd&amp;quot;&amp;gt;&lt;br /&gt;
                                &amp;lt;script ref=&amp;quot;clvmd&amp;quot;&amp;gt;&lt;br /&gt;
                                        &amp;lt;script ref=&amp;quot;gfs2&amp;quot;/&amp;gt;&lt;br /&gt;
                                &amp;lt;/script&amp;gt;&lt;br /&gt;
                        &amp;lt;/script&amp;gt;&lt;br /&gt;
                &amp;lt;/service&amp;gt;&lt;br /&gt;
                &amp;lt;service autostart=&amp;quot;1&amp;quot; domain=&amp;quot;an5_only&amp;quot; exclusive=&amp;quot;0&amp;quot; max_restarts=&amp;quot;0&amp;quot; name=&amp;quot;an5_storage&amp;quot; recovery=&amp;quot;restart&amp;quot; restart_expire_time=&amp;quot;0&amp;quot;&amp;gt;&lt;br /&gt;
                        &amp;lt;script ref=&amp;quot;drbd&amp;quot;&amp;gt;&lt;br /&gt;
                                &amp;lt;script ref=&amp;quot;clvmd&amp;quot;&amp;gt;&lt;br /&gt;
                                        &amp;lt;script ref=&amp;quot;gfs2&amp;quot;/&amp;gt;&lt;br /&gt;
                                &amp;lt;/script&amp;gt;&lt;br /&gt;
                        &amp;lt;/script&amp;gt;&lt;br /&gt;
                &amp;lt;/service&amp;gt;&lt;br /&gt;
        &amp;lt;/rm&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Validate and push out the new configuration.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
xmllint --relaxng /usr/share/system-config-cluster/misc/cluster.ng /etc/cluster/cluster.conf&lt;br /&gt;
&amp;lt;/source&amp;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-cluster01&amp;quot; config_version=&amp;quot;16&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;cman expected_votes=&amp;quot;1&amp;quot; two_node=&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-node04.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;fence_na01&amp;quot; port=&amp;quot;04&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-node05.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;fence_na01&amp;quot; port=&amp;quot;03&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 agent=&amp;quot;fence_na&amp;quot; ipaddr=&amp;quot;fence_na01.alteeve.com&amp;quot; login=&amp;quot;admin&amp;quot; name=&amp;quot;fence_na01&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;fence_daemon post_join_delay=&amp;quot;60&amp;quot;/&amp;gt;&lt;br /&gt;
        &amp;lt;totem rrp_mode=&amp;quot;none&amp;quot; secauth=&amp;quot;off&amp;quot;/&amp;gt;&lt;br /&gt;
        &amp;lt;rm&amp;gt;&lt;br /&gt;
                &amp;lt;resources&amp;gt;&lt;br /&gt;
                        &amp;lt;script file=&amp;quot;/etc/init.d/drbd&amp;quot; name=&amp;quot;drbd&amp;quot;/&amp;gt;&lt;br /&gt;
                        &amp;lt;script file=&amp;quot;/etc/init.d/clvmd&amp;quot; name=&amp;quot;clvmd&amp;quot;/&amp;gt;&lt;br /&gt;
                        &amp;lt;script file=&amp;quot;/etc/init.d/gfs2&amp;quot; name=&amp;quot;gfs2&amp;quot;/&amp;gt;&lt;br /&gt;
                &amp;lt;/resources&amp;gt;&lt;br /&gt;
		&amp;lt;failoverdomains&amp;gt;&lt;br /&gt;
			&amp;lt;failoverdomain name=&amp;quot;an4_only&amp;quot; nofailback=&amp;quot;0&amp;quot; ordered=&amp;quot;0&amp;quot; restricted=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
				&amp;lt;failoverdomainnode name=&amp;quot;an-node04.alteeve.com&amp;quot; priority=&amp;quot;1&amp;quot;/&amp;gt;&lt;br /&gt;
			&amp;lt;/failoverdomain&amp;gt;&lt;br /&gt;
			&amp;lt;failoverdomain name=&amp;quot;an5_only&amp;quot; nofailback=&amp;quot;0&amp;quot; ordered=&amp;quot;0&amp;quot; restricted=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
				&amp;lt;failoverdomainnode name=&amp;quot;an-node05.alteeve.com&amp;quot; priority=&amp;quot;1&amp;quot;/&amp;gt;&lt;br /&gt;
			&amp;lt;/failoverdomain&amp;gt;&lt;br /&gt;
			&amp;lt;failoverdomain name=&amp;quot;an4_primary&amp;quot; nofailback=&amp;quot;0&amp;quot; ordered=&amp;quot;1&amp;quot; restricted=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
				&amp;lt;failoverdomainnode name=&amp;quot;an-node04.alteeve.com&amp;quot; priority=&amp;quot;1&amp;quot;/&amp;gt;&lt;br /&gt;
				&amp;lt;failoverdomainnode name=&amp;quot;an-node05.alteeve.com&amp;quot; priority=&amp;quot;2&amp;quot;/&amp;gt;&lt;br /&gt;
			&amp;lt;/failoverdomain&amp;gt;&lt;br /&gt;
			&amp;lt;failoverdomain name=&amp;quot;an5_primary&amp;quot; nofailback=&amp;quot;0&amp;quot; ordered=&amp;quot;1&amp;quot; restricted=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
				&amp;lt;failoverdomainnode name=&amp;quot;an-node04.alteeve.com&amp;quot; priority=&amp;quot;2&amp;quot;/&amp;gt;&lt;br /&gt;
				&amp;lt;failoverdomainnode name=&amp;quot;an-node05.alteeve.com&amp;quot; priority=&amp;quot;1&amp;quot;/&amp;gt;&lt;br /&gt;
			&amp;lt;/failoverdomain&amp;gt;&lt;br /&gt;
		&amp;lt;/failoverdomains&amp;gt;&lt;br /&gt;
		&amp;lt;service autostart=&amp;quot;1&amp;quot; domain=&amp;quot;an4_only&amp;quot; exclusive=&amp;quot;0&amp;quot; max_restarts=&amp;quot;0&amp;quot; name=&amp;quot;an4_storage&amp;quot; recovery=&amp;quot;restart&amp;quot; restart_expire_time=&amp;quot;0&amp;quot;&amp;gt;&lt;br /&gt;
			&amp;lt;script ref=&amp;quot;drbd&amp;quot;&amp;gt;&lt;br /&gt;
				&amp;lt;script ref=&amp;quot;clvmd&amp;quot;&amp;gt;&lt;br /&gt;
					&amp;lt;script ref=&amp;quot;gfs2&amp;quot;/&amp;gt;&lt;br /&gt;
				&amp;lt;/script&amp;gt;&lt;br /&gt;
			&amp;lt;/script&amp;gt;&lt;br /&gt;
		&amp;lt;/service&amp;gt;&lt;br /&gt;
		&amp;lt;service autostart=&amp;quot;1&amp;quot; domain=&amp;quot;an5_only&amp;quot; exclusive=&amp;quot;0&amp;quot; max_restarts=&amp;quot;0&amp;quot; name=&amp;quot;an5_storage&amp;quot; recovery=&amp;quot;restart&amp;quot; restart_expire_time=&amp;quot;0&amp;quot;&amp;gt;&lt;br /&gt;
			&amp;lt;script ref=&amp;quot;drbd&amp;quot;&amp;gt;&lt;br /&gt;
				&amp;lt;script ref=&amp;quot;clvmd&amp;quot;&amp;gt;&lt;br /&gt;
					&amp;lt;script ref=&amp;quot;gfs2&amp;quot;/&amp;gt;&lt;br /&gt;
				&amp;lt;/script&amp;gt;&lt;br /&gt;
			&amp;lt;/script&amp;gt;&lt;br /&gt;
		&amp;lt;/service&amp;gt;&lt;br /&gt;
                &amp;lt;vm name=&amp;quot;vm0001_ws1&amp;quot; domain=&amp;quot;an4_primary&amp;quot; path=&amp;quot;/xen_shared/definitions/&amp;quot; autostart=&amp;quot;0&amp;quot; exclusive=&amp;quot;0&amp;quot; recovery=&amp;quot;restart&amp;quot; max_restarts=&amp;quot;2&amp;quot; restart_expire_time=&amp;quot;600&amp;quot;/&amp;gt;&lt;br /&gt;
                &amp;lt;vm name=&amp;quot;vm0002_win1&amp;quot; domain=&amp;quot;an5_primary&amp;quot; path=&amp;quot;/xen_shared/definitions/&amp;quot; autostart=&amp;quot;0&amp;quot; exclusive=&amp;quot;0&amp;quot; recovery=&amp;quot;restart&amp;quot; max_restarts=&amp;quot;2&amp;quot; restart_expire_time=&amp;quot;600&amp;quot;/&amp;gt;&lt;br /&gt;
        &amp;lt;/rm&amp;gt;&lt;br /&gt;
&amp;lt;/cluster&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;
/etc/cluster/cluster.conf validates&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;
ccs_tool update /etc/cluster/cluster.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;
Config file updated from version 15 to 16&lt;br /&gt;
&lt;br /&gt;
Update complete.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now stop and then start again &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt;. When it starts, you will not need to enable the storage resources, they will start automatically.&lt;br /&gt;
&lt;br /&gt;
== Complete! ==&lt;br /&gt;
&lt;br /&gt;
We&#039;re done.&lt;br /&gt;
&lt;br /&gt;
I hope you&#039;ve found this tutorial useful. If you have any feedback, criticism, corrections or comments, please let me know.&lt;br /&gt;
&lt;br /&gt;
-- [[Digimer]]&lt;br /&gt;
&lt;br /&gt;
= Common Administrative Tasks =&lt;br /&gt;
&lt;br /&gt;
This is far from a comprehensive list!&lt;br /&gt;
&lt;br /&gt;
This section will attempt to cover some of the day to day tasks you may want to perform on you cluster of VMs.&lt;br /&gt;
&lt;br /&gt;
== Enabling MTU Sizes Over 1500 Bytes ==&lt;br /&gt;
&lt;br /&gt;
{{warning|1=This requires the use of a kernel compiled outside of the main repos. For this reason, do not apply this unless you have a particular need for jumbo frames and are willing to take on the additional risk of installing and running an unsupported kernel.}}&lt;br /&gt;
&lt;br /&gt;
Currently, enabling MTU sizes over 1500 bytes requires compiling a new kernel and replacing/patching two Xen scripts. I&#039;ve made a pre-compiled kernel and the patched scripts available on [https://alteeve.com/xen https://alteeve.com/xen]. [[Red Hat]] bugzilla bugs have been filed, but they missed the window for being added to [[EL5]].7. They will be merged in for [[EL5]].8, but that is some time off.&lt;br /&gt;
&lt;br /&gt;
You can track the bug progress below:&lt;br /&gt;
* [https://bugzilla.redhat.com/show_bug.cgi?id=697021 Patch needed to allow MTU &amp;gt;1500 on vif prior to connecting to bridge]&lt;br /&gt;
* [https://bugzilla.redhat.com/show_bug.cgi?id=697310 Patch for xen-3.0.3 to support patch in BZ 697021]&lt;br /&gt;
&lt;br /&gt;
Below is a pretty ugly [[bash]] chain of commands that will download, install and copy into place everything needed to make jumbo frames work.&lt;br /&gt;
&lt;br /&gt;
{{note|1=The debug and devel packages for the kernel used below can be found here: https://alteeve.com/xen/RPMS/x86_64/}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cd /etc/xen/ &amp;amp;&amp;amp; \&lt;br /&gt;
	mv qemu-ifup qemu-ifup.orig &amp;amp;&amp;amp; \&lt;br /&gt;
	wget https://alteeve.com/xen/qemu-ifup &amp;amp;&amp;amp; \&lt;br /&gt;
	cd scripts/ &amp;amp;&amp;amp; \&lt;br /&gt;
	mv xen-network-common.sh xen-network-common.sh.orig &amp;amp;&amp;amp; \&lt;br /&gt;
	wget https://alteeve.com/xen/xen-network-common.sh &amp;amp;&amp;amp; \&lt;br /&gt;
	mv xen-network-common-bonding.sh xen-network-common-bonding.sh.orig &amp;amp;&amp;amp; \&lt;br /&gt;
	wget https://alteeve.com/xen/xen-network-common-bonding.sh &amp;amp;&amp;amp; \&lt;br /&gt;
	cd ~ &amp;amp;&amp;amp; \&lt;br /&gt;
	wget https://alteeve.com/xen/RPMS/x86_64/kernel-xen-2.6.18-238.9.3.el5.x86_64.rpm &amp;amp;&amp;amp; \&lt;br /&gt;
	wget https://alteeve.com/xen/RPMS/x86_64/kernel-2.6.18-238.9.3.el5.x86_64.rpm &amp;amp;&amp;amp; \&lt;br /&gt;
	rpm -ivh ~/kernel-* &amp;amp;&amp;amp; \&lt;br /&gt;
	echo &amp;quot;exclude=kernel*&amp;quot; &amp;gt;&amp;gt; /etc/yum.conf &amp;amp;&amp;amp; \&lt;br /&gt;
	echo &amp;quot;exclude=xen*&amp;quot; &amp;gt;&amp;gt; /etc/yum.conf&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{note|1=Choosing a jumbo frame size larger that what is supported by your network interfaces and switches will cause networking to fail when the first large packet is sent. Consult your hardware documentation before setting an MTU size and remember to use the lowest size supported by all of your equipment. Note that some manufacturers will claim jumbo frame support when the actually only support ~4000 [[bytes]].}}&lt;br /&gt;
&lt;br /&gt;
Once this is done, you will need to reboot the use the new kernel. Before you do though, edit your &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/sysconfig/network-scripts/ifcfg-eth*&amp;lt;/span&amp;gt; files and add &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;MTU=xxxx&amp;lt;/span&amp;gt;, where &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xxxx&amp;lt;/span&amp;gt; is the frame size you want.&lt;br /&gt;
&lt;br /&gt;
Once set, you can reboot.&lt;br /&gt;
&lt;br /&gt;
{{note|1=Do not set the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;MTU=&amp;lt;/span&amp;gt; in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ifcfg-xenbrX&amp;lt;/span&amp;gt; configuration files. The bridges will always use the MTU of the lowest MTU device connected to it.}}&lt;br /&gt;
&lt;br /&gt;
On my system, my &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth0&amp;lt;/span&amp;gt; device has a maximum MTU of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;7200&amp;lt;/span&amp;gt; [[bytes]]. The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth1&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth2&amp;lt;/span&amp;gt; devices both support &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;9000&amp;lt;/span&amp;gt; [[bytes]], as does my switch. So my configuration files will be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/sysconfig/network-scripts/ifcfg-eth0&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;
# Realtek Semiconductor Co., Ltd. RTL8111/8168B PCI Express Gigabit Ethernet controller&lt;br /&gt;
HWADDR=48:5B:39:3C:53:14&lt;br /&gt;
DEVICE=eth0&lt;br /&gt;
BRIDGE=xenbr0&lt;br /&gt;
BOOTPROTO=static&lt;br /&gt;
ONBOOT=yes&lt;br /&gt;
MTU=7200&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/sysconfig/network-scripts/ifcfg-eth1&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;
# Intel Corporation 82574L Gigabit Network Connection&lt;br /&gt;
HWADDR=00:1B:21:72:9B:5A&lt;br /&gt;
DEVICE=eth1&lt;br /&gt;
BOOTPROTO=static&lt;br /&gt;
ONBOOT=yes&lt;br /&gt;
MTU=9000&lt;br /&gt;
IPADDR=192.168.2.74&lt;br /&gt;
NETMASK=255.255.255.0&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/sysconfig/network-scripts/ifcfg-eth2&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;
# Intel Corporation 82574L Gigabit Network Connection&lt;br /&gt;
HWADDR=00:1B:21:72:96:EA&lt;br /&gt;
DEVICE=eth2&lt;br /&gt;
BRIDGE=xenbr2&lt;br /&gt;
BOOTPROTO=static&lt;br /&gt;
ONBOOT=yes&lt;br /&gt;
MTU=9000&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Confirm that the newly installed &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;2.6.18-238.9.3.el5xen&amp;lt;/span&amp;gt; is set to boot by default.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cat /boot/grub/grub.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;
# grub.conf generated by anaconda&lt;br /&gt;
#&lt;br /&gt;
# Note that you do not have to rerun grub after making changes to this file&lt;br /&gt;
# NOTICE:  You have a /boot partition.  This means that&lt;br /&gt;
#          all kernel and initrd paths are relative to /boot/, eg.&lt;br /&gt;
#          root (hd0,0)&lt;br /&gt;
#          kernel /vmlinuz-version ro root=/dev/sda2&lt;br /&gt;
#          initrd /initrd-version.img&lt;br /&gt;
#boot=/dev/sda&lt;br /&gt;
default=1&lt;br /&gt;
timeout=5&lt;br /&gt;
splashimage=(hd0,0)/grub/splash.xpm.gz&lt;br /&gt;
hiddenmenu&lt;br /&gt;
title CentOS (2.6.18-238.9.3.el5)&lt;br /&gt;
	root (hd0,0)&lt;br /&gt;
	kernel /vmlinuz-2.6.18-238.9.3.el5 ro root=LABEL=/ dom0_mem=1024M&lt;br /&gt;
	initrd /initrd-2.6.18-238.9.3.el5.img&lt;br /&gt;
title CentOS (2.6.18-238.9.3.el5xen)&lt;br /&gt;
	root (hd0,0)&lt;br /&gt;
	kernel /xen.gz-2.6.18-238.9.3.el5&lt;br /&gt;
	module /vmlinuz-2.6.18-238.9.3.el5xen ro root=LABEL=/ dom0_mem=1024M&lt;br /&gt;
	module /initrd-2.6.18-238.9.3.el5xen.img&lt;br /&gt;
title CentOS (2.6.18-238.9.1.el5xen)&lt;br /&gt;
	root (hd0,0)&lt;br /&gt;
	kernel /xen.gz-2.6.18-238.9.1.el5&lt;br /&gt;
	module /vmlinuz-2.6.18-238.9.1.el5xen ro root=LABEL=/ dom0_mem=1024M&lt;br /&gt;
	module /initrd-2.6.18-238.9.1.el5xen.img&lt;br /&gt;
title CentOS (2.6.18-238.9.1.el5)&lt;br /&gt;
	root (hd0,0)&lt;br /&gt;
	kernel /vmlinuz-2.6.18-238.9.1.el5 ro root=LABEL=/ dom0_mem=1024M&lt;br /&gt;
	initrd /initrd-2.6.18-238.9.1.el5.img&lt;br /&gt;
title CentOS (2.6.18-238.el5xen)&lt;br /&gt;
	root (hd0,0)&lt;br /&gt;
	kernel /xen.gz-2.6.18-238.el5 &lt;br /&gt;
	module /vmlinuz-2.6.18-238.el5xen ro root=LABEL=/ rhgb quiet&lt;br /&gt;
	module /initrd-2.6.18-238.el5xen.img&lt;br /&gt;
title CentOS-base (2.6.18-238.el5)&lt;br /&gt;
	root (hd0,0)&lt;br /&gt;
	kernel /vmlinuz-2.6.18-238.el5 ro root=LABEL=/ rhgb quiet&lt;br /&gt;
	initrd /initrd-2.6.18-238.el5.img&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now reboot. When the nodes come back up, we should see the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xenbr0&amp;lt;/span&amp;gt; with an MTU of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;7200&amp;lt;/span&amp;gt;, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth1&amp;lt;/span&amp;gt; should have an MTU of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;9000&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xenbr2&amp;lt;/span&amp;gt; should also be at &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;9000&amp;lt;/span&amp;gt;. Note that we did not need to new kernel for &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth1&amp;lt;/span&amp;gt; as it&#039;s outside of Xen.&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;
          inet6 addr: fe80::4a5b:39ff:fe3c:5314/64 Scope:Link&lt;br /&gt;
          UP BROADCAST RUNNING MULTICAST  MTU:7200  Metric:1&lt;br /&gt;
          RX packets:263 errors:0 dropped:0 overruns:0 frame:0&lt;br /&gt;
          TX packets:164 errors:0 dropped:0 overruns:0 carrier:0&lt;br /&gt;
          collisions:0 txqueuelen:1000 &lt;br /&gt;
          RX bytes:46333 (45.2 KiB)  TX bytes:27403 (26.7 KiB)&lt;br /&gt;
          Interrupt:246 Base address:0xe000 &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:9000  Metric:1&lt;br /&gt;
          RX packets:122 errors:0 dropped:0 overruns:0 frame:0&lt;br /&gt;
          TX packets:49 errors:0 dropped:0 overruns:0 carrier:0&lt;br /&gt;
          collisions:0 txqueuelen:1000 &lt;br /&gt;
          RX bytes:25004 (24.4 KiB)  TX bytes:8658 (8.4 KiB)&lt;br /&gt;
          Interrupt:17 Memory:feae0000-feb00000 &lt;br /&gt;
&lt;br /&gt;
eth2      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 MULTICAST  MTU:9000  Metric:1&lt;br /&gt;
          RX packets:172 errors:0 dropped:0 overruns:0 frame:0&lt;br /&gt;
          TX packets:97 errors:0 dropped:0 overruns:0 carrier:0&lt;br /&gt;
          collisions:0 txqueuelen:1000 &lt;br /&gt;
          RX bytes:42769 (41.7 KiB)  TX bytes:28487 (27.8 KiB)&lt;br /&gt;
          Interrupt:16 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:10 errors:0 dropped:0 overruns:0 frame:0&lt;br /&gt;
          TX packets:10 errors:0 dropped:0 overruns:0 carrier:0&lt;br /&gt;
          collisions:0 txqueuelen:0 &lt;br /&gt;
          RX bytes:696 (696.0 b)  TX bytes:696 (696.0 b)&lt;br /&gt;
&lt;br /&gt;
xenbr0    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:7200  Metric:1&lt;br /&gt;
          RX packets:254 errors:0 dropped:0 overruns:0 frame:0&lt;br /&gt;
          TX packets:167 errors:0 dropped:0 overruns:0 carrier:0&lt;br /&gt;
          collisions:0 txqueuelen:0 &lt;br /&gt;
          RX bytes:41271 (40.3 KiB)  TX bytes:26870 (26.2 KiB)&lt;br /&gt;
&lt;br /&gt;
xenbr2    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:9000  Metric:1&lt;br /&gt;
          RX packets:153 errors:0 dropped:0 overruns:0 frame:0&lt;br /&gt;
          TX packets:88 errors:0 dropped:0 overruns:0 carrier:0&lt;br /&gt;
          collisions:0 txqueuelen:0 &lt;br /&gt;
          RX bytes:38585 (37.6 KiB)  TX bytes:24586 (24.0 KiB)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To test that the new MTU sizes are working, we can use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ping&amp;lt;/span&amp;gt; from the source node and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;tcpdump&amp;lt;/span&amp;gt; on the target node. This works because &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ping&amp;lt;/span&amp;gt; can define the size of the message and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;tcpdump&amp;lt;/span&amp;gt; will show how many packets were sent and returned.&lt;br /&gt;
&lt;br /&gt;
Let&#039;s test &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xenbr0&amp;lt;/span&amp;gt;, which we&#039;ve set to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;7200&amp;lt;/span&amp;gt;. To do this test, we&#039;ll first use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;tcpdump&amp;lt;/span&amp;gt; on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt; to listen to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth0&amp;lt;/span&amp;gt; for [[ICMP]] packets.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
tcpdump -i xenbr0 icmp&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode&lt;br /&gt;
listening on xenbr0, link-type EN10MB (Ethernet), capture size 96 bytes&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt;, we&#039;re going to send a single ping with a payload of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;7172&amp;lt;/span&amp;gt; bytes. This is because the ICMP packet has an overhead of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;28&amp;lt;/span&amp;gt; bytes. This means the full ping size will be &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;7200&amp;lt;/span&amp;gt; bytes total. This should result in the ping taking only one packet to and from the destination node.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ping -c 1 -s 7172 an-node05.ifn&lt;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-node05.ifn (192.168.1.75) 7172(7200) bytes of data.&lt;br /&gt;
7180 bytes from an-node05.ifn (192.168.1.75): icmp_seq=1 ttl=64 time=1.53 ms&lt;br /&gt;
&lt;br /&gt;
--- an-node05.ifn ping statistics ---&lt;br /&gt;
1 packets transmitted, 1 received, 0% packet loss, time 0ms&lt;br /&gt;
rtt min/avg/max/mdev = 1.534/1.534/1.534/0.000 ms&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Going back to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt;, we&#039;ll see that indeed the ping took just one packet for each direction of travel.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
23:02:14.045744 IP an-node04.ifn &amp;gt; an-node05.ifn: ICMP echo request, id 3859, seq 1, length 7180&lt;br /&gt;
23:02:14.046601 IP an-node05.ifn &amp;gt; an-node04.ifn: ICMP echo reply, id 3859, seq 1, length 7180&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If we try again, with a payload size of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;7173&amp;lt;/span&amp;gt; bytes, for a total of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;7201&amp;lt;/span&amp;gt; packet size, we&#039;ll see on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt; that two packets were needed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
23:07:18.091292 IP an-node04.ifn &amp;gt; an-node05.ifn: ICMP echo request, id 21779, seq 1, length 7181&lt;br /&gt;
23:07:18.092199 IP an-node05.ifn &amp;gt; an-node04.ifn: ICMP echo reply, id 21779, seq 1, length 7176&lt;br /&gt;
23:07:18.092242 IP an-node05.ifn &amp;gt; an-node04.ifn: icmp&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Perfect!&lt;br /&gt;
&lt;br /&gt;
== Renaming a Virtual Machine ==&lt;br /&gt;
&lt;br /&gt;
There may be times when you want to rename a VM domain. For example, if you provision a machine and then realize that you gave it a name that didn&#039;t describe it properly.&lt;br /&gt;
&lt;br /&gt;
Things to keep in mind before starting;&lt;br /&gt;
&lt;br /&gt;
* The new name of the VM &#039;&#039;&#039;must&#039;&#039;&#039; match the name of the definition file as well as the name of the VM service in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cluster.conf&amp;lt;/span&amp;gt;&lt;br /&gt;
* The VM will need to be shut down for the renaming process to succeed.&lt;br /&gt;
&lt;br /&gt;
At this time, the only way to rename a VM is:&lt;br /&gt;
&lt;br /&gt;
# Use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virsh dumpxml old_name &amp;gt; /xen_shared/definitions/new_name.xml&amp;lt;/span&amp;gt;.&lt;br /&gt;
# Shut down the VM with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virsh shutdown old_name&amp;lt;/span&amp;gt;.&lt;br /&gt;
# Edit the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/xen_shared/definitions/new_name.xml&amp;lt;/span&amp;gt; [[XML]] definition file and change &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;name&amp;gt;old_name&amp;lt;/name&amp;gt;&amp;lt;/span&amp;gt; to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;name&amp;gt;new_name&amp;lt;/name&amp;gt;&amp;lt;/span&amp;gt;.&lt;br /&gt;
# Undefine the VM using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virsh undefine old_name&amp;lt;/span&amp;gt; on all nodes.&lt;br /&gt;
# Redefine the VM using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virsh define /xen_shared/definitions/new_name.xml&amp;lt;/span&amp;gt; on all nodes.&lt;br /&gt;
# Update the cluster service name.&lt;br /&gt;
## Edit &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/cluster/cluster.conf&amp;lt;/span&amp;gt; and change &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;vm name=&amp;quot;old_name&amp;quot; ... /&amp;gt;&amp;lt;/span&amp;gt; to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;vm name=&amp;quot;new_name&amp;quot; ... /&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
## Increment the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;cluster ... config_version=&amp;quot;x&amp;quot;&amp;gt;&amp;lt;/span&amp;gt; attribute.&lt;br /&gt;
## Push the new cluster configuration using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ccs_tool update /etc/cluster/cluster.conf&amp;lt;/span&amp;gt;.&lt;br /&gt;
# Confirm that the new name is seen by both &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virsh list --all&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clustat&amp;lt;/span&amp;gt;.&lt;br /&gt;
# Start the VM back up.&lt;br /&gt;
&lt;br /&gt;
== Adding Space to a VM ==&lt;br /&gt;
&lt;br /&gt;
Here we will see what it takes to add a new 50 [[GiB]] LV to a VM as a second virtual hard drive.&lt;br /&gt;
&lt;br /&gt;
This process requires a few steps.&lt;br /&gt;
* Setting the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/drbd3&amp;lt;/span&amp;gt; resource as a new [[LVM]] [[PV]].&lt;br /&gt;
* Create a new [[VG]] called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;drbd_an4_vg1&amp;lt;/span&amp;gt;.&lt;br /&gt;
* Carve out a 50 [[GB]] [[LV]] called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0001_xvdb&amp;lt;/span&amp;gt;. &lt;br /&gt;
* Attach it to the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0001_ws1&amp;lt;/span&amp;gt;.&lt;br /&gt;
* Dumping the VM&#039;s updated configuration to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/xen_shared/definitions/vm0001_ws1.xml&amp;lt;/span&amp;gt;.&lt;br /&gt;
* Redefining the VM on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node05&amp;lt;/span&amp;gt; (assuming that it is currently running on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt;).&lt;br /&gt;
* Logging into the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0001_ws1&amp;lt;/span&amp;gt; VM, formatting the new space and adding the partition 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;
{{note|1=It is assumed that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0001_ws1&amp;lt;/span&amp;gt; is currently running on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt;. Unless stated otherwise, all the following commands should, thus, be run from &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node04&amp;lt;/span&amp;gt;.&amp;lt;br /&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
=== Creating a new PV, VG and LV ===&lt;br /&gt;
&lt;br /&gt;
Create the new [[PV]]:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
pvcreate /dev/drbd3 &lt;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/drbd3&amp;quot; successfully created&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Create the new [[VG]]:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vgcreate -c y --addtag @an-cluster01 drbd_an4_vg1 /dev/drbd3&lt;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;drbd_an4_vg1&amp;quot; successfully created&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Create the new [[LV]]:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
lvcreate -L 50G --addtag @an-cluster01 -n vm0001_xvdb /dev/drbd_an4_vg1&lt;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;vm0001_xvdb&amp;quot; created&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Attaching the new LV to the VM ===&lt;br /&gt;
&lt;br /&gt;
Attach the new LV to the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0001_ws1&amp;lt;/span&amp;gt; VM. This is done using the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virsh attach-disk&amp;lt;/span&amp;gt;. We&#039;ll tell &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virsh&amp;lt;/span&amp;gt; to attach the new LV and to create it as &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/xvdb&amp;lt;/span&amp;gt; within the VM.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
virsh attach-disk vm0001_ws1 /dev/drbd_an4_vg1/vm0001_xvdb xvdb&lt;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 attached successfully&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{note|1=Log in to the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0001_ws1&amp;lt;/span&amp;gt; VM and run the following commands there. Note that, in this tutorial, the VM&#039;s hostname has been changed to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0001_ws1&amp;lt;/span&amp;gt; and has been statically assigned to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;192.168.1.253&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;
ssh root@192.168.1.253&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
root@192.168.1.253&#039;s password: &lt;br /&gt;
Last login: Sun Apr  3 18:18:13 2011 from 192.168.1.102&lt;br /&gt;
[root@vm0001_ws1 ~]# &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Confirm that the new &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/xvdb&amp;lt;/span&amp;gt; device now exists.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
fdisk -l&lt;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/xvda: 10.7 GB, 10737418240 bytes&lt;br /&gt;
255 heads, 63 sectors/track, 1305 cylinders&lt;br /&gt;
Units = cylinders of 16065 * 512 = 8225280 bytes&lt;br /&gt;
&lt;br /&gt;
    Device Boot      Start         End      Blocks   Id  System&lt;br /&gt;
/dev/xvda1   *           1          33      265041   83  Linux&lt;br /&gt;
/dev/xvda2              34         164     1052257+  82  Linux swap / Solaris&lt;br /&gt;
/dev/xvda3             165        1305     9165082+  83  Linux&lt;br /&gt;
&lt;br /&gt;
Disk /dev/xvdb: 53.6 GB, 53687091200 bytes&lt;br /&gt;
255 heads, 63 sectors/track, 6527 cylinders&lt;br /&gt;
Units = cylinders of 16065 * 512 = 8225280 bytes&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Configuring the new Virtual Hard Drive in the VM ===&lt;br /&gt;
&lt;br /&gt;
From here on in, we&#039;ll be proceeding exactly the same as if we had added a real hard drive to a bare-iron server.&lt;br /&gt;
&lt;br /&gt;
Create a single partition out of the new space.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
fdisk /dev/xvdb&lt;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 contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel&lt;br /&gt;
Building a new DOS disklabel. Changes will remain in memory only,&lt;br /&gt;
until you decide to write them. After that, of course, the previous&lt;br /&gt;
content won&#039;t be recoverable.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The number of cylinders for this disk is set to 6527.&lt;br /&gt;
There is nothing wrong with that, but this is larger than 1024,&lt;br /&gt;
and could in certain setups cause problems with:&lt;br /&gt;
1) software that runs at boot time (e.g., old versions of LILO)&lt;br /&gt;
2) booting and partitioning software from other OSs&lt;br /&gt;
   (e.g., DOS FDISK, OS/2 FDISK)&lt;br /&gt;
Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)&lt;br /&gt;
&lt;br /&gt;
Command (m for help): n&lt;br /&gt;
Command action&lt;br /&gt;
   e   extended&lt;br /&gt;
   p   primary partition (1-4)&lt;br /&gt;
p&lt;br /&gt;
Partition number (1-4): 1&lt;br /&gt;
First cylinder (1-6527, default 1): &lt;br /&gt;
Using default value 1&lt;br /&gt;
Last cylinder or +size or +sizeM or +sizeK (1-6527, default 6527): &lt;br /&gt;
Using default value 6527&lt;br /&gt;
&lt;br /&gt;
Command (m for help): p&lt;br /&gt;
&lt;br /&gt;
Disk /dev/xvdb: 53.6 GB, 53687091200 bytes&lt;br /&gt;
255 heads, 63 sectors/track, 6527 cylinders&lt;br /&gt;
Units = cylinders of 16065 * 512 = 8225280 bytes&lt;br /&gt;
&lt;br /&gt;
    Device Boot      Start         End      Blocks   Id  System&lt;br /&gt;
/dev/xvdb1               1        6527    52428096   83  Linux&lt;br /&gt;
&lt;br /&gt;
Command (m for help): w&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;
Syncing disks.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{note|1=Unlike when we worked on the nodes, we do not need to reboot the VM to see the changes on the disk. This is not because it&#039;s a virtual server, but rather because the new virtual disk is not used by the OS.}}&lt;br /&gt;
&lt;br /&gt;
Now, format the new &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/xvdb1&amp;lt;/span&amp;gt; partition.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
mkfs.ext3 /dev/xvdb1 &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
mke2fs 1.39 (29-May-2006)&lt;br /&gt;
Filesystem label=&lt;br /&gt;
OS type: Linux&lt;br /&gt;
Block size=4096 (log=2)&lt;br /&gt;
Fragment size=4096 (log=2)&lt;br /&gt;
6553600 inodes, 13107024 blocks&lt;br /&gt;
655351 blocks (5.00%) reserved for the super user&lt;br /&gt;
First data block=0&lt;br /&gt;
Maximum filesystem blocks=4294967296&lt;br /&gt;
400 block groups&lt;br /&gt;
32768 blocks per group, 32768 fragments per group&lt;br /&gt;
16384 inodes per group&lt;br /&gt;
Superblock backups stored on blocks: &lt;br /&gt;
	32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208, &lt;br /&gt;
	4096000, 7962624, 11239424&lt;br /&gt;
&lt;br /&gt;
Writing inode tables: done                            &lt;br /&gt;
Creating journal (32768 blocks): done&lt;br /&gt;
Writing superblocks and filesystem accounting information: done&lt;br /&gt;
&lt;br /&gt;
This filesystem will be automatically checked every 32 mounts or&lt;br /&gt;
180 days, whichever comes first.  Use tune2fs -c or -i to override.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/var/www&amp;lt;/span&amp;gt; does not yet exist. If it doesn&#039;t, create it.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ls -lah /var/www&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
ls: /var/www: No such file or directory&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;
mkdir /var/www&lt;br /&gt;
ls -lah /var/www&lt;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 12K&lt;br /&gt;
drwxr-xr-x  2 root root 4.0K Apr  3 23:01 .&lt;br /&gt;
drwxr-xr-x 21 root root 4.0K Apr  3 23:01 ..&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Mount the newly formatted partition.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
mount /dev/xvdb1 /var/www/&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/xvda3            8.5G  2.0G  6.1G  25% /&lt;br /&gt;
/dev/xvda1            251M   25M  214M  11% /boot&lt;br /&gt;
tmpfs                 524M     0  524M   0% /dev/shm&lt;br /&gt;
/dev/xvdb1             50G  180M   47G   1% /var/www&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Add the new partition to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/fstab&amp;lt;/span&amp;gt; so that the partition mounts on boot.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
echo &amp;quot;/dev/xvdb1              /var/www                ext3    defaults        1 3&amp;quot; &amp;gt;&amp;gt; /etc/fstab&lt;br /&gt;
cat /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;
LABEL=/                 /                       ext3    defaults        1 1&lt;br /&gt;
LABEL=/boot             /boot                   ext3    defaults        1 2&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;
LABEL=SWAP-xvda2        swap                    swap    defaults        0 0&lt;br /&gt;
/dev/xvdb1              /var/www                ext3    defaults        1 3&lt;br /&gt;
&amp;lt;/source&amp;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 please don&#039;t pay it too much mind. They&#039;ll be happy to talk to you directly. :)&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 &#039;&#039;&#039;Lon Hohberger&#039;&#039;&#039;, lon at fedoraproject.org, for the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; help. He also provided some excellent feedback on the first release (see [https://alteeve.com/index.php?title=Red_Hat_Cluster_Service_2_Tutorial&amp;amp;action=historysubmit&amp;amp;diff=3456&amp;amp;oldid=3455 here])&lt;br /&gt;
* To [http://dk.linkedin.com/in/fabbione Fabio Massimo Di Nitto] for helping me get caught up with clustering and VMs on FC13.&lt;br /&gt;
&lt;br /&gt;
{{footer}}&lt;/div&gt;</summary>
		<author><name>Kiwi</name></author>
	</entry>
</feed>