]> git.proxmox.com Git - pve-storage.git/log
pve-storage.git
5 days agobump version to 8.2.4 master
Thomas Lamprecht [Thu, 12 Sep 2024 10:26:30 +0000 (12:26 +0200)]
bump version to 8.2.4

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
5 days agoapi: upload: correctly test for result of unlink
Fiona Ebner [Mon, 29 Jul 2024 14:29:56 +0000 (16:29 +0200)]
api: upload: correctly test for result of unlink

It's not enough to check whether $! is set. From "perldoc perlvar":

> Many system or library calls set "errno" if they fail, to
> indicate the cause of failure. They usually do not set "errno"
> to zero if they succeed and may set "errno" to a non-zero value
> on success. This means "errno", hence $!, is meaningful only
> *immediately* after a failure:

To protect against potential issues, check the return value of unlink
and only check $! if it failed.

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
11 days agobase plugin: do not decode the empty string
Maximiliano Sandoval [Mon, 2 Sep 2024 12:47:45 +0000 (14:47 +0200)]
base plugin: do not decode the empty string

If the json was empty, for example if the qemu-img command times out, a
message

    warn "could not parse qemu-img info command output for '$filename' - $err\n";

would have been printed.

This message could lead one to think the issue lies in the contents of
the json, even if the previous warning said that there was a timeout.

Signed-off-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
11 days agofix #4272: btrfs: add rename feature
Maximiliano Sandoval [Fri, 5 Jul 2024 13:10:39 +0000 (15:10 +0200)]
fix #4272: btrfs: add rename feature

Adds the ability to change the owner of a guest image.

Btrfs does not need special commands to rename a subvolume and this can
be achieved the same as in Storage/plugin.pm's rename_volume taking
special care of how the directory structure used by Btrfs.

Signed-off-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
Tested-By: Aaron Lauterer <a.lauterer@proxmox.com>
Reviewed-By: Aaron Lauterer <a.lauterer@proxmox.com>
11 days agoesxi: fix #5587: add support for older version of vmx storage filepaths
Daniel Kral [Wed, 21 Aug 2024 13:57:47 +0000 (15:57 +0200)]
esxi: fix #5587: add support for older version of vmx storage filepaths

Allow the ESXi storage disk entry property "fileName" to be flatcased
("filename") in addition to being camelcased ("fileName"). This adds
compatibility with older ESXi .vmx configuration files.

Signed-off-by: Daniel Kral <d.kral@proxmox.com>
8 weeks agobtrfs: log executed command on failures
Maximiliano Sandoval [Tue, 9 Jul 2024 11:49:18 +0000 (13:49 +0200)]
btrfs: log executed command on failures

Having the complete command printed out makes debuging easier.

Signed-off-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
2 months agovolume import: assume target API version is at least 9
Fiona Ebner [Mon, 10 Jun 2024 09:04:15 +0000 (11:04 +0200)]
volume import: assume target API version is at least 9

The storage API version has been bumped to at least 9 since
libpve-storage = 7.0-4. If the source node is on Proxmox VE 8, where
this change will come in, then the target node can be assumed to be
running either Proxmox VE 8 or, during upgrade, the latest version of
Proxmox VE 7.4, so it's safe to assume a storage API version of at
least 9 in all cases.

As reported by Maximiliano, the fact that the 'apiinfo' call was
guarded with a quiet eval could lead to strange errors for replication
on a customer system where an SSH connection could not always be
established, because the target's API version would fall back to 1.
Because of that, the '-base' argument would be missing for the import
call on the target which would in turn lead to an error about the
target ZFS volume already existing (rather than doing an incremental
sync).

Reported-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
Reviewed-by: Max Carrara <m.carrara@proxmox.com>
2 months agoplugin: move definition for 'port' option to base plugin
Fiona Ebner [Thu, 18 Apr 2024 08:33:17 +0000 (10:33 +0200)]
plugin: move definition for 'port' option to base plugin

Commit 7020491 ("esxi: add 'port' config parameter") started using
the 'port' option in a second plugin, but the definition stayed in the
PBS plugin. Avoid the hidden dependency and move the definition to the
base plugin instead.

It is necessary to mark it as optional or it would be required always.

Clarify that the option is not used by NFS and CIFS.

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
2 months agostyle: remove goto statements
Fabian Grünbichler [Wed, 26 Jun 2024 08:56:17 +0000 (10:56 +0200)]
style: remove goto statements

these can just as well be `die` statements right there, there is no complicated
cleanup that would warrant a goto statement..

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
Reviewed-by: Fiona Ebner <f.ebner@proxmox.com>
2 months agofix reminder comment for template regex
Fiona Ebner [Thu, 27 Jun 2024 13:05:02 +0000 (15:05 +0200)]
fix reminder comment for template regex

The necessary change in pve-manager to remove this [0] only got
applied during PVE 8.2 [1], so removing this regex has to wait.

[0]: https://lists.proxmox.com/pipermail/pve-devel/2021-October/050514.html
[1]: https://git.proxmox.com/?p=pve-manager.git;a=commit;h=9c54c52d7996572956e65c4820459ff3a1cda778

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
2 months agobump version to 8.2.3
Wolfgang Bumiller [Fri, 21 Jun 2024 11:55:10 +0000 (13:55 +0200)]
bump version to 8.2.3

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 months agoesxi: remove already-dealt-with FIXME comment
Wolfgang Bumiller [Fri, 21 Jun 2024 11:56:25 +0000 (13:56 +0200)]
esxi: remove already-dealt-with FIXME comment

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 months agoRevert "esxi: improve error handling for fuse mount tool"
Wolfgang Bumiller [Fri, 21 Jun 2024 11:46:36 +0000 (13:46 +0200)]
Revert "esxi: improve error handling for fuse mount tool"

This reverts commit d80420bca8ef5c78bcb9bfabb2a3e6c74667ce49.

This diverts stderr of the fuse process to a pipe, which makes no
sense as it runs daemonized in a scope, also, the pipe fd was used as
a ready-signal, which now does not trigger anymore.

3 months agobump version to 8.2.2
Wolfgang Bumiller [Fri, 7 Jun 2024 11:23:35 +0000 (13:23 +0200)]
bump version to 8.2.2

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
3 months agoesxi: improve error handling for fuse mount tool
Dominik Csapak [Fri, 10 May 2024 13:56:58 +0000 (15:56 +0200)]
esxi: improve error handling for fuse mount tool

if the fuse tool encounters an error early, it prints it like:
   Error: some error message
on stderr.

Redirect STDERR of the child process (which mounts the ESXi instance) to
the pipe of the parent (API) process, so that it can pass a hopefully
more meaningful message to the user than just an erroneous return code.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
4 months agofixup error messages when getting file size info
Wolfgang Bumiller [Tue, 30 Apr 2024 07:53:43 +0000 (09:53 +0200)]
fixup error messages when getting file size info

The assignment happens before the 'die', so the error message would
always contain 'undef'.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
4 months agodon't bail on whitespaces in backing devices
Wolfgang Bumiller [Tue, 30 Apr 2024 07:53:42 +0000 (09:53 +0200)]
don't bail on whitespaces in backing devices

This prevents importing from vmdks with whitespaces in file names.
Further, some operations that include file sizes (like listing disks)
would potentially fail entirely if a custom disk with a badly name
backing device exists in a VM images directory since they don't expect
this. Specifically, since we don't necessarily know the actual naming
scheme of the current storage in the plain Plugin.pm version, we don't
check the full name anyway, so why bother with whitespaces...

See-also: https://forum.proxmox.com/threads/new-import-wizard-available-for-migrating-vmware-esxi-based-virtual-machines.144023/page-16#post-658697
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
4 months agobump version to 8.2.1
Thomas Lamprecht [Tue, 23 Apr 2024 15:20:47 +0000 (17:20 +0200)]
bump version to 8.2.1

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 months agoesxi import: add "longhorn" to possible Windows Server 2008 OS types
Thomas Lamprecht [Tue, 23 Apr 2024 08:50:06 +0000 (10:50 +0200)]
esxi import: add "longhorn" to possible Windows Server 2008 OS types

While we detected "winLonghorn" already as w2k8, it seems that some
ESXi versions also use "longhorn" here.

Add that to our known Windows OS type mapping, so that it gets
correctly mapped to our w2k8 type, which affects the selected
hardware.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 months agobump version to 8.2.0
Thomas Lamprecht [Fri, 19 Apr 2024 07:07:15 +0000 (09:07 +0200)]
bump version to 8.2.0

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 months agod/control: bump versioned dependency for libpve-cluster-perl
Thomas Lamprecht [Fri, 19 Apr 2024 06:41:21 +0000 (08:41 +0200)]
d/control: bump versioned dependency for libpve-cluster-perl

to have the new ssh related helpers available

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 months agoupload: use SSH helper to get ssh/scp options
Fabian Grünbichler [Thu, 11 Jan 2024 10:51:23 +0000 (11:51 +0100)]
upload: use SSH helper to get ssh/scp options

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
5 months agolvmthin: import: improve readability
Fabian Grünbichler [Thu, 18 Apr 2024 13:10:46 +0000 (15:10 +0200)]
lvmthin: import: improve readability

the nested call combined with the long parameter list is not very nice to
format/read, let's split it..

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
5 months agofix #1611: implement import of base-images for LVM-thin Storage
Hannes Duerr [Tue, 19 Dec 2023 14:03:06 +0000 (15:03 +0100)]
fix #1611: implement import of base-images for LVM-thin Storage

for base images we call the volume_import of the parent plugin and pass
it as vm-image instead of base-image, then convert it back as base-image

Signed-off-by: Hannes Duerr <h.duerr@proxmox.com>
5 months agostorage migrate: only output about cleaning-up snapshots if there are any
Thomas Lamprecht [Wed, 17 Apr 2024 10:21:08 +0000 (12:21 +0200)]
storage migrate: only output about cleaning-up snapshots if there are any

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
5 months agostorage migrate: tiny line reduction
Thomas Lamprecht [Wed, 17 Apr 2024 10:20:36 +0000 (12:20 +0200)]
storage migrate: tiny line reduction

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
5 months agofix insecure migration failing if waiting on lock
Mira Limbeck [Wed, 17 Apr 2024 09:48:57 +0000 (11:48 +0200)]
fix insecure migration failing if waiting on lock

both STDOUT and STDERR are written into `$info` which is then parsed for
IP and port of the target socket listening.
when the ports file can't be locked immediately `trying to acquire
lock...` is printed on STDERR and in turn written into `$info`.
trying to parse the IP then fails, resulting in a migration or
replication failing.

the bare open3 call is replaced by the run_command wrapper from
pve-common to use a safe wrapper around open3 with the same
functionality.
STDERR is read separatey from STDOUT and the last line of STDERR is
kept in case of errors.

Fixes: 57acd6a ("fix #1452: also log stderr of remote command with
insecure storage migration")

Signed-off-by: Mira Limbeck <m.limbeck@proxmox.com>
5 months agobump version to 8.1.5
Fabian Grünbichler [Thu, 11 Apr 2024 12:33:56 +0000 (14:33 +0200)]
bump version to 8.1.5

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
5 months agocephconfig: align our parser with Ceph's parser
Max Carrara [Tue, 2 Apr 2024 14:55:20 +0000 (16:55 +0200)]
cephconfig: align our parser with Ceph's parser

This commit rewrites the entire parser for ceph.conf, aligning its
behaviour as closely as possible with Ceph's parser grammar [0].

The most notable improvements are as follows:

  1. The characters '#' and ';' now both mark comments, instead of
     just the '#' character.

  2. Any character, including comment literals ('#' and ';'), may now
     be escaped.

  3. Quoted values (single and double) are now supported.

  4. Line continuations are now supported (lines ending with '\').

  5. Repeated whitespace characters in keys are now treated as a
     single space character.

  6. Dashes '-' are not treated the same as spaces and underscores
     anymore, as Ceph's grammar doesn't treat them that way.
     * Paired with 5., this means that repeated whitespace is now
       equivalent to a single underscore.

  7. Escaped comment literals are now un-escaped.

  8. Although not too crucial, the parser now also supports empty
     sections and will just initialize them with an empty hash.

Furthermore, the original grammar's more quirky behaviours are also
respected where sanely possible.

[0]: https://git.proxmox.com/?p=ceph.git;a=blob;f=ceph/src/common/ConfUtils.cc;h=2f78fd02bf9e27467275752e6f3bca0c5e3946ce;hb=e9fe820e7fffd1b7cde143a9f77653b73fcec748#l144

Signed-off-by: Max Carrara <m.carrara@proxmox.com>
Tested-by: Friedrich Weber <f.weber@proxmox.com>
5 months agocephconfig: escape un-escaped comment literals on write
Max Carrara [Tue, 2 Apr 2024 14:55:19 +0000 (16:55 +0200)]
cephconfig: escape un-escaped comment literals on write

in order to prevent configuration errors or the configuration being
misinterpreted.

Signed-off-by: Max Carrara <m.carrara@proxmox.com>
Tested-by: Friedrich Weber <f.weber@proxmox.com>
5 months agocephconfig: align written key-value pairs by tab
Max Carrara [Tue, 2 Apr 2024 14:55:18 +0000 (16:55 +0200)]
cephconfig: align written key-value pairs by tab

instead of tab + space.

Signed-off-by: Max Carrara <m.carrara@proxmox.com>
Tested-by: Friedrich Weber <f.weber@proxmox.com>
5 months agocephconfig: change order of written sections
Max Carrara [Tue, 2 Apr 2024 14:55:17 +0000 (16:55 +0200)]
cephconfig: change order of written sections

in order to group related sections together.

Additionally, sections that are associated with the client, for
example '[client.foo]', are written directly after the '[client]'
section.

Signed-off-by: Max Carrara <m.carrara@proxmox.com>
Tested-by: Friedrich Weber <f.weber@proxmox.com>
5 months agocephconfig: allow writing arbitrary sections
Max Carrara [Tue, 2 Apr 2024 14:55:16 +0000 (16:55 +0200)]
cephconfig: allow writing arbitrary sections

This adds support for writing arbitrary sections to 'ceph.conf' while
ensuring that already written sections are not duplicated.

Signed-off-by: Max Carrara <m.carrara@proxmox.com>
Tested-by: Friedrich Weber <f.weber@proxmox.com>
5 months agotest: add tests for 'ceph.conf' parser and writer
Max Carrara [Tue, 2 Apr 2024 14:55:14 +0000 (16:55 +0200)]
test: add tests for 'ceph.conf' parser and writer

These tests attempt to cover most of Ceph's config parser's grammar,
including all of its syntax quirks [0].

Each case is tested against two testing subroutines:

  1. The parser's output is compared with the expected output.

  2. The writer's output is parsed again ant then compared with the
     expected output.

[0]: https://git.proxmox.com/?p=ceph.git;a=blob;f=ceph/src/common/ConfUtils.cc;h=2f78fd02bf9e27467275752e6f3bca0c5e3946ce;hb=e9fe820e7fffd1b7cde143a9f77653b73fcec748#l144

Signed-off-by: Max Carrara <m.carrara@proxmox.com>
Tested-by: Friedrich Weber <f.weber@proxmox.com>
5 months agocephconfig: change code style inside config writer
Max Carrara [Tue, 2 Apr 2024 14:55:13 +0000 (16:55 +0200)]
cephconfig: change code style inside config writer

This commit changes the code style of subroutine `write_ceph_config`
to match our style guide [0] more.

Furthermore, the repeated calls to the inner subroutine are replaced
with a loop, while the regular expressions used by the inner `sub` are
now quoted with `qr` to prevent any accidental mis-quotings in the
future.

[0]: https://pve.proxmox.com/wiki/Perl_Style_Guide

Signed-off-by: Max Carrara <m.carrara@proxmox.com>
Tested-by: Friedrich Weber <f.weber@proxmox.com>
5 months agoesxi: guest types: use quotes for all hash-map keys
Thomas Lamprecht [Tue, 9 Apr 2024 11:18:50 +0000 (13:18 +0200)]
esxi: guest types: use quotes for all hash-map keys

A small coding style patch to make the list of guest-types mapping to
Windows easier to read.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
5 months agoesxi: add mapping for windows server 2016/2019
Stefan Sterz [Tue, 9 Apr 2024 10:56:11 +0000 (12:56 +0200)]
esxi: add mapping for windows server 2016/2019

previously these were mapped to the linux 2.6 default

Signed-off-by: Stefan Sterz <s.sterz@proxmox.com>
5 months agouse stderr from qemu-img invocation as error
Wolfgang Bumiller [Thu, 4 Apr 2024 10:55:40 +0000 (12:55 +0200)]
use stderr from qemu-img invocation as error

Instead of just using it as a warning and then trying to parse an
empty string as json.

For example, trying to parse unsupported vmdks, previously we'd see
something like this:

  qemu-img: Could not open
  '/run/pve/import/esxi/foo/mnt/ha-datacenter/vsanDatastore/asdf/asdf-000001.vmdk':
  Unsupported image type 'vsanSparse'
  could not parse qemu-img info command output for
  '/run/pve/import/esxi/foo/mnt/ha-datacenter/vsanDatastore/asdf/asdf-000001.vmdk'
  - malformed JSON string, neither tag, array, object, number, string
  or atom, at character offset 0 (before "(end of string)") at
  src/PVE/Storage/Plugin.pm line 962, <DATA> line 960.

Now it simply shows:

  qemu-img: Could not open
  '/run/pve/import/esxi/foo/mnt/ha-datacenter/vsanDatastore/asdf/asdf-000001.vmdk':
  Unsupported image type 'vsanSparse'

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
5 months agoesxi: status: mark as active if its mounted
Thomas Lamprecht [Thu, 28 Mar 2024 18:12:06 +0000 (19:12 +0100)]
esxi: status: mark as active if its mounted

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
5 months agoesxi: drop unused variable and commented out code
Thomas Lamprecht [Thu, 28 Mar 2024 18:11:33 +0000 (19:11 +0100)]
esxi: drop unused variable and commented out code

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
5 months agobump version to 8.1.4
Thomas Lamprecht [Thu, 28 Mar 2024 16:37:32 +0000 (17:37 +0100)]
bump version to 8.1.4

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
5 months agod/control: bump versioned dependency for esxi-import-tool
Thomas Lamprecht [Thu, 28 Mar 2024 16:37:26 +0000 (17:37 +0100)]
d/control: bump versioned dependency for esxi-import-tool

to ensure new port-related CLI options are available

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
5 months agoesxi: add 'port' config parameter
Wolfgang Bumiller [Thu, 28 Mar 2024 13:18:34 +0000 (14:18 +0100)]
esxi: add 'port' config parameter

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
5 months agobump version to 8.1.3
Thomas Lamprecht [Wed, 27 Mar 2024 11:38:59 +0000 (12:38 +0100)]
bump version to 8.1.3

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
5 months agoesxi: reduce cache invalidation time to 30s
Thomas Lamprecht [Wed, 27 Mar 2024 12:11:22 +0000 (13:11 +0100)]
esxi: reduce cache invalidation time to 30s

Reduce the time the cache stays valid from 60s to 30s, while this
could double the amount of requests in the worst case, it's still not
that frequent and also halves the maximal time a user has to wait to
see changes on the ESXi side to appear here.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
5 months agoesxi: use mac address when static, generated and vpx
Aaron Lauterer [Tue, 26 Mar 2024 12:04:38 +0000 (13:04 +0100)]
esxi: use mac address when static, generated and vpx

static -> defined manually
generated -> by ESXi
vpx -> generated by vCenter

Signed-off-by: Aaron Lauterer <a.lauterer@proxmox.com>
5 months agobump version to 8.1.2
Thomas Lamprecht [Fri, 22 Mar 2024 15:39:30 +0000 (16:39 +0100)]
bump version to 8.1.2

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
5 months agod/control: bump versioned dependency for esxi-import-tool
Thomas Lamprecht [Fri, 22 Mar 2024 15:39:10 +0000 (16:39 +0100)]
d/control: bump versioned dependency for esxi-import-tool

to ensure new CLI options for dropping privileges are available

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
5 months agoesxi: have the fuse process drop its privileges
Wolfgang Bumiller [Fri, 22 Mar 2024 12:24:13 +0000 (13:24 +0100)]
esxi: have the fuse process drop its privileges

once it's mounted it only needs to make http requests and talk to the
open fuse fd

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
5 months agoesxi: use listvms.py's stderr as error message
Wolfgang Bumiller [Fri, 22 Mar 2024 10:06:56 +0000 (11:06 +0100)]
esxi: use listvms.py's stderr as error message

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
5 months agoesxi: detect correct os type in 'other' family
Gabriel Goller [Thu, 21 Mar 2024 09:07:52 +0000 (10:07 +0100)]
esxi: detect correct os type in 'other' family

This patch introduces the conversion table for all possible OS Types
that are in the VMWare 'other' family and sets the pve counterpart.
Our default OS Type is 'linux', so including mappings to 'other' makes
sense.

Signed-off-by: Gabriel Goller <g.goller@proxmox.com>
6 months agoesxi: only add scsihw if it's defined
Dominik Csapak [Tue, 19 Mar 2024 13:00:28 +0000 (14:00 +0100)]
esxi: only add scsihw if it's defined

otherwise we get `scsihw: null` from the api, which is not a valid
value, so just omit it.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
6 months agoesxi: add warning for losing efi state
Dominik Csapak [Tue, 19 Mar 2024 13:00:27 +0000 (14:00 +0100)]
esxi: add warning for losing efi state

we cannot import the state of the efivars (e.g. boot order)
so add a warning for that

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
 [ TL: add new warning to return schema ]
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
6 months agobump version to 8.1.1
Thomas Lamprecht [Wed, 13 Mar 2024 14:29:52 +0000 (15:29 +0100)]
bump version to 8.1.1

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
6 months agoesxi: deactivate storage if config gets updated
Thomas Lamprecht [Tue, 12 Mar 2024 17:34:33 +0000 (18:34 +0100)]
esxi: deactivate storage if config gets updated

to ensure that the next access actually uses the updated config for
accessing the remote ESXi, for both manifest API and FUSE mount.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
6 months agoesxi: clean-up state-dir in deactivate storage
Thomas Lamprecht [Tue, 12 Mar 2024 17:33:15 +0000 (18:33 +0100)]
esxi: clean-up state-dir in deactivate storage

to ensure we always query a new one on quick add-delete-add cycles.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
6 months agoesxi: deactivate storage on deletion from config
Thomas Lamprecht [Tue, 12 Mar 2024 17:34:04 +0000 (18:34 +0100)]
esxi: deactivate storage on deletion from config

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
6 months agoesxi: add 'skip-cert-verification' option
Wolfgang Bumiller [Tue, 12 Mar 2024 12:54:49 +0000 (13:54 +0100)]
esxi: add 'skip-cert-verification' option

following pve-esxi-import-tools's commits:
3ee5c3b ("esxi-folder-fuse: add --insecure option")
c292c67 ("listvms.py: add --insecure parameter, verify cert by
          default")
34c87be ("rename --insecure option to --skip-cert-verification")

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
 [ TL: rename 'insecure' to 'skip-cert-verification' to better convey
   what it means ]
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
6 months agoimport: rework plugin api to not need a blessed object
Dominik Csapak [Tue, 12 Mar 2024 11:51:26 +0000 (12:51 +0100)]
import: rework plugin api to not need a blessed object

does not really make sense, and if the plugin wants that, it can still
be done, like we do here for the ESXiPlugin

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
6 months agoimport: drop target parameter
Wolfgang Bumiller [Tue, 12 Mar 2024 12:58:45 +0000 (13:58 +0100)]
import: drop target parameter

since disks are a separate hash now with no associated storage, we
don't need this anymore

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
6 months agoesxi: add disk capacity to import metadata
Wolfgang Bumiller [Mon, 11 Mar 2024 13:02:14 +0000 (14:02 +0100)]
esxi: add disk capacity to import metadata

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
6 months agoesxi: warn if the guest was running
Wolfgang Bumiller [Mon, 11 Mar 2024 12:50:16 +0000 (13:50 +0100)]
esxi: warn if the guest was running

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
6 months agoesxi: add helper to get vm from manifest for vmx path
Wolfgang Bumiller [Mon, 11 Mar 2024 12:49:58 +0000 (13:49 +0100)]
esxi: add helper to get vm from manifest for vmx path

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
6 months agoesxi: let manifest file expire after 60s
Wolfgang Bumiller [Mon, 11 Mar 2024 12:13:19 +0000 (13:13 +0100)]
esxi: let manifest file expire after 60s

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
 [ TL: fix wrong comparison with >= and avoid undef warning if file
   does not yet exist at all ]
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
6 months agoesxi: drop unused sub methods
Wolfgang Bumiller [Mon, 11 Mar 2024 12:08:22 +0000 (13:08 +0100)]
esxi: drop unused sub methods

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
 [ TL: squash removal of both subs into one commit ]
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
6 months agoapi: import-metadata: make warnings structured & merge ignored-volumes
Thomas Lamprecht [Sun, 10 Mar 2024 18:25:34 +0000 (19:25 +0100)]
api: import-metadata: make warnings structured & merge ignored-volumes

This allows the frontends to translate them and avoids somewhat
duplicated info by having some warnings explicitly (ignored-volumes)
while others are in the warnings array.

By passing along the key and the value the frontend can also show the
warnings in-line, e.g. by marking a disk-entry in a grid as having
potential problems.

Ideally we'd have a central list of known types used for the API
return schema enum and to check when calling the $warn closure, but as
we only got three warnings keep this as is and only add a comment.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
6 months agoapi: import-metadata: complete return schema
Thomas Lamprecht [Sun, 10 Mar 2024 17:50:45 +0000 (18:50 +0100)]
api: import-metadata: complete return schema

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
6 months agoesxi plugin: do not support the images content-type
Thomas Lamprecht [Sun, 10 Mar 2024 17:46:34 +0000 (18:46 +0100)]
esxi plugin: do not support the images content-type

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
6 months agoesxi plugin: adapt to new libexec path for helpers
Thomas Lamprecht [Sun, 10 Mar 2024 17:45:15 +0000 (18:45 +0100)]
esxi plugin: adapt to new libexec path for helpers

and rename the name of the constant for the FUSE tool, as otherwise it
sounds like this was the mountpoint to be used

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
6 months agoesxi import: deal with serial devices
Wolfgang Bumiller [Fri, 8 Mar 2024 13:06:47 +0000 (14:06 +0100)]
esxi import: deal with serial devices

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
6 months agoadd source field to import-metadata
Wolfgang Bumiller [Fri, 8 Mar 2024 12:34:58 +0000 (13:34 +0100)]
add source field to import-metadata

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
6 months agoadd a warnings array to import-metadata
Wolfgang Bumiller [Fri, 8 Mar 2024 12:34:31 +0000 (13:34 +0100)]
add a warnings array to import-metadata

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
6 months agoesxi: improve scsihw detection
Wolfgang Bumiller [Fri, 8 Mar 2024 09:52:33 +0000 (10:52 +0100)]
esxi: improve scsihw detection

we should actually keep the scsihw even with eg. linux VMs as they
might not have virtio/... in their initrd and then fail to boot

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
6 months agoesxi: separate disks and network
Wolfgang Bumiller [Fri, 8 Mar 2024 09:43:16 +0000 (10:43 +0100)]
esxi: separate disks and network

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
6 months agoimport: return skipped/ignored volumes in get_create_args
Wolfgang Bumiller [Wed, 6 Mar 2024 14:14:05 +0000 (15:14 +0100)]
import: return skipped/ignored volumes in get_create_args

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
6 months agoapi: add storage/{storage}/import-metadata
Wolfgang Bumiller [Wed, 6 Mar 2024 13:13:54 +0000 (14:13 +0100)]
api: add storage/{storage}/import-metadata

This will be used for returning the base meta information of a
external VM that is about to be imported into Proxmox VE.

A front-end can use this endpoint to show the proposed configs with
potential override switches to the user, so that they can adapt the
most important options to ensure that import can work.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
 [ TL: add more commit message with some background ]
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
6 months agoadd ESXi plugin for import and wire-it up to a new get_guest_import plugin fn
Wolfgang Bumiller [Mon, 4 Mar 2024 09:10:47 +0000 (10:10 +0100)]
add ESXi plugin for import and wire-it up to a new get_guest_import plugin fn

The get_guest_import fn is currently a private/internal API and should
not yet be exposed as a public part of the storage API.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
6 months agobump pve-common dep to 8.1.1 for PVE::Systemd::unit_is_active
Wolfgang Bumiller [Wed, 6 Mar 2024 13:49:36 +0000 (14:49 +0100)]
bump pve-common dep to 8.1.1 for PVE::Systemd::unit_is_active

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
6 months agostorage plugins: add 'import' content type
Wolfgang Bumiller [Mon, 4 Mar 2024 09:10:33 +0000 (10:10 +0100)]
storage plugins: add 'import' content type

Add a new 'import' content type which will be the corner stone for a
better API and UI integrated way to import virtual guests into Proxmox
VE.

For starters this will be used to implement a ESXi adapter, so that
those VMs can get imported nicely.

Later we want to integrate the OVF/OVA import skeletons we got in
qemu-server to something more usable here.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
 [ TL: add more commit message with some background ]
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
6 months agobump version to 8.1.0
Thomas Lamprecht [Wed, 6 Mar 2024 17:26:01 +0000 (18:26 +0100)]
bump version to 8.1.0

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
6 months agobuildsys: cleanup all docs and shell comnpletion artefacts
Thomas Lamprecht [Tue, 5 Mar 2024 10:26:30 +0000 (11:26 +0100)]
buildsys: cleanup all docs and shell comnpletion artefacts

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
6 months agod/copyright: update years
Thomas Lamprecht [Fri, 1 Mar 2024 09:13:24 +0000 (10:13 +0100)]
d/copyright: update years

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
6 months agod/control: add dependency relation on libpve-access-control
Thomas Lamprecht [Wed, 28 Feb 2024 14:51:23 +0000 (15:51 +0100)]
d/control: add dependency relation on libpve-access-control

We actually use it already (partially without perl use statement) and
the use of the new Sys.AccessNetwork privilege should be version
guarded too.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
6 months agofix #5254: api: allow usage of download-url with Sys.AccessNetwork
Thomas Lamprecht [Mon, 19 Feb 2024 16:13:41 +0000 (17:13 +0100)]
fix #5254: api: allow usage of download-url with Sys.AccessNetwork

The download-url API endpoint has some implications that admins are
unaware of, namely that it basically allow to scan the whole network
via HTTP URLs, and potentially even download some image that the user
should not have access to and adding to a VM that the user controls.

That's why in addition to the Datastore.AllocateTemplate privilege on
the storage, the Sys.Modify on the whole Cluster was required to use
the API call. That design was chosen as we were not fully sure if a
separate privilege is warranted, but user feedback has shown that the
(not so big) cost of adding such a new privilege is justified.

Change the permission check to allow the combination of
Datastore.AllocateTemplate on the storage and either 'Sys.Modify' on
/, for backwards compatibility, or the newer 'Sys.AccessNetwork' on
the node that handles the download.
Using a node-specific ACL path allows admins to e.g. prepare one
specific node's firewall so that pveproxy can access only a safe set
of hosts via outgoing HTTP (not stemming from valid connection
tracking to the PVE API), and thus even further limit the privileges
of users or tools that are trusted to download images to a storage.

Buglink: https://bugzilla.proxmox.com/show_bug.cgi?id=5254
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Tested-by: Hannes Duerr <h.duerr@proxmox.com>
Reviewed-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
7 months agoplugin schema: improve description of 'shared' property
Fiona Ebner [Tue, 30 Jan 2024 10:28:31 +0000 (11:28 +0100)]
plugin schema: improve description of 'shared' property

It's not clear to users what this property does otherwise. Latest
report from the community forum:

https://forum.proxmox.com/threads/134393

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
7 months agoplugin schema: improve description of 'nodes' property
Fiona Ebner [Wed, 4 Oct 2023 07:35:41 +0000 (09:35 +0200)]
plugin schema: improve description of 'nodes' property

The default description doesn't make it clear what the property is
used for in the context of storages.

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
7 months agozfs: fix duplicate word typo in error message
Fiona Ebner [Tue, 30 Jan 2024 09:11:04 +0000 (10:11 +0100)]
zfs: fix duplicate word typo in error message

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
9 months agobump version to 8.0.5
Thomas Lamprecht [Tue, 21 Nov 2023 20:20:57 +0000 (21:20 +0100)]
bump version to 8.0.5

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
9 months agobtrfs: fix calling parent create_base method in fall-back
Thomas Lamprecht [Sun, 19 Nov 2023 19:05:50 +0000 (20:05 +0100)]
btrfs: fix calling parent create_base method in fall-back

If we want to forward to the create_base of the directory plugin while
making that use our $class for the operations that call might do, we
cannot use the -> notation (which would resolve the next actual
implementation) but rather pass the class directly.
But, DirPlugin reuses the create_base method from the base Plugin
method, so we also need to call that, because on direct call notation
the inheritance fallback to super methods isn't available.

Reported in the forum:
https://forum.proxmox.com/threads/95684/post-606535

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
10 months agobump version to 8.0.4
Thomas Lamprecht [Mon, 13 Nov 2023 17:12:48 +0000 (18:12 +0100)]
bump version to 8.0.4

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
10 months agodisks: get: add osdid-list return parameter
Aaron Lauterer [Tue, 22 Aug 2023 09:04:55 +0000 (11:04 +0200)]
disks: get: add osdid-list return parameter

It is possible to run multiple OSD daemons on one disk. The new
'osdid-list' parameter returns an array of all OSD IDs found on the
disk.

The old 'osdid' parameter is kept for compatibility. We might want to
deprecate / remove it in the future.

Signed-off-by: Aaron Lauterer <a.lauterer@proxmox.com>
10 months agod/control: bump versioned dependency for libpve-common-perl to >= 8.0.10
Thomas Lamprecht [Mon, 13 Nov 2023 15:44:41 +0000 (16:44 +0100)]
d/control: bump versioned dependency for libpve-common-perl to >= 8.0.10

to ensure the new tar parameter for the pbs-client is known

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
10 months agoapi/filerestore: add 'tar' parameter to 'download' api
Dominik Csapak [Thu, 19 Oct 2023 09:13:54 +0000 (11:13 +0200)]
api/filerestore: add 'tar' parameter to 'download' api

to be able to download 'tar.zst' archives

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
10 months agoiscsi: code cleanups
Thomas Lamprecht [Fri, 27 Oct 2023 11:44:05 +0000 (13:44 +0200)]
iscsi: code cleanups

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
10 months agoiscsi: always recheck if iscsiadm binary is available
Thomas Lamprecht [Fri, 27 Oct 2023 11:42:46 +0000 (13:42 +0200)]
iscsi: always recheck if iscsiadm binary is available

this avoids the need for restarting all services that have pve-storage
modules loaded after the admin installed open-iscsi.

while at it make it a bit more clear that this might die by using
assert in the method name.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
10 months agofix #254: iscsi: add support for multipath targets
Yuri Konotopov via pve-devel [Mon, 23 Oct 2023 17:45:08 +0000 (21:45 +0400)]
fix #254: iscsi: add support for multipath targets

With this patch Proxmox now tries to login to all discovered portals
in case some of them are not logged yet.
In case of multipath configuration when initially configured portal is
missing for some reason Proxmox don't lose iSCSI storage now and can
successfully restore iSCSI connection between reboots.

Signed-off-by: Yuri Konotopov <ykonotopov@gnome.org>
Reviewed-By: Dominik Csapak <d.csapak@proxmox.com>
Tested-By: Dominik Csapak <d.csapak@proxmox.com>
12 months agooffline migration: use telling variable for capture group
Thomas Lamprecht [Thu, 31 Aug 2023 13:21:30 +0000 (15:21 +0200)]
offline migration: use telling variable for capture group

With that the if/else branches are pretty clear, so drop the rather
noisy comments that describe what one can get from the code already
anyway.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
12 months agofix #3004: show progress of offline migration in task log
Leo Nunner [Thu, 31 Aug 2023 10:41:59 +0000 (12:41 +0200)]
fix #3004: show progress of offline migration in task log

dd supports a 'status' flag, which enables it to show the copied bytes,
duration, and the transfer rate, which then get printed to stderr.

Signed-off-by: Leo Nunner <l.nunner@proxmox.com>
12 months agocifs: bubble up NT_STATUS_INVALID_PARAMETER during connection check
Fiona Ebner [Tue, 27 Jun 2023 07:48:49 +0000 (09:48 +0200)]
cifs: bubble up NT_STATUS_INVALID_PARAMETER during connection check

instead of claiming that the storage is not online.

Would've made the issue fixed by b27da68 ("cifs: fix check connection
call") more obvious, because (the UI passes along an empty string for
domain if not set and) the smbclient call returns that status with
> -W ''
in Bookworm.

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
13 months agobump version to 8.0.3
Wolfgang Bumiller [Fri, 18 Aug 2023 08:40:16 +0000 (10:40 +0200)]
bump version to 8.0.3

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>