5
0
mirror of git://git.proxmox.com/git/proxmox-backup.git synced 2025-01-07 17:18:03 +03:00
Commit Graph

8130 Commits

Author SHA1 Message Date
Daniel Kral
974b4527e2 fix #5600: pbs2to3: allow arbitrary newer '-pve' kernels after upgrade
Fixes a bug where `pbs2to3` shows an incorrect warning about an
unexpected running kernel version, where newer kernel versions than 6.5
were marked as unexpected (e.g. "8.6.12-1-pve").

This commit allows arbitrary newer kernel versions that are suffixed
with '-pve' from kernel version 6.2 onward. This is the same behavior as
in other upgrade helpers like `pve7to8` [1] and `pmg7to8` [2].

[1] https://git.proxmox.com/?p=pve-manager.git;a=commit;h=fb59038a8b110b0b0b438ec035fd41dd9d591232
[2] https://git.proxmox.com/?p=pmg-api.git;a=commit;h=9d67a9af218b73027822c9c4665b88e6662e7ef7

Signed-off-by: Daniel Kral <d.kral@proxmox.com>
2024-11-12 21:19:22 +01:00
Daniel Kral
65574209ad pbs2to3: add test for kernel version compatibility
Factors the kernel version compatibility check into its own method and
adds test cases for a set of expected and unexpected kernel versions.

Signed-off-by: Daniel Kral <d.kral@proxmox.com>
2024-11-12 21:19:22 +01:00
Gabriel Goller
1a0229b881 api: parallelize smartctl checks
To improve the performance of the smartctl checks, especially when a lot
of disks are used, parallelize the checks using the `ParallelHandler`.

Signed-off-by: Gabriel Goller <g.goller@proxmox.com>
2024-11-12 21:17:24 +01:00
Gabriel Goller
b3d9b6d5f1 api: avoid retrieving lsblk result twice
Avoid running `lsblk` twice when executing the `list_disk`
endpoint/command. This and the various other small nits improve the
performance of the endpoint.

Does not really fix, but is related to: #4961.

Signed-off-by: Gabriel Goller <g.goller@proxmox.com>
2024-11-12 21:17:24 +01:00
Christian Ebner
da82aca849 client: catalog shell: avoid navigating below archive root
Avoid to underflow the catalogs shell position stack by navigating
below the archives root directory into the catalog root. Otherwise
the shell will panic, as the root entry is always expected to be
present.

This threats the archive root directory as being it's own parent
directory, mimicking the behaviour of most common shells.

Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
2024-11-12 21:08:27 +01:00
Hannes Laimer
7f193b88ed api: tape: add permission to move_tape endpoint
... so it is usable by non-root users, this came up in support.

Signed-off-by: Hannes Laimer <h.laimer@proxmox.com>
2024-11-12 13:55:15 +01:00
Thomas Lamprecht
720bf707e8 update proxmox-notify crate to 0.5
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2024-11-11 23:55:25 +01:00
Gabriel Goller
f2ea424cc1 web: disallow datastore in root, add reuse-datastore flag
Disallows creating a datastore in root on the frontend side, by
filtering the '/' path. Add reuse-flag to permit us to open existing
datastores.

Signed-off-by: Gabriel Goller <g.goller@proxmox.com>
2024-11-11 23:51:06 +01:00
Gabriel Goller
6e101ff757 fix #5439: allow to reuse existing datastore
Disallow creating datastores in non-empty directories. Allow adding
existing datastores via a 'reuse-datastore' checkmark. This only checks
if all the necessary directories (.chunks + subdirectories and .lock)
exist and have the correct permissions. Note that the reuse-datastore
path does not open the datastore, so that we don't drop the
ProcessLocker of an existing datastore.

Signed-off-by: Gabriel Goller <g.goller@proxmox.com>
2024-11-11 23:51:06 +01:00
Gabriel Goller
27811f3f8f fix #5861: remove min username length in ChangeOwner modal
We allow usernames shorter than 4 characters since this patch [0] in
pbs.

[0]: https://lore.proxmox.com/pbs-devel/20240117142918.264978-1-g.goller@proxmox.com/

Signed-off-by: Gabriel Goller <g.goller@proxmox.com>
2024-11-11 11:08:15 +01:00
Wolfgang Bumiller
6391a45b43 bump rest-server to 0.8.1
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2024-11-08 12:07:00 +01:00
Christoph Heiss
667797ce2e d/control: bump proxmox-subscription to 0.5
Seems this was forgotten while bumping it in Cargo.toml in dcd863e0.

Fixes: dcd863e0 ("bump proxmox-subscription to 0.5.0")
Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
2024-11-08 10:58:48 +01:00
Dietmar Maurer
dcd863e0c9 bump proxmox-subscription to 0.5.0
Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
2024-11-07 14:09:15 +01:00
Fabian Grünbichler
faa08f6564 sync: pull: reword last_sync_time resync comment
make it a bit easier to parse and include some examples of what the resync
might be able to pick up.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2024-11-04 15:13:37 +01:00
Christian Ebner
868ca01a7a sync: pull: simplify logic for source snapshot filtering
Decouple the actual filter logic from the skip reason output logic by
pulling the latter out of the filter closue.

Makes the filtering logic more intuitive.

Reviewed-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
2024-11-04 14:45:43 +01:00
Christian Ebner
b752b8cb96 sync: pull: mention why last snapshot of previous sync is resynced
The last snapshot synced during the previous sync job might not have
been fully completed just yet (e.g. backup log still missing,
verification still ongoing, ...).
Explicitley mention the reason and that the resync is therefore
intentional by a comment in the filter logic.

Suggested-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
2024-11-04 14:45:43 +01:00
Christian Ebner
1e36930e0b sync: fix premature return in snapshot skip filter logic
While checking which snapshots to sync, the filter logic incorrectly
included the first snapshot newer that the last synced one
unconditionally, bypassing the transfer last check for that one
snapshot. Following snapshots are correctly handled again.

E.g. of an incorrect sync by excerpt of a task log provided by a user
in the community forum [0], with transfer last set to 1:

```
skipped: 2 snapshot(s) (2024-09-29T18:00:28Z .. 2024-10-20T18:00:29Z) - older than the newest local snapshot
skipped: 5 snapshot(s) (2024-10-28T19:00:28Z .. 2024-11-01T19:00:32Z) - due to transfer-last
sync snapshot vm/110/2024-10-27T19:00:25Z
...
sync snapshot vm/110/2024-11-02T19:00:23Z
```

Not only the last, but the first newer than newest and last were
incorrectly synced.

By dropping the early return, leading to incorrect inclusion of the
snapshot, the transfer last condition is now correctly checked as
well.

Link to the issue reported in the community forum:
[0] https://forum.proxmox.com/threads/156873/

Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
2024-11-04 13:03:15 +01:00
Christian Ebner
59243d200e client: catalog shell: drop payload offset in stat output
Drop the payload offset output for the multi line formatting helper,
as the formatting was skewed anyways and the `stat` output is not
intended for debugging.

Commit 51e8fa96 ("client: pxar: include payload offset in entry
listing") introduced the payload offset output for pxar entries
in case of split archives for both, single line and multi line
formatting helpers with debugging prupose.

While the payload offset output is fine for the single line entry
formatting (generates the pxar dump output in debugging mode),
it should not be included in the multi line entry formatting helper,
used to generate the output for the `stat` command of the catalog
shell.

Fixes: 51e8fa96 ("client: pxar: include payload offset in entry listing")

Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
2024-10-25 14:22:32 +02:00
Fabian Grünbichler
dd16eabe19 pxar: tools: inline async recursion
this works since rustc 1.77, and makes the code less verbose.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2024-10-23 16:10:41 +02:00
Christian Ebner
5ddd59e167 client: catalog shell: fallback to accessor for navigation
Make the catalog optional and use the pxar accessor for navigation if
the catalog is not provided.
This allows to use the metadata archive for navigraion, as for split
pxar archives no dedicated catalog is encoded.

Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
2024-10-23 16:10:41 +02:00
Christian Ebner
78e4098eae client: helper to mimic catalog find using metadata archive
Adds helper functions to reimplement the catalog shell functionality
for snapshots being encoded as split pxar archives.

Just as the `CatalogReader`s find method, recursively iterate entries
and call the given callback on all entries matched by the match
patterns, starting from the given parent entry.

The helper has been split into 2 functions for the async recursion to
work.
2024-10-23 16:10:41 +02:00
Christian Ebner
8b9bae1ef1 client: catalog: fallback to metadata archives for catalog dump
Commit c0302805c "client: backup: conditionally write catalog for
file level backups" drops encoding of the dedicated catalog when
archives are encoded as split metadata/data archives with the
`change-detection-mode` set to `data` or `metadata`.

Since the catalog is not present anymore, fallback to use the pxar
metadata archives in the manifest (if present) for generating the
listing of contents in a compatible manner.

Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
2024-10-23 16:10:41 +02:00
Christian Ebner
d530ba080d client: add helper to dump catalog from metadata archive
Implements the methods to dump the contents of a metadata pxar
archive using the same output format as used by the catalog dump.

The helper function has been split into 2 for async recursion to
work.

Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
2024-10-23 16:10:41 +02:00
Christian Ebner
0a32544585 client: tools: factor out pxar entry to dir entry mapping
Perform the conversion from pxar file entries to catalog entry
attributes by implementing `TryFrom<&FileEntry<T>>` for
`DirEntryAttribute` and use that.

Allows the reuse for the catalog shell, when using the split pxar
archive instead of the catalog.

Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
2024-10-23 16:10:41 +02:00
Christian Ebner
50d20e9b64 client: tools: factor out entry path prefix helper
Move the logic to generate `FileEntry` paths with a given prefix to
its own helper function for it to be reusable for the catalog shell
implementation of split pxar archives.

Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
2024-10-23 16:10:41 +02:00
Christian Ebner
3e6318a535 client: make helper to get remote pxar reader reusable
Move the `get_remote_pxar_reader` helper function so it can be reused
also for getting the metadata archive reader instance for the catalog
dump.

No functional changes.

Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
2024-10-23 16:10:41 +02:00
Christian Ebner
3a6755363b client: tools: move pxar root entry helper to pxar submodule
Move the `handle_root_with_optional_format_version_prelude` helper,
purely related to handling the root entry for pxar format version 2
archives, to the more fitting pxar tools submodule.

Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
2024-10-23 16:10:41 +02:00
Christian Ebner
113c04bc60 client: pxar: move catalog lookup helper to pxar tools
The lookup helper used to generate catalog entries via the metadata
archive for split archive backups is pxar specific, therefore move it
to the appropriate pxar tools submodlue.
2024-10-23 16:10:41 +02:00
Christian Ebner
84c066297c client: tools: make tools module public
Change namespace visibility for tools submodule to be accessible from
other creates, to be used for common pxar related helpers.

Switch helpers declared as `pub` to `pub(crate)` in order to keep module
encapsulation, adapt namespace for functions required to be `pub`.

Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
2024-10-23 16:10:41 +02:00
Thomas Lamprecht
2d4209d9ef api: add missing doc-comment description for api enums
this is used as description in the api schema

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2024-10-22 15:26:35 +02:00
Thomas Lamprecht
32dad63696 file-restore: add missing doc-comment description for api enums
this is used as description in the api schema

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2024-10-22 15:26:11 +02:00
Thomas Lamprecht
c606fdaa88 api-types: add missing doc-comment description for api enums
this is used as description in the api schema

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2024-10-22 15:25:52 +02:00
Thomas Lamprecht
6c44f3e584 bump version to 3.2.8-1
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2024-10-21 17:18:18 +02:00
Christian Ebner
d2b6c75fa1 docs: sync: explicitly mention removed-vanish flag
Add a short sentence describing the function of the remove vanished
flag since this has not been documented explicitly.

Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
2024-10-21 16:38:24 +02:00
Thomas Lamprecht
1836c135bc docs: prefix node.cfg man page with proxmox-backup
As node.cfg is a rather general name that could clash with manual
pages from other packages, or at least be a bit confusing if there's
another tool providing a node.cfg.

In the long term we should rename all existing manual pages from
section 5 and 7, i.e. all those that are not directly named after an
executable. As those normally talk about product-specific configs and
topics where just the filename is not specific enough for a system
wide manual page.

Note that there was some off-list discussion with proposal of using
"section suffixes" that man supports and can be used to differ between
manual pages with the same name (and in the same section), for example
`man 3pm Git`, but to me this seems a bit more obscure and potentially
less discoverable, but can be a great way to provide an link alias for
convenience.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2024-10-21 14:19:51 +02:00
Thomas Lamprecht
082c37b5a6 buildsys: install node.cfg man page in server package
Fixes: 3c9fe358 ("docs: add node.cfg man page")
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2024-10-21 09:07:25 +02:00
Gabriel Goller
521647436d docs: fix warnings in external-metric-server page
Rename external-metric-server page and fix code-block to remove some
warnings.

Signed-off-by: Gabriel Goller <g.goller@proxmox.com>
2024-10-18 17:56:46 +02:00
Gabriel Goller
3c9fe358cc docs: add node.cfg man page
Add man page for the node.cfg config file.

Signed-off-by: Gabriel Goller <g.goller@proxmox.com>
 [ TL: pull out sorting of synopsis file list to separate commit ]
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2024-10-18 17:56:17 +02:00
Thomas Lamprecht
45c9383e94 buildsys: sort list of generated synopsis and man page files alphabetically
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2024-10-18 17:54:23 +02:00
Thomas Lamprecht
a3e87f5a03 client: progress log: small opinionated code clean-up
It was fine as is, but IMO saving a few lines is nice, albeit it makes
the atomic fetch expressions look slightly complexer by wrapping them
directly with the HumanByte and TimeSpan from-constructors.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2024-10-17 16:51:41 +02:00
Christian Ebner
1d746a2c02 partial fix #5560: client: periodically show backup progress
Spawn a new tokio task which about every minute displays the
cumulative progress of the backup for pxar, ppxar or img archive
streams. Catalog and metadata archive streams are excluded from the
output for better readability, and because the catalog upload lives
for the whole upload time, leading to possible temporal
misalignments in the output. The actual payload data is written via
the other streams anyway.

Add accounting for uploaded chunks, to distinguish from chunks queued
for upload, but not actually uploaded yet.

Example output in the backup task log:
```
...
INFO:  processed 2.471 GiB in 1m, uploaded 2.439 GiB
INFO:  processed 4.963 GiB in 2m, uploaded 4.929 GiB
INFO:  processed 7.349 GiB in 3m, uploaded 7.284 GiB
...
```

This partially fixes issue 5560:
https://bugzilla.proxmox.com/show_bug.cgi?id=5560

Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2024-10-17 16:32:32 +02:00
Christoph Heiss
fb378fe543 docs: installation: fix wrong product reference
This was probably copied verbatim from pve-docs and forgotten to be
appropriately changed.

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
2024-10-17 05:43:25 +02:00
Christian Ebner
4ee9264b00 docs: Fix typo for chunk directory naming and rewording
The chunks subdirectories are only using the chunk's 2 byte checksum
prefix given in hex notation.

Also, clarify that chunks are grouped into subdirectories.

Reported in the community forum:
https://forum.proxmox.com/threads/155751/

Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
2024-10-17 05:43:25 +02:00
Thomas Lamprecht
a61272c7ff debian: run wrap-and-sort -tkn to normalize control files
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2024-10-16 14:34:11 +02:00
Lukas Wagner
8038f96a53 api: metrics: check permissions before reading any data from the cache
Reading from the metric cache is somewhat expensive, so validate as many
of the required permissions as possible. For host metrics, we can
do the full check in advance. For datastores, we check if we have
audit permissions for *any* datastore. If we do not have privs for
either of those, we return early and avoid reading from the
cache altogether.

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
Suggested-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2024-10-15 16:03:37 +02:00
Wolfgang Bumiller
2feb4160f1 update d/control
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2024-10-15 15:32:58 +02:00
Wolfgang Bumiller
da409e0a62 api: optimize metrics permission checks a bit
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2024-10-15 14:53:15 +02:00
Lukas Wagner
c804763bdf api: add /status/metrics API
This one is modelled exactly as the one in PVE (there it
is available under /cluster/metrics/export).

The returned data format is quite simple, being an array of
metric records, including a value, a metric name, an id to identify
the object (e.g. datastore/foo, host), a timestamp and a type
('gauge', 'derive', ...). The latter property makes the format
self-describing and aids the metric collector in choosing a
representation for storing the metric data.

[
    ...
    {
	"metric": "cpu_avg1",
	"value": 0.12,
	"timestamp": 170053205,
	"id": "host",
	"type": "gauge"
    },
    ...
]

In terms of permissions, the new endpoint requires Sys.Audit
on /system/status for metrics of the 'host' object,
and Datastore.Audit on /datastore/{store} for 'datastore/{store}'
metric objects.

Via the 'history' and 'start-time' parameters one can query
the last 30mins of metric history. If these parameters
are not provided, only the most recent metric generation
is returned.

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
2024-10-15 14:09:41 +02:00
Lukas Wagner
da12adb1f9 metric collection: put metrics in a cache
Any pull-metric API endpoint can alter access the cache to
retrieve metric data for a limited time (30mins).

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
2024-10-15 14:09:41 +02:00
Lukas Wagner
20753e1b53 metric collection: initialize metric cache on startup
Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
2024-10-15 14:09:41 +02:00