diff --git a/examples/objectivefs.yaml b/examples/objectivefs.yaml index e24a917..6d19745 100644 --- a/examples/objectivefs.yaml +++ b/examples/objectivefs.yaml @@ -1,6 +1,6 @@ driver: objectivefs objectivefs: - # note, ALL provisioned filesystems will be created in this pool + # note, ALL provisioned filesystems will be created in this pool / bucket # with the same passphrase entered below pool: ofs cli: diff --git a/src/driver/controller-zfs/index.js b/src/driver/controller-zfs/index.js index 28d714a..f1ff1d1 100644 --- a/src/driver/controller-zfs/index.js +++ b/src/driver/controller-zfs/index.js @@ -1190,11 +1190,30 @@ class ControllerZfsBaseDriver extends CsiBaseDriver { // this should be already set, but when coming from a volume source // it may not match that of the source - // TODO: probably need to recalculate size based on *actual* volume source blocksize in case of difference from currently configured properties.volsize = capacity_bytes; - //dedup - //compression + // dedup + // on, off, verify + // zfs set dedup=on tank/home + // restore default must use the below + // zfs inherit [-rS] property filesystem|volume|snapshot… + if ( + (typeof this.options.zfs.zvolDedup === "string" || + this.options.zfs.zvolDedup instanceof String) && + this.options.zfs.zvolDedup.length > 0 + ) { + properties.dedup = this.options.zfs.zvolDedup; + } + + // compression + // lz4, gzip-9, etc + if ( + (typeof this.options.zfs.zvolCompression === "string" || + this.options.zfs.zvolCompression instanceof String) && + this.options.zfs.zvolCompression > 0 + ) { + properties.compression = this.options.zfs.zvolCompression; + } if (setProps) { await zb.zfs.set(datasetName, properties); diff --git a/src/driver/freenas/api.js b/src/driver/freenas/api.js index e1933f9..0af12e9 100644 --- a/src/driver/freenas/api.js +++ b/src/driver/freenas/api.js @@ -2917,11 +2917,30 @@ class FreeNASApiDriver extends CsiBaseDriver { // this should be already set, but when coming from a volume source // it may not match that of the source - // TODO: probably need to recalculate size based on *actual* volume source blocksize in case of difference from currently configured properties.volsize = capacity_bytes; - //dedup - //compression + // dedup + // on, off, verify + // zfs set dedup=on tank/home + // restore default must use the below + // zfs inherit [-rS] property filesystem|volume|snapshot… + if ( + (typeof this.options.zfs.zvolDedup === "string" || + this.options.zfs.zvolDedup instanceof String) && + this.options.zfs.zvolDedup.length > 0 + ) { + properties.dedup = this.options.zfs.zvolDedup; + } + + // compression + // lz4, gzip-9, etc + if ( + (typeof this.options.zfs.zvolCompression === "string" || + this.options.zfs.zvolCompression instanceof String) && + this.options.zfs.zvolCompression > 0 + ) { + properties.compression = this.options.zfs.zvolCompression; + } if (setProps) { await httpApiClient.DatasetSet(datasetName, properties);