{"action":"created","issue":{"url":"https://api.github.com/repos/mesosphere/marathon/issues/3765","repository_url":"https://api.github.com/repos/mesosphere/marathon","labels_url":"https://api.github.com/repos/mesosphere/marathon/issues/3765/labels{/name}","comments_url":"https://api.github.com/repos/mesosphere/marathon/issues/3765/comments","events_url":"https://api.github.com/repos/mesosphere/marathon/issues/3765/events","html_url":"https://github.com/mesosphere/marathon/issues/3765","id":148172915,"number":3765,"title":"Allow allocation of persistent volumes on non-root mesos disk resources","user":{"login":"timcharper","id":183,"avatar_url":"https://avatars.githubusercontent.com/u/183?v=3","gravatar_id":"","url":"https://api.github.com/users/timcharper","html_url":"https://github.com/timcharper","followers_url":"https://api.github.com/users/timcharper/followers","following_url":"https://api.github.com/users/timcharper/following{/other_user}","gists_url":"https://api.github.com/users/timcharper/gists{/gist_id}","starred_url":"https://api.github.com/users/timcharper/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/timcharper/subscriptions","organizations_url":"https://api.github.com/users/timcharper/orgs","repos_url":"https://api.github.com/users/timcharper/repos","events_url":"https://api.github.com/users/timcharper/events{/privacy}","received_events_url":"https://api.github.com/users/timcharper/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/mesosphere/marathon/labels/Epic-217","name":"Epic-217","color":"9351E5"},{"url":"https://api.github.com/repos/mesosphere/marathon/labels/ready","name":"ready","color":"ededed"},{"url":"https://api.github.com/repos/mesosphere/marathon/labels/service","name":"service","color":"eb6420"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2016-04-13T20:21:28Z","updated_at":"2016-07-11T08:10:46Z","closed_at":null,"body":"Mesos supports multiple-disk resources of the following kinds of disk resources: \"Root\", \"Path\", and \"Mount\". In the present release candidate, it is impossible to allocate a persistent volume on a disk resource other than root. Marathon will see non-root disk resources offered, and completely ignore them.\r\n\r\nI believe this could be resolved somewhat easily by:\r\n\r\n- Adding an optional string parameter, `kind`, to [PersistentVolumeInfo](https://github.com/mesosphere/marathon/blob/master/src/main/scala/mesosphere/marathon/state/Volume.scala#L114) (and updating serializers / json-schema)\r\n- Updating [ResourceMatcher](https://github.com/mesosphere/marathon/blob/master/src/main/scala/mesosphere/mesos/ResourceMatcher.scala#L101) to consider non-Root Resource offers (currently, my experience indicates these are ignored, but I can't exactly tell where, in the code, they are being filtered out). I would be inclined to make it such that if `kind` were unspecified, then a root volume is used, although there is no reason to not consider path disk resources as well. (the biggest concern would be allocating an entire disk to a process that doesn't need / want an entire disk).\r\n- Updating OfferOperationFactory [createVolumes](https://github.com/mesosphere/marathon/blob/master/src/main/scala/mesosphere/marathon/core/matcher/base/util/OfferOperationFactory.scala#L57) and [reserve](https://github.com/mesosphere/marathon/blob/master/src/main/scala/mesosphere/marathon/core/matcher/base/util/OfferOperationFactory.scala#L33) to specify the appropriate disk source for the selected disk resource(s).\r\n\r\nAm I totally off in thinking this should be somewhat easy to do? I'm an experienced Scala programmer and am willing to take a stab at it, but want to discuss / solicit any guidance before starting. This feature would drastically simplify my mesos cluster deployment."},"comment":{"url":"https://api.github.com/repos/mesosphere/marathon/issues/comments/231668387","html_url":"https://github.com/mesosphere/marathon/issues/3765#issuecomment-231668387","issue_url":"https://api.github.com/repos/mesosphere/marathon/issues/3765","id":231668387,"user":{"login":"timcharper","id":183,"avatar_url":"https://avatars.githubusercontent.com/u/183?v=3","gravatar_id":"","url":"https://api.github.com/users/timcharper","html_url":"https://github.com/timcharper","followers_url":"https://api.github.com/users/timcharper/followers","following_url":"https://api.github.com/users/timcharper/following{/other_user}","gists_url":"https://api.github.com/users/timcharper/gists{/gist_id}","starred_url":"https://api.github.com/users/timcharper/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/timcharper/subscriptions","organizations_url":"https://api.github.com/users/timcharper/orgs","repos_url":"https://api.github.com/users/timcharper/repos","events_url":"https://api.github.com/users/timcharper/events{/privacy}","received_events_url":"https://api.github.com/users/timcharper/received_events","type":"User","site_admin":false},"created_at":"2016-07-11T08:10:46Z","updated_at":"2016-07-11T08:10:46Z","body":"I've got a work-in-progress commit for this:\r\n\r\nhttps://github.com/timcharper/marathon/tree/multi-disk\r\n\r\nIt compiles (except for the tests). It's not really pretty, just shoveling code around to get a sense for general direction at this point. I had to change the disk resource allocation strategy to pair each allocation with a persistent volume (so that the persistent volume could be created on the corresponding disk). Allocation strategy is myopic in that it won't try different combinations of allocations to try and make it succeed, but that can be improved once this is ironed out.\r\n\r\nAs for resource tagging, I'm thinking of the following:\r\n\r\n- add a \"whole disk\" flag to persistent volume. If checked, use mount disk. If not, use root or PATH volume.\r\n- add constraints to persistent volumes in order to compensate for the lack of resources tags in marathon. ` \"constraints\": [[\"path\", \"LIKE\", \"^.+/ssd.*]]`. This would allow the user to put disk property information in the path in which the disk is mounted, which probably isn't a bad idea anyways, and then select the disk accordingly."}}
{"actor":{"display_login":"timcharper"}}