This file is indexed.

/usr/share/doc/ganeti/html/design-file-based-disks-ownership.html is in ganeti-doc 2.16.0~rc2-1build1.

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
<!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" lang="en">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Ganeti file-based disks ownership &#8212; Ganeti 2.16.0~rc2 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.16.0~rc2',
        COLLAPSE_INDEX: false,
        FILE_SUFFIX: '.html',
        HAS_SOURCE:  true,
        SOURCELINK_SUFFIX: '.txt'
      };
    </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="search" title="Search" href="search.html" />
    <link rel="next" title="GlusterFS Ganeti support" href="design-glusterfs-ganeti-support.html" />
    <link rel="prev" title="File-based Storage" href="design-file-based-storage.html" /> 
  </head>
  <body>
    <div class="related" role="navigation" aria-label="related navigation">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="design-glusterfs-ganeti-support.html" title="GlusterFS Ganeti support"
             accesskey="N">next</a></li>
        <li class="right" >
          <a href="design-file-based-storage.html" title="File-based Storage"
             accesskey="P">previous</a> |</li>
        <li class="nav-item nav-item-0"><a href="index.html">Ganeti 2.16.0~rc2 documentation</a> &#187;</li> 
      </ul>
    </div>  

    <div class="document">
      <div class="documentwrapper">
        <div class="bodywrapper">
          <div class="body" role="main">
            
  <div class="section" id="ganeti-file-based-disks-ownership">
<h1><a class="toc-backref" href="#id1">Ganeti file-based disks ownership</a><a class="headerlink" href="#ganeti-file-based-disks-ownership" title="Permalink to this headline"></a></h1>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Created:</th><td class="field-body">2015-Jan-20</td>
</tr>
<tr class="field-even field"><th class="field-name">Status:</th><td class="field-body">Implemented</td>
</tr>
<tr class="field-odd field"><th class="field-name">Ganeti-Version:</th><td class="field-body">2.14.0</td>
</tr>
</tbody>
</table>
<div class="contents topic" id="contents">
<p class="topic-title first">Contents</p>
<ul class="simple">
<li><a class="reference internal" href="#ganeti-file-based-disks-ownership" id="id1">Ganeti file-based disks ownership</a><ul>
<li><a class="reference internal" href="#current-state-and-shortcomings" id="id2">Current state and shortcomings</a></li>
<li><a class="reference internal" href="#proposed-changes" id="id3">Proposed changes</a></li>
<li><a class="reference internal" href="#implementation-details" id="id4">Implementation details</a></li>
</ul>
</li>
</ul>
</div>
<p>This design document explains the issue that emerges from the usage of the
<cite>detach</cite> operation to file-based disks and provides a simple solution to it.
Note that this design document applies only to disks of template <cite>file</cite> and
<cite>sharedfile</cite>, but not <cite>gluster</cite>. However, for brevity reasons these templates
will go under the umbrella term <cite>file-based</cite>.</p>
<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>When creating a file-based disk, Ganeti stores it inside a specific directory,
called <cite>file_storage_dir</cite>. Inside this directory, there is a folder for each
file-based instance and inside each folder are the files for the instance’s
disks (e.g. <code class="docutils literal"><span class="pre">&lt;file_storage_dir&gt;/&lt;instance_name&gt;/&lt;disk_name&gt;</span></code>). This way of
storing disks seems simple enough, but the
<cite>detach</cite> operation does not work well with it. The reason is that if a disk is
detached from an instance and attached to another one, the file will remain to
the folder of the original instance.</p>
<p>This means that if we try to destroy an instance with detached disks, Ganeti
will correctly complain that the instance folder still has disk data. In more
high-level terms, we need to find a way to resolve the issue of disk ownership
at the filesystem level for file-based instances.</p>
</div>
<div class="section" id="proposed-changes">
<h2><a class="toc-backref" href="#id3">Proposed changes</a><a class="headerlink" href="#proposed-changes" title="Permalink to this headline"></a></h2>
<p>The change we propose is simple. Once a disk is detached from an instance, it
will be moved out of the instance’s folder. The new location will be the
<cite>file_storage_dir</cite>, i.e. the disk will reside on the same level as the instance
folders. In order to maintain a consistent configuration, the logical_id of the
disk will be updated to point to the new path.</p>
<p>Similarly, on the <cite>attach</cite> operation, the file name and logical id will change
and the disk will be moved under the new instance’s directory.</p>
</div>
<div class="section" id="implementation-details">
<h2><a class="toc-backref" href="#id4">Implementation details</a><a class="headerlink" href="#implementation-details" title="Permalink to this headline"></a></h2>
<div class="section" id="detach-operation">
<h3>Detach operation<a class="headerlink" href="#detach-operation" title="Permalink to this headline"></a></h3>
<p>Before detaching a disk from an instance, we do the following:</p>
<ol class="arabic">
<li><p class="first">Transform the current path to the new one.</p>
<p>&lt;file_storage_dir&gt;/&lt;instance_name&gt;/&lt;disk_name&gt;&gt; &lt;file_storage_dir&gt;/&lt;disk_name&gt;</p>
</li>
<li><p class="first">Use the rpc call <code class="docutils literal"><span class="pre">call_blockdev_rename</span></code> to move the disk to the new path.</p>
</li>
<li><p class="first">Store the new <code class="docutils literal"><span class="pre">logical_id</span></code> to the configuration.</p>
</li>
</ol>
</div>
<div class="section" id="attach-operation">
<h3>Attach operation<a class="headerlink" href="#attach-operation" title="Permalink to this headline"></a></h3>
<p>Before attaching a disk to an instance, we do the following:</p>
<ol class="arabic simple">
<li>Create the new path for the file disk. In order to construct it properly,
use the <code class="docutils literal"><span class="pre">GenerateDiskTemplate</span></code> function to create a dummy disk template
and get its <code class="docutils literal"><span class="pre">logical_id</span></code>. The new <code class="docutils literal"><span class="pre">logical_id</span></code> contains the new path for
the file disk.</li>
<li>Use the rpc call <code class="docutils literal"><span class="pre">call_blockdev_rename</span></code> to move the disk to the new path.</li>
<li>Store the new <code class="docutils literal"><span class="pre">logical_id</span></code> to the configuration.</li>
</ol>
</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 file-based disks ownership</a><ul>
<li><a class="reference internal" href="#current-state-and-shortcomings">Current state and shortcomings</a></li>
<li><a class="reference internal" href="#proposed-changes">Proposed changes</a></li>
<li><a class="reference internal" href="#implementation-details">Implementation details</a><ul>
<li><a class="reference internal" href="#detach-operation">Detach operation</a></li>
<li><a class="reference internal" href="#attach-operation">Attach operation</a></li>
</ul>
</li>
</ul>
</li>
</ul>

  <h4>Previous topic</h4>
  <p class="topless"><a href="design-file-based-storage.html"
                        title="previous chapter">File-based Storage</a></p>
  <h4>Next topic</h4>
  <p class="topless"><a href="design-glusterfs-ganeti-support.html"
                        title="next chapter">GlusterFS Ganeti support</a></p>
  <div role="note" aria-label="source link">
    <h3>This Page</h3>
    <ul class="this-page-menu">
      <li><a href="_sources/design-file-based-disks-ownership.rst.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">
      <div><input type="text" name="q" /></div>
      <div><input type="submit" value="Go" /></div>
      <input type="hidden" name="check_keywords" value="yes" />
      <input type="hidden" name="area" value="default" />
    </form>
</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-glusterfs-ganeti-support.html" title="GlusterFS Ganeti support"
             >next</a></li>
        <li class="right" >
          <a href="design-file-based-storage.html" title="File-based Storage"
             >previous</a> |</li>
        <li class="nav-item nav-item-0"><a href="index.html">Ganeti 2.16.0~rc2 documentation</a> &#187;</li> 
      </ul>
    </div>
    <div class="footer" role="contentinfo">
        &#169; Copyright 2018, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015 Google Inc..
      Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.6.7.
    </div>
  </body>
</html>