Project

General

Profile

Actions

Feature #11355

open

zfs create needs dry-run

Added by Mike Gerdts almost 5 years ago. Updated over 4 years ago.

Status:
New
Priority:
Normal
Assignee:
Category:
-
Start date:
Due date:
% Done:

0%

Estimated time:
Difficulty:
Medium
Tags:
Gerrit CR:
External Bug:

Description

There are times when we need to know the amount of space that a volume with refreservation=auto will reserve ahead of the volume creation. Forcing the callers to reimplement zvol_volsize_to_reservation() is not reasonable.

Rather than just having a one-off command that calculates this, we could extend zfs create so that it has dry-run, verbose, and parseable options. For example, the first form is intended to be readable by humans and the second form is tab separated parseable output.

# zfs create -b 16k -nvV 1t zones/bigvol
would create zones/bigvol
        volblocksize=16384
        volsize=1099511627776
        refreservation=1116710371328
# zfs create -b 16k -nPV 1t zones/bigvol
create  zones/bigvol
property        volblocksize    16384
property        volsize 1099511627776
property        refreservation  1116710371328

There is an open PR in zfsonlinux where the interface details should be hashed out.

https://github.com/zfsonlinux/zfs/pull/8974

Because of a somewhat urgent need, the functionality requested in this change is already in SmartOS. SmartOS does not advertise the change via the man page or usage messages.

https://github.com/joyent/illumos-joyent/commit/b322ba367cdb75882f1cede5a8b22c7fd17ced94

Actions

Also available in: Atom PDF