"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"
+ "journal_size", "unmanaged"
]
def __init__(self,
encrypted=False, # type: bool
db_slots=None, # type: Optional[int]
wal_slots=None, # type: Optional[int]
- osd_id_claims=None, # type: Optional[Dict[str, DeviceSelection]]
+ osd_id_claims=None, # type: Optional[Dict[str, List[str]]]
block_db_size=None, # type: Optional[int]
block_wal_size=None, # type: Optional[int]
journal_size=None, # type: Optional[int]
service_type=None, # type: Optional[str]
+ unmanaged=False, # type: bool
):
assert service_type is None or service_type == 'osd'
- super(DriveGroupSpec, self).__init__('osd', service_id=service_id, placement=placement)
+ super(DriveGroupSpec, self).__init__('osd', service_id=service_id,
+ placement=placement,
+ unmanaged=unmanaged)
#: A :class:`ceph.deployment.drive_group.DeviceSelection`
self.data_devices = data_devices
#: How many OSDs per WAL device
self.wal_slots = wal_slots
- #: Optional: mapping of OSD id to DeviceSelection, used when the
- #: created OSDs are meant to replace previous OSDs on
- #: the same node. See :ref:`orchestrator-osd-replace`
- self.osd_id_claims = osd_id_claims
+ #: Optional: mapping of host -> List of osd_ids that should be replaced
+ #: See :ref:`orchestrator-osd-replace`
+ self.osd_id_claims = osd_id_claims or dict()
@classmethod
def _from_json_impl(cls, json_drive_group):
# type: () -> None
super(DriveGroupSpec, self).validate()
- if not isinstance(self.placement.host_pattern, six.string_types):
+ if not isinstance(self.placement.host_pattern, six.string_types) and \
+ self.placement.host_pattern is not None:
raise DriveGroupValidationError('host_pattern must be of type string')
specs = [self.data_devices, self.db_devices, self.wal_devices, self.journal_devices]
c['db_devices'] = self.db_devices.to_json()
if self.wal_devices:
c['wal_devices'] = self.wal_devices.to_json()
+ c['service_name'] = self.service_name()
return c
def __eq__(self, other):