Uploaded image for project: 'Mesos'
  1. Mesos
  2. MESOS-4400

Create persistent volume directories based on DiskInfo.Source.

    XMLWordPrintableJSON

    Details

    • Type: Task
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 0.27.0
    • Component/s: None
    • Labels:

      Description

      Currently, we always create persistent volumes from root disk, and the persistent volumes are directories. With DiskInfo.Source being added, we should create the persistent volume accordingly based on the information in DiskInfo.Source.

      This ticket handles the case where DiskInfo.Source.type is PATH. In that case, we should create sub-directories and use the same layout as slave.work_dir.

      See the relevant code here:

      void Slave::checkpointResources(...)
      {
        // Creates persistent volumes that do not exist and schedules
        // releasing those persistent volumes that are no longer needed.
        //
        // TODO(jieyu): Consider introducing a volume manager once we start
        // to support multiple disks, or raw disks. Depending on the
        // DiskInfo, we may want to create either directories under a root
        // directory, or LVM volumes from a given device.
        Resources volumes = newCheckpointedResources.persistentVolumes();
      
        foreach (const Resource& volume, volumes) {
          // This is validated in master.
          CHECK_NE(volume.role(), "*");
      
          string path = paths::getPersistentVolumePath(
              flags.work_dir,
              volume.role(),
              volume.disk().persistence().id());
      
          if (!os::exists(path)) {
            CHECK_SOME(os::mkdir(path, true))
              << "Failed to create persistent volume at '" << path << "'";
          }
        }
      }
      

        Attachments

          Activity

            People

            • Assignee:
              jvanremoortere Joris Van Remoortere
              Reporter:
              jieyu Jie Yu
              Shepherd:
              Jie Yu
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: