storage.html 15.7 KB
Newer Older
1 2
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
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
<html xmlns="http://www.w3.org/1999/xhtml">
<!--
        This file is autogenerated from storage.html.in
        Do not edit this file. Changes will be lost.
      -->
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
    <link rel="stylesheet" type="text/css" href="main.css" />
    <link rel="SHORTCUT ICON" href="32favicon.png" />
    <title>libvirt: Storage Management</title>
    <meta name="description" content="libvirt, virtualization, virtualization API" />
  </head>
  <body>
    <div id="header">
      <div id="headerLogo"></div>
      <div id="headerSearch">
        <form action="search.php" enctype="application/x-www-form-urlencoded" method="get">
          <input id="query" name="query" type="text" size="12" value="" />
          <input id="submit" name="submit" type="submit" value="Search" />
        </form>
      </div>
    </div>
    <div id="body">
      <div id="content">
        <h1>Storage Management</h1>
        <p>
This page describes the backends for the storage management capabilities in
30 31
libvirt.
</p>
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 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391
        <ul><li>
        <a href="#StorageBackendDir">Directory backend</a>
      </li><li>
        <a href="#StorageBackendFS">Local filesystem backend</a>
      </li><li>
        <a href="#StorageBackendNetFS">Network filesystem backend</a>
      </li><li>
        <a href="#StorageBackendLogical">Logical backend</a>
      </li><li>
        <a href="#StorageBackendDisk">Disk backend</a>
      </li><li>
        <a href="#StorageBackendISCSI">iSCSI backend</a>
      </li></ul>
        <h2>
          <a name="StorageBackendDir" id="StorageBackendDir">Directory pool</a>
        </h2>
        <p>
      A pool with a type of <code>dir</code> provides the means to manage
      files within a directory. The files can be fully allocated raw files,
      sparsely allocated raw files, or one of the special disk formats
      such as <code>qcow</code>,<code>qcow2</code>,<code>vmdk</code>,
      <code>cow</code>, etc as supported  by the <code>qemu-img</code>
      program. If the directory does not exist at the time the pool is
      defined, the <code>build</code> operation can be used to create it.
    </p>
        <h3>Example pool input definition</h3>
        <pre>
      &lt;pool type="dir"&gt;
        &lt;name&gt;virtimages&lt;/name&gt;
        &lt;target&gt;
          &lt;path&gt;/var/lib/virt/images&lt;/path&gt;
        &lt;/target&gt;
      &lt;/pool&gt;
    </pre>
        <h3>Valid pool format types</h3>
        <p>
      The directory pool does not use the pool format type element.
    </p>
        <h3>Valid volume format types</h3>
        <p>
      One of the following options:
    </p>
        <ul><li><code>raw</code>: a plain file</li><li><code>bochs</code>: Bochs disk image format</li><li><code>cloop</code>: compressed loopback disk image format</li><li><code>cow</code>: User Mode Linux disk image format</li><li><code>dmg</code>: Mac disk image format</li><li><code>iso</code>: CDROM disk image format</li><li><code>qcow</code>: QEMU v1 disk image format</li><li><code>qcow2</code>: QEMU v2 disk image format</li><li><code>vmdk</code>: VMWare disk image format</li><li><code>vpc</code>: VirtualPC disk image format</li></ul>
        <p>
      When listing existing volumes all these formats are supported
      natively. When creating new volumes, only a subset may be
      available. The <code>raw</code> type is guaranteed always
      available. The <code>qcow2</code> type can be created if
      either <code>qemu-img</code> or <code>qcow-create</code> tools
      are present. The others are dependent on support of the
      <code>qemu-img</code> tool.

    </p>
        <h2>
          <a name="StorageBackendFS" id="StorageBackendFS">Filesystem pool</a>
        </h2>
        <p>
      This is a variant of the directory pool. Instead of creating a
      directory on an existing mounted filesystem though, it expects
      a source block device to be named. This block device will be
      mounted and files managed in the directory of its mount point.
      It will default to allowing the kernel to automatically discover
      the filesystem type, though it can be specified manually if
      required.
    </p>
        <h3>Example pool input</h3>
        <pre>
      &lt;pool type="fs"&gt;
        &lt;name&gt;virtimages&lt;/name&gt;
        &lt;source&gt;
          &lt;device path="/dev/VolGroup00/VirtImages"/&gt;
        &lt;/source&gt;
        &lt;target&gt;
          &lt;path&gt;/var/lib/virt/images&lt;/path&gt;
        &lt;/target&gt;
      &lt;/pool&gt;
    </pre>
        <h3>Valid pool format types</h3>
        <p>
      The filesystem pool supports the following formats:
    </p>
        <ul><li><code>auto</code> - automatically determine format</li><li>
        <code>ext2</code>
      </li><li>
        <code>ext3</code>
      </li><li>
        <code>ext4</code>
      </li><li>
        <code>ufs</code>
      </li><li>
        <code>iso9660</code>
      </li><li>
        <code>udf</code>
      </li><li>
        <code>gfs</code>
      </li><li>
        <code>gfs2</code>
      </li><li>
        <code>vfat</code>
      </li><li>
        <code>hfs+</code>
      </li><li>
        <code>xfs</code>
      </li></ul>
        <h3>Valid volume format types</h3>
        <p>
      The valid volume types are the same as for the <code>directory</code>
      pool type.
    </p>
        <h2>
          <a name="StorageBackendNetFS" id="StorageBackendNetFS">Network filesystem pool</a>
        </h2>
        <p>
      This is a variant of the filesystem pool. Instead of requiring
      a local block device as the source, it requires the name of a
      host and path of an exported directory. It will mount this network
      filesystem and manage files within the directory of its mount
      point. It will default to using NFS as the protocol.
    </p>
        <h3>Example pool input</h3>
        <pre>
      &lt;pool type="netfs"&gt;
        &lt;name&gt;virtimages&lt;/name&gt;
        &lt;source&gt;
          &lt;host name="nfs.example.com"/&gt;
          &lt;dir path="/var/lib/virt/images"/&gt;
        &lt;/source&gt;
        &lt;target&gt;
          &lt;path&gt;/var/lib/virt/images&lt;/path&gt;
        &lt;/target&gt;
      &lt;/pool&gt;
    </pre>
        <h3>Valid pool format types</h3>
        <p>
      The network filesystem pool supports the following formats:
    </p>
        <ul><li><code>auto</code> - automatically determine format</li><li>
        <code>nfs</code>
      </li></ul>
        <h3>Valid volume format types</h3>
        <p>
      The valid volume types are the same as for the <code>directory</code>
      pool type.
    </p>
        <h2>
          <a name="StorageBackendLogical" id="StorageBackendLogical">Logical volume pools</a>
        </h2>
        <p>
      This provides a pool based on an LVM volume group. For a
      pre-defined LVM volume group, simply providing the group
      name is sufficient, while to build a new group requires
      providing a list of source devices to serve as physical
      volumes. Volumes will be allocated by carving out chunks
      of storage from the volume group.
    </p>
        <h3>Example pool input</h3>
        <pre>
      &lt;pool type="logical"&gt;
        &lt;name&gt;HostVG&lt;/name&gt;
        &lt;source&gt;
          &lt;device path="/dev/sda1"/&gt;
          &lt;device path="/dev/sdb1"/&gt;
          &lt;device path="/dev/sdc1"/&gt;
        &lt;/source&gt;
        &lt;target&gt;
          &lt;path&gt;/dev/HostVG&lt;/path&gt;
        &lt;/target&gt;
      &lt;/pool&gt;
    </pre>
        <h3>Valid pool format types</h3>
        <p>
      The logical volume pool does not use the pool format type element.
    </p>
        <h3>Valid volume format types</h3>
        <p>
      The logical volume pool does not use the volume format type element.
    </p>
        <h2>
          <a name="StorageBackendDisk" id="StorageBackendDisk">Disk volume pools</a>
        </h2>
        <p>
      This provides a pool based on a physical disk. Volumes are created
      by adding partitions to the disk. Disk pools are have constraints
      on the size and placement of volumes. The 'free extents'
      information will detail the regions which are available for creating
      new volumes. A volume cannot span across 2 different free extents.
    </p>
        <h3>Example pool input</h3>
        <pre>
      &lt;pool type="disk"&gt;
        &lt;name&gt;sda&lt;/name&gt;
        &lt;source&gt;
          &lt;device path='/dev/sda'/&gt;
        &lt;/source&gt;
        &lt;target&gt;
          &lt;path&gt;/dev&lt;/path&gt;
        &lt;/target&gt;
      &lt;/pool&gt;
    </pre>
        <h3>Valid pool format types</h3>
        <p>
      The disk volume pool accepts the following pool format types, representing
      the common partition table types:
    </p>
        <ul><li>
        <code>dos</code>
      </li><li>
        <code>dvh</code>
      </li><li>
        <code>gpt</code>
      </li><li>
        <code>mac</code>
      </li><li>
        <code>bsd</code>
      </li><li>
        <code>pc98</code>
      </li><li>
        <code>sun</code>
      </li></ul>
        <p>
      The <code>dos</code> or <code>gpt</code> formats are recommended for
      best portability - the latter is needed for disks larger than 2TB.
    </p>
        <h3>Valid volume format types</h3>
        <p>
      The disk volume pool accepts the following volume format types, representing
      the common partition entry types:
    </p>
        <ul><li>
        <code>none</code>
      </li><li>
        <code>linux</code>
      </li><li>
        <code>fat16</code>
      </li><li>
        <code>fat32</code>
      </li><li>
        <code>linux-swap</code>
      </li><li>
        <code>linux-lvm</code>
      </li><li>
        <code>linux-raid</code>
      </li><li>
        <code>extended</code>
      </li></ul>
        <h2>
          <a name="StorageBackendISCSI" id="StorageBackendISCSI">iSCSI volume pools</a>
        </h2>
        <p>
      This provides a pool based on an iSCSI target. Volumes must be
      pre-allocated on the iSCSI server, and cannot be created via
      the libvirt APIs. Since /dev/XXX names may change each time libvirt
      logs into the iSCSI target, it is recommended to configure the pool
      to use <code>/dev/disk/by-path</code> or <code>/dev/disk/by-id</code>
      for the target path. These provide persistent stable naming for LUNs
    </p>
        <h3>Example pool input</h3>
        <pre>
      &lt;pool type="iscsi"&gt;
        &lt;name&gt;virtimages&lt;/name&gt;
        &lt;source&gt;
          &lt;host name="iscsi.example.com"/&gt;
          &lt;device path="demo-target"/&gt;
        &lt;/source&gt;
        &lt;target&gt;
          &lt;path&gt;/dev/disk/by-path&lt;/path&gt;
        &lt;/target&gt;
      &lt;/pool&gt;
    </pre>
        <h3>Valid pool format types</h3>
        <p>
      The logical volume pool does not use the pool format type element.
    </p>
        <h3>Valid volume format types</h3>
        <p>
      The logical volume pool does not use the volume format type element.
    </p>
      </div>
      <div id="menu">
        <ul class="l0"><li>
            <a title="Front page of the libvirt website" class="inactive" href="index.html">Home</a>
          </li><li>
            <a title="Details of new features and bugs fixed in each release" class="inactive" href="news.html">News</a>
          </li><li>
            <a title="Get the latest source releases, binary builds and get access to the source repository" class="inactive" href="downloads.html">Downloads</a>
          </li><li>
            <a title="Information for users, administrators and developers" class="active" href="docs.html">Documentation</a>
            <ul class="l1"><li>
                <a title="Information about deploying and using libvirt" class="inactive" href="deployment.html">Deployment</a>
              </li><li>
                <a title="Overview of the logical subsystems in the libvirt API" class="inactive" href="intro.html">Architecture</a>
              </li><li>
                <a title="Description of the XML formats used in libvirt" class="inactive" href="format.html">XML format</a>
              </li><li>
                <a title="Hypervisor specific driver information" class="active" href="drivers.html">Drivers</a>
                <ul class="l2"><li>
                    <a title="Driver the Xen hypervisor" class="inactive" href="drvxen.html">Xen</a>
                  </li><li>
                    <a title="Driver for QEMU, KQEMU, KVM and Xenner" class="inactive" href="drvqemu.html">QEMU / KVM</a>
                  </li><li>
                    <a title="Driver for the Linux native container API" class="inactive" href="drvlxc.html">Linux Container</a>
                  </li><li>
                    <a title="Psuedo-driver simulating APIs in memory for test suites" class="inactive" href="drvtest.html">Test</a>
                  </li><li>
                    <a title="Driver providing secure remote to the libvirt APIs" class="inactive" href="drvremote.html">Remote</a>
                  </li><li>
                    <a title="Driver for the OpenVZ container technology" class="inactive" href="drvopenvz.html">OpenVZ</a>
                  </li><li>
                    <span class="active">Storage</span>
                  </li></ul>
              </li><li>
                <a title="Reference manual for the C public API" class="inactive" href="html/index.html">API reference</a>
              </li><li>
                <a title="Bindings of the libvirt API for other languages" class="inactive" href="bindings.html">Language bindings</a>
              </li></ul>
          </li><li>
            <a title="User contributed content" class="inactive" href="http://wiki.libvirt.org">Wiki</a>
          </li><li>
            <a title="Frequently asked questions" class="inactive" href="FAQ.html">FAQ</a>
          </li><li>
            <a title="How and where to report bugs and request features" class="inactive" href="bugs.html">Bug reports</a>
          </li><li>
            <a title="How to contact the developers via email and IRC" class="inactive" href="contact.html">Contact</a>
          </li><li>
            <a title="Miscellaneous links of interest related to libvirt" class="inactive" href="relatedlinks.html">Related Links</a>
          </li><li>
            <a title="Overview of all content on the website" class="inactive" href="sitemap.html">Sitemap</a>
          </li></ul>
      </div>
    </div>
    <div id="footer">
      <div id="projects">
        <dl id="p1"><dt>
            <a href="http://augeas.net/">Augeas</a>
          </dt><dd>
            <span>A configuration editing tool and API</span>
          </dd><dt>
            <a href="http://libvirt.org/">libvirt</a>
          </dt><dd>
            <span>The open source virtualization API</span>
          </dd></dl>
        <dl id="p2"><dt>
            <a href="http://cobbler.et.redhat.com/">Cobbler</a>
          </dt><dd>
            <span>OS provisioning and profile management</span>
          </dd><dt>
            <a href="http://ovirt.org/">oVirt</a>
          </dt><dd>
            <span>Virtualization management across the data center</span>
          </dd></dl>
        <dl id="p3"><dt>
            <a href="http://freeipa.org/">FreeIPA</a>
          </dt><dd>
            <span>Identity, policy and audit management</span>
          </dd><dt>
            <a href="http://virt-manager.org/">Virtual Machine Manager</a>
          </dt><dd>
            <span>Virtualization management from the desktop</span>
          </dd></dl>
      </div>
D
Daniel Veillard 已提交
392 393
      <p id="sponsor">
	    Sponsored by:<br /><a href="http://et.redhat.com/"><img src="redhat.gif" alt="Project sponsored by Red Hat" /></a></p>
394 395 396
    </div>
  </body>
</html>