]> git.proxmox.com Git - pve-manager.git/log
pve-manager.git
7 weeks agoapi: backup/vzdump: add permission check for fleecing storage
Fiona Ebner [Wed, 13 Mar 2024 13:26:01 +0000 (14:26 +0100)]
api: backup/vzdump: add permission check for fleecing storage

Similar to how Datastore.AllocateSpace is required for the backup
storage, it should also be required for the fleecing storage.

Removing a fleecing storage from a job does not require more
permissions than for modifying the job.

Suggested-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
7 weeks agovzdump: handle new 'fleecing' property string
Fiona Ebner [Mon, 22 Jan 2024 14:55:06 +0000 (15:55 +0100)]
vzdump: handle new 'fleecing' property string

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
7 weeks agovzdump: have property string helpers always return the result
Fiona Ebner [Thu, 11 Apr 2024 08:13:24 +0000 (10:13 +0200)]
vzdump: have property string helpers always return the result

Previously, the result would only be returned implicitly and if not
already parsed. While callers do not strictly need the return value,
future callers might mistakenly rely on it and even work by chance in
some scenarios, because of the implicit return. Make the code more
future proof by explicitly returning the result in all cases.

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
7 weeks agoapi: notifications: add 'smtp' to target index
Lukas Wagner [Mon, 15 Apr 2024 08:25:59 +0000 (10:25 +0200)]
api: notifications: add 'smtp' to target index

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
7 weeks agopvesh: use SSH command helper
Fabian Grünbichler [Thu, 11 Jan 2024 10:51:22 +0000 (11:51 +0100)]
pvesh: use SSH command helper

to benefit from future improvements like known host key pinning.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
7 weeks agovnc: use SSH command helper
Fabian Grünbichler [Thu, 11 Jan 2024 10:51:21 +0000 (11:51 +0100)]
vnc: use SSH command helper

to benefit from future improvements there, like pinning the known host key.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
7 weeks agoreport: list held back packages
Alexander Zeidler [Thu, 18 Apr 2024 09:16:47 +0000 (11:16 +0200)]
report: list held back packages

Signed-off-by: Alexander Zeidler <a.zeidler@proxmox.com>
7 weeks agoreport: add `apt-cache policy` to list recognized APT sources
Alexander Zeidler [Thu, 18 Apr 2024 09:16:46 +0000 (11:16 +0200)]
report: add `apt-cache policy` to list recognized APT sources

with their details as well as pinned packages. Omit the "origin"
lines, as their value is already visible in the URLs.

 # apt-cache policy ...
 Package files:
  100 /var/lib/dpkg/status
      release a=now
  500 https://enterprise.proxmox.com/debian/pve bookworm/pve-enterprise amd64 Packages
      release o=Proxmox,a=stable,n=bookworm,l=Proxmox VE Enterprise Debian Repository,c=pve-enterprise,b=amd64
 ...
 Pinned packages:
      intel-microcode -> 3.20231114.1~deb12u1 with priority 1234

Signed-off-by: Alexander Zeidler <a.zeidler@proxmox.com>
7 weeks agoreport: fix regex of config filenames
Alexander Zeidler [Thu, 18 Apr 2024 07:44:04 +0000 (09:44 +0200)]
report: fix regex of config filenames

to only match those that are correct/accepted by their software

Signed-off-by: Alexander Zeidler <a.zeidler@proxmox.com>
7 weeks agoreport: create "jobs" section, add `jobs.cfg`
Alexander Zeidler [Thu, 18 Apr 2024 09:16:45 +0000 (11:16 +0200)]
report: create "jobs" section, add `jobs.cfg`

to recognize temporal correlations with network/load/backup/etc issues

Suggested-by: Friedrich Weber <f.weber@proxmox.com>
Signed-off-by: Alexander Zeidler <a.zeidler@proxmox.com>
7 weeks agoreport: add kernel command line from current boot
Alexander Zeidler [Thu, 18 Apr 2024 09:16:44 +0000 (11:16 +0200)]
report: add kernel command line from current boot

to get a first clue for debugging passthrough and similar issues, when
no dmesg output has been provided yet.

Signed-off-by: Alexander Zeidler <a.zeidler@proxmox.com>
7 weeks agoui: acl: group selector: allow search
Fiona Ebner [Fri, 12 Apr 2024 09:16:13 +0000 (11:16 +0200)]
ui: acl: group selector: allow search

Makes it consistent with the user selector and token selector.

Requested in the community forum:
https://forum.proxmox.com/threads/144978/

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
7 weeks agoapi: apt versions: track optional pve-esxi-import-tools package
Thomas Lamprecht [Thu, 18 Apr 2024 20:15:17 +0000 (22:15 +0200)]
api: apt versions: track optional pve-esxi-import-tools package

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
7 weeks agoapi: apt versions: track optional amd64/intel-microcode packages
Alexander Zeidler [Thu, 18 Apr 2024 07:44:05 +0000 (09:44 +0200)]
api: apt versions: track optional amd64/intel-microcode packages

Signed-off-by: Alexander Zeidler <a.zeidler@proxmox.com>
7 weeks agod/control: bump versioned b-d for guest-common
Thomas Lamprecht [Thu, 18 Apr 2024 08:22:18 +0000 (10:22 +0200)]
d/control: bump versioned b-d for guest-common

so that our replication regression tests work correctly.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
7 weeks agoRevert "tests: update expected replication log output"
Fiona Ebner [Thu, 18 Apr 2024 07:06:48 +0000 (09:06 +0200)]
Revert "tests: update expected replication log output"

This reverts commit 3a259c22e64ff22049856256a1dad643439c79ef.

There was an oversight with recent replication fixes that led to
attempting to remove snapshots that do not exist (in more scenarios).
While not an issue with real consequences, it's confusing to users.
This has since been fixed by pve-guest-common commit "replication:
snapshot cleanup: only attempt to remove snapshots that exist".

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
7 weeks agoui: acme: add External Account Binding (EAB) related fields
Folke Gleumes [Wed, 17 Apr 2024 15:55:05 +0000 (17:55 +0200)]
ui: acme: add External Account Binding (EAB) related fields

Adds fields for eab credentials. By default eab is optional, but if the
directory should report that eab is required, the eab credential fields
are marked as mandatory and prevent the form from being submittable
until credentials are provided.

Signed-off-by: Folke Gleumes <f.gleumes@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
7 weeks agofix #5093: ui: acme: expose custom directory option
Folke Gleumes [Wed, 17 Apr 2024 15:55:04 +0000 (17:55 +0200)]
fix #5093: ui: acme: expose custom directory option

This patch allows the user to set a custom ACME directory by providing
a 'Custom' option in the directory dropdown. This in turn reveals an
input for the url. When using a custom directory the directory has to
be manually queried via button press to prevent from spamming the
directory on every input.

Signed-off-by: Folke Gleumes <f.gleumes@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
7 weeks agotests: update expected replication log output
Thomas Lamprecht [Wed, 17 Apr 2024 19:13:25 +0000 (21:13 +0200)]
tests: update expected replication log output

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
7 weeks agoui: fix typo to make pve-cluster-tasks store globally available
Friedrich Weber [Fri, 12 Apr 2024 14:15:52 +0000 (16:15 +0200)]
ui: fix typo to make pve-cluster-tasks store globally available

This way, it can be used to retrieve the current list of tasks.

Signed-off-by: Friedrich Weber <f.weber@proxmox.com>
7 weeks agod/postinst: make deb-systemd-invoke non-fatal
Fabian Grünbichler [Thu, 11 Apr 2024 10:10:48 +0000 (12:10 +0200)]
d/postinst: make deb-systemd-invoke non-fatal

else this can break an upgrade for unrelated reasons (regular debhelper also
constructs the restart invocations like this, it even redirects output to
/dev/null)

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
7 weeks agoui: backup job: rework advanced empty text and descriptions
Thomas Lamprecht [Wed, 17 Apr 2024 14:03:03 +0000 (16:03 +0200)]
ui: backup job: rework advanced empty text and descriptions

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
7 weeks agoui: backup job: make add/edit window wider
Thomas Lamprecht [Wed, 17 Apr 2024 14:01:31 +0000 (16:01 +0200)]
ui: backup job: make add/edit window wider

it looks a bit tall and cramped nowadays, so go for 720, like the
wizard class uses by default.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
7 weeks agoui: backup job: avoid calling max-workers VM workers
Thomas Lamprecht [Wed, 17 Apr 2024 12:22:41 +0000 (14:22 +0200)]
ui: backup job: avoid calling max-workers VM workers

that could make some users (not reading the explanation on the right
closely) belief that this controls the amount of parallel VMs to be
backed up or the like.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
7 weeks agoui: backup job: rework hint about fallback config and make it less flashy
Thomas Lamprecht [Wed, 17 Apr 2024 11:49:43 +0000 (13:49 +0200)]
ui: backup job: rework hint about fallback config and make it less flashy

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
7 weeks agoui: backup job: move repeat-missed option to advanced tab
Fiona Ebner [Tue, 16 Apr 2024 12:09:55 +0000 (14:09 +0200)]
ui: backup job: move repeat-missed option to advanced tab

Suggested-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
7 weeks agoui: backup job: disable zstd thread count field when zstd isn't used
Fiona Ebner [Tue, 16 Apr 2024 12:09:54 +0000 (14:09 +0200)]
ui: backup job: disable zstd thread count field when zstd isn't used

Also need to check for enable/disable of the compression selector,
because with PBS the value zstd is set, but the thread count setting
doesn't apply.

Suggested-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
7 weeks agoclose #4513: ui: backup job: add tab for advanced options
Fiona Ebner [Tue, 16 Apr 2024 12:09:53 +0000 (14:09 +0200)]
close #4513: ui: backup job: add tab for advanced options

pigz is not exposed, because it only works after manually installing
the pigz package.

ionice is not exposed, because it only works in combination with the
BFQ scheduler and even then not in all cases (only affects the
compressor when doing snapshot/suspend mode backup of a VM).

The pbs-entries-max performance option is not exposed. It is rather
niche and hard to understand. It serves as an escape hatch for
rare/extreme cases.

These can still be added with appropriate notes if there is enough
user demand.

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
7 weeks agovzdump: use per-property fallback for performance settings
Fiona Ebner [Tue, 16 Apr 2024 12:09:52 +0000 (14:09 +0200)]
vzdump: use per-property fallback for performance settings

Currently, fallback for the 'performance' option is done as a whole,
taking away flexibility from the user. It also means that when only
one of the two sub-properties is specified, the other one will default
to the backend (i.e. QEMU or proxmox-backup-client) default rather
than the schema default. For the latter point in particular, it can be
argued to be incorrect. These limitations will only get worse in the
future with more sub-properties.

Switch to a per-property fallback mechanism to improve the situation,
having each go through the usual preference order (CLI/job > node-wide
default > schema default).

Technically, this is a breaking change, but pbs-entries-max is rather
new and potential for breakage seems rather low. Requirements for
breakage:
* job (or CLI) that defines only one of the performance options
* job also covers a guest where the other performance option applies
* the other performance option is defined in the node-wide configuration
* the node-wide setting is worse for the job than the implicit backend
  default (because this change will have the node-wide default win over
  the implicit backend default).

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
7 weeks agovzdump: actually honor schema defaults for performance
Fiona Ebner [Tue, 16 Apr 2024 12:09:51 +0000 (14:09 +0200)]
vzdump: actually honor schema defaults for performance

The 'performance' option itself defines no 'default' in the schema, so
what happened is that the defaults used by the backends (i.e. QEMU and
proxmox-backup-client) would be used. Luckily, they correspond to the
default values defined in the schema, i.e. in the 'backup-performance'
format. Make the code future-proof and use the actual defaults defined
in the schema instead of relying on that correspondence.

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
7 weeks agoui: backup job: code clean-up the add/edit window creation
Thomas Lamprecht [Wed, 17 Apr 2024 14:02:35 +0000 (16:02 +0200)]
ui: backup job: code clean-up the add/edit window creation

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
7 weeks agoui: lxc: dev passthrough: rework labels
Thomas Lamprecht [Wed, 17 Apr 2024 09:53:20 +0000 (11:53 +0200)]
ui: lxc: dev passthrough: rework labels

try to make it more clear that the file UID/GID/mode are for the
device file node inside the CT

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
7 weeks agoui: lxc: dev passthrough: drop bogus type config from textfield
Thomas Lamprecht [Wed, 17 Apr 2024 09:52:26 +0000 (11:52 +0200)]
ui: lxc: dev passthrough: drop bogus type config from textfield

this does nothing here, would have to be a vtype to make sense

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
7 weeks agoui: lxc: dev passthrough: allow translating validation errors
Thomas Lamprecht [Wed, 17 Apr 2024 09:52:07 +0000 (11:52 +0200)]
ui: lxc: dev passthrough: allow translating validation errors

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
7 weeks agoui: lxc: keep passthrough ID internal for now
Thomas Lamprecht [Wed, 17 Apr 2024 09:33:55 +0000 (11:33 +0200)]
ui: lxc: keep passthrough ID internal for now

this is not like mount points, where the order can make a difference,
but rather like the PCI passthrough for VMs, for which we do not
expose editing the ID either.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
7 weeks agoui: lxc: do not righ-align labels
Thomas Lamprecht [Wed, 17 Apr 2024 09:18:56 +0000 (11:18 +0200)]
ui: lxc: do not righ-align labels

This is totally out of line with the rest of the UI and looks quite
odd...

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
7 weeks agoui: lxc: fix maximum ID boundary for device passthrough
Thomas Lamprecht [Wed, 17 Apr 2024 09:13:55 +0000 (11:13 +0200)]
ui: lxc: fix maximum ID boundary for device passthrough

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
7 weeks agoui: lxc: pass full property name to for-each dev & mountpoint helpers
Thomas Lamprecht [Wed, 17 Apr 2024 08:59:33 +0000 (10:59 +0200)]
ui: lxc: pass full property name to for-each dev & mountpoint helpers

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
7 weeks agoui: lxc: add edit window for device passthrough
Filip Schauer [Wed, 17 Apr 2024 08:44:19 +0000 (10:44 +0200)]
ui: lxc: add edit window for device passthrough

Signed-off-by: Filip Schauer <f.schauer@proxmox.com>
7 weeks agoutils: clarify naming of LXC mount point utils
Filip Schauer [Wed, 17 Apr 2024 08:44:18 +0000 (10:44 +0200)]
utils: clarify naming of LXC mount point utils

Clarify the naming of mount point utils to clearly indicate their
relation to LXC containers.

Signed-off-by: Filip Schauer <f.schauer@proxmox.com>
7 weeks agoui: lxc: add firewall log view filtering
Christian Ebner [Tue, 5 Dec 2023 14:36:26 +0000 (15:36 +0100)]
ui: lxc: add firewall log view filtering

Allow to filter firewall logs analogous to node and VM firewall logs.

Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
8 weeks agofirewall: properly detect changes when ip / cidr is used in rule
Stefan Hanreich [Tue, 16 Jan 2024 14:30:22 +0000 (15:30 +0100)]
firewall: properly detect changes when ip / cidr is used in rule

With the current implementation using queryDelay, this means that the
change event for the input never completes. This in turn leads to
the input panel never changing its dirty status. By using the
beforequery event we can simply cancel the query without resorting to
the queryDelay hack.

Reported-By: Mira Limbeck <m.limbeck@proxmox.com>
Signed-off-by: Stefan Hanreich <s.hanreich@proxmox.com>
Tested-by: Mira Limbeck <m.limbeck@proxmox.com>
Reviewed-by: Mira Limbeck <m.limbeck@proxmox.com>
8 weeks agofix #4963: firewall: fix editing firewall rules using ips / cidrs
Stefan Hanreich [Tue, 16 Jan 2024 14:30:21 +0000 (15:30 +0100)]
fix #4963: firewall: fix editing firewall rules using ips / cidrs

fall back to using v.ref as value when we do not have an alias or ipset
since scope and name are not set for ips / cidrs

Signed-off-by: Stefan Hanreich <s.hanreich@proxmox.com>
Tested-by: Filip Schauer <f.schauer@proxmox.com>
Reviewed-by: Mira Limbeck <m.limbeck@proxmox.com>
Tested-by: Mira Limbeck <m.limbeck@proxmox.com>
8 weeks agoAllow moving unused disks to another storage
Filip Schauer [Mon, 19 Feb 2024 11:11:40 +0000 (12:11 +0100)]
Allow moving unused disks to another storage

Signed-off-by: Filip Schauer <f.schauer@proxmox.com>
8 weeks agopostinst: move dir creation to helper
Fabian Grünbichler [Thu, 11 Apr 2024 12:45:44 +0000 (14:45 +0200)]
postinst: move dir creation to helper

and guard it to only run on ceph-using systems (the regular 'inited' check
doesn't work as a guard for this, because it checks for new-style inits
including the dir existing).

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
8 weeks agopostinst: remove blank lines
Fabian Grünbichler [Thu, 11 Apr 2024 09:56:10 +0000 (11:56 +0200)]
postinst: remove blank lines

it looks confusing in `apt ..` output

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
8 weeks agod/control: depend on pve-storage with new ceph parser
Fabian Grünbichler [Thu, 11 Apr 2024 09:55:47 +0000 (11:55 +0200)]
d/control: depend on pve-storage with new ceph parser

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
8 weeks agopostinst: replace placeholder with actual version
Fabian Grünbichler [Thu, 11 Apr 2024 08:55:35 +0000 (10:55 +0200)]
postinst: replace placeholder with actual version

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
8 weeks agobin/make: gather helper scripts in separate variable
Max Carrara [Tue, 2 Apr 2024 14:55:23 +0000 (16:55 +0200)]
bin/make: gather helper scripts in separate variable

Signed-off-by: Max Carrara <m.carrara@proxmox.com>
Tested-by: Friedrich Weber <f.weber@proxmox.com>
8 weeks agofix #4759: ceph: configure ceph-crash.service and its key
Max Carrara [Tue, 2 Apr 2024 14:55:22 +0000 (16:55 +0200)]
fix #4759: ceph: configure ceph-crash.service and its key

Due to Ceph dropping privileges when running the 'ceph-crash' daemon
[0], it is necessary to allow the daemon to authenticate with its
cluster in a safe manner.

In order to avoid exposing sensitive keyrings or somehow escalating
its privileges again, 'ceph-crash' is therefore provided with its own
keyring in the '/etc/pve/ceph' directory. This directory, due to being
on 'pmxcfs', may be read by members of the 'www-data' group, which
'ceph-crash' is made part of [1].

Expected Configuration
----------------------

 1. A keyring file named '/etc/pve/ceph/ceph.client.crash.keyring'
    exists
 2. A section named 'client.crash' exists in '/etc/pve/ceph.conf'
 3. The 'client.crash' section has a key named 'keyring' which
    references the keyring file as '/etc/pve/ceph/$cluster.$name.keyring'
 4. The 'client.crash' section has *no* key named 'key'

New Clusters
------------

The keyring file is created and the conf file is updated after the first
monitor has been created (when calling `pveceph mon create`).

Existing Clusters
-----------------

A new helper script creates and configures the 'client.crash' keyring in
`postinst`, if:
 * Ceph is installed
 * Ceph is initialized ('/etc/pve/ceph.conf' and '/etc/pve/ceph' exist)
 * Connection to RADOS is successful

If the above conditions are met, the helper script ensures that the
existing configuration matches the expected configuration mentioned
above.

The configuration is not changed if it is already as expected.

The helper script may be called again manually if the `postinst` hook
fails. It is installed to '/usr/share/pve-manager/helpers/pve-init-ceph-crash'.

Existing `client.crash` Key
---------------------------

If a key named 'client.crash' already exists within the cluster, it is
reused and not regenerated.

[0]: https://github.com/ceph/ceph/pull/48713
[1]: https://git.proxmox.com/?p=ceph.git;a=commitdiff;h=f72c698a55905d93e9a0b7b95674616547deba8a

Signed-off-by: Max Carrara <m.carrara@proxmox.com>
Tested-by: Friedrich Weber <f.weber@proxmox.com>
8 weeks agoceph: introduce '/etc/pve/ceph'
Max Carrara [Tue, 2 Apr 2024 14:55:21 +0000 (16:55 +0200)]
ceph: introduce '/etc/pve/ceph'

This commit adds the '/etc/pve/ceph' directory to our overall expected
Ceph configuration.

This directory is meant to store cluster-wide, non-private
configuration files used by Ceph applications and services that are
executed with lower privileges, such as 'ceph-crash.service'.

The existence of the directory is now also checked for when checking
whether Ceph is configured correctly. This makes it easier for our
other tooling to rely on the directory's existence, reducing the
number of otherwise needless frequent checking.

* For new clusters: `pveceph init` now creates '/etc/pve/ceph' when
  called.

* For existing clusters: The 'postinst' hook this commit adds ensures
  that '/etc/pve/ceph' is created when updating.

Signed-off-by: Max Carrara <m.carrara@proxmox.com>
Tested-by: Friedrich Weber <f.weber@proxmox.com>
2 months agosdn: evpn: allow empty primary exit node in zone form
Stefan Hanreich [Thu, 22 Feb 2024 16:40:47 +0000 (17:40 +0100)]
sdn: evpn: allow empty primary exit node in zone form

its broken since the change in semantics of the PUT endpoint [1]

[1] https://git.proxmox.com/?p=pve-network.git;a=commit;h=3e3cafabaf955d53c4c2d4e346bf5c3a5c6d1852

Signed-off-by: Stefan Hanreich <s.hanreich@proxmox.com>
Originally-by: Alexandre Derumier <aderumier@odiso.com>
2 months agobump version to 8.1.10
Thomas Lamprecht [Thu, 28 Mar 2024 18:57:10 +0000 (19:57 +0100)]
bump version to 8.1.10

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 months agoguest import: allow setting VLAN-tag
Thomas Lamprecht [Thu, 28 Mar 2024 18:56:10 +0000 (19:56 +0100)]
guest import: allow setting VLAN-tag

can be a requirement for live-import to make sense

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 months agobump version to 8.1.9
Thomas Lamprecht [Thu, 28 Mar 2024 17:12:50 +0000 (18:12 +0100)]
bump version to 8.1.9

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 months agofix #5337: ui: parse a port in the server field
Thomas Lamprecht [Thu, 28 Mar 2024 17:06:34 +0000 (18:06 +0100)]
fix #5337: ui: parse a port in the server field

Based on how we handle this for PBS but without the hidden fields,
which do not really make this simpler, at least not if the logic is
only required on creation due to the field being only editable then.

As example, if the port of the ESXi host would be 8080, one would
enter `192.168.1.2:8080` for an IPv4 address or `[2001:db8::42]:8443`
for an IPv6 one.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 months agonode: wake-on-lan: document defaults and small style clean-up
Thomas Lamprecht [Thu, 28 Mar 2024 16:52:25 +0000 (17:52 +0100)]
node: wake-on-lan: document defaults and small style clean-up

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 months agofix #5255: node: wol: configurable broadcast address
Christian Ebner [Tue, 26 Mar 2024 09:16:58 +0000 (10:16 +0100)]
fix #5255: node: wol: configurable broadcast address

Allows to configure a custom broadcast address to use when sending a
wake on lan packet to wake a remote node.

Default behaviour remains to fallback to 255.255.255.255.

Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
2 months agofix #5255: node: wol: add optional bind interface
Christian Ebner [Tue, 26 Mar 2024 09:16:57 +0000 (10:16 +0100)]
fix #5255: node: wol: add optional bind interface

Allows to optionally configure a local interface name to which to
bind to when sending a wake on lan packet to wake a remote node.

Default behaviour remains to send the packet via the interface for
the default gateway.

Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
2 months agonode: config: make wakeonlan a property string
Christian Ebner [Tue, 26 Mar 2024 09:16:56 +0000 (10:16 +0100)]
node: config: make wakeonlan a property string

Moves the wakeonlan property to be a property string, with current mac
address as default key. This allows to later add further optional
properties such as bind-interface and broadcast-address.

Adds the `get_wakeonlan_config` helper function to parse the string
when read from the node config.

Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
2 months agoui: guest import: separate disk mapping and rendering cleanly
Thomas Lamprecht [Thu, 28 Mar 2024 16:25:31 +0000 (17:25 +0100)]
ui: guest import: separate disk mapping and rendering cleanly

handle mapping purely in the change handler for the prepare-for-virtio
checkbox and avoid any such mapping logic in the renderer, while
slightly longer the code is much easier to reason about.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 months agoui: guest import: avoid using "grid" as variable name for a window view
Thomas Lamprecht [Thu, 28 Mar 2024 16:22:24 +0000 (17:22 +0100)]
ui: guest import: avoid using "grid" as variable name for a window view

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 months agoui: guest import: actually copy vmconfig state before applying values
Thomas Lamprecht [Thu, 28 Mar 2024 16:09:21 +0000 (17:09 +0100)]
ui: guest import: actually copy vmconfig state before applying values

Otherwise changes will persist, e.g., disabling a CDROM drive won't
work if the values got assembled for the "Resulting Config" tab
before. Same for the "Prepare for VirtIO" checkbox, there one got the
disk twice, once as (old) mapped SATA and once as (original) SCSI.

To fix this do not work on a reference of the original VM config, but
rather always copy that to a new object before applying the form
values.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 months agobump version to 8.1.8
Thomas Lamprecht [Wed, 27 Mar 2024 13:33:52 +0000 (14:33 +0100)]
bump version to 8.1.8

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 months agod/control: bump versioned dependencies for libpve-storage-perl
Thomas Lamprecht [Wed, 27 Mar 2024 13:36:00 +0000 (14:36 +0100)]
d/control: bump versioned dependencies for libpve-storage-perl

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 months agoguest import: validate that selected VMID does not exist yet
Thomas Lamprecht [Wed, 27 Mar 2024 13:31:34 +0000 (14:31 +0100)]
guest import: validate that selected VMID does not exist yet

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 months agoguest import: fine tune icons
Thomas Lamprecht [Wed, 27 Mar 2024 11:44:40 +0000 (12:44 +0100)]
guest import: fine tune icons

We switched the storage browser navigation entry to 'Virtual Guests'
recently, but still used the icon for import.

For now switch to use to the one for VMs for this entry, matching the
label, and use the import icon for the "Import" button instead.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 months agoui: guest import: use box-label style for prepare-for-virtio checkbox
Thomas Lamprecht [Wed, 27 Mar 2024 10:45:31 +0000 (11:45 +0100)]
ui: guest import: use box-label style for prepare-for-virtio checkbox

Aaron originally designed the new "unique MAC address" checkbox after
this one for alignment reasons [0]. I changed it and argued that's
fine if there is a misalignment between those components [1], which I
still think, but tbh. I also like the boxLabel more for the "Prepare
for VirtIO" checkbox, so lets use it there too and hope all are happy
again.

[0]: https://lists.proxmox.com/pipermail/pve-devel/2024-March/062411.html
[1]: https://lists.proxmox.com/pipermail/pve-devel/2024-March/062412.html

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 months agoui: guest import: fix internal name for the prepare-for-virtIO feature
Thomas Lamprecht [Wed, 27 Mar 2024 10:40:21 +0000 (11:40 +0100)]
ui: guest import: fix internal name for the prepare-for-virtIO feature

Mapping to SATA is only one thing it does, and what we actually want
to do is preparing for VirtIO, the effects are implementation detail,
so name it after the reason not one specific step.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 months agoui: network card selector: add Intel E1000E as choosable model
Thomas Lamprecht [Wed, 27 Mar 2024 10:38:39 +0000 (11:38 +0100)]
ui: network card selector: add Intel E1000E as choosable model

it's popular in VMware ESXi and so should be available to choose
directly, avoiding a invalid model field in the import wizard.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 months agoui: guest import: avoid one indentation level in deeply nested widget tree
Thomas Lamprecht [Wed, 27 Mar 2024 09:50:03 +0000 (10:50 +0100)]
ui: guest import: avoid one indentation level in deeply nested widget tree

best viewed with git show --ignore-space-change

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 months agoui: guest import: use view-model for unique-mac-addr state
Thomas Lamprecht [Wed, 27 Mar 2024 09:33:41 +0000 (10:33 +0100)]
ui: guest import: use view-model for unique-mac-addr state

Avoid some global widget config to store internal state, rather use
the existing viewModel for that.

Also avoid unnecessary references and switch to a boxLabel, drop also
the tooltip, as that doesn't add much here where the effect can be
seen in the grid.

Avoid reconfiguring all grids if only the network one can have changed
due to a change of this check box value.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 months agoui: guest import: allow setting mac addresses to unique
Aaron Lauterer [Tue, 26 Mar 2024 13:25:56 +0000 (14:25 +0100)]
ui: guest import: allow setting mac addresses to unique

by adding a new checkbox and render the grid accordingly.

If unique MAC addresses are enabled, set them to undefined when getting
the values from the grid.

Signed-off-by: Aaron Lauterer <a.lauterer@proxmox.com>
2 months agoui: parser: recognize e1000e as network card
Wolfgang Bumiller [Tue, 26 Mar 2024 10:18:09 +0000 (11:18 +0100)]
ui: parser: recognize e1000e as network card

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 months agobump version to 8.1.7
Thomas Lamprecht [Fri, 22 Mar 2024 10:54:32 +0000 (11:54 +0100)]
bump version to 8.1.7

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 months agod/control: bump versioned deps for widget-toolkit and access-control
Thomas Lamprecht [Fri, 22 Mar 2024 15:07:41 +0000 (16:07 +0100)]
d/control: bump versioned deps for widget-toolkit and access-control

to ensure the new password confirmation API and UI is available

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 months agoapi: ceph monitor: rework some code style to modern
Max Carrara [Thu, 14 Mar 2024 10:19:30 +0000 (11:19 +0100)]
api: ceph monitor: rework some code style to modern

Signed-off-by: Max Carrara <m.carrara@proxmox.com>
 [ TL: also improve if-expression wrapping ]
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 months agofix #5198: ceph: mon: fix mon existence check in mon removal assertion
Max Carrara [Thu, 14 Mar 2024 10:19:29 +0000 (11:19 +0100)]
fix #5198: ceph: mon: fix mon existence check in mon removal assertion

The Ceph monitor removal assertion contains a condition that checks
whether the given mon ID actually exists and thus may be removed.

The first part of the condition checks whether the hash returned by
`get_services_info` [0] contains the key "mon.$monid". However, the
hash's keys are never prefixed with "mon.", which makes this check
incorrect.

This is fixed by just using "$monid" directly.

The second part checks whether the mon hashes returned by
Ceph contain the "name" key before comparing the key with the given
mon ID. This key existence check is also incorrect; in particular:
  * If the lookup `$_->{name}` evaluates to e.g. "foo", the check
    passes, because "foo" is truthy. [1]
  * If the lookup `$_->{name}` evaluates to "0", the check fails,
    because "0" is falsy (due to it being equivalent to the number 0,
    according to Perl [1]).

This is solved by using the inbuilt `defined()` instead of relying on
Perl's definition of truthiness.

[0]: https://git.proxmox.com/?p=pve-manager.git;a=blob;f=PVE/Ceph/Services.pm;h=e0f31e8eb6bc9b3777b3d0d548497276efaa5c41;hb=HEAD#l112
[1]: https://perldoc.perl.org/perldata#Scalar-values

Fixes: https://bugzilla.proxmox.com/show_bug.cgi?id=5198
Signed-off-by: Max Carrara <m.carrara@proxmox.com>
2 months agoui: vm: guest-agent network view: make text in grid selectable
Aaron Lauterer [Thu, 21 Mar 2024 09:25:32 +0000 (10:25 +0100)]
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>
2 months agoui: user: password change: require a confirmation-password
Wolfgang Bumiller [Fri, 15 Mar 2024 12:47:43 +0000 (13:47 +0100)]
ui: user: password change: require a confirmation-password

To hedge against a scenario where an attacker has local or even
physical access to a computer where a user is logged in.

While that general scenario cannot neither get detected nor really
secured against, at least not without requiring re-authentication on
every API call that can have side-effect (i.e., all but GET method),
it still makes sense to ensure that credentials cannot be modified,
which would allow denial of service.

See the related pve-access-control commit 5bcf553 ("user: password
change: require confirmation-password parameter")

Reported-by: Wouter Arts <security@wth-security.nl>
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 months agoui: parse VM network: support floats without trailing zero
Thomas Lamprecht [Thu, 21 Mar 2024 09:40:35 +0000 (10:40 +0100)]
ui: parse VM network: support floats without trailing zero

While on simple cases the frontend will translate a `.5` to `0.5` the
backend really doesn't care and takes either.
And it seems that editing from an exiting `0.5` to `.75` will often
cause this to submitted as is.

Independent of how such a value comes into the config, it broke parsing
the network rate property in the UI, where we assumed that there's
always a digit on the left side of the floating point separator.

Simply extend the regex to allow parsing those floats that directly
start with a separator too.

Link: https://forum.proxmox.com/threads/143525/
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 months agoui: guest import: add warning for losing efi state
Dominik Csapak [Tue, 19 Mar 2024 13:00:32 +0000 (14:00 +0100)]
ui: guest import: add warning for losing efi state

and add a link to recreate the boot entries in ovmf

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
 [ TL: break up String.format to avoid overly long line ]
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 months agoui: guest import: correctly set default scsihw value
Dominik Csapak [Tue, 19 Mar 2024 13:00:31 +0000 (14:00 +0100)]
ui: guest import: correctly set default scsihw value

we have to set it to '__default__' if we didn't get one from the API

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
 [ TL: fix-up eslint warning ]
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 months agoui: guest import: auto activate virtio preparation for win + ovmf
Dominik Csapak [Tue, 19 Mar 2024 13:00:30 +0000 (14:00 +0100)]
ui: guest import: auto activate virtio preparation for win + ovmf

it seems on esxi, most windows vms with uefi are automatically
configured with an lsi scsi controller, which we can't currently support
(ovmf driver issue) so automatically activate the sata mapping + virtio
preparation in this case

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 months agoui: guest import: fix isWindows check
Dominik Csapak [Tue, 19 Mar 2024 13:00:29 +0000 (14:00 +0100)]
ui: guest import: fix isWindows check

while most of our 'windiows' ostypes start with 'win' not all of them do
(wxp, wvista), so just shorten the condition to 'starts with `w`', this
covers all our windows ostypes, while not including others.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 months agofix #5293: ceph status: fix division-by-zero when calculating usage
Christoph Heiss [Tue, 12 Mar 2024 09:13:46 +0000 (10:13 +0100)]
fix #5293: ceph status: fix division-by-zero when calculating usage

Fixes #5293 [0]. This happens when no OSDs are created yet and thus the
total space is 0, which leads to a division-by-zero.

Add a simple check if the total space is greater than 0.

[0] https://bugzilla.proxmox.com/show_bug.cgi?id=5293

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 months agobump version to 8.1.6
Thomas Lamprecht [Thu, 14 Mar 2024 14:26:40 +0000 (15:26 +0100)]
bump version to 8.1.6

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 months agoui: guest import: avoid view-model race on setting os type
Thomas Lamprecht [Wed, 13 Mar 2024 13:52:31 +0000 (14:52 +0100)]
ui: guest import: avoid view-model race on setting os type

Use the default value of the field also as start value in the
viewModel, as other wise the two-way binding can cause the empty
string to be set to the field's value, not vice-versa.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 months agoui: guest import: fine-tune text on labels and button
Thomas Lamprecht [Wed, 13 Mar 2024 13:50:15 +0000 (14:50 +0100)]
ui: guest import: fine-tune text on labels and button

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 months agoui: storage browser: add item double-click handler for guest import
Thomas Lamprecht [Wed, 13 Mar 2024 13:47:13 +0000 (14:47 +0100)]
ui: storage browser: add item double-click handler for guest import

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 months agoui: import: fix top-padding of CD-ROM label
Thomas Lamprecht [Wed, 13 Mar 2024 12:01:45 +0000 (13:01 +0100)]
ui: import: fix top-padding of CD-ROM label

While it was required before commit ca9dce9e8 ("ui: guest import:
rework windows virtio-scsi preparation") to avoid making this crowded,
after that commit we already got the top-padding from the columnT
here, so no need for adding extra padding to that.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 months agoui: import: improve grouping of fields with more spacers
Thomas Lamprecht [Wed, 13 Mar 2024 11:59:28 +0000 (12:59 +0100)]
ui: import: improve grouping of fields with more spacers

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 months agoui: import: increase CPU limits to better match ESXi
Thomas Lamprecht [Wed, 13 Mar 2024 11:54:06 +0000 (12:54 +0100)]
ui: import: increase CPU limits to better match ESXi

On ESXi one can have at max 768 vCPUs and that over maximal 128
sockets. Further, by default ESXi will favor adding single-cpu
sockets, so if one just enters "give me 8 vCPUs", it will be 8
single-core sockets.

As we only supported up to 4 sockets in the web UI, which caused this
field to show up as invalid on initial load for such VMs, which is not
nice.

Having that many sockets is rather odd, so for us it doesn't make
sense to allow more than the ESXi limit that, but having more vCPUs
might make sense, so allow up to 1024 for that for now.

Note that QEMU and our API backend doesn't really cares, the kernels
NR_MAX_CPU is the limit there. Albeit it is questionable if using more
vCPU threads as there are host threads has some sense in any setup.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 months agoui: guest import: rework windows virtio-scsi preparation
Dominik Csapak [Wed, 13 Mar 2024 08:35:57 +0000 (09:35 +0100)]
ui: guest import: rework windows virtio-scsi preparation

instead of having a separate iso selector that shows with an enabled
checkbox, just add a CDROM drive when windows is selected and there is
no such drive available yet.
The idea here is that the VM's OS is already fully set up, so a single
CDROM drive is enough to be used for installing VirtIO drivers, unlike
the VM create case, where the first one is already used for the
installation medium.

Also, rename the 'map to sata' checkbox to 'prepare for virtio-scsi'
that also changes the scsi controller to virtio-scsi-single

Additionally, change the positioning of the checkbox/scsihw selector
to be below the disk grid
With that we then only disable prepare-for-virtio checkbox for
non-windows OS types, as the scsi controller on the right looks like
it hangs in the air without any field on the left otherwise.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
 [ TL: rework commit message, squash in some fixes ]
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 months agoui: guest import: style clean-ups
Thomas Lamprecht [Wed, 13 Mar 2024 07:16:47 +0000 (08:16 +0100)]
ui: guest import: style clean-ups

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 months agoui: guest import: prevent accidental form field submission on second panel
Dominik Csapak [Tue, 12 Mar 2024 14:13:36 +0000 (15:13 +0100)]
ui: guest import: prevent accidental form field submission on second panel

by overwriting the onGetValues to always return nothing

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2 months agoui: guest import: add checkbox for virtio drive
Dominik Csapak [Tue, 12 Mar 2024 14:12:39 +0000 (15:12 +0100)]
ui: guest import: add checkbox for virtio drive

similar to what we have in the wizard.

in the case we cannot find a suitable slot (ide0/2, sata0-6), we
continue, but print a warning into the javascript log

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2 months agoui: iso selector: make labelWidth and Align configurable
Dominik Csapak [Tue, 12 Mar 2024 14:10:12 +0000 (15:10 +0100)]
ui: iso selector: make labelWidth and Align configurable

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2 months agoui: guest import: add field for scsi controller
Dominik Csapak [Tue, 12 Mar 2024 13:37:01 +0000 (14:37 +0100)]
ui: guest import: add field for scsi controller

so that one can overwrite it

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2 months agoui: guest import: implement 'map-to-sata' checkbox
Dominik Csapak [Tue, 12 Mar 2024 13:25:39 +0000 (14:25 +0100)]
ui: guest import: implement 'map-to-sata' checkbox

this is useful when wanting to change to virtioscsi for windows vms,
since we cannot have multiple different scsi controllers.

we assume here that all assigned sata disks/cds have a continuous range,
so sata0, sata1, etc. without any holes

with that assumption, we can use the maximum sata index and simply put
the scsi ones after that.

when there are too many disks to map correctly to sata, show a warning
with the disk id that contains a tooltip.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>