Details

      Description

      The pod definition:

      {
        "id": "/with-ephemeral-volume",
        "version": "2018-01-05T15:03:02.547Z",
        "containers": [
          {
            "name": "ct1",
            "resources": {
              "cpus": 0.1,
              "mem": 32,
              "disk": 0
            },
            "exec": {
              "command": {
                "shell": "while true; do echo the current time is $(date) > ./jdef-v1/clock; sleep 1; done"
              }
            },
            "volumeMounts": [
              {
                "name": "v1",
                "mountPath": "jdef-v1"
              }
            ]
          },
          {
            "name": "ct2",
            "resources": {
              "cpus": 0.1,
              "mem": 32,
              "disk": 0
            },
            "exec": {
              "command": {
                "shell": "while true; do cat ./etc/clock; sleep 1; done"
              }
            },
            "volumeMounts": [
              {
                "name": "v1",
                "mountPath": "etc"
              }
            ]
          }
        ],
        "volumes": [
          {
            "name": "v1"
          }
        ],
        "networks": [
          {
            "mode": "host"
          }
        ],
        "scaling": {
          "instances": 1,
          "kind": "fixed"
        },
        "scheduling": {
          "placement": {
            "constraints": []
          }
        },
        "executorResources": {
          "cpus": 0.1,
          "mem": 32,
          "disk": 10
        },
        "fetch": []
      }
      

      Mesos agent logs:

      Jan 05 15:03:02 ip-10-0-2-84.eu-central-1.compute.internal mesos-agent[17471]: I0105 15:03:02.637655 17531 container_assigner.cpp:64] Registering and retrieving endpoint for container_i
      d[value: "76469cbc-104a-47ce-833f-359f72b674b5"] executor_info[executor_id { value: "instance-with-ephemeral-volume.86b66220-f229-11e7-a557-e200ecd1fb97" } resources { name: "cpus" type
      : SCALAR scalar { value: 0.1 } allocation_info { role: "slave_public" } } resources { name: "mem" type: SCALAR scalar { value: 32 } allocation_info { role: "slave_public" } } resources 
      { name: "disk" type: SCALAR scalar { value: 10 } allocation_info { role: "slave_public" } } command { value: "/opt/mesosphere/packages/mesos--c8167bb8fd4f9840ac414b20ce44184f30acf0cd/li
      bexec/mesos/mesos-default-executor" user: "root" shell: false arguments: "mesos-default-executor" arguments: "--launcher_dir=/opt/mesosphere/active/mesos/libexec/mesos" } framework_id {
       value: "376bd079-d717-4d9c-9689-8d640538ff28-0001" } container { type: MESOS volumes { container_path: "volumes/v1" mode: RW source { type: SANDBOX_PATH sandbox_path { type: SELF path:
       "volumes/v1" } } } } labels { } type: DEFAULT].
      Jan 05 15:03:02 ip-10-0-2-84.eu-central-1.compute.internal mesos-agent[17471]: E0105 15:03:02.827041 17524 slave.cpp:5668] Container '76469cbc-104a-47ce-833f-359f72b674b5' for executor 'instance-with-ephemeral-volume.86b66220-f229-11e7-a557-e200ecd1fb97' of framework 376bd079-d717-4d9c-9689-8d640538ff28-0001 failed to start: 'container_path' is relative for SANDBOX_PATH volume SELF type
      Jan 05 15:03:02 ip-10-0-2-84.eu-central-1.compute.internal mesos-agent[17471]: I0105 15:03:02.857538 17524 slave.cpp:5790] Executor 'instance-with-ephemeral-volume.86b66220-f229-11e7-a557-e200ecd1fb97' of framework 376bd079-d717-4d9c-9689-8d640538ff28-0001 has terminated with unknown status
      

      The Mesos docs http://mesos.apache.org/documentation/latest/container-volume/#sandbox_path-volume-source say:

      Note that container_path has to be an absolute path in this case. If container_path is relative, that means it’s a volume from a subdirectory in the container sandbox to another subdirectory in the container sandbox. In that case, the user can just create a symlink, instead of using a volume.

      The code constructing SELF SANDBOX_PATH volume was dead up until recently. And Mesos agent validation was made stricter in Sep, 2017. That's why ephemeral volumes for pods do not work anymore.

        Attachments

          Activity

            People

            • Assignee:
              ivanchernetsky Ivan Chernetsky
              Reporter:
              ivanchernetsky Ivan Chernetsky
              Team:
              Orchestration Team
              Watchers:
            • Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: