def osd_fsid(self) -> Optional[str]:
return self._osd_fsid
+ def default_entrypoint(self) -> str:
+ config_json = fetch_configs(self.ctx)
+ if (
+ config_json is not None
+ and config_json.get('osd_type') == 'crimson'
+ ):
+ return '/usr/bin/ceph-osd-crimson'
+ return '/usr/bin/ceph-osd'
+
@register_daemon_form
class CephExporter(ContainerDaemonForm):
if hasattr(svc_spec, 'objectstore') and svc_spec.objectstore:
config['objectstore'] = svc_spec.objectstore
+ if hasattr(svc_spec, 'osd_type') and svc_spec.osd_type:
+ config['osd_type'] = svc_spec.osd_type
return config, parent_deps
converted = convert_to_old_style_json(spec.to_json())
if spec_json.get('service_type') == 'osd':
spec_json['termination_grace_period_seconds'] = 30
+ spec_json['osd_type'] = "classic"
assert spec_json == converted
natsorted = sorted # type: ignore
from ceph.deployment.inventory import Device # noqa: F401; pylint: disable=unused-variable
-from ceph.deployment.drive_group import DriveGroupSpec, DeviceSelection, OSDMethod
+from ceph.deployment.drive_group import DriveGroupSpec, DeviceSelection, OSDMethod, OSDType
from ceph.deployment.service_spec import PlacementSpec, ServiceSpec, service_spec_allow_invalid_from_json, TracingSpec
from ceph.deployment.hostspec import SpecValidationError
from ceph.deployment.utils import unwrap_ipv6
dry_run: bool = False,
no_overwrite: bool = False,
method: Optional[OSDMethod] = None,
- inbuf: Optional[str] = None # deprecated. Was deprecated before Quincy
+ inbuf: Optional[str] = None, # deprecated. Was deprecated before Quincy
+ osd_type: Optional[OSDType] = None
) -> HandleCommandResult:
"""
Create OSD daemon(s) on all available devices
data_devices=DeviceSelection(all=True),
unmanaged=unmanaged,
preview_only=dry_run,
- method=method
+ method=method,
+ osd_type=osd_type
)
]
return self._apply_misc(dg_specs, dry_run, format, no_overwrite)
def _daemon_add_osd(self,
svc_arg: Optional[str] = None,
method: Optional[OSDMethod] = None,
- skip_validation: bool = False) -> HandleCommandResult:
+ skip_validation: bool = False,
+ osd_type: Optional[OSDType] = None) -> HandleCommandResult:
"""Create OSD daemon(s) on specified host and device(s) (e.g., ceph orch daemon add osd myhost:/dev/sdb)"""
# Create one or more OSDs"""
drive_group = DriveGroupSpec(
placement=PlacementSpec(host_pattern=host_name),
method=method,
+ osd_type=osd_type,
**drive_group_spec,
)
except (TypeError, KeyError, ValueError) as e:
spec:
filter_logic: AND
objectstore: bluestore
+ osd_type: classic
termination_grace_period_seconds: 30
status:
running: 123
return self.value
+class OSDType(str, enum.Enum):
+ crimson = 'crimson'
+ classic = 'classic'
+
+ def to_json(self) -> str:
+ return self.value
+
+
class DeviceSelection(object):
"""
Used within :class:`ceph.deployment.drive_group.DriveGroupSpec` to specify the devices
"journal_size", "unmanaged", "filter_logic", "preview_only", "extra_container_args",
"extra_entrypoint_args", "data_allocate_fraction", "method",
"termination_grace_period_seconds", "crush_device_class", "config",
+ "osd_type",
]
def __init__(self,
config=None, # type: Optional[Dict[str, str]]
custom_configs=None, # type: Optional[List[CustomConfig]]
crush_device_class=None, # type: Optional[str]
+ osd_type=None, # type: Optional[OSDType]
termination_grace_period_seconds: Optional[int] = 30,
):
assert service_type is None or service_type == 'osd'
#: Crush device class to assign to OSDs
self.crush_device_class = crush_device_class
+ #: OSD type to install, defaults to classic OSDs if not specified
+ self.osd_type = osd_type if osd_type is not None else "classic"
+
@classmethod
def _from_json_impl(cls, json_drive_group):
# type: (dict) -> DriveGroupSpec
for device in list(self.data_devices.paths):
if not device.path:
raise DriveGroupValidationError(self.service_id, 'Device path cannot be empty') # noqa E501
+ if self.osd_type not in ['classic', 'crimson']:
+ raise DriveGroupValidationError(
+ self.service_id,
+ 'osd_type must be one of classic, crimson')
yaml.add_representer(DriveGroupSpec, DriveGroupSpec.yaml_representer)
wal_devices:
model: NVME-QQQQ-987
termination_grace_period_seconds: 30
+ osd_type: classic
---
service_type: alertmanager
service_name: alertmanager