Commit Graph

286 Commits

Author SHA1 Message Date
Folke Gleumes
c8dba92e1b fix #4497: cli/acme: detect eab and ask for credentials
Since external account binding is advertised the same way as the ToS,
it can be detected when creating an account and asked for if needed.

Signed-off-by: Folke Gleumes <f.gleumes@proxmox.com>
Reviewed-by: Fabian.Grünbichler <f.gruenbichler@proxmox.com>
Tested-by: Fabian.Grünbichler <f.gruenbichler@proxmox.com>
2023-11-13 12:06:10 +01:00
Stoiko Ivanov
67c655b933 pve7to8: check for proper grub meta-package for bootmode
This should catch installations from our ISO on non-ZFS in uefi mode,
which won't get the updated grub efi binary installed upon upgrade,
because grub-pc is installed instead of grub-efi-amd64.

Adding this to pve7to8 should make this even more visible, than the
corresponding patch for promxox-kernel-helper (warnings printed during
regular package upgrades might be overlooked more easily than
a yellow line in the major upgrade checkscript)

The if/else order was chosen to limit the nesting level of the long
messages.

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
2023-11-06 18:12:17 +01:00
Thomas Lamprecht
2944acf97e pvesh: code clean-ups
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-10-21 16:32:46 +02:00
Thomas Lamprecht
6d7deac70d pvesh: code cleanups for streamed response handling
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-10-19 15:26:08 +02:00
Christoph Heiss
86f9a0acea pvesh: decode streamed responses
This allows to use `pvesh` on endpoints like /nodes/{node}/journal,
which return streamed (and possibly gzip'd) responses.

Currently, e.g. `pvesh get /nodes/localhost/journal --lastentries 10`
fails with:

  gzip: stdout: Broken pipe
  got hash object, but result schema specified array!

Using e.g. `--output-format yaml` resulted in:

  ---
  download:
    content-encoding: gzip
    content-type: application/json
    fh: &1 !!perl/ref
      =: *1
    stream: 1

  gzip: stdout: Broken pipe
  Failed to write

This is due the API call returning a "download" object (as seen above),
which contains (among some other things) a file handle to read the
response from.

With this patch, the response from such endpoints is now correctly read
and displayed. Only handles combinations of `Content-Encoding` == 'gzip'
and either 'text/plain' or 'application/json' for `Content-Type`.

This tries to mimic the behavior of the API server implementation when
encountering `download` objects.

Tested this with all four output formats 'text', 'json', 'json-pretty'
and 'yaml', as well as "cross-node" in a local test cluster.

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
2023-10-19 10:08:54 +02:00
Christian Ebner
0329876ccf pve7to8: Add check for dkms modules
... and warn if at least one is present.

Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
2023-09-27 17:02:12 +02:00
Christian Ebner
68278ea36d pve7to8: Fix Fedora 38 systemd unified cgroupv2 check
For Fedora 38 the systemd shared object files used to check the systemd
version are located at /usr/lib64/systemd or /usr/lib/systemd.
Therefore, include /usr/lib64/systemd in the list of directories to
check.

Further, Fedora 38 adds a fc38 postfix to the filename, so expand the
regex to cover that as well.

Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
2023-09-27 16:51:35 +02:00
Thomas Lamprecht
12c8efb59e pveceph: support installing Ceph 18.2 Reef
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-09-04 18:05:08 +02:00
Fabian Grünbichler
3fc687f57b handle pve-kernel -> proxmox-kernel rename
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2023-08-01 10:33:12 +02:00
Fiona Ebner
a083d41041 pve7to8: fix Ceph noout check
Commit 114e5f2c ("pve7to8: sync over from stable-7 branch")
accidentally got rid of the correct value 0 here and also the new TODO
message to improve the situation. But the TODO is actually easy,
because there already is the $upgraded variable. Just rely on that
instead of hard-coding and forgetting about it again.

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
2023-07-15 23:28:46 +02:00
Max Carrara
d1c49f5b64 fix #4364: pveceph: add confirmation dialogue for ceph installation
Displays a confirmation dialogue if the user didn't explicitly
provide a valid ceph version via the `--version` flag and if
stdout is connected to a tty.

Signed-off-by: Max Carrara <m.carrara@proxmox.com>
2023-07-06 16:10:25 +02:00
Thomas Lamprecht
114e5f2c4a pve7to8: sync over from stable-7 branch
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-07-03 13:19:13 +02:00
Thomas Lamprecht
ffa79167b0 pve7to8: sync over from stable-7 branch
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-06-21 19:52:59 +02:00
Stoiko Ivanov
35069cdbdc pve7to8: add check for systemd-boot presence where needed
since the package won't get installed for systems upgraded from 7 to 8
we warn users who need systemd-boot - to be able to initialize new
ESPs - that they need to install it

The check for package installation is based on existance of the
changelog, since the package information used in pve7to8 comes from
the API-modules, which limit it to the pve-relevant packages.

tested in VMs with uefi and legacy mode, with existing
proxmox-boot-uuids both with and w/o systemd-boot being installed

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
2023-06-21 19:48:11 +02:00
Fiona Ebner
daf74a20fd pve7to8: avoid confusing warning about required setting 'storage' for vzdump
It's required in the schema for notes-template and protected, but when
parsing vzdump.conf, it shouldn't matter whether the storage parameter
is set or not.

The warning is ugly and users might interpret it as something that
needs to be acted upon for the upgrade:
parse error in '/etc/vzdump.conf' - 'storage': missing property - 'notes-template' requires this property\nmissing property - 'protected' requires this property

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
(cherry picked from commit 517abd0cd2)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-06-21 18:26:34 +02:00
Fiona Ebner
e63cea8930 pve7to8: remove outdated warning about retention
It just talks about the default behavior since PVE 7. It's rather
confusing to mention this, because the behavior doesn't change anymore
in PVE 8.

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
(cherry picked from commit b58348b1b6)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-06-21 18:26:34 +02:00
Friedrich Weber
2a7f4f7111 pve7to8: content-dirs check: skip paths that cannot be resolved
The current inequality check for content-dirs does not correctly
handle the case in which `abs_path` returns undef. This can result in
confusing warnings:

  storage [...] uses directory  for multiple content types [...]

Fix this by skipping paths for which `abs_path` returns undef. This
matches the behavior of the actual content-dirs check in PVE 8 [0].

[0]: https://git.proxmox.com/?p=pve-storage.git;a=commit;h=09f1f847a

Fixes: ea0a4f1943
Signed-off-by: Friedrich Weber <f.weber@proxmox.com>
(cherry picked from commit 20fb9aa3f1)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-06-21 18:26:34 +02:00
Fiona Ebner
1f8f027290 pve7to8: add reminder comment for noout_wanted variable
Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
2023-06-21 18:25:30 +02:00
Dominik Csapak
0fe0a2dd2b pvesh: fix parameters for proxyto_callback
in pve-http-server the proxyto_callback always has a complete list of
parameters, not only the ones in the url, so adapt the implementation
here to do the same

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2023-06-16 11:22:27 +02:00
Thomas Lamprecht
eed1e93ee9 pve7to8: sync over from stable-7 branch
for after-upgrade checks

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-06-08 13:07:07 +02:00
Thomas Lamprecht
cf14758f5f ceph CLI: osd details: code/style cleanups
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-06-06 18:21:38 +02:00
Aaron Lauterer
b48ca5a7c0 pveceph: add osd details command
To provide similar output on the CLI as is possible in the GUI/API
regaring OSD details.

By default (output-format=text) a more concise output is shown. Using
json or yaml as output format will print all the available data.

The 'verbose' flag causes json-pretty output to be used.

The functionality is split between the actual function and the output
formatter as not all options/parameters are available in each.

Signed-off-by: Aaron Lauterer <a.lauterer@proxmox.com>
2023-06-06 18:04:25 +02:00
Thomas Lamprecht
bbfbf0efe9 ceph install: output some hints depending repo choice and subscription
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-06-05 19:04:12 +02:00
Thomas Lamprecht
93542d7748 pveceph: support new enterprise repository
With Proxmox VE 8, we'll have support for a enterprise ceph repo,
accessed through Proxmox VE subscriptions, to provide more broadly
tested ceph updates for production setups.

Replace the test-repository parameter with an actual enum of
selectable repo types for:

- test (same as previously selected through setting test-repository)
- no-subscription (the previous default, then named "main")
- enterprise (new and the default now, recommended for production)

Note that writing the auth-part is a bit hacky and might/should be
improved.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-06-05 19:04:12 +02:00
Thomas Lamprecht
75d1eb55ae cli: subscription: simplify printing output in get command
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-06-05 19:04:12 +02:00
Thomas Lamprecht
45d1707c75 pve7to8: cope with native version of proxmox-ve package
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-05-31 18:19:21 +02:00
Thomas Lamprecht
de52feb88d drop outdated pve6to7 upgrade checker script for bookworm
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-05-31 18:02:39 +02:00
Thomas Lamprecht
a98193c295 update source of pve7to8 upgrade checker script
squashed from the respective commits of the stable-7 branch, which is
the canonical source for this specific script.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-05-31 18:00:07 +02:00
Thomas Lamprecht
37c01c901d buildsys: split list of CLI sources over multiple lines
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-05-31 18:00:07 +02:00
Thomas Lamprecht
ddd8927990 pveceph: drop special for octopus and pacific, unsupported in 8.x
sort the package list while at it

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-05-30 15:17:10 +02:00
Thomas Lamprecht
74ea1fb257 pveceph: update Ceph releases and repo dist for Bookworm
We'll only support Quincy and newer in Bookworm, and Reef isn't yet
released.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-05-30 15:16:19 +02:00
Thomas Lamprecht
147d67c495 makefile: convert to use simple parenthesis
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-05-29 18:24:00 +02:00
Aaron Lauterer
a066500123 pveceph: adapt to new Pool module
The API::Ceph::Pools module is deprecated. Use the new API::Ceph::Pool
(singular) module.

Signed-off-by: Aaron Lauterer <a.lauterer@proxmox.com>
Reviewed-by: Dominik Csapak <d.csapak@proxmox.com>
Tested-by:  Dominik Csapak <d.csapak@proxmox.com>
2023-03-20 15:31:04 +01:00
Thomas Lamprecht
e07c055df4 revert "fix #4333: redirect API handler output to STDERR"
Redirecting stdout is not a feasible approach, as that also affects
all run_commands and other command executions/forks done by the API
handler, and thus breaks parsing outputs of such command executions
in the API handlers.

We plan to add a `--result-fd` option instead, allowing users to pass
their own file, open FD or named pipe to the pvesh, so that they can
process the output in streaming or in full afterward afterwards.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-03-14 11:21:29 +01:00
Thomas Lamprecht
5ea98762aa pvesh: don't bloat the code on comments
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-03-11 18:10:09 +01:00
Fabian Grünbichler
89fba14715 fix #4333: redirect API handler output to STDERR
otherwise, print/warn statements by the API endpoint are included in the
output, which breaks JSON parsing in case of output-format == json*.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2023-03-11 18:08:00 +01:00
Moayad Almalat
7d8a9a99fc fix #3037: include the split_list to shell_qoute
Based to the suggestion of Wolfgang, in regard to `split_list()`,
 I converted the `split_list()` to `split(/\0/, $param->{$key});`
 this will split the `$param->{$key}` null characters and push each
 element to the `$args` array along with the key value.

 changes since v1:
 * get rid of the `use PVE::Tools qw(split_list);` since not need it anymore.
 * replace the split_list to split(/\0/).

Signed-off-by: Moayad Almalat <m.almalat@proxmox.com>
2023-01-25 09:30:13 +01:00
Fabian Grünbichler
774c5031b4 pvesubscription: remove leftover $key
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2022-09-09 15:06:26 +02:00
Fabian Grünbichler
d4df1b145c pvesubscription: add 'set-offline-key' command
and disallow updating signed offline keys via regular check/update code
path.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2022-09-06 11:02:59 +02:00
Fiona Ebner
55b1af44fd pvesr: prepare local job: remove stale replicated volumes immediately
Commit d8cd8e8cf9 introduced a
regression where only stale replicated volumes with an older
timestamp would be cleaned up. This meant that after removing a volume
from the guest config, it would only be cleaned up the second time the
replication ran afterwards. And the volume could become completely
orphaned in case the relevant storage wasn't used by the job anymore.

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
2022-08-02 11:05:06 +02:00
Fiona Ebner
e3e0e09637 pvesr: rename last_snapshots to local_snapshots
while dropping the instance where the local variable was unused.
prepare() was changed a while ago to return all local snapshots.

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
2022-08-02 11:04:55 +02:00
Thomas Lamprecht
b23305d5ad pveceph install: clarify comment for conditional ceph-volume inclusion
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2022-07-05 08:38:51 +02:00
Stefan Sterz
3409fbeaff pveceph install: exclude 'ceph-volume' from older than quincy releases
when installing non-quincy versions, 'ceph-volume' is not contained in
the respective repositories and, thus, the install process would fail.

Signed-off-by: Stefan Sterz <s.sterz@proxmox.com>
 [ T: reworded commit subject ]
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2022-07-05 08:19:28 +02:00
Thomas Lamprecht
2812907f23 pveceph: install split-out ceph-volume package
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2022-07-04 13:30:51 +02:00
Thomas Lamprecht
7271e6f67d pveceph: reuse supported ceph versions for non-default warning
albeit this is a bit odd safety "check" anyway

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2022-06-21 17:04:49 +02:00
Thomas Lamprecht
983921b9a1 pveceph: factor out supported/default ceph version to single source
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2022-06-21 17:04:49 +02:00
Thomas Lamprecht
ef25743f04 pveceph: warn on (soon) EOL octopus
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2022-06-21 16:52:54 +02:00
Thomas Lamprecht
9e81f36459 pveceph: add quincy installation support
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2022-06-21 16:52:25 +02:00
Oguz Bektas
61a687ac13 fix #3961: pveam: error on 'list' if storage doesn't exist
storage_check_enabled() already dies with an appropriate error message
so we don't have to handle it here

Signed-off-by: Oguz Bektas <o.bektas@proxmox.com>
2022-06-14 10:12:35 +02:00
Fabian Ebner
0782c03469 pveam: remove: add content type check
Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2022-04-01 09:24:35 +02:00