Commit Graph

160 Commits

Author SHA1 Message Date
Thomas Lamprecht
d4d2e789b8 api/CephOSD: cleanup and sort module usage
most of this was imported by just copying without verifying if all is
actually required. Some lost its purpose as we re-used more from our
existing module code base (e.g., pve-common) but wasn't actually
removed.

As this file includes two perl modules you need to take a bit caution
when looking at this, as some things are used in one module but not
the other - simple grep'ing at this may give false positives.

Also include the missing IO::File use.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2018-11-22 11:06:12 +01:00
Alwin Antreich
6281777bd9 add_storage creates only one ceph storage entry
This patch removes the separate storage entries for CT & VM to the same
ceph pool. Instead only one entry is made as we can now map/unmap
volumes actively in pve-container.

Signed-off-by: Alwin Antreich <a.antreich@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2018-11-12 13:22:55 +01:00
Thomas Lamprecht
3e1d7320d0 follow up: cleanup long line
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2018-10-24 13:24:11 +02:00
David Limbeck
1b3caf4f21 add wipe_disk option when destroying ceph disk
this allows the disk to be reused as ceph disk by zeroing the first 200M
of the destroyed disk. disks are iterated separately from partitions to
prevent duplicate wipes.

Signed-off-by: David Limbeck <d.limbeck@proxmox.com>
2018-10-24 11:46:13 +02:00
Wolfgang Link
29f633a8b1 pveceph: remove 'btrfs' as fstype for new OSDs
btrfs is deprecated since Luminous and it will no more be tested.

If btrfs is used, you have to add an extra parameter to ceph.conf
to allow ceph-disk to activate btrfs OSD's.
In our default config this is not the case.

From Luminous release note [1]:

"We no longer test the FileStore ceph-osd backend in combination with
btrfs. We recommend against using btrfs. If you are using
btrfs-based OSDs and want to upgrade to luminous you will need to
add the follwing to your ceph.conf:

enable experimental unrecoverable data corrupting features = btrfs
The code is mature and unlikely to change, but we are only
continuing to test the Jewel stable branch against btrfs. We
recommend moving these OSDs to FileStore with XFS or BlueStore."

[1] https://ceph.com/releases/v12-2-0-luminous-released/
2018-08-31 08:15:43 +02:00
Fabian Grünbichler
9f4ff79860 pveceph: add missing use statement 2017-11-30 11:31:35 +01:00
Thomas Lamprecht
9aad4e2e79 ceph: create mon: fix & improve check if IP is in public net
If a CIDR gets passed to Net::IP it is expected to not be from the
middle of  an subnet, i.e., 192.168.1.12/24 is *not* OK but
192.168.1.0/24 would be OK.

As the Network/interfaces files also accepts CIDR notation for the
'address' param (now also for IPv4) this let to problems in our node
monitor IP detection code, which used the interface file and Net::IP to
find any address from the ceph public network.

So change to our newer helper PVE::Network::get_local_ip_from_cidr to
get all configured and ready (=up) IPs from this network.

Also handle the case where multiple networks where returned, add a
parameter to allow specifying one of those and ask the user to do so.

If no public network is configured and no mon-address parameter was
passed, we fall back to the remote node IP of the node, as was done
previously. We expect that the user only overwrites the mon-address
if he knows what he do and omit checks here.
2017-11-28 16:46:31 +01:00
Thomas Lamprecht
68f4def420 ceph: create pool: check for quorum at start
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2017-11-28 16:13:50 +01:00
Alwin Antreich
dae96e48dc Fix: #1542, use percent_used key instead of calculation
Signed-off-by: Alwin Antreich <a.antreich@proxmox.com>
2017-10-31 08:21:32 +01:00
Dominik Csapak
815a2bc1a7 make bluestore the default on the api
with this we also have to send '0' to from the frontend, when the
bluestore checkbox is not checked

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2017-10-20 12:01:41 +02:00
Fabian Grünbichler
8ccae777f0 ceph: disable OSD unit in destroyosd
while OSDs units should only be runtime enable and disappear on reboots,
this serves as an additional safeguard to ensure no leftover units can
exist.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2017-10-10 12:17:17 +02:00
Fabian Grünbichler
f4fe197db4 ceph: correctly parse 'pg dump' output
Reported-By: Waschbüsch IT-Services GmbH <service@waschbuesch.it>
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2017-10-10 12:16:43 +02:00
Dominik Csapak
1fb090840d ceph: do not automatically use wal if only journal is given
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2017-09-07 12:35:14 +02:00
Fabian Grünbichler
0a521b6634 ceph/destroypool: move image check into worker
vdisk_list can potentially take very long, and we don't want
the API request to time out.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2017-09-07 11:38:20 +02:00
Fabian Grünbichler
8c42620460 ceph: make create/destroypool API paths async
in order to get task log entries and easily accessible
task/error logs.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2017-09-07 11:38:20 +02:00
Fabian Grünbichler
c75f019a55 ceph/destroypool: refactor to use get_storages
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2017-09-07 11:38:20 +02:00
Fabian Grünbichler
f6144f3493 ceph/destroypool: optionally remove storages
only storages which don't have the 'monhost' option set are removed

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2017-09-07 11:38:20 +02:00
Fabian Grünbichler
60811ad7eb ceph/createpool: optionally add storages
introduce new API parameter 'add_storages'. if set, one
storage each is configured using the created pool:
- for containers using KRBD
- for VMs using librbd

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2017-09-07 11:38:20 +02:00
Fabian Grünbichler
0c0d43a7cc ceph: create/destroypool: shorten variable name
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2017-09-07 11:38:20 +02:00
Fabian Grünbichler
f4aae93bbf ceph: add get_storages helper
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2017-09-07 11:38:20 +02:00
Fabian Grünbichler
ae672a64ce ceph: add add_storage helper
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2017-09-07 11:38:20 +02:00
Fabian Grünbichler
e16cd81fb5 pveceph/init: improve version check error message 2017-08-25 14:16:09 +02:00
Alwin Antreich
c64c04dd39 implement checks for ceph version & binaries
add version check to ceph init to require luminous or higher and
fix #1481: check existence of ceph binaries before use

Signed-off-by: Alwin Antreich <a.antreich@proxmox.com>
2017-08-25 13:46:42 +02:00
Dominik Csapak
6c11e92154 ceph: add application parameter to createpool
and use 'rbd' by default, since we cannot create a cephfs or
rgw from the gui currently

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2017-08-10 09:38:29 +02:00
Dominik Csapak
6747b0a903 ceph: make size 3/min 2 default with createpool
in the gui this is already the default, so make it also the default
in the backend (also 2/1 is really bad as a default)

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2017-08-10 09:38:29 +02:00
Dominik Csapak
4d422ffc3e add bluestore information to osd api call
this adds information about bluestore (which devices and if
bluestore/filestore) to show in the gui

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2017-08-07 14:52:02 +02:00
Dominik Csapak
c9508b5d4c also get the crush rule name in the ceph pool list
we get the names in the backend, and give them as an additional field
in the api call, and use it in the grid

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2017-07-31 15:25:34 +02:00
Dominik Csapak
d2692b86e2 fix #1465: use a combobox for the crush rule instead of the id
this patch does a few things

1. we introduce a new api call /nodes/nodename/ceph/rules
   which gets us a list of crush rules

2. we introduce a new CephRuleSelector which is a simple combobox
   with the data from the api call ceph/rules

3. we use this in the create pool window

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2017-07-31 15:25:34 +02:00
Dominik Csapak
2db28c036e make crush rules working again
since ceph 12.1.1 the (deprecated) parameter 'crush_ruleset' is removed
and replaced with 'crush_rule' while changing this, change from
integer to string so that we can later use the names of the rules
instead of the id

(for now there seems to be a bug that you can only use the name and
not the id)

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2017-07-31 15:25:34 +02:00
Dominik Csapak
33a7e15766 add osd device class to osd tree
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2017-07-31 15:25:34 +02:00
Dominik Csapak
bb7d5aa955 correctly remove partitions for ceph bluestore osds
we now have to remove 5 types of partitions:

data/metadata
journal
block
block.db
block.wal

this patch fixes the detection of block/block.db/block.wal
generalizes it

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2017-07-31 15:25:34 +02:00
Dominik Csapak
8d64bd8c3b enable using a device for bluestore block db/wal
we reuse the 'journal_dev' parameter for bluestores block.db
and add a new parameter 'wal_dev' for bluestores write ahead log

if only journal_dev is given, use it for both db and wal

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2017-07-31 15:25:34 +02:00
Dominik Csapak
87eb0fc205 fix creating the first ceph monitor
we cannot use a rados connection before having at least one monitor,
so we have to move it down

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2017-07-27 15:14:21 +02:00
Dominik Csapak
b0e5ae21cf add missing '-' to service name pattern
since ids can contain '-', we have to include them in the pattern
for the service names

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2017-07-26 16:51:09 +02:00
Dominik Csapak
be753927e7 whitespace cleanup
and intendation fix

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2017-07-26 14:45:07 +02:00
Dominik Csapak
ca68ac3efd pveceph: add createmgr/destroymgr commands
this patch adds the create-/destroymgr commands to the api and pveceph,
so that advanced users can split monitor and manager daemons

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2017-07-26 14:45:07 +02:00
Dominik Csapak
c05ff7b4de pveceph: create mgr with mon, use nodename for id
we now want to add a ceph-mgr daemon to every node where a ceph-mon
daemon runs, as per ceph documentation recommendation, because in
luminous the mgr daemons will not be automatically created/started
with a monitor anymore

we also give the createmon an optional id parameter, so that one
can set a custom id, and make the creation/removal of the manager
optional but the default

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2017-07-26 14:45:07 +02:00
Dominik Csapak
84caf265bd add health detail to ceph status api call
with ceph 12.1.1 luminous, ceph has reorganized its json
interface of the ceph status and ceph health call

so to get everything we need, we have to also get
the ceph health detail information into our
status call

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2017-07-24 16:10:24 +02:00
Wolfgang Link
b6c427261c Fix pveceph createosd
The --filestore flag is now required see doc of ceph.

If the --bluestore argument is given, a bluestore objectstore will be
created.  If --filestore is provided, a legacy FileStore objectstore
will be created.  If neither is specified, we default to BlueStore.
2017-07-19 12:40:28 +02:00
Fabian Grünbichler
d197634b4b ceph: keys: add mgr allow * to client.admin
needed for data that now gets queried via the mgr instead of
via the mon.
2017-06-27 16:42:35 +02:00
Fabian Grünbichler
50239dba68 pveceph: createosd: allow to create bluestore OSDs 2017-06-27 16:15:44 +02:00
Fabian Grünbichler
207f493293 pveceph: init: add min_size, change default to 3/2
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2017-06-27 16:15:44 +02:00
Fabian Grünbichler
2e9d791ee6 ceph: init: allow pool deletion by default
set to false by default since Ceph > Kraken

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2017-06-27 14:53:17 +02:00
Fabian Grünbichler
4280f25c17 ceph: init: rename disable-cephx to disable_cephx
for consistency
2017-05-03 11:37:08 +02:00
Fabian Grünbichler
97f050bb79 ceph: init: add warning to disable-cephx 2017-05-03 10:27:24 +02:00
Alexandre Derumier
77bb90b03b ceph: init: add optional disable-cephx option
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2017-05-03 10:27:18 +02:00
Alexandre Derumier
d70e3c4860 ceph: init: remove filestore xattr use omap
it's not used anymore since emperor

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2017-05-03 10:26:25 +02:00
Fabian Grünbichler
8366363738 Ceph: allow bigger size and min_size in API 2017-04-03 12:06:55 +02:00
Fabian Grünbichler
cc5bb515ed ceph: create default keys when creating monitor
this used to be a separate service, but got dropped in
Kraken in favour of calling ceph-create-keys manually when
deploying a node.
2017-03-21 13:50:28 +01:00
Wolfgang Link
ef3d095b55 Change remove partition order.
If we remove first the journal the data partition will automatically mounted
and can't destroy the partition.
This is trigger by the udev ceph rule.
2016-12-22 12:26:10 +01:00
Wolfgang Link
84aed461aa Fix parsing block device.
Get the partition num and block device from sysfs.
This ensure different block device types will work.
2016-12-22 12:25:45 +01:00
Wolfgang Link
19bada0c96 Enable service for ceph monitor.
We do not use the ceph.service what normally start ceph-mon,
so we have to ensure ceph-mon is enabled.
2016-12-22 11:57:50 +01:00
Wolfgang Link
3279b1d2d4 Set correct permission for ceph user.
We have to set the correct permission,
because ceph greater than infernalis use ceph as daemon user.
2016-12-22 11:51:19 +01:00
Dominik Csapak
a46ad02adb add ceph flags api calls
we add a get/post/delete api call for ceph flags

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2016-11-30 17:08:38 +01:00
Dominik Csapak
85c17d9673 also return the ceph flags in osd api call
we want to set/get the flags in the ceph/osd tab, so we have to
return it there

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2016-11-30 17:07:14 +01:00
Dominik Csapak
107e872ac7 use correct info on disks in destroyosd and skip smart
instead of using
'/dev/${real_dev}'

we use the devpath property directly

also we skip the smart check in the cleanup

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2016-10-06 08:27:46 +02:00
Dominik Csapak
929376d778 fix #1099: get correct info on disks in createosd
instead of getting all disks, only get the info
from the one we get as parameter
and use the 'devname' value for the
ceph commands instead of the parameter itself
(this fixes the cciss!cXdY cciss/cXdY mismatch)

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2016-10-06 08:26:32 +02:00
Dominik Csapak
5fd5c30db7 do not get smart data for ceph disk list
on the ceph disks call, we do not need the smart
data, so set the nosmart flag

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2016-10-06 08:20:42 +02:00
Dominik Csapak
7f4924bd9b use the Diskmanage subs for ceph instead
the subs are now in PVE::Diskmanage, so use them

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2016-09-07 11:45:09 +02:00
Dominik Csapak
76dc2ad016 fix #1043: prevent ceph destroypool when in use
also introduces a force parameter to this call
if force is true, the call destroys the ceph pool
even when it is use

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2016-06-30 13:47:36 +02:00
Wolfgang Bumiller
98901f1d88 ceph: brackets around ipv6 2016-05-17 16:05:21 +02:00
Fabian Grünbichler
3cba09d570 docs: typo, newlines 2016-04-15 16:36:03 +02:00
Wolfgang Bumiller
4aed5e3e3a Fix #936: ceph: support multiple roots in osd tree
The OSD tree in our GUI otherwise only shows the "first"
root it finds in the crush map.
2016-04-13 08:40:49 +02:00
Thomas Lamprecht
90c75580b6 add permissions to allow non root ceph configuration
Do not only allow root@pam to admin ceph server as some user do not
want to allow root logins and users with the Sys.Modify permission
should be able to modify ceph related stuff.

We use basically the following permissions:
 Sys.Modify:
    for any delete, add, modify action (POST, PUT, DELETE)
 Sys.Audit and Datastore.Audit:
    for any status/information view action (GET)
 Sys.Log:
    for viewing the Ceph log (was already implemented)

We have two exceptions creating and destroying osds. Those may only
be done by 'root@pam' for security reasons.

Also show users with any of those capabilities the ceph tab in the
web GUI.

Addresses bug#818
2016-02-12 08:22:16 +01:00
Alexandre Derumier
fc78c972ef ceph.conf : remove auth_supported
It's not used since ceph 0.50,
replaced by the 3 others auth config options

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2016-01-22 11:24:15 +01:00
Wolfgang Link
6f9ea1c199 fix output percent_used in rbd pools
This fix is essential of cause json field changes in the ceph api.
They change the field size in pool to max_avail
and the field total_size in stats to total_max_avail
2015-09-09 06:41:54 +02:00
Wolfgang Bumiller
957a59b308 Ceph: fix old interfaces access in find_node_ip
Fixes #681
2015-08-12 09:43:03 +02:00
Wolfgang Bumiller
905c2f5176 PVE::API2::Ceph: network_interfaces update + ipv6 2015-06-26 08:53:09 +02:00
Dietmar Maurer
1f3e956a53 fix mon_command syntax for 'auth get' 2014-05-22 06:43:09 +02:00
Dietmar Maurer
5374d54f21 ceph: fix percent_used 2014-01-23 17:29:14 +01:00
Dietmar Maurer
cc81005afd ceph: view osd commit/apply latency 2014-01-23 10:08:02 +01:00
Dietmar Maurer
941c019548 ceph: display osd usage 2014-01-23 09:38:29 +01:00
Dietmar Maurer
d54f1126b7 ceph: display pool usage information 2014-01-23 08:28:26 +01:00
Dietmar Maurer
7d4fc5ef92 ceph: add API and buttons for osd in/out
And move OSD API into separate package PVE::API2::CephOSD
2014-01-22 12:44:52 +01:00
Dietmar Maurer
a34866f031 split out ceph code into PVE::CephTools 2014-01-22 09:33:15 +01:00
Dietmar Maurer
2f80464060 use longer rados timeouts when inside worker tasks 2014-01-22 08:05:40 +01:00
Dietmar Maurer
f26b46dbcb ceph: re-open rados connection inside worker process 2014-01-21 12:11:25 +01:00
Dietmar Maurer
2aafa9ea6d ceph: untaint values for createosd 2014-01-21 11:21:46 +01:00
Dietmar Maurer
6e3c2f4764 ceph: use format 'plain' for call which do no return data 2014-01-21 07:44:41 +01:00
Dietmar Maurer
36fd0190c5 code cleanup 2014-01-20 08:55:35 +01:00
Dietmar Maurer
970236b3ec use PVE::RADOS perl bindings 2014-01-17 09:45:22 +01:00
Dietmar Maurer
a7a7fb00ac ceph: improve disk usage detection 2014-01-10 12:04:26 +01:00
Dietmar Maurer
0e5816e4d2 ceph: allow to specify separate journal disks 2014-01-10 09:04:48 +01:00
Dietmar Maurer
946662f65b ceph: allow to specify crush ruleset on pool creation 2014-01-03 11:40:53 +01:00
Dietmar Maurer
d6261e3122 ceph: only use 64 PGs by default (same default as ceph default pools) 2014-01-03 11:03:05 +01:00
Dietmar Maurer
190df9a105 ceph: try to unmount OSD after removal 2014-01-03 10:58:08 +01:00
Dietmar Maurer
8b336060cb ceph: return decompiled crush map in text format.
This is easier to read.
2014-01-03 10:46:59 +01:00
Dietmar Maurer
ace49d5357 avoid slash characters in task ids
Our REST API cannot handle that.
2013-12-31 12:47:40 +01:00
Dietmar Maurer
43d85563a7 pveceph: allow to specify fs-type 2013-12-31 08:12:20 +01:00
Dietmar Maurer
740895591f pveceph: allow to set min_size for pools 2013-12-31 08:04:26 +01:00
Dietmar Maurer
cee8e2b661 fix osd remove 2013-12-30 13:50:01 +01:00
Dietmar Maurer
f7e342ea2a ceph: allow to specify network 2013-12-21 10:18:17 +01:00
Dietmar Maurer
c56a583f4e use new --connect-timeout for ceph commands 2013-11-22 09:17:42 +01:00
Dietmar Maurer
52d7be4197 fix osd keyring, use tasks 2013-11-22 08:41:37 +01:00
Dietmar Maurer
88a6e29ad1 set correct keyring location for osd 2013-11-21 09:11:42 +01:00
Dietmar Maurer
0b1efc01d5 fix mds permissions in client.admin key 2013-11-21 07:34:30 +01:00
Dietmar Maurer
a08988dc48 allow to call ceph init multiple times 2013-11-20 11:28:23 +01:00
Dietmar Maurer
eac465a574 generate and save ceph fsid
add dependency on libuuid-perl
2013-11-20 10:48:22 +01:00
Dietmar Maurer
f3224487a3 avoid useles symlinks to ceph keyrings 2013-11-20 10:28:41 +01:00
Dietmar Maurer
c7881bf602 add ceph pool GUI 2013-11-20 07:53:43 +01:00