]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
python-common: add data_allocate_fraction to DriveGroupSpec
authorJonas Pfefferle <pepperjo@japf.ch>
Wed, 7 Apr 2021 11:11:39 +0000 (13:11 +0200)
committerJonas Pfefferle <pepperjo@japf.ch>
Thu, 3 Jun 2021 07:28:35 +0000 (09:28 +0200)
data_allocate_fraction is used to partially allocate a drive.

Signed-off-by: Jonas Pfefferle <pepperjo@japf.ch>
src/python-common/ceph/deployment/drive_group.py

index 93d7aaef1779fab982622eacb3a7b18a03d1f0eb..e063e0d5d82de85c9fa2c918232e57613a5d475f 100644 (file)
@@ -143,7 +143,8 @@ class DriveGroupSpec(ServiceSpec):
         "db_slots", "wal_slots", "block_db_size", "placement", "service_id", "service_type",
         "data_devices", "db_devices", "wal_devices", "journal_devices",
         "data_directories", "osds_per_device", "objectstore", "osd_id_claims",
-        "journal_size", "unmanaged", "filter_logic", "preview_only"
+        "journal_size", "unmanaged", "filter_logic", "preview_only",
+        "data_allocate_fraction"
     ]
 
     def __init__(self,
@@ -167,6 +168,7 @@ class DriveGroupSpec(ServiceSpec):
                  unmanaged=False,  # type: bool
                  filter_logic='AND',  # type: str
                  preview_only=False,  # type: bool
+                 data_allocate_fraction=None,  # type: Optional[float]
                  ):
         assert service_type is None or service_type == 'osd'
         super(DriveGroupSpec, self).__init__('osd', service_id=service_id,
@@ -225,6 +227,9 @@ class DriveGroupSpec(ServiceSpec):
         #: If this should be treated as a 'preview' spec
         self.preview_only = preview_only
 
+        #: Allocate a fraction of the data device (0,1.0]
+        self.data_allocate_fraction = data_allocate_fraction
+
     @classmethod
     def _from_json_impl(cls, json_drive_group):
         # type: (dict) -> DriveGroupSpec