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>
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>
Sorting the OSD tree by the name column compared the names as plain
strings, so 'osd.10' and 'osd.11' ended up before 'osd.8' and 'osd.9',
and the same happened for host names like 'pve10' and 'pve2'.
Add a sorter to the name column that compares numbers in the names by
their value, like it is already done for the storage content view.
Signed-off-by: Michal Fox <me@dualfroz.com>
The size fields for creating and resizing disks of VMs and mount points
of containers only accepted up to 128 TiB. The API does not have such a
limit, so larger disks could only be created or resized on the CLI.
Remove the limit from the size fields, like it was done for the memory
fields in commit fdce7d56 ("Remove swap/memory limit in the Manager,
fixes#1799").
Signed-off-by: Michal Fox <me@dualfroz.com>
When selecting a raw PCI device, a warning should be shown if the device
is not in a separate IOMMU group. To not count the other functions of
the selected device itself, the check only compares the bus and device
part of the PCI IDs, by taking their first five characters.
But since the PCI selector also shows the domain, for example
'0000:01:00.0', the first five characters are just the domain. So all
devices of the same domain were treated as functions of the selected
device and the warning was never shown.
Compare everything before the function instead, so the domain, bus and
device, like the IOMMU check in the PCI mapping editor does.
Fixes: f36240c5 ("gui: pci passthrough: consider domain in PCISelector")
Signed-off-by: Michal Fox <me@dualfroz.com>
When adding an entry to an IPSet, the alias selector lists all aliases,
including those that are already part of the IPSet. Selecting one of
them only results in an "already exists" error from the API.
Pass the current entries of the IPSet to the add window and filter the
matching aliases out of the selector. Aliases are stored in the IPSet
with the same scoped reference the selector uses as value, so an exact
comparison is sufficient.
Signed-off-by: Michal Fox <me@dualfroz.com>
Reviewed-by: Arthur Bied-Charreton <a.bied-charreton@proxmox.com>
Tested-by: Arthur Bied-Charreton <a.bied-charreton@proxmox.com>
Link: https://lore.proxmox.com/20260929142331.2990690-1-me@dualfroz.com
The API only accepts resource mapping IDs in the 'pve-configid' format,
but the name field of the PCI, USB and directory mapping windows takes
any value. A name like 'gpu@node1' is thus only rejected after
submitting, with a generic "invalid configuration ID" error that does
not tell which characters are allowed.
Use the existing 'ConfigId' vtype, so the field is marked invalid right
away and its tooltip lists the allowed characters.
Signed-off-by: Michal Fox <me@dualfroz.com>
Link: https://lore.proxmox.com/20260929141313.2873638-1-me@dualfroz.com
Like for the upload, '.raw' was appended to the name of '.img' images
downloaded as import content, which breaks importing images in other
formats, such as the qcow2 based Ubuntu cloud images.
After querying the URL of such an image, show a format selector and
append the extension of the selected format to the file name instead.
Signed-off-by: Michal Fox <me@dualfroz.com>
Link: https://lore.proxmox.com/20260929135840.2748665-3-me@dualfroz.com
When uploading a '.img' file as import content, '.raw' is appended to
the file name, so the image is always treated as a raw image. But the
'.img' extension is also commonly used for other formats, for example
the Ubuntu cloud images are qcow2 images. Such an image is then
imported as raw disk, which results in a disk with the size of the
qcow2 file and a guest that does not boot.
The format cannot be derived from the '.img' extension, so show a
format selector for such files and only append the extension of the
selected format to the file name. The upload stays disabled until a
format is selected, so the choice is always an explicit one.
Signed-off-by: Michal Fox <me@dualfroz.com>
Link: https://lore.proxmox.com/20260929135840.2748665-2-me@dualfroz.com
For privacy reasons, browsers do not expose the real path of a selected
file and prefix its name with 'C:\fakepath\' instead, on every
platform. The file field of the upload window shows this value as is,
which confuses users on Linux or macOS clients.
Show the name of the selected file object instead. Only the displayed
value changes, the upload itself uses the file object and is not
affected.
Signed-off-by: Michal Fox <me@dualfroz.com>
Reviewed-by: Max R. Carrara <m.carrara@proxmox.com>
Tested-by: Max R. Carrara <m.carrara@proxmox.com>
Link: https://lore.proxmox.com/20260926084935.7-1-me@dualfroz.com
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>
The API only allows backup job IDs of up to 50 characters, so mark
longer values as invalid in the edit window already, instead of failing
on submit.
Signed-off-by: Michal Fox <me@dualfroz.com>
The guest list in the backup job editor filters the resource store by
the selected pool. With a plain string value, ExtJS matches any pool
that starts with it, ignoring case, so selecting 'Clients' also listed
the guests of 'Clients/Client1', 'Clients/Client2' and 'clients'.
The job itself only backs up the guests of the selected pool, so the
editor suggested that guests are covered which are not.
Match the pool id exactly and case-sensitively.
Signed-off-by: Michal Fox <me@dualfroz.com>
The memory usage column of the node selector, used e.g. in the
migration dialog, and of the HA node priority selector shows a
percentage, but uses the raw 'mem' bytes as data index. Sorting by that
column thus sorts by used bytes, which does not match the displayed
values as soon as the nodes have a different amount of memory.
Add a calculated 'memuse' field, like the resource store already has,
and use it for the column. This also makes the percentage renderer
receive a ratio here, like everywhere else, which allows dropping its
bytes fallback in a follow-up.
Signed-off-by: Michal Fox <me@dualfroz.com>
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>
render_mem_usage_percent() treated any value above 1 as a byte count
and recalculated the percentage from 'mem' and 'maxmem'. But the memory
usage ratio of a guest can legitimately exceed 1, for example when the
reported usage is the host-side memory of the QEMU process, which
includes its own overhead. In the reported case, 'mem' was 2222472192
with a 'maxmem' of 2147483648, so the ratio of about 1.035 got taken as
bytes and the search and resource grids showed 0.0 % instead of 103.5 %.
All users of the renderer now pass the usage as a ratio, so drop the
bytes fallback and always render the value as percentage.
Signed-off-by: Michal Fox <me@dualfroz.com>