]> git.proxmox.com Git - proxmox-backup.git/log
proxmox-backup.git
23 months agoupdate d/control
Fabian Grünbichler [Fri, 9 Dec 2022 10:50:55 +0000 (11:50 +0100)]
update d/control

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
23 months agoswitch proxmox dependencies to workspace
Fabian Grünbichler [Fri, 9 Dec 2022 10:37:02 +0000 (11:37 +0100)]
switch proxmox dependencies to workspace

besides harmonizing versions, the only global change is that the tokio-io
feature of pxar is now implied since its default anyway, instead of being
spelled out.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
23 months agoadd pbs-api-types to Cargo.toml
Fabian Grünbichler [Fri, 9 Dec 2022 10:49:59 +0000 (11:49 +0100)]
add pbs-api-types to Cargo.toml

else the next commit would drop its dependencies for d/control generation.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
23 months agorestore-daemon: add missing tokio feature
Fabian Grünbichler [Wed, 7 Dec 2022 11:06:43 +0000 (12:06 +0100)]
restore-daemon: add missing tokio feature

hidden by the top-level crate enabling it.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
23 months agoworkspace: inherit metadata
Fabian Grünbichler [Wed, 7 Dec 2022 10:33:47 +0000 (11:33 +0100)]
workspace: inherit metadata

pbs-buildcfg is the only one that needs to inherit the version as well, since
it stores it in the compiled crate.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
23 months agomanager: remove accidentally committed ldap.rs
Lukas Wagner [Fri, 9 Dec 2022 13:13:49 +0000 (14:13 +0100)]
manager: remove accidentally committed ldap.rs

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
23 months agobump d/control
Wolfgang Bumiller [Fri, 9 Dec 2022 13:39:48 +0000 (14:39 +0100)]
bump d/control

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
23 months agodebug cli: move parameters into the function signature
Lukas Wagner [Fri, 9 Dec 2022 11:14:26 +0000 (12:14 +0100)]
debug cli: move parameters into the function signature

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
23 months agodebug cli: add colored output for `diff archive`
Lukas Wagner [Fri, 9 Dec 2022 11:14:25 +0000 (12:14 +0100)]
debug cli: add colored output for `diff archive`

This commit adds the `--color` flag to the `diff archive` tool.
Valid values are `always`, `auto` and `never`. `always` and
`never` should be self-explanatory, whereas `auto` will enable
colors unless one of the following is true:
  - STDOUT is not a tty
  - TERM=dumb is set
  - NO_COLOR is set

The tool will highlight changed file attributes in yellow.
Furthermore, (A)dded files are highlighted in green,
(M)odified in yellow and (D)eleted in red.

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
23 months agodebug cli: add 'compare-content' flag to `diff archive` command
Lukas Wagner [Fri, 9 Dec 2022 11:14:24 +0000 (12:14 +0100)]
debug cli: add 'compare-content' flag to `diff archive` command

When --compare-content is set, the command will compare the
file content instead on relying on mtime to detect modified files.

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
23 months agodebug cli: show more file attributes for `diff archive` command
Lukas Wagner [Fri, 9 Dec 2022 11:14:23 +0000 (12:14 +0100)]
debug cli: show more file attributes for `diff archive` command

This commit enriches the output of the `diff archive` command,
showing pxar entry type, mode, uid, gid, size, mtime and filename.
Attributes that changed between both snapshots are prefixed
with a "*".

For instance:

$ proxmox-backup-debug diff archive ...
A  f   644  10045  10000    0 B  2022-11-28 13:44:51  add.txt
M  f   644  10045  10000    6 B *2022-11-28 13:45:05  content.txt
D  f   644  10045  10000    0 B  2022-11-28 13:17:09  deleted.txt
M  f   644  10045    *29    0 B  2022-11-28 13:16:20  gid.txt
M  f  *777  10045  10000    0 B  2022-11-28 13:42:47  mode.txt
M  f   644  10045  10000    0 B *2022-11-28 13:44:33  mtime.txt
M  f   644  10045  10000   *7 B *2022-11-28 13:44:59 *size.txt
M  f   644 *64045  10000    0 B  2022-11-28 13:16:18  uid.txt
M *f   644  10045  10000   10 B  2022-11-28 13:44:59  type_changed.txt

Also, this commit ensures that we always show the *new* type.
Previously, the command showed the old type if it was changed.
Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
23 months agotree-wide: bump edition to 2021
Wolfgang Bumiller [Tue, 6 Dec 2022 10:19:41 +0000 (11:19 +0100)]
tree-wide: bump edition to 2021

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
23 months agomove fuse code from pbs-client to pbs-pxar-fuse
Wolfgang Bumiller [Tue, 6 Dec 2022 08:17:03 +0000 (09:17 +0100)]
move fuse code from pbs-client to pbs-pxar-fuse

it's used by pxar-bin and proxmox-backup-client for
mounting, but pbs-client is used by more (eg. the
proxmox-backup-qemu library which really doesn't need to
pull in any fuse dependencies)

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
23 months agoclippy 1.65 fixes
Fabian Grünbichler [Mon, 5 Dec 2022 10:27:40 +0000 (11:27 +0100)]
clippy 1.65 fixes

and rustfmt

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
23 months agoui: metricserver: fix enable column
Dominik Csapak [Tue, 29 Nov 2022 12:01:03 +0000 (13:01 +0100)]
ui: metricserver: fix enable column

we use 'enable' property here with a default of true, so change
the dataIndex and the renderer to reflect that

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
23 months agotape: inventory: skip unassigned tapes
Dominik Csapak [Tue, 29 Nov 2022 14:17:01 +0000 (15:17 +0100)]
tape: inventory: skip unassigned tapes

tapes that are labeled into a pool but are not in a media-set yet, belong
to the special 'all zero' media-set. these will never have a catalog on them,
so skip them

fixes the issue, that an inventory with 'catalog restore' aborted on
such a tape

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
23 months agotape: hide internal use of all zero uuid for unassigned tapes
Dominik Csapak [Tue, 29 Nov 2022 14:17:00 +0000 (15:17 +0100)]
tape: hide internal use of all zero uuid for unassigned tapes

a tape assigned to a pool but no media-set, gets the special 'all zero'
media set in it's MediaSetLabel. Instead of having that constant
scattered all over the code, hide this fact by using wrapper functions
to initialize it that way and to check for it

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
23 months agoFix formatting in proxmox-backup-manager
Stefan Hanreich [Tue, 29 Nov 2022 15:53:43 +0000 (16:53 +0100)]
Fix formatting in proxmox-backup-manager

Small followup to my previous commit, fixing minor formatting issues.

Signed-off-by: Stefan Hanreich <s.hanreich@proxmox.com>
23 months agoui: datastore options: fix default for prune notify render
Thomas Lamprecht [Tue, 29 Nov 2022 09:28:10 +0000 (10:28 +0100)]
ui: datastore options: fix default for prune notify render

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
23 months agobump version to 2.3.1-1 v2.3.1
Thomas Lamprecht [Mon, 28 Nov 2022 16:18:15 +0000 (17:18 +0100)]
bump version to 2.3.1-1

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
23 months agodocs: link all screenshots to their image file
Thomas Lamprecht [Mon, 28 Nov 2022 16:15:42 +0000 (17:15 +0100)]
docs: link all screenshots to their image file

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
23 months agod/postinst: try to fixup installations with wrong .datastore.lck owner
Thomas Lamprecht [Mon, 28 Nov 2022 16:03:39 +0000 (17:03 +0100)]
d/postinst: try to fixup installations with wrong .datastore.lck owner

Must be a rather ancient installation in that case as we create
new lockfiles with backup:backup since a while.

Note that this wasn't all to relevant until recently when we fixed a
TOCTOU for maintenance mode check by locking on datastore create,
which happens in the unpriv. proxy daemon too, e.g., for the
datastore status call.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
23 months agobump version to 2.3.0-1
Thomas Lamprecht [Mon, 28 Nov 2022 15:11:09 +0000 (16:11 +0100)]
bump version to 2.3.0-1

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
23 months agodocs: ransomware: drop extra 'd'
Thomas Lamprecht [Mon, 28 Nov 2022 15:02:25 +0000 (16:02 +0100)]
docs: ransomware: drop extra 'd'

Reported-by: Daniel Tschlatscher <d.tschlatscher@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
23 months agodocs: add paragraph on verification jobs to ransomware section
Stefan Sterz [Mon, 28 Nov 2022 14:34:01 +0000 (15:34 +0100)]
docs: add paragraph on verification jobs to ransomware section

Signed-off-by: Stefan Sterz <s.sterz@proxmox.com>
23 months agodocs: minor re-phrasing and spell checking clean up
Stefan Sterz [Mon, 28 Nov 2022 14:34:00 +0000 (15:34 +0100)]
docs: minor re-phrasing and spell checking clean up

Signed-off-by: Stefan Sterz <s.sterz@proxmox.com>
23 months agodocs: don't mention CLI only anymore for tuning options
Dominik Csapak [Mon, 28 Nov 2022 13:26:41 +0000 (14:26 +0100)]
docs: don't mention CLI only anymore for tuning options

since we now have those on the ui

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
23 months agouse derive 'Default' for ChunkOrder
Dominik Csapak [Mon, 28 Nov 2022 13:26:40 +0000 (14:26 +0100)]
use derive 'Default' for ChunkOrder

instead of hardcoding the default deep inside the code. This makes it
much easier to see what is the actual default

the first instance of ChunkOrder::None was only for the test case, were
the ordering doe not matter

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
23 months agoui: datastore tuning: show correct default option
Dominik Csapak [Mon, 28 Nov 2022 13:26:39 +0000 (14:26 +0100)]
ui: datastore tuning: show correct default option

the default in the backend is really 'inode' not 'none', so show that

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
23 months agoui: datastore: override maintenance icon if currently destroying
Thomas Lamprecht [Mon, 28 Nov 2022 14:56:29 +0000 (15:56 +0100)]
ui: datastore: override maintenance icon if currently destroying

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
23 months agoui: datastore: allow to destroy all underlying data on removal
Thomas Lamprecht [Mon, 28 Nov 2022 14:43:59 +0000 (15:43 +0100)]
ui: datastore: allow to destroy all underlying data on removal

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
23 months agoui: datastore: factor out safe datastore destroy
Thomas Lamprecht [Mon, 28 Nov 2022 14:42:48 +0000 (15:42 +0100)]
ui: datastore: factor out safe datastore destroy

will extend it for data-destroy flag in a next commit

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
23 months agofix #3335: allow removing datastore contents on delete
Wolfgang Bumiller [Fri, 25 Nov 2022 08:13:52 +0000 (09:13 +0100)]
fix #3335: allow removing datastore contents on delete

Adds an optional 'destroy-data' parameter to the datastore
remove api call.

Based-on: https://lists.proxmox.com/pipermail/pbs-devel/2022-January/004574.html
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
23 months agoapi-types: add MaintenanceType::Delete
Wolfgang Bumiller [Fri, 25 Nov 2022 10:19:11 +0000 (11:19 +0100)]
api-types: add MaintenanceType::Delete

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
23 months agoapi-types: derive Display and FromStr for MaintenanceType
Wolfgang Bumiller [Fri, 25 Nov 2022 10:18:56 +0000 (11:18 +0100)]
api-types: derive Display and FromStr for MaintenanceType

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
23 months agoapi-types: make Operation Eq
Wolfgang Bumiller [Fri, 25 Nov 2022 10:18:40 +0000 (11:18 +0100)]
api-types: make Operation Eq

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
23 months agoui: prune job edit: set correct onlineHelp reference
Thomas Lamprecht [Mon, 28 Nov 2022 13:43:07 +0000 (14:43 +0100)]
ui: prune job edit: set correct onlineHelp reference

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
23 months agodocs: add section for prune jobs
Thomas Lamprecht [Mon, 28 Nov 2022 13:42:45 +0000 (14:42 +0100)]
docs: add section for prune jobs

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
23 months agodocs: update disks, datastore prune/GC and datastore options screenshots
Thomas Lamprecht [Mon, 28 Nov 2022 13:16:24 +0000 (14:16 +0100)]
docs: update disks, datastore prune/GC and datastore options screenshots

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
23 months agoui: datastore options: use new onSetValues over setValues
Thomas Lamprecht [Mon, 28 Nov 2022 13:00:14 +0000 (14:00 +0100)]
ui: datastore options: use new onSetValues over setValues

The `onSetValues` (pedant to `onGetValues`) got added relatively
recently to widget toolkits input panel. Using it avoids the need to
hard-code some "dynamic override" calling semantics.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
23 months agoui: datastore options: code style line reduction
Thomas Lamprecht [Mon, 28 Nov 2022 12:59:51 +0000 (13:59 +0100)]
ui: datastore options: code style line reduction

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
23 months agoui: docs: update online help info
Thomas Lamprecht [Mon, 28 Nov 2022 12:52:48 +0000 (13:52 +0100)]
ui: docs: update online help info

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
23 months agoui: datastore: add tuning settings to datastore options
Dominik Csapak [Mon, 28 Nov 2022 10:13:06 +0000 (11:13 +0100)]
ui: datastore: add tuning settings to datastore options

Add a simple edit window with 2 combo boxes for `sync-level` and
`chunk-order`.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
 [ T: rework commit message/subject a bit ]
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
23 months agodocs: storage: remove duplicate screenshot, link remaining one
Thomas Lamprecht [Mon, 28 Nov 2022 11:47:16 +0000 (12:47 +0100)]
docs: storage: remove duplicate screenshot, link remaining one

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
23 months agodocs: ransomeware: rework structure and expand
Thomas Lamprecht [Mon, 28 Nov 2022 11:11:18 +0000 (12:11 +0100)]
docs: ransomeware: rework structure and expand

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
23 months agodocs: maintenance: add prune job reference and update title
Thomas Lamprecht [Mon, 28 Nov 2022 11:09:33 +0000 (12:09 +0100)]
docs: maintenance: add prune job reference and update title

this section needs general rework/expansion but to be able to link to
it already now add a reference and only do a minimal title update.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
23 months agodocs: ransom ware: fix some typos commented in review
Thomas Lamprecht [Mon, 28 Nov 2022 09:46:50 +0000 (10:46 +0100)]
docs: ransom ware: fix some typos commented in review

Note that the diff is bigger due to quite some text re-flow.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
23 months agodocs: ransom ware: reflow text to our 80cc
Thomas Lamprecht [Mon, 28 Nov 2022 09:25:23 +0000 (10:25 +0100)]
docs: ransom ware: reflow text to our 80cc

and drop some trailing whitespace while at it

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
23 months agodocs: add section on ransomware and PBS help against it
Noel Ullreich [Fri, 25 Nov 2022 12:10:34 +0000 (13:10 +0100)]
docs: add section on ransomware and PBS help against it

Added a section on ransomware. This includes a bullet point in the
main features section and a section in the backup storage section.
The latter section lists mitigation resources in pbs as well as best
practices.

Updated capitalization to be consistent in main features. Imo, since
these are bullet points and not headings, they should be in lowercase

Signed-off-by: Noel Ullreich <n.ullreich@proxmox.com>
Reviewed-by: Stefan Hanreich <s.hanreich@proxmox.com>
Reviewed-by: Stefan Sterz <s.sterz@proxmox.com>
23 months agodatastore: make 'filesystem' the default sync-level
Dominik Csapak [Fri, 4 Nov 2022 09:49:34 +0000 (10:49 +0100)]
datastore: make 'filesystem' the default sync-level

rationale is that it makes the backup much safer than 'none', but does not
incur a big of a performance hit as 'file'.

here some benchmark:

data to be backed up:
~14GiB semi-random test images between 12kiB and 4GiB
that results in ~11GiB chunks (more than ram available on the target)

PBS setup:
virtualized (on an idle machine), PBS itself was also idle
8 cores (kvm64 on Intel 12700k) and 8 GiB memory

all virtual disks are on LVM with discard and iothread on
the HDD is a 4TB Seagate ST4000DM000 drive, and the NVME is a 2TB
Crucial CT2000P5PSSD8

i tested each disk with ext4/xfs/zfs (default created with the gui)
with 5 runs each, inbetween the caches are flushed and the filesystem synced
i removed the biggest and smallest result and from the remaining 3
results built the average (percentage is relative to the 'none' result)

result:

test         none     filesystem         file
hdd - ext4   125.67s  140.39s (+11.71%)  358.10s (+184.95%)
hdd - xfs    92.18s   102.64s (+11.35%)  351.58s (+281.41%)
hdd - zfs    94.82s   104.00s (+9.68%)   309.13s (+226.02%)
nvme - ext4  60.44s   60.26s (-0.30%)    60.47s (+0.05%)
nvme - xfs   60.11s   60.47s (+0.60%)    60.49s (+0.63%)
nvme - zfs   60.83s   60.85s (+0.03%)    60.80s (-0.05%)

So all in all, it does not seem to make a difference for nvme drives,
for hdds 'filesystem' increases backup time by ~10%, while
for 'file' it largely depends on the filesystem, but always
in the range of factor ~3 - ~4

Note that this does not take into account parallel actions, such as gc,
verify or other backups.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
23 months agod/control: bump version dependency for widget-toolkit 3.5.2
Thomas Lamprecht [Mon, 28 Nov 2022 08:23:10 +0000 (09:23 +0100)]
d/control: bump version dependency for widget-toolkit 3.5.2

to ensure that the moved CSS rules are installed

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
23 months agoui: css: move action columns fix to widget-toolkit
Matthias Heiserer [Fri, 7 Oct 2022 11:18:59 +0000 (13:18 +0200)]
ui: css: move action columns fix to widget-toolkit

Signed-off-by: Matthias Heiserer <m.heiserer@proxmox.com>
2 years agodatastore: actually hold the active operation file lock on update
Wolfgang Bumiller [Fri, 25 Nov 2022 09:35:43 +0000 (10:35 +0100)]
datastore: actually hold the active operation file lock on update

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 years agofix active state when reading task logs
Wolfgang Bumiller [Fri, 25 Nov 2022 12:39:43 +0000 (13:39 +0100)]
fix active state when reading task logs

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 years agobump version to 2.2.8-1
Thomas Lamprecht [Thu, 24 Nov 2022 16:41:51 +0000 (17:41 +0100)]
bump version to 2.2.8-1

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years ago prune jobs: switch default to on-error-only notifications
Thomas Lamprecht [Thu, 24 Nov 2022 16:32:03 +0000 (17:32 +0100)]
 prune jobs: switch default to on-error-only notifications

we can still do that as notifications for prune jobs weren't released
yet.

We may want to evaluate if we adapt (some) other notification types
too on next major release.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoui: nav tree: move config sets to top of the class
Thomas Lamprecht [Thu, 24 Nov 2022 15:53:22 +0000 (16:53 +0100)]
ui: nav tree: move config sets to top of the class

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agodatastore: write chunk: comment utimesat params
Thomas Lamprecht [Thu, 24 Nov 2022 15:52:54 +0000 (16:52 +0100)]
datastore: write chunk: comment utimesat params

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agodocs: intro: fix text-width
Thomas Lamprecht [Thu, 24 Nov 2022 15:52:33 +0000 (16:52 +0100)]
docs: intro: fix text-width

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agodisk: smartctl: ignore bit 2 of exitcode
Dominik Csapak [Thu, 24 Nov 2022 10:17:09 +0000 (11:17 +0100)]
disk: smartctl: ignore bit 2 of exitcode

under some conditions, the smartctl exitcode sets bit 2, even if the
smartctl call succeeded, but has e.g. some warnings derived from the
attributes

we do the same in pve, but it is only the first step in fixing #4353, since
we probably should parse the smartcl output better to include
such warnings

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2 years agocleanup rrd bounds checks in datastore status call
Wolfgang Bumiller [Thu, 24 Nov 2022 12:55:22 +0000 (13:55 +0100)]
cleanup rrd bounds checks in datastore status call

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 years agorrd: add Entry::get() to access the data
Wolfgang Bumiller [Thu, 24 Nov 2022 12:52:43 +0000 (13:52 +0100)]
rrd: add Entry::get() to access the data

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 years agogui: change reporting of the estimated_time_full to "Full" if no space
Daniel Tschlatscher [Wed, 9 Nov 2022 14:25:24 +0000 (15:25 +0100)]
gui: change reporting of the estimated_time_full to "Full" if no space

is left in the datastore. Before, the GUI would report "Never" for the
estimated time full, because the value provided in the backend was in
the past. To get around this, the GUI now reports "Full" if the value
for available reaches 0.

Signed-off-by: Daniel Tschlatscher <d.tschlatscher@proxmox.com>
2 years ago'available' field in rrd data in the API and change usage of 'total'
Daniel Tschlatscher [Wed, 9 Nov 2022 14:25:23 +0000 (15:25 +0100)]
'available' field in rrd data in the API and change usage of 'total'

The API now exposes the field 'available' as well, with which the
unprivileged total is calculated in all corresponsing views in the
frontend.
The rrd charts now also display the total as the unprivileged total
if available, otherwise the absolute total is used.

Signed-off-by: Daniel Tschlatscher <d.tschlatscher@proxmox.com>
2 years agofix #4077: Estimated Full metric on ext4 file systems
Daniel Tschlatscher [Wed, 9 Nov 2022 14:25:22 +0000 (15:25 +0100)]
fix #4077: Estimated Full metric on ext4 file systems

The rrd data now includes tracking the available field in disk usage.
The calculation for the estimated_time_full was adapted to use the
total for the unpriviliged user, which is the sum of used + available.

The total for unprivileged users is preferable, because datastores are
always written to by the backup user. Which means that any storage
space reserved for root is unusable for our purposes.

To avoid resetting the estimate when switching to this new version,
the backend will try to use the available value to calculate the
unprivileged total. When that is not an option, it will fall back to
using the absolute total.

Signed-off-by: Daniel Tschlatscher <d.tschlatscher@proxmox.com>
2 years agocleanup for line limit & less indentation
Wolfgang Bumiller [Thu, 24 Nov 2022 09:40:21 +0000 (10:40 +0100)]
cleanup for line limit & less indentation

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 years agomake tasklog downloadable in the backup server backend
Daniel Tschlatscher [Wed, 23 Nov 2022 14:52:07 +0000 (15:52 +0100)]
make tasklog downloadable in the backup server backend

The read_tasklog API call now stream the whole log file if the query
parameter 'download' is set to true. If the limit parameter is set to
0, all lines in the tasklog will be returned in json format.

To make a file stream and a json response in the same API call work, I
had to use one of the lower level apimethod types from the
proxmox-router. Therefore, the routing declarations and parameter
schemas have been changed accordingly.

Signed-off-by: Daniel Tschlatscher <d.tschlatscher@proxmox.com>
2 years agobump d/control
Wolfgang Bumiller [Wed, 23 Nov 2022 14:47:33 +0000 (15:47 +0100)]
bump d/control

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 years agobump pxar dependency to 0.10.2
Wolfgang Bumiller [Wed, 23 Nov 2022 14:47:07 +0000 (15:47 +0100)]
bump pxar dependency to 0.10.2

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 years agodistinguish between block/chardevs in diff output
Wolfgang Bumiller [Wed, 23 Nov 2022 09:07:23 +0000 (10:07 +0100)]
distinguish between block/chardevs in diff output

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 years agofix #3828: proxmox_backup_debug: Introduce `diff archive` subcommand.
Lukas Wagner [Fri, 28 Oct 2022 10:01:43 +0000 (12:01 +0200)]
fix #3828: proxmox_backup_debug: Introduce `diff archive` subcommand.

This new subcommand compares a pxar archive in two different
snapshots and prints a list of added/modified/deleted file
entries.

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
2 years agoui: prune job edit: fix disabling jobs
Thomas Lamprecht [Tue, 15 Nov 2022 14:26:05 +0000 (15:26 +0100)]
ui: prune job edit: fix disabling jobs

The backend doesn't have an 'enable' option, but 'disable'. Convert
it to avoid a negative value that is checked "enabled".

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoapi-types: derive Ord for BackupDir
Wolfgang Bumiller [Tue, 15 Nov 2022 09:16:54 +0000 (10:16 +0100)]
api-types: derive Ord for BackupDir

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 years agoui: update generated OnlineHelpInfo map
Thomas Lamprecht [Tue, 15 Nov 2022 08:25:09 +0000 (09:25 +0100)]
ui: update generated OnlineHelpInfo map

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoui: improve tape/drive icon positioning/size
Thomas Lamprecht [Tue, 15 Nov 2022 08:24:40 +0000 (09:24 +0100)]
ui: improve tape/drive icon positioning/size

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agofile-restore: move various formats to inline-string macros
Thomas Lamprecht [Tue, 15 Nov 2022 08:08:09 +0000 (09:08 +0100)]
file-restore: move various formats to inline-string macros

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agofile-restore: split out internal QMP logic from unrelated fn
Thomas Lamprecht [Mon, 14 Nov 2022 15:13:29 +0000 (16:13 +0100)]
file-restore: split out internal QMP logic from unrelated fn

Capsule it in a small QMPSock struct impl, make the usage nicer as
the caller should not have to care & keep track of the initial socket
state+details.

A send_raw and send Value method should cover most needs.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agofile restore: allow to pass dimm size via env
Thomas Lamprecht [Mon, 14 Nov 2022 15:07:10 +0000 (16:07 +0100)]
file restore: allow to pass dimm size via env

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agofile restore: limit max dimm size to 512 MB
Thomas Lamprecht [Mon, 14 Nov 2022 14:59:49 +0000 (15:59 +0100)]
file restore: limit max dimm size to 512 MB

this is on top of the normal memory, and over 1.3 GB required is just
huge, sadly the commit adding this has zero details about what setups
fail and what work again with the change, so hard to tell, but any
setup that needs that much sounds like a bug in ZFS or remaining code
here.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agofile restore: move allow-memory-hotplug param from CLI to environment
Thomas Lamprecht [Mon, 14 Nov 2022 14:41:07 +0000 (15:41 +0100)]
file restore: move allow-memory-hotplug param from CLI to environment

avoid the need to loop a parameter through a dozen function which all
don't care about it at all; iff this should be a global oncecell or
lock guarded param.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agofile restore: rename dynamic-memory to auto-memory-hotplug
Thomas Lamprecht [Fri, 11 Nov 2022 09:20:41 +0000 (10:20 +0100)]
file restore: rename dynamic-memory to auto-memory-hotplug

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agofile-restore: make dynamic memory behaviour controllable
Dominik Csapak [Thu, 10 Nov 2022 10:36:29 +0000 (11:36 +0100)]
file-restore: make dynamic memory behaviour controllable

by adding 'dynamic-memory' parameter that controls if we automatically
increase the memory of the guest vm or not

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2 years agolimit ZFS Arc to more smalles possible value
Thomas Lamprecht [Fri, 11 Nov 2022 09:21:37 +0000 (10:21 +0100)]
limit ZFS Arc to more smalles possible value

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agofile restore: list api: fix description of "path"
Thomas Lamprecht [Fri, 11 Nov 2022 09:21:07 +0000 (10:21 +0100)]
file restore: list api: fix description of "path"

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agofile restore: switch some formats to inline template variables
Thomas Lamprecht [Fri, 11 Nov 2022 09:18:40 +0000 (10:18 +0100)]
file restore: switch some formats to inline template variables

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agofix #4287: d/control: recommend proxmox-mail-forward
Fiona Ebner [Fri, 21 Oct 2022 13:02:48 +0000 (15:02 +0200)]
fix #4287: d/control: recommend proxmox-mail-forward

which registers a binary in /root/.forward and handles mail forwarding
to the mail addresss configured for root@pam in PBS. Similar to how it
is done in PVE currently.

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
2 years agofile-restore: dynamically increase memory of vm for zpools
Dominik Csapak [Mon, 31 Oct 2022 11:39:53 +0000 (12:39 +0100)]
file-restore: dynamically increase memory of vm for zpools

when a backup contains a drive with zfs on it, the default memory
size (up to 384 MiB) is often not enough to hold the zfs metadata

to improve that situation, add memory dynamically (1GiB) when a path is
requested that is on zfs. Note that the image must be started with a
kernel capable of memory hotplug.

to achieve that, we also have to add a qmp socket to the vm, so that
we can later connect and add the memory backend and dimm

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2 years agofile-restore: fix deprecated qemu parameters
Dominik Csapak [Mon, 31 Oct 2022 11:39:52 +0000 (12:39 +0100)]
file-restore: fix deprecated qemu parameters

server and nowait are deprecated, so we should use the longform:
server=on and wait=off

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2 years agodocs: add documentation about the 'sync-level' tuning
Dominik Csapak [Fri, 28 Oct 2022 07:34:48 +0000 (09:34 +0200)]
docs: add documentation about the 'sync-level' tuning

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2 years agodatastore: improve sync level code a bit
Dominik Csapak [Fri, 28 Oct 2022 07:34:47 +0000 (09:34 +0200)]
datastore: improve sync level code a bit

fixups for DatastoreFSyncLevel:
* use derive for Default
* add some more derives (Clone, Copy)

chunk store:
* drop to_owned for chunk_dir_path

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2 years agoclippy fixes
Fabian Grünbichler [Mon, 24 Oct 2022 10:10:19 +0000 (12:10 +0200)]
clippy fixes

the dropped .into() is guarded by the bumped build-dependency on
proxmox-sys 0.4.1, the missing Eq is a new clippy lint.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2 years agoreport: add arcstat
Aaron Lauterer [Tue, 18 Oct 2022 12:33:02 +0000 (14:33 +0200)]
report: add arcstat

Signed-off-by: Aaron Lauterer <a.lauterer@proxmox.com>
2 years agofix #4301: correctly pass rate limit parameters to API
Stefan Hanreich [Thu, 20 Oct 2022 13:36:30 +0000 (15:36 +0200)]
fix #4301: correctly pass rate limit parameters to API

With the old code the rate limit parameters got passed in their own
dictionary under the limit key, but the API expects the rate-limit
settings as top-level keys. This commit correctly sets the rate-limit
parameters so the API actually uses them.

Signed-off-by: Stefan Hanreich <s.hanreich@proxmox.com>
2 years agodatastore: implement sync-level tuning for datastores
Dominik Csapak [Thu, 20 Oct 2022 07:40:56 +0000 (09:40 +0200)]
datastore: implement sync-level tuning for datastores

currently, we don't (f)sync on chunk insertion (or at any point after
that), which can lead to broken chunks in case of e.g. an unexpected
powerloss. To fix that, offer a tuning option for datastores that
controls the level of syncs it does:

* None (default): same as current state, no (f)syncs done at any point
* Filesystem: at the end of a backup, the datastore issues
  a syncfs(2) to the filesystem of the datastore
* File: issues an fsync on each chunk as they get inserted
  (using our 'replace_file' helper) and a fsync on the directory handle

a small benchmark showed the following (times in mm:ss):
setup: virtual pbs, 4 cores, 8GiB memory, ext4 on spinner

size                none    filesystem  file
2GiB (fits in ram)   00:13   0:41        01:00
33GiB                05:21   05:31       13:45

so if the backup fits in memory, there is a large difference between all
of the modes (expected), but as soon as it exceeds the memory size,
the difference between not syncing and syncing the fs at the end becomes
much smaller.

i also tested on an nvme, but there the syncs basically made no difference

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2 years agopbs-datastore: chunk_store: use replace_file in insert_chunk
Dominik Csapak [Thu, 20 Oct 2022 07:40:55 +0000 (09:40 +0200)]
pbs-datastore: chunk_store: use replace_file in insert_chunk

it does the same as the current code

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2 years agodocs: add information about chunk order option for datastores
Dominik Csapak [Thu, 20 Oct 2022 07:40:54 +0000 (09:40 +0200)]
docs: add information about chunk order option for datastores

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2 years agoproxmox-tape: inventory: add default to parameters
Dominik Csapak [Wed, 19 Oct 2022 11:13:35 +0000 (13:13 +0200)]
proxmox-tape: inventory: add default to parameters

and convert the 'Option<bool>' to 'bool'

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2 years agoui: tape/ChangerStatus: adding parameter selection to inventory
Dominik Csapak [Wed, 19 Oct 2022 11:13:34 +0000 (13:13 +0200)]
ui: tape/ChangerStatus: adding parameter selection to inventory

namely 'catalog' and 'read-all-labels', by always opening a
window (with a drive now autoselected) and the two checkboxes

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2 years agoproxmox-tape: add 'catalog' option to 'proxmox-tape inventory'
Dominik Csapak [Wed, 19 Oct 2022 11:13:33 +0000 (13:13 +0200)]
proxmox-tape: add 'catalog' option to 'proxmox-tape inventory'

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2 years agoapi/tape/inventory: optionally try to restore catalogs
Dominik Csapak [Wed, 19 Oct 2022 11:13:32 +0000 (13:13 +0200)]
api/tape/inventory: optionally try to restore catalogs

in a disaster recovery case, it is useful to not only re-invetorize
the labels + media-sets, but also to try to recover the catalogs
from the tape (to know whats on there). This adds an option to
the inventory api call that tries to do a fast catalog restore
from each tape to be inventorized.

also sets the correct default for 'read-all-labels' in the api and
converts to a bool

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>