{"action":"closed","issue":{"url":"https://api.github.com/repos/gluster/glusterd2/issues/1190","repository_url":"https://api.github.com/repos/gluster/glusterd2","labels_url":"https://api.github.com/repos/gluster/glusterd2/issues/1190/labels{/name}","comments_url":"https://api.github.com/repos/gluster/glusterd2/issues/1190/comments","events_url":"https://api.github.com/repos/gluster/glusterd2/issues/1190/events","html_url":"https://github.com/gluster/glusterd2/issues/1190","id":352420856,"node_id":"MDU6SXNzdWUzNTI0MjA4NTY=","number":1190,"title":"[RFE] Template support for Volfiles","user":{"login":"aravindavk","id":338230,"node_id":"MDQ6VXNlcjMzODIzMA==","avatar_url":"https://avatars3.githubusercontent.com/u/338230?v=4","gravatar_id":"","url":"https://api.github.com/users/aravindavk","html_url":"https://github.com/aravindavk","followers_url":"https://api.github.com/users/aravindavk/followers","following_url":"https://api.github.com/users/aravindavk/following{/other_user}","gists_url":"https://api.github.com/users/aravindavk/gists{/gist_id}","starred_url":"https://api.github.com/users/aravindavk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aravindavk/subscriptions","organizations_url":"https://api.github.com/users/aravindavk/orgs","repos_url":"https://api.github.com/users/aravindavk/repos","events_url":"https://api.github.com/users/aravindavk/events{/privacy}","received_events_url":"https://api.github.com/users/aravindavk/received_events","type":"User","site_admin":false},"labels":[{"id":507042655,"node_id":"MDU6TGFiZWw1MDcwNDI2NTU=","url":"https://api.github.com/repos/gluster/glusterd2/labels/FW:%20Volgen","name":"FW: Volgen","color":"fbca04","default":false},{"id":1104068624,"node_id":"MDU6TGFiZWwxMTA0MDY4NjI0","url":"https://api.github.com/repos/gluster/glusterd2/labels/GCS/0.3","name":"GCS/0.3","color":"d93f0b","default":false},{"id":971990657,"node_id":"MDU6TGFiZWw5NzE5OTA2NTc=","url":"https://api.github.com/repos/gluster/glusterd2/labels/GCS/1.0-Blocker","name":"GCS/1.0-Blocker","color":"c96a0c","default":false},{"id":1078412623,"node_id":"MDU6TGFiZWwxMDc4NDEyNjIz","url":"https://api.github.com/repos/gluster/glusterd2/labels/GCS/beta0","name":"GCS/beta0","color":"bfd4f2","default":false},{"id":254949910,"node_id":"MDU6TGFiZWwyNTQ5NDk5MTA=","url":"https://api.github.com/repos/gluster/glusterd2/labels/in%20progress","name":"in progress","color":"ededed","default":false}],"state":"closed","locked":false,"assignee":{"login":"aravindavk","id":338230,"node_id":"MDQ6VXNlcjMzODIzMA==","avatar_url":"https://avatars3.githubusercontent.com/u/338230?v=4","gravatar_id":"","url":"https://api.github.com/users/aravindavk","html_url":"https://github.com/aravindavk","followers_url":"https://api.github.com/users/aravindavk/followers","following_url":"https://api.github.com/users/aravindavk/following{/other_user}","gists_url":"https://api.github.com/users/aravindavk/gists{/gist_id}","starred_url":"https://api.github.com/users/aravindavk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aravindavk/subscriptions","organizations_url":"https://api.github.com/users/aravindavk/orgs","repos_url":"https://api.github.com/users/aravindavk/repos","events_url":"https://api.github.com/users/aravindavk/events{/privacy}","received_events_url":"https://api.github.com/users/aravindavk/received_events","type":"User","site_admin":false},"assignees":[{"login":"aravindavk","id":338230,"node_id":"MDQ6VXNlcjMzODIzMA==","avatar_url":"https://avatars3.githubusercontent.com/u/338230?v=4","gravatar_id":"","url":"https://api.github.com/users/aravindavk","html_url":"https://github.com/aravindavk","followers_url":"https://api.github.com/users/aravindavk/followers","following_url":"https://api.github.com/users/aravindavk/following{/other_user}","gists_url":"https://api.github.com/users/aravindavk/gists{/gist_id}","starred_url":"https://api.github.com/users/aravindavk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aravindavk/subscriptions","organizations_url":"https://api.github.com/users/aravindavk/orgs","repos_url":"https://api.github.com/users/aravindavk/repos","events_url":"https://api.github.com/users/aravindavk/events{/privacy}","received_events_url":"https://api.github.com/users/aravindavk/received_events","type":"User","site_admin":false}],"milestone":null,"comments":5,"created_at":"2018-08-21T07:41:19Z","updated_at":"2018-11-09T03:42:53Z","closed_at":"2018-11-09T03:42:53Z","author_association":"CONTRIBUTOR","body":"Default Graphs via template file, This will be applied build\r\ntime. Alternatively we can load this when glusterd2 starts, but may\r\nface issues if each node contains different versions of template.\r\n\r\nAlong with the list of xlators and order of xlators to load, templates\r\ncan mention default options and default state of xlator.\r\n\r\nExample brick template(`toml` format):\r\n\r\n```\r\n[[xlator]]\r\nname = \"protocol/server\"\r\n\r\n[[xlator]]\r\nname = \"debug/io-stats\"\r\n\r\n[[xlator]]\r\nname = \"features/index\"\r\n\r\n[[xlator]]\r\nname = \"features/selinux\"\r\n\r\n[[xlator]]\r\nname = \"performance/io-threads\"\r\n\r\n[[xlator]]\r\nname = \"features/upcall\"\r\n\r\n[[xlator]]\r\nname = \"features/locks\"\r\n\r\n[[xlator]]\r\nname = \"features/access-control\"\r\n\r\n[[xlator]]\r\nname = \"features/changelog\"\r\nenabled = false\r\nenable_by_option = true\r\n\r\n[xlator.options]\r\ncapture-del-path = \"on\"\r\n\r\n[[xlator]]\r\nname = \"storage/posix\"\r\n```\r\n\r\nExample client template(`toml` format):\r\n\r\n```\r\n[[clustergraph.xlator]]\r\nname = \"protocol/client\"\r\n\r\n[clustergraph.xlator.options]\r\nping-timeout = 42\r\n\r\n[[xlator]]\r\nname = \"debug/io-stats\"\r\n\r\n[xlator.options]\r\nclient-log-level = \"INFO\"\r\n\r\n[[xlator]]\r\nname = \"distribute\"\r\n```\r\n\r\nBy default xlators included in template are enabled. Add `enabled =\r\nfalse` if a xlator needs to be disabled by default. If a xlator\r\nenabled/disabled is dicided based on option inside that xlator then\r\nadd `enabled_by_option=true` (Example above is `changelog` xlator,\r\ndisabled by default)\r\n\r\n\r\n### New APIs\r\n\r\nNew templates can be registerd using the following APIs\r\n\r\n```\r\nAdd new Template:    POST /volfiles-template/:template-name\r\nDelete new Template: DEL /volfiles-template/:template-name\r\n```\r\n\r\nOnce the templates are registerd, default template for new volumes can\r\nbe customized using,\r\n\r\n```\r\nPOST /cluster/config -d '{\"volfiles-template\": \"my-new-tmpl\"}'\r\n```\r\n\r\nNote: Already created volumes will continue to use the previously\r\nregisterd template or default template.\r\n\r\nTemplate of an existing volume can be changed using, (Note: This may\r\nrequire Volume restart)\r\n\r\n```\r\nPOST /volumes/:name/edit -d '{\"volfiles-template\": \"my-new-tmpl\"}'\r\n```\r\n\r\n### Enabled state and Options\r\nEnabled state and options will be applied in the following order.\r\n\r\n- Options and Enabled state from options table of xlators(default\r\n  value)\r\n- Options and Enabled state from volfile template\r\n- Options and Enabled state from Volinfo(Set using Volume set)\r\n\r\n### Effect on Volume Options Set/Get\r\n\r\n- xlators can only be enabled/disabled only if it is listed in its\r\n  template.Volume set will fail if that option does not belong to the\r\n  xlators list.\r\n- Volume options get/help will only show the options which are related\r\n  to listed xlators.\r\n- Xlator can be enabled or disabled using key as `xlator-name` and\r\n  value as `on|off`.\r\n- Xlator enable/disable volume set should not fail if xlator's option\r\n  table does not define option with xlator name itself.\r\n\r\n### Effect on generated Volfiles\r\n\r\n- Volfiles will only contains the xlators which are Enabled.\r\n- If `enable_by_option` is set then generated volfile will contain the\r\n  xlator graph even though it is disabled. Disabled state will be\r\n  mentioned as one of the option in xlator graph as `option\r\n  <xlator-name> on/off`\r\n- If `enabled_by_option` is not set then generated volfile will not\r\n  contain xlator graph if it is disabled.\r\n\r\n### Effect on the running Volumes\r\n\r\n- If a xlator is enabled without setting `enabled_by_option`, then\r\n  brick/daemon restart is required if graph changes.(Clients can\r\n  reconfigure on new graph, but brick processes and other daemons\r\n  can't re-configure on graph change.)\r\n  \r\n## Changes to option table and xlators\r\n\r\n- If a xlator requires support for `enable_by_option`, then option\r\n  table should contain a key with name same as xlator name and default\r\n  value `on` or `off`. Respective code should understand this key when\r\n  xlator is disabled/enabled.\r\n\r\n\r\n## MVP 0\r\n\r\n- Default template support\r\n- Consider Enabled state and Options from template and apply during\r\n  Volfile generation\r\n- Consider `enabled_by_option` to include xlator in volfile\r\n\r\n## MVP.Next\r\n\r\n- New APIs for customizing the templates and assign template to Volume\r\n- Volume set support to enable/disable xlators and Validation if a\r\n  xlator does not exists in the template.\r\n- Changes to xlators option table to accomodate enable option(If\r\n  `enable_by_option` is required)\r\n- Volume options GET filter - include in response only in template\r\n"}}
{"actor":{"display_login":"atinmu"}}