5
0
mirror of git://git.proxmox.com/git/pve-guest-common.git synced 2025-01-31 01:47:21 +03:00

307 Commits

Author SHA1 Message Date
Stefan Hanreich
f5dbf998dc vzdump: improve description of bwlimit parameter
This makes the description consistent with the other places that
have bwlimit as a parameter as well.

Signed-off-by: Stefan Hanreich <s.hanreich@proxmox.com>
2023-06-06 17:56:47 +02:00
Thomas Lamprecht
99bcf18468 bump version to 5.0.0
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-05-22 13:24:50 +02:00
Thomas Lamprecht
d412cf7ae1 d/control: define compat level via build-depends and raise to 13
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-05-22 13:24:50 +02:00
Thomas Lamprecht
408800ff77 d/control: raise standards version compliance to 4.6.2
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-05-22 13:24:50 +02:00
Thomas Lamprecht
f05c2303fa buildsys: add sbuild convenience target
And only run lintian explicitly for the dsc target, as sbuild runs it
itself anyway

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-05-22 13:24:50 +02:00
Thomas Lamprecht
cdf9756618 buildsys: cleanup and expand clean target
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-05-22 13:24:50 +02:00
Thomas Lamprecht
d0a94a5372 buildsys: derive upload dist automatically
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-05-22 13:24:50 +02:00
Thomas Lamprecht
9a75d60723 buildsys: make build-dir generation atomic
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-05-22 13:24:50 +02:00
Thomas Lamprecht
f26cc0b2d4 buildsys: use full DEB_VERSION
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-05-22 13:24:50 +02:00
Thomas Lamprecht
1ae23d630a d/control: wrap-and-sort -tkn
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-05-22 12:53:23 +02:00
Thomas Lamprecht
fc81777b3d src/makefile: convert to use simple parenthesis
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-05-22 12:30:42 +02:00
Thomas Lamprecht
77ca89a73f bump version to 4.2-4
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-03-16 11:54:08 +01:00
Thomas Lamprecht
c95b563b7b config: ensure definedness for iterating pending & snapshot volumes
while it will work as is, autovivification can be a real PITA so this
should make it more robust and might even avoid having the one or
other warning about accessing undef values in logs.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-03-16 11:48:51 +01:00
Fiona Ebner
c788e7c8d1 fix #4572: config: also update volume IDs in pending section
The method is intended to be used in cases where the volumes actually
got renamed (e.g. migration). Thus, updating the volume IDs should of
course also be done for pending changes to avoid changes referring to
now non-existent volumes or even the wrong existing volume.

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
2023-03-16 10:27:44 +01:00
Thomas Lamprecht
c363e8245c abstract migrate: avoid branched loop, move error-level into prefix
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-01-12 13:01:18 +01:00
Thomas Lamprecht
fb2bf95ebb abstract migrate: rename tstr to prefix
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-01-12 13:00:33 +01:00
Thomas Lamprecht
2b062714d8 abstract migrate: minimal code cleanups
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-01-12 12:59:37 +01:00
Thomas Lamprecht
790f7f1f97 abstract migrate: sort and split use statements
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-01-12 11:21:57 +01:00
Thomas Lamprecht
5ae2f221e2 bump version to 4.2-3
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2022-11-21 08:17:36 +01:00
Thomas Lamprecht
091598000c tag helpers: add get_unique_tags method for filtering out duplicates
tags must be unique, allow the user some control in how unique (case
sensitive) and honor the ordering settings (even if I doubt any
production setups wants to spent time and $$$ on cautiously
reordering all tags of their dozens to hundreds virtual guests..

Have some duplicate code to avoid checking to much in the loop
itself, as frequent branches can be more expensive.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2022-11-21 08:15:21 +01:00
Thomas Lamprecht
2bf45e382a tag helpers: code/style cleanup and reduction
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2022-11-21 08:09:02 +01:00
Thomas Lamprecht
a5cbcc91c7 bump version to 4.2-2
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2022-11-17 13:14:03 +01:00
Thomas Lamprecht
a2fc394c75 d/control: bump versioned dependency for libpve-cluster-perl to >= 7-2-3
to ensure we got the tag stuff available

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2022-11-17 13:11:48 +01:00
Dominik Csapak
2b00f6236d GuestHelpers: add tag related helpers
'get_allowed_tags':
returns the allowed tags for the given user

'assert_tag_permissions'
helper to check permissions for tag setting/updating/deleting
for both container and qemu-server

gets the list of allowed tags from the DataCenterConfig and the current
user permissions, and checks for each tag that is added/removed if
the user has permissions to modify it

'normal' tags require 'VM.Config.Options' on '/vms/<vmid>', but not
allowed tags (either limited with 'user-tag-access' or
'privileged-tags' in the datacenter.cfg) requrie 'Sys.Modify' on '/'

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2022-11-17 10:24:33 +01:00
Thomas Lamprecht
b208122a11 bump version to 4.2-1
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2022-11-12 16:52:14 +01:00
Thomas Lamprecht
fb8d2eeca7 d/control: bump versioned dependency for libpve-common-perl to 7.2-6
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2022-11-12 16:50:22 +01:00
Thomas Lamprecht
a90246abb1 vzdump: comment that vzdump.cron is the legacy parser
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2022-11-12 16:30:02 +01:00
Thomas Lamprecht
57f3baeb76 vzdump: handle new jobs.cfg when removing VMIDs from backup jobs
we use the relatively new SectionConfig functionallity of allowing to
parse/write unknown config types, that way we can directly use the
directly available base job plugin for vzdump jobs and update only
those, keeping the other jobs untouched.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2022-11-12 16:25:39 +01:00
Thomas Lamprecht
1791dd4a71 add VZDump::JobBase, split out from manager
We need access to vzdump type jobs at this level, else we cannot do
things like removing VMIDs on purge of their guest.

So split out the independent part (all but the actual run method)
from pve-manager's PVE::Jobs::VZDump module.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2022-11-12 16:21:35 +01:00
Thomas Lamprecht
915e7a0216 vzdump: re-factor remove_vmid_from_jobs to checking a single job
that way we'll be able to re-use it for adding support of cleaning
out vzdump jobs from the newish job.cfg

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2022-11-12 14:18:08 +01:00
Wolfgang Bumiller
b41392062f bump version to 4.1-4
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2022-10-12 14:02:29 +02:00
Fiona Ebner
e8d7ef5be3 vzdump: add 'performance' property string as a setting
Initially, to be used for tuning backup performance with QEMU.

A few users reported IO-related issues during backup after upgrading
to PVE 7.x and using a modified QEMU build with max-workers reduced to
8 instead of 16 helped them [0].

Also generalizes the way vzdump property string are handled for easier
extension in the future.

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

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
2022-10-10 13:02:53 +02:00
Thomas Lamprecht
bdbc909757 bump version to 4.1-3
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2022-09-27 13:15:54 +02:00
Fiona Ebner
18b6c8d1fe replication: avoid "expected snapshot missing" warning when irrelevant
Only print it when there is a snapshot that would've been removed
without the safeguard. Mostly relevant when a new volume is added to
an already replicated guest.

Fixes replication tests in pve-manager.

Fixes: c0b2948 ("replication: prepare: safeguard against removal if expected snapshot is missing")
Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
2022-09-26 11:23:17 +02:00
Fiona Ebner
c0b29481e4 replication: prepare: safeguard against removal if expected snapshot is missing
Such a check would also have prevented the issue in 1aa4d84
("ReplicationState: purge state from non local vms") and other
scenarios where state and disk state are inconsistent with regard to
the last_sync snapshot.

AFAICT, all existing callers intending to remove all snapshots use
last_sync=1 so chaning the behavior for other (non-zero) values should
be fine.

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
2022-08-02 11:05:52 +02:00
Fiona Ebner
1e6416f172 replication: also consider storages from replication state upon removal
This prevents left-over volume(s) in the following situation:
1. replication with volumes on different storages A and B
2. remove all volumes on storage B from the guest configuration
3. schedule full removal before the next normal replication runs

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
2022-08-02 11:05:49 +02:00
Fiona Ebner
4c1bd50289 replication: rename last_snapshots to local_snapshots
because prepare() was changed in 8d1cd44 ("partially fix #3111:
replication: be less picky when selecting incremental base") to return
all local snapshots.

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
2022-08-02 11:05:45 +02:00
Fiona Ebner
efe85efbb7 replication: prepare: adapt/expand function comment
Commit 8d1cd44 ("partially fix #3111: replication: be less picky when
selecting incremental base") changed prepare() to return all local
snapshots.

Special behavior regarding last_sync is also better mentioned
explicitly.

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
2022-08-02 11:05:38 +02:00
Dominik Csapak
f1fc7d6c61 ReplicationState: deterministically order replication jobs
if we have multiple jobs for the same vmid with the same schedule,
the last_sync, next_sync and vmid will always be the same, so the order
depends on the order of the $jobs hash (which is random; thanks perl)

to have a fixed order, take the jobid also into consideration

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Reviewed-by: Fabian Ebner <f.ebner@proxmox.com>
2022-06-08 08:48:04 +02:00
Dominik Csapak
1aa4d844a1 ReplicationState: purge state from non local vms
when running replication, we don't want to keep replication states for
non-local vms. Normally this would not be a problem, since on migration,
we transfer the states anyway, but when the ha-manager steals a vm, it
cannot do that. In that case, having an old state lying around is
harmful, since the code does not expect the state to be out-of-sync
with the actual snapshots on disk.

One such problem is the following:

Replicate vm 100 from node A to node B and C, and activate HA. When node
A dies, it will be relocated to e.g. node B and start replicate from
there. If node B now had an old state lying around for it's sync to node
C, it might delete the common base snapshots of B and C and cannot sync
again.

Deleting the state for all non local guests fixes that issue, since it
always starts fresh, and the potentially existing old state cannot be
valid anyway since we just relocated the vm here (from a dead node).

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Reviewed-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
Reviewed-by: Fabian Ebner <f.ebner@proxmox.com>
2022-06-08 08:48:04 +02:00
Thomas Lamprecht
3802f3ddd0 vzdump config: limit notes template to maximal 1024 characters
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2022-06-08 08:47:59 +02:00
Fabian Ebner
8ec108b341 vzdump: update notes-template description
as the actual handling in pve-manager changed a bit.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2022-04-28 15:06:43 +02:00
Thomas Lamprecht
54fba1b4a9 bump version to 4.1-2
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2022-04-27 18:51:21 +02:00
Fabian Ebner
51cbaa3f93 vzdump: schema: add 'notes-template' and 'protected' properties
In command_line(), notes are printed, quoted, but otherwise as is,
which is a bit ugly for multi-line notes. But it is part of the
commandline, so print it.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2022-04-27 10:45:59 +02:00
Thomas Lamprecht
73a3e4cb23 replication config: retry first three failed times quicker before going to 30m
So the repeat frequency for a stuck job is now:
t0 -> fails
t1 = t0 +  5m -> repat
t2 = t1 + 10m = t0 + 15m -> repat
t3 = t2 + 15m = t0 + 30m -> repat
t4 = t3 + 30m = t0 + 60-> repat
then
tx = tx-1 + 30m -> repat

So, we converge more naturally/stable to the 30m intervals than
before, when t3 would have been t0 + 45m.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2022-04-27 09:59:26 +02:00
Thomas Lamprecht
3bf8e49a94 replication config: code cleanup
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2022-04-27 09:58:41 +02:00
Thomas Lamprecht
e6e1550049 print snapshot tree: reduce indentation delta per level
previous:

> `-> foo                         2021-05-28 12:59:36 no-description
>   `-> bar                       2021-06-18 12:44:48 no-description
>     `-> current                                     You are here!

now:

> `-> foo                         2021-05-28 12:59:36 no-description
>  `-> bar                        2021-06-18 12:44:48 no-description
>   `-> current                                       You are here!

So requires less space, allowing deeper snapshot trees to still be
displayed nicely, and looks even better while doing that - the latter
may be subjective though.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2022-03-01 13:06:35 +01:00
Dominik Csapak
9fca8f9d5e print snapshot tree: clamp indentation length to positive
If a user has many snapshots, the length heuristic can go negative
and produce wrong indentation, so clamp it at 0.

Reported in the forum: https://forum.proxmox.com/threads/105740/

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2022-03-01 12:59:38 +01:00
Thomas Lamprecht
6a5f25ee19 bump version to 4.1-1
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2022-02-09 18:28:20 +01:00
Fabian Grünbichler
1fa3dc1994 add storage tunnel module
encapsulating storage-related tunnel methods, currently
- source-side storage-migrate helper
- target-side disk-import handler
- target-side query-disk-import handler
- target-side bwlimit handler

to be extended further with replication-related handlers and helpers.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2022-02-09 18:22:29 +01:00