storage: ZFS support

Implement ZFS storage backend driver. Currently supported
only on FreeBSD because of ZFS limitations on Linux.

Features supported:

 - pool-start, pool-stop
 - pool-info
 - vol-list
 - vol-create / vol-delete

Pool definition looks like that:

 <pool type='zfs'>
  <name>myzfspool</name>
  <source>
    <name>actualpoolname</name>
  </source>
 </pool>

The 'actualpoolname' value is a name of the pool on the system,
such as shown by 'zpool list' command. Target makes no sense
here because volumes path is always /dev/zvol/$poolname/$volname.

User has to create a pool on his own, this driver doesn't
support pool creation currently.

A volume could be used with Qemu by adding an entry like this:

    <disk type='volume' device='disk'>
      <driver name='qemu' type='raw'/>
      <source pool='myzfspool' volume='vol5'/>
      <target dev='hdc' bus='ide'/>
    </disk>
This commit is contained in:
Roman Bogorodskiy
2014-07-21 18:38:42 +04:00
parent 1b7c2c549e
commit 0257d06ba4
14 changed files with 492 additions and 3 deletions

View File

@@ -22,6 +22,7 @@
<ref name='poolrbd'/>
<ref name='poolsheepdog'/>
<ref name='poolgluster'/>
<ref name='poolzfs'/>
</choice>
</element>
</define>
@@ -157,6 +158,17 @@
</interleave>
</define>
<define name='poolzfs'>
<attribute name='type'>
<value>zfs</value>
</attribute>
<interleave>
<ref name='commonmetadata'/>
<ref name='sizing'/>
<ref name='sourcezfs'/>
</interleave>
</define>
<define name='sourceinfovendor'>
<interleave>
<optional>
@@ -370,6 +382,14 @@
</element>
</define>
<define name='sourcezfs'>
<element name='source'>
<interleave>
<ref name='sourceinfoname'/>
</interleave>
</element>
</define>
<define name='sourcefmtfs'>
<optional>
<element name='format'>

View File

@@ -117,6 +117,9 @@
<li>
<a href="#StorageBackendGluster">Gluster backend</a>
</li>
<li>
<a href="#StorageBackendZFS">ZFS backend</a>
</li>
</ul>
<h2><a name="StorageBackendDir">Directory pool</a></h2>
@@ -743,5 +746,36 @@
pool type.
</p>
<h2><a name="StorageBackendZFS">ZFS pools</a></h2>
<p>
This provides a pool based on the ZFS filesystem. It is currently
supported on FreeBSD only.
A pool has to be created before libvirt could start using it. That
could be done using <code>zpool create</code> command. Please refer to
the ZFS documentation for details on a pool creation.
<span class="since">Since 1.2.8</span>
</p>
<h3>Example pool input</h3>
<pre>
&lt;pool type="zfs"&gt;
&lt;name&gt;myzfspool&lt;/name&gt;
&lt;source&gt;
&lt;name&gt;zpoolname&lt;/name&gt;
&lt;/source&gt;
&lt;/pool&gt;</pre>
<h3>Valid pool format types</h3>
<p>
The ZFS volume pool does not use the pool format type element.
</p>
<h3>Valid pool format types</h3>
<p>
The ZFS volume pool does not use the volume format type element.
</p>
</body>
</html>