]> git.proxmox.com Git - pve-storage.git/log
pve-storage.git
5 years agofollowup: improve comment
Thomas Lamprecht [Tue, 5 Feb 2019 16:19:35 +0000 (17:19 +0100)]
followup: improve comment

while the commit message tells it nicely a comment should add
additional info for people just giving this a quick look

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
5 years agocheck_volume_access: tighten checks for iso/tmpl
Fabian Grünbichler [Tue, 5 Feb 2019 15:01:40 +0000 (16:01 +0100)]
check_volume_access: tighten checks for iso/tmpl

(custom) templates might contain sensitive data, so require at least
read access on the underlying storage to access ISO and template files.

the same permissions are already needed for listing them, so this is
unlikely to cause fallout.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
5 years agod/control: bump version dependency of libpve-common-perl
Thomas Lamprecht [Mon, 4 Feb 2019 11:02:21 +0000 (12:02 +0100)]
d/control: bump version dependency of libpve-common-perl

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
5 years agodiskmanage: fix device encoding handling
Wolfgang Bumiller [Mon, 4 Feb 2019 09:42:01 +0000 (10:42 +0100)]
diskmanage: fix device encoding handling

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
5 years agobump version 5.0-37
Thomas Lamprecht [Fri, 1 Feb 2019 11:39:32 +0000 (12:39 +0100)]
bump version 5.0-37

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
5 years agoallow snippets by default for new dir storages
Dominik Csapak [Tue, 29 Jan 2019 15:28:40 +0000 (16:28 +0100)]
allow snippets by default for new dir storages

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
5 years agoenable snippets content type for all directory based storages
Dominik Csapak [Tue, 29 Jan 2019 15:28:39 +0000 (16:28 +0100)]
enable snippets content type for all directory based storages

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
5 years agoadd new content type 'snippets'
Dominik Csapak [Tue, 29 Jan 2019 15:28:38 +0000 (16:28 +0100)]
add new content type 'snippets'

will be used to contain files which can be executed as hookscripts or
contain custom cloud-init configs

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
5 years agofix #1598: use glusterfs daemon default port for online check
Thomas Lamprecht [Mon, 28 Jan 2019 13:37:05 +0000 (14:37 +0100)]
fix #1598: use glusterfs daemon default port for online check

use the port where the main glusterfs daemon listens on as ping port,
this one is also used by QEMU as default.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
5 years agoFix #1941: remove empty directories when freeing image on FS based storages
Christian Ebner [Thu, 24 Jan 2019 13:58:22 +0000 (14:58 +0100)]
Fix #1941: remove empty directories when freeing image on FS based storages

Remove directories if they are empty, which can happen if all images
from a VM got deleted, e.g., after destroying said VM.

Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
5 years agoFix #2050: only provide 'conv=sparse' for LvmThin
Stoiko Ivanov [Thu, 17 Jan 2019 15:31:51 +0000 (16:31 +0100)]
Fix #2050: only provide 'conv=sparse' for LvmThin

LVMPlugin->volume_import (used by storage_migrate on either offline
migration with local disks, or online migration with storage-only
referenced disks) passed 'conv=sparse' to `dd`. This can lead to
data-corruption, if the target volume is not zero-initialized.

dropping the sparse argument completely would fix the problem, but
breaks keeping data sparse for LvmThinPlugin.

This patch moves the dd out into (LVM*) plugin specific sub so that
each can control the parameters.

Steps for reproducing the issue:
* create a cluster with (at least) 2 nodes A and B, with a free
  disk-device (/dev/sdx)
* write a recognizable pattern to /dev/sdx on B:
  `dd if=/dev/zero bs=10M | tr '\000' '\255' | dd of=/dev/sdb bs=10M`
  (would be grateful for alternatives to the dd| tr| dd)
* on both A and B create a lvm-vg (pvcreate, vgcreate)
* add it as _not_ shared storage, which is available on nodes A and B
* create a small guest on A
* fill a file in the guest with zeros
  `dd if=/dev/zero of=/zerofil bs=10M`
* stop the guest, migrate it to B
* start the guest - check that the file `/zerofil` contains `ad`
  instead of `00`

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
5 years agoupdate version to 5.0-36
Thomas Lamprecht [Tue, 15 Jan 2019 12:18:28 +0000 (13:18 +0100)]
update version to 5.0-36

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
5 years agoLVM: Add '--refresh' when activating volumes
Stoiko Ivanov [Fri, 4 Jan 2019 13:06:25 +0000 (14:06 +0100)]
LVM: Add '--refresh' when activating volumes

From `man 8 lvchange`:
  --refresh
      If the logical volume is active, reload its metadata. This is not
      necessary in normal operation, but may be useful ... if you're doing
      clustering manually without a clustered lock manager.

Fixes migration in a shared LVM (iscsi) setup, where a disk gets resized on one
node A and the guest is afterwards migrated to another node B: B still presents
the old size to the guest, leading to data corruption.

It is necessary to run `lvchange` twice because the options `-ay` and
`--refresh` are mutually exclusive.

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
5 years agofix #2046 add volume_size_info to LVMPlugin
Stoiko Ivanov [Fri, 4 Jan 2019 13:06:24 +0000 (14:06 +0100)]
fix #2046 add volume_size_info to LVMPlugin

Without volume_size_info a Storage plugin falls back to the Implementation
in PVE/Storage/Plugin.pm, which relies on `qemu-img info`.

`qemu-img info` returns wrong results on a node in the case of shared volume
groups (e.g. when sharing disks via iSCSI), if a disk was resized on another
node (it lseeks to the end of the block-device, and this yields the old size).

Using lvs directly fixes the issue, since the LVM metadata gets updated when
invoking lvs.

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
5 years agoget_monaddr_list: also ensure that returned 'mon addr' are defined
Thomas Lamprecht [Wed, 9 Jan 2019 14:23:39 +0000 (15:23 +0100)]
get_monaddr_list: also ensure that returned 'mon addr' are defined

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
5 years agoceph: get_monaddr_list: exclude general monitor section
Alwin Antreich [Wed, 9 Jan 2019 10:59:12 +0000 (11:59 +0100)]
ceph: get_monaddr_list: exclude general monitor section

Else, if a general MON section existed in the ceph.conf, we added a
undefined entry and a cephfs storage can't be mounted anymore.

Signed-off-by: Alwin Antreich <a.antreich@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
5 years agofix use of uninitialized value in parse_ceph_config
David Limbeck [Thu, 3 Jan 2019 08:44:59 +0000 (09:44 +0100)]
fix use of uninitialized value in parse_ceph_config

Signed-off-by: David Limbeck <d.limbeck@proxmox.com>
5 years agobump version to 5.0-35
Thomas Lamprecht [Thu, 20 Dec 2018 09:50:45 +0000 (10:50 +0100)]
bump version to 5.0-35

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
5 years agod/control: bump pve-cluster version dependency to 5.0-32
Thomas Lamprecht [Thu, 20 Dec 2018 09:49:06 +0000 (10:49 +0100)]
d/control: bump pve-cluster version dependency to 5.0-32

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
5 years agoregister ceph.conf parser/writer
Dominik Csapak [Wed, 19 Dec 2018 10:24:40 +0000 (11:24 +0100)]
register ceph.conf parser/writer

With this we can use cfs_read_file/cfs_write_file and cfs_lock_file.

Code for writing is mostly copied from pve-managers CephTools.pm,
with the addition of mgr sections.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
5 years agomove Storage/CephTools to CephConfig
Dominik Csapak [Wed, 19 Dec 2018 10:24:39 +0000 (11:24 +0100)]
move Storage/CephTools to CephConfig

it is not a storage plugin, and it makes more sense to have it
top-level, but there we cannot name it CephTools because of the
existing ones in pve-manager

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
5 years agobump version to 5.0-34
Thomas Lamprecht [Fri, 14 Dec 2018 11:22:22 +0000 (12:22 +0100)]
bump version to 5.0-34

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
5 years agoFix #2020: use /sys to map nvmeXnY to nvmeX
Wolfgang Bumiller [Mon, 10 Dec 2018 13:17:06 +0000 (14:17 +0100)]
Fix #2020: use /sys to map nvmeXnY to nvmeX

`nvmeX` devices nodes are apparently allocated independently
from their namespace block devices `nvmeXnY` and therefore
they are not strictly related by name. For instance:
  $ readlink /sys/block/nvme0n1/device
  ../../nvme1
  $ readlink /sys/block/nvme1n1/device
  ../../nvme0

Here /dev/nvme0n1 is the first namespace of /dev/nvme1 while
/dev/nvme1n1 is the first namespace of /dev/nvme0.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
5 years agoFix #2019: CephFS storage misses maxfiles
Alwin Antreich [Fri, 7 Dec 2018 08:02:58 +0000 (09:02 +0100)]
Fix #2019: CephFS storage misses maxfiles

Signed-off-by: Alwin Antreich <a.antreich@proxmox.com>
5 years agobump version to 5.0-33
Thomas Lamprecht [Tue, 27 Nov 2018 12:23:48 +0000 (13:23 +0100)]
bump version to 5.0-33

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
5 years agocephfs: tell systemd that mount mount requires network
Thomas Lamprecht [Tue, 27 Nov 2018 11:02:01 +0000 (12:02 +0100)]
cephfs: tell systemd that mount mount requires network

As we mount this manually and thus systemd doesn't know about any
dependency for cephFS mounts, this got umounted only at the last
stage of shutdown, where network wasn't active anymore.

But, CephFS needs to be connected to an active MDS for a clean
unmount so without network this mount would delay shutdown for quite
a bit, until after some minutes systemd gave up and forced unmount.

So tell systemd that this mount requires network, which can be done
with the '_netdev'[0] mount option, that lucky for us can be also
passed to a mount call and isn't only available for fstab.

with this a mount gets, among others:
> Wants=network-online.target
> Before=umount.target remote-fs.target
> After=remote-fs-pre.target system.slice network.target network-online.target -.mount

Which does the trick for us.

[0]: https://www.freedesktop.org/software/systemd/man/systemd.mount.html#_netdev

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
5 years agopvesm: add scan subcommands
Thomas Lamprecht [Mon, 19 Nov 2018 15:23:25 +0000 (16:23 +0100)]
pvesm: add scan subcommands

Change to a cleaner sub command interface grouping all scan commands.

Alias to old command names for backward compatibility
Best viewed with the ignore whitespace/indent change '-w' flag from
git

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
5 years agobump version to 5.0-32
Thomas Lamprecht [Mon, 19 Nov 2018 14:19:56 +0000 (15:19 +0100)]
bump version to 5.0-32

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
5 years agod/control: bump pve-common dependency and break older pve-manager
Thomas Lamprecht [Mon, 19 Nov 2018 13:44:46 +0000 (14:44 +0100)]
d/control: bump pve-common dependency and break older pve-manager

To ensure that we have the new SysFSTools available and as previously
we hosted the API scan endoints which pve-manager registered so
record the break of older versions.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
5 years agoremove usb scan code
Dominik Csapak [Fri, 16 Nov 2018 15:17:59 +0000 (16:17 +0100)]
remove usb scan code

this is now in PVE::SysFSTools

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
5 years agoremove PVE/API2/Storage/Scan.pm
Dominik Csapak [Fri, 16 Nov 2018 15:17:58 +0000 (16:17 +0100)]
remove PVE/API2/Storage/Scan.pm

since those are now defined in pve-manager

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
5 years agomove Scan API calls from PVE/API2/Storage/Scan.pm to pvesm.pm
Dominik Csapak [Fri, 16 Nov 2018 15:17:57 +0000 (16:17 +0100)]
move Scan API calls from PVE/API2/Storage/Scan.pm to pvesm.pm

since the calls for the real API are defined now in pve-managers Scan.pm

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
5 years agoAPIAGE followup: fix typo and print versions in error message
Thomas Lamprecht [Mon, 19 Nov 2018 11:18:03 +0000 (12:18 +0100)]
APIAGE followup: fix typo and print versions in error message

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
5 years agoplugin loader: add an APIAGE
Wolfgang Bumiller [Fri, 16 Nov 2018 12:54:44 +0000 (13:54 +0100)]
plugin loader: add an APIAGE

With the addition of the map/unmap_volume() methods we made
an (actually unnecessary) API version bump.
All current users of these methods fall back to path() when
they return undef, so plugins implementing version 1 are
in fact compatible currently. (In fact, the default
Plugin::map_volume() could fall back to it on its own, but
doesn't currently).

For now let's just allow plugins older plugins to also be
loaded by introducing an API age variable. With it, if we
have a reason to break older plugins, we can have a
deprecation period during which older plugins cause a
warning instead of refusing to load altogether.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
5 years agoLVM: lock on volume_resize
Thomas Lamprecht [Wed, 14 Nov 2018 13:43:29 +0000 (14:43 +0100)]
LVM: lock on volume_resize

This is important for shared LVM storages. As with deletes and
creates of images, as else we may have not the up-to-date metadata
and extents may get reused if another node created an image during
the same time, for example.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
5 years agofix #862: do not resolve portal adress on storage add
Thomas Lamprecht [Wed, 14 Nov 2018 17:11:02 +0000 (18:11 +0100)]
fix #862: do not resolve portal adress on storage add

as described in #862:

> I experienced a problem with ISCSI portal when using a hostname and
> not IP.
> The GUI resolves the hostname to an IP and writes it to storage.cfg.
> As my setup requires hostnames, i needed to change the config
> manually back to the hostname which is working fine.
>
> Why is this conversion done? If I enter a hostname, i want to have a
> hostname. If i enter an IP address i want to have an IP address.

This makes sense to me, a feature of using domains is that they
are/should be resolved when actually using (i.e., connecting to them)
so resolving it once on add does not seems like a good idea (if I do
not miss something - as this is a classic "imported from SVN" I do
not have any rationale to look at).

So save the work and pass it as is.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
5 years agobump version to 5.0-31
Thomas Lamprecht [Fri, 9 Nov 2018 14:30:24 +0000 (15:30 +0100)]
bump version to 5.0-31

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
5 years agoimplement map_volume and unmap_volume
Dietmar Maurer [Thu, 8 Nov 2018 13:05:17 +0000 (14:05 +0100)]
implement map_volume and unmap_volume

This allows to request a mapped device/path explicitly, regardles of
the storage option, eg. krbd option in the RBDplugin.

Bump of the storage ABI => 2

Co-authored-by: Alwin Antreich <a.antreich@proxmox.com>
Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
5 years agofolowup: fix whitespace errors and s/and/&&/ for consistency
Thomas Lamprecht [Fri, 9 Nov 2018 14:27:06 +0000 (15:27 +0100)]
folowup: fix whitespace errors and s/and/&&/ for consistency

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
5 years agostorage zfs: removed unused variable
Tim Marx [Tue, 6 Nov 2018 13:04:34 +0000 (14:04 +0100)]
storage zfs: removed unused variable

Signed-off-by: Tim Marx <t.marx@proxmox.com>
5 years agostorage zfs: changed return value description & optionals
Tim Marx [Tue, 6 Nov 2018 13:04:33 +0000 (14:04 +0100)]
storage zfs: changed return value description & optionals

Signed-off-by: Tim Marx <t.marx@proxmox.com>
5 years agoclose #1949: storage zfs: changed zpool command parser
Tim Marx [Tue, 6 Nov 2018 13:04:32 +0000 (14:04 +0100)]
close #1949: storage zfs: changed zpool command parser

Signed-off-by: Tim Marx <t.marx@proxmox.com>
5 years agoFix: api zfs: changed return value name to errors
Tim Marx [Thu, 25 Oct 2018 10:51:08 +0000 (12:51 +0200)]
Fix: api zfs: changed return value name to errors

Signed-off-by: Tim Marx <t.marx@proxmox.com>
5 years agod/control: record pve-cluster build dependency
Thomas Lamprecht [Thu, 18 Oct 2018 11:25:34 +0000 (13:25 +0200)]
d/control: record pve-cluster build dependency

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
5 years agobump version to 5.0-30
Thomas Lamprecht [Wed, 3 Oct 2018 15:02:43 +0000 (17:02 +0200)]
bump version to 5.0-30

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
5 years agoremove outdated unused API2::Storage::Replication module
Thomas Lamprecht [Wed, 3 Oct 2018 14:58:55 +0000 (16:58 +0200)]
remove outdated unused API2::Storage::Replication module

this was not installed, had references to non-existing modules
(e.g., PVE::ReplicationTools) and the things it probably was intended
for are done in pve-manager, which has full access to all pve perl
libs and API methods (from a dependency POV)

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
5 years agodiskmanage: rename check_unused to assert_disk_unused
Thomas Lamprecht [Wed, 3 Oct 2018 12:51:35 +0000 (14:51 +0200)]
diskmanage: rename check_unused to assert_disk_unused

to have a clear method name for this. check_XYZ suggests also that we
return true if the check was OK, but we don't.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
5 years agorename check_available to assert_sid_unused
Thomas Lamprecht [Wed, 3 Oct 2018 12:49:14 +0000 (14:49 +0200)]
rename check_available to assert_sid_unused

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
5 years agofix #1929: only check storage if user want to create one
Dominik Csapak [Tue, 25 Sep 2018 08:38:02 +0000 (10:38 +0200)]
fix #1929: only check storage if user want to create one

this is useful if a user wants to create similar storage on each host

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
5 years agoadd missing storage check in LVM Disk API
Dominik Csapak [Tue, 25 Sep 2018 08:38:01 +0000 (10:38 +0200)]
add missing storage check in LVM Disk API

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
5 years agorefactor disk/storage checks for Disk API
Dominik Csapak [Tue, 25 Sep 2018 08:38:00 +0000 (10:38 +0200)]
refactor disk/storage checks for Disk API

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
5 years agopvesm iscsiscan: fix cli parameters
Dietmar Maurer [Mon, 1 Oct 2018 08:53:31 +0000 (10:53 +0200)]
pvesm iscsiscan: fix cli parameters

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
5 years agobump version to 5.0-29
Thomas Lamprecht [Wed, 19 Sep 2018 09:20:52 +0000 (11:20 +0200)]
bump version to 5.0-29

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
5 years agofind_free_diskname: fixup regex match operator
Thomas Lamprecht [Wed, 19 Sep 2018 09:04:33 +0000 (11:04 +0200)]
find_free_diskname: fixup regex match operator

Co-developed-by: Stoiko Ivanov <s.ivanov@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
5 years agoFix #1925: untaint rbd JSON output
Dietmar Maurer [Wed, 19 Sep 2018 04:43:12 +0000 (06:43 +0200)]
Fix #1925: untaint rbd JSON output

Reviewed-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Tested-by: Stoiko Ivanov <s.ivanov@proxmox.com>
Reviewed-by: Stoiko Ivanov <s.ivanov@proxmox.com>
Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
5 years agobump version to 5.0-28
Thomas Lamprecht [Fri, 14 Sep 2018 09:42:23 +0000 (11:42 +0200)]
bump version to 5.0-28

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
5 years agofix #1912: find the partition instead of guessing it
Dominik Csapak [Fri, 14 Sep 2018 09:13:35 +0000 (11:13 +0200)]
fix #1912: find the partition instead of guessing it

instead of using '$dev1' as partition,
get the information from /sys/block/$dev

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
5 years agoget_vm_disk_number: follow up cleanup
Thomas Lamprecht [Fri, 14 Sep 2018 07:17:06 +0000 (09:17 +0200)]
get_vm_disk_number: follow up cleanup

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
5 years agoFix #1913: get_vm_disk_number: clone plugindata to avoid side effects
Stoiko Ivanov [Thu, 13 Sep 2018 18:36:40 +0000 (20:36 +0200)]
Fix #1913: get_vm_disk_number: clone plugindata to avoid side effects

Accessing a non-existing 'format' key in plugindata (e.g., in LvmThinPlugin),
created it by autovivication, thus breaking the fallback to the default value
'raw' upon any following access.

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
5 years agobump version to 5.0-27
Thomas Lamprecht [Wed, 12 Sep 2018 13:00:31 +0000 (15:00 +0200)]
bump version to 5.0-27

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
5 years agorbd: krbd_feature_disable was not disabling features
Alwin Antreich [Wed, 12 Sep 2018 12:49:28 +0000 (14:49 +0200)]
rbd: krbd_feature_disable was not disabling features

$features is actually an array reference, so use it as one.
This broke creation and migration of disks on rbd storages

Signed-off-by: Alwin Antreich <a.antreich@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
5 years agorefactor is_valid_vm_diskname to private simpler sub
Thomas Lamprecht [Mon, 10 Sep 2018 08:11:22 +0000 (10:11 +0200)]
refactor is_valid_vm_diskname to private simpler sub

This was newly introduced and is only used once, so having a
wantarray return mechanism, without ever using it or knowing for sure
if this may help with reuse of the method is not ideal.

Make the sub a module private one just returning the vm disk number
or explicit undef. Pass it the $suffix variable, to avoid recomputing
it every time called by out caller's loop.

If there's re-use potential in the future we can actually decide what
makes sense to return.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
5 years agorefactor finding next diskname for all plugins
Stoiko Ivanov [Fri, 7 Sep 2018 13:08:42 +0000 (15:08 +0200)]
refactor finding next diskname for all plugins

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
5 years agonext diskname: start ids with 0 to honor MAX_VOLUMES_PER_GUEST
Thomas Lamprecht [Mon, 10 Sep 2018 08:07:44 +0000 (10:07 +0200)]
next diskname: start ids with 0 to honor MAX_VOLUMES_PER_GUEST

else we can only have MAX_VOLUMES_PER_GUEST-1 disk per VMID,
not tragic but possible confusing

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
5 years agomake max number of disks a constant
Stoiko Ivanov [Fri, 7 Sep 2018 13:08:41 +0000 (15:08 +0200)]
make max number of disks a constant

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
5 years agoadd vm_diskname helpers (get_next, is_valid)
Stoiko Ivanov [Fri, 7 Sep 2018 13:08:40 +0000 (15:08 +0200)]
add vm_diskname helpers (get_next, is_valid)

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
5 years agobump version to 5.0-26
Thomas Lamprecht [Fri, 7 Sep 2018 12:12:31 +0000 (14:12 +0200)]
bump version to 5.0-26

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
5 years agoAddition to fix #1895, skip image if no owner
Alwin Antreich [Fri, 7 Sep 2018 08:52:23 +0000 (10:52 +0200)]
Addition to fix #1895, skip image if no owner

Non conforming image names are not ignored anymore by the new rbd_ls
implementation, this patch adds the old behaviour.

This fix is a temporary workaround and should be removed, once the new
image name parser is ready.

Signed-off-by: Alwin Antreich <a.antreich@proxmox.com>
5 years agordb: followup cleanups
Thomas Lamprecht [Thu, 6 Sep 2018 13:19:16 +0000 (15:19 +0200)]
rdb: followup cleanups

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
5 years agorbd: remove unused size conversion function
Dominik Csapak [Thu, 6 Sep 2018 09:35:43 +0000 (11:35 +0200)]
rbd: remove unused size conversion function

since the json output gives the sizes in bytes, we do not
need to convert anymore

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
5 years agofix #1895: use json for 'rbd ls -l' and 'rbd info'
Dominik Csapak [Thu, 6 Sep 2018 09:35:42 +0000 (11:35 +0200)]
fix #1895: use json for 'rbd ls -l' and 'rbd info'

since ceph changed the plain output format for 12.2.8
we have to change the code anyway, and when were at it,
we can change it to the (hopefully) more robust json output

Co-authored-by: Alwin Antreich <a.antreich@proxmox.com>
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
5 years agotest: zfspoolplugin: fix perl lib path for test
Thomas Lamprecht [Tue, 28 Aug 2018 14:40:31 +0000 (16:40 +0200)]
test: zfspoolplugin: fix perl lib path for test

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
5 years agobump version to 5.0-25
Thomas Lamprecht [Mon, 20 Aug 2018 13:15:55 +0000 (15:15 +0200)]
bump version to 5.0-25

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
5 years agoadd missing parameter descriptions
Dietmar Maurer [Thu, 9 Aug 2018 07:52:44 +0000 (09:52 +0200)]
add missing parameter descriptions

5 years agocleanup return property descriptions
Dietmar Maurer [Thu, 9 Aug 2018 07:29:10 +0000 (09:29 +0200)]
cleanup return property descriptions

5 years agoPVE::API2::Storage::Content::index - document return values
Dietmar Maurer [Thu, 9 Aug 2018 06:53:24 +0000 (08:53 +0200)]
PVE::API2::Storage::Content::index - document return values

5 years agoadd return description for zfs detail api call
Dominik Csapak [Wed, 8 Aug 2018 08:20:09 +0000 (10:20 +0200)]
add return description for zfs detail api call

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
5 years agorefactor diskmanagement lock_file calls
Dominik Csapak [Wed, 8 Aug 2018 08:20:08 +0000 (10:20 +0200)]
refactor diskmanagement lock_file calls

so that we only have one place where we reference the lockfile
and the timeout

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
5 years agoadd 'single' raidlevel for zfs
Dominik Csapak [Wed, 8 Aug 2018 08:20:07 +0000 (10:20 +0200)]
add 'single' raidlevel for zfs

the syntax for creating a pool with a single disk is
not the same as for mirror, so let the user select it
explicitely

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
5 years agorename raidlvl to raidlevel
Dominik Csapak [Wed, 8 Aug 2018 08:20:06 +0000 (10:20 +0200)]
rename raidlvl to raidlevel

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
5 years agofix descriptions of api calls
Dominik Csapak [Wed, 8 Aug 2018 08:20:05 +0000 (10:20 +0200)]
fix descriptions of api calls

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
5 years agocleanup descriptions
Dietmar Maurer [Wed, 8 Aug 2018 06:22:27 +0000 (08:22 +0200)]
cleanup descriptions

5 years agofix schema - 'string-list' is a format, not a type
Dietmar Maurer [Wed, 8 Aug 2018 06:21:06 +0000 (08:21 +0200)]
fix schema - 'string-list' is a format, not a type

5 years agoadd API for ZFS management
Dominik Csapak [Tue, 7 Aug 2018 14:51:09 +0000 (16:51 +0200)]
add API for ZFS management

a list, a detail and a create api call

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
5 years agorename lvmcreate to lvmthincreate for lvm thin
Dominik Csapak [Tue, 7 Aug 2018 14:51:08 +0000 (16:51 +0200)]
rename lvmcreate to lvmthincreate for lvm thin

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
5 years agoPVE::API2::Storage::Status::index - document return schema properties
Dietmar Maurer [Tue, 7 Aug 2018 11:08:05 +0000 (13:08 +0200)]
PVE::API2::Storage::Status::index - document return schema properties

And add property "used_fraction" - I want to use that for the CLI tool.

5 years agoFix #1858: lvm_find_free_diskname check for base
Stoiko Ivanov [Mon, 6 Aug 2018 14:01:15 +0000 (16:01 +0200)]
Fix #1858: lvm_find_free_diskname check for base

lvm_find_free_diskname only checked for existing volumes starting with 'vm-',
and not with 'base-'.

Unify implementation with other Plugins.

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
5 years agoLIO: followup: various small cleanups
Thomas Lamprecht [Thu, 2 Aug 2018 12:43:27 +0000 (14:43 +0200)]
LIO: followup: various small cleanups

move two loop bodies from

if (condition) {
    ...
}

too
next if !condition;

...

to save an indentation level

rename variables to a bit shorter version, i.e.:
s/oneTarget/target/
s/oneTpg/tpg/

and a comment rewording

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
5 years agoLIO: followup: shorter stderr/out logging
Thomas Lamprecht [Thu, 2 Aug 2018 12:41:37 +0000 (14:41 +0200)]
LIO: followup: shorter stderr/out logging

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
5 years agoLIO: followup: fix indentation
Thomas Lamprecht [Thu, 2 Aug 2018 12:39:55 +0000 (14:39 +0200)]
LIO: followup: fix indentation

5 years agoLIO: followup: remove trailing whitespaces
Thomas Lamprecht [Thu, 2 Aug 2018 07:37:00 +0000 (09:37 +0200)]
LIO: followup: remove trailing whitespaces

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
5 years agoLinux LIO/targetcli support
Udo Rader [Thu, 26 Jul 2018 21:26:27 +0000 (23:26 +0200)]
Linux LIO/targetcli support

Introducing LIO/targetcli support allowing to use recent linux
distributions as iSCSI targets for ZFS volumes.

In order for this to work, two preconditions have to be met:

1. the portal has to be set up correctly using targetcli
2. the initiator has to be authorized to connect to the target
   based on the initiator's InitiatorName

When adding a LIO iSCSI target, a new "LIO target portal group" field needs
to be correctly populated in the "Add: ZFS over iSCSI" popup, containing the
fitting "LIO target portal group" name (typically something like 'tpg1').

Signed-Off-By: Udo Rader <udo.rader@bestsolution.at>
Tested-by: Stoiko Ivanov <s.ivanov@proxmox.com>
5 years agoadd missing dependency to pve-cluster
Dietmar Maurer [Thu, 2 Aug 2018 11:28:04 +0000 (13:28 +0200)]
add missing dependency to pve-cluster

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
5 years agofix typo
Dietmar Maurer [Thu, 2 Aug 2018 10:44:30 +0000 (12:44 +0200)]
fix typo

5 years agoadd API for add Directory storage
Dominik Csapak [Mon, 30 Jul 2018 08:26:06 +0000 (10:26 +0200)]
add API for add Directory storage

creates/lists systemd mount units for /mnt/pve/.*
filetypes allowed are ext4 and xfs for now
mount with /dev/disk/by-uuid

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
5 years agocleanup: do not convert exceptions to strings.
Dietmar Maurer [Thu, 2 Aug 2018 09:39:35 +0000 (11:39 +0200)]
cleanup: do not convert exceptions to strings.

5 years agoadd API for LVMThin management
Dominik Csapak [Mon, 30 Jul 2018 08:26:05 +0000 (10:26 +0200)]
add API for LVMThin management

like the LVM API, but return an array for the list,
because we do not have nested data here

and create a vg and thin lv with the name given and use the full size

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
5 years agoadd metadata_size and _used to lv list
Dominik Csapak [Mon, 30 Jul 2018 08:26:03 +0000 (10:26 +0200)]
add metadata_size and _used to lv list

so that we can show it in the webinterface and the user can check
how full it is

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
5 years agoextend list_thinpools for multiple vgs and more information
Dominik Csapak [Mon, 30 Jul 2018 08:26:02 +0000 (10:26 +0200)]
extend list_thinpools for multiple vgs and more information

if no vg is given, give back all thinpools from all vgs
if verbose is 1, then give back the information about the thinpools
(like size and free)

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
5 years agoadd type and skipsmart to /nodes/NODE/disks/list
Dominik Csapak [Mon, 30 Jul 2018 08:26:01 +0000 (10:26 +0200)]
add type and skipsmart to /nodes/NODE/disks/list

so that we can use it for a generic disk selector
this mirrors the functionality we have in
/nodes/NODE/ceph/disks api call (which we can deprecate then)

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