]> git.proxmox.com Git - pve-cluster.git/log
pve-cluster.git
4 years agofix #2479: use correct sub in create_conf
Oguz Bektas [Fri, 22 Nov 2019 15:21:44 +0000 (16:21 +0100)]
fix #2479: use correct sub in create_conf

'pvecm create' fails since the subroutine doesn't exist in PVE::Cluster
but in PVE::Corosync

Signed-off-by: Oguz Bektas <o.bektas@proxmox.com>
4 years agocorosync: die in check_conf_exists if !$noerr
Stefan Reiter [Tue, 19 Nov 2019 09:28:29 +0000 (10:28 +0100)]
corosync: die in check_conf_exists if !$noerr

...and change $silent to $noerr for consistency.

Commit 3df092f9 (fix #1380: pvecm status: add general cluster
information) broke "pvecm status" on non-cluster nodes (well, it made
the error look worse, ofc it didn't "work" before either) because it
tries to access a totem that cannot exist without a corosync.conf.

pvecm status/nodes/expected already fail without a cluster, so it makes
more sense to fail early. But instead of copying the way the qdevice API
handles it, move the die to check_conf_exists directly, which makes
more sense then a warn anyway IMHO.

check_conf_exists is never called without $noerr = 1 outside of
pvecm.pm, so this change does not require any versioned depends/breaks.

Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
4 years agopvecm: move assert_joinable to avoid double call
Stefan Reiter [Tue, 19 Nov 2019 09:28:28 +0000 (10:28 +0100)]
pvecm: move assert_joinable to avoid double call

PVE::Cluster::Setup::join already calls assert_joinable, we only need the
explicit call in pvecm if we fall back to SSH.

Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
4 years agopvecm: fix weirdly spaced double-prompt for password on join
Stefan Reiter [Tue, 19 Nov 2019 09:28:27 +0000 (10:28 +0100)]
pvecm: fix weirdly spaced double-prompt for password on join

Not only did it display two prompts with identical meaning, the second
was indented to the end of the first in my terminal for some reason.

Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
4 years agocorosync config: avoid cyclic reference in closure
Thomas Lamprecht [Tue, 19 Nov 2019 15:03:45 +0000 (16:03 +0100)]
corosync config: avoid cyclic reference in closure

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agobump version to 6.0-8
Fabian Grünbichler [Mon, 11 Nov 2019 10:28:07 +0000 (11:28 +0100)]
bump version to 6.0-8

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agod/control: update breaks versions to actual one
Thomas Lamprecht [Mon, 18 Nov 2019 11:27:03 +0000 (12:27 +0100)]
d/control: update breaks versions to actual one

ha-manager and pve-manager got bumped during this series development,
so reflect that by updating the breaks versions, to not leave a gap
here.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agofix some lintian warning about Package description/synopsis
Thomas Lamprecht [Mon, 18 Nov 2019 10:47:17 +0000 (11:47 +0100)]
fix some lintian warning about Package description/synopsis

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agod/control: make api lib depend on the same version as cluster lib
Thomas Lamprecht [Mon, 18 Nov 2019 10:46:35 +0000 (11:46 +0100)]
d/control: make api lib depend on the same version as cluster lib

As they need to be the same to work, else some half-upgrades or
half-downgrades can be done, which may break stuff badly. So tell
apt/dpkg about the relation ship be doing a hard version dependency
on ${binary:Version} which is our currently build package version

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agopve-cluster.service: move pvecm call to pveproxy.service
Fabian Grünbichler [Mon, 11 Nov 2019 10:28:06 +0000 (11:28 +0100)]
pve-cluster.service: move pvecm call to pveproxy.service

since that is were we actually require a certificate/key to be present

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
4 years agosplit package into pve-cluster/pmxcfs and perl modules
Fabian Grünbichler [Mon, 11 Nov 2019 10:28:05 +0000 (11:28 +0100)]
split package into pve-cluster/pmxcfs and perl modules

with the former containing:
- pmxcfs binary + service
- IPCC perl bindings
- PVE::Cluster

and the latter being further split into

libpve-cluster-perl:
- PVE::DataCenterConfig
- various other perl modules not directly related to pmxcfs

and libpve-cluster-api-perl:
- ClusterConfig API
- pvecm CLI
- PVE::Corosync
- PVE::Cluster::Setup helper module

this second split is needed to avoid a (pre-existing) circular
dependency between libpve-access-control and libpve-cluster-perl:
- the cluster API code uses PVE::RPCEnvironment
- the access-control API code uses PVE::DataCenterConfig

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
4 years agod/control: add versioned breaks
Fabian Grünbichler [Mon, 11 Nov 2019 10:28:04 +0000 (11:28 +0100)]
d/control: add versioned breaks

for all the refactored/moved code

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
4 years agomove ssh_info code to own file
Fabian Grünbichler [Mon, 11 Nov 2019 10:28:03 +0000 (11:28 +0100)]
move ssh_info code to own file

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
4 years agodatacenter.cfg: parse/print u2f property string
Fabian Grünbichler [Mon, 11 Nov 2019 10:28:02 +0000 (11:28 +0100)]
datacenter.cfg: parse/print u2f property string

when parsing config, like other property strings stored in this file.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
4 years agomove datacenter.cfg to own file
Fabian Grünbichler [Mon, 11 Nov 2019 10:28:01 +0000 (11:28 +0100)]
move datacenter.cfg to own file

and inline get_local_migration_ip into 'pvecm mtunnel', since all the
other callers are either wrong or have different requirements.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
4 years agomove CertCache to pve-manager
Fabian Grünbichler [Mon, 11 Nov 2019 10:28:00 +0000 (11:28 +0100)]
move CertCache to pve-manager

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
4 years agomove certificate cache to own file
Fabian Grünbichler [Mon, 11 Nov 2019 10:27:59 +0000 (11:27 +0100)]
move certificate cache to own file

and just keep node to certificate path helper in PVE::Cluster.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
4 years agomove corosync_link schema to Corosync.pm
Fabian Grünbichler [Mon, 11 Nov 2019 10:27:58 +0000 (11:27 +0100)]
move corosync_link schema to Corosync.pm

since it can be/is already used by all relevant files, and it is not
related at all to pmxcfs.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
4 years agomove cluster setup related code to own file
Fabian Grünbichler [Mon, 11 Nov 2019 10:27:57 +0000 (11:27 +0100)]
move cluster setup related code to own file

this includes:
- directory setup
- ssh setup (known hosts, keys, config)
- CA/certificate helpers
- join helpers used by API and CLI code

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
4 years agomove RRD creating into own file
Fabian Grünbichler [Mon, 11 Nov 2019 10:27:56 +0000 (11:27 +0100)]
move RRD creating into own file

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
4 years agod/control: add missing build-depends
Fabian Grünbichler [Mon, 11 Nov 2019 10:27:55 +0000 (11:27 +0100)]
d/control: add missing build-depends

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
4 years agouse PVE::Certificate to read fingerprint
Fabian Grünbichler [Wed, 6 Nov 2019 12:36:08 +0000 (13:36 +0100)]
use PVE::Certificate to read fingerprint

instead of duplicating the whole "read certificate from file" code that
we already have in pve-common.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
4 years agoremove unused Data::Dumper import
Fabian Grünbichler [Wed, 6 Nov 2019 12:36:07 +0000 (13:36 +0100)]
remove unused Data::Dumper import

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
4 years agodc.conf: add missing entries to default language property (he, da)
Thomas Lamprecht [Sat, 5 Oct 2019 11:46:28 +0000 (13:46 +0200)]
dc.conf: add missing entries to default language property (he, da)

To bring it in sink with the one from widget-toolkit add Danish (da)
and Hebrew (he) to this, so user can set it as cluster wide default
language.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agodc.conf: sort languages for easier finding one
Thomas Lamprecht [Sat, 5 Oct 2019 11:41:58 +0000 (13:41 +0200)]
dc.conf: sort languages for easier finding one

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agofix #1380: pvecm status: add general cluster information
Thomas Lamprecht [Fri, 4 Oct 2019 07:26:38 +0000 (09:26 +0200)]
fix #1380: pvecm status: add general cluster information

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agobump version to 6.0-7
Thomas Lamprecht [Mon, 2 Sep 2019 09:08:06 +0000 (11:08 +0200)]
bump version to 6.0-7

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agopmxcfs: dcdb: fix returned pointer value:
Wolfgang Bumiller [Mon, 2 Sep 2019 08:47:32 +0000 (10:47 +0200)]
pmxcfs: dcdb: fix returned pointer value:

Commit 926f961f62f5 used a new temporary pointer variable
for type correctness, but the return value was still using
the previous variable which had not been moved forward
anymore.

Fixes: 926f961f62f5 ("pmxcfs dcdb: fix pointer void* aritmethic")
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
4 years agobump version to 6.0-6
Thomas Lamprecht [Fri, 30 Aug 2019 12:46:49 +0000 (14:46 +0200)]
bump version to 6.0-6

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agopmxcfs server: fix off-by-one error when ensuring string NUL termination
Thomas Lamprecht [Thu, 29 Aug 2019 14:59:55 +0000 (16:59 +0200)]
pmxcfs server: fix off-by-one error when ensuring string NUL termination

done once, then copied over by copy-is-my-hobby, once by me too :)

While this is in the relative big SHM we get from the libqb backed
IPC mechanisms, and thus there's a really really low chance to hit a
corruption of another following data element here, it's still a
possibility.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agopmxcfs: cleanup remaining_size calculation
Wolfgang Bumiller [Fri, 30 Aug 2019 08:09:46 +0000 (10:09 +0200)]
pmxcfs: cleanup remaining_size calculation

using an end-pointer it's a bit more readable and gets rid
of an (int) cast

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
4 years agopmxcfs: get config properties: ensure we do not read after the config
Thomas Lamprecht [Thu, 29 Aug 2019 12:45:08 +0000 (14:45 +0200)]
pmxcfs: get config properties: ensure we do not read after the config

pmxcfs files need to be treated as blobs, while we can have some
assumptions on certain files, like the $vmid.conf ones, we should
still cope with problematic files.
Especially, the files may not end with \0, so always ensure that we
read at most file-size bytes.

Replace strtok_r, which assumes that the data is NUL terminated, and
use memchr, with logic ensuring that we never read over the size
returned by memdb_read.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
4 years agopmxcfs: fixup dcdb pointer void* aritmethic fix
Thomas Lamprecht [Fri, 30 Aug 2019 05:45:28 +0000 (07:45 +0200)]
pmxcfs: fixup dcdb pointer void* aritmethic fix

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
(cherry picked from commit be072d67c81373a59913a5df729788eaea53619e)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agocheck_memdb: free data to allow building with memory leak sanitizer
Thomas Lamprecht [Thu, 29 Aug 2019 17:45:18 +0000 (19:45 +0200)]
check_memdb: free data to allow building with memory leak sanitizer

while this "memory leak" was irrelevant (short running anyway, so the
OS could clean up after us just fine) let's free the malloced stuff
nonetheless - this allows to build with -fsanitize=address and
-fsanitize=undefined

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agocfs-utils cluster_config_version: actually enforce config_length when matching
Thomas Lamprecht [Thu, 29 Aug 2019 17:40:45 +0000 (19:40 +0200)]
cfs-utils cluster_config_version: actually enforce config_length when matching

Fix out-of-bound read found with AddressSanitizer

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agopmxcfs database: tree struct member name is array, and cannot be false
Thomas Lamprecht [Thu, 29 Aug 2019 15:11:26 +0000 (17:11 +0200)]
pmxcfs database: tree struct member name is array, and cannot be false

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agopmxcfs build: enable -Wpedantic
Thomas Lamprecht [Thu, 29 Aug 2019 14:57:30 +0000 (16:57 +0200)]
pmxcfs build: enable -Wpedantic

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agopmxcfs server: fix pointer void* aritmethic
Thomas Lamprecht [Thu, 29 Aug 2019 14:50:32 +0000 (16:50 +0200)]
pmxcfs server: fix pointer void* aritmethic

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agopmxcfs: server: move request id and size in own variable
Thomas Lamprecht [Thu, 29 Aug 2019 14:36:07 +0000 (16:36 +0200)]
pmxcfs: server: move request id and size in own variable

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agopmxcfs: fix more void pointer arithmetic
Thomas Lamprecht [Thu, 29 Aug 2019 14:27:39 +0000 (16:27 +0200)]
pmxcfs: fix more void pointer arithmetic

To be able to finally enable -Wpedantic during compile in a future
patch. This ensures that the arithmetic actually happens on byte
granularity, while void* is undefined.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agopmxcfs status: fix pointer void* aritmethic
Thomas Lamprecht [Thu, 29 Aug 2019 14:21:59 +0000 (16:21 +0200)]
pmxcfs status: fix pointer void* aritmethic

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agopmxcfs dcdb: fix pointer void* aritmethic
Thomas Lamprecht [Thu, 29 Aug 2019 14:20:25 +0000 (16:20 +0200)]
pmxcfs dcdb: fix pointer void* aritmethic

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agopmxcfs build: do not pass CFLAGS to linker stage
Thomas Lamprecht [Thu, 29 Aug 2019 14:56:50 +0000 (16:56 +0200)]
pmxcfs build: do not pass CFLAGS to linker stage

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agobump version to 6.0-5
Fabian Grünbichler [Wed, 7 Aug 2019 08:49:36 +0000 (10:49 +0200)]
bump version to 6.0-5

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
4 years agofollowup: code cleanup
Thomas Lamprecht [Wed, 17 Jul 2019 10:48:45 +0000 (12:48 +0200)]
followup: code cleanup

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agoAPI: correctly propagate $@ with nested locks
Fabian Grünbichler [Tue, 16 Jul 2019 13:43:18 +0000 (15:43 +0200)]
API: correctly propagate $@ with nested locks

PVE::Cluster::cfs_lock_file sets $@ and returns undef for all errors,
including when $code dies. PVE::Tools::lock_file runs $code inside an
eval as well, so just setting $@ is not enough when nesting these two
types of locks.

re-die with the inner error to actually propagate error messages and
fail instead of proceeding. this triggered (probably among other cases)
when attempting to join an existing cluster without specifying all
needed links.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
4 years agomake: fix upload target
Fabian Grünbichler [Wed, 3 Jul 2019 06:44:30 +0000 (08:44 +0200)]
make: fix upload target

to correctly reference dbgsym package

4 years agobump version to 6.0-6
Fabian Grünbichler [Tue, 2 Jul 2019 08:37:39 +0000 (10:37 +0200)]
bump version to 6.0-6

4 years agocorosync: refactor and reuse IP RE matching
Fabian Grünbichler [Tue, 2 Jul 2019 08:19:52 +0000 (10:19 +0200)]
corosync: refactor and reuse IP RE matching

this avoids calling getaddrinfo for the usual case of plain IPs, and
makes the code a bit easier to read as well.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
4 years agocorosync: stylistic changes
Fabian Grünbichler [Tue, 2 Jul 2019 08:05:57 +0000 (10:05 +0200)]
corosync: stylistic changes

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
4 years agoAdd functions to resolve hostnames and iterate corosync nodes
Stefan Reiter [Mon, 1 Jul 2019 15:22:14 +0000 (17:22 +0200)]
Add functions to resolve hostnames and iterate corosync nodes

The sub 'for_all_corosync_addresses' iterates through all nodes in a
passed corosync config and calls a specified function for every ringX_addr
on every node it finds (provided the IP-version matches the specified
one or undef was specified).

All ringX_addr entries that cannot be parsed as an IP address will be
best-effort resolved as hostnames. This has to happen in the exact same
way as corosync does internally, to ensure consistency with firewall
rules.

Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
4 years agoadd qdevice status api call
Oguz Bektas [Mon, 1 Jul 2019 16:31:01 +0000 (18:31 +0200)]
add qdevice status api call

Signed-off-by: Oguz Bektas <o.bektas@proxmox.com>
4 years agobump version to 6.0-3
Thomas Lamprecht [Thu, 27 Jun 2019 09:17:20 +0000 (11:17 +0200)]
bump version to 6.0-3

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agoRevert "pvecm: remove mtunnel"
Thomas Lamprecht [Thu, 27 Jun 2019 09:15:56 +0000 (11:15 +0200)]
Revert "pvecm: remove mtunnel"

This reverts commit 7a415f9657e68114c29b0bd1cad52283c203950a.
For now we have to many bad users of that, they all never should have
used this in the first place, but it slipped in so here we are..

4 years agobump version to 6.0-2
Thomas Lamprecht [Tue, 25 Jun 2019 10:30:27 +0000 (12:30 +0200)]
bump version to 6.0-2

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agoapi: join info: we still get ring0_addr in nodelist
Thomas Lamprecht [Tue, 25 Jun 2019 10:28:49 +0000 (12:28 +0200)]
api: join info: we still get ring0_addr in nodelist

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agopmxcfs: workaround dumb g_string_free behaviour
Thomas Lamprecht [Mon, 24 Jun 2019 10:44:51 +0000 (12:44 +0200)]
pmxcfs: workaround dumb g_string_free behaviour

While GLib mentions that this method is nullable[0][1] (i.e., can be passed
and can return null) its use of the, a bit misleading,
g_return_val_if_fail[2] voids that, as passing NULL emits an
warning[2] which looks pretty grave (assertion failure), albeit is
just noise..

[0]: https://developer.gnome.org/glib/stable/glib-Strings.html#g-string-free
[1]: https://salsa.debian.org/gnome-team/glib/blob/debian/2.58.3-2/glib/gstring.c#L196
[2]: https://developer.gnome.org/glib/stable/glib-Warnings-and-Assertions.html#g-return-val-if-fail

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agopmxcfs: get guest cfg properties: use g_string_sized_new
Thomas Lamprecht [Mon, 24 Jun 2019 10:42:20 +0000 (12:42 +0200)]
pmxcfs: get guest cfg properties: use g_string_sized_new

While with NULL as first argument g_string_new_len effectively
becomes a g_string_sized_new it can be confusing as the docs do not
mention that. Also this may lead to an error if one changes the call
with out to much research, so fix it to the one function we should
used to begin with here.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agoadd 'sdn.cfg' && 'sdn.cfg.new' to observed files
Alexandre Derumier [Wed, 19 Jun 2019 16:01:23 +0000 (18:01 +0200)]
add 'sdn.cfg' && 'sdn.cfg.new' to observed files

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
4 years agobump version to 6.0-1
Thomas Lamprecht [Fri, 14 Jun 2019 18:13:05 +0000 (20:13 +0200)]
bump version to 6.0-1

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agoremove now unused old corosync ringX_addr formats
Thomas Lamprecht [Tue, 28 May 2019 16:14:47 +0000 (18:14 +0200)]
remove now unused old corosync ringX_addr formats

no users of this anymore, so drop it.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agonode join: use new corosync link parameters
Thomas Lamprecht [Tue, 28 May 2019 16:14:18 +0000 (18:14 +0200)]
node join: use new corosync link parameters

Similar to the change to cluster creation use now also the
corosync-link definition for the rest of the cluster join/add calls.

As link0, former ring0, is not special anymore allow that it's not
passed and only default back to nodename if it's configured in the
totem section of the configuration.

As the 'join' and 'addnode' api paths are quite connected, do all in
one patch.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agocorosync: allow to set link priorities
Thomas Lamprecht [Tue, 28 May 2019 16:13:22 +0000 (18:13 +0200)]
corosync: allow to set link priorities

For now in passive mode, a link with a higher value has a lower
priority. If the current active link fails the one with the next
higher priority will take over. Use 255 as maximum, as internally
kronosnet uses an uin8_t variable for this, and while there can be
"only" 8 links currently it may be still nice to use different values
that ]0..1[ for them, e.g., when re-shuffling link priorities it's
useful to have space between them.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agocluster create: use new corosync-link format for totem interfaces
Thomas Lamprecht [Tue, 28 May 2019 16:07:05 +0000 (18:07 +0200)]
cluster create: use new corosync-link format for totem interfaces

Preparation for enhanced compatibility with new corosync 3/knet
transport. Pretty straight forward switch from ringX_addr to links,
*but*, for configuration backward compatibility corosync still uses
"ringX_addr" as "link address", this will surely add confusion...

We drop all the "all IP versions must match" checking code, as
1. it could not cope with unresolved hostname's anyway
2. links can be on different IP versions with kronosnet

This makes it a bit easier and shorter, we can re-add some (saner)
checking always later on, if people misconfigure this often..

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agoadd new corosync-link format
Thomas Lamprecht [Tue, 28 May 2019 16:04:04 +0000 (18:04 +0200)]
add new corosync-link format

use a format string this time, so we can drop the parameter count a
bit. With address as default_key we can still use it conveniently
from CLI.

There will be the link priority flag added in a future patch.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agocorosync config: support 'linknumber' property
Thomas Lamprecht [Mon, 27 May 2019 16:08:47 +0000 (18:08 +0200)]
corosync config: support 'linknumber' property

Corosync has moved its rings a layer up, i.e., abstracted away from
the network layer below. That what early were called rings are now
links, knet can have up to 8 all others 1, for now.

Let our parser understand this change in the totem section of the
config, but keep backwards compatibility and accept 'ringnumber'
also.

While we are at it, try to write out the two map operations used in a
bit more readable way.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agopmxcfs: get config property: escape double quote and backslash
Thomas Lamprecht [Thu, 13 Jun 2019 07:01:59 +0000 (09:01 +0200)]
pmxcfs: get config property: escape double quote and backslash

This are the most relevant from as the bite JSON really and can in
theory be in our configuration property values.

While technically a literal \t, \b, \f, \r (but not \n) can be an
issue too, this values normally really do not get written into the
config by our stack, if it has been manually added, but that's off
limits. If we really need it we can add it always in the future

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agoadd get_guest_config_property IPCC method
Thomas Lamprecht [Thu, 13 Jun 2019 07:01:58 +0000 (09:01 +0200)]
add get_guest_config_property IPCC method

This adds a new method to our IPCC interface.
It's a helper to get a property of a single or all guests.

It is restricted to only look at the current config state only, i.e.,
no PENDING changes and no snapshots, this is by design and wanted.
It uses the strict config format to be quick and return/continue
early, those restrictions are imposed by
PVE::QemuServer::parse_vm_config, and the container counterpart, it
mostly boils down to the following regex:
/^([a-z][a-z_]*\d*):\s*(.+?)\s*$/
and the fact that this is applied directly on the config lines (no
whitespace trimming, in any way, happens before)

Motivation for this work is to get the lock state of all guests
_quick_, allowing us to pass this info in our resource call, and
enhance the tree view of our Web User Interface with that
information. It was kept a bit more general, without bending the code
to much. The call returns a serialized JSON object with the format:
VMID => { PROPERTY => PROPERTY_VALUE }
if the property was found in VMID configuration, a empty object will
be returned if it was not found.

If one passes 0 to the request all VM configurations will be
searched, only those with a match will be returned, in the same
manner as above.

So why a IPCC call and not perl handling of this? Well performance.
Dominik's proposed a perl + cfs_read_file approach[0], while this is
relatively short and in the (mostly) safer perl land it's pretty
slow, especially on first connections. The idea for this existed
since quite a bit in my head, but Dominik's patch put it in front and
a prototype of this was born soon after that, initial evaluation and
performance comparison showed a speedup of >100 times at the initial
gathering, as [0] really benefits from the ccache afterwards, and
that _is_ a cache which gets often used and hit more "serial runs"
(i.e., in same worker) make his approach more reasonable, though.
But after a bit of work this came in not to ugly shape, and here the
numbers, with 10005 VM configs, all "real" ones with about 502 bytes
space usage, and all with a lock in the worst place, at the end.

Legend:
C0 : how many "serial runs" took place, i.e., how many runs in the
     same worker
C1: IPCC (this) approach total runtime in ms
C2: IPCC (this) approach per-run runtime in ms, i.e., C1 / C0
C3: Perl + cfs_read_file ([0]) approach total runtime
C4: Perl + cfs_read_file ([0]) approach per-run runtime, i.e., C3 / C0

Data:
C0   C1    C2     C3     C4
1 18.31 18.31 3570.29 3570.29
2 31.51 15.76 3717.69 1858.84
3 44.19 14.73 3821.84 1273.95
4 58.54 14.63 3950.24 987.56
5 70.31 14.06 4071.42 814.28
6 95.29 15.88 4175.95 695.99
7 95.87 13.70 4192.35 598.91
8 111.81 13.98 4346.84 543.36
9 120.84 13.43 4432.13 492.46
10 134.52 13.45 4554.25 455.42
11 149.74 13.61 4673.71 424.88
12 161.13 13.43 4797.56 399.80
13 172.74 13.29 4892.15 376.32
14 180.63 12.90 4951.17 353.66
15 199.04 13.27 5034.51 335.63

So, initially C beats Perl (not really correct wording, but hey) by
>200 times. But, on the second run we immediately see that while IPCC
scales almost linear the perl one doesn't, it really benefits from
the cache now, while initial call needed 3.5s this "only" needs ~200
ms more. But 200ms is still quite a bit of addition to an API call,
10k VMs are not seen to often in the wild, I guess, albeit it's
easily possible with setups using a lot of containers, here we know
about users having ~1500 CTs on only two nodes, so not completely
unrealistic either.

[0]: https://pve.proxmox.com/pipermail/pve-devel/2019-February/035830.html

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agopmxcfs: vminfo_type_to_string: fixup indendation and parenthesis
Thomas Lamprecht [Wed, 12 Jun 2019 15:02:37 +0000 (17:02 +0200)]
pmxcfs: vminfo_type_to_string: fixup indendation and parenthesis

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agopmxcfs: status: refactor out vminfo_type_to_string
Thomas Lamprecht [Wed, 8 May 2019 19:33:13 +0000 (19:33 +0000)]
pmxcfs: status: refactor out vminfo_type_to_string

will be re-used in a future patch and improves readabillity a little
bit, IMO

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agopvecm: remove mtunnel
Thomas Lamprecht [Tue, 4 Jun 2019 14:49:03 +0000 (16:49 +0200)]
pvecm: remove mtunnel

it was a mistake to move it here in the first place, and now we can
finally drop it again, as no PVE version can exist in 6.0, or latest
5.4 which still tries to use this one.
The one we will keep using is the one in qm from qemu-server, as
there we have full access to all it's perl modules without adding
cyclic dependencies.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agocorosync: config: write: die if we get a undefined value
Thomas Lamprecht [Tue, 28 May 2019 16:02:15 +0000 (18:02 +0200)]
corosync: config: write: die if we get a undefined value

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agoget_node_kv: unpack result from pmxcfs
Dominik Csapak [Mon, 27 May 2019 07:21:39 +0000 (09:21 +0200)]
get_node_kv: unpack result from pmxcfs

in 'broadcast_node_kv' we send the status and make sure its always
a scalar so it gets send as a null terminated string via pack(Z*)
when we get it back from pmxcfs we have to unpack(Z*) again, or
we get a string with a trailing '\0'

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
4 years agobuildsys: perlapi-X.Y gets set automatically by dh, so drop manual replace
Thomas Lamprecht [Sat, 25 May 2019 17:12:32 +0000 (19:12 +0200)]
buildsys: perlapi-X.Y gets set automatically by dh, so drop manual replace

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agofollouwp: fix and add comments + minor code cleanup
Thomas Lamprecht [Sat, 25 May 2019 15:21:20 +0000 (17:21 +0200)]
follouwp: fix and add comments + minor code cleanup

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agoadd generic data broadcast interface
Dominik Csapak [Thu, 16 May 2019 15:12:31 +0000 (17:12 +0200)]
add generic data broadcast interface

similar to how we handle the cluster wide tasklist and rrd data,
have an interface that can sync data across the cluster

this data is only transient and will not be written to disk

we can use this for a number of things, e.g. listing ceph services
across the cluster, etc.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
4 years agopmxcfs: make status entry removable
Dominik Csapak [Thu, 16 May 2019 15:12:30 +0000 (17:12 +0200)]
pmxcfs: make status entry removable

we can now do a CFS_IPC_SET_STATUS with no data, which results in
removal of the entry in the kv entries

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
4 years agod/control: remove obsolete dependencies
Thomas Lamprecht [Wed, 22 May 2019 10:25:05 +0000 (12:25 +0200)]
d/control: remove obsolete dependencies

the xml one should have been already removed by commit
77a620a8f9aa749580679dd687d233c52526b1f6 which removed it from the
build dependencies only..

rsyslog and lsb-base have no direct use here anymore

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agod/control: remove unnecessary build depends
Thomas Lamprecht [Wed, 22 May 2019 10:24:23 +0000 (12:24 +0200)]
d/control: remove unnecessary build depends

compat level 10 implies those, and autotools is not needed anymore

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agoremove workarounds for avoiding HA fencing on upgrade
Thomas Lamprecht [Tue, 21 May 2019 20:18:26 +0000 (22:18 +0200)]
remove workarounds for avoiding HA fencing on upgrade

those got introduced by commit
ec826d72c06e6f649b2b19c3341c39abb29b19f9 and can now be safely
removed, as current pve-cluster and pve-ha-manager do show this
problems, and upgrades need to go through latest PVE 5.X which then
ensures this is fixed.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agoremove maintscript for pve-cluster default conf
Thomas Lamprecht [Tue, 21 May 2019 20:15:39 +0000 (22:15 +0200)]
remove maintscript for pve-cluster default conf

upgraders are required to go through latest PVE 5.X which includes
executing this step, so we can remove it now here.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agod/control: update standards version
Thomas Lamprecht [Tue, 21 May 2019 15:58:19 +0000 (17:58 +0200)]
d/control: update standards version

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agobump debian compat level to 10
Thomas Lamprecht [Tue, 21 May 2019 15:57:08 +0000 (17:57 +0200)]
bump debian compat level to 10

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agobuildsys: switch upload dist over to buster
Thomas Lamprecht [Tue, 21 May 2019 16:12:48 +0000 (18:12 +0200)]
buildsys: switch upload dist over to buster

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agobump version to 6.0-0+1
Thomas Lamprecht [Tue, 21 May 2019 16:11:28 +0000 (18:11 +0200)]
bump version to 6.0-0+1

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agobuildsys: use dpkg-dev Makefile helpers for pkg info
Thomas Lamprecht [Tue, 21 May 2019 16:07:41 +0000 (18:07 +0200)]
buildsys: use dpkg-dev Makefile helpers for pkg info

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agobuildsys: reuse PERL_DOC_INC from pve-doc-generator
Thomas Lamprecht [Tue, 21 May 2019 15:54:06 +0000 (17:54 +0200)]
buildsys: reuse PERL_DOC_INC from pve-doc-generator

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agobump version to 5.0-37
Thomas Lamprecht [Tue, 30 Apr 2019 13:59:10 +0000 (13:59 +0000)]
bump version to 5.0-37

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
5 years agoupdate corosync build-dependency
Fabian Grünbichler [Fri, 19 Apr 2019 08:33:34 +0000 (10:33 +0200)]
update corosync build-dependency

transitional corosync-dev is dropped with Debian Buster / PVE 6

5 years agofix #1777: join: assert that local nodename bound IP is configured
Thomas Lamprecht [Mon, 15 Apr 2019 12:40:26 +0000 (12:40 +0000)]
fix #1777: join: assert that local nodename bound IP is configured

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
5 years agoassert_joinable: report what param caused the error
Thomas Lamprecht [Mon, 15 Apr 2019 12:39:25 +0000 (12:39 +0000)]
assert_joinable: report what param caused the error

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
5 years agopmxcfs: allow read access for www-data to /run dir
Thomas Lamprecht [Thu, 11 Apr 2019 05:46:09 +0000 (07:46 +0200)]
pmxcfs: allow read access for www-data to /run dir

There's no real sensible information here, and we naturally only
allow read, but no write/exec.

This makes our IPCC restart connection re-cachin heuristic also work
for processes run as www-data, e.g., pveproxy, and thus guarantee a
more seamless pmxcfs restart - e.g., for package updates.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
5 years agoipcc: increase restart grace period
Thomas Lamprecht [Thu, 11 Apr 2019 05:42:21 +0000 (07:42 +0200)]
ipcc: increase restart grace period

with bad timing and general restart overhead 5 secs were sometimes a
too small timeout, even if it happened really seldom. Increase it a
bit, as it's desired to have the connection stay a live in a lot of
cases, e.g., to not get logged out on pve-cluster update as
pveproxy's verify_ticked couldn't do IPCC.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
5 years agobump version to 5.0-36
Thomas Lamprecht [Wed, 10 Apr 2019 13:47:06 +0000 (15:47 +0200)]
bump version to 5.0-36

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
5 years agocleanup and sort use module section
Thomas Lamprecht [Wed, 10 Apr 2019 13:45:42 +0000 (15:45 +0200)]
cleanup and sort use module section

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
5 years agodatacenter: only print properties to string if not already
Thomas Lamprecht [Wed, 10 Apr 2019 13:45:21 +0000 (15:45 +0200)]
datacenter: only print properties to string if not already

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
5 years agobump version to 5.0-35
Thomas Lamprecht [Wed, 3 Apr 2019 11:38:15 +0000 (13:38 +0200)]
bump version to 5.0-35

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
5 years agoactually add priv/tfa.cfg to observed files
Thomas Lamprecht [Wed, 3 Apr 2019 11:35:07 +0000 (13:35 +0200)]
actually add priv/tfa.cfg to observed files

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
5 years agoregister priv/tfa.cfg as observed file
Wolfgang Bumiller [Tue, 2 Apr 2019 10:21:59 +0000 (12:21 +0200)]
register priv/tfa.cfg as observed file

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
5 years agoadd u2f configuration to datacenter.cfg
Wolfgang Bumiller [Tue, 2 Apr 2019 10:21:58 +0000 (12:21 +0200)]
add u2f configuration to datacenter.cfg

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>