John Mulligan [Wed, 8 Nov 2023 16:54:42 +0000 (11:54 -0500)]
cephadm: remove call to get_container from iscsi tcmu runner method
Remove the call to get_container from the iscsi class's
get_tcmu_runner_container method, replacing it with a call to the
daemon_to_container function. While they're roughly equivalent -
we can consider get_container legacy and only for use in cephadm.py
where daemon_to_container is more general.
Signed-off-by: John Mulligan <jmulligan@redhat.com>
John Mulligan [Sun, 5 Nov 2023 20:22:02 +0000 (15:22 -0500)]
cephadm: rework get_container in terms of daemon_to_container
With get_container basically equivalent to daemon_to_container except
one creates a ContainerDaemonForm and the other requires one, we
can rework get_container to act as a thin wrapper around
daemon_to_container.
Signed-off-by: John Mulligan <jmulligan@redhat.com>
John Mulligan [Sun, 5 Nov 2023 20:18:57 +0000 (15:18 -0500)]
cephadm: switch custom container class to use daemon_to_container function
Switch the custom container daemon type class to call
daemon_to_container instead of get_container in the class's container
method. This breaks a dependency loop between the class and the
get_container function hopefully enabling future clean ups and code
moves.
Signed-off-by: John Mulligan <jmulligan@redhat.com>
John Mulligan [Sun, 5 Nov 2023 20:18:49 +0000 (15:18 -0500)]
cephadm: switch tracing class to use daemon_to_container function
Switch the tracing daemon type class to call daemon_to_container instead of
get_container in the class's container method. This breaks a dependency loop
between the class and the get_container function hopefully enabling future
clean ups and code moves.
Signed-off-by: John Mulligan <jmulligan@redhat.com>
John Mulligan [Sun, 5 Nov 2023 20:18:33 +0000 (15:18 -0500)]
cephadm: switch keepalived class to use daemon_to_container function
Switch the keepalived daemon type class to call daemon_to_container instead of
get_container in the class's container method. This breaks a dependency loop
between the class and the get_container function hopefully enabling future
clean ups and code moves.
Signed-off-by: John Mulligan <jmulligan@redhat.com>
John Mulligan [Sun, 5 Nov 2023 20:18:19 +0000 (15:18 -0500)]
cephadm: switch haproxy class to use daemon_to_container function
Switch the haproxy daemon type class to call daemon_to_container instead of
get_container in the class's container method. This breaks a dependency loop
between the class and the get_container function hopefully enabling future
clean ups and code moves.
Signed-off-by: John Mulligan <jmulligan@redhat.com>
John Mulligan [Sun, 5 Nov 2023 20:18:08 +0000 (15:18 -0500)]
cephadm: switch ceph exporter class to use daemon_to_container function
Switch the ceph exporter daemon type class to call daemon_to_container
instead of get_container in the class's container method. This breaks a
dependency loop between the class and the get_container function
hopefully enabling future clean ups and code moves.
Signed-off-by: John Mulligan <jmulligan@redhat.com>
John Mulligan [Sun, 5 Nov 2023 20:17:47 +0000 (15:17 -0500)]
cephadm: switch nvmeof class to use daemon_to_container function
Switch the nvmeof daemon type class to call daemon_to_container instead of
get_container in the class's container method. This breaks a dependency loop
between the class and the get_container function hopefully enabling future
clean ups and code moves.
Signed-off-by: John Mulligan <jmulligan@redhat.com>
John Mulligan [Sun, 5 Nov 2023 20:17:33 +0000 (15:17 -0500)]
cephadm: switch iscsi class to use daemon_to_container function
Switch the iscsi daemon type class to call daemon_to_container instead of
get_container in the class's container method. This breaks a dependency loop
between the class and the get_container function hopefully enabling future
clean ups and code moves.
Signed-off-by: John Mulligan <jmulligan@redhat.com>
John Mulligan [Sun, 5 Nov 2023 20:17:10 +0000 (15:17 -0500)]
cephadm: switch nfs class to use daemon_to_container function
Switch the nfs daemon type class to call daemon_to_container instead of
get_container in the class's container method. This breaks a dependency loop
between the class and the get_container function hopefully enabling future
clean ups and code moves.
Signed-off-by: John Mulligan <jmulligan@redhat.com>
John Mulligan [Sun, 5 Nov 2023 20:16:44 +0000 (15:16 -0500)]
cephadm: switch monitoring class to use daemon_to_container function
Switch the monitoring daemon type class to call daemon_to_container instead of
get_container in the class's container method. This breaks a dependency loop
between the class and the get_container function hopefully enabling future
clean ups and code moves.
Signed-off-by: John Mulligan <jmulligan@redhat.com>
John Mulligan [Sun, 5 Nov 2023 18:43:44 +0000 (13:43 -0500)]
cephadm: switch snmp class to use daemon_to_container function
Switch the snmp daemon type class to call daemon_to_container instead of
get_container in the class's container method. This breaks a dependency loop
between the class and the get_container function hopefully enabling future
clean ups and code moves.
Signed-off-by: John Mulligan <jmulligan@redhat.com>
John Mulligan [Sun, 5 Nov 2023 18:41:29 +0000 (13:41 -0500)]
cephadm: switch ceph class to use daemon_to_container function
Switch the ceph daemon type class to call daemon_to_container instead of
get_container in the class's container method. This breaks a dependency loop
between the class and the get_container function hopefully enabling future
clean ups and code moves.
Signed-off-by: John Mulligan <jmulligan@redhat.com>
John Mulligan [Sun, 5 Nov 2023 18:36:41 +0000 (13:36 -0500)]
cephadm: add daemon_to_container utility function
Add the function daemon_to_container in the container_daemon_form.py
function. This function is roughly equivalent to `get_container` in
cephadm.py but entirely relies on subclasses implementing
ContainerDaemonForm methods and avoids special casing of daemon
types.
It duplicates the functionality provided by functions in cephadm.py with
regards to special podman specific behaviors. I feel that this is a
minor issue because due to recent refactoring those functions are now
the one- or two-liners that are copied here. I gated them behind
arguments `auto_podman_mounts` and `auto_podman_args` that default to
true in order to make the function more reusable - however I don't need
them that way and if it seems like extra complexity for no win, we can
remove them later.
Signed-off-by: John Mulligan <jmulligan@redhat.com>
John Mulligan [Sun, 5 Nov 2023 18:22:07 +0000 (13:22 -0500)]
cephadm: convert calls to get_container_{mounts,binds} to method calls
In get_container, convert calls to get_container_binds and
get_container_mounts to direct uses of the ContainerDaemonForm customize
methods, avoiding constructing said ContainerDaemonForm subclasses
redundantly.
This is all done in one pass because the _update_podman_mounts function
is called by get_container_mounts and trying to convert each type at a
time would result in extra calls to that function.
Signed-off-by: John Mulligan <jmulligan@redhat.com>
John Mulligan [Tue, 14 Nov 2023 00:15:25 +0000 (19:15 -0500)]
cephadm: workaround issues running cephadm with relative path
Implement a workaround for the jinja2 package loader not correctly
finding a template inside the cephadmlib package when run as
a zipapp. See docstring in the shim class for more details.
Signed-off-by: John Mulligan <jmulligan@redhat.com>
'ceph-volume raw list' is broken for a specific use case (rook).
rook copies devices from /dev/ to /mnt for specific/internal needs.
when ceph-volume raw list is passed a device from /mnt then
ceph-volume ignores it and return an empty dict.
That prevent rook from creating OSDs properly.
Ronen Friedman [Thu, 9 Nov 2023 15:21:42 +0000 (09:21 -0600)]
tests/standalone: fix scrub-related tests following command changes
Using
ceph tell $pgid [deep]-scrub
to initiate an 'operator initiated' scrub, and
ceph tell $pgid schedule[-deep]-scrub
for causing a 'periodic scrub' to be scheduled.
mgr/cephadm: Expose nvmeof gateway configuration parameters through specifications
- min_controller_id, max_controller_id: Enable the specification of minimum and maximum controller IDs utilized by the SPDK.
Having distinct controller IDs is vital for configuring multipath setups.
- enable_spdk_discovery_controller: Manage whether the SPDK or ceph-nvmeof discovery service is employed. The default value is set to False.
Signed-off-by: Alexander Indenbaum <aindenba@redhat.com>
Zac Dover [Tue, 14 Nov 2023 13:40:42 +0000 (23:40 +1000)]
doc/glossary: add "Quorum" to glossary
Add the term "Quorum" to the glossary and link to the part of
architecture.rst concerning Monitors. The sticky header at the top of
the docs.ceph.com website gets in the way of the location linked to in
this commit, but fatigue and disgust prevent me from spending time today
trial-and-erroring my way through the hostile and ill-documented
wilderness of scroll-margin so that the link goes where it should.
Co-authored-by: Anthony D'Atri <anthony.datri@gmail.com> Signed-off-by: Zac Dover <zac.dover@proton.me>
John Mulligan [Sun, 5 Nov 2023 17:57:45 +0000 (12:57 -0500)]
cephadm: eliminate the _update_pids_limit function
Eliminate the _update_pids_limit function by moving the logic into the
various daemon type classes `customize_container_args` functions allow
each class to decide if it needs to run with unlimited-pids or not.
Signed-off-by: John Mulligan <jmulligan@redhat.com>
John Mulligan [Sun, 5 Nov 2023 16:44:48 +0000 (11:44 -0500)]
cephadm: use class methods when setting up ceph based daemon containers
Now that the ceph and ceph exporter classes have all the necessary
methods, rework the get_container function to use those class methods
in a common manner.
Signed-off-by: John Mulligan <jmulligan@redhat.com>
John Mulligan [Sat, 21 Oct 2023 00:18:36 +0000 (20:18 -0400)]
cephadm: add container envs methods to ceph and ceph exporter classes
These, currently unused, methods will be used in a subsequent change to
move logic for setting up containers out of the get_containers function
into the daemon type classes in a common way.
Signed-off-by: John Mulligan <jmulligan@redhat.com>
John Mulligan [Sun, 5 Nov 2023 16:12:54 +0000 (11:12 -0500)]
cephadm: add methods to ceph daemon type class
Add unused methods to the ceph class in order to prepare for moving
the logic for setting up the various ceph deaemon types to be
handled by the class.
Signed-off-by: John Mulligan <jmulligan@redhat.com>
John Mulligan [Sun, 5 Nov 2023 16:09:27 +0000 (11:09 -0500)]
cephadm: add more ContainerDeamonForm methods to the monitoring class
Add methods customize_{container_args,process_args} & default_entrypoint
to the monitoring daemon type class. Use those methods in the
get_container function.
Signed-off-by: John Mulligan <jmulligan@redhat.com>
John Mulligan [Sun, 5 Nov 2023 16:00:54 +0000 (11:00 -0500)]
cephadm: add more ContainerDeamonForm methods to the tracing class
Add methods customize_{container_envs,process_args} & default_entrypoint
to the tracing daemon type class. Use those methods in the get_container
function.
This change tries to adapt to, but not fix, the rather strange
set_configuration static method that side-effects the class's(!)
property.
Signed-off-by: John Mulligan <jmulligan@redhat.com>
John Mulligan [Sun, 5 Nov 2023 13:09:10 +0000 (08:09 -0500)]
cephadm: add more ContainerDeamonForm methods to the nfs class
Add methods customize_{container_envs,process_args} & default_entrypoint
to the nfs daemon type class. Use those methods in the get_container
function.
Signed-off-by: John Mulligan <jmulligan@redhat.com>
John Mulligan [Sun, 5 Nov 2023 12:18:55 +0000 (07:18 -0500)]
cephadm: add more ContainerDeamonForm methods to the custom container class
Add methods customize_{process_args,container_envs,container_args} and
default_entrypoint to the custom container daemon type class. Use those
methods in the get_container function.
Signed-off-by: John Mulligan <jmulligan@redhat.com>
John Mulligan [Tue, 7 Nov 2023 22:57:43 +0000 (17:57 -0500)]
cephadm: update additional container daemon form base class methods
Fix the function signature for the previously added stub
customize_container_args.
Add methods for customize_process_args and customize_container_envs.
The "process args" are args passed to the daemon process / entrypoint.
Container args are passed to the container engine.
Add a default_entrypoint method to return the default entrypoint for
a particular daemon-in-container.
Signed-off-by: John Mulligan <jmulligan@redhat.com>
and it placed the node-exporter daemons on vm-00
and vm-02 but not vm-01. Obviously there are more
advanced scenarios that justify this than listing
two hosts, but using "|" as an OR like that is an
example of something you can't do with the fnmatch
version of the host pattern
Ramana Raja [Thu, 2 Nov 2023 21:44:10 +0000 (17:44 -0400)]
pybind/mgr: remove __del__() of mgr modules
It's strongly recommended for objects that have references to
external resources (e.g., files) to explicitly release them.
Python doesn't guarantee garbage collection of objects and hence
doesn't guarantee freeing of external resources that occur on
garbage collection.
The __del__() methods in the python mgr modules may not even be
called since garbage collection of objects is not guaranteed in python.
And some of the __del__() methods try to cleanup that seem redundant.
- In volumes/module.py, vc.shutdown() is called in Module.shutdown().
No need to call it again in Module.__del__()
- In telegraf/basesocket.py, BaseSocker.close() is called in
BaseSocket.__exit__(). No need to call it again in
BaseSocket.__del__().
- In mgr_module.py, MgrModuleLoggingMixin._unconfigure_logging() is
called in MgrModule.__init__() and MgrStandbyModule.__init__(). No
need to call it in MgrModule.__del__() and
MgrStandbyModule.__del__().|
- In dashboard/services/cephfs.py, the libcephfs mount is not
shutdown explicitly by the mgr module. However, the cython libcephfs
bindings has a LibCephFS.__dealloc__() finalizer method that calls
LibCephFS.shutdown(). This should unmount and cleanup the ceph mount
handle.
Remove the __del__() of the python mgr modules.
Fixes: https://tracker.ceph.com/issues/63421 Signed-off-by: Ramana Raja <rraja@redhat.com>
Zac Dover [Mon, 13 Nov 2023 10:57:07 +0000 (20:57 +1000)]
doc/rados: format "initial troubleshooting"
Format the steps in the "Initial Troubleshooting" section of
doc/rados/troubleshooting/troubleshooting-mon.rst. A near-future PR (not
this one) will add context to this section and explain that the steps
described here are the first steps that you should undertake when you
determine that you have an unresponsive or down Monitor. This PR is
merely for formatting.
The operation's id and future returned when starting SnapTrimObjSubEvent
is emplaced into subop_blocker.
Later on, we await the completion of all the started operations futures.
Before this patch, we only stored the op id in the subop_blocker vector
which allowed `op` to go out of scope and lose all its references
(and get deleted) before exiting.
Storing the operation as a reference instead of the id
will maintain the SnapTrimObjSubEvent operation lifetime.
Zac Dover [Sun, 12 Nov 2023 10:52:09 +0000 (20:52 +1000)]
doc/rados: parallelize t-mon headings
Give parallel structure to the questions in the Q&A section of the "The
Cluster Has Quorum But At Least One Monitor Is Down" subsection of the
"Most Common Monitor Issues" section of
doc/rados/troubleshooting/troubleshooting-mon.rst.
Zac Dover [Sun, 12 Nov 2023 10:21:41 +0000 (20:21 +1000)]
doc/config: edit "ceph-conf.rst"
Edit the first section of doc/rados/configuration/ceph-conf.rst.
Initially I just wanted to change "series" to "set", but once I got my
hands dirty I ended up simplifying some sentences.
John Mulligan [Sat, 4 Nov 2023 23:41:25 +0000 (19:41 -0400)]
cephadm: change ceph & exporter to customize_container_mounts method
Unlike the other types Ceph and CephExporter share the underlying
method. There was no other use of get_container_mounts on the class
so it could be converted to be customize_container_mounts.
Because there's an extra arg that passes from get_container_mounts
top-level function to Ceph.get_ceph_mounts, that function was not
changed.
Signed-off-by: John Mulligan <jmulligan@redhat.com>
John Mulligan [Sat, 4 Nov 2023 22:39:07 +0000 (18:39 -0400)]
cephadm: move volume mounts assignment to a variable
Move the call to get_container_mounts out of the function call block.
This will aid with the next refactoring steps, so that the uses
of get_container_mounts can be brought into the get_container call
directly.
Signed-off-by: John Mulligan <jmulligan@redhat.com>