This is useful for ceph-mgr because it means that
any in-mgr modules that want to use e.g. rbd
can find it when running in a vstart cluster.
Signed-off-by: John Spray <john.spray@redhat.com>
...at least, try to! This is a copy-paste of the ceph-mds
packaging with a search and replace mds to mgr.
Signed-off-by: John Spray <john.spray@redhat.com>
This is a hack to inject a key for the mgr daemon, using whatever
key already exists on the mon on this node to gain sufficient
permissions to create the mgr key. Failure is ignored at every
step (the '-' prefix) in case someone has already used some other
trick to set everything up manually.
Signed-off-by: Tim Serong <tserong@suse.com>
This change introduces the following behaviour:
- When ceph-mon starts, it will try to start ceph-mgr with the same
instance id (Wants=), but will *not* fail to start if ceph-mgr
doesn't start (i.e. the mon still works as it always did).
- ceph-mgr will start After= ceph-mon, and will stop and start when
ceph-mon stops and starts, because it's PartOf= ceph-mon.
If you don't want ceph-mgr to run on the mons, you need to mask the
service, i.e. `systemctl mask ceph-mgr@INSTANCE`. Hostnames are
typically instance names, so `systemctl mask ceph-mgr@$(hostname)`
should suffice if you wish to disable ceph-mgr on the mons.
Signed-off-by: Tim Serong <tserong@suse.com>
This adds ceph-mgr following the same pattern used for ceph-mon,
ceph-mds, ceph-osd. I've removed the boost-python BuildRequire
for SUSE distros, because we don't ship that (the relevant bits
are already included in boost-devel).
NOTE: This gives an installable ceph-mgr, but not necessarily a
runnable ceph-mgr. This is because ceph-mgr needs the following
python packages:
- CherryPy
- Django
- gevent
- python-dateutil
- djangorestframework
Not all of these are available as distro packages. For example,
on openSUSE Tumbleweed, we don't have djangorestframework available
in the base distro, and our Django version is 1.9, which seems to
be incompatible with ceph-mgr. I'm not sure of the situation on
other distros.
Signed-off-by: Tim Serong <tserong@suse.com>
...and change the "if False" django-rest-framework
conditionals to actual version checks, with a view
to genuinely supporting 2.x in future if needed.
Signed-off-by: John Spray <john.spray@redhat.com>
This broken when MgrStandby was separated out,
because it now eats the original OSDMap message
without calling maybe_request_map.
Signed-off-by: John Spray <john.spray@redhat.com>
This used to be the friend relationship to PGMonitor. It
was never really needed anyway, it was only being used
to skip the getter on `pools`
Signed-off-by: John Spray <john.spray@redhat.com>
...and remove the copypasta from mgr.
mgr still doesn't do all the same logic (it doesn't
have osdmap history handy) but it is now much easier
to see which bits are used one place vs. the other.
Signed-off-by: John Spray <john.spray@redhat.com>
A demonstration of creating a simple
ASCII-art status display by fusing
the metadata, perf counters, and maps that
are available to python modules in ceph-mgr.
Signed-off-by: John Spray <john.spray@redhat.com>
Previously only the errors were getting through, because
other stuff was getting held up in the python logging
framework.
Signed-off-by: John Spray <john.spray@redhat.com>
This is a rough implementation that sends all the stats,
without the efficiency of the queue+acks that we use
when talking to the mon.
Signed-off-by: John Spray <john.spray@redhat.com>
The send_report loop doesn't get kicked off
on configure messages unless the period is
set to its initial value (0).
Signed-off-by: John Spray <john.spray@redhat.com>
The ceph_state module is implemented in C++, and isn't available at
build time, which causes import failures when api_docs.py tries to
import calamari_rest in order to introspect it (MgrModule is eventually
imported, which in turn tries to import ceph_state, which fails unless
we stub it out).
Additional changes:
* Search calamari_rest.urls (not calamari_web)
calamari_web isn't available - it largely held static content in
Calamari, and in turn included calamari_rest.urls. Here in ceph-mgr we
only have calamari_rest.
* note that --list-urls does nothing, apparently
* Pass actions to old as_view method
django-rest-framework 3.x raises TypeError if the actions argument isn't
passed to as_view().
* Use view().get_view_name() instead of metadata
Attempting to access view().metadata(None)['name'] results in
"AttributeError: 'super' object has no attribute 'metadata'".
* Use somewhat unfriendly field class names
django-rest-framework 3.x seems to have done away with type_label for
fields, so instead use the field's class name, which is somewhat
unfriendly, but arguably better than nothing.
* import global_instance to fix ImportError
This is necessary to avoid what seems to be weird import loops (if this
isn't present, we later get "ImportError: cannot import name
UserRequest" or similar).
* Make api_examples.json optional
This way we at least get bare docs with no examples, rather than no docs
at all.
* Explain how to generate API docs
Signed-off-by: Tim Serong <tserong@suse.com>