Commit Graph

20 Commits

Author SHA1 Message Date
Thomas Lamprecht
970f96fdbb api osd create: followup code cleanup
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-06-06 13:43:32 +02:00
Dominik Csapak
45d45a63cd ceph: make ceph osd create api more readable
The aim of this patch is to reorder/rework the code of the api call
so that it gets more readable

it adds comments of what/why something is done, removes
code duplication between db/wal checks/creation

There are two changes in behaviour:
* when a device is given more than once via the api,
  the user gets a parameter exception for the db or wal
  with the information that the explicit defined devices must be
  different

* we check the usage for db/wal before the worker, so that the user
  gets instant feedback if a device is already in use
  (this is more for api users than for gui users, since we do those
  checks there also)

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2019-06-06 12:41:14 +02:00
Dominik Csapak
3d7b3992dd ceph: osd create: add missing gpt check
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2019-06-05 18:23:49 +02:00
Dominik Csapak
ab62d137e1 ceph: osd create: round size down to the next kib
since the size of an LV can only be a multiple of 512b, we round
down to the next kib

we then have to mulitply it by 1024 for the partition, since
append_partition expects bytes and not kib

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2019-06-05 18:23:49 +02:00
Thomas Lamprecht
b32e925587 api: osd destroy: try to remove PVs directly on the fly
no point in first building a list if we can just remove it directly
afterwards, it's eval-ed anyway and $osd_list did not get touched
in-between.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-06-05 10:50:54 +02:00
Thomas Lamprecht
5ebb945c3c api: osd destroy: pull out cleanup param
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-06-05 10:49:53 +02:00
Dominik Csapak
9b44d03dad ceph: osd: rework osd destroy to work with ceph-volume
with this, osd destruction is left to ceph-volume if the osd was created
with ceph-volume, else our old code remains mostly the same since
we want to be able to destroy upgraded osds

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2019-06-05 10:43:12 +02:00
Thomas Lamprecht
0154e79558 followup: api: osd create: code cleanup
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-06-05 10:01:45 +02:00
Thomas Lamprecht
0e5f83badc api: osd create: use verbose_description and document defaults directly
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-06-05 10:01:01 +02:00
Thomas Lamprecht
afa09e02c7 fixup: ceph osd create: also put real UUID when adding a lv
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-06-05 09:46:38 +02:00
Dominik Csapak
7783f755e3 ceph: osd: rework creation with ceph-volume
this completely rewrites the ceph os creation api call using ceph-volume
since ceph-disk is not available anymore

breaking changes:
no filestore anymore, journal_dev -> db_dev

it is now possible to give a specific size for db/wal, default
is to read from ceph db/config and fallback is
10% of osd for block.db and 1% of osd for block.wal

the reason is that ceph-volume does not autocreate those itself
(like ceph-disk) but you have to create it yourself

if the db/wal device has an lvm on it with naming scheme 'ceph-UUID'
it uses that and creates a new lv

if we detect partitions, we create a new partition at the end

if the disk is not used at all, we create a pv/vg/lv for it

it is not possible to create osds on luminous with this api call anymore,
anyone needing this has to use ceph-disk directly

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2019-06-05 08:55:28 +02:00
Dominik Csapak
e02970235d gui/ceph: show versions in osd overview
and highlight the not current osds

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2019-05-31 15:45:48 +02:00
Thomas Lamprecht
78c2d7f781 api: ceph/osd: conciser metadata array to hash mapping
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-04-24 10:24:21 +00:00
Thomas Lamprecht
de6ad72f23 followup: refactor & code cleanup
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-04-24 10:22:58 +00:00
Dominik Csapak
91564b7267 adapt osd api call for ceph nautilus
ceph nautilus changed the structure of 'pg dump osds'
they moved the data one level below

parse both new and old format, and bail if it returns anything else

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2019-04-24 10:06:28 +00:00
Thomas Lamprecht
017bb1a8bd minor typo fix and code cleanups
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-02-08 15:26:44 +01:00
Alwin Antreich
3c6aa3f47e api osd/destroy: use ProcFSTools to iterate mounts
Instead of opening proc/mounts through IO::File directly for parsing,
the patch uses ProcFSTools. This way it also takes care of eventual
decoding.

Signed-off-by: Alwin Antreich <a.antreich@proxmox.com>
2019-02-08 15:26:00 +01:00
Thomas Lamprecht
e45cc727e6 follouwp: code cleanup
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-02-08 15:26:00 +01:00
Alwin Antreich
b436dca874 Fix #2051: preserve DB/WAL disk on destroy
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>
2019-02-08 14:20:23 +01:00
Dominik Csapak
79fa41a2b8 ceph: move API2::CephOSD to API2::Ceph::OSD
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2018-12-20 09:44:01 +01:00