Commit Graph

24 Commits

Author SHA1 Message Date
Dominik Csapak
b8c37fdae1 ceph: disallow ipv4 in new cluster when ipv6 is enabled
ms_bind_ipv4 is default true and osds look for both
ipv6 and ipv4 addresses in cluster network/public network

since we only allow for one network each (which must be either
ipv4 or ipv6) we disallow ipv4 if ipv6 is detected

this fixes not starting osds on an ipv6 enabled, newly-setup cluster

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2019-06-28 15:14:04 +02:00
Dominik Csapak
78f99813bb ceph: mon create: fix not starting monitor if no public_addr is in conf
when there is no 'public_network' in the config, the monitor
can only find an ip if it is given explicitly, either via commandline
(not possible with systemd) or via the ceph.conf

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2019-06-28 14:23:23 +02:00
Thomas Lamprecht
790ebc9053 api: ceph mon: add missing perl use statement for Cephconfig
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-06-19 16:59:26 +02:00
Dominik Csapak
f4d0945862 ceph: mon destroy: do not stop monitor ourselves
a 'mon remove' does this already for us, so do not stop it
this lead to a race where we could stop the next to the last monitor
before it was removed from the cluster, leading to a state
where two monitor were needed for quorum, but only one did exist

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2019-06-19 15:26:33 +02:00
Dominik Csapak
ea2ecb0c2f ceph: mon destroy: remove from mon_host
we need to remove an ip, ip:port or a ipvector from monhost
so use multiple regex search and replaces for this

this looks not really nice, but due to the strange format
of the line (e.g. ',' is a seperator inside and outside of a vector,
also ipv6 adresses may be surrounded with [] but so are vectors),
i found no better way

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2019-06-19 15:26:33 +02:00
Dominik Csapak
9bc15eea0a ceph: mon destroy: add cfs lock
so that multiple users cannot remove a monitor simultaniously

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2019-06-19 15:26:33 +02:00
Dominik Csapak
3babcc1d52 ceph: mon destroy: refactor removal assertions
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2019-06-19 15:26:33 +02:00
Dominik Csapak
ad475e25db ceph: mon create: lock monitor creation
otherwise it is possible that multiple users create monitors at the same
time, resulting in a wrong ceph.conf and probably worse

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2019-06-19 15:26:33 +02:00
Dominik Csapak
10907e548d ceph: mon create: add to mon_host with msgr2
in nautilus, the default msgr protocol is v2, but it has to be
explicitely given to monmaptool, also we don't want to use the
monitor sections anymore so only update mon_host

ceph can cope with mixed mon_host and monitor sections, so this is
not a problem

also the ceph-create-keys part is not necessary anymore since
this is done by the monitor itself now

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2019-06-19 15:26:33 +02:00
Dominik Csapak
db1c4cc8f3 ceph: mon create: refactor mon assertions
by using our new 'get_services_info'

this already checks for nautilus+ style 'mon_host' key in the ceph.conf
for the ip address

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2019-06-19 15:26:33 +02:00
Dominik Csapak
d558d296f7 ceph: mon create: refactor and improve auth key creation
it makes no sense to have the mon key inside the client.admin.keyring
also the order and operations did not make much sense

also create the client admin keyring when creating the config

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2019-06-18 17:06:50 +02:00
Dominik Csapak
7e32d0bdc4 ceph: mon create: detect pubnet via config database
if we already have a monitor, we can try to get the public_network via
the ceph configuration database

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2019-06-18 16:17:35 +02:00
Dominik Csapak
78441ff8da ceph: mon list: make more robust
in a case where we cannot connect to any monitor, we did not get
any info even if we have them via the pmxcfs

so get the RADOS object in an eval, and get the info we have from the
config/pmxcfs, and set the state to unknown if we cannot query via RADOS

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2019-06-18 16:17:35 +02:00
Thomas Lamprecht
a435eaf9a0 api: create mon: also have monid in path for create
similar to the MDS api, so that DELETE and POST calls can operate on
the same path. This does not changes the CLI pveceph interface

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-06-05 12:41:11 +02:00
Thomas Lamprecht
7760a8beba api: mon create: code cleanup, redue heavy empty line usage
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-06-05 12:41:11 +02:00
Dominik Csapak
da92b5fcce ceph: mon: use ceph_service_cmd to enable/disable the systemd service
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2019-06-04 17:07:43 +02:00
Dominik Csapak
919513b01b ceph: remove 'exclude-manager' api parameter
since we will have a seperate gui for the manager, we do not need this
anymore

this is a breaking api change

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2019-06-04 16:51:18 +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
Thomas Lamprecht
97ed02b8b6 api/ceph: create mon: drop now unsupported set-uid on autkey create
From Nautilus release changelog[0]:
> The auid property for cephx users and RADOS pools has been removed.
> This was an undocumented and partially implemented capability that
> allowed cephx users to map capabilities to RADOS pools that they
> “owned”. Because there are no users we have removed this support.

[0]: https://ceph.com/releases/v14-2-0-nautilus-released/

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-05-26 15:22:42 +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
Thomas Lamprecht
a7a84cb446 api: ceph/mon: improve no ip error
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-04-08 17:36:54 +02:00
Alwin Antreich
7491160403 Ceph MON - Reword error message on IP config
Reword the error message in find_mon_ip to make it more clear, that
there is no active IP configuration for the ceph public network.

Signed-off-by: Alwin Antreich <a.antreich@proxmox.com>
2019-04-08 17:04:27 +02:00
Dominik Csapak
98fe93ae25 ceph: move Monitor API calls to API2/Ceph/MON.pm
and adapt the paths

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