Is there an API for accessing the ZFS file system

I would like to know if there is a way to access the ZFS api (preferably from python, but C is fine too). My goal is to write some tools that will track my pools, but I definitely would like not to analyze the output of the zpool command.

+7
source share
3 answers

There are java bindings to libzfs on Solaris. AFAIK they have not yet been ported to BSD or Linux. However, it may not be of much interest to begin with, since it is, after all, Java, it may be relatively portable already.

The IIRC Java API was used for the Solaris 10 ZFS web management interface.

Also, I heard rumors about the Python API (maybe it was used in Tim Foster's new-style Autosnapshot service?).

Here is a link to the last bit that I knew how to find

+6
source

Also, if you use OpenZFS (i.e. ZFS on Illumos, FreeBSD, Linux, Mac OS X, etc.), now libzfs_core is an alternative to libzfs (which has never been a stable API). See: http://blog.delphix.com/matt/2012/01/17/the-future-of-libzfs/

+3
source

Well, this may not be the complete answer, but the libzfs library in / usr / lib. It is strange that the headers for libzfs (zfs.h, etc.) are not installed and are present only in the kernel sources.

So, if you need to develop something using libzfs, you can try to install the kernel source code and include the necessary headers there.

0
source

All Articles