Commit Graph

1961 Commits

Author SHA1 Message Date
Thomas Lamprecht
5a2d31746f bump version to 6.1-4
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-01-29 20:04:03 +01:00
Thomas Lamprecht
e38418266f cephcfg sort keys in write_ceph_config
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-01-29 19:59:08 +01:00
Thomas Lamprecht
9a80a3eae0 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>
2020-01-29 19:54:40 +01:00
Thomas Lamprecht
25e222ca0d 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>
2020-01-29 19:41:11 +01:00
Thomas Lamprecht
d9ece228fb fix random hangs on reboot with active CephFS mount ordering cycle
commit 54e0b0034b 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>
2020-01-29 18:25:21 +01:00
Thomas Lamprecht
edaaf47aec 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>
2020-01-29 18:00:37 +01:00
Fabian Grünbichler
a420842d01 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>
2020-01-08 12:01:10 +01:00
Dominic Jäger
c3ed9ac3da 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>
2019-12-20 10:35:45 +01:00
Thomas Lamprecht
66efee5b8c bump version to 6.1-3
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-12-13 12:18:40 +01:00
Thomas Lamprecht
481f6177a5 grammar fix: s/does not exists/does not exist/g
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-12-13 12:11:26 +01:00
Thomas Lamprecht
01e872db98 base find_free_diskname: refactor mapping from disks to volid array
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-12-12 12:59:57 +01:00
Fabian Ebner
a44c0147bc 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>
2019-12-12 12:52:43 +01:00
Fabian Grünbichler
a573f66a2e 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>
2019-12-11 10:55:04 +01:00
Fabian Ebner
d3e3e5d6bd 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>
2019-12-09 14:07:50 +01:00
Tim Marx
3ea55f0532 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>
2019-12-09 14:04:07 +01:00
Thomas Lamprecht
14c7ede3a3 lvm: vg create: followup for bogus warnings
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-12-02 15:15:52 +01:00
Thomas Lamprecht
f16d514a42 bump version to 6.1-2
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-11-30 19:38:17 +01:00
Thomas Lamprecht
14092a3794 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>
2019-11-29 14:44:17 +01:00
Fabian Grünbichler
518f3908bf 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>
2019-11-29 13:41:33 +01:00
Fabian Grünbichler
b4227e776f 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>
2019-11-29 11:09:52 +01:00
Thomas Lamprecht
eb98e68611 bump version to 6.1-1
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-11-27 14:46:53 +01:00
Fabian Grünbichler
b5eff97d66 pvesm import: make error messages consistent
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2019-11-27 14:36:19 +01:00
Fabian Grünbichler
f105c1766e 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>
2019-11-27 14:36:19 +01:00
Thomas Lamprecht
97cf933fe5 fix #2309: allow LVM Volume Group names starting with a digit
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-11-26 14:17:19 +01:00
Thomas Lamprecht
8bd69ec82d bump version to 6.0-12
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-11-25 18:28:57 +01:00
Thomas Lamprecht
43fe2a0d2c d/controll: add zfs-zed to Recommends
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-11-25 14:57:23 +01:00
Thomas Lamprecht
c5590ef7ba 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>
2019-11-23 16:15:59 +01:00
Thomas Lamprecht
0ef8fb9d4d 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>
2019-11-23 15:44:19 +01:00
Thomas Lamprecht
5102900d50 rbd: group and sort module usage
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-11-22 18:15:25 +01:00
Thomas Lamprecht
3ee4ef1886 bump version to 6.0-11
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-11-22 16:06:20 +01:00
Thomas Lamprecht
a4e603c657 RBD: fix ceph version detection
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-11-22 16:02:40 +01:00
Thomas Lamprecht
0877df047c cleanuo: no need to negate we have not-equal
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-11-21 12:43:55 +01:00
Tim Marx
a4e41b0bbf change var name ct to type to prevent confusion with container
Signed-off-by: Tim Marx <t.marx@proxmox.com>
2019-11-21 12:43:55 +01:00
Tim Marx
5dae1a319b 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>
2019-11-21 12:43:55 +01:00
Thomas Lamprecht
528aa0eefb followup: remove no-op JSONSchema::check_format on mountpoint
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-11-21 12:43:55 +01:00
Fabian Ebner
dcefd9dd28 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>
2019-11-21 12:42:38 +01:00
Thomas Lamprecht
61c261e76c pvesm list: right align size column
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-11-21 11:59:43 +01:00
Tim Marx
2e2e11db3e add content type to pvesm list output
Signed-off-by: Tim Marx <t.marx@proxmox.com>
2019-11-21 09:01:43 +01:00
Fabian Grünbichler
ad71f2ffb6 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>
2019-11-18 12:06:01 +01:00
Fabian Grünbichler
396477a7ce d/control: add (build-)depends on libpve-cluster-perl
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2019-11-18 12:03:00 +01:00
Fabian Grünbichler
0ce8cadd7f 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>
2019-11-18 12:03:00 +01:00
Fabian Grünbichler
65bb98596c use PVE::SSHInfo
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2019-11-18 12:03:00 +01:00
Fabian Grünbichler
2f08fb4bac use PVE::DataCenterConfig
to make sure that the corresponding cfs_read_file works() works.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2019-11-18 12:03:00 +01:00
Fabian Ebner
4966c8869e Introduce zfs_get_properties helper
Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2019-11-14 12:38:25 +01:00
Thomas Lamprecht
ed2df8e35e followup: different error messages for no and to many IPs
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-11-08 12:19:04 +01:00
Fabian Grünbichler
a2aae38c4b 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>
2019-11-08 11:24:52 +01:00
Tim Marx
83a9960c71 convert vmid to int to conform with return type declaration
Signed-off-by: Tim Marx <t.marx@proxmox.com>
2019-11-05 18:37:15 +01:00
Tim Marx
9148f5b355 whitespace cleanup
Signed-off-by: Tim Marx <t.marx@proxmox.com>
2019-11-05 18:37:15 +01:00
Thomas Lamprecht
6ed43d81dc cleanup: omit module prefix for call to methods in same module
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-10-31 07:36:27 +01:00
Fabian Ebner
3824ba88a9 Whitespace cleanup
Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2019-10-08 11:22:12 +02:00