<?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=RoyK</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=RoyK"/>
	<link rel="alternate" type="text/html" href="https://alteeve.com/w/Special:Contributions/RoyK"/>
	<updated>2026-06-28T19:05:24Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.42.3</generator>
	<entry>
		<id>https://alteeve.com/w/index.php?title=2-Node_Red_Hat_KVM_Cluster_Tutorial_-_Archive&amp;diff=4369</id>
		<title>2-Node Red Hat KVM Cluster Tutorial - Archive</title>
		<link rel="alternate" type="text/html" href="https://alteeve.com/w/index.php?title=2-Node_Red_Hat_KVM_Cluster_Tutorial_-_Archive&amp;diff=4369"/>
		<updated>2012-07-20T09:38:42Z</updated>

		<summary type="html">&lt;p&gt;RoyK: /* Concept; Fencing */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{howto_header}}&lt;br /&gt;
&lt;br /&gt;
{{note|1=This is the second edition of the original [[Red Hat Cluster Service 2 Tutorial]]. This version is updated to use the Red Hat Cluster Suite, Stable version 3. It replaces [[Xen]] in favour of [[KVM]] to stay in-line with [[Red Hat]]&#039;s supported configuration. It also uses [[corosync]], replacing [[openais]], as the core cluster communication stack.}}&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 [[KVM]] virtual machines using [[RHCS]] &amp;quot;stable 3&amp;quot; with [[DRBD]] and clustered [[LVM]] for synchronizing storage data. This is an updated version of the earlier [[Red Hat Cluster Service 2 Tutorial]] Tutorial. You will find much in common with that tutorial if you&#039;ve previously followed that document. Please don&#039;t skip large sections though. There are some differences that are subtle but important.&lt;br /&gt;
&lt;br /&gt;
Grab a coffee, 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 its complexities.&lt;br /&gt;
&lt;br /&gt;
== Technologies We Will Use ==&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;Red Hat Enterprise Linux 6&#039;&#039; ([[EL6]]); You can use  a derivative like [[CentOS]] v6.&lt;br /&gt;
* &#039;&#039;Red Hat Cluster Services&#039;&#039; &amp;quot;Stable&amp;quot; version 3. This describes the following core components:&lt;br /&gt;
** &#039;&#039;Corosync&#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;Clustered 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 [[KVM]] 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;KVM&#039;&#039;; [[Hypervisor]] that controls and supports virtual machines.&lt;br /&gt;
&lt;br /&gt;
== A Note on Hardware ==&lt;br /&gt;
&lt;br /&gt;
In this tutorial, I will make reference to specific hardware components and devices. I do this to share what devices and equipment I use, but I do not endorse any of the products named in this tutorial. I am in no way affiliated with any hardware vendor not do I receive any compensation or gifts from any company.&lt;br /&gt;
&lt;br /&gt;
== A Note on Patience ==&lt;br /&gt;
&lt;br /&gt;
When someone wants to become a pilot, they can&#039;t jump into a plane and try to take off. It&#039;s not that flying is inherently hard, but it requires a foundation of understanding. Clustering is the same in this regard; there are many different pieces that have to work together just to get off the ground. &lt;br /&gt;
&lt;br /&gt;
You &#039;&#039;&#039;must&#039;&#039;&#039; have patience.&lt;br /&gt;
&lt;br /&gt;
Like a pilot on their first flight, seeing a cluster come to life is a fantastic experience. Don&#039;t rush it! Do your homework and you&#039;ll be on your way before you know it.&lt;br /&gt;
&lt;br /&gt;
Coming back to earth:&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 analogue 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]] [[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 its 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. Browse 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 &#039;&#039;&#039;won&#039;t happen&#039;&#039;&#039;. If you rush, you will skip important points and &#039;&#039;&#039;you will fail&#039;&#039;&#039;. &lt;br /&gt;
&lt;br /&gt;
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 [[KVM]]-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 its 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 [[RHEL]] version 6.2, [[x86_64]] architecture. The KVM hypervisor will not run on [[i686]]. No testing was done on other [[EL6]] derivatives. That said, there is no reason to believe that this tutorial will not apply to any variant of EL6. As much as possible, the language will be distro-agnostic.&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;Fabimer Principle&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;corosync&amp;lt;/span&amp;gt;, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;dlm&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 many more smaller apps.&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;clvmd&amp;lt;/span&amp;gt;, &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;KVM&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 across &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;6&amp;lt;/span&amp;gt; interfaces bonded into pairs.&lt;br /&gt;
** The network infrastructure (Switches, routers, etc). We will be using two managed switches, adding 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*2))+2&amp;lt;/span&amp;gt;, the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;+2&amp;lt;/span&amp;gt; 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 proficient. 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))+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;
Clustering isn&#039;t like most applications or technologies. Most of us learn by taking something such as a configuration file, and tweaking it 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;
The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt; portion of the the cluster is the &#039;&#039;&#039;c&#039;&#039;&#039;luster &#039;&#039;&#039;man&#039;&#039;&#039;ager. In the 3.0 series used in [[EL6]], &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt; acts mainly as a [[quorum]] provider. That is, is adds up the votes from the cluster members and decides if there is a simple majority. If there is, the cluster is &amp;quot;quorate&amp;quot; and is allowed to provide cluster services. Newer versions of the Red Hat Cluster Suite found in [[Fedora]] will use a new quorum provider and &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;
Until it is removed, the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt; service will be used to start and stop all of the daemons needed to make the cluster operate.&lt;br /&gt;
&lt;br /&gt;
== Component; corosync ==&lt;br /&gt;
&lt;br /&gt;
Corosync is the heart of the cluster. Almost all other cluster compnents operate though this.&lt;br /&gt;
&lt;br /&gt;
In Red Hat clusters, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;corosync&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. It can be configured directly in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;corosync.conf&amp;lt;/span&amp;gt;, but given that we will be building an RHCS cluster, 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;corosync.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;
Corosync sends messages using [[multicast]] messaging by default. Recently, [[unicast]] support has been added, but due to network latency, it is only recommended for use with small clusters of two to four nodes. We will be using [[multicast]] in this tutorial.&lt;br /&gt;
&lt;br /&gt;
=== A Little History ===&lt;br /&gt;
&lt;br /&gt;
There were significant changes between [[RHCS]] the old version 2 and version 3 available on [[EL6]], which we are using.&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 provided &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 totem, cluster membership, messaging, and basic APIs for use by clustered applications, while the OpenAIS project became an optional add-on to corosync for users who want the full AIS API.&lt;br /&gt;
&lt;br /&gt;
You will see a lot of references to OpenAIS while searching the web for information on clustering. Understanding its 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 clustered services 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 is 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, when a cluster splits into two or more partitions, which ever group of machines has quorum can safely start clustered services knowing that no other lost nodes will try to do the same.&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 has been confirmed successful, the partition with quorum will begin accessing clustered resources, like shared filesystems.&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 its 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;
Many cluster operations, like 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;corosync&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 between members are ordered. Delivery, however, is not guaranteed. If a member misses messages, it is up to the member&#039;s application to decide what action to take.&lt;br /&gt;
&lt;br /&gt;
Let&#039;s look at two scenarios showing how locks are handled using CPG;&lt;br /&gt;
&lt;br /&gt;
* The cluster starts up cleanly with two members.&lt;br /&gt;
* Both members are able to start &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;service:foo&amp;lt;/span&amp;gt;.&lt;br /&gt;
* Both want to start it, but need a lock from [[DLM]] to do so.&lt;br /&gt;
** The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt; member has its totem token, and sends its request for the lock.&lt;br /&gt;
** DLM issues a lock for that service to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;.&lt;br /&gt;
** The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt; member requests a lock for the same service.&lt;br /&gt;
** DLM rejects the lock request.&lt;br /&gt;
* The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt; member successfully starts &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;service:foo&amp;lt;/span&amp;gt; and announces this to the CPG members.&lt;br /&gt;
* The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt; sees that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;service:foo&amp;lt;/span&amp;gt; is now running on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt; and no longer tries to start the service.&lt;br /&gt;
&lt;br /&gt;
* The two members want to write to a common area of the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/shared&amp;lt;/span&amp;gt; GFS2 partition.&lt;br /&gt;
** The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt; sends a request for a DLM lock against the FS, gets it.&lt;br /&gt;
** The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt; sends a request for the same lock, but DLM sees that a lock is pending and rejects the request.&lt;br /&gt;
** The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt; member finishes altering the file system, announces the changed over CPG and releases the lock.&lt;br /&gt;
** The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt; member updates its view of the filesystem, requests a lock, receives it and proceeds to update the filesystems.&lt;br /&gt;
** It completes the changes, annouces the changes over CPG and releases the lock.&lt;br /&gt;
&lt;br /&gt;
Messages can only be sent to the members of the CPG while the node has a totem tokem from corosync.&lt;br /&gt;
&lt;br /&gt;
== Concept; Fencing ==&lt;br /&gt;
&lt;br /&gt;
{{warning|1=DO NOT BUILD A CLUSTER WITHOUT PROPER, WORKING AND TESTED 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;
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 [[DLM]] locks are allowed to be issued. Anything using DLM, including &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&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;, are effectively hung. The hung node is detected using a totem token timeout. That is, if a token is not received from a node within a period of time, it is considered lost and a new token is sent. After a certain number of lost tokens, the cluster declares the node dead. The remaining nodes reconfigure into a new cluster and, if they have quorum (or if quorum is ignored), a fence call against the silent node is made.&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 succeeds.&lt;br /&gt;
&lt;br /&gt;
Here&#039;s the flow, in point form:&lt;br /&gt;
&lt;br /&gt;
* The totem token moves around the cluster members. As each member gets the token, it sends sequenced messages to the CPG members.&lt;br /&gt;
* The token is passed from one node to the next, in order and continuously during normal operation.&lt;br /&gt;
* Suddenly, one node stops responding.&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 and a replacement token is created.&lt;br /&gt;
** The silent node responds before the failure counter reaches the limit.&lt;br /&gt;
*** The failure 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 token 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;corosync&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;
**** The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fenced&amp;lt;/span&amp;gt; daemon notifies [[DLM]] and locks are blocked.&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 effectively 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, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fenced&amp;lt;/span&amp;gt; notifies DLM and lost locks are recovered.&lt;br /&gt;
**** [[GFS2]] partitions recover using their journal.&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, minus the lost node.&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 remain hung until a human can intervene.&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;corosync&amp;lt;/span&amp;gt;. A token is passed around all the nodes in the cluster, and nodes can only send messages while they have the token. A node will keep its messages in memory until it gets the token back with no &amp;quot;not ack&amp;quot; messages. This way, if a node missed a message, it can request it be resent when it gets its token. If a node isn&#039;t up, it will simply miss the messages.&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;. The RRP is being re-introduced in RHCS version 3. Its use is experimental and should only be used with plenty of testing.&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;corosync&amp;lt;/span&amp;gt; tells the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; that it needs to recheck its services. 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;
The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; daemon runs separately from the cluster manager, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt;. This means that, to fully start the cluster, we need to start both &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt; and then &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt;.&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 Cluster 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 traditional [[SAN]] 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 cluster&#039;s storage. &lt;br /&gt;
&lt;br /&gt;
This shows;&lt;br /&gt;
* Each node having four physical disks tied together in a [[RAID_level_5#Level_5|RAID Level 5]] array and presented to the Node&#039;s OS as a single drive which is found at &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/sda&amp;lt;/span&amp;gt;.&lt;br /&gt;
* Each node&#039;s OS uses three primary partitions for &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/boot&amp;lt;/span&amp;gt;, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;swap&amp;gt;&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/&amp;lt;/span&amp;gt;.&lt;br /&gt;
* Three extended partitions are created;&lt;br /&gt;
** &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/sda5&amp;lt;/span&amp;gt; backs a small partition used as a [[GFS2]]-formatted shared mount point.&lt;br /&gt;
** &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/sda6&amp;lt;/span&amp;gt; backs the [[VM]]s designed to run primarily on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&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; backs the [[VM]]s designed to run primarily on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt;.&lt;br /&gt;
* All three extended partitions are combined using DRBD to create three DRBD resources;&lt;br /&gt;
** &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/drbd0&amp;lt;/span&amp;gt; is backed by &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/drbd1&amp;lt;/span&amp;gt; is backed by &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/drbd2&amp;lt;/span&amp;gt; is backed by &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/sda7&amp;lt;/span&amp;gt;.&lt;br /&gt;
* All three DRBD resources are managed by clustered LVM.&lt;br /&gt;
* The GFS2-formatted [[LV]] is mounted on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/shared&amp;lt;/span&amp;gt; on both nodes.&lt;br /&gt;
* Each [[VM]] gets its own [[LV]].&lt;br /&gt;
* All three DRBD resources sync over the [[Storage Network]], which uses the bonded &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;bond1&amp;lt;/span&amp;gt; (backed be &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;eth4&amp;lt;/span&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
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;
 _________________________________________________                 _________________________________________________ &lt;br /&gt;
| [ an-node01 ]                                   |               |                                   [ an-node02 ] |&lt;br /&gt;
|  ________       __________                      |               |                      __________       ________  |&lt;br /&gt;
| [_disk_1_]--+--[_/dev/sda_]                     |               |                     [_/dev/sda_]--+--[_disk_1_] |&lt;br /&gt;
|  ________   |    |   ___________    _______     |               |     _______    ___________   |    |   ________  |&lt;br /&gt;
| [_disk_2_]--+    +--[_/dev/sda1_]--[_/boot_]    |               |    [_/boot_]--[_/dev/sda1_]--+    +--[_disk_2_] |&lt;br /&gt;
|  ________   |    |   ___________    ________    |               |    ________    ___________   |    |   ________  |&lt;br /&gt;
| [_disk_3_]--+    +--[_/dev/sda2_]--[_&amp;lt;swap&amp;gt;_]   |               |   [_&amp;lt;swap&amp;gt;_]--[_/dev/sda2_]--+    +--[_disk_3_] |&lt;br /&gt;
|  ________   |    |   ___________    ___         |               |         ___    ___________   |    |   ________  |&lt;br /&gt;
| [_disk_4_]--/    +--[_/dev/sda3_]--[_/_]        |               |        [_/_]--[_/dev/sda3_]--+    \--[_disk_4_] |&lt;br /&gt;
|                  |   ___________                |               |                ___________   |                  |&lt;br /&gt;
|                  +--[_/dev/sda5_]------------\  |               |  /------------[_/dev/sda5_]--+                  |&lt;br /&gt;
|                  |   ___________             |  |               |  |             ___________   |                  |&lt;br /&gt;
|                  +--[_/dev/sda6_]----------\ |  |               |  | /----------[_/dev/sda6_]--+                  |&lt;br /&gt;
|                  |   ___________           | |  |               |  | |           ___________   |                  |&lt;br /&gt;
|                  \--[_/dev/sda7_]--------\ | |  |               |  | | /--------[_/dev/sda7_]--/                  |&lt;br /&gt;
|        _______________    ____________   | | |  |               |  | | |   ____________    _______________        |&lt;br /&gt;
|    /--[_Clustered_LVM_]--[_/dev/drbd2_]--/ | |  |               |  | | \--[_/dev/drbd2_]--[_Clustered_LVM_]--\    |&lt;br /&gt;
|   _|__                     |   _______     | |  |               |  | |      |   _______                    __|_   |&lt;br /&gt;
|  [_PV_]                    \--{_bond1_}    | |  |               |  | |      \--{_bond1_}                  [_PV_]  |&lt;br /&gt;
|   _|________                               | |  |               |  | |                               ________|_   |&lt;br /&gt;
|  [_an02-vg0_]                              | |  |               |  | |                              [_an02-vg0_]  |&lt;br /&gt;
|    |   ________________________    ....... | |  |               |  | |  _____     ________________________   |    |&lt;br /&gt;
|    +--[_/dev/an02-vg0/vm0003_1_]---:.vm3.: | |  |               |  | | [_vm3_]---[_/dev/an02-vg0/vm0003_1_]--+    |&lt;br /&gt;
|    |   ________________________    ....... | |  |               |  | |  _____     ________________________   |    |&lt;br /&gt;
|    \--[_/dev/an02-vg0/vm0004_1_]---:.vm4.: | |  |               |  | | [_vm4_]---[_/dev/an02-vg0/vm0004_1_]--/    |&lt;br /&gt;
|          _______________    ____________   | |  |               |  | |   ____________    _______________          |&lt;br /&gt;
|      /--[_Clustered_LVM_]--[_/dev/drbd1_]--/ |  |               |  | \--[_/dev/drbd1_]--[_Clustered_LVM_]--\      |&lt;br /&gt;
|     _|__                     |   _______     |  |               |  |      |   _______                    __|_     |&lt;br /&gt;
|    [_PV_]                    \--{_bond1_}    |  |               |  |      \--{_bond1_}                  [_PV_]    |&lt;br /&gt;
|     _|________                               |  |               |  |                               ________|_     |&lt;br /&gt;
|    [_an01-vg0_]                              |  |               |  |                              [_an01-vg0_]    |&lt;br /&gt;
|      |   ________________________     _____  |  |               |  | .......    ________________________   |      |&lt;br /&gt;
|      +--[_/dev/an01-vg0/vm0001_1_]---[_vm1_] |  |               |  | :.vm1.:---[_/dev/an02-vg0/vm0001_1_]--+      |&lt;br /&gt;
|      |   ________________________     _____  |  |               |  | .......    ________________________   |      |&lt;br /&gt;
|      \--[_/dev/an01-vg0/vm0002_1_]---[_vm2_] |  |               |  | :.vm2.:---[_/dev/an02-vg0/vm0002_1_]--/      |&lt;br /&gt;
|            _______________    ____________   |  |               |  |   ____________    _______________            |&lt;br /&gt;
|        /--[_Clustered_LVM_]--[_/dev/drbd0_]--/  |               |  \--[_/dev/drbd0_]--[_Clustered_LVM_]--\        |&lt;br /&gt;
|       _|__                     |   _______      |               |       |   _______                    __|_       |&lt;br /&gt;
|      [_PV_]                    \--{_bond1_}     |               |       \--{_bond1_}                  [_PV_]      |&lt;br /&gt;
|       _|__________                              |               |                              __________|_       |&lt;br /&gt;
|      [_shared-vg0_]                             |               |                             [_shared-vg0_]      |&lt;br /&gt;
|       _|_________________________               |               |               _________________________|_       |&lt;br /&gt;
|      [_/dev/shared-vg0/lv_shared_]              |               |              [_/dev/shared-vg0/lv_shared_]      |&lt;br /&gt;
|        |   ______    _________                  |               |                  _________    ______   |        |&lt;br /&gt;
|        \--[_GFS2_]--[_/shared_]                 |               |                 [_/shared_]--[_GFS2_]--/        |&lt;br /&gt;
|                                          _______|   _________   |_______                                          |&lt;br /&gt;
|                                         | bond1 =--| Storage |--= bond1 |                                         |&lt;br /&gt;
|                                         |______||  | Network |  ||______|                                         |&lt;br /&gt;
|_________________________________________________|  |_________|  |_________________________________________________|&lt;br /&gt;
.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Component; Clustered LVM ==&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;corosync&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 [[KVM]]&#039;s virtual machine guests 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 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 [[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;
{{note|1=GFS2 is &#039;&#039;&#039;only&#039;&#039;&#039; supported when run on top of Clustered LVM [[LV]]s. This is because, in certain error states, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;gfs2_controld&amp;lt;/span&amp;gt; will call &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;dmsetup&amp;lt;/span&amp;gt; to disconnect the GFS2 partition from its storage in certain failure states.}}&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]] for clustered storage and resource management.&lt;br /&gt;
&lt;br /&gt;
Whenever a resource, GFS2 filesystem or clustered LVM LV needs a lock, it sends a request to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;dlm_controld&amp;lt;/span&amp;gt; which runs in userspace. This communicates with DLM in kernel. If the lockspace does not yet exist, DLM will create it and then give the lock to the requester. Should a subsequant lock request come in for the same lockspace, it will be rejected. Once the application using the lock is finished with it, it will release the lock. After this, another node may request and receive a lock for the lockspace.&lt;br /&gt;
&lt;br /&gt;
If a node fails, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fenced&amp;lt;/span&amp;gt; will alert &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;dlm_controld&amp;lt;/span&amp;gt; that a fence is pending and new lock requests will block. After a successful fence, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fenced&amp;lt;/span&amp;gt; will alert DLM that the node is gone and any locks the victim node held are released. At this time, other nodes may request a lock on the lockspaces the lost node held and can perform recovery, like replaying a GFS2 filesystem journal, prior to resuming normal operation.&lt;br /&gt;
&lt;br /&gt;
Note that DLM locks are not used for actually locking the file system. That job is still handled by &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;plock()&amp;lt;/span&amp;gt; calls ([[POSIX]] locks).&lt;br /&gt;
&lt;br /&gt;
== Component; KVM ==&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 KVM [[hypervisor]] within which our highly-available virtual machine guests will reside. It is a type-1 hypervisor, which means that the host operating system runs directly on the bare hardware. Contrasted against Xen, which is a type-2 hypervisor where even the installed OS is itself just another virtual machine.&lt;br /&gt;
&lt;br /&gt;
= Node Installation =&lt;br /&gt;
&lt;br /&gt;
This section is going to be intentionally vague, as I don&#039;t want to influence too heavily what hardware you buy or how you install your operating systems. However, we need a baseline, a minimum system requirement of sorts. Also, I will refer fairly frequently to my setup, so I will share with you the details of what I bought. Please don&#039;t take this as an endorsement though... Every cluster will have its own needs, and you should plan and purchase for your particular needs.&lt;br /&gt;
&lt;br /&gt;
In my case, my goal was to have a low-power consumption setup and I knew that I would never put my cluster into production as it&#039;s strictly a research and design cluster. As such, I can afford to be quite modest.&lt;br /&gt;
&lt;br /&gt;
== Minimum Requirements ==&lt;br /&gt;
&lt;br /&gt;
This will cover two sections;&lt;br /&gt;
&lt;br /&gt;
* Node Minimum requirements&lt;br /&gt;
* Infrastructure requirements&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;nodes&#039;&#039;&#039; are the two separate servers that will, together, form the base of our cluster. The infrastructure covers the networking and the switched power bars called a &#039;&#039;&#039;[[PDU]]s&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
=== Node Requirements ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;General&#039;&#039;;&lt;br /&gt;
&lt;br /&gt;
As these nodes will host virtual machines, then will need sufficient [[RAM]] and provide [http://en.wikipedia.org/wiki/AMD-V#AMD_virtualization_.28AMD-V.29 virtualization-enabled] [[CPU]]s. Most, though not all, modern processors support hardware virtualization extensions. Finally, you need to have sufficient network bandwidth across two independent links to support the maximum burst storage traffic plus enough headroom to ensure that cluster traffic is never interrupted.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Network&#039;&#039;;&lt;br /&gt;
&lt;br /&gt;
This tutorial will use three independent networks, each using two physical interfaces in a bonded configuration. These will route through two separate managed switches for high-availability networking. Each network will be dedicated to a given traffic type. This requires six interfaces and, with a separate [[IPMI]] interface, consumes a staggering seven ports per node. &lt;br /&gt;
&lt;br /&gt;
Understanding that this may not be feasible, you can drop this to just two connections in a single bonded interface. If you decide to do this, you will need to configure [[QoS]] to ensure that [[totem]] [[multicast]] traffic gets highest priority as a delay of less than one second can cause the cluster to break. You also need to test sustained, heavy disk traffic to ensure that it doesn&#039;t cause problems. In particular, run storage tests from a virtual machine and then live-migrate that machine to create a &amp;quot;worst case&amp;quot; network load. If that succeeds, you are probably safe. All of this is outside of this tutorial&#039;s scope though.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Power&#039;&#039;;&lt;br /&gt;
&lt;br /&gt;
In production, you will want to use servers which have redundant power supplies and ensure that either side of the power connects to two separate power sources.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Out-of-Band Management&#039;&#039;;&lt;br /&gt;
&lt;br /&gt;
As we will discuss later, the ideal method of fencing a node is to use [[IPMI]] or one of the vendor-specific variants like HP&#039;s [[iLO]], Dell&#039;s [[DRAC]] or IBM&#039;s [[RSA]]. This allows another node in the cluster to force the host node to power off, regardless of the state of the operating system. Critically, it can confirm to the caller once the node has been shut down, which allows for the cluster to safely and confidently recover lost services.&lt;br /&gt;
&lt;br /&gt;
The two nodes used to create this tutorial have the following hardware (again, these will never see production use, so I could afford to go low);&lt;br /&gt;
* 1x Tyan [http://www.tyan.com/product_SKU_spec.aspx?ProductType=MB&amp;amp;pid=698&amp;amp;SKU=600000217 S5510GM3NR] Mainboard (note that the &#039;-LE&#039; has no IPMI)&lt;br /&gt;
* 1x Intel [http://ark.intel.com/products/52269?wapkw=%28E3-1220%29 Xeon E3-1220] CPU&lt;br /&gt;
* 2x Kingston [http://www.ec.kingston.com/ecom/configurator_new/partsinfo.asp?root=&amp;amp;LinkBack=&amp;amp;ktcpartno=KVR1333D3E9S/4GHB KVR1333D3E9S/4GHB] DDR3 ECC DIMMs&lt;br /&gt;
* 3x Intel [http://www.intel.com/products/desktop/adapters/gigabit-ct/gigabit-ct-overview.htm Gigabit CT] PCIe Ethernet adapters&lt;br /&gt;
&lt;br /&gt;
=== Infrastructure Requirements ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Network&#039;&#039;;&lt;br /&gt;
&lt;br /&gt;
You will need two separate switches in order to provide High Availability. These do not need to be stacked or even managed, but you do need to consider their actual capabilities and disregard the stated capacity. What I mean by this, in essence, is that not all gigabit equipment is equal. You will need to calculate how much bandwidth (in raw data throughput and as packets-per-second) and confirm that the switch can sustain that load. Most switches will rate these two values as their switching fabric capacity, so be sure to look closely at the specifications.&lt;br /&gt;
&lt;br /&gt;
Another thing to consider is whether you wish to run at an [[MTU]] higher that 1500 [[bytes]] per packet. This is generally referred to in specification sheets as &amp;quot;jumbo frame&amp;quot; support. However, many lesser companies will advertise support for jumbo frames, but they only support up to 4 [[KiB]]. Most professional networks looking to implement large MTU sizes aim for 9 [[KiB]] frame sizes, so be sure to look at the actual size of the largest supported jumbo frame before purchasing network equipment.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Power&#039;&#039;;&lt;br /&gt;
&lt;br /&gt;
As we will discuss later, we need a backup fence device. This will be implemented using a specific brand and model of switched power distribution unit, called a [[PDU]] which is effectively a power bar whose outlets can be independently turned on and off over the network. This tutorial uses an [ APC AP7900] PDU, but many others are available. Should you choose to use another make or model, you &#039;&#039;&#039;must&#039;&#039;&#039; first ensure that it has a supported [http://git.fedorahosted.org/git/?p=fence-agents.git;a=tree;f=fence/agents;hb=HEAD fence agent]. Ensuring this is an exercise for the reader.&lt;br /&gt;
&lt;br /&gt;
In production environments, it is ideal to have each PDU backed by its own [[UPS]], and each UPS connected to a separate mains electrical circuit. This way, the failure of a given PDU, UPS or mains circuit will not cause an interruption to the cluster. Do be sure to plan your power infrastructure to supply enough power to drive the entire cluster at full load in a failed state. That is, more plainly, don&#039;t divide the total load in two when planning your infrastructure. You must always plan for a failed state!&lt;br /&gt;
&lt;br /&gt;
Hardware used in this tutorial are;&lt;br /&gt;
* 2x D-Link [http://dlink.ca/products/?pid=DGS-3100-24 DGS-3100-24] 24-port Gbit switches supporting 10 [[KiB]] jumbo frames.&lt;br /&gt;
* 1x APC [http://www.apc.com/products/resource/include/techspec_index.cfm?base_sku=AP7900 AP7900] switched PDU (supported by the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[http://git.fedorahosted.org/git/?p=fence-agents.git;a=tree;f=fence/agents/apc_snmp;hb=HEAD fence_apc_snmp]&amp;lt;/span&amp;gt; fence agent).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Two Notes&#039;&#039;;&lt;br /&gt;
&lt;br /&gt;
# The D-Link switch I use is being phased out and is being replaced by the [http://dlink.ca/products/?pid=DGS-3120-24TC DGS-3120-24TC] models. The DGS-3120 models are much improved over the DGS-3100 series and can be safely used in stacked configuration (thus enabling the use of [[VLAN]] [[LAG]]s). The DGS-3100 would interrupt traffic when a switch in the stack recovered, which would partition the cluster. This forced me to unstack the switches in this tutorial.&lt;br /&gt;
# Given my budget, I could not afford to purchase redundant power supplies for use in this tutorial. As such, my test cluster has the power as a single point of failure. For learning, this is fine, but it is strongly ill-advised in production. I do show an example configuration of redundant [[PSU]] use spread across separate PDUs from a production cluster.&lt;br /&gt;
&lt;br /&gt;
== Pre-Installation Planning ==&lt;br /&gt;
&lt;br /&gt;
Before you assemble your servers, it is highly advised to first record the [[MAC]] addresses of the NICs. I always write a little file called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;node&amp;gt;-nics.txt&amp;lt;/span&amp;gt; matched to the device name I plan to set it to.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim ~/an-node01-nics.txt&lt;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	00:E0:81:C7:EC:49	# Back-Channel Network - Link 1&lt;br /&gt;
eth1	00:E0:81:C7:EC:48	# Storage Network - Link 1&lt;br /&gt;
eth2	00:E0:81:C7:EC:47	# Internet-Facing Network - Link 1&lt;br /&gt;
eth3	00:1B:21:9D:59:FC	# Back-Channel Network - Link 2&lt;br /&gt;
eth4	00:1B:21:BF:70:02	# Storage Network - Link 2&lt;br /&gt;
eth5	00:1B:21:BF:6F:FE	# Back-Channel Network - Link 2&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
How, or even if you record this is entirely up to you.&lt;br /&gt;
&lt;br /&gt;
== OS Installation ==&lt;br /&gt;
&lt;br /&gt;
{{warning|1=[[EL6]].1 shipped with a version of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[corosync]]&amp;lt;/span&amp;gt; that had a token retransmit bug. On slower systems, there would be a form of race condition which would cause &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[totem]]&amp;lt;/span&amp;gt; tokens the be retransmitted and cause significant performance problems. This has been resolved in [[EL6]].2 so please be sure to upgrade.}}&lt;br /&gt;
&lt;br /&gt;
Beyond being based on [[RHEL]] 6, there are no requirements for how the operating system is installed. This tutorial is written using &amp;quot;minimal&amp;quot; installs, and as such, installation instructions will be provided that will install all needed packages if they aren&#039;t already installed on your nodes.&lt;br /&gt;
&lt;br /&gt;
A few notes about the installation used for this tutorial;&lt;br /&gt;
* [[RHCS]] stable 3 supports &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[selinux]]&amp;lt;/span&amp;gt;, but it is disabled in this tutorial.&lt;br /&gt;
* Both &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; firewalls are disabled.&lt;br /&gt;
&lt;br /&gt;
Obviously, this significantly reduces the security of your nodes. For learning, which is the goal here, this helps keep a focus on the clustering and simplifies debugging when things go wrong. In production clusters though, these steps are ill advised. It is strongly suggested that you enable first the firewall, then when that is working, enabling &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;selinux&amp;lt;/span&amp;gt;. Leaving &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;selinux&amp;lt;/span&amp;gt; for last is intentional, as it generally takes the most work to get right.&lt;br /&gt;
&lt;br /&gt;
=== Network Security ===&lt;br /&gt;
&lt;br /&gt;
When building production clusters, you will want to consider two options with regard to network security.&lt;br /&gt;
&lt;br /&gt;
First, the interfaces connected to an untrusted network, like the Internet, should not have an IP address, though the interfaces themselves will need to be up so that virtual machines can route through them to the outside world. Alternatively, anything inbound from the virtual machines or inbound from the untrusted network should be &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;DROP&amp;lt;/span&amp;gt;ed by the firewall.&lt;br /&gt;
&lt;br /&gt;
Second, if you can not run the cluster communications or storage traffic on dedicated network connections over isolated subnets, you will need to configure the firewall to block everything except the ports needed by storage and cluster traffic. The default ports are below.&lt;br /&gt;
&lt;br /&gt;
* [http://docs.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/6/html-single/Cluster_Administration/index.html#s1-iptables_firewall-CA RHEL 6 Cluster Configuration, Firewall Setup]&lt;br /&gt;
* [http://docs.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/6/html-single/Cluster_Administration/index.html#s1-iptables_firewall-CA Linbit&#039;s DRBD, Firewall Configuration]&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
!Component&lt;br /&gt;
!Protocol&lt;br /&gt;
!Port&lt;br /&gt;
!Note&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[dlm]]&amp;lt;/span&amp;gt;&lt;br /&gt;
|[[TCP]]&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;21064&amp;lt;/span&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[drbd]]&amp;lt;/span&amp;gt;&lt;br /&gt;
|[[TCP]]&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;7788&amp;lt;/span&amp;gt;+&lt;br /&gt;
|Each [[DRBD]] resource will use an additional port, generally counting up (ie: &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;r0&amp;lt;/span&amp;gt; will use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;7788&amp;lt;/span&amp;gt;, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;r1&amp;lt;/span&amp;gt; will use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;7789&amp;lt;/span&amp;gt;, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;r2&amp;lt;/span&amp;gt; will use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;7790&amp;lt;/span&amp;gt; and so on).&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[luci]]&amp;lt;/span&amp;gt;&lt;br /&gt;
|[[TCP]]&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;8084&amp;lt;/span&amp;gt;&lt;br /&gt;
|Optional web-based configuration tool, not used in this tutorial.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[modclusterd]]&amp;lt;/span&amp;gt;&lt;br /&gt;
|[[TCP]]&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;16851&amp;lt;/span&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[ricci]]&amp;lt;/span&amp;gt;&lt;br /&gt;
|[[TCP]]&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;11111&amp;lt;/span&amp;gt;&lt;br /&gt;
|Each [[DRBD]] resource will use an additional port, generally counting up (ie: &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;r1&amp;lt;/span&amp;gt; will use &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;r2&amp;lt;/span&amp;gt; will use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;7791&amp;lt;/span&amp;gt; and so on).&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[totem]]&amp;lt;/span&amp;gt;&lt;br /&gt;
|[[UDP]]/[[multicast]]&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;
|Uses a multicast group for cluster communications&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{{note|1=As of [[EL6]].2, you can now use [[unicast]] for totem communication instead of multicast. This is &#039;&#039;&#039;not&#039;&#039;&#039; advised, and should only be used for clusters of two or three nodes on networks where unresolvable [[multicast]] issues exist. If using [[gfs2]], as we do here, using unicast for totem is strongly discouraged.}}&lt;br /&gt;
&lt;br /&gt;
As mentioned above, we will disable &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;selinux&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;iptables&amp;lt;/span&amp;gt;. This is to simplify the learning process and both should be enable pre-production.&lt;br /&gt;
&lt;br /&gt;
To disable the firewall (not that I disable both &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;
&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;
To disable &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;selinux&amp;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/selinux/config /etc/selinux/config.orig&lt;br /&gt;
vim /etc/selinux/config&lt;br /&gt;
diff -u /etc/selinux/config.orig /etc/selinux/config&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/selinux/config.orig	2012-06-15 18:13:12.416646749 -0400&lt;br /&gt;
+++ /etc/selinux/config	2012-06-15 18:09:46.920938956 -0400&lt;br /&gt;
@@ -4,7 +4,7 @@&lt;br /&gt;
 #     enforcing - SELinux security policy is enforced.&lt;br /&gt;
 #     permissive - SELinux prints warnings instead of enforcing.&lt;br /&gt;
 #     disabled - No SELinux policy is loaded.&lt;br /&gt;
-SELINUX=enforcing&lt;br /&gt;
+SELINUX=disabled&lt;br /&gt;
 # SELINUXTYPE= can take one of these two values:&lt;br /&gt;
 #     targeted - Targeted processes are protected,&lt;br /&gt;
 #     mls - Multi Level Security protection.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You &#039;&#039;&#039;must&#039;&#039;&#039; reboot for the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;selinux&amp;lt;/span&amp;gt; changes to take effect.&lt;br /&gt;
&lt;br /&gt;
= Network =&lt;br /&gt;
&lt;br /&gt;
Before we begin, let&#039;s take a look at a block diagram of what we&#039;re going to build. This will help when trying to see what we&#039;ll be talking about.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
                                                           ______________                                                         &lt;br /&gt;
                                                          [___Internet___]                                                        &lt;br /&gt;
  _____________________________________________________          |          _____________________________________________________ &lt;br /&gt;
 | [ an-node01 ]                                       |         |         |                                       [ an-node02 ] |&lt;br /&gt;
 |                       ____________    ______________|     ____|____     |______________    ____________                       |&lt;br /&gt;
 |                      |    vbr2    |--| bond2        |    | [ IFN ] |    |        bond2 |--|   vbr2     |                      |&lt;br /&gt;
 |  _________________   | 10.255.0.1 |  | ______       |   _|_________|_   |       ______ |  | 10.255.0.2 |  ................... |&lt;br /&gt;
 | | [ vm0001-dev ]  |  |____________|  || eth2 =--\   |  |   Switch 1  |  |   /--= eth2 ||  |____________|  :  [ vm0001-dev ] : |&lt;br /&gt;
 | | [ Dev Server ]  |    | | : :       ||_____|    \--=--|_____________|--=--/    |_____||       | | : :    :  [ Dev Server ] : |&lt;br /&gt;
 | |           ______|    | | : :       | ______    /--=--|   Switch 2  |--=--\    ______ |       | | : :    :.......          : |&lt;br /&gt;
 | |          | eth0 =----/ | : :       || eth5 =--/   |  |_____________|  |   \--= eth5 ||       | | : :----= eth0 :          : |&lt;br /&gt;
 | |          |_____||      | : :       ||_____|       |                   |       |_____||       | | :      ::.....:          : |&lt;br /&gt;
 | |      10.254.0.1 |      | : :       |______________|                   |______________|       | | :      :                 : |&lt;br /&gt;
 | |_________________|      | : :        ______________|                   |______________        | | :      :.................: |&lt;br /&gt;
 |                          | : :       | bond1        |     _________     |        bond1 |       | | :                          |&lt;br /&gt;
 |  _________________       | : :       |   10.10.0.1  |    | [ SN  ] |    | 10.10.0.2    |       | | :      ................... |&lt;br /&gt;
 | | [ vm0002-web ]  |      | : :       | ______       |   _|_________|_   |       ______ |       | | :      :  [ vm0002-web ] : |&lt;br /&gt;
 | | [ Web Server ]  |      | : :       || eth1 =--\   |  |   Switch 1  |  |   /--= eth1 ||       | | :      :  [ Web Server ] : |&lt;br /&gt;
 | |           ______|      | : :       ||_____|    \--=--|_____________|--=--/    |_____||       | | :      :.......          : |&lt;br /&gt;
 | |          | eth0 =------/ : :       | ______    /--=--|   Switch 2  |--=--\    ______ |       | | :------= eth0 :          : |&lt;br /&gt;
 | |          |_____||        : :       || eth4 =--/   |  |_____________|  |   \--= eth4 ||       | |        ::.....:          : |&lt;br /&gt;
 | |      10.254.0.2 |        : :       ||_____|       |                   |       |_____||       | |        :                 : |&lt;br /&gt;
 | |_________________|        : :       |______________|                   |______________|       | |        :.................: |&lt;br /&gt;
 |                            : :        ______________|                   |______________        | |                            |&lt;br /&gt;
 | ...................        : :       | bond0        |     _________     |        bond0 |       | |         _________________  |&lt;br /&gt;
 | : [ vm0003-db  ]  :        : :       |   10.20.0.1  |    | [ BCN ] |    | 10.20.0.2    |       | |        |  [ vm0003-db  ] | |&lt;br /&gt;
 | : [ DB Server  ]  :        : :       | ______       |   _|_________|_   |       ______ |       | |        |  [ DB Server  ] | |&lt;br /&gt;
 | :          .......:        : :       || eth0 =--\   |  |   Switch 1  |  |   /--= eth0 ||       | |        |______           | |&lt;br /&gt;
 | :          : eth0 =--------: :       ||_____|    \--=--|_____________|--=--/    |_____||       | \--------= eth0 |          | |&lt;br /&gt;
 | :          :.....::          :       | ______    /--=--|   Switch 2  |--=--\    ______ |       |          ||_____|          | |&lt;br /&gt;
 | :                 :          :       || eth3 =--/   |  |_____________|  |   \--= eth3 ||       |          | 10.254.0.3      | |&lt;br /&gt;
 | :.................:          :       ||_____|       |    | |     | |    |       |_____||       |          |_________________| |&lt;br /&gt;
 |                              :       |______________|    | |     | |    |______________|       |                              |&lt;br /&gt;
 | ...................          :                      |    | |     | |    |                      |           _________________  |&lt;br /&gt;
 | : [ vm0004-win ]  :          :                      |    | |     | |    |                      |          |  [ vm0004-win ] | |&lt;br /&gt;
 | : [ MS Server  ]  :          :                      |    | |     | |    |                      |          |  [ MS Server  ] | |&lt;br /&gt;
 | :          .......:          :                      |    | |     | |    |                      |          |______           | |&lt;br /&gt;
 | :          : NIC0 =----------:                      |    | |     | |    |                      \----------= NIC0 |          | |&lt;br /&gt;
 | :          :.....::                           ______|    | |     | |    |______                           ||_____|          | |&lt;br /&gt;
 | :                 :                  _____   | IPMI =----/ |     | \----= IPMI |   _____                  | 10.254.0.4      | |&lt;br /&gt;
 | :.................:                 [_BMC_]--|_____||      |     |      ||_____|--[_BMC_]                 |_________________| |&lt;br /&gt;
 |_____________________________________________________|      |     |      |_____________________________________________________|&lt;br /&gt;
                                       || ||               ___|_   _|___               || ||                                      &lt;br /&gt;
                                       || ||              | PDU | | PDU |              || ||                                      &lt;br /&gt;
                                       || ||              |  1  | |  2  |              || ||                                      &lt;br /&gt;
                                       || ||              |_____| |_____|              || ||                                      &lt;br /&gt;
                                       || ||               || ||   || ||               || ||                                      &lt;br /&gt;
                                       || \\==[ Power 1 ]==// ||   || \\==[ Power 1 ]==// ||                                      &lt;br /&gt;
                                       \\=====[ Power 2 ]=====||===//                     ||                                      &lt;br /&gt;
                                                              \\==========[ Power 2 ]=====//                                      &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The cluster will use three separate Class B networks;&lt;br /&gt;
&lt;br /&gt;
{{note|1=There are situations where it is not possible to add additional network cards, blades being a prime example. In these cases it will be up to the admin to decide how to proceed. If there is sufficient bandwidth, you can merge all networks, but it is advised in such cases to isolate IFN traffic from the SN/BCN traffic using [[VLAN]]s.}}&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Purpose&lt;br /&gt;
!Subnet&lt;br /&gt;
!Notes&lt;br /&gt;
|-&lt;br /&gt;
|Internet-Facing Network ([[IFN]])&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;10.255.0.0/16&amp;lt;/span&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
* Each node will use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;10.255.0.x&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 node ID.&amp;lt;br /&amp;gt;&lt;br /&gt;
* Virtual Machines in the cluster that need to be connected to the Internet will use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;192.168.1.0/24&amp;lt;/span&amp;gt;. These IPs are intentionally separate from the two nodes&#039; IFN bridge&#039;s IPs. If you are particularly concerned about security, you can drop the bridges&#039; IPs once the cluster is build and add a firewall rule to reject all traffic from the VMs. &lt;br /&gt;
|-&lt;br /&gt;
|Storage Network ([[SN]])&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;10.10.0.0/16&amp;lt;/span&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
* Each node will use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;10.10.0.x&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 node ID.&lt;br /&gt;
|-&lt;br /&gt;
|Back-Channel Network ([[BCN]])&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;10.20.0.0/16&amp;lt;/span&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
* Each node will use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;10.20.0.x&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 node ID.&amp;lt;br /&amp;gt;&lt;br /&gt;
* Node-specific [[IPMI]] or other out-of-band management devices will use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;10.20.1.x&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 node ID.&amp;lt;br /&amp;gt;&lt;br /&gt;
* Multi-port fence devices, switches and similar will use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;10.20.2.z&amp;lt;/span&amp;gt; where &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;z&amp;lt;/span&amp;gt; is a simple sequence.&amp;lt;br /&amp;gt;&lt;br /&gt;
Miscellaneous equipment in the cluster, like managed switches, will use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;10.20.3.z&amp;lt;/span&amp;gt; where &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;z&amp;lt;/span&amp;gt; is a simple sequence.&amp;lt;br /&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;Optional&#039;&#039; OpenVPN Network&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;10.30.0.0/16&amp;lt;/span&amp;gt;&lt;br /&gt;
|* For clients behind firewalls, I like to create a [[OpenVPN Server on EL6|VPN]] server for the cluster nodes to log into when support is needed. This way, the client retains control over when remote access is available simply by starting and stopping the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;openvpn&amp;lt;/span&amp;gt; daemon. This will not be discussed any further in this tutorial.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
We will be using six interfaces, bonded into three pairs of two NICs in Active/Passive (mode 1) configuration. Each link of each bond will be on alternate, unstacked switches. This configuration is the only configuration supported by [[Red Hat]] in clusters. We will also configure affinity by specifying interfaces &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth0&amp;lt;/span&amp;gt;, &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; as primary for the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;bond0&amp;lt;/span&amp;gt;, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;bond1&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;bond2&amp;lt;/span&amp;gt; interfaces, respectively. This way, when everything is working fine, all traffic is routed through the same switch for maximum performance.&lt;br /&gt;
&lt;br /&gt;
{{note|1=Only the bonded interface used by corosync must be in Active/Passive configuration (&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;bond0&amp;lt;/span&amp;gt; in this tutorial). If you want to experiment with other bonding modes for &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;bond1&amp;lt;/span&amp;gt; or &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;bond2&amp;lt;/span&amp;gt;, please feel free to do so. That is outside the scope of this tutorial, however.}}&lt;br /&gt;
&lt;br /&gt;
If you can not install six interfaces in your server, then four interfaces will do with the [[SN]] and [[BCN]] networks merged.&lt;br /&gt;
&lt;br /&gt;
{{warning|1=If you wish to merge the [[SN]] and [[BCN]] onto one interface, test to ensure that the storage traffic will not block cluster communication. Test by forming your cluster and then pushing your storage to maximum read and write performance for an extended period of time (minimum of several seconds). If the cluster partitions, you will need to do some advanced quality-of-service or other network configuration to ensure reliable delivery of cluster network traffic.}}&lt;br /&gt;
&lt;br /&gt;
In this tutorial, we will use two [http://dlink.ca/products/?pid=DGS-3120-24TC D-Link DGS-3120-24TC/SI], stacked, using three [[VLAN]]s to isolate the three networks.&lt;br /&gt;
* [[BCN]] will have VLAN ID of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt;, which is the default VLAN.&lt;br /&gt;
* [[SN]] will have VLAN ID number 100.&lt;br /&gt;
* [[IFN]] will have VLAN ID number 101.&lt;br /&gt;
&lt;br /&gt;
{{note|Switch configuration [[D-Link_Notes|details]].}}&lt;br /&gt;
&lt;br /&gt;
The actual mapping of interfaces to bonds to networks will be:&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Subnet&lt;br /&gt;
!Cable Colour&lt;br /&gt;
![[VLAN]] ID&lt;br /&gt;
!Link 1&lt;br /&gt;
!Link 2&lt;br /&gt;
!Bond&lt;br /&gt;
!IP&lt;br /&gt;
|-&lt;br /&gt;
|[[BCN]]&lt;br /&gt;
|Blue&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt;&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;eth3&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;bond0&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;10.20.0.x&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|[[SN]]&lt;br /&gt;
|Green&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;100&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth1&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth4&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;bond1&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;10.10.0.x&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|[[IFN]]&lt;br /&gt;
|Black&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;101&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth2&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth5&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;bond2&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;10.255.0.x&amp;lt;/span&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Setting Up the Network ==&lt;br /&gt;
&lt;br /&gt;
{{warning|1=The following steps can easily get confusing, given how many files we need to edit. Losing access to your server&#039;s network is a very real possibility! &#039;&#039;&#039;Do not continue without direct access to your servers!&#039;&#039;&#039; If you have out-of-band access via [[iKVM]], console redirection or similar, be sure to test that it is working before proceeding.}}&lt;br /&gt;
&lt;br /&gt;
=== Planning The Use of Physical Interfaces ===&lt;br /&gt;
&lt;br /&gt;
In production clusters, I generally intentionally get three separate dual-port controllers (two on-board interfaces plus two separate dual-port PCIe cards). I then ensure that no bond uses two interfaces on the same physical board. Thus, should a card or its bus interface fail, none of the bonds will fail completely.&lt;br /&gt;
&lt;br /&gt;
Lets take a look at an example layout;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
 ____________________                            &lt;br /&gt;
| [ an-node01 ]      |                           &lt;br /&gt;
|         ___________|      _______              &lt;br /&gt;
|        |     ______|     | bond0 |             &lt;br /&gt;
|        | O  | eth0 =-----=---.---=------------{&lt;br /&gt;
|        | n  |_____||  /--=--/    |             &lt;br /&gt;
|        | b         |  |  |_______|  _______    &lt;br /&gt;
|        | o   ______|  |            | bond1 |   &lt;br /&gt;
|        | a  | eth1 =--|------------=---.---=--{&lt;br /&gt;
|        | r  |_____||  |  /---------=--/    |   &lt;br /&gt;
|        | d         |  |  |         |_______|   &lt;br /&gt;
|        |___________|  |  |                     &lt;br /&gt;
|         ___________|  |  |      _______        &lt;br /&gt;
|        |     ______|  |  |     | bond2 |       &lt;br /&gt;
|        | P  | eth2 =--|--|-----=---.---=------{&lt;br /&gt;
|        | C  |_____||  |  |  /--=--/    |       &lt;br /&gt;
|        | I         |  |  |  |  |_______|       &lt;br /&gt;
|        | e   ______|  |  |  |                  &lt;br /&gt;
|        |    | eth3 =--/  |  |                  &lt;br /&gt;
|        | 1  |_____||     |  |                  &lt;br /&gt;
|        |___________|     |  |                  &lt;br /&gt;
|         ___________|     |  |                  &lt;br /&gt;
|        |     ______|     |  |                  &lt;br /&gt;
|        | P  | eth4 =-----/  |                  &lt;br /&gt;
|        | C  |_____||        |                  &lt;br /&gt;
|        | I         |        |                  &lt;br /&gt;
|        | e   ______|        |                  &lt;br /&gt;
|        |    | eth5 =--------/                  &lt;br /&gt;
|        | 2  |_____||                           &lt;br /&gt;
|        |___________|                           &lt;br /&gt;
|____________________|                           &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Consider the possible failure scenarios;&lt;br /&gt;
* The on-board controllers fail;&lt;br /&gt;
** &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;bond0&amp;lt;/span&amp;gt; falls back onto &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth3&amp;lt;/span&amp;gt; on the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;PCIe 1&amp;lt;/span&amp;gt; controller.&lt;br /&gt;
** &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;bond1&amp;lt;/span&amp;gt; falls back onto &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth4&amp;lt;/span&amp;gt; on the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;PCIe 2&amp;lt;/span&amp;gt; controller.&lt;br /&gt;
** &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;bond2&amp;lt;/span&amp;gt; is unaffected.&lt;br /&gt;
* The PCIe #1 controller fails&lt;br /&gt;
** &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;bond0&amp;lt;/span&amp;gt; remains on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth0&amp;lt;/span&amp;gt; interface but losses its redundancy as &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth3&amp;lt;/span&amp;gt; is down.&lt;br /&gt;
** &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;bond1&amp;lt;/span&amp;gt; is unaffected.&lt;br /&gt;
** &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;bond2&amp;lt;/span&amp;gt; falls back onto &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth5&amp;lt;/span&amp;gt; on the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;PCIe 2&amp;lt;/span&amp;gt; controller.&lt;br /&gt;
* The PCIe #2 controller fails&lt;br /&gt;
** &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;bond0&amp;lt;/span&amp;gt; is unaffected.&lt;br /&gt;
** &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;bond1&amp;lt;/span&amp;gt; remains on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth1&amp;lt;/span&amp;gt; interface but losses its redundancy as &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth4&amp;lt;/span&amp;gt; is down.&lt;br /&gt;
** &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;bond2&amp;lt;/span&amp;gt; remains on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth2&amp;lt;/span&amp;gt; interface but losses its redundancy as &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth5&amp;lt;/span&amp;gt; is down.&lt;br /&gt;
&lt;br /&gt;
In all three failure scenarios, no network interruption occurs making for the most robust configuration possible.&lt;br /&gt;
&lt;br /&gt;
=== Managed and Stacking Switch Notes ===&lt;br /&gt;
&lt;br /&gt;
{{note|1=If you have two stacked switches, be extra careful to test them to ensure that traffic will not block when a switch is lost or is recovering!}}&lt;br /&gt;
&lt;br /&gt;
There are two things you need to be wary of with managed switches.&lt;br /&gt;
&lt;br /&gt;
* Don&#039;t stack them unless you can confirm that there will be no interruption in traffic flow on the surviving switch when the lost switch disappears or recovers. It may seem like it makes sense to stack them and create Link Aggregation Groups, but this can cause problems. When in doubt, don&#039;t stack the switches.&lt;br /&gt;
* Disable Spanning Tree Protocol on all ports used by the cluster. Otherwise, when a lost switch is recovered, STP negotiation will cause traffic to stop on the ports for upwards of thirty seconds. This is more than enough time to partition a cluster.&lt;br /&gt;
&lt;br /&gt;
If you use three [[VLAN]]s across two unstacked switches, be sure to use a dedicate uplink for each VLAN. You may need to enable [[STP]] of these uplinks to avoid switch loops if the VLANs themselves are not enough. The reason for doing this is to ensure that cluster communications always have a clear path for traffic. If you had only one uplink between the two switches, and you found yourself in a situation where a node&#039;s [[BCN]] and [[SN]] faulted through the backup switch, the storage traffic could saturate the uplink and cause intolerable latency for the BCN traffic, leading to cluster partitioning.&lt;br /&gt;
&lt;br /&gt;
=== Connecting Fence Devices ===&lt;br /&gt;
&lt;br /&gt;
As we will see soon, each node can be fenced either by calling its [[IPMI]] interface or by calling the [[PDU]] and cutting the node&#039;s power. Each of these methods are inherently single points of failure as each has only one network connection. To work around this concern, we will connect all IPMI interfaces to one switch and the PDUs to the secondary switch. This way, should a switch fail, only one of the two fence devices will fail and fencing in general will still be possible via the alternate fence device.&lt;br /&gt;
&lt;br /&gt;
Generally speaking, I like to connect the IPMI interfaces to the primary switch and the PDUs to the backup switch.&lt;br /&gt;
&lt;br /&gt;
=== Making Sure We Know Our Interfaces ===&lt;br /&gt;
&lt;br /&gt;
When you installed the operating system, the network interfaces names are somewhat randomly assigned to the physical network interfaces. It more than likely that you will want to re-order. &lt;br /&gt;
&lt;br /&gt;
Before you start moving interface names around, you will want to consider which physical interfaces you will want to use on which networks. At the end of the day, the names themselves have no meaning. At the very least though, make them consistent across nodes.&lt;br /&gt;
&lt;br /&gt;
Some things to consider, in order of importance:&lt;br /&gt;
&lt;br /&gt;
* If you have a shared interface for your out-of-band management interface, like [[IPMI]] or [[iLO]], you will want that interface to be on the [[Back-Channel Network]].&lt;br /&gt;
* For redundancy, you want to spread out which interfaces are paired up. In my case, I have three interfaces on my mainboard and three additional add-in cards. I will pair each onboard interface with an add-in interface. In my case, my IPMI interface physically piggy-backs on one of the onboard interfaces so this interface will need to be part of the [[BCN]] bond.&lt;br /&gt;
* Your interfaces with the lowest latency should be used for the back-channel network.&lt;br /&gt;
* Your two fastest interfaces should be used for your storage network.&lt;br /&gt;
* The remaining two slowest interfaces should be used for the [[Internet-Facing Network]] bond.&lt;br /&gt;
&lt;br /&gt;
In my case, all six interfaces are identical, so there is little to consider. The left-most interface on my system has IPMI, so its paired network interface will be &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth0&amp;lt;/span&amp;gt;. I simply work my way left, incrementing as I go. What you do will be whatever makes most sense to you.&lt;br /&gt;
&lt;br /&gt;
There is a separate, short tutorial on re-ordering network interface;&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;[[Changing the ethX to Ethernet Device Mapping in EL6 and Fedora 12+]]&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Once you have the physical interfaces named the way you like, proceed to the next step.&lt;br /&gt;
&lt;br /&gt;
=== Planning Our Network ===&lt;br /&gt;
&lt;br /&gt;
To setup our network, we will need to edit the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ifcfg-ethX&amp;lt;/span&amp;gt;, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ifcfg-bondX&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ifcfg-vbr2&amp;lt;/span&amp;gt; scripts. The last one will create a bridge, like a virtual network switch, which will be used to route network connections between the virtual machines and the outside world, via the [[IFN]]. You will note that the bridge will have the [[IP]] addresses, not the bonded interface &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;bond2&amp;lt;/span&amp;gt;. It will instead be slaved to the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vbr2&amp;lt;/span&amp;gt; bridge.&lt;br /&gt;
&lt;br /&gt;
We&#039;re going to be editing a lot of files. It&#039;s best to lay out what we&#039;ll be doing in a chart. So our setup will be:&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
!Node&lt;br /&gt;
!BCN IP and Device&lt;br /&gt;
!SN IP and Device&lt;br /&gt;
!IFN IP and Device&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;10.20.0.1&amp;lt;/span&amp;gt; on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;bond0&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;10.10.0.1&amp;lt;/span&amp;gt; on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;bond1&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;10.255.0.1&amp;lt;/span&amp;gt; on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vbr2&amp;lt;/span&amp;gt; (&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;bond2&amp;lt;/span&amp;gt; slaved)&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;10.20.0.2&amp;lt;/span&amp;gt; on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;bond0&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;10.10.0.2&amp;lt;/span&amp;gt; on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;bond1&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;10.255.0.2&amp;lt;/span&amp;gt; on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vbr2&amp;lt;/span&amp;gt; (&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;bond2&amp;lt;/span&amp;gt; slaved)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Switch Network Daemons ===&lt;br /&gt;
&lt;br /&gt;
The new &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;NetworkManager&amp;lt;/span&amp;gt; daemon is much more flexible and is perfect for machines like laptops which move around networks a lot. However, it does this by making a lot of decisions for you and changing the network as it sees fit. As good as this is for laptops and the like, it&#039;s not appropriate for servers. We will want to use the traditional &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;network&amp;lt;/span&amp;gt; service.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum remove NetworkManager&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now enable &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;network&amp;lt;/span&amp;gt; to start 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;
chkconfig --list network&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;
network        	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;
=== Creating Some Network Configuration Files ===&lt;br /&gt;
&lt;br /&gt;
{{warning|1=Bridge configuration files &#039;&#039;&#039;must&#039;&#039;&#039; have a file name which will sort &#039;&#039;&#039;after&#039;&#039;&#039; the interface and bridge files. The actual device name can be whatever you want though. If the system tries to start a bridge before its slaved interface is up, it will fail. I personally like to use the name &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vbrX&amp;lt;/span&amp;gt; for &amp;quot;&#039;&#039;&#039;v&#039;&#039;&#039;irtual machine &#039;&#039;&#039;br&#039;&#039;&#039;idge&amp;quot;. You can use whatever makes sense to you, with the above concern in mind.}}&lt;br /&gt;
&lt;br /&gt;
Start by &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;touch&amp;lt;/span&amp;gt;ing the configuration files we will need.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
touch /etc/sysconfig/network-scripts/ifcfg-bond{0,1,2}&lt;br /&gt;
touch /etc/sysconfig/network-scripts/ifcfg-vbr2&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now make a backup of your configuration files, in case something goes wrong and you want to start over.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
mkdir /root/backups/&lt;br /&gt;
rsync -av /etc/sysconfig/network-scripts/ifcfg-eth* /root/backups/&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
sending incremental file list&lt;br /&gt;
ifcfg-eth0&lt;br /&gt;
ifcfg-eth1&lt;br /&gt;
ifcfg-eth2&lt;br /&gt;
ifcfg-eth3&lt;br /&gt;
ifcfg-eth4&lt;br /&gt;
ifcfg-eth5&lt;br /&gt;
&lt;br /&gt;
sent 1467 bytes  received 126 bytes  3186.00 bytes/sec&lt;br /&gt;
total size is 1119  speedup is 0.70&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Configuring The Bridge ===&lt;br /&gt;
&lt;br /&gt;
We&#039;ll start in reverse order, crafting the bridge&#039;s script first.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;&#039;&#039;&#039; IFN Bridge:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/sysconfig/network-scripts/ifcfg-vbr2&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;
# Internet-Facing Network - Bridge&lt;br /&gt;
DEVICE=&amp;quot;vbr2&amp;quot;&lt;br /&gt;
TYPE=&amp;quot;Bridge&amp;quot;&lt;br /&gt;
BOOTPROTO=&amp;quot;static&amp;quot;&lt;br /&gt;
IPADDR=&amp;quot;10.255.0.1&amp;quot;&lt;br /&gt;
NETMASK=&amp;quot;255.255.0.0&amp;quot;&lt;br /&gt;
GATEWAY=&amp;quot;10.255.255.254&amp;quot;&lt;br /&gt;
DNS1=&amp;quot;78.46.37.135&amp;quot;&lt;br /&gt;
DNS2=&amp;quot;192.139.81.117&amp;quot;&lt;br /&gt;
DEFROUTE=&amp;quot;yes&amp;quot;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Creating the Bonded Interfaces ===&lt;br /&gt;
&lt;br /&gt;
Next up, we&#039;ll can create the three bonding configuration files. This is where two physical network interfaces are tied together to work like a single, highly available network interface. You can think of a bonded interface as being akin to [[TLUG_Talk:_Storage_Technologies_and_Theory#Level_1|RAID level 1]]; A new virtual device is created out of two real devices.&lt;br /&gt;
&lt;br /&gt;
We&#039;re going to see a long line called &amp;quot;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[http://docs.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/6/html/Deployment_Guide/sec-Using_Channel_Bonding.html BONDING_OPTS]&amp;lt;/span&amp;gt;&amp;quot;. Let&#039;s look at the meaning of these options before we look at the configuration; &lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;mode=1&amp;lt;/span&amp;gt; sets the bonding mode to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;active-backup&amp;lt;/span&amp;gt;. &lt;br /&gt;
* The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;miimon=100&amp;lt;/span&amp;gt; tells the bonding driver to check if the network cable has been unplugged or plugged in every 100 milliseconds. &lt;br /&gt;
* The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;use_carrier=1&amp;lt;/span&amp;gt; tells the driver to use the driver to maintain the link state. Some drivers don&#039;t support that. If you run into trouble, try changing this to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;0&amp;lt;/span&amp;gt;. &lt;br /&gt;
* The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;updelay=120000&amp;lt;/span&amp;gt; tells the driver to delay switching back to the primary interface for 120,000 milliseconds (2 minutes). This is designed to give the switch connected to the primary interface time to finish booting. Setting this too low may cause the bonding driver to switch back before the network switch is ready to actually move data. Some switches will not provide a link until it is fully booted, so please experiment.&lt;br /&gt;
* The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;downdelay=0&amp;lt;/span&amp;gt; tells the driver not to wait before changing the state of an interface when the link goes down. That is, when the driver detects a fault, it will switch to the backup interface immediately.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;&#039;&#039;&#039; BCN Bond:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/sysconfig/network-scripts/ifcfg-bond0&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;
# Back-Channel Network - Bond&lt;br /&gt;
DEVICE=&amp;quot;bond0&amp;quot;&lt;br /&gt;
BOOTPROTO=&amp;quot;static&amp;quot;&lt;br /&gt;
NM_CONTROLLED=&amp;quot;no&amp;quot;&lt;br /&gt;
ONBOOT=&amp;quot;yes&amp;quot;&lt;br /&gt;
BONDING_OPTS=&amp;quot;mode=1 miimon=100 use_carrier=1 updelay=120000 downdelay=0 primary=eth0&amp;quot;&lt;br /&gt;
IPADDR=&amp;quot;10.20.0.1&amp;quot;&lt;br /&gt;
NETMASK=&amp;quot;255.255.0.0&amp;quot;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;&#039;&#039;&#039; SN Bond:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/sysconfig/network-scripts/ifcfg-bond1&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;
# Storage Network - Bond&lt;br /&gt;
DEVICE=&amp;quot;bond1&amp;quot;&lt;br /&gt;
BOOTPROTO=&amp;quot;static&amp;quot;&lt;br /&gt;
NM_CONTROLLED=&amp;quot;no&amp;quot;&lt;br /&gt;
ONBOOT=&amp;quot;yes&amp;quot;&lt;br /&gt;
BONDING_OPTS=&amp;quot;mode=1 miimon=100 use_carrier=1 updelay=120000 downdelay=0 primary=eth1&amp;quot;&lt;br /&gt;
IPADDR=&amp;quot;10.10.0.1&amp;quot;&lt;br /&gt;
NETMASK=&amp;quot;255.255.0.0&amp;quot;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;&#039;&#039;&#039; IFN Bond:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/sysconfig/network-scripts/ifcfg-bond2&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;
# Internet-Facing Network - Bond&lt;br /&gt;
DEVICE=&amp;quot;bond2&amp;quot;&lt;br /&gt;
BRIDGE=&amp;quot;vbr2&amp;quot;&lt;br /&gt;
BOOTPROTO=&amp;quot;none&amp;quot;&lt;br /&gt;
NM_CONTROLLED=&amp;quot;no&amp;quot;&lt;br /&gt;
ONBOOT=&amp;quot;yes&amp;quot;&lt;br /&gt;
BONDING_OPTS=&amp;quot;mode=1 miimon=100 use_carrier=1 updelay=120000 downdelay=0 primary=eth2&amp;quot;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Alter The Interface Configurations ===&lt;br /&gt;
&lt;br /&gt;
With the bridge and bonds in place, we can now alter the interface configurations.&lt;br /&gt;
&lt;br /&gt;
Which two interfaces you use in a given bond is entirely up to you. I&#039;ve found it easiest to keep straight when I match the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;bondX&amp;lt;/span&amp;gt; to the primary interface&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ethX&amp;lt;/span&amp;gt; number.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;&#039;&#039;&#039;&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth0&amp;lt;/span&amp;gt;, the BCN &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;bond0&amp;lt;/span&amp;gt;, Link 1:&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;
# Back-Channel Network - Link 1&lt;br /&gt;
HWADDR=&amp;quot;00:E0:81:C7:EC:49&amp;quot;&lt;br /&gt;
DEVICE=&amp;quot;eth0&amp;quot;&lt;br /&gt;
NM_CONTROLLED=&amp;quot;no&amp;quot;&lt;br /&gt;
ONBOOT=&amp;quot;yes&amp;quot;&lt;br /&gt;
BOOTPROTO=&amp;quot;none&amp;quot;&lt;br /&gt;
MASTER=&amp;quot;bond0&amp;quot;&lt;br /&gt;
SLAVE=&amp;quot;yes&amp;quot;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;&#039;&#039;&#039;&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth1&amp;lt;/span&amp;gt;, the SN &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;bond1&amp;lt;/span&amp;gt;, Link 1:&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;
# Storage Network - Link 1&lt;br /&gt;
HWADDR=&amp;quot;00:E0:81:C7:EC:48&amp;quot;&lt;br /&gt;
DEVICE=&amp;quot;eth1&amp;quot;&lt;br /&gt;
NM_CONTROLLED=&amp;quot;no&amp;quot;&lt;br /&gt;
ONBOOT=&amp;quot;yes&amp;quot;&lt;br /&gt;
BOOTPROTO=&amp;quot;none&amp;quot;&lt;br /&gt;
MASTER=&amp;quot;bond1&amp;quot;&lt;br /&gt;
SLAVE=&amp;quot;yes&amp;quot;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;&#039;&#039;&#039;&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth2&amp;lt;/span&amp;gt;, the IFN &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;bond2&amp;lt;/span&amp;gt;, Link 1:&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;
# Internet-Facing Network - Link 1&lt;br /&gt;
HWADDR=&amp;quot;00:E0:81:C7:EC:47&amp;quot;&lt;br /&gt;
DEVICE=&amp;quot;eth2&amp;quot;&lt;br /&gt;
NM_CONTROLLED=&amp;quot;no&amp;quot;&lt;br /&gt;
ONBOOT=&amp;quot;yes&amp;quot;&lt;br /&gt;
BOOTPROTO=&amp;quot;none&amp;quot;&lt;br /&gt;
MASTER=&amp;quot;bond2&amp;quot;&lt;br /&gt;
SLAVE=&amp;quot;yes&amp;quot;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;&#039;&#039;&#039;&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth3&amp;lt;/span&amp;gt;, the BCN &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;bond0&amp;lt;/span&amp;gt;, Link 2:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/sysconfig/network-scripts/ifcfg-eth3&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;
# Back-Channel Network - Link 2&lt;br /&gt;
HWADDR=&amp;quot;00:1B:21:9D:59:FC&amp;quot;&lt;br /&gt;
DEVICE=&amp;quot;eth3&amp;quot;&lt;br /&gt;
NM_CONTROLLED=&amp;quot;no&amp;quot;&lt;br /&gt;
ONBOOT=&amp;quot;yes&amp;quot;&lt;br /&gt;
BOOTPROTO=&amp;quot;none&amp;quot;&lt;br /&gt;
MASTER=&amp;quot;bond0&amp;quot;&lt;br /&gt;
SLAVE=&amp;quot;yes&amp;quot;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;&#039;&#039;&#039;&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth4&amp;lt;/span&amp;gt;, the SN &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;bond1&amp;lt;/span&amp;gt;, Link 2:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/sysconfig/network-scripts/ifcfg-eth4&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;
# Storage Network - Link 2&lt;br /&gt;
HWADDR=&amp;quot;00:1B:21:BF:70:02&amp;quot;&lt;br /&gt;
DEVICE=&amp;quot;eth4&amp;quot;&lt;br /&gt;
NM_CONTROLLED=&amp;quot;no&amp;quot;&lt;br /&gt;
ONBOOT=&amp;quot;yes&amp;quot;&lt;br /&gt;
BOOTPROTO=&amp;quot;none&amp;quot;&lt;br /&gt;
MASTER=&amp;quot;bond1&amp;quot;&lt;br /&gt;
SLAVE=&amp;quot;yes&amp;quot;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;&#039;&#039;&#039;&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth5&amp;lt;/span&amp;gt;, the IFN &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;bond2&amp;lt;/span&amp;gt;, Link 2:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/sysconfig/network-scripts/ifcfg-eth5&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;
# Internet-Facing Network - Link 2&lt;br /&gt;
HWADDR=&amp;quot;00:1B:21:BF:6F:FE&amp;quot;&lt;br /&gt;
DEVICE=&amp;quot;eth5&amp;quot;&lt;br /&gt;
NM_CONTROLLED=&amp;quot;no&amp;quot;&lt;br /&gt;
ONBOOT=&amp;quot;yes&amp;quot;&lt;br /&gt;
BOOTPROTO=&amp;quot;none&amp;quot;&lt;br /&gt;
MASTER=&amp;quot;bond2&amp;quot;&lt;br /&gt;
SLAVE=&amp;quot;yes&amp;quot;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Loading The New Network Configuration ==&lt;br /&gt;
&lt;br /&gt;
Simple restart the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;network&amp;lt;/span&amp;gt; service.&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;
&lt;br /&gt;
== Updating /etc/hosts ==&lt;br /&gt;
&lt;br /&gt;
On both nodes, update the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/hosts&amp;lt;/span&amp;gt; file to reflect your network configuration. Remember to add entries for your [[IPMI]], switched PDUs and other devices.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/hosts&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4&lt;br /&gt;
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6&lt;br /&gt;
&lt;br /&gt;
# an-node01&lt;br /&gt;
10.20.0.1	an-node01 an-node01.bcn an-node01.alteeve.com&lt;br /&gt;
10.20.1.1	an-node01.ipmi&lt;br /&gt;
10.10.0.1	an-node01.sn&lt;br /&gt;
10.255.0.1	an-node01.ifn&lt;br /&gt;
&lt;br /&gt;
# an-node01&lt;br /&gt;
10.20.0.2	an-node02 an-node02.bcn an-node02.alteeve.com&lt;br /&gt;
10.20.1.2	an-node02.ipmi&lt;br /&gt;
10.10.0.2	an-node02.sn&lt;br /&gt;
10.255.0.2	an-node02.ifn&lt;br /&gt;
&lt;br /&gt;
# Fence devices&lt;br /&gt;
10.20.2.1       pdu1 pdu1.alteeve.com&lt;br /&gt;
10.20.2.2       pdu2 pdu2.alteeve.com&lt;br /&gt;
&lt;br /&gt;
# VPN interfaces, if used.&lt;br /&gt;
10.30.0.1	an-node01.vpn&lt;br /&gt;
10.30.0.2	an-node02.vpn&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{warning|1=Remember, which ever switch you have the IPMI interfaces connected to, be sure to connect the PDU into the &#039;&#039;&#039;opposite&#039;&#039;&#039; switch! If both fence types are on one switch, then that switch becomes a single point of failure!}}&lt;br /&gt;
&lt;br /&gt;
{{note|1=I like to run an [[OpenVPN Server on EL6|OpenVPN]] server and set up my remote clusters and customers as clients on this VPN to enable rapid, secure remote access when the client&#039;s firewall blocks inbound connections. This offers the client the option of disabling the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;openvpn&amp;lt;/span&amp;gt; client daemon until they wish to enable access. This tends to be easier for the client to manage as opposed to manipulating the firewall on demand. This will be the only mention of the VPN in this tutorial, but explains the last entries in the file above.}}&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 its tools, like &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 its 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;
4a:52:a1:c7:60:d5:e8:6d:c4:75:20:dd:62:2b:86:c5 root@an-node01.alteeve.com&lt;br /&gt;
The key&#039;s randomart image is:&lt;br /&gt;
+--[ RSA 2047]----+&lt;br /&gt;
|    o.o=.ooo.    |&lt;br /&gt;
|   . +..E.+..    |&lt;br /&gt;
|    ..+= . o     |&lt;br /&gt;
|     oo = .      |&lt;br /&gt;
|    . .oS.       |&lt;br /&gt;
|     o .         |&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;
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;
If you look closely when you created the ssh key, the node&#039;s fingerprint is show (&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;4a:52:a1:c7:60:d5:e8:6d:c4:75:20:dd:62:2b:86:c5&amp;lt;/span&amp;gt; for &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt; above). Make a note of the fingerprint for each machine, and then compare it to the one presented to you when you ssh to a machine for the first time. If you are presented with a fingerprint that doesn&#039;t match, you could be facing a &amp;quot;man in the middle&amp;quot; attack. &lt;br /&gt;
&lt;br /&gt;
To look up a fingerprint in the future, you can run the following;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ssh-keygen -l -f ~/.ssh/id_rsa&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;
2047 4a:52:a1:c7:60:d5:e8:6d:c4:75:20:dd:62:2b:86:c5 /root/.ssh/id_rsa.pub (RSA)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The two newly generated 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;
MIIEnwIBAAKCAQBs+CsWeKegqmtneZcLDvHV4QT1n+ajj98gkmjoLcIFW5g/VFRL&lt;br /&gt;
pSMMkwkQBgGDkmKPvYFa5OolL6qBQSAN1NpP8zET+1lZr4OFg/TZTuA8QnhNeh6V&lt;br /&gt;
mU2hSoyJfEkKJ6TVYg4s1rsbbTZPLdCDe9CMn/iI824WUu2wA8RwhF2WTqqTrWTW&lt;br /&gt;
4h8tYK9Y4eT4IYMXiYZ8+eQfzHyMaNxvUcI1Z8heMn/CEnrA67ja7Czi/ljYnw0I&lt;br /&gt;
3MXy9d2ANYjYahBLF2+ok19NS9tkFHDlcZTh0gTQ4vV5fksgdJjsWl5l/aLjnSRf&lt;br /&gt;
x2pQrMl3w8U7JBpr0PWJPIuzd4q47+KBI1A9AgEjAoIBADTtkUVtzcMQ8lbUqHMV&lt;br /&gt;
4y1eqqMwaLXYKowp2y7xp2GwJWCWrJnFPOjZs/HXCAy00Ml5TXVKnZ0IhgRENCP5&lt;br /&gt;
q92wos8w8OJrMUDZsXDdKxX0ZlGEdUFZFxPTwJqM0wTuryXQiorOsqbr5y3Fy62T&lt;br /&gt;
6PPYq+q/YVtM2dkmZrpO66DGcTkBA8tq8tTU3TdqZEVfmCzM9DIGz2hprvky+yDU&lt;br /&gt;
Pa296CP7+lHFty34K6j/WxD49+aKrdxXxdLbH/3Wfq7a9fu/FuYObPRtXoYRJNGP&lt;br /&gt;
ZEzfVoNwVdc3vETuzZPDoidkc4jomA4vM4cTS1EvwEWVHfaSdIE0wF16N1FlDgNA&lt;br /&gt;
hKsCgYEA9Xp5vGoPRer3hTSglGrPOTTkGEhXiE/JDMZ7w4fk2lXo+Q7HqxetrS6l&lt;br /&gt;
hMxY+x2W0FBfKwJqBuhVv4Y5MPLbC2JazwYDoP85g6RWH72ebsqdYwYvSx808iDs&lt;br /&gt;
C8HArWv8RtQ/K1pRVkq0GPhTdc22sYE9aKa5Hc6nd0SEmq+hLoUCgYBxo9c3M28h&lt;br /&gt;
jDpxwTkYszMfpIb++tCSrcBw8guqdqjhW6yH9kXva3NjfuzpOisb7cFN6dcSqjaC&lt;br /&gt;
HEZjpBWPUGLOPMnL1/mSsTErusgyh2+x8WjRjuqBJrh7CDN8gejMiski5nALQpxt&lt;br /&gt;
s6PKI5WHVqPQ395+549LQnoaCROyf4TUWQKBgFQp/doy/ewWC7ikVFAkntHI/b8u&lt;br /&gt;
vuzoJ6yb0qlwa7iSe8MbAwaldo8IrcchfZfs40AbjlfjkhD/M1ebu9ZEot9U6+81&lt;br /&gt;
QxKgpgE/qH/pPaJUGLQ8ooAn9OVNHbrjWADx0tZ0p/GbTxZFf5OIVyETVJShVuIN&lt;br /&gt;
RshkHCjkSrixPpObAoGAPbC2qPAJINcYaaNoI1n3Lm9B+CHBrrYYAsyJ/XOdgabL&lt;br /&gt;
X8A0l+nfjciPPMfOQlx+4ScrnGsHpbeT7PKsnkGUuRmvYAeHe4TC69psrbc8om0b&lt;br /&gt;
pPXPwnQbAPXSzo+qQybE9bBLc9O0AQm/UHm3kpy/VCHB7R6ePsxQ6Y/mHxIGR2MC&lt;br /&gt;
gYEAhW7evwpxUMcW+BV84xIIt7cW2K/mu8nOb2qajFTej+WgvHNT+h4vgs4ZrTkH&lt;br /&gt;
rHyUiN/tzTCxBnkoh1w9FmCdnAdr/+br56Zq8oEXzBUUALqeW0xnB0zpTc6Hn0xq&lt;br /&gt;
iU0P5cM1sgyCWv83MgeGegcpxt54K5bqUjPKjaUpLNqbtiA=&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; (single line, but wrapped here 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 AAAAB3NzaC1yc2EAAAABIwAAAQBs+CsWeKegqmtneZcLDvHV4QT1n+ajj98gkmjo&lt;br /&gt;
LcIFW5g/VFRLpSMMkwkQBgGDkmKPvYFa5OolL6qBQSAN1NpP8zET+1lZr4OFg/TZTuA8QnhN&lt;br /&gt;
eh6VmU2hSoyJfEkKJ6TVYg4s1rsbbTZPLdCDe9CMn/iI824WUu2wA8RwhF2WTqqTrWTW4h8t&lt;br /&gt;
YK9Y4eT4IYMXiYZ8+eQfzHyMaNxvUcI1Z8heMn/CEnrA67ja7Czi/ljYnw0I3MXy9d2ANYjY&lt;br /&gt;
ahBLF2+ok19NS9tkFHDlcZTh0gTQ4vV5fksgdJjsWl5l/aLjnSRfx2pQrMl3w8U7JBpr0PWJ&lt;br /&gt;
PIuzd4q47+KBI1A9 root@an-node01.alteeve.com&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{note|1=Generate the key on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt; before proceeding.}}&lt;br /&gt;
&lt;br /&gt;
In order to enable password-less login, we need to create a file called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;~/.ssh/authorized_keys&amp;lt;/span&amp;gt; and put both nodes&#039; public key in it. To seed the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;~/.ssh/authorized_keys&amp;lt;/span&amp;gt; file, we&#039;ll simply copy the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;~/.ssh/id_rsa.pub&amp;lt;/span&amp;gt; file. After that, we will append &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt;&#039;s public key into it over ssh. Once both keys are in it, we&#039;ll push it over to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt;. If you want to add your workstation&#039;s key as well, this is the best time to do so.&lt;br /&gt;
&lt;br /&gt;
From &#039;&#039;&#039;an-node01&#039;&#039;&#039;, type:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
rsync -av ~/.ssh/id_rsa.pub ~/.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;
sending incremental file list&lt;br /&gt;
id_rsa.pub&lt;br /&gt;
&lt;br /&gt;
sent 482 bytes  received 31 bytes  1026.00 bytes/sec&lt;br /&gt;
total size is 404  speedup is 0.79&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we&#039;ll grab the public key from &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt; over SSH and append it to the new &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;authorized_keys&amp;lt;/span&amp;gt; file.&lt;br /&gt;
&lt;br /&gt;
I noted when I created &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt;&#039;s ssh key that its fingerprint was &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;04:08:37:43:6b:5c:a0:b0:f5:27:a7:46:d4:77:a3:34&amp;lt;/span&amp;gt;. This matches the one presented to me in the next step, so I trust that I am talking to the right machine.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ssh root@an-node02 &amp;quot;cat ~/.ssh/id_rsa.pub&amp;quot; &amp;gt;&amp;gt; ~/.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;
The authenticity of host &#039;an-node02 (10.20.0.2)&#039; can&#039;t be established.&lt;br /&gt;
RSA key fingerprint is 04:08:37:43:6b:5c:a0:b0:f5:27:a7:46:d4:77:a3:34.&lt;br /&gt;
Are you sure you want to continue connecting (yes/no)? yes&lt;br /&gt;
Warning: Permanently added &#039;an-node02,10.20.0.2&#039; (RSA) to the list of known hosts.&lt;br /&gt;
root@an-node02&#039;s password: &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{note|1=If you want to add your workstation&#039;s key, do so here.}}&lt;br /&gt;
&lt;br /&gt;
Now push the local copy of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;authorized_keys&amp;lt;/span&amp;gt; with both keys over to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;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 ~/.ssh/authorized_keys root@an-node02:/root/.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;
root@an-node02&#039;s password: &lt;br /&gt;
sending incremental file list&lt;br /&gt;
authorized_keys&lt;br /&gt;
&lt;br /&gt;
sent 1704 bytes  received 31 bytes  694.00 bytes/sec&lt;br /&gt;
total size is 1621  speedup is 0.93&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now log into the remote machine. This time, the connection should succeed without having entered a password!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ssh root@an-node02&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Last login: Sat Dec 10 16:06:21 2011 from 10.20.255.254&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Perfect! Once you can log into both nodes, from either node, without a password you will be finished.&lt;br /&gt;
&lt;br /&gt;
=== Populating And Pushing ~/.ssh/known_hosts ===&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, lets &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ssh&amp;lt;/span&amp;gt; into both nodes using all host names. 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 &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;exit&amp;lt;/span&amp;gt; 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, but it only needs to be done one time for all nodes. 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-node01 &amp;amp;&amp;amp; \&lt;br /&gt;
ssh root@an-node01.alteeve.com &amp;amp;&amp;amp; \&lt;br /&gt;
ssh root@an-node01.bcn &amp;amp;&amp;amp; \&lt;br /&gt;
ssh root@an-node01.sn &amp;amp;&amp;amp; \&lt;br /&gt;
ssh root@an-node01.ifn &amp;amp;&amp;amp; \&lt;br /&gt;
ssh root@an-node02 &amp;amp;&amp;amp; \&lt;br /&gt;
ssh root@an-node02.alteeve.com &amp;amp;&amp;amp; \&lt;br /&gt;
ssh root@an-node02.bcn &amp;amp;&amp;amp; \&lt;br /&gt;
ssh root@an-node02.sn &amp;amp;&amp;amp; \&lt;br /&gt;
ssh root@an-node02.ifn&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;
The authenticity of host &#039;an-node01 (10.20.0.1)&#039; can&#039;t be established.&lt;br /&gt;
RSA key fingerprint is e6:cb:50:41:88:26:c3:a5:aa:85:80:89:02:6f:ae:5e.&lt;br /&gt;
Are you sure you want to continue connecting (yes/no)? 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;
Warning: Permanently added &#039;an-node01,10.20.0.1&#039; (RSA) to the list of known hosts.&lt;br /&gt;
Last login: Sun Dec 11 04:45:50 2011 from 10.20.255.254&lt;br /&gt;
[root@an-node01 ~]# &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;
exit&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
logout&lt;br /&gt;
Connection to an-node01 closed.&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;
The authenticity of host &#039;an-node01.alteeve.com (10.20.0.1)&#039; can&#039;t be established.&lt;br /&gt;
RSA key fingerprint is e6:cb:50:41:88:26:c3:a5:aa:85:80:89:02:6f:ae:5e.&lt;br /&gt;
Are you sure you want to continue connecting (yes/no)? 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;
Warning: Permanently added &#039;an-node01.alteeve.com&#039; (RSA) to the list of known hosts.&lt;br /&gt;
Last login: Sun Dec 11 04:50:24 2011 from an-node01&lt;br /&gt;
[root@an-node01 ~]# &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;
exit&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
logout&lt;br /&gt;
Connection to an-node01.alteeve.com closed.&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;
The authenticity of host &#039;an-node01.bcn (10.20.0.1)&#039; can&#039;t be established.&lt;br /&gt;
RSA key fingerprint is e6:cb:50:41:88:26:c3:a5:aa:85:80:89:02:6f:ae:5e.&lt;br /&gt;
Are you sure you want to continue connecting (yes/no)? 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;
Warning: Permanently added &#039;an-node01.bcn&#039; (RSA) to the list of known hosts.&lt;br /&gt;
Last login: Sun Dec 11 04:51:14 2011 from an-node01&lt;br /&gt;
[root@an-node01 ~]# &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;
exit&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
logout&lt;br /&gt;
Connection to an-node01.bcn closed.&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;
The authenticity of host &#039;an-node01.sn (10.10.0.1)&#039; can&#039;t be established.&lt;br /&gt;
RSA key fingerprint is e6:cb:50:41:88:26:c3:a5:aa:85:80:89:02:6f:ae:5e.&lt;br /&gt;
Are you sure you want to continue connecting (yes/no)? 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;
Warning: Permanently added &#039;an-node01.sn,10.10.0.1&#039; (RSA) to the list of known hosts.&lt;br /&gt;
Last login: Sun Dec 11 04:53:23 2011 from an-node01&lt;br /&gt;
[root@an-node01 ~]# &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;
exit&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
logout&lt;br /&gt;
Connection to an-node01.sn closed.&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;
The authenticity of host &#039;an-node01.ifn (10.255.0.1)&#039; can&#039;t be established.&lt;br /&gt;
RSA key fingerprint is e6:cb:50:41:88:26:c3:a5:aa:85:80:89:02:6f:ae:5e.&lt;br /&gt;
Are you sure you want to continue connecting (yes/no)? 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;
Warning: Permanently added &#039;an-node01.ifn,10.255.0.1&#039; (RSA) to the list of known hosts.&lt;br /&gt;
Last login: Sun Dec 11 04:54:30 2011 from an-node01.sn&lt;br /&gt;
[root@an-node01 ~]# &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;
exit&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
logout&lt;br /&gt;
Connection to an-node01.ifn closed.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is the connection to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt;, which we established earlier when we pushed the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;authorized_keys&amp;lt;/span&amp;gt;, so this time we&#039;re not asked to verify the key.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Last login: Sun Dec 11 05:44:40 2011 from 10.20.255.254&lt;br /&gt;
[root@an-node02 ~]# &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;
exit&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
logout&lt;br /&gt;
Connection to an-node02 closed.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we&#039;ll be asked to verify keys again, as only the base &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt; hostname had been recorded earlier.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
The authenticity of host &#039;an-node02.alteeve.com (10.20.0.2)&#039; can&#039;t be established.&lt;br /&gt;
RSA key fingerprint is 04:08:37:43:6b:5c:a0:b0:f5:27:a7:46:d4:77:a3:34.&lt;br /&gt;
Are you sure you want to continue connecting (yes/no)? 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;
Warning: Permanently added &#039;an-node02.alteeve.com&#039; (RSA) to the list of known hosts.&lt;br /&gt;
Last login: Sun Dec 11 05:54:44 2011 from an-node01&lt;br /&gt;
[root@an-node02 ~]# &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;
exit&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
logout&lt;br /&gt;
Connection to an-node02.alteeve.com closed.&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;
The authenticity of host &#039;an-node02.bcn (10.20.0.2)&#039; can&#039;t be established.&lt;br /&gt;
RSA key fingerprint is 04:08:37:43:6b:5c:a0:b0:f5:27:a7:46:d4:77:a3:34.&lt;br /&gt;
Are you sure you want to continue connecting (yes/no)? 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;
Warning: Permanently added &#039;an-node02.bcn&#039; (RSA) to the list of known hosts.&lt;br /&gt;
Last login: Sun Dec 11 06:05:58 2011 from an-node01&lt;br /&gt;
[root@an-node02 ~]# &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;
exit&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
logout&lt;br /&gt;
Connection to an-node02.bcn closed.&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;
The authenticity of host &#039;an-node02.sn (10.10.0.2)&#039; can&#039;t be established.&lt;br /&gt;
RSA key fingerprint is 04:08:37:43:6b:5c:a0:b0:f5:27:a7:46:d4:77:a3:34.&lt;br /&gt;
Are you sure you want to continue connecting (yes/no)? 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;
Warning: Permanently added &#039;an-node02.sn,10.10.0.2&#039; (RSA) to the list of known hosts.&lt;br /&gt;
Last login: Sun Dec 11 06:07:20 2011 from an-node01&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;
exit&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
logout&lt;br /&gt;
Connection to an-node02.sn closed.&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;
The authenticity of host &#039;an-node02.ifn (10.255.0.2)&#039; can&#039;t be established.&lt;br /&gt;
RSA key fingerprint is 04:08:37:43:6b:5c:a0:b0:f5:27:a7:46:d4:77:a3:34.&lt;br /&gt;
Are you sure you want to continue connecting (yes/no)? 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;
Warning: Permanently added &#039;an-node02.ifn,10.255.0.2&#039; (RSA) to the list of known hosts.&lt;br /&gt;
Last login: Sun Dec 11 06:08:11 2011 from an-node01.sn&lt;br /&gt;
[root@an-node02 ~]# &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;
exit&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
logout&lt;br /&gt;
Connection to an-node02.ifn closed.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Finally done!&lt;br /&gt;
&lt;br /&gt;
Now we 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.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
rsync -av root@an-node01:/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 incremental file list&lt;br /&gt;
&lt;br /&gt;
sent 11 bytes  received 41 bytes  104.00 bytes/sec&lt;br /&gt;
total size is 4413  speedup is 84.87&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we can connect via SSH to either node, from either node, using any of the networks and we will not be prompted to enter a password or to verify SSH fingerprints any more.&lt;br /&gt;
&lt;br /&gt;
= Configuring The Cluster Foundation =&lt;br /&gt;
&lt;br /&gt;
We need to configure the cluster in two stages. This is because we have something of a chicken-and-egg problem.&lt;br /&gt;
&lt;br /&gt;
* We need clustered storage for our virtual machines.&lt;br /&gt;
* Our clustered storage needs the cluster for fencing.&lt;br /&gt;
&lt;br /&gt;
Conveniently, clustering has two logical parts;&lt;br /&gt;
* Cluster communication and membership.&lt;br /&gt;
* Cluster resource management.&lt;br /&gt;
&lt;br /&gt;
The first, communication and membership, covers which nodes are part of the cluster and ejecting faulty nodes from the cluster, among other tasks. The second part, resource management, is provided by a second tool called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt;. It&#039;s this second part that we will set aside for later.&lt;br /&gt;
&lt;br /&gt;
== Installing Required Programs ==&lt;br /&gt;
&lt;br /&gt;
You will need to install the packages below. Under [[CentOS]], [[Scientific Linux]] or other [[RHEL]]-based distros, you can simply run the command below. &lt;br /&gt;
&lt;br /&gt;
For [[Red Hat]] customers though, you will need to enable the &amp;quot;[http://www.redhat.com/rhel/add-ons/resilient_storage.html RHEL Server Resilient Storage]&amp;quot; entitlement. If you are foregoing [[GFS2]] to save money, then you will need to instead enable the &amp;quot;[http://www.redhat.com/rhel/add-ons/high_availability.html RHEL Server High Availability]&amp;quot; entitlement instead. &lt;br /&gt;
&lt;br /&gt;
Once you are ready, run the following command to install what you need. If you opted not to use GFS2, remove &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;gfs2-utils&amp;lt;/span&amp;gt;. The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;gpm&amp;lt;/span&amp;gt; is also optional as it provides mouse facility in the command-line.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install cman corosync rgmanager ricci gfs2-utils ntp libvirt lvm2-cluster \&lt;br /&gt;
            qemu-kvm qemu-kvm-tools virt-install virt-viewer syslinux wget gpm rsync&lt;br /&gt;
&amp;lt;/source&amp;gt;&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 now. 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. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cat /dev/null &amp;gt;/etc/libvirt/qemu/networks/default.xml&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;libvirtd&amp;lt;/span&amp;gt; has started, then you will also need to stop the bridge, delete it 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;
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;
== 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;
== Configuration Methods ==&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 v3 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. We&#039;re going to do this on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt; and, when we&#039;re done, copy it over to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt;.&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_v3_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;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;?xml version=&amp;quot;1.0&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;cluster name=&amp;quot;an-cluster-A&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;
The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cluster&amp;lt;/span&amp;gt; element has two attributes that we need to set;&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;name=&amp;quot;&amp;quot;&amp;lt;/span&amp;gt;&lt;br /&gt;
* &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 v3 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-A&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[RHCS v3 cluster.conf#config_version|config_version]]=&amp;quot;&amp;quot;&amp;lt;/span&amp;gt; attribute is an integer indicating 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 &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt;. 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 setting up a special kind of cluster, called 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_v3_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_v3_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;
In short; this disables quorum.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;cluster name=&amp;quot;an-cluster-A&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 introduces two tags, the later a child tag of the former;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clusternodes&amp;lt;/span&amp;gt;&lt;br /&gt;
** &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clusternode&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The first is the parent &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[RHCS_v3_cluster.conf#clusternodes.3B_Defining_Cluster_Nodes|clusternodes]]&amp;lt;/span&amp;gt; tag, which takes no attributes of its own. Its sole purpose is to contain the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[RHCS_v3_cluster.conf#Tag.3B_clusternode|clusternode]]&amp;lt;/span&amp;gt; child tags, of which there will be one per node. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;cluster name=&amp;quot;an-cluster-A&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-node01.alteeve.com&amp;quot; nodeid=&amp;quot;1&amp;quot; /&amp;gt;&lt;br /&gt;
		&amp;lt;clusternode name=&amp;quot;an-node02.alteeve.com&amp;quot; nodeid=&amp;quot;2&amp;quot; /&amp;gt;&lt;br /&gt;
	&amp;lt;/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_v3_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_v3_cluster.conf#clusternode.27s_name_attribute|name]]=&amp;quot;&amp;quot;&amp;lt;/span&amp;gt; attribute. The value &#039;&#039;&#039;should&#039;&#039;&#039; match the fully qualified domain name, which you can check by running &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;uname -n&amp;lt;/span&amp;gt; on each node. This isn&#039;t strictly required, mind you, but for simplicity&#039;s sake, this is the name we will use.&lt;br /&gt;
&lt;br /&gt;
The cluster decides which network to use for cluster communication by resolving the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;name=&amp;quot;...&amp;quot;&amp;lt;/span&amp;gt; value. It will take the returned [[IP]] address and try to match it to one of the IPs on the system. Once it finds a match, that becomes the network the cluster will use. In our case, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01.alteeve.com&amp;lt;/span&amp;gt; resolves to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;10.20.0.1&amp;lt;/span&amp;gt;, which is used by &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;bond0&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
If you have &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;syslinux&amp;lt;/span&amp;gt; installed, you can check this out yourself using the following command;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ifconfig |grep -B 1 $(gethostip -d $(uname -n)) | grep HWaddr | awk &#039;{ print $1 }&#039;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
bond0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Please see the &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;[[RHCS_v3_cluster.conf#name_3|name]]&amp;lt;/span&amp;gt; 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_v3_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; elements in the cluster. It is what the cluster itself uses to identify the node.&lt;br /&gt;
&lt;br /&gt;
=== Defining Fence Devices ===&lt;br /&gt;
&lt;br /&gt;
[[2-Node_Red_Hat_KVM_Cluster_Tutorial#Concept.3B_Fencing|Fencing]] devices are used to forcible eject a node from a cluster if it stops responding.&lt;br /&gt;
&lt;br /&gt;
This is generally done by forcing it to power off or reboot. Some [[SAN]] switches can logically disconnect a node from the shared storage device, a process called fabric fencing, 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. These are called [[PDU]]s and are effectively power bars where each outlet can be independently switched off over the network.&lt;br /&gt;
&lt;br /&gt;
In this tutorial, our nodes support [[IPMI]], which we will use as the primary fence device. We also have an [http://www.apc.com/products/resource/include/techspec_index.cfm?base_sku=AP7900 APC] brand switched PDU which will act as a backup fence device.&lt;br /&gt;
&lt;br /&gt;
{{note|1=Not all brands of switched PDUs are supported as fence devices. Before you purchase a fence device, confirm that it is supported.}}&lt;br /&gt;
&lt;br /&gt;
All fence devices are contained within the parent &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[RHCS_v3_cluster.conf#fencedevices.3B_Defining_Fence_Devices|fencedevices]]&amp;lt;/span&amp;gt; tag, which has no attributes of its own. Within this parent tag are one or more &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[RHCS_v3_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-cluster-A&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-node01.alteeve.com&amp;quot; nodeid=&amp;quot;1&amp;quot; /&amp;gt;&lt;br /&gt;
                &amp;lt;clusternode name=&amp;quot;an-node02.alteeve.com&amp;quot; nodeid=&amp;quot;2&amp;quot; /&amp;gt;&lt;br /&gt;
        &amp;lt;/clusternodes&amp;gt;&lt;br /&gt;
        &amp;lt;fencedevices&amp;gt;&lt;br /&gt;
                &amp;lt;fencedevice name=&amp;quot;ipmi_an01&amp;quot; agent=&amp;quot;fence_ipmilan&amp;quot; ipaddr=&amp;quot;an-node01.ipmi&amp;quot; login=&amp;quot;root&amp;quot; passwd=&amp;quot;secret&amp;quot; /&amp;gt;&lt;br /&gt;
                &amp;lt;fencedevice name=&amp;quot;ipmi_an02&amp;quot; agent=&amp;quot;fence_ipmilan&amp;quot; ipaddr=&amp;quot;an-node02.ipmi&amp;quot; login=&amp;quot;root&amp;quot; passwd=&amp;quot;secret&amp;quot; /&amp;gt;&lt;br /&gt;
                &amp;lt;fencedevice agent=&amp;quot;fence_apc_snmp&amp;quot; ipaddr=&amp;quot;pdu2.alteeve.com&amp;quot; name=&amp;quot;pdu2&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 its own &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[RHCS_v3_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. On the other hand, fence devices that support multiple nodes, like switched PDUs, will have just one entry. In our case, we&#039;re using both types, so we have three fences devices; The two IPMI BMCs plus the switched PDU.&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_v3_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_v3_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 go-between 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 performs the requested action against the target node. The agent is responsible for ensuring that the execution succeeded and returning an appropriate success or failure exit code. &lt;br /&gt;
&lt;br /&gt;
For those curious, the full details are described in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[https://fedorahosted.org/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 its own subset of attributes. The scope of which is outside this tutorial, though we will see examples for IPMI and a switched PDU. 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_ipmilan&amp;lt;/span&amp;gt; - IPMI fence agent.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;man fence_apc_snmp&amp;lt;/span&amp;gt; - APC-brand switched PDU using [[SNMP]].&lt;br /&gt;
&lt;br /&gt;
The example above is what this tutorial will use. &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_v3_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_v3_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_v3_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;
Here is how we implement [[IPMI]] as the primary fence device with the APC switched PDU as the backup method.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;cluster name=&amp;quot;an-cluster-A&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-node01.alteeve.com&amp;quot; nodeid=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
                        &amp;lt;fence&amp;gt;&lt;br /&gt;
                                &amp;lt;method name=&amp;quot;ipmi&amp;quot;&amp;gt;&lt;br /&gt;
                                        &amp;lt;device name=&amp;quot;ipmi_an01&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;pdu&amp;quot;&amp;gt;&lt;br /&gt;
                                        &amp;lt;device name=&amp;quot;pdu2&amp;quot; port=&amp;quot;1&amp;quot; action=&amp;quot;reboot&amp;quot; /&amp;gt;&lt;br /&gt;
                                &amp;lt;/method&amp;gt;&lt;br /&gt;
                        &amp;lt;/fence&amp;gt;&lt;br /&gt;
                &amp;lt;/clusternode&amp;gt;&lt;br /&gt;
                &amp;lt;clusternode name=&amp;quot;an-node02.alteeve.com&amp;quot; nodeid=&amp;quot;2&amp;quot;&amp;gt;&lt;br /&gt;
                        &amp;lt;fence&amp;gt;&lt;br /&gt;
                                &amp;lt;method name=&amp;quot;ipmi&amp;quot;&amp;gt;&lt;br /&gt;
                                        &amp;lt;device name=&amp;quot;ipmi_an02&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;pdu&amp;quot;&amp;gt;&lt;br /&gt;
                                        &amp;lt;device name=&amp;quot;pdu2&amp;quot; port=&amp;quot;2&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;ipmi_an01&amp;quot; agent=&amp;quot;fence_ipmilan&amp;quot; ipaddr=&amp;quot;an-node01.ipmi&amp;quot; login=&amp;quot;root&amp;quot; passwd=&amp;quot;secret&amp;quot; /&amp;gt;&lt;br /&gt;
                &amp;lt;fencedevice name=&amp;quot;ipmi_an02&amp;quot; agent=&amp;quot;fence_ipmilan&amp;quot; ipaddr=&amp;quot;an-node02.ipmi&amp;quot; login=&amp;quot;root&amp;quot; passwd=&amp;quot;secret&amp;quot; /&amp;gt;&lt;br /&gt;
                &amp;lt;fencedevice agent=&amp;quot;fence_apc_snmp&amp;quot; ipaddr=&amp;quot;pdu2.alteeve.com&amp;quot; name=&amp;quot;pdu2&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;
First, notice that the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[RHCS_v3_cluster.conf#Tag.3B_fence|fence]]&amp;lt;/span&amp;gt; tag has no attributes. It&#039;s merely a parent for the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[RHCS_v3_cluster.conf#Tag.3B_method|method]](s)&amp;lt;/span&amp;gt; child elements.&lt;br /&gt;
&lt;br /&gt;
There are two &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[RHCS_v3_cluster.conf#Tag.3B_method|method]]&amp;lt;/span&amp;gt; elements, one for each fence device, named &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ipmi&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;pdu&amp;lt;/span&amp;gt;. These names are merely descriptive and can be whatever you feel is most appropriate. &lt;br /&gt;
&lt;br /&gt;
Within each &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;method&amp;lt;/span&amp;gt; element is one or more &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[RHCS_v3_cluster.conf#Tag.3B_device|device]]&amp;lt;/span&amp;gt; tags. For a given method to succeed, all defined &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;device&amp;lt;/span&amp;gt; elements must themselves succeed. This is very useful for grouping calls to separate PDUs when dealing with nodes having redundant power supplies, as shown in the [[2-Node_Red_Hat_KVM_Cluster_Tutorial#Example_.3Cfencedevice....3E_Tag_For_APC_Switched_PDUs|PDU example]] above.&lt;br /&gt;
&lt;br /&gt;
The actual fence &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[RHCS_v3_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_v3_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_v3_cluster.conf#device.27s_name_attribute|name]]&amp;lt;/span&amp;gt;, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ipmi_an01&amp;lt;/span&amp;gt; in this example.&lt;br /&gt;
&lt;br /&gt;
Note that the PDU definition needs a &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;port=&amp;quot;&amp;quot;&amp;lt;/span&amp;gt; attribute where the IPMI fence devices do not. These are the sorts of differences you will find, varying depending on how the fence device agent works.&lt;br /&gt;
&lt;br /&gt;
When a fence call is needed, the fence devices will be called in the order they are found here. If both devices fail, the cluster will go back to the start and try again, looping indefinitely until one device succeeds.&lt;br /&gt;
&lt;br /&gt;
{{note|1=It&#039;s important to understand why we use IPMI as the primary fence device. The FenceAgentAPI specification suggests, but does not require, that a fence device confirm that the node is off. IPMI can do this, the switched PDU can not. Thus, IPMI won&#039;t return a success unless the node is truly off. The PDU, however, will return a success once the power is cut to the requested port. The risk is that a misconfigured node with redundant PDU may in fact still be running, leading to disastrous consequences.}}&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-node02&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-node02&amp;lt;/span&amp;gt; is consulted. Within it there are two &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;method&amp;lt;/span&amp;gt; entries, named &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ipmi&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;pdu&amp;lt;/span&amp;gt;. The IPMI method&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;device&amp;lt;/span&amp;gt; has one attribute while the PDU&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;device&amp;lt;/span&amp;gt; has two attributes;&lt;br /&gt;
** &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;port&amp;lt;/span&amp;gt;; only found in the PDU &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;method&amp;lt;/span&amp;gt;, this tells the cluster that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt; is connected to switched PDU&#039;s outlet number &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;2&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;; Found on both devices, 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;ipmi_an02&amp;lt;/span&amp;gt;. This fence device has four 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_ipmilan&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 IPMI BMC. 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;
* Should the IPMI fence call fail for some reason, the cluster will move on to the second &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;pdu&amp;lt;/span&amp;gt; method, repeating the steps above but using the PDU values.&lt;br /&gt;
&lt;br /&gt;
When the cluster calls the fence agent, it does so by initially calling the fence agent script with no arguments.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/usr/sbin/fence_ipmilan&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=an-node02.ipmi&lt;br /&gt;
login=root&lt;br /&gt;
passwd=secret&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 three 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 one is 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-node02&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;
If this method fails, then the PDU will be called in a very similar way, but with an extra argument from the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;device&amp;lt;/span&amp;gt; attributes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/usr/sbin/fence_apc_snmp&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=pdu2.alteeve.com&lt;br /&gt;
port=2&lt;br /&gt;
action=reboot&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Should this fail, the cluster will go back and try the IPMI interface again. It will loop through the fence device methods forever until one of the methods succeeds.&lt;br /&gt;
Below are snippets from other clusters using different fence device configurations which might help you build your cluster.&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.&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;clusternode name=&amp;quot;an-node01.alteeve.com&amp;quot; nodeid=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
			&amp;lt;fence&amp;gt;&lt;br /&gt;
				&amp;lt;method name=&amp;quot;ipmi&amp;quot;&amp;gt;&lt;br /&gt;
					&amp;lt;device name=&amp;quot;ipmi_an01&amp;quot; action=&amp;quot;reboot&amp;quot;/&amp;gt;&lt;br /&gt;
				&amp;lt;/method&amp;gt;&lt;br /&gt;
			&amp;lt;/fence&amp;gt;&lt;br /&gt;
		&amp;lt;/clusternode&amp;gt;&lt;br /&gt;
		&amp;lt;clusternode name=&amp;quot;an-node02.alteeve.com&amp;quot; nodeid=&amp;quot;2&amp;quot;&amp;gt;&lt;br /&gt;
			&amp;lt;fence&amp;gt;&lt;br /&gt;
				&amp;lt;method name=&amp;quot;ipmi&amp;quot;&amp;gt;&lt;br /&gt;
					&amp;lt;device name=&amp;quot;ipmi_an02&amp;quot; action=&amp;quot;reboot&amp;quot;/&amp;gt;&lt;br /&gt;
				&amp;lt;/method&amp;gt;&lt;br /&gt;
			&amp;lt;/fence&amp;gt;&lt;br /&gt;
		&amp;lt;/clusternode&amp;gt;&lt;br /&gt;
	...&lt;br /&gt;
	&amp;lt;fencedevices&amp;gt;&lt;br /&gt;
		&amp;lt;fencedevice name=&amp;quot;ipmi_an01&amp;quot; agent=&amp;quot;fence_ipmilan&amp;quot; ipaddr=&amp;quot;an-node01.ipmi&amp;quot; login=&amp;quot;root&amp;quot; passwd=&amp;quot;secret&amp;quot; /&amp;gt;&lt;br /&gt;
		&amp;lt;fencedevice name=&amp;quot;ipmi_an02&amp;quot; agent=&amp;quot;fence_ipmilan&amp;quot; ipaddr=&amp;quot;an-node02.ipmi&amp;quot; login=&amp;quot;root&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 or other network fence devices, [[IPMI]] does not have ports. This is because each [[IPMI]] BMC supports just its host system. More on that later.}}&lt;br /&gt;
&lt;br /&gt;
==== Example &amp;lt;fencedevice...&amp;gt; Tag For HP iLO ====&lt;br /&gt;
&lt;br /&gt;
Here we will show how to use [http://h18013.www1.hp.com/products/servers/management/remotemgmt.html iLO] (integraterd Lights-Out) management devices as &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;fencedevice...&amp;gt;&amp;lt;/span&amp;gt; entries. 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 its use.&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;clusternode name=&amp;quot;an-node01.alteeve.com&amp;quot; nodeid=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
			&amp;lt;fence&amp;gt;&lt;br /&gt;
				&amp;lt;method name=&amp;quot;ilo&amp;quot;&amp;gt;&lt;br /&gt;
					&amp;lt;device action=&amp;quot;reboot&amp;quot; name=&amp;quot;ilo_an01&amp;quot;/&amp;gt;&lt;br /&gt;
				&amp;lt;/method&amp;gt;&lt;br /&gt;
			&amp;lt;/fence&amp;gt;&lt;br /&gt;
		&amp;lt;/clusternode&amp;gt;&lt;br /&gt;
		&amp;lt;clusternode name=&amp;quot;an-node02.alteeve.com&amp;quot; nodeid=&amp;quot;2&amp;quot;&amp;gt;&lt;br /&gt;
			&amp;lt;fence&amp;gt;&lt;br /&gt;
				&amp;lt;method name=&amp;quot;ilo&amp;quot;&amp;gt;&lt;br /&gt;
					&amp;lt;device action=&amp;quot;reboot&amp;quot; name=&amp;quot;ilo_an02&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;
	...&lt;br /&gt;
	&amp;lt;fencedevices&amp;gt;&lt;br /&gt;
		&amp;lt;fencedevice agent=&amp;quot;fence_ilo&amp;quot; ipaddr=&amp;quot;an-node01.ilo&amp;quot; login=&amp;quot;root&amp;quot; name=&amp;quot;ilo_an01&amp;quot; passwd=&amp;quot;secret&amp;quot;/&amp;gt;&lt;br /&gt;
		&amp;lt;fencedevice agent=&amp;quot;fence_ilo&amp;quot; ipaddr=&amp;quot;an-node02.ilo&amp;quot; login=&amp;quot;root&amp;quot; name=&amp;quot;ilo_an02&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=Like [[IPMI]], [[iLO]] does not have ports. This is because each [[iLO]] BMC supports just its host system.}}&lt;br /&gt;
&lt;br /&gt;
==== Example &amp;lt;fencedevice...&amp;gt; Tag For Dell&#039;s DRAC ====&lt;br /&gt;
&lt;br /&gt;
{{note|1=I have not tested fencing on Dell, but am using a reference working configuration from another user.}}&lt;br /&gt;
&lt;br /&gt;
Here we will show how to use [http://support.dell.com/support/edocs/software/smdrac3/ DRAC] (Dell Remote Access Controller) management devices as &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;fencedevice...&amp;gt;&amp;lt;/span&amp;gt; entries. We won&#039;t be using it ourselves, but it is another popular as a fence device so I wanted to show an example of its use.&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;clusternode name=&amp;quot;an-node01.alteeve.com&amp;quot; nodeid=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
			&amp;lt;fence&amp;gt;&lt;br /&gt;
				&amp;lt;method name=&amp;quot;drac&amp;quot;&amp;gt;&lt;br /&gt;
					&amp;lt;device action=&amp;quot;reboot&amp;quot; name=&amp;quot;drac_an01&amp;quot;/&amp;gt;&lt;br /&gt;
				&amp;lt;/method&amp;gt;&lt;br /&gt;
			&amp;lt;/fence&amp;gt;&lt;br /&gt;
		&amp;lt;/clusternode&amp;gt;&lt;br /&gt;
		&amp;lt;clusternode name=&amp;quot;an-node02.alteeve.com&amp;quot; nodeid=&amp;quot;2&amp;quot;&amp;gt;&lt;br /&gt;
			&amp;lt;fence&amp;gt;&lt;br /&gt;
				&amp;lt;method name=&amp;quot;ilo&amp;quot;&amp;gt;&lt;br /&gt;
					&amp;lt;device action=&amp;quot;reboot&amp;quot; name=&amp;quot;drac_an02&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;
	...&lt;br /&gt;
	&amp;lt;fencedevices&amp;gt;&lt;br /&gt;
		&amp;lt;fencedevice agent=&amp;quot;fence_drac5&amp;quot; cmd_prompt=&amp;quot;admin1-&amp;amp;gt;&amp;quot; ipaddr=&amp;quot;an-node01.drac&amp;quot; login=&amp;quot;root&amp;quot; name=&amp;quot;drac_an01&amp;quot; passwd=&amp;quot;secret&amp;quot; secure=&amp;quot;1&amp;quot;/&amp;gt;&lt;br /&gt;
		&amp;lt;fencedevice agent=&amp;quot;fence_drac5&amp;quot; cmd_prompt=&amp;quot;admin1-&amp;amp;gt;&amp;quot; ipaddr=&amp;quot;an-node02.drac&amp;quot; login=&amp;quot;root&amp;quot; name=&amp;quot;drac_an02&amp;quot; passwd=&amp;quot;secret&amp;quot; secure=&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;
* &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;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cmd_prompt&amp;lt;/span&amp;gt;; This is the string that the fence agent looks for when talking to the DRAC device.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;secure&amp;lt;/span&amp;gt;; This tells the agent to use [[SSH]].&lt;br /&gt;
&lt;br /&gt;
{{note|1=Like [[IPMI]] and [[iLO]], [[DRAC]] does not have ports. This is because each [[DRAC]] BMC supports just its host system.}}&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. There are two agents for these devices; One that uses the telnet or ssh login and one that uses [[SNMP]]. This tutorial uses the later, and it is recommended that you do the same.&lt;br /&gt;
&lt;br /&gt;
The example below is from a production cluster that uses redundant power supplies and two separate PDUs. This is how you will want to configure any production clusters you build.&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;clusternode name=&amp;quot;an-node01.alteeve.com&amp;quot; nodeid=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
			&amp;lt;fence&amp;gt;&lt;br /&gt;
				&amp;lt;method name=&amp;quot;pdu2&amp;quot;&amp;gt;&lt;br /&gt;
					&amp;lt;device action=&amp;quot;reboot&amp;quot; name=&amp;quot;pdu1&amp;quot; port=&amp;quot;1&amp;quot;/&amp;gt;&lt;br /&gt;
					&amp;lt;device action=&amp;quot;reboot&amp;quot; name=&amp;quot;pdu2&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;
		&amp;lt;/clusternode&amp;gt;&lt;br /&gt;
		&amp;lt;clusternode name=&amp;quot;an-node02.alteeve.com&amp;quot; nodeid=&amp;quot;2&amp;quot;&amp;gt;&lt;br /&gt;
			&amp;lt;fence&amp;gt;&lt;br /&gt;
				&amp;lt;method name=&amp;quot;pdu2&amp;quot;&amp;gt;&lt;br /&gt;
					&amp;lt;device action=&amp;quot;reboot&amp;quot; name=&amp;quot;pdu1&amp;quot; port=&amp;quot;2&amp;quot;/&amp;gt;&lt;br /&gt;
					&amp;lt;device action=&amp;quot;reboot&amp;quot; name=&amp;quot;pdu2&amp;quot; port=&amp;quot;2&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;
	...&lt;br /&gt;
	&amp;lt;fencedevices&amp;gt;&lt;br /&gt;
 		&amp;lt;fencedevice agent=&amp;quot;fence_apc_snmp&amp;quot; ipaddr=&amp;quot;pdu1.alteeve.com&amp;quot; name=&amp;quot;pdu1&amp;quot; /&amp;gt;&lt;br /&gt;
		&amp;lt;fencedevice agent=&amp;quot;fence_apc_snmp&amp;quot; ipaddr=&amp;quot;pdu2.alteeve.com&amp;quot; name=&amp;quot;pdu2&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;agent&amp;lt;/span&amp;gt;; This is the name of the script under &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/usr/sbin/&amp;lt;/span&amp;gt; to use when calling the physical PDU.&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;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;
=== 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 discussed earlier though, this is not the case when using the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[RHCS_v3_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_v3_cluster.conf#cman.3B_The_Cluster_Manager|cman]]&amp;lt;/span&amp;gt; element. 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 its 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, its 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-cluster-A&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-node01.alteeve.com&amp;quot; nodeid=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
                        &amp;lt;fence&amp;gt;&lt;br /&gt;
                                &amp;lt;method name=&amp;quot;ipmi&amp;quot;&amp;gt;&lt;br /&gt;
                                        &amp;lt;device name=&amp;quot;ipmi_an01&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;pdu&amp;quot;&amp;gt;&lt;br /&gt;
                                        &amp;lt;device name=&amp;quot;pdu2&amp;quot; port=&amp;quot;1&amp;quot; action=&amp;quot;reboot&amp;quot; /&amp;gt;&lt;br /&gt;
                                &amp;lt;/method&amp;gt;&lt;br /&gt;
                        &amp;lt;/fence&amp;gt;&lt;br /&gt;
                &amp;lt;/clusternode&amp;gt;&lt;br /&gt;
                &amp;lt;clusternode name=&amp;quot;an-node02.alteeve.com&amp;quot; nodeid=&amp;quot;2&amp;quot;&amp;gt;&lt;br /&gt;
                        &amp;lt;fence&amp;gt;&lt;br /&gt;
                                &amp;lt;method name=&amp;quot;ipmi&amp;quot;&amp;gt;&lt;br /&gt;
                                        &amp;lt;device name=&amp;quot;ipmi_an02&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;pdu&amp;quot;&amp;gt;&lt;br /&gt;
                                        &amp;lt;device name=&amp;quot;pdu2&amp;quot; port=&amp;quot;2&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;ipmi_an01&amp;quot; agent=&amp;quot;fence_ipmilan&amp;quot; ipaddr=&amp;quot;an-node01.ipmi&amp;quot; login=&amp;quot;root&amp;quot; passwd=&amp;quot;secret&amp;quot; /&amp;gt;&lt;br /&gt;
                &amp;lt;fencedevice name=&amp;quot;ipmi_an02&amp;quot; agent=&amp;quot;fence_ipmilan&amp;quot; ipaddr=&amp;quot;an-node02.ipmi&amp;quot; login=&amp;quot;root&amp;quot; passwd=&amp;quot;secret&amp;quot; /&amp;gt;&lt;br /&gt;
                &amp;lt;fencedevice agent=&amp;quot;fence_apc_snmp&amp;quot; ipaddr=&amp;quot;pdu2.alteeve.com&amp;quot; name=&amp;quot;pdu2&amp;quot; /&amp;gt;&lt;br /&gt;
        &amp;lt;/fencedevices&amp;gt;&lt;br /&gt;
        &amp;lt;fence_daemon post_join_delay=&amp;quot;30&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_v3_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_v3_cluster.conf#post_join_delay|post_join_delay]]=&amp;quot;30&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 with which you are comfortable.&lt;br /&gt;
&lt;br /&gt;
=== Configuring Totem ===&lt;br /&gt;
&lt;br /&gt;
There are many attributes for the [[totem]] element. For now though, we&#039;re only going to set two of them. We know that cluster communication will be travelling over our private, secured [[BCN]] network, so for the sake of simplicity, we&#039;re going to disable encryption. We are also offering network redundancy using the bonding drivers, so we&#039;re also going to disable totem&#039;s [[redundant ring protocol]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;cluster name=&amp;quot;an-cluster-A&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-node01.alteeve.com&amp;quot; nodeid=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
                        &amp;lt;fence&amp;gt;&lt;br /&gt;
                                &amp;lt;method name=&amp;quot;ipmi&amp;quot;&amp;gt;&lt;br /&gt;
                                        &amp;lt;device name=&amp;quot;ipmi_an01&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;pdu&amp;quot;&amp;gt;&lt;br /&gt;
                                        &amp;lt;device name=&amp;quot;pdu2&amp;quot; port=&amp;quot;1&amp;quot; action=&amp;quot;reboot&amp;quot; /&amp;gt;&lt;br /&gt;
                                &amp;lt;/method&amp;gt;&lt;br /&gt;
                        &amp;lt;/fence&amp;gt;&lt;br /&gt;
                &amp;lt;/clusternode&amp;gt;&lt;br /&gt;
                &amp;lt;clusternode name=&amp;quot;an-node02.alteeve.com&amp;quot; nodeid=&amp;quot;2&amp;quot;&amp;gt;&lt;br /&gt;
                        &amp;lt;fence&amp;gt;&lt;br /&gt;
                                &amp;lt;method name=&amp;quot;ipmi&amp;quot;&amp;gt;&lt;br /&gt;
                                        &amp;lt;device name=&amp;quot;ipmi_an02&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;pdu&amp;quot;&amp;gt;&lt;br /&gt;
                                        &amp;lt;device name=&amp;quot;pdu2&amp;quot; port=&amp;quot;2&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;ipmi_an01&amp;quot; agent=&amp;quot;fence_ipmilan&amp;quot; ipaddr=&amp;quot;an-node01.ipmi&amp;quot; login=&amp;quot;root&amp;quot; passwd=&amp;quot;secret&amp;quot; /&amp;gt;&lt;br /&gt;
                &amp;lt;fencedevice name=&amp;quot;ipmi_an02&amp;quot; agent=&amp;quot;fence_ipmilan&amp;quot; ipaddr=&amp;quot;an-node02.ipmi&amp;quot; login=&amp;quot;root&amp;quot; passwd=&amp;quot;secret&amp;quot; /&amp;gt;&lt;br /&gt;
                &amp;lt;fencedevice agent=&amp;quot;fence_apc_snmp&amp;quot; ipaddr=&amp;quot;pdu2.alteeve.com&amp;quot; name=&amp;quot;pdu2&amp;quot; /&amp;gt;&lt;br /&gt;
        &amp;lt;/fencedevices&amp;gt;&lt;br /&gt;
        &amp;lt;fence_daemon post_join_delay=&amp;quot;30&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;
{{note|1=At this time, [[redundant ring protocol]] is not supported ([[RHEL6]].1 and lower). It is in technology preview mode in [[RHEL6]].2 and above. This is another reason why we will not be using it in this tutorial..}}&lt;br /&gt;
&lt;br /&gt;
[[RRP]] is an optional second ring that can be used for cluster communication in the case of a break down in the first ring. 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_v3_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_v3_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_v3_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;
One of the most noticeable changes in [[RHCS]] cluster stable 3 is that we no longer have to make a long, cryptic &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xmllint&amp;lt;/span&amp;gt; call to validate our cluster configuration. Now we can simply call &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ccs_config_validate&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ccs_config_validate&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Configuration 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-node02:/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;
sending incremental file list&lt;br /&gt;
cluster.conf&lt;br /&gt;
&lt;br /&gt;
sent 1198 bytes  received 31 bytes  2458.00 bytes/sec&lt;br /&gt;
total size is 1118  speedup is 0.91&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Setting Up ricci ===&lt;br /&gt;
&lt;br /&gt;
Another change from [[RHCS]] stable 2 is how configuration changes are propagated. Before, after a change, we&#039;d push out the updated cluster configuration by calling &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ccs_tool update /etc/cluster/cluster.conf&amp;lt;/span&amp;gt;. Now this is done with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman_tool version -r&amp;lt;/span&amp;gt;. More fundamentally though, the cluster needs to authenticate against each node and does this using the local &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ricci&amp;lt;/span&amp;gt; system user. The user has no password initially, so we need to set one.&lt;br /&gt;
&lt;br /&gt;
On &#039;&#039;&#039;both&#039;&#039;&#039; nodes:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
passwd ricci&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Changing password for user ricci.&lt;br /&gt;
New password: &lt;br /&gt;
Retype new password: &lt;br /&gt;
passwd: all authentication tokens updated successfully.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You will need to enter this password once from each node against the other node. We will see this later.&lt;br /&gt;
&lt;br /&gt;
Now make sure that the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ricci&amp;lt;/span&amp;gt; daemon is set to start on boot and is running now.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
chkconfig ricci on&lt;br /&gt;
chkconfig --list ricci&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
ricci          	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;
Now start it up.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/ricci 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 ricci:                                            [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{note|1=If you don&#039;t see &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[  OK  ]&amp;lt;/span&amp;gt;, don&#039;t worry, it is probably because it was already running.}}&lt;br /&gt;
&lt;br /&gt;
We also need to have a daemon called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;modclusterd&amp;lt;/span&amp;gt; running on start.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
chkconfig modclusterd on&lt;br /&gt;
chkconfig --list modclusterd&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
modclusterd    	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;
Now start it up.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/modclusterd 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 Module - cluster monitor: Setting verbosity level to LogBasic&lt;br /&gt;
                                                           [  OK  ]&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;
It&#039;s a good idea to open a second terminal on either node and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;tail&amp;lt;/span&amp;gt; the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/var/log/messages&amp;lt;/span&amp;gt; [[syslog]] file. All cluster messages will be recorded here and it will help to debug problems if you can watch the logs. To do this, in the new terminal windows run;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
clear; tail -f -n 0 /var/log/messages&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will clear the screen and start watching for new lines to be written to syslog. When you are done watching syslog, press the &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;c&amp;lt;/span&amp;gt; key combination.&lt;br /&gt;
&lt;br /&gt;
How you lay out your terminal windows is, obviously, up to your own preferences. Below is a configuration I have found very useful.&lt;br /&gt;
&lt;br /&gt;
[[Image:2-node-rhcs3_terminal-window-layout_01.png|thumb|center|700px|Terminal window layout for watching 2 nodes. Left windows are used for entering commands and the left windows are used for tailing syslog.]]&lt;br /&gt;
&lt;br /&gt;
With the terminals setup, lets start the cluster!&lt;br /&gt;
&lt;br /&gt;
{{warning|1=If you don&#039;t start &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt; on both nodes within 30 seconds, the slower node will be fenced.}}&lt;br /&gt;
&lt;br /&gt;
On &#039;&#039;&#039;both&#039;&#039;&#039; nodes, run:&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;
   Checking if cluster has been disabled at boot...        [  OK  ]&lt;br /&gt;
   Checking Network Manager...                             [  OK  ]&lt;br /&gt;
   Global setup...                                         [  OK  ]&lt;br /&gt;
   Loading kernel modules...                               [  OK  ]&lt;br /&gt;
   Mounting configfs...                                    [  OK  ]&lt;br /&gt;
   Starting cman...                                        [  OK  ]&lt;br /&gt;
   Waiting for quorum...                                   [  OK  ]&lt;br /&gt;
   Starting fenced...                                      [  OK  ]&lt;br /&gt;
   Starting dlm_controld...                                [  OK  ]&lt;br /&gt;
   Starting gfs_controld...                                [  OK  ]&lt;br /&gt;
   Unfencing self...                                       [  OK  ]&lt;br /&gt;
   Joining fence domain...                                 [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here is what you should see in syslog:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Dec 13 12:08:44 an-node01 kernel: DLM (built Nov  9 2011 08:04:11) installed&lt;br /&gt;
Dec 13 12:08:45 an-node01 corosync[3434]:   [MAIN  ] Corosync Cluster Engine (&#039;1.4.1&#039;): started and ready to provide service.&lt;br /&gt;
Dec 13 12:08:45 an-node01 corosync[3434]:   [MAIN  ] Corosync built-in features: nss dbus rdma snmp&lt;br /&gt;
Dec 13 12:08:45 an-node01 corosync[3434]:   [MAIN  ] Successfully read config from /etc/cluster/cluster.conf&lt;br /&gt;
Dec 13 12:08:45 an-node01 corosync[3434]:   [MAIN  ] Successfully parsed cman config&lt;br /&gt;
Dec 13 12:08:45 an-node01 corosync[3434]:   [TOTEM ] Initializing transport (UDP/IP Multicast).&lt;br /&gt;
Dec 13 12:08:45 an-node01 corosync[3434]:   [TOTEM ] Initializing transmit/receive security: libtomcrypt SOBER128/SHA1HMAC (mode 0).&lt;br /&gt;
Dec 13 12:08:46 an-node01 corosync[3434]:   [TOTEM ] The network interface [10.20.0.1] is now up.&lt;br /&gt;
Dec 13 12:08:46 an-node01 corosync[3434]:   [QUORUM] Using quorum provider quorum_cman&lt;br /&gt;
Dec 13 12:08:46 an-node01 corosync[3434]:   [SERV  ] Service engine loaded: corosync cluster quorum service v0.1&lt;br /&gt;
Dec 13 12:08:46 an-node01 corosync[3434]:   [CMAN  ] CMAN 3.0.12.1 (built Sep 30 2011 03:17:43) started&lt;br /&gt;
Dec 13 12:08:46 an-node01 corosync[3434]:   [SERV  ] Service engine loaded: corosync CMAN membership service 2.90&lt;br /&gt;
Dec 13 12:08:46 an-node01 corosync[3434]:   [SERV  ] Service engine loaded: openais checkpoint service B.01.01&lt;br /&gt;
Dec 13 12:08:46 an-node01 corosync[3434]:   [SERV  ] Service engine loaded: corosync extended virtual synchrony service&lt;br /&gt;
Dec 13 12:08:46 an-node01 corosync[3434]:   [SERV  ] Service engine loaded: corosync configuration service&lt;br /&gt;
Dec 13 12:08:46 an-node01 corosync[3434]:   [SERV  ] Service engine loaded: corosync cluster closed process group service v1.01&lt;br /&gt;
Dec 13 12:08:46 an-node01 corosync[3434]:   [SERV  ] Service engine loaded: corosync cluster config database access v1.01&lt;br /&gt;
Dec 13 12:08:46 an-node01 corosync[3434]:   [SERV  ] Service engine loaded: corosync profile loading service&lt;br /&gt;
Dec 13 12:08:46 an-node01 corosync[3434]:   [QUORUM] Using quorum provider quorum_cman&lt;br /&gt;
Dec 13 12:08:46 an-node01 corosync[3434]:   [SERV  ] Service engine loaded: corosync cluster quorum service v0.1&lt;br /&gt;
Dec 13 12:08:46 an-node01 corosync[3434]:   [MAIN  ] Compatibility mode set to whitetank.  Using V1 and V2 of the synchronization engine.&lt;br /&gt;
Dec 13 12:08:46 an-node01 corosync[3434]:   [TOTEM ] A processor joined or left the membership and a new membership was formed.&lt;br /&gt;
Dec 13 12:08:46 an-node01 corosync[3434]:   [CMAN  ] quorum regained, resuming activity&lt;br /&gt;
Dec 13 12:08:46 an-node01 corosync[3434]:   [QUORUM] This node is within the primary component and will provide service.&lt;br /&gt;
Dec 13 12:08:46 an-node01 corosync[3434]:   [QUORUM] Members[1]: 1&lt;br /&gt;
Dec 13 12:08:46 an-node01 corosync[3434]:   [QUORUM] Members[1]: 1&lt;br /&gt;
Dec 13 12:08:46 an-node01 corosync[3434]:   [CPG   ] chosen downlist: sender r(0) ip(10.20.0.1) ; members(old:0 left:0)&lt;br /&gt;
Dec 13 12:08:46 an-node01 corosync[3434]:   [MAIN  ] Completed service synchronization, ready to provide service.&lt;br /&gt;
Dec 13 12:08:47 an-node01 corosync[3434]:   [TOTEM ] A processor joined or left the membership and a new membership was formed.&lt;br /&gt;
Dec 13 12:08:47 an-node01 corosync[3434]:   [QUORUM] Members[2]: 1 2&lt;br /&gt;
Dec 13 12:08:47 an-node01 corosync[3434]:   [QUORUM] Members[2]: 1 2&lt;br /&gt;
Dec 13 12:08:47 an-node01 corosync[3434]:   [CPG   ] chosen downlist: sender r(0) ip(10.20.0.1) ; members(old:1 left:0)&lt;br /&gt;
Dec 13 12:08:47 an-node01 corosync[3434]:   [MAIN  ] Completed service synchronization, ready to provide service.&lt;br /&gt;
Dec 13 12:08:49 an-node01 fenced[3490]: fenced 3.0.12.1 started&lt;br /&gt;
Dec 13 12:08:49 an-node01 dlm_controld[3515]: dlm_controld 3.0.12.1 started&lt;br /&gt;
Dec 13 12:08:51 an-node01 gfs_controld[3565]: gfs_controld 3.0.12.1 started&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now to confirm that the cluster is operating properly, run &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman_tool status&amp;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: 7&lt;br /&gt;
Cluster Name: an-cluster-A&lt;br /&gt;
Cluster Id: 24561&lt;br /&gt;
Cluster Member: Yes&lt;br /&gt;
Cluster Generation: 8&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;
Node votes: 1&lt;br /&gt;
Quorum: 1  &lt;br /&gt;
Active subsystems: 7&lt;br /&gt;
Flags: 2node &lt;br /&gt;
Ports Bound: 0  &lt;br /&gt;
Node name: an-node01.alteeve.com&lt;br /&gt;
Node ID: 1&lt;br /&gt;
Multicast addresses: 239.192.95.81 &lt;br /&gt;
Node addresses: 10.20.0.1 &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can see that the both nodes are talking because of the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Nodes: 2&amp;lt;/span&amp;gt; entry.&lt;br /&gt;
&lt;br /&gt;
If you ever want to see the nitty-gritty configuration, you can run &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;corosync-objctl&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
corosync-objctl&lt;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.name=an-cluster-A&lt;br /&gt;
cluster.config_version=7&lt;br /&gt;
cluster.cman.expected_votes=1&lt;br /&gt;
cluster.cman.two_node=1&lt;br /&gt;
cluster.cman.nodename=an-node01.alteeve.com&lt;br /&gt;
cluster.cman.cluster_id=24561&lt;br /&gt;
cluster.clusternodes.clusternode.name=an-node01.alteeve.com&lt;br /&gt;
cluster.clusternodes.clusternode.nodeid=1&lt;br /&gt;
cluster.clusternodes.clusternode.fence.method.name=ipmi&lt;br /&gt;
cluster.clusternodes.clusternode.fence.method.device.name=ipmi_an01&lt;br /&gt;
cluster.clusternodes.clusternode.fence.method.device.action=reboot&lt;br /&gt;
cluster.clusternodes.clusternode.fence.method.name=pdu&lt;br /&gt;
cluster.clusternodes.clusternode.fence.method.device.name=pdu2&lt;br /&gt;
cluster.clusternodes.clusternode.fence.method.device.port=1&lt;br /&gt;
cluster.clusternodes.clusternode.fence.method.device.action=reboot&lt;br /&gt;
cluster.clusternodes.clusternode.name=an-node02.alteeve.com&lt;br /&gt;
cluster.clusternodes.clusternode.nodeid=2&lt;br /&gt;
cluster.clusternodes.clusternode.fence.method.name=ipmi&lt;br /&gt;
cluster.clusternodes.clusternode.fence.method.device.name=ipmi_an02&lt;br /&gt;
cluster.clusternodes.clusternode.fence.method.device.action=reboot&lt;br /&gt;
cluster.clusternodes.clusternode.fence.method.name=pdu&lt;br /&gt;
cluster.clusternodes.clusternode.fence.method.device.name=pdu2&lt;br /&gt;
cluster.clusternodes.clusternode.fence.method.device.port=2&lt;br /&gt;
cluster.clusternodes.clusternode.fence.method.device.action=reboot&lt;br /&gt;
cluster.fencedevices.fencedevice.name=ipmi_an01&lt;br /&gt;
cluster.fencedevices.fencedevice.agent=fence_ipmilan&lt;br /&gt;
cluster.fencedevices.fencedevice.ipaddr=an-node01.ipmi&lt;br /&gt;
cluster.fencedevices.fencedevice.login=root&lt;br /&gt;
cluster.fencedevices.fencedevice.passwd=secret&lt;br /&gt;
cluster.fencedevices.fencedevice.name=ipmi_an02&lt;br /&gt;
cluster.fencedevices.fencedevice.agent=fence_ipmilan&lt;br /&gt;
cluster.fencedevices.fencedevice.ipaddr=an-node02.ipmi&lt;br /&gt;
cluster.fencedevices.fencedevice.login=root&lt;br /&gt;
cluster.fencedevices.fencedevice.passwd=secret&lt;br /&gt;
cluster.fencedevices.fencedevice.agent=fence_apc_snmp&lt;br /&gt;
cluster.fencedevices.fencedevice.ipaddr=pdu2.alteeve.com&lt;br /&gt;
cluster.fencedevices.fencedevice.name=pdu2&lt;br /&gt;
cluster.fence_daemon.post_join_delay=30&lt;br /&gt;
cluster.totem.rrp_mode=none&lt;br /&gt;
cluster.totem.secauth=off&lt;br /&gt;
totem.rrp_mode=none&lt;br /&gt;
totem.secauth=off&lt;br /&gt;
totem.transport=udp&lt;br /&gt;
totem.version=2&lt;br /&gt;
totem.nodeid=1&lt;br /&gt;
totem.vsftype=none&lt;br /&gt;
totem.token=10000&lt;br /&gt;
totem.join=60&lt;br /&gt;
totem.fail_recv_const=2500&lt;br /&gt;
totem.consensus=2000&lt;br /&gt;
totem.key=an-cluster-A&lt;br /&gt;
totem.interface.ringnumber=0&lt;br /&gt;
totem.interface.bindnetaddr=10.20.0.1&lt;br /&gt;
totem.interface.mcastaddr=239.192.95.81&lt;br /&gt;
totem.interface.mcastport=5405&lt;br /&gt;
libccs.next_handle=7&lt;br /&gt;
libccs.connection.ccs_handle=3&lt;br /&gt;
libccs.connection.config_version=7&lt;br /&gt;
libccs.connection.fullxpath=0&lt;br /&gt;
libccs.connection.ccs_handle=4&lt;br /&gt;
libccs.connection.config_version=7&lt;br /&gt;
libccs.connection.fullxpath=0&lt;br /&gt;
libccs.connection.ccs_handle=5&lt;br /&gt;
libccs.connection.config_version=7&lt;br /&gt;
libccs.connection.fullxpath=0&lt;br /&gt;
logging.timestamp=on&lt;br /&gt;
logging.to_logfile=yes&lt;br /&gt;
logging.logfile=/var/log/cluster/corosync.log&lt;br /&gt;
logging.logfile_priority=info&lt;br /&gt;
logging.to_syslog=yes&lt;br /&gt;
logging.syslog_facility=local4&lt;br /&gt;
logging.syslog_priority=info&lt;br /&gt;
aisexec.user=ais&lt;br /&gt;
aisexec.group=ais&lt;br /&gt;
service.name=corosync_quorum&lt;br /&gt;
service.ver=0&lt;br /&gt;
service.name=corosync_cman&lt;br /&gt;
service.ver=0&lt;br /&gt;
quorum.provider=quorum_cman&lt;br /&gt;
service.name=openais_ckpt&lt;br /&gt;
service.ver=0&lt;br /&gt;
runtime.services.quorum.service_id=12&lt;br /&gt;
runtime.services.cman.service_id=9&lt;br /&gt;
runtime.services.ckpt.service_id=3&lt;br /&gt;
runtime.services.ckpt.0.tx=0&lt;br /&gt;
runtime.services.ckpt.0.rx=0&lt;br /&gt;
runtime.services.ckpt.1.tx=0&lt;br /&gt;
runtime.services.ckpt.1.rx=0&lt;br /&gt;
runtime.services.ckpt.2.tx=0&lt;br /&gt;
runtime.services.ckpt.2.rx=0&lt;br /&gt;
runtime.services.ckpt.3.tx=0&lt;br /&gt;
runtime.services.ckpt.3.rx=0&lt;br /&gt;
runtime.services.ckpt.4.tx=0&lt;br /&gt;
runtime.services.ckpt.4.rx=0&lt;br /&gt;
runtime.services.ckpt.5.tx=0&lt;br /&gt;
runtime.services.ckpt.5.rx=0&lt;br /&gt;
runtime.services.ckpt.6.tx=0&lt;br /&gt;
runtime.services.ckpt.6.rx=0&lt;br /&gt;
runtime.services.ckpt.7.tx=0&lt;br /&gt;
runtime.services.ckpt.7.rx=0&lt;br /&gt;
runtime.services.ckpt.8.tx=0&lt;br /&gt;
runtime.services.ckpt.8.rx=0&lt;br /&gt;
runtime.services.ckpt.9.tx=0&lt;br /&gt;
runtime.services.ckpt.9.rx=0&lt;br /&gt;
runtime.services.ckpt.10.tx=0&lt;br /&gt;
runtime.services.ckpt.10.rx=0&lt;br /&gt;
runtime.services.ckpt.11.tx=2&lt;br /&gt;
runtime.services.ckpt.11.rx=3&lt;br /&gt;
runtime.services.ckpt.12.tx=0&lt;br /&gt;
runtime.services.ckpt.12.rx=0&lt;br /&gt;
runtime.services.ckpt.13.tx=0&lt;br /&gt;
runtime.services.ckpt.13.rx=0&lt;br /&gt;
runtime.services.evs.service_id=0&lt;br /&gt;
runtime.services.evs.0.tx=0&lt;br /&gt;
runtime.services.evs.0.rx=0&lt;br /&gt;
runtime.services.cfg.service_id=7&lt;br /&gt;
runtime.services.cfg.0.tx=0&lt;br /&gt;
runtime.services.cfg.0.rx=0&lt;br /&gt;
runtime.services.cfg.1.tx=0&lt;br /&gt;
runtime.services.cfg.1.rx=0&lt;br /&gt;
runtime.services.cfg.2.tx=0&lt;br /&gt;
runtime.services.cfg.2.rx=0&lt;br /&gt;
runtime.services.cfg.3.tx=0&lt;br /&gt;
runtime.services.cfg.3.rx=0&lt;br /&gt;
runtime.services.cpg.service_id=8&lt;br /&gt;
runtime.services.cpg.0.tx=4&lt;br /&gt;
runtime.services.cpg.0.rx=8&lt;br /&gt;
runtime.services.cpg.1.tx=0&lt;br /&gt;
runtime.services.cpg.1.rx=0&lt;br /&gt;
runtime.services.cpg.2.tx=0&lt;br /&gt;
runtime.services.cpg.2.rx=0&lt;br /&gt;
runtime.services.cpg.3.tx=16&lt;br /&gt;
runtime.services.cpg.3.rx=23&lt;br /&gt;
runtime.services.cpg.4.tx=0&lt;br /&gt;
runtime.services.cpg.4.rx=0&lt;br /&gt;
runtime.services.cpg.5.tx=2&lt;br /&gt;
runtime.services.cpg.5.rx=3&lt;br /&gt;
runtime.services.confdb.service_id=11&lt;br /&gt;
runtime.services.pload.service_id=13&lt;br /&gt;
runtime.services.pload.0.tx=0&lt;br /&gt;
runtime.services.pload.0.rx=0&lt;br /&gt;
runtime.services.pload.1.tx=0&lt;br /&gt;
runtime.services.pload.1.rx=0&lt;br /&gt;
runtime.services.quorum.service_id=12&lt;br /&gt;
runtime.connections.active=6&lt;br /&gt;
runtime.connections.closed=110&lt;br /&gt;
runtime.connections.fenced:CPG:3490:19.service_id=8&lt;br /&gt;
runtime.connections.fenced:CPG:3490:19.client_pid=3490&lt;br /&gt;
runtime.connections.fenced:CPG:3490:19.responses=5&lt;br /&gt;
runtime.connections.fenced:CPG:3490:19.dispatched=9&lt;br /&gt;
runtime.connections.fenced:CPG:3490:19.requests=5&lt;br /&gt;
runtime.connections.fenced:CPG:3490:19.sem_retry_count=0&lt;br /&gt;
runtime.connections.fenced:CPG:3490:19.send_retry_count=0&lt;br /&gt;
runtime.connections.fenced:CPG:3490:19.recv_retry_count=0&lt;br /&gt;
runtime.connections.fenced:CPG:3490:19.flow_control=0&lt;br /&gt;
runtime.connections.fenced:CPG:3490:19.flow_control_count=0&lt;br /&gt;
runtime.connections.fenced:CPG:3490:19.queue_size=0&lt;br /&gt;
runtime.connections.fenced:CPG:3490:19.invalid_request=0&lt;br /&gt;
runtime.connections.fenced:CPG:3490:19.overload=0&lt;br /&gt;
runtime.connections.dlm_controld:CPG:3515:22.service_id=8&lt;br /&gt;
runtime.connections.dlm_controld:CPG:3515:22.client_pid=3515&lt;br /&gt;
runtime.connections.dlm_controld:CPG:3515:22.responses=5&lt;br /&gt;
runtime.connections.dlm_controld:CPG:3515:22.dispatched=8&lt;br /&gt;
runtime.connections.dlm_controld:CPG:3515:22.requests=5&lt;br /&gt;
runtime.connections.dlm_controld:CPG:3515:22.sem_retry_count=0&lt;br /&gt;
runtime.connections.dlm_controld:CPG:3515:22.send_retry_count=0&lt;br /&gt;
runtime.connections.dlm_controld:CPG:3515:22.recv_retry_count=0&lt;br /&gt;
runtime.connections.dlm_controld:CPG:3515:22.flow_control=0&lt;br /&gt;
runtime.connections.dlm_controld:CPG:3515:22.flow_control_count=0&lt;br /&gt;
runtime.connections.dlm_controld:CPG:3515:22.queue_size=0&lt;br /&gt;
runtime.connections.dlm_controld:CPG:3515:22.invalid_request=0&lt;br /&gt;
runtime.connections.dlm_controld:CPG:3515:22.overload=0&lt;br /&gt;
runtime.connections.dlm_controld:CKPT:3515:23.service_id=3&lt;br /&gt;
runtime.connections.dlm_controld:CKPT:3515:23.client_pid=3515&lt;br /&gt;
runtime.connections.dlm_controld:CKPT:3515:23.responses=0&lt;br /&gt;
runtime.connections.dlm_controld:CKPT:3515:23.dispatched=0&lt;br /&gt;
runtime.connections.dlm_controld:CKPT:3515:23.requests=0&lt;br /&gt;
runtime.connections.dlm_controld:CKPT:3515:23.sem_retry_count=0&lt;br /&gt;
runtime.connections.dlm_controld:CKPT:3515:23.send_retry_count=0&lt;br /&gt;
runtime.connections.dlm_controld:CKPT:3515:23.recv_retry_count=0&lt;br /&gt;
runtime.connections.dlm_controld:CKPT:3515:23.flow_control=0&lt;br /&gt;
runtime.connections.dlm_controld:CKPT:3515:23.flow_control_count=0&lt;br /&gt;
runtime.connections.dlm_controld:CKPT:3515:23.queue_size=0&lt;br /&gt;
runtime.connections.dlm_controld:CKPT:3515:23.invalid_request=0&lt;br /&gt;
runtime.connections.dlm_controld:CKPT:3515:23.overload=0&lt;br /&gt;
runtime.connections.gfs_controld:CPG:3565:26.service_id=8&lt;br /&gt;
runtime.connections.gfs_controld:CPG:3565:26.client_pid=3565&lt;br /&gt;
runtime.connections.gfs_controld:CPG:3565:26.responses=5&lt;br /&gt;
runtime.connections.gfs_controld:CPG:3565:26.dispatched=8&lt;br /&gt;
runtime.connections.gfs_controld:CPG:3565:26.requests=5&lt;br /&gt;
runtime.connections.gfs_controld:CPG:3565:26.sem_retry_count=0&lt;br /&gt;
runtime.connections.gfs_controld:CPG:3565:26.send_retry_count=0&lt;br /&gt;
runtime.connections.gfs_controld:CPG:3565:26.recv_retry_count=0&lt;br /&gt;
runtime.connections.gfs_controld:CPG:3565:26.flow_control=0&lt;br /&gt;
runtime.connections.gfs_controld:CPG:3565:26.flow_control_count=0&lt;br /&gt;
runtime.connections.gfs_controld:CPG:3565:26.queue_size=0&lt;br /&gt;
runtime.connections.gfs_controld:CPG:3565:26.invalid_request=0&lt;br /&gt;
runtime.connections.gfs_controld:CPG:3565:26.overload=0&lt;br /&gt;
runtime.connections.fenced:CPG:3490:28.service_id=8&lt;br /&gt;
runtime.connections.fenced:CPG:3490:28.client_pid=3490&lt;br /&gt;
runtime.connections.fenced:CPG:3490:28.responses=5&lt;br /&gt;
runtime.connections.fenced:CPG:3490:28.dispatched=8&lt;br /&gt;
runtime.connections.fenced:CPG:3490:28.requests=5&lt;br /&gt;
runtime.connections.fenced:CPG:3490:28.sem_retry_count=0&lt;br /&gt;
runtime.connections.fenced:CPG:3490:28.send_retry_count=0&lt;br /&gt;
runtime.connections.fenced:CPG:3490:28.recv_retry_count=0&lt;br /&gt;
runtime.connections.fenced:CPG:3490:28.flow_control=0&lt;br /&gt;
runtime.connections.fenced:CPG:3490:28.flow_control_count=0&lt;br /&gt;
runtime.connections.fenced:CPG:3490:28.queue_size=0&lt;br /&gt;
runtime.connections.fenced:CPG:3490:28.invalid_request=0&lt;br /&gt;
runtime.connections.fenced:CPG:3490:28.overload=0&lt;br /&gt;
runtime.connections.corosync-objctl:CONFDB:3698:27.service_id=11&lt;br /&gt;
runtime.connections.corosync-objctl:CONFDB:3698:27.client_pid=3698&lt;br /&gt;
runtime.connections.corosync-objctl:CONFDB:3698:27.responses=444&lt;br /&gt;
runtime.connections.corosync-objctl:CONFDB:3698:27.dispatched=0&lt;br /&gt;
runtime.connections.corosync-objctl:CONFDB:3698:27.requests=447&lt;br /&gt;
runtime.connections.corosync-objctl:CONFDB:3698:27.sem_retry_count=0&lt;br /&gt;
runtime.connections.corosync-objctl:CONFDB:3698:27.send_retry_count=0&lt;br /&gt;
runtime.connections.corosync-objctl:CONFDB:3698:27.recv_retry_count=0&lt;br /&gt;
runtime.connections.corosync-objctl:CONFDB:3698:27.flow_control=0&lt;br /&gt;
runtime.connections.corosync-objctl:CONFDB:3698:27.flow_control_count=0&lt;br /&gt;
runtime.connections.corosync-objctl:CONFDB:3698:27.queue_size=0&lt;br /&gt;
runtime.connections.corosync-objctl:CONFDB:3698:27.invalid_request=0&lt;br /&gt;
runtime.connections.corosync-objctl:CONFDB:3698:27.overload=0&lt;br /&gt;
runtime.totem.pg.msg_reserved=1&lt;br /&gt;
runtime.totem.pg.msg_queue_avail=761&lt;br /&gt;
runtime.totem.pg.mrp.srp.orf_token_tx=2&lt;br /&gt;
runtime.totem.pg.mrp.srp.orf_token_rx=405&lt;br /&gt;
runtime.totem.pg.mrp.srp.memb_merge_detect_tx=53&lt;br /&gt;
runtime.totem.pg.mrp.srp.memb_merge_detect_rx=53&lt;br /&gt;
runtime.totem.pg.mrp.srp.memb_join_tx=3&lt;br /&gt;
runtime.totem.pg.mrp.srp.memb_join_rx=5&lt;br /&gt;
runtime.totem.pg.mrp.srp.mcast_tx=45&lt;br /&gt;
runtime.totem.pg.mrp.srp.mcast_retx=0&lt;br /&gt;
runtime.totem.pg.mrp.srp.mcast_rx=56&lt;br /&gt;
runtime.totem.pg.mrp.srp.memb_commit_token_tx=4&lt;br /&gt;
runtime.totem.pg.mrp.srp.memb_commit_token_rx=4&lt;br /&gt;
runtime.totem.pg.mrp.srp.token_hold_cancel_tx=4&lt;br /&gt;
runtime.totem.pg.mrp.srp.token_hold_cancel_rx=7&lt;br /&gt;
runtime.totem.pg.mrp.srp.operational_entered=2&lt;br /&gt;
runtime.totem.pg.mrp.srp.operational_token_lost=0&lt;br /&gt;
runtime.totem.pg.mrp.srp.gather_entered=2&lt;br /&gt;
runtime.totem.pg.mrp.srp.gather_token_lost=0&lt;br /&gt;
runtime.totem.pg.mrp.srp.commit_entered=2&lt;br /&gt;
runtime.totem.pg.mrp.srp.commit_token_lost=0&lt;br /&gt;
runtime.totem.pg.mrp.srp.recovery_entered=2&lt;br /&gt;
runtime.totem.pg.mrp.srp.recovery_token_lost=0&lt;br /&gt;
runtime.totem.pg.mrp.srp.consensus_timeouts=0&lt;br /&gt;
runtime.totem.pg.mrp.srp.mtt_rx_token=913&lt;br /&gt;
runtime.totem.pg.mrp.srp.avg_token_workload=0&lt;br /&gt;
runtime.totem.pg.mrp.srp.avg_backlog_calc=0&lt;br /&gt;
runtime.totem.pg.mrp.srp.rx_msg_dropped=0&lt;br /&gt;
runtime.totem.pg.mrp.srp.continuous_gather=0&lt;br /&gt;
runtime.totem.pg.mrp.srp.firewall_enabled_or_nic_failure=0&lt;br /&gt;
runtime.totem.pg.mrp.srp.members.1.ip=r(0) ip(10.20.0.1) &lt;br /&gt;
runtime.totem.pg.mrp.srp.members.1.join_count=1&lt;br /&gt;
runtime.totem.pg.mrp.srp.members.1.status=joined&lt;br /&gt;
runtime.totem.pg.mrp.srp.members.2.ip=r(0) ip(10.20.0.2) &lt;br /&gt;
runtime.totem.pg.mrp.srp.members.2.join_count=1&lt;br /&gt;
runtime.totem.pg.mrp.srp.members.2.status=joined&lt;br /&gt;
runtime.blackbox.dump_flight_data=no&lt;br /&gt;
runtime.blackbox.dump_state=no&lt;br /&gt;
cman_private.COROSYNC_DEFAULT_CONFIG_IFACE=xmlconfig:cmanpreconfig&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you want to check what [[DLM]] lockspaces, you can use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;dlm_tool ls&amp;lt;/span&amp;gt; to list lock spaces. Given that we&#039;re not running and resources or clustered filesystems though, there won&#039;t be any at this time. We&#039;ll look at this again later.&lt;br /&gt;
&lt;br /&gt;
== Testing Fencing ==&lt;br /&gt;
&lt;br /&gt;
We need to thoroughly test our fence configuration and devices before we proceed. Should the cluster call a fence, and if the fence call fails, the cluster will hang until the fence finally succeeds. There is no way to abort a fence, so this could effectively hang the cluster. If we have problems, we need to find them now.&lt;br /&gt;
&lt;br /&gt;
We need to run two tests from each node against the other node for a total of four tests.&lt;br /&gt;
* The first test will use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fence_ipmilan&amp;lt;/span&amp;gt;. To do this, we will hang the victim node by running &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;echo c &amp;gt; /proc/sysrq-trigger&amp;lt;/span&amp;gt; on it. This will immediately and completely hang the kernel. The other node should detect the failure and reboot the victim. You can confirm that IPMI was used by watching the fence PDU and &#039;&#039;&#039;not&#039;&#039;&#039; seeing it power-cycle the port.&lt;br /&gt;
* Secondly, we will pull the power on the victim node. This is done to ensure that the IPMI BMC is also dead and will simulate a failure in the power supply. You should see the other node try to fence the victim, fail initially, then try again using the second, switched PDU. If you want the PDU, you should see the power indicator LED go off and then come back on. &lt;br /&gt;
&lt;br /&gt;
{{note|1=To &amp;quot;pull the power&amp;quot;, we can actually just log into the PDU and turn off the victim&#039;s power. In this case, we&#039;ll see the power restored when the PDU is used to fence the node. We can actually use the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fence_apc&amp;lt;/span&amp;gt; fence agent to pull the power, as we&#039;ll see.}}&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Test&lt;br /&gt;
!Victim&lt;br /&gt;
!Pass?&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;echo c &amp;gt; /proc/sysrq-trigger&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;span style=&amp;quot;color: green;&amp;quot;&amp;gt;Yes&amp;lt;/span&amp;gt; / &amp;lt;span style=&amp;quot;color: red;&amp;quot;&amp;gt;No&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fence_apc_snmp -a pdu2.alteeve.com -n 1 -o off&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;span style=&amp;quot;color: green;&amp;quot;&amp;gt;Yes&amp;lt;/span&amp;gt; / &amp;lt;span style=&amp;quot;color: red;&amp;quot;&amp;gt;No&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;echo c &amp;gt; /proc/sysrq-trigger&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;span style=&amp;quot;color: green;&amp;quot;&amp;gt;Yes&amp;lt;/span&amp;gt; / &amp;lt;span style=&amp;quot;color: red;&amp;quot;&amp;gt;No&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fence_apc_snmp -a pdu2.alteeve.com -n 2 -o off&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;span style=&amp;quot;color: green;&amp;quot;&amp;gt;Yes&amp;lt;/span&amp;gt; / &amp;lt;span style=&amp;quot;color: red;&amp;quot;&amp;gt;No&amp;lt;/span&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
After the lost node is recovered, remember to restart &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt; before starting the next test.&lt;br /&gt;
&lt;br /&gt;
=== Hanging an-node01 ===&lt;br /&gt;
&lt;br /&gt;
Be sure to be &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;tail&amp;lt;/span&amp;gt;ing the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/var/log/messages&amp;lt;/span&amp;gt; on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt;. Go to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;&#039;s first terminal and run the following command. &lt;br /&gt;
&lt;br /&gt;
{{warning|1=This command will not return and you will lose all ability to talk to this node until it is rebooted.}}&lt;br /&gt;
&lt;br /&gt;
On &#039;&#039;&#039;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;&#039;&#039;&#039; 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;
On &#039;&#039;&#039;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt;&#039;&#039;&#039;&#039;s syslog terminal, you should see the following entries in the log.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Dec 13 12:42:39 an-node02 corosync[2758]:   [TOTEM ] A processor failed, forming new configuration.&lt;br /&gt;
Dec 13 12:42:41 an-node02 corosync[2758]:   [QUORUM] Members[1]: 2&lt;br /&gt;
Dec 13 12:42:41 an-node02 corosync[2758]:   [TOTEM ] A processor joined or left the membership and a new membership was formed.&lt;br /&gt;
Dec 13 12:42:41 an-node02 corosync[2758]:   [CPG   ] chosen downlist: sender r(0) ip(10.20.0.2) ; members(old:2 left:1)&lt;br /&gt;
Dec 13 12:42:41 an-node02 corosync[2758]:   [MAIN  ] Completed service synchronization, ready to provide service.&lt;br /&gt;
Dec 13 12:42:41 an-node02 kernel: dlm: closing connection to node 1&lt;br /&gt;
Dec 13 12:42:41 an-node02 fenced[2817]: fencing node an-node01.alteeve.com&lt;br /&gt;
Dec 13 12:42:56 an-node02 fenced[2817]: fence an-node01.alteeve.com success&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Perfect!&lt;br /&gt;
&lt;br /&gt;
If you are watching &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;&#039;s display, you should now see it starting to boot back up. &lt;br /&gt;
&lt;br /&gt;
{{note|1=Remember to start &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt; once the node boots back up before trying the next test.}}&lt;br /&gt;
&lt;br /&gt;
=== Cutting the Power to an-node01 ===&lt;br /&gt;
&lt;br /&gt;
As was discussed earlier, IPMI and other out-of-band management interfaces have a fatal flaw as a fence device. Their [[BMC]] draws its power from the same power supply as the node itself. Thus, when the power supply itself fails (or the mains connection is pulled/tripped over), fencing via IPMI will fail. This makes the power supply a single point of failure, which is what the PDU protects us against.&lt;br /&gt;
&lt;br /&gt;
So to simulate a failed power supply, we&#039;re going to use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt;&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fence_apc&amp;lt;/span&amp;gt; fence agent to turn off the power to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
Alternatively, you could also just unplug the power and the fence would still succeed. The fence call only needs to confirm that the node is off to succeed. Whether the node restarts after or not is not important so far as the cluster is concerned.&lt;br /&gt;
&lt;br /&gt;
From &#039;&#039;&#039;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt;&#039;&#039;&#039;, pull the power on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt; with the following call;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
fence_apc_snmp -a pdu2.alteeve.com -n 1 -o off&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Success: Powered OFF&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Back on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt;&#039;s syslog, we should see the following entries;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Dec 13 12:45:46 an-node02 corosync[2758]:   [TOTEM ] A processor failed, forming new configuration.&lt;br /&gt;
Dec 13 12:45:48 an-node02 corosync[2758]:   [QUORUM] Members[1]: 2&lt;br /&gt;
Dec 13 12:45:48 an-node02 corosync[2758]:   [TOTEM ] A processor joined or left the membership and a new membership was formed.&lt;br /&gt;
Dec 13 12:45:48 an-node02 corosync[2758]:   [CPG   ] chosen downlist: sender r(0) ip(10.20.0.2) ; members(old:2 left:1)&lt;br /&gt;
Dec 13 12:45:48 an-node02 corosync[2758]:   [MAIN  ] Completed service synchronization, ready to provide service.&lt;br /&gt;
Dec 13 12:45:48 an-node02 kernel: dlm: closing connection to node 1&lt;br /&gt;
Dec 13 12:45:48 an-node02 fenced[2817]: fencing node an-node01.alteeve.com&lt;br /&gt;
Dec 13 12:46:08 an-node02 fenced[2817]: fence an-node01.alteeve.com dev 0.0 agent fence_ipmilan result: error from agent&lt;br /&gt;
Dec 13 12:46:08 an-node02 fenced[2817]: fence an-node01.alteeve.com success&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Hoozah!&lt;br /&gt;
&lt;br /&gt;
Notice that there is an error from the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fence_ipmilan&amp;lt;/span&amp;gt;. This is exactly what we expected because of the IPMI&#039;s BMC lost power and couldn&#039;t respond.&lt;br /&gt;
&lt;br /&gt;
So now we know that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt; can be fenced successfully from both fence devices. Now we need to run the same tests against &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Hanging an-node02 ===&lt;br /&gt;
&lt;br /&gt;
{{warning|1=&#039;&#039;&#039;DO NOT ASSUME THAT &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt; WILL FENCE PROPERLY JUST BECAUSE &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt; PASSED!&#039;&#039;&#039;. There are many ways that a fence could fail; Bad password, misconfigured device, plugged into the wrong port on the PDU and so on. Always test all nodes using all methods!}}&lt;br /&gt;
&lt;br /&gt;
Be sure to be &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;tail&amp;lt;/span&amp;gt;ing the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/var/log/messages&amp;lt;/span&amp;gt; on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt;. Go to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;&#039;s first terminal and run the following command. &lt;br /&gt;
&lt;br /&gt;
{{note|1=This command will not return and you will lose all ability to talk to this node until it is rebooted.}}&lt;br /&gt;
&lt;br /&gt;
On &#039;&#039;&#039;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt;&#039;&#039;&#039; 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;
On &#039;&#039;&#039;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;&#039;&#039;&#039;&#039;s syslog terminal, you should see the following entries in the log.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Dec 13 12:52:34 an-node01 corosync[3445]:   [TOTEM ] A processor failed, forming new configuration.&lt;br /&gt;
Dec 13 12:52:36 an-node01 corosync[3445]:   [QUORUM] Members[1]: 1&lt;br /&gt;
Dec 13 12:52:36 an-node01 corosync[3445]:   [TOTEM ] A processor joined or left the membership and a new membership was formed.&lt;br /&gt;
Dec 13 12:52:36 an-node01 corosync[3445]:   [CPG   ] chosen downlist: sender r(0) ip(10.20.0.1) ; members(old:2 left:1)&lt;br /&gt;
Dec 13 12:52:36 an-node01 corosync[3445]:   [MAIN  ] Completed service synchronization, ready to provide service.&lt;br /&gt;
Dec 13 12:52:36 an-node01 kernel: dlm: closing connection to node 2&lt;br /&gt;
Dec 13 12:52:36 an-node01 fenced[3501]: fencing node an-node02.alteeve.com&lt;br /&gt;
Dec 13 12:52:51 an-node01 fenced[3501]: fence an-node02.alteeve.com success&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Again, perfect!&lt;br /&gt;
&lt;br /&gt;
=== Cutting the Power to an-node02 ===&lt;br /&gt;
&lt;br /&gt;
From &#039;&#039;&#039;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;&#039;&#039;&#039;, pull the power on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt; with the following call;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
fence_apc_snmp -a pdu2.alteeve.com -n 2 -o off&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Success: Powered OFF&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Back on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;&#039;s syslog, we should see the following entries;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Dec 13 12:55:58 an-node01 corosync[3445]:   [TOTEM ] A processor failed, forming new configuration.&lt;br /&gt;
Dec 13 12:56:00 an-node01 corosync[3445]:   [QUORUM] Members[1]: 1&lt;br /&gt;
Dec 13 12:56:00 an-node01 corosync[3445]:   [TOTEM ] A processor joined or left the membership and a new membership was formed.&lt;br /&gt;
Dec 13 12:56:00 an-node01 corosync[3445]:   [CPG   ] chosen downlist: sender r(0) ip(10.20.0.1) ; members(old:2 left:1)&lt;br /&gt;
Dec 13 12:56:00 an-node01 kernel: dlm: closing connection to node 2&lt;br /&gt;
Dec 13 12:56:00 an-node01 corosync[3445]:   [MAIN  ] Completed service synchronization, ready to provide service.&lt;br /&gt;
Dec 13 12:56:00 an-node01 fenced[3501]: fencing node an-node02.alteeve.com&lt;br /&gt;
Dec 13 12:56:20 an-node01 fenced[3501]: fence an-node02.alteeve.com dev 0.0 agent fence_ipmilan result: error from agent&lt;br /&gt;
Dec 13 12:56:20 an-node01 fenced[3501]: fence an-node02.alteeve.com success&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Woot!&lt;br /&gt;
&lt;br /&gt;
Only now can we safely say that our fencing is setup and working properly.&lt;br /&gt;
&lt;br /&gt;
== Testing Network Redundancy ==&lt;br /&gt;
&lt;br /&gt;
Next up of the testing block is our network configuration. Seeing as we&#039;ve build our bonds, we need to now test that they are working properly. &lt;br /&gt;
&lt;br /&gt;
* Make sure that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt; has started on both nodes.&lt;br /&gt;
&lt;br /&gt;
First, we&#039;ll test all network cables individually, one node and one bonded interface at a time.&lt;br /&gt;
&lt;br /&gt;
* For each network; IFN, SN and BCN;&lt;br /&gt;
** On both nodes, start a ping flood against the opposing node specifying the appropriate network name suffix in the first window and starting &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;tail&amp;lt;/span&amp;gt;ing syslog in the second window.&lt;br /&gt;
** &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;watch&amp;lt;/span&amp;gt; each bond&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/proc/net/bonding/bondX&amp;lt;/span&amp;gt; file to see which interfaces are active.&lt;br /&gt;
** Pull the currently-active network cable from the bond (either at the switch or at the node).&lt;br /&gt;
** Check the state of the bonds again and see that they&#039;ve switched to their backup interface. If a node gets fenced, you know something went wrong. You should see a handful of lost packets in the ping flood.&lt;br /&gt;
** Restore the network cable and wait 2 minutes, then verify that the old primary interface was restored. You will see another handful of lost packets in the flood during the recovery.&lt;br /&gt;
** Pull the cable again, then restore it. This time, do not wait 2 minutes. After just a few seconds, pull the backup link and ensure that the bond immediately resumed use of the primary interface.&lt;br /&gt;
** Repeat the above steps for all bonds on both nodes. This will take a while, but you need to ensure configuration errors are found now.&lt;br /&gt;
&lt;br /&gt;
{{warning|1=Testing the complete primary switch failure and subsequant recovery is very, very important. Please do NOT skip this step!}}&lt;br /&gt;
&lt;br /&gt;
Once all bonds have been tested, we&#039;ll do a final test by failing the primary switch.&lt;br /&gt;
* Cut the power to the switch.&lt;br /&gt;
* Check all bond status files. Confirm that all have switched to their backup links.&lt;br /&gt;
* Restore power to the switch and wait 2 minutes.&lt;br /&gt;
* Confirm that the bonds did not switch to the primary interfaces before the switch was ready to move data.&lt;br /&gt;
&lt;br /&gt;
If all of these steps pass and the cluster doesn&#039;t partition, then you can be confident that your network is configured properly for full redundancy.&lt;br /&gt;
&lt;br /&gt;
=== Network Testing Terminal Layout ===&lt;br /&gt;
&lt;br /&gt;
If you have a couple of monitors, particularly one with portrait mode, you might be able to open 16 terminals at once. This is how many are needed to run ping floods, watch the bond status files, tail syslog and watch cman_tool all at the same time. This configuration makes it very easy to keep a near real-time, complete view of all network components.&lt;br /&gt;
&lt;br /&gt;
On the left window, the top-left terminal shows &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;watch cman_tool status&amp;lt;/span&amp;gt; and the top-right terminal shows &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;tail -f -n 0 /var/log/messages&amp;lt;/span&amp;gt; for &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;. The bottom two terminals show the same for &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
On the right, portrait-mode window, the terminal layout used for monitoring the bonded link status and ping floods are shown. There are two columns; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt; on the left and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt; on the right. Each column is stacked into six rows, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;bond0&amp;lt;/span&amp;gt; on the top followed by &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ping -f an-node02.bcn&amp;lt;/span&amp;gt;, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;bond1&amp;lt;/span&amp;gt; in the middle followed by &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ping -f an-node02.sn&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;bond2&amp;lt;/span&amp;gt; at the bottom followed by &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ping -f an-node02.ifn&amp;lt;/span&amp;gt;. The left window shows the standard &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;tail&amp;lt;/span&amp;gt; on syslog plus &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;watch cman_tool status&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[Image:2-node_el6-tutorial_network-test_terminal-layout_01.png|thumb|center|700px|Terminal layout used for HA network testing; Calls shown.]]&lt;br /&gt;
&lt;br /&gt;
[[Image:2-node_el6-tutorial_network-test_terminal-layout_02.png|thumb|center|700px|Terminal layout used for HA network testing; Calls running.]]&lt;br /&gt;
&lt;br /&gt;
=== How to Know if the Tests Passed ===&lt;br /&gt;
&lt;br /&gt;
Well, the most obvious answer to this question is if the cluster is still working after a switch is powered off.&lt;br /&gt;
&lt;br /&gt;
We can be a little more subtle than that though.&lt;br /&gt;
&lt;br /&gt;
The state of each bond is viewable by looking in the special &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/proc/net/bonding/bondX&amp;lt;/span&amp;gt; files, where &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;X&amp;lt;/span&amp;gt; is the bond number. Lets take a look at &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;bond0&amp;lt;/span&amp;gt; on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cat /proc/net/bonding/bond0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Ethernet Channel Bonding Driver: v3.6.0 (September 26, 2009)&lt;br /&gt;
&lt;br /&gt;
Bonding Mode: fault-tolerance (active-backup)&lt;br /&gt;
Primary Slave: eth0 (primary_reselect always)&lt;br /&gt;
Currently Active Slave: eth0&lt;br /&gt;
MII Status: up&lt;br /&gt;
MII Polling Interval (ms): 100&lt;br /&gt;
Up Delay (ms): 120000&lt;br /&gt;
Down Delay (ms): 0&lt;br /&gt;
&lt;br /&gt;
Slave Interface: eth0&lt;br /&gt;
MII Status: up&lt;br /&gt;
Link Failure Count: 0&lt;br /&gt;
Permanent HW addr: 00:e0:81:c7:ec:49&lt;br /&gt;
Slave queue ID: 0&lt;br /&gt;
&lt;br /&gt;
Slave Interface: eth3&lt;br /&gt;
MII Status: up&lt;br /&gt;
Link Failure Count: 0&lt;br /&gt;
Permanent HW addr: 00:1b:21:9d:59:fc&lt;br /&gt;
Slave queue ID: 0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can see that the currently active interface is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth0&amp;lt;/span&amp;gt;. This is the key bit we&#039;re going to be watching for these tests. I know that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth0&amp;lt;/span&amp;gt; on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt; is connected to by first switch. So when I pull the cable to that switch, or when I fail that switch entirely, I should see &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth3&amp;lt;/span&amp;gt; take over.&lt;br /&gt;
&lt;br /&gt;
We&#039;ll also be watching syslog. If things work right, we should not see any messages from the cluster during failure and recovery.&lt;br /&gt;
&lt;br /&gt;
=== Failing The First Interface ===&lt;br /&gt;
&lt;br /&gt;
Let&#039;s look at the first test. We&#039;ll fail &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth0&amp;lt;/span&amp;gt; interface by pulling its cable.&lt;br /&gt;
&lt;br /&gt;
On &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;&#039;s syslog, you will see;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Dec 13 14:03:19 an-node01 kernel: e1000e: eth0 NIC Link is Down&lt;br /&gt;
Dec 13 14:03:19 an-node01 kernel: bonding: bond0: link status definitely down for interface eth0, disabling it&lt;br /&gt;
Dec 13 14:03:19 an-node01 kernel: bonding: bond0: making interface eth3 the new active one.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Looking again at &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;bond0&amp;lt;/span&amp;gt;&#039;s status;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cat /proc/net/bonding/bond0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Ethernet Channel Bonding Driver: v3.6.0 (September 26, 2009)&lt;br /&gt;
&lt;br /&gt;
Bonding Mode: fault-tolerance (active-backup)&lt;br /&gt;
Primary Slave: eth0 (primary_reselect always)&lt;br /&gt;
Currently Active Slave: eth3&lt;br /&gt;
MII Status: up&lt;br /&gt;
MII Polling Interval (ms): 100&lt;br /&gt;
Up Delay (ms): 120000&lt;br /&gt;
Down Delay (ms): 0&lt;br /&gt;
&lt;br /&gt;
Slave Interface: eth0&lt;br /&gt;
MII Status: down&lt;br /&gt;
Link Failure Count: 1&lt;br /&gt;
Permanent HW addr: 00:e0:81:c7:ec:49&lt;br /&gt;
Slave queue ID: 0&lt;br /&gt;
&lt;br /&gt;
Slave Interface: eth3&lt;br /&gt;
MII Status: up&lt;br /&gt;
Link Failure Count: 0&lt;br /&gt;
Permanent HW addr: 00:1b:21:9d:59:fc&lt;br /&gt;
Slave queue ID: 0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can see now that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth0&amp;lt;/span&amp;gt; is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;down&amp;lt;/span&amp;gt; and that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth3&amp;lt;/span&amp;gt; has taken over.&lt;br /&gt;
&lt;br /&gt;
If you look at the windows running the ping flood, both &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt; should show nearly the same number of lost packets;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
PING an-node02 (10.20.0.2) 56(84) bytes of data.&lt;br /&gt;
........................&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The failure of the link was successful!&lt;br /&gt;
&lt;br /&gt;
=== Recovering The First Interface ===&lt;br /&gt;
&lt;br /&gt;
Surviving failure is only half the test. We also need to test the recovery of the interface. When ready, reconnect &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth0&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The first thing you should notice is in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;&#039;s syslog;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Dec 13 14:06:40 an-node01 kernel: e1000e: eth0 NIC Link is Up 1000 Mbps Full Duplex, Flow Control: Rx/Tx&lt;br /&gt;
Dec 13 14:06:40 an-node01 kernel: bonding: bond0: link status up for interface eth0, enabling it in 120000 ms.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The bond will still be using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth3&amp;lt;/span&amp;gt;, so lets wait two minutes.&lt;br /&gt;
&lt;br /&gt;
After the two minutes, you should see the following addition syslog entries.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Dec 13 14:08:40 an-node01 kernel: bond0: link status definitely up for interface eth0, 1000 Mbps full duplex.&lt;br /&gt;
Dec 13 14:08:40 an-node01 kernel: bonding: bond0: making interface eth0 the new active one.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If we go back to the bond status file, we&#039;ll see that the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth0&amp;lt;/span&amp;gt; interface has been restored.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cat /proc/net/bonding/bond0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Ethernet Channel Bonding Driver: v3.6.0 (September 26, 2009)&lt;br /&gt;
&lt;br /&gt;
Bonding Mode: fault-tolerance (active-backup)&lt;br /&gt;
Primary Slave: eth0 (primary_reselect always)&lt;br /&gt;
Currently Active Slave: eth0&lt;br /&gt;
MII Status: up&lt;br /&gt;
MII Polling Interval (ms): 100&lt;br /&gt;
Up Delay (ms): 120000&lt;br /&gt;
Down Delay (ms): 0&lt;br /&gt;
&lt;br /&gt;
Slave Interface: eth0&lt;br /&gt;
MII Status: up&lt;br /&gt;
Link Failure Count: 1&lt;br /&gt;
Permanent HW addr: 00:e0:81:c7:ec:49&lt;br /&gt;
Slave queue ID: 0&lt;br /&gt;
&lt;br /&gt;
Slave Interface: eth3&lt;br /&gt;
MII Status: up&lt;br /&gt;
Link Failure Count: 0&lt;br /&gt;
Permanent HW addr: 00:1b:21:9d:59:fc&lt;br /&gt;
Slave queue ID: 0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that the only difference from before is that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth0&amp;lt;/span&amp;gt;&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Link Failure Count&amp;lt;/span&amp;gt; has been incremented to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The test has passed!&lt;br /&gt;
&lt;br /&gt;
Now repeat the test for the other two bonds, then for all three bonds on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt;. Remember to also repeat each test, but pull the backup interface before the 2 minutes delays has completed. The primary interface should immediately take over again. This will confirm that failover for the backup link is also working properly.&lt;br /&gt;
&lt;br /&gt;
=== Failing The First Switch ===&lt;br /&gt;
&lt;br /&gt;
{{note|1=Make sure that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt; is running before beginning the test! The real test is less about the failure and recovery of the network itself and more about whether it fails and recovers in such a way that the cluster stays up and no partitioning occurs.}}&lt;br /&gt;
&lt;br /&gt;
Check that all bonds on both nodes are using their primary interfaces. Confirm your cabling to ensure that these are all routed to the primary switch and that all backup links are cabled into the backup switch. Once done, pull the power to the primary switch. Both nodes should show similar output in their syslog windows;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Dec 13 14:16:17 an-node01 kernel: e1000e: eth2 NIC Link is Down&lt;br /&gt;
Dec 13 14:16:17 an-node01 kernel: e1000e: eth0 NIC Link is Down&lt;br /&gt;
Dec 13 14:16:17 an-node01 kernel: bonding: bond0: link status definitely down for interface eth0, disabling it&lt;br /&gt;
Dec 13 14:16:17 an-node01 kernel: bonding: bond0: making interface eth3 the new active one.&lt;br /&gt;
Dec 13 14:16:17 an-node01 kernel: bonding: bond2: link status definitely down for interface eth2, disabling it&lt;br /&gt;
Dec 13 14:16:17 an-node01 kernel: bonding: bond2: making interface eth5 the new active one.&lt;br /&gt;
Dec 13 14:16:17 an-node01 kernel: device eth2 left promiscuous mode&lt;br /&gt;
Dec 13 14:16:17 an-node01 kernel: device eth5 entered promiscuous mode&lt;br /&gt;
Dec 13 14:16:17 an-node01 kernel: e1000e: eth1 NIC Link is Down&lt;br /&gt;
Dec 13 14:16:18 an-node01 kernel: bonding: bond1: link status definitely down for interface eth1, disabling it&lt;br /&gt;
Dec 13 14:16:18 an-node01 kernel: bonding: bond1: making interface eth4 the new active one.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I can look at &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/proc/net/bonding/bond0&amp;lt;/span&amp;gt; file and see:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cat /proc/net/bonding/bond0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Ethernet Channel Bonding Driver: v3.6.0 (September 26, 2009)&lt;br /&gt;
&lt;br /&gt;
Bonding Mode: fault-tolerance (active-backup)&lt;br /&gt;
Primary Slave: eth0 (primary_reselect always)&lt;br /&gt;
Currently Active Slave: eth3&lt;br /&gt;
MII Status: up&lt;br /&gt;
MII Polling Interval (ms): 100&lt;br /&gt;
Up Delay (ms): 120000&lt;br /&gt;
Down Delay (ms): 0&lt;br /&gt;
&lt;br /&gt;
Slave Interface: eth0&lt;br /&gt;
MII Status: down&lt;br /&gt;
Link Failure Count: 3&lt;br /&gt;
Permanent HW addr: 00:e0:81:c7:ec:49&lt;br /&gt;
Slave queue ID: 0&lt;br /&gt;
&lt;br /&gt;
Slave Interface: eth3&lt;br /&gt;
MII Status: up&lt;br /&gt;
Link Failure Count: 2&lt;br /&gt;
Permanent HW addr: 00:1b:21:9d:59:fc&lt;br /&gt;
Slave queue ID: 0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Notice &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Currently Active Slave&amp;lt;/span&amp;gt; is now &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth3&amp;lt;/span&amp;gt;? You can also see now that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth0&amp;lt;/span&amp;gt;&#039;s link is down (&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;MII Status: down&amp;lt;/span&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
It should be the same story for all the other bonds on both nodes. &lt;br /&gt;
&lt;br /&gt;
If we check the status of the cluster, we&#039;ll see that all is good.&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: 7&lt;br /&gt;
Cluster Name: an-cluster-A&lt;br /&gt;
Cluster Id: 24561&lt;br /&gt;
Cluster Member: Yes&lt;br /&gt;
Cluster Generation: 40&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;
Node votes: 1&lt;br /&gt;
Quorum: 1  &lt;br /&gt;
Active subsystems: 7&lt;br /&gt;
Flags: 2node &lt;br /&gt;
Ports Bound: 0  &lt;br /&gt;
Node name: an-node01.alteeve.com&lt;br /&gt;
Node ID: 1&lt;br /&gt;
Multicast addresses: 239.192.95.81 &lt;br /&gt;
Node addresses: 10.20.0.1 &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Success! We just failed the primary switch without any interruption of clustered services.&lt;br /&gt;
&lt;br /&gt;
We&#039;re not out of the woods yet, though...&lt;br /&gt;
&lt;br /&gt;
=== Restoring The First Switch ===&lt;br /&gt;
&lt;br /&gt;
Now that we&#039;ve confirmed all of the bonds are working on the backup switch, lets restore power to the first switch.&lt;br /&gt;
&lt;br /&gt;
{{warning|1=Be sure to wait five minutes after restoring power before declaring the recovery a success! Some configuration faults will take a few minutes to appear.}}&lt;br /&gt;
&lt;br /&gt;
It is very important to wait for a while after restoring power to the switch. Some of the common problems that can break your cluster will not show up immediately. A good example is a misconfiguration of [[STP]]. In this case, the switch will come up, a short time will pass and then the switch will trigger an STP reconfiguration. Once this happens, both switches will block traffic for many seconds. This will partition you cluster.&lt;br /&gt;
&lt;br /&gt;
So then, lets power it back up.&lt;br /&gt;
&lt;br /&gt;
Within a few moments, you should see this in your syslog;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Dec 13 14:19:30 an-node01 kernel: e1000e: eth0 NIC Link is Up 1000 Mbps Full Duplex, Flow Control: Rx/Tx&lt;br /&gt;
Dec 13 14:19:30 an-node01 kernel: bonding: bond0: link status up for interface eth0, enabling it in 120000 ms.&lt;br /&gt;
Dec 13 14:19:30 an-node01 kernel: e1000e: eth2 NIC Link is Up 1000 Mbps Full Duplex, Flow Control: Rx/Tx&lt;br /&gt;
Dec 13 14:19:30 an-node01 kernel: e1000e: eth1 NIC Link is Up 1000 Mbps Full Duplex, Flow Control: Rx/Tx&lt;br /&gt;
Dec 13 14:19:30 an-node01 kernel: bonding: bond2: link status up for interface eth2, enabling it in 120000 ms.&lt;br /&gt;
Dec 13 14:19:30 an-node01 kernel: bonding: bond1: link status up for interface eth1, enabling it in 120000 ms.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As with the individual link test, the backup interfaces will remain in use for two minutes. This is critical because &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;miimon&amp;lt;/span&amp;gt; has detected the connection to the switches, but the switches are still a long way from being able to route traffic. After the two minutes, we&#039;ll see the primary interfaces return to active state.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Dec 13 14:20:25 an-node01 kernel: e1000e: eth0 NIC Link is Down&lt;br /&gt;
Dec 13 14:20:25 an-node01 kernel: bonding: bond0: link status down again after 55000 ms for interface eth0.&lt;br /&gt;
Dec 13 14:20:26 an-node01 kernel: e1000e: eth1 NIC Link is Down&lt;br /&gt;
Dec 13 14:20:26 an-node01 kernel: bonding: bond1: link status down again after 55800 ms for interface eth1.&lt;br /&gt;
Dec 13 14:20:27 an-node01 kernel: e1000e: eth2 NIC Link is Down&lt;br /&gt;
Dec 13 14:20:27 an-node01 kernel: bonding: bond2: link status down again after 56800 ms for interface eth2.&lt;br /&gt;
Dec 13 14:20:27 an-node01 kernel: e1000e: eth0 NIC Link is Up 1000 Mbps Full Duplex, Flow Control: Rx/Tx&lt;br /&gt;
Dec 13 14:20:27 an-node01 kernel: bonding: bond0: link status up for interface eth0, enabling it in 120000 ms.&lt;br /&gt;
Dec 13 14:20:28 an-node01 kernel: e1000e: eth1 NIC Link is Up 1000 Mbps Full Duplex, Flow Control: Rx/Tx&lt;br /&gt;
Dec 13 14:20:28 an-node01 kernel: bonding: bond1: link status up for interface eth1, enabling it in 120000 ms.&lt;br /&gt;
Dec 13 14:20:29 an-node01 kernel: e1000e: eth2 NIC Link is Up 1000 Mbps Full Duplex, Flow Control: Rx/Tx&lt;br /&gt;
Dec 13 14:20:29 an-node01 kernel: bonding: bond2: link status up for interface eth2, enabling it in 120000 ms.&lt;br /&gt;
Dec 13 14:20:31 an-node01 kernel: e1000e: eth0 NIC Link is Down&lt;br /&gt;
Dec 13 14:20:31 an-node01 kernel: bonding: bond0: link status down again after 3500 ms for interface eth0.&lt;br /&gt;
Dec 13 14:20:32 an-node01 kernel: e1000e: eth1 NIC Link is Down&lt;br /&gt;
Dec 13 14:20:32 an-node01 kernel: bonding: bond1: link status down again after 4100 ms for interface eth1.&lt;br /&gt;
Dec 13 14:20:32 an-node01 kernel: e1000e: eth2 NIC Link is Down&lt;br /&gt;
Dec 13 14:20:32 an-node01 kernel: bonding: bond2: link status down again after 3500 ms for interface eth2.&lt;br /&gt;
Dec 13 14:20:33 an-node01 kernel: e1000e: eth0 NIC Link is Up 1000 Mbps Full Duplex, Flow Control: Rx/Tx&lt;br /&gt;
Dec 13 14:20:33 an-node01 kernel: bonding: bond0: link status up for interface eth0, enabling it in 120000 ms.&lt;br /&gt;
Dec 13 14:20:34 an-node01 kernel: e1000e: eth1 NIC Link is Up 1000 Mbps Full Duplex, Flow Control: Rx/Tx&lt;br /&gt;
Dec 13 14:20:34 an-node01 kernel: bonding: bond1: link status up for interface eth1, enabling it in 120000 ms.&lt;br /&gt;
Dec 13 14:20:35 an-node01 kernel: e1000e: eth2 NIC Link is Up 1000 Mbps Full Duplex, Flow Control: Rx/Tx&lt;br /&gt;
Dec 13 14:20:35 an-node01 kernel: bonding: bond2: link status up for interface eth2, enabling it in 120000 ms.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
See all that bouncing? That is caused by many switches showing a link (that is the [[MII]] status) without actually being able to push traffic. As part of the switches boot sequence, the links will go down and come back up a couple of times. The 2 minute counter will reset with each bounce, so the recovery time is actually quite a bit longer than two minutes. This is fine, no need to rush back to the first switch.&lt;br /&gt;
&lt;br /&gt;
Note that you will not see this bouncing on switches that hold back on [[MII]] status until finished booting.&lt;br /&gt;
&lt;br /&gt;
After a few minutes, the old interfaces will actually be restored.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Dec 13 14:22:33 an-node01 kernel: bond0: link status definitely up for interface eth0, 1000 Mbps full duplex.&lt;br /&gt;
Dec 13 14:22:33 an-node01 kernel: bonding: bond0: making interface eth0 the new active one.&lt;br /&gt;
Dec 13 14:22:34 an-node01 kernel: bond1: link status definitely up for interface eth1, 1000 Mbps full duplex.&lt;br /&gt;
Dec 13 14:22:34 an-node01 kernel: bonding: bond1: making interface eth1 the new active one.&lt;br /&gt;
Dec 13 14:22:35 an-node01 kernel: bond2: link status definitely up for interface eth2, 1000 Mbps full duplex.&lt;br /&gt;
Dec 13 14:22:35 an-node01 kernel: bonding: bond2: making interface eth2 the new active one.&lt;br /&gt;
Dec 13 14:22:35 an-node01 kernel: device eth5 left promiscuous mode&lt;br /&gt;
Dec 13 14:22:35 an-node01 kernel: device eth2 entered promiscuous mode&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Complete success!&lt;br /&gt;
&lt;br /&gt;
{{warning|1=It is worth restating the importance of spreading your two fence methods across two switches. If both your PDU(s) and you IPMI (or iLO, etc) interfaces all run through one switch, that switch becomes a single point of failure. Generally, I run the IPMI/iLO/etc fence devices on the primary switch and the PDU(s) on the secondary switch.}}&lt;br /&gt;
&lt;br /&gt;
=== Failing The Secondary Switch ===&lt;br /&gt;
&lt;br /&gt;
Before we can say that everything is perfect, we need to test failing and recovering the secondary switch. The main purpose of this test is to ensure that there are no problems caused when the secondary switch restarts.&lt;br /&gt;
&lt;br /&gt;
To fail the switch, as we did with the primary switch, simply cut its power. We should see the following in both node&#039;s syslog;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Dec 13 14:30:57 an-node01 kernel: e1000e: eth3 NIC Link is Down&lt;br /&gt;
Dec 13 14:30:57 an-node01 kernel: bonding: bond0: link status definitely down for interface eth3, disabling it&lt;br /&gt;
Dec 13 14:30:58 an-node01 kernel: e1000e: eth4 NIC Link is Down&lt;br /&gt;
Dec 13 14:30:58 an-node01 kernel: e1000e: eth5 NIC Link is Down&lt;br /&gt;
Dec 13 14:30:58 an-node01 kernel: bonding: bond1: link status definitely down for interface eth4, disabling it&lt;br /&gt;
Dec 13 14:30:58 an-node01 kernel: bonding: bond2: link status definitely down for interface eth5, disabling it&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Let&#039;s take a look at &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;bond0&amp;lt;/span&amp;gt; status file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cat /proc/net/bonding/bond0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Ethernet Channel Bonding Driver: v3.6.0 (September 26, 2009)&lt;br /&gt;
&lt;br /&gt;
Bonding Mode: fault-tolerance (active-backup)&lt;br /&gt;
Primary Slave: eth0 (primary_reselect always)&lt;br /&gt;
Currently Active Slave: eth0&lt;br /&gt;
MII Status: up&lt;br /&gt;
MII Polling Interval (ms): 100&lt;br /&gt;
Up Delay (ms): 120000&lt;br /&gt;
Down Delay (ms): 0&lt;br /&gt;
&lt;br /&gt;
Slave Interface: eth0&lt;br /&gt;
MII Status: up&lt;br /&gt;
Link Failure Count: 3&lt;br /&gt;
Permanent HW addr: 00:e0:81:c7:ec:49&lt;br /&gt;
Slave queue ID: 0&lt;br /&gt;
&lt;br /&gt;
Slave Interface: eth3&lt;br /&gt;
MII Status: down&lt;br /&gt;
Link Failure Count: 3&lt;br /&gt;
Permanent HW addr: 00:1b:21:9d:59:fc&lt;br /&gt;
Slave queue ID: 0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth3&amp;lt;/span&amp;gt; interface is shown as &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;down&amp;lt;/span&amp;gt;. There should have been no dropped packets in the ping-flood window at all.&lt;br /&gt;
&lt;br /&gt;
=== Restoring The Second Switch ===&lt;br /&gt;
&lt;br /&gt;
When the power is restored to the switch, we&#039;ll see the same &amp;quot;bouncing&amp;quot; as the switch goes through its startup process. Notice that the backup link also remains listed as &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;down&amp;lt;/span&amp;gt; for 2 minutes, despite the interface not being used by the bonded interface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Dec 13 14:33:36 an-node01 kernel: e1000e: eth4 NIC Link is Up 1000 Mbps Full Duplex, Flow Control: Rx/Tx&lt;br /&gt;
Dec 13 14:33:36 an-node01 kernel: e1000e: eth5 NIC Link is Up 1000 Mbps Full Duplex, Flow Control: Rx/Tx&lt;br /&gt;
Dec 13 14:33:36 an-node01 kernel: bonding: bond1: link status up for interface eth4, enabling it in 120000 ms.&lt;br /&gt;
Dec 13 14:33:36 an-node01 kernel: bonding: bond2: link status up for interface eth5, enabling it in 120000 ms.&lt;br /&gt;
Dec 13 14:33:37 an-node01 kernel: e1000e: eth3 NIC Link is Up 1000 Mbps Full Duplex, Flow Control: Rx/Tx&lt;br /&gt;
Dec 13 14:33:37 an-node01 kernel: bonding: bond0: link status up for interface eth3, enabling it in 120000 ms.&lt;br /&gt;
Dec 13 14:34:34 an-node01 kernel: e1000e: eth5 NIC Link is Down&lt;br /&gt;
Dec 13 14:34:34 an-node01 kernel: bonding: bond2: link status down again after 58000 ms for interface eth5.&lt;br /&gt;
Dec 13 14:34:36 an-node01 kernel: e1000e: eth5 NIC Link is Up 1000 Mbps Full Duplex, Flow Control: Rx/Tx&lt;br /&gt;
Dec 13 14:34:36 an-node01 kernel: bonding: bond2: link status up for interface eth5, enabling it in 120000 ms.&lt;br /&gt;
Dec 13 14:34:38 an-node01 kernel: e1000e: eth5 NIC Link is Down&lt;br /&gt;
Dec 13 14:34:38 an-node01 kernel: bonding: bond2: link status down again after 2000 ms for interface eth5.&lt;br /&gt;
Dec 13 14:34:40 an-node01 kernel: e1000e: eth5 NIC Link is Up 1000 Mbps Full Duplex, Flow Control: None&lt;br /&gt;
Dec 13 14:34:40 an-node01 kernel: bonding: bond2: link status up for interface eth5, enabling it in 120000 ms.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After two minutes from the last bound, we&#039;ll see the backup interfaces return to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;up&amp;lt;/span&amp;gt; state in the bond&#039;s status file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Dec 13 14:35:36 an-node01 kernel: bond1: link status definitely up for interface eth4, 1000 Mbps full duplex.&lt;br /&gt;
Dec 13 14:35:37 an-node01 kernel: bond0: link status definitely up for interface eth3, 1000 Mbps full duplex.&lt;br /&gt;
Dec 13 14:36:40 an-node01 kernel: bond2: link status definitely up for interface eth5, 1000 Mbps full duplex.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After a full five minutes, the cluster and the network remain stable. We can officially declare our network to be fully highly available!&lt;br /&gt;
&lt;br /&gt;
= Installing DRBD =&lt;br /&gt;
&lt;br /&gt;
DRBD is an open-source application for real-time, block-level disk replication created and maintained by [http://linbit.com Linbit]. We will use this to keep the data on our cluster consistent between the two nodes.&lt;br /&gt;
&lt;br /&gt;
To install it, we have three choices;&lt;br /&gt;
# Purchase a Red Hat blessed, fully supported copy from [http://linbit.com Linbit].&lt;br /&gt;
# Install from the freely available, community maintained [http://elrepo.org/tiki/tiki-index.php ELRepo] repository.&lt;br /&gt;
# Install from source files.&lt;br /&gt;
&lt;br /&gt;
We will be using the 8.3.x version of DRBD. This tracts the Red Hat and Linbit supported versions, providing the most tested combination and providing a painless path to move to a fully supported version, should you decide to do so down the road.&lt;br /&gt;
&lt;br /&gt;
== Option 1 - Fully Supported by Red Hat and Linbit ==&lt;br /&gt;
&lt;br /&gt;
Red Hat decided to no longer directly support [[DRBD]] in [[EL6]] to narrow down what applications they shipped and focus on improving those components. Given the popularity of DRBD, however, Red Hat struck a deal with [[Linbit]], the authors and maintainers of DRBD. You have the option of purchasing a fully supported version of DRBD that is blessed by Red Hat for use under Red Hat Enterprise Linux 6.&lt;br /&gt;
&lt;br /&gt;
If you are building a fully supported cluster, please [http://www.linbit.com/en/products-services/drbd/drbd-for-high-availability/ contact Linbit] to purchase DRBD. Once done, you will get an email with you login information and, most importantly here, the [[URL]] hash needed to access the official repositories.&lt;br /&gt;
&lt;br /&gt;
First you will need to add an entry in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/yum.repo.d/&amp;lt;/span&amp;gt; for DRBD, but this needs to be hand-crafted as you must specify the URL hash given to you in the email as part of the repo configuration.&lt;br /&gt;
&lt;br /&gt;
* Log into the [https://my.linbit.com Linbit portal].&lt;br /&gt;
* Click on &#039;&#039;Account&#039;&#039;.&lt;br /&gt;
* Under &#039;&#039;Your account details&#039;&#039;, click on the hash string to the right of &#039;&#039;URL hash:&#039;&#039;.&lt;br /&gt;
* Click on &#039;&#039;RHEL 6&#039;&#039; (even if you are using CentOS or another [[EL6]] distro.&lt;br /&gt;
&lt;br /&gt;
This will take you to a new page called &#039;&#039;Instructions for using the DRBD package repository&#039;&#039;. The details installation instruction are found here.&lt;br /&gt;
&lt;br /&gt;
Lets use the imaginative URL hash of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;abcdefghijklmnopqrstuvwxyz0123456789ABCD&amp;lt;/span&amp;gt; and we&#039;re are in fact using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;x86_64&amp;lt;/span&amp;gt; architecture. Given this, we would create the following repository configuration file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/yum.repos.d/linbit.repo&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
[drbd-8]&lt;br /&gt;
name=DRBD 8&lt;br /&gt;
baseurl=http://packages.linbit.com/abcdefghijklmnopqrstuvwxyz0123456789ABCD/rhel6/x86_64&lt;br /&gt;
gpgcheck=0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once this is saved, you can install DRBD using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;yum&amp;lt;/span&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install drbd kmod-drbd&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Done!&lt;br /&gt;
&lt;br /&gt;
== Option 2 - Install From ELRepo ==&lt;br /&gt;
&lt;br /&gt;
[http://elrepo.org ELRepo] is a community-maintained repository of packages for &#039;&#039;&#039;E&#039;&#039;&#039;nterprise &#039;&#039;&#039;L&#039;&#039;&#039;inux; Red Hat Enterprise Linux and its derivatives like CentOS. This is the easiest option for a freely available DRBD package.&lt;br /&gt;
&lt;br /&gt;
The main concern with this option is that you are seceding control of DRBD to a community-controlled project. This is a trusted repo, but there are still undeniable security concerns. &lt;br /&gt;
&lt;br /&gt;
Check for the latest installation RPM and information;&lt;br /&gt;
* [http://elrepo.org ELRepo Installation Page]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# Install the ELRepo GPG key, add the repo and install DRBD.&lt;br /&gt;
rpm --import http://elrepo.org/RPM-GPG-KEY-elrepo.org&lt;br /&gt;
rpm -Uvh http://elrepo.org/elrepo-release-6-4.el6.elrepo.noarch.rpm&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Retrieving http://elrepo.org/elrepo-release-6-4.el6.elrepo.noarch.rpm&lt;br /&gt;
Preparing...                ########################################### [100%]&lt;br /&gt;
   1:elrepo-release         ########################################### [100%]&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;
yum install drbd83-utils kmod-drbd83&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is the method used for this tutorial.&lt;br /&gt;
&lt;br /&gt;
== Option 3 - Install From Source ==&lt;br /&gt;
&lt;br /&gt;
If you do not wish to pay for access to the official DRBD repository and do not feel comfortable adding a public repository, your last option is to install from Linbit&#039;s source code. The benefit of this is that you can vet the source before installing it, making it a more secure option. The downside is that you will need to manually install updates and security fixes as they are made available.&lt;br /&gt;
&lt;br /&gt;
On &#039;&#039;&#039;Both&#039;&#039;&#039; nodes run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# Download, compile and install DRBD&lt;br /&gt;
yum install flex gcc make kernel-devel&lt;br /&gt;
wget -c http://oss.linbit.com/drbd/8.3/drbd-8.3.12.tar.gz&lt;br /&gt;
tar -xvzf drbd-8.3.12.tar.gz&lt;br /&gt;
cd drbd-8.3.12&lt;br /&gt;
./configure \&lt;br /&gt;
   --prefix=/usr \&lt;br /&gt;
   --localstatedir=/var \&lt;br /&gt;
   --sysconfdir=/etc \&lt;br /&gt;
   --with-utils \&lt;br /&gt;
   --with-km \&lt;br /&gt;
   --with-udev \&lt;br /&gt;
   --with-pacemaker \&lt;br /&gt;
   --with-rgmanager \&lt;br /&gt;
   --with-bashcompletion&lt;br /&gt;
make&lt;br /&gt;
make install&lt;br /&gt;
chkconfig --add drbd&lt;br /&gt;
chkconfig drbd off&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Hooking DRBD Into The Cluster&#039;s Fencing ===&lt;br /&gt;
&lt;br /&gt;
{{warning|1=This script has no delay built into it. In many cases, if the link between the DRBD resources fail, both nodes may fence simultaneously causing both nodes to shut down. If you add &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;sleep 10;&amp;lt;/span&amp;gt; to &#039;&#039;&#039;one&#039;&#039;&#039; of the nodes, then you can ensure that dual-fencing won&#039;t occur.}}&lt;br /&gt;
&lt;br /&gt;
We will use a script, written by [http://lon.fedorapeople.org/ Lon Hohberger] of Red Hat. This script will capture fence calls from DRBD and in turn calls the cluster&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fence_node&amp;lt;/span&amp;gt; against the opposing node. It this way, DRBD will avoid split-brain without the need to maintain two separate fence configurations.&lt;br /&gt;
&lt;br /&gt;
On &#039;&#039;&#039;Both&#039;&#039;&#039; nodes run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# Obliterate peer - fence via cman&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;
-rwxr-xr-x 1 root root 2.1K May  4  2011 /sbin/obliterate-peer.sh&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We&#039;ll configure DRBD to use this script shortly.&lt;br /&gt;
&lt;br /&gt;
==== Alternate Fence Handler; rhcs_fence ====&lt;br /&gt;
&lt;br /&gt;
{{note|1=Caveat: The author of this tutorial is also the author of this script.}}&lt;br /&gt;
&lt;br /&gt;
A new fence handler which ties DRBD into RHCS is now available called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rhcs_fence&amp;lt;/span&amp;gt; with the goal of replacing &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;obliterate-peer.sh&amp;lt;/span&amp;gt;. It aims to extend Lon&#039;s script, which hasn&#039;t been actively developed in some time.&lt;br /&gt;
&lt;br /&gt;
This agent has had minimal testing, so please test thoroughly when using it. &lt;br /&gt;
&lt;br /&gt;
This agent addresses the simultaneous fencing issue by automatically adding a delay to the fence call based on the host node&#039;s ID number, with the node having ID of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt; having no delay at all. It is also a little more elegant about how it handles the actual fence call with the goal of being more reliable when a fence action takes longer than usual to complete.&lt;br /&gt;
&lt;br /&gt;
To install it, run the following on both nodes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
wget -c https://raw.github.com/digimer/rhcs_fence/master/rhcs_fence &lt;br /&gt;
chmod 755 rhcs_fence&lt;br /&gt;
mv rhcs_fence /usr/sbin/&lt;br /&gt;
ls -lah /usr/sbin/rhcs_fence &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
-rwxr-xr-x 1 root root 15K Jan 24 22:04 /usr/sbin/rhcs_fence&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== The &amp;quot;Why&amp;quot; of Our Layout ===&lt;br /&gt;
&lt;br /&gt;
We will be creating three separate DRBD resources. The reason for this is to minimize the chance of data loss in a [[split-brain]] event. &lt;br /&gt;
&lt;br /&gt;
We&#039;re going to take steps to ensure that a [[split-brain]] is exceedingly unlikely, but we always have to plan for the worst case scenario. The biggest concern with recovering from a split-brain is that, by necessity, one of the nodes will lose data. Further, there is no way to automate the recovery, as there is no clear way for DRBD to tell which node has the more valuable data.&lt;br /&gt;
&lt;br /&gt;
Consider this scenario;&lt;br /&gt;
* You have a two-node cluster running two VMs. One is a mirror for a project and the other is an accounting application. Node 1 hosts the mirror, Node 2 hosts the accounting application.&lt;br /&gt;
* A partition occurs and both nodes try to fence the other.&lt;br /&gt;
* Network access is lost, so both nodes fall back to fencing using PDUs.&lt;br /&gt;
* Both nodes have redundant power supplies, and at some point in time, the power cables on the second PDU got reversed.&lt;br /&gt;
* The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fence_apc_snmp&amp;lt;/span&amp;gt; agent succeeds, because the requested outlets were shut off. However, do to the cabling mistake, neither node actually shut down.&lt;br /&gt;
* Both nodes proceed to run independently, thinking they are the only node left.&lt;br /&gt;
* During this split-brain, the mirror VM downloads over a [[gigabyte]] of updates. Meanwhile, an hour earlier, the accountant updates the books, totalling less than one [[megabyte]] of changes.&lt;br /&gt;
&lt;br /&gt;
At this point, you will need to discard the changed on one of the nodes. So now you have to choose;&lt;br /&gt;
* Is the node with the most changes more valid?&lt;br /&gt;
* Is the node with the most recent changes more valid?&lt;br /&gt;
&lt;br /&gt;
Neither of these are true, as the node with the older data and smallest amount of changed data is the accounting data which is significantly more valuable.&lt;br /&gt;
&lt;br /&gt;
Now imagine that both VMs have equally valuable data. What then? Which side do you discard?&lt;br /&gt;
&lt;br /&gt;
The approach we will use is to create two separate DRBD resources. Then we will assign the VMs into two groups; VMs normally designed to run on one node will go one one resource while the VMs designed to normally run on the other resource will share the second resource. &lt;br /&gt;
&lt;br /&gt;
With all the VMs on a given resource running on the same DRBD resource, we can fairly easily decide which node to discard changes on, on a per-resource level.&lt;br /&gt;
&lt;br /&gt;
To summarize, we&#039;re going to create the following three resources;&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;r0&amp;lt;/span&amp;gt;; A small resource for the shared files formatted with [[GFS2]].&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;r1&amp;lt;/span&amp;gt;; This resource will back the VMs designed to primarily run on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;r2&amp;lt;/span&amp;gt;; This resource will back the VMs designed to primarily run on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Creating The Partitions For DRBD ==&lt;br /&gt;
&lt;br /&gt;
It is possible to use [[LVM]] on the hosts, and simply create [[LV]]s to back our DRBD resources. However, this causes confusion as LVM will see the [[PV]] signatures on both the DRBD backing devices and the DRBD device itself. Getting around this requires editing LVM&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;filter&amp;lt;/span&amp;gt; option, which is somewhat complicated. Not overly so, mind you, but enough to be outside the scope of this document. &lt;br /&gt;
&lt;br /&gt;
Also, by working with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fdisk&amp;lt;/span&amp;gt; directly, it will give us a chance to make sure that the DRBD partitions start on an even 64 [[KiB]] boundry. This is important for decent performance on Windows VMs, as we will see later. This is true for both traditional platter and modern solid-state drives.&lt;br /&gt;
&lt;br /&gt;
On our nodes, we created three primary disk partitions;&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/sda1&amp;lt;/span&amp;gt;; The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/boot&amp;lt;/span&amp;gt; partition.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/sda2&amp;lt;/span&amp;gt;; The root &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/&amp;lt;/span&amp;gt; partition.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/sda3&amp;lt;/span&amp;gt;; The swap partition.&lt;br /&gt;
&lt;br /&gt;
We will create a new extended partition. Then within it we will create three new partitions;&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/sda5&amp;lt;/span&amp;gt;; a small partition we will later use for our shared [[GFS2]] partition.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/sda6&amp;lt;/span&amp;gt;; a partition big enough to host the VMs that will normally run on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&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;; a partition big enough to host the VMs that will normally run on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
As we create each partition, we will do a little math to ensure that the start sector is on a 64 [[KiB]] boundry.&lt;br /&gt;
&lt;br /&gt;
=== Block Alignment ===&lt;br /&gt;
&lt;br /&gt;
For performance reasons, we want to ensure that the file systems created within a VM matches the block alignment of the underlying storage stack, clear down to the base partitions on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/sda&amp;lt;/span&amp;gt; (or what ever your lowest-level block device is).&lt;br /&gt;
&lt;br /&gt;
Imagine this misaligned scenario;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Note: Not to scale&lt;br /&gt;
                 ________________________________________________________________&lt;br /&gt;
VM File system  |~~~~~|_______|_______|_______|_______|_______|_______|_______|__&lt;br /&gt;
                |~~~~~|==========================================================&lt;br /&gt;
DRBD Partition  |~~~~~|_______|_______|_______|_______|_______|_______|_______|__&lt;br /&gt;
64 KiB block    |_______|_______|_______|_______|_______|_______|_______|_______|&lt;br /&gt;
512byte sectors |_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now, when the guest wants to write one block worth of data, it actually causes two blocks to be written, causing avoidable disk I/O.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Note: Not to scale&lt;br /&gt;
                 ________________________________________________________________&lt;br /&gt;
VM File system  |~~~~~~~|_______|_______|_______|_______|_______|_______|_______|&lt;br /&gt;
                |~~~~~~~|========================================================&lt;br /&gt;
DRBD Partition  |~~~~~~~|_______|_______|_______|_______|_______|_______|_______|&lt;br /&gt;
64 KiB block    |_______|_______|_______|_______|_______|_______|_______|_______|&lt;br /&gt;
512byte sectors |_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
By changing the start cylinder of our partitions to always start on 64 [[KiB]] boundaries, we&#039;re sure to keep the guest OS&#039;s file system in-line with the DRBD backing device&#039;s blocks. Thus, all reads and writes in the guest OS effect a matching number of real blocks, maximizing disk I/O efficiency.&lt;br /&gt;
&lt;br /&gt;
Thankfully, as we&#039;ll see in a moment, the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;parted&amp;lt;/span&amp;gt; program has a mode that will tell it to always optimally align partitions, so we won&#039;t need to do any crazy math.&lt;br /&gt;
&lt;br /&gt;
{{note|1=You will want to do this with [[SSD]] drives, too. It&#039;s true that the performance will remain about the same, but SSD drives have a limited number of write cycles, and aligning the blocks will minimize block writes.}}&lt;br /&gt;
&lt;br /&gt;
Special thanks to [http://xen.org/community/spotlight/pasi.html Pasi Kärkkäinen] for his patience in explaining to me the importance of disk alignment. He created two images which I used as templates for the [[ASCII]] art images above;&lt;br /&gt;
* [http://pasik.reaktio.net/virtual-disk-partitions-not-aligned.jpg Virtual Disk Partitions, Not aligned.]&lt;br /&gt;
* [http://pasik.reaktio.net/virtual-disk-partitions-aligned.jpg Virtual Disk Partitions, aligned.]&lt;br /&gt;
&lt;br /&gt;
=== Creating the DRBD Partitions ===&lt;br /&gt;
&lt;br /&gt;
Here I will show you the values I entered to create the three partitions I needed on my nodes. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;DO NOT DIRECTLY COPY THIS!&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The values you enter will almost certainly be different.&lt;br /&gt;
&lt;br /&gt;
We&#039;re going to use a program called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;parted&amp;lt;/span&amp;gt; to configure the disk &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/sda&amp;lt;/span&amp;gt;. Pay close attention to the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;-a optimal&amp;lt;/span&amp;gt; switch. This tells &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;parted&amp;lt;/span&amp;gt; to create new partitions with optimal block alignment, which is crucial for virtual machine performance.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
parted -a optimal /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;
GNU Parted 2.1&lt;br /&gt;
Using /dev/sda&lt;br /&gt;
Welcome to GNU Parted! Type &#039;help&#039; to view a list of commands.&lt;br /&gt;
(parted)                                                                  &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We&#039;re now in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;parted&amp;lt;/span&amp;gt; console. Before we start, let&#039;s take a look at the current disk configuration along with the amount of free space available.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
print free&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Model: ATA ST9500420ASG (scsi)&lt;br /&gt;
Disk /dev/sda: 500GB&lt;br /&gt;
Sector size (logical/physical): 512B/512B&lt;br /&gt;
Partition Table: msdos&lt;br /&gt;
&lt;br /&gt;
Number  Start   End     Size    Type     File system     Flags&lt;br /&gt;
        32.3kB  1049kB  1016kB           Free Space&lt;br /&gt;
 1      1049kB  269MB   268MB   primary  ext4            boot&lt;br /&gt;
 2      269MB   43.2GB  42.9GB  primary  ext4&lt;br /&gt;
 3      43.2GB  47.5GB  4295MB  primary  linux-swap(v1)&lt;br /&gt;
        47.5GB  500GB   453GB            Free Space&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Before we can create the three DRBD partition, we first need to create an [[extended partition|extended]] partition wherein which we will create the three [[logical partition|logical]] partitions. From the output above, we can see that the free space starts at &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;47.5GB&amp;lt;/span&amp;gt;, and that the drive ends at &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;500GB&amp;lt;/span&amp;gt;. Knowing this, we can now create the extended partition.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
mkpart extended 47.5GB 500GB&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Warning: WARNING: the kernel failed to re-read the partition table on /dev/sda&lt;br /&gt;
(Device or resource busy).  As a result, it may not reflect all of your changes&lt;br /&gt;
until after reboot.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Don&#039;t worry about that message, we will reboot when we finish.&lt;br /&gt;
&lt;br /&gt;
So now we can confirm that the new extended partition was create by again printing the partition table and the free space.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
print free&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Model: ATA ST9500420ASG (scsi)&lt;br /&gt;
Disk /dev/sda: 500GB&lt;br /&gt;
Sector size (logical/physical): 512B/512B&lt;br /&gt;
Partition Table: msdos&lt;br /&gt;
&lt;br /&gt;
Number  Start   End     Size    Type      File system     Flags&lt;br /&gt;
        32.3kB  1049kB  1016kB            Free Space&lt;br /&gt;
 1      1049kB  269MB   268MB   primary   ext4            boot&lt;br /&gt;
 2      269MB   43.2GB  42.9GB  primary   ext4&lt;br /&gt;
 3      43.2GB  47.5GB  4295MB  primary   linux-swap(v1)&lt;br /&gt;
 4      47.5GB  500GB   453GB   extended                  lba&lt;br /&gt;
        47.5GB  500GB   453GB             Free Space&lt;br /&gt;
        500GB   500GB   24.6kB            Free Space&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Perfect. So now we&#039;re going to create our three logical partitions. We&#039;re going to use the same start position as last time, but the end position will be 20 [[GiB]] further in.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
mkpart logical 47.5GB 67.5GB&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Warning: WARNING: the kernel failed to re-read the partition table on /dev/sda&lt;br /&gt;
(Device or resource busy).  As a result, it may not reflect all of your changes&lt;br /&gt;
until after reboot.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We&#039;ll check again to see the new partition layout.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
print free&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Model: ATA ST9500420ASG (scsi)&lt;br /&gt;
Disk /dev/sda: 500GB&lt;br /&gt;
Sector size (logical/physical): 512B/512B&lt;br /&gt;
Partition Table: msdos&lt;br /&gt;
&lt;br /&gt;
Number  Start   End     Size    Type      File system     Flags&lt;br /&gt;
        32.3kB  1049kB  1016kB            Free Space&lt;br /&gt;
 1      1049kB  269MB   268MB   primary   ext4            boot&lt;br /&gt;
 2      269MB   43.2GB  42.9GB  primary   ext4&lt;br /&gt;
 3      43.2GB  47.5GB  4295MB  primary   linux-swap(v1)&lt;br /&gt;
 4      47.5GB  500GB   453GB   extended                  lba&lt;br /&gt;
 5      47.5GB  67.5GB  20.0GB  logical&lt;br /&gt;
        67.5GB  500GB   433GB             Free Space&lt;br /&gt;
        500GB   500GB   24.6kB            Free Space&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Again, perfect. Now I have a total of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;433[[GB]]&amp;lt;/span&amp;gt; left free. How you carve this up for your VMs will depend entirely on what kind of VMs you plan to install and what their needs are. For me, I will divide the space evenly into to logical partitions of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;216.5GB&amp;lt;/span&amp;gt; (&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;433 / 2 = 216.5)&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The first partition will start at &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;67.5&amp;lt;/span&amp;gt; and end at &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;284GB&amp;lt;/span&amp;gt; (&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;67.5 + 216.5 = 284&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;
mkpart logical 67.5GB 284GB&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Warning: WARNING: the kernel failed to re-read the partition table on /dev/sda&lt;br /&gt;
(Device or resource busy).  As a result, it may not reflect all of your changes&lt;br /&gt;
until after reboot.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once again, lets look at the new partition table.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
print free&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Model: ATA ST9500420ASG (scsi)&lt;br /&gt;
Disk /dev/sda: 500GB&lt;br /&gt;
Sector size (logical/physical): 512B/512B&lt;br /&gt;
Partition Table: msdos&lt;br /&gt;
&lt;br /&gt;
Number  Start   End     Size    Type      File system     Flags&lt;br /&gt;
        32.3kB  1049kB  1016kB            Free Space&lt;br /&gt;
 1      1049kB  269MB   268MB   primary   ext4            boot&lt;br /&gt;
 2      269MB   43.2GB  42.9GB  primary   ext4&lt;br /&gt;
 3      43.2GB  47.5GB  4295MB  primary   linux-swap(v1)&lt;br /&gt;
 4      47.5GB  500GB   453GB   extended                  lba&lt;br /&gt;
 5      47.5GB  67.5GB  20.0GB  logical&lt;br /&gt;
 6      67.5GB  284GB   216GB   logical&lt;br /&gt;
        284GB   500GB   216GB             Free Space&lt;br /&gt;
        500GB   500GB   24.6kB            Free Space&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Finally, our last partition will start at &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;284GB&amp;lt;/span&amp;gt; and use the rest of the free space, ending at &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;500GB&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;
mkpart logical 284GB 500GB&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Warning: WARNING: the kernel failed to re-read the partition table on /dev/sda&lt;br /&gt;
(Device or resource busy).  As a result, it may not reflect all of your changes&lt;br /&gt;
until after reboot.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
One last time, let&#039;s look at the partition table.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
print free&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Model: ATA ST9500420ASG (scsi)&lt;br /&gt;
Disk /dev/sda: 500GB&lt;br /&gt;
Sector size (logical/physical): 512B/512B&lt;br /&gt;
Partition Table: msdos&lt;br /&gt;
&lt;br /&gt;
Number  Start   End     Size    Type      File system     Flags&lt;br /&gt;
        32.3kB  1049kB  1016kB            Free Space&lt;br /&gt;
 1      1049kB  269MB   268MB   primary   ext4            boot&lt;br /&gt;
 2      269MB   43.2GB  42.9GB  primary   ext4&lt;br /&gt;
 3      43.2GB  47.5GB  4295MB  primary   linux-swap(v1)&lt;br /&gt;
 4      47.5GB  500GB   453GB   extended                  lba&lt;br /&gt;
 5      47.5GB  67.5GB  20.0GB  logical&lt;br /&gt;
 6      67.5GB  284GB   216GB   logical&lt;br /&gt;
 7      284GB   500GB   216GB   logical&lt;br /&gt;
        500GB   500GB   24.6kB            Free Space&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Just as we asked for. Before we finish though, let&#039;s be extra careful and do a manual check of our three partitions to ensure that they are, in fact, aligned optimally. There will be no output from the following commands if the partitions are aligned.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
(parted) align-check opt 5&lt;br /&gt;
(parted) align-check opt 6&lt;br /&gt;
(parted) align-check opt 7&lt;br /&gt;
(parted)                                                                  &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Excellent! We can now exit.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
quit&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Information: You may need to update /etc/fstab.                           &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we need to reboot to make the kernel see the new partition table.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
reboot&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Done! Do this for both nodes, then proceed.&lt;br /&gt;
&lt;br /&gt;
== Configuring DRBD ==&lt;br /&gt;
&lt;br /&gt;
DRBD is configured in two parts;&lt;br /&gt;
&lt;br /&gt;
* Global and common configuration options&lt;br /&gt;
* Resource configurations&lt;br /&gt;
&lt;br /&gt;
We will be creating three separate DRBD resources, so we will create three separate resource configuration files. More on that in a moment.&lt;br /&gt;
&lt;br /&gt;
=== Configuring DRBD Global and Common Options ===&lt;br /&gt;
&lt;br /&gt;
The first file to edit is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/drbd.d/global_common.conf&amp;lt;/span&amp;gt;. In this file, we will set global configuration options and set default resource configuration options. These default resource options can be overwritten in the actual resource files which we&#039;ll create once we&#039;re done here.&lt;br /&gt;
&lt;br /&gt;
I&#039;ll explain the values we&#039;re setting here, and we&#039;ll put the explanation of each option in the file itself, as it will be useful to have them should you need to alter the files sometime in the future.&lt;br /&gt;
&lt;br /&gt;
The first addition is in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;handlers { }&amp;lt;/span&amp;gt; directive. We&#039;re going to add the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fence-peer&amp;lt;/span&amp;gt; option and configure it to use the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;obliterate-peer.sh&amp;lt;/span&amp;gt; script we spoke about earlier in the DRBD section.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/drbd.d/global_common.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;
	handlers {&lt;br /&gt;
		# This script is a wrapper for RHCS&#039;s &#039;fence_node&#039; command line&lt;br /&gt;
		# tool. It will call a fence against the other node and return&lt;br /&gt;
		# the appropriate exit code to DRBD.&lt;br /&gt;
		fence-peer		&amp;quot;/sbin/obliterate-peer.sh&amp;quot;;&lt;br /&gt;
	}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{note|1=If you used the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rhcs_fence&amp;lt;/span&amp;gt; handler, use &#039;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fence-peer		&amp;quot;/usr/sbin/rhcs_fence&amp;quot;;&amp;lt;/span&amp;gt;&#039;.}}&lt;br /&gt;
&lt;br /&gt;
We&#039;re going to add three options to the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;startup { }&amp;lt;/span&amp;gt; directive; We&#039;re going to tell DRBD to make both nodes &amp;quot;primary&amp;quot; on start, to wait five minutes on start for its peer to connect and, if the peer never connected last time, to wait onto two minutes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
	startup {&lt;br /&gt;
		# This tells DRBD to promote both nodes to Primary on start.&lt;br /&gt;
		become-primary-on	both;&lt;br /&gt;
&lt;br /&gt;
		# This tells DRBD to wait five minutes for the other node to&lt;br /&gt;
		# connect. This should be longer than it takes for cman to&lt;br /&gt;
		# timeout and fence the other node *plus* the amount of time it&lt;br /&gt;
		# takes the other node to reboot. If you set this too short,&lt;br /&gt;
		# you could corrupt your data. If you want to be extra safe, do&lt;br /&gt;
		# not use this at all and DRBD will wait for the other node&lt;br /&gt;
		# forever.&lt;br /&gt;
		wfc-timeout		300;&lt;br /&gt;
&lt;br /&gt;
		# This tells DRBD to wait for the other node for three minutes&lt;br /&gt;
		# if the other node was degraded the last time it was seen by&lt;br /&gt;
		# this node. This is a way to speed up the boot process when&lt;br /&gt;
		# the other node is out of commission for an extended duration.&lt;br /&gt;
		degr-wfc-timeout	120;&lt;br /&gt;
	}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;disk { }&amp;lt;/span&amp;gt; directive, we&#039;re going to configure DRBD&#039;s behaviour when a [[split-brain]] is detected. By setting &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fencing&amp;lt;/span&amp;gt; to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;resource-and-stonith&amp;lt;/span&amp;gt;, we&#039;re telling DRBD to stop all disk access and call a fence against its peer node rather than proceeding.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
	disk {&lt;br /&gt;
		# This tells DRBD to block IO and fence the remote node (using&lt;br /&gt;
		# the &#039;fence-peer&#039; helper) when connection with the other node&lt;br /&gt;
		# is unexpectedly lost. This is what helps prevent split-brain&lt;br /&gt;
		# condition and it is incredible important in dual-primary&lt;br /&gt;
		# setups!&lt;br /&gt;
		fencing			resource-and-stonith;&lt;br /&gt;
	}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;net { }&amp;lt;/span&amp;gt; directive, we&#039;re going to tell DRBD that it is allowed to run in dual-primary mode and we&#039;re going to configure how it behaves if a split-brain has occurred, despite our best efforts. The recovery (or lack there of) requires three options; What to do when neither node had been primary (&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;after-sb-0pri&amp;lt;/span&amp;gt;), what to do if only one node had been primary (&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;after-sb-1pri&amp;lt;/span&amp;gt;) and finally, what to do if both nodes had been primary (&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;after-sb-2pri&amp;lt;/span&amp;gt;), as will most likely be the case for us. This last instance will be configured to tell DRBD just to drop the connection, which will require human intervention to correct.&lt;br /&gt;
&lt;br /&gt;
At this point, you might be wondering why we won&#039;t simply run Primary/Secondary. The reason is because of live-migration. When we push a VM across to the backup node, there is a short period of time where both nodes need to be writeable. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
	net {&lt;br /&gt;
		# This tells DRBD to allow two nodes to be Primary at the same&lt;br /&gt;
		# time. It is needed when &#039;become-primary-on both&#039; is set.&lt;br /&gt;
		allow-two-primaries;&lt;br /&gt;
&lt;br /&gt;
		# The following three commands tell DRBD how to react should&lt;br /&gt;
		# our best efforts fail and a split brain occurs. You can learn&lt;br /&gt;
		# more about these options by reading the drbd.conf man page.&lt;br /&gt;
		# NOTE! It is not possible to safely recover from a split brain&lt;br /&gt;
		# where both nodes were primary. This care requires human&lt;br /&gt;
		# intervention, so &#039;disconnect&#039; is the only safe policy.&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;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We&#039;ll make our usual backup of the configuration file, add the new sections and then create a diff to see exactly how things have changed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/drbd.d/global_common.conf /etc/drbd.d/global_common.conf.orig&lt;br /&gt;
vim /etc/drbd.d/global_common.conf &lt;br /&gt;
diff -u  /etc/drbd.d/global_common.conf.orig /etc/drbd.d/global_common.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/drbd.d/global_common.conf.orig	2011-12-13 22:22:30.916128360 -0500&lt;br /&gt;
+++ /etc/drbd.d/global_common.conf	2011-12-13 22:26:30.733379609 -0500&lt;br /&gt;
@@ -14,22 +14,67 @@&lt;br /&gt;
 		# split-brain &amp;quot;/usr/lib/drbd/notify-split-brain.sh root&amp;quot;;&lt;br /&gt;
 		# out-of-sync &amp;quot;/usr/lib/drbd/notify-out-of-sync.sh root&amp;quot;;&lt;br /&gt;
 		# before-resync-target &amp;quot;/usr/lib/drbd/snapshot-resync-target-lvm.sh -p 15 -- -c 16k&amp;quot;;&lt;br /&gt;
+&lt;br /&gt;
 		# after-resync-target /usr/lib/drbd/unsnapshot-resync-target-lvm.sh;&lt;br /&gt;
+                # This script is a wrapper for RHCS&#039;s &#039;fence_node&#039; command line&lt;br /&gt;
+                # tool. It will call a fence against the other node and return&lt;br /&gt;
+                # the appropriate exit code to DRBD.&lt;br /&gt;
+                fence-peer              &amp;quot;/sbin/obliterate-peer.sh&amp;quot;;&lt;br /&gt;
 	}&lt;br /&gt;
 &lt;br /&gt;
 	startup {&lt;br /&gt;
 		# wfc-timeout degr-wfc-timeout outdated-wfc-timeout wait-after-sb&lt;br /&gt;
+&lt;br /&gt;
+                # This tells DRBD to promote both nodes to Primary on start.&lt;br /&gt;
+                become-primary-on       both;&lt;br /&gt;
+&lt;br /&gt;
+                # This tells DRBD to wait five minutes for the other node to&lt;br /&gt;
+                # connect. This should be longer than it takes for cman to&lt;br /&gt;
+                # timeout and fence the other node *plus* the amount of time it&lt;br /&gt;
+                # takes the other node to reboot. If you set this too short,&lt;br /&gt;
+                # you could corrupt your data. If you want to be extra safe, do&lt;br /&gt;
+                # not use this at all and DRBD will wait for the other node&lt;br /&gt;
+                # forever.&lt;br /&gt;
+                wfc-timeout             300;&lt;br /&gt;
+&lt;br /&gt;
+                # This tells DRBD to wait for the other node for three minutes&lt;br /&gt;
+                # if the other node was degraded the last time it was seen by&lt;br /&gt;
+                # this node. This is a way to speed up the boot process when&lt;br /&gt;
+                # the other node is out of commission for an extended duration.&lt;br /&gt;
+                degr-wfc-timeout        120;&lt;br /&gt;
 	}&lt;br /&gt;
 &lt;br /&gt;
 	disk {&lt;br /&gt;
 		# on-io-error fencing use-bmbv no-disk-barrier no-disk-flushes&lt;br /&gt;
 		# no-disk-drain no-md-flushes max-bio-bvecs&lt;br /&gt;
+&lt;br /&gt;
+                # This tells DRBD to block IO and fence the remote node (using&lt;br /&gt;
+                # the &#039;fence-peer&#039; helper) when connection with the other node&lt;br /&gt;
+                # is unexpectedly lost. This is what helps prevent split-brain&lt;br /&gt;
+                # condition and it is incredible important in dual-primary&lt;br /&gt;
+                # setups!&lt;br /&gt;
+                fencing                 resource-and-stonith;&lt;br /&gt;
 	}&lt;br /&gt;
 &lt;br /&gt;
 	net {&lt;br /&gt;
 		# sndbuf-size rcvbuf-size timeout connect-int ping-int ping-timeout max-buffers&lt;br /&gt;
 		# max-epoch-size ko-count allow-two-primaries cram-hmac-alg shared-secret&lt;br /&gt;
 		# after-sb-0pri after-sb-1pri after-sb-2pri data-integrity-alg no-tcp-cork&lt;br /&gt;
+&lt;br /&gt;
+&lt;br /&gt;
+                # This tells DRBD to allow two nodes to be Primary at the same&lt;br /&gt;
+                # time. It is needed when &#039;become-primary-on both&#039; is set.&lt;br /&gt;
+                allow-two-primaries;&lt;br /&gt;
+&lt;br /&gt;
+                # The following three commands tell DRBD how to react should&lt;br /&gt;
+                # our best efforts fail and a split brain occurs. You can learn&lt;br /&gt;
+                # more about these options by reading the drbd.conf man page.&lt;br /&gt;
+                # NOTE! It is not possible to safely recover from a split brain&lt;br /&gt;
+                # where both nodes were primary. This care requires human&lt;br /&gt;
+                # intervention, so &#039;disconnect&#039; is the only safe policy.&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;
 &lt;br /&gt;
 	syncer {&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Configuring the DRBD Resources ===&lt;br /&gt;
&lt;br /&gt;
As mentioned earlier, we are going to create three DRBD resources.&lt;br /&gt;
&lt;br /&gt;
* Resource &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;r0&amp;lt;/span&amp;gt;, which will be device &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/drbd0&amp;lt;/span&amp;gt;, will be the shared GFS2 partition.&lt;br /&gt;
* Resource &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;r1&amp;lt;/span&amp;gt;, which will be device &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/drbd1&amp;lt;/span&amp;gt;, will provide disk space for VMs that will normally run on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;.&lt;br /&gt;
* Resource &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;r2&amp;lt;/span&amp;gt;, which will be device &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/drbd2&amp;lt;/span&amp;gt;, will provide disk space for VMs that will normally run on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
{{note|1=The reason for the two separate VM resources is to help protect against data loss in the off chance that a [[split-brain]] occurs, despite our counter-measures. As we will see later, recovering from a split brain requires discarding the changes on one side of the resource. If VMs are running on the same resource but on different nodes, this would lead to data loss. Using two resources helps prevent that scenario.}}&lt;br /&gt;
&lt;br /&gt;
Each resource configuration will be in its own file saved as &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/drbd.d/rX.res&amp;lt;/span&amp;gt;. The three of them will be pretty much the same. So let&#039;s take a look at the first GFS2 resource &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;r0.res&amp;lt;/span&amp;gt;, then we&#039;ll just look at the changes for &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;r1.res&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;r2.res&amp;lt;/span&amp;gt;. These files won&#039;t exist initially.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/drbd.d/r0.res&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
# This is the resource used for the shared GFS2 partition.&lt;br /&gt;
resource r0 {&lt;br /&gt;
	# This is the block device path.&lt;br /&gt;
	device		/dev/drbd0;&lt;br /&gt;
&lt;br /&gt;
	# We&#039;ll use the normal internal metadisk (takes about 32MB/TB)&lt;br /&gt;
	meta-disk	internal;&lt;br /&gt;
&lt;br /&gt;
	# This is the `uname -n` of the first node&lt;br /&gt;
	on an-node01.alteeve.com {&lt;br /&gt;
		# The &#039;address&#039; has to be the IP, not a hostname. This is the&lt;br /&gt;
		# node&#039;s SN (bond1) IP. The port number must be unique amoung&lt;br /&gt;
		# resources.&lt;br /&gt;
		address		10.10.0.1:7788;&lt;br /&gt;
&lt;br /&gt;
		# This is the block device backing this resource on this node.&lt;br /&gt;
		disk		/dev/sda5;&lt;br /&gt;
	}&lt;br /&gt;
	# Now the same information again for the second node.&lt;br /&gt;
	on an-node02.alteeve.com {&lt;br /&gt;
		address		10.10.0.2:7788;&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;
Now copy this to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;r1.res&amp;lt;/span&amp;gt; and edit for the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt; VM resource. The main differences are the resource name, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;r1&amp;lt;/span&amp;gt;, the block device, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/drbd1&amp;lt;/span&amp;gt;, the port, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;7790&amp;lt;/span&amp;gt; and the backing block devices, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/sda6&amp;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/drbd.d/r0.res /etc/drbd.d/r1.res&lt;br /&gt;
vim /etc/drbd.d/r1.res&lt;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 is the resource used for VMs that will normally run on an-node01.&lt;br /&gt;
resource r1 {&lt;br /&gt;
	# This is the block device path.&lt;br /&gt;
	device		/dev/drbd1;&lt;br /&gt;
&lt;br /&gt;
	# We&#039;ll use the normal internal metadisk (takes about 32MB/TB)&lt;br /&gt;
	meta-disk	internal;&lt;br /&gt;
&lt;br /&gt;
	# This is the `uname -n` of the first node&lt;br /&gt;
	on an-node01.alteeve.com {&lt;br /&gt;
		# The &#039;address&#039; has to be the IP, not a hostname. This is the&lt;br /&gt;
		# node&#039;s SN (bond1) IP. The port number must be unique amoung&lt;br /&gt;
		# resources.&lt;br /&gt;
		address		10.10.0.1:7789;&lt;br /&gt;
&lt;br /&gt;
		# This is the block device backing this resource on this node.&lt;br /&gt;
		disk		/dev/sda6;&lt;br /&gt;
	}&lt;br /&gt;
	# Now the same information again for the second node.&lt;br /&gt;
	on an-node02.alteeve.com {&lt;br /&gt;
		address		10.10.0.2:7789;&lt;br /&gt;
		disk		/dev/sda6;&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The last resource is again the same, with the same set of changes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/drbd.d/r1.res /etc/drbd.d/r2.res&lt;br /&gt;
vim /etc/drbd.d/r2.res&lt;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 is the resource used for VMs that will normally run on an-node02.&lt;br /&gt;
resource r2 {&lt;br /&gt;
	# This is the block device path.&lt;br /&gt;
	device		/dev/drbd2;&lt;br /&gt;
&lt;br /&gt;
	# We&#039;ll use the normal internal metadisk (takes about 32MB/TB)&lt;br /&gt;
	meta-disk	internal;&lt;br /&gt;
&lt;br /&gt;
	# This is the `uname -n` of the first node&lt;br /&gt;
	on an-node01.alteeve.com {&lt;br /&gt;
		# The &#039;address&#039; has to be the IP, not a hostname. This is the&lt;br /&gt;
		# node&#039;s SN (bond1) IP. The port number must be unique amoung&lt;br /&gt;
		# resources.&lt;br /&gt;
		address		10.10.0.1:7790;&lt;br /&gt;
&lt;br /&gt;
		# This is the block device backing this resource on this node.&lt;br /&gt;
		disk		/dev/sda7;&lt;br /&gt;
	}&lt;br /&gt;
	# Now the same information again for the second node.&lt;br /&gt;
	on an-node02.alteeve.com {&lt;br /&gt;
		address		10.10.0.2:7790;&lt;br /&gt;
		disk		/dev/sda7;&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The final step is to validate the configuration. This is done by running the following command;&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;
# /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;
    startup {&lt;br /&gt;
        wfc-timeout      300;&lt;br /&gt;
        degr-wfc-timeout 120;&lt;br /&gt;
        become-primary-on both;&lt;br /&gt;
    }&lt;br /&gt;
    handlers {&lt;br /&gt;
        pri-on-incon-degr &amp;quot;/usr/lib/drbd/notify-pri-on-incon-degr.sh; /usr/lib/drbd/notify-emergency-reboot.sh; echo b &amp;gt; /proc/sysrq-trigger ; reboot -f&amp;quot;;&lt;br /&gt;
        pri-lost-after-sb &amp;quot;/usr/lib/drbd/notify-pri-lost-after-sb.sh; /usr/lib/drbd/notify-emergency-reboot.sh; echo b &amp;gt; /proc/sysrq-trigger ; reboot -f&amp;quot;;&lt;br /&gt;
        local-io-error   &amp;quot;/usr/lib/drbd/notify-io-error.sh; /usr/lib/drbd/notify-emergency-shutdown.sh; echo o &amp;gt; /proc/sysrq-trigger ; halt -f&amp;quot;;&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-node01.alteeve.com: not ignored, not stacked&lt;br /&gt;
resource r0 {&lt;br /&gt;
    on an-node01.alteeve.com {&lt;br /&gt;
        device           /dev/drbd0 minor 0;&lt;br /&gt;
        disk             /dev/sda5;&lt;br /&gt;
        address          ipv4 10.10.0.1:7788;&lt;br /&gt;
        meta-disk        internal;&lt;br /&gt;
    }&lt;br /&gt;
    on an-node02.alteeve.com {&lt;br /&gt;
        device           /dev/drbd0 minor 0;&lt;br /&gt;
        disk             /dev/sda5;&lt;br /&gt;
        address          ipv4 10.10.0.2:7788;&lt;br /&gt;
        meta-disk        internal;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
# resource r1 on an-node01.alteeve.com: not ignored, not stacked&lt;br /&gt;
resource r1 {&lt;br /&gt;
    on an-node01.alteeve.com {&lt;br /&gt;
        device           /dev/drbd1 minor 1;&lt;br /&gt;
        disk             /dev/sda6;&lt;br /&gt;
        address          ipv4 10.10.0.1:7789;&lt;br /&gt;
        meta-disk        internal;&lt;br /&gt;
    }&lt;br /&gt;
    on an-node02.alteeve.com {&lt;br /&gt;
        device           /dev/drbd1 minor 1;&lt;br /&gt;
        disk             /dev/sda6;&lt;br /&gt;
        address          ipv4 10.10.0.2:7789;&lt;br /&gt;
        meta-disk        internal;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
# resource r2 on an-node01.alteeve.com: not ignored, not stacked&lt;br /&gt;
resource r2 {&lt;br /&gt;
    on an-node01.alteeve.com {&lt;br /&gt;
        device           /dev/drbd2 minor 2;&lt;br /&gt;
        disk             /dev/sda7;&lt;br /&gt;
        address          ipv4 10.10.0.1:7790;&lt;br /&gt;
        meta-disk        internal;&lt;br /&gt;
    }&lt;br /&gt;
    on an-node02.alteeve.com {&lt;br /&gt;
        device           /dev/drbd2 minor 2;&lt;br /&gt;
        disk             /dev/sda7;&lt;br /&gt;
        address          ipv4 10.10.0.2:7790;&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;
You&#039;ll note that the output is formatted differently from the configuration files we created, but the values themselves are the same. If there had of been errors, you would have seen them printed. Fix any problems before proceeding. Once you get a clean dump, copy the configuration over to the other node.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
rsync -av /etc/drbd.d root@an-node02:/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;
sending incremental file list&lt;br /&gt;
drbd.d/&lt;br /&gt;
drbd.d/global_common.conf&lt;br /&gt;
drbd.d/global_common.conf.orig&lt;br /&gt;
drbd.d/r0.res&lt;br /&gt;
drbd.d/r1.res&lt;br /&gt;
drbd.d/r2.res&lt;br /&gt;
&lt;br /&gt;
sent 7534 bytes  received 129 bytes  5108.67 bytes/sec&lt;br /&gt;
total size is 7874  speedup is 1.03&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Initializing The DRBD Resources ==&lt;br /&gt;
&lt;br /&gt;
Now that we have DRBD configured, we need to initialize the DRBD backing devices and then bring up the resources for the first time.&lt;br /&gt;
&lt;br /&gt;
{{note|1=To save a bit of time and typing, the following sections will use a little &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;bash&amp;lt;/span&amp;gt; magic. When commands need to be run on all three resources, rather than running the same command three times with the different resource names, we will use the short-hand form &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;r{0,1,2}&amp;lt;/span&amp;gt; or &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;r{0..2}&amp;lt;/span&amp;gt;.}}&lt;br /&gt;
&lt;br /&gt;
On &#039;&#039;&#039;both&#039;&#039;&#039; nodes, create the new [[DRBD metadata|metadata]] on the backing devices. You may need to type &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;yes&amp;lt;/span&amp;gt; to confirm the action if any data is seen. If DRBD sees an actual file system, it will error and insist that you clear the partition. You can do this by running; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;dd if=/dev/zero of=/dev/sdaX bs=4M&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 partition you want to clear. This is called &amp;quot;zeroing out&amp;quot; a partition. The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;dd&amp;lt;/span&amp;gt; program does not print its progress, and can take a long time. To check the progress, open a new session to the server and run &#039;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;kill -USR1 $(pgrep -l &#039;^dd$&#039; | awk &#039;{ print $1 }&#039;)&amp;lt;/span&amp;gt;&#039;.&lt;br /&gt;
&lt;br /&gt;
If DRBD sees old metadata, it will prompt you to type &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;yes&amp;lt;/span&amp;gt; before it will proceed. In my case, I had recently zeroed-out my drive so DRBD had no concerns and just created the metadata for the three resources.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
drbdadm create-md r{0..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;
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;
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;
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;
Before you go any further, we&#039;ll need to load the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;drbd&amp;lt;/span&amp;gt; kernel module. Note that you won&#039;t normally need to do this. Later, after we get everything running the first time, we&#039;ll be able to start and stop the DRBD resources using the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/init.d/drbd&amp;lt;/span&amp;gt; script, which loads and unloads the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;drbd&amp;lt;/span&amp;gt; kernel module as needed.&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;
Now go back to the terminal windows we had used to watch the cluster start. We now want to watch the output of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cat /proc/drbd&amp;lt;/span&amp;gt; so we can keep tabs on the current state of the DRBD resources. We&#039;ll do this by using the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;watch&amp;lt;/span&amp;gt; program, which will refresh the output of the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cat&amp;lt;/span&amp;gt; call every couple of seconds.&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;
version: 8.3.12 (api:88/proto:86-96)&lt;br /&gt;
GIT-hash: e2a8ef4656be026bbae540305fcb998a5991090f build by dag@Build64R6, 2011-11-20 10:57:03&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Back in the first terminal, we need to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;attach&amp;lt;/span&amp;gt; the backing device, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/sda{5..7}&amp;lt;/span&amp;gt; to their respective DRBD resources, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;r{0..2}&amp;lt;/span&amp;gt;. After running the following command, you will see no output on the first terminal, but the second terminal&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/proc/drbd&amp;lt;/span&amp;gt; should update.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
drbdadm attach r{0..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;
version: 8.3.12 (api:88/proto:86-96)&lt;br /&gt;
GIT-hash: e2a8ef4656be026bbae540305fcb998a5991090f build by dag@Build64R6, 2011-11-20 10:57:03&lt;br /&gt;
 0: cs:StandAlone ro:Secondary/Unknown ds:Inconsistent/DUnknown   r----s&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:19515784&lt;br /&gt;
 1: cs:StandAlone ro:Secondary/Unknown ds:Inconsistent/DUnknown   r----s&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:211418788&lt;br /&gt;
 2: cs:StandAlone ro:Secondary/Unknown ds:Inconsistent/DUnknown   r----s&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:211034800&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Take note of the connection state, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cs:StandAlone&amp;lt;/span&amp;gt;, the current role, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ro:Secondary/Unknown&amp;lt;/span&amp;gt; and the disk state, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ds:Inconsistent/DUnknown&amp;lt;/span&amp;gt;. This tells us that our resources are not talking to one another, are not usable because they are in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Secondary&amp;lt;/span&amp;gt; state (you can&#039;t even read the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/drbdX&amp;lt;/span&amp;gt; device) and that the backing device does not have an up to date view of the data. &lt;br /&gt;
&lt;br /&gt;
This all makes sense of course, as the resources are brand new.&lt;br /&gt;
&lt;br /&gt;
So the next step is to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;connect&amp;lt;/span&amp;gt; the two nodes together. As before, we won&#039;t see any output from the first terminal, but the second terminal will change.&lt;br /&gt;
&lt;br /&gt;
{{note|1=After running the following command on the first node, its connection state will become &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cs:WFConnection&amp;lt;/span&amp;gt; which means that it is &#039;&#039;&#039;w&#039;&#039;&#039;aiting &#039;&#039;&#039;f&#039;&#039;&#039;or a &#039;&#039;&#039;connection&#039;&#039;&#039; from the other node.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
drbdadm connect r{0..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;
version: 8.3.12 (api:88/proto:86-96)&lt;br /&gt;
GIT-hash: e2a8ef4656be026bbae540305fcb998a5991090f build by dag@Build64R6, 2011-11-20 10:57:03&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:19515784&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:211418788&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:211034800&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can now see that the two nodes are talking to one another properly as the connection state has changed to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cs:Connected&amp;lt;/span&amp;gt;. They can see that their peer node is in the same state as they are; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Secondary&amp;lt;/span&amp;gt;/&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Inconsistent&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Seeing as the resources are brand new, there is no data to synchronize the two nodes. We&#039;re going to issue a special command that will only ever be used this one time. It will tell DRBD to immediately consider the DRBD resources to be up to date.&lt;br /&gt;
&lt;br /&gt;
On &#039;&#039;&#039;one&#039;&#039;&#039; node only, run;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
drbdadm -- --clear-bitmap new-current-uuid r{0..2}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As before, look to the second terminal to see the new state of affairs.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
version: 8.3.12 (api:88/proto:86-96)&lt;br /&gt;
GIT-hash: e2a8ef4656be026bbae540305fcb998a5991090f build by dag@Build64R6, 2011-11-20 10:57:03&lt;br /&gt;
 0: cs:Connected ro:Secondary/Secondary ds:UpToDate/UpToDate 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:0&lt;br /&gt;
 1: cs:Connected ro:Secondary/Secondary ds:UpToDate/UpToDate 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:0&lt;br /&gt;
 2: cs:Connected ro:Secondary/Secondary ds:UpToDate/UpToDate 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:0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Voila!&lt;br /&gt;
&lt;br /&gt;
We could promote both sides to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Primary&amp;lt;/span&amp;gt; by running &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;drbdadm primary r{0..2}&amp;lt;/span&amp;gt; on both nodes, but there is no purpose in doing that at this stage as we can safely say our DRBD is ready to go. So instead, let&#039;s just stop DRBD entirely. We&#039;ll also prevent it from starting on boot as &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;drbd&amp;lt;/span&amp;gt; will be managed by the cluster in a later step.&lt;br /&gt;
&lt;br /&gt;
On &#039;&#039;&#039;both&#039;&#039;&#039; nodes run;&lt;br /&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 disable it from starting on boot.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
chkconfig drbd off&lt;br /&gt;
chkconfig --list 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           	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;
The second terminal will start complaining that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/proc/drbd&amp;lt;/span&amp;gt; no longer exists. This is because the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;drbd&amp;lt;/span&amp;gt; init script unloaded the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;drbd&amp;lt;/span&amp;gt; kernel module. It is expected and not a problem.&lt;br /&gt;
&lt;br /&gt;
= Configuring Clustered Storage =&lt;br /&gt;
&lt;br /&gt;
Before we can provision the first virtual machine, we must first create the storage that will back them. This will take a few steps;&lt;br /&gt;
&lt;br /&gt;
* Configuring [[LVM]]&#039;s clustered locking and creating the [[PV]]s, [[VG]]s and [[LV]]s&lt;br /&gt;
* Formatting and configuring the shared [[GFS2]] partition.&lt;br /&gt;
* Adding storage to the cluster&#039;s resource management.&lt;br /&gt;
&lt;br /&gt;
== Clustered Logical Volume Management ==&lt;br /&gt;
&lt;br /&gt;
We will assign all three DRBD resources to be managed by clustered LVM. This isn&#039;t strictly needed for the [[GFS2]] partition, as it uses DLM directly. However, the flexibility of LVM is very appealing, and will make later growth of the GFS2 partition quite trivial, should the need arise. &lt;br /&gt;
&lt;br /&gt;
The real reason for clustered LVM in our cluster is to provide DLM-backed locking to the partitions, or logical volumes in LVM, that will be used to back our VMs. Of course, the flexibility of LVM managed storage is enough of a win to justify using LVM for our VMs in itself, and shouldn&#039;t be ignored here.&lt;br /&gt;
&lt;br /&gt;
=== Configuring Clustered LVM Locking ===&lt;br /&gt;
&lt;br /&gt;
Before we create the clustered LVM, we need to first make three changes to the LVM configuration. &lt;br /&gt;
* We need to filter out the DRBD backing devices so that LVM doesn&#039;t see the same signature twice.&lt;br /&gt;
* Switch from local locking to clustered locking.&lt;br /&gt;
* Prevent fall-back to local locking when the cluster is not available.&lt;br /&gt;
&lt;br /&gt;
Start by making a backup of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;lvm.conf&amp;lt;/span&amp;gt; and then begin editing it.&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 configuration option to filter out the DRBD backing device is, surprisingly, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;filter = [ ... ]&amp;lt;/span&amp;gt;. By default, it is set to allow everything via the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;quot;a/.*/&amp;quot;&amp;lt;/span&amp;gt; regular expression. We&#039;re only using DRBD in our LVM, so we&#039;re going to flip that to reject everything &#039;&#039;except&#039;&#039; DRBD by changing the regex to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;quot;a|/dev/drbd*|&amp;quot;, &amp;quot;r/.*/&amp;quot;&amp;lt;/span&amp;gt;. If we didn&#039;t do this, LVM would see the same signature on the DRBD device and again on the backing devices, at which time it would ignore the DRBD device. This filter allows LVM to only inspect the DRBD devices for LVM signatures.&lt;br /&gt;
&lt;br /&gt;
Change;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
    # By default we accept every block device:&lt;br /&gt;
    filter = [ &amp;quot;a/.*/&amp;quot; ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
    # We&#039;re only using LVM on DRBD resource.&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;
For the locking, we&#039;re going to change the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;locking_type&amp;lt;/span&amp;gt; from &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt; (local locking) to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;3&amp;lt;/span&amp;gt;, (clustered locking). This is what tells LVM to use DLM.&lt;br /&gt;
&lt;br /&gt;
Change;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
    locking_type = 1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
    locking_type = 3&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Lastly, we&#039;re also going to disallow fall-back to local locking. Normally, LVM would try to access a clustered LVM [[VG]] using local locking if DLM is not available. We want to prevent any access to the clustered LVM volumes &#039;&#039;except&#039;&#039; when the DLM is itself running. 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; to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;0&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Change;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
    fallback_to_local_locking = 1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
    fallback_to_local_locking = 0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Save the changes, then lets run a &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;diff&amp;lt;/span&amp;gt; against our backup to see a summary of the changes.&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-12-14 17:42:16.416094972 -0500&lt;br /&gt;
+++ /etc/lvm/lvm.conf	2011-12-14 17:49:15.747097684 -0500&lt;br /&gt;
@@ -62,8 +62,8 @@&lt;br /&gt;
     # If it doesn&#039;t do what you expect, check the output of &#039;vgscan -vvvv&#039;.&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;
+    # We&#039;re only using LVM on DRBD resource.&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;
@@ -356,7 +356,7 @@&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 = 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;
@@ -372,7 +372,7 @@&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 = 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;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Perfect! Now copy the modified &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;lvm.conf&amp;lt;/span&amp;gt; file to the other 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-node02:/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;
sending incremental file list&lt;br /&gt;
lvm.conf&lt;br /&gt;
&lt;br /&gt;
sent 2351 bytes  received 283 bytes  5268.00 bytes/sec&lt;br /&gt;
total size is 28718  speedup is 10.90&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Testing the clvmd Daemon ===&lt;br /&gt;
&lt;br /&gt;
A little later on, we&#039;re going to put clustered LVM under the control of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt;. Before we can do that though, we need to start it manually so that we can use it to create the LV that will back the GFS2 &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/shared&amp;lt;/span&amp;gt; partition, which we will also be adding to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; when we build our storage services.&lt;br /&gt;
&lt;br /&gt;
Before we start the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clvmd&amp;lt;/span&amp;gt; daemon, we&#039;ll want to ensure that the cluster is 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;bash&amp;quot;&amp;gt;&lt;br /&gt;
Version: 6.2.0&lt;br /&gt;
Config Version: 7&lt;br /&gt;
Cluster Name: an-cluster-A&lt;br /&gt;
Cluster Id: 24561&lt;br /&gt;
Cluster Member: Yes&lt;br /&gt;
Cluster Generation: 68&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;
Node votes: 1&lt;br /&gt;
Quorum: 1  &lt;br /&gt;
Active subsystems: 7&lt;br /&gt;
Flags: 2node &lt;br /&gt;
Ports Bound: 0  &lt;br /&gt;
Node name: an-node01.alteeve.com&lt;br /&gt;
Node ID: 1&lt;br /&gt;
Multicast addresses: 239.192.95.81 &lt;br /&gt;
Node addresses: 10.20.0.1 &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is, and both nodes are members. We can start the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clvmd&amp;lt;/span&amp;gt; daemon now.&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;
We&#039;ve not created any clustered volume groups yet, so that complaint about not finding volume groups is expected.&lt;br /&gt;
&lt;br /&gt;
We don&#039;t want &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clvmd&amp;lt;/span&amp;gt; to start at boot, as we will be putting it under the cluster&#039;s control. So we need to make sure that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clvmd&amp;lt;/span&amp;gt; is disabled at boot, and then we&#039;ll stop &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clvmd&amp;lt;/span&amp;gt; for now.&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;
Now stop it entirely.&lt;br /&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;
Signaling clvmd to exit                                    [  OK  ]&lt;br /&gt;
clvmd terminated                                           [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Initialize our DRBD Resource for use as LVM PVs ===&lt;br /&gt;
&lt;br /&gt;
This is the first time we&#039;re actually going to use DRBD and clustered LVM, so we need to make sure that both are started. Earlier we stopped them, so if they&#039;re not running now, we need to restart them.&lt;br /&gt;
&lt;br /&gt;
First, check (and start if needed) &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;drbd&amp;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/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;
It&#039;s stopped, so we&#039;ll start it on &#039;&#039;&#039;both&#039;&#039;&#039; nodes now.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/drbd 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 DRBD resources: [ d(r0) d(r1) d(r2) n(r0) n(r1) n(r2) ].&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It looks like it started, but let&#039;s confirm that the resources are all &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Connected&amp;lt;/span&amp;gt;, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Primary&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;UpToDate&amp;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/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.12 (api:88/proto:86-96)&lt;br /&gt;
GIT-hash: e2a8ef4656be026bbae540305fcb998a5991090f build by dag@Build64R6, 2011-11-20 10:57:03&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;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Excellent, now to check on &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;
/etc/init.d/clvmd status&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
clvmd is stopped&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It&#039;s also stopped, so lets start it now.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/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;
Now we&#039;re ready to start!&lt;br /&gt;
&lt;br /&gt;
Before we can use LVM, clustered or otherwise, we need to initialize one or more raw storage devices. This is done using the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;pvcreate&amp;lt;/span&amp;gt; command. We&#039;re going to do this on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;, then run &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;pvscan&amp;lt;/span&amp;gt; on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt;. We should see the newly initialized DRBD resources appear.&lt;br /&gt;
&lt;br /&gt;
Running &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;pvscan&amp;lt;/span&amp;gt; first, we&#039;ll see that no [[PV]]s have been created.&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;
  No matching physical volumes found&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On &#039;&#039;&#039;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;&#039;&#039;&#039;, initialize the PVs;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
pvcreate /dev/drbd{0..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;
  Writing physical volume data to disk &amp;quot;/dev/drbd0&amp;quot;&lt;br /&gt;
  Physical volume &amp;quot;/dev/drbd0&amp;quot; successfully created&lt;br /&gt;
  Writing physical volume data to disk &amp;quot;/dev/drbd1&amp;quot;&lt;br /&gt;
  Physical volume &amp;quot;/dev/drbd1&amp;quot; successfully created&lt;br /&gt;
  Writing physical volume data to disk &amp;quot;/dev/drbd2&amp;quot;&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;
On both nodes, re-run &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;pvscan&amp;lt;/span&amp;gt; and the new PVs should show. This works because DRBD is keeping the data in sync, including the new LVM signatures.&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 [18.61 GiB]&lt;br /&gt;
  PV /dev/drbd1                      lvm2 [201.62 GiB]&lt;br /&gt;
  PV /dev/drbd2                      lvm2 [201.26 GiB]&lt;br /&gt;
  Total: 3 [421.49 GiB] / in use: 0 [0   ] / in no VG: 3 [421.49 GiB]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Done.&lt;br /&gt;
&lt;br /&gt;
=== Creating Cluster Volume Groups ===&lt;br /&gt;
&lt;br /&gt;
As with initializing the DRBD resource above, we will create out volume groups, [[VG]]s, on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt; only, but we will then see them on both nodes.&lt;br /&gt;
&lt;br /&gt;
Check to confirm that no VGs exist;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vgdisplay&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
  No volume groups found&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now to create the VGs, we&#039;ll use the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vgcreate&amp;lt;/span&amp;gt; command with the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;-c y&amp;lt;/span&amp;gt; switch, which tells LVM to make the VG a clustered VG. Note that when the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clvmd&amp;lt;/span&amp;gt; daemon is running, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;-c y&amp;lt;/span&amp;gt; is implied. However, I like to get into the habit of using it because it will trigger an error if, for some reason, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clvmd&amp;lt;/span&amp;gt; wasn&#039;t actually running.&lt;br /&gt;
&lt;br /&gt;
On &#039;&#039;&#039;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;&#039;&#039;&#039;, create the three VGs.&lt;br /&gt;
&lt;br /&gt;
* VG for the GFS2 &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/shared&amp;lt;/span&amp;gt; partition;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vgcreate -c y shared-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;shared-vg0&amp;quot; successfully created&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* VG for the VMs that will primarily run on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vgcreate -c y an01-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;an01-vg0&amp;quot; successfully created&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* VG for the VMs that will primarily run on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt;;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vgcreate -c y an02-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;an02-vg0&amp;quot; successfully created&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now on both nodes, we should see the three new volume groups.&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;an02-vg0&amp;quot; using metadata type lvm2&lt;br /&gt;
  Found volume group &amp;quot;an01-vg0&amp;quot; using metadata type lvm2&lt;br /&gt;
  Found volume group &amp;quot;shared-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 stage, we&#039;re going to create only one [[LV]] for the GFS2 partition. We&#039;ll create the rest later when we&#039;re ready to provision the VMs. This will be the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/shared&amp;lt;/span&amp;gt; partiton, which we will discuss further in the next section.&lt;br /&gt;
&lt;br /&gt;
As before, we&#039;ll create the LV on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt; and then verify it exists on both nodes.&lt;br /&gt;
&lt;br /&gt;
Before we create our first LV, check &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;lvscan&amp;lt;/span&amp;gt;.&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;
&#039;&#039;Nothing is returned&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
On &#039;&#039;&#039;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;&#039;&#039;&#039;, create the the LV on the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;shared-vg0&amp;lt;/span&amp;gt; VG, using all of the available space.&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 shared shared-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;shared&amp;quot; created&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now on both nodes, check that the new LV exists.&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/shared-vg0/shared&#039; [18.61 GiB] inherit&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Perfect. We can now create our GFS2 partition.&lt;br /&gt;
&lt;br /&gt;
== Creating The Shared GFS2 Partition ==&lt;br /&gt;
&lt;br /&gt;
The GFS2-formatted &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/shared&amp;lt;/span&amp;gt; partition will be used for four main purposes;&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/shared/files&amp;lt;/span&amp;gt;; Storing files like [[ISO]] images needed when provisioning VMs.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/shared/provision&amp;lt;/span&amp;gt;; Storing short scripts used to call &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-install&amp;lt;/span&amp;gt; which handles the creation of our VMs.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/shared/definitions&amp;lt;/span&amp;gt;; This is where the [[XML]] definition files which define the emulated hardware backing our VMs are kept. This is the most critical directory as the cluster will look here when starting and recovering VMs.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/shared/archive&amp;lt;/span&amp;gt;; This is used to store old copies of the [[XML]] definition files. I like to make a time-stamped copy of definition files prior to altering and redefining a VM. This way, I can quickly and easily revert to an old configuration should I run into trouble.&lt;br /&gt;
&lt;br /&gt;
Make sure that both &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;drbd&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clvmd&amp;lt;/span&amp;gt; are running.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;mkfs.gfs2&amp;lt;/span&amp;gt; call uses a few switches that are worth explaining;&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;-p lock_dlm&amp;lt;/span&amp;gt;; This tells GFS2 to use [[DLM]] for its clustered locking. Currently, this is the only supported locking type.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;-j 2&amp;lt;/span&amp;gt;; This tells GFS2 to create two journals. This must match the number of nodes that will try to mount this partition at any one time.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;-t an-cluster-A:shared&amp;lt;/span&amp;gt;; This is the lockspace name, which must be in the format &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;clustename&amp;gt;:&amp;lt;fsname&amp;gt;&amp;lt;/span&amp;gt;. The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clustername&amp;lt;/span&amp;gt; must match the one in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cluster.conf&amp;lt;/span&amp;gt;, and any node that belongs to a cluster of another name will not be allowed to access the file system.&lt;br /&gt;
&lt;br /&gt;
{{note|1=Depending on the size of the new partition, this call could take a while to complete. Please be patient.}}&lt;br /&gt;
&lt;br /&gt;
Then, on &#039;&#039;&#039;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;&#039;&#039;&#039;, run;&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-cluster-A:shared /dev/shared-vg0/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/shared-vg0/shared.&lt;br /&gt;
It appears to contain: symbolic link to `../dm-0&#039;&lt;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;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Device:                    /dev/shared-vg0/shared&lt;br /&gt;
Blocksize:                 4096&lt;br /&gt;
Device Size                18.61 GB (4878336 blocks)&lt;br /&gt;
Filesystem Size:           18.61 GB (4878333 blocks)&lt;br /&gt;
Journals:                  2&lt;br /&gt;
Resource Groups:           75&lt;br /&gt;
Locking Protocol:          &amp;quot;lock_dlm&amp;quot;&lt;br /&gt;
Lock Table:                &amp;quot;an-cluster-A:shared&amp;quot;&lt;br /&gt;
UUID:                      162a80eb-59b3-08bd-5d69-740cbb60aa45&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On &#039;&#039;&#039;both&#039;&#039;&#039; nodes, run all of the following commands.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
mkdir /shared&lt;br /&gt;
mount /dev/shared-vg0/shared /shared/&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Confirm that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/shared&amp;lt;/span&amp;gt; is now mounted.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
df -hP /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;
Filesystem            Size  Used Avail Use% Mounted on&lt;br /&gt;
/dev/mapper/shared--vg0-shared   19G  259M   19G   2% /shared&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that the path under &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Filesystem&amp;lt;/span&amp;gt; is different from what we used when creating the GFS2 partition. This is an effect of [[Device Mapper]], which is used by LVM to create symlinks to actual block device paths. If we look at our &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/shared-vg0/shared&amp;lt;/span&amp;gt; device and the device from &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;df&amp;lt;/span&amp;gt;, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/mapper/shared--vg0-shared&amp;lt;/span&amp;gt;, we&#039;ll see that they both point to the same actual block device.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ls -lah /dev/shared-vg0/shared /dev/mapper/shared--vg0-shared&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
lrwxrwxrwx 1 root root 7 Oct 23 16:35 /dev/mapper/shared--vg0-shared -&amp;gt; ../dm-0&lt;br /&gt;
lrwxrwxrwx 1 root root 7 Oct 23 16:35 /dev/shared-vg0/shared -&amp;gt; ../dm-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;
ls -lah /dev/dm-0 &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
brw-rw---- 1 root disk 253, 0 Oct 23 16:35 /dev/dm-0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This next step uses some command-line voodoo. It takes the output from &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;gfs2_edit -p sb /dev/shared-vg0/shared&amp;lt;/span&amp;gt;, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;grep&amp;lt;/span&amp;gt;&#039;s out the [[UUID]] line for the new GFS2 partition, parses out of that the UUID itself, converts it to lower-case and, finally, spits out a string that can be used in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/fstab&amp;lt;/span&amp;gt;. We&#039;ll run it twice; The first time to confirm that the output is what we expect and the second time to append it 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;
The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;gfs2&amp;lt;/span&amp;gt; daemon can only work on GFS2 partitions that have been defined in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/fstab&amp;lt;/span&amp;gt;, so this is a required step on both nodes.&lt;br /&gt;
&lt;br /&gt;
We use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;defaults,noatime,nodiratime&amp;lt;/span&amp;gt; instead of just &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;defaults&amp;lt;/span&amp;gt; for performance reasons. Normally, every time a file or directory is accessed, its &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[atime]]&amp;lt;/span&amp;gt; (or &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[diratime]]&amp;lt;/span&amp;gt;) is updated, which requires a disk write, which requires an exclusive DLM lock, which is expensive. If you need to know when a file or directory was accessed, remove &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;,noatime,nodiratime&amp;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 `gfs2_edit -p sb /dev/shared-vg0/shared | grep sb_uuid | sed -e &amp;quot;s/.*sb_uuid  *\(.*\)/UUID=\L\1\E \/shared\t\tgfs2\tdefaults,noatime,nodiratime\t0 0/&amp;quot;`&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
UUID=162a80eb-59b3-08bd-5d69-740cbb60aa45 /shared gfs2 defaults,noatime,nodiratime 0 0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This looks good, so now re-run it but redirect the output to append to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/fstab&amp;lt;/span&amp;gt;. We&#039;ll confirm it worked by checking the status of the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;gfs2&amp;lt;/span&amp;gt; daemon.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
echo `gfs2_edit -p sb /dev/shared-vg0/shared | grep sb_uuid | sed -e &amp;quot;s/.*sb_uuid  *\(.*\)/UUID=\L\1\E \/shared\t\tgfs2\tdefaults,noatime,nodiratime\t0 0/&amp;quot;` &amp;gt;&amp;gt; /etc/fstab&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;
/shared&lt;br /&gt;
Active GFS2 mountpoints: &lt;br /&gt;
/shared&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Perfect, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;gfs2&amp;lt;/span&amp;gt; can see the partition now! We&#039;re ready to setup our directories.&lt;br /&gt;
&lt;br /&gt;
On &#039;&#039;&#039;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&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 /shared/{definitions,provision,archive,files}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On &#039;&#039;&#039;both&#039;&#039;&#039; nodes, confirm that all of the new directories exist and are visible.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ls -lah /shared/&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
total 24K&lt;br /&gt;
drwxr-xr-x   6 root root 3.8K Dec 14 19:05 .&lt;br /&gt;
dr-xr-xr-x. 24 root root 4.0K Dec 14 18:44 ..&lt;br /&gt;
drwxr-xr-x   2 root root    0 Dec 14 19:05 archive&lt;br /&gt;
drwxr-xr-x   2 root root    0 Dec 14 19:05 definitions&lt;br /&gt;
drwxr-xr-x   2 root root    0 Dec 14 19:05 files&lt;br /&gt;
drwxr-xr-x   2 root root    0 Dec 14 19:05 provision&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Wonderful!&lt;br /&gt;
&lt;br /&gt;
As with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;drbd&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clvmd&amp;lt;/span&amp;gt;, we don&#039;t want to have &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;gfs2&amp;lt;/span&amp;gt; start at boot as we&#039;re going to put it under the control of the cluster.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
chkconfig gfs2 off&lt;br /&gt;
chkconfig --list gfs2&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
gfs2           	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;
==== Renaming a GFS2 Partition ====&lt;br /&gt;
&lt;br /&gt;
{{warning|1=Be sure to unmount the GFS2 partition from &#039;&#039;&#039;all&#039;&#039;&#039; nodes prior to altering the cluster or filesystem names!}}&lt;br /&gt;
&lt;br /&gt;
If you ever need to rename your cluster, you will need to update your GFS2 partition before you can remount it. Unmount the partition from all nodes and run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
gfs2_tool sb /dev/shared-vg0/shared table &amp;quot;new_cluster_name:shared&amp;quot;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
You shouldn&#039;t change any of these values if the filesystem is mounted.&lt;br /&gt;
&lt;br /&gt;
Are you sure? [y/n] y&lt;br /&gt;
&lt;br /&gt;
current lock table name = &amp;quot;an-cluster-A:shared&amp;quot;&lt;br /&gt;
new lock table name = &amp;quot;new_cluster_name:shared&amp;quot;&lt;br /&gt;
Done&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then you can change the cluster&#039;s name in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cluster.conf&amp;lt;/span&amp;gt; and then remount the GFS2 partition.&lt;br /&gt;
&lt;br /&gt;
You can use the same command, changing the GFS2 partition name, if you want to change the name of the filesystem instead of (or at the same time as) the cluster&#039;s name.&lt;br /&gt;
&lt;br /&gt;
=== Stopping All Clustered Storage Components ===&lt;br /&gt;
&lt;br /&gt;
Before we can put storage under the cluster&#039;s control, we need to make sure that the &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;clvmd&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;drbd&amp;lt;/span&amp;gt; daemons are stopped.&lt;br /&gt;
&lt;br /&gt;
On &#039;&#039;&#039;both&#039;&#039;&#039; nodes, run;&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 &amp;amp;&amp;amp; /etc/init.d/clvmd stop &amp;amp;&amp;amp; /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;
Unmounting GFS2 filesystem (/shared):                      [  OK  ]&lt;br /&gt;
Deactivating clustered VG(s):   0 logical volume(s) in volume group &amp;quot;an02-vg0&amp;quot; now active&lt;br /&gt;
  0 logical volume(s) in volume group &amp;quot;an01-vg0&amp;quot; now active&lt;br /&gt;
  0 logical volume(s) in volume group &amp;quot;shared-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;
Stopping all DRBD resources: .&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Managing Storage In The Cluster =&lt;br /&gt;
&lt;br /&gt;
A little while back, we spoke about how the cluster is split into two components; cluster communication managed by &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt; and resource management provided by &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt;. It&#039;s the later which we will now begin to configure.&lt;br /&gt;
&lt;br /&gt;
In the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cluster.conf&amp;lt;/span&amp;gt;, the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; component is contained within the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;rm /&amp;gt;&amp;lt;/span&amp;gt; element tags. Within this element are three types of child elements. They are:&lt;br /&gt;
* Fail-over Domains - &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;failoverdomains /&amp;gt;&amp;lt;/span&amp;gt;; &lt;br /&gt;
** These are optional constraints which allow for control which nodes, and under what circumstances, services may run. When not used, a service will be allowed to run on any node in the cluster without constraints or ordering.&lt;br /&gt;
* Resources - &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;resources /&amp;gt;&amp;lt;/span&amp;gt;; &lt;br /&gt;
** Within this element, available resources are defined. Simply having a resource here will not put it under cluster control. Rather, it makes it available for use in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;service /&amp;gt;&amp;lt;/span&amp;gt; elements.&lt;br /&gt;
* Services - &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;service /&amp;gt;&amp;lt;/span&amp;gt;; &lt;br /&gt;
** This element contains one or more parallel or series child-elements which are themselves references to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;resources /&amp;gt;&amp;lt;/span&amp;gt; elements. When in parallel, the services will start and stop at the same time. When in series, the services start in order and stop in reverse order. We will also see a specialized type of service that uses the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;vm /&amp;gt;&amp;lt;/span&amp;gt; element name, as you can probably guess, for creating virtual machine services.&lt;br /&gt;
&lt;br /&gt;
We&#039;ll look at each of these components in more detail shortly.&lt;br /&gt;
&lt;br /&gt;
== A Note On Daemon Starting ==&lt;br /&gt;
&lt;br /&gt;
There are four daemons we will be putting under cluster control;&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;drbd&amp;lt;/span&amp;gt;; Replicated storage.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clvmd&amp;lt;/span&amp;gt;; Clustered LVM.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;gfs2&amp;lt;/span&amp;gt;; Mounts and Unmounts configured GFS2 partition.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;libvirtd&amp;lt;/span&amp;gt;; Provides access to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virsh&amp;lt;/span&amp;gt; and other &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;libvirt&amp;lt;/span&amp;gt; tools. Needed for running our VMs.&lt;br /&gt;
&lt;br /&gt;
The reason we do not want to start these daemons with the system is so that we can let the cluster do it. This way, should any fail, the cluster will detect the failure and fail the entire service tree. For example, lets say that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;drbd&amp;lt;/span&amp;gt; failed to start, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; would fail the storage service and give up, rather than continue trying to start &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clvmd&amp;lt;/span&amp;gt; and the rest. With &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;libvirtd&amp;lt;/span&amp;gt; being the last daemon, it will not be possible to start a VM unless the storage started successfully. &lt;br /&gt;
&lt;br /&gt;
If we had left these daemons to boot on start, the failure of the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;drbd&amp;lt;/span&amp;gt; would not effect the start-up of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clvmd&amp;lt;/span&amp;gt;, which would then not find its [[PV]]s given that DRBD is down. Next, the system would try to start the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;gfs2&amp;lt;/span&amp;gt; daemon which would also fail as the [[LV]] backing the partition would not be available. Finally, the system would start &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;libvirtd&amp;lt;/span&amp;gt;, which would allow the start of virtual machine, which would also be missing their &amp;quot;hard drives&amp;quot; as their backing LVs would also not be available. Pretty messy situation to clean up from.&lt;br /&gt;
&lt;br /&gt;
=== Defining The Resources ===&lt;br /&gt;
&lt;br /&gt;
Lets start by first defining our clustered resources. &lt;br /&gt;
&lt;br /&gt;
As stated before, the addition of these resources does not, in itself, put the defined resources under the cluster&#039;s management. Instead, it defines services, like &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;init.d&amp;lt;/span&amp;gt; scripts. These can then be used by one or more &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;service /&amp;gt;&amp;lt;/span&amp;gt; elements, as we will see shortly. For now, it is enough to know what, until a resource is defined, it can not be used in the cluster.&lt;br /&gt;
&lt;br /&gt;
Given that this is the first component of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; being added to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cluster.conf&amp;lt;/span&amp;gt;, we will be creating the parent &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;rm /&amp;gt;&amp;lt;/span&amp;gt; elements here as well.&lt;br /&gt;
&lt;br /&gt;
Let&#039;s take a look at the new section, then discuss the parts.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;cluster name=&amp;quot;an-cluster-A&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-node01.alteeve.com&amp;quot; nodeid=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
                        &amp;lt;fence&amp;gt;&lt;br /&gt;
                                &amp;lt;method name=&amp;quot;ipmi&amp;quot;&amp;gt;&lt;br /&gt;
                                        &amp;lt;device name=&amp;quot;ipmi_an01&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;pdu&amp;quot;&amp;gt;&lt;br /&gt;
                                        &amp;lt;device name=&amp;quot;pdu2&amp;quot; port=&amp;quot;1&amp;quot; action=&amp;quot;reboot&amp;quot; /&amp;gt;&lt;br /&gt;
                                &amp;lt;/method&amp;gt;&lt;br /&gt;
                        &amp;lt;/fence&amp;gt;&lt;br /&gt;
                &amp;lt;/clusternode&amp;gt;&lt;br /&gt;
                &amp;lt;clusternode name=&amp;quot;an-node02.alteeve.com&amp;quot; nodeid=&amp;quot;2&amp;quot;&amp;gt;&lt;br /&gt;
                        &amp;lt;fence&amp;gt;&lt;br /&gt;
                                &amp;lt;method name=&amp;quot;ipmi&amp;quot;&amp;gt;&lt;br /&gt;
                                        &amp;lt;device name=&amp;quot;ipmi_an02&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;pdu&amp;quot;&amp;gt;&lt;br /&gt;
                                        &amp;lt;device name=&amp;quot;pdu2&amp;quot; port=&amp;quot;2&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;ipmi_an01&amp;quot; agent=&amp;quot;fence_ipmilan&amp;quot; ipaddr=&amp;quot;an-node01.ipmi&amp;quot; login=&amp;quot;root&amp;quot; passwd=&amp;quot;secret&amp;quot; /&amp;gt;&lt;br /&gt;
                &amp;lt;fencedevice name=&amp;quot;ipmi_an02&amp;quot; agent=&amp;quot;fence_ipmilan&amp;quot; ipaddr=&amp;quot;an-node02.ipmi&amp;quot; login=&amp;quot;root&amp;quot; passwd=&amp;quot;secret&amp;quot; /&amp;gt;&lt;br /&gt;
                &amp;lt;fencedevice agent=&amp;quot;fence_apc_snmp&amp;quot; ipaddr=&amp;quot;pdu2.alteeve.com&amp;quot; name=&amp;quot;pdu2&amp;quot; /&amp;gt;&lt;br /&gt;
        &amp;lt;/fencedevices&amp;gt;&lt;br /&gt;
        &amp;lt;fence_daemon post_join_delay=&amp;quot;30&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 log_level=&amp;quot;5&amp;quot;&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;script file=&amp;quot;/etc/init.d/libvirtd&amp;quot; name=&amp;quot;libvirtd&amp;quot;/&amp;gt;&lt;br /&gt;
                &amp;lt;/resources&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;
First and foremost; Note that we&#039;ve incremented the version to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;8&amp;lt;/span&amp;gt;. As always, increment and then edit.&lt;br /&gt;
&lt;br /&gt;
Let&#039;s focus on the new section;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;rm log_level=&amp;quot;5&amp;quot;&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;script file=&amp;quot;/etc/init.d/libvirtd&amp;quot; name=&amp;quot;libvirtd&amp;quot;/&amp;gt;&lt;br /&gt;
		&amp;lt;/resources&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 new &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;rm log_level=&amp;quot;5&amp;quot;&amp;gt;...&amp;lt;/rm&amp;gt;&amp;lt;/span&amp;gt; element tells the cluster that this is the section for &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; and that we&#039;re setting the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;log_level&amp;lt;/span&amp;gt; to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;5&amp;lt;/span&amp;gt;. This &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;log_level&amp;lt;/span&amp;gt; is slightly less verbose that the default. Specifically, by default, there is an entry in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/var/log/messages&amp;lt;/span&amp;gt; every time each resource is checked. This quickly adds a lot of questionably useful information to [[syslog]]. By changing this, we will still see all important messages, but these resource check messages are suppressed. If you are ever curious about whether or not &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; is, in fact, checking the services than either remove &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;log_level=&amp;quot;5&amp;quot;&amp;lt;/span&amp;gt; or change it to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;6&amp;lt;/span&amp;gt; or higher.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;resources&amp;gt;...&amp;lt;/resources&amp;gt;&amp;lt;/span&amp;gt; element contains our four &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;script .../&amp;gt;&amp;lt;/span&amp;gt; resources. This is a particular type of resource which specifically handles that starting and stopping of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[init.d]]&amp;lt;/span&amp;gt; style scripts. That is, the script must exit with [[LSB]] compliant codes. They must also properly react to being called with the sole argument of &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;.&lt;br /&gt;
&lt;br /&gt;
There are many other types of resources which, with the exception of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;vm .../&amp;gt;&amp;lt;/span&amp;gt;, we will not be looking at in this tutorial. Should you be interested in them, please look in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/usr/share/cluster&amp;lt;/span&amp;gt; for the various scripts (executable files that end with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;.sh&amp;lt;/span&amp;gt;). &lt;br /&gt;
&lt;br /&gt;
Each of our four &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;script ... /&amp;gt;&amp;lt;/span&amp;gt; resources have two attributes;&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;file=&amp;quot;...&amp;quot;&amp;lt;/span&amp;gt;; The full path to the script to be managed.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;name=&amp;quot;...&amp;quot;&amp;lt;/span&amp;gt;; A unique name used to reference this resource later on in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;service /&amp;gt;&amp;lt;/span&amp;gt; elements.&lt;br /&gt;
&lt;br /&gt;
Other resources are more involved, but the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;script .../&amp;gt;&amp;lt;/span&amp;gt; resources are quite simple.&lt;br /&gt;
&lt;br /&gt;
=== Creating Failover Domains ===&lt;br /&gt;
&lt;br /&gt;
Fail-over domains are, at their most basic, a collection of one or more nodes in the cluster with a particular set of rules associated with them. Services can then be configured to operate within the context of a given fail-over domain. There are a few key options to be aware of.&lt;br /&gt;
&lt;br /&gt;
Fail-over domains are optional and can be left out of the cluster, generally speaking. However, in our cluster, we will need them for our storage services, as we will later see, so please do not skip this step.&lt;br /&gt;
&lt;br /&gt;
* A fail-over domain can be unordered or prioritized.&lt;br /&gt;
** When unordered, a service will start on any node in the domain. Should that node later fail, it will restart to another random node in the domain.&lt;br /&gt;
** When prioritized, a service will start on the available node with the highest priority in the domain. Should that node later fail, the service will restart on the available node with the next highest priority.&lt;br /&gt;
* A fail-over domain can be restricted or unrestricted.&lt;br /&gt;
** When restricted, a service is &#039;&#039;&#039;only&#039;&#039;&#039; allowed to start on, or restart on. a nodes in the domain. When no nodes are available, the service will be stopped.&lt;br /&gt;
** When unrestricted, a service will try to start on, or restart on, a node in the domain. However, when no domain members are available, the cluster will pick another available node at random to start the service on.&lt;br /&gt;
* A fail-over domain can have a fail-back policy.&lt;br /&gt;
** When a domain allows for fail-back and the domain is ordered, and a node with a higher &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;priority&amp;lt;/span&amp;gt; (re)joins the cluster, services within the domain will migrate to that higher-priority node. 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 fail-back, but is unrestricted, fail-back of services that fell out of the domain will happen anyway. That is to say, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;nofailback=&amp;quot;1&amp;quot;&amp;lt;/span&amp;gt; is ignored if a service was running on a node outside of the fail-over domain and a node within the domain joins the cluster. However, once the service is on a node within the domain, the service will &#039;&#039;&#039;not&#039;&#039;&#039; relocate to a higher-priority node should one join the cluster later.&lt;br /&gt;
** When a domain does not allow for fail-back and is restricted, then fail-back of services will never occur.&lt;br /&gt;
&lt;br /&gt;
What we need to do at this stage is to create something of a hack. Let me explain;&lt;br /&gt;
&lt;br /&gt;
As discussed earlier, we need to start a set of local daemons on all nodes. These aren&#039;t really clustered resources though as they can only ever run on their host node. They will never be relocated or restarted elsewhere in the cluster as as such, are not highly available. So to work around this desire to &amp;quot;cluster the unclusterable&amp;quot;, we&#039;re going to create a fail-over domain for each node in the cluster. Each of these domains will have only one of the cluster nodes as members of the domain and the domain will be restricted, unordered and have no fail-back. With this configuration, any service group using it will only ever run on the one node in the domain.&lt;br /&gt;
&lt;br /&gt;
In the next step, we will create a service group, then replicate it once for each node in the cluster. The only difference will be the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;failoverdomain&amp;lt;/span&amp;gt; each is set to use. With our configuration of two nodes then, we will have two fail-over domains, one for each node, and we will define the clustered storage service twice, each one using one of the two fail-over domains.&lt;br /&gt;
&lt;br /&gt;
Let&#039;s look at the complete updated &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cluster.conf&amp;lt;/span&amp;gt;, then we will focus closer on the new section.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;cluster name=&amp;quot;an-cluster-A&amp;quot; config_version=&amp;quot;9&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-node01.alteeve.com&amp;quot; nodeid=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
                        &amp;lt;fence&amp;gt;&lt;br /&gt;
                                &amp;lt;method name=&amp;quot;ipmi&amp;quot;&amp;gt;&lt;br /&gt;
                                        &amp;lt;device name=&amp;quot;ipmi_an01&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;pdu&amp;quot;&amp;gt;&lt;br /&gt;
                                        &amp;lt;device name=&amp;quot;pdu2&amp;quot; port=&amp;quot;1&amp;quot; action=&amp;quot;reboot&amp;quot; /&amp;gt;&lt;br /&gt;
                                &amp;lt;/method&amp;gt;&lt;br /&gt;
                        &amp;lt;/fence&amp;gt;&lt;br /&gt;
                &amp;lt;/clusternode&amp;gt;&lt;br /&gt;
                &amp;lt;clusternode name=&amp;quot;an-node02.alteeve.com&amp;quot; nodeid=&amp;quot;2&amp;quot;&amp;gt;&lt;br /&gt;
                        &amp;lt;fence&amp;gt;&lt;br /&gt;
                                &amp;lt;method name=&amp;quot;ipmi&amp;quot;&amp;gt;&lt;br /&gt;
                                        &amp;lt;device name=&amp;quot;ipmi_an02&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;pdu&amp;quot;&amp;gt;&lt;br /&gt;
                                        &amp;lt;device name=&amp;quot;pdu2&amp;quot; port=&amp;quot;2&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;ipmi_an01&amp;quot; agent=&amp;quot;fence_ipmilan&amp;quot; ipaddr=&amp;quot;an-node01.ipmi&amp;quot; login=&amp;quot;root&amp;quot; passwd=&amp;quot;secret&amp;quot; /&amp;gt;&lt;br /&gt;
                &amp;lt;fencedevice name=&amp;quot;ipmi_an02&amp;quot; agent=&amp;quot;fence_ipmilan&amp;quot; ipaddr=&amp;quot;an-node02.ipmi&amp;quot; login=&amp;quot;root&amp;quot; passwd=&amp;quot;secret&amp;quot; /&amp;gt;&lt;br /&gt;
                &amp;lt;fencedevice agent=&amp;quot;fence_apc_snmp&amp;quot; ipaddr=&amp;quot;pdu2.alteeve.com&amp;quot; name=&amp;quot;pdu2&amp;quot; /&amp;gt;&lt;br /&gt;
        &amp;lt;/fencedevices&amp;gt;&lt;br /&gt;
        &amp;lt;fence_daemon post_join_delay=&amp;quot;30&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 log_level=&amp;quot;5&amp;quot;&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;script file=&amp;quot;/etc/init.d/libvirtd&amp;quot; name=&amp;quot;libvirtd&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;only_an01&amp;quot; nofailback=&amp;quot;1&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-node01.alteeve.com&amp;quot;/&amp;gt;&lt;br /&gt;
                        &amp;lt;/failoverdomain&amp;gt;&lt;br /&gt;
                        &amp;lt;failoverdomain name=&amp;quot;only_an02&amp;quot; nofailback=&amp;quot;1&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-node02.alteeve.com&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;
As always, the version was incremented, this time to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;9&amp;lt;/span&amp;gt;. We&#039;ve also added the new &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;failoverdomains&amp;gt;...&amp;lt;/failoverdomains&amp;gt;&amp;lt;/span&amp;gt; element. Let&#039;s take a closer look at this new element.&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;
                        &amp;lt;failoverdomain name=&amp;quot;only_an01&amp;quot; nofailback=&amp;quot;1&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-node01.alteeve.com&amp;quot;/&amp;gt;&lt;br /&gt;
                        &amp;lt;/failoverdomain&amp;gt;&lt;br /&gt;
                        &amp;lt;failoverdomain name=&amp;quot;only_an02&amp;quot; nofailback=&amp;quot;1&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-node02.alteeve.com&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;
The first thing to node is that there are two &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;failoverdomain...&amp;gt;...&amp;lt;/failoverdomain&amp;gt;&amp;lt;/span&amp;gt; child elements. &lt;br /&gt;
* The first has the name &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;only_an01&amp;lt;/span&amp;gt; and contains only the node &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt; as a member.&lt;br /&gt;
* The second is effectively identical, save that the domain&#039;s name is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;only_an02&amp;lt;/span&amp;gt; and it contains only the node &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt; as a member.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;failoverdomain ...&amp;gt;&amp;lt;/span&amp;gt; element has four attributes;&lt;br /&gt;
* The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;name=&amp;quot;...&amp;quot;&amp;lt;/span&amp;gt; attribute sets the unique name of the domain which we will later use to bind a service to the domain.&lt;br /&gt;
* The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;nofailback=&amp;quot;1&amp;quot;&amp;lt;/span&amp;gt; attribute tells the cluster to never &amp;quot;fail back&amp;quot; any services in this domain. This seems redundant, given there is only one node, but when combined with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;restricted=&amp;quot;0&amp;quot;&amp;lt;/span&amp;gt;, prevents any migration of services.&lt;br /&gt;
* The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ordered=&amp;quot;0&amp;quot;&amp;lt;/span&amp;gt; this is also somewhat redundant in that there is only one node defined in the domain, but I don&#039;t like to leave attributes undefined so I have it here.&lt;br /&gt;
* The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;restricted=&amp;quot;1&amp;quot;&amp;lt;/span&amp;gt; attribute is key in that it tells the cluster to &#039;&#039;&#039;not&#039;&#039;&#039; try to restart services within this domain on any other nodes outside of the one defined in the fail-over domain.&lt;br /&gt;
&lt;br /&gt;
Each of the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;failoverdomain...&amp;gt;&amp;lt;/span&amp;gt; elements has a single &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;failoverdomainnode .../&amp;gt;&amp;lt;/span&amp;gt; child element. This is a very simple element which has, at this time, only one attribute;&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;name=&amp;quot;...&amp;quot;&amp;lt;/span&amp;gt;; The name of the node to include in the fail-over domain. This name must match the corresponding &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;clusternode name=&amp;quot;...&amp;quot;&amp;lt;/span&amp;gt; node name.&lt;br /&gt;
&lt;br /&gt;
At this point, we&#039;re ready to finally create our clustered storage services.&lt;br /&gt;
&lt;br /&gt;
=== Creating Clustered Storage Services ===&lt;br /&gt;
&lt;br /&gt;
With the resources defined and the fail-over domains created, we can set about creating our services.&lt;br /&gt;
&lt;br /&gt;
Generally speaking, services can have one or more resources within them. When two or more resources exist, then can be put into a dependency tree, they can used in parallel or a combination of parallel and dependent resources.&lt;br /&gt;
&lt;br /&gt;
When you create a service dependency tree, you put each dependent resource as a child element of its parent. The resources are then started in order, starting at the top of the tree and working its way down to the deepest child resource. If at any time one of the resources should fail, the entire service will be declared failed and no attempt will be made to try and start any further child resources. Conversely, stopping the service will cause the deepest child resource to be stopped first. Then the second deepest and on upwards towards the top resource. This is exactly the behaviour we want, as we will see shortly.&lt;br /&gt;
&lt;br /&gt;
When resources are defined in parallel, all defined resources will be started at the same time. Should any one of the resources fail to start, the entire resource will declared failed. Stopping the service will likewise cause a simultaneous call to stop all resources.&lt;br /&gt;
&lt;br /&gt;
As before, let&#039;s take a look at the entire updated &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cluster.conf&amp;lt;/span&amp;gt; file, then we&#039;ll focus in on the new service section.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;cluster name=&amp;quot;an-cluster-A&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-node01.alteeve.com&amp;quot; nodeid=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
                        &amp;lt;fence&amp;gt;&lt;br /&gt;
                                &amp;lt;method name=&amp;quot;ipmi&amp;quot;&amp;gt;&lt;br /&gt;
                                        &amp;lt;device name=&amp;quot;ipmi_an01&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;pdu&amp;quot;&amp;gt;&lt;br /&gt;
                                        &amp;lt;device name=&amp;quot;pdu2&amp;quot; port=&amp;quot;1&amp;quot; action=&amp;quot;reboot&amp;quot; /&amp;gt;&lt;br /&gt;
                                &amp;lt;/method&amp;gt;&lt;br /&gt;
                        &amp;lt;/fence&amp;gt;&lt;br /&gt;
                &amp;lt;/clusternode&amp;gt;&lt;br /&gt;
                &amp;lt;clusternode name=&amp;quot;an-node02.alteeve.com&amp;quot; nodeid=&amp;quot;2&amp;quot;&amp;gt;&lt;br /&gt;
                        &amp;lt;fence&amp;gt;&lt;br /&gt;
                                &amp;lt;method name=&amp;quot;ipmi&amp;quot;&amp;gt;&lt;br /&gt;
                                        &amp;lt;device name=&amp;quot;ipmi_an02&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;pdu&amp;quot;&amp;gt;&lt;br /&gt;
                                        &amp;lt;device name=&amp;quot;pdu2&amp;quot; port=&amp;quot;2&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;ipmi_an01&amp;quot; agent=&amp;quot;fence_ipmilan&amp;quot; ipaddr=&amp;quot;an-node01.ipmi&amp;quot; login=&amp;quot;root&amp;quot; passwd=&amp;quot;secret&amp;quot; /&amp;gt;&lt;br /&gt;
                &amp;lt;fencedevice name=&amp;quot;ipmi_an02&amp;quot; agent=&amp;quot;fence_ipmilan&amp;quot; ipaddr=&amp;quot;an-node02.ipmi&amp;quot; login=&amp;quot;root&amp;quot; passwd=&amp;quot;secret&amp;quot; /&amp;gt;&lt;br /&gt;
                &amp;lt;fencedevice agent=&amp;quot;fence_apc_snmp&amp;quot; ipaddr=&amp;quot;pdu2.alteeve.com&amp;quot; name=&amp;quot;pdu2&amp;quot; /&amp;gt;&lt;br /&gt;
        &amp;lt;/fencedevices&amp;gt;&lt;br /&gt;
        &amp;lt;fence_daemon post_join_delay=&amp;quot;30&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 log_level=&amp;quot;5&amp;quot;&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;script file=&amp;quot;/etc/init.d/libvirtd&amp;quot; name=&amp;quot;libvirtd&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;only_an01&amp;quot; nofailback=&amp;quot;1&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-node01.alteeve.com&amp;quot;/&amp;gt;&lt;br /&gt;
                        &amp;lt;/failoverdomain&amp;gt;&lt;br /&gt;
                        &amp;lt;failoverdomain name=&amp;quot;only_an02&amp;quot; nofailback=&amp;quot;1&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-node02.alteeve.com&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 name=&amp;quot;storage_an01&amp;quot; autostart=&amp;quot;1&amp;quot; domain=&amp;quot;only_an01&amp;quot; exclusive=&amp;quot;0&amp;quot; recovery=&amp;quot;restart&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 ref=&amp;quot;libvirtd&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;/script&amp;gt;&lt;br /&gt;
                &amp;lt;/service&amp;gt;&lt;br /&gt;
                &amp;lt;service name=&amp;quot;storage_an02&amp;quot; autostart=&amp;quot;1&amp;quot; domain=&amp;quot;only_an02&amp;quot; exclusive=&amp;quot;0&amp;quot; recovery=&amp;quot;restart&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 ref=&amp;quot;libvirtd&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;/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;
With the version now at &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;10&amp;lt;/span&amp;gt;, we have added two &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;service...&amp;gt;...&amp;lt;/service&amp;gt;&amp;lt;/span&amp;gt; elements. Each containing a four &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;script ...&amp;gt;&amp;lt;/span&amp;gt; type resources in a service tree configuration. Let&#039;s take a closer look.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;service name=&amp;quot;storage_an01&amp;quot; autostart=&amp;quot;1&amp;quot; domain=&amp;quot;only_an01&amp;quot; exclusive=&amp;quot;0&amp;quot; recovery=&amp;quot;restart&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 ref=&amp;quot;libvirtd&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;/script&amp;gt;&lt;br /&gt;
		&amp;lt;/service&amp;gt;&lt;br /&gt;
		&amp;lt;service name=&amp;quot;storage_an02&amp;quot; autostart=&amp;quot;1&amp;quot; domain=&amp;quot;only_an02&amp;quot; exclusive=&amp;quot;0&amp;quot; recovery=&amp;quot;restart&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 ref=&amp;quot;libvirtd&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;/script&amp;gt;&lt;br /&gt;
		&amp;lt;/service&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;&amp;lt;service ...&amp;gt;...&amp;lt;/service&amp;gt;&amp;lt;/span&amp;gt; elements have five attributes each;&lt;br /&gt;
* The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;name=&amp;quot;...&amp;quot;&amp;lt;/span&amp;gt; attribute is a unique name that will be used to identify the service, as we will see later.&lt;br /&gt;
* The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;autostart=&amp;quot;1&amp;quot;&amp;lt;/span&amp;gt; attribute tells the cluster that, when it starts, it should automatically start this service.&lt;br /&gt;
* The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;domain=&amp;quot;...&amp;quot;&amp;lt;/span&amp;gt; attribute tells the cluster which fail-over domain this service must run within. The two otherwise identical services each point to a different fail-over domain, as we discussed in the previous section.&lt;br /&gt;
* The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;exclusive=&amp;quot;0&amp;quot;&amp;lt;/span&amp;gt; attribute tells the cluster that a node running this service &#039;&#039;&#039;is&#039;&#039;&#039; allowed to to have other services running as well.&lt;br /&gt;
* The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;recovery=&amp;quot;restart&amp;quot;&amp;lt;/span&amp;gt; attribute sets the service recovery policy. As the name implies, the cluster will try to restart this service should it fail. Should the service fail multiple times in a row, it will be disabled. The exact number of failures allowed before disabling is configurable using the optional &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;max_restarts&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;restart_expire_time&amp;lt;/span&amp;gt; attributes, which are not covered here.&lt;br /&gt;
&lt;br /&gt;
{{warning|1=It is a fairly common mistake to interpret &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;exclusive&amp;lt;/span&amp;gt; to mean that a service is only allowed to run on one node at a time. This is not the case, please do not use this attribute incorrectly.}}&lt;br /&gt;
&lt;br /&gt;
Within each of the two &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;service ...&amp;gt;...&amp;lt;/service&amp;gt;&amp;lt;/span&amp;gt; attributes are four &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;script...&amp;gt;&amp;lt;/span&amp;gt; type resources. These are configured as a service tree in the order;&lt;br /&gt;
* &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; -&amp;gt; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;libvirtd&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Each of these &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;script ...&amp;gt;&amp;lt;/span&amp;gt; elements has just one attribute; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ref=&amp;quot;...&amp;quot;&amp;lt;/span&amp;gt; which points to a corresponding &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;script&amp;lt;/span&amp;gt; resource. &lt;br /&gt;
&lt;br /&gt;
The logic for this particular resource tree is;&lt;br /&gt;
* DRBD needs to start so that the bare clustered storage devices become available.&lt;br /&gt;
* Clustered LVM must next start so that the logical volumes used by GFS2 and our VMs become available.&lt;br /&gt;
* The GFS2 partition contains the [[XML]] definition files needed to start our virtual machines.&lt;br /&gt;
* Finally, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;libvirtd&amp;lt;/span&amp;gt; must be running for the virtual machines to be able to run. By putting this daemon in the resource tree, we can ensure that no attempt to start a VM will succeed until all of the clustered storage stack is available.&lt;br /&gt;
&lt;br /&gt;
From the other direction, we need the stop order to be organized in the reverse order.&lt;br /&gt;
* Stopping &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;libvirtd&amp;lt;/span&amp;gt; would cause any remaining running VMs to stop. If a VM is blocking, it will prevent &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;libvirtd&amp;lt;/span&amp;gt; from stopping and, thus, delay any of our other clustered storage resources from attempting to stop.&lt;br /&gt;
* We need the GFS2 partition to unmount after the VM goes down and before Clustered LVM map stop.&lt;br /&gt;
* With all VMs and the GFS2 partition stopped, we can safely say that all LVs are no longer in use and thus &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clvmd&amp;lt;/span&amp;gt; can stop.&lt;br /&gt;
* With Clustered LVM now stopped, nothing should be using our DRBD resources any more, so we can safely stop them, too.&lt;br /&gt;
&lt;br /&gt;
All in all, it&#039;s a surprisingly simple and effective configuration.&lt;br /&gt;
&lt;br /&gt;
== Validating And Pushing The Changes ==&lt;br /&gt;
&lt;br /&gt;
We&#039;ve made a big change, so it&#039;s all the more important that we validate the config before proceeding.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ccs_config_validate &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Configuration validates&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We need to now tell the cluster to use the new configuration file. Unlike last time, we won&#039;t use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rsync&amp;lt;/span&amp;gt;. Now that the cluster is up and running, we can use it to push out the updated configuration file using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman_tool&amp;lt;/span&amp;gt;. This is the first time we&#039;ve used the cluster to push out an updated &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cluster.conf&amp;lt;/span&amp;gt; file, so we will have to enter the password we set earlier for the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ricci&amp;lt;/span&amp;gt; user on both nodes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cman_tool version -r&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
You have not authenticated to the ricci daemon on an-node01.alteeve.com&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Password: &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
You have not authenticated to the ricci daemon on an-node02.alteeve.com&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Password: &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you were watching syslog, you will have seen an entries like the ones below.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Dec 14 20:39:08 an-node01 modcluster: Updating cluster.conf&lt;br /&gt;
Dec 14 20:39:12 an-node01 corosync[2360]:   [QUORUM] Members[2]: 1 2&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we can confirm that both nodes are using the new configuration by re-running the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman_tool version&amp;lt;/span&amp;gt; command, but without the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;-r&amp;lt;/span&amp;gt; switch.&lt;br /&gt;
&lt;br /&gt;
On &#039;&#039;&#039;both&#039;&#039;&#039;;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cman_tool version&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
6.2.0 config 10&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Checking The Cluster&#039;s Status ==&lt;br /&gt;
&lt;br /&gt;
Now let&#039;s look at a new tool; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clustat&amp;lt;/span&amp;gt;, &#039;&#039;&#039;clu&#039;&#039;&#039;ster &#039;&#039;&#039;stat&#039;&#039;&#039;us. We&#039;ll be using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clustat&amp;lt;/span&amp;gt; extensively from here on out to monitor the status of the cluster members and managed services. It does not manage the cluster in any way, it is simply a status tool. We&#039;ll see how &lt;br /&gt;
&lt;br /&gt;
Here is what it should look like when run from &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;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-cluster-A @ Wed Dec 14 20:45:04 2011&lt;br /&gt;
Member Status: Quorate&lt;br /&gt;
&lt;br /&gt;
 Member Name                             ID   Status&lt;br /&gt;
 ------ ----                             ---- ------&lt;br /&gt;
 an-node01.alteeve.com                       1 Online, Local&lt;br /&gt;
 an-node02.alteeve.com                       2 Online&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At this point, we&#039;re only running the foundation of the cluster, so we can only see which nodes are in the cluster. We&#039;ve added resources to the cluster configuration though, so it&#039;s time to start the resource layer as well, which is managed by the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; daemon. &lt;br /&gt;
&lt;br /&gt;
At this time, we&#039;re still starting the cluster manually after each node boots, so we&#039;re going to make sure that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; is disabled at boot.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
chkconfig rgmanager off&lt;br /&gt;
chkconfig --list rgmanager&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
rgmanager      	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;
Now let&#039;s start it. &lt;br /&gt;
&lt;br /&gt;
{{note|1=We&#039;ve configured the storage services to start automatically. When we start &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; now, it will start the storage resources, including DRBD. In turn, DRBD will stop up to five minutes and wait for its peer. This will cause the first node you start &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; on to appear to hang until the other node&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; has started DRBD as well.}}&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;
Now let&#039;s run &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clustat&amp;lt;/span&amp;gt; again, and see what&#039;s new.&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-cluster-A @ Wed Dec 14 20:52:11 2011&lt;br /&gt;
Member Status: Quorate&lt;br /&gt;
&lt;br /&gt;
 Member Name                             ID   Status&lt;br /&gt;
 ------ ----                             ---- ------&lt;br /&gt;
 an-node01.alteeve.com                       1 Online, Local, rgmanager&lt;br /&gt;
 an-node02.alteeve.com                       2 Online, rgmanager&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State         &lt;br /&gt;
 ------- ----                   ----- ------                   -----         &lt;br /&gt;
 service:storage_an01           an-node01.alteeve.com          started       &lt;br /&gt;
 service:storage_an02           an-node02.alteeve.com          started       &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
What we see are two section; The top section shows the cluster members and the lower part covers the managed resources. &lt;br /&gt;
&lt;br /&gt;
We can see that both members, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01.alteeve.com&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02.alteeve.com&amp;lt;/span&amp;gt; are &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Online&amp;lt;/span&amp;gt;, meaning that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt; is running and that they&#039;ve joined the cluster. It also shows us that both members are running &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt;. You will always see &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Local&amp;lt;/span&amp;gt; beside the name of the node you ran the actual &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clustat&amp;lt;/span&amp;gt; command from.&lt;br /&gt;
&lt;br /&gt;
Under the services, you can see the two new services we created with the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;service:&amp;lt;/span&amp;gt; prefix. We can see that each service is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;started&amp;lt;/span&amp;gt;, meaning that all four of the resources are up and running properly and which node each service is running on.&lt;br /&gt;
&lt;br /&gt;
Note that the two storage services are running, despite not having started them? That is because the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; service was started earlier. When we pushed out the updated configuration, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; saw the two new storage services had &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;autostart=&amp;quot;1&amp;quot;&amp;lt;/span&amp;gt; and started them. If you check your storage services now, you will see that they are all online.&lt;br /&gt;
&lt;br /&gt;
DRBD;&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;
version: 8.3.12 (api:88/proto:86-96)&lt;br /&gt;
GIT-hash: e2a8ef4656be026bbae540305fcb998a5991090f build by dag@Build64R6, 2011-11-20 10:57:03&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;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Clustered LVM;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
pvscan; vgscan; 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;
  PV /dev/drbd2   VG an02-vg0     lvm2 [201.25 GiB / 201.25 GiB free]&lt;br /&gt;
  PV /dev/drbd1   VG an01-vg0     lvm2 [201.62 GiB / 201.62 GiB free]&lt;br /&gt;
  PV /dev/drbd0   VG shared-vg0   lvm2 [18.61 GiB / 0    free]&lt;br /&gt;
  Total: 3 [421.48 GiB] / in use: 3 [421.48 GiB] / in no VG: 0 [0   ]&lt;br /&gt;
  Reading all physical volumes.  This may take a while...&lt;br /&gt;
  Found volume group &amp;quot;an02-vg0&amp;quot; using metadata type lvm2&lt;br /&gt;
  Found volume group &amp;quot;an01-vg0&amp;quot; using metadata type lvm2&lt;br /&gt;
  Found volume group &amp;quot;shared-vg0&amp;quot; using metadata type lvm2&lt;br /&gt;
  ACTIVE            &#039;/dev/shared-vg0/shared&#039; [18.61 GiB] inherit&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
GFS2;&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;
Configured GFS2 mountpoints: &lt;br /&gt;
/shared&lt;br /&gt;
Active GFS2 mountpoints: &lt;br /&gt;
/shared&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Nice, eh?&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;&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;
&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;
== Stopping Clustered Storage - A Preview To Cold-Stopping The Cluster ==&lt;br /&gt;
&lt;br /&gt;
To stop the storage services, we&#039;ll use the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; command line tool &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clusvcadm&amp;lt;/span&amp;gt;, the &#039;&#039;&#039;clu&#039;&#039;&#039;ster &#039;&#039;&#039;s&#039;&#039;&#039;er&#039;&#039;&#039;v&#039;&#039;&#039;i&#039;&#039;&#039;c&#039;&#039;&#039;e &#039;&#039;&#039;adm&#039;&#039;&#039;inistrator. Specifically, we&#039;ll use its &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;-d&amp;lt;/span&amp;gt; switch, which tells &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; to &#039;&#039;&#039;d&#039;&#039;&#039;isable the service.&lt;br /&gt;
&lt;br /&gt;
{{note|1=Services with the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;service:&amp;lt;/span&amp;gt; prefix can be called with their name alone. As we will see later, other services will need to have the service type prefix included.}}&lt;br /&gt;
&lt;br /&gt;
As always, confirm the current state of affairs before starting. On both nodes, run &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clustat&amp;lt;/span&amp;gt; to confirm that the storage services are up.&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-cluster-A @ Tue Dec 20 20:37:42 2011&lt;br /&gt;
Member Status: Quorate&lt;br /&gt;
&lt;br /&gt;
 Member Name                             ID   Status&lt;br /&gt;
 ------ ----                             ---- ------&lt;br /&gt;
 an-node01.alteeve.com                       1 Online, Local, rgmanager&lt;br /&gt;
 an-node02.alteeve.com                       2 Online, rgmanager&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State         &lt;br /&gt;
 ------- ----                   ----- ------                   -----         &lt;br /&gt;
 service:storage_an01           an-node01.alteeve.com          started       &lt;br /&gt;
 service:storage_an02           an-node02.alteeve.com          started       &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
They are, so now lets gracefully shut them down.&lt;br /&gt;
&lt;br /&gt;
On &#039;&#039;&#039;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;&#039;&#039;&#039;, run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
clusvcadm -d storage_an01&lt;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 service:storage_an01...Success&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If we now run &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clustat&amp;lt;/span&amp;gt; from either node, we should see this;&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-cluster-A @ Tue Dec 20 20:38:28 2011&lt;br /&gt;
Member Status: Quorate&lt;br /&gt;
&lt;br /&gt;
 Member Name                             ID   Status&lt;br /&gt;
 ------ ----                             ---- ------&lt;br /&gt;
 an-node01.alteeve.com                       1 Online, Local, rgmanager&lt;br /&gt;
 an-node02.alteeve.com                       2 Online, rgmanager&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State         &lt;br /&gt;
 ------- ----                   ----- ------                   -----         &lt;br /&gt;
 service:storage_an01           (an-node01.alteeve.com)        disabled      &lt;br /&gt;
 service:storage_an02           an-node02.alteeve.com          started       &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Notice how &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;service:storage_an01&amp;lt;/span&amp;gt; is now in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;disabled&amp;lt;/span&amp;gt; state? If you check the status of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;drbd&amp;lt;/span&amp;gt; now on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt; you will see that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt; is indeed down.&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.12 (api:88/proto:86-96)&lt;br /&gt;
GIT-hash: e2a8ef4656be026bbae540305fcb998a5991090f build by dag@Build64R6, 2011-11-20 10:57:03&lt;br /&gt;
m:res  cs            ro               ds                 p  mounted  fstype&lt;br /&gt;
0:r0   WFConnection  Primary/Unknown  UpToDate/Outdated  C&lt;br /&gt;
1:r1   WFConnection  Primary/Unknown  UpToDate/Outdated  C&lt;br /&gt;
2:r2   WFConnection  Primary/Unknown  UpToDate/Outdated  C&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you want to shut down the entire cluster, you will need to stop the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;storage_an02&amp;lt;/span&amp;gt; service as well. For fun, let&#039;s do this, but lets stop the service from &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
clusvcadm -d storage_an02&lt;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 service:storage_an02...Success&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now on both nodes, we should see this from &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-cluster-A @ Tue Dec 20 20:39: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-node01.alteeve.com                       1 Online, Local, rgmanager&lt;br /&gt;
 an-node02.alteeve.com                       2 Online, rgmanager&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State         &lt;br /&gt;
 ------- ----                   ----- ------                   -----         &lt;br /&gt;
 service:storage_an01           (an-node01.alteeve.com)        disabled      &lt;br /&gt;
 service:storage_an02           (an-node02.alteeve.com)        disabled      &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{warning|1=If you are not doing a cold shut-down of the cluster, you will want to skip this step and just stop &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt;. The reason is that the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;autostart=&amp;quot;1&amp;quot;&amp;lt;/span&amp;gt; value only gets evaluated when [[quorum]] is gained. If you disable the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;storage_anXX&amp;lt;/span&amp;gt; service and then reboot the node, the cluster has not lost quorum. Thus, when the node rejoins the cluster, the storage service &#039;&#039;&#039;will not&#039;&#039;&#039; automatically start.}}&lt;br /&gt;
&lt;br /&gt;
We can now, if we wanted to, stop the &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;cman&amp;lt;/span&amp;gt; daemons. This is, in fact, how we will cold-stop the cluster from now on.&lt;br /&gt;
&lt;br /&gt;
We&#039;ll cover cold stopping the cluster after we finish provisioning VMs.&lt;br /&gt;
&lt;br /&gt;
== Starting Clustered Storage ==&lt;br /&gt;
&lt;br /&gt;
Normally from now on, the clustered storage will start automatically. However, it&#039;s a good exercise to look at how to manually start them, just in case.&lt;br /&gt;
&lt;br /&gt;
The main difference from stopping the service is that we swap the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;-d&amp;lt;/span&amp;gt; switch for the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;-e&amp;lt;/span&amp;gt;, &#039;&#039;&#039;e&#039;&#039;&#039;nable, switch. We will also add the target cluster member name using the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;-m&amp;lt;/span&amp;gt; switch. We didn&#039;t need to use the member switch while stopping because the cluster could tell where the service was running and, thus, which member to contact to stop the service.&lt;br /&gt;
&lt;br /&gt;
Should you omit the member name, the cluster will try to use the local node as the target member. Note though that a target service will start on the node the command was issued on, regardless of the fail-over domain&#039;s ordered policy. That is to say, a service will not start on another node in the cluster when the member option is not specified, despite the fail-over configuration set to prefer another node.&lt;br /&gt;
&lt;br /&gt;
{{note|1=The storage services need to start at about the same time on both nodes. This is because the initially started storage service will hang when it tries to start &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;drbd&amp;lt;/span&amp;gt; until either the other node is up or until it times out. For this reason, be sure to have two terminal windows open to make then next two calls simultaneously.}}&lt;br /&gt;
&lt;br /&gt;
On &#039;&#039;&#039;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;&#039;&#039;&#039;, run;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
clusvcadm -e storage_an01 -m an-node01.alteeve.com&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Member an-node01.alteeve.com trying to enable service:storage_an01...Success&lt;br /&gt;
service:storage_an01 is now running on an-node01.alteeve.com&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On &#039;&#039;&#039;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt;&#039;&#039;&#039;, run;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
clusvcadm -e storage_an02 -m an-node02.alteeve.com&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Member an-node02.alteeve.com trying to enable service:storage_an02...Success&lt;br /&gt;
service:storage_an02 is now running on an-node02.alteeve.com&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; on either node should again show the storage services running again.&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-cluster-A @ Tue Dec 20 21:09:19 2011&lt;br /&gt;
Member Status: Quorate&lt;br /&gt;
&lt;br /&gt;
 Member Name                             ID   Status&lt;br /&gt;
 ------ ----                             ---- ------&lt;br /&gt;
 an-node01.alteeve.com                       1 Online, Local, rgmanager&lt;br /&gt;
 an-node02.alteeve.com                       2 Online, rgmanager&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State         &lt;br /&gt;
 ------- ----                   ----- ------                   -----         &lt;br /&gt;
 service:storage_an01           an-node01.alteeve.com          started       &lt;br /&gt;
 service:storage_an02           an-node02.alteeve.com          started       &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== A Note On Resource Management With DRBD ==&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 for &lt;br /&gt;
&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/drbd.d/global_common.conf&amp;lt;/span&amp;gt;&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;wfc-timeout&amp;lt;/span&amp;gt; seconds (&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;300&amp;lt;/span&amp;gt; in our case) 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;
If the clustered storage service ever fails, look in [[syslog]]&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/var/log/messages&amp;lt;/span&amp;gt; for a split-brain error. Look for a message 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-node01 kernel: block drbd2: helper command: /sbin/drbdadm initial-split-brain minor-2&lt;br /&gt;
Mar 29 20:24:37 an-node01 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-node01 kernel: block drbd2: Split-Brain detected but unresolved, dropping connection!&lt;br /&gt;
Mar 29 20:24:37 an-node01 kernel: block drbd2: helper command: /sbin/drbdadm split-brain minor-2&lt;br /&gt;
Mar 29 20:24:37 an-node01 kernel: block drbd2: helper command: /sbin/drbdadm split-brain minor-2 exit code 0 (0x0)&lt;br /&gt;
Mar 29 20:24:37 an-node01 kernel: block drbd2: conn( WFReportParams -&amp;gt; Disconnecting )&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With the fencing hook into the cluster, this should be a very hard problem to run into. If you do though, [http://linbit.com Linbit] has the authoritative guide to recover from this situation.&lt;br /&gt;
&lt;br /&gt;
* [http://www.drbd.org/users-guide-legacy/s-resolve-split-brain.html Manual split brain recovery]&lt;br /&gt;
&lt;br /&gt;
= Provisioning Virtual Machines =&lt;br /&gt;
&lt;br /&gt;
Now we&#039;re getting to the purpose of our cluster; Provision virtual machines!&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; Assign a collection of emulated hardware, connected to physical devices, to a given virtual machine and begin the process of installing the operating system on it. This tutorial is more about clustering than it is about virtual machine administration, so some experience with managing virtual machines has to be assumed. If you need to brush up, here are some resources;&lt;br /&gt;
&lt;br /&gt;
* [http://www.linux-kvm.org/page/HOWTO KVM project&#039;s How-Tos]&lt;br /&gt;
* [http://kvm.et.redhat.com/page/FAQ KVM project&#039;s FAQ]&lt;br /&gt;
* [http://docs.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/6/html/Hypervisor_Deployment_Guide/index.html Red Hat&#039;s Hypervisor Guide]&lt;br /&gt;
* [http://docs.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/6/html/Virtualization_Getting_Started_Guide/index.html Red Hat&#039;s Virtualization Guide]&lt;br /&gt;
* [http://docs.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/6/html/Virtualization_Administration_Guide/index.html Red Hat&#039;s Virtualization Administration]&lt;br /&gt;
* [http://docs.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/6/html/Virtualization_Host_Configuration_and_Guest_Installation_Guide/index.html Red Hat&#039;s Virtualization Host Configuration and Guest Installation Guide]&lt;br /&gt;
&lt;br /&gt;
When you feel comfortable, proceed.&lt;br /&gt;
&lt;br /&gt;
== Before We Begin - Setting Up Our Workstation ==&lt;br /&gt;
&lt;br /&gt;
The virtual machines are, for obvious reasons, headless. That is, they have no real video card into which we can plug a monitor and watch the progress of the install. This would, left unresolved, make it pretty hard to install the operating systems as there is simply no network in the early stages of most operating system installations.&lt;br /&gt;
&lt;br /&gt;
Part of the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;libvirtd&amp;lt;/span&amp;gt; package is a program called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-manager&amp;lt;/span&amp;gt; which is available on most all modern Linux distributions. This application makes it very easy to connect to our virtual machines, regardless of their network state.&lt;br /&gt;
&lt;br /&gt;
How you install this will depend on your workstation. &lt;br /&gt;
&lt;br /&gt;
On [[RPM]]-based systems, try:&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;
On [[deb]] based systems, try:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
apt-get install virt-manager&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On [[SUSE]]-based systems, try;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
zypper install virt-manager&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once it is installed, you need to determine whether your workstation is on the [[IFN]] or [[BCN]]. I&#039;ve got my laptop on the BCN, so I will connect to the nodes using just their short host names. If you&#039;re on the same IFN as the nodes, you will need to append &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;.ifn&amp;lt;/span&amp;gt; to the host names.&lt;br /&gt;
&lt;br /&gt;
[[Image:2n-RHEL6-KVM_virt-manager_01.png|thumb|448px|center|Initial installation of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-manager&amp;lt;/span&amp;gt;.]]&lt;br /&gt;
&lt;br /&gt;
To connect to the the cluster nodes;&lt;br /&gt;
&lt;br /&gt;
# Click on &#039;&#039;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;File&amp;lt;/span&amp;gt;&#039;&#039; -&amp;gt; &#039;&#039;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Add Connection...&amp;lt;/span&amp;gt;&#039;&#039;. &lt;br /&gt;
# Make sure that &#039;&#039;Hypervisor&#039;&#039; is set to &#039;&#039;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;QEMU/KVM&amp;lt;/span&amp;gt;&#039;&#039;.&lt;br /&gt;
# Click to check &#039;&#039;Connect to remote host&#039;&#039;.&lt;br /&gt;
# Make sure that &#039;&#039;Method&#039;&#039; is set to &#039;&#039;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;SSH/span&amp;gt;&#039;&#039;.&lt;br /&gt;
# Make sure that &#039;&#039;Username&#039;&#039; is set to &#039;&#039;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;root&amp;lt;/span&amp;gt;&#039;&#039;.&lt;br /&gt;
# Enter the &#039;&#039;Hostname&#039;&#039; using the proper entry from &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/hosts&amp;lt;/span&amp;gt; (ie: &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt; or &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01.ifn&amp;lt;/span&amp;gt;)&lt;br /&gt;
# Click on the button labelled &#039;&#039;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Connect&amp;lt;/span&amp;gt;&#039;&#039;.&lt;br /&gt;
# Repeat these steps for the other node.&lt;br /&gt;
&lt;br /&gt;
[[Image:2n-RHEL6-KVM_virt-manager_02.png|thumb|700px|center|New connection window.]]&lt;br /&gt;
&lt;br /&gt;
Once your two nodes have been added to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-manager&amp;lt;/span&amp;gt;, you should see both nodes as connected, but no VMs will be shown as we&#039;ve not yet provisioned any yet.&lt;br /&gt;
&lt;br /&gt;
[[Image:2n-RHEL6-KVM_virt-manager_03.png|thumb|448px|center|Two nodes added to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-manager&amp;lt;/span&amp;gt;.]]&lt;br /&gt;
&lt;br /&gt;
We&#039;ll come back to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-manager&amp;lt;/span&amp;gt; shortly.&lt;br /&gt;
&lt;br /&gt;
== Provision Planning ==&lt;br /&gt;
&lt;br /&gt;
Before we can start creating virtual machines, we need to take stock of what resources we have available and how we want to divy them out to the VMs.&lt;br /&gt;
&lt;br /&gt;
In my cluster, I&#039;ve got 200 [[GiB]] available on each of my two nodes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vgdisplay |grep -i -e free -e &amp;quot;vg name&amp;quot;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
  VG Name               an02-vg0&lt;br /&gt;
  Free  PE / Size       51521 / 201.25 GiB&lt;br /&gt;
  VG Name               an01-vg0&lt;br /&gt;
  Free  PE / Size       51615 / 201.62 GiB&lt;br /&gt;
  VG Name               shared-vg0&lt;br /&gt;
  Free  PE / Size       0 / 0   &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I know I have 8 [[GiB]] of memory, but I have to slice off a certain amount of that for the host [[OS]]. I&#039;ve got my nodes sitting about where they will be normally, so I can check how much memory is in use fairly easily.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cat /proc/meminfo |grep -e MemTotal -e MemFree&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
MemTotal:        8050312 kB&lt;br /&gt;
MemFree:         7432288 kB&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I&#039;m sitting about about 604 [[MiB]] used (&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;8,050,312 [[KiB]] - 7,432,288 KiB == 618,024 KiB / 1,024 == 603.54 MiB). I think I can safely operate within 1 [[GiB]], leaving me 7 GiB of RAM to allocate to VMs.&lt;br /&gt;
&lt;br /&gt;
Next up, I need to confirm how many CPU cores I have available.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cat /proc/cpuinfo |grep processor&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
processor	: 0&lt;br /&gt;
processor	: 1&lt;br /&gt;
processor	: 2&lt;br /&gt;
processor	: 3&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I&#039;ve got four, and I like to dedicate the first one to the host OS, so I&#039;ve got three to allocate to my VMs.&lt;br /&gt;
&lt;br /&gt;
On the network front, I know I&#039;ve got two bridges, one to the [[IFN]] and one to the [[BCN]]. &lt;br /&gt;
&lt;br /&gt;
So let&#039;s summarize:&lt;br /&gt;
* 400 GiB of space, 200 GiB per DRBD resource.&lt;br /&gt;
* 7 GiB of RAM.&lt;br /&gt;
* 3 CPU cores (can over-allocate).&lt;br /&gt;
* 1 network bridge, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vbr2&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
With this list in mind, we can now start planning out the VMs.&lt;br /&gt;
&lt;br /&gt;
The network can share the same [[subnet]] as the [[IFN]] if you wish, but I prefer to isolate my VMs from the IFN using a different subnet, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;10.254.0.0/16&amp;lt;/span&amp;gt;. This is, admittedly, &amp;quot;security by obscurity&amp;quot; and in no way is it a replacement for proper isolation. In production, you will want to setup firewalls on you nodes to prevent access from virtual machines.&lt;br /&gt;
&lt;br /&gt;
With that said, here is what we will install now. Obviously, you will have other needs and goals. Mine is an admittedly artificial network.&lt;br /&gt;
* A development server. This would be used for testing, so it will have more modest resources.&lt;br /&gt;
* A web server, which will mainly use a DB server, so will need CPU and RAM, but not much disk. &lt;br /&gt;
* A database server. &lt;br /&gt;
* A windows server. I don&#039;t exactly have a use for it, except to show how to install a Windows VM for those who do need it.&lt;br /&gt;
&lt;br /&gt;
Now to divvy up the resources;&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!VM&lt;br /&gt;
!Name&lt;br /&gt;
!Primary Host&lt;br /&gt;
!Disk&lt;br /&gt;
!CPU&lt;br /&gt;
!RAM&lt;br /&gt;
![[IFN]]&lt;br /&gt;
!OS&lt;br /&gt;
|-&lt;br /&gt;
|Dev Server&lt;br /&gt;
|class=&amp;quot;code&amp;quot;|vm0001-dev&lt;br /&gt;
|class=&amp;quot;code&amp;quot;|an-node01&lt;br /&gt;
|150 [[GiB]]&lt;br /&gt;
|1 [[GiB]]&lt;br /&gt;
|2 core&lt;br /&gt;
|class=&amp;quot;code&amp;quot;|10.254.0.1/16&lt;br /&gt;
|CentOS 6&lt;br /&gt;
|-&lt;br /&gt;
|Web Server&lt;br /&gt;
|class=&amp;quot;code&amp;quot;|vm0002-web&lt;br /&gt;
|class=&amp;quot;code&amp;quot;|an-node01&lt;br /&gt;
|50 [[GiB]]&lt;br /&gt;
|2 [[GiB]]&lt;br /&gt;
|2 cores&lt;br /&gt;
|class=&amp;quot;code&amp;quot;|10.254.0.2/16&lt;br /&gt;
|CentOS 6&lt;br /&gt;
|-&lt;br /&gt;
|Database Server&lt;br /&gt;
|class=&amp;quot;code&amp;quot;|vm0003-db&lt;br /&gt;
|class=&amp;quot;code&amp;quot;|an-node02&lt;br /&gt;
|100 [[GiB]]&lt;br /&gt;
|2 [[GiB]]&lt;br /&gt;
|2 cores&lt;br /&gt;
|class=&amp;quot;code&amp;quot;|10.254.0.3/16&lt;br /&gt;
|CentOS 6&lt;br /&gt;
|-&lt;br /&gt;
|Web Server&lt;br /&gt;
|class=&amp;quot;code&amp;quot;|vm0004-ms&lt;br /&gt;
|class=&amp;quot;code&amp;quot;|an-node02&lt;br /&gt;
|100 [[GiB]]&lt;br /&gt;
|2 [[GiB]]&lt;br /&gt;
|2 cores&lt;br /&gt;
|class=&amp;quot;code&amp;quot;|10.254.0.4/16&lt;br /&gt;
|Windows Server 2008 R2 64-bit&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Notice that we&#039;ve over-allocated the CPU cores? This is ok. We&#039;re going to restrict the VMs to CPU cores number 1 through 3, leaving core number 0 for the host OS. When all of the VMs are running on one node, the hypervisor&#039;s scheduler will handle shuffling jobs from the VMs&#039; cores to the real cores that are least loaded at a given time. &lt;br /&gt;
&lt;br /&gt;
As for the RAM though, we can not use more than we have. We&#039;re going to leave 1 [[GiB]] for the host, so we&#039;ll divvy the remaining 7 GiB between the VMs. Remember, we have to plan for when all four VMs will run on just one node.&lt;br /&gt;
&lt;br /&gt;
==== A Note on VM Configuration ====&lt;br /&gt;
&lt;br /&gt;
It would be a questionably valueable divertion to cover the setup of each VM. It will be up to you, reader, to setup each VM however you like.&lt;br /&gt;
&lt;br /&gt;
=== Provisioning vm0001-dev ===&lt;br /&gt;
&lt;br /&gt;
{{note|1=We&#039;re going to spend a lot more time on this first VM, so bear with me here, even if you aren&#039;t interested in creating a VM like this.}}&lt;br /&gt;
&lt;br /&gt;
Before we can provision, we need to gather whatever install source we&#039;ll need for the VM. This can be a simple [[ISO]] file, as we&#039;ll see on the [[2-Node Red Hat KVM Cluster Tutorial#Provisioning vm0001-dev|windows install]] later, or it can be files on a web server, which we&#039;ll use here. We&#039;ll also need to create the &amp;quot;hard drive&amp;quot; for the VM, which will be a new [[LV]]. Finally, we&#039;ll craft the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-install&amp;lt;/span&amp;gt; command which will begin the actual OS install.&lt;br /&gt;
&lt;br /&gt;
This being a Linux machine, we can provision this using a network. Conveniently, I&#039;ve got a [[Setting Up a PXE Server on an RPM-based OS|PXE server]] setup with the CentOS install files available on my local network at &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;http://10.255.255.254/c6/x86_64/img/&amp;lt;/nowiki&amp;gt;&amp;lt;/span&amp;gt;. You don&#039;t need to have a full [[PXE]] server setup, mounting the install [[ISO]] and pointing a web server at the mounted directory would work just fine. I&#039;m also going to further customize my install by using a [[kickstart]] file which, effectively, pre-answers the installation questions so that the install is fully automated.&lt;br /&gt;
&lt;br /&gt;
So, let&#039;s create the new [[LV]]. I know that this machine will be primarily run on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt; and that it will be 150 [[GiB]]. I personally always name the [[LV]]s as &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vmXXXX-Y&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 VM&#039;s name and the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Y&amp;lt;/span&amp;gt; is a simple integer. You are obviously free to use whatever makes most sense to you.&lt;br /&gt;
&lt;br /&gt;
==== Creating vm0001-dev&#039;s Storage ====&lt;br /&gt;
&lt;br /&gt;
With that, the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;lvcreate&amp;lt;/span&amp;gt; call is;&lt;br /&gt;
&lt;br /&gt;
On &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&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;
lvcreate -L 150G -n vm0001-1 /dev/an01-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;
==== Creating vm0001-dev&#039;s virt-install Call ====&lt;br /&gt;
&lt;br /&gt;
Now with the storage created, we can craft the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-install&amp;lt;/span&amp;gt; command. I like to put this into a file under the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/shared/provision/&amp;lt;/span&amp;gt; directory for future reference. Let&#039;s take a look at the command, then we&#039;ll discuss what the switches are for.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
touch /shared/provision/vm0001-dev.sh&lt;br /&gt;
chmod 755 /shared/provision/vm0001-dev.sh &lt;br /&gt;
vim /shared/provision/vm0001-dev.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;
virt-install --connect qemu:///system \&lt;br /&gt;
  --name vm0001-dev \&lt;br /&gt;
  --ram 1024 \&lt;br /&gt;
  --arch x86_64 \&lt;br /&gt;
  --vcpus 1 \&lt;br /&gt;
  --location http://10.255.255.254/c6/x86_64/img/ \&lt;br /&gt;
  --extra-args &amp;quot;ks=http://10.255.255.254/c6/x86_64/ks/c6_minimal.ks&amp;quot; \&lt;br /&gt;
  --os-type linux \&lt;br /&gt;
  --os-variant rhel6 \&lt;br /&gt;
  --disk path=/dev/an01-vg0/vm0001-1 \&lt;br /&gt;
  --network bridge=vbr2 \&lt;br /&gt;
  --vnc&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{note|1=Don&#039;t use tabs to indent the lines.}}&lt;br /&gt;
&lt;br /&gt;
Let&#039;s break it down;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--connect qemu:///system&amp;lt;/span&amp;gt;&lt;br /&gt;
This tells &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-install&amp;lt;/span&amp;gt; to use the [[QEMU]] hardware emulator (as opposed to [[Xen]]) and to install the VM on to local system.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--name vm0001-dev&amp;lt;/span&amp;gt;&lt;br /&gt;
This sets the name of the VM. It is the name we will use in the cluster configuration and whenever we use the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;libvirtd&amp;lt;/span&amp;gt; tools, like &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virsh&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--ram 1024&amp;lt;/span&amp;gt;&lt;br /&gt;
This sets the amount of RAM, in [[MiB]], to allocate to this VM. Here, we&#039;re allocating 1 [[GiB]] (1,024 MiB).&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--arch x86_64&amp;lt;/span&amp;gt;&lt;br /&gt;
This sets the emulated CPU&#039;s architecture to 64-[[bit]]. This can be used even when you plan to install a 32-bit [[OS]], but not the other way around, of course.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--vcpus 1&amp;lt;/span&amp;gt;&lt;br /&gt;
This sets the number of CPU cores to allocate to this VM. Here, we&#039;re setting just one.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--location &amp;lt;nowiki&amp;gt;http://10.255255.254/c6/x86_64/img/&amp;lt;/nowiki&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
This tells &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-install&amp;lt;/span&amp;gt; to pull the installation files from the [[URL]] specified.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--extra-args &amp;quot;ks=&amp;lt;nowiki&amp;gt;http://10.255.255.254/c6/x86_64/ks/c6_minimal.ks&amp;lt;/nowiki&amp;gt;&amp;quot;&amp;lt;/span&amp;gt;&lt;br /&gt;
This is an optional command used to pass the install kernel arguments. Here, I&#039;m using it to tell the kernel to grab the specified kickstart file for use during the installation.&lt;br /&gt;
&lt;br /&gt;
{{note|1=If you want to copy the kickstart script used in this tutorial, you can [[File c6_minimal.ks|find it here]].}}&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--os-type linux&amp;lt;/span&amp;gt;&lt;br /&gt;
This broadly sets hardware emulation for optimal use with Linux-based virtual machines.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--os-variant rhel6&amp;lt;/span&amp;gt;&lt;br /&gt;
This further refines tweaks to the hardware emulation to maximize performance for [[RHEL]]6 (and derivative) installs.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--disk path=/dev/an01-vg0/vm0001-1&amp;lt;/span&amp;gt;&lt;br /&gt;
This tells the installer to use the [[LV]] we created earlier as the backing storage device for the new virtual machine.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--network bridge=vbr2&amp;lt;/span&amp;gt;&lt;br /&gt;
This tells the installer to create a network card in the VM and to then connect it to the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vbr2&amp;lt;/span&amp;gt; bridge, thus connecting the VM to the [[IFN]]. Optionally, you could add &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;,model=e1000&amp;lt;/span&amp;gt; option to tells the emulator to mimic an [[Intel]] &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;e1000&amp;lt;/span&amp;gt; hardware NIC. The default is to use the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[virtio]]&amp;lt;/span&amp;gt; virtualized network card. If you have two or more bridges, you can repeat the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--network&amp;lt;/span&amp;gt; switch as many times as you need.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--vnc&amp;lt;/span&amp;gt;&lt;br /&gt;
This tells &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-manager&amp;lt;/span&amp;gt; to create a [[VNC]] server on the VM and, if possible, immediately connect it the just-provisioned VM. With a minimal install on the nodes, the automatically spawned client will fail. This is fine, just use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-manager&amp;lt;/span&amp;gt; from my workstation.&lt;br /&gt;
&lt;br /&gt;
{{note|1=If you close the initial VNC window and want to reconnect to the VM, you can simply open up &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-manager&amp;lt;/span&amp;gt;, connect to the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt; host if needed, and double-click on the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0001-dev&amp;lt;/span&amp;gt; entry. This will effectively &amp;quot;plug a monitor into the VM&amp;quot;.}}&lt;br /&gt;
&lt;br /&gt;
==== Initializing vm0001-dev&#039;s Install ====&lt;br /&gt;
&lt;br /&gt;
Well, time to start the install!&lt;br /&gt;
&lt;br /&gt;
On &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&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;
/shared/provision/vm0001-dev.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;
Starting install...&lt;br /&gt;
Retrieving file .treeinfo...                             |  676 B     00:00 ... &lt;br /&gt;
Retrieving file vmlinuz...                               | 7.5 MB     00:00 ... &lt;br /&gt;
Retrieving file initrd.img...                            |  59 MB     00:02 ... &lt;br /&gt;
Creating domain...                                       |    0 B     00:00     &lt;br /&gt;
WARNING  Unable to connect to graphical console: virt-viewer not installed. Please install the &#039;virt-viewer&#039; package.&lt;br /&gt;
Domain installation still in progress. You can reconnect to &lt;br /&gt;
the console to complete the installation process.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And it&#039;s off!&lt;br /&gt;
&lt;br /&gt;
[[Image:2n-RHEL6-KVM_vm0001_provision_01.png|thumb|700px|center|Initial provision of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0001-dev&amp;lt;/span&amp;gt;.]]&lt;br /&gt;
&lt;br /&gt;
Progressing nicely.&lt;br /&gt;
&lt;br /&gt;
[[Image:2n-RHEL6-KVM_vm0001_provision_02.png|thumb|700px|center|Installation of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0001-dev&amp;lt;/span&amp;gt; proceeding as expected.]]&lt;br /&gt;
&lt;br /&gt;
And done! Note that, depending on your kickstart file, it may have automatically rebooted or you may need to reboot manually.&lt;br /&gt;
&lt;br /&gt;
{{note|1=I&#039;ve found that there are occassions where the VM will power off instead of rebooting. With &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-manager&amp;lt;/span&amp;gt;, you can click to select the new VM and then press the &amp;quot;play&amp;quot; button to boot the VM manually.}}&lt;br /&gt;
&lt;br /&gt;
[[Image:2n-RHEL6-KVM_vm0001_provision_03.png|thumb|700px|center|Installation of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0001-dev&amp;lt;/span&amp;gt; complete.]]&lt;br /&gt;
&lt;br /&gt;
==== Defining vm0001-dev On an-node02 ====&lt;br /&gt;
&lt;br /&gt;
We can use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virsh&amp;lt;/span&amp;gt; to see that the new virtual machine exists and what state it is in. Note that I&#039;ve gotten into the habit of using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--all&amp;lt;/span&amp;gt; to get around &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virsh&amp;lt;/span&amp;gt;&#039;s default behaviour of hiding VMs that are off.&lt;br /&gt;
&lt;br /&gt;
On &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;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;
  2 vm0001-dev           running&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;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;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As we see, the new &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0001-dev&amp;lt;/span&amp;gt; is only known to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;. This is, in and of itself, just fine.&lt;br /&gt;
&lt;br /&gt;
We&#039;re going to need to put the virtual machine&#039;s [[XML]] definition file in a common place accessible on both nodes. This could be matching but separate directories on either node, or it can be a common shared location. As we&#039;ve got the cluster&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/shared&amp;lt;/span&amp;gt; GFS2 partition, we&#039;re going to use the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/shared/definitions&amp;lt;/span&amp;gt; directory we create earlier. This avoids the need to remember to keep two copies of the file in sync across both nodes.&lt;br /&gt;
&lt;br /&gt;
To backup the VM&#039;s configuration, we&#039;ll again use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virsh&amp;lt;/span&amp;gt;, but this time with the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;dumpxml&amp;lt;/span&amp;gt; command.&lt;br /&gt;
&lt;br /&gt;
On &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;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 dumpxml vm0001-dev &amp;gt; /shared/definitions/vm0001-dev.xml&lt;br /&gt;
cat /shared/definitions/vm0001-dev.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;kvm&#039; id=&#039;2&#039;&amp;gt;&lt;br /&gt;
  &amp;lt;name&amp;gt;vm0001-dev&amp;lt;/name&amp;gt;&lt;br /&gt;
  &amp;lt;uuid&amp;gt;2512b2dd-a1a8-f990-2a0d-6c41968ab3f8&amp;lt;/uuid&amp;gt;&lt;br /&gt;
  &amp;lt;memory&amp;gt;1048576&amp;lt;/memory&amp;gt;&lt;br /&gt;
  &amp;lt;currentMemory&amp;gt;1048576&amp;lt;/currentMemory&amp;gt;&lt;br /&gt;
  &amp;lt;vcpu&amp;gt;1&amp;lt;/vcpu&amp;gt;&lt;br /&gt;
  &amp;lt;os&amp;gt;&lt;br /&gt;
    &amp;lt;type arch=&#039;x86_64&#039; machine=&#039;rhel6.2.0&#039;&amp;gt;hvm&amp;lt;/type&amp;gt;&lt;br /&gt;
    &amp;lt;boot dev=&#039;network&#039;/&amp;gt;&lt;br /&gt;
    &amp;lt;boot dev=&#039;cdrom&#039;/&amp;gt;&lt;br /&gt;
    &amp;lt;boot dev=&#039;hd&#039;/&amp;gt;&lt;br /&gt;
    &amp;lt;bootmenu enable=&#039;yes&#039;/&amp;gt;&lt;br /&gt;
  &amp;lt;/os&amp;gt;&lt;br /&gt;
  &amp;lt;features&amp;gt;&lt;br /&gt;
    &amp;lt;acpi/&amp;gt;&lt;br /&gt;
    &amp;lt;apic/&amp;gt;&lt;br /&gt;
    &amp;lt;pae/&amp;gt;&lt;br /&gt;
  &amp;lt;/features&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;emulator&amp;gt;/usr/libexec/qemu-kvm&amp;lt;/emulator&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;qemu&#039; type=&#039;raw&#039; cache=&#039;none&#039; io=&#039;native&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;source dev=&#039;/dev/an01-vg0/vm0001-1&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;target dev=&#039;vda&#039; bus=&#039;virtio&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;alias name=&#039;virtio-disk0&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;address type=&#039;pci&#039; domain=&#039;0x0000&#039; bus=&#039;0x00&#039; slot=&#039;0x04&#039; function=&#039;0x0&#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;52:54:00:9b:3c:f7&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;source bridge=&#039;vbr2&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;target dev=&#039;vnet0&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;model type=&#039;virtio&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;alias name=&#039;net0&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;address type=&#039;pci&#039; domain=&#039;0x0000&#039; bus=&#039;0x00&#039; slot=&#039;0x03&#039; function=&#039;0x0&#039;/&amp;gt;&lt;br /&gt;
    &amp;lt;/interface&amp;gt;&lt;br /&gt;
    &amp;lt;serial type=&#039;pty&#039;&amp;gt;&lt;br /&gt;
      &amp;lt;source path=&#039;/dev/pts/2&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;target port=&#039;0&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;alias name=&#039;serial0&#039;/&amp;gt;&lt;br /&gt;
    &amp;lt;/serial&amp;gt;&lt;br /&gt;
    &amp;lt;console type=&#039;pty&#039; tty=&#039;/dev/pts/2&#039;&amp;gt;&lt;br /&gt;
      &amp;lt;source path=&#039;/dev/pts/2&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;target type=&#039;serial&#039; port=&#039;0&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;alias name=&#039;serial0&#039;/&amp;gt;&lt;br /&gt;
    &amp;lt;/console&amp;gt;&lt;br /&gt;
    &amp;lt;input type=&#039;tablet&#039; bus=&#039;usb&#039;&amp;gt;&lt;br /&gt;
      &amp;lt;alias name=&#039;input0&#039;/&amp;gt;&lt;br /&gt;
    &amp;lt;/input&amp;gt;&lt;br /&gt;
    &amp;lt;input type=&#039;mouse&#039; bus=&#039;ps2&#039;/&amp;gt;&lt;br /&gt;
    &amp;lt;graphics type=&#039;vnc&#039; port=&#039;5900&#039; autoport=&#039;yes&#039;/&amp;gt;&lt;br /&gt;
    &amp;lt;video&amp;gt;&lt;br /&gt;
      &amp;lt;model type=&#039;cirrus&#039; vram=&#039;9216&#039; heads=&#039;1&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;alias name=&#039;video0&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;address type=&#039;pci&#039; domain=&#039;0x0000&#039; bus=&#039;0x00&#039; slot=&#039;0x02&#039; function=&#039;0x0&#039;/&amp;gt;&lt;br /&gt;
    &amp;lt;/video&amp;gt;&lt;br /&gt;
    &amp;lt;memballoon model=&#039;virtio&#039;&amp;gt;&lt;br /&gt;
      &amp;lt;alias name=&#039;balloon0&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;address type=&#039;pci&#039; domain=&#039;0x0000&#039; bus=&#039;0x00&#039; slot=&#039;0x05&#039; function=&#039;0x0&#039;/&amp;gt;&lt;br /&gt;
    &amp;lt;/memballoon&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;
There we go; That is the emulated hardware on which your virtual machine exists. Pretty neat, eh?&lt;br /&gt;
&lt;br /&gt;
I like to keep all of my VMs defined on all of my nodes. This is entirely optional, as the cluster will define the VM on a target node when needed. It is, though, a good chance to examine how this is done manually.&lt;br /&gt;
&lt;br /&gt;
On &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;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 /shared/definitions/vm0001-dev.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-dev defined from /shared/definitions/vm0001-dev.xml&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can confirm that it now exists by re-running &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virsh list --all&amp;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;
  - vm0001-dev           shut off&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You should also now be able to see &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0001-dev&amp;lt;/span&amp;gt; under &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt; in your &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-manager&amp;lt;/span&amp;gt; window. It will be listed as &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;shutoff&amp;lt;/span&amp;gt;, which is expected. &#039;&#039;&#039;Do not&#039;&#039;&#039; try to turn it on while it&#039;s running on the other node!&lt;br /&gt;
&lt;br /&gt;
=== Provisioning vm0002-web ===&lt;br /&gt;
&lt;br /&gt;
This installation will be pretty much the same as it was for &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0001-dev&amp;lt;/span&amp;gt;, so we&#039;ll look mainly at the differences.&lt;br /&gt;
&lt;br /&gt;
==== Creating vm0002-web&#039;s Storage ====&lt;br /&gt;
&lt;br /&gt;
We&#039;ll use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;lvcreate&amp;lt;/span&amp;gt; again, but this time we won&#039;t specify a specific size, but instead a percentage of the remainin free space will be defined. Note that the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;-L&amp;lt;/span&amp;gt; switch changes to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;-l&amp;lt;/span&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
On &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&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;
lvcreate -l 100%FREE -n vm0002-1 /dev/an01-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;
==== Creating vm0002-web&#039;s virt-install Call ====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-install&amp;lt;/span&amp;gt; command will be quite similar to the previous one.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
touch /shared/provision/vm0002-web.sh&lt;br /&gt;
chmod 755 /shared/provision/vm0002-web.sh &lt;br /&gt;
vim /shared/provision/vm0002-web.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;
virt-install --connect qemu:///system \&lt;br /&gt;
  --name vm0002-web \&lt;br /&gt;
  --ram 2048 \&lt;br /&gt;
  --arch x86_64 \&lt;br /&gt;
  --vcpus 2 \&lt;br /&gt;
  --location http://10.255.255.254/c6/x86_64/img/ \&lt;br /&gt;
  --extra-args &amp;quot;ks=http://10.255.255.254/c6/x86_64/ks/c6_minimal.ks&amp;quot; \&lt;br /&gt;
  --os-type linux \&lt;br /&gt;
  --os-variant rhel6 \&lt;br /&gt;
  --disk path=/dev/an01-vg0/vm0002-1 \&lt;br /&gt;
  --network bridge=vbr2 \&lt;br /&gt;
  --vnc&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Lets look at the differences;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--name vm0002-web&amp;lt;/span&amp;gt;; This sets the new name of the VM.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--ram 2048&amp;lt;/span&amp;gt;; This doubles the amount of RAM to 2048 [[MiB]].&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--vcpus 2&amp;lt;/span&amp;gt;; This sets the number of CPU cores to two.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--disk path=/dev/an01-vg0/vm0002-1&amp;lt;/span&amp;gt;; The path to the new LV is set.&lt;br /&gt;
&lt;br /&gt;
Note that the same kickstart file from before is used. This is fine as it doesn&#039;t specify a specific IP address and it is smart enough to adapt to the new virtual disk size.&lt;br /&gt;
&lt;br /&gt;
==== Initializing vm0002-web&#039;s Install ====&lt;br /&gt;
&lt;br /&gt;
Well, time to start the install!&lt;br /&gt;
&lt;br /&gt;
On &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&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;
/shared/provision/vm0002-web.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;
Starting install...&lt;br /&gt;
Retrieving file .treeinfo...                             |  676 B     00:00 ... &lt;br /&gt;
Retrieving file vmlinuz...                               | 7.5 MB     00:00 ... &lt;br /&gt;
Retrieving file initrd.img...                            |  59 MB     00:02 ... &lt;br /&gt;
Creating domain...                                       |    0 B     00:00     &lt;br /&gt;
WARNING  Unable to connect to graphical console: virt-viewer not installed. Please install the &#039;virt-viewer&#039; package.&lt;br /&gt;
Domain installation still in progress. You can reconnect to &lt;br /&gt;
the console to complete the installation process.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The install should proceed more or less the same as it did for &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0001-dev&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==== Defining vm0002-web On an-node02 ====&lt;br /&gt;
&lt;br /&gt;
We can use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virsh&amp;lt;/span&amp;gt; to see that the new virtual machine exists and what state it is in. Note that I&#039;ve gotten into the habit of using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--all&amp;lt;/span&amp;gt; to get around &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virsh&amp;lt;/span&amp;gt;&#039;s default behaviour of hiding VMs that are off.&lt;br /&gt;
&lt;br /&gt;
On &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;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;
  2 vm0001-dev           running&lt;br /&gt;
  4 vm0002-web           running&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;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;
  - vm0001-dev           shut off&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As before, the new &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0002-web&amp;lt;/span&amp;gt; is only known to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
On &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;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 dumpxml vm0002-web &amp;gt; /shared/definitions/vm0002-web.xml&lt;br /&gt;
cat /shared/definitions/vm0002-web.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;kvm&#039; id=&#039;4&#039;&amp;gt;&lt;br /&gt;
  &amp;lt;name&amp;gt;vm0002-web&amp;lt;/name&amp;gt;&lt;br /&gt;
  &amp;lt;uuid&amp;gt;02f967ab-103f-c276-c40f-9eaa47339df4&amp;lt;/uuid&amp;gt;&lt;br /&gt;
  &amp;lt;memory&amp;gt;2097152&amp;lt;/memory&amp;gt;&lt;br /&gt;
  &amp;lt;currentMemory&amp;gt;2097152&amp;lt;/currentMemory&amp;gt;&lt;br /&gt;
  &amp;lt;vcpu&amp;gt;2&amp;lt;/vcpu&amp;gt;&lt;br /&gt;
  &amp;lt;os&amp;gt;&lt;br /&gt;
    &amp;lt;type arch=&#039;x86_64&#039; machine=&#039;rhel6.2.0&#039;&amp;gt;hvm&amp;lt;/type&amp;gt;&lt;br /&gt;
    &amp;lt;boot dev=&#039;hd&#039;/&amp;gt;&lt;br /&gt;
  &amp;lt;/os&amp;gt;&lt;br /&gt;
  &amp;lt;features&amp;gt;&lt;br /&gt;
    &amp;lt;acpi/&amp;gt;&lt;br /&gt;
    &amp;lt;apic/&amp;gt;&lt;br /&gt;
    &amp;lt;pae/&amp;gt;&lt;br /&gt;
  &amp;lt;/features&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;emulator&amp;gt;/usr/libexec/qemu-kvm&amp;lt;/emulator&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;qemu&#039; type=&#039;raw&#039; cache=&#039;none&#039; io=&#039;native&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;source dev=&#039;/dev/an01-vg0/vm0002-1&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;target dev=&#039;vda&#039; bus=&#039;virtio&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;alias name=&#039;virtio-disk0&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;address type=&#039;pci&#039; domain=&#039;0x0000&#039; bus=&#039;0x00&#039; slot=&#039;0x04&#039; function=&#039;0x0&#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;52:54:00:65:39:60&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;source bridge=&#039;vbr2&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;target dev=&#039;vnet1&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;model type=&#039;virtio&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;alias name=&#039;net0&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;address type=&#039;pci&#039; domain=&#039;0x0000&#039; bus=&#039;0x00&#039; slot=&#039;0x03&#039; function=&#039;0x0&#039;/&amp;gt;&lt;br /&gt;
    &amp;lt;/interface&amp;gt;&lt;br /&gt;
    &amp;lt;serial type=&#039;pty&#039;&amp;gt;&lt;br /&gt;
      &amp;lt;source path=&#039;/dev/pts/3&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;target port=&#039;0&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;alias name=&#039;serial0&#039;/&amp;gt;&lt;br /&gt;
    &amp;lt;/serial&amp;gt;&lt;br /&gt;
    &amp;lt;console type=&#039;pty&#039; tty=&#039;/dev/pts/3&#039;&amp;gt;&lt;br /&gt;
      &amp;lt;source path=&#039;/dev/pts/3&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;target type=&#039;serial&#039; port=&#039;0&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;alias name=&#039;serial0&#039;/&amp;gt;&lt;br /&gt;
    &amp;lt;/console&amp;gt;&lt;br /&gt;
    &amp;lt;input type=&#039;tablet&#039; bus=&#039;usb&#039;&amp;gt;&lt;br /&gt;
      &amp;lt;alias name=&#039;input0&#039;/&amp;gt;&lt;br /&gt;
    &amp;lt;/input&amp;gt;&lt;br /&gt;
    &amp;lt;input type=&#039;mouse&#039; bus=&#039;ps2&#039;/&amp;gt;&lt;br /&gt;
    &amp;lt;graphics type=&#039;vnc&#039; port=&#039;5901&#039; autoport=&#039;yes&#039;/&amp;gt;&lt;br /&gt;
    &amp;lt;video&amp;gt;&lt;br /&gt;
      &amp;lt;model type=&#039;cirrus&#039; vram=&#039;9216&#039; heads=&#039;1&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;alias name=&#039;video0&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;address type=&#039;pci&#039; domain=&#039;0x0000&#039; bus=&#039;0x00&#039; slot=&#039;0x02&#039; function=&#039;0x0&#039;/&amp;gt;&lt;br /&gt;
    &amp;lt;/video&amp;gt;&lt;br /&gt;
    &amp;lt;memballoon model=&#039;virtio&#039;&amp;gt;&lt;br /&gt;
      &amp;lt;alias name=&#039;balloon0&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;address type=&#039;pci&#039; domain=&#039;0x0000&#039; bus=&#039;0x00&#039; slot=&#039;0x05&#039; function=&#039;0x0&#039;/&amp;gt;&lt;br /&gt;
    &amp;lt;/memballoon&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;
There we go; That is the emulated hardware on which your virtual machine exists. Pretty neat, eh?&lt;br /&gt;
&lt;br /&gt;
I like to keep all of my VMs defined on all of my nodes. This is entirely optional, as the cluster will define the VM on a target node when needed. It is, though, a good chance to examine how this is done manually.&lt;br /&gt;
&lt;br /&gt;
On &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;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 /shared/definitions/vm0002-web.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-web defined from /shared/definitions/vm0002-web.xml&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can confirm that it now exists by re-running &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virsh list --all&amp;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;
  - vm0001-dev           shut off&lt;br /&gt;
  - vm0002-web           shut off&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Provisioning vm0003-db ===&lt;br /&gt;
&lt;br /&gt;
This installation will, again, be pretty much the same as it was for &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0001-dev&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0002-web&amp;lt;/span&amp;gt;, so we&#039;ll again look mainly at the differences.&lt;br /&gt;
&lt;br /&gt;
==== Creating vm0003-db&#039;s Storage ====&lt;br /&gt;
&lt;br /&gt;
We&#039;ll use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;lvcreate&amp;lt;/span&amp;gt; again, but being the first [[LV]] on the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an02-vg0&amp;lt;/span&amp;gt;, we&#039;ll specify the specific size again.&lt;br /&gt;
&lt;br /&gt;
On &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&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;
lvcreate -L 100G -n vm0003-1 /dev/an02-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;vm0003-1&amp;quot; created&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Creating vm0003-db&#039;s virt-install Call ====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-install&amp;lt;/span&amp;gt; command will be quite similar to the previous one.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
touch /shared/provision/vm0003-db.sh&lt;br /&gt;
chmod 755 /shared/provision/vm0003-db.sh &lt;br /&gt;
vim /shared/provision/vm0003-db.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;
virt-install --connect qemu:///system \&lt;br /&gt;
  --name vm0003-db \&lt;br /&gt;
  --ram 2048 \&lt;br /&gt;
  --arch x86_64 \&lt;br /&gt;
  --vcpus 2 \&lt;br /&gt;
  --location http://10.255.255.254/c6/x86_64/img/ \&lt;br /&gt;
  --extra-args &amp;quot;ks=http://10.255.255.254/c6/x86_64/ks/c6_minimal.ks&amp;quot; \&lt;br /&gt;
  --os-type linux \&lt;br /&gt;
  --os-variant rhel6 \&lt;br /&gt;
  --disk path=/dev/an02-vg0/vm0003-1 \&lt;br /&gt;
  --network bridge=vbr2 \&lt;br /&gt;
  --vnc&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Lets look at the differences;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--name vm0003-db&amp;lt;/span&amp;gt;; This sets the new name of the VM.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--disk path=/dev/an02-vg0/vm0003-1&amp;lt;/span&amp;gt;; The path to the new LV is set. Note that the [[VG]] has changed as this VM will run in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt; normally.&lt;br /&gt;
&lt;br /&gt;
==== Initializing vm0003-db&#039;s Install ====&lt;br /&gt;
&lt;br /&gt;
This time we&#039;re going to provision the new VM on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt;, as that is where it will live normally.&lt;br /&gt;
&lt;br /&gt;
On &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&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;
/shared/provision/vm0003-db.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;
Starting install...&lt;br /&gt;
Retrieving file .treeinfo...                             |  676 B     00:00 ... &lt;br /&gt;
Retrieving file vmlinuz...                               | 7.5 MB     00:00 ... &lt;br /&gt;
Retrieving file initrd.img...                            |  59 MB     00:02 ... &lt;br /&gt;
Creating domain...                                       |    0 B     00:00     &lt;br /&gt;
WARNING  Unable to connect to graphical console: virt-viewer not installed. Please install the &#039;virt-viewer&#039; package.&lt;br /&gt;
Domain installation still in progress. You can reconnect to &lt;br /&gt;
the console to complete the installation process.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The install should proceed more or less the same as it did for &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0001-dev&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0002-web&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==== Defining vm0003-db On an-node01 ====&lt;br /&gt;
&lt;br /&gt;
We can use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virsh&amp;lt;/span&amp;gt; to see that the new virtual machine exists and what state it is in. Note that I&#039;ve gotten into the habit of using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--all&amp;lt;/span&amp;gt; to get around &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virsh&amp;lt;/span&amp;gt;&#039;s default behaviour of hiding VMs that are off.&lt;br /&gt;
&lt;br /&gt;
On &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;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;
  2 vm0003-db            running&lt;br /&gt;
  - vm0001-dev           shut off&lt;br /&gt;
  - vm0002-web           shut off&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;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;
  2 vm0001-dev           running&lt;br /&gt;
  4 vm0002-web           running&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To backup the VM&#039;s configuration, we&#039;ll again use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virsh&amp;lt;/span&amp;gt;, but this time with the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;dumpxml&amp;lt;/span&amp;gt; command.&lt;br /&gt;
&lt;br /&gt;
On &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;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 dumpxml vm0003-db &amp;gt; /shared/definitions/vm0003-db.xml&lt;br /&gt;
cat /shared/definitions/vm0003-db.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;kvm&#039; id=&#039;2&#039;&amp;gt;&lt;br /&gt;
  &amp;lt;name&amp;gt;vm0003-db&amp;lt;/name&amp;gt;&lt;br /&gt;
  &amp;lt;uuid&amp;gt;a7018001-b433-b739-bbd9-d4d3285f0a72&amp;lt;/uuid&amp;gt;&lt;br /&gt;
  &amp;lt;memory&amp;gt;2097152&amp;lt;/memory&amp;gt;&lt;br /&gt;
  &amp;lt;currentMemory&amp;gt;2097152&amp;lt;/currentMemory&amp;gt;&lt;br /&gt;
  &amp;lt;vcpu&amp;gt;2&amp;lt;/vcpu&amp;gt;&lt;br /&gt;
  &amp;lt;os&amp;gt;&lt;br /&gt;
    &amp;lt;type arch=&#039;x86_64&#039; machine=&#039;rhel6.2.0&#039;&amp;gt;hvm&amp;lt;/type&amp;gt;&lt;br /&gt;
    &amp;lt;boot dev=&#039;hd&#039;/&amp;gt;&lt;br /&gt;
  &amp;lt;/os&amp;gt;&lt;br /&gt;
  &amp;lt;features&amp;gt;&lt;br /&gt;
    &amp;lt;acpi/&amp;gt;&lt;br /&gt;
    &amp;lt;apic/&amp;gt;&lt;br /&gt;
    &amp;lt;pae/&amp;gt;&lt;br /&gt;
  &amp;lt;/features&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;emulator&amp;gt;/usr/libexec/qemu-kvm&amp;lt;/emulator&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;qemu&#039; type=&#039;raw&#039; cache=&#039;none&#039; io=&#039;native&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;source dev=&#039;/dev/an02-vg0/vm0003-1&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;target dev=&#039;vda&#039; bus=&#039;virtio&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;alias name=&#039;virtio-disk0&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;address type=&#039;pci&#039; domain=&#039;0x0000&#039; bus=&#039;0x00&#039; slot=&#039;0x04&#039; function=&#039;0x0&#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;52:54:00:44:83:ec&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;source bridge=&#039;vbr2&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;target dev=&#039;vnet0&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;model type=&#039;virtio&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;alias name=&#039;net0&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;address type=&#039;pci&#039; domain=&#039;0x0000&#039; bus=&#039;0x00&#039; slot=&#039;0x03&#039; function=&#039;0x0&#039;/&amp;gt;&lt;br /&gt;
    &amp;lt;/interface&amp;gt;&lt;br /&gt;
    &amp;lt;serial type=&#039;pty&#039;&amp;gt;&lt;br /&gt;
      &amp;lt;source path=&#039;/dev/pts/2&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;target port=&#039;0&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;alias name=&#039;serial0&#039;/&amp;gt;&lt;br /&gt;
    &amp;lt;/serial&amp;gt;&lt;br /&gt;
    &amp;lt;console type=&#039;pty&#039; tty=&#039;/dev/pts/2&#039;&amp;gt;&lt;br /&gt;
      &amp;lt;source path=&#039;/dev/pts/2&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;target type=&#039;serial&#039; port=&#039;0&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;alias name=&#039;serial0&#039;/&amp;gt;&lt;br /&gt;
    &amp;lt;/console&amp;gt;&lt;br /&gt;
    &amp;lt;input type=&#039;tablet&#039; bus=&#039;usb&#039;&amp;gt;&lt;br /&gt;
      &amp;lt;alias name=&#039;input0&#039;/&amp;gt;&lt;br /&gt;
    &amp;lt;/input&amp;gt;&lt;br /&gt;
    &amp;lt;input type=&#039;mouse&#039; bus=&#039;ps2&#039;/&amp;gt;&lt;br /&gt;
    &amp;lt;graphics type=&#039;vnc&#039; port=&#039;5900&#039; autoport=&#039;yes&#039;/&amp;gt;&lt;br /&gt;
    &amp;lt;video&amp;gt;&lt;br /&gt;
      &amp;lt;model type=&#039;cirrus&#039; vram=&#039;9216&#039; heads=&#039;1&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;alias name=&#039;video0&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;address type=&#039;pci&#039; domain=&#039;0x0000&#039; bus=&#039;0x00&#039; slot=&#039;0x02&#039; function=&#039;0x0&#039;/&amp;gt;&lt;br /&gt;
    &amp;lt;/video&amp;gt;&lt;br /&gt;
    &amp;lt;memballoon model=&#039;virtio&#039;&amp;gt;&lt;br /&gt;
      &amp;lt;alias name=&#039;balloon0&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;address type=&#039;pci&#039; domain=&#039;0x0000&#039; bus=&#039;0x00&#039; slot=&#039;0x05&#039; function=&#039;0x0&#039;/&amp;gt;&lt;br /&gt;
    &amp;lt;/memballoon&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;
On &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;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 /shared/definitions/vm0003-db.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 vm0003-db defined from /shared/definitions/vm0003-db.xml&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can confirm that it now exists by re-running &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virsh list --all&amp;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;
  2 vm0001-dev           running&lt;br /&gt;
  4 vm0002-web           running&lt;br /&gt;
  - vm0003-db            shut off&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Provisioning vm0004-ms ===&lt;br /&gt;
&lt;br /&gt;
Now for something a little different!&lt;br /&gt;
&lt;br /&gt;
This will be the [http://www.microsoft.com/en-us/server-cloud/windows-server/2008-r2-standard.aspx Windows 2008 R2] virtual machine. The biggest difference this time will be that we&#039;re going to install from the [[ISO]] file rather than from a web-accessible store.&lt;br /&gt;
&lt;br /&gt;
Another difference is that we&#039;re going to specify what kind of storage bus to use with this VM. We&#039;ll be using a special, virtualized bus called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virtio&amp;lt;/span&amp;gt; which requires that the drivers be available to the OS at install time. These drivers will, in turn, be made available to the installer as a virtual floppy disk. It will make for quite the interesting &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-install&amp;lt;/span&amp;gt; call, as we&#039;ll see.&lt;br /&gt;
&lt;br /&gt;
==== Preparing vm0004-ms&#039;s Storage ====&lt;br /&gt;
&lt;br /&gt;
As before, we need to create the backing storage [[LV]] before we can provision the machine. As we planned, this will be a 100 [[GiB]] partition and will be on the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an02-vg0&amp;lt;/span&amp;gt; [[VG]]. Seeing as this LV will use up the rest of the free space in the VG, we&#039;ll again use the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;lvcreate -l 100%FREE&amp;lt;/span&amp;gt; instead of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;-L 100G&amp;lt;/span&amp;gt; as sometimes the numbers don&#039;t work out to be exactly the size we intend.&lt;br /&gt;
&lt;br /&gt;
On &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&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;
lvcreate -l 100%FREE -n vm0004-1 /dev/an02-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;vm0004-1&amp;quot; created&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Before we proceed, we now need to put a copy of the install media, the OS&#039;s [[ISO]] and the virtual floppy disk, somewhere that the installer can access. I like to put files like this into the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/shared/files/&amp;lt;/span&amp;gt; directory we created earlier. How you put them there will be an exercise for the reader.&lt;br /&gt;
&lt;br /&gt;
If you do not have a copy of Microsoft&#039;s server operating system, you can download a 30-day free trial here;&lt;br /&gt;
* [http://technet.microsoft.com/en-us/evalcenter/dd459137 MS Windows Server 2008 R2 with SP1]&lt;br /&gt;
&lt;br /&gt;
The driver for the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virtio&amp;lt;/span&amp;gt; bus can be found from Red Hat here. Note that there is an [[ISO]] and a &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vfd&amp;lt;/span&amp;gt; (virtual floppy disk) file. You can use the ISO and mount it as a second CD-ROM if you wish. This tutorial will use the virtual floppy disk to show how floppy images can be used in VMs:&lt;br /&gt;
* [http://alt.fedoraproject.org/pub/alt/virtio-win/latest/images/bin/ virtio Drivers for Windows]&lt;br /&gt;
&lt;br /&gt;
{{note|1=The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vfd&amp;lt;/span&amp;gt; no longer seems to exist upstream and I&#039;ve not found a way to get windows to use the latest (&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virtio-win-0.1-22.iso&amp;lt;/span&amp;gt; image. As such, I&#039;ve uploaded of the virtual floppy disk image from version 1.1.16. If you have any insight into the proper use of the latest virtio image, please [mailto:digimer@alteeve.ca let me know].}}&lt;br /&gt;
* Local copy of [https://alteeve.com/files/virtio-win-1.1.16.vfd virtio-win-1.1.16.vfd].&lt;br /&gt;
&lt;br /&gt;
==== Creating vm0004-ms&#039;s virt-install Call ====&lt;br /&gt;
&lt;br /&gt;
Lets look at the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-install&amp;lt;/span&amp;gt; command, then we&#039;ll discuss the main differences from the previous call for the firewall. As before, we&#039;ll put this command into a small shell script for later reference.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
touch /shared/provision/vm0004-ms.sh&lt;br /&gt;
chmod 755 /shared/provision/vm0004-ms.sh &lt;br /&gt;
vim /shared/provision/vm0004-ms.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;
virt-install --connect qemu:///system \&lt;br /&gt;
  --name vm0004-ms \&lt;br /&gt;
  --ram 2048 \&lt;br /&gt;
  --arch x86_64 \&lt;br /&gt;
  --vcpus 2 \&lt;br /&gt;
  --cdrom /shared/files/Windows_Server_2008_R2_64Bit_SP1.iso \&lt;br /&gt;
  --disk path=/dev/an02-vg0/vm0004-1,device=disk,bus=virtio \&lt;br /&gt;
  --disk path=/shared/files/virtio-win-1.1.16.vfd,device=floppy \&lt;br /&gt;
  --os-type windows \&lt;br /&gt;
  --os-variant win2k8 \&lt;br /&gt;
  --network bridge=vbr2 \&lt;br /&gt;
  --vnc&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Let&#039;s look at the main differences;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--cdrom /shared/files/Windows_Server_2008_R2_64Bit_SP1.iso&amp;lt;/span&amp;gt;&lt;br /&gt;
Here we&#039;ve swapped out the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--location&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--extra-args&amp;lt;/span&amp;gt; arguments for the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--cdrom&amp;lt;/span&amp;gt; switch. This will create an emulated DVD-ROM drive and boot from it. The path and file is an [[ISO]] image of the installation media we want to use.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--disk path=/dev/an02-vg0/vm0004-1,device=disk,bus=virtio&amp;lt;/span&amp;gt;&lt;br /&gt;
This is the same line we used before, pointing to the new [[LV]] of course, but we&#039;ve added options to it. Specifically, we&#039;ve told the hardware emulator, [[QEMU]], to not create the standard (&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ide&amp;lt;/span&amp;gt; or &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;scsi&amp;lt;/span&amp;gt;) bus. This is a special bus that improves storage [[I/O]] on windows (and other) guests. Windows does not support this bus natively, which brings us to the next option.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--disk path=/shared/files/virtio-win-1.1.16.vfd,device=floppy&amp;lt;/span&amp;gt;&lt;br /&gt;
This mounts the emulated floppy disk with the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virtio&amp;lt;/span&amp;gt; drivers that we&#039;ll need to allow windows to see the hard drive during the install.&lt;br /&gt;
&lt;br /&gt;
The rest is more or less the same as before.&lt;br /&gt;
&lt;br /&gt;
==== Initializing vm0004-ms&#039;s Install ====&lt;br /&gt;
&lt;br /&gt;
As before, we&#039;ll run the script with the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-install&amp;lt;/span&amp;gt; command in it.&lt;br /&gt;
&lt;br /&gt;
On &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&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;
/shared/provision/vm0004-ms.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;
Starting install...&lt;br /&gt;
Creating domain...                                       |    0 B     00:00     &lt;br /&gt;
WARNING  Unable to connect to graphical console: virt-viewer not installed. Please install the &#039;virt-viewer&#039; package.&lt;br /&gt;
Domain installation still in progress. Waiting for installation to complete.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This install isn&#039;t automated like the previous installs were, so we&#039;ll need to hand-hold the VM through the install.&lt;br /&gt;
&lt;br /&gt;
[[Image:2n-RHEL6-KVM_vm0004_provision_01.png|thumb|700px|center|Initial provision of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0004-ms&amp;lt;/span&amp;gt;.]]&lt;br /&gt;
&lt;br /&gt;
After you get click to select the &#039;&#039;Custom (advanced)&#039;&#039; installation method, you will &lt;br /&gt;
&lt;br /&gt;
[[Image:2n-RHEL6-KVM_vm0004_provision_02.png|thumb|700px|center|The Windows 2008 VM &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0004-ms&amp;lt;/span&amp;gt; doesn&#039;t see a hard drive.]]&lt;br /&gt;
&lt;br /&gt;
Click on the &#039;&#039;Load Driver&#039;&#039; option on the bottom left. You will be presented with a window telling you your options for loading the drivers.&lt;br /&gt;
&lt;br /&gt;
[[Image:2n-RHEL6-KVM_vm0004_provision_03.png|thumb|700px|center|The Windows 2008 VM &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0004-ms&amp;lt;/span&amp;gt; driver prompt.]]&lt;br /&gt;
&lt;br /&gt;
Click on the &#039;&#039;OK&#039;&#039; button and the installer will automatically find the virtual floppy disk and present you with the available drivers. Click to highlight &#039;&#039;Red Hat VirtIO SCSI Controller (A:\amd64\Win2008\viostor.inf)&#039;&#039; and click the &#039;&#039;Next&#039;&#039; button.&lt;br /&gt;
&lt;br /&gt;
[[Image:2n-RHEL6-KVM_vm0004_provision_04.png|thumb|700px|center|Selecting the Win2008 &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virtio&amp;lt;/span&amp;gt; driver.]]&lt;br /&gt;
&lt;br /&gt;
At this point, the windows installer will see the virtual hard drive and you can proceed with the install as you would normally install Windows 2008 R2 server.&lt;br /&gt;
&lt;br /&gt;
[[Image:2n-RHEL6-KVM_vm0004_provision_05.png|thumb|700px|center|The Win2008 installer now is about to use the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virtio&amp;lt;/span&amp;gt;-backed storage.]]&lt;br /&gt;
&lt;br /&gt;
Once the install is complete, reboot.&lt;br /&gt;
&lt;br /&gt;
[[Image:2n-RHEL6-KVM_vm0004_provision_06.png|thumb|700px|center|Installation of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0004-ms&amp;lt;/span&amp;gt; complete.]]&lt;br /&gt;
&lt;br /&gt;
==== Post-Install Housekeeping ====&lt;br /&gt;
&lt;br /&gt;
We have to be careful to &amp;quot;eject&amp;quot; the virtual floppy and DVD disks from the VM. If you neglect to do so, then later delete the files, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virsh&amp;lt;/span&amp;gt; will fail to boot the VMs and &#039;&#039;&#039;undefine them entirely&#039;&#039;&#039;. (Yes, that is dumb, in this author&#039;s opinion). [[#My VM Just Vanished!|How to recover]] from this issue can be found below.&lt;br /&gt;
&lt;br /&gt;
{{note|1=At the time of writing this, the author could not find any manner to eject media from the command line, shy of modifying the raw [[XML]] definition file and then redefining the VM and rebooting the guest. This is part of a known bug found in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[libvirt]]&amp;lt;/span&amp;gt; prior to version 0.9.7 and [[EL6]] ships with version 0.8.7. For this reason, we will use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-manager&amp;lt;/span&amp;gt; here.}}&lt;br /&gt;
&lt;br /&gt;
To &amp;quot;eject&amp;quot; the DVD-ROM and floppy drive, we will use the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-manager&amp;lt;/span&amp;gt; graphical program. You will need to either run &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-manager&amp;lt;/span&amp;gt; on one of the nodes, or use a version of it from your workstation by connecting to the host node over [[SSH]]. This later method is what I like to do.&lt;br /&gt;
&lt;br /&gt;
Using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-manager&amp;lt;/span&amp;gt;, connect to the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0004-ms&amp;lt;/span&amp;gt; VM.&lt;br /&gt;
&lt;br /&gt;
[[Image:2n-RHEL6-KVM_vm0004_eject-media_01.png|thumb|700px|center|Connecting to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0004-ms&amp;lt;/span&amp;gt; using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-manager&amp;lt;/span&amp;gt; from a remote workstation.]]&lt;br /&gt;
&lt;br /&gt;
Click on &#039;&#039;View&#039;&#039; then &#039;&#039;Details&#039;&#039; and you will see the virtual machine&#039;s emulated hardware.&lt;br /&gt;
&lt;br /&gt;
[[Image:2n-RHEL6-KVM_vm0004_eject-media_02.png|thumb|700px|center|Looking at &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0004-ms&amp;lt;/span&amp;gt;&#039;s emulated hardware configuration.]]&lt;br /&gt;
&lt;br /&gt;
First, let&#039;s eject the virtual floppy disk. In the left panel, click to select the &#039;&#039;Floppy 1&#039;&#039; device.&lt;br /&gt;
&lt;br /&gt;
[[Image:2n-RHEL6-KVM_vm0004_eject-media_03.png|thumb|700px|center|Viewing the &#039;&#039;Floppy 1&#039;&#039; device on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0004-ms&amp;lt;/span&amp;gt;.]]&lt;br /&gt;
&lt;br /&gt;
Click on the &#039;&#039;Disconnect&#039;&#039; button and the disk will be unmounted.&lt;br /&gt;
&lt;br /&gt;
[[Image:2n-RHEL6-KVM_vm0004_eject-media_04.png|thumb|700px|center|Viewing the &#039;&#039;Floppy 1&#039;&#039; device after ejecting the virtual floppy disk on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0004-ms&amp;lt;/span&amp;gt;.]]&lt;br /&gt;
&lt;br /&gt;
Now to eject the emulated DVD-ROM, again on the left panel, click to select the &#039;&#039;IDE CDROM 1&#039;&#039; device.&lt;br /&gt;
&lt;br /&gt;
[[Image:2n-RHEL6-KVM_vm0004_eject-media_05.png|thumb|700px|center|Viewing the &#039;&#039;IDE CDROM 1&#039;&#039; device on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0004-ms&amp;lt;/span&amp;gt;.]]&lt;br /&gt;
&lt;br /&gt;
Click on &#039;&#039;Disconnect&#039;&#039; again to unmount the ISO image.&lt;br /&gt;
&lt;br /&gt;
[[Image:2n-RHEL6-KVM_vm0004_eject-media_06.png|thumb|700px|center|Viewing the &#039;&#039;IDE CDROM 1&#039;&#039; device after ejecting the virtual floppy disk on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0004-ms&amp;lt;/span&amp;gt;.]]&lt;br /&gt;
&lt;br /&gt;
Now both the floppy disk and DVD image have been unmounted from the VM. We can return to the console view (&#039;&#039;View&#039;&#039; -&amp;gt; &#039;&#039;Console&#039;&#039;) and we will see that both the floppy disk and DVD drive no longer show any media as mounted within them.&lt;br /&gt;
&lt;br /&gt;
[[Image:2n-RHEL6-KVM_vm0004_eject-media_07.png|thumb|700px|center|Viewing &#039;&#039;File Manager&#039;&#039; on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0004-ms&amp;lt;/span&amp;gt; with the virtual floppy disk and DVD ISO image now unmounted.]]&lt;br /&gt;
&lt;br /&gt;
Done!&lt;br /&gt;
&lt;br /&gt;
==== Defining vm0004-ms On an-node02 ====&lt;br /&gt;
&lt;br /&gt;
Now with the installation media unmounted, and as we did before, we will use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virsh dumpxml&amp;lt;/span&amp;gt; to write out the [[XML]] definition file for the new VM and then &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virsh define&amp;lt;/span&amp;gt; it on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
On &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;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;
  2 vm0003-db            running&lt;br /&gt;
  4 vm0004-ms            running&lt;br /&gt;
  - vm0001-dev           shut off&lt;br /&gt;
  - vm0002-web           shut off&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;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;
  2 vm0001-dev           running&lt;br /&gt;
  4 vm0002-web           running&lt;br /&gt;
  - vm0003-db            shut off&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As before, our new VM is only defined on the node we installed it on. We&#039;ll fix this now.&lt;br /&gt;
&lt;br /&gt;
On &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;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 dumpxml vm0004-ms &amp;gt; /shared/definitions/vm0004-ms.xml&lt;br /&gt;
cat /shared/definitions/vm0004-ms.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;kvm&#039; id=&#039;4&#039;&amp;gt;&lt;br /&gt;
  &amp;lt;name&amp;gt;vm0004-ms&amp;lt;/name&amp;gt;&lt;br /&gt;
  &amp;lt;uuid&amp;gt;4c537551-96f4-3b5e-209a-0e41cab41d44&amp;lt;/uuid&amp;gt;&lt;br /&gt;
  &amp;lt;memory&amp;gt;2097152&amp;lt;/memory&amp;gt;&lt;br /&gt;
  &amp;lt;currentMemory&amp;gt;2097152&amp;lt;/currentMemory&amp;gt;&lt;br /&gt;
  &amp;lt;vcpu&amp;gt;2&amp;lt;/vcpu&amp;gt;&lt;br /&gt;
  &amp;lt;os&amp;gt;&lt;br /&gt;
    &amp;lt;type arch=&#039;x86_64&#039; machine=&#039;rhel6.2.0&#039;&amp;gt;hvm&amp;lt;/type&amp;gt;&lt;br /&gt;
    &amp;lt;boot dev=&#039;hd&#039;/&amp;gt;&lt;br /&gt;
  &amp;lt;/os&amp;gt;&lt;br /&gt;
  &amp;lt;features&amp;gt;&lt;br /&gt;
    &amp;lt;acpi/&amp;gt;&lt;br /&gt;
    &amp;lt;apic/&amp;gt;&lt;br /&gt;
    &amp;lt;pae/&amp;gt;&lt;br /&gt;
  &amp;lt;/features&amp;gt;&lt;br /&gt;
  &amp;lt;clock offset=&#039;localtime&#039;&amp;gt;&lt;br /&gt;
    &amp;lt;timer name=&#039;rtc&#039; tickpolicy=&#039;catchup&#039;/&amp;gt;&lt;br /&gt;
  &amp;lt;/clock&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;emulator&amp;gt;/usr/libexec/qemu-kvm&amp;lt;/emulator&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;qemu&#039; type=&#039;raw&#039; cache=&#039;none&#039; io=&#039;native&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;source dev=&#039;/dev/an02-vg0/vm0004-1&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;target dev=&#039;vda&#039; bus=&#039;virtio&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;alias name=&#039;virtio-disk0&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;address type=&#039;pci&#039; domain=&#039;0x0000&#039; bus=&#039;0x00&#039; slot=&#039;0x04&#039; function=&#039;0x0&#039;/&amp;gt;&lt;br /&gt;
    &amp;lt;/disk&amp;gt;&lt;br /&gt;
    &amp;lt;disk type=&#039;file&#039; device=&#039;floppy&#039;&amp;gt;&lt;br /&gt;
      &amp;lt;driver name=&#039;qemu&#039; type=&#039;raw&#039; cache=&#039;none&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;target dev=&#039;fda&#039; bus=&#039;fdc&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;alias name=&#039;fdc0-0-0&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;address type=&#039;drive&#039; controller=&#039;0&#039; bus=&#039;0&#039; unit=&#039;0&#039;/&amp;gt;&lt;br /&gt;
    &amp;lt;/disk&amp;gt;&lt;br /&gt;
    &amp;lt;disk type=&#039;file&#039; device=&#039;cdrom&#039;&amp;gt;&lt;br /&gt;
      &amp;lt;driver name=&#039;qemu&#039; type=&#039;raw&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;target dev=&#039;hdc&#039; bus=&#039;ide&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;readonly/&amp;gt;&lt;br /&gt;
      &amp;lt;alias name=&#039;ide0-1-0&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;address type=&#039;drive&#039; controller=&#039;0&#039; bus=&#039;1&#039; unit=&#039;0&#039;/&amp;gt;&lt;br /&gt;
    &amp;lt;/disk&amp;gt;&lt;br /&gt;
    &amp;lt;controller type=&#039;fdc&#039; index=&#039;0&#039;&amp;gt;&lt;br /&gt;
      &amp;lt;alias name=&#039;fdc0&#039;/&amp;gt;&lt;br /&gt;
    &amp;lt;/controller&amp;gt;&lt;br /&gt;
    &amp;lt;controller type=&#039;ide&#039; index=&#039;0&#039;&amp;gt;&lt;br /&gt;
      &amp;lt;alias name=&#039;ide0&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;address type=&#039;pci&#039; domain=&#039;0x0000&#039; bus=&#039;0x00&#039; slot=&#039;0x01&#039; function=&#039;0x1&#039;/&amp;gt;&lt;br /&gt;
    &amp;lt;/controller&amp;gt;&lt;br /&gt;
    &amp;lt;interface type=&#039;bridge&#039;&amp;gt;&lt;br /&gt;
      &amp;lt;mac address=&#039;52:54:00:5e:b1:47&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;source bridge=&#039;vbr2&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;target dev=&#039;vnet1&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;alias name=&#039;net0&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;address type=&#039;pci&#039; domain=&#039;0x0000&#039; bus=&#039;0x00&#039; slot=&#039;0x03&#039; function=&#039;0x0&#039;/&amp;gt;&lt;br /&gt;
    &amp;lt;/interface&amp;gt;&lt;br /&gt;
    &amp;lt;serial type=&#039;pty&#039;&amp;gt;&lt;br /&gt;
      &amp;lt;source path=&#039;/dev/pts/3&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;target port=&#039;0&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;alias name=&#039;serial0&#039;/&amp;gt;&lt;br /&gt;
    &amp;lt;/serial&amp;gt;&lt;br /&gt;
    &amp;lt;console type=&#039;pty&#039; tty=&#039;/dev/pts/3&#039;&amp;gt;&lt;br /&gt;
      &amp;lt;source path=&#039;/dev/pts/3&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;target type=&#039;serial&#039; port=&#039;0&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;alias name=&#039;serial0&#039;/&amp;gt;&lt;br /&gt;
    &amp;lt;/console&amp;gt;&lt;br /&gt;
    &amp;lt;input type=&#039;tablet&#039; bus=&#039;usb&#039;&amp;gt;&lt;br /&gt;
      &amp;lt;alias name=&#039;input0&#039;/&amp;gt;&lt;br /&gt;
    &amp;lt;/input&amp;gt;&lt;br /&gt;
    &amp;lt;input type=&#039;mouse&#039; bus=&#039;ps2&#039;/&amp;gt;&lt;br /&gt;
    &amp;lt;graphics type=&#039;vnc&#039; port=&#039;5901&#039; autoport=&#039;yes&#039;/&amp;gt;&lt;br /&gt;
    &amp;lt;video&amp;gt;&lt;br /&gt;
      &amp;lt;model type=&#039;vga&#039; vram=&#039;9216&#039; heads=&#039;1&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;alias name=&#039;video0&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;address type=&#039;pci&#039; domain=&#039;0x0000&#039; bus=&#039;0x00&#039; slot=&#039;0x02&#039; function=&#039;0x0&#039;/&amp;gt;&lt;br /&gt;
    &amp;lt;/video&amp;gt;&lt;br /&gt;
    &amp;lt;memballoon model=&#039;virtio&#039;&amp;gt;&lt;br /&gt;
      &amp;lt;alias name=&#039;balloon0&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;address type=&#039;pci&#039; domain=&#039;0x0000&#039; bus=&#039;0x00&#039; slot=&#039;0x05&#039; function=&#039;0x0&#039;/&amp;gt;&lt;br /&gt;
    &amp;lt;/memballoon&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;
As before, defining the VM on both nodes is optional, but a habit I like to do.&lt;br /&gt;
&lt;br /&gt;
On &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;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 /shared/definitions/vm0004-ms.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 vm0004-ms defined from /shared/definitions/vm0004-ms.xml&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can confirm that it now exists by re-running &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virsh list --all&amp;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;
  2 vm0001-dev           running&lt;br /&gt;
  4 vm0002-web           running&lt;br /&gt;
  - vm0003-db            shut off&lt;br /&gt;
  - vm0004-ms            shut off&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With that, all our VMs exist and we&#039;re ready to make them highly available!&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 cluster services! This involves two main steps:&lt;br /&gt;
* Creating two new, ordered fail-over Domains; One with each node as the highest priority.&lt;br /&gt;
* Adding our VMs as services, one is each new fail-over domain.&lt;br /&gt;
&lt;br /&gt;
== Creating the Ordered Fail-Over Domains ==&lt;br /&gt;
&lt;br /&gt;
We have planned for two VMs, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0001-dev&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0002-web&amp;lt;/span&amp;gt; to normally run on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt; while &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0003-db&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0004-ms&amp;lt;/span&amp;gt; to run on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt;. Of course, should one of the nodes fail, the lost VMs will be restarted on the surviving node. For this, we will use an ordered fail-over domain.&lt;br /&gt;
&lt;br /&gt;
The idea here is that each new fail-over 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-node01&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-node02&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 fail-over domain.&lt;br /&gt;
&lt;br /&gt;
{{note|1=With 2-node clusters like ours, ordering is arguably useless. It&#039;s used here more to introduce the concepts rather than providing any real benefit. If you want to make production clusters unordered, you can. Just remember to run the VMs on the appropriate nodes when both are on-line.}}&lt;br /&gt;
&lt;br /&gt;
Here are the two new domains we will create 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;
&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;primary_an01&amp;quot; nofailback=&amp;quot;1&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-node01.alteeve.com&amp;quot; priority=&amp;quot;1&amp;quot;/&amp;gt;&lt;br /&gt;
                                &amp;lt;failoverdomainnode name=&amp;quot;an-node02.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;primary_an02&amp;quot; nofailback=&amp;quot;1&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-node01.alteeve.com&amp;quot; priority=&amp;quot;2&amp;quot;/&amp;gt;&lt;br /&gt;
                                &amp;lt;failoverdomainnode name=&amp;quot;an-node02.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;
The two major pieces of the puzzle here are the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;failoverdomain ...&amp;gt;&amp;lt;/span&amp;gt;&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ordered=&amp;quot;1&amp;quot;&amp;lt;/span&amp;gt; attribute and the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;failoverdomainnode ...&amp;gt;&amp;lt;/span&amp;gt;&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;priority=&amp;quot;x&amp;quot;&amp;lt;/span&amp;gt; attributes. The former tells the cluster that there is a preference for which node should be used when both are available. The later, which is the difference between the two new domains, tells the cluster which specific node is preferred.&lt;br /&gt;
&lt;br /&gt;
The first of the new fail-over domains is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;primary_an01&amp;lt;/span&amp;gt;. Any service placed in this domain will prefer to run on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;, as its priority of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt; is higher than &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt;&#039;s priority of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;2&amp;lt;/span&amp;gt;. The second of the new domains is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;primary_an02&amp;lt;/span&amp;gt; which reverses the preference, making &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt; preferred over &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Let&#039;s look at the complete &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cluster.conf&amp;lt;/span&amp;gt; with the new domain, and the version updated to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;11&amp;lt;/span&amp;gt; of course.&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 config_version=&amp;quot;11&amp;quot; name=&amp;quot;an-cluster-A&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-node01.alteeve.com&amp;quot; nodeid=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
                        &amp;lt;fence&amp;gt;&lt;br /&gt;
                                &amp;lt;method name=&amp;quot;ipmi&amp;quot;&amp;gt;&lt;br /&gt;
                                        &amp;lt;device action=&amp;quot;reboot&amp;quot; name=&amp;quot;ipmi_an01&amp;quot;/&amp;gt;&lt;br /&gt;
                                &amp;lt;/method&amp;gt;&lt;br /&gt;
                                &amp;lt;method name=&amp;quot;pdu&amp;quot;&amp;gt;&lt;br /&gt;
                                        &amp;lt;device action=&amp;quot;reboot&amp;quot; name=&amp;quot;pdu2&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;
                &amp;lt;/clusternode&amp;gt;&lt;br /&gt;
                &amp;lt;clusternode name=&amp;quot;an-node02.alteeve.com&amp;quot; nodeid=&amp;quot;2&amp;quot;&amp;gt;&lt;br /&gt;
                        &amp;lt;fence&amp;gt;&lt;br /&gt;
                                &amp;lt;method name=&amp;quot;ipmi&amp;quot;&amp;gt;&lt;br /&gt;
                                        &amp;lt;device action=&amp;quot;reboot&amp;quot; name=&amp;quot;ipmi_an02&amp;quot;/&amp;gt;&lt;br /&gt;
                                &amp;lt;/method&amp;gt;&lt;br /&gt;
                                &amp;lt;method name=&amp;quot;pdu&amp;quot;&amp;gt;&lt;br /&gt;
                                        &amp;lt;device action=&amp;quot;reboot&amp;quot; name=&amp;quot;pdu2&amp;quot; port=&amp;quot;2&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_ipmilan&amp;quot; ipaddr=&amp;quot;an-node01.ipmi&amp;quot; login=&amp;quot;root&amp;quot; name=&amp;quot;ipmi_an01&amp;quot; passwd=&amp;quot;secret&amp;quot;/&amp;gt;&lt;br /&gt;
                &amp;lt;fencedevice agent=&amp;quot;fence_ipmilan&amp;quot; ipaddr=&amp;quot;an-node02.ipmi&amp;quot; login=&amp;quot;root&amp;quot; name=&amp;quot;ipmi_an02&amp;quot; passwd=&amp;quot;secret&amp;quot;/&amp;gt;&lt;br /&gt;
                &amp;lt;fencedevice agent=&amp;quot;fence_apc_snmp&amp;quot; ipaddr=&amp;quot;pdu2.alteeve.com&amp;quot; name=&amp;quot;pdu2&amp;quot;/&amp;gt;&lt;br /&gt;
        &amp;lt;/fencedevices&amp;gt;&lt;br /&gt;
        &amp;lt;fence_daemon post_join_delay=&amp;quot;30&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 log_level=&amp;quot;5&amp;quot;&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;script file=&amp;quot;/etc/init.d/libvirtd&amp;quot; name=&amp;quot;libvirtd&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;only_an01&amp;quot; nofailback=&amp;quot;1&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-node01.alteeve.com&amp;quot;/&amp;gt;&lt;br /&gt;
                        &amp;lt;/failoverdomain&amp;gt;&lt;br /&gt;
                        &amp;lt;failoverdomain name=&amp;quot;only_an02&amp;quot; nofailback=&amp;quot;1&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-node02.alteeve.com&amp;quot;/&amp;gt;&lt;br /&gt;
                        &amp;lt;/failoverdomain&amp;gt;&lt;br /&gt;
                        &amp;lt;failoverdomain name=&amp;quot;primary_an01&amp;quot; nofailback=&amp;quot;1&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-node01.alteeve.com&amp;quot; priority=&amp;quot;1&amp;quot;/&amp;gt;&lt;br /&gt;
                                &amp;lt;failoverdomainnode name=&amp;quot;an-node02.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;primary_an02&amp;quot; nofailback=&amp;quot;1&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-node01.alteeve.com&amp;quot; priority=&amp;quot;2&amp;quot;/&amp;gt;&lt;br /&gt;
                                &amp;lt;failoverdomainnode name=&amp;quot;an-node02.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;only_an01&amp;quot; exclusive=&amp;quot;0&amp;quot; name=&amp;quot;storage_an01&amp;quot; recovery=&amp;quot;restart&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 ref=&amp;quot;libvirtd&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;/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;only_an02&amp;quot; exclusive=&amp;quot;0&amp;quot; name=&amp;quot;storage_an02&amp;quot; recovery=&amp;quot;restart&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 ref=&amp;quot;libvirtd&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;/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;
Let&#039;s validate it now, but we won&#039;t bother to push it out just yet.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ccs_config_validate &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Configuration validates&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Good, now to create the new VM services!&lt;br /&gt;
&lt;br /&gt;
== Making Our VMs Clustered Services ==&lt;br /&gt;
&lt;br /&gt;
The final piece of the puzzle, and the whole purpose of this exercise is in sight!&lt;br /&gt;
&lt;br /&gt;
There is a special service in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; for virtual machines which uses the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm:&amp;lt;/span&amp;gt; prefix. We will need to create four of these services; One for each of the virtual machines.&lt;br /&gt;
&lt;br /&gt;
{{note|1=There is a one main drawback of using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; to manage virtual machines in our cluster. Ideally, we&#039;d like to have the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm:&amp;lt;/span&amp;gt; services start after the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;storage_X&amp;lt;/span&amp;gt; services are up, and a bit of logic to say that all VMs can start on one node, should the other&#039;s storage service fail. This isn&#039;t possible though, so we will need to manually start VMs after a cold-start of the cluster.}}&lt;br /&gt;
&lt;br /&gt;
=== Creating The vm: Services ===&lt;br /&gt;
&lt;br /&gt;
We&#039;ll create four new services, one for each VM. These are simple single-element entries. Lets increment the version to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;12&amp;lt;/span&amp;gt; and take a look at the new entries.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;rm log_level=&amp;quot;5&amp;quot;&amp;gt;&lt;br /&gt;
                ...&lt;br /&gt;
                &amp;lt;vm name=&amp;quot;vm0001-dev&amp;quot; domain=&amp;quot;primary_an01&amp;quot; path=&amp;quot;/shared/definitions/&amp;quot; autostart=&amp;quot;0&amp;quot;&lt;br /&gt;
                 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-web&amp;quot; domain=&amp;quot;primary_an01&amp;quot; path=&amp;quot;/shared/definitions/&amp;quot; autostart=&amp;quot;0&amp;quot;&lt;br /&gt;
                 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;vm0003-db&amp;quot; domain=&amp;quot;primary_an02&amp;quot; path=&amp;quot;/shared/definitions/&amp;quot; autostart=&amp;quot;0&amp;quot;&lt;br /&gt;
                 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;vm0004-ms&amp;quot; domain=&amp;quot;primary_an02&amp;quot; path=&amp;quot;/shared/definitions/&amp;quot; autostart=&amp;quot;0&amp;quot;&lt;br /&gt;
                 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;
Let&#039;s look at each of the attributes now;&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;name&amp;lt;/span&amp;gt;; This must match the name we created the VM with (the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--name ...&amp;lt;/span&amp;gt; value when we provisioned the VMs). This is the name that will be passed to the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm.sh&amp;lt;/span&amp;gt; resource agent when managing this service, and it will be the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;name&amp;gt;.xml&amp;lt;/span&amp;gt; used when looking under &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;path=...&amp;lt;/span&amp;gt; for the VM&#039;s definition file.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;domain&amp;lt;/span&amp;gt;; This tells the cluster to manage the VM using the given fail-over domain.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;path&amp;lt;/span&amp;gt;; This tells the cluster where to look for the VM&#039;s definition file. &#039;&#039;&#039;Do not&#039;&#039;&#039; include the actual file name, just the path. This is partly why we wrote out each VM&#039;s definition to the shared directory.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;autostart&amp;lt;/span&amp;gt;; As mentioned above, we can&#039;t have the VMs start with the cluster, because the underlying storage takes too long to come on-line. Setting this to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;0&amp;lt;/span&amp;gt; disables the auto-start behaviour.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;exclusive&amp;lt;/span&amp;gt;; As we saw with the storage services, we want to ensure that this service &#039;&#039;&#039;is not&#039;&#039;&#039; exclusive. If it were, starting the VM would stop the storage and prevent other VMs from running on the node. This would be a bad thing™.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;recovery&amp;lt;/span&amp;gt;; This tells the cluster what to do when the service fails. We are setting this to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;restart&amp;lt;/span&amp;gt;, so the cluster will try to restart the VM on the same node it was on when it failed. The alternative is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;relocate&amp;lt;/span&amp;gt;, which would instead start the VM on another node. More about this next.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;max_restarts&amp;lt;/span&amp;gt;; When a VM fails, it is possible that it is because there is a subtle problem on the host node itself. So this attribute allows up to set a limit on how many times a VM will be allowed to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;restart&amp;lt;/span&amp;gt; before giving up and switching to a &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;relocate&amp;lt;/span&amp;gt; police. We&#039;re setting this to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;2&amp;lt;/span&amp;gt;, which means that if a VM is restarted twice, the third failure will trigger a &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;relocate&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;restart_expire_time&amp;lt;/span&amp;gt;; If we let the failure count increment indefinitely, than a &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;relocate&amp;lt;/span&amp;gt; policy becomes inevitable, when there is no reason to believe that an issue with the host node exists. To account for this, we use this attribute to tell the cluster to &amp;quot;forget&amp;quot; a restart after the defined number of seconds. We&#039;re using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;600&amp;lt;/span&amp;gt; seconds (ten minutes). So if a VM fails, the failure count increments from &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;0&amp;lt;/span&amp;gt; to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt;. After &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;600&amp;lt;/span&amp;gt; seconds though, the restart is &amp;quot;forgotten&amp;quot; and the failure count returns to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;0&amp;lt;/span&amp;gt;. Said another way, a VM will have to fail three times in ten minutes to trigger the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;relocate&amp;lt;/span&amp;gt; recovery policy.&lt;br /&gt;
&lt;br /&gt;
So let&#039;s take a look at the final, complete &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;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;?xml version=&amp;quot;1.0&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;cluster config_version=&amp;quot;12&amp;quot; name=&amp;quot;an-cluster-A&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-node01.alteeve.com&amp;quot; nodeid=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
			&amp;lt;fence&amp;gt;&lt;br /&gt;
				&amp;lt;method name=&amp;quot;ipmi&amp;quot;&amp;gt;&lt;br /&gt;
					&amp;lt;device action=&amp;quot;reboot&amp;quot; name=&amp;quot;ipmi_an01&amp;quot;/&amp;gt;&lt;br /&gt;
				&amp;lt;/method&amp;gt;&lt;br /&gt;
				&amp;lt;method name=&amp;quot;pdu&amp;quot;&amp;gt;&lt;br /&gt;
					&amp;lt;device action=&amp;quot;reboot&amp;quot; name=&amp;quot;pdu2&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;
		&amp;lt;/clusternode&amp;gt;&lt;br /&gt;
		&amp;lt;clusternode name=&amp;quot;an-node02.alteeve.com&amp;quot; nodeid=&amp;quot;2&amp;quot;&amp;gt;&lt;br /&gt;
			&amp;lt;fence&amp;gt;&lt;br /&gt;
				&amp;lt;method name=&amp;quot;ipmi&amp;quot;&amp;gt;&lt;br /&gt;
					&amp;lt;device action=&amp;quot;reboot&amp;quot; name=&amp;quot;ipmi_an02&amp;quot;/&amp;gt;&lt;br /&gt;
				&amp;lt;/method&amp;gt;&lt;br /&gt;
				&amp;lt;method name=&amp;quot;pdu&amp;quot;&amp;gt;&lt;br /&gt;
					&amp;lt;device action=&amp;quot;reboot&amp;quot; name=&amp;quot;pdu2&amp;quot; port=&amp;quot;2&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_ipmilan&amp;quot; ipaddr=&amp;quot;an-node01.ipmi&amp;quot; login=&amp;quot;root&amp;quot; name=&amp;quot;ipmi_an01&amp;quot; passwd=&amp;quot;secret&amp;quot;/&amp;gt;&lt;br /&gt;
		&amp;lt;fencedevice agent=&amp;quot;fence_ipmilan&amp;quot; ipaddr=&amp;quot;an-node02.ipmi&amp;quot; login=&amp;quot;root&amp;quot; name=&amp;quot;ipmi_an02&amp;quot; passwd=&amp;quot;secret&amp;quot;/&amp;gt;&lt;br /&gt;
		&amp;lt;fencedevice agent=&amp;quot;fence_apc_snmp&amp;quot; ipaddr=&amp;quot;pdu2.alteeve.com&amp;quot; name=&amp;quot;pdu2&amp;quot;/&amp;gt;&lt;br /&gt;
	&amp;lt;/fencedevices&amp;gt;&lt;br /&gt;
	&amp;lt;fence_daemon post_join_delay=&amp;quot;30&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 log_level=&amp;quot;5&amp;quot;&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;script file=&amp;quot;/etc/init.d/libvirtd&amp;quot; name=&amp;quot;libvirtd&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;only_an01&amp;quot; nofailback=&amp;quot;1&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-node01.alteeve.com&amp;quot;/&amp;gt;&lt;br /&gt;
			&amp;lt;/failoverdomain&amp;gt;&lt;br /&gt;
			&amp;lt;failoverdomain name=&amp;quot;only_an02&amp;quot; nofailback=&amp;quot;1&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-node02.alteeve.com&amp;quot;/&amp;gt;&lt;br /&gt;
			&amp;lt;/failoverdomain&amp;gt;&lt;br /&gt;
			&amp;lt;failoverdomain name=&amp;quot;primary_an01&amp;quot; nofailback=&amp;quot;1&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-node01.alteeve.com&amp;quot; priority=&amp;quot;1&amp;quot;/&amp;gt;&lt;br /&gt;
				&amp;lt;failoverdomainnode name=&amp;quot;an-node02.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;primary_an02&amp;quot; nofailback=&amp;quot;1&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-node01.alteeve.com&amp;quot; priority=&amp;quot;2&amp;quot;/&amp;gt;&lt;br /&gt;
				&amp;lt;failoverdomainnode name=&amp;quot;an-node02.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;only_an01&amp;quot; exclusive=&amp;quot;0&amp;quot; name=&amp;quot;storage_an01&amp;quot; recovery=&amp;quot;restart&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 ref=&amp;quot;libvirtd&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;/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;only_an02&amp;quot; exclusive=&amp;quot;0&amp;quot; name=&amp;quot;storage_an02&amp;quot; recovery=&amp;quot;restart&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 ref=&amp;quot;libvirtd&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;/script&amp;gt;&lt;br /&gt;
		&amp;lt;/service&amp;gt;&lt;br /&gt;
		&amp;lt;vm name=&amp;quot;vm0001-dev&amp;quot; domain=&amp;quot;primary_an01&amp;quot; path=&amp;quot;/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-web&amp;quot; domain=&amp;quot;primary_an01&amp;quot; path=&amp;quot;/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;vm0003-db&amp;quot; domain=&amp;quot;primary_an02&amp;quot; path=&amp;quot;/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;vm0004-ms&amp;quot; domain=&amp;quot;primary_an02&amp;quot; path=&amp;quot;/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;
&lt;br /&gt;
Let&#039;s validate one more time.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ccs_config_validate &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Configuration validates&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
She&#039;s a beaut&#039;, eh?&lt;br /&gt;
&lt;br /&gt;
=== Making The VM Services Active ===&lt;br /&gt;
&lt;br /&gt;
Before we push the last &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cluster.conf&amp;lt;/span&amp;gt; out, lets take a look at the current state of affairs.&lt;br /&gt;
&lt;br /&gt;
On &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;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-cluster-A @ Tue Dec 27 14:06: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-node01.alteeve.com                       1 Online, Local, rgmanager&lt;br /&gt;
 an-node02.alteeve.com                       2 Online, rgmanager&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State         &lt;br /&gt;
 ------- ----                   ----- ------                   -----         &lt;br /&gt;
 service:storage_an01           an-node01.alteeve.com          started       &lt;br /&gt;
 service:storage_an02           an-node02.alteeve.com          started       &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;
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;
  2 vm0001-dev           running&lt;br /&gt;
  4 vm0002-web           running&lt;br /&gt;
  - vm0003-db            shut off&lt;br /&gt;
  - vm0004-ms            shut off&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;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-cluster-A @ Tue Dec 27 14:07:32 2011&lt;br /&gt;
Member Status: Quorate&lt;br /&gt;
&lt;br /&gt;
 Member Name                             ID   Status&lt;br /&gt;
 ------ ----                             ---- ------&lt;br /&gt;
 an-node01.alteeve.com                       1 Online, rgmanager&lt;br /&gt;
 an-node02.alteeve.com                       2 Online, Local, rgmanager&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State         &lt;br /&gt;
 ------- ----                   ----- ------                   -----         &lt;br /&gt;
 service:storage_an01           an-node01.alteeve.com          started       &lt;br /&gt;
 service:storage_an02           an-node02.alteeve.com          started       &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;
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;
  2 vm0003-db            running&lt;br /&gt;
  4 vm0004-ms            running&lt;br /&gt;
  - vm0001-dev           shut off&lt;br /&gt;
  - vm0002-web           shut off&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So we can see that the cluster doesn&#039;t know about the VMs yet, as we&#039;ve not yet pushed out the changes. We can also see that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0001-dev&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0002-web&amp;lt;/span&amp;gt; are currently running on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0003-db&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0004-ms&amp;lt;/span&amp;gt; are running on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
So let&#039;s push out the new configuration and see what happens!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cman_tool version -r&lt;br /&gt;
cman_tool version&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
6.2.0 config 12&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Let&#039;s take a look at what showed up in syslog;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Dec 27 14:18:20 an-node01 modcluster: Updating cluster.conf&lt;br /&gt;
Dec 27 14:18:20 an-node01 corosync[2362]:   [QUORUM] Members[2]: 1 2&lt;br /&gt;
Dec 27 14:18:20 an-node01 rgmanager[2579]: Reconfiguring&lt;br /&gt;
Dec 27 14:18:22 an-node01 rgmanager[2579]: Initializing vm:vm0001-dev&lt;br /&gt;
Dec 27 14:18:22 an-node01 rgmanager[2579]: vm:vm0001-dev was added to the config, but I am not initializing it.&lt;br /&gt;
Dec 27 14:18:22 an-node01 rgmanager[2579]: Initializing vm:vm0002-web&lt;br /&gt;
Dec 27 14:18:22 an-node01 rgmanager[2579]: vm:vm0002-web was added to the config, but I am not initializing it.&lt;br /&gt;
Dec 27 14:18:22 an-node01 rgmanager[2579]: Initializing vm:vm0003-db&lt;br /&gt;
Dec 27 14:18:22 an-node01 rgmanager[2579]: vm:vm0003-db was added to the config, but I am not initializing it.&lt;br /&gt;
Dec 27 14:18:23 an-node01 rgmanager[2579]: Initializing vm:vm0004-ms&lt;br /&gt;
Dec 27 14:18:23 an-node01 rgmanager[2579]: vm:vm0004-ms was added to the config, but I am not initializing it.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Indeed, if we check again with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clustat&amp;lt;/span&amp;gt;, we&#039;ll see the new VM services, but all four will show as &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;disabled&amp;lt;/span&amp;gt;, despite the VMs themselves being up and running.&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-cluster-A @ Tue Dec 27 14:20: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-node01.alteeve.com                       1 Online, Local, rgmanager&lt;br /&gt;
 an-node02.alteeve.com                       2 Online, rgmanager&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State         &lt;br /&gt;
 ------- ----                   ----- ------                   -----         &lt;br /&gt;
 service:storage_an01           an-node01.alteeve.com          started       &lt;br /&gt;
 service:storage_an02           an-node02.alteeve.com          started       &lt;br /&gt;
 vm:vm0001-dev                  (none)                         disabled      &lt;br /&gt;
 vm:vm0002-web                  (none)                         disabled      &lt;br /&gt;
 vm:vm0003-db                   (none)                         disabled      &lt;br /&gt;
 vm:vm0004-ms                   (none)                         disabled      &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This highlights how the state of the VMs is not intrinsically tied to the cluster&#039;s status. The VMs were started outside of the cluster, so the cluster thinks they are off-line. We know they&#039;re running though, so we can tell the cluster to enable them now. Note that the VMs will &#039;&#039;&#039;not&#039;&#039;&#039; be rebooted or in any way effected, provided you tell the cluster to enable the VM on the node it&#039;s currently running on.&lt;br /&gt;
&lt;br /&gt;
Let&#039;s start by enabling &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0001-dev&amp;lt;/span&amp;gt;, which we know is running on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;. Be aware that the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm:&amp;lt;/span&amp;gt; prefix is required when using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clusvcadm&amp;lt;/span&amp;gt;!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
clusvcadm -e vm:vm0001-dev -m an-node01.alteeve.com&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
vm:vm0001-dev is now running on an-node01.alteeve.com&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we can see that the VM is under the cluster&#039;s control!&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-cluster-A @ Tue Dec 27 14:25:08 2011&lt;br /&gt;
Member Status: Quorate&lt;br /&gt;
&lt;br /&gt;
 Member Name                             ID   Status&lt;br /&gt;
 ------ ----                             ---- ------&lt;br /&gt;
 an-node01.alteeve.com                       1 Online, Local, rgmanager&lt;br /&gt;
 an-node02.alteeve.com                       2 Online, rgmanager&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State         &lt;br /&gt;
 ------- ----                   ----- ------                   -----         &lt;br /&gt;
 service:storage_an01           an-node01.alteeve.com          started       &lt;br /&gt;
 service:storage_an02           an-node02.alteeve.com          started       &lt;br /&gt;
 vm:vm0001-dev                  an-node01.alteeve.com          started       &lt;br /&gt;
 vm:vm0002-web                  (none)                         disabled      &lt;br /&gt;
 vm:vm0003-db                   (none)                         disabled      &lt;br /&gt;
 vm:vm0004-ms                   (none)                         disabled      &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Perfect! Now to add the other three VMs. Note that all of these commands can be run from whichever node you wish, because we&#039;re specifying the target node by using the &amp;quot;member&amp;quot; switch.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
clusvcadm -e vm:vm0002-web -m an-node01.alteeve.com&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
vm:vm0002-web is now running on an-node01.alteeve.com&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
clusvcadm -e vm:vm0003-db -m an-node02.alteeve.com&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
vm:vm0003-db is now running on an-node02.alteeve.com&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
clusvcadm -e vm:vm0004-ms -m an-node02.alteeve.com&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
vm:vm0004-ms is now running on an-node02.alteeve.com&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Let&#039;s do a final check of the cluster&#039;s status;&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-cluster-A @ Tue Dec 27 14:28:19 2011&lt;br /&gt;
Member Status: Quorate&lt;br /&gt;
&lt;br /&gt;
 Member Name                             ID   Status&lt;br /&gt;
 ------ ----                             ---- ------&lt;br /&gt;
 an-node01.alteeve.com                       1 Online, Local, rgmanager&lt;br /&gt;
 an-node02.alteeve.com                       2 Online, rgmanager&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State         &lt;br /&gt;
 ------- ----                   ----- ------                   -----         &lt;br /&gt;
 service:storage_an01           an-node01.alteeve.com          started       &lt;br /&gt;
 service:storage_an02           an-node02.alteeve.com          started       &lt;br /&gt;
 vm:vm0001-dev                  an-node01.alteeve.com          started       &lt;br /&gt;
 vm:vm0002-web                  an-node01.alteeve.com          started       &lt;br /&gt;
 vm:vm0003-db                   an-node02.alteeve.com          started       &lt;br /&gt;
 vm:vm0004-ms                   an-node02.alteeve.com          started       &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== The Last Step - Automatic Cluster Start ==&lt;br /&gt;
&lt;br /&gt;
The last step is to enable automatic starting of the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; services when the host node boots. This is quite simple;&lt;br /&gt;
&lt;br /&gt;
On both nodes, run;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
chkconfig cman on &amp;amp;&amp;amp; chkconfig rgmanager on&lt;br /&gt;
chkconfig --list | grep -e cman -e rgmanager&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;
cman           	0:off	1:off	2:on	3:on	4:on	5:on	6:off&lt;br /&gt;
rgmanager      	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;
The next time you restart the nodes, you will be able to run &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clustat&amp;lt;/span&amp;gt; and you should find your cluster up and running!&lt;br /&gt;
&lt;br /&gt;
== We&#039;re Done! Or, Are We? ==&lt;br /&gt;
&lt;br /&gt;
That&#039;s it, ladies and gentlemen. Our cluster is completed! In theory now, any failure in the cluster will result in no lost data and, at worst, no more than a minute or two of downtime.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;In theory&amp;quot; just isn&#039;t good enough in clustering though. Time to take &amp;quot;theory&amp;quot; and make it a tested, known fact.&lt;br /&gt;
&lt;br /&gt;
= Testing; Taking Theory And Putting It Into Practice =&lt;br /&gt;
&lt;br /&gt;
You may have thought that we were done. Indeed, the cluster has been built, but we don&#039;t know if things actually work.&lt;br /&gt;
&lt;br /&gt;
Enter testing.&lt;br /&gt;
&lt;br /&gt;
In practice, when preparing production clusters for deployment, you should plan to spend &#039;&#039;&#039;at least&#039;&#039;&#039; twice as long in testing as you did in building the cluster. You need to imagine all failure scenarios, trigger those failures and see what happens.&lt;br /&gt;
&lt;br /&gt;
== A Note On The Importance Of Fencing ==&lt;br /&gt;
&lt;br /&gt;
It may be tempting to think that you were careful and don&#039;t really need to test you cluster thoroughly.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;You are wrong&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Baring you being absolutely obsessive with testing every step of the way, you will almost certain make mistakes. Now I make no claims to genius, but I do like to think I am pretty comfortable building 2-node clusters. Despite that, while writing this testing portion of the tutorial, I found the following problems with my cluster;&lt;br /&gt;
&lt;br /&gt;
* RGManager&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;autostart=&amp;quot;1&amp;quot;&amp;lt;/span&amp;gt; is not evaluated when a node starts, only when quorum is gained. The mistake had me assuming that the storage services would start when the node restarted, after having manually disabled the service prior to node withdrawal.&lt;br /&gt;
* The behaviour of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;echo c &amp;gt; /proc/sysrq-trigger&amp;lt;/span&amp;gt; changed since [[EL5]] and now triggers a core dump with 100% CPU load in [[EL6]] KVM guests. This means that a previous expectation of the cluster recovering from these crashes was wrong.&lt;br /&gt;
* I forgot to install the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;obliterate-peer.sh&amp;lt;/span&amp;gt; script for DRBD, which I didn&#039;t catch until I tried to fail a node.&lt;br /&gt;
&lt;br /&gt;
You simply can&#039;t make assumptions. Test your cluster in every failure mode you can imagine. Until you do, you won&#039;t know what you might have missed!&lt;br /&gt;
&lt;br /&gt;
== Controlled VM Migration And Node Withdrawal ==&lt;br /&gt;
&lt;br /&gt;
This testing will ensure that live migration works in both directions, and that each node can be cleanly removed from and then rejoin the cluster.&lt;br /&gt;
&lt;br /&gt;
The test will consist of the following steps;&lt;br /&gt;
&lt;br /&gt;
# Live migrate &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0001-dev&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0002-web&amp;lt;/span&amp;gt; from &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt; to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt;. This will ensure live migration works and that all VMs will run on a single node.&lt;br /&gt;
# Withdraw &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt; from the cluster entirely and reboot it. This will ensure that cold shut-down of the node is successful.&lt;br /&gt;
# Once &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt; has rebooted, rejoin it to the cluster. This will ensure that rejoining the cluster works.&lt;br /&gt;
# Once &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt; is a member of the cluster, we will wait a few minutes and ensure that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0001-dev&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0002-web&amp;lt;/span&amp;gt; automatically live migrate back to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;. This will ensure that priority is working.&lt;br /&gt;
# We will live migrate &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0003-db&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0004-ms&amp;lt;/span&amp;gt; from &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt; to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt; to ensure that migration works in the other direction.&lt;br /&gt;
# With the VMs all running on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;, we will withdraw &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt; from the cluster, reboot it, rejoin it to the cluster and then confirm that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0003-db&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0004-ms&amp;lt;/span&amp;gt; automatically migrate back to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
With all of these tests completed, we will be able to ensure that order and controlled migration of VM services work as expected.&lt;br /&gt;
&lt;br /&gt;
=== Live Migration - vm0001-dev And vm0002-dev To an-node02 ===&lt;br /&gt;
&lt;br /&gt;
First up, we will use the special &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clusvcadm&amp;lt;/span&amp;gt; switch &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;-M&amp;lt;/span&amp;gt;, which tells the cluster to use &amp;quot;live migration&amp;quot;. This is, the VM will move to the target member without shutting down. Users of the VM should notice, and worst, a brief network interruption when the cut-over occurs, without any adverse effect on their services or dropped connections.&lt;br /&gt;
&lt;br /&gt;
Let&#039;s take a quick look at the state of affairs;&lt;br /&gt;
&lt;br /&gt;
On &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&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;
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-cluster-A @ Sat Dec 31 13:49: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-node01.alteeve.com                       1 Online, rgmanager&lt;br /&gt;
 an-node02.alteeve.com                       2 Online, Local, rgmanager&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State         &lt;br /&gt;
 ------- ----                   ----- ------                   -----         &lt;br /&gt;
 service:storage_an01           an-node01.alteeve.com          started       &lt;br /&gt;
 service:storage_an02           an-node02.alteeve.com          started       &lt;br /&gt;
 vm:vm0001-dev                  an-node01.alteeve.com          started       &lt;br /&gt;
 vm:vm0002-web                  an-node01.alteeve.com          started       &lt;br /&gt;
 vm:vm0003-db                   an-node02.alteeve.com          started       &lt;br /&gt;
 vm:vm0004-ms                   an-node02.alteeve.com          started       &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Lets start by live migrating &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0001-dev&amp;lt;/span&amp;gt;. Before we do though, let&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[ssh]]&amp;lt;/span&amp;gt; into it and start a ping against a target on the internet. We&#039;ll leave this running throughout the live migration.&lt;br /&gt;
&lt;br /&gt;
On &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0001-dev&amp;lt;/span&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
[[Image:vm0001-dev_ping_live-migration-test_01.png|thumb|700px|center|Running &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ping alteeve.com&amp;lt;/span&amp;gt; on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0001-dev&amp;lt;/span&amp;gt; prior to live migration.]]&lt;br /&gt;
&lt;br /&gt;
Now back on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;, let&#039;s migrate &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0001-dev&amp;lt;/span&amp;gt; over to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt;. This will take a little while as the VM&#039;s [[RAM]] gets copied across the [[BCN]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
clusvcadm -M vm:vm0001-dev -m an-node02.alteeve.com&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Trying to migrate vm:vm0001-dev to an-node02.alteeve.com...Success&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Image:vm0001-dev_ping_live-migration-test_02.png|thumb|700px|center|Mid-migration of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0001-dev&amp;lt;/span&amp;gt;.]]&lt;br /&gt;
&lt;br /&gt;
Once complete, check the new status of &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-cluster-A @ Sat Dec 31 14:11: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-node01.alteeve.com                       1 Online, rgmanager&lt;br /&gt;
 an-node02.alteeve.com                       2 Online, Local, rgmanager&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State         &lt;br /&gt;
 ------- ----                   ----- ------                   -----         &lt;br /&gt;
 service:storage_an01           an-node01.alteeve.com          started       &lt;br /&gt;
 service:storage_an02           an-node02.alteeve.com          started       &lt;br /&gt;
 vm:vm0001-dev                  an-node02.alteeve.com          started       &lt;br /&gt;
 vm:vm0002-web                  an-node01.alteeve.com          started       &lt;br /&gt;
 vm:vm0003-db                   an-node02.alteeve.com          started       &lt;br /&gt;
 vm:vm0004-ms                   an-node02.alteeve.com          started       &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If we look again at &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0001-dev&amp;lt;/span&amp;gt;&#039;s ping, we&#039;ll see that a few packets were dropped but our ssh session remained intact. Any other active [[TCP]] session should have survived this just fine as well.&lt;br /&gt;
&lt;br /&gt;
[[Image:vm0001-dev_ping_live-migration-test_03.png|thumb|700px|center|Results of the ping on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0001-dev&amp;lt;/span&amp;gt; post live migration.]]&lt;br /&gt;
&lt;br /&gt;
Wonderful! Now let&#039;s live migrate &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0002-web&amp;lt;/span&amp;gt; to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
clusvcadm -M vm:vm0002-web -m an-node02.alteeve.com&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Trying to migrate vm:vm0002-web to an-node02.alteeve.com...Success&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Again, check the new status of &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-cluster-A @ Sat Dec 31 14:17:35 2011&lt;br /&gt;
Member Status: Quorate&lt;br /&gt;
&lt;br /&gt;
 Member Name                             ID   Status&lt;br /&gt;
 ------ ----                             ---- ------&lt;br /&gt;
 an-node01.alteeve.com                       1 Online, rgmanager&lt;br /&gt;
 an-node02.alteeve.com                       2 Online, Local, rgmanager&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State         &lt;br /&gt;
 ------- ----                   ----- ------                   -----         &lt;br /&gt;
 service:storage_an01           an-node01.alteeve.com          started       &lt;br /&gt;
 service:storage_an02           an-node02.alteeve.com          started       &lt;br /&gt;
 vm:vm0001-dev                  an-node02.alteeve.com          started       &lt;br /&gt;
 vm:vm0002-web                  an-node02.alteeve.com          started       &lt;br /&gt;
 vm:vm0003-db                   an-node02.alteeve.com          started       &lt;br /&gt;
 vm:vm0004-ms                   an-node02.alteeve.com          started       &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can see now that all four VMs are running on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt;! This is possible because of our careful planning of the VM resources earlier. This will mean more load on the host node&#039;s CPU, so things might not be as fast as we would like, but all services are on-line!&lt;br /&gt;
&lt;br /&gt;
=== Withdraw an-node01 From The Cluster ===&lt;br /&gt;
&lt;br /&gt;
So imagine now that we need to do some work on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;, like replace a bad network card or add some RAM. We&#039;ve moved the VMs off, so now the only remaining service is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;service:storage_an01&amp;lt;/span&amp;gt;. We don&#039;t want to manually disable this service, because if we did, the service would not automatically start when the node rejoined the cluster. So we&#039;re going to just stop &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; and let it disable the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;storage_an01&amp;lt;/span&amp;gt; service.&lt;br /&gt;
&lt;br /&gt;
Check the state of the cluster;&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-cluster-A @ Sun Jan  1 16:11:56 2012&lt;br /&gt;
Member Status: Quorate&lt;br /&gt;
&lt;br /&gt;
 Member Name                             ID   Status&lt;br /&gt;
 ------ ----                             ---- ------&lt;br /&gt;
 an-node01.alteeve.com                       1 Online, Local, rgmanager&lt;br /&gt;
 an-node02.alteeve.com                       2 Online, rgmanager&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State         &lt;br /&gt;
 ------- ----                   ----- ------                   -----         &lt;br /&gt;
 service:storage_an01           an-node01.alteeve.com          started       &lt;br /&gt;
 service:storage_an02           an-node02.alteeve.com          started       &lt;br /&gt;
 vm:vm0001-dev                  an-node02.alteeve.com          started       &lt;br /&gt;
 vm:vm0002-web                  an-node02.alteeve.com          started       &lt;br /&gt;
 vm:vm0003-db                   an-node02.alteeve.com          started       &lt;br /&gt;
 vm:vm0004-ms                   an-node02.alteeve.com          started       &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Just as we expect, so now we will stop &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt;, then stop &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
On &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;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 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 Service Manager:                          [  OK  ]&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/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;
   Leaving fence domain...                                 [  OK  ]&lt;br /&gt;
   Stopping gfs_controld...                                [  OK  ]&lt;br /&gt;
   Stopping dlm_controld...                                [  OK  ]&lt;br /&gt;
   Stopping fenced...                                      [  OK  ]&lt;br /&gt;
   Stopping cman...                                        [  OK  ]&lt;br /&gt;
   Waiting for corosync to shutdown:                       [  OK  ]&lt;br /&gt;
   Unloading kernel modules...                             [  OK  ]&lt;br /&gt;
   Unmounting configfs...                                  [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checking on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt;, we can see that all four VMs are running fine and that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt; is gone.&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-cluster-A @ Sun Jan  1 16:13:23 2012&lt;br /&gt;
Member Status: Quorate&lt;br /&gt;
&lt;br /&gt;
 Member Name                             ID   Status&lt;br /&gt;
 ------ ----                             ---- ------&lt;br /&gt;
 an-node01.alteeve.com                       1 Offline&lt;br /&gt;
 an-node02.alteeve.com                       2 Online, Local, rgmanager&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State         &lt;br /&gt;
 ------- ----                   ----- ------                   -----         &lt;br /&gt;
 service:storage_an01           (an-node01.alteeve.com)        stopped       &lt;br /&gt;
 service:storage_an02           an-node02.alteeve.com          started       &lt;br /&gt;
 vm:vm0001-dev                  an-node02.alteeve.com          started       &lt;br /&gt;
 vm:vm0002-web                  an-node02.alteeve.com          started       &lt;br /&gt;
 vm:vm0003-db                   an-node02.alteeve.com          started       &lt;br /&gt;
 vm:vm0004-ms                   an-node02.alteeve.com          started       &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Test passed!&lt;br /&gt;
&lt;br /&gt;
You can now power off and restart &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Rejoining an-node01 To The Cluster ===&lt;br /&gt;
&lt;br /&gt;
If you haven&#039;t already, reboot &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;. As we set earlier, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; will start automatically. The easiest thing to do for this test is to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;watch clustat&amp;lt;/span&amp;gt; on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt;. If all goes well, you should see &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt; rejoin the cluster automatically.&lt;br /&gt;
&lt;br /&gt;
Connected to cluster;&lt;br /&gt;
&lt;br /&gt;
[[Image:2nrhkct_automatic-reconnect-an-node01_01.png|thumb|700px|center|Rebooting &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;, while &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt; hosts all four VMs.]]&lt;br /&gt;
&lt;br /&gt;
Storage coming on-line;&lt;br /&gt;
&lt;br /&gt;
[[Image:2nrhkct_automatic-reconnect-an-node01_02.png|thumb|700px|center|Storage coming up on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;.]]&lt;br /&gt;
&lt;br /&gt;
Back in business!&lt;br /&gt;
&lt;br /&gt;
[[Image:2nrhkct_automatic-reconnect-an-node01_03.png|thumb|700px|center|Back in business!]]&lt;br /&gt;
&lt;br /&gt;
You should be able to log back into &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt; and see that everything is back on-line. DRBD should be &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;UpToDate&amp;lt;/span&amp;gt;, or be in the process of synchronizing. &lt;br /&gt;
&lt;br /&gt;
{{warning|1=Never migrate a VM to a node until its underlying DRBD resource is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;UpToDate&amp;lt;/span&amp;gt;! If the sync source node (the one that is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;UpToDate&amp;lt;/span&amp;gt;) goes down, DRBD will drop the resource to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Secondary&amp;lt;/span&amp;gt;, making it inaccessible to the node and crashing the VM.}}&lt;br /&gt;
&lt;br /&gt;
=== Migrating vm0001-dev And vm0002-web Back To an-node01 ===&lt;br /&gt;
&lt;br /&gt;
If we were putting the cluster back into its normal state, all that would be left to do is to migrate &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;&#039;s VMs back. So let&#039;s do that. &lt;br /&gt;
&lt;br /&gt;
As always, start with a check of the current cluster status.&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-cluster-A @ Sun Jan  1 16:31:06 2012&lt;br /&gt;
Member Status: Quorate&lt;br /&gt;
&lt;br /&gt;
 Member Name                             ID   Status&lt;br /&gt;
 ------ ----                             ---- ------&lt;br /&gt;
 an-node01.alteeve.com                       1 Online, Local, rgmanager&lt;br /&gt;
 an-node02.alteeve.com                       2 Online, rgmanager&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State         &lt;br /&gt;
 ------- ----                   ----- ------                   -----         &lt;br /&gt;
 service:storage_an01           an-node01.alteeve.com          started       &lt;br /&gt;
 service:storage_an02           an-node02.alteeve.com          started       &lt;br /&gt;
 vm:vm0001-dev                  an-node02.alteeve.com          started       &lt;br /&gt;
 vm:vm0002-web                  an-node02.alteeve.com          started       &lt;br /&gt;
 vm:vm0003-db                   an-node02.alteeve.com          started       &lt;br /&gt;
 vm:vm0004-ms                   an-node02.alteeve.com          started       &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now confirm that the underlying storage is ready. Remember that DRBD resource &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;r1&amp;lt;/span&amp;gt; backs the VMs used by the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an01-vg0&amp;lt;/span&amp;gt; volume groups.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
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;
version: 8.3.12 (api:88/proto:86-96)&lt;br /&gt;
GIT-hash: e2a8ef4656be026bbae540305fcb998a5991090f build by dag@Build64R6, 2011-11-20 10:57:03&lt;br /&gt;
 0: cs:Connected ro:Primary/Primary ds:UpToDate/UpToDate C r-----&lt;br /&gt;
    ns:0 nr:0 dw:0 dr:12552 al:0 bm:0 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:0 nr:2428 dw:2428 dr:9776 al:0 bm:4 lo:0 pe:0 ua:0 ap:0 ep:1 wo:f oos:0&lt;br /&gt;
 2: cs:Connected ro:Primary/Primary ds:UpToDate/UpToDate C r-----&lt;br /&gt;
    ns:0 nr:510 dw:510 dr:9744 al:0 bm:4 lo:0 pe:0 ua:0 ap:0 ep:1 wo:f oos:0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
All systems ready; Let&#039;s migrate &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0001-dev&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0002-web&amp;lt;/span&amp;gt; now.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
clusvcadm -M vm:vm0001-dev -m an-node01.alteeve.com&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Trying to migrate vm:vm0001-dev to an-node01.alteeve.com...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 -M vm:vm0002-web -m an-node01.alteeve.com&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Trying to migrate vm:vm0002-web to an-node01.alteeve.com...Success&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check the new status;&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-cluster-A @ Sun Jan  1 16:32:11 2012&lt;br /&gt;
Member Status: Quorate&lt;br /&gt;
&lt;br /&gt;
 Member Name                             ID   Status&lt;br /&gt;
 ------ ----                             ---- ------&lt;br /&gt;
 an-node01.alteeve.com                       1 Online, Local, rgmanager&lt;br /&gt;
 an-node02.alteeve.com                       2 Online, rgmanager&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State         &lt;br /&gt;
 ------- ----                   ----- ------                   -----         &lt;br /&gt;
 service:storage_an01           an-node01.alteeve.com          started       &lt;br /&gt;
 service:storage_an02           an-node02.alteeve.com          started       &lt;br /&gt;
 vm:vm0001-dev                  an-node01.alteeve.com          started       &lt;br /&gt;
 vm:vm0002-web                  an-node01.alteeve.com          started       &lt;br /&gt;
 vm:vm0003-db                   an-node02.alteeve.com          started       &lt;br /&gt;
 vm:vm0004-ms                   an-node02.alteeve.com          started       &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With that, the cluster is back in business!&lt;br /&gt;
&lt;br /&gt;
=== Live Migration - vm0003-db And vm0004-ms To an-node01 ===&lt;br /&gt;
&lt;br /&gt;
Let&#039;s start the process of taking &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt; out of the cluster. The first step is to move &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0003-db&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0004-ms&amp;lt;/span&amp;gt; over to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;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-cluster-A @ Sun Jan  1 16:42:10 2012&lt;br /&gt;
Member Status: Quorate&lt;br /&gt;
&lt;br /&gt;
 Member Name                             ID   Status&lt;br /&gt;
 ------ ----                             ---- ------&lt;br /&gt;
 an-node01.alteeve.com                       1 Online, Local, rgmanager&lt;br /&gt;
 an-node02.alteeve.com                       2 Online, rgmanager&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State         &lt;br /&gt;
 ------- ----                   ----- ------                   -----         &lt;br /&gt;
 service:storage_an01           an-node01.alteeve.com          started       &lt;br /&gt;
 service:storage_an02           an-node02.alteeve.com          started       &lt;br /&gt;
 vm:vm0001-dev                  an-node01.alteeve.com          started       &lt;br /&gt;
 vm:vm0002-web                  an-node01.alteeve.com          started       &lt;br /&gt;
 vm:vm0003-db                   an-node02.alteeve.com          started       &lt;br /&gt;
 vm:vm0004-ms                   an-node02.alteeve.com          started       &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Ready to migrate.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
clusvcadm -M vm:vm0003-db -m an-node01.alteeve.com&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Trying to migrate vm:vm0003-db to an-node01.alteeve.com...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 -M vm:vm0004-ms -m an-node01.alteeve.com&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Trying to migrate vm:vm0004-ms to an-node01.alteeve.com...Success&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Confirm;&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-cluster-A @ Sun Jan  1 16:42:42 2012&lt;br /&gt;
Member Status: Quorate&lt;br /&gt;
&lt;br /&gt;
 Member Name                             ID   Status&lt;br /&gt;
 ------ ----                             ---- ------&lt;br /&gt;
 an-node01.alteeve.com                       1 Online, Local, rgmanager&lt;br /&gt;
 an-node02.alteeve.com                       2 Online, rgmanager&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State         &lt;br /&gt;
 ------- ----                   ----- ------                   -----         &lt;br /&gt;
 service:storage_an01           an-node01.alteeve.com          started       &lt;br /&gt;
 service:storage_an02           an-node02.alteeve.com          started       &lt;br /&gt;
 vm:vm0001-dev                  an-node01.alteeve.com          started       &lt;br /&gt;
 vm:vm0002-web                  an-node01.alteeve.com          started       &lt;br /&gt;
 vm:vm0003-db                   an-node01.alteeve.com          started       &lt;br /&gt;
 vm:vm0004-ms                   an-node01.alteeve.com          started       &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Done!&lt;br /&gt;
&lt;br /&gt;
=== Withdraw an-node02 From The Cluster ===&lt;br /&gt;
&lt;br /&gt;
Double-check that all the VMs are off of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt; prior to withdrawal.&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-cluster-A @ Sun Jan  1 16:45:30 2012&lt;br /&gt;
Member Status: Quorate&lt;br /&gt;
&lt;br /&gt;
 Member Name                             ID   Status&lt;br /&gt;
 ------ ----                             ---- ------&lt;br /&gt;
 an-node01.alteeve.com                       1 Online, Local, rgmanager&lt;br /&gt;
 an-node02.alteeve.com                       2 Online, rgmanager&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State         &lt;br /&gt;
 ------- ----                   ----- ------                   -----         &lt;br /&gt;
 service:storage_an01           an-node01.alteeve.com          started       &lt;br /&gt;
 service:storage_an02           an-node02.alteeve.com          started       &lt;br /&gt;
 vm:vm0001-dev                  an-node01.alteeve.com          started       &lt;br /&gt;
 vm:vm0002-web                  an-node01.alteeve.com          started       &lt;br /&gt;
 vm:vm0003-db                   an-node01.alteeve.com          started       &lt;br /&gt;
 vm:vm0004-ms                   an-node01.alteeve.com          started       &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As before, we &#039;&#039;&#039;will not&#039;&#039;&#039; disable the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;storage_an02&amp;lt;/span&amp;gt; service. If we did, the service would not automatically restart when the node rejoined the cluster.&lt;br /&gt;
&lt;br /&gt;
So now that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt; is hosting all of the VMs and is running independently. Now we can stop &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;cman&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
On &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;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 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 Service Manager:                          [  OK  ]&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/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;
   Leaving fence domain...                                 [  OK  ]&lt;br /&gt;
   Stopping gfs_controld...                                [  OK  ]&lt;br /&gt;
   Stopping dlm_controld...                                [  OK  ]&lt;br /&gt;
   Stopping fenced...                                      [  OK  ]&lt;br /&gt;
   Stopping cman...                                        [  OK  ]&lt;br /&gt;
   Waiting for corosync to shutdown:                       [  OK  ]&lt;br /&gt;
   Unloading kernel modules...                             [  OK  ]&lt;br /&gt;
   Unmounting configfs...                                  [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Confirm;&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-cluster-A @ Sun Jan  1 16:49:14 2012&lt;br /&gt;
Member Status: Quorate&lt;br /&gt;
&lt;br /&gt;
 Member Name                             ID   Status&lt;br /&gt;
 ------ ----                             ---- ------&lt;br /&gt;
 an-node01.alteeve.com                       1 Online, Local, rgmanager&lt;br /&gt;
 an-node02.alteeve.com                       2 Offline&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State&lt;br /&gt;
 ------- ----                   ----- ------                   -----&lt;br /&gt;
 service:storage_an01           an-node01.alteeve.com          started&lt;br /&gt;
 service:storage_an02           (an-node02.alteeve.com)        stopped&lt;br /&gt;
 vm:vm0001-dev                  an-node01.alteeve.com          started&lt;br /&gt;
 vm:vm0002-web                  an-node01.alteeve.com          started&lt;br /&gt;
 vm:vm0003-db                   an-node01.alteeve.com          started&lt;br /&gt;
 vm:vm0004-ms                   an-node01.alteeve.com          started&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Done! We can now shut down and reboot &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt; entirely.&lt;br /&gt;
&lt;br /&gt;
=== Rejoining an-node02 To The Cluster ===&lt;br /&gt;
&lt;br /&gt;
Exactly as we did with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;, we will reboot &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt;. The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; services should start automatically, so once again, we will just &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;watch clustat&amp;lt;/span&amp;gt; on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;. If all goes well, you should see &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt; rejoin the cluster automatically.&lt;br /&gt;
&lt;br /&gt;
Connected to cluster;&lt;br /&gt;
&lt;br /&gt;
[[Image:2nrhkct_automatic-reconnect-an-node02_01.png|thumb|700px|center|Rebooting &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt;, while &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt; hosts all four VMs.]]&lt;br /&gt;
&lt;br /&gt;
Storage coming on-line;&lt;br /&gt;
&lt;br /&gt;
[[Image:2nrhkct_automatic-reconnect-an-node02_02.png|thumb|700px|center|Storage coming up on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt;.]]&lt;br /&gt;
&lt;br /&gt;
Back in business!&lt;br /&gt;
&lt;br /&gt;
[[Image:2nrhkct_automatic-reconnect-an-node02_03.png|thumb|700px|center|Back in business!]]&lt;br /&gt;
&lt;br /&gt;
You should be able to log back into &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt; and see that everything is back on-line. DRBD should be &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;UpToDate&amp;lt;/span&amp;gt;, or be in the process of synchronizing.&lt;br /&gt;
&lt;br /&gt;
{{warning|1=Again; Never migrate a VM to a node until its underlying DRBD resource is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;UpToDate&amp;lt;/span&amp;gt;! If the sync source node (the one that is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;UpToDate&amp;lt;/span&amp;gt;) goes down, DRBD will drop the resource to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Secondary&amp;lt;/span&amp;gt;, making it inaccessible to the node and crashing the VM.}}&lt;br /&gt;
&lt;br /&gt;
=== Migrating vm0003-db And vm0004-ms Back To an-node02 ===&lt;br /&gt;
&lt;br /&gt;
The last step to restore the cluster to its ideal state is to migrate &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0003-db&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0004-ms&amp;lt;/span&amp;gt; back to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
As always, start with a check of the current cluster status.&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-cluster-A @ Sun Jan  1 16:57:19 2012&lt;br /&gt;
Member Status: Quorate&lt;br /&gt;
&lt;br /&gt;
 Member Name                             ID   Status&lt;br /&gt;
 ------ ----                             ---- ------&lt;br /&gt;
 an-node01.alteeve.com                       1 Online, rgmanager&lt;br /&gt;
 an-node02.alteeve.com                       2 Online, Local, rgmanager&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State         &lt;br /&gt;
 ------- ----                   ----- ------                   -----         &lt;br /&gt;
 service:storage_an01           an-node01.alteeve.com          started       &lt;br /&gt;
 service:storage_an02           an-node02.alteeve.com          started       &lt;br /&gt;
 vm:vm0001-dev                  an-node01.alteeve.com          started       &lt;br /&gt;
 vm:vm0002-web                  an-node01.alteeve.com          started       &lt;br /&gt;
 vm:vm0003-db                   an-node01.alteeve.com          started       &lt;br /&gt;
 vm:vm0004-ms                   an-node01.alteeve.com          started       &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now confirm that the underlying storage is ready. Remember that DRBD resource &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;r2&amp;lt;/span&amp;gt; backs the VMs used by the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an02-vg0&amp;lt;/span&amp;gt; volume groups.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
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;
version: 8.3.12 (api:88/proto:86-96)&lt;br /&gt;
GIT-hash: e2a8ef4656be026bbae540305fcb998a5991090f build by dag@Build64R6, 2011-11-20 10:57:03&lt;br /&gt;
 0: cs:Connected ro:Primary/Primary ds:UpToDate/UpToDate C r-----&lt;br /&gt;
    ns:0 nr:0 dw:0 dr:8788 al:0 bm:0 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:0 nr:376 dw:376 dr:5876 al:0 bm:7 lo:0 pe:0 ua:0 ap:0 ep:1 wo:f oos:0&lt;br /&gt;
 2: cs:Connected ro:Primary/Primary ds:UpToDate/UpToDate C r-----&lt;br /&gt;
    ns:0 nr:671 dw:671 dr:5844 al:0 bm:16 lo:0 pe:0 ua:0 ap:0 ep:1 wo:f oos:0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
All systems ready; Let&#039;s migrate &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0003-db&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0004-ms&amp;lt;/span&amp;gt; now.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
clusvcadm -M vm:vm0003-db -m an-node02.alteeve.com&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Trying to migrate vm:vm0003-db to an-node02.alteeve.com...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 -M vm:vm0004-ms -m an-node02.alteeve.com&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Trying to migrate vm:vm0004-ms to an-node02.alteeve.com...Success&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check the new status;&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-cluster-A @ Sun Jan  1 16:59:22 2012&lt;br /&gt;
Member Status: Quorate&lt;br /&gt;
&lt;br /&gt;
 Member Name                             ID   Status&lt;br /&gt;
 ------ ----                             ---- ------&lt;br /&gt;
 an-node01.alteeve.com                       1 Online, rgmanager&lt;br /&gt;
 an-node02.alteeve.com                       2 Online, Local, rgmanager&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State         &lt;br /&gt;
 ------- ----                   ----- ------                   -----         &lt;br /&gt;
 service:storage_an01           an-node01.alteeve.com          started       &lt;br /&gt;
 service:storage_an02           an-node02.alteeve.com          started       &lt;br /&gt;
 vm:vm0001-dev                  an-node01.alteeve.com          started       &lt;br /&gt;
 vm:vm0002-web                  an-node01.alteeve.com          started       &lt;br /&gt;
 vm:vm0003-db                   an-node02.alteeve.com          started       &lt;br /&gt;
 vm:vm0004-ms                   an-node02.alteeve.com          started       &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
All controlled migration, withdrawal and re-joining tests completed!&lt;br /&gt;
&lt;br /&gt;
== Uncontrolled VM Migration and Node Failure ==&lt;br /&gt;
&lt;br /&gt;
This test will be more violent than the previous tests. Here we will test failing the VMs and ensuring that the cluster will recover the VMs by restarting them on the hosts. We will repeatedly fail the VMs three times within ten minutes to ensure that the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;relocate&amp;lt;/span&amp;gt; policy kicks in, as we expect it to.&lt;br /&gt;
&lt;br /&gt;
Once we complete the VM failure testing, we will fail and recover both nodes, one at a time of course, and rejoin them to the cluster. This will confirm that the VMs recover on the surviving node.&lt;br /&gt;
&lt;br /&gt;
The tests will be;&lt;br /&gt;
&lt;br /&gt;
* Crash all four VMs three times. The failures will be triggered by using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virsh destroy &amp;lt;vm&amp;gt;&amp;lt;/span&amp;gt; on the current host node.&lt;br /&gt;
* After each crash, we will confirm that the VM came back on-line before crashing it again.&lt;br /&gt;
* With all of the VMs tested to recover properly, we will live-migrate them back to their designated host nodes.&lt;br /&gt;
* Once the cluster is back into its ideal state, we will crash &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;. Within a few seconds, it should be [[fenced]] and the lost VMs should restart on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt;. Once it rejoins the cluster and the VMs return to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;, we will repeat the test by failing &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Failure Testing vm0001-dev ===&lt;br /&gt;
&lt;br /&gt;
Confirm that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0001-dev&amp;lt;/span&amp;gt; is running on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;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-cluster-A @ Sun Jan  1 18:29:10 2012&lt;br /&gt;
Member Status: Quorate&lt;br /&gt;
&lt;br /&gt;
 Member Name                             ID   Status&lt;br /&gt;
 ------ ----                             ---- ------&lt;br /&gt;
 an-node01.alteeve.com                       1 Online, Local, rgmanager&lt;br /&gt;
 an-node02.alteeve.com                       2 Online, rgmanager&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State&lt;br /&gt;
 ------- ----                   ----- ------                   -----&lt;br /&gt;
 service:storage_an01           an-node01.alteeve.com          started&lt;br /&gt;
 service:storage_an02           an-node02.alteeve.com          started&lt;br /&gt;
 vm:vm0001-dev                  an-node01.alteeve.com          started&lt;br /&gt;
 vm:vm0002-web                  an-node01.alteeve.com          started&lt;br /&gt;
 vm:vm0003-db                   an-node02.alteeve.com          started&lt;br /&gt;
 vm:vm0004-ms                   an-node02.alteeve.com          started&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is, perfect. Now before I kill a VM, I like to start a ping against it. It acts both as an indication of when the node is back up and acts as a crude method of timing how long it took the VM to fully recover.&lt;br /&gt;
&lt;br /&gt;
{{note|1=If your VMs are isolated, as they are in this tutorial, you may have to run the ping from another VM or from your firewall.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ping 10.254.0.1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
PING 10.254.0.1 (10.254.0.1) 56(84) bytes of data.&lt;br /&gt;
64 bytes from 10.254.0.1: icmp_seq=1 ttl=64 time=0.737 ms&lt;br /&gt;
64 bytes from 10.254.0.1: icmp_seq=2 ttl=64 time=0.530 ms&lt;br /&gt;
64 bytes from 10.254.0.1: icmp_seq=3 ttl=64 time=0.589 ms&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-node01&amp;lt;/span&amp;gt;, forcefully shut down &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0001-dev&amp;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 destroy vm0001-dev&lt;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-dev destroyed&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Within a few seconds (10, maximum), the cluster will detect that the VM has failed and will restart it.&lt;br /&gt;
&lt;br /&gt;
[[Image:2nrhkct_failing-vm0001-dev_01.png|thumb|700px|center|Failure of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0001-dev&amp;lt;/span&amp;gt; detected by the cluster and restarted.]]&lt;br /&gt;
&lt;br /&gt;
We can see in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;&#039;s syslog that the failure was detected and automatically recovered.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Jan  1 18:38:25 an-node01 kernel: vbr2: port 2(vnet0) entering disabled state&lt;br /&gt;
Jan  1 18:38:25 an-node01 kernel: device vnet0 left promiscuous mode&lt;br /&gt;
Jan  1 18:38:25 an-node01 kernel: vbr2: port 2(vnet0) entering disabled state&lt;br /&gt;
Jan  1 18:38:27 an-node01 ntpd[2190]: Deleting interface #19 vnet0, fe80::fc54:ff:fe9b:3cf7#123, interface stats: received=0, sent=0, dropped=0, active_time=3058 secs&lt;br /&gt;
Jan  1 18:38:35 an-node01 rgmanager[2430]: status on vm &amp;quot;vm0001-dev&amp;quot; returned 7 (unspecified)&lt;br /&gt;
Jan  1 18:38:35 an-node01 rgmanager[2430]: Stopping service vm:vm0001-dev&lt;br /&gt;
Jan  1 18:38:36 an-node01 rgmanager[2430]: Service vm:vm0001-dev is recovering&lt;br /&gt;
Jan  1 18:38:36 an-node01 rgmanager[2430]: Recovering failed service vm:vm0001-dev&lt;br /&gt;
Jan  1 18:38:37 an-node01 kernel: device vnet0 entered promiscuous mode&lt;br /&gt;
Jan  1 18:38:37 an-node01 kernel: vbr2: port 2(vnet0) entering learning state&lt;br /&gt;
Jan  1 18:38:37 an-node01 rgmanager[2430]: Service vm:vm0001-dev started&lt;br /&gt;
Jan  1 18:38:39 an-node01 ntpd[2190]: Listening on interface #20 vnet0, fe80::fc54:ff:fe9b:3cf7#123 Enabled&lt;br /&gt;
Jan  1 18:38:49 an-node01 kernel: kvm: 12390: cpu0 unimplemented perfctr wrmsr: 0xc1 data 0xabcd&lt;br /&gt;
Jan  1 18:38:52 an-node01 kernel: vbr2: port 2(vnet0) entering forwarding state&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The first four entries are related to the VM&#039;s network being torn down after it was killed. The fifth through eighth lines show the detection and recovery of the node!&lt;br /&gt;
&lt;br /&gt;
Going back to the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ping&amp;lt;/span&amp;gt;, we can see that the VM was down for roughly 36 seconds (time between network loss and recovery, add a bit more time for all services to start.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
PING 10.254.0.1 (10.254.0.1) 56(84) bytes of data.&lt;br /&gt;
64 bytes from 10.254.0.1: icmp_seq=1 ttl=64 time=0.737 ms&lt;br /&gt;
64 bytes from 10.254.0.1: icmp_seq=2 ttl=64 time=0.530 ms&lt;br /&gt;
64 bytes from 10.254.0.1: icmp_seq=3 ttl=64 time=0.589 ms&lt;br /&gt;
64 bytes from 10.254.0.1: icmp_seq=4 ttl=64 time=0.589 ms&lt;br /&gt;
64 bytes from 10.254.0.1: icmp_seq=5 ttl=64 time=0.477 ms&lt;br /&gt;
64 bytes from 10.254.0.1: icmp_seq=6 ttl=64 time=0.482 ms&lt;br /&gt;
64 bytes from 10.254.0.1: icmp_seq=7 ttl=64 time=0.489 ms&lt;br /&gt;
64 bytes from 10.254.0.1: icmp_seq=8 ttl=64 time=0.495 ms&lt;br /&gt;
64 bytes from 10.254.0.1: icmp_seq=9 ttl=64 time=0.503 ms&lt;br /&gt;
64 bytes from 10.254.0.1: icmp_seq=10 ttl=64 time=0.513 ms&lt;br /&gt;
64 bytes from 10.254.0.1: icmp_seq=11 ttl=64 time=0.516 ms&lt;br /&gt;
64 bytes from 10.254.0.1: icmp_seq=12 ttl=64 time=0.524 ms&lt;br /&gt;
64 bytes from 10.254.0.1: icmp_seq=13 ttl=64 time=0.405 ms&lt;br /&gt;
64 bytes from 10.254.0.1: icmp_seq=14 ttl=64 time=0.536 ms&lt;br /&gt;
64 bytes from 10.254.0.1: icmp_seq=15 ttl=64 time=0.441 ms&lt;br /&gt;
64 bytes from 10.254.0.1: icmp_seq=16 ttl=64 time=0.552 ms&lt;br /&gt;
&lt;br /&gt;
# Node died here, 36 pings lost at ~1 ping/sec.&lt;br /&gt;
&lt;br /&gt;
64 bytes from 10.254.0.1: icmp_seq=52 ttl=64 time=0.816 ms&lt;br /&gt;
64 bytes from 10.254.0.1: icmp_seq=53 ttl=64 time=0.440 ms&lt;br /&gt;
64 bytes from 10.254.0.1: icmp_seq=54 ttl=64 time=0.354 ms&lt;br /&gt;
64 bytes from 10.254.0.1: icmp_seq=55 ttl=64 time=0.342 ms&lt;br /&gt;
64 bytes from 10.254.0.1: icmp_seq=56 ttl=64 time=0.446 ms&lt;br /&gt;
64 bytes from 10.254.0.1: icmp_seq=57 ttl=64 time=0.418 ms&lt;br /&gt;
64 bytes from 10.254.0.1: icmp_seq=58 ttl=64 time=0.441 ms&lt;br /&gt;
^C&lt;br /&gt;
--- 10.254.0.1 ping statistics ---&lt;br /&gt;
58 packets transmitted, 23 received, 60% packet loss, time 57949ms&lt;br /&gt;
rtt min/avg/max/mdev = 0.342/0.505/0.816/0.109 ms&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Not bad at all!&lt;br /&gt;
&lt;br /&gt;
Now let&#039;s kill it two more times and confirm that the third recovery happens on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt;. We&#039;ll use the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ping&amp;lt;/span&amp;gt; as an indicator of when the VM is back on-line before killing it the third time.&lt;br /&gt;
&lt;br /&gt;
Second failure;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
virsh destroy vm0001-dev&lt;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-dev destroyed&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checking syslog again;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Jan  1 18:45:07 an-node01 kernel: vbr2: port 2(vnet0) entering disabled state&lt;br /&gt;
Jan  1 18:45:07 an-node01 kernel: device vnet0 left promiscuous mode&lt;br /&gt;
Jan  1 18:45:07 an-node01 kernel: vbr2: port 2(vnet0) entering disabled state&lt;br /&gt;
Jan  1 18:45:09 an-node01 ntpd[2190]: Deleting interface #20 vnet0, fe80::fc54:ff:fe9b:3cf7#123, interface stats: received=0, sent=0, dropped=0, active_time=390 secs&lt;br /&gt;
Jan  1 18:45:46 an-node01 rgmanager[2430]: status on vm &amp;quot;vm0001-dev&amp;quot; returned 7 (unspecified)&lt;br /&gt;
Jan  1 18:45:46 an-node01 rgmanager[2430]: Stopping service vm:vm0001-dev&lt;br /&gt;
Jan  1 18:45:46 an-node01 rgmanager[2430]: Service vm:vm0001-dev is recovering&lt;br /&gt;
Jan  1 18:45:47 an-node01 rgmanager[2430]: Recovering failed service vm:vm0001-dev&lt;br /&gt;
Jan  1 18:45:47 an-node01 kernel: device vnet0 entered promiscuous mode&lt;br /&gt;
Jan  1 18:45:47 an-node01 kernel: vbr2: port 2(vnet0) entering learning state&lt;br /&gt;
Jan  1 18:45:47 an-node01 rgmanager[2430]: Service vm:vm0001-dev started&lt;br /&gt;
Jan  1 18:45:50 an-node01 ntpd[2190]: Listening on interface #21 vnet0, fe80::fc54:ff:fe9b:3cf7#123 Enabled&lt;br /&gt;
Jan  1 18:45:59 an-node01 kernel: kvm: 17874: cpu0 unimplemented perfctr wrmsr: 0xc1 data 0xabcd&lt;br /&gt;
Jan  1 18:46:02 an-node01 kernel: vbr2: port 2(vnet0) entering forwarding state&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can see that the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0001-dev&amp;lt;/span&amp;gt; VM is still on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;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-cluster-A @ Sun Jan  1 18:47:01 2012&lt;br /&gt;
Member Status: Quorate&lt;br /&gt;
&lt;br /&gt;
 Member Name                             ID   Status&lt;br /&gt;
 ------ ----                             ---- ------&lt;br /&gt;
 an-node01.alteeve.com                       1 Online, rgmanager&lt;br /&gt;
 an-node02.alteeve.com                       2 Online, Local, rgmanager&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State&lt;br /&gt;
 ------- ----                   ----- ------                   -----&lt;br /&gt;
 service:storage_an01           an-node01.alteeve.com          started&lt;br /&gt;
 service:storage_an02           an-node02.alteeve.com          started&lt;br /&gt;
 vm:vm0001-dev                  an-node01.alteeve.com          started&lt;br /&gt;
 vm:vm0002-web                  an-node01.alteeve.com          started&lt;br /&gt;
 vm:vm0003-db                   an-node02.alteeve.com          started&lt;br /&gt;
 vm:vm0004-ms                   an-node02.alteeve.com          started&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now the third crash. This time it should come up on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;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 destroy vm0001-dev&lt;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-dev destroyed&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checking &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;&#039;s syslog again, we&#039;ll see something different.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Jan  1 18:47:26 an-node01 kernel: vbr2: port 2(vnet0) entering disabled state&lt;br /&gt;
Jan  1 18:47:26 an-node01 kernel: device vnet0 left promiscuous mode&lt;br /&gt;
Jan  1 18:47:26 an-node01 kernel: vbr2: port 2(vnet0) entering disabled state&lt;br /&gt;
Jan  1 18:47:27 an-node01 ntpd[2190]: Deleting interface #21 vnet0, fe80::fc54:ff:fe9b:3cf7#123, interface stats: received=0, sent=0, dropped=0, active_time=97 secs&lt;br /&gt;
Jan  1 18:47:46 an-node01 rgmanager[2430]: status on vm &amp;quot;vm0001-dev&amp;quot; returned 7 (unspecified)&lt;br /&gt;
Jan  1 18:47:46 an-node01 rgmanager[2430]: Stopping service vm:vm0001-dev&lt;br /&gt;
Jan  1 18:47:46 an-node01 rgmanager[2430]: Service vm:vm0001-dev is recovering&lt;br /&gt;
Jan  1 18:47:46 an-node01 rgmanager[2430]: Restart threshold for vm:vm0001-dev exceeded; attempting to relocate&lt;br /&gt;
Jan  1 18:47:47 an-node01 rgmanager[2430]: Service vm:vm0001-dev is now running on member 2&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The difference is the &amp;quot;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Restart threshold for vm:vm0001-dev exceeded; attempting to relocate&amp;lt;/span&amp;gt;&amp;quot; line. Indeed, if we check &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clustat&amp;lt;/span&amp;gt;, we will in fact see it running on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;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-cluster-A @ Sun Jan  1 18:49:38 2012&lt;br /&gt;
Member Status: Quorate&lt;br /&gt;
&lt;br /&gt;
 Member Name                             ID   Status&lt;br /&gt;
 ------ ----                             ---- ------&lt;br /&gt;
 an-node01.alteeve.com                       1 Online, rgmanager&lt;br /&gt;
 an-node02.alteeve.com                       2 Online, Local, rgmanager&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State&lt;br /&gt;
 ------- ----                   ----- ------                   -----&lt;br /&gt;
 service:storage_an01           an-node01.alteeve.com          started&lt;br /&gt;
 service:storage_an02           an-node02.alteeve.com          started&lt;br /&gt;
 vm:vm0001-dev                  an-node02.alteeve.com          started&lt;br /&gt;
 vm:vm0002-web                  an-node01.alteeve.com          started&lt;br /&gt;
 vm:vm0003-db                   an-node02.alteeve.com          started&lt;br /&gt;
 vm:vm0004-ms                   an-node02.alteeve.com          started&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Success!&lt;br /&gt;
&lt;br /&gt;
This test is complete, so we&#039;ll finish my migrating the VM back to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
clusvcadm -M vm:vm0001-dev -m an-node01.alteeve.com&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Trying to migrate vm:vm0001-dev to an-node01.alteeve.com...Success&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As always, confirm.&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-cluster-A @ Sun Jan  1 18:51:05 2012&lt;br /&gt;
Member Status: Quorate&lt;br /&gt;
&lt;br /&gt;
 Member Name                             ID   Status&lt;br /&gt;
 ------ ----                             ---- ------&lt;br /&gt;
 an-node01.alteeve.com                       1 Online, rgmanager&lt;br /&gt;
 an-node02.alteeve.com                       2 Online, Local, rgmanager&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State&lt;br /&gt;
 ------- ----                   ----- ------                   -----&lt;br /&gt;
 service:storage_an01           an-node01.alteeve.com          started&lt;br /&gt;
 service:storage_an02           an-node02.alteeve.com          started&lt;br /&gt;
 vm:vm0001-dev                  an-node01.alteeve.com          started&lt;br /&gt;
 vm:vm0002-web                  an-node01.alteeve.com          started&lt;br /&gt;
 vm:vm0003-db                   an-node02.alteeve.com          started&lt;br /&gt;
 vm:vm0004-ms                   an-node02.alteeve.com          started&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Excellent.&lt;br /&gt;
&lt;br /&gt;
=== Failure Testing vm0002-web ===&lt;br /&gt;
&lt;br /&gt;
We&#039;ll go through the same process here as we just did with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0001-dev&amp;lt;/span&amp;gt;, but we won&#039;t cover all the details here as much. After each crash of the VM, we&#039;ll check &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clustat&amp;lt;/span&amp;gt; and look at the syslog on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;. Not shown here is a background ping running to indicate when the VM is back up enough to crash again.&lt;br /&gt;
&lt;br /&gt;
Confirm that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0002-web&amp;lt;/span&amp;gt; is on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;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-cluster-A @ Sun Jan  1 19:06:21 2012&lt;br /&gt;
Member Status: Quorate&lt;br /&gt;
&lt;br /&gt;
 Member Name                             ID   Status&lt;br /&gt;
 ------ ----                             ---- ------&lt;br /&gt;
 an-node01.alteeve.com                       1 Online, rgmanager&lt;br /&gt;
 an-node02.alteeve.com                       2 Online, Local, rgmanager&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State&lt;br /&gt;
 ------- ----                   ----- ------                   -----&lt;br /&gt;
 service:storage_an01           an-node01.alteeve.com          started&lt;br /&gt;
 service:storage_an02           an-node02.alteeve.com          started&lt;br /&gt;
 vm:vm0001-dev                  an-node01.alteeve.com          started&lt;br /&gt;
 vm:vm0002-web                  an-node01.alteeve.com          started&lt;br /&gt;
 vm:vm0003-db                   an-node02.alteeve.com          started&lt;br /&gt;
 vm:vm0004-ms                   an-node02.alteeve.com          started&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Good, we&#039;re ready. On &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;, kill the VM.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
virsh destroy vm0002-web&lt;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-web destroyed&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As we expect, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt; restarts the VM within a few seconds.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Jan  1 19:07:16 an-node01 kernel: vbr2: port 3(vnet1) entering disabled state&lt;br /&gt;
Jan  1 19:07:16 an-node01 kernel: device vnet1 left promiscuous mode&lt;br /&gt;
Jan  1 19:07:16 an-node01 kernel: vbr2: port 3(vnet1) entering disabled state&lt;br /&gt;
Jan  1 19:07:18 an-node01 ntpd[2190]: Deleting interface #11 vnet1, fe80::fc54:ff:fe65:3960#123, interface stats: received=0, sent=0, dropped=0, active_time=9315 secs&lt;br /&gt;
Jan  1 19:07:27 an-node01 rgmanager[2430]: status on vm &amp;quot;vm0002-web&amp;quot; returned 7 (unspecified)&lt;br /&gt;
Jan  1 19:07:27 an-node01 rgmanager[2430]: Stopping service vm:vm0002-web&lt;br /&gt;
Jan  1 19:07:27 an-node01 rgmanager[2430]: Service vm:vm0002-web is recovering&lt;br /&gt;
Jan  1 19:07:28 an-node01 rgmanager[2430]: Recovering failed service vm:vm0002-web&lt;br /&gt;
Jan  1 19:07:28 an-node01 kernel: device vnet1 entered promiscuous mode&lt;br /&gt;
Jan  1 19:07:28 an-node01 kernel: vbr2: port 3(vnet1) entering learning state&lt;br /&gt;
Jan  1 19:07:29 an-node01 rgmanager[2430]: Service vm:vm0002-web started&lt;br /&gt;
Jan  1 19:07:31 an-node01 ntpd[2190]: Listening on interface #23 vnet1, fe80::fc54:ff:fe65:3960#123 Enabled&lt;br /&gt;
Jan  1 19:07:38 an-node01 kernel: kvm: 1994: cpu0 unimplemented perfctr wrmsr: 0xc1 data 0xabcd&lt;br /&gt;
Jan  1 19:07:43 an-node01 kernel: vbr2: port 3(vnet1) entering forwarding state&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checking &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clustat&amp;lt;/span&amp;gt;, I can see the VM is back on-line.&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-cluster-A @ Sun Jan  1 19:09:03 2012&lt;br /&gt;
Member Status: Quorate&lt;br /&gt;
&lt;br /&gt;
 Member Name                             ID   Status&lt;br /&gt;
 ------ ----                             ---- ------&lt;br /&gt;
 an-node01.alteeve.com                       1 Online, rgmanager&lt;br /&gt;
 an-node02.alteeve.com                       2 Online, Local, rgmanager&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State&lt;br /&gt;
 ------- ----                   ----- ------                   -----&lt;br /&gt;
 service:storage_an01           an-node01.alteeve.com          started&lt;br /&gt;
 service:storage_an02           an-node02.alteeve.com          started&lt;br /&gt;
 vm:vm0001-dev                  an-node01.alteeve.com          started&lt;br /&gt;
 vm:vm0002-web                  an-node01.alteeve.com          started&lt;br /&gt;
 vm:vm0003-db                   an-node02.alteeve.com          started&lt;br /&gt;
 vm:vm0004-ms                   an-node02.alteeve.com          started&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Let&#039;s kill it for the second time.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
virsh destroy vm0002-web&lt;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-web destroyed&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can again see that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt; recovered it locally.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Jan  1 19:12:08 an-node01 kernel: vbr2: port 3(vnet1) entering disabled state&lt;br /&gt;
Jan  1 19:12:08 an-node01 kernel: device vnet1 left promiscuous mode&lt;br /&gt;
Jan  1 19:12:08 an-node01 kernel: vbr2: port 3(vnet1) entering disabled state&lt;br /&gt;
Jan  1 19:12:10 an-node01 ntpd[2190]: Deleting interface #23 vnet1, fe80::fc54:ff:fe65:3960#123, interface stats: received=0, sent=0, dropped=0, active_time=279 secs&lt;br /&gt;
Jan  1 19:12:17 an-node01 rgmanager[2430]: status on vm &amp;quot;vm0002-web&amp;quot; returned 7 (unspecified)&lt;br /&gt;
Jan  1 19:12:17 an-node01 rgmanager[2430]: Stopping service vm:vm0002-web&lt;br /&gt;
Jan  1 19:12:18 an-node01 rgmanager[2430]: Service vm:vm0002-web is recovering&lt;br /&gt;
Jan  1 19:12:18 an-node01 rgmanager[2430]: Recovering failed service vm:vm0002-web&lt;br /&gt;
Jan  1 19:12:19 an-node01 kernel: device vnet1 entered promiscuous mode&lt;br /&gt;
Jan  1 19:12:19 an-node01 kernel: vbr2: port 3(vnet1) entering learning state&lt;br /&gt;
Jan  1 19:12:19 an-node01 rgmanager[2430]: Service vm:vm0002-web started&lt;br /&gt;
Jan  1 19:12:22 an-node01 ntpd[2190]: Listening on interface #24 vnet1, fe80::fc54:ff:fe65:3960#123 Enabled&lt;br /&gt;
Jan  1 19:12:28 an-node01 kernel: kvm: 6113: cpu0 unimplemented perfctr wrmsr: 0xc1 data 0xabcd&lt;br /&gt;
Jan  1 19:12:34 an-node01 kernel: vbr2: port 3(vnet1) entering forwarding state&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Confirm with &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-cluster-A @ Sun Jan  1 19:13:45 2012&lt;br /&gt;
Member Status: Quorate&lt;br /&gt;
&lt;br /&gt;
 Member Name                             ID   Status&lt;br /&gt;
 ------ ----                             ---- ------&lt;br /&gt;
 an-node01.alteeve.com                       1 Online, rgmanager&lt;br /&gt;
 an-node02.alteeve.com                       2 Online, Local, rgmanager&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State&lt;br /&gt;
 ------- ----                   ----- ------                   -----&lt;br /&gt;
 service:storage_an01           an-node01.alteeve.com          started&lt;br /&gt;
 service:storage_an02           an-node02.alteeve.com          started&lt;br /&gt;
 vm:vm0001-dev                  an-node01.alteeve.com          started&lt;br /&gt;
 vm:vm0002-web                  an-node01.alteeve.com          started&lt;br /&gt;
 vm:vm0003-db                   an-node02.alteeve.com          started&lt;br /&gt;
 vm:vm0004-ms                   an-node02.alteeve.com          started&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This time, it should recover on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;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 destroy vm0002-web&lt;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-web destroyed&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Looking in syslog, we can see the counter was tripped.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Jan  1 19:14:26 an-node01 kernel: vbr2: port 3(vnet1) entering disabled state&lt;br /&gt;
Jan  1 19:14:26 an-node01 kernel: device vnet1 left promiscuous mode&lt;br /&gt;
Jan  1 19:14:26 an-node01 kernel: vbr2: port 3(vnet1) entering disabled state&lt;br /&gt;
Jan  1 19:14:27 an-node01 rgmanager[2430]: status on vm &amp;quot;vm0002-web&amp;quot; returned 7 (unspecified)&lt;br /&gt;
Jan  1 19:14:27 an-node01 rgmanager[2430]: Stopping service vm:vm0002-web&lt;br /&gt;
Jan  1 19:14:28 an-node01 rgmanager[2430]: Service vm:vm0002-web is recovering&lt;br /&gt;
Jan  1 19:14:28 an-node01 rgmanager[2430]: Restart threshold for vm:vm0002-web exceeded; attempting to relocate&lt;br /&gt;
Jan  1 19:14:28 an-node01 ntpd[2190]: Deleting interface #24 vnet1, fe80::fc54:ff:fe65:3960#123, interface stats: received=0, sent=0, dropped=0, active_time=126 secs&lt;br /&gt;
Jan  1 19:14:29 an-node01 rgmanager[2430]: Service vm:vm0002-web is now running on member 2&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Indeed, this is confirmed with &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-cluster-A @ Sun Jan  1 19:15:57 2012&lt;br /&gt;
Member Status: Quorate&lt;br /&gt;
&lt;br /&gt;
 Member Name                             ID   Status&lt;br /&gt;
 ------ ----                             ---- ------&lt;br /&gt;
 an-node01.alteeve.com                       1 Online, rgmanager&lt;br /&gt;
 an-node02.alteeve.com                       2 Online, Local, rgmanager&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State&lt;br /&gt;
 ------- ----                   ----- ------                   -----&lt;br /&gt;
 service:storage_an01           an-node01.alteeve.com          started&lt;br /&gt;
 service:storage_an02           an-node02.alteeve.com          started&lt;br /&gt;
 vm:vm0001-dev                  an-node01.alteeve.com          started&lt;br /&gt;
 vm:vm0002-web                  an-node02.alteeve.com          started&lt;br /&gt;
 vm:vm0003-db                   an-node02.alteeve.com          started&lt;br /&gt;
 vm:vm0004-ms                   an-node02.alteeve.com          started&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Excellent, this test has passed as well! Now migrate the VM back and we&#039;ll be ready to test the third VM.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
clusvcadm -M vm:vm0002-web -m an-node01.alteeve.com&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Trying to migrate vm:vm0002-web to an-node01.alteeve.com...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;
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-cluster-A @ Sun Jan  1 19:17:41 2012&lt;br /&gt;
Member Status: Quorate&lt;br /&gt;
&lt;br /&gt;
 Member Name                             ID   Status&lt;br /&gt;
 ------ ----                             ---- ------&lt;br /&gt;
 an-node01.alteeve.com                       1 Online, rgmanager&lt;br /&gt;
 an-node02.alteeve.com                       2 Online, Local, rgmanager&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State&lt;br /&gt;
 ------- ----                   ----- ------                   -----&lt;br /&gt;
 service:storage_an01           an-node01.alteeve.com          started&lt;br /&gt;
 service:storage_an02           an-node02.alteeve.com          started&lt;br /&gt;
 vm:vm0001-dev                  an-node01.alteeve.com          started&lt;br /&gt;
 vm:vm0002-web                  an-node01.alteeve.com          started&lt;br /&gt;
 vm:vm0003-db                   an-node02.alteeve.com          started&lt;br /&gt;
 vm:vm0004-ms                   an-node02.alteeve.com          started&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Done.&lt;br /&gt;
&lt;br /&gt;
=== Failure Testing vm0003-db ===&lt;br /&gt;
&lt;br /&gt;
This should be getting familiar now. The main difference is that the VM is now running on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt;, so that is where will will kill the VM from and that is where we will watch syslog.&lt;br /&gt;
&lt;br /&gt;
Confirm that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0003-db&amp;lt;/span&amp;gt; is on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;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-cluster-A @ Sun Jan  1 19:25:55 2012&lt;br /&gt;
Member Status: Quorate&lt;br /&gt;
&lt;br /&gt;
 Member Name                             ID   Status&lt;br /&gt;
 ------ ----                             ---- ------&lt;br /&gt;
 an-node01.alteeve.com                       1 Online, Local, rgmanager&lt;br /&gt;
 an-node02.alteeve.com                       2 Online, rgmanager&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State&lt;br /&gt;
 ------- ----                   ----- ------                   -----&lt;br /&gt;
 service:storage_an01           an-node01.alteeve.com          started&lt;br /&gt;
 service:storage_an02           an-node02.alteeve.com          started&lt;br /&gt;
 vm:vm0001-dev                  an-node01.alteeve.com          started&lt;br /&gt;
 vm:vm0002-web                  an-node01.alteeve.com          started&lt;br /&gt;
 vm:vm0003-db                   an-node02.alteeve.com          started&lt;br /&gt;
 vm:vm0004-ms                   an-node02.alteeve.com          started&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Good, we&#039;re ready. On &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt;, kill the VM.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
virsh destroy vm0003-db&lt;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 vm0003-db destroyed&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As we expect, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt; restarts the VM within a few seconds.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Jan  1 19:26:21 an-node02 kernel: vbr2: port 2(vnet0) entering disabled state&lt;br /&gt;
Jan  1 19:26:21 an-node02 kernel: device vnet0 left promiscuous mode&lt;br /&gt;
Jan  1 19:26:21 an-node02 kernel: vbr2: port 2(vnet0) entering disabled state&lt;br /&gt;
Jan  1 19:26:22 an-node02 ntpd[2200]: Deleting interface #10 vnet0, fe80::fc54:ff:fe44:83ec#123, interface stats: received=0, sent=0, dropped=0, active_time=8863 secs&lt;br /&gt;
Jan  1 19:26:35 an-node02 rgmanager[2439]: status on vm &amp;quot;vm0003-db&amp;quot; returned 7 (unspecified)&lt;br /&gt;
Jan  1 19:26:36 an-node02 rgmanager[2439]: Stopping service vm:vm0003-db&lt;br /&gt;
Jan  1 19:26:36 an-node02 rgmanager[2439]: Service vm:vm0003-db is recovering&lt;br /&gt;
Jan  1 19:26:36 an-node02 rgmanager[2439]: Recovering failed service vm:vm0003-db&lt;br /&gt;
Jan  1 19:26:37 an-node02 kernel: device vnet0 entered promiscuous mode&lt;br /&gt;
Jan  1 19:26:37 an-node02 kernel: vbr2: port 2(vnet0) entering learning state&lt;br /&gt;
Jan  1 19:26:37 an-node02 rgmanager[2439]: Service vm:vm0003-db started&lt;br /&gt;
Jan  1 19:26:40 an-node02 ntpd[2200]: Listening on interface #15 vnet0, fe80::fc54:ff:fe44:83ec#123 Enabled&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checking &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clustat&amp;lt;/span&amp;gt;, I can see the VM is back on-line.&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-cluster-A @ Sun Jan  1 19:27:06 2012&lt;br /&gt;
Member Status: Quorate&lt;br /&gt;
&lt;br /&gt;
 Member Name                             ID   Status&lt;br /&gt;
 ------ ----                             ---- ------&lt;br /&gt;
 an-node01.alteeve.com                       1 Online, Local, rgmanager&lt;br /&gt;
 an-node02.alteeve.com                       2 Online, rgmanager&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State&lt;br /&gt;
 ------- ----                   ----- ------                   -----&lt;br /&gt;
 service:storage_an01           an-node01.alteeve.com          started&lt;br /&gt;
 service:storage_an02           an-node02.alteeve.com          started&lt;br /&gt;
 vm:vm0001-dev                  an-node01.alteeve.com          started&lt;br /&gt;
 vm:vm0002-web                  an-node01.alteeve.com          started&lt;br /&gt;
 vm:vm0003-db                   an-node02.alteeve.com          started&lt;br /&gt;
 vm:vm0004-ms                   an-node02.alteeve.com          started&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Let&#039;s kill it for the second time.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
virsh destroy vm0003-db&lt;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 vm0003-db destroyed&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can again see that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt; recovered it locally.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Jan  1 19:27:40 an-node02 kernel: vbr2: port 2(vnet0) entering disabled state&lt;br /&gt;
Jan  1 19:27:40 an-node02 kernel: device vnet0 left promiscuous mode&lt;br /&gt;
Jan  1 19:27:40 an-node02 kernel: vbr2: port 2(vnet0) entering disabled state&lt;br /&gt;
Jan  1 19:27:41 an-node02 ntpd[2200]: Deleting interface #15 vnet0, fe80::fc54:ff:fe44:83ec#123, interface stats: received=0, sent=0, dropped=0, active_time=61 secs&lt;br /&gt;
Jan  1 19:27:45 an-node02 rgmanager[2439]: status on vm &amp;quot;vm0003-db&amp;quot; returned 7 (unspecified)&lt;br /&gt;
Jan  1 19:27:46 an-node02 rgmanager[2439]: Stopping service vm:vm0003-db&lt;br /&gt;
Jan  1 19:27:46 an-node02 rgmanager[2439]: Service vm:vm0003-db is recovering&lt;br /&gt;
Jan  1 19:27:46 an-node02 rgmanager[2439]: Recovering failed service vm:vm0003-db&lt;br /&gt;
Jan  1 19:27:47 an-node02 kernel: device vnet0 entered promiscuous mode&lt;br /&gt;
Jan  1 19:27:47 an-node02 kernel: vbr2: port 2(vnet0) entering learning state&lt;br /&gt;
Jan  1 19:27:47 an-node02 rgmanager[2439]: Service vm:vm0003-db started&lt;br /&gt;
Jan  1 19:27:50 an-node02 ntpd[2200]: Listening on interface #16 vnet0, fe80::fc54:ff:fe44:83ec#123 Enabled&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Confirm with &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-cluster-A @ Sun Jan  1 19:28:21 2012&lt;br /&gt;
Member Status: Quorate&lt;br /&gt;
&lt;br /&gt;
 Member Name                             ID   Status&lt;br /&gt;
 ------ ----                             ---- ------&lt;br /&gt;
 an-node01.alteeve.com                       1 Online, Local, rgmanager&lt;br /&gt;
 an-node02.alteeve.com                       2 Online, rgmanager&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State&lt;br /&gt;
 ------- ----                   ----- ------                   -----&lt;br /&gt;
 service:storage_an01           an-node01.alteeve.com          started&lt;br /&gt;
 service:storage_an02           an-node02.alteeve.com          started&lt;br /&gt;
 vm:vm0001-dev                  an-node01.alteeve.com          started&lt;br /&gt;
 vm:vm0002-web                  an-node01.alteeve.com          started&lt;br /&gt;
 vm:vm0003-db                   an-node02.alteeve.com          started&lt;br /&gt;
 vm:vm0004-ms                   an-node02.alteeve.com          started&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This time, it should recover on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;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 destroy vm0003-db&lt;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 vm0003-db destroyed&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Looking in syslog, we can see the counter was tripped.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Jan  1 19:28:36 an-node02 kernel: vbr2: port 2(vnet0) entering disabled state&lt;br /&gt;
Jan  1 19:28:36 an-node02 kernel: device vnet0 left promiscuous mode&lt;br /&gt;
Jan  1 19:28:36 an-node02 kernel: vbr2: port 2(vnet0) entering disabled state&lt;br /&gt;
Jan  1 19:28:37 an-node02 ntpd[2200]: Deleting interface #16 vnet0, fe80::fc54:ff:fe44:83ec#123, interface stats: received=0, sent=0, dropped=0, active_time=47 secs&lt;br /&gt;
Jan  1 19:28:55 an-node02 rgmanager[2439]: status on vm &amp;quot;vm0003-db&amp;quot; returned 7 (unspecified)&lt;br /&gt;
Jan  1 19:28:56 an-node02 rgmanager[2439]: Stopping service vm:vm0003-db&lt;br /&gt;
Jan  1 19:28:56 an-node02 rgmanager[2439]: Service vm:vm0003-db is recovering&lt;br /&gt;
Jan  1 19:28:56 an-node02 rgmanager[2439]: Restart threshold for vm:vm0003-db exceeded; attempting to relocate&lt;br /&gt;
Jan  1 19:28:57 an-node02 rgmanager[2439]: Service vm:vm0003-db is now running on member 1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Again, this is confirmed with &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-cluster-A @ Sun Jan  1 19:29:42 2012&lt;br /&gt;
Member Status: Quorate&lt;br /&gt;
&lt;br /&gt;
 Member Name                             ID   Status&lt;br /&gt;
 ------ ----                             ---- ------&lt;br /&gt;
 an-node01.alteeve.com                       1 Online, Local, rgmanager&lt;br /&gt;
 an-node02.alteeve.com                       2 Online, rgmanager&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State&lt;br /&gt;
 ------- ----                   ----- ------                   -----&lt;br /&gt;
 service:storage_an01           an-node01.alteeve.com          started&lt;br /&gt;
 service:storage_an02           an-node02.alteeve.com          started&lt;br /&gt;
 vm:vm0001-dev                  an-node01.alteeve.com          started&lt;br /&gt;
 vm:vm0002-web                  an-node01.alteeve.com          started&lt;br /&gt;
 vm:vm0003-db                   an-node01.alteeve.com          started&lt;br /&gt;
 vm:vm0004-ms                   an-node02.alteeve.com          started&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This test has passed as well! As before, migrate the VM back and we&#039;ll be ready to test the last VM.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
clusvcadm -M vm:vm0003-db -m an-node02.alteeve.com&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Trying to migrate vm:vm0003-db to an-node02.alteeve.com...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;
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-cluster-A @ Sun Jan  1 19:30:32 2012&lt;br /&gt;
Member Status: Quorate&lt;br /&gt;
&lt;br /&gt;
 Member Name                             ID   Status&lt;br /&gt;
 ------ ----                             ---- ------&lt;br /&gt;
 an-node01.alteeve.com                       1 Online, Local, rgmanager&lt;br /&gt;
 an-node02.alteeve.com                       2 Online, rgmanager&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State&lt;br /&gt;
 ------- ----                   ----- ------                   -----&lt;br /&gt;
 service:storage_an01           an-node01.alteeve.com          started&lt;br /&gt;
 service:storage_an02           an-node02.alteeve.com          started&lt;br /&gt;
 vm:vm0001-dev                  an-node01.alteeve.com          started&lt;br /&gt;
 vm:vm0002-web                  an-node01.alteeve.com          started&lt;br /&gt;
 vm:vm0003-db                   an-node02.alteeve.com          started&lt;br /&gt;
 vm:vm0004-ms                   an-node02.alteeve.com          started&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Done.&lt;br /&gt;
&lt;br /&gt;
=== Failure Testing vm0004-ms ===&lt;br /&gt;
&lt;br /&gt;
{{warning|1=Windows is particularly sensitive to sudden reboots. This is the nature of MS Windows and beyond the ability of the cluster to deal with. As such, be sure that you&#039;ve created your recovery ISOs and taken reasonable precautions so that you can recover the guest after a hard shut down. That is, of course, what we&#039;re about to do here.}}&lt;br /&gt;
&lt;br /&gt;
This is the last VM to test. This testing is repetitive and boring, but it is also critical. Good on you for sticking it out. Right then, let&#039;s get to it.&lt;br /&gt;
&lt;br /&gt;
Confirm that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0004-ms&amp;lt;/span&amp;gt; is on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;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-cluster-A @ Sun Jan  1 19:43:41 2012&lt;br /&gt;
Member Status: Quorate&lt;br /&gt;
&lt;br /&gt;
 Member Name                             ID   Status&lt;br /&gt;
 ------ ----                             ---- ------&lt;br /&gt;
 an-node01.alteeve.com                       1 Online, Local, rgmanager&lt;br /&gt;
 an-node02.alteeve.com                       2 Online, rgmanager&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State&lt;br /&gt;
 ------- ----                   ----- ------                   -----&lt;br /&gt;
 service:storage_an01           an-node01.alteeve.com          started&lt;br /&gt;
 service:storage_an02           an-node02.alteeve.com          started&lt;br /&gt;
 vm:vm0001-dev                  an-node01.alteeve.com          started&lt;br /&gt;
 vm:vm0002-web                  an-node01.alteeve.com          started&lt;br /&gt;
 vm:vm0003-db                   an-node02.alteeve.com          started&lt;br /&gt;
 vm:vm0004-ms                   an-node02.alteeve.com          started&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Good, we&#039;re ready. On &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt;, kill the VM.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
virsh destroy vm0004-ms&lt;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 vm0004-ms destroyed&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As we expect, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt; restarts the VM within a few seconds.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Jan  1 19:43:52 an-node02 kernel: vbr2: port 3(vnet1) entering disabled state&lt;br /&gt;
Jan  1 19:43:52 an-node02 kernel: device vnet1 left promiscuous mode&lt;br /&gt;
Jan  1 19:43:52 an-node02 kernel: vbr2: port 3(vnet1) entering disabled state&lt;br /&gt;
Jan  1 19:43:53 an-node02 ntpd[2200]: Deleting interface #11 vnet1, fe80::fc54:ff:fe5e:b147#123, interface stats: received=0, sent=0, dropped=0, active_time=9895 secs&lt;br /&gt;
Jan  1 19:44:06 an-node02 rgmanager[2439]: status on vm &amp;quot;vm0004-ms&amp;quot; returned 7 (unspecified)&lt;br /&gt;
Jan  1 19:44:07 an-node02 rgmanager[2439]: Stopping service vm:vm0004-ms&lt;br /&gt;
Jan  1 19:44:07 an-node02 rgmanager[2439]: Service vm:vm0004-ms is recovering&lt;br /&gt;
Jan  1 19:44:07 an-node02 rgmanager[2439]: Recovering failed service vm:vm0004-ms&lt;br /&gt;
Jan  1 19:44:08 an-node02 kernel: device vnet1 entered promiscuous mode&lt;br /&gt;
Jan  1 19:44:08 an-node02 kernel: vbr2: port 3(vnet1) entering learning state&lt;br /&gt;
Jan  1 19:44:08 an-node02 rgmanager[2439]: Service vm:vm0004-ms started&lt;br /&gt;
Jan  1 19:44:11 an-node02 ntpd[2200]: Listening on interface #18 vnet1, fe80::fc54:ff:fe5e:b147#123 Enabled&lt;br /&gt;
Jan  1 19:44:23 an-node02 kernel: vbr2: port 3(vnet1) entering forwarding state&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checking &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clustat&amp;lt;/span&amp;gt;, I can see the VM is back on-line.&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-cluster-A @ Sun Jan  1 19:44:38 2012&lt;br /&gt;
Member Status: Quorate&lt;br /&gt;
&lt;br /&gt;
 Member Name                             ID   Status&lt;br /&gt;
 ------ ----                             ---- ------&lt;br /&gt;
 an-node01.alteeve.com                       1 Online, Local, rgmanager&lt;br /&gt;
 an-node02.alteeve.com                       2 Online, rgmanager&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State&lt;br /&gt;
 ------- ----                   ----- ------                   -----&lt;br /&gt;
 service:storage_an01           an-node01.alteeve.com          started&lt;br /&gt;
 service:storage_an02           an-node02.alteeve.com          started&lt;br /&gt;
 vm:vm0001-dev                  an-node01.alteeve.com          started&lt;br /&gt;
 vm:vm0002-web                  an-node01.alteeve.com          started&lt;br /&gt;
 vm:vm0003-db                   an-node02.alteeve.com          started&lt;br /&gt;
 vm:vm0004-ms                   an-node02.alteeve.com          started&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Let&#039;s kill it for the second time.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
virsh destroy vm0004-ms&lt;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 vm0004-ms destroyed&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can again see that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt; recovered it locally.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Jan  1 19:44:54 an-node02 kernel: vbr2: port 3(vnet1) entering disabled state&lt;br /&gt;
Jan  1 19:44:54 an-node02 kernel: device vnet1 left promiscuous mode&lt;br /&gt;
Jan  1 19:44:54 an-node02 kernel: vbr2: port 3(vnet1) entering disabled state&lt;br /&gt;
Jan  1 19:44:55 an-node02 ntpd[2200]: Deleting interface #18 vnet1, fe80::fc54:ff:fe5e:b147#123, interface stats: received=0, sent=0, dropped=0, active_time=44 secs&lt;br /&gt;
Jan  1 19:45:16 an-node02 rgmanager[2439]: status on vm &amp;quot;vm0004-ms&amp;quot; returned 7 (unspecified)&lt;br /&gt;
Jan  1 19:45:17 an-node02 rgmanager[2439]: Stopping service vm:vm0004-ms&lt;br /&gt;
Jan  1 19:45:17 an-node02 rgmanager[2439]: Service vm:vm0004-ms is recovering&lt;br /&gt;
Jan  1 19:45:17 an-node02 rgmanager[2439]: Recovering failed service vm:vm0004-ms&lt;br /&gt;
Jan  1 19:45:18 an-node02 kernel: device vnet1 entered promiscuous mode&lt;br /&gt;
Jan  1 19:45:18 an-node02 kernel: vbr2: port 3(vnet1) entering learning state&lt;br /&gt;
Jan  1 19:45:18 an-node02 rgmanager[2439]: Service vm:vm0004-ms started&lt;br /&gt;
Jan  1 19:45:21 an-node02 ntpd[2200]: Listening on interface #19 vnet1, fe80::fc54:ff:fe5e:b147#123 Enabled&lt;br /&gt;
Jan  1 19:45:33 an-node02 kernel: vbr2: port 3(vnet1) entering forwarding state&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Confirm with &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-cluster-A @ Sun Jan  1 19:46:17 2012&lt;br /&gt;
Member Status: Quorate&lt;br /&gt;
&lt;br /&gt;
 Member Name                             ID   Status&lt;br /&gt;
 ------ ----                             ---- ------&lt;br /&gt;
 an-node01.alteeve.com                       1 Online, Local, rgmanager&lt;br /&gt;
 an-node02.alteeve.com                       2 Online, rgmanager&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State&lt;br /&gt;
 ------- ----                   ----- ------                   -----&lt;br /&gt;
 service:storage_an01           an-node01.alteeve.com          started&lt;br /&gt;
 service:storage_an02           an-node02.alteeve.com          started&lt;br /&gt;
 vm:vm0001-dev                  an-node01.alteeve.com          started&lt;br /&gt;
 vm:vm0002-web                  an-node01.alteeve.com          started&lt;br /&gt;
 vm:vm0003-db                   an-node02.alteeve.com          started&lt;br /&gt;
 vm:vm0004-ms                   an-node02.alteeve.com          started&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This time, it should recover on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;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 destroy vm0004-ms&lt;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 vm0004-ms destroyed&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Looking in syslog, we can see the counter was tripped.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Jan  1 19:45:33 an-node02 kernel: vbr2: port 3(vnet1) entering forwarding state&lt;br /&gt;
Jan  1 19:46:30 an-node02 kernel: vbr2: port 3(vnet1) entering disabled state&lt;br /&gt;
Jan  1 19:46:30 an-node02 kernel: device vnet1 left promiscuous mode&lt;br /&gt;
Jan  1 19:46:30 an-node02 kernel: vbr2: port 3(vnet1) entering disabled state&lt;br /&gt;
Jan  1 19:46:32 an-node02 ntpd[2200]: Deleting interface #19 vnet1, fe80::fc54:ff:fe5e:b147#123, interface stats: received=0, sent=0, dropped=0, active_time=71 secs&lt;br /&gt;
Jan  1 19:46:36 an-node02 rgmanager[2439]: status on vm &amp;quot;vm0004-ms&amp;quot; returned 7 (unspecified)&lt;br /&gt;
Jan  1 19:46:37 an-node02 rgmanager[2439]: Stopping service vm:vm0004-ms&lt;br /&gt;
Jan  1 19:46:37 an-node02 rgmanager[2439]: Service vm:vm0004-ms is recovering&lt;br /&gt;
Jan  1 19:46:37 an-node02 rgmanager[2439]: Restart threshold for vm:vm0004-ms exceeded; attempting to relocate&lt;br /&gt;
Jan  1 19:46:38 an-node02 rgmanager[2439]: Service vm:vm0004-ms is now running on member 1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Indeed, this is confirmed with &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-cluster-A @ Sun Jan  1 19:48:23 2012&lt;br /&gt;
Member Status: Quorate&lt;br /&gt;
&lt;br /&gt;
 Member Name                             ID   Status&lt;br /&gt;
 ------ ----                             ---- ------&lt;br /&gt;
 an-node01.alteeve.com                       1 Online, Local, rgmanager&lt;br /&gt;
 an-node02.alteeve.com                       2 Online, rgmanager&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State&lt;br /&gt;
 ------- ----                   ----- ------                   -----&lt;br /&gt;
 service:storage_an01           an-node01.alteeve.com          started&lt;br /&gt;
 service:storage_an02           an-node02.alteeve.com          started&lt;br /&gt;
 vm:vm0001-dev                  an-node01.alteeve.com          started&lt;br /&gt;
 vm:vm0002-web                  an-node01.alteeve.com          started&lt;br /&gt;
 vm:vm0003-db                   an-node02.alteeve.com          started&lt;br /&gt;
 vm:vm0004-ms                   an-node01.alteeve.com          started&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Wonderful! All four VMs fail and recover as we expected them to. Move the VM back and we&#039;re ready to crash the nodes!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
clusvcadm -M vm:vm0004-ms -m an-node02.alteeve.com&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Trying to migrate vm:vm0004-ms to an-node02.alteeve.com...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;
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-cluster-A @ Sun Jan  1 19:49:32 2012&lt;br /&gt;
Member Status: Quorate&lt;br /&gt;
&lt;br /&gt;
 Member Name                             ID   Status&lt;br /&gt;
 ------ ----                             ---- ------&lt;br /&gt;
 an-node01.alteeve.com                       1 Online, Local, rgmanager&lt;br /&gt;
 an-node02.alteeve.com                       2 Online, rgmanager&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State&lt;br /&gt;
 ------- ----                   ----- ------                   -----&lt;br /&gt;
 service:storage_an01           an-node01.alteeve.com          started&lt;br /&gt;
 service:storage_an02           an-node02.alteeve.com          started&lt;br /&gt;
 vm:vm0001-dev                  an-node01.alteeve.com          started&lt;br /&gt;
 vm:vm0002-web                  an-node01.alteeve.com          started&lt;br /&gt;
 vm:vm0003-db                   an-node02.alteeve.com          started&lt;br /&gt;
 vm:vm0004-ms                   an-node02.alteeve.com          started&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Done and done!&lt;br /&gt;
&lt;br /&gt;
=== Failing and Recovery of an-node01 ===&lt;br /&gt;
&lt;br /&gt;
The final stage of testing is also the most brutal. We&#039;re going to hang &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt; in such a way that it stops responding to messages from &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt;. Within a few seconds, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt; should be fenced, then shortly after the two lost VMs should boot up on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The is a particularly important test for a somewhat non-obvious reason.&lt;br /&gt;
&lt;br /&gt;
{{note|1=It&#039;s one thing to migrate or boot VMs one at a time. The other VMs will not likely be under load, so the resources of the host should be more or less free for the VM being recovered. After a failure though, all lost VMs will be simultaneously recovered, taxing the host&#039;s resources to a greater extent. This test ensures that each node has sufficient resources to effectively recover the VMs simultaneously.}}&lt;br /&gt;
&lt;br /&gt;
We could just shut off &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;, but we tested this earlier when we setup fencing. What we have not yet tested is how the cluster recovers from a hung node. To hang the host, we&#039;re going to trigger a special event in the kernel, using [http://en.wikipedia.org/wiki/Magic_SysRq_key#Alternate_ways_to_invoke_Magic_SysRq magic SysRq] triggers. We&#039;ll do this by sending the letter &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;c&amp;lt;/span&amp;gt; to the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/proc/sysrq-trigger&amp;lt;/span&amp;gt; file. This will &amp;quot;[http://en.wikipedia.org/wiki/Magic_SysRq_key#Magic_commands Reboot kexec and output a crashdump]&amp;quot;. The node should be [[fenced]] before a memory dump can complete, so don&#039;t expect to see anything in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/var/crashed&amp;lt;/span&amp;gt; unless your system is extremely fast.&lt;br /&gt;
&lt;br /&gt;
{{warning|1=If you are skimming, take note! The next command will crash your node!}}&lt;br /&gt;
&lt;br /&gt;
So, on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;, issue the following command to crash the node.&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;
This command will not return. Watching syslog on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt;, we&#039;ll see output like this;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Jan  1 21:26:00 an-node02 kernel: block drbd1: PingAck did not arrive in time.&lt;br /&gt;
Jan  1 21:26:00 an-node02 kernel: block drbd1: peer( Primary -&amp;gt; Unknown ) conn( Connected -&amp;gt; NetworkFailure ) pdsk( UpToDate -&amp;gt; DUnknown ) susp( 0 -&amp;gt; 1 ) &lt;br /&gt;
Jan  1 21:26:00 an-node02 kernel: block drbd1: asender terminated&lt;br /&gt;
Jan  1 21:26:00 an-node02 kernel: block drbd1: Terminating asender thread&lt;br /&gt;
Jan  1 21:26:00 an-node02 kernel: block drbd1: Connection closed&lt;br /&gt;
Jan  1 21:26:00 an-node02 kernel: block drbd1: conn( NetworkFailure -&amp;gt; Unconnected ) &lt;br /&gt;
Jan  1 21:26:00 an-node02 kernel: block drbd1: helper command: /sbin/drbdadm fence-peer minor-1&lt;br /&gt;
Jan  1 21:26:00 an-node02 kernel: block drbd1: receiver terminated&lt;br /&gt;
Jan  1 21:26:00 an-node02 kernel: block drbd1: Restarting receiver thread&lt;br /&gt;
Jan  1 21:26:00 an-node02 kernel: block drbd1: receiver (re)started&lt;br /&gt;
Jan  1 21:26:00 an-node02 kernel: block drbd1: conn( Unconnected -&amp;gt; WFConnection ) &lt;br /&gt;
Jan  1 21:26:00 an-node02 /sbin/obliterate-peer.sh: Local node ID: 2 / Remote node: an-node01.alteeve.com&lt;br /&gt;
Jan  1 21:26:01 an-node02 kernel: block drbd2: PingAck did not arrive in time.&lt;br /&gt;
Jan  1 21:26:01 an-node02 kernel: block drbd2: peer( Primary -&amp;gt; Unknown ) conn( Connected -&amp;gt; NetworkFailure ) pdsk( UpToDate -&amp;gt; DUnknown ) susp( 0 -&amp;gt; 1 ) &lt;br /&gt;
Jan  1 21:26:01 an-node02 kernel: block drbd2: asender terminated&lt;br /&gt;
Jan  1 21:26:01 an-node02 kernel: block drbd2: Terminating asender thread&lt;br /&gt;
Jan  1 21:26:01 an-node02 kernel: block drbd2: Connection closed&lt;br /&gt;
Jan  1 21:26:01 an-node02 kernel: block drbd2: conn( NetworkFailure -&amp;gt; Unconnected ) &lt;br /&gt;
Jan  1 21:26:01 an-node02 kernel: block drbd2: helper command: /sbin/drbdadm fence-peer minor-2&lt;br /&gt;
Jan  1 21:26:01 an-node02 kernel: block drbd2: receiver terminated&lt;br /&gt;
Jan  1 21:26:01 an-node02 kernel: block drbd2: Restarting receiver thread&lt;br /&gt;
Jan  1 21:26:01 an-node02 kernel: block drbd2: receiver (re)started&lt;br /&gt;
Jan  1 21:26:01 an-node02 kernel: block drbd2: conn( Unconnected -&amp;gt; WFConnection ) &lt;br /&gt;
Jan  1 21:26:01 an-node02 /sbin/obliterate-peer.sh: Local node ID: 2 / Remote node: an-node01.alteeve.com&lt;br /&gt;
Jan  1 21:26:01 an-node02 /sbin/obliterate-peer.sh: kill node failed: Invalid argument&lt;br /&gt;
Jan  1 21:26:03 an-node02 kernel: block drbd0: PingAck did not arrive in time.&lt;br /&gt;
Jan  1 21:26:03 an-node02 kernel: block drbd0: peer( Primary -&amp;gt; Unknown ) conn( Connected -&amp;gt; NetworkFailure ) pdsk( UpToDate -&amp;gt; DUnknown ) susp( 0 -&amp;gt; 1 ) &lt;br /&gt;
Jan  1 21:26:03 an-node02 kernel: block drbd0: asender terminated&lt;br /&gt;
Jan  1 21:26:03 an-node02 kernel: block drbd0: Terminating asender thread&lt;br /&gt;
Jan  1 21:26:03 an-node02 kernel: block drbd0: Connection closed&lt;br /&gt;
Jan  1 21:26:03 an-node02 kernel: block drbd0: conn( NetworkFailure -&amp;gt; Unconnected ) &lt;br /&gt;
Jan  1 21:26:03 an-node02 kernel: block drbd0: helper command: /sbin/drbdadm fence-peer minor-0&lt;br /&gt;
Jan  1 21:26:03 an-node02 kernel: block drbd0: receiver terminated&lt;br /&gt;
Jan  1 21:26:03 an-node02 kernel: block drbd0: Restarting receiver thread&lt;br /&gt;
Jan  1 21:26:03 an-node02 kernel: block drbd0: receiver (re)started&lt;br /&gt;
Jan  1 21:26:03 an-node02 kernel: block drbd0: conn( Unconnected -&amp;gt; WFConnection ) &lt;br /&gt;
Jan  1 21:26:03 an-node02 /sbin/obliterate-peer.sh: Local node ID: 2 / Remote node: an-node01.alteeve.com&lt;br /&gt;
Jan  1 21:26:03 an-node02 /sbin/obliterate-peer.sh: kill node failed: Invalid argument&lt;br /&gt;
Jan  1 21:26:09 an-node02 corosync[1963]:   [TOTEM ] A processor failed, forming new configuration.&lt;br /&gt;
Jan  1 21:26:11 an-node02 corosync[1963]:   [QUORUM] Members[1]: 2&lt;br /&gt;
Jan  1 21:26:11 an-node02 corosync[1963]:   [TOTEM ] A processor joined or left the membership and a new membership was formed.&lt;br /&gt;
Jan  1 21:26:11 an-node02 kernel: dlm: closing connection to node 1&lt;br /&gt;
Jan  1 21:26:11 an-node02 corosync[1963]:   [CPG   ] chosen downlist: sender r(0) ip(10.20.0.2) ; members(old:2 left:1)&lt;br /&gt;
Jan  1 21:26:11 an-node02 corosync[1963]:   [MAIN  ] Completed service synchronization, ready to provide service.&lt;br /&gt;
Jan  1 21:26:11 an-node02 fenced[2022]: fencing node an-node01.alteeve.com&lt;br /&gt;
Jan  1 21:26:11 an-node02 kernel: GFS2: fsid=an-cluster-A:shared.0: jid=1: Trying to acquire journal lock...&lt;br /&gt;
Jan  1 21:26:14 an-node02 fence_node[15572]: fence an-node01.alteeve.com success&lt;br /&gt;
Jan  1 21:26:14 an-node02 kernel: block drbd1: helper command: /sbin/drbdadm fence-peer minor-1 exit code 7 (0x700)&lt;br /&gt;
Jan  1 21:26:14 an-node02 kernel: block drbd1: fence-peer helper returned 7 (peer was stonithed)&lt;br /&gt;
Jan  1 21:26:14 an-node02 kernel: block drbd1: pdsk( DUnknown -&amp;gt; Outdated ) &lt;br /&gt;
Jan  1 21:26:14 an-node02 kernel: block drbd1: new current UUID 6355AAB258658E8F:4642D156D54731A1:5F8A6B05E2FCCE19:165E9B466805EC81&lt;br /&gt;
Jan  1 21:26:14 an-node02 kernel: block drbd1: susp( 1 -&amp;gt; 0 ) &lt;br /&gt;
Jan  1 21:26:15 an-node02 fenced[2022]: fence an-node01.alteeve.com success&lt;br /&gt;
Jan  1 21:26:15 an-node02 fence_node[15672]: fence an-node01.alteeve.com success&lt;br /&gt;
Jan  1 21:26:15 an-node02 kernel: block drbd0: helper command: /sbin/drbdadm fence-peer minor-0 exit code 7 (0x700)&lt;br /&gt;
Jan  1 21:26:15 an-node02 kernel: block drbd0: fence-peer helper returned 7 (peer was stonithed)&lt;br /&gt;
Jan  1 21:26:15 an-node02 kernel: block drbd0: pdsk( DUnknown -&amp;gt; Outdated ) &lt;br /&gt;
Jan  1 21:26:15 an-node02 kernel: block drbd0: new current UUID C1F5EF16EE80E6C1:1B503B46E6650575:234E9A10EE04FDE7:7DBC4288E230DC9B&lt;br /&gt;
Jan  1 21:26:15 an-node02 kernel: block drbd0: susp( 1 -&amp;gt; 0 ) &lt;br /&gt;
Jan  1 21:26:15 an-node02 fence_node[15627]: fence an-node01.alteeve.com success&lt;br /&gt;
Jan  1 21:26:15 an-node02 kernel: block drbd2: helper command: /sbin/drbdadm fence-peer minor-2 exit code 7 (0x700)&lt;br /&gt;
Jan  1 21:26:15 an-node02 kernel: block drbd2: fence-peer helper returned 7 (peer was stonithed)&lt;br /&gt;
Jan  1 21:26:15 an-node02 kernel: block drbd2: pdsk( DUnknown -&amp;gt; Outdated ) &lt;br /&gt;
Jan  1 21:26:15 an-node02 kernel: block drbd2: new current UUID 1F79DE480F1E33C1:A674C3CB12017193:76118DDAE165C5FB:871F8081B7D527A9&lt;br /&gt;
Jan  1 21:26:15 an-node02 kernel: block drbd2: susp( 1 -&amp;gt; 0 ) &lt;br /&gt;
Jan  1 21:26:16 an-node02 kernel: GFS2: fsid=an-cluster-A:shared.0: jid=1: Looking at journal...&lt;br /&gt;
Jan  1 21:26:16 an-node02 kernel: GFS2: fsid=an-cluster-A:shared.0: jid=1: Done&lt;br /&gt;
Jan  1 21:26:16 an-node02 rgmanager[2514]: Marking service:storage_an01 as stopped: Restricted domain unavailable&lt;br /&gt;
Jan  1 21:26:16 an-node02 rgmanager[2514]: Taking over service vm:vm0001-dev from down member an-node01.alteeve.com&lt;br /&gt;
Jan  1 21:26:16 an-node02 rgmanager[2514]: Taking over service vm:vm0002-web from down member an-node01.alteeve.com&lt;br /&gt;
Jan  1 21:26:17 an-node02 kernel: device vnet2 entered promiscuous mode&lt;br /&gt;
Jan  1 21:26:17 an-node02 kernel: vbr2: port 4(vnet2) entering learning state&lt;br /&gt;
Jan  1 21:26:17 an-node02 rgmanager[2514]: Service vm:vm0001-dev started&lt;br /&gt;
Jan  1 21:26:17 an-node02 kernel: device vnet3 entered promiscuous mode&lt;br /&gt;
Jan  1 21:26:17 an-node02 kernel: vbr2: port 5(vnet3) entering learning state&lt;br /&gt;
Jan  1 21:26:18 an-node02 rgmanager[2514]: Service vm:vm0002-web started&lt;br /&gt;
Jan  1 21:26:20 an-node02 ntpd[2275]: Listening on interface #12 vnet2, fe80::fc54:ff:fe9b:3cf7#123 Enabled&lt;br /&gt;
Jan  1 21:26:20 an-node02 ntpd[2275]: Listening on interface #13 vnet3, fe80::fc54:ff:fe65:3960#123 Enabled&lt;br /&gt;
Jan  1 21:26:27 an-node02 kernel: kvm: 16177: cpu0 unimplemented perfctr wrmsr: 0xc1 data 0xabcd&lt;br /&gt;
Jan  1 21:26:29 an-node02 kernel: kvm: 16118: cpu0 unimplemented perfctr wrmsr: 0xc1 data 0xabcd&lt;br /&gt;
Jan  1 21:26:32 an-node02 kernel: vbr2: port 4(vnet2) entering forwarding state&lt;br /&gt;
Jan  1 21:26:32 an-node02 kernel: vbr2: port 5(vnet3) entering forwarding state&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checking with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clustat&amp;lt;/span&amp;gt;, we can confirm that all four VMs are now running on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;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-cluster-A @ Sun Jan  1 21:28:00 2012&lt;br /&gt;
Member Status: Quorate&lt;br /&gt;
&lt;br /&gt;
 Member Name                             ID   Status&lt;br /&gt;
 ------ ----                             ---- ------&lt;br /&gt;
 an-node01.alteeve.com                       1 Online, rgmanager&lt;br /&gt;
 an-node02.alteeve.com                       2 Online, Local, rgmanager&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State&lt;br /&gt;
 ------- ----                   ----- ------                   -----&lt;br /&gt;
 service:storage_an01           an-node01.alteeve.com          started&lt;br /&gt;
 service:storage_an02           an-node02.alteeve.com          started&lt;br /&gt;
 vm:vm0001-dev                  an-node02.alteeve.com          started&lt;br /&gt;
 vm:vm0002-web                  an-node02.alteeve.com          started&lt;br /&gt;
 vm:vm0003-db                   an-node02.alteeve.com          started&lt;br /&gt;
 vm:vm0004-ms                   an-node02.alteeve.com          started&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Perfect! This is exactly why we built the cluster!&lt;br /&gt;
&lt;br /&gt;
If we wait a few minutes, we&#039;ll see that the hung node has recovered.&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-cluster-A @ Sun Jan  1 22:30:04 2012&lt;br /&gt;
Member Status: Quorate&lt;br /&gt;
&lt;br /&gt;
 Member Name                             ID   Status&lt;br /&gt;
 ------ ----                             ---- ------&lt;br /&gt;
 an-node01.alteeve.com                       1 Online, rgmanager&lt;br /&gt;
 an-node02.alteeve.com                       2 Online, Local, rgmanager&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State         &lt;br /&gt;
 ------- ----                   ----- ------                   -----         &lt;br /&gt;
 service:storage_an01           an-node01.alteeve.com          started       &lt;br /&gt;
 service:storage_an02           an-node02.alteeve.com          started       &lt;br /&gt;
 vm:vm0001-dev                  an-node02.alteeve.com          started       &lt;br /&gt;
 vm:vm0002-web                  an-node02.alteeve.com          started       &lt;br /&gt;
 vm:vm0003-db                   an-node02.alteeve.com          started       &lt;br /&gt;
 vm:vm0004-ms                   an-node02.alteeve.com          started       &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Before we can push the VMs back though, we must make sure that the underlying DRBD resource has finished synchronizing.&lt;br /&gt;
&lt;br /&gt;
{{note|1=With four VMs, it will most certainly take time for underlying resource to resync. Do not migrate the VMs until this has completed!}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
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;
version: 8.3.12 (api:88/proto:86-96)&lt;br /&gt;
GIT-hash: e2a8ef4656be026bbae540305fcb998a5991090f build by dag@Build64R6, 2011-11-20 10:57:03&lt;br /&gt;
 0: cs:Connected ro:Primary/Primary ds:UpToDate/UpToDate C r-----&lt;br /&gt;
    ns:1182704 nr:1053880 dw:1052676 dr:1245848 al:0 bm:266 lo:0 pe:0 ua:0 ap:0 ep:1 wo:f oos:0&lt;br /&gt;
 1: cs:Connected ro:Primary/Primary ds:UpToDate/UpToDate C r-----&lt;br /&gt;
    ns:2087568 nr:362698 dw:366444 dr:2263316 al:9 bm:411 lo:0 pe:0 ua:0 ap:0 ep:1 wo:f oos:0&lt;br /&gt;
 2: cs:Connected ro:Primary/Primary ds:UpToDate/UpToDate C r-----&lt;br /&gt;
    ns:2098343 nr:1114307 dw:1065375 dr:2340421 al:10 bm:551 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;
We&#039;re ready, so lets migrate back &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0001-dev&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0002-web&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
clusvcadm -M vm:vm0001-dev -m an-node01.alteeve.com&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Trying to migrate vm:vm0001-dev to an-node01.alteeve.com...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 -M vm:vm0002-web -m an-node01.alteeve.com&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Trying to migrate vm:vm0002-web to an-node01.alteeve.com...Success&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Confirm;&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-cluster-A @ Sun Jan  1 22:37:10 2012&lt;br /&gt;
Member Status: Quorate&lt;br /&gt;
&lt;br /&gt;
 Member Name                             ID   Status&lt;br /&gt;
 ------ ----                             ---- ------&lt;br /&gt;
 an-node01.alteeve.com                       1 Online, Local, rgmanager&lt;br /&gt;
 an-node02.alteeve.com                       2 Online, rgmanager&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State&lt;br /&gt;
 ------- ----                   ----- ------                   -----&lt;br /&gt;
 service:storage_an01           an-node01.alteeve.com          started&lt;br /&gt;
 service:storage_an02           an-node02.alteeve.com          started&lt;br /&gt;
 vm:vm0001-dev                  an-node01.alteeve.com          started&lt;br /&gt;
 vm:vm0002-web                  an-node01.alteeve.com          started&lt;br /&gt;
 vm:vm0003-db                   an-node02.alteeve.com          started&lt;br /&gt;
 vm:vm0004-ms                   an-node02.alteeve.com          started&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There we have it. Successful crash and recovery of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==== Discussing the syslog Messages ====&lt;br /&gt;
&lt;br /&gt;
Let&#039;s step back and look at the syslog output; There are a few things to discuss.&lt;br /&gt;
&lt;br /&gt;
The first thing we see is that almost immediately after hanging &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;, the first messages are from DRBD, not the cluster. This in turn trigger&#039;s DRBD&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fence-handler&amp;lt;/span&amp;gt; script, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;obliterate-peer.sh&amp;lt;/span&amp;gt;. This is because DRBD is extremely sensitive to interruptions, even more so than the cluster itself. You will notice that DRBD reacted a full 9 seconds faster than the cluster.&lt;br /&gt;
&lt;br /&gt;
The first thing the cluster does, upon realizing it has lost communication with its peer, is call a fence against the lost node. As mentioned, this involves calling &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;obliterate-peer.sh&amp;lt;/span&amp;gt;, which is itself a very simple wrapper for &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman_tool&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fence_node&amp;lt;/span&amp;gt; shell calls.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Jan  1 21:26:00 an-node02 kernel: block drbd1: helper command: /sbin/drbdadm fence-peer minor-1&lt;br /&gt;
Jan  1 21:26:00 an-node02 kernel: block drbd1: receiver terminated&lt;br /&gt;
Jan  1 21:26:00 an-node02 kernel: block drbd1: Restarting receiver thread&lt;br /&gt;
Jan  1 21:26:00 an-node02 kernel: block drbd1: receiver (re)started&lt;br /&gt;
Jan  1 21:26:00 an-node02 kernel: block drbd1: conn( Unconnected -&amp;gt; WFConnection ) &lt;br /&gt;
Jan  1 21:26:00 an-node02 /sbin/obliterate-peer.sh: Local node ID: 2 / Remote node: an-node01.alteeve.com&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here we see DRBD calling the handler (first message), shortly after we see a log entry from &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;obliterate-peer.sh&amp;lt;/span&amp;gt; (last entry). What you don&#039;t see is that right after that last message, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;obliterate-peer.sh&amp;lt;/span&amp;gt; goes into a 10-iteration loop where it calls &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fence_node&amp;lt;/span&amp;gt; against its peer.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Jan  1 21:26:01 an-node02 /sbin/obliterate-peer.sh: Local node ID: 2 / Remote node: an-node01.alteeve.com&lt;br /&gt;
Jan  1 21:26:01 an-node02 /sbin/obliterate-peer.sh: kill node failed: Invalid argument&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;fence_node&amp;lt;/span&amp;gt; call runs in the background, so the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;obliterate-peer.sh&amp;lt;/span&amp;gt; script goes into a short sleep before trying again (and again...). These subsequent calls will generate the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;kill node failed: Invalid argument&amp;lt;/span&amp;gt; because the first call is already in the process of fencing the node, and are thus safe to ignore. The important past was that this error message &#039;&#039;&#039;didn&#039;t&#039;&#039;&#039; follow the first entry.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Jan  1 21:26:15 an-node02 fenced[2022]: fence an-node01.alteeve.com success&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is what matters. Here we see that the fence succeeded and the hung node was indeed fenced.&lt;br /&gt;
&lt;br /&gt;
=== Failing and Recovery of an-node02 ===&lt;br /&gt;
&lt;br /&gt;
With everything back in place, we&#039;ll hang &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt; and ensure that its VMs will recover on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
As always, check the current state.&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-cluster-A @ Sun Jan  1 22:53:43 2012&lt;br /&gt;
Member Status: Quorate&lt;br /&gt;
&lt;br /&gt;
 Member Name                             ID   Status&lt;br /&gt;
 ------ ----                             ---- ------&lt;br /&gt;
 an-node01.alteeve.com                       1 Online, Local, rgmanager&lt;br /&gt;
 an-node02.alteeve.com                       2 Online, rgmanager&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State&lt;br /&gt;
 ------- ----                   ----- ------                   -----&lt;br /&gt;
 service:storage_an01           an-node01.alteeve.com          started&lt;br /&gt;
 service:storage_an02           an-node02.alteeve.com          started&lt;br /&gt;
 vm:vm0001-dev                  an-node01.alteeve.com          started&lt;br /&gt;
 vm:vm0002-web                  an-node01.alteeve.com          started&lt;br /&gt;
 vm:vm0003-db                   an-node02.alteeve.com          started&lt;br /&gt;
 vm:vm0004-ms                   an-node02.alteeve.com          started&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now hang &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;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 c &amp;gt; /proc/sysrq-trigger&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As before, that command will not return. If we check &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;&#039;s syslog though, we should see that the node is fenced and the lost VMs are recovered.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Jan  1 22:56:14 an-node01 kernel: block drbd1: PingAck did not arrive in time.&lt;br /&gt;
Jan  1 22:56:14 an-node01 kernel: block drbd1: peer( Primary -&amp;gt; Unknown ) conn( Connected -&amp;gt; NetworkFailure ) pdsk( UpToDate -&amp;gt; DUnknown ) susp( 0 -&amp;gt; 1 ) &lt;br /&gt;
Jan  1 22:56:15 an-node01 kernel: block drbd1: asender terminated&lt;br /&gt;
Jan  1 22:56:15 an-node01 kernel: block drbd1: Terminating asender thread&lt;br /&gt;
Jan  1 22:56:15 an-node01 kernel: block drbd1: Connection closed&lt;br /&gt;
Jan  1 22:56:15 an-node01 kernel: block drbd1: conn( NetworkFailure -&amp;gt; Unconnected ) &lt;br /&gt;
Jan  1 22:56:15 an-node01 kernel: block drbd1: helper command: /sbin/drbdadm fence-peer minor-1&lt;br /&gt;
Jan  1 22:56:15 an-node01 kernel: block drbd1: receiver terminated&lt;br /&gt;
Jan  1 22:56:15 an-node01 kernel: block drbd1: Restarting receiver thread&lt;br /&gt;
Jan  1 22:56:15 an-node01 kernel: block drbd1: receiver (re)started&lt;br /&gt;
Jan  1 22:56:15 an-node01 kernel: block drbd1: conn( Unconnected -&amp;gt; WFConnection ) &lt;br /&gt;
Jan  1 22:56:15 an-node01 /sbin/obliterate-peer.sh: Local node ID: 1 / Remote node: an-node02.alteeve.com&lt;br /&gt;
Jan  1 22:56:19 an-node01 kernel: block drbd0: PingAck did not arrive in time.&lt;br /&gt;
Jan  1 22:56:19 an-node01 kernel: block drbd0: peer( Primary -&amp;gt; Unknown ) conn( Connected -&amp;gt; NetworkFailure ) pdsk( UpToDate -&amp;gt; DUnknown ) susp( 0 -&amp;gt; 1 ) &lt;br /&gt;
Jan  1 22:56:19 an-node01 kernel: block drbd0: asender terminated&lt;br /&gt;
Jan  1 22:56:19 an-node01 kernel: block drbd0: Terminating asender thread&lt;br /&gt;
Jan  1 22:56:19 an-node01 kernel: block drbd0: Connection closed&lt;br /&gt;
Jan  1 22:56:19 an-node01 kernel: block drbd0: conn( NetworkFailure -&amp;gt; Unconnected ) &lt;br /&gt;
Jan  1 22:56:19 an-node01 kernel: block drbd0: helper command: /sbin/drbdadm fence-peer minor-0&lt;br /&gt;
Jan  1 22:56:19 an-node01 kernel: block drbd0: receiver terminated&lt;br /&gt;
Jan  1 22:56:19 an-node01 kernel: block drbd0: Restarting receiver thread&lt;br /&gt;
Jan  1 22:56:19 an-node01 kernel: block drbd0: receiver (re)started&lt;br /&gt;
Jan  1 22:56:19 an-node01 kernel: block drbd0: conn( Unconnected -&amp;gt; WFConnection ) &lt;br /&gt;
Jan  1 22:56:19 an-node01 /sbin/obliterate-peer.sh: Local node ID: 1 / Remote node: an-node02.alteeve.com&lt;br /&gt;
Jan  1 22:56:19 an-node01 /sbin/obliterate-peer.sh: kill node failed: Invalid argument&lt;br /&gt;
Jan  1 22:56:21 an-node01 kernel: block drbd2: PingAck did not arrive in time.&lt;br /&gt;
Jan  1 22:56:21 an-node01 kernel: block drbd2: peer( Primary -&amp;gt; Unknown ) conn( Connected -&amp;gt; NetworkFailure ) pdsk( UpToDate -&amp;gt; DUnknown ) susp( 0 -&amp;gt; 1 ) &lt;br /&gt;
Jan  1 22:56:21 an-node01 kernel: block drbd2: asender terminated&lt;br /&gt;
Jan  1 22:56:21 an-node01 kernel: block drbd2: Terminating asender thread&lt;br /&gt;
Jan  1 22:56:21 an-node01 kernel: block drbd2: Connection closed&lt;br /&gt;
Jan  1 22:56:21 an-node01 kernel: block drbd2: conn( NetworkFailure -&amp;gt; Unconnected ) &lt;br /&gt;
Jan  1 22:56:21 an-node01 kernel: block drbd2: receiver terminated&lt;br /&gt;
Jan  1 22:56:21 an-node01 kernel: block drbd2: Restarting receiver thread&lt;br /&gt;
Jan  1 22:56:21 an-node01 kernel: block drbd2: receiver (re)started&lt;br /&gt;
Jan  1 22:56:21 an-node01 kernel: block drbd2: conn( Unconnected -&amp;gt; WFConnection ) &lt;br /&gt;
Jan  1 22:56:21 an-node01 kernel: block drbd2: helper command: /sbin/drbdadm fence-peer minor-2&lt;br /&gt;
Jan  1 22:56:21 an-node01 /sbin/obliterate-peer.sh: Local node ID: 1 / Remote node: an-node02.alteeve.com&lt;br /&gt;
Jan  1 22:56:21 an-node01 /sbin/obliterate-peer.sh: kill node failed: Invalid argument&lt;br /&gt;
Jan  1 22:56:22 an-node01 corosync[1958]:   [TOTEM ] A processor failed, forming new configuration.&lt;br /&gt;
Jan  1 22:56:24 an-node01 corosync[1958]:   [QUORUM] Members[1]: 1&lt;br /&gt;
Jan  1 22:56:24 an-node01 corosync[1958]:   [TOTEM ] A processor joined or left the membership and a new membership was formed.&lt;br /&gt;
Jan  1 22:56:24 an-node01 kernel: dlm: closing connection to node 2&lt;br /&gt;
Jan  1 22:56:24 an-node01 corosync[1958]:   [CPG   ] chosen downlist: sender r(0) ip(10.20.0.1) ; members(old:2 left:1)&lt;br /&gt;
Jan  1 22:56:24 an-node01 corosync[1958]:   [MAIN  ] Completed service synchronization, ready to provide service.&lt;br /&gt;
Jan  1 22:56:24 an-node01 fenced[2014]: fencing node an-node02.alteeve.com&lt;br /&gt;
Jan  1 22:56:24 an-node01 kernel: GFS2: fsid=an-cluster-A:shared.1: jid=0: Trying to acquire journal lock...&lt;br /&gt;
Jan  1 22:56:28 an-node01 fenced[2014]: fence an-node02.alteeve.com success&lt;br /&gt;
Jan  1 22:56:29 an-node01 fence_node[638]: fence an-node02.alteeve.com success&lt;br /&gt;
Jan  1 22:56:29 an-node01 kernel: block drbd2: helper command: /sbin/drbdadm fence-peer minor-2 exit code 7 (0x700)&lt;br /&gt;
Jan  1 22:56:29 an-node01 kernel: block drbd2: fence-peer helper returned 7 (peer was stonithed)&lt;br /&gt;
Jan  1 22:56:29 an-node01 kernel: block drbd2: pdsk( DUnknown -&amp;gt; Outdated ) &lt;br /&gt;
Jan  1 22:56:29 an-node01 kernel: block drbd2: new current UUID 207F7C9279067EC1:3EEB0F756A6A289F:FD92DAC355F53A93:FD91DAC355F53A93&lt;br /&gt;
Jan  1 22:56:29 an-node01 kernel: block drbd2: susp( 1 -&amp;gt; 0 ) &lt;br /&gt;
Jan  1 22:56:29 an-node01 fence_node[518]: fence an-node02.alteeve.com success&lt;br /&gt;
Jan  1 22:56:29 an-node01 kernel: block drbd1: helper command: /sbin/drbdadm fence-peer minor-1 exit code 7 (0x700)&lt;br /&gt;
Jan  1 22:56:29 an-node01 kernel: block drbd1: fence-peer helper returned 7 (peer was stonithed)&lt;br /&gt;
Jan  1 22:56:29 an-node01 kernel: block drbd1: pdsk( DUnknown -&amp;gt; Outdated ) &lt;br /&gt;
Jan  1 22:56:29 an-node01 kernel: block drbd1: new current UUID C65C044AE682D8C5:67D512BD61B70265:C1947DF86E910F8B:C1937DF86E910F8B&lt;br /&gt;
Jan  1 22:56:29 an-node01 kernel: block drbd1: susp( 1 -&amp;gt; 0 ) &lt;br /&gt;
Jan  1 22:56:29 an-node01 rgmanager[2507]: Marking service:storage_an02 as stopped: Restricted domain unavailable&lt;br /&gt;
Jan  1 22:56:29 an-node01 fence_node[583]: fence an-node02.alteeve.com success&lt;br /&gt;
Jan  1 22:56:29 an-node01 kernel: block drbd0: helper command: /sbin/drbdadm fence-peer minor-0 exit code 7 (0x700)&lt;br /&gt;
Jan  1 22:56:29 an-node01 kernel: block drbd0: fence-peer helper returned 7 (peer was stonithed)&lt;br /&gt;
Jan  1 22:56:29 an-node01 kernel: block drbd0: pdsk( DUnknown -&amp;gt; Outdated ) &lt;br /&gt;
Jan  1 22:56:29 an-node01 kernel: block drbd0: new current UUID 295A00166167B5C3:A3F3889ECF7247F5:30313B4AFFF6F82B:30303B4AFFF6F82B&lt;br /&gt;
Jan  1 22:56:29 an-node01 kernel: block drbd0: susp( 1 -&amp;gt; 0 ) &lt;br /&gt;
Jan  1 22:56:29 an-node01 kernel: GFS2: fsid=an-cluster-A:shared.1: jid=0: Looking at journal...&lt;br /&gt;
Jan  1 22:56:30 an-node01 kernel: GFS2: fsid=an-cluster-A:shared.1: jid=0: Done&lt;br /&gt;
Jan  1 22:56:30 an-node01 rgmanager[2507]: Taking over service vm:vm0003-db from down member an-node02.alteeve.com&lt;br /&gt;
Jan  1 22:56:30 an-node01 rgmanager[2507]: Taking over service vm:vm0004-ms from down member an-node02.alteeve.com&lt;br /&gt;
Jan  1 22:56:30 an-node01 kernel: device vnet2 entered promiscuous mode&lt;br /&gt;
Jan  1 22:56:30 an-node01 kernel: vbr2: port 4(vnet2) entering learning state&lt;br /&gt;
Jan  1 22:56:30 an-node01 rgmanager[2507]: Service vm:vm0003-db started&lt;br /&gt;
Jan  1 22:56:31 an-node01 kernel: device vnet3 entered promiscuous mode&lt;br /&gt;
Jan  1 22:56:31 an-node01 kernel: vbr2: port 5(vnet3) entering learning state&lt;br /&gt;
Jan  1 22:56:31 an-node01 rgmanager[2507]: Service vm:vm0004-ms started&lt;br /&gt;
Jan  1 22:56:34 an-node01 ntpd[2267]: Listening on interface #12 vnet3, fe80::fc54:ff:fe5e:b147#123 Enabled&lt;br /&gt;
Jan  1 22:56:34 an-node01 ntpd[2267]: Listening on interface #13 vnet2, fe80::fc54:ff:fe44:83ec#123 Enabled&lt;br /&gt;
Jan  1 22:56:40 an-node01 kernel: kvm: 1074: cpu0 unimplemented perfctr wrmsr: 0xc1 data 0xabcd&lt;br /&gt;
Jan  1 22:56:45 an-node01 kernel: vbr2: port 4(vnet2) entering forwarding state&lt;br /&gt;
Jan  1 22:56:46 an-node01 kernel: vbr2: port 5(vnet3) entering forwarding state&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checking &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-cluster-A @ Sun Jan  1 22:57:36 2012&lt;br /&gt;
Member Status: Quorate&lt;br /&gt;
&lt;br /&gt;
 Member Name                             ID   Status&lt;br /&gt;
 ------ ----                             ---- ------&lt;br /&gt;
 an-node01.alteeve.com                       1 Online, Local, rgmanager&lt;br /&gt;
 an-node02.alteeve.com                       2 Offline&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State&lt;br /&gt;
 ------- ----                   ----- ------                   -----&lt;br /&gt;
 service:storage_an01           an-node01.alteeve.com          started&lt;br /&gt;
 service:storage_an02           (an-node02.alteeve.com)        stopped&lt;br /&gt;
 vm:vm0001-dev                  an-node01.alteeve.com          started&lt;br /&gt;
 vm:vm0002-web                  an-node01.alteeve.com          started&lt;br /&gt;
 vm:vm0003-db                   an-node01.alteeve.com          started&lt;br /&gt;
 vm:vm0004-ms                   an-node01.alteeve.com          started&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
All four VMs are back up and running on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;!&lt;br /&gt;
&lt;br /&gt;
Within a few moments, we should see see that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt; has rejoined the cluster.&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-cluster-A @ Sun Jan  1 23:00:43 2012&lt;br /&gt;
Member Status: Quorate&lt;br /&gt;
&lt;br /&gt;
 Member Name                             ID   Status&lt;br /&gt;
 ------ ----                             ---- ------&lt;br /&gt;
 an-node01.alteeve.com                       1 Online, Local, rgmanager&lt;br /&gt;
 an-node02.alteeve.com                       2 Online, rgmanager&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State&lt;br /&gt;
 ------- ----                   ----- ------                   -----&lt;br /&gt;
 service:storage_an01           an-node01.alteeve.com          started&lt;br /&gt;
 service:storage_an02           an-node02.alteeve.com          started&lt;br /&gt;
 vm:vm0001-dev                  an-node01.alteeve.com          started&lt;br /&gt;
 vm:vm0002-web                  an-node01.alteeve.com          started&lt;br /&gt;
 vm:vm0003-db                   an-node01.alteeve.com          started&lt;br /&gt;
 vm:vm0004-ms                   an-node01.alteeve.com          started&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we&#039;ll wait for the backing DRBD resources to be in sync.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
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;
GIT-hash: e2a8ef4656be026bbae540305fcb998a5991090f build by dag@Build64R6, 2011-11-20 10:57:03&lt;br /&gt;
 0: cs:SyncTarget ro:Primary/Primary ds:Inconsistent/UpToDate C r-----&lt;br /&gt;
    ns:0 nr:272884 dw:271744 dr:5700 al:0 bm:25 lo:0 pe:0 ua:0 ap:0 ep:1 wo:b oos:780928&lt;br /&gt;
	[====&amp;gt;...............] sync&#039;ed: 26.4% (780928/1052672)K&lt;br /&gt;
	finish: 0:10:02 speed: 1,284 (1,280) want: 250 K/sec&lt;br /&gt;
 1: cs:SyncTarget ro:Primary/Primary ds:Inconsistent/UpToDate C r-----&lt;br /&gt;
    ns:0 nr:272196 dw:271048 dr:3688 al:0 bm:45 lo:0 pe:0 ua:0 ap:0 ep:1 wo:f oos:122292&lt;br /&gt;
	[=============&amp;gt;......] sync&#039;ed: 70.2% (122292/393216)K&lt;br /&gt;
	finish: 0:01:31 speed: 1,328 (1,276) want: 250 K/sec&lt;br /&gt;
 2: cs:SyncTarget ro:Primary/Primary ds:Inconsistent/UpToDate C r-----&lt;br /&gt;
    ns:0 nr:273426 dw:272258 dr:3636 al:0 bm:47 lo:0 pe:0 ua:0 ap:0 ep:1 wo:f oos:781500&lt;br /&gt;
	[====&amp;gt;...............] sync&#039;ed: 26.4% (781500/1052760)K&lt;br /&gt;
	finish: 0:09:49 speed: 1,308 (1,284) want: 250 K/sec&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(time passes)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
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;
version: 8.3.12 (api:88/proto:86-96)&lt;br /&gt;
GIT-hash: e2a8ef4656be026bbae540305fcb998a5991090f build by dag@Build64R6, 2011-11-20 10:57:03&lt;br /&gt;
 0: cs:Connected ro:Primary/Primary ds:UpToDate/UpToDate C r-----&lt;br /&gt;
    ns:0 nr:1053812 dw:1052672 dr:6964 al:0 bm:74 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:0 nr:394560 dw:393412 dr:4988 al:0 bm:70 lo:0 pe:0 ua:0 ap:0 ep:1 wo:f oos:0&lt;br /&gt;
 2: cs:Connected ro:Primary/Primary ds:UpToDate/UpToDate C r-----&lt;br /&gt;
    ns:0 nr:1055190 dw:1054022 dr:4936 al:0 bm:167 lo:0 pe:0 ua:0 ap:0 ep:1 wo:f oos:0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we&#039;re ready to migrate &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0003-db&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0004-ms&amp;lt;/span&amp;gt; back to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
clusvcadm -M vm:vm0003-db -m an-node02.alteeve.com&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Trying to migrate vm:vm0003-db to an-node02.alteeve.com...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 -M vm:vm0004-ms -m an-node02.alteeve.com&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Trying to migrate vm:vm0004-ms to an-node02.alteeve.com...Success&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A final check;&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-cluster-A @ Sun Jan  1 23:08:06 2012&lt;br /&gt;
Member Status: Quorate&lt;br /&gt;
&lt;br /&gt;
 Member Name                             ID   Status&lt;br /&gt;
 ------ ----                             ---- ------&lt;br /&gt;
 an-node01.alteeve.com                       1 Online, Local, rgmanager&lt;br /&gt;
 an-node02.alteeve.com                       2 Online, rgmanager&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State&lt;br /&gt;
 ------- ----                   ----- ------                   -----&lt;br /&gt;
 service:storage_an01           an-node01.alteeve.com          started&lt;br /&gt;
 service:storage_an02           an-node02.alteeve.com          started&lt;br /&gt;
 vm:vm0001-dev                  an-node01.alteeve.com          started&lt;br /&gt;
 vm:vm0002-web                  an-node01.alteeve.com          started&lt;br /&gt;
 vm:vm0003-db                   an-node02.alteeve.com          started&lt;br /&gt;
 vm:vm0004-ms                   an-node02.alteeve.com          started&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Good!&lt;br /&gt;
&lt;br /&gt;
== Complete Cold Shut Down And Cold Starting The Cluster ==&lt;br /&gt;
&lt;br /&gt;
The final testing is now complete. There is one final task to cover though; &amp;quot;Cold Shut Down&amp;quot; and &amp;quot;Cold Start&amp;quot; of the cluster. This involves shutting down all VMs, stopping &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;cman&amp;lt;/span&amp;gt; on both nodes, then powering off both nodes. &lt;br /&gt;
&lt;br /&gt;
The cold-start process involves simply powering both nodes on within the set &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;post_join_delay&amp;lt;/span&amp;gt;, then manually enabling the four VMs.&lt;br /&gt;
&lt;br /&gt;
=== Stopping All VMs ===&lt;br /&gt;
&lt;br /&gt;
Check the status as always;&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-cluster-A @ Sun Jan  1 23:13:24 2012&lt;br /&gt;
Member Status: Quorate&lt;br /&gt;
&lt;br /&gt;
 Member Name                             ID   Status&lt;br /&gt;
 ------ ----                             ---- ------&lt;br /&gt;
 an-node01.alteeve.com                       1 Online, Local, rgmanager&lt;br /&gt;
 an-node02.alteeve.com                       2 Online, rgmanager&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State&lt;br /&gt;
 ------- ----                   ----- ------                   -----&lt;br /&gt;
 service:storage_an01           an-node01.alteeve.com          started&lt;br /&gt;
 service:storage_an02           an-node02.alteeve.com          started&lt;br /&gt;
 vm:vm0001-dev                  an-node01.alteeve.com          started&lt;br /&gt;
 vm:vm0002-web                  an-node01.alteeve.com          started&lt;br /&gt;
 vm:vm0003-db                   an-node02.alteeve.com          started&lt;br /&gt;
 vm:vm0004-ms                   an-node02.alteeve.com          started&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
All four VMs are up, so we&#039;ll stop all of them.&lt;br /&gt;
&lt;br /&gt;
{{note|1=You might want to get into the habit of stopping the windows machines, then connecting to them over [[RDP]] or using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-manager&amp;lt;/span&amp;gt; to ensure that it has started to power down. If it hasn&#039;t, shut it down from within the OS.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
clusvcadm -d vm:vm0001-dev&lt;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-dev...Success&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 vm:vm0002-web&lt;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-web...Success&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 vm:vm0003-db&lt;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:vm0003-db...Success&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 vm:vm0004-ms&lt;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:vm0004-ms...Success&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Confirm;&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-cluster-A @ Sun Jan  1 23:17:29 2012&lt;br /&gt;
Member Status: Quorate&lt;br /&gt;
&lt;br /&gt;
 Member Name                             ID   Status&lt;br /&gt;
 ------ ----                             ---- ------&lt;br /&gt;
 an-node01.alteeve.com                       1 Online, Local, rgmanager&lt;br /&gt;
 an-node02.alteeve.com                       2 Online, rgmanager&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State&lt;br /&gt;
 ------- ----                   ----- ------                   -----&lt;br /&gt;
 service:storage_an01           an-node01.alteeve.com          started&lt;br /&gt;
 service:storage_an02           an-node02.alteeve.com          started&lt;br /&gt;
 vm:vm0001-dev                  (an-node01.alteeve.com)        disabled&lt;br /&gt;
 vm:vm0002-web                  (an-node01.alteeve.com)        disabled&lt;br /&gt;
 vm:vm0003-db                   (an-node02.alteeve.com)        disabled&lt;br /&gt;
 vm:vm0004-ms                   (an-node02.alteeve.com)        disabled&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Good, we can now stop &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;
=== Shutting Down The Cluster Entirely ===&lt;br /&gt;
&lt;br /&gt;
{{note|1=It can sometimes take a minute or two for &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; to stop. Please be patient.}}&lt;br /&gt;
&lt;br /&gt;
On &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;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 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 Service Manager:                          [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;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 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 Service Manager:                          [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now stop &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 &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;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;
   Leaving fence domain...                                 [  OK  ]&lt;br /&gt;
   Stopping gfs_controld...                                [  OK  ]&lt;br /&gt;
   Stopping dlm_controld...                                [  OK  ]&lt;br /&gt;
   Stopping fenced...                                      [  OK  ]&lt;br /&gt;
   Stopping cman...                                        [  OK  ]&lt;br /&gt;
   Waiting for corosync to shutdown:                       [  OK  ]&lt;br /&gt;
   Unloading kernel modules...                             [  OK  ]&lt;br /&gt;
   Unmounting configfs...                                  [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;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;
   Leaving fence domain...                                 [  OK  ]&lt;br /&gt;
   Stopping gfs_controld...                                [  OK  ]&lt;br /&gt;
   Stopping dlm_controld...                                [  OK  ]&lt;br /&gt;
   Stopping fenced...                                      [  OK  ]&lt;br /&gt;
   Stopping cman...                                        [  OK  ]&lt;br /&gt;
   Waiting for corosync to shutdown:                       [  OK  ]&lt;br /&gt;
   Unloading kernel modules...                             [  OK  ]&lt;br /&gt;
   Unmounting configfs...                                  [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We&#039;re down, we can safely power off the nodes now.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
poweroff&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Broadcast message from root@an-node01.alteeve.com&lt;br /&gt;
	(/dev/pts/0) at 23:22 ...&lt;br /&gt;
&lt;br /&gt;
The system is going down for power off NOW!&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Cold-Stop achieved!&lt;br /&gt;
&lt;br /&gt;
=== Cold-Starting The Cluster ===&lt;br /&gt;
&lt;br /&gt;
{{note|1=It is important to power on both nodes within &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;post_join_delay&amp;lt;/span&amp;gt; seconds. Otherwise, the slower node will be fenced and the boot process will take longer than it needs to.}}&lt;br /&gt;
&lt;br /&gt;
Power on both nodes. You can just hit the power button, or if you have a workstation on the [[BCN]] with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fence-agents&amp;lt;/span&amp;gt; installed, you can call &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fence_ipmilan&amp;lt;/span&amp;gt; (or the agent you use in your cluster).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
fence_ipmilan -a an-node01.ipmi -l root -p secret -o on&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Powering on machine @ IPMI:an-node01.ipmi...Done&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;
fence_ipmilan -a an-node02.ipmi -l root -p secret -o on&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Powering on machine @ IPMI:an-node02.ipmi...Done&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once they&#039;re up, log into them again and check their status. You will see that the VMs are off-line.&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-cluster-A @ Sun Jan  1 23:40:16 2012&lt;br /&gt;
Member Status: Quorate&lt;br /&gt;
&lt;br /&gt;
 Member Name                             ID   Status&lt;br /&gt;
 ------ ----                             ---- ------&lt;br /&gt;
 an-node01.alteeve.com                       1 Online, Local, rgmanager&lt;br /&gt;
 an-node02.alteeve.com                       2 Online, rgmanager&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State         &lt;br /&gt;
 ------- ----                   ----- ------                   -----         &lt;br /&gt;
 service:storage_an01           an-node01.alteeve.com          started       &lt;br /&gt;
 service:storage_an02           an-node02.alteeve.com          started       &lt;br /&gt;
 vm:vm0001-dev                  (none)                         disabled      &lt;br /&gt;
 vm:vm0002-web                  (none)                         disabled      &lt;br /&gt;
 vm:vm0003-db                   (none)                         disabled      &lt;br /&gt;
 vm:vm0004-ms                   (none)                         disabled      &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check that DRBD is ready;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
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;
version: 8.3.12 (api:88/proto:86-96)&lt;br /&gt;
GIT-hash: e2a8ef4656be026bbae540305fcb998a5991090f build by dag@Build64R6, 2011-11-20 10:57:03&lt;br /&gt;
 0: cs:Connected ro:Primary/Primary ds:UpToDate/UpToDate C r-----&lt;br /&gt;
    ns:4 nr:0 dw:0 dr:8712 al:0 bm:1 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:0 nr:0 dw:0 dr:4632 al:0 bm:0 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:0 nr:0 dw:0 dr:4648 al:0 bm:0 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;
Golden, let&#039;s start the VMs.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
clusvcadm -e vm:vm0001-dev -m an-node01.alteeve.com&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
vm:vm0001-dev is now running on an-node01.alteeve.com&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 -e vm:vm0002-web -m an-node01.alteeve.com&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
vm:vm0002-web is now running on an-node01.alteeve.com&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 -e vm:vm0003-db -m an-node02.alteeve.com&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
vm:vm0003-db is now running on an-node02.alteeve.com&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 -e vm:vm0004-ms -m an-node02.alteeve.com&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
vm:vm0004-ms is now running on an-node02.alteeve.com&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check the new status;&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-cluster-A @ Sun Jan  1 23:45:35 2012&lt;br /&gt;
Member Status: Quorate&lt;br /&gt;
&lt;br /&gt;
 Member Name                             ID   Status&lt;br /&gt;
 ------ ----                             ---- ------&lt;br /&gt;
 an-node01.alteeve.com                       1 Online, rgmanager&lt;br /&gt;
 an-node02.alteeve.com                       2 Online, Local, rgmanager&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State         &lt;br /&gt;
 ------- ----                   ----- ------                   -----         &lt;br /&gt;
 service:storage_an01           an-node01.alteeve.com          started       &lt;br /&gt;
 service:storage_an02           an-node02.alteeve.com          started       &lt;br /&gt;
 vm:vm0001-dev                  an-node01.alteeve.com          started       &lt;br /&gt;
 vm:vm0002-web                  an-node01.alteeve.com          started       &lt;br /&gt;
 vm:vm0003-db                   an-node02.alteeve.com          started       &lt;br /&gt;
 vm:vm0004-ms                   an-node02.alteeve.com          started       &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We&#039;re back up and running!&lt;br /&gt;
&lt;br /&gt;
== Done and Done! ==&lt;br /&gt;
&lt;br /&gt;
That, ladies and gentlemen, is all she wrote!&lt;br /&gt;
&lt;br /&gt;
You should now be safely ready to take your cluster into production at this stage.&lt;br /&gt;
&lt;br /&gt;
Happy Hacking!&lt;br /&gt;
&lt;br /&gt;
= Troubleshooting =&lt;br /&gt;
&lt;br /&gt;
Here we will cover, in no particular order, some common clustering problems and their fixes.&lt;br /&gt;
&lt;br /&gt;
== [vm] error: internal error Attempt to migrate guest to the same host {uuid} ==&lt;br /&gt;
&lt;br /&gt;
{{note|1=&amp;lt;s&amp;gt;See [https://bugzilla.redhat.com/show_bug.cgi?id=770626 rhbz#770626]. Work-around below.&amp;lt;/s&amp;gt; This seems to now be resolved! Setting &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;host_uuid&amp;lt;/span&amp;gt; is enough to work around this issue.}}&lt;br /&gt;
&lt;br /&gt;
This message will appear in the source node&#039;s syslog when trying to migrate a VM. Here is an example set of error messages.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Dec 27 22:00:46 an-node01 rgmanager[2492]: Migrating vm:vm0001-dev to an-node02.alteeve.com&lt;br /&gt;
Dec 27 22:00:46 an-node01 rgmanager[22331]: [vm] Migrate vm0001-dev to an-node02.alteeve.com failed:&lt;br /&gt;
Dec 27 22:00:46 an-node01 rgmanager[22353]: [vm] error: internal error Attempt to migrate guest to the same host 00020003-0004-0005-0006-000700080009&lt;br /&gt;
Dec 27 22:00:46 an-node01 rgmanager[2492]: migrate on vm &amp;quot;vm0001-dev&amp;quot; returned 150 (unspecified)&lt;br /&gt;
Dec 27 22:00:46 an-node01 rgmanager[2492]: Migration of vm:vm0001-dev to an-node02.alteeve.com failed; return code 150&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For reasons as yet unknown, both nodes have the same [[UUID]]. You can verify this by running &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virsh sysinfo | grep uuid&amp;lt;/span&amp;gt; on both nodes.&lt;br /&gt;
&lt;br /&gt;
First node;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
virsh sysinfo | grep uuid&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;entry name=&#039;uuid&#039;&amp;gt;03000200-0400-0500-0006-000700080009&amp;lt;/entry&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
First node;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
virsh sysinfo | grep uuid&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;entry name=&#039;uuid&#039;&amp;gt;03000200-0400-0500-0006-000700080009&amp;lt;/entry&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This UUID comes from the mainboard, and you can confirm this with the following command (note to change the string in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;grep&amp;lt;/span&amp;gt; to a portion of your UUID);&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
dmidecode -s system-uuid&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
03000200-0400-0500-0006-000700080009&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Alternatively;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
dmidecode |grep 000700080009 -B 7 -A 4&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Handle 0x0001, DMI type 1, 27 bytes&lt;br /&gt;
System Information&lt;br /&gt;
	Manufacturer: empty&lt;br /&gt;
	Product Name: empty&lt;br /&gt;
	Version: empty&lt;br /&gt;
	Serial Number: empty&lt;br /&gt;
	UUID: 03000200-0400-0500-0006-000700080009&lt;br /&gt;
	Wake-up Type: Power Switch&lt;br /&gt;
	SKU Number: To be filled by O.E.M.&lt;br /&gt;
	Family: To be filled by O.E.M.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is the result of a lazy vendor re-using UUIDs across mainboards.&lt;br /&gt;
&lt;br /&gt;
The fix is to specify a unique UUID in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/libvirt/libvirtd.conf&amp;lt;/span&amp;gt; using its &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;host_uuid&amp;lt;/span&amp;gt; variable. We&#039;ll generate new, unique UUIDs for each node using the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;uuidgen&amp;lt;/span&amp;gt; command. Be sure to use two new UUIDs for each node!&lt;br /&gt;
&lt;br /&gt;
On the first node;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/libvirt/libvirtd.conf /etc/libvirt/libvirtd.conf.orig&lt;br /&gt;
uuidgen &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;
31873b9e-1069-42ce-b950-137ae5eaa3d1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Change the UUID;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/libvirt/libvirtd.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;
host_uuid = &amp;quot;31873b9e-1069-42ce-b950-137ae5eaa3d1&amp;quot;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here&#039;s the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;diff&amp;lt;/span&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
diff -u /etc/libvirt/libvirtd.conf.orig /etc/libvirt/libvirtd.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/libvirt/libvirtd.conf.orig	2011-12-27 22:29:01.243394880 -0500&lt;br /&gt;
+++ /etc/libvirt/libvirtd.conf	2011-12-27 22:33:44.309799253 -0500&lt;br /&gt;
@@ -365,4 +365,4 @@&lt;br /&gt;
 # NB This default all-zeros UUID will not work. Replace&lt;br /&gt;
 # it with the output of the &#039;uuidgen&#039; command and then&lt;br /&gt;
 # uncomment this entry&lt;br /&gt;
-#host_uuid = &amp;quot;00000000-0000-0000-0000-000000000000&amp;quot;&lt;br /&gt;
+host_uuid = &amp;quot;31873b9e-1069-42ce-b950-137ae5eaa3d1&amp;quot;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Make the same change, with a new and unique UUID, on the second node.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/libvirt/libvirtd.conf /etc/libvirt/libvirtd.conf.orig&lt;br /&gt;
uuidgen &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;
90b8d280-c9ff-4e0e-867e-6d4f7d915995&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Change the UUID;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/libvirt/libvirtd.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;
host_uuid = &amp;quot;90b8d280-c9ff-4e0e-867e-6d4f7d915995&amp;quot;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here&#039;s the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;diff&amp;lt;/span&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
diff -u /etc/libvirt/libvirtd.conf.orig /etc/libvirt/libvirtd.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/libvirt/libvirtd.conf.orig	2011-12-27 22:35:45.975389858 -0500&lt;br /&gt;
+++ /etc/libvirt/libvirtd.conf	2011-12-27 22:36:28.325518880 -0500&lt;br /&gt;
@@ -365,4 +365,4 @@&lt;br /&gt;
 # NB This default all-zeros UUID will not work. Replace&lt;br /&gt;
 # it with the output of the &#039;uuidgen&#039; command and then&lt;br /&gt;
 # uncomment this entry&lt;br /&gt;
-#host_uuid = &amp;quot;00000000-0000-0000-0000-000000000000&amp;quot;&lt;br /&gt;
+host_uuid = &amp;quot;90b8d280-c9ff-4e0e-867e-6d4f7d915995&amp;quot;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now to reload the configuration, we need to restart &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;libvirtd&amp;lt;/span&amp;gt; (a reload is not enough). &lt;br /&gt;
&lt;br /&gt;
{{warning|1=Be sure to stop all VMs on the node before proceeding!}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/libvirtd restart&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Stopping libvirtd daemon:                                  [  OK  ]&lt;br /&gt;
Starting libvirtd daemon:                                  [  OK  ]&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;
virsh sysinfo | grep uuid&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This should show the new UUID. If it doesn&#039;t though, please apply the work-around below.&lt;br /&gt;
&lt;br /&gt;
=== Setting host_uuid Didn&#039;t Work, What Now? ===&lt;br /&gt;
&lt;br /&gt;
{{warning|1=This work-around is not supported in any way supported by Red Hat or any other vendor. This work-around is provided as-is until &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;libvirt&amp;lt;/span&amp;gt; is fixed. - &#039;&#039;&#039;Dec. 28, 2011&#039;&#039;&#039;}}&lt;br /&gt;
&lt;br /&gt;
The problem is that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;libvirt&amp;lt;/span&amp;gt; doesn&#039;t use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;libvirtd.conf&amp;lt;/span&amp;gt;&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;host_uuid&amp;lt;/span&amp;gt; if it sees the system UUID as being valid (not all &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;0&amp;lt;/span&amp;gt; or all &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;f&amp;lt;/span&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
The work-around is to create a wrapper script for &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;dmidecode&amp;lt;/span&amp;gt; that intercepts &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;dmidecode -q -t 0,1,4,17&amp;lt;/span&amp;gt;, reads the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;libvirtd.conf&amp;lt;/span&amp;gt; and, if &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;host_uuid&amp;lt;/span&amp;gt; is set, substitute UUID returned by &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;dmidecode&amp;lt;/span&amp;gt; with the one set by &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;host_uuid&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
{{note|1=You can look at the source of the wrapper script [http://pastebin.com/dwXkUnPT on pastebin.org].}}&lt;br /&gt;
&lt;br /&gt;
To apply the work-around;&lt;br /&gt;
&lt;br /&gt;
Check that the current &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;dmidecode&amp;lt;/span&amp;gt; returns the bad UUID;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
dmidecode -q -t 0,1,4,17 | grep UUID&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
	UUID: 03000200-0400-0500-0006-000700080009&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we&#039;re going to rename &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;dmidecode&amp;lt;/span&amp;gt; as &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;dmidecode.orig&amp;lt;/span&amp;gt;, then download the wrapper script.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
mv /usr/sbin/dmidecode /usr/sbin/dmidecode.orig&lt;br /&gt;
wget -c https://alteeve.com/files/dmidecode -O /usr/sbin/dmidecode&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
--2011-12-28 13:44:27--  https://alteeve.com/files/dmidecode&lt;br /&gt;
Resolving alteeve.com... 192.139.81.121&lt;br /&gt;
Connecting to alteeve.com|192.139.81.121|:443... connected.&lt;br /&gt;
HTTP request sent, awaiting response... 200 OK&lt;br /&gt;
Length: 1159 (1.1K) [text/plain]&lt;br /&gt;
Saving to: “/usr/sbin/dmidecode”&lt;br /&gt;
&lt;br /&gt;
100%[======================================&amp;gt;] 1,159       --.-K/s   in 0s      &lt;br /&gt;
&lt;br /&gt;
2011-12-28 13:44:28 (15.3 MB/s) - “/usr/sbin/dmidecode” saved [1159/1159]&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;
chmod 755 /usr/sbin/dmidecode&lt;br /&gt;
ls -lah /usr/sbin/dmidecode&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
-rwxr-xr-x 1 root root 1.2K Dec 28 13:26 /usr/sbin/dmidecode&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now re-run the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;dmidecode&amp;lt;/span&amp;gt; call and see that the new UUID is used.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
dmidecode -q -t 0,1,4,17 | grep UUID&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
	UUID: 31873b9e-1069-42ce-b950-137ae5eaa3d1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This matches what was set in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/libvirt/libvirtd.conf&amp;lt;/span&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
grep host_uuid /etc/libvirt/libvirtd.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;
host_uuid = &amp;quot;31873b9e-1069-42ce-b950-137ae5eaa3d1&amp;quot;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now restart &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;libvirtd&amp;lt;/span&amp;gt; and check &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virsh sysinfo&amp;lt;/span&amp;gt; to confirm that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;libvirtd&amp;lt;/span&amp;gt; now returns the proper UUID.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/libvirtd restart&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Stopping libvirtd daemon:                                  [  OK  ]&lt;br /&gt;
Starting libvirtd daemon:                                  [  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;
virsh sysinfo | grep uuid&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;entry name=&#039;uuid&#039;&amp;gt;31873b9e-1069-42ce-b950-137ae5eaa3d1&amp;lt;/entry&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Done!&lt;br /&gt;
&lt;br /&gt;
As soon as &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;libvirtd&amp;lt;/span&amp;gt; is fixed, this section will be re-written.&lt;br /&gt;
&lt;br /&gt;
== [vm] error: Cannot recv data: Host key verification failed.#015: Connection reset by peer ==&lt;br /&gt;
&lt;br /&gt;
This can show up when you try to live migrate a VM but your &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/root/.ssh/known_hosts&amp;lt;/span&amp;gt; file has not been populated. Effectively, the cluster was prompted to accept the finger-print of the target node, was unable to answer and so then closed the connection.&lt;br /&gt;
&lt;br /&gt;
The syslog entry will look something like this;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Dec 27 21:58:00 an-node02 rgmanager[2439]: Migrating vm:vm0003-db to an-node01.alteeve.com&lt;br /&gt;
Dec 27 21:58:01 an-node02 rgmanager[18951]: [vm] Migrate vm0003-db to an-node01.alteeve.com failed:&lt;br /&gt;
Dec 27 21:58:01 an-node02 rgmanager[18973]: [vm] error: Cannot recv data: Host key verification failed.#015: Connection reset by peer&lt;br /&gt;
Dec 27 21:58:01 an-node02 rgmanager[2439]: migrate on vm &amp;quot;vm0003-db&amp;quot; returned 150 (unspecified)&lt;br /&gt;
Dec 27 21:58:01 an-node02 rgmanager[2439]: Migration of vm:vm0003-db to an-node01.alteeve.com failed; return code 150&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To fix the problem, please return to [[2-Node_Red_Hat_KVM_Cluster_Tutorial#Populating_And_Pushing_.7E.2F.ssh.2Fknown_hosts|Populating And Pushing ~/ssh/known_hosts]].&lt;br /&gt;
&lt;br /&gt;
== error: unknown OS type hvm ==&lt;br /&gt;
&lt;br /&gt;
This can be caused by hardware virtualization support being disabled in your [[BIOS]].&lt;br /&gt;
&lt;br /&gt;
To check whether you have hardware virtualization support enabled, run;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
egrep &#039;(vmx|svm)&#039; --color=always /proc/cpuinfo&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On [[Intel]] machines, you should see this;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
flags		: ... vmx ...&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On [[AMD]] machines, you should see this;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
flags		: ... svm ...&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The above will have the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xvm&amp;lt;/span&amp;gt; or &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;svm&amp;lt;/span&amp;gt; highlighted and the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;flags&amp;lt;/span&amp;gt; line will be quite long. You will also see an entry for every CPU core (or hyperthreaded pseudo-core).&lt;br /&gt;
&lt;br /&gt;
If you don&#039;t see a match to either &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xvm&amp;lt;/span&amp;gt; or &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;svm&amp;lt;/span&amp;gt;, please consult your motherboard&#039;s manual for information on enabling hardware virtualization.&lt;br /&gt;
&lt;br /&gt;
== My VM Just Vanished! ==&lt;br /&gt;
&lt;br /&gt;
{{warning|1=If &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virsh&amp;lt;/span&amp;gt; tries to start a virtual machine but a referenced device or media is missing, it will react by completely undefining the virtual machine!}}&lt;br /&gt;
&lt;br /&gt;
If you ever suddenly find that a virtual machine has vanished, it is probably because something the VM wanted to use couldn&#039;t be found. This can be as trivial as deleting an ISO that a VM had been defined to mount on boot. &lt;br /&gt;
&lt;br /&gt;
Let&#039;s look at the example where an ISO was deleted, as this is a common issue.&lt;br /&gt;
&lt;br /&gt;
Copy your last backup of the XML definition file for the effected VM and then edit it to remove the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;&amp;lt;source file=&#039;...&#039;/&amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/span&amp;gt; lines for the removed media. For example, change:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;disk type=&#039;file&#039; device=&#039;floppy&#039;&amp;gt;&lt;br /&gt;
      &amp;lt;driver name=&#039;qemu&#039; type=&#039;raw&#039; cache=&#039;none&#039; io=&#039;threads&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;source file=&#039;/shared/files/virtio-win-1.1.16.vfd&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;target dev=&#039;fda&#039; bus=&#039;fdc&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;alias name=&#039;fdc0-0-0&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;address type=&#039;drive&#039; controller=&#039;0&#039; bus=&#039;0&#039; unit=&#039;0&#039;/&amp;gt;&lt;br /&gt;
    &amp;lt;/disk&amp;gt;&lt;br /&gt;
    &amp;lt;disk type=&#039;file&#039; device=&#039;cdrom&#039;&amp;gt;&lt;br /&gt;
      &amp;lt;driver name=&#039;qemu&#039; type=&#039;raw&#039; io=&#039;threads&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;source file=&#039;/shared/files/Windows_Server_2008_R2_64Bit_SP1.iso&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;target dev=&#039;hdc&#039; bus=&#039;ide&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;readonly/&amp;gt;&lt;br /&gt;
      &amp;lt;alias name=&#039;ide0-1-0&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;address type=&#039;drive&#039; controller=&#039;0&#039; bus=&#039;1&#039; unit=&#039;0&#039;/&amp;gt;&lt;br /&gt;
    &amp;lt;/disk&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;disk type=&#039;file&#039; device=&#039;floppy&#039;&amp;gt;&lt;br /&gt;
      &amp;lt;driver name=&#039;qemu&#039; type=&#039;raw&#039; cache=&#039;none&#039; io=&#039;threads&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;target dev=&#039;fda&#039; bus=&#039;fdc&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;alias name=&#039;fdc0-0-0&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;address type=&#039;drive&#039; controller=&#039;0&#039; bus=&#039;0&#039; unit=&#039;0&#039;/&amp;gt;&lt;br /&gt;
    &amp;lt;/disk&amp;gt;&lt;br /&gt;
    &amp;lt;disk type=&#039;file&#039; device=&#039;cdrom&#039;&amp;gt;&lt;br /&gt;
      &amp;lt;driver name=&#039;qemu&#039; type=&#039;raw&#039; io=&#039;threads&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;target dev=&#039;hdc&#039; bus=&#039;ide&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;readonly/&amp;gt;&lt;br /&gt;
      &amp;lt;alias name=&#039;ide0-1-0&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;address type=&#039;drive&#039; controller=&#039;0&#039; bus=&#039;1&#039; unit=&#039;0&#039;/&amp;gt;&lt;br /&gt;
    &amp;lt;/disk&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then redefine the VM and you can safely restart it again.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
virsh define /shared/definitions/vm0002-ms.xml&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You should be back in business at this point.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{footer}}&lt;/div&gt;</summary>
		<author><name>RoyK</name></author>
	</entry>
	<entry>
		<id>https://alteeve.com/w/index.php?title=2-Node_Red_Hat_KVM_Cluster_Tutorial_-_Archive&amp;diff=4368</id>
		<title>2-Node Red Hat KVM Cluster Tutorial - Archive</title>
		<link rel="alternate" type="text/html" href="https://alteeve.com/w/index.php?title=2-Node_Red_Hat_KVM_Cluster_Tutorial_-_Archive&amp;diff=4368"/>
		<updated>2012-07-20T08:59:42Z</updated>

		<summary type="html">&lt;p&gt;RoyK: /* A Note on Patience */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{howto_header}}&lt;br /&gt;
&lt;br /&gt;
{{note|1=This is the second edition of the original [[Red Hat Cluster Service 2 Tutorial]]. This version is updated to use the Red Hat Cluster Suite, Stable version 3. It replaces [[Xen]] in favour of [[KVM]] to stay in-line with [[Red Hat]]&#039;s supported configuration. It also uses [[corosync]], replacing [[openais]], as the core cluster communication stack.}}&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 [[KVM]] virtual machines using [[RHCS]] &amp;quot;stable 3&amp;quot; with [[DRBD]] and clustered [[LVM]] for synchronizing storage data. This is an updated version of the earlier [[Red Hat Cluster Service 2 Tutorial]] Tutorial. You will find much in common with that tutorial if you&#039;ve previously followed that document. Please don&#039;t skip large sections though. There are some differences that are subtle but important.&lt;br /&gt;
&lt;br /&gt;
Grab a coffee, 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 its complexities.&lt;br /&gt;
&lt;br /&gt;
== Technologies We Will Use ==&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;Red Hat Enterprise Linux 6&#039;&#039; ([[EL6]]); You can use  a derivative like [[CentOS]] v6.&lt;br /&gt;
* &#039;&#039;Red Hat Cluster Services&#039;&#039; &amp;quot;Stable&amp;quot; version 3. This describes the following core components:&lt;br /&gt;
** &#039;&#039;Corosync&#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;Clustered 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 [[KVM]] 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;KVM&#039;&#039;; [[Hypervisor]] that controls and supports virtual machines.&lt;br /&gt;
&lt;br /&gt;
== A Note on Hardware ==&lt;br /&gt;
&lt;br /&gt;
In this tutorial, I will make reference to specific hardware components and devices. I do this to share what devices and equipment I use, but I do not endorse any of the products named in this tutorial. I am in no way affiliated with any hardware vendor not do I receive any compensation or gifts from any company.&lt;br /&gt;
&lt;br /&gt;
== A Note on Patience ==&lt;br /&gt;
&lt;br /&gt;
When someone wants to become a pilot, they can&#039;t jump into a plane and try to take off. It&#039;s not that flying is inherently hard, but it requires a foundation of understanding. Clustering is the same in this regard; there are many different pieces that have to work together just to get off the ground. &lt;br /&gt;
&lt;br /&gt;
You &#039;&#039;&#039;must&#039;&#039;&#039; have patience.&lt;br /&gt;
&lt;br /&gt;
Like a pilot on their first flight, seeing a cluster come to life is a fantastic experience. Don&#039;t rush it! Do your homework and you&#039;ll be on your way before you know it.&lt;br /&gt;
&lt;br /&gt;
Coming back to earth:&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 analogue 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]] [[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 its 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. Browse 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 &#039;&#039;&#039;won&#039;t happen&#039;&#039;&#039;. If you rush, you will skip important points and &#039;&#039;&#039;you will fail&#039;&#039;&#039;. &lt;br /&gt;
&lt;br /&gt;
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 [[KVM]]-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 its 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 [[RHEL]] version 6.2, [[x86_64]] architecture. The KVM hypervisor will not run on [[i686]]. No testing was done on other [[EL6]] derivatives. That said, there is no reason to believe that this tutorial will not apply to any variant of EL6. As much as possible, the language will be distro-agnostic.&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;Fabimer Principle&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;corosync&amp;lt;/span&amp;gt;, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;dlm&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 many more smaller apps.&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;clvmd&amp;lt;/span&amp;gt;, &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;KVM&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 across &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;6&amp;lt;/span&amp;gt; interfaces bonded into pairs.&lt;br /&gt;
** The network infrastructure (Switches, routers, etc). We will be using two managed switches, adding 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*2))+2&amp;lt;/span&amp;gt;, the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;+2&amp;lt;/span&amp;gt; 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 proficient. 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))+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;
Clustering isn&#039;t like most applications or technologies. Most of us learn by taking something such as a configuration file, and tweaking it 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;
The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt; portion of the the cluster is the &#039;&#039;&#039;c&#039;&#039;&#039;luster &#039;&#039;&#039;man&#039;&#039;&#039;ager. In the 3.0 series used in [[EL6]], &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt; acts mainly as a [[quorum]] provider. That is, is adds up the votes from the cluster members and decides if there is a simple majority. If there is, the cluster is &amp;quot;quorate&amp;quot; and is allowed to provide cluster services. Newer versions of the Red Hat Cluster Suite found in [[Fedora]] will use a new quorum provider and &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;
Until it is removed, the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt; service will be used to start and stop all of the daemons needed to make the cluster operate.&lt;br /&gt;
&lt;br /&gt;
== Component; corosync ==&lt;br /&gt;
&lt;br /&gt;
Corosync is the heart of the cluster. Almost all other cluster compnents operate though this.&lt;br /&gt;
&lt;br /&gt;
In Red Hat clusters, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;corosync&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. It can be configured directly in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;corosync.conf&amp;lt;/span&amp;gt;, but given that we will be building an RHCS cluster, 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;corosync.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;
Corosync sends messages using [[multicast]] messaging by default. Recently, [[unicast]] support has been added, but due to network latency, it is only recommended for use with small clusters of two to four nodes. We will be using [[multicast]] in this tutorial.&lt;br /&gt;
&lt;br /&gt;
=== A Little History ===&lt;br /&gt;
&lt;br /&gt;
There were significant changes between [[RHCS]] the old version 2 and version 3 available on [[EL6]], which we are using.&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 provided &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 totem, cluster membership, messaging, and basic APIs for use by clustered applications, while the OpenAIS project became an optional add-on to corosync for users who want the full AIS API.&lt;br /&gt;
&lt;br /&gt;
You will see a lot of references to OpenAIS while searching the web for information on clustering. Understanding its 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 clustered services 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 is 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, when a cluster splits into two or more partitions, which ever group of machines has quorum can safely start clustered services knowing that no other lost nodes will try to do the same.&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 has been confirmed successful, the partition with quorum will begin accessing clustered resources, like shared filesystems.&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 its 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;
Many cluster operations, like 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;corosync&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 between members are ordered. Delivery, however, is not guaranteed. If a member misses messages, it is up to the member&#039;s application to decide what action to take.&lt;br /&gt;
&lt;br /&gt;
Let&#039;s look at two scenarios showing how locks are handled using CPG;&lt;br /&gt;
&lt;br /&gt;
* The cluster starts up cleanly with two members.&lt;br /&gt;
* Both members are able to start &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;service:foo&amp;lt;/span&amp;gt;.&lt;br /&gt;
* Both want to start it, but need a lock from [[DLM]] to do so.&lt;br /&gt;
** The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt; member has its totem token, and sends its request for the lock.&lt;br /&gt;
** DLM issues a lock for that service to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;.&lt;br /&gt;
** The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt; member requests a lock for the same service.&lt;br /&gt;
** DLM rejects the lock request.&lt;br /&gt;
* The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt; member successfully starts &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;service:foo&amp;lt;/span&amp;gt; and announces this to the CPG members.&lt;br /&gt;
* The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt; sees that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;service:foo&amp;lt;/span&amp;gt; is now running on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt; and no longer tries to start the service.&lt;br /&gt;
&lt;br /&gt;
* The two members want to write to a common area of the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/shared&amp;lt;/span&amp;gt; GFS2 partition.&lt;br /&gt;
** The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt; sends a request for a DLM lock against the FS, gets it.&lt;br /&gt;
** The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt; sends a request for the same lock, but DLM sees that a lock is pending and rejects the request.&lt;br /&gt;
** The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt; member finishes altering the file system, announces the changed over CPG and releases the lock.&lt;br /&gt;
** The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt; member updates its view of the filesystem, requests a lock, receives it and proceeds to update the filesystems.&lt;br /&gt;
** It completes the changes, annouces the changes over CPG and releases the lock.&lt;br /&gt;
&lt;br /&gt;
Messages can only be sent to the members of the CPG while the node has a totem tokem from corosync.&lt;br /&gt;
&lt;br /&gt;
== Concept; Fencing ==&lt;br /&gt;
&lt;br /&gt;
{{warning|1=DO NOT BUILD A CLUSTER WITHOUT PROPER, WORKING AND TESTED 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;
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 [[DLM]] locks are allowed to be issued. Anything using DLM, including &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&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;, are effectively hung. The hung node is detected using a totem token timeout. That is, if a token is not received from a node within a period of time, it is considered lost and a new token is sent. After a certain number of lost tokens, the cluster declares the node dead. The remaining nodes reconfigure into a new cluster and, if they have quorum (or if quorum is ignored), a fence call against the silent node is made.&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 totem token moves around the cluster members. As each member gets the token, it sends sequenced messages to the CPG members.&lt;br /&gt;
* The token is passed from one node to the next, in order and continuously during normal operation.&lt;br /&gt;
* Suddenly, one node stops responding.&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 and a replacement token is created.&lt;br /&gt;
** The silent node responds before the failure counter reaches the limit.&lt;br /&gt;
*** The failure 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 token 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;corosync&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;
**** The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fenced&amp;lt;/span&amp;gt; daemon notifies [[DLM]] and locks are blocked.&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 effectively 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, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fenced&amp;lt;/span&amp;gt; notifies DLM and lost locks are recovered.&lt;br /&gt;
**** [[GFS2]] partitions recover using their journal.&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, minus the lost node.&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 remain hung until a human can intervene.&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;corosync&amp;lt;/span&amp;gt;. A token is passed around all the nodes in the cluster, and nodes can only send messages while they have the token. A node will keep its messages in memory until it gets the token back with no &amp;quot;not ack&amp;quot; messages. This way, if a node missed a message, it can request it be resent when it gets its token. If a node isn&#039;t up, it will simply miss the messages.&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;. The RRP is being re-introduced in RHCS version 3. Its use is experimental and should only be used with plenty of testing.&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;corosync&amp;lt;/span&amp;gt; tells the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; that it needs to recheck its services. 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;
The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; daemon runs separately from the cluster manager, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt;. This means that, to fully start the cluster, we need to start both &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt; and then &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt;.&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 Cluster 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 traditional [[SAN]] 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 cluster&#039;s storage. &lt;br /&gt;
&lt;br /&gt;
This shows;&lt;br /&gt;
* Each node having four physical disks tied together in a [[RAID_level_5#Level_5|RAID Level 5]] array and presented to the Node&#039;s OS as a single drive which is found at &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/sda&amp;lt;/span&amp;gt;.&lt;br /&gt;
* Each node&#039;s OS uses three primary partitions for &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/boot&amp;lt;/span&amp;gt;, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;swap&amp;gt;&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/&amp;lt;/span&amp;gt;.&lt;br /&gt;
* Three extended partitions are created;&lt;br /&gt;
** &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/sda5&amp;lt;/span&amp;gt; backs a small partition used as a [[GFS2]]-formatted shared mount point.&lt;br /&gt;
** &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/sda6&amp;lt;/span&amp;gt; backs the [[VM]]s designed to run primarily on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&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; backs the [[VM]]s designed to run primarily on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt;.&lt;br /&gt;
* All three extended partitions are combined using DRBD to create three DRBD resources;&lt;br /&gt;
** &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/drbd0&amp;lt;/span&amp;gt; is backed by &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/drbd1&amp;lt;/span&amp;gt; is backed by &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/drbd2&amp;lt;/span&amp;gt; is backed by &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/sda7&amp;lt;/span&amp;gt;.&lt;br /&gt;
* All three DRBD resources are managed by clustered LVM.&lt;br /&gt;
* The GFS2-formatted [[LV]] is mounted on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/shared&amp;lt;/span&amp;gt; on both nodes.&lt;br /&gt;
* Each [[VM]] gets its own [[LV]].&lt;br /&gt;
* All three DRBD resources sync over the [[Storage Network]], which uses the bonded &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;bond1&amp;lt;/span&amp;gt; (backed be &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;eth4&amp;lt;/span&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
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;
 _________________________________________________                 _________________________________________________ &lt;br /&gt;
| [ an-node01 ]                                   |               |                                   [ an-node02 ] |&lt;br /&gt;
|  ________       __________                      |               |                      __________       ________  |&lt;br /&gt;
| [_disk_1_]--+--[_/dev/sda_]                     |               |                     [_/dev/sda_]--+--[_disk_1_] |&lt;br /&gt;
|  ________   |    |   ___________    _______     |               |     _______    ___________   |    |   ________  |&lt;br /&gt;
| [_disk_2_]--+    +--[_/dev/sda1_]--[_/boot_]    |               |    [_/boot_]--[_/dev/sda1_]--+    +--[_disk_2_] |&lt;br /&gt;
|  ________   |    |   ___________    ________    |               |    ________    ___________   |    |   ________  |&lt;br /&gt;
| [_disk_3_]--+    +--[_/dev/sda2_]--[_&amp;lt;swap&amp;gt;_]   |               |   [_&amp;lt;swap&amp;gt;_]--[_/dev/sda2_]--+    +--[_disk_3_] |&lt;br /&gt;
|  ________   |    |   ___________    ___         |               |         ___    ___________   |    |   ________  |&lt;br /&gt;
| [_disk_4_]--/    +--[_/dev/sda3_]--[_/_]        |               |        [_/_]--[_/dev/sda3_]--+    \--[_disk_4_] |&lt;br /&gt;
|                  |   ___________                |               |                ___________   |                  |&lt;br /&gt;
|                  +--[_/dev/sda5_]------------\  |               |  /------------[_/dev/sda5_]--+                  |&lt;br /&gt;
|                  |   ___________             |  |               |  |             ___________   |                  |&lt;br /&gt;
|                  +--[_/dev/sda6_]----------\ |  |               |  | /----------[_/dev/sda6_]--+                  |&lt;br /&gt;
|                  |   ___________           | |  |               |  | |           ___________   |                  |&lt;br /&gt;
|                  \--[_/dev/sda7_]--------\ | |  |               |  | | /--------[_/dev/sda7_]--/                  |&lt;br /&gt;
|        _______________    ____________   | | |  |               |  | | |   ____________    _______________        |&lt;br /&gt;
|    /--[_Clustered_LVM_]--[_/dev/drbd2_]--/ | |  |               |  | | \--[_/dev/drbd2_]--[_Clustered_LVM_]--\    |&lt;br /&gt;
|   _|__                     |   _______     | |  |               |  | |      |   _______                    __|_   |&lt;br /&gt;
|  [_PV_]                    \--{_bond1_}    | |  |               |  | |      \--{_bond1_}                  [_PV_]  |&lt;br /&gt;
|   _|________                               | |  |               |  | |                               ________|_   |&lt;br /&gt;
|  [_an02-vg0_]                              | |  |               |  | |                              [_an02-vg0_]  |&lt;br /&gt;
|    |   ________________________    ....... | |  |               |  | |  _____     ________________________   |    |&lt;br /&gt;
|    +--[_/dev/an02-vg0/vm0003_1_]---:.vm3.: | |  |               |  | | [_vm3_]---[_/dev/an02-vg0/vm0003_1_]--+    |&lt;br /&gt;
|    |   ________________________    ....... | |  |               |  | |  _____     ________________________   |    |&lt;br /&gt;
|    \--[_/dev/an02-vg0/vm0004_1_]---:.vm4.: | |  |               |  | | [_vm4_]---[_/dev/an02-vg0/vm0004_1_]--/    |&lt;br /&gt;
|          _______________    ____________   | |  |               |  | |   ____________    _______________          |&lt;br /&gt;
|      /--[_Clustered_LVM_]--[_/dev/drbd1_]--/ |  |               |  | \--[_/dev/drbd1_]--[_Clustered_LVM_]--\      |&lt;br /&gt;
|     _|__                     |   _______     |  |               |  |      |   _______                    __|_     |&lt;br /&gt;
|    [_PV_]                    \--{_bond1_}    |  |               |  |      \--{_bond1_}                  [_PV_]    |&lt;br /&gt;
|     _|________                               |  |               |  |                               ________|_     |&lt;br /&gt;
|    [_an01-vg0_]                              |  |               |  |                              [_an01-vg0_]    |&lt;br /&gt;
|      |   ________________________     _____  |  |               |  | .......    ________________________   |      |&lt;br /&gt;
|      +--[_/dev/an01-vg0/vm0001_1_]---[_vm1_] |  |               |  | :.vm1.:---[_/dev/an02-vg0/vm0001_1_]--+      |&lt;br /&gt;
|      |   ________________________     _____  |  |               |  | .......    ________________________   |      |&lt;br /&gt;
|      \--[_/dev/an01-vg0/vm0002_1_]---[_vm2_] |  |               |  | :.vm2.:---[_/dev/an02-vg0/vm0002_1_]--/      |&lt;br /&gt;
|            _______________    ____________   |  |               |  |   ____________    _______________            |&lt;br /&gt;
|        /--[_Clustered_LVM_]--[_/dev/drbd0_]--/  |               |  \--[_/dev/drbd0_]--[_Clustered_LVM_]--\        |&lt;br /&gt;
|       _|__                     |   _______      |               |       |   _______                    __|_       |&lt;br /&gt;
|      [_PV_]                    \--{_bond1_}     |               |       \--{_bond1_}                  [_PV_]      |&lt;br /&gt;
|       _|__________                              |               |                              __________|_       |&lt;br /&gt;
|      [_shared-vg0_]                             |               |                             [_shared-vg0_]      |&lt;br /&gt;
|       _|_________________________               |               |               _________________________|_       |&lt;br /&gt;
|      [_/dev/shared-vg0/lv_shared_]              |               |              [_/dev/shared-vg0/lv_shared_]      |&lt;br /&gt;
|        |   ______    _________                  |               |                  _________    ______   |        |&lt;br /&gt;
|        \--[_GFS2_]--[_/shared_]                 |               |                 [_/shared_]--[_GFS2_]--/        |&lt;br /&gt;
|                                          _______|   _________   |_______                                          |&lt;br /&gt;
|                                         | bond1 =--| Storage |--= bond1 |                                         |&lt;br /&gt;
|                                         |______||  | Network |  ||______|                                         |&lt;br /&gt;
|_________________________________________________|  |_________|  |_________________________________________________|&lt;br /&gt;
.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Component; Clustered LVM ==&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;corosync&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 [[KVM]]&#039;s virtual machine guests 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 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 [[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;
{{note|1=GFS2 is &#039;&#039;&#039;only&#039;&#039;&#039; supported when run on top of Clustered LVM [[LV]]s. This is because, in certain error states, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;gfs2_controld&amp;lt;/span&amp;gt; will call &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;dmsetup&amp;lt;/span&amp;gt; to disconnect the GFS2 partition from its storage in certain failure states.}}&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]] for clustered storage and resource management.&lt;br /&gt;
&lt;br /&gt;
Whenever a resource, GFS2 filesystem or clustered LVM LV needs a lock, it sends a request to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;dlm_controld&amp;lt;/span&amp;gt; which runs in userspace. This communicates with DLM in kernel. If the lockspace does not yet exist, DLM will create it and then give the lock to the requester. Should a subsequant lock request come in for the same lockspace, it will be rejected. Once the application using the lock is finished with it, it will release the lock. After this, another node may request and receive a lock for the lockspace.&lt;br /&gt;
&lt;br /&gt;
If a node fails, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fenced&amp;lt;/span&amp;gt; will alert &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;dlm_controld&amp;lt;/span&amp;gt; that a fence is pending and new lock requests will block. After a successful fence, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fenced&amp;lt;/span&amp;gt; will alert DLM that the node is gone and any locks the victim node held are released. At this time, other nodes may request a lock on the lockspaces the lost node held and can perform recovery, like replaying a GFS2 filesystem journal, prior to resuming normal operation.&lt;br /&gt;
&lt;br /&gt;
Note that DLM locks are not used for actually locking the file system. That job is still handled by &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;plock()&amp;lt;/span&amp;gt; calls ([[POSIX]] locks).&lt;br /&gt;
&lt;br /&gt;
== Component; KVM ==&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 KVM [[hypervisor]] within which our highly-available virtual machine guests will reside. It is a type-1 hypervisor, which means that the host operating system runs directly on the bare hardware. Contrasted against Xen, which is a type-2 hypervisor where even the installed OS is itself just another virtual machine.&lt;br /&gt;
&lt;br /&gt;
= Node Installation =&lt;br /&gt;
&lt;br /&gt;
This section is going to be intentionally vague, as I don&#039;t want to influence too heavily what hardware you buy or how you install your operating systems. However, we need a baseline, a minimum system requirement of sorts. Also, I will refer fairly frequently to my setup, so I will share with you the details of what I bought. Please don&#039;t take this as an endorsement though... Every cluster will have its own needs, and you should plan and purchase for your particular needs.&lt;br /&gt;
&lt;br /&gt;
In my case, my goal was to have a low-power consumption setup and I knew that I would never put my cluster into production as it&#039;s strictly a research and design cluster. As such, I can afford to be quite modest.&lt;br /&gt;
&lt;br /&gt;
== Minimum Requirements ==&lt;br /&gt;
&lt;br /&gt;
This will cover two sections;&lt;br /&gt;
&lt;br /&gt;
* Node Minimum requirements&lt;br /&gt;
* Infrastructure requirements&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;nodes&#039;&#039;&#039; are the two separate servers that will, together, form the base of our cluster. The infrastructure covers the networking and the switched power bars called a &#039;&#039;&#039;[[PDU]]s&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
=== Node Requirements ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;General&#039;&#039;;&lt;br /&gt;
&lt;br /&gt;
As these nodes will host virtual machines, then will need sufficient [[RAM]] and provide [http://en.wikipedia.org/wiki/AMD-V#AMD_virtualization_.28AMD-V.29 virtualization-enabled] [[CPU]]s. Most, though not all, modern processors support hardware virtualization extensions. Finally, you need to have sufficient network bandwidth across two independent links to support the maximum burst storage traffic plus enough headroom to ensure that cluster traffic is never interrupted.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Network&#039;&#039;;&lt;br /&gt;
&lt;br /&gt;
This tutorial will use three independent networks, each using two physical interfaces in a bonded configuration. These will route through two separate managed switches for high-availability networking. Each network will be dedicated to a given traffic type. This requires six interfaces and, with a separate [[IPMI]] interface, consumes a staggering seven ports per node. &lt;br /&gt;
&lt;br /&gt;
Understanding that this may not be feasible, you can drop this to just two connections in a single bonded interface. If you decide to do this, you will need to configure [[QoS]] to ensure that [[totem]] [[multicast]] traffic gets highest priority as a delay of less than one second can cause the cluster to break. You also need to test sustained, heavy disk traffic to ensure that it doesn&#039;t cause problems. In particular, run storage tests from a virtual machine and then live-migrate that machine to create a &amp;quot;worst case&amp;quot; network load. If that succeeds, you are probably safe. All of this is outside of this tutorial&#039;s scope though.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Power&#039;&#039;;&lt;br /&gt;
&lt;br /&gt;
In production, you will want to use servers which have redundant power supplies and ensure that either side of the power connects to two separate power sources.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Out-of-Band Management&#039;&#039;;&lt;br /&gt;
&lt;br /&gt;
As we will discuss later, the ideal method of fencing a node is to use [[IPMI]] or one of the vendor-specific variants like HP&#039;s [[iLO]], Dell&#039;s [[DRAC]] or IBM&#039;s [[RSA]]. This allows another node in the cluster to force the host node to power off, regardless of the state of the operating system. Critically, it can confirm to the caller once the node has been shut down, which allows for the cluster to safely and confidently recover lost services.&lt;br /&gt;
&lt;br /&gt;
The two nodes used to create this tutorial have the following hardware (again, these will never see production use, so I could afford to go low);&lt;br /&gt;
* 1x Tyan [http://www.tyan.com/product_SKU_spec.aspx?ProductType=MB&amp;amp;pid=698&amp;amp;SKU=600000217 S5510GM3NR] Mainboard (note that the &#039;-LE&#039; has no IPMI)&lt;br /&gt;
* 1x Intel [http://ark.intel.com/products/52269?wapkw=%28E3-1220%29 Xeon E3-1220] CPU&lt;br /&gt;
* 2x Kingston [http://www.ec.kingston.com/ecom/configurator_new/partsinfo.asp?root=&amp;amp;LinkBack=&amp;amp;ktcpartno=KVR1333D3E9S/4GHB KVR1333D3E9S/4GHB] DDR3 ECC DIMMs&lt;br /&gt;
* 3x Intel [http://www.intel.com/products/desktop/adapters/gigabit-ct/gigabit-ct-overview.htm Gigabit CT] PCIe Ethernet adapters&lt;br /&gt;
&lt;br /&gt;
=== Infrastructure Requirements ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Network&#039;&#039;;&lt;br /&gt;
&lt;br /&gt;
You will need two separate switches in order to provide High Availability. These do not need to be stacked or even managed, but you do need to consider their actual capabilities and disregard the stated capacity. What I mean by this, in essence, is that not all gigabit equipment is equal. You will need to calculate how much bandwidth (in raw data throughput and as packets-per-second) and confirm that the switch can sustain that load. Most switches will rate these two values as their switching fabric capacity, so be sure to look closely at the specifications.&lt;br /&gt;
&lt;br /&gt;
Another thing to consider is whether you wish to run at an [[MTU]] higher that 1500 [[bytes]] per packet. This is generally referred to in specification sheets as &amp;quot;jumbo frame&amp;quot; support. However, many lesser companies will advertise support for jumbo frames, but they only support up to 4 [[KiB]]. Most professional networks looking to implement large MTU sizes aim for 9 [[KiB]] frame sizes, so be sure to look at the actual size of the largest supported jumbo frame before purchasing network equipment.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Power&#039;&#039;;&lt;br /&gt;
&lt;br /&gt;
As we will discuss later, we need a backup fence device. This will be implemented using a specific brand and model of switched power distribution unit, called a [[PDU]] which is effectively a power bar whose outlets can be independently turned on and off over the network. This tutorial uses an [ APC AP7900] PDU, but many others are available. Should you choose to use another make or model, you &#039;&#039;&#039;must&#039;&#039;&#039; first ensure that it has a supported [http://git.fedorahosted.org/git/?p=fence-agents.git;a=tree;f=fence/agents;hb=HEAD fence agent]. Ensuring this is an exercise for the reader.&lt;br /&gt;
&lt;br /&gt;
In production environments, it is ideal to have each PDU backed by its own [[UPS]], and each UPS connected to a separate mains electrical circuit. This way, the failure of a given PDU, UPS or mains circuit will not cause an interruption to the cluster. Do be sure to plan your power infrastructure to supply enough power to drive the entire cluster at full load in a failed state. That is, more plainly, don&#039;t divide the total load in two when planning your infrastructure. You must always plan for a failed state!&lt;br /&gt;
&lt;br /&gt;
Hardware used in this tutorial are;&lt;br /&gt;
* 2x D-Link [http://dlink.ca/products/?pid=DGS-3100-24 DGS-3100-24] 24-port Gbit switches supporting 10 [[KiB]] jumbo frames.&lt;br /&gt;
* 1x APC [http://www.apc.com/products/resource/include/techspec_index.cfm?base_sku=AP7900 AP7900] switched PDU (supported by the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[http://git.fedorahosted.org/git/?p=fence-agents.git;a=tree;f=fence/agents/apc_snmp;hb=HEAD fence_apc_snmp]&amp;lt;/span&amp;gt; fence agent).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Two Notes&#039;&#039;;&lt;br /&gt;
&lt;br /&gt;
# The D-Link switch I use is being phased out and is being replaced by the [http://dlink.ca/products/?pid=DGS-3120-24TC DGS-3120-24TC] models. The DGS-3120 models are much improved over the DGS-3100 series and can be safely used in stacked configuration (thus enabling the use of [[VLAN]] [[LAG]]s). The DGS-3100 would interrupt traffic when a switch in the stack recovered, which would partition the cluster. This forced me to unstack the switches in this tutorial.&lt;br /&gt;
# Given my budget, I could not afford to purchase redundant power supplies for use in this tutorial. As such, my test cluster has the power as a single point of failure. For learning, this is fine, but it is strongly ill-advised in production. I do show an example configuration of redundant [[PSU]] use spread across separate PDUs from a production cluster.&lt;br /&gt;
&lt;br /&gt;
== Pre-Installation Planning ==&lt;br /&gt;
&lt;br /&gt;
Before you assemble your servers, it is highly advised to first record the [[MAC]] addresses of the NICs. I always write a little file called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;node&amp;gt;-nics.txt&amp;lt;/span&amp;gt; matched to the device name I plan to set it to.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim ~/an-node01-nics.txt&lt;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	00:E0:81:C7:EC:49	# Back-Channel Network - Link 1&lt;br /&gt;
eth1	00:E0:81:C7:EC:48	# Storage Network - Link 1&lt;br /&gt;
eth2	00:E0:81:C7:EC:47	# Internet-Facing Network - Link 1&lt;br /&gt;
eth3	00:1B:21:9D:59:FC	# Back-Channel Network - Link 2&lt;br /&gt;
eth4	00:1B:21:BF:70:02	# Storage Network - Link 2&lt;br /&gt;
eth5	00:1B:21:BF:6F:FE	# Back-Channel Network - Link 2&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
How, or even if you record this is entirely up to you.&lt;br /&gt;
&lt;br /&gt;
== OS Installation ==&lt;br /&gt;
&lt;br /&gt;
{{warning|1=[[EL6]].1 shipped with a version of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[corosync]]&amp;lt;/span&amp;gt; that had a token retransmit bug. On slower systems, there would be a form of race condition which would cause &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[totem]]&amp;lt;/span&amp;gt; tokens the be retransmitted and cause significant performance problems. This has been resolved in [[EL6]].2 so please be sure to upgrade.}}&lt;br /&gt;
&lt;br /&gt;
Beyond being based on [[RHEL]] 6, there are no requirements for how the operating system is installed. This tutorial is written using &amp;quot;minimal&amp;quot; installs, and as such, installation instructions will be provided that will install all needed packages if they aren&#039;t already installed on your nodes.&lt;br /&gt;
&lt;br /&gt;
A few notes about the installation used for this tutorial;&lt;br /&gt;
* [[RHCS]] stable 3 supports &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[selinux]]&amp;lt;/span&amp;gt;, but it is disabled in this tutorial.&lt;br /&gt;
* Both &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; firewalls are disabled.&lt;br /&gt;
&lt;br /&gt;
Obviously, this significantly reduces the security of your nodes. For learning, which is the goal here, this helps keep a focus on the clustering and simplifies debugging when things go wrong. In production clusters though, these steps are ill advised. It is strongly suggested that you enable first the firewall, then when that is working, enabling &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;selinux&amp;lt;/span&amp;gt;. Leaving &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;selinux&amp;lt;/span&amp;gt; for last is intentional, as it generally takes the most work to get right.&lt;br /&gt;
&lt;br /&gt;
=== Network Security ===&lt;br /&gt;
&lt;br /&gt;
When building production clusters, you will want to consider two options with regard to network security.&lt;br /&gt;
&lt;br /&gt;
First, the interfaces connected to an untrusted network, like the Internet, should not have an IP address, though the interfaces themselves will need to be up so that virtual machines can route through them to the outside world. Alternatively, anything inbound from the virtual machines or inbound from the untrusted network should be &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;DROP&amp;lt;/span&amp;gt;ed by the firewall.&lt;br /&gt;
&lt;br /&gt;
Second, if you can not run the cluster communications or storage traffic on dedicated network connections over isolated subnets, you will need to configure the firewall to block everything except the ports needed by storage and cluster traffic. The default ports are below.&lt;br /&gt;
&lt;br /&gt;
* [http://docs.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/6/html-single/Cluster_Administration/index.html#s1-iptables_firewall-CA RHEL 6 Cluster Configuration, Firewall Setup]&lt;br /&gt;
* [http://docs.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/6/html-single/Cluster_Administration/index.html#s1-iptables_firewall-CA Linbit&#039;s DRBD, Firewall Configuration]&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
!Component&lt;br /&gt;
!Protocol&lt;br /&gt;
!Port&lt;br /&gt;
!Note&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[dlm]]&amp;lt;/span&amp;gt;&lt;br /&gt;
|[[TCP]]&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;21064&amp;lt;/span&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[drbd]]&amp;lt;/span&amp;gt;&lt;br /&gt;
|[[TCP]]&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;7788&amp;lt;/span&amp;gt;+&lt;br /&gt;
|Each [[DRBD]] resource will use an additional port, generally counting up (ie: &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;r0&amp;lt;/span&amp;gt; will use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;7788&amp;lt;/span&amp;gt;, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;r1&amp;lt;/span&amp;gt; will use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;7789&amp;lt;/span&amp;gt;, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;r2&amp;lt;/span&amp;gt; will use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;7790&amp;lt;/span&amp;gt; and so on).&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[luci]]&amp;lt;/span&amp;gt;&lt;br /&gt;
|[[TCP]]&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;8084&amp;lt;/span&amp;gt;&lt;br /&gt;
|Optional web-based configuration tool, not used in this tutorial.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[modclusterd]]&amp;lt;/span&amp;gt;&lt;br /&gt;
|[[TCP]]&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;16851&amp;lt;/span&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[ricci]]&amp;lt;/span&amp;gt;&lt;br /&gt;
|[[TCP]]&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;11111&amp;lt;/span&amp;gt;&lt;br /&gt;
|Each [[DRBD]] resource will use an additional port, generally counting up (ie: &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;r1&amp;lt;/span&amp;gt; will use &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;r2&amp;lt;/span&amp;gt; will use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;7791&amp;lt;/span&amp;gt; and so on).&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[totem]]&amp;lt;/span&amp;gt;&lt;br /&gt;
|[[UDP]]/[[multicast]]&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;
|Uses a multicast group for cluster communications&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{{note|1=As of [[EL6]].2, you can now use [[unicast]] for totem communication instead of multicast. This is &#039;&#039;&#039;not&#039;&#039;&#039; advised, and should only be used for clusters of two or three nodes on networks where unresolvable [[multicast]] issues exist. If using [[gfs2]], as we do here, using unicast for totem is strongly discouraged.}}&lt;br /&gt;
&lt;br /&gt;
As mentioned above, we will disable &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;selinux&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;iptables&amp;lt;/span&amp;gt;. This is to simplify the learning process and both should be enable pre-production.&lt;br /&gt;
&lt;br /&gt;
To disable the firewall (not that I disable both &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;
&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;
To disable &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;selinux&amp;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/selinux/config /etc/selinux/config.orig&lt;br /&gt;
vim /etc/selinux/config&lt;br /&gt;
diff -u /etc/selinux/config.orig /etc/selinux/config&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/selinux/config.orig	2012-06-15 18:13:12.416646749 -0400&lt;br /&gt;
+++ /etc/selinux/config	2012-06-15 18:09:46.920938956 -0400&lt;br /&gt;
@@ -4,7 +4,7 @@&lt;br /&gt;
 #     enforcing - SELinux security policy is enforced.&lt;br /&gt;
 #     permissive - SELinux prints warnings instead of enforcing.&lt;br /&gt;
 #     disabled - No SELinux policy is loaded.&lt;br /&gt;
-SELINUX=enforcing&lt;br /&gt;
+SELINUX=disabled&lt;br /&gt;
 # SELINUXTYPE= can take one of these two values:&lt;br /&gt;
 #     targeted - Targeted processes are protected,&lt;br /&gt;
 #     mls - Multi Level Security protection.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You &#039;&#039;&#039;must&#039;&#039;&#039; reboot for the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;selinux&amp;lt;/span&amp;gt; changes to take effect.&lt;br /&gt;
&lt;br /&gt;
= Network =&lt;br /&gt;
&lt;br /&gt;
Before we begin, let&#039;s take a look at a block diagram of what we&#039;re going to build. This will help when trying to see what we&#039;ll be talking about.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
                                                           ______________                                                         &lt;br /&gt;
                                                          [___Internet___]                                                        &lt;br /&gt;
  _____________________________________________________          |          _____________________________________________________ &lt;br /&gt;
 | [ an-node01 ]                                       |         |         |                                       [ an-node02 ] |&lt;br /&gt;
 |                       ____________    ______________|     ____|____     |______________    ____________                       |&lt;br /&gt;
 |                      |    vbr2    |--| bond2        |    | [ IFN ] |    |        bond2 |--|   vbr2     |                      |&lt;br /&gt;
 |  _________________   | 10.255.0.1 |  | ______       |   _|_________|_   |       ______ |  | 10.255.0.2 |  ................... |&lt;br /&gt;
 | | [ vm0001-dev ]  |  |____________|  || eth2 =--\   |  |   Switch 1  |  |   /--= eth2 ||  |____________|  :  [ vm0001-dev ] : |&lt;br /&gt;
 | | [ Dev Server ]  |    | | : :       ||_____|    \--=--|_____________|--=--/    |_____||       | | : :    :  [ Dev Server ] : |&lt;br /&gt;
 | |           ______|    | | : :       | ______    /--=--|   Switch 2  |--=--\    ______ |       | | : :    :.......          : |&lt;br /&gt;
 | |          | eth0 =----/ | : :       || eth5 =--/   |  |_____________|  |   \--= eth5 ||       | | : :----= eth0 :          : |&lt;br /&gt;
 | |          |_____||      | : :       ||_____|       |                   |       |_____||       | | :      ::.....:          : |&lt;br /&gt;
 | |      10.254.0.1 |      | : :       |______________|                   |______________|       | | :      :                 : |&lt;br /&gt;
 | |_________________|      | : :        ______________|                   |______________        | | :      :.................: |&lt;br /&gt;
 |                          | : :       | bond1        |     _________     |        bond1 |       | | :                          |&lt;br /&gt;
 |  _________________       | : :       |   10.10.0.1  |    | [ SN  ] |    | 10.10.0.2    |       | | :      ................... |&lt;br /&gt;
 | | [ vm0002-web ]  |      | : :       | ______       |   _|_________|_   |       ______ |       | | :      :  [ vm0002-web ] : |&lt;br /&gt;
 | | [ Web Server ]  |      | : :       || eth1 =--\   |  |   Switch 1  |  |   /--= eth1 ||       | | :      :  [ Web Server ] : |&lt;br /&gt;
 | |           ______|      | : :       ||_____|    \--=--|_____________|--=--/    |_____||       | | :      :.......          : |&lt;br /&gt;
 | |          | eth0 =------/ : :       | ______    /--=--|   Switch 2  |--=--\    ______ |       | | :------= eth0 :          : |&lt;br /&gt;
 | |          |_____||        : :       || eth4 =--/   |  |_____________|  |   \--= eth4 ||       | |        ::.....:          : |&lt;br /&gt;
 | |      10.254.0.2 |        : :       ||_____|       |                   |       |_____||       | |        :                 : |&lt;br /&gt;
 | |_________________|        : :       |______________|                   |______________|       | |        :.................: |&lt;br /&gt;
 |                            : :        ______________|                   |______________        | |                            |&lt;br /&gt;
 | ...................        : :       | bond0        |     _________     |        bond0 |       | |         _________________  |&lt;br /&gt;
 | : [ vm0003-db  ]  :        : :       |   10.20.0.1  |    | [ BCN ] |    | 10.20.0.2    |       | |        |  [ vm0003-db  ] | |&lt;br /&gt;
 | : [ DB Server  ]  :        : :       | ______       |   _|_________|_   |       ______ |       | |        |  [ DB Server  ] | |&lt;br /&gt;
 | :          .......:        : :       || eth0 =--\   |  |   Switch 1  |  |   /--= eth0 ||       | |        |______           | |&lt;br /&gt;
 | :          : eth0 =--------: :       ||_____|    \--=--|_____________|--=--/    |_____||       | \--------= eth0 |          | |&lt;br /&gt;
 | :          :.....::          :       | ______    /--=--|   Switch 2  |--=--\    ______ |       |          ||_____|          | |&lt;br /&gt;
 | :                 :          :       || eth3 =--/   |  |_____________|  |   \--= eth3 ||       |          | 10.254.0.3      | |&lt;br /&gt;
 | :.................:          :       ||_____|       |    | |     | |    |       |_____||       |          |_________________| |&lt;br /&gt;
 |                              :       |______________|    | |     | |    |______________|       |                              |&lt;br /&gt;
 | ...................          :                      |    | |     | |    |                      |           _________________  |&lt;br /&gt;
 | : [ vm0004-win ]  :          :                      |    | |     | |    |                      |          |  [ vm0004-win ] | |&lt;br /&gt;
 | : [ MS Server  ]  :          :                      |    | |     | |    |                      |          |  [ MS Server  ] | |&lt;br /&gt;
 | :          .......:          :                      |    | |     | |    |                      |          |______           | |&lt;br /&gt;
 | :          : NIC0 =----------:                      |    | |     | |    |                      \----------= NIC0 |          | |&lt;br /&gt;
 | :          :.....::                           ______|    | |     | |    |______                           ||_____|          | |&lt;br /&gt;
 | :                 :                  _____   | IPMI =----/ |     | \----= IPMI |   _____                  | 10.254.0.4      | |&lt;br /&gt;
 | :.................:                 [_BMC_]--|_____||      |     |      ||_____|--[_BMC_]                 |_________________| |&lt;br /&gt;
 |_____________________________________________________|      |     |      |_____________________________________________________|&lt;br /&gt;
                                       || ||               ___|_   _|___               || ||                                      &lt;br /&gt;
                                       || ||              | PDU | | PDU |              || ||                                      &lt;br /&gt;
                                       || ||              |  1  | |  2  |              || ||                                      &lt;br /&gt;
                                       || ||              |_____| |_____|              || ||                                      &lt;br /&gt;
                                       || ||               || ||   || ||               || ||                                      &lt;br /&gt;
                                       || \\==[ Power 1 ]==// ||   || \\==[ Power 1 ]==// ||                                      &lt;br /&gt;
                                       \\=====[ Power 2 ]=====||===//                     ||                                      &lt;br /&gt;
                                                              \\==========[ Power 2 ]=====//                                      &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The cluster will use three separate Class B networks;&lt;br /&gt;
&lt;br /&gt;
{{note|1=There are situations where it is not possible to add additional network cards, blades being a prime example. In these cases it will be up to the admin to decide how to proceed. If there is sufficient bandwidth, you can merge all networks, but it is advised in such cases to isolate IFN traffic from the SN/BCN traffic using [[VLAN]]s.}}&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Purpose&lt;br /&gt;
!Subnet&lt;br /&gt;
!Notes&lt;br /&gt;
|-&lt;br /&gt;
|Internet-Facing Network ([[IFN]])&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;10.255.0.0/16&amp;lt;/span&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
* Each node will use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;10.255.0.x&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 node ID.&amp;lt;br /&amp;gt;&lt;br /&gt;
* Virtual Machines in the cluster that need to be connected to the Internet will use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;192.168.1.0/24&amp;lt;/span&amp;gt;. These IPs are intentionally separate from the two nodes&#039; IFN bridge&#039;s IPs. If you are particularly concerned about security, you can drop the bridges&#039; IPs once the cluster is build and add a firewall rule to reject all traffic from the VMs. &lt;br /&gt;
|-&lt;br /&gt;
|Storage Network ([[SN]])&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;10.10.0.0/16&amp;lt;/span&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
* Each node will use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;10.10.0.x&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 node ID.&lt;br /&gt;
|-&lt;br /&gt;
|Back-Channel Network ([[BCN]])&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;10.20.0.0/16&amp;lt;/span&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
* Each node will use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;10.20.0.x&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 node ID.&amp;lt;br /&amp;gt;&lt;br /&gt;
* Node-specific [[IPMI]] or other out-of-band management devices will use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;10.20.1.x&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 node ID.&amp;lt;br /&amp;gt;&lt;br /&gt;
* Multi-port fence devices, switches and similar will use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;10.20.2.z&amp;lt;/span&amp;gt; where &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;z&amp;lt;/span&amp;gt; is a simple sequence.&amp;lt;br /&amp;gt;&lt;br /&gt;
Miscellaneous equipment in the cluster, like managed switches, will use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;10.20.3.z&amp;lt;/span&amp;gt; where &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;z&amp;lt;/span&amp;gt; is a simple sequence.&amp;lt;br /&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;Optional&#039;&#039; OpenVPN Network&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;10.30.0.0/16&amp;lt;/span&amp;gt;&lt;br /&gt;
|* For clients behind firewalls, I like to create a [[OpenVPN Server on EL6|VPN]] server for the cluster nodes to log into when support is needed. This way, the client retains control over when remote access is available simply by starting and stopping the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;openvpn&amp;lt;/span&amp;gt; daemon. This will not be discussed any further in this tutorial.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
We will be using six interfaces, bonded into three pairs of two NICs in Active/Passive (mode 1) configuration. Each link of each bond will be on alternate, unstacked switches. This configuration is the only configuration supported by [[Red Hat]] in clusters. We will also configure affinity by specifying interfaces &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth0&amp;lt;/span&amp;gt;, &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; as primary for the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;bond0&amp;lt;/span&amp;gt;, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;bond1&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;bond2&amp;lt;/span&amp;gt; interfaces, respectively. This way, when everything is working fine, all traffic is routed through the same switch for maximum performance.&lt;br /&gt;
&lt;br /&gt;
{{note|1=Only the bonded interface used by corosync must be in Active/Passive configuration (&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;bond0&amp;lt;/span&amp;gt; in this tutorial). If you want to experiment with other bonding modes for &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;bond1&amp;lt;/span&amp;gt; or &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;bond2&amp;lt;/span&amp;gt;, please feel free to do so. That is outside the scope of this tutorial, however.}}&lt;br /&gt;
&lt;br /&gt;
If you can not install six interfaces in your server, then four interfaces will do with the [[SN]] and [[BCN]] networks merged.&lt;br /&gt;
&lt;br /&gt;
{{warning|1=If you wish to merge the [[SN]] and [[BCN]] onto one interface, test to ensure that the storage traffic will not block cluster communication. Test by forming your cluster and then pushing your storage to maximum read and write performance for an extended period of time (minimum of several seconds). If the cluster partitions, you will need to do some advanced quality-of-service or other network configuration to ensure reliable delivery of cluster network traffic.}}&lt;br /&gt;
&lt;br /&gt;
In this tutorial, we will use two [http://dlink.ca/products/?pid=DGS-3120-24TC D-Link DGS-3120-24TC/SI], stacked, using three [[VLAN]]s to isolate the three networks.&lt;br /&gt;
* [[BCN]] will have VLAN ID of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt;, which is the default VLAN.&lt;br /&gt;
* [[SN]] will have VLAN ID number 100.&lt;br /&gt;
* [[IFN]] will have VLAN ID number 101.&lt;br /&gt;
&lt;br /&gt;
{{note|Switch configuration [[D-Link_Notes|details]].}}&lt;br /&gt;
&lt;br /&gt;
The actual mapping of interfaces to bonds to networks will be:&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Subnet&lt;br /&gt;
!Cable Colour&lt;br /&gt;
![[VLAN]] ID&lt;br /&gt;
!Link 1&lt;br /&gt;
!Link 2&lt;br /&gt;
!Bond&lt;br /&gt;
!IP&lt;br /&gt;
|-&lt;br /&gt;
|[[BCN]]&lt;br /&gt;
|Blue&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt;&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;eth3&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;bond0&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;10.20.0.x&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|[[SN]]&lt;br /&gt;
|Green&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;100&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth1&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth4&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;bond1&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;10.10.0.x&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|[[IFN]]&lt;br /&gt;
|Black&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;101&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth2&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth5&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;bond2&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;10.255.0.x&amp;lt;/span&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Setting Up the Network ==&lt;br /&gt;
&lt;br /&gt;
{{warning|1=The following steps can easily get confusing, given how many files we need to edit. Losing access to your server&#039;s network is a very real possibility! &#039;&#039;&#039;Do not continue without direct access to your servers!&#039;&#039;&#039; If you have out-of-band access via [[iKVM]], console redirection or similar, be sure to test that it is working before proceeding.}}&lt;br /&gt;
&lt;br /&gt;
=== Planning The Use of Physical Interfaces ===&lt;br /&gt;
&lt;br /&gt;
In production clusters, I generally intentionally get three separate dual-port controllers (two on-board interfaces plus two separate dual-port PCIe cards). I then ensure that no bond uses two interfaces on the same physical board. Thus, should a card or its bus interface fail, none of the bonds will fail completely.&lt;br /&gt;
&lt;br /&gt;
Lets take a look at an example layout;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
 ____________________                            &lt;br /&gt;
| [ an-node01 ]      |                           &lt;br /&gt;
|         ___________|      _______              &lt;br /&gt;
|        |     ______|     | bond0 |             &lt;br /&gt;
|        | O  | eth0 =-----=---.---=------------{&lt;br /&gt;
|        | n  |_____||  /--=--/    |             &lt;br /&gt;
|        | b         |  |  |_______|  _______    &lt;br /&gt;
|        | o   ______|  |            | bond1 |   &lt;br /&gt;
|        | a  | eth1 =--|------------=---.---=--{&lt;br /&gt;
|        | r  |_____||  |  /---------=--/    |   &lt;br /&gt;
|        | d         |  |  |         |_______|   &lt;br /&gt;
|        |___________|  |  |                     &lt;br /&gt;
|         ___________|  |  |      _______        &lt;br /&gt;
|        |     ______|  |  |     | bond2 |       &lt;br /&gt;
|        | P  | eth2 =--|--|-----=---.---=------{&lt;br /&gt;
|        | C  |_____||  |  |  /--=--/    |       &lt;br /&gt;
|        | I         |  |  |  |  |_______|       &lt;br /&gt;
|        | e   ______|  |  |  |                  &lt;br /&gt;
|        |    | eth3 =--/  |  |                  &lt;br /&gt;
|        | 1  |_____||     |  |                  &lt;br /&gt;
|        |___________|     |  |                  &lt;br /&gt;
|         ___________|     |  |                  &lt;br /&gt;
|        |     ______|     |  |                  &lt;br /&gt;
|        | P  | eth4 =-----/  |                  &lt;br /&gt;
|        | C  |_____||        |                  &lt;br /&gt;
|        | I         |        |                  &lt;br /&gt;
|        | e   ______|        |                  &lt;br /&gt;
|        |    | eth5 =--------/                  &lt;br /&gt;
|        | 2  |_____||                           &lt;br /&gt;
|        |___________|                           &lt;br /&gt;
|____________________|                           &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Consider the possible failure scenarios;&lt;br /&gt;
* The on-board controllers fail;&lt;br /&gt;
** &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;bond0&amp;lt;/span&amp;gt; falls back onto &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth3&amp;lt;/span&amp;gt; on the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;PCIe 1&amp;lt;/span&amp;gt; controller.&lt;br /&gt;
** &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;bond1&amp;lt;/span&amp;gt; falls back onto &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth4&amp;lt;/span&amp;gt; on the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;PCIe 2&amp;lt;/span&amp;gt; controller.&lt;br /&gt;
** &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;bond2&amp;lt;/span&amp;gt; is unaffected.&lt;br /&gt;
* The PCIe #1 controller fails&lt;br /&gt;
** &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;bond0&amp;lt;/span&amp;gt; remains on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth0&amp;lt;/span&amp;gt; interface but losses its redundancy as &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth3&amp;lt;/span&amp;gt; is down.&lt;br /&gt;
** &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;bond1&amp;lt;/span&amp;gt; is unaffected.&lt;br /&gt;
** &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;bond2&amp;lt;/span&amp;gt; falls back onto &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth5&amp;lt;/span&amp;gt; on the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;PCIe 2&amp;lt;/span&amp;gt; controller.&lt;br /&gt;
* The PCIe #2 controller fails&lt;br /&gt;
** &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;bond0&amp;lt;/span&amp;gt; is unaffected.&lt;br /&gt;
** &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;bond1&amp;lt;/span&amp;gt; remains on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth1&amp;lt;/span&amp;gt; interface but losses its redundancy as &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth4&amp;lt;/span&amp;gt; is down.&lt;br /&gt;
** &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;bond2&amp;lt;/span&amp;gt; remains on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth2&amp;lt;/span&amp;gt; interface but losses its redundancy as &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth5&amp;lt;/span&amp;gt; is down.&lt;br /&gt;
&lt;br /&gt;
In all three failure scenarios, no network interruption occurs making for the most robust configuration possible.&lt;br /&gt;
&lt;br /&gt;
=== Managed and Stacking Switch Notes ===&lt;br /&gt;
&lt;br /&gt;
{{note|1=If you have two stacked switches, be extra careful to test them to ensure that traffic will not block when a switch is lost or is recovering!}}&lt;br /&gt;
&lt;br /&gt;
There are two things you need to be wary of with managed switches.&lt;br /&gt;
&lt;br /&gt;
* Don&#039;t stack them unless you can confirm that there will be no interruption in traffic flow on the surviving switch when the lost switch disappears or recovers. It may seem like it makes sense to stack them and create Link Aggregation Groups, but this can cause problems. When in doubt, don&#039;t stack the switches.&lt;br /&gt;
* Disable Spanning Tree Protocol on all ports used by the cluster. Otherwise, when a lost switch is recovered, STP negotiation will cause traffic to stop on the ports for upwards of thirty seconds. This is more than enough time to partition a cluster.&lt;br /&gt;
&lt;br /&gt;
If you use three [[VLAN]]s across two unstacked switches, be sure to use a dedicate uplink for each VLAN. You may need to enable [[STP]] of these uplinks to avoid switch loops if the VLANs themselves are not enough. The reason for doing this is to ensure that cluster communications always have a clear path for traffic. If you had only one uplink between the two switches, and you found yourself in a situation where a node&#039;s [[BCN]] and [[SN]] faulted through the backup switch, the storage traffic could saturate the uplink and cause intolerable latency for the BCN traffic, leading to cluster partitioning.&lt;br /&gt;
&lt;br /&gt;
=== Connecting Fence Devices ===&lt;br /&gt;
&lt;br /&gt;
As we will see soon, each node can be fenced either by calling its [[IPMI]] interface or by calling the [[PDU]] and cutting the node&#039;s power. Each of these methods are inherently single points of failure as each has only one network connection. To work around this concern, we will connect all IPMI interfaces to one switch and the PDUs to the secondary switch. This way, should a switch fail, only one of the two fence devices will fail and fencing in general will still be possible via the alternate fence device.&lt;br /&gt;
&lt;br /&gt;
Generally speaking, I like to connect the IPMI interfaces to the primary switch and the PDUs to the backup switch.&lt;br /&gt;
&lt;br /&gt;
=== Making Sure We Know Our Interfaces ===&lt;br /&gt;
&lt;br /&gt;
When you installed the operating system, the network interfaces names are somewhat randomly assigned to the physical network interfaces. It more than likely that you will want to re-order. &lt;br /&gt;
&lt;br /&gt;
Before you start moving interface names around, you will want to consider which physical interfaces you will want to use on which networks. At the end of the day, the names themselves have no meaning. At the very least though, make them consistent across nodes.&lt;br /&gt;
&lt;br /&gt;
Some things to consider, in order of importance:&lt;br /&gt;
&lt;br /&gt;
* If you have a shared interface for your out-of-band management interface, like [[IPMI]] or [[iLO]], you will want that interface to be on the [[Back-Channel Network]].&lt;br /&gt;
* For redundancy, you want to spread out which interfaces are paired up. In my case, I have three interfaces on my mainboard and three additional add-in cards. I will pair each onboard interface with an add-in interface. In my case, my IPMI interface physically piggy-backs on one of the onboard interfaces so this interface will need to be part of the [[BCN]] bond.&lt;br /&gt;
* Your interfaces with the lowest latency should be used for the back-channel network.&lt;br /&gt;
* Your two fastest interfaces should be used for your storage network.&lt;br /&gt;
* The remaining two slowest interfaces should be used for the [[Internet-Facing Network]] bond.&lt;br /&gt;
&lt;br /&gt;
In my case, all six interfaces are identical, so there is little to consider. The left-most interface on my system has IPMI, so its paired network interface will be &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth0&amp;lt;/span&amp;gt;. I simply work my way left, incrementing as I go. What you do will be whatever makes most sense to you.&lt;br /&gt;
&lt;br /&gt;
There is a separate, short tutorial on re-ordering network interface;&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;[[Changing the ethX to Ethernet Device Mapping in EL6 and Fedora 12+]]&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Once you have the physical interfaces named the way you like, proceed to the next step.&lt;br /&gt;
&lt;br /&gt;
=== Planning Our Network ===&lt;br /&gt;
&lt;br /&gt;
To setup our network, we will need to edit the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ifcfg-ethX&amp;lt;/span&amp;gt;, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ifcfg-bondX&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ifcfg-vbr2&amp;lt;/span&amp;gt; scripts. The last one will create a bridge, like a virtual network switch, which will be used to route network connections between the virtual machines and the outside world, via the [[IFN]]. You will note that the bridge will have the [[IP]] addresses, not the bonded interface &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;bond2&amp;lt;/span&amp;gt;. It will instead be slaved to the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vbr2&amp;lt;/span&amp;gt; bridge.&lt;br /&gt;
&lt;br /&gt;
We&#039;re going to be editing a lot of files. It&#039;s best to lay out what we&#039;ll be doing in a chart. So our setup will be:&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
!Node&lt;br /&gt;
!BCN IP and Device&lt;br /&gt;
!SN IP and Device&lt;br /&gt;
!IFN IP and Device&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;10.20.0.1&amp;lt;/span&amp;gt; on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;bond0&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;10.10.0.1&amp;lt;/span&amp;gt; on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;bond1&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;10.255.0.1&amp;lt;/span&amp;gt; on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vbr2&amp;lt;/span&amp;gt; (&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;bond2&amp;lt;/span&amp;gt; slaved)&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;10.20.0.2&amp;lt;/span&amp;gt; on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;bond0&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;10.10.0.2&amp;lt;/span&amp;gt; on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;bond1&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;10.255.0.2&amp;lt;/span&amp;gt; on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vbr2&amp;lt;/span&amp;gt; (&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;bond2&amp;lt;/span&amp;gt; slaved)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Switch Network Daemons ===&lt;br /&gt;
&lt;br /&gt;
The new &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;NetworkManager&amp;lt;/span&amp;gt; daemon is much more flexible and is perfect for machines like laptops which move around networks a lot. However, it does this by making a lot of decisions for you and changing the network as it sees fit. As good as this is for laptops and the like, it&#039;s not appropriate for servers. We will want to use the traditional &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;network&amp;lt;/span&amp;gt; service.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum remove NetworkManager&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now enable &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;network&amp;lt;/span&amp;gt; to start 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;
chkconfig --list network&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;
network        	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;
=== Creating Some Network Configuration Files ===&lt;br /&gt;
&lt;br /&gt;
{{warning|1=Bridge configuration files &#039;&#039;&#039;must&#039;&#039;&#039; have a file name which will sort &#039;&#039;&#039;after&#039;&#039;&#039; the interface and bridge files. The actual device name can be whatever you want though. If the system tries to start a bridge before its slaved interface is up, it will fail. I personally like to use the name &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vbrX&amp;lt;/span&amp;gt; for &amp;quot;&#039;&#039;&#039;v&#039;&#039;&#039;irtual machine &#039;&#039;&#039;br&#039;&#039;&#039;idge&amp;quot;. You can use whatever makes sense to you, with the above concern in mind.}}&lt;br /&gt;
&lt;br /&gt;
Start by &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;touch&amp;lt;/span&amp;gt;ing the configuration files we will need.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
touch /etc/sysconfig/network-scripts/ifcfg-bond{0,1,2}&lt;br /&gt;
touch /etc/sysconfig/network-scripts/ifcfg-vbr2&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now make a backup of your configuration files, in case something goes wrong and you want to start over.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
mkdir /root/backups/&lt;br /&gt;
rsync -av /etc/sysconfig/network-scripts/ifcfg-eth* /root/backups/&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
sending incremental file list&lt;br /&gt;
ifcfg-eth0&lt;br /&gt;
ifcfg-eth1&lt;br /&gt;
ifcfg-eth2&lt;br /&gt;
ifcfg-eth3&lt;br /&gt;
ifcfg-eth4&lt;br /&gt;
ifcfg-eth5&lt;br /&gt;
&lt;br /&gt;
sent 1467 bytes  received 126 bytes  3186.00 bytes/sec&lt;br /&gt;
total size is 1119  speedup is 0.70&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Configuring The Bridge ===&lt;br /&gt;
&lt;br /&gt;
We&#039;ll start in reverse order, crafting the bridge&#039;s script first.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;&#039;&#039;&#039; IFN Bridge:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/sysconfig/network-scripts/ifcfg-vbr2&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;
# Internet-Facing Network - Bridge&lt;br /&gt;
DEVICE=&amp;quot;vbr2&amp;quot;&lt;br /&gt;
TYPE=&amp;quot;Bridge&amp;quot;&lt;br /&gt;
BOOTPROTO=&amp;quot;static&amp;quot;&lt;br /&gt;
IPADDR=&amp;quot;10.255.0.1&amp;quot;&lt;br /&gt;
NETMASK=&amp;quot;255.255.0.0&amp;quot;&lt;br /&gt;
GATEWAY=&amp;quot;10.255.255.254&amp;quot;&lt;br /&gt;
DNS1=&amp;quot;78.46.37.135&amp;quot;&lt;br /&gt;
DNS2=&amp;quot;192.139.81.117&amp;quot;&lt;br /&gt;
DEFROUTE=&amp;quot;yes&amp;quot;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Creating the Bonded Interfaces ===&lt;br /&gt;
&lt;br /&gt;
Next up, we&#039;ll can create the three bonding configuration files. This is where two physical network interfaces are tied together to work like a single, highly available network interface. You can think of a bonded interface as being akin to [[TLUG_Talk:_Storage_Technologies_and_Theory#Level_1|RAID level 1]]; A new virtual device is created out of two real devices.&lt;br /&gt;
&lt;br /&gt;
We&#039;re going to see a long line called &amp;quot;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[http://docs.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/6/html/Deployment_Guide/sec-Using_Channel_Bonding.html BONDING_OPTS]&amp;lt;/span&amp;gt;&amp;quot;. Let&#039;s look at the meaning of these options before we look at the configuration; &lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;mode=1&amp;lt;/span&amp;gt; sets the bonding mode to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;active-backup&amp;lt;/span&amp;gt;. &lt;br /&gt;
* The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;miimon=100&amp;lt;/span&amp;gt; tells the bonding driver to check if the network cable has been unplugged or plugged in every 100 milliseconds. &lt;br /&gt;
* The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;use_carrier=1&amp;lt;/span&amp;gt; tells the driver to use the driver to maintain the link state. Some drivers don&#039;t support that. If you run into trouble, try changing this to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;0&amp;lt;/span&amp;gt;. &lt;br /&gt;
* The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;updelay=120000&amp;lt;/span&amp;gt; tells the driver to delay switching back to the primary interface for 120,000 milliseconds (2 minutes). This is designed to give the switch connected to the primary interface time to finish booting. Setting this too low may cause the bonding driver to switch back before the network switch is ready to actually move data. Some switches will not provide a link until it is fully booted, so please experiment.&lt;br /&gt;
* The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;downdelay=0&amp;lt;/span&amp;gt; tells the driver not to wait before changing the state of an interface when the link goes down. That is, when the driver detects a fault, it will switch to the backup interface immediately.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;&#039;&#039;&#039; BCN Bond:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/sysconfig/network-scripts/ifcfg-bond0&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;
# Back-Channel Network - Bond&lt;br /&gt;
DEVICE=&amp;quot;bond0&amp;quot;&lt;br /&gt;
BOOTPROTO=&amp;quot;static&amp;quot;&lt;br /&gt;
NM_CONTROLLED=&amp;quot;no&amp;quot;&lt;br /&gt;
ONBOOT=&amp;quot;yes&amp;quot;&lt;br /&gt;
BONDING_OPTS=&amp;quot;mode=1 miimon=100 use_carrier=1 updelay=120000 downdelay=0 primary=eth0&amp;quot;&lt;br /&gt;
IPADDR=&amp;quot;10.20.0.1&amp;quot;&lt;br /&gt;
NETMASK=&amp;quot;255.255.0.0&amp;quot;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;&#039;&#039;&#039; SN Bond:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/sysconfig/network-scripts/ifcfg-bond1&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;
# Storage Network - Bond&lt;br /&gt;
DEVICE=&amp;quot;bond1&amp;quot;&lt;br /&gt;
BOOTPROTO=&amp;quot;static&amp;quot;&lt;br /&gt;
NM_CONTROLLED=&amp;quot;no&amp;quot;&lt;br /&gt;
ONBOOT=&amp;quot;yes&amp;quot;&lt;br /&gt;
BONDING_OPTS=&amp;quot;mode=1 miimon=100 use_carrier=1 updelay=120000 downdelay=0 primary=eth1&amp;quot;&lt;br /&gt;
IPADDR=&amp;quot;10.10.0.1&amp;quot;&lt;br /&gt;
NETMASK=&amp;quot;255.255.0.0&amp;quot;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;&#039;&#039;&#039; IFN Bond:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/sysconfig/network-scripts/ifcfg-bond2&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;
# Internet-Facing Network - Bond&lt;br /&gt;
DEVICE=&amp;quot;bond2&amp;quot;&lt;br /&gt;
BRIDGE=&amp;quot;vbr2&amp;quot;&lt;br /&gt;
BOOTPROTO=&amp;quot;none&amp;quot;&lt;br /&gt;
NM_CONTROLLED=&amp;quot;no&amp;quot;&lt;br /&gt;
ONBOOT=&amp;quot;yes&amp;quot;&lt;br /&gt;
BONDING_OPTS=&amp;quot;mode=1 miimon=100 use_carrier=1 updelay=120000 downdelay=0 primary=eth2&amp;quot;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Alter The Interface Configurations ===&lt;br /&gt;
&lt;br /&gt;
With the bridge and bonds in place, we can now alter the interface configurations.&lt;br /&gt;
&lt;br /&gt;
Which two interfaces you use in a given bond is entirely up to you. I&#039;ve found it easiest to keep straight when I match the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;bondX&amp;lt;/span&amp;gt; to the primary interface&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ethX&amp;lt;/span&amp;gt; number.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;&#039;&#039;&#039;&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth0&amp;lt;/span&amp;gt;, the BCN &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;bond0&amp;lt;/span&amp;gt;, Link 1:&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;
# Back-Channel Network - Link 1&lt;br /&gt;
HWADDR=&amp;quot;00:E0:81:C7:EC:49&amp;quot;&lt;br /&gt;
DEVICE=&amp;quot;eth0&amp;quot;&lt;br /&gt;
NM_CONTROLLED=&amp;quot;no&amp;quot;&lt;br /&gt;
ONBOOT=&amp;quot;yes&amp;quot;&lt;br /&gt;
BOOTPROTO=&amp;quot;none&amp;quot;&lt;br /&gt;
MASTER=&amp;quot;bond0&amp;quot;&lt;br /&gt;
SLAVE=&amp;quot;yes&amp;quot;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;&#039;&#039;&#039;&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth1&amp;lt;/span&amp;gt;, the SN &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;bond1&amp;lt;/span&amp;gt;, Link 1:&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;
# Storage Network - Link 1&lt;br /&gt;
HWADDR=&amp;quot;00:E0:81:C7:EC:48&amp;quot;&lt;br /&gt;
DEVICE=&amp;quot;eth1&amp;quot;&lt;br /&gt;
NM_CONTROLLED=&amp;quot;no&amp;quot;&lt;br /&gt;
ONBOOT=&amp;quot;yes&amp;quot;&lt;br /&gt;
BOOTPROTO=&amp;quot;none&amp;quot;&lt;br /&gt;
MASTER=&amp;quot;bond1&amp;quot;&lt;br /&gt;
SLAVE=&amp;quot;yes&amp;quot;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;&#039;&#039;&#039;&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth2&amp;lt;/span&amp;gt;, the IFN &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;bond2&amp;lt;/span&amp;gt;, Link 1:&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;
# Internet-Facing Network - Link 1&lt;br /&gt;
HWADDR=&amp;quot;00:E0:81:C7:EC:47&amp;quot;&lt;br /&gt;
DEVICE=&amp;quot;eth2&amp;quot;&lt;br /&gt;
NM_CONTROLLED=&amp;quot;no&amp;quot;&lt;br /&gt;
ONBOOT=&amp;quot;yes&amp;quot;&lt;br /&gt;
BOOTPROTO=&amp;quot;none&amp;quot;&lt;br /&gt;
MASTER=&amp;quot;bond2&amp;quot;&lt;br /&gt;
SLAVE=&amp;quot;yes&amp;quot;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;&#039;&#039;&#039;&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth3&amp;lt;/span&amp;gt;, the BCN &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;bond0&amp;lt;/span&amp;gt;, Link 2:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/sysconfig/network-scripts/ifcfg-eth3&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;
# Back-Channel Network - Link 2&lt;br /&gt;
HWADDR=&amp;quot;00:1B:21:9D:59:FC&amp;quot;&lt;br /&gt;
DEVICE=&amp;quot;eth3&amp;quot;&lt;br /&gt;
NM_CONTROLLED=&amp;quot;no&amp;quot;&lt;br /&gt;
ONBOOT=&amp;quot;yes&amp;quot;&lt;br /&gt;
BOOTPROTO=&amp;quot;none&amp;quot;&lt;br /&gt;
MASTER=&amp;quot;bond0&amp;quot;&lt;br /&gt;
SLAVE=&amp;quot;yes&amp;quot;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;&#039;&#039;&#039;&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth4&amp;lt;/span&amp;gt;, the SN &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;bond1&amp;lt;/span&amp;gt;, Link 2:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/sysconfig/network-scripts/ifcfg-eth4&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;
# Storage Network - Link 2&lt;br /&gt;
HWADDR=&amp;quot;00:1B:21:BF:70:02&amp;quot;&lt;br /&gt;
DEVICE=&amp;quot;eth4&amp;quot;&lt;br /&gt;
NM_CONTROLLED=&amp;quot;no&amp;quot;&lt;br /&gt;
ONBOOT=&amp;quot;yes&amp;quot;&lt;br /&gt;
BOOTPROTO=&amp;quot;none&amp;quot;&lt;br /&gt;
MASTER=&amp;quot;bond1&amp;quot;&lt;br /&gt;
SLAVE=&amp;quot;yes&amp;quot;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;&#039;&#039;&#039;&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth5&amp;lt;/span&amp;gt;, the IFN &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;bond2&amp;lt;/span&amp;gt;, Link 2:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/sysconfig/network-scripts/ifcfg-eth5&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;
# Internet-Facing Network - Link 2&lt;br /&gt;
HWADDR=&amp;quot;00:1B:21:BF:6F:FE&amp;quot;&lt;br /&gt;
DEVICE=&amp;quot;eth5&amp;quot;&lt;br /&gt;
NM_CONTROLLED=&amp;quot;no&amp;quot;&lt;br /&gt;
ONBOOT=&amp;quot;yes&amp;quot;&lt;br /&gt;
BOOTPROTO=&amp;quot;none&amp;quot;&lt;br /&gt;
MASTER=&amp;quot;bond2&amp;quot;&lt;br /&gt;
SLAVE=&amp;quot;yes&amp;quot;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Loading The New Network Configuration ==&lt;br /&gt;
&lt;br /&gt;
Simple restart the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;network&amp;lt;/span&amp;gt; service.&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;
&lt;br /&gt;
== Updating /etc/hosts ==&lt;br /&gt;
&lt;br /&gt;
On both nodes, update the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/hosts&amp;lt;/span&amp;gt; file to reflect your network configuration. Remember to add entries for your [[IPMI]], switched PDUs and other devices.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/hosts&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4&lt;br /&gt;
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6&lt;br /&gt;
&lt;br /&gt;
# an-node01&lt;br /&gt;
10.20.0.1	an-node01 an-node01.bcn an-node01.alteeve.com&lt;br /&gt;
10.20.1.1	an-node01.ipmi&lt;br /&gt;
10.10.0.1	an-node01.sn&lt;br /&gt;
10.255.0.1	an-node01.ifn&lt;br /&gt;
&lt;br /&gt;
# an-node01&lt;br /&gt;
10.20.0.2	an-node02 an-node02.bcn an-node02.alteeve.com&lt;br /&gt;
10.20.1.2	an-node02.ipmi&lt;br /&gt;
10.10.0.2	an-node02.sn&lt;br /&gt;
10.255.0.2	an-node02.ifn&lt;br /&gt;
&lt;br /&gt;
# Fence devices&lt;br /&gt;
10.20.2.1       pdu1 pdu1.alteeve.com&lt;br /&gt;
10.20.2.2       pdu2 pdu2.alteeve.com&lt;br /&gt;
&lt;br /&gt;
# VPN interfaces, if used.&lt;br /&gt;
10.30.0.1	an-node01.vpn&lt;br /&gt;
10.30.0.2	an-node02.vpn&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{warning|1=Remember, which ever switch you have the IPMI interfaces connected to, be sure to connect the PDU into the &#039;&#039;&#039;opposite&#039;&#039;&#039; switch! If both fence types are on one switch, then that switch becomes a single point of failure!}}&lt;br /&gt;
&lt;br /&gt;
{{note|1=I like to run an [[OpenVPN Server on EL6|OpenVPN]] server and set up my remote clusters and customers as clients on this VPN to enable rapid, secure remote access when the client&#039;s firewall blocks inbound connections. This offers the client the option of disabling the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;openvpn&amp;lt;/span&amp;gt; client daemon until they wish to enable access. This tends to be easier for the client to manage as opposed to manipulating the firewall on demand. This will be the only mention of the VPN in this tutorial, but explains the last entries in the file above.}}&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 its tools, like &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 its 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;
4a:52:a1:c7:60:d5:e8:6d:c4:75:20:dd:62:2b:86:c5 root@an-node01.alteeve.com&lt;br /&gt;
The key&#039;s randomart image is:&lt;br /&gt;
+--[ RSA 2047]----+&lt;br /&gt;
|    o.o=.ooo.    |&lt;br /&gt;
|   . +..E.+..    |&lt;br /&gt;
|    ..+= . o     |&lt;br /&gt;
|     oo = .      |&lt;br /&gt;
|    . .oS.       |&lt;br /&gt;
|     o .         |&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;
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;
If you look closely when you created the ssh key, the node&#039;s fingerprint is show (&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;4a:52:a1:c7:60:d5:e8:6d:c4:75:20:dd:62:2b:86:c5&amp;lt;/span&amp;gt; for &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt; above). Make a note of the fingerprint for each machine, and then compare it to the one presented to you when you ssh to a machine for the first time. If you are presented with a fingerprint that doesn&#039;t match, you could be facing a &amp;quot;man in the middle&amp;quot; attack. &lt;br /&gt;
&lt;br /&gt;
To look up a fingerprint in the future, you can run the following;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ssh-keygen -l -f ~/.ssh/id_rsa&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;
2047 4a:52:a1:c7:60:d5:e8:6d:c4:75:20:dd:62:2b:86:c5 /root/.ssh/id_rsa.pub (RSA)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The two newly generated 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;
MIIEnwIBAAKCAQBs+CsWeKegqmtneZcLDvHV4QT1n+ajj98gkmjoLcIFW5g/VFRL&lt;br /&gt;
pSMMkwkQBgGDkmKPvYFa5OolL6qBQSAN1NpP8zET+1lZr4OFg/TZTuA8QnhNeh6V&lt;br /&gt;
mU2hSoyJfEkKJ6TVYg4s1rsbbTZPLdCDe9CMn/iI824WUu2wA8RwhF2WTqqTrWTW&lt;br /&gt;
4h8tYK9Y4eT4IYMXiYZ8+eQfzHyMaNxvUcI1Z8heMn/CEnrA67ja7Czi/ljYnw0I&lt;br /&gt;
3MXy9d2ANYjYahBLF2+ok19NS9tkFHDlcZTh0gTQ4vV5fksgdJjsWl5l/aLjnSRf&lt;br /&gt;
x2pQrMl3w8U7JBpr0PWJPIuzd4q47+KBI1A9AgEjAoIBADTtkUVtzcMQ8lbUqHMV&lt;br /&gt;
4y1eqqMwaLXYKowp2y7xp2GwJWCWrJnFPOjZs/HXCAy00Ml5TXVKnZ0IhgRENCP5&lt;br /&gt;
q92wos8w8OJrMUDZsXDdKxX0ZlGEdUFZFxPTwJqM0wTuryXQiorOsqbr5y3Fy62T&lt;br /&gt;
6PPYq+q/YVtM2dkmZrpO66DGcTkBA8tq8tTU3TdqZEVfmCzM9DIGz2hprvky+yDU&lt;br /&gt;
Pa296CP7+lHFty34K6j/WxD49+aKrdxXxdLbH/3Wfq7a9fu/FuYObPRtXoYRJNGP&lt;br /&gt;
ZEzfVoNwVdc3vETuzZPDoidkc4jomA4vM4cTS1EvwEWVHfaSdIE0wF16N1FlDgNA&lt;br /&gt;
hKsCgYEA9Xp5vGoPRer3hTSglGrPOTTkGEhXiE/JDMZ7w4fk2lXo+Q7HqxetrS6l&lt;br /&gt;
hMxY+x2W0FBfKwJqBuhVv4Y5MPLbC2JazwYDoP85g6RWH72ebsqdYwYvSx808iDs&lt;br /&gt;
C8HArWv8RtQ/K1pRVkq0GPhTdc22sYE9aKa5Hc6nd0SEmq+hLoUCgYBxo9c3M28h&lt;br /&gt;
jDpxwTkYszMfpIb++tCSrcBw8guqdqjhW6yH9kXva3NjfuzpOisb7cFN6dcSqjaC&lt;br /&gt;
HEZjpBWPUGLOPMnL1/mSsTErusgyh2+x8WjRjuqBJrh7CDN8gejMiski5nALQpxt&lt;br /&gt;
s6PKI5WHVqPQ395+549LQnoaCROyf4TUWQKBgFQp/doy/ewWC7ikVFAkntHI/b8u&lt;br /&gt;
vuzoJ6yb0qlwa7iSe8MbAwaldo8IrcchfZfs40AbjlfjkhD/M1ebu9ZEot9U6+81&lt;br /&gt;
QxKgpgE/qH/pPaJUGLQ8ooAn9OVNHbrjWADx0tZ0p/GbTxZFf5OIVyETVJShVuIN&lt;br /&gt;
RshkHCjkSrixPpObAoGAPbC2qPAJINcYaaNoI1n3Lm9B+CHBrrYYAsyJ/XOdgabL&lt;br /&gt;
X8A0l+nfjciPPMfOQlx+4ScrnGsHpbeT7PKsnkGUuRmvYAeHe4TC69psrbc8om0b&lt;br /&gt;
pPXPwnQbAPXSzo+qQybE9bBLc9O0AQm/UHm3kpy/VCHB7R6ePsxQ6Y/mHxIGR2MC&lt;br /&gt;
gYEAhW7evwpxUMcW+BV84xIIt7cW2K/mu8nOb2qajFTej+WgvHNT+h4vgs4ZrTkH&lt;br /&gt;
rHyUiN/tzTCxBnkoh1w9FmCdnAdr/+br56Zq8oEXzBUUALqeW0xnB0zpTc6Hn0xq&lt;br /&gt;
iU0P5cM1sgyCWv83MgeGegcpxt54K5bqUjPKjaUpLNqbtiA=&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; (single line, but wrapped here 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 AAAAB3NzaC1yc2EAAAABIwAAAQBs+CsWeKegqmtneZcLDvHV4QT1n+ajj98gkmjo&lt;br /&gt;
LcIFW5g/VFRLpSMMkwkQBgGDkmKPvYFa5OolL6qBQSAN1NpP8zET+1lZr4OFg/TZTuA8QnhN&lt;br /&gt;
eh6VmU2hSoyJfEkKJ6TVYg4s1rsbbTZPLdCDe9CMn/iI824WUu2wA8RwhF2WTqqTrWTW4h8t&lt;br /&gt;
YK9Y4eT4IYMXiYZ8+eQfzHyMaNxvUcI1Z8heMn/CEnrA67ja7Czi/ljYnw0I3MXy9d2ANYjY&lt;br /&gt;
ahBLF2+ok19NS9tkFHDlcZTh0gTQ4vV5fksgdJjsWl5l/aLjnSRfx2pQrMl3w8U7JBpr0PWJ&lt;br /&gt;
PIuzd4q47+KBI1A9 root@an-node01.alteeve.com&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{note|1=Generate the key on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt; before proceeding.}}&lt;br /&gt;
&lt;br /&gt;
In order to enable password-less login, we need to create a file called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;~/.ssh/authorized_keys&amp;lt;/span&amp;gt; and put both nodes&#039; public key in it. To seed the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;~/.ssh/authorized_keys&amp;lt;/span&amp;gt; file, we&#039;ll simply copy the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;~/.ssh/id_rsa.pub&amp;lt;/span&amp;gt; file. After that, we will append &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt;&#039;s public key into it over ssh. Once both keys are in it, we&#039;ll push it over to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt;. If you want to add your workstation&#039;s key as well, this is the best time to do so.&lt;br /&gt;
&lt;br /&gt;
From &#039;&#039;&#039;an-node01&#039;&#039;&#039;, type:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
rsync -av ~/.ssh/id_rsa.pub ~/.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;
sending incremental file list&lt;br /&gt;
id_rsa.pub&lt;br /&gt;
&lt;br /&gt;
sent 482 bytes  received 31 bytes  1026.00 bytes/sec&lt;br /&gt;
total size is 404  speedup is 0.79&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we&#039;ll grab the public key from &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt; over SSH and append it to the new &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;authorized_keys&amp;lt;/span&amp;gt; file.&lt;br /&gt;
&lt;br /&gt;
I noted when I created &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt;&#039;s ssh key that its fingerprint was &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;04:08:37:43:6b:5c:a0:b0:f5:27:a7:46:d4:77:a3:34&amp;lt;/span&amp;gt;. This matches the one presented to me in the next step, so I trust that I am talking to the right machine.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ssh root@an-node02 &amp;quot;cat ~/.ssh/id_rsa.pub&amp;quot; &amp;gt;&amp;gt; ~/.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;
The authenticity of host &#039;an-node02 (10.20.0.2)&#039; can&#039;t be established.&lt;br /&gt;
RSA key fingerprint is 04:08:37:43:6b:5c:a0:b0:f5:27:a7:46:d4:77:a3:34.&lt;br /&gt;
Are you sure you want to continue connecting (yes/no)? yes&lt;br /&gt;
Warning: Permanently added &#039;an-node02,10.20.0.2&#039; (RSA) to the list of known hosts.&lt;br /&gt;
root@an-node02&#039;s password: &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{note|1=If you want to add your workstation&#039;s key, do so here.}}&lt;br /&gt;
&lt;br /&gt;
Now push the local copy of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;authorized_keys&amp;lt;/span&amp;gt; with both keys over to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;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 ~/.ssh/authorized_keys root@an-node02:/root/.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;
root@an-node02&#039;s password: &lt;br /&gt;
sending incremental file list&lt;br /&gt;
authorized_keys&lt;br /&gt;
&lt;br /&gt;
sent 1704 bytes  received 31 bytes  694.00 bytes/sec&lt;br /&gt;
total size is 1621  speedup is 0.93&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now log into the remote machine. This time, the connection should succeed without having entered a password!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ssh root@an-node02&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Last login: Sat Dec 10 16:06:21 2011 from 10.20.255.254&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Perfect! Once you can log into both nodes, from either node, without a password you will be finished.&lt;br /&gt;
&lt;br /&gt;
=== Populating And Pushing ~/.ssh/known_hosts ===&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, lets &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ssh&amp;lt;/span&amp;gt; into both nodes using all host names. 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 &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;exit&amp;lt;/span&amp;gt; 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, but it only needs to be done one time for all nodes. 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-node01 &amp;amp;&amp;amp; \&lt;br /&gt;
ssh root@an-node01.alteeve.com &amp;amp;&amp;amp; \&lt;br /&gt;
ssh root@an-node01.bcn &amp;amp;&amp;amp; \&lt;br /&gt;
ssh root@an-node01.sn &amp;amp;&amp;amp; \&lt;br /&gt;
ssh root@an-node01.ifn &amp;amp;&amp;amp; \&lt;br /&gt;
ssh root@an-node02 &amp;amp;&amp;amp; \&lt;br /&gt;
ssh root@an-node02.alteeve.com &amp;amp;&amp;amp; \&lt;br /&gt;
ssh root@an-node02.bcn &amp;amp;&amp;amp; \&lt;br /&gt;
ssh root@an-node02.sn &amp;amp;&amp;amp; \&lt;br /&gt;
ssh root@an-node02.ifn&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;
The authenticity of host &#039;an-node01 (10.20.0.1)&#039; can&#039;t be established.&lt;br /&gt;
RSA key fingerprint is e6:cb:50:41:88:26:c3:a5:aa:85:80:89:02:6f:ae:5e.&lt;br /&gt;
Are you sure you want to continue connecting (yes/no)? 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;
Warning: Permanently added &#039;an-node01,10.20.0.1&#039; (RSA) to the list of known hosts.&lt;br /&gt;
Last login: Sun Dec 11 04:45:50 2011 from 10.20.255.254&lt;br /&gt;
[root@an-node01 ~]# &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;
exit&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
logout&lt;br /&gt;
Connection to an-node01 closed.&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;
The authenticity of host &#039;an-node01.alteeve.com (10.20.0.1)&#039; can&#039;t be established.&lt;br /&gt;
RSA key fingerprint is e6:cb:50:41:88:26:c3:a5:aa:85:80:89:02:6f:ae:5e.&lt;br /&gt;
Are you sure you want to continue connecting (yes/no)? 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;
Warning: Permanently added &#039;an-node01.alteeve.com&#039; (RSA) to the list of known hosts.&lt;br /&gt;
Last login: Sun Dec 11 04:50:24 2011 from an-node01&lt;br /&gt;
[root@an-node01 ~]# &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;
exit&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
logout&lt;br /&gt;
Connection to an-node01.alteeve.com closed.&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;
The authenticity of host &#039;an-node01.bcn (10.20.0.1)&#039; can&#039;t be established.&lt;br /&gt;
RSA key fingerprint is e6:cb:50:41:88:26:c3:a5:aa:85:80:89:02:6f:ae:5e.&lt;br /&gt;
Are you sure you want to continue connecting (yes/no)? 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;
Warning: Permanently added &#039;an-node01.bcn&#039; (RSA) to the list of known hosts.&lt;br /&gt;
Last login: Sun Dec 11 04:51:14 2011 from an-node01&lt;br /&gt;
[root@an-node01 ~]# &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;
exit&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
logout&lt;br /&gt;
Connection to an-node01.bcn closed.&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;
The authenticity of host &#039;an-node01.sn (10.10.0.1)&#039; can&#039;t be established.&lt;br /&gt;
RSA key fingerprint is e6:cb:50:41:88:26:c3:a5:aa:85:80:89:02:6f:ae:5e.&lt;br /&gt;
Are you sure you want to continue connecting (yes/no)? 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;
Warning: Permanently added &#039;an-node01.sn,10.10.0.1&#039; (RSA) to the list of known hosts.&lt;br /&gt;
Last login: Sun Dec 11 04:53:23 2011 from an-node01&lt;br /&gt;
[root@an-node01 ~]# &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;
exit&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
logout&lt;br /&gt;
Connection to an-node01.sn closed.&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;
The authenticity of host &#039;an-node01.ifn (10.255.0.1)&#039; can&#039;t be established.&lt;br /&gt;
RSA key fingerprint is e6:cb:50:41:88:26:c3:a5:aa:85:80:89:02:6f:ae:5e.&lt;br /&gt;
Are you sure you want to continue connecting (yes/no)? 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;
Warning: Permanently added &#039;an-node01.ifn,10.255.0.1&#039; (RSA) to the list of known hosts.&lt;br /&gt;
Last login: Sun Dec 11 04:54:30 2011 from an-node01.sn&lt;br /&gt;
[root@an-node01 ~]# &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;
exit&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
logout&lt;br /&gt;
Connection to an-node01.ifn closed.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is the connection to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt;, which we established earlier when we pushed the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;authorized_keys&amp;lt;/span&amp;gt;, so this time we&#039;re not asked to verify the key.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Last login: Sun Dec 11 05:44:40 2011 from 10.20.255.254&lt;br /&gt;
[root@an-node02 ~]# &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;
exit&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
logout&lt;br /&gt;
Connection to an-node02 closed.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we&#039;ll be asked to verify keys again, as only the base &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt; hostname had been recorded earlier.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
The authenticity of host &#039;an-node02.alteeve.com (10.20.0.2)&#039; can&#039;t be established.&lt;br /&gt;
RSA key fingerprint is 04:08:37:43:6b:5c:a0:b0:f5:27:a7:46:d4:77:a3:34.&lt;br /&gt;
Are you sure you want to continue connecting (yes/no)? 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;
Warning: Permanently added &#039;an-node02.alteeve.com&#039; (RSA) to the list of known hosts.&lt;br /&gt;
Last login: Sun Dec 11 05:54:44 2011 from an-node01&lt;br /&gt;
[root@an-node02 ~]# &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;
exit&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
logout&lt;br /&gt;
Connection to an-node02.alteeve.com closed.&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;
The authenticity of host &#039;an-node02.bcn (10.20.0.2)&#039; can&#039;t be established.&lt;br /&gt;
RSA key fingerprint is 04:08:37:43:6b:5c:a0:b0:f5:27:a7:46:d4:77:a3:34.&lt;br /&gt;
Are you sure you want to continue connecting (yes/no)? 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;
Warning: Permanently added &#039;an-node02.bcn&#039; (RSA) to the list of known hosts.&lt;br /&gt;
Last login: Sun Dec 11 06:05:58 2011 from an-node01&lt;br /&gt;
[root@an-node02 ~]# &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;
exit&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
logout&lt;br /&gt;
Connection to an-node02.bcn closed.&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;
The authenticity of host &#039;an-node02.sn (10.10.0.2)&#039; can&#039;t be established.&lt;br /&gt;
RSA key fingerprint is 04:08:37:43:6b:5c:a0:b0:f5:27:a7:46:d4:77:a3:34.&lt;br /&gt;
Are you sure you want to continue connecting (yes/no)? 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;
Warning: Permanently added &#039;an-node02.sn,10.10.0.2&#039; (RSA) to the list of known hosts.&lt;br /&gt;
Last login: Sun Dec 11 06:07:20 2011 from an-node01&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;
exit&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
logout&lt;br /&gt;
Connection to an-node02.sn closed.&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;
The authenticity of host &#039;an-node02.ifn (10.255.0.2)&#039; can&#039;t be established.&lt;br /&gt;
RSA key fingerprint is 04:08:37:43:6b:5c:a0:b0:f5:27:a7:46:d4:77:a3:34.&lt;br /&gt;
Are you sure you want to continue connecting (yes/no)? 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;
Warning: Permanently added &#039;an-node02.ifn,10.255.0.2&#039; (RSA) to the list of known hosts.&lt;br /&gt;
Last login: Sun Dec 11 06:08:11 2011 from an-node01.sn&lt;br /&gt;
[root@an-node02 ~]# &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;
exit&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
logout&lt;br /&gt;
Connection to an-node02.ifn closed.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Finally done!&lt;br /&gt;
&lt;br /&gt;
Now we 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.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
rsync -av root@an-node01:/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 incremental file list&lt;br /&gt;
&lt;br /&gt;
sent 11 bytes  received 41 bytes  104.00 bytes/sec&lt;br /&gt;
total size is 4413  speedup is 84.87&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we can connect via SSH to either node, from either node, using any of the networks and we will not be prompted to enter a password or to verify SSH fingerprints any more.&lt;br /&gt;
&lt;br /&gt;
= Configuring The Cluster Foundation =&lt;br /&gt;
&lt;br /&gt;
We need to configure the cluster in two stages. This is because we have something of a chicken-and-egg problem.&lt;br /&gt;
&lt;br /&gt;
* We need clustered storage for our virtual machines.&lt;br /&gt;
* Our clustered storage needs the cluster for fencing.&lt;br /&gt;
&lt;br /&gt;
Conveniently, clustering has two logical parts;&lt;br /&gt;
* Cluster communication and membership.&lt;br /&gt;
* Cluster resource management.&lt;br /&gt;
&lt;br /&gt;
The first, communication and membership, covers which nodes are part of the cluster and ejecting faulty nodes from the cluster, among other tasks. The second part, resource management, is provided by a second tool called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt;. It&#039;s this second part that we will set aside for later.&lt;br /&gt;
&lt;br /&gt;
== Installing Required Programs ==&lt;br /&gt;
&lt;br /&gt;
You will need to install the packages below. Under [[CentOS]], [[Scientific Linux]] or other [[RHEL]]-based distros, you can simply run the command below. &lt;br /&gt;
&lt;br /&gt;
For [[Red Hat]] customers though, you will need to enable the &amp;quot;[http://www.redhat.com/rhel/add-ons/resilient_storage.html RHEL Server Resilient Storage]&amp;quot; entitlement. If you are foregoing [[GFS2]] to save money, then you will need to instead enable the &amp;quot;[http://www.redhat.com/rhel/add-ons/high_availability.html RHEL Server High Availability]&amp;quot; entitlement instead. &lt;br /&gt;
&lt;br /&gt;
Once you are ready, run the following command to install what you need. If you opted not to use GFS2, remove &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;gfs2-utils&amp;lt;/span&amp;gt;. The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;gpm&amp;lt;/span&amp;gt; is also optional as it provides mouse facility in the command-line.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install cman corosync rgmanager ricci gfs2-utils ntp libvirt lvm2-cluster \&lt;br /&gt;
            qemu-kvm qemu-kvm-tools virt-install virt-viewer syslinux wget gpm rsync&lt;br /&gt;
&amp;lt;/source&amp;gt;&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 now. 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. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cat /dev/null &amp;gt;/etc/libvirt/qemu/networks/default.xml&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;libvirtd&amp;lt;/span&amp;gt; has started, then you will also need to stop the bridge, delete it 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;
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;
== 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;
== Configuration Methods ==&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 v3 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. We&#039;re going to do this on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt; and, when we&#039;re done, copy it over to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt;.&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_v3_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;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;?xml version=&amp;quot;1.0&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;cluster name=&amp;quot;an-cluster-A&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;
The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cluster&amp;lt;/span&amp;gt; element has two attributes that we need to set;&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;name=&amp;quot;&amp;quot;&amp;lt;/span&amp;gt;&lt;br /&gt;
* &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 v3 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-A&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[RHCS v3 cluster.conf#config_version|config_version]]=&amp;quot;&amp;quot;&amp;lt;/span&amp;gt; attribute is an integer indicating 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 &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt;. 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 setting up a special kind of cluster, called 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_v3_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_v3_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;
In short; this disables quorum.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;cluster name=&amp;quot;an-cluster-A&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 introduces two tags, the later a child tag of the former;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clusternodes&amp;lt;/span&amp;gt;&lt;br /&gt;
** &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clusternode&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The first is the parent &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[RHCS_v3_cluster.conf#clusternodes.3B_Defining_Cluster_Nodes|clusternodes]]&amp;lt;/span&amp;gt; tag, which takes no attributes of its own. Its sole purpose is to contain the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[RHCS_v3_cluster.conf#Tag.3B_clusternode|clusternode]]&amp;lt;/span&amp;gt; child tags, of which there will be one per node. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;cluster name=&amp;quot;an-cluster-A&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-node01.alteeve.com&amp;quot; nodeid=&amp;quot;1&amp;quot; /&amp;gt;&lt;br /&gt;
		&amp;lt;clusternode name=&amp;quot;an-node02.alteeve.com&amp;quot; nodeid=&amp;quot;2&amp;quot; /&amp;gt;&lt;br /&gt;
	&amp;lt;/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_v3_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_v3_cluster.conf#clusternode.27s_name_attribute|name]]=&amp;quot;&amp;quot;&amp;lt;/span&amp;gt; attribute. The value &#039;&#039;&#039;should&#039;&#039;&#039; match the fully qualified domain name, which you can check by running &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;uname -n&amp;lt;/span&amp;gt; on each node. This isn&#039;t strictly required, mind you, but for simplicity&#039;s sake, this is the name we will use.&lt;br /&gt;
&lt;br /&gt;
The cluster decides which network to use for cluster communication by resolving the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;name=&amp;quot;...&amp;quot;&amp;lt;/span&amp;gt; value. It will take the returned [[IP]] address and try to match it to one of the IPs on the system. Once it finds a match, that becomes the network the cluster will use. In our case, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01.alteeve.com&amp;lt;/span&amp;gt; resolves to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;10.20.0.1&amp;lt;/span&amp;gt;, which is used by &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;bond0&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
If you have &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;syslinux&amp;lt;/span&amp;gt; installed, you can check this out yourself using the following command;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ifconfig |grep -B 1 $(gethostip -d $(uname -n)) | grep HWaddr | awk &#039;{ print $1 }&#039;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
bond0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Please see the &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;[[RHCS_v3_cluster.conf#name_3|name]]&amp;lt;/span&amp;gt; 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_v3_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; elements in the cluster. It is what the cluster itself uses to identify the node.&lt;br /&gt;
&lt;br /&gt;
=== Defining Fence Devices ===&lt;br /&gt;
&lt;br /&gt;
[[2-Node_Red_Hat_KVM_Cluster_Tutorial#Concept.3B_Fencing|Fencing]] devices are used to forcible eject a node from a cluster if it stops responding.&lt;br /&gt;
&lt;br /&gt;
This is generally done by forcing it to power off or reboot. Some [[SAN]] switches can logically disconnect a node from the shared storage device, a process called fabric fencing, 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. These are called [[PDU]]s and are effectively power bars where each outlet can be independently switched off over the network.&lt;br /&gt;
&lt;br /&gt;
In this tutorial, our nodes support [[IPMI]], which we will use as the primary fence device. We also have an [http://www.apc.com/products/resource/include/techspec_index.cfm?base_sku=AP7900 APC] brand switched PDU which will act as a backup fence device.&lt;br /&gt;
&lt;br /&gt;
{{note|1=Not all brands of switched PDUs are supported as fence devices. Before you purchase a fence device, confirm that it is supported.}}&lt;br /&gt;
&lt;br /&gt;
All fence devices are contained within the parent &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[RHCS_v3_cluster.conf#fencedevices.3B_Defining_Fence_Devices|fencedevices]]&amp;lt;/span&amp;gt; tag, which has no attributes of its own. Within this parent tag are one or more &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[RHCS_v3_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-cluster-A&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-node01.alteeve.com&amp;quot; nodeid=&amp;quot;1&amp;quot; /&amp;gt;&lt;br /&gt;
                &amp;lt;clusternode name=&amp;quot;an-node02.alteeve.com&amp;quot; nodeid=&amp;quot;2&amp;quot; /&amp;gt;&lt;br /&gt;
        &amp;lt;/clusternodes&amp;gt;&lt;br /&gt;
        &amp;lt;fencedevices&amp;gt;&lt;br /&gt;
                &amp;lt;fencedevice name=&amp;quot;ipmi_an01&amp;quot; agent=&amp;quot;fence_ipmilan&amp;quot; ipaddr=&amp;quot;an-node01.ipmi&amp;quot; login=&amp;quot;root&amp;quot; passwd=&amp;quot;secret&amp;quot; /&amp;gt;&lt;br /&gt;
                &amp;lt;fencedevice name=&amp;quot;ipmi_an02&amp;quot; agent=&amp;quot;fence_ipmilan&amp;quot; ipaddr=&amp;quot;an-node02.ipmi&amp;quot; login=&amp;quot;root&amp;quot; passwd=&amp;quot;secret&amp;quot; /&amp;gt;&lt;br /&gt;
                &amp;lt;fencedevice agent=&amp;quot;fence_apc_snmp&amp;quot; ipaddr=&amp;quot;pdu2.alteeve.com&amp;quot; name=&amp;quot;pdu2&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 its own &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[RHCS_v3_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. On the other hand, fence devices that support multiple nodes, like switched PDUs, will have just one entry. In our case, we&#039;re using both types, so we have three fences devices; The two IPMI BMCs plus the switched PDU.&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_v3_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_v3_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 go-between 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 performs the requested action against the target node. The agent is responsible for ensuring that the execution succeeded and returning an appropriate success or failure exit code. &lt;br /&gt;
&lt;br /&gt;
For those curious, the full details are described in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[https://fedorahosted.org/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 its own subset of attributes. The scope of which is outside this tutorial, though we will see examples for IPMI and a switched PDU. 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_ipmilan&amp;lt;/span&amp;gt; - IPMI fence agent.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;man fence_apc_snmp&amp;lt;/span&amp;gt; - APC-brand switched PDU using [[SNMP]].&lt;br /&gt;
&lt;br /&gt;
The example above is what this tutorial will use. &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_v3_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_v3_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_v3_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;
Here is how we implement [[IPMI]] as the primary fence device with the APC switched PDU as the backup method.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;cluster name=&amp;quot;an-cluster-A&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-node01.alteeve.com&amp;quot; nodeid=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
                        &amp;lt;fence&amp;gt;&lt;br /&gt;
                                &amp;lt;method name=&amp;quot;ipmi&amp;quot;&amp;gt;&lt;br /&gt;
                                        &amp;lt;device name=&amp;quot;ipmi_an01&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;pdu&amp;quot;&amp;gt;&lt;br /&gt;
                                        &amp;lt;device name=&amp;quot;pdu2&amp;quot; port=&amp;quot;1&amp;quot; action=&amp;quot;reboot&amp;quot; /&amp;gt;&lt;br /&gt;
                                &amp;lt;/method&amp;gt;&lt;br /&gt;
                        &amp;lt;/fence&amp;gt;&lt;br /&gt;
                &amp;lt;/clusternode&amp;gt;&lt;br /&gt;
                &amp;lt;clusternode name=&amp;quot;an-node02.alteeve.com&amp;quot; nodeid=&amp;quot;2&amp;quot;&amp;gt;&lt;br /&gt;
                        &amp;lt;fence&amp;gt;&lt;br /&gt;
                                &amp;lt;method name=&amp;quot;ipmi&amp;quot;&amp;gt;&lt;br /&gt;
                                        &amp;lt;device name=&amp;quot;ipmi_an02&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;pdu&amp;quot;&amp;gt;&lt;br /&gt;
                                        &amp;lt;device name=&amp;quot;pdu2&amp;quot; port=&amp;quot;2&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;ipmi_an01&amp;quot; agent=&amp;quot;fence_ipmilan&amp;quot; ipaddr=&amp;quot;an-node01.ipmi&amp;quot; login=&amp;quot;root&amp;quot; passwd=&amp;quot;secret&amp;quot; /&amp;gt;&lt;br /&gt;
                &amp;lt;fencedevice name=&amp;quot;ipmi_an02&amp;quot; agent=&amp;quot;fence_ipmilan&amp;quot; ipaddr=&amp;quot;an-node02.ipmi&amp;quot; login=&amp;quot;root&amp;quot; passwd=&amp;quot;secret&amp;quot; /&amp;gt;&lt;br /&gt;
                &amp;lt;fencedevice agent=&amp;quot;fence_apc_snmp&amp;quot; ipaddr=&amp;quot;pdu2.alteeve.com&amp;quot; name=&amp;quot;pdu2&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;
First, notice that the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[RHCS_v3_cluster.conf#Tag.3B_fence|fence]]&amp;lt;/span&amp;gt; tag has no attributes. It&#039;s merely a parent for the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[RHCS_v3_cluster.conf#Tag.3B_method|method]](s)&amp;lt;/span&amp;gt; child elements.&lt;br /&gt;
&lt;br /&gt;
There are two &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[RHCS_v3_cluster.conf#Tag.3B_method|method]]&amp;lt;/span&amp;gt; elements, one for each fence device, named &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ipmi&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;pdu&amp;lt;/span&amp;gt;. These names are merely descriptive and can be whatever you feel is most appropriate. &lt;br /&gt;
&lt;br /&gt;
Within each &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;method&amp;lt;/span&amp;gt; element is one or more &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[RHCS_v3_cluster.conf#Tag.3B_device|device]]&amp;lt;/span&amp;gt; tags. For a given method to succeed, all defined &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;device&amp;lt;/span&amp;gt; elements must themselves succeed. This is very useful for grouping calls to separate PDUs when dealing with nodes having redundant power supplies, as shown in the [[2-Node_Red_Hat_KVM_Cluster_Tutorial#Example_.3Cfencedevice....3E_Tag_For_APC_Switched_PDUs|PDU example]] above.&lt;br /&gt;
&lt;br /&gt;
The actual fence &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[RHCS_v3_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_v3_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_v3_cluster.conf#device.27s_name_attribute|name]]&amp;lt;/span&amp;gt;, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ipmi_an01&amp;lt;/span&amp;gt; in this example.&lt;br /&gt;
&lt;br /&gt;
Note that the PDU definition needs a &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;port=&amp;quot;&amp;quot;&amp;lt;/span&amp;gt; attribute where the IPMI fence devices do not. These are the sorts of differences you will find, varying depending on how the fence device agent works.&lt;br /&gt;
&lt;br /&gt;
When a fence call is needed, the fence devices will be called in the order they are found here. If both devices fail, the cluster will go back to the start and try again, looping indefinitely until one device succeeds.&lt;br /&gt;
&lt;br /&gt;
{{note|1=It&#039;s important to understand why we use IPMI as the primary fence device. The FenceAgentAPI specification suggests, but does not require, that a fence device confirm that the node is off. IPMI can do this, the switched PDU can not. Thus, IPMI won&#039;t return a success unless the node is truly off. The PDU, however, will return a success once the power is cut to the requested port. The risk is that a misconfigured node with redundant PDU may in fact still be running, leading to disastrous consequences.}}&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-node02&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-node02&amp;lt;/span&amp;gt; is consulted. Within it there are two &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;method&amp;lt;/span&amp;gt; entries, named &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ipmi&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;pdu&amp;lt;/span&amp;gt;. The IPMI method&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;device&amp;lt;/span&amp;gt; has one attribute while the PDU&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;device&amp;lt;/span&amp;gt; has two attributes;&lt;br /&gt;
** &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;port&amp;lt;/span&amp;gt;; only found in the PDU &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;method&amp;lt;/span&amp;gt;, this tells the cluster that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt; is connected to switched PDU&#039;s outlet number &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;2&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;; Found on both devices, 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;ipmi_an02&amp;lt;/span&amp;gt;. This fence device has four 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_ipmilan&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 IPMI BMC. 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;
* Should the IPMI fence call fail for some reason, the cluster will move on to the second &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;pdu&amp;lt;/span&amp;gt; method, repeating the steps above but using the PDU values.&lt;br /&gt;
&lt;br /&gt;
When the cluster calls the fence agent, it does so by initially calling the fence agent script with no arguments.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/usr/sbin/fence_ipmilan&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=an-node02.ipmi&lt;br /&gt;
login=root&lt;br /&gt;
passwd=secret&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 three 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 one is 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-node02&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;
If this method fails, then the PDU will be called in a very similar way, but with an extra argument from the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;device&amp;lt;/span&amp;gt; attributes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/usr/sbin/fence_apc_snmp&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=pdu2.alteeve.com&lt;br /&gt;
port=2&lt;br /&gt;
action=reboot&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Should this fail, the cluster will go back and try the IPMI interface again. It will loop through the fence device methods forever until one of the methods succeeds.&lt;br /&gt;
Below are snippets from other clusters using different fence device configurations which might help you build your cluster.&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.&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;clusternode name=&amp;quot;an-node01.alteeve.com&amp;quot; nodeid=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
			&amp;lt;fence&amp;gt;&lt;br /&gt;
				&amp;lt;method name=&amp;quot;ipmi&amp;quot;&amp;gt;&lt;br /&gt;
					&amp;lt;device name=&amp;quot;ipmi_an01&amp;quot; action=&amp;quot;reboot&amp;quot;/&amp;gt;&lt;br /&gt;
				&amp;lt;/method&amp;gt;&lt;br /&gt;
			&amp;lt;/fence&amp;gt;&lt;br /&gt;
		&amp;lt;/clusternode&amp;gt;&lt;br /&gt;
		&amp;lt;clusternode name=&amp;quot;an-node02.alteeve.com&amp;quot; nodeid=&amp;quot;2&amp;quot;&amp;gt;&lt;br /&gt;
			&amp;lt;fence&amp;gt;&lt;br /&gt;
				&amp;lt;method name=&amp;quot;ipmi&amp;quot;&amp;gt;&lt;br /&gt;
					&amp;lt;device name=&amp;quot;ipmi_an02&amp;quot; action=&amp;quot;reboot&amp;quot;/&amp;gt;&lt;br /&gt;
				&amp;lt;/method&amp;gt;&lt;br /&gt;
			&amp;lt;/fence&amp;gt;&lt;br /&gt;
		&amp;lt;/clusternode&amp;gt;&lt;br /&gt;
	...&lt;br /&gt;
	&amp;lt;fencedevices&amp;gt;&lt;br /&gt;
		&amp;lt;fencedevice name=&amp;quot;ipmi_an01&amp;quot; agent=&amp;quot;fence_ipmilan&amp;quot; ipaddr=&amp;quot;an-node01.ipmi&amp;quot; login=&amp;quot;root&amp;quot; passwd=&amp;quot;secret&amp;quot; /&amp;gt;&lt;br /&gt;
		&amp;lt;fencedevice name=&amp;quot;ipmi_an02&amp;quot; agent=&amp;quot;fence_ipmilan&amp;quot; ipaddr=&amp;quot;an-node02.ipmi&amp;quot; login=&amp;quot;root&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 or other network fence devices, [[IPMI]] does not have ports. This is because each [[IPMI]] BMC supports just its host system. More on that later.}}&lt;br /&gt;
&lt;br /&gt;
==== Example &amp;lt;fencedevice...&amp;gt; Tag For HP iLO ====&lt;br /&gt;
&lt;br /&gt;
Here we will show how to use [http://h18013.www1.hp.com/products/servers/management/remotemgmt.html iLO] (integraterd Lights-Out) management devices as &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;fencedevice...&amp;gt;&amp;lt;/span&amp;gt; entries. 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 its use.&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;clusternode name=&amp;quot;an-node01.alteeve.com&amp;quot; nodeid=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
			&amp;lt;fence&amp;gt;&lt;br /&gt;
				&amp;lt;method name=&amp;quot;ilo&amp;quot;&amp;gt;&lt;br /&gt;
					&amp;lt;device action=&amp;quot;reboot&amp;quot; name=&amp;quot;ilo_an01&amp;quot;/&amp;gt;&lt;br /&gt;
				&amp;lt;/method&amp;gt;&lt;br /&gt;
			&amp;lt;/fence&amp;gt;&lt;br /&gt;
		&amp;lt;/clusternode&amp;gt;&lt;br /&gt;
		&amp;lt;clusternode name=&amp;quot;an-node02.alteeve.com&amp;quot; nodeid=&amp;quot;2&amp;quot;&amp;gt;&lt;br /&gt;
			&amp;lt;fence&amp;gt;&lt;br /&gt;
				&amp;lt;method name=&amp;quot;ilo&amp;quot;&amp;gt;&lt;br /&gt;
					&amp;lt;device action=&amp;quot;reboot&amp;quot; name=&amp;quot;ilo_an02&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;
	...&lt;br /&gt;
	&amp;lt;fencedevices&amp;gt;&lt;br /&gt;
		&amp;lt;fencedevice agent=&amp;quot;fence_ilo&amp;quot; ipaddr=&amp;quot;an-node01.ilo&amp;quot; login=&amp;quot;root&amp;quot; name=&amp;quot;ilo_an01&amp;quot; passwd=&amp;quot;secret&amp;quot;/&amp;gt;&lt;br /&gt;
		&amp;lt;fencedevice agent=&amp;quot;fence_ilo&amp;quot; ipaddr=&amp;quot;an-node02.ilo&amp;quot; login=&amp;quot;root&amp;quot; name=&amp;quot;ilo_an02&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=Like [[IPMI]], [[iLO]] does not have ports. This is because each [[iLO]] BMC supports just its host system.}}&lt;br /&gt;
&lt;br /&gt;
==== Example &amp;lt;fencedevice...&amp;gt; Tag For Dell&#039;s DRAC ====&lt;br /&gt;
&lt;br /&gt;
{{note|1=I have not tested fencing on Dell, but am using a reference working configuration from another user.}}&lt;br /&gt;
&lt;br /&gt;
Here we will show how to use [http://support.dell.com/support/edocs/software/smdrac3/ DRAC] (Dell Remote Access Controller) management devices as &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;fencedevice...&amp;gt;&amp;lt;/span&amp;gt; entries. We won&#039;t be using it ourselves, but it is another popular as a fence device so I wanted to show an example of its use.&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;clusternode name=&amp;quot;an-node01.alteeve.com&amp;quot; nodeid=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
			&amp;lt;fence&amp;gt;&lt;br /&gt;
				&amp;lt;method name=&amp;quot;drac&amp;quot;&amp;gt;&lt;br /&gt;
					&amp;lt;device action=&amp;quot;reboot&amp;quot; name=&amp;quot;drac_an01&amp;quot;/&amp;gt;&lt;br /&gt;
				&amp;lt;/method&amp;gt;&lt;br /&gt;
			&amp;lt;/fence&amp;gt;&lt;br /&gt;
		&amp;lt;/clusternode&amp;gt;&lt;br /&gt;
		&amp;lt;clusternode name=&amp;quot;an-node02.alteeve.com&amp;quot; nodeid=&amp;quot;2&amp;quot;&amp;gt;&lt;br /&gt;
			&amp;lt;fence&amp;gt;&lt;br /&gt;
				&amp;lt;method name=&amp;quot;ilo&amp;quot;&amp;gt;&lt;br /&gt;
					&amp;lt;device action=&amp;quot;reboot&amp;quot; name=&amp;quot;drac_an02&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;
	...&lt;br /&gt;
	&amp;lt;fencedevices&amp;gt;&lt;br /&gt;
		&amp;lt;fencedevice agent=&amp;quot;fence_drac5&amp;quot; cmd_prompt=&amp;quot;admin1-&amp;amp;gt;&amp;quot; ipaddr=&amp;quot;an-node01.drac&amp;quot; login=&amp;quot;root&amp;quot; name=&amp;quot;drac_an01&amp;quot; passwd=&amp;quot;secret&amp;quot; secure=&amp;quot;1&amp;quot;/&amp;gt;&lt;br /&gt;
		&amp;lt;fencedevice agent=&amp;quot;fence_drac5&amp;quot; cmd_prompt=&amp;quot;admin1-&amp;amp;gt;&amp;quot; ipaddr=&amp;quot;an-node02.drac&amp;quot; login=&amp;quot;root&amp;quot; name=&amp;quot;drac_an02&amp;quot; passwd=&amp;quot;secret&amp;quot; secure=&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;
* &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;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cmd_prompt&amp;lt;/span&amp;gt;; This is the string that the fence agent looks for when talking to the DRAC device.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;secure&amp;lt;/span&amp;gt;; This tells the agent to use [[SSH]].&lt;br /&gt;
&lt;br /&gt;
{{note|1=Like [[IPMI]] and [[iLO]], [[DRAC]] does not have ports. This is because each [[DRAC]] BMC supports just its host system.}}&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. There are two agents for these devices; One that uses the telnet or ssh login and one that uses [[SNMP]]. This tutorial uses the later, and it is recommended that you do the same.&lt;br /&gt;
&lt;br /&gt;
The example below is from a production cluster that uses redundant power supplies and two separate PDUs. This is how you will want to configure any production clusters you build.&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;clusternode name=&amp;quot;an-node01.alteeve.com&amp;quot; nodeid=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
			&amp;lt;fence&amp;gt;&lt;br /&gt;
				&amp;lt;method name=&amp;quot;pdu2&amp;quot;&amp;gt;&lt;br /&gt;
					&amp;lt;device action=&amp;quot;reboot&amp;quot; name=&amp;quot;pdu1&amp;quot; port=&amp;quot;1&amp;quot;/&amp;gt;&lt;br /&gt;
					&amp;lt;device action=&amp;quot;reboot&amp;quot; name=&amp;quot;pdu2&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;
		&amp;lt;/clusternode&amp;gt;&lt;br /&gt;
		&amp;lt;clusternode name=&amp;quot;an-node02.alteeve.com&amp;quot; nodeid=&amp;quot;2&amp;quot;&amp;gt;&lt;br /&gt;
			&amp;lt;fence&amp;gt;&lt;br /&gt;
				&amp;lt;method name=&amp;quot;pdu2&amp;quot;&amp;gt;&lt;br /&gt;
					&amp;lt;device action=&amp;quot;reboot&amp;quot; name=&amp;quot;pdu1&amp;quot; port=&amp;quot;2&amp;quot;/&amp;gt;&lt;br /&gt;
					&amp;lt;device action=&amp;quot;reboot&amp;quot; name=&amp;quot;pdu2&amp;quot; port=&amp;quot;2&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;
	...&lt;br /&gt;
	&amp;lt;fencedevices&amp;gt;&lt;br /&gt;
 		&amp;lt;fencedevice agent=&amp;quot;fence_apc_snmp&amp;quot; ipaddr=&amp;quot;pdu1.alteeve.com&amp;quot; name=&amp;quot;pdu1&amp;quot; /&amp;gt;&lt;br /&gt;
		&amp;lt;fencedevice agent=&amp;quot;fence_apc_snmp&amp;quot; ipaddr=&amp;quot;pdu2.alteeve.com&amp;quot; name=&amp;quot;pdu2&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;agent&amp;lt;/span&amp;gt;; This is the name of the script under &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/usr/sbin/&amp;lt;/span&amp;gt; to use when calling the physical PDU.&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;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;
=== 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 discussed earlier though, this is not the case when using the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[RHCS_v3_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_v3_cluster.conf#cman.3B_The_Cluster_Manager|cman]]&amp;lt;/span&amp;gt; element. 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 its 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, its 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-cluster-A&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-node01.alteeve.com&amp;quot; nodeid=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
                        &amp;lt;fence&amp;gt;&lt;br /&gt;
                                &amp;lt;method name=&amp;quot;ipmi&amp;quot;&amp;gt;&lt;br /&gt;
                                        &amp;lt;device name=&amp;quot;ipmi_an01&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;pdu&amp;quot;&amp;gt;&lt;br /&gt;
                                        &amp;lt;device name=&amp;quot;pdu2&amp;quot; port=&amp;quot;1&amp;quot; action=&amp;quot;reboot&amp;quot; /&amp;gt;&lt;br /&gt;
                                &amp;lt;/method&amp;gt;&lt;br /&gt;
                        &amp;lt;/fence&amp;gt;&lt;br /&gt;
                &amp;lt;/clusternode&amp;gt;&lt;br /&gt;
                &amp;lt;clusternode name=&amp;quot;an-node02.alteeve.com&amp;quot; nodeid=&amp;quot;2&amp;quot;&amp;gt;&lt;br /&gt;
                        &amp;lt;fence&amp;gt;&lt;br /&gt;
                                &amp;lt;method name=&amp;quot;ipmi&amp;quot;&amp;gt;&lt;br /&gt;
                                        &amp;lt;device name=&amp;quot;ipmi_an02&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;pdu&amp;quot;&amp;gt;&lt;br /&gt;
                                        &amp;lt;device name=&amp;quot;pdu2&amp;quot; port=&amp;quot;2&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;ipmi_an01&amp;quot; agent=&amp;quot;fence_ipmilan&amp;quot; ipaddr=&amp;quot;an-node01.ipmi&amp;quot; login=&amp;quot;root&amp;quot; passwd=&amp;quot;secret&amp;quot; /&amp;gt;&lt;br /&gt;
                &amp;lt;fencedevice name=&amp;quot;ipmi_an02&amp;quot; agent=&amp;quot;fence_ipmilan&amp;quot; ipaddr=&amp;quot;an-node02.ipmi&amp;quot; login=&amp;quot;root&amp;quot; passwd=&amp;quot;secret&amp;quot; /&amp;gt;&lt;br /&gt;
                &amp;lt;fencedevice agent=&amp;quot;fence_apc_snmp&amp;quot; ipaddr=&amp;quot;pdu2.alteeve.com&amp;quot; name=&amp;quot;pdu2&amp;quot; /&amp;gt;&lt;br /&gt;
        &amp;lt;/fencedevices&amp;gt;&lt;br /&gt;
        &amp;lt;fence_daemon post_join_delay=&amp;quot;30&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_v3_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_v3_cluster.conf#post_join_delay|post_join_delay]]=&amp;quot;30&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 with which you are comfortable.&lt;br /&gt;
&lt;br /&gt;
=== Configuring Totem ===&lt;br /&gt;
&lt;br /&gt;
There are many attributes for the [[totem]] element. For now though, we&#039;re only going to set two of them. We know that cluster communication will be travelling over our private, secured [[BCN]] network, so for the sake of simplicity, we&#039;re going to disable encryption. We are also offering network redundancy using the bonding drivers, so we&#039;re also going to disable totem&#039;s [[redundant ring protocol]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;cluster name=&amp;quot;an-cluster-A&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-node01.alteeve.com&amp;quot; nodeid=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
                        &amp;lt;fence&amp;gt;&lt;br /&gt;
                                &amp;lt;method name=&amp;quot;ipmi&amp;quot;&amp;gt;&lt;br /&gt;
                                        &amp;lt;device name=&amp;quot;ipmi_an01&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;pdu&amp;quot;&amp;gt;&lt;br /&gt;
                                        &amp;lt;device name=&amp;quot;pdu2&amp;quot; port=&amp;quot;1&amp;quot; action=&amp;quot;reboot&amp;quot; /&amp;gt;&lt;br /&gt;
                                &amp;lt;/method&amp;gt;&lt;br /&gt;
                        &amp;lt;/fence&amp;gt;&lt;br /&gt;
                &amp;lt;/clusternode&amp;gt;&lt;br /&gt;
                &amp;lt;clusternode name=&amp;quot;an-node02.alteeve.com&amp;quot; nodeid=&amp;quot;2&amp;quot;&amp;gt;&lt;br /&gt;
                        &amp;lt;fence&amp;gt;&lt;br /&gt;
                                &amp;lt;method name=&amp;quot;ipmi&amp;quot;&amp;gt;&lt;br /&gt;
                                        &amp;lt;device name=&amp;quot;ipmi_an02&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;pdu&amp;quot;&amp;gt;&lt;br /&gt;
                                        &amp;lt;device name=&amp;quot;pdu2&amp;quot; port=&amp;quot;2&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;ipmi_an01&amp;quot; agent=&amp;quot;fence_ipmilan&amp;quot; ipaddr=&amp;quot;an-node01.ipmi&amp;quot; login=&amp;quot;root&amp;quot; passwd=&amp;quot;secret&amp;quot; /&amp;gt;&lt;br /&gt;
                &amp;lt;fencedevice name=&amp;quot;ipmi_an02&amp;quot; agent=&amp;quot;fence_ipmilan&amp;quot; ipaddr=&amp;quot;an-node02.ipmi&amp;quot; login=&amp;quot;root&amp;quot; passwd=&amp;quot;secret&amp;quot; /&amp;gt;&lt;br /&gt;
                &amp;lt;fencedevice agent=&amp;quot;fence_apc_snmp&amp;quot; ipaddr=&amp;quot;pdu2.alteeve.com&amp;quot; name=&amp;quot;pdu2&amp;quot; /&amp;gt;&lt;br /&gt;
        &amp;lt;/fencedevices&amp;gt;&lt;br /&gt;
        &amp;lt;fence_daemon post_join_delay=&amp;quot;30&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;
{{note|1=At this time, [[redundant ring protocol]] is not supported ([[RHEL6]].1 and lower). It is in technology preview mode in [[RHEL6]].2 and above. This is another reason why we will not be using it in this tutorial..}}&lt;br /&gt;
&lt;br /&gt;
[[RRP]] is an optional second ring that can be used for cluster communication in the case of a break down in the first ring. 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_v3_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_v3_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_v3_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;
One of the most noticeable changes in [[RHCS]] cluster stable 3 is that we no longer have to make a long, cryptic &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xmllint&amp;lt;/span&amp;gt; call to validate our cluster configuration. Now we can simply call &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ccs_config_validate&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ccs_config_validate&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Configuration 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-node02:/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;
sending incremental file list&lt;br /&gt;
cluster.conf&lt;br /&gt;
&lt;br /&gt;
sent 1198 bytes  received 31 bytes  2458.00 bytes/sec&lt;br /&gt;
total size is 1118  speedup is 0.91&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Setting Up ricci ===&lt;br /&gt;
&lt;br /&gt;
Another change from [[RHCS]] stable 2 is how configuration changes are propagated. Before, after a change, we&#039;d push out the updated cluster configuration by calling &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ccs_tool update /etc/cluster/cluster.conf&amp;lt;/span&amp;gt;. Now this is done with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman_tool version -r&amp;lt;/span&amp;gt;. More fundamentally though, the cluster needs to authenticate against each node and does this using the local &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ricci&amp;lt;/span&amp;gt; system user. The user has no password initially, so we need to set one.&lt;br /&gt;
&lt;br /&gt;
On &#039;&#039;&#039;both&#039;&#039;&#039; nodes:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
passwd ricci&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Changing password for user ricci.&lt;br /&gt;
New password: &lt;br /&gt;
Retype new password: &lt;br /&gt;
passwd: all authentication tokens updated successfully.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You will need to enter this password once from each node against the other node. We will see this later.&lt;br /&gt;
&lt;br /&gt;
Now make sure that the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ricci&amp;lt;/span&amp;gt; daemon is set to start on boot and is running now.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
chkconfig ricci on&lt;br /&gt;
chkconfig --list ricci&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
ricci          	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;
Now start it up.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/ricci 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 ricci:                                            [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{note|1=If you don&#039;t see &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[  OK  ]&amp;lt;/span&amp;gt;, don&#039;t worry, it is probably because it was already running.}}&lt;br /&gt;
&lt;br /&gt;
We also need to have a daemon called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;modclusterd&amp;lt;/span&amp;gt; running on start.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
chkconfig modclusterd on&lt;br /&gt;
chkconfig --list modclusterd&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
modclusterd    	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;
Now start it up.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/modclusterd 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 Module - cluster monitor: Setting verbosity level to LogBasic&lt;br /&gt;
                                                           [  OK  ]&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;
It&#039;s a good idea to open a second terminal on either node and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;tail&amp;lt;/span&amp;gt; the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/var/log/messages&amp;lt;/span&amp;gt; [[syslog]] file. All cluster messages will be recorded here and it will help to debug problems if you can watch the logs. To do this, in the new terminal windows run;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
clear; tail -f -n 0 /var/log/messages&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will clear the screen and start watching for new lines to be written to syslog. When you are done watching syslog, press the &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;c&amp;lt;/span&amp;gt; key combination.&lt;br /&gt;
&lt;br /&gt;
How you lay out your terminal windows is, obviously, up to your own preferences. Below is a configuration I have found very useful.&lt;br /&gt;
&lt;br /&gt;
[[Image:2-node-rhcs3_terminal-window-layout_01.png|thumb|center|700px|Terminal window layout for watching 2 nodes. Left windows are used for entering commands and the left windows are used for tailing syslog.]]&lt;br /&gt;
&lt;br /&gt;
With the terminals setup, lets start the cluster!&lt;br /&gt;
&lt;br /&gt;
{{warning|1=If you don&#039;t start &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt; on both nodes within 30 seconds, the slower node will be fenced.}}&lt;br /&gt;
&lt;br /&gt;
On &#039;&#039;&#039;both&#039;&#039;&#039; nodes, run:&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;
   Checking if cluster has been disabled at boot...        [  OK  ]&lt;br /&gt;
   Checking Network Manager...                             [  OK  ]&lt;br /&gt;
   Global setup...                                         [  OK  ]&lt;br /&gt;
   Loading kernel modules...                               [  OK  ]&lt;br /&gt;
   Mounting configfs...                                    [  OK  ]&lt;br /&gt;
   Starting cman...                                        [  OK  ]&lt;br /&gt;
   Waiting for quorum...                                   [  OK  ]&lt;br /&gt;
   Starting fenced...                                      [  OK  ]&lt;br /&gt;
   Starting dlm_controld...                                [  OK  ]&lt;br /&gt;
   Starting gfs_controld...                                [  OK  ]&lt;br /&gt;
   Unfencing self...                                       [  OK  ]&lt;br /&gt;
   Joining fence domain...                                 [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here is what you should see in syslog:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Dec 13 12:08:44 an-node01 kernel: DLM (built Nov  9 2011 08:04:11) installed&lt;br /&gt;
Dec 13 12:08:45 an-node01 corosync[3434]:   [MAIN  ] Corosync Cluster Engine (&#039;1.4.1&#039;): started and ready to provide service.&lt;br /&gt;
Dec 13 12:08:45 an-node01 corosync[3434]:   [MAIN  ] Corosync built-in features: nss dbus rdma snmp&lt;br /&gt;
Dec 13 12:08:45 an-node01 corosync[3434]:   [MAIN  ] Successfully read config from /etc/cluster/cluster.conf&lt;br /&gt;
Dec 13 12:08:45 an-node01 corosync[3434]:   [MAIN  ] Successfully parsed cman config&lt;br /&gt;
Dec 13 12:08:45 an-node01 corosync[3434]:   [TOTEM ] Initializing transport (UDP/IP Multicast).&lt;br /&gt;
Dec 13 12:08:45 an-node01 corosync[3434]:   [TOTEM ] Initializing transmit/receive security: libtomcrypt SOBER128/SHA1HMAC (mode 0).&lt;br /&gt;
Dec 13 12:08:46 an-node01 corosync[3434]:   [TOTEM ] The network interface [10.20.0.1] is now up.&lt;br /&gt;
Dec 13 12:08:46 an-node01 corosync[3434]:   [QUORUM] Using quorum provider quorum_cman&lt;br /&gt;
Dec 13 12:08:46 an-node01 corosync[3434]:   [SERV  ] Service engine loaded: corosync cluster quorum service v0.1&lt;br /&gt;
Dec 13 12:08:46 an-node01 corosync[3434]:   [CMAN  ] CMAN 3.0.12.1 (built Sep 30 2011 03:17:43) started&lt;br /&gt;
Dec 13 12:08:46 an-node01 corosync[3434]:   [SERV  ] Service engine loaded: corosync CMAN membership service 2.90&lt;br /&gt;
Dec 13 12:08:46 an-node01 corosync[3434]:   [SERV  ] Service engine loaded: openais checkpoint service B.01.01&lt;br /&gt;
Dec 13 12:08:46 an-node01 corosync[3434]:   [SERV  ] Service engine loaded: corosync extended virtual synchrony service&lt;br /&gt;
Dec 13 12:08:46 an-node01 corosync[3434]:   [SERV  ] Service engine loaded: corosync configuration service&lt;br /&gt;
Dec 13 12:08:46 an-node01 corosync[3434]:   [SERV  ] Service engine loaded: corosync cluster closed process group service v1.01&lt;br /&gt;
Dec 13 12:08:46 an-node01 corosync[3434]:   [SERV  ] Service engine loaded: corosync cluster config database access v1.01&lt;br /&gt;
Dec 13 12:08:46 an-node01 corosync[3434]:   [SERV  ] Service engine loaded: corosync profile loading service&lt;br /&gt;
Dec 13 12:08:46 an-node01 corosync[3434]:   [QUORUM] Using quorum provider quorum_cman&lt;br /&gt;
Dec 13 12:08:46 an-node01 corosync[3434]:   [SERV  ] Service engine loaded: corosync cluster quorum service v0.1&lt;br /&gt;
Dec 13 12:08:46 an-node01 corosync[3434]:   [MAIN  ] Compatibility mode set to whitetank.  Using V1 and V2 of the synchronization engine.&lt;br /&gt;
Dec 13 12:08:46 an-node01 corosync[3434]:   [TOTEM ] A processor joined or left the membership and a new membership was formed.&lt;br /&gt;
Dec 13 12:08:46 an-node01 corosync[3434]:   [CMAN  ] quorum regained, resuming activity&lt;br /&gt;
Dec 13 12:08:46 an-node01 corosync[3434]:   [QUORUM] This node is within the primary component and will provide service.&lt;br /&gt;
Dec 13 12:08:46 an-node01 corosync[3434]:   [QUORUM] Members[1]: 1&lt;br /&gt;
Dec 13 12:08:46 an-node01 corosync[3434]:   [QUORUM] Members[1]: 1&lt;br /&gt;
Dec 13 12:08:46 an-node01 corosync[3434]:   [CPG   ] chosen downlist: sender r(0) ip(10.20.0.1) ; members(old:0 left:0)&lt;br /&gt;
Dec 13 12:08:46 an-node01 corosync[3434]:   [MAIN  ] Completed service synchronization, ready to provide service.&lt;br /&gt;
Dec 13 12:08:47 an-node01 corosync[3434]:   [TOTEM ] A processor joined or left the membership and a new membership was formed.&lt;br /&gt;
Dec 13 12:08:47 an-node01 corosync[3434]:   [QUORUM] Members[2]: 1 2&lt;br /&gt;
Dec 13 12:08:47 an-node01 corosync[3434]:   [QUORUM] Members[2]: 1 2&lt;br /&gt;
Dec 13 12:08:47 an-node01 corosync[3434]:   [CPG   ] chosen downlist: sender r(0) ip(10.20.0.1) ; members(old:1 left:0)&lt;br /&gt;
Dec 13 12:08:47 an-node01 corosync[3434]:   [MAIN  ] Completed service synchronization, ready to provide service.&lt;br /&gt;
Dec 13 12:08:49 an-node01 fenced[3490]: fenced 3.0.12.1 started&lt;br /&gt;
Dec 13 12:08:49 an-node01 dlm_controld[3515]: dlm_controld 3.0.12.1 started&lt;br /&gt;
Dec 13 12:08:51 an-node01 gfs_controld[3565]: gfs_controld 3.0.12.1 started&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now to confirm that the cluster is operating properly, run &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman_tool status&amp;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: 7&lt;br /&gt;
Cluster Name: an-cluster-A&lt;br /&gt;
Cluster Id: 24561&lt;br /&gt;
Cluster Member: Yes&lt;br /&gt;
Cluster Generation: 8&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;
Node votes: 1&lt;br /&gt;
Quorum: 1  &lt;br /&gt;
Active subsystems: 7&lt;br /&gt;
Flags: 2node &lt;br /&gt;
Ports Bound: 0  &lt;br /&gt;
Node name: an-node01.alteeve.com&lt;br /&gt;
Node ID: 1&lt;br /&gt;
Multicast addresses: 239.192.95.81 &lt;br /&gt;
Node addresses: 10.20.0.1 &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can see that the both nodes are talking because of the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Nodes: 2&amp;lt;/span&amp;gt; entry.&lt;br /&gt;
&lt;br /&gt;
If you ever want to see the nitty-gritty configuration, you can run &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;corosync-objctl&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
corosync-objctl&lt;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.name=an-cluster-A&lt;br /&gt;
cluster.config_version=7&lt;br /&gt;
cluster.cman.expected_votes=1&lt;br /&gt;
cluster.cman.two_node=1&lt;br /&gt;
cluster.cman.nodename=an-node01.alteeve.com&lt;br /&gt;
cluster.cman.cluster_id=24561&lt;br /&gt;
cluster.clusternodes.clusternode.name=an-node01.alteeve.com&lt;br /&gt;
cluster.clusternodes.clusternode.nodeid=1&lt;br /&gt;
cluster.clusternodes.clusternode.fence.method.name=ipmi&lt;br /&gt;
cluster.clusternodes.clusternode.fence.method.device.name=ipmi_an01&lt;br /&gt;
cluster.clusternodes.clusternode.fence.method.device.action=reboot&lt;br /&gt;
cluster.clusternodes.clusternode.fence.method.name=pdu&lt;br /&gt;
cluster.clusternodes.clusternode.fence.method.device.name=pdu2&lt;br /&gt;
cluster.clusternodes.clusternode.fence.method.device.port=1&lt;br /&gt;
cluster.clusternodes.clusternode.fence.method.device.action=reboot&lt;br /&gt;
cluster.clusternodes.clusternode.name=an-node02.alteeve.com&lt;br /&gt;
cluster.clusternodes.clusternode.nodeid=2&lt;br /&gt;
cluster.clusternodes.clusternode.fence.method.name=ipmi&lt;br /&gt;
cluster.clusternodes.clusternode.fence.method.device.name=ipmi_an02&lt;br /&gt;
cluster.clusternodes.clusternode.fence.method.device.action=reboot&lt;br /&gt;
cluster.clusternodes.clusternode.fence.method.name=pdu&lt;br /&gt;
cluster.clusternodes.clusternode.fence.method.device.name=pdu2&lt;br /&gt;
cluster.clusternodes.clusternode.fence.method.device.port=2&lt;br /&gt;
cluster.clusternodes.clusternode.fence.method.device.action=reboot&lt;br /&gt;
cluster.fencedevices.fencedevice.name=ipmi_an01&lt;br /&gt;
cluster.fencedevices.fencedevice.agent=fence_ipmilan&lt;br /&gt;
cluster.fencedevices.fencedevice.ipaddr=an-node01.ipmi&lt;br /&gt;
cluster.fencedevices.fencedevice.login=root&lt;br /&gt;
cluster.fencedevices.fencedevice.passwd=secret&lt;br /&gt;
cluster.fencedevices.fencedevice.name=ipmi_an02&lt;br /&gt;
cluster.fencedevices.fencedevice.agent=fence_ipmilan&lt;br /&gt;
cluster.fencedevices.fencedevice.ipaddr=an-node02.ipmi&lt;br /&gt;
cluster.fencedevices.fencedevice.login=root&lt;br /&gt;
cluster.fencedevices.fencedevice.passwd=secret&lt;br /&gt;
cluster.fencedevices.fencedevice.agent=fence_apc_snmp&lt;br /&gt;
cluster.fencedevices.fencedevice.ipaddr=pdu2.alteeve.com&lt;br /&gt;
cluster.fencedevices.fencedevice.name=pdu2&lt;br /&gt;
cluster.fence_daemon.post_join_delay=30&lt;br /&gt;
cluster.totem.rrp_mode=none&lt;br /&gt;
cluster.totem.secauth=off&lt;br /&gt;
totem.rrp_mode=none&lt;br /&gt;
totem.secauth=off&lt;br /&gt;
totem.transport=udp&lt;br /&gt;
totem.version=2&lt;br /&gt;
totem.nodeid=1&lt;br /&gt;
totem.vsftype=none&lt;br /&gt;
totem.token=10000&lt;br /&gt;
totem.join=60&lt;br /&gt;
totem.fail_recv_const=2500&lt;br /&gt;
totem.consensus=2000&lt;br /&gt;
totem.key=an-cluster-A&lt;br /&gt;
totem.interface.ringnumber=0&lt;br /&gt;
totem.interface.bindnetaddr=10.20.0.1&lt;br /&gt;
totem.interface.mcastaddr=239.192.95.81&lt;br /&gt;
totem.interface.mcastport=5405&lt;br /&gt;
libccs.next_handle=7&lt;br /&gt;
libccs.connection.ccs_handle=3&lt;br /&gt;
libccs.connection.config_version=7&lt;br /&gt;
libccs.connection.fullxpath=0&lt;br /&gt;
libccs.connection.ccs_handle=4&lt;br /&gt;
libccs.connection.config_version=7&lt;br /&gt;
libccs.connection.fullxpath=0&lt;br /&gt;
libccs.connection.ccs_handle=5&lt;br /&gt;
libccs.connection.config_version=7&lt;br /&gt;
libccs.connection.fullxpath=0&lt;br /&gt;
logging.timestamp=on&lt;br /&gt;
logging.to_logfile=yes&lt;br /&gt;
logging.logfile=/var/log/cluster/corosync.log&lt;br /&gt;
logging.logfile_priority=info&lt;br /&gt;
logging.to_syslog=yes&lt;br /&gt;
logging.syslog_facility=local4&lt;br /&gt;
logging.syslog_priority=info&lt;br /&gt;
aisexec.user=ais&lt;br /&gt;
aisexec.group=ais&lt;br /&gt;
service.name=corosync_quorum&lt;br /&gt;
service.ver=0&lt;br /&gt;
service.name=corosync_cman&lt;br /&gt;
service.ver=0&lt;br /&gt;
quorum.provider=quorum_cman&lt;br /&gt;
service.name=openais_ckpt&lt;br /&gt;
service.ver=0&lt;br /&gt;
runtime.services.quorum.service_id=12&lt;br /&gt;
runtime.services.cman.service_id=9&lt;br /&gt;
runtime.services.ckpt.service_id=3&lt;br /&gt;
runtime.services.ckpt.0.tx=0&lt;br /&gt;
runtime.services.ckpt.0.rx=0&lt;br /&gt;
runtime.services.ckpt.1.tx=0&lt;br /&gt;
runtime.services.ckpt.1.rx=0&lt;br /&gt;
runtime.services.ckpt.2.tx=0&lt;br /&gt;
runtime.services.ckpt.2.rx=0&lt;br /&gt;
runtime.services.ckpt.3.tx=0&lt;br /&gt;
runtime.services.ckpt.3.rx=0&lt;br /&gt;
runtime.services.ckpt.4.tx=0&lt;br /&gt;
runtime.services.ckpt.4.rx=0&lt;br /&gt;
runtime.services.ckpt.5.tx=0&lt;br /&gt;
runtime.services.ckpt.5.rx=0&lt;br /&gt;
runtime.services.ckpt.6.tx=0&lt;br /&gt;
runtime.services.ckpt.6.rx=0&lt;br /&gt;
runtime.services.ckpt.7.tx=0&lt;br /&gt;
runtime.services.ckpt.7.rx=0&lt;br /&gt;
runtime.services.ckpt.8.tx=0&lt;br /&gt;
runtime.services.ckpt.8.rx=0&lt;br /&gt;
runtime.services.ckpt.9.tx=0&lt;br /&gt;
runtime.services.ckpt.9.rx=0&lt;br /&gt;
runtime.services.ckpt.10.tx=0&lt;br /&gt;
runtime.services.ckpt.10.rx=0&lt;br /&gt;
runtime.services.ckpt.11.tx=2&lt;br /&gt;
runtime.services.ckpt.11.rx=3&lt;br /&gt;
runtime.services.ckpt.12.tx=0&lt;br /&gt;
runtime.services.ckpt.12.rx=0&lt;br /&gt;
runtime.services.ckpt.13.tx=0&lt;br /&gt;
runtime.services.ckpt.13.rx=0&lt;br /&gt;
runtime.services.evs.service_id=0&lt;br /&gt;
runtime.services.evs.0.tx=0&lt;br /&gt;
runtime.services.evs.0.rx=0&lt;br /&gt;
runtime.services.cfg.service_id=7&lt;br /&gt;
runtime.services.cfg.0.tx=0&lt;br /&gt;
runtime.services.cfg.0.rx=0&lt;br /&gt;
runtime.services.cfg.1.tx=0&lt;br /&gt;
runtime.services.cfg.1.rx=0&lt;br /&gt;
runtime.services.cfg.2.tx=0&lt;br /&gt;
runtime.services.cfg.2.rx=0&lt;br /&gt;
runtime.services.cfg.3.tx=0&lt;br /&gt;
runtime.services.cfg.3.rx=0&lt;br /&gt;
runtime.services.cpg.service_id=8&lt;br /&gt;
runtime.services.cpg.0.tx=4&lt;br /&gt;
runtime.services.cpg.0.rx=8&lt;br /&gt;
runtime.services.cpg.1.tx=0&lt;br /&gt;
runtime.services.cpg.1.rx=0&lt;br /&gt;
runtime.services.cpg.2.tx=0&lt;br /&gt;
runtime.services.cpg.2.rx=0&lt;br /&gt;
runtime.services.cpg.3.tx=16&lt;br /&gt;
runtime.services.cpg.3.rx=23&lt;br /&gt;
runtime.services.cpg.4.tx=0&lt;br /&gt;
runtime.services.cpg.4.rx=0&lt;br /&gt;
runtime.services.cpg.5.tx=2&lt;br /&gt;
runtime.services.cpg.5.rx=3&lt;br /&gt;
runtime.services.confdb.service_id=11&lt;br /&gt;
runtime.services.pload.service_id=13&lt;br /&gt;
runtime.services.pload.0.tx=0&lt;br /&gt;
runtime.services.pload.0.rx=0&lt;br /&gt;
runtime.services.pload.1.tx=0&lt;br /&gt;
runtime.services.pload.1.rx=0&lt;br /&gt;
runtime.services.quorum.service_id=12&lt;br /&gt;
runtime.connections.active=6&lt;br /&gt;
runtime.connections.closed=110&lt;br /&gt;
runtime.connections.fenced:CPG:3490:19.service_id=8&lt;br /&gt;
runtime.connections.fenced:CPG:3490:19.client_pid=3490&lt;br /&gt;
runtime.connections.fenced:CPG:3490:19.responses=5&lt;br /&gt;
runtime.connections.fenced:CPG:3490:19.dispatched=9&lt;br /&gt;
runtime.connections.fenced:CPG:3490:19.requests=5&lt;br /&gt;
runtime.connections.fenced:CPG:3490:19.sem_retry_count=0&lt;br /&gt;
runtime.connections.fenced:CPG:3490:19.send_retry_count=0&lt;br /&gt;
runtime.connections.fenced:CPG:3490:19.recv_retry_count=0&lt;br /&gt;
runtime.connections.fenced:CPG:3490:19.flow_control=0&lt;br /&gt;
runtime.connections.fenced:CPG:3490:19.flow_control_count=0&lt;br /&gt;
runtime.connections.fenced:CPG:3490:19.queue_size=0&lt;br /&gt;
runtime.connections.fenced:CPG:3490:19.invalid_request=0&lt;br /&gt;
runtime.connections.fenced:CPG:3490:19.overload=0&lt;br /&gt;
runtime.connections.dlm_controld:CPG:3515:22.service_id=8&lt;br /&gt;
runtime.connections.dlm_controld:CPG:3515:22.client_pid=3515&lt;br /&gt;
runtime.connections.dlm_controld:CPG:3515:22.responses=5&lt;br /&gt;
runtime.connections.dlm_controld:CPG:3515:22.dispatched=8&lt;br /&gt;
runtime.connections.dlm_controld:CPG:3515:22.requests=5&lt;br /&gt;
runtime.connections.dlm_controld:CPG:3515:22.sem_retry_count=0&lt;br /&gt;
runtime.connections.dlm_controld:CPG:3515:22.send_retry_count=0&lt;br /&gt;
runtime.connections.dlm_controld:CPG:3515:22.recv_retry_count=0&lt;br /&gt;
runtime.connections.dlm_controld:CPG:3515:22.flow_control=0&lt;br /&gt;
runtime.connections.dlm_controld:CPG:3515:22.flow_control_count=0&lt;br /&gt;
runtime.connections.dlm_controld:CPG:3515:22.queue_size=0&lt;br /&gt;
runtime.connections.dlm_controld:CPG:3515:22.invalid_request=0&lt;br /&gt;
runtime.connections.dlm_controld:CPG:3515:22.overload=0&lt;br /&gt;
runtime.connections.dlm_controld:CKPT:3515:23.service_id=3&lt;br /&gt;
runtime.connections.dlm_controld:CKPT:3515:23.client_pid=3515&lt;br /&gt;
runtime.connections.dlm_controld:CKPT:3515:23.responses=0&lt;br /&gt;
runtime.connections.dlm_controld:CKPT:3515:23.dispatched=0&lt;br /&gt;
runtime.connections.dlm_controld:CKPT:3515:23.requests=0&lt;br /&gt;
runtime.connections.dlm_controld:CKPT:3515:23.sem_retry_count=0&lt;br /&gt;
runtime.connections.dlm_controld:CKPT:3515:23.send_retry_count=0&lt;br /&gt;
runtime.connections.dlm_controld:CKPT:3515:23.recv_retry_count=0&lt;br /&gt;
runtime.connections.dlm_controld:CKPT:3515:23.flow_control=0&lt;br /&gt;
runtime.connections.dlm_controld:CKPT:3515:23.flow_control_count=0&lt;br /&gt;
runtime.connections.dlm_controld:CKPT:3515:23.queue_size=0&lt;br /&gt;
runtime.connections.dlm_controld:CKPT:3515:23.invalid_request=0&lt;br /&gt;
runtime.connections.dlm_controld:CKPT:3515:23.overload=0&lt;br /&gt;
runtime.connections.gfs_controld:CPG:3565:26.service_id=8&lt;br /&gt;
runtime.connections.gfs_controld:CPG:3565:26.client_pid=3565&lt;br /&gt;
runtime.connections.gfs_controld:CPG:3565:26.responses=5&lt;br /&gt;
runtime.connections.gfs_controld:CPG:3565:26.dispatched=8&lt;br /&gt;
runtime.connections.gfs_controld:CPG:3565:26.requests=5&lt;br /&gt;
runtime.connections.gfs_controld:CPG:3565:26.sem_retry_count=0&lt;br /&gt;
runtime.connections.gfs_controld:CPG:3565:26.send_retry_count=0&lt;br /&gt;
runtime.connections.gfs_controld:CPG:3565:26.recv_retry_count=0&lt;br /&gt;
runtime.connections.gfs_controld:CPG:3565:26.flow_control=0&lt;br /&gt;
runtime.connections.gfs_controld:CPG:3565:26.flow_control_count=0&lt;br /&gt;
runtime.connections.gfs_controld:CPG:3565:26.queue_size=0&lt;br /&gt;
runtime.connections.gfs_controld:CPG:3565:26.invalid_request=0&lt;br /&gt;
runtime.connections.gfs_controld:CPG:3565:26.overload=0&lt;br /&gt;
runtime.connections.fenced:CPG:3490:28.service_id=8&lt;br /&gt;
runtime.connections.fenced:CPG:3490:28.client_pid=3490&lt;br /&gt;
runtime.connections.fenced:CPG:3490:28.responses=5&lt;br /&gt;
runtime.connections.fenced:CPG:3490:28.dispatched=8&lt;br /&gt;
runtime.connections.fenced:CPG:3490:28.requests=5&lt;br /&gt;
runtime.connections.fenced:CPG:3490:28.sem_retry_count=0&lt;br /&gt;
runtime.connections.fenced:CPG:3490:28.send_retry_count=0&lt;br /&gt;
runtime.connections.fenced:CPG:3490:28.recv_retry_count=0&lt;br /&gt;
runtime.connections.fenced:CPG:3490:28.flow_control=0&lt;br /&gt;
runtime.connections.fenced:CPG:3490:28.flow_control_count=0&lt;br /&gt;
runtime.connections.fenced:CPG:3490:28.queue_size=0&lt;br /&gt;
runtime.connections.fenced:CPG:3490:28.invalid_request=0&lt;br /&gt;
runtime.connections.fenced:CPG:3490:28.overload=0&lt;br /&gt;
runtime.connections.corosync-objctl:CONFDB:3698:27.service_id=11&lt;br /&gt;
runtime.connections.corosync-objctl:CONFDB:3698:27.client_pid=3698&lt;br /&gt;
runtime.connections.corosync-objctl:CONFDB:3698:27.responses=444&lt;br /&gt;
runtime.connections.corosync-objctl:CONFDB:3698:27.dispatched=0&lt;br /&gt;
runtime.connections.corosync-objctl:CONFDB:3698:27.requests=447&lt;br /&gt;
runtime.connections.corosync-objctl:CONFDB:3698:27.sem_retry_count=0&lt;br /&gt;
runtime.connections.corosync-objctl:CONFDB:3698:27.send_retry_count=0&lt;br /&gt;
runtime.connections.corosync-objctl:CONFDB:3698:27.recv_retry_count=0&lt;br /&gt;
runtime.connections.corosync-objctl:CONFDB:3698:27.flow_control=0&lt;br /&gt;
runtime.connections.corosync-objctl:CONFDB:3698:27.flow_control_count=0&lt;br /&gt;
runtime.connections.corosync-objctl:CONFDB:3698:27.queue_size=0&lt;br /&gt;
runtime.connections.corosync-objctl:CONFDB:3698:27.invalid_request=0&lt;br /&gt;
runtime.connections.corosync-objctl:CONFDB:3698:27.overload=0&lt;br /&gt;
runtime.totem.pg.msg_reserved=1&lt;br /&gt;
runtime.totem.pg.msg_queue_avail=761&lt;br /&gt;
runtime.totem.pg.mrp.srp.orf_token_tx=2&lt;br /&gt;
runtime.totem.pg.mrp.srp.orf_token_rx=405&lt;br /&gt;
runtime.totem.pg.mrp.srp.memb_merge_detect_tx=53&lt;br /&gt;
runtime.totem.pg.mrp.srp.memb_merge_detect_rx=53&lt;br /&gt;
runtime.totem.pg.mrp.srp.memb_join_tx=3&lt;br /&gt;
runtime.totem.pg.mrp.srp.memb_join_rx=5&lt;br /&gt;
runtime.totem.pg.mrp.srp.mcast_tx=45&lt;br /&gt;
runtime.totem.pg.mrp.srp.mcast_retx=0&lt;br /&gt;
runtime.totem.pg.mrp.srp.mcast_rx=56&lt;br /&gt;
runtime.totem.pg.mrp.srp.memb_commit_token_tx=4&lt;br /&gt;
runtime.totem.pg.mrp.srp.memb_commit_token_rx=4&lt;br /&gt;
runtime.totem.pg.mrp.srp.token_hold_cancel_tx=4&lt;br /&gt;
runtime.totem.pg.mrp.srp.token_hold_cancel_rx=7&lt;br /&gt;
runtime.totem.pg.mrp.srp.operational_entered=2&lt;br /&gt;
runtime.totem.pg.mrp.srp.operational_token_lost=0&lt;br /&gt;
runtime.totem.pg.mrp.srp.gather_entered=2&lt;br /&gt;
runtime.totem.pg.mrp.srp.gather_token_lost=0&lt;br /&gt;
runtime.totem.pg.mrp.srp.commit_entered=2&lt;br /&gt;
runtime.totem.pg.mrp.srp.commit_token_lost=0&lt;br /&gt;
runtime.totem.pg.mrp.srp.recovery_entered=2&lt;br /&gt;
runtime.totem.pg.mrp.srp.recovery_token_lost=0&lt;br /&gt;
runtime.totem.pg.mrp.srp.consensus_timeouts=0&lt;br /&gt;
runtime.totem.pg.mrp.srp.mtt_rx_token=913&lt;br /&gt;
runtime.totem.pg.mrp.srp.avg_token_workload=0&lt;br /&gt;
runtime.totem.pg.mrp.srp.avg_backlog_calc=0&lt;br /&gt;
runtime.totem.pg.mrp.srp.rx_msg_dropped=0&lt;br /&gt;
runtime.totem.pg.mrp.srp.continuous_gather=0&lt;br /&gt;
runtime.totem.pg.mrp.srp.firewall_enabled_or_nic_failure=0&lt;br /&gt;
runtime.totem.pg.mrp.srp.members.1.ip=r(0) ip(10.20.0.1) &lt;br /&gt;
runtime.totem.pg.mrp.srp.members.1.join_count=1&lt;br /&gt;
runtime.totem.pg.mrp.srp.members.1.status=joined&lt;br /&gt;
runtime.totem.pg.mrp.srp.members.2.ip=r(0) ip(10.20.0.2) &lt;br /&gt;
runtime.totem.pg.mrp.srp.members.2.join_count=1&lt;br /&gt;
runtime.totem.pg.mrp.srp.members.2.status=joined&lt;br /&gt;
runtime.blackbox.dump_flight_data=no&lt;br /&gt;
runtime.blackbox.dump_state=no&lt;br /&gt;
cman_private.COROSYNC_DEFAULT_CONFIG_IFACE=xmlconfig:cmanpreconfig&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you want to check what [[DLM]] lockspaces, you can use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;dlm_tool ls&amp;lt;/span&amp;gt; to list lock spaces. Given that we&#039;re not running and resources or clustered filesystems though, there won&#039;t be any at this time. We&#039;ll look at this again later.&lt;br /&gt;
&lt;br /&gt;
== Testing Fencing ==&lt;br /&gt;
&lt;br /&gt;
We need to thoroughly test our fence configuration and devices before we proceed. Should the cluster call a fence, and if the fence call fails, the cluster will hang until the fence finally succeeds. There is no way to abort a fence, so this could effectively hang the cluster. If we have problems, we need to find them now.&lt;br /&gt;
&lt;br /&gt;
We need to run two tests from each node against the other node for a total of four tests.&lt;br /&gt;
* The first test will use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fence_ipmilan&amp;lt;/span&amp;gt;. To do this, we will hang the victim node by running &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;echo c &amp;gt; /proc/sysrq-trigger&amp;lt;/span&amp;gt; on it. This will immediately and completely hang the kernel. The other node should detect the failure and reboot the victim. You can confirm that IPMI was used by watching the fence PDU and &#039;&#039;&#039;not&#039;&#039;&#039; seeing it power-cycle the port.&lt;br /&gt;
* Secondly, we will pull the power on the victim node. This is done to ensure that the IPMI BMC is also dead and will simulate a failure in the power supply. You should see the other node try to fence the victim, fail initially, then try again using the second, switched PDU. If you want the PDU, you should see the power indicator LED go off and then come back on. &lt;br /&gt;
&lt;br /&gt;
{{note|1=To &amp;quot;pull the power&amp;quot;, we can actually just log into the PDU and turn off the victim&#039;s power. In this case, we&#039;ll see the power restored when the PDU is used to fence the node. We can actually use the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fence_apc&amp;lt;/span&amp;gt; fence agent to pull the power, as we&#039;ll see.}}&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Test&lt;br /&gt;
!Victim&lt;br /&gt;
!Pass?&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;echo c &amp;gt; /proc/sysrq-trigger&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;span style=&amp;quot;color: green;&amp;quot;&amp;gt;Yes&amp;lt;/span&amp;gt; / &amp;lt;span style=&amp;quot;color: red;&amp;quot;&amp;gt;No&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fence_apc_snmp -a pdu2.alteeve.com -n 1 -o off&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;span style=&amp;quot;color: green;&amp;quot;&amp;gt;Yes&amp;lt;/span&amp;gt; / &amp;lt;span style=&amp;quot;color: red;&amp;quot;&amp;gt;No&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;echo c &amp;gt; /proc/sysrq-trigger&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;span style=&amp;quot;color: green;&amp;quot;&amp;gt;Yes&amp;lt;/span&amp;gt; / &amp;lt;span style=&amp;quot;color: red;&amp;quot;&amp;gt;No&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fence_apc_snmp -a pdu2.alteeve.com -n 2 -o off&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;span style=&amp;quot;color: green;&amp;quot;&amp;gt;Yes&amp;lt;/span&amp;gt; / &amp;lt;span style=&amp;quot;color: red;&amp;quot;&amp;gt;No&amp;lt;/span&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
After the lost node is recovered, remember to restart &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt; before starting the next test.&lt;br /&gt;
&lt;br /&gt;
=== Hanging an-node01 ===&lt;br /&gt;
&lt;br /&gt;
Be sure to be &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;tail&amp;lt;/span&amp;gt;ing the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/var/log/messages&amp;lt;/span&amp;gt; on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt;. Go to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;&#039;s first terminal and run the following command. &lt;br /&gt;
&lt;br /&gt;
{{warning|1=This command will not return and you will lose all ability to talk to this node until it is rebooted.}}&lt;br /&gt;
&lt;br /&gt;
On &#039;&#039;&#039;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;&#039;&#039;&#039; 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;
On &#039;&#039;&#039;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt;&#039;&#039;&#039;&#039;s syslog terminal, you should see the following entries in the log.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Dec 13 12:42:39 an-node02 corosync[2758]:   [TOTEM ] A processor failed, forming new configuration.&lt;br /&gt;
Dec 13 12:42:41 an-node02 corosync[2758]:   [QUORUM] Members[1]: 2&lt;br /&gt;
Dec 13 12:42:41 an-node02 corosync[2758]:   [TOTEM ] A processor joined or left the membership and a new membership was formed.&lt;br /&gt;
Dec 13 12:42:41 an-node02 corosync[2758]:   [CPG   ] chosen downlist: sender r(0) ip(10.20.0.2) ; members(old:2 left:1)&lt;br /&gt;
Dec 13 12:42:41 an-node02 corosync[2758]:   [MAIN  ] Completed service synchronization, ready to provide service.&lt;br /&gt;
Dec 13 12:42:41 an-node02 kernel: dlm: closing connection to node 1&lt;br /&gt;
Dec 13 12:42:41 an-node02 fenced[2817]: fencing node an-node01.alteeve.com&lt;br /&gt;
Dec 13 12:42:56 an-node02 fenced[2817]: fence an-node01.alteeve.com success&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Perfect!&lt;br /&gt;
&lt;br /&gt;
If you are watching &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;&#039;s display, you should now see it starting to boot back up. &lt;br /&gt;
&lt;br /&gt;
{{note|1=Remember to start &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt; once the node boots back up before trying the next test.}}&lt;br /&gt;
&lt;br /&gt;
=== Cutting the Power to an-node01 ===&lt;br /&gt;
&lt;br /&gt;
As was discussed earlier, IPMI and other out-of-band management interfaces have a fatal flaw as a fence device. Their [[BMC]] draws its power from the same power supply as the node itself. Thus, when the power supply itself fails (or the mains connection is pulled/tripped over), fencing via IPMI will fail. This makes the power supply a single point of failure, which is what the PDU protects us against.&lt;br /&gt;
&lt;br /&gt;
So to simulate a failed power supply, we&#039;re going to use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt;&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fence_apc&amp;lt;/span&amp;gt; fence agent to turn off the power to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
Alternatively, you could also just unplug the power and the fence would still succeed. The fence call only needs to confirm that the node is off to succeed. Whether the node restarts after or not is not important so far as the cluster is concerned.&lt;br /&gt;
&lt;br /&gt;
From &#039;&#039;&#039;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt;&#039;&#039;&#039;, pull the power on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt; with the following call;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
fence_apc_snmp -a pdu2.alteeve.com -n 1 -o off&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Success: Powered OFF&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Back on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt;&#039;s syslog, we should see the following entries;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Dec 13 12:45:46 an-node02 corosync[2758]:   [TOTEM ] A processor failed, forming new configuration.&lt;br /&gt;
Dec 13 12:45:48 an-node02 corosync[2758]:   [QUORUM] Members[1]: 2&lt;br /&gt;
Dec 13 12:45:48 an-node02 corosync[2758]:   [TOTEM ] A processor joined or left the membership and a new membership was formed.&lt;br /&gt;
Dec 13 12:45:48 an-node02 corosync[2758]:   [CPG   ] chosen downlist: sender r(0) ip(10.20.0.2) ; members(old:2 left:1)&lt;br /&gt;
Dec 13 12:45:48 an-node02 corosync[2758]:   [MAIN  ] Completed service synchronization, ready to provide service.&lt;br /&gt;
Dec 13 12:45:48 an-node02 kernel: dlm: closing connection to node 1&lt;br /&gt;
Dec 13 12:45:48 an-node02 fenced[2817]: fencing node an-node01.alteeve.com&lt;br /&gt;
Dec 13 12:46:08 an-node02 fenced[2817]: fence an-node01.alteeve.com dev 0.0 agent fence_ipmilan result: error from agent&lt;br /&gt;
Dec 13 12:46:08 an-node02 fenced[2817]: fence an-node01.alteeve.com success&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Hoozah!&lt;br /&gt;
&lt;br /&gt;
Notice that there is an error from the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fence_ipmilan&amp;lt;/span&amp;gt;. This is exactly what we expected because of the IPMI&#039;s BMC lost power and couldn&#039;t respond.&lt;br /&gt;
&lt;br /&gt;
So now we know that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt; can be fenced successfully from both fence devices. Now we need to run the same tests against &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Hanging an-node02 ===&lt;br /&gt;
&lt;br /&gt;
{{warning|1=&#039;&#039;&#039;DO NOT ASSUME THAT &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt; WILL FENCE PROPERLY JUST BECAUSE &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt; PASSED!&#039;&#039;&#039;. There are many ways that a fence could fail; Bad password, misconfigured device, plugged into the wrong port on the PDU and so on. Always test all nodes using all methods!}}&lt;br /&gt;
&lt;br /&gt;
Be sure to be &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;tail&amp;lt;/span&amp;gt;ing the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/var/log/messages&amp;lt;/span&amp;gt; on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt;. Go to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;&#039;s first terminal and run the following command. &lt;br /&gt;
&lt;br /&gt;
{{note|1=This command will not return and you will lose all ability to talk to this node until it is rebooted.}}&lt;br /&gt;
&lt;br /&gt;
On &#039;&#039;&#039;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt;&#039;&#039;&#039; 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;
On &#039;&#039;&#039;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;&#039;&#039;&#039;&#039;s syslog terminal, you should see the following entries in the log.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Dec 13 12:52:34 an-node01 corosync[3445]:   [TOTEM ] A processor failed, forming new configuration.&lt;br /&gt;
Dec 13 12:52:36 an-node01 corosync[3445]:   [QUORUM] Members[1]: 1&lt;br /&gt;
Dec 13 12:52:36 an-node01 corosync[3445]:   [TOTEM ] A processor joined or left the membership and a new membership was formed.&lt;br /&gt;
Dec 13 12:52:36 an-node01 corosync[3445]:   [CPG   ] chosen downlist: sender r(0) ip(10.20.0.1) ; members(old:2 left:1)&lt;br /&gt;
Dec 13 12:52:36 an-node01 corosync[3445]:   [MAIN  ] Completed service synchronization, ready to provide service.&lt;br /&gt;
Dec 13 12:52:36 an-node01 kernel: dlm: closing connection to node 2&lt;br /&gt;
Dec 13 12:52:36 an-node01 fenced[3501]: fencing node an-node02.alteeve.com&lt;br /&gt;
Dec 13 12:52:51 an-node01 fenced[3501]: fence an-node02.alteeve.com success&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Again, perfect!&lt;br /&gt;
&lt;br /&gt;
=== Cutting the Power to an-node02 ===&lt;br /&gt;
&lt;br /&gt;
From &#039;&#039;&#039;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;&#039;&#039;&#039;, pull the power on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt; with the following call;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
fence_apc_snmp -a pdu2.alteeve.com -n 2 -o off&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Success: Powered OFF&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Back on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;&#039;s syslog, we should see the following entries;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Dec 13 12:55:58 an-node01 corosync[3445]:   [TOTEM ] A processor failed, forming new configuration.&lt;br /&gt;
Dec 13 12:56:00 an-node01 corosync[3445]:   [QUORUM] Members[1]: 1&lt;br /&gt;
Dec 13 12:56:00 an-node01 corosync[3445]:   [TOTEM ] A processor joined or left the membership and a new membership was formed.&lt;br /&gt;
Dec 13 12:56:00 an-node01 corosync[3445]:   [CPG   ] chosen downlist: sender r(0) ip(10.20.0.1) ; members(old:2 left:1)&lt;br /&gt;
Dec 13 12:56:00 an-node01 kernel: dlm: closing connection to node 2&lt;br /&gt;
Dec 13 12:56:00 an-node01 corosync[3445]:   [MAIN  ] Completed service synchronization, ready to provide service.&lt;br /&gt;
Dec 13 12:56:00 an-node01 fenced[3501]: fencing node an-node02.alteeve.com&lt;br /&gt;
Dec 13 12:56:20 an-node01 fenced[3501]: fence an-node02.alteeve.com dev 0.0 agent fence_ipmilan result: error from agent&lt;br /&gt;
Dec 13 12:56:20 an-node01 fenced[3501]: fence an-node02.alteeve.com success&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Woot!&lt;br /&gt;
&lt;br /&gt;
Only now can we safely say that our fencing is setup and working properly.&lt;br /&gt;
&lt;br /&gt;
== Testing Network Redundancy ==&lt;br /&gt;
&lt;br /&gt;
Next up of the testing block is our network configuration. Seeing as we&#039;ve build our bonds, we need to now test that they are working properly. &lt;br /&gt;
&lt;br /&gt;
* Make sure that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt; has started on both nodes.&lt;br /&gt;
&lt;br /&gt;
First, we&#039;ll test all network cables individually, one node and one bonded interface at a time.&lt;br /&gt;
&lt;br /&gt;
* For each network; IFN, SN and BCN;&lt;br /&gt;
** On both nodes, start a ping flood against the opposing node specifying the appropriate network name suffix in the first window and starting &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;tail&amp;lt;/span&amp;gt;ing syslog in the second window.&lt;br /&gt;
** &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;watch&amp;lt;/span&amp;gt; each bond&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/proc/net/bonding/bondX&amp;lt;/span&amp;gt; file to see which interfaces are active.&lt;br /&gt;
** Pull the currently-active network cable from the bond (either at the switch or at the node).&lt;br /&gt;
** Check the state of the bonds again and see that they&#039;ve switched to their backup interface. If a node gets fenced, you know something went wrong. You should see a handful of lost packets in the ping flood.&lt;br /&gt;
** Restore the network cable and wait 2 minutes, then verify that the old primary interface was restored. You will see another handful of lost packets in the flood during the recovery.&lt;br /&gt;
** Pull the cable again, then restore it. This time, do not wait 2 minutes. After just a few seconds, pull the backup link and ensure that the bond immediately resumed use of the primary interface.&lt;br /&gt;
** Repeat the above steps for all bonds on both nodes. This will take a while, but you need to ensure configuration errors are found now.&lt;br /&gt;
&lt;br /&gt;
{{warning|1=Testing the complete primary switch failure and subsequant recovery is very, very important. Please do NOT skip this step!}}&lt;br /&gt;
&lt;br /&gt;
Once all bonds have been tested, we&#039;ll do a final test by failing the primary switch.&lt;br /&gt;
* Cut the power to the switch.&lt;br /&gt;
* Check all bond status files. Confirm that all have switched to their backup links.&lt;br /&gt;
* Restore power to the switch and wait 2 minutes.&lt;br /&gt;
* Confirm that the bonds did not switch to the primary interfaces before the switch was ready to move data.&lt;br /&gt;
&lt;br /&gt;
If all of these steps pass and the cluster doesn&#039;t partition, then you can be confident that your network is configured properly for full redundancy.&lt;br /&gt;
&lt;br /&gt;
=== Network Testing Terminal Layout ===&lt;br /&gt;
&lt;br /&gt;
If you have a couple of monitors, particularly one with portrait mode, you might be able to open 16 terminals at once. This is how many are needed to run ping floods, watch the bond status files, tail syslog and watch cman_tool all at the same time. This configuration makes it very easy to keep a near real-time, complete view of all network components.&lt;br /&gt;
&lt;br /&gt;
On the left window, the top-left terminal shows &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;watch cman_tool status&amp;lt;/span&amp;gt; and the top-right terminal shows &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;tail -f -n 0 /var/log/messages&amp;lt;/span&amp;gt; for &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;. The bottom two terminals show the same for &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
On the right, portrait-mode window, the terminal layout used for monitoring the bonded link status and ping floods are shown. There are two columns; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt; on the left and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt; on the right. Each column is stacked into six rows, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;bond0&amp;lt;/span&amp;gt; on the top followed by &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ping -f an-node02.bcn&amp;lt;/span&amp;gt;, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;bond1&amp;lt;/span&amp;gt; in the middle followed by &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ping -f an-node02.sn&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;bond2&amp;lt;/span&amp;gt; at the bottom followed by &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ping -f an-node02.ifn&amp;lt;/span&amp;gt;. The left window shows the standard &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;tail&amp;lt;/span&amp;gt; on syslog plus &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;watch cman_tool status&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[Image:2-node_el6-tutorial_network-test_terminal-layout_01.png|thumb|center|700px|Terminal layout used for HA network testing; Calls shown.]]&lt;br /&gt;
&lt;br /&gt;
[[Image:2-node_el6-tutorial_network-test_terminal-layout_02.png|thumb|center|700px|Terminal layout used for HA network testing; Calls running.]]&lt;br /&gt;
&lt;br /&gt;
=== How to Know if the Tests Passed ===&lt;br /&gt;
&lt;br /&gt;
Well, the most obvious answer to this question is if the cluster is still working after a switch is powered off.&lt;br /&gt;
&lt;br /&gt;
We can be a little more subtle than that though.&lt;br /&gt;
&lt;br /&gt;
The state of each bond is viewable by looking in the special &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/proc/net/bonding/bondX&amp;lt;/span&amp;gt; files, where &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;X&amp;lt;/span&amp;gt; is the bond number. Lets take a look at &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;bond0&amp;lt;/span&amp;gt; on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cat /proc/net/bonding/bond0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Ethernet Channel Bonding Driver: v3.6.0 (September 26, 2009)&lt;br /&gt;
&lt;br /&gt;
Bonding Mode: fault-tolerance (active-backup)&lt;br /&gt;
Primary Slave: eth0 (primary_reselect always)&lt;br /&gt;
Currently Active Slave: eth0&lt;br /&gt;
MII Status: up&lt;br /&gt;
MII Polling Interval (ms): 100&lt;br /&gt;
Up Delay (ms): 120000&lt;br /&gt;
Down Delay (ms): 0&lt;br /&gt;
&lt;br /&gt;
Slave Interface: eth0&lt;br /&gt;
MII Status: up&lt;br /&gt;
Link Failure Count: 0&lt;br /&gt;
Permanent HW addr: 00:e0:81:c7:ec:49&lt;br /&gt;
Slave queue ID: 0&lt;br /&gt;
&lt;br /&gt;
Slave Interface: eth3&lt;br /&gt;
MII Status: up&lt;br /&gt;
Link Failure Count: 0&lt;br /&gt;
Permanent HW addr: 00:1b:21:9d:59:fc&lt;br /&gt;
Slave queue ID: 0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can see that the currently active interface is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth0&amp;lt;/span&amp;gt;. This is the key bit we&#039;re going to be watching for these tests. I know that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth0&amp;lt;/span&amp;gt; on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt; is connected to by first switch. So when I pull the cable to that switch, or when I fail that switch entirely, I should see &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth3&amp;lt;/span&amp;gt; take over.&lt;br /&gt;
&lt;br /&gt;
We&#039;ll also be watching syslog. If things work right, we should not see any messages from the cluster during failure and recovery.&lt;br /&gt;
&lt;br /&gt;
=== Failing The First Interface ===&lt;br /&gt;
&lt;br /&gt;
Let&#039;s look at the first test. We&#039;ll fail &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth0&amp;lt;/span&amp;gt; interface by pulling its cable.&lt;br /&gt;
&lt;br /&gt;
On &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;&#039;s syslog, you will see;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Dec 13 14:03:19 an-node01 kernel: e1000e: eth0 NIC Link is Down&lt;br /&gt;
Dec 13 14:03:19 an-node01 kernel: bonding: bond0: link status definitely down for interface eth0, disabling it&lt;br /&gt;
Dec 13 14:03:19 an-node01 kernel: bonding: bond0: making interface eth3 the new active one.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Looking again at &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;bond0&amp;lt;/span&amp;gt;&#039;s status;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cat /proc/net/bonding/bond0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Ethernet Channel Bonding Driver: v3.6.0 (September 26, 2009)&lt;br /&gt;
&lt;br /&gt;
Bonding Mode: fault-tolerance (active-backup)&lt;br /&gt;
Primary Slave: eth0 (primary_reselect always)&lt;br /&gt;
Currently Active Slave: eth3&lt;br /&gt;
MII Status: up&lt;br /&gt;
MII Polling Interval (ms): 100&lt;br /&gt;
Up Delay (ms): 120000&lt;br /&gt;
Down Delay (ms): 0&lt;br /&gt;
&lt;br /&gt;
Slave Interface: eth0&lt;br /&gt;
MII Status: down&lt;br /&gt;
Link Failure Count: 1&lt;br /&gt;
Permanent HW addr: 00:e0:81:c7:ec:49&lt;br /&gt;
Slave queue ID: 0&lt;br /&gt;
&lt;br /&gt;
Slave Interface: eth3&lt;br /&gt;
MII Status: up&lt;br /&gt;
Link Failure Count: 0&lt;br /&gt;
Permanent HW addr: 00:1b:21:9d:59:fc&lt;br /&gt;
Slave queue ID: 0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can see now that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth0&amp;lt;/span&amp;gt; is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;down&amp;lt;/span&amp;gt; and that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth3&amp;lt;/span&amp;gt; has taken over.&lt;br /&gt;
&lt;br /&gt;
If you look at the windows running the ping flood, both &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt; should show nearly the same number of lost packets;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
PING an-node02 (10.20.0.2) 56(84) bytes of data.&lt;br /&gt;
........................&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The failure of the link was successful!&lt;br /&gt;
&lt;br /&gt;
=== Recovering The First Interface ===&lt;br /&gt;
&lt;br /&gt;
Surviving failure is only half the test. We also need to test the recovery of the interface. When ready, reconnect &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth0&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The first thing you should notice is in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;&#039;s syslog;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Dec 13 14:06:40 an-node01 kernel: e1000e: eth0 NIC Link is Up 1000 Mbps Full Duplex, Flow Control: Rx/Tx&lt;br /&gt;
Dec 13 14:06:40 an-node01 kernel: bonding: bond0: link status up for interface eth0, enabling it in 120000 ms.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The bond will still be using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth3&amp;lt;/span&amp;gt;, so lets wait two minutes.&lt;br /&gt;
&lt;br /&gt;
After the two minutes, you should see the following addition syslog entries.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Dec 13 14:08:40 an-node01 kernel: bond0: link status definitely up for interface eth0, 1000 Mbps full duplex.&lt;br /&gt;
Dec 13 14:08:40 an-node01 kernel: bonding: bond0: making interface eth0 the new active one.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If we go back to the bond status file, we&#039;ll see that the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth0&amp;lt;/span&amp;gt; interface has been restored.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cat /proc/net/bonding/bond0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Ethernet Channel Bonding Driver: v3.6.0 (September 26, 2009)&lt;br /&gt;
&lt;br /&gt;
Bonding Mode: fault-tolerance (active-backup)&lt;br /&gt;
Primary Slave: eth0 (primary_reselect always)&lt;br /&gt;
Currently Active Slave: eth0&lt;br /&gt;
MII Status: up&lt;br /&gt;
MII Polling Interval (ms): 100&lt;br /&gt;
Up Delay (ms): 120000&lt;br /&gt;
Down Delay (ms): 0&lt;br /&gt;
&lt;br /&gt;
Slave Interface: eth0&lt;br /&gt;
MII Status: up&lt;br /&gt;
Link Failure Count: 1&lt;br /&gt;
Permanent HW addr: 00:e0:81:c7:ec:49&lt;br /&gt;
Slave queue ID: 0&lt;br /&gt;
&lt;br /&gt;
Slave Interface: eth3&lt;br /&gt;
MII Status: up&lt;br /&gt;
Link Failure Count: 0&lt;br /&gt;
Permanent HW addr: 00:1b:21:9d:59:fc&lt;br /&gt;
Slave queue ID: 0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that the only difference from before is that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth0&amp;lt;/span&amp;gt;&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Link Failure Count&amp;lt;/span&amp;gt; has been incremented to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The test has passed!&lt;br /&gt;
&lt;br /&gt;
Now repeat the test for the other two bonds, then for all three bonds on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt;. Remember to also repeat each test, but pull the backup interface before the 2 minutes delays has completed. The primary interface should immediately take over again. This will confirm that failover for the backup link is also working properly.&lt;br /&gt;
&lt;br /&gt;
=== Failing The First Switch ===&lt;br /&gt;
&lt;br /&gt;
{{note|1=Make sure that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt; is running before beginning the test! The real test is less about the failure and recovery of the network itself and more about whether it fails and recovers in such a way that the cluster stays up and no partitioning occurs.}}&lt;br /&gt;
&lt;br /&gt;
Check that all bonds on both nodes are using their primary interfaces. Confirm your cabling to ensure that these are all routed to the primary switch and that all backup links are cabled into the backup switch. Once done, pull the power to the primary switch. Both nodes should show similar output in their syslog windows;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Dec 13 14:16:17 an-node01 kernel: e1000e: eth2 NIC Link is Down&lt;br /&gt;
Dec 13 14:16:17 an-node01 kernel: e1000e: eth0 NIC Link is Down&lt;br /&gt;
Dec 13 14:16:17 an-node01 kernel: bonding: bond0: link status definitely down for interface eth0, disabling it&lt;br /&gt;
Dec 13 14:16:17 an-node01 kernel: bonding: bond0: making interface eth3 the new active one.&lt;br /&gt;
Dec 13 14:16:17 an-node01 kernel: bonding: bond2: link status definitely down for interface eth2, disabling it&lt;br /&gt;
Dec 13 14:16:17 an-node01 kernel: bonding: bond2: making interface eth5 the new active one.&lt;br /&gt;
Dec 13 14:16:17 an-node01 kernel: device eth2 left promiscuous mode&lt;br /&gt;
Dec 13 14:16:17 an-node01 kernel: device eth5 entered promiscuous mode&lt;br /&gt;
Dec 13 14:16:17 an-node01 kernel: e1000e: eth1 NIC Link is Down&lt;br /&gt;
Dec 13 14:16:18 an-node01 kernel: bonding: bond1: link status definitely down for interface eth1, disabling it&lt;br /&gt;
Dec 13 14:16:18 an-node01 kernel: bonding: bond1: making interface eth4 the new active one.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I can look at &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/proc/net/bonding/bond0&amp;lt;/span&amp;gt; file and see:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cat /proc/net/bonding/bond0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Ethernet Channel Bonding Driver: v3.6.0 (September 26, 2009)&lt;br /&gt;
&lt;br /&gt;
Bonding Mode: fault-tolerance (active-backup)&lt;br /&gt;
Primary Slave: eth0 (primary_reselect always)&lt;br /&gt;
Currently Active Slave: eth3&lt;br /&gt;
MII Status: up&lt;br /&gt;
MII Polling Interval (ms): 100&lt;br /&gt;
Up Delay (ms): 120000&lt;br /&gt;
Down Delay (ms): 0&lt;br /&gt;
&lt;br /&gt;
Slave Interface: eth0&lt;br /&gt;
MII Status: down&lt;br /&gt;
Link Failure Count: 3&lt;br /&gt;
Permanent HW addr: 00:e0:81:c7:ec:49&lt;br /&gt;
Slave queue ID: 0&lt;br /&gt;
&lt;br /&gt;
Slave Interface: eth3&lt;br /&gt;
MII Status: up&lt;br /&gt;
Link Failure Count: 2&lt;br /&gt;
Permanent HW addr: 00:1b:21:9d:59:fc&lt;br /&gt;
Slave queue ID: 0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Notice &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Currently Active Slave&amp;lt;/span&amp;gt; is now &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth3&amp;lt;/span&amp;gt;? You can also see now that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth0&amp;lt;/span&amp;gt;&#039;s link is down (&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;MII Status: down&amp;lt;/span&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
It should be the same story for all the other bonds on both nodes. &lt;br /&gt;
&lt;br /&gt;
If we check the status of the cluster, we&#039;ll see that all is good.&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: 7&lt;br /&gt;
Cluster Name: an-cluster-A&lt;br /&gt;
Cluster Id: 24561&lt;br /&gt;
Cluster Member: Yes&lt;br /&gt;
Cluster Generation: 40&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;
Node votes: 1&lt;br /&gt;
Quorum: 1  &lt;br /&gt;
Active subsystems: 7&lt;br /&gt;
Flags: 2node &lt;br /&gt;
Ports Bound: 0  &lt;br /&gt;
Node name: an-node01.alteeve.com&lt;br /&gt;
Node ID: 1&lt;br /&gt;
Multicast addresses: 239.192.95.81 &lt;br /&gt;
Node addresses: 10.20.0.1 &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Success! We just failed the primary switch without any interruption of clustered services.&lt;br /&gt;
&lt;br /&gt;
We&#039;re not out of the woods yet, though...&lt;br /&gt;
&lt;br /&gt;
=== Restoring The First Switch ===&lt;br /&gt;
&lt;br /&gt;
Now that we&#039;ve confirmed all of the bonds are working on the backup switch, lets restore power to the first switch.&lt;br /&gt;
&lt;br /&gt;
{{warning|1=Be sure to wait five minutes after restoring power before declaring the recovery a success! Some configuration faults will take a few minutes to appear.}}&lt;br /&gt;
&lt;br /&gt;
It is very important to wait for a while after restoring power to the switch. Some of the common problems that can break your cluster will not show up immediately. A good example is a misconfiguration of [[STP]]. In this case, the switch will come up, a short time will pass and then the switch will trigger an STP reconfiguration. Once this happens, both switches will block traffic for many seconds. This will partition you cluster.&lt;br /&gt;
&lt;br /&gt;
So then, lets power it back up.&lt;br /&gt;
&lt;br /&gt;
Within a few moments, you should see this in your syslog;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Dec 13 14:19:30 an-node01 kernel: e1000e: eth0 NIC Link is Up 1000 Mbps Full Duplex, Flow Control: Rx/Tx&lt;br /&gt;
Dec 13 14:19:30 an-node01 kernel: bonding: bond0: link status up for interface eth0, enabling it in 120000 ms.&lt;br /&gt;
Dec 13 14:19:30 an-node01 kernel: e1000e: eth2 NIC Link is Up 1000 Mbps Full Duplex, Flow Control: Rx/Tx&lt;br /&gt;
Dec 13 14:19:30 an-node01 kernel: e1000e: eth1 NIC Link is Up 1000 Mbps Full Duplex, Flow Control: Rx/Tx&lt;br /&gt;
Dec 13 14:19:30 an-node01 kernel: bonding: bond2: link status up for interface eth2, enabling it in 120000 ms.&lt;br /&gt;
Dec 13 14:19:30 an-node01 kernel: bonding: bond1: link status up for interface eth1, enabling it in 120000 ms.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As with the individual link test, the backup interfaces will remain in use for two minutes. This is critical because &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;miimon&amp;lt;/span&amp;gt; has detected the connection to the switches, but the switches are still a long way from being able to route traffic. After the two minutes, we&#039;ll see the primary interfaces return to active state.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Dec 13 14:20:25 an-node01 kernel: e1000e: eth0 NIC Link is Down&lt;br /&gt;
Dec 13 14:20:25 an-node01 kernel: bonding: bond0: link status down again after 55000 ms for interface eth0.&lt;br /&gt;
Dec 13 14:20:26 an-node01 kernel: e1000e: eth1 NIC Link is Down&lt;br /&gt;
Dec 13 14:20:26 an-node01 kernel: bonding: bond1: link status down again after 55800 ms for interface eth1.&lt;br /&gt;
Dec 13 14:20:27 an-node01 kernel: e1000e: eth2 NIC Link is Down&lt;br /&gt;
Dec 13 14:20:27 an-node01 kernel: bonding: bond2: link status down again after 56800 ms for interface eth2.&lt;br /&gt;
Dec 13 14:20:27 an-node01 kernel: e1000e: eth0 NIC Link is Up 1000 Mbps Full Duplex, Flow Control: Rx/Tx&lt;br /&gt;
Dec 13 14:20:27 an-node01 kernel: bonding: bond0: link status up for interface eth0, enabling it in 120000 ms.&lt;br /&gt;
Dec 13 14:20:28 an-node01 kernel: e1000e: eth1 NIC Link is Up 1000 Mbps Full Duplex, Flow Control: Rx/Tx&lt;br /&gt;
Dec 13 14:20:28 an-node01 kernel: bonding: bond1: link status up for interface eth1, enabling it in 120000 ms.&lt;br /&gt;
Dec 13 14:20:29 an-node01 kernel: e1000e: eth2 NIC Link is Up 1000 Mbps Full Duplex, Flow Control: Rx/Tx&lt;br /&gt;
Dec 13 14:20:29 an-node01 kernel: bonding: bond2: link status up for interface eth2, enabling it in 120000 ms.&lt;br /&gt;
Dec 13 14:20:31 an-node01 kernel: e1000e: eth0 NIC Link is Down&lt;br /&gt;
Dec 13 14:20:31 an-node01 kernel: bonding: bond0: link status down again after 3500 ms for interface eth0.&lt;br /&gt;
Dec 13 14:20:32 an-node01 kernel: e1000e: eth1 NIC Link is Down&lt;br /&gt;
Dec 13 14:20:32 an-node01 kernel: bonding: bond1: link status down again after 4100 ms for interface eth1.&lt;br /&gt;
Dec 13 14:20:32 an-node01 kernel: e1000e: eth2 NIC Link is Down&lt;br /&gt;
Dec 13 14:20:32 an-node01 kernel: bonding: bond2: link status down again after 3500 ms for interface eth2.&lt;br /&gt;
Dec 13 14:20:33 an-node01 kernel: e1000e: eth0 NIC Link is Up 1000 Mbps Full Duplex, Flow Control: Rx/Tx&lt;br /&gt;
Dec 13 14:20:33 an-node01 kernel: bonding: bond0: link status up for interface eth0, enabling it in 120000 ms.&lt;br /&gt;
Dec 13 14:20:34 an-node01 kernel: e1000e: eth1 NIC Link is Up 1000 Mbps Full Duplex, Flow Control: Rx/Tx&lt;br /&gt;
Dec 13 14:20:34 an-node01 kernel: bonding: bond1: link status up for interface eth1, enabling it in 120000 ms.&lt;br /&gt;
Dec 13 14:20:35 an-node01 kernel: e1000e: eth2 NIC Link is Up 1000 Mbps Full Duplex, Flow Control: Rx/Tx&lt;br /&gt;
Dec 13 14:20:35 an-node01 kernel: bonding: bond2: link status up for interface eth2, enabling it in 120000 ms.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
See all that bouncing? That is caused by many switches showing a link (that is the [[MII]] status) without actually being able to push traffic. As part of the switches boot sequence, the links will go down and come back up a couple of times. The 2 minute counter will reset with each bounce, so the recovery time is actually quite a bit longer than two minutes. This is fine, no need to rush back to the first switch.&lt;br /&gt;
&lt;br /&gt;
Note that you will not see this bouncing on switches that hold back on [[MII]] status until finished booting.&lt;br /&gt;
&lt;br /&gt;
After a few minutes, the old interfaces will actually be restored.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Dec 13 14:22:33 an-node01 kernel: bond0: link status definitely up for interface eth0, 1000 Mbps full duplex.&lt;br /&gt;
Dec 13 14:22:33 an-node01 kernel: bonding: bond0: making interface eth0 the new active one.&lt;br /&gt;
Dec 13 14:22:34 an-node01 kernel: bond1: link status definitely up for interface eth1, 1000 Mbps full duplex.&lt;br /&gt;
Dec 13 14:22:34 an-node01 kernel: bonding: bond1: making interface eth1 the new active one.&lt;br /&gt;
Dec 13 14:22:35 an-node01 kernel: bond2: link status definitely up for interface eth2, 1000 Mbps full duplex.&lt;br /&gt;
Dec 13 14:22:35 an-node01 kernel: bonding: bond2: making interface eth2 the new active one.&lt;br /&gt;
Dec 13 14:22:35 an-node01 kernel: device eth5 left promiscuous mode&lt;br /&gt;
Dec 13 14:22:35 an-node01 kernel: device eth2 entered promiscuous mode&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Complete success!&lt;br /&gt;
&lt;br /&gt;
{{warning|1=It is worth restating the importance of spreading your two fence methods across two switches. If both your PDU(s) and you IPMI (or iLO, etc) interfaces all run through one switch, that switch becomes a single point of failure. Generally, I run the IPMI/iLO/etc fence devices on the primary switch and the PDU(s) on the secondary switch.}}&lt;br /&gt;
&lt;br /&gt;
=== Failing The Secondary Switch ===&lt;br /&gt;
&lt;br /&gt;
Before we can say that everything is perfect, we need to test failing and recovering the secondary switch. The main purpose of this test is to ensure that there are no problems caused when the secondary switch restarts.&lt;br /&gt;
&lt;br /&gt;
To fail the switch, as we did with the primary switch, simply cut its power. We should see the following in both node&#039;s syslog;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Dec 13 14:30:57 an-node01 kernel: e1000e: eth3 NIC Link is Down&lt;br /&gt;
Dec 13 14:30:57 an-node01 kernel: bonding: bond0: link status definitely down for interface eth3, disabling it&lt;br /&gt;
Dec 13 14:30:58 an-node01 kernel: e1000e: eth4 NIC Link is Down&lt;br /&gt;
Dec 13 14:30:58 an-node01 kernel: e1000e: eth5 NIC Link is Down&lt;br /&gt;
Dec 13 14:30:58 an-node01 kernel: bonding: bond1: link status definitely down for interface eth4, disabling it&lt;br /&gt;
Dec 13 14:30:58 an-node01 kernel: bonding: bond2: link status definitely down for interface eth5, disabling it&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Let&#039;s take a look at &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;bond0&amp;lt;/span&amp;gt; status file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cat /proc/net/bonding/bond0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Ethernet Channel Bonding Driver: v3.6.0 (September 26, 2009)&lt;br /&gt;
&lt;br /&gt;
Bonding Mode: fault-tolerance (active-backup)&lt;br /&gt;
Primary Slave: eth0 (primary_reselect always)&lt;br /&gt;
Currently Active Slave: eth0&lt;br /&gt;
MII Status: up&lt;br /&gt;
MII Polling Interval (ms): 100&lt;br /&gt;
Up Delay (ms): 120000&lt;br /&gt;
Down Delay (ms): 0&lt;br /&gt;
&lt;br /&gt;
Slave Interface: eth0&lt;br /&gt;
MII Status: up&lt;br /&gt;
Link Failure Count: 3&lt;br /&gt;
Permanent HW addr: 00:e0:81:c7:ec:49&lt;br /&gt;
Slave queue ID: 0&lt;br /&gt;
&lt;br /&gt;
Slave Interface: eth3&lt;br /&gt;
MII Status: down&lt;br /&gt;
Link Failure Count: 3&lt;br /&gt;
Permanent HW addr: 00:1b:21:9d:59:fc&lt;br /&gt;
Slave queue ID: 0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth3&amp;lt;/span&amp;gt; interface is shown as &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;down&amp;lt;/span&amp;gt;. There should have been no dropped packets in the ping-flood window at all.&lt;br /&gt;
&lt;br /&gt;
=== Restoring The Second Switch ===&lt;br /&gt;
&lt;br /&gt;
When the power is restored to the switch, we&#039;ll see the same &amp;quot;bouncing&amp;quot; as the switch goes through its startup process. Notice that the backup link also remains listed as &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;down&amp;lt;/span&amp;gt; for 2 minutes, despite the interface not being used by the bonded interface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Dec 13 14:33:36 an-node01 kernel: e1000e: eth4 NIC Link is Up 1000 Mbps Full Duplex, Flow Control: Rx/Tx&lt;br /&gt;
Dec 13 14:33:36 an-node01 kernel: e1000e: eth5 NIC Link is Up 1000 Mbps Full Duplex, Flow Control: Rx/Tx&lt;br /&gt;
Dec 13 14:33:36 an-node01 kernel: bonding: bond1: link status up for interface eth4, enabling it in 120000 ms.&lt;br /&gt;
Dec 13 14:33:36 an-node01 kernel: bonding: bond2: link status up for interface eth5, enabling it in 120000 ms.&lt;br /&gt;
Dec 13 14:33:37 an-node01 kernel: e1000e: eth3 NIC Link is Up 1000 Mbps Full Duplex, Flow Control: Rx/Tx&lt;br /&gt;
Dec 13 14:33:37 an-node01 kernel: bonding: bond0: link status up for interface eth3, enabling it in 120000 ms.&lt;br /&gt;
Dec 13 14:34:34 an-node01 kernel: e1000e: eth5 NIC Link is Down&lt;br /&gt;
Dec 13 14:34:34 an-node01 kernel: bonding: bond2: link status down again after 58000 ms for interface eth5.&lt;br /&gt;
Dec 13 14:34:36 an-node01 kernel: e1000e: eth5 NIC Link is Up 1000 Mbps Full Duplex, Flow Control: Rx/Tx&lt;br /&gt;
Dec 13 14:34:36 an-node01 kernel: bonding: bond2: link status up for interface eth5, enabling it in 120000 ms.&lt;br /&gt;
Dec 13 14:34:38 an-node01 kernel: e1000e: eth5 NIC Link is Down&lt;br /&gt;
Dec 13 14:34:38 an-node01 kernel: bonding: bond2: link status down again after 2000 ms for interface eth5.&lt;br /&gt;
Dec 13 14:34:40 an-node01 kernel: e1000e: eth5 NIC Link is Up 1000 Mbps Full Duplex, Flow Control: None&lt;br /&gt;
Dec 13 14:34:40 an-node01 kernel: bonding: bond2: link status up for interface eth5, enabling it in 120000 ms.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After two minutes from the last bound, we&#039;ll see the backup interfaces return to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;up&amp;lt;/span&amp;gt; state in the bond&#039;s status file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Dec 13 14:35:36 an-node01 kernel: bond1: link status definitely up for interface eth4, 1000 Mbps full duplex.&lt;br /&gt;
Dec 13 14:35:37 an-node01 kernel: bond0: link status definitely up for interface eth3, 1000 Mbps full duplex.&lt;br /&gt;
Dec 13 14:36:40 an-node01 kernel: bond2: link status definitely up for interface eth5, 1000 Mbps full duplex.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After a full five minutes, the cluster and the network remain stable. We can officially declare our network to be fully highly available!&lt;br /&gt;
&lt;br /&gt;
= Installing DRBD =&lt;br /&gt;
&lt;br /&gt;
DRBD is an open-source application for real-time, block-level disk replication created and maintained by [http://linbit.com Linbit]. We will use this to keep the data on our cluster consistent between the two nodes.&lt;br /&gt;
&lt;br /&gt;
To install it, we have three choices;&lt;br /&gt;
# Purchase a Red Hat blessed, fully supported copy from [http://linbit.com Linbit].&lt;br /&gt;
# Install from the freely available, community maintained [http://elrepo.org/tiki/tiki-index.php ELRepo] repository.&lt;br /&gt;
# Install from source files.&lt;br /&gt;
&lt;br /&gt;
We will be using the 8.3.x version of DRBD. This tracts the Red Hat and Linbit supported versions, providing the most tested combination and providing a painless path to move to a fully supported version, should you decide to do so down the road.&lt;br /&gt;
&lt;br /&gt;
== Option 1 - Fully Supported by Red Hat and Linbit ==&lt;br /&gt;
&lt;br /&gt;
Red Hat decided to no longer directly support [[DRBD]] in [[EL6]] to narrow down what applications they shipped and focus on improving those components. Given the popularity of DRBD, however, Red Hat struck a deal with [[Linbit]], the authors and maintainers of DRBD. You have the option of purchasing a fully supported version of DRBD that is blessed by Red Hat for use under Red Hat Enterprise Linux 6.&lt;br /&gt;
&lt;br /&gt;
If you are building a fully supported cluster, please [http://www.linbit.com/en/products-services/drbd/drbd-for-high-availability/ contact Linbit] to purchase DRBD. Once done, you will get an email with you login information and, most importantly here, the [[URL]] hash needed to access the official repositories.&lt;br /&gt;
&lt;br /&gt;
First you will need to add an entry in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/yum.repo.d/&amp;lt;/span&amp;gt; for DRBD, but this needs to be hand-crafted as you must specify the URL hash given to you in the email as part of the repo configuration.&lt;br /&gt;
&lt;br /&gt;
* Log into the [https://my.linbit.com Linbit portal].&lt;br /&gt;
* Click on &#039;&#039;Account&#039;&#039;.&lt;br /&gt;
* Under &#039;&#039;Your account details&#039;&#039;, click on the hash string to the right of &#039;&#039;URL hash:&#039;&#039;.&lt;br /&gt;
* Click on &#039;&#039;RHEL 6&#039;&#039; (even if you are using CentOS or another [[EL6]] distro.&lt;br /&gt;
&lt;br /&gt;
This will take you to a new page called &#039;&#039;Instructions for using the DRBD package repository&#039;&#039;. The details installation instruction are found here.&lt;br /&gt;
&lt;br /&gt;
Lets use the imaginative URL hash of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;abcdefghijklmnopqrstuvwxyz0123456789ABCD&amp;lt;/span&amp;gt; and we&#039;re are in fact using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;x86_64&amp;lt;/span&amp;gt; architecture. Given this, we would create the following repository configuration file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/yum.repos.d/linbit.repo&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
[drbd-8]&lt;br /&gt;
name=DRBD 8&lt;br /&gt;
baseurl=http://packages.linbit.com/abcdefghijklmnopqrstuvwxyz0123456789ABCD/rhel6/x86_64&lt;br /&gt;
gpgcheck=0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once this is saved, you can install DRBD using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;yum&amp;lt;/span&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install drbd kmod-drbd&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Done!&lt;br /&gt;
&lt;br /&gt;
== Option 2 - Install From ELRepo ==&lt;br /&gt;
&lt;br /&gt;
[http://elrepo.org ELRepo] is a community-maintained repository of packages for &#039;&#039;&#039;E&#039;&#039;&#039;nterprise &#039;&#039;&#039;L&#039;&#039;&#039;inux; Red Hat Enterprise Linux and its derivatives like CentOS. This is the easiest option for a freely available DRBD package.&lt;br /&gt;
&lt;br /&gt;
The main concern with this option is that you are seceding control of DRBD to a community-controlled project. This is a trusted repo, but there are still undeniable security concerns. &lt;br /&gt;
&lt;br /&gt;
Check for the latest installation RPM and information;&lt;br /&gt;
* [http://elrepo.org ELRepo Installation Page]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# Install the ELRepo GPG key, add the repo and install DRBD.&lt;br /&gt;
rpm --import http://elrepo.org/RPM-GPG-KEY-elrepo.org&lt;br /&gt;
rpm -Uvh http://elrepo.org/elrepo-release-6-4.el6.elrepo.noarch.rpm&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Retrieving http://elrepo.org/elrepo-release-6-4.el6.elrepo.noarch.rpm&lt;br /&gt;
Preparing...                ########################################### [100%]&lt;br /&gt;
   1:elrepo-release         ########################################### [100%]&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;
yum install drbd83-utils kmod-drbd83&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is the method used for this tutorial.&lt;br /&gt;
&lt;br /&gt;
== Option 3 - Install From Source ==&lt;br /&gt;
&lt;br /&gt;
If you do not wish to pay for access to the official DRBD repository and do not feel comfortable adding a public repository, your last option is to install from Linbit&#039;s source code. The benefit of this is that you can vet the source before installing it, making it a more secure option. The downside is that you will need to manually install updates and security fixes as they are made available.&lt;br /&gt;
&lt;br /&gt;
On &#039;&#039;&#039;Both&#039;&#039;&#039; nodes run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# Download, compile and install DRBD&lt;br /&gt;
yum install flex gcc make kernel-devel&lt;br /&gt;
wget -c http://oss.linbit.com/drbd/8.3/drbd-8.3.12.tar.gz&lt;br /&gt;
tar -xvzf drbd-8.3.12.tar.gz&lt;br /&gt;
cd drbd-8.3.12&lt;br /&gt;
./configure \&lt;br /&gt;
   --prefix=/usr \&lt;br /&gt;
   --localstatedir=/var \&lt;br /&gt;
   --sysconfdir=/etc \&lt;br /&gt;
   --with-utils \&lt;br /&gt;
   --with-km \&lt;br /&gt;
   --with-udev \&lt;br /&gt;
   --with-pacemaker \&lt;br /&gt;
   --with-rgmanager \&lt;br /&gt;
   --with-bashcompletion&lt;br /&gt;
make&lt;br /&gt;
make install&lt;br /&gt;
chkconfig --add drbd&lt;br /&gt;
chkconfig drbd off&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Hooking DRBD Into The Cluster&#039;s Fencing ===&lt;br /&gt;
&lt;br /&gt;
{{warning|1=This script has no delay built into it. In many cases, if the link between the DRBD resources fail, both nodes may fence simultaneously causing both nodes to shut down. If you add &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;sleep 10;&amp;lt;/span&amp;gt; to &#039;&#039;&#039;one&#039;&#039;&#039; of the nodes, then you can ensure that dual-fencing won&#039;t occur.}}&lt;br /&gt;
&lt;br /&gt;
We will use a script, written by [http://lon.fedorapeople.org/ Lon Hohberger] of Red Hat. This script will capture fence calls from DRBD and in turn calls the cluster&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fence_node&amp;lt;/span&amp;gt; against the opposing node. It this way, DRBD will avoid split-brain without the need to maintain two separate fence configurations.&lt;br /&gt;
&lt;br /&gt;
On &#039;&#039;&#039;Both&#039;&#039;&#039; nodes run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# Obliterate peer - fence via cman&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;
-rwxr-xr-x 1 root root 2.1K May  4  2011 /sbin/obliterate-peer.sh&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We&#039;ll configure DRBD to use this script shortly.&lt;br /&gt;
&lt;br /&gt;
==== Alternate Fence Handler; rhcs_fence ====&lt;br /&gt;
&lt;br /&gt;
{{note|1=Caveat: The author of this tutorial is also the author of this script.}}&lt;br /&gt;
&lt;br /&gt;
A new fence handler which ties DRBD into RHCS is now available called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rhcs_fence&amp;lt;/span&amp;gt; with the goal of replacing &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;obliterate-peer.sh&amp;lt;/span&amp;gt;. It aims to extend Lon&#039;s script, which hasn&#039;t been actively developed in some time.&lt;br /&gt;
&lt;br /&gt;
This agent has had minimal testing, so please test thoroughly when using it. &lt;br /&gt;
&lt;br /&gt;
This agent addresses the simultaneous fencing issue by automatically adding a delay to the fence call based on the host node&#039;s ID number, with the node having ID of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt; having no delay at all. It is also a little more elegant about how it handles the actual fence call with the goal of being more reliable when a fence action takes longer than usual to complete.&lt;br /&gt;
&lt;br /&gt;
To install it, run the following on both nodes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
wget -c https://raw.github.com/digimer/rhcs_fence/master/rhcs_fence &lt;br /&gt;
chmod 755 rhcs_fence&lt;br /&gt;
mv rhcs_fence /usr/sbin/&lt;br /&gt;
ls -lah /usr/sbin/rhcs_fence &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
-rwxr-xr-x 1 root root 15K Jan 24 22:04 /usr/sbin/rhcs_fence&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== The &amp;quot;Why&amp;quot; of Our Layout ===&lt;br /&gt;
&lt;br /&gt;
We will be creating three separate DRBD resources. The reason for this is to minimize the chance of data loss in a [[split-brain]] event. &lt;br /&gt;
&lt;br /&gt;
We&#039;re going to take steps to ensure that a [[split-brain]] is exceedingly unlikely, but we always have to plan for the worst case scenario. The biggest concern with recovering from a split-brain is that, by necessity, one of the nodes will lose data. Further, there is no way to automate the recovery, as there is no clear way for DRBD to tell which node has the more valuable data.&lt;br /&gt;
&lt;br /&gt;
Consider this scenario;&lt;br /&gt;
* You have a two-node cluster running two VMs. One is a mirror for a project and the other is an accounting application. Node 1 hosts the mirror, Node 2 hosts the accounting application.&lt;br /&gt;
* A partition occurs and both nodes try to fence the other.&lt;br /&gt;
* Network access is lost, so both nodes fall back to fencing using PDUs.&lt;br /&gt;
* Both nodes have redundant power supplies, and at some point in time, the power cables on the second PDU got reversed.&lt;br /&gt;
* The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fence_apc_snmp&amp;lt;/span&amp;gt; agent succeeds, because the requested outlets were shut off. However, do to the cabling mistake, neither node actually shut down.&lt;br /&gt;
* Both nodes proceed to run independently, thinking they are the only node left.&lt;br /&gt;
* During this split-brain, the mirror VM downloads over a [[gigabyte]] of updates. Meanwhile, an hour earlier, the accountant updates the books, totalling less than one [[megabyte]] of changes.&lt;br /&gt;
&lt;br /&gt;
At this point, you will need to discard the changed on one of the nodes. So now you have to choose;&lt;br /&gt;
* Is the node with the most changes more valid?&lt;br /&gt;
* Is the node with the most recent changes more valid?&lt;br /&gt;
&lt;br /&gt;
Neither of these are true, as the node with the older data and smallest amount of changed data is the accounting data which is significantly more valuable.&lt;br /&gt;
&lt;br /&gt;
Now imagine that both VMs have equally valuable data. What then? Which side do you discard?&lt;br /&gt;
&lt;br /&gt;
The approach we will use is to create two separate DRBD resources. Then we will assign the VMs into two groups; VMs normally designed to run on one node will go one one resource while the VMs designed to normally run on the other resource will share the second resource. &lt;br /&gt;
&lt;br /&gt;
With all the VMs on a given resource running on the same DRBD resource, we can fairly easily decide which node to discard changes on, on a per-resource level.&lt;br /&gt;
&lt;br /&gt;
To summarize, we&#039;re going to create the following three resources;&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;r0&amp;lt;/span&amp;gt;; A small resource for the shared files formatted with [[GFS2]].&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;r1&amp;lt;/span&amp;gt;; This resource will back the VMs designed to primarily run on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;r2&amp;lt;/span&amp;gt;; This resource will back the VMs designed to primarily run on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Creating The Partitions For DRBD ==&lt;br /&gt;
&lt;br /&gt;
It is possible to use [[LVM]] on the hosts, and simply create [[LV]]s to back our DRBD resources. However, this causes confusion as LVM will see the [[PV]] signatures on both the DRBD backing devices and the DRBD device itself. Getting around this requires editing LVM&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;filter&amp;lt;/span&amp;gt; option, which is somewhat complicated. Not overly so, mind you, but enough to be outside the scope of this document. &lt;br /&gt;
&lt;br /&gt;
Also, by working with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fdisk&amp;lt;/span&amp;gt; directly, it will give us a chance to make sure that the DRBD partitions start on an even 64 [[KiB]] boundry. This is important for decent performance on Windows VMs, as we will see later. This is true for both traditional platter and modern solid-state drives.&lt;br /&gt;
&lt;br /&gt;
On our nodes, we created three primary disk partitions;&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/sda1&amp;lt;/span&amp;gt;; The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/boot&amp;lt;/span&amp;gt; partition.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/sda2&amp;lt;/span&amp;gt;; The root &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/&amp;lt;/span&amp;gt; partition.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/sda3&amp;lt;/span&amp;gt;; The swap partition.&lt;br /&gt;
&lt;br /&gt;
We will create a new extended partition. Then within it we will create three new partitions;&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/sda5&amp;lt;/span&amp;gt;; a small partition we will later use for our shared [[GFS2]] partition.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/sda6&amp;lt;/span&amp;gt;; a partition big enough to host the VMs that will normally run on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&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;; a partition big enough to host the VMs that will normally run on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
As we create each partition, we will do a little math to ensure that the start sector is on a 64 [[KiB]] boundry.&lt;br /&gt;
&lt;br /&gt;
=== Block Alignment ===&lt;br /&gt;
&lt;br /&gt;
For performance reasons, we want to ensure that the file systems created within a VM matches the block alignment of the underlying storage stack, clear down to the base partitions on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/sda&amp;lt;/span&amp;gt; (or what ever your lowest-level block device is).&lt;br /&gt;
&lt;br /&gt;
Imagine this misaligned scenario;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Note: Not to scale&lt;br /&gt;
                 ________________________________________________________________&lt;br /&gt;
VM File system  |~~~~~|_______|_______|_______|_______|_______|_______|_______|__&lt;br /&gt;
                |~~~~~|==========================================================&lt;br /&gt;
DRBD Partition  |~~~~~|_______|_______|_______|_______|_______|_______|_______|__&lt;br /&gt;
64 KiB block    |_______|_______|_______|_______|_______|_______|_______|_______|&lt;br /&gt;
512byte sectors |_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now, when the guest wants to write one block worth of data, it actually causes two blocks to be written, causing avoidable disk I/O.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Note: Not to scale&lt;br /&gt;
                 ________________________________________________________________&lt;br /&gt;
VM File system  |~~~~~~~|_______|_______|_______|_______|_______|_______|_______|&lt;br /&gt;
                |~~~~~~~|========================================================&lt;br /&gt;
DRBD Partition  |~~~~~~~|_______|_______|_______|_______|_______|_______|_______|&lt;br /&gt;
64 KiB block    |_______|_______|_______|_______|_______|_______|_______|_______|&lt;br /&gt;
512byte sectors |_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
By changing the start cylinder of our partitions to always start on 64 [[KiB]] boundaries, we&#039;re sure to keep the guest OS&#039;s file system in-line with the DRBD backing device&#039;s blocks. Thus, all reads and writes in the guest OS effect a matching number of real blocks, maximizing disk I/O efficiency.&lt;br /&gt;
&lt;br /&gt;
Thankfully, as we&#039;ll see in a moment, the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;parted&amp;lt;/span&amp;gt; program has a mode that will tell it to always optimally align partitions, so we won&#039;t need to do any crazy math.&lt;br /&gt;
&lt;br /&gt;
{{note|1=You will want to do this with [[SSD]] drives, too. It&#039;s true that the performance will remain about the same, but SSD drives have a limited number of write cycles, and aligning the blocks will minimize block writes.}}&lt;br /&gt;
&lt;br /&gt;
Special thanks to [http://xen.org/community/spotlight/pasi.html Pasi Kärkkäinen] for his patience in explaining to me the importance of disk alignment. He created two images which I used as templates for the [[ASCII]] art images above;&lt;br /&gt;
* [http://pasik.reaktio.net/virtual-disk-partitions-not-aligned.jpg Virtual Disk Partitions, Not aligned.]&lt;br /&gt;
* [http://pasik.reaktio.net/virtual-disk-partitions-aligned.jpg Virtual Disk Partitions, aligned.]&lt;br /&gt;
&lt;br /&gt;
=== Creating the DRBD Partitions ===&lt;br /&gt;
&lt;br /&gt;
Here I will show you the values I entered to create the three partitions I needed on my nodes. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;DO NOT DIRECTLY COPY THIS!&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The values you enter will almost certainly be different.&lt;br /&gt;
&lt;br /&gt;
We&#039;re going to use a program called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;parted&amp;lt;/span&amp;gt; to configure the disk &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/sda&amp;lt;/span&amp;gt;. Pay close attention to the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;-a optimal&amp;lt;/span&amp;gt; switch. This tells &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;parted&amp;lt;/span&amp;gt; to create new partitions with optimal block alignment, which is crucial for virtual machine performance.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
parted -a optimal /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;
GNU Parted 2.1&lt;br /&gt;
Using /dev/sda&lt;br /&gt;
Welcome to GNU Parted! Type &#039;help&#039; to view a list of commands.&lt;br /&gt;
(parted)                                                                  &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We&#039;re now in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;parted&amp;lt;/span&amp;gt; console. Before we start, let&#039;s take a look at the current disk configuration along with the amount of free space available.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
print free&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Model: ATA ST9500420ASG (scsi)&lt;br /&gt;
Disk /dev/sda: 500GB&lt;br /&gt;
Sector size (logical/physical): 512B/512B&lt;br /&gt;
Partition Table: msdos&lt;br /&gt;
&lt;br /&gt;
Number  Start   End     Size    Type     File system     Flags&lt;br /&gt;
        32.3kB  1049kB  1016kB           Free Space&lt;br /&gt;
 1      1049kB  269MB   268MB   primary  ext4            boot&lt;br /&gt;
 2      269MB   43.2GB  42.9GB  primary  ext4&lt;br /&gt;
 3      43.2GB  47.5GB  4295MB  primary  linux-swap(v1)&lt;br /&gt;
        47.5GB  500GB   453GB            Free Space&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Before we can create the three DRBD partition, we first need to create an [[extended partition|extended]] partition wherein which we will create the three [[logical partition|logical]] partitions. From the output above, we can see that the free space starts at &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;47.5GB&amp;lt;/span&amp;gt;, and that the drive ends at &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;500GB&amp;lt;/span&amp;gt;. Knowing this, we can now create the extended partition.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
mkpart extended 47.5GB 500GB&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Warning: WARNING: the kernel failed to re-read the partition table on /dev/sda&lt;br /&gt;
(Device or resource busy).  As a result, it may not reflect all of your changes&lt;br /&gt;
until after reboot.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Don&#039;t worry about that message, we will reboot when we finish.&lt;br /&gt;
&lt;br /&gt;
So now we can confirm that the new extended partition was create by again printing the partition table and the free space.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
print free&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Model: ATA ST9500420ASG (scsi)&lt;br /&gt;
Disk /dev/sda: 500GB&lt;br /&gt;
Sector size (logical/physical): 512B/512B&lt;br /&gt;
Partition Table: msdos&lt;br /&gt;
&lt;br /&gt;
Number  Start   End     Size    Type      File system     Flags&lt;br /&gt;
        32.3kB  1049kB  1016kB            Free Space&lt;br /&gt;
 1      1049kB  269MB   268MB   primary   ext4            boot&lt;br /&gt;
 2      269MB   43.2GB  42.9GB  primary   ext4&lt;br /&gt;
 3      43.2GB  47.5GB  4295MB  primary   linux-swap(v1)&lt;br /&gt;
 4      47.5GB  500GB   453GB   extended                  lba&lt;br /&gt;
        47.5GB  500GB   453GB             Free Space&lt;br /&gt;
        500GB   500GB   24.6kB            Free Space&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Perfect. So now we&#039;re going to create our three logical partitions. We&#039;re going to use the same start position as last time, but the end position will be 20 [[GiB]] further in.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
mkpart logical 47.5GB 67.5GB&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Warning: WARNING: the kernel failed to re-read the partition table on /dev/sda&lt;br /&gt;
(Device or resource busy).  As a result, it may not reflect all of your changes&lt;br /&gt;
until after reboot.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We&#039;ll check again to see the new partition layout.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
print free&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Model: ATA ST9500420ASG (scsi)&lt;br /&gt;
Disk /dev/sda: 500GB&lt;br /&gt;
Sector size (logical/physical): 512B/512B&lt;br /&gt;
Partition Table: msdos&lt;br /&gt;
&lt;br /&gt;
Number  Start   End     Size    Type      File system     Flags&lt;br /&gt;
        32.3kB  1049kB  1016kB            Free Space&lt;br /&gt;
 1      1049kB  269MB   268MB   primary   ext4            boot&lt;br /&gt;
 2      269MB   43.2GB  42.9GB  primary   ext4&lt;br /&gt;
 3      43.2GB  47.5GB  4295MB  primary   linux-swap(v1)&lt;br /&gt;
 4      47.5GB  500GB   453GB   extended                  lba&lt;br /&gt;
 5      47.5GB  67.5GB  20.0GB  logical&lt;br /&gt;
        67.5GB  500GB   433GB             Free Space&lt;br /&gt;
        500GB   500GB   24.6kB            Free Space&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Again, perfect. Now I have a total of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;433[[GB]]&amp;lt;/span&amp;gt; left free. How you carve this up for your VMs will depend entirely on what kind of VMs you plan to install and what their needs are. For me, I will divide the space evenly into to logical partitions of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;216.5GB&amp;lt;/span&amp;gt; (&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;433 / 2 = 216.5)&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The first partition will start at &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;67.5&amp;lt;/span&amp;gt; and end at &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;284GB&amp;lt;/span&amp;gt; (&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;67.5 + 216.5 = 284&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;
mkpart logical 67.5GB 284GB&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Warning: WARNING: the kernel failed to re-read the partition table on /dev/sda&lt;br /&gt;
(Device or resource busy).  As a result, it may not reflect all of your changes&lt;br /&gt;
until after reboot.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once again, lets look at the new partition table.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
print free&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Model: ATA ST9500420ASG (scsi)&lt;br /&gt;
Disk /dev/sda: 500GB&lt;br /&gt;
Sector size (logical/physical): 512B/512B&lt;br /&gt;
Partition Table: msdos&lt;br /&gt;
&lt;br /&gt;
Number  Start   End     Size    Type      File system     Flags&lt;br /&gt;
        32.3kB  1049kB  1016kB            Free Space&lt;br /&gt;
 1      1049kB  269MB   268MB   primary   ext4            boot&lt;br /&gt;
 2      269MB   43.2GB  42.9GB  primary   ext4&lt;br /&gt;
 3      43.2GB  47.5GB  4295MB  primary   linux-swap(v1)&lt;br /&gt;
 4      47.5GB  500GB   453GB   extended                  lba&lt;br /&gt;
 5      47.5GB  67.5GB  20.0GB  logical&lt;br /&gt;
 6      67.5GB  284GB   216GB   logical&lt;br /&gt;
        284GB   500GB   216GB             Free Space&lt;br /&gt;
        500GB   500GB   24.6kB            Free Space&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Finally, our last partition will start at &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;284GB&amp;lt;/span&amp;gt; and use the rest of the free space, ending at &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;500GB&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;
mkpart logical 284GB 500GB&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Warning: WARNING: the kernel failed to re-read the partition table on /dev/sda&lt;br /&gt;
(Device or resource busy).  As a result, it may not reflect all of your changes&lt;br /&gt;
until after reboot.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
One last time, let&#039;s look at the partition table.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
print free&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Model: ATA ST9500420ASG (scsi)&lt;br /&gt;
Disk /dev/sda: 500GB&lt;br /&gt;
Sector size (logical/physical): 512B/512B&lt;br /&gt;
Partition Table: msdos&lt;br /&gt;
&lt;br /&gt;
Number  Start   End     Size    Type      File system     Flags&lt;br /&gt;
        32.3kB  1049kB  1016kB            Free Space&lt;br /&gt;
 1      1049kB  269MB   268MB   primary   ext4            boot&lt;br /&gt;
 2      269MB   43.2GB  42.9GB  primary   ext4&lt;br /&gt;
 3      43.2GB  47.5GB  4295MB  primary   linux-swap(v1)&lt;br /&gt;
 4      47.5GB  500GB   453GB   extended                  lba&lt;br /&gt;
 5      47.5GB  67.5GB  20.0GB  logical&lt;br /&gt;
 6      67.5GB  284GB   216GB   logical&lt;br /&gt;
 7      284GB   500GB   216GB   logical&lt;br /&gt;
        500GB   500GB   24.6kB            Free Space&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Just as we asked for. Before we finish though, let&#039;s be extra careful and do a manual check of our three partitions to ensure that they are, in fact, aligned optimally. There will be no output from the following commands if the partitions are aligned.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
(parted) align-check opt 5&lt;br /&gt;
(parted) align-check opt 6&lt;br /&gt;
(parted) align-check opt 7&lt;br /&gt;
(parted)                                                                  &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Excellent! We can now exit.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
quit&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Information: You may need to update /etc/fstab.                           &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we need to reboot to make the kernel see the new partition table.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
reboot&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Done! Do this for both nodes, then proceed.&lt;br /&gt;
&lt;br /&gt;
== Configuring DRBD ==&lt;br /&gt;
&lt;br /&gt;
DRBD is configured in two parts;&lt;br /&gt;
&lt;br /&gt;
* Global and common configuration options&lt;br /&gt;
* Resource configurations&lt;br /&gt;
&lt;br /&gt;
We will be creating three separate DRBD resources, so we will create three separate resource configuration files. More on that in a moment.&lt;br /&gt;
&lt;br /&gt;
=== Configuring DRBD Global and Common Options ===&lt;br /&gt;
&lt;br /&gt;
The first file to edit is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/drbd.d/global_common.conf&amp;lt;/span&amp;gt;. In this file, we will set global configuration options and set default resource configuration options. These default resource options can be overwritten in the actual resource files which we&#039;ll create once we&#039;re done here.&lt;br /&gt;
&lt;br /&gt;
I&#039;ll explain the values we&#039;re setting here, and we&#039;ll put the explanation of each option in the file itself, as it will be useful to have them should you need to alter the files sometime in the future.&lt;br /&gt;
&lt;br /&gt;
The first addition is in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;handlers { }&amp;lt;/span&amp;gt; directive. We&#039;re going to add the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fence-peer&amp;lt;/span&amp;gt; option and configure it to use the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;obliterate-peer.sh&amp;lt;/span&amp;gt; script we spoke about earlier in the DRBD section.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/drbd.d/global_common.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;
	handlers {&lt;br /&gt;
		# This script is a wrapper for RHCS&#039;s &#039;fence_node&#039; command line&lt;br /&gt;
		# tool. It will call a fence against the other node and return&lt;br /&gt;
		# the appropriate exit code to DRBD.&lt;br /&gt;
		fence-peer		&amp;quot;/sbin/obliterate-peer.sh&amp;quot;;&lt;br /&gt;
	}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{note|1=If you used the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rhcs_fence&amp;lt;/span&amp;gt; handler, use &#039;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fence-peer		&amp;quot;/usr/sbin/rhcs_fence&amp;quot;;&amp;lt;/span&amp;gt;&#039;.}}&lt;br /&gt;
&lt;br /&gt;
We&#039;re going to add three options to the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;startup { }&amp;lt;/span&amp;gt; directive; We&#039;re going to tell DRBD to make both nodes &amp;quot;primary&amp;quot; on start, to wait five minutes on start for its peer to connect and, if the peer never connected last time, to wait onto two minutes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
	startup {&lt;br /&gt;
		# This tells DRBD to promote both nodes to Primary on start.&lt;br /&gt;
		become-primary-on	both;&lt;br /&gt;
&lt;br /&gt;
		# This tells DRBD to wait five minutes for the other node to&lt;br /&gt;
		# connect. This should be longer than it takes for cman to&lt;br /&gt;
		# timeout and fence the other node *plus* the amount of time it&lt;br /&gt;
		# takes the other node to reboot. If you set this too short,&lt;br /&gt;
		# you could corrupt your data. If you want to be extra safe, do&lt;br /&gt;
		# not use this at all and DRBD will wait for the other node&lt;br /&gt;
		# forever.&lt;br /&gt;
		wfc-timeout		300;&lt;br /&gt;
&lt;br /&gt;
		# This tells DRBD to wait for the other node for three minutes&lt;br /&gt;
		# if the other node was degraded the last time it was seen by&lt;br /&gt;
		# this node. This is a way to speed up the boot process when&lt;br /&gt;
		# the other node is out of commission for an extended duration.&lt;br /&gt;
		degr-wfc-timeout	120;&lt;br /&gt;
	}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;disk { }&amp;lt;/span&amp;gt; directive, we&#039;re going to configure DRBD&#039;s behaviour when a [[split-brain]] is detected. By setting &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fencing&amp;lt;/span&amp;gt; to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;resource-and-stonith&amp;lt;/span&amp;gt;, we&#039;re telling DRBD to stop all disk access and call a fence against its peer node rather than proceeding.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
	disk {&lt;br /&gt;
		# This tells DRBD to block IO and fence the remote node (using&lt;br /&gt;
		# the &#039;fence-peer&#039; helper) when connection with the other node&lt;br /&gt;
		# is unexpectedly lost. This is what helps prevent split-brain&lt;br /&gt;
		# condition and it is incredible important in dual-primary&lt;br /&gt;
		# setups!&lt;br /&gt;
		fencing			resource-and-stonith;&lt;br /&gt;
	}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;net { }&amp;lt;/span&amp;gt; directive, we&#039;re going to tell DRBD that it is allowed to run in dual-primary mode and we&#039;re going to configure how it behaves if a split-brain has occurred, despite our best efforts. The recovery (or lack there of) requires three options; What to do when neither node had been primary (&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;after-sb-0pri&amp;lt;/span&amp;gt;), what to do if only one node had been primary (&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;after-sb-1pri&amp;lt;/span&amp;gt;) and finally, what to do if both nodes had been primary (&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;after-sb-2pri&amp;lt;/span&amp;gt;), as will most likely be the case for us. This last instance will be configured to tell DRBD just to drop the connection, which will require human intervention to correct.&lt;br /&gt;
&lt;br /&gt;
At this point, you might be wondering why we won&#039;t simply run Primary/Secondary. The reason is because of live-migration. When we push a VM across to the backup node, there is a short period of time where both nodes need to be writeable. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
	net {&lt;br /&gt;
		# This tells DRBD to allow two nodes to be Primary at the same&lt;br /&gt;
		# time. It is needed when &#039;become-primary-on both&#039; is set.&lt;br /&gt;
		allow-two-primaries;&lt;br /&gt;
&lt;br /&gt;
		# The following three commands tell DRBD how to react should&lt;br /&gt;
		# our best efforts fail and a split brain occurs. You can learn&lt;br /&gt;
		# more about these options by reading the drbd.conf man page.&lt;br /&gt;
		# NOTE! It is not possible to safely recover from a split brain&lt;br /&gt;
		# where both nodes were primary. This care requires human&lt;br /&gt;
		# intervention, so &#039;disconnect&#039; is the only safe policy.&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;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We&#039;ll make our usual backup of the configuration file, add the new sections and then create a diff to see exactly how things have changed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/drbd.d/global_common.conf /etc/drbd.d/global_common.conf.orig&lt;br /&gt;
vim /etc/drbd.d/global_common.conf &lt;br /&gt;
diff -u  /etc/drbd.d/global_common.conf.orig /etc/drbd.d/global_common.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/drbd.d/global_common.conf.orig	2011-12-13 22:22:30.916128360 -0500&lt;br /&gt;
+++ /etc/drbd.d/global_common.conf	2011-12-13 22:26:30.733379609 -0500&lt;br /&gt;
@@ -14,22 +14,67 @@&lt;br /&gt;
 		# split-brain &amp;quot;/usr/lib/drbd/notify-split-brain.sh root&amp;quot;;&lt;br /&gt;
 		# out-of-sync &amp;quot;/usr/lib/drbd/notify-out-of-sync.sh root&amp;quot;;&lt;br /&gt;
 		# before-resync-target &amp;quot;/usr/lib/drbd/snapshot-resync-target-lvm.sh -p 15 -- -c 16k&amp;quot;;&lt;br /&gt;
+&lt;br /&gt;
 		# after-resync-target /usr/lib/drbd/unsnapshot-resync-target-lvm.sh;&lt;br /&gt;
+                # This script is a wrapper for RHCS&#039;s &#039;fence_node&#039; command line&lt;br /&gt;
+                # tool. It will call a fence against the other node and return&lt;br /&gt;
+                # the appropriate exit code to DRBD.&lt;br /&gt;
+                fence-peer              &amp;quot;/sbin/obliterate-peer.sh&amp;quot;;&lt;br /&gt;
 	}&lt;br /&gt;
 &lt;br /&gt;
 	startup {&lt;br /&gt;
 		# wfc-timeout degr-wfc-timeout outdated-wfc-timeout wait-after-sb&lt;br /&gt;
+&lt;br /&gt;
+                # This tells DRBD to promote both nodes to Primary on start.&lt;br /&gt;
+                become-primary-on       both;&lt;br /&gt;
+&lt;br /&gt;
+                # This tells DRBD to wait five minutes for the other node to&lt;br /&gt;
+                # connect. This should be longer than it takes for cman to&lt;br /&gt;
+                # timeout and fence the other node *plus* the amount of time it&lt;br /&gt;
+                # takes the other node to reboot. If you set this too short,&lt;br /&gt;
+                # you could corrupt your data. If you want to be extra safe, do&lt;br /&gt;
+                # not use this at all and DRBD will wait for the other node&lt;br /&gt;
+                # forever.&lt;br /&gt;
+                wfc-timeout             300;&lt;br /&gt;
+&lt;br /&gt;
+                # This tells DRBD to wait for the other node for three minutes&lt;br /&gt;
+                # if the other node was degraded the last time it was seen by&lt;br /&gt;
+                # this node. This is a way to speed up the boot process when&lt;br /&gt;
+                # the other node is out of commission for an extended duration.&lt;br /&gt;
+                degr-wfc-timeout        120;&lt;br /&gt;
 	}&lt;br /&gt;
 &lt;br /&gt;
 	disk {&lt;br /&gt;
 		# on-io-error fencing use-bmbv no-disk-barrier no-disk-flushes&lt;br /&gt;
 		# no-disk-drain no-md-flushes max-bio-bvecs&lt;br /&gt;
+&lt;br /&gt;
+                # This tells DRBD to block IO and fence the remote node (using&lt;br /&gt;
+                # the &#039;fence-peer&#039; helper) when connection with the other node&lt;br /&gt;
+                # is unexpectedly lost. This is what helps prevent split-brain&lt;br /&gt;
+                # condition and it is incredible important in dual-primary&lt;br /&gt;
+                # setups!&lt;br /&gt;
+                fencing                 resource-and-stonith;&lt;br /&gt;
 	}&lt;br /&gt;
 &lt;br /&gt;
 	net {&lt;br /&gt;
 		# sndbuf-size rcvbuf-size timeout connect-int ping-int ping-timeout max-buffers&lt;br /&gt;
 		# max-epoch-size ko-count allow-two-primaries cram-hmac-alg shared-secret&lt;br /&gt;
 		# after-sb-0pri after-sb-1pri after-sb-2pri data-integrity-alg no-tcp-cork&lt;br /&gt;
+&lt;br /&gt;
+&lt;br /&gt;
+                # This tells DRBD to allow two nodes to be Primary at the same&lt;br /&gt;
+                # time. It is needed when &#039;become-primary-on both&#039; is set.&lt;br /&gt;
+                allow-two-primaries;&lt;br /&gt;
+&lt;br /&gt;
+                # The following three commands tell DRBD how to react should&lt;br /&gt;
+                # our best efforts fail and a split brain occurs. You can learn&lt;br /&gt;
+                # more about these options by reading the drbd.conf man page.&lt;br /&gt;
+                # NOTE! It is not possible to safely recover from a split brain&lt;br /&gt;
+                # where both nodes were primary. This care requires human&lt;br /&gt;
+                # intervention, so &#039;disconnect&#039; is the only safe policy.&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;
 &lt;br /&gt;
 	syncer {&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Configuring the DRBD Resources ===&lt;br /&gt;
&lt;br /&gt;
As mentioned earlier, we are going to create three DRBD resources.&lt;br /&gt;
&lt;br /&gt;
* Resource &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;r0&amp;lt;/span&amp;gt;, which will be device &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/drbd0&amp;lt;/span&amp;gt;, will be the shared GFS2 partition.&lt;br /&gt;
* Resource &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;r1&amp;lt;/span&amp;gt;, which will be device &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/drbd1&amp;lt;/span&amp;gt;, will provide disk space for VMs that will normally run on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;.&lt;br /&gt;
* Resource &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;r2&amp;lt;/span&amp;gt;, which will be device &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/drbd2&amp;lt;/span&amp;gt;, will provide disk space for VMs that will normally run on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
{{note|1=The reason for the two separate VM resources is to help protect against data loss in the off chance that a [[split-brain]] occurs, despite our counter-measures. As we will see later, recovering from a split brain requires discarding the changes on one side of the resource. If VMs are running on the same resource but on different nodes, this would lead to data loss. Using two resources helps prevent that scenario.}}&lt;br /&gt;
&lt;br /&gt;
Each resource configuration will be in its own file saved as &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/drbd.d/rX.res&amp;lt;/span&amp;gt;. The three of them will be pretty much the same. So let&#039;s take a look at the first GFS2 resource &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;r0.res&amp;lt;/span&amp;gt;, then we&#039;ll just look at the changes for &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;r1.res&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;r2.res&amp;lt;/span&amp;gt;. These files won&#039;t exist initially.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/drbd.d/r0.res&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
# This is the resource used for the shared GFS2 partition.&lt;br /&gt;
resource r0 {&lt;br /&gt;
	# This is the block device path.&lt;br /&gt;
	device		/dev/drbd0;&lt;br /&gt;
&lt;br /&gt;
	# We&#039;ll use the normal internal metadisk (takes about 32MB/TB)&lt;br /&gt;
	meta-disk	internal;&lt;br /&gt;
&lt;br /&gt;
	# This is the `uname -n` of the first node&lt;br /&gt;
	on an-node01.alteeve.com {&lt;br /&gt;
		# The &#039;address&#039; has to be the IP, not a hostname. This is the&lt;br /&gt;
		# node&#039;s SN (bond1) IP. The port number must be unique amoung&lt;br /&gt;
		# resources.&lt;br /&gt;
		address		10.10.0.1:7788;&lt;br /&gt;
&lt;br /&gt;
		# This is the block device backing this resource on this node.&lt;br /&gt;
		disk		/dev/sda5;&lt;br /&gt;
	}&lt;br /&gt;
	# Now the same information again for the second node.&lt;br /&gt;
	on an-node02.alteeve.com {&lt;br /&gt;
		address		10.10.0.2:7788;&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;
Now copy this to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;r1.res&amp;lt;/span&amp;gt; and edit for the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt; VM resource. The main differences are the resource name, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;r1&amp;lt;/span&amp;gt;, the block device, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/drbd1&amp;lt;/span&amp;gt;, the port, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;7790&amp;lt;/span&amp;gt; and the backing block devices, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/sda6&amp;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/drbd.d/r0.res /etc/drbd.d/r1.res&lt;br /&gt;
vim /etc/drbd.d/r1.res&lt;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 is the resource used for VMs that will normally run on an-node01.&lt;br /&gt;
resource r1 {&lt;br /&gt;
	# This is the block device path.&lt;br /&gt;
	device		/dev/drbd1;&lt;br /&gt;
&lt;br /&gt;
	# We&#039;ll use the normal internal metadisk (takes about 32MB/TB)&lt;br /&gt;
	meta-disk	internal;&lt;br /&gt;
&lt;br /&gt;
	# This is the `uname -n` of the first node&lt;br /&gt;
	on an-node01.alteeve.com {&lt;br /&gt;
		# The &#039;address&#039; has to be the IP, not a hostname. This is the&lt;br /&gt;
		# node&#039;s SN (bond1) IP. The port number must be unique amoung&lt;br /&gt;
		# resources.&lt;br /&gt;
		address		10.10.0.1:7789;&lt;br /&gt;
&lt;br /&gt;
		# This is the block device backing this resource on this node.&lt;br /&gt;
		disk		/dev/sda6;&lt;br /&gt;
	}&lt;br /&gt;
	# Now the same information again for the second node.&lt;br /&gt;
	on an-node02.alteeve.com {&lt;br /&gt;
		address		10.10.0.2:7789;&lt;br /&gt;
		disk		/dev/sda6;&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The last resource is again the same, with the same set of changes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/drbd.d/r1.res /etc/drbd.d/r2.res&lt;br /&gt;
vim /etc/drbd.d/r2.res&lt;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 is the resource used for VMs that will normally run on an-node02.&lt;br /&gt;
resource r2 {&lt;br /&gt;
	# This is the block device path.&lt;br /&gt;
	device		/dev/drbd2;&lt;br /&gt;
&lt;br /&gt;
	# We&#039;ll use the normal internal metadisk (takes about 32MB/TB)&lt;br /&gt;
	meta-disk	internal;&lt;br /&gt;
&lt;br /&gt;
	# This is the `uname -n` of the first node&lt;br /&gt;
	on an-node01.alteeve.com {&lt;br /&gt;
		# The &#039;address&#039; has to be the IP, not a hostname. This is the&lt;br /&gt;
		# node&#039;s SN (bond1) IP. The port number must be unique amoung&lt;br /&gt;
		# resources.&lt;br /&gt;
		address		10.10.0.1:7790;&lt;br /&gt;
&lt;br /&gt;
		# This is the block device backing this resource on this node.&lt;br /&gt;
		disk		/dev/sda7;&lt;br /&gt;
	}&lt;br /&gt;
	# Now the same information again for the second node.&lt;br /&gt;
	on an-node02.alteeve.com {&lt;br /&gt;
		address		10.10.0.2:7790;&lt;br /&gt;
		disk		/dev/sda7;&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The final step is to validate the configuration. This is done by running the following command;&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;
# /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;
    startup {&lt;br /&gt;
        wfc-timeout      300;&lt;br /&gt;
        degr-wfc-timeout 120;&lt;br /&gt;
        become-primary-on both;&lt;br /&gt;
    }&lt;br /&gt;
    handlers {&lt;br /&gt;
        pri-on-incon-degr &amp;quot;/usr/lib/drbd/notify-pri-on-incon-degr.sh; /usr/lib/drbd/notify-emergency-reboot.sh; echo b &amp;gt; /proc/sysrq-trigger ; reboot -f&amp;quot;;&lt;br /&gt;
        pri-lost-after-sb &amp;quot;/usr/lib/drbd/notify-pri-lost-after-sb.sh; /usr/lib/drbd/notify-emergency-reboot.sh; echo b &amp;gt; /proc/sysrq-trigger ; reboot -f&amp;quot;;&lt;br /&gt;
        local-io-error   &amp;quot;/usr/lib/drbd/notify-io-error.sh; /usr/lib/drbd/notify-emergency-shutdown.sh; echo o &amp;gt; /proc/sysrq-trigger ; halt -f&amp;quot;;&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-node01.alteeve.com: not ignored, not stacked&lt;br /&gt;
resource r0 {&lt;br /&gt;
    on an-node01.alteeve.com {&lt;br /&gt;
        device           /dev/drbd0 minor 0;&lt;br /&gt;
        disk             /dev/sda5;&lt;br /&gt;
        address          ipv4 10.10.0.1:7788;&lt;br /&gt;
        meta-disk        internal;&lt;br /&gt;
    }&lt;br /&gt;
    on an-node02.alteeve.com {&lt;br /&gt;
        device           /dev/drbd0 minor 0;&lt;br /&gt;
        disk             /dev/sda5;&lt;br /&gt;
        address          ipv4 10.10.0.2:7788;&lt;br /&gt;
        meta-disk        internal;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
# resource r1 on an-node01.alteeve.com: not ignored, not stacked&lt;br /&gt;
resource r1 {&lt;br /&gt;
    on an-node01.alteeve.com {&lt;br /&gt;
        device           /dev/drbd1 minor 1;&lt;br /&gt;
        disk             /dev/sda6;&lt;br /&gt;
        address          ipv4 10.10.0.1:7789;&lt;br /&gt;
        meta-disk        internal;&lt;br /&gt;
    }&lt;br /&gt;
    on an-node02.alteeve.com {&lt;br /&gt;
        device           /dev/drbd1 minor 1;&lt;br /&gt;
        disk             /dev/sda6;&lt;br /&gt;
        address          ipv4 10.10.0.2:7789;&lt;br /&gt;
        meta-disk        internal;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
# resource r2 on an-node01.alteeve.com: not ignored, not stacked&lt;br /&gt;
resource r2 {&lt;br /&gt;
    on an-node01.alteeve.com {&lt;br /&gt;
        device           /dev/drbd2 minor 2;&lt;br /&gt;
        disk             /dev/sda7;&lt;br /&gt;
        address          ipv4 10.10.0.1:7790;&lt;br /&gt;
        meta-disk        internal;&lt;br /&gt;
    }&lt;br /&gt;
    on an-node02.alteeve.com {&lt;br /&gt;
        device           /dev/drbd2 minor 2;&lt;br /&gt;
        disk             /dev/sda7;&lt;br /&gt;
        address          ipv4 10.10.0.2:7790;&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;
You&#039;ll note that the output is formatted differently from the configuration files we created, but the values themselves are the same. If there had of been errors, you would have seen them printed. Fix any problems before proceeding. Once you get a clean dump, copy the configuration over to the other node.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
rsync -av /etc/drbd.d root@an-node02:/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;
sending incremental file list&lt;br /&gt;
drbd.d/&lt;br /&gt;
drbd.d/global_common.conf&lt;br /&gt;
drbd.d/global_common.conf.orig&lt;br /&gt;
drbd.d/r0.res&lt;br /&gt;
drbd.d/r1.res&lt;br /&gt;
drbd.d/r2.res&lt;br /&gt;
&lt;br /&gt;
sent 7534 bytes  received 129 bytes  5108.67 bytes/sec&lt;br /&gt;
total size is 7874  speedup is 1.03&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Initializing The DRBD Resources ==&lt;br /&gt;
&lt;br /&gt;
Now that we have DRBD configured, we need to initialize the DRBD backing devices and then bring up the resources for the first time.&lt;br /&gt;
&lt;br /&gt;
{{note|1=To save a bit of time and typing, the following sections will use a little &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;bash&amp;lt;/span&amp;gt; magic. When commands need to be run on all three resources, rather than running the same command three times with the different resource names, we will use the short-hand form &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;r{0,1,2}&amp;lt;/span&amp;gt; or &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;r{0..2}&amp;lt;/span&amp;gt;.}}&lt;br /&gt;
&lt;br /&gt;
On &#039;&#039;&#039;both&#039;&#039;&#039; nodes, create the new [[DRBD metadata|metadata]] on the backing devices. You may need to type &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;yes&amp;lt;/span&amp;gt; to confirm the action if any data is seen. If DRBD sees an actual file system, it will error and insist that you clear the partition. You can do this by running; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;dd if=/dev/zero of=/dev/sdaX bs=4M&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 partition you want to clear. This is called &amp;quot;zeroing out&amp;quot; a partition. The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;dd&amp;lt;/span&amp;gt; program does not print its progress, and can take a long time. To check the progress, open a new session to the server and run &#039;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;kill -USR1 $(pgrep -l &#039;^dd$&#039; | awk &#039;{ print $1 }&#039;)&amp;lt;/span&amp;gt;&#039;.&lt;br /&gt;
&lt;br /&gt;
If DRBD sees old metadata, it will prompt you to type &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;yes&amp;lt;/span&amp;gt; before it will proceed. In my case, I had recently zeroed-out my drive so DRBD had no concerns and just created the metadata for the three resources.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
drbdadm create-md r{0..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;
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;
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;
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;
Before you go any further, we&#039;ll need to load the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;drbd&amp;lt;/span&amp;gt; kernel module. Note that you won&#039;t normally need to do this. Later, after we get everything running the first time, we&#039;ll be able to start and stop the DRBD resources using the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/init.d/drbd&amp;lt;/span&amp;gt; script, which loads and unloads the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;drbd&amp;lt;/span&amp;gt; kernel module as needed.&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;
Now go back to the terminal windows we had used to watch the cluster start. We now want to watch the output of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cat /proc/drbd&amp;lt;/span&amp;gt; so we can keep tabs on the current state of the DRBD resources. We&#039;ll do this by using the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;watch&amp;lt;/span&amp;gt; program, which will refresh the output of the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cat&amp;lt;/span&amp;gt; call every couple of seconds.&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;
version: 8.3.12 (api:88/proto:86-96)&lt;br /&gt;
GIT-hash: e2a8ef4656be026bbae540305fcb998a5991090f build by dag@Build64R6, 2011-11-20 10:57:03&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Back in the first terminal, we need to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;attach&amp;lt;/span&amp;gt; the backing device, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/sda{5..7}&amp;lt;/span&amp;gt; to their respective DRBD resources, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;r{0..2}&amp;lt;/span&amp;gt;. After running the following command, you will see no output on the first terminal, but the second terminal&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/proc/drbd&amp;lt;/span&amp;gt; should update.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
drbdadm attach r{0..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;
version: 8.3.12 (api:88/proto:86-96)&lt;br /&gt;
GIT-hash: e2a8ef4656be026bbae540305fcb998a5991090f build by dag@Build64R6, 2011-11-20 10:57:03&lt;br /&gt;
 0: cs:StandAlone ro:Secondary/Unknown ds:Inconsistent/DUnknown   r----s&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:19515784&lt;br /&gt;
 1: cs:StandAlone ro:Secondary/Unknown ds:Inconsistent/DUnknown   r----s&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:211418788&lt;br /&gt;
 2: cs:StandAlone ro:Secondary/Unknown ds:Inconsistent/DUnknown   r----s&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:211034800&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Take note of the connection state, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cs:StandAlone&amp;lt;/span&amp;gt;, the current role, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ro:Secondary/Unknown&amp;lt;/span&amp;gt; and the disk state, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ds:Inconsistent/DUnknown&amp;lt;/span&amp;gt;. This tells us that our resources are not talking to one another, are not usable because they are in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Secondary&amp;lt;/span&amp;gt; state (you can&#039;t even read the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/drbdX&amp;lt;/span&amp;gt; device) and that the backing device does not have an up to date view of the data. &lt;br /&gt;
&lt;br /&gt;
This all makes sense of course, as the resources are brand new.&lt;br /&gt;
&lt;br /&gt;
So the next step is to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;connect&amp;lt;/span&amp;gt; the two nodes together. As before, we won&#039;t see any output from the first terminal, but the second terminal will change.&lt;br /&gt;
&lt;br /&gt;
{{note|1=After running the following command on the first node, its connection state will become &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cs:WFConnection&amp;lt;/span&amp;gt; which means that it is &#039;&#039;&#039;w&#039;&#039;&#039;aiting &#039;&#039;&#039;f&#039;&#039;&#039;or a &#039;&#039;&#039;connection&#039;&#039;&#039; from the other node.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
drbdadm connect r{0..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;
version: 8.3.12 (api:88/proto:86-96)&lt;br /&gt;
GIT-hash: e2a8ef4656be026bbae540305fcb998a5991090f build by dag@Build64R6, 2011-11-20 10:57:03&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:19515784&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:211418788&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:211034800&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can now see that the two nodes are talking to one another properly as the connection state has changed to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cs:Connected&amp;lt;/span&amp;gt;. They can see that their peer node is in the same state as they are; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Secondary&amp;lt;/span&amp;gt;/&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Inconsistent&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Seeing as the resources are brand new, there is no data to synchronize the two nodes. We&#039;re going to issue a special command that will only ever be used this one time. It will tell DRBD to immediately consider the DRBD resources to be up to date.&lt;br /&gt;
&lt;br /&gt;
On &#039;&#039;&#039;one&#039;&#039;&#039; node only, run;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
drbdadm -- --clear-bitmap new-current-uuid r{0..2}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As before, look to the second terminal to see the new state of affairs.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
version: 8.3.12 (api:88/proto:86-96)&lt;br /&gt;
GIT-hash: e2a8ef4656be026bbae540305fcb998a5991090f build by dag@Build64R6, 2011-11-20 10:57:03&lt;br /&gt;
 0: cs:Connected ro:Secondary/Secondary ds:UpToDate/UpToDate 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:0&lt;br /&gt;
 1: cs:Connected ro:Secondary/Secondary ds:UpToDate/UpToDate 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:0&lt;br /&gt;
 2: cs:Connected ro:Secondary/Secondary ds:UpToDate/UpToDate 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:0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Voila!&lt;br /&gt;
&lt;br /&gt;
We could promote both sides to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Primary&amp;lt;/span&amp;gt; by running &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;drbdadm primary r{0..2}&amp;lt;/span&amp;gt; on both nodes, but there is no purpose in doing that at this stage as we can safely say our DRBD is ready to go. So instead, let&#039;s just stop DRBD entirely. We&#039;ll also prevent it from starting on boot as &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;drbd&amp;lt;/span&amp;gt; will be managed by the cluster in a later step.&lt;br /&gt;
&lt;br /&gt;
On &#039;&#039;&#039;both&#039;&#039;&#039; nodes run;&lt;br /&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 disable it from starting on boot.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
chkconfig drbd off&lt;br /&gt;
chkconfig --list 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           	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;
The second terminal will start complaining that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/proc/drbd&amp;lt;/span&amp;gt; no longer exists. This is because the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;drbd&amp;lt;/span&amp;gt; init script unloaded the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;drbd&amp;lt;/span&amp;gt; kernel module. It is expected and not a problem.&lt;br /&gt;
&lt;br /&gt;
= Configuring Clustered Storage =&lt;br /&gt;
&lt;br /&gt;
Before we can provision the first virtual machine, we must first create the storage that will back them. This will take a few steps;&lt;br /&gt;
&lt;br /&gt;
* Configuring [[LVM]]&#039;s clustered locking and creating the [[PV]]s, [[VG]]s and [[LV]]s&lt;br /&gt;
* Formatting and configuring the shared [[GFS2]] partition.&lt;br /&gt;
* Adding storage to the cluster&#039;s resource management.&lt;br /&gt;
&lt;br /&gt;
== Clustered Logical Volume Management ==&lt;br /&gt;
&lt;br /&gt;
We will assign all three DRBD resources to be managed by clustered LVM. This isn&#039;t strictly needed for the [[GFS2]] partition, as it uses DLM directly. However, the flexibility of LVM is very appealing, and will make later growth of the GFS2 partition quite trivial, should the need arise. &lt;br /&gt;
&lt;br /&gt;
The real reason for clustered LVM in our cluster is to provide DLM-backed locking to the partitions, or logical volumes in LVM, that will be used to back our VMs. Of course, the flexibility of LVM managed storage is enough of a win to justify using LVM for our VMs in itself, and shouldn&#039;t be ignored here.&lt;br /&gt;
&lt;br /&gt;
=== Configuring Clustered LVM Locking ===&lt;br /&gt;
&lt;br /&gt;
Before we create the clustered LVM, we need to first make three changes to the LVM configuration. &lt;br /&gt;
* We need to filter out the DRBD backing devices so that LVM doesn&#039;t see the same signature twice.&lt;br /&gt;
* Switch from local locking to clustered locking.&lt;br /&gt;
* Prevent fall-back to local locking when the cluster is not available.&lt;br /&gt;
&lt;br /&gt;
Start by making a backup of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;lvm.conf&amp;lt;/span&amp;gt; and then begin editing it.&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 configuration option to filter out the DRBD backing device is, surprisingly, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;filter = [ ... ]&amp;lt;/span&amp;gt;. By default, it is set to allow everything via the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;quot;a/.*/&amp;quot;&amp;lt;/span&amp;gt; regular expression. We&#039;re only using DRBD in our LVM, so we&#039;re going to flip that to reject everything &#039;&#039;except&#039;&#039; DRBD by changing the regex to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;quot;a|/dev/drbd*|&amp;quot;, &amp;quot;r/.*/&amp;quot;&amp;lt;/span&amp;gt;. If we didn&#039;t do this, LVM would see the same signature on the DRBD device and again on the backing devices, at which time it would ignore the DRBD device. This filter allows LVM to only inspect the DRBD devices for LVM signatures.&lt;br /&gt;
&lt;br /&gt;
Change;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
    # By default we accept every block device:&lt;br /&gt;
    filter = [ &amp;quot;a/.*/&amp;quot; ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
    # We&#039;re only using LVM on DRBD resource.&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;
For the locking, we&#039;re going to change the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;locking_type&amp;lt;/span&amp;gt; from &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt; (local locking) to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;3&amp;lt;/span&amp;gt;, (clustered locking). This is what tells LVM to use DLM.&lt;br /&gt;
&lt;br /&gt;
Change;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
    locking_type = 1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
    locking_type = 3&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Lastly, we&#039;re also going to disallow fall-back to local locking. Normally, LVM would try to access a clustered LVM [[VG]] using local locking if DLM is not available. We want to prevent any access to the clustered LVM volumes &#039;&#039;except&#039;&#039; when the DLM is itself running. 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; to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;0&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Change;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
    fallback_to_local_locking = 1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
    fallback_to_local_locking = 0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Save the changes, then lets run a &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;diff&amp;lt;/span&amp;gt; against our backup to see a summary of the changes.&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-12-14 17:42:16.416094972 -0500&lt;br /&gt;
+++ /etc/lvm/lvm.conf	2011-12-14 17:49:15.747097684 -0500&lt;br /&gt;
@@ -62,8 +62,8 @@&lt;br /&gt;
     # If it doesn&#039;t do what you expect, check the output of &#039;vgscan -vvvv&#039;.&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;
+    # We&#039;re only using LVM on DRBD resource.&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;
@@ -356,7 +356,7 @@&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 = 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;
@@ -372,7 +372,7 @@&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 = 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;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Perfect! Now copy the modified &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;lvm.conf&amp;lt;/span&amp;gt; file to the other 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-node02:/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;
sending incremental file list&lt;br /&gt;
lvm.conf&lt;br /&gt;
&lt;br /&gt;
sent 2351 bytes  received 283 bytes  5268.00 bytes/sec&lt;br /&gt;
total size is 28718  speedup is 10.90&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Testing the clvmd Daemon ===&lt;br /&gt;
&lt;br /&gt;
A little later on, we&#039;re going to put clustered LVM under the control of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt;. Before we can do that though, we need to start it manually so that we can use it to create the LV that will back the GFS2 &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/shared&amp;lt;/span&amp;gt; partition, which we will also be adding to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; when we build our storage services.&lt;br /&gt;
&lt;br /&gt;
Before we start the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clvmd&amp;lt;/span&amp;gt; daemon, we&#039;ll want to ensure that the cluster is 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;bash&amp;quot;&amp;gt;&lt;br /&gt;
Version: 6.2.0&lt;br /&gt;
Config Version: 7&lt;br /&gt;
Cluster Name: an-cluster-A&lt;br /&gt;
Cluster Id: 24561&lt;br /&gt;
Cluster Member: Yes&lt;br /&gt;
Cluster Generation: 68&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;
Node votes: 1&lt;br /&gt;
Quorum: 1  &lt;br /&gt;
Active subsystems: 7&lt;br /&gt;
Flags: 2node &lt;br /&gt;
Ports Bound: 0  &lt;br /&gt;
Node name: an-node01.alteeve.com&lt;br /&gt;
Node ID: 1&lt;br /&gt;
Multicast addresses: 239.192.95.81 &lt;br /&gt;
Node addresses: 10.20.0.1 &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is, and both nodes are members. We can start the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clvmd&amp;lt;/span&amp;gt; daemon now.&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;
We&#039;ve not created any clustered volume groups yet, so that complaint about not finding volume groups is expected.&lt;br /&gt;
&lt;br /&gt;
We don&#039;t want &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clvmd&amp;lt;/span&amp;gt; to start at boot, as we will be putting it under the cluster&#039;s control. So we need to make sure that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clvmd&amp;lt;/span&amp;gt; is disabled at boot, and then we&#039;ll stop &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clvmd&amp;lt;/span&amp;gt; for now.&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;
Now stop it entirely.&lt;br /&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;
Signaling clvmd to exit                                    [  OK  ]&lt;br /&gt;
clvmd terminated                                           [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Initialize our DRBD Resource for use as LVM PVs ===&lt;br /&gt;
&lt;br /&gt;
This is the first time we&#039;re actually going to use DRBD and clustered LVM, so we need to make sure that both are started. Earlier we stopped them, so if they&#039;re not running now, we need to restart them.&lt;br /&gt;
&lt;br /&gt;
First, check (and start if needed) &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;drbd&amp;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/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;
It&#039;s stopped, so we&#039;ll start it on &#039;&#039;&#039;both&#039;&#039;&#039; nodes now.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/drbd 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 DRBD resources: [ d(r0) d(r1) d(r2) n(r0) n(r1) n(r2) ].&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It looks like it started, but let&#039;s confirm that the resources are all &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Connected&amp;lt;/span&amp;gt;, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Primary&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;UpToDate&amp;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/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.12 (api:88/proto:86-96)&lt;br /&gt;
GIT-hash: e2a8ef4656be026bbae540305fcb998a5991090f build by dag@Build64R6, 2011-11-20 10:57:03&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;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Excellent, now to check on &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;
/etc/init.d/clvmd status&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
clvmd is stopped&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It&#039;s also stopped, so lets start it now.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/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;
Now we&#039;re ready to start!&lt;br /&gt;
&lt;br /&gt;
Before we can use LVM, clustered or otherwise, we need to initialize one or more raw storage devices. This is done using the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;pvcreate&amp;lt;/span&amp;gt; command. We&#039;re going to do this on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;, then run &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;pvscan&amp;lt;/span&amp;gt; on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt;. We should see the newly initialized DRBD resources appear.&lt;br /&gt;
&lt;br /&gt;
Running &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;pvscan&amp;lt;/span&amp;gt; first, we&#039;ll see that no [[PV]]s have been created.&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;
  No matching physical volumes found&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On &#039;&#039;&#039;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;&#039;&#039;&#039;, initialize the PVs;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
pvcreate /dev/drbd{0..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;
  Writing physical volume data to disk &amp;quot;/dev/drbd0&amp;quot;&lt;br /&gt;
  Physical volume &amp;quot;/dev/drbd0&amp;quot; successfully created&lt;br /&gt;
  Writing physical volume data to disk &amp;quot;/dev/drbd1&amp;quot;&lt;br /&gt;
  Physical volume &amp;quot;/dev/drbd1&amp;quot; successfully created&lt;br /&gt;
  Writing physical volume data to disk &amp;quot;/dev/drbd2&amp;quot;&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;
On both nodes, re-run &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;pvscan&amp;lt;/span&amp;gt; and the new PVs should show. This works because DRBD is keeping the data in sync, including the new LVM signatures.&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 [18.61 GiB]&lt;br /&gt;
  PV /dev/drbd1                      lvm2 [201.62 GiB]&lt;br /&gt;
  PV /dev/drbd2                      lvm2 [201.26 GiB]&lt;br /&gt;
  Total: 3 [421.49 GiB] / in use: 0 [0   ] / in no VG: 3 [421.49 GiB]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Done.&lt;br /&gt;
&lt;br /&gt;
=== Creating Cluster Volume Groups ===&lt;br /&gt;
&lt;br /&gt;
As with initializing the DRBD resource above, we will create out volume groups, [[VG]]s, on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt; only, but we will then see them on both nodes.&lt;br /&gt;
&lt;br /&gt;
Check to confirm that no VGs exist;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vgdisplay&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
  No volume groups found&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now to create the VGs, we&#039;ll use the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vgcreate&amp;lt;/span&amp;gt; command with the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;-c y&amp;lt;/span&amp;gt; switch, which tells LVM to make the VG a clustered VG. Note that when the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clvmd&amp;lt;/span&amp;gt; daemon is running, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;-c y&amp;lt;/span&amp;gt; is implied. However, I like to get into the habit of using it because it will trigger an error if, for some reason, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clvmd&amp;lt;/span&amp;gt; wasn&#039;t actually running.&lt;br /&gt;
&lt;br /&gt;
On &#039;&#039;&#039;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;&#039;&#039;&#039;, create the three VGs.&lt;br /&gt;
&lt;br /&gt;
* VG for the GFS2 &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/shared&amp;lt;/span&amp;gt; partition;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vgcreate -c y shared-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;shared-vg0&amp;quot; successfully created&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* VG for the VMs that will primarily run on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vgcreate -c y an01-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;an01-vg0&amp;quot; successfully created&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* VG for the VMs that will primarily run on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt;;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vgcreate -c y an02-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;an02-vg0&amp;quot; successfully created&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now on both nodes, we should see the three new volume groups.&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;an02-vg0&amp;quot; using metadata type lvm2&lt;br /&gt;
  Found volume group &amp;quot;an01-vg0&amp;quot; using metadata type lvm2&lt;br /&gt;
  Found volume group &amp;quot;shared-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 stage, we&#039;re going to create only one [[LV]] for the GFS2 partition. We&#039;ll create the rest later when we&#039;re ready to provision the VMs. This will be the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/shared&amp;lt;/span&amp;gt; partiton, which we will discuss further in the next section.&lt;br /&gt;
&lt;br /&gt;
As before, we&#039;ll create the LV on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt; and then verify it exists on both nodes.&lt;br /&gt;
&lt;br /&gt;
Before we create our first LV, check &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;lvscan&amp;lt;/span&amp;gt;.&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;
&#039;&#039;Nothing is returned&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
On &#039;&#039;&#039;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;&#039;&#039;&#039;, create the the LV on the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;shared-vg0&amp;lt;/span&amp;gt; VG, using all of the available space.&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 shared shared-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;shared&amp;quot; created&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now on both nodes, check that the new LV exists.&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/shared-vg0/shared&#039; [18.61 GiB] inherit&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Perfect. We can now create our GFS2 partition.&lt;br /&gt;
&lt;br /&gt;
== Creating The Shared GFS2 Partition ==&lt;br /&gt;
&lt;br /&gt;
The GFS2-formatted &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/shared&amp;lt;/span&amp;gt; partition will be used for four main purposes;&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/shared/files&amp;lt;/span&amp;gt;; Storing files like [[ISO]] images needed when provisioning VMs.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/shared/provision&amp;lt;/span&amp;gt;; Storing short scripts used to call &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-install&amp;lt;/span&amp;gt; which handles the creation of our VMs.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/shared/definitions&amp;lt;/span&amp;gt;; This is where the [[XML]] definition files which define the emulated hardware backing our VMs are kept. This is the most critical directory as the cluster will look here when starting and recovering VMs.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/shared/archive&amp;lt;/span&amp;gt;; This is used to store old copies of the [[XML]] definition files. I like to make a time-stamped copy of definition files prior to altering and redefining a VM. This way, I can quickly and easily revert to an old configuration should I run into trouble.&lt;br /&gt;
&lt;br /&gt;
Make sure that both &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;drbd&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clvmd&amp;lt;/span&amp;gt; are running.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;mkfs.gfs2&amp;lt;/span&amp;gt; call uses a few switches that are worth explaining;&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;-p lock_dlm&amp;lt;/span&amp;gt;; This tells GFS2 to use [[DLM]] for its clustered locking. Currently, this is the only supported locking type.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;-j 2&amp;lt;/span&amp;gt;; This tells GFS2 to create two journals. This must match the number of nodes that will try to mount this partition at any one time.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;-t an-cluster-A:shared&amp;lt;/span&amp;gt;; This is the lockspace name, which must be in the format &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;clustename&amp;gt;:&amp;lt;fsname&amp;gt;&amp;lt;/span&amp;gt;. The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clustername&amp;lt;/span&amp;gt; must match the one in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cluster.conf&amp;lt;/span&amp;gt;, and any node that belongs to a cluster of another name will not be allowed to access the file system.&lt;br /&gt;
&lt;br /&gt;
{{note|1=Depending on the size of the new partition, this call could take a while to complete. Please be patient.}}&lt;br /&gt;
&lt;br /&gt;
Then, on &#039;&#039;&#039;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;&#039;&#039;&#039;, run;&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-cluster-A:shared /dev/shared-vg0/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/shared-vg0/shared.&lt;br /&gt;
It appears to contain: symbolic link to `../dm-0&#039;&lt;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;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Device:                    /dev/shared-vg0/shared&lt;br /&gt;
Blocksize:                 4096&lt;br /&gt;
Device Size                18.61 GB (4878336 blocks)&lt;br /&gt;
Filesystem Size:           18.61 GB (4878333 blocks)&lt;br /&gt;
Journals:                  2&lt;br /&gt;
Resource Groups:           75&lt;br /&gt;
Locking Protocol:          &amp;quot;lock_dlm&amp;quot;&lt;br /&gt;
Lock Table:                &amp;quot;an-cluster-A:shared&amp;quot;&lt;br /&gt;
UUID:                      162a80eb-59b3-08bd-5d69-740cbb60aa45&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On &#039;&#039;&#039;both&#039;&#039;&#039; nodes, run all of the following commands.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
mkdir /shared&lt;br /&gt;
mount /dev/shared-vg0/shared /shared/&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Confirm that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/shared&amp;lt;/span&amp;gt; is now mounted.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
df -hP /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;
Filesystem            Size  Used Avail Use% Mounted on&lt;br /&gt;
/dev/mapper/shared--vg0-shared   19G  259M   19G   2% /shared&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that the path under &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Filesystem&amp;lt;/span&amp;gt; is different from what we used when creating the GFS2 partition. This is an effect of [[Device Mapper]], which is used by LVM to create symlinks to actual block device paths. If we look at our &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/shared-vg0/shared&amp;lt;/span&amp;gt; device and the device from &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;df&amp;lt;/span&amp;gt;, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/mapper/shared--vg0-shared&amp;lt;/span&amp;gt;, we&#039;ll see that they both point to the same actual block device.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ls -lah /dev/shared-vg0/shared /dev/mapper/shared--vg0-shared&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
lrwxrwxrwx 1 root root 7 Oct 23 16:35 /dev/mapper/shared--vg0-shared -&amp;gt; ../dm-0&lt;br /&gt;
lrwxrwxrwx 1 root root 7 Oct 23 16:35 /dev/shared-vg0/shared -&amp;gt; ../dm-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;
ls -lah /dev/dm-0 &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
brw-rw---- 1 root disk 253, 0 Oct 23 16:35 /dev/dm-0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This next step uses some command-line voodoo. It takes the output from &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;gfs2_edit -p sb /dev/shared-vg0/shared&amp;lt;/span&amp;gt;, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;grep&amp;lt;/span&amp;gt;&#039;s out the [[UUID]] line for the new GFS2 partition, parses out of that the UUID itself, converts it to lower-case and, finally, spits out a string that can be used in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/fstab&amp;lt;/span&amp;gt;. We&#039;ll run it twice; The first time to confirm that the output is what we expect and the second time to append it 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;
The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;gfs2&amp;lt;/span&amp;gt; daemon can only work on GFS2 partitions that have been defined in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/fstab&amp;lt;/span&amp;gt;, so this is a required step on both nodes.&lt;br /&gt;
&lt;br /&gt;
We use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;defaults,noatime,nodiratime&amp;lt;/span&amp;gt; instead of just &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;defaults&amp;lt;/span&amp;gt; for performance reasons. Normally, every time a file or directory is accessed, its &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[atime]]&amp;lt;/span&amp;gt; (or &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[diratime]]&amp;lt;/span&amp;gt;) is updated, which requires a disk write, which requires an exclusive DLM lock, which is expensive. If you need to know when a file or directory was accessed, remove &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;,noatime,nodiratime&amp;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 `gfs2_edit -p sb /dev/shared-vg0/shared | grep sb_uuid | sed -e &amp;quot;s/.*sb_uuid  *\(.*\)/UUID=\L\1\E \/shared\t\tgfs2\tdefaults,noatime,nodiratime\t0 0/&amp;quot;`&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
UUID=162a80eb-59b3-08bd-5d69-740cbb60aa45 /shared gfs2 defaults,noatime,nodiratime 0 0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This looks good, so now re-run it but redirect the output to append to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/fstab&amp;lt;/span&amp;gt;. We&#039;ll confirm it worked by checking the status of the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;gfs2&amp;lt;/span&amp;gt; daemon.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
echo `gfs2_edit -p sb /dev/shared-vg0/shared | grep sb_uuid | sed -e &amp;quot;s/.*sb_uuid  *\(.*\)/UUID=\L\1\E \/shared\t\tgfs2\tdefaults,noatime,nodiratime\t0 0/&amp;quot;` &amp;gt;&amp;gt; /etc/fstab&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;
/shared&lt;br /&gt;
Active GFS2 mountpoints: &lt;br /&gt;
/shared&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Perfect, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;gfs2&amp;lt;/span&amp;gt; can see the partition now! We&#039;re ready to setup our directories.&lt;br /&gt;
&lt;br /&gt;
On &#039;&#039;&#039;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&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 /shared/{definitions,provision,archive,files}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On &#039;&#039;&#039;both&#039;&#039;&#039; nodes, confirm that all of the new directories exist and are visible.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ls -lah /shared/&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
total 24K&lt;br /&gt;
drwxr-xr-x   6 root root 3.8K Dec 14 19:05 .&lt;br /&gt;
dr-xr-xr-x. 24 root root 4.0K Dec 14 18:44 ..&lt;br /&gt;
drwxr-xr-x   2 root root    0 Dec 14 19:05 archive&lt;br /&gt;
drwxr-xr-x   2 root root    0 Dec 14 19:05 definitions&lt;br /&gt;
drwxr-xr-x   2 root root    0 Dec 14 19:05 files&lt;br /&gt;
drwxr-xr-x   2 root root    0 Dec 14 19:05 provision&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Wonderful!&lt;br /&gt;
&lt;br /&gt;
As with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;drbd&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clvmd&amp;lt;/span&amp;gt;, we don&#039;t want to have &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;gfs2&amp;lt;/span&amp;gt; start at boot as we&#039;re going to put it under the control of the cluster.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
chkconfig gfs2 off&lt;br /&gt;
chkconfig --list gfs2&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
gfs2           	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;
==== Renaming a GFS2 Partition ====&lt;br /&gt;
&lt;br /&gt;
{{warning|1=Be sure to unmount the GFS2 partition from &#039;&#039;&#039;all&#039;&#039;&#039; nodes prior to altering the cluster or filesystem names!}}&lt;br /&gt;
&lt;br /&gt;
If you ever need to rename your cluster, you will need to update your GFS2 partition before you can remount it. Unmount the partition from all nodes and run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
gfs2_tool sb /dev/shared-vg0/shared table &amp;quot;new_cluster_name:shared&amp;quot;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
You shouldn&#039;t change any of these values if the filesystem is mounted.&lt;br /&gt;
&lt;br /&gt;
Are you sure? [y/n] y&lt;br /&gt;
&lt;br /&gt;
current lock table name = &amp;quot;an-cluster-A:shared&amp;quot;&lt;br /&gt;
new lock table name = &amp;quot;new_cluster_name:shared&amp;quot;&lt;br /&gt;
Done&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then you can change the cluster&#039;s name in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cluster.conf&amp;lt;/span&amp;gt; and then remount the GFS2 partition.&lt;br /&gt;
&lt;br /&gt;
You can use the same command, changing the GFS2 partition name, if you want to change the name of the filesystem instead of (or at the same time as) the cluster&#039;s name.&lt;br /&gt;
&lt;br /&gt;
=== Stopping All Clustered Storage Components ===&lt;br /&gt;
&lt;br /&gt;
Before we can put storage under the cluster&#039;s control, we need to make sure that the &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;clvmd&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;drbd&amp;lt;/span&amp;gt; daemons are stopped.&lt;br /&gt;
&lt;br /&gt;
On &#039;&#039;&#039;both&#039;&#039;&#039; nodes, run;&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 &amp;amp;&amp;amp; /etc/init.d/clvmd stop &amp;amp;&amp;amp; /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;
Unmounting GFS2 filesystem (/shared):                      [  OK  ]&lt;br /&gt;
Deactivating clustered VG(s):   0 logical volume(s) in volume group &amp;quot;an02-vg0&amp;quot; now active&lt;br /&gt;
  0 logical volume(s) in volume group &amp;quot;an01-vg0&amp;quot; now active&lt;br /&gt;
  0 logical volume(s) in volume group &amp;quot;shared-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;
Stopping all DRBD resources: .&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Managing Storage In The Cluster =&lt;br /&gt;
&lt;br /&gt;
A little while back, we spoke about how the cluster is split into two components; cluster communication managed by &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt; and resource management provided by &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt;. It&#039;s the later which we will now begin to configure.&lt;br /&gt;
&lt;br /&gt;
In the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cluster.conf&amp;lt;/span&amp;gt;, the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; component is contained within the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;rm /&amp;gt;&amp;lt;/span&amp;gt; element tags. Within this element are three types of child elements. They are:&lt;br /&gt;
* Fail-over Domains - &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;failoverdomains /&amp;gt;&amp;lt;/span&amp;gt;; &lt;br /&gt;
** These are optional constraints which allow for control which nodes, and under what circumstances, services may run. When not used, a service will be allowed to run on any node in the cluster without constraints or ordering.&lt;br /&gt;
* Resources - &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;resources /&amp;gt;&amp;lt;/span&amp;gt;; &lt;br /&gt;
** Within this element, available resources are defined. Simply having a resource here will not put it under cluster control. Rather, it makes it available for use in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;service /&amp;gt;&amp;lt;/span&amp;gt; elements.&lt;br /&gt;
* Services - &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;service /&amp;gt;&amp;lt;/span&amp;gt;; &lt;br /&gt;
** This element contains one or more parallel or series child-elements which are themselves references to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;resources /&amp;gt;&amp;lt;/span&amp;gt; elements. When in parallel, the services will start and stop at the same time. When in series, the services start in order and stop in reverse order. We will also see a specialized type of service that uses the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;vm /&amp;gt;&amp;lt;/span&amp;gt; element name, as you can probably guess, for creating virtual machine services.&lt;br /&gt;
&lt;br /&gt;
We&#039;ll look at each of these components in more detail shortly.&lt;br /&gt;
&lt;br /&gt;
== A Note On Daemon Starting ==&lt;br /&gt;
&lt;br /&gt;
There are four daemons we will be putting under cluster control;&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;drbd&amp;lt;/span&amp;gt;; Replicated storage.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clvmd&amp;lt;/span&amp;gt;; Clustered LVM.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;gfs2&amp;lt;/span&amp;gt;; Mounts and Unmounts configured GFS2 partition.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;libvirtd&amp;lt;/span&amp;gt;; Provides access to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virsh&amp;lt;/span&amp;gt; and other &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;libvirt&amp;lt;/span&amp;gt; tools. Needed for running our VMs.&lt;br /&gt;
&lt;br /&gt;
The reason we do not want to start these daemons with the system is so that we can let the cluster do it. This way, should any fail, the cluster will detect the failure and fail the entire service tree. For example, lets say that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;drbd&amp;lt;/span&amp;gt; failed to start, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; would fail the storage service and give up, rather than continue trying to start &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clvmd&amp;lt;/span&amp;gt; and the rest. With &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;libvirtd&amp;lt;/span&amp;gt; being the last daemon, it will not be possible to start a VM unless the storage started successfully. &lt;br /&gt;
&lt;br /&gt;
If we had left these daemons to boot on start, the failure of the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;drbd&amp;lt;/span&amp;gt; would not effect the start-up of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clvmd&amp;lt;/span&amp;gt;, which would then not find its [[PV]]s given that DRBD is down. Next, the system would try to start the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;gfs2&amp;lt;/span&amp;gt; daemon which would also fail as the [[LV]] backing the partition would not be available. Finally, the system would start &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;libvirtd&amp;lt;/span&amp;gt;, which would allow the start of virtual machine, which would also be missing their &amp;quot;hard drives&amp;quot; as their backing LVs would also not be available. Pretty messy situation to clean up from.&lt;br /&gt;
&lt;br /&gt;
=== Defining The Resources ===&lt;br /&gt;
&lt;br /&gt;
Lets start by first defining our clustered resources. &lt;br /&gt;
&lt;br /&gt;
As stated before, the addition of these resources does not, in itself, put the defined resources under the cluster&#039;s management. Instead, it defines services, like &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;init.d&amp;lt;/span&amp;gt; scripts. These can then be used by one or more &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;service /&amp;gt;&amp;lt;/span&amp;gt; elements, as we will see shortly. For now, it is enough to know what, until a resource is defined, it can not be used in the cluster.&lt;br /&gt;
&lt;br /&gt;
Given that this is the first component of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; being added to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cluster.conf&amp;lt;/span&amp;gt;, we will be creating the parent &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;rm /&amp;gt;&amp;lt;/span&amp;gt; elements here as well.&lt;br /&gt;
&lt;br /&gt;
Let&#039;s take a look at the new section, then discuss the parts.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;cluster name=&amp;quot;an-cluster-A&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-node01.alteeve.com&amp;quot; nodeid=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
                        &amp;lt;fence&amp;gt;&lt;br /&gt;
                                &amp;lt;method name=&amp;quot;ipmi&amp;quot;&amp;gt;&lt;br /&gt;
                                        &amp;lt;device name=&amp;quot;ipmi_an01&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;pdu&amp;quot;&amp;gt;&lt;br /&gt;
                                        &amp;lt;device name=&amp;quot;pdu2&amp;quot; port=&amp;quot;1&amp;quot; action=&amp;quot;reboot&amp;quot; /&amp;gt;&lt;br /&gt;
                                &amp;lt;/method&amp;gt;&lt;br /&gt;
                        &amp;lt;/fence&amp;gt;&lt;br /&gt;
                &amp;lt;/clusternode&amp;gt;&lt;br /&gt;
                &amp;lt;clusternode name=&amp;quot;an-node02.alteeve.com&amp;quot; nodeid=&amp;quot;2&amp;quot;&amp;gt;&lt;br /&gt;
                        &amp;lt;fence&amp;gt;&lt;br /&gt;
                                &amp;lt;method name=&amp;quot;ipmi&amp;quot;&amp;gt;&lt;br /&gt;
                                        &amp;lt;device name=&amp;quot;ipmi_an02&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;pdu&amp;quot;&amp;gt;&lt;br /&gt;
                                        &amp;lt;device name=&amp;quot;pdu2&amp;quot; port=&amp;quot;2&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;ipmi_an01&amp;quot; agent=&amp;quot;fence_ipmilan&amp;quot; ipaddr=&amp;quot;an-node01.ipmi&amp;quot; login=&amp;quot;root&amp;quot; passwd=&amp;quot;secret&amp;quot; /&amp;gt;&lt;br /&gt;
                &amp;lt;fencedevice name=&amp;quot;ipmi_an02&amp;quot; agent=&amp;quot;fence_ipmilan&amp;quot; ipaddr=&amp;quot;an-node02.ipmi&amp;quot; login=&amp;quot;root&amp;quot; passwd=&amp;quot;secret&amp;quot; /&amp;gt;&lt;br /&gt;
                &amp;lt;fencedevice agent=&amp;quot;fence_apc_snmp&amp;quot; ipaddr=&amp;quot;pdu2.alteeve.com&amp;quot; name=&amp;quot;pdu2&amp;quot; /&amp;gt;&lt;br /&gt;
        &amp;lt;/fencedevices&amp;gt;&lt;br /&gt;
        &amp;lt;fence_daemon post_join_delay=&amp;quot;30&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 log_level=&amp;quot;5&amp;quot;&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;script file=&amp;quot;/etc/init.d/libvirtd&amp;quot; name=&amp;quot;libvirtd&amp;quot;/&amp;gt;&lt;br /&gt;
                &amp;lt;/resources&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;
First and foremost; Note that we&#039;ve incremented the version to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;8&amp;lt;/span&amp;gt;. As always, increment and then edit.&lt;br /&gt;
&lt;br /&gt;
Let&#039;s focus on the new section;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;rm log_level=&amp;quot;5&amp;quot;&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;script file=&amp;quot;/etc/init.d/libvirtd&amp;quot; name=&amp;quot;libvirtd&amp;quot;/&amp;gt;&lt;br /&gt;
		&amp;lt;/resources&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 new &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;rm log_level=&amp;quot;5&amp;quot;&amp;gt;...&amp;lt;/rm&amp;gt;&amp;lt;/span&amp;gt; element tells the cluster that this is the section for &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; and that we&#039;re setting the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;log_level&amp;lt;/span&amp;gt; to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;5&amp;lt;/span&amp;gt;. This &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;log_level&amp;lt;/span&amp;gt; is slightly less verbose that the default. Specifically, by default, there is an entry in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/var/log/messages&amp;lt;/span&amp;gt; every time each resource is checked. This quickly adds a lot of questionably useful information to [[syslog]]. By changing this, we will still see all important messages, but these resource check messages are suppressed. If you are ever curious about whether or not &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; is, in fact, checking the services than either remove &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;log_level=&amp;quot;5&amp;quot;&amp;lt;/span&amp;gt; or change it to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;6&amp;lt;/span&amp;gt; or higher.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;resources&amp;gt;...&amp;lt;/resources&amp;gt;&amp;lt;/span&amp;gt; element contains our four &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;script .../&amp;gt;&amp;lt;/span&amp;gt; resources. This is a particular type of resource which specifically handles that starting and stopping of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[init.d]]&amp;lt;/span&amp;gt; style scripts. That is, the script must exit with [[LSB]] compliant codes. They must also properly react to being called with the sole argument of &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;.&lt;br /&gt;
&lt;br /&gt;
There are many other types of resources which, with the exception of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;vm .../&amp;gt;&amp;lt;/span&amp;gt;, we will not be looking at in this tutorial. Should you be interested in them, please look in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/usr/share/cluster&amp;lt;/span&amp;gt; for the various scripts (executable files that end with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;.sh&amp;lt;/span&amp;gt;). &lt;br /&gt;
&lt;br /&gt;
Each of our four &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;script ... /&amp;gt;&amp;lt;/span&amp;gt; resources have two attributes;&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;file=&amp;quot;...&amp;quot;&amp;lt;/span&amp;gt;; The full path to the script to be managed.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;name=&amp;quot;...&amp;quot;&amp;lt;/span&amp;gt;; A unique name used to reference this resource later on in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;service /&amp;gt;&amp;lt;/span&amp;gt; elements.&lt;br /&gt;
&lt;br /&gt;
Other resources are more involved, but the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;script .../&amp;gt;&amp;lt;/span&amp;gt; resources are quite simple.&lt;br /&gt;
&lt;br /&gt;
=== Creating Failover Domains ===&lt;br /&gt;
&lt;br /&gt;
Fail-over domains are, at their most basic, a collection of one or more nodes in the cluster with a particular set of rules associated with them. Services can then be configured to operate within the context of a given fail-over domain. There are a few key options to be aware of.&lt;br /&gt;
&lt;br /&gt;
Fail-over domains are optional and can be left out of the cluster, generally speaking. However, in our cluster, we will need them for our storage services, as we will later see, so please do not skip this step.&lt;br /&gt;
&lt;br /&gt;
* A fail-over domain can be unordered or prioritized.&lt;br /&gt;
** When unordered, a service will start on any node in the domain. Should that node later fail, it will restart to another random node in the domain.&lt;br /&gt;
** When prioritized, a service will start on the available node with the highest priority in the domain. Should that node later fail, the service will restart on the available node with the next highest priority.&lt;br /&gt;
* A fail-over domain can be restricted or unrestricted.&lt;br /&gt;
** When restricted, a service is &#039;&#039;&#039;only&#039;&#039;&#039; allowed to start on, or restart on. a nodes in the domain. When no nodes are available, the service will be stopped.&lt;br /&gt;
** When unrestricted, a service will try to start on, or restart on, a node in the domain. However, when no domain members are available, the cluster will pick another available node at random to start the service on.&lt;br /&gt;
* A fail-over domain can have a fail-back policy.&lt;br /&gt;
** When a domain allows for fail-back and the domain is ordered, and a node with a higher &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;priority&amp;lt;/span&amp;gt; (re)joins the cluster, services within the domain will migrate to that higher-priority node. 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 fail-back, but is unrestricted, fail-back of services that fell out of the domain will happen anyway. That is to say, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;nofailback=&amp;quot;1&amp;quot;&amp;lt;/span&amp;gt; is ignored if a service was running on a node outside of the fail-over domain and a node within the domain joins the cluster. However, once the service is on a node within the domain, the service will &#039;&#039;&#039;not&#039;&#039;&#039; relocate to a higher-priority node should one join the cluster later.&lt;br /&gt;
** When a domain does not allow for fail-back and is restricted, then fail-back of services will never occur.&lt;br /&gt;
&lt;br /&gt;
What we need to do at this stage is to create something of a hack. Let me explain;&lt;br /&gt;
&lt;br /&gt;
As discussed earlier, we need to start a set of local daemons on all nodes. These aren&#039;t really clustered resources though as they can only ever run on their host node. They will never be relocated or restarted elsewhere in the cluster as as such, are not highly available. So to work around this desire to &amp;quot;cluster the unclusterable&amp;quot;, we&#039;re going to create a fail-over domain for each node in the cluster. Each of these domains will have only one of the cluster nodes as members of the domain and the domain will be restricted, unordered and have no fail-back. With this configuration, any service group using it will only ever run on the one node in the domain.&lt;br /&gt;
&lt;br /&gt;
In the next step, we will create a service group, then replicate it once for each node in the cluster. The only difference will be the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;failoverdomain&amp;lt;/span&amp;gt; each is set to use. With our configuration of two nodes then, we will have two fail-over domains, one for each node, and we will define the clustered storage service twice, each one using one of the two fail-over domains.&lt;br /&gt;
&lt;br /&gt;
Let&#039;s look at the complete updated &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cluster.conf&amp;lt;/span&amp;gt;, then we will focus closer on the new section.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;cluster name=&amp;quot;an-cluster-A&amp;quot; config_version=&amp;quot;9&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-node01.alteeve.com&amp;quot; nodeid=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
                        &amp;lt;fence&amp;gt;&lt;br /&gt;
                                &amp;lt;method name=&amp;quot;ipmi&amp;quot;&amp;gt;&lt;br /&gt;
                                        &amp;lt;device name=&amp;quot;ipmi_an01&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;pdu&amp;quot;&amp;gt;&lt;br /&gt;
                                        &amp;lt;device name=&amp;quot;pdu2&amp;quot; port=&amp;quot;1&amp;quot; action=&amp;quot;reboot&amp;quot; /&amp;gt;&lt;br /&gt;
                                &amp;lt;/method&amp;gt;&lt;br /&gt;
                        &amp;lt;/fence&amp;gt;&lt;br /&gt;
                &amp;lt;/clusternode&amp;gt;&lt;br /&gt;
                &amp;lt;clusternode name=&amp;quot;an-node02.alteeve.com&amp;quot; nodeid=&amp;quot;2&amp;quot;&amp;gt;&lt;br /&gt;
                        &amp;lt;fence&amp;gt;&lt;br /&gt;
                                &amp;lt;method name=&amp;quot;ipmi&amp;quot;&amp;gt;&lt;br /&gt;
                                        &amp;lt;device name=&amp;quot;ipmi_an02&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;pdu&amp;quot;&amp;gt;&lt;br /&gt;
                                        &amp;lt;device name=&amp;quot;pdu2&amp;quot; port=&amp;quot;2&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;ipmi_an01&amp;quot; agent=&amp;quot;fence_ipmilan&amp;quot; ipaddr=&amp;quot;an-node01.ipmi&amp;quot; login=&amp;quot;root&amp;quot; passwd=&amp;quot;secret&amp;quot; /&amp;gt;&lt;br /&gt;
                &amp;lt;fencedevice name=&amp;quot;ipmi_an02&amp;quot; agent=&amp;quot;fence_ipmilan&amp;quot; ipaddr=&amp;quot;an-node02.ipmi&amp;quot; login=&amp;quot;root&amp;quot; passwd=&amp;quot;secret&amp;quot; /&amp;gt;&lt;br /&gt;
                &amp;lt;fencedevice agent=&amp;quot;fence_apc_snmp&amp;quot; ipaddr=&amp;quot;pdu2.alteeve.com&amp;quot; name=&amp;quot;pdu2&amp;quot; /&amp;gt;&lt;br /&gt;
        &amp;lt;/fencedevices&amp;gt;&lt;br /&gt;
        &amp;lt;fence_daemon post_join_delay=&amp;quot;30&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 log_level=&amp;quot;5&amp;quot;&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;script file=&amp;quot;/etc/init.d/libvirtd&amp;quot; name=&amp;quot;libvirtd&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;only_an01&amp;quot; nofailback=&amp;quot;1&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-node01.alteeve.com&amp;quot;/&amp;gt;&lt;br /&gt;
                        &amp;lt;/failoverdomain&amp;gt;&lt;br /&gt;
                        &amp;lt;failoverdomain name=&amp;quot;only_an02&amp;quot; nofailback=&amp;quot;1&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-node02.alteeve.com&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;
As always, the version was incremented, this time to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;9&amp;lt;/span&amp;gt;. We&#039;ve also added the new &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;failoverdomains&amp;gt;...&amp;lt;/failoverdomains&amp;gt;&amp;lt;/span&amp;gt; element. Let&#039;s take a closer look at this new element.&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;
                        &amp;lt;failoverdomain name=&amp;quot;only_an01&amp;quot; nofailback=&amp;quot;1&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-node01.alteeve.com&amp;quot;/&amp;gt;&lt;br /&gt;
                        &amp;lt;/failoverdomain&amp;gt;&lt;br /&gt;
                        &amp;lt;failoverdomain name=&amp;quot;only_an02&amp;quot; nofailback=&amp;quot;1&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-node02.alteeve.com&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;
The first thing to node is that there are two &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;failoverdomain...&amp;gt;...&amp;lt;/failoverdomain&amp;gt;&amp;lt;/span&amp;gt; child elements. &lt;br /&gt;
* The first has the name &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;only_an01&amp;lt;/span&amp;gt; and contains only the node &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt; as a member.&lt;br /&gt;
* The second is effectively identical, save that the domain&#039;s name is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;only_an02&amp;lt;/span&amp;gt; and it contains only the node &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt; as a member.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;failoverdomain ...&amp;gt;&amp;lt;/span&amp;gt; element has four attributes;&lt;br /&gt;
* The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;name=&amp;quot;...&amp;quot;&amp;lt;/span&amp;gt; attribute sets the unique name of the domain which we will later use to bind a service to the domain.&lt;br /&gt;
* The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;nofailback=&amp;quot;1&amp;quot;&amp;lt;/span&amp;gt; attribute tells the cluster to never &amp;quot;fail back&amp;quot; any services in this domain. This seems redundant, given there is only one node, but when combined with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;restricted=&amp;quot;0&amp;quot;&amp;lt;/span&amp;gt;, prevents any migration of services.&lt;br /&gt;
* The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ordered=&amp;quot;0&amp;quot;&amp;lt;/span&amp;gt; this is also somewhat redundant in that there is only one node defined in the domain, but I don&#039;t like to leave attributes undefined so I have it here.&lt;br /&gt;
* The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;restricted=&amp;quot;1&amp;quot;&amp;lt;/span&amp;gt; attribute is key in that it tells the cluster to &#039;&#039;&#039;not&#039;&#039;&#039; try to restart services within this domain on any other nodes outside of the one defined in the fail-over domain.&lt;br /&gt;
&lt;br /&gt;
Each of the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;failoverdomain...&amp;gt;&amp;lt;/span&amp;gt; elements has a single &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;failoverdomainnode .../&amp;gt;&amp;lt;/span&amp;gt; child element. This is a very simple element which has, at this time, only one attribute;&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;name=&amp;quot;...&amp;quot;&amp;lt;/span&amp;gt;; The name of the node to include in the fail-over domain. This name must match the corresponding &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;clusternode name=&amp;quot;...&amp;quot;&amp;lt;/span&amp;gt; node name.&lt;br /&gt;
&lt;br /&gt;
At this point, we&#039;re ready to finally create our clustered storage services.&lt;br /&gt;
&lt;br /&gt;
=== Creating Clustered Storage Services ===&lt;br /&gt;
&lt;br /&gt;
With the resources defined and the fail-over domains created, we can set about creating our services.&lt;br /&gt;
&lt;br /&gt;
Generally speaking, services can have one or more resources within them. When two or more resources exist, then can be put into a dependency tree, they can used in parallel or a combination of parallel and dependent resources.&lt;br /&gt;
&lt;br /&gt;
When you create a service dependency tree, you put each dependent resource as a child element of its parent. The resources are then started in order, starting at the top of the tree and working its way down to the deepest child resource. If at any time one of the resources should fail, the entire service will be declared failed and no attempt will be made to try and start any further child resources. Conversely, stopping the service will cause the deepest child resource to be stopped first. Then the second deepest and on upwards towards the top resource. This is exactly the behaviour we want, as we will see shortly.&lt;br /&gt;
&lt;br /&gt;
When resources are defined in parallel, all defined resources will be started at the same time. Should any one of the resources fail to start, the entire resource will declared failed. Stopping the service will likewise cause a simultaneous call to stop all resources.&lt;br /&gt;
&lt;br /&gt;
As before, let&#039;s take a look at the entire updated &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cluster.conf&amp;lt;/span&amp;gt; file, then we&#039;ll focus in on the new service section.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;cluster name=&amp;quot;an-cluster-A&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-node01.alteeve.com&amp;quot; nodeid=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
                        &amp;lt;fence&amp;gt;&lt;br /&gt;
                                &amp;lt;method name=&amp;quot;ipmi&amp;quot;&amp;gt;&lt;br /&gt;
                                        &amp;lt;device name=&amp;quot;ipmi_an01&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;pdu&amp;quot;&amp;gt;&lt;br /&gt;
                                        &amp;lt;device name=&amp;quot;pdu2&amp;quot; port=&amp;quot;1&amp;quot; action=&amp;quot;reboot&amp;quot; /&amp;gt;&lt;br /&gt;
                                &amp;lt;/method&amp;gt;&lt;br /&gt;
                        &amp;lt;/fence&amp;gt;&lt;br /&gt;
                &amp;lt;/clusternode&amp;gt;&lt;br /&gt;
                &amp;lt;clusternode name=&amp;quot;an-node02.alteeve.com&amp;quot; nodeid=&amp;quot;2&amp;quot;&amp;gt;&lt;br /&gt;
                        &amp;lt;fence&amp;gt;&lt;br /&gt;
                                &amp;lt;method name=&amp;quot;ipmi&amp;quot;&amp;gt;&lt;br /&gt;
                                        &amp;lt;device name=&amp;quot;ipmi_an02&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;pdu&amp;quot;&amp;gt;&lt;br /&gt;
                                        &amp;lt;device name=&amp;quot;pdu2&amp;quot; port=&amp;quot;2&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;ipmi_an01&amp;quot; agent=&amp;quot;fence_ipmilan&amp;quot; ipaddr=&amp;quot;an-node01.ipmi&amp;quot; login=&amp;quot;root&amp;quot; passwd=&amp;quot;secret&amp;quot; /&amp;gt;&lt;br /&gt;
                &amp;lt;fencedevice name=&amp;quot;ipmi_an02&amp;quot; agent=&amp;quot;fence_ipmilan&amp;quot; ipaddr=&amp;quot;an-node02.ipmi&amp;quot; login=&amp;quot;root&amp;quot; passwd=&amp;quot;secret&amp;quot; /&amp;gt;&lt;br /&gt;
                &amp;lt;fencedevice agent=&amp;quot;fence_apc_snmp&amp;quot; ipaddr=&amp;quot;pdu2.alteeve.com&amp;quot; name=&amp;quot;pdu2&amp;quot; /&amp;gt;&lt;br /&gt;
        &amp;lt;/fencedevices&amp;gt;&lt;br /&gt;
        &amp;lt;fence_daemon post_join_delay=&amp;quot;30&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 log_level=&amp;quot;5&amp;quot;&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;script file=&amp;quot;/etc/init.d/libvirtd&amp;quot; name=&amp;quot;libvirtd&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;only_an01&amp;quot; nofailback=&amp;quot;1&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-node01.alteeve.com&amp;quot;/&amp;gt;&lt;br /&gt;
                        &amp;lt;/failoverdomain&amp;gt;&lt;br /&gt;
                        &amp;lt;failoverdomain name=&amp;quot;only_an02&amp;quot; nofailback=&amp;quot;1&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-node02.alteeve.com&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 name=&amp;quot;storage_an01&amp;quot; autostart=&amp;quot;1&amp;quot; domain=&amp;quot;only_an01&amp;quot; exclusive=&amp;quot;0&amp;quot; recovery=&amp;quot;restart&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 ref=&amp;quot;libvirtd&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;/script&amp;gt;&lt;br /&gt;
                &amp;lt;/service&amp;gt;&lt;br /&gt;
                &amp;lt;service name=&amp;quot;storage_an02&amp;quot; autostart=&amp;quot;1&amp;quot; domain=&amp;quot;only_an02&amp;quot; exclusive=&amp;quot;0&amp;quot; recovery=&amp;quot;restart&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 ref=&amp;quot;libvirtd&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;/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;
With the version now at &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;10&amp;lt;/span&amp;gt;, we have added two &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;service...&amp;gt;...&amp;lt;/service&amp;gt;&amp;lt;/span&amp;gt; elements. Each containing a four &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;script ...&amp;gt;&amp;lt;/span&amp;gt; type resources in a service tree configuration. Let&#039;s take a closer look.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;service name=&amp;quot;storage_an01&amp;quot; autostart=&amp;quot;1&amp;quot; domain=&amp;quot;only_an01&amp;quot; exclusive=&amp;quot;0&amp;quot; recovery=&amp;quot;restart&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 ref=&amp;quot;libvirtd&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;/script&amp;gt;&lt;br /&gt;
		&amp;lt;/service&amp;gt;&lt;br /&gt;
		&amp;lt;service name=&amp;quot;storage_an02&amp;quot; autostart=&amp;quot;1&amp;quot; domain=&amp;quot;only_an02&amp;quot; exclusive=&amp;quot;0&amp;quot; recovery=&amp;quot;restart&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 ref=&amp;quot;libvirtd&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;/script&amp;gt;&lt;br /&gt;
		&amp;lt;/service&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;&amp;lt;service ...&amp;gt;...&amp;lt;/service&amp;gt;&amp;lt;/span&amp;gt; elements have five attributes each;&lt;br /&gt;
* The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;name=&amp;quot;...&amp;quot;&amp;lt;/span&amp;gt; attribute is a unique name that will be used to identify the service, as we will see later.&lt;br /&gt;
* The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;autostart=&amp;quot;1&amp;quot;&amp;lt;/span&amp;gt; attribute tells the cluster that, when it starts, it should automatically start this service.&lt;br /&gt;
* The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;domain=&amp;quot;...&amp;quot;&amp;lt;/span&amp;gt; attribute tells the cluster which fail-over domain this service must run within. The two otherwise identical services each point to a different fail-over domain, as we discussed in the previous section.&lt;br /&gt;
* The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;exclusive=&amp;quot;0&amp;quot;&amp;lt;/span&amp;gt; attribute tells the cluster that a node running this service &#039;&#039;&#039;is&#039;&#039;&#039; allowed to to have other services running as well.&lt;br /&gt;
* The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;recovery=&amp;quot;restart&amp;quot;&amp;lt;/span&amp;gt; attribute sets the service recovery policy. As the name implies, the cluster will try to restart this service should it fail. Should the service fail multiple times in a row, it will be disabled. The exact number of failures allowed before disabling is configurable using the optional &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;max_restarts&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;restart_expire_time&amp;lt;/span&amp;gt; attributes, which are not covered here.&lt;br /&gt;
&lt;br /&gt;
{{warning|1=It is a fairly common mistake to interpret &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;exclusive&amp;lt;/span&amp;gt; to mean that a service is only allowed to run on one node at a time. This is not the case, please do not use this attribute incorrectly.}}&lt;br /&gt;
&lt;br /&gt;
Within each of the two &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;service ...&amp;gt;...&amp;lt;/service&amp;gt;&amp;lt;/span&amp;gt; attributes are four &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;script...&amp;gt;&amp;lt;/span&amp;gt; type resources. These are configured as a service tree in the order;&lt;br /&gt;
* &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; -&amp;gt; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;libvirtd&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Each of these &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;script ...&amp;gt;&amp;lt;/span&amp;gt; elements has just one attribute; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ref=&amp;quot;...&amp;quot;&amp;lt;/span&amp;gt; which points to a corresponding &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;script&amp;lt;/span&amp;gt; resource. &lt;br /&gt;
&lt;br /&gt;
The logic for this particular resource tree is;&lt;br /&gt;
* DRBD needs to start so that the bare clustered storage devices become available.&lt;br /&gt;
* Clustered LVM must next start so that the logical volumes used by GFS2 and our VMs become available.&lt;br /&gt;
* The GFS2 partition contains the [[XML]] definition files needed to start our virtual machines.&lt;br /&gt;
* Finally, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;libvirtd&amp;lt;/span&amp;gt; must be running for the virtual machines to be able to run. By putting this daemon in the resource tree, we can ensure that no attempt to start a VM will succeed until all of the clustered storage stack is available.&lt;br /&gt;
&lt;br /&gt;
From the other direction, we need the stop order to be organized in the reverse order.&lt;br /&gt;
* Stopping &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;libvirtd&amp;lt;/span&amp;gt; would cause any remaining running VMs to stop. If a VM is blocking, it will prevent &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;libvirtd&amp;lt;/span&amp;gt; from stopping and, thus, delay any of our other clustered storage resources from attempting to stop.&lt;br /&gt;
* We need the GFS2 partition to unmount after the VM goes down and before Clustered LVM map stop.&lt;br /&gt;
* With all VMs and the GFS2 partition stopped, we can safely say that all LVs are no longer in use and thus &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clvmd&amp;lt;/span&amp;gt; can stop.&lt;br /&gt;
* With Clustered LVM now stopped, nothing should be using our DRBD resources any more, so we can safely stop them, too.&lt;br /&gt;
&lt;br /&gt;
All in all, it&#039;s a surprisingly simple and effective configuration.&lt;br /&gt;
&lt;br /&gt;
== Validating And Pushing The Changes ==&lt;br /&gt;
&lt;br /&gt;
We&#039;ve made a big change, so it&#039;s all the more important that we validate the config before proceeding.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ccs_config_validate &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Configuration validates&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We need to now tell the cluster to use the new configuration file. Unlike last time, we won&#039;t use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rsync&amp;lt;/span&amp;gt;. Now that the cluster is up and running, we can use it to push out the updated configuration file using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman_tool&amp;lt;/span&amp;gt;. This is the first time we&#039;ve used the cluster to push out an updated &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cluster.conf&amp;lt;/span&amp;gt; file, so we will have to enter the password we set earlier for the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ricci&amp;lt;/span&amp;gt; user on both nodes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cman_tool version -r&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
You have not authenticated to the ricci daemon on an-node01.alteeve.com&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Password: &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
You have not authenticated to the ricci daemon on an-node02.alteeve.com&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Password: &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you were watching syslog, you will have seen an entries like the ones below.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Dec 14 20:39:08 an-node01 modcluster: Updating cluster.conf&lt;br /&gt;
Dec 14 20:39:12 an-node01 corosync[2360]:   [QUORUM] Members[2]: 1 2&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we can confirm that both nodes are using the new configuration by re-running the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman_tool version&amp;lt;/span&amp;gt; command, but without the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;-r&amp;lt;/span&amp;gt; switch.&lt;br /&gt;
&lt;br /&gt;
On &#039;&#039;&#039;both&#039;&#039;&#039;;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cman_tool version&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
6.2.0 config 10&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Checking The Cluster&#039;s Status ==&lt;br /&gt;
&lt;br /&gt;
Now let&#039;s look at a new tool; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clustat&amp;lt;/span&amp;gt;, &#039;&#039;&#039;clu&#039;&#039;&#039;ster &#039;&#039;&#039;stat&#039;&#039;&#039;us. We&#039;ll be using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clustat&amp;lt;/span&amp;gt; extensively from here on out to monitor the status of the cluster members and managed services. It does not manage the cluster in any way, it is simply a status tool. We&#039;ll see how &lt;br /&gt;
&lt;br /&gt;
Here is what it should look like when run from &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;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-cluster-A @ Wed Dec 14 20:45:04 2011&lt;br /&gt;
Member Status: Quorate&lt;br /&gt;
&lt;br /&gt;
 Member Name                             ID   Status&lt;br /&gt;
 ------ ----                             ---- ------&lt;br /&gt;
 an-node01.alteeve.com                       1 Online, Local&lt;br /&gt;
 an-node02.alteeve.com                       2 Online&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At this point, we&#039;re only running the foundation of the cluster, so we can only see which nodes are in the cluster. We&#039;ve added resources to the cluster configuration though, so it&#039;s time to start the resource layer as well, which is managed by the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; daemon. &lt;br /&gt;
&lt;br /&gt;
At this time, we&#039;re still starting the cluster manually after each node boots, so we&#039;re going to make sure that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; is disabled at boot.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
chkconfig rgmanager off&lt;br /&gt;
chkconfig --list rgmanager&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
rgmanager      	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;
Now let&#039;s start it. &lt;br /&gt;
&lt;br /&gt;
{{note|1=We&#039;ve configured the storage services to start automatically. When we start &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; now, it will start the storage resources, including DRBD. In turn, DRBD will stop up to five minutes and wait for its peer. This will cause the first node you start &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; on to appear to hang until the other node&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; has started DRBD as well.}}&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;
Now let&#039;s run &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clustat&amp;lt;/span&amp;gt; again, and see what&#039;s new.&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-cluster-A @ Wed Dec 14 20:52:11 2011&lt;br /&gt;
Member Status: Quorate&lt;br /&gt;
&lt;br /&gt;
 Member Name                             ID   Status&lt;br /&gt;
 ------ ----                             ---- ------&lt;br /&gt;
 an-node01.alteeve.com                       1 Online, Local, rgmanager&lt;br /&gt;
 an-node02.alteeve.com                       2 Online, rgmanager&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State         &lt;br /&gt;
 ------- ----                   ----- ------                   -----         &lt;br /&gt;
 service:storage_an01           an-node01.alteeve.com          started       &lt;br /&gt;
 service:storage_an02           an-node02.alteeve.com          started       &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
What we see are two section; The top section shows the cluster members and the lower part covers the managed resources. &lt;br /&gt;
&lt;br /&gt;
We can see that both members, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01.alteeve.com&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02.alteeve.com&amp;lt;/span&amp;gt; are &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Online&amp;lt;/span&amp;gt;, meaning that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt; is running and that they&#039;ve joined the cluster. It also shows us that both members are running &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt;. You will always see &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Local&amp;lt;/span&amp;gt; beside the name of the node you ran the actual &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clustat&amp;lt;/span&amp;gt; command from.&lt;br /&gt;
&lt;br /&gt;
Under the services, you can see the two new services we created with the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;service:&amp;lt;/span&amp;gt; prefix. We can see that each service is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;started&amp;lt;/span&amp;gt;, meaning that all four of the resources are up and running properly and which node each service is running on.&lt;br /&gt;
&lt;br /&gt;
Note that the two storage services are running, despite not having started them? That is because the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; service was started earlier. When we pushed out the updated configuration, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; saw the two new storage services had &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;autostart=&amp;quot;1&amp;quot;&amp;lt;/span&amp;gt; and started them. If you check your storage services now, you will see that they are all online.&lt;br /&gt;
&lt;br /&gt;
DRBD;&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;
version: 8.3.12 (api:88/proto:86-96)&lt;br /&gt;
GIT-hash: e2a8ef4656be026bbae540305fcb998a5991090f build by dag@Build64R6, 2011-11-20 10:57:03&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;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Clustered LVM;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
pvscan; vgscan; 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;
  PV /dev/drbd2   VG an02-vg0     lvm2 [201.25 GiB / 201.25 GiB free]&lt;br /&gt;
  PV /dev/drbd1   VG an01-vg0     lvm2 [201.62 GiB / 201.62 GiB free]&lt;br /&gt;
  PV /dev/drbd0   VG shared-vg0   lvm2 [18.61 GiB / 0    free]&lt;br /&gt;
  Total: 3 [421.48 GiB] / in use: 3 [421.48 GiB] / in no VG: 0 [0   ]&lt;br /&gt;
  Reading all physical volumes.  This may take a while...&lt;br /&gt;
  Found volume group &amp;quot;an02-vg0&amp;quot; using metadata type lvm2&lt;br /&gt;
  Found volume group &amp;quot;an01-vg0&amp;quot; using metadata type lvm2&lt;br /&gt;
  Found volume group &amp;quot;shared-vg0&amp;quot; using metadata type lvm2&lt;br /&gt;
  ACTIVE            &#039;/dev/shared-vg0/shared&#039; [18.61 GiB] inherit&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
GFS2;&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;
Configured GFS2 mountpoints: &lt;br /&gt;
/shared&lt;br /&gt;
Active GFS2 mountpoints: &lt;br /&gt;
/shared&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Nice, eh?&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;&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;
&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;
== Stopping Clustered Storage - A Preview To Cold-Stopping The Cluster ==&lt;br /&gt;
&lt;br /&gt;
To stop the storage services, we&#039;ll use the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; command line tool &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clusvcadm&amp;lt;/span&amp;gt;, the &#039;&#039;&#039;clu&#039;&#039;&#039;ster &#039;&#039;&#039;s&#039;&#039;&#039;er&#039;&#039;&#039;v&#039;&#039;&#039;i&#039;&#039;&#039;c&#039;&#039;&#039;e &#039;&#039;&#039;adm&#039;&#039;&#039;inistrator. Specifically, we&#039;ll use its &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;-d&amp;lt;/span&amp;gt; switch, which tells &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; to &#039;&#039;&#039;d&#039;&#039;&#039;isable the service.&lt;br /&gt;
&lt;br /&gt;
{{note|1=Services with the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;service:&amp;lt;/span&amp;gt; prefix can be called with their name alone. As we will see later, other services will need to have the service type prefix included.}}&lt;br /&gt;
&lt;br /&gt;
As always, confirm the current state of affairs before starting. On both nodes, run &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clustat&amp;lt;/span&amp;gt; to confirm that the storage services are up.&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-cluster-A @ Tue Dec 20 20:37:42 2011&lt;br /&gt;
Member Status: Quorate&lt;br /&gt;
&lt;br /&gt;
 Member Name                             ID   Status&lt;br /&gt;
 ------ ----                             ---- ------&lt;br /&gt;
 an-node01.alteeve.com                       1 Online, Local, rgmanager&lt;br /&gt;
 an-node02.alteeve.com                       2 Online, rgmanager&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State         &lt;br /&gt;
 ------- ----                   ----- ------                   -----         &lt;br /&gt;
 service:storage_an01           an-node01.alteeve.com          started       &lt;br /&gt;
 service:storage_an02           an-node02.alteeve.com          started       &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
They are, so now lets gracefully shut them down.&lt;br /&gt;
&lt;br /&gt;
On &#039;&#039;&#039;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;&#039;&#039;&#039;, run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
clusvcadm -d storage_an01&lt;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 service:storage_an01...Success&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If we now run &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clustat&amp;lt;/span&amp;gt; from either node, we should see this;&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-cluster-A @ Tue Dec 20 20:38:28 2011&lt;br /&gt;
Member Status: Quorate&lt;br /&gt;
&lt;br /&gt;
 Member Name                             ID   Status&lt;br /&gt;
 ------ ----                             ---- ------&lt;br /&gt;
 an-node01.alteeve.com                       1 Online, Local, rgmanager&lt;br /&gt;
 an-node02.alteeve.com                       2 Online, rgmanager&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State         &lt;br /&gt;
 ------- ----                   ----- ------                   -----         &lt;br /&gt;
 service:storage_an01           (an-node01.alteeve.com)        disabled      &lt;br /&gt;
 service:storage_an02           an-node02.alteeve.com          started       &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Notice how &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;service:storage_an01&amp;lt;/span&amp;gt; is now in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;disabled&amp;lt;/span&amp;gt; state? If you check the status of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;drbd&amp;lt;/span&amp;gt; now on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt; you will see that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt; is indeed down.&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.12 (api:88/proto:86-96)&lt;br /&gt;
GIT-hash: e2a8ef4656be026bbae540305fcb998a5991090f build by dag@Build64R6, 2011-11-20 10:57:03&lt;br /&gt;
m:res  cs            ro               ds                 p  mounted  fstype&lt;br /&gt;
0:r0   WFConnection  Primary/Unknown  UpToDate/Outdated  C&lt;br /&gt;
1:r1   WFConnection  Primary/Unknown  UpToDate/Outdated  C&lt;br /&gt;
2:r2   WFConnection  Primary/Unknown  UpToDate/Outdated  C&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you want to shut down the entire cluster, you will need to stop the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;storage_an02&amp;lt;/span&amp;gt; service as well. For fun, let&#039;s do this, but lets stop the service from &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
clusvcadm -d storage_an02&lt;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 service:storage_an02...Success&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now on both nodes, we should see this from &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-cluster-A @ Tue Dec 20 20:39: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-node01.alteeve.com                       1 Online, Local, rgmanager&lt;br /&gt;
 an-node02.alteeve.com                       2 Online, rgmanager&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State         &lt;br /&gt;
 ------- ----                   ----- ------                   -----         &lt;br /&gt;
 service:storage_an01           (an-node01.alteeve.com)        disabled      &lt;br /&gt;
 service:storage_an02           (an-node02.alteeve.com)        disabled      &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{warning|1=If you are not doing a cold shut-down of the cluster, you will want to skip this step and just stop &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt;. The reason is that the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;autostart=&amp;quot;1&amp;quot;&amp;lt;/span&amp;gt; value only gets evaluated when [[quorum]] is gained. If you disable the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;storage_anXX&amp;lt;/span&amp;gt; service and then reboot the node, the cluster has not lost quorum. Thus, when the node rejoins the cluster, the storage service &#039;&#039;&#039;will not&#039;&#039;&#039; automatically start.}}&lt;br /&gt;
&lt;br /&gt;
We can now, if we wanted to, stop the &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;cman&amp;lt;/span&amp;gt; daemons. This is, in fact, how we will cold-stop the cluster from now on.&lt;br /&gt;
&lt;br /&gt;
We&#039;ll cover cold stopping the cluster after we finish provisioning VMs.&lt;br /&gt;
&lt;br /&gt;
== Starting Clustered Storage ==&lt;br /&gt;
&lt;br /&gt;
Normally from now on, the clustered storage will start automatically. However, it&#039;s a good exercise to look at how to manually start them, just in case.&lt;br /&gt;
&lt;br /&gt;
The main difference from stopping the service is that we swap the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;-d&amp;lt;/span&amp;gt; switch for the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;-e&amp;lt;/span&amp;gt;, &#039;&#039;&#039;e&#039;&#039;&#039;nable, switch. We will also add the target cluster member name using the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;-m&amp;lt;/span&amp;gt; switch. We didn&#039;t need to use the member switch while stopping because the cluster could tell where the service was running and, thus, which member to contact to stop the service.&lt;br /&gt;
&lt;br /&gt;
Should you omit the member name, the cluster will try to use the local node as the target member. Note though that a target service will start on the node the command was issued on, regardless of the fail-over domain&#039;s ordered policy. That is to say, a service will not start on another node in the cluster when the member option is not specified, despite the fail-over configuration set to prefer another node.&lt;br /&gt;
&lt;br /&gt;
{{note|1=The storage services need to start at about the same time on both nodes. This is because the initially started storage service will hang when it tries to start &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;drbd&amp;lt;/span&amp;gt; until either the other node is up or until it times out. For this reason, be sure to have two terminal windows open to make then next two calls simultaneously.}}&lt;br /&gt;
&lt;br /&gt;
On &#039;&#039;&#039;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;&#039;&#039;&#039;, run;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
clusvcadm -e storage_an01 -m an-node01.alteeve.com&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Member an-node01.alteeve.com trying to enable service:storage_an01...Success&lt;br /&gt;
service:storage_an01 is now running on an-node01.alteeve.com&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On &#039;&#039;&#039;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt;&#039;&#039;&#039;, run;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
clusvcadm -e storage_an02 -m an-node02.alteeve.com&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Member an-node02.alteeve.com trying to enable service:storage_an02...Success&lt;br /&gt;
service:storage_an02 is now running on an-node02.alteeve.com&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; on either node should again show the storage services running again.&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-cluster-A @ Tue Dec 20 21:09:19 2011&lt;br /&gt;
Member Status: Quorate&lt;br /&gt;
&lt;br /&gt;
 Member Name                             ID   Status&lt;br /&gt;
 ------ ----                             ---- ------&lt;br /&gt;
 an-node01.alteeve.com                       1 Online, Local, rgmanager&lt;br /&gt;
 an-node02.alteeve.com                       2 Online, rgmanager&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State         &lt;br /&gt;
 ------- ----                   ----- ------                   -----         &lt;br /&gt;
 service:storage_an01           an-node01.alteeve.com          started       &lt;br /&gt;
 service:storage_an02           an-node02.alteeve.com          started       &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== A Note On Resource Management With DRBD ==&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 for &lt;br /&gt;
&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/drbd.d/global_common.conf&amp;lt;/span&amp;gt;&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;wfc-timeout&amp;lt;/span&amp;gt; seconds (&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;300&amp;lt;/span&amp;gt; in our case) 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;
If the clustered storage service ever fails, look in [[syslog]]&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/var/log/messages&amp;lt;/span&amp;gt; for a split-brain error. Look for a message 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-node01 kernel: block drbd2: helper command: /sbin/drbdadm initial-split-brain minor-2&lt;br /&gt;
Mar 29 20:24:37 an-node01 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-node01 kernel: block drbd2: Split-Brain detected but unresolved, dropping connection!&lt;br /&gt;
Mar 29 20:24:37 an-node01 kernel: block drbd2: helper command: /sbin/drbdadm split-brain minor-2&lt;br /&gt;
Mar 29 20:24:37 an-node01 kernel: block drbd2: helper command: /sbin/drbdadm split-brain minor-2 exit code 0 (0x0)&lt;br /&gt;
Mar 29 20:24:37 an-node01 kernel: block drbd2: conn( WFReportParams -&amp;gt; Disconnecting )&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With the fencing hook into the cluster, this should be a very hard problem to run into. If you do though, [http://linbit.com Linbit] has the authoritative guide to recover from this situation.&lt;br /&gt;
&lt;br /&gt;
* [http://www.drbd.org/users-guide-legacy/s-resolve-split-brain.html Manual split brain recovery]&lt;br /&gt;
&lt;br /&gt;
= Provisioning Virtual Machines =&lt;br /&gt;
&lt;br /&gt;
Now we&#039;re getting to the purpose of our cluster; Provision virtual machines!&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; Assign a collection of emulated hardware, connected to physical devices, to a given virtual machine and begin the process of installing the operating system on it. This tutorial is more about clustering than it is about virtual machine administration, so some experience with managing virtual machines has to be assumed. If you need to brush up, here are some resources;&lt;br /&gt;
&lt;br /&gt;
* [http://www.linux-kvm.org/page/HOWTO KVM project&#039;s How-Tos]&lt;br /&gt;
* [http://kvm.et.redhat.com/page/FAQ KVM project&#039;s FAQ]&lt;br /&gt;
* [http://docs.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/6/html/Hypervisor_Deployment_Guide/index.html Red Hat&#039;s Hypervisor Guide]&lt;br /&gt;
* [http://docs.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/6/html/Virtualization_Getting_Started_Guide/index.html Red Hat&#039;s Virtualization Guide]&lt;br /&gt;
* [http://docs.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/6/html/Virtualization_Administration_Guide/index.html Red Hat&#039;s Virtualization Administration]&lt;br /&gt;
* [http://docs.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/6/html/Virtualization_Host_Configuration_and_Guest_Installation_Guide/index.html Red Hat&#039;s Virtualization Host Configuration and Guest Installation Guide]&lt;br /&gt;
&lt;br /&gt;
When you feel comfortable, proceed.&lt;br /&gt;
&lt;br /&gt;
== Before We Begin - Setting Up Our Workstation ==&lt;br /&gt;
&lt;br /&gt;
The virtual machines are, for obvious reasons, headless. That is, they have no real video card into which we can plug a monitor and watch the progress of the install. This would, left unresolved, make it pretty hard to install the operating systems as there is simply no network in the early stages of most operating system installations.&lt;br /&gt;
&lt;br /&gt;
Part of the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;libvirtd&amp;lt;/span&amp;gt; package is a program called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-manager&amp;lt;/span&amp;gt; which is available on most all modern Linux distributions. This application makes it very easy to connect to our virtual machines, regardless of their network state.&lt;br /&gt;
&lt;br /&gt;
How you install this will depend on your workstation. &lt;br /&gt;
&lt;br /&gt;
On [[RPM]]-based systems, try:&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;
On [[deb]] based systems, try:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
apt-get install virt-manager&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On [[SUSE]]-based systems, try;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
zypper install virt-manager&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once it is installed, you need to determine whether your workstation is on the [[IFN]] or [[BCN]]. I&#039;ve got my laptop on the BCN, so I will connect to the nodes using just their short host names. If you&#039;re on the same IFN as the nodes, you will need to append &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;.ifn&amp;lt;/span&amp;gt; to the host names.&lt;br /&gt;
&lt;br /&gt;
[[Image:2n-RHEL6-KVM_virt-manager_01.png|thumb|448px|center|Initial installation of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-manager&amp;lt;/span&amp;gt;.]]&lt;br /&gt;
&lt;br /&gt;
To connect to the the cluster nodes;&lt;br /&gt;
&lt;br /&gt;
# Click on &#039;&#039;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;File&amp;lt;/span&amp;gt;&#039;&#039; -&amp;gt; &#039;&#039;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Add Connection...&amp;lt;/span&amp;gt;&#039;&#039;. &lt;br /&gt;
# Make sure that &#039;&#039;Hypervisor&#039;&#039; is set to &#039;&#039;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;QEMU/KVM&amp;lt;/span&amp;gt;&#039;&#039;.&lt;br /&gt;
# Click to check &#039;&#039;Connect to remote host&#039;&#039;.&lt;br /&gt;
# Make sure that &#039;&#039;Method&#039;&#039; is set to &#039;&#039;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;SSH/span&amp;gt;&#039;&#039;.&lt;br /&gt;
# Make sure that &#039;&#039;Username&#039;&#039; is set to &#039;&#039;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;root&amp;lt;/span&amp;gt;&#039;&#039;.&lt;br /&gt;
# Enter the &#039;&#039;Hostname&#039;&#039; using the proper entry from &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/hosts&amp;lt;/span&amp;gt; (ie: &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt; or &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01.ifn&amp;lt;/span&amp;gt;)&lt;br /&gt;
# Click on the button labelled &#039;&#039;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Connect&amp;lt;/span&amp;gt;&#039;&#039;.&lt;br /&gt;
# Repeat these steps for the other node.&lt;br /&gt;
&lt;br /&gt;
[[Image:2n-RHEL6-KVM_virt-manager_02.png|thumb|700px|center|New connection window.]]&lt;br /&gt;
&lt;br /&gt;
Once your two nodes have been added to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-manager&amp;lt;/span&amp;gt;, you should see both nodes as connected, but no VMs will be shown as we&#039;ve not yet provisioned any yet.&lt;br /&gt;
&lt;br /&gt;
[[Image:2n-RHEL6-KVM_virt-manager_03.png|thumb|448px|center|Two nodes added to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-manager&amp;lt;/span&amp;gt;.]]&lt;br /&gt;
&lt;br /&gt;
We&#039;ll come back to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-manager&amp;lt;/span&amp;gt; shortly.&lt;br /&gt;
&lt;br /&gt;
== Provision Planning ==&lt;br /&gt;
&lt;br /&gt;
Before we can start creating virtual machines, we need to take stock of what resources we have available and how we want to divy them out to the VMs.&lt;br /&gt;
&lt;br /&gt;
In my cluster, I&#039;ve got 200 [[GiB]] available on each of my two nodes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vgdisplay |grep -i -e free -e &amp;quot;vg name&amp;quot;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
  VG Name               an02-vg0&lt;br /&gt;
  Free  PE / Size       51521 / 201.25 GiB&lt;br /&gt;
  VG Name               an01-vg0&lt;br /&gt;
  Free  PE / Size       51615 / 201.62 GiB&lt;br /&gt;
  VG Name               shared-vg0&lt;br /&gt;
  Free  PE / Size       0 / 0   &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I know I have 8 [[GiB]] of memory, but I have to slice off a certain amount of that for the host [[OS]]. I&#039;ve got my nodes sitting about where they will be normally, so I can check how much memory is in use fairly easily.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cat /proc/meminfo |grep -e MemTotal -e MemFree&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
MemTotal:        8050312 kB&lt;br /&gt;
MemFree:         7432288 kB&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I&#039;m sitting about about 604 [[MiB]] used (&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;8,050,312 [[KiB]] - 7,432,288 KiB == 618,024 KiB / 1,024 == 603.54 MiB). I think I can safely operate within 1 [[GiB]], leaving me 7 GiB of RAM to allocate to VMs.&lt;br /&gt;
&lt;br /&gt;
Next up, I need to confirm how many CPU cores I have available.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cat /proc/cpuinfo |grep processor&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
processor	: 0&lt;br /&gt;
processor	: 1&lt;br /&gt;
processor	: 2&lt;br /&gt;
processor	: 3&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I&#039;ve got four, and I like to dedicate the first one to the host OS, so I&#039;ve got three to allocate to my VMs.&lt;br /&gt;
&lt;br /&gt;
On the network front, I know I&#039;ve got two bridges, one to the [[IFN]] and one to the [[BCN]]. &lt;br /&gt;
&lt;br /&gt;
So let&#039;s summarize:&lt;br /&gt;
* 400 GiB of space, 200 GiB per DRBD resource.&lt;br /&gt;
* 7 GiB of RAM.&lt;br /&gt;
* 3 CPU cores (can over-allocate).&lt;br /&gt;
* 1 network bridge, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vbr2&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
With this list in mind, we can now start planning out the VMs.&lt;br /&gt;
&lt;br /&gt;
The network can share the same [[subnet]] as the [[IFN]] if you wish, but I prefer to isolate my VMs from the IFN using a different subnet, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;10.254.0.0/16&amp;lt;/span&amp;gt;. This is, admittedly, &amp;quot;security by obscurity&amp;quot; and in no way is it a replacement for proper isolation. In production, you will want to setup firewalls on you nodes to prevent access from virtual machines.&lt;br /&gt;
&lt;br /&gt;
With that said, here is what we will install now. Obviously, you will have other needs and goals. Mine is an admittedly artificial network.&lt;br /&gt;
* A development server. This would be used for testing, so it will have more modest resources.&lt;br /&gt;
* A web server, which will mainly use a DB server, so will need CPU and RAM, but not much disk. &lt;br /&gt;
* A database server. &lt;br /&gt;
* A windows server. I don&#039;t exactly have a use for it, except to show how to install a Windows VM for those who do need it.&lt;br /&gt;
&lt;br /&gt;
Now to divvy up the resources;&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!VM&lt;br /&gt;
!Name&lt;br /&gt;
!Primary Host&lt;br /&gt;
!Disk&lt;br /&gt;
!CPU&lt;br /&gt;
!RAM&lt;br /&gt;
![[IFN]]&lt;br /&gt;
!OS&lt;br /&gt;
|-&lt;br /&gt;
|Dev Server&lt;br /&gt;
|class=&amp;quot;code&amp;quot;|vm0001-dev&lt;br /&gt;
|class=&amp;quot;code&amp;quot;|an-node01&lt;br /&gt;
|150 [[GiB]]&lt;br /&gt;
|1 [[GiB]]&lt;br /&gt;
|2 core&lt;br /&gt;
|class=&amp;quot;code&amp;quot;|10.254.0.1/16&lt;br /&gt;
|CentOS 6&lt;br /&gt;
|-&lt;br /&gt;
|Web Server&lt;br /&gt;
|class=&amp;quot;code&amp;quot;|vm0002-web&lt;br /&gt;
|class=&amp;quot;code&amp;quot;|an-node01&lt;br /&gt;
|50 [[GiB]]&lt;br /&gt;
|2 [[GiB]]&lt;br /&gt;
|2 cores&lt;br /&gt;
|class=&amp;quot;code&amp;quot;|10.254.0.2/16&lt;br /&gt;
|CentOS 6&lt;br /&gt;
|-&lt;br /&gt;
|Database Server&lt;br /&gt;
|class=&amp;quot;code&amp;quot;|vm0003-db&lt;br /&gt;
|class=&amp;quot;code&amp;quot;|an-node02&lt;br /&gt;
|100 [[GiB]]&lt;br /&gt;
|2 [[GiB]]&lt;br /&gt;
|2 cores&lt;br /&gt;
|class=&amp;quot;code&amp;quot;|10.254.0.3/16&lt;br /&gt;
|CentOS 6&lt;br /&gt;
|-&lt;br /&gt;
|Web Server&lt;br /&gt;
|class=&amp;quot;code&amp;quot;|vm0004-ms&lt;br /&gt;
|class=&amp;quot;code&amp;quot;|an-node02&lt;br /&gt;
|100 [[GiB]]&lt;br /&gt;
|2 [[GiB]]&lt;br /&gt;
|2 cores&lt;br /&gt;
|class=&amp;quot;code&amp;quot;|10.254.0.4/16&lt;br /&gt;
|Windows Server 2008 R2 64-bit&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Notice that we&#039;ve over-allocated the CPU cores? This is ok. We&#039;re going to restrict the VMs to CPU cores number 1 through 3, leaving core number 0 for the host OS. When all of the VMs are running on one node, the hypervisor&#039;s scheduler will handle shuffling jobs from the VMs&#039; cores to the real cores that are least loaded at a given time. &lt;br /&gt;
&lt;br /&gt;
As for the RAM though, we can not use more than we have. We&#039;re going to leave 1 [[GiB]] for the host, so we&#039;ll divvy the remaining 7 GiB between the VMs. Remember, we have to plan for when all four VMs will run on just one node.&lt;br /&gt;
&lt;br /&gt;
==== A Note on VM Configuration ====&lt;br /&gt;
&lt;br /&gt;
It would be a questionably valueable divertion to cover the setup of each VM. It will be up to you, reader, to setup each VM however you like.&lt;br /&gt;
&lt;br /&gt;
=== Provisioning vm0001-dev ===&lt;br /&gt;
&lt;br /&gt;
{{note|1=We&#039;re going to spend a lot more time on this first VM, so bear with me here, even if you aren&#039;t interested in creating a VM like this.}}&lt;br /&gt;
&lt;br /&gt;
Before we can provision, we need to gather whatever install source we&#039;ll need for the VM. This can be a simple [[ISO]] file, as we&#039;ll see on the [[2-Node Red Hat KVM Cluster Tutorial#Provisioning vm0001-dev|windows install]] later, or it can be files on a web server, which we&#039;ll use here. We&#039;ll also need to create the &amp;quot;hard drive&amp;quot; for the VM, which will be a new [[LV]]. Finally, we&#039;ll craft the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-install&amp;lt;/span&amp;gt; command which will begin the actual OS install.&lt;br /&gt;
&lt;br /&gt;
This being a Linux machine, we can provision this using a network. Conveniently, I&#039;ve got a [[Setting Up a PXE Server on an RPM-based OS|PXE server]] setup with the CentOS install files available on my local network at &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;http://10.255.255.254/c6/x86_64/img/&amp;lt;/nowiki&amp;gt;&amp;lt;/span&amp;gt;. You don&#039;t need to have a full [[PXE]] server setup, mounting the install [[ISO]] and pointing a web server at the mounted directory would work just fine. I&#039;m also going to further customize my install by using a [[kickstart]] file which, effectively, pre-answers the installation questions so that the install is fully automated.&lt;br /&gt;
&lt;br /&gt;
So, let&#039;s create the new [[LV]]. I know that this machine will be primarily run on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt; and that it will be 150 [[GiB]]. I personally always name the [[LV]]s as &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vmXXXX-Y&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 VM&#039;s name and the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Y&amp;lt;/span&amp;gt; is a simple integer. You are obviously free to use whatever makes most sense to you.&lt;br /&gt;
&lt;br /&gt;
==== Creating vm0001-dev&#039;s Storage ====&lt;br /&gt;
&lt;br /&gt;
With that, the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;lvcreate&amp;lt;/span&amp;gt; call is;&lt;br /&gt;
&lt;br /&gt;
On &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&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;
lvcreate -L 150G -n vm0001-1 /dev/an01-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;
==== Creating vm0001-dev&#039;s virt-install Call ====&lt;br /&gt;
&lt;br /&gt;
Now with the storage created, we can craft the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-install&amp;lt;/span&amp;gt; command. I like to put this into a file under the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/shared/provision/&amp;lt;/span&amp;gt; directory for future reference. Let&#039;s take a look at the command, then we&#039;ll discuss what the switches are for.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
touch /shared/provision/vm0001-dev.sh&lt;br /&gt;
chmod 755 /shared/provision/vm0001-dev.sh &lt;br /&gt;
vim /shared/provision/vm0001-dev.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;
virt-install --connect qemu:///system \&lt;br /&gt;
  --name vm0001-dev \&lt;br /&gt;
  --ram 1024 \&lt;br /&gt;
  --arch x86_64 \&lt;br /&gt;
  --vcpus 1 \&lt;br /&gt;
  --location http://10.255.255.254/c6/x86_64/img/ \&lt;br /&gt;
  --extra-args &amp;quot;ks=http://10.255.255.254/c6/x86_64/ks/c6_minimal.ks&amp;quot; \&lt;br /&gt;
  --os-type linux \&lt;br /&gt;
  --os-variant rhel6 \&lt;br /&gt;
  --disk path=/dev/an01-vg0/vm0001-1 \&lt;br /&gt;
  --network bridge=vbr2 \&lt;br /&gt;
  --vnc&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{note|1=Don&#039;t use tabs to indent the lines.}}&lt;br /&gt;
&lt;br /&gt;
Let&#039;s break it down;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--connect qemu:///system&amp;lt;/span&amp;gt;&lt;br /&gt;
This tells &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-install&amp;lt;/span&amp;gt; to use the [[QEMU]] hardware emulator (as opposed to [[Xen]]) and to install the VM on to local system.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--name vm0001-dev&amp;lt;/span&amp;gt;&lt;br /&gt;
This sets the name of the VM. It is the name we will use in the cluster configuration and whenever we use the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;libvirtd&amp;lt;/span&amp;gt; tools, like &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virsh&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--ram 1024&amp;lt;/span&amp;gt;&lt;br /&gt;
This sets the amount of RAM, in [[MiB]], to allocate to this VM. Here, we&#039;re allocating 1 [[GiB]] (1,024 MiB).&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--arch x86_64&amp;lt;/span&amp;gt;&lt;br /&gt;
This sets the emulated CPU&#039;s architecture to 64-[[bit]]. This can be used even when you plan to install a 32-bit [[OS]], but not the other way around, of course.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--vcpus 1&amp;lt;/span&amp;gt;&lt;br /&gt;
This sets the number of CPU cores to allocate to this VM. Here, we&#039;re setting just one.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--location &amp;lt;nowiki&amp;gt;http://10.255255.254/c6/x86_64/img/&amp;lt;/nowiki&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
This tells &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-install&amp;lt;/span&amp;gt; to pull the installation files from the [[URL]] specified.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--extra-args &amp;quot;ks=&amp;lt;nowiki&amp;gt;http://10.255.255.254/c6/x86_64/ks/c6_minimal.ks&amp;lt;/nowiki&amp;gt;&amp;quot;&amp;lt;/span&amp;gt;&lt;br /&gt;
This is an optional command used to pass the install kernel arguments. Here, I&#039;m using it to tell the kernel to grab the specified kickstart file for use during the installation.&lt;br /&gt;
&lt;br /&gt;
{{note|1=If you want to copy the kickstart script used in this tutorial, you can [[File c6_minimal.ks|find it here]].}}&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--os-type linux&amp;lt;/span&amp;gt;&lt;br /&gt;
This broadly sets hardware emulation for optimal use with Linux-based virtual machines.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--os-variant rhel6&amp;lt;/span&amp;gt;&lt;br /&gt;
This further refines tweaks to the hardware emulation to maximize performance for [[RHEL]]6 (and derivative) installs.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--disk path=/dev/an01-vg0/vm0001-1&amp;lt;/span&amp;gt;&lt;br /&gt;
This tells the installer to use the [[LV]] we created earlier as the backing storage device for the new virtual machine.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--network bridge=vbr2&amp;lt;/span&amp;gt;&lt;br /&gt;
This tells the installer to create a network card in the VM and to then connect it to the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vbr2&amp;lt;/span&amp;gt; bridge, thus connecting the VM to the [[IFN]]. Optionally, you could add &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;,model=e1000&amp;lt;/span&amp;gt; option to tells the emulator to mimic an [[Intel]] &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;e1000&amp;lt;/span&amp;gt; hardware NIC. The default is to use the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[virtio]]&amp;lt;/span&amp;gt; virtualized network card. If you have two or more bridges, you can repeat the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--network&amp;lt;/span&amp;gt; switch as many times as you need.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--vnc&amp;lt;/span&amp;gt;&lt;br /&gt;
This tells &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-manager&amp;lt;/span&amp;gt; to create a [[VNC]] server on the VM and, if possible, immediately connect it the just-provisioned VM. With a minimal install on the nodes, the automatically spawned client will fail. This is fine, just use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-manager&amp;lt;/span&amp;gt; from my workstation.&lt;br /&gt;
&lt;br /&gt;
{{note|1=If you close the initial VNC window and want to reconnect to the VM, you can simply open up &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-manager&amp;lt;/span&amp;gt;, connect to the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt; host if needed, and double-click on the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0001-dev&amp;lt;/span&amp;gt; entry. This will effectively &amp;quot;plug a monitor into the VM&amp;quot;.}}&lt;br /&gt;
&lt;br /&gt;
==== Initializing vm0001-dev&#039;s Install ====&lt;br /&gt;
&lt;br /&gt;
Well, time to start the install!&lt;br /&gt;
&lt;br /&gt;
On &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&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;
/shared/provision/vm0001-dev.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;
Starting install...&lt;br /&gt;
Retrieving file .treeinfo...                             |  676 B     00:00 ... &lt;br /&gt;
Retrieving file vmlinuz...                               | 7.5 MB     00:00 ... &lt;br /&gt;
Retrieving file initrd.img...                            |  59 MB     00:02 ... &lt;br /&gt;
Creating domain...                                       |    0 B     00:00     &lt;br /&gt;
WARNING  Unable to connect to graphical console: virt-viewer not installed. Please install the &#039;virt-viewer&#039; package.&lt;br /&gt;
Domain installation still in progress. You can reconnect to &lt;br /&gt;
the console to complete the installation process.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And it&#039;s off!&lt;br /&gt;
&lt;br /&gt;
[[Image:2n-RHEL6-KVM_vm0001_provision_01.png|thumb|700px|center|Initial provision of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0001-dev&amp;lt;/span&amp;gt;.]]&lt;br /&gt;
&lt;br /&gt;
Progressing nicely.&lt;br /&gt;
&lt;br /&gt;
[[Image:2n-RHEL6-KVM_vm0001_provision_02.png|thumb|700px|center|Installation of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0001-dev&amp;lt;/span&amp;gt; proceeding as expected.]]&lt;br /&gt;
&lt;br /&gt;
And done! Note that, depending on your kickstart file, it may have automatically rebooted or you may need to reboot manually.&lt;br /&gt;
&lt;br /&gt;
{{note|1=I&#039;ve found that there are occassions where the VM will power off instead of rebooting. With &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-manager&amp;lt;/span&amp;gt;, you can click to select the new VM and then press the &amp;quot;play&amp;quot; button to boot the VM manually.}}&lt;br /&gt;
&lt;br /&gt;
[[Image:2n-RHEL6-KVM_vm0001_provision_03.png|thumb|700px|center|Installation of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0001-dev&amp;lt;/span&amp;gt; complete.]]&lt;br /&gt;
&lt;br /&gt;
==== Defining vm0001-dev On an-node02 ====&lt;br /&gt;
&lt;br /&gt;
We can use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virsh&amp;lt;/span&amp;gt; to see that the new virtual machine exists and what state it is in. Note that I&#039;ve gotten into the habit of using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--all&amp;lt;/span&amp;gt; to get around &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virsh&amp;lt;/span&amp;gt;&#039;s default behaviour of hiding VMs that are off.&lt;br /&gt;
&lt;br /&gt;
On &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;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;
  2 vm0001-dev           running&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;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;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As we see, the new &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0001-dev&amp;lt;/span&amp;gt; is only known to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;. This is, in and of itself, just fine.&lt;br /&gt;
&lt;br /&gt;
We&#039;re going to need to put the virtual machine&#039;s [[XML]] definition file in a common place accessible on both nodes. This could be matching but separate directories on either node, or it can be a common shared location. As we&#039;ve got the cluster&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/shared&amp;lt;/span&amp;gt; GFS2 partition, we&#039;re going to use the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/shared/definitions&amp;lt;/span&amp;gt; directory we create earlier. This avoids the need to remember to keep two copies of the file in sync across both nodes.&lt;br /&gt;
&lt;br /&gt;
To backup the VM&#039;s configuration, we&#039;ll again use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virsh&amp;lt;/span&amp;gt;, but this time with the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;dumpxml&amp;lt;/span&amp;gt; command.&lt;br /&gt;
&lt;br /&gt;
On &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;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 dumpxml vm0001-dev &amp;gt; /shared/definitions/vm0001-dev.xml&lt;br /&gt;
cat /shared/definitions/vm0001-dev.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;kvm&#039; id=&#039;2&#039;&amp;gt;&lt;br /&gt;
  &amp;lt;name&amp;gt;vm0001-dev&amp;lt;/name&amp;gt;&lt;br /&gt;
  &amp;lt;uuid&amp;gt;2512b2dd-a1a8-f990-2a0d-6c41968ab3f8&amp;lt;/uuid&amp;gt;&lt;br /&gt;
  &amp;lt;memory&amp;gt;1048576&amp;lt;/memory&amp;gt;&lt;br /&gt;
  &amp;lt;currentMemory&amp;gt;1048576&amp;lt;/currentMemory&amp;gt;&lt;br /&gt;
  &amp;lt;vcpu&amp;gt;1&amp;lt;/vcpu&amp;gt;&lt;br /&gt;
  &amp;lt;os&amp;gt;&lt;br /&gt;
    &amp;lt;type arch=&#039;x86_64&#039; machine=&#039;rhel6.2.0&#039;&amp;gt;hvm&amp;lt;/type&amp;gt;&lt;br /&gt;
    &amp;lt;boot dev=&#039;network&#039;/&amp;gt;&lt;br /&gt;
    &amp;lt;boot dev=&#039;cdrom&#039;/&amp;gt;&lt;br /&gt;
    &amp;lt;boot dev=&#039;hd&#039;/&amp;gt;&lt;br /&gt;
    &amp;lt;bootmenu enable=&#039;yes&#039;/&amp;gt;&lt;br /&gt;
  &amp;lt;/os&amp;gt;&lt;br /&gt;
  &amp;lt;features&amp;gt;&lt;br /&gt;
    &amp;lt;acpi/&amp;gt;&lt;br /&gt;
    &amp;lt;apic/&amp;gt;&lt;br /&gt;
    &amp;lt;pae/&amp;gt;&lt;br /&gt;
  &amp;lt;/features&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;emulator&amp;gt;/usr/libexec/qemu-kvm&amp;lt;/emulator&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;qemu&#039; type=&#039;raw&#039; cache=&#039;none&#039; io=&#039;native&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;source dev=&#039;/dev/an01-vg0/vm0001-1&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;target dev=&#039;vda&#039; bus=&#039;virtio&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;alias name=&#039;virtio-disk0&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;address type=&#039;pci&#039; domain=&#039;0x0000&#039; bus=&#039;0x00&#039; slot=&#039;0x04&#039; function=&#039;0x0&#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;52:54:00:9b:3c:f7&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;source bridge=&#039;vbr2&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;target dev=&#039;vnet0&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;model type=&#039;virtio&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;alias name=&#039;net0&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;address type=&#039;pci&#039; domain=&#039;0x0000&#039; bus=&#039;0x00&#039; slot=&#039;0x03&#039; function=&#039;0x0&#039;/&amp;gt;&lt;br /&gt;
    &amp;lt;/interface&amp;gt;&lt;br /&gt;
    &amp;lt;serial type=&#039;pty&#039;&amp;gt;&lt;br /&gt;
      &amp;lt;source path=&#039;/dev/pts/2&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;target port=&#039;0&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;alias name=&#039;serial0&#039;/&amp;gt;&lt;br /&gt;
    &amp;lt;/serial&amp;gt;&lt;br /&gt;
    &amp;lt;console type=&#039;pty&#039; tty=&#039;/dev/pts/2&#039;&amp;gt;&lt;br /&gt;
      &amp;lt;source path=&#039;/dev/pts/2&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;target type=&#039;serial&#039; port=&#039;0&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;alias name=&#039;serial0&#039;/&amp;gt;&lt;br /&gt;
    &amp;lt;/console&amp;gt;&lt;br /&gt;
    &amp;lt;input type=&#039;tablet&#039; bus=&#039;usb&#039;&amp;gt;&lt;br /&gt;
      &amp;lt;alias name=&#039;input0&#039;/&amp;gt;&lt;br /&gt;
    &amp;lt;/input&amp;gt;&lt;br /&gt;
    &amp;lt;input type=&#039;mouse&#039; bus=&#039;ps2&#039;/&amp;gt;&lt;br /&gt;
    &amp;lt;graphics type=&#039;vnc&#039; port=&#039;5900&#039; autoport=&#039;yes&#039;/&amp;gt;&lt;br /&gt;
    &amp;lt;video&amp;gt;&lt;br /&gt;
      &amp;lt;model type=&#039;cirrus&#039; vram=&#039;9216&#039; heads=&#039;1&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;alias name=&#039;video0&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;address type=&#039;pci&#039; domain=&#039;0x0000&#039; bus=&#039;0x00&#039; slot=&#039;0x02&#039; function=&#039;0x0&#039;/&amp;gt;&lt;br /&gt;
    &amp;lt;/video&amp;gt;&lt;br /&gt;
    &amp;lt;memballoon model=&#039;virtio&#039;&amp;gt;&lt;br /&gt;
      &amp;lt;alias name=&#039;balloon0&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;address type=&#039;pci&#039; domain=&#039;0x0000&#039; bus=&#039;0x00&#039; slot=&#039;0x05&#039; function=&#039;0x0&#039;/&amp;gt;&lt;br /&gt;
    &amp;lt;/memballoon&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;
There we go; That is the emulated hardware on which your virtual machine exists. Pretty neat, eh?&lt;br /&gt;
&lt;br /&gt;
I like to keep all of my VMs defined on all of my nodes. This is entirely optional, as the cluster will define the VM on a target node when needed. It is, though, a good chance to examine how this is done manually.&lt;br /&gt;
&lt;br /&gt;
On &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;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 /shared/definitions/vm0001-dev.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-dev defined from /shared/definitions/vm0001-dev.xml&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can confirm that it now exists by re-running &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virsh list --all&amp;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;
  - vm0001-dev           shut off&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You should also now be able to see &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0001-dev&amp;lt;/span&amp;gt; under &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt; in your &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-manager&amp;lt;/span&amp;gt; window. It will be listed as &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;shutoff&amp;lt;/span&amp;gt;, which is expected. &#039;&#039;&#039;Do not&#039;&#039;&#039; try to turn it on while it&#039;s running on the other node!&lt;br /&gt;
&lt;br /&gt;
=== Provisioning vm0002-web ===&lt;br /&gt;
&lt;br /&gt;
This installation will be pretty much the same as it was for &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0001-dev&amp;lt;/span&amp;gt;, so we&#039;ll look mainly at the differences.&lt;br /&gt;
&lt;br /&gt;
==== Creating vm0002-web&#039;s Storage ====&lt;br /&gt;
&lt;br /&gt;
We&#039;ll use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;lvcreate&amp;lt;/span&amp;gt; again, but this time we won&#039;t specify a specific size, but instead a percentage of the remainin free space will be defined. Note that the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;-L&amp;lt;/span&amp;gt; switch changes to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;-l&amp;lt;/span&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
On &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&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;
lvcreate -l 100%FREE -n vm0002-1 /dev/an01-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;
==== Creating vm0002-web&#039;s virt-install Call ====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-install&amp;lt;/span&amp;gt; command will be quite similar to the previous one.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
touch /shared/provision/vm0002-web.sh&lt;br /&gt;
chmod 755 /shared/provision/vm0002-web.sh &lt;br /&gt;
vim /shared/provision/vm0002-web.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;
virt-install --connect qemu:///system \&lt;br /&gt;
  --name vm0002-web \&lt;br /&gt;
  --ram 2048 \&lt;br /&gt;
  --arch x86_64 \&lt;br /&gt;
  --vcpus 2 \&lt;br /&gt;
  --location http://10.255.255.254/c6/x86_64/img/ \&lt;br /&gt;
  --extra-args &amp;quot;ks=http://10.255.255.254/c6/x86_64/ks/c6_minimal.ks&amp;quot; \&lt;br /&gt;
  --os-type linux \&lt;br /&gt;
  --os-variant rhel6 \&lt;br /&gt;
  --disk path=/dev/an01-vg0/vm0002-1 \&lt;br /&gt;
  --network bridge=vbr2 \&lt;br /&gt;
  --vnc&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Lets look at the differences;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--name vm0002-web&amp;lt;/span&amp;gt;; This sets the new name of the VM.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--ram 2048&amp;lt;/span&amp;gt;; This doubles the amount of RAM to 2048 [[MiB]].&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--vcpus 2&amp;lt;/span&amp;gt;; This sets the number of CPU cores to two.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--disk path=/dev/an01-vg0/vm0002-1&amp;lt;/span&amp;gt;; The path to the new LV is set.&lt;br /&gt;
&lt;br /&gt;
Note that the same kickstart file from before is used. This is fine as it doesn&#039;t specify a specific IP address and it is smart enough to adapt to the new virtual disk size.&lt;br /&gt;
&lt;br /&gt;
==== Initializing vm0002-web&#039;s Install ====&lt;br /&gt;
&lt;br /&gt;
Well, time to start the install!&lt;br /&gt;
&lt;br /&gt;
On &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&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;
/shared/provision/vm0002-web.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;
Starting install...&lt;br /&gt;
Retrieving file .treeinfo...                             |  676 B     00:00 ... &lt;br /&gt;
Retrieving file vmlinuz...                               | 7.5 MB     00:00 ... &lt;br /&gt;
Retrieving file initrd.img...                            |  59 MB     00:02 ... &lt;br /&gt;
Creating domain...                                       |    0 B     00:00     &lt;br /&gt;
WARNING  Unable to connect to graphical console: virt-viewer not installed. Please install the &#039;virt-viewer&#039; package.&lt;br /&gt;
Domain installation still in progress. You can reconnect to &lt;br /&gt;
the console to complete the installation process.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The install should proceed more or less the same as it did for &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0001-dev&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==== Defining vm0002-web On an-node02 ====&lt;br /&gt;
&lt;br /&gt;
We can use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virsh&amp;lt;/span&amp;gt; to see that the new virtual machine exists and what state it is in. Note that I&#039;ve gotten into the habit of using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--all&amp;lt;/span&amp;gt; to get around &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virsh&amp;lt;/span&amp;gt;&#039;s default behaviour of hiding VMs that are off.&lt;br /&gt;
&lt;br /&gt;
On &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;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;
  2 vm0001-dev           running&lt;br /&gt;
  4 vm0002-web           running&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;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;
  - vm0001-dev           shut off&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As before, the new &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0002-web&amp;lt;/span&amp;gt; is only known to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
On &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;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 dumpxml vm0002-web &amp;gt; /shared/definitions/vm0002-web.xml&lt;br /&gt;
cat /shared/definitions/vm0002-web.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;kvm&#039; id=&#039;4&#039;&amp;gt;&lt;br /&gt;
  &amp;lt;name&amp;gt;vm0002-web&amp;lt;/name&amp;gt;&lt;br /&gt;
  &amp;lt;uuid&amp;gt;02f967ab-103f-c276-c40f-9eaa47339df4&amp;lt;/uuid&amp;gt;&lt;br /&gt;
  &amp;lt;memory&amp;gt;2097152&amp;lt;/memory&amp;gt;&lt;br /&gt;
  &amp;lt;currentMemory&amp;gt;2097152&amp;lt;/currentMemory&amp;gt;&lt;br /&gt;
  &amp;lt;vcpu&amp;gt;2&amp;lt;/vcpu&amp;gt;&lt;br /&gt;
  &amp;lt;os&amp;gt;&lt;br /&gt;
    &amp;lt;type arch=&#039;x86_64&#039; machine=&#039;rhel6.2.0&#039;&amp;gt;hvm&amp;lt;/type&amp;gt;&lt;br /&gt;
    &amp;lt;boot dev=&#039;hd&#039;/&amp;gt;&lt;br /&gt;
  &amp;lt;/os&amp;gt;&lt;br /&gt;
  &amp;lt;features&amp;gt;&lt;br /&gt;
    &amp;lt;acpi/&amp;gt;&lt;br /&gt;
    &amp;lt;apic/&amp;gt;&lt;br /&gt;
    &amp;lt;pae/&amp;gt;&lt;br /&gt;
  &amp;lt;/features&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;emulator&amp;gt;/usr/libexec/qemu-kvm&amp;lt;/emulator&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;qemu&#039; type=&#039;raw&#039; cache=&#039;none&#039; io=&#039;native&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;source dev=&#039;/dev/an01-vg0/vm0002-1&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;target dev=&#039;vda&#039; bus=&#039;virtio&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;alias name=&#039;virtio-disk0&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;address type=&#039;pci&#039; domain=&#039;0x0000&#039; bus=&#039;0x00&#039; slot=&#039;0x04&#039; function=&#039;0x0&#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;52:54:00:65:39:60&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;source bridge=&#039;vbr2&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;target dev=&#039;vnet1&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;model type=&#039;virtio&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;alias name=&#039;net0&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;address type=&#039;pci&#039; domain=&#039;0x0000&#039; bus=&#039;0x00&#039; slot=&#039;0x03&#039; function=&#039;0x0&#039;/&amp;gt;&lt;br /&gt;
    &amp;lt;/interface&amp;gt;&lt;br /&gt;
    &amp;lt;serial type=&#039;pty&#039;&amp;gt;&lt;br /&gt;
      &amp;lt;source path=&#039;/dev/pts/3&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;target port=&#039;0&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;alias name=&#039;serial0&#039;/&amp;gt;&lt;br /&gt;
    &amp;lt;/serial&amp;gt;&lt;br /&gt;
    &amp;lt;console type=&#039;pty&#039; tty=&#039;/dev/pts/3&#039;&amp;gt;&lt;br /&gt;
      &amp;lt;source path=&#039;/dev/pts/3&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;target type=&#039;serial&#039; port=&#039;0&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;alias name=&#039;serial0&#039;/&amp;gt;&lt;br /&gt;
    &amp;lt;/console&amp;gt;&lt;br /&gt;
    &amp;lt;input type=&#039;tablet&#039; bus=&#039;usb&#039;&amp;gt;&lt;br /&gt;
      &amp;lt;alias name=&#039;input0&#039;/&amp;gt;&lt;br /&gt;
    &amp;lt;/input&amp;gt;&lt;br /&gt;
    &amp;lt;input type=&#039;mouse&#039; bus=&#039;ps2&#039;/&amp;gt;&lt;br /&gt;
    &amp;lt;graphics type=&#039;vnc&#039; port=&#039;5901&#039; autoport=&#039;yes&#039;/&amp;gt;&lt;br /&gt;
    &amp;lt;video&amp;gt;&lt;br /&gt;
      &amp;lt;model type=&#039;cirrus&#039; vram=&#039;9216&#039; heads=&#039;1&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;alias name=&#039;video0&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;address type=&#039;pci&#039; domain=&#039;0x0000&#039; bus=&#039;0x00&#039; slot=&#039;0x02&#039; function=&#039;0x0&#039;/&amp;gt;&lt;br /&gt;
    &amp;lt;/video&amp;gt;&lt;br /&gt;
    &amp;lt;memballoon model=&#039;virtio&#039;&amp;gt;&lt;br /&gt;
      &amp;lt;alias name=&#039;balloon0&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;address type=&#039;pci&#039; domain=&#039;0x0000&#039; bus=&#039;0x00&#039; slot=&#039;0x05&#039; function=&#039;0x0&#039;/&amp;gt;&lt;br /&gt;
    &amp;lt;/memballoon&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;
There we go; That is the emulated hardware on which your virtual machine exists. Pretty neat, eh?&lt;br /&gt;
&lt;br /&gt;
I like to keep all of my VMs defined on all of my nodes. This is entirely optional, as the cluster will define the VM on a target node when needed. It is, though, a good chance to examine how this is done manually.&lt;br /&gt;
&lt;br /&gt;
On &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;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 /shared/definitions/vm0002-web.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-web defined from /shared/definitions/vm0002-web.xml&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can confirm that it now exists by re-running &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virsh list --all&amp;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;
  - vm0001-dev           shut off&lt;br /&gt;
  - vm0002-web           shut off&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Provisioning vm0003-db ===&lt;br /&gt;
&lt;br /&gt;
This installation will, again, be pretty much the same as it was for &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0001-dev&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0002-web&amp;lt;/span&amp;gt;, so we&#039;ll again look mainly at the differences.&lt;br /&gt;
&lt;br /&gt;
==== Creating vm0003-db&#039;s Storage ====&lt;br /&gt;
&lt;br /&gt;
We&#039;ll use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;lvcreate&amp;lt;/span&amp;gt; again, but being the first [[LV]] on the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an02-vg0&amp;lt;/span&amp;gt;, we&#039;ll specify the specific size again.&lt;br /&gt;
&lt;br /&gt;
On &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&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;
lvcreate -L 100G -n vm0003-1 /dev/an02-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;vm0003-1&amp;quot; created&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Creating vm0003-db&#039;s virt-install Call ====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-install&amp;lt;/span&amp;gt; command will be quite similar to the previous one.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
touch /shared/provision/vm0003-db.sh&lt;br /&gt;
chmod 755 /shared/provision/vm0003-db.sh &lt;br /&gt;
vim /shared/provision/vm0003-db.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;
virt-install --connect qemu:///system \&lt;br /&gt;
  --name vm0003-db \&lt;br /&gt;
  --ram 2048 \&lt;br /&gt;
  --arch x86_64 \&lt;br /&gt;
  --vcpus 2 \&lt;br /&gt;
  --location http://10.255.255.254/c6/x86_64/img/ \&lt;br /&gt;
  --extra-args &amp;quot;ks=http://10.255.255.254/c6/x86_64/ks/c6_minimal.ks&amp;quot; \&lt;br /&gt;
  --os-type linux \&lt;br /&gt;
  --os-variant rhel6 \&lt;br /&gt;
  --disk path=/dev/an02-vg0/vm0003-1 \&lt;br /&gt;
  --network bridge=vbr2 \&lt;br /&gt;
  --vnc&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Lets look at the differences;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--name vm0003-db&amp;lt;/span&amp;gt;; This sets the new name of the VM.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--disk path=/dev/an02-vg0/vm0003-1&amp;lt;/span&amp;gt;; The path to the new LV is set. Note that the [[VG]] has changed as this VM will run in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt; normally.&lt;br /&gt;
&lt;br /&gt;
==== Initializing vm0003-db&#039;s Install ====&lt;br /&gt;
&lt;br /&gt;
This time we&#039;re going to provision the new VM on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt;, as that is where it will live normally.&lt;br /&gt;
&lt;br /&gt;
On &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&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;
/shared/provision/vm0003-db.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;
Starting install...&lt;br /&gt;
Retrieving file .treeinfo...                             |  676 B     00:00 ... &lt;br /&gt;
Retrieving file vmlinuz...                               | 7.5 MB     00:00 ... &lt;br /&gt;
Retrieving file initrd.img...                            |  59 MB     00:02 ... &lt;br /&gt;
Creating domain...                                       |    0 B     00:00     &lt;br /&gt;
WARNING  Unable to connect to graphical console: virt-viewer not installed. Please install the &#039;virt-viewer&#039; package.&lt;br /&gt;
Domain installation still in progress. You can reconnect to &lt;br /&gt;
the console to complete the installation process.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The install should proceed more or less the same as it did for &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0001-dev&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0002-web&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==== Defining vm0003-db On an-node01 ====&lt;br /&gt;
&lt;br /&gt;
We can use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virsh&amp;lt;/span&amp;gt; to see that the new virtual machine exists and what state it is in. Note that I&#039;ve gotten into the habit of using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--all&amp;lt;/span&amp;gt; to get around &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virsh&amp;lt;/span&amp;gt;&#039;s default behaviour of hiding VMs that are off.&lt;br /&gt;
&lt;br /&gt;
On &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;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;
  2 vm0003-db            running&lt;br /&gt;
  - vm0001-dev           shut off&lt;br /&gt;
  - vm0002-web           shut off&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;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;
  2 vm0001-dev           running&lt;br /&gt;
  4 vm0002-web           running&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To backup the VM&#039;s configuration, we&#039;ll again use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virsh&amp;lt;/span&amp;gt;, but this time with the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;dumpxml&amp;lt;/span&amp;gt; command.&lt;br /&gt;
&lt;br /&gt;
On &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;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 dumpxml vm0003-db &amp;gt; /shared/definitions/vm0003-db.xml&lt;br /&gt;
cat /shared/definitions/vm0003-db.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;kvm&#039; id=&#039;2&#039;&amp;gt;&lt;br /&gt;
  &amp;lt;name&amp;gt;vm0003-db&amp;lt;/name&amp;gt;&lt;br /&gt;
  &amp;lt;uuid&amp;gt;a7018001-b433-b739-bbd9-d4d3285f0a72&amp;lt;/uuid&amp;gt;&lt;br /&gt;
  &amp;lt;memory&amp;gt;2097152&amp;lt;/memory&amp;gt;&lt;br /&gt;
  &amp;lt;currentMemory&amp;gt;2097152&amp;lt;/currentMemory&amp;gt;&lt;br /&gt;
  &amp;lt;vcpu&amp;gt;2&amp;lt;/vcpu&amp;gt;&lt;br /&gt;
  &amp;lt;os&amp;gt;&lt;br /&gt;
    &amp;lt;type arch=&#039;x86_64&#039; machine=&#039;rhel6.2.0&#039;&amp;gt;hvm&amp;lt;/type&amp;gt;&lt;br /&gt;
    &amp;lt;boot dev=&#039;hd&#039;/&amp;gt;&lt;br /&gt;
  &amp;lt;/os&amp;gt;&lt;br /&gt;
  &amp;lt;features&amp;gt;&lt;br /&gt;
    &amp;lt;acpi/&amp;gt;&lt;br /&gt;
    &amp;lt;apic/&amp;gt;&lt;br /&gt;
    &amp;lt;pae/&amp;gt;&lt;br /&gt;
  &amp;lt;/features&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;emulator&amp;gt;/usr/libexec/qemu-kvm&amp;lt;/emulator&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;qemu&#039; type=&#039;raw&#039; cache=&#039;none&#039; io=&#039;native&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;source dev=&#039;/dev/an02-vg0/vm0003-1&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;target dev=&#039;vda&#039; bus=&#039;virtio&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;alias name=&#039;virtio-disk0&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;address type=&#039;pci&#039; domain=&#039;0x0000&#039; bus=&#039;0x00&#039; slot=&#039;0x04&#039; function=&#039;0x0&#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;52:54:00:44:83:ec&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;source bridge=&#039;vbr2&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;target dev=&#039;vnet0&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;model type=&#039;virtio&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;alias name=&#039;net0&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;address type=&#039;pci&#039; domain=&#039;0x0000&#039; bus=&#039;0x00&#039; slot=&#039;0x03&#039; function=&#039;0x0&#039;/&amp;gt;&lt;br /&gt;
    &amp;lt;/interface&amp;gt;&lt;br /&gt;
    &amp;lt;serial type=&#039;pty&#039;&amp;gt;&lt;br /&gt;
      &amp;lt;source path=&#039;/dev/pts/2&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;target port=&#039;0&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;alias name=&#039;serial0&#039;/&amp;gt;&lt;br /&gt;
    &amp;lt;/serial&amp;gt;&lt;br /&gt;
    &amp;lt;console type=&#039;pty&#039; tty=&#039;/dev/pts/2&#039;&amp;gt;&lt;br /&gt;
      &amp;lt;source path=&#039;/dev/pts/2&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;target type=&#039;serial&#039; port=&#039;0&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;alias name=&#039;serial0&#039;/&amp;gt;&lt;br /&gt;
    &amp;lt;/console&amp;gt;&lt;br /&gt;
    &amp;lt;input type=&#039;tablet&#039; bus=&#039;usb&#039;&amp;gt;&lt;br /&gt;
      &amp;lt;alias name=&#039;input0&#039;/&amp;gt;&lt;br /&gt;
    &amp;lt;/input&amp;gt;&lt;br /&gt;
    &amp;lt;input type=&#039;mouse&#039; bus=&#039;ps2&#039;/&amp;gt;&lt;br /&gt;
    &amp;lt;graphics type=&#039;vnc&#039; port=&#039;5900&#039; autoport=&#039;yes&#039;/&amp;gt;&lt;br /&gt;
    &amp;lt;video&amp;gt;&lt;br /&gt;
      &amp;lt;model type=&#039;cirrus&#039; vram=&#039;9216&#039; heads=&#039;1&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;alias name=&#039;video0&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;address type=&#039;pci&#039; domain=&#039;0x0000&#039; bus=&#039;0x00&#039; slot=&#039;0x02&#039; function=&#039;0x0&#039;/&amp;gt;&lt;br /&gt;
    &amp;lt;/video&amp;gt;&lt;br /&gt;
    &amp;lt;memballoon model=&#039;virtio&#039;&amp;gt;&lt;br /&gt;
      &amp;lt;alias name=&#039;balloon0&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;address type=&#039;pci&#039; domain=&#039;0x0000&#039; bus=&#039;0x00&#039; slot=&#039;0x05&#039; function=&#039;0x0&#039;/&amp;gt;&lt;br /&gt;
    &amp;lt;/memballoon&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;
On &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;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 /shared/definitions/vm0003-db.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 vm0003-db defined from /shared/definitions/vm0003-db.xml&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can confirm that it now exists by re-running &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virsh list --all&amp;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;
  2 vm0001-dev           running&lt;br /&gt;
  4 vm0002-web           running&lt;br /&gt;
  - vm0003-db            shut off&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Provisioning vm0004-ms ===&lt;br /&gt;
&lt;br /&gt;
Now for something a little different!&lt;br /&gt;
&lt;br /&gt;
This will be the [http://www.microsoft.com/en-us/server-cloud/windows-server/2008-r2-standard.aspx Windows 2008 R2] virtual machine. The biggest difference this time will be that we&#039;re going to install from the [[ISO]] file rather than from a web-accessible store.&lt;br /&gt;
&lt;br /&gt;
Another difference is that we&#039;re going to specify what kind of storage bus to use with this VM. We&#039;ll be using a special, virtualized bus called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virtio&amp;lt;/span&amp;gt; which requires that the drivers be available to the OS at install time. These drivers will, in turn, be made available to the installer as a virtual floppy disk. It will make for quite the interesting &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-install&amp;lt;/span&amp;gt; call, as we&#039;ll see.&lt;br /&gt;
&lt;br /&gt;
==== Preparing vm0004-ms&#039;s Storage ====&lt;br /&gt;
&lt;br /&gt;
As before, we need to create the backing storage [[LV]] before we can provision the machine. As we planned, this will be a 100 [[GiB]] partition and will be on the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an02-vg0&amp;lt;/span&amp;gt; [[VG]]. Seeing as this LV will use up the rest of the free space in the VG, we&#039;ll again use the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;lvcreate -l 100%FREE&amp;lt;/span&amp;gt; instead of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;-L 100G&amp;lt;/span&amp;gt; as sometimes the numbers don&#039;t work out to be exactly the size we intend.&lt;br /&gt;
&lt;br /&gt;
On &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&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;
lvcreate -l 100%FREE -n vm0004-1 /dev/an02-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;vm0004-1&amp;quot; created&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Before we proceed, we now need to put a copy of the install media, the OS&#039;s [[ISO]] and the virtual floppy disk, somewhere that the installer can access. I like to put files like this into the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/shared/files/&amp;lt;/span&amp;gt; directory we created earlier. How you put them there will be an exercise for the reader.&lt;br /&gt;
&lt;br /&gt;
If you do not have a copy of Microsoft&#039;s server operating system, you can download a 30-day free trial here;&lt;br /&gt;
* [http://technet.microsoft.com/en-us/evalcenter/dd459137 MS Windows Server 2008 R2 with SP1]&lt;br /&gt;
&lt;br /&gt;
The driver for the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virtio&amp;lt;/span&amp;gt; bus can be found from Red Hat here. Note that there is an [[ISO]] and a &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vfd&amp;lt;/span&amp;gt; (virtual floppy disk) file. You can use the ISO and mount it as a second CD-ROM if you wish. This tutorial will use the virtual floppy disk to show how floppy images can be used in VMs:&lt;br /&gt;
* [http://alt.fedoraproject.org/pub/alt/virtio-win/latest/images/bin/ virtio Drivers for Windows]&lt;br /&gt;
&lt;br /&gt;
{{note|1=The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vfd&amp;lt;/span&amp;gt; no longer seems to exist upstream and I&#039;ve not found a way to get windows to use the latest (&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virtio-win-0.1-22.iso&amp;lt;/span&amp;gt; image. As such, I&#039;ve uploaded of the virtual floppy disk image from version 1.1.16. If you have any insight into the proper use of the latest virtio image, please [mailto:digimer@alteeve.ca let me know].}}&lt;br /&gt;
* Local copy of [https://alteeve.com/files/virtio-win-1.1.16.vfd virtio-win-1.1.16.vfd].&lt;br /&gt;
&lt;br /&gt;
==== Creating vm0004-ms&#039;s virt-install Call ====&lt;br /&gt;
&lt;br /&gt;
Lets look at the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-install&amp;lt;/span&amp;gt; command, then we&#039;ll discuss the main differences from the previous call for the firewall. As before, we&#039;ll put this command into a small shell script for later reference.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
touch /shared/provision/vm0004-ms.sh&lt;br /&gt;
chmod 755 /shared/provision/vm0004-ms.sh &lt;br /&gt;
vim /shared/provision/vm0004-ms.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;
virt-install --connect qemu:///system \&lt;br /&gt;
  --name vm0004-ms \&lt;br /&gt;
  --ram 2048 \&lt;br /&gt;
  --arch x86_64 \&lt;br /&gt;
  --vcpus 2 \&lt;br /&gt;
  --cdrom /shared/files/Windows_Server_2008_R2_64Bit_SP1.iso \&lt;br /&gt;
  --disk path=/dev/an02-vg0/vm0004-1,device=disk,bus=virtio \&lt;br /&gt;
  --disk path=/shared/files/virtio-win-1.1.16.vfd,device=floppy \&lt;br /&gt;
  --os-type windows \&lt;br /&gt;
  --os-variant win2k8 \&lt;br /&gt;
  --network bridge=vbr2 \&lt;br /&gt;
  --vnc&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Let&#039;s look at the main differences;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--cdrom /shared/files/Windows_Server_2008_R2_64Bit_SP1.iso&amp;lt;/span&amp;gt;&lt;br /&gt;
Here we&#039;ve swapped out the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--location&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--extra-args&amp;lt;/span&amp;gt; arguments for the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--cdrom&amp;lt;/span&amp;gt; switch. This will create an emulated DVD-ROM drive and boot from it. The path and file is an [[ISO]] image of the installation media we want to use.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--disk path=/dev/an02-vg0/vm0004-1,device=disk,bus=virtio&amp;lt;/span&amp;gt;&lt;br /&gt;
This is the same line we used before, pointing to the new [[LV]] of course, but we&#039;ve added options to it. Specifically, we&#039;ve told the hardware emulator, [[QEMU]], to not create the standard (&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ide&amp;lt;/span&amp;gt; or &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;scsi&amp;lt;/span&amp;gt;) bus. This is a special bus that improves storage [[I/O]] on windows (and other) guests. Windows does not support this bus natively, which brings us to the next option.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--disk path=/shared/files/virtio-win-1.1.16.vfd,device=floppy&amp;lt;/span&amp;gt;&lt;br /&gt;
This mounts the emulated floppy disk with the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virtio&amp;lt;/span&amp;gt; drivers that we&#039;ll need to allow windows to see the hard drive during the install.&lt;br /&gt;
&lt;br /&gt;
The rest is more or less the same as before.&lt;br /&gt;
&lt;br /&gt;
==== Initializing vm0004-ms&#039;s Install ====&lt;br /&gt;
&lt;br /&gt;
As before, we&#039;ll run the script with the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-install&amp;lt;/span&amp;gt; command in it.&lt;br /&gt;
&lt;br /&gt;
On &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&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;
/shared/provision/vm0004-ms.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;
Starting install...&lt;br /&gt;
Creating domain...                                       |    0 B     00:00     &lt;br /&gt;
WARNING  Unable to connect to graphical console: virt-viewer not installed. Please install the &#039;virt-viewer&#039; package.&lt;br /&gt;
Domain installation still in progress. Waiting for installation to complete.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This install isn&#039;t automated like the previous installs were, so we&#039;ll need to hand-hold the VM through the install.&lt;br /&gt;
&lt;br /&gt;
[[Image:2n-RHEL6-KVM_vm0004_provision_01.png|thumb|700px|center|Initial provision of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0004-ms&amp;lt;/span&amp;gt;.]]&lt;br /&gt;
&lt;br /&gt;
After you get click to select the &#039;&#039;Custom (advanced)&#039;&#039; installation method, you will &lt;br /&gt;
&lt;br /&gt;
[[Image:2n-RHEL6-KVM_vm0004_provision_02.png|thumb|700px|center|The Windows 2008 VM &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0004-ms&amp;lt;/span&amp;gt; doesn&#039;t see a hard drive.]]&lt;br /&gt;
&lt;br /&gt;
Click on the &#039;&#039;Load Driver&#039;&#039; option on the bottom left. You will be presented with a window telling you your options for loading the drivers.&lt;br /&gt;
&lt;br /&gt;
[[Image:2n-RHEL6-KVM_vm0004_provision_03.png|thumb|700px|center|The Windows 2008 VM &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0004-ms&amp;lt;/span&amp;gt; driver prompt.]]&lt;br /&gt;
&lt;br /&gt;
Click on the &#039;&#039;OK&#039;&#039; button and the installer will automatically find the virtual floppy disk and present you with the available drivers. Click to highlight &#039;&#039;Red Hat VirtIO SCSI Controller (A:\amd64\Win2008\viostor.inf)&#039;&#039; and click the &#039;&#039;Next&#039;&#039; button.&lt;br /&gt;
&lt;br /&gt;
[[Image:2n-RHEL6-KVM_vm0004_provision_04.png|thumb|700px|center|Selecting the Win2008 &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virtio&amp;lt;/span&amp;gt; driver.]]&lt;br /&gt;
&lt;br /&gt;
At this point, the windows installer will see the virtual hard drive and you can proceed with the install as you would normally install Windows 2008 R2 server.&lt;br /&gt;
&lt;br /&gt;
[[Image:2n-RHEL6-KVM_vm0004_provision_05.png|thumb|700px|center|The Win2008 installer now is about to use the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virtio&amp;lt;/span&amp;gt;-backed storage.]]&lt;br /&gt;
&lt;br /&gt;
Once the install is complete, reboot.&lt;br /&gt;
&lt;br /&gt;
[[Image:2n-RHEL6-KVM_vm0004_provision_06.png|thumb|700px|center|Installation of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0004-ms&amp;lt;/span&amp;gt; complete.]]&lt;br /&gt;
&lt;br /&gt;
==== Post-Install Housekeeping ====&lt;br /&gt;
&lt;br /&gt;
We have to be careful to &amp;quot;eject&amp;quot; the virtual floppy and DVD disks from the VM. If you neglect to do so, then later delete the files, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virsh&amp;lt;/span&amp;gt; will fail to boot the VMs and &#039;&#039;&#039;undefine them entirely&#039;&#039;&#039;. (Yes, that is dumb, in this author&#039;s opinion). [[#My VM Just Vanished!|How to recover]] from this issue can be found below.&lt;br /&gt;
&lt;br /&gt;
{{note|1=At the time of writing this, the author could not find any manner to eject media from the command line, shy of modifying the raw [[XML]] definition file and then redefining the VM and rebooting the guest. This is part of a known bug found in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[libvirt]]&amp;lt;/span&amp;gt; prior to version 0.9.7 and [[EL6]] ships with version 0.8.7. For this reason, we will use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-manager&amp;lt;/span&amp;gt; here.}}&lt;br /&gt;
&lt;br /&gt;
To &amp;quot;eject&amp;quot; the DVD-ROM and floppy drive, we will use the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-manager&amp;lt;/span&amp;gt; graphical program. You will need to either run &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-manager&amp;lt;/span&amp;gt; on one of the nodes, or use a version of it from your workstation by connecting to the host node over [[SSH]]. This later method is what I like to do.&lt;br /&gt;
&lt;br /&gt;
Using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-manager&amp;lt;/span&amp;gt;, connect to the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0004-ms&amp;lt;/span&amp;gt; VM.&lt;br /&gt;
&lt;br /&gt;
[[Image:2n-RHEL6-KVM_vm0004_eject-media_01.png|thumb|700px|center|Connecting to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0004-ms&amp;lt;/span&amp;gt; using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-manager&amp;lt;/span&amp;gt; from a remote workstation.]]&lt;br /&gt;
&lt;br /&gt;
Click on &#039;&#039;View&#039;&#039; then &#039;&#039;Details&#039;&#039; and you will see the virtual machine&#039;s emulated hardware.&lt;br /&gt;
&lt;br /&gt;
[[Image:2n-RHEL6-KVM_vm0004_eject-media_02.png|thumb|700px|center|Looking at &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0004-ms&amp;lt;/span&amp;gt;&#039;s emulated hardware configuration.]]&lt;br /&gt;
&lt;br /&gt;
First, let&#039;s eject the virtual floppy disk. In the left panel, click to select the &#039;&#039;Floppy 1&#039;&#039; device.&lt;br /&gt;
&lt;br /&gt;
[[Image:2n-RHEL6-KVM_vm0004_eject-media_03.png|thumb|700px|center|Viewing the &#039;&#039;Floppy 1&#039;&#039; device on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0004-ms&amp;lt;/span&amp;gt;.]]&lt;br /&gt;
&lt;br /&gt;
Click on the &#039;&#039;Disconnect&#039;&#039; button and the disk will be unmounted.&lt;br /&gt;
&lt;br /&gt;
[[Image:2n-RHEL6-KVM_vm0004_eject-media_04.png|thumb|700px|center|Viewing the &#039;&#039;Floppy 1&#039;&#039; device after ejecting the virtual floppy disk on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0004-ms&amp;lt;/span&amp;gt;.]]&lt;br /&gt;
&lt;br /&gt;
Now to eject the emulated DVD-ROM, again on the left panel, click to select the &#039;&#039;IDE CDROM 1&#039;&#039; device.&lt;br /&gt;
&lt;br /&gt;
[[Image:2n-RHEL6-KVM_vm0004_eject-media_05.png|thumb|700px|center|Viewing the &#039;&#039;IDE CDROM 1&#039;&#039; device on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0004-ms&amp;lt;/span&amp;gt;.]]&lt;br /&gt;
&lt;br /&gt;
Click on &#039;&#039;Disconnect&#039;&#039; again to unmount the ISO image.&lt;br /&gt;
&lt;br /&gt;
[[Image:2n-RHEL6-KVM_vm0004_eject-media_06.png|thumb|700px|center|Viewing the &#039;&#039;IDE CDROM 1&#039;&#039; device after ejecting the virtual floppy disk on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0004-ms&amp;lt;/span&amp;gt;.]]&lt;br /&gt;
&lt;br /&gt;
Now both the floppy disk and DVD image have been unmounted from the VM. We can return to the console view (&#039;&#039;View&#039;&#039; -&amp;gt; &#039;&#039;Console&#039;&#039;) and we will see that both the floppy disk and DVD drive no longer show any media as mounted within them.&lt;br /&gt;
&lt;br /&gt;
[[Image:2n-RHEL6-KVM_vm0004_eject-media_07.png|thumb|700px|center|Viewing &#039;&#039;File Manager&#039;&#039; on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0004-ms&amp;lt;/span&amp;gt; with the virtual floppy disk and DVD ISO image now unmounted.]]&lt;br /&gt;
&lt;br /&gt;
Done!&lt;br /&gt;
&lt;br /&gt;
==== Defining vm0004-ms On an-node02 ====&lt;br /&gt;
&lt;br /&gt;
Now with the installation media unmounted, and as we did before, we will use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virsh dumpxml&amp;lt;/span&amp;gt; to write out the [[XML]] definition file for the new VM and then &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virsh define&amp;lt;/span&amp;gt; it on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
On &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;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;
  2 vm0003-db            running&lt;br /&gt;
  4 vm0004-ms            running&lt;br /&gt;
  - vm0001-dev           shut off&lt;br /&gt;
  - vm0002-web           shut off&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;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;
  2 vm0001-dev           running&lt;br /&gt;
  4 vm0002-web           running&lt;br /&gt;
  - vm0003-db            shut off&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As before, our new VM is only defined on the node we installed it on. We&#039;ll fix this now.&lt;br /&gt;
&lt;br /&gt;
On &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;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 dumpxml vm0004-ms &amp;gt; /shared/definitions/vm0004-ms.xml&lt;br /&gt;
cat /shared/definitions/vm0004-ms.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;kvm&#039; id=&#039;4&#039;&amp;gt;&lt;br /&gt;
  &amp;lt;name&amp;gt;vm0004-ms&amp;lt;/name&amp;gt;&lt;br /&gt;
  &amp;lt;uuid&amp;gt;4c537551-96f4-3b5e-209a-0e41cab41d44&amp;lt;/uuid&amp;gt;&lt;br /&gt;
  &amp;lt;memory&amp;gt;2097152&amp;lt;/memory&amp;gt;&lt;br /&gt;
  &amp;lt;currentMemory&amp;gt;2097152&amp;lt;/currentMemory&amp;gt;&lt;br /&gt;
  &amp;lt;vcpu&amp;gt;2&amp;lt;/vcpu&amp;gt;&lt;br /&gt;
  &amp;lt;os&amp;gt;&lt;br /&gt;
    &amp;lt;type arch=&#039;x86_64&#039; machine=&#039;rhel6.2.0&#039;&amp;gt;hvm&amp;lt;/type&amp;gt;&lt;br /&gt;
    &amp;lt;boot dev=&#039;hd&#039;/&amp;gt;&lt;br /&gt;
  &amp;lt;/os&amp;gt;&lt;br /&gt;
  &amp;lt;features&amp;gt;&lt;br /&gt;
    &amp;lt;acpi/&amp;gt;&lt;br /&gt;
    &amp;lt;apic/&amp;gt;&lt;br /&gt;
    &amp;lt;pae/&amp;gt;&lt;br /&gt;
  &amp;lt;/features&amp;gt;&lt;br /&gt;
  &amp;lt;clock offset=&#039;localtime&#039;&amp;gt;&lt;br /&gt;
    &amp;lt;timer name=&#039;rtc&#039; tickpolicy=&#039;catchup&#039;/&amp;gt;&lt;br /&gt;
  &amp;lt;/clock&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;emulator&amp;gt;/usr/libexec/qemu-kvm&amp;lt;/emulator&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;qemu&#039; type=&#039;raw&#039; cache=&#039;none&#039; io=&#039;native&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;source dev=&#039;/dev/an02-vg0/vm0004-1&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;target dev=&#039;vda&#039; bus=&#039;virtio&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;alias name=&#039;virtio-disk0&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;address type=&#039;pci&#039; domain=&#039;0x0000&#039; bus=&#039;0x00&#039; slot=&#039;0x04&#039; function=&#039;0x0&#039;/&amp;gt;&lt;br /&gt;
    &amp;lt;/disk&amp;gt;&lt;br /&gt;
    &amp;lt;disk type=&#039;file&#039; device=&#039;floppy&#039;&amp;gt;&lt;br /&gt;
      &amp;lt;driver name=&#039;qemu&#039; type=&#039;raw&#039; cache=&#039;none&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;target dev=&#039;fda&#039; bus=&#039;fdc&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;alias name=&#039;fdc0-0-0&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;address type=&#039;drive&#039; controller=&#039;0&#039; bus=&#039;0&#039; unit=&#039;0&#039;/&amp;gt;&lt;br /&gt;
    &amp;lt;/disk&amp;gt;&lt;br /&gt;
    &amp;lt;disk type=&#039;file&#039; device=&#039;cdrom&#039;&amp;gt;&lt;br /&gt;
      &amp;lt;driver name=&#039;qemu&#039; type=&#039;raw&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;target dev=&#039;hdc&#039; bus=&#039;ide&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;readonly/&amp;gt;&lt;br /&gt;
      &amp;lt;alias name=&#039;ide0-1-0&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;address type=&#039;drive&#039; controller=&#039;0&#039; bus=&#039;1&#039; unit=&#039;0&#039;/&amp;gt;&lt;br /&gt;
    &amp;lt;/disk&amp;gt;&lt;br /&gt;
    &amp;lt;controller type=&#039;fdc&#039; index=&#039;0&#039;&amp;gt;&lt;br /&gt;
      &amp;lt;alias name=&#039;fdc0&#039;/&amp;gt;&lt;br /&gt;
    &amp;lt;/controller&amp;gt;&lt;br /&gt;
    &amp;lt;controller type=&#039;ide&#039; index=&#039;0&#039;&amp;gt;&lt;br /&gt;
      &amp;lt;alias name=&#039;ide0&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;address type=&#039;pci&#039; domain=&#039;0x0000&#039; bus=&#039;0x00&#039; slot=&#039;0x01&#039; function=&#039;0x1&#039;/&amp;gt;&lt;br /&gt;
    &amp;lt;/controller&amp;gt;&lt;br /&gt;
    &amp;lt;interface type=&#039;bridge&#039;&amp;gt;&lt;br /&gt;
      &amp;lt;mac address=&#039;52:54:00:5e:b1:47&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;source bridge=&#039;vbr2&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;target dev=&#039;vnet1&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;alias name=&#039;net0&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;address type=&#039;pci&#039; domain=&#039;0x0000&#039; bus=&#039;0x00&#039; slot=&#039;0x03&#039; function=&#039;0x0&#039;/&amp;gt;&lt;br /&gt;
    &amp;lt;/interface&amp;gt;&lt;br /&gt;
    &amp;lt;serial type=&#039;pty&#039;&amp;gt;&lt;br /&gt;
      &amp;lt;source path=&#039;/dev/pts/3&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;target port=&#039;0&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;alias name=&#039;serial0&#039;/&amp;gt;&lt;br /&gt;
    &amp;lt;/serial&amp;gt;&lt;br /&gt;
    &amp;lt;console type=&#039;pty&#039; tty=&#039;/dev/pts/3&#039;&amp;gt;&lt;br /&gt;
      &amp;lt;source path=&#039;/dev/pts/3&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;target type=&#039;serial&#039; port=&#039;0&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;alias name=&#039;serial0&#039;/&amp;gt;&lt;br /&gt;
    &amp;lt;/console&amp;gt;&lt;br /&gt;
    &amp;lt;input type=&#039;tablet&#039; bus=&#039;usb&#039;&amp;gt;&lt;br /&gt;
      &amp;lt;alias name=&#039;input0&#039;/&amp;gt;&lt;br /&gt;
    &amp;lt;/input&amp;gt;&lt;br /&gt;
    &amp;lt;input type=&#039;mouse&#039; bus=&#039;ps2&#039;/&amp;gt;&lt;br /&gt;
    &amp;lt;graphics type=&#039;vnc&#039; port=&#039;5901&#039; autoport=&#039;yes&#039;/&amp;gt;&lt;br /&gt;
    &amp;lt;video&amp;gt;&lt;br /&gt;
      &amp;lt;model type=&#039;vga&#039; vram=&#039;9216&#039; heads=&#039;1&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;alias name=&#039;video0&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;address type=&#039;pci&#039; domain=&#039;0x0000&#039; bus=&#039;0x00&#039; slot=&#039;0x02&#039; function=&#039;0x0&#039;/&amp;gt;&lt;br /&gt;
    &amp;lt;/video&amp;gt;&lt;br /&gt;
    &amp;lt;memballoon model=&#039;virtio&#039;&amp;gt;&lt;br /&gt;
      &amp;lt;alias name=&#039;balloon0&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;address type=&#039;pci&#039; domain=&#039;0x0000&#039; bus=&#039;0x00&#039; slot=&#039;0x05&#039; function=&#039;0x0&#039;/&amp;gt;&lt;br /&gt;
    &amp;lt;/memballoon&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;
As before, defining the VM on both nodes is optional, but a habit I like to do.&lt;br /&gt;
&lt;br /&gt;
On &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;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 /shared/definitions/vm0004-ms.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 vm0004-ms defined from /shared/definitions/vm0004-ms.xml&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can confirm that it now exists by re-running &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virsh list --all&amp;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;
  2 vm0001-dev           running&lt;br /&gt;
  4 vm0002-web           running&lt;br /&gt;
  - vm0003-db            shut off&lt;br /&gt;
  - vm0004-ms            shut off&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With that, all our VMs exist and we&#039;re ready to make them highly available!&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 cluster services! This involves two main steps:&lt;br /&gt;
* Creating two new, ordered fail-over Domains; One with each node as the highest priority.&lt;br /&gt;
* Adding our VMs as services, one is each new fail-over domain.&lt;br /&gt;
&lt;br /&gt;
== Creating the Ordered Fail-Over Domains ==&lt;br /&gt;
&lt;br /&gt;
We have planned for two VMs, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0001-dev&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0002-web&amp;lt;/span&amp;gt; to normally run on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt; while &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0003-db&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0004-ms&amp;lt;/span&amp;gt; to run on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt;. Of course, should one of the nodes fail, the lost VMs will be restarted on the surviving node. For this, we will use an ordered fail-over domain.&lt;br /&gt;
&lt;br /&gt;
The idea here is that each new fail-over 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-node01&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-node02&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 fail-over domain.&lt;br /&gt;
&lt;br /&gt;
{{note|1=With 2-node clusters like ours, ordering is arguably useless. It&#039;s used here more to introduce the concepts rather than providing any real benefit. If you want to make production clusters unordered, you can. Just remember to run the VMs on the appropriate nodes when both are on-line.}}&lt;br /&gt;
&lt;br /&gt;
Here are the two new domains we will create 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;
&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;primary_an01&amp;quot; nofailback=&amp;quot;1&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-node01.alteeve.com&amp;quot; priority=&amp;quot;1&amp;quot;/&amp;gt;&lt;br /&gt;
                                &amp;lt;failoverdomainnode name=&amp;quot;an-node02.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;primary_an02&amp;quot; nofailback=&amp;quot;1&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-node01.alteeve.com&amp;quot; priority=&amp;quot;2&amp;quot;/&amp;gt;&lt;br /&gt;
                                &amp;lt;failoverdomainnode name=&amp;quot;an-node02.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;
The two major pieces of the puzzle here are the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;failoverdomain ...&amp;gt;&amp;lt;/span&amp;gt;&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ordered=&amp;quot;1&amp;quot;&amp;lt;/span&amp;gt; attribute and the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;failoverdomainnode ...&amp;gt;&amp;lt;/span&amp;gt;&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;priority=&amp;quot;x&amp;quot;&amp;lt;/span&amp;gt; attributes. The former tells the cluster that there is a preference for which node should be used when both are available. The later, which is the difference between the two new domains, tells the cluster which specific node is preferred.&lt;br /&gt;
&lt;br /&gt;
The first of the new fail-over domains is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;primary_an01&amp;lt;/span&amp;gt;. Any service placed in this domain will prefer to run on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;, as its priority of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt; is higher than &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt;&#039;s priority of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;2&amp;lt;/span&amp;gt;. The second of the new domains is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;primary_an02&amp;lt;/span&amp;gt; which reverses the preference, making &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt; preferred over &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Let&#039;s look at the complete &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cluster.conf&amp;lt;/span&amp;gt; with the new domain, and the version updated to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;11&amp;lt;/span&amp;gt; of course.&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 config_version=&amp;quot;11&amp;quot; name=&amp;quot;an-cluster-A&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-node01.alteeve.com&amp;quot; nodeid=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
                        &amp;lt;fence&amp;gt;&lt;br /&gt;
                                &amp;lt;method name=&amp;quot;ipmi&amp;quot;&amp;gt;&lt;br /&gt;
                                        &amp;lt;device action=&amp;quot;reboot&amp;quot; name=&amp;quot;ipmi_an01&amp;quot;/&amp;gt;&lt;br /&gt;
                                &amp;lt;/method&amp;gt;&lt;br /&gt;
                                &amp;lt;method name=&amp;quot;pdu&amp;quot;&amp;gt;&lt;br /&gt;
                                        &amp;lt;device action=&amp;quot;reboot&amp;quot; name=&amp;quot;pdu2&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;
                &amp;lt;/clusternode&amp;gt;&lt;br /&gt;
                &amp;lt;clusternode name=&amp;quot;an-node02.alteeve.com&amp;quot; nodeid=&amp;quot;2&amp;quot;&amp;gt;&lt;br /&gt;
                        &amp;lt;fence&amp;gt;&lt;br /&gt;
                                &amp;lt;method name=&amp;quot;ipmi&amp;quot;&amp;gt;&lt;br /&gt;
                                        &amp;lt;device action=&amp;quot;reboot&amp;quot; name=&amp;quot;ipmi_an02&amp;quot;/&amp;gt;&lt;br /&gt;
                                &amp;lt;/method&amp;gt;&lt;br /&gt;
                                &amp;lt;method name=&amp;quot;pdu&amp;quot;&amp;gt;&lt;br /&gt;
                                        &amp;lt;device action=&amp;quot;reboot&amp;quot; name=&amp;quot;pdu2&amp;quot; port=&amp;quot;2&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_ipmilan&amp;quot; ipaddr=&amp;quot;an-node01.ipmi&amp;quot; login=&amp;quot;root&amp;quot; name=&amp;quot;ipmi_an01&amp;quot; passwd=&amp;quot;secret&amp;quot;/&amp;gt;&lt;br /&gt;
                &amp;lt;fencedevice agent=&amp;quot;fence_ipmilan&amp;quot; ipaddr=&amp;quot;an-node02.ipmi&amp;quot; login=&amp;quot;root&amp;quot; name=&amp;quot;ipmi_an02&amp;quot; passwd=&amp;quot;secret&amp;quot;/&amp;gt;&lt;br /&gt;
                &amp;lt;fencedevice agent=&amp;quot;fence_apc_snmp&amp;quot; ipaddr=&amp;quot;pdu2.alteeve.com&amp;quot; name=&amp;quot;pdu2&amp;quot;/&amp;gt;&lt;br /&gt;
        &amp;lt;/fencedevices&amp;gt;&lt;br /&gt;
        &amp;lt;fence_daemon post_join_delay=&amp;quot;30&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 log_level=&amp;quot;5&amp;quot;&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;script file=&amp;quot;/etc/init.d/libvirtd&amp;quot; name=&amp;quot;libvirtd&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;only_an01&amp;quot; nofailback=&amp;quot;1&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-node01.alteeve.com&amp;quot;/&amp;gt;&lt;br /&gt;
                        &amp;lt;/failoverdomain&amp;gt;&lt;br /&gt;
                        &amp;lt;failoverdomain name=&amp;quot;only_an02&amp;quot; nofailback=&amp;quot;1&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-node02.alteeve.com&amp;quot;/&amp;gt;&lt;br /&gt;
                        &amp;lt;/failoverdomain&amp;gt;&lt;br /&gt;
                        &amp;lt;failoverdomain name=&amp;quot;primary_an01&amp;quot; nofailback=&amp;quot;1&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-node01.alteeve.com&amp;quot; priority=&amp;quot;1&amp;quot;/&amp;gt;&lt;br /&gt;
                                &amp;lt;failoverdomainnode name=&amp;quot;an-node02.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;primary_an02&amp;quot; nofailback=&amp;quot;1&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-node01.alteeve.com&amp;quot; priority=&amp;quot;2&amp;quot;/&amp;gt;&lt;br /&gt;
                                &amp;lt;failoverdomainnode name=&amp;quot;an-node02.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;only_an01&amp;quot; exclusive=&amp;quot;0&amp;quot; name=&amp;quot;storage_an01&amp;quot; recovery=&amp;quot;restart&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 ref=&amp;quot;libvirtd&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;/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;only_an02&amp;quot; exclusive=&amp;quot;0&amp;quot; name=&amp;quot;storage_an02&amp;quot; recovery=&amp;quot;restart&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 ref=&amp;quot;libvirtd&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;/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;
Let&#039;s validate it now, but we won&#039;t bother to push it out just yet.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ccs_config_validate &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Configuration validates&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Good, now to create the new VM services!&lt;br /&gt;
&lt;br /&gt;
== Making Our VMs Clustered Services ==&lt;br /&gt;
&lt;br /&gt;
The final piece of the puzzle, and the whole purpose of this exercise is in sight!&lt;br /&gt;
&lt;br /&gt;
There is a special service in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; for virtual machines which uses the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm:&amp;lt;/span&amp;gt; prefix. We will need to create four of these services; One for each of the virtual machines.&lt;br /&gt;
&lt;br /&gt;
{{note|1=There is a one main drawback of using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; to manage virtual machines in our cluster. Ideally, we&#039;d like to have the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm:&amp;lt;/span&amp;gt; services start after the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;storage_X&amp;lt;/span&amp;gt; services are up, and a bit of logic to say that all VMs can start on one node, should the other&#039;s storage service fail. This isn&#039;t possible though, so we will need to manually start VMs after a cold-start of the cluster.}}&lt;br /&gt;
&lt;br /&gt;
=== Creating The vm: Services ===&lt;br /&gt;
&lt;br /&gt;
We&#039;ll create four new services, one for each VM. These are simple single-element entries. Lets increment the version to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;12&amp;lt;/span&amp;gt; and take a look at the new entries.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;rm log_level=&amp;quot;5&amp;quot;&amp;gt;&lt;br /&gt;
                ...&lt;br /&gt;
                &amp;lt;vm name=&amp;quot;vm0001-dev&amp;quot; domain=&amp;quot;primary_an01&amp;quot; path=&amp;quot;/shared/definitions/&amp;quot; autostart=&amp;quot;0&amp;quot;&lt;br /&gt;
                 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-web&amp;quot; domain=&amp;quot;primary_an01&amp;quot; path=&amp;quot;/shared/definitions/&amp;quot; autostart=&amp;quot;0&amp;quot;&lt;br /&gt;
                 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;vm0003-db&amp;quot; domain=&amp;quot;primary_an02&amp;quot; path=&amp;quot;/shared/definitions/&amp;quot; autostart=&amp;quot;0&amp;quot;&lt;br /&gt;
                 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;vm0004-ms&amp;quot; domain=&amp;quot;primary_an02&amp;quot; path=&amp;quot;/shared/definitions/&amp;quot; autostart=&amp;quot;0&amp;quot;&lt;br /&gt;
                 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;
Let&#039;s look at each of the attributes now;&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;name&amp;lt;/span&amp;gt;; This must match the name we created the VM with (the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--name ...&amp;lt;/span&amp;gt; value when we provisioned the VMs). This is the name that will be passed to the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm.sh&amp;lt;/span&amp;gt; resource agent when managing this service, and it will be the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;name&amp;gt;.xml&amp;lt;/span&amp;gt; used when looking under &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;path=...&amp;lt;/span&amp;gt; for the VM&#039;s definition file.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;domain&amp;lt;/span&amp;gt;; This tells the cluster to manage the VM using the given fail-over domain.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;path&amp;lt;/span&amp;gt;; This tells the cluster where to look for the VM&#039;s definition file. &#039;&#039;&#039;Do not&#039;&#039;&#039; include the actual file name, just the path. This is partly why we wrote out each VM&#039;s definition to the shared directory.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;autostart&amp;lt;/span&amp;gt;; As mentioned above, we can&#039;t have the VMs start with the cluster, because the underlying storage takes too long to come on-line. Setting this to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;0&amp;lt;/span&amp;gt; disables the auto-start behaviour.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;exclusive&amp;lt;/span&amp;gt;; As we saw with the storage services, we want to ensure that this service &#039;&#039;&#039;is not&#039;&#039;&#039; exclusive. If it were, starting the VM would stop the storage and prevent other VMs from running on the node. This would be a bad thing™.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;recovery&amp;lt;/span&amp;gt;; This tells the cluster what to do when the service fails. We are setting this to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;restart&amp;lt;/span&amp;gt;, so the cluster will try to restart the VM on the same node it was on when it failed. The alternative is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;relocate&amp;lt;/span&amp;gt;, which would instead start the VM on another node. More about this next.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;max_restarts&amp;lt;/span&amp;gt;; When a VM fails, it is possible that it is because there is a subtle problem on the host node itself. So this attribute allows up to set a limit on how many times a VM will be allowed to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;restart&amp;lt;/span&amp;gt; before giving up and switching to a &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;relocate&amp;lt;/span&amp;gt; police. We&#039;re setting this to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;2&amp;lt;/span&amp;gt;, which means that if a VM is restarted twice, the third failure will trigger a &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;relocate&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;restart_expire_time&amp;lt;/span&amp;gt;; If we let the failure count increment indefinitely, than a &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;relocate&amp;lt;/span&amp;gt; policy becomes inevitable, when there is no reason to believe that an issue with the host node exists. To account for this, we use this attribute to tell the cluster to &amp;quot;forget&amp;quot; a restart after the defined number of seconds. We&#039;re using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;600&amp;lt;/span&amp;gt; seconds (ten minutes). So if a VM fails, the failure count increments from &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;0&amp;lt;/span&amp;gt; to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt;. After &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;600&amp;lt;/span&amp;gt; seconds though, the restart is &amp;quot;forgotten&amp;quot; and the failure count returns to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;0&amp;lt;/span&amp;gt;. Said another way, a VM will have to fail three times in ten minutes to trigger the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;relocate&amp;lt;/span&amp;gt; recovery policy.&lt;br /&gt;
&lt;br /&gt;
So let&#039;s take a look at the final, complete &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;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;?xml version=&amp;quot;1.0&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;cluster config_version=&amp;quot;12&amp;quot; name=&amp;quot;an-cluster-A&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-node01.alteeve.com&amp;quot; nodeid=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
			&amp;lt;fence&amp;gt;&lt;br /&gt;
				&amp;lt;method name=&amp;quot;ipmi&amp;quot;&amp;gt;&lt;br /&gt;
					&amp;lt;device action=&amp;quot;reboot&amp;quot; name=&amp;quot;ipmi_an01&amp;quot;/&amp;gt;&lt;br /&gt;
				&amp;lt;/method&amp;gt;&lt;br /&gt;
				&amp;lt;method name=&amp;quot;pdu&amp;quot;&amp;gt;&lt;br /&gt;
					&amp;lt;device action=&amp;quot;reboot&amp;quot; name=&amp;quot;pdu2&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;
		&amp;lt;/clusternode&amp;gt;&lt;br /&gt;
		&amp;lt;clusternode name=&amp;quot;an-node02.alteeve.com&amp;quot; nodeid=&amp;quot;2&amp;quot;&amp;gt;&lt;br /&gt;
			&amp;lt;fence&amp;gt;&lt;br /&gt;
				&amp;lt;method name=&amp;quot;ipmi&amp;quot;&amp;gt;&lt;br /&gt;
					&amp;lt;device action=&amp;quot;reboot&amp;quot; name=&amp;quot;ipmi_an02&amp;quot;/&amp;gt;&lt;br /&gt;
				&amp;lt;/method&amp;gt;&lt;br /&gt;
				&amp;lt;method name=&amp;quot;pdu&amp;quot;&amp;gt;&lt;br /&gt;
					&amp;lt;device action=&amp;quot;reboot&amp;quot; name=&amp;quot;pdu2&amp;quot; port=&amp;quot;2&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_ipmilan&amp;quot; ipaddr=&amp;quot;an-node01.ipmi&amp;quot; login=&amp;quot;root&amp;quot; name=&amp;quot;ipmi_an01&amp;quot; passwd=&amp;quot;secret&amp;quot;/&amp;gt;&lt;br /&gt;
		&amp;lt;fencedevice agent=&amp;quot;fence_ipmilan&amp;quot; ipaddr=&amp;quot;an-node02.ipmi&amp;quot; login=&amp;quot;root&amp;quot; name=&amp;quot;ipmi_an02&amp;quot; passwd=&amp;quot;secret&amp;quot;/&amp;gt;&lt;br /&gt;
		&amp;lt;fencedevice agent=&amp;quot;fence_apc_snmp&amp;quot; ipaddr=&amp;quot;pdu2.alteeve.com&amp;quot; name=&amp;quot;pdu2&amp;quot;/&amp;gt;&lt;br /&gt;
	&amp;lt;/fencedevices&amp;gt;&lt;br /&gt;
	&amp;lt;fence_daemon post_join_delay=&amp;quot;30&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 log_level=&amp;quot;5&amp;quot;&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;script file=&amp;quot;/etc/init.d/libvirtd&amp;quot; name=&amp;quot;libvirtd&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;only_an01&amp;quot; nofailback=&amp;quot;1&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-node01.alteeve.com&amp;quot;/&amp;gt;&lt;br /&gt;
			&amp;lt;/failoverdomain&amp;gt;&lt;br /&gt;
			&amp;lt;failoverdomain name=&amp;quot;only_an02&amp;quot; nofailback=&amp;quot;1&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-node02.alteeve.com&amp;quot;/&amp;gt;&lt;br /&gt;
			&amp;lt;/failoverdomain&amp;gt;&lt;br /&gt;
			&amp;lt;failoverdomain name=&amp;quot;primary_an01&amp;quot; nofailback=&amp;quot;1&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-node01.alteeve.com&amp;quot; priority=&amp;quot;1&amp;quot;/&amp;gt;&lt;br /&gt;
				&amp;lt;failoverdomainnode name=&amp;quot;an-node02.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;primary_an02&amp;quot; nofailback=&amp;quot;1&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-node01.alteeve.com&amp;quot; priority=&amp;quot;2&amp;quot;/&amp;gt;&lt;br /&gt;
				&amp;lt;failoverdomainnode name=&amp;quot;an-node02.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;only_an01&amp;quot; exclusive=&amp;quot;0&amp;quot; name=&amp;quot;storage_an01&amp;quot; recovery=&amp;quot;restart&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 ref=&amp;quot;libvirtd&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;/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;only_an02&amp;quot; exclusive=&amp;quot;0&amp;quot; name=&amp;quot;storage_an02&amp;quot; recovery=&amp;quot;restart&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 ref=&amp;quot;libvirtd&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;/script&amp;gt;&lt;br /&gt;
		&amp;lt;/service&amp;gt;&lt;br /&gt;
		&amp;lt;vm name=&amp;quot;vm0001-dev&amp;quot; domain=&amp;quot;primary_an01&amp;quot; path=&amp;quot;/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-web&amp;quot; domain=&amp;quot;primary_an01&amp;quot; path=&amp;quot;/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;vm0003-db&amp;quot; domain=&amp;quot;primary_an02&amp;quot; path=&amp;quot;/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;vm0004-ms&amp;quot; domain=&amp;quot;primary_an02&amp;quot; path=&amp;quot;/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;
&lt;br /&gt;
Let&#039;s validate one more time.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ccs_config_validate &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Configuration validates&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
She&#039;s a beaut&#039;, eh?&lt;br /&gt;
&lt;br /&gt;
=== Making The VM Services Active ===&lt;br /&gt;
&lt;br /&gt;
Before we push the last &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cluster.conf&amp;lt;/span&amp;gt; out, lets take a look at the current state of affairs.&lt;br /&gt;
&lt;br /&gt;
On &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;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-cluster-A @ Tue Dec 27 14:06: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-node01.alteeve.com                       1 Online, Local, rgmanager&lt;br /&gt;
 an-node02.alteeve.com                       2 Online, rgmanager&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State         &lt;br /&gt;
 ------- ----                   ----- ------                   -----         &lt;br /&gt;
 service:storage_an01           an-node01.alteeve.com          started       &lt;br /&gt;
 service:storage_an02           an-node02.alteeve.com          started       &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;
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;
  2 vm0001-dev           running&lt;br /&gt;
  4 vm0002-web           running&lt;br /&gt;
  - vm0003-db            shut off&lt;br /&gt;
  - vm0004-ms            shut off&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;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-cluster-A @ Tue Dec 27 14:07:32 2011&lt;br /&gt;
Member Status: Quorate&lt;br /&gt;
&lt;br /&gt;
 Member Name                             ID   Status&lt;br /&gt;
 ------ ----                             ---- ------&lt;br /&gt;
 an-node01.alteeve.com                       1 Online, rgmanager&lt;br /&gt;
 an-node02.alteeve.com                       2 Online, Local, rgmanager&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State         &lt;br /&gt;
 ------- ----                   ----- ------                   -----         &lt;br /&gt;
 service:storage_an01           an-node01.alteeve.com          started       &lt;br /&gt;
 service:storage_an02           an-node02.alteeve.com          started       &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;
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;
  2 vm0003-db            running&lt;br /&gt;
  4 vm0004-ms            running&lt;br /&gt;
  - vm0001-dev           shut off&lt;br /&gt;
  - vm0002-web           shut off&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So we can see that the cluster doesn&#039;t know about the VMs yet, as we&#039;ve not yet pushed out the changes. We can also see that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0001-dev&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0002-web&amp;lt;/span&amp;gt; are currently running on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0003-db&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0004-ms&amp;lt;/span&amp;gt; are running on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
So let&#039;s push out the new configuration and see what happens!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cman_tool version -r&lt;br /&gt;
cman_tool version&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
6.2.0 config 12&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Let&#039;s take a look at what showed up in syslog;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Dec 27 14:18:20 an-node01 modcluster: Updating cluster.conf&lt;br /&gt;
Dec 27 14:18:20 an-node01 corosync[2362]:   [QUORUM] Members[2]: 1 2&lt;br /&gt;
Dec 27 14:18:20 an-node01 rgmanager[2579]: Reconfiguring&lt;br /&gt;
Dec 27 14:18:22 an-node01 rgmanager[2579]: Initializing vm:vm0001-dev&lt;br /&gt;
Dec 27 14:18:22 an-node01 rgmanager[2579]: vm:vm0001-dev was added to the config, but I am not initializing it.&lt;br /&gt;
Dec 27 14:18:22 an-node01 rgmanager[2579]: Initializing vm:vm0002-web&lt;br /&gt;
Dec 27 14:18:22 an-node01 rgmanager[2579]: vm:vm0002-web was added to the config, but I am not initializing it.&lt;br /&gt;
Dec 27 14:18:22 an-node01 rgmanager[2579]: Initializing vm:vm0003-db&lt;br /&gt;
Dec 27 14:18:22 an-node01 rgmanager[2579]: vm:vm0003-db was added to the config, but I am not initializing it.&lt;br /&gt;
Dec 27 14:18:23 an-node01 rgmanager[2579]: Initializing vm:vm0004-ms&lt;br /&gt;
Dec 27 14:18:23 an-node01 rgmanager[2579]: vm:vm0004-ms was added to the config, but I am not initializing it.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Indeed, if we check again with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clustat&amp;lt;/span&amp;gt;, we&#039;ll see the new VM services, but all four will show as &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;disabled&amp;lt;/span&amp;gt;, despite the VMs themselves being up and running.&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-cluster-A @ Tue Dec 27 14:20: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-node01.alteeve.com                       1 Online, Local, rgmanager&lt;br /&gt;
 an-node02.alteeve.com                       2 Online, rgmanager&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State         &lt;br /&gt;
 ------- ----                   ----- ------                   -----         &lt;br /&gt;
 service:storage_an01           an-node01.alteeve.com          started       &lt;br /&gt;
 service:storage_an02           an-node02.alteeve.com          started       &lt;br /&gt;
 vm:vm0001-dev                  (none)                         disabled      &lt;br /&gt;
 vm:vm0002-web                  (none)                         disabled      &lt;br /&gt;
 vm:vm0003-db                   (none)                         disabled      &lt;br /&gt;
 vm:vm0004-ms                   (none)                         disabled      &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This highlights how the state of the VMs is not intrinsically tied to the cluster&#039;s status. The VMs were started outside of the cluster, so the cluster thinks they are off-line. We know they&#039;re running though, so we can tell the cluster to enable them now. Note that the VMs will &#039;&#039;&#039;not&#039;&#039;&#039; be rebooted or in any way effected, provided you tell the cluster to enable the VM on the node it&#039;s currently running on.&lt;br /&gt;
&lt;br /&gt;
Let&#039;s start by enabling &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0001-dev&amp;lt;/span&amp;gt;, which we know is running on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;. Be aware that the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm:&amp;lt;/span&amp;gt; prefix is required when using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clusvcadm&amp;lt;/span&amp;gt;!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
clusvcadm -e vm:vm0001-dev -m an-node01.alteeve.com&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
vm:vm0001-dev is now running on an-node01.alteeve.com&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we can see that the VM is under the cluster&#039;s control!&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-cluster-A @ Tue Dec 27 14:25:08 2011&lt;br /&gt;
Member Status: Quorate&lt;br /&gt;
&lt;br /&gt;
 Member Name                             ID   Status&lt;br /&gt;
 ------ ----                             ---- ------&lt;br /&gt;
 an-node01.alteeve.com                       1 Online, Local, rgmanager&lt;br /&gt;
 an-node02.alteeve.com                       2 Online, rgmanager&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State         &lt;br /&gt;
 ------- ----                   ----- ------                   -----         &lt;br /&gt;
 service:storage_an01           an-node01.alteeve.com          started       &lt;br /&gt;
 service:storage_an02           an-node02.alteeve.com          started       &lt;br /&gt;
 vm:vm0001-dev                  an-node01.alteeve.com          started       &lt;br /&gt;
 vm:vm0002-web                  (none)                         disabled      &lt;br /&gt;
 vm:vm0003-db                   (none)                         disabled      &lt;br /&gt;
 vm:vm0004-ms                   (none)                         disabled      &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Perfect! Now to add the other three VMs. Note that all of these commands can be run from whichever node you wish, because we&#039;re specifying the target node by using the &amp;quot;member&amp;quot; switch.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
clusvcadm -e vm:vm0002-web -m an-node01.alteeve.com&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
vm:vm0002-web is now running on an-node01.alteeve.com&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
clusvcadm -e vm:vm0003-db -m an-node02.alteeve.com&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
vm:vm0003-db is now running on an-node02.alteeve.com&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
clusvcadm -e vm:vm0004-ms -m an-node02.alteeve.com&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
vm:vm0004-ms is now running on an-node02.alteeve.com&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Let&#039;s do a final check of the cluster&#039;s status;&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-cluster-A @ Tue Dec 27 14:28:19 2011&lt;br /&gt;
Member Status: Quorate&lt;br /&gt;
&lt;br /&gt;
 Member Name                             ID   Status&lt;br /&gt;
 ------ ----                             ---- ------&lt;br /&gt;
 an-node01.alteeve.com                       1 Online, Local, rgmanager&lt;br /&gt;
 an-node02.alteeve.com                       2 Online, rgmanager&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State         &lt;br /&gt;
 ------- ----                   ----- ------                   -----         &lt;br /&gt;
 service:storage_an01           an-node01.alteeve.com          started       &lt;br /&gt;
 service:storage_an02           an-node02.alteeve.com          started       &lt;br /&gt;
 vm:vm0001-dev                  an-node01.alteeve.com          started       &lt;br /&gt;
 vm:vm0002-web                  an-node01.alteeve.com          started       &lt;br /&gt;
 vm:vm0003-db                   an-node02.alteeve.com          started       &lt;br /&gt;
 vm:vm0004-ms                   an-node02.alteeve.com          started       &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== The Last Step - Automatic Cluster Start ==&lt;br /&gt;
&lt;br /&gt;
The last step is to enable automatic starting of the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; services when the host node boots. This is quite simple;&lt;br /&gt;
&lt;br /&gt;
On both nodes, run;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
chkconfig cman on &amp;amp;&amp;amp; chkconfig rgmanager on&lt;br /&gt;
chkconfig --list | grep -e cman -e rgmanager&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;
cman           	0:off	1:off	2:on	3:on	4:on	5:on	6:off&lt;br /&gt;
rgmanager      	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;
The next time you restart the nodes, you will be able to run &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clustat&amp;lt;/span&amp;gt; and you should find your cluster up and running!&lt;br /&gt;
&lt;br /&gt;
== We&#039;re Done! Or, Are We? ==&lt;br /&gt;
&lt;br /&gt;
That&#039;s it, ladies and gentlemen. Our cluster is completed! In theory now, any failure in the cluster will result in no lost data and, at worst, no more than a minute or two of downtime.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;In theory&amp;quot; just isn&#039;t good enough in clustering though. Time to take &amp;quot;theory&amp;quot; and make it a tested, known fact.&lt;br /&gt;
&lt;br /&gt;
= Testing; Taking Theory And Putting It Into Practice =&lt;br /&gt;
&lt;br /&gt;
You may have thought that we were done. Indeed, the cluster has been built, but we don&#039;t know if things actually work.&lt;br /&gt;
&lt;br /&gt;
Enter testing.&lt;br /&gt;
&lt;br /&gt;
In practice, when preparing production clusters for deployment, you should plan to spend &#039;&#039;&#039;at least&#039;&#039;&#039; twice as long in testing as you did in building the cluster. You need to imagine all failure scenarios, trigger those failures and see what happens.&lt;br /&gt;
&lt;br /&gt;
== A Note On The Importance Of Fencing ==&lt;br /&gt;
&lt;br /&gt;
It may be tempting to think that you were careful and don&#039;t really need to test you cluster thoroughly.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;You are wrong&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Baring you being absolutely obsessive with testing every step of the way, you will almost certain make mistakes. Now I make no claims to genius, but I do like to think I am pretty comfortable building 2-node clusters. Despite that, while writing this testing portion of the tutorial, I found the following problems with my cluster;&lt;br /&gt;
&lt;br /&gt;
* RGManager&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;autostart=&amp;quot;1&amp;quot;&amp;lt;/span&amp;gt; is not evaluated when a node starts, only when quorum is gained. The mistake had me assuming that the storage services would start when the node restarted, after having manually disabled the service prior to node withdrawal.&lt;br /&gt;
* The behaviour of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;echo c &amp;gt; /proc/sysrq-trigger&amp;lt;/span&amp;gt; changed since [[EL5]] and now triggers a core dump with 100% CPU load in [[EL6]] KVM guests. This means that a previous expectation of the cluster recovering from these crashes was wrong.&lt;br /&gt;
* I forgot to install the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;obliterate-peer.sh&amp;lt;/span&amp;gt; script for DRBD, which I didn&#039;t catch until I tried to fail a node.&lt;br /&gt;
&lt;br /&gt;
You simply can&#039;t make assumptions. Test your cluster in every failure mode you can imagine. Until you do, you won&#039;t know what you might have missed!&lt;br /&gt;
&lt;br /&gt;
== Controlled VM Migration And Node Withdrawal ==&lt;br /&gt;
&lt;br /&gt;
This testing will ensure that live migration works in both directions, and that each node can be cleanly removed from and then rejoin the cluster.&lt;br /&gt;
&lt;br /&gt;
The test will consist of the following steps;&lt;br /&gt;
&lt;br /&gt;
# Live migrate &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0001-dev&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0002-web&amp;lt;/span&amp;gt; from &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt; to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt;. This will ensure live migration works and that all VMs will run on a single node.&lt;br /&gt;
# Withdraw &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt; from the cluster entirely and reboot it. This will ensure that cold shut-down of the node is successful.&lt;br /&gt;
# Once &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt; has rebooted, rejoin it to the cluster. This will ensure that rejoining the cluster works.&lt;br /&gt;
# Once &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt; is a member of the cluster, we will wait a few minutes and ensure that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0001-dev&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0002-web&amp;lt;/span&amp;gt; automatically live migrate back to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;. This will ensure that priority is working.&lt;br /&gt;
# We will live migrate &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0003-db&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0004-ms&amp;lt;/span&amp;gt; from &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt; to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt; to ensure that migration works in the other direction.&lt;br /&gt;
# With the VMs all running on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;, we will withdraw &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt; from the cluster, reboot it, rejoin it to the cluster and then confirm that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0003-db&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0004-ms&amp;lt;/span&amp;gt; automatically migrate back to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
With all of these tests completed, we will be able to ensure that order and controlled migration of VM services work as expected.&lt;br /&gt;
&lt;br /&gt;
=== Live Migration - vm0001-dev And vm0002-dev To an-node02 ===&lt;br /&gt;
&lt;br /&gt;
First up, we will use the special &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clusvcadm&amp;lt;/span&amp;gt; switch &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;-M&amp;lt;/span&amp;gt;, which tells the cluster to use &amp;quot;live migration&amp;quot;. This is, the VM will move to the target member without shutting down. Users of the VM should notice, and worst, a brief network interruption when the cut-over occurs, without any adverse effect on their services or dropped connections.&lt;br /&gt;
&lt;br /&gt;
Let&#039;s take a quick look at the state of affairs;&lt;br /&gt;
&lt;br /&gt;
On &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&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;
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-cluster-A @ Sat Dec 31 13:49: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-node01.alteeve.com                       1 Online, rgmanager&lt;br /&gt;
 an-node02.alteeve.com                       2 Online, Local, rgmanager&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State         &lt;br /&gt;
 ------- ----                   ----- ------                   -----         &lt;br /&gt;
 service:storage_an01           an-node01.alteeve.com          started       &lt;br /&gt;
 service:storage_an02           an-node02.alteeve.com          started       &lt;br /&gt;
 vm:vm0001-dev                  an-node01.alteeve.com          started       &lt;br /&gt;
 vm:vm0002-web                  an-node01.alteeve.com          started       &lt;br /&gt;
 vm:vm0003-db                   an-node02.alteeve.com          started       &lt;br /&gt;
 vm:vm0004-ms                   an-node02.alteeve.com          started       &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Lets start by live migrating &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0001-dev&amp;lt;/span&amp;gt;. Before we do though, let&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[ssh]]&amp;lt;/span&amp;gt; into it and start a ping against a target on the internet. We&#039;ll leave this running throughout the live migration.&lt;br /&gt;
&lt;br /&gt;
On &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0001-dev&amp;lt;/span&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
[[Image:vm0001-dev_ping_live-migration-test_01.png|thumb|700px|center|Running &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ping alteeve.com&amp;lt;/span&amp;gt; on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0001-dev&amp;lt;/span&amp;gt; prior to live migration.]]&lt;br /&gt;
&lt;br /&gt;
Now back on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;, let&#039;s migrate &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0001-dev&amp;lt;/span&amp;gt; over to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt;. This will take a little while as the VM&#039;s [[RAM]] gets copied across the [[BCN]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
clusvcadm -M vm:vm0001-dev -m an-node02.alteeve.com&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Trying to migrate vm:vm0001-dev to an-node02.alteeve.com...Success&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Image:vm0001-dev_ping_live-migration-test_02.png|thumb|700px|center|Mid-migration of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0001-dev&amp;lt;/span&amp;gt;.]]&lt;br /&gt;
&lt;br /&gt;
Once complete, check the new status of &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-cluster-A @ Sat Dec 31 14:11: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-node01.alteeve.com                       1 Online, rgmanager&lt;br /&gt;
 an-node02.alteeve.com                       2 Online, Local, rgmanager&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State         &lt;br /&gt;
 ------- ----                   ----- ------                   -----         &lt;br /&gt;
 service:storage_an01           an-node01.alteeve.com          started       &lt;br /&gt;
 service:storage_an02           an-node02.alteeve.com          started       &lt;br /&gt;
 vm:vm0001-dev                  an-node02.alteeve.com          started       &lt;br /&gt;
 vm:vm0002-web                  an-node01.alteeve.com          started       &lt;br /&gt;
 vm:vm0003-db                   an-node02.alteeve.com          started       &lt;br /&gt;
 vm:vm0004-ms                   an-node02.alteeve.com          started       &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If we look again at &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0001-dev&amp;lt;/span&amp;gt;&#039;s ping, we&#039;ll see that a few packets were dropped but our ssh session remained intact. Any other active [[TCP]] session should have survived this just fine as well.&lt;br /&gt;
&lt;br /&gt;
[[Image:vm0001-dev_ping_live-migration-test_03.png|thumb|700px|center|Results of the ping on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0001-dev&amp;lt;/span&amp;gt; post live migration.]]&lt;br /&gt;
&lt;br /&gt;
Wonderful! Now let&#039;s live migrate &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0002-web&amp;lt;/span&amp;gt; to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
clusvcadm -M vm:vm0002-web -m an-node02.alteeve.com&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Trying to migrate vm:vm0002-web to an-node02.alteeve.com...Success&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Again, check the new status of &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-cluster-A @ Sat Dec 31 14:17:35 2011&lt;br /&gt;
Member Status: Quorate&lt;br /&gt;
&lt;br /&gt;
 Member Name                             ID   Status&lt;br /&gt;
 ------ ----                             ---- ------&lt;br /&gt;
 an-node01.alteeve.com                       1 Online, rgmanager&lt;br /&gt;
 an-node02.alteeve.com                       2 Online, Local, rgmanager&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State         &lt;br /&gt;
 ------- ----                   ----- ------                   -----         &lt;br /&gt;
 service:storage_an01           an-node01.alteeve.com          started       &lt;br /&gt;
 service:storage_an02           an-node02.alteeve.com          started       &lt;br /&gt;
 vm:vm0001-dev                  an-node02.alteeve.com          started       &lt;br /&gt;
 vm:vm0002-web                  an-node02.alteeve.com          started       &lt;br /&gt;
 vm:vm0003-db                   an-node02.alteeve.com          started       &lt;br /&gt;
 vm:vm0004-ms                   an-node02.alteeve.com          started       &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can see now that all four VMs are running on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt;! This is possible because of our careful planning of the VM resources earlier. This will mean more load on the host node&#039;s CPU, so things might not be as fast as we would like, but all services are on-line!&lt;br /&gt;
&lt;br /&gt;
=== Withdraw an-node01 From The Cluster ===&lt;br /&gt;
&lt;br /&gt;
So imagine now that we need to do some work on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;, like replace a bad network card or add some RAM. We&#039;ve moved the VMs off, so now the only remaining service is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;service:storage_an01&amp;lt;/span&amp;gt;. We don&#039;t want to manually disable this service, because if we did, the service would not automatically start when the node rejoined the cluster. So we&#039;re going to just stop &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; and let it disable the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;storage_an01&amp;lt;/span&amp;gt; service.&lt;br /&gt;
&lt;br /&gt;
Check the state of the cluster;&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-cluster-A @ Sun Jan  1 16:11:56 2012&lt;br /&gt;
Member Status: Quorate&lt;br /&gt;
&lt;br /&gt;
 Member Name                             ID   Status&lt;br /&gt;
 ------ ----                             ---- ------&lt;br /&gt;
 an-node01.alteeve.com                       1 Online, Local, rgmanager&lt;br /&gt;
 an-node02.alteeve.com                       2 Online, rgmanager&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State         &lt;br /&gt;
 ------- ----                   ----- ------                   -----         &lt;br /&gt;
 service:storage_an01           an-node01.alteeve.com          started       &lt;br /&gt;
 service:storage_an02           an-node02.alteeve.com          started       &lt;br /&gt;
 vm:vm0001-dev                  an-node02.alteeve.com          started       &lt;br /&gt;
 vm:vm0002-web                  an-node02.alteeve.com          started       &lt;br /&gt;
 vm:vm0003-db                   an-node02.alteeve.com          started       &lt;br /&gt;
 vm:vm0004-ms                   an-node02.alteeve.com          started       &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Just as we expect, so now we will stop &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt;, then stop &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
On &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;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 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 Service Manager:                          [  OK  ]&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/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;
   Leaving fence domain...                                 [  OK  ]&lt;br /&gt;
   Stopping gfs_controld...                                [  OK  ]&lt;br /&gt;
   Stopping dlm_controld...                                [  OK  ]&lt;br /&gt;
   Stopping fenced...                                      [  OK  ]&lt;br /&gt;
   Stopping cman...                                        [  OK  ]&lt;br /&gt;
   Waiting for corosync to shutdown:                       [  OK  ]&lt;br /&gt;
   Unloading kernel modules...                             [  OK  ]&lt;br /&gt;
   Unmounting configfs...                                  [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checking on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt;, we can see that all four VMs are running fine and that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt; is gone.&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-cluster-A @ Sun Jan  1 16:13:23 2012&lt;br /&gt;
Member Status: Quorate&lt;br /&gt;
&lt;br /&gt;
 Member Name                             ID   Status&lt;br /&gt;
 ------ ----                             ---- ------&lt;br /&gt;
 an-node01.alteeve.com                       1 Offline&lt;br /&gt;
 an-node02.alteeve.com                       2 Online, Local, rgmanager&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State         &lt;br /&gt;
 ------- ----                   ----- ------                   -----         &lt;br /&gt;
 service:storage_an01           (an-node01.alteeve.com)        stopped       &lt;br /&gt;
 service:storage_an02           an-node02.alteeve.com          started       &lt;br /&gt;
 vm:vm0001-dev                  an-node02.alteeve.com          started       &lt;br /&gt;
 vm:vm0002-web                  an-node02.alteeve.com          started       &lt;br /&gt;
 vm:vm0003-db                   an-node02.alteeve.com          started       &lt;br /&gt;
 vm:vm0004-ms                   an-node02.alteeve.com          started       &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Test passed!&lt;br /&gt;
&lt;br /&gt;
You can now power off and restart &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Rejoining an-node01 To The Cluster ===&lt;br /&gt;
&lt;br /&gt;
If you haven&#039;t already, reboot &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;. As we set earlier, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; will start automatically. The easiest thing to do for this test is to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;watch clustat&amp;lt;/span&amp;gt; on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt;. If all goes well, you should see &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt; rejoin the cluster automatically.&lt;br /&gt;
&lt;br /&gt;
Connected to cluster;&lt;br /&gt;
&lt;br /&gt;
[[Image:2nrhkct_automatic-reconnect-an-node01_01.png|thumb|700px|center|Rebooting &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;, while &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt; hosts all four VMs.]]&lt;br /&gt;
&lt;br /&gt;
Storage coming on-line;&lt;br /&gt;
&lt;br /&gt;
[[Image:2nrhkct_automatic-reconnect-an-node01_02.png|thumb|700px|center|Storage coming up on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;.]]&lt;br /&gt;
&lt;br /&gt;
Back in business!&lt;br /&gt;
&lt;br /&gt;
[[Image:2nrhkct_automatic-reconnect-an-node01_03.png|thumb|700px|center|Back in business!]]&lt;br /&gt;
&lt;br /&gt;
You should be able to log back into &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt; and see that everything is back on-line. DRBD should be &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;UpToDate&amp;lt;/span&amp;gt;, or be in the process of synchronizing. &lt;br /&gt;
&lt;br /&gt;
{{warning|1=Never migrate a VM to a node until its underlying DRBD resource is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;UpToDate&amp;lt;/span&amp;gt;! If the sync source node (the one that is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;UpToDate&amp;lt;/span&amp;gt;) goes down, DRBD will drop the resource to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Secondary&amp;lt;/span&amp;gt;, making it inaccessible to the node and crashing the VM.}}&lt;br /&gt;
&lt;br /&gt;
=== Migrating vm0001-dev And vm0002-web Back To an-node01 ===&lt;br /&gt;
&lt;br /&gt;
If we were putting the cluster back into its normal state, all that would be left to do is to migrate &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;&#039;s VMs back. So let&#039;s do that. &lt;br /&gt;
&lt;br /&gt;
As always, start with a check of the current cluster status.&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-cluster-A @ Sun Jan  1 16:31:06 2012&lt;br /&gt;
Member Status: Quorate&lt;br /&gt;
&lt;br /&gt;
 Member Name                             ID   Status&lt;br /&gt;
 ------ ----                             ---- ------&lt;br /&gt;
 an-node01.alteeve.com                       1 Online, Local, rgmanager&lt;br /&gt;
 an-node02.alteeve.com                       2 Online, rgmanager&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State         &lt;br /&gt;
 ------- ----                   ----- ------                   -----         &lt;br /&gt;
 service:storage_an01           an-node01.alteeve.com          started       &lt;br /&gt;
 service:storage_an02           an-node02.alteeve.com          started       &lt;br /&gt;
 vm:vm0001-dev                  an-node02.alteeve.com          started       &lt;br /&gt;
 vm:vm0002-web                  an-node02.alteeve.com          started       &lt;br /&gt;
 vm:vm0003-db                   an-node02.alteeve.com          started       &lt;br /&gt;
 vm:vm0004-ms                   an-node02.alteeve.com          started       &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now confirm that the underlying storage is ready. Remember that DRBD resource &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;r1&amp;lt;/span&amp;gt; backs the VMs used by the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an01-vg0&amp;lt;/span&amp;gt; volume groups.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
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;
version: 8.3.12 (api:88/proto:86-96)&lt;br /&gt;
GIT-hash: e2a8ef4656be026bbae540305fcb998a5991090f build by dag@Build64R6, 2011-11-20 10:57:03&lt;br /&gt;
 0: cs:Connected ro:Primary/Primary ds:UpToDate/UpToDate C r-----&lt;br /&gt;
    ns:0 nr:0 dw:0 dr:12552 al:0 bm:0 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:0 nr:2428 dw:2428 dr:9776 al:0 bm:4 lo:0 pe:0 ua:0 ap:0 ep:1 wo:f oos:0&lt;br /&gt;
 2: cs:Connected ro:Primary/Primary ds:UpToDate/UpToDate C r-----&lt;br /&gt;
    ns:0 nr:510 dw:510 dr:9744 al:0 bm:4 lo:0 pe:0 ua:0 ap:0 ep:1 wo:f oos:0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
All systems ready; Let&#039;s migrate &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0001-dev&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0002-web&amp;lt;/span&amp;gt; now.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
clusvcadm -M vm:vm0001-dev -m an-node01.alteeve.com&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Trying to migrate vm:vm0001-dev to an-node01.alteeve.com...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 -M vm:vm0002-web -m an-node01.alteeve.com&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Trying to migrate vm:vm0002-web to an-node01.alteeve.com...Success&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check the new status;&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-cluster-A @ Sun Jan  1 16:32:11 2012&lt;br /&gt;
Member Status: Quorate&lt;br /&gt;
&lt;br /&gt;
 Member Name                             ID   Status&lt;br /&gt;
 ------ ----                             ---- ------&lt;br /&gt;
 an-node01.alteeve.com                       1 Online, Local, rgmanager&lt;br /&gt;
 an-node02.alteeve.com                       2 Online, rgmanager&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State         &lt;br /&gt;
 ------- ----                   ----- ------                   -----         &lt;br /&gt;
 service:storage_an01           an-node01.alteeve.com          started       &lt;br /&gt;
 service:storage_an02           an-node02.alteeve.com          started       &lt;br /&gt;
 vm:vm0001-dev                  an-node01.alteeve.com          started       &lt;br /&gt;
 vm:vm0002-web                  an-node01.alteeve.com          started       &lt;br /&gt;
 vm:vm0003-db                   an-node02.alteeve.com          started       &lt;br /&gt;
 vm:vm0004-ms                   an-node02.alteeve.com          started       &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With that, the cluster is back in business!&lt;br /&gt;
&lt;br /&gt;
=== Live Migration - vm0003-db And vm0004-ms To an-node01 ===&lt;br /&gt;
&lt;br /&gt;
Let&#039;s start the process of taking &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt; out of the cluster. The first step is to move &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0003-db&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0004-ms&amp;lt;/span&amp;gt; over to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;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-cluster-A @ Sun Jan  1 16:42:10 2012&lt;br /&gt;
Member Status: Quorate&lt;br /&gt;
&lt;br /&gt;
 Member Name                             ID   Status&lt;br /&gt;
 ------ ----                             ---- ------&lt;br /&gt;
 an-node01.alteeve.com                       1 Online, Local, rgmanager&lt;br /&gt;
 an-node02.alteeve.com                       2 Online, rgmanager&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State         &lt;br /&gt;
 ------- ----                   ----- ------                   -----         &lt;br /&gt;
 service:storage_an01           an-node01.alteeve.com          started       &lt;br /&gt;
 service:storage_an02           an-node02.alteeve.com          started       &lt;br /&gt;
 vm:vm0001-dev                  an-node01.alteeve.com          started       &lt;br /&gt;
 vm:vm0002-web                  an-node01.alteeve.com          started       &lt;br /&gt;
 vm:vm0003-db                   an-node02.alteeve.com          started       &lt;br /&gt;
 vm:vm0004-ms                   an-node02.alteeve.com          started       &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Ready to migrate.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
clusvcadm -M vm:vm0003-db -m an-node01.alteeve.com&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Trying to migrate vm:vm0003-db to an-node01.alteeve.com...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 -M vm:vm0004-ms -m an-node01.alteeve.com&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Trying to migrate vm:vm0004-ms to an-node01.alteeve.com...Success&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Confirm;&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-cluster-A @ Sun Jan  1 16:42:42 2012&lt;br /&gt;
Member Status: Quorate&lt;br /&gt;
&lt;br /&gt;
 Member Name                             ID   Status&lt;br /&gt;
 ------ ----                             ---- ------&lt;br /&gt;
 an-node01.alteeve.com                       1 Online, Local, rgmanager&lt;br /&gt;
 an-node02.alteeve.com                       2 Online, rgmanager&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State         &lt;br /&gt;
 ------- ----                   ----- ------                   -----         &lt;br /&gt;
 service:storage_an01           an-node01.alteeve.com          started       &lt;br /&gt;
 service:storage_an02           an-node02.alteeve.com          started       &lt;br /&gt;
 vm:vm0001-dev                  an-node01.alteeve.com          started       &lt;br /&gt;
 vm:vm0002-web                  an-node01.alteeve.com          started       &lt;br /&gt;
 vm:vm0003-db                   an-node01.alteeve.com          started       &lt;br /&gt;
 vm:vm0004-ms                   an-node01.alteeve.com          started       &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Done!&lt;br /&gt;
&lt;br /&gt;
=== Withdraw an-node02 From The Cluster ===&lt;br /&gt;
&lt;br /&gt;
Double-check that all the VMs are off of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt; prior to withdrawal.&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-cluster-A @ Sun Jan  1 16:45:30 2012&lt;br /&gt;
Member Status: Quorate&lt;br /&gt;
&lt;br /&gt;
 Member Name                             ID   Status&lt;br /&gt;
 ------ ----                             ---- ------&lt;br /&gt;
 an-node01.alteeve.com                       1 Online, Local, rgmanager&lt;br /&gt;
 an-node02.alteeve.com                       2 Online, rgmanager&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State         &lt;br /&gt;
 ------- ----                   ----- ------                   -----         &lt;br /&gt;
 service:storage_an01           an-node01.alteeve.com          started       &lt;br /&gt;
 service:storage_an02           an-node02.alteeve.com          started       &lt;br /&gt;
 vm:vm0001-dev                  an-node01.alteeve.com          started       &lt;br /&gt;
 vm:vm0002-web                  an-node01.alteeve.com          started       &lt;br /&gt;
 vm:vm0003-db                   an-node01.alteeve.com          started       &lt;br /&gt;
 vm:vm0004-ms                   an-node01.alteeve.com          started       &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As before, we &#039;&#039;&#039;will not&#039;&#039;&#039; disable the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;storage_an02&amp;lt;/span&amp;gt; service. If we did, the service would not automatically restart when the node rejoined the cluster.&lt;br /&gt;
&lt;br /&gt;
So now that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt; is hosting all of the VMs and is running independently. Now we can stop &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;cman&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
On &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;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 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 Service Manager:                          [  OK  ]&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/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;
   Leaving fence domain...                                 [  OK  ]&lt;br /&gt;
   Stopping gfs_controld...                                [  OK  ]&lt;br /&gt;
   Stopping dlm_controld...                                [  OK  ]&lt;br /&gt;
   Stopping fenced...                                      [  OK  ]&lt;br /&gt;
   Stopping cman...                                        [  OK  ]&lt;br /&gt;
   Waiting for corosync to shutdown:                       [  OK  ]&lt;br /&gt;
   Unloading kernel modules...                             [  OK  ]&lt;br /&gt;
   Unmounting configfs...                                  [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Confirm;&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-cluster-A @ Sun Jan  1 16:49:14 2012&lt;br /&gt;
Member Status: Quorate&lt;br /&gt;
&lt;br /&gt;
 Member Name                             ID   Status&lt;br /&gt;
 ------ ----                             ---- ------&lt;br /&gt;
 an-node01.alteeve.com                       1 Online, Local, rgmanager&lt;br /&gt;
 an-node02.alteeve.com                       2 Offline&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State&lt;br /&gt;
 ------- ----                   ----- ------                   -----&lt;br /&gt;
 service:storage_an01           an-node01.alteeve.com          started&lt;br /&gt;
 service:storage_an02           (an-node02.alteeve.com)        stopped&lt;br /&gt;
 vm:vm0001-dev                  an-node01.alteeve.com          started&lt;br /&gt;
 vm:vm0002-web                  an-node01.alteeve.com          started&lt;br /&gt;
 vm:vm0003-db                   an-node01.alteeve.com          started&lt;br /&gt;
 vm:vm0004-ms                   an-node01.alteeve.com          started&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Done! We can now shut down and reboot &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt; entirely.&lt;br /&gt;
&lt;br /&gt;
=== Rejoining an-node02 To The Cluster ===&lt;br /&gt;
&lt;br /&gt;
Exactly as we did with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;, we will reboot &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt;. The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; services should start automatically, so once again, we will just &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;watch clustat&amp;lt;/span&amp;gt; on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;. If all goes well, you should see &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt; rejoin the cluster automatically.&lt;br /&gt;
&lt;br /&gt;
Connected to cluster;&lt;br /&gt;
&lt;br /&gt;
[[Image:2nrhkct_automatic-reconnect-an-node02_01.png|thumb|700px|center|Rebooting &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt;, while &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt; hosts all four VMs.]]&lt;br /&gt;
&lt;br /&gt;
Storage coming on-line;&lt;br /&gt;
&lt;br /&gt;
[[Image:2nrhkct_automatic-reconnect-an-node02_02.png|thumb|700px|center|Storage coming up on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt;.]]&lt;br /&gt;
&lt;br /&gt;
Back in business!&lt;br /&gt;
&lt;br /&gt;
[[Image:2nrhkct_automatic-reconnect-an-node02_03.png|thumb|700px|center|Back in business!]]&lt;br /&gt;
&lt;br /&gt;
You should be able to log back into &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt; and see that everything is back on-line. DRBD should be &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;UpToDate&amp;lt;/span&amp;gt;, or be in the process of synchronizing.&lt;br /&gt;
&lt;br /&gt;
{{warning|1=Again; Never migrate a VM to a node until its underlying DRBD resource is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;UpToDate&amp;lt;/span&amp;gt;! If the sync source node (the one that is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;UpToDate&amp;lt;/span&amp;gt;) goes down, DRBD will drop the resource to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Secondary&amp;lt;/span&amp;gt;, making it inaccessible to the node and crashing the VM.}}&lt;br /&gt;
&lt;br /&gt;
=== Migrating vm0003-db And vm0004-ms Back To an-node02 ===&lt;br /&gt;
&lt;br /&gt;
The last step to restore the cluster to its ideal state is to migrate &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0003-db&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0004-ms&amp;lt;/span&amp;gt; back to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
As always, start with a check of the current cluster status.&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-cluster-A @ Sun Jan  1 16:57:19 2012&lt;br /&gt;
Member Status: Quorate&lt;br /&gt;
&lt;br /&gt;
 Member Name                             ID   Status&lt;br /&gt;
 ------ ----                             ---- ------&lt;br /&gt;
 an-node01.alteeve.com                       1 Online, rgmanager&lt;br /&gt;
 an-node02.alteeve.com                       2 Online, Local, rgmanager&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State         &lt;br /&gt;
 ------- ----                   ----- ------                   -----         &lt;br /&gt;
 service:storage_an01           an-node01.alteeve.com          started       &lt;br /&gt;
 service:storage_an02           an-node02.alteeve.com          started       &lt;br /&gt;
 vm:vm0001-dev                  an-node01.alteeve.com          started       &lt;br /&gt;
 vm:vm0002-web                  an-node01.alteeve.com          started       &lt;br /&gt;
 vm:vm0003-db                   an-node01.alteeve.com          started       &lt;br /&gt;
 vm:vm0004-ms                   an-node01.alteeve.com          started       &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now confirm that the underlying storage is ready. Remember that DRBD resource &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;r2&amp;lt;/span&amp;gt; backs the VMs used by the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an02-vg0&amp;lt;/span&amp;gt; volume groups.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
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;
version: 8.3.12 (api:88/proto:86-96)&lt;br /&gt;
GIT-hash: e2a8ef4656be026bbae540305fcb998a5991090f build by dag@Build64R6, 2011-11-20 10:57:03&lt;br /&gt;
 0: cs:Connected ro:Primary/Primary ds:UpToDate/UpToDate C r-----&lt;br /&gt;
    ns:0 nr:0 dw:0 dr:8788 al:0 bm:0 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:0 nr:376 dw:376 dr:5876 al:0 bm:7 lo:0 pe:0 ua:0 ap:0 ep:1 wo:f oos:0&lt;br /&gt;
 2: cs:Connected ro:Primary/Primary ds:UpToDate/UpToDate C r-----&lt;br /&gt;
    ns:0 nr:671 dw:671 dr:5844 al:0 bm:16 lo:0 pe:0 ua:0 ap:0 ep:1 wo:f oos:0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
All systems ready; Let&#039;s migrate &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0003-db&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0004-ms&amp;lt;/span&amp;gt; now.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
clusvcadm -M vm:vm0003-db -m an-node02.alteeve.com&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Trying to migrate vm:vm0003-db to an-node02.alteeve.com...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 -M vm:vm0004-ms -m an-node02.alteeve.com&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Trying to migrate vm:vm0004-ms to an-node02.alteeve.com...Success&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check the new status;&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-cluster-A @ Sun Jan  1 16:59:22 2012&lt;br /&gt;
Member Status: Quorate&lt;br /&gt;
&lt;br /&gt;
 Member Name                             ID   Status&lt;br /&gt;
 ------ ----                             ---- ------&lt;br /&gt;
 an-node01.alteeve.com                       1 Online, rgmanager&lt;br /&gt;
 an-node02.alteeve.com                       2 Online, Local, rgmanager&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State         &lt;br /&gt;
 ------- ----                   ----- ------                   -----         &lt;br /&gt;
 service:storage_an01           an-node01.alteeve.com          started       &lt;br /&gt;
 service:storage_an02           an-node02.alteeve.com          started       &lt;br /&gt;
 vm:vm0001-dev                  an-node01.alteeve.com          started       &lt;br /&gt;
 vm:vm0002-web                  an-node01.alteeve.com          started       &lt;br /&gt;
 vm:vm0003-db                   an-node02.alteeve.com          started       &lt;br /&gt;
 vm:vm0004-ms                   an-node02.alteeve.com          started       &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
All controlled migration, withdrawal and re-joining tests completed!&lt;br /&gt;
&lt;br /&gt;
== Uncontrolled VM Migration and Node Failure ==&lt;br /&gt;
&lt;br /&gt;
This test will be more violent than the previous tests. Here we will test failing the VMs and ensuring that the cluster will recover the VMs by restarting them on the hosts. We will repeatedly fail the VMs three times within ten minutes to ensure that the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;relocate&amp;lt;/span&amp;gt; policy kicks in, as we expect it to.&lt;br /&gt;
&lt;br /&gt;
Once we complete the VM failure testing, we will fail and recover both nodes, one at a time of course, and rejoin them to the cluster. This will confirm that the VMs recover on the surviving node.&lt;br /&gt;
&lt;br /&gt;
The tests will be;&lt;br /&gt;
&lt;br /&gt;
* Crash all four VMs three times. The failures will be triggered by using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virsh destroy &amp;lt;vm&amp;gt;&amp;lt;/span&amp;gt; on the current host node.&lt;br /&gt;
* After each crash, we will confirm that the VM came back on-line before crashing it again.&lt;br /&gt;
* With all of the VMs tested to recover properly, we will live-migrate them back to their designated host nodes.&lt;br /&gt;
* Once the cluster is back into its ideal state, we will crash &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;. Within a few seconds, it should be [[fenced]] and the lost VMs should restart on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt;. Once it rejoins the cluster and the VMs return to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;, we will repeat the test by failing &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Failure Testing vm0001-dev ===&lt;br /&gt;
&lt;br /&gt;
Confirm that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0001-dev&amp;lt;/span&amp;gt; is running on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;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-cluster-A @ Sun Jan  1 18:29:10 2012&lt;br /&gt;
Member Status: Quorate&lt;br /&gt;
&lt;br /&gt;
 Member Name                             ID   Status&lt;br /&gt;
 ------ ----                             ---- ------&lt;br /&gt;
 an-node01.alteeve.com                       1 Online, Local, rgmanager&lt;br /&gt;
 an-node02.alteeve.com                       2 Online, rgmanager&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State&lt;br /&gt;
 ------- ----                   ----- ------                   -----&lt;br /&gt;
 service:storage_an01           an-node01.alteeve.com          started&lt;br /&gt;
 service:storage_an02           an-node02.alteeve.com          started&lt;br /&gt;
 vm:vm0001-dev                  an-node01.alteeve.com          started&lt;br /&gt;
 vm:vm0002-web                  an-node01.alteeve.com          started&lt;br /&gt;
 vm:vm0003-db                   an-node02.alteeve.com          started&lt;br /&gt;
 vm:vm0004-ms                   an-node02.alteeve.com          started&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is, perfect. Now before I kill a VM, I like to start a ping against it. It acts both as an indication of when the node is back up and acts as a crude method of timing how long it took the VM to fully recover.&lt;br /&gt;
&lt;br /&gt;
{{note|1=If your VMs are isolated, as they are in this tutorial, you may have to run the ping from another VM or from your firewall.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ping 10.254.0.1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
PING 10.254.0.1 (10.254.0.1) 56(84) bytes of data.&lt;br /&gt;
64 bytes from 10.254.0.1: icmp_seq=1 ttl=64 time=0.737 ms&lt;br /&gt;
64 bytes from 10.254.0.1: icmp_seq=2 ttl=64 time=0.530 ms&lt;br /&gt;
64 bytes from 10.254.0.1: icmp_seq=3 ttl=64 time=0.589 ms&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-node01&amp;lt;/span&amp;gt;, forcefully shut down &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0001-dev&amp;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 destroy vm0001-dev&lt;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-dev destroyed&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Within a few seconds (10, maximum), the cluster will detect that the VM has failed and will restart it.&lt;br /&gt;
&lt;br /&gt;
[[Image:2nrhkct_failing-vm0001-dev_01.png|thumb|700px|center|Failure of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0001-dev&amp;lt;/span&amp;gt; detected by the cluster and restarted.]]&lt;br /&gt;
&lt;br /&gt;
We can see in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;&#039;s syslog that the failure was detected and automatically recovered.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Jan  1 18:38:25 an-node01 kernel: vbr2: port 2(vnet0) entering disabled state&lt;br /&gt;
Jan  1 18:38:25 an-node01 kernel: device vnet0 left promiscuous mode&lt;br /&gt;
Jan  1 18:38:25 an-node01 kernel: vbr2: port 2(vnet0) entering disabled state&lt;br /&gt;
Jan  1 18:38:27 an-node01 ntpd[2190]: Deleting interface #19 vnet0, fe80::fc54:ff:fe9b:3cf7#123, interface stats: received=0, sent=0, dropped=0, active_time=3058 secs&lt;br /&gt;
Jan  1 18:38:35 an-node01 rgmanager[2430]: status on vm &amp;quot;vm0001-dev&amp;quot; returned 7 (unspecified)&lt;br /&gt;
Jan  1 18:38:35 an-node01 rgmanager[2430]: Stopping service vm:vm0001-dev&lt;br /&gt;
Jan  1 18:38:36 an-node01 rgmanager[2430]: Service vm:vm0001-dev is recovering&lt;br /&gt;
Jan  1 18:38:36 an-node01 rgmanager[2430]: Recovering failed service vm:vm0001-dev&lt;br /&gt;
Jan  1 18:38:37 an-node01 kernel: device vnet0 entered promiscuous mode&lt;br /&gt;
Jan  1 18:38:37 an-node01 kernel: vbr2: port 2(vnet0) entering learning state&lt;br /&gt;
Jan  1 18:38:37 an-node01 rgmanager[2430]: Service vm:vm0001-dev started&lt;br /&gt;
Jan  1 18:38:39 an-node01 ntpd[2190]: Listening on interface #20 vnet0, fe80::fc54:ff:fe9b:3cf7#123 Enabled&lt;br /&gt;
Jan  1 18:38:49 an-node01 kernel: kvm: 12390: cpu0 unimplemented perfctr wrmsr: 0xc1 data 0xabcd&lt;br /&gt;
Jan  1 18:38:52 an-node01 kernel: vbr2: port 2(vnet0) entering forwarding state&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The first four entries are related to the VM&#039;s network being torn down after it was killed. The fifth through eighth lines show the detection and recovery of the node!&lt;br /&gt;
&lt;br /&gt;
Going back to the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ping&amp;lt;/span&amp;gt;, we can see that the VM was down for roughly 36 seconds (time between network loss and recovery, add a bit more time for all services to start.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
PING 10.254.0.1 (10.254.0.1) 56(84) bytes of data.&lt;br /&gt;
64 bytes from 10.254.0.1: icmp_seq=1 ttl=64 time=0.737 ms&lt;br /&gt;
64 bytes from 10.254.0.1: icmp_seq=2 ttl=64 time=0.530 ms&lt;br /&gt;
64 bytes from 10.254.0.1: icmp_seq=3 ttl=64 time=0.589 ms&lt;br /&gt;
64 bytes from 10.254.0.1: icmp_seq=4 ttl=64 time=0.589 ms&lt;br /&gt;
64 bytes from 10.254.0.1: icmp_seq=5 ttl=64 time=0.477 ms&lt;br /&gt;
64 bytes from 10.254.0.1: icmp_seq=6 ttl=64 time=0.482 ms&lt;br /&gt;
64 bytes from 10.254.0.1: icmp_seq=7 ttl=64 time=0.489 ms&lt;br /&gt;
64 bytes from 10.254.0.1: icmp_seq=8 ttl=64 time=0.495 ms&lt;br /&gt;
64 bytes from 10.254.0.1: icmp_seq=9 ttl=64 time=0.503 ms&lt;br /&gt;
64 bytes from 10.254.0.1: icmp_seq=10 ttl=64 time=0.513 ms&lt;br /&gt;
64 bytes from 10.254.0.1: icmp_seq=11 ttl=64 time=0.516 ms&lt;br /&gt;
64 bytes from 10.254.0.1: icmp_seq=12 ttl=64 time=0.524 ms&lt;br /&gt;
64 bytes from 10.254.0.1: icmp_seq=13 ttl=64 time=0.405 ms&lt;br /&gt;
64 bytes from 10.254.0.1: icmp_seq=14 ttl=64 time=0.536 ms&lt;br /&gt;
64 bytes from 10.254.0.1: icmp_seq=15 ttl=64 time=0.441 ms&lt;br /&gt;
64 bytes from 10.254.0.1: icmp_seq=16 ttl=64 time=0.552 ms&lt;br /&gt;
&lt;br /&gt;
# Node died here, 36 pings lost at ~1 ping/sec.&lt;br /&gt;
&lt;br /&gt;
64 bytes from 10.254.0.1: icmp_seq=52 ttl=64 time=0.816 ms&lt;br /&gt;
64 bytes from 10.254.0.1: icmp_seq=53 ttl=64 time=0.440 ms&lt;br /&gt;
64 bytes from 10.254.0.1: icmp_seq=54 ttl=64 time=0.354 ms&lt;br /&gt;
64 bytes from 10.254.0.1: icmp_seq=55 ttl=64 time=0.342 ms&lt;br /&gt;
64 bytes from 10.254.0.1: icmp_seq=56 ttl=64 time=0.446 ms&lt;br /&gt;
64 bytes from 10.254.0.1: icmp_seq=57 ttl=64 time=0.418 ms&lt;br /&gt;
64 bytes from 10.254.0.1: icmp_seq=58 ttl=64 time=0.441 ms&lt;br /&gt;
^C&lt;br /&gt;
--- 10.254.0.1 ping statistics ---&lt;br /&gt;
58 packets transmitted, 23 received, 60% packet loss, time 57949ms&lt;br /&gt;
rtt min/avg/max/mdev = 0.342/0.505/0.816/0.109 ms&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Not bad at all!&lt;br /&gt;
&lt;br /&gt;
Now let&#039;s kill it two more times and confirm that the third recovery happens on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt;. We&#039;ll use the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ping&amp;lt;/span&amp;gt; as an indicator of when the VM is back on-line before killing it the third time.&lt;br /&gt;
&lt;br /&gt;
Second failure;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
virsh destroy vm0001-dev&lt;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-dev destroyed&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checking syslog again;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Jan  1 18:45:07 an-node01 kernel: vbr2: port 2(vnet0) entering disabled state&lt;br /&gt;
Jan  1 18:45:07 an-node01 kernel: device vnet0 left promiscuous mode&lt;br /&gt;
Jan  1 18:45:07 an-node01 kernel: vbr2: port 2(vnet0) entering disabled state&lt;br /&gt;
Jan  1 18:45:09 an-node01 ntpd[2190]: Deleting interface #20 vnet0, fe80::fc54:ff:fe9b:3cf7#123, interface stats: received=0, sent=0, dropped=0, active_time=390 secs&lt;br /&gt;
Jan  1 18:45:46 an-node01 rgmanager[2430]: status on vm &amp;quot;vm0001-dev&amp;quot; returned 7 (unspecified)&lt;br /&gt;
Jan  1 18:45:46 an-node01 rgmanager[2430]: Stopping service vm:vm0001-dev&lt;br /&gt;
Jan  1 18:45:46 an-node01 rgmanager[2430]: Service vm:vm0001-dev is recovering&lt;br /&gt;
Jan  1 18:45:47 an-node01 rgmanager[2430]: Recovering failed service vm:vm0001-dev&lt;br /&gt;
Jan  1 18:45:47 an-node01 kernel: device vnet0 entered promiscuous mode&lt;br /&gt;
Jan  1 18:45:47 an-node01 kernel: vbr2: port 2(vnet0) entering learning state&lt;br /&gt;
Jan  1 18:45:47 an-node01 rgmanager[2430]: Service vm:vm0001-dev started&lt;br /&gt;
Jan  1 18:45:50 an-node01 ntpd[2190]: Listening on interface #21 vnet0, fe80::fc54:ff:fe9b:3cf7#123 Enabled&lt;br /&gt;
Jan  1 18:45:59 an-node01 kernel: kvm: 17874: cpu0 unimplemented perfctr wrmsr: 0xc1 data 0xabcd&lt;br /&gt;
Jan  1 18:46:02 an-node01 kernel: vbr2: port 2(vnet0) entering forwarding state&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can see that the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0001-dev&amp;lt;/span&amp;gt; VM is still on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;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-cluster-A @ Sun Jan  1 18:47:01 2012&lt;br /&gt;
Member Status: Quorate&lt;br /&gt;
&lt;br /&gt;
 Member Name                             ID   Status&lt;br /&gt;
 ------ ----                             ---- ------&lt;br /&gt;
 an-node01.alteeve.com                       1 Online, rgmanager&lt;br /&gt;
 an-node02.alteeve.com                       2 Online, Local, rgmanager&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State&lt;br /&gt;
 ------- ----                   ----- ------                   -----&lt;br /&gt;
 service:storage_an01           an-node01.alteeve.com          started&lt;br /&gt;
 service:storage_an02           an-node02.alteeve.com          started&lt;br /&gt;
 vm:vm0001-dev                  an-node01.alteeve.com          started&lt;br /&gt;
 vm:vm0002-web                  an-node01.alteeve.com          started&lt;br /&gt;
 vm:vm0003-db                   an-node02.alteeve.com          started&lt;br /&gt;
 vm:vm0004-ms                   an-node02.alteeve.com          started&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now the third crash. This time it should come up on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;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 destroy vm0001-dev&lt;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-dev destroyed&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checking &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;&#039;s syslog again, we&#039;ll see something different.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Jan  1 18:47:26 an-node01 kernel: vbr2: port 2(vnet0) entering disabled state&lt;br /&gt;
Jan  1 18:47:26 an-node01 kernel: device vnet0 left promiscuous mode&lt;br /&gt;
Jan  1 18:47:26 an-node01 kernel: vbr2: port 2(vnet0) entering disabled state&lt;br /&gt;
Jan  1 18:47:27 an-node01 ntpd[2190]: Deleting interface #21 vnet0, fe80::fc54:ff:fe9b:3cf7#123, interface stats: received=0, sent=0, dropped=0, active_time=97 secs&lt;br /&gt;
Jan  1 18:47:46 an-node01 rgmanager[2430]: status on vm &amp;quot;vm0001-dev&amp;quot; returned 7 (unspecified)&lt;br /&gt;
Jan  1 18:47:46 an-node01 rgmanager[2430]: Stopping service vm:vm0001-dev&lt;br /&gt;
Jan  1 18:47:46 an-node01 rgmanager[2430]: Service vm:vm0001-dev is recovering&lt;br /&gt;
Jan  1 18:47:46 an-node01 rgmanager[2430]: Restart threshold for vm:vm0001-dev exceeded; attempting to relocate&lt;br /&gt;
Jan  1 18:47:47 an-node01 rgmanager[2430]: Service vm:vm0001-dev is now running on member 2&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The difference is the &amp;quot;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Restart threshold for vm:vm0001-dev exceeded; attempting to relocate&amp;lt;/span&amp;gt;&amp;quot; line. Indeed, if we check &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clustat&amp;lt;/span&amp;gt;, we will in fact see it running on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;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-cluster-A @ Sun Jan  1 18:49:38 2012&lt;br /&gt;
Member Status: Quorate&lt;br /&gt;
&lt;br /&gt;
 Member Name                             ID   Status&lt;br /&gt;
 ------ ----                             ---- ------&lt;br /&gt;
 an-node01.alteeve.com                       1 Online, rgmanager&lt;br /&gt;
 an-node02.alteeve.com                       2 Online, Local, rgmanager&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State&lt;br /&gt;
 ------- ----                   ----- ------                   -----&lt;br /&gt;
 service:storage_an01           an-node01.alteeve.com          started&lt;br /&gt;
 service:storage_an02           an-node02.alteeve.com          started&lt;br /&gt;
 vm:vm0001-dev                  an-node02.alteeve.com          started&lt;br /&gt;
 vm:vm0002-web                  an-node01.alteeve.com          started&lt;br /&gt;
 vm:vm0003-db                   an-node02.alteeve.com          started&lt;br /&gt;
 vm:vm0004-ms                   an-node02.alteeve.com          started&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Success!&lt;br /&gt;
&lt;br /&gt;
This test is complete, so we&#039;ll finish my migrating the VM back to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
clusvcadm -M vm:vm0001-dev -m an-node01.alteeve.com&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Trying to migrate vm:vm0001-dev to an-node01.alteeve.com...Success&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As always, confirm.&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-cluster-A @ Sun Jan  1 18:51:05 2012&lt;br /&gt;
Member Status: Quorate&lt;br /&gt;
&lt;br /&gt;
 Member Name                             ID   Status&lt;br /&gt;
 ------ ----                             ---- ------&lt;br /&gt;
 an-node01.alteeve.com                       1 Online, rgmanager&lt;br /&gt;
 an-node02.alteeve.com                       2 Online, Local, rgmanager&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State&lt;br /&gt;
 ------- ----                   ----- ------                   -----&lt;br /&gt;
 service:storage_an01           an-node01.alteeve.com          started&lt;br /&gt;
 service:storage_an02           an-node02.alteeve.com          started&lt;br /&gt;
 vm:vm0001-dev                  an-node01.alteeve.com          started&lt;br /&gt;
 vm:vm0002-web                  an-node01.alteeve.com          started&lt;br /&gt;
 vm:vm0003-db                   an-node02.alteeve.com          started&lt;br /&gt;
 vm:vm0004-ms                   an-node02.alteeve.com          started&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Excellent.&lt;br /&gt;
&lt;br /&gt;
=== Failure Testing vm0002-web ===&lt;br /&gt;
&lt;br /&gt;
We&#039;ll go through the same process here as we just did with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0001-dev&amp;lt;/span&amp;gt;, but we won&#039;t cover all the details here as much. After each crash of the VM, we&#039;ll check &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clustat&amp;lt;/span&amp;gt; and look at the syslog on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;. Not shown here is a background ping running to indicate when the VM is back up enough to crash again.&lt;br /&gt;
&lt;br /&gt;
Confirm that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0002-web&amp;lt;/span&amp;gt; is on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;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-cluster-A @ Sun Jan  1 19:06:21 2012&lt;br /&gt;
Member Status: Quorate&lt;br /&gt;
&lt;br /&gt;
 Member Name                             ID   Status&lt;br /&gt;
 ------ ----                             ---- ------&lt;br /&gt;
 an-node01.alteeve.com                       1 Online, rgmanager&lt;br /&gt;
 an-node02.alteeve.com                       2 Online, Local, rgmanager&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State&lt;br /&gt;
 ------- ----                   ----- ------                   -----&lt;br /&gt;
 service:storage_an01           an-node01.alteeve.com          started&lt;br /&gt;
 service:storage_an02           an-node02.alteeve.com          started&lt;br /&gt;
 vm:vm0001-dev                  an-node01.alteeve.com          started&lt;br /&gt;
 vm:vm0002-web                  an-node01.alteeve.com          started&lt;br /&gt;
 vm:vm0003-db                   an-node02.alteeve.com          started&lt;br /&gt;
 vm:vm0004-ms                   an-node02.alteeve.com          started&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Good, we&#039;re ready. On &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;, kill the VM.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
virsh destroy vm0002-web&lt;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-web destroyed&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As we expect, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt; restarts the VM within a few seconds.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Jan  1 19:07:16 an-node01 kernel: vbr2: port 3(vnet1) entering disabled state&lt;br /&gt;
Jan  1 19:07:16 an-node01 kernel: device vnet1 left promiscuous mode&lt;br /&gt;
Jan  1 19:07:16 an-node01 kernel: vbr2: port 3(vnet1) entering disabled state&lt;br /&gt;
Jan  1 19:07:18 an-node01 ntpd[2190]: Deleting interface #11 vnet1, fe80::fc54:ff:fe65:3960#123, interface stats: received=0, sent=0, dropped=0, active_time=9315 secs&lt;br /&gt;
Jan  1 19:07:27 an-node01 rgmanager[2430]: status on vm &amp;quot;vm0002-web&amp;quot; returned 7 (unspecified)&lt;br /&gt;
Jan  1 19:07:27 an-node01 rgmanager[2430]: Stopping service vm:vm0002-web&lt;br /&gt;
Jan  1 19:07:27 an-node01 rgmanager[2430]: Service vm:vm0002-web is recovering&lt;br /&gt;
Jan  1 19:07:28 an-node01 rgmanager[2430]: Recovering failed service vm:vm0002-web&lt;br /&gt;
Jan  1 19:07:28 an-node01 kernel: device vnet1 entered promiscuous mode&lt;br /&gt;
Jan  1 19:07:28 an-node01 kernel: vbr2: port 3(vnet1) entering learning state&lt;br /&gt;
Jan  1 19:07:29 an-node01 rgmanager[2430]: Service vm:vm0002-web started&lt;br /&gt;
Jan  1 19:07:31 an-node01 ntpd[2190]: Listening on interface #23 vnet1, fe80::fc54:ff:fe65:3960#123 Enabled&lt;br /&gt;
Jan  1 19:07:38 an-node01 kernel: kvm: 1994: cpu0 unimplemented perfctr wrmsr: 0xc1 data 0xabcd&lt;br /&gt;
Jan  1 19:07:43 an-node01 kernel: vbr2: port 3(vnet1) entering forwarding state&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checking &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clustat&amp;lt;/span&amp;gt;, I can see the VM is back on-line.&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-cluster-A @ Sun Jan  1 19:09:03 2012&lt;br /&gt;
Member Status: Quorate&lt;br /&gt;
&lt;br /&gt;
 Member Name                             ID   Status&lt;br /&gt;
 ------ ----                             ---- ------&lt;br /&gt;
 an-node01.alteeve.com                       1 Online, rgmanager&lt;br /&gt;
 an-node02.alteeve.com                       2 Online, Local, rgmanager&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State&lt;br /&gt;
 ------- ----                   ----- ------                   -----&lt;br /&gt;
 service:storage_an01           an-node01.alteeve.com          started&lt;br /&gt;
 service:storage_an02           an-node02.alteeve.com          started&lt;br /&gt;
 vm:vm0001-dev                  an-node01.alteeve.com          started&lt;br /&gt;
 vm:vm0002-web                  an-node01.alteeve.com          started&lt;br /&gt;
 vm:vm0003-db                   an-node02.alteeve.com          started&lt;br /&gt;
 vm:vm0004-ms                   an-node02.alteeve.com          started&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Let&#039;s kill it for the second time.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
virsh destroy vm0002-web&lt;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-web destroyed&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can again see that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt; recovered it locally.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Jan  1 19:12:08 an-node01 kernel: vbr2: port 3(vnet1) entering disabled state&lt;br /&gt;
Jan  1 19:12:08 an-node01 kernel: device vnet1 left promiscuous mode&lt;br /&gt;
Jan  1 19:12:08 an-node01 kernel: vbr2: port 3(vnet1) entering disabled state&lt;br /&gt;
Jan  1 19:12:10 an-node01 ntpd[2190]: Deleting interface #23 vnet1, fe80::fc54:ff:fe65:3960#123, interface stats: received=0, sent=0, dropped=0, active_time=279 secs&lt;br /&gt;
Jan  1 19:12:17 an-node01 rgmanager[2430]: status on vm &amp;quot;vm0002-web&amp;quot; returned 7 (unspecified)&lt;br /&gt;
Jan  1 19:12:17 an-node01 rgmanager[2430]: Stopping service vm:vm0002-web&lt;br /&gt;
Jan  1 19:12:18 an-node01 rgmanager[2430]: Service vm:vm0002-web is recovering&lt;br /&gt;
Jan  1 19:12:18 an-node01 rgmanager[2430]: Recovering failed service vm:vm0002-web&lt;br /&gt;
Jan  1 19:12:19 an-node01 kernel: device vnet1 entered promiscuous mode&lt;br /&gt;
Jan  1 19:12:19 an-node01 kernel: vbr2: port 3(vnet1) entering learning state&lt;br /&gt;
Jan  1 19:12:19 an-node01 rgmanager[2430]: Service vm:vm0002-web started&lt;br /&gt;
Jan  1 19:12:22 an-node01 ntpd[2190]: Listening on interface #24 vnet1, fe80::fc54:ff:fe65:3960#123 Enabled&lt;br /&gt;
Jan  1 19:12:28 an-node01 kernel: kvm: 6113: cpu0 unimplemented perfctr wrmsr: 0xc1 data 0xabcd&lt;br /&gt;
Jan  1 19:12:34 an-node01 kernel: vbr2: port 3(vnet1) entering forwarding state&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Confirm with &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-cluster-A @ Sun Jan  1 19:13:45 2012&lt;br /&gt;
Member Status: Quorate&lt;br /&gt;
&lt;br /&gt;
 Member Name                             ID   Status&lt;br /&gt;
 ------ ----                             ---- ------&lt;br /&gt;
 an-node01.alteeve.com                       1 Online, rgmanager&lt;br /&gt;
 an-node02.alteeve.com                       2 Online, Local, rgmanager&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State&lt;br /&gt;
 ------- ----                   ----- ------                   -----&lt;br /&gt;
 service:storage_an01           an-node01.alteeve.com          started&lt;br /&gt;
 service:storage_an02           an-node02.alteeve.com          started&lt;br /&gt;
 vm:vm0001-dev                  an-node01.alteeve.com          started&lt;br /&gt;
 vm:vm0002-web                  an-node01.alteeve.com          started&lt;br /&gt;
 vm:vm0003-db                   an-node02.alteeve.com          started&lt;br /&gt;
 vm:vm0004-ms                   an-node02.alteeve.com          started&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This time, it should recover on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;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 destroy vm0002-web&lt;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-web destroyed&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Looking in syslog, we can see the counter was tripped.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Jan  1 19:14:26 an-node01 kernel: vbr2: port 3(vnet1) entering disabled state&lt;br /&gt;
Jan  1 19:14:26 an-node01 kernel: device vnet1 left promiscuous mode&lt;br /&gt;
Jan  1 19:14:26 an-node01 kernel: vbr2: port 3(vnet1) entering disabled state&lt;br /&gt;
Jan  1 19:14:27 an-node01 rgmanager[2430]: status on vm &amp;quot;vm0002-web&amp;quot; returned 7 (unspecified)&lt;br /&gt;
Jan  1 19:14:27 an-node01 rgmanager[2430]: Stopping service vm:vm0002-web&lt;br /&gt;
Jan  1 19:14:28 an-node01 rgmanager[2430]: Service vm:vm0002-web is recovering&lt;br /&gt;
Jan  1 19:14:28 an-node01 rgmanager[2430]: Restart threshold for vm:vm0002-web exceeded; attempting to relocate&lt;br /&gt;
Jan  1 19:14:28 an-node01 ntpd[2190]: Deleting interface #24 vnet1, fe80::fc54:ff:fe65:3960#123, interface stats: received=0, sent=0, dropped=0, active_time=126 secs&lt;br /&gt;
Jan  1 19:14:29 an-node01 rgmanager[2430]: Service vm:vm0002-web is now running on member 2&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Indeed, this is confirmed with &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-cluster-A @ Sun Jan  1 19:15:57 2012&lt;br /&gt;
Member Status: Quorate&lt;br /&gt;
&lt;br /&gt;
 Member Name                             ID   Status&lt;br /&gt;
 ------ ----                             ---- ------&lt;br /&gt;
 an-node01.alteeve.com                       1 Online, rgmanager&lt;br /&gt;
 an-node02.alteeve.com                       2 Online, Local, rgmanager&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State&lt;br /&gt;
 ------- ----                   ----- ------                   -----&lt;br /&gt;
 service:storage_an01           an-node01.alteeve.com          started&lt;br /&gt;
 service:storage_an02           an-node02.alteeve.com          started&lt;br /&gt;
 vm:vm0001-dev                  an-node01.alteeve.com          started&lt;br /&gt;
 vm:vm0002-web                  an-node02.alteeve.com          started&lt;br /&gt;
 vm:vm0003-db                   an-node02.alteeve.com          started&lt;br /&gt;
 vm:vm0004-ms                   an-node02.alteeve.com          started&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Excellent, this test has passed as well! Now migrate the VM back and we&#039;ll be ready to test the third VM.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
clusvcadm -M vm:vm0002-web -m an-node01.alteeve.com&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Trying to migrate vm:vm0002-web to an-node01.alteeve.com...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;
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-cluster-A @ Sun Jan  1 19:17:41 2012&lt;br /&gt;
Member Status: Quorate&lt;br /&gt;
&lt;br /&gt;
 Member Name                             ID   Status&lt;br /&gt;
 ------ ----                             ---- ------&lt;br /&gt;
 an-node01.alteeve.com                       1 Online, rgmanager&lt;br /&gt;
 an-node02.alteeve.com                       2 Online, Local, rgmanager&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State&lt;br /&gt;
 ------- ----                   ----- ------                   -----&lt;br /&gt;
 service:storage_an01           an-node01.alteeve.com          started&lt;br /&gt;
 service:storage_an02           an-node02.alteeve.com          started&lt;br /&gt;
 vm:vm0001-dev                  an-node01.alteeve.com          started&lt;br /&gt;
 vm:vm0002-web                  an-node01.alteeve.com          started&lt;br /&gt;
 vm:vm0003-db                   an-node02.alteeve.com          started&lt;br /&gt;
 vm:vm0004-ms                   an-node02.alteeve.com          started&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Done.&lt;br /&gt;
&lt;br /&gt;
=== Failure Testing vm0003-db ===&lt;br /&gt;
&lt;br /&gt;
This should be getting familiar now. The main difference is that the VM is now running on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt;, so that is where will will kill the VM from and that is where we will watch syslog.&lt;br /&gt;
&lt;br /&gt;
Confirm that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0003-db&amp;lt;/span&amp;gt; is on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;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-cluster-A @ Sun Jan  1 19:25:55 2012&lt;br /&gt;
Member Status: Quorate&lt;br /&gt;
&lt;br /&gt;
 Member Name                             ID   Status&lt;br /&gt;
 ------ ----                             ---- ------&lt;br /&gt;
 an-node01.alteeve.com                       1 Online, Local, rgmanager&lt;br /&gt;
 an-node02.alteeve.com                       2 Online, rgmanager&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State&lt;br /&gt;
 ------- ----                   ----- ------                   -----&lt;br /&gt;
 service:storage_an01           an-node01.alteeve.com          started&lt;br /&gt;
 service:storage_an02           an-node02.alteeve.com          started&lt;br /&gt;
 vm:vm0001-dev                  an-node01.alteeve.com          started&lt;br /&gt;
 vm:vm0002-web                  an-node01.alteeve.com          started&lt;br /&gt;
 vm:vm0003-db                   an-node02.alteeve.com          started&lt;br /&gt;
 vm:vm0004-ms                   an-node02.alteeve.com          started&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Good, we&#039;re ready. On &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt;, kill the VM.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
virsh destroy vm0003-db&lt;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 vm0003-db destroyed&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As we expect, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt; restarts the VM within a few seconds.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Jan  1 19:26:21 an-node02 kernel: vbr2: port 2(vnet0) entering disabled state&lt;br /&gt;
Jan  1 19:26:21 an-node02 kernel: device vnet0 left promiscuous mode&lt;br /&gt;
Jan  1 19:26:21 an-node02 kernel: vbr2: port 2(vnet0) entering disabled state&lt;br /&gt;
Jan  1 19:26:22 an-node02 ntpd[2200]: Deleting interface #10 vnet0, fe80::fc54:ff:fe44:83ec#123, interface stats: received=0, sent=0, dropped=0, active_time=8863 secs&lt;br /&gt;
Jan  1 19:26:35 an-node02 rgmanager[2439]: status on vm &amp;quot;vm0003-db&amp;quot; returned 7 (unspecified)&lt;br /&gt;
Jan  1 19:26:36 an-node02 rgmanager[2439]: Stopping service vm:vm0003-db&lt;br /&gt;
Jan  1 19:26:36 an-node02 rgmanager[2439]: Service vm:vm0003-db is recovering&lt;br /&gt;
Jan  1 19:26:36 an-node02 rgmanager[2439]: Recovering failed service vm:vm0003-db&lt;br /&gt;
Jan  1 19:26:37 an-node02 kernel: device vnet0 entered promiscuous mode&lt;br /&gt;
Jan  1 19:26:37 an-node02 kernel: vbr2: port 2(vnet0) entering learning state&lt;br /&gt;
Jan  1 19:26:37 an-node02 rgmanager[2439]: Service vm:vm0003-db started&lt;br /&gt;
Jan  1 19:26:40 an-node02 ntpd[2200]: Listening on interface #15 vnet0, fe80::fc54:ff:fe44:83ec#123 Enabled&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checking &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clustat&amp;lt;/span&amp;gt;, I can see the VM is back on-line.&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-cluster-A @ Sun Jan  1 19:27:06 2012&lt;br /&gt;
Member Status: Quorate&lt;br /&gt;
&lt;br /&gt;
 Member Name                             ID   Status&lt;br /&gt;
 ------ ----                             ---- ------&lt;br /&gt;
 an-node01.alteeve.com                       1 Online, Local, rgmanager&lt;br /&gt;
 an-node02.alteeve.com                       2 Online, rgmanager&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State&lt;br /&gt;
 ------- ----                   ----- ------                   -----&lt;br /&gt;
 service:storage_an01           an-node01.alteeve.com          started&lt;br /&gt;
 service:storage_an02           an-node02.alteeve.com          started&lt;br /&gt;
 vm:vm0001-dev                  an-node01.alteeve.com          started&lt;br /&gt;
 vm:vm0002-web                  an-node01.alteeve.com          started&lt;br /&gt;
 vm:vm0003-db                   an-node02.alteeve.com          started&lt;br /&gt;
 vm:vm0004-ms                   an-node02.alteeve.com          started&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Let&#039;s kill it for the second time.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
virsh destroy vm0003-db&lt;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 vm0003-db destroyed&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can again see that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt; recovered it locally.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Jan  1 19:27:40 an-node02 kernel: vbr2: port 2(vnet0) entering disabled state&lt;br /&gt;
Jan  1 19:27:40 an-node02 kernel: device vnet0 left promiscuous mode&lt;br /&gt;
Jan  1 19:27:40 an-node02 kernel: vbr2: port 2(vnet0) entering disabled state&lt;br /&gt;
Jan  1 19:27:41 an-node02 ntpd[2200]: Deleting interface #15 vnet0, fe80::fc54:ff:fe44:83ec#123, interface stats: received=0, sent=0, dropped=0, active_time=61 secs&lt;br /&gt;
Jan  1 19:27:45 an-node02 rgmanager[2439]: status on vm &amp;quot;vm0003-db&amp;quot; returned 7 (unspecified)&lt;br /&gt;
Jan  1 19:27:46 an-node02 rgmanager[2439]: Stopping service vm:vm0003-db&lt;br /&gt;
Jan  1 19:27:46 an-node02 rgmanager[2439]: Service vm:vm0003-db is recovering&lt;br /&gt;
Jan  1 19:27:46 an-node02 rgmanager[2439]: Recovering failed service vm:vm0003-db&lt;br /&gt;
Jan  1 19:27:47 an-node02 kernel: device vnet0 entered promiscuous mode&lt;br /&gt;
Jan  1 19:27:47 an-node02 kernel: vbr2: port 2(vnet0) entering learning state&lt;br /&gt;
Jan  1 19:27:47 an-node02 rgmanager[2439]: Service vm:vm0003-db started&lt;br /&gt;
Jan  1 19:27:50 an-node02 ntpd[2200]: Listening on interface #16 vnet0, fe80::fc54:ff:fe44:83ec#123 Enabled&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Confirm with &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-cluster-A @ Sun Jan  1 19:28:21 2012&lt;br /&gt;
Member Status: Quorate&lt;br /&gt;
&lt;br /&gt;
 Member Name                             ID   Status&lt;br /&gt;
 ------ ----                             ---- ------&lt;br /&gt;
 an-node01.alteeve.com                       1 Online, Local, rgmanager&lt;br /&gt;
 an-node02.alteeve.com                       2 Online, rgmanager&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State&lt;br /&gt;
 ------- ----                   ----- ------                   -----&lt;br /&gt;
 service:storage_an01           an-node01.alteeve.com          started&lt;br /&gt;
 service:storage_an02           an-node02.alteeve.com          started&lt;br /&gt;
 vm:vm0001-dev                  an-node01.alteeve.com          started&lt;br /&gt;
 vm:vm0002-web                  an-node01.alteeve.com          started&lt;br /&gt;
 vm:vm0003-db                   an-node02.alteeve.com          started&lt;br /&gt;
 vm:vm0004-ms                   an-node02.alteeve.com          started&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This time, it should recover on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;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 destroy vm0003-db&lt;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 vm0003-db destroyed&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Looking in syslog, we can see the counter was tripped.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Jan  1 19:28:36 an-node02 kernel: vbr2: port 2(vnet0) entering disabled state&lt;br /&gt;
Jan  1 19:28:36 an-node02 kernel: device vnet0 left promiscuous mode&lt;br /&gt;
Jan  1 19:28:36 an-node02 kernel: vbr2: port 2(vnet0) entering disabled state&lt;br /&gt;
Jan  1 19:28:37 an-node02 ntpd[2200]: Deleting interface #16 vnet0, fe80::fc54:ff:fe44:83ec#123, interface stats: received=0, sent=0, dropped=0, active_time=47 secs&lt;br /&gt;
Jan  1 19:28:55 an-node02 rgmanager[2439]: status on vm &amp;quot;vm0003-db&amp;quot; returned 7 (unspecified)&lt;br /&gt;
Jan  1 19:28:56 an-node02 rgmanager[2439]: Stopping service vm:vm0003-db&lt;br /&gt;
Jan  1 19:28:56 an-node02 rgmanager[2439]: Service vm:vm0003-db is recovering&lt;br /&gt;
Jan  1 19:28:56 an-node02 rgmanager[2439]: Restart threshold for vm:vm0003-db exceeded; attempting to relocate&lt;br /&gt;
Jan  1 19:28:57 an-node02 rgmanager[2439]: Service vm:vm0003-db is now running on member 1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Again, this is confirmed with &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-cluster-A @ Sun Jan  1 19:29:42 2012&lt;br /&gt;
Member Status: Quorate&lt;br /&gt;
&lt;br /&gt;
 Member Name                             ID   Status&lt;br /&gt;
 ------ ----                             ---- ------&lt;br /&gt;
 an-node01.alteeve.com                       1 Online, Local, rgmanager&lt;br /&gt;
 an-node02.alteeve.com                       2 Online, rgmanager&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State&lt;br /&gt;
 ------- ----                   ----- ------                   -----&lt;br /&gt;
 service:storage_an01           an-node01.alteeve.com          started&lt;br /&gt;
 service:storage_an02           an-node02.alteeve.com          started&lt;br /&gt;
 vm:vm0001-dev                  an-node01.alteeve.com          started&lt;br /&gt;
 vm:vm0002-web                  an-node01.alteeve.com          started&lt;br /&gt;
 vm:vm0003-db                   an-node01.alteeve.com          started&lt;br /&gt;
 vm:vm0004-ms                   an-node02.alteeve.com          started&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This test has passed as well! As before, migrate the VM back and we&#039;ll be ready to test the last VM.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
clusvcadm -M vm:vm0003-db -m an-node02.alteeve.com&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Trying to migrate vm:vm0003-db to an-node02.alteeve.com...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;
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-cluster-A @ Sun Jan  1 19:30:32 2012&lt;br /&gt;
Member Status: Quorate&lt;br /&gt;
&lt;br /&gt;
 Member Name                             ID   Status&lt;br /&gt;
 ------ ----                             ---- ------&lt;br /&gt;
 an-node01.alteeve.com                       1 Online, Local, rgmanager&lt;br /&gt;
 an-node02.alteeve.com                       2 Online, rgmanager&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State&lt;br /&gt;
 ------- ----                   ----- ------                   -----&lt;br /&gt;
 service:storage_an01           an-node01.alteeve.com          started&lt;br /&gt;
 service:storage_an02           an-node02.alteeve.com          started&lt;br /&gt;
 vm:vm0001-dev                  an-node01.alteeve.com          started&lt;br /&gt;
 vm:vm0002-web                  an-node01.alteeve.com          started&lt;br /&gt;
 vm:vm0003-db                   an-node02.alteeve.com          started&lt;br /&gt;
 vm:vm0004-ms                   an-node02.alteeve.com          started&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Done.&lt;br /&gt;
&lt;br /&gt;
=== Failure Testing vm0004-ms ===&lt;br /&gt;
&lt;br /&gt;
{{warning|1=Windows is particularly sensitive to sudden reboots. This is the nature of MS Windows and beyond the ability of the cluster to deal with. As such, be sure that you&#039;ve created your recovery ISOs and taken reasonable precautions so that you can recover the guest after a hard shut down. That is, of course, what we&#039;re about to do here.}}&lt;br /&gt;
&lt;br /&gt;
This is the last VM to test. This testing is repetitive and boring, but it is also critical. Good on you for sticking it out. Right then, let&#039;s get to it.&lt;br /&gt;
&lt;br /&gt;
Confirm that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0004-ms&amp;lt;/span&amp;gt; is on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;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-cluster-A @ Sun Jan  1 19:43:41 2012&lt;br /&gt;
Member Status: Quorate&lt;br /&gt;
&lt;br /&gt;
 Member Name                             ID   Status&lt;br /&gt;
 ------ ----                             ---- ------&lt;br /&gt;
 an-node01.alteeve.com                       1 Online, Local, rgmanager&lt;br /&gt;
 an-node02.alteeve.com                       2 Online, rgmanager&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State&lt;br /&gt;
 ------- ----                   ----- ------                   -----&lt;br /&gt;
 service:storage_an01           an-node01.alteeve.com          started&lt;br /&gt;
 service:storage_an02           an-node02.alteeve.com          started&lt;br /&gt;
 vm:vm0001-dev                  an-node01.alteeve.com          started&lt;br /&gt;
 vm:vm0002-web                  an-node01.alteeve.com          started&lt;br /&gt;
 vm:vm0003-db                   an-node02.alteeve.com          started&lt;br /&gt;
 vm:vm0004-ms                   an-node02.alteeve.com          started&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Good, we&#039;re ready. On &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt;, kill the VM.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
virsh destroy vm0004-ms&lt;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 vm0004-ms destroyed&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As we expect, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt; restarts the VM within a few seconds.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Jan  1 19:43:52 an-node02 kernel: vbr2: port 3(vnet1) entering disabled state&lt;br /&gt;
Jan  1 19:43:52 an-node02 kernel: device vnet1 left promiscuous mode&lt;br /&gt;
Jan  1 19:43:52 an-node02 kernel: vbr2: port 3(vnet1) entering disabled state&lt;br /&gt;
Jan  1 19:43:53 an-node02 ntpd[2200]: Deleting interface #11 vnet1, fe80::fc54:ff:fe5e:b147#123, interface stats: received=0, sent=0, dropped=0, active_time=9895 secs&lt;br /&gt;
Jan  1 19:44:06 an-node02 rgmanager[2439]: status on vm &amp;quot;vm0004-ms&amp;quot; returned 7 (unspecified)&lt;br /&gt;
Jan  1 19:44:07 an-node02 rgmanager[2439]: Stopping service vm:vm0004-ms&lt;br /&gt;
Jan  1 19:44:07 an-node02 rgmanager[2439]: Service vm:vm0004-ms is recovering&lt;br /&gt;
Jan  1 19:44:07 an-node02 rgmanager[2439]: Recovering failed service vm:vm0004-ms&lt;br /&gt;
Jan  1 19:44:08 an-node02 kernel: device vnet1 entered promiscuous mode&lt;br /&gt;
Jan  1 19:44:08 an-node02 kernel: vbr2: port 3(vnet1) entering learning state&lt;br /&gt;
Jan  1 19:44:08 an-node02 rgmanager[2439]: Service vm:vm0004-ms started&lt;br /&gt;
Jan  1 19:44:11 an-node02 ntpd[2200]: Listening on interface #18 vnet1, fe80::fc54:ff:fe5e:b147#123 Enabled&lt;br /&gt;
Jan  1 19:44:23 an-node02 kernel: vbr2: port 3(vnet1) entering forwarding state&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checking &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clustat&amp;lt;/span&amp;gt;, I can see the VM is back on-line.&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-cluster-A @ Sun Jan  1 19:44:38 2012&lt;br /&gt;
Member Status: Quorate&lt;br /&gt;
&lt;br /&gt;
 Member Name                             ID   Status&lt;br /&gt;
 ------ ----                             ---- ------&lt;br /&gt;
 an-node01.alteeve.com                       1 Online, Local, rgmanager&lt;br /&gt;
 an-node02.alteeve.com                       2 Online, rgmanager&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State&lt;br /&gt;
 ------- ----                   ----- ------                   -----&lt;br /&gt;
 service:storage_an01           an-node01.alteeve.com          started&lt;br /&gt;
 service:storage_an02           an-node02.alteeve.com          started&lt;br /&gt;
 vm:vm0001-dev                  an-node01.alteeve.com          started&lt;br /&gt;
 vm:vm0002-web                  an-node01.alteeve.com          started&lt;br /&gt;
 vm:vm0003-db                   an-node02.alteeve.com          started&lt;br /&gt;
 vm:vm0004-ms                   an-node02.alteeve.com          started&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Let&#039;s kill it for the second time.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
virsh destroy vm0004-ms&lt;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 vm0004-ms destroyed&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can again see that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt; recovered it locally.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Jan  1 19:44:54 an-node02 kernel: vbr2: port 3(vnet1) entering disabled state&lt;br /&gt;
Jan  1 19:44:54 an-node02 kernel: device vnet1 left promiscuous mode&lt;br /&gt;
Jan  1 19:44:54 an-node02 kernel: vbr2: port 3(vnet1) entering disabled state&lt;br /&gt;
Jan  1 19:44:55 an-node02 ntpd[2200]: Deleting interface #18 vnet1, fe80::fc54:ff:fe5e:b147#123, interface stats: received=0, sent=0, dropped=0, active_time=44 secs&lt;br /&gt;
Jan  1 19:45:16 an-node02 rgmanager[2439]: status on vm &amp;quot;vm0004-ms&amp;quot; returned 7 (unspecified)&lt;br /&gt;
Jan  1 19:45:17 an-node02 rgmanager[2439]: Stopping service vm:vm0004-ms&lt;br /&gt;
Jan  1 19:45:17 an-node02 rgmanager[2439]: Service vm:vm0004-ms is recovering&lt;br /&gt;
Jan  1 19:45:17 an-node02 rgmanager[2439]: Recovering failed service vm:vm0004-ms&lt;br /&gt;
Jan  1 19:45:18 an-node02 kernel: device vnet1 entered promiscuous mode&lt;br /&gt;
Jan  1 19:45:18 an-node02 kernel: vbr2: port 3(vnet1) entering learning state&lt;br /&gt;
Jan  1 19:45:18 an-node02 rgmanager[2439]: Service vm:vm0004-ms started&lt;br /&gt;
Jan  1 19:45:21 an-node02 ntpd[2200]: Listening on interface #19 vnet1, fe80::fc54:ff:fe5e:b147#123 Enabled&lt;br /&gt;
Jan  1 19:45:33 an-node02 kernel: vbr2: port 3(vnet1) entering forwarding state&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Confirm with &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-cluster-A @ Sun Jan  1 19:46:17 2012&lt;br /&gt;
Member Status: Quorate&lt;br /&gt;
&lt;br /&gt;
 Member Name                             ID   Status&lt;br /&gt;
 ------ ----                             ---- ------&lt;br /&gt;
 an-node01.alteeve.com                       1 Online, Local, rgmanager&lt;br /&gt;
 an-node02.alteeve.com                       2 Online, rgmanager&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State&lt;br /&gt;
 ------- ----                   ----- ------                   -----&lt;br /&gt;
 service:storage_an01           an-node01.alteeve.com          started&lt;br /&gt;
 service:storage_an02           an-node02.alteeve.com          started&lt;br /&gt;
 vm:vm0001-dev                  an-node01.alteeve.com          started&lt;br /&gt;
 vm:vm0002-web                  an-node01.alteeve.com          started&lt;br /&gt;
 vm:vm0003-db                   an-node02.alteeve.com          started&lt;br /&gt;
 vm:vm0004-ms                   an-node02.alteeve.com          started&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This time, it should recover on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;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 destroy vm0004-ms&lt;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 vm0004-ms destroyed&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Looking in syslog, we can see the counter was tripped.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Jan  1 19:45:33 an-node02 kernel: vbr2: port 3(vnet1) entering forwarding state&lt;br /&gt;
Jan  1 19:46:30 an-node02 kernel: vbr2: port 3(vnet1) entering disabled state&lt;br /&gt;
Jan  1 19:46:30 an-node02 kernel: device vnet1 left promiscuous mode&lt;br /&gt;
Jan  1 19:46:30 an-node02 kernel: vbr2: port 3(vnet1) entering disabled state&lt;br /&gt;
Jan  1 19:46:32 an-node02 ntpd[2200]: Deleting interface #19 vnet1, fe80::fc54:ff:fe5e:b147#123, interface stats: received=0, sent=0, dropped=0, active_time=71 secs&lt;br /&gt;
Jan  1 19:46:36 an-node02 rgmanager[2439]: status on vm &amp;quot;vm0004-ms&amp;quot; returned 7 (unspecified)&lt;br /&gt;
Jan  1 19:46:37 an-node02 rgmanager[2439]: Stopping service vm:vm0004-ms&lt;br /&gt;
Jan  1 19:46:37 an-node02 rgmanager[2439]: Service vm:vm0004-ms is recovering&lt;br /&gt;
Jan  1 19:46:37 an-node02 rgmanager[2439]: Restart threshold for vm:vm0004-ms exceeded; attempting to relocate&lt;br /&gt;
Jan  1 19:46:38 an-node02 rgmanager[2439]: Service vm:vm0004-ms is now running on member 1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Indeed, this is confirmed with &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-cluster-A @ Sun Jan  1 19:48:23 2012&lt;br /&gt;
Member Status: Quorate&lt;br /&gt;
&lt;br /&gt;
 Member Name                             ID   Status&lt;br /&gt;
 ------ ----                             ---- ------&lt;br /&gt;
 an-node01.alteeve.com                       1 Online, Local, rgmanager&lt;br /&gt;
 an-node02.alteeve.com                       2 Online, rgmanager&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State&lt;br /&gt;
 ------- ----                   ----- ------                   -----&lt;br /&gt;
 service:storage_an01           an-node01.alteeve.com          started&lt;br /&gt;
 service:storage_an02           an-node02.alteeve.com          started&lt;br /&gt;
 vm:vm0001-dev                  an-node01.alteeve.com          started&lt;br /&gt;
 vm:vm0002-web                  an-node01.alteeve.com          started&lt;br /&gt;
 vm:vm0003-db                   an-node02.alteeve.com          started&lt;br /&gt;
 vm:vm0004-ms                   an-node01.alteeve.com          started&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Wonderful! All four VMs fail and recover as we expected them to. Move the VM back and we&#039;re ready to crash the nodes!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
clusvcadm -M vm:vm0004-ms -m an-node02.alteeve.com&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Trying to migrate vm:vm0004-ms to an-node02.alteeve.com...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;
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-cluster-A @ Sun Jan  1 19:49:32 2012&lt;br /&gt;
Member Status: Quorate&lt;br /&gt;
&lt;br /&gt;
 Member Name                             ID   Status&lt;br /&gt;
 ------ ----                             ---- ------&lt;br /&gt;
 an-node01.alteeve.com                       1 Online, Local, rgmanager&lt;br /&gt;
 an-node02.alteeve.com                       2 Online, rgmanager&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State&lt;br /&gt;
 ------- ----                   ----- ------                   -----&lt;br /&gt;
 service:storage_an01           an-node01.alteeve.com          started&lt;br /&gt;
 service:storage_an02           an-node02.alteeve.com          started&lt;br /&gt;
 vm:vm0001-dev                  an-node01.alteeve.com          started&lt;br /&gt;
 vm:vm0002-web                  an-node01.alteeve.com          started&lt;br /&gt;
 vm:vm0003-db                   an-node02.alteeve.com          started&lt;br /&gt;
 vm:vm0004-ms                   an-node02.alteeve.com          started&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Done and done!&lt;br /&gt;
&lt;br /&gt;
=== Failing and Recovery of an-node01 ===&lt;br /&gt;
&lt;br /&gt;
The final stage of testing is also the most brutal. We&#039;re going to hang &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt; in such a way that it stops responding to messages from &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt;. Within a few seconds, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt; should be fenced, then shortly after the two lost VMs should boot up on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The is a particularly important test for a somewhat non-obvious reason.&lt;br /&gt;
&lt;br /&gt;
{{note|1=It&#039;s one thing to migrate or boot VMs one at a time. The other VMs will not likely be under load, so the resources of the host should be more or less free for the VM being recovered. After a failure though, all lost VMs will be simultaneously recovered, taxing the host&#039;s resources to a greater extent. This test ensures that each node has sufficient resources to effectively recover the VMs simultaneously.}}&lt;br /&gt;
&lt;br /&gt;
We could just shut off &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;, but we tested this earlier when we setup fencing. What we have not yet tested is how the cluster recovers from a hung node. To hang the host, we&#039;re going to trigger a special event in the kernel, using [http://en.wikipedia.org/wiki/Magic_SysRq_key#Alternate_ways_to_invoke_Magic_SysRq magic SysRq] triggers. We&#039;ll do this by sending the letter &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;c&amp;lt;/span&amp;gt; to the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/proc/sysrq-trigger&amp;lt;/span&amp;gt; file. This will &amp;quot;[http://en.wikipedia.org/wiki/Magic_SysRq_key#Magic_commands Reboot kexec and output a crashdump]&amp;quot;. The node should be [[fenced]] before a memory dump can complete, so don&#039;t expect to see anything in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/var/crashed&amp;lt;/span&amp;gt; unless your system is extremely fast.&lt;br /&gt;
&lt;br /&gt;
{{warning|1=If you are skimming, take note! The next command will crash your node!}}&lt;br /&gt;
&lt;br /&gt;
So, on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;, issue the following command to crash the node.&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;
This command will not return. Watching syslog on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt;, we&#039;ll see output like this;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Jan  1 21:26:00 an-node02 kernel: block drbd1: PingAck did not arrive in time.&lt;br /&gt;
Jan  1 21:26:00 an-node02 kernel: block drbd1: peer( Primary -&amp;gt; Unknown ) conn( Connected -&amp;gt; NetworkFailure ) pdsk( UpToDate -&amp;gt; DUnknown ) susp( 0 -&amp;gt; 1 ) &lt;br /&gt;
Jan  1 21:26:00 an-node02 kernel: block drbd1: asender terminated&lt;br /&gt;
Jan  1 21:26:00 an-node02 kernel: block drbd1: Terminating asender thread&lt;br /&gt;
Jan  1 21:26:00 an-node02 kernel: block drbd1: Connection closed&lt;br /&gt;
Jan  1 21:26:00 an-node02 kernel: block drbd1: conn( NetworkFailure -&amp;gt; Unconnected ) &lt;br /&gt;
Jan  1 21:26:00 an-node02 kernel: block drbd1: helper command: /sbin/drbdadm fence-peer minor-1&lt;br /&gt;
Jan  1 21:26:00 an-node02 kernel: block drbd1: receiver terminated&lt;br /&gt;
Jan  1 21:26:00 an-node02 kernel: block drbd1: Restarting receiver thread&lt;br /&gt;
Jan  1 21:26:00 an-node02 kernel: block drbd1: receiver (re)started&lt;br /&gt;
Jan  1 21:26:00 an-node02 kernel: block drbd1: conn( Unconnected -&amp;gt; WFConnection ) &lt;br /&gt;
Jan  1 21:26:00 an-node02 /sbin/obliterate-peer.sh: Local node ID: 2 / Remote node: an-node01.alteeve.com&lt;br /&gt;
Jan  1 21:26:01 an-node02 kernel: block drbd2: PingAck did not arrive in time.&lt;br /&gt;
Jan  1 21:26:01 an-node02 kernel: block drbd2: peer( Primary -&amp;gt; Unknown ) conn( Connected -&amp;gt; NetworkFailure ) pdsk( UpToDate -&amp;gt; DUnknown ) susp( 0 -&amp;gt; 1 ) &lt;br /&gt;
Jan  1 21:26:01 an-node02 kernel: block drbd2: asender terminated&lt;br /&gt;
Jan  1 21:26:01 an-node02 kernel: block drbd2: Terminating asender thread&lt;br /&gt;
Jan  1 21:26:01 an-node02 kernel: block drbd2: Connection closed&lt;br /&gt;
Jan  1 21:26:01 an-node02 kernel: block drbd2: conn( NetworkFailure -&amp;gt; Unconnected ) &lt;br /&gt;
Jan  1 21:26:01 an-node02 kernel: block drbd2: helper command: /sbin/drbdadm fence-peer minor-2&lt;br /&gt;
Jan  1 21:26:01 an-node02 kernel: block drbd2: receiver terminated&lt;br /&gt;
Jan  1 21:26:01 an-node02 kernel: block drbd2: Restarting receiver thread&lt;br /&gt;
Jan  1 21:26:01 an-node02 kernel: block drbd2: receiver (re)started&lt;br /&gt;
Jan  1 21:26:01 an-node02 kernel: block drbd2: conn( Unconnected -&amp;gt; WFConnection ) &lt;br /&gt;
Jan  1 21:26:01 an-node02 /sbin/obliterate-peer.sh: Local node ID: 2 / Remote node: an-node01.alteeve.com&lt;br /&gt;
Jan  1 21:26:01 an-node02 /sbin/obliterate-peer.sh: kill node failed: Invalid argument&lt;br /&gt;
Jan  1 21:26:03 an-node02 kernel: block drbd0: PingAck did not arrive in time.&lt;br /&gt;
Jan  1 21:26:03 an-node02 kernel: block drbd0: peer( Primary -&amp;gt; Unknown ) conn( Connected -&amp;gt; NetworkFailure ) pdsk( UpToDate -&amp;gt; DUnknown ) susp( 0 -&amp;gt; 1 ) &lt;br /&gt;
Jan  1 21:26:03 an-node02 kernel: block drbd0: asender terminated&lt;br /&gt;
Jan  1 21:26:03 an-node02 kernel: block drbd0: Terminating asender thread&lt;br /&gt;
Jan  1 21:26:03 an-node02 kernel: block drbd0: Connection closed&lt;br /&gt;
Jan  1 21:26:03 an-node02 kernel: block drbd0: conn( NetworkFailure -&amp;gt; Unconnected ) &lt;br /&gt;
Jan  1 21:26:03 an-node02 kernel: block drbd0: helper command: /sbin/drbdadm fence-peer minor-0&lt;br /&gt;
Jan  1 21:26:03 an-node02 kernel: block drbd0: receiver terminated&lt;br /&gt;
Jan  1 21:26:03 an-node02 kernel: block drbd0: Restarting receiver thread&lt;br /&gt;
Jan  1 21:26:03 an-node02 kernel: block drbd0: receiver (re)started&lt;br /&gt;
Jan  1 21:26:03 an-node02 kernel: block drbd0: conn( Unconnected -&amp;gt; WFConnection ) &lt;br /&gt;
Jan  1 21:26:03 an-node02 /sbin/obliterate-peer.sh: Local node ID: 2 / Remote node: an-node01.alteeve.com&lt;br /&gt;
Jan  1 21:26:03 an-node02 /sbin/obliterate-peer.sh: kill node failed: Invalid argument&lt;br /&gt;
Jan  1 21:26:09 an-node02 corosync[1963]:   [TOTEM ] A processor failed, forming new configuration.&lt;br /&gt;
Jan  1 21:26:11 an-node02 corosync[1963]:   [QUORUM] Members[1]: 2&lt;br /&gt;
Jan  1 21:26:11 an-node02 corosync[1963]:   [TOTEM ] A processor joined or left the membership and a new membership was formed.&lt;br /&gt;
Jan  1 21:26:11 an-node02 kernel: dlm: closing connection to node 1&lt;br /&gt;
Jan  1 21:26:11 an-node02 corosync[1963]:   [CPG   ] chosen downlist: sender r(0) ip(10.20.0.2) ; members(old:2 left:1)&lt;br /&gt;
Jan  1 21:26:11 an-node02 corosync[1963]:   [MAIN  ] Completed service synchronization, ready to provide service.&lt;br /&gt;
Jan  1 21:26:11 an-node02 fenced[2022]: fencing node an-node01.alteeve.com&lt;br /&gt;
Jan  1 21:26:11 an-node02 kernel: GFS2: fsid=an-cluster-A:shared.0: jid=1: Trying to acquire journal lock...&lt;br /&gt;
Jan  1 21:26:14 an-node02 fence_node[15572]: fence an-node01.alteeve.com success&lt;br /&gt;
Jan  1 21:26:14 an-node02 kernel: block drbd1: helper command: /sbin/drbdadm fence-peer minor-1 exit code 7 (0x700)&lt;br /&gt;
Jan  1 21:26:14 an-node02 kernel: block drbd1: fence-peer helper returned 7 (peer was stonithed)&lt;br /&gt;
Jan  1 21:26:14 an-node02 kernel: block drbd1: pdsk( DUnknown -&amp;gt; Outdated ) &lt;br /&gt;
Jan  1 21:26:14 an-node02 kernel: block drbd1: new current UUID 6355AAB258658E8F:4642D156D54731A1:5F8A6B05E2FCCE19:165E9B466805EC81&lt;br /&gt;
Jan  1 21:26:14 an-node02 kernel: block drbd1: susp( 1 -&amp;gt; 0 ) &lt;br /&gt;
Jan  1 21:26:15 an-node02 fenced[2022]: fence an-node01.alteeve.com success&lt;br /&gt;
Jan  1 21:26:15 an-node02 fence_node[15672]: fence an-node01.alteeve.com success&lt;br /&gt;
Jan  1 21:26:15 an-node02 kernel: block drbd0: helper command: /sbin/drbdadm fence-peer minor-0 exit code 7 (0x700)&lt;br /&gt;
Jan  1 21:26:15 an-node02 kernel: block drbd0: fence-peer helper returned 7 (peer was stonithed)&lt;br /&gt;
Jan  1 21:26:15 an-node02 kernel: block drbd0: pdsk( DUnknown -&amp;gt; Outdated ) &lt;br /&gt;
Jan  1 21:26:15 an-node02 kernel: block drbd0: new current UUID C1F5EF16EE80E6C1:1B503B46E6650575:234E9A10EE04FDE7:7DBC4288E230DC9B&lt;br /&gt;
Jan  1 21:26:15 an-node02 kernel: block drbd0: susp( 1 -&amp;gt; 0 ) &lt;br /&gt;
Jan  1 21:26:15 an-node02 fence_node[15627]: fence an-node01.alteeve.com success&lt;br /&gt;
Jan  1 21:26:15 an-node02 kernel: block drbd2: helper command: /sbin/drbdadm fence-peer minor-2 exit code 7 (0x700)&lt;br /&gt;
Jan  1 21:26:15 an-node02 kernel: block drbd2: fence-peer helper returned 7 (peer was stonithed)&lt;br /&gt;
Jan  1 21:26:15 an-node02 kernel: block drbd2: pdsk( DUnknown -&amp;gt; Outdated ) &lt;br /&gt;
Jan  1 21:26:15 an-node02 kernel: block drbd2: new current UUID 1F79DE480F1E33C1:A674C3CB12017193:76118DDAE165C5FB:871F8081B7D527A9&lt;br /&gt;
Jan  1 21:26:15 an-node02 kernel: block drbd2: susp( 1 -&amp;gt; 0 ) &lt;br /&gt;
Jan  1 21:26:16 an-node02 kernel: GFS2: fsid=an-cluster-A:shared.0: jid=1: Looking at journal...&lt;br /&gt;
Jan  1 21:26:16 an-node02 kernel: GFS2: fsid=an-cluster-A:shared.0: jid=1: Done&lt;br /&gt;
Jan  1 21:26:16 an-node02 rgmanager[2514]: Marking service:storage_an01 as stopped: Restricted domain unavailable&lt;br /&gt;
Jan  1 21:26:16 an-node02 rgmanager[2514]: Taking over service vm:vm0001-dev from down member an-node01.alteeve.com&lt;br /&gt;
Jan  1 21:26:16 an-node02 rgmanager[2514]: Taking over service vm:vm0002-web from down member an-node01.alteeve.com&lt;br /&gt;
Jan  1 21:26:17 an-node02 kernel: device vnet2 entered promiscuous mode&lt;br /&gt;
Jan  1 21:26:17 an-node02 kernel: vbr2: port 4(vnet2) entering learning state&lt;br /&gt;
Jan  1 21:26:17 an-node02 rgmanager[2514]: Service vm:vm0001-dev started&lt;br /&gt;
Jan  1 21:26:17 an-node02 kernel: device vnet3 entered promiscuous mode&lt;br /&gt;
Jan  1 21:26:17 an-node02 kernel: vbr2: port 5(vnet3) entering learning state&lt;br /&gt;
Jan  1 21:26:18 an-node02 rgmanager[2514]: Service vm:vm0002-web started&lt;br /&gt;
Jan  1 21:26:20 an-node02 ntpd[2275]: Listening on interface #12 vnet2, fe80::fc54:ff:fe9b:3cf7#123 Enabled&lt;br /&gt;
Jan  1 21:26:20 an-node02 ntpd[2275]: Listening on interface #13 vnet3, fe80::fc54:ff:fe65:3960#123 Enabled&lt;br /&gt;
Jan  1 21:26:27 an-node02 kernel: kvm: 16177: cpu0 unimplemented perfctr wrmsr: 0xc1 data 0xabcd&lt;br /&gt;
Jan  1 21:26:29 an-node02 kernel: kvm: 16118: cpu0 unimplemented perfctr wrmsr: 0xc1 data 0xabcd&lt;br /&gt;
Jan  1 21:26:32 an-node02 kernel: vbr2: port 4(vnet2) entering forwarding state&lt;br /&gt;
Jan  1 21:26:32 an-node02 kernel: vbr2: port 5(vnet3) entering forwarding state&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checking with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clustat&amp;lt;/span&amp;gt;, we can confirm that all four VMs are now running on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;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-cluster-A @ Sun Jan  1 21:28:00 2012&lt;br /&gt;
Member Status: Quorate&lt;br /&gt;
&lt;br /&gt;
 Member Name                             ID   Status&lt;br /&gt;
 ------ ----                             ---- ------&lt;br /&gt;
 an-node01.alteeve.com                       1 Online, rgmanager&lt;br /&gt;
 an-node02.alteeve.com                       2 Online, Local, rgmanager&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State&lt;br /&gt;
 ------- ----                   ----- ------                   -----&lt;br /&gt;
 service:storage_an01           an-node01.alteeve.com          started&lt;br /&gt;
 service:storage_an02           an-node02.alteeve.com          started&lt;br /&gt;
 vm:vm0001-dev                  an-node02.alteeve.com          started&lt;br /&gt;
 vm:vm0002-web                  an-node02.alteeve.com          started&lt;br /&gt;
 vm:vm0003-db                   an-node02.alteeve.com          started&lt;br /&gt;
 vm:vm0004-ms                   an-node02.alteeve.com          started&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Perfect! This is exactly why we built the cluster!&lt;br /&gt;
&lt;br /&gt;
If we wait a few minutes, we&#039;ll see that the hung node has recovered.&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-cluster-A @ Sun Jan  1 22:30:04 2012&lt;br /&gt;
Member Status: Quorate&lt;br /&gt;
&lt;br /&gt;
 Member Name                             ID   Status&lt;br /&gt;
 ------ ----                             ---- ------&lt;br /&gt;
 an-node01.alteeve.com                       1 Online, rgmanager&lt;br /&gt;
 an-node02.alteeve.com                       2 Online, Local, rgmanager&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State         &lt;br /&gt;
 ------- ----                   ----- ------                   -----         &lt;br /&gt;
 service:storage_an01           an-node01.alteeve.com          started       &lt;br /&gt;
 service:storage_an02           an-node02.alteeve.com          started       &lt;br /&gt;
 vm:vm0001-dev                  an-node02.alteeve.com          started       &lt;br /&gt;
 vm:vm0002-web                  an-node02.alteeve.com          started       &lt;br /&gt;
 vm:vm0003-db                   an-node02.alteeve.com          started       &lt;br /&gt;
 vm:vm0004-ms                   an-node02.alteeve.com          started       &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Before we can push the VMs back though, we must make sure that the underlying DRBD resource has finished synchronizing.&lt;br /&gt;
&lt;br /&gt;
{{note|1=With four VMs, it will most certainly take time for underlying resource to resync. Do not migrate the VMs until this has completed!}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
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;
version: 8.3.12 (api:88/proto:86-96)&lt;br /&gt;
GIT-hash: e2a8ef4656be026bbae540305fcb998a5991090f build by dag@Build64R6, 2011-11-20 10:57:03&lt;br /&gt;
 0: cs:Connected ro:Primary/Primary ds:UpToDate/UpToDate C r-----&lt;br /&gt;
    ns:1182704 nr:1053880 dw:1052676 dr:1245848 al:0 bm:266 lo:0 pe:0 ua:0 ap:0 ep:1 wo:f oos:0&lt;br /&gt;
 1: cs:Connected ro:Primary/Primary ds:UpToDate/UpToDate C r-----&lt;br /&gt;
    ns:2087568 nr:362698 dw:366444 dr:2263316 al:9 bm:411 lo:0 pe:0 ua:0 ap:0 ep:1 wo:f oos:0&lt;br /&gt;
 2: cs:Connected ro:Primary/Primary ds:UpToDate/UpToDate C r-----&lt;br /&gt;
    ns:2098343 nr:1114307 dw:1065375 dr:2340421 al:10 bm:551 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;
We&#039;re ready, so lets migrate back &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0001-dev&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0002-web&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
clusvcadm -M vm:vm0001-dev -m an-node01.alteeve.com&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Trying to migrate vm:vm0001-dev to an-node01.alteeve.com...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 -M vm:vm0002-web -m an-node01.alteeve.com&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Trying to migrate vm:vm0002-web to an-node01.alteeve.com...Success&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Confirm;&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-cluster-A @ Sun Jan  1 22:37:10 2012&lt;br /&gt;
Member Status: Quorate&lt;br /&gt;
&lt;br /&gt;
 Member Name                             ID   Status&lt;br /&gt;
 ------ ----                             ---- ------&lt;br /&gt;
 an-node01.alteeve.com                       1 Online, Local, rgmanager&lt;br /&gt;
 an-node02.alteeve.com                       2 Online, rgmanager&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State&lt;br /&gt;
 ------- ----                   ----- ------                   -----&lt;br /&gt;
 service:storage_an01           an-node01.alteeve.com          started&lt;br /&gt;
 service:storage_an02           an-node02.alteeve.com          started&lt;br /&gt;
 vm:vm0001-dev                  an-node01.alteeve.com          started&lt;br /&gt;
 vm:vm0002-web                  an-node01.alteeve.com          started&lt;br /&gt;
 vm:vm0003-db                   an-node02.alteeve.com          started&lt;br /&gt;
 vm:vm0004-ms                   an-node02.alteeve.com          started&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There we have it. Successful crash and recovery of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==== Discussing the syslog Messages ====&lt;br /&gt;
&lt;br /&gt;
Let&#039;s step back and look at the syslog output; There are a few things to discuss.&lt;br /&gt;
&lt;br /&gt;
The first thing we see is that almost immediately after hanging &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;, the first messages are from DRBD, not the cluster. This in turn trigger&#039;s DRBD&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fence-handler&amp;lt;/span&amp;gt; script, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;obliterate-peer.sh&amp;lt;/span&amp;gt;. This is because DRBD is extremely sensitive to interruptions, even more so than the cluster itself. You will notice that DRBD reacted a full 9 seconds faster than the cluster.&lt;br /&gt;
&lt;br /&gt;
The first thing the cluster does, upon realizing it has lost communication with its peer, is call a fence against the lost node. As mentioned, this involves calling &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;obliterate-peer.sh&amp;lt;/span&amp;gt;, which is itself a very simple wrapper for &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman_tool&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fence_node&amp;lt;/span&amp;gt; shell calls.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Jan  1 21:26:00 an-node02 kernel: block drbd1: helper command: /sbin/drbdadm fence-peer minor-1&lt;br /&gt;
Jan  1 21:26:00 an-node02 kernel: block drbd1: receiver terminated&lt;br /&gt;
Jan  1 21:26:00 an-node02 kernel: block drbd1: Restarting receiver thread&lt;br /&gt;
Jan  1 21:26:00 an-node02 kernel: block drbd1: receiver (re)started&lt;br /&gt;
Jan  1 21:26:00 an-node02 kernel: block drbd1: conn( Unconnected -&amp;gt; WFConnection ) &lt;br /&gt;
Jan  1 21:26:00 an-node02 /sbin/obliterate-peer.sh: Local node ID: 2 / Remote node: an-node01.alteeve.com&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here we see DRBD calling the handler (first message), shortly after we see a log entry from &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;obliterate-peer.sh&amp;lt;/span&amp;gt; (last entry). What you don&#039;t see is that right after that last message, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;obliterate-peer.sh&amp;lt;/span&amp;gt; goes into a 10-iteration loop where it calls &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fence_node&amp;lt;/span&amp;gt; against its peer.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Jan  1 21:26:01 an-node02 /sbin/obliterate-peer.sh: Local node ID: 2 / Remote node: an-node01.alteeve.com&lt;br /&gt;
Jan  1 21:26:01 an-node02 /sbin/obliterate-peer.sh: kill node failed: Invalid argument&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;fence_node&amp;lt;/span&amp;gt; call runs in the background, so the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;obliterate-peer.sh&amp;lt;/span&amp;gt; script goes into a short sleep before trying again (and again...). These subsequent calls will generate the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;kill node failed: Invalid argument&amp;lt;/span&amp;gt; because the first call is already in the process of fencing the node, and are thus safe to ignore. The important past was that this error message &#039;&#039;&#039;didn&#039;t&#039;&#039;&#039; follow the first entry.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Jan  1 21:26:15 an-node02 fenced[2022]: fence an-node01.alteeve.com success&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is what matters. Here we see that the fence succeeded and the hung node was indeed fenced.&lt;br /&gt;
&lt;br /&gt;
=== Failing and Recovery of an-node02 ===&lt;br /&gt;
&lt;br /&gt;
With everything back in place, we&#039;ll hang &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt; and ensure that its VMs will recover on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
As always, check the current state.&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-cluster-A @ Sun Jan  1 22:53:43 2012&lt;br /&gt;
Member Status: Quorate&lt;br /&gt;
&lt;br /&gt;
 Member Name                             ID   Status&lt;br /&gt;
 ------ ----                             ---- ------&lt;br /&gt;
 an-node01.alteeve.com                       1 Online, Local, rgmanager&lt;br /&gt;
 an-node02.alteeve.com                       2 Online, rgmanager&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State&lt;br /&gt;
 ------- ----                   ----- ------                   -----&lt;br /&gt;
 service:storage_an01           an-node01.alteeve.com          started&lt;br /&gt;
 service:storage_an02           an-node02.alteeve.com          started&lt;br /&gt;
 vm:vm0001-dev                  an-node01.alteeve.com          started&lt;br /&gt;
 vm:vm0002-web                  an-node01.alteeve.com          started&lt;br /&gt;
 vm:vm0003-db                   an-node02.alteeve.com          started&lt;br /&gt;
 vm:vm0004-ms                   an-node02.alteeve.com          started&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now hang &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;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 c &amp;gt; /proc/sysrq-trigger&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As before, that command will not return. If we check &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;&#039;s syslog though, we should see that the node is fenced and the lost VMs are recovered.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Jan  1 22:56:14 an-node01 kernel: block drbd1: PingAck did not arrive in time.&lt;br /&gt;
Jan  1 22:56:14 an-node01 kernel: block drbd1: peer( Primary -&amp;gt; Unknown ) conn( Connected -&amp;gt; NetworkFailure ) pdsk( UpToDate -&amp;gt; DUnknown ) susp( 0 -&amp;gt; 1 ) &lt;br /&gt;
Jan  1 22:56:15 an-node01 kernel: block drbd1: asender terminated&lt;br /&gt;
Jan  1 22:56:15 an-node01 kernel: block drbd1: Terminating asender thread&lt;br /&gt;
Jan  1 22:56:15 an-node01 kernel: block drbd1: Connection closed&lt;br /&gt;
Jan  1 22:56:15 an-node01 kernel: block drbd1: conn( NetworkFailure -&amp;gt; Unconnected ) &lt;br /&gt;
Jan  1 22:56:15 an-node01 kernel: block drbd1: helper command: /sbin/drbdadm fence-peer minor-1&lt;br /&gt;
Jan  1 22:56:15 an-node01 kernel: block drbd1: receiver terminated&lt;br /&gt;
Jan  1 22:56:15 an-node01 kernel: block drbd1: Restarting receiver thread&lt;br /&gt;
Jan  1 22:56:15 an-node01 kernel: block drbd1: receiver (re)started&lt;br /&gt;
Jan  1 22:56:15 an-node01 kernel: block drbd1: conn( Unconnected -&amp;gt; WFConnection ) &lt;br /&gt;
Jan  1 22:56:15 an-node01 /sbin/obliterate-peer.sh: Local node ID: 1 / Remote node: an-node02.alteeve.com&lt;br /&gt;
Jan  1 22:56:19 an-node01 kernel: block drbd0: PingAck did not arrive in time.&lt;br /&gt;
Jan  1 22:56:19 an-node01 kernel: block drbd0: peer( Primary -&amp;gt; Unknown ) conn( Connected -&amp;gt; NetworkFailure ) pdsk( UpToDate -&amp;gt; DUnknown ) susp( 0 -&amp;gt; 1 ) &lt;br /&gt;
Jan  1 22:56:19 an-node01 kernel: block drbd0: asender terminated&lt;br /&gt;
Jan  1 22:56:19 an-node01 kernel: block drbd0: Terminating asender thread&lt;br /&gt;
Jan  1 22:56:19 an-node01 kernel: block drbd0: Connection closed&lt;br /&gt;
Jan  1 22:56:19 an-node01 kernel: block drbd0: conn( NetworkFailure -&amp;gt; Unconnected ) &lt;br /&gt;
Jan  1 22:56:19 an-node01 kernel: block drbd0: helper command: /sbin/drbdadm fence-peer minor-0&lt;br /&gt;
Jan  1 22:56:19 an-node01 kernel: block drbd0: receiver terminated&lt;br /&gt;
Jan  1 22:56:19 an-node01 kernel: block drbd0: Restarting receiver thread&lt;br /&gt;
Jan  1 22:56:19 an-node01 kernel: block drbd0: receiver (re)started&lt;br /&gt;
Jan  1 22:56:19 an-node01 kernel: block drbd0: conn( Unconnected -&amp;gt; WFConnection ) &lt;br /&gt;
Jan  1 22:56:19 an-node01 /sbin/obliterate-peer.sh: Local node ID: 1 / Remote node: an-node02.alteeve.com&lt;br /&gt;
Jan  1 22:56:19 an-node01 /sbin/obliterate-peer.sh: kill node failed: Invalid argument&lt;br /&gt;
Jan  1 22:56:21 an-node01 kernel: block drbd2: PingAck did not arrive in time.&lt;br /&gt;
Jan  1 22:56:21 an-node01 kernel: block drbd2: peer( Primary -&amp;gt; Unknown ) conn( Connected -&amp;gt; NetworkFailure ) pdsk( UpToDate -&amp;gt; DUnknown ) susp( 0 -&amp;gt; 1 ) &lt;br /&gt;
Jan  1 22:56:21 an-node01 kernel: block drbd2: asender terminated&lt;br /&gt;
Jan  1 22:56:21 an-node01 kernel: block drbd2: Terminating asender thread&lt;br /&gt;
Jan  1 22:56:21 an-node01 kernel: block drbd2: Connection closed&lt;br /&gt;
Jan  1 22:56:21 an-node01 kernel: block drbd2: conn( NetworkFailure -&amp;gt; Unconnected ) &lt;br /&gt;
Jan  1 22:56:21 an-node01 kernel: block drbd2: receiver terminated&lt;br /&gt;
Jan  1 22:56:21 an-node01 kernel: block drbd2: Restarting receiver thread&lt;br /&gt;
Jan  1 22:56:21 an-node01 kernel: block drbd2: receiver (re)started&lt;br /&gt;
Jan  1 22:56:21 an-node01 kernel: block drbd2: conn( Unconnected -&amp;gt; WFConnection ) &lt;br /&gt;
Jan  1 22:56:21 an-node01 kernel: block drbd2: helper command: /sbin/drbdadm fence-peer minor-2&lt;br /&gt;
Jan  1 22:56:21 an-node01 /sbin/obliterate-peer.sh: Local node ID: 1 / Remote node: an-node02.alteeve.com&lt;br /&gt;
Jan  1 22:56:21 an-node01 /sbin/obliterate-peer.sh: kill node failed: Invalid argument&lt;br /&gt;
Jan  1 22:56:22 an-node01 corosync[1958]:   [TOTEM ] A processor failed, forming new configuration.&lt;br /&gt;
Jan  1 22:56:24 an-node01 corosync[1958]:   [QUORUM] Members[1]: 1&lt;br /&gt;
Jan  1 22:56:24 an-node01 corosync[1958]:   [TOTEM ] A processor joined or left the membership and a new membership was formed.&lt;br /&gt;
Jan  1 22:56:24 an-node01 kernel: dlm: closing connection to node 2&lt;br /&gt;
Jan  1 22:56:24 an-node01 corosync[1958]:   [CPG   ] chosen downlist: sender r(0) ip(10.20.0.1) ; members(old:2 left:1)&lt;br /&gt;
Jan  1 22:56:24 an-node01 corosync[1958]:   [MAIN  ] Completed service synchronization, ready to provide service.&lt;br /&gt;
Jan  1 22:56:24 an-node01 fenced[2014]: fencing node an-node02.alteeve.com&lt;br /&gt;
Jan  1 22:56:24 an-node01 kernel: GFS2: fsid=an-cluster-A:shared.1: jid=0: Trying to acquire journal lock...&lt;br /&gt;
Jan  1 22:56:28 an-node01 fenced[2014]: fence an-node02.alteeve.com success&lt;br /&gt;
Jan  1 22:56:29 an-node01 fence_node[638]: fence an-node02.alteeve.com success&lt;br /&gt;
Jan  1 22:56:29 an-node01 kernel: block drbd2: helper command: /sbin/drbdadm fence-peer minor-2 exit code 7 (0x700)&lt;br /&gt;
Jan  1 22:56:29 an-node01 kernel: block drbd2: fence-peer helper returned 7 (peer was stonithed)&lt;br /&gt;
Jan  1 22:56:29 an-node01 kernel: block drbd2: pdsk( DUnknown -&amp;gt; Outdated ) &lt;br /&gt;
Jan  1 22:56:29 an-node01 kernel: block drbd2: new current UUID 207F7C9279067EC1:3EEB0F756A6A289F:FD92DAC355F53A93:FD91DAC355F53A93&lt;br /&gt;
Jan  1 22:56:29 an-node01 kernel: block drbd2: susp( 1 -&amp;gt; 0 ) &lt;br /&gt;
Jan  1 22:56:29 an-node01 fence_node[518]: fence an-node02.alteeve.com success&lt;br /&gt;
Jan  1 22:56:29 an-node01 kernel: block drbd1: helper command: /sbin/drbdadm fence-peer minor-1 exit code 7 (0x700)&lt;br /&gt;
Jan  1 22:56:29 an-node01 kernel: block drbd1: fence-peer helper returned 7 (peer was stonithed)&lt;br /&gt;
Jan  1 22:56:29 an-node01 kernel: block drbd1: pdsk( DUnknown -&amp;gt; Outdated ) &lt;br /&gt;
Jan  1 22:56:29 an-node01 kernel: block drbd1: new current UUID C65C044AE682D8C5:67D512BD61B70265:C1947DF86E910F8B:C1937DF86E910F8B&lt;br /&gt;
Jan  1 22:56:29 an-node01 kernel: block drbd1: susp( 1 -&amp;gt; 0 ) &lt;br /&gt;
Jan  1 22:56:29 an-node01 rgmanager[2507]: Marking service:storage_an02 as stopped: Restricted domain unavailable&lt;br /&gt;
Jan  1 22:56:29 an-node01 fence_node[583]: fence an-node02.alteeve.com success&lt;br /&gt;
Jan  1 22:56:29 an-node01 kernel: block drbd0: helper command: /sbin/drbdadm fence-peer minor-0 exit code 7 (0x700)&lt;br /&gt;
Jan  1 22:56:29 an-node01 kernel: block drbd0: fence-peer helper returned 7 (peer was stonithed)&lt;br /&gt;
Jan  1 22:56:29 an-node01 kernel: block drbd0: pdsk( DUnknown -&amp;gt; Outdated ) &lt;br /&gt;
Jan  1 22:56:29 an-node01 kernel: block drbd0: new current UUID 295A00166167B5C3:A3F3889ECF7247F5:30313B4AFFF6F82B:30303B4AFFF6F82B&lt;br /&gt;
Jan  1 22:56:29 an-node01 kernel: block drbd0: susp( 1 -&amp;gt; 0 ) &lt;br /&gt;
Jan  1 22:56:29 an-node01 kernel: GFS2: fsid=an-cluster-A:shared.1: jid=0: Looking at journal...&lt;br /&gt;
Jan  1 22:56:30 an-node01 kernel: GFS2: fsid=an-cluster-A:shared.1: jid=0: Done&lt;br /&gt;
Jan  1 22:56:30 an-node01 rgmanager[2507]: Taking over service vm:vm0003-db from down member an-node02.alteeve.com&lt;br /&gt;
Jan  1 22:56:30 an-node01 rgmanager[2507]: Taking over service vm:vm0004-ms from down member an-node02.alteeve.com&lt;br /&gt;
Jan  1 22:56:30 an-node01 kernel: device vnet2 entered promiscuous mode&lt;br /&gt;
Jan  1 22:56:30 an-node01 kernel: vbr2: port 4(vnet2) entering learning state&lt;br /&gt;
Jan  1 22:56:30 an-node01 rgmanager[2507]: Service vm:vm0003-db started&lt;br /&gt;
Jan  1 22:56:31 an-node01 kernel: device vnet3 entered promiscuous mode&lt;br /&gt;
Jan  1 22:56:31 an-node01 kernel: vbr2: port 5(vnet3) entering learning state&lt;br /&gt;
Jan  1 22:56:31 an-node01 rgmanager[2507]: Service vm:vm0004-ms started&lt;br /&gt;
Jan  1 22:56:34 an-node01 ntpd[2267]: Listening on interface #12 vnet3, fe80::fc54:ff:fe5e:b147#123 Enabled&lt;br /&gt;
Jan  1 22:56:34 an-node01 ntpd[2267]: Listening on interface #13 vnet2, fe80::fc54:ff:fe44:83ec#123 Enabled&lt;br /&gt;
Jan  1 22:56:40 an-node01 kernel: kvm: 1074: cpu0 unimplemented perfctr wrmsr: 0xc1 data 0xabcd&lt;br /&gt;
Jan  1 22:56:45 an-node01 kernel: vbr2: port 4(vnet2) entering forwarding state&lt;br /&gt;
Jan  1 22:56:46 an-node01 kernel: vbr2: port 5(vnet3) entering forwarding state&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checking &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-cluster-A @ Sun Jan  1 22:57:36 2012&lt;br /&gt;
Member Status: Quorate&lt;br /&gt;
&lt;br /&gt;
 Member Name                             ID   Status&lt;br /&gt;
 ------ ----                             ---- ------&lt;br /&gt;
 an-node01.alteeve.com                       1 Online, Local, rgmanager&lt;br /&gt;
 an-node02.alteeve.com                       2 Offline&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State&lt;br /&gt;
 ------- ----                   ----- ------                   -----&lt;br /&gt;
 service:storage_an01           an-node01.alteeve.com          started&lt;br /&gt;
 service:storage_an02           (an-node02.alteeve.com)        stopped&lt;br /&gt;
 vm:vm0001-dev                  an-node01.alteeve.com          started&lt;br /&gt;
 vm:vm0002-web                  an-node01.alteeve.com          started&lt;br /&gt;
 vm:vm0003-db                   an-node01.alteeve.com          started&lt;br /&gt;
 vm:vm0004-ms                   an-node01.alteeve.com          started&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
All four VMs are back up and running on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;!&lt;br /&gt;
&lt;br /&gt;
Within a few moments, we should see see that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt; has rejoined the cluster.&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-cluster-A @ Sun Jan  1 23:00:43 2012&lt;br /&gt;
Member Status: Quorate&lt;br /&gt;
&lt;br /&gt;
 Member Name                             ID   Status&lt;br /&gt;
 ------ ----                             ---- ------&lt;br /&gt;
 an-node01.alteeve.com                       1 Online, Local, rgmanager&lt;br /&gt;
 an-node02.alteeve.com                       2 Online, rgmanager&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State&lt;br /&gt;
 ------- ----                   ----- ------                   -----&lt;br /&gt;
 service:storage_an01           an-node01.alteeve.com          started&lt;br /&gt;
 service:storage_an02           an-node02.alteeve.com          started&lt;br /&gt;
 vm:vm0001-dev                  an-node01.alteeve.com          started&lt;br /&gt;
 vm:vm0002-web                  an-node01.alteeve.com          started&lt;br /&gt;
 vm:vm0003-db                   an-node01.alteeve.com          started&lt;br /&gt;
 vm:vm0004-ms                   an-node01.alteeve.com          started&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we&#039;ll wait for the backing DRBD resources to be in sync.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
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;
GIT-hash: e2a8ef4656be026bbae540305fcb998a5991090f build by dag@Build64R6, 2011-11-20 10:57:03&lt;br /&gt;
 0: cs:SyncTarget ro:Primary/Primary ds:Inconsistent/UpToDate C r-----&lt;br /&gt;
    ns:0 nr:272884 dw:271744 dr:5700 al:0 bm:25 lo:0 pe:0 ua:0 ap:0 ep:1 wo:b oos:780928&lt;br /&gt;
	[====&amp;gt;...............] sync&#039;ed: 26.4% (780928/1052672)K&lt;br /&gt;
	finish: 0:10:02 speed: 1,284 (1,280) want: 250 K/sec&lt;br /&gt;
 1: cs:SyncTarget ro:Primary/Primary ds:Inconsistent/UpToDate C r-----&lt;br /&gt;
    ns:0 nr:272196 dw:271048 dr:3688 al:0 bm:45 lo:0 pe:0 ua:0 ap:0 ep:1 wo:f oos:122292&lt;br /&gt;
	[=============&amp;gt;......] sync&#039;ed: 70.2% (122292/393216)K&lt;br /&gt;
	finish: 0:01:31 speed: 1,328 (1,276) want: 250 K/sec&lt;br /&gt;
 2: cs:SyncTarget ro:Primary/Primary ds:Inconsistent/UpToDate C r-----&lt;br /&gt;
    ns:0 nr:273426 dw:272258 dr:3636 al:0 bm:47 lo:0 pe:0 ua:0 ap:0 ep:1 wo:f oos:781500&lt;br /&gt;
	[====&amp;gt;...............] sync&#039;ed: 26.4% (781500/1052760)K&lt;br /&gt;
	finish: 0:09:49 speed: 1,308 (1,284) want: 250 K/sec&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(time passes)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
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;
version: 8.3.12 (api:88/proto:86-96)&lt;br /&gt;
GIT-hash: e2a8ef4656be026bbae540305fcb998a5991090f build by dag@Build64R6, 2011-11-20 10:57:03&lt;br /&gt;
 0: cs:Connected ro:Primary/Primary ds:UpToDate/UpToDate C r-----&lt;br /&gt;
    ns:0 nr:1053812 dw:1052672 dr:6964 al:0 bm:74 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:0 nr:394560 dw:393412 dr:4988 al:0 bm:70 lo:0 pe:0 ua:0 ap:0 ep:1 wo:f oos:0&lt;br /&gt;
 2: cs:Connected ro:Primary/Primary ds:UpToDate/UpToDate C r-----&lt;br /&gt;
    ns:0 nr:1055190 dw:1054022 dr:4936 al:0 bm:167 lo:0 pe:0 ua:0 ap:0 ep:1 wo:f oos:0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we&#039;re ready to migrate &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0003-db&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0004-ms&amp;lt;/span&amp;gt; back to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
clusvcadm -M vm:vm0003-db -m an-node02.alteeve.com&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Trying to migrate vm:vm0003-db to an-node02.alteeve.com...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 -M vm:vm0004-ms -m an-node02.alteeve.com&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Trying to migrate vm:vm0004-ms to an-node02.alteeve.com...Success&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A final check;&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-cluster-A @ Sun Jan  1 23:08:06 2012&lt;br /&gt;
Member Status: Quorate&lt;br /&gt;
&lt;br /&gt;
 Member Name                             ID   Status&lt;br /&gt;
 ------ ----                             ---- ------&lt;br /&gt;
 an-node01.alteeve.com                       1 Online, Local, rgmanager&lt;br /&gt;
 an-node02.alteeve.com                       2 Online, rgmanager&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State&lt;br /&gt;
 ------- ----                   ----- ------                   -----&lt;br /&gt;
 service:storage_an01           an-node01.alteeve.com          started&lt;br /&gt;
 service:storage_an02           an-node02.alteeve.com          started&lt;br /&gt;
 vm:vm0001-dev                  an-node01.alteeve.com          started&lt;br /&gt;
 vm:vm0002-web                  an-node01.alteeve.com          started&lt;br /&gt;
 vm:vm0003-db                   an-node02.alteeve.com          started&lt;br /&gt;
 vm:vm0004-ms                   an-node02.alteeve.com          started&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Good!&lt;br /&gt;
&lt;br /&gt;
== Complete Cold Shut Down And Cold Starting The Cluster ==&lt;br /&gt;
&lt;br /&gt;
The final testing is now complete. There is one final task to cover though; &amp;quot;Cold Shut Down&amp;quot; and &amp;quot;Cold Start&amp;quot; of the cluster. This involves shutting down all VMs, stopping &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;cman&amp;lt;/span&amp;gt; on both nodes, then powering off both nodes. &lt;br /&gt;
&lt;br /&gt;
The cold-start process involves simply powering both nodes on within the set &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;post_join_delay&amp;lt;/span&amp;gt;, then manually enabling the four VMs.&lt;br /&gt;
&lt;br /&gt;
=== Stopping All VMs ===&lt;br /&gt;
&lt;br /&gt;
Check the status as always;&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-cluster-A @ Sun Jan  1 23:13:24 2012&lt;br /&gt;
Member Status: Quorate&lt;br /&gt;
&lt;br /&gt;
 Member Name                             ID   Status&lt;br /&gt;
 ------ ----                             ---- ------&lt;br /&gt;
 an-node01.alteeve.com                       1 Online, Local, rgmanager&lt;br /&gt;
 an-node02.alteeve.com                       2 Online, rgmanager&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State&lt;br /&gt;
 ------- ----                   ----- ------                   -----&lt;br /&gt;
 service:storage_an01           an-node01.alteeve.com          started&lt;br /&gt;
 service:storage_an02           an-node02.alteeve.com          started&lt;br /&gt;
 vm:vm0001-dev                  an-node01.alteeve.com          started&lt;br /&gt;
 vm:vm0002-web                  an-node01.alteeve.com          started&lt;br /&gt;
 vm:vm0003-db                   an-node02.alteeve.com          started&lt;br /&gt;
 vm:vm0004-ms                   an-node02.alteeve.com          started&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
All four VMs are up, so we&#039;ll stop all of them.&lt;br /&gt;
&lt;br /&gt;
{{note|1=You might want to get into the habit of stopping the windows machines, then connecting to them over [[RDP]] or using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-manager&amp;lt;/span&amp;gt; to ensure that it has started to power down. If it hasn&#039;t, shut it down from within the OS.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
clusvcadm -d vm:vm0001-dev&lt;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-dev...Success&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 vm:vm0002-web&lt;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-web...Success&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 vm:vm0003-db&lt;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:vm0003-db...Success&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 vm:vm0004-ms&lt;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:vm0004-ms...Success&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Confirm;&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-cluster-A @ Sun Jan  1 23:17:29 2012&lt;br /&gt;
Member Status: Quorate&lt;br /&gt;
&lt;br /&gt;
 Member Name                             ID   Status&lt;br /&gt;
 ------ ----                             ---- ------&lt;br /&gt;
 an-node01.alteeve.com                       1 Online, Local, rgmanager&lt;br /&gt;
 an-node02.alteeve.com                       2 Online, rgmanager&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State&lt;br /&gt;
 ------- ----                   ----- ------                   -----&lt;br /&gt;
 service:storage_an01           an-node01.alteeve.com          started&lt;br /&gt;
 service:storage_an02           an-node02.alteeve.com          started&lt;br /&gt;
 vm:vm0001-dev                  (an-node01.alteeve.com)        disabled&lt;br /&gt;
 vm:vm0002-web                  (an-node01.alteeve.com)        disabled&lt;br /&gt;
 vm:vm0003-db                   (an-node02.alteeve.com)        disabled&lt;br /&gt;
 vm:vm0004-ms                   (an-node02.alteeve.com)        disabled&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Good, we can now stop &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;
=== Shutting Down The Cluster Entirely ===&lt;br /&gt;
&lt;br /&gt;
{{note|1=It can sometimes take a minute or two for &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; to stop. Please be patient.}}&lt;br /&gt;
&lt;br /&gt;
On &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;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 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 Service Manager:                          [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;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 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 Service Manager:                          [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now stop &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 &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;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;
   Leaving fence domain...                                 [  OK  ]&lt;br /&gt;
   Stopping gfs_controld...                                [  OK  ]&lt;br /&gt;
   Stopping dlm_controld...                                [  OK  ]&lt;br /&gt;
   Stopping fenced...                                      [  OK  ]&lt;br /&gt;
   Stopping cman...                                        [  OK  ]&lt;br /&gt;
   Waiting for corosync to shutdown:                       [  OK  ]&lt;br /&gt;
   Unloading kernel modules...                             [  OK  ]&lt;br /&gt;
   Unmounting configfs...                                  [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;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;
   Leaving fence domain...                                 [  OK  ]&lt;br /&gt;
   Stopping gfs_controld...                                [  OK  ]&lt;br /&gt;
   Stopping dlm_controld...                                [  OK  ]&lt;br /&gt;
   Stopping fenced...                                      [  OK  ]&lt;br /&gt;
   Stopping cman...                                        [  OK  ]&lt;br /&gt;
   Waiting for corosync to shutdown:                       [  OK  ]&lt;br /&gt;
   Unloading kernel modules...                             [  OK  ]&lt;br /&gt;
   Unmounting configfs...                                  [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We&#039;re down, we can safely power off the nodes now.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
poweroff&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Broadcast message from root@an-node01.alteeve.com&lt;br /&gt;
	(/dev/pts/0) at 23:22 ...&lt;br /&gt;
&lt;br /&gt;
The system is going down for power off NOW!&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Cold-Stop achieved!&lt;br /&gt;
&lt;br /&gt;
=== Cold-Starting The Cluster ===&lt;br /&gt;
&lt;br /&gt;
{{note|1=It is important to power on both nodes within &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;post_join_delay&amp;lt;/span&amp;gt; seconds. Otherwise, the slower node will be fenced and the boot process will take longer than it needs to.}}&lt;br /&gt;
&lt;br /&gt;
Power on both nodes. You can just hit the power button, or if you have a workstation on the [[BCN]] with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fence-agents&amp;lt;/span&amp;gt; installed, you can call &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fence_ipmilan&amp;lt;/span&amp;gt; (or the agent you use in your cluster).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
fence_ipmilan -a an-node01.ipmi -l root -p secret -o on&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Powering on machine @ IPMI:an-node01.ipmi...Done&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;
fence_ipmilan -a an-node02.ipmi -l root -p secret -o on&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Powering on machine @ IPMI:an-node02.ipmi...Done&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once they&#039;re up, log into them again and check their status. You will see that the VMs are off-line.&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-cluster-A @ Sun Jan  1 23:40:16 2012&lt;br /&gt;
Member Status: Quorate&lt;br /&gt;
&lt;br /&gt;
 Member Name                             ID   Status&lt;br /&gt;
 ------ ----                             ---- ------&lt;br /&gt;
 an-node01.alteeve.com                       1 Online, Local, rgmanager&lt;br /&gt;
 an-node02.alteeve.com                       2 Online, rgmanager&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State         &lt;br /&gt;
 ------- ----                   ----- ------                   -----         &lt;br /&gt;
 service:storage_an01           an-node01.alteeve.com          started       &lt;br /&gt;
 service:storage_an02           an-node02.alteeve.com          started       &lt;br /&gt;
 vm:vm0001-dev                  (none)                         disabled      &lt;br /&gt;
 vm:vm0002-web                  (none)                         disabled      &lt;br /&gt;
 vm:vm0003-db                   (none)                         disabled      &lt;br /&gt;
 vm:vm0004-ms                   (none)                         disabled      &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check that DRBD is ready;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
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;
version: 8.3.12 (api:88/proto:86-96)&lt;br /&gt;
GIT-hash: e2a8ef4656be026bbae540305fcb998a5991090f build by dag@Build64R6, 2011-11-20 10:57:03&lt;br /&gt;
 0: cs:Connected ro:Primary/Primary ds:UpToDate/UpToDate C r-----&lt;br /&gt;
    ns:4 nr:0 dw:0 dr:8712 al:0 bm:1 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:0 nr:0 dw:0 dr:4632 al:0 bm:0 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:0 nr:0 dw:0 dr:4648 al:0 bm:0 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;
Golden, let&#039;s start the VMs.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
clusvcadm -e vm:vm0001-dev -m an-node01.alteeve.com&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
vm:vm0001-dev is now running on an-node01.alteeve.com&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 -e vm:vm0002-web -m an-node01.alteeve.com&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
vm:vm0002-web is now running on an-node01.alteeve.com&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 -e vm:vm0003-db -m an-node02.alteeve.com&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
vm:vm0003-db is now running on an-node02.alteeve.com&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 -e vm:vm0004-ms -m an-node02.alteeve.com&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
vm:vm0004-ms is now running on an-node02.alteeve.com&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check the new status;&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-cluster-A @ Sun Jan  1 23:45:35 2012&lt;br /&gt;
Member Status: Quorate&lt;br /&gt;
&lt;br /&gt;
 Member Name                             ID   Status&lt;br /&gt;
 ------ ----                             ---- ------&lt;br /&gt;
 an-node01.alteeve.com                       1 Online, rgmanager&lt;br /&gt;
 an-node02.alteeve.com                       2 Online, Local, rgmanager&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State         &lt;br /&gt;
 ------- ----                   ----- ------                   -----         &lt;br /&gt;
 service:storage_an01           an-node01.alteeve.com          started       &lt;br /&gt;
 service:storage_an02           an-node02.alteeve.com          started       &lt;br /&gt;
 vm:vm0001-dev                  an-node01.alteeve.com          started       &lt;br /&gt;
 vm:vm0002-web                  an-node01.alteeve.com          started       &lt;br /&gt;
 vm:vm0003-db                   an-node02.alteeve.com          started       &lt;br /&gt;
 vm:vm0004-ms                   an-node02.alteeve.com          started       &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We&#039;re back up and running!&lt;br /&gt;
&lt;br /&gt;
== Done and Done! ==&lt;br /&gt;
&lt;br /&gt;
That, ladies and gentlemen, is all she wrote!&lt;br /&gt;
&lt;br /&gt;
You should now be safely ready to take your cluster into production at this stage.&lt;br /&gt;
&lt;br /&gt;
Happy Hacking!&lt;br /&gt;
&lt;br /&gt;
= Troubleshooting =&lt;br /&gt;
&lt;br /&gt;
Here we will cover, in no particular order, some common clustering problems and their fixes.&lt;br /&gt;
&lt;br /&gt;
== [vm] error: internal error Attempt to migrate guest to the same host {uuid} ==&lt;br /&gt;
&lt;br /&gt;
{{note|1=&amp;lt;s&amp;gt;See [https://bugzilla.redhat.com/show_bug.cgi?id=770626 rhbz#770626]. Work-around below.&amp;lt;/s&amp;gt; This seems to now be resolved! Setting &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;host_uuid&amp;lt;/span&amp;gt; is enough to work around this issue.}}&lt;br /&gt;
&lt;br /&gt;
This message will appear in the source node&#039;s syslog when trying to migrate a VM. Here is an example set of error messages.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Dec 27 22:00:46 an-node01 rgmanager[2492]: Migrating vm:vm0001-dev to an-node02.alteeve.com&lt;br /&gt;
Dec 27 22:00:46 an-node01 rgmanager[22331]: [vm] Migrate vm0001-dev to an-node02.alteeve.com failed:&lt;br /&gt;
Dec 27 22:00:46 an-node01 rgmanager[22353]: [vm] error: internal error Attempt to migrate guest to the same host 00020003-0004-0005-0006-000700080009&lt;br /&gt;
Dec 27 22:00:46 an-node01 rgmanager[2492]: migrate on vm &amp;quot;vm0001-dev&amp;quot; returned 150 (unspecified)&lt;br /&gt;
Dec 27 22:00:46 an-node01 rgmanager[2492]: Migration of vm:vm0001-dev to an-node02.alteeve.com failed; return code 150&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For reasons as yet unknown, both nodes have the same [[UUID]]. You can verify this by running &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virsh sysinfo | grep uuid&amp;lt;/span&amp;gt; on both nodes.&lt;br /&gt;
&lt;br /&gt;
First node;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
virsh sysinfo | grep uuid&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;entry name=&#039;uuid&#039;&amp;gt;03000200-0400-0500-0006-000700080009&amp;lt;/entry&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
First node;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
virsh sysinfo | grep uuid&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;entry name=&#039;uuid&#039;&amp;gt;03000200-0400-0500-0006-000700080009&amp;lt;/entry&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This UUID comes from the mainboard, and you can confirm this with the following command (note to change the string in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;grep&amp;lt;/span&amp;gt; to a portion of your UUID);&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
dmidecode -s system-uuid&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
03000200-0400-0500-0006-000700080009&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Alternatively;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
dmidecode |grep 000700080009 -B 7 -A 4&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Handle 0x0001, DMI type 1, 27 bytes&lt;br /&gt;
System Information&lt;br /&gt;
	Manufacturer: empty&lt;br /&gt;
	Product Name: empty&lt;br /&gt;
	Version: empty&lt;br /&gt;
	Serial Number: empty&lt;br /&gt;
	UUID: 03000200-0400-0500-0006-000700080009&lt;br /&gt;
	Wake-up Type: Power Switch&lt;br /&gt;
	SKU Number: To be filled by O.E.M.&lt;br /&gt;
	Family: To be filled by O.E.M.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is the result of a lazy vendor re-using UUIDs across mainboards.&lt;br /&gt;
&lt;br /&gt;
The fix is to specify a unique UUID in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/libvirt/libvirtd.conf&amp;lt;/span&amp;gt; using its &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;host_uuid&amp;lt;/span&amp;gt; variable. We&#039;ll generate new, unique UUIDs for each node using the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;uuidgen&amp;lt;/span&amp;gt; command. Be sure to use two new UUIDs for each node!&lt;br /&gt;
&lt;br /&gt;
On the first node;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/libvirt/libvirtd.conf /etc/libvirt/libvirtd.conf.orig&lt;br /&gt;
uuidgen &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;
31873b9e-1069-42ce-b950-137ae5eaa3d1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Change the UUID;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/libvirt/libvirtd.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;
host_uuid = &amp;quot;31873b9e-1069-42ce-b950-137ae5eaa3d1&amp;quot;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here&#039;s the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;diff&amp;lt;/span&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
diff -u /etc/libvirt/libvirtd.conf.orig /etc/libvirt/libvirtd.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/libvirt/libvirtd.conf.orig	2011-12-27 22:29:01.243394880 -0500&lt;br /&gt;
+++ /etc/libvirt/libvirtd.conf	2011-12-27 22:33:44.309799253 -0500&lt;br /&gt;
@@ -365,4 +365,4 @@&lt;br /&gt;
 # NB This default all-zeros UUID will not work. Replace&lt;br /&gt;
 # it with the output of the &#039;uuidgen&#039; command and then&lt;br /&gt;
 # uncomment this entry&lt;br /&gt;
-#host_uuid = &amp;quot;00000000-0000-0000-0000-000000000000&amp;quot;&lt;br /&gt;
+host_uuid = &amp;quot;31873b9e-1069-42ce-b950-137ae5eaa3d1&amp;quot;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Make the same change, with a new and unique UUID, on the second node.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/libvirt/libvirtd.conf /etc/libvirt/libvirtd.conf.orig&lt;br /&gt;
uuidgen &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;
90b8d280-c9ff-4e0e-867e-6d4f7d915995&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Change the UUID;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/libvirt/libvirtd.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;
host_uuid = &amp;quot;90b8d280-c9ff-4e0e-867e-6d4f7d915995&amp;quot;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here&#039;s the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;diff&amp;lt;/span&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
diff -u /etc/libvirt/libvirtd.conf.orig /etc/libvirt/libvirtd.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/libvirt/libvirtd.conf.orig	2011-12-27 22:35:45.975389858 -0500&lt;br /&gt;
+++ /etc/libvirt/libvirtd.conf	2011-12-27 22:36:28.325518880 -0500&lt;br /&gt;
@@ -365,4 +365,4 @@&lt;br /&gt;
 # NB This default all-zeros UUID will not work. Replace&lt;br /&gt;
 # it with the output of the &#039;uuidgen&#039; command and then&lt;br /&gt;
 # uncomment this entry&lt;br /&gt;
-#host_uuid = &amp;quot;00000000-0000-0000-0000-000000000000&amp;quot;&lt;br /&gt;
+host_uuid = &amp;quot;90b8d280-c9ff-4e0e-867e-6d4f7d915995&amp;quot;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now to reload the configuration, we need to restart &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;libvirtd&amp;lt;/span&amp;gt; (a reload is not enough). &lt;br /&gt;
&lt;br /&gt;
{{warning|1=Be sure to stop all VMs on the node before proceeding!}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/libvirtd restart&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Stopping libvirtd daemon:                                  [  OK  ]&lt;br /&gt;
Starting libvirtd daemon:                                  [  OK  ]&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;
virsh sysinfo | grep uuid&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This should show the new UUID. If it doesn&#039;t though, please apply the work-around below.&lt;br /&gt;
&lt;br /&gt;
=== Setting host_uuid Didn&#039;t Work, What Now? ===&lt;br /&gt;
&lt;br /&gt;
{{warning|1=This work-around is not supported in any way supported by Red Hat or any other vendor. This work-around is provided as-is until &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;libvirt&amp;lt;/span&amp;gt; is fixed. - &#039;&#039;&#039;Dec. 28, 2011&#039;&#039;&#039;}}&lt;br /&gt;
&lt;br /&gt;
The problem is that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;libvirt&amp;lt;/span&amp;gt; doesn&#039;t use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;libvirtd.conf&amp;lt;/span&amp;gt;&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;host_uuid&amp;lt;/span&amp;gt; if it sees the system UUID as being valid (not all &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;0&amp;lt;/span&amp;gt; or all &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;f&amp;lt;/span&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
The work-around is to create a wrapper script for &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;dmidecode&amp;lt;/span&amp;gt; that intercepts &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;dmidecode -q -t 0,1,4,17&amp;lt;/span&amp;gt;, reads the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;libvirtd.conf&amp;lt;/span&amp;gt; and, if &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;host_uuid&amp;lt;/span&amp;gt; is set, substitute UUID returned by &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;dmidecode&amp;lt;/span&amp;gt; with the one set by &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;host_uuid&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
{{note|1=You can look at the source of the wrapper script [http://pastebin.com/dwXkUnPT on pastebin.org].}}&lt;br /&gt;
&lt;br /&gt;
To apply the work-around;&lt;br /&gt;
&lt;br /&gt;
Check that the current &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;dmidecode&amp;lt;/span&amp;gt; returns the bad UUID;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
dmidecode -q -t 0,1,4,17 | grep UUID&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
	UUID: 03000200-0400-0500-0006-000700080009&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we&#039;re going to rename &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;dmidecode&amp;lt;/span&amp;gt; as &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;dmidecode.orig&amp;lt;/span&amp;gt;, then download the wrapper script.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
mv /usr/sbin/dmidecode /usr/sbin/dmidecode.orig&lt;br /&gt;
wget -c https://alteeve.com/files/dmidecode -O /usr/sbin/dmidecode&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
--2011-12-28 13:44:27--  https://alteeve.com/files/dmidecode&lt;br /&gt;
Resolving alteeve.com... 192.139.81.121&lt;br /&gt;
Connecting to alteeve.com|192.139.81.121|:443... connected.&lt;br /&gt;
HTTP request sent, awaiting response... 200 OK&lt;br /&gt;
Length: 1159 (1.1K) [text/plain]&lt;br /&gt;
Saving to: “/usr/sbin/dmidecode”&lt;br /&gt;
&lt;br /&gt;
100%[======================================&amp;gt;] 1,159       --.-K/s   in 0s      &lt;br /&gt;
&lt;br /&gt;
2011-12-28 13:44:28 (15.3 MB/s) - “/usr/sbin/dmidecode” saved [1159/1159]&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;
chmod 755 /usr/sbin/dmidecode&lt;br /&gt;
ls -lah /usr/sbin/dmidecode&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
-rwxr-xr-x 1 root root 1.2K Dec 28 13:26 /usr/sbin/dmidecode&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now re-run the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;dmidecode&amp;lt;/span&amp;gt; call and see that the new UUID is used.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
dmidecode -q -t 0,1,4,17 | grep UUID&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
	UUID: 31873b9e-1069-42ce-b950-137ae5eaa3d1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This matches what was set in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/libvirt/libvirtd.conf&amp;lt;/span&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
grep host_uuid /etc/libvirt/libvirtd.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;
host_uuid = &amp;quot;31873b9e-1069-42ce-b950-137ae5eaa3d1&amp;quot;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now restart &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;libvirtd&amp;lt;/span&amp;gt; and check &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virsh sysinfo&amp;lt;/span&amp;gt; to confirm that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;libvirtd&amp;lt;/span&amp;gt; now returns the proper UUID.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/libvirtd restart&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Stopping libvirtd daemon:                                  [  OK  ]&lt;br /&gt;
Starting libvirtd daemon:                                  [  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;
virsh sysinfo | grep uuid&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;entry name=&#039;uuid&#039;&amp;gt;31873b9e-1069-42ce-b950-137ae5eaa3d1&amp;lt;/entry&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Done!&lt;br /&gt;
&lt;br /&gt;
As soon as &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;libvirtd&amp;lt;/span&amp;gt; is fixed, this section will be re-written.&lt;br /&gt;
&lt;br /&gt;
== [vm] error: Cannot recv data: Host key verification failed.#015: Connection reset by peer ==&lt;br /&gt;
&lt;br /&gt;
This can show up when you try to live migrate a VM but your &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/root/.ssh/known_hosts&amp;lt;/span&amp;gt; file has not been populated. Effectively, the cluster was prompted to accept the finger-print of the target node, was unable to answer and so then closed the connection.&lt;br /&gt;
&lt;br /&gt;
The syslog entry will look something like this;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Dec 27 21:58:00 an-node02 rgmanager[2439]: Migrating vm:vm0003-db to an-node01.alteeve.com&lt;br /&gt;
Dec 27 21:58:01 an-node02 rgmanager[18951]: [vm] Migrate vm0003-db to an-node01.alteeve.com failed:&lt;br /&gt;
Dec 27 21:58:01 an-node02 rgmanager[18973]: [vm] error: Cannot recv data: Host key verification failed.#015: Connection reset by peer&lt;br /&gt;
Dec 27 21:58:01 an-node02 rgmanager[2439]: migrate on vm &amp;quot;vm0003-db&amp;quot; returned 150 (unspecified)&lt;br /&gt;
Dec 27 21:58:01 an-node02 rgmanager[2439]: Migration of vm:vm0003-db to an-node01.alteeve.com failed; return code 150&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To fix the problem, please return to [[2-Node_Red_Hat_KVM_Cluster_Tutorial#Populating_And_Pushing_.7E.2F.ssh.2Fknown_hosts|Populating And Pushing ~/ssh/known_hosts]].&lt;br /&gt;
&lt;br /&gt;
== error: unknown OS type hvm ==&lt;br /&gt;
&lt;br /&gt;
This can be caused by hardware virtualization support being disabled in your [[BIOS]].&lt;br /&gt;
&lt;br /&gt;
To check whether you have hardware virtualization support enabled, run;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
egrep &#039;(vmx|svm)&#039; --color=always /proc/cpuinfo&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On [[Intel]] machines, you should see this;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
flags		: ... vmx ...&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On [[AMD]] machines, you should see this;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
flags		: ... svm ...&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The above will have the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xvm&amp;lt;/span&amp;gt; or &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;svm&amp;lt;/span&amp;gt; highlighted and the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;flags&amp;lt;/span&amp;gt; line will be quite long. You will also see an entry for every CPU core (or hyperthreaded pseudo-core).&lt;br /&gt;
&lt;br /&gt;
If you don&#039;t see a match to either &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xvm&amp;lt;/span&amp;gt; or &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;svm&amp;lt;/span&amp;gt;, please consult your motherboard&#039;s manual for information on enabling hardware virtualization.&lt;br /&gt;
&lt;br /&gt;
== My VM Just Vanished! ==&lt;br /&gt;
&lt;br /&gt;
{{warning|1=If &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virsh&amp;lt;/span&amp;gt; tries to start a virtual machine but a referenced device or media is missing, it will react by completely undefining the virtual machine!}}&lt;br /&gt;
&lt;br /&gt;
If you ever suddenly find that a virtual machine has vanished, it is probably because something the VM wanted to use couldn&#039;t be found. This can be as trivial as deleting an ISO that a VM had been defined to mount on boot. &lt;br /&gt;
&lt;br /&gt;
Let&#039;s look at the example where an ISO was deleted, as this is a common issue.&lt;br /&gt;
&lt;br /&gt;
Copy your last backup of the XML definition file for the effected VM and then edit it to remove the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;&amp;lt;source file=&#039;...&#039;/&amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/span&amp;gt; lines for the removed media. For example, change:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;disk type=&#039;file&#039; device=&#039;floppy&#039;&amp;gt;&lt;br /&gt;
      &amp;lt;driver name=&#039;qemu&#039; type=&#039;raw&#039; cache=&#039;none&#039; io=&#039;threads&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;source file=&#039;/shared/files/virtio-win-1.1.16.vfd&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;target dev=&#039;fda&#039; bus=&#039;fdc&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;alias name=&#039;fdc0-0-0&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;address type=&#039;drive&#039; controller=&#039;0&#039; bus=&#039;0&#039; unit=&#039;0&#039;/&amp;gt;&lt;br /&gt;
    &amp;lt;/disk&amp;gt;&lt;br /&gt;
    &amp;lt;disk type=&#039;file&#039; device=&#039;cdrom&#039;&amp;gt;&lt;br /&gt;
      &amp;lt;driver name=&#039;qemu&#039; type=&#039;raw&#039; io=&#039;threads&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;source file=&#039;/shared/files/Windows_Server_2008_R2_64Bit_SP1.iso&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;target dev=&#039;hdc&#039; bus=&#039;ide&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;readonly/&amp;gt;&lt;br /&gt;
      &amp;lt;alias name=&#039;ide0-1-0&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;address type=&#039;drive&#039; controller=&#039;0&#039; bus=&#039;1&#039; unit=&#039;0&#039;/&amp;gt;&lt;br /&gt;
    &amp;lt;/disk&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;disk type=&#039;file&#039; device=&#039;floppy&#039;&amp;gt;&lt;br /&gt;
      &amp;lt;driver name=&#039;qemu&#039; type=&#039;raw&#039; cache=&#039;none&#039; io=&#039;threads&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;target dev=&#039;fda&#039; bus=&#039;fdc&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;alias name=&#039;fdc0-0-0&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;address type=&#039;drive&#039; controller=&#039;0&#039; bus=&#039;0&#039; unit=&#039;0&#039;/&amp;gt;&lt;br /&gt;
    &amp;lt;/disk&amp;gt;&lt;br /&gt;
    &amp;lt;disk type=&#039;file&#039; device=&#039;cdrom&#039;&amp;gt;&lt;br /&gt;
      &amp;lt;driver name=&#039;qemu&#039; type=&#039;raw&#039; io=&#039;threads&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;target dev=&#039;hdc&#039; bus=&#039;ide&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;readonly/&amp;gt;&lt;br /&gt;
      &amp;lt;alias name=&#039;ide0-1-0&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;address type=&#039;drive&#039; controller=&#039;0&#039; bus=&#039;1&#039; unit=&#039;0&#039;/&amp;gt;&lt;br /&gt;
    &amp;lt;/disk&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then redefine the VM and you can safely restart it again.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
virsh define /shared/definitions/vm0002-ms.xml&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You should be back in business at this point.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{footer}}&lt;/div&gt;</summary>
		<author><name>RoyK</name></author>
	</entry>
	<entry>
		<id>https://alteeve.com/w/index.php?title=2-Node_Red_Hat_KVM_Cluster_Tutorial_-_Archive&amp;diff=4367</id>
		<title>2-Node Red Hat KVM Cluster Tutorial - Archive</title>
		<link rel="alternate" type="text/html" href="https://alteeve.com/w/index.php?title=2-Node_Red_Hat_KVM_Cluster_Tutorial_-_Archive&amp;diff=4367"/>
		<updated>2012-07-19T17:41:04Z</updated>

		<summary type="html">&lt;p&gt;RoyK: /* Give Nodes More Time To Start */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{howto_header}}&lt;br /&gt;
&lt;br /&gt;
{{note|1=This is the second edition of the original [[Red Hat Cluster Service 2 Tutorial]]. This version is updated to use the Red Hat Cluster Suite, Stable version 3. It replaces [[Xen]] in favour of [[KVM]] to stay in-line with [[Red Hat]]&#039;s supported configuration. It also uses [[corosync]], replacing [[openais]], as the core cluster communication stack.}}&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 [[KVM]] virtual machines using [[RHCS]] &amp;quot;stable 3&amp;quot; with [[DRBD]] and clustered [[LVM]] for synchronizing storage data. This is an updated version of the earlier [[Red Hat Cluster Service 2 Tutorial]] Tutorial. You will find much in common with that tutorial if you&#039;ve previously followed that document. Please don&#039;t skip large sections though. There are some differences that are subtle but important.&lt;br /&gt;
&lt;br /&gt;
Grab a coffee, 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 its complexities.&lt;br /&gt;
&lt;br /&gt;
== Technologies We Will Use ==&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;Red Hat Enterprise Linux 6&#039;&#039; ([[EL6]]); You can use  a derivative like [[CentOS]] v6.&lt;br /&gt;
* &#039;&#039;Red Hat Cluster Services&#039;&#039; &amp;quot;Stable&amp;quot; version 3. This describes the following core components:&lt;br /&gt;
** &#039;&#039;Corosync&#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;Clustered 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 [[KVM]] 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;KVM&#039;&#039;; [[Hypervisor]] that controls and supports virtual machines.&lt;br /&gt;
&lt;br /&gt;
== A Note on Hardware ==&lt;br /&gt;
&lt;br /&gt;
In this tutorial, I will make reference to specific hardware components and devices. I do this to share what devices and equipment I use, but I do not endorse any of the products named in this tutorial. I am in no way affiliated with any hardware vendor not do I receive any compensation or gifts from any company.&lt;br /&gt;
&lt;br /&gt;
== A Note on Patience ==&lt;br /&gt;
&lt;br /&gt;
When someone wants to become a pilot, they can&#039;t jump in a plane and try to take off. It&#039;s not that flying is inherently hard, but it requires a foundation of understanding. Clustering is the same in this regard; there are many different pieces that have to work together just to get off the ground. &lt;br /&gt;
&lt;br /&gt;
You &#039;&#039;&#039;must&#039;&#039;&#039; have patience.&lt;br /&gt;
&lt;br /&gt;
Like a pilot on their first flight, seeing a cluster come to life is a fantastic experience. Don&#039;t rush it! Do your homework and you&#039;ll be on your way before you know it.&lt;br /&gt;
&lt;br /&gt;
Coming back to earth:&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 analogue 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]] [[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 its 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. Browse 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 &#039;&#039;&#039;won&#039;t happen&#039;&#039;&#039;. If you rush, you will skip important points and &#039;&#039;&#039;you will fail&#039;&#039;&#039;. &lt;br /&gt;
&lt;br /&gt;
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 [[KVM]]-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 its 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 [[RHEL]] version 6.2, [[x86_64]] architecture. The KVM hypervisor will not run on [[i686]]. No testing was done on other [[EL6]] derivatives. That said, there is no reason to believe that this tutorial will not apply to any variant of EL6. As much as possible, the language will be distro-agnostic.&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;Fabimer Principle&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;corosync&amp;lt;/span&amp;gt;, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;dlm&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 many more smaller apps.&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;clvmd&amp;lt;/span&amp;gt;, &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;KVM&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 across &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;6&amp;lt;/span&amp;gt; interfaces bonded into pairs.&lt;br /&gt;
** The network infrastructure (Switches, routers, etc). We will be using two managed switches, adding 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*2))+2&amp;lt;/span&amp;gt;, the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;+2&amp;lt;/span&amp;gt; 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 proficient. 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))+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;
Clustering isn&#039;t like most applications or technologies. Most of us learn by taking something such as a configuration file, and tweaking it 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;
The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt; portion of the the cluster is the &#039;&#039;&#039;c&#039;&#039;&#039;luster &#039;&#039;&#039;man&#039;&#039;&#039;ager. In the 3.0 series used in [[EL6]], &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt; acts mainly as a [[quorum]] provider. That is, is adds up the votes from the cluster members and decides if there is a simple majority. If there is, the cluster is &amp;quot;quorate&amp;quot; and is allowed to provide cluster services. Newer versions of the Red Hat Cluster Suite found in [[Fedora]] will use a new quorum provider and &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;
Until it is removed, the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt; service will be used to start and stop all of the daemons needed to make the cluster operate.&lt;br /&gt;
&lt;br /&gt;
== Component; corosync ==&lt;br /&gt;
&lt;br /&gt;
Corosync is the heart of the cluster. Almost all other cluster compnents operate though this.&lt;br /&gt;
&lt;br /&gt;
In Red Hat clusters, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;corosync&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. It can be configured directly in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;corosync.conf&amp;lt;/span&amp;gt;, but given that we will be building an RHCS cluster, 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;corosync.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;
Corosync sends messages using [[multicast]] messaging by default. Recently, [[unicast]] support has been added, but due to network latency, it is only recommended for use with small clusters of two to four nodes. We will be using [[multicast]] in this tutorial.&lt;br /&gt;
&lt;br /&gt;
=== A Little History ===&lt;br /&gt;
&lt;br /&gt;
There were significant changes between [[RHCS]] the old version 2 and version 3 available on [[EL6]], which we are using.&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 provided &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 totem, cluster membership, messaging, and basic APIs for use by clustered applications, while the OpenAIS project became an optional add-on to corosync for users who want the full AIS API.&lt;br /&gt;
&lt;br /&gt;
You will see a lot of references to OpenAIS while searching the web for information on clustering. Understanding its 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 clustered services 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 is 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, when a cluster splits into two or more partitions, which ever group of machines has quorum can safely start clustered services knowing that no other lost nodes will try to do the same.&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 has been confirmed successful, the partition with quorum will begin accessing clustered resources, like shared filesystems.&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 its 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;
Many cluster operations, like 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;corosync&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 between members are ordered. Delivery, however, is not guaranteed. If a member misses messages, it is up to the member&#039;s application to decide what action to take.&lt;br /&gt;
&lt;br /&gt;
Let&#039;s look at two scenarios showing how locks are handled using CPG;&lt;br /&gt;
&lt;br /&gt;
* The cluster starts up cleanly with two members.&lt;br /&gt;
* Both members are able to start &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;service:foo&amp;lt;/span&amp;gt;.&lt;br /&gt;
* Both want to start it, but need a lock from [[DLM]] to do so.&lt;br /&gt;
** The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt; member has its totem token, and sends its request for the lock.&lt;br /&gt;
** DLM issues a lock for that service to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;.&lt;br /&gt;
** The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt; member requests a lock for the same service.&lt;br /&gt;
** DLM rejects the lock request.&lt;br /&gt;
* The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt; member successfully starts &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;service:foo&amp;lt;/span&amp;gt; and announces this to the CPG members.&lt;br /&gt;
* The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt; sees that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;service:foo&amp;lt;/span&amp;gt; is now running on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt; and no longer tries to start the service.&lt;br /&gt;
&lt;br /&gt;
* The two members want to write to a common area of the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/shared&amp;lt;/span&amp;gt; GFS2 partition.&lt;br /&gt;
** The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt; sends a request for a DLM lock against the FS, gets it.&lt;br /&gt;
** The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt; sends a request for the same lock, but DLM sees that a lock is pending and rejects the request.&lt;br /&gt;
** The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt; member finishes altering the file system, announces the changed over CPG and releases the lock.&lt;br /&gt;
** The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt; member updates its view of the filesystem, requests a lock, receives it and proceeds to update the filesystems.&lt;br /&gt;
** It completes the changes, annouces the changes over CPG and releases the lock.&lt;br /&gt;
&lt;br /&gt;
Messages can only be sent to the members of the CPG while the node has a totem tokem from corosync.&lt;br /&gt;
&lt;br /&gt;
== Concept; Fencing ==&lt;br /&gt;
&lt;br /&gt;
{{warning|1=DO NOT BUILD A CLUSTER WITHOUT PROPER, WORKING AND TESTED 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;
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 [[DLM]] locks are allowed to be issued. Anything using DLM, including &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&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;, are effectively hung. The hung node is detected using a totem token timeout. That is, if a token is not received from a node within a period of time, it is considered lost and a new token is sent. After a certain number of lost tokens, the cluster declares the node dead. The remaining nodes reconfigure into a new cluster and, if they have quorum (or if quorum is ignored), a fence call against the silent node is made.&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 totem token moves around the cluster members. As each member gets the token, it sends sequenced messages to the CPG members.&lt;br /&gt;
* The token is passed from one node to the next, in order and continuously during normal operation.&lt;br /&gt;
* Suddenly, one node stops responding.&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 and a replacement token is created.&lt;br /&gt;
** The silent node responds before the failure counter reaches the limit.&lt;br /&gt;
*** The failure 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 token 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;corosync&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;
**** The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fenced&amp;lt;/span&amp;gt; daemon notifies [[DLM]] and locks are blocked.&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 effectively 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, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fenced&amp;lt;/span&amp;gt; notifies DLM and lost locks are recovered.&lt;br /&gt;
**** [[GFS2]] partitions recover using their journal.&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, minus the lost node.&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 remain hung until a human can intervene.&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;corosync&amp;lt;/span&amp;gt;. A token is passed around all the nodes in the cluster, and nodes can only send messages while they have the token. A node will keep its messages in memory until it gets the token back with no &amp;quot;not ack&amp;quot; messages. This way, if a node missed a message, it can request it be resent when it gets its token. If a node isn&#039;t up, it will simply miss the messages.&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;. The RRP is being re-introduced in RHCS version 3. Its use is experimental and should only be used with plenty of testing.&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;corosync&amp;lt;/span&amp;gt; tells the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; that it needs to recheck its services. 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;
The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; daemon runs separately from the cluster manager, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt;. This means that, to fully start the cluster, we need to start both &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt; and then &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt;.&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 Cluster 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 traditional [[SAN]] 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 cluster&#039;s storage. &lt;br /&gt;
&lt;br /&gt;
This shows;&lt;br /&gt;
* Each node having four physical disks tied together in a [[RAID_level_5#Level_5|RAID Level 5]] array and presented to the Node&#039;s OS as a single drive which is found at &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/sda&amp;lt;/span&amp;gt;.&lt;br /&gt;
* Each node&#039;s OS uses three primary partitions for &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/boot&amp;lt;/span&amp;gt;, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;swap&amp;gt;&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/&amp;lt;/span&amp;gt;.&lt;br /&gt;
* Three extended partitions are created;&lt;br /&gt;
** &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/sda5&amp;lt;/span&amp;gt; backs a small partition used as a [[GFS2]]-formatted shared mount point.&lt;br /&gt;
** &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/sda6&amp;lt;/span&amp;gt; backs the [[VM]]s designed to run primarily on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&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; backs the [[VM]]s designed to run primarily on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt;.&lt;br /&gt;
* All three extended partitions are combined using DRBD to create three DRBD resources;&lt;br /&gt;
** &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/drbd0&amp;lt;/span&amp;gt; is backed by &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/drbd1&amp;lt;/span&amp;gt; is backed by &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/drbd2&amp;lt;/span&amp;gt; is backed by &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/sda7&amp;lt;/span&amp;gt;.&lt;br /&gt;
* All three DRBD resources are managed by clustered LVM.&lt;br /&gt;
* The GFS2-formatted [[LV]] is mounted on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/shared&amp;lt;/span&amp;gt; on both nodes.&lt;br /&gt;
* Each [[VM]] gets its own [[LV]].&lt;br /&gt;
* All three DRBD resources sync over the [[Storage Network]], which uses the bonded &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;bond1&amp;lt;/span&amp;gt; (backed be &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;eth4&amp;lt;/span&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
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;
 _________________________________________________                 _________________________________________________ &lt;br /&gt;
| [ an-node01 ]                                   |               |                                   [ an-node02 ] |&lt;br /&gt;
|  ________       __________                      |               |                      __________       ________  |&lt;br /&gt;
| [_disk_1_]--+--[_/dev/sda_]                     |               |                     [_/dev/sda_]--+--[_disk_1_] |&lt;br /&gt;
|  ________   |    |   ___________    _______     |               |     _______    ___________   |    |   ________  |&lt;br /&gt;
| [_disk_2_]--+    +--[_/dev/sda1_]--[_/boot_]    |               |    [_/boot_]--[_/dev/sda1_]--+    +--[_disk_2_] |&lt;br /&gt;
|  ________   |    |   ___________    ________    |               |    ________    ___________   |    |   ________  |&lt;br /&gt;
| [_disk_3_]--+    +--[_/dev/sda2_]--[_&amp;lt;swap&amp;gt;_]   |               |   [_&amp;lt;swap&amp;gt;_]--[_/dev/sda2_]--+    +--[_disk_3_] |&lt;br /&gt;
|  ________   |    |   ___________    ___         |               |         ___    ___________   |    |   ________  |&lt;br /&gt;
| [_disk_4_]--/    +--[_/dev/sda3_]--[_/_]        |               |        [_/_]--[_/dev/sda3_]--+    \--[_disk_4_] |&lt;br /&gt;
|                  |   ___________                |               |                ___________   |                  |&lt;br /&gt;
|                  +--[_/dev/sda5_]------------\  |               |  /------------[_/dev/sda5_]--+                  |&lt;br /&gt;
|                  |   ___________             |  |               |  |             ___________   |                  |&lt;br /&gt;
|                  +--[_/dev/sda6_]----------\ |  |               |  | /----------[_/dev/sda6_]--+                  |&lt;br /&gt;
|                  |   ___________           | |  |               |  | |           ___________   |                  |&lt;br /&gt;
|                  \--[_/dev/sda7_]--------\ | |  |               |  | | /--------[_/dev/sda7_]--/                  |&lt;br /&gt;
|        _______________    ____________   | | |  |               |  | | |   ____________    _______________        |&lt;br /&gt;
|    /--[_Clustered_LVM_]--[_/dev/drbd2_]--/ | |  |               |  | | \--[_/dev/drbd2_]--[_Clustered_LVM_]--\    |&lt;br /&gt;
|   _|__                     |   _______     | |  |               |  | |      |   _______                    __|_   |&lt;br /&gt;
|  [_PV_]                    \--{_bond1_}    | |  |               |  | |      \--{_bond1_}                  [_PV_]  |&lt;br /&gt;
|   _|________                               | |  |               |  | |                               ________|_   |&lt;br /&gt;
|  [_an02-vg0_]                              | |  |               |  | |                              [_an02-vg0_]  |&lt;br /&gt;
|    |   ________________________    ....... | |  |               |  | |  _____     ________________________   |    |&lt;br /&gt;
|    +--[_/dev/an02-vg0/vm0003_1_]---:.vm3.: | |  |               |  | | [_vm3_]---[_/dev/an02-vg0/vm0003_1_]--+    |&lt;br /&gt;
|    |   ________________________    ....... | |  |               |  | |  _____     ________________________   |    |&lt;br /&gt;
|    \--[_/dev/an02-vg0/vm0004_1_]---:.vm4.: | |  |               |  | | [_vm4_]---[_/dev/an02-vg0/vm0004_1_]--/    |&lt;br /&gt;
|          _______________    ____________   | |  |               |  | |   ____________    _______________          |&lt;br /&gt;
|      /--[_Clustered_LVM_]--[_/dev/drbd1_]--/ |  |               |  | \--[_/dev/drbd1_]--[_Clustered_LVM_]--\      |&lt;br /&gt;
|     _|__                     |   _______     |  |               |  |      |   _______                    __|_     |&lt;br /&gt;
|    [_PV_]                    \--{_bond1_}    |  |               |  |      \--{_bond1_}                  [_PV_]    |&lt;br /&gt;
|     _|________                               |  |               |  |                               ________|_     |&lt;br /&gt;
|    [_an01-vg0_]                              |  |               |  |                              [_an01-vg0_]    |&lt;br /&gt;
|      |   ________________________     _____  |  |               |  | .......    ________________________   |      |&lt;br /&gt;
|      +--[_/dev/an01-vg0/vm0001_1_]---[_vm1_] |  |               |  | :.vm1.:---[_/dev/an02-vg0/vm0001_1_]--+      |&lt;br /&gt;
|      |   ________________________     _____  |  |               |  | .......    ________________________   |      |&lt;br /&gt;
|      \--[_/dev/an01-vg0/vm0002_1_]---[_vm2_] |  |               |  | :.vm2.:---[_/dev/an02-vg0/vm0002_1_]--/      |&lt;br /&gt;
|            _______________    ____________   |  |               |  |   ____________    _______________            |&lt;br /&gt;
|        /--[_Clustered_LVM_]--[_/dev/drbd0_]--/  |               |  \--[_/dev/drbd0_]--[_Clustered_LVM_]--\        |&lt;br /&gt;
|       _|__                     |   _______      |               |       |   _______                    __|_       |&lt;br /&gt;
|      [_PV_]                    \--{_bond1_}     |               |       \--{_bond1_}                  [_PV_]      |&lt;br /&gt;
|       _|__________                              |               |                              __________|_       |&lt;br /&gt;
|      [_shared-vg0_]                             |               |                             [_shared-vg0_]      |&lt;br /&gt;
|       _|_________________________               |               |               _________________________|_       |&lt;br /&gt;
|      [_/dev/shared-vg0/lv_shared_]              |               |              [_/dev/shared-vg0/lv_shared_]      |&lt;br /&gt;
|        |   ______    _________                  |               |                  _________    ______   |        |&lt;br /&gt;
|        \--[_GFS2_]--[_/shared_]                 |               |                 [_/shared_]--[_GFS2_]--/        |&lt;br /&gt;
|                                          _______|   _________   |_______                                          |&lt;br /&gt;
|                                         | bond1 =--| Storage |--= bond1 |                                         |&lt;br /&gt;
|                                         |______||  | Network |  ||______|                                         |&lt;br /&gt;
|_________________________________________________|  |_________|  |_________________________________________________|&lt;br /&gt;
.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Component; Clustered LVM ==&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;corosync&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 [[KVM]]&#039;s virtual machine guests 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 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 [[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;
{{note|1=GFS2 is &#039;&#039;&#039;only&#039;&#039;&#039; supported when run on top of Clustered LVM [[LV]]s. This is because, in certain error states, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;gfs2_controld&amp;lt;/span&amp;gt; will call &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;dmsetup&amp;lt;/span&amp;gt; to disconnect the GFS2 partition from its storage in certain failure states.}}&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]] for clustered storage and resource management.&lt;br /&gt;
&lt;br /&gt;
Whenever a resource, GFS2 filesystem or clustered LVM LV needs a lock, it sends a request to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;dlm_controld&amp;lt;/span&amp;gt; which runs in userspace. This communicates with DLM in kernel. If the lockspace does not yet exist, DLM will create it and then give the lock to the requester. Should a subsequant lock request come in for the same lockspace, it will be rejected. Once the application using the lock is finished with it, it will release the lock. After this, another node may request and receive a lock for the lockspace.&lt;br /&gt;
&lt;br /&gt;
If a node fails, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fenced&amp;lt;/span&amp;gt; will alert &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;dlm_controld&amp;lt;/span&amp;gt; that a fence is pending and new lock requests will block. After a successful fence, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fenced&amp;lt;/span&amp;gt; will alert DLM that the node is gone and any locks the victim node held are released. At this time, other nodes may request a lock on the lockspaces the lost node held and can perform recovery, like replaying a GFS2 filesystem journal, prior to resuming normal operation.&lt;br /&gt;
&lt;br /&gt;
Note that DLM locks are not used for actually locking the file system. That job is still handled by &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;plock()&amp;lt;/span&amp;gt; calls ([[POSIX]] locks).&lt;br /&gt;
&lt;br /&gt;
== Component; KVM ==&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 KVM [[hypervisor]] within which our highly-available virtual machine guests will reside. It is a type-1 hypervisor, which means that the host operating system runs directly on the bare hardware. Contrasted against Xen, which is a type-2 hypervisor where even the installed OS is itself just another virtual machine.&lt;br /&gt;
&lt;br /&gt;
= Node Installation =&lt;br /&gt;
&lt;br /&gt;
This section is going to be intentionally vague, as I don&#039;t want to influence too heavily what hardware you buy or how you install your operating systems. However, we need a baseline, a minimum system requirement of sorts. Also, I will refer fairly frequently to my setup, so I will share with you the details of what I bought. Please don&#039;t take this as an endorsement though... Every cluster will have its own needs, and you should plan and purchase for your particular needs.&lt;br /&gt;
&lt;br /&gt;
In my case, my goal was to have a low-power consumption setup and I knew that I would never put my cluster into production as it&#039;s strictly a research and design cluster. As such, I can afford to be quite modest.&lt;br /&gt;
&lt;br /&gt;
== Minimum Requirements ==&lt;br /&gt;
&lt;br /&gt;
This will cover two sections;&lt;br /&gt;
&lt;br /&gt;
* Node Minimum requirements&lt;br /&gt;
* Infrastructure requirements&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;nodes&#039;&#039;&#039; are the two separate servers that will, together, form the base of our cluster. The infrastructure covers the networking and the switched power bars called a &#039;&#039;&#039;[[PDU]]s&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
=== Node Requirements ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;General&#039;&#039;;&lt;br /&gt;
&lt;br /&gt;
As these nodes will host virtual machines, then will need sufficient [[RAM]] and provide [http://en.wikipedia.org/wiki/AMD-V#AMD_virtualization_.28AMD-V.29 virtualization-enabled] [[CPU]]s. Most, though not all, modern processors support hardware virtualization extensions. Finally, you need to have sufficient network bandwidth across two independent links to support the maximum burst storage traffic plus enough headroom to ensure that cluster traffic is never interrupted.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Network&#039;&#039;;&lt;br /&gt;
&lt;br /&gt;
This tutorial will use three independent networks, each using two physical interfaces in a bonded configuration. These will route through two separate managed switches for high-availability networking. Each network will be dedicated to a given traffic type. This requires six interfaces and, with a separate [[IPMI]] interface, consumes a staggering seven ports per node. &lt;br /&gt;
&lt;br /&gt;
Understanding that this may not be feasible, you can drop this to just two connections in a single bonded interface. If you decide to do this, you will need to configure [[QoS]] to ensure that [[totem]] [[multicast]] traffic gets highest priority as a delay of less than one second can cause the cluster to break. You also need to test sustained, heavy disk traffic to ensure that it doesn&#039;t cause problems. In particular, run storage tests from a virtual machine and then live-migrate that machine to create a &amp;quot;worst case&amp;quot; network load. If that succeeds, you are probably safe. All of this is outside of this tutorial&#039;s scope though.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Power&#039;&#039;;&lt;br /&gt;
&lt;br /&gt;
In production, you will want to use servers which have redundant power supplies and ensure that either side of the power connects to two separate power sources.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Out-of-Band Management&#039;&#039;;&lt;br /&gt;
&lt;br /&gt;
As we will discuss later, the ideal method of fencing a node is to use [[IPMI]] or one of the vendor-specific variants like HP&#039;s [[iLO]], Dell&#039;s [[DRAC]] or IBM&#039;s [[RSA]]. This allows another node in the cluster to force the host node to power off, regardless of the state of the operating system. Critically, it can confirm to the caller once the node has been shut down, which allows for the cluster to safely and confidently recover lost services.&lt;br /&gt;
&lt;br /&gt;
The two nodes used to create this tutorial have the following hardware (again, these will never see production use, so I could afford to go low);&lt;br /&gt;
* 1x Tyan [http://www.tyan.com/product_SKU_spec.aspx?ProductType=MB&amp;amp;pid=698&amp;amp;SKU=600000217 S5510GM3NR] Mainboard (note that the &#039;-LE&#039; has no IPMI)&lt;br /&gt;
* 1x Intel [http://ark.intel.com/products/52269?wapkw=%28E3-1220%29 Xeon E3-1220] CPU&lt;br /&gt;
* 2x Kingston [http://www.ec.kingston.com/ecom/configurator_new/partsinfo.asp?root=&amp;amp;LinkBack=&amp;amp;ktcpartno=KVR1333D3E9S/4GHB KVR1333D3E9S/4GHB] DDR3 ECC DIMMs&lt;br /&gt;
* 3x Intel [http://www.intel.com/products/desktop/adapters/gigabit-ct/gigabit-ct-overview.htm Gigabit CT] PCIe Ethernet adapters&lt;br /&gt;
&lt;br /&gt;
=== Infrastructure Requirements ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Network&#039;&#039;;&lt;br /&gt;
&lt;br /&gt;
You will need two separate switches in order to provide High Availability. These do not need to be stacked or even managed, but you do need to consider their actual capabilities and disregard the stated capacity. What I mean by this, in essence, is that not all gigabit equipment is equal. You will need to calculate how much bandwidth (in raw data throughput and as packets-per-second) and confirm that the switch can sustain that load. Most switches will rate these two values as their switching fabric capacity, so be sure to look closely at the specifications.&lt;br /&gt;
&lt;br /&gt;
Another thing to consider is whether you wish to run at an [[MTU]] higher that 1500 [[bytes]] per packet. This is generally referred to in specification sheets as &amp;quot;jumbo frame&amp;quot; support. However, many lesser companies will advertise support for jumbo frames, but they only support up to 4 [[KiB]]. Most professional networks looking to implement large MTU sizes aim for 9 [[KiB]] frame sizes, so be sure to look at the actual size of the largest supported jumbo frame before purchasing network equipment.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Power&#039;&#039;;&lt;br /&gt;
&lt;br /&gt;
As we will discuss later, we need a backup fence device. This will be implemented using a specific brand and model of switched power distribution unit, called a [[PDU]] which is effectively a power bar whose outlets can be independently turned on and off over the network. This tutorial uses an [ APC AP7900] PDU, but many others are available. Should you choose to use another make or model, you &#039;&#039;&#039;must&#039;&#039;&#039; first ensure that it has a supported [http://git.fedorahosted.org/git/?p=fence-agents.git;a=tree;f=fence/agents;hb=HEAD fence agent]. Ensuring this is an exercise for the reader.&lt;br /&gt;
&lt;br /&gt;
In production environments, it is ideal to have each PDU backed by its own [[UPS]], and each UPS connected to a separate mains electrical circuit. This way, the failure of a given PDU, UPS or mains circuit will not cause an interruption to the cluster. Do be sure to plan your power infrastructure to supply enough power to drive the entire cluster at full load in a failed state. That is, more plainly, don&#039;t divide the total load in two when planning your infrastructure. You must always plan for a failed state!&lt;br /&gt;
&lt;br /&gt;
Hardware used in this tutorial are;&lt;br /&gt;
* 2x D-Link [http://dlink.ca/products/?pid=DGS-3100-24 DGS-3100-24] 24-port Gbit switches supporting 10 [[KiB]] jumbo frames.&lt;br /&gt;
* 1x APC [http://www.apc.com/products/resource/include/techspec_index.cfm?base_sku=AP7900 AP7900] switched PDU (supported by the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[http://git.fedorahosted.org/git/?p=fence-agents.git;a=tree;f=fence/agents/apc_snmp;hb=HEAD fence_apc_snmp]&amp;lt;/span&amp;gt; fence agent).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Two Notes&#039;&#039;;&lt;br /&gt;
&lt;br /&gt;
# The D-Link switch I use is being phased out and is being replaced by the [http://dlink.ca/products/?pid=DGS-3120-24TC DGS-3120-24TC] models. The DGS-3120 models are much improved over the DGS-3100 series and can be safely used in stacked configuration (thus enabling the use of [[VLAN]] [[LAG]]s). The DGS-3100 would interrupt traffic when a switch in the stack recovered, which would partition the cluster. This forced me to unstack the switches in this tutorial.&lt;br /&gt;
# Given my budget, I could not afford to purchase redundant power supplies for use in this tutorial. As such, my test cluster has the power as a single point of failure. For learning, this is fine, but it is strongly ill-advised in production. I do show an example configuration of redundant [[PSU]] use spread across separate PDUs from a production cluster.&lt;br /&gt;
&lt;br /&gt;
== Pre-Installation Planning ==&lt;br /&gt;
&lt;br /&gt;
Before you assemble your servers, it is highly advised to first record the [[MAC]] addresses of the NICs. I always write a little file called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;node&amp;gt;-nics.txt&amp;lt;/span&amp;gt; matched to the device name I plan to set it to.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim ~/an-node01-nics.txt&lt;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	00:E0:81:C7:EC:49	# Back-Channel Network - Link 1&lt;br /&gt;
eth1	00:E0:81:C7:EC:48	# Storage Network - Link 1&lt;br /&gt;
eth2	00:E0:81:C7:EC:47	# Internet-Facing Network - Link 1&lt;br /&gt;
eth3	00:1B:21:9D:59:FC	# Back-Channel Network - Link 2&lt;br /&gt;
eth4	00:1B:21:BF:70:02	# Storage Network - Link 2&lt;br /&gt;
eth5	00:1B:21:BF:6F:FE	# Back-Channel Network - Link 2&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
How, or even if you record this is entirely up to you.&lt;br /&gt;
&lt;br /&gt;
== OS Installation ==&lt;br /&gt;
&lt;br /&gt;
{{warning|1=[[EL6]].1 shipped with a version of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[corosync]]&amp;lt;/span&amp;gt; that had a token retransmit bug. On slower systems, there would be a form of race condition which would cause &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[totem]]&amp;lt;/span&amp;gt; tokens the be retransmitted and cause significant performance problems. This has been resolved in [[EL6]].2 so please be sure to upgrade.}}&lt;br /&gt;
&lt;br /&gt;
Beyond being based on [[RHEL]] 6, there are no requirements for how the operating system is installed. This tutorial is written using &amp;quot;minimal&amp;quot; installs, and as such, installation instructions will be provided that will install all needed packages if they aren&#039;t already installed on your nodes.&lt;br /&gt;
&lt;br /&gt;
A few notes about the installation used for this tutorial;&lt;br /&gt;
* [[RHCS]] stable 3 supports &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[selinux]]&amp;lt;/span&amp;gt;, but it is disabled in this tutorial.&lt;br /&gt;
* Both &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; firewalls are disabled.&lt;br /&gt;
&lt;br /&gt;
Obviously, this significantly reduces the security of your nodes. For learning, which is the goal here, this helps keep a focus on the clustering and simplifies debugging when things go wrong. In production clusters though, these steps are ill advised. It is strongly suggested that you enable first the firewall, then when that is working, enabling &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;selinux&amp;lt;/span&amp;gt;. Leaving &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;selinux&amp;lt;/span&amp;gt; for last is intentional, as it generally takes the most work to get right.&lt;br /&gt;
&lt;br /&gt;
=== Network Security ===&lt;br /&gt;
&lt;br /&gt;
When building production clusters, you will want to consider two options with regard to network security.&lt;br /&gt;
&lt;br /&gt;
First, the interfaces connected to an untrusted network, like the Internet, should not have an IP address, though the interfaces themselves will need to be up so that virtual machines can route through them to the outside world. Alternatively, anything inbound from the virtual machines or inbound from the untrusted network should be &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;DROP&amp;lt;/span&amp;gt;ed by the firewall.&lt;br /&gt;
&lt;br /&gt;
Second, if you can not run the cluster communications or storage traffic on dedicated network connections over isolated subnets, you will need to configure the firewall to block everything except the ports needed by storage and cluster traffic. The default ports are below.&lt;br /&gt;
&lt;br /&gt;
* [http://docs.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/6/html-single/Cluster_Administration/index.html#s1-iptables_firewall-CA RHEL 6 Cluster Configuration, Firewall Setup]&lt;br /&gt;
* [http://docs.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/6/html-single/Cluster_Administration/index.html#s1-iptables_firewall-CA Linbit&#039;s DRBD, Firewall Configuration]&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
!Component&lt;br /&gt;
!Protocol&lt;br /&gt;
!Port&lt;br /&gt;
!Note&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[dlm]]&amp;lt;/span&amp;gt;&lt;br /&gt;
|[[TCP]]&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;21064&amp;lt;/span&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[drbd]]&amp;lt;/span&amp;gt;&lt;br /&gt;
|[[TCP]]&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;7788&amp;lt;/span&amp;gt;+&lt;br /&gt;
|Each [[DRBD]] resource will use an additional port, generally counting up (ie: &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;r0&amp;lt;/span&amp;gt; will use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;7788&amp;lt;/span&amp;gt;, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;r1&amp;lt;/span&amp;gt; will use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;7789&amp;lt;/span&amp;gt;, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;r2&amp;lt;/span&amp;gt; will use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;7790&amp;lt;/span&amp;gt; and so on).&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[luci]]&amp;lt;/span&amp;gt;&lt;br /&gt;
|[[TCP]]&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;8084&amp;lt;/span&amp;gt;&lt;br /&gt;
|Optional web-based configuration tool, not used in this tutorial.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[modclusterd]]&amp;lt;/span&amp;gt;&lt;br /&gt;
|[[TCP]]&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;16851&amp;lt;/span&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[ricci]]&amp;lt;/span&amp;gt;&lt;br /&gt;
|[[TCP]]&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;11111&amp;lt;/span&amp;gt;&lt;br /&gt;
|Each [[DRBD]] resource will use an additional port, generally counting up (ie: &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;r1&amp;lt;/span&amp;gt; will use &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;r2&amp;lt;/span&amp;gt; will use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;7791&amp;lt;/span&amp;gt; and so on).&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[totem]]&amp;lt;/span&amp;gt;&lt;br /&gt;
|[[UDP]]/[[multicast]]&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;
|Uses a multicast group for cluster communications&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{{note|1=As of [[EL6]].2, you can now use [[unicast]] for totem communication instead of multicast. This is &#039;&#039;&#039;not&#039;&#039;&#039; advised, and should only be used for clusters of two or three nodes on networks where unresolvable [[multicast]] issues exist. If using [[gfs2]], as we do here, using unicast for totem is strongly discouraged.}}&lt;br /&gt;
&lt;br /&gt;
As mentioned above, we will disable &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;selinux&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;iptables&amp;lt;/span&amp;gt;. This is to simplify the learning process and both should be enable pre-production.&lt;br /&gt;
&lt;br /&gt;
To disable the firewall (not that I disable both &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;
&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;
To disable &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;selinux&amp;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/selinux/config /etc/selinux/config.orig&lt;br /&gt;
vim /etc/selinux/config&lt;br /&gt;
diff -u /etc/selinux/config.orig /etc/selinux/config&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/selinux/config.orig	2012-06-15 18:13:12.416646749 -0400&lt;br /&gt;
+++ /etc/selinux/config	2012-06-15 18:09:46.920938956 -0400&lt;br /&gt;
@@ -4,7 +4,7 @@&lt;br /&gt;
 #     enforcing - SELinux security policy is enforced.&lt;br /&gt;
 #     permissive - SELinux prints warnings instead of enforcing.&lt;br /&gt;
 #     disabled - No SELinux policy is loaded.&lt;br /&gt;
-SELINUX=enforcing&lt;br /&gt;
+SELINUX=disabled&lt;br /&gt;
 # SELINUXTYPE= can take one of these two values:&lt;br /&gt;
 #     targeted - Targeted processes are protected,&lt;br /&gt;
 #     mls - Multi Level Security protection.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You &#039;&#039;&#039;must&#039;&#039;&#039; reboot for the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;selinux&amp;lt;/span&amp;gt; changes to take effect.&lt;br /&gt;
&lt;br /&gt;
= Network =&lt;br /&gt;
&lt;br /&gt;
Before we begin, let&#039;s take a look at a block diagram of what we&#039;re going to build. This will help when trying to see what we&#039;ll be talking about.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
                                                           ______________                                                         &lt;br /&gt;
                                                          [___Internet___]                                                        &lt;br /&gt;
  _____________________________________________________          |          _____________________________________________________ &lt;br /&gt;
 | [ an-node01 ]                                       |         |         |                                       [ an-node02 ] |&lt;br /&gt;
 |                       ____________    ______________|     ____|____     |______________    ____________                       |&lt;br /&gt;
 |                      |    vbr2    |--| bond2        |    | [ IFN ] |    |        bond2 |--|   vbr2     |                      |&lt;br /&gt;
 |  _________________   | 10.255.0.1 |  | ______       |   _|_________|_   |       ______ |  | 10.255.0.2 |  ................... |&lt;br /&gt;
 | | [ vm0001-dev ]  |  |____________|  || eth2 =--\   |  |   Switch 1  |  |   /--= eth2 ||  |____________|  :  [ vm0001-dev ] : |&lt;br /&gt;
 | | [ Dev Server ]  |    | | : :       ||_____|    \--=--|_____________|--=--/    |_____||       | | : :    :  [ Dev Server ] : |&lt;br /&gt;
 | |           ______|    | | : :       | ______    /--=--|   Switch 2  |--=--\    ______ |       | | : :    :.......          : |&lt;br /&gt;
 | |          | eth0 =----/ | : :       || eth5 =--/   |  |_____________|  |   \--= eth5 ||       | | : :----= eth0 :          : |&lt;br /&gt;
 | |          |_____||      | : :       ||_____|       |                   |       |_____||       | | :      ::.....:          : |&lt;br /&gt;
 | |      10.254.0.1 |      | : :       |______________|                   |______________|       | | :      :                 : |&lt;br /&gt;
 | |_________________|      | : :        ______________|                   |______________        | | :      :.................: |&lt;br /&gt;
 |                          | : :       | bond1        |     _________     |        bond1 |       | | :                          |&lt;br /&gt;
 |  _________________       | : :       |   10.10.0.1  |    | [ SN  ] |    | 10.10.0.2    |       | | :      ................... |&lt;br /&gt;
 | | [ vm0002-web ]  |      | : :       | ______       |   _|_________|_   |       ______ |       | | :      :  [ vm0002-web ] : |&lt;br /&gt;
 | | [ Web Server ]  |      | : :       || eth1 =--\   |  |   Switch 1  |  |   /--= eth1 ||       | | :      :  [ Web Server ] : |&lt;br /&gt;
 | |           ______|      | : :       ||_____|    \--=--|_____________|--=--/    |_____||       | | :      :.......          : |&lt;br /&gt;
 | |          | eth0 =------/ : :       | ______    /--=--|   Switch 2  |--=--\    ______ |       | | :------= eth0 :          : |&lt;br /&gt;
 | |          |_____||        : :       || eth4 =--/   |  |_____________|  |   \--= eth4 ||       | |        ::.....:          : |&lt;br /&gt;
 | |      10.254.0.2 |        : :       ||_____|       |                   |       |_____||       | |        :                 : |&lt;br /&gt;
 | |_________________|        : :       |______________|                   |______________|       | |        :.................: |&lt;br /&gt;
 |                            : :        ______________|                   |______________        | |                            |&lt;br /&gt;
 | ...................        : :       | bond0        |     _________     |        bond0 |       | |         _________________  |&lt;br /&gt;
 | : [ vm0003-db  ]  :        : :       |   10.20.0.1  |    | [ BCN ] |    | 10.20.0.2    |       | |        |  [ vm0003-db  ] | |&lt;br /&gt;
 | : [ DB Server  ]  :        : :       | ______       |   _|_________|_   |       ______ |       | |        |  [ DB Server  ] | |&lt;br /&gt;
 | :          .......:        : :       || eth0 =--\   |  |   Switch 1  |  |   /--= eth0 ||       | |        |______           | |&lt;br /&gt;
 | :          : eth0 =--------: :       ||_____|    \--=--|_____________|--=--/    |_____||       | \--------= eth0 |          | |&lt;br /&gt;
 | :          :.....::          :       | ______    /--=--|   Switch 2  |--=--\    ______ |       |          ||_____|          | |&lt;br /&gt;
 | :                 :          :       || eth3 =--/   |  |_____________|  |   \--= eth3 ||       |          | 10.254.0.3      | |&lt;br /&gt;
 | :.................:          :       ||_____|       |    | |     | |    |       |_____||       |          |_________________| |&lt;br /&gt;
 |                              :       |______________|    | |     | |    |______________|       |                              |&lt;br /&gt;
 | ...................          :                      |    | |     | |    |                      |           _________________  |&lt;br /&gt;
 | : [ vm0004-win ]  :          :                      |    | |     | |    |                      |          |  [ vm0004-win ] | |&lt;br /&gt;
 | : [ MS Server  ]  :          :                      |    | |     | |    |                      |          |  [ MS Server  ] | |&lt;br /&gt;
 | :          .......:          :                      |    | |     | |    |                      |          |______           | |&lt;br /&gt;
 | :          : NIC0 =----------:                      |    | |     | |    |                      \----------= NIC0 |          | |&lt;br /&gt;
 | :          :.....::                           ______|    | |     | |    |______                           ||_____|          | |&lt;br /&gt;
 | :                 :                  _____   | IPMI =----/ |     | \----= IPMI |   _____                  | 10.254.0.4      | |&lt;br /&gt;
 | :.................:                 [_BMC_]--|_____||      |     |      ||_____|--[_BMC_]                 |_________________| |&lt;br /&gt;
 |_____________________________________________________|      |     |      |_____________________________________________________|&lt;br /&gt;
                                       || ||               ___|_   _|___               || ||                                      &lt;br /&gt;
                                       || ||              | PDU | | PDU |              || ||                                      &lt;br /&gt;
                                       || ||              |  1  | |  2  |              || ||                                      &lt;br /&gt;
                                       || ||              |_____| |_____|              || ||                                      &lt;br /&gt;
                                       || ||               || ||   || ||               || ||                                      &lt;br /&gt;
                                       || \\==[ Power 1 ]==// ||   || \\==[ Power 1 ]==// ||                                      &lt;br /&gt;
                                       \\=====[ Power 2 ]=====||===//                     ||                                      &lt;br /&gt;
                                                              \\==========[ Power 2 ]=====//                                      &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The cluster will use three separate Class B networks;&lt;br /&gt;
&lt;br /&gt;
{{note|1=There are situations where it is not possible to add additional network cards, blades being a prime example. In these cases it will be up to the admin to decide how to proceed. If there is sufficient bandwidth, you can merge all networks, but it is advised in such cases to isolate IFN traffic from the SN/BCN traffic using [[VLAN]]s.}}&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Purpose&lt;br /&gt;
!Subnet&lt;br /&gt;
!Notes&lt;br /&gt;
|-&lt;br /&gt;
|Internet-Facing Network ([[IFN]])&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;10.255.0.0/16&amp;lt;/span&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
* Each node will use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;10.255.0.x&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 node ID.&amp;lt;br /&amp;gt;&lt;br /&gt;
* Virtual Machines in the cluster that need to be connected to the Internet will use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;192.168.1.0/24&amp;lt;/span&amp;gt;. These IPs are intentionally separate from the two nodes&#039; IFN bridge&#039;s IPs. If you are particularly concerned about security, you can drop the bridges&#039; IPs once the cluster is build and add a firewall rule to reject all traffic from the VMs. &lt;br /&gt;
|-&lt;br /&gt;
|Storage Network ([[SN]])&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;10.10.0.0/16&amp;lt;/span&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
* Each node will use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;10.10.0.x&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 node ID.&lt;br /&gt;
|-&lt;br /&gt;
|Back-Channel Network ([[BCN]])&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;10.20.0.0/16&amp;lt;/span&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
* Each node will use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;10.20.0.x&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 node ID.&amp;lt;br /&amp;gt;&lt;br /&gt;
* Node-specific [[IPMI]] or other out-of-band management devices will use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;10.20.1.x&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 node ID.&amp;lt;br /&amp;gt;&lt;br /&gt;
* Multi-port fence devices, switches and similar will use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;10.20.2.z&amp;lt;/span&amp;gt; where &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;z&amp;lt;/span&amp;gt; is a simple sequence.&amp;lt;br /&amp;gt;&lt;br /&gt;
Miscellaneous equipment in the cluster, like managed switches, will use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;10.20.3.z&amp;lt;/span&amp;gt; where &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;z&amp;lt;/span&amp;gt; is a simple sequence.&amp;lt;br /&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;Optional&#039;&#039; OpenVPN Network&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;10.30.0.0/16&amp;lt;/span&amp;gt;&lt;br /&gt;
|* For clients behind firewalls, I like to create a [[OpenVPN Server on EL6|VPN]] server for the cluster nodes to log into when support is needed. This way, the client retains control over when remote access is available simply by starting and stopping the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;openvpn&amp;lt;/span&amp;gt; daemon. This will not be discussed any further in this tutorial.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
We will be using six interfaces, bonded into three pairs of two NICs in Active/Passive (mode 1) configuration. Each link of each bond will be on alternate, unstacked switches. This configuration is the only configuration supported by [[Red Hat]] in clusters. We will also configure affinity by specifying interfaces &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth0&amp;lt;/span&amp;gt;, &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; as primary for the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;bond0&amp;lt;/span&amp;gt;, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;bond1&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;bond2&amp;lt;/span&amp;gt; interfaces, respectively. This way, when everything is working fine, all traffic is routed through the same switch for maximum performance.&lt;br /&gt;
&lt;br /&gt;
{{note|1=Only the bonded interface used by corosync must be in Active/Passive configuration (&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;bond0&amp;lt;/span&amp;gt; in this tutorial). If you want to experiment with other bonding modes for &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;bond1&amp;lt;/span&amp;gt; or &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;bond2&amp;lt;/span&amp;gt;, please feel free to do so. That is outside the scope of this tutorial, however.}}&lt;br /&gt;
&lt;br /&gt;
If you can not install six interfaces in your server, then four interfaces will do with the [[SN]] and [[BCN]] networks merged.&lt;br /&gt;
&lt;br /&gt;
{{warning|1=If you wish to merge the [[SN]] and [[BCN]] onto one interface, test to ensure that the storage traffic will not block cluster communication. Test by forming your cluster and then pushing your storage to maximum read and write performance for an extended period of time (minimum of several seconds). If the cluster partitions, you will need to do some advanced quality-of-service or other network configuration to ensure reliable delivery of cluster network traffic.}}&lt;br /&gt;
&lt;br /&gt;
In this tutorial, we will use two [http://dlink.ca/products/?pid=DGS-3120-24TC D-Link DGS-3120-24TC/SI], stacked, using three [[VLAN]]s to isolate the three networks.&lt;br /&gt;
* [[BCN]] will have VLAN ID of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt;, which is the default VLAN.&lt;br /&gt;
* [[SN]] will have VLAN ID number 100.&lt;br /&gt;
* [[IFN]] will have VLAN ID number 101.&lt;br /&gt;
&lt;br /&gt;
{{note|Switch configuration [[D-Link_Notes|details]].}}&lt;br /&gt;
&lt;br /&gt;
The actual mapping of interfaces to bonds to networks will be:&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Subnet&lt;br /&gt;
!Cable Colour&lt;br /&gt;
![[VLAN]] ID&lt;br /&gt;
!Link 1&lt;br /&gt;
!Link 2&lt;br /&gt;
!Bond&lt;br /&gt;
!IP&lt;br /&gt;
|-&lt;br /&gt;
|[[BCN]]&lt;br /&gt;
|Blue&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt;&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;eth3&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;bond0&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;10.20.0.x&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|[[SN]]&lt;br /&gt;
|Green&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;100&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth1&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth4&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;bond1&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;10.10.0.x&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|[[IFN]]&lt;br /&gt;
|Black&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;101&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth2&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth5&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;bond2&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;10.255.0.x&amp;lt;/span&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Setting Up the Network ==&lt;br /&gt;
&lt;br /&gt;
{{warning|1=The following steps can easily get confusing, given how many files we need to edit. Losing access to your server&#039;s network is a very real possibility! &#039;&#039;&#039;Do not continue without direct access to your servers!&#039;&#039;&#039; If you have out-of-band access via [[iKVM]], console redirection or similar, be sure to test that it is working before proceeding.}}&lt;br /&gt;
&lt;br /&gt;
=== Planning The Use of Physical Interfaces ===&lt;br /&gt;
&lt;br /&gt;
In production clusters, I generally intentionally get three separate dual-port controllers (two on-board interfaces plus two separate dual-port PCIe cards). I then ensure that no bond uses two interfaces on the same physical board. Thus, should a card or its bus interface fail, none of the bonds will fail completely.&lt;br /&gt;
&lt;br /&gt;
Lets take a look at an example layout;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
 ____________________                            &lt;br /&gt;
| [ an-node01 ]      |                           &lt;br /&gt;
|         ___________|      _______              &lt;br /&gt;
|        |     ______|     | bond0 |             &lt;br /&gt;
|        | O  | eth0 =-----=---.---=------------{&lt;br /&gt;
|        | n  |_____||  /--=--/    |             &lt;br /&gt;
|        | b         |  |  |_______|  _______    &lt;br /&gt;
|        | o   ______|  |            | bond1 |   &lt;br /&gt;
|        | a  | eth1 =--|------------=---.---=--{&lt;br /&gt;
|        | r  |_____||  |  /---------=--/    |   &lt;br /&gt;
|        | d         |  |  |         |_______|   &lt;br /&gt;
|        |___________|  |  |                     &lt;br /&gt;
|         ___________|  |  |      _______        &lt;br /&gt;
|        |     ______|  |  |     | bond2 |       &lt;br /&gt;
|        | P  | eth2 =--|--|-----=---.---=------{&lt;br /&gt;
|        | C  |_____||  |  |  /--=--/    |       &lt;br /&gt;
|        | I         |  |  |  |  |_______|       &lt;br /&gt;
|        | e   ______|  |  |  |                  &lt;br /&gt;
|        |    | eth3 =--/  |  |                  &lt;br /&gt;
|        | 1  |_____||     |  |                  &lt;br /&gt;
|        |___________|     |  |                  &lt;br /&gt;
|         ___________|     |  |                  &lt;br /&gt;
|        |     ______|     |  |                  &lt;br /&gt;
|        | P  | eth4 =-----/  |                  &lt;br /&gt;
|        | C  |_____||        |                  &lt;br /&gt;
|        | I         |        |                  &lt;br /&gt;
|        | e   ______|        |                  &lt;br /&gt;
|        |    | eth5 =--------/                  &lt;br /&gt;
|        | 2  |_____||                           &lt;br /&gt;
|        |___________|                           &lt;br /&gt;
|____________________|                           &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Consider the possible failure scenarios;&lt;br /&gt;
* The on-board controllers fail;&lt;br /&gt;
** &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;bond0&amp;lt;/span&amp;gt; falls back onto &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth3&amp;lt;/span&amp;gt; on the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;PCIe 1&amp;lt;/span&amp;gt; controller.&lt;br /&gt;
** &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;bond1&amp;lt;/span&amp;gt; falls back onto &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth4&amp;lt;/span&amp;gt; on the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;PCIe 2&amp;lt;/span&amp;gt; controller.&lt;br /&gt;
** &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;bond2&amp;lt;/span&amp;gt; is unaffected.&lt;br /&gt;
* The PCIe #1 controller fails&lt;br /&gt;
** &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;bond0&amp;lt;/span&amp;gt; remains on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth0&amp;lt;/span&amp;gt; interface but losses its redundancy as &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth3&amp;lt;/span&amp;gt; is down.&lt;br /&gt;
** &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;bond1&amp;lt;/span&amp;gt; is unaffected.&lt;br /&gt;
** &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;bond2&amp;lt;/span&amp;gt; falls back onto &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth5&amp;lt;/span&amp;gt; on the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;PCIe 2&amp;lt;/span&amp;gt; controller.&lt;br /&gt;
* The PCIe #2 controller fails&lt;br /&gt;
** &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;bond0&amp;lt;/span&amp;gt; is unaffected.&lt;br /&gt;
** &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;bond1&amp;lt;/span&amp;gt; remains on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth1&amp;lt;/span&amp;gt; interface but losses its redundancy as &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth4&amp;lt;/span&amp;gt; is down.&lt;br /&gt;
** &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;bond2&amp;lt;/span&amp;gt; remains on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth2&amp;lt;/span&amp;gt; interface but losses its redundancy as &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth5&amp;lt;/span&amp;gt; is down.&lt;br /&gt;
&lt;br /&gt;
In all three failure scenarios, no network interruption occurs making for the most robust configuration possible.&lt;br /&gt;
&lt;br /&gt;
=== Managed and Stacking Switch Notes ===&lt;br /&gt;
&lt;br /&gt;
{{note|1=If you have two stacked switches, be extra careful to test them to ensure that traffic will not block when a switch is lost or is recovering!}}&lt;br /&gt;
&lt;br /&gt;
There are two things you need to be wary of with managed switches.&lt;br /&gt;
&lt;br /&gt;
* Don&#039;t stack them unless you can confirm that there will be no interruption in traffic flow on the surviving switch when the lost switch disappears or recovers. It may seem like it makes sense to stack them and create Link Aggregation Groups, but this can cause problems. When in doubt, don&#039;t stack the switches.&lt;br /&gt;
* Disable Spanning Tree Protocol on all ports used by the cluster. Otherwise, when a lost switch is recovered, STP negotiation will cause traffic to stop on the ports for upwards of thirty seconds. This is more than enough time to partition a cluster.&lt;br /&gt;
&lt;br /&gt;
If you use three [[VLAN]]s across two unstacked switches, be sure to use a dedicate uplink for each VLAN. You may need to enable [[STP]] of these uplinks to avoid switch loops if the VLANs themselves are not enough. The reason for doing this is to ensure that cluster communications always have a clear path for traffic. If you had only one uplink between the two switches, and you found yourself in a situation where a node&#039;s [[BCN]] and [[SN]] faulted through the backup switch, the storage traffic could saturate the uplink and cause intolerable latency for the BCN traffic, leading to cluster partitioning.&lt;br /&gt;
&lt;br /&gt;
=== Connecting Fence Devices ===&lt;br /&gt;
&lt;br /&gt;
As we will see soon, each node can be fenced either by calling its [[IPMI]] interface or by calling the [[PDU]] and cutting the node&#039;s power. Each of these methods are inherently single points of failure as each has only one network connection. To work around this concern, we will connect all IPMI interfaces to one switch and the PDUs to the secondary switch. This way, should a switch fail, only one of the two fence devices will fail and fencing in general will still be possible via the alternate fence device.&lt;br /&gt;
&lt;br /&gt;
Generally speaking, I like to connect the IPMI interfaces to the primary switch and the PDUs to the backup switch.&lt;br /&gt;
&lt;br /&gt;
=== Making Sure We Know Our Interfaces ===&lt;br /&gt;
&lt;br /&gt;
When you installed the operating system, the network interfaces names are somewhat randomly assigned to the physical network interfaces. It more than likely that you will want to re-order. &lt;br /&gt;
&lt;br /&gt;
Before you start moving interface names around, you will want to consider which physical interfaces you will want to use on which networks. At the end of the day, the names themselves have no meaning. At the very least though, make them consistent across nodes.&lt;br /&gt;
&lt;br /&gt;
Some things to consider, in order of importance:&lt;br /&gt;
&lt;br /&gt;
* If you have a shared interface for your out-of-band management interface, like [[IPMI]] or [[iLO]], you will want that interface to be on the [[Back-Channel Network]].&lt;br /&gt;
* For redundancy, you want to spread out which interfaces are paired up. In my case, I have three interfaces on my mainboard and three additional add-in cards. I will pair each onboard interface with an add-in interface. In my case, my IPMI interface physically piggy-backs on one of the onboard interfaces so this interface will need to be part of the [[BCN]] bond.&lt;br /&gt;
* Your interfaces with the lowest latency should be used for the back-channel network.&lt;br /&gt;
* Your two fastest interfaces should be used for your storage network.&lt;br /&gt;
* The remaining two slowest interfaces should be used for the [[Internet-Facing Network]] bond.&lt;br /&gt;
&lt;br /&gt;
In my case, all six interfaces are identical, so there is little to consider. The left-most interface on my system has IPMI, so its paired network interface will be &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth0&amp;lt;/span&amp;gt;. I simply work my way left, incrementing as I go. What you do will be whatever makes most sense to you.&lt;br /&gt;
&lt;br /&gt;
There is a separate, short tutorial on re-ordering network interface;&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;[[Changing the ethX to Ethernet Device Mapping in EL6 and Fedora 12+]]&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Once you have the physical interfaces named the way you like, proceed to the next step.&lt;br /&gt;
&lt;br /&gt;
=== Planning Our Network ===&lt;br /&gt;
&lt;br /&gt;
To setup our network, we will need to edit the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ifcfg-ethX&amp;lt;/span&amp;gt;, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ifcfg-bondX&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ifcfg-vbr2&amp;lt;/span&amp;gt; scripts. The last one will create a bridge, like a virtual network switch, which will be used to route network connections between the virtual machines and the outside world, via the [[IFN]]. You will note that the bridge will have the [[IP]] addresses, not the bonded interface &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;bond2&amp;lt;/span&amp;gt;. It will instead be slaved to the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vbr2&amp;lt;/span&amp;gt; bridge.&lt;br /&gt;
&lt;br /&gt;
We&#039;re going to be editing a lot of files. It&#039;s best to lay out what we&#039;ll be doing in a chart. So our setup will be:&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
!Node&lt;br /&gt;
!BCN IP and Device&lt;br /&gt;
!SN IP and Device&lt;br /&gt;
!IFN IP and Device&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;10.20.0.1&amp;lt;/span&amp;gt; on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;bond0&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;10.10.0.1&amp;lt;/span&amp;gt; on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;bond1&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;10.255.0.1&amp;lt;/span&amp;gt; on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vbr2&amp;lt;/span&amp;gt; (&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;bond2&amp;lt;/span&amp;gt; slaved)&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;10.20.0.2&amp;lt;/span&amp;gt; on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;bond0&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;10.10.0.2&amp;lt;/span&amp;gt; on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;bond1&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;10.255.0.2&amp;lt;/span&amp;gt; on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vbr2&amp;lt;/span&amp;gt; (&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;bond2&amp;lt;/span&amp;gt; slaved)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Switch Network Daemons ===&lt;br /&gt;
&lt;br /&gt;
The new &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;NetworkManager&amp;lt;/span&amp;gt; daemon is much more flexible and is perfect for machines like laptops which move around networks a lot. However, it does this by making a lot of decisions for you and changing the network as it sees fit. As good as this is for laptops and the like, it&#039;s not appropriate for servers. We will want to use the traditional &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;network&amp;lt;/span&amp;gt; service.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum remove NetworkManager&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now enable &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;network&amp;lt;/span&amp;gt; to start 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;
chkconfig --list network&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;
network        	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;
=== Creating Some Network Configuration Files ===&lt;br /&gt;
&lt;br /&gt;
{{warning|1=Bridge configuration files &#039;&#039;&#039;must&#039;&#039;&#039; have a file name which will sort &#039;&#039;&#039;after&#039;&#039;&#039; the interface and bridge files. The actual device name can be whatever you want though. If the system tries to start a bridge before its slaved interface is up, it will fail. I personally like to use the name &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vbrX&amp;lt;/span&amp;gt; for &amp;quot;&#039;&#039;&#039;v&#039;&#039;&#039;irtual machine &#039;&#039;&#039;br&#039;&#039;&#039;idge&amp;quot;. You can use whatever makes sense to you, with the above concern in mind.}}&lt;br /&gt;
&lt;br /&gt;
Start by &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;touch&amp;lt;/span&amp;gt;ing the configuration files we will need.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
touch /etc/sysconfig/network-scripts/ifcfg-bond{0,1,2}&lt;br /&gt;
touch /etc/sysconfig/network-scripts/ifcfg-vbr2&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now make a backup of your configuration files, in case something goes wrong and you want to start over.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
mkdir /root/backups/&lt;br /&gt;
rsync -av /etc/sysconfig/network-scripts/ifcfg-eth* /root/backups/&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
sending incremental file list&lt;br /&gt;
ifcfg-eth0&lt;br /&gt;
ifcfg-eth1&lt;br /&gt;
ifcfg-eth2&lt;br /&gt;
ifcfg-eth3&lt;br /&gt;
ifcfg-eth4&lt;br /&gt;
ifcfg-eth5&lt;br /&gt;
&lt;br /&gt;
sent 1467 bytes  received 126 bytes  3186.00 bytes/sec&lt;br /&gt;
total size is 1119  speedup is 0.70&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Configuring The Bridge ===&lt;br /&gt;
&lt;br /&gt;
We&#039;ll start in reverse order, crafting the bridge&#039;s script first.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;&#039;&#039;&#039; IFN Bridge:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/sysconfig/network-scripts/ifcfg-vbr2&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;
# Internet-Facing Network - Bridge&lt;br /&gt;
DEVICE=&amp;quot;vbr2&amp;quot;&lt;br /&gt;
TYPE=&amp;quot;Bridge&amp;quot;&lt;br /&gt;
BOOTPROTO=&amp;quot;static&amp;quot;&lt;br /&gt;
IPADDR=&amp;quot;10.255.0.1&amp;quot;&lt;br /&gt;
NETMASK=&amp;quot;255.255.0.0&amp;quot;&lt;br /&gt;
GATEWAY=&amp;quot;10.255.255.254&amp;quot;&lt;br /&gt;
DNS1=&amp;quot;78.46.37.135&amp;quot;&lt;br /&gt;
DNS2=&amp;quot;192.139.81.117&amp;quot;&lt;br /&gt;
DEFROUTE=&amp;quot;yes&amp;quot;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Creating the Bonded Interfaces ===&lt;br /&gt;
&lt;br /&gt;
Next up, we&#039;ll can create the three bonding configuration files. This is where two physical network interfaces are tied together to work like a single, highly available network interface. You can think of a bonded interface as being akin to [[TLUG_Talk:_Storage_Technologies_and_Theory#Level_1|RAID level 1]]; A new virtual device is created out of two real devices.&lt;br /&gt;
&lt;br /&gt;
We&#039;re going to see a long line called &amp;quot;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[http://docs.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/6/html/Deployment_Guide/sec-Using_Channel_Bonding.html BONDING_OPTS]&amp;lt;/span&amp;gt;&amp;quot;. Let&#039;s look at the meaning of these options before we look at the configuration; &lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;mode=1&amp;lt;/span&amp;gt; sets the bonding mode to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;active-backup&amp;lt;/span&amp;gt;. &lt;br /&gt;
* The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;miimon=100&amp;lt;/span&amp;gt; tells the bonding driver to check if the network cable has been unplugged or plugged in every 100 milliseconds. &lt;br /&gt;
* The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;use_carrier=1&amp;lt;/span&amp;gt; tells the driver to use the driver to maintain the link state. Some drivers don&#039;t support that. If you run into trouble, try changing this to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;0&amp;lt;/span&amp;gt;. &lt;br /&gt;
* The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;updelay=120000&amp;lt;/span&amp;gt; tells the driver to delay switching back to the primary interface for 120,000 milliseconds (2 minutes). This is designed to give the switch connected to the primary interface time to finish booting. Setting this too low may cause the bonding driver to switch back before the network switch is ready to actually move data. Some switches will not provide a link until it is fully booted, so please experiment.&lt;br /&gt;
* The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;downdelay=0&amp;lt;/span&amp;gt; tells the driver not to wait before changing the state of an interface when the link goes down. That is, when the driver detects a fault, it will switch to the backup interface immediately.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;&#039;&#039;&#039; BCN Bond:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/sysconfig/network-scripts/ifcfg-bond0&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;
# Back-Channel Network - Bond&lt;br /&gt;
DEVICE=&amp;quot;bond0&amp;quot;&lt;br /&gt;
BOOTPROTO=&amp;quot;static&amp;quot;&lt;br /&gt;
NM_CONTROLLED=&amp;quot;no&amp;quot;&lt;br /&gt;
ONBOOT=&amp;quot;yes&amp;quot;&lt;br /&gt;
BONDING_OPTS=&amp;quot;mode=1 miimon=100 use_carrier=1 updelay=120000 downdelay=0 primary=eth0&amp;quot;&lt;br /&gt;
IPADDR=&amp;quot;10.20.0.1&amp;quot;&lt;br /&gt;
NETMASK=&amp;quot;255.255.0.0&amp;quot;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;&#039;&#039;&#039; SN Bond:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/sysconfig/network-scripts/ifcfg-bond1&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;
# Storage Network - Bond&lt;br /&gt;
DEVICE=&amp;quot;bond1&amp;quot;&lt;br /&gt;
BOOTPROTO=&amp;quot;static&amp;quot;&lt;br /&gt;
NM_CONTROLLED=&amp;quot;no&amp;quot;&lt;br /&gt;
ONBOOT=&amp;quot;yes&amp;quot;&lt;br /&gt;
BONDING_OPTS=&amp;quot;mode=1 miimon=100 use_carrier=1 updelay=120000 downdelay=0 primary=eth1&amp;quot;&lt;br /&gt;
IPADDR=&amp;quot;10.10.0.1&amp;quot;&lt;br /&gt;
NETMASK=&amp;quot;255.255.0.0&amp;quot;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;&#039;&#039;&#039; IFN Bond:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/sysconfig/network-scripts/ifcfg-bond2&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;
# Internet-Facing Network - Bond&lt;br /&gt;
DEVICE=&amp;quot;bond2&amp;quot;&lt;br /&gt;
BRIDGE=&amp;quot;vbr2&amp;quot;&lt;br /&gt;
BOOTPROTO=&amp;quot;none&amp;quot;&lt;br /&gt;
NM_CONTROLLED=&amp;quot;no&amp;quot;&lt;br /&gt;
ONBOOT=&amp;quot;yes&amp;quot;&lt;br /&gt;
BONDING_OPTS=&amp;quot;mode=1 miimon=100 use_carrier=1 updelay=120000 downdelay=0 primary=eth2&amp;quot;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Alter The Interface Configurations ===&lt;br /&gt;
&lt;br /&gt;
With the bridge and bonds in place, we can now alter the interface configurations.&lt;br /&gt;
&lt;br /&gt;
Which two interfaces you use in a given bond is entirely up to you. I&#039;ve found it easiest to keep straight when I match the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;bondX&amp;lt;/span&amp;gt; to the primary interface&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ethX&amp;lt;/span&amp;gt; number.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;&#039;&#039;&#039;&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth0&amp;lt;/span&amp;gt;, the BCN &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;bond0&amp;lt;/span&amp;gt;, Link 1:&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;
# Back-Channel Network - Link 1&lt;br /&gt;
HWADDR=&amp;quot;00:E0:81:C7:EC:49&amp;quot;&lt;br /&gt;
DEVICE=&amp;quot;eth0&amp;quot;&lt;br /&gt;
NM_CONTROLLED=&amp;quot;no&amp;quot;&lt;br /&gt;
ONBOOT=&amp;quot;yes&amp;quot;&lt;br /&gt;
BOOTPROTO=&amp;quot;none&amp;quot;&lt;br /&gt;
MASTER=&amp;quot;bond0&amp;quot;&lt;br /&gt;
SLAVE=&amp;quot;yes&amp;quot;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;&#039;&#039;&#039;&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth1&amp;lt;/span&amp;gt;, the SN &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;bond1&amp;lt;/span&amp;gt;, Link 1:&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;
# Storage Network - Link 1&lt;br /&gt;
HWADDR=&amp;quot;00:E0:81:C7:EC:48&amp;quot;&lt;br /&gt;
DEVICE=&amp;quot;eth1&amp;quot;&lt;br /&gt;
NM_CONTROLLED=&amp;quot;no&amp;quot;&lt;br /&gt;
ONBOOT=&amp;quot;yes&amp;quot;&lt;br /&gt;
BOOTPROTO=&amp;quot;none&amp;quot;&lt;br /&gt;
MASTER=&amp;quot;bond1&amp;quot;&lt;br /&gt;
SLAVE=&amp;quot;yes&amp;quot;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;&#039;&#039;&#039;&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth2&amp;lt;/span&amp;gt;, the IFN &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;bond2&amp;lt;/span&amp;gt;, Link 1:&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;
# Internet-Facing Network - Link 1&lt;br /&gt;
HWADDR=&amp;quot;00:E0:81:C7:EC:47&amp;quot;&lt;br /&gt;
DEVICE=&amp;quot;eth2&amp;quot;&lt;br /&gt;
NM_CONTROLLED=&amp;quot;no&amp;quot;&lt;br /&gt;
ONBOOT=&amp;quot;yes&amp;quot;&lt;br /&gt;
BOOTPROTO=&amp;quot;none&amp;quot;&lt;br /&gt;
MASTER=&amp;quot;bond2&amp;quot;&lt;br /&gt;
SLAVE=&amp;quot;yes&amp;quot;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;&#039;&#039;&#039;&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth3&amp;lt;/span&amp;gt;, the BCN &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;bond0&amp;lt;/span&amp;gt;, Link 2:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/sysconfig/network-scripts/ifcfg-eth3&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;
# Back-Channel Network - Link 2&lt;br /&gt;
HWADDR=&amp;quot;00:1B:21:9D:59:FC&amp;quot;&lt;br /&gt;
DEVICE=&amp;quot;eth3&amp;quot;&lt;br /&gt;
NM_CONTROLLED=&amp;quot;no&amp;quot;&lt;br /&gt;
ONBOOT=&amp;quot;yes&amp;quot;&lt;br /&gt;
BOOTPROTO=&amp;quot;none&amp;quot;&lt;br /&gt;
MASTER=&amp;quot;bond0&amp;quot;&lt;br /&gt;
SLAVE=&amp;quot;yes&amp;quot;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;&#039;&#039;&#039;&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth4&amp;lt;/span&amp;gt;, the SN &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;bond1&amp;lt;/span&amp;gt;, Link 2:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/sysconfig/network-scripts/ifcfg-eth4&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;
# Storage Network - Link 2&lt;br /&gt;
HWADDR=&amp;quot;00:1B:21:BF:70:02&amp;quot;&lt;br /&gt;
DEVICE=&amp;quot;eth4&amp;quot;&lt;br /&gt;
NM_CONTROLLED=&amp;quot;no&amp;quot;&lt;br /&gt;
ONBOOT=&amp;quot;yes&amp;quot;&lt;br /&gt;
BOOTPROTO=&amp;quot;none&amp;quot;&lt;br /&gt;
MASTER=&amp;quot;bond1&amp;quot;&lt;br /&gt;
SLAVE=&amp;quot;yes&amp;quot;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;&#039;&#039;&#039;&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth5&amp;lt;/span&amp;gt;, the IFN &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;bond2&amp;lt;/span&amp;gt;, Link 2:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/sysconfig/network-scripts/ifcfg-eth5&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;
# Internet-Facing Network - Link 2&lt;br /&gt;
HWADDR=&amp;quot;00:1B:21:BF:6F:FE&amp;quot;&lt;br /&gt;
DEVICE=&amp;quot;eth5&amp;quot;&lt;br /&gt;
NM_CONTROLLED=&amp;quot;no&amp;quot;&lt;br /&gt;
ONBOOT=&amp;quot;yes&amp;quot;&lt;br /&gt;
BOOTPROTO=&amp;quot;none&amp;quot;&lt;br /&gt;
MASTER=&amp;quot;bond2&amp;quot;&lt;br /&gt;
SLAVE=&amp;quot;yes&amp;quot;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Loading The New Network Configuration ==&lt;br /&gt;
&lt;br /&gt;
Simple restart the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;network&amp;lt;/span&amp;gt; service.&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;
&lt;br /&gt;
== Updating /etc/hosts ==&lt;br /&gt;
&lt;br /&gt;
On both nodes, update the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/hosts&amp;lt;/span&amp;gt; file to reflect your network configuration. Remember to add entries for your [[IPMI]], switched PDUs and other devices.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/hosts&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4&lt;br /&gt;
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6&lt;br /&gt;
&lt;br /&gt;
# an-node01&lt;br /&gt;
10.20.0.1	an-node01 an-node01.bcn an-node01.alteeve.com&lt;br /&gt;
10.20.1.1	an-node01.ipmi&lt;br /&gt;
10.10.0.1	an-node01.sn&lt;br /&gt;
10.255.0.1	an-node01.ifn&lt;br /&gt;
&lt;br /&gt;
# an-node01&lt;br /&gt;
10.20.0.2	an-node02 an-node02.bcn an-node02.alteeve.com&lt;br /&gt;
10.20.1.2	an-node02.ipmi&lt;br /&gt;
10.10.0.2	an-node02.sn&lt;br /&gt;
10.255.0.2	an-node02.ifn&lt;br /&gt;
&lt;br /&gt;
# Fence devices&lt;br /&gt;
10.20.2.1       pdu1 pdu1.alteeve.com&lt;br /&gt;
10.20.2.2       pdu2 pdu2.alteeve.com&lt;br /&gt;
&lt;br /&gt;
# VPN interfaces, if used.&lt;br /&gt;
10.30.0.1	an-node01.vpn&lt;br /&gt;
10.30.0.2	an-node02.vpn&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{warning|1=Remember, which ever switch you have the IPMI interfaces connected to, be sure to connect the PDU into the &#039;&#039;&#039;opposite&#039;&#039;&#039; switch! If both fence types are on one switch, then that switch becomes a single point of failure!}}&lt;br /&gt;
&lt;br /&gt;
{{note|1=I like to run an [[OpenVPN Server on EL6|OpenVPN]] server and set up my remote clusters and customers as clients on this VPN to enable rapid, secure remote access when the client&#039;s firewall blocks inbound connections. This offers the client the option of disabling the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;openvpn&amp;lt;/span&amp;gt; client daemon until they wish to enable access. This tends to be easier for the client to manage as opposed to manipulating the firewall on demand. This will be the only mention of the VPN in this tutorial, but explains the last entries in the file above.}}&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 its tools, like &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 its 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;
4a:52:a1:c7:60:d5:e8:6d:c4:75:20:dd:62:2b:86:c5 root@an-node01.alteeve.com&lt;br /&gt;
The key&#039;s randomart image is:&lt;br /&gt;
+--[ RSA 2047]----+&lt;br /&gt;
|    o.o=.ooo.    |&lt;br /&gt;
|   . +..E.+..    |&lt;br /&gt;
|    ..+= . o     |&lt;br /&gt;
|     oo = .      |&lt;br /&gt;
|    . .oS.       |&lt;br /&gt;
|     o .         |&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;
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;
If you look closely when you created the ssh key, the node&#039;s fingerprint is show (&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;4a:52:a1:c7:60:d5:e8:6d:c4:75:20:dd:62:2b:86:c5&amp;lt;/span&amp;gt; for &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt; above). Make a note of the fingerprint for each machine, and then compare it to the one presented to you when you ssh to a machine for the first time. If you are presented with a fingerprint that doesn&#039;t match, you could be facing a &amp;quot;man in the middle&amp;quot; attack. &lt;br /&gt;
&lt;br /&gt;
To look up a fingerprint in the future, you can run the following;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ssh-keygen -l -f ~/.ssh/id_rsa&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;
2047 4a:52:a1:c7:60:d5:e8:6d:c4:75:20:dd:62:2b:86:c5 /root/.ssh/id_rsa.pub (RSA)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The two newly generated 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;
MIIEnwIBAAKCAQBs+CsWeKegqmtneZcLDvHV4QT1n+ajj98gkmjoLcIFW5g/VFRL&lt;br /&gt;
pSMMkwkQBgGDkmKPvYFa5OolL6qBQSAN1NpP8zET+1lZr4OFg/TZTuA8QnhNeh6V&lt;br /&gt;
mU2hSoyJfEkKJ6TVYg4s1rsbbTZPLdCDe9CMn/iI824WUu2wA8RwhF2WTqqTrWTW&lt;br /&gt;
4h8tYK9Y4eT4IYMXiYZ8+eQfzHyMaNxvUcI1Z8heMn/CEnrA67ja7Czi/ljYnw0I&lt;br /&gt;
3MXy9d2ANYjYahBLF2+ok19NS9tkFHDlcZTh0gTQ4vV5fksgdJjsWl5l/aLjnSRf&lt;br /&gt;
x2pQrMl3w8U7JBpr0PWJPIuzd4q47+KBI1A9AgEjAoIBADTtkUVtzcMQ8lbUqHMV&lt;br /&gt;
4y1eqqMwaLXYKowp2y7xp2GwJWCWrJnFPOjZs/HXCAy00Ml5TXVKnZ0IhgRENCP5&lt;br /&gt;
q92wos8w8OJrMUDZsXDdKxX0ZlGEdUFZFxPTwJqM0wTuryXQiorOsqbr5y3Fy62T&lt;br /&gt;
6PPYq+q/YVtM2dkmZrpO66DGcTkBA8tq8tTU3TdqZEVfmCzM9DIGz2hprvky+yDU&lt;br /&gt;
Pa296CP7+lHFty34K6j/WxD49+aKrdxXxdLbH/3Wfq7a9fu/FuYObPRtXoYRJNGP&lt;br /&gt;
ZEzfVoNwVdc3vETuzZPDoidkc4jomA4vM4cTS1EvwEWVHfaSdIE0wF16N1FlDgNA&lt;br /&gt;
hKsCgYEA9Xp5vGoPRer3hTSglGrPOTTkGEhXiE/JDMZ7w4fk2lXo+Q7HqxetrS6l&lt;br /&gt;
hMxY+x2W0FBfKwJqBuhVv4Y5MPLbC2JazwYDoP85g6RWH72ebsqdYwYvSx808iDs&lt;br /&gt;
C8HArWv8RtQ/K1pRVkq0GPhTdc22sYE9aKa5Hc6nd0SEmq+hLoUCgYBxo9c3M28h&lt;br /&gt;
jDpxwTkYszMfpIb++tCSrcBw8guqdqjhW6yH9kXva3NjfuzpOisb7cFN6dcSqjaC&lt;br /&gt;
HEZjpBWPUGLOPMnL1/mSsTErusgyh2+x8WjRjuqBJrh7CDN8gejMiski5nALQpxt&lt;br /&gt;
s6PKI5WHVqPQ395+549LQnoaCROyf4TUWQKBgFQp/doy/ewWC7ikVFAkntHI/b8u&lt;br /&gt;
vuzoJ6yb0qlwa7iSe8MbAwaldo8IrcchfZfs40AbjlfjkhD/M1ebu9ZEot9U6+81&lt;br /&gt;
QxKgpgE/qH/pPaJUGLQ8ooAn9OVNHbrjWADx0tZ0p/GbTxZFf5OIVyETVJShVuIN&lt;br /&gt;
RshkHCjkSrixPpObAoGAPbC2qPAJINcYaaNoI1n3Lm9B+CHBrrYYAsyJ/XOdgabL&lt;br /&gt;
X8A0l+nfjciPPMfOQlx+4ScrnGsHpbeT7PKsnkGUuRmvYAeHe4TC69psrbc8om0b&lt;br /&gt;
pPXPwnQbAPXSzo+qQybE9bBLc9O0AQm/UHm3kpy/VCHB7R6ePsxQ6Y/mHxIGR2MC&lt;br /&gt;
gYEAhW7evwpxUMcW+BV84xIIt7cW2K/mu8nOb2qajFTej+WgvHNT+h4vgs4ZrTkH&lt;br /&gt;
rHyUiN/tzTCxBnkoh1w9FmCdnAdr/+br56Zq8oEXzBUUALqeW0xnB0zpTc6Hn0xq&lt;br /&gt;
iU0P5cM1sgyCWv83MgeGegcpxt54K5bqUjPKjaUpLNqbtiA=&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; (single line, but wrapped here 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 AAAAB3NzaC1yc2EAAAABIwAAAQBs+CsWeKegqmtneZcLDvHV4QT1n+ajj98gkmjo&lt;br /&gt;
LcIFW5g/VFRLpSMMkwkQBgGDkmKPvYFa5OolL6qBQSAN1NpP8zET+1lZr4OFg/TZTuA8QnhN&lt;br /&gt;
eh6VmU2hSoyJfEkKJ6TVYg4s1rsbbTZPLdCDe9CMn/iI824WUu2wA8RwhF2WTqqTrWTW4h8t&lt;br /&gt;
YK9Y4eT4IYMXiYZ8+eQfzHyMaNxvUcI1Z8heMn/CEnrA67ja7Czi/ljYnw0I3MXy9d2ANYjY&lt;br /&gt;
ahBLF2+ok19NS9tkFHDlcZTh0gTQ4vV5fksgdJjsWl5l/aLjnSRfx2pQrMl3w8U7JBpr0PWJ&lt;br /&gt;
PIuzd4q47+KBI1A9 root@an-node01.alteeve.com&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{note|1=Generate the key on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt; before proceeding.}}&lt;br /&gt;
&lt;br /&gt;
In order to enable password-less login, we need to create a file called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;~/.ssh/authorized_keys&amp;lt;/span&amp;gt; and put both nodes&#039; public key in it. To seed the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;~/.ssh/authorized_keys&amp;lt;/span&amp;gt; file, we&#039;ll simply copy the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;~/.ssh/id_rsa.pub&amp;lt;/span&amp;gt; file. After that, we will append &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt;&#039;s public key into it over ssh. Once both keys are in it, we&#039;ll push it over to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt;. If you want to add your workstation&#039;s key as well, this is the best time to do so.&lt;br /&gt;
&lt;br /&gt;
From &#039;&#039;&#039;an-node01&#039;&#039;&#039;, type:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
rsync -av ~/.ssh/id_rsa.pub ~/.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;
sending incremental file list&lt;br /&gt;
id_rsa.pub&lt;br /&gt;
&lt;br /&gt;
sent 482 bytes  received 31 bytes  1026.00 bytes/sec&lt;br /&gt;
total size is 404  speedup is 0.79&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we&#039;ll grab the public key from &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt; over SSH and append it to the new &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;authorized_keys&amp;lt;/span&amp;gt; file.&lt;br /&gt;
&lt;br /&gt;
I noted when I created &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt;&#039;s ssh key that its fingerprint was &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;04:08:37:43:6b:5c:a0:b0:f5:27:a7:46:d4:77:a3:34&amp;lt;/span&amp;gt;. This matches the one presented to me in the next step, so I trust that I am talking to the right machine.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ssh root@an-node02 &amp;quot;cat ~/.ssh/id_rsa.pub&amp;quot; &amp;gt;&amp;gt; ~/.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;
The authenticity of host &#039;an-node02 (10.20.0.2)&#039; can&#039;t be established.&lt;br /&gt;
RSA key fingerprint is 04:08:37:43:6b:5c:a0:b0:f5:27:a7:46:d4:77:a3:34.&lt;br /&gt;
Are you sure you want to continue connecting (yes/no)? yes&lt;br /&gt;
Warning: Permanently added &#039;an-node02,10.20.0.2&#039; (RSA) to the list of known hosts.&lt;br /&gt;
root@an-node02&#039;s password: &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{note|1=If you want to add your workstation&#039;s key, do so here.}}&lt;br /&gt;
&lt;br /&gt;
Now push the local copy of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;authorized_keys&amp;lt;/span&amp;gt; with both keys over to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;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 ~/.ssh/authorized_keys root@an-node02:/root/.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;
root@an-node02&#039;s password: &lt;br /&gt;
sending incremental file list&lt;br /&gt;
authorized_keys&lt;br /&gt;
&lt;br /&gt;
sent 1704 bytes  received 31 bytes  694.00 bytes/sec&lt;br /&gt;
total size is 1621  speedup is 0.93&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now log into the remote machine. This time, the connection should succeed without having entered a password!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ssh root@an-node02&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Last login: Sat Dec 10 16:06:21 2011 from 10.20.255.254&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Perfect! Once you can log into both nodes, from either node, without a password you will be finished.&lt;br /&gt;
&lt;br /&gt;
=== Populating And Pushing ~/.ssh/known_hosts ===&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, lets &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ssh&amp;lt;/span&amp;gt; into both nodes using all host names. 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 &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;exit&amp;lt;/span&amp;gt; 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, but it only needs to be done one time for all nodes. 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-node01 &amp;amp;&amp;amp; \&lt;br /&gt;
ssh root@an-node01.alteeve.com &amp;amp;&amp;amp; \&lt;br /&gt;
ssh root@an-node01.bcn &amp;amp;&amp;amp; \&lt;br /&gt;
ssh root@an-node01.sn &amp;amp;&amp;amp; \&lt;br /&gt;
ssh root@an-node01.ifn &amp;amp;&amp;amp; \&lt;br /&gt;
ssh root@an-node02 &amp;amp;&amp;amp; \&lt;br /&gt;
ssh root@an-node02.alteeve.com &amp;amp;&amp;amp; \&lt;br /&gt;
ssh root@an-node02.bcn &amp;amp;&amp;amp; \&lt;br /&gt;
ssh root@an-node02.sn &amp;amp;&amp;amp; \&lt;br /&gt;
ssh root@an-node02.ifn&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;
The authenticity of host &#039;an-node01 (10.20.0.1)&#039; can&#039;t be established.&lt;br /&gt;
RSA key fingerprint is e6:cb:50:41:88:26:c3:a5:aa:85:80:89:02:6f:ae:5e.&lt;br /&gt;
Are you sure you want to continue connecting (yes/no)? 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;
Warning: Permanently added &#039;an-node01,10.20.0.1&#039; (RSA) to the list of known hosts.&lt;br /&gt;
Last login: Sun Dec 11 04:45:50 2011 from 10.20.255.254&lt;br /&gt;
[root@an-node01 ~]# &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;
exit&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
logout&lt;br /&gt;
Connection to an-node01 closed.&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;
The authenticity of host &#039;an-node01.alteeve.com (10.20.0.1)&#039; can&#039;t be established.&lt;br /&gt;
RSA key fingerprint is e6:cb:50:41:88:26:c3:a5:aa:85:80:89:02:6f:ae:5e.&lt;br /&gt;
Are you sure you want to continue connecting (yes/no)? 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;
Warning: Permanently added &#039;an-node01.alteeve.com&#039; (RSA) to the list of known hosts.&lt;br /&gt;
Last login: Sun Dec 11 04:50:24 2011 from an-node01&lt;br /&gt;
[root@an-node01 ~]# &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;
exit&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
logout&lt;br /&gt;
Connection to an-node01.alteeve.com closed.&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;
The authenticity of host &#039;an-node01.bcn (10.20.0.1)&#039; can&#039;t be established.&lt;br /&gt;
RSA key fingerprint is e6:cb:50:41:88:26:c3:a5:aa:85:80:89:02:6f:ae:5e.&lt;br /&gt;
Are you sure you want to continue connecting (yes/no)? 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;
Warning: Permanently added &#039;an-node01.bcn&#039; (RSA) to the list of known hosts.&lt;br /&gt;
Last login: Sun Dec 11 04:51:14 2011 from an-node01&lt;br /&gt;
[root@an-node01 ~]# &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;
exit&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
logout&lt;br /&gt;
Connection to an-node01.bcn closed.&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;
The authenticity of host &#039;an-node01.sn (10.10.0.1)&#039; can&#039;t be established.&lt;br /&gt;
RSA key fingerprint is e6:cb:50:41:88:26:c3:a5:aa:85:80:89:02:6f:ae:5e.&lt;br /&gt;
Are you sure you want to continue connecting (yes/no)? 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;
Warning: Permanently added &#039;an-node01.sn,10.10.0.1&#039; (RSA) to the list of known hosts.&lt;br /&gt;
Last login: Sun Dec 11 04:53:23 2011 from an-node01&lt;br /&gt;
[root@an-node01 ~]# &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;
exit&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
logout&lt;br /&gt;
Connection to an-node01.sn closed.&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;
The authenticity of host &#039;an-node01.ifn (10.255.0.1)&#039; can&#039;t be established.&lt;br /&gt;
RSA key fingerprint is e6:cb:50:41:88:26:c3:a5:aa:85:80:89:02:6f:ae:5e.&lt;br /&gt;
Are you sure you want to continue connecting (yes/no)? 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;
Warning: Permanently added &#039;an-node01.ifn,10.255.0.1&#039; (RSA) to the list of known hosts.&lt;br /&gt;
Last login: Sun Dec 11 04:54:30 2011 from an-node01.sn&lt;br /&gt;
[root@an-node01 ~]# &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;
exit&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
logout&lt;br /&gt;
Connection to an-node01.ifn closed.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is the connection to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt;, which we established earlier when we pushed the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;authorized_keys&amp;lt;/span&amp;gt;, so this time we&#039;re not asked to verify the key.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Last login: Sun Dec 11 05:44:40 2011 from 10.20.255.254&lt;br /&gt;
[root@an-node02 ~]# &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;
exit&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
logout&lt;br /&gt;
Connection to an-node02 closed.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we&#039;ll be asked to verify keys again, as only the base &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt; hostname had been recorded earlier.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
The authenticity of host &#039;an-node02.alteeve.com (10.20.0.2)&#039; can&#039;t be established.&lt;br /&gt;
RSA key fingerprint is 04:08:37:43:6b:5c:a0:b0:f5:27:a7:46:d4:77:a3:34.&lt;br /&gt;
Are you sure you want to continue connecting (yes/no)? 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;
Warning: Permanently added &#039;an-node02.alteeve.com&#039; (RSA) to the list of known hosts.&lt;br /&gt;
Last login: Sun Dec 11 05:54:44 2011 from an-node01&lt;br /&gt;
[root@an-node02 ~]# &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;
exit&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
logout&lt;br /&gt;
Connection to an-node02.alteeve.com closed.&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;
The authenticity of host &#039;an-node02.bcn (10.20.0.2)&#039; can&#039;t be established.&lt;br /&gt;
RSA key fingerprint is 04:08:37:43:6b:5c:a0:b0:f5:27:a7:46:d4:77:a3:34.&lt;br /&gt;
Are you sure you want to continue connecting (yes/no)? 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;
Warning: Permanently added &#039;an-node02.bcn&#039; (RSA) to the list of known hosts.&lt;br /&gt;
Last login: Sun Dec 11 06:05:58 2011 from an-node01&lt;br /&gt;
[root@an-node02 ~]# &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;
exit&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
logout&lt;br /&gt;
Connection to an-node02.bcn closed.&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;
The authenticity of host &#039;an-node02.sn (10.10.0.2)&#039; can&#039;t be established.&lt;br /&gt;
RSA key fingerprint is 04:08:37:43:6b:5c:a0:b0:f5:27:a7:46:d4:77:a3:34.&lt;br /&gt;
Are you sure you want to continue connecting (yes/no)? 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;
Warning: Permanently added &#039;an-node02.sn,10.10.0.2&#039; (RSA) to the list of known hosts.&lt;br /&gt;
Last login: Sun Dec 11 06:07:20 2011 from an-node01&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;
exit&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
logout&lt;br /&gt;
Connection to an-node02.sn closed.&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;
The authenticity of host &#039;an-node02.ifn (10.255.0.2)&#039; can&#039;t be established.&lt;br /&gt;
RSA key fingerprint is 04:08:37:43:6b:5c:a0:b0:f5:27:a7:46:d4:77:a3:34.&lt;br /&gt;
Are you sure you want to continue connecting (yes/no)? 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;
Warning: Permanently added &#039;an-node02.ifn,10.255.0.2&#039; (RSA) to the list of known hosts.&lt;br /&gt;
Last login: Sun Dec 11 06:08:11 2011 from an-node01.sn&lt;br /&gt;
[root@an-node02 ~]# &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;
exit&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
logout&lt;br /&gt;
Connection to an-node02.ifn closed.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Finally done!&lt;br /&gt;
&lt;br /&gt;
Now we 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.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
rsync -av root@an-node01:/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 incremental file list&lt;br /&gt;
&lt;br /&gt;
sent 11 bytes  received 41 bytes  104.00 bytes/sec&lt;br /&gt;
total size is 4413  speedup is 84.87&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we can connect via SSH to either node, from either node, using any of the networks and we will not be prompted to enter a password or to verify SSH fingerprints any more.&lt;br /&gt;
&lt;br /&gt;
= Configuring The Cluster Foundation =&lt;br /&gt;
&lt;br /&gt;
We need to configure the cluster in two stages. This is because we have something of a chicken-and-egg problem.&lt;br /&gt;
&lt;br /&gt;
* We need clustered storage for our virtual machines.&lt;br /&gt;
* Our clustered storage needs the cluster for fencing.&lt;br /&gt;
&lt;br /&gt;
Conveniently, clustering has two logical parts;&lt;br /&gt;
* Cluster communication and membership.&lt;br /&gt;
* Cluster resource management.&lt;br /&gt;
&lt;br /&gt;
The first, communication and membership, covers which nodes are part of the cluster and ejecting faulty nodes from the cluster, among other tasks. The second part, resource management, is provided by a second tool called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt;. It&#039;s this second part that we will set aside for later.&lt;br /&gt;
&lt;br /&gt;
== Installing Required Programs ==&lt;br /&gt;
&lt;br /&gt;
You will need to install the packages below. Under [[CentOS]], [[Scientific Linux]] or other [[RHEL]]-based distros, you can simply run the command below. &lt;br /&gt;
&lt;br /&gt;
For [[Red Hat]] customers though, you will need to enable the &amp;quot;[http://www.redhat.com/rhel/add-ons/resilient_storage.html RHEL Server Resilient Storage]&amp;quot; entitlement. If you are foregoing [[GFS2]] to save money, then you will need to instead enable the &amp;quot;[http://www.redhat.com/rhel/add-ons/high_availability.html RHEL Server High Availability]&amp;quot; entitlement instead. &lt;br /&gt;
&lt;br /&gt;
Once you are ready, run the following command to install what you need. If you opted not to use GFS2, remove &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;gfs2-utils&amp;lt;/span&amp;gt;. The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;gpm&amp;lt;/span&amp;gt; is also optional as it provides mouse facility in the command-line.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install cman corosync rgmanager ricci gfs2-utils ntp libvirt lvm2-cluster \&lt;br /&gt;
            qemu-kvm qemu-kvm-tools virt-install virt-viewer syslinux wget gpm rsync&lt;br /&gt;
&amp;lt;/source&amp;gt;&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 now. 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. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cat /dev/null &amp;gt;/etc/libvirt/qemu/networks/default.xml&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;libvirtd&amp;lt;/span&amp;gt; has started, then you will also need to stop the bridge, delete it 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;
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;
== 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;
== Configuration Methods ==&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 v3 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. We&#039;re going to do this on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt; and, when we&#039;re done, copy it over to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt;.&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_v3_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;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;?xml version=&amp;quot;1.0&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;cluster name=&amp;quot;an-cluster-A&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;
The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cluster&amp;lt;/span&amp;gt; element has two attributes that we need to set;&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;name=&amp;quot;&amp;quot;&amp;lt;/span&amp;gt;&lt;br /&gt;
* &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 v3 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-A&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[RHCS v3 cluster.conf#config_version|config_version]]=&amp;quot;&amp;quot;&amp;lt;/span&amp;gt; attribute is an integer indicating 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 &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt;. 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 setting up a special kind of cluster, called 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_v3_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_v3_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;
In short; this disables quorum.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;cluster name=&amp;quot;an-cluster-A&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 introduces two tags, the later a child tag of the former;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clusternodes&amp;lt;/span&amp;gt;&lt;br /&gt;
** &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clusternode&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The first is the parent &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[RHCS_v3_cluster.conf#clusternodes.3B_Defining_Cluster_Nodes|clusternodes]]&amp;lt;/span&amp;gt; tag, which takes no attributes of its own. Its sole purpose is to contain the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[RHCS_v3_cluster.conf#Tag.3B_clusternode|clusternode]]&amp;lt;/span&amp;gt; child tags, of which there will be one per node. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;cluster name=&amp;quot;an-cluster-A&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-node01.alteeve.com&amp;quot; nodeid=&amp;quot;1&amp;quot; /&amp;gt;&lt;br /&gt;
		&amp;lt;clusternode name=&amp;quot;an-node02.alteeve.com&amp;quot; nodeid=&amp;quot;2&amp;quot; /&amp;gt;&lt;br /&gt;
	&amp;lt;/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_v3_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_v3_cluster.conf#clusternode.27s_name_attribute|name]]=&amp;quot;&amp;quot;&amp;lt;/span&amp;gt; attribute. The value &#039;&#039;&#039;should&#039;&#039;&#039; match the fully qualified domain name, which you can check by running &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;uname -n&amp;lt;/span&amp;gt; on each node. This isn&#039;t strictly required, mind you, but for simplicity&#039;s sake, this is the name we will use.&lt;br /&gt;
&lt;br /&gt;
The cluster decides which network to use for cluster communication by resolving the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;name=&amp;quot;...&amp;quot;&amp;lt;/span&amp;gt; value. It will take the returned [[IP]] address and try to match it to one of the IPs on the system. Once it finds a match, that becomes the network the cluster will use. In our case, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01.alteeve.com&amp;lt;/span&amp;gt; resolves to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;10.20.0.1&amp;lt;/span&amp;gt;, which is used by &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;bond0&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
If you have &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;syslinux&amp;lt;/span&amp;gt; installed, you can check this out yourself using the following command;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ifconfig |grep -B 1 $(gethostip -d $(uname -n)) | grep HWaddr | awk &#039;{ print $1 }&#039;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
bond0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Please see the &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;[[RHCS_v3_cluster.conf#name_3|name]]&amp;lt;/span&amp;gt; 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_v3_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; elements in the cluster. It is what the cluster itself uses to identify the node.&lt;br /&gt;
&lt;br /&gt;
=== Defining Fence Devices ===&lt;br /&gt;
&lt;br /&gt;
[[2-Node_Red_Hat_KVM_Cluster_Tutorial#Concept.3B_Fencing|Fencing]] devices are used to forcible eject a node from a cluster if it stops responding.&lt;br /&gt;
&lt;br /&gt;
This is generally done by forcing it to power off or reboot. Some [[SAN]] switches can logically disconnect a node from the shared storage device, a process called fabric fencing, 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. These are called [[PDU]]s and are effectively power bars where each outlet can be independently switched off over the network.&lt;br /&gt;
&lt;br /&gt;
In this tutorial, our nodes support [[IPMI]], which we will use as the primary fence device. We also have an [http://www.apc.com/products/resource/include/techspec_index.cfm?base_sku=AP7900 APC] brand switched PDU which will act as a backup fence device.&lt;br /&gt;
&lt;br /&gt;
{{note|1=Not all brands of switched PDUs are supported as fence devices. Before you purchase a fence device, confirm that it is supported.}}&lt;br /&gt;
&lt;br /&gt;
All fence devices are contained within the parent &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[RHCS_v3_cluster.conf#fencedevices.3B_Defining_Fence_Devices|fencedevices]]&amp;lt;/span&amp;gt; tag, which has no attributes of its own. Within this parent tag are one or more &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[RHCS_v3_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-cluster-A&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-node01.alteeve.com&amp;quot; nodeid=&amp;quot;1&amp;quot; /&amp;gt;&lt;br /&gt;
                &amp;lt;clusternode name=&amp;quot;an-node02.alteeve.com&amp;quot; nodeid=&amp;quot;2&amp;quot; /&amp;gt;&lt;br /&gt;
        &amp;lt;/clusternodes&amp;gt;&lt;br /&gt;
        &amp;lt;fencedevices&amp;gt;&lt;br /&gt;
                &amp;lt;fencedevice name=&amp;quot;ipmi_an01&amp;quot; agent=&amp;quot;fence_ipmilan&amp;quot; ipaddr=&amp;quot;an-node01.ipmi&amp;quot; login=&amp;quot;root&amp;quot; passwd=&amp;quot;secret&amp;quot; /&amp;gt;&lt;br /&gt;
                &amp;lt;fencedevice name=&amp;quot;ipmi_an02&amp;quot; agent=&amp;quot;fence_ipmilan&amp;quot; ipaddr=&amp;quot;an-node02.ipmi&amp;quot; login=&amp;quot;root&amp;quot; passwd=&amp;quot;secret&amp;quot; /&amp;gt;&lt;br /&gt;
                &amp;lt;fencedevice agent=&amp;quot;fence_apc_snmp&amp;quot; ipaddr=&amp;quot;pdu2.alteeve.com&amp;quot; name=&amp;quot;pdu2&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 its own &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[RHCS_v3_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. On the other hand, fence devices that support multiple nodes, like switched PDUs, will have just one entry. In our case, we&#039;re using both types, so we have three fences devices; The two IPMI BMCs plus the switched PDU.&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_v3_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_v3_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 go-between 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 performs the requested action against the target node. The agent is responsible for ensuring that the execution succeeded and returning an appropriate success or failure exit code. &lt;br /&gt;
&lt;br /&gt;
For those curious, the full details are described in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[https://fedorahosted.org/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 its own subset of attributes. The scope of which is outside this tutorial, though we will see examples for IPMI and a switched PDU. 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_ipmilan&amp;lt;/span&amp;gt; - IPMI fence agent.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;man fence_apc_snmp&amp;lt;/span&amp;gt; - APC-brand switched PDU using [[SNMP]].&lt;br /&gt;
&lt;br /&gt;
The example above is what this tutorial will use. &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_v3_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_v3_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_v3_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;
Here is how we implement [[IPMI]] as the primary fence device with the APC switched PDU as the backup method.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;cluster name=&amp;quot;an-cluster-A&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-node01.alteeve.com&amp;quot; nodeid=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
                        &amp;lt;fence&amp;gt;&lt;br /&gt;
                                &amp;lt;method name=&amp;quot;ipmi&amp;quot;&amp;gt;&lt;br /&gt;
                                        &amp;lt;device name=&amp;quot;ipmi_an01&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;pdu&amp;quot;&amp;gt;&lt;br /&gt;
                                        &amp;lt;device name=&amp;quot;pdu2&amp;quot; port=&amp;quot;1&amp;quot; action=&amp;quot;reboot&amp;quot; /&amp;gt;&lt;br /&gt;
                                &amp;lt;/method&amp;gt;&lt;br /&gt;
                        &amp;lt;/fence&amp;gt;&lt;br /&gt;
                &amp;lt;/clusternode&amp;gt;&lt;br /&gt;
                &amp;lt;clusternode name=&amp;quot;an-node02.alteeve.com&amp;quot; nodeid=&amp;quot;2&amp;quot;&amp;gt;&lt;br /&gt;
                        &amp;lt;fence&amp;gt;&lt;br /&gt;
                                &amp;lt;method name=&amp;quot;ipmi&amp;quot;&amp;gt;&lt;br /&gt;
                                        &amp;lt;device name=&amp;quot;ipmi_an02&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;pdu&amp;quot;&amp;gt;&lt;br /&gt;
                                        &amp;lt;device name=&amp;quot;pdu2&amp;quot; port=&amp;quot;2&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;ipmi_an01&amp;quot; agent=&amp;quot;fence_ipmilan&amp;quot; ipaddr=&amp;quot;an-node01.ipmi&amp;quot; login=&amp;quot;root&amp;quot; passwd=&amp;quot;secret&amp;quot; /&amp;gt;&lt;br /&gt;
                &amp;lt;fencedevice name=&amp;quot;ipmi_an02&amp;quot; agent=&amp;quot;fence_ipmilan&amp;quot; ipaddr=&amp;quot;an-node02.ipmi&amp;quot; login=&amp;quot;root&amp;quot; passwd=&amp;quot;secret&amp;quot; /&amp;gt;&lt;br /&gt;
                &amp;lt;fencedevice agent=&amp;quot;fence_apc_snmp&amp;quot; ipaddr=&amp;quot;pdu2.alteeve.com&amp;quot; name=&amp;quot;pdu2&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;
First, notice that the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[RHCS_v3_cluster.conf#Tag.3B_fence|fence]]&amp;lt;/span&amp;gt; tag has no attributes. It&#039;s merely a parent for the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[RHCS_v3_cluster.conf#Tag.3B_method|method]](s)&amp;lt;/span&amp;gt; child elements.&lt;br /&gt;
&lt;br /&gt;
There are two &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[RHCS_v3_cluster.conf#Tag.3B_method|method]]&amp;lt;/span&amp;gt; elements, one for each fence device, named &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ipmi&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;pdu&amp;lt;/span&amp;gt;. These names are merely descriptive and can be whatever you feel is most appropriate. &lt;br /&gt;
&lt;br /&gt;
Within each &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;method&amp;lt;/span&amp;gt; element is one or more &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[RHCS_v3_cluster.conf#Tag.3B_device|device]]&amp;lt;/span&amp;gt; tags. For a given method to succeed, all defined &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;device&amp;lt;/span&amp;gt; elements must themselves succeed. This is very useful for grouping calls to separate PDUs when dealing with nodes having redundant power supplies, as shown in the [[2-Node_Red_Hat_KVM_Cluster_Tutorial#Example_.3Cfencedevice....3E_Tag_For_APC_Switched_PDUs|PDU example]] above.&lt;br /&gt;
&lt;br /&gt;
The actual fence &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[RHCS_v3_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_v3_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_v3_cluster.conf#device.27s_name_attribute|name]]&amp;lt;/span&amp;gt;, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ipmi_an01&amp;lt;/span&amp;gt; in this example.&lt;br /&gt;
&lt;br /&gt;
Note that the PDU definition needs a &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;port=&amp;quot;&amp;quot;&amp;lt;/span&amp;gt; attribute where the IPMI fence devices do not. These are the sorts of differences you will find, varying depending on how the fence device agent works.&lt;br /&gt;
&lt;br /&gt;
When a fence call is needed, the fence devices will be called in the order they are found here. If both devices fail, the cluster will go back to the start and try again, looping indefinitely until one device succeeds.&lt;br /&gt;
&lt;br /&gt;
{{note|1=It&#039;s important to understand why we use IPMI as the primary fence device. The FenceAgentAPI specification suggests, but does not require, that a fence device confirm that the node is off. IPMI can do this, the switched PDU can not. Thus, IPMI won&#039;t return a success unless the node is truly off. The PDU, however, will return a success once the power is cut to the requested port. The risk is that a misconfigured node with redundant PDU may in fact still be running, leading to disastrous consequences.}}&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-node02&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-node02&amp;lt;/span&amp;gt; is consulted. Within it there are two &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;method&amp;lt;/span&amp;gt; entries, named &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ipmi&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;pdu&amp;lt;/span&amp;gt;. The IPMI method&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;device&amp;lt;/span&amp;gt; has one attribute while the PDU&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;device&amp;lt;/span&amp;gt; has two attributes;&lt;br /&gt;
** &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;port&amp;lt;/span&amp;gt;; only found in the PDU &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;method&amp;lt;/span&amp;gt;, this tells the cluster that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt; is connected to switched PDU&#039;s outlet number &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;2&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;; Found on both devices, 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;ipmi_an02&amp;lt;/span&amp;gt;. This fence device has four 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_ipmilan&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 IPMI BMC. 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;
* Should the IPMI fence call fail for some reason, the cluster will move on to the second &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;pdu&amp;lt;/span&amp;gt; method, repeating the steps above but using the PDU values.&lt;br /&gt;
&lt;br /&gt;
When the cluster calls the fence agent, it does so by initially calling the fence agent script with no arguments.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/usr/sbin/fence_ipmilan&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=an-node02.ipmi&lt;br /&gt;
login=root&lt;br /&gt;
passwd=secret&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 three 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 one is 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-node02&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;
If this method fails, then the PDU will be called in a very similar way, but with an extra argument from the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;device&amp;lt;/span&amp;gt; attributes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/usr/sbin/fence_apc_snmp&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=pdu2.alteeve.com&lt;br /&gt;
port=2&lt;br /&gt;
action=reboot&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Should this fail, the cluster will go back and try the IPMI interface again. It will loop through the fence device methods forever until one of the methods succeeds.&lt;br /&gt;
Below are snippets from other clusters using different fence device configurations which might help you build your cluster.&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.&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;clusternode name=&amp;quot;an-node01.alteeve.com&amp;quot; nodeid=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
			&amp;lt;fence&amp;gt;&lt;br /&gt;
				&amp;lt;method name=&amp;quot;ipmi&amp;quot;&amp;gt;&lt;br /&gt;
					&amp;lt;device name=&amp;quot;ipmi_an01&amp;quot; action=&amp;quot;reboot&amp;quot;/&amp;gt;&lt;br /&gt;
				&amp;lt;/method&amp;gt;&lt;br /&gt;
			&amp;lt;/fence&amp;gt;&lt;br /&gt;
		&amp;lt;/clusternode&amp;gt;&lt;br /&gt;
		&amp;lt;clusternode name=&amp;quot;an-node02.alteeve.com&amp;quot; nodeid=&amp;quot;2&amp;quot;&amp;gt;&lt;br /&gt;
			&amp;lt;fence&amp;gt;&lt;br /&gt;
				&amp;lt;method name=&amp;quot;ipmi&amp;quot;&amp;gt;&lt;br /&gt;
					&amp;lt;device name=&amp;quot;ipmi_an02&amp;quot; action=&amp;quot;reboot&amp;quot;/&amp;gt;&lt;br /&gt;
				&amp;lt;/method&amp;gt;&lt;br /&gt;
			&amp;lt;/fence&amp;gt;&lt;br /&gt;
		&amp;lt;/clusternode&amp;gt;&lt;br /&gt;
	...&lt;br /&gt;
	&amp;lt;fencedevices&amp;gt;&lt;br /&gt;
		&amp;lt;fencedevice name=&amp;quot;ipmi_an01&amp;quot; agent=&amp;quot;fence_ipmilan&amp;quot; ipaddr=&amp;quot;an-node01.ipmi&amp;quot; login=&amp;quot;root&amp;quot; passwd=&amp;quot;secret&amp;quot; /&amp;gt;&lt;br /&gt;
		&amp;lt;fencedevice name=&amp;quot;ipmi_an02&amp;quot; agent=&amp;quot;fence_ipmilan&amp;quot; ipaddr=&amp;quot;an-node02.ipmi&amp;quot; login=&amp;quot;root&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 or other network fence devices, [[IPMI]] does not have ports. This is because each [[IPMI]] BMC supports just its host system. More on that later.}}&lt;br /&gt;
&lt;br /&gt;
==== Example &amp;lt;fencedevice...&amp;gt; Tag For HP iLO ====&lt;br /&gt;
&lt;br /&gt;
Here we will show how to use [http://h18013.www1.hp.com/products/servers/management/remotemgmt.html iLO] (integraterd Lights-Out) management devices as &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;fencedevice...&amp;gt;&amp;lt;/span&amp;gt; entries. 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 its use.&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;clusternode name=&amp;quot;an-node01.alteeve.com&amp;quot; nodeid=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
			&amp;lt;fence&amp;gt;&lt;br /&gt;
				&amp;lt;method name=&amp;quot;ilo&amp;quot;&amp;gt;&lt;br /&gt;
					&amp;lt;device action=&amp;quot;reboot&amp;quot; name=&amp;quot;ilo_an01&amp;quot;/&amp;gt;&lt;br /&gt;
				&amp;lt;/method&amp;gt;&lt;br /&gt;
			&amp;lt;/fence&amp;gt;&lt;br /&gt;
		&amp;lt;/clusternode&amp;gt;&lt;br /&gt;
		&amp;lt;clusternode name=&amp;quot;an-node02.alteeve.com&amp;quot; nodeid=&amp;quot;2&amp;quot;&amp;gt;&lt;br /&gt;
			&amp;lt;fence&amp;gt;&lt;br /&gt;
				&amp;lt;method name=&amp;quot;ilo&amp;quot;&amp;gt;&lt;br /&gt;
					&amp;lt;device action=&amp;quot;reboot&amp;quot; name=&amp;quot;ilo_an02&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;
	...&lt;br /&gt;
	&amp;lt;fencedevices&amp;gt;&lt;br /&gt;
		&amp;lt;fencedevice agent=&amp;quot;fence_ilo&amp;quot; ipaddr=&amp;quot;an-node01.ilo&amp;quot; login=&amp;quot;root&amp;quot; name=&amp;quot;ilo_an01&amp;quot; passwd=&amp;quot;secret&amp;quot;/&amp;gt;&lt;br /&gt;
		&amp;lt;fencedevice agent=&amp;quot;fence_ilo&amp;quot; ipaddr=&amp;quot;an-node02.ilo&amp;quot; login=&amp;quot;root&amp;quot; name=&amp;quot;ilo_an02&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=Like [[IPMI]], [[iLO]] does not have ports. This is because each [[iLO]] BMC supports just its host system.}}&lt;br /&gt;
&lt;br /&gt;
==== Example &amp;lt;fencedevice...&amp;gt; Tag For Dell&#039;s DRAC ====&lt;br /&gt;
&lt;br /&gt;
{{note|1=I have not tested fencing on Dell, but am using a reference working configuration from another user.}}&lt;br /&gt;
&lt;br /&gt;
Here we will show how to use [http://support.dell.com/support/edocs/software/smdrac3/ DRAC] (Dell Remote Access Controller) management devices as &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;fencedevice...&amp;gt;&amp;lt;/span&amp;gt; entries. We won&#039;t be using it ourselves, but it is another popular as a fence device so I wanted to show an example of its use.&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;clusternode name=&amp;quot;an-node01.alteeve.com&amp;quot; nodeid=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
			&amp;lt;fence&amp;gt;&lt;br /&gt;
				&amp;lt;method name=&amp;quot;drac&amp;quot;&amp;gt;&lt;br /&gt;
					&amp;lt;device action=&amp;quot;reboot&amp;quot; name=&amp;quot;drac_an01&amp;quot;/&amp;gt;&lt;br /&gt;
				&amp;lt;/method&amp;gt;&lt;br /&gt;
			&amp;lt;/fence&amp;gt;&lt;br /&gt;
		&amp;lt;/clusternode&amp;gt;&lt;br /&gt;
		&amp;lt;clusternode name=&amp;quot;an-node02.alteeve.com&amp;quot; nodeid=&amp;quot;2&amp;quot;&amp;gt;&lt;br /&gt;
			&amp;lt;fence&amp;gt;&lt;br /&gt;
				&amp;lt;method name=&amp;quot;ilo&amp;quot;&amp;gt;&lt;br /&gt;
					&amp;lt;device action=&amp;quot;reboot&amp;quot; name=&amp;quot;drac_an02&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;
	...&lt;br /&gt;
	&amp;lt;fencedevices&amp;gt;&lt;br /&gt;
		&amp;lt;fencedevice agent=&amp;quot;fence_drac5&amp;quot; cmd_prompt=&amp;quot;admin1-&amp;amp;gt;&amp;quot; ipaddr=&amp;quot;an-node01.drac&amp;quot; login=&amp;quot;root&amp;quot; name=&amp;quot;drac_an01&amp;quot; passwd=&amp;quot;secret&amp;quot; secure=&amp;quot;1&amp;quot;/&amp;gt;&lt;br /&gt;
		&amp;lt;fencedevice agent=&amp;quot;fence_drac5&amp;quot; cmd_prompt=&amp;quot;admin1-&amp;amp;gt;&amp;quot; ipaddr=&amp;quot;an-node02.drac&amp;quot; login=&amp;quot;root&amp;quot; name=&amp;quot;drac_an02&amp;quot; passwd=&amp;quot;secret&amp;quot; secure=&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;
* &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;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cmd_prompt&amp;lt;/span&amp;gt;; This is the string that the fence agent looks for when talking to the DRAC device.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;secure&amp;lt;/span&amp;gt;; This tells the agent to use [[SSH]].&lt;br /&gt;
&lt;br /&gt;
{{note|1=Like [[IPMI]] and [[iLO]], [[DRAC]] does not have ports. This is because each [[DRAC]] BMC supports just its host system.}}&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. There are two agents for these devices; One that uses the telnet or ssh login and one that uses [[SNMP]]. This tutorial uses the later, and it is recommended that you do the same.&lt;br /&gt;
&lt;br /&gt;
The example below is from a production cluster that uses redundant power supplies and two separate PDUs. This is how you will want to configure any production clusters you build.&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;clusternode name=&amp;quot;an-node01.alteeve.com&amp;quot; nodeid=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
			&amp;lt;fence&amp;gt;&lt;br /&gt;
				&amp;lt;method name=&amp;quot;pdu2&amp;quot;&amp;gt;&lt;br /&gt;
					&amp;lt;device action=&amp;quot;reboot&amp;quot; name=&amp;quot;pdu1&amp;quot; port=&amp;quot;1&amp;quot;/&amp;gt;&lt;br /&gt;
					&amp;lt;device action=&amp;quot;reboot&amp;quot; name=&amp;quot;pdu2&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;
		&amp;lt;/clusternode&amp;gt;&lt;br /&gt;
		&amp;lt;clusternode name=&amp;quot;an-node02.alteeve.com&amp;quot; nodeid=&amp;quot;2&amp;quot;&amp;gt;&lt;br /&gt;
			&amp;lt;fence&amp;gt;&lt;br /&gt;
				&amp;lt;method name=&amp;quot;pdu2&amp;quot;&amp;gt;&lt;br /&gt;
					&amp;lt;device action=&amp;quot;reboot&amp;quot; name=&amp;quot;pdu1&amp;quot; port=&amp;quot;2&amp;quot;/&amp;gt;&lt;br /&gt;
					&amp;lt;device action=&amp;quot;reboot&amp;quot; name=&amp;quot;pdu2&amp;quot; port=&amp;quot;2&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;
	...&lt;br /&gt;
	&amp;lt;fencedevices&amp;gt;&lt;br /&gt;
 		&amp;lt;fencedevice agent=&amp;quot;fence_apc_snmp&amp;quot; ipaddr=&amp;quot;pdu1.alteeve.com&amp;quot; name=&amp;quot;pdu1&amp;quot; /&amp;gt;&lt;br /&gt;
		&amp;lt;fencedevice agent=&amp;quot;fence_apc_snmp&amp;quot; ipaddr=&amp;quot;pdu2.alteeve.com&amp;quot; name=&amp;quot;pdu2&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;agent&amp;lt;/span&amp;gt;; This is the name of the script under &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/usr/sbin/&amp;lt;/span&amp;gt; to use when calling the physical PDU.&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;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;
=== 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 discussed earlier though, this is not the case when using the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[RHCS_v3_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_v3_cluster.conf#cman.3B_The_Cluster_Manager|cman]]&amp;lt;/span&amp;gt; element. 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 its 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, its 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-cluster-A&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-node01.alteeve.com&amp;quot; nodeid=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
                        &amp;lt;fence&amp;gt;&lt;br /&gt;
                                &amp;lt;method name=&amp;quot;ipmi&amp;quot;&amp;gt;&lt;br /&gt;
                                        &amp;lt;device name=&amp;quot;ipmi_an01&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;pdu&amp;quot;&amp;gt;&lt;br /&gt;
                                        &amp;lt;device name=&amp;quot;pdu2&amp;quot; port=&amp;quot;1&amp;quot; action=&amp;quot;reboot&amp;quot; /&amp;gt;&lt;br /&gt;
                                &amp;lt;/method&amp;gt;&lt;br /&gt;
                        &amp;lt;/fence&amp;gt;&lt;br /&gt;
                &amp;lt;/clusternode&amp;gt;&lt;br /&gt;
                &amp;lt;clusternode name=&amp;quot;an-node02.alteeve.com&amp;quot; nodeid=&amp;quot;2&amp;quot;&amp;gt;&lt;br /&gt;
                        &amp;lt;fence&amp;gt;&lt;br /&gt;
                                &amp;lt;method name=&amp;quot;ipmi&amp;quot;&amp;gt;&lt;br /&gt;
                                        &amp;lt;device name=&amp;quot;ipmi_an02&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;pdu&amp;quot;&amp;gt;&lt;br /&gt;
                                        &amp;lt;device name=&amp;quot;pdu2&amp;quot; port=&amp;quot;2&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;ipmi_an01&amp;quot; agent=&amp;quot;fence_ipmilan&amp;quot; ipaddr=&amp;quot;an-node01.ipmi&amp;quot; login=&amp;quot;root&amp;quot; passwd=&amp;quot;secret&amp;quot; /&amp;gt;&lt;br /&gt;
                &amp;lt;fencedevice name=&amp;quot;ipmi_an02&amp;quot; agent=&amp;quot;fence_ipmilan&amp;quot; ipaddr=&amp;quot;an-node02.ipmi&amp;quot; login=&amp;quot;root&amp;quot; passwd=&amp;quot;secret&amp;quot; /&amp;gt;&lt;br /&gt;
                &amp;lt;fencedevice agent=&amp;quot;fence_apc_snmp&amp;quot; ipaddr=&amp;quot;pdu2.alteeve.com&amp;quot; name=&amp;quot;pdu2&amp;quot; /&amp;gt;&lt;br /&gt;
        &amp;lt;/fencedevices&amp;gt;&lt;br /&gt;
        &amp;lt;fence_daemon post_join_delay=&amp;quot;30&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_v3_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_v3_cluster.conf#post_join_delay|post_join_delay]]=&amp;quot;30&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 with which you are comfortable.&lt;br /&gt;
&lt;br /&gt;
=== Configuring Totem ===&lt;br /&gt;
&lt;br /&gt;
There are many attributes for the [[totem]] element. For now though, we&#039;re only going to set two of them. We know that cluster communication will be travelling over our private, secured [[BCN]] network, so for the sake of simplicity, we&#039;re going to disable encryption. We are also offering network redundancy using the bonding drivers, so we&#039;re also going to disable totem&#039;s [[redundant ring protocol]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;cluster name=&amp;quot;an-cluster-A&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-node01.alteeve.com&amp;quot; nodeid=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
                        &amp;lt;fence&amp;gt;&lt;br /&gt;
                                &amp;lt;method name=&amp;quot;ipmi&amp;quot;&amp;gt;&lt;br /&gt;
                                        &amp;lt;device name=&amp;quot;ipmi_an01&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;pdu&amp;quot;&amp;gt;&lt;br /&gt;
                                        &amp;lt;device name=&amp;quot;pdu2&amp;quot; port=&amp;quot;1&amp;quot; action=&amp;quot;reboot&amp;quot; /&amp;gt;&lt;br /&gt;
                                &amp;lt;/method&amp;gt;&lt;br /&gt;
                        &amp;lt;/fence&amp;gt;&lt;br /&gt;
                &amp;lt;/clusternode&amp;gt;&lt;br /&gt;
                &amp;lt;clusternode name=&amp;quot;an-node02.alteeve.com&amp;quot; nodeid=&amp;quot;2&amp;quot;&amp;gt;&lt;br /&gt;
                        &amp;lt;fence&amp;gt;&lt;br /&gt;
                                &amp;lt;method name=&amp;quot;ipmi&amp;quot;&amp;gt;&lt;br /&gt;
                                        &amp;lt;device name=&amp;quot;ipmi_an02&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;pdu&amp;quot;&amp;gt;&lt;br /&gt;
                                        &amp;lt;device name=&amp;quot;pdu2&amp;quot; port=&amp;quot;2&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;ipmi_an01&amp;quot; agent=&amp;quot;fence_ipmilan&amp;quot; ipaddr=&amp;quot;an-node01.ipmi&amp;quot; login=&amp;quot;root&amp;quot; passwd=&amp;quot;secret&amp;quot; /&amp;gt;&lt;br /&gt;
                &amp;lt;fencedevice name=&amp;quot;ipmi_an02&amp;quot; agent=&amp;quot;fence_ipmilan&amp;quot; ipaddr=&amp;quot;an-node02.ipmi&amp;quot; login=&amp;quot;root&amp;quot; passwd=&amp;quot;secret&amp;quot; /&amp;gt;&lt;br /&gt;
                &amp;lt;fencedevice agent=&amp;quot;fence_apc_snmp&amp;quot; ipaddr=&amp;quot;pdu2.alteeve.com&amp;quot; name=&amp;quot;pdu2&amp;quot; /&amp;gt;&lt;br /&gt;
        &amp;lt;/fencedevices&amp;gt;&lt;br /&gt;
        &amp;lt;fence_daemon post_join_delay=&amp;quot;30&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;
{{note|1=At this time, [[redundant ring protocol]] is not supported ([[RHEL6]].1 and lower). It is in technology preview mode in [[RHEL6]].2 and above. This is another reason why we will not be using it in this tutorial..}}&lt;br /&gt;
&lt;br /&gt;
[[RRP]] is an optional second ring that can be used for cluster communication in the case of a break down in the first ring. 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_v3_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_v3_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_v3_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;
One of the most noticeable changes in [[RHCS]] cluster stable 3 is that we no longer have to make a long, cryptic &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xmllint&amp;lt;/span&amp;gt; call to validate our cluster configuration. Now we can simply call &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ccs_config_validate&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ccs_config_validate&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Configuration 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-node02:/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;
sending incremental file list&lt;br /&gt;
cluster.conf&lt;br /&gt;
&lt;br /&gt;
sent 1198 bytes  received 31 bytes  2458.00 bytes/sec&lt;br /&gt;
total size is 1118  speedup is 0.91&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Setting Up ricci ===&lt;br /&gt;
&lt;br /&gt;
Another change from [[RHCS]] stable 2 is how configuration changes are propagated. Before, after a change, we&#039;d push out the updated cluster configuration by calling &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ccs_tool update /etc/cluster/cluster.conf&amp;lt;/span&amp;gt;. Now this is done with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman_tool version -r&amp;lt;/span&amp;gt;. More fundamentally though, the cluster needs to authenticate against each node and does this using the local &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ricci&amp;lt;/span&amp;gt; system user. The user has no password initially, so we need to set one.&lt;br /&gt;
&lt;br /&gt;
On &#039;&#039;&#039;both&#039;&#039;&#039; nodes:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
passwd ricci&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Changing password for user ricci.&lt;br /&gt;
New password: &lt;br /&gt;
Retype new password: &lt;br /&gt;
passwd: all authentication tokens updated successfully.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You will need to enter this password once from each node against the other node. We will see this later.&lt;br /&gt;
&lt;br /&gt;
Now make sure that the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ricci&amp;lt;/span&amp;gt; daemon is set to start on boot and is running now.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
chkconfig ricci on&lt;br /&gt;
chkconfig --list ricci&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
ricci          	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;
Now start it up.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/ricci 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 ricci:                                            [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{note|1=If you don&#039;t see &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[  OK  ]&amp;lt;/span&amp;gt;, don&#039;t worry, it is probably because it was already running.}}&lt;br /&gt;
&lt;br /&gt;
We also need to have a daemon called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;modclusterd&amp;lt;/span&amp;gt; running on start.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
chkconfig modclusterd on&lt;br /&gt;
chkconfig --list modclusterd&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
modclusterd    	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;
Now start it up.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/modclusterd 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 Module - cluster monitor: Setting verbosity level to LogBasic&lt;br /&gt;
                                                           [  OK  ]&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;
It&#039;s a good idea to open a second terminal on either node and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;tail&amp;lt;/span&amp;gt; the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/var/log/messages&amp;lt;/span&amp;gt; [[syslog]] file. All cluster messages will be recorded here and it will help to debug problems if you can watch the logs. To do this, in the new terminal windows run;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
clear; tail -f -n 0 /var/log/messages&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will clear the screen and start watching for new lines to be written to syslog. When you are done watching syslog, press the &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;c&amp;lt;/span&amp;gt; key combination.&lt;br /&gt;
&lt;br /&gt;
How you lay out your terminal windows is, obviously, up to your own preferences. Below is a configuration I have found very useful.&lt;br /&gt;
&lt;br /&gt;
[[Image:2-node-rhcs3_terminal-window-layout_01.png|thumb|center|700px|Terminal window layout for watching 2 nodes. Left windows are used for entering commands and the left windows are used for tailing syslog.]]&lt;br /&gt;
&lt;br /&gt;
With the terminals setup, lets start the cluster!&lt;br /&gt;
&lt;br /&gt;
{{warning|1=If you don&#039;t start &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt; on both nodes within 30 seconds, the slower node will be fenced.}}&lt;br /&gt;
&lt;br /&gt;
On &#039;&#039;&#039;both&#039;&#039;&#039; nodes, run:&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;
   Checking if cluster has been disabled at boot...        [  OK  ]&lt;br /&gt;
   Checking Network Manager...                             [  OK  ]&lt;br /&gt;
   Global setup...                                         [  OK  ]&lt;br /&gt;
   Loading kernel modules...                               [  OK  ]&lt;br /&gt;
   Mounting configfs...                                    [  OK  ]&lt;br /&gt;
   Starting cman...                                        [  OK  ]&lt;br /&gt;
   Waiting for quorum...                                   [  OK  ]&lt;br /&gt;
   Starting fenced...                                      [  OK  ]&lt;br /&gt;
   Starting dlm_controld...                                [  OK  ]&lt;br /&gt;
   Starting gfs_controld...                                [  OK  ]&lt;br /&gt;
   Unfencing self...                                       [  OK  ]&lt;br /&gt;
   Joining fence domain...                                 [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here is what you should see in syslog:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Dec 13 12:08:44 an-node01 kernel: DLM (built Nov  9 2011 08:04:11) installed&lt;br /&gt;
Dec 13 12:08:45 an-node01 corosync[3434]:   [MAIN  ] Corosync Cluster Engine (&#039;1.4.1&#039;): started and ready to provide service.&lt;br /&gt;
Dec 13 12:08:45 an-node01 corosync[3434]:   [MAIN  ] Corosync built-in features: nss dbus rdma snmp&lt;br /&gt;
Dec 13 12:08:45 an-node01 corosync[3434]:   [MAIN  ] Successfully read config from /etc/cluster/cluster.conf&lt;br /&gt;
Dec 13 12:08:45 an-node01 corosync[3434]:   [MAIN  ] Successfully parsed cman config&lt;br /&gt;
Dec 13 12:08:45 an-node01 corosync[3434]:   [TOTEM ] Initializing transport (UDP/IP Multicast).&lt;br /&gt;
Dec 13 12:08:45 an-node01 corosync[3434]:   [TOTEM ] Initializing transmit/receive security: libtomcrypt SOBER128/SHA1HMAC (mode 0).&lt;br /&gt;
Dec 13 12:08:46 an-node01 corosync[3434]:   [TOTEM ] The network interface [10.20.0.1] is now up.&lt;br /&gt;
Dec 13 12:08:46 an-node01 corosync[3434]:   [QUORUM] Using quorum provider quorum_cman&lt;br /&gt;
Dec 13 12:08:46 an-node01 corosync[3434]:   [SERV  ] Service engine loaded: corosync cluster quorum service v0.1&lt;br /&gt;
Dec 13 12:08:46 an-node01 corosync[3434]:   [CMAN  ] CMAN 3.0.12.1 (built Sep 30 2011 03:17:43) started&lt;br /&gt;
Dec 13 12:08:46 an-node01 corosync[3434]:   [SERV  ] Service engine loaded: corosync CMAN membership service 2.90&lt;br /&gt;
Dec 13 12:08:46 an-node01 corosync[3434]:   [SERV  ] Service engine loaded: openais checkpoint service B.01.01&lt;br /&gt;
Dec 13 12:08:46 an-node01 corosync[3434]:   [SERV  ] Service engine loaded: corosync extended virtual synchrony service&lt;br /&gt;
Dec 13 12:08:46 an-node01 corosync[3434]:   [SERV  ] Service engine loaded: corosync configuration service&lt;br /&gt;
Dec 13 12:08:46 an-node01 corosync[3434]:   [SERV  ] Service engine loaded: corosync cluster closed process group service v1.01&lt;br /&gt;
Dec 13 12:08:46 an-node01 corosync[3434]:   [SERV  ] Service engine loaded: corosync cluster config database access v1.01&lt;br /&gt;
Dec 13 12:08:46 an-node01 corosync[3434]:   [SERV  ] Service engine loaded: corosync profile loading service&lt;br /&gt;
Dec 13 12:08:46 an-node01 corosync[3434]:   [QUORUM] Using quorum provider quorum_cman&lt;br /&gt;
Dec 13 12:08:46 an-node01 corosync[3434]:   [SERV  ] Service engine loaded: corosync cluster quorum service v0.1&lt;br /&gt;
Dec 13 12:08:46 an-node01 corosync[3434]:   [MAIN  ] Compatibility mode set to whitetank.  Using V1 and V2 of the synchronization engine.&lt;br /&gt;
Dec 13 12:08:46 an-node01 corosync[3434]:   [TOTEM ] A processor joined or left the membership and a new membership was formed.&lt;br /&gt;
Dec 13 12:08:46 an-node01 corosync[3434]:   [CMAN  ] quorum regained, resuming activity&lt;br /&gt;
Dec 13 12:08:46 an-node01 corosync[3434]:   [QUORUM] This node is within the primary component and will provide service.&lt;br /&gt;
Dec 13 12:08:46 an-node01 corosync[3434]:   [QUORUM] Members[1]: 1&lt;br /&gt;
Dec 13 12:08:46 an-node01 corosync[3434]:   [QUORUM] Members[1]: 1&lt;br /&gt;
Dec 13 12:08:46 an-node01 corosync[3434]:   [CPG   ] chosen downlist: sender r(0) ip(10.20.0.1) ; members(old:0 left:0)&lt;br /&gt;
Dec 13 12:08:46 an-node01 corosync[3434]:   [MAIN  ] Completed service synchronization, ready to provide service.&lt;br /&gt;
Dec 13 12:08:47 an-node01 corosync[3434]:   [TOTEM ] A processor joined or left the membership and a new membership was formed.&lt;br /&gt;
Dec 13 12:08:47 an-node01 corosync[3434]:   [QUORUM] Members[2]: 1 2&lt;br /&gt;
Dec 13 12:08:47 an-node01 corosync[3434]:   [QUORUM] Members[2]: 1 2&lt;br /&gt;
Dec 13 12:08:47 an-node01 corosync[3434]:   [CPG   ] chosen downlist: sender r(0) ip(10.20.0.1) ; members(old:1 left:0)&lt;br /&gt;
Dec 13 12:08:47 an-node01 corosync[3434]:   [MAIN  ] Completed service synchronization, ready to provide service.&lt;br /&gt;
Dec 13 12:08:49 an-node01 fenced[3490]: fenced 3.0.12.1 started&lt;br /&gt;
Dec 13 12:08:49 an-node01 dlm_controld[3515]: dlm_controld 3.0.12.1 started&lt;br /&gt;
Dec 13 12:08:51 an-node01 gfs_controld[3565]: gfs_controld 3.0.12.1 started&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now to confirm that the cluster is operating properly, run &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman_tool status&amp;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: 7&lt;br /&gt;
Cluster Name: an-cluster-A&lt;br /&gt;
Cluster Id: 24561&lt;br /&gt;
Cluster Member: Yes&lt;br /&gt;
Cluster Generation: 8&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;
Node votes: 1&lt;br /&gt;
Quorum: 1  &lt;br /&gt;
Active subsystems: 7&lt;br /&gt;
Flags: 2node &lt;br /&gt;
Ports Bound: 0  &lt;br /&gt;
Node name: an-node01.alteeve.com&lt;br /&gt;
Node ID: 1&lt;br /&gt;
Multicast addresses: 239.192.95.81 &lt;br /&gt;
Node addresses: 10.20.0.1 &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can see that the both nodes are talking because of the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Nodes: 2&amp;lt;/span&amp;gt; entry.&lt;br /&gt;
&lt;br /&gt;
If you ever want to see the nitty-gritty configuration, you can run &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;corosync-objctl&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
corosync-objctl&lt;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.name=an-cluster-A&lt;br /&gt;
cluster.config_version=7&lt;br /&gt;
cluster.cman.expected_votes=1&lt;br /&gt;
cluster.cman.two_node=1&lt;br /&gt;
cluster.cman.nodename=an-node01.alteeve.com&lt;br /&gt;
cluster.cman.cluster_id=24561&lt;br /&gt;
cluster.clusternodes.clusternode.name=an-node01.alteeve.com&lt;br /&gt;
cluster.clusternodes.clusternode.nodeid=1&lt;br /&gt;
cluster.clusternodes.clusternode.fence.method.name=ipmi&lt;br /&gt;
cluster.clusternodes.clusternode.fence.method.device.name=ipmi_an01&lt;br /&gt;
cluster.clusternodes.clusternode.fence.method.device.action=reboot&lt;br /&gt;
cluster.clusternodes.clusternode.fence.method.name=pdu&lt;br /&gt;
cluster.clusternodes.clusternode.fence.method.device.name=pdu2&lt;br /&gt;
cluster.clusternodes.clusternode.fence.method.device.port=1&lt;br /&gt;
cluster.clusternodes.clusternode.fence.method.device.action=reboot&lt;br /&gt;
cluster.clusternodes.clusternode.name=an-node02.alteeve.com&lt;br /&gt;
cluster.clusternodes.clusternode.nodeid=2&lt;br /&gt;
cluster.clusternodes.clusternode.fence.method.name=ipmi&lt;br /&gt;
cluster.clusternodes.clusternode.fence.method.device.name=ipmi_an02&lt;br /&gt;
cluster.clusternodes.clusternode.fence.method.device.action=reboot&lt;br /&gt;
cluster.clusternodes.clusternode.fence.method.name=pdu&lt;br /&gt;
cluster.clusternodes.clusternode.fence.method.device.name=pdu2&lt;br /&gt;
cluster.clusternodes.clusternode.fence.method.device.port=2&lt;br /&gt;
cluster.clusternodes.clusternode.fence.method.device.action=reboot&lt;br /&gt;
cluster.fencedevices.fencedevice.name=ipmi_an01&lt;br /&gt;
cluster.fencedevices.fencedevice.agent=fence_ipmilan&lt;br /&gt;
cluster.fencedevices.fencedevice.ipaddr=an-node01.ipmi&lt;br /&gt;
cluster.fencedevices.fencedevice.login=root&lt;br /&gt;
cluster.fencedevices.fencedevice.passwd=secret&lt;br /&gt;
cluster.fencedevices.fencedevice.name=ipmi_an02&lt;br /&gt;
cluster.fencedevices.fencedevice.agent=fence_ipmilan&lt;br /&gt;
cluster.fencedevices.fencedevice.ipaddr=an-node02.ipmi&lt;br /&gt;
cluster.fencedevices.fencedevice.login=root&lt;br /&gt;
cluster.fencedevices.fencedevice.passwd=secret&lt;br /&gt;
cluster.fencedevices.fencedevice.agent=fence_apc_snmp&lt;br /&gt;
cluster.fencedevices.fencedevice.ipaddr=pdu2.alteeve.com&lt;br /&gt;
cluster.fencedevices.fencedevice.name=pdu2&lt;br /&gt;
cluster.fence_daemon.post_join_delay=30&lt;br /&gt;
cluster.totem.rrp_mode=none&lt;br /&gt;
cluster.totem.secauth=off&lt;br /&gt;
totem.rrp_mode=none&lt;br /&gt;
totem.secauth=off&lt;br /&gt;
totem.transport=udp&lt;br /&gt;
totem.version=2&lt;br /&gt;
totem.nodeid=1&lt;br /&gt;
totem.vsftype=none&lt;br /&gt;
totem.token=10000&lt;br /&gt;
totem.join=60&lt;br /&gt;
totem.fail_recv_const=2500&lt;br /&gt;
totem.consensus=2000&lt;br /&gt;
totem.key=an-cluster-A&lt;br /&gt;
totem.interface.ringnumber=0&lt;br /&gt;
totem.interface.bindnetaddr=10.20.0.1&lt;br /&gt;
totem.interface.mcastaddr=239.192.95.81&lt;br /&gt;
totem.interface.mcastport=5405&lt;br /&gt;
libccs.next_handle=7&lt;br /&gt;
libccs.connection.ccs_handle=3&lt;br /&gt;
libccs.connection.config_version=7&lt;br /&gt;
libccs.connection.fullxpath=0&lt;br /&gt;
libccs.connection.ccs_handle=4&lt;br /&gt;
libccs.connection.config_version=7&lt;br /&gt;
libccs.connection.fullxpath=0&lt;br /&gt;
libccs.connection.ccs_handle=5&lt;br /&gt;
libccs.connection.config_version=7&lt;br /&gt;
libccs.connection.fullxpath=0&lt;br /&gt;
logging.timestamp=on&lt;br /&gt;
logging.to_logfile=yes&lt;br /&gt;
logging.logfile=/var/log/cluster/corosync.log&lt;br /&gt;
logging.logfile_priority=info&lt;br /&gt;
logging.to_syslog=yes&lt;br /&gt;
logging.syslog_facility=local4&lt;br /&gt;
logging.syslog_priority=info&lt;br /&gt;
aisexec.user=ais&lt;br /&gt;
aisexec.group=ais&lt;br /&gt;
service.name=corosync_quorum&lt;br /&gt;
service.ver=0&lt;br /&gt;
service.name=corosync_cman&lt;br /&gt;
service.ver=0&lt;br /&gt;
quorum.provider=quorum_cman&lt;br /&gt;
service.name=openais_ckpt&lt;br /&gt;
service.ver=0&lt;br /&gt;
runtime.services.quorum.service_id=12&lt;br /&gt;
runtime.services.cman.service_id=9&lt;br /&gt;
runtime.services.ckpt.service_id=3&lt;br /&gt;
runtime.services.ckpt.0.tx=0&lt;br /&gt;
runtime.services.ckpt.0.rx=0&lt;br /&gt;
runtime.services.ckpt.1.tx=0&lt;br /&gt;
runtime.services.ckpt.1.rx=0&lt;br /&gt;
runtime.services.ckpt.2.tx=0&lt;br /&gt;
runtime.services.ckpt.2.rx=0&lt;br /&gt;
runtime.services.ckpt.3.tx=0&lt;br /&gt;
runtime.services.ckpt.3.rx=0&lt;br /&gt;
runtime.services.ckpt.4.tx=0&lt;br /&gt;
runtime.services.ckpt.4.rx=0&lt;br /&gt;
runtime.services.ckpt.5.tx=0&lt;br /&gt;
runtime.services.ckpt.5.rx=0&lt;br /&gt;
runtime.services.ckpt.6.tx=0&lt;br /&gt;
runtime.services.ckpt.6.rx=0&lt;br /&gt;
runtime.services.ckpt.7.tx=0&lt;br /&gt;
runtime.services.ckpt.7.rx=0&lt;br /&gt;
runtime.services.ckpt.8.tx=0&lt;br /&gt;
runtime.services.ckpt.8.rx=0&lt;br /&gt;
runtime.services.ckpt.9.tx=0&lt;br /&gt;
runtime.services.ckpt.9.rx=0&lt;br /&gt;
runtime.services.ckpt.10.tx=0&lt;br /&gt;
runtime.services.ckpt.10.rx=0&lt;br /&gt;
runtime.services.ckpt.11.tx=2&lt;br /&gt;
runtime.services.ckpt.11.rx=3&lt;br /&gt;
runtime.services.ckpt.12.tx=0&lt;br /&gt;
runtime.services.ckpt.12.rx=0&lt;br /&gt;
runtime.services.ckpt.13.tx=0&lt;br /&gt;
runtime.services.ckpt.13.rx=0&lt;br /&gt;
runtime.services.evs.service_id=0&lt;br /&gt;
runtime.services.evs.0.tx=0&lt;br /&gt;
runtime.services.evs.0.rx=0&lt;br /&gt;
runtime.services.cfg.service_id=7&lt;br /&gt;
runtime.services.cfg.0.tx=0&lt;br /&gt;
runtime.services.cfg.0.rx=0&lt;br /&gt;
runtime.services.cfg.1.tx=0&lt;br /&gt;
runtime.services.cfg.1.rx=0&lt;br /&gt;
runtime.services.cfg.2.tx=0&lt;br /&gt;
runtime.services.cfg.2.rx=0&lt;br /&gt;
runtime.services.cfg.3.tx=0&lt;br /&gt;
runtime.services.cfg.3.rx=0&lt;br /&gt;
runtime.services.cpg.service_id=8&lt;br /&gt;
runtime.services.cpg.0.tx=4&lt;br /&gt;
runtime.services.cpg.0.rx=8&lt;br /&gt;
runtime.services.cpg.1.tx=0&lt;br /&gt;
runtime.services.cpg.1.rx=0&lt;br /&gt;
runtime.services.cpg.2.tx=0&lt;br /&gt;
runtime.services.cpg.2.rx=0&lt;br /&gt;
runtime.services.cpg.3.tx=16&lt;br /&gt;
runtime.services.cpg.3.rx=23&lt;br /&gt;
runtime.services.cpg.4.tx=0&lt;br /&gt;
runtime.services.cpg.4.rx=0&lt;br /&gt;
runtime.services.cpg.5.tx=2&lt;br /&gt;
runtime.services.cpg.5.rx=3&lt;br /&gt;
runtime.services.confdb.service_id=11&lt;br /&gt;
runtime.services.pload.service_id=13&lt;br /&gt;
runtime.services.pload.0.tx=0&lt;br /&gt;
runtime.services.pload.0.rx=0&lt;br /&gt;
runtime.services.pload.1.tx=0&lt;br /&gt;
runtime.services.pload.1.rx=0&lt;br /&gt;
runtime.services.quorum.service_id=12&lt;br /&gt;
runtime.connections.active=6&lt;br /&gt;
runtime.connections.closed=110&lt;br /&gt;
runtime.connections.fenced:CPG:3490:19.service_id=8&lt;br /&gt;
runtime.connections.fenced:CPG:3490:19.client_pid=3490&lt;br /&gt;
runtime.connections.fenced:CPG:3490:19.responses=5&lt;br /&gt;
runtime.connections.fenced:CPG:3490:19.dispatched=9&lt;br /&gt;
runtime.connections.fenced:CPG:3490:19.requests=5&lt;br /&gt;
runtime.connections.fenced:CPG:3490:19.sem_retry_count=0&lt;br /&gt;
runtime.connections.fenced:CPG:3490:19.send_retry_count=0&lt;br /&gt;
runtime.connections.fenced:CPG:3490:19.recv_retry_count=0&lt;br /&gt;
runtime.connections.fenced:CPG:3490:19.flow_control=0&lt;br /&gt;
runtime.connections.fenced:CPG:3490:19.flow_control_count=0&lt;br /&gt;
runtime.connections.fenced:CPG:3490:19.queue_size=0&lt;br /&gt;
runtime.connections.fenced:CPG:3490:19.invalid_request=0&lt;br /&gt;
runtime.connections.fenced:CPG:3490:19.overload=0&lt;br /&gt;
runtime.connections.dlm_controld:CPG:3515:22.service_id=8&lt;br /&gt;
runtime.connections.dlm_controld:CPG:3515:22.client_pid=3515&lt;br /&gt;
runtime.connections.dlm_controld:CPG:3515:22.responses=5&lt;br /&gt;
runtime.connections.dlm_controld:CPG:3515:22.dispatched=8&lt;br /&gt;
runtime.connections.dlm_controld:CPG:3515:22.requests=5&lt;br /&gt;
runtime.connections.dlm_controld:CPG:3515:22.sem_retry_count=0&lt;br /&gt;
runtime.connections.dlm_controld:CPG:3515:22.send_retry_count=0&lt;br /&gt;
runtime.connections.dlm_controld:CPG:3515:22.recv_retry_count=0&lt;br /&gt;
runtime.connections.dlm_controld:CPG:3515:22.flow_control=0&lt;br /&gt;
runtime.connections.dlm_controld:CPG:3515:22.flow_control_count=0&lt;br /&gt;
runtime.connections.dlm_controld:CPG:3515:22.queue_size=0&lt;br /&gt;
runtime.connections.dlm_controld:CPG:3515:22.invalid_request=0&lt;br /&gt;
runtime.connections.dlm_controld:CPG:3515:22.overload=0&lt;br /&gt;
runtime.connections.dlm_controld:CKPT:3515:23.service_id=3&lt;br /&gt;
runtime.connections.dlm_controld:CKPT:3515:23.client_pid=3515&lt;br /&gt;
runtime.connections.dlm_controld:CKPT:3515:23.responses=0&lt;br /&gt;
runtime.connections.dlm_controld:CKPT:3515:23.dispatched=0&lt;br /&gt;
runtime.connections.dlm_controld:CKPT:3515:23.requests=0&lt;br /&gt;
runtime.connections.dlm_controld:CKPT:3515:23.sem_retry_count=0&lt;br /&gt;
runtime.connections.dlm_controld:CKPT:3515:23.send_retry_count=0&lt;br /&gt;
runtime.connections.dlm_controld:CKPT:3515:23.recv_retry_count=0&lt;br /&gt;
runtime.connections.dlm_controld:CKPT:3515:23.flow_control=0&lt;br /&gt;
runtime.connections.dlm_controld:CKPT:3515:23.flow_control_count=0&lt;br /&gt;
runtime.connections.dlm_controld:CKPT:3515:23.queue_size=0&lt;br /&gt;
runtime.connections.dlm_controld:CKPT:3515:23.invalid_request=0&lt;br /&gt;
runtime.connections.dlm_controld:CKPT:3515:23.overload=0&lt;br /&gt;
runtime.connections.gfs_controld:CPG:3565:26.service_id=8&lt;br /&gt;
runtime.connections.gfs_controld:CPG:3565:26.client_pid=3565&lt;br /&gt;
runtime.connections.gfs_controld:CPG:3565:26.responses=5&lt;br /&gt;
runtime.connections.gfs_controld:CPG:3565:26.dispatched=8&lt;br /&gt;
runtime.connections.gfs_controld:CPG:3565:26.requests=5&lt;br /&gt;
runtime.connections.gfs_controld:CPG:3565:26.sem_retry_count=0&lt;br /&gt;
runtime.connections.gfs_controld:CPG:3565:26.send_retry_count=0&lt;br /&gt;
runtime.connections.gfs_controld:CPG:3565:26.recv_retry_count=0&lt;br /&gt;
runtime.connections.gfs_controld:CPG:3565:26.flow_control=0&lt;br /&gt;
runtime.connections.gfs_controld:CPG:3565:26.flow_control_count=0&lt;br /&gt;
runtime.connections.gfs_controld:CPG:3565:26.queue_size=0&lt;br /&gt;
runtime.connections.gfs_controld:CPG:3565:26.invalid_request=0&lt;br /&gt;
runtime.connections.gfs_controld:CPG:3565:26.overload=0&lt;br /&gt;
runtime.connections.fenced:CPG:3490:28.service_id=8&lt;br /&gt;
runtime.connections.fenced:CPG:3490:28.client_pid=3490&lt;br /&gt;
runtime.connections.fenced:CPG:3490:28.responses=5&lt;br /&gt;
runtime.connections.fenced:CPG:3490:28.dispatched=8&lt;br /&gt;
runtime.connections.fenced:CPG:3490:28.requests=5&lt;br /&gt;
runtime.connections.fenced:CPG:3490:28.sem_retry_count=0&lt;br /&gt;
runtime.connections.fenced:CPG:3490:28.send_retry_count=0&lt;br /&gt;
runtime.connections.fenced:CPG:3490:28.recv_retry_count=0&lt;br /&gt;
runtime.connections.fenced:CPG:3490:28.flow_control=0&lt;br /&gt;
runtime.connections.fenced:CPG:3490:28.flow_control_count=0&lt;br /&gt;
runtime.connections.fenced:CPG:3490:28.queue_size=0&lt;br /&gt;
runtime.connections.fenced:CPG:3490:28.invalid_request=0&lt;br /&gt;
runtime.connections.fenced:CPG:3490:28.overload=0&lt;br /&gt;
runtime.connections.corosync-objctl:CONFDB:3698:27.service_id=11&lt;br /&gt;
runtime.connections.corosync-objctl:CONFDB:3698:27.client_pid=3698&lt;br /&gt;
runtime.connections.corosync-objctl:CONFDB:3698:27.responses=444&lt;br /&gt;
runtime.connections.corosync-objctl:CONFDB:3698:27.dispatched=0&lt;br /&gt;
runtime.connections.corosync-objctl:CONFDB:3698:27.requests=447&lt;br /&gt;
runtime.connections.corosync-objctl:CONFDB:3698:27.sem_retry_count=0&lt;br /&gt;
runtime.connections.corosync-objctl:CONFDB:3698:27.send_retry_count=0&lt;br /&gt;
runtime.connections.corosync-objctl:CONFDB:3698:27.recv_retry_count=0&lt;br /&gt;
runtime.connections.corosync-objctl:CONFDB:3698:27.flow_control=0&lt;br /&gt;
runtime.connections.corosync-objctl:CONFDB:3698:27.flow_control_count=0&lt;br /&gt;
runtime.connections.corosync-objctl:CONFDB:3698:27.queue_size=0&lt;br /&gt;
runtime.connections.corosync-objctl:CONFDB:3698:27.invalid_request=0&lt;br /&gt;
runtime.connections.corosync-objctl:CONFDB:3698:27.overload=0&lt;br /&gt;
runtime.totem.pg.msg_reserved=1&lt;br /&gt;
runtime.totem.pg.msg_queue_avail=761&lt;br /&gt;
runtime.totem.pg.mrp.srp.orf_token_tx=2&lt;br /&gt;
runtime.totem.pg.mrp.srp.orf_token_rx=405&lt;br /&gt;
runtime.totem.pg.mrp.srp.memb_merge_detect_tx=53&lt;br /&gt;
runtime.totem.pg.mrp.srp.memb_merge_detect_rx=53&lt;br /&gt;
runtime.totem.pg.mrp.srp.memb_join_tx=3&lt;br /&gt;
runtime.totem.pg.mrp.srp.memb_join_rx=5&lt;br /&gt;
runtime.totem.pg.mrp.srp.mcast_tx=45&lt;br /&gt;
runtime.totem.pg.mrp.srp.mcast_retx=0&lt;br /&gt;
runtime.totem.pg.mrp.srp.mcast_rx=56&lt;br /&gt;
runtime.totem.pg.mrp.srp.memb_commit_token_tx=4&lt;br /&gt;
runtime.totem.pg.mrp.srp.memb_commit_token_rx=4&lt;br /&gt;
runtime.totem.pg.mrp.srp.token_hold_cancel_tx=4&lt;br /&gt;
runtime.totem.pg.mrp.srp.token_hold_cancel_rx=7&lt;br /&gt;
runtime.totem.pg.mrp.srp.operational_entered=2&lt;br /&gt;
runtime.totem.pg.mrp.srp.operational_token_lost=0&lt;br /&gt;
runtime.totem.pg.mrp.srp.gather_entered=2&lt;br /&gt;
runtime.totem.pg.mrp.srp.gather_token_lost=0&lt;br /&gt;
runtime.totem.pg.mrp.srp.commit_entered=2&lt;br /&gt;
runtime.totem.pg.mrp.srp.commit_token_lost=0&lt;br /&gt;
runtime.totem.pg.mrp.srp.recovery_entered=2&lt;br /&gt;
runtime.totem.pg.mrp.srp.recovery_token_lost=0&lt;br /&gt;
runtime.totem.pg.mrp.srp.consensus_timeouts=0&lt;br /&gt;
runtime.totem.pg.mrp.srp.mtt_rx_token=913&lt;br /&gt;
runtime.totem.pg.mrp.srp.avg_token_workload=0&lt;br /&gt;
runtime.totem.pg.mrp.srp.avg_backlog_calc=0&lt;br /&gt;
runtime.totem.pg.mrp.srp.rx_msg_dropped=0&lt;br /&gt;
runtime.totem.pg.mrp.srp.continuous_gather=0&lt;br /&gt;
runtime.totem.pg.mrp.srp.firewall_enabled_or_nic_failure=0&lt;br /&gt;
runtime.totem.pg.mrp.srp.members.1.ip=r(0) ip(10.20.0.1) &lt;br /&gt;
runtime.totem.pg.mrp.srp.members.1.join_count=1&lt;br /&gt;
runtime.totem.pg.mrp.srp.members.1.status=joined&lt;br /&gt;
runtime.totem.pg.mrp.srp.members.2.ip=r(0) ip(10.20.0.2) &lt;br /&gt;
runtime.totem.pg.mrp.srp.members.2.join_count=1&lt;br /&gt;
runtime.totem.pg.mrp.srp.members.2.status=joined&lt;br /&gt;
runtime.blackbox.dump_flight_data=no&lt;br /&gt;
runtime.blackbox.dump_state=no&lt;br /&gt;
cman_private.COROSYNC_DEFAULT_CONFIG_IFACE=xmlconfig:cmanpreconfig&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you want to check what [[DLM]] lockspaces, you can use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;dlm_tool ls&amp;lt;/span&amp;gt; to list lock spaces. Given that we&#039;re not running and resources or clustered filesystems though, there won&#039;t be any at this time. We&#039;ll look at this again later.&lt;br /&gt;
&lt;br /&gt;
== Testing Fencing ==&lt;br /&gt;
&lt;br /&gt;
We need to thoroughly test our fence configuration and devices before we proceed. Should the cluster call a fence, and if the fence call fails, the cluster will hang until the fence finally succeeds. There is no way to abort a fence, so this could effectively hang the cluster. If we have problems, we need to find them now.&lt;br /&gt;
&lt;br /&gt;
We need to run two tests from each node against the other node for a total of four tests.&lt;br /&gt;
* The first test will use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fence_ipmilan&amp;lt;/span&amp;gt;. To do this, we will hang the victim node by running &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;echo c &amp;gt; /proc/sysrq-trigger&amp;lt;/span&amp;gt; on it. This will immediately and completely hang the kernel. The other node should detect the failure and reboot the victim. You can confirm that IPMI was used by watching the fence PDU and &#039;&#039;&#039;not&#039;&#039;&#039; seeing it power-cycle the port.&lt;br /&gt;
* Secondly, we will pull the power on the victim node. This is done to ensure that the IPMI BMC is also dead and will simulate a failure in the power supply. You should see the other node try to fence the victim, fail initially, then try again using the second, switched PDU. If you want the PDU, you should see the power indicator LED go off and then come back on. &lt;br /&gt;
&lt;br /&gt;
{{note|1=To &amp;quot;pull the power&amp;quot;, we can actually just log into the PDU and turn off the victim&#039;s power. In this case, we&#039;ll see the power restored when the PDU is used to fence the node. We can actually use the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fence_apc&amp;lt;/span&amp;gt; fence agent to pull the power, as we&#039;ll see.}}&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Test&lt;br /&gt;
!Victim&lt;br /&gt;
!Pass?&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;echo c &amp;gt; /proc/sysrq-trigger&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;span style=&amp;quot;color: green;&amp;quot;&amp;gt;Yes&amp;lt;/span&amp;gt; / &amp;lt;span style=&amp;quot;color: red;&amp;quot;&amp;gt;No&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fence_apc_snmp -a pdu2.alteeve.com -n 1 -o off&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;span style=&amp;quot;color: green;&amp;quot;&amp;gt;Yes&amp;lt;/span&amp;gt; / &amp;lt;span style=&amp;quot;color: red;&amp;quot;&amp;gt;No&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;echo c &amp;gt; /proc/sysrq-trigger&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;span style=&amp;quot;color: green;&amp;quot;&amp;gt;Yes&amp;lt;/span&amp;gt; / &amp;lt;span style=&amp;quot;color: red;&amp;quot;&amp;gt;No&amp;lt;/span&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fence_apc_snmp -a pdu2.alteeve.com -n 2 -o off&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt;&lt;br /&gt;
|&amp;lt;span style=&amp;quot;color: green;&amp;quot;&amp;gt;Yes&amp;lt;/span&amp;gt; / &amp;lt;span style=&amp;quot;color: red;&amp;quot;&amp;gt;No&amp;lt;/span&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
After the lost node is recovered, remember to restart &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt; before starting the next test.&lt;br /&gt;
&lt;br /&gt;
=== Hanging an-node01 ===&lt;br /&gt;
&lt;br /&gt;
Be sure to be &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;tail&amp;lt;/span&amp;gt;ing the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/var/log/messages&amp;lt;/span&amp;gt; on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt;. Go to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;&#039;s first terminal and run the following command. &lt;br /&gt;
&lt;br /&gt;
{{warning|1=This command will not return and you will lose all ability to talk to this node until it is rebooted.}}&lt;br /&gt;
&lt;br /&gt;
On &#039;&#039;&#039;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;&#039;&#039;&#039; 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;
On &#039;&#039;&#039;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt;&#039;&#039;&#039;&#039;s syslog terminal, you should see the following entries in the log.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Dec 13 12:42:39 an-node02 corosync[2758]:   [TOTEM ] A processor failed, forming new configuration.&lt;br /&gt;
Dec 13 12:42:41 an-node02 corosync[2758]:   [QUORUM] Members[1]: 2&lt;br /&gt;
Dec 13 12:42:41 an-node02 corosync[2758]:   [TOTEM ] A processor joined or left the membership and a new membership was formed.&lt;br /&gt;
Dec 13 12:42:41 an-node02 corosync[2758]:   [CPG   ] chosen downlist: sender r(0) ip(10.20.0.2) ; members(old:2 left:1)&lt;br /&gt;
Dec 13 12:42:41 an-node02 corosync[2758]:   [MAIN  ] Completed service synchronization, ready to provide service.&lt;br /&gt;
Dec 13 12:42:41 an-node02 kernel: dlm: closing connection to node 1&lt;br /&gt;
Dec 13 12:42:41 an-node02 fenced[2817]: fencing node an-node01.alteeve.com&lt;br /&gt;
Dec 13 12:42:56 an-node02 fenced[2817]: fence an-node01.alteeve.com success&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Perfect!&lt;br /&gt;
&lt;br /&gt;
If you are watching &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;&#039;s display, you should now see it starting to boot back up. &lt;br /&gt;
&lt;br /&gt;
{{note|1=Remember to start &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt; once the node boots back up before trying the next test.}}&lt;br /&gt;
&lt;br /&gt;
=== Cutting the Power to an-node01 ===&lt;br /&gt;
&lt;br /&gt;
As was discussed earlier, IPMI and other out-of-band management interfaces have a fatal flaw as a fence device. Their [[BMC]] draws its power from the same power supply as the node itself. Thus, when the power supply itself fails (or the mains connection is pulled/tripped over), fencing via IPMI will fail. This makes the power supply a single point of failure, which is what the PDU protects us against.&lt;br /&gt;
&lt;br /&gt;
So to simulate a failed power supply, we&#039;re going to use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt;&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fence_apc&amp;lt;/span&amp;gt; fence agent to turn off the power to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
Alternatively, you could also just unplug the power and the fence would still succeed. The fence call only needs to confirm that the node is off to succeed. Whether the node restarts after or not is not important so far as the cluster is concerned.&lt;br /&gt;
&lt;br /&gt;
From &#039;&#039;&#039;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt;&#039;&#039;&#039;, pull the power on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt; with the following call;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
fence_apc_snmp -a pdu2.alteeve.com -n 1 -o off&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Success: Powered OFF&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Back on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt;&#039;s syslog, we should see the following entries;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Dec 13 12:45:46 an-node02 corosync[2758]:   [TOTEM ] A processor failed, forming new configuration.&lt;br /&gt;
Dec 13 12:45:48 an-node02 corosync[2758]:   [QUORUM] Members[1]: 2&lt;br /&gt;
Dec 13 12:45:48 an-node02 corosync[2758]:   [TOTEM ] A processor joined or left the membership and a new membership was formed.&lt;br /&gt;
Dec 13 12:45:48 an-node02 corosync[2758]:   [CPG   ] chosen downlist: sender r(0) ip(10.20.0.2) ; members(old:2 left:1)&lt;br /&gt;
Dec 13 12:45:48 an-node02 corosync[2758]:   [MAIN  ] Completed service synchronization, ready to provide service.&lt;br /&gt;
Dec 13 12:45:48 an-node02 kernel: dlm: closing connection to node 1&lt;br /&gt;
Dec 13 12:45:48 an-node02 fenced[2817]: fencing node an-node01.alteeve.com&lt;br /&gt;
Dec 13 12:46:08 an-node02 fenced[2817]: fence an-node01.alteeve.com dev 0.0 agent fence_ipmilan result: error from agent&lt;br /&gt;
Dec 13 12:46:08 an-node02 fenced[2817]: fence an-node01.alteeve.com success&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Hoozah!&lt;br /&gt;
&lt;br /&gt;
Notice that there is an error from the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fence_ipmilan&amp;lt;/span&amp;gt;. This is exactly what we expected because of the IPMI&#039;s BMC lost power and couldn&#039;t respond.&lt;br /&gt;
&lt;br /&gt;
So now we know that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt; can be fenced successfully from both fence devices. Now we need to run the same tests against &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Hanging an-node02 ===&lt;br /&gt;
&lt;br /&gt;
{{warning|1=&#039;&#039;&#039;DO NOT ASSUME THAT &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt; WILL FENCE PROPERLY JUST BECAUSE &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt; PASSED!&#039;&#039;&#039;. There are many ways that a fence could fail; Bad password, misconfigured device, plugged into the wrong port on the PDU and so on. Always test all nodes using all methods!}}&lt;br /&gt;
&lt;br /&gt;
Be sure to be &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;tail&amp;lt;/span&amp;gt;ing the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/var/log/messages&amp;lt;/span&amp;gt; on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt;. Go to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;&#039;s first terminal and run the following command. &lt;br /&gt;
&lt;br /&gt;
{{note|1=This command will not return and you will lose all ability to talk to this node until it is rebooted.}}&lt;br /&gt;
&lt;br /&gt;
On &#039;&#039;&#039;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt;&#039;&#039;&#039; 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;
On &#039;&#039;&#039;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;&#039;&#039;&#039;&#039;s syslog terminal, you should see the following entries in the log.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Dec 13 12:52:34 an-node01 corosync[3445]:   [TOTEM ] A processor failed, forming new configuration.&lt;br /&gt;
Dec 13 12:52:36 an-node01 corosync[3445]:   [QUORUM] Members[1]: 1&lt;br /&gt;
Dec 13 12:52:36 an-node01 corosync[3445]:   [TOTEM ] A processor joined or left the membership and a new membership was formed.&lt;br /&gt;
Dec 13 12:52:36 an-node01 corosync[3445]:   [CPG   ] chosen downlist: sender r(0) ip(10.20.0.1) ; members(old:2 left:1)&lt;br /&gt;
Dec 13 12:52:36 an-node01 corosync[3445]:   [MAIN  ] Completed service synchronization, ready to provide service.&lt;br /&gt;
Dec 13 12:52:36 an-node01 kernel: dlm: closing connection to node 2&lt;br /&gt;
Dec 13 12:52:36 an-node01 fenced[3501]: fencing node an-node02.alteeve.com&lt;br /&gt;
Dec 13 12:52:51 an-node01 fenced[3501]: fence an-node02.alteeve.com success&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Again, perfect!&lt;br /&gt;
&lt;br /&gt;
=== Cutting the Power to an-node02 ===&lt;br /&gt;
&lt;br /&gt;
From &#039;&#039;&#039;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;&#039;&#039;&#039;, pull the power on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt; with the following call;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
fence_apc_snmp -a pdu2.alteeve.com -n 2 -o off&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Success: Powered OFF&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Back on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;&#039;s syslog, we should see the following entries;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Dec 13 12:55:58 an-node01 corosync[3445]:   [TOTEM ] A processor failed, forming new configuration.&lt;br /&gt;
Dec 13 12:56:00 an-node01 corosync[3445]:   [QUORUM] Members[1]: 1&lt;br /&gt;
Dec 13 12:56:00 an-node01 corosync[3445]:   [TOTEM ] A processor joined or left the membership and a new membership was formed.&lt;br /&gt;
Dec 13 12:56:00 an-node01 corosync[3445]:   [CPG   ] chosen downlist: sender r(0) ip(10.20.0.1) ; members(old:2 left:1)&lt;br /&gt;
Dec 13 12:56:00 an-node01 kernel: dlm: closing connection to node 2&lt;br /&gt;
Dec 13 12:56:00 an-node01 corosync[3445]:   [MAIN  ] Completed service synchronization, ready to provide service.&lt;br /&gt;
Dec 13 12:56:00 an-node01 fenced[3501]: fencing node an-node02.alteeve.com&lt;br /&gt;
Dec 13 12:56:20 an-node01 fenced[3501]: fence an-node02.alteeve.com dev 0.0 agent fence_ipmilan result: error from agent&lt;br /&gt;
Dec 13 12:56:20 an-node01 fenced[3501]: fence an-node02.alteeve.com success&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Woot!&lt;br /&gt;
&lt;br /&gt;
Only now can we safely say that our fencing is setup and working properly.&lt;br /&gt;
&lt;br /&gt;
== Testing Network Redundancy ==&lt;br /&gt;
&lt;br /&gt;
Next up of the testing block is our network configuration. Seeing as we&#039;ve build our bonds, we need to now test that they are working properly. &lt;br /&gt;
&lt;br /&gt;
* Make sure that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt; has started on both nodes.&lt;br /&gt;
&lt;br /&gt;
First, we&#039;ll test all network cables individually, one node and one bonded interface at a time.&lt;br /&gt;
&lt;br /&gt;
* For each network; IFN, SN and BCN;&lt;br /&gt;
** On both nodes, start a ping flood against the opposing node specifying the appropriate network name suffix in the first window and starting &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;tail&amp;lt;/span&amp;gt;ing syslog in the second window.&lt;br /&gt;
** &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;watch&amp;lt;/span&amp;gt; each bond&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/proc/net/bonding/bondX&amp;lt;/span&amp;gt; file to see which interfaces are active.&lt;br /&gt;
** Pull the currently-active network cable from the bond (either at the switch or at the node).&lt;br /&gt;
** Check the state of the bonds again and see that they&#039;ve switched to their backup interface. If a node gets fenced, you know something went wrong. You should see a handful of lost packets in the ping flood.&lt;br /&gt;
** Restore the network cable and wait 2 minutes, then verify that the old primary interface was restored. You will see another handful of lost packets in the flood during the recovery.&lt;br /&gt;
** Pull the cable again, then restore it. This time, do not wait 2 minutes. After just a few seconds, pull the backup link and ensure that the bond immediately resumed use of the primary interface.&lt;br /&gt;
** Repeat the above steps for all bonds on both nodes. This will take a while, but you need to ensure configuration errors are found now.&lt;br /&gt;
&lt;br /&gt;
{{warning|1=Testing the complete primary switch failure and subsequant recovery is very, very important. Please do NOT skip this step!}}&lt;br /&gt;
&lt;br /&gt;
Once all bonds have been tested, we&#039;ll do a final test by failing the primary switch.&lt;br /&gt;
* Cut the power to the switch.&lt;br /&gt;
* Check all bond status files. Confirm that all have switched to their backup links.&lt;br /&gt;
* Restore power to the switch and wait 2 minutes.&lt;br /&gt;
* Confirm that the bonds did not switch to the primary interfaces before the switch was ready to move data.&lt;br /&gt;
&lt;br /&gt;
If all of these steps pass and the cluster doesn&#039;t partition, then you can be confident that your network is configured properly for full redundancy.&lt;br /&gt;
&lt;br /&gt;
=== Network Testing Terminal Layout ===&lt;br /&gt;
&lt;br /&gt;
If you have a couple of monitors, particularly one with portrait mode, you might be able to open 16 terminals at once. This is how many are needed to run ping floods, watch the bond status files, tail syslog and watch cman_tool all at the same time. This configuration makes it very easy to keep a near real-time, complete view of all network components.&lt;br /&gt;
&lt;br /&gt;
On the left window, the top-left terminal shows &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;watch cman_tool status&amp;lt;/span&amp;gt; and the top-right terminal shows &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;tail -f -n 0 /var/log/messages&amp;lt;/span&amp;gt; for &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;. The bottom two terminals show the same for &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
On the right, portrait-mode window, the terminal layout used for monitoring the bonded link status and ping floods are shown. There are two columns; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt; on the left and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt; on the right. Each column is stacked into six rows, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;bond0&amp;lt;/span&amp;gt; on the top followed by &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ping -f an-node02.bcn&amp;lt;/span&amp;gt;, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;bond1&amp;lt;/span&amp;gt; in the middle followed by &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ping -f an-node02.sn&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;bond2&amp;lt;/span&amp;gt; at the bottom followed by &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ping -f an-node02.ifn&amp;lt;/span&amp;gt;. The left window shows the standard &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;tail&amp;lt;/span&amp;gt; on syslog plus &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;watch cman_tool status&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[Image:2-node_el6-tutorial_network-test_terminal-layout_01.png|thumb|center|700px|Terminal layout used for HA network testing; Calls shown.]]&lt;br /&gt;
&lt;br /&gt;
[[Image:2-node_el6-tutorial_network-test_terminal-layout_02.png|thumb|center|700px|Terminal layout used for HA network testing; Calls running.]]&lt;br /&gt;
&lt;br /&gt;
=== How to Know if the Tests Passed ===&lt;br /&gt;
&lt;br /&gt;
Well, the most obvious answer to this question is if the cluster is still working after a switch is powered off.&lt;br /&gt;
&lt;br /&gt;
We can be a little more subtle than that though.&lt;br /&gt;
&lt;br /&gt;
The state of each bond is viewable by looking in the special &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/proc/net/bonding/bondX&amp;lt;/span&amp;gt; files, where &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;X&amp;lt;/span&amp;gt; is the bond number. Lets take a look at &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;bond0&amp;lt;/span&amp;gt; on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cat /proc/net/bonding/bond0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Ethernet Channel Bonding Driver: v3.6.0 (September 26, 2009)&lt;br /&gt;
&lt;br /&gt;
Bonding Mode: fault-tolerance (active-backup)&lt;br /&gt;
Primary Slave: eth0 (primary_reselect always)&lt;br /&gt;
Currently Active Slave: eth0&lt;br /&gt;
MII Status: up&lt;br /&gt;
MII Polling Interval (ms): 100&lt;br /&gt;
Up Delay (ms): 120000&lt;br /&gt;
Down Delay (ms): 0&lt;br /&gt;
&lt;br /&gt;
Slave Interface: eth0&lt;br /&gt;
MII Status: up&lt;br /&gt;
Link Failure Count: 0&lt;br /&gt;
Permanent HW addr: 00:e0:81:c7:ec:49&lt;br /&gt;
Slave queue ID: 0&lt;br /&gt;
&lt;br /&gt;
Slave Interface: eth3&lt;br /&gt;
MII Status: up&lt;br /&gt;
Link Failure Count: 0&lt;br /&gt;
Permanent HW addr: 00:1b:21:9d:59:fc&lt;br /&gt;
Slave queue ID: 0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can see that the currently active interface is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth0&amp;lt;/span&amp;gt;. This is the key bit we&#039;re going to be watching for these tests. I know that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth0&amp;lt;/span&amp;gt; on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt; is connected to by first switch. So when I pull the cable to that switch, or when I fail that switch entirely, I should see &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth3&amp;lt;/span&amp;gt; take over.&lt;br /&gt;
&lt;br /&gt;
We&#039;ll also be watching syslog. If things work right, we should not see any messages from the cluster during failure and recovery.&lt;br /&gt;
&lt;br /&gt;
=== Failing The First Interface ===&lt;br /&gt;
&lt;br /&gt;
Let&#039;s look at the first test. We&#039;ll fail &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth0&amp;lt;/span&amp;gt; interface by pulling its cable.&lt;br /&gt;
&lt;br /&gt;
On &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;&#039;s syslog, you will see;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Dec 13 14:03:19 an-node01 kernel: e1000e: eth0 NIC Link is Down&lt;br /&gt;
Dec 13 14:03:19 an-node01 kernel: bonding: bond0: link status definitely down for interface eth0, disabling it&lt;br /&gt;
Dec 13 14:03:19 an-node01 kernel: bonding: bond0: making interface eth3 the new active one.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Looking again at &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;bond0&amp;lt;/span&amp;gt;&#039;s status;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cat /proc/net/bonding/bond0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Ethernet Channel Bonding Driver: v3.6.0 (September 26, 2009)&lt;br /&gt;
&lt;br /&gt;
Bonding Mode: fault-tolerance (active-backup)&lt;br /&gt;
Primary Slave: eth0 (primary_reselect always)&lt;br /&gt;
Currently Active Slave: eth3&lt;br /&gt;
MII Status: up&lt;br /&gt;
MII Polling Interval (ms): 100&lt;br /&gt;
Up Delay (ms): 120000&lt;br /&gt;
Down Delay (ms): 0&lt;br /&gt;
&lt;br /&gt;
Slave Interface: eth0&lt;br /&gt;
MII Status: down&lt;br /&gt;
Link Failure Count: 1&lt;br /&gt;
Permanent HW addr: 00:e0:81:c7:ec:49&lt;br /&gt;
Slave queue ID: 0&lt;br /&gt;
&lt;br /&gt;
Slave Interface: eth3&lt;br /&gt;
MII Status: up&lt;br /&gt;
Link Failure Count: 0&lt;br /&gt;
Permanent HW addr: 00:1b:21:9d:59:fc&lt;br /&gt;
Slave queue ID: 0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can see now that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth0&amp;lt;/span&amp;gt; is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;down&amp;lt;/span&amp;gt; and that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth3&amp;lt;/span&amp;gt; has taken over.&lt;br /&gt;
&lt;br /&gt;
If you look at the windows running the ping flood, both &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt; should show nearly the same number of lost packets;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
PING an-node02 (10.20.0.2) 56(84) bytes of data.&lt;br /&gt;
........................&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The failure of the link was successful!&lt;br /&gt;
&lt;br /&gt;
=== Recovering The First Interface ===&lt;br /&gt;
&lt;br /&gt;
Surviving failure is only half the test. We also need to test the recovery of the interface. When ready, reconnect &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth0&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The first thing you should notice is in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;&#039;s syslog;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Dec 13 14:06:40 an-node01 kernel: e1000e: eth0 NIC Link is Up 1000 Mbps Full Duplex, Flow Control: Rx/Tx&lt;br /&gt;
Dec 13 14:06:40 an-node01 kernel: bonding: bond0: link status up for interface eth0, enabling it in 120000 ms.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The bond will still be using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth3&amp;lt;/span&amp;gt;, so lets wait two minutes.&lt;br /&gt;
&lt;br /&gt;
After the two minutes, you should see the following addition syslog entries.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Dec 13 14:08:40 an-node01 kernel: bond0: link status definitely up for interface eth0, 1000 Mbps full duplex.&lt;br /&gt;
Dec 13 14:08:40 an-node01 kernel: bonding: bond0: making interface eth0 the new active one.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If we go back to the bond status file, we&#039;ll see that the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth0&amp;lt;/span&amp;gt; interface has been restored.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cat /proc/net/bonding/bond0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Ethernet Channel Bonding Driver: v3.6.0 (September 26, 2009)&lt;br /&gt;
&lt;br /&gt;
Bonding Mode: fault-tolerance (active-backup)&lt;br /&gt;
Primary Slave: eth0 (primary_reselect always)&lt;br /&gt;
Currently Active Slave: eth0&lt;br /&gt;
MII Status: up&lt;br /&gt;
MII Polling Interval (ms): 100&lt;br /&gt;
Up Delay (ms): 120000&lt;br /&gt;
Down Delay (ms): 0&lt;br /&gt;
&lt;br /&gt;
Slave Interface: eth0&lt;br /&gt;
MII Status: up&lt;br /&gt;
Link Failure Count: 1&lt;br /&gt;
Permanent HW addr: 00:e0:81:c7:ec:49&lt;br /&gt;
Slave queue ID: 0&lt;br /&gt;
&lt;br /&gt;
Slave Interface: eth3&lt;br /&gt;
MII Status: up&lt;br /&gt;
Link Failure Count: 0&lt;br /&gt;
Permanent HW addr: 00:1b:21:9d:59:fc&lt;br /&gt;
Slave queue ID: 0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that the only difference from before is that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth0&amp;lt;/span&amp;gt;&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Link Failure Count&amp;lt;/span&amp;gt; has been incremented to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The test has passed!&lt;br /&gt;
&lt;br /&gt;
Now repeat the test for the other two bonds, then for all three bonds on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt;. Remember to also repeat each test, but pull the backup interface before the 2 minutes delays has completed. The primary interface should immediately take over again. This will confirm that failover for the backup link is also working properly.&lt;br /&gt;
&lt;br /&gt;
=== Failing The First Switch ===&lt;br /&gt;
&lt;br /&gt;
{{note|1=Make sure that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt; is running before beginning the test! The real test is less about the failure and recovery of the network itself and more about whether it fails and recovers in such a way that the cluster stays up and no partitioning occurs.}}&lt;br /&gt;
&lt;br /&gt;
Check that all bonds on both nodes are using their primary interfaces. Confirm your cabling to ensure that these are all routed to the primary switch and that all backup links are cabled into the backup switch. Once done, pull the power to the primary switch. Both nodes should show similar output in their syslog windows;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Dec 13 14:16:17 an-node01 kernel: e1000e: eth2 NIC Link is Down&lt;br /&gt;
Dec 13 14:16:17 an-node01 kernel: e1000e: eth0 NIC Link is Down&lt;br /&gt;
Dec 13 14:16:17 an-node01 kernel: bonding: bond0: link status definitely down for interface eth0, disabling it&lt;br /&gt;
Dec 13 14:16:17 an-node01 kernel: bonding: bond0: making interface eth3 the new active one.&lt;br /&gt;
Dec 13 14:16:17 an-node01 kernel: bonding: bond2: link status definitely down for interface eth2, disabling it&lt;br /&gt;
Dec 13 14:16:17 an-node01 kernel: bonding: bond2: making interface eth5 the new active one.&lt;br /&gt;
Dec 13 14:16:17 an-node01 kernel: device eth2 left promiscuous mode&lt;br /&gt;
Dec 13 14:16:17 an-node01 kernel: device eth5 entered promiscuous mode&lt;br /&gt;
Dec 13 14:16:17 an-node01 kernel: e1000e: eth1 NIC Link is Down&lt;br /&gt;
Dec 13 14:16:18 an-node01 kernel: bonding: bond1: link status definitely down for interface eth1, disabling it&lt;br /&gt;
Dec 13 14:16:18 an-node01 kernel: bonding: bond1: making interface eth4 the new active one.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I can look at &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/proc/net/bonding/bond0&amp;lt;/span&amp;gt; file and see:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cat /proc/net/bonding/bond0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Ethernet Channel Bonding Driver: v3.6.0 (September 26, 2009)&lt;br /&gt;
&lt;br /&gt;
Bonding Mode: fault-tolerance (active-backup)&lt;br /&gt;
Primary Slave: eth0 (primary_reselect always)&lt;br /&gt;
Currently Active Slave: eth3&lt;br /&gt;
MII Status: up&lt;br /&gt;
MII Polling Interval (ms): 100&lt;br /&gt;
Up Delay (ms): 120000&lt;br /&gt;
Down Delay (ms): 0&lt;br /&gt;
&lt;br /&gt;
Slave Interface: eth0&lt;br /&gt;
MII Status: down&lt;br /&gt;
Link Failure Count: 3&lt;br /&gt;
Permanent HW addr: 00:e0:81:c7:ec:49&lt;br /&gt;
Slave queue ID: 0&lt;br /&gt;
&lt;br /&gt;
Slave Interface: eth3&lt;br /&gt;
MII Status: up&lt;br /&gt;
Link Failure Count: 2&lt;br /&gt;
Permanent HW addr: 00:1b:21:9d:59:fc&lt;br /&gt;
Slave queue ID: 0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Notice &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Currently Active Slave&amp;lt;/span&amp;gt; is now &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth3&amp;lt;/span&amp;gt;? You can also see now that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth0&amp;lt;/span&amp;gt;&#039;s link is down (&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;MII Status: down&amp;lt;/span&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
It should be the same story for all the other bonds on both nodes. &lt;br /&gt;
&lt;br /&gt;
If we check the status of the cluster, we&#039;ll see that all is good.&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: 7&lt;br /&gt;
Cluster Name: an-cluster-A&lt;br /&gt;
Cluster Id: 24561&lt;br /&gt;
Cluster Member: Yes&lt;br /&gt;
Cluster Generation: 40&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;
Node votes: 1&lt;br /&gt;
Quorum: 1  &lt;br /&gt;
Active subsystems: 7&lt;br /&gt;
Flags: 2node &lt;br /&gt;
Ports Bound: 0  &lt;br /&gt;
Node name: an-node01.alteeve.com&lt;br /&gt;
Node ID: 1&lt;br /&gt;
Multicast addresses: 239.192.95.81 &lt;br /&gt;
Node addresses: 10.20.0.1 &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Success! We just failed the primary switch without any interruption of clustered services.&lt;br /&gt;
&lt;br /&gt;
We&#039;re not out of the woods yet, though...&lt;br /&gt;
&lt;br /&gt;
=== Restoring The First Switch ===&lt;br /&gt;
&lt;br /&gt;
Now that we&#039;ve confirmed all of the bonds are working on the backup switch, lets restore power to the first switch.&lt;br /&gt;
&lt;br /&gt;
{{warning|1=Be sure to wait five minutes after restoring power before declaring the recovery a success! Some configuration faults will take a few minutes to appear.}}&lt;br /&gt;
&lt;br /&gt;
It is very important to wait for a while after restoring power to the switch. Some of the common problems that can break your cluster will not show up immediately. A good example is a misconfiguration of [[STP]]. In this case, the switch will come up, a short time will pass and then the switch will trigger an STP reconfiguration. Once this happens, both switches will block traffic for many seconds. This will partition you cluster.&lt;br /&gt;
&lt;br /&gt;
So then, lets power it back up.&lt;br /&gt;
&lt;br /&gt;
Within a few moments, you should see this in your syslog;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Dec 13 14:19:30 an-node01 kernel: e1000e: eth0 NIC Link is Up 1000 Mbps Full Duplex, Flow Control: Rx/Tx&lt;br /&gt;
Dec 13 14:19:30 an-node01 kernel: bonding: bond0: link status up for interface eth0, enabling it in 120000 ms.&lt;br /&gt;
Dec 13 14:19:30 an-node01 kernel: e1000e: eth2 NIC Link is Up 1000 Mbps Full Duplex, Flow Control: Rx/Tx&lt;br /&gt;
Dec 13 14:19:30 an-node01 kernel: e1000e: eth1 NIC Link is Up 1000 Mbps Full Duplex, Flow Control: Rx/Tx&lt;br /&gt;
Dec 13 14:19:30 an-node01 kernel: bonding: bond2: link status up for interface eth2, enabling it in 120000 ms.&lt;br /&gt;
Dec 13 14:19:30 an-node01 kernel: bonding: bond1: link status up for interface eth1, enabling it in 120000 ms.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As with the individual link test, the backup interfaces will remain in use for two minutes. This is critical because &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;miimon&amp;lt;/span&amp;gt; has detected the connection to the switches, but the switches are still a long way from being able to route traffic. After the two minutes, we&#039;ll see the primary interfaces return to active state.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Dec 13 14:20:25 an-node01 kernel: e1000e: eth0 NIC Link is Down&lt;br /&gt;
Dec 13 14:20:25 an-node01 kernel: bonding: bond0: link status down again after 55000 ms for interface eth0.&lt;br /&gt;
Dec 13 14:20:26 an-node01 kernel: e1000e: eth1 NIC Link is Down&lt;br /&gt;
Dec 13 14:20:26 an-node01 kernel: bonding: bond1: link status down again after 55800 ms for interface eth1.&lt;br /&gt;
Dec 13 14:20:27 an-node01 kernel: e1000e: eth2 NIC Link is Down&lt;br /&gt;
Dec 13 14:20:27 an-node01 kernel: bonding: bond2: link status down again after 56800 ms for interface eth2.&lt;br /&gt;
Dec 13 14:20:27 an-node01 kernel: e1000e: eth0 NIC Link is Up 1000 Mbps Full Duplex, Flow Control: Rx/Tx&lt;br /&gt;
Dec 13 14:20:27 an-node01 kernel: bonding: bond0: link status up for interface eth0, enabling it in 120000 ms.&lt;br /&gt;
Dec 13 14:20:28 an-node01 kernel: e1000e: eth1 NIC Link is Up 1000 Mbps Full Duplex, Flow Control: Rx/Tx&lt;br /&gt;
Dec 13 14:20:28 an-node01 kernel: bonding: bond1: link status up for interface eth1, enabling it in 120000 ms.&lt;br /&gt;
Dec 13 14:20:29 an-node01 kernel: e1000e: eth2 NIC Link is Up 1000 Mbps Full Duplex, Flow Control: Rx/Tx&lt;br /&gt;
Dec 13 14:20:29 an-node01 kernel: bonding: bond2: link status up for interface eth2, enabling it in 120000 ms.&lt;br /&gt;
Dec 13 14:20:31 an-node01 kernel: e1000e: eth0 NIC Link is Down&lt;br /&gt;
Dec 13 14:20:31 an-node01 kernel: bonding: bond0: link status down again after 3500 ms for interface eth0.&lt;br /&gt;
Dec 13 14:20:32 an-node01 kernel: e1000e: eth1 NIC Link is Down&lt;br /&gt;
Dec 13 14:20:32 an-node01 kernel: bonding: bond1: link status down again after 4100 ms for interface eth1.&lt;br /&gt;
Dec 13 14:20:32 an-node01 kernel: e1000e: eth2 NIC Link is Down&lt;br /&gt;
Dec 13 14:20:32 an-node01 kernel: bonding: bond2: link status down again after 3500 ms for interface eth2.&lt;br /&gt;
Dec 13 14:20:33 an-node01 kernel: e1000e: eth0 NIC Link is Up 1000 Mbps Full Duplex, Flow Control: Rx/Tx&lt;br /&gt;
Dec 13 14:20:33 an-node01 kernel: bonding: bond0: link status up for interface eth0, enabling it in 120000 ms.&lt;br /&gt;
Dec 13 14:20:34 an-node01 kernel: e1000e: eth1 NIC Link is Up 1000 Mbps Full Duplex, Flow Control: Rx/Tx&lt;br /&gt;
Dec 13 14:20:34 an-node01 kernel: bonding: bond1: link status up for interface eth1, enabling it in 120000 ms.&lt;br /&gt;
Dec 13 14:20:35 an-node01 kernel: e1000e: eth2 NIC Link is Up 1000 Mbps Full Duplex, Flow Control: Rx/Tx&lt;br /&gt;
Dec 13 14:20:35 an-node01 kernel: bonding: bond2: link status up for interface eth2, enabling it in 120000 ms.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
See all that bouncing? That is caused by many switches showing a link (that is the [[MII]] status) without actually being able to push traffic. As part of the switches boot sequence, the links will go down and come back up a couple of times. The 2 minute counter will reset with each bounce, so the recovery time is actually quite a bit longer than two minutes. This is fine, no need to rush back to the first switch.&lt;br /&gt;
&lt;br /&gt;
Note that you will not see this bouncing on switches that hold back on [[MII]] status until finished booting.&lt;br /&gt;
&lt;br /&gt;
After a few minutes, the old interfaces will actually be restored.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Dec 13 14:22:33 an-node01 kernel: bond0: link status definitely up for interface eth0, 1000 Mbps full duplex.&lt;br /&gt;
Dec 13 14:22:33 an-node01 kernel: bonding: bond0: making interface eth0 the new active one.&lt;br /&gt;
Dec 13 14:22:34 an-node01 kernel: bond1: link status definitely up for interface eth1, 1000 Mbps full duplex.&lt;br /&gt;
Dec 13 14:22:34 an-node01 kernel: bonding: bond1: making interface eth1 the new active one.&lt;br /&gt;
Dec 13 14:22:35 an-node01 kernel: bond2: link status definitely up for interface eth2, 1000 Mbps full duplex.&lt;br /&gt;
Dec 13 14:22:35 an-node01 kernel: bonding: bond2: making interface eth2 the new active one.&lt;br /&gt;
Dec 13 14:22:35 an-node01 kernel: device eth5 left promiscuous mode&lt;br /&gt;
Dec 13 14:22:35 an-node01 kernel: device eth2 entered promiscuous mode&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Complete success!&lt;br /&gt;
&lt;br /&gt;
{{warning|1=It is worth restating the importance of spreading your two fence methods across two switches. If both your PDU(s) and you IPMI (or iLO, etc) interfaces all run through one switch, that switch becomes a single point of failure. Generally, I run the IPMI/iLO/etc fence devices on the primary switch and the PDU(s) on the secondary switch.}}&lt;br /&gt;
&lt;br /&gt;
=== Failing The Secondary Switch ===&lt;br /&gt;
&lt;br /&gt;
Before we can say that everything is perfect, we need to test failing and recovering the secondary switch. The main purpose of this test is to ensure that there are no problems caused when the secondary switch restarts.&lt;br /&gt;
&lt;br /&gt;
To fail the switch, as we did with the primary switch, simply cut its power. We should see the following in both node&#039;s syslog;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Dec 13 14:30:57 an-node01 kernel: e1000e: eth3 NIC Link is Down&lt;br /&gt;
Dec 13 14:30:57 an-node01 kernel: bonding: bond0: link status definitely down for interface eth3, disabling it&lt;br /&gt;
Dec 13 14:30:58 an-node01 kernel: e1000e: eth4 NIC Link is Down&lt;br /&gt;
Dec 13 14:30:58 an-node01 kernel: e1000e: eth5 NIC Link is Down&lt;br /&gt;
Dec 13 14:30:58 an-node01 kernel: bonding: bond1: link status definitely down for interface eth4, disabling it&lt;br /&gt;
Dec 13 14:30:58 an-node01 kernel: bonding: bond2: link status definitely down for interface eth5, disabling it&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Let&#039;s take a look at &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;bond0&amp;lt;/span&amp;gt; status file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cat /proc/net/bonding/bond0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Ethernet Channel Bonding Driver: v3.6.0 (September 26, 2009)&lt;br /&gt;
&lt;br /&gt;
Bonding Mode: fault-tolerance (active-backup)&lt;br /&gt;
Primary Slave: eth0 (primary_reselect always)&lt;br /&gt;
Currently Active Slave: eth0&lt;br /&gt;
MII Status: up&lt;br /&gt;
MII Polling Interval (ms): 100&lt;br /&gt;
Up Delay (ms): 120000&lt;br /&gt;
Down Delay (ms): 0&lt;br /&gt;
&lt;br /&gt;
Slave Interface: eth0&lt;br /&gt;
MII Status: up&lt;br /&gt;
Link Failure Count: 3&lt;br /&gt;
Permanent HW addr: 00:e0:81:c7:ec:49&lt;br /&gt;
Slave queue ID: 0&lt;br /&gt;
&lt;br /&gt;
Slave Interface: eth3&lt;br /&gt;
MII Status: down&lt;br /&gt;
Link Failure Count: 3&lt;br /&gt;
Permanent HW addr: 00:1b:21:9d:59:fc&lt;br /&gt;
Slave queue ID: 0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;eth3&amp;lt;/span&amp;gt; interface is shown as &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;down&amp;lt;/span&amp;gt;. There should have been no dropped packets in the ping-flood window at all.&lt;br /&gt;
&lt;br /&gt;
=== Restoring The Second Switch ===&lt;br /&gt;
&lt;br /&gt;
When the power is restored to the switch, we&#039;ll see the same &amp;quot;bouncing&amp;quot; as the switch goes through its startup process. Notice that the backup link also remains listed as &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;down&amp;lt;/span&amp;gt; for 2 minutes, despite the interface not being used by the bonded interface.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Dec 13 14:33:36 an-node01 kernel: e1000e: eth4 NIC Link is Up 1000 Mbps Full Duplex, Flow Control: Rx/Tx&lt;br /&gt;
Dec 13 14:33:36 an-node01 kernel: e1000e: eth5 NIC Link is Up 1000 Mbps Full Duplex, Flow Control: Rx/Tx&lt;br /&gt;
Dec 13 14:33:36 an-node01 kernel: bonding: bond1: link status up for interface eth4, enabling it in 120000 ms.&lt;br /&gt;
Dec 13 14:33:36 an-node01 kernel: bonding: bond2: link status up for interface eth5, enabling it in 120000 ms.&lt;br /&gt;
Dec 13 14:33:37 an-node01 kernel: e1000e: eth3 NIC Link is Up 1000 Mbps Full Duplex, Flow Control: Rx/Tx&lt;br /&gt;
Dec 13 14:33:37 an-node01 kernel: bonding: bond0: link status up for interface eth3, enabling it in 120000 ms.&lt;br /&gt;
Dec 13 14:34:34 an-node01 kernel: e1000e: eth5 NIC Link is Down&lt;br /&gt;
Dec 13 14:34:34 an-node01 kernel: bonding: bond2: link status down again after 58000 ms for interface eth5.&lt;br /&gt;
Dec 13 14:34:36 an-node01 kernel: e1000e: eth5 NIC Link is Up 1000 Mbps Full Duplex, Flow Control: Rx/Tx&lt;br /&gt;
Dec 13 14:34:36 an-node01 kernel: bonding: bond2: link status up for interface eth5, enabling it in 120000 ms.&lt;br /&gt;
Dec 13 14:34:38 an-node01 kernel: e1000e: eth5 NIC Link is Down&lt;br /&gt;
Dec 13 14:34:38 an-node01 kernel: bonding: bond2: link status down again after 2000 ms for interface eth5.&lt;br /&gt;
Dec 13 14:34:40 an-node01 kernel: e1000e: eth5 NIC Link is Up 1000 Mbps Full Duplex, Flow Control: None&lt;br /&gt;
Dec 13 14:34:40 an-node01 kernel: bonding: bond2: link status up for interface eth5, enabling it in 120000 ms.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After two minutes from the last bound, we&#039;ll see the backup interfaces return to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;up&amp;lt;/span&amp;gt; state in the bond&#039;s status file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Dec 13 14:35:36 an-node01 kernel: bond1: link status definitely up for interface eth4, 1000 Mbps full duplex.&lt;br /&gt;
Dec 13 14:35:37 an-node01 kernel: bond0: link status definitely up for interface eth3, 1000 Mbps full duplex.&lt;br /&gt;
Dec 13 14:36:40 an-node01 kernel: bond2: link status definitely up for interface eth5, 1000 Mbps full duplex.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After a full five minutes, the cluster and the network remain stable. We can officially declare our network to be fully highly available!&lt;br /&gt;
&lt;br /&gt;
= Installing DRBD =&lt;br /&gt;
&lt;br /&gt;
DRBD is an open-source application for real-time, block-level disk replication created and maintained by [http://linbit.com Linbit]. We will use this to keep the data on our cluster consistent between the two nodes.&lt;br /&gt;
&lt;br /&gt;
To install it, we have three choices;&lt;br /&gt;
# Purchase a Red Hat blessed, fully supported copy from [http://linbit.com Linbit].&lt;br /&gt;
# Install from the freely available, community maintained [http://elrepo.org/tiki/tiki-index.php ELRepo] repository.&lt;br /&gt;
# Install from source files.&lt;br /&gt;
&lt;br /&gt;
We will be using the 8.3.x version of DRBD. This tracts the Red Hat and Linbit supported versions, providing the most tested combination and providing a painless path to move to a fully supported version, should you decide to do so down the road.&lt;br /&gt;
&lt;br /&gt;
== Option 1 - Fully Supported by Red Hat and Linbit ==&lt;br /&gt;
&lt;br /&gt;
Red Hat decided to no longer directly support [[DRBD]] in [[EL6]] to narrow down what applications they shipped and focus on improving those components. Given the popularity of DRBD, however, Red Hat struck a deal with [[Linbit]], the authors and maintainers of DRBD. You have the option of purchasing a fully supported version of DRBD that is blessed by Red Hat for use under Red Hat Enterprise Linux 6.&lt;br /&gt;
&lt;br /&gt;
If you are building a fully supported cluster, please [http://www.linbit.com/en/products-services/drbd/drbd-for-high-availability/ contact Linbit] to purchase DRBD. Once done, you will get an email with you login information and, most importantly here, the [[URL]] hash needed to access the official repositories.&lt;br /&gt;
&lt;br /&gt;
First you will need to add an entry in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/yum.repo.d/&amp;lt;/span&amp;gt; for DRBD, but this needs to be hand-crafted as you must specify the URL hash given to you in the email as part of the repo configuration.&lt;br /&gt;
&lt;br /&gt;
* Log into the [https://my.linbit.com Linbit portal].&lt;br /&gt;
* Click on &#039;&#039;Account&#039;&#039;.&lt;br /&gt;
* Under &#039;&#039;Your account details&#039;&#039;, click on the hash string to the right of &#039;&#039;URL hash:&#039;&#039;.&lt;br /&gt;
* Click on &#039;&#039;RHEL 6&#039;&#039; (even if you are using CentOS or another [[EL6]] distro.&lt;br /&gt;
&lt;br /&gt;
This will take you to a new page called &#039;&#039;Instructions for using the DRBD package repository&#039;&#039;. The details installation instruction are found here.&lt;br /&gt;
&lt;br /&gt;
Lets use the imaginative URL hash of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;abcdefghijklmnopqrstuvwxyz0123456789ABCD&amp;lt;/span&amp;gt; and we&#039;re are in fact using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;x86_64&amp;lt;/span&amp;gt; architecture. Given this, we would create the following repository configuration file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/yum.repos.d/linbit.repo&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
[drbd-8]&lt;br /&gt;
name=DRBD 8&lt;br /&gt;
baseurl=http://packages.linbit.com/abcdefghijklmnopqrstuvwxyz0123456789ABCD/rhel6/x86_64&lt;br /&gt;
gpgcheck=0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once this is saved, you can install DRBD using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;yum&amp;lt;/span&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install drbd kmod-drbd&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Done!&lt;br /&gt;
&lt;br /&gt;
== Option 2 - Install From ELRepo ==&lt;br /&gt;
&lt;br /&gt;
[http://elrepo.org ELRepo] is a community-maintained repository of packages for &#039;&#039;&#039;E&#039;&#039;&#039;nterprise &#039;&#039;&#039;L&#039;&#039;&#039;inux; Red Hat Enterprise Linux and its derivatives like CentOS. This is the easiest option for a freely available DRBD package.&lt;br /&gt;
&lt;br /&gt;
The main concern with this option is that you are seceding control of DRBD to a community-controlled project. This is a trusted repo, but there are still undeniable security concerns. &lt;br /&gt;
&lt;br /&gt;
Check for the latest installation RPM and information;&lt;br /&gt;
* [http://elrepo.org ELRepo Installation Page]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# Install the ELRepo GPG key, add the repo and install DRBD.&lt;br /&gt;
rpm --import http://elrepo.org/RPM-GPG-KEY-elrepo.org&lt;br /&gt;
rpm -Uvh http://elrepo.org/elrepo-release-6-4.el6.elrepo.noarch.rpm&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Retrieving http://elrepo.org/elrepo-release-6-4.el6.elrepo.noarch.rpm&lt;br /&gt;
Preparing...                ########################################### [100%]&lt;br /&gt;
   1:elrepo-release         ########################################### [100%]&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;
yum install drbd83-utils kmod-drbd83&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is the method used for this tutorial.&lt;br /&gt;
&lt;br /&gt;
== Option 3 - Install From Source ==&lt;br /&gt;
&lt;br /&gt;
If you do not wish to pay for access to the official DRBD repository and do not feel comfortable adding a public repository, your last option is to install from Linbit&#039;s source code. The benefit of this is that you can vet the source before installing it, making it a more secure option. The downside is that you will need to manually install updates and security fixes as they are made available.&lt;br /&gt;
&lt;br /&gt;
On &#039;&#039;&#039;Both&#039;&#039;&#039; nodes run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# Download, compile and install DRBD&lt;br /&gt;
yum install flex gcc make kernel-devel&lt;br /&gt;
wget -c http://oss.linbit.com/drbd/8.3/drbd-8.3.12.tar.gz&lt;br /&gt;
tar -xvzf drbd-8.3.12.tar.gz&lt;br /&gt;
cd drbd-8.3.12&lt;br /&gt;
./configure \&lt;br /&gt;
   --prefix=/usr \&lt;br /&gt;
   --localstatedir=/var \&lt;br /&gt;
   --sysconfdir=/etc \&lt;br /&gt;
   --with-utils \&lt;br /&gt;
   --with-km \&lt;br /&gt;
   --with-udev \&lt;br /&gt;
   --with-pacemaker \&lt;br /&gt;
   --with-rgmanager \&lt;br /&gt;
   --with-bashcompletion&lt;br /&gt;
make&lt;br /&gt;
make install&lt;br /&gt;
chkconfig --add drbd&lt;br /&gt;
chkconfig drbd off&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Hooking DRBD Into The Cluster&#039;s Fencing ===&lt;br /&gt;
&lt;br /&gt;
{{warning|1=This script has no delay built into it. In many cases, if the link between the DRBD resources fail, both nodes may fence simultaneously causing both nodes to shut down. If you add &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;sleep 10;&amp;lt;/span&amp;gt; to &#039;&#039;&#039;one&#039;&#039;&#039; of the nodes, then you can ensure that dual-fencing won&#039;t occur.}}&lt;br /&gt;
&lt;br /&gt;
We will use a script, written by [http://lon.fedorapeople.org/ Lon Hohberger] of Red Hat. This script will capture fence calls from DRBD and in turn calls the cluster&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fence_node&amp;lt;/span&amp;gt; against the opposing node. It this way, DRBD will avoid split-brain without the need to maintain two separate fence configurations.&lt;br /&gt;
&lt;br /&gt;
On &#039;&#039;&#039;Both&#039;&#039;&#039; nodes run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# Obliterate peer - fence via cman&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;
-rwxr-xr-x 1 root root 2.1K May  4  2011 /sbin/obliterate-peer.sh&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We&#039;ll configure DRBD to use this script shortly.&lt;br /&gt;
&lt;br /&gt;
==== Alternate Fence Handler; rhcs_fence ====&lt;br /&gt;
&lt;br /&gt;
{{note|1=Caveat: The author of this tutorial is also the author of this script.}}&lt;br /&gt;
&lt;br /&gt;
A new fence handler which ties DRBD into RHCS is now available called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rhcs_fence&amp;lt;/span&amp;gt; with the goal of replacing &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;obliterate-peer.sh&amp;lt;/span&amp;gt;. It aims to extend Lon&#039;s script, which hasn&#039;t been actively developed in some time.&lt;br /&gt;
&lt;br /&gt;
This agent has had minimal testing, so please test thoroughly when using it. &lt;br /&gt;
&lt;br /&gt;
This agent addresses the simultaneous fencing issue by automatically adding a delay to the fence call based on the host node&#039;s ID number, with the node having ID of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt; having no delay at all. It is also a little more elegant about how it handles the actual fence call with the goal of being more reliable when a fence action takes longer than usual to complete.&lt;br /&gt;
&lt;br /&gt;
To install it, run the following on both nodes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
wget -c https://raw.github.com/digimer/rhcs_fence/master/rhcs_fence &lt;br /&gt;
chmod 755 rhcs_fence&lt;br /&gt;
mv rhcs_fence /usr/sbin/&lt;br /&gt;
ls -lah /usr/sbin/rhcs_fence &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
-rwxr-xr-x 1 root root 15K Jan 24 22:04 /usr/sbin/rhcs_fence&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== The &amp;quot;Why&amp;quot; of Our Layout ===&lt;br /&gt;
&lt;br /&gt;
We will be creating three separate DRBD resources. The reason for this is to minimize the chance of data loss in a [[split-brain]] event. &lt;br /&gt;
&lt;br /&gt;
We&#039;re going to take steps to ensure that a [[split-brain]] is exceedingly unlikely, but we always have to plan for the worst case scenario. The biggest concern with recovering from a split-brain is that, by necessity, one of the nodes will lose data. Further, there is no way to automate the recovery, as there is no clear way for DRBD to tell which node has the more valuable data.&lt;br /&gt;
&lt;br /&gt;
Consider this scenario;&lt;br /&gt;
* You have a two-node cluster running two VMs. One is a mirror for a project and the other is an accounting application. Node 1 hosts the mirror, Node 2 hosts the accounting application.&lt;br /&gt;
* A partition occurs and both nodes try to fence the other.&lt;br /&gt;
* Network access is lost, so both nodes fall back to fencing using PDUs.&lt;br /&gt;
* Both nodes have redundant power supplies, and at some point in time, the power cables on the second PDU got reversed.&lt;br /&gt;
* The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fence_apc_snmp&amp;lt;/span&amp;gt; agent succeeds, because the requested outlets were shut off. However, do to the cabling mistake, neither node actually shut down.&lt;br /&gt;
* Both nodes proceed to run independently, thinking they are the only node left.&lt;br /&gt;
* During this split-brain, the mirror VM downloads over a [[gigabyte]] of updates. Meanwhile, an hour earlier, the accountant updates the books, totalling less than one [[megabyte]] of changes.&lt;br /&gt;
&lt;br /&gt;
At this point, you will need to discard the changed on one of the nodes. So now you have to choose;&lt;br /&gt;
* Is the node with the most changes more valid?&lt;br /&gt;
* Is the node with the most recent changes more valid?&lt;br /&gt;
&lt;br /&gt;
Neither of these are true, as the node with the older data and smallest amount of changed data is the accounting data which is significantly more valuable.&lt;br /&gt;
&lt;br /&gt;
Now imagine that both VMs have equally valuable data. What then? Which side do you discard?&lt;br /&gt;
&lt;br /&gt;
The approach we will use is to create two separate DRBD resources. Then we will assign the VMs into two groups; VMs normally designed to run on one node will go one one resource while the VMs designed to normally run on the other resource will share the second resource. &lt;br /&gt;
&lt;br /&gt;
With all the VMs on a given resource running on the same DRBD resource, we can fairly easily decide which node to discard changes on, on a per-resource level.&lt;br /&gt;
&lt;br /&gt;
To summarize, we&#039;re going to create the following three resources;&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;r0&amp;lt;/span&amp;gt;; A small resource for the shared files formatted with [[GFS2]].&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;r1&amp;lt;/span&amp;gt;; This resource will back the VMs designed to primarily run on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;r2&amp;lt;/span&amp;gt;; This resource will back the VMs designed to primarily run on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Creating The Partitions For DRBD ==&lt;br /&gt;
&lt;br /&gt;
It is possible to use [[LVM]] on the hosts, and simply create [[LV]]s to back our DRBD resources. However, this causes confusion as LVM will see the [[PV]] signatures on both the DRBD backing devices and the DRBD device itself. Getting around this requires editing LVM&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;filter&amp;lt;/span&amp;gt; option, which is somewhat complicated. Not overly so, mind you, but enough to be outside the scope of this document. &lt;br /&gt;
&lt;br /&gt;
Also, by working with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fdisk&amp;lt;/span&amp;gt; directly, it will give us a chance to make sure that the DRBD partitions start on an even 64 [[KiB]] boundry. This is important for decent performance on Windows VMs, as we will see later. This is true for both traditional platter and modern solid-state drives.&lt;br /&gt;
&lt;br /&gt;
On our nodes, we created three primary disk partitions;&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/sda1&amp;lt;/span&amp;gt;; The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/boot&amp;lt;/span&amp;gt; partition.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/sda2&amp;lt;/span&amp;gt;; The root &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/&amp;lt;/span&amp;gt; partition.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/sda3&amp;lt;/span&amp;gt;; The swap partition.&lt;br /&gt;
&lt;br /&gt;
We will create a new extended partition. Then within it we will create three new partitions;&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/sda5&amp;lt;/span&amp;gt;; a small partition we will later use for our shared [[GFS2]] partition.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/sda6&amp;lt;/span&amp;gt;; a partition big enough to host the VMs that will normally run on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&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;; a partition big enough to host the VMs that will normally run on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
As we create each partition, we will do a little math to ensure that the start sector is on a 64 [[KiB]] boundry.&lt;br /&gt;
&lt;br /&gt;
=== Block Alignment ===&lt;br /&gt;
&lt;br /&gt;
For performance reasons, we want to ensure that the file systems created within a VM matches the block alignment of the underlying storage stack, clear down to the base partitions on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/sda&amp;lt;/span&amp;gt; (or what ever your lowest-level block device is).&lt;br /&gt;
&lt;br /&gt;
Imagine this misaligned scenario;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Note: Not to scale&lt;br /&gt;
                 ________________________________________________________________&lt;br /&gt;
VM File system  |~~~~~|_______|_______|_______|_______|_______|_______|_______|__&lt;br /&gt;
                |~~~~~|==========================================================&lt;br /&gt;
DRBD Partition  |~~~~~|_______|_______|_______|_______|_______|_______|_______|__&lt;br /&gt;
64 KiB block    |_______|_______|_______|_______|_______|_______|_______|_______|&lt;br /&gt;
512byte sectors |_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now, when the guest wants to write one block worth of data, it actually causes two blocks to be written, causing avoidable disk I/O.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Note: Not to scale&lt;br /&gt;
                 ________________________________________________________________&lt;br /&gt;
VM File system  |~~~~~~~|_______|_______|_______|_______|_______|_______|_______|&lt;br /&gt;
                |~~~~~~~|========================================================&lt;br /&gt;
DRBD Partition  |~~~~~~~|_______|_______|_______|_______|_______|_______|_______|&lt;br /&gt;
64 KiB block    |_______|_______|_______|_______|_______|_______|_______|_______|&lt;br /&gt;
512byte sectors |_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
By changing the start cylinder of our partitions to always start on 64 [[KiB]] boundaries, we&#039;re sure to keep the guest OS&#039;s file system in-line with the DRBD backing device&#039;s blocks. Thus, all reads and writes in the guest OS effect a matching number of real blocks, maximizing disk I/O efficiency.&lt;br /&gt;
&lt;br /&gt;
Thankfully, as we&#039;ll see in a moment, the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;parted&amp;lt;/span&amp;gt; program has a mode that will tell it to always optimally align partitions, so we won&#039;t need to do any crazy math.&lt;br /&gt;
&lt;br /&gt;
{{note|1=You will want to do this with [[SSD]] drives, too. It&#039;s true that the performance will remain about the same, but SSD drives have a limited number of write cycles, and aligning the blocks will minimize block writes.}}&lt;br /&gt;
&lt;br /&gt;
Special thanks to [http://xen.org/community/spotlight/pasi.html Pasi Kärkkäinen] for his patience in explaining to me the importance of disk alignment. He created two images which I used as templates for the [[ASCII]] art images above;&lt;br /&gt;
* [http://pasik.reaktio.net/virtual-disk-partitions-not-aligned.jpg Virtual Disk Partitions, Not aligned.]&lt;br /&gt;
* [http://pasik.reaktio.net/virtual-disk-partitions-aligned.jpg Virtual Disk Partitions, aligned.]&lt;br /&gt;
&lt;br /&gt;
=== Creating the DRBD Partitions ===&lt;br /&gt;
&lt;br /&gt;
Here I will show you the values I entered to create the three partitions I needed on my nodes. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;DO NOT DIRECTLY COPY THIS!&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The values you enter will almost certainly be different.&lt;br /&gt;
&lt;br /&gt;
We&#039;re going to use a program called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;parted&amp;lt;/span&amp;gt; to configure the disk &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/sda&amp;lt;/span&amp;gt;. Pay close attention to the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;-a optimal&amp;lt;/span&amp;gt; switch. This tells &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;parted&amp;lt;/span&amp;gt; to create new partitions with optimal block alignment, which is crucial for virtual machine performance.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
parted -a optimal /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;
GNU Parted 2.1&lt;br /&gt;
Using /dev/sda&lt;br /&gt;
Welcome to GNU Parted! Type &#039;help&#039; to view a list of commands.&lt;br /&gt;
(parted)                                                                  &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We&#039;re now in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;parted&amp;lt;/span&amp;gt; console. Before we start, let&#039;s take a look at the current disk configuration along with the amount of free space available.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
print free&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Model: ATA ST9500420ASG (scsi)&lt;br /&gt;
Disk /dev/sda: 500GB&lt;br /&gt;
Sector size (logical/physical): 512B/512B&lt;br /&gt;
Partition Table: msdos&lt;br /&gt;
&lt;br /&gt;
Number  Start   End     Size    Type     File system     Flags&lt;br /&gt;
        32.3kB  1049kB  1016kB           Free Space&lt;br /&gt;
 1      1049kB  269MB   268MB   primary  ext4            boot&lt;br /&gt;
 2      269MB   43.2GB  42.9GB  primary  ext4&lt;br /&gt;
 3      43.2GB  47.5GB  4295MB  primary  linux-swap(v1)&lt;br /&gt;
        47.5GB  500GB   453GB            Free Space&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Before we can create the three DRBD partition, we first need to create an [[extended partition|extended]] partition wherein which we will create the three [[logical partition|logical]] partitions. From the output above, we can see that the free space starts at &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;47.5GB&amp;lt;/span&amp;gt;, and that the drive ends at &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;500GB&amp;lt;/span&amp;gt;. Knowing this, we can now create the extended partition.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
mkpart extended 47.5GB 500GB&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Warning: WARNING: the kernel failed to re-read the partition table on /dev/sda&lt;br /&gt;
(Device or resource busy).  As a result, it may not reflect all of your changes&lt;br /&gt;
until after reboot.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Don&#039;t worry about that message, we will reboot when we finish.&lt;br /&gt;
&lt;br /&gt;
So now we can confirm that the new extended partition was create by again printing the partition table and the free space.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
print free&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Model: ATA ST9500420ASG (scsi)&lt;br /&gt;
Disk /dev/sda: 500GB&lt;br /&gt;
Sector size (logical/physical): 512B/512B&lt;br /&gt;
Partition Table: msdos&lt;br /&gt;
&lt;br /&gt;
Number  Start   End     Size    Type      File system     Flags&lt;br /&gt;
        32.3kB  1049kB  1016kB            Free Space&lt;br /&gt;
 1      1049kB  269MB   268MB   primary   ext4            boot&lt;br /&gt;
 2      269MB   43.2GB  42.9GB  primary   ext4&lt;br /&gt;
 3      43.2GB  47.5GB  4295MB  primary   linux-swap(v1)&lt;br /&gt;
 4      47.5GB  500GB   453GB   extended                  lba&lt;br /&gt;
        47.5GB  500GB   453GB             Free Space&lt;br /&gt;
        500GB   500GB   24.6kB            Free Space&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Perfect. So now we&#039;re going to create our three logical partitions. We&#039;re going to use the same start position as last time, but the end position will be 20 [[GiB]] further in.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
mkpart logical 47.5GB 67.5GB&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Warning: WARNING: the kernel failed to re-read the partition table on /dev/sda&lt;br /&gt;
(Device or resource busy).  As a result, it may not reflect all of your changes&lt;br /&gt;
until after reboot.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We&#039;ll check again to see the new partition layout.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
print free&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Model: ATA ST9500420ASG (scsi)&lt;br /&gt;
Disk /dev/sda: 500GB&lt;br /&gt;
Sector size (logical/physical): 512B/512B&lt;br /&gt;
Partition Table: msdos&lt;br /&gt;
&lt;br /&gt;
Number  Start   End     Size    Type      File system     Flags&lt;br /&gt;
        32.3kB  1049kB  1016kB            Free Space&lt;br /&gt;
 1      1049kB  269MB   268MB   primary   ext4            boot&lt;br /&gt;
 2      269MB   43.2GB  42.9GB  primary   ext4&lt;br /&gt;
 3      43.2GB  47.5GB  4295MB  primary   linux-swap(v1)&lt;br /&gt;
 4      47.5GB  500GB   453GB   extended                  lba&lt;br /&gt;
 5      47.5GB  67.5GB  20.0GB  logical&lt;br /&gt;
        67.5GB  500GB   433GB             Free Space&lt;br /&gt;
        500GB   500GB   24.6kB            Free Space&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Again, perfect. Now I have a total of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;433[[GB]]&amp;lt;/span&amp;gt; left free. How you carve this up for your VMs will depend entirely on what kind of VMs you plan to install and what their needs are. For me, I will divide the space evenly into to logical partitions of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;216.5GB&amp;lt;/span&amp;gt; (&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;433 / 2 = 216.5)&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The first partition will start at &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;67.5&amp;lt;/span&amp;gt; and end at &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;284GB&amp;lt;/span&amp;gt; (&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;67.5 + 216.5 = 284&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;
mkpart logical 67.5GB 284GB&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Warning: WARNING: the kernel failed to re-read the partition table on /dev/sda&lt;br /&gt;
(Device or resource busy).  As a result, it may not reflect all of your changes&lt;br /&gt;
until after reboot.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once again, lets look at the new partition table.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
print free&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Model: ATA ST9500420ASG (scsi)&lt;br /&gt;
Disk /dev/sda: 500GB&lt;br /&gt;
Sector size (logical/physical): 512B/512B&lt;br /&gt;
Partition Table: msdos&lt;br /&gt;
&lt;br /&gt;
Number  Start   End     Size    Type      File system     Flags&lt;br /&gt;
        32.3kB  1049kB  1016kB            Free Space&lt;br /&gt;
 1      1049kB  269MB   268MB   primary   ext4            boot&lt;br /&gt;
 2      269MB   43.2GB  42.9GB  primary   ext4&lt;br /&gt;
 3      43.2GB  47.5GB  4295MB  primary   linux-swap(v1)&lt;br /&gt;
 4      47.5GB  500GB   453GB   extended                  lba&lt;br /&gt;
 5      47.5GB  67.5GB  20.0GB  logical&lt;br /&gt;
 6      67.5GB  284GB   216GB   logical&lt;br /&gt;
        284GB   500GB   216GB             Free Space&lt;br /&gt;
        500GB   500GB   24.6kB            Free Space&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Finally, our last partition will start at &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;284GB&amp;lt;/span&amp;gt; and use the rest of the free space, ending at &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;500GB&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;
mkpart logical 284GB 500GB&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Warning: WARNING: the kernel failed to re-read the partition table on /dev/sda&lt;br /&gt;
(Device or resource busy).  As a result, it may not reflect all of your changes&lt;br /&gt;
until after reboot.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
One last time, let&#039;s look at the partition table.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
print free&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Model: ATA ST9500420ASG (scsi)&lt;br /&gt;
Disk /dev/sda: 500GB&lt;br /&gt;
Sector size (logical/physical): 512B/512B&lt;br /&gt;
Partition Table: msdos&lt;br /&gt;
&lt;br /&gt;
Number  Start   End     Size    Type      File system     Flags&lt;br /&gt;
        32.3kB  1049kB  1016kB            Free Space&lt;br /&gt;
 1      1049kB  269MB   268MB   primary   ext4            boot&lt;br /&gt;
 2      269MB   43.2GB  42.9GB  primary   ext4&lt;br /&gt;
 3      43.2GB  47.5GB  4295MB  primary   linux-swap(v1)&lt;br /&gt;
 4      47.5GB  500GB   453GB   extended                  lba&lt;br /&gt;
 5      47.5GB  67.5GB  20.0GB  logical&lt;br /&gt;
 6      67.5GB  284GB   216GB   logical&lt;br /&gt;
 7      284GB   500GB   216GB   logical&lt;br /&gt;
        500GB   500GB   24.6kB            Free Space&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Just as we asked for. Before we finish though, let&#039;s be extra careful and do a manual check of our three partitions to ensure that they are, in fact, aligned optimally. There will be no output from the following commands if the partitions are aligned.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
(parted) align-check opt 5&lt;br /&gt;
(parted) align-check opt 6&lt;br /&gt;
(parted) align-check opt 7&lt;br /&gt;
(parted)                                                                  &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Excellent! We can now exit.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
quit&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Information: You may need to update /etc/fstab.                           &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we need to reboot to make the kernel see the new partition table.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
reboot&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Done! Do this for both nodes, then proceed.&lt;br /&gt;
&lt;br /&gt;
== Configuring DRBD ==&lt;br /&gt;
&lt;br /&gt;
DRBD is configured in two parts;&lt;br /&gt;
&lt;br /&gt;
* Global and common configuration options&lt;br /&gt;
* Resource configurations&lt;br /&gt;
&lt;br /&gt;
We will be creating three separate DRBD resources, so we will create three separate resource configuration files. More on that in a moment.&lt;br /&gt;
&lt;br /&gt;
=== Configuring DRBD Global and Common Options ===&lt;br /&gt;
&lt;br /&gt;
The first file to edit is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/drbd.d/global_common.conf&amp;lt;/span&amp;gt;. In this file, we will set global configuration options and set default resource configuration options. These default resource options can be overwritten in the actual resource files which we&#039;ll create once we&#039;re done here.&lt;br /&gt;
&lt;br /&gt;
I&#039;ll explain the values we&#039;re setting here, and we&#039;ll put the explanation of each option in the file itself, as it will be useful to have them should you need to alter the files sometime in the future.&lt;br /&gt;
&lt;br /&gt;
The first addition is in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;handlers { }&amp;lt;/span&amp;gt; directive. We&#039;re going to add the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fence-peer&amp;lt;/span&amp;gt; option and configure it to use the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;obliterate-peer.sh&amp;lt;/span&amp;gt; script we spoke about earlier in the DRBD section.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/drbd.d/global_common.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;
	handlers {&lt;br /&gt;
		# This script is a wrapper for RHCS&#039;s &#039;fence_node&#039; command line&lt;br /&gt;
		# tool. It will call a fence against the other node and return&lt;br /&gt;
		# the appropriate exit code to DRBD.&lt;br /&gt;
		fence-peer		&amp;quot;/sbin/obliterate-peer.sh&amp;quot;;&lt;br /&gt;
	}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{note|1=If you used the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rhcs_fence&amp;lt;/span&amp;gt; handler, use &#039;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fence-peer		&amp;quot;/usr/sbin/rhcs_fence&amp;quot;;&amp;lt;/span&amp;gt;&#039;.}}&lt;br /&gt;
&lt;br /&gt;
We&#039;re going to add three options to the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;startup { }&amp;lt;/span&amp;gt; directive; We&#039;re going to tell DRBD to make both nodes &amp;quot;primary&amp;quot; on start, to wait five minutes on start for its peer to connect and, if the peer never connected last time, to wait onto two minutes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
	startup {&lt;br /&gt;
		# This tells DRBD to promote both nodes to Primary on start.&lt;br /&gt;
		become-primary-on	both;&lt;br /&gt;
&lt;br /&gt;
		# This tells DRBD to wait five minutes for the other node to&lt;br /&gt;
		# connect. This should be longer than it takes for cman to&lt;br /&gt;
		# timeout and fence the other node *plus* the amount of time it&lt;br /&gt;
		# takes the other node to reboot. If you set this too short,&lt;br /&gt;
		# you could corrupt your data. If you want to be extra safe, do&lt;br /&gt;
		# not use this at all and DRBD will wait for the other node&lt;br /&gt;
		# forever.&lt;br /&gt;
		wfc-timeout		300;&lt;br /&gt;
&lt;br /&gt;
		# This tells DRBD to wait for the other node for three minutes&lt;br /&gt;
		# if the other node was degraded the last time it was seen by&lt;br /&gt;
		# this node. This is a way to speed up the boot process when&lt;br /&gt;
		# the other node is out of commission for an extended duration.&lt;br /&gt;
		degr-wfc-timeout	120;&lt;br /&gt;
	}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;disk { }&amp;lt;/span&amp;gt; directive, we&#039;re going to configure DRBD&#039;s behaviour when a [[split-brain]] is detected. By setting &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fencing&amp;lt;/span&amp;gt; to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;resource-and-stonith&amp;lt;/span&amp;gt;, we&#039;re telling DRBD to stop all disk access and call a fence against its peer node rather than proceeding.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
	disk {&lt;br /&gt;
		# This tells DRBD to block IO and fence the remote node (using&lt;br /&gt;
		# the &#039;fence-peer&#039; helper) when connection with the other node&lt;br /&gt;
		# is unexpectedly lost. This is what helps prevent split-brain&lt;br /&gt;
		# condition and it is incredible important in dual-primary&lt;br /&gt;
		# setups!&lt;br /&gt;
		fencing			resource-and-stonith;&lt;br /&gt;
	}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;net { }&amp;lt;/span&amp;gt; directive, we&#039;re going to tell DRBD that it is allowed to run in dual-primary mode and we&#039;re going to configure how it behaves if a split-brain has occurred, despite our best efforts. The recovery (or lack there of) requires three options; What to do when neither node had been primary (&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;after-sb-0pri&amp;lt;/span&amp;gt;), what to do if only one node had been primary (&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;after-sb-1pri&amp;lt;/span&amp;gt;) and finally, what to do if both nodes had been primary (&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;after-sb-2pri&amp;lt;/span&amp;gt;), as will most likely be the case for us. This last instance will be configured to tell DRBD just to drop the connection, which will require human intervention to correct.&lt;br /&gt;
&lt;br /&gt;
At this point, you might be wondering why we won&#039;t simply run Primary/Secondary. The reason is because of live-migration. When we push a VM across to the backup node, there is a short period of time where both nodes need to be writeable. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
	net {&lt;br /&gt;
		# This tells DRBD to allow two nodes to be Primary at the same&lt;br /&gt;
		# time. It is needed when &#039;become-primary-on both&#039; is set.&lt;br /&gt;
		allow-two-primaries;&lt;br /&gt;
&lt;br /&gt;
		# The following three commands tell DRBD how to react should&lt;br /&gt;
		# our best efforts fail and a split brain occurs. You can learn&lt;br /&gt;
		# more about these options by reading the drbd.conf man page.&lt;br /&gt;
		# NOTE! It is not possible to safely recover from a split brain&lt;br /&gt;
		# where both nodes were primary. This care requires human&lt;br /&gt;
		# intervention, so &#039;disconnect&#039; is the only safe policy.&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;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We&#039;ll make our usual backup of the configuration file, add the new sections and then create a diff to see exactly how things have changed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/drbd.d/global_common.conf /etc/drbd.d/global_common.conf.orig&lt;br /&gt;
vim /etc/drbd.d/global_common.conf &lt;br /&gt;
diff -u  /etc/drbd.d/global_common.conf.orig /etc/drbd.d/global_common.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/drbd.d/global_common.conf.orig	2011-12-13 22:22:30.916128360 -0500&lt;br /&gt;
+++ /etc/drbd.d/global_common.conf	2011-12-13 22:26:30.733379609 -0500&lt;br /&gt;
@@ -14,22 +14,67 @@&lt;br /&gt;
 		# split-brain &amp;quot;/usr/lib/drbd/notify-split-brain.sh root&amp;quot;;&lt;br /&gt;
 		# out-of-sync &amp;quot;/usr/lib/drbd/notify-out-of-sync.sh root&amp;quot;;&lt;br /&gt;
 		# before-resync-target &amp;quot;/usr/lib/drbd/snapshot-resync-target-lvm.sh -p 15 -- -c 16k&amp;quot;;&lt;br /&gt;
+&lt;br /&gt;
 		# after-resync-target /usr/lib/drbd/unsnapshot-resync-target-lvm.sh;&lt;br /&gt;
+                # This script is a wrapper for RHCS&#039;s &#039;fence_node&#039; command line&lt;br /&gt;
+                # tool. It will call a fence against the other node and return&lt;br /&gt;
+                # the appropriate exit code to DRBD.&lt;br /&gt;
+                fence-peer              &amp;quot;/sbin/obliterate-peer.sh&amp;quot;;&lt;br /&gt;
 	}&lt;br /&gt;
 &lt;br /&gt;
 	startup {&lt;br /&gt;
 		# wfc-timeout degr-wfc-timeout outdated-wfc-timeout wait-after-sb&lt;br /&gt;
+&lt;br /&gt;
+                # This tells DRBD to promote both nodes to Primary on start.&lt;br /&gt;
+                become-primary-on       both;&lt;br /&gt;
+&lt;br /&gt;
+                # This tells DRBD to wait five minutes for the other node to&lt;br /&gt;
+                # connect. This should be longer than it takes for cman to&lt;br /&gt;
+                # timeout and fence the other node *plus* the amount of time it&lt;br /&gt;
+                # takes the other node to reboot. If you set this too short,&lt;br /&gt;
+                # you could corrupt your data. If you want to be extra safe, do&lt;br /&gt;
+                # not use this at all and DRBD will wait for the other node&lt;br /&gt;
+                # forever.&lt;br /&gt;
+                wfc-timeout             300;&lt;br /&gt;
+&lt;br /&gt;
+                # This tells DRBD to wait for the other node for three minutes&lt;br /&gt;
+                # if the other node was degraded the last time it was seen by&lt;br /&gt;
+                # this node. This is a way to speed up the boot process when&lt;br /&gt;
+                # the other node is out of commission for an extended duration.&lt;br /&gt;
+                degr-wfc-timeout        120;&lt;br /&gt;
 	}&lt;br /&gt;
 &lt;br /&gt;
 	disk {&lt;br /&gt;
 		# on-io-error fencing use-bmbv no-disk-barrier no-disk-flushes&lt;br /&gt;
 		# no-disk-drain no-md-flushes max-bio-bvecs&lt;br /&gt;
+&lt;br /&gt;
+                # This tells DRBD to block IO and fence the remote node (using&lt;br /&gt;
+                # the &#039;fence-peer&#039; helper) when connection with the other node&lt;br /&gt;
+                # is unexpectedly lost. This is what helps prevent split-brain&lt;br /&gt;
+                # condition and it is incredible important in dual-primary&lt;br /&gt;
+                # setups!&lt;br /&gt;
+                fencing                 resource-and-stonith;&lt;br /&gt;
 	}&lt;br /&gt;
 &lt;br /&gt;
 	net {&lt;br /&gt;
 		# sndbuf-size rcvbuf-size timeout connect-int ping-int ping-timeout max-buffers&lt;br /&gt;
 		# max-epoch-size ko-count allow-two-primaries cram-hmac-alg shared-secret&lt;br /&gt;
 		# after-sb-0pri after-sb-1pri after-sb-2pri data-integrity-alg no-tcp-cork&lt;br /&gt;
+&lt;br /&gt;
+&lt;br /&gt;
+                # This tells DRBD to allow two nodes to be Primary at the same&lt;br /&gt;
+                # time. It is needed when &#039;become-primary-on both&#039; is set.&lt;br /&gt;
+                allow-two-primaries;&lt;br /&gt;
+&lt;br /&gt;
+                # The following three commands tell DRBD how to react should&lt;br /&gt;
+                # our best efforts fail and a split brain occurs. You can learn&lt;br /&gt;
+                # more about these options by reading the drbd.conf man page.&lt;br /&gt;
+                # NOTE! It is not possible to safely recover from a split brain&lt;br /&gt;
+                # where both nodes were primary. This care requires human&lt;br /&gt;
+                # intervention, so &#039;disconnect&#039; is the only safe policy.&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;
 &lt;br /&gt;
 	syncer {&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Configuring the DRBD Resources ===&lt;br /&gt;
&lt;br /&gt;
As mentioned earlier, we are going to create three DRBD resources.&lt;br /&gt;
&lt;br /&gt;
* Resource &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;r0&amp;lt;/span&amp;gt;, which will be device &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/drbd0&amp;lt;/span&amp;gt;, will be the shared GFS2 partition.&lt;br /&gt;
* Resource &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;r1&amp;lt;/span&amp;gt;, which will be device &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/drbd1&amp;lt;/span&amp;gt;, will provide disk space for VMs that will normally run on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;.&lt;br /&gt;
* Resource &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;r2&amp;lt;/span&amp;gt;, which will be device &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/drbd2&amp;lt;/span&amp;gt;, will provide disk space for VMs that will normally run on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
{{note|1=The reason for the two separate VM resources is to help protect against data loss in the off chance that a [[split-brain]] occurs, despite our counter-measures. As we will see later, recovering from a split brain requires discarding the changes on one side of the resource. If VMs are running on the same resource but on different nodes, this would lead to data loss. Using two resources helps prevent that scenario.}}&lt;br /&gt;
&lt;br /&gt;
Each resource configuration will be in its own file saved as &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/drbd.d/rX.res&amp;lt;/span&amp;gt;. The three of them will be pretty much the same. So let&#039;s take a look at the first GFS2 resource &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;r0.res&amp;lt;/span&amp;gt;, then we&#039;ll just look at the changes for &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;r1.res&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;r2.res&amp;lt;/span&amp;gt;. These files won&#039;t exist initially.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/drbd.d/r0.res&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
# This is the resource used for the shared GFS2 partition.&lt;br /&gt;
resource r0 {&lt;br /&gt;
	# This is the block device path.&lt;br /&gt;
	device		/dev/drbd0;&lt;br /&gt;
&lt;br /&gt;
	# We&#039;ll use the normal internal metadisk (takes about 32MB/TB)&lt;br /&gt;
	meta-disk	internal;&lt;br /&gt;
&lt;br /&gt;
	# This is the `uname -n` of the first node&lt;br /&gt;
	on an-node01.alteeve.com {&lt;br /&gt;
		# The &#039;address&#039; has to be the IP, not a hostname. This is the&lt;br /&gt;
		# node&#039;s SN (bond1) IP. The port number must be unique amoung&lt;br /&gt;
		# resources.&lt;br /&gt;
		address		10.10.0.1:7788;&lt;br /&gt;
&lt;br /&gt;
		# This is the block device backing this resource on this node.&lt;br /&gt;
		disk		/dev/sda5;&lt;br /&gt;
	}&lt;br /&gt;
	# Now the same information again for the second node.&lt;br /&gt;
	on an-node02.alteeve.com {&lt;br /&gt;
		address		10.10.0.2:7788;&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;
Now copy this to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;r1.res&amp;lt;/span&amp;gt; and edit for the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt; VM resource. The main differences are the resource name, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;r1&amp;lt;/span&amp;gt;, the block device, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/drbd1&amp;lt;/span&amp;gt;, the port, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;7790&amp;lt;/span&amp;gt; and the backing block devices, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/sda6&amp;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/drbd.d/r0.res /etc/drbd.d/r1.res&lt;br /&gt;
vim /etc/drbd.d/r1.res&lt;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 is the resource used for VMs that will normally run on an-node01.&lt;br /&gt;
resource r1 {&lt;br /&gt;
	# This is the block device path.&lt;br /&gt;
	device		/dev/drbd1;&lt;br /&gt;
&lt;br /&gt;
	# We&#039;ll use the normal internal metadisk (takes about 32MB/TB)&lt;br /&gt;
	meta-disk	internal;&lt;br /&gt;
&lt;br /&gt;
	# This is the `uname -n` of the first node&lt;br /&gt;
	on an-node01.alteeve.com {&lt;br /&gt;
		# The &#039;address&#039; has to be the IP, not a hostname. This is the&lt;br /&gt;
		# node&#039;s SN (bond1) IP. The port number must be unique amoung&lt;br /&gt;
		# resources.&lt;br /&gt;
		address		10.10.0.1:7789;&lt;br /&gt;
&lt;br /&gt;
		# This is the block device backing this resource on this node.&lt;br /&gt;
		disk		/dev/sda6;&lt;br /&gt;
	}&lt;br /&gt;
	# Now the same information again for the second node.&lt;br /&gt;
	on an-node02.alteeve.com {&lt;br /&gt;
		address		10.10.0.2:7789;&lt;br /&gt;
		disk		/dev/sda6;&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The last resource is again the same, with the same set of changes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/drbd.d/r1.res /etc/drbd.d/r2.res&lt;br /&gt;
vim /etc/drbd.d/r2.res&lt;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 is the resource used for VMs that will normally run on an-node02.&lt;br /&gt;
resource r2 {&lt;br /&gt;
	# This is the block device path.&lt;br /&gt;
	device		/dev/drbd2;&lt;br /&gt;
&lt;br /&gt;
	# We&#039;ll use the normal internal metadisk (takes about 32MB/TB)&lt;br /&gt;
	meta-disk	internal;&lt;br /&gt;
&lt;br /&gt;
	# This is the `uname -n` of the first node&lt;br /&gt;
	on an-node01.alteeve.com {&lt;br /&gt;
		# The &#039;address&#039; has to be the IP, not a hostname. This is the&lt;br /&gt;
		# node&#039;s SN (bond1) IP. The port number must be unique amoung&lt;br /&gt;
		# resources.&lt;br /&gt;
		address		10.10.0.1:7790;&lt;br /&gt;
&lt;br /&gt;
		# This is the block device backing this resource on this node.&lt;br /&gt;
		disk		/dev/sda7;&lt;br /&gt;
	}&lt;br /&gt;
	# Now the same information again for the second node.&lt;br /&gt;
	on an-node02.alteeve.com {&lt;br /&gt;
		address		10.10.0.2:7790;&lt;br /&gt;
		disk		/dev/sda7;&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The final step is to validate the configuration. This is done by running the following command;&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;
# /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;
    startup {&lt;br /&gt;
        wfc-timeout      300;&lt;br /&gt;
        degr-wfc-timeout 120;&lt;br /&gt;
        become-primary-on both;&lt;br /&gt;
    }&lt;br /&gt;
    handlers {&lt;br /&gt;
        pri-on-incon-degr &amp;quot;/usr/lib/drbd/notify-pri-on-incon-degr.sh; /usr/lib/drbd/notify-emergency-reboot.sh; echo b &amp;gt; /proc/sysrq-trigger ; reboot -f&amp;quot;;&lt;br /&gt;
        pri-lost-after-sb &amp;quot;/usr/lib/drbd/notify-pri-lost-after-sb.sh; /usr/lib/drbd/notify-emergency-reboot.sh; echo b &amp;gt; /proc/sysrq-trigger ; reboot -f&amp;quot;;&lt;br /&gt;
        local-io-error   &amp;quot;/usr/lib/drbd/notify-io-error.sh; /usr/lib/drbd/notify-emergency-shutdown.sh; echo o &amp;gt; /proc/sysrq-trigger ; halt -f&amp;quot;;&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-node01.alteeve.com: not ignored, not stacked&lt;br /&gt;
resource r0 {&lt;br /&gt;
    on an-node01.alteeve.com {&lt;br /&gt;
        device           /dev/drbd0 minor 0;&lt;br /&gt;
        disk             /dev/sda5;&lt;br /&gt;
        address          ipv4 10.10.0.1:7788;&lt;br /&gt;
        meta-disk        internal;&lt;br /&gt;
    }&lt;br /&gt;
    on an-node02.alteeve.com {&lt;br /&gt;
        device           /dev/drbd0 minor 0;&lt;br /&gt;
        disk             /dev/sda5;&lt;br /&gt;
        address          ipv4 10.10.0.2:7788;&lt;br /&gt;
        meta-disk        internal;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
# resource r1 on an-node01.alteeve.com: not ignored, not stacked&lt;br /&gt;
resource r1 {&lt;br /&gt;
    on an-node01.alteeve.com {&lt;br /&gt;
        device           /dev/drbd1 minor 1;&lt;br /&gt;
        disk             /dev/sda6;&lt;br /&gt;
        address          ipv4 10.10.0.1:7789;&lt;br /&gt;
        meta-disk        internal;&lt;br /&gt;
    }&lt;br /&gt;
    on an-node02.alteeve.com {&lt;br /&gt;
        device           /dev/drbd1 minor 1;&lt;br /&gt;
        disk             /dev/sda6;&lt;br /&gt;
        address          ipv4 10.10.0.2:7789;&lt;br /&gt;
        meta-disk        internal;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
# resource r2 on an-node01.alteeve.com: not ignored, not stacked&lt;br /&gt;
resource r2 {&lt;br /&gt;
    on an-node01.alteeve.com {&lt;br /&gt;
        device           /dev/drbd2 minor 2;&lt;br /&gt;
        disk             /dev/sda7;&lt;br /&gt;
        address          ipv4 10.10.0.1:7790;&lt;br /&gt;
        meta-disk        internal;&lt;br /&gt;
    }&lt;br /&gt;
    on an-node02.alteeve.com {&lt;br /&gt;
        device           /dev/drbd2 minor 2;&lt;br /&gt;
        disk             /dev/sda7;&lt;br /&gt;
        address          ipv4 10.10.0.2:7790;&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;
You&#039;ll note that the output is formatted differently from the configuration files we created, but the values themselves are the same. If there had of been errors, you would have seen them printed. Fix any problems before proceeding. Once you get a clean dump, copy the configuration over to the other node.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
rsync -av /etc/drbd.d root@an-node02:/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;
sending incremental file list&lt;br /&gt;
drbd.d/&lt;br /&gt;
drbd.d/global_common.conf&lt;br /&gt;
drbd.d/global_common.conf.orig&lt;br /&gt;
drbd.d/r0.res&lt;br /&gt;
drbd.d/r1.res&lt;br /&gt;
drbd.d/r2.res&lt;br /&gt;
&lt;br /&gt;
sent 7534 bytes  received 129 bytes  5108.67 bytes/sec&lt;br /&gt;
total size is 7874  speedup is 1.03&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Initializing The DRBD Resources ==&lt;br /&gt;
&lt;br /&gt;
Now that we have DRBD configured, we need to initialize the DRBD backing devices and then bring up the resources for the first time.&lt;br /&gt;
&lt;br /&gt;
{{note|1=To save a bit of time and typing, the following sections will use a little &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;bash&amp;lt;/span&amp;gt; magic. When commands need to be run on all three resources, rather than running the same command three times with the different resource names, we will use the short-hand form &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;r{0,1,2}&amp;lt;/span&amp;gt; or &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;r{0..2}&amp;lt;/span&amp;gt;.}}&lt;br /&gt;
&lt;br /&gt;
On &#039;&#039;&#039;both&#039;&#039;&#039; nodes, create the new [[DRBD metadata|metadata]] on the backing devices. You may need to type &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;yes&amp;lt;/span&amp;gt; to confirm the action if any data is seen. If DRBD sees an actual file system, it will error and insist that you clear the partition. You can do this by running; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;dd if=/dev/zero of=/dev/sdaX bs=4M&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 partition you want to clear. This is called &amp;quot;zeroing out&amp;quot; a partition. The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;dd&amp;lt;/span&amp;gt; program does not print its progress, and can take a long time. To check the progress, open a new session to the server and run &#039;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;kill -USR1 $(pgrep -l &#039;^dd$&#039; | awk &#039;{ print $1 }&#039;)&amp;lt;/span&amp;gt;&#039;.&lt;br /&gt;
&lt;br /&gt;
If DRBD sees old metadata, it will prompt you to type &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;yes&amp;lt;/span&amp;gt; before it will proceed. In my case, I had recently zeroed-out my drive so DRBD had no concerns and just created the metadata for the three resources.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
drbdadm create-md r{0..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;
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;
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;
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;
Before you go any further, we&#039;ll need to load the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;drbd&amp;lt;/span&amp;gt; kernel module. Note that you won&#039;t normally need to do this. Later, after we get everything running the first time, we&#039;ll be able to start and stop the DRBD resources using the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/init.d/drbd&amp;lt;/span&amp;gt; script, which loads and unloads the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;drbd&amp;lt;/span&amp;gt; kernel module as needed.&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;
Now go back to the terminal windows we had used to watch the cluster start. We now want to watch the output of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cat /proc/drbd&amp;lt;/span&amp;gt; so we can keep tabs on the current state of the DRBD resources. We&#039;ll do this by using the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;watch&amp;lt;/span&amp;gt; program, which will refresh the output of the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cat&amp;lt;/span&amp;gt; call every couple of seconds.&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;
version: 8.3.12 (api:88/proto:86-96)&lt;br /&gt;
GIT-hash: e2a8ef4656be026bbae540305fcb998a5991090f build by dag@Build64R6, 2011-11-20 10:57:03&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Back in the first terminal, we need to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;attach&amp;lt;/span&amp;gt; the backing device, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/sda{5..7}&amp;lt;/span&amp;gt; to their respective DRBD resources, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;r{0..2}&amp;lt;/span&amp;gt;. After running the following command, you will see no output on the first terminal, but the second terminal&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/proc/drbd&amp;lt;/span&amp;gt; should update.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
drbdadm attach r{0..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;
version: 8.3.12 (api:88/proto:86-96)&lt;br /&gt;
GIT-hash: e2a8ef4656be026bbae540305fcb998a5991090f build by dag@Build64R6, 2011-11-20 10:57:03&lt;br /&gt;
 0: cs:StandAlone ro:Secondary/Unknown ds:Inconsistent/DUnknown   r----s&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:19515784&lt;br /&gt;
 1: cs:StandAlone ro:Secondary/Unknown ds:Inconsistent/DUnknown   r----s&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:211418788&lt;br /&gt;
 2: cs:StandAlone ro:Secondary/Unknown ds:Inconsistent/DUnknown   r----s&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:211034800&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Take note of the connection state, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cs:StandAlone&amp;lt;/span&amp;gt;, the current role, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ro:Secondary/Unknown&amp;lt;/span&amp;gt; and the disk state, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ds:Inconsistent/DUnknown&amp;lt;/span&amp;gt;. This tells us that our resources are not talking to one another, are not usable because they are in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Secondary&amp;lt;/span&amp;gt; state (you can&#039;t even read the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/drbdX&amp;lt;/span&amp;gt; device) and that the backing device does not have an up to date view of the data. &lt;br /&gt;
&lt;br /&gt;
This all makes sense of course, as the resources are brand new.&lt;br /&gt;
&lt;br /&gt;
So the next step is to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;connect&amp;lt;/span&amp;gt; the two nodes together. As before, we won&#039;t see any output from the first terminal, but the second terminal will change.&lt;br /&gt;
&lt;br /&gt;
{{note|1=After running the following command on the first node, its connection state will become &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cs:WFConnection&amp;lt;/span&amp;gt; which means that it is &#039;&#039;&#039;w&#039;&#039;&#039;aiting &#039;&#039;&#039;f&#039;&#039;&#039;or a &#039;&#039;&#039;connection&#039;&#039;&#039; from the other node.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
drbdadm connect r{0..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;
version: 8.3.12 (api:88/proto:86-96)&lt;br /&gt;
GIT-hash: e2a8ef4656be026bbae540305fcb998a5991090f build by dag@Build64R6, 2011-11-20 10:57:03&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:19515784&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:211418788&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:211034800&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can now see that the two nodes are talking to one another properly as the connection state has changed to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cs:Connected&amp;lt;/span&amp;gt;. They can see that their peer node is in the same state as they are; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Secondary&amp;lt;/span&amp;gt;/&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Inconsistent&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Seeing as the resources are brand new, there is no data to synchronize the two nodes. We&#039;re going to issue a special command that will only ever be used this one time. It will tell DRBD to immediately consider the DRBD resources to be up to date.&lt;br /&gt;
&lt;br /&gt;
On &#039;&#039;&#039;one&#039;&#039;&#039; node only, run;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
drbdadm -- --clear-bitmap new-current-uuid r{0..2}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As before, look to the second terminal to see the new state of affairs.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
version: 8.3.12 (api:88/proto:86-96)&lt;br /&gt;
GIT-hash: e2a8ef4656be026bbae540305fcb998a5991090f build by dag@Build64R6, 2011-11-20 10:57:03&lt;br /&gt;
 0: cs:Connected ro:Secondary/Secondary ds:UpToDate/UpToDate 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:0&lt;br /&gt;
 1: cs:Connected ro:Secondary/Secondary ds:UpToDate/UpToDate 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:0&lt;br /&gt;
 2: cs:Connected ro:Secondary/Secondary ds:UpToDate/UpToDate 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:0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Voila!&lt;br /&gt;
&lt;br /&gt;
We could promote both sides to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Primary&amp;lt;/span&amp;gt; by running &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;drbdadm primary r{0..2}&amp;lt;/span&amp;gt; on both nodes, but there is no purpose in doing that at this stage as we can safely say our DRBD is ready to go. So instead, let&#039;s just stop DRBD entirely. We&#039;ll also prevent it from starting on boot as &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;drbd&amp;lt;/span&amp;gt; will be managed by the cluster in a later step.&lt;br /&gt;
&lt;br /&gt;
On &#039;&#039;&#039;both&#039;&#039;&#039; nodes run;&lt;br /&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 disable it from starting on boot.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
chkconfig drbd off&lt;br /&gt;
chkconfig --list 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           	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;
The second terminal will start complaining that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/proc/drbd&amp;lt;/span&amp;gt; no longer exists. This is because the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;drbd&amp;lt;/span&amp;gt; init script unloaded the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;drbd&amp;lt;/span&amp;gt; kernel module. It is expected and not a problem.&lt;br /&gt;
&lt;br /&gt;
= Configuring Clustered Storage =&lt;br /&gt;
&lt;br /&gt;
Before we can provision the first virtual machine, we must first create the storage that will back them. This will take a few steps;&lt;br /&gt;
&lt;br /&gt;
* Configuring [[LVM]]&#039;s clustered locking and creating the [[PV]]s, [[VG]]s and [[LV]]s&lt;br /&gt;
* Formatting and configuring the shared [[GFS2]] partition.&lt;br /&gt;
* Adding storage to the cluster&#039;s resource management.&lt;br /&gt;
&lt;br /&gt;
== Clustered Logical Volume Management ==&lt;br /&gt;
&lt;br /&gt;
We will assign all three DRBD resources to be managed by clustered LVM. This isn&#039;t strictly needed for the [[GFS2]] partition, as it uses DLM directly. However, the flexibility of LVM is very appealing, and will make later growth of the GFS2 partition quite trivial, should the need arise. &lt;br /&gt;
&lt;br /&gt;
The real reason for clustered LVM in our cluster is to provide DLM-backed locking to the partitions, or logical volumes in LVM, that will be used to back our VMs. Of course, the flexibility of LVM managed storage is enough of a win to justify using LVM for our VMs in itself, and shouldn&#039;t be ignored here.&lt;br /&gt;
&lt;br /&gt;
=== Configuring Clustered LVM Locking ===&lt;br /&gt;
&lt;br /&gt;
Before we create the clustered LVM, we need to first make three changes to the LVM configuration. &lt;br /&gt;
* We need to filter out the DRBD backing devices so that LVM doesn&#039;t see the same signature twice.&lt;br /&gt;
* Switch from local locking to clustered locking.&lt;br /&gt;
* Prevent fall-back to local locking when the cluster is not available.&lt;br /&gt;
&lt;br /&gt;
Start by making a backup of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;lvm.conf&amp;lt;/span&amp;gt; and then begin editing it.&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 configuration option to filter out the DRBD backing device is, surprisingly, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;filter = [ ... ]&amp;lt;/span&amp;gt;. By default, it is set to allow everything via the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;quot;a/.*/&amp;quot;&amp;lt;/span&amp;gt; regular expression. We&#039;re only using DRBD in our LVM, so we&#039;re going to flip that to reject everything &#039;&#039;except&#039;&#039; DRBD by changing the regex to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;quot;a|/dev/drbd*|&amp;quot;, &amp;quot;r/.*/&amp;quot;&amp;lt;/span&amp;gt;. If we didn&#039;t do this, LVM would see the same signature on the DRBD device and again on the backing devices, at which time it would ignore the DRBD device. This filter allows LVM to only inspect the DRBD devices for LVM signatures.&lt;br /&gt;
&lt;br /&gt;
Change;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
    # By default we accept every block device:&lt;br /&gt;
    filter = [ &amp;quot;a/.*/&amp;quot; ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
    # We&#039;re only using LVM on DRBD resource.&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;
For the locking, we&#039;re going to change the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;locking_type&amp;lt;/span&amp;gt; from &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt; (local locking) to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;3&amp;lt;/span&amp;gt;, (clustered locking). This is what tells LVM to use DLM.&lt;br /&gt;
&lt;br /&gt;
Change;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
    locking_type = 1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
    locking_type = 3&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Lastly, we&#039;re also going to disallow fall-back to local locking. Normally, LVM would try to access a clustered LVM [[VG]] using local locking if DLM is not available. We want to prevent any access to the clustered LVM volumes &#039;&#039;except&#039;&#039; when the DLM is itself running. 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; to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;0&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Change;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
    fallback_to_local_locking = 1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
    fallback_to_local_locking = 0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Save the changes, then lets run a &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;diff&amp;lt;/span&amp;gt; against our backup to see a summary of the changes.&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-12-14 17:42:16.416094972 -0500&lt;br /&gt;
+++ /etc/lvm/lvm.conf	2011-12-14 17:49:15.747097684 -0500&lt;br /&gt;
@@ -62,8 +62,8 @@&lt;br /&gt;
     # If it doesn&#039;t do what you expect, check the output of &#039;vgscan -vvvv&#039;.&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;
+    # We&#039;re only using LVM on DRBD resource.&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;
@@ -356,7 +356,7 @@&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 = 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;
@@ -372,7 +372,7 @@&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 = 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;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Perfect! Now copy the modified &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;lvm.conf&amp;lt;/span&amp;gt; file to the other 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-node02:/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;
sending incremental file list&lt;br /&gt;
lvm.conf&lt;br /&gt;
&lt;br /&gt;
sent 2351 bytes  received 283 bytes  5268.00 bytes/sec&lt;br /&gt;
total size is 28718  speedup is 10.90&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Testing the clvmd Daemon ===&lt;br /&gt;
&lt;br /&gt;
A little later on, we&#039;re going to put clustered LVM under the control of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt;. Before we can do that though, we need to start it manually so that we can use it to create the LV that will back the GFS2 &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/shared&amp;lt;/span&amp;gt; partition, which we will also be adding to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; when we build our storage services.&lt;br /&gt;
&lt;br /&gt;
Before we start the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clvmd&amp;lt;/span&amp;gt; daemon, we&#039;ll want to ensure that the cluster is 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;bash&amp;quot;&amp;gt;&lt;br /&gt;
Version: 6.2.0&lt;br /&gt;
Config Version: 7&lt;br /&gt;
Cluster Name: an-cluster-A&lt;br /&gt;
Cluster Id: 24561&lt;br /&gt;
Cluster Member: Yes&lt;br /&gt;
Cluster Generation: 68&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;
Node votes: 1&lt;br /&gt;
Quorum: 1  &lt;br /&gt;
Active subsystems: 7&lt;br /&gt;
Flags: 2node &lt;br /&gt;
Ports Bound: 0  &lt;br /&gt;
Node name: an-node01.alteeve.com&lt;br /&gt;
Node ID: 1&lt;br /&gt;
Multicast addresses: 239.192.95.81 &lt;br /&gt;
Node addresses: 10.20.0.1 &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is, and both nodes are members. We can start the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clvmd&amp;lt;/span&amp;gt; daemon now.&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;
We&#039;ve not created any clustered volume groups yet, so that complaint about not finding volume groups is expected.&lt;br /&gt;
&lt;br /&gt;
We don&#039;t want &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clvmd&amp;lt;/span&amp;gt; to start at boot, as we will be putting it under the cluster&#039;s control. So we need to make sure that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clvmd&amp;lt;/span&amp;gt; is disabled at boot, and then we&#039;ll stop &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clvmd&amp;lt;/span&amp;gt; for now.&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;
Now stop it entirely.&lt;br /&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;
Signaling clvmd to exit                                    [  OK  ]&lt;br /&gt;
clvmd terminated                                           [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Initialize our DRBD Resource for use as LVM PVs ===&lt;br /&gt;
&lt;br /&gt;
This is the first time we&#039;re actually going to use DRBD and clustered LVM, so we need to make sure that both are started. Earlier we stopped them, so if they&#039;re not running now, we need to restart them.&lt;br /&gt;
&lt;br /&gt;
First, check (and start if needed) &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;drbd&amp;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/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;
It&#039;s stopped, so we&#039;ll start it on &#039;&#039;&#039;both&#039;&#039;&#039; nodes now.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/drbd 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 DRBD resources: [ d(r0) d(r1) d(r2) n(r0) n(r1) n(r2) ].&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It looks like it started, but let&#039;s confirm that the resources are all &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Connected&amp;lt;/span&amp;gt;, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Primary&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;UpToDate&amp;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/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.12 (api:88/proto:86-96)&lt;br /&gt;
GIT-hash: e2a8ef4656be026bbae540305fcb998a5991090f build by dag@Build64R6, 2011-11-20 10:57:03&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;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Excellent, now to check on &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;
/etc/init.d/clvmd status&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
clvmd is stopped&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It&#039;s also stopped, so lets start it now.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/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;
Now we&#039;re ready to start!&lt;br /&gt;
&lt;br /&gt;
Before we can use LVM, clustered or otherwise, we need to initialize one or more raw storage devices. This is done using the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;pvcreate&amp;lt;/span&amp;gt; command. We&#039;re going to do this on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;, then run &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;pvscan&amp;lt;/span&amp;gt; on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt;. We should see the newly initialized DRBD resources appear.&lt;br /&gt;
&lt;br /&gt;
Running &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;pvscan&amp;lt;/span&amp;gt; first, we&#039;ll see that no [[PV]]s have been created.&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;
  No matching physical volumes found&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On &#039;&#039;&#039;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;&#039;&#039;&#039;, initialize the PVs;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
pvcreate /dev/drbd{0..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;
  Writing physical volume data to disk &amp;quot;/dev/drbd0&amp;quot;&lt;br /&gt;
  Physical volume &amp;quot;/dev/drbd0&amp;quot; successfully created&lt;br /&gt;
  Writing physical volume data to disk &amp;quot;/dev/drbd1&amp;quot;&lt;br /&gt;
  Physical volume &amp;quot;/dev/drbd1&amp;quot; successfully created&lt;br /&gt;
  Writing physical volume data to disk &amp;quot;/dev/drbd2&amp;quot;&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;
On both nodes, re-run &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;pvscan&amp;lt;/span&amp;gt; and the new PVs should show. This works because DRBD is keeping the data in sync, including the new LVM signatures.&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 [18.61 GiB]&lt;br /&gt;
  PV /dev/drbd1                      lvm2 [201.62 GiB]&lt;br /&gt;
  PV /dev/drbd2                      lvm2 [201.26 GiB]&lt;br /&gt;
  Total: 3 [421.49 GiB] / in use: 0 [0   ] / in no VG: 3 [421.49 GiB]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Done.&lt;br /&gt;
&lt;br /&gt;
=== Creating Cluster Volume Groups ===&lt;br /&gt;
&lt;br /&gt;
As with initializing the DRBD resource above, we will create out volume groups, [[VG]]s, on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt; only, but we will then see them on both nodes.&lt;br /&gt;
&lt;br /&gt;
Check to confirm that no VGs exist;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vgdisplay&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
  No volume groups found&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now to create the VGs, we&#039;ll use the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vgcreate&amp;lt;/span&amp;gt; command with the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;-c y&amp;lt;/span&amp;gt; switch, which tells LVM to make the VG a clustered VG. Note that when the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clvmd&amp;lt;/span&amp;gt; daemon is running, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;-c y&amp;lt;/span&amp;gt; is implied. However, I like to get into the habit of using it because it will trigger an error if, for some reason, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clvmd&amp;lt;/span&amp;gt; wasn&#039;t actually running.&lt;br /&gt;
&lt;br /&gt;
On &#039;&#039;&#039;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;&#039;&#039;&#039;, create the three VGs.&lt;br /&gt;
&lt;br /&gt;
* VG for the GFS2 &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/shared&amp;lt;/span&amp;gt; partition;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vgcreate -c y shared-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;shared-vg0&amp;quot; successfully created&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* VG for the VMs that will primarily run on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vgcreate -c y an01-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;an01-vg0&amp;quot; successfully created&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* VG for the VMs that will primarily run on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt;;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vgcreate -c y an02-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;an02-vg0&amp;quot; successfully created&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now on both nodes, we should see the three new volume groups.&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;an02-vg0&amp;quot; using metadata type lvm2&lt;br /&gt;
  Found volume group &amp;quot;an01-vg0&amp;quot; using metadata type lvm2&lt;br /&gt;
  Found volume group &amp;quot;shared-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 stage, we&#039;re going to create only one [[LV]] for the GFS2 partition. We&#039;ll create the rest later when we&#039;re ready to provision the VMs. This will be the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/shared&amp;lt;/span&amp;gt; partiton, which we will discuss further in the next section.&lt;br /&gt;
&lt;br /&gt;
As before, we&#039;ll create the LV on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt; and then verify it exists on both nodes.&lt;br /&gt;
&lt;br /&gt;
Before we create our first LV, check &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;lvscan&amp;lt;/span&amp;gt;.&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;
&#039;&#039;Nothing is returned&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
On &#039;&#039;&#039;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;&#039;&#039;&#039;, create the the LV on the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;shared-vg0&amp;lt;/span&amp;gt; VG, using all of the available space.&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 shared shared-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;shared&amp;quot; created&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now on both nodes, check that the new LV exists.&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/shared-vg0/shared&#039; [18.61 GiB] inherit&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Perfect. We can now create our GFS2 partition.&lt;br /&gt;
&lt;br /&gt;
== Creating The Shared GFS2 Partition ==&lt;br /&gt;
&lt;br /&gt;
The GFS2-formatted &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/shared&amp;lt;/span&amp;gt; partition will be used for four main purposes;&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/shared/files&amp;lt;/span&amp;gt;; Storing files like [[ISO]] images needed when provisioning VMs.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/shared/provision&amp;lt;/span&amp;gt;; Storing short scripts used to call &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-install&amp;lt;/span&amp;gt; which handles the creation of our VMs.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/shared/definitions&amp;lt;/span&amp;gt;; This is where the [[XML]] definition files which define the emulated hardware backing our VMs are kept. This is the most critical directory as the cluster will look here when starting and recovering VMs.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/shared/archive&amp;lt;/span&amp;gt;; This is used to store old copies of the [[XML]] definition files. I like to make a time-stamped copy of definition files prior to altering and redefining a VM. This way, I can quickly and easily revert to an old configuration should I run into trouble.&lt;br /&gt;
&lt;br /&gt;
Make sure that both &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;drbd&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clvmd&amp;lt;/span&amp;gt; are running.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;mkfs.gfs2&amp;lt;/span&amp;gt; call uses a few switches that are worth explaining;&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;-p lock_dlm&amp;lt;/span&amp;gt;; This tells GFS2 to use [[DLM]] for its clustered locking. Currently, this is the only supported locking type.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;-j 2&amp;lt;/span&amp;gt;; This tells GFS2 to create two journals. This must match the number of nodes that will try to mount this partition at any one time.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;-t an-cluster-A:shared&amp;lt;/span&amp;gt;; This is the lockspace name, which must be in the format &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;clustename&amp;gt;:&amp;lt;fsname&amp;gt;&amp;lt;/span&amp;gt;. The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clustername&amp;lt;/span&amp;gt; must match the one in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cluster.conf&amp;lt;/span&amp;gt;, and any node that belongs to a cluster of another name will not be allowed to access the file system.&lt;br /&gt;
&lt;br /&gt;
{{note|1=Depending on the size of the new partition, this call could take a while to complete. Please be patient.}}&lt;br /&gt;
&lt;br /&gt;
Then, on &#039;&#039;&#039;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;&#039;&#039;&#039;, run;&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-cluster-A:shared /dev/shared-vg0/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/shared-vg0/shared.&lt;br /&gt;
It appears to contain: symbolic link to `../dm-0&#039;&lt;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;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Device:                    /dev/shared-vg0/shared&lt;br /&gt;
Blocksize:                 4096&lt;br /&gt;
Device Size                18.61 GB (4878336 blocks)&lt;br /&gt;
Filesystem Size:           18.61 GB (4878333 blocks)&lt;br /&gt;
Journals:                  2&lt;br /&gt;
Resource Groups:           75&lt;br /&gt;
Locking Protocol:          &amp;quot;lock_dlm&amp;quot;&lt;br /&gt;
Lock Table:                &amp;quot;an-cluster-A:shared&amp;quot;&lt;br /&gt;
UUID:                      162a80eb-59b3-08bd-5d69-740cbb60aa45&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On &#039;&#039;&#039;both&#039;&#039;&#039; nodes, run all of the following commands.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
mkdir /shared&lt;br /&gt;
mount /dev/shared-vg0/shared /shared/&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Confirm that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/shared&amp;lt;/span&amp;gt; is now mounted.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
df -hP /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;
Filesystem            Size  Used Avail Use% Mounted on&lt;br /&gt;
/dev/mapper/shared--vg0-shared   19G  259M   19G   2% /shared&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that the path under &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Filesystem&amp;lt;/span&amp;gt; is different from what we used when creating the GFS2 partition. This is an effect of [[Device Mapper]], which is used by LVM to create symlinks to actual block device paths. If we look at our &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/shared-vg0/shared&amp;lt;/span&amp;gt; device and the device from &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;df&amp;lt;/span&amp;gt;, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/dev/mapper/shared--vg0-shared&amp;lt;/span&amp;gt;, we&#039;ll see that they both point to the same actual block device.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ls -lah /dev/shared-vg0/shared /dev/mapper/shared--vg0-shared&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
lrwxrwxrwx 1 root root 7 Oct 23 16:35 /dev/mapper/shared--vg0-shared -&amp;gt; ../dm-0&lt;br /&gt;
lrwxrwxrwx 1 root root 7 Oct 23 16:35 /dev/shared-vg0/shared -&amp;gt; ../dm-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;
ls -lah /dev/dm-0 &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
brw-rw---- 1 root disk 253, 0 Oct 23 16:35 /dev/dm-0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This next step uses some command-line voodoo. It takes the output from &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;gfs2_edit -p sb /dev/shared-vg0/shared&amp;lt;/span&amp;gt;, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;grep&amp;lt;/span&amp;gt;&#039;s out the [[UUID]] line for the new GFS2 partition, parses out of that the UUID itself, converts it to lower-case and, finally, spits out a string that can be used in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/fstab&amp;lt;/span&amp;gt;. We&#039;ll run it twice; The first time to confirm that the output is what we expect and the second time to append it 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;
The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;gfs2&amp;lt;/span&amp;gt; daemon can only work on GFS2 partitions that have been defined in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/fstab&amp;lt;/span&amp;gt;, so this is a required step on both nodes.&lt;br /&gt;
&lt;br /&gt;
We use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;defaults,noatime,nodiratime&amp;lt;/span&amp;gt; instead of just &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;defaults&amp;lt;/span&amp;gt; for performance reasons. Normally, every time a file or directory is accessed, its &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[atime]]&amp;lt;/span&amp;gt; (or &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[diratime]]&amp;lt;/span&amp;gt;) is updated, which requires a disk write, which requires an exclusive DLM lock, which is expensive. If you need to know when a file or directory was accessed, remove &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;,noatime,nodiratime&amp;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 `gfs2_edit -p sb /dev/shared-vg0/shared | grep sb_uuid | sed -e &amp;quot;s/.*sb_uuid  *\(.*\)/UUID=\L\1\E \/shared\t\tgfs2\tdefaults,noatime,nodiratime\t0 0/&amp;quot;`&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
UUID=162a80eb-59b3-08bd-5d69-740cbb60aa45 /shared gfs2 defaults,noatime,nodiratime 0 0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This looks good, so now re-run it but redirect the output to append to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/fstab&amp;lt;/span&amp;gt;. We&#039;ll confirm it worked by checking the status of the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;gfs2&amp;lt;/span&amp;gt; daemon.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
echo `gfs2_edit -p sb /dev/shared-vg0/shared | grep sb_uuid | sed -e &amp;quot;s/.*sb_uuid  *\(.*\)/UUID=\L\1\E \/shared\t\tgfs2\tdefaults,noatime,nodiratime\t0 0/&amp;quot;` &amp;gt;&amp;gt; /etc/fstab&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;
/shared&lt;br /&gt;
Active GFS2 mountpoints: &lt;br /&gt;
/shared&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Perfect, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;gfs2&amp;lt;/span&amp;gt; can see the partition now! We&#039;re ready to setup our directories.&lt;br /&gt;
&lt;br /&gt;
On &#039;&#039;&#039;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&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 /shared/{definitions,provision,archive,files}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On &#039;&#039;&#039;both&#039;&#039;&#039; nodes, confirm that all of the new directories exist and are visible.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ls -lah /shared/&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
total 24K&lt;br /&gt;
drwxr-xr-x   6 root root 3.8K Dec 14 19:05 .&lt;br /&gt;
dr-xr-xr-x. 24 root root 4.0K Dec 14 18:44 ..&lt;br /&gt;
drwxr-xr-x   2 root root    0 Dec 14 19:05 archive&lt;br /&gt;
drwxr-xr-x   2 root root    0 Dec 14 19:05 definitions&lt;br /&gt;
drwxr-xr-x   2 root root    0 Dec 14 19:05 files&lt;br /&gt;
drwxr-xr-x   2 root root    0 Dec 14 19:05 provision&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Wonderful!&lt;br /&gt;
&lt;br /&gt;
As with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;drbd&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clvmd&amp;lt;/span&amp;gt;, we don&#039;t want to have &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;gfs2&amp;lt;/span&amp;gt; start at boot as we&#039;re going to put it under the control of the cluster.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
chkconfig gfs2 off&lt;br /&gt;
chkconfig --list gfs2&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
gfs2           	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;
==== Renaming a GFS2 Partition ====&lt;br /&gt;
&lt;br /&gt;
{{warning|1=Be sure to unmount the GFS2 partition from &#039;&#039;&#039;all&#039;&#039;&#039; nodes prior to altering the cluster or filesystem names!}}&lt;br /&gt;
&lt;br /&gt;
If you ever need to rename your cluster, you will need to update your GFS2 partition before you can remount it. Unmount the partition from all nodes and run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
gfs2_tool sb /dev/shared-vg0/shared table &amp;quot;new_cluster_name:shared&amp;quot;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
You shouldn&#039;t change any of these values if the filesystem is mounted.&lt;br /&gt;
&lt;br /&gt;
Are you sure? [y/n] y&lt;br /&gt;
&lt;br /&gt;
current lock table name = &amp;quot;an-cluster-A:shared&amp;quot;&lt;br /&gt;
new lock table name = &amp;quot;new_cluster_name:shared&amp;quot;&lt;br /&gt;
Done&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then you can change the cluster&#039;s name in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cluster.conf&amp;lt;/span&amp;gt; and then remount the GFS2 partition.&lt;br /&gt;
&lt;br /&gt;
You can use the same command, changing the GFS2 partition name, if you want to change the name of the filesystem instead of (or at the same time as) the cluster&#039;s name.&lt;br /&gt;
&lt;br /&gt;
=== Stopping All Clustered Storage Components ===&lt;br /&gt;
&lt;br /&gt;
Before we can put storage under the cluster&#039;s control, we need to make sure that the &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;clvmd&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;drbd&amp;lt;/span&amp;gt; daemons are stopped.&lt;br /&gt;
&lt;br /&gt;
On &#039;&#039;&#039;both&#039;&#039;&#039; nodes, run;&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 &amp;amp;&amp;amp; /etc/init.d/clvmd stop &amp;amp;&amp;amp; /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;
Unmounting GFS2 filesystem (/shared):                      [  OK  ]&lt;br /&gt;
Deactivating clustered VG(s):   0 logical volume(s) in volume group &amp;quot;an02-vg0&amp;quot; now active&lt;br /&gt;
  0 logical volume(s) in volume group &amp;quot;an01-vg0&amp;quot; now active&lt;br /&gt;
  0 logical volume(s) in volume group &amp;quot;shared-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;
Stopping all DRBD resources: .&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Managing Storage In The Cluster =&lt;br /&gt;
&lt;br /&gt;
A little while back, we spoke about how the cluster is split into two components; cluster communication managed by &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt; and resource management provided by &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt;. It&#039;s the later which we will now begin to configure.&lt;br /&gt;
&lt;br /&gt;
In the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cluster.conf&amp;lt;/span&amp;gt;, the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; component is contained within the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;rm /&amp;gt;&amp;lt;/span&amp;gt; element tags. Within this element are three types of child elements. They are:&lt;br /&gt;
* Fail-over Domains - &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;failoverdomains /&amp;gt;&amp;lt;/span&amp;gt;; &lt;br /&gt;
** These are optional constraints which allow for control which nodes, and under what circumstances, services may run. When not used, a service will be allowed to run on any node in the cluster without constraints or ordering.&lt;br /&gt;
* Resources - &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;resources /&amp;gt;&amp;lt;/span&amp;gt;; &lt;br /&gt;
** Within this element, available resources are defined. Simply having a resource here will not put it under cluster control. Rather, it makes it available for use in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;service /&amp;gt;&amp;lt;/span&amp;gt; elements.&lt;br /&gt;
* Services - &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;service /&amp;gt;&amp;lt;/span&amp;gt;; &lt;br /&gt;
** This element contains one or more parallel or series child-elements which are themselves references to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;resources /&amp;gt;&amp;lt;/span&amp;gt; elements. When in parallel, the services will start and stop at the same time. When in series, the services start in order and stop in reverse order. We will also see a specialized type of service that uses the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;vm /&amp;gt;&amp;lt;/span&amp;gt; element name, as you can probably guess, for creating virtual machine services.&lt;br /&gt;
&lt;br /&gt;
We&#039;ll look at each of these components in more detail shortly.&lt;br /&gt;
&lt;br /&gt;
== A Note On Daemon Starting ==&lt;br /&gt;
&lt;br /&gt;
There are four daemons we will be putting under cluster control;&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;drbd&amp;lt;/span&amp;gt;; Replicated storage.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clvmd&amp;lt;/span&amp;gt;; Clustered LVM.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;gfs2&amp;lt;/span&amp;gt;; Mounts and Unmounts configured GFS2 partition.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;libvirtd&amp;lt;/span&amp;gt;; Provides access to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virsh&amp;lt;/span&amp;gt; and other &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;libvirt&amp;lt;/span&amp;gt; tools. Needed for running our VMs.&lt;br /&gt;
&lt;br /&gt;
The reason we do not want to start these daemons with the system is so that we can let the cluster do it. This way, should any fail, the cluster will detect the failure and fail the entire service tree. For example, lets say that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;drbd&amp;lt;/span&amp;gt; failed to start, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; would fail the storage service and give up, rather than continue trying to start &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clvmd&amp;lt;/span&amp;gt; and the rest. With &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;libvirtd&amp;lt;/span&amp;gt; being the last daemon, it will not be possible to start a VM unless the storage started successfully. &lt;br /&gt;
&lt;br /&gt;
If we had left these daemons to boot on start, the failure of the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;drbd&amp;lt;/span&amp;gt; would not effect the start-up of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clvmd&amp;lt;/span&amp;gt;, which would then not find its [[PV]]s given that DRBD is down. Next, the system would try to start the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;gfs2&amp;lt;/span&amp;gt; daemon which would also fail as the [[LV]] backing the partition would not be available. Finally, the system would start &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;libvirtd&amp;lt;/span&amp;gt;, which would allow the start of virtual machine, which would also be missing their &amp;quot;hard drives&amp;quot; as their backing LVs would also not be available. Pretty messy situation to clean up from.&lt;br /&gt;
&lt;br /&gt;
=== Defining The Resources ===&lt;br /&gt;
&lt;br /&gt;
Lets start by first defining our clustered resources. &lt;br /&gt;
&lt;br /&gt;
As stated before, the addition of these resources does not, in itself, put the defined resources under the cluster&#039;s management. Instead, it defines services, like &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;init.d&amp;lt;/span&amp;gt; scripts. These can then be used by one or more &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;service /&amp;gt;&amp;lt;/span&amp;gt; elements, as we will see shortly. For now, it is enough to know what, until a resource is defined, it can not be used in the cluster.&lt;br /&gt;
&lt;br /&gt;
Given that this is the first component of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; being added to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cluster.conf&amp;lt;/span&amp;gt;, we will be creating the parent &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;rm /&amp;gt;&amp;lt;/span&amp;gt; elements here as well.&lt;br /&gt;
&lt;br /&gt;
Let&#039;s take a look at the new section, then discuss the parts.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;cluster name=&amp;quot;an-cluster-A&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-node01.alteeve.com&amp;quot; nodeid=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
                        &amp;lt;fence&amp;gt;&lt;br /&gt;
                                &amp;lt;method name=&amp;quot;ipmi&amp;quot;&amp;gt;&lt;br /&gt;
                                        &amp;lt;device name=&amp;quot;ipmi_an01&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;pdu&amp;quot;&amp;gt;&lt;br /&gt;
                                        &amp;lt;device name=&amp;quot;pdu2&amp;quot; port=&amp;quot;1&amp;quot; action=&amp;quot;reboot&amp;quot; /&amp;gt;&lt;br /&gt;
                                &amp;lt;/method&amp;gt;&lt;br /&gt;
                        &amp;lt;/fence&amp;gt;&lt;br /&gt;
                &amp;lt;/clusternode&amp;gt;&lt;br /&gt;
                &amp;lt;clusternode name=&amp;quot;an-node02.alteeve.com&amp;quot; nodeid=&amp;quot;2&amp;quot;&amp;gt;&lt;br /&gt;
                        &amp;lt;fence&amp;gt;&lt;br /&gt;
                                &amp;lt;method name=&amp;quot;ipmi&amp;quot;&amp;gt;&lt;br /&gt;
                                        &amp;lt;device name=&amp;quot;ipmi_an02&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;pdu&amp;quot;&amp;gt;&lt;br /&gt;
                                        &amp;lt;device name=&amp;quot;pdu2&amp;quot; port=&amp;quot;2&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;ipmi_an01&amp;quot; agent=&amp;quot;fence_ipmilan&amp;quot; ipaddr=&amp;quot;an-node01.ipmi&amp;quot; login=&amp;quot;root&amp;quot; passwd=&amp;quot;secret&amp;quot; /&amp;gt;&lt;br /&gt;
                &amp;lt;fencedevice name=&amp;quot;ipmi_an02&amp;quot; agent=&amp;quot;fence_ipmilan&amp;quot; ipaddr=&amp;quot;an-node02.ipmi&amp;quot; login=&amp;quot;root&amp;quot; passwd=&amp;quot;secret&amp;quot; /&amp;gt;&lt;br /&gt;
                &amp;lt;fencedevice agent=&amp;quot;fence_apc_snmp&amp;quot; ipaddr=&amp;quot;pdu2.alteeve.com&amp;quot; name=&amp;quot;pdu2&amp;quot; /&amp;gt;&lt;br /&gt;
        &amp;lt;/fencedevices&amp;gt;&lt;br /&gt;
        &amp;lt;fence_daemon post_join_delay=&amp;quot;30&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 log_level=&amp;quot;5&amp;quot;&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;script file=&amp;quot;/etc/init.d/libvirtd&amp;quot; name=&amp;quot;libvirtd&amp;quot;/&amp;gt;&lt;br /&gt;
                &amp;lt;/resources&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;
First and foremost; Note that we&#039;ve incremented the version to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;8&amp;lt;/span&amp;gt;. As always, increment and then edit.&lt;br /&gt;
&lt;br /&gt;
Let&#039;s focus on the new section;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;rm log_level=&amp;quot;5&amp;quot;&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;script file=&amp;quot;/etc/init.d/libvirtd&amp;quot; name=&amp;quot;libvirtd&amp;quot;/&amp;gt;&lt;br /&gt;
		&amp;lt;/resources&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 new &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;rm log_level=&amp;quot;5&amp;quot;&amp;gt;...&amp;lt;/rm&amp;gt;&amp;lt;/span&amp;gt; element tells the cluster that this is the section for &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; and that we&#039;re setting the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;log_level&amp;lt;/span&amp;gt; to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;5&amp;lt;/span&amp;gt;. This &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;log_level&amp;lt;/span&amp;gt; is slightly less verbose that the default. Specifically, by default, there is an entry in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/var/log/messages&amp;lt;/span&amp;gt; every time each resource is checked. This quickly adds a lot of questionably useful information to [[syslog]]. By changing this, we will still see all important messages, but these resource check messages are suppressed. If you are ever curious about whether or not &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; is, in fact, checking the services than either remove &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;log_level=&amp;quot;5&amp;quot;&amp;lt;/span&amp;gt; or change it to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;6&amp;lt;/span&amp;gt; or higher.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;resources&amp;gt;...&amp;lt;/resources&amp;gt;&amp;lt;/span&amp;gt; element contains our four &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;script .../&amp;gt;&amp;lt;/span&amp;gt; resources. This is a particular type of resource which specifically handles that starting and stopping of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[init.d]]&amp;lt;/span&amp;gt; style scripts. That is, the script must exit with [[LSB]] compliant codes. They must also properly react to being called with the sole argument of &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;.&lt;br /&gt;
&lt;br /&gt;
There are many other types of resources which, with the exception of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;vm .../&amp;gt;&amp;lt;/span&amp;gt;, we will not be looking at in this tutorial. Should you be interested in them, please look in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/usr/share/cluster&amp;lt;/span&amp;gt; for the various scripts (executable files that end with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;.sh&amp;lt;/span&amp;gt;). &lt;br /&gt;
&lt;br /&gt;
Each of our four &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;script ... /&amp;gt;&amp;lt;/span&amp;gt; resources have two attributes;&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;file=&amp;quot;...&amp;quot;&amp;lt;/span&amp;gt;; The full path to the script to be managed.&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;name=&amp;quot;...&amp;quot;&amp;lt;/span&amp;gt;; A unique name used to reference this resource later on in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;service /&amp;gt;&amp;lt;/span&amp;gt; elements.&lt;br /&gt;
&lt;br /&gt;
Other resources are more involved, but the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;script .../&amp;gt;&amp;lt;/span&amp;gt; resources are quite simple.&lt;br /&gt;
&lt;br /&gt;
=== Creating Failover Domains ===&lt;br /&gt;
&lt;br /&gt;
Fail-over domains are, at their most basic, a collection of one or more nodes in the cluster with a particular set of rules associated with them. Services can then be configured to operate within the context of a given fail-over domain. There are a few key options to be aware of.&lt;br /&gt;
&lt;br /&gt;
Fail-over domains are optional and can be left out of the cluster, generally speaking. However, in our cluster, we will need them for our storage services, as we will later see, so please do not skip this step.&lt;br /&gt;
&lt;br /&gt;
* A fail-over domain can be unordered or prioritized.&lt;br /&gt;
** When unordered, a service will start on any node in the domain. Should that node later fail, it will restart to another random node in the domain.&lt;br /&gt;
** When prioritized, a service will start on the available node with the highest priority in the domain. Should that node later fail, the service will restart on the available node with the next highest priority.&lt;br /&gt;
* A fail-over domain can be restricted or unrestricted.&lt;br /&gt;
** When restricted, a service is &#039;&#039;&#039;only&#039;&#039;&#039; allowed to start on, or restart on. a nodes in the domain. When no nodes are available, the service will be stopped.&lt;br /&gt;
** When unrestricted, a service will try to start on, or restart on, a node in the domain. However, when no domain members are available, the cluster will pick another available node at random to start the service on.&lt;br /&gt;
* A fail-over domain can have a fail-back policy.&lt;br /&gt;
** When a domain allows for fail-back and the domain is ordered, and a node with a higher &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;priority&amp;lt;/span&amp;gt; (re)joins the cluster, services within the domain will migrate to that higher-priority node. 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 fail-back, but is unrestricted, fail-back of services that fell out of the domain will happen anyway. That is to say, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;nofailback=&amp;quot;1&amp;quot;&amp;lt;/span&amp;gt; is ignored if a service was running on a node outside of the fail-over domain and a node within the domain joins the cluster. However, once the service is on a node within the domain, the service will &#039;&#039;&#039;not&#039;&#039;&#039; relocate to a higher-priority node should one join the cluster later.&lt;br /&gt;
** When a domain does not allow for fail-back and is restricted, then fail-back of services will never occur.&lt;br /&gt;
&lt;br /&gt;
What we need to do at this stage is to create something of a hack. Let me explain;&lt;br /&gt;
&lt;br /&gt;
As discussed earlier, we need to start a set of local daemons on all nodes. These aren&#039;t really clustered resources though as they can only ever run on their host node. They will never be relocated or restarted elsewhere in the cluster as as such, are not highly available. So to work around this desire to &amp;quot;cluster the unclusterable&amp;quot;, we&#039;re going to create a fail-over domain for each node in the cluster. Each of these domains will have only one of the cluster nodes as members of the domain and the domain will be restricted, unordered and have no fail-back. With this configuration, any service group using it will only ever run on the one node in the domain.&lt;br /&gt;
&lt;br /&gt;
In the next step, we will create a service group, then replicate it once for each node in the cluster. The only difference will be the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;failoverdomain&amp;lt;/span&amp;gt; each is set to use. With our configuration of two nodes then, we will have two fail-over domains, one for each node, and we will define the clustered storage service twice, each one using one of the two fail-over domains.&lt;br /&gt;
&lt;br /&gt;
Let&#039;s look at the complete updated &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cluster.conf&amp;lt;/span&amp;gt;, then we will focus closer on the new section.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;cluster name=&amp;quot;an-cluster-A&amp;quot; config_version=&amp;quot;9&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-node01.alteeve.com&amp;quot; nodeid=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
                        &amp;lt;fence&amp;gt;&lt;br /&gt;
                                &amp;lt;method name=&amp;quot;ipmi&amp;quot;&amp;gt;&lt;br /&gt;
                                        &amp;lt;device name=&amp;quot;ipmi_an01&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;pdu&amp;quot;&amp;gt;&lt;br /&gt;
                                        &amp;lt;device name=&amp;quot;pdu2&amp;quot; port=&amp;quot;1&amp;quot; action=&amp;quot;reboot&amp;quot; /&amp;gt;&lt;br /&gt;
                                &amp;lt;/method&amp;gt;&lt;br /&gt;
                        &amp;lt;/fence&amp;gt;&lt;br /&gt;
                &amp;lt;/clusternode&amp;gt;&lt;br /&gt;
                &amp;lt;clusternode name=&amp;quot;an-node02.alteeve.com&amp;quot; nodeid=&amp;quot;2&amp;quot;&amp;gt;&lt;br /&gt;
                        &amp;lt;fence&amp;gt;&lt;br /&gt;
                                &amp;lt;method name=&amp;quot;ipmi&amp;quot;&amp;gt;&lt;br /&gt;
                                        &amp;lt;device name=&amp;quot;ipmi_an02&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;pdu&amp;quot;&amp;gt;&lt;br /&gt;
                                        &amp;lt;device name=&amp;quot;pdu2&amp;quot; port=&amp;quot;2&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;ipmi_an01&amp;quot; agent=&amp;quot;fence_ipmilan&amp;quot; ipaddr=&amp;quot;an-node01.ipmi&amp;quot; login=&amp;quot;root&amp;quot; passwd=&amp;quot;secret&amp;quot; /&amp;gt;&lt;br /&gt;
                &amp;lt;fencedevice name=&amp;quot;ipmi_an02&amp;quot; agent=&amp;quot;fence_ipmilan&amp;quot; ipaddr=&amp;quot;an-node02.ipmi&amp;quot; login=&amp;quot;root&amp;quot; passwd=&amp;quot;secret&amp;quot; /&amp;gt;&lt;br /&gt;
                &amp;lt;fencedevice agent=&amp;quot;fence_apc_snmp&amp;quot; ipaddr=&amp;quot;pdu2.alteeve.com&amp;quot; name=&amp;quot;pdu2&amp;quot; /&amp;gt;&lt;br /&gt;
        &amp;lt;/fencedevices&amp;gt;&lt;br /&gt;
        &amp;lt;fence_daemon post_join_delay=&amp;quot;30&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 log_level=&amp;quot;5&amp;quot;&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;script file=&amp;quot;/etc/init.d/libvirtd&amp;quot; name=&amp;quot;libvirtd&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;only_an01&amp;quot; nofailback=&amp;quot;1&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-node01.alteeve.com&amp;quot;/&amp;gt;&lt;br /&gt;
                        &amp;lt;/failoverdomain&amp;gt;&lt;br /&gt;
                        &amp;lt;failoverdomain name=&amp;quot;only_an02&amp;quot; nofailback=&amp;quot;1&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-node02.alteeve.com&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;
As always, the version was incremented, this time to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;9&amp;lt;/span&amp;gt;. We&#039;ve also added the new &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;failoverdomains&amp;gt;...&amp;lt;/failoverdomains&amp;gt;&amp;lt;/span&amp;gt; element. Let&#039;s take a closer look at this new element.&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;
                        &amp;lt;failoverdomain name=&amp;quot;only_an01&amp;quot; nofailback=&amp;quot;1&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-node01.alteeve.com&amp;quot;/&amp;gt;&lt;br /&gt;
                        &amp;lt;/failoverdomain&amp;gt;&lt;br /&gt;
                        &amp;lt;failoverdomain name=&amp;quot;only_an02&amp;quot; nofailback=&amp;quot;1&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-node02.alteeve.com&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;
The first thing to node is that there are two &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;failoverdomain...&amp;gt;...&amp;lt;/failoverdomain&amp;gt;&amp;lt;/span&amp;gt; child elements. &lt;br /&gt;
* The first has the name &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;only_an01&amp;lt;/span&amp;gt; and contains only the node &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt; as a member.&lt;br /&gt;
* The second is effectively identical, save that the domain&#039;s name is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;only_an02&amp;lt;/span&amp;gt; and it contains only the node &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt; as a member.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;failoverdomain ...&amp;gt;&amp;lt;/span&amp;gt; element has four attributes;&lt;br /&gt;
* The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;name=&amp;quot;...&amp;quot;&amp;lt;/span&amp;gt; attribute sets the unique name of the domain which we will later use to bind a service to the domain.&lt;br /&gt;
* The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;nofailback=&amp;quot;1&amp;quot;&amp;lt;/span&amp;gt; attribute tells the cluster to never &amp;quot;fail back&amp;quot; any services in this domain. This seems redundant, given there is only one node, but when combined with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;restricted=&amp;quot;0&amp;quot;&amp;lt;/span&amp;gt;, prevents any migration of services.&lt;br /&gt;
* The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ordered=&amp;quot;0&amp;quot;&amp;lt;/span&amp;gt; this is also somewhat redundant in that there is only one node defined in the domain, but I don&#039;t like to leave attributes undefined so I have it here.&lt;br /&gt;
* The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;restricted=&amp;quot;1&amp;quot;&amp;lt;/span&amp;gt; attribute is key in that it tells the cluster to &#039;&#039;&#039;not&#039;&#039;&#039; try to restart services within this domain on any other nodes outside of the one defined in the fail-over domain.&lt;br /&gt;
&lt;br /&gt;
Each of the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;failoverdomain...&amp;gt;&amp;lt;/span&amp;gt; elements has a single &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;failoverdomainnode .../&amp;gt;&amp;lt;/span&amp;gt; child element. This is a very simple element which has, at this time, only one attribute;&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;name=&amp;quot;...&amp;quot;&amp;lt;/span&amp;gt;; The name of the node to include in the fail-over domain. This name must match the corresponding &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;clusternode name=&amp;quot;...&amp;quot;&amp;lt;/span&amp;gt; node name.&lt;br /&gt;
&lt;br /&gt;
At this point, we&#039;re ready to finally create our clustered storage services.&lt;br /&gt;
&lt;br /&gt;
=== Creating Clustered Storage Services ===&lt;br /&gt;
&lt;br /&gt;
With the resources defined and the fail-over domains created, we can set about creating our services.&lt;br /&gt;
&lt;br /&gt;
Generally speaking, services can have one or more resources within them. When two or more resources exist, then can be put into a dependency tree, they can used in parallel or a combination of parallel and dependent resources.&lt;br /&gt;
&lt;br /&gt;
When you create a service dependency tree, you put each dependent resource as a child element of its parent. The resources are then started in order, starting at the top of the tree and working its way down to the deepest child resource. If at any time one of the resources should fail, the entire service will be declared failed and no attempt will be made to try and start any further child resources. Conversely, stopping the service will cause the deepest child resource to be stopped first. Then the second deepest and on upwards towards the top resource. This is exactly the behaviour we want, as we will see shortly.&lt;br /&gt;
&lt;br /&gt;
When resources are defined in parallel, all defined resources will be started at the same time. Should any one of the resources fail to start, the entire resource will declared failed. Stopping the service will likewise cause a simultaneous call to stop all resources.&lt;br /&gt;
&lt;br /&gt;
As before, let&#039;s take a look at the entire updated &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cluster.conf&amp;lt;/span&amp;gt; file, then we&#039;ll focus in on the new service section.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;cluster name=&amp;quot;an-cluster-A&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-node01.alteeve.com&amp;quot; nodeid=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
                        &amp;lt;fence&amp;gt;&lt;br /&gt;
                                &amp;lt;method name=&amp;quot;ipmi&amp;quot;&amp;gt;&lt;br /&gt;
                                        &amp;lt;device name=&amp;quot;ipmi_an01&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;pdu&amp;quot;&amp;gt;&lt;br /&gt;
                                        &amp;lt;device name=&amp;quot;pdu2&amp;quot; port=&amp;quot;1&amp;quot; action=&amp;quot;reboot&amp;quot; /&amp;gt;&lt;br /&gt;
                                &amp;lt;/method&amp;gt;&lt;br /&gt;
                        &amp;lt;/fence&amp;gt;&lt;br /&gt;
                &amp;lt;/clusternode&amp;gt;&lt;br /&gt;
                &amp;lt;clusternode name=&amp;quot;an-node02.alteeve.com&amp;quot; nodeid=&amp;quot;2&amp;quot;&amp;gt;&lt;br /&gt;
                        &amp;lt;fence&amp;gt;&lt;br /&gt;
                                &amp;lt;method name=&amp;quot;ipmi&amp;quot;&amp;gt;&lt;br /&gt;
                                        &amp;lt;device name=&amp;quot;ipmi_an02&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;pdu&amp;quot;&amp;gt;&lt;br /&gt;
                                        &amp;lt;device name=&amp;quot;pdu2&amp;quot; port=&amp;quot;2&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;ipmi_an01&amp;quot; agent=&amp;quot;fence_ipmilan&amp;quot; ipaddr=&amp;quot;an-node01.ipmi&amp;quot; login=&amp;quot;root&amp;quot; passwd=&amp;quot;secret&amp;quot; /&amp;gt;&lt;br /&gt;
                &amp;lt;fencedevice name=&amp;quot;ipmi_an02&amp;quot; agent=&amp;quot;fence_ipmilan&amp;quot; ipaddr=&amp;quot;an-node02.ipmi&amp;quot; login=&amp;quot;root&amp;quot; passwd=&amp;quot;secret&amp;quot; /&amp;gt;&lt;br /&gt;
                &amp;lt;fencedevice agent=&amp;quot;fence_apc_snmp&amp;quot; ipaddr=&amp;quot;pdu2.alteeve.com&amp;quot; name=&amp;quot;pdu2&amp;quot; /&amp;gt;&lt;br /&gt;
        &amp;lt;/fencedevices&amp;gt;&lt;br /&gt;
        &amp;lt;fence_daemon post_join_delay=&amp;quot;30&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 log_level=&amp;quot;5&amp;quot;&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;script file=&amp;quot;/etc/init.d/libvirtd&amp;quot; name=&amp;quot;libvirtd&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;only_an01&amp;quot; nofailback=&amp;quot;1&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-node01.alteeve.com&amp;quot;/&amp;gt;&lt;br /&gt;
                        &amp;lt;/failoverdomain&amp;gt;&lt;br /&gt;
                        &amp;lt;failoverdomain name=&amp;quot;only_an02&amp;quot; nofailback=&amp;quot;1&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-node02.alteeve.com&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 name=&amp;quot;storage_an01&amp;quot; autostart=&amp;quot;1&amp;quot; domain=&amp;quot;only_an01&amp;quot; exclusive=&amp;quot;0&amp;quot; recovery=&amp;quot;restart&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 ref=&amp;quot;libvirtd&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;/script&amp;gt;&lt;br /&gt;
                &amp;lt;/service&amp;gt;&lt;br /&gt;
                &amp;lt;service name=&amp;quot;storage_an02&amp;quot; autostart=&amp;quot;1&amp;quot; domain=&amp;quot;only_an02&amp;quot; exclusive=&amp;quot;0&amp;quot; recovery=&amp;quot;restart&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 ref=&amp;quot;libvirtd&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;/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;
With the version now at &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;10&amp;lt;/span&amp;gt;, we have added two &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;service...&amp;gt;...&amp;lt;/service&amp;gt;&amp;lt;/span&amp;gt; elements. Each containing a four &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;script ...&amp;gt;&amp;lt;/span&amp;gt; type resources in a service tree configuration. Let&#039;s take a closer look.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
		&amp;lt;service name=&amp;quot;storage_an01&amp;quot; autostart=&amp;quot;1&amp;quot; domain=&amp;quot;only_an01&amp;quot; exclusive=&amp;quot;0&amp;quot; recovery=&amp;quot;restart&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 ref=&amp;quot;libvirtd&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;/script&amp;gt;&lt;br /&gt;
		&amp;lt;/service&amp;gt;&lt;br /&gt;
		&amp;lt;service name=&amp;quot;storage_an02&amp;quot; autostart=&amp;quot;1&amp;quot; domain=&amp;quot;only_an02&amp;quot; exclusive=&amp;quot;0&amp;quot; recovery=&amp;quot;restart&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 ref=&amp;quot;libvirtd&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;/script&amp;gt;&lt;br /&gt;
		&amp;lt;/service&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;&amp;lt;service ...&amp;gt;...&amp;lt;/service&amp;gt;&amp;lt;/span&amp;gt; elements have five attributes each;&lt;br /&gt;
* The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;name=&amp;quot;...&amp;quot;&amp;lt;/span&amp;gt; attribute is a unique name that will be used to identify the service, as we will see later.&lt;br /&gt;
* The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;autostart=&amp;quot;1&amp;quot;&amp;lt;/span&amp;gt; attribute tells the cluster that, when it starts, it should automatically start this service.&lt;br /&gt;
* The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;domain=&amp;quot;...&amp;quot;&amp;lt;/span&amp;gt; attribute tells the cluster which fail-over domain this service must run within. The two otherwise identical services each point to a different fail-over domain, as we discussed in the previous section.&lt;br /&gt;
* The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;exclusive=&amp;quot;0&amp;quot;&amp;lt;/span&amp;gt; attribute tells the cluster that a node running this service &#039;&#039;&#039;is&#039;&#039;&#039; allowed to to have other services running as well.&lt;br /&gt;
* The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;recovery=&amp;quot;restart&amp;quot;&amp;lt;/span&amp;gt; attribute sets the service recovery policy. As the name implies, the cluster will try to restart this service should it fail. Should the service fail multiple times in a row, it will be disabled. The exact number of failures allowed before disabling is configurable using the optional &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;max_restarts&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;restart_expire_time&amp;lt;/span&amp;gt; attributes, which are not covered here.&lt;br /&gt;
&lt;br /&gt;
{{warning|1=It is a fairly common mistake to interpret &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;exclusive&amp;lt;/span&amp;gt; to mean that a service is only allowed to run on one node at a time. This is not the case, please do not use this attribute incorrectly.}}&lt;br /&gt;
&lt;br /&gt;
Within each of the two &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;service ...&amp;gt;...&amp;lt;/service&amp;gt;&amp;lt;/span&amp;gt; attributes are four &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;script...&amp;gt;&amp;lt;/span&amp;gt; type resources. These are configured as a service tree in the order;&lt;br /&gt;
* &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; -&amp;gt; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;libvirtd&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Each of these &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;script ...&amp;gt;&amp;lt;/span&amp;gt; elements has just one attribute; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ref=&amp;quot;...&amp;quot;&amp;lt;/span&amp;gt; which points to a corresponding &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;script&amp;lt;/span&amp;gt; resource. &lt;br /&gt;
&lt;br /&gt;
The logic for this particular resource tree is;&lt;br /&gt;
* DRBD needs to start so that the bare clustered storage devices become available.&lt;br /&gt;
* Clustered LVM must next start so that the logical volumes used by GFS2 and our VMs become available.&lt;br /&gt;
* The GFS2 partition contains the [[XML]] definition files needed to start our virtual machines.&lt;br /&gt;
* Finally, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;libvirtd&amp;lt;/span&amp;gt; must be running for the virtual machines to be able to run. By putting this daemon in the resource tree, we can ensure that no attempt to start a VM will succeed until all of the clustered storage stack is available.&lt;br /&gt;
&lt;br /&gt;
From the other direction, we need the stop order to be organized in the reverse order.&lt;br /&gt;
* Stopping &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;libvirtd&amp;lt;/span&amp;gt; would cause any remaining running VMs to stop. If a VM is blocking, it will prevent &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;libvirtd&amp;lt;/span&amp;gt; from stopping and, thus, delay any of our other clustered storage resources from attempting to stop.&lt;br /&gt;
* We need the GFS2 partition to unmount after the VM goes down and before Clustered LVM map stop.&lt;br /&gt;
* With all VMs and the GFS2 partition stopped, we can safely say that all LVs are no longer in use and thus &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clvmd&amp;lt;/span&amp;gt; can stop.&lt;br /&gt;
* With Clustered LVM now stopped, nothing should be using our DRBD resources any more, so we can safely stop them, too.&lt;br /&gt;
&lt;br /&gt;
All in all, it&#039;s a surprisingly simple and effective configuration.&lt;br /&gt;
&lt;br /&gt;
== Validating And Pushing The Changes ==&lt;br /&gt;
&lt;br /&gt;
We&#039;ve made a big change, so it&#039;s all the more important that we validate the config before proceeding.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ccs_config_validate &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Configuration validates&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We need to now tell the cluster to use the new configuration file. Unlike last time, we won&#039;t use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rsync&amp;lt;/span&amp;gt;. Now that the cluster is up and running, we can use it to push out the updated configuration file using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman_tool&amp;lt;/span&amp;gt;. This is the first time we&#039;ve used the cluster to push out an updated &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cluster.conf&amp;lt;/span&amp;gt; file, so we will have to enter the password we set earlier for the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ricci&amp;lt;/span&amp;gt; user on both nodes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cman_tool version -r&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
You have not authenticated to the ricci daemon on an-node01.alteeve.com&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Password: &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
You have not authenticated to the ricci daemon on an-node02.alteeve.com&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Password: &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you were watching syslog, you will have seen an entries like the ones below.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Dec 14 20:39:08 an-node01 modcluster: Updating cluster.conf&lt;br /&gt;
Dec 14 20:39:12 an-node01 corosync[2360]:   [QUORUM] Members[2]: 1 2&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we can confirm that both nodes are using the new configuration by re-running the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman_tool version&amp;lt;/span&amp;gt; command, but without the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;-r&amp;lt;/span&amp;gt; switch.&lt;br /&gt;
&lt;br /&gt;
On &#039;&#039;&#039;both&#039;&#039;&#039;;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cman_tool version&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
6.2.0 config 10&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Checking The Cluster&#039;s Status ==&lt;br /&gt;
&lt;br /&gt;
Now let&#039;s look at a new tool; &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clustat&amp;lt;/span&amp;gt;, &#039;&#039;&#039;clu&#039;&#039;&#039;ster &#039;&#039;&#039;stat&#039;&#039;&#039;us. We&#039;ll be using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clustat&amp;lt;/span&amp;gt; extensively from here on out to monitor the status of the cluster members and managed services. It does not manage the cluster in any way, it is simply a status tool. We&#039;ll see how &lt;br /&gt;
&lt;br /&gt;
Here is what it should look like when run from &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;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-cluster-A @ Wed Dec 14 20:45:04 2011&lt;br /&gt;
Member Status: Quorate&lt;br /&gt;
&lt;br /&gt;
 Member Name                             ID   Status&lt;br /&gt;
 ------ ----                             ---- ------&lt;br /&gt;
 an-node01.alteeve.com                       1 Online, Local&lt;br /&gt;
 an-node02.alteeve.com                       2 Online&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At this point, we&#039;re only running the foundation of the cluster, so we can only see which nodes are in the cluster. We&#039;ve added resources to the cluster configuration though, so it&#039;s time to start the resource layer as well, which is managed by the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; daemon. &lt;br /&gt;
&lt;br /&gt;
At this time, we&#039;re still starting the cluster manually after each node boots, so we&#039;re going to make sure that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; is disabled at boot.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
chkconfig rgmanager off&lt;br /&gt;
chkconfig --list rgmanager&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
rgmanager      	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;
Now let&#039;s start it. &lt;br /&gt;
&lt;br /&gt;
{{note|1=We&#039;ve configured the storage services to start automatically. When we start &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; now, it will start the storage resources, including DRBD. In turn, DRBD will stop up to five minutes and wait for its peer. This will cause the first node you start &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; on to appear to hang until the other node&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; has started DRBD as well.}}&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;
Now let&#039;s run &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clustat&amp;lt;/span&amp;gt; again, and see what&#039;s new.&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-cluster-A @ Wed Dec 14 20:52:11 2011&lt;br /&gt;
Member Status: Quorate&lt;br /&gt;
&lt;br /&gt;
 Member Name                             ID   Status&lt;br /&gt;
 ------ ----                             ---- ------&lt;br /&gt;
 an-node01.alteeve.com                       1 Online, Local, rgmanager&lt;br /&gt;
 an-node02.alteeve.com                       2 Online, rgmanager&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State         &lt;br /&gt;
 ------- ----                   ----- ------                   -----         &lt;br /&gt;
 service:storage_an01           an-node01.alteeve.com          started       &lt;br /&gt;
 service:storage_an02           an-node02.alteeve.com          started       &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
What we see are two section; The top section shows the cluster members and the lower part covers the managed resources. &lt;br /&gt;
&lt;br /&gt;
We can see that both members, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01.alteeve.com&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02.alteeve.com&amp;lt;/span&amp;gt; are &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Online&amp;lt;/span&amp;gt;, meaning that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt; is running and that they&#039;ve joined the cluster. It also shows us that both members are running &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt;. You will always see &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Local&amp;lt;/span&amp;gt; beside the name of the node you ran the actual &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clustat&amp;lt;/span&amp;gt; command from.&lt;br /&gt;
&lt;br /&gt;
Under the services, you can see the two new services we created with the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;service:&amp;lt;/span&amp;gt; prefix. We can see that each service is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;started&amp;lt;/span&amp;gt;, meaning that all four of the resources are up and running properly and which node each service is running on.&lt;br /&gt;
&lt;br /&gt;
Note that the two storage services are running, despite not having started them? That is because the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; service was started earlier. When we pushed out the updated configuration, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; saw the two new storage services had &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;autostart=&amp;quot;1&amp;quot;&amp;lt;/span&amp;gt; and started them. If you check your storage services now, you will see that they are all online.&lt;br /&gt;
&lt;br /&gt;
DRBD;&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;
version: 8.3.12 (api:88/proto:86-96)&lt;br /&gt;
GIT-hash: e2a8ef4656be026bbae540305fcb998a5991090f build by dag@Build64R6, 2011-11-20 10:57:03&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;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Clustered LVM;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
pvscan; vgscan; 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;
  PV /dev/drbd2   VG an02-vg0     lvm2 [201.25 GiB / 201.25 GiB free]&lt;br /&gt;
  PV /dev/drbd1   VG an01-vg0     lvm2 [201.62 GiB / 201.62 GiB free]&lt;br /&gt;
  PV /dev/drbd0   VG shared-vg0   lvm2 [18.61 GiB / 0    free]&lt;br /&gt;
  Total: 3 [421.48 GiB] / in use: 3 [421.48 GiB] / in no VG: 0 [0   ]&lt;br /&gt;
  Reading all physical volumes.  This may take a while...&lt;br /&gt;
  Found volume group &amp;quot;an02-vg0&amp;quot; using metadata type lvm2&lt;br /&gt;
  Found volume group &amp;quot;an01-vg0&amp;quot; using metadata type lvm2&lt;br /&gt;
  Found volume group &amp;quot;shared-vg0&amp;quot; using metadata type lvm2&lt;br /&gt;
  ACTIVE            &#039;/dev/shared-vg0/shared&#039; [18.61 GiB] inherit&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
GFS2;&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;
Configured GFS2 mountpoints: &lt;br /&gt;
/shared&lt;br /&gt;
Active GFS2 mountpoints: &lt;br /&gt;
/shared&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Nice, eh?&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;&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;
&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;
== Stopping Clustered Storage - A Preview To Cold-Stopping The Cluster ==&lt;br /&gt;
&lt;br /&gt;
To stop the storage services, we&#039;ll use the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; command line tool &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clusvcadm&amp;lt;/span&amp;gt;, the &#039;&#039;&#039;clu&#039;&#039;&#039;ster &#039;&#039;&#039;s&#039;&#039;&#039;er&#039;&#039;&#039;v&#039;&#039;&#039;i&#039;&#039;&#039;c&#039;&#039;&#039;e &#039;&#039;&#039;adm&#039;&#039;&#039;inistrator. Specifically, we&#039;ll use its &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;-d&amp;lt;/span&amp;gt; switch, which tells &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; to &#039;&#039;&#039;d&#039;&#039;&#039;isable the service.&lt;br /&gt;
&lt;br /&gt;
{{note|1=Services with the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;service:&amp;lt;/span&amp;gt; prefix can be called with their name alone. As we will see later, other services will need to have the service type prefix included.}}&lt;br /&gt;
&lt;br /&gt;
As always, confirm the current state of affairs before starting. On both nodes, run &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clustat&amp;lt;/span&amp;gt; to confirm that the storage services are up.&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-cluster-A @ Tue Dec 20 20:37:42 2011&lt;br /&gt;
Member Status: Quorate&lt;br /&gt;
&lt;br /&gt;
 Member Name                             ID   Status&lt;br /&gt;
 ------ ----                             ---- ------&lt;br /&gt;
 an-node01.alteeve.com                       1 Online, Local, rgmanager&lt;br /&gt;
 an-node02.alteeve.com                       2 Online, rgmanager&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State         &lt;br /&gt;
 ------- ----                   ----- ------                   -----         &lt;br /&gt;
 service:storage_an01           an-node01.alteeve.com          started       &lt;br /&gt;
 service:storage_an02           an-node02.alteeve.com          started       &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
They are, so now lets gracefully shut them down.&lt;br /&gt;
&lt;br /&gt;
On &#039;&#039;&#039;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;&#039;&#039;&#039;, run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
clusvcadm -d storage_an01&lt;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 service:storage_an01...Success&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If we now run &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clustat&amp;lt;/span&amp;gt; from either node, we should see this;&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-cluster-A @ Tue Dec 20 20:38:28 2011&lt;br /&gt;
Member Status: Quorate&lt;br /&gt;
&lt;br /&gt;
 Member Name                             ID   Status&lt;br /&gt;
 ------ ----                             ---- ------&lt;br /&gt;
 an-node01.alteeve.com                       1 Online, Local, rgmanager&lt;br /&gt;
 an-node02.alteeve.com                       2 Online, rgmanager&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State         &lt;br /&gt;
 ------- ----                   ----- ------                   -----         &lt;br /&gt;
 service:storage_an01           (an-node01.alteeve.com)        disabled      &lt;br /&gt;
 service:storage_an02           an-node02.alteeve.com          started       &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Notice how &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;service:storage_an01&amp;lt;/span&amp;gt; is now in the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;disabled&amp;lt;/span&amp;gt; state? If you check the status of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;drbd&amp;lt;/span&amp;gt; now on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt; you will see that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt; is indeed down.&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.12 (api:88/proto:86-96)&lt;br /&gt;
GIT-hash: e2a8ef4656be026bbae540305fcb998a5991090f build by dag@Build64R6, 2011-11-20 10:57:03&lt;br /&gt;
m:res  cs            ro               ds                 p  mounted  fstype&lt;br /&gt;
0:r0   WFConnection  Primary/Unknown  UpToDate/Outdated  C&lt;br /&gt;
1:r1   WFConnection  Primary/Unknown  UpToDate/Outdated  C&lt;br /&gt;
2:r2   WFConnection  Primary/Unknown  UpToDate/Outdated  C&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you want to shut down the entire cluster, you will need to stop the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;storage_an02&amp;lt;/span&amp;gt; service as well. For fun, let&#039;s do this, but lets stop the service from &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
clusvcadm -d storage_an02&lt;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 service:storage_an02...Success&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now on both nodes, we should see this from &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-cluster-A @ Tue Dec 20 20:39: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-node01.alteeve.com                       1 Online, Local, rgmanager&lt;br /&gt;
 an-node02.alteeve.com                       2 Online, rgmanager&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State         &lt;br /&gt;
 ------- ----                   ----- ------                   -----         &lt;br /&gt;
 service:storage_an01           (an-node01.alteeve.com)        disabled      &lt;br /&gt;
 service:storage_an02           (an-node02.alteeve.com)        disabled      &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{warning|1=If you are not doing a cold shut-down of the cluster, you will want to skip this step and just stop &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt;. The reason is that the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;autostart=&amp;quot;1&amp;quot;&amp;lt;/span&amp;gt; value only gets evaluated when [[quorum]] is gained. If you disable the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;storage_anXX&amp;lt;/span&amp;gt; service and then reboot the node, the cluster has not lost quorum. Thus, when the node rejoins the cluster, the storage service &#039;&#039;&#039;will not&#039;&#039;&#039; automatically start.}}&lt;br /&gt;
&lt;br /&gt;
We can now, if we wanted to, stop the &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;cman&amp;lt;/span&amp;gt; daemons. This is, in fact, how we will cold-stop the cluster from now on.&lt;br /&gt;
&lt;br /&gt;
We&#039;ll cover cold stopping the cluster after we finish provisioning VMs.&lt;br /&gt;
&lt;br /&gt;
== Starting Clustered Storage ==&lt;br /&gt;
&lt;br /&gt;
Normally from now on, the clustered storage will start automatically. However, it&#039;s a good exercise to look at how to manually start them, just in case.&lt;br /&gt;
&lt;br /&gt;
The main difference from stopping the service is that we swap the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;-d&amp;lt;/span&amp;gt; switch for the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;-e&amp;lt;/span&amp;gt;, &#039;&#039;&#039;e&#039;&#039;&#039;nable, switch. We will also add the target cluster member name using the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;-m&amp;lt;/span&amp;gt; switch. We didn&#039;t need to use the member switch while stopping because the cluster could tell where the service was running and, thus, which member to contact to stop the service.&lt;br /&gt;
&lt;br /&gt;
Should you omit the member name, the cluster will try to use the local node as the target member. Note though that a target service will start on the node the command was issued on, regardless of the fail-over domain&#039;s ordered policy. That is to say, a service will not start on another node in the cluster when the member option is not specified, despite the fail-over configuration set to prefer another node.&lt;br /&gt;
&lt;br /&gt;
{{note|1=The storage services need to start at about the same time on both nodes. This is because the initially started storage service will hang when it tries to start &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;drbd&amp;lt;/span&amp;gt; until either the other node is up or until it times out. For this reason, be sure to have two terminal windows open to make then next two calls simultaneously.}}&lt;br /&gt;
&lt;br /&gt;
On &#039;&#039;&#039;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;&#039;&#039;&#039;, run;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
clusvcadm -e storage_an01 -m an-node01.alteeve.com&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Member an-node01.alteeve.com trying to enable service:storage_an01...Success&lt;br /&gt;
service:storage_an01 is now running on an-node01.alteeve.com&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On &#039;&#039;&#039;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt;&#039;&#039;&#039;, run;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
clusvcadm -e storage_an02 -m an-node02.alteeve.com&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Member an-node02.alteeve.com trying to enable service:storage_an02...Success&lt;br /&gt;
service:storage_an02 is now running on an-node02.alteeve.com&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; on either node should again show the storage services running again.&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-cluster-A @ Tue Dec 20 21:09:19 2011&lt;br /&gt;
Member Status: Quorate&lt;br /&gt;
&lt;br /&gt;
 Member Name                             ID   Status&lt;br /&gt;
 ------ ----                             ---- ------&lt;br /&gt;
 an-node01.alteeve.com                       1 Online, Local, rgmanager&lt;br /&gt;
 an-node02.alteeve.com                       2 Online, rgmanager&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State         &lt;br /&gt;
 ------- ----                   ----- ------                   -----         &lt;br /&gt;
 service:storage_an01           an-node01.alteeve.com          started       &lt;br /&gt;
 service:storage_an02           an-node02.alteeve.com          started       &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== A Note On Resource Management With DRBD ==&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 for &lt;br /&gt;
&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/drbd.d/global_common.conf&amp;lt;/span&amp;gt;&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;wfc-timeout&amp;lt;/span&amp;gt; seconds (&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;300&amp;lt;/span&amp;gt; in our case) 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;
If the clustered storage service ever fails, look in [[syslog]]&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/var/log/messages&amp;lt;/span&amp;gt; for a split-brain error. Look for a message 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-node01 kernel: block drbd2: helper command: /sbin/drbdadm initial-split-brain minor-2&lt;br /&gt;
Mar 29 20:24:37 an-node01 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-node01 kernel: block drbd2: Split-Brain detected but unresolved, dropping connection!&lt;br /&gt;
Mar 29 20:24:37 an-node01 kernel: block drbd2: helper command: /sbin/drbdadm split-brain minor-2&lt;br /&gt;
Mar 29 20:24:37 an-node01 kernel: block drbd2: helper command: /sbin/drbdadm split-brain minor-2 exit code 0 (0x0)&lt;br /&gt;
Mar 29 20:24:37 an-node01 kernel: block drbd2: conn( WFReportParams -&amp;gt; Disconnecting )&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With the fencing hook into the cluster, this should be a very hard problem to run into. If you do though, [http://linbit.com Linbit] has the authoritative guide to recover from this situation.&lt;br /&gt;
&lt;br /&gt;
* [http://www.drbd.org/users-guide-legacy/s-resolve-split-brain.html Manual split brain recovery]&lt;br /&gt;
&lt;br /&gt;
= Provisioning Virtual Machines =&lt;br /&gt;
&lt;br /&gt;
Now we&#039;re getting to the purpose of our cluster; Provision virtual machines!&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; Assign a collection of emulated hardware, connected to physical devices, to a given virtual machine and begin the process of installing the operating system on it. This tutorial is more about clustering than it is about virtual machine administration, so some experience with managing virtual machines has to be assumed. If you need to brush up, here are some resources;&lt;br /&gt;
&lt;br /&gt;
* [http://www.linux-kvm.org/page/HOWTO KVM project&#039;s How-Tos]&lt;br /&gt;
* [http://kvm.et.redhat.com/page/FAQ KVM project&#039;s FAQ]&lt;br /&gt;
* [http://docs.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/6/html/Hypervisor_Deployment_Guide/index.html Red Hat&#039;s Hypervisor Guide]&lt;br /&gt;
* [http://docs.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/6/html/Virtualization_Getting_Started_Guide/index.html Red Hat&#039;s Virtualization Guide]&lt;br /&gt;
* [http://docs.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/6/html/Virtualization_Administration_Guide/index.html Red Hat&#039;s Virtualization Administration]&lt;br /&gt;
* [http://docs.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/6/html/Virtualization_Host_Configuration_and_Guest_Installation_Guide/index.html Red Hat&#039;s Virtualization Host Configuration and Guest Installation Guide]&lt;br /&gt;
&lt;br /&gt;
When you feel comfortable, proceed.&lt;br /&gt;
&lt;br /&gt;
== Before We Begin - Setting Up Our Workstation ==&lt;br /&gt;
&lt;br /&gt;
The virtual machines are, for obvious reasons, headless. That is, they have no real video card into which we can plug a monitor and watch the progress of the install. This would, left unresolved, make it pretty hard to install the operating systems as there is simply no network in the early stages of most operating system installations.&lt;br /&gt;
&lt;br /&gt;
Part of the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;libvirtd&amp;lt;/span&amp;gt; package is a program called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-manager&amp;lt;/span&amp;gt; which is available on most all modern Linux distributions. This application makes it very easy to connect to our virtual machines, regardless of their network state.&lt;br /&gt;
&lt;br /&gt;
How you install this will depend on your workstation. &lt;br /&gt;
&lt;br /&gt;
On [[RPM]]-based systems, try:&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;
On [[deb]] based systems, try:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
apt-get install virt-manager&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On [[SUSE]]-based systems, try;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
zypper install virt-manager&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once it is installed, you need to determine whether your workstation is on the [[IFN]] or [[BCN]]. I&#039;ve got my laptop on the BCN, so I will connect to the nodes using just their short host names. If you&#039;re on the same IFN as the nodes, you will need to append &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;.ifn&amp;lt;/span&amp;gt; to the host names.&lt;br /&gt;
&lt;br /&gt;
[[Image:2n-RHEL6-KVM_virt-manager_01.png|thumb|448px|center|Initial installation of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-manager&amp;lt;/span&amp;gt;.]]&lt;br /&gt;
&lt;br /&gt;
To connect to the the cluster nodes;&lt;br /&gt;
&lt;br /&gt;
# Click on &#039;&#039;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;File&amp;lt;/span&amp;gt;&#039;&#039; -&amp;gt; &#039;&#039;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Add Connection...&amp;lt;/span&amp;gt;&#039;&#039;. &lt;br /&gt;
# Make sure that &#039;&#039;Hypervisor&#039;&#039; is set to &#039;&#039;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;QEMU/KVM&amp;lt;/span&amp;gt;&#039;&#039;.&lt;br /&gt;
# Click to check &#039;&#039;Connect to remote host&#039;&#039;.&lt;br /&gt;
# Make sure that &#039;&#039;Method&#039;&#039; is set to &#039;&#039;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;SSH/span&amp;gt;&#039;&#039;.&lt;br /&gt;
# Make sure that &#039;&#039;Username&#039;&#039; is set to &#039;&#039;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;root&amp;lt;/span&amp;gt;&#039;&#039;.&lt;br /&gt;
# Enter the &#039;&#039;Hostname&#039;&#039; using the proper entry from &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/hosts&amp;lt;/span&amp;gt; (ie: &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt; or &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01.ifn&amp;lt;/span&amp;gt;)&lt;br /&gt;
# Click on the button labelled &#039;&#039;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Connect&amp;lt;/span&amp;gt;&#039;&#039;.&lt;br /&gt;
# Repeat these steps for the other node.&lt;br /&gt;
&lt;br /&gt;
[[Image:2n-RHEL6-KVM_virt-manager_02.png|thumb|700px|center|New connection window.]]&lt;br /&gt;
&lt;br /&gt;
Once your two nodes have been added to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-manager&amp;lt;/span&amp;gt;, you should see both nodes as connected, but no VMs will be shown as we&#039;ve not yet provisioned any yet.&lt;br /&gt;
&lt;br /&gt;
[[Image:2n-RHEL6-KVM_virt-manager_03.png|thumb|448px|center|Two nodes added to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-manager&amp;lt;/span&amp;gt;.]]&lt;br /&gt;
&lt;br /&gt;
We&#039;ll come back to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-manager&amp;lt;/span&amp;gt; shortly.&lt;br /&gt;
&lt;br /&gt;
== Provision Planning ==&lt;br /&gt;
&lt;br /&gt;
Before we can start creating virtual machines, we need to take stock of what resources we have available and how we want to divy them out to the VMs.&lt;br /&gt;
&lt;br /&gt;
In my cluster, I&#039;ve got 200 [[GiB]] available on each of my two nodes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vgdisplay |grep -i -e free -e &amp;quot;vg name&amp;quot;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
  VG Name               an02-vg0&lt;br /&gt;
  Free  PE / Size       51521 / 201.25 GiB&lt;br /&gt;
  VG Name               an01-vg0&lt;br /&gt;
  Free  PE / Size       51615 / 201.62 GiB&lt;br /&gt;
  VG Name               shared-vg0&lt;br /&gt;
  Free  PE / Size       0 / 0   &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I know I have 8 [[GiB]] of memory, but I have to slice off a certain amount of that for the host [[OS]]. I&#039;ve got my nodes sitting about where they will be normally, so I can check how much memory is in use fairly easily.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cat /proc/meminfo |grep -e MemTotal -e MemFree&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
MemTotal:        8050312 kB&lt;br /&gt;
MemFree:         7432288 kB&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I&#039;m sitting about about 604 [[MiB]] used (&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;8,050,312 [[KiB]] - 7,432,288 KiB == 618,024 KiB / 1,024 == 603.54 MiB). I think I can safely operate within 1 [[GiB]], leaving me 7 GiB of RAM to allocate to VMs.&lt;br /&gt;
&lt;br /&gt;
Next up, I need to confirm how many CPU cores I have available.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cat /proc/cpuinfo |grep processor&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
processor	: 0&lt;br /&gt;
processor	: 1&lt;br /&gt;
processor	: 2&lt;br /&gt;
processor	: 3&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I&#039;ve got four, and I like to dedicate the first one to the host OS, so I&#039;ve got three to allocate to my VMs.&lt;br /&gt;
&lt;br /&gt;
On the network front, I know I&#039;ve got two bridges, one to the [[IFN]] and one to the [[BCN]]. &lt;br /&gt;
&lt;br /&gt;
So let&#039;s summarize:&lt;br /&gt;
* 400 GiB of space, 200 GiB per DRBD resource.&lt;br /&gt;
* 7 GiB of RAM.&lt;br /&gt;
* 3 CPU cores (can over-allocate).&lt;br /&gt;
* 1 network bridge, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vbr2&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
With this list in mind, we can now start planning out the VMs.&lt;br /&gt;
&lt;br /&gt;
The network can share the same [[subnet]] as the [[IFN]] if you wish, but I prefer to isolate my VMs from the IFN using a different subnet, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;10.254.0.0/16&amp;lt;/span&amp;gt;. This is, admittedly, &amp;quot;security by obscurity&amp;quot; and in no way is it a replacement for proper isolation. In production, you will want to setup firewalls on you nodes to prevent access from virtual machines.&lt;br /&gt;
&lt;br /&gt;
With that said, here is what we will install now. Obviously, you will have other needs and goals. Mine is an admittedly artificial network.&lt;br /&gt;
* A development server. This would be used for testing, so it will have more modest resources.&lt;br /&gt;
* A web server, which will mainly use a DB server, so will need CPU and RAM, but not much disk. &lt;br /&gt;
* A database server. &lt;br /&gt;
* A windows server. I don&#039;t exactly have a use for it, except to show how to install a Windows VM for those who do need it.&lt;br /&gt;
&lt;br /&gt;
Now to divvy up the resources;&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!VM&lt;br /&gt;
!Name&lt;br /&gt;
!Primary Host&lt;br /&gt;
!Disk&lt;br /&gt;
!CPU&lt;br /&gt;
!RAM&lt;br /&gt;
![[IFN]]&lt;br /&gt;
!OS&lt;br /&gt;
|-&lt;br /&gt;
|Dev Server&lt;br /&gt;
|class=&amp;quot;code&amp;quot;|vm0001-dev&lt;br /&gt;
|class=&amp;quot;code&amp;quot;|an-node01&lt;br /&gt;
|150 [[GiB]]&lt;br /&gt;
|1 [[GiB]]&lt;br /&gt;
|2 core&lt;br /&gt;
|class=&amp;quot;code&amp;quot;|10.254.0.1/16&lt;br /&gt;
|CentOS 6&lt;br /&gt;
|-&lt;br /&gt;
|Web Server&lt;br /&gt;
|class=&amp;quot;code&amp;quot;|vm0002-web&lt;br /&gt;
|class=&amp;quot;code&amp;quot;|an-node01&lt;br /&gt;
|50 [[GiB]]&lt;br /&gt;
|2 [[GiB]]&lt;br /&gt;
|2 cores&lt;br /&gt;
|class=&amp;quot;code&amp;quot;|10.254.0.2/16&lt;br /&gt;
|CentOS 6&lt;br /&gt;
|-&lt;br /&gt;
|Database Server&lt;br /&gt;
|class=&amp;quot;code&amp;quot;|vm0003-db&lt;br /&gt;
|class=&amp;quot;code&amp;quot;|an-node02&lt;br /&gt;
|100 [[GiB]]&lt;br /&gt;
|2 [[GiB]]&lt;br /&gt;
|2 cores&lt;br /&gt;
|class=&amp;quot;code&amp;quot;|10.254.0.3/16&lt;br /&gt;
|CentOS 6&lt;br /&gt;
|-&lt;br /&gt;
|Web Server&lt;br /&gt;
|class=&amp;quot;code&amp;quot;|vm0004-ms&lt;br /&gt;
|class=&amp;quot;code&amp;quot;|an-node02&lt;br /&gt;
|100 [[GiB]]&lt;br /&gt;
|2 [[GiB]]&lt;br /&gt;
|2 cores&lt;br /&gt;
|class=&amp;quot;code&amp;quot;|10.254.0.4/16&lt;br /&gt;
|Windows Server 2008 R2 64-bit&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Notice that we&#039;ve over-allocated the CPU cores? This is ok. We&#039;re going to restrict the VMs to CPU cores number 1 through 3, leaving core number 0 for the host OS. When all of the VMs are running on one node, the hypervisor&#039;s scheduler will handle shuffling jobs from the VMs&#039; cores to the real cores that are least loaded at a given time. &lt;br /&gt;
&lt;br /&gt;
As for the RAM though, we can not use more than we have. We&#039;re going to leave 1 [[GiB]] for the host, so we&#039;ll divvy the remaining 7 GiB between the VMs. Remember, we have to plan for when all four VMs will run on just one node.&lt;br /&gt;
&lt;br /&gt;
==== A Note on VM Configuration ====&lt;br /&gt;
&lt;br /&gt;
It would be a questionably valueable divertion to cover the setup of each VM. It will be up to you, reader, to setup each VM however you like.&lt;br /&gt;
&lt;br /&gt;
=== Provisioning vm0001-dev ===&lt;br /&gt;
&lt;br /&gt;
{{note|1=We&#039;re going to spend a lot more time on this first VM, so bear with me here, even if you aren&#039;t interested in creating a VM like this.}}&lt;br /&gt;
&lt;br /&gt;
Before we can provision, we need to gather whatever install source we&#039;ll need for the VM. This can be a simple [[ISO]] file, as we&#039;ll see on the [[2-Node Red Hat KVM Cluster Tutorial#Provisioning vm0001-dev|windows install]] later, or it can be files on a web server, which we&#039;ll use here. We&#039;ll also need to create the &amp;quot;hard drive&amp;quot; for the VM, which will be a new [[LV]]. Finally, we&#039;ll craft the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-install&amp;lt;/span&amp;gt; command which will begin the actual OS install.&lt;br /&gt;
&lt;br /&gt;
This being a Linux machine, we can provision this using a network. Conveniently, I&#039;ve got a [[Setting Up a PXE Server on an RPM-based OS|PXE server]] setup with the CentOS install files available on my local network at &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;http://10.255.255.254/c6/x86_64/img/&amp;lt;/nowiki&amp;gt;&amp;lt;/span&amp;gt;. You don&#039;t need to have a full [[PXE]] server setup, mounting the install [[ISO]] and pointing a web server at the mounted directory would work just fine. I&#039;m also going to further customize my install by using a [[kickstart]] file which, effectively, pre-answers the installation questions so that the install is fully automated.&lt;br /&gt;
&lt;br /&gt;
So, let&#039;s create the new [[LV]]. I know that this machine will be primarily run on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt; and that it will be 150 [[GiB]]. I personally always name the [[LV]]s as &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vmXXXX-Y&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 VM&#039;s name and the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Y&amp;lt;/span&amp;gt; is a simple integer. You are obviously free to use whatever makes most sense to you.&lt;br /&gt;
&lt;br /&gt;
==== Creating vm0001-dev&#039;s Storage ====&lt;br /&gt;
&lt;br /&gt;
With that, the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;lvcreate&amp;lt;/span&amp;gt; call is;&lt;br /&gt;
&lt;br /&gt;
On &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&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;
lvcreate -L 150G -n vm0001-1 /dev/an01-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;
==== Creating vm0001-dev&#039;s virt-install Call ====&lt;br /&gt;
&lt;br /&gt;
Now with the storage created, we can craft the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-install&amp;lt;/span&amp;gt; command. I like to put this into a file under the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/shared/provision/&amp;lt;/span&amp;gt; directory for future reference. Let&#039;s take a look at the command, then we&#039;ll discuss what the switches are for.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
touch /shared/provision/vm0001-dev.sh&lt;br /&gt;
chmod 755 /shared/provision/vm0001-dev.sh &lt;br /&gt;
vim /shared/provision/vm0001-dev.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;
virt-install --connect qemu:///system \&lt;br /&gt;
  --name vm0001-dev \&lt;br /&gt;
  --ram 1024 \&lt;br /&gt;
  --arch x86_64 \&lt;br /&gt;
  --vcpus 1 \&lt;br /&gt;
  --location http://10.255.255.254/c6/x86_64/img/ \&lt;br /&gt;
  --extra-args &amp;quot;ks=http://10.255.255.254/c6/x86_64/ks/c6_minimal.ks&amp;quot; \&lt;br /&gt;
  --os-type linux \&lt;br /&gt;
  --os-variant rhel6 \&lt;br /&gt;
  --disk path=/dev/an01-vg0/vm0001-1 \&lt;br /&gt;
  --network bridge=vbr2 \&lt;br /&gt;
  --vnc&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{note|1=Don&#039;t use tabs to indent the lines.}}&lt;br /&gt;
&lt;br /&gt;
Let&#039;s break it down;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--connect qemu:///system&amp;lt;/span&amp;gt;&lt;br /&gt;
This tells &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-install&amp;lt;/span&amp;gt; to use the [[QEMU]] hardware emulator (as opposed to [[Xen]]) and to install the VM on to local system.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--name vm0001-dev&amp;lt;/span&amp;gt;&lt;br /&gt;
This sets the name of the VM. It is the name we will use in the cluster configuration and whenever we use the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;libvirtd&amp;lt;/span&amp;gt; tools, like &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virsh&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--ram 1024&amp;lt;/span&amp;gt;&lt;br /&gt;
This sets the amount of RAM, in [[MiB]], to allocate to this VM. Here, we&#039;re allocating 1 [[GiB]] (1,024 MiB).&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--arch x86_64&amp;lt;/span&amp;gt;&lt;br /&gt;
This sets the emulated CPU&#039;s architecture to 64-[[bit]]. This can be used even when you plan to install a 32-bit [[OS]], but not the other way around, of course.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--vcpus 1&amp;lt;/span&amp;gt;&lt;br /&gt;
This sets the number of CPU cores to allocate to this VM. Here, we&#039;re setting just one.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--location &amp;lt;nowiki&amp;gt;http://10.255255.254/c6/x86_64/img/&amp;lt;/nowiki&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
This tells &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-install&amp;lt;/span&amp;gt; to pull the installation files from the [[URL]] specified.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--extra-args &amp;quot;ks=&amp;lt;nowiki&amp;gt;http://10.255.255.254/c6/x86_64/ks/c6_minimal.ks&amp;lt;/nowiki&amp;gt;&amp;quot;&amp;lt;/span&amp;gt;&lt;br /&gt;
This is an optional command used to pass the install kernel arguments. Here, I&#039;m using it to tell the kernel to grab the specified kickstart file for use during the installation.&lt;br /&gt;
&lt;br /&gt;
{{note|1=If you want to copy the kickstart script used in this tutorial, you can [[File c6_minimal.ks|find it here]].}}&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--os-type linux&amp;lt;/span&amp;gt;&lt;br /&gt;
This broadly sets hardware emulation for optimal use with Linux-based virtual machines.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--os-variant rhel6&amp;lt;/span&amp;gt;&lt;br /&gt;
This further refines tweaks to the hardware emulation to maximize performance for [[RHEL]]6 (and derivative) installs.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--disk path=/dev/an01-vg0/vm0001-1&amp;lt;/span&amp;gt;&lt;br /&gt;
This tells the installer to use the [[LV]] we created earlier as the backing storage device for the new virtual machine.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--network bridge=vbr2&amp;lt;/span&amp;gt;&lt;br /&gt;
This tells the installer to create a network card in the VM and to then connect it to the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vbr2&amp;lt;/span&amp;gt; bridge, thus connecting the VM to the [[IFN]]. Optionally, you could add &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;,model=e1000&amp;lt;/span&amp;gt; option to tells the emulator to mimic an [[Intel]] &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;e1000&amp;lt;/span&amp;gt; hardware NIC. The default is to use the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[virtio]]&amp;lt;/span&amp;gt; virtualized network card. If you have two or more bridges, you can repeat the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--network&amp;lt;/span&amp;gt; switch as many times as you need.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--vnc&amp;lt;/span&amp;gt;&lt;br /&gt;
This tells &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-manager&amp;lt;/span&amp;gt; to create a [[VNC]] server on the VM and, if possible, immediately connect it the just-provisioned VM. With a minimal install on the nodes, the automatically spawned client will fail. This is fine, just use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-manager&amp;lt;/span&amp;gt; from my workstation.&lt;br /&gt;
&lt;br /&gt;
{{note|1=If you close the initial VNC window and want to reconnect to the VM, you can simply open up &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-manager&amp;lt;/span&amp;gt;, connect to the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt; host if needed, and double-click on the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0001-dev&amp;lt;/span&amp;gt; entry. This will effectively &amp;quot;plug a monitor into the VM&amp;quot;.}}&lt;br /&gt;
&lt;br /&gt;
==== Initializing vm0001-dev&#039;s Install ====&lt;br /&gt;
&lt;br /&gt;
Well, time to start the install!&lt;br /&gt;
&lt;br /&gt;
On &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&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;
/shared/provision/vm0001-dev.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;
Starting install...&lt;br /&gt;
Retrieving file .treeinfo...                             |  676 B     00:00 ... &lt;br /&gt;
Retrieving file vmlinuz...                               | 7.5 MB     00:00 ... &lt;br /&gt;
Retrieving file initrd.img...                            |  59 MB     00:02 ... &lt;br /&gt;
Creating domain...                                       |    0 B     00:00     &lt;br /&gt;
WARNING  Unable to connect to graphical console: virt-viewer not installed. Please install the &#039;virt-viewer&#039; package.&lt;br /&gt;
Domain installation still in progress. You can reconnect to &lt;br /&gt;
the console to complete the installation process.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And it&#039;s off!&lt;br /&gt;
&lt;br /&gt;
[[Image:2n-RHEL6-KVM_vm0001_provision_01.png|thumb|700px|center|Initial provision of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0001-dev&amp;lt;/span&amp;gt;.]]&lt;br /&gt;
&lt;br /&gt;
Progressing nicely.&lt;br /&gt;
&lt;br /&gt;
[[Image:2n-RHEL6-KVM_vm0001_provision_02.png|thumb|700px|center|Installation of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0001-dev&amp;lt;/span&amp;gt; proceeding as expected.]]&lt;br /&gt;
&lt;br /&gt;
And done! Note that, depending on your kickstart file, it may have automatically rebooted or you may need to reboot manually.&lt;br /&gt;
&lt;br /&gt;
{{note|1=I&#039;ve found that there are occassions where the VM will power off instead of rebooting. With &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-manager&amp;lt;/span&amp;gt;, you can click to select the new VM and then press the &amp;quot;play&amp;quot; button to boot the VM manually.}}&lt;br /&gt;
&lt;br /&gt;
[[Image:2n-RHEL6-KVM_vm0001_provision_03.png|thumb|700px|center|Installation of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0001-dev&amp;lt;/span&amp;gt; complete.]]&lt;br /&gt;
&lt;br /&gt;
==== Defining vm0001-dev On an-node02 ====&lt;br /&gt;
&lt;br /&gt;
We can use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virsh&amp;lt;/span&amp;gt; to see that the new virtual machine exists and what state it is in. Note that I&#039;ve gotten into the habit of using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--all&amp;lt;/span&amp;gt; to get around &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virsh&amp;lt;/span&amp;gt;&#039;s default behaviour of hiding VMs that are off.&lt;br /&gt;
&lt;br /&gt;
On &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;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;
  2 vm0001-dev           running&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;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;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As we see, the new &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0001-dev&amp;lt;/span&amp;gt; is only known to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;. This is, in and of itself, just fine.&lt;br /&gt;
&lt;br /&gt;
We&#039;re going to need to put the virtual machine&#039;s [[XML]] definition file in a common place accessible on both nodes. This could be matching but separate directories on either node, or it can be a common shared location. As we&#039;ve got the cluster&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/shared&amp;lt;/span&amp;gt; GFS2 partition, we&#039;re going to use the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/shared/definitions&amp;lt;/span&amp;gt; directory we create earlier. This avoids the need to remember to keep two copies of the file in sync across both nodes.&lt;br /&gt;
&lt;br /&gt;
To backup the VM&#039;s configuration, we&#039;ll again use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virsh&amp;lt;/span&amp;gt;, but this time with the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;dumpxml&amp;lt;/span&amp;gt; command.&lt;br /&gt;
&lt;br /&gt;
On &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;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 dumpxml vm0001-dev &amp;gt; /shared/definitions/vm0001-dev.xml&lt;br /&gt;
cat /shared/definitions/vm0001-dev.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;kvm&#039; id=&#039;2&#039;&amp;gt;&lt;br /&gt;
  &amp;lt;name&amp;gt;vm0001-dev&amp;lt;/name&amp;gt;&lt;br /&gt;
  &amp;lt;uuid&amp;gt;2512b2dd-a1a8-f990-2a0d-6c41968ab3f8&amp;lt;/uuid&amp;gt;&lt;br /&gt;
  &amp;lt;memory&amp;gt;1048576&amp;lt;/memory&amp;gt;&lt;br /&gt;
  &amp;lt;currentMemory&amp;gt;1048576&amp;lt;/currentMemory&amp;gt;&lt;br /&gt;
  &amp;lt;vcpu&amp;gt;1&amp;lt;/vcpu&amp;gt;&lt;br /&gt;
  &amp;lt;os&amp;gt;&lt;br /&gt;
    &amp;lt;type arch=&#039;x86_64&#039; machine=&#039;rhel6.2.0&#039;&amp;gt;hvm&amp;lt;/type&amp;gt;&lt;br /&gt;
    &amp;lt;boot dev=&#039;network&#039;/&amp;gt;&lt;br /&gt;
    &amp;lt;boot dev=&#039;cdrom&#039;/&amp;gt;&lt;br /&gt;
    &amp;lt;boot dev=&#039;hd&#039;/&amp;gt;&lt;br /&gt;
    &amp;lt;bootmenu enable=&#039;yes&#039;/&amp;gt;&lt;br /&gt;
  &amp;lt;/os&amp;gt;&lt;br /&gt;
  &amp;lt;features&amp;gt;&lt;br /&gt;
    &amp;lt;acpi/&amp;gt;&lt;br /&gt;
    &amp;lt;apic/&amp;gt;&lt;br /&gt;
    &amp;lt;pae/&amp;gt;&lt;br /&gt;
  &amp;lt;/features&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;emulator&amp;gt;/usr/libexec/qemu-kvm&amp;lt;/emulator&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;qemu&#039; type=&#039;raw&#039; cache=&#039;none&#039; io=&#039;native&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;source dev=&#039;/dev/an01-vg0/vm0001-1&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;target dev=&#039;vda&#039; bus=&#039;virtio&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;alias name=&#039;virtio-disk0&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;address type=&#039;pci&#039; domain=&#039;0x0000&#039; bus=&#039;0x00&#039; slot=&#039;0x04&#039; function=&#039;0x0&#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;52:54:00:9b:3c:f7&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;source bridge=&#039;vbr2&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;target dev=&#039;vnet0&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;model type=&#039;virtio&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;alias name=&#039;net0&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;address type=&#039;pci&#039; domain=&#039;0x0000&#039; bus=&#039;0x00&#039; slot=&#039;0x03&#039; function=&#039;0x0&#039;/&amp;gt;&lt;br /&gt;
    &amp;lt;/interface&amp;gt;&lt;br /&gt;
    &amp;lt;serial type=&#039;pty&#039;&amp;gt;&lt;br /&gt;
      &amp;lt;source path=&#039;/dev/pts/2&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;target port=&#039;0&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;alias name=&#039;serial0&#039;/&amp;gt;&lt;br /&gt;
    &amp;lt;/serial&amp;gt;&lt;br /&gt;
    &amp;lt;console type=&#039;pty&#039; tty=&#039;/dev/pts/2&#039;&amp;gt;&lt;br /&gt;
      &amp;lt;source path=&#039;/dev/pts/2&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;target type=&#039;serial&#039; port=&#039;0&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;alias name=&#039;serial0&#039;/&amp;gt;&lt;br /&gt;
    &amp;lt;/console&amp;gt;&lt;br /&gt;
    &amp;lt;input type=&#039;tablet&#039; bus=&#039;usb&#039;&amp;gt;&lt;br /&gt;
      &amp;lt;alias name=&#039;input0&#039;/&amp;gt;&lt;br /&gt;
    &amp;lt;/input&amp;gt;&lt;br /&gt;
    &amp;lt;input type=&#039;mouse&#039; bus=&#039;ps2&#039;/&amp;gt;&lt;br /&gt;
    &amp;lt;graphics type=&#039;vnc&#039; port=&#039;5900&#039; autoport=&#039;yes&#039;/&amp;gt;&lt;br /&gt;
    &amp;lt;video&amp;gt;&lt;br /&gt;
      &amp;lt;model type=&#039;cirrus&#039; vram=&#039;9216&#039; heads=&#039;1&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;alias name=&#039;video0&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;address type=&#039;pci&#039; domain=&#039;0x0000&#039; bus=&#039;0x00&#039; slot=&#039;0x02&#039; function=&#039;0x0&#039;/&amp;gt;&lt;br /&gt;
    &amp;lt;/video&amp;gt;&lt;br /&gt;
    &amp;lt;memballoon model=&#039;virtio&#039;&amp;gt;&lt;br /&gt;
      &amp;lt;alias name=&#039;balloon0&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;address type=&#039;pci&#039; domain=&#039;0x0000&#039; bus=&#039;0x00&#039; slot=&#039;0x05&#039; function=&#039;0x0&#039;/&amp;gt;&lt;br /&gt;
    &amp;lt;/memballoon&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;
There we go; That is the emulated hardware on which your virtual machine exists. Pretty neat, eh?&lt;br /&gt;
&lt;br /&gt;
I like to keep all of my VMs defined on all of my nodes. This is entirely optional, as the cluster will define the VM on a target node when needed. It is, though, a good chance to examine how this is done manually.&lt;br /&gt;
&lt;br /&gt;
On &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;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 /shared/definitions/vm0001-dev.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-dev defined from /shared/definitions/vm0001-dev.xml&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can confirm that it now exists by re-running &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virsh list --all&amp;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;
  - vm0001-dev           shut off&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You should also now be able to see &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0001-dev&amp;lt;/span&amp;gt; under &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt; in your &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-manager&amp;lt;/span&amp;gt; window. It will be listed as &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;shutoff&amp;lt;/span&amp;gt;, which is expected. &#039;&#039;&#039;Do not&#039;&#039;&#039; try to turn it on while it&#039;s running on the other node!&lt;br /&gt;
&lt;br /&gt;
=== Provisioning vm0002-web ===&lt;br /&gt;
&lt;br /&gt;
This installation will be pretty much the same as it was for &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0001-dev&amp;lt;/span&amp;gt;, so we&#039;ll look mainly at the differences.&lt;br /&gt;
&lt;br /&gt;
==== Creating vm0002-web&#039;s Storage ====&lt;br /&gt;
&lt;br /&gt;
We&#039;ll use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;lvcreate&amp;lt;/span&amp;gt; again, but this time we won&#039;t specify a specific size, but instead a percentage of the remainin free space will be defined. Note that the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;-L&amp;lt;/span&amp;gt; switch changes to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;-l&amp;lt;/span&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
On &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&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;
lvcreate -l 100%FREE -n vm0002-1 /dev/an01-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;
==== Creating vm0002-web&#039;s virt-install Call ====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-install&amp;lt;/span&amp;gt; command will be quite similar to the previous one.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
touch /shared/provision/vm0002-web.sh&lt;br /&gt;
chmod 755 /shared/provision/vm0002-web.sh &lt;br /&gt;
vim /shared/provision/vm0002-web.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;
virt-install --connect qemu:///system \&lt;br /&gt;
  --name vm0002-web \&lt;br /&gt;
  --ram 2048 \&lt;br /&gt;
  --arch x86_64 \&lt;br /&gt;
  --vcpus 2 \&lt;br /&gt;
  --location http://10.255.255.254/c6/x86_64/img/ \&lt;br /&gt;
  --extra-args &amp;quot;ks=http://10.255.255.254/c6/x86_64/ks/c6_minimal.ks&amp;quot; \&lt;br /&gt;
  --os-type linux \&lt;br /&gt;
  --os-variant rhel6 \&lt;br /&gt;
  --disk path=/dev/an01-vg0/vm0002-1 \&lt;br /&gt;
  --network bridge=vbr2 \&lt;br /&gt;
  --vnc&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Lets look at the differences;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--name vm0002-web&amp;lt;/span&amp;gt;; This sets the new name of the VM.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--ram 2048&amp;lt;/span&amp;gt;; This doubles the amount of RAM to 2048 [[MiB]].&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--vcpus 2&amp;lt;/span&amp;gt;; This sets the number of CPU cores to two.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--disk path=/dev/an01-vg0/vm0002-1&amp;lt;/span&amp;gt;; The path to the new LV is set.&lt;br /&gt;
&lt;br /&gt;
Note that the same kickstart file from before is used. This is fine as it doesn&#039;t specify a specific IP address and it is smart enough to adapt to the new virtual disk size.&lt;br /&gt;
&lt;br /&gt;
==== Initializing vm0002-web&#039;s Install ====&lt;br /&gt;
&lt;br /&gt;
Well, time to start the install!&lt;br /&gt;
&lt;br /&gt;
On &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&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;
/shared/provision/vm0002-web.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;
Starting install...&lt;br /&gt;
Retrieving file .treeinfo...                             |  676 B     00:00 ... &lt;br /&gt;
Retrieving file vmlinuz...                               | 7.5 MB     00:00 ... &lt;br /&gt;
Retrieving file initrd.img...                            |  59 MB     00:02 ... &lt;br /&gt;
Creating domain...                                       |    0 B     00:00     &lt;br /&gt;
WARNING  Unable to connect to graphical console: virt-viewer not installed. Please install the &#039;virt-viewer&#039; package.&lt;br /&gt;
Domain installation still in progress. You can reconnect to &lt;br /&gt;
the console to complete the installation process.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The install should proceed more or less the same as it did for &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0001-dev&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==== Defining vm0002-web On an-node02 ====&lt;br /&gt;
&lt;br /&gt;
We can use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virsh&amp;lt;/span&amp;gt; to see that the new virtual machine exists and what state it is in. Note that I&#039;ve gotten into the habit of using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--all&amp;lt;/span&amp;gt; to get around &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virsh&amp;lt;/span&amp;gt;&#039;s default behaviour of hiding VMs that are off.&lt;br /&gt;
&lt;br /&gt;
On &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;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;
  2 vm0001-dev           running&lt;br /&gt;
  4 vm0002-web           running&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;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;
  - vm0001-dev           shut off&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As before, the new &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0002-web&amp;lt;/span&amp;gt; is only known to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
On &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;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 dumpxml vm0002-web &amp;gt; /shared/definitions/vm0002-web.xml&lt;br /&gt;
cat /shared/definitions/vm0002-web.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;kvm&#039; id=&#039;4&#039;&amp;gt;&lt;br /&gt;
  &amp;lt;name&amp;gt;vm0002-web&amp;lt;/name&amp;gt;&lt;br /&gt;
  &amp;lt;uuid&amp;gt;02f967ab-103f-c276-c40f-9eaa47339df4&amp;lt;/uuid&amp;gt;&lt;br /&gt;
  &amp;lt;memory&amp;gt;2097152&amp;lt;/memory&amp;gt;&lt;br /&gt;
  &amp;lt;currentMemory&amp;gt;2097152&amp;lt;/currentMemory&amp;gt;&lt;br /&gt;
  &amp;lt;vcpu&amp;gt;2&amp;lt;/vcpu&amp;gt;&lt;br /&gt;
  &amp;lt;os&amp;gt;&lt;br /&gt;
    &amp;lt;type arch=&#039;x86_64&#039; machine=&#039;rhel6.2.0&#039;&amp;gt;hvm&amp;lt;/type&amp;gt;&lt;br /&gt;
    &amp;lt;boot dev=&#039;hd&#039;/&amp;gt;&lt;br /&gt;
  &amp;lt;/os&amp;gt;&lt;br /&gt;
  &amp;lt;features&amp;gt;&lt;br /&gt;
    &amp;lt;acpi/&amp;gt;&lt;br /&gt;
    &amp;lt;apic/&amp;gt;&lt;br /&gt;
    &amp;lt;pae/&amp;gt;&lt;br /&gt;
  &amp;lt;/features&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;emulator&amp;gt;/usr/libexec/qemu-kvm&amp;lt;/emulator&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;qemu&#039; type=&#039;raw&#039; cache=&#039;none&#039; io=&#039;native&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;source dev=&#039;/dev/an01-vg0/vm0002-1&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;target dev=&#039;vda&#039; bus=&#039;virtio&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;alias name=&#039;virtio-disk0&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;address type=&#039;pci&#039; domain=&#039;0x0000&#039; bus=&#039;0x00&#039; slot=&#039;0x04&#039; function=&#039;0x0&#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;52:54:00:65:39:60&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;source bridge=&#039;vbr2&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;target dev=&#039;vnet1&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;model type=&#039;virtio&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;alias name=&#039;net0&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;address type=&#039;pci&#039; domain=&#039;0x0000&#039; bus=&#039;0x00&#039; slot=&#039;0x03&#039; function=&#039;0x0&#039;/&amp;gt;&lt;br /&gt;
    &amp;lt;/interface&amp;gt;&lt;br /&gt;
    &amp;lt;serial type=&#039;pty&#039;&amp;gt;&lt;br /&gt;
      &amp;lt;source path=&#039;/dev/pts/3&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;target port=&#039;0&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;alias name=&#039;serial0&#039;/&amp;gt;&lt;br /&gt;
    &amp;lt;/serial&amp;gt;&lt;br /&gt;
    &amp;lt;console type=&#039;pty&#039; tty=&#039;/dev/pts/3&#039;&amp;gt;&lt;br /&gt;
      &amp;lt;source path=&#039;/dev/pts/3&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;target type=&#039;serial&#039; port=&#039;0&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;alias name=&#039;serial0&#039;/&amp;gt;&lt;br /&gt;
    &amp;lt;/console&amp;gt;&lt;br /&gt;
    &amp;lt;input type=&#039;tablet&#039; bus=&#039;usb&#039;&amp;gt;&lt;br /&gt;
      &amp;lt;alias name=&#039;input0&#039;/&amp;gt;&lt;br /&gt;
    &amp;lt;/input&amp;gt;&lt;br /&gt;
    &amp;lt;input type=&#039;mouse&#039; bus=&#039;ps2&#039;/&amp;gt;&lt;br /&gt;
    &amp;lt;graphics type=&#039;vnc&#039; port=&#039;5901&#039; autoport=&#039;yes&#039;/&amp;gt;&lt;br /&gt;
    &amp;lt;video&amp;gt;&lt;br /&gt;
      &amp;lt;model type=&#039;cirrus&#039; vram=&#039;9216&#039; heads=&#039;1&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;alias name=&#039;video0&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;address type=&#039;pci&#039; domain=&#039;0x0000&#039; bus=&#039;0x00&#039; slot=&#039;0x02&#039; function=&#039;0x0&#039;/&amp;gt;&lt;br /&gt;
    &amp;lt;/video&amp;gt;&lt;br /&gt;
    &amp;lt;memballoon model=&#039;virtio&#039;&amp;gt;&lt;br /&gt;
      &amp;lt;alias name=&#039;balloon0&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;address type=&#039;pci&#039; domain=&#039;0x0000&#039; bus=&#039;0x00&#039; slot=&#039;0x05&#039; function=&#039;0x0&#039;/&amp;gt;&lt;br /&gt;
    &amp;lt;/memballoon&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;
There we go; That is the emulated hardware on which your virtual machine exists. Pretty neat, eh?&lt;br /&gt;
&lt;br /&gt;
I like to keep all of my VMs defined on all of my nodes. This is entirely optional, as the cluster will define the VM on a target node when needed. It is, though, a good chance to examine how this is done manually.&lt;br /&gt;
&lt;br /&gt;
On &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;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 /shared/definitions/vm0002-web.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-web defined from /shared/definitions/vm0002-web.xml&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can confirm that it now exists by re-running &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virsh list --all&amp;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;
  - vm0001-dev           shut off&lt;br /&gt;
  - vm0002-web           shut off&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Provisioning vm0003-db ===&lt;br /&gt;
&lt;br /&gt;
This installation will, again, be pretty much the same as it was for &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0001-dev&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0002-web&amp;lt;/span&amp;gt;, so we&#039;ll again look mainly at the differences.&lt;br /&gt;
&lt;br /&gt;
==== Creating vm0003-db&#039;s Storage ====&lt;br /&gt;
&lt;br /&gt;
We&#039;ll use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;lvcreate&amp;lt;/span&amp;gt; again, but being the first [[LV]] on the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an02-vg0&amp;lt;/span&amp;gt;, we&#039;ll specify the specific size again.&lt;br /&gt;
&lt;br /&gt;
On &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&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;
lvcreate -L 100G -n vm0003-1 /dev/an02-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;vm0003-1&amp;quot; created&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Creating vm0003-db&#039;s virt-install Call ====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-install&amp;lt;/span&amp;gt; command will be quite similar to the previous one.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
touch /shared/provision/vm0003-db.sh&lt;br /&gt;
chmod 755 /shared/provision/vm0003-db.sh &lt;br /&gt;
vim /shared/provision/vm0003-db.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;
virt-install --connect qemu:///system \&lt;br /&gt;
  --name vm0003-db \&lt;br /&gt;
  --ram 2048 \&lt;br /&gt;
  --arch x86_64 \&lt;br /&gt;
  --vcpus 2 \&lt;br /&gt;
  --location http://10.255.255.254/c6/x86_64/img/ \&lt;br /&gt;
  --extra-args &amp;quot;ks=http://10.255.255.254/c6/x86_64/ks/c6_minimal.ks&amp;quot; \&lt;br /&gt;
  --os-type linux \&lt;br /&gt;
  --os-variant rhel6 \&lt;br /&gt;
  --disk path=/dev/an02-vg0/vm0003-1 \&lt;br /&gt;
  --network bridge=vbr2 \&lt;br /&gt;
  --vnc&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Lets look at the differences;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--name vm0003-db&amp;lt;/span&amp;gt;; This sets the new name of the VM.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--disk path=/dev/an02-vg0/vm0003-1&amp;lt;/span&amp;gt;; The path to the new LV is set. Note that the [[VG]] has changed as this VM will run in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt; normally.&lt;br /&gt;
&lt;br /&gt;
==== Initializing vm0003-db&#039;s Install ====&lt;br /&gt;
&lt;br /&gt;
This time we&#039;re going to provision the new VM on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt;, as that is where it will live normally.&lt;br /&gt;
&lt;br /&gt;
On &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&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;
/shared/provision/vm0003-db.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;
Starting install...&lt;br /&gt;
Retrieving file .treeinfo...                             |  676 B     00:00 ... &lt;br /&gt;
Retrieving file vmlinuz...                               | 7.5 MB     00:00 ... &lt;br /&gt;
Retrieving file initrd.img...                            |  59 MB     00:02 ... &lt;br /&gt;
Creating domain...                                       |    0 B     00:00     &lt;br /&gt;
WARNING  Unable to connect to graphical console: virt-viewer not installed. Please install the &#039;virt-viewer&#039; package.&lt;br /&gt;
Domain installation still in progress. You can reconnect to &lt;br /&gt;
the console to complete the installation process.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The install should proceed more or less the same as it did for &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0001-dev&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0002-web&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==== Defining vm0003-db On an-node01 ====&lt;br /&gt;
&lt;br /&gt;
We can use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virsh&amp;lt;/span&amp;gt; to see that the new virtual machine exists and what state it is in. Note that I&#039;ve gotten into the habit of using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--all&amp;lt;/span&amp;gt; to get around &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virsh&amp;lt;/span&amp;gt;&#039;s default behaviour of hiding VMs that are off.&lt;br /&gt;
&lt;br /&gt;
On &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;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;
  2 vm0003-db            running&lt;br /&gt;
  - vm0001-dev           shut off&lt;br /&gt;
  - vm0002-web           shut off&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;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;
  2 vm0001-dev           running&lt;br /&gt;
  4 vm0002-web           running&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To backup the VM&#039;s configuration, we&#039;ll again use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virsh&amp;lt;/span&amp;gt;, but this time with the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;dumpxml&amp;lt;/span&amp;gt; command.&lt;br /&gt;
&lt;br /&gt;
On &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;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 dumpxml vm0003-db &amp;gt; /shared/definitions/vm0003-db.xml&lt;br /&gt;
cat /shared/definitions/vm0003-db.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;kvm&#039; id=&#039;2&#039;&amp;gt;&lt;br /&gt;
  &amp;lt;name&amp;gt;vm0003-db&amp;lt;/name&amp;gt;&lt;br /&gt;
  &amp;lt;uuid&amp;gt;a7018001-b433-b739-bbd9-d4d3285f0a72&amp;lt;/uuid&amp;gt;&lt;br /&gt;
  &amp;lt;memory&amp;gt;2097152&amp;lt;/memory&amp;gt;&lt;br /&gt;
  &amp;lt;currentMemory&amp;gt;2097152&amp;lt;/currentMemory&amp;gt;&lt;br /&gt;
  &amp;lt;vcpu&amp;gt;2&amp;lt;/vcpu&amp;gt;&lt;br /&gt;
  &amp;lt;os&amp;gt;&lt;br /&gt;
    &amp;lt;type arch=&#039;x86_64&#039; machine=&#039;rhel6.2.0&#039;&amp;gt;hvm&amp;lt;/type&amp;gt;&lt;br /&gt;
    &amp;lt;boot dev=&#039;hd&#039;/&amp;gt;&lt;br /&gt;
  &amp;lt;/os&amp;gt;&lt;br /&gt;
  &amp;lt;features&amp;gt;&lt;br /&gt;
    &amp;lt;acpi/&amp;gt;&lt;br /&gt;
    &amp;lt;apic/&amp;gt;&lt;br /&gt;
    &amp;lt;pae/&amp;gt;&lt;br /&gt;
  &amp;lt;/features&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;emulator&amp;gt;/usr/libexec/qemu-kvm&amp;lt;/emulator&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;qemu&#039; type=&#039;raw&#039; cache=&#039;none&#039; io=&#039;native&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;source dev=&#039;/dev/an02-vg0/vm0003-1&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;target dev=&#039;vda&#039; bus=&#039;virtio&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;alias name=&#039;virtio-disk0&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;address type=&#039;pci&#039; domain=&#039;0x0000&#039; bus=&#039;0x00&#039; slot=&#039;0x04&#039; function=&#039;0x0&#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;52:54:00:44:83:ec&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;source bridge=&#039;vbr2&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;target dev=&#039;vnet0&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;model type=&#039;virtio&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;alias name=&#039;net0&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;address type=&#039;pci&#039; domain=&#039;0x0000&#039; bus=&#039;0x00&#039; slot=&#039;0x03&#039; function=&#039;0x0&#039;/&amp;gt;&lt;br /&gt;
    &amp;lt;/interface&amp;gt;&lt;br /&gt;
    &amp;lt;serial type=&#039;pty&#039;&amp;gt;&lt;br /&gt;
      &amp;lt;source path=&#039;/dev/pts/2&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;target port=&#039;0&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;alias name=&#039;serial0&#039;/&amp;gt;&lt;br /&gt;
    &amp;lt;/serial&amp;gt;&lt;br /&gt;
    &amp;lt;console type=&#039;pty&#039; tty=&#039;/dev/pts/2&#039;&amp;gt;&lt;br /&gt;
      &amp;lt;source path=&#039;/dev/pts/2&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;target type=&#039;serial&#039; port=&#039;0&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;alias name=&#039;serial0&#039;/&amp;gt;&lt;br /&gt;
    &amp;lt;/console&amp;gt;&lt;br /&gt;
    &amp;lt;input type=&#039;tablet&#039; bus=&#039;usb&#039;&amp;gt;&lt;br /&gt;
      &amp;lt;alias name=&#039;input0&#039;/&amp;gt;&lt;br /&gt;
    &amp;lt;/input&amp;gt;&lt;br /&gt;
    &amp;lt;input type=&#039;mouse&#039; bus=&#039;ps2&#039;/&amp;gt;&lt;br /&gt;
    &amp;lt;graphics type=&#039;vnc&#039; port=&#039;5900&#039; autoport=&#039;yes&#039;/&amp;gt;&lt;br /&gt;
    &amp;lt;video&amp;gt;&lt;br /&gt;
      &amp;lt;model type=&#039;cirrus&#039; vram=&#039;9216&#039; heads=&#039;1&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;alias name=&#039;video0&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;address type=&#039;pci&#039; domain=&#039;0x0000&#039; bus=&#039;0x00&#039; slot=&#039;0x02&#039; function=&#039;0x0&#039;/&amp;gt;&lt;br /&gt;
    &amp;lt;/video&amp;gt;&lt;br /&gt;
    &amp;lt;memballoon model=&#039;virtio&#039;&amp;gt;&lt;br /&gt;
      &amp;lt;alias name=&#039;balloon0&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;address type=&#039;pci&#039; domain=&#039;0x0000&#039; bus=&#039;0x00&#039; slot=&#039;0x05&#039; function=&#039;0x0&#039;/&amp;gt;&lt;br /&gt;
    &amp;lt;/memballoon&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;
On &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;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 /shared/definitions/vm0003-db.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 vm0003-db defined from /shared/definitions/vm0003-db.xml&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can confirm that it now exists by re-running &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virsh list --all&amp;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;
  2 vm0001-dev           running&lt;br /&gt;
  4 vm0002-web           running&lt;br /&gt;
  - vm0003-db            shut off&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Provisioning vm0004-ms ===&lt;br /&gt;
&lt;br /&gt;
Now for something a little different!&lt;br /&gt;
&lt;br /&gt;
This will be the [http://www.microsoft.com/en-us/server-cloud/windows-server/2008-r2-standard.aspx Windows 2008 R2] virtual machine. The biggest difference this time will be that we&#039;re going to install from the [[ISO]] file rather than from a web-accessible store.&lt;br /&gt;
&lt;br /&gt;
Another difference is that we&#039;re going to specify what kind of storage bus to use with this VM. We&#039;ll be using a special, virtualized bus called &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virtio&amp;lt;/span&amp;gt; which requires that the drivers be available to the OS at install time. These drivers will, in turn, be made available to the installer as a virtual floppy disk. It will make for quite the interesting &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-install&amp;lt;/span&amp;gt; call, as we&#039;ll see.&lt;br /&gt;
&lt;br /&gt;
==== Preparing vm0004-ms&#039;s Storage ====&lt;br /&gt;
&lt;br /&gt;
As before, we need to create the backing storage [[LV]] before we can provision the machine. As we planned, this will be a 100 [[GiB]] partition and will be on the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an02-vg0&amp;lt;/span&amp;gt; [[VG]]. Seeing as this LV will use up the rest of the free space in the VG, we&#039;ll again use the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;lvcreate -l 100%FREE&amp;lt;/span&amp;gt; instead of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;-L 100G&amp;lt;/span&amp;gt; as sometimes the numbers don&#039;t work out to be exactly the size we intend.&lt;br /&gt;
&lt;br /&gt;
On &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&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;
lvcreate -l 100%FREE -n vm0004-1 /dev/an02-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;vm0004-1&amp;quot; created&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Before we proceed, we now need to put a copy of the install media, the OS&#039;s [[ISO]] and the virtual floppy disk, somewhere that the installer can access. I like to put files like this into the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/shared/files/&amp;lt;/span&amp;gt; directory we created earlier. How you put them there will be an exercise for the reader.&lt;br /&gt;
&lt;br /&gt;
If you do not have a copy of Microsoft&#039;s server operating system, you can download a 30-day free trial here;&lt;br /&gt;
* [http://technet.microsoft.com/en-us/evalcenter/dd459137 MS Windows Server 2008 R2 with SP1]&lt;br /&gt;
&lt;br /&gt;
The driver for the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virtio&amp;lt;/span&amp;gt; bus can be found from Red Hat here. Note that there is an [[ISO]] and a &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vfd&amp;lt;/span&amp;gt; (virtual floppy disk) file. You can use the ISO and mount it as a second CD-ROM if you wish. This tutorial will use the virtual floppy disk to show how floppy images can be used in VMs:&lt;br /&gt;
* [http://alt.fedoraproject.org/pub/alt/virtio-win/latest/images/bin/ virtio Drivers for Windows]&lt;br /&gt;
&lt;br /&gt;
{{note|1=The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vfd&amp;lt;/span&amp;gt; no longer seems to exist upstream and I&#039;ve not found a way to get windows to use the latest (&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virtio-win-0.1-22.iso&amp;lt;/span&amp;gt; image. As such, I&#039;ve uploaded of the virtual floppy disk image from version 1.1.16. If you have any insight into the proper use of the latest virtio image, please [mailto:digimer@alteeve.ca let me know].}}&lt;br /&gt;
* Local copy of [https://alteeve.com/files/virtio-win-1.1.16.vfd virtio-win-1.1.16.vfd].&lt;br /&gt;
&lt;br /&gt;
==== Creating vm0004-ms&#039;s virt-install Call ====&lt;br /&gt;
&lt;br /&gt;
Lets look at the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-install&amp;lt;/span&amp;gt; command, then we&#039;ll discuss the main differences from the previous call for the firewall. As before, we&#039;ll put this command into a small shell script for later reference.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
touch /shared/provision/vm0004-ms.sh&lt;br /&gt;
chmod 755 /shared/provision/vm0004-ms.sh &lt;br /&gt;
vim /shared/provision/vm0004-ms.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;
virt-install --connect qemu:///system \&lt;br /&gt;
  --name vm0004-ms \&lt;br /&gt;
  --ram 2048 \&lt;br /&gt;
  --arch x86_64 \&lt;br /&gt;
  --vcpus 2 \&lt;br /&gt;
  --cdrom /shared/files/Windows_Server_2008_R2_64Bit_SP1.iso \&lt;br /&gt;
  --disk path=/dev/an02-vg0/vm0004-1,device=disk,bus=virtio \&lt;br /&gt;
  --disk path=/shared/files/virtio-win-1.1.16.vfd,device=floppy \&lt;br /&gt;
  --os-type windows \&lt;br /&gt;
  --os-variant win2k8 \&lt;br /&gt;
  --network bridge=vbr2 \&lt;br /&gt;
  --vnc&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Let&#039;s look at the main differences;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--cdrom /shared/files/Windows_Server_2008_R2_64Bit_SP1.iso&amp;lt;/span&amp;gt;&lt;br /&gt;
Here we&#039;ve swapped out the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--location&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--extra-args&amp;lt;/span&amp;gt; arguments for the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--cdrom&amp;lt;/span&amp;gt; switch. This will create an emulated DVD-ROM drive and boot from it. The path and file is an [[ISO]] image of the installation media we want to use.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--disk path=/dev/an02-vg0/vm0004-1,device=disk,bus=virtio&amp;lt;/span&amp;gt;&lt;br /&gt;
This is the same line we used before, pointing to the new [[LV]] of course, but we&#039;ve added options to it. Specifically, we&#039;ve told the hardware emulator, [[QEMU]], to not create the standard (&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ide&amp;lt;/span&amp;gt; or &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;scsi&amp;lt;/span&amp;gt;) bus. This is a special bus that improves storage [[I/O]] on windows (and other) guests. Windows does not support this bus natively, which brings us to the next option.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--disk path=/shared/files/virtio-win-1.1.16.vfd,device=floppy&amp;lt;/span&amp;gt;&lt;br /&gt;
This mounts the emulated floppy disk with the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virtio&amp;lt;/span&amp;gt; drivers that we&#039;ll need to allow windows to see the hard drive during the install.&lt;br /&gt;
&lt;br /&gt;
The rest is more or less the same as before.&lt;br /&gt;
&lt;br /&gt;
==== Initializing vm0004-ms&#039;s Install ====&lt;br /&gt;
&lt;br /&gt;
As before, we&#039;ll run the script with the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-install&amp;lt;/span&amp;gt; command in it.&lt;br /&gt;
&lt;br /&gt;
On &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&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;
/shared/provision/vm0004-ms.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;
Starting install...&lt;br /&gt;
Creating domain...                                       |    0 B     00:00     &lt;br /&gt;
WARNING  Unable to connect to graphical console: virt-viewer not installed. Please install the &#039;virt-viewer&#039; package.&lt;br /&gt;
Domain installation still in progress. Waiting for installation to complete.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This install isn&#039;t automated like the previous installs were, so we&#039;ll need to hand-hold the VM through the install.&lt;br /&gt;
&lt;br /&gt;
[[Image:2n-RHEL6-KVM_vm0004_provision_01.png|thumb|700px|center|Initial provision of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0004-ms&amp;lt;/span&amp;gt;.]]&lt;br /&gt;
&lt;br /&gt;
After you get click to select the &#039;&#039;Custom (advanced)&#039;&#039; installation method, you will &lt;br /&gt;
&lt;br /&gt;
[[Image:2n-RHEL6-KVM_vm0004_provision_02.png|thumb|700px|center|The Windows 2008 VM &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0004-ms&amp;lt;/span&amp;gt; doesn&#039;t see a hard drive.]]&lt;br /&gt;
&lt;br /&gt;
Click on the &#039;&#039;Load Driver&#039;&#039; option on the bottom left. You will be presented with a window telling you your options for loading the drivers.&lt;br /&gt;
&lt;br /&gt;
[[Image:2n-RHEL6-KVM_vm0004_provision_03.png|thumb|700px|center|The Windows 2008 VM &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0004-ms&amp;lt;/span&amp;gt; driver prompt.]]&lt;br /&gt;
&lt;br /&gt;
Click on the &#039;&#039;OK&#039;&#039; button and the installer will automatically find the virtual floppy disk and present you with the available drivers. Click to highlight &#039;&#039;Red Hat VirtIO SCSI Controller (A:\amd64\Win2008\viostor.inf)&#039;&#039; and click the &#039;&#039;Next&#039;&#039; button.&lt;br /&gt;
&lt;br /&gt;
[[Image:2n-RHEL6-KVM_vm0004_provision_04.png|thumb|700px|center|Selecting the Win2008 &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virtio&amp;lt;/span&amp;gt; driver.]]&lt;br /&gt;
&lt;br /&gt;
At this point, the windows installer will see the virtual hard drive and you can proceed with the install as you would normally install Windows 2008 R2 server.&lt;br /&gt;
&lt;br /&gt;
[[Image:2n-RHEL6-KVM_vm0004_provision_05.png|thumb|700px|center|The Win2008 installer now is about to use the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virtio&amp;lt;/span&amp;gt;-backed storage.]]&lt;br /&gt;
&lt;br /&gt;
Once the install is complete, reboot.&lt;br /&gt;
&lt;br /&gt;
[[Image:2n-RHEL6-KVM_vm0004_provision_06.png|thumb|700px|center|Installation of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0004-ms&amp;lt;/span&amp;gt; complete.]]&lt;br /&gt;
&lt;br /&gt;
==== Post-Install Housekeeping ====&lt;br /&gt;
&lt;br /&gt;
We have to be careful to &amp;quot;eject&amp;quot; the virtual floppy and DVD disks from the VM. If you neglect to do so, then later delete the files, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virsh&amp;lt;/span&amp;gt; will fail to boot the VMs and &#039;&#039;&#039;undefine them entirely&#039;&#039;&#039;. (Yes, that is dumb, in this author&#039;s opinion). [[#My VM Just Vanished!|How to recover]] from this issue can be found below.&lt;br /&gt;
&lt;br /&gt;
{{note|1=At the time of writing this, the author could not find any manner to eject media from the command line, shy of modifying the raw [[XML]] definition file and then redefining the VM and rebooting the guest. This is part of a known bug found in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[libvirt]]&amp;lt;/span&amp;gt; prior to version 0.9.7 and [[EL6]] ships with version 0.8.7. For this reason, we will use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-manager&amp;lt;/span&amp;gt; here.}}&lt;br /&gt;
&lt;br /&gt;
To &amp;quot;eject&amp;quot; the DVD-ROM and floppy drive, we will use the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-manager&amp;lt;/span&amp;gt; graphical program. You will need to either run &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-manager&amp;lt;/span&amp;gt; on one of the nodes, or use a version of it from your workstation by connecting to the host node over [[SSH]]. This later method is what I like to do.&lt;br /&gt;
&lt;br /&gt;
Using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-manager&amp;lt;/span&amp;gt;, connect to the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0004-ms&amp;lt;/span&amp;gt; VM.&lt;br /&gt;
&lt;br /&gt;
[[Image:2n-RHEL6-KVM_vm0004_eject-media_01.png|thumb|700px|center|Connecting to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0004-ms&amp;lt;/span&amp;gt; using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-manager&amp;lt;/span&amp;gt; from a remote workstation.]]&lt;br /&gt;
&lt;br /&gt;
Click on &#039;&#039;View&#039;&#039; then &#039;&#039;Details&#039;&#039; and you will see the virtual machine&#039;s emulated hardware.&lt;br /&gt;
&lt;br /&gt;
[[Image:2n-RHEL6-KVM_vm0004_eject-media_02.png|thumb|700px|center|Looking at &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0004-ms&amp;lt;/span&amp;gt;&#039;s emulated hardware configuration.]]&lt;br /&gt;
&lt;br /&gt;
First, let&#039;s eject the virtual floppy disk. In the left panel, click to select the &#039;&#039;Floppy 1&#039;&#039; device.&lt;br /&gt;
&lt;br /&gt;
[[Image:2n-RHEL6-KVM_vm0004_eject-media_03.png|thumb|700px|center|Viewing the &#039;&#039;Floppy 1&#039;&#039; device on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0004-ms&amp;lt;/span&amp;gt;.]]&lt;br /&gt;
&lt;br /&gt;
Click on the &#039;&#039;Disconnect&#039;&#039; button and the disk will be unmounted.&lt;br /&gt;
&lt;br /&gt;
[[Image:2n-RHEL6-KVM_vm0004_eject-media_04.png|thumb|700px|center|Viewing the &#039;&#039;Floppy 1&#039;&#039; device after ejecting the virtual floppy disk on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0004-ms&amp;lt;/span&amp;gt;.]]&lt;br /&gt;
&lt;br /&gt;
Now to eject the emulated DVD-ROM, again on the left panel, click to select the &#039;&#039;IDE CDROM 1&#039;&#039; device.&lt;br /&gt;
&lt;br /&gt;
[[Image:2n-RHEL6-KVM_vm0004_eject-media_05.png|thumb|700px|center|Viewing the &#039;&#039;IDE CDROM 1&#039;&#039; device on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0004-ms&amp;lt;/span&amp;gt;.]]&lt;br /&gt;
&lt;br /&gt;
Click on &#039;&#039;Disconnect&#039;&#039; again to unmount the ISO image.&lt;br /&gt;
&lt;br /&gt;
[[Image:2n-RHEL6-KVM_vm0004_eject-media_06.png|thumb|700px|center|Viewing the &#039;&#039;IDE CDROM 1&#039;&#039; device after ejecting the virtual floppy disk on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0004-ms&amp;lt;/span&amp;gt;.]]&lt;br /&gt;
&lt;br /&gt;
Now both the floppy disk and DVD image have been unmounted from the VM. We can return to the console view (&#039;&#039;View&#039;&#039; -&amp;gt; &#039;&#039;Console&#039;&#039;) and we will see that both the floppy disk and DVD drive no longer show any media as mounted within them.&lt;br /&gt;
&lt;br /&gt;
[[Image:2n-RHEL6-KVM_vm0004_eject-media_07.png|thumb|700px|center|Viewing &#039;&#039;File Manager&#039;&#039; on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0004-ms&amp;lt;/span&amp;gt; with the virtual floppy disk and DVD ISO image now unmounted.]]&lt;br /&gt;
&lt;br /&gt;
Done!&lt;br /&gt;
&lt;br /&gt;
==== Defining vm0004-ms On an-node02 ====&lt;br /&gt;
&lt;br /&gt;
Now with the installation media unmounted, and as we did before, we will use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virsh dumpxml&amp;lt;/span&amp;gt; to write out the [[XML]] definition file for the new VM and then &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virsh define&amp;lt;/span&amp;gt; it on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
On &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;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;
  2 vm0003-db            running&lt;br /&gt;
  4 vm0004-ms            running&lt;br /&gt;
  - vm0001-dev           shut off&lt;br /&gt;
  - vm0002-web           shut off&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;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;
  2 vm0001-dev           running&lt;br /&gt;
  4 vm0002-web           running&lt;br /&gt;
  - vm0003-db            shut off&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As before, our new VM is only defined on the node we installed it on. We&#039;ll fix this now.&lt;br /&gt;
&lt;br /&gt;
On &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;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 dumpxml vm0004-ms &amp;gt; /shared/definitions/vm0004-ms.xml&lt;br /&gt;
cat /shared/definitions/vm0004-ms.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;kvm&#039; id=&#039;4&#039;&amp;gt;&lt;br /&gt;
  &amp;lt;name&amp;gt;vm0004-ms&amp;lt;/name&amp;gt;&lt;br /&gt;
  &amp;lt;uuid&amp;gt;4c537551-96f4-3b5e-209a-0e41cab41d44&amp;lt;/uuid&amp;gt;&lt;br /&gt;
  &amp;lt;memory&amp;gt;2097152&amp;lt;/memory&amp;gt;&lt;br /&gt;
  &amp;lt;currentMemory&amp;gt;2097152&amp;lt;/currentMemory&amp;gt;&lt;br /&gt;
  &amp;lt;vcpu&amp;gt;2&amp;lt;/vcpu&amp;gt;&lt;br /&gt;
  &amp;lt;os&amp;gt;&lt;br /&gt;
    &amp;lt;type arch=&#039;x86_64&#039; machine=&#039;rhel6.2.0&#039;&amp;gt;hvm&amp;lt;/type&amp;gt;&lt;br /&gt;
    &amp;lt;boot dev=&#039;hd&#039;/&amp;gt;&lt;br /&gt;
  &amp;lt;/os&amp;gt;&lt;br /&gt;
  &amp;lt;features&amp;gt;&lt;br /&gt;
    &amp;lt;acpi/&amp;gt;&lt;br /&gt;
    &amp;lt;apic/&amp;gt;&lt;br /&gt;
    &amp;lt;pae/&amp;gt;&lt;br /&gt;
  &amp;lt;/features&amp;gt;&lt;br /&gt;
  &amp;lt;clock offset=&#039;localtime&#039;&amp;gt;&lt;br /&gt;
    &amp;lt;timer name=&#039;rtc&#039; tickpolicy=&#039;catchup&#039;/&amp;gt;&lt;br /&gt;
  &amp;lt;/clock&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;emulator&amp;gt;/usr/libexec/qemu-kvm&amp;lt;/emulator&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;qemu&#039; type=&#039;raw&#039; cache=&#039;none&#039; io=&#039;native&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;source dev=&#039;/dev/an02-vg0/vm0004-1&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;target dev=&#039;vda&#039; bus=&#039;virtio&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;alias name=&#039;virtio-disk0&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;address type=&#039;pci&#039; domain=&#039;0x0000&#039; bus=&#039;0x00&#039; slot=&#039;0x04&#039; function=&#039;0x0&#039;/&amp;gt;&lt;br /&gt;
    &amp;lt;/disk&amp;gt;&lt;br /&gt;
    &amp;lt;disk type=&#039;file&#039; device=&#039;floppy&#039;&amp;gt;&lt;br /&gt;
      &amp;lt;driver name=&#039;qemu&#039; type=&#039;raw&#039; cache=&#039;none&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;target dev=&#039;fda&#039; bus=&#039;fdc&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;alias name=&#039;fdc0-0-0&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;address type=&#039;drive&#039; controller=&#039;0&#039; bus=&#039;0&#039; unit=&#039;0&#039;/&amp;gt;&lt;br /&gt;
    &amp;lt;/disk&amp;gt;&lt;br /&gt;
    &amp;lt;disk type=&#039;file&#039; device=&#039;cdrom&#039;&amp;gt;&lt;br /&gt;
      &amp;lt;driver name=&#039;qemu&#039; type=&#039;raw&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;target dev=&#039;hdc&#039; bus=&#039;ide&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;readonly/&amp;gt;&lt;br /&gt;
      &amp;lt;alias name=&#039;ide0-1-0&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;address type=&#039;drive&#039; controller=&#039;0&#039; bus=&#039;1&#039; unit=&#039;0&#039;/&amp;gt;&lt;br /&gt;
    &amp;lt;/disk&amp;gt;&lt;br /&gt;
    &amp;lt;controller type=&#039;fdc&#039; index=&#039;0&#039;&amp;gt;&lt;br /&gt;
      &amp;lt;alias name=&#039;fdc0&#039;/&amp;gt;&lt;br /&gt;
    &amp;lt;/controller&amp;gt;&lt;br /&gt;
    &amp;lt;controller type=&#039;ide&#039; index=&#039;0&#039;&amp;gt;&lt;br /&gt;
      &amp;lt;alias name=&#039;ide0&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;address type=&#039;pci&#039; domain=&#039;0x0000&#039; bus=&#039;0x00&#039; slot=&#039;0x01&#039; function=&#039;0x1&#039;/&amp;gt;&lt;br /&gt;
    &amp;lt;/controller&amp;gt;&lt;br /&gt;
    &amp;lt;interface type=&#039;bridge&#039;&amp;gt;&lt;br /&gt;
      &amp;lt;mac address=&#039;52:54:00:5e:b1:47&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;source bridge=&#039;vbr2&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;target dev=&#039;vnet1&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;alias name=&#039;net0&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;address type=&#039;pci&#039; domain=&#039;0x0000&#039; bus=&#039;0x00&#039; slot=&#039;0x03&#039; function=&#039;0x0&#039;/&amp;gt;&lt;br /&gt;
    &amp;lt;/interface&amp;gt;&lt;br /&gt;
    &amp;lt;serial type=&#039;pty&#039;&amp;gt;&lt;br /&gt;
      &amp;lt;source path=&#039;/dev/pts/3&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;target port=&#039;0&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;alias name=&#039;serial0&#039;/&amp;gt;&lt;br /&gt;
    &amp;lt;/serial&amp;gt;&lt;br /&gt;
    &amp;lt;console type=&#039;pty&#039; tty=&#039;/dev/pts/3&#039;&amp;gt;&lt;br /&gt;
      &amp;lt;source path=&#039;/dev/pts/3&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;target type=&#039;serial&#039; port=&#039;0&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;alias name=&#039;serial0&#039;/&amp;gt;&lt;br /&gt;
    &amp;lt;/console&amp;gt;&lt;br /&gt;
    &amp;lt;input type=&#039;tablet&#039; bus=&#039;usb&#039;&amp;gt;&lt;br /&gt;
      &amp;lt;alias name=&#039;input0&#039;/&amp;gt;&lt;br /&gt;
    &amp;lt;/input&amp;gt;&lt;br /&gt;
    &amp;lt;input type=&#039;mouse&#039; bus=&#039;ps2&#039;/&amp;gt;&lt;br /&gt;
    &amp;lt;graphics type=&#039;vnc&#039; port=&#039;5901&#039; autoport=&#039;yes&#039;/&amp;gt;&lt;br /&gt;
    &amp;lt;video&amp;gt;&lt;br /&gt;
      &amp;lt;model type=&#039;vga&#039; vram=&#039;9216&#039; heads=&#039;1&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;alias name=&#039;video0&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;address type=&#039;pci&#039; domain=&#039;0x0000&#039; bus=&#039;0x00&#039; slot=&#039;0x02&#039; function=&#039;0x0&#039;/&amp;gt;&lt;br /&gt;
    &amp;lt;/video&amp;gt;&lt;br /&gt;
    &amp;lt;memballoon model=&#039;virtio&#039;&amp;gt;&lt;br /&gt;
      &amp;lt;alias name=&#039;balloon0&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;address type=&#039;pci&#039; domain=&#039;0x0000&#039; bus=&#039;0x00&#039; slot=&#039;0x05&#039; function=&#039;0x0&#039;/&amp;gt;&lt;br /&gt;
    &amp;lt;/memballoon&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;
As before, defining the VM on both nodes is optional, but a habit I like to do.&lt;br /&gt;
&lt;br /&gt;
On &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;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 /shared/definitions/vm0004-ms.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 vm0004-ms defined from /shared/definitions/vm0004-ms.xml&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can confirm that it now exists by re-running &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virsh list --all&amp;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;
  2 vm0001-dev           running&lt;br /&gt;
  4 vm0002-web           running&lt;br /&gt;
  - vm0003-db            shut off&lt;br /&gt;
  - vm0004-ms            shut off&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With that, all our VMs exist and we&#039;re ready to make them highly available!&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 cluster services! This involves two main steps:&lt;br /&gt;
* Creating two new, ordered fail-over Domains; One with each node as the highest priority.&lt;br /&gt;
* Adding our VMs as services, one is each new fail-over domain.&lt;br /&gt;
&lt;br /&gt;
== Creating the Ordered Fail-Over Domains ==&lt;br /&gt;
&lt;br /&gt;
We have planned for two VMs, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0001-dev&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0002-web&amp;lt;/span&amp;gt; to normally run on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt; while &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0003-db&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0004-ms&amp;lt;/span&amp;gt; to run on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt;. Of course, should one of the nodes fail, the lost VMs will be restarted on the surviving node. For this, we will use an ordered fail-over domain.&lt;br /&gt;
&lt;br /&gt;
The idea here is that each new fail-over 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-node01&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-node02&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 fail-over domain.&lt;br /&gt;
&lt;br /&gt;
{{note|1=With 2-node clusters like ours, ordering is arguably useless. It&#039;s used here more to introduce the concepts rather than providing any real benefit. If you want to make production clusters unordered, you can. Just remember to run the VMs on the appropriate nodes when both are on-line.}}&lt;br /&gt;
&lt;br /&gt;
Here are the two new domains we will create 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;
&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;primary_an01&amp;quot; nofailback=&amp;quot;1&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-node01.alteeve.com&amp;quot; priority=&amp;quot;1&amp;quot;/&amp;gt;&lt;br /&gt;
                                &amp;lt;failoverdomainnode name=&amp;quot;an-node02.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;primary_an02&amp;quot; nofailback=&amp;quot;1&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-node01.alteeve.com&amp;quot; priority=&amp;quot;2&amp;quot;/&amp;gt;&lt;br /&gt;
                                &amp;lt;failoverdomainnode name=&amp;quot;an-node02.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;
The two major pieces of the puzzle here are the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;failoverdomain ...&amp;gt;&amp;lt;/span&amp;gt;&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ordered=&amp;quot;1&amp;quot;&amp;lt;/span&amp;gt; attribute and the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;failoverdomainnode ...&amp;gt;&amp;lt;/span&amp;gt;&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;priority=&amp;quot;x&amp;quot;&amp;lt;/span&amp;gt; attributes. The former tells the cluster that there is a preference for which node should be used when both are available. The later, which is the difference between the two new domains, tells the cluster which specific node is preferred.&lt;br /&gt;
&lt;br /&gt;
The first of the new fail-over domains is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;primary_an01&amp;lt;/span&amp;gt;. Any service placed in this domain will prefer to run on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;, as its priority of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt; is higher than &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt;&#039;s priority of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;2&amp;lt;/span&amp;gt;. The second of the new domains is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;primary_an02&amp;lt;/span&amp;gt; which reverses the preference, making &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt; preferred over &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Let&#039;s look at the complete &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cluster.conf&amp;lt;/span&amp;gt; with the new domain, and the version updated to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;11&amp;lt;/span&amp;gt; of course.&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 config_version=&amp;quot;11&amp;quot; name=&amp;quot;an-cluster-A&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-node01.alteeve.com&amp;quot; nodeid=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
                        &amp;lt;fence&amp;gt;&lt;br /&gt;
                                &amp;lt;method name=&amp;quot;ipmi&amp;quot;&amp;gt;&lt;br /&gt;
                                        &amp;lt;device action=&amp;quot;reboot&amp;quot; name=&amp;quot;ipmi_an01&amp;quot;/&amp;gt;&lt;br /&gt;
                                &amp;lt;/method&amp;gt;&lt;br /&gt;
                                &amp;lt;method name=&amp;quot;pdu&amp;quot;&amp;gt;&lt;br /&gt;
                                        &amp;lt;device action=&amp;quot;reboot&amp;quot; name=&amp;quot;pdu2&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;
                &amp;lt;/clusternode&amp;gt;&lt;br /&gt;
                &amp;lt;clusternode name=&amp;quot;an-node02.alteeve.com&amp;quot; nodeid=&amp;quot;2&amp;quot;&amp;gt;&lt;br /&gt;
                        &amp;lt;fence&amp;gt;&lt;br /&gt;
                                &amp;lt;method name=&amp;quot;ipmi&amp;quot;&amp;gt;&lt;br /&gt;
                                        &amp;lt;device action=&amp;quot;reboot&amp;quot; name=&amp;quot;ipmi_an02&amp;quot;/&amp;gt;&lt;br /&gt;
                                &amp;lt;/method&amp;gt;&lt;br /&gt;
                                &amp;lt;method name=&amp;quot;pdu&amp;quot;&amp;gt;&lt;br /&gt;
                                        &amp;lt;device action=&amp;quot;reboot&amp;quot; name=&amp;quot;pdu2&amp;quot; port=&amp;quot;2&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_ipmilan&amp;quot; ipaddr=&amp;quot;an-node01.ipmi&amp;quot; login=&amp;quot;root&amp;quot; name=&amp;quot;ipmi_an01&amp;quot; passwd=&amp;quot;secret&amp;quot;/&amp;gt;&lt;br /&gt;
                &amp;lt;fencedevice agent=&amp;quot;fence_ipmilan&amp;quot; ipaddr=&amp;quot;an-node02.ipmi&amp;quot; login=&amp;quot;root&amp;quot; name=&amp;quot;ipmi_an02&amp;quot; passwd=&amp;quot;secret&amp;quot;/&amp;gt;&lt;br /&gt;
                &amp;lt;fencedevice agent=&amp;quot;fence_apc_snmp&amp;quot; ipaddr=&amp;quot;pdu2.alteeve.com&amp;quot; name=&amp;quot;pdu2&amp;quot;/&amp;gt;&lt;br /&gt;
        &amp;lt;/fencedevices&amp;gt;&lt;br /&gt;
        &amp;lt;fence_daemon post_join_delay=&amp;quot;30&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 log_level=&amp;quot;5&amp;quot;&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;script file=&amp;quot;/etc/init.d/libvirtd&amp;quot; name=&amp;quot;libvirtd&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;only_an01&amp;quot; nofailback=&amp;quot;1&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-node01.alteeve.com&amp;quot;/&amp;gt;&lt;br /&gt;
                        &amp;lt;/failoverdomain&amp;gt;&lt;br /&gt;
                        &amp;lt;failoverdomain name=&amp;quot;only_an02&amp;quot; nofailback=&amp;quot;1&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-node02.alteeve.com&amp;quot;/&amp;gt;&lt;br /&gt;
                        &amp;lt;/failoverdomain&amp;gt;&lt;br /&gt;
                        &amp;lt;failoverdomain name=&amp;quot;primary_an01&amp;quot; nofailback=&amp;quot;1&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-node01.alteeve.com&amp;quot; priority=&amp;quot;1&amp;quot;/&amp;gt;&lt;br /&gt;
                                &amp;lt;failoverdomainnode name=&amp;quot;an-node02.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;primary_an02&amp;quot; nofailback=&amp;quot;1&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-node01.alteeve.com&amp;quot; priority=&amp;quot;2&amp;quot;/&amp;gt;&lt;br /&gt;
                                &amp;lt;failoverdomainnode name=&amp;quot;an-node02.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;only_an01&amp;quot; exclusive=&amp;quot;0&amp;quot; name=&amp;quot;storage_an01&amp;quot; recovery=&amp;quot;restart&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 ref=&amp;quot;libvirtd&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;/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;only_an02&amp;quot; exclusive=&amp;quot;0&amp;quot; name=&amp;quot;storage_an02&amp;quot; recovery=&amp;quot;restart&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 ref=&amp;quot;libvirtd&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;/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;
Let&#039;s validate it now, but we won&#039;t bother to push it out just yet.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ccs_config_validate &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Configuration validates&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Good, now to create the new VM services!&lt;br /&gt;
&lt;br /&gt;
== Making Our VMs Clustered Services ==&lt;br /&gt;
&lt;br /&gt;
The final piece of the puzzle, and the whole purpose of this exercise is in sight!&lt;br /&gt;
&lt;br /&gt;
There is a special service in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; for virtual machines which uses the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm:&amp;lt;/span&amp;gt; prefix. We will need to create four of these services; One for each of the virtual machines.&lt;br /&gt;
&lt;br /&gt;
{{note|1=There is a one main drawback of using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; to manage virtual machines in our cluster. Ideally, we&#039;d like to have the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm:&amp;lt;/span&amp;gt; services start after the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;storage_X&amp;lt;/span&amp;gt; services are up, and a bit of logic to say that all VMs can start on one node, should the other&#039;s storage service fail. This isn&#039;t possible though, so we will need to manually start VMs after a cold-start of the cluster.}}&lt;br /&gt;
&lt;br /&gt;
=== Creating The vm: Services ===&lt;br /&gt;
&lt;br /&gt;
We&#039;ll create four new services, one for each VM. These are simple single-element entries. Lets increment the version to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;12&amp;lt;/span&amp;gt; and take a look at the new entries.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;rm log_level=&amp;quot;5&amp;quot;&amp;gt;&lt;br /&gt;
                ...&lt;br /&gt;
                &amp;lt;vm name=&amp;quot;vm0001-dev&amp;quot; domain=&amp;quot;primary_an01&amp;quot; path=&amp;quot;/shared/definitions/&amp;quot; autostart=&amp;quot;0&amp;quot;&lt;br /&gt;
                 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-web&amp;quot; domain=&amp;quot;primary_an01&amp;quot; path=&amp;quot;/shared/definitions/&amp;quot; autostart=&amp;quot;0&amp;quot;&lt;br /&gt;
                 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;vm0003-db&amp;quot; domain=&amp;quot;primary_an02&amp;quot; path=&amp;quot;/shared/definitions/&amp;quot; autostart=&amp;quot;0&amp;quot;&lt;br /&gt;
                 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;vm0004-ms&amp;quot; domain=&amp;quot;primary_an02&amp;quot; path=&amp;quot;/shared/definitions/&amp;quot; autostart=&amp;quot;0&amp;quot;&lt;br /&gt;
                 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;
Let&#039;s look at each of the attributes now;&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;name&amp;lt;/span&amp;gt;; This must match the name we created the VM with (the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;--name ...&amp;lt;/span&amp;gt; value when we provisioned the VMs). This is the name that will be passed to the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm.sh&amp;lt;/span&amp;gt; resource agent when managing this service, and it will be the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;name&amp;gt;.xml&amp;lt;/span&amp;gt; used when looking under &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;path=...&amp;lt;/span&amp;gt; for the VM&#039;s definition file.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;domain&amp;lt;/span&amp;gt;; This tells the cluster to manage the VM using the given fail-over domain.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;path&amp;lt;/span&amp;gt;; This tells the cluster where to look for the VM&#039;s definition file. &#039;&#039;&#039;Do not&#039;&#039;&#039; include the actual file name, just the path. This is partly why we wrote out each VM&#039;s definition to the shared directory.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;autostart&amp;lt;/span&amp;gt;; As mentioned above, we can&#039;t have the VMs start with the cluster, because the underlying storage takes too long to come on-line. Setting this to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;0&amp;lt;/span&amp;gt; disables the auto-start behaviour.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;exclusive&amp;lt;/span&amp;gt;; As we saw with the storage services, we want to ensure that this service &#039;&#039;&#039;is not&#039;&#039;&#039; exclusive. If it were, starting the VM would stop the storage and prevent other VMs from running on the node. This would be a bad thing™.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;recovery&amp;lt;/span&amp;gt;; This tells the cluster what to do when the service fails. We are setting this to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;restart&amp;lt;/span&amp;gt;, so the cluster will try to restart the VM on the same node it was on when it failed. The alternative is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;relocate&amp;lt;/span&amp;gt;, which would instead start the VM on another node. More about this next.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;max_restarts&amp;lt;/span&amp;gt;; When a VM fails, it is possible that it is because there is a subtle problem on the host node itself. So this attribute allows up to set a limit on how many times a VM will be allowed to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;restart&amp;lt;/span&amp;gt; before giving up and switching to a &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;relocate&amp;lt;/span&amp;gt; police. We&#039;re setting this to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;2&amp;lt;/span&amp;gt;, which means that if a VM is restarted twice, the third failure will trigger a &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;relocate&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;restart_expire_time&amp;lt;/span&amp;gt;; If we let the failure count increment indefinitely, than a &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;relocate&amp;lt;/span&amp;gt; policy becomes inevitable, when there is no reason to believe that an issue with the host node exists. To account for this, we use this attribute to tell the cluster to &amp;quot;forget&amp;quot; a restart after the defined number of seconds. We&#039;re using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;600&amp;lt;/span&amp;gt; seconds (ten minutes). So if a VM fails, the failure count increments from &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;0&amp;lt;/span&amp;gt; to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;1&amp;lt;/span&amp;gt;. After &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;600&amp;lt;/span&amp;gt; seconds though, the restart is &amp;quot;forgotten&amp;quot; and the failure count returns to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;0&amp;lt;/span&amp;gt;. Said another way, a VM will have to fail three times in ten minutes to trigger the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;relocate&amp;lt;/span&amp;gt; recovery policy.&lt;br /&gt;
&lt;br /&gt;
So let&#039;s take a look at the final, complete &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;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;?xml version=&amp;quot;1.0&amp;quot;?&amp;gt;&lt;br /&gt;
&amp;lt;cluster config_version=&amp;quot;12&amp;quot; name=&amp;quot;an-cluster-A&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-node01.alteeve.com&amp;quot; nodeid=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
			&amp;lt;fence&amp;gt;&lt;br /&gt;
				&amp;lt;method name=&amp;quot;ipmi&amp;quot;&amp;gt;&lt;br /&gt;
					&amp;lt;device action=&amp;quot;reboot&amp;quot; name=&amp;quot;ipmi_an01&amp;quot;/&amp;gt;&lt;br /&gt;
				&amp;lt;/method&amp;gt;&lt;br /&gt;
				&amp;lt;method name=&amp;quot;pdu&amp;quot;&amp;gt;&lt;br /&gt;
					&amp;lt;device action=&amp;quot;reboot&amp;quot; name=&amp;quot;pdu2&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;
		&amp;lt;/clusternode&amp;gt;&lt;br /&gt;
		&amp;lt;clusternode name=&amp;quot;an-node02.alteeve.com&amp;quot; nodeid=&amp;quot;2&amp;quot;&amp;gt;&lt;br /&gt;
			&amp;lt;fence&amp;gt;&lt;br /&gt;
				&amp;lt;method name=&amp;quot;ipmi&amp;quot;&amp;gt;&lt;br /&gt;
					&amp;lt;device action=&amp;quot;reboot&amp;quot; name=&amp;quot;ipmi_an02&amp;quot;/&amp;gt;&lt;br /&gt;
				&amp;lt;/method&amp;gt;&lt;br /&gt;
				&amp;lt;method name=&amp;quot;pdu&amp;quot;&amp;gt;&lt;br /&gt;
					&amp;lt;device action=&amp;quot;reboot&amp;quot; name=&amp;quot;pdu2&amp;quot; port=&amp;quot;2&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_ipmilan&amp;quot; ipaddr=&amp;quot;an-node01.ipmi&amp;quot; login=&amp;quot;root&amp;quot; name=&amp;quot;ipmi_an01&amp;quot; passwd=&amp;quot;secret&amp;quot;/&amp;gt;&lt;br /&gt;
		&amp;lt;fencedevice agent=&amp;quot;fence_ipmilan&amp;quot; ipaddr=&amp;quot;an-node02.ipmi&amp;quot; login=&amp;quot;root&amp;quot; name=&amp;quot;ipmi_an02&amp;quot; passwd=&amp;quot;secret&amp;quot;/&amp;gt;&lt;br /&gt;
		&amp;lt;fencedevice agent=&amp;quot;fence_apc_snmp&amp;quot; ipaddr=&amp;quot;pdu2.alteeve.com&amp;quot; name=&amp;quot;pdu2&amp;quot;/&amp;gt;&lt;br /&gt;
	&amp;lt;/fencedevices&amp;gt;&lt;br /&gt;
	&amp;lt;fence_daemon post_join_delay=&amp;quot;30&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 log_level=&amp;quot;5&amp;quot;&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;script file=&amp;quot;/etc/init.d/libvirtd&amp;quot; name=&amp;quot;libvirtd&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;only_an01&amp;quot; nofailback=&amp;quot;1&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-node01.alteeve.com&amp;quot;/&amp;gt;&lt;br /&gt;
			&amp;lt;/failoverdomain&amp;gt;&lt;br /&gt;
			&amp;lt;failoverdomain name=&amp;quot;only_an02&amp;quot; nofailback=&amp;quot;1&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-node02.alteeve.com&amp;quot;/&amp;gt;&lt;br /&gt;
			&amp;lt;/failoverdomain&amp;gt;&lt;br /&gt;
			&amp;lt;failoverdomain name=&amp;quot;primary_an01&amp;quot; nofailback=&amp;quot;1&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-node01.alteeve.com&amp;quot; priority=&amp;quot;1&amp;quot;/&amp;gt;&lt;br /&gt;
				&amp;lt;failoverdomainnode name=&amp;quot;an-node02.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;primary_an02&amp;quot; nofailback=&amp;quot;1&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-node01.alteeve.com&amp;quot; priority=&amp;quot;2&amp;quot;/&amp;gt;&lt;br /&gt;
				&amp;lt;failoverdomainnode name=&amp;quot;an-node02.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;only_an01&amp;quot; exclusive=&amp;quot;0&amp;quot; name=&amp;quot;storage_an01&amp;quot; recovery=&amp;quot;restart&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 ref=&amp;quot;libvirtd&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;/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;only_an02&amp;quot; exclusive=&amp;quot;0&amp;quot; name=&amp;quot;storage_an02&amp;quot; recovery=&amp;quot;restart&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 ref=&amp;quot;libvirtd&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;/script&amp;gt;&lt;br /&gt;
		&amp;lt;/service&amp;gt;&lt;br /&gt;
		&amp;lt;vm name=&amp;quot;vm0001-dev&amp;quot; domain=&amp;quot;primary_an01&amp;quot; path=&amp;quot;/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-web&amp;quot; domain=&amp;quot;primary_an01&amp;quot; path=&amp;quot;/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;vm0003-db&amp;quot; domain=&amp;quot;primary_an02&amp;quot; path=&amp;quot;/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;vm0004-ms&amp;quot; domain=&amp;quot;primary_an02&amp;quot; path=&amp;quot;/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;
&lt;br /&gt;
Let&#039;s validate one more time.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ccs_config_validate &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Configuration validates&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
She&#039;s a beaut&#039;, eh?&lt;br /&gt;
&lt;br /&gt;
=== Making The VM Services Active ===&lt;br /&gt;
&lt;br /&gt;
Before we push the last &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cluster.conf&amp;lt;/span&amp;gt; out, lets take a look at the current state of affairs.&lt;br /&gt;
&lt;br /&gt;
On &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;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-cluster-A @ Tue Dec 27 14:06: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-node01.alteeve.com                       1 Online, Local, rgmanager&lt;br /&gt;
 an-node02.alteeve.com                       2 Online, rgmanager&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State         &lt;br /&gt;
 ------- ----                   ----- ------                   -----         &lt;br /&gt;
 service:storage_an01           an-node01.alteeve.com          started       &lt;br /&gt;
 service:storage_an02           an-node02.alteeve.com          started       &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;
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;
  2 vm0001-dev           running&lt;br /&gt;
  4 vm0002-web           running&lt;br /&gt;
  - vm0003-db            shut off&lt;br /&gt;
  - vm0004-ms            shut off&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;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-cluster-A @ Tue Dec 27 14:07:32 2011&lt;br /&gt;
Member Status: Quorate&lt;br /&gt;
&lt;br /&gt;
 Member Name                             ID   Status&lt;br /&gt;
 ------ ----                             ---- ------&lt;br /&gt;
 an-node01.alteeve.com                       1 Online, rgmanager&lt;br /&gt;
 an-node02.alteeve.com                       2 Online, Local, rgmanager&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State         &lt;br /&gt;
 ------- ----                   ----- ------                   -----         &lt;br /&gt;
 service:storage_an01           an-node01.alteeve.com          started       &lt;br /&gt;
 service:storage_an02           an-node02.alteeve.com          started       &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;
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;
  2 vm0003-db            running&lt;br /&gt;
  4 vm0004-ms            running&lt;br /&gt;
  - vm0001-dev           shut off&lt;br /&gt;
  - vm0002-web           shut off&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So we can see that the cluster doesn&#039;t know about the VMs yet, as we&#039;ve not yet pushed out the changes. We can also see that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0001-dev&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0002-web&amp;lt;/span&amp;gt; are currently running on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0003-db&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0004-ms&amp;lt;/span&amp;gt; are running on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
So let&#039;s push out the new configuration and see what happens!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cman_tool version -r&lt;br /&gt;
cman_tool version&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
6.2.0 config 12&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Let&#039;s take a look at what showed up in syslog;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Dec 27 14:18:20 an-node01 modcluster: Updating cluster.conf&lt;br /&gt;
Dec 27 14:18:20 an-node01 corosync[2362]:   [QUORUM] Members[2]: 1 2&lt;br /&gt;
Dec 27 14:18:20 an-node01 rgmanager[2579]: Reconfiguring&lt;br /&gt;
Dec 27 14:18:22 an-node01 rgmanager[2579]: Initializing vm:vm0001-dev&lt;br /&gt;
Dec 27 14:18:22 an-node01 rgmanager[2579]: vm:vm0001-dev was added to the config, but I am not initializing it.&lt;br /&gt;
Dec 27 14:18:22 an-node01 rgmanager[2579]: Initializing vm:vm0002-web&lt;br /&gt;
Dec 27 14:18:22 an-node01 rgmanager[2579]: vm:vm0002-web was added to the config, but I am not initializing it.&lt;br /&gt;
Dec 27 14:18:22 an-node01 rgmanager[2579]: Initializing vm:vm0003-db&lt;br /&gt;
Dec 27 14:18:22 an-node01 rgmanager[2579]: vm:vm0003-db was added to the config, but I am not initializing it.&lt;br /&gt;
Dec 27 14:18:23 an-node01 rgmanager[2579]: Initializing vm:vm0004-ms&lt;br /&gt;
Dec 27 14:18:23 an-node01 rgmanager[2579]: vm:vm0004-ms was added to the config, but I am not initializing it.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Indeed, if we check again with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clustat&amp;lt;/span&amp;gt;, we&#039;ll see the new VM services, but all four will show as &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;disabled&amp;lt;/span&amp;gt;, despite the VMs themselves being up and running.&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-cluster-A @ Tue Dec 27 14:20: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-node01.alteeve.com                       1 Online, Local, rgmanager&lt;br /&gt;
 an-node02.alteeve.com                       2 Online, rgmanager&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State         &lt;br /&gt;
 ------- ----                   ----- ------                   -----         &lt;br /&gt;
 service:storage_an01           an-node01.alteeve.com          started       &lt;br /&gt;
 service:storage_an02           an-node02.alteeve.com          started       &lt;br /&gt;
 vm:vm0001-dev                  (none)                         disabled      &lt;br /&gt;
 vm:vm0002-web                  (none)                         disabled      &lt;br /&gt;
 vm:vm0003-db                   (none)                         disabled      &lt;br /&gt;
 vm:vm0004-ms                   (none)                         disabled      &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This highlights how the state of the VMs is not intrinsically tied to the cluster&#039;s status. The VMs were started outside of the cluster, so the cluster thinks they are off-line. We know they&#039;re running though, so we can tell the cluster to enable them now. Note that the VMs will &#039;&#039;&#039;not&#039;&#039;&#039; be rebooted or in any way effected, provided you tell the cluster to enable the VM on the node it&#039;s currently running on.&lt;br /&gt;
&lt;br /&gt;
Let&#039;s start by enabling &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0001-dev&amp;lt;/span&amp;gt;, which we know is running on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;. Be aware that the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm:&amp;lt;/span&amp;gt; prefix is required when using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clusvcadm&amp;lt;/span&amp;gt;!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
clusvcadm -e vm:vm0001-dev -m an-node01.alteeve.com&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
vm:vm0001-dev is now running on an-node01.alteeve.com&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we can see that the VM is under the cluster&#039;s control!&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-cluster-A @ Tue Dec 27 14:25:08 2011&lt;br /&gt;
Member Status: Quorate&lt;br /&gt;
&lt;br /&gt;
 Member Name                             ID   Status&lt;br /&gt;
 ------ ----                             ---- ------&lt;br /&gt;
 an-node01.alteeve.com                       1 Online, Local, rgmanager&lt;br /&gt;
 an-node02.alteeve.com                       2 Online, rgmanager&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State         &lt;br /&gt;
 ------- ----                   ----- ------                   -----         &lt;br /&gt;
 service:storage_an01           an-node01.alteeve.com          started       &lt;br /&gt;
 service:storage_an02           an-node02.alteeve.com          started       &lt;br /&gt;
 vm:vm0001-dev                  an-node01.alteeve.com          started       &lt;br /&gt;
 vm:vm0002-web                  (none)                         disabled      &lt;br /&gt;
 vm:vm0003-db                   (none)                         disabled      &lt;br /&gt;
 vm:vm0004-ms                   (none)                         disabled      &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Perfect! Now to add the other three VMs. Note that all of these commands can be run from whichever node you wish, because we&#039;re specifying the target node by using the &amp;quot;member&amp;quot; switch.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
clusvcadm -e vm:vm0002-web -m an-node01.alteeve.com&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
vm:vm0002-web is now running on an-node01.alteeve.com&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
clusvcadm -e vm:vm0003-db -m an-node02.alteeve.com&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
vm:vm0003-db is now running on an-node02.alteeve.com&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
clusvcadm -e vm:vm0004-ms -m an-node02.alteeve.com&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
vm:vm0004-ms is now running on an-node02.alteeve.com&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Let&#039;s do a final check of the cluster&#039;s status;&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-cluster-A @ Tue Dec 27 14:28:19 2011&lt;br /&gt;
Member Status: Quorate&lt;br /&gt;
&lt;br /&gt;
 Member Name                             ID   Status&lt;br /&gt;
 ------ ----                             ---- ------&lt;br /&gt;
 an-node01.alteeve.com                       1 Online, Local, rgmanager&lt;br /&gt;
 an-node02.alteeve.com                       2 Online, rgmanager&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State         &lt;br /&gt;
 ------- ----                   ----- ------                   -----         &lt;br /&gt;
 service:storage_an01           an-node01.alteeve.com          started       &lt;br /&gt;
 service:storage_an02           an-node02.alteeve.com          started       &lt;br /&gt;
 vm:vm0001-dev                  an-node01.alteeve.com          started       &lt;br /&gt;
 vm:vm0002-web                  an-node01.alteeve.com          started       &lt;br /&gt;
 vm:vm0003-db                   an-node02.alteeve.com          started       &lt;br /&gt;
 vm:vm0004-ms                   an-node02.alteeve.com          started       &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== The Last Step - Automatic Cluster Start ==&lt;br /&gt;
&lt;br /&gt;
The last step is to enable automatic starting of the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; services when the host node boots. This is quite simple;&lt;br /&gt;
&lt;br /&gt;
On both nodes, run;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
chkconfig cman on &amp;amp;&amp;amp; chkconfig rgmanager on&lt;br /&gt;
chkconfig --list | grep -e cman -e rgmanager&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;
cman           	0:off	1:off	2:on	3:on	4:on	5:on	6:off&lt;br /&gt;
rgmanager      	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;
The next time you restart the nodes, you will be able to run &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clustat&amp;lt;/span&amp;gt; and you should find your cluster up and running!&lt;br /&gt;
&lt;br /&gt;
== We&#039;re Done! Or, Are We? ==&lt;br /&gt;
&lt;br /&gt;
That&#039;s it, ladies and gentlemen. Our cluster is completed! In theory now, any failure in the cluster will result in no lost data and, at worst, no more than a minute or two of downtime.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;In theory&amp;quot; just isn&#039;t good enough in clustering though. Time to take &amp;quot;theory&amp;quot; and make it a tested, known fact.&lt;br /&gt;
&lt;br /&gt;
= Testing; Taking Theory And Putting It Into Practice =&lt;br /&gt;
&lt;br /&gt;
You may have thought that we were done. Indeed, the cluster has been built, but we don&#039;t know if things actually work.&lt;br /&gt;
&lt;br /&gt;
Enter testing.&lt;br /&gt;
&lt;br /&gt;
In practice, when preparing production clusters for deployment, you should plan to spend &#039;&#039;&#039;at least&#039;&#039;&#039; twice as long in testing as you did in building the cluster. You need to imagine all failure scenarios, trigger those failures and see what happens.&lt;br /&gt;
&lt;br /&gt;
== A Note On The Importance Of Fencing ==&lt;br /&gt;
&lt;br /&gt;
It may be tempting to think that you were careful and don&#039;t really need to test you cluster thoroughly.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;You are wrong&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Baring you being absolutely obsessive with testing every step of the way, you will almost certain make mistakes. Now I make no claims to genius, but I do like to think I am pretty comfortable building 2-node clusters. Despite that, while writing this testing portion of the tutorial, I found the following problems with my cluster;&lt;br /&gt;
&lt;br /&gt;
* RGManager&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;autostart=&amp;quot;1&amp;quot;&amp;lt;/span&amp;gt; is not evaluated when a node starts, only when quorum is gained. The mistake had me assuming that the storage services would start when the node restarted, after having manually disabled the service prior to node withdrawal.&lt;br /&gt;
* The behaviour of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;echo c &amp;gt; /proc/sysrq-trigger&amp;lt;/span&amp;gt; changed since [[EL5]] and now triggers a core dump with 100% CPU load in [[EL6]] KVM guests. This means that a previous expectation of the cluster recovering from these crashes was wrong.&lt;br /&gt;
* I forgot to install the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;obliterate-peer.sh&amp;lt;/span&amp;gt; script for DRBD, which I didn&#039;t catch until I tried to fail a node.&lt;br /&gt;
&lt;br /&gt;
You simply can&#039;t make assumptions. Test your cluster in every failure mode you can imagine. Until you do, you won&#039;t know what you might have missed!&lt;br /&gt;
&lt;br /&gt;
== Controlled VM Migration And Node Withdrawal ==&lt;br /&gt;
&lt;br /&gt;
This testing will ensure that live migration works in both directions, and that each node can be cleanly removed from and then rejoin the cluster.&lt;br /&gt;
&lt;br /&gt;
The test will consist of the following steps;&lt;br /&gt;
&lt;br /&gt;
# Live migrate &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0001-dev&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0002-web&amp;lt;/span&amp;gt; from &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt; to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt;. This will ensure live migration works and that all VMs will run on a single node.&lt;br /&gt;
# Withdraw &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt; from the cluster entirely and reboot it. This will ensure that cold shut-down of the node is successful.&lt;br /&gt;
# Once &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt; has rebooted, rejoin it to the cluster. This will ensure that rejoining the cluster works.&lt;br /&gt;
# Once &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt; is a member of the cluster, we will wait a few minutes and ensure that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0001-dev&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0002-web&amp;lt;/span&amp;gt; automatically live migrate back to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;. This will ensure that priority is working.&lt;br /&gt;
# We will live migrate &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0003-db&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0004-ms&amp;lt;/span&amp;gt; from &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt; to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt; to ensure that migration works in the other direction.&lt;br /&gt;
# With the VMs all running on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;, we will withdraw &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt; from the cluster, reboot it, rejoin it to the cluster and then confirm that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0003-db&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0004-ms&amp;lt;/span&amp;gt; automatically migrate back to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
With all of these tests completed, we will be able to ensure that order and controlled migration of VM services work as expected.&lt;br /&gt;
&lt;br /&gt;
=== Live Migration - vm0001-dev And vm0002-dev To an-node02 ===&lt;br /&gt;
&lt;br /&gt;
First up, we will use the special &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clusvcadm&amp;lt;/span&amp;gt; switch &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;-M&amp;lt;/span&amp;gt;, which tells the cluster to use &amp;quot;live migration&amp;quot;. This is, the VM will move to the target member without shutting down. Users of the VM should notice, and worst, a brief network interruption when the cut-over occurs, without any adverse effect on their services or dropped connections.&lt;br /&gt;
&lt;br /&gt;
Let&#039;s take a quick look at the state of affairs;&lt;br /&gt;
&lt;br /&gt;
On &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&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;
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-cluster-A @ Sat Dec 31 13:49: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-node01.alteeve.com                       1 Online, rgmanager&lt;br /&gt;
 an-node02.alteeve.com                       2 Online, Local, rgmanager&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State         &lt;br /&gt;
 ------- ----                   ----- ------                   -----         &lt;br /&gt;
 service:storage_an01           an-node01.alteeve.com          started       &lt;br /&gt;
 service:storage_an02           an-node02.alteeve.com          started       &lt;br /&gt;
 vm:vm0001-dev                  an-node01.alteeve.com          started       &lt;br /&gt;
 vm:vm0002-web                  an-node01.alteeve.com          started       &lt;br /&gt;
 vm:vm0003-db                   an-node02.alteeve.com          started       &lt;br /&gt;
 vm:vm0004-ms                   an-node02.alteeve.com          started       &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Lets start by live migrating &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0001-dev&amp;lt;/span&amp;gt;. Before we do though, let&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;[[ssh]]&amp;lt;/span&amp;gt; into it and start a ping against a target on the internet. We&#039;ll leave this running throughout the live migration.&lt;br /&gt;
&lt;br /&gt;
On &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0001-dev&amp;lt;/span&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
[[Image:vm0001-dev_ping_live-migration-test_01.png|thumb|700px|center|Running &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ping alteeve.com&amp;lt;/span&amp;gt; on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0001-dev&amp;lt;/span&amp;gt; prior to live migration.]]&lt;br /&gt;
&lt;br /&gt;
Now back on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;, let&#039;s migrate &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0001-dev&amp;lt;/span&amp;gt; over to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt;. This will take a little while as the VM&#039;s [[RAM]] gets copied across the [[BCN]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
clusvcadm -M vm:vm0001-dev -m an-node02.alteeve.com&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Trying to migrate vm:vm0001-dev to an-node02.alteeve.com...Success&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Image:vm0001-dev_ping_live-migration-test_02.png|thumb|700px|center|Mid-migration of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0001-dev&amp;lt;/span&amp;gt;.]]&lt;br /&gt;
&lt;br /&gt;
Once complete, check the new status of &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-cluster-A @ Sat Dec 31 14:11: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-node01.alteeve.com                       1 Online, rgmanager&lt;br /&gt;
 an-node02.alteeve.com                       2 Online, Local, rgmanager&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State         &lt;br /&gt;
 ------- ----                   ----- ------                   -----         &lt;br /&gt;
 service:storage_an01           an-node01.alteeve.com          started       &lt;br /&gt;
 service:storage_an02           an-node02.alteeve.com          started       &lt;br /&gt;
 vm:vm0001-dev                  an-node02.alteeve.com          started       &lt;br /&gt;
 vm:vm0002-web                  an-node01.alteeve.com          started       &lt;br /&gt;
 vm:vm0003-db                   an-node02.alteeve.com          started       &lt;br /&gt;
 vm:vm0004-ms                   an-node02.alteeve.com          started       &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If we look again at &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0001-dev&amp;lt;/span&amp;gt;&#039;s ping, we&#039;ll see that a few packets were dropped but our ssh session remained intact. Any other active [[TCP]] session should have survived this just fine as well.&lt;br /&gt;
&lt;br /&gt;
[[Image:vm0001-dev_ping_live-migration-test_03.png|thumb|700px|center|Results of the ping on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0001-dev&amp;lt;/span&amp;gt; post live migration.]]&lt;br /&gt;
&lt;br /&gt;
Wonderful! Now let&#039;s live migrate &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0002-web&amp;lt;/span&amp;gt; to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
clusvcadm -M vm:vm0002-web -m an-node02.alteeve.com&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Trying to migrate vm:vm0002-web to an-node02.alteeve.com...Success&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Again, check the new status of &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-cluster-A @ Sat Dec 31 14:17:35 2011&lt;br /&gt;
Member Status: Quorate&lt;br /&gt;
&lt;br /&gt;
 Member Name                             ID   Status&lt;br /&gt;
 ------ ----                             ---- ------&lt;br /&gt;
 an-node01.alteeve.com                       1 Online, rgmanager&lt;br /&gt;
 an-node02.alteeve.com                       2 Online, Local, rgmanager&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State         &lt;br /&gt;
 ------- ----                   ----- ------                   -----         &lt;br /&gt;
 service:storage_an01           an-node01.alteeve.com          started       &lt;br /&gt;
 service:storage_an02           an-node02.alteeve.com          started       &lt;br /&gt;
 vm:vm0001-dev                  an-node02.alteeve.com          started       &lt;br /&gt;
 vm:vm0002-web                  an-node02.alteeve.com          started       &lt;br /&gt;
 vm:vm0003-db                   an-node02.alteeve.com          started       &lt;br /&gt;
 vm:vm0004-ms                   an-node02.alteeve.com          started       &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can see now that all four VMs are running on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt;! This is possible because of our careful planning of the VM resources earlier. This will mean more load on the host node&#039;s CPU, so things might not be as fast as we would like, but all services are on-line!&lt;br /&gt;
&lt;br /&gt;
=== Withdraw an-node01 From The Cluster ===&lt;br /&gt;
&lt;br /&gt;
So imagine now that we need to do some work on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;, like replace a bad network card or add some RAM. We&#039;ve moved the VMs off, so now the only remaining service is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;service:storage_an01&amp;lt;/span&amp;gt;. We don&#039;t want to manually disable this service, because if we did, the service would not automatically start when the node rejoined the cluster. So we&#039;re going to just stop &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; and let it disable the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;storage_an01&amp;lt;/span&amp;gt; service.&lt;br /&gt;
&lt;br /&gt;
Check the state of the cluster;&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-cluster-A @ Sun Jan  1 16:11:56 2012&lt;br /&gt;
Member Status: Quorate&lt;br /&gt;
&lt;br /&gt;
 Member Name                             ID   Status&lt;br /&gt;
 ------ ----                             ---- ------&lt;br /&gt;
 an-node01.alteeve.com                       1 Online, Local, rgmanager&lt;br /&gt;
 an-node02.alteeve.com                       2 Online, rgmanager&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State         &lt;br /&gt;
 ------- ----                   ----- ------                   -----         &lt;br /&gt;
 service:storage_an01           an-node01.alteeve.com          started       &lt;br /&gt;
 service:storage_an02           an-node02.alteeve.com          started       &lt;br /&gt;
 vm:vm0001-dev                  an-node02.alteeve.com          started       &lt;br /&gt;
 vm:vm0002-web                  an-node02.alteeve.com          started       &lt;br /&gt;
 vm:vm0003-db                   an-node02.alteeve.com          started       &lt;br /&gt;
 vm:vm0004-ms                   an-node02.alteeve.com          started       &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Just as we expect, so now we will stop &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt;, then stop &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
On &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;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 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 Service Manager:                          [  OK  ]&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/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;
   Leaving fence domain...                                 [  OK  ]&lt;br /&gt;
   Stopping gfs_controld...                                [  OK  ]&lt;br /&gt;
   Stopping dlm_controld...                                [  OK  ]&lt;br /&gt;
   Stopping fenced...                                      [  OK  ]&lt;br /&gt;
   Stopping cman...                                        [  OK  ]&lt;br /&gt;
   Waiting for corosync to shutdown:                       [  OK  ]&lt;br /&gt;
   Unloading kernel modules...                             [  OK  ]&lt;br /&gt;
   Unmounting configfs...                                  [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checking on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt;, we can see that all four VMs are running fine and that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt; is gone.&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-cluster-A @ Sun Jan  1 16:13:23 2012&lt;br /&gt;
Member Status: Quorate&lt;br /&gt;
&lt;br /&gt;
 Member Name                             ID   Status&lt;br /&gt;
 ------ ----                             ---- ------&lt;br /&gt;
 an-node01.alteeve.com                       1 Offline&lt;br /&gt;
 an-node02.alteeve.com                       2 Online, Local, rgmanager&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State         &lt;br /&gt;
 ------- ----                   ----- ------                   -----         &lt;br /&gt;
 service:storage_an01           (an-node01.alteeve.com)        stopped       &lt;br /&gt;
 service:storage_an02           an-node02.alteeve.com          started       &lt;br /&gt;
 vm:vm0001-dev                  an-node02.alteeve.com          started       &lt;br /&gt;
 vm:vm0002-web                  an-node02.alteeve.com          started       &lt;br /&gt;
 vm:vm0003-db                   an-node02.alteeve.com          started       &lt;br /&gt;
 vm:vm0004-ms                   an-node02.alteeve.com          started       &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Test passed!&lt;br /&gt;
&lt;br /&gt;
You can now power off and restart &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Rejoining an-node01 To The Cluster ===&lt;br /&gt;
&lt;br /&gt;
If you haven&#039;t already, reboot &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;. As we set earlier, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; will start automatically. The easiest thing to do for this test is to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;watch clustat&amp;lt;/span&amp;gt; on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt;. If all goes well, you should see &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt; rejoin the cluster automatically.&lt;br /&gt;
&lt;br /&gt;
Connected to cluster;&lt;br /&gt;
&lt;br /&gt;
[[Image:2nrhkct_automatic-reconnect-an-node01_01.png|thumb|700px|center|Rebooting &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;, while &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt; hosts all four VMs.]]&lt;br /&gt;
&lt;br /&gt;
Storage coming on-line;&lt;br /&gt;
&lt;br /&gt;
[[Image:2nrhkct_automatic-reconnect-an-node01_02.png|thumb|700px|center|Storage coming up on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;.]]&lt;br /&gt;
&lt;br /&gt;
Back in business!&lt;br /&gt;
&lt;br /&gt;
[[Image:2nrhkct_automatic-reconnect-an-node01_03.png|thumb|700px|center|Back in business!]]&lt;br /&gt;
&lt;br /&gt;
You should be able to log back into &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt; and see that everything is back on-line. DRBD should be &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;UpToDate&amp;lt;/span&amp;gt;, or be in the process of synchronizing. &lt;br /&gt;
&lt;br /&gt;
{{warning|1=Never migrate a VM to a node until its underlying DRBD resource is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;UpToDate&amp;lt;/span&amp;gt;! If the sync source node (the one that is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;UpToDate&amp;lt;/span&amp;gt;) goes down, DRBD will drop the resource to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Secondary&amp;lt;/span&amp;gt;, making it inaccessible to the node and crashing the VM.}}&lt;br /&gt;
&lt;br /&gt;
=== Migrating vm0001-dev And vm0002-web Back To an-node01 ===&lt;br /&gt;
&lt;br /&gt;
If we were putting the cluster back into its normal state, all that would be left to do is to migrate &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;&#039;s VMs back. So let&#039;s do that. &lt;br /&gt;
&lt;br /&gt;
As always, start with a check of the current cluster status.&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-cluster-A @ Sun Jan  1 16:31:06 2012&lt;br /&gt;
Member Status: Quorate&lt;br /&gt;
&lt;br /&gt;
 Member Name                             ID   Status&lt;br /&gt;
 ------ ----                             ---- ------&lt;br /&gt;
 an-node01.alteeve.com                       1 Online, Local, rgmanager&lt;br /&gt;
 an-node02.alteeve.com                       2 Online, rgmanager&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State         &lt;br /&gt;
 ------- ----                   ----- ------                   -----         &lt;br /&gt;
 service:storage_an01           an-node01.alteeve.com          started       &lt;br /&gt;
 service:storage_an02           an-node02.alteeve.com          started       &lt;br /&gt;
 vm:vm0001-dev                  an-node02.alteeve.com          started       &lt;br /&gt;
 vm:vm0002-web                  an-node02.alteeve.com          started       &lt;br /&gt;
 vm:vm0003-db                   an-node02.alteeve.com          started       &lt;br /&gt;
 vm:vm0004-ms                   an-node02.alteeve.com          started       &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now confirm that the underlying storage is ready. Remember that DRBD resource &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;r1&amp;lt;/span&amp;gt; backs the VMs used by the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an01-vg0&amp;lt;/span&amp;gt; volume groups.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
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;
version: 8.3.12 (api:88/proto:86-96)&lt;br /&gt;
GIT-hash: e2a8ef4656be026bbae540305fcb998a5991090f build by dag@Build64R6, 2011-11-20 10:57:03&lt;br /&gt;
 0: cs:Connected ro:Primary/Primary ds:UpToDate/UpToDate C r-----&lt;br /&gt;
    ns:0 nr:0 dw:0 dr:12552 al:0 bm:0 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:0 nr:2428 dw:2428 dr:9776 al:0 bm:4 lo:0 pe:0 ua:0 ap:0 ep:1 wo:f oos:0&lt;br /&gt;
 2: cs:Connected ro:Primary/Primary ds:UpToDate/UpToDate C r-----&lt;br /&gt;
    ns:0 nr:510 dw:510 dr:9744 al:0 bm:4 lo:0 pe:0 ua:0 ap:0 ep:1 wo:f oos:0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
All systems ready; Let&#039;s migrate &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0001-dev&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0002-web&amp;lt;/span&amp;gt; now.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
clusvcadm -M vm:vm0001-dev -m an-node01.alteeve.com&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Trying to migrate vm:vm0001-dev to an-node01.alteeve.com...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 -M vm:vm0002-web -m an-node01.alteeve.com&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Trying to migrate vm:vm0002-web to an-node01.alteeve.com...Success&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check the new status;&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-cluster-A @ Sun Jan  1 16:32:11 2012&lt;br /&gt;
Member Status: Quorate&lt;br /&gt;
&lt;br /&gt;
 Member Name                             ID   Status&lt;br /&gt;
 ------ ----                             ---- ------&lt;br /&gt;
 an-node01.alteeve.com                       1 Online, Local, rgmanager&lt;br /&gt;
 an-node02.alteeve.com                       2 Online, rgmanager&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State         &lt;br /&gt;
 ------- ----                   ----- ------                   -----         &lt;br /&gt;
 service:storage_an01           an-node01.alteeve.com          started       &lt;br /&gt;
 service:storage_an02           an-node02.alteeve.com          started       &lt;br /&gt;
 vm:vm0001-dev                  an-node01.alteeve.com          started       &lt;br /&gt;
 vm:vm0002-web                  an-node01.alteeve.com          started       &lt;br /&gt;
 vm:vm0003-db                   an-node02.alteeve.com          started       &lt;br /&gt;
 vm:vm0004-ms                   an-node02.alteeve.com          started       &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With that, the cluster is back in business!&lt;br /&gt;
&lt;br /&gt;
=== Live Migration - vm0003-db And vm0004-ms To an-node01 ===&lt;br /&gt;
&lt;br /&gt;
Let&#039;s start the process of taking &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt; out of the cluster. The first step is to move &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0003-db&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0004-ms&amp;lt;/span&amp;gt; over to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;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-cluster-A @ Sun Jan  1 16:42:10 2012&lt;br /&gt;
Member Status: Quorate&lt;br /&gt;
&lt;br /&gt;
 Member Name                             ID   Status&lt;br /&gt;
 ------ ----                             ---- ------&lt;br /&gt;
 an-node01.alteeve.com                       1 Online, Local, rgmanager&lt;br /&gt;
 an-node02.alteeve.com                       2 Online, rgmanager&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State         &lt;br /&gt;
 ------- ----                   ----- ------                   -----         &lt;br /&gt;
 service:storage_an01           an-node01.alteeve.com          started       &lt;br /&gt;
 service:storage_an02           an-node02.alteeve.com          started       &lt;br /&gt;
 vm:vm0001-dev                  an-node01.alteeve.com          started       &lt;br /&gt;
 vm:vm0002-web                  an-node01.alteeve.com          started       &lt;br /&gt;
 vm:vm0003-db                   an-node02.alteeve.com          started       &lt;br /&gt;
 vm:vm0004-ms                   an-node02.alteeve.com          started       &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Ready to migrate.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
clusvcadm -M vm:vm0003-db -m an-node01.alteeve.com&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Trying to migrate vm:vm0003-db to an-node01.alteeve.com...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 -M vm:vm0004-ms -m an-node01.alteeve.com&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Trying to migrate vm:vm0004-ms to an-node01.alteeve.com...Success&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Confirm;&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-cluster-A @ Sun Jan  1 16:42:42 2012&lt;br /&gt;
Member Status: Quorate&lt;br /&gt;
&lt;br /&gt;
 Member Name                             ID   Status&lt;br /&gt;
 ------ ----                             ---- ------&lt;br /&gt;
 an-node01.alteeve.com                       1 Online, Local, rgmanager&lt;br /&gt;
 an-node02.alteeve.com                       2 Online, rgmanager&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State         &lt;br /&gt;
 ------- ----                   ----- ------                   -----         &lt;br /&gt;
 service:storage_an01           an-node01.alteeve.com          started       &lt;br /&gt;
 service:storage_an02           an-node02.alteeve.com          started       &lt;br /&gt;
 vm:vm0001-dev                  an-node01.alteeve.com          started       &lt;br /&gt;
 vm:vm0002-web                  an-node01.alteeve.com          started       &lt;br /&gt;
 vm:vm0003-db                   an-node01.alteeve.com          started       &lt;br /&gt;
 vm:vm0004-ms                   an-node01.alteeve.com          started       &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Done!&lt;br /&gt;
&lt;br /&gt;
=== Withdraw an-node02 From The Cluster ===&lt;br /&gt;
&lt;br /&gt;
Double-check that all the VMs are off of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt; prior to withdrawal.&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-cluster-A @ Sun Jan  1 16:45:30 2012&lt;br /&gt;
Member Status: Quorate&lt;br /&gt;
&lt;br /&gt;
 Member Name                             ID   Status&lt;br /&gt;
 ------ ----                             ---- ------&lt;br /&gt;
 an-node01.alteeve.com                       1 Online, Local, rgmanager&lt;br /&gt;
 an-node02.alteeve.com                       2 Online, rgmanager&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State         &lt;br /&gt;
 ------- ----                   ----- ------                   -----         &lt;br /&gt;
 service:storage_an01           an-node01.alteeve.com          started       &lt;br /&gt;
 service:storage_an02           an-node02.alteeve.com          started       &lt;br /&gt;
 vm:vm0001-dev                  an-node01.alteeve.com          started       &lt;br /&gt;
 vm:vm0002-web                  an-node01.alteeve.com          started       &lt;br /&gt;
 vm:vm0003-db                   an-node01.alteeve.com          started       &lt;br /&gt;
 vm:vm0004-ms                   an-node01.alteeve.com          started       &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As before, we &#039;&#039;&#039;will not&#039;&#039;&#039; disable the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;storage_an02&amp;lt;/span&amp;gt; service. If we did, the service would not automatically restart when the node rejoined the cluster.&lt;br /&gt;
&lt;br /&gt;
So now that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt; is hosting all of the VMs and is running independently. Now we can stop &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;cman&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
On &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;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 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 Service Manager:                          [  OK  ]&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/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;
   Leaving fence domain...                                 [  OK  ]&lt;br /&gt;
   Stopping gfs_controld...                                [  OK  ]&lt;br /&gt;
   Stopping dlm_controld...                                [  OK  ]&lt;br /&gt;
   Stopping fenced...                                      [  OK  ]&lt;br /&gt;
   Stopping cman...                                        [  OK  ]&lt;br /&gt;
   Waiting for corosync to shutdown:                       [  OK  ]&lt;br /&gt;
   Unloading kernel modules...                             [  OK  ]&lt;br /&gt;
   Unmounting configfs...                                  [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Confirm;&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-cluster-A @ Sun Jan  1 16:49:14 2012&lt;br /&gt;
Member Status: Quorate&lt;br /&gt;
&lt;br /&gt;
 Member Name                             ID   Status&lt;br /&gt;
 ------ ----                             ---- ------&lt;br /&gt;
 an-node01.alteeve.com                       1 Online, Local, rgmanager&lt;br /&gt;
 an-node02.alteeve.com                       2 Offline&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State&lt;br /&gt;
 ------- ----                   ----- ------                   -----&lt;br /&gt;
 service:storage_an01           an-node01.alteeve.com          started&lt;br /&gt;
 service:storage_an02           (an-node02.alteeve.com)        stopped&lt;br /&gt;
 vm:vm0001-dev                  an-node01.alteeve.com          started&lt;br /&gt;
 vm:vm0002-web                  an-node01.alteeve.com          started&lt;br /&gt;
 vm:vm0003-db                   an-node01.alteeve.com          started&lt;br /&gt;
 vm:vm0004-ms                   an-node01.alteeve.com          started&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Done! We can now shut down and reboot &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt; entirely.&lt;br /&gt;
&lt;br /&gt;
=== Rejoining an-node02 To The Cluster ===&lt;br /&gt;
&lt;br /&gt;
Exactly as we did with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;, we will reboot &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt;. The &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; services should start automatically, so once again, we will just &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;watch clustat&amp;lt;/span&amp;gt; on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;. If all goes well, you should see &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt; rejoin the cluster automatically.&lt;br /&gt;
&lt;br /&gt;
Connected to cluster;&lt;br /&gt;
&lt;br /&gt;
[[Image:2nrhkct_automatic-reconnect-an-node02_01.png|thumb|700px|center|Rebooting &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt;, while &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt; hosts all four VMs.]]&lt;br /&gt;
&lt;br /&gt;
Storage coming on-line;&lt;br /&gt;
&lt;br /&gt;
[[Image:2nrhkct_automatic-reconnect-an-node02_02.png|thumb|700px|center|Storage coming up on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt;.]]&lt;br /&gt;
&lt;br /&gt;
Back in business!&lt;br /&gt;
&lt;br /&gt;
[[Image:2nrhkct_automatic-reconnect-an-node02_03.png|thumb|700px|center|Back in business!]]&lt;br /&gt;
&lt;br /&gt;
You should be able to log back into &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt; and see that everything is back on-line. DRBD should be &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;UpToDate&amp;lt;/span&amp;gt;, or be in the process of synchronizing.&lt;br /&gt;
&lt;br /&gt;
{{warning|1=Again; Never migrate a VM to a node until its underlying DRBD resource is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;UpToDate&amp;lt;/span&amp;gt;! If the sync source node (the one that is &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;UpToDate&amp;lt;/span&amp;gt;) goes down, DRBD will drop the resource to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Secondary&amp;lt;/span&amp;gt;, making it inaccessible to the node and crashing the VM.}}&lt;br /&gt;
&lt;br /&gt;
=== Migrating vm0003-db And vm0004-ms Back To an-node02 ===&lt;br /&gt;
&lt;br /&gt;
The last step to restore the cluster to its ideal state is to migrate &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0003-db&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0004-ms&amp;lt;/span&amp;gt; back to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
As always, start with a check of the current cluster status.&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-cluster-A @ Sun Jan  1 16:57:19 2012&lt;br /&gt;
Member Status: Quorate&lt;br /&gt;
&lt;br /&gt;
 Member Name                             ID   Status&lt;br /&gt;
 ------ ----                             ---- ------&lt;br /&gt;
 an-node01.alteeve.com                       1 Online, rgmanager&lt;br /&gt;
 an-node02.alteeve.com                       2 Online, Local, rgmanager&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State         &lt;br /&gt;
 ------- ----                   ----- ------                   -----         &lt;br /&gt;
 service:storage_an01           an-node01.alteeve.com          started       &lt;br /&gt;
 service:storage_an02           an-node02.alteeve.com          started       &lt;br /&gt;
 vm:vm0001-dev                  an-node01.alteeve.com          started       &lt;br /&gt;
 vm:vm0002-web                  an-node01.alteeve.com          started       &lt;br /&gt;
 vm:vm0003-db                   an-node01.alteeve.com          started       &lt;br /&gt;
 vm:vm0004-ms                   an-node01.alteeve.com          started       &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now confirm that the underlying storage is ready. Remember that DRBD resource &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;r2&amp;lt;/span&amp;gt; backs the VMs used by the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an02-vg0&amp;lt;/span&amp;gt; volume groups.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
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;
version: 8.3.12 (api:88/proto:86-96)&lt;br /&gt;
GIT-hash: e2a8ef4656be026bbae540305fcb998a5991090f build by dag@Build64R6, 2011-11-20 10:57:03&lt;br /&gt;
 0: cs:Connected ro:Primary/Primary ds:UpToDate/UpToDate C r-----&lt;br /&gt;
    ns:0 nr:0 dw:0 dr:8788 al:0 bm:0 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:0 nr:376 dw:376 dr:5876 al:0 bm:7 lo:0 pe:0 ua:0 ap:0 ep:1 wo:f oos:0&lt;br /&gt;
 2: cs:Connected ro:Primary/Primary ds:UpToDate/UpToDate C r-----&lt;br /&gt;
    ns:0 nr:671 dw:671 dr:5844 al:0 bm:16 lo:0 pe:0 ua:0 ap:0 ep:1 wo:f oos:0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
All systems ready; Let&#039;s migrate &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0003-db&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0004-ms&amp;lt;/span&amp;gt; now.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
clusvcadm -M vm:vm0003-db -m an-node02.alteeve.com&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Trying to migrate vm:vm0003-db to an-node02.alteeve.com...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 -M vm:vm0004-ms -m an-node02.alteeve.com&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Trying to migrate vm:vm0004-ms to an-node02.alteeve.com...Success&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check the new status;&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-cluster-A @ Sun Jan  1 16:59:22 2012&lt;br /&gt;
Member Status: Quorate&lt;br /&gt;
&lt;br /&gt;
 Member Name                             ID   Status&lt;br /&gt;
 ------ ----                             ---- ------&lt;br /&gt;
 an-node01.alteeve.com                       1 Online, rgmanager&lt;br /&gt;
 an-node02.alteeve.com                       2 Online, Local, rgmanager&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State         &lt;br /&gt;
 ------- ----                   ----- ------                   -----         &lt;br /&gt;
 service:storage_an01           an-node01.alteeve.com          started       &lt;br /&gt;
 service:storage_an02           an-node02.alteeve.com          started       &lt;br /&gt;
 vm:vm0001-dev                  an-node01.alteeve.com          started       &lt;br /&gt;
 vm:vm0002-web                  an-node01.alteeve.com          started       &lt;br /&gt;
 vm:vm0003-db                   an-node02.alteeve.com          started       &lt;br /&gt;
 vm:vm0004-ms                   an-node02.alteeve.com          started       &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
All controlled migration, withdrawal and re-joining tests completed!&lt;br /&gt;
&lt;br /&gt;
== Uncontrolled VM Migration and Node Failure ==&lt;br /&gt;
&lt;br /&gt;
This test will be more violent than the previous tests. Here we will test failing the VMs and ensuring that the cluster will recover the VMs by restarting them on the hosts. We will repeatedly fail the VMs three times within ten minutes to ensure that the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;relocate&amp;lt;/span&amp;gt; policy kicks in, as we expect it to.&lt;br /&gt;
&lt;br /&gt;
Once we complete the VM failure testing, we will fail and recover both nodes, one at a time of course, and rejoin them to the cluster. This will confirm that the VMs recover on the surviving node.&lt;br /&gt;
&lt;br /&gt;
The tests will be;&lt;br /&gt;
&lt;br /&gt;
* Crash all four VMs three times. The failures will be triggered by using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virsh destroy &amp;lt;vm&amp;gt;&amp;lt;/span&amp;gt; on the current host node.&lt;br /&gt;
* After each crash, we will confirm that the VM came back on-line before crashing it again.&lt;br /&gt;
* With all of the VMs tested to recover properly, we will live-migrate them back to their designated host nodes.&lt;br /&gt;
* Once the cluster is back into its ideal state, we will crash &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;. Within a few seconds, it should be [[fenced]] and the lost VMs should restart on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt;. Once it rejoins the cluster and the VMs return to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;, we will repeat the test by failing &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Failure Testing vm0001-dev ===&lt;br /&gt;
&lt;br /&gt;
Confirm that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0001-dev&amp;lt;/span&amp;gt; is running on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;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-cluster-A @ Sun Jan  1 18:29:10 2012&lt;br /&gt;
Member Status: Quorate&lt;br /&gt;
&lt;br /&gt;
 Member Name                             ID   Status&lt;br /&gt;
 ------ ----                             ---- ------&lt;br /&gt;
 an-node01.alteeve.com                       1 Online, Local, rgmanager&lt;br /&gt;
 an-node02.alteeve.com                       2 Online, rgmanager&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State&lt;br /&gt;
 ------- ----                   ----- ------                   -----&lt;br /&gt;
 service:storage_an01           an-node01.alteeve.com          started&lt;br /&gt;
 service:storage_an02           an-node02.alteeve.com          started&lt;br /&gt;
 vm:vm0001-dev                  an-node01.alteeve.com          started&lt;br /&gt;
 vm:vm0002-web                  an-node01.alteeve.com          started&lt;br /&gt;
 vm:vm0003-db                   an-node02.alteeve.com          started&lt;br /&gt;
 vm:vm0004-ms                   an-node02.alteeve.com          started&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is, perfect. Now before I kill a VM, I like to start a ping against it. It acts both as an indication of when the node is back up and acts as a crude method of timing how long it took the VM to fully recover.&lt;br /&gt;
&lt;br /&gt;
{{note|1=If your VMs are isolated, as they are in this tutorial, you may have to run the ping from another VM or from your firewall.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
ping 10.254.0.1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
PING 10.254.0.1 (10.254.0.1) 56(84) bytes of data.&lt;br /&gt;
64 bytes from 10.254.0.1: icmp_seq=1 ttl=64 time=0.737 ms&lt;br /&gt;
64 bytes from 10.254.0.1: icmp_seq=2 ttl=64 time=0.530 ms&lt;br /&gt;
64 bytes from 10.254.0.1: icmp_seq=3 ttl=64 time=0.589 ms&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-node01&amp;lt;/span&amp;gt;, forcefully shut down &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0001-dev&amp;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 destroy vm0001-dev&lt;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-dev destroyed&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Within a few seconds (10, maximum), the cluster will detect that the VM has failed and will restart it.&lt;br /&gt;
&lt;br /&gt;
[[Image:2nrhkct_failing-vm0001-dev_01.png|thumb|700px|center|Failure of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0001-dev&amp;lt;/span&amp;gt; detected by the cluster and restarted.]]&lt;br /&gt;
&lt;br /&gt;
We can see in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;&#039;s syslog that the failure was detected and automatically recovered.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Jan  1 18:38:25 an-node01 kernel: vbr2: port 2(vnet0) entering disabled state&lt;br /&gt;
Jan  1 18:38:25 an-node01 kernel: device vnet0 left promiscuous mode&lt;br /&gt;
Jan  1 18:38:25 an-node01 kernel: vbr2: port 2(vnet0) entering disabled state&lt;br /&gt;
Jan  1 18:38:27 an-node01 ntpd[2190]: Deleting interface #19 vnet0, fe80::fc54:ff:fe9b:3cf7#123, interface stats: received=0, sent=0, dropped=0, active_time=3058 secs&lt;br /&gt;
Jan  1 18:38:35 an-node01 rgmanager[2430]: status on vm &amp;quot;vm0001-dev&amp;quot; returned 7 (unspecified)&lt;br /&gt;
Jan  1 18:38:35 an-node01 rgmanager[2430]: Stopping service vm:vm0001-dev&lt;br /&gt;
Jan  1 18:38:36 an-node01 rgmanager[2430]: Service vm:vm0001-dev is recovering&lt;br /&gt;
Jan  1 18:38:36 an-node01 rgmanager[2430]: Recovering failed service vm:vm0001-dev&lt;br /&gt;
Jan  1 18:38:37 an-node01 kernel: device vnet0 entered promiscuous mode&lt;br /&gt;
Jan  1 18:38:37 an-node01 kernel: vbr2: port 2(vnet0) entering learning state&lt;br /&gt;
Jan  1 18:38:37 an-node01 rgmanager[2430]: Service vm:vm0001-dev started&lt;br /&gt;
Jan  1 18:38:39 an-node01 ntpd[2190]: Listening on interface #20 vnet0, fe80::fc54:ff:fe9b:3cf7#123 Enabled&lt;br /&gt;
Jan  1 18:38:49 an-node01 kernel: kvm: 12390: cpu0 unimplemented perfctr wrmsr: 0xc1 data 0xabcd&lt;br /&gt;
Jan  1 18:38:52 an-node01 kernel: vbr2: port 2(vnet0) entering forwarding state&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The first four entries are related to the VM&#039;s network being torn down after it was killed. The fifth through eighth lines show the detection and recovery of the node!&lt;br /&gt;
&lt;br /&gt;
Going back to the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ping&amp;lt;/span&amp;gt;, we can see that the VM was down for roughly 36 seconds (time between network loss and recovery, add a bit more time for all services to start.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
PING 10.254.0.1 (10.254.0.1) 56(84) bytes of data.&lt;br /&gt;
64 bytes from 10.254.0.1: icmp_seq=1 ttl=64 time=0.737 ms&lt;br /&gt;
64 bytes from 10.254.0.1: icmp_seq=2 ttl=64 time=0.530 ms&lt;br /&gt;
64 bytes from 10.254.0.1: icmp_seq=3 ttl=64 time=0.589 ms&lt;br /&gt;
64 bytes from 10.254.0.1: icmp_seq=4 ttl=64 time=0.589 ms&lt;br /&gt;
64 bytes from 10.254.0.1: icmp_seq=5 ttl=64 time=0.477 ms&lt;br /&gt;
64 bytes from 10.254.0.1: icmp_seq=6 ttl=64 time=0.482 ms&lt;br /&gt;
64 bytes from 10.254.0.1: icmp_seq=7 ttl=64 time=0.489 ms&lt;br /&gt;
64 bytes from 10.254.0.1: icmp_seq=8 ttl=64 time=0.495 ms&lt;br /&gt;
64 bytes from 10.254.0.1: icmp_seq=9 ttl=64 time=0.503 ms&lt;br /&gt;
64 bytes from 10.254.0.1: icmp_seq=10 ttl=64 time=0.513 ms&lt;br /&gt;
64 bytes from 10.254.0.1: icmp_seq=11 ttl=64 time=0.516 ms&lt;br /&gt;
64 bytes from 10.254.0.1: icmp_seq=12 ttl=64 time=0.524 ms&lt;br /&gt;
64 bytes from 10.254.0.1: icmp_seq=13 ttl=64 time=0.405 ms&lt;br /&gt;
64 bytes from 10.254.0.1: icmp_seq=14 ttl=64 time=0.536 ms&lt;br /&gt;
64 bytes from 10.254.0.1: icmp_seq=15 ttl=64 time=0.441 ms&lt;br /&gt;
64 bytes from 10.254.0.1: icmp_seq=16 ttl=64 time=0.552 ms&lt;br /&gt;
&lt;br /&gt;
# Node died here, 36 pings lost at ~1 ping/sec.&lt;br /&gt;
&lt;br /&gt;
64 bytes from 10.254.0.1: icmp_seq=52 ttl=64 time=0.816 ms&lt;br /&gt;
64 bytes from 10.254.0.1: icmp_seq=53 ttl=64 time=0.440 ms&lt;br /&gt;
64 bytes from 10.254.0.1: icmp_seq=54 ttl=64 time=0.354 ms&lt;br /&gt;
64 bytes from 10.254.0.1: icmp_seq=55 ttl=64 time=0.342 ms&lt;br /&gt;
64 bytes from 10.254.0.1: icmp_seq=56 ttl=64 time=0.446 ms&lt;br /&gt;
64 bytes from 10.254.0.1: icmp_seq=57 ttl=64 time=0.418 ms&lt;br /&gt;
64 bytes from 10.254.0.1: icmp_seq=58 ttl=64 time=0.441 ms&lt;br /&gt;
^C&lt;br /&gt;
--- 10.254.0.1 ping statistics ---&lt;br /&gt;
58 packets transmitted, 23 received, 60% packet loss, time 57949ms&lt;br /&gt;
rtt min/avg/max/mdev = 0.342/0.505/0.816/0.109 ms&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Not bad at all!&lt;br /&gt;
&lt;br /&gt;
Now let&#039;s kill it two more times and confirm that the third recovery happens on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt;. We&#039;ll use the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;ping&amp;lt;/span&amp;gt; as an indicator of when the VM is back on-line before killing it the third time.&lt;br /&gt;
&lt;br /&gt;
Second failure;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
virsh destroy vm0001-dev&lt;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-dev destroyed&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checking syslog again;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Jan  1 18:45:07 an-node01 kernel: vbr2: port 2(vnet0) entering disabled state&lt;br /&gt;
Jan  1 18:45:07 an-node01 kernel: device vnet0 left promiscuous mode&lt;br /&gt;
Jan  1 18:45:07 an-node01 kernel: vbr2: port 2(vnet0) entering disabled state&lt;br /&gt;
Jan  1 18:45:09 an-node01 ntpd[2190]: Deleting interface #20 vnet0, fe80::fc54:ff:fe9b:3cf7#123, interface stats: received=0, sent=0, dropped=0, active_time=390 secs&lt;br /&gt;
Jan  1 18:45:46 an-node01 rgmanager[2430]: status on vm &amp;quot;vm0001-dev&amp;quot; returned 7 (unspecified)&lt;br /&gt;
Jan  1 18:45:46 an-node01 rgmanager[2430]: Stopping service vm:vm0001-dev&lt;br /&gt;
Jan  1 18:45:46 an-node01 rgmanager[2430]: Service vm:vm0001-dev is recovering&lt;br /&gt;
Jan  1 18:45:47 an-node01 rgmanager[2430]: Recovering failed service vm:vm0001-dev&lt;br /&gt;
Jan  1 18:45:47 an-node01 kernel: device vnet0 entered promiscuous mode&lt;br /&gt;
Jan  1 18:45:47 an-node01 kernel: vbr2: port 2(vnet0) entering learning state&lt;br /&gt;
Jan  1 18:45:47 an-node01 rgmanager[2430]: Service vm:vm0001-dev started&lt;br /&gt;
Jan  1 18:45:50 an-node01 ntpd[2190]: Listening on interface #21 vnet0, fe80::fc54:ff:fe9b:3cf7#123 Enabled&lt;br /&gt;
Jan  1 18:45:59 an-node01 kernel: kvm: 17874: cpu0 unimplemented perfctr wrmsr: 0xc1 data 0xabcd&lt;br /&gt;
Jan  1 18:46:02 an-node01 kernel: vbr2: port 2(vnet0) entering forwarding state&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can see that the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0001-dev&amp;lt;/span&amp;gt; VM is still on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;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-cluster-A @ Sun Jan  1 18:47:01 2012&lt;br /&gt;
Member Status: Quorate&lt;br /&gt;
&lt;br /&gt;
 Member Name                             ID   Status&lt;br /&gt;
 ------ ----                             ---- ------&lt;br /&gt;
 an-node01.alteeve.com                       1 Online, rgmanager&lt;br /&gt;
 an-node02.alteeve.com                       2 Online, Local, rgmanager&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State&lt;br /&gt;
 ------- ----                   ----- ------                   -----&lt;br /&gt;
 service:storage_an01           an-node01.alteeve.com          started&lt;br /&gt;
 service:storage_an02           an-node02.alteeve.com          started&lt;br /&gt;
 vm:vm0001-dev                  an-node01.alteeve.com          started&lt;br /&gt;
 vm:vm0002-web                  an-node01.alteeve.com          started&lt;br /&gt;
 vm:vm0003-db                   an-node02.alteeve.com          started&lt;br /&gt;
 vm:vm0004-ms                   an-node02.alteeve.com          started&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now the third crash. This time it should come up on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;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 destroy vm0001-dev&lt;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-dev destroyed&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checking &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;&#039;s syslog again, we&#039;ll see something different.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Jan  1 18:47:26 an-node01 kernel: vbr2: port 2(vnet0) entering disabled state&lt;br /&gt;
Jan  1 18:47:26 an-node01 kernel: device vnet0 left promiscuous mode&lt;br /&gt;
Jan  1 18:47:26 an-node01 kernel: vbr2: port 2(vnet0) entering disabled state&lt;br /&gt;
Jan  1 18:47:27 an-node01 ntpd[2190]: Deleting interface #21 vnet0, fe80::fc54:ff:fe9b:3cf7#123, interface stats: received=0, sent=0, dropped=0, active_time=97 secs&lt;br /&gt;
Jan  1 18:47:46 an-node01 rgmanager[2430]: status on vm &amp;quot;vm0001-dev&amp;quot; returned 7 (unspecified)&lt;br /&gt;
Jan  1 18:47:46 an-node01 rgmanager[2430]: Stopping service vm:vm0001-dev&lt;br /&gt;
Jan  1 18:47:46 an-node01 rgmanager[2430]: Service vm:vm0001-dev is recovering&lt;br /&gt;
Jan  1 18:47:46 an-node01 rgmanager[2430]: Restart threshold for vm:vm0001-dev exceeded; attempting to relocate&lt;br /&gt;
Jan  1 18:47:47 an-node01 rgmanager[2430]: Service vm:vm0001-dev is now running on member 2&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The difference is the &amp;quot;&amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;Restart threshold for vm:vm0001-dev exceeded; attempting to relocate&amp;lt;/span&amp;gt;&amp;quot; line. Indeed, if we check &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clustat&amp;lt;/span&amp;gt;, we will in fact see it running on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;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-cluster-A @ Sun Jan  1 18:49:38 2012&lt;br /&gt;
Member Status: Quorate&lt;br /&gt;
&lt;br /&gt;
 Member Name                             ID   Status&lt;br /&gt;
 ------ ----                             ---- ------&lt;br /&gt;
 an-node01.alteeve.com                       1 Online, rgmanager&lt;br /&gt;
 an-node02.alteeve.com                       2 Online, Local, rgmanager&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State&lt;br /&gt;
 ------- ----                   ----- ------                   -----&lt;br /&gt;
 service:storage_an01           an-node01.alteeve.com          started&lt;br /&gt;
 service:storage_an02           an-node02.alteeve.com          started&lt;br /&gt;
 vm:vm0001-dev                  an-node02.alteeve.com          started&lt;br /&gt;
 vm:vm0002-web                  an-node01.alteeve.com          started&lt;br /&gt;
 vm:vm0003-db                   an-node02.alteeve.com          started&lt;br /&gt;
 vm:vm0004-ms                   an-node02.alteeve.com          started&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Success!&lt;br /&gt;
&lt;br /&gt;
This test is complete, so we&#039;ll finish my migrating the VM back to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
clusvcadm -M vm:vm0001-dev -m an-node01.alteeve.com&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Trying to migrate vm:vm0001-dev to an-node01.alteeve.com...Success&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As always, confirm.&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-cluster-A @ Sun Jan  1 18:51:05 2012&lt;br /&gt;
Member Status: Quorate&lt;br /&gt;
&lt;br /&gt;
 Member Name                             ID   Status&lt;br /&gt;
 ------ ----                             ---- ------&lt;br /&gt;
 an-node01.alteeve.com                       1 Online, rgmanager&lt;br /&gt;
 an-node02.alteeve.com                       2 Online, Local, rgmanager&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State&lt;br /&gt;
 ------- ----                   ----- ------                   -----&lt;br /&gt;
 service:storage_an01           an-node01.alteeve.com          started&lt;br /&gt;
 service:storage_an02           an-node02.alteeve.com          started&lt;br /&gt;
 vm:vm0001-dev                  an-node01.alteeve.com          started&lt;br /&gt;
 vm:vm0002-web                  an-node01.alteeve.com          started&lt;br /&gt;
 vm:vm0003-db                   an-node02.alteeve.com          started&lt;br /&gt;
 vm:vm0004-ms                   an-node02.alteeve.com          started&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Excellent.&lt;br /&gt;
&lt;br /&gt;
=== Failure Testing vm0002-web ===&lt;br /&gt;
&lt;br /&gt;
We&#039;ll go through the same process here as we just did with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0001-dev&amp;lt;/span&amp;gt;, but we won&#039;t cover all the details here as much. After each crash of the VM, we&#039;ll check &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clustat&amp;lt;/span&amp;gt; and look at the syslog on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;. Not shown here is a background ping running to indicate when the VM is back up enough to crash again.&lt;br /&gt;
&lt;br /&gt;
Confirm that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0002-web&amp;lt;/span&amp;gt; is on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;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-cluster-A @ Sun Jan  1 19:06:21 2012&lt;br /&gt;
Member Status: Quorate&lt;br /&gt;
&lt;br /&gt;
 Member Name                             ID   Status&lt;br /&gt;
 ------ ----                             ---- ------&lt;br /&gt;
 an-node01.alteeve.com                       1 Online, rgmanager&lt;br /&gt;
 an-node02.alteeve.com                       2 Online, Local, rgmanager&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State&lt;br /&gt;
 ------- ----                   ----- ------                   -----&lt;br /&gt;
 service:storage_an01           an-node01.alteeve.com          started&lt;br /&gt;
 service:storage_an02           an-node02.alteeve.com          started&lt;br /&gt;
 vm:vm0001-dev                  an-node01.alteeve.com          started&lt;br /&gt;
 vm:vm0002-web                  an-node01.alteeve.com          started&lt;br /&gt;
 vm:vm0003-db                   an-node02.alteeve.com          started&lt;br /&gt;
 vm:vm0004-ms                   an-node02.alteeve.com          started&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Good, we&#039;re ready. On &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;, kill the VM.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
virsh destroy vm0002-web&lt;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-web destroyed&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As we expect, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt; restarts the VM within a few seconds.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Jan  1 19:07:16 an-node01 kernel: vbr2: port 3(vnet1) entering disabled state&lt;br /&gt;
Jan  1 19:07:16 an-node01 kernel: device vnet1 left promiscuous mode&lt;br /&gt;
Jan  1 19:07:16 an-node01 kernel: vbr2: port 3(vnet1) entering disabled state&lt;br /&gt;
Jan  1 19:07:18 an-node01 ntpd[2190]: Deleting interface #11 vnet1, fe80::fc54:ff:fe65:3960#123, interface stats: received=0, sent=0, dropped=0, active_time=9315 secs&lt;br /&gt;
Jan  1 19:07:27 an-node01 rgmanager[2430]: status on vm &amp;quot;vm0002-web&amp;quot; returned 7 (unspecified)&lt;br /&gt;
Jan  1 19:07:27 an-node01 rgmanager[2430]: Stopping service vm:vm0002-web&lt;br /&gt;
Jan  1 19:07:27 an-node01 rgmanager[2430]: Service vm:vm0002-web is recovering&lt;br /&gt;
Jan  1 19:07:28 an-node01 rgmanager[2430]: Recovering failed service vm:vm0002-web&lt;br /&gt;
Jan  1 19:07:28 an-node01 kernel: device vnet1 entered promiscuous mode&lt;br /&gt;
Jan  1 19:07:28 an-node01 kernel: vbr2: port 3(vnet1) entering learning state&lt;br /&gt;
Jan  1 19:07:29 an-node01 rgmanager[2430]: Service vm:vm0002-web started&lt;br /&gt;
Jan  1 19:07:31 an-node01 ntpd[2190]: Listening on interface #23 vnet1, fe80::fc54:ff:fe65:3960#123 Enabled&lt;br /&gt;
Jan  1 19:07:38 an-node01 kernel: kvm: 1994: cpu0 unimplemented perfctr wrmsr: 0xc1 data 0xabcd&lt;br /&gt;
Jan  1 19:07:43 an-node01 kernel: vbr2: port 3(vnet1) entering forwarding state&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checking &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clustat&amp;lt;/span&amp;gt;, I can see the VM is back on-line.&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-cluster-A @ Sun Jan  1 19:09:03 2012&lt;br /&gt;
Member Status: Quorate&lt;br /&gt;
&lt;br /&gt;
 Member Name                             ID   Status&lt;br /&gt;
 ------ ----                             ---- ------&lt;br /&gt;
 an-node01.alteeve.com                       1 Online, rgmanager&lt;br /&gt;
 an-node02.alteeve.com                       2 Online, Local, rgmanager&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State&lt;br /&gt;
 ------- ----                   ----- ------                   -----&lt;br /&gt;
 service:storage_an01           an-node01.alteeve.com          started&lt;br /&gt;
 service:storage_an02           an-node02.alteeve.com          started&lt;br /&gt;
 vm:vm0001-dev                  an-node01.alteeve.com          started&lt;br /&gt;
 vm:vm0002-web                  an-node01.alteeve.com          started&lt;br /&gt;
 vm:vm0003-db                   an-node02.alteeve.com          started&lt;br /&gt;
 vm:vm0004-ms                   an-node02.alteeve.com          started&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Let&#039;s kill it for the second time.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
virsh destroy vm0002-web&lt;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-web destroyed&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can again see that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt; recovered it locally.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Jan  1 19:12:08 an-node01 kernel: vbr2: port 3(vnet1) entering disabled state&lt;br /&gt;
Jan  1 19:12:08 an-node01 kernel: device vnet1 left promiscuous mode&lt;br /&gt;
Jan  1 19:12:08 an-node01 kernel: vbr2: port 3(vnet1) entering disabled state&lt;br /&gt;
Jan  1 19:12:10 an-node01 ntpd[2190]: Deleting interface #23 vnet1, fe80::fc54:ff:fe65:3960#123, interface stats: received=0, sent=0, dropped=0, active_time=279 secs&lt;br /&gt;
Jan  1 19:12:17 an-node01 rgmanager[2430]: status on vm &amp;quot;vm0002-web&amp;quot; returned 7 (unspecified)&lt;br /&gt;
Jan  1 19:12:17 an-node01 rgmanager[2430]: Stopping service vm:vm0002-web&lt;br /&gt;
Jan  1 19:12:18 an-node01 rgmanager[2430]: Service vm:vm0002-web is recovering&lt;br /&gt;
Jan  1 19:12:18 an-node01 rgmanager[2430]: Recovering failed service vm:vm0002-web&lt;br /&gt;
Jan  1 19:12:19 an-node01 kernel: device vnet1 entered promiscuous mode&lt;br /&gt;
Jan  1 19:12:19 an-node01 kernel: vbr2: port 3(vnet1) entering learning state&lt;br /&gt;
Jan  1 19:12:19 an-node01 rgmanager[2430]: Service vm:vm0002-web started&lt;br /&gt;
Jan  1 19:12:22 an-node01 ntpd[2190]: Listening on interface #24 vnet1, fe80::fc54:ff:fe65:3960#123 Enabled&lt;br /&gt;
Jan  1 19:12:28 an-node01 kernel: kvm: 6113: cpu0 unimplemented perfctr wrmsr: 0xc1 data 0xabcd&lt;br /&gt;
Jan  1 19:12:34 an-node01 kernel: vbr2: port 3(vnet1) entering forwarding state&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Confirm with &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-cluster-A @ Sun Jan  1 19:13:45 2012&lt;br /&gt;
Member Status: Quorate&lt;br /&gt;
&lt;br /&gt;
 Member Name                             ID   Status&lt;br /&gt;
 ------ ----                             ---- ------&lt;br /&gt;
 an-node01.alteeve.com                       1 Online, rgmanager&lt;br /&gt;
 an-node02.alteeve.com                       2 Online, Local, rgmanager&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State&lt;br /&gt;
 ------- ----                   ----- ------                   -----&lt;br /&gt;
 service:storage_an01           an-node01.alteeve.com          started&lt;br /&gt;
 service:storage_an02           an-node02.alteeve.com          started&lt;br /&gt;
 vm:vm0001-dev                  an-node01.alteeve.com          started&lt;br /&gt;
 vm:vm0002-web                  an-node01.alteeve.com          started&lt;br /&gt;
 vm:vm0003-db                   an-node02.alteeve.com          started&lt;br /&gt;
 vm:vm0004-ms                   an-node02.alteeve.com          started&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This time, it should recover on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;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 destroy vm0002-web&lt;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-web destroyed&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Looking in syslog, we can see the counter was tripped.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Jan  1 19:14:26 an-node01 kernel: vbr2: port 3(vnet1) entering disabled state&lt;br /&gt;
Jan  1 19:14:26 an-node01 kernel: device vnet1 left promiscuous mode&lt;br /&gt;
Jan  1 19:14:26 an-node01 kernel: vbr2: port 3(vnet1) entering disabled state&lt;br /&gt;
Jan  1 19:14:27 an-node01 rgmanager[2430]: status on vm &amp;quot;vm0002-web&amp;quot; returned 7 (unspecified)&lt;br /&gt;
Jan  1 19:14:27 an-node01 rgmanager[2430]: Stopping service vm:vm0002-web&lt;br /&gt;
Jan  1 19:14:28 an-node01 rgmanager[2430]: Service vm:vm0002-web is recovering&lt;br /&gt;
Jan  1 19:14:28 an-node01 rgmanager[2430]: Restart threshold for vm:vm0002-web exceeded; attempting to relocate&lt;br /&gt;
Jan  1 19:14:28 an-node01 ntpd[2190]: Deleting interface #24 vnet1, fe80::fc54:ff:fe65:3960#123, interface stats: received=0, sent=0, dropped=0, active_time=126 secs&lt;br /&gt;
Jan  1 19:14:29 an-node01 rgmanager[2430]: Service vm:vm0002-web is now running on member 2&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Indeed, this is confirmed with &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-cluster-A @ Sun Jan  1 19:15:57 2012&lt;br /&gt;
Member Status: Quorate&lt;br /&gt;
&lt;br /&gt;
 Member Name                             ID   Status&lt;br /&gt;
 ------ ----                             ---- ------&lt;br /&gt;
 an-node01.alteeve.com                       1 Online, rgmanager&lt;br /&gt;
 an-node02.alteeve.com                       2 Online, Local, rgmanager&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State&lt;br /&gt;
 ------- ----                   ----- ------                   -----&lt;br /&gt;
 service:storage_an01           an-node01.alteeve.com          started&lt;br /&gt;
 service:storage_an02           an-node02.alteeve.com          started&lt;br /&gt;
 vm:vm0001-dev                  an-node01.alteeve.com          started&lt;br /&gt;
 vm:vm0002-web                  an-node02.alteeve.com          started&lt;br /&gt;
 vm:vm0003-db                   an-node02.alteeve.com          started&lt;br /&gt;
 vm:vm0004-ms                   an-node02.alteeve.com          started&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Excellent, this test has passed as well! Now migrate the VM back and we&#039;ll be ready to test the third VM.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
clusvcadm -M vm:vm0002-web -m an-node01.alteeve.com&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Trying to migrate vm:vm0002-web to an-node01.alteeve.com...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;
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-cluster-A @ Sun Jan  1 19:17:41 2012&lt;br /&gt;
Member Status: Quorate&lt;br /&gt;
&lt;br /&gt;
 Member Name                             ID   Status&lt;br /&gt;
 ------ ----                             ---- ------&lt;br /&gt;
 an-node01.alteeve.com                       1 Online, rgmanager&lt;br /&gt;
 an-node02.alteeve.com                       2 Online, Local, rgmanager&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State&lt;br /&gt;
 ------- ----                   ----- ------                   -----&lt;br /&gt;
 service:storage_an01           an-node01.alteeve.com          started&lt;br /&gt;
 service:storage_an02           an-node02.alteeve.com          started&lt;br /&gt;
 vm:vm0001-dev                  an-node01.alteeve.com          started&lt;br /&gt;
 vm:vm0002-web                  an-node01.alteeve.com          started&lt;br /&gt;
 vm:vm0003-db                   an-node02.alteeve.com          started&lt;br /&gt;
 vm:vm0004-ms                   an-node02.alteeve.com          started&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Done.&lt;br /&gt;
&lt;br /&gt;
=== Failure Testing vm0003-db ===&lt;br /&gt;
&lt;br /&gt;
This should be getting familiar now. The main difference is that the VM is now running on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt;, so that is where will will kill the VM from and that is where we will watch syslog.&lt;br /&gt;
&lt;br /&gt;
Confirm that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0003-db&amp;lt;/span&amp;gt; is on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;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-cluster-A @ Sun Jan  1 19:25:55 2012&lt;br /&gt;
Member Status: Quorate&lt;br /&gt;
&lt;br /&gt;
 Member Name                             ID   Status&lt;br /&gt;
 ------ ----                             ---- ------&lt;br /&gt;
 an-node01.alteeve.com                       1 Online, Local, rgmanager&lt;br /&gt;
 an-node02.alteeve.com                       2 Online, rgmanager&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State&lt;br /&gt;
 ------- ----                   ----- ------                   -----&lt;br /&gt;
 service:storage_an01           an-node01.alteeve.com          started&lt;br /&gt;
 service:storage_an02           an-node02.alteeve.com          started&lt;br /&gt;
 vm:vm0001-dev                  an-node01.alteeve.com          started&lt;br /&gt;
 vm:vm0002-web                  an-node01.alteeve.com          started&lt;br /&gt;
 vm:vm0003-db                   an-node02.alteeve.com          started&lt;br /&gt;
 vm:vm0004-ms                   an-node02.alteeve.com          started&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Good, we&#039;re ready. On &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt;, kill the VM.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
virsh destroy vm0003-db&lt;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 vm0003-db destroyed&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As we expect, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt; restarts the VM within a few seconds.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Jan  1 19:26:21 an-node02 kernel: vbr2: port 2(vnet0) entering disabled state&lt;br /&gt;
Jan  1 19:26:21 an-node02 kernel: device vnet0 left promiscuous mode&lt;br /&gt;
Jan  1 19:26:21 an-node02 kernel: vbr2: port 2(vnet0) entering disabled state&lt;br /&gt;
Jan  1 19:26:22 an-node02 ntpd[2200]: Deleting interface #10 vnet0, fe80::fc54:ff:fe44:83ec#123, interface stats: received=0, sent=0, dropped=0, active_time=8863 secs&lt;br /&gt;
Jan  1 19:26:35 an-node02 rgmanager[2439]: status on vm &amp;quot;vm0003-db&amp;quot; returned 7 (unspecified)&lt;br /&gt;
Jan  1 19:26:36 an-node02 rgmanager[2439]: Stopping service vm:vm0003-db&lt;br /&gt;
Jan  1 19:26:36 an-node02 rgmanager[2439]: Service vm:vm0003-db is recovering&lt;br /&gt;
Jan  1 19:26:36 an-node02 rgmanager[2439]: Recovering failed service vm:vm0003-db&lt;br /&gt;
Jan  1 19:26:37 an-node02 kernel: device vnet0 entered promiscuous mode&lt;br /&gt;
Jan  1 19:26:37 an-node02 kernel: vbr2: port 2(vnet0) entering learning state&lt;br /&gt;
Jan  1 19:26:37 an-node02 rgmanager[2439]: Service vm:vm0003-db started&lt;br /&gt;
Jan  1 19:26:40 an-node02 ntpd[2200]: Listening on interface #15 vnet0, fe80::fc54:ff:fe44:83ec#123 Enabled&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checking &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clustat&amp;lt;/span&amp;gt;, I can see the VM is back on-line.&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-cluster-A @ Sun Jan  1 19:27:06 2012&lt;br /&gt;
Member Status: Quorate&lt;br /&gt;
&lt;br /&gt;
 Member Name                             ID   Status&lt;br /&gt;
 ------ ----                             ---- ------&lt;br /&gt;
 an-node01.alteeve.com                       1 Online, Local, rgmanager&lt;br /&gt;
 an-node02.alteeve.com                       2 Online, rgmanager&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State&lt;br /&gt;
 ------- ----                   ----- ------                   -----&lt;br /&gt;
 service:storage_an01           an-node01.alteeve.com          started&lt;br /&gt;
 service:storage_an02           an-node02.alteeve.com          started&lt;br /&gt;
 vm:vm0001-dev                  an-node01.alteeve.com          started&lt;br /&gt;
 vm:vm0002-web                  an-node01.alteeve.com          started&lt;br /&gt;
 vm:vm0003-db                   an-node02.alteeve.com          started&lt;br /&gt;
 vm:vm0004-ms                   an-node02.alteeve.com          started&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Let&#039;s kill it for the second time.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
virsh destroy vm0003-db&lt;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 vm0003-db destroyed&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can again see that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt; recovered it locally.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Jan  1 19:27:40 an-node02 kernel: vbr2: port 2(vnet0) entering disabled state&lt;br /&gt;
Jan  1 19:27:40 an-node02 kernel: device vnet0 left promiscuous mode&lt;br /&gt;
Jan  1 19:27:40 an-node02 kernel: vbr2: port 2(vnet0) entering disabled state&lt;br /&gt;
Jan  1 19:27:41 an-node02 ntpd[2200]: Deleting interface #15 vnet0, fe80::fc54:ff:fe44:83ec#123, interface stats: received=0, sent=0, dropped=0, active_time=61 secs&lt;br /&gt;
Jan  1 19:27:45 an-node02 rgmanager[2439]: status on vm &amp;quot;vm0003-db&amp;quot; returned 7 (unspecified)&lt;br /&gt;
Jan  1 19:27:46 an-node02 rgmanager[2439]: Stopping service vm:vm0003-db&lt;br /&gt;
Jan  1 19:27:46 an-node02 rgmanager[2439]: Service vm:vm0003-db is recovering&lt;br /&gt;
Jan  1 19:27:46 an-node02 rgmanager[2439]: Recovering failed service vm:vm0003-db&lt;br /&gt;
Jan  1 19:27:47 an-node02 kernel: device vnet0 entered promiscuous mode&lt;br /&gt;
Jan  1 19:27:47 an-node02 kernel: vbr2: port 2(vnet0) entering learning state&lt;br /&gt;
Jan  1 19:27:47 an-node02 rgmanager[2439]: Service vm:vm0003-db started&lt;br /&gt;
Jan  1 19:27:50 an-node02 ntpd[2200]: Listening on interface #16 vnet0, fe80::fc54:ff:fe44:83ec#123 Enabled&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Confirm with &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-cluster-A @ Sun Jan  1 19:28:21 2012&lt;br /&gt;
Member Status: Quorate&lt;br /&gt;
&lt;br /&gt;
 Member Name                             ID   Status&lt;br /&gt;
 ------ ----                             ---- ------&lt;br /&gt;
 an-node01.alteeve.com                       1 Online, Local, rgmanager&lt;br /&gt;
 an-node02.alteeve.com                       2 Online, rgmanager&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State&lt;br /&gt;
 ------- ----                   ----- ------                   -----&lt;br /&gt;
 service:storage_an01           an-node01.alteeve.com          started&lt;br /&gt;
 service:storage_an02           an-node02.alteeve.com          started&lt;br /&gt;
 vm:vm0001-dev                  an-node01.alteeve.com          started&lt;br /&gt;
 vm:vm0002-web                  an-node01.alteeve.com          started&lt;br /&gt;
 vm:vm0003-db                   an-node02.alteeve.com          started&lt;br /&gt;
 vm:vm0004-ms                   an-node02.alteeve.com          started&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This time, it should recover on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;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 destroy vm0003-db&lt;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 vm0003-db destroyed&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Looking in syslog, we can see the counter was tripped.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Jan  1 19:28:36 an-node02 kernel: vbr2: port 2(vnet0) entering disabled state&lt;br /&gt;
Jan  1 19:28:36 an-node02 kernel: device vnet0 left promiscuous mode&lt;br /&gt;
Jan  1 19:28:36 an-node02 kernel: vbr2: port 2(vnet0) entering disabled state&lt;br /&gt;
Jan  1 19:28:37 an-node02 ntpd[2200]: Deleting interface #16 vnet0, fe80::fc54:ff:fe44:83ec#123, interface stats: received=0, sent=0, dropped=0, active_time=47 secs&lt;br /&gt;
Jan  1 19:28:55 an-node02 rgmanager[2439]: status on vm &amp;quot;vm0003-db&amp;quot; returned 7 (unspecified)&lt;br /&gt;
Jan  1 19:28:56 an-node02 rgmanager[2439]: Stopping service vm:vm0003-db&lt;br /&gt;
Jan  1 19:28:56 an-node02 rgmanager[2439]: Service vm:vm0003-db is recovering&lt;br /&gt;
Jan  1 19:28:56 an-node02 rgmanager[2439]: Restart threshold for vm:vm0003-db exceeded; attempting to relocate&lt;br /&gt;
Jan  1 19:28:57 an-node02 rgmanager[2439]: Service vm:vm0003-db is now running on member 1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Again, this is confirmed with &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-cluster-A @ Sun Jan  1 19:29:42 2012&lt;br /&gt;
Member Status: Quorate&lt;br /&gt;
&lt;br /&gt;
 Member Name                             ID   Status&lt;br /&gt;
 ------ ----                             ---- ------&lt;br /&gt;
 an-node01.alteeve.com                       1 Online, Local, rgmanager&lt;br /&gt;
 an-node02.alteeve.com                       2 Online, rgmanager&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State&lt;br /&gt;
 ------- ----                   ----- ------                   -----&lt;br /&gt;
 service:storage_an01           an-node01.alteeve.com          started&lt;br /&gt;
 service:storage_an02           an-node02.alteeve.com          started&lt;br /&gt;
 vm:vm0001-dev                  an-node01.alteeve.com          started&lt;br /&gt;
 vm:vm0002-web                  an-node01.alteeve.com          started&lt;br /&gt;
 vm:vm0003-db                   an-node01.alteeve.com          started&lt;br /&gt;
 vm:vm0004-ms                   an-node02.alteeve.com          started&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This test has passed as well! As before, migrate the VM back and we&#039;ll be ready to test the last VM.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
clusvcadm -M vm:vm0003-db -m an-node02.alteeve.com&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Trying to migrate vm:vm0003-db to an-node02.alteeve.com...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;
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-cluster-A @ Sun Jan  1 19:30:32 2012&lt;br /&gt;
Member Status: Quorate&lt;br /&gt;
&lt;br /&gt;
 Member Name                             ID   Status&lt;br /&gt;
 ------ ----                             ---- ------&lt;br /&gt;
 an-node01.alteeve.com                       1 Online, Local, rgmanager&lt;br /&gt;
 an-node02.alteeve.com                       2 Online, rgmanager&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State&lt;br /&gt;
 ------- ----                   ----- ------                   -----&lt;br /&gt;
 service:storage_an01           an-node01.alteeve.com          started&lt;br /&gt;
 service:storage_an02           an-node02.alteeve.com          started&lt;br /&gt;
 vm:vm0001-dev                  an-node01.alteeve.com          started&lt;br /&gt;
 vm:vm0002-web                  an-node01.alteeve.com          started&lt;br /&gt;
 vm:vm0003-db                   an-node02.alteeve.com          started&lt;br /&gt;
 vm:vm0004-ms                   an-node02.alteeve.com          started&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Done.&lt;br /&gt;
&lt;br /&gt;
=== Failure Testing vm0004-ms ===&lt;br /&gt;
&lt;br /&gt;
{{warning|1=Windows is particularly sensitive to sudden reboots. This is the nature of MS Windows and beyond the ability of the cluster to deal with. As such, be sure that you&#039;ve created your recovery ISOs and taken reasonable precautions so that you can recover the guest after a hard shut down. That is, of course, what we&#039;re about to do here.}}&lt;br /&gt;
&lt;br /&gt;
This is the last VM to test. This testing is repetitive and boring, but it is also critical. Good on you for sticking it out. Right then, let&#039;s get to it.&lt;br /&gt;
&lt;br /&gt;
Confirm that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0004-ms&amp;lt;/span&amp;gt; is on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;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-cluster-A @ Sun Jan  1 19:43:41 2012&lt;br /&gt;
Member Status: Quorate&lt;br /&gt;
&lt;br /&gt;
 Member Name                             ID   Status&lt;br /&gt;
 ------ ----                             ---- ------&lt;br /&gt;
 an-node01.alteeve.com                       1 Online, Local, rgmanager&lt;br /&gt;
 an-node02.alteeve.com                       2 Online, rgmanager&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State&lt;br /&gt;
 ------- ----                   ----- ------                   -----&lt;br /&gt;
 service:storage_an01           an-node01.alteeve.com          started&lt;br /&gt;
 service:storage_an02           an-node02.alteeve.com          started&lt;br /&gt;
 vm:vm0001-dev                  an-node01.alteeve.com          started&lt;br /&gt;
 vm:vm0002-web                  an-node01.alteeve.com          started&lt;br /&gt;
 vm:vm0003-db                   an-node02.alteeve.com          started&lt;br /&gt;
 vm:vm0004-ms                   an-node02.alteeve.com          started&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Good, we&#039;re ready. On &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt;, kill the VM.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
virsh destroy vm0004-ms&lt;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 vm0004-ms destroyed&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As we expect, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt; restarts the VM within a few seconds.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Jan  1 19:43:52 an-node02 kernel: vbr2: port 3(vnet1) entering disabled state&lt;br /&gt;
Jan  1 19:43:52 an-node02 kernel: device vnet1 left promiscuous mode&lt;br /&gt;
Jan  1 19:43:52 an-node02 kernel: vbr2: port 3(vnet1) entering disabled state&lt;br /&gt;
Jan  1 19:43:53 an-node02 ntpd[2200]: Deleting interface #11 vnet1, fe80::fc54:ff:fe5e:b147#123, interface stats: received=0, sent=0, dropped=0, active_time=9895 secs&lt;br /&gt;
Jan  1 19:44:06 an-node02 rgmanager[2439]: status on vm &amp;quot;vm0004-ms&amp;quot; returned 7 (unspecified)&lt;br /&gt;
Jan  1 19:44:07 an-node02 rgmanager[2439]: Stopping service vm:vm0004-ms&lt;br /&gt;
Jan  1 19:44:07 an-node02 rgmanager[2439]: Service vm:vm0004-ms is recovering&lt;br /&gt;
Jan  1 19:44:07 an-node02 rgmanager[2439]: Recovering failed service vm:vm0004-ms&lt;br /&gt;
Jan  1 19:44:08 an-node02 kernel: device vnet1 entered promiscuous mode&lt;br /&gt;
Jan  1 19:44:08 an-node02 kernel: vbr2: port 3(vnet1) entering learning state&lt;br /&gt;
Jan  1 19:44:08 an-node02 rgmanager[2439]: Service vm:vm0004-ms started&lt;br /&gt;
Jan  1 19:44:11 an-node02 ntpd[2200]: Listening on interface #18 vnet1, fe80::fc54:ff:fe5e:b147#123 Enabled&lt;br /&gt;
Jan  1 19:44:23 an-node02 kernel: vbr2: port 3(vnet1) entering forwarding state&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checking &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clustat&amp;lt;/span&amp;gt;, I can see the VM is back on-line.&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-cluster-A @ Sun Jan  1 19:44:38 2012&lt;br /&gt;
Member Status: Quorate&lt;br /&gt;
&lt;br /&gt;
 Member Name                             ID   Status&lt;br /&gt;
 ------ ----                             ---- ------&lt;br /&gt;
 an-node01.alteeve.com                       1 Online, Local, rgmanager&lt;br /&gt;
 an-node02.alteeve.com                       2 Online, rgmanager&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State&lt;br /&gt;
 ------- ----                   ----- ------                   -----&lt;br /&gt;
 service:storage_an01           an-node01.alteeve.com          started&lt;br /&gt;
 service:storage_an02           an-node02.alteeve.com          started&lt;br /&gt;
 vm:vm0001-dev                  an-node01.alteeve.com          started&lt;br /&gt;
 vm:vm0002-web                  an-node01.alteeve.com          started&lt;br /&gt;
 vm:vm0003-db                   an-node02.alteeve.com          started&lt;br /&gt;
 vm:vm0004-ms                   an-node02.alteeve.com          started&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Let&#039;s kill it for the second time.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
virsh destroy vm0004-ms&lt;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 vm0004-ms destroyed&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can again see that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt; recovered it locally.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Jan  1 19:44:54 an-node02 kernel: vbr2: port 3(vnet1) entering disabled state&lt;br /&gt;
Jan  1 19:44:54 an-node02 kernel: device vnet1 left promiscuous mode&lt;br /&gt;
Jan  1 19:44:54 an-node02 kernel: vbr2: port 3(vnet1) entering disabled state&lt;br /&gt;
Jan  1 19:44:55 an-node02 ntpd[2200]: Deleting interface #18 vnet1, fe80::fc54:ff:fe5e:b147#123, interface stats: received=0, sent=0, dropped=0, active_time=44 secs&lt;br /&gt;
Jan  1 19:45:16 an-node02 rgmanager[2439]: status on vm &amp;quot;vm0004-ms&amp;quot; returned 7 (unspecified)&lt;br /&gt;
Jan  1 19:45:17 an-node02 rgmanager[2439]: Stopping service vm:vm0004-ms&lt;br /&gt;
Jan  1 19:45:17 an-node02 rgmanager[2439]: Service vm:vm0004-ms is recovering&lt;br /&gt;
Jan  1 19:45:17 an-node02 rgmanager[2439]: Recovering failed service vm:vm0004-ms&lt;br /&gt;
Jan  1 19:45:18 an-node02 kernel: device vnet1 entered promiscuous mode&lt;br /&gt;
Jan  1 19:45:18 an-node02 kernel: vbr2: port 3(vnet1) entering learning state&lt;br /&gt;
Jan  1 19:45:18 an-node02 rgmanager[2439]: Service vm:vm0004-ms started&lt;br /&gt;
Jan  1 19:45:21 an-node02 ntpd[2200]: Listening on interface #19 vnet1, fe80::fc54:ff:fe5e:b147#123 Enabled&lt;br /&gt;
Jan  1 19:45:33 an-node02 kernel: vbr2: port 3(vnet1) entering forwarding state&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Confirm with &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-cluster-A @ Sun Jan  1 19:46:17 2012&lt;br /&gt;
Member Status: Quorate&lt;br /&gt;
&lt;br /&gt;
 Member Name                             ID   Status&lt;br /&gt;
 ------ ----                             ---- ------&lt;br /&gt;
 an-node01.alteeve.com                       1 Online, Local, rgmanager&lt;br /&gt;
 an-node02.alteeve.com                       2 Online, rgmanager&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State&lt;br /&gt;
 ------- ----                   ----- ------                   -----&lt;br /&gt;
 service:storage_an01           an-node01.alteeve.com          started&lt;br /&gt;
 service:storage_an02           an-node02.alteeve.com          started&lt;br /&gt;
 vm:vm0001-dev                  an-node01.alteeve.com          started&lt;br /&gt;
 vm:vm0002-web                  an-node01.alteeve.com          started&lt;br /&gt;
 vm:vm0003-db                   an-node02.alteeve.com          started&lt;br /&gt;
 vm:vm0004-ms                   an-node02.alteeve.com          started&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This time, it should recover on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;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 destroy vm0004-ms&lt;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 vm0004-ms destroyed&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Looking in syslog, we can see the counter was tripped.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Jan  1 19:45:33 an-node02 kernel: vbr2: port 3(vnet1) entering forwarding state&lt;br /&gt;
Jan  1 19:46:30 an-node02 kernel: vbr2: port 3(vnet1) entering disabled state&lt;br /&gt;
Jan  1 19:46:30 an-node02 kernel: device vnet1 left promiscuous mode&lt;br /&gt;
Jan  1 19:46:30 an-node02 kernel: vbr2: port 3(vnet1) entering disabled state&lt;br /&gt;
Jan  1 19:46:32 an-node02 ntpd[2200]: Deleting interface #19 vnet1, fe80::fc54:ff:fe5e:b147#123, interface stats: received=0, sent=0, dropped=0, active_time=71 secs&lt;br /&gt;
Jan  1 19:46:36 an-node02 rgmanager[2439]: status on vm &amp;quot;vm0004-ms&amp;quot; returned 7 (unspecified)&lt;br /&gt;
Jan  1 19:46:37 an-node02 rgmanager[2439]: Stopping service vm:vm0004-ms&lt;br /&gt;
Jan  1 19:46:37 an-node02 rgmanager[2439]: Service vm:vm0004-ms is recovering&lt;br /&gt;
Jan  1 19:46:37 an-node02 rgmanager[2439]: Restart threshold for vm:vm0004-ms exceeded; attempting to relocate&lt;br /&gt;
Jan  1 19:46:38 an-node02 rgmanager[2439]: Service vm:vm0004-ms is now running on member 1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Indeed, this is confirmed with &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-cluster-A @ Sun Jan  1 19:48:23 2012&lt;br /&gt;
Member Status: Quorate&lt;br /&gt;
&lt;br /&gt;
 Member Name                             ID   Status&lt;br /&gt;
 ------ ----                             ---- ------&lt;br /&gt;
 an-node01.alteeve.com                       1 Online, Local, rgmanager&lt;br /&gt;
 an-node02.alteeve.com                       2 Online, rgmanager&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State&lt;br /&gt;
 ------- ----                   ----- ------                   -----&lt;br /&gt;
 service:storage_an01           an-node01.alteeve.com          started&lt;br /&gt;
 service:storage_an02           an-node02.alteeve.com          started&lt;br /&gt;
 vm:vm0001-dev                  an-node01.alteeve.com          started&lt;br /&gt;
 vm:vm0002-web                  an-node01.alteeve.com          started&lt;br /&gt;
 vm:vm0003-db                   an-node02.alteeve.com          started&lt;br /&gt;
 vm:vm0004-ms                   an-node01.alteeve.com          started&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Wonderful! All four VMs fail and recover as we expected them to. Move the VM back and we&#039;re ready to crash the nodes!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
clusvcadm -M vm:vm0004-ms -m an-node02.alteeve.com&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Trying to migrate vm:vm0004-ms to an-node02.alteeve.com...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;
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-cluster-A @ Sun Jan  1 19:49:32 2012&lt;br /&gt;
Member Status: Quorate&lt;br /&gt;
&lt;br /&gt;
 Member Name                             ID   Status&lt;br /&gt;
 ------ ----                             ---- ------&lt;br /&gt;
 an-node01.alteeve.com                       1 Online, Local, rgmanager&lt;br /&gt;
 an-node02.alteeve.com                       2 Online, rgmanager&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State&lt;br /&gt;
 ------- ----                   ----- ------                   -----&lt;br /&gt;
 service:storage_an01           an-node01.alteeve.com          started&lt;br /&gt;
 service:storage_an02           an-node02.alteeve.com          started&lt;br /&gt;
 vm:vm0001-dev                  an-node01.alteeve.com          started&lt;br /&gt;
 vm:vm0002-web                  an-node01.alteeve.com          started&lt;br /&gt;
 vm:vm0003-db                   an-node02.alteeve.com          started&lt;br /&gt;
 vm:vm0004-ms                   an-node02.alteeve.com          started&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Done and done!&lt;br /&gt;
&lt;br /&gt;
=== Failing and Recovery of an-node01 ===&lt;br /&gt;
&lt;br /&gt;
The final stage of testing is also the most brutal. We&#039;re going to hang &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt; in such a way that it stops responding to messages from &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt;. Within a few seconds, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt; should be fenced, then shortly after the two lost VMs should boot up on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The is a particularly important test for a somewhat non-obvious reason.&lt;br /&gt;
&lt;br /&gt;
{{note|1=It&#039;s one thing to migrate or boot VMs one at a time. The other VMs will not likely be under load, so the resources of the host should be more or less free for the VM being recovered. After a failure though, all lost VMs will be simultaneously recovered, taxing the host&#039;s resources to a greater extent. This test ensures that each node has sufficient resources to effectively recover the VMs simultaneously.}}&lt;br /&gt;
&lt;br /&gt;
We could just shut off &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;, but we tested this earlier when we setup fencing. What we have not yet tested is how the cluster recovers from a hung node. To hang the host, we&#039;re going to trigger a special event in the kernel, using [http://en.wikipedia.org/wiki/Magic_SysRq_key#Alternate_ways_to_invoke_Magic_SysRq magic SysRq] triggers. We&#039;ll do this by sending the letter &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;c&amp;lt;/span&amp;gt; to the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/proc/sysrq-trigger&amp;lt;/span&amp;gt; file. This will &amp;quot;[http://en.wikipedia.org/wiki/Magic_SysRq_key#Magic_commands Reboot kexec and output a crashdump]&amp;quot;. The node should be [[fenced]] before a memory dump can complete, so don&#039;t expect to see anything in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/var/crashed&amp;lt;/span&amp;gt; unless your system is extremely fast.&lt;br /&gt;
&lt;br /&gt;
{{warning|1=If you are skimming, take note! The next command will crash your node!}}&lt;br /&gt;
&lt;br /&gt;
So, on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;, issue the following command to crash the node.&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;
This command will not return. Watching syslog on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt;, we&#039;ll see output like this;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Jan  1 21:26:00 an-node02 kernel: block drbd1: PingAck did not arrive in time.&lt;br /&gt;
Jan  1 21:26:00 an-node02 kernel: block drbd1: peer( Primary -&amp;gt; Unknown ) conn( Connected -&amp;gt; NetworkFailure ) pdsk( UpToDate -&amp;gt; DUnknown ) susp( 0 -&amp;gt; 1 ) &lt;br /&gt;
Jan  1 21:26:00 an-node02 kernel: block drbd1: asender terminated&lt;br /&gt;
Jan  1 21:26:00 an-node02 kernel: block drbd1: Terminating asender thread&lt;br /&gt;
Jan  1 21:26:00 an-node02 kernel: block drbd1: Connection closed&lt;br /&gt;
Jan  1 21:26:00 an-node02 kernel: block drbd1: conn( NetworkFailure -&amp;gt; Unconnected ) &lt;br /&gt;
Jan  1 21:26:00 an-node02 kernel: block drbd1: helper command: /sbin/drbdadm fence-peer minor-1&lt;br /&gt;
Jan  1 21:26:00 an-node02 kernel: block drbd1: receiver terminated&lt;br /&gt;
Jan  1 21:26:00 an-node02 kernel: block drbd1: Restarting receiver thread&lt;br /&gt;
Jan  1 21:26:00 an-node02 kernel: block drbd1: receiver (re)started&lt;br /&gt;
Jan  1 21:26:00 an-node02 kernel: block drbd1: conn( Unconnected -&amp;gt; WFConnection ) &lt;br /&gt;
Jan  1 21:26:00 an-node02 /sbin/obliterate-peer.sh: Local node ID: 2 / Remote node: an-node01.alteeve.com&lt;br /&gt;
Jan  1 21:26:01 an-node02 kernel: block drbd2: PingAck did not arrive in time.&lt;br /&gt;
Jan  1 21:26:01 an-node02 kernel: block drbd2: peer( Primary -&amp;gt; Unknown ) conn( Connected -&amp;gt; NetworkFailure ) pdsk( UpToDate -&amp;gt; DUnknown ) susp( 0 -&amp;gt; 1 ) &lt;br /&gt;
Jan  1 21:26:01 an-node02 kernel: block drbd2: asender terminated&lt;br /&gt;
Jan  1 21:26:01 an-node02 kernel: block drbd2: Terminating asender thread&lt;br /&gt;
Jan  1 21:26:01 an-node02 kernel: block drbd2: Connection closed&lt;br /&gt;
Jan  1 21:26:01 an-node02 kernel: block drbd2: conn( NetworkFailure -&amp;gt; Unconnected ) &lt;br /&gt;
Jan  1 21:26:01 an-node02 kernel: block drbd2: helper command: /sbin/drbdadm fence-peer minor-2&lt;br /&gt;
Jan  1 21:26:01 an-node02 kernel: block drbd2: receiver terminated&lt;br /&gt;
Jan  1 21:26:01 an-node02 kernel: block drbd2: Restarting receiver thread&lt;br /&gt;
Jan  1 21:26:01 an-node02 kernel: block drbd2: receiver (re)started&lt;br /&gt;
Jan  1 21:26:01 an-node02 kernel: block drbd2: conn( Unconnected -&amp;gt; WFConnection ) &lt;br /&gt;
Jan  1 21:26:01 an-node02 /sbin/obliterate-peer.sh: Local node ID: 2 / Remote node: an-node01.alteeve.com&lt;br /&gt;
Jan  1 21:26:01 an-node02 /sbin/obliterate-peer.sh: kill node failed: Invalid argument&lt;br /&gt;
Jan  1 21:26:03 an-node02 kernel: block drbd0: PingAck did not arrive in time.&lt;br /&gt;
Jan  1 21:26:03 an-node02 kernel: block drbd0: peer( Primary -&amp;gt; Unknown ) conn( Connected -&amp;gt; NetworkFailure ) pdsk( UpToDate -&amp;gt; DUnknown ) susp( 0 -&amp;gt; 1 ) &lt;br /&gt;
Jan  1 21:26:03 an-node02 kernel: block drbd0: asender terminated&lt;br /&gt;
Jan  1 21:26:03 an-node02 kernel: block drbd0: Terminating asender thread&lt;br /&gt;
Jan  1 21:26:03 an-node02 kernel: block drbd0: Connection closed&lt;br /&gt;
Jan  1 21:26:03 an-node02 kernel: block drbd0: conn( NetworkFailure -&amp;gt; Unconnected ) &lt;br /&gt;
Jan  1 21:26:03 an-node02 kernel: block drbd0: helper command: /sbin/drbdadm fence-peer minor-0&lt;br /&gt;
Jan  1 21:26:03 an-node02 kernel: block drbd0: receiver terminated&lt;br /&gt;
Jan  1 21:26:03 an-node02 kernel: block drbd0: Restarting receiver thread&lt;br /&gt;
Jan  1 21:26:03 an-node02 kernel: block drbd0: receiver (re)started&lt;br /&gt;
Jan  1 21:26:03 an-node02 kernel: block drbd0: conn( Unconnected -&amp;gt; WFConnection ) &lt;br /&gt;
Jan  1 21:26:03 an-node02 /sbin/obliterate-peer.sh: Local node ID: 2 / Remote node: an-node01.alteeve.com&lt;br /&gt;
Jan  1 21:26:03 an-node02 /sbin/obliterate-peer.sh: kill node failed: Invalid argument&lt;br /&gt;
Jan  1 21:26:09 an-node02 corosync[1963]:   [TOTEM ] A processor failed, forming new configuration.&lt;br /&gt;
Jan  1 21:26:11 an-node02 corosync[1963]:   [QUORUM] Members[1]: 2&lt;br /&gt;
Jan  1 21:26:11 an-node02 corosync[1963]:   [TOTEM ] A processor joined or left the membership and a new membership was formed.&lt;br /&gt;
Jan  1 21:26:11 an-node02 kernel: dlm: closing connection to node 1&lt;br /&gt;
Jan  1 21:26:11 an-node02 corosync[1963]:   [CPG   ] chosen downlist: sender r(0) ip(10.20.0.2) ; members(old:2 left:1)&lt;br /&gt;
Jan  1 21:26:11 an-node02 corosync[1963]:   [MAIN  ] Completed service synchronization, ready to provide service.&lt;br /&gt;
Jan  1 21:26:11 an-node02 fenced[2022]: fencing node an-node01.alteeve.com&lt;br /&gt;
Jan  1 21:26:11 an-node02 kernel: GFS2: fsid=an-cluster-A:shared.0: jid=1: Trying to acquire journal lock...&lt;br /&gt;
Jan  1 21:26:14 an-node02 fence_node[15572]: fence an-node01.alteeve.com success&lt;br /&gt;
Jan  1 21:26:14 an-node02 kernel: block drbd1: helper command: /sbin/drbdadm fence-peer minor-1 exit code 7 (0x700)&lt;br /&gt;
Jan  1 21:26:14 an-node02 kernel: block drbd1: fence-peer helper returned 7 (peer was stonithed)&lt;br /&gt;
Jan  1 21:26:14 an-node02 kernel: block drbd1: pdsk( DUnknown -&amp;gt; Outdated ) &lt;br /&gt;
Jan  1 21:26:14 an-node02 kernel: block drbd1: new current UUID 6355AAB258658E8F:4642D156D54731A1:5F8A6B05E2FCCE19:165E9B466805EC81&lt;br /&gt;
Jan  1 21:26:14 an-node02 kernel: block drbd1: susp( 1 -&amp;gt; 0 ) &lt;br /&gt;
Jan  1 21:26:15 an-node02 fenced[2022]: fence an-node01.alteeve.com success&lt;br /&gt;
Jan  1 21:26:15 an-node02 fence_node[15672]: fence an-node01.alteeve.com success&lt;br /&gt;
Jan  1 21:26:15 an-node02 kernel: block drbd0: helper command: /sbin/drbdadm fence-peer minor-0 exit code 7 (0x700)&lt;br /&gt;
Jan  1 21:26:15 an-node02 kernel: block drbd0: fence-peer helper returned 7 (peer was stonithed)&lt;br /&gt;
Jan  1 21:26:15 an-node02 kernel: block drbd0: pdsk( DUnknown -&amp;gt; Outdated ) &lt;br /&gt;
Jan  1 21:26:15 an-node02 kernel: block drbd0: new current UUID C1F5EF16EE80E6C1:1B503B46E6650575:234E9A10EE04FDE7:7DBC4288E230DC9B&lt;br /&gt;
Jan  1 21:26:15 an-node02 kernel: block drbd0: susp( 1 -&amp;gt; 0 ) &lt;br /&gt;
Jan  1 21:26:15 an-node02 fence_node[15627]: fence an-node01.alteeve.com success&lt;br /&gt;
Jan  1 21:26:15 an-node02 kernel: block drbd2: helper command: /sbin/drbdadm fence-peer minor-2 exit code 7 (0x700)&lt;br /&gt;
Jan  1 21:26:15 an-node02 kernel: block drbd2: fence-peer helper returned 7 (peer was stonithed)&lt;br /&gt;
Jan  1 21:26:15 an-node02 kernel: block drbd2: pdsk( DUnknown -&amp;gt; Outdated ) &lt;br /&gt;
Jan  1 21:26:15 an-node02 kernel: block drbd2: new current UUID 1F79DE480F1E33C1:A674C3CB12017193:76118DDAE165C5FB:871F8081B7D527A9&lt;br /&gt;
Jan  1 21:26:15 an-node02 kernel: block drbd2: susp( 1 -&amp;gt; 0 ) &lt;br /&gt;
Jan  1 21:26:16 an-node02 kernel: GFS2: fsid=an-cluster-A:shared.0: jid=1: Looking at journal...&lt;br /&gt;
Jan  1 21:26:16 an-node02 kernel: GFS2: fsid=an-cluster-A:shared.0: jid=1: Done&lt;br /&gt;
Jan  1 21:26:16 an-node02 rgmanager[2514]: Marking service:storage_an01 as stopped: Restricted domain unavailable&lt;br /&gt;
Jan  1 21:26:16 an-node02 rgmanager[2514]: Taking over service vm:vm0001-dev from down member an-node01.alteeve.com&lt;br /&gt;
Jan  1 21:26:16 an-node02 rgmanager[2514]: Taking over service vm:vm0002-web from down member an-node01.alteeve.com&lt;br /&gt;
Jan  1 21:26:17 an-node02 kernel: device vnet2 entered promiscuous mode&lt;br /&gt;
Jan  1 21:26:17 an-node02 kernel: vbr2: port 4(vnet2) entering learning state&lt;br /&gt;
Jan  1 21:26:17 an-node02 rgmanager[2514]: Service vm:vm0001-dev started&lt;br /&gt;
Jan  1 21:26:17 an-node02 kernel: device vnet3 entered promiscuous mode&lt;br /&gt;
Jan  1 21:26:17 an-node02 kernel: vbr2: port 5(vnet3) entering learning state&lt;br /&gt;
Jan  1 21:26:18 an-node02 rgmanager[2514]: Service vm:vm0002-web started&lt;br /&gt;
Jan  1 21:26:20 an-node02 ntpd[2275]: Listening on interface #12 vnet2, fe80::fc54:ff:fe9b:3cf7#123 Enabled&lt;br /&gt;
Jan  1 21:26:20 an-node02 ntpd[2275]: Listening on interface #13 vnet3, fe80::fc54:ff:fe65:3960#123 Enabled&lt;br /&gt;
Jan  1 21:26:27 an-node02 kernel: kvm: 16177: cpu0 unimplemented perfctr wrmsr: 0xc1 data 0xabcd&lt;br /&gt;
Jan  1 21:26:29 an-node02 kernel: kvm: 16118: cpu0 unimplemented perfctr wrmsr: 0xc1 data 0xabcd&lt;br /&gt;
Jan  1 21:26:32 an-node02 kernel: vbr2: port 4(vnet2) entering forwarding state&lt;br /&gt;
Jan  1 21:26:32 an-node02 kernel: vbr2: port 5(vnet3) entering forwarding state&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checking with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;clustat&amp;lt;/span&amp;gt;, we can confirm that all four VMs are now running on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;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-cluster-A @ Sun Jan  1 21:28:00 2012&lt;br /&gt;
Member Status: Quorate&lt;br /&gt;
&lt;br /&gt;
 Member Name                             ID   Status&lt;br /&gt;
 ------ ----                             ---- ------&lt;br /&gt;
 an-node01.alteeve.com                       1 Online, rgmanager&lt;br /&gt;
 an-node02.alteeve.com                       2 Online, Local, rgmanager&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State&lt;br /&gt;
 ------- ----                   ----- ------                   -----&lt;br /&gt;
 service:storage_an01           an-node01.alteeve.com          started&lt;br /&gt;
 service:storage_an02           an-node02.alteeve.com          started&lt;br /&gt;
 vm:vm0001-dev                  an-node02.alteeve.com          started&lt;br /&gt;
 vm:vm0002-web                  an-node02.alteeve.com          started&lt;br /&gt;
 vm:vm0003-db                   an-node02.alteeve.com          started&lt;br /&gt;
 vm:vm0004-ms                   an-node02.alteeve.com          started&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Perfect! This is exactly why we built the cluster!&lt;br /&gt;
&lt;br /&gt;
If we wait a few minutes, we&#039;ll see that the hung node has recovered.&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-cluster-A @ Sun Jan  1 22:30:04 2012&lt;br /&gt;
Member Status: Quorate&lt;br /&gt;
&lt;br /&gt;
 Member Name                             ID   Status&lt;br /&gt;
 ------ ----                             ---- ------&lt;br /&gt;
 an-node01.alteeve.com                       1 Online, rgmanager&lt;br /&gt;
 an-node02.alteeve.com                       2 Online, Local, rgmanager&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State         &lt;br /&gt;
 ------- ----                   ----- ------                   -----         &lt;br /&gt;
 service:storage_an01           an-node01.alteeve.com          started       &lt;br /&gt;
 service:storage_an02           an-node02.alteeve.com          started       &lt;br /&gt;
 vm:vm0001-dev                  an-node02.alteeve.com          started       &lt;br /&gt;
 vm:vm0002-web                  an-node02.alteeve.com          started       &lt;br /&gt;
 vm:vm0003-db                   an-node02.alteeve.com          started       &lt;br /&gt;
 vm:vm0004-ms                   an-node02.alteeve.com          started       &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Before we can push the VMs back though, we must make sure that the underlying DRBD resource has finished synchronizing.&lt;br /&gt;
&lt;br /&gt;
{{note|1=With four VMs, it will most certainly take time for underlying resource to resync. Do not migrate the VMs until this has completed!}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
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;
version: 8.3.12 (api:88/proto:86-96)&lt;br /&gt;
GIT-hash: e2a8ef4656be026bbae540305fcb998a5991090f build by dag@Build64R6, 2011-11-20 10:57:03&lt;br /&gt;
 0: cs:Connected ro:Primary/Primary ds:UpToDate/UpToDate C r-----&lt;br /&gt;
    ns:1182704 nr:1053880 dw:1052676 dr:1245848 al:0 bm:266 lo:0 pe:0 ua:0 ap:0 ep:1 wo:f oos:0&lt;br /&gt;
 1: cs:Connected ro:Primary/Primary ds:UpToDate/UpToDate C r-----&lt;br /&gt;
    ns:2087568 nr:362698 dw:366444 dr:2263316 al:9 bm:411 lo:0 pe:0 ua:0 ap:0 ep:1 wo:f oos:0&lt;br /&gt;
 2: cs:Connected ro:Primary/Primary ds:UpToDate/UpToDate C r-----&lt;br /&gt;
    ns:2098343 nr:1114307 dw:1065375 dr:2340421 al:10 bm:551 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;
We&#039;re ready, so lets migrate back &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0001-dev&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0002-web&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
clusvcadm -M vm:vm0001-dev -m an-node01.alteeve.com&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Trying to migrate vm:vm0001-dev to an-node01.alteeve.com...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 -M vm:vm0002-web -m an-node01.alteeve.com&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Trying to migrate vm:vm0002-web to an-node01.alteeve.com...Success&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Confirm;&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-cluster-A @ Sun Jan  1 22:37:10 2012&lt;br /&gt;
Member Status: Quorate&lt;br /&gt;
&lt;br /&gt;
 Member Name                             ID   Status&lt;br /&gt;
 ------ ----                             ---- ------&lt;br /&gt;
 an-node01.alteeve.com                       1 Online, Local, rgmanager&lt;br /&gt;
 an-node02.alteeve.com                       2 Online, rgmanager&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State&lt;br /&gt;
 ------- ----                   ----- ------                   -----&lt;br /&gt;
 service:storage_an01           an-node01.alteeve.com          started&lt;br /&gt;
 service:storage_an02           an-node02.alteeve.com          started&lt;br /&gt;
 vm:vm0001-dev                  an-node01.alteeve.com          started&lt;br /&gt;
 vm:vm0002-web                  an-node01.alteeve.com          started&lt;br /&gt;
 vm:vm0003-db                   an-node02.alteeve.com          started&lt;br /&gt;
 vm:vm0004-ms                   an-node02.alteeve.com          started&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There we have it. Successful crash and recovery of &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==== Discussing the syslog Messages ====&lt;br /&gt;
&lt;br /&gt;
Let&#039;s step back and look at the syslog output; There are a few things to discuss.&lt;br /&gt;
&lt;br /&gt;
The first thing we see is that almost immediately after hanging &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;, the first messages are from DRBD, not the cluster. This in turn trigger&#039;s DRBD&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fence-handler&amp;lt;/span&amp;gt; script, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;obliterate-peer.sh&amp;lt;/span&amp;gt;. This is because DRBD is extremely sensitive to interruptions, even more so than the cluster itself. You will notice that DRBD reacted a full 9 seconds faster than the cluster.&lt;br /&gt;
&lt;br /&gt;
The first thing the cluster does, upon realizing it has lost communication with its peer, is call a fence against the lost node. As mentioned, this involves calling &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;obliterate-peer.sh&amp;lt;/span&amp;gt;, which is itself a very simple wrapper for &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;cman_tool&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fence_node&amp;lt;/span&amp;gt; shell calls.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Jan  1 21:26:00 an-node02 kernel: block drbd1: helper command: /sbin/drbdadm fence-peer minor-1&lt;br /&gt;
Jan  1 21:26:00 an-node02 kernel: block drbd1: receiver terminated&lt;br /&gt;
Jan  1 21:26:00 an-node02 kernel: block drbd1: Restarting receiver thread&lt;br /&gt;
Jan  1 21:26:00 an-node02 kernel: block drbd1: receiver (re)started&lt;br /&gt;
Jan  1 21:26:00 an-node02 kernel: block drbd1: conn( Unconnected -&amp;gt; WFConnection ) &lt;br /&gt;
Jan  1 21:26:00 an-node02 /sbin/obliterate-peer.sh: Local node ID: 2 / Remote node: an-node01.alteeve.com&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here we see DRBD calling the handler (first message), shortly after we see a log entry from &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;obliterate-peer.sh&amp;lt;/span&amp;gt; (last entry). What you don&#039;t see is that right after that last message, &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;obliterate-peer.sh&amp;lt;/span&amp;gt; goes into a 10-iteration loop where it calls &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fence_node&amp;lt;/span&amp;gt; against its peer.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Jan  1 21:26:01 an-node02 /sbin/obliterate-peer.sh: Local node ID: 2 / Remote node: an-node01.alteeve.com&lt;br /&gt;
Jan  1 21:26:01 an-node02 /sbin/obliterate-peer.sh: kill node failed: Invalid argument&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;fence_node&amp;lt;/span&amp;gt; call runs in the background, so the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;obliterate-peer.sh&amp;lt;/span&amp;gt; script goes into a short sleep before trying again (and again...). These subsequent calls will generate the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;kill node failed: Invalid argument&amp;lt;/span&amp;gt; because the first call is already in the process of fencing the node, and are thus safe to ignore. The important past was that this error message &#039;&#039;&#039;didn&#039;t&#039;&#039;&#039; follow the first entry.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Jan  1 21:26:15 an-node02 fenced[2022]: fence an-node01.alteeve.com success&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is what matters. Here we see that the fence succeeded and the hung node was indeed fenced.&lt;br /&gt;
&lt;br /&gt;
=== Failing and Recovery of an-node02 ===&lt;br /&gt;
&lt;br /&gt;
With everything back in place, we&#039;ll hang &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt; and ensure that its VMs will recover on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
As always, check the current state.&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-cluster-A @ Sun Jan  1 22:53:43 2012&lt;br /&gt;
Member Status: Quorate&lt;br /&gt;
&lt;br /&gt;
 Member Name                             ID   Status&lt;br /&gt;
 ------ ----                             ---- ------&lt;br /&gt;
 an-node01.alteeve.com                       1 Online, Local, rgmanager&lt;br /&gt;
 an-node02.alteeve.com                       2 Online, rgmanager&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State&lt;br /&gt;
 ------- ----                   ----- ------                   -----&lt;br /&gt;
 service:storage_an01           an-node01.alteeve.com          started&lt;br /&gt;
 service:storage_an02           an-node02.alteeve.com          started&lt;br /&gt;
 vm:vm0001-dev                  an-node01.alteeve.com          started&lt;br /&gt;
 vm:vm0002-web                  an-node01.alteeve.com          started&lt;br /&gt;
 vm:vm0003-db                   an-node02.alteeve.com          started&lt;br /&gt;
 vm:vm0004-ms                   an-node02.alteeve.com          started&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now hang &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;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 c &amp;gt; /proc/sysrq-trigger&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As before, that command will not return. If we check &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;&#039;s syslog though, we should see that the node is fenced and the lost VMs are recovered.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Jan  1 22:56:14 an-node01 kernel: block drbd1: PingAck did not arrive in time.&lt;br /&gt;
Jan  1 22:56:14 an-node01 kernel: block drbd1: peer( Primary -&amp;gt; Unknown ) conn( Connected -&amp;gt; NetworkFailure ) pdsk( UpToDate -&amp;gt; DUnknown ) susp( 0 -&amp;gt; 1 ) &lt;br /&gt;
Jan  1 22:56:15 an-node01 kernel: block drbd1: asender terminated&lt;br /&gt;
Jan  1 22:56:15 an-node01 kernel: block drbd1: Terminating asender thread&lt;br /&gt;
Jan  1 22:56:15 an-node01 kernel: block drbd1: Connection closed&lt;br /&gt;
Jan  1 22:56:15 an-node01 kernel: block drbd1: conn( NetworkFailure -&amp;gt; Unconnected ) &lt;br /&gt;
Jan  1 22:56:15 an-node01 kernel: block drbd1: helper command: /sbin/drbdadm fence-peer minor-1&lt;br /&gt;
Jan  1 22:56:15 an-node01 kernel: block drbd1: receiver terminated&lt;br /&gt;
Jan  1 22:56:15 an-node01 kernel: block drbd1: Restarting receiver thread&lt;br /&gt;
Jan  1 22:56:15 an-node01 kernel: block drbd1: receiver (re)started&lt;br /&gt;
Jan  1 22:56:15 an-node01 kernel: block drbd1: conn( Unconnected -&amp;gt; WFConnection ) &lt;br /&gt;
Jan  1 22:56:15 an-node01 /sbin/obliterate-peer.sh: Local node ID: 1 / Remote node: an-node02.alteeve.com&lt;br /&gt;
Jan  1 22:56:19 an-node01 kernel: block drbd0: PingAck did not arrive in time.&lt;br /&gt;
Jan  1 22:56:19 an-node01 kernel: block drbd0: peer( Primary -&amp;gt; Unknown ) conn( Connected -&amp;gt; NetworkFailure ) pdsk( UpToDate -&amp;gt; DUnknown ) susp( 0 -&amp;gt; 1 ) &lt;br /&gt;
Jan  1 22:56:19 an-node01 kernel: block drbd0: asender terminated&lt;br /&gt;
Jan  1 22:56:19 an-node01 kernel: block drbd0: Terminating asender thread&lt;br /&gt;
Jan  1 22:56:19 an-node01 kernel: block drbd0: Connection closed&lt;br /&gt;
Jan  1 22:56:19 an-node01 kernel: block drbd0: conn( NetworkFailure -&amp;gt; Unconnected ) &lt;br /&gt;
Jan  1 22:56:19 an-node01 kernel: block drbd0: helper command: /sbin/drbdadm fence-peer minor-0&lt;br /&gt;
Jan  1 22:56:19 an-node01 kernel: block drbd0: receiver terminated&lt;br /&gt;
Jan  1 22:56:19 an-node01 kernel: block drbd0: Restarting receiver thread&lt;br /&gt;
Jan  1 22:56:19 an-node01 kernel: block drbd0: receiver (re)started&lt;br /&gt;
Jan  1 22:56:19 an-node01 kernel: block drbd0: conn( Unconnected -&amp;gt; WFConnection ) &lt;br /&gt;
Jan  1 22:56:19 an-node01 /sbin/obliterate-peer.sh: Local node ID: 1 / Remote node: an-node02.alteeve.com&lt;br /&gt;
Jan  1 22:56:19 an-node01 /sbin/obliterate-peer.sh: kill node failed: Invalid argument&lt;br /&gt;
Jan  1 22:56:21 an-node01 kernel: block drbd2: PingAck did not arrive in time.&lt;br /&gt;
Jan  1 22:56:21 an-node01 kernel: block drbd2: peer( Primary -&amp;gt; Unknown ) conn( Connected -&amp;gt; NetworkFailure ) pdsk( UpToDate -&amp;gt; DUnknown ) susp( 0 -&amp;gt; 1 ) &lt;br /&gt;
Jan  1 22:56:21 an-node01 kernel: block drbd2: asender terminated&lt;br /&gt;
Jan  1 22:56:21 an-node01 kernel: block drbd2: Terminating asender thread&lt;br /&gt;
Jan  1 22:56:21 an-node01 kernel: block drbd2: Connection closed&lt;br /&gt;
Jan  1 22:56:21 an-node01 kernel: block drbd2: conn( NetworkFailure -&amp;gt; Unconnected ) &lt;br /&gt;
Jan  1 22:56:21 an-node01 kernel: block drbd2: receiver terminated&lt;br /&gt;
Jan  1 22:56:21 an-node01 kernel: block drbd2: Restarting receiver thread&lt;br /&gt;
Jan  1 22:56:21 an-node01 kernel: block drbd2: receiver (re)started&lt;br /&gt;
Jan  1 22:56:21 an-node01 kernel: block drbd2: conn( Unconnected -&amp;gt; WFConnection ) &lt;br /&gt;
Jan  1 22:56:21 an-node01 kernel: block drbd2: helper command: /sbin/drbdadm fence-peer minor-2&lt;br /&gt;
Jan  1 22:56:21 an-node01 /sbin/obliterate-peer.sh: Local node ID: 1 / Remote node: an-node02.alteeve.com&lt;br /&gt;
Jan  1 22:56:21 an-node01 /sbin/obliterate-peer.sh: kill node failed: Invalid argument&lt;br /&gt;
Jan  1 22:56:22 an-node01 corosync[1958]:   [TOTEM ] A processor failed, forming new configuration.&lt;br /&gt;
Jan  1 22:56:24 an-node01 corosync[1958]:   [QUORUM] Members[1]: 1&lt;br /&gt;
Jan  1 22:56:24 an-node01 corosync[1958]:   [TOTEM ] A processor joined or left the membership and a new membership was formed.&lt;br /&gt;
Jan  1 22:56:24 an-node01 kernel: dlm: closing connection to node 2&lt;br /&gt;
Jan  1 22:56:24 an-node01 corosync[1958]:   [CPG   ] chosen downlist: sender r(0) ip(10.20.0.1) ; members(old:2 left:1)&lt;br /&gt;
Jan  1 22:56:24 an-node01 corosync[1958]:   [MAIN  ] Completed service synchronization, ready to provide service.&lt;br /&gt;
Jan  1 22:56:24 an-node01 fenced[2014]: fencing node an-node02.alteeve.com&lt;br /&gt;
Jan  1 22:56:24 an-node01 kernel: GFS2: fsid=an-cluster-A:shared.1: jid=0: Trying to acquire journal lock...&lt;br /&gt;
Jan  1 22:56:28 an-node01 fenced[2014]: fence an-node02.alteeve.com success&lt;br /&gt;
Jan  1 22:56:29 an-node01 fence_node[638]: fence an-node02.alteeve.com success&lt;br /&gt;
Jan  1 22:56:29 an-node01 kernel: block drbd2: helper command: /sbin/drbdadm fence-peer minor-2 exit code 7 (0x700)&lt;br /&gt;
Jan  1 22:56:29 an-node01 kernel: block drbd2: fence-peer helper returned 7 (peer was stonithed)&lt;br /&gt;
Jan  1 22:56:29 an-node01 kernel: block drbd2: pdsk( DUnknown -&amp;gt; Outdated ) &lt;br /&gt;
Jan  1 22:56:29 an-node01 kernel: block drbd2: new current UUID 207F7C9279067EC1:3EEB0F756A6A289F:FD92DAC355F53A93:FD91DAC355F53A93&lt;br /&gt;
Jan  1 22:56:29 an-node01 kernel: block drbd2: susp( 1 -&amp;gt; 0 ) &lt;br /&gt;
Jan  1 22:56:29 an-node01 fence_node[518]: fence an-node02.alteeve.com success&lt;br /&gt;
Jan  1 22:56:29 an-node01 kernel: block drbd1: helper command: /sbin/drbdadm fence-peer minor-1 exit code 7 (0x700)&lt;br /&gt;
Jan  1 22:56:29 an-node01 kernel: block drbd1: fence-peer helper returned 7 (peer was stonithed)&lt;br /&gt;
Jan  1 22:56:29 an-node01 kernel: block drbd1: pdsk( DUnknown -&amp;gt; Outdated ) &lt;br /&gt;
Jan  1 22:56:29 an-node01 kernel: block drbd1: new current UUID C65C044AE682D8C5:67D512BD61B70265:C1947DF86E910F8B:C1937DF86E910F8B&lt;br /&gt;
Jan  1 22:56:29 an-node01 kernel: block drbd1: susp( 1 -&amp;gt; 0 ) &lt;br /&gt;
Jan  1 22:56:29 an-node01 rgmanager[2507]: Marking service:storage_an02 as stopped: Restricted domain unavailable&lt;br /&gt;
Jan  1 22:56:29 an-node01 fence_node[583]: fence an-node02.alteeve.com success&lt;br /&gt;
Jan  1 22:56:29 an-node01 kernel: block drbd0: helper command: /sbin/drbdadm fence-peer minor-0 exit code 7 (0x700)&lt;br /&gt;
Jan  1 22:56:29 an-node01 kernel: block drbd0: fence-peer helper returned 7 (peer was stonithed)&lt;br /&gt;
Jan  1 22:56:29 an-node01 kernel: block drbd0: pdsk( DUnknown -&amp;gt; Outdated ) &lt;br /&gt;
Jan  1 22:56:29 an-node01 kernel: block drbd0: new current UUID 295A00166167B5C3:A3F3889ECF7247F5:30313B4AFFF6F82B:30303B4AFFF6F82B&lt;br /&gt;
Jan  1 22:56:29 an-node01 kernel: block drbd0: susp( 1 -&amp;gt; 0 ) &lt;br /&gt;
Jan  1 22:56:29 an-node01 kernel: GFS2: fsid=an-cluster-A:shared.1: jid=0: Looking at journal...&lt;br /&gt;
Jan  1 22:56:30 an-node01 kernel: GFS2: fsid=an-cluster-A:shared.1: jid=0: Done&lt;br /&gt;
Jan  1 22:56:30 an-node01 rgmanager[2507]: Taking over service vm:vm0003-db from down member an-node02.alteeve.com&lt;br /&gt;
Jan  1 22:56:30 an-node01 rgmanager[2507]: Taking over service vm:vm0004-ms from down member an-node02.alteeve.com&lt;br /&gt;
Jan  1 22:56:30 an-node01 kernel: device vnet2 entered promiscuous mode&lt;br /&gt;
Jan  1 22:56:30 an-node01 kernel: vbr2: port 4(vnet2) entering learning state&lt;br /&gt;
Jan  1 22:56:30 an-node01 rgmanager[2507]: Service vm:vm0003-db started&lt;br /&gt;
Jan  1 22:56:31 an-node01 kernel: device vnet3 entered promiscuous mode&lt;br /&gt;
Jan  1 22:56:31 an-node01 kernel: vbr2: port 5(vnet3) entering learning state&lt;br /&gt;
Jan  1 22:56:31 an-node01 rgmanager[2507]: Service vm:vm0004-ms started&lt;br /&gt;
Jan  1 22:56:34 an-node01 ntpd[2267]: Listening on interface #12 vnet3, fe80::fc54:ff:fe5e:b147#123 Enabled&lt;br /&gt;
Jan  1 22:56:34 an-node01 ntpd[2267]: Listening on interface #13 vnet2, fe80::fc54:ff:fe44:83ec#123 Enabled&lt;br /&gt;
Jan  1 22:56:40 an-node01 kernel: kvm: 1074: cpu0 unimplemented perfctr wrmsr: 0xc1 data 0xabcd&lt;br /&gt;
Jan  1 22:56:45 an-node01 kernel: vbr2: port 4(vnet2) entering forwarding state&lt;br /&gt;
Jan  1 22:56:46 an-node01 kernel: vbr2: port 5(vnet3) entering forwarding state&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checking &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-cluster-A @ Sun Jan  1 22:57:36 2012&lt;br /&gt;
Member Status: Quorate&lt;br /&gt;
&lt;br /&gt;
 Member Name                             ID   Status&lt;br /&gt;
 ------ ----                             ---- ------&lt;br /&gt;
 an-node01.alteeve.com                       1 Online, Local, rgmanager&lt;br /&gt;
 an-node02.alteeve.com                       2 Offline&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State&lt;br /&gt;
 ------- ----                   ----- ------                   -----&lt;br /&gt;
 service:storage_an01           an-node01.alteeve.com          started&lt;br /&gt;
 service:storage_an02           (an-node02.alteeve.com)        stopped&lt;br /&gt;
 vm:vm0001-dev                  an-node01.alteeve.com          started&lt;br /&gt;
 vm:vm0002-web                  an-node01.alteeve.com          started&lt;br /&gt;
 vm:vm0003-db                   an-node01.alteeve.com          started&lt;br /&gt;
 vm:vm0004-ms                   an-node01.alteeve.com          started&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
All four VMs are back up and running on &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;lt;/span&amp;gt;!&lt;br /&gt;
&lt;br /&gt;
Within a few moments, we should see see that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt; has rejoined the cluster.&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-cluster-A @ Sun Jan  1 23:00:43 2012&lt;br /&gt;
Member Status: Quorate&lt;br /&gt;
&lt;br /&gt;
 Member Name                             ID   Status&lt;br /&gt;
 ------ ----                             ---- ------&lt;br /&gt;
 an-node01.alteeve.com                       1 Online, Local, rgmanager&lt;br /&gt;
 an-node02.alteeve.com                       2 Online, rgmanager&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State&lt;br /&gt;
 ------- ----                   ----- ------                   -----&lt;br /&gt;
 service:storage_an01           an-node01.alteeve.com          started&lt;br /&gt;
 service:storage_an02           an-node02.alteeve.com          started&lt;br /&gt;
 vm:vm0001-dev                  an-node01.alteeve.com          started&lt;br /&gt;
 vm:vm0002-web                  an-node01.alteeve.com          started&lt;br /&gt;
 vm:vm0003-db                   an-node01.alteeve.com          started&lt;br /&gt;
 vm:vm0004-ms                   an-node01.alteeve.com          started&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we&#039;ll wait for the backing DRBD resources to be in sync.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
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;
GIT-hash: e2a8ef4656be026bbae540305fcb998a5991090f build by dag@Build64R6, 2011-11-20 10:57:03&lt;br /&gt;
 0: cs:SyncTarget ro:Primary/Primary ds:Inconsistent/UpToDate C r-----&lt;br /&gt;
    ns:0 nr:272884 dw:271744 dr:5700 al:0 bm:25 lo:0 pe:0 ua:0 ap:0 ep:1 wo:b oos:780928&lt;br /&gt;
	[====&amp;gt;...............] sync&#039;ed: 26.4% (780928/1052672)K&lt;br /&gt;
	finish: 0:10:02 speed: 1,284 (1,280) want: 250 K/sec&lt;br /&gt;
 1: cs:SyncTarget ro:Primary/Primary ds:Inconsistent/UpToDate C r-----&lt;br /&gt;
    ns:0 nr:272196 dw:271048 dr:3688 al:0 bm:45 lo:0 pe:0 ua:0 ap:0 ep:1 wo:f oos:122292&lt;br /&gt;
	[=============&amp;gt;......] sync&#039;ed: 70.2% (122292/393216)K&lt;br /&gt;
	finish: 0:01:31 speed: 1,328 (1,276) want: 250 K/sec&lt;br /&gt;
 2: cs:SyncTarget ro:Primary/Primary ds:Inconsistent/UpToDate C r-----&lt;br /&gt;
    ns:0 nr:273426 dw:272258 dr:3636 al:0 bm:47 lo:0 pe:0 ua:0 ap:0 ep:1 wo:f oos:781500&lt;br /&gt;
	[====&amp;gt;...............] sync&#039;ed: 26.4% (781500/1052760)K&lt;br /&gt;
	finish: 0:09:49 speed: 1,308 (1,284) want: 250 K/sec&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(time passes)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
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;
version: 8.3.12 (api:88/proto:86-96)&lt;br /&gt;
GIT-hash: e2a8ef4656be026bbae540305fcb998a5991090f build by dag@Build64R6, 2011-11-20 10:57:03&lt;br /&gt;
 0: cs:Connected ro:Primary/Primary ds:UpToDate/UpToDate C r-----&lt;br /&gt;
    ns:0 nr:1053812 dw:1052672 dr:6964 al:0 bm:74 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:0 nr:394560 dw:393412 dr:4988 al:0 bm:70 lo:0 pe:0 ua:0 ap:0 ep:1 wo:f oos:0&lt;br /&gt;
 2: cs:Connected ro:Primary/Primary ds:UpToDate/UpToDate C r-----&lt;br /&gt;
    ns:0 nr:1055190 dw:1054022 dr:4936 al:0 bm:167 lo:0 pe:0 ua:0 ap:0 ep:1 wo:f oos:0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we&#039;re ready to migrate &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0003-db&amp;lt;/span&amp;gt; and &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;vm0004-ms&amp;lt;/span&amp;gt; back to &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
clusvcadm -M vm:vm0003-db -m an-node02.alteeve.com&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Trying to migrate vm:vm0003-db to an-node02.alteeve.com...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 -M vm:vm0004-ms -m an-node02.alteeve.com&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Trying to migrate vm:vm0004-ms to an-node02.alteeve.com...Success&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A final check;&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-cluster-A @ Sun Jan  1 23:08:06 2012&lt;br /&gt;
Member Status: Quorate&lt;br /&gt;
&lt;br /&gt;
 Member Name                             ID   Status&lt;br /&gt;
 ------ ----                             ---- ------&lt;br /&gt;
 an-node01.alteeve.com                       1 Online, Local, rgmanager&lt;br /&gt;
 an-node02.alteeve.com                       2 Online, rgmanager&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State&lt;br /&gt;
 ------- ----                   ----- ------                   -----&lt;br /&gt;
 service:storage_an01           an-node01.alteeve.com          started&lt;br /&gt;
 service:storage_an02           an-node02.alteeve.com          started&lt;br /&gt;
 vm:vm0001-dev                  an-node01.alteeve.com          started&lt;br /&gt;
 vm:vm0002-web                  an-node01.alteeve.com          started&lt;br /&gt;
 vm:vm0003-db                   an-node02.alteeve.com          started&lt;br /&gt;
 vm:vm0004-ms                   an-node02.alteeve.com          started&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Good!&lt;br /&gt;
&lt;br /&gt;
== Complete Cold Shut Down And Cold Starting The Cluster ==&lt;br /&gt;
&lt;br /&gt;
The final testing is now complete. There is one final task to cover though; &amp;quot;Cold Shut Down&amp;quot; and &amp;quot;Cold Start&amp;quot; of the cluster. This involves shutting down all VMs, stopping &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;cman&amp;lt;/span&amp;gt; on both nodes, then powering off both nodes. &lt;br /&gt;
&lt;br /&gt;
The cold-start process involves simply powering both nodes on within the set &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;post_join_delay&amp;lt;/span&amp;gt;, then manually enabling the four VMs.&lt;br /&gt;
&lt;br /&gt;
=== Stopping All VMs ===&lt;br /&gt;
&lt;br /&gt;
Check the status as always;&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-cluster-A @ Sun Jan  1 23:13:24 2012&lt;br /&gt;
Member Status: Quorate&lt;br /&gt;
&lt;br /&gt;
 Member Name                             ID   Status&lt;br /&gt;
 ------ ----                             ---- ------&lt;br /&gt;
 an-node01.alteeve.com                       1 Online, Local, rgmanager&lt;br /&gt;
 an-node02.alteeve.com                       2 Online, rgmanager&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State&lt;br /&gt;
 ------- ----                   ----- ------                   -----&lt;br /&gt;
 service:storage_an01           an-node01.alteeve.com          started&lt;br /&gt;
 service:storage_an02           an-node02.alteeve.com          started&lt;br /&gt;
 vm:vm0001-dev                  an-node01.alteeve.com          started&lt;br /&gt;
 vm:vm0002-web                  an-node01.alteeve.com          started&lt;br /&gt;
 vm:vm0003-db                   an-node02.alteeve.com          started&lt;br /&gt;
 vm:vm0004-ms                   an-node02.alteeve.com          started&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
All four VMs are up, so we&#039;ll stop all of them.&lt;br /&gt;
&lt;br /&gt;
{{note|1=You might want to get into the habit of stopping the windows machines, then connecting to them over [[RDP]] or using &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virt-manager&amp;lt;/span&amp;gt; to ensure that it has started to power down. If it hasn&#039;t, shut it down from within the OS.}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
clusvcadm -d vm:vm0001-dev&lt;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-dev...Success&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 vm:vm0002-web&lt;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-web...Success&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 vm:vm0003-db&lt;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:vm0003-db...Success&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 vm:vm0004-ms&lt;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:vm0004-ms...Success&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Confirm;&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-cluster-A @ Sun Jan  1 23:17:29 2012&lt;br /&gt;
Member Status: Quorate&lt;br /&gt;
&lt;br /&gt;
 Member Name                             ID   Status&lt;br /&gt;
 ------ ----                             ---- ------&lt;br /&gt;
 an-node01.alteeve.com                       1 Online, Local, rgmanager&lt;br /&gt;
 an-node02.alteeve.com                       2 Online, rgmanager&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State&lt;br /&gt;
 ------- ----                   ----- ------                   -----&lt;br /&gt;
 service:storage_an01           an-node01.alteeve.com          started&lt;br /&gt;
 service:storage_an02           an-node02.alteeve.com          started&lt;br /&gt;
 vm:vm0001-dev                  (an-node01.alteeve.com)        disabled&lt;br /&gt;
 vm:vm0002-web                  (an-node01.alteeve.com)        disabled&lt;br /&gt;
 vm:vm0003-db                   (an-node02.alteeve.com)        disabled&lt;br /&gt;
 vm:vm0004-ms                   (an-node02.alteeve.com)        disabled&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Good, we can now stop &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;
=== Shutting Down The Cluster Entirely ===&lt;br /&gt;
&lt;br /&gt;
{{note|1=It can sometimes take a minute or two for &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;rgmanager&amp;lt;/span&amp;gt; to stop. Please be patient.}}&lt;br /&gt;
&lt;br /&gt;
On &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;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 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 Service Manager:                          [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;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 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 Service Manager:                          [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now stop &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 &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node01&amp;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;
   Leaving fence domain...                                 [  OK  ]&lt;br /&gt;
   Stopping gfs_controld...                                [  OK  ]&lt;br /&gt;
   Stopping dlm_controld...                                [  OK  ]&lt;br /&gt;
   Stopping fenced...                                      [  OK  ]&lt;br /&gt;
   Stopping cman...                                        [  OK  ]&lt;br /&gt;
   Waiting for corosync to shutdown:                       [  OK  ]&lt;br /&gt;
   Unloading kernel modules...                             [  OK  ]&lt;br /&gt;
   Unmounting configfs...                                  [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;an-node02&amp;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;
   Leaving fence domain...                                 [  OK  ]&lt;br /&gt;
   Stopping gfs_controld...                                [  OK  ]&lt;br /&gt;
   Stopping dlm_controld...                                [  OK  ]&lt;br /&gt;
   Stopping fenced...                                      [  OK  ]&lt;br /&gt;
   Stopping cman...                                        [  OK  ]&lt;br /&gt;
   Waiting for corosync to shutdown:                       [  OK  ]&lt;br /&gt;
   Unloading kernel modules...                             [  OK  ]&lt;br /&gt;
   Unmounting configfs...                                  [  OK  ]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We&#039;re down, we can safely power off the nodes now.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
poweroff&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Broadcast message from root@an-node01.alteeve.com&lt;br /&gt;
	(/dev/pts/0) at 23:22 ...&lt;br /&gt;
&lt;br /&gt;
The system is going down for power off NOW!&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Cold-Stop achieved!&lt;br /&gt;
&lt;br /&gt;
=== Cold-Starting The Cluster ===&lt;br /&gt;
&lt;br /&gt;
{{note|1=It is important to power on both nodes within &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;post_join_delay&amp;lt;/span&amp;gt; seconds. Otherwise, the slower node will be fenced and the boot process will take longer than it needs to.}}&lt;br /&gt;
&lt;br /&gt;
Power on both nodes. You can just hit the power button, or if you have a workstation on the [[BCN]] with &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fence-agents&amp;lt;/span&amp;gt; installed, you can call &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;fence_ipmilan&amp;lt;/span&amp;gt; (or the agent you use in your cluster).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
fence_ipmilan -a an-node01.ipmi -l root -p secret -o on&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Powering on machine @ IPMI:an-node01.ipmi...Done&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;
fence_ipmilan -a an-node02.ipmi -l root -p secret -o on&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Powering on machine @ IPMI:an-node02.ipmi...Done&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once they&#039;re up, log into them again and check their status. You will see that the VMs are off-line.&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-cluster-A @ Sun Jan  1 23:40:16 2012&lt;br /&gt;
Member Status: Quorate&lt;br /&gt;
&lt;br /&gt;
 Member Name                             ID   Status&lt;br /&gt;
 ------ ----                             ---- ------&lt;br /&gt;
 an-node01.alteeve.com                       1 Online, Local, rgmanager&lt;br /&gt;
 an-node02.alteeve.com                       2 Online, rgmanager&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State         &lt;br /&gt;
 ------- ----                   ----- ------                   -----         &lt;br /&gt;
 service:storage_an01           an-node01.alteeve.com          started       &lt;br /&gt;
 service:storage_an02           an-node02.alteeve.com          started       &lt;br /&gt;
 vm:vm0001-dev                  (none)                         disabled      &lt;br /&gt;
 vm:vm0002-web                  (none)                         disabled      &lt;br /&gt;
 vm:vm0003-db                   (none)                         disabled      &lt;br /&gt;
 vm:vm0004-ms                   (none)                         disabled      &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check that DRBD is ready;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
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;
version: 8.3.12 (api:88/proto:86-96)&lt;br /&gt;
GIT-hash: e2a8ef4656be026bbae540305fcb998a5991090f build by dag@Build64R6, 2011-11-20 10:57:03&lt;br /&gt;
 0: cs:Connected ro:Primary/Primary ds:UpToDate/UpToDate C r-----&lt;br /&gt;
    ns:4 nr:0 dw:0 dr:8712 al:0 bm:1 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:0 nr:0 dw:0 dr:4632 al:0 bm:0 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:0 nr:0 dw:0 dr:4648 al:0 bm:0 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;
Golden, let&#039;s start the VMs.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
clusvcadm -e vm:vm0001-dev -m an-node01.alteeve.com&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
vm:vm0001-dev is now running on an-node01.alteeve.com&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 -e vm:vm0002-web -m an-node01.alteeve.com&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
vm:vm0002-web is now running on an-node01.alteeve.com&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 -e vm:vm0003-db -m an-node02.alteeve.com&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
vm:vm0003-db is now running on an-node02.alteeve.com&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 -e vm:vm0004-ms -m an-node02.alteeve.com&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
vm:vm0004-ms is now running on an-node02.alteeve.com&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check the new status;&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-cluster-A @ Sun Jan  1 23:45:35 2012&lt;br /&gt;
Member Status: Quorate&lt;br /&gt;
&lt;br /&gt;
 Member Name                             ID   Status&lt;br /&gt;
 ------ ----                             ---- ------&lt;br /&gt;
 an-node01.alteeve.com                       1 Online, rgmanager&lt;br /&gt;
 an-node02.alteeve.com                       2 Online, Local, rgmanager&lt;br /&gt;
&lt;br /&gt;
 Service Name                   Owner (Last)                   State         &lt;br /&gt;
 ------- ----                   ----- ------                   -----         &lt;br /&gt;
 service:storage_an01           an-node01.alteeve.com          started       &lt;br /&gt;
 service:storage_an02           an-node02.alteeve.com          started       &lt;br /&gt;
 vm:vm0001-dev                  an-node01.alteeve.com          started       &lt;br /&gt;
 vm:vm0002-web                  an-node01.alteeve.com          started       &lt;br /&gt;
 vm:vm0003-db                   an-node02.alteeve.com          started       &lt;br /&gt;
 vm:vm0004-ms                   an-node02.alteeve.com          started       &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We&#039;re back up and running!&lt;br /&gt;
&lt;br /&gt;
== Done and Done! ==&lt;br /&gt;
&lt;br /&gt;
That, ladies and gentlemen, is all she wrote!&lt;br /&gt;
&lt;br /&gt;
You should now be safely ready to take your cluster into production at this stage.&lt;br /&gt;
&lt;br /&gt;
Happy Hacking!&lt;br /&gt;
&lt;br /&gt;
= Troubleshooting =&lt;br /&gt;
&lt;br /&gt;
Here we will cover, in no particular order, some common clustering problems and their fixes.&lt;br /&gt;
&lt;br /&gt;
== [vm] error: internal error Attempt to migrate guest to the same host {uuid} ==&lt;br /&gt;
&lt;br /&gt;
{{note|1=&amp;lt;s&amp;gt;See [https://bugzilla.redhat.com/show_bug.cgi?id=770626 rhbz#770626]. Work-around below.&amp;lt;/s&amp;gt; This seems to now be resolved! Setting &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;host_uuid&amp;lt;/span&amp;gt; is enough to work around this issue.}}&lt;br /&gt;
&lt;br /&gt;
This message will appear in the source node&#039;s syslog when trying to migrate a VM. Here is an example set of error messages.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Dec 27 22:00:46 an-node01 rgmanager[2492]: Migrating vm:vm0001-dev to an-node02.alteeve.com&lt;br /&gt;
Dec 27 22:00:46 an-node01 rgmanager[22331]: [vm] Migrate vm0001-dev to an-node02.alteeve.com failed:&lt;br /&gt;
Dec 27 22:00:46 an-node01 rgmanager[22353]: [vm] error: internal error Attempt to migrate guest to the same host 00020003-0004-0005-0006-000700080009&lt;br /&gt;
Dec 27 22:00:46 an-node01 rgmanager[2492]: migrate on vm &amp;quot;vm0001-dev&amp;quot; returned 150 (unspecified)&lt;br /&gt;
Dec 27 22:00:46 an-node01 rgmanager[2492]: Migration of vm:vm0001-dev to an-node02.alteeve.com failed; return code 150&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For reasons as yet unknown, both nodes have the same [[UUID]]. You can verify this by running &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virsh sysinfo | grep uuid&amp;lt;/span&amp;gt; on both nodes.&lt;br /&gt;
&lt;br /&gt;
First node;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
virsh sysinfo | grep uuid&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;entry name=&#039;uuid&#039;&amp;gt;03000200-0400-0500-0006-000700080009&amp;lt;/entry&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
First node;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
virsh sysinfo | grep uuid&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;entry name=&#039;uuid&#039;&amp;gt;03000200-0400-0500-0006-000700080009&amp;lt;/entry&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This UUID comes from the mainboard, and you can confirm this with the following command (note to change the string in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;grep&amp;lt;/span&amp;gt; to a portion of your UUID);&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
dmidecode -s system-uuid&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
03000200-0400-0500-0006-000700080009&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Alternatively;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
dmidecode |grep 000700080009 -B 7 -A 4&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Handle 0x0001, DMI type 1, 27 bytes&lt;br /&gt;
System Information&lt;br /&gt;
	Manufacturer: empty&lt;br /&gt;
	Product Name: empty&lt;br /&gt;
	Version: empty&lt;br /&gt;
	Serial Number: empty&lt;br /&gt;
	UUID: 03000200-0400-0500-0006-000700080009&lt;br /&gt;
	Wake-up Type: Power Switch&lt;br /&gt;
	SKU Number: To be filled by O.E.M.&lt;br /&gt;
	Family: To be filled by O.E.M.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is the result of a lazy vendor re-using UUIDs across mainboards.&lt;br /&gt;
&lt;br /&gt;
The fix is to specify a unique UUID in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/libvirt/libvirtd.conf&amp;lt;/span&amp;gt; using its &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;host_uuid&amp;lt;/span&amp;gt; variable. We&#039;ll generate new, unique UUIDs for each node using the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;uuidgen&amp;lt;/span&amp;gt; command. Be sure to use two new UUIDs for each node!&lt;br /&gt;
&lt;br /&gt;
On the first node;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/libvirt/libvirtd.conf /etc/libvirt/libvirtd.conf.orig&lt;br /&gt;
uuidgen &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;
31873b9e-1069-42ce-b950-137ae5eaa3d1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Change the UUID;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/libvirt/libvirtd.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;
host_uuid = &amp;quot;31873b9e-1069-42ce-b950-137ae5eaa3d1&amp;quot;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here&#039;s the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;diff&amp;lt;/span&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
diff -u /etc/libvirt/libvirtd.conf.orig /etc/libvirt/libvirtd.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/libvirt/libvirtd.conf.orig	2011-12-27 22:29:01.243394880 -0500&lt;br /&gt;
+++ /etc/libvirt/libvirtd.conf	2011-12-27 22:33:44.309799253 -0500&lt;br /&gt;
@@ -365,4 +365,4 @@&lt;br /&gt;
 # NB This default all-zeros UUID will not work. Replace&lt;br /&gt;
 # it with the output of the &#039;uuidgen&#039; command and then&lt;br /&gt;
 # uncomment this entry&lt;br /&gt;
-#host_uuid = &amp;quot;00000000-0000-0000-0000-000000000000&amp;quot;&lt;br /&gt;
+host_uuid = &amp;quot;31873b9e-1069-42ce-b950-137ae5eaa3d1&amp;quot;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Make the same change, with a new and unique UUID, on the second node.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp /etc/libvirt/libvirtd.conf /etc/libvirt/libvirtd.conf.orig&lt;br /&gt;
uuidgen &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;
90b8d280-c9ff-4e0e-867e-6d4f7d915995&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Change the UUID;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
vim /etc/libvirt/libvirtd.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;
host_uuid = &amp;quot;90b8d280-c9ff-4e0e-867e-6d4f7d915995&amp;quot;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here&#039;s the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;diff&amp;lt;/span&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
diff -u /etc/libvirt/libvirtd.conf.orig /etc/libvirt/libvirtd.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/libvirt/libvirtd.conf.orig	2011-12-27 22:35:45.975389858 -0500&lt;br /&gt;
+++ /etc/libvirt/libvirtd.conf	2011-12-27 22:36:28.325518880 -0500&lt;br /&gt;
@@ -365,4 +365,4 @@&lt;br /&gt;
 # NB This default all-zeros UUID will not work. Replace&lt;br /&gt;
 # it with the output of the &#039;uuidgen&#039; command and then&lt;br /&gt;
 # uncomment this entry&lt;br /&gt;
-#host_uuid = &amp;quot;00000000-0000-0000-0000-000000000000&amp;quot;&lt;br /&gt;
+host_uuid = &amp;quot;90b8d280-c9ff-4e0e-867e-6d4f7d915995&amp;quot;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now to reload the configuration, we need to restart &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;libvirtd&amp;lt;/span&amp;gt; (a reload is not enough). &lt;br /&gt;
&lt;br /&gt;
{{warning|1=Be sure to stop all VMs on the node before proceeding!}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/libvirtd restart&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Stopping libvirtd daemon:                                  [  OK  ]&lt;br /&gt;
Starting libvirtd daemon:                                  [  OK  ]&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;
virsh sysinfo | grep uuid&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This should show the new UUID. If it doesn&#039;t though, please apply the work-around below.&lt;br /&gt;
&lt;br /&gt;
=== Setting host_uuid Didn&#039;t Work, What Now? ===&lt;br /&gt;
&lt;br /&gt;
{{warning|1=This work-around is not supported in any way supported by Red Hat or any other vendor. This work-around is provided as-is until &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;libvirt&amp;lt;/span&amp;gt; is fixed. - &#039;&#039;&#039;Dec. 28, 2011&#039;&#039;&#039;}}&lt;br /&gt;
&lt;br /&gt;
The problem is that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;libvirt&amp;lt;/span&amp;gt; doesn&#039;t use &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;libvirtd.conf&amp;lt;/span&amp;gt;&#039;s &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;host_uuid&amp;lt;/span&amp;gt; if it sees the system UUID as being valid (not all &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;0&amp;lt;/span&amp;gt; or all &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;f&amp;lt;/span&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
The work-around is to create a wrapper script for &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;dmidecode&amp;lt;/span&amp;gt; that intercepts &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;dmidecode -q -t 0,1,4,17&amp;lt;/span&amp;gt;, reads the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;libvirtd.conf&amp;lt;/span&amp;gt; and, if &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;host_uuid&amp;lt;/span&amp;gt; is set, substitute UUID returned by &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;dmidecode&amp;lt;/span&amp;gt; with the one set by &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;host_uuid&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
{{note|1=You can look at the source of the wrapper script [http://pastebin.com/dwXkUnPT on pastebin.org].}}&lt;br /&gt;
&lt;br /&gt;
To apply the work-around;&lt;br /&gt;
&lt;br /&gt;
Check that the current &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;dmidecode&amp;lt;/span&amp;gt; returns the bad UUID;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
dmidecode -q -t 0,1,4,17 | grep UUID&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
	UUID: 03000200-0400-0500-0006-000700080009&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we&#039;re going to rename &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;dmidecode&amp;lt;/span&amp;gt; as &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;dmidecode.orig&amp;lt;/span&amp;gt;, then download the wrapper script.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
mv /usr/sbin/dmidecode /usr/sbin/dmidecode.orig&lt;br /&gt;
wget -c https://alteeve.com/files/dmidecode -O /usr/sbin/dmidecode&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
--2011-12-28 13:44:27--  https://alteeve.com/files/dmidecode&lt;br /&gt;
Resolving alteeve.com... 192.139.81.121&lt;br /&gt;
Connecting to alteeve.com|192.139.81.121|:443... connected.&lt;br /&gt;
HTTP request sent, awaiting response... 200 OK&lt;br /&gt;
Length: 1159 (1.1K) [text/plain]&lt;br /&gt;
Saving to: “/usr/sbin/dmidecode”&lt;br /&gt;
&lt;br /&gt;
100%[======================================&amp;gt;] 1,159       --.-K/s   in 0s      &lt;br /&gt;
&lt;br /&gt;
2011-12-28 13:44:28 (15.3 MB/s) - “/usr/sbin/dmidecode” saved [1159/1159]&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;
chmod 755 /usr/sbin/dmidecode&lt;br /&gt;
ls -lah /usr/sbin/dmidecode&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
-rwxr-xr-x 1 root root 1.2K Dec 28 13:26 /usr/sbin/dmidecode&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now re-run the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;dmidecode&amp;lt;/span&amp;gt; call and see that the new UUID is used.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
dmidecode -q -t 0,1,4,17 | grep UUID&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
	UUID: 31873b9e-1069-42ce-b950-137ae5eaa3d1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This matches what was set in &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/etc/libvirt/libvirtd.conf&amp;lt;/span&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
grep host_uuid /etc/libvirt/libvirtd.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;
host_uuid = &amp;quot;31873b9e-1069-42ce-b950-137ae5eaa3d1&amp;quot;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now restart &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;libvirtd&amp;lt;/span&amp;gt; and check &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virsh sysinfo&amp;lt;/span&amp;gt; to confirm that &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;libvirtd&amp;lt;/span&amp;gt; now returns the proper UUID.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
/etc/init.d/libvirtd restart&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Stopping libvirtd daemon:                                  [  OK  ]&lt;br /&gt;
Starting libvirtd daemon:                                  [  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;
virsh sysinfo | grep uuid&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;entry name=&#039;uuid&#039;&amp;gt;31873b9e-1069-42ce-b950-137ae5eaa3d1&amp;lt;/entry&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Done!&lt;br /&gt;
&lt;br /&gt;
As soon as &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;libvirtd&amp;lt;/span&amp;gt; is fixed, this section will be re-written.&lt;br /&gt;
&lt;br /&gt;
== [vm] error: Cannot recv data: Host key verification failed.#015: Connection reset by peer ==&lt;br /&gt;
&lt;br /&gt;
This can show up when you try to live migrate a VM but your &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;/root/.ssh/known_hosts&amp;lt;/span&amp;gt; file has not been populated. Effectively, the cluster was prompted to accept the finger-print of the target node, was unable to answer and so then closed the connection.&lt;br /&gt;
&lt;br /&gt;
The syslog entry will look something like this;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Dec 27 21:58:00 an-node02 rgmanager[2439]: Migrating vm:vm0003-db to an-node01.alteeve.com&lt;br /&gt;
Dec 27 21:58:01 an-node02 rgmanager[18951]: [vm] Migrate vm0003-db to an-node01.alteeve.com failed:&lt;br /&gt;
Dec 27 21:58:01 an-node02 rgmanager[18973]: [vm] error: Cannot recv data: Host key verification failed.#015: Connection reset by peer&lt;br /&gt;
Dec 27 21:58:01 an-node02 rgmanager[2439]: migrate on vm &amp;quot;vm0003-db&amp;quot; returned 150 (unspecified)&lt;br /&gt;
Dec 27 21:58:01 an-node02 rgmanager[2439]: Migration of vm:vm0003-db to an-node01.alteeve.com failed; return code 150&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To fix the problem, please return to [[2-Node_Red_Hat_KVM_Cluster_Tutorial#Populating_And_Pushing_.7E.2F.ssh.2Fknown_hosts|Populating And Pushing ~/ssh/known_hosts]].&lt;br /&gt;
&lt;br /&gt;
== error: unknown OS type hvm ==&lt;br /&gt;
&lt;br /&gt;
This can be caused by hardware virtualization support being disabled in your [[BIOS]].&lt;br /&gt;
&lt;br /&gt;
To check whether you have hardware virtualization support enabled, run;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
egrep &#039;(vmx|svm)&#039; --color=always /proc/cpuinfo&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On [[Intel]] machines, you should see this;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
flags		: ... vmx ...&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On [[AMD]] machines, you should see this;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
flags		: ... svm ...&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The above will have the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xvm&amp;lt;/span&amp;gt; or &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;svm&amp;lt;/span&amp;gt; highlighted and the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;flags&amp;lt;/span&amp;gt; line will be quite long. You will also see an entry for every CPU core (or hyperthreaded pseudo-core).&lt;br /&gt;
&lt;br /&gt;
If you don&#039;t see a match to either &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;xvm&amp;lt;/span&amp;gt; or &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;svm&amp;lt;/span&amp;gt;, please consult your motherboard&#039;s manual for information on enabling hardware virtualization.&lt;br /&gt;
&lt;br /&gt;
== My VM Just Vanished! ==&lt;br /&gt;
&lt;br /&gt;
{{warning|1=If &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;virsh&amp;lt;/span&amp;gt; tries to start a virtual machine but a referenced device or media is missing, it will react by completely undefining the virtual machine!}}&lt;br /&gt;
&lt;br /&gt;
If you ever suddenly find that a virtual machine has vanished, it is probably because something the VM wanted to use couldn&#039;t be found. This can be as trivial as deleting an ISO that a VM had been defined to mount on boot. &lt;br /&gt;
&lt;br /&gt;
Let&#039;s look at the example where an ISO was deleted, as this is a common issue.&lt;br /&gt;
&lt;br /&gt;
Copy your last backup of the XML definition file for the effected VM and then edit it to remove the &amp;lt;span class=&amp;quot;code&amp;quot;&amp;gt;&amp;lt;nowiki&amp;gt;&amp;lt;source file=&#039;...&#039;/&amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/span&amp;gt; lines for the removed media. For example, change:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;disk type=&#039;file&#039; device=&#039;floppy&#039;&amp;gt;&lt;br /&gt;
      &amp;lt;driver name=&#039;qemu&#039; type=&#039;raw&#039; cache=&#039;none&#039; io=&#039;threads&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;source file=&#039;/shared/files/virtio-win-1.1.16.vfd&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;target dev=&#039;fda&#039; bus=&#039;fdc&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;alias name=&#039;fdc0-0-0&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;address type=&#039;drive&#039; controller=&#039;0&#039; bus=&#039;0&#039; unit=&#039;0&#039;/&amp;gt;&lt;br /&gt;
    &amp;lt;/disk&amp;gt;&lt;br /&gt;
    &amp;lt;disk type=&#039;file&#039; device=&#039;cdrom&#039;&amp;gt;&lt;br /&gt;
      &amp;lt;driver name=&#039;qemu&#039; type=&#039;raw&#039; io=&#039;threads&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;source file=&#039;/shared/files/Windows_Server_2008_R2_64Bit_SP1.iso&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;target dev=&#039;hdc&#039; bus=&#039;ide&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;readonly/&amp;gt;&lt;br /&gt;
      &amp;lt;alias name=&#039;ide0-1-0&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;address type=&#039;drive&#039; controller=&#039;0&#039; bus=&#039;1&#039; unit=&#039;0&#039;/&amp;gt;&lt;br /&gt;
    &amp;lt;/disk&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;disk type=&#039;file&#039; device=&#039;floppy&#039;&amp;gt;&lt;br /&gt;
      &amp;lt;driver name=&#039;qemu&#039; type=&#039;raw&#039; cache=&#039;none&#039; io=&#039;threads&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;target dev=&#039;fda&#039; bus=&#039;fdc&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;alias name=&#039;fdc0-0-0&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;address type=&#039;drive&#039; controller=&#039;0&#039; bus=&#039;0&#039; unit=&#039;0&#039;/&amp;gt;&lt;br /&gt;
    &amp;lt;/disk&amp;gt;&lt;br /&gt;
    &amp;lt;disk type=&#039;file&#039; device=&#039;cdrom&#039;&amp;gt;&lt;br /&gt;
      &amp;lt;driver name=&#039;qemu&#039; type=&#039;raw&#039; io=&#039;threads&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;target dev=&#039;hdc&#039; bus=&#039;ide&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;readonly/&amp;gt;&lt;br /&gt;
      &amp;lt;alias name=&#039;ide0-1-0&#039;/&amp;gt;&lt;br /&gt;
      &amp;lt;address type=&#039;drive&#039; controller=&#039;0&#039; bus=&#039;1&#039; unit=&#039;0&#039;/&amp;gt;&lt;br /&gt;
    &amp;lt;/disk&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then redefine the VM and you can safely restart it again.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
virsh define /shared/definitions/vm0002-ms.xml&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You should be back in business at this point.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{footer}}&lt;/div&gt;</summary>
		<author><name>RoyK</name></author>
	</entry>
</feed>