Commit Graph

585 Commits

Author SHA1 Message Date
Stoiko Ivanov
5641693298 ui: qemu: unify enabled state of pci, usb and rng
all 3 additions fail in the backend, if a user does not have
VM.Config.HWType on the VM.

unify their display to cause less confusion, to the most recently
added version for the rng.

drop the now unused noHWPerm (eslint reminded me about that).

found while reviewing:
https://lore.proxmox.com/all/20250408195959.0b1f3aaf@rosa.proxmox.com/T/#t

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
Link: https://lore.proxmox.com/20250408181640.2332561-1-s.ivanov@proxmox.com
2025-04-09 08:01:53 +02:00
Friedrich Weber
c7b75cc57f ui: qemu: hardware view: fix hwrng cap check for unprivileged users
Currently, as an unprivileged user with role PVEVMUser the GUI breaks
with an error after navigating to a VM's hardware tab. The reason is
that the frontend checks the GUI capabilities via accessing
`caps.mapping.hwrng`, but `caps.mapping` does not actually have a
property called `hwrng`.

The reason this does not trigger for more privileged users is that all
expressions involving `caps.mapping.hwrng` are short-circuited if the
user has privilege `VM.Config.HWType`, so `caps.mapping.hwrng` is
never evaluated.

Fixes: a47a8afb ("ui: let non-root users configure VirtIO RNG devices")
Signed-off-by: Friedrich Weber <f.weber@proxmox.com>
Reviewed-by: Stoiko Ivanov <s.ivanov@proxmox.com>
Tested-by: Stoiko Ivanov <s.ivanov@proxmox.com>
Tested-by: Stefan Hanreich <s.hanreich@proxmox.com>
Link: https://lore.proxmox.com/20250408163856.116576-1-f.weber@proxmox.com
 [TL: typos in commit message]
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2025-04-08 20:26:27 +02:00
Fiona Ebner
0b29ea8a42 ui: virtiofs edit: drop writeback checkbox
VirtIO-fs using writeback cache seems very broken at the moment. If a
guest accesses a file (even just using 'touch'), that the host is
currently writing, the guest can permanently end up with a truncated
version of that file. Even subsequent operations like moving the file,
will not result in the correct file being visible, but just rename the
truncated one.

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
2025-04-08 17:29:38 +02:00
Thomas Lamprecht
72bfd176e2 ui: qemu: rework Virtiofs input panel layout and increase window size
This looked very crammed and unpolished, with labels spanning multiple
lines, not following our standard title casing for labels, having text
in parenthesis on labels, having something like 'dirid' as empty text,
which gives the users exactly zero useful info, most of these should
have been noted in early review already.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2025-04-08 00:46:40 +02:00
Markus Frank
d67f05bc6f ui: add options to add virtio-fs to qemu config
Signed-off-by: Markus Frank <m.frank@proxmox.com>
Link: https://lore.proxmox.com/20250407134950.265270-11-m.frank@proxmox.com
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2025-04-08 00:46:40 +02:00
Maximiliano Sandoval
419e473456 ui: do not split translatable strings
Splitting the strings adds extra work to translators as they now have
less context to work with.

Signed-off-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
Link: https://lore.proxmox.com/20250228102342.163467-1-m.sandoval@proxmox.com
2025-04-07 15:16:15 +02:00
Michael Köppl
708de5b341 close #3181: ui: display guest name in confirm dialogs
The confirmation dialogs of the following actions are affected by this
change:
* Remove
* Clone
* Migrate
* Snapshot
* Snapshot restore
* Backup VM/CT from config view
* Restore VM/CT from config view

A combination of VM/CT id and name is added to each confirmation dialog.
The order of id and name depends on the sort field selected in the tree
settings. If "Name" is selected, the confirmation dialogs will show "VM
name (VMID)". In any other case, "VMID (VM name)" will be used.

The VM/CT name is considered optional in all handled cases. If it is
undefined, only the VMID will be displayed in the dialog window. No
exceptions are thrown in case of an undefined guest name because it
only extends the information displayed to the user and is not essential
for performing any of the actions above.

Signed-off-by: Michael Köppl <m.koeppl@proxmox.com>
2025-04-07 14:07:35 +02:00
Dominik Csapak
4ecd28022c ui: qemu pci edit: select correct radiobutton when editing
This panel uses a view model for changing between mapping and raw for
disabling fields. Since the view model bindings take effect after
setVMConfig is called, the default value for 'isMapped' of true
overwrote the mode chosen from the config.

To fix that, set the value in the view model there too.

Additionally, check the 'mapped' radiobutton by default instead of
'raw', so that it is the same as the view model.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Link: https://lore.proxmox.com/20250407095029.2950635-1-d.csapak@proxmox.com
2025-04-07 11:52:45 +02:00
Fiona Ebner
0326691c2f fix #6116: ui: qemu: create wizard: order install ISO before additional ISO in boot order
Also clarify the function comment with the original intention for why
this was added in the frontend (the backend cannot know which is
which), see commit fc3a88ad ("ui: qemu wizard: use better boot order
for second cd drive").

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
Link: https://lore.proxmox.com/20250130094956.11374-1-f.ebner@proxmox.com
2025-04-06 21:51:20 +02:00
Philipp Giersfeld
3497c01420 Add configuration options for AMD SEV-SNP
Expand input panel with AMD SEV-SNP selection, and relevant optional
parameters similar to existing options for AMD SEV(-ES).

Further, upon selecting AMD SEV-SNP, issue a warning that EFI disks
are not included when using SEV-SNP.

Signed-off-by: Philipp Giersfeld <philipp.giersfeld@canarybit.eu>
Tested-by: Markus Frank <m.frank@proxmox.com>
Reviewed-by: Markus Frank <m.frank@proxmox.com>
2025-04-04 18:45:24 +02:00
Friedrich Weber
62579dd707 ui: qemu: hardware: htmlEncode unused disk
to avoid interpreting HTML.

Signed-off-by: Friedrich Weber <f.weber@proxmox.com>
2025-04-04 15:26:23 +02:00
Filip Schauer
a47a8afb00 ui: let non-root users configure VirtIO RNG devices
Allow non-root users with the VM.Config.HWType privilege to configure
/dev/urandom & /dev/random as an entropy source for a VirtIO RNG device.
Users with the Mapping.Use privilege on the /mapping/hwrng ACL path may
also configure /dev/hwrng as an entropy source.

Signed-off-by: Filip Schauer <f.schauer@proxmox.com>
2025-04-04 10:26:28 +02:00
Filip Schauer
a601fd6c2b ui: remove warning about entropy starvation of /dev/random
Remove the warning about entropy-starvation when using /dev/random as
the entropy source. This concern no longer applies since the removal of
the blocking entropy pool in kernel version 5.6. [1] [2]

[1] https://git.kernel.org/torvalds/c/acd77500aa8a337baa6d853568c4b55aca48e20f
[2] https://lwn.net/Articles/808575/

Signed-off-by: Filip Schauer <f.schauer@proxmox.com>
2025-04-04 10:26:28 +02:00
Markus Frank
a38c3527a9 ui: qemu: fix the capitalisation of the word clipboard in DisplayEdit
Fixes: 80da5bb97d
Signed-off-by: Markus Frank <m.frank@proxmox.com>
2025-02-04 13:07:25 +01:00
Markus Frank
ed43c2d719 ui: qemu: add vnc clipboard hint for migration
Signed-off-by: Markus Frank <m.frank@proxmox.com>
2025-02-04 13:07:25 +01:00
Dominik Csapak
b66a60f050 ui: wizards: htmlEncode the values in the summary grid
so that we don't accidentally interpret html tags in the values.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2025-01-20 11:35:54 +01:00
Dominik Csapak
38fd419220 ui: hardware/resources: htmlEncode volume ids configs
so we don't interpret html tags in filenames

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2025-01-20 11:34:56 +01:00
Friedrich Weber
adfa98cc88 ui: qemu network IPs: fix error reporting
When the network-get-interfaces API endpoint returns an error, the GUI
currently only displays "No network information" instead of the actual
error message. The reason is that `Ext.String.format` is applied to
`text` to fill in the error message, but the format string `text` does
not contain any tokens. Commit e7f07a2e ("show guest-agent provided ip
address in qemu summary"), which introduced the feature, added a
format string in a variable `msg`, but unintentionally did not use it.
The unused variable `msg` was then removed in 55ee6ba1 ("ui: eslint:
No unused or duplicate variables").

Fix error reporting by re-introducing and actually using the format
string. Also, htmlEncode the error message returned by the backend.

Signed-off-by: Friedrich Weber <f.weber@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2024-12-16 17:44:05 +01:00
Dominik Csapak
a44a318b62 ui: qemu network IPs: htmlEncode backend supplied values
So we show the value as they get sent by the backend, and not get
interpolated as html.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Reported-by: Jens Krabbenhöft <jens@krabbenhoeft.net>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2024-12-16 17:44:05 +01:00
Stefan Hanreich
c7f36f8890 firewall: add forward direction to rule panel
Enables us to use the new forward direction as an option when creating
or editing firewall rules. By introducing firewall_type we can switch
between the available directions depending on which ruleset is being
edited.

Signed-off-by: Stefan Hanreich <s.hanreich@proxmox.com>
Tested-by: Hannes Dürr <h.duerr@proxmox.com>
2024-11-19 16:02:16 +01:00
Markus Frank
66c018376c ui: add AMD SEV configuration to Options
By adding a new input panel with an AMD SEV technology selection combo
box and checkboxes for the optional parameters in an advanced section,
the user can configure the amd_sev option via the WebUI's Options tab.

Signed-off-by: Markus Frank <m.frank@proxmox.com>
Reviewed-by: Shannon Sterz <s.sterz@proxmox.com>
 [ TL: fleeced in a nit from Shannon and went further with some
   personal ones, like using the field label as subject and avoiding
   the exact onlineHelp until pve-docs is bumped ]
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2024-11-18 22:10:00 +01:00
Timothy Nicholson
31965684c9 fix #5787: ui: display guest name in confirmation dialog
Signed-off-by: Timothy Nicholson <t.nicholson@proxmox.com>
2024-11-10 20:12:24 +01:00
Thomas Lamprecht
b42153ff2f ui: qemu cloud-init: use more concise request-failure callback
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2024-11-10 19:58:17 +01:00
Daniel Kral
a0b0e54e18 ui: cloudinit: disallow unprivileged users to regenerate images
Disables the "Regenerate image" button in the VM CloudInit tab for
users, which lack the necessary permission "VM.Config.CloudInit" for the
CloudInit update API endpoint.

This is a cosmetic change as the CloudInit update API endpoint would
fail because of insufficient permissions anyway.

Signed-off-by: Daniel Kral <d.kral@proxmox.com>
2024-11-10 19:56:48 +01:00
Daniel Kral
6cb5aee5c4 ui: cloudinit: use cloudinit update api when regenerating images
Changes the behavior of the "Regenerate Image" button in the VM's
CloudInit tab from using the more expensive VM update API endpoint to
using the CloudInit update API endpoint.

Originally-by: Alexandre Derumier <alexandre.derumier@groupe-cyllene.com>
Signed-off-by: Daniel Kral <d.kral@proxmox.com>
2024-11-10 19:56:48 +01:00
Thomas Lamprecht
67bad2bed6 ui: mdev selector: clarify that config accepts a named PCI mapping now too
The backend and this component accept both, a specific PCI id or a
named mapping since commit 8b33297c6 ("api/ui: improve mdev listing
for pci mappings"), so clarify that by updating the config property
from `pciid` to `pciIdOrMapping`, including the setter method.

Only the setter was used once by our single caller, so update that
there to use the new name.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2024-10-30 11:15:28 +01:00
Dominik Csapak
8b33297c6e api/ui: improve mdev listing for pci mappings
Currently, when we have a PCI resource mapping, we manually check only
the available models for the first PCI entry. This often works, but not
always, since one could have completely different devices in one
mapping, or with the new NVIDIA sysfs api we don't get the generally
available models.

To improve this, extend the parameter for the PCI ID to accept both,
PCI IDs or named mappings, and for the latter mappings, iterate over
all local PCI devices in it and extract the mdev types.

Rename also the parameter to better reflect what it accepts. While the
this is changing a API parameter, it's not a breaking change in this
specific case because the parameter is derived from the URL path, and
any attempt to include the parameter with a name manually is not
possible and  will result in an error:

  duplicate parameter (already defined in URI) with conflicting values!

Since we cannot reach the API handler without giving the parameter
already via the URL, there is no way to give it via name.

Accepting named mappings directly in this API endpoint also vastly
simplifies the UI code, since we now only have to give the mapping to
the selector instead of an (arbitrarily selected) PCI id from that
mapping.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
 [ TL: also split pciid into pci-id for readability and reword message
   slightly ]
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2024-10-30 10:38:46 +01:00
Timothy Nicholson
d161b6c4e0 fix #5302: ui: vm cpu affinity displayed in hardware overview
Signed-off-by: Timothy Nicholson <t.nicholson@proxmox.com>
2024-10-15 15:32:54 +02:00
Friedrich Weber
72c274754d ui: qemu: hardware: fix permission check for adding tpmstate volume
Previously, the "Add -> TPM State" menu item in the GUI was disabled
if the user did not have Sys.Console privileges. This deviated from
the permission check in the backend, which does not require
Sys.Console but (among others) VM.Config.Disk.

Fix this inconsistency by checking for VM.Config.Disk in the frontend
instead of Sys.Console.

Reported in enterprise support.

Signed-off-by: Friedrich Weber <f.weber@proxmox.com>
2024-09-10 12:13:09 +02:00
Maximiliano Sandoval
d76c2b0f9e fix typos in comments
Signed-off-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
2024-07-22 18:28:18 +02:00
Fiona Ebner
5b32251812 ui: qemu: hardware: use asynchronous remove API call for disk hot-unplug
The backend uses a 10 minute timeout for disk hot-unplug, so avoid
using the synchronous call which only has a 30 second timeout.

Commit 3b2e557f ("close #584: ui qemu: changed remove unused disk to
asynchron call") introduced the necessary functionality when removing
unused disks.

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
2024-06-11 13:58:09 +02:00
Fiona Ebner
3dba293d78 ui: qemu: hardware: use background delay for asynchronous remove tasks
Avoids spawning a progress window for tasks that do complete more
quickly than the background delay.

Currently, the remove task is only asynchronous (i.e. using POST) when
it's for an unused disk, but this might change in the future (e.g. for
hot-unplug).

When adding a disk, a background delay of 5 seconds is already used.

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
2024-06-11 13:58:09 +02:00
Thomas Lamprecht
216398458d ui: qemu: clarify that the intel vIOMMU is compatible with AMD
This is definitively a source of confusion otherwise.

Reported-by: Fiona Ebner <f.ebner@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2024-04-22 19:49:33 +02:00
Dominik Csapak
592d91724e ui: qemu machine: update link to better docs section
qm_machine_type is more relevant to this panel thatn qm_system_settings

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2024-04-22 15:20:44 +02:00
Markus Frank
175dff3e29 ui: machine: add link to documentation of the system settings 2024-04-22 14:51:43 +02:00
Markus Frank
10df2d5a65 ui: machine: add viommu ComboBox
Added a proxmoxKVComboBox for selecting a vIOMMU implementation for a VM.
If i440fx is selected, another ComboBox will be enabled/visible that does not
have the Intel option, as Intel-vIOMMU is not compatible with i440fx.

Uses the new machine property-string from the qemu-server's "config: define
machine schema as property-string" commit and the viommu option added in the
qemu-server's "fix #3784: config: Parameter for guest vIOMMU + test-cases"
commit.

Signed-off-by: Markus Frank <m.frank@proxmox.com>
2024-04-22 14:51:43 +02:00
Markus Frank
80da5bb97d ui: qemu: add clipboard ComboBox as a advanced option in DisplayEdit
For SPICE and VNC, a different message is displayed.

The backend code for the clipboard option can be found in the
'config: enable vnc clipboard parameter in vga_fmt'-commit in qemu-server.

Signed-off-by: Markus Frank <m.frank@proxmox.com>
2024-04-22 14:49:35 +02:00
Markus Frank
524be1b994 ui: qemu: change logic to use ViewModel instead of listener function
Signed-off-by: Markus Frank <m.frank@proxmox.com>
Reviewed-by: Dominik Csapak <d.csapak@proxmox.com>
Tested-by: Dominik Csapak <d.csapak@proxmox.com>
2024-04-22 14:49:35 +02:00
Friedrich Weber
e8b411f1c5 fix #4474: ui: guest stop: offer to overrule active shutdown tasks
Implement a new "guest stop" confirmation message box which first
checks if there is an active shutdown task for the same guest that is
visible to the logged-in user. If there is at least one, the dialog
displays an additional default-on checkbox for overruling active
shutdown tasks. If the user confirms and the checkbox is checked, the
UI sends a guest stop API request with the `overrule-shutdown`
parameter set to 1. If there are no active shutdown tasks, or the
checkbox is unchecked, the UI sends a guest stop API request without
`overrule-shutdown`.

To avoid an additional API request for querying active shutdown tasks,
check the UI's current view of cluster tasks instead, which is fetched
from the `pve-cluster-tasks` store.

As the UI might hold an outdated task list, there are some
opportunities for races, e.g., the UI may miss a new shutdown task or
consider a shutdown task active even though it has already terminated.
These races either result in a surviving shutdown task that the user
still needs to abort manually, or a superfluous `override-shutdown=1`
parameter that does not actually abort any tasks. Since "stop
overrules shutdown" is merely a convenience feature, both outcomes
seem bearable.

The confirmation message box is now always marked as dangerous (with a
warning sign icon), whereas previously it was only marked dangerous if
the stop issued from the guest panel, but not when issued from the
resource tree command menu.

Signed-off-by: Friedrich Weber <f.weber@proxmox.com>
Reviewed-by: Dominik Csapak <d.csapak@proxmox.com>
 [ TL: squash in some slightly opinionated code/style clean-ups ]
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2024-04-20 20:32:32 +02:00
Filip Schauer
bbffc765ea Allow moving unused disks to another storage
Signed-off-by: Filip Schauer <f.schauer@proxmox.com>
2024-04-12 11:50:03 +02:00
Aaron Lauterer
6d336ba433 ui: vm: guest-agent network view: make text in grid selectable
This makes it possible to select any of the IP addresses listed in the
full view window to copy & paste it.

Signed-off-by: Aaron Lauterer <a.lauterer@proxmox.com>
 [ TL: reworked subject ]
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2024-03-21 17:56:42 +01:00
Alexandre Derumier
591c2d7beb ui: qemu: bump max cores to 256 by socket
New AMD Epyc CPUs already supports 168 threads and QEMU 8.1 support
1024 cores with q35.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2024-02-20 13:45:30 +01:00
Thomas Lamprecht
571bc9e2f7 ui: qemu os type edit: eslint fixes
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-11-21 14:40:20 +01:00
Thomas Lamprecht
76543c7397 ui: vm wizard: reword label for extra drive for virtio-drivers
while a user can attach anything, we change the defaults for, e.g.,
scsi controller or network to virtio if this is ticked, so try to hint
that a bit better

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-11-21 14:16:35 +01:00
Dominik Csapak
fc3a88ad0d ui: qemu wizard: use better boot order for second cd drive
in the case we add a second cd drive (for windows), we don't want the
backend logic to only include the first one, since we cannot know
which is bootable and which is (probably) the virtio iso.

so instead, emulate the backend logic for the wizard but include both cd
drives in that case, otherwise let the backend decide like before

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2023-11-21 09:47:56 +01:00
Dominik Csapak
5b2e8bd4d1 ui: vm wizard: allow second iso for windows vms
Having a second CD-drive is useful for adding the virtio-win driver
ISO for new installs, and thus we change the default disk type to scsi
and network type to VirtIO.

Add special logic to the OSTypeInputPanel when 'insideWizard' is true
to add an additional checkbox + iso selector

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-11-21 09:34:41 +01:00
Dominik Csapak
fc7b556d4f ui: refactor iso-selector out of the cd input panel
and make it into a proper field.
it's intended to be used like a single field, otherwise exactly as before

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-11-21 09:34:12 +01:00
Christian Ebner
038e94bbbe fix #4442: Add date-time filtering for firewall logs
Extend the current firewall log view to add date time based filtering.
The user can switch between live view, which shows logs from the
unrotated log file, or to filter mode, where date time based filtering,
including rotated logs can be performed.

Enable the feature by setting the property and the submit format
for since and until timestamps expected by the api.

Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
2023-11-13 15:23:49 +01:00
Dominik Csapak
01740cb2f7 ui: factor out standalone node check
into Utils and use it where we manually checked that

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2023-11-13 11:19:46 +01:00
Dominik Csapak
ca97f6301a ui: wizards: allow adding tags in the qemu/lxc create wizard
in the general tab in the advanced section.

For that to work, we introduce a new option for the TagEditContainer
named 'editOnly', which controls now the cancel/finish buttons,
automatically enter edit mode and disable enter/escape keypresses.

We also prevent now the loading of tags while in edit mode, so the tags
don't change while editing (this can be jarring and unexpected).

Then we wrap that all in a FieldSet that implements the Field mixin, so
we can easily use that in the wizard. There we set a maxHeight so that
the field can grow so that it still fits in the wizard.

To properly align the input with the '+' button, we have to add a custom
css class there. (In the hbox we could set the alignment, but this is
not possible in the 'column' layout)

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2023-11-06 17:02:08 +01:00