Commit graph

8053 commits

Author SHA1 Message Date
Thomas Lamprecht
3bf5476b8a bump version to 9.0.11
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2025-10-06 19:13:44 +02:00
Thomas Lamprecht
360e906d53 pveceph: fix variable name and file ending for deb822 formatted ceph repo
In commit 405fcbc1e ("pveceph: switch repo sources to modern deb822
format") we switched away from single-line repos, but the later
rebased commit 9c0ac59e0 ("fix #5244 pveceph: install: add new
repository for offline installation") seemingly missed that change and
was not re-tested, thus it referenced the previous variable name and
old file ending, as this was already pushed let's fix it as this
follow-up.

Fixes: 9c0ac59e0 ("fix #5244 pveceph: install: add new repository for offline installation")
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2025-10-06 19:13:44 +02:00
Thomas Lamprecht
6d8d8d567b pveceph: break-up overly long literal strings over multiple lines
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2025-10-06 17:44:53 +02:00
Aaron Lauterer
e5b2f19060 pveceph: print repo metadata when installing from manual
By printing the site and component, the person installing it manuall has
a final check to see if the correct repository is being used.

Signed-off-by: Aaron Lauterer <a.lauterer@proxmox.com>
Link: https://lore.proxmox.com/20250714083838.68483-3-a.lauterer@proxmox.com
2025-10-06 15:55:54 +02:00
Aaron Lauterer
435004aad4 ui: CephInstallWizard: add option and hint for offline repository
The new 'offline' repository option will not try to configure the Ceph
repositories during installation.

Signed-off-by: Aaron Lauterer <a.lauterer@proxmox.com>
Tested-by: Christoph Heiss <c.heiss@proxmox.com>
Link: https://lore.proxmox.com/20250714083838.68483-2-a.lauterer@proxmox.com
2025-10-06 15:55:54 +02:00
Aaron Lauterer
9c0ac59e09 fix #5244 pveceph: install: add new repository for offline installation
by adding a 4th repository option called 'offline'. If set, the ceph
installation step will not touch the repository configuration.

We add a simple version check to make sure that the latest version
available (and to be installed) does match the selected major Ceph
version.

Signed-off-by: Aaron Lauterer <a.lauterer@proxmox.com>
Tested-by: Christoph Heiss <c.heiss@proxmox.com>
Link: https://lore.proxmox.com/20250714083838.68483-1-a.lauterer@proxmox.com
2025-10-06 15:55:53 +02:00
Nicolas Frey
38ed148a6b ui: guest snapshot: remove excess '}' at the end of window title
Noticed one too many curly braces in the Snapshot window title.

Signed-off-by: Nicolas Frey <n.frey@proxmox.com>
Tested-by: Shan Shaji <s.shaji@proxmox.com>
Link: https://lore.proxmox.com/20251002151609.41473-2-n.frey@proxmox.com
2025-10-03 19:14:12 +02:00
Nicolas Frey
65a80884b0 api: add replication config read return schema
The return props now include programmatically added properties guest,
jobnum, and digest (the latter only being returned in read endpoint)
in addition to the create schema.

Signed-off-by: Nicolas Frey <n.frey@proxmox.com>
Link: https://lore.proxmox.com/20251002124728.103425-3-n.frey@proxmox.com
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2025-10-03 14:19:55 +02:00
Nicolas Frey
6deba095c5 api: add APT versions return schema
The Arch property now includes all officially supported debian
Architectures [0]. These could be extended to include unofficial
ones as well, though I don't see a reason to currently do this.
The CurrentState property now includes all variants according to
the documentation of package AptPkg::Cache.

Also implemented suggestion to clone $apt_package_return_props
instead of modifying, which could've potentially resulted in
unwanted behaviour.

[0] https://wiki.debian.org/SupportedArchitectures

Signed-off-by: Nicolas Frey <n.frey@proxmox.com>
Link: https://lore.proxmox.com/20251002124728.103425-2-n.frey@proxmox.com
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2025-10-03 14:18:38 +02:00
Hannes Laimer
d38659c986 api: cluster: add permission description to log endpoint
Signed-off-by: Hannes Laimer <h.laimer@proxmox.com>
Link: https://lore.proxmox.com/20251003103812.180139-1-h.laimer@proxmox.com
2025-10-03 14:15:40 +02:00
Amin Vakil via pve-devel
3ed06d66d3 close #4248: ui: Add Reset button to VM right click menu
Add the missing 'Reset' action to the VM command menu. All other
actions for managing the VM run state were already present.

Also this patch does not add reset option to containers as they do not
have this option and reboot is already present for containers.

Fixes: https://bugzilla.proxmox.com/show_bug.cgi?id=4248
Signed-off-by: Amin Vakil <info@aminvakil.com>
Link: https://lore.proxmox.com/mailman.631.1754383164.367.pve-devel@lists.proxmox.com
[FE: small improvements to the commit message]
Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
2025-10-02 11:20:37 +02:00
Nicolas Frey
35754e078d api: add service state return schema
values for the respective states (active-state, state, unit-state)
were taken from the systemd manpages [0] for ActiveState, SubState,
and UnitFileState. With the addition of unknown and not-found to
account for logic present in the code.

[0] https://manpages.debian.org/trixie/systemd/org.freedesktop.systemd1.5.en.html

Signed-off-by: Nicolas Frey <n.frey@proxmox.com>
Link: https://lore.proxmox.com/20250924115904.122696-4-n.frey@proxmox.com
 [TL: rename variable for more clarity]
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2025-10-02 10:22:35 +02:00
Nicolas Frey
427e2627c0 api: add ACME plugin return schema
After looking at the code, I don't see any issues with using the
createSchema method. Additionally tested by comparing the output of:
- pvesh usage /cluster/acme/plugins --returns
- pvesh get /cluster/acme/plugins
confirmed that the contents match.

Signed-off-by: Nicolas Frey <n.frey@proxmox.com>
Link: https://lore.proxmox.com/20250924115904.122696-2-n.frey@proxmox.com
 [TL: rename variable used for schema for more clarity]
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2025-10-02 10:22:35 +02:00
Thomas Lamprecht
55ddbb4647 api: nodes: re-tidy perl code
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2025-10-02 10:22:35 +02:00
Thomas Lamprecht
035bf934e4 update shipped appliance info index
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2025-10-01 17:00:42 +02:00
Nicolas Frey
410f25e349 Fix grammar in ifupdown2 version error message
Signed-off-by: Nicolas Frey <n.frey@proxmox.com>
Link: https://lore.proxmox.com/20250919093915.21641-2-n.frey@proxmox.com
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2025-09-22 18:48:42 +02:00
Thomas Lamprecht
deb1ca707e bump version to 9.0.10
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2025-09-12 18:05:17 +02:00
Thomas Lamprecht
145642be3e api: node shells: avoid nested login for already logged in root@pam
When using the vncshell or xtermjs based shells we use a SSH tunnel if
the requested node is different from the one the request was made too.

Further we special case sessions from the root@pam user, as they
already got verified, so do not need to re-login on the target shell.

With Debian Trixie based releases we had to make a change to make this
shell work again [0], it seems that there is still a race in the
whole interaction, at least if there is a nested login shell. See [1]
for more details.

The Debian Trixie version of the `login` manual page explicitly
mentions a bug related to this:

> A recursive login, as used to be possible in the good old days, no
> longer works; for most purposes su(1) is a satisfactory substitute.
> Indeed, for security reasons, login does a vhangup(2) system call
> to remove any possible listening processes on the tty. This is to
> avoid password sniffing. If one uses the command login, then the
> surrounding shell gets killed by vhangup(2) because it’s no longer
> the true owner of the tty. This can be avoided by using exec login
> in a top-level shell or xterm.
-- man 1 login

IIRC this was checked back when implanting [0], but as it was during
quite eventful bootstrapping times of Debian Trixie releases I'm not
100% certain about that.

If the issues our users sometimes (?) see stem indeed from a race
related to above bug, we should be able to avoid that by dropping the
explicit login call for root@pam when tunneling. Other @pam users
would be still affected, but as the partial fix is so simple and
correct in any way it's still worth roll it out sooner.

To improve this more broadly the following two options seem most
promising:

1. Replace the manual SSH tunnel by our proxy-to-node infrastructure
   and tunnel the websocket of the target nodes termproxy command
   through that.

2. Use a wrapper tool to handle the login command such that it does
   not interferes with the outer login, could potentially even be an
   existing one like dtach, or alternatively something we write
   ourselves.

I did not yet evaluate impact and work required for either option to
happen, but from an experienced gut feeling the first option would be
the better one, especially as we want to drop SSH for tunneling
completely in the mid to long term.

As this is not a complete and certain fix for #6789 [1] and especially
as we cannot really reproduce this ourselves here in any useful way,
I refrained from adding a fix # to the commit message, but it should
be a partial fix.

[0]: https://git.proxmox.com/?p=pve-xtermjs.git;a=commitdiff;h=7b47cca8368e63c30f6227442570f9f35dd7ccf0
[1]: https://bugzilla.proxmox.com/show_bug.cgi?id=6789

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2025-09-12 17:24:40 +02:00
Thomas Lamprecht
0f38ce3ee6 api: node shells: make helper aware of tunnel command
Rename the not so telling $remcmd to $tunnel_cmd and make the helper
prefix it to the actual command.

This is a preparation of adapting login for proxied (tunneled) shells,
i.e. where the user requests a shell from another node than they
opened the web UI for.

No semantic change intended.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2025-09-12 17:22:32 +02:00
Dominik Csapak
dbc0ca81d6 ui: fix datacenter notes toolbar visibility
the recent commit
 d2660fc7 (ui: resource tree: improve performance on initial update)
changed how we construct the resource tree, namely outside the
treestore. While it worked fine mostly, the standard
`Ext.data.TreeModel` was used. This lead to problem with the detection
of some things, since we expected all properties that were defined on
the custom `PVETree` model.

To fix this, create an instance of `PVETree` instead.
Note that this might also fix other things that depend on the
PVETree specific properties on the datacenter root node.

Fixes: d2660fc7 (ui: resource tree: improve performance on initial update)
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Tested-by: Michael Köppl <m.koeppl@proxmox.com>
Link: https://lore.proxmox.com/20250912113242.3139402-1-d.csapak@proxmox.com
2025-09-12 16:08:37 +02:00
Thomas Lamprecht
117b893e0e bump version to 9.0.9
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2025-09-10 12:52:06 +02:00
Thomas Lamprecht
0984e4c607 ui: pool grid: never submit value of filter field
As this is for the frontend only and the API will fail due to getting
an unknown property.

Reported-by: Alexander Zeidler <a.zeidler@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2025-09-10 12:45:06 +02:00
Stefan Hanreich
20464270a5 cluster: resources: add sdn property to cluster resources schema
SDN entities return their name in the sdn property. Add this property
to the schema so it is shown in the documentation, as well for
generating proper types in proxmox-api-types.

Signed-off-by: Stefan Hanreich <s.hanreich@proxmox.com>
Link: https://lore.proxmox.com/20250909155423.526917-2-s.hanreich@proxmox.com
2025-09-10 09:58:17 +02:00
Thomas Lamprecht
1d328910bf api: metrics export: update use statements
Quite a bit was unused while a few others were missing and only worked
because other modules loaded them already.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2025-09-10 09:53:01 +02:00
Thomas Lamprecht
e09d688c37 ui: cluster dashboard: streamline warning thresholds for memory usage in node table
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2025-09-09 13:12:12 +02:00
Thomas Lamprecht
2ac4ea1cc7 ui: progress widget: increase default warning threshold from 75% to 80%
This unifies it with other recent changes, as 75% often really is not
a problematic usage, while 80% isn't always problematic either, it's
still closer in practice to a load that might need to be checked out
and use sites can now override this to what makes sense most for their
semantics.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2025-09-09 13:12:12 +02:00
Thomas Lamprecht
157d5322db ui: progress widget: move warning and critical threshold to config
This allows one to override them on the use site.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2025-09-09 13:12:12 +02:00
Thomas Lamprecht
24afc8085a ui: cluster dashboard: use higher warning thresholds for memory gauge
Use the same thresholds for warning and critical as we do now for the
node status overview, see commit 6df3a71bd ("ui: node status: increase
warning/critical threshold percentage for memory usage") for details.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2025-09-09 13:12:12 +02:00
Fabian Grünbichler
21d93bcbab run make-tidy
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2025-09-09 12:05:53 +02:00
Thomas Lamprecht
2f72b02143 bump version to 9.0.8
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2025-09-08 22:57:54 +02:00
Thomas Lamprecht
5b6bfa4a16 ui: guests status: increase threshold for warning/critical memory usage
With a similar rationale than commit f70ea8f7c ("ui: node status:
increase warning/critical threshold percentage for memory usage"),
i.e. memory is there to be used and leveraging most of what's
configured is an OK thing to do, so no need to show a warning status
at already 75% of usage.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2025-09-08 22:48:14 +02:00
Thomas Lamprecht
6df3a71bd4 ui: node status: increase warning/critical threshold percentage for memory usage
Memory is there to be used and unlike with block/file storage it can
be fine, even wanted to use all memory besides a bit of headroom.
As memory is easy to defragment (it's all virtual addresses anyway)
and some usage is also easy to evict (e.g. to SWAP if not really used
at the moment or as it is only an advanced cache like the ZFS ARC).

Without the override the threshold where 75% for warning and 90% for
showing a critical status. For a host with 396 GiB of installed memory
that meant that we warned already on 297 GiB used (99 GiB still
available!) and showed a critical status with ~365 GiB in use (~40 GiB
free), both can be still very OK and warranted usages though.

So increase the thresholds to 90% for warning and 97.5% for critical
usage displays, which provides a less "scare-mongering" display.

Ideally we'd support a callback to make a better decision, as clamping
on totals might be even better, but this simple change makes it
already much better. Add a comment that we might want to split out the
ARC in its own custom bar (I got a prototype around, but that needs
polishing and in-depth review).

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2025-09-08 22:48:14 +02:00
Thomas Lamprecht
e1a85d845b ui: node summary: use arrow fn for KSM renderer
Code clean-up without any semantic change intended.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2025-09-08 22:48:14 +02:00
Thomas Lamprecht
da5129fb82 influxdb metrics: explicitly include the SSL_VERIFY_NONE constant
This avoids a "compile" check error (i.e. perl -wc) if no other module
that pulls in that dependency is loaded already.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2025-09-08 22:48:14 +02:00
Thomas Lamprecht
515549c31f pull metrics: comment the time that the cached old generation includes
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2025-09-08 22:48:14 +02:00
Thomas Lamprecht
308217e530 api: cluster metrics export: support an explicit node-list
This allows one to query the metrics stats from a specific set of
nodes. This can, e.g., help on batch querying the stats in bigger
clusters, like in a 15 node cluster one could do 3 requests at 5 nodes
each concurrently.

Doing such things can especially help on clusters with many virtual
guests, as there the time required to gather all stats quickly adds
up, more so if the time window is long, and we got a 30s overall
timeout here currently due to being proxied to the privileged API
daemon as we cannot reuse the API ticket and need to generate a new
one.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2025-09-08 22:48:14 +02:00
Thomas Lamprecht
69b01030f4 api: cluster: metric server: increase timeout when fetching other nodes metrics
5s is rather short, especially if one has many guests on a node and
queries for a (relatively) period, e.g. for a node with 4000 and
querying the last 10 minutes of data needs a bit over 8s on a test
cluster of mine.

So increase the timeout from 5s to 20s as a stop-gap. Note that due to
being a protected API call we are limited by the 30s proxy timeout in
total, which is something that might be revisited but out of the scope
of this change, especially as it would need to be changed in the
pve-http-server git repo anyway.

There are other ideas floating around in making this more reliable,
like making this async here (anyevent or a dedicated executable),
allowing the requester to pass a node-list to allow batching the
queries and so on.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2025-09-08 22:48:14 +02:00
Thomas Lamprecht
bdecc8191a update shipped appliance info index
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2025-09-07 19:47:34 +02:00
Thomas Lamprecht
040945d6fe ui: pool members: add filter for name, node or vmid when adding guests
Makes it easier to find specific guests when one got many of them.

I decided to not allow filtering the current pool name, as often there
is none set for the guest the user wants to add and one could
theoretically sort the current pool column to group guests by them,
and finally, we can still add that easily if it gets requested with a
good enough rationale.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2025-09-06 15:48:12 +02:00
Thomas Lamprecht
ce79e33a14 ui: pool: add members: make virtual guest window bigger and resizeable
It was rather small, i.e. always to narrow for seeing the column
values for somewhat normal name lengths and for more than a handful of
guests the height was rather short too.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2025-09-06 15:46:19 +02:00
Gabriel Goller
1b37bf06a0 sdn: remove fabrics property correctly from the Vxlan Zone
The missing `deleteEmtpy` attribute caused the fabric property to never
be removed. So when e.g. removing the fabric to add the peers manually,
there would always be an error because you can't have peers *and*
fabrics configured.

Fixes: https://bugzilla.proxmox.com/show_bug.cgi?id=6710
Signed-off-by: Gabriel Goller <g.goller@proxmox.com>
Link: https://lore.proxmox.com/20250821083455.21307-1-g.goller@proxmox.com
2025-09-05 20:40:43 +02:00
Gabriel Goller
146cb84d7c sdn: remove fabrics property correctly from EVPN controller
The missing `deleteEmtpy` attribute caused the fabric property to never
be removed from the EVPN controller. So when e.g. removing the fabric to
add the peers manually, there would always be an error because you can't
have peers *and* fabrics configured.

Signed-off-by: Gabriel Goller <g.goller@proxmox.com>
Link: https://lore.proxmox.com/20250821085015.29401-1-g.goller@proxmox.com
2025-09-05 20:39:51 +02:00
Shannon Sterz
ccccc387fb ui: remove unused pve-itype-icon-itype class
it's based on an old gif icon and should no longer be used anyway, so
remove it.

Signed-off-by: Shannon Sterz <s.sterz@proxmox.com>
Link: https://lore.proxmox.com/20250829141219.290626-6-s.sterz@proxmox.com
2025-09-05 20:16:24 +02:00
Maximiliano Sandoval
13cd96a74a cli: pveceph: set use bytes renderer when listing a pool's content
This will make pveceph pool ls report the 'Used' column specifying its
units:

$ pveceph pool ls --noborder
... Used
... 2.07 MiB
... 108.61 KiB

Signed-off-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
Tested-by: Shannon Sterz <s.sterz@proxmox.com>
Reviewed-by: Shannon Sterz <s.sterz@proxmox.com>
Link: https://lore.proxmox.com/20250829094401.223667-2-m.sandoval@proxmox.com
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2025-09-05 20:15:02 +02:00
Maximiliano Sandoval
c83ad9cd49 ui: storage summary: set 'bytes' as unit for metrics graph
This change ensures that the storage unites are displayed consistently
between the graph and the usage label right above.

When setting the unit to `bytes` the graph will now, for example, show
"130 GB" instead of "130 G", which matches the usage displayed above
and removes any ambiguity about whether "G" refers to GiB or GB.

Signed-off-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
Tested-by: Shannon Sterz <s.sterz@proxmox.com>
Reviewed-by: Shannon Sterz <s.sterz@proxmox.com>
Link: https://lore.proxmox.com/20250829094401.223667-1-m.sandoval@proxmox.com
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2025-09-05 20:15:02 +02:00
Maximiliano Sandoval
6121d1126c api: apt: Return valid utf8 on changelog
This was displayed wrongly on the web UI and when calling

    pvesh get /nodes/localhost/apt/changelog

One potential example of such a package was bind9-dnsutils where the
character `ř` was rendered as `Å`.

Reported-by: Lukas Wagner <l.wagner@proxmox.com>
Signed-off-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
Tested-by: Daniel Kral <d.kral@proxmox.com>
Link: https://lore.proxmox.com/20250902145345.500823-1-m.sandoval@proxmox.com
2025-09-05 20:10:33 +02:00
Gabriel Goller
a5250e9e9c make: clean up line continuation backslashes
Some backslashes were not indented correctly and some used spaces
instead of tabs. Most were introduced in the recent fabrics series
(29ebe4e8d4 ("ui: fabrics: add model definitions for fabrics") and
following).

Signed-off-by: Gabriel Goller <g.goller@proxmox.com>
Link: https://lore.proxmox.com/20250905125435.231976-1-g.goller@proxmox.com
2025-09-05 19:47:03 +02:00
Daniel Kral
2ddc4d864b parser: qemu cpu: also allow kebab-cased properties while parsing
There are quite a few kebab-cased properties in the QEMU CPU config,
such as phys-bits and guest-phys-bits. These are currently not exposed
through the web interface, but only the command line.

If the QEMU CPU config is parsed, it will return undefined with an
error and will break the ProcessorEdit component so that changes cannot
be submitted anymore.

Fix that by allowing kebab-cased properties as well.

Signed-off-by: Daniel Kral <d.kral@proxmox.com>
Link: https://lore.proxmox.com/20250905142249.219371-1-d.kral@proxmox.com
 [TL: drop unnecessary escape]
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2025-09-05 19:04:25 +02:00
Dominik Csapak
e19de81f54 ui: resource tree: fix change detection
when trying to detect changes of resources, we compare a list of
properties of the existing nodes in the tree with the ones we got from
the api call, so that we can update only those that changed.

One of these properties is the 'text' one, which is calculated from e.g.
the vmid and name (or the name and host, depending on the type).

Sadly, when inserting/updating the node, we modified the text property
in every case, at least adding a '<span></span>' around the existing
text. This meant that every resource was updated every time instead of
only when something changed.

To fix this, remote the 'text' property from the to checked ones, and
add all the properties that are used to compile the text one.

This reduces the time of updateTree in my test-setup (~10000 guests)
when nothing changed from ~100ms to ~15ms and reduces scroll stutter
during such an update.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Link: https://lore.proxmox.com/20250905120627.2585826-5-d.csapak@proxmox.com
2025-09-05 18:52:26 +02:00
Dominik Csapak
d2660fc7a4 ui: resource tree: improve performance on initial update
When we insert nodes into the tree, we use 'insertBefore' of extjs'
NodeInterface. When the node is inside a TreeStore, it calls
'registerNode' to handle some events and accounting. Sadly it does so
not only for the inserted node, but also for the node in which is
inserted too and that calls 'registerNode' again for all of its
children.

So inserting a large number of guests under node this way has (at least)
O(n^2) calls to registerNode.

To workaround this, create the first tree node structure outside the
TreeStore and add it at the end. Further insertions are more likely to
only come in small numbers. (Still have to look into if we can avoid
that behavior there too)

This improves the time spend in 'registerNode' (in my ~10000 guests test
setup) from 4,081.6 ms to about 2.7ms.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Link: https://lore.proxmox.com/20250905120627.2585826-4-d.csapak@proxmox.com
2025-09-05 18:52:26 +02:00