You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by ch...@apache.org on 2018/05/04 01:18:33 UTC

[10/13] mesos git commit: Added new operator API to grow and shrink persistent volume.

Added new operator API to grow and shrink persistent volume.

The same API could be used in the future to grow or shrink CSI volumes,
but currently only persistent volumes are supported.

Review: https://reviews.apache.org/r/66052/


Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/d418f155
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/d418f155
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/d418f155

Branch: refs/heads/master
Commit: d418f155271723903c70371c6be41de86d639ff5
Parents: 360ae2f
Author: Zhitao Li <zh...@gmail.com>
Authored: Thu May 3 17:05:01 2018 -0700
Committer: Chun-Hung Hsiao <ch...@mesosphere.io>
Committed: Thu May 3 17:05:01 2018 -0700

----------------------------------------------------------------------
 include/mesos/master/master.proto    | 31 +++++++++++++++++++++++++++++++
 include/mesos/v1/master/master.proto | 31 +++++++++++++++++++++++++++++++
 2 files changed, 62 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/d418f155/include/mesos/master/master.proto
----------------------------------------------------------------------
diff --git a/include/mesos/master/master.proto b/include/mesos/master/master.proto
index aa63904..54f8412 100644
--- a/include/mesos/master/master.proto
+++ b/include/mesos/master/master.proto
@@ -79,6 +79,9 @@ message Call {
     CREATE_VOLUMES = 21;     // See 'CreateVolumes' below.
     DESTROY_VOLUMES = 22;    // See 'DestroyVolumes' below.
 
+    GROW_VOLUME = 34;        // See 'GrowVolume' below.
+    SHRINK_VOLUME = 35;      // See 'ShrinkVolume' below.
+
     // Retrieves the cluster's maintenance status.
     GET_MAINTENANCE_STATUS = 23;
     // Retrieves the cluster's maintenance schedule.
@@ -169,6 +172,32 @@ message Call {
     repeated Resource volumes = 2;
   }
 
+  // Grow a volume by an additional disk resource.
+  // NOTE: This is currently experimental and only for persistent volumes
+  // created on ROOT/PATH disks.
+  message GrowVolume {
+    // `slave_id` must be set if `volume` is an agent-local resource, and must
+    // be unset if `volume` is an external resource.
+    optional SlaveID slave_id = 1;
+
+    required Resource volume = 2;
+    required Resource addition = 3;
+  }
+
+  // Shrink a volume by the size specified in the `subtract` field.
+  // NOTE: This is currently experimental and only for persistent volumes
+  // created on ROOT/PATH disks.
+  message ShrinkVolume {
+    // `slave_id` must be set if `volume` is an agent-local resource, and must
+    // be unset if `volume` is an external resource.
+    optional SlaveID slave_id = 1;
+
+    required Resource volume = 2;
+
+    // See comments in `Value.Scalar` for maximum precision supported.
+    required Value.Scalar subtract = 3;
+  }
+
   // Updates the cluster's maintenance schedule.
   message UpdateMaintenanceSchedule {
     required maintenance.Schedule schedule = 1;
@@ -227,6 +256,8 @@ message Call {
   optional UnreserveResources unreserve_resources = 8;
   optional CreateVolumes create_volumes = 9;
   optional DestroyVolumes destroy_volumes = 10;
+  optional GrowVolume grow_volume = 18;
+  optional ShrinkVolume shrink_volume = 19;
   optional UpdateMaintenanceSchedule update_maintenance_schedule = 11;
   optional StartMaintenance start_maintenance = 12;
   optional StopMaintenance stop_maintenance = 13;

http://git-wip-us.apache.org/repos/asf/mesos/blob/d418f155/include/mesos/v1/master/master.proto
----------------------------------------------------------------------
diff --git a/include/mesos/v1/master/master.proto b/include/mesos/v1/master/master.proto
index ddb28f9..12f019d 100644
--- a/include/mesos/v1/master/master.proto
+++ b/include/mesos/v1/master/master.proto
@@ -77,6 +77,9 @@ message Call {
     CREATE_VOLUMES = 21;     // See 'CreateVolumes' below.
     DESTROY_VOLUMES = 22;    // See 'DestroyVolumes' below.
 
+    GROW_VOLUME = 34;        // See 'GrowVolume' below.
+    SHRINK_VOLUME = 35;      // See 'ShrinkVolume' below.
+
     // Retrieves the cluster's maintenance status.
     GET_MAINTENANCE_STATUS = 23;
     // Retrieves the cluster's maintenance schedule.
@@ -167,6 +170,32 @@ message Call {
     repeated Resource volumes = 2;
   }
 
+  // Grow a volume by an additional disk resource.
+  // NOTE: This is currently experimental and only for persistent volumes
+  // created on ROOT/PATH disks.
+  message GrowVolume {
+    // `agent_id` must be set if `volume` is an agent-local resource, and must
+    // be unset if `volume` is an external resource.
+    optional AgentID agent_id = 1;
+
+    required Resource volume = 2;
+    required Resource addition = 3;
+  }
+
+  // Shrink a volume by the size specified in the `subtract` field.
+  // NOTE: This is currently experimental and only for persistent volumes
+  // created on ROOT/PATH disks.
+  message ShrinkVolume {
+    // `agent_id` must be set if `volume` is an agent-local resource, and must
+    // be unset if `volume` is an external resource.
+    optional AgentID agent_id = 1;
+
+    required Resource volume = 2;
+
+    // See comments in `Value.Scalar` for maximum precision supported.
+    required Value.Scalar subtract = 3;
+  }
+
   // Updates the cluster's maintenance schedule.
   message UpdateMaintenanceSchedule {
     required maintenance.Schedule schedule = 1;
@@ -225,6 +254,8 @@ message Call {
   optional UnreserveResources unreserve_resources = 8;
   optional CreateVolumes create_volumes = 9;
   optional DestroyVolumes destroy_volumes = 10;
+  optional GrowVolume grow_volume = 18;
+  optional ShrinkVolume shrink_volume = 19;
   optional UpdateMaintenanceSchedule update_maintenance_schedule = 11;
   optional StartMaintenance start_maintenance = 12;
   optional StopMaintenance stop_maintenance = 13;