Commit Graph

7343 Commits

Author SHA1 Message Date
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
Fabian Grünbichler
b76dc13ba5 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>
2024-04-11 14:56:16 +02:00
Fabian Grünbichler
85c14e2826 postinst: remove blank lines
it looks confusing in `apt ..` output

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2024-04-11 11:56:10 +02:00
Fabian Grünbichler
59dd868c1f d/control: depend on pve-storage with new ceph parser
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2024-04-11 11:55:47 +02:00
Fabian Grünbichler
2ff48ca76c postinst: replace placeholder with actual version
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2024-04-11 10:55:35 +02:00
Max Carrara
70b800e944 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>
2024-04-11 10:42:11 +02:00
Max Carrara
11edd5d88d 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>
2024-04-11 10:42:11 +02:00
Max Carrara
a51a28e3cd 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>
2024-04-11 10:42:11 +02:00
Stefan Hanreich
0cc99840e0 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>
2024-04-08 18:00:49 +02:00
Thomas Lamprecht
4b06efb5db bump version to 8.1.10
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2024-03-28 19:57:10 +01:00
Thomas Lamprecht
a3be01c6ea 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>
2024-03-28 19:56:11 +01:00
Thomas Lamprecht
71ba92b1c9 bump version to 8.1.9
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2024-03-28 18:12:50 +01:00
Thomas Lamprecht
302f0d083d 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>
2024-03-28 18:07:31 +01:00
Thomas Lamprecht
f2be47a4c5 node: wake-on-lan: document defaults and small style clean-up
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2024-03-28 17:52:25 +01:00
Christian Ebner
a967ff655f 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>
2024-03-28 17:27:47 +01:00
Christian Ebner
869c155c6a 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>
2024-03-28 17:27:47 +01:00
Christian Ebner
3f83a0332e 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>
2024-03-28 17:27:47 +01:00
Thomas Lamprecht
0bd4061da8 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>
2024-03-28 17:25:36 +01:00
Thomas Lamprecht
ddb5a882b4 ui: guest import: avoid using "grid" as variable name for a window view
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2024-03-28 17:22:24 +01:00
Thomas Lamprecht
8f02fa4307 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>
2024-03-28 17:15:42 +01:00
Thomas Lamprecht
d29041d9f8 bump version to 8.1.8
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2024-03-27 14:36:05 +01:00
Thomas Lamprecht
d5336b9e2b d/control: bump versioned dependencies for libpve-storage-perl
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2024-03-27 14:36:05 +01:00
Thomas Lamprecht
b0a9a170d4 guest import: validate that selected VMID does not exist yet
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2024-03-27 14:31:34 +01:00
Thomas Lamprecht
549bffb7bb 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>
2024-03-27 12:44:41 +01:00
Thomas Lamprecht
e4ebc552df 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>
2024-03-27 11:45:32 +01:00
Thomas Lamprecht
c8c53aa413 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>
2024-03-27 11:45:26 +01:00
Thomas Lamprecht
74a2419530 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>
2024-03-27 11:39:24 +01:00
Thomas Lamprecht
911a62c592 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>
2024-03-27 10:50:41 +01:00
Thomas Lamprecht
2d101e4539 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>
2024-03-27 10:36:03 +01:00
Aaron Lauterer
d71556966f 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>
2024-03-27 08:46:14 +01:00
Wolfgang Bumiller
8e460b76be ui: parser: recognize e1000e as network card
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2024-03-26 11:18:12 +01:00
Thomas Lamprecht
bbbaf45d62 bump version to 8.1.7
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2024-03-22 16:08:20 +01:00
Thomas Lamprecht
a2ae3c5011 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>
2024-03-22 16:08:20 +01:00
Max Carrara
50ae86b758 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>
2024-03-21 18:12:39 +01:00
Max Carrara
bacedc4e9b 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>
2024-03-21 18:09:30 +01: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
Wolfgang Bumiller
baf6842a17 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>
2024-03-21 17:08:25 +01:00
Thomas Lamprecht
b120875cc4 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>
2024-03-21 10:50:04 +01:00
Dominik Csapak
24d60df3da 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>
2024-03-19 18:16:51 +01:00
Dominik Csapak
6353e9f8c3 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>
2024-03-19 18:16:21 +01:00
Dominik Csapak
4a855db6fa 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>
2024-03-19 18:16:00 +01:00
Dominik Csapak
ffa2f7b4a7 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>
2024-03-19 18:16:00 +01:00
Christoph Heiss
da266fdc51 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>
2024-03-19 18:16:00 +01:00
Thomas Lamprecht
01200f7d73 bump version to 8.1.6
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2024-03-14 15:26:40 +01:00
Thomas Lamprecht
0dca5cdabd 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>
2024-03-14 15:17:43 +01:00
Thomas Lamprecht
202dc899e7 ui: guest import: fine-tune text on labels and button
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2024-03-14 15:17:43 +01:00
Thomas Lamprecht
7538d01102 ui: storage browser: add item double-click handler for guest import
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2024-03-14 15:17:43 +01:00
Thomas Lamprecht
defff6ad73 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>
2024-03-14 15:17:43 +01:00
Thomas Lamprecht
c07819af96 ui: import: improve grouping of fields with more spacers
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2024-03-14 15:17:43 +01:00
Thomas Lamprecht
194eb3a850 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>
2024-03-14 15:17:43 +01:00