]> git.proxmox.com Git - pve-storage.git/log
pve-storage.git
4 years agocalculate reasonable metadatasize for lvm thin pools on creation
Tim Marx [Fri, 6 Dec 2019 13:04:45 +0000 (14:04 +0100)]
calculate reasonable metadatasize for lvm thin pools on creation

Letting LVM set the meta-data size internally was not a good idea, as
it produces really small metadata LVs. Adapts the same logic as the
installer.

Signed-off-by: Tim Marx <t.marx@proxmox.com>
Reviewed-By: Dominik Csapak <d.csapak@proxmox.com>
Tested-By: Dominik Csapak <d.csapak@proxmox.com>
4 years agolvm: vg create: followup for bogus warnings
Thomas Lamprecht [Mon, 2 Dec 2019 14:15:52 +0000 (15:15 +0100)]
lvm: vg create: followup for bogus warnings

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agobump version to 6.1-2
Thomas Lamprecht [Sat, 30 Nov 2019 18:38:17 +0000 (19:38 +0100)]
bump version to 6.1-2

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agoLVM commands: ignore "No medium found" bogus warnings
Thomas Lamprecht [Fri, 29 Nov 2019 13:44:13 +0000 (14:44 +0100)]
LVM commands: ignore "No medium found" bogus warnings

Those come normally from virtual devices, like a IPMI disk, if no
media is attached. They spam the log really often on operations like
migrate, and are quite scare-mongering. So filter them out.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agorbd: update features of image when mapping snapshot
Fabian Grünbichler [Fri, 29 Nov 2019 12:30:30 +0000 (13:30 +0100)]
rbd: update features of image when mapping snapshot

in order to fix the features even if the image itself never gets mapped.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
4 years agorbd: don't attempt to update features of snapshots
Fabian Grünbichler [Fri, 29 Nov 2019 09:57:17 +0000 (10:57 +0100)]
rbd: don't attempt to update features of snapshots

it does not work:

disable RBD image features this kernel RBD drivers is not compatible with: fast-diff,object-map,deep-flatten
clone failed: could not disable krbd-incompatible image features 'fast-diff,object-map,deep-flatten' for rbd image: vm-123123123-disk-0@test: rbd: snapshot name specified for a command that doesn't use it

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
4 years agobump version to 6.1-1
Thomas Lamprecht [Wed, 27 Nov 2019 13:46:53 +0000 (14:46 +0100)]
bump version to 6.1-1

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agopvesm import: make error messages consistent
Fabian Grünbichler [Wed, 27 Nov 2019 12:48:59 +0000 (13:48 +0100)]
pvesm import: make error messages consistent

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
4 years agopvesm import: improve handling of interrupted export
Fabian Grünbichler [Wed, 27 Nov 2019 12:48:58 +0000 (13:48 +0100)]
pvesm import: improve handling of interrupted export

since 'pvesm export' and 'pvesm import' are connected via a pipe and
SSH, a fatal error in the former can lead to no valid header being
written to the pipe. handle this more gracefully by printing an easier
to understand error message, instead of uninitialized warnings with no
context.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
4 years agofix #2309: allow LVM Volume Group names starting with a digit
Thomas Lamprecht [Tue, 26 Nov 2019 13:17:19 +0000 (14:17 +0100)]
fix #2309: allow LVM Volume Group names starting with a digit

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agobump version to 6.0-12
Thomas Lamprecht [Mon, 25 Nov 2019 17:28:57 +0000 (18:28 +0100)]
bump version to 6.0-12

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agod/controll: add zfs-zed to Recommends
Thomas Lamprecht [Mon, 25 Nov 2019 13:57:23 +0000 (14:57 +0100)]
d/controll: add zfs-zed to Recommends

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agod/control: bump version dependency to pve-common
Thomas Lamprecht [Sat, 23 Nov 2019 15:15:56 +0000 (16:15 +0100)]
d/control: bump version dependency to pve-common

ensures we have the new kernel_version helper available.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agoRBD: disable and enable features depending on kernel version
Thomas Lamprecht [Sat, 23 Nov 2019 14:37:46 +0000 (15:37 +0100)]
RBD: disable and enable features depending on kernel version

Modern kernel, like 5.3, support all those features ('fast-diff',
'object-map', 'deep-flatten'), so we do not want to disable them
there. 5.0 already supports exclusive-locks, so no need to disable
exclusive locking there.

Further, we also want to profit from new features available, so let's
enable those which can be enabled "live" (i.e., after image creation)
if their available.

While we could also parse the kernel information directly from:
/sys/module/libceph/parameters/supported_features
there's not much advantage to that, features cannot be disabled with
KConfig, their also very dependent of the kernel version booted.
So for us it's enough to check that one.

This only affects container and VMs backed by a storage with KRBD
explicitly enabled. But as the enabling and disabling happens
transparently, it has no effect on the running guest.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agorbd: group and sort module usage
Thomas Lamprecht [Fri, 22 Nov 2019 17:15:25 +0000 (18:15 +0100)]
rbd: group and sort module usage

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agobump version to 6.0-11
Thomas Lamprecht [Fri, 22 Nov 2019 15:06:20 +0000 (16:06 +0100)]
bump version to 6.0-11

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agoRBD: fix ceph version detection
Thomas Lamprecht [Fri, 22 Nov 2019 15:00:59 +0000 (16:00 +0100)]
RBD: fix ceph version detection

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agocleanuo: no need to negate we have not-equal
Thomas Lamprecht [Thu, 21 Nov 2019 11:28:49 +0000 (12:28 +0100)]
cleanuo: no need to negate we have not-equal

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agochange var name ct to type to prevent confusion with container
Tim Marx [Thu, 21 Nov 2019 10:43:22 +0000 (11:43 +0100)]
change var name ct to type to prevent confusion with container

Signed-off-by: Tim Marx <t.marx@proxmox.com>
4 years agofix #2467: avoid duplicate volumes & tag with correct content type
Tim Marx [Thu, 21 Nov 2019 10:43:20 +0000 (11:43 +0100)]
fix #2467: avoid duplicate volumes & tag with correct content type

The bugfix for #2317 introduced a kind of odd API behavior, where
each volume was returned twice from our API if a storage has both
'rootdir' & 'images' content types enabled. To give the content type
of the volume an actual meaning, it is now inferred from the
associated guest, if there's no guest or we don't have an owner for
that volume we default to 'images'.

At the volume level, there is no option to list volumes based on
content types, since the volumes do not know what type they are
actually used for.

Signed-off-by: Tim Marx <t.marx@proxmox.com>
4 years agofollowup: remove no-op JSONSchema::check_format on mountpoint
Thomas Lamprecht [Thu, 21 Nov 2019 11:41:56 +0000 (12:41 +0100)]
followup: remove no-op JSONSchema::check_format on mountpoint

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agofix #2085: add mountpoint property for non-default ZFS pool MPs
Fabian Ebner [Mon, 18 Nov 2019 10:45:38 +0000 (11:45 +0100)]
fix #2085: add mountpoint property for non-default ZFS pool MPs

When adding a zfspool storage with 'pvesm add' the mount point is now
added automatically to the storage configuration if it can be
determined.  path() does not assume the default mountpoint anymore,
fixing 2085.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
4 years agopvesm list: right align size column
Thomas Lamprecht [Thu, 21 Nov 2019 10:59:43 +0000 (11:59 +0100)]
pvesm list: right align size column

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agoadd content type to pvesm list output
Tim Marx [Wed, 20 Nov 2019 10:35:17 +0000 (11:35 +0100)]
add content type to pvesm list output

Signed-off-by: Tim Marx <t.marx@proxmox.com>
4 years agobump version to 6.0-10
Fabian Grünbichler [Mon, 11 Nov 2019 10:28:18 +0000 (11:28 +0100)]
bump version to 6.0-10

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agod/control: add (build-)depends on libpve-cluster-perl
Fabian Grünbichler [Mon, 11 Nov 2019 10:28:17 +0000 (11:28 +0100)]
d/control: add (build-)depends on libpve-cluster-perl

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
4 years agouse PVE::RRD for RRD data
Fabian Grünbichler [Mon, 11 Nov 2019 10:28:16 +0000 (11:28 +0100)]
use PVE::RRD for RRD data

refactored from PVE::Cluster. same code, same semantics, different file.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
4 years agouse PVE::SSHInfo
Fabian Grünbichler [Mon, 11 Nov 2019 10:28:15 +0000 (11:28 +0100)]
use PVE::SSHInfo

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
4 years agouse PVE::DataCenterConfig
Fabian Grünbichler [Mon, 11 Nov 2019 10:28:14 +0000 (11:28 +0100)]
use PVE::DataCenterConfig

to make sure that the corresponding cfs_read_file works() works.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
4 years agoIntroduce zfs_get_properties helper
Fabian Ebner [Thu, 14 Nov 2019 10:33:48 +0000 (11:33 +0100)]
Introduce zfs_get_properties helper

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
4 years agofollowup: different error messages for no and to many IPs
Thomas Lamprecht [Fri, 8 Nov 2019 11:19:04 +0000 (12:19 +0100)]
followup: different error messages for no and to many IPs

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agouse correct local IP address helper
Fabian Grünbichler [Wed, 6 Nov 2019 12:36:37 +0000 (13:36 +0100)]
use correct local IP address helper

this always uses an explicit CIDR, so we don't need a round-trip via
datacenter.cfg ..

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
4 years agoconvert vmid to int to conform with return type declaration
Tim Marx [Tue, 5 Nov 2019 12:42:18 +0000 (13:42 +0100)]
convert vmid to int to conform with return type declaration

Signed-off-by: Tim Marx <t.marx@proxmox.com>
4 years agowhitespace cleanup
Tim Marx [Tue, 5 Nov 2019 12:42:17 +0000 (13:42 +0100)]
whitespace cleanup

Signed-off-by: Tim Marx <t.marx@proxmox.com>
4 years agocleanup: omit module prefix for call to methods in same module
Thomas Lamprecht [Thu, 31 Oct 2019 06:36:27 +0000 (07:36 +0100)]
cleanup: omit module prefix for call to methods in same module

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agoWhitespace cleanup
Fabian Ebner [Tue, 8 Oct 2019 08:48:05 +0000 (10:48 +0200)]
Whitespace cleanup

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
4 years agoLIO: re-use variables
Daniel Berteaud [Thu, 26 Sep 2019 15:27:02 +0000 (17:27 +0200)]
LIO: re-use variables

Signed-off-by: Daniel Berteaud <daniel@firewall-services.com>
4 years agoLIO: Prefix backstores with the pool name
Daniel Berteaud [Thu, 26 Sep 2019 15:27:01 +0000 (17:27 +0200)]
LIO: Prefix backstores with the pool name

So it won't clash with another backstore in another pool

Signed-off-by: Daniel Berteaud <daniel@firewall-services.com>
4 years agoLIO: Make the target cache works per target and portal
Daniel Berteaud [Thu, 26 Sep 2019 15:27:00 +0000 (17:27 +0200)]
LIO: Make the target cache works per target and portal

When working with several ZFS over iSCSI / LIO storages, we might lookup
between them with less than 15 sec interval.
Previously, the cache of the previous storage was used, which was breaking
disk move for example

Signed-off-by: Daniel Berteaud <daniel@firewall-services.com>
4 years agolio: list_lun: return early if volname cannot be parsed
Thomas Lamprecht [Thu, 26 Sep 2019 13:31:07 +0000 (15:31 +0200)]
lio: list_lun: return early if volname cannot be parsed

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agolio: list_lun: re-use $object variable
Thomas Lamprecht [Thu, 26 Sep 2019 13:30:27 +0000 (15:30 +0200)]
lio: list_lun: re-use $object variable

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agobump version to 6.0-9
Thomas Lamprecht [Mon, 23 Sep 2019 16:20:49 +0000 (18:20 +0200)]
bump version to 6.0-9

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agoParse volname where needed
Daniel Berteaud [Wed, 18 Sep 2019 15:15:46 +0000 (17:15 +0200)]
Parse volname where needed

The common ZFSPlugin was missing volume name parsing
in a few places. This was not a problem for standard
volumes, but broke functionnalities (like resize,
snapshot, rollback) with linked clones as the name of
the zvol must be extracted from the entry in the config
(remove base-X-disk-Y prefix)

Signed-off-by: Daniel Berteaud <daniel@firewall-services.com>
4 years agoEnable unmap support
Daniel Berteaud [Wed, 18 Sep 2019 15:15:45 +0000 (17:15 +0200)]
Enable unmap support

In the default config, emulate_tpu is set to 0, which disables
unmap support. Once enabled, trim can run from guest to reclaim free
space.

Signed-off-by: Daniel Berteaud <daniel@firewall-services.com>
4 years agoDon't remove and recreate lun when changing a volume
Daniel Berteaud [Wed, 18 Sep 2019 15:15:44 +0000 (17:15 +0200)]
Don't remove and recreate lun when changing a volume

It's not needed, LIO sees the new size automatically.
And it was broken anyway. Partially fix #2335

Signed-off-by: Daniel Berteaud <daniel@firewall-services.com>
4 years agofollowup: add JSON use and cleanup
Thomas Lamprecht [Fri, 20 Sep 2019 11:31:54 +0000 (13:31 +0200)]
followup: add JSON use and cleanup

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agochange file_size_info sub to use qemu-img info json decoding
Tim Marx [Fri, 20 Sep 2019 09:12:46 +0000 (11:12 +0200)]
change file_size_info sub to use qemu-img info json decoding

Using the json output, as suggested by Thomas, we now die if the decoding
fails and, if not, all return values are set to the corresponding decoded
values. That should prevent any unforeseen null size values, except if
qemu-img info reports it, which we then consider as valid.

Signed-off-by: Tim Marx <t.marx@proxmox.com>
4 years agoActually use target_volid
Fabian Ebner [Wed, 11 Sep 2019 09:46:19 +0000 (11:46 +0200)]
Actually use target_volid

Migration with --targetstorage was broken because of this.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
4 years agofix vmid filter for backup listing
Dominik Csapak [Fri, 6 Sep 2019 12:12:16 +0000 (14:12 +0200)]
fix vmid filter for backup listing

$1 and $2 get set to undef from the vmid filter regex, so we have to do
the name/format regex after, else we get errors like:

'use of unitiialized value $1[...]'

and the listing is empty

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
4 years agofile_size_info: move parser to own variable
Thomas Lamprecht [Mon, 9 Sep 2019 13:36:14 +0000 (15:36 +0200)]
file_size_info: move parser to own variable

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agowarn if filesize info couldn't be read due to error
Tim Marx [Mon, 9 Sep 2019 10:56:04 +0000 (12:56 +0200)]
warn if filesize info couldn't be read due to error

This sh
Signed-off-by: Tim Marx <t.marx@proxmox.com>
4 years agowhitespace cleanup
Tim Marx [Mon, 9 Sep 2019 10:56:03 +0000 (12:56 +0200)]
whitespace cleanup

Signed-off-by: Tim Marx <t.marx@proxmox.com>
4 years agobump version to 6.0-8
Thomas Lamprecht [Tue, 3 Sep 2019 08:24:29 +0000 (10:24 +0200)]
bump version to 6.0-8

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agoFix #2346: rbd storage shows wrong %-usage
Alwin Antreich [Tue, 3 Sep 2019 08:13:39 +0000 (10:13 +0200)]
Fix #2346: rbd storage shows wrong %-usage

The patch uses the value from the field 'stored' if it is available.

In Ceph 14.2.2 the storage calculation changed to a per pool basis. This
introduced an additional field 'stored' that holds the amount of data
that has been written to the pool. While the field 'used' now has the
data after replication for the pool.

The new calculation will be used only if all OSDs are running with the
on-disk format introduced by Ceph 14.2.2.

Signed-off-by: Alwin Antreich <a.antreich@proxmox.com>
4 years agofollowup: just use case sensitive flag, no manual hack
Thomas Lamprecht [Tue, 3 Sep 2019 07:42:15 +0000 (09:42 +0200)]
followup: just use case sensitive flag, no manual hack

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agofixup: use our to make $iso_extension_re value available for other modules
Thomas Lamprecht [Tue, 3 Sep 2019 07:41:50 +0000 (09:41 +0200)]
fixup: use our to make $iso_extension_re value available for other modules

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agofix #2216: Allow .img files in 'iso' type storages
Stefan Reiter [Thu, 22 Aug 2019 12:39:53 +0000 (14:39 +0200)]
fix #2216: Allow .img files in 'iso' type storages

To maintain full (backwards) compatibility, leave the type name as
'iso' - this makes this patch work without changing every consumer of
storage APIs.

Note that currently these files can only be attached as a CDROM/DVD
drive, so USB-only images can be uploaded but might not work in VMs.

Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
4 years agobump version to 6.0-7
Fabian Grünbichler [Tue, 6 Aug 2019 12:08:02 +0000 (14:08 +0200)]
bump version to 6.0-7

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
4 years agoZFS: refactor waiting for zvol symlinks
Fabian Grünbichler [Wed, 31 Jul 2019 08:58:04 +0000 (10:58 +0200)]
ZFS: refactor waiting for zvol symlinks

and actually do that not just for creating zvols, but also when
activating them. this should fix a range of issues/races that sometimes
occured on bootup, snapshot rollback or similar operations.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
4 years agofix 2317: list images on 'rootdir' only storages
Fabian Grünbichler [Tue, 6 Aug 2019 07:23:19 +0000 (09:23 +0200)]
fix 2317: list images on 'rootdir' only storages

plugins can still override list_volumes if they want separate methods to
list rootdir and images content.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
4 years agobump version to 6.0-6
Thomas Lamprecht [Thu, 25 Jul 2019 11:35:07 +0000 (13:35 +0200)]
bump version to 6.0-6

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agoFix #582: Add DELETE delay logic
Dominic Jäger [Mon, 15 Jul 2019 10:28:20 +0000 (12:28 +0200)]
Fix #582: Add DELETE delay logic

Previously, the web GUI timed out when removing content (e.g. backup) took
too long. Doing the main part of the API DELETE call in a fork_worker solves
this.

Signed-off-by: Dominic Jäger <d.jaeger@proxmox.com>
4 years agostorage plugin: move get_subdir call
Fabian Grünbichler [Fri, 19 Jul 2019 11:53:45 +0000 (13:53 +0200)]
storage plugin: move get_subdir call

since list_volumes is only supposed to be called with filtered content
types, this should ensure that get_subdir is only called for plugins
that have a defined 'path' property, like the old code in
PVE::Storage::template_list did.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
4 years agostorage plugin: new list_volumes plugin method
Dietmar Maurer [Fri, 19 Jul 2019 09:56:16 +0000 (11:56 +0200)]
storage plugin: new list_volumes plugin method

This cleanup improve code reuse, and allows plugins to override list_volumes.

4 years agoDiskmanage: add flag for encrypted osds
Dominik Csapak [Fri, 12 Jul 2019 10:15:15 +0000 (12:15 +0200)]
Diskmanage: add flag for encrypted osds

we can only do this here, since the ceph cluster is not aware of
osd encryption, only the local node is (via ceph-volume and lv tags)

this way, we are able to show an 'encrypted' flag in the disk gui at least

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
4 years agoDiskmanage: fix usage test for sdd
Dominik Csapak [Fri, 12 Jul 2019 10:13:51 +0000 (12:13 +0200)]
Diskmanage: fix usage test for sdd

sdd1 and sdd2 were listed in the zfs output but were not included
in the partlist, so the zfs detection test was wrong

now it is correct and more in line with the real world

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
4 years agoDiskmanage: add test for lsblk by simulating zfs disk
Dominik Csapak [Fri, 12 Jul 2019 10:13:50 +0000 (12:13 +0200)]
Diskmanage: add test for lsblk by simulating zfs disk

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
4 years agoDiskmanage: change parttype uuid detection
Dominik Csapak [Fri, 12 Jul 2019 10:13:49 +0000 (12:13 +0200)]
Diskmanage: change parttype uuid detection

previously ceph included a udev rule to populate
/dev/disk/by-parttypeuuid/

but not anymore, so we now use 'lsblk --json -o path,parttype' to
get a mapping between parttype uuid and partition

fix the test by simulating empty lsblk output

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
4 years agobump version to 6.0-5
Thomas Lamprecht [Thu, 11 Jul 2019 17:37:31 +0000 (19:37 +0200)]
bump version to 6.0-5

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agopvesm import: allow to pass a tcp://<IP> as file
Thomas Lamprecht [Thu, 27 Jun 2019 14:16:09 +0000 (16:16 +0200)]
pvesm import: allow to pass a tcp://<IP> as file

To allow getting closer to finally drop "pvecm mtunnel".
Code parts taken from pipe_socket_to_command

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
[regex fixup]
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
4 years agofix #2266: Diskmanage: get correct osd id
Dominik Csapak [Mon, 8 Jul 2019 13:48:14 +0000 (15:48 +0200)]
fix #2266: Diskmanage: get correct osd id

The osdid can consist of multiple digits, cope with that and add more
regression tests for this

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
4 years agobump version to 6.0-4
Thomas Lamprecht [Thu, 4 Jul 2019 14:00:48 +0000 (16:00 +0200)]
bump version to 6.0-4

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agocephfs: make is_mounted check less strict
Dominik Csapak [Wed, 3 Jul 2019 07:42:13 +0000 (09:42 +0200)]
cephfs: make is_mounted check less strict

checking '$server:$subdir' is too strict to work in all cirumcstances,
e.g. adding/removing a monitor would mean that it is not the same
anymore, same if one is adding/removing the ports from the config

check only if the subdir is the same and if it is a cephfs
this way, it still returns true if someone changes the config

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
4 years agofix missing osd info for osd 0
Dominik Csapak [Wed, 3 Jul 2019 06:43:12 +0000 (08:43 +0200)]
fix missing osd info for osd 0

0 is falsy, we have to check for definedness
also adapt the tests so we test for this

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
4 years agobump version to 6.0-3
Thomas Lamprecht [Thu, 27 Jun 2019 14:18:03 +0000 (16:18 +0200)]
bump version to 6.0-3

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agoCephConfig: read monitor addresses also from mon_host for cephfs
Dominik Csapak [Thu, 27 Jun 2019 08:43:12 +0000 (10:43 +0200)]
CephConfig: read monitor addresses also from mon_host for cephfs

since we write only the mon_host config beginning with nautilus,
we have to get the monitor ips from there as well

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
4 years agoCephConfig: refactor host port parsing
Dominik Csapak [Thu, 27 Jun 2019 08:43:11 +0000 (10:43 +0200)]
CephConfig: refactor host port parsing

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
4 years agoCephConfig: do not always interpret '; ' as a comment
Dominik Csapak [Thu, 27 Jun 2019 08:43:10 +0000 (10:43 +0200)]
CephConfig: do not always interpret '; ' as a comment

; is the beginning of a comment, but in some configuration settings
it is also valid syntax, e.g. for mon_host it is a valid
seperator for hosts (sigh ...)

only remove lines when it starts with a ';'

since we remove all comments anyway any time we write the ceph conf
it should not really matter for our users

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
4 years agobump version to 6.0-2
Thomas Lamprecht [Mon, 24 Jun 2019 16:48:27 +0000 (18:48 +0200)]
bump version to 6.0-2

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agofollowup: comment reword
Thomas Lamprecht [Wed, 19 Jun 2019 08:23:01 +0000 (10:23 +0200)]
followup: comment reword

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agoCephConfig: map special config key characters to _
Dominik Csapak [Wed, 19 Jun 2019 07:17:52 +0000 (09:17 +0200)]
CephConfig: map special config key characters to _

we want a consistent config has, regardless of how the user or a tool
adds it to the config, so we map ' ' and '-' to '_' in the keys

this way we can always access the correct key without trying multiple
times

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
4 years agopartially revert follow up
Thomas Lamprecht [Mon, 17 Jun 2019 10:35:51 +0000 (12:35 +0200)]
partially revert follow up

see
https://pve.proxmox.com/pipermail/pve-devel/2019-June/037575.html

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agofollowup: free_image: just check if a file in general exist
Thomas Lamprecht [Mon, 17 Jun 2019 09:51:27 +0000 (11:51 +0200)]
followup: free_image: just check if a file in general exist

don't require any specific file types, if something is here which can
be requested to delete over API/CLI it either comes from an API/CLI
operation and should be thus OK to delete, else a user caused the
creation of the special file and it either works and all is good or
the user gets notified as we check if unlink succeeded anyway

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agofix #2226: allow broken symlinks to be deleted via API
Stefan Reiter [Mon, 17 Jun 2019 09:05:32 +0000 (11:05 +0200)]
fix #2226: allow broken symlinks to be deleted via API

Symlinks with a non-existing target fail Perls '-f' test and were thus
not deleteable via the API (failing with '$path does not exist').

Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
4 years agofix #2226: ignore broken symlinks in *_list
Stefan Reiter [Mon, 17 Jun 2019 09:05:31 +0000 (11:05 +0200)]
fix #2226: ignore broken symlinks in *_list

Broken symlinks (and other files without a size) will now show up as 0
byte instead of causing a format validation error in the API.

Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
4 years agobump version to 6.0-1
Thomas Lamprecht [Fri, 14 Jun 2019 18:44:46 +0000 (20:44 +0200)]
bump version to 6.0-1

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agocephfs: Exclude _netdev when mounting with fuse
Alwin Antreich [Wed, 12 Jun 2019 10:32:05 +0000 (12:32 +0200)]
cephfs: Exclude _netdev when mounting with fuse

Since ceph-fuse is called directly in the CephFS storage plugin, which
can not process the _netdev option, mounting the CephFS storage fails
when fuse is set in the storage.cfg.

This patch moves the _netdev option into the else part of the if fuse is
set statement. _netdev is only added if the CephFS kernel client mounts
the storage.

It seems _netdev is not needed anyway for the fuse mount, as the
connection is closed, once the fuse process gets killed on shutdown.

Signed-off-by: Alwin Antreich <a.antreich@proxmox.com>
4 years agofollowup: reword comment a bit
Thomas Lamprecht [Thu, 13 Jun 2019 09:59:58 +0000 (11:59 +0200)]
followup: reword comment a bit

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agofix #1427: Set file mode on uploaded templates/ISOs
Stefan Reiter [Thu, 13 Jun 2019 09:33:28 +0000 (11:33 +0200)]
fix #1427: Set file mode on uploaded templates/ISOs

simply chmod the temp file before copying to the "correct" permission
mode, where all users with access to the directory can read the file,
to mirror the behavior one gets for a apl_download call.

Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
4 years agodrop un-maintained sheepdog plugin
Thomas Lamprecht [Tue, 4 Jun 2019 14:57:40 +0000 (16:57 +0200)]
drop un-maintained sheepdog plugin

as already announced over two months ago[0], remove the unofficial
SheepDog plugin now completely. Besides that it was never fully
supported in Proxmox VE one of its main developer and ex-maintainer
declared it as abandoned[1], and thus just let's remove it, git
allows to resurrect it any time if a wonder happens anyway.

[0]: https://pve.proxmox.com/pipermail/pve-user/2019-March/170497.html
[1]: http://lists.wpkg.org/pipermail/sheepdog/2019-March/068449.html

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agobuildsys: split storage plugins to single lines
Thomas Lamprecht [Tue, 4 Jun 2019 14:56:46 +0000 (16:56 +0200)]
buildsys: split storage plugins to single lines

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agoDiskmanage: correctly add wearout value of 0
Dominik Csapak [Tue, 4 Jun 2019 11:05:29 +0000 (13:05 +0200)]
Diskmanage: correctly add wearout value of 0

if wearout is 0 we showed 'N/A' instead of 100%
(wearout is really the 'life left' value)

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
4 years agoDiskmanage: fix incorrect variable usage
Dominik Csapak [Tue, 4 Jun 2019 11:05:28 +0000 (13:05 +0200)]
Diskmanage: fix incorrect variable usage

sysdir is a string, we wanted sysdata

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
4 years agoDiskmanage: extract nvme wearout from smartctl text
Dominik Csapak [Tue, 4 Jun 2019 11:05:27 +0000 (13:05 +0200)]
Diskmanage: extract nvme wearout from smartctl text

extract the info from the line:
Percentage Used: XX%

also adapt the tests

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
4 years agotests: test get_disks single/multi disk filter
Dominik Csapak [Tue, 4 Jun 2019 10:35:24 +0000 (12:35 +0200)]
tests: test get_disks single/multi disk filter

this executes all tests again with each disk as a single parameter
and all disks again as an array ref

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
4 years agoDiskmanage: add append_partition sub
Dominik Csapak [Tue, 4 Jun 2019 10:35:23 +0000 (12:35 +0200)]
Diskmanage: add append_partition sub

we will use this for adding a partition to a disk when using a device
for ceph osd db/wal which already has partitions on it

first we search for the highest partition number, then add the partition
and search for the resulting device (we cannot assume to simply
append the number, e.g. from /dev/nvme0n1 we get /dev/nvme0n1pX)

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
4 years agoDiskmanage: allow get_disks to take multiple disks
Dominik Csapak [Tue, 4 Jun 2019 10:35:22 +0000 (12:35 +0200)]
Diskmanage: allow get_disks to take multiple disks

we now expect the first parameter to be either a string with a single
disk, or an array ref with a list of disks

this way we can get the info of multiple disks simultaneously while
not iterating over all disks

this will be used to get the info for osd/db/wal disk

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
4 years agoDisks API: allow also unused disks for db/wal
Dominik Csapak [Tue, 4 Jun 2019 10:35:21 +0000 (12:35 +0200)]
Disks API: allow also unused disks for db/wal

since we will create a pv/vg/lv on it with nautilus

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
4 years agotests: improve error handling of run_disk_tests
Dominik Csapak [Tue, 4 Jun 2019 07:21:17 +0000 (09:21 +0200)]
tests: improve error handling of run_disk_tests

if Diskmanage.pm has a syntax error, this will now catch it
during build

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
4 years agoLVMPlugin: factor out the lv creation
Dominik Csapak [Tue, 4 Jun 2019 07:21:16 +0000 (09:21 +0200)]
LVMPlugin: factor out the lv creation

we will want to create lvs manually for ceph nautilus db/wal devices

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