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

Create persistent volume directories based on DiskInfo.Source.

    XMLWordPrintableJSON

Details

    • Task
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 0.27.0
    • None

    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

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

            Dates

              Created:
              Updated:
              Resolved: