Since Ceph Nautilus 14.2.10 and Octopus 15.2.2 the min_size of a pool is
calculated by the size (round(size / 2)). When size is applied after
min_size to the pool, the manual specified min_size will be overwritten.
Signed-off-by: Alwin Antreich <a.antreich@proxmox.com>
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Since I had to look up the cause of the error-message in our source
explaining why exactly ceph-operations fail, because
/etc/ceph/ceph.conf exists.
reported via our community forum:
https://forum.proxmox.com/threads/osd-ersetzen-neu-erstellen.80793/
quickly tested on a virtual ceph cluster
Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
to reduce code duplication and make it easier to add more options for
pool commands.
Use a new rados object for each 'osd pool set', as each command can set
an option independent of the previous commands success/failure. On
failure a new rados object would need to be created and that will
confuse task tracking of the REST environment.
Signed-off-by: Alwin Antreich <a.antreich@proxmox.com>
Luminous, Nautilus and Octopus. In Octopus the mon_status was dropped.
Also the ceph status was cleaned up and doesn't provide the mgrmap and
monmap.
The rados queries used in the ceph status API endpoints (cluster / node)
were factored out and merged to one place.
Signed-off-by: Alwin Antreich <a.antreich@proxmox.com>
to clean service directories as well as disable and stop Ceph services.
Addtionally provide the option to remove crash and log information.
This patch is also in addtion to #2607, as the current cleanup doesn't
allow to re-configure Ceph, without manual steps during purge.
Signed-off-by: Alwin Antreich <a.antreich@proxmox.com>
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>
add and change the return signature for the wantarray case, which can
safely done as this is only used once (statd), and there only the
first elemen, the full version string, is used - so no breakage
potential there
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
A fixed path for the ceph.client.admin.keyring was used in the chown
command. This patch uses the ckeyring_path variable instead, to minimize
changes should the path change.
Signed-off-by: Alwin Antreich <a.antreich@proxmox.com>
pveceph init failed, as the copy used a wrong path with typo as
target and then the chown tried to operate on the correct keyring
path, which was then non-existing.
Signed-off-by: Alwin Antreich <a.antreich@proxmox.com>
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>
normally this gets created on package installation, but could be
deleted, e.g., by a debug purge. As it costs nothing to create just
do a mkdir on it, which does not fails if it already exists..
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
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>
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>
this parameter changed sometime between luminous and nautilus
note that with this change, it is not possible to delete pools in
luminous anymore
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
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>
reads the sizes from the ceph config db first, then from the
ceph config, first from the osd section then global
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
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>
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>
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>
The new luminous release 12.2.11 cherry-picked a commit[0] which
remove some legacy fallback when parsing a pool set command.
As of now only strings (which itself can then be a string, int or
float) may be passed as a value, while older also accepted an int
directly.
So ensure that all of our "osd pool set" commands pass strings, which
means that 'min_size' and 'size' must be converted to strings before
executing the command.
Without this one cannot create a CephFS over the WebUI anymore as the
create pools fails. Interestingly, the normal create pools over WebUI
still worked, as it has those two parameters exposed in the creation
formular, and thus sents them as string to the backend, while the
cephfs API does not exposes those two values at all but sets them
directly to integers. Funny stuff. CLI invocations also had the same
issue, depending on the fact if size and min_size could and got
passed (then it worked) or where omited (then it did not worked).
[0]: c838a0096d
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
When destroying an OSD over API or CLI, e.g. by executing:
'pveceph osd destroy <num> --cleanup'
all disks associated with the OSD got wiped with dd, which included
any shared and by others still in use ones, e.g., separate disks with
DB/WAL.
The patch changes 'wipe_disks' to wipe the partition instead of the
whole disk.
Signed-off-by: Alwin Antreich <a.antreich@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
It makes more sense to have it there, especially since we want to
split out the service parts into a seperate file.
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>