Commit Graph

633 Commits

Author SHA1 Message Date
Fabian Grünbichler
8e2b5110e5 ceph init: actually die on errors
instead of silently ignoring them

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2019-07-17 13:01:31 +02:00
Thomas Lamprecht
7c9f66d036 followup code cleanup
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-07-15 10:57:00 +02:00
Dominik Csapak
199aa9efb7 ceph: mon list: show only as running when monitor is quorate
nautilus puts non running monitors also in the monmap, so only show
as running when it has quorum

this is also not 100% correct, but the only 'correct' alternative is
to try and get/parse the systemd status of the units and broadcast it
to the pmxcfs

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2019-07-15 10:56:14 +02:00
Thomas Lamprecht
9cc5ac9e75 api/ceph: code cleanup
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-07-11 14:16:11 +02:00
Dominik Csapak
b7701301a8 api/ceph: add osd scrub api call
can be called to (deep) scrub a specific osd

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2019-07-11 14:16:06 +02:00
Dominik Csapak
47d13c02b0 fix #2267: delete address(6) and netmas(6) with cidr(6)
otherwise a user cannot delete an ip from an interface

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2019-07-08 19:19:15 +02:00
Dominik Csapak
21e413dc01 ceph: add api call for config database
simply returns the database content

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2019-07-05 09:52:58 +02:00
Thomas Lamprecht
93580fec68 use new url
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-07-04 17:57:27 +02:00
Dominik Csapak
351d128f80 ceph: mon create: add known monitor ips to mon_host if it is empty
this fixes an issue where only one monitor is in mon_host, which is
offline, prevents a client connection

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2019-07-04 09:57:50 +02:00
Dominik Csapak
217dde83f0 ceph: osd: use get-or-create to create a bootstrap-osd key on demand
if for some reason the cluster does not have this key, generate it

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2019-07-04 09:57:50 +02:00
Dominik Csapak
7712a4e151 ceph: osd create: check for auth before getting bootstrap key
we do not need it if auth is 'none'

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2019-07-04 09:57:50 +02:00
Thomas Lamprecht
8ec913c1cc followup: do not use string comparision for integers
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-07-03 15:34:19 +02:00
Tim Marx
2fb592ddbe api: ceph: automatically create manager after the first monitor
Signed-off-by: Tim Marx <t.marx@proxmox.com>
2019-07-03 15:34:19 +02:00
Fabian Grünbichler
50d5fd6ab0 ceph: init: fix undef var access
Fixes: d851d63ecc
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2019-07-03 15:10:02 +02:00
Dominik Csapak
d851d63ecc ceph: init: only handle keyring if auth is cephx
if auth is 'none' there is no client keyring, so do not generate it and
do not write it into the config

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2019-07-03 11:34:34 +02:00
Thomas Lamprecht
5dff9157df api: subscription: return https backed link
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-07-01 15:00:27 +02:00
Thomas Lamprecht
c92c54d54b api: backup pool: enforce VM.Backup permissions on pool also on create
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-06-28 20:04:04 +02:00
Thomas Lamprecht
16f5b2834e api: backup pool: enforce VM.Backup permissions on pool
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-06-28 19:29:46 +02:00
Tim Marx
f337626155 fix #1278 api: add pool backup option
Signed-off-by: Tim Marx <t.marx@proxmox.com>
2019-06-28 18:05:19 +02:00
Tim Marx
60e049c231 whitespace cleanup
Signed-off-by: Tim Marx <t.marx@proxmox.com>
2019-06-28 18:01:04 +02:00
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
Christian Ebner
200cef80ee backup jobs: Aquire lock before modifying vzdump.cron
Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
2019-06-25 11:43:31 +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
Dominik Csapak
3e4c0f06e7 ceph: init: lock ceph config
so that not multiple users can create a ceph cluster at the same time

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2019-06-18 16:17:35 +02:00
Dominik Csapak
b3d8b5f527 ceph: init: check for nautilus
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2019-06-18 16:17:35 +02:00
Dominik Csapak
52fea280cf ceph: init: update inital config for nautilus
since we do not support creating filestore osds anymore, drop
the journal size from the config

and move the keyring from global to client
this makes it possible to omit the osd keyring path
(which was the default but got overwritten from the global section)

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2019-06-18 16:17:35 +02:00
Thomas Lamprecht
7618913027 perl: fix some common typos found with codespell
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-06-15 10:40:20 +02:00
Alexandre Derumier
f31cc71c03 network api : reload : don't allow openswitch at all
ifupdown2 reload can't work with openswitch until we implement
ovs.

I don't think that too much users are mixing ovs && bridge anyway.

It's possible to use ifupdown2 with ovs for ifup/down with ifupdown script,
but config need to be changed, and I don't have tested too much.
(maybe add a conflict in ifupdown2 package with openvswitch package for now)

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2019-06-14 09:14:58 +02:00
Alexandre Derumier
feaf369e77 network api : reload : always reload
reload also if interfaces.new don't exist
(for vnet or other user change in different file)

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2019-06-14 09:14:58 +02:00
Alexandre Derumier
bf32b90e89 network api : reload : don't check bridge delete
we are doing it in ifupdown2 directly

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2019-06-14 09:14:58 +02:00
Alexandre Derumier
e46bf624d5 network api : reload : remove ifdown/up hack
This was for vxlan interfaces and fixed in ifupdown2 with my last patches.

simply reload network, and if we still have errors, we can use ifquery to check them later

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2019-06-14 09:14:58 +02:00
Thomas Lamprecht
f79372c0dc api: cluster/resources: add information about guest locks
using the new get_guest_config_property helper from pve-cluster,
which allows us to get this info with relatively low overhead.

With a somewhat realistic setup of 303 guest configurations here my
API call timing changes from ~ 24 to 26 ms without this to 26 to 28
ms with this patch applied, which seems reasonable.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-06-13 11:11:38 +02:00
Thomas Lamprecht
68f371d4d1 fixup: while not an error here a trailing semicolon is good to have
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-06-13 11:08:28 +02:00
Thomas Lamprecht
0f6e6f6b5c api network: make IPv6 address checking spew out useful errors
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-06-13 11:06:15 +02:00
Dominik Csapak
4ce045788a ceph: osd create: add encrypted as parameter
uses cpeh-volumes --dmcrypt parameter to encrypt the osd

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2019-06-11 12:58:24 +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
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