Commit Graph
18 Commits
Author SHA1 Message Date
dualfroz e6a220f2b1 fix #4986: jobs: do not get stuck if the task log is missing
When the scheduler checks whether the last run of a job has finished,
it dies if the task log of that run does not exist. The job is then
skipped with 'could not update job state, skipping - no such task' on
every iteration, so it never runs again until its state file is
cleaned up manually.

The task log can be gone, for example after a crash. If the task is
not running anymore, treat it as stopped with an error status instead,
so that the job gets scheduled again, like Proxmox Backup Server does
since commit 48fbce07 ("fix #4895: scheduled jobs: ignore task-log not
found error").

The check now comes after the one whether the task is still running,
so a running task does not get marked as stopped.

Signed-off-by: Michal Fox <me@dualfroz.com>
Link: https://lore.proxmox.com/20261003153820.7-1-me@dualfroz.com
[FE: use file_exists()
     issue warning]
Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
2026-10-06 14:13:35 +02:00
upstream 0085410b6c Upstream proxmox-git/pve-manager state of the touched files before ac0c87dd37 2026-10-03 15:38:20 +00:00
dualfroz 8a2a44a473 fix #7178: pve8to9: detect qcow2 TPM state volumes containing raw data
Before qemu-server 8.3.3, cloning a VM template with a raw TPM state on
a directory storage as linked clone created a qcow2 overlay for it.
swtpm_setup used that file as raw TPM state and, as it found no valid
state in it, overwrote it with a new one, turning it into a raw file
with a qcow2 name.

With Proxmox VE 9, the TPM state is attached with the format of the
volume name, so such a VM fails to start with 'Image is not in qcow2
format'. Since qemu-server 8.3.3, it also fails to start on Proxmox VE
8, as swtpm only accepts raw volumes there, but the VM might not have
been started since then.

Check the TPM state volumes of all VMs that are named as qcow2 and on
a file based storage for the qcow2 magic, and warn about those that do
not have it, with how to fix them, as described in the bug report.

Signed-off-by: Michal Fox <me@dualfroz.com>
2026-10-03 03:33:56 +02:00
upstream 11ef65c947 Upstream proxmox-git/pve-manager state of the touched files before c7c382a352 2026-10-03 03:33:15 +02:00
dualfroz 2564208ca8 fix #5997: metrics: influxdb: fall back to the ready endpoint in connection test
The connection test for InfluxDB over HTTP(S) queries the '/health'
endpoint. The InfluxDB v2 listener of Telegraf only has it since
version 1.36, older versions only provide '/api/v2/ready'. So adding
such a listener as metric server fails with '404 Not Found', although
writing metrics to it would work.

If '/health' is not found, query '/api/v2/ready' instead. Other errors,
like an invalid token, are still reported right away.

Signed-off-by: Michal Fox <me@dualfroz.com>
2026-10-03 03:24:10 +02:00
upstream 6cb3347d96 Upstream proxmox-git/pve-manager state of the touched files before f6a1a98be5 2026-10-03 03:24:10 +02:00
dualfroz 723bba9164 fix #5725: pvenode: acme: add options for external account binding
The credentials for external account binding can only be entered
interactively when registering an ACME account with pvenode, and only
if the CA requires them or a custom directory was selected. So they
cannot be passed when the account is registered from a script, or
when the directory is passed with --directory and the CA does not
announce that it requires them.

Add the --eab-kid and --eab-hmac-key options, which the API endpoint
already supports, and only ask for the credentials if they were not
passed.

Signed-off-by: Michal Fox <me@dualfroz.com>
2026-10-03 01:15:47 +02:00
upstream d0798f384d Upstream proxmox-git/pve-manager state of the touched files before addd95543d 2026-10-03 01:15:47 +02:00
dualfroz bddd179228 fix #5990: vzdump: notes template: add pool variable
Backups of guests from different teams or users often end up on the
same storage, and the resource pool of the guest is a common way to
tell them apart. But the pool is not part of the backup, and the VMID
alone is not enough to find out later where a backup came from, as
VMIDs can be reused.

Add a {{pool}} variable to the notes template, which is replaced with
the resource pool the guest is a member of at the time of the backup,
or with an empty string if it is not in any pool, and list it in the
hint of the backup dialogs.

Signed-off-by: Michal Fox <me@dualfroz.com>
2026-10-03 01:13:05 +02:00
upstream 9584686a33 Upstream proxmox-git/pve-manager state of the touched files before 338e084bf0 2026-10-03 01:13:05 +02:00
dualfroz 5537758fe8 fix #6560: metrics: influxdb: do not send storage type as field too
The type of a storage is sent as a tag, but it is also part of the
storage status data and so sent as a field with the same name.
InfluxDB 3 does not allow this and rejects the whole write with:

 'type' is used as both a tag and a field

so no storage metrics end up in the database.

Exclude the type from the fields, like it is already done for the
VMID of guests since commit 456be471 ("fix #3440: influxdb: remove
duplicate vmid tag").

Signed-off-by: Michal Fox <me@dualfroz.com>
2026-10-03 01:09:40 +02:00
upstream c739e509f9 Upstream proxmox-git/pve-manager state of the touched files before ae24f0571f 2026-10-03 01:09:40 +02:00
dualfroz 4be32c6b82 fix #4986: jobs: do not get stuck if the task log is missing
When the scheduler checks whether the last run of a job has finished,
it dies if the task log of that run does not exist. The job is then
skipped with 'could not update job state, skipping - no such task' on
every iteration, so it never runs again until its state file is
cleaned up manually.

The task log can be gone, for example after a crash. If the task is
not running anymore, treat it as stopped with an error status instead,
so that the job gets scheduled again, like Proxmox Backup Server does
since commit 48fbce07 ("fix #4895: scheduled jobs: ignore task-log not
found error").

The check now comes after the one whether the task is still running,
so a running task does not get marked as stopped.

Signed-off-by: Michal Fox <me@dualfroz.com>
2026-10-03 01:07:38 +02:00
upstream 81a3792fe3 Upstream proxmox-git/pve-manager state of the touched files before aeca33cb87 2026-10-03 01:07:38 +02:00
dualfroz 4dfc7eb30c fix #6516: api: backup jobs: limit the job ID length on creation
All backup job API calls that take an existing job ID use the
'pve-backup-jobid' option, which is limited to 50 characters. The
create call uses its own 'id' parameter without that limit, so a longer
ID can be created, but the job can then neither be read, updated nor
deleted through the API or the web UI, and has to be removed from
jobs.cfg by hand.

Apply the same limit when creating the job.

Signed-off-by: Michal Fox <me@dualfroz.com>
2026-09-25 11:31:04 +02:00
upstream bc569c5258 Upstream proxmox-git/pve-manager state of the touched files before 52a2c5c37c 2026-09-25 11:31:04 +02:00
dualfroz c09a3d7d49 fix #7860: api: backup info: skip jobs with invalid guest selection
A backup job in pool mode keeps referencing its pool after the pool got
deleted. Resolving the guests of such a job dies with "pool '<name>'
does not exist", and since get_included_vmids() did not catch this, the
whole /cluster/backup-info/not-backed-up call failed. The GUI then hides
the "Show guests without backup job" button, so users lose exactly the
overview that would tell them some guests are no longer backed up.

Catch the error per job, warn about it and continue with the remaining
jobs. The broken job does not back up anything, so its guests correctly
show up as not covered by any backup job.

Add a test for get_included_vmids() covering this case.

Signed-off-by: Michal Fox <me@dualfroz.com>
2026-09-25 07:15:08 +02:00
upstream ac62170ae2 Upstream proxmox-git/pve-manager state of the touched files before 453c245e58 2026-09-25 07:15:08 +02:00