Commit Graph

19 Commits

Author SHA1 Message Date
Thomas Lamprecht
51498a2664 ceph: code/indentation cleanup
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-05-03 14:03:32 +02:00
Thomas Lamprecht
a11328286a ceph services: cleanup variable names
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-11-22 17:59:36 +01:00
Alwin Antreich
93bf658986 ceph: remove unused variable assignment
Signed-off-by: Alwin Antreich <a.antreich@proxmox.com>
2020-04-15 09:52:31 +02:00
Dominik Csapak
0496138e44 ceph: factor out get/broadcast ceph versions to ceph::services
which also removes some dead code
(the my $local_last_version variable was never used)

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2020-04-01 17:15:41 +02:00
Dominik Csapak
7e98f79e40 ceph: make all service name regexes the same
instead of having multiple regexes in various places for the name,
define a 'SERVICE_REGEX' in PVE::Ceph::Services, and use that
everywhere in the api where we need it

additionally limit new sevices to 200 characters, since
systemd units have a limit of 256 characters[0] (including suffix), and
200 seems to be enough.

users can now create ceph services on machines with hostnames
longer than 32 characters

0: https://www.freedesktop.org/software/systemd/man/systemd.unit.html

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2020-03-04 15:38:09 +01:00
Dominik Csapak
342de4e778 ceph: services: improve addr selection
we map '$type addr' to '$type_addr' anyway in the ceph.conf parser,
so this is not necessary

also use 'public_addr' if it is set

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2019-07-04 09:57:50 +02:00
Dominik Csapak
e7e615768f ceph: services: do not create rados object in get_services_info
we always gave one, and the only reason why it could be undef
is that we could not connect, so it makes no sense to try again
and add unecessary time to the api call

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2019-06-18 16:17:35 +02:00
Dominik Csapak
46fb9c5017 ceph: a little luminous backwards compatibility
ceph luminous does not use the 'name' property in the metadata
everywhere, so fall back to 'id'

this makes the ceph dashboard usable while having still luminous
(relevant for upgrading)

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2019-06-11 12:58:24 +02:00
Dominik Csapak
b521573040 ceph: mgr: delete auth key on destruction
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2019-06-04 17:07:39 +02:00
Thomas Lamprecht
930c1d6a15 get_cluster_service: do not always call cfs_update
This was done to ensure the nodelist, which get_node_kv uses
internally to loop over all nodes, is filled. But, everything coming
through API/CLI already has a cfs_update called so this is not
required outside from development testing calls. As we normally do
not do this for such calls, cfs_update call is a prerequisite for
such things. The better solution would be handling this internally in
get_node_kv, e.g., by checking if $clinfo->{versionn} was set once,
and if not call to cfs_update, or maybe even better, so adapt the IPC
call for a possibility to get the KV status hash for all nodes.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-06-04 16:42:37 +02:00
Thomas Lamprecht
9ecb3d10e4 followup code cleanup
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-06-04 16:42:37 +02:00
Dominik Csapak
d5373b7dc3 ceph: factor out the service info generation
and include a call to $type metadata to include the version

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2019-06-04 14:57:10 +02:00
Dominik Csapak
4e76dbd7b3 ceph: refactor broadcast_ceph_services and get_cluster_service
and use the broadcast when a service is added/removed
we will use 'get_cluster_service' in the future when we generate a list
of services of a specific type

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2019-06-04 14:56:24 +02:00
Dominik Csapak
74628668d7 ceph: get_local_services: also check /var/lib/ceph/$type
so we do not miss disabled services

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2019-06-04 14:55:45 +02:00
Thomas Lamprecht
ac4f971d18 followup code cleanup for: add get_local_services for ceph
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-05-27 15:52:12 +02:00
Dominik Csapak
23b20ae451 add get_local_services for ceph
this returns a hash of existing service links for
mds/mgr/mons so that we know which services exists

this is necessary since ceph itself does not save if a service is
defined somewhere, only when it runs

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2019-05-27 15:30:35 +02:00
Thomas Lamprecht
bba5c71217 ceph: drop systemd_managed - we now always are
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-05-26 13:35:39 +02:00
Dominik Csapak
be7edba15d ceph: move mgr create/destroy to Ceph::Services
and adapt the paths and callers

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2018-12-20 09:44:01 +01:00
Dominik Csapak
27439be616 ceph: move service_cmd and MDS related code to Services.pm
Also adapts the calls to the relevant subs.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2018-12-20 09:44:01 +01:00