Commit graph

883 commits

Author SHA1 Message Date
Thomas Lamprecht
66b0e690fe pvecm: updatecerts: check and report if we got a timeout
If timeout is reached, run_fork_with_timeout will warn "got timeout".
When processing triggers for pve-manager (because of ExecStartPre of
pveproxy.service invoking pvecm updatecerts) that warning can appear
in the apt output without any context (output of the forked sub
doesn't appear there). So give it some actual content using the
$got_timeout returned in wantarray list context of the
run_fork_with_timeout method.

Note that this could be seen as clash with the silent flag, but IMO
that is a bit misnamed, we mostly want to avoid outputting the info
messages from updatecerts_and_ssh, and that silent (i.e., quite) gets
convoluted with a no-error behavior seems also odd.
TBH., I actually thought about printing the "waiting for quorum" at
least once for the silent case too, but for now omitted it – lets
wait on actual feedback and then maybe restructure this completely.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-07-01 19:29:38 +02:00
Thomas Lamprecht
a56d0aa8f1 pvecm: updatecerts: reword comment
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-07-01 19:29:38 +02:00
Thomas Lamprecht
f34d461403 pvecm: updatecerts: only report quorum-wait progress if not silent
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-07-01 19:29:38 +02:00
Thomas Lamprecht
1d42870684 pvecm: updatecerts: improve variable naming
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-07-01 18:04:41 +02:00
Fiona Ebner
97dc596c68 pvecm: updatecerts: wait for quorum
Mostly useful for the updatecerts call triggered via the ExecStartPre
hook for pveproxy.service.

When starting a node that's part of a cluster, there is a time window
between the start of pve-cluster.service and when quorum is reached
(from the node's perspective). pveproxy.service is ordered after
pve-cluster.service, but that does not prevent the ExecStartPre hook
from being executed before the node is part of the quorate partition.

The pvecm updatecerts command won't do much without quorum. Generating
local (non-pmxcfs) files is still done before waiting on quorum.

In particular, it might happen that the base directories for observed
files will not get created during/after the upgrade from Proxmox VE 7
to 8 (reported in the community forum [0] and reproduced right away in
a virtual test cluster).

Waiting on quorum should highly increase the chances for successful
execution of the ExecStartPre hook.

[0]: https://forum.proxmox.com/threads/129644/

Suggested-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-07-01 18:04:41 +02:00
Fiona Ebner
9a37534884 setup: split generation of local (i.e. non-pmxcfs) files out into helper
In preparation to wait for quorum in the updatecerts command. The
generation of files that do not depend on quorum should still be done
beforehand.

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-07-01 16:35:24 +02:00
Fiona Ebner
98cfaf4408 fix typo
Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-07-01 16:35:24 +02:00
Thomas Lamprecht
6ae4359973 pvecm: style cleanups
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-07-01 16:35:24 +02:00
Thomas Lamprecht
1ed0106946 pmxcfs: drop unused variable from full_write
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-07-01 16:35:24 +02:00
Thomas Lamprecht
175ad01c61 pmxcfs: log resolved IP and improve log on failure to resolve
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-07-01 16:35:24 +02:00
Thomas Lamprecht
c78963b1c6 pmxcfs: check all addresses from getaddrinfo to find non-loopback one
Make the resolution of the node name to a local non-loopback address
through getaddrinfo more flexible.

Don't just ask for one, but for all addresses, then loop through the
returned linked list until the first non-loopback one is found.

It seems that some cloud-init templates hosting providers, like e.g.
OVH use, are misconfigured in always adding 127.0.1.1 for the
hostname to /etc/hosts, even if another mapping for the hostname
exists already. This popped up in our community forum with the
upgrade to bookworm, so might be related to the cloud-init version
from Bookworm.

Some examples pointed out by Alexandre:
https://forum.proxmox.com/threads/129678/
https://forum.proxmox.com/threads/129669/#post-568172
https://forum.proxmox.com/threads/129398/#post-568290

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-07-01 16:35:24 +02:00
Fiona Ebner
0ddbd320f4 pvecm: update comment about updatecerts timeout
The call was moved by 84c3ab0 ("pve-cluster.service: move pvecm call
to pveproxy.service") to pveproxy.service's ExecStartPre.

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
2023-06-28 15:41:26 +02:00
Fiona Ebner
731f4e153f datacenter config: turn shutdown policy into a standard option
to be re-used by the node/status API endpoint.

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
2023-06-16 14:46:51 +02:00
Thomas Lamprecht
e658e95ea4 buildsys: improve DSC target
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-06-05 12:06:49 +02:00
Thomas Lamprecht
5ad37004c8 bump version to 8.0.1
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-06-05 12:05:05 +02:00
Dominik Csapak
815e6ac1d8 add cfg files for resource mapping
There might be more mapping types in the future, but for now it's:

- mapping/pci.cfg
- mapping/usb.cfg

Add them to both, the perl side (PVE/Cluster.pm) and pmxcfs side
(status.c).

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
 [ TL: Dominik, Fabian and I decided to do a s/resource/mapping/
   rename on the cfg & API paths and privileges, so ammend that ]
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-06-05 11:09:19 +02:00
Dominik Csapak
9697997575 pvecm: fix cluster join over ssh with newer rsync
Since rsync 3.2.4, the syntax to give multiple files in one parameter
does not work anymore, so instead add both files explicitly.

this fixes the cluster join over ssh on Bookworm based Proxmox VE,
and Bullseye has rsync 3.2.3 so no change required there.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2023-06-04 18:56:14 +02:00
Thomas Lamprecht
b0913cb018 buildsys: use correct perl vendorarch path again
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-05-31 14:08:43 +02:00
Thomas Lamprecht
2f5f09cbd1 update gitignore
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-05-31 13:50:26 +02:00
Thomas Lamprecht
864b236692 buildsys: rework doc-gen cleanup and makefile inclusion
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-05-31 13:47:09 +02:00
Thomas Lamprecht
05a31bffc9 makefile: convert to use simple parenthesis
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-05-31 13:46:56 +02:00
Wolfgang Bumiller
16f7fe8522 bump glib2 dependency to 2.68, required by g_memdup2
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2023-05-31 13:36:20 +02:00
Wolfgang Bumiller
52c5bfd0f3 buildsys: move -Wl linker flags from CFLAGS to LDFLAGS
(requires to also be buildable with clang)

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2023-05-31 13:19:11 +02:00
Thomas Lamprecht
7be769af36 buildsys: derive upload dist automatically
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-05-19 18:30:39 +02:00
Thomas Lamprecht
b3b916da28 bump version to 8.0.0
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-05-19 18:07:47 +02:00
Thomas Lamprecht
e5f0776517 re-organize source hierachy
data/src was a bit odd, and git is good enough to resolve such things
for history (blame) or applying patches, so don't bother enduring
this.

The process was basically:

 git mv data/src/ data/pmxcfs
 git mv data/ src
 git mv cpgtest.c src/test
 git mv src/cts/* src/test/scripts

And a few Makefile fixups.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-05-19 18:04:56 +02:00
Thomas Lamprecht
3ce80eea9c buildsys: add sbuild convenience target
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-05-19 17:34:39 +02:00
Thomas Lamprecht
abb84466a7 buildsys: drop bogus and unused NOVIEW variable
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-05-19 17:34:25 +02:00
Thomas Lamprecht
e8871db77e buildsys: drop bogus and unused PERL_APIVER
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-05-19 17:34:09 +02:00
Thomas Lamprecht
2c372aee2a pmxcfs: migrate to g_memdup2
As the previously used g_memdup is deprecated since GLib 2.68, due to
being prone to integer overflows when converting the argument from a
gsize to a guint, while that only produces a warning we compile with
Werror, so this FTBFS.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-05-19 17:32:16 +02:00
Thomas Lamprecht
a01bc7b71b d/control: avoid versioned build-dependcies with a -1 Debian revisions
for us not _that_ relevant, but it makes backporting unnecessarily
difficult and is just useless.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-05-19 17:26:31 +02:00
Thomas Lamprecht
69b707fb06 buildsys: add DSC target
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-05-19 17:17:46 +02:00
Thomas Lamprecht
1bc8dbc1fd buildsys: refactor generating build directory into own target
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-05-19 17:16:55 +02:00
Thomas Lamprecht
1286f6c63f buildsys: use full DEB_VERSION
we're in control of this, so don't need to be scared about epoch
bumps or the like

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-05-19 17:07:01 +02:00
Thomas Lamprecht
bdd401a1e2 d/control: raise standards version compliance to 4.6.2
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-05-19 17:05:55 +02:00
Thomas Lamprecht
3dc50e7d4b d/control: define compat level via build-depends and raise to 13
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-05-19 17:05:51 +02:00
Thomas Lamprecht
3b61597641 use combined dpkg packaging variable makefile fragment
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-05-19 17:05:04 +02:00
Thomas Lamprecht
49179c316f makefile: convert to use simple parenthesis
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-05-19 17:04:05 +02:00
Thomas Lamprecht
5f86768caa drop out of date authors file
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-05-19 16:56:10 +02:00
Thomas Lamprecht
1fa86afba4 bump version to 7.3-3
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-03-20 11:17:04 +01:00
Thomas Lamprecht
1a75f4db36 crs: add ha-rebalance-on-start sub-option to datacenter config
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-03-20 07:39:25 +01:00
Thomas Lamprecht
c008170e6f dc config: mark HA CRS scheduler sub-property optional
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-03-20 07:36:04 +01:00
Leo Nunner
581e22f406 fix #4234: vzdump: add cluster-wide configuration
Introduce a cluster-wide vzdump.conf file which gets filled with the
default vzdump configuration.

Signed-off-by: Leo Nunner <l.nunner@proxmox.com>
2023-03-11 18:11:13 +01:00
Friedrich Weber
91c2593616 pvecm add: require user to navigate out of /etc/pve
If `pvecm add` is issued from /etc/pve (or any subdirectory), it
prints some errors:

    [...]
    shell-init: error retrieving current directory: getcwd: cannot
    access parent directories: Transport endpoint is not connected
    [...]
    successfully added node 'pve-c2' to cluster.
    cannot fetch initial working directory: Transport endpoint is not
    connected at /usr/share/perl5/PVE/CLI/pvecm.pm line 446.

The reason is that `pvecm add` restarts pmxcfs, which re-mounts the
fuse mount at /etc/pve, invalidating pvecm's working directory.

The error messages give the impression that something went wrong.
Indeed, the second error indicates the temporary directory is not
cleaned up. The cluster join itself actually works, though.

The issue could be fixed by chdir'ing to / in `pvecm add`. However,
the user's shell would still remain in the now-invalid /etc/pve,
potentially leading to confusing "transport endpoint not connected"
messages in future interactions.

To avoid this, require the user to chdir out of /etc/pve before
running `pvecm add`.

Signed-off-by: Friedrich Weber <f.weber@proxmox.com>
2023-03-11 18:01:09 +01:00
Thomas Lamprecht
deeedc09ae fix variable declared in conditional statement
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-01-27 11:40:22 +01:00
Thomas Lamprecht
fc822a9f65 bump version to 7.3-2
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-01-03 16:32:18 +01:00
Thomas Lamprecht
63e5cd0970 fix #1295: add config schema to control pending update notifications
For now allow a simple selection of `auto` (current behavior),
`always` (if updates are available) or `never`.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-01-03 16:29:33 +01:00
Thomas Lamprecht
ce908dd9b6 bump version to 7.3-1
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2022-11-21 08:34:41 +01:00
Thomas Lamprecht
2453d13ff8 datacenter config: add 'case-sensitive' option to to 'tag-styles'
defaults to off, but admins that want that can turn it on easily

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2022-11-21 08:33:37 +01:00
Stefan Sterz
e46444634a datacenter config: remove typos in "user-tag-access" description
Signed-off-by: Stefan Sterz <s.sterz@proxmox.com>
2022-11-18 16:34:32 +01:00