{"id":18690464,"url":"https://github.com/kvaps/opennebula-addon-linstor_un","last_synced_at":"2025-09-05T11:35:05.750Z","repository":{"id":80916077,"uuid":"180793545","full_name":"kvaps/opennebula-addon-linstor_un","owner":"kvaps","description":"Community driven full-feature Linstor storage driver for OpenNebula","archived":false,"fork":false,"pushed_at":"2021-11-11T17:26:55.000Z","size":283,"stargazers_count":3,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-12-28T02:30:19.394Z","etag":null,"topics":["drbd","linstor","lvm","opennebula","storage","zfs"],"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":"2019-04-11T13:03:50.000Z","updated_at":"2021-11-11T17:26:45.000Z","dependencies_parsed_at":null,"dependency_job_id":"9c301cb4-6aa2-41f0-8121-850df6abdd17","html_url":"https://github.com/kvaps/opennebula-addon-linstor_un","commit_stats":null,"previous_names":[],"tags_count":43,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kvaps%2Fopennebula-addon-linstor_un","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kvaps%2Fopennebula-addon-linstor_un/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kvaps%2Fopennebula-addon-linstor_un/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kvaps%2Fopennebula-addon-linstor_un/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kvaps","download_url":"https://codeload.github.com/kvaps/opennebula-addon-linstor_un/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239550283,"owners_count":19657541,"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":["drbd","linstor","lvm","opennebula","storage","zfs"],"created_at":"2024-11-07T10:47:39.959Z","updated_at":"2025-02-18T21:14:12.633Z","avatar_url":"https://github.com/kvaps.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Linstor Storage Driver (unofficial)\n\n## Description\n\nCommunity driven full-feature Linstor storage driver for OpenNebula\n\nRead the [**blog article**](https://opennebula.org/linstor_un-new-storage-driver-for-opennebula-2/) for more details...\n\n### Comparsion to addon-linstor\n\nWhy not simply use the [official Linstor driver](https://github.com/OpenNebula/addon-linstor)? I was trying an official Linstor driver for OpenNebula, before I made a decidion to write my own implementation. And I didn't like it because of reasons, that are mostly described below\n\n* Bash-written.\n  Unlike official Linstor driver which is written in python, this driver is written in bash. Any driver action is just a conventional bash script, which is calling standard shell-commands, meaning these scripts can be easily updated or extended.\n* Uses OpenNebula native library\n  This driver uses standard OpenNebula library which provides simplicity developing and debugging driver actions, e.g. you will always see what exact command was unsuccessful from the VM log, if something went wrong.\n* Does not requires external dependings.\n  Official driver needs configured linstor-client and extra python-bindings on every compute node. This driver has a central managment model from the OpenNebula frontend node, so it requires only `jq` and `linstor-client` installed on the frontend node, and no external components on compute nodes. It's also worth noting, that you still need linstor-satellite and drbd9 module to build linstor-cluster.\n* Usually supports newer versions of OpenNebula.\n* Can work with any backend, even without snapshots support.\n\n## Compatibility\n\nThis add-on is compatible with:\n\n* OpenNebula 5.8+\n* Linstor server 1.7.0+\n* Linstor client 1.1.1+\n\n## OpenNebula Installation\n\n### Requirements\n\n* Installed `jq` and `linstor` on the OpenNebula frontend.\n* Configured Linstor cluster and access to it from the OpenNebula frontend server.\n* All OpenNebula hosts should have DRBD9 module installed and be registred in Linstor cluster as satellite nodes.\n\n### Installation steps\n\n* Copy [vmm overriders](vmm/kvm) to `/var/lib/one/remotes/vmm/kvm/`\n* Copy [datastore drivers](datastore/linstor_un) to `/var/lib/one/remotes/datastore/linstor_un`\n* Copy [transport drivers](tm/linstor_un) to `/var/lib/one/remotes/tm/linstor_un`\n* Move [datastore config](datastore/linstor_un/linstor_un.conf) to `/var/lib/one/remotes/etc/datastore/linstor_un/linstor_un.conf`\n\n*Only for OpenNebula 5.10 and below*:\n* Uncomment `LEGACY_MONITORING=1` option in `linstor_un.conf` \n\n*Only for OpenNebula 5.12 and below*:\n* Copy `/var/lib/one/remotes/tm/ssh/context` to `/var/lib/one/remotes/tm/linstor_un/context`\n\n#### Update **oned.conf**:\n\nModify **VM_MAD** section for the **kvm** driver:\n- add `save=save_linstor_un` and `restore=restore_linstor_un` overrides to local actions.\n\n```diff\n VM_MAD = [\n     NAME           = \"kvm\",\n-    ARGUMENTS      = \"-t 15 -r 0 kvm\",\n+    ARGUMENTS      = \"-t 15 -r 0 kvm -l save=save_linstor_un,restore=restore_linstor_un\",\n ]\n```\n\nModify **TM_MAD** section for the **one_tm** driver:\n- add `linstor_un` transfer drivers list.\n\n```diff\n TM_MAD = [\n     EXECUTABLE = \"one_tm\",\n-    ARGUMENTS = \"-t 15 -d dummy,lvm,shared,fs_lvm,qcow2,ssh,ceph,dev,vcenter,iscsi_libvirt\"\n+    ARGUMENTS = \"-t 15 -d dummy,lvm,shared,fs_lvm,qcow2,ssh,ceph,dev,vcenter,iscsi_libvirt,linstor_un\"\n ]\n```\n\nModify **DATASTORE_MAD** section for the **one_datastore** driver:\n- add `linstor_un` to datastore mads and system datastore tm drivers list.\n\n```diff\n DATASTORE_MAD = [\n     EXECUTABLE = \"one_datastore\",\n-    ARGUMENTS  = \"-t 15 -d dummy,fs,lvm,ceph,dev,iscsi_libvirt,vcenter -s shared,ssh,ceph,fs_lvm,qcow2,vcenter\"\n+    ARGUMENTS  = \"-t 15 -d dummy,fs,lvm,ceph,dev,iscsi_libvirt,vcenter,linstor_un -s shared,ssh,ceph,fs_lvm,qcow2,vcenter,linstor_un\"\n ]\n```\n\nAdd new **TM_MAD_CONF** section:\n\n```\nTM_MAD_CONF = [\n    NAME = \"linstor_un\", LN_TARGET = \"NONE\", CLONE_TARGET = \"SYSTEM\", SHARED = \"yes\",\n    DS_MIGRATE = \"YES\", ALLOW_ORPHANS=\"yes\"\n]\n```\n\nAdd new **DS_MAD_CONF** section:\n```\nDS_MAD_CONF = [\n    NAME = \"linstor_un\", PERSISTENT_ONLY = \"NO\",\n    MARKETPLACE_ACTIONS = \"export\"\n]\n```\n\n#### Update **vmm_execrc**:\n\n- add `kvm-linstor_un` to the LIVE_DISK_SNAPSHOTS list\n\n```diff\n-LIVE_DISK_SNAPSHOTS=\"kvm-qcow2 kvm-ceph\"\n+LIVE_DISK_SNAPSHOTS=\"kvm-qcow2 kvm-ceph kvm-linstor_un\"\n```\n\n## LINSTOR Configuration\n\n* Install Linstor-satellite and DRBD9 kernel module on all your compute nodes.\n* Nodes in linstor must have same name like for OpenNebula hosts.\n* Linstor-client should be installed and working on control-plane nodes.\n* Create Resource group:\n  ```\n  linstor resource-group create opennebula --place-count 2 --storage-pool thinlvm\n  linstor volume-group create opennebula\n  ```\n  Resource group must have storage-pool assigned and single volume-group created.\n\n## OpenNebula Configuration\n\nTo use your Linstor cluster with the OpenNebula, you need to define a System and Image datastores. Each Image/System Datastore pair will share same following Linstor configuration attributes:\n\n| Attribute                  | Description                                                                                                      | Mandatory            |\n|----------------------------|------------------------------------------------------------------------------------------------------------------|----------------------|\n| `NAME`                     | The name of the datastore                                                                                        | **YES**              |\n| `CLONE_MODE`               | `snapshot` - will create snapshot for instantiate VMs. `copy` - create full copy of image, this is default mode. | NO                   |\n| `BRIDGE_LIST`              | Space separated hosts list used for transfer operations. Copy data between images and etc. Default: all hosts.   | NO                   |\n| `LS_CONTROLLERS`           | Comma separated linstor controllers list for establish connection.                                               | NO                   |\n| `LS_CERTFILE`              | SSL certificate file.                                                                                            | NO                   |\n| `LS_KEYFILE`               | SSL key file.                                                                                                    | NO                   |\n| `LS_CAFILE`                | SSL CA certificate file.                                                                                         | NO                   |\n| `RESOURCE_GROUP`           | Resource group to spawn the resources.                                                                           | **YES** \u003csup\u003e1\u003c/sup\u003e |\n| `NODE_LIST`                | Space separated hosts list to place replicas. Replicas will always be created on all these hosts.                | **YES** \u003csup\u003e1\u003c/sup\u003e |\n| `LAYER_LIST`               | Comma separated layer list to place replicas.                                                                    | NO                   |\n| `PROVIDERS`                | Comma separated providers list to place replicas.                                                                | NO                   |\n| `REPLICAS_ON_SAME`         | Space separated aux-properties list to always place replicas on hosts with same aux-property.                    | NO                   |\n| `REPLICAS_ON_DIFFERENT`    | Space separated aux-properties list to always place replicas on hosts with different aux-property.               | NO                   |\n| `REPLICA_COUNT`            | Number of replicas for creating new volumes.                                                                     | **YES** \u003csup\u003e1\u003c/sup\u003e |\n| `CHECKPOINT_REPLICA_COUNT` | Number of replicas for save checkpoint file for suspend and offline migration process.                           | NO                   |\n| `DO_NOT_PLACE_WITH`        | Space separated resources list to avid placing replicas on same place with them.                                 | NO                   |\n| `DO_NOT_PLACE_WITH_REGEX`  | Regular expression to avoid placing replicas on same place with targeted resources.                              | NO                   |\n| `STORAGE_POOL`             | Space separated storage pool names to place replicas.                                                            | **YES** \u003csup\u003e2\u003c/sup\u003e |\n| `DISKLESS_POOL`            | Diskless pool to place diskless replicas. Default: `DfltDisklessStorPool`.                                       | NO                   |\n| `PREFER_NODE`              | `yes` - try to place and copy the data on the node that will afterwards be used by the VM                        | NO                   |\n| `ENCRYPTION`               | `yes` - will enable encryption during volume creation.                                                           | NO                   |\n\n*\u003csup\u003e1\u003c/sup\u003e - only one attribute required*  \n*\u003csup\u003e2\u003c/sup\u003e - required if no RESOURCE_GROUP specified*\n\n\u003e **Note**: You may add another Image and System Datastores pointing to other pools with different allocation/replication policies in Linstor.\n\n### Create an Image Datastore\n\nApart from the previous attributes, that need to be the same as the associated System Datastore, the following can be set for an Image Datastore:\n\n\n| Attribute     | Description                                           | Mandatory |\n|---------------|-------------------------------------------------------|-----------|\n| `NAME`        | The name of the datastore                             | **YES**   |\n| `DS_MAD`      | `linstor_un`                                          | **YES**   |\n| `TM_MAD`      | `linstor_un`                                          | **YES**   |\n| `DISK_TYPE`   | `BLOCK`                                               | **YES**   |\n| `STAGING_DIR` | Default path for image operations in the bridges      | NO        |\n\nAn example of datastore:\n\n```bash\ncat \u003e images-ds.conf \u003c\u003cEOT\nNAME=\"linstor-images\"\nTYPE=\"IMAGE_DS\"\nRESOURCE_GROUP=\"opennebula\"\nDISK_TYPE=\"BLOCK\"\nDS_MAD=\"linstor_un\"\nTM_MAD=\"linstor_un\"\nRESTRICTED_DIRS=/\nSAFE_DIRS=/var/tmp\nEOT\n\nonedatastore create images-ds.conf\n```\n\n### Create a System Datastore\n\nSystem Datastore also requires these attributes:\n\n| Attribute | Description  | Mandatory |\n|-----------|--------------|-----------|\n| `TYPE`    | `SYSTEM_DS`  | **YES**   |\n| `TM_MAD`  | `linstor_un` | **YES**   |\n\nCreate a System Datastore in Sunstone or through the CLI, for example:\n\n```bash\ncat \u003e system-ds.conf \u003c\u003cEOT\nNAME=\"linstor-system\"\nTYPE=\"SYSTEM_DS\"\nSTORAGE_POOL=\"data\"\nRESOURCE_GROUP=\"opennebula\"\nPREFER_NODE=\"yes\"\nCHECKPOINT_REPLICA_COUNT=\"1\"\nTM_MAD=\"linstor_un\"\nEOT\n\nonedatastore create system-ds.conf\n```\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-linstor_un/issues)\n\n## Author\n\n* Andrei Kvapil \u003c[kvapss@gmail.com](mailto:kvapss@gmail.com)\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkvaps%2Fopennebula-addon-linstor_un","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkvaps%2Fopennebula-addon-linstor_un","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkvaps%2Fopennebula-addon-linstor_un/lists"}