Commit Graph

372 Commits

Author SHA1 Message Date
Fiona Ebner
58ad1835bf bump version to 5.2.2
Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
Link: https://lore.proxmox.com/20250408081233.20843-2-f.ebner@proxmox.com
 [TL: slightly reword changelog entry]
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2025-04-08 10:32:41 +02:00
Fiona Ebner
ca3f9a69a3 d/control: bump dependency for libpve-cluster-perl
For example, otherwise build of qemu-server will fail with:
> unknown file 'mapping/directory.cfg' at /usr/share/perl5/PVE/Cluster.pm
if libpve-cluster-perl is not recent enough and there most likely are
runtime issues too.

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
Link: https://lore.proxmox.com/20250408081233.20843-1-f.ebner@proxmox.com
2025-04-08 10:27:50 +02:00
Thomas Lamprecht
424c1d9367 bump version to 5.2.1
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2025-04-07 22:20:02 +02:00
Hannes Laimer
de2ddf940a replication: delete job even if it is disabled
Currently we skip all disabled jobs, also the ones up for deletion,
which does not make sense. This came up in support.

Signed-off-by: Hannes Laimer <h.laimer@proxmox.com>
Link: https://lore.proxmox.com/20250407085138.4653-1-h.laimer@proxmox.com
2025-04-07 14:04:13 +02:00
Thomas Lamprecht
29721ba4b2 bump version to 5.2.0
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2025-04-06 21:27:58 +02:00
Markus Frank
728afcdf6c add dir mapping section config
Adds a config file for directories by using a 'map' property string for
each node mapping.

example config:
```
some-dir-id
	map node=node1,path=/path/to/share/
	map node=node2,path=/different/location/
```

Signed-off-by: Markus Frank <m.frank@proxmox.com>
 [TL: adapt config path to directory.cfg like in pve-cluster]
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2025-04-06 21:26:35 +02:00
Thomas Lamprecht
5186eefdf3 d/control: bump versioned dependency for libpve-storage
to ensure the 'pve-storage-image-format' is available.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2025-04-03 19:24:24 +02:00
Fiona Ebner
06180926e4 storage tunnel: use pve-storage-image-format standard option
Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
2025-04-03 19:23:40 +02:00
Thomas Lamprecht
90edabc816 bump version to 5.1.7
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2025-04-03 12:01:32 +02:00
Thomas Lamprecht
d0415b8179 storage tunnel: add error handling for cleaning up unix socket file
Warn if removing the socket failed and it still existed when trying to
do so.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2025-04-03 11:59:36 +02:00
Fabian Grünbichler
16ff09f72c storage tunnel: check just-imported image files
remote migration requires elevated privileges already and can thus only be
triggered by trusted sources, but an additional safeguard of checking the image
for external references doesn't hurt.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2025-04-03 11:54:29 +02:00
Dominik Csapak
ef051db594 mapping: pci: add 'live-migration-capable' flag to mappings
so that we can decide in qemu-server to allow live-migration.
The driver and QEMU must be capable of that, and it's the
admin's responsibility to know and configure that

Mark the option as experimental in the description.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Reviewed-by: Christoph Heiss <c.heiss@proxmox.com>
Reviewed-by: Fiona Ebner <f.ebner@proxmox.com>
Tested-by: Christoph Heiss <c.heiss@proxmox.com>
2025-04-03 11:36:55 +02:00
Dominik Csapak
57cd454c42 mapping: pci: check the mdev configuration on the device too
but that lives int he 'global' part of the mapping config, not in a
specific mapping. To check that, add it to the $configured_props from
there.

this requires all call sites to be adapted otherwise the check will
always fail for devices that are capable of mediated devices

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Reviewed-by: Christoph Heiss <c.heiss@proxmox.com>
Reviewed-by: Fiona Ebner <f.ebner@proxmox.com>
Tested-by: Christoph Heiss <c.heiss@proxmox.com>
2025-04-03 11:36:38 +02:00
Thomas Lamprecht
ea022f01c3 abstract migrate: code-style cleanup get_bwlimit
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2025-02-10 16:48:36 +01:00
Fiona Ebner
8d62b1e563 fix #6130: remote migration: untaint bandwidth limit from remote
Remote migration via API will be invoked under Perl's '-T' switch to
detect tainted input used in commands. For remote migration, the
bandwidth limit from the remote side would be such tainted input. This
would lead to failure for offline disk migration when the target
node's bandwidth limit is stricter when invoking the 'pvesm export'
command:

> command 'set -o pipefail && pvesm export rbd:vm-400-disk-0 \
> raw+size - -with-snapshots 0 | /usr/bin/cstream -t 307232768' \
> failed: Insecure dependency in exec while running with -T switch

Untaint the value to fix the issue. Note that the schema for the
bandwidth limits in datacenter.cfg and storage.cfg allows fractional
values.

Avoid re-using the same variable for both, the reply from the remote
(which is a hash) and the actual remote bandwidth limit. This also
makes it possible to use the "assign regex match or die" pattern while
accessing the original value in the error message.

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
2025-02-10 16:40:38 +01:00
Thomas Lamprecht
4c2dd7c226 bump version to 5.1.6
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2024-11-18 08:38:44 +01:00
Thomas Lamprecht
9d15995df3 vzdump common: fix missing comma
Fixes: 5118fac ("vzdump: change-detection: fix description and drop experimental note")
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2024-11-18 08:37:47 +01:00
Thomas Lamprecht
ea43284837 bump version to 5.1.5
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2024-11-17 18:33:49 +01:00
Thomas Lamprecht
5118facafd vzdump: change-detection: fix description and drop experimental note
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2024-11-17 18:32:54 +01:00
Markus Frank
e476bfe4df AbstractConfig: add abstract method to check for resources preventing a snapshot
Signed-off-by: Markus Frank <m.frank@proxmox.com>
Suggested-by: Fiona Ebner <f.ebner@proxmox.com>
2024-11-17 18:08:17 +01:00
Thomas Lamprecht
23ef2fb414 vzdump: avoid declaring whole PBS change-detection mode as experimental
As the legacy option is the long-time and stable default.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2024-07-31 14:35:46 +02:00
Thomas Lamprecht
58923bbb7a bump version to 5.1.4
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2024-07-22 19:18:12 +02:00
Lukas Wagner
1489970288 vzdump: common: allow 'job-id' as a parameter without being in schema
'job-id' is passed when a backup as started as a job and will be
passed to the notification system as matchable metadata. It
can be considered 'internal'.

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
Reviewed-by: Max Carrara <m.carrara@proxmox.com>
2024-07-22 19:11:29 +02:00
Dominik Csapak
c29c6fc736 mapping: pci: make sure all desired properties are checked
by placing all expected properties from the hardware into an 'expected_props'
and those fromt he config into 'configured_props'

the names makes clearer what's what, and we can easily extend it, even
if the data does not come from the mapping (like we'll do with 'mdev')

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2024-07-05 10:22:11 +02:00
Dominik Csapak
8052f6f96f mapping: pci: assert_valid: reword error messages
makes them a bit clearer

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2024-07-05 10:22:11 +02:00
Dominik Csapak
903d06de13 mapping: pci: assert_valid: rename cfg to mapping
to make it clearer what it actually is. Also we want to add the
'real' config as parameter too, and so it's less confusing.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2024-07-05 10:22:11 +02:00
Fabian Grünbichler
a9604f72eb bump version to 5.1.3
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2024-06-10 13:59:34 +02:00
Christian Ebner
35d0e15e84 vzdump: add PBS change detection mode configuration
Define the possible modes to be configured in a PBS file change
detection mode.

Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
2024-06-10 13:02:52 +02:00
Thomas Lamprecht
6ca6ff2365 bump version to 5.1.2
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2024-05-15 19:23:28 +02:00
Fabian Grünbichler
172ab9f5cc storage tunnel: correctly set disk-import parameters
according to the schema, else some combinations of migration / guest /
storage settings will fail validation:

2024-05-15 11:48:51 ERROR: migration_snapshot: type check ('boolean') failed - got ''

since this is client / source side, remote migrations to a remote node
with validation enabled can fail without this change.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2024-05-15 19:21:10 +02:00
Fabian Grünbichler
5dbf4609bd storage tunnel: fix schema definitions
to avoid breakage with schema validation turned on.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2024-05-15 19:21:10 +02:00
Thomas Lamprecht
ff2208849c bump version to 5.1.1
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2024-04-18 10:20:23 +02:00
Fiona Ebner
45c3553562 replication: snapshot cleanup: only attempt to remove snapshots that exist
Since commit a6f5b35 ("replication: prepare: include volumes without
snapshots in the result"), attempts would be made to remove previous
replication snapshots from volumes on which they didn't exist. This
was noticed by Thomas since the output of a replication test in
pve-manager changed.

The issue is not completely new, i.e. there was no check that the
(previous) replication snapshot acutally exists before attempting
removal during the cleanup phase. Fix the issue by adding such a
check.

The $replicate_snapshots hash is only used for this, so the change
there is fine.

Fixes: a6f5b35 ("replication: prepare: include volumes without snapshots in the result")
Reported-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
2024-04-18 10:19:59 +02:00
Thomas Lamprecht
bfc998e0f0 bump version to 5.1.0
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2024-04-17 17:39:52 +02:00
Thomas Lamprecht
1d06c1bf95 guest helpers: avoid checking user/token if one can abort all tasks
If the user can already stop all tasks there is no point in spending
some work on every task to check if the user could also stop if
without those powerful permissions.

To avoid to much indentation rework the filter to an early-next style.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2024-04-17 17:30:53 +02:00
Friedrich Weber
253a2ea93d guest helpers: add helper to abort active guest tasks of a certain type
Given a `(type, user, vmid)` tuple, the helper aborts all tasks of the
given `type` for guest `vmid` that `user` is allowed to abort:

- If `user` has `Sys.Modify` on the node, they can abort any task
- If `user` is an API token, it can abort any task it started itself
- If `user` is a user, they can abort any task started by themselves
  or one of their API tokens.

The helper is used to overrule any active qmshutdown/vzshutdown tasks
when attempting to stop a VM/CT (if requested).

Signed-off-by: Friedrich Weber <f.weber@proxmox.com>
2024-04-17 17:24:11 +02:00
Fiona Ebner
58c48f3ef0 vzdump: schema: make storage for fleecing semi-optional
so it doesn't need to be set when explicitly disabling fleecing. Needs
a custom verifier to enforce it being set when enabled.

Suggested-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2024-04-11 19:13:29 +02:00
Fiona Ebner
ceb527c870 vzdump: schema: add fleecing property string
It's a property string, because that avoids having an implicit
"enabled" as part of a 'fleecing-storage' property. And there likely
will be more options in the future, e.g. threshold/limit for the
fleecing image size.

Storage is non-optional, so the storage choice needs to be a conscious
decision. Can allow for a default later, when a good choice can be
made further down the stack. The original idea with "same storage as
VM disk" is not great, because e.g. for LVM, it would require the same
size as the disk up front.

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
 [ TL: style fix for whitespace placement in multi-line strings ]
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2024-04-11 19:08:39 +02:00
Dominik Csapak
bdf06beb0a mapping: pci: fix missing description/default for mdev
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2024-04-11 18:20:17 +02:00
Fiona Ebner
5e1f2f38d2 abstract config: fix snapshot needed by replication check
Do not pass the cleanup flag to get_replicatable_volumes() which leads
to replicatable volumes that have the replicate setting turned off to
be part of the result.

Instead pass the noerr flag, because things like missing the
storage-level replicate feature should not lead to an error here.

Reported in the community forum:
https://forum.proxmox.com/threads/120910/post-605574

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
2024-04-11 18:13:44 +02:00
Fiona Ebner
f657b6abeb replication: find common base: improve error when no common base snapshot exists
Suggest an alternative solution by removing the problematic volumes
from the replication target rather than the whole job.

This is helpful if there are multiple replicated volumes to avoid the
need to fully re-sync all volumes in many cases.

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
2024-04-11 18:13:44 +02:00
Fiona Ebner
a6f5b35851 replication: prepare: include volumes without snapshots in the result
Note that PVE::Storage::volume_snapshot_info() will fail when a volume
does not exist, so no non-existing volume will end up in the result
(prepare() is only called with volumes that should exist).

This makes it possible to detect a volume without snapshots in the
result of prepare(), and as a consequence, replication will now also
fail early in a situation where source and remote volume both exist,
but (at least) one of them doesn't have any snapshots.

Such a situation can happen, for example, by deleting and re-creating
a volume with the same name on the source side without running
replication after deletion.

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
2024-04-11 18:13:44 +02:00
Thomas Lamprecht
f28a4d1398 bump version to 5.0.6
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-11-21 13:31:14 +01:00
Thomas Lamprecht
06c318c45e vzdump: fixup style for multi-line literal strings
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-11-21 13:29:43 +01:00
Lukas Wagner
e5278e9827 vzdump: config: add 'notification-mode' param for backup jobs
'legacy-sendmail': Use mailto/mailnotification parameters and send
emails directly.
'notification-system': Always notify via notification system
'auto': Notify via mail if mailto is set, otherwise use notification
system.

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
2023-11-21 13:23:12 +01:00
Lukas Wagner
53bee4f466 vzdump: deprecate mailto/mailnotification/notification-{target, policy}
The first two will be migrated to the notification system, the second
were part for the first attempt for the new notification system.
The first attempt only ever hit pvetest, so we simply tell the user
to not use the two params.

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
2023-11-17 14:59:15 +01:00
Thomas Lamprecht
16bf01217c bump version to 5.0.5
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-09-18 16:47:40 +02:00
Alexander Zeidler
9234d8a1fe fix #3069: vzdump: schema: add 'pbs-entries-max' property
configuring pbs-entries-max can avoid failing backups due to a high
amount of files in folders where a folder exclusion is not possible

Signed-off-by: Alexander Zeidler <a.zeidler@proxmox.com>
2023-09-18 16:46:40 +02:00
Fiona Ebner
018565379e replication: avoid passing removed storages to target
After removing a storage, replication states can still contain
references to it, even if no volume references it anymore.

If a storage does not exist in the storage configuration, the
replication target runs into an error when preparing the job locally.
This error prevents both running and removing the replication job. Fix
it by not passing the invalid storage ID in the first place.

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
2023-08-30 11:52:56 +02:00
Wolfgang Bumiller
8a81208e4d bump version to 5.0.4
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2023-07-24 15:22:15 +02:00