{"id":18690457,"url":"https://github.com/kvaps/opennebula-addon-zfs","last_synced_at":"2026-01-30T00:49:17.639Z","repository":{"id":80916072,"uuid":"43367405","full_name":"kvaps/opennebula-addon-zfs","owner":"kvaps","description":"ZFS Storage Driver","archived":false,"fork":false,"pushed_at":"2016-11-12T18:43:45.000Z","size":25,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-12T05:54:24.775Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kvaps.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-09-29T12:57:51.000Z","updated_at":"2018-07-13T16:52:37.000Z","dependencies_parsed_at":null,"dependency_job_id":"157b3e99-3d0b-4a51-8849-6a2152e2720f","html_url":"https://github.com/kvaps/opennebula-addon-zfs","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kvaps%2Fopennebula-addon-zfs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kvaps%2Fopennebula-addon-zfs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kvaps%2Fopennebula-addon-zfs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kvaps%2Fopennebula-addon-zfs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kvaps","download_url":"https://codeload.github.com/kvaps/opennebula-addon-zfs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248525156,"owners_count":21118616,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-07T10:47:38.376Z","updated_at":"2026-01-30T00:49:12.609Z","avatar_url":"https://github.com/kvaps.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Opennebula ZFS Storage Driver \n\n## Description\n\nThe ZFS datastore driver provides OpenNebula with the possibility of using ZVOL volumes instead of plain files to hold the Virtual Images.\n\n## Development\n\nTo contribute bug patches or new features, you can use the github Pull Request model. It is assumed that code and documentation are contributed under the Apache License 2.0. \n\nMore info:\n* [How to Contribute](http://opennebula.org/addons/contribute/)\n* Support: [OpenNebula user forum](https://forum.opennebula.org/c/support)\n* Development: [OpenNebula developers forum](https://forum.opennebula.org/c/development)\n* Issues Tracking: Github issues (https://github.com/OpenNebula/addon-zfs/issues)\n\n## Author\n\n* [kvaps](mailto:kvapss@gmail.com)\n\n## Compatibility\n\nThis add-on is compatible with OpenNebula 4.6+\n\n## Requirements\n\n### OpenNebula Front-end\n\nPassword-less ssh access to an OpenNebula ZFS host. (eg. localhost)\n\n### OpenNebula ZFS Host\n\nThe oneadmin user should be able to execute ZFS related command with sudo passwordlessly.\n\n* Password-less sudo permission for: `zfs` and `dd`.\n* `oneadmin` needs to belong to the `disk` group (for KVM).\n\n## Limitations\n\nThere are some limitations that you have to consider, though:\n\n* ZFS is not cluster filesystem! Use it on single host. For multiple hosts you may use [ceph](http://docs.opennebula.org/4.10/administration/storage/ceph_ds.html) or [opennebula-addon-iscsi](https://github.com/kvaps/opennebula-addon-iscsi) with zfs support.\n\n## Installation\n\nTo install the driver you have to copy these files:\n\n* `datastore/zfs` --\u003e `/var/lib/one/remotes/datastore/zfs`\n* `tm/zfs` --\u003e `/var/lib/one/remotes/tm/zfs`\n\n## Configuration\n\n### Configuring the System Datastore\n\nTo use ZFS drivers, you must configure the system datastore as shared. This system datastore will hold only the symbolic links to the block devices, so it will not take much space. See more details on the [System Datastore Guide](http://docs.opennebula.org/4.6/administration/storage/system_ds.html).\n\nIt will also be used to hold context images and Disks created on the fly, they will be created as regular files.\n\n### Configuring ZFS Datastores\n\nThe first step to create a ZFS datastore is to set up a template file for it. In the following table you can see the supported configuration attributes. The datastore type is set by its drivers, in this case be sure to add `DS_MAD=zfs` and `TM_MAD=zfs` for the transfer mechanism, see below.\n\n|    Attribute        |                     Description                                                                                                                                      |\n| ---------------     | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| `NAME`              | The name of the datastore                                                                                                                                            |\n| `DS_MAD`            | Must be `zfs`                                                                                                                                                        |\n| `TM_MAD`            | Must be `zfs`                                                                                                                                                        |\n| `DISK_TYPE`         | Must be `block`                                                                                                                                                      |\n| `BRIDGE_LIST`       | The zfs server host. Defaults to `localhost`                                                                                                                         |\n| `DATASET_NAME`      | The top level dataset name under which all volumes are created. Defaults to `rpool/ONE/images`                                                                       |\n| `ZFS_CMD`           | Path to the zfs binary. Defaults to `/usr/sbin/zfs`                                                                                                                  |\n| `RESTRICTED_DIRS`   | Paths that can not be used to register images. A space separated list of paths. (1)                                                                                  |\n| `SAFE_DIRS`         | If you need to un-block a directory under one of the RESTRICTED_DIRS. A space separated list of paths.                                                               |\n| `NO_DECOMPRESS`     | Do not try to untar or decompress the file to be registered. Useful for specialized Transfer Managers                                                                |\n| `LIMIT_TRANSFER_BW` | Specify the maximum transfer rate in bytes/second when downloading images from a http/https URL. Suffixes K, M or G can be used.                                     |\n\n\n\u003e (1) This will prevent users registering important files as VM images and accessing them through their VMs. OpenNebula will automatically add its configuration directories: /var/lib/one, /etc/one and oneadmin's home. If users try to register an image from a restricted directory, they will get the following error message: “Not allowed to copy image file”.\n\nFor example, the following examples illustrates the creation of an ZFS datastore using a configuration file. In this case we will use the host `localhost` as ZFS-enabled host.\n\n~~~~\n\u003e cat ds.conf\nNAME = \"zfs\"\nDS_MAD = zfs\nTM_MAD = zfs\nDISK_TYPE = block\nDATASET_NAME = rpool/ONE/images\n\n\u003e onedatastore create ds.conf\nID: 100\n\n\u003e onedatastore list\n  ID NAME            CLUSTER  IMAGES TYPE   TM    \n   0 system          none     0      fs     shared\n   1 default         none     3      fs     shared\n 100 zfs             none     0      zfs    shared\n~~~~\n\nThe DS and TM MAD can be changed later using the onedatastore update command. You can check more details of the datastore by issuing the onedatastore show command.\n\n\u003e Note that datastores are not associated to any cluster by default, and they are supposed to be accessible by every single host. If you need to configure datastores for just a subset of the hosts take a look to the [Cluster guide](http://opennebula.org/documentation:rel4.4:cluster_guide).\n\n### Configuring DS_MAD and TM_MAD\n\nThese values must be added to `/etc/one/oned.conf`\n\nFirst we add `zfs` as an option, replace:\n\n~~~~\nTM_MAD = [\n    executable = \"one_tm\",\n    arguments = \"-t 15 -d dummy,lvm,shared,fs_lvm,qcow2,ssh,vmfs,ceph\"\n]\n~~~~\n\nWith:\n\n~~~~\nTM_MAD = [\n    executable = \"one_tm\",\n    arguments = \"-t 15 -d dummy,lvm,shared,fs_lvm,qcow2,ssh,vmfs,ceph,zfs\"\n]\n~~~~\n\nAfter that create a new TM_MAD_CONF section:\n\n~~~~\nTM_MAD_CONF = [\n    name = \"zfs\", ln_target = \"NONE\", clone_target = \"SELF\", shared = \"yes\"\n]\n~~~~\n\nNow we add `zfs` as a new `DATASTORE_MAD` option, replace:\n\n~~~~\nDATASTORE_MAD = [\n    executable = \"one_datastore\",\n    arguments  = \"-t 15 -d dummy,fs,vmfs,lvm,ceph\"\n]\n~~~~\n\nWith:\n\n~~~~\nDATASTORE_MAD = [\n    executable = \"one_datastore\",\n    arguments  = \"-t 15 -d dummy,fs,vmfs,lvm,ceph,zfs\"\n]\n~~~~\n\nFor OpenNebula 5.0 we also need to  create a new DS_MAD_CONF section:\n\n~~~~\nDS_MAD_CONF = [\n    NAME = \"zfs\", REQUIRED_ATTRS = \"DISK_TYPE\", PERSISTENT_ONLY = \"YES\"\n]\n~~~~\n\n## Usage \n\nThe ZFS transfer driver will create volume with zfs. Once the zvol is available, the driver will link it to `disk.i`.\n\n### Host Configuration\n\nThe host must have ZFS and have the dataset used in the `DATASET` attributed of the datastore template. \n\nIt’s also required to have password-less sudo permission for `zfs` and `dd`.\n\n## Tuning \u0026 Extending\n\nSystem administrators and integrators are encouraged to modify these drivers in order to integrate them with their datacenter:\n\nUnder ``/var/lib/one/remotes/``:\n\n-  **datastore/zfs/zfs.conf**: Default values for LVM parameters\n\n   -  ZFS_CMD: Path to the zfs binary\n   -  BRIDGE_LIST: The zfs server host\n   -  DATASET_NAME: Default dataset\n   -  STAGING_DIR: Staging directory\n\n-  **datastore/zfs/cp**: Registers a new image. Creates a new ZFS volume.\n-  **datastore/zfs/mkfs**: Makes a new empty image. Creates a new ZFS volume.\n-  **datastore/zfs/rm**: Removes the ZFS volume.\n-  **tm/zfs/ln**: Links to the ZFS volume.\n-  **tm/zfs/clone**: Clones the image by creating a snapshot.\n-  **tm/zfs/mvds**: Saves the image in a new ZFS volume for SAVE\\_AS.\n\n## Optimizations\n\n* Due [this issue](https://github.com/zfsonlinux/zfs/issues/824) use more large values of `volblocksize`.\n* Also you may to turn on the writeback cache or set `io` to `native`\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkvaps%2Fopennebula-addon-zfs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkvaps%2Fopennebula-addon-zfs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkvaps%2Fopennebula-addon-zfs/lists"}