]> git.proxmox.com Git - pve-storage.git/log
pve-storage.git
4 years agoapi: storage/content: add ctime to return schema
Dietmar Maurer [Wed, 4 Mar 2020 10:46:19 +0000 (11:46 +0100)]
api: storage/content: add ctime to return schema

to allow implementation from plugins in future patches

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
4 years agoiscis: add iscsi_session helper
Thomas Lamprecht [Tue, 3 Mar 2020 09:49:11 +0000 (10:49 +0100)]
iscis: add iscsi_session helper

allows to write some code sligthly nicer

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agoiscsi: sort and split module usage
Thomas Lamprecht [Tue, 3 Mar 2020 09:43:02 +0000 (10:43 +0100)]
iscsi: sort and split module usage

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agoISCSI: whitespace cleanup
Aaron Lauterer [Mon, 2 Mar 2020 07:52:06 +0000 (08:52 +0100)]
ISCSI: whitespace cleanup

Signed-off-by: Aaron Lauterer <a.lauterer@proxmox.com>
4 years agofix #2620: storage API: iSCSI: return active field as integer
Aaron Lauterer [Mon, 2 Mar 2020 07:52:05 +0000 (08:52 +0100)]
fix #2620: storage API: iSCSI: return active field as integer

If active, the return value was a string: "1" and not an integer.

Signed-off-by: Aaron Lauterer <a.lauterer@proxmox.com>
4 years agofollowup: fix VMID regex, use same as JSONSchema does
Thomas Lamprecht [Fri, 21 Feb 2020 14:58:06 +0000 (15:58 +0100)]
followup: fix VMID regex, use same as JSONSchema does

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agolist_volumes: try to return vmid also for backups
Dominik Csapak [Fri, 21 Feb 2020 10:02:09 +0000 (11:02 +0100)]
list_volumes: try to return vmid also for backups

this way the content listing api also returns the vmid on content
listings which, among other things, is useful for the gui for
filtering

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
4 years agobump version to 6.1-5
Thomas Lamprecht [Thu, 20 Feb 2020 12:46:24 +0000 (13:46 +0100)]
bump version to 6.1-5

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agocifs: followup fix for credential fallback
Thomas Lamprecht [Thu, 20 Feb 2020 12:55:43 +0000 (13:55 +0100)]
cifs: followup fix for credential fallback

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agocifs: move password credential file to storage subdirectory
Thomas Lamprecht [Thu, 20 Feb 2020 12:07:06 +0000 (13:07 +0100)]
cifs: move password credential file to storage subdirectory

Do not pollute top-level private directory, use "storage" folder but
with backward compatibility.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agoPBSPlugin.pm: fix password handling using new on_update_hook
Dietmar Maurer [Thu, 20 Feb 2020 11:38:21 +0000 (12:38 +0100)]
PBSPlugin.pm: fix password handling using new on_update_hook

4 years agoCIFSPlugin.pm: fix crediential handling using new on_update_hook
Dietmar Maurer [Thu, 20 Feb 2020 11:33:59 +0000 (12:33 +0100)]
CIFSPlugin.pm: fix crediential handling using new on_update_hook

4 years agoPVE/Storage/Plugin.pm: introduce on_update_hook
Dietmar Maurer [Thu, 20 Feb 2020 11:33:58 +0000 (12:33 +0100)]
PVE/Storage/Plugin.pm: introduce on_update_hook

We need this to correctly update the password file.

4 years agopbs: ensure storage secret file directory exists
Thomas Lamprecht [Thu, 20 Feb 2020 10:12:29 +0000 (11:12 +0100)]
pbs: ensure storage secret file directory exists

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agoPBSPlugin.pm - extract_vzdump_config: fix call to run_raw_client_cmd
Dietmar Maurer [Thu, 20 Feb 2020 09:45:34 +0000 (10:45 +0100)]
PBSPlugin.pm - extract_vzdump_config: fix call to run_raw_client_cmd

4 years agovolume_resize: align size to 1 KiB
Fabian Ebner [Wed, 19 Feb 2020 10:31:31 +0000 (11:31 +0100)]
volume_resize: align size to 1 KiB

1. Avoids the error
qemu-img: The new size must be a multiple of 512
for qcow2 disks.
2. Because volume_import expects disk sizes to be a multiple of 1 KiB.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
4 years agonamespace storage specific secret files to 'priv/storage' folder
Thomas Lamprecht [Wed, 19 Feb 2020 13:51:00 +0000 (14:51 +0100)]
namespace storage specific secret files to 'priv/storage' folder

As /etc/pve/priv is already pretty polluted, having a
"<storage-id>.pw" file there smells like it could make problems in
the future.

So let the pbs pw file generator use /etc/pve/priv/storages as base
path.
Other storage should move also to that path in the future, if they
save such secrets anywhere in /etc/pve.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agocheck if client executable ist installed before running command
Thomas Lamprecht [Wed, 19 Feb 2020 13:50:42 +0000 (14:50 +0100)]
check if client executable ist installed before running command

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agouse one liner closure for outfunc
Thomas Lamprecht [Wed, 19 Feb 2020 13:50:04 +0000 (14:50 +0100)]
use one liner closure for outfunc

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agoindentation fixes
Thomas Lamprecht [Wed, 19 Feb 2020 13:49:38 +0000 (14:49 +0100)]
indentation fixes

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agoimplement extract_vzdump_config for PBSPlugin
Dietmar Maurer [Wed, 19 Feb 2020 12:55:28 +0000 (13:55 +0100)]
implement extract_vzdump_config for PBSPlugin

4 years agoPVE/Storage/PBSPlugin.pm: start new proxmox backup server plugin
Dietmar Maurer [Wed, 19 Feb 2020 12:55:27 +0000 (13:55 +0100)]
PVE/Storage/PBSPlugin.pm: start new proxmox backup server plugin

4 years agoCheck whether 'zfs get mountpoint' returns a valid absolute path
Fabian Ebner [Tue, 18 Feb 2020 10:14:59 +0000 (11:14 +0100)]
Check whether 'zfs get mountpoint' returns a valid absolute path

The command 'zfs get mountpoint' can return 'none' and so 'mountpoint
none' was written to storage.cfg, which would block the fall-back to
using the default mount point when requesting a path, see [0].

[0]: https://forum.proxmox.com/threads/zfs-backup-with-snapshot-mode-fails.61927/#post-284123

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
4 years agosystemd unit name escape helpers moved to common, use them
Thomas Lamprecht [Wed, 5 Feb 2020 16:14:39 +0000 (17:14 +0100)]
systemd unit name escape helpers moved to common, use them

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agodirectory/cephfs: sort module usage
Thomas Lamprecht [Wed, 5 Feb 2020 16:13:30 +0000 (17:13 +0100)]
directory/cephfs: sort module usage

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agostorage_migrate: only set errfunc for send stream
Fabian Grünbichler [Wed, 5 Feb 2020 08:37:09 +0000 (09:37 +0100)]
storage_migrate: only set errfunc for send stream

since we redirect the output to our (insecure) socket, logfunc is only
used for STDERR anyway, so we might as well make it explicit on the
caller side.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
4 years agostorage_migrate: also log with an insecure connection if there is a log function
Fabian Ebner [Wed, 29 Jan 2020 13:30:02 +0000 (14:30 +0100)]
storage_migrate: also log with an insecure connection if there is a log function

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
4 years agoRemove unused string
Fabian Ebner [Wed, 29 Jan 2020 13:30:00 +0000 (14:30 +0100)]
Remove unused string

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
4 years agobump version to 6.1-4
Thomas Lamprecht [Wed, 29 Jan 2020 19:04:03 +0000 (20:04 +0100)]
bump version to 6.1-4

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agocephcfg sort keys in write_ceph_config
Thomas Lamprecht [Wed, 29 Jan 2020 18:59:08 +0000 (19:59 +0100)]
cephcfg sort keys in write_ceph_config

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agocephfs mount: reload systemd if existing unit gets regenerated
Thomas Lamprecht [Wed, 29 Jan 2020 18:48:49 +0000 (19:48 +0100)]
cephfs mount: reload systemd if existing unit gets regenerated

One the first write bringing the unit file in existence we can just
start it, after that we need to tell systemd that we want to actively
reload it.

While this is slightly shaky due to the fact that we do not check all
paths where such a unit could reside, it is something we can do
because earlier one couldn't have a unit/overwrite anyway (from
procfs mountinfo generated one do not support that) and does adding
such override ones from now on should work.

Also note that we can only get here in the "user does no weird stuff"
case when "cephfs_is_mounted" actively tells that there is no cephfs
mounted at the $mountpoint - at which time we can safely re-write the
potential updated unit file, reload and mount again.

So let's make our life a bit easier here until a user actually
complains about a rational issue for this, maybe we have PVE 7.0 then
and can get rid of that anyway :)

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agocephfs: mount fuse through systemd with correct order dependencies
Thomas Lamprecht [Wed, 29 Jan 2020 18:41:09 +0000 (19:41 +0100)]
cephfs: mount fuse through systemd with correct order dependencies

This fixes a potential races where fuse get's unmouted to late in the
shutdown process, i.e., at a time where network was down and it could
not talk to any MDS or monitor anymore.

We could fix it the same way we did once with the kernel based mount,
i.e., adding _netdev, but doing so would require to switch over from
"ceph-fuse" to "mount.fuse.ceph" which has better compatibility with
the common mount tool API.

As that helper exists we can reuse the newer systemd_netmount
ephemeral unit generator, only some options differ in name between
fuse and kernel variant.

So besides solving a potential issue we get a more unified handling
of those two cases.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agofix random hangs on reboot with active CephFS mount ordering cycle
Thomas Lamprecht [Wed, 29 Jan 2020 17:02:13 +0000 (18:02 +0100)]
fix random hangs on reboot with active CephFS mount ordering cycle

commit 54e0b0034bd6654c566cb4ae7d4a5953c48cd1ca introduced the
"_netdev" option, for PVE 5.3. The systemd generator then correctly
resolved that in the following resulting order-dependencies:
> Wants=network-online.target
> Before=umount.target remote-fs.target
> After=remote-fs-pre.target system.slice network.target network-online.target -.mount

This worked well and all were happy. With the current systemd in 6.0
we sometimes get the local-fs ones there generated too. This is a
fallout from a try to better handling nested mount hierachies, where
a .mount unit needs to be mounter or unmounted, before or after,
respectively, the parent mount was processed. It seems that sometime
that glitches and thus a "RequireMountFor=/mnt/pve" gets thrown in
and result sometimes in the local-fs order constraints being added.

The issue now is, that one must not have ordering depends to all,
local-fs, local-fs-pre, remote-fs, remote-fs-pre, as that gets you a
ordering cycle. Systemd tries to solve that cycle by randomly
dropping one constraint and retrying. By luck this is a not so
important unit, and all goes on well. Most of the time one isn't that
lucky and something important gets dropped, for example:

> Jan 24 18:43:05 prod1 systemd[1]: sysinit.target: Found ordering cycle on systemd-timesyncd.service/stop
> Jan 24 18:43:05 prod1 systemd[1]: sysinit.target: Found dependency on systemd-tmpfiles-setup.service/stop
> Jan 24 18:43:05 prod1 systemd[1]: sysinit.target: Found dependency on local-fs.target/stop
> Jan 24 18:43:05 prod1 systemd[1]: sysinit.target: Found dependency on mnt-pve-cephfs.mount/stop
> Jan 24 18:43:05 prod1 systemd[1]: sysinit.target: Found dependency on remote-fs-pre.target/stop
> Jan 24 18:43:05 prod1 systemd[1]: sysinit.target: Found dependency on rbdmap.service/stop
> Jan 24 18:43:05 prod1 systemd[1]: sysinit.target: Found dependency on sysinit.target/stop
> Jan 24 18:43:05 prod1 systemd[1]: sysinit.target: Job remote-fs-pre.target/stop deleted to break ordering cycle starting with sysinit.target/stop

Then, most of the time the host reboot hangs for ~10 minutes, often
showing scapegoat units like the pve-ha-lrm being the cause of the
hang (even if no HA is configure >.<).

This behavior is fixed with newer systemd versions, e.g., the v244
from buster-backports, but that is not a real option for us for now.

So until 7.0 we generate the unit with the correct dependencies
directly in the ephemeral /run/ tmpfs backed systemd/system path and
start it.

While FUSE gets only the local-fs ordering constraint, it seems to cope
very well regarding such symptoms. But it _is_ racy and probably only
works due to systemd stopping it early as it has not much ordering
constraints at all.. It should be moved in the future nonetheless, as
there's a mount.fuse.ceph helper that should be not an issue.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agoCephFSPlugin: copy over systemd_escape
Thomas Lamprecht [Wed, 29 Jan 2020 17:00:34 +0000 (18:00 +0100)]
CephFSPlugin: copy over systemd_escape

This is but a hack, but we have no general helper/tools module here
and I do not want to do versioned dependencies for this fast-tracked
bugfix to pve-common, so I'll have to live with the shame for now.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agodon't (accidentally) modify PVE::Cluster::vmlist
Fabian Grünbichler [Tue, 7 Jan 2020 11:24:13 +0000 (12:24 +0100)]
don't (accidentally) modify PVE::Cluster::vmlist

when listing volumes, otherwise an empty hash can be persisted into the
current worker's $vmlist, which could cause issues at various other API
endpoints.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
4 years agocifs-plugin: Add bwlimit storage option
Dominic Jäger [Fri, 20 Dec 2019 09:12:31 +0000 (10:12 +0100)]
cifs-plugin: Add bwlimit storage option

This is already implemented in all other storage plugins.

Signed-off-by: Dominic Jäger <d.jaeger@proxmox.com>
4 years agobump version to 6.1-3
Thomas Lamprecht [Fri, 13 Dec 2019 11:18:40 +0000 (12:18 +0100)]
bump version to 6.1-3

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agogrammar fix: s/does not exists/does not exist/g
Thomas Lamprecht [Fri, 13 Dec 2019 11:11:26 +0000 (12:11 +0100)]
grammar fix: s/does not exists/does not exist/g

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agobase find_free_diskname: refactor mapping from disks to volid array
Thomas Lamprecht [Thu, 12 Dec 2019 11:59:57 +0000 (12:59 +0100)]
base find_free_diskname: refactor mapping from disks to volid array

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
4 years agoUse a common interface for find_free_diskname
Fabian Ebner [Wed, 11 Dec 2019 09:25:49 +0000 (10:25 +0100)]
Use a common interface for find_free_diskname

We can use 'list_images' to get the desired volume IDs in
'find_free_diskname' for most plugins. For the two LVM plugins, 'list_images'
potentially skips untagged volumes, so we keep the custom version. For the
RBD plugin, 'list_images' is much more costly than the custom version, so we
keep the custom version.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
4 years agorbd: unprotect all snapshots on image removal
Fabian Grünbichler [Fri, 29 Nov 2019 11:00:37 +0000 (12:00 +0100)]
rbd: unprotect all snapshots on image removal

we need to unprotect more snapshots than just the base one, since we
allow linked clones of regular VM snapshots. unprotection will only work
if no linked clones exist anymore.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
4 years agoWhen resizing a ZFS volume, align size to 1M
Fabian Ebner [Mon, 9 Dec 2019 07:25:53 +0000 (08:25 +0100)]
When resizing a ZFS volume, align size to 1M

The size is required to be a multiple of volblocksize. Make sure
that the requirement is always met, so ZFS won't complain when we do
things like 'qm resize 102 scsi1 +0.01G'.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
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>