This file is indexed.

/usr/share/doc/ganeti-doc/html/design-bulk-create.html is in ganeti-doc 2.15.2-3.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">


<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    
    <title>Ganeti Bulk Create &mdash; Ganeti 2.15.2 documentation</title>
    
    <link rel="stylesheet" href="_static/style.css" type="text/css" />
    <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
    
    <script type="text/javascript">
      var DOCUMENTATION_OPTIONS = {
        URL_ROOT:    './',
        VERSION:     '2.15.2',
        COLLAPSE_INDEX: false,
        FILE_SUFFIX: '.html',
        HAS_SOURCE:  true
      };
    </script>
    <script type="text/javascript" src="_static/jquery.js"></script>
    <script type="text/javascript" src="_static/underscore.js"></script>
    <script type="text/javascript" src="_static/doctools.js"></script>
    <link rel="top" title="Ganeti 2.15.2 documentation" href="index.html" />
    <link rel="next" title="Chained jobs" href="design-chained-jobs.html" />
    <link rel="prev" title="Instance auto-repair" href="design-autorepair.html" /> 
  </head>
  <body role="document">
    <div class="related" role="navigation" aria-label="related navigation">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="design-chained-jobs.html" title="Chained jobs"
             accesskey="N">next</a></li>
        <li class="right" >
          <a href="design-autorepair.html" title="Instance auto-repair"
             accesskey="P">previous</a> |</li>
        <li class="nav-item nav-item-0"><a href="index.html">Ganeti 2.15.2 documentation</a> &raquo;</li> 
      </ul>
    </div>  

    <div class="document">
      <div class="documentwrapper">
        <div class="bodywrapper">
          <div class="body" role="main">
            
  <div class="section" id="ganeti-bulk-create">
<h1><a class="toc-backref" href="#id1">Ganeti Bulk Create</a><a class="headerlink" href="#ganeti-bulk-create" title="Permalink to this headline"></a></h1>
<div class="contents topic" id="contents">
<p class="topic-title first">Contents</p>
<ul class="simple">
<li><a class="reference internal" href="#ganeti-bulk-create" id="id1">Ganeti Bulk Create</a><ul>
<li><a class="reference internal" href="#current-state-and-shortcomings" id="id2">Current state and shortcomings</a><ul>
<li><a class="reference internal" href="#proposed-changes" id="id3">Proposed changes</a></li>
<li><a class="reference internal" href="#problems" id="id4">Problems</a></li>
</ul>
</li>
<li><a class="reference internal" href="#implementation" id="id5">Implementation</a><ul>
<li><a class="reference internal" href="#iallocator" id="id6">IAllocator</a></li>
<li><a class="reference internal" href="#opinstancebulkadd" id="id7">OpInstanceBulkAdd</a></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<div class="section" id="current-state-and-shortcomings">
<h2><a class="toc-backref" href="#id2">Current state and shortcomings</a><a class="headerlink" href="#current-state-and-shortcomings" title="Permalink to this headline"></a></h2>
<p>Creation of instances happens a lot. A fair load is done by just
creating instances and due to bad allocation shifting them around later
again. Additionally, if you turn up a new cluster you already know a
bunch of instances, which need to exists on the cluster. Doing this
one-by-one is not only cumbersome but might also fail, due to lack of
resources or lead to badly balanced clusters.</p>
<p>Since the early Ganeti 2.0 alpha version there is a <code class="docutils literal"><span class="pre">gnt-instance</span>
<span class="pre">batch-create</span></code> command to allocate a bunch of instances based on a json
file. This feature, however, doesn&#8217;t take any advantages of iallocator
and submits jobs in a serialized manner.</p>
<div class="section" id="proposed-changes">
<h3><a class="toc-backref" href="#id3">Proposed changes</a><a class="headerlink" href="#proposed-changes" title="Permalink to this headline"></a></h3>
<p>To overcome this shortcoming we would extend the current iallocator
interface to allow bulk requests. On the Ganeti side, a new opcode is
introduced to handle the bulk creation and returning the resulting
placement from the <a class="reference internal" href="#iallocator">IAllocator</a>.</p>
</div>
<div class="section" id="problems">
<h3><a class="toc-backref" href="#id4">Problems</a><a class="headerlink" href="#problems" title="Permalink to this headline"></a></h3>
<p>Due to the design of chained jobs, we can guarantee, that with the state
at which the <code class="docutils literal"><span class="pre">multi-alloc</span></code> opcode is run, all of the instances will
fit (or all won&#8217;t). But we can&#8217;t guarantee that once the instance
creation requests were submit, no other jobs have sneaked in between.
This might still lead to failing jobs because the resources have changed
in the meantime.</p>
</div>
</div>
<div class="section" id="implementation">
<h2><a class="toc-backref" href="#id5">Implementation</a><a class="headerlink" href="#implementation" title="Permalink to this headline"></a></h2>
<div class="section" id="iallocator">
<h3><a class="toc-backref" href="#id6">IAllocator</a><a class="headerlink" href="#iallocator" title="Permalink to this headline"></a></h3>
<p>A new additional <code class="docutils literal"><span class="pre">type</span></code> will be added called <code class="docutils literal"><span class="pre">multi-allocate</span></code> to
distinguish between normal and bulk operation. For the bulk operation
the <code class="docutils literal"><span class="pre">request</span></code> will be a finite list of request dicts.</p>
<p>If <code class="docutils literal"><span class="pre">multi-allocate</span></code> is declared, <code class="docutils literal"><span class="pre">request</span></code> must exist and is a list
of <code class="docutils literal"><span class="pre">request</span></code> dicts as described in <a class="reference internal" href="iallocator.html"><em>Operation specific input</em></a>. The <code class="docutils literal"><span class="pre">result</span></code> then is a list of instance name and node
placements in the order of the <code class="docutils literal"><span class="pre">request</span></code> field.</p>
<p>In addition, the old <code class="docutils literal"><span class="pre">allocate</span></code> request type will be deprecated and at
latest in Ganeti 2.8 incooperated into this new request. Current code
will need slight adaption to work with the new request. This needs
careful testing.</p>
</div>
<div class="section" id="opinstancebulkadd">
<h3><a class="toc-backref" href="#id7">OpInstanceBulkAdd</a><a class="headerlink" href="#opinstancebulkadd" title="Permalink to this headline"></a></h3>
<p>We add a new opcode <code class="docutils literal"><span class="pre">OpInstanceBulkAdd</span></code>. It receives a list of
<code class="docutils literal"><span class="pre">OpInstanceCreate</span></code> on the <code class="docutils literal"><span class="pre">instances</span></code> field. This is done to make
sure, that these two loosely coupled opcodes do not get out of sync. On
the RAPI side, however, this just is a list of instance create
definitions. And the client is adapted accordingly.</p>
<p>The opcode itself does some sanity checks on the instance creation
opcodes which includes:</p>
<ul class="simple">
<li><code class="docutils literal"><span class="pre">mode</span></code> is not set</li>
<li><code class="docutils literal"><span class="pre">pnode</span></code> and <code class="docutils literal"><span class="pre">snodes</span></code> is not set</li>
<li><code class="docutils literal"><span class="pre">iallocator</span></code> is not set</li>
</ul>
<p>Any of the above error will be aborted with <code class="docutils literal"><span class="pre">OpPrereqError</span></code>. Once the
list has been verified it is handed to the <code class="docutils literal"><span class="pre">iallocator</span></code> as described
in <a class="reference internal" href="#iallocator">IAllocator</a>. Upon success we then return the result of the
<a class="reference internal" href="#iallocator">IAllocator</a> call.</p>
<p>At this point the current instance allocation would work with the
resources available on the cluster as perceived upon
<code class="docutils literal"><span class="pre">OpInstanceBulkAdd</span></code> invocation. However, there might be corner cases
where this is not true as described in <a class="reference internal" href="#problems">Problems</a>.</p>
</div>
</div>
</div>


          </div>
        </div>
      </div>
      <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
        <div class="sphinxsidebarwrapper">
  <h3><a href="index.html">Table Of Contents</a></h3>
  <ul>
<li><a class="reference internal" href="#">Ganeti Bulk Create</a><ul>
<li><a class="reference internal" href="#current-state-and-shortcomings">Current state and shortcomings</a><ul>
<li><a class="reference internal" href="#proposed-changes">Proposed changes</a></li>
<li><a class="reference internal" href="#problems">Problems</a></li>
</ul>
</li>
<li><a class="reference internal" href="#implementation">Implementation</a><ul>
<li><a class="reference internal" href="#iallocator">IAllocator</a></li>
<li><a class="reference internal" href="#opinstancebulkadd">OpInstanceBulkAdd</a></li>
</ul>
</li>
</ul>
</li>
</ul>

  <h4>Previous topic</h4>
  <p class="topless"><a href="design-autorepair.html"
                        title="previous chapter">Instance auto-repair</a></p>
  <h4>Next topic</h4>
  <p class="topless"><a href="design-chained-jobs.html"
                        title="next chapter">Chained jobs</a></p>
  <div role="note" aria-label="source link">
    <h3>This Page</h3>
    <ul class="this-page-menu">
      <li><a href="_sources/design-bulk-create.txt"
            rel="nofollow">Show Source</a></li>
    </ul>
   </div>
<div id="searchbox" style="display: none" role="search">
  <h3>Quick search</h3>
    <form class="search" action="search.html" method="get">
      <input type="text" name="q" />
      <input type="submit" value="Go" />
      <input type="hidden" name="check_keywords" value="yes" />
      <input type="hidden" name="area" value="default" />
    </form>
    <p class="searchtip" style="font-size: 90%">
    Enter search terms or a module, class or function name.
    </p>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
        </div>
      </div>
      <div class="clearer"></div>
    </div>
    <div class="related" role="navigation" aria-label="related navigation">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="design-chained-jobs.html" title="Chained jobs"
             >next</a></li>
        <li class="right" >
          <a href="design-autorepair.html" title="Instance auto-repair"
             >previous</a> |</li>
        <li class="nav-item nav-item-0"><a href="index.html">Ganeti 2.15.2 documentation</a> &raquo;</li> 
      </ul>
    </div>
    <div class="footer" role="contentinfo">
        &copy; Copyright 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Google Inc..
      Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.3.6.
    </div>
  </body>
</html>