salt.modules.zfs

Salt interface to ZFS commands

codeauthor:Nitin Madhok <nmadhok@clemson.edu>
salt.modules.zfs.create(name, **kwargs)

New in version 2015.5.0.

Create a ZFS File System.

CLI Example:

salt '*' zfs.create myzpool/mydataset [create_parent=True|False]

Note

ZFS properties can be specified at the time of creation of the filesystem by passing an additional argument called "properties" and specifying the properties with their respective values in the form of a python dictionary:

properties="{'property1': 'value1', 'property2': 'value2'}"

Example:

salt '*' zfs.create myzpool/mydataset properties="{'mountpoint': '/export/zfs', 'sharenfs': 'on'}"
salt.modules.zfs.destroy(name, **kwargs)

New in version 2015.5.0.

Destroy a ZFS File System.

CLI Example:

salt '*' zfs.destroy myzpool/mydataset [force=True|False]
salt.modules.zfs.exists(name)

New in version 2015.5.0.

Check if a ZFS filesystem or volume or snapshot exists.

CLI Example:

salt '*' zfs.exists myzpool/mydataset
salt.modules.zfs.list(name='', **kwargs)

New in version 2015.5.0.

Return a list of all datasets or a specified dataset on the system and the values of their used, available, referenced, and mountpoint properties.

Note

Information about the dataset and all of it's descendent datasets can be displayed by passing recursive=True on the CLI.

CLI Example:

salt '*' zfs.list [recursive=True|False]
salt '*' zfs.list /myzpool/mydataset [recursive=True|False]

Note

Dataset property value output can be customized by passing an additional argument called "properties" in the form of a python list:

properties="[property1, property2, property3]"

Example:

salt '*' zfs.list /myzpool/mydataset properties="[name, sharenfs, mountpoint]"
salt.modules.zfs.rename(name, new_name)

New in version 2015.5.0.

Rename or Relocate a ZFS File System.

CLI Example:

salt '*' zfs.rename myzpool/mydataset myzpool/renameddataset