Sophie

Sophie

distrib > Mageia > 6 > armv5tl > by-pkgid > 940719b99703aa60bacd4609ca4a8f3f > files > 230

crmsh-3.0.0-1.mga6.noarch.rpm

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
    "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=UTF-8" />
<meta name="generator" content="AsciiDoc 8.6.9" />
<title>crm(8)</title>
<style type="text/css">
/* Shared CSS for AsciiDoc xhtml11 and html5 backends */

/* Default font. */
body {
  font-family: Georgia,serif;
}

/* Title font. */
h1, h2, h3, h4, h5, h6,
div.title, caption.title,
thead, p.table.header,
#toctitle,
#author, #revnumber, #revdate, #revremark,
#footer {
  font-family: Arial,Helvetica,sans-serif;
}

body {
  margin: 1em 5% 1em 5%;
}

a {
  color: blue;
  text-decoration: underline;
}
a:visited {
  color: fuchsia;
}

em {
  font-style: italic;
  color: navy;
}

strong {
  font-weight: bold;
  color: #083194;
}

h1, h2, h3, h4, h5, h6 {
  color: #527bbd;
  margin-top: 1.2em;
  margin-bottom: 0.5em;
  line-height: 1.3;
}

h1, h2, h3 {
  border-bottom: 2px solid silver;
}
h2 {
  padding-top: 0.5em;
}
h3 {
  float: left;
}
h3 + * {
  clear: left;
}
h5 {
  font-size: 1.0em;
}

div.sectionbody {
  margin-left: 0;
}

hr {
  border: 1px solid silver;
}

p {
  margin-top: 0.5em;
  margin-bottom: 0.5em;
}

ul, ol, li > p {
  margin-top: 0;
}
ul > li     { color: #aaa; }
ul > li > * { color: black; }

.monospaced, code, pre {
  font-family: "Courier New", Courier, monospace;
  font-size: inherit;
  color: navy;
  padding: 0;
  margin: 0;
}
pre {
  white-space: pre-wrap;
}

#author {
  color: #527bbd;
  font-weight: bold;
  font-size: 1.1em;
}
#email {
}
#revnumber, #revdate, #revremark {
}

#footer {
  font-size: small;
  border-top: 2px solid silver;
  padding-top: 0.5em;
  margin-top: 4.0em;
}
#footer-text {
  float: left;
  padding-bottom: 0.5em;
}
#footer-badges {
  float: right;
  padding-bottom: 0.5em;
}

#preamble {
  margin-top: 1.5em;
  margin-bottom: 1.5em;
}
div.imageblock, div.exampleblock, div.verseblock,
div.quoteblock, div.literalblock, div.listingblock, div.sidebarblock,
div.admonitionblock {
  margin-top: 1.0em;
  margin-bottom: 1.5em;
}
div.admonitionblock {
  margin-top: 2.0em;
  margin-bottom: 2.0em;
  margin-right: 10%;
  color: #606060;
}

div.content { /* Block element content. */
  padding: 0;
}

/* Block element titles. */
div.title, caption.title {
  color: #527bbd;
  font-weight: bold;
  text-align: left;
  margin-top: 1.0em;
  margin-bottom: 0.5em;
}
div.title + * {
  margin-top: 0;
}

td div.title:first-child {
  margin-top: 0.0em;
}
div.content div.title:first-child {
  margin-top: 0.0em;
}
div.content + div.title {
  margin-top: 0.0em;
}

div.sidebarblock > div.content {
  background: #ffffee;
  border: 1px solid #dddddd;
  border-left: 4px solid #f0f0f0;
  padding: 0.5em;
}

div.listingblock > div.content {
  border: 1px solid #dddddd;
  border-left: 5px solid #f0f0f0;
  background: #f8f8f8;
  padding: 0.5em;
}

div.quoteblock, div.verseblock {
  padding-left: 1.0em;
  margin-left: 1.0em;
  margin-right: 10%;
  border-left: 5px solid #f0f0f0;
  color: #888;
}

div.quoteblock > div.attribution {
  padding-top: 0.5em;
  text-align: right;
}

div.verseblock > pre.content {
  font-family: inherit;
  font-size: inherit;
}
div.verseblock > div.attribution {
  padding-top: 0.75em;
  text-align: left;
}
/* DEPRECATED: Pre version 8.2.7 verse style literal block. */
div.verseblock + div.attribution {
  text-align: left;
}

div.admonitionblock .icon {
  vertical-align: top;
  font-size: 1.1em;
  font-weight: bold;
  text-decoration: underline;
  color: #527bbd;
  padding-right: 0.5em;
}
div.admonitionblock td.content {
  padding-left: 0.5em;
  border-left: 3px solid #dddddd;
}

div.exampleblock > div.content {
  border-left: 3px solid #dddddd;
  padding-left: 0.5em;
}

div.imageblock div.content { padding-left: 0; }
span.image img { border-style: none; vertical-align: text-bottom; }
a.image:visited { color: white; }

dl {
  margin-top: 0.8em;
  margin-bottom: 0.8em;
}
dt {
  margin-top: 0.5em;
  margin-bottom: 0;
  font-style: normal;
  color: navy;
}
dd > *:first-child {
  margin-top: 0.1em;
}

ul, ol {
    list-style-position: outside;
}
ol.arabic {
  list-style-type: decimal;
}
ol.loweralpha {
  list-style-type: lower-alpha;
}
ol.upperalpha {
  list-style-type: upper-alpha;
}
ol.lowerroman {
  list-style-type: lower-roman;
}
ol.upperroman {
  list-style-type: upper-roman;
}

div.compact ul, div.compact ol,
div.compact p, div.compact p,
div.compact div, div.compact div {
  margin-top: 0.1em;
  margin-bottom: 0.1em;
}

tfoot {
  font-weight: bold;
}
td > div.verse {
  white-space: pre;
}

div.hdlist {
  margin-top: 0.8em;
  margin-bottom: 0.8em;
}
div.hdlist tr {
  padding-bottom: 15px;
}
dt.hdlist1.strong, td.hdlist1.strong {
  font-weight: bold;
}
td.hdlist1 {
  vertical-align: top;
  font-style: normal;
  padding-right: 0.8em;
  color: navy;
}
td.hdlist2 {
  vertical-align: top;
}
div.hdlist.compact tr {
  margin: 0;
  padding-bottom: 0;
}

.comment {
  background: yellow;
}

.footnote, .footnoteref {
  font-size: 0.8em;
}

span.footnote, span.footnoteref {
  vertical-align: super;
}

#footnotes {
  margin: 20px 0 20px 0;
  padding: 7px 0 0 0;
}

#footnotes div.footnote {
  margin: 0 0 5px 0;
}

#footnotes hr {
  border: none;
  border-top: 1px solid silver;
  height: 1px;
  text-align: left;
  margin-left: 0;
  width: 20%;
  min-width: 100px;
}

div.colist td {
  padding-right: 0.5em;
  padding-bottom: 0.3em;
  vertical-align: top;
}
div.colist td img {
  margin-top: 0.3em;
}

@media print {
  #footer-badges { display: none; }
}

#toc {
  margin-bottom: 2.5em;
}

#toctitle {
  color: #527bbd;
  font-size: 1.1em;
  font-weight: bold;
  margin-top: 1.0em;
  margin-bottom: 0.1em;
}

div.toclevel0, div.toclevel1, div.toclevel2, div.toclevel3, div.toclevel4 {
  margin-top: 0;
  margin-bottom: 0;
}
div.toclevel2 {
  margin-left: 2em;
  font-size: 0.9em;
}
div.toclevel3 {
  margin-left: 4em;
  font-size: 0.9em;
}
div.toclevel4 {
  margin-left: 6em;
  font-size: 0.9em;
}

span.aqua { color: aqua; }
span.black { color: black; }
span.blue { color: blue; }
span.fuchsia { color: fuchsia; }
span.gray { color: gray; }
span.green { color: green; }
span.lime { color: lime; }
span.maroon { color: maroon; }
span.navy { color: navy; }
span.olive { color: olive; }
span.purple { color: purple; }
span.red { color: red; }
span.silver { color: silver; }
span.teal { color: teal; }
span.white { color: white; }
span.yellow { color: yellow; }

span.aqua-background { background: aqua; }
span.black-background { background: black; }
span.blue-background { background: blue; }
span.fuchsia-background { background: fuchsia; }
span.gray-background { background: gray; }
span.green-background { background: green; }
span.lime-background { background: lime; }
span.maroon-background { background: maroon; }
span.navy-background { background: navy; }
span.olive-background { background: olive; }
span.purple-background { background: purple; }
span.red-background { background: red; }
span.silver-background { background: silver; }
span.teal-background { background: teal; }
span.white-background { background: white; }
span.yellow-background { background: yellow; }

span.big { font-size: 2em; }
span.small { font-size: 0.6em; }

span.underline { text-decoration: underline; }
span.overline { text-decoration: overline; }
span.line-through { text-decoration: line-through; }

div.unbreakable { page-break-inside: avoid; }


/*
 * xhtml11 specific
 *
 * */

div.tableblock {
  margin-top: 1.0em;
  margin-bottom: 1.5em;
}
div.tableblock > table {
  border: 3px solid #527bbd;
}
thead, p.table.header {
  font-weight: bold;
  color: #527bbd;
}
p.table {
  margin-top: 0;
}
/* Because the table frame attribute is overriden by CSS in most browsers. */
div.tableblock > table[frame="void"] {
  border-style: none;
}
div.tableblock > table[frame="hsides"] {
  border-left-style: none;
  border-right-style: none;
}
div.tableblock > table[frame="vsides"] {
  border-top-style: none;
  border-bottom-style: none;
}


/*
 * html5 specific
 *
 * */

table.tableblock {
  margin-top: 1.0em;
  margin-bottom: 1.5em;
}
thead, p.tableblock.header {
  font-weight: bold;
  color: #527bbd;
}
p.tableblock {
  margin-top: 0;
}
table.tableblock {
  border-width: 3px;
  border-spacing: 0px;
  border-style: solid;
  border-color: #527bbd;
  border-collapse: collapse;
}
th.tableblock, td.tableblock {
  border-width: 1px;
  padding: 4px;
  border-style: solid;
  border-color: #527bbd;
}

table.tableblock.frame-topbot {
  border-left-style: hidden;
  border-right-style: hidden;
}
table.tableblock.frame-sides {
  border-top-style: hidden;
  border-bottom-style: hidden;
}
table.tableblock.frame-none {
  border-style: hidden;
}

th.tableblock.halign-left, td.tableblock.halign-left {
  text-align: left;
}
th.tableblock.halign-center, td.tableblock.halign-center {
  text-align: center;
}
th.tableblock.halign-right, td.tableblock.halign-right {
  text-align: right;
}

th.tableblock.valign-top, td.tableblock.valign-top {
  vertical-align: top;
}
th.tableblock.valign-middle, td.tableblock.valign-middle {
  vertical-align: middle;
}
th.tableblock.valign-bottom, td.tableblock.valign-bottom {
  vertical-align: bottom;
}


/*
 * manpage specific
 *
 * */

body.manpage h1 {
  padding-top: 0.5em;
  padding-bottom: 0.5em;
  border-top: 2px solid silver;
  border-bottom: 2px solid silver;
}
body.manpage h2 {
  border-style: none;
}
body.manpage div.sectionbody {
  margin-left: 3em;
}

@media print {
  body.manpage div#toc { display: none; }
}


</style>
<script type="text/javascript">
/*<![CDATA[*/
var asciidoc = {  // Namespace.

/////////////////////////////////////////////////////////////////////
// Table Of Contents generator
/////////////////////////////////////////////////////////////////////

/* Author: Mihai Bazon, September 2002
 * http://students.infoiasi.ro/~mishoo
 *
 * Table Of Content generator
 * Version: 0.4
 *
 * Feel free to use this script under the terms of the GNU General Public
 * License, as long as you do not remove or alter this notice.
 */

 /* modified by Troy D. Hanson, September 2006. License: GPL */
 /* modified by Stuart Rackham, 2006, 2009. License: GPL */

// toclevels = 1..4.
toc: function (toclevels) {

  function getText(el) {
    var text = "";
    for (var i = el.firstChild; i != null; i = i.nextSibling) {
      if (i.nodeType == 3 /* Node.TEXT_NODE */) // IE doesn't speak constants.
        text += i.data;
      else if (i.firstChild != null)
        text += getText(i);
    }
    return text;
  }

  function TocEntry(el, text, toclevel) {
    this.element = el;
    this.text = text;
    this.toclevel = toclevel;
  }

  function tocEntries(el, toclevels) {
    var result = new Array;
    var re = new RegExp('[hH]([1-'+(toclevels+1)+'])');
    // Function that scans the DOM tree for header elements (the DOM2
    // nodeIterator API would be a better technique but not supported by all
    // browsers).
    var iterate = function (el) {
      for (var i = el.firstChild; i != null; i = i.nextSibling) {
        if (i.nodeType == 1 /* Node.ELEMENT_NODE */) {
          var mo = re.exec(i.tagName);
          if (mo && (i.getAttribute("class") || i.getAttribute("className")) != "float") {
            result[result.length] = new TocEntry(i, getText(i), mo[1]-1);
          }
          iterate(i);
        }
      }
    }
    iterate(el);
    return result;
  }

  var toc = document.getElementById("toc");
  if (!toc) {
    return;
  }

  // Delete existing TOC entries in case we're reloading the TOC.
  var tocEntriesToRemove = [];
  var i;
  for (i = 0; i < toc.childNodes.length; i++) {
    var entry = toc.childNodes[i];
    if (entry.nodeName.toLowerCase() == 'div'
     && entry.getAttribute("class")
     && entry.getAttribute("class").match(/^toclevel/))
      tocEntriesToRemove.push(entry);
  }
  for (i = 0; i < tocEntriesToRemove.length; i++) {
    toc.removeChild(tocEntriesToRemove[i]);
  }

  // Rebuild TOC entries.
  var entries = tocEntries(document.getElementById("content"), toclevels);
  for (var i = 0; i < entries.length; ++i) {
    var entry = entries[i];
    if (entry.element.id == "")
      entry.element.id = "_toc_" + i;
    var a = document.createElement("a");
    a.href = "#" + entry.element.id;
    a.appendChild(document.createTextNode(entry.text));
    var div = document.createElement("div");
    div.appendChild(a);
    div.className = "toclevel" + entry.toclevel;
    toc.appendChild(div);
  }
  if (entries.length == 0)
    toc.parentNode.removeChild(toc);
},


/////////////////////////////////////////////////////////////////////
// Footnotes generator
/////////////////////////////////////////////////////////////////////

/* Based on footnote generation code from:
 * http://www.brandspankingnew.net/archive/2005/07/format_footnote.html
 */

footnotes: function () {
  // Delete existing footnote entries in case we're reloading the footnodes.
  var i;
  var noteholder = document.getElementById("footnotes");
  if (!noteholder) {
    return;
  }
  var entriesToRemove = [];
  for (i = 0; i < noteholder.childNodes.length; i++) {
    var entry = noteholder.childNodes[i];
    if (entry.nodeName.toLowerCase() == 'div' && entry.getAttribute("class") == "footnote")
      entriesToRemove.push(entry);
  }
  for (i = 0; i < entriesToRemove.length; i++) {
    noteholder.removeChild(entriesToRemove[i]);
  }

  // Rebuild footnote entries.
  var cont = document.getElementById("content");
  var spans = cont.getElementsByTagName("span");
  var refs = {};
  var n = 0;
  for (i=0; i<spans.length; i++) {
    if (spans[i].className == "footnote") {
      n++;
      var note = spans[i].getAttribute("data-note");
      if (!note) {
        // Use [\s\S] in place of . so multi-line matches work.
        // Because JavaScript has no s (dotall) regex flag.
        note = spans[i].innerHTML.match(/\s*\[([\s\S]*)]\s*/)[1];
        spans[i].innerHTML =
          "[<a id='_footnoteref_" + n + "' href='#_footnote_" + n +
          "' title='View footnote' class='footnote'>" + n + "</a>]";
        spans[i].setAttribute("data-note", note);
      }
      noteholder.innerHTML +=
        "<div class='footnote' id='_footnote_" + n + "'>" +
        "<a href='#_footnoteref_" + n + "' title='Return to text'>" +
        n + "</a>. " + note + "</div>";
      var id =spans[i].getAttribute("id");
      if (id != null) refs["#"+id] = n;
    }
  }
  if (n == 0)
    noteholder.parentNode.removeChild(noteholder);
  else {
    // Process footnoterefs.
    for (i=0; i<spans.length; i++) {
      if (spans[i].className == "footnoteref") {
        var href = spans[i].getElementsByTagName("a")[0].getAttribute("href");
        href = href.match(/#.*/)[0];  // Because IE return full URL.
        n = refs[href];
        spans[i].innerHTML =
          "[<a href='#_footnote_" + n +
          "' title='View footnote' class='footnote'>" + n + "</a>]";
      }
    }
  }
},

install: function(toclevels) {
  var timerId;

  function reinstall() {
    asciidoc.footnotes();
    if (toclevels) {
      asciidoc.toc(toclevels);
    }
  }

  function reinstallAndRemoveTimer() {
    clearInterval(timerId);
    reinstall();
  }

  timerId = setInterval(reinstall, 500);
  if (document.addEventListener)
    document.addEventListener("DOMContentLoaded", reinstallAndRemoveTimer, false);
  else
    window.onload = reinstallAndRemoveTimer;
}

}
asciidoc.install();
/*]]>*/
</script>
</head>
<body class="article">
<div id="header">
<h1>crm(8)</h1>
</div>
<div id="content">
<div class="sect1">
<h2 id="_name">NAME</h2>
<div class="sectionbody">
<div class="paragraph"><p>crm - Pacemaker command line interface for configuration and management</p></div>
</div>
</div>
<div class="sect1">
<h2 id="_synopsis">SYNOPSIS</h2>
<div class="sectionbody">
<div class="paragraph"><p><strong>crm</strong> [OPTIONS] [SUBCOMMAND ARGS&#8230;]</p></div>
</div>
</div>
<div class="sect1">
<h2 id="topics_Description">DESCRIPTION</h2>
<div class="sectionbody">
<div class="paragraph"><p>The <code>crm</code> shell is a command-line based cluster configuration and
management tool. Its goal is to assist as much as possible with the
configuration and maintenance of Pacemaker-based High Availability
clusters.</p></div>
<div class="paragraph"><p>For more information on Pacemaker itself, see <a href="http://clusterlabs.org/">http://clusterlabs.org/</a>.</p></div>
<div class="paragraph"><p><code>crm</code> works both as a command-line tool to be called directly from the
system shell, and as an interactive shell with extensive tab
completion and help.</p></div>
<div class="paragraph"><p>The primary focus of the <code>crm</code> shell is to provide a simplified and
consistent interface to Pacemaker, but it also provides tools for
managing the creation and configuration of High Availability clusters
from scratch. To learn more about this aspect of <code>crm</code>, see the
<code>cluster</code> section below.</p></div>
<div class="paragraph"><p>The <code>crm</code> shell can be used to manage every aspect of configuring and
maintaining a cluster. It provides a simplified line-based syntax on
top of the XML configuration format used by Pacemaker, commands for
starting and stopping resources, tools for exploring the history of a
cluster including log scraping and a set of cluster scripts useful for
automating the setup and installation of services on the cluster
nodes.</p></div>
<div class="paragraph"><p>The <code>crm</code> shell is line oriented: every command must start and finish
on the same line. It is possible to use a continuation character (<code>\</code>)
to write one command in two or more lines. The continuation character
is commonly used when displaying configurations.</p></div>
</div>
</div>
<div class="sect1">
<h2 id="topics_CommandLine">OPTIONS</h2>
<div class="sectionbody">
<div class="dlist"><dl>
<dt class="hdlist1">
<strong>-f, --file</strong>=<em>FILE</em>
</dt>
<dd>
<p>
    Load commands from the given file. If a dash <code>-</code> is used in place
    of a file name, <code>crm</code> will read commands from the shell standard
    input (<code>stdin</code>).
</p>
</dd>
<dt class="hdlist1">
<strong>-c, --cib</strong>=<em>CIB</em>
</dt>
<dd>
<p>
    Start the session using the given shadow CIB file.
    Equivalent to <code>cib use &lt;CIB&gt;</code>.
</p>
</dd>
<dt class="hdlist1">
<strong>-D, --display=</strong><em>OUTPUT_TYPE</em>
</dt>
<dd>
<p>
    Choose one of the output options: <code>plain</code>, <code>color-always</code>, <code>color</code>,
    or <code>uppercase</code>. The default is <code>color</code> if the terminal emulation
    supports colors. Otherwise, <code>plain</code> is used.
</p>
</dd>
<dt class="hdlist1">
<strong>-F, --force</strong>
</dt>
<dd>
<p>
    Make <code>crm</code> proceed with applying changes where it would normally
    ask the user to confirm before proceeding. This option is mainly
    useful in scripts, and should be used with care.
</p>
</dd>
<dt class="hdlist1">
<strong>-w, --wait</strong>
</dt>
<dd>
<p>
    Make <code>crm</code> wait for the cluster transition to finish (for the
    changes to take effect) after each processed line.
</p>
</dd>
<dt class="hdlist1">
<strong>-H, --history</strong>=<em>DIR|FILE|SESSION</em>
</dt>
<dd>
<p>
    A directory or file containing a cluster report to load
    into the <code>history</code> commands, or the name of a previously
    saved history session.
</p>
</dd>
<dt class="hdlist1">
<strong>-h, --help</strong>
</dt>
<dd>
<p>
    Print help page.
</p>
</dd>
<dt class="hdlist1">
<strong>--version</strong>
</dt>
<dd>
<p>
    Print crmsh version and build information (Mercurial Hg changeset
    hash).
</p>
</dd>
<dt class="hdlist1">
<strong>-d, --debug</strong>
</dt>
<dd>
<p>
    Print verbose debugging information.
</p>
</dd>
<dt class="hdlist1">
<strong>-R, --regression-tests</strong>
</dt>
<dd>
<p>
    Enables extra verbose trace logging used by the regression
    tests. Logs all external calls made by crmsh.
</p>
</dd>
<dt class="hdlist1">
<strong>--scriptdir</strong>=<em>DIR</em>
</dt>
<dd>
<p>
    Extra directory where crm looks for cluster scripts, or a list of
    directories separated by semi-colons (e.g. <code>/dir1;/dir2;etc.</code>).
</p>
</dd>
<dt class="hdlist1">
<strong>-o, --opt</strong>=<em>OPTION=VALUE</em>
</dt>
<dd>
<p>
     Set crmsh option temporarily. If the options are saved using
     <code>options save</code> then the value passed here will also be saved.
     Multiple options can be set by using <code>-o</code> multiple times.
</p>
</dd>
</dl></div>
</div>
</div>
<div class="sect1">
<h2 id="topics_Introduction">Introduction</h2>
<div class="sectionbody">
<div class="paragraph"><p>This section of the user guide covers general topics about the user
interface and describes some of the features of <code>crmsh</code> in detail.</p></div>
<div class="sect2">
<h3 id="topics_Introduction_Interface">User interface</h3>
<div class="paragraph"><p>The main purpose of <code>crmsh</code> is to provide a simple yet powerful
interface to the cluster stack. There are two main modes of operation
with the user interface of <code>crmsh</code>:</p></div>
<div class="ulist"><ul>
<li>
<p>
Command line (single-shot) use - Use <code>crm</code> as a regular UNIX command
  from your usual shell. <code>crm</code> has full bash completion built in, so
  using it in this manner should be as comfortable and familiar as
  using any other command-line tool.
</p>
</li>
<li>
<p>
Interactive mode - By calling <code>crm</code> without arguments, or by calling
  it with only a sublevel as argument, <code>crm</code> enters the interactive
  mode. In this mode, it acts as its own command shell, which
  remembers which sublevel you are currently in and allows for rapid
  and convenient execution of multiple commands within the same
  sublevel. This mode also has full tab completion, as well as
  built-in interactive help and syntax highlighting.
</p>
</li>
</ul></div>
<div class="paragraph"><p>Here are a few examples of using <code>crm</code> both as a command-line tool and
as an interactive shell:</p></div>
<div class="literalblock">
<div class="title">Command line (one-shot) use:</div>
<div class="content">
<pre><code># crm resource stop www_app</code></pre>
</div></div>
<div class="literalblock">
<div class="title">Interactive use:</div>
<div class="content">
<pre><code># crm
crm(live)# resource
crm(live)resource# unmanage tetris_1
crm(live)resource# up
crm(live)# node standby node4</code></pre>
</div></div>
<div class="literalblock">
<div class="title">Cluster configuration:</div>
<div class="content">
<pre><code># crm configure&lt;&lt;EOF
  #
  # resources
  #
  primitive disk0 iscsi \
    params portal=192.168.2.108:3260 target=iqn.2008-07.com.suse:disk0
  primitive fs0 Filesystem \
    params device=/dev/disk/by-label/disk0 directory=/disk0 fstype=ext3
  primitive internal_ip IPaddr params ip=192.168.1.101
  primitive apache apache \
    params configfile=/disk0/etc/apache2/site0.conf
  primitive apcfence stonith:apcsmart \
    params ttydev=/dev/ttyS0 hostlist="node1 node2" \
    op start timeout=60s
  primitive pingd pingd \
    params name=pingd dampen=5s multiplier=100 host_list="r1 r2"
  #
  # monitor apache and the UPS
  #
  monitor apache 60s:30s
  monitor apcfence 120m:60s
  #
  # cluster layout
  #
  group internal_www \
    disk0 fs0 internal_ip apache
  clone fence apcfence \
    meta globally-unique=false clone-max=2 clone-node-max=1
  clone conn pingd \
    meta globally-unique=false clone-max=2 clone-node-max=1
  location node_pref internal_www \
    rule 50: #uname eq node1 \
    rule pingd: defined pingd
  #
  # cluster properties
  #
  property stonith-enabled=true
  commit
EOF</code></pre>
</div></div>
<div class="paragraph"><p>The <code>crm</code> interface is hierarchical, with commands organized into
separate levels by functionality. To list the available levels and
commands, either execute <code>help &lt;level&gt;</code>, or, if at the top level of
the shell, simply typing <code>help</code> will provide an overview of all
available levels and commands.</p></div>
<div class="paragraph"><p>The <code>(live)</code> string in the <code>crm</code> prompt signifies that the current CIB
in use is the cluster live configuration. It is also possible to
work with so-called <a href="#topics_Features_Shadows">shadow CIBs</a>. These are separate, inactive
configurations stored in files, that can be applied and thereby
replace the live configuration at any time.</p></div>
</div>
<div class="sect2">
<h3 id="topics_Introduction_Completion">Tab completion</h3>
<div class="paragraph"><p>The <code>crm</code> makes extensive use of tab completion. The completion
is both static (i.e. for <code>crm</code> commands) and dynamic. The latter
takes into account the current status of the cluster or
information from installed resource agents. Sometimes, completion
may also be used to get short help on resource parameters. Here
are a few examples:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>crm(live)resource# &lt;TAB&gt;&lt;TAB&gt;
bye           failcount     move          restart       unmigrate
cd            help          param         show          unmove
cleanup       list          promote       start         up
demote        manage        quit          status        utilization
end           meta          refresh       stop
exit          migrate       reprobe       unmanage

crm(live)configure# primitive fence-1 &lt;TAB&gt;&lt;TAB&gt;
heartbeat:  lsb:    ocf:    stonith:

crm(live)configure# primitive fence-1 stonith:&lt;TAB&gt;&lt;TAB&gt;
apcmaster                external/ippower9258     fence_legacy
apcmastersnmp            external/kdumpcheck      ibmhmc
apcsmart                 external/libvirt         ipmilan

crm(live)configure# primitive fence-1 stonith:ipmilan params &lt;TAB&gt;&lt;TAB&gt;
auth=      hostname=  ipaddr=    login=     password=  port=      priv=

crm(live)configure# primitive fence-1 stonith:ipmilan params auth=&lt;TAB&gt;&lt;TAB&gt;
auth* (string)
    The authorization type of the IPMI session ("none", "straight", "md2", or "md5")</code></pre>
</div></div>
<div class="paragraph"><p><code>crmsh</code> also comes with bash completion usable directly from the
system shell. This should be installed automatically with the command
itself.</p></div>
</div>
<div class="sect2">
<h3 id="topics_Introduction_Shorthand">Shorthand syntax</h3>
<div class="paragraph"><p>When using the <code>crm</code> shell to manage clusters, you will end up typing
a lot of commands many times over. Clear command names like
<code>configure</code> help in understanding and learning to use the cluster
shell, but is easy to misspell and is tedious to type repeatedly. The
interactive mode and tab completion both help with this, but the <code>crm</code>
shell also has the ability to understand a variety of shorthand
aliases for all of the commands.</p></div>
<div class="paragraph"><p>For example, instead of typing <code>crm status</code>, you can type <code>crm st</code> or
<code>crm stat</code>. Instead of <code>crm configure</code> you can type <code>crm cfg</code> or even
<code>crm cf</code>. <code>crm resource</code> can be shorted as <code>crm rsc</code>, and so on.</p></div>
<div class="paragraph"><p>The exact list of accepted aliases is too long to print in full, but
experimentation and typoes should help in discovering more of them.</p></div>
</div>
</div>
</div>
<div class="sect1">
<h2 id="topics_Features">Features</h2>
<div class="sectionbody">
<div class="paragraph"><p>The feature set of crmsh covers a wide range of functionality, and
understanding how and when to use the various features of the shell
can be difficult. This section of the guide describes some of the
features and use cases of <code>crmsh</code> in more depth. The intention is to
provide a deeper understanding of these features, but also to serve as
a guide to using them.</p></div>
<div class="sect2">
<h3 id="topics_Features_Shadows">Shadow CIB usage</h3>
<div class="paragraph"><p>A Shadow CIB is a normal cluster configuration stored in a file.
They may be manipulated in much the same way as the <em>live</em> CIB, with
the key difference that changes to a shadow CIB have no effect on the
actual cluster resources. An administrator may choose to apply any of
them to the cluster, thus replacing the running configuration with the
one found in the shadow CIB.</p></div>
<div class="paragraph"><p>The <code>crm</code> prompt always contains the name of the configuration which
is currently in use, or the string <em>live</em> if using the live cluster
configuration.</p></div>
<div class="paragraph"><p>When editing the configuration in the <code>configure</code> level, no changes
are actually applied until the <code>commit</code> command is executed. It is
possible to start editing a configuration as usual, but instead of
committing the changes to the active CIB, save them to a shadow CIB.</p></div>
<div class="paragraph"><p>The following example <code>configure</code> session demonstrates how this can be
done:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>crm(live)configure# cib new test-2
INFO: test-2 shadow CIB created
crm(test-2)configure# commit</code></pre>
</div></div>
</div>
<div class="sect2">
<h3 id="topics_Features_Checks">Configuration semantic checks</h3>
<div class="paragraph"><p>Resource definitions may be checked against the meta-data
provided with the resource agents. These checks are currently
carried out:</p></div>
<div class="ulist"><ul>
<li>
<p>
are required parameters set
</p>
</li>
<li>
<p>
existence of defined parameters
</p>
</li>
<li>
<p>
timeout values for operations
</p>
</li>
</ul></div>
<div class="paragraph"><p>The parameter checks are obvious and need no further explanation.
Failures in these checks are treated as configuration errors.</p></div>
<div class="paragraph"><p>The timeouts for operations should be at least as long as those
recommended in the meta-data. Too short timeout values are a
common mistake in cluster configurations and, even worse, they
often slip through if cluster testing was not thorough. Though
operation timeouts issues are treated as warnings, make sure that
the timeouts are usable in your environment. Note also that the
values given are just <em>advisory minimum</em>---your resources may
require longer timeouts.</p></div>
<div class="paragraph"><p>User may tune the frequency of checks and the treatment of errors
by the <a href="#cmdhelp_options_check-frequency"><code>check-frequency</code></a> and
<a href="#cmdhelp_options_check-mode"><code>check-mode</code></a> preferences.</p></div>
<div class="paragraph"><p>Note that if the <code>check-frequency</code> is set to <code>always</code> and the
<code>check-mode</code> to <code>strict</code>, errors are not tolerated and such
configuration cannot be saved.</p></div>
</div>
<div class="sect2">
<h3 id="topics_Features_Templates">Configuration templates</h3>
<div class="sidebarblock">
<div class="content">
<div class="title">Deprecation note</div>
<div class="paragraph"><p>Configuration templates have been deprecated in favor of the more
capable <code>cluster scripts</code>. To learn how to use cluster scripts, see
the dedicated documentation on the <code>crmsh</code> website at
<a href="http://crmsh.github.io/">http://crmsh.github.io/</a>, or in the <a href="#cmdhelp_script">Script section</a>.</p></div>
</div></div>
<div class="paragraph"><p>Configuration templates are ready made configurations created by
cluster experts. They are designed in such a way so that users
may generate valid cluster configurations with minimum effort.
If you are new to Pacemaker, templates may be the best way to
start.</p></div>
<div class="paragraph"><p>We will show here how to create a simple yet functional Apache
configuration:</p></div>
<div class="literalblock">
<div class="content">
<pre><code># crm configure
crm(live)configure# template
crm(live)configure template# list templates
apache       filesystem   virtual-ip
crm(live)configure template# new web &lt;TAB&gt;&lt;TAB&gt;
apache       filesystem   virtual-ip
crm(live)configure template# new web apache
INFO: pulling in template apache
INFO: pulling in template virtual-ip
crm(live)configure template# list
web2-d       web2     vip2     web3     vip      web</code></pre>
</div></div>
<div class="paragraph"><p>We enter the <code>template</code> level from <code>configure</code>. Use the <code>list</code>
command to show templates available on the system. The <code>new</code>
command creates a configuration from the <code>apache</code> template. You
can use tab completion to pick templates. Note that the apache
template depends on a virtual IP address which is automatically
pulled along. The <code>list</code> command shows the just created <code>web</code>
configuration, among other configurations (I hope that you,
unlike me, will use more sensible and descriptive names).</p></div>
<div class="paragraph"><p>The <code>show</code> command, which displays the resulting configuration,
may be used to get an idea about the minimum required changes
which have to be done. All <code>ERROR</code> messages show the line numbers
in which the respective parameters are to be defined:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>crm(live)configure template# show
ERROR: 23: required parameter ip not set
ERROR: 61: required parameter id not set
ERROR: 65: required parameter configfile not set
crm(live)configure template# edit</code></pre>
</div></div>
<div class="paragraph"><p>The <code>edit</code> command invokes the preferred text editor with the
<code>web</code> configuration. At the top of the file, the user is advised
how to make changes. A good template should require from the user
to specify only parameters. For example, the <code>web</code> configuration
we created above has the following required and optional
parameters (all parameter lines start with <code>%%</code>):</p></div>
<div class="literalblock">
<div class="content">
<pre><code>$ grep -n ^%% ~/.crmconf/web
23:%% ip
31:%% netmask
35:%% lvs_support
61:%% id
65:%% configfile
71:%% options
76:%% envfiles</code></pre>
</div></div>
<div class="paragraph"><p>These lines are the only ones that should be modified. Simply
append the parameter value at the end of the line. For instance,
after editing this template, the result could look like this (we
used tabs instead of spaces to make the values stand out):</p></div>
<div class="literalblock">
<div class="content">
<pre><code>$ grep -n ^%% ~/.crmconf/web
23:%% ip        192.168.1.101
31:%% netmask
35:%% lvs_support
61:%% id        websvc
65:%% configfile    /etc/apache2/httpd.conf
71:%% options
76:%% envfiles</code></pre>
</div></div>
<div class="paragraph"><p>As you can see, the parameter line format is very simple:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>%% &lt;name&gt; &lt;value&gt;</code></pre>
</div></div>
<div class="paragraph"><p>After editing the file, use <code>show</code> again to display the
configuration:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>crm(live)configure template# show
primitive virtual-ip IPaddr \
    params ip=192.168.1.101
primitive apache apache \
    params configfile="/etc/apache2/httpd.conf"
monitor apache 120s:60s
group websvc \
    apache virtual-ip</code></pre>
</div></div>
<div class="paragraph"><p>The target resource of the apache template is a group which we
named <code>websvc</code> in this sample session.</p></div>
<div class="paragraph"><p>This configuration looks exactly as you could type it at the
<code>configure</code> level. The point of templates is to save you some
typing. It is important, however, to understand the configuration
produced.</p></div>
<div class="paragraph"><p>Finally, the configuration may be applied to the current
crm configuration (note how the configuration changed slightly,
though it is still equivalent, after being digested at the
<code>configure</code> level):</p></div>
<div class="literalblock">
<div class="content">
<pre><code>crm(live)configure template# apply
crm(live)configure template# cd ..
crm(live)configure# show
node xen-b
node xen-c
primitive apache apache \
    params configfile="/etc/apache2/httpd.conf" \
    op monitor interval=120s timeout=60s
primitive virtual-ip IPaddr \
    params ip=192.168.1.101
group websvc apache virtual-ip</code></pre>
</div></div>
<div class="paragraph"><p>Note that this still does not commit the configuration to the CIB
which is used in the shell, either the running one (<code>live</code>) or
some shadow CIB. For that you still need to execute the <code>commit</code>
command.</p></div>
<div class="paragraph"><p>To complete our example, we should also define the preferred node
to run the service:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>crm(live)configure# location websvc-pref websvc 100: xen-b</code></pre>
</div></div>
<div class="paragraph"><p>If you are not happy with some resource names which are provided
by default, you can rename them now:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>crm(live)configure# rename virtual-ip intranet-ip
crm(live)configure# show
node xen-b
node xen-c
primitive apache apache \
    params configfile="/etc/apache2/httpd.conf" \
    op monitor interval=120s timeout=60s
primitive intranet-ip IPaddr \
    params ip=192.168.1.101
group websvc apache intranet-ip
location websvc-pref websvc 100: xen-b</code></pre>
</div></div>
<div class="paragraph"><p>To summarize, working with templates typically consists of the
following steps:</p></div>
<div class="ulist"><ul>
<li>
<p>
<code>new</code>: create a new configuration from templates
</p>
</li>
<li>
<p>
<code>edit</code>: define parameters, at least the required ones
</p>
</li>
<li>
<p>
<code>show</code>: see if the configuration is valid
</p>
</li>
<li>
<p>
<code>apply</code>: apply the configuration to the <code>configure</code> level
</p>
</li>
</ul></div>
</div>
<div class="sect2">
<h3 id="topics_Features_Testing">Resource testing</h3>
<div class="paragraph"><p>The amount of detail in a cluster makes all configurations prone
to errors. By far the largest number of issues in a cluster is
due to bad resource configuration. The shell can help quickly
diagnose such problems. And considerably reduce your keyboard
wear.</p></div>
<div class="paragraph"><p>Let&#8217;s say that we entered the following configuration:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>node xen-b
node xen-c
node xen-d
primitive fencer stonith:external/libvirt \
    params hypervisor_uri="qemu+tcp://10.2.13.1/system" \
        hostlist="xen-b xen-c xen-d" \
    op monitor interval=2h
primitive svc Xinetd \
    params service=systat \
    op monitor interval=30s
primitive intranet-ip IPaddr2 \
    params ip=10.2.13.100 \
    op monitor interval=30s
primitive apache apache \
    params configfile="/etc/apache2/httpd.conf" \
    op monitor interval=120s timeout=60s
group websvc apache intranet-ip
location websvc-pref websvc 100: xen-b</code></pre>
</div></div>
<div class="paragraph"><p>Before typing <code>commit</code> to submit the configuration to the cib we
can make sure that all resources are usable on all nodes:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>crm(live)configure# rsctest websvc svc fencer</code></pre>
</div></div>
<div class="paragraph"><p>It is important that resources being tested are not running on
any nodes. Otherwise, the <code>rsctest</code> command will refuse to do
anything. Of course, if the current configuration resides in a
CIB shadow, then a <code>commit</code> is irrelevant. The point being that
resources are not running on any node.</p></div>
<div class="sidebarblock">
<div class="content">
<div class="title">Note on stopping all resources</div>
<div class="paragraph"><p>Alternatively to not committing a configuration, it is also
possible to tell Pacemaker not to start any resources:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>crm(live)configure# property stop-all-resources=yes</code></pre>
</div></div>
<div class="paragraph"><p>Almost none---resources of class stonith are still started. But
shell is not as strict when it comes to stonith resources.</p></div>
</div></div>
<div class="paragraph"><p>Order of resources is significant insofar that a resource depends
on all resources to its left. In most configurations, it&#8217;s
probably practical to test resources in several runs, based on
their dependencies.</p></div>
<div class="paragraph"><p>Apart from groups, <code>crm</code> does not interpret constraints and
therefore knows nothing about resource dependencies. It also
doesn&#8217;t know if a resource can run on a node at all in case of an
asymmetric cluster. It is up to the user to specify a list of
eligible nodes if a resource is not meant to run on every node.</p></div>
</div>
<div class="sect2">
<h3 id="topics_Features_Security">Access Control Lists (ACL)</h3>
<div class="sidebarblock">
<div class="content">
<div class="title">Note on ACLs in Pacemaker 1.1.12</div>
<div class="paragraph"><p>The support for ACLs has been revised in Pacemaker version 1.1.12 and
up. Depending on which version you are using, the information in this
section may no longer be accurate. Look for the <code>acl_target</code>
configuration element for more details on the new syntax.</p></div>
</div></div>
<div class="paragraph"><p>By default, the users from the <code>haclient</code> group have full access
to the cluster (or, more precisely, to the CIB). Access control
lists allow for finer access control to the cluster.</p></div>
<div class="paragraph"><p>Access control lists consist of an ordered set of access rules.
Each rule allows read or write access or denies access
completely. Rules are typically combined to produce a specific
role. Then, users may be assigned a role.</p></div>
<div class="paragraph"><p>For instance, this is a role which defines a set of rules
allowing management of a single resource:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>role bigdb_admin \
    write meta:bigdb:target-role \
    write meta:bigdb:is-managed \
    write location:bigdb \
    read ref:bigdb</code></pre>
</div></div>
<div class="paragraph"><p>The first two rules allow modifying the <code>target-role</code> and
<code>is-managed</code> meta attributes which effectively enables users in
this role to stop/start and manage/unmanage the resource. The
constraints write access rule allows moving the resource around.
Finally, the user is granted read access to the resource
definition.</p></div>
<div class="paragraph"><p>For proper operation of all Pacemaker programs, it is advisable
to add the following role to all users:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>role read_all \
    read cib</code></pre>
</div></div>
<div class="paragraph"><p>For finer grained read access try with the rules listed in the
following role:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>role basic_read \
    read node attribute:uname \
    read node attribute:type \
    read property \
    read status</code></pre>
</div></div>
<div class="paragraph"><p>It is however possible that some Pacemaker programs (e.g.
<code>ptest</code>) may not function correctly if the whole CIB is not
readable.</p></div>
<div class="paragraph"><p>Some of the ACL rules in the examples above are expanded by the
shell to XPath specifications. For instance,
<code>meta:bigdb:target-role</code> expands to:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>//primitive[@id='bigdb']/meta_attributes/nvpair[@name='target-role']</code></pre>
</div></div>
<div class="paragraph"><p>You can see the expansion by showing XML:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>crm(live) configure# show xml bigdb_admin
...
&lt;acls&gt;
  &lt;acl_role id="bigdb_admin"&gt;
      &lt;write id="bigdb_admin-write"
      xpath="//primitive[@id='bigdb']/meta_attributes/nvpair[@name='target-role']"/&gt;</code></pre>
</div></div>
<div class="paragraph"><p>Many different XPath expressions can have equal meaning. For
instance, the following two are equal, but only the first one is
going to be recognized as shortcut:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>//primitive[@id='bigdb']/meta_attributes/nvpair[@name='target-role']
//resources/primitive[@id='bigdb']/meta_attributes/nvpair[@name='target-role']</code></pre>
</div></div>
<div class="paragraph"><p>XPath is a powerful language, but you should try to keep your ACL
xpaths simple and the builtin shortcuts should be used whenever
possible.</p></div>
</div>
<div class="sect2">
<h3 id="topics_Features_Resourcesets">Syntax: Resource sets</h3>
<div class="paragraph"><p>Using resource sets can be a bit confusing unless one knows the
details of the implementation in Pacemaker as well as how to interpret
the syntax provided by <code>crmsh</code>.</p></div>
<div class="paragraph"><p>Three different types of resource sets are provided by <code>crmsh</code>, and
each one implies different values for the two resource set attributes,
<code>sequential</code> and <code>require-all</code>.</p></div>
<div class="dlist"><dl>
<dt class="hdlist1">
<code>sequential</code>
</dt>
<dd>
<p>
  If false, the resources in the set do not depend on each other
  internally. Setting <code>sequential</code> to <code>true</code> implies a strict order of
  dependency within the set.
</p>
</dd>
<dt class="hdlist1">
<code>require-all</code>
</dt>
<dd>
<p>
  If false, only one resource in the set is required to fulfil the
  requirements of the set. The set of A, B and C with <code>require-all</code>
  set to <code>false</code> is be read as "A OR B OR C" when its dependencies
  are resolved.
</p>
</dd>
</dl></div>
<div class="paragraph"><p>The three types of resource sets modify the attributes in the
following way:</p></div>
<div class="olist arabic"><ol class="arabic">
<li>
<p>
Implicit sets (no brackets). <code>sequential=true</code>, <code>require-all=true</code>
</p>
</li>
<li>
<p>
Parenthesis set (<code>(</code> &#8230; <code>)</code>). <code>sequential=false</code>, <code>require-all=true</code>
</p>
</li>
<li>
<p>
Bracket set (<code>[</code> &#8230; <code>]</code>). <code>sequential=false</code>, <code>require-all=false</code>
</p>
</li>
</ol></div>
<div class="paragraph"><p>To create a set with the properties <code>sequential=true</code> and
<code>require-all=false</code>, explicitly set <code>sequential</code> in a bracketed set,
<code>[ A B C sequential=true ]</code>.</p></div>
<div class="paragraph"><p>To create multiple sets with both <code>sequential</code> and <code>require-all</code> set to
true, explicitly set <code>sequential</code> in a parenthesis set:
<code>A B ( C D sequential=true )</code>.</p></div>
</div>
<div class="sect2">
<h3 id="topics_Features_AttributeListReferences">Syntax: Attribute list references</h3>
<div class="paragraph"><p>Attribute lists are used to set attributes and parameters for
resources, constraints and property definitions. For example, to set
the virtual IP used by an <code>IPAddr2</code> resource the attribute <code>ip</code> can be
set in an attribute list for that resource.</p></div>
<div class="paragraph"><p>Attribute lists can have identifiers that name them, and other
resources can reuse the same attribute list by referring to that name
using an <code>$id-ref</code>. For example, the following statement defines a
simple dummy resource with an attribute list which sets the parameter
<code>state</code> to the value 1 and sets the identifier for the attribute list
to <code>on-state</code>:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>primitive dummy-1 Dummy params $id=on-state state=1</code></pre>
</div></div>
<div class="paragraph"><p>To refer to this attribute list from a different resource, refer to
the <code>on-state</code> name using an id-ref:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>primitive dummy-2 Dummy params $id-ref=on-state</code></pre>
</div></div>
<div class="paragraph"><p>The resource <code>dummy-2</code> will now also have the parameter <code>state</code> set to the value 1.</p></div>
</div>
<div class="sect2">
<h3 id="topics_Features_AttributeReferences">Syntax: Attribute references</h3>
<div class="paragraph"><p>In some cases, referencing complete attribute lists is too
coarse-grained, for example if two different parameters with different
names should have the same value set. Instead of having to copy the
value in multiple places, it is possible to create references to
individual attributes in attribute lists.</p></div>
<div class="paragraph"><p>To name an attribute in order to be able to refer to it later, prefix
the attribute name with a <code>$</code> character (as seen above with the
special names <code>$id</code> and <code>$id-ref</code>:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>primitive dummy-1 Dummy params $state=1</code></pre>
</div></div>
<div class="paragraph"><p>The identifier <code>state</code> can now be used to refer to this attribute from other
primitives, using the <code>@&lt;id&gt;</code> syntax:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>primitive dummy-2 Dummy params @state</code></pre>
</div></div>
<div class="paragraph"><p>In some cases, using the attribute name as the identifier doesn&#8217;t work
due to name clashes. In this case, the syntax <code>$&lt;id&gt;:&lt;name&gt;=&lt;value&gt;</code>
can be used to give the attribute a different identifier:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>primitive dummy-1 params $dummy-state-on:state=1
primitive dummy-2 params @dummy-state-on</code></pre>
</div></div>
<div class="paragraph"><p>There is also the possibility that two resources both use the same
attribute value but with different names. For example, a web server
may have a parameter <code>server_ip</code> for setting the IP address where it
listens for incoming requests, and a virtual IP resource may have a
parameter called <code>ip</code> which sets the IP address it creates. To
configure these two resources with an IP without repeating the value,
the reference can be given a name using the syntax <code>@&lt;id&gt;:&lt;name&gt;</code>.</p></div>
<div class="paragraph"><p>Example:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>primitive virtual-ip IPaddr2 params $vip:ip=192.168.1.100
primitive webserver apache params @vip:server_ip</code></pre>
</div></div>
</div>
<div class="sect2">
<h3 id="topics_Syntax_RuleExpressions">Syntax: Rule expressions</h3>
<div class="paragraph"><p>Many of the configuration commands in <code>crmsh</code> now support the use of
<em>rule expressions</em>, which can influence what attributes apply to a
resource or under which conditions a constraint is applied, depending
on changing conditions like date, time, the value of attributes and
more.</p></div>
<div class="paragraph"><p>Here is an example of a simple rule expression used to apply a
a different resource parameter on the node named <code>node1</code>:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>primitive my_resource Special \
  params 2: rule #uname eq node1 interface=eth1 \
  params 1: interface=eth0</code></pre>
</div></div>
<div class="paragraph"><p>This primitive resource has two lists of parameters with descending
priority. The parameter list with the highest priority is applied
first, but only if the rule expressions for that parameter list all
apply. In this case, the rule <code>#uname eq node1</code> limits the parameter
list so that it is only applied on <code>node1</code>.</p></div>
<div class="paragraph"><p>Note that rule expressions are not terminated and are immediately
followed by the data to which the rule is applied. In this case, the
name-value pair <code>interface=eth1</code>.</p></div>
<div class="paragraph"><p>Rule expressions can contain multiple expressions connected using the
boolean operator <code>or</code> and <code>and</code>. The full syntax for rule expressions
is listed below.</p></div>
<div class="literalblock">
<div class="content">
<pre><code>rules ::
  rule [id_spec] [$role=&lt;role&gt;] &lt;score&gt;: &lt;expression&gt;
  [rule [id_spec] [$role=&lt;role&gt;] &lt;score&gt;: &lt;expression&gt; ...]

id_spec :: $id=&lt;id&gt; | $id-ref=&lt;id&gt;
score :: &lt;number&gt; | &lt;attribute&gt; | [-]inf
expression :: &lt;simple_exp&gt; [&lt;bool_op&gt; &lt;simple_exp&gt; ...]
bool_op :: or | and
simple_exp :: &lt;attribute&gt; [type:]&lt;binary_op&gt; &lt;value&gt;
          | &lt;unary_op&gt; &lt;attribute&gt;
          | date &lt;date_expr&gt;
type :: &lt;string&gt; | &lt;version&gt; | &lt;number&gt;
binary_op :: lt | gt | lte | gte | eq | ne
unary_op :: defined | not_defined

date_expr :: lt &lt;end&gt;
         | gt &lt;start&gt;
         | in start=&lt;start&gt; end=&lt;end&gt;
         | in start=&lt;start&gt; &lt;duration&gt;
         | spec &lt;date_spec&gt;
duration|date_spec ::
         hours=&lt;value&gt;
         | monthdays=&lt;value&gt;
         | weekdays=&lt;value&gt;
         | yearsdays=&lt;value&gt;
         | months=&lt;value&gt;
         | weeks=&lt;value&gt;
         | years=&lt;value&gt;
         | weekyears=&lt;value&gt;
         | moon=&lt;value&gt;</code></pre>
</div></div>
</div>
</div>
</div>
<div class="sect1">
<h2 id="topics_Reference">Command reference</h2>
<div class="sectionbody">
<div class="paragraph"><p>The commands are structured to be compatible with the shell command
line. Sometimes, the underlying Pacemaker grammar uses characters that
have special meaning in bash, that will need to be quoted. This
includes the hash or pound sign (<code>#</code>), single and double quotes, and
any significant whitespace.</p></div>
<div class="paragraph"><p>Whitespace is also significant when assigning values, meaning that
<code>key=value</code> is different from <code>key = value</code>.</p></div>
<div class="paragraph"><p>Commands can be referenced using short-hand as long as the short-hand
is unique. This can be either a prefix of the command name or a prefix
string of characters found in the name.</p></div>
<div class="paragraph"><p>For example, <code>status</code> can be abbreviated as <code>st</code> or <code>su</code>, and
<code>configure</code> as <code>conf</code> or <code>cfg</code>.</p></div>
<div class="paragraph"><p>The syntax for the commands is given below in an informal, BNF-like
grammar.</p></div>
<div class="ulist"><ul>
<li>
<p>
<code>&lt;value&gt;</code> denotes a string.
</p>
</li>
<li>
<p>
<code>[value]</code> means that the construct is optional.
</p>
</li>
<li>
<p>
The ellipsis (<code>...</code>) signifies that the previous construct may be
  repeated.
</p>
</li>
<li>
<p>
<code>first|second</code> means either first or second.
</p>
</li>
<li>
<p>
The rest are literals (strings, <code>:</code>, <code>=</code>).
</p>
</li>
</ul></div>
<div class="sect2">
<h3 id="cmdhelp_root_status"><code>status</code></h3>
<div class="paragraph"><p>Show cluster status. The status is displayed by <code>crm_mon</code>. Supply
additional arguments for more information or different format.
See <code>crm_mon(8)</code> for more details.</p></div>
<div class="paragraph"><p>Example:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>status
status simple
status full</code></pre>
</div></div>
<div class="paragraph"><p>Usage:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>status [&lt;option&gt; ...]

option :: full
        | bynode
        | inactive
        | ops
        | timing
        | failcounts
        | verbose
        | quiet
        | html
        | xml
        | simple
        | tickets
        | noheaders
        | detail
        | brief</code></pre>
</div></div>
</div>
<div class="sect2">
<h3 id="cmdhelp_root_verify"><code>verify</code></h3>
<div class="paragraph"><p>Performs basic checks for the cluster configuration and
current status, reporting potential issues.</p></div>
<div class="paragraph"><p>See <code>crm_verify(8)</code> and <code>crm_simulate(8)</code> for more details.</p></div>
<div class="paragraph"><p>Example:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>verify
verify scores</code></pre>
</div></div>
<div class="paragraph"><p>Usage:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>verify [scores]</code></pre>
</div></div>
</div>
<div class="sect2">
<h3 id="cmdhelp_cluster"><code>cluster</code> - Cluster setup and management</h3>
<div class="paragraph"><p>Whole-cluster configuration management with High Availability
awareness.</p></div>
<div class="paragraph"><p>The commands on the cluster level allows configuration and
modification of the underlying cluster infrastructure, and also
supplies tools to do whole-cluster systems management.</p></div>
<div class="paragraph"><p>These commands enable easy installation and maintenance of a HA
cluster, by providing support for package installation, configuration
of the cluster messaging layer, file system setup and more.</p></div>
<div class="sect3">
<h4 id="cmdhelp_cluster_add"><code>add</code></h4>
<div class="paragraph"><p>Add a new node to the cluster. The new node will be
configured as a cluster member.</p></div>
<div class="paragraph"><p>Options:</p></div>
<div class="dlist"><dl>
<dt class="hdlist1">
<strong>-y, --yes</strong>
</dt>
<dd>
<p>
    Answer "yes" to all prompts (use with caution)
</p>
</dd>
</dl></div>
<div class="paragraph"><p>Usage:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>add [options] [&lt;node&gt; ...]</code></pre>
</div></div>
</div>
<div class="sect3">
<h4 id="cmdhelp_cluster_copy"><code>copy</code></h4>
<div class="paragraph"><p>Copy file to other cluster nodes.</p></div>
<div class="paragraph"><p>Copies the given file to all other nodes unless given a
list of nodes to copy to as argument.</p></div>
<div class="paragraph"><p>Usage:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>copy &lt;filename&gt; [nodes ...]</code></pre>
</div></div>
<div class="paragraph"><p>Example:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>copy /etc/motd</code></pre>
</div></div>
</div>
<div class="sect3">
<h4 id="cmdhelp_cluster_diff"><code>diff</code></h4>
<div class="paragraph"><p>Displays the difference, if any, between a given file
on different nodes. If the second argument is <code>--checksum</code>,
a checksum of the file will be calculated and displayed for
each node.</p></div>
<div class="paragraph"><p>Usage:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>diff &lt;file&gt; [--checksum] [nodes...]</code></pre>
</div></div>
<div class="paragraph"><p>Example:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>diff /etc/crm/crm.conf node2
diff /etc/resolv.conf --checksum</code></pre>
</div></div>
</div>
<div class="sect3">
<h4 id="cmdhelp_cluster_geo_init"><code>geo-init</code></h4>
<div class="paragraph"><p>Create a new geo cluster with the current cluster as the
first member. Pass the complete geo cluster topology as
arguments to this command, and then use <code>geo-join</code> and
<code>geo-init-arbitrator</code> to add the remaining members to
the geo cluster.</p></div>
<div class="paragraph"><p>Options:</p></div>
<div class="dlist"><dl>
<dt class="hdlist1">
<strong>-q, --quiet</strong>
</dt>
<dd>
<p>
    Be quiet (don&#8217;t describe what&#8217;s happening, just do it)
</p>
</dd>
<dt class="hdlist1">
<strong>-y, --yes</strong>
</dt>
<dd>
<p>
    Answer "yes" to all prompts (use with caution)
</p>
</dd>
<dt class="hdlist1">
<strong>--arbitrator=IP</strong>
</dt>
<dd>
<p>
    IP address of geo cluster arbitrator
</p>
</dd>
<dt class="hdlist1">
<strong>--clusters=DESC</strong>
</dt>
<dd>
<p>
    Cluster description (see details below)
</p>
</dd>
<dt class="hdlist1">
<strong>--tickets=LIST</strong>
</dt>
<dd>
<p>
    Tickets to create (space-separated)
</p>
</dd>
</dl></div>
<div class="paragraph"><p>Cluster Description:</p></div>
<div class="paragraph"><p>This is a map of cluster names to IP addresses.
Each IP address will be configured as a virtual IP
representing that cluster in the geo cluster
configuration.</p></div>
<div class="paragraph"><p>Example with two clusters named paris and amsterdam:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>  --clusters "paris=192.168.10.10 amsterdam=192.168.10.11"</code></pre>
</div></div>
<div class="paragraph"><p>Name clusters using the <code>--name</code> parameter to <code>init</code>.</p></div>
<div class="paragraph"><p>Usage:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>geo-init [options]</code></pre>
</div></div>
</div>
<div class="sect3">
<h4 id="cmdhelp_cluster_geo_init_arbitrator"><code>geo-init-arbitrator</code></h4>
<div class="paragraph"><p>Configure the current node as a geo arbitrator. The command
requires an existing geo cluster or geo arbitrator from which
to get the geo cluster configuration.</p></div>
<div class="paragraph"><p>Options:</p></div>
<div class="dlist"><dl>
<dt class="hdlist1">
<strong>--clusters=DESC</strong>
</dt>
<dd>
<p>
    Cluster description (see <code>geo-init</code> for details)
</p>
</dd>
<dt class="hdlist1">
<strong>-c IP, --cluster-node=IP</strong>
</dt>
<dd>
<p>
    IP address of an already-configured geo cluster
</p>
</dd>
</dl></div>
<div class="paragraph"><p>Usage:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>geo-init-arbitrator [options]</code></pre>
</div></div>
</div>
<div class="sect3">
<h4 id="cmdhelp_cluster_geo_join"><code>geo-join</code></h4>
<div class="paragraph"><p>This command should be run from one of the nodes in a cluster
which is currently not a member of a geo cluster. The geo
cluster configuration will be fetched from the provided node,
and the cluster will be added to the geo cluster.</p></div>
<div class="paragraph"><p>Note that each cluster in a geo cluster needs to have a unique
name set. The cluster name can be set using the <code>--name</code> argument
to <code>init</code>, or by configuring corosync with the cluster name in
an existing cluster.</p></div>
<div class="paragraph"><p>Options:</p></div>
<div class="dlist"><dl>
<dt class="hdlist1">
<strong>-c IP, --cluster-node=IP</strong>
</dt>
<dd>
<p>
    IP address of an already-configured geo cluster or arbitrator
</p>
</dd>
</dl></div>
<div class="paragraph"><p>Usage:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>geo-join [options]</code></pre>
</div></div>
</div>
<div class="sect3">
<h4 id="cmdhelp_cluster_health"><code>health</code></h4>
<div class="paragraph"><p>Runs a larger set of tests and queries on all nodes in the cluster to
verify the general system health and detect potential problems.</p></div>
<div class="paragraph"><p>Usage:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>health</code></pre>
</div></div>
</div>
<div class="sect3">
<h4 id="cmdhelp_cluster_init"><code>init</code></h4>
<div class="paragraph"><p>Initialize a cluster from scratch. This command configures
a complete cluster, and can also add additional cluster
nodes to the initial one-node cluster using the <code>--nodes</code>
option.</p></div>
<div class="paragraph"><p>Options:</p></div>
<div class="dlist"><dl>
<dt class="hdlist1">
<strong>-q, --quiet</strong>
</dt>
<dd>
<p>
    Be quiet (don&#8217;t describe what&#8217;s happening, just do it)
</p>
</dd>
<dt class="hdlist1">
<strong>-y, --yes</strong>
</dt>
<dd>
<p>
    Answer "yes" to all prompts (use with caution, this
    is destructive, especially during the "storage" stage)
</p>
</dd>
<dt class="hdlist1">
<strong>-t TEMPLATE, --template=TEMPLATE</strong>*
</dt>
<dd>
<p>
    Optionally configure cluster with template "name"
    (currently only "ocfs2" is valid here)
</p>
</dd>
<dt class="hdlist1">
<strong>-n NAME, --name=NAME</strong>
</dt>
<dd>
<p>
    Set the name of the configured cluster.
</p>
</dd>
<dt class="hdlist1">
<strong>-N NODES, --nodes=NODES</strong>
</dt>
<dd>
<p>
    Additional nodes to add to the created cluster. May
    include the current node, which will always be the
    initial cluster node.
</p>
</dd>
<dt class="hdlist1">
<strong>-w WATCHDOG, --watchdog=WATCHDOG</strong>
</dt>
<dd>
<p>
    Use the given watchdog device.
</p>
</dd>
</dl></div>
<div class="paragraph"><p>Network configuration:</p></div>
<div class="paragraph"><p>Options for configuring the network and messaging layer.</p></div>
<div class="dlist"><dl>
<dt class="hdlist1">
<strong>-i IF, --interface=IF</strong>
</dt>
<dd>
<p>
    Bind to IP address on interface IF
</p>
</dd>
<dt class="hdlist1">
<strong>-u, --unicast</strong>
</dt>
<dd>
<p>
    Configure corosync to communicate over unicast (UDP),
    and not multicast. Default is multicast unless an
    environment where multicast cannot be used is
    detected.
</p>
</dd>
<dt class="hdlist1">
<strong>-A IP, --admin-ip=IP</strong>
</dt>
<dd>
<p>
    Configure IP address as an administration virtual IP
</p>
</dd>
</dl></div>
<div class="paragraph"><p>Storage configuration:</p></div>
<div class="paragraph"><p>Options for configuring shared storage.</p></div>
<div class="dlist"><dl>
<dt class="hdlist1">
<strong>-p DEVICE, --partition-device=DEVICE</strong>
</dt>
<dd>
<p>
    Partition this shared storage device (only used in
    "storage" stage)
</p>
</dd>
<dt class="hdlist1">
<strong>-s DEVICE, --sbd-device=DEVICE</strong>
</dt>
<dd>
<p>
    Block device to use for SBD fencing
</p>
</dd>
<dt class="hdlist1">
<strong>-o DEVICE, --ocfs2-device=DEVICE</strong>
</dt>
<dd>
<p>
    Block device to use for OCFS2 (only used in "vgfs"
    stage)
</p>
</dd>
</dl></div>
<div class="paragraph"><p>Stage can be one of:</p></div>
<div class="dlist"><dl>
<dt class="hdlist1">
<strong>ssh</strong>
</dt>
<dd>
<p>
    Create SSH keys for passwordless SSH between cluster nodes
</p>
</dd>
<dt class="hdlist1">
<strong>csync2</strong>
</dt>
<dd>
<p>
    Configure csync2
</p>
</dd>
<dt class="hdlist1">
<strong>corosync</strong>
</dt>
<dd>
<p>
    Configure corosync
</p>
</dd>
<dt class="hdlist1">
<strong>storage</strong>
</dt>
<dd>
<p>
    Partition shared storage (ocfs2 template only)
</p>
</dd>
<dt class="hdlist1">
<strong>sbd</strong>
</dt>
<dd>
<p>
    Configure SBD (requires -s &lt;dev&gt;)
</p>
</dd>
<dt class="hdlist1">
<strong>cluster</strong>
</dt>
<dd>
<p>
    Bring the cluster online
</p>
</dd>
<dt class="hdlist1">
<strong>vgfs</strong>
</dt>
<dd>
<p>
    Create volume group and filesystem (ocfs2 template only, requires <code>-o &lt;dev&gt;</code>)
</p>
</dd>
<dt class="hdlist1">
<strong>admin</strong>
</dt>
<dd>
<p>
    Create administration virtual IP (optional)
</p>
</dd>
</dl></div>
<div class="admonitionblock">
<table><tr>
<td class="icon">
<div class="title">Note</div>
</td>
<td class="content">
<div class="ulist"><ul>
<li>
<p>
If stage is not specified, the script will run through each stage
  in sequence, with prompts for required information.
</p>
</li>
<li>
<p>
If using the ocfs2 template, the storage stage will partition a block
  device into two pieces, one for SBD, the remainder for OCFS2.  This is
  good for testing and demonstration, but not ideal for production.
  To use storage you have already configured, pass -s and -o to specify
  the block devices for SBD and OCFS2, and the automatic partitioning
  will be skipped.
</p>
</li>
</ul></div>
</td>
</tr></table>
</div>
<div class="paragraph"><p>Usage:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>init [options] [STAGE]</code></pre>
</div></div>
</div>
<div class="sect3">
<h4 id="cmdhelp_cluster_join"><code>join</code></h4>
<div class="paragraph"><p>Join the current node to an existing cluster. The
current node cannot be a member of a cluster already.
Pass any node in the existing cluster as the argument
to the <code>-c</code> option.</p></div>
<div class="paragraph"><p>Options:</p></div>
<div class="dlist"><dl>
<dt class="hdlist1">
<strong>-q, --quiet</strong>
</dt>
<dd>
<p>
    Be quiet (don&#8217;t describe what&#8217;s happening, just do it)
</p>
</dd>
<dt class="hdlist1">
<strong>-y, --yes</strong>
</dt>
<dd>
<p>
    Answer "yes" to all prompts (use with caution)
</p>
</dd>
<dt class="hdlist1">
<strong>-w WATCHDOG, --watchdog=WATCHDOG</strong>
</dt>
<dd>
<p>
    Use the given watchdog device
</p>
</dd>
</dl></div>
<div class="paragraph"><p>Network configuration:</p></div>
<div class="paragraph"><p>Options for configuring the network and messaging layer.</p></div>
<div class="dlist"><dl>
<dt class="hdlist1">
<strong>-c HOST, --cluster-node=HOST</strong>
</dt>
<dd>
<p>
    IP address or hostname of existing cluster node
</p>
</dd>
<dt class="hdlist1">
<strong>-i IF, --interface=IF</strong>
</dt>
<dd>
<p>
    Bind to IP address on interface IF
</p>
</dd>
</dl></div>
<div class="paragraph"><p>Stage can be one of:</p></div>
<div class="dlist"><dl>
<dt class="hdlist1">
<strong>ssh</strong>
</dt>
<dd>
<p>
    Obtain SSH keys from existing cluster node (requires -c &lt;host&gt;)
</p>
</dd>
<dt class="hdlist1">
<strong>csync2</strong>
</dt>
<dd>
<p>
    Configure csync2 (requires -c &lt;host&gt;)
</p>
</dd>
<dt class="hdlist1">
<strong>ssh_merge</strong>
</dt>
<dd>
<p>
    Merge root&#8217;s SSH known_hosts across all nodes (csync2 must
    already be configured).
</p>
</dd>
<dt class="hdlist1">
<strong>cluster</strong>
</dt>
<dd>
<p>
    Start the cluster on this node
</p>
</dd>
</dl></div>
<div class="paragraph"><p>If stage is not specified, each stage will be invoked in sequence.</p></div>
<div class="paragraph"><p>Usage:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>join [options] [STAGE]</code></pre>
</div></div>
</div>
<div class="sect3">
<h4 id="cmdhelp_cluster_remove"><code>remove</code></h4>
<div class="paragraph"><p>Remove one or more nodes from the cluster.</p></div>
<div class="paragraph"><p>This command can remove the last node in the cluster,
thus effectively removing the whole cluster. To remove
the last node, pass <code>--force</code> argument to <code>crm</code> or set
the <code>config.core.force</code> option.</p></div>
<div class="paragraph"><p>Options:</p></div>
<div class="dlist"><dl>
<dt class="hdlist1">
<strong>-q, --quiet</strong>
</dt>
<dd>
<p>
    Be quiet (don&#8217;t describe what&#8217;s happening, just do it)
</p>
</dd>
<dt class="hdlist1">
<strong>-y, --yes</strong>
</dt>
<dd>
<p>
    Answer "yes" to all prompts (use with caution)
</p>
</dd>
<dt class="hdlist1">
<strong>-c HOST, --cluster-node=HOST</strong>
</dt>
<dd>
<p>
    IP address or hostname of cluster node which will be
    removed from the cluster
</p>
</dd>
</dl></div>
<div class="paragraph"><p>Usage:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>remove [options] [&lt;node&gt; ...]</code></pre>
</div></div>
</div>
<div class="sect3">
<h4 id="cmdhelp_cluster_run"><code>run</code></h4>
<div class="paragraph"><p>This command takes a shell statement as argument, executes that
statement on all nodes in the cluster, and reports the result.</p></div>
<div class="paragraph"><p>Usage:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>run &lt;command&gt;</code></pre>
</div></div>
<div class="paragraph"><p>Example:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>run "cat /proc/uptime"</code></pre>
</div></div>
</div>
<div class="sect3">
<h4 id="cmdhelp_cluster_start"><code>start</code></h4>
<div class="paragraph"><p>Starts the cluster-related system services on this node.</p></div>
<div class="paragraph"><p>Usage:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>start</code></pre>
</div></div>
</div>
<div class="sect3">
<h4 id="cmdhelp_cluster_status"><code>status</code></h4>
<div class="paragraph"><p>Reports the status for the cluster messaging layer on the local
node.</p></div>
<div class="paragraph"><p>Usage:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>status</code></pre>
</div></div>
</div>
<div class="sect3">
<h4 id="cmdhelp_cluster_stop"><code>stop</code></h4>
<div class="paragraph"><p>Stops the cluster-related system services on this node.</p></div>
<div class="paragraph"><p>Usage:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>stop</code></pre>
</div></div>
</div>
<div class="sect3">
<h4 id="cmdhelp_cluster_wait_for_startup"><code>wait_for_startup</code></h4>
<div class="paragraph"><p>Mostly useful in scripts or automated workflows, this command will
attempt to connect to the local cluster node repeatedly. The command
will keep trying until the cluster node responds, or the <code>timeout</code>
elapses. The timeout can be changed by supplying a value in seconds as
an argument.</p></div>
<div class="paragraph"><p>Usage:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>wait_for_startup</code></pre>
</div></div>
</div>
</div>
<div class="sect2">
<h3 id="cmdhelp_script"><code>script</code> - Cluster script management</h3>
<div class="paragraph"><p>A big part of the configuration and management of a cluster is
collecting information about all cluster nodes and deploying changes
to those nodes. Often, just performing the same procedure on all nodes
will encounter problems, due to subtle differences in the
configuration.</p></div>
<div class="paragraph"><p>For example, when configuring a cluster for the first time, the
software needs to be installed and configured on all nodes before the
cluster software can be launched and configured using <code>crmsh</code>. This
process is cumbersome and error-prone, and the goal is for scripts to
make this process easier.</p></div>
<div class="paragraph"><p>Scripts are implemented using the python <code>parallax</code> package which
provides a thin wrapper on top of SSH. This allows the scripts to
function through the usual SSH channels used for system maintenance,
requiring no additional software to be installed or maintained.</p></div>
<div class="sect3">
<h4 id="cmdhelp_script_json"><code>json</code></h4>
<div class="paragraph"><p>This command provides a JSON API for the cluster scripts, intended for
use in user interface tools that want to interact with the cluster via
scripts.</p></div>
<div class="paragraph"><p>The command takes a single argument, which should be a JSON array with
the first member identifying the command to perform.</p></div>
<div class="paragraph"><p>The output is line-based: Commands that return multiple results will
return them line-by-line, ending with a terminator value: "end".</p></div>
<div class="paragraph"><p>When providing parameter values to this command, they should be
provided as nested objects, so <code>virtual-ip:ip=192.168.0.5</code> on the
command line becomes the JSON object
<code>{"virtual-ip":{"ip":"192.168.0.5"}}</code>.</p></div>
<div class="paragraph"><p>API:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>["list"]
=&gt; [{name, shortdesc, category}]

["show", &lt;name&gt;]
=&gt; [{name, shortdesc, longdesc, category, &lt;&lt;steps&gt;&gt;}]

&lt;&lt;steps&gt;&gt; := [{name, shortdesc], longdesc, required, parameters, steps}]

&lt;&lt;params&gt;&gt; := [{name, shortdesc, longdesc, required, unique, advanced,
                type, value, example}]

["verify", &lt;name&gt;, &lt;&lt;values&gt;&gt;]
=&gt; [{shortdesc, longdesc, text, nodes}]

["run", &lt;name&gt;, &lt;&lt;values&gt;&gt;]
=&gt; [{shortdesc, rc, output|error}]</code></pre>
</div></div>
</div>
<div class="sect3">
<h4 id="cmdhelp_script_list"><code>list</code></h4>
<div class="paragraph"><p>Lists the available scripts, sorted by category. Scripts that have the
special <code>Script</code> category are hidden by default, since they are mainly
used by other scripts or commands. To also show these, pass <code>all</code> as
argument.</p></div>
<div class="paragraph"><p>To get a flat list of script names, not sorted by category, pass
<code>names</code> as an extra argument.</p></div>
<div class="paragraph"><p>Usage:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>list [all] [names]</code></pre>
</div></div>
<div class="paragraph"><p>Example:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>list
list all names</code></pre>
</div></div>
</div>
<div class="sect3">
<h4 id="cmdhelp_script_run"><code>run</code></h4>
<div class="paragraph"><p>Given a list of parameter values, this command will execute the
actions specified by the cluster script. The format for the parameter
values is the same as for the <code>verify</code> command.</p></div>
<div class="paragraph"><p>Can optionally take at least two parameters:
* <code>nodes=&lt;nodes&gt;</code>: List of nodes that the script runs over
* <code>dry_run=yes|no</code>: If set, the script will not perform any modifications.</p></div>
<div class="paragraph"><p>Additional parameters may be available depending on the script.</p></div>
<div class="paragraph"><p>Use the <code>show</code> command to see what parameters are available.</p></div>
<div class="paragraph"><p>Usage:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>run &lt;script&gt; [args...]</code></pre>
</div></div>
<div class="paragraph"><p>Example:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>run apache install=true
run sbd id=sbd-1 node=node1 sbd_device=/dev/disk/by-uuid/F00D-CAFE</code></pre>
</div></div>
</div>
<div class="sect3">
<h4 id="cmdhelp_script_show"><code>show</code></h4>
<div class="paragraph"><p>Prints a description and short summary of the script, with
descriptions of the accepted parameters.</p></div>
<div class="paragraph"><p>Advanced parameters are hidden by default. To show the complete list
of parameters accepted by the script, pass <code>all</code> as argument.</p></div>
<div class="paragraph"><p>Usage:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>show &lt;script&gt; [all]</code></pre>
</div></div>
<div class="paragraph"><p>Example:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>show virtual-ip</code></pre>
</div></div>
</div>
<div class="sect3">
<h4 id="cmdhelp_script_verify"><code>verify</code></h4>
<div class="paragraph"><p>Checks the given parameter values, and returns a list
of actions that will be executed when running the script
if provided the same list of parameter values.</p></div>
<div class="paragraph"><p>Usage:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>verify &lt;script&gt; [args...]</code></pre>
</div></div>
<div class="paragraph"><p>Example:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>verify sbd id=sbd-1 node=node1 sbd_device=/dev/disk/by-uuid/F00D-CAFE</code></pre>
</div></div>
</div>
</div>
<div class="sect2">
<h3 id="cmdhelp_corosync"><code>corosync</code> - Corosync management</h3>
<div class="paragraph"><p>Corosync is the underlying messaging layer for most HA clusters.
This level provides commands for editing and managing the corosync
configuration.</p></div>
<div class="sect3">
<h4 id="cmdhelp_corosync_add-node"><code>add-node</code></h4>
<div class="paragraph"><p>Adds a node to the corosync configuration. This is used with the <code>udpu</code>
type configuration in corosync.</p></div>
<div class="paragraph"><p>A nodeid for the added node is generated automatically.</p></div>
<div class="paragraph"><p>Note that this command assumes that only a single ring is used, and
sets only the address for ring0.</p></div>
<div class="paragraph"><p>Usage:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>add-node &lt;addr&gt; [name]</code></pre>
</div></div>
</div>
<div class="sect3">
<h4 id="cmdhelp_corosync_del-node"><code>del-node</code></h4>
<div class="paragraph"><p>Removes a node from the corosync configuration. The argument given is
the <code>ring0_addr</code> address set in the configuration file.</p></div>
<div class="paragraph"><p>Usage:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>del-node &lt;addr&gt;</code></pre>
</div></div>
</div>
<div class="sect3">
<h4 id="cmdhelp_corosync_diff"><code>diff</code></h4>
<div class="paragraph"><p>Diffs the corosync configurations on different nodes. If no nodes are
given as arguments, the corosync configurations on all nodes in the
cluster are compared.</p></div>
<div class="paragraph"><p><code>diff</code> takes an option argument <code>--checksum</code>, to display a checksum
for each file instead of calculating a diff.</p></div>
<div class="paragraph"><p>Usage:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>diff [--checksum] [node...]</code></pre>
</div></div>
</div>
<div class="sect3">
<h4 id="cmdhelp_corosync_edit"><code>edit</code></h4>
<div class="paragraph"><p>Opens the Corosync configuration file in an editor.</p></div>
<div class="paragraph"><p>Usage:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>edit</code></pre>
</div></div>
</div>
<div class="sect3">
<h4 id="cmdhelp_corosync_get"><code>get</code></h4>
<div class="paragraph"><p>Returns the value configured in <code>corosync.conf</code>, which is not
necessarily the value used in the running configuration. See <code>reload</code>
for telling corosync about configuration changes.</p></div>
<div class="paragraph"><p>The argument is the complete dot-separated path to the value.</p></div>
<div class="paragraph"><p>If there are multiple values configured with the same path, the
command returns all values for that path. For example, to get all
configured <code>ring0_addr</code> values, use this command:</p></div>
<div class="paragraph"><p>Example:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>get nodelist.node.ring0_addr</code></pre>
</div></div>
</div>
<div class="sect3">
<h4 id="cmdhelp_corosync_log"><code>log</code></h4>
<div class="paragraph"><p>Opens the log file specified in the corosync configuration file. If no
log file is configured, this command returns an error.</p></div>
<div class="paragraph"><p>The pager used can be configured either using the PAGER
environment variable or in <code>crm.conf</code>.</p></div>
<div class="paragraph"><p>Usage:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>log</code></pre>
</div></div>
</div>
<div class="sect3">
<h4 id="cmdhelp_corosync_pull"><code>pull</code></h4>
<div class="paragraph"><p>Gets the corosync configuration from another node and copies
it to this node.</p></div>
<div class="paragraph"><p>Usage:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>pull &lt;node&gt;</code></pre>
</div></div>
</div>
<div class="sect3">
<h4 id="cmdhelp_corosync_push"><code>push</code></h4>
<div class="paragraph"><p>Pushes the corosync configuration file on this node to
the list of nodes provided. If no target nodes are given,
the configuration is pushed to all other nodes in the cluster.</p></div>
<div class="paragraph"><p>It is recommended to use <code>csync2</code> to distribute the cluster
configuration files rather than relying on this command.</p></div>
<div class="paragraph"><p>Usage:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>push [node] ...</code></pre>
</div></div>
<div class="paragraph"><p>Example:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>push node-2 node-3</code></pre>
</div></div>
</div>
<div class="sect3">
<h4 id="cmdhelp_corosync_reload"><code>reload</code></h4>
<div class="paragraph"><p>Tells all instances of corosync in this cluster to reload
<code>corosync.conf</code>.</p></div>
<div class="paragraph"><p>After pushing a new configuration to all cluster nodes, call this
command to make corosync use the new configuration.</p></div>
<div class="paragraph"><p>Usage:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>reload</code></pre>
</div></div>
</div>
<div class="sect3">
<h4 id="cmdhelp_corosync_set"><code>set</code></h4>
<div class="paragraph"><p>Sets the value identified by the given path. If the value does not
exist in the configuration file, it will be added. However, if the
section containing the value does not exist, the command will fail.</p></div>
<div class="paragraph"><p>Usage:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>set quorum.expected_votes 2</code></pre>
</div></div>
</div>
<div class="sect3">
<h4 id="cmdhelp_corosync_show"><code>show</code></h4>
<div class="paragraph"><p>Displays the corosync configuration on the current node.</p></div>
<div class="literalblock">
<div class="content">
<pre><code>show</code></pre>
</div></div>
</div>
<div class="sect3">
<h4 id="cmdhelp_corosync_status"><code>status</code></h4>
<div class="paragraph"><p>Displays the status of Corosync, including the votequorum state.</p></div>
<div class="paragraph"><p>Usage:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>status</code></pre>
</div></div>
</div>
</div>
<div class="sect2">
<h3 id="cmdhelp_cib"><code>cib</code> - CIB shadow management</h3>
<div class="paragraph"><p>This level is for management of shadow CIBs. It is available both
at the top level and the <code>configure</code> level.</p></div>
<div class="paragraph"><p>All the commands are implemented using <code>cib_shadow(8)</code> and the
<code>CIB_shadow</code> environment variable. The user prompt always
includes the name of the currently active shadow or the live CIB.</p></div>
<div class="sect3">
<h4 id="cmdhelp_cib_cibstatus"><code>cibstatus</code></h4>
<div class="paragraph"><p>Enter edit and manage the CIB status section level. See the
<a href="#cmdhelp_cibstatus">CIB status management section</a>.</p></div>
</div>
<div class="sect3">
<h4 id="cmdhelp_cib_commit"><code>commit</code></h4>
<div class="paragraph"><p>Apply a shadow CIB to the cluster. If the shadow name is omitted
then the current shadow CIB is applied.</p></div>
<div class="paragraph"><p>Temporary shadow CIBs are removed automatically on commit.</p></div>
<div class="paragraph"><p>Usage:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>commit [&lt;cib&gt;]</code></pre>
</div></div>
</div>
<div class="sect3">
<h4 id="cmdhelp_cib_delete"><code>delete</code></h4>
<div class="paragraph"><p>Delete an existing shadow CIB.</p></div>
<div class="paragraph"><p>Usage:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>delete &lt;cib&gt;</code></pre>
</div></div>
</div>
<div class="sect3">
<h4 id="cmdhelp_cib_diff"><code>diff</code></h4>
<div class="paragraph"><p>Print differences between the current cluster configuration and
the active shadow CIB.</p></div>
<div class="paragraph"><p>Usage:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>diff</code></pre>
</div></div>
</div>
<div class="sect3">
<h4 id="cmdhelp_cib_import"><code>import</code></h4>
<div class="paragraph"><p>At times it may be useful to create a shadow file from the
existing CIB. The CIB may be specified as file or as a PE input
file number. The shell will look up files in the local directory
first and then in the PE directory (typically <code>/var/lib/pengine</code>).
Once the CIB file is found, it is copied to a shadow and this
shadow is immediately available for use at both <code>configure</code> and
<code>cibstatus</code> levels.</p></div>
<div class="paragraph"><p>If the shadow name is omitted then the target shadow is named
after the input CIB file.</p></div>
<div class="paragraph"><p>Note that there are often more than one PE input file, so you may
need to specify the full name.</p></div>
<div class="paragraph"><p>Usage:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>import {&lt;file&gt;|&lt;number&gt;} [&lt;shadow&gt;]</code></pre>
</div></div>
<div class="paragraph"><p>Examples:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>import pe-warn-2222
import 2289 issue2</code></pre>
</div></div>
</div>
<div class="sect3">
<h4 id="cmdhelp_cib_list"><code>list</code></h4>
<div class="paragraph"><p>List existing shadow CIBs.</p></div>
<div class="paragraph"><p>Usage:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>list</code></pre>
</div></div>
</div>
<div class="sect3">
<h4 id="cmdhelp_cib_new"><code>new</code></h4>
<div class="paragraph"><p>Create a new shadow CIB. The live cluster configuration and
status is copied to the shadow CIB.</p></div>
<div class="paragraph"><p>If the name of the shadow is omitted, we create a temporary CIB
shadow. It is useful if multiple level sessions are desired
without affecting the cluster. A temporary CIB shadow is short
lived and will be removed either on <code>commit</code> or on program exit.
Note that if the temporary shadow is not committed all changes in
the temporary shadow are lost.</p></div>
<div class="paragraph"><p>Specify <code>withstatus</code> if you want to edit the status section of
the shadow CIB (see the <a href="#cmdhelp_cibstatus">cibstatus section</a>).
Add <code>force</code> to force overwriting the existing shadow CIB.</p></div>
<div class="paragraph"><p>To start with an empty configuration that is not copied from the live
CIB, specify the <code>empty</code> keyword. (This also allows a shadow CIB to be
created in case no cluster is running.)</p></div>
<div class="paragraph"><p>Usage:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>new [&lt;cib&gt;] [withstatus] [force] [empty]</code></pre>
</div></div>
</div>
<div class="sect3">
<h4 id="cmdhelp_cib_reset"><code>reset</code></h4>
<div class="paragraph"><p>Copy the current cluster configuration into the shadow CIB.</p></div>
<div class="paragraph"><p>Usage:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>reset &lt;cib&gt;</code></pre>
</div></div>
</div>
<div class="sect3">
<h4 id="cmdhelp_cib_use"><code>use</code></h4>
<div class="paragraph"><p>Choose a CIB source. If you want to edit the status from the
shadow CIB specify <code>withstatus</code> (see <a href="#cmdhelp_cibstatus"><code>cibstatus</code></a>).
Leave out the CIB name to switch to the running CIB.</p></div>
<div class="paragraph"><p>Usage:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>use [&lt;cib&gt;] [withstatus]</code></pre>
</div></div>
</div>
</div>
<div class="sect2">
<h3 id="cmdhelp_ra"><code>ra</code> - Resource Agents (RA) lists and documentation</h3>
<div class="paragraph"><p>This level contains commands which show various information about
the installed resource agents. It is available both at the top
level and at the <code>configure</code> level.</p></div>
<div class="sect3">
<h4 id="cmdhelp_ra_classes"><code>classes</code></h4>
<div class="paragraph"><p>Print all resource agents' classes and, where appropriate, a list
of available providers.</p></div>
<div class="paragraph"><p>Usage:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>classes</code></pre>
</div></div>
</div>
<div class="sect3">
<h4 id="cmdhelp_ra_info"><code>info</code> (<code>meta</code>)</h4>
<div class="paragraph"><p>Show the meta-data of a resource agent type. This is where users
can find information on how to use a resource agent. It is also
possible to get information from some programs: <code>pengine</code>,
<code>crmd</code>, <code>cib</code>, and <code>stonithd</code>. Just specify the program name
instead of an RA.</p></div>
<div class="paragraph"><p>Usage:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>info [&lt;class&gt;:[&lt;provider&gt;:]]&lt;type&gt;
info &lt;type&gt; &lt;class&gt; [&lt;provider&gt;] (obsolete)</code></pre>
</div></div>
<div class="paragraph"><p>Example:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>info apache
info ocf:pacemaker:Dummy
info stonith:ipmilan
info pengine</code></pre>
</div></div>
</div>
<div class="sect3">
<h4 id="cmdhelp_ra_list"><code>list</code></h4>
<div class="paragraph"><p>List available resource agents for the given class. If the class
is <code>ocf</code>, supply a provider to get agents which are available
only from that provider.</p></div>
<div class="paragraph"><p>Usage:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>list &lt;class&gt; [&lt;provider&gt;]</code></pre>
</div></div>
<div class="paragraph"><p>Example:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>list ocf pacemaker</code></pre>
</div></div>
</div>
<div class="sect3">
<h4 id="cmdhelp_ra_providers"><code>providers</code></h4>
<div class="paragraph"><p>List providers for a resource agent type. The class parameter
defaults to <code>ocf</code>.</p></div>
<div class="paragraph"><p>Usage:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>providers &lt;type&gt; [&lt;class&gt;]</code></pre>
</div></div>
<div class="paragraph"><p>Example:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>providers apache</code></pre>
</div></div>
</div>
<div class="sect3">
<h4 id="cmdhelp_ra_validate"><code>validate</code></h4>
<div class="paragraph"><p>If the resource agent supports the <code>validate-all</code> action, this calls
the action with the given parameters, printing any warnings or errors
reported by the agent.</p></div>
<div class="paragraph"><p>Usage:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>validate &lt;agent&gt; [&lt;key&gt;=&lt;value&gt; ...]</code></pre>
</div></div>
</div>
</div>
<div class="sect2">
<h3 id="cmdhelp_resource"><code>resource</code> - Resource management</h3>
<div class="paragraph"><p>At this level resources may be managed.</p></div>
<div class="paragraph"><p>All (or almost all) commands are implemented with the CRM tools
such as <code>crm_resource(8)</code>.</p></div>
<div class="sect3">
<h4 id="cmdhelp_resource_ban"><code>ban</code></h4>
<div class="paragraph"><p>Ban a resource from running on a certain node. If no node is given
as argument, the resource is banned from the current location.</p></div>
<div class="paragraph"><p>See <code>move</code> for details on other arguments.</p></div>
<div class="paragraph"><p>Usage:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>ban &lt;rsc&gt; [&lt;node&gt;] [&lt;lifetime&gt;] [force]</code></pre>
</div></div>
</div>
<div class="sect3">
<h4 id="cmdhelp_resource_cleanup"><code>cleanup</code></h4>
<div class="paragraph"><p>Cleanup resource status. Typically done after the resource has
temporarily failed. If a node is omitted, cleanup on all nodes.
If there are many nodes, the command may take a while.</p></div>
<div class="paragraph"><p><code>(Pacemaker 1.1.14)</code> Pass force to cleanup the resource itself,
otherwise the cleanup command will apply to the parent resource (if
any).</p></div>
<div class="paragraph"><p>Usage:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>cleanup &lt;rsc&gt; [&lt;node&gt;] [force]</code></pre>
</div></div>
</div>
<div class="sect3">
<h4 id="cmdhelp_resource_clear"><code>clear</code> (<code>unmove</code>, <code>unmigrate</code>, <code>unban</code>)</h4>
<div class="paragraph"><p>Remove any relocation constraint created by
the <code>move</code>, <code>migrate</code> or <code>ban</code> command.</p></div>
<div class="paragraph"><p>Usage:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>clear &lt;rsc&gt;
unmigrate &lt;rsc&gt;
unban &lt;rsc&gt;</code></pre>
</div></div>
</div>
<div class="sect3">
<h4 id="cmdhelp_resource_constraints"><code>constraints</code></h4>
<div class="paragraph"><p>Display the location and colocation constraints affecting the
resource.</p></div>
<div class="paragraph"><p>Usage:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>constraints &lt;rsc&gt;</code></pre>
</div></div>
</div>
<div class="sect3">
<h4 id="cmdhelp_resource_demote"><code>demote</code></h4>
<div class="paragraph"><p>Demote a master-slave resource using the <code>target-role</code>
attribute.</p></div>
<div class="paragraph"><p>Usage:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>demote &lt;rsc&gt;</code></pre>
</div></div>
</div>
<div class="sect3">
<h4 id="cmdhelp_resource_failcount"><code>failcount</code></h4>
<div class="paragraph"><p>Show/edit/delete the failcount of a resource.</p></div>
<div class="paragraph"><p>Usage:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>failcount &lt;rsc&gt; set &lt;node&gt; &lt;value&gt;
failcount &lt;rsc&gt; delete &lt;node&gt;
failcount &lt;rsc&gt; show &lt;node&gt;</code></pre>
</div></div>
<div class="paragraph"><p>Example:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>failcount fs_0 delete node2</code></pre>
</div></div>
</div>
<div class="sect3">
<h4 id="cmdhelp_resource_locate"><code>locate</code></h4>
<div class="paragraph"><p>Show the current location of one or more resources.</p></div>
<div class="paragraph"><p>Usage:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>locate [&lt;rsc&gt; ...]</code></pre>
</div></div>
</div>
<div class="sect3">
<h4 id="cmdhelp_resource_maintenance"><code>maintenance</code></h4>
<div class="paragraph"><p>Enables or disables the per-resource maintenance mode. When this mode
is enabled, no monitor operations will be triggered for the resource.</p></div>
<div class="paragraph"><p>Usage:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>maintenance &lt;resource&gt; [on|off|true|false]</code></pre>
</div></div>
<div class="paragraph"><p>Example:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>maintenance rsc1
maintenance rsc2 off</code></pre>
</div></div>
</div>
<div class="sect3">
<h4 id="cmdhelp_resource_manage"><code>manage</code></h4>
<div class="paragraph"><p>Manage a resource using the <code>is-managed</code> attribute. If there
are multiple meta attributes sets, the attribute is set in all of
them. If the resource is a clone, all <code>is-managed</code> attributes are
removed from the children resources.</p></div>
<div class="paragraph"><p>For details on group management see <a href="#cmdhelp_options_manage-children"><code>options manage-children</code></a>.</p></div>
<div class="paragraph"><p>Usage:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>manage &lt;rsc&gt;</code></pre>
</div></div>
</div>
<div class="sect3">
<h4 id="cmdhelp_resource_meta"><code>meta</code></h4>
<div class="paragraph"><p>Show/edit/delete a meta attribute of a resource. Currently, all
meta attributes of a resource may be managed with other commands
such as <code>resource stop</code>.</p></div>
<div class="paragraph"><p>Usage:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>meta &lt;rsc&gt; set &lt;attr&gt; &lt;value&gt;
meta &lt;rsc&gt; delete &lt;attr&gt;
meta &lt;rsc&gt; show &lt;attr&gt;</code></pre>
</div></div>
<div class="paragraph"><p>Example:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>meta ip_0 set target-role stopped</code></pre>
</div></div>
</div>
<div class="sect3">
<h4 id="cmdhelp_resource_move"><code>move</code> (<code>migrate</code>)</h4>
<div class="paragraph"><p>Move a resource away from its current location.</p></div>
<div class="paragraph"><p>If the destination node is left out, the resource is migrated by
creating a constraint which prevents it from running on the current
node. For this type of constraint to be created, the <code>force</code> argument
is required.</p></div>
<div class="paragraph"><p>A lifetime may be given for the constraint. Once it expires, the
location constraint will no longer be active.</p></div>
<div class="paragraph"><p>Usage:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>move &lt;rsc&gt; [&lt;node&gt;] [&lt;lifetime&gt;] [force]</code></pre>
</div></div>
</div>
<div class="sect3">
<h4 id="cmdhelp_resource_operations"><code>operations</code></h4>
<div class="paragraph"><p>Show active operations, optionally filtered by resource and node.</p></div>
<div class="paragraph"><p>Usage:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>operations [&lt;rsc&gt;] [&lt;node&gt;]</code></pre>
</div></div>
</div>
<div class="sect3">
<h4 id="cmdhelp_resource_param"><code>param</code></h4>
<div class="paragraph"><p>Show/edit/delete a parameter of a resource.</p></div>
<div class="paragraph"><p>Usage:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>param &lt;rsc&gt; set &lt;param&gt; &lt;value&gt;
param &lt;rsc&gt; delete &lt;param&gt;
param &lt;rsc&gt; show &lt;param&gt;</code></pre>
</div></div>
<div class="paragraph"><p>Example:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>param ip_0 show ip</code></pre>
</div></div>
</div>
<div class="sect3">
<h4 id="cmdhelp_resource_promote"><code>promote</code></h4>
<div class="paragraph"><p>Promote a master-slave resource using the <code>target-role</code>
attribute.</p></div>
<div class="paragraph"><p>Usage:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>promote &lt;rsc&gt;</code></pre>
</div></div>
</div>
<div class="sect3">
<h4 id="cmdhelp_resource_refresh"><code>refresh</code></h4>
<div class="paragraph"><p>Refresh CIB from the LRM status.</p></div>
<div class="sidebarblock">
<div class="content">
<div class="title">Note</div>
<div class="paragraph"><p><code>refresh</code> has been deprecated and is now
an alias for <code>cleanup</code>.</p></div>
</div></div>
<div class="paragraph"><p>Usage:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>refresh [&lt;node&gt;]</code></pre>
</div></div>
</div>
<div class="sect3">
<h4 id="cmdhelp_resource_reprobe"><code>reprobe</code></h4>
<div class="paragraph"><p>Probe for resources not started by the CRM.</p></div>
<div class="sidebarblock">
<div class="content">
<div class="title">Note</div>
<div class="paragraph"><p><code>reprobe</code> has been deprecated and is now
an alias for <code>cleanup</code>.</p></div>
</div></div>
<div class="paragraph"><p>Usage:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>reprobe [&lt;node&gt;]</code></pre>
</div></div>
</div>
<div class="sect3">
<h4 id="cmdhelp_resource_restart"><code>restart</code></h4>
<div class="paragraph"><p>Restart one or more resources. This is essentially a shortcut for
resource stop followed by a start. The shell is first going to wait
for the stop to finish, that is for all resources to really stop, and
only then to order the start action. Due to this command
entailing a whole set of operations, informational messages are
printed to let the user see some progress.</p></div>
<div class="paragraph"><p>For details on group management see
<a href="#cmdhelp_options_manage-children"><code>options manage-children</code></a>.</p></div>
<div class="paragraph"><p>Usage:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>restart &lt;rsc&gt; [&lt;rsc&gt; ...]</code></pre>
</div></div>
<div class="paragraph"><p>Example:</p></div>
<div class="literalblock">
<div class="content">
<pre><code># crm resource restart g_webserver
INFO: ordering g_webserver to stop
waiting for stop to finish .... done
INFO: ordering g_webserver to start
#</code></pre>
</div></div>
</div>
<div class="sect3">
<h4 id="cmdhelp_resource_scores"><code>scores</code></h4>
<div class="paragraph"><p>Display the allocation scores for all resources.</p></div>
<div class="paragraph"><p>Usage:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>scores</code></pre>
</div></div>
</div>
<div class="sect3">
<h4 id="cmdhelp_resource_secret"><code>secret</code></h4>
<div class="paragraph"><p>Sensitive parameters can be kept in local files rather than CIB
in order to prevent accidental data exposure. Use the <code>secret</code>
command to manage such parameters. <code>stash</code> and <code>unstash</code> move the
value from the CIB and back to the CIB respectively. The <code>set</code>
subcommand sets the parameter to the provided value. <code>delete</code>
removes the parameter completely. <code>show</code> displays the value of
the parameter from the local file. Use <code>check</code> to verify if the
local file content is valid.</p></div>
<div class="paragraph"><p>Usage:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>secret &lt;rsc&gt; set &lt;param&gt; &lt;value&gt;
secret &lt;rsc&gt; stash &lt;param&gt;
secret &lt;rsc&gt; unstash &lt;param&gt;
secret &lt;rsc&gt; delete &lt;param&gt;
secret &lt;rsc&gt; show &lt;param&gt;
secret &lt;rsc&gt; check &lt;param&gt;</code></pre>
</div></div>
<div class="paragraph"><p>Example:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>secret fence_1 show password
secret fence_1 stash password
secret fence_1 set password secret_value</code></pre>
</div></div>
</div>
<div class="sect3">
<h4 id="cmdhelp_resource_start"><code>start</code></h4>
<div class="paragraph"><p>Start one or more resources by setting the <code>target-role</code> attribute. If
there are multiple meta attributes sets, the attribute is set in all
of them. If the resource is a clone, all <code>target-role</code> attributes are
removed from the children resources.</p></div>
<div class="paragraph"><p>For details on group management see
<a href="#cmdhelp_options_manage-children"><code>options manage-children</code></a>.</p></div>
<div class="paragraph"><p>Usage:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>start &lt;rsc&gt; [&lt;rsc&gt; ...]</code></pre>
</div></div>
</div>
<div class="sect3">
<h4 id="cmdhelp_resource_status"><code>status</code> (<code>show</code>, <code>list</code>)</h4>
<div class="paragraph"><p>Print resource status. More than one resource can be shown at once. If
the resource parameter is left out, the status of all resources is
printed.</p></div>
<div class="paragraph"><p>Usage:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>status [&lt;rsc&gt; ...]</code></pre>
</div></div>
</div>
<div class="sect3">
<h4 id="cmdhelp_resource_stop"><code>stop</code></h4>
<div class="paragraph"><p>Stop one or more resources using the <code>target-role</code> attribute. If there
are multiple meta attributes sets, the attribute is set in all of
them. If the resource is a clone, all <code>target-role</code> attributes are
removed from the children resources.</p></div>
<div class="paragraph"><p>For details on group management see
<a href="#cmdhelp_options_manage-children"><code>options manage-children</code></a>.</p></div>
<div class="paragraph"><p>Usage:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>stop &lt;rsc&gt; [&lt;rsc&gt; ...]</code></pre>
</div></div>
</div>
<div class="sect3">
<h4 id="cmdhelp_resource_trace"><code>trace</code></h4>
<div class="paragraph"><p>Start tracing RA for the given operation. The trace files are
stored in <code>$HA_VARLIB/trace_ra</code>. If the operation to be traced is
monitor, note that the number of trace files can grow very
quickly.</p></div>
<div class="paragraph"><p>If no operation name is given, crmsh will attempt to trace all
operations for the RA. This includes any configured operations, start
and stop as well as promote/demote for multistate resources.</p></div>
<div class="paragraph"><p>To trace the probe operation which exists for all resources, either
set a trace for <code>monitor</code> with interval <code>0</code>, or use <code>probe</code> as the
operation name.</p></div>
<div class="paragraph"><p>Usage:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>trace &lt;rsc&gt; [&lt;op&gt; [&lt;interval&gt;] ]</code></pre>
</div></div>
<div class="paragraph"><p>Example:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>trace fs start
trace webserver
trace webserver probe
trace fs monitor 0</code></pre>
</div></div>
</div>
<div class="sect3">
<h4 id="cmdhelp_resource_unmanage"><code>unmanage</code></h4>
<div class="paragraph"><p>Unmanage a resource using the <code>is-managed</code> attribute. If there
are multiple meta attributes sets, the attribute is set in all of
them. If the resource is a clone, all <code>is-managed</code> attributes are
removed from the children resources.</p></div>
<div class="paragraph"><p>For details on group management see <a href="#cmdhelp_options_manage-children"><code>options manage-children</code></a>.</p></div>
<div class="paragraph"><p>Usage:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>unmanage &lt;rsc&gt;</code></pre>
</div></div>
</div>
<div class="sect3">
<h4 id="cmdhelp_resource_untrace"><code>untrace</code></h4>
<div class="paragraph"><p>Stop tracing RA for the given operation. If no operation name is
given, crmsh will attempt to stop tracing all operations in resource.</p></div>
<div class="paragraph"><p>Usage:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>untrace &lt;rsc&gt; [&lt;op&gt; [&lt;interval&gt;] ]</code></pre>
</div></div>
<div class="paragraph"><p>Example:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>untrace fs start
untrace webserver</code></pre>
</div></div>
</div>
<div class="sect3">
<h4 id="cmdhelp_resource_utilization"><code>utilization</code></h4>
<div class="paragraph"><p>Show/edit/delete a utilization attribute of a resource. These
attributes describe hardware requirements. By setting the
<code>placement-strategy</code> cluster property appropriately, it is
possible then to distribute resources based on resource
requirements and node size. See also <a href="#cmdhelp_node_utilization">node utilization attributes</a>.</p></div>
<div class="paragraph"><p>Usage:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>utilization &lt;rsc&gt; set &lt;attr&gt; &lt;value&gt;
utilization &lt;rsc&gt; delete &lt;attr&gt;
utilization &lt;rsc&gt; show &lt;attr&gt;</code></pre>
</div></div>
<div class="paragraph"><p>Example:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>utilization xen1 set memory 4096</code></pre>
</div></div>
</div>
</div>
<div class="sect2">
<h3 id="cmdhelp_node"><code>node</code> - Node management</h3>
<div class="paragraph"><p>Node management and status commands.</p></div>
<div class="sect3">
<h4 id="cmdhelp_node_attribute"><code>attribute</code></h4>
<div class="paragraph"><p>Edit node attributes. This kind of attribute should refer to
relatively static properties, such as memory size.</p></div>
<div class="paragraph"><p>Usage:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>attribute &lt;node&gt; set &lt;attr&gt; &lt;value&gt;
attribute &lt;node&gt; delete &lt;attr&gt;
attribute &lt;node&gt; show &lt;attr&gt;</code></pre>
</div></div>
<div class="paragraph"><p>Example:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>attribute node_1 set memory_size 4096</code></pre>
</div></div>
</div>
<div class="sect3">
<h4 id="cmdhelp_node_clearstate"><code>clearstate</code></h4>
<div class="paragraph"><p>Resets and clears the state of the specified node. This node is
afterwards assumed clean and offline. This command can be used to
manually confirm that a node has been fenced (e.g., powered off).</p></div>
<div class="paragraph"><p>Be careful! This can cause data corruption if you confirm that a node is
down that is, in fact, not cleanly down - the cluster will proceed as if
the fence had succeeded, possibly starting resources multiple times.</p></div>
<div class="paragraph"><p>Usage:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>clearstate &lt;node&gt;</code></pre>
</div></div>
</div>
<div class="sect3">
<h4 id="cmdhelp_node_delete"><code>delete</code></h4>
<div class="paragraph"><p>Delete a node. This command will remove the node from the CIB
and, in case the cluster stack is running, use the appropriate
program (<code>crm_node</code> or <code>hb_delnode</code>) to remove the node from the
membership.</p></div>
<div class="paragraph"><p>If the node is still listed as active and a member of our
partition we refuse to remove it. With the global force option
(<code>-F</code>) we will try to delete the node anyway.</p></div>
<div class="paragraph"><p>Usage:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>delete &lt;node&gt;</code></pre>
</div></div>
</div>
<div class="sect3">
<h4 id="cmdhelp_node_fence"><code>fence</code></h4>
<div class="paragraph"><p>Make CRM fence a node. This functionality depends on stonith
resources capable of fencing the specified node. No such stonith
resources, no fencing will happen.</p></div>
<div class="paragraph"><p>Usage:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>fence &lt;node&gt;</code></pre>
</div></div>
</div>
<div class="sect3">
<h4 id="cmdhelp_node_maintenance"><code>maintenance</code></h4>
<div class="paragraph"><p>Set the node status to maintenance. This is equivalent to the
cluster-wide <code>maintenance-mode</code> property but puts just one node
into the maintenance mode.</p></div>
<div class="paragraph"><p>The node parameter defaults to the node where the command is run.</p></div>
<div class="paragraph"><p>Usage:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>maintenance [&lt;node&gt;]</code></pre>
</div></div>
</div>
<div class="sect3">
<h4 id="cmdhelp_node_online"><code>online</code></h4>
<div class="paragraph"><p>Set a node to online status.</p></div>
<div class="paragraph"><p>The node parameter defaults to the node where the command is run.</p></div>
<div class="paragraph"><p>Usage:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>online [&lt;node&gt;]</code></pre>
</div></div>
</div>
<div class="sect3">
<h4 id="cmdhelp_node_ready"><code>ready</code></h4>
<div class="paragraph"><p>Set the node&#8217;s maintenance status to <code>off</code>. The node should be
now again fully operational and capable of running resource
operations.</p></div>
<div class="paragraph"><p>The node parameter defaults to the node where the command is run.</p></div>
<div class="paragraph"><p>Usage:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>ready [&lt;node&gt;]</code></pre>
</div></div>
</div>
<div class="sect3">
<h4 id="cmdhelp_node_server"><code>server</code></h4>
<div class="paragraph"><p>Remote nodes may have a configured server address which should
be used when contacting the node. This command prints the
server address if configured, else the node name.</p></div>
<div class="paragraph"><p>If no parameter is given, the addresses or names for all nodes
are printed.</p></div>
<div class="paragraph"><p>Usage:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>server [&lt;node&gt; ...]</code></pre>
</div></div>
</div>
<div class="sect3">
<h4 id="cmdhelp_node_show"><code>show</code></h4>
<div class="paragraph"><p>Show a node definition. If the node parameter is omitted then all
nodes are shown.</p></div>
<div class="paragraph"><p>Usage:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>show [&lt;node&gt;]</code></pre>
</div></div>
</div>
<div class="sect3">
<h4 id="cmdhelp_node_standby"><code>standby</code></h4>
<div class="paragraph"><p>Set a node to standby status. The node parameter defaults to the
node where the command is run.</p></div>
<div class="paragraph"><p>Additionally, you may specify a lifetime for the standby---if set to
<code>reboot</code>, the node will be back online once it reboots. <code>forever</code> will
keep the node in standby after reboot. The life time defaults to
<code>forever</code>.</p></div>
<div class="paragraph"><p>Usage:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>standby [&lt;node&gt;] [&lt;lifetime&gt;]

lifetime :: reboot | forever</code></pre>
</div></div>
<div class="paragraph"><p>Example:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>standby bob reboot</code></pre>
</div></div>
</div>
<div class="sect3">
<h4 id="cmdhelp_node_status"><code>status</code></h4>
<div class="paragraph"><p>Show nodes' status as XML. If the node parameter is omitted then
all nodes are shown.</p></div>
<div class="paragraph"><p>Usage:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>status [&lt;node&gt;]</code></pre>
</div></div>
</div>
<div class="sect3">
<h4 id="cmdhelp_node_status-attr"><code>status-attr</code></h4>
<div class="paragraph"><p>Edit node attributes which are in the CIB status section, i.e.
attributes which hold properties of a more volatile nature. One
typical example is attribute generated by the <code>pingd</code> utility.</p></div>
<div class="paragraph"><p>Usage:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>status-attr &lt;node&gt; set &lt;attr&gt; &lt;value&gt;
status-attr &lt;node&gt; delete &lt;attr&gt;
status-attr &lt;node&gt; show &lt;attr&gt;</code></pre>
</div></div>
<div class="paragraph"><p>Example:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>status-attr node_1 show pingd</code></pre>
</div></div>
</div>
<div class="sect3">
<h4 id="cmdhelp_node_utilization"><code>utilization</code></h4>
<div class="paragraph"><p>Edit node utilization attributes. These attributes describe
hardware characteristics as integer numbers such as memory size
or the number of CPUs. By setting the <code>placement-strategy</code>
cluster property appropriately, it is possible then to distribute
resources based on resource requirements and node size. See also
<a href="#cmdhelp_resource_utilization">resource utilization attributes</a>.</p></div>
<div class="paragraph"><p>Usage:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>utilization &lt;node&gt; set &lt;attr&gt; &lt;value&gt;
utilization &lt;node&gt; delete &lt;attr&gt;
utilization &lt;node&gt; show &lt;attr&gt;</code></pre>
</div></div>
<div class="paragraph"><p>Examples:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>utilization node_1 set memory 16384
utilization node_1 show cpu</code></pre>
</div></div>
</div>
</div>
<div class="sect2">
<h3 id="cmdhelp_site"><code>site</code> - GEO clustering site support</h3>
<div class="paragraph"><p>A cluster may consist of two or more subclusters in different and
distant locations. This set of commands supports such setups.</p></div>
<div class="sect3">
<h4 id="cmdhelp_site_ticket"><code>ticket</code></h4>
<div class="paragraph"><p>Tickets are cluster-wide attributes. They can be managed at the
site where this command is executed.</p></div>
<div class="paragraph"><p>It is then possible to constrain resources depending on the
ticket availability (see the <a href="#cmdhelp_configure_rsc_ticket"><code>rsc_ticket</code></a> command
for more details).</p></div>
<div class="paragraph"><p>Usage:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>ticket {grant|revoke|standby|activate|show|time|delete} &lt;ticket&gt;</code></pre>
</div></div>
<div class="paragraph"><p>Example:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>ticket grant ticket1</code></pre>
</div></div>
</div>
</div>
<div class="sect2">
<h3 id="cmdhelp_options"><code>options</code> - User preferences</h3>
<div class="paragraph"><p>The user may set various options for the crm shell itself.</p></div>
<div class="sect3">
<h4 id="cmdhelp_options_add-quotes"><code>add-quotes</code></h4>
<div class="paragraph"><p>The shell (as in <code>/bin/sh</code>) parser strips quotes from the command
line. This may sometimes make it really difficult to type values
which contain white space. One typical example is the configure
filter command. The crm shell will supply extra quotes around
arguments which contain white space. The default is <code>yes</code>.</p></div>
<div class="sidebarblock">
<div class="content">
<div class="title">Note on quotes use</div>
<div class="paragraph"><p>Adding quotes around arguments automatically has been introduced
with version 1.2.2 and it is technically a regression. Being a
regression is the only reason the <code>add-quotes</code> option exists. If
you have custom shell scripts which would break, just set the
<code>add-quotes</code> option to <code>no</code>.</p></div>
<div class="paragraph"><p>For instance, with adding quotes enabled, it is possible to do
the following:</p></div>
<div class="literalblock">
<div class="content">
<pre><code># crm configure primitive d1 Dummy \
    meta description="some description here"
# crm configure filter 'sed "s/hostlist=./&amp;node-c /"' fencing</code></pre>
</div></div>
</div></div>
</div>
<div class="sect3">
<h4 id="cmdhelp_options_check-frequency"><code>check-frequency</code></h4>
<div class="paragraph"><p>Semantic check of the CIB or elements modified or created may be
done on every configuration change (<code>always</code>), when verifying
(<code>on-verify</code>) or <code>never</code>. It is by default set to <code>always</code>.
Experts may want to change the setting to <code>on-verify</code>.</p></div>
<div class="paragraph"><p>The checks require that resource agents are present. If they are
not installed at the configuration time set this preference to
<code>never</code>.</p></div>
<div class="paragraph"><p>See <a href="#topics_Features_Checks">Configuration semantic checks</a> for more details.</p></div>
</div>
<div class="sect3">
<h4 id="cmdhelp_options_check-mode"><code>check-mode</code></h4>
<div class="paragraph"><p>Semantic check of the CIB or elements modified or created may be
done in the <code>strict</code> mode or in the <code>relaxed</code> mode. In the former
certain problems are treated as configuration errors. In the
<code>relaxed</code> mode all are treated as warnings. The default is <code>strict</code>.</p></div>
<div class="paragraph"><p>See <a href="#topics_Features_Checks">Configuration semantic checks</a> for more details.</p></div>
</div>
<div class="sect3">
<h4 id="cmdhelp_options_colorscheme"><code>colorscheme</code></h4>
<div class="paragraph"><p>With <code>output</code> set to <code>color</code>, a comma separated list of colors
from this option are used to emphasize:</p></div>
<div class="ulist"><ul>
<li>
<p>
keywords
</p>
</li>
<li>
<p>
object ids
</p>
</li>
<li>
<p>
attribute names
</p>
</li>
<li>
<p>
attribute values
</p>
</li>
<li>
<p>
scores
</p>
</li>
<li>
<p>
resource references
</p>
</li>
</ul></div>
<div class="paragraph"><p><code>crm</code> can show colors only if there is curses support for python
installed (usually provided by the <code>python-curses</code> package). The
colors are whatever is available in your terminal. Use <code>normal</code>
if you want to keep the default foreground color.</p></div>
<div class="paragraph"><p>This user preference defaults to
<code>yellow,normal,cyan,red,green,magenta</code> which is good for
terminals with dark background. You may want to change the color
scheme and save it in the preferences file for other color
setups.</p></div>
<div class="paragraph"><p>Example:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>colorscheme yellow,normal,blue,red,green,magenta</code></pre>
</div></div>
</div>
<div class="sect3">
<h4 id="cmdhelp_options_editor"><code>editor</code></h4>
<div class="paragraph"><p>The <code>edit</code> command invokes an editor. Use this to specify your
preferred editor program. If not set, it will default to either
the value of the <code>EDITOR</code> environment variable or to one of the
standard UNIX editors (<code>vi</code>,<code>emacs</code>,<code>nano</code>).</p></div>
<div class="paragraph"><p>Usage:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>editor program</code></pre>
</div></div>
<div class="paragraph"><p>Example:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>editor vim</code></pre>
</div></div>
</div>
<div class="sect3">
<h4 id="cmdhelp_options_manage-children"><code>manage-children</code></h4>
<div class="paragraph"><p>Some resource management commands, such as <code>resource stop</code>, when
the target resource is a group, may not always produce desired
result. Each element, group and the primitive members, can have a
meta attribute and those attributes may end up with conflicting
values. Consider the following construct:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>crm(live)# configure show svc fs virtual-ip
primitive fs Filesystem \
    params device="/dev/drbd0" directory="/srv/nfs" fstype=ext3 \
    op monitor interval=10s \
    meta target-role=Started
primitive virtual-ip IPaddr2 \
    params ip=10.2.13.110 iflabel=1 \
    op monitor interval=10s \
    op start interval=0 \
    meta target-role=Started
group svc fs virtual-ip \
    meta target-role=Stopped</code></pre>
</div></div>
<div class="paragraph"><p>Even though the element <code>svc</code> should be stopped, the group is
actually running because all its members have the <code>target-role</code>
set to <code>Started</code>:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>crm(live)# resource show svc
resource svc is running on: xen-f</code></pre>
</div></div>
<div class="paragraph"><p>Hence, if the user invokes <code>resource stop svc</code> the intention is
not clear. This preference gives the user an opportunity to
better control what happens if attributes of group members have
values which are in conflict with the same attribute of the group
itself.</p></div>
<div class="paragraph"><p>Possible values are <code>ask</code> (the default), <code>always</code>, and <code>never</code>.
If set to <code>always</code>, the crm shell removes all children attributes
which have values different from the parent. If set to <code>never</code>,
all children attributes are left intact. Finally, if set to
<code>ask</code>, the user will be asked for each member what is to be done.</p></div>
</div>
<div class="sect3">
<h4 id="cmdhelp_options_output"><code>output</code></h4>
<div class="paragraph"><p><code>crm</code> can adorn configurations in two ways: in color (similar to
for instance the <code>ls --color</code> command) and by showing keywords in
upper case. Possible values are <code>plain</code>, <code>color-always</code>, <code>color</code>,
and <em>uppercase</em>. It is possible to combine <code>uppercase</code> with one
of the color values in order to get an upper case xmass tree. Just
set this option to <code>color,uppercase</code> or <code>color-always,uppercase</code>.
In case you need color codes in pipes, <code>color-always</code> forces color
codes even in case the terminal is not a tty (just like <code>ls
--color=always</code>).</p></div>
</div>
<div class="sect3">
<h4 id="cmdhelp_options_pager"><code>pager</code></h4>
<div class="paragraph"><p>The <code>view</code> command displays text through a pager. Use this to
specify your preferred pager program. If not set, it will default
to either the value of the <code>PAGER</code> environment variable or to one
of the standard UNIX system pagers (<code>less</code>,<code>more</code>,<code>pg</code>).</p></div>
</div>
<div class="sect3">
<h4 id="cmdhelp_options_reset"><code>reset</code></h4>
<div class="paragraph"><p>This command resets all user options to the defaults. If used as
a single-shot command, the rc file (<code>$HOME/.config/crm/rc</code>) is
reset to the defaults too.</p></div>
</div>
<div class="sect3">
<h4 id="cmdhelp_options_save"><code>save</code></h4>
<div class="paragraph"><p>Save current settings to the rc file (<code>$HOME/.config/crm/rc</code>). On
further <code>crm</code> runs, the rc file is automatically read and parsed.</p></div>
</div>
<div class="sect3">
<h4 id="cmdhelp_options_set"><code>set</code></h4>
<div class="paragraph"><p>Sets the value of an option. Takes the fully qualified
name of the option as argument, as displayed by <code>show all</code>.</p></div>
<div class="paragraph"><p>The modified option value is stored in the user-local
configuration file, usually found in <code>~/.config/crm/crm.conf</code>.</p></div>
<div class="paragraph"><p>Usage:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>set &lt;option&gt; &lt;value&gt;</code></pre>
</div></div>
<div class="paragraph"><p>Example:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>set color.warn "magenta bold"
set editor nano</code></pre>
</div></div>
</div>
<div class="sect3">
<h4 id="cmdhelp_options_show"><code>show</code></h4>
<div class="paragraph"><p>Display all current settings.</p></div>
<div class="paragraph"><p>Given an option name as argument, <code>show</code> will display only the value
of that argument.</p></div>
<div class="paragraph"><p>Given <code>all</code> as argument, <code>show</code> displays all available user options.</p></div>
<div class="paragraph"><p>Usage:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>show [all|&lt;option&gt;]</code></pre>
</div></div>
<div class="paragraph"><p>Example:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>show
show skill-level
show all</code></pre>
</div></div>
</div>
<div class="sect3">
<h4 id="cmdhelp_options_skill-level"><code>skill-level</code></h4>
<div class="paragraph"><p>Based on the skill-level setting, the user is allowed to use only
a subset of commands. There are three levels: operator,
administrator, and expert. The operator level allows only
commands at the <code>resource</code> and <code>node</code> levels, but not editing
or deleting resources. The administrator may do that and may also
configure the cluster at the <code>configure</code> level and manage the
shadow CIBs. The expert may do all.</p></div>
<div class="paragraph"><p>Usage:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>skill-level &lt;level&gt;

level :: operator | administrator | expert</code></pre>
</div></div>
<div class="sidebarblock">
<div class="content">
<div class="title">Note on security</div>
<div class="paragraph"><p>The <code>skill-level</code> option is advisory only. There is nothing
stopping any users change their skill level (see
<a href="#topics_Features_Security">Access Control Lists (ACL)</a> on how to enforce
access control).</p></div>
</div></div>
</div>
<div class="sect3">
<h4 id="cmdhelp_options_sort-elements"><code>sort-elements</code></h4>
<div class="paragraph"><p><code>crm</code> by default sorts CIB elements. If you want them appear in
the order they were created, set this option to <code>no</code>.</p></div>
<div class="paragraph"><p>Usage:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>sort-elements {yes|no}</code></pre>
</div></div>
<div class="paragraph"><p>Example:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>sort-elements no</code></pre>
</div></div>
</div>
<div class="sect3">
<h4 id="cmdhelp_options_user"><code>user</code></h4>
<div class="paragraph"><p>Sufficient privileges are necessary in order to manage a
cluster: programs such as <code>crm_verify</code> or <code>crm_resource</code> and,
ultimately, <code>cibadmin</code> have to be run either as <code>root</code> or as the
CRM owner user (typically <code>hacluster</code>). You don&#8217;t have to worry
about that if you run <code>crm</code> as <code>root</code>. A more secure way is to
run the program with your usual privileges, set this option to
the appropriate user (such as <code>hacluster</code>), and setup the
<code>sudoers</code> file.</p></div>
<div class="paragraph"><p>Usage:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>user system-user</code></pre>
</div></div>
<div class="paragraph"><p>Example:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>user hacluster</code></pre>
</div></div>
</div>
<div class="sect3">
<h4 id="cmdhelp_options_wait"><code>wait</code></h4>
<div class="paragraph"><p>In normal operation, <code>crm</code> runs a command and gets back
immediately to process other commands or get input from the user.
With this option set to <code>yes</code> it will wait for the started
transition to finish. In interactive mode dots are printed to
indicate progress.</p></div>
<div class="paragraph"><p>Usage:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>wait {yes|no}</code></pre>
</div></div>
<div class="paragraph"><p>Example:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>wait yes</code></pre>
</div></div>
</div>
</div>
<div class="sect2">
<h3 id="cmdhelp_configure"><code>configure</code> - CIB configuration</h3>
<div class="paragraph"><p>This level enables all CIB object definition commands.</p></div>
<div class="paragraph"><p>The configuration may be logically divided into four parts:
nodes, resources, constraints, and (cluster) properties and
attributes.  Each of these commands support one or more basic CIB
objects.</p></div>
<div class="paragraph"><p>Nodes and attributes describing nodes are managed using the
<code>node</code> command.</p></div>
<div class="paragraph"><p>Commands for resources are:</p></div>
<div class="ulist"><ul>
<li>
<p>
<code>primitive</code>
</p>
</li>
<li>
<p>
<code>monitor</code>
</p>
</li>
<li>
<p>
<code>group</code>
</p>
</li>
<li>
<p>
<code>clone</code>
</p>
</li>
<li>
<p>
<code>ms</code>/<code>master</code> (master-slave)
</p>
</li>
</ul></div>
<div class="paragraph"><p>In order to streamline large configurations, it is possible to
define a template which can later be referenced in primitives:</p></div>
<div class="ulist"><ul>
<li>
<p>
<code>rsc_template</code>
</p>
</li>
</ul></div>
<div class="paragraph"><p>In that case the primitive inherits all attributes defined in the
template.</p></div>
<div class="paragraph"><p>There are three types of constraints:</p></div>
<div class="ulist"><ul>
<li>
<p>
<code>location</code>
</p>
</li>
<li>
<p>
<code>colocation</code>
</p>
</li>
<li>
<p>
<code>order</code>
</p>
</li>
</ul></div>
<div class="paragraph"><p>It is possible to define fencing order (stonith resource
priorities):</p></div>
<div class="ulist"><ul>
<li>
<p>
<code>fencing_topology</code>
</p>
</li>
</ul></div>
<div class="paragraph"><p>Finally, there are the cluster properties, resource meta
attributes defaults, and operations defaults. All are just a set
of attributes. These attributes are managed by the following
commands:</p></div>
<div class="ulist"><ul>
<li>
<p>
<code>property</code>
</p>
</li>
<li>
<p>
<code>rsc_defaults</code>
</p>
</li>
<li>
<p>
<code>op_defaults</code>
</p>
</li>
</ul></div>
<div class="paragraph"><p>In addition to the cluster configuration, the Access Control
Lists (ACL) can be setup to allow access to parts of the CIB for
users other than <code>root</code> and <code>hacluster</code>. The following commands
manage ACL:</p></div>
<div class="ulist"><ul>
<li>
<p>
<code>user</code>
</p>
</li>
<li>
<p>
<code>role</code>
</p>
</li>
</ul></div>
<div class="paragraph"><p>In Pacemaker 1.1.12 and up, this command replaces the <code>user</code> command
for handling ACLs:</p></div>
<div class="ulist"><ul>
<li>
<p>
<code>acl_target</code>
</p>
</li>
</ul></div>
<div class="paragraph"><p>The changes are applied to the current CIB only on ending the
configuration session or using the <code>commit</code> command.</p></div>
<div class="paragraph"><p>Comments start with <code>#</code> in the first line. The comments are tied
to the element which follows. If the element moves, its comments
will follow.</p></div>
<div class="sect3">
<h4 id="cmdhelp_configure_acl_target"><code>acl_target</code></h4>
<div class="paragraph"><p>Defines an ACL target.</p></div>
<div class="paragraph"><p>Usage:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>acl_target &lt;tid&gt; [&lt;role&gt; ...]</code></pre>
</div></div>
<div class="paragraph"><p>Example:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>acl_target joe resource_admin constraint_editor</code></pre>
</div></div>
</div>
<div class="sect3">
<h4 id="cmdhelp_configure_alert"><code>alert</code></h4>
<div class="sidebarblock">
<div class="content">
<div class="title">Version note</div>
<div class="paragraph"><p>This feature is only available
in Pacemaker 1.1.15+.</p></div>
</div></div>
<div class="paragraph"><p>Event-driven alerts enables calling scripts whenever interesting
events occur in the cluster (nodes joining or leaving, resources
starting or stopping, etc.).</p></div>
<div class="paragraph"><p>The <code>path</code> is an arbitrary file path to an alert script.  Existing
external scripts used with ClusterMon resources can be used as alert
scripts, since the interface is compatible.</p></div>
<div class="paragraph"><p>Each alert may have a number of receipients configured.  These will be
passed to the script as arguments. The first recipient will also be
passed as the <code>CRM_alert_recipient</code> environment variable, for
compatibility with existing scripts that only support one recipient.</p></div>
<div class="paragraph"><p>The available meta attributes are <code>timeout</code> (default 30s) and
<code>timestamp-format</code> (default <code>"%H:%M:%S.%06N"</code>).</p></div>
<div class="paragraph"><p>Some configurations may require each recipient to be delimited by
brackets, to avoid ambiguity. In the example <code>alert-2</code> below, the meta
attribute for <code>timeout</code> is defined after the recipient, so the
brackets are used to ensure that the meta attribute is set for the
alert and not just the recipient. This can be avoided by setting any
alert attributes before defining the recipients.</p></div>
<div class="paragraph"><p>Usage:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>alert &lt;id&gt; &lt;path&gt; \
  [attributes &lt;nvpair&gt; ...] \
  [meta &lt;nvpair&gt; ...] \
  [to [{] &lt;recipient&gt;
    [attributes &lt;nvpair&gt; ...] \
    [meta &lt;nvpair&gt; ...] [}] \
    ...]</code></pre>
</div></div>
<div class="paragraph"><p>Example:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>alert alert-1 /srv/pacemaker/pcmk_alert_sample.sh \
    to /var/log/cluster-alerts.log

alert alert-2 /srv/pacemaker/example_alert.sh \
    meta timeout=60s \
    to { /var/log/cluster-alerts.log }</code></pre>
</div></div>
</div>
<div class="sect3">
<h4 id="cmdhelp_configure_cib"><code>cib</code></h4>
<div class="paragraph"><p>This level is for management of shadow CIBs. It is available at
the <code>configure</code> level to enable saving intermediate changes to a
shadow CIB instead of to the live cluster. This short excerpt
shows how:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>crm(live)configure# cib new test-2
INFO: test-2 shadow CIB created
crm(test-2)configure# commit</code></pre>
</div></div>
<div class="paragraph"><p>Note how the current CIB in the prompt changed from <code>live</code> to
<code>test-2</code> after issuing the <code>cib new</code> command. See also the
<a href="#cmdhelp_cib">CIB shadow management</a> for more information.</p></div>
</div>
<div class="sect3">
<h4 id="cmdhelp_configure_cibstatus"><code>cibstatus</code></h4>
<div class="paragraph"><p>Enter edit and manage the CIB status section level. See the
<a href="#cmdhelp_cibstatus">CIB status management section</a>.</p></div>
</div>
<div class="sect3">
<h4 id="cmdhelp_configure_clone"><code>clone</code></h4>
<div class="paragraph"><p>The <code>clone</code> command creates a resource clone. It may contain a
single primitive resource or one group of resources.</p></div>
<div class="paragraph"><p>Usage:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>clone &lt;name&gt; &lt;rsc&gt;
  [description=&lt;description&gt;]
  [meta &lt;attr_list&gt;]
  [params &lt;attr_list&gt;]

attr_list :: [$id=&lt;id&gt;] &lt;attr&gt;=&lt;val&gt; [&lt;attr&gt;=&lt;val&gt;...] | $id-ref=&lt;id&gt;</code></pre>
</div></div>
<div class="paragraph"><p>Example:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>clone cl_fence apc_1 \
  meta clone-node-max=1 globally-unique=false</code></pre>
</div></div>
</div>
<div class="sect3">
<h4 id="cmdhelp_configure_colocation"><code>colocation</code> (<code>collocation</code>)</h4>
<div class="paragraph"><p>This constraint expresses the placement relation between two
or more resources. If there are more than two resources, then the
constraint is called a resource set.</p></div>
<div class="paragraph"><p>The score is used to indicate the priority of the constraint. A
positive score indicates that the resources should run on the same
node. A negative score that they should not run on the same
node. Values of positive or negative <code>infinity</code> indicate a mandatory
constraint.</p></div>
<div class="paragraph"><p>In the two resource form, the cluster will place <code>&lt;with-rsc&gt;</code> first,
and then decide where to put the <code>&lt;rsc&gt;</code> resource.</p></div>
<div class="paragraph"><p>Collocation resource sets have an extra attribute (<code>sequential</code>)
to allow for sets of resources which don&#8217;t depend on each other
in terms of state. The shell syntax for such sets is to put
resources in parentheses.</p></div>
<div class="paragraph"><p>Sets cannot be nested.</p></div>
<div class="paragraph"><p>The optional <code>node-attribute</code> can be used to colocate resources on a
set of nodes and not necessarily on the same node. For example, by
setting a node attribute <code>color</code> on all nodes and setting the
<code>node-attribute</code> value to <code>color</code> as well, the colocated resources
will be placed on any node that has the same color.</p></div>
<div class="paragraph"><p>For more details on how to configure resource sets, see
<a href="#topics_Features_Resourcesets"><code>Syntax: Resource sets</code></a>.</p></div>
<div class="paragraph"><p>Usage:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>colocation &lt;id&gt; &lt;score&gt;: &lt;rsc&gt;[:&lt;role&gt;] &lt;with-rsc&gt;[:&lt;role&gt;]
  [node-attribute=&lt;node_attr&gt;]

colocation &lt;id&gt; &lt;score&gt;: &lt;resource_sets&gt;
  [node-attribute=&lt;node_attr&gt;]

resource_sets :: &lt;resource_set&gt; [&lt;resource_set&gt; ...]

resource_set :: ["("|"["] &lt;rsc&gt;[:&lt;role&gt;] [&lt;rsc&gt;[:&lt;role&gt;] ...] \
                [&lt;attributes&gt;]  [")"|"]"]

attributes :: [require-all=(true|false)] [sequential=(true|false)]</code></pre>
</div></div>
<div class="paragraph"><p>Example:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>colocation never_put_apache_with_dummy -inf: apache dummy
colocation c1 inf: A ( B C )</code></pre>
</div></div>
</div>
<div class="sect3">
<h4 id="cmdhelp_configure_commit"><code>commit</code></h4>
<div class="paragraph"><p>Commit the current configuration to the CIB in use. As noted
elsewhere, commands in a configure session don&#8217;t have immediate
effect on the CIB. All changes are applied at one point in time,
either using <code>commit</code> or when the user leaves the configure
level. In case the CIB in use changed in the meantime, presumably
by somebody else, the crm shell will refuse to apply the changes.</p></div>
<div class="paragraph"><p>If you know that it&#8217;s fine to still apply them, add <code>force</code> to the
command line.</p></div>
<div class="paragraph"><p>To disable CIB patching and apply the changes by replacing the CIB
completely, add <code>replace</code> to the command line. Note that this can lead
to previous changes being overwritten if some other process
concurrently modifies the CIB.</p></div>
<div class="paragraph"><p>Usage:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>commit [force] [replace]</code></pre>
</div></div>
</div>
<div class="sect3">
<h4 id="cmdhelp_configure_default-timeouts"><code>default-timeouts</code></h4>
<div class="paragraph"><p>This command takes the timeouts from the actions section of the
resource agent meta-data and sets them for the operations of the
primitive.</p></div>
<div class="paragraph"><p>Usage:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>default-timeouts &lt;id&gt; [&lt;id&gt;...]</code></pre>
</div></div>
<div class="sidebarblock">
<div class="content">
<div class="title">Note on <code>default-timeouts</code></div>
<div class="paragraph"><p>The use of this command is discouraged in favor of manually
determining the best timeouts required for the particular
configuration. Relying on the resource agent to supply appropriate
timeouts can cause the resource to fail at the worst possible moment.</p></div>
<div class="paragraph"><p>Appropriate timeouts for resource actions are context-sensitive, and
should be carefully considered with the whole configuration in mind.</p></div>
</div></div>
</div>
<div class="sect3">
<h4 id="cmdhelp_configure_delete"><code>delete</code></h4>
<div class="paragraph"><p>Delete one or more objects. If an object to be deleted belongs to
a container object, such as a group, and it is the only resource
in that container, then the container is deleted as well. Any
related constraints are removed as well.</p></div>
<div class="paragraph"><p>If the object is a started resource, it will not be deleted unless the
<code>--force</code> flag is passed to the command, or the <code>force</code> option is set.</p></div>
<div class="paragraph"><p>Usage:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>delete [--force] &lt;id&gt; [&lt;id&gt;...]</code></pre>
</div></div>
</div>
<div class="sect3">
<h4 id="cmdhelp_configure_edit"><code>edit</code></h4>
<div class="paragraph"><p>This command invokes the editor with the object description. As
with the <code>show</code> command, the user may choose to edit all objects
or a set of objects.</p></div>
<div class="paragraph"><p>If the user insists, he or she may edit the XML edition of the
object. If you do that, don&#8217;t modify any id attributes.</p></div>
<div class="paragraph"><p>Usage:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>edit [xml] [&lt;id&gt; ...]
edit [xml] changed</code></pre>
</div></div>
<div class="sidebarblock">
<div class="content">
<div class="title">Note on renaming element ids</div>
<div class="paragraph"><p>The edit command sometimes cannot properly handle modifying
element ids. In particular for elements which belong to group or
ms resources. Group and ms resources themselves also cannot be
renamed. Please use the <code>rename</code> command instead.</p></div>
</div></div>
</div>
<div class="sect3">
<h4 id="cmdhelp_configure_erase"><code>erase</code></h4>
<div class="paragraph"><p>The <code>erase</code> clears all configuration. Apart from nodes. To remove
nodes, you have to specify an additional keyword <code>nodes</code>.</p></div>
<div class="paragraph"><p>Note that removing nodes from the live cluster may have some
strange/interesting/unwelcome effects.</p></div>
<div class="paragraph"><p>Usage:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>erase [nodes]</code></pre>
</div></div>
</div>
<div class="sect3">
<h4 id="cmdhelp_configure_fencing_topology"><code>fencing_topology</code></h4>
<div class="paragraph"><p>If multiple fencing (stonith) devices are available capable of
fencing a node, their order may be specified by <code>fencing_topology</code>.
The order is specified per node.</p></div>
<div class="paragraph"><p>Stonith resources can be separated by <code>,</code> in which case all of
them need to succeed. If they fail, the next stonith resource (or
set of resources) is used. In other words, use comma to separate
resources which all need to succeed and whitespace for serial
order. It is not allowed to use whitespace around comma.</p></div>
<div class="paragraph"><p>If the node is left out, the order is used for all nodes.
That should reduce the configuration size in some stonith setups.</p></div>
<div class="paragraph"><p>From Pacemaker version 1.1.14, it is possible to use a node attribute
as the <code>target</code> in a fencing topology. The syntax for this usage is
described below.</p></div>
<div class="paragraph"><p>From Pacemaker version 1.1.14, it is also possible to use regular
expression patterns as the <code>target</code> in a fencing topology. The configured
fencing sequence then applies to all devices matching the pattern.</p></div>
<div class="paragraph"><p>Usage:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>fencing_topology &lt;stonith_resources&gt; [&lt;stonith_resources&gt; ...]
fencing_topology &lt;fencing_order&gt; [&lt;fencing_order&gt; ...]

fencing_order :: &lt;target&gt; &lt;stonith_resources&gt; [&lt;stonith_resources&gt; ...]

stonith_resources :: &lt;rsc&gt;[,&lt;rsc&gt;...]
target :: &lt;node&gt;: | attr:&lt;node-attribute&gt;=&lt;value&gt; | pattern:&lt;pattern&gt;</code></pre>
</div></div>
<div class="paragraph"><p>Example:</p></div>
<div class="literalblock">
<div class="content">
<pre><code># Only kill the power if poison-pill fails
fencing_topology poison-pill power

# As above for node-a, but a different strategy for node-b
fencing_topology \
    node-a: poison-pill power \
    node-b: ipmi serial

# Fencing anything on rack 1 requires fencing via both APC 1 and 2,
# to defeat the redundancy provided by two separate UPS units.
fencing_topology attr:rack=1 apc01,apc02

# Fencing for all machines named green.* is done using the pear
# fencing device first, while all machines named red.* are fenced
# using the apple fencing device first.
fencing_topology \
    pattern:green.* pear apple \
    pattern:red.* apple pear</code></pre>
</div></div>
</div>
<div class="sect3">
<h4 id="cmdhelp_configure_filter"><code>filter</code></h4>
<div class="paragraph"><p>This command filters the given CIB elements through an external
program. The program should accept input on <code>stdin</code> and send
output to <code>stdout</code> (the standard UNIX filter conventions). As
with the <code>show</code> command, the user may choose to filter all or
just a subset of elements.</p></div>
<div class="paragraph"><p>It is possible to filter the XML representation of objects, but
probably not as useful as the configuration language. The
presentation is somewhat different from what would be displayed
by the <code>show</code> command---each element is shown on a single line,
i.e. there are no backslashes and no other embelishments.</p></div>
<div class="paragraph"><p>Don&#8217;t forget to put quotes around the filter if it contains
spaces.</p></div>
<div class="paragraph"><p>Usage:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>filter &lt;prog&gt; [xml] [&lt;id&gt; ...]
filter &lt;prog&gt; [xml] changed</code></pre>
</div></div>
<div class="paragraph"><p>Examples:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>filter "sed '/^primitive/s/target-role=[^ ]*//'"
# crm configure filter "sed '/^primitive/s/target-role=[^ ]*//'"
crm configure &lt;&lt;END
  filter "sed '/threshold=\"1\"/s/=\"1\"/=\"0\"/g'"
END</code></pre>
</div></div>
<div class="sidebarblock">
<div class="content">
<div class="title">Note on quotation marks</div>
<div class="paragraph"><p>Filter commands which feature a blend of quotation marks can be
difficult to get right, especially when used directly from bash, since
bash does its own quotation parsing. In these cases, it can be easier
to supply the filter command as standard input. See the last example
above.</p></div>
</div></div>
</div>
<div class="sect3">
<h4 id="cmdhelp_configure_get_property"><code>get-property</code></h4>
<div class="paragraph"><p>Show the value of the given property. If the value is not set, the
command will print the default value for the property, if known.</p></div>
<div class="paragraph"><p>If no property name is passed to the command, the list of known
cluster properties is printed.</p></div>
<div class="paragraph"><p>If the property is set multiple times, for example using multiple
property sets with different rule expressions, the output of this
command is undefined.</p></div>
<div class="paragraph"><p>Pass the argument <code>-t</code> or <code>--true</code> to <code>get-property</code> to translate
the argument value into <code>true</code> or <code>false</code>. If the value is not
set, the command will print <code>false</code>.</p></div>
<div class="paragraph"><p>Usage:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>get-property [-t|--true] [&lt;name&gt;]</code></pre>
</div></div>
<div class="paragraph"><p>Example:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>get-property stonith-enabled
get-property -t maintenance-mode</code></pre>
</div></div>
</div>
<div class="sect3">
<h4 id="cmdhelp_configure_graph"><code>graph</code></h4>
<div class="paragraph"><p>Create a graphviz graphical layout from the current cluster
configuration.</p></div>
<div class="paragraph"><p>Currently, only <code>dot</code> (directed graph) is supported. It is
essentially a visualization of resource ordering.</p></div>
<div class="paragraph"><p>The graph may be saved to a file which can be used as source for
various graphviz tools (by default it is displayed in the user&#8217;s
X11 session). Optionally, by specifying the format, one can also
produce an image instead.</p></div>
<div class="paragraph"><p>For more or different graphviz attributes, it is possible to save
the default set of attributes to an ini file. If this file exists
it will always override the builtin settings. The <code>exportsettings</code>
subcommand also prints the location of the ini file.</p></div>
<div class="paragraph"><p>Usage:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>graph [&lt;gtype&gt; [&lt;file&gt; [&lt;img_format&gt;]]]
graph exportsettings

gtype :: dot
img_format :: `dot` output format (see the +-T+ option)</code></pre>
</div></div>
<div class="paragraph"><p>Example:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>graph dot
graph dot clu1.conf.dot
graph dot clu1.conf.svg svg</code></pre>
</div></div>
</div>
<div class="sect3">
<h4 id="cmdhelp_configure_group"><code>group</code></h4>
<div class="paragraph"><p>The <code>group</code> command creates a group of resources. This can be useful
when resources depend on other resources and require that those
resources start in order on the same node. A commmon use of resource
groups is to ensure that a server and a virtual IP are located
together, and that the virtual IP is started before the server.</p></div>
<div class="paragraph"><p>Grouped resources are started in the order they appear in the group,
and stopped in the reverse order. If a resource in the group cannot
run anywhere, resources following it in the group will not start.</p></div>
<div class="paragraph"><p><code>group</code> can be passed the "container" meta attribute, to indicate that
it is to be used to group VM resources monitored using Nagios. The
resource referred to by the container attribute must be of type
<code>ocf:heartbeat:Xen</code>, <code>oxf:heartbeat:VirtualDomain</code> or <code>ocf:heartbeat:lxc</code>.</p></div>
<div class="paragraph"><p>Usage:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>group &lt;name&gt; &lt;rsc&gt; [&lt;rsc&gt;...]
  [description=&lt;description&gt;]
  [meta attr_list]
  [params attr_list]

attr_list :: [$id=&lt;id&gt;] &lt;attr&gt;=&lt;val&gt; [&lt;attr&gt;=&lt;val&gt;...] | $id-ref=&lt;id&gt;</code></pre>
</div></div>
<div class="paragraph"><p>Example:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>group internal_www disk0 fs0 internal_ip apache \
  meta target_role=stopped

group vm-and-services vm vm-sshd meta container="vm"</code></pre>
</div></div>
</div>
<div class="sect3">
<h4 id="cmdhelp_configure_load"><code>load</code></h4>
<div class="paragraph"><p>Load a part of configuration (or all of it) from a local file or
a network URL. The <code>replace</code> method replaces the current
configuration with the one from the source. The <code>update</code> method
tries to import the contents into the current configuration. The
<code>push</code> method imports the contents into the current configuration
and removes any lines that are not present in the given
configuration.
The file may be a CLI file or an XML file.</p></div>
<div class="paragraph"><p>If the URL is <code>-</code>, the configuration is read from standard input.</p></div>
<div class="paragraph"><p>Usage:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>load [xml] &lt;method&gt; URL

method :: replace | update | push</code></pre>
</div></div>
<div class="paragraph"><p>Example:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>load xml update myfirstcib.xml
load xml replace http://storage.big.com/cibs/bigcib.xml
load xml push smallcib.xml</code></pre>
</div></div>
</div>
<div class="sect3">
<h4 id="cmdhelp_configure_location"><code>location</code></h4>
<div class="paragraph"><p><code>location</code> defines the preference of nodes for the given
resource. The location constraints consist of one or more rules
which specify a score to be awarded if the rule matches.</p></div>
<div class="paragraph"><p>The resource referenced by the location constraint can be one of the
following:</p></div>
<div class="ulist"><ul>
<li>
<p>
Plain resource reference: <code>location loc1 webserver 100: node1</code>
</p>
</li>
<li>
<p>
Resource set in curly brackets: <code>location loc1 { virtual-ip webserver } 100: node1</code>
</p>
</li>
<li>
<p>
Tag containing resource ids: <code>location loc1 tag1 100: node1</code>
</p>
</li>
<li>
<p>
Resource pattern: <code>location loc1 /web.*/ 100: node1</code>
</p>
</li>
</ul></div>
<div class="paragraph"><p>The <code>resource-discovery</code> attribute allows probes to be selectively
enabled or disabled per resource and node.</p></div>
<div class="paragraph"><p>The syntax for resource sets is described in detail for
<a href="#cmdhelp_configure_colocation"><code>colocation</code></a>.</p></div>
<div class="paragraph"><p>For more details on how to configure resource sets, see
<a href="#topics_Features_Resourcesets"><code>Syntax: Resource sets</code></a>.</p></div>
<div class="paragraph"><p>For more information on rule expressions, see
<a href="#topics_Syntax_RuleExpressions">Syntax: Rule expressions</a>.</p></div>
<div class="paragraph"><p>Usage:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>location &lt;id&gt; &lt;rsc&gt; [&lt;attributes&gt;] {&lt;node_pref&gt;|&lt;rules&gt;}

rsc :: /&lt;rsc-pattern&gt;/
        | { resource_sets }
        | &lt;rsc&gt;

attributes :: role=&lt;role&gt; | resource-discovery=always|never|exclusive

node_pref :: &lt;score&gt;: &lt;node&gt;

rules ::
  rule [id_spec] [$role=&lt;role&gt;] &lt;score&gt;: &lt;expression&gt;
  [rule [id_spec] [$role=&lt;role&gt;] &lt;score&gt;: &lt;expression&gt; ...]

id_spec :: $id=&lt;id&gt; | $id-ref=&lt;id&gt;
score :: &lt;number&gt; | &lt;attribute&gt; | [-]inf
expression :: &lt;simple_exp&gt; [&lt;bool_op&gt; &lt;simple_exp&gt; ...]
bool_op :: or | and
simple_exp :: &lt;attribute&gt; [type:]&lt;binary_op&gt; &lt;value&gt;
          | &lt;unary_op&gt; &lt;attribute&gt;
          | date &lt;date_expr&gt;
type :: string | version | number
binary_op :: lt | gt | lte | gte | eq | ne
unary_op :: defined | not_defined

date_expr :: lt &lt;end&gt;
         | gt &lt;start&gt;
         | in start=&lt;start&gt; end=&lt;end&gt;
         | in start=&lt;start&gt; &lt;duration&gt;
         | spec &lt;date_spec&gt;
duration|date_spec ::
         hours=&lt;value&gt;
         | monthdays=&lt;value&gt;
         | weekdays=&lt;value&gt;
         | yearsdays=&lt;value&gt;
         | months=&lt;value&gt;
         | weeks=&lt;value&gt;
         | years=&lt;value&gt;
         | weekyears=&lt;value&gt;
         | moon=&lt;value&gt;</code></pre>
</div></div>
<div class="paragraph"><p>Examples:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>location conn_1 internal_www 100: node1

location conn_1 internal_www \
  rule 50: #uname eq node1 \
  rule pingd: defined pingd

location conn_2 dummy_float \
  rule -inf: not_defined pingd or pingd number:lte 0

# never probe for rsc1 on node1
location no-probe rsc1 resource-discovery=never -inf: node1</code></pre>
</div></div>
</div>
<div class="sect3">
<h4 id="cmdhelp_configure_modgroup"><code>modgroup</code></h4>
<div class="paragraph"><p>Add or remove primitives in a group. The <code>add</code> subcommand appends
the new group member by default. Should it go elsewhere, there
are <code>after</code> and <code>before</code> clauses.</p></div>
<div class="paragraph"><p>Usage:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>modgroup &lt;id&gt; add &lt;id&gt; [after &lt;id&gt;|before &lt;id&gt;]
modgroup &lt;id&gt; remove &lt;id&gt;</code></pre>
</div></div>
<div class="paragraph"><p>Examples:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>modgroup share1 add storage2 before share1-fs</code></pre>
</div></div>
</div>
<div class="sect3">
<h4 id="cmdhelp_configure_monitor"><code>monitor</code></h4>
<div class="paragraph"><p>Monitor is by far the most common operation. It is possible to
add it without editing the whole resource. Also, long primitive
definitions may be a bit uncluttered. In order to make this
command as concise as possible, less common operation attributes
are not available. If you need them, then use the <code>op</code> part of
the <code>primitive</code> command.</p></div>
<div class="paragraph"><p>Usage:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>monitor &lt;rsc&gt;[:&lt;role&gt;] &lt;interval&gt;[:&lt;timeout&gt;]</code></pre>
</div></div>
<div class="paragraph"><p>Example:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>monitor apcfence 60m:60s</code></pre>
</div></div>
<div class="paragraph"><p>Note that after executing the command, the monitor operation may
be shown as part of the primitive definition.</p></div>
</div>
<div class="sect3">
<h4 id="cmdhelp_configure_ms"><code>ms</code> (<code>master</code>)</h4>
<div class="paragraph"><p>The <code>ms</code> command creates a master/slave resource type. It may contain a
single primitive resource or one group of resources.</p></div>
<div class="paragraph"><p>Usage:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>ms &lt;name&gt; &lt;rsc&gt;
  [description=&lt;description&gt;]
  [meta attr_list]
  [params attr_list]

attr_list :: [$id=&lt;id&gt;] &lt;attr&gt;=&lt;val&gt; [&lt;attr&gt;=&lt;val&gt;...] | $id-ref=&lt;id&gt;</code></pre>
</div></div>
<div class="paragraph"><p>Example:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>ms disk1 drbd1 \
  meta notify=true globally-unique=false</code></pre>
</div></div>
<div class="sidebarblock">
<div class="content">
<div class="title">Note on <code>id-ref</code> usage</div>
<div class="paragraph"><p>Instance or meta attributes (&#8216;params` and <code>meta</code>) may contain
a reference to another set of attributes. In that case, no other
attributes are allowed. Since attribute sets&#8217; ids, though they do
exist, are not shown in the <code>crm</code>, it is also possible to
reference an object instead of an attribute set. <code>crm</code> will
automatically replace such a reference with the right id:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>crm(live)configure# primitive a2 www-2 meta $id-ref=a1
crm(live)configure# show a2
primitive a2 apache \
    meta $id-ref=a1-meta_attributes
    [...]</code></pre>
</div></div>
<div class="paragraph"><p>It is advisable to give meaningful names to attribute sets which
are going to be referenced.</p></div>
</div></div>
</div>
<div class="sect3">
<h4 id="cmdhelp_configure_node"><code>node</code></h4>
<div class="paragraph"><p>The node command describes a cluster node. Nodes in the CIB are
commonly created automatically by the CRM. Hence, you should not
need to deal with nodes unless you also want to define node
attributes. Note that it is also possible to manage node
attributes at the <code>node</code> level.</p></div>
<div class="paragraph"><p>Usage:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>node [$id=&lt;id&gt;] &lt;uname&gt;[:&lt;type&gt;]
  [description=&lt;description&gt;]
  [attributes [$id=&lt;id&gt;] [&lt;score&gt;:] [rule...]
    &lt;param&gt;=&lt;value&gt; [&lt;param&gt;=&lt;value&gt;...]] | $id-ref=&lt;ref&gt;
  [utilization [$id=&lt;id&gt;] [&lt;score&gt;:] [rule...]
    &lt;param&gt;=&lt;value&gt; [&lt;param&gt;=&lt;value&gt;...]] | $id-ref=&lt;ref&gt;

type :: normal | member | ping | remote</code></pre>
</div></div>
<div class="paragraph"><p>Example:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>node node1
node big_node attributes memory=64</code></pre>
</div></div>
</div>
<div class="sect3">
<h4 id="cmdhelp_configure_op_defaults"><code>op_defaults</code></h4>
<div class="paragraph"><p>Set defaults for the operations meta attributes.</p></div>
<div class="paragraph"><p>For more information on rule expressions, see
<a href="#topics_Syntax_RuleExpressions">Syntax: Rule expressions</a>.</p></div>
<div class="paragraph"><p>Usage:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>op_defaults [$id=&lt;set_id&gt;] [rule ...] &lt;option&gt;=&lt;value&gt; [&lt;option&gt;=&lt;value&gt; ...]</code></pre>
</div></div>
<div class="paragraph"><p>Example:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>op_defaults record-pending=true</code></pre>
</div></div>
</div>
<div class="sect3">
<h4 id="cmdhelp_configure_order"><code>order</code></h4>
<div class="paragraph"><p>This constraint expresses the order of actions on two resources
or more resources. If there are more than two resources, then the
constraint is called a resource set.</p></div>
<div class="paragraph"><p>Ordered resource sets have an extra attribute to allow for sets
of resources whose actions may run in parallel. The shell syntax
for such sets is to put resources in parentheses.</p></div>
<div class="paragraph"><p>If the subsequent resource can start or promote after any one of the
resources in a set has done, enclose the set in brackets (<code>[</code> and <code>]</code>).</p></div>
<div class="paragraph"><p>Sets cannot be nested.</p></div>
<div class="paragraph"><p>Three strings are reserved to specify a kind of order constraint:
<code>Mandatory</code>, <code>Optional</code>, and <code>Serialize</code>. It is preferred to use
one of these settings instead of score. Previous versions mapped
scores <code>0</code> and <code>inf</code> to keywords <code>advisory</code> and <code>mandatory</code>.
That is still valid but deprecated.</p></div>
<div class="paragraph"><p>For more details on how to configure resource sets, see
<a href="#topics_Features_Resourcesets"><code>Syntax: Resource sets</code></a>.</p></div>
<div class="paragraph"><p>Usage:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>order &lt;id&gt; [{kind|&lt;score&gt;}:] first then [symmetrical=&lt;bool&gt;]

order &lt;id&gt; [{kind|&lt;score&gt;}:] resource_sets [symmetrical=&lt;bool&gt;]

kind :: Mandatory | Optional | Serialize

first :: &lt;rsc&gt;[:&lt;action&gt;]

then ::  &lt;rsc&gt;[:&lt;action&gt;]

resource_sets :: resource_set [resource_set ...]

resource_set :: ["["|"("] &lt;rsc&gt;[:&lt;action&gt;] [&lt;rsc&gt;[:&lt;action&gt;] ...] \
                [attributes] ["]"|")"]

attributes :: [require-all=(true|false)] [sequential=(true|false)]</code></pre>
</div></div>
<div class="paragraph"><p>Example:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>order o-1 Mandatory: apache:start ip_1
order o-2 Serialize: A ( B C )
order o-3 inf: [ A B ] C
order o-4 first-resource then-resource</code></pre>
</div></div>
</div>
<div class="sect3">
<h4 id="cmdhelp_configure_primitive"><code>primitive</code></h4>
<div class="paragraph"><p>The primitive command describes a resource. It may be referenced
only once in group, clone, or master-slave objects. If it&#8217;s not
referenced, then it is placed as a single resource in the CIB.</p></div>
<div class="paragraph"><p>Operations may be specified anonymously, as a group or by reference:</p></div>
<div class="ulist"><ul>
<li>
<p>
"Anonymous", as a list of <code>op</code> specifications. Use this
  method if you don&#8217;t need to reference the set of operations
  elsewhere. This is the most common way to define operations.
</p>
</li>
<li>
<p>
If reusing operation sets is desired, use the <code>operations</code> keyword
  along with an id to give the operations set a name. Use the
  <code>operations</code> keyword and an id-ref value set to the id of another
  operations set, to apply the same set of operations to this
  primitive.
</p>
</li>
</ul></div>
<div class="paragraph"><p>Operation attributes which are not recognized are saved as
instance attributes of that operation. A typical example is
<code>OCF_CHECK_LEVEL</code>.</p></div>
<div class="paragraph"><p>For multistate resources, roles are specified as <code>role=&lt;role&gt;</code>.</p></div>
<div class="paragraph"><p>A template may be defined for resources which are of the same
type and which share most of the configuration. See
<a href="#cmdhelp_configure_rsc_template"><code>rsc_template</code></a> for more information.</p></div>
<div class="paragraph"><p>Attributes containing time values, such as the <code>interval</code> attribute on
operations, are configured either as a plain number, which is
interpreted as a time in seconds, or using one of the following
suffixes:</p></div>
<div class="ulist"><ul>
<li>
<p>
<code>s</code>, <code>sec</code> - time in seconds (same as no suffix)
</p>
</li>
<li>
<p>
<code>ms</code>, <code>msec</code> - time in milliseconds
</p>
</li>
<li>
<p>
<code>us</code>, <code>usec</code> - time in microseconds
</p>
</li>
<li>
<p>
<code>m</code>, <code>min</code> - time in minutes
</p>
</li>
<li>
<p>
<code>h</code>, <code>hr</code> - time in hours
</p>
</li>
</ul></div>
<div class="paragraph"><p>Usage:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>primitive &lt;rsc&gt; {[&lt;class&gt;:[&lt;provider&gt;:]]&lt;type&gt;|@&lt;template&gt;}
  [description=&lt;description&gt;]
  [[params] attr_list]
  [meta attr_list]
  [utilization attr_list]
  [operations id_spec]
    [op op_type [&lt;attribute&gt;=&lt;value&gt;...] ...]

attr_list :: [$id=&lt;id&gt;] [&lt;score&gt;:] [rule...]
             &lt;attr&gt;=&lt;val&gt; [&lt;attr&gt;=&lt;val&gt;...]] | $id-ref=&lt;id&gt;
id_spec :: $id=&lt;id&gt; | $id-ref=&lt;id&gt;
op_type :: start | stop | monitor</code></pre>
</div></div>
<div class="paragraph"><p>Example:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>primitive apcfence stonith:apcsmart \
  params ttydev=/dev/ttyS0 hostlist="node1 node2" \
  op start timeout=60s \
  op monitor interval=30m timeout=60s

primitive www8 apache \
  configfile=/etc/apache/www8.conf \
  operations $id-ref=apache_ops

primitive db0 mysql \
  params config=/etc/mysql/db0.conf \
  op monitor interval=60s \
  op monitor interval=300s OCF_CHECK_LEVEL=10

primitive r0 ocf:linbit:drbd \
  params drbd_resource=r0 \
  op monitor role=Master interval=60s \
  op monitor role=Slave interval=300s

primitive xen0 @vm_scheme1 xmfile=/etc/xen/vm/xen0

primitive mySpecialRsc Special \
  params 3: rule #uname eq node1 interface=eth1 \
  params 2: rule #uname eq node2 interface=eth2 port=8888 \
  params 1: interface=eth0 port=9999</code></pre>
</div></div>
</div>
<div class="sect3">
<h4 id="cmdhelp_configure_property"><code>property</code></h4>
<div class="paragraph"><p>Set cluster configuration properties. To list the
available cluster configuration properties, use the
<a href="#cmdhelp_ra_info"><code>ra info</code></a> command with <code>pengine</code>, <code>crmd</code>,
<code>cib</code> and <code>stonithd</code> as arguments.</p></div>
<div class="paragraph"><p>For more information on rule expressions, see
<a href="#topics_Syntax_RuleExpressions">Syntax: Rule expressions</a>.</p></div>
<div class="paragraph"><p>Usage:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>property [&lt;set_id&gt;:] [rule ...] &lt;option&gt;=&lt;value&gt; [&lt;option&gt;=&lt;value&gt; ...]</code></pre>
</div></div>
<div class="paragraph"><p>Example:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>property stonith-enabled=true
property rule date spec years=2014 stonith-enabled=false</code></pre>
</div></div>
</div>
<div class="sect3">
<h4 id="cmdhelp_configure_ptest"><code>ptest</code> (<code>simulate</code>)</h4>
<div class="paragraph"><p>Show PE (Policy Engine) motions using <code>ptest(8)</code> or
<code>crm_simulate(8)</code>.</p></div>
<div class="paragraph"><p>A CIB is constructed using the current user edited configuration
and the status from the running CIB. The resulting CIB is run
through <code>ptest</code> (or <code>crm_simulate</code>) to show changes which would
happen if the configuration is committed.</p></div>
<div class="paragraph"><p>The status section may be loaded from another source and modified
using the <a href="#cmdhelp_cibstatus"><code>cibstatus</code></a> level commands. In that case, the
<code>ptest</code> command will issue a message informing the user that the
Policy Engine graph is not calculated based on the current status
section and therefore won&#8217;t show what would happen to the
running but some imaginary cluster.</p></div>
<div class="paragraph"><p>If you have graphviz installed and X11 session, <code>dotty(1)</code> is run
to display the changes graphically.</p></div>
<div class="paragraph"><p>Add a string of <code>v</code> characters to increase verbosity. <code>ptest</code>
can also show allocation scores. <code>utilization</code> turns on
information about the remaining capacity of nodes. With the
<code>actions</code> option, <code>ptest</code> will print all resource actions.</p></div>
<div class="paragraph"><p>The <code>ptest</code> program has been replaced by <code>crm_simulate</code> in newer
Pacemaker versions. In some installations both could be
installed. Use <code>simulate</code> to enfore using <code>crm_simulate</code>.</p></div>
<div class="paragraph"><p>Usage:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>ptest [nograph] [v...] [scores] [actions] [utilization]</code></pre>
</div></div>
<div class="paragraph"><p>Examples:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>ptest scores
ptest vvvvv
simulate actions</code></pre>
</div></div>
</div>
<div class="sect3">
<h4 id="cmdhelp_configure_refresh"><code>refresh</code></h4>
<div class="paragraph"><p>Refresh the internal structures from the CIB. All changes made
during this session are lost.</p></div>
<div class="paragraph"><p>Usage:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>refresh</code></pre>
</div></div>
</div>
<div class="sect3">
<h4 id="cmdhelp_configure_rename"><code>rename</code></h4>
<div class="paragraph"><p>Rename an object. It is recommended to use this command to rename
a resource, because it will take care of updating all related
constraints and a parent resource. Changing ids with the edit
command won&#8217;t have the same effect.</p></div>
<div class="paragraph"><p>If you want to rename a resource, it must be in the stopped state.</p></div>
<div class="paragraph"><p>Usage:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>rename &lt;old_id&gt; &lt;new_id&gt;</code></pre>
</div></div>
</div>
<div class="sect3">
<h4 id="cmdhelp_configure_role"><code>role</code></h4>
<div class="paragraph"><p>An ACL role is a set of rules which describe access rights to
CIB. Rules consist of an access right <code>read</code>, <code>write</code>, or <code>deny</code>
and a specification denoting part of the configuration to which
the access right applies. The specification can be an XPath or a
combination of tag and id references. If an attribute is
appended, then the specification applies only to that attribute
of the matching element.</p></div>
<div class="paragraph"><p>There is a number of shortcuts for XPath specifications. The
<code>meta</code>, <code>params</code>, and <code>utilization</code> shortcuts reference resource
meta attributes, parameters, and utilization respectively. The
<code>location</code> may be used to specify location constraints most of
the time to allow resource <code>move</code> and <code>unmove</code> commands. The
<code>property</code> references cluster properties. The <code>node</code> allows
reading node attributes. <code>nodeattr</code> and <code>nodeutil</code> reference node
attributes and node capacity (utilization). The <code>status</code> shortcut
references the whole status section of the CIB. Read access to
status is necessary for various monitoring tools such as
<code>crm_mon(8)</code> (aka <code>crm status</code>).</p></div>
<div class="paragraph"><p>For more information on rule expressions, see
<a href="#topics_Syntax_RuleExpressions">Syntax: Rule expressions</a>.</p></div>
<div class="paragraph"><p>Usage:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>role &lt;role-id&gt; rule [rule ...]

rule :: acl-right cib-spec [attribute:&lt;attribute&gt;]

acl-right :: read | write | deny

cib-spec :: xpath-spec | tag-ref-spec
xpath-spec :: xpath:&lt;xpath&gt; | shortcut
tag-ref-spec :: tag:&lt;tag&gt; | ref:&lt;id&gt; | tag:&lt;tag&gt; ref:&lt;id&gt;

shortcut :: meta:&lt;rsc&gt;[:&lt;attr&gt;]
        params:&lt;rsc&gt;[:&lt;attr&gt;]
        utilization:&lt;rsc&gt;
        location:&lt;rsc&gt;
        property[:&lt;attr&gt;]
        node[:&lt;node&gt;]
        nodeattr[:&lt;attr&gt;]
        nodeutil[:&lt;node&gt;]
        status</code></pre>
</div></div>
<div class="paragraph"><p>Example:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>role app1_admin \
    write meta:app1:target-role \
    write meta:app1:is-managed \
    write location:app1 \
    read ref:app1</code></pre>
</div></div>
</div>
<div class="sect3">
<h4 id="cmdhelp_configure_rsc_defaults"><code>rsc_defaults</code></h4>
<div class="paragraph"><p>Set defaults for the resource meta attributes.</p></div>
<div class="paragraph"><p>For more information on rule expressions, see
<a href="#topics_Syntax_RuleExpressions">Syntax: Rule expressions</a>.</p></div>
<div class="paragraph"><p>Usage:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>rsc_defaults [&lt;set_id&gt;:] [rule ...] &lt;option&gt;=&lt;value&gt; [&lt;option&gt;=&lt;value&gt; ...]</code></pre>
</div></div>
<div class="paragraph"><p>Example:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>rsc_defaults failure-timeout=3m</code></pre>
</div></div>
</div>
<div class="sect3">
<h4 id="cmdhelp_configure_rsc_template"><code>rsc_template</code></h4>
<div class="paragraph"><p>The <code>rsc_template</code> command creates a resource template. It may be
referenced in primitives. It is used to reduce large
configurations with many similar resources.</p></div>
<div class="paragraph"><p>Usage:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>rsc_template &lt;name&gt; [&lt;class&gt;:[&lt;provider&gt;:]]&lt;type&gt;
  [description=&lt;description&gt;]
  [params attr_list]
  [meta attr_list]
  [utilization attr_list]
  [operations id_spec]
    [op op_type [&lt;attribute&gt;=&lt;value&gt;...] ...]

attr_list :: [$id=&lt;id&gt;] &lt;attr&gt;=&lt;val&gt; [&lt;attr&gt;=&lt;val&gt;...] | $id-ref=&lt;id&gt;
id_spec :: $id=&lt;id&gt; | $id-ref=&lt;id&gt;
op_type :: start | stop | monitor</code></pre>
</div></div>
<div class="paragraph"><p>Example:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>rsc_template public_vm Xen \
  op start timeout=300s \
  op stop timeout=300s \
  op monitor interval=30s timeout=60s \
  op migrate_from timeout=600s \
  op migrate_to timeout=600s
primitive xen0 @public_vm \
  params xmfile=/etc/xen/xen0
primitive xen1 @public_vm \
  params xmfile=/etc/xen/xen1</code></pre>
</div></div>
</div>
<div class="sect3">
<h4 id="cmdhelp_configure_rsc_ticket"><code>rsc_ticket</code></h4>
<div class="paragraph"><p>This constraint expresses dependency of resources on cluster-wide
attributes, also known as tickets. Tickets are mainly used in
geo-clusters, which consist of multiple sites. A ticket may be
granted to a site, thus allowing resources to run there.</p></div>
<div class="paragraph"><p>The <code>loss-policy</code> attribute specifies what happens to the
resource (or resources) if the ticket is revoked. The default is
either <code>stop</code> or <code>demote</code> depending on whether a resource is
multi-state.</p></div>
<div class="paragraph"><p>See also the <a href="#cmdhelp_site_ticket"><code>site</code></a> set of commands.</p></div>
<div class="paragraph"><p>Usage:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>rsc_ticket &lt;id&gt; &lt;ticket_id&gt;: &lt;rsc&gt;[:&lt;role&gt;] [&lt;rsc&gt;[:&lt;role&gt;] ...]
  [loss-policy=&lt;loss_policy_action&gt;]

loss_policy_action :: stop | demote | fence | freeze</code></pre>
</div></div>
<div class="paragraph"><p>Example:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>rsc_ticket ticket-A_public-ip ticket-A: public-ip
rsc_ticket ticket-A_bigdb ticket-A: bigdb loss-policy=fence
rsc_ticket ticket-B_storage ticket-B: drbd-a:Master drbd-b:Master</code></pre>
</div></div>
</div>
<div class="sect3">
<h4 id="cmdhelp_configure_rsctest"><code>rsctest</code></h4>
<div class="paragraph"><p>Test resources with current resource configuration. If no nodes
are specified, tests are run on all known nodes.</p></div>
<div class="paragraph"><p>The order of resources is significant: it is assumed that later
resources depend on earlier ones.</p></div>
<div class="paragraph"><p>If a resource is multi-state, it is assumed that the role on
which later resources depend is master.</p></div>
<div class="paragraph"><p>Tests are run sequentially to prevent running the same resource
on two or more nodes. Tests are carried out only if none of the
specified nodes currently run any of the specified resources.
However, it won&#8217;t verify whether resources run on the other
nodes.</p></div>
<div class="paragraph"><p>Superuser privileges are obviously required: either run this as
root or setup the <code>sudoers</code> file appropriately.</p></div>
<div class="paragraph"><p>Note that resource testing may take some time.</p></div>
<div class="paragraph"><p>Usage:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>rsctest &lt;rsc_id&gt; [&lt;rsc_id&gt; ...] [&lt;node_id&gt; ...]</code></pre>
</div></div>
<div class="paragraph"><p>Examples:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>rsctest my_ip websvc
rsctest websvc nodeB</code></pre>
</div></div>
</div>
<div class="sect3">
<h4 id="cmdhelp_configure_save"><code>save</code></h4>
<div class="paragraph"><p>Save the current configuration to a file. Optionally, as XML. Use
<code>-</code> instead of file name to write the output to <code>stdout</code>.</p></div>
<div class="paragraph"><p>The <code>save</code> command accepts the same selection arguments as the <code>show</code>
command. See the <a href="#cmdhelp_configure_show">help section</a> for <code>show</code>
for more details.</p></div>
<div class="paragraph"><p>Usage:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>save [xml] [&lt;id&gt; | type:&lt;type | tag:&lt;tag&gt; |
            related:&lt;obj&gt; | changed ...] &lt;file&gt;</code></pre>
</div></div>
<div class="paragraph"><p>Example:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>save myfirstcib.txt
save web-server server-config.txt</code></pre>
</div></div>
</div>
<div class="sect3">
<h4 id="cmdhelp_configure_schema"><code>schema</code></h4>
<div class="paragraph"><p>CIB&#8217;s content is validated by a RNG schema. Pacemaker supports
several, depending on version. At least the following schemas are
accepted by <code>crmsh</code>:</p></div>
<div class="ulist"><ul>
<li>
<p>
<code>pacemaker-1.0</code>
</p>
</li>
<li>
<p>
<code>pacemaker-1.1</code>
</p>
</li>
<li>
<p>
<code>pacemaker-1.2</code>
</p>
</li>
<li>
<p>
<code>pacemaker-1.3</code>
</p>
</li>
<li>
<p>
<code>pacemaker-2.0</code>
</p>
</li>
</ul></div>
<div class="paragraph"><p>Use this command to display or switch to another RNG schema.</p></div>
<div class="paragraph"><p>Usage:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>schema [&lt;schema&gt;]</code></pre>
</div></div>
<div class="paragraph"><p>Example:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>schema pacemaker-1.1</code></pre>
</div></div>
</div>
<div class="sect3">
<h4 id="cmdhelp_configure_set"><code>set</code></h4>
<div class="paragraph"><p>Set the value of a configured attribute. The attribute must
have a value configured previously, and can be an agent
parameter, meta attribute or utilization value.</p></div>
<div class="paragraph"><p>The first argument to the command is a path to an attribute.
This is a dot-separated sequence beginning with the name of
the resource, and ending with the name of the attribute to
set.</p></div>
<div class="paragraph"><p>Usage:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>set &lt;path&gt; &lt;value&gt;</code></pre>
</div></div>
<div class="paragraph"><p>Examples:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>set vip1.ip 192.168.20.5
set vm-a.force_stop 1</code></pre>
</div></div>
</div>
<div class="sect3">
<h4 id="cmdhelp_configure_show"><code>show</code></h4>
<div class="paragraph"><p>The <code>show</code> command displays CIB objects. Without any argument, it
displays all objects in the CIB, but the set of objects displayed by
<code>show</code> can be limited to only objects with the given IDs or by using
one or more of the special prefixes described below.</p></div>
<div class="paragraph"><p>The XML representation for the objects can be displayed by passing
<code>xml</code> as the first argument.</p></div>
<div class="paragraph"><p>To show one or more specific objects, pass the object IDs as
arguments.</p></div>
<div class="paragraph"><p>To show all objects of a certain type, use the <code>type:</code> prefix.</p></div>
<div class="paragraph"><p>To show all objects in a tag, use the <code>tag:</code> prefix.</p></div>
<div class="paragraph"><p>To show all constraints related to a primitive, use the <code>related:</code> prefix.</p></div>
<div class="paragraph"><p>To show all modified objects, pass the argument <code>changed</code>.</p></div>
<div class="paragraph"><p>The prefixes can be used together on a single command line. For
example, to show both the tag itself and the objects tagged by it the
following combination can be used: <code>show tag:my-tag my-tag</code>.</p></div>
<div class="paragraph"><p>To refine a selection of objects using multiple modifiers, the keywords
<code>and</code> and <code>or</code> can be used. For example, to select all primitives tagged
<code>foo</code>, the following combination can be used:
<code>show type:primitive and tag:foo</code>.</p></div>
<div class="paragraph"><p>To hide values when displaying the configuration, use the
<code>obscure:&lt;glob&gt;</code> argument. This can be useful when sending the
configuration over a public channel, to avoid exposing potentially
sensitive information. The <code>&lt;glob&gt;</code> argument is a bash-style pattern
matching attribute keys.</p></div>
<div class="paragraph"><p>Usage:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>show [xml] [&lt;id&gt;
           | changed
           | type:&lt;type&gt;
           | tag:&lt;id&gt;
           | related:&lt;obj&gt;
           | obscure:&lt;glob&gt;
           ...]

type :: node | primitive | group | clone | ms | rsc_template
      | location | colocation | order
      | rsc_ticket
      | property | rsc_defaults | op_defaults
      | fencing_topology
      | role | user | acl_target
      | tag</code></pre>
</div></div>
<div class="paragraph"><p>Example:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>show webapp
show type:primitive
show xml tag:db tag:fs
show related:webapp
show type:primitive obscure:passwd</code></pre>
</div></div>
</div>
<div class="sect3">
<h4 id="cmdhelp_configure_tag"><code>tag</code></h4>
<div class="paragraph"><p>Define a resource tag. A tag is an id referring to one or more
resources, without implying any constraints between the tagged
resources. This can be useful for grouping conceptually related
resources.</p></div>
<div class="paragraph"><p>Usage:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>tag &lt;tag-name&gt;: &lt;rsc&gt; [&lt;rsc&gt; ...]
tag &lt;tag-name&gt; &lt;rsc&gt; [&lt;rsc&gt; ...]</code></pre>
</div></div>
<div class="paragraph"><p>Example:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>tag web: p-webserver p-vip
tag ips server-vip admin-vip</code></pre>
</div></div>
</div>
<div class="sect3">
<h4 id="cmdhelp_configure_template"><code>template</code></h4>
<div class="paragraph"><p>The specified template is loaded into the editor. It&#8217;s up to the
user to make a good CRM configuration out of it. See also the
<a href="#cmdhelp_template">template section</a>.</p></div>
<div class="paragraph"><p>Usage:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>template [xml] url</code></pre>
</div></div>
<div class="paragraph"><p>Example:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>template two-apaches.txt</code></pre>
</div></div>
</div>
<div class="sect3">
<h4 id="cmdhelp_configure_upgrade"><code>upgrade</code></h4>
<div class="paragraph"><p>Attempts to upgrade the CIB to validate with the current
version. Commonly, this is required if the error
<code>CIB not supported</code> occurs. It typically means that the
active CIB version is coming from an older release.</p></div>
<div class="paragraph"><p>As a safety precaution, the force argument is required if the
<code>validation-with</code> attribute is set to anything other than
<code>0.6</code>. Thus in most cases, it is required.</p></div>
<div class="paragraph"><p>Usage:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>upgrade [force]</code></pre>
</div></div>
<div class="paragraph"><p>Example:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>upgrade force</code></pre>
</div></div>
</div>
<div class="sect3">
<h4 id="cmdhelp_configure_user"><code>user</code></h4>
<div class="paragraph"><p>Users which normally cannot view or manage cluster configuration
can be allowed access to parts of the CIB. The access is defined
by a set of <code>read</code>, <code>write</code>, and <code>deny</code> rules as in role
definitions or by referencing roles. The latter is considered
best practice.</p></div>
<div class="paragraph"><p>For more information on rule expressions, see
<a href="#topics_Syntax_RuleExpressions">Syntax: Rule expressions</a>.</p></div>
<div class="paragraph"><p>Usage:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>user &lt;uid&gt; {roles|rules}

roles :: role:&lt;role-ref&gt; [role:&lt;role-ref&gt; ...]
rules :: rule [rule ...]</code></pre>
</div></div>
<div class="paragraph"><p>Example:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>user joe \
    role:app1_admin \
    role:read_all</code></pre>
</div></div>
</div>
<div class="sect3">
<h4 id="cmdhelp_configure_validate_all"><code>validate-all</code></h4>
<div class="paragraph"><p>Call the <code>validate-all</code> action for the resource, if possible.</p></div>
<div class="paragraph"><p>Limitations:</p></div>
<div class="ulist"><ul>
<li>
<p>
The resource agent must implement the <code>validate-all</code> action.
</p>
</li>
<li>
<p>
The current user must be root.
</p>
</li>
<li>
<p>
The primitive resource must not use nvpair references.
</p>
</li>
</ul></div>
<div class="paragraph"><p>Usage:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>validate-all &lt;rsc&gt;</code></pre>
</div></div>
</div>
<div class="sect3">
<h4 id="cmdhelp_configure_verify"><code>verify</code></h4>
<div class="paragraph"><p>Verify the contents of the CIB which would be committed.</p></div>
<div class="paragraph"><p>Usage:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>verify</code></pre>
</div></div>
</div>
<div class="sect3">
<h4 id="cmdhelp_configure_xml"><code>xml</code></h4>
<div class="paragraph"><p>Even though we promissed no xml, it may happen, but hopefully
very very seldom, that an element from the CIB cannot be rendered
in the configuration language. In that case, the element will be
shown as raw xml, prefixed by this command. That element can then
be edited like any other. If the shell finds out that after the
change it can digest it, then it is going to be converted into
the normal configuration language. Otherwise, there is no need to
use <code>xml</code> for configuration.</p></div>
<div class="paragraph"><p>Usage:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>xml &lt;xml&gt;</code></pre>
</div></div>
</div>
</div>
<div class="sect2">
<h3 id="cmdhelp_template"><code>template</code> - Import configuration from templates</h3>
<div class="paragraph"><p>User may be assisted in the cluster configuration by templates
prepared in advance. Templates consist of a typical ready
configuration which may be edited to suit particular user needs.</p></div>
<div class="paragraph"><p>This command enters a template level where additional commands
for configuration/template management are available.</p></div>
<div class="sect3">
<h4 id="cmdhelp_template_apply"><code>apply</code></h4>
<div class="paragraph"><p>Copy the current or given configuration to the current CIB. By
default, the CIB is replaced, unless the method is set to
"update".</p></div>
<div class="paragraph"><p>Usage:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>apply [&lt;method&gt;] [&lt;config&gt;]

method :: replace | update</code></pre>
</div></div>
</div>
<div class="sect3">
<h4 id="cmdhelp_template_delete"><code>delete</code></h4>
<div class="paragraph"><p>Remove a configuration. The loaded (active) configuration may be
removed by force.</p></div>
<div class="paragraph"><p>Usage:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>delete &lt;config&gt; [force]</code></pre>
</div></div>
</div>
<div class="sect3">
<h4 id="cmdhelp_template_edit"><code>edit</code></h4>
<div class="paragraph"><p>Edit current or given configuration using your favourite editor.</p></div>
<div class="paragraph"><p>Usage:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>edit [&lt;config&gt;]</code></pre>
</div></div>
</div>
<div class="sect3">
<h4 id="cmdhelp_template_list"><code>list</code></h4>
<div class="paragraph"><p>When called with no argument, lists existing templates and
configurations.</p></div>
<div class="paragraph"><p>Given the argument <code>templates</code>, lists the available templates.</p></div>
<div class="paragraph"><p>Given the argument <code>configs</code>, lists the available configurations.</p></div>
<div class="paragraph"><p>Usage:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>list [templates|configs]</code></pre>
</div></div>
</div>
<div class="sect3">
<h4 id="cmdhelp_template_load"><code>load</code></h4>
<div class="paragraph"><p>Load an existing configuration. Further <code>edit</code>, <code>show</code>, and
<code>apply</code> commands will refer to this configuration.</p></div>
<div class="paragraph"><p>Usage:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>load &lt;config&gt;</code></pre>
</div></div>
</div>
<div class="sect3">
<h4 id="cmdhelp_template_new"><code>new</code></h4>
<div class="paragraph"><p>Create a new configuration from one or more templates. Note that
configurations and templates are kept in different places, so it
is possible to have a configuration name equal a template name.</p></div>
<div class="paragraph"><p>If you already know which parameters are required, you can set
them directly on the command line.</p></div>
<div class="paragraph"><p>The parameter name <code>id</code> is set by default to the name of the
configuration.</p></div>
<div class="paragraph"><p>If no parameters are being set and you don&#8217;t want a particular name
for your configuration, you can call this command with a template name
as the only parameter. A unique configuration name based on the
template name will be generated.</p></div>
<div class="paragraph"><p>Usage:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>new [&lt;config&gt;] &lt;template&gt; [&lt;template&gt; ...] [params name=value ...]</code></pre>
</div></div>
<div class="paragraph"><p>Example:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>new vip virtual-ip
new bigfs ocfs2 params device=/dev/sdx8 directory=/bigfs
new apache</code></pre>
</div></div>
</div>
<div class="sect3">
<h4 id="cmdhelp_template_show"><code>show</code></h4>
<div class="paragraph"><p>Process the current or given configuration and display the result.</p></div>
<div class="paragraph"><p>Usage:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>show [&lt;config&gt;]</code></pre>
</div></div>
</div>
</div>
<div class="sect2">
<h3 id="cmdhelp_cibstatus"><code>cibstatus</code> - CIB status management and editing</h3>
<div class="paragraph"><p>The <code>status</code> section of the CIB keeps the current status of nodes
and resources. It is modified <em>only</em> on events, i.e. when some
resource operation is run or node status changes. For obvious
reasons, the CRM has no user interface with which it is possible
to affect the status section. From the user&#8217;s point of view, the
status section is essentially a read-only part of the CIB. The
current status is never even written to disk, though it is
available in the PE (Policy Engine) input files which represent
the history of cluster motions. The current status may be read
using the <code>cibadmin -Q</code> command.</p></div>
<div class="paragraph"><p>It may sometimes be of interest to see how status changes would
affect the Policy Engine. The set of &#8216;cibstatus` level commands
allow the user to load status sections from various sources and
then insert or modify resource operations or change nodes&#8217; state.</p></div>
<div class="paragraph"><p>The effect of those changes may then be observed by running the
<a href="#cmdhelp_configure_ptest"><code>ptest</code></a> command at the <code>configure</code> level
or <code>simulate</code> and <code>run</code> commands at this level. The <code>ptest</code>
runs with the user edited CIB whereas the latter two commands
run with the CIB which was loaded along with the status section.</p></div>
<div class="paragraph"><p>The <code>simulate</code> and <code>run</code> commands as well as all status
modification commands are implemented using <code>crm_simulate(8)</code>.</p></div>
<div class="sect3">
<h4 id="cmdhelp_cibstatus_load"><code>load</code></h4>
<div class="paragraph"><p>Load a status section from a file, a shadow CIB, or the running
cluster. By default, the current (<code>live</code>) status section is
modified. Note that if the <code>live</code> status section is modified it
is not going to be updated if the cluster status changes, because
that would overwrite the user changes. To make <code>crm</code> drop changes
and resume use of the running cluster status, run <code>load live</code>.</p></div>
<div class="paragraph"><p>All CIB shadow configurations contain the status section which is
a snapshot of the status section taken at the time the shadow was
created. Obviously, this status section doesn&#8217;t have much to do
with the running cluster status, unless the shadow CIB has just
been created. Therefore, the <code>ptest</code> command by default uses the
running cluster status section.</p></div>
<div class="paragraph"><p>Usage:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>load {&lt;file&gt;|shadow:&lt;cib&gt;|live}</code></pre>
</div></div>
<div class="paragraph"><p>Example:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>load bug-12299.xml
load shadow:test1</code></pre>
</div></div>
</div>
<div class="sect3">
<h4 id="cmdhelp_cibstatus_node"><code>node</code></h4>
<div class="paragraph"><p>Change the node status. It is possible to throw a node out of
the cluster, make it a member, or set its state to unclean.</p></div>
<div class="dlist"><dl>
<dt class="hdlist1">
<code>online</code>
</dt>
<dd>
<p>
Set the <code>node_state</code> <code>crmd</code> attribute to <code>online</code>
and the <code>expected</code> and <code>join</code> attributes to <code>member</code>. The effect
is that the node becomes a cluster member.
</p>
</dd>
<dt class="hdlist1">
<code>offline</code>
</dt>
<dd>
<p>
Set the <code>node_state</code> <code>crmd</code> attribute to <code>offline</code>
and the <code>expected</code> attribute to empty. This makes the node
cleanly removed from the cluster.
</p>
</dd>
<dt class="hdlist1">
<code>unclean</code>
</dt>
<dd>
<p>
Set the <code>node_state</code> <code>crmd</code> attribute to <code>offline</code>
and the <code>expected</code> attribute to <code>member</code>. In this case the node
has unexpectedly disappeared.
</p>
</dd>
</dl></div>
<div class="paragraph"><p>Usage:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>node &lt;node&gt; {online|offline|unclean}</code></pre>
</div></div>
<div class="paragraph"><p>Example:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>node xen-b unclean</code></pre>
</div></div>
</div>
<div class="sect3">
<h4 id="cmdhelp_cibstatus_op"><code>op</code></h4>
<div class="paragraph"><p>Edit the outcome of a resource operation. This way you can
tell CRM that it ran an operation and that the resource agent
returned certain exit code. It is also possible to change the
operation&#8217;s status. In case the operation status is set to
something other than <code>done</code>, the exit code is effectively
ignored.</p></div>
<div class="paragraph"><p>Usage:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>op &lt;operation&gt; &lt;resource&gt; &lt;exit_code&gt; [&lt;op_status&gt;] [&lt;node&gt;]

operation :: probe | monitor[:&lt;n&gt;] | start | stop |
   promote | demote | notify | migrate_to | migrate_from
exit_code :: &lt;rc&gt; | success | generic | args |
   unimplemented | perm | installed | configured | not_running |
   master | failed_master
op_status :: pending | done | cancelled | timeout | notsupported | error

n :: the monitor interval in seconds; if omitted, the first
   recurring operation is referenced
rc :: numeric exit code in range 0..9</code></pre>
</div></div>
<div class="paragraph"><p>Example:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>op start d1 xen-b generic
op start d1 xen-b 1
op monitor d1 xen-b not_running
op stop d1 xen-b 0 timeout</code></pre>
</div></div>
</div>
<div class="sect3">
<h4 id="cmdhelp_cibstatus_origin"><code>origin</code></h4>
<div class="paragraph"><p>Show the origin of the status section currently in use. This
essentially shows the latest <code>load</code> argument.</p></div>
<div class="paragraph"><p>Usage:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>origin</code></pre>
</div></div>
</div>
<div class="sect3">
<h4 id="cmdhelp_cibstatus_quorum"><code>quorum</code></h4>
<div class="paragraph"><p>Set the quorum value.</p></div>
<div class="paragraph"><p>Usage:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>quorum &lt;bool&gt;</code></pre>
</div></div>
<div class="paragraph"><p>Example:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>quorum false</code></pre>
</div></div>
</div>
<div class="sect3">
<h4 id="cmdhelp_cibstatus_run"><code>run</code></h4>
<div class="paragraph"><p>Run the policy engine with the edited status section.</p></div>
<div class="paragraph"><p>Add a string of <code>v</code> characters to increase verbosity. Specify
<code>scores</code> to see allocation scores also. <code>utilization</code> turns on
information about the remaining capacity of nodes.</p></div>
<div class="paragraph"><p>If you have graphviz installed and X11 session, <code>dotty(1)</code> is run
to display the changes graphically.</p></div>
<div class="paragraph"><p>Usage:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>run [nograph] [v...] [scores] [utilization]</code></pre>
</div></div>
<div class="paragraph"><p>Example:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>run</code></pre>
</div></div>
</div>
<div class="sect3">
<h4 id="cmdhelp_cibstatus_save"><code>save</code></h4>
<div class="paragraph"><p>The current internal status section with whatever modifications
were performed can be saved to a file or shadow CIB.</p></div>
<div class="paragraph"><p>If the file exists and contains a complete CIB, only the status
section is going to be replaced and the rest of the CIB will
remain intact. Otherwise, the current user edited configuration
is saved along with the status section.</p></div>
<div class="paragraph"><p>Note that all modifications are saved in the source file as soon
as they are run.</p></div>
<div class="paragraph"><p>Usage:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>save [&lt;file&gt;|shadow:&lt;cib&gt;]</code></pre>
</div></div>
<div class="paragraph"><p>Example:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>save bug-12299.xml</code></pre>
</div></div>
</div>
<div class="sect3">
<h4 id="cmdhelp_cibstatus_show"><code>show</code></h4>
<div class="paragraph"><p>Show the current status section in the XML format. Brace yourself
for some unreadable output. Add <code>changed</code> option to get a human
readable output of all changes.</p></div>
<div class="paragraph"><p>Usage:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>show [changed]</code></pre>
</div></div>
</div>
<div class="sect3">
<h4 id="cmdhelp_cibstatus_simulate"><code>simulate</code></h4>
<div class="paragraph"><p>Run the policy engine with the edited status section and simulate
the transition.</p></div>
<div class="paragraph"><p>Add a string of <code>v</code> characters to increase verbosity. Specify
<code>scores</code> to see allocation scores also. <code>utilization</code> turns on
information about the remaining capacity of nodes.</p></div>
<div class="paragraph"><p>If you have graphviz installed and X11 session, <code>dotty(1)</code> is run
to display the changes graphically.</p></div>
<div class="paragraph"><p>Usage:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>simulate [nograph] [v...] [scores] [utilization]</code></pre>
</div></div>
<div class="paragraph"><p>Example:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>simulate</code></pre>
</div></div>
</div>
<div class="sect3">
<h4 id="cmdhelp_cibstatus_ticket"><code>ticket</code></h4>
<div class="paragraph"><p>Modify the ticket status. Tickets can be granted and revoked.
Granted tickets could be activated or put in standby.</p></div>
<div class="paragraph"><p>Usage:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>ticket &lt;ticket&gt; {grant|revoke|activate|standby}</code></pre>
</div></div>
<div class="paragraph"><p>Example:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>ticket ticketA grant</code></pre>
</div></div>
</div>
</div>
<div class="sect2">
<h3 id="cmdhelp_assist"><code>assist</code> - Configuration assistant</h3>
<div class="paragraph"><p>The <code>assist</code> sublevel is a collection of helper
commands that create or modify resources and
constraints, to simplify the creation of certain
configurations.</p></div>
<div class="paragraph"><p>For more information on individual commands, see
the help text for those commands.</p></div>
<div class="sect3">
<h4 id="cmdhelp_assist_template"><code>template</code></h4>
<div class="paragraph"><p>This command takes a list of primitives as argument, and creates a new
<code>rsc_template</code> for these primitives. It can only do this if the
primitives do not already share a template and are of the same type.</p></div>
<div class="paragraph"><p>Usage:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>template primitive-1 primitive-2 primitive-3</code></pre>
</div></div>
</div>
<div class="sect3">
<h4 id="cmdhelp_assist_weak-bond"><code>weak-bond</code></h4>
<div class="paragraph"><p>A colocation between a group of resources says that the resources
should be located together, but it also means that those resources are
dependent on each other. If one of the resources fails, the others
will be restarted.</p></div>
<div class="paragraph"><p>If this is not desired, it is possible to circumvent: By placing the
resources in a non-sequential set and colocating the set with a dummy
resource which is not monitored, the resources will be placed together
but will have no further dependency on each other.</p></div>
<div class="paragraph"><p>This command creates both the constraint and the dummy resource needed
for such a colocation.</p></div>
<div class="paragraph"><p>Usage:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>weak-bond resource-1 resource-2</code></pre>
</div></div>
</div>
</div>
<div class="sect2">
<h3 id="cmdhelp_maintenance"><code>maintenance</code> - Maintenance mode commands</h3>
<div class="paragraph"><p>Maintenance mode commands are commands that manipulate resources
directly without going through the cluster infrastructure. Therefore,
it is essential to ensure that the cluster does not attempt to monitor
or manipulate the resources while these commands are being executed.</p></div>
<div class="paragraph"><p>To ensure this, these commands require that maintenance mode is set
either for the particular resource, or for the whole cluster.</p></div>
<div class="sect3">
<h4 id="cmdhelp_maintenance_action"><code>action</code></h4>
<div class="paragraph"><p>Invokes the given action for the resource. This is
done directly via the resource agent, so the command must
be issued while the cluster or the resource is in
maintenance mode.</p></div>
<div class="paragraph"><p>Unless the action is <code>start</code> or <code>monitor</code>, the action must be invoked
on the same node as where the resource is running. If the resource is
running on multiple nodes, the command will fail.</p></div>
<div class="paragraph"><p>To use SSH for executing resource actions on multiple nodes, append
<code>ssh</code> after the action name. This requires SSH access to be configured
between the nodes and the parallax python package to be installed.</p></div>
<div class="paragraph"><p>Usage:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>action &lt;rsc&gt; &lt;action&gt;
action &lt;rsc&gt; &lt;action&gt; ssh</code></pre>
</div></div>
<div class="paragraph"><p>Example:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>action webserver reload
action webserver monitor ssh</code></pre>
</div></div>
</div>
<div class="sect3">
<h4 id="cmdhelp_maintenance_off"><code>off</code></h4>
<div class="paragraph"><p>Disables maintenances mode, either for the whole cluster
or for the given resource.</p></div>
<div class="paragraph"><p>Usage:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>off
off &lt;rsc&gt;</code></pre>
</div></div>
<div class="paragraph"><p>Example:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>off rsc1</code></pre>
</div></div>
</div>
<div class="sect3">
<h4 id="cmdhelp_maintenance_on"><code>on</code></h4>
<div class="paragraph"><p>Enables maintenances mode, either for the whole cluster
or for the given resource.</p></div>
<div class="paragraph"><p>Usage:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>on
on &lt;rsc&gt;</code></pre>
</div></div>
<div class="paragraph"><p>Example:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>on rsc1</code></pre>
</div></div>
</div>
</div>
<div class="sect2">
<h3 id="cmdhelp_history"><code>history</code> - Cluster history</h3>
<div class="paragraph"><p>Examining Pacemaker&#8217;s history is a particularly involved task. The
number of subsystems to be considered, the complexity of the
configuration, and the set of various information sources, most of
which are not exactly human readable, keep analyzing resource or node
problems accessible to only the most knowledgeable. Or, depending on
the point of view, to the most persistent. The following set of
commands has been devised in hope to make cluster history more
accessible.</p></div>
<div class="paragraph"><p>Of course, looking at <em>all</em> history could be time consuming regardless
of how good the tools at hand are. Therefore, one should first say
which period he or she wants to analyze. If not otherwise specified,
the last hour is considered. Logs and other relevant information is
collected using <code>crm report</code>. Since this process takes some time and
we always need fresh logs, information is refreshed in a much faster
way using the python parallax module. If <code>python-parallax</code> is not
found on the system, examining a live cluster is still possible&#8201;&#8212;&#8201;though not as comfortable.</p></div>
<div class="paragraph"><p>Apart from examining a live cluster, events may be retrieved from a
report generated by <code>crm report</code> (see also the <code>-H</code> option). In that
case we assume that the period stretching the whole report needs to be
investigated. Of course, it is still possible to further reduce the
time range.</p></div>
<div class="paragraph"><p>If you have discovered an issue that you want to show someone else,
you can use the <code>session pack</code> command to save the current session as
a tarball, similar to those generated by <code>crm report</code>.</p></div>
<div class="paragraph"><p>In order to minimize the size of the tarball, and to make it easier
for others to find the interesting events, it is recommended to limit
the time frame which the saved session covers. This can be done using
the <code>timeframe</code> command (example below).</p></div>
<div class="paragraph"><p>It is also possible to name the saved session using the <code>session save</code>
command.</p></div>
<div class="paragraph"><p>Example:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>crm(live)history# limit "Jul 18 12:00" "Jul 18 12:30"
crm(live)history# session save strange_restart
crm(live)history# session pack
Report saved in .../strange_restart.tar.bz2
crm(live)history#</code></pre>
</div></div>
<div class="sect3">
<h4 id="cmdhelp_history_detail"><code>detail</code></h4>
<div class="paragraph"><p>How much detail to show from the logs. Valid detail levels are either
<code>0</code> or <code>1</code>, where <code>1</code> is the highest detail level. The default detail
level is <code>0</code>.</p></div>
<div class="paragraph"><p>Usage:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>detail &lt;detail_level&gt;

detail_level :: small integer (defaults to 0)</code></pre>
</div></div>
<div class="paragraph"><p>Example:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>detail 1</code></pre>
</div></div>
</div>
<div class="sect3">
<h4 id="cmdhelp_history_diff"><code>diff</code></h4>
<div class="paragraph"><p>A transition represents a change in cluster configuration or
state. Use <code>diff</code> to see what has changed between two
transitions.</p></div>
<div class="paragraph"><p>If you want to specify the current cluster configuration and
status, use the string <code>live</code>.</p></div>
<div class="paragraph"><p>Normally, the first transition specified should be the one which
is older, but we are not going to enforce that.</p></div>
<div class="paragraph"><p>Note that a single configuration update may result in more than
one transition.</p></div>
<div class="paragraph"><p>Usage:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>diff &lt;pe&gt; &lt;pe&gt; [status] [html]

pe :: &lt;number&gt;|&lt;index&gt;|&lt;file&gt;|live</code></pre>
</div></div>
<div class="paragraph"><p>Examples:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>diff 2066 2067
diff pe-input-2080.bz2 live status</code></pre>
</div></div>
</div>
<div class="sect3">
<h4 id="cmdhelp_history_events"><code>events</code></h4>
<div class="paragraph"><p>By analysing the log output and looking for particular
patterns, the <code>events</code> command helps sifting through
the logs to find when particular events like resources
changing state or node failure may have occurred.</p></div>
<div class="paragraph"><p>This can be used to generate a combined list of events
from all nodes.</p></div>
<div class="paragraph"><p>Usage:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>events</code></pre>
</div></div>
<div class="paragraph"><p>Example:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>events</code></pre>
</div></div>
</div>
<div class="sect3">
<h4 id="cmdhelp_history_exclude"><code>exclude</code></h4>
<div class="paragraph"><p>If a log is infested with irrelevant messages, those messages may
be excluded by specifying a regular expression. The regular
expressions used are Python extended. This command is additive.
To drop all regular expressions, use <code>exclude clear</code>. Run
<code>exclude</code> only to see the current list of regular expressions.
Excludes are saved along with the history sessions.</p></div>
<div class="paragraph"><p>Usage:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>exclude [&lt;regex&gt;|clear]</code></pre>
</div></div>
<div class="paragraph"><p>Example:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>exclude kernel.*ocfs2</code></pre>
</div></div>
</div>
<div class="sect3">
<h4 id="cmdhelp_history_graph"><code>graph</code></h4>
<div class="paragraph"><p>Create a graphviz graphical layout from the PE file (the
transition). Every transition contains the cluster configuration
which was active at the time. See also <a href="#cmdhelp_configure_graph">generate a directed graph from configuration</a>.</p></div>
<div class="paragraph"><p>Usage:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>graph &lt;pe&gt; [&lt;gtype&gt; [&lt;file&gt; [&lt;img_format&gt;]]]

gtype :: dot
img_format :: `dot` output format (see the +-T+ option)</code></pre>
</div></div>
<div class="paragraph"><p>Example:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>graph -1
graph 322 dot clu1.conf.dot
graph 322 dot clu1.conf.svg svg</code></pre>
</div></div>
</div>
<div class="sect3">
<h4 id="cmdhelp_history_info"><code>info</code></h4>
<div class="paragraph"><p>The <code>info</code> command provides a summary of the information source, which
can be either a live cluster snapshot or a previously generated
report.</p></div>
<div class="paragraph"><p>Usage:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>info</code></pre>
</div></div>
<div class="paragraph"><p>Example:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>info</code></pre>
</div></div>
</div>
<div class="sect3">
<h4 id="cmdhelp_history_latest"><code>latest</code></h4>
<div class="paragraph"><p>The <code>latest</code> command shows a bit of recent history, more
precisely whatever happened since the last cluster change (the
latest transition). If the transition is running, the shell will
first wait until it finishes.</p></div>
<div class="paragraph"><p>Usage:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>latest</code></pre>
</div></div>
<div class="paragraph"><p>Example:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>latest</code></pre>
</div></div>
</div>
<div class="sect3">
<h4 id="cmdhelp_history_limit"><code>limit</code> (<code>timeframe</code>)</h4>
<div class="paragraph"><p>This command can be used to modify the time span to examine. All
history commands look at events within a certain time span.</p></div>
<div class="paragraph"><p>For the <code>live</code> source, the default time span is the <em>last hour</em>.</p></div>
<div class="paragraph"><p>There is no time span limit for the <code>hb_report</code> source.</p></div>
<div class="paragraph"><p>The time period is parsed by the <code>dateutil</code> python module. It
covers a wide range of date formats. For instance:</p></div>
<div class="ulist"><ul>
<li>
<p>
3:00          (today at 3am)
</p>
</li>
<li>
<p>
15:00         (today at 3pm)
</p>
</li>
<li>
<p>
2010/9/1 2pm  (September 1st 2010 at 2pm)
</p>
</li>
</ul></div>
<div class="paragraph"><p>For more examples of valid time/date statements, please refer to the
<code>python-dateutil</code> documentation:</p></div>
<div class="ulist"><ul>
<li>
<p>
<a href="https://dateutil.readthedocs.org/">dateutil.readthedocs.org</a>
</p>
</li>
</ul></div>
<div class="paragraph"><p>If the dateutil module is not available, then the time is parsed using
strptime and only the kind as printed by <code>date(1)</code> is allowed:</p></div>
<div class="ulist"><ul>
<li>
<p>
Tue Sep 15 20:46:27 CEST 2010
</p>
</li>
</ul></div>
<div class="paragraph"><p>Usage:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>limit [&lt;from_time&gt;] [&lt;to_time&gt;]</code></pre>
</div></div>
<div class="paragraph"><p>Examples:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>limit 10:15
limit 15h22m 16h
limit "Sun 5 20:46" "Sun 5 22:00"</code></pre>
</div></div>
</div>
<div class="sect3">
<h4 id="cmdhelp_history_log"><code>log</code></h4>
<div class="paragraph"><p>Show messages logged on one or more nodes. Leaving out a node
name produces combined logs of all nodes. Messages are sorted by
time and, if the terminal emulations supports it, displayed in
different colours depending on the node to allow for easier
reading.</p></div>
<div class="paragraph"><p>The sorting key is the timestamp as written by syslog which
normally has the maximum resolution of one second. Obviously,
messages generated by events which share the same timestamp may
not be sorted in the same way as they happened. Such close events
may actually happen fairly often.</p></div>
<div class="paragraph"><p>Usage:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>log [&lt;node&gt; [&lt;node&gt; ...] ]</code></pre>
</div></div>
<div class="paragraph"><p>Example:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>log node-a</code></pre>
</div></div>
</div>
<div class="sect3">
<h4 id="cmdhelp_history_node"><code>node</code></h4>
<div class="paragraph"><p>Show important events that happened on a node. Important events
are node lost and join, standby and online, and fence. Use either
node names or extended regular expressions.</p></div>
<div class="paragraph"><p>Usage:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>node &lt;node&gt; [&lt;node&gt; ...]</code></pre>
</div></div>
<div class="paragraph"><p>Example:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>node node1</code></pre>
</div></div>
</div>
<div class="sect3">
<h4 id="cmdhelp_history_peinputs"><code>peinputs</code></h4>
<div class="paragraph"><p>Every event in the cluster results in generating one or more
Policy Engine (PE) files. These files describe future motions of
resources. The files are listed as full paths in the current
report directory. Add <code>v</code> to also see the creation time stamps.</p></div>
<div class="paragraph"><p>Usage:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>peinputs [{&lt;range&gt;|&lt;number&gt;} ...] [v]

range :: &lt;n1&gt;:&lt;n2&gt;</code></pre>
</div></div>
<div class="paragraph"><p>Example:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>peinputs
peinputs 440:444 446
peinputs v</code></pre>
</div></div>
</div>
<div class="sect3">
<h4 id="cmdhelp_history_refresh"><code>refresh</code></h4>
<div class="paragraph"><p>This command makes sense only for the <code>live</code> source and makes
<code>crm</code> collect the latest logs and other relevant information from
the logs. If you want to make a completely new report, specify
<code>force</code>.</p></div>
<div class="paragraph"><p>Usage:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>refresh [force]</code></pre>
</div></div>
</div>
<div class="sect3">
<h4 id="cmdhelp_history_resource"><code>resource</code></h4>
<div class="paragraph"><p>Show actions and any failures that happened on all specified
resources on all nodes. Normally, one gives resource names as
arguments, but it is also possible to use extended regular
expressions. Note that neither groups nor clones or master/slave
names are ever logged. The resource command is going to expand
all of these appropriately, so that clone instances or resources
which are part of a group are shown.</p></div>
<div class="paragraph"><p>Usage:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>resource &lt;rsc&gt; [&lt;rsc&gt; ...]</code></pre>
</div></div>
<div class="paragraph"><p>Example:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>resource bigdb public_ip
resource my_.*_db2
resource ping_clone</code></pre>
</div></div>
</div>
<div class="sect3">
<h4 id="cmdhelp_history_session"><code>session</code></h4>
<div class="paragraph"><p>Sometimes you may want to get back to examining a particular
history period or bug report. In order to make that easier, the
current settings can be saved and later retrieved.</p></div>
<div class="paragraph"><p>If the current history being examined is coming from a live
cluster the logs, PE inputs, and other files are saved too,
because they may disappear from nodes. For the existing reports
coming from <code>hb_report</code>, only the directory location is saved
(not to waste space).</p></div>
<div class="paragraph"><p>A history session may also be packed into a tarball which can
then be sent to support.</p></div>
<div class="paragraph"><p>Leave out subcommand to see the current session.</p></div>
<div class="paragraph"><p>Usage:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>session [{save|load|delete} &lt;name&gt; | pack [&lt;name&gt;] | update | list]</code></pre>
</div></div>
<div class="paragraph"><p>Examples:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>session save bnc966622
session load rsclost-2
session list</code></pre>
</div></div>
</div>
<div class="sect3">
<h4 id="cmdhelp_history_setnodes"><code>setnodes</code></h4>
<div class="paragraph"><p>In case the host this program runs on is not part of the cluster,
it is necessary to set the list of nodes.</p></div>
<div class="paragraph"><p>Usage:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>setnodes node &lt;node&gt; [&lt;node&gt; ...]</code></pre>
</div></div>
<div class="paragraph"><p>Example:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>setnodes node_a node_b</code></pre>
</div></div>
</div>
<div class="sect3">
<h4 id="cmdhelp_history_show"><code>show</code></h4>
<div class="paragraph"><p>Every transition is saved as a PE file. Use this command to
render that PE file either as configuration or status. The
configuration output is the same as <code>crm configure show</code>.</p></div>
<div class="paragraph"><p>Usage:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>show &lt;pe&gt; [status]

pe :: &lt;number&gt;|&lt;index&gt;|&lt;file&gt;|live</code></pre>
</div></div>
<div class="paragraph"><p>Examples:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>show 2066
show pe-input-2080.bz2 status</code></pre>
</div></div>
</div>
<div class="sect3">
<h4 id="cmdhelp_history_source"><code>source</code></h4>
<div class="paragraph"><p>Events to be examined can come from the current cluster or from a
<code>hb_report</code> report. This command sets the source. <code>source live</code>
sets source to the running cluster and system logs. If no source
is specified, the current source information is printed.</p></div>
<div class="paragraph"><p>In case a report source is specified as a file reference, the file
is going to be unpacked in place where it resides. This directory
is not removed on exit.</p></div>
<div class="paragraph"><p>Usage:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>source [&lt;dir&gt;|&lt;file&gt;|live]</code></pre>
</div></div>
<div class="paragraph"><p>Examples:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>source live
source /tmp/customer_case_22.tar.bz2
source /tmp/customer_case_22
source</code></pre>
</div></div>
</div>
<div class="sect3">
<h4 id="cmdhelp_history_transition"><code>transition</code></h4>
<div class="paragraph"><p>This command will print actions planned by the PE and run
graphviz (<code>dotty</code>) to display a graphical representation of the
transition. Of course, for the latter an X11 session is required.
This command invokes <code>ptest(8)</code> in background.</p></div>
<div class="paragraph"><p>The <code>showdot</code> subcommand runs graphviz (<code>dotty</code>) to display a
graphical representation of the <code>.dot</code> file which has been
included in the report. Essentially, it shows the calculation
produced by <code>pengine</code> which is installed on the node where the
report was produced. In optimal case this output should not
differ from the one produced by the locally installed <code>pengine</code>.</p></div>
<div class="paragraph"><p>The <code>log</code> subcommand shows the full log for the duration of the
transition.</p></div>
<div class="paragraph"><p>A transition can also be saved to a CIB shadow for further
analysis or use with <code>cib</code> or <code>configure</code> commands (use the
<code>save</code> subcommand). The shadow file name defaults to the name of
the PE input file.</p></div>
<div class="paragraph"><p>If the PE input file number is not provided, it defaults to the
last one, i.e. the last transition. The last transition can also
be referenced with number 0. If the number is negative, then the
corresponding transition relative to the last one is chosen.</p></div>
<div class="paragraph"><p>If there are warning and error PE input files or different nodes
were the DC in the observed timeframe, it may happen that PE
input file numbers collide. In that case provide some unique part
of the path to the file.</p></div>
<div class="paragraph"><p>After the <code>ptest</code> output, logs about events that happened during
the transition are printed.</p></div>
<div class="paragraph"><p>The <code>tags</code> subcommand scans the logs for the transition and return a
list of key events during that transition. For example, the tag
<code>error</code> will be returned if there are any errors logged during the
transition.</p></div>
<div class="paragraph"><p>Usage:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>transition [&lt;number&gt;|&lt;index&gt;|&lt;file&gt;] [nograph] [v...] [scores] [actions] [utilization]
transition showdot [&lt;number&gt;|&lt;index&gt;|&lt;file&gt;]
transition log [&lt;number&gt;|&lt;index&gt;|&lt;file&gt;]
transition save [&lt;number&gt;|&lt;index&gt;|&lt;file&gt; [name]]
transition tags [&lt;number&gt;|&lt;index&gt;|&lt;file&gt;]</code></pre>
</div></div>
<div class="paragraph"><p>Examples:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>transition
transition 444
transition -1
transition pe-error-3.bz2
transition node-a/pengine/pe-input-2.bz2
transition showdot 444
transition log
transition save 0 enigma-22</code></pre>
</div></div>
</div>
<div class="sect3">
<h4 id="cmdhelp_history_transitions"><code>transitions</code></h4>
<div class="paragraph"><p>A transition represents a change in cluster configuration or
state. This command lists the transitions in the current timeframe.</p></div>
<div class="paragraph"><p>Usage:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>transitions</code></pre>
</div></div>
<div class="paragraph"><p>Example:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>transitions</code></pre>
</div></div>
</div>
<div class="sect3">
<h4 id="cmdhelp_history_wdiff"><code>wdiff</code></h4>
<div class="paragraph"><p>A transition represents a change in cluster configuration or
state. Use <code>wdiff</code> to see what has changed between two
transitions as word differences on a line-by-line basis.</p></div>
<div class="paragraph"><p>If you want to specify the current cluster configuration and
status, use the string <code>live</code>.</p></div>
<div class="paragraph"><p>Normally, the first transition specified should be the one which
is older, but we are not going to enforce that.</p></div>
<div class="paragraph"><p>Note that a single configuration update may result in more than
one transition.</p></div>
<div class="paragraph"><p>Usage:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>wdiff &lt;pe&gt; &lt;pe&gt; [status]

pe :: &lt;number&gt;|&lt;index&gt;|&lt;file&gt;|live</code></pre>
</div></div>
<div class="paragraph"><p>Examples:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>wdiff 2066 2067
wdiff pe-input-2080.bz2 live status</code></pre>
</div></div>
</div>
</div>
<div class="sect2">
<h3 id="cmdhelp_root_report"><code>report</code></h3>
<div class="paragraph"><p>Interface to a tool for creating a cluster report. A report is an
archive containing log files, configuration files, system information
and other relevant data for a given time period. This is a useful tool
for collecting data to attach to bug reports, or for detecting the
root cause of errors resulting in resource failover, for example.</p></div>
<div class="paragraph"><p>See <code>crmsh_hb_report(8)</code> for more details on arguments,
or call <code>crm report -h</code></p></div>
<div class="paragraph"><p>Usage:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>report -f {time|"cts:"testnum} [-t time] [-u user] [-l file]
       [-n nodes] [-E files] [-p patt] [-L patt] [-e prog]
       [-MSDZAVsvhd] [dest]</code></pre>
</div></div>
<div class="paragraph"><p>Examples:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>report -f 2pm report_1
report -f "2007/9/5 12:30" -t "2007/9/5 14:00" report_2
report -f 1:00 -t 3:00 -l /var/log/cluster/ha-debug report_3
report -f "09sep07 2:00" -u hbadmin report_4
report -f 18:00 -p "usern.*" -p "admin.*" report_5
report -f cts:133 ctstest_133</code></pre>
</div></div>
</div>
<div class="sect2">
<h3 id="_code_end_code_code_cd_code_code_up_code"><code>end</code> (<code>cd</code>, <code>up</code>)</h3>
<div class="paragraph"><p>The <code>end</code> command ends the current level and the user moves to
the parent level. This command is available everywhere.</p></div>
<div class="paragraph"><p>Usage:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>end</code></pre>
</div></div>
</div>
<div class="sect2">
<h3 id="_code_help_code"><code>help</code></h3>
<div class="paragraph"><p>The <code>help</code> command prints help for the current level or for the
specified topic (command). This command is available everywhere.</p></div>
<div class="paragraph"><p>Usage:</p></div>
<div class="literalblock">
<div class="content">
<pre><code>help [&lt;topic&gt;]</code></pre>
</div></div>
</div>
<div class="sect2">
<h3 id="_code_quit_code_code_exit_code_code_bye_code"><code>quit</code> (<code>exit</code>, <code>bye</code>)</h3>
<div class="paragraph"><p>Leave the program.</p></div>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_bugs">BUGS</h2>
<div class="sectionbody">
<div class="paragraph"><p>Even though all sensible configurations (and most of those that
are not) are going to be supported by the crm shell, I suspect
that it may still happen that certain XML constructs may confuse
the tool. When that happens, please file a bug report.</p></div>
<div class="paragraph"><p>The crm shell will not try to update the objects it does not
understand. Of course, it is always possible to edit such objects
in the XML format.</p></div>
</div>
</div>
<div class="sect1">
<h2 id="_authors">AUTHORS</h2>
<div class="sectionbody">
<div class="paragraph"><p>Dejan Muhamedagic, &lt;<a href="mailto:dejan@suse.de">dejan@suse.de</a>&gt;
Kristoffer Gronlund &lt;<a href="mailto:kgronlund@suse.com">kgronlund@suse.com</a>&gt;
and many OTHERS</p></div>
</div>
</div>
<div class="sect1">
<h2 id="_see_also">SEE ALSO</h2>
<div class="sectionbody">
<div class="paragraph"><p>crm_resource(8), crm_attribute(8), crm_mon(8), cib_shadow(8),
ptest(8), dotty(1), crm_simulate(8), cibadmin(8)</p></div>
</div>
</div>
<div class="sect1">
<h2 id="_copying">COPYING</h2>
<div class="sectionbody">
<div class="paragraph"><p>Copyright (C) 2008-2013 Dejan Muhamedagic.
Copyright (C) 2013 Kristoffer Gronlund.</p></div>
<div class="paragraph"><p>Free use of this software is granted under the terms of the GNU General Public License (GPL).</p></div>
</div>
</div>
</div>
<div id="footnotes"><hr /></div>
<div id="footer">
<div id="footer-text">
Last updated 2017-03-08 08:06:16 UTC
</div>
</div>
</body>
</html>