mirror of
https://github.com/democratic-csi/democratic-csi.git
synced 2026-10-18 15:38:23 +02:00
implement zvol dedup/compression settings
Signed-off-by: Travis Glenn Hansen <travisghansen@yahoo.com>
This commit is contained in:
@@ -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:
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user