注意
本文档适用于 Ceph 开发版本。
ceph-mgr orchestrator modules
警告
这是开发者文档,描述了只有编写 ceph-mgr orchestrator modules 的人员才相关的内容。
在此上下文中,orchestrator指的是某些外部服务,它提供发现设备和创建 Ceph 服务的能力。这包括像 Rook 这样的外部项目。
一个orchestrator module是一个 ceph-mgr 模块(参考 ceph-mgr 模块开发者指南),它使用特定的 orchestrator 实现常见的管理操作。ceph-mgr module developer’s guide) which implements common management operations using a particular orchestrator.
Orchestrator 模块继承自Orchestrator
类:这个类是一个接口,它只提供要由子类实现的方法定义。定义不同 orchestrator 的通用接口的目的是使常见的 UI 代码(例如仪表板)能够与各种不同的后端一起工作。
在所有这些抽象背后,orchestrator 模块的目的很简单:使 Ceph 能够执行诸如发现可用硬件、创建和销毁 OSD 以及运行 MDS 和 RGW 服务之类的事情。
这里不包括教程:有关完整且具体的示例,请参阅 Ceph 源树中现有的已实现的 orchestrator 模块。
术语表
- 状态服务
使用本地存储(如 OSD 或 mon)的守护进程。
- 无状态服务
不使用任何本地存储的守护进程,例如 MDS、RGW、nfs-ganesha、iSCSI 网关。
- 标签
可由管理员应用于主机的任意字符串标签。通常,管理员使用标签来指示哪些主机应该运行哪些类型的服务。标签是建议性的(来自人工输入),并不保证主机具有特定的物理功能。
- 驱动组
具有通用/共享 OSD 格式的块设备集合(通常是一个或多个 SSD 作为一组 HDD 的日志/数据库)。
- 布局
选择用于运行服务的哪个主机的选项。
关键概念
底层的 orchestrator 是有关服务是否正在运行、正在哪里运行、哪些主机可用等信息的真实来源。Orchestrator 模块应避免复制这些信息,尽可能直接从 orchestrator 后端读取。
引导主机并将其添加到底层的编排系统中不在 Ceph 的 orchestrator 接口的范围内。Ceph 只能在 orchestrator 已经知道它们的情况下才能在主机上工作。
在可能的情况下,无状态服务的布局应该留给 orchestrator 处理。
完成和批处理
所有读取或修改系统状态的方法都可能很耗时。因此,模块需要安排这些操作。
每个 orchestrator 模块都实现了自己的底层完成机制。这可能涉及在线程中运行底层操作,或者将操作批量处理,稍后在一个后台中一次性执行。如果实现这种批量模式,模块在操作出现在传入process.
错误处理
orchestrator 模块中错误处理的主要目标是为用户提供调试信息,以帮助他们在处理部署错误时进行故障排除。
- class orchestrator。OrchestratorError(msg, errno=-22, event_kind_subject=无)
通用 orchestrator 特定错误。
用于部署、配置或用户错误。
它不打算用于编程错误或 orchestrator 内部错误。
- class orchestrator。没有 orchestrator(msg='没有 orchestrator 配置 (尝试 `ceph orch 设置 后端`)')
配置中没有 orchestrator。
- class orchestrator。OrchestratorValidationError(msg, errno=-22, event_kind_subject=无)
当 orchestrator 不支持特定功能时引发。
详细来说,orchestrator 需要明确处理不同类型的错误:
没有配置 orchestrator
请参阅
NoOrchestrator
.Orchestrator 没有实现特定方法。
例如,Orchestrator 不支持
add_host
.在这种情况下,会引发
NotImplementedError
。实现的方法中缺少功能。
例如,命令的可选参数不受后端支持(例如使用 rook 后端的命令中的主机字段)。
Orchestrator.apply_mons()
command with the rook backend).输入验证错误
The
orchestrator
模块和其他调用模块应提供有意义的错误消息。实际执行命令时出现的错误
结果的 Completion 应包含一个错误字符串,以帮助理解问题。此外,
Completion.is_errored()
被设置为True
orchestrator 模块中的无效配置
这可以类似于 5 来处理。
所有其他错误都是意外的 orchestrator 问题,因此应该引发异常,然后记录到 mgr 日志文件中。如果在该点有 completion 对象,Completion.result()
可能包含错误消息。
排除的功能
Ceph 的 orchestrator 接口不是一个通用的管理 Linux 服务器的框架——它被故意限制为仅管理 Ceph 集群的服务。
多路径存储没有被处理(多路径对于 Ceph 集群是不必要的)。每个驱动器假定只在单个主机上可见。
主机管理
- Orchestrator.add_host(host_spec)
将主机添加到 orchestrator 库存。
- 参数:
主机-- hostname
- 返回类型:
OrchResult
[str
]
- Orchestrator.remove_host(主机, force, 离线, rm_crush_entry)
从 orchestrator 库存中删除主机。
- 参数:
主机 (
str
) -- 主机名- 返回类型:
OrchResult
[str
]
- Orchestrator.get_hosts()
Report the hosts in the cluster.
- 返回类型:
OrchResult
[List
[HostSpec
]]- 返回:
list of HostSpec
- Orchestrator.update_host_addr(主机, addr)
更新主机的地址
- 参数:
主机 (
str
) -- 主机名addr (
str
) -- 地址(dns 名称或 IP)
- 返回类型:
OrchResult
[str
]
- Orchestrator.add_host_label(主机, label)
Add a host label
- 返回类型:
OrchResult
[str
]
- Orchestrator.remove_host_label(主机, label, force=False)
删除主机标签
- 返回类型:
OrchResult
[str
]
- class orchestrator。HostSpec(hostname, addr=无, labels=无, status=无, location=无, oob=无)
Information about hosts. Like e.g.
kubectl get nodes
设备
- Orchestrator.get_inventory(host_filter=无, refresh=False)
Returns something that was created by ceph-volume inventory.
- 返回类型:
OrchResult
[List
[InventoryHost
]]- 返回:
list of InventoryHost
- class orchestrator。InventoryFilter(labels=无, hosts=无)
When fetching inventory, use this filter to avoid unnecessarily scanning the whole estate.
Typical use:
filter by host when presenting UI workflow for configuring a particular server. filter by label when not all of estate is Ceph servers, and we want to only learn about the Ceph servers. filter by label when we are interested particularly in e.g. OSD servers.
- class ceph.deployment.inventory.设备(devices)
A container for Device instances with reporting
- class ceph.deployment.inventory.Device(path, sys_api=无, 不可用的设备上配置OSD。=无, rejected_reasons=无, lvs=无, device_id=无, lsm_data=无, created=无, ceph_device=无, crush_device_class=无, being_replaced=无)
布局
A 守护进程放置 defines the placement of daemons of a specific service.
In general, stateless services do not require any specific placement rules as they can run anywhere that sufficient system resources are available. However, some orchestrators may not include the functionality to choose a location in this way. Optionally, you can specify a location when creating a stateless service.
- class ceph.deployment.service_spec.PlacementSpec(label=无, hosts=无, count=无, count_per_host=无, host_pattern=无)
For APIs that need to specify a host subset
- classmethod from_string(arg)
A single integer is parsed as a count:
>>> PlacementSpec.from_string('3') PlacementSpec(count=3)
A list of names is parsed as host specifications:
>>> PlacementSpec.from_string('host1 host2') PlacementSpec(hosts=[HostPlacementSpec(hostname='host1', network='', name=''), HostPlacementSpec(hostname='host2', network='', name='')])
You can also prefix the hosts with a count as follows:
>>> PlacementSpec.from_string('2 host1 host2') PlacementSpec(count=2, hosts=[HostPlacementSpec(hostname='host1', network='', name=''), HostPlacementSpec(hostname='host2', network='', name='')])
You can specify labels using label:<label>
>>> PlacementSpec.from_string('label:mon') PlacementSpec(label='mon')
Labels also support a count:
>>> PlacementSpec.from_string('3 label:mon') PlacementSpec(count=3, label='mon')
You can specify a regex to match with regex:<regex>
>>> PlacementSpec.from_string('regex:Foo[0-9]|Bar[0-9]') PlacementSpec(host_pattern=HostPattern(pattern='Foo[0-9]|Bar[0-9]', pattern_type=PatternType.regex))
fnmatch is the default for a single string if “regex:” is not provided:
>>> PlacementSpec.from_string('data[1-3]') PlacementSpec(host_pattern=HostPattern(pattern='data[1-3]', pattern_type=PatternType.fnmatch))
>>> PlacementSpec.from_string(None) PlacementSpec()
- 返回类型:
- host_pattern: HostPattern
fnmatch patterns to select hosts. Can also be a single host.
- pretty_str()
>>> ... ps = PlacementSpec(...) # For all placement specs: ... PlacementSpec.from_string(ps.pretty_str()) == ps
- 返回类型:
str
服务
- class orchestrator。ServiceDescription(spec, container_image_id=无, container_image_name=无, service_url=无, last_refresh=无, created=无, deleted=无, size定位特定驱动器容量:=0, running=0, events=无, virtual_ip=无, ports=[])
For responding to queries about the status of a particular service, stateful or stateless.
This is not about health or performance monitoring of services: it’s about letting the orchestrator tell Ceph whether and where a service is scheduled in the cluster. When an orchestrator tells Ceph “it’s running on host123”, that’s not a promise that the process is literally up this second, it’s a description of where the orchestrator has decided the service should run.
- class ceph.deployment.service_spec.ServiceSpec(service_type, service_id=无, placement=无, count=无, config=无, unmanaged=False, preview_only=False, 网络=无, targets=无, extra_container_args=无, extra_entrypoint_args=无, custom_configs=无)
服务创建的详细信息。
向 orchestrator 发出请求,以获取一组守护进程,例如 MDS、RGW、iscsi 网关、nvmeof 网关、MON、MGR、Prometheus
此结构应该包含足够的信息来启动服务。
- classmethod from_json(cls, json_spec)
Initialize ‘ServiceSpec’ object data from a json structure
There are two valid styles for service specs:
the “old” style:
service_type: nfs service_id: foo pool: mypool namespace: myns
and the “new” style:
service_type: nfs service_id: foo config: some_option: the_value networks: [10.10.0.0/16] spec: pool: mypool namespace: myns
In https://tracker.ceph.com/issues/45321 we decided that we’d like to prefer the new style as it is more readable and provides a better understanding of what fields are special for a give service type.
Note, we’ll need to stay compatible with both versions for the the next two major releases (octopus, pacific).
- 参数:
json_spec (
Dict
) -- A valid dict with ServiceSpec- 返回类型:
TypeVar
(ServiceSpecT
, bound=ServiceSpec
)
- placement: PlacementSpec
请参阅守护进程放置.
- service_id
服务的名称。对于
iscsi
,nvmeof
,mds
,nfs
,osd
,rgw
,container
,ingress
- service_type
服务类型。必须是 Ceph 服务(
mon
,crash
,mds
,mgr
,osd
或rbd-mirror
)、网关(nfs
或rgw
)、监控堆栈的一部分(alertmanager
,grafana
,node-exporter
或prometheus
)或(container
)用于自定义容器。
- unmanaged
如果设置为
true
,orchestrator 将不会部署或移除与此服务关联的任何守护进程。放置和所有其他属性都将被忽略。如果您暂时不想管理此服务,这很有用。对于 cephadm,请参阅禁用守护进程的自动部署
- Orchestrator.describe_service(service_type=无, service_name=无, refresh=False)
Describe a service (of any kind) that is already configured in the orchestrator. For example, when viewing an OSD in the dashboard we might like to also display information about the orchestrator’s view of the service (like the kubernetes pod ID).
When viewing a CephFS filesystem in the dashboard, we would use this to display the pods being currently run for MDS daemons.
- 返回类型:
OrchResult
[List
[ServiceDescription
]]- 返回:
list of ServiceDescription objects.
- Orchestrator.service_action(action, service_name)
对服务(即提供逻辑服务的所有守护进程)执行操作(启动/停止/重新加载)。
- 参数:
action (
str
) -- “start”,“stop”,“restart”,“redeploy”,“reconfig”service_name (
str
) -- service_type + ‘.’ + service_id
- 返回类型:
OrchResult
- Orchestrator.remove_service(service_name, force=False)
删除服务(一组守护进程)。
- 返回类型:
OrchResult
[str
]- 返回:
无
守护进程
- Orchestrator.list_daemons(service_name=无, daemon_type=无, daemon_id=无, 主机=无, refresh=False)
Describe a daemon (of any kind) that is already configured in the orchestrator.
- 返回类型:
OrchResult
[List
[DaemonDescription
]]- 返回:
list of DaemonDescription objects.
- Orchestrator.remove_daemons(names)
Remove specific daemon(s).
- 返回类型:
OrchResult
[List
[str
]]- 返回:
无
- Orchestrator.daemon_action(action, daemon_name, image=无, force=False)
Perform an action (start/stop/reload) on a daemon.
- 参数:
action (
str
) -- “start”,“stop”,“restart”,“redeploy”,“reconfig”daemon_name (
str
) -- name of daemonimage (
Optional
[str
]) -- Container image when redeploying that daemon
- 返回类型:
OrchResult
- class orchestrator。DaemonDescription(daemon_type=无, daemon_id=无, hostname=无, container_id=无, container_image_id=无, container_image_name=无, container_image_digests=无, version=无, status=无, status_desc=无, last_refresh=无, created=无, started=无, last_configured=无, osdspec_affinity=无, last_deployed=无, events=无, is_active=False, memory_usage=无, memory_request=无, memory_limit=无, cpu_percentage=无, service_name=无, ports=无, ip=无, deployed_by=无, systemd_unit=无, rank=无, rank_generation=无, extra_container_args=无, extra_entrypoint_args=无, pending_daemon_config=False)
For responding to queries about the status of a particular daemon, stateful or stateless.
This is not about health or performance monitoring of daemons: it’s about letting the orchestrator tell Ceph whether and where a daemon is scheduled in the cluster. When an orchestrator tells Ceph “it’s running on host123”, that’s not a promise that the process is literally up this second, it’s a description of where the orchestrator has decided the daemon should run.
- class orchestrator。DaemonDescriptionStatus(值)
是一个枚举。
OSD 管理
- Orchestrator.create_osds(drive_group, skip_validation=False)
Create one or more OSDs within a single Drive Group.
The principal argument here is the drive_group member of OsdSpec: other fields are advisory/extensible for any finer-grained OSD feature enablement (choice of backing store, compression/encryption, etc).
- 返回类型:
OrchResult
[str
]
- Orchestrator.blink_device_light(ident_fault, on, locations)
Instructs the orchestrator to enable or disable either the ident or the fault LED.
- 参数:
ident_fault (
str
) -- either"ident"
或"fault"
on (
bool
) --True
= on.locations (
List
[DeviceLightLoc
]) -- Seeorchestrator.DeviceLightLoc
- 返回类型:
OrchResult
[List
[str
]]
- class orchestrator。DeviceLightLoc(主机, dev, path)
Describes a specific device on a specific host. Used for enabling or disabling LEDs on devices.
hostname as in
orchestrator.Orchestrator.get_hosts()
- device_id: e.g.
ABC1234DEF567-1R1234_ABC8DE0Q
. 请参阅
ceph osd metadata | jq '.[].device_ids'
- device_id: e.g.
OSD替换
请参阅替换OSD for the underlying process.
Replacing OSDs is fundamentally a two-staged process, as users need to physically replace drives. The orchestrator therefore exposes this two-staged process.
Phase one is a call to Orchestrator.remove_daemons()
with destroy=True
in order to mark
the OSD as destroyed.
Phase two is a call to Orchestrator.create_osds()
with a Drive Group with
DriveGroupSpec.osd_id_claims
set to the destroyed OSD ids.
服务
- Orchestrator.add_daemon(spec)
Create daemons daemon(s) for unmanaged services
- 返回类型:
OrchResult
[List
[str
]]
- Orchestrator.apply_mon(spec)
Update mon cluster
- 返回类型:
OrchResult
[str
]
- Orchestrator.apply_mgr(spec)
Update mgr cluster
- 返回类型:
OrchResult
[str
]
- Orchestrator.apply_mds(spec)
Update MDS cluster
- 返回类型:
OrchResult
[str
]
- Orchestrator.apply_rbd_mirror(spec)
Update rbd-mirror cluster
- 返回类型:
OrchResult
[str
]
- class ceph.deployment.service_spec.RGWSpec(service_type='rgw', service_id=无, placement=无, rgw_realm=无, rgw_zonegroup=无, rgw_zone=无, rgw_frontend_port=无, rgw_frontend_ssl_certificate=无, rgw_frontend_type=无, rgw_frontend_extra_args=无, unmanaged=False, ssl=False, preview_only=False, config=无, 网络=无, subcluster=无, extra_container_args=无, extra_entrypoint_args=无, custom_configs=无, only_bind_port_on_networks=False, rgw_realm_token=无, update_endpoints=False, zone_endpoints=无, zonegroup_hostnames=无, data_pool_attributes=无, rgw_user_counters_cache=False, rgw_user_counters_cache_size=无, rgw_bucket_counters_cache=False, rgw_bucket_counters_cache_size=无, generate_cert=False, disable_multisite_sync_traffic=无, wildcard_enabled=False, rgw_exit_timeout_secs=120)
配置(多站点)Ceph RGW的设置
service_type: rgw service_id: myrealm.myzone spec: rgw_realm: myrealm rgw_zonegroup: myzonegroup rgw_zone: myzone ssl: true rgw_frontend_port: 1234 rgw_frontend_type: beast rgw_frontend_ssl_certificate: ...
See also: 服务规范
- Orchestrator.apply_rgw(spec)
Update RGW cluster
- 返回类型:
OrchResult
[str
]
- class ceph.deployment.service_spec.NFSServiceSpec(service_type='nfs', service_id=无, placement=无, unmanaged=False, preview_only=False, config=无, 网络=无, port=无, monitoring_port=无, virtual_ip=无, enable_nlm=False, enable_haproxy_protocol=False, extra_container_args=无, extra_entrypoint_args=无, idmap_conf=无, custom_configs=无)
- Orchestrator.apply_nfs(spec)
Update NFS cluster
- 返回类型:
OrchResult
[str
]
升级
- Orchestrator.upgrade_available()
报告可以升级到的版本
- 返回类型:
OrchResult
- 返回:
字符串列表
- Orchestrator.upgrade_start(image, version, daemon_types, hosts, services, limit)
- 返回类型:
OrchResult
[str
]
- Orchestrator.upgrade_status()
如果正在进行升级,报告我们处于进程中的位置,或者如果发生了某些错误。
- 返回类型:
OrchResult
[UpgradeStatusSpec
]- 返回:
UpgradeStatusSpec 实例
- class orchestrator。UpgradeStatusSpec
实用工具
- Orchestrator.不可用的设备上配置OSD。()
Report whether we can talk to the orchestrator. This is the place to give the user a meaningful message if the orchestrator isn’t running or can’t be contacted.
This method may be called frequently (e.g. every page load to conditionally display a warning banner), so make sure it’s not too expensive. It’s okay to give a slightly stale status (e.g. based on a periodic background ping of the orchestrator) if that’s necessary to make this method fast.
Note
True doesn’t mean that the desired functionality is actually available in the orchestrator. I.e. this won’t work as expected:
>>> ... if OrchestratorClientMixin().available()[0]: # wrong. ... OrchestratorClientMixin().get_hosts()
- 返回:
boolean representing whether the module is available/usable
- 返回:
string describing any error
- 返回类型:
Tuple
[bool
,str
,Dict
[str
,Any
]]- 返回:
dict containing any module specific information
- Orchestrator.get_feature_set()
Describes which methods this orchestrator implements
Note
True doesn’t mean that the desired functionality is actually possible in the orchestrator. I.e. this won’t work as expected:
>>> ... api = OrchestratorClientMixin() ... if api.get_feature_set()['get_hosts']['available']: # wrong. ... api.get_hosts()
It’s better to ask for forgiveness instead:
>>> ... try: ... OrchestratorClientMixin().get_hosts() ... except (OrchestratorError, NotImplementedError): ... ...
- 返回类型:
Dict
[str
,dict
]- 返回:
Dict of API method names to
{'available': True or False}
客户端模块
- class orchestrator。OrchestratorClientMixin
A module that inherents from OrchestratorClientMixin can directly call all
Orchestrator
methods without manually calling remote.Every interface method from
Orchestrator
is converted into a stub method that internally callsOrchestratorClientMixin._oremote()
>>> class MyModule(OrchestratorClientMixin): ... def func(self): ... completion = self.add_host('somehost') # calls `_oremote()` ... self.log.debug(completion.result)
Note
Orchestrator implementations should not inherit from OrchestratorClientMixin. Reason is, that OrchestratorClientMixin magically redirects all methods to the “real” implementation of the orchestrator.
>>> import mgr_module >>> ... class MyImplementation(mgr_module.MgrModule, Orchestrator): ... def __init__(self, ...): ... self.orch_client = OrchestratorClientMixin() ... self.orch_client.set_mgr(self.mgr))
- add_daemon(spec)
Create daemons daemon(s) for unmanaged services
- 返回类型:
OrchResult
[List
[str
]]
- add_host(host_spec)
将主机添加到 orchestrator 库存。
- 参数:
主机-- hostname
- 返回类型:
OrchResult
[str
]
- add_host_label(主机, label)
Add a host label
- 返回类型:
OrchResult
[str
]
- apply(specs, no_overwrite=False, continue_on_error=False)
Applies any spec
- 返回类型:
List
[str
]
- apply_alertmanager(spec)
Update an existing AlertManager daemon(s)
- 返回类型:
OrchResult
[str
]
- apply_ceph_exporter(spec)
Update existing a ceph exporter daemon(s)
- 返回类型:
OrchResult
[str
]
- apply_crash(spec)
Update existing a crash daemon(s)
- 返回类型:
OrchResult
[str
]
- apply_drivegroups(specs)
Update OSD cluster
- 返回类型:
OrchResult
[List
[str
]]
- apply_grafana(spec)
Update existing a grafana service
- 返回类型:
OrchResult
[str
]
- apply_ingress(spec)
Update ingress daemons
- 返回类型:
OrchResult
[str
]
- apply_iscsi(spec)
Update iscsi cluster
- 返回类型:
OrchResult
[str
]
- apply_loki(spec)
Update existing a Loki daemon(s)
- 返回类型:
OrchResult
[str
]
- apply_mds(spec)
Update MDS cluster
- 返回类型:
OrchResult
[str
]
- apply_mgmt_gateway(spec)
Update an existing cluster gateway service
- 返回类型:
OrchResult
[str
]
- apply_mgr(spec)
Update mgr cluster
- 返回类型:
OrchResult
[str
]
- apply_mon(spec)
Update mon cluster
- 返回类型:
OrchResult
[str
]
- apply_nfs(spec)
Update NFS cluster
- 返回类型:
OrchResult
[str
]
- apply_node_exporter(spec)
Update existing a Node-Exporter daemon(s)
- 返回类型:
OrchResult
[str
]
- apply_nvmeof(spec)
Update nvmeof cluster
- 返回类型:
OrchResult
[str
]
- apply_oauth2_proxy(spec)
Update an existing oauth2-proxy
- 返回类型:
OrchResult
[str
]
- apply_prometheus(spec)
Update prometheus cluster
- 返回类型:
OrchResult
[str
]
- apply_promtail(spec)
Update existing a Promtail daemon(s)
- 返回类型:
OrchResult
[str
]
- apply_rbd_mirror(spec)
Update rbd-mirror cluster
- 返回类型:
OrchResult
[str
]
- apply_rgw(spec)
Update RGW cluster
- 返回类型:
OrchResult
[str
]
- apply_smb(spec)
Update a smb gateway service
- 返回类型:
OrchResult
[str
]
- apply_snmp_gateway(spec)
Update an existing snmp gateway service
- 返回类型:
OrchResult
[str
]
- apply_tuned_profiles(specs, no_overwrite)
Add or update an existing tuned profile
- 返回类型:
OrchResult
[str
]
- 不可用的设备上配置OSD。()
Report whether we can talk to the orchestrator. This is the place to give the user a meaningful message if the orchestrator isn’t running or can’t be contacted.
This method may be called frequently (e.g. every page load to conditionally display a warning banner), so make sure it’s not too expensive. It’s okay to give a slightly stale status (e.g. based on a periodic background ping of the orchestrator) if that’s necessary to make this method fast.
Note
True doesn’t mean that the desired functionality is actually available in the orchestrator. I.e. this won’t work as expected:
>>> ... if OrchestratorClientMixin().available()[0]: # wrong. ... OrchestratorClientMixin().get_hosts()
- 返回:
boolean representing whether the module is available/usable
- 返回:
string describing any error
- 返回类型:
Tuple
[bool
,str
,Dict
[str
,Any
]]- 返回:
dict containing any module specific information
- blink_device_light(ident_fault, on, locations)
Instructs the orchestrator to enable or disable either the ident or the fault LED.
- 参数:
ident_fault (
str
) -- either"ident"
或"fault"
on (
bool
) --True
= on.locations (
List
[DeviceLightLoc
]) -- Seeorchestrator.DeviceLightLoc
- 返回类型:
OrchResult
[List
[str
]]
- cancel_completions()
Cancels ongoing completions. Unstuck the mgr.
- 返回类型:
None
- create_osds(drive_group, skip_validation=False)
Create one or more OSDs within a single Drive Group.
The principal argument here is the drive_group member of OsdSpec: other fields are advisory/extensible for any finer-grained OSD feature enablement (choice of backing store, compression/encryption, etc).
- 返回类型:
OrchResult
[str
]
- daemon_action(action, daemon_name, image=无, force=False)
Perform an action (start/stop/reload) on a daemon.
- 参数:
action (
str
) -- “start”,“stop”,“restart”,“redeploy”,“reconfig”daemon_name (
str
) -- name of daemonimage (
Optional
[str
]) -- Container image when redeploying that daemon
- 返回类型:
OrchResult
- describe_service(service_type=无, service_name=无, refresh=False)
Describe a service (of any kind) that is already configured in the orchestrator. For example, when viewing an OSD in the dashboard we might like to also display information about the orchestrator’s view of the service (like the kubernetes pod ID).
When viewing a CephFS filesystem in the dashboard, we would use this to display the pods being currently run for MDS daemons.
- 返回类型:
OrchResult
[List
[ServiceDescription
]]- 返回:
list of ServiceDescription objects.
- drain_host(hostname, force=False, keep_conf_keyring=False, zap_osd_devices=False)
drain all daemons from a host
- 参数:
hostname (
str
) -- 主机名- 返回类型:
OrchResult
[str
]
- enter_host_maintenance(hostname, force=False, 确实=False)
Place a host in maintenance, stopping daemons and disabling it’s systemd target
- 返回类型:
OrchResult
- exit_host_maintenance(hostname, force=False, 离线=False)
Return a host from maintenance, restarting the clusters systemd target
- 返回类型:
OrchResult
- generate_certificates(module_name)
generate cert/key for the module with the name module_name
- 返回类型:
OrchResult
[Optional
[Dict
[str
,str
]]]
- get_alertmanager_access_info()
get alertmanager access information
- 返回类型:
OrchResult
[Dict
[str
,str
]]
- get_facts(hostname=无)
Return hosts metadata(gather_facts).
- 返回类型:
OrchResult
[List
[Dict
[str
,Any
]]]
- get_feature_set()
Describes which methods this orchestrator implements
Note
True doesn’t mean that the desired functionality is actually possible in the orchestrator. I.e. this won’t work as expected:
>>> ... api = OrchestratorClientMixin() ... if api.get_feature_set()['get_hosts']['available']: # wrong. ... api.get_hosts()
It’s better to ask for forgiveness instead:
>>> ... try: ... OrchestratorClientMixin().get_hosts() ... except (OrchestratorError, NotImplementedError): ... ...
- 返回类型:
Dict
[str
,dict
]- 返回:
Dict of API method names to
{'available': True or False}
- get_inventory(host_filter=无, refresh=False)
Returns something that was created by ceph-volume inventory.
- 返回类型:
OrchResult
[List
[InventoryHost
]]- 返回:
list of InventoryHost
- get_prometheus_access_info()
get prometheus access information
- 返回类型:
OrchResult
[Dict
[str
,str
]]
- get_security_config()
get security config
- 返回类型:
OrchResult
[Dict
[str
,bool
]]
- hardware_light(light_type, action, hostname, device=无)
Light a chassis or device ident LED.
- 参数:
light_type (
str
) -- led type (chassis or device).action (
str
) -- set or get status led.hostname (
str
) -- the name of the host.device (
Optional
[str
]) -- the device id (when light_type = ‘device’)
- 返回类型:
OrchResult
[Dict
[str
,Any
]]
- hardware_powercycle(hostname, 确实=False)
Reboot a host.
- 参数:
hostname (
str
) -- the name of the host being rebooted.- 返回类型:
OrchResult
[str
]
- hardware_shutdown(hostname, force=False, 确实=False)
Shutdown a host.
- 参数:
hostname (
str
) -- the name of the host to shutdown.- 返回类型:
OrchResult
[str
]
- hardware_status(hostname=无, category='summary')
Display hardware status.
- 参数:
category (
Optional
[str
]) -- categoryhostname (
Optional
[str
]) -- hostname
- 返回类型:
OrchResult
[str
]
- host_ok_to_stop(hostname)
Check if the specified host can be safely stopped without reducing availability
- 参数:
主机-- hostname
- 返回类型:
OrchResult
- list_daemons(service_name=无, daemon_type=无, daemon_id=无, 主机=无, refresh=False)
Describe a daemon (of any kind) that is already configured in the orchestrator.
- 返回类型:
OrchResult
[List
[DaemonDescription
]]- 返回:
list of DaemonDescription objects.
- node_proxy_common(category, hostname=无)
Return node-proxy generic report
- 参数:
hostname (
Optional
[str
]) -- hostname- 返回类型:
OrchResult
[Dict
[str
,Any
]]
- node_proxy_criticals(hostname=无)
Return node-proxy criticals report
- 参数:
hostname (
Optional
[str
]) -- hostname- 返回类型:
OrchResult
[Dict
[str
,Any
]]
- node_proxy_firmwares(hostname=无)
Return node-proxy firmwares report
- 参数:
hostname (
Optional
[str
]) -- hostname- 返回类型:
OrchResult
[Dict
[str
,Any
]]
- node_proxy_fullreport(hostname=无)
Return node-proxy full report
- 参数:
hostname (
Optional
[str
]) -- hostname- 返回类型:
OrchResult
[Dict
[str
,Any
]]
- node_proxy_summary(hostname=无)
Return node-proxy summary
- 参数:
hostname (
Optional
[str
]) -- hostname- 返回类型:
OrchResult
[Dict
[str
,Any
]]
- plan(spec)
Plan (Dry-run, Preview) a List of Specs.
- 返回类型:
OrchResult
[List
]
- preview_osdspecs(osdspec_name='osd', osdspecs=无)
Get a preview for OSD deployments
- 返回类型:
OrchResult
[str
]
- remove_daemons(names)
Remove specific daemon(s).
- 返回类型:
OrchResult
[List
[str
]]- 返回:
无
- remove_host(主机, force, 离线, rm_crush_entry)
从 orchestrator 库存中删除主机。
- 参数:
主机 (
str
) -- 主机名- 返回类型:
OrchResult
[str
]
- remove_host_label(主机, label, force=False)
删除主机标签
- 返回类型:
OrchResult
[str
]
- remove_osds(osd_ids, 替换=False, 替换块=False, 替换数据库=False, 替换日志=False, force=False, zap=False, no_destroy=False)
- 参数:
osd_ids (
List
[str
]) -- OSD ID 列表替换 (
bool
) -- 将 OSD 标记为已销毁。参见OSD替换替换块 (
bool
) -- 将相应的块设备标记为已替换。替换数据库 (
bool
) -- 将相应的数据库设备标记为已替换。替换日志 (
bool
) -- 将相应的日志设备标记为已替换。force (
bool
) -- 强制 OSD 删除过程,而无需首先等待数据被引流。zap (
bool
) -- 擦除与 OSD 相关的所有设备(销毁数据)no_destroy (
bool
) -- 不要与 OSD 一起销毁相关的 VGs/LVs。
Note
这只能删除成功创建的 OSD(即获得 OSD ID 的 OSD)。
- 返回类型:
OrchResult
[str
]
- remove_osds_status()
返回正在进行的 OSD 删除操作的状态。
- 返回类型:
OrchResult
- remove_prometheus_target(url)
删除多集群的 prometheus 目标
- 返回类型:
OrchResult
[str
]
- remove_service(service_name, force=False)
删除服务(一组守护进程)。
- 返回类型:
OrchResult
[str
]- 返回:
无
- replace_device(hostname, device, 清除=False, 确实=False)
执行所有必要的操作以替换设备。
- 返回类型:
OrchResult
- rescan_host(hostname)
使用 cephadm 在每个 HBA 上发出磁盘重扫描
一些 HBAs 和外部机箱不会自动将设备插入注册到内核,因此对于这些场景,我们需要手动重扫描
- 参数:
hostname (
str
) -- (str) 主机名- 返回类型:
OrchResult
- rm_tuned_profile(profile_name)
删除 tuned profile
- 返回类型:
OrchResult
[str
]
- service_action(action, service_name)
对服务(即提供逻辑服务的所有守护进程)执行操作(启动/停止/重新加载)。
- 参数:
action (
str
) -- “start”,“stop”,“restart”,“redeploy”,“reconfig”service_name (
str
) -- service_type + ‘.’ + service_id
- 返回类型:
OrchResult
- set_alertmanager_access_info(user, password)
设置 alertmanager 访问信息
- 返回类型:
OrchResult
[str
]
- set_custom_prometheus_alerts(alerts_file)
设置 prometheus 自定义警报文件并安排重新配置 prometheus
- 返回类型:
OrchResult
[str
]
- set_mgr(mgr)
可用于使用全局
mgr
- 返回类型:
None
- set_osd_spec(service_name, osd_ids)
设置 osd 服务
- 返回类型:
OrchResult
- set_prometheus_access_info(user, password)
设置 prometheus 访问信息
- 返回类型:
OrchResult
[str
]
- set_prometheus_target(url)
设置多集群的 prometheus 目标
- 返回类型:
OrchResult
[str
]
- set_unmanaged(service_name, 值)
为给定服务设置 unmanaged 参数为 True/False
- 返回类型:
OrchResult
[str
]- 返回:
无
- stop_drain_host(hostname)
停止主机上的守护进程引流
- 参数:
hostname (
str
) -- 主机名- 返回类型:
OrchResult
[str
]
- stop_remove_osds(osd_ids)
TODO
- 返回类型:
OrchResult
- tuned_profile_add_setting(profile_name, 设置, 值)
为 tuned profile 更改/添加特定设置
- 返回类型:
OrchResult
[str
]
- tuned_profile_add_settings(profile_name, 设置)
为 tuned profile 更改/添加多个设置
- 返回类型:
OrchResult
[str
]
- tuned_profile_ls()
查看当前的 tuned profiles
- 返回类型:
OrchResult
[List
[TunedProfileSpec
]]
- tuned_profile_rm_setting(profile_name, 设置)
删除 tuned profile 的特定设置
- 返回类型:
OrchResult
[str
]
- tuned_profile_rm_settings(profile_name, 设置)
从 tuned profile 中删除多个设置
- 返回类型:
OrchResult
[str
]
- update_host_addr(主机, addr)
更新主机的地址
- 参数:
主机 (
str
) -- 主机名addr (
str
) -- 地址(dns 名称或 IP)
- 返回类型:
OrchResult
[str
]
- upgrade_available()
报告可以升级到的版本
- 返回类型:
OrchResult
- 返回:
字符串列表
- upgrade_status()
如果正在进行升级,报告我们处于进程中的位置,或者如果发生了某些错误。
- 返回类型:
OrchResult
[UpgradeStatusSpec
]- 返回:
UpgradeStatusSpec 实例
- zap_device(主机, path)
擦除设备(销毁数据)
- 返回类型:
OrchResult
[str
]
由 Ceph 基金会带给您
Ceph 文档是一个社区资源,由非盈利的 Ceph 基金会资助和托管Ceph Foundation. 如果您想支持这一点和我们的其他工作,请考虑加入现在加入.