Commit Graph

22 Commits

Author SHA1 Message Date
Fabian Ebner
342a56805c fix #3348: NFS: select correct transport to check for service
Suggested-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2021-03-31 10:22:52 +02:00
Fabian Ebner
816dadb17f NFS: avoid using obsolete rpcinfo option
as suggested in the man page.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-02-09 12:24:35 +01:00
Alwin Antreich
89b9ac961a fix: check connection for nfs v4 only server
the check_connection is done by querying the exports of the nfs server
in question. With nfs v4 those exports aren't listed anymore since nfs
v4 employs a pseudo-filesystem starting from root (/).

rpcinfo allows to query the existence of an nfs v4 service.

Signed-off-by: Alwin Antreich <a.antreich@proxmox.com>
2021-01-26 19:15:17 +01:00
Thomas Lamprecht
44fdfb2af6 nfs and cifs: implement backup notes helper
reuse the one from DirPlugin by directing the call to it, but with
the actual $class. This should stay stable, as we provide an ABI and
try to always use $class->helpers.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-12-07 16:13:09 +01:00
Thomas Lamprecht
74dcca3a48 nfs: code cleanup
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-11-27 10:45:06 +01:00
Thomas Lamprecht
70232472bc fix #3097: cifs, nfs: increase connection check timeout to 10s
we already have the ZFS pool plugin as precedent to use 10s, at for
network with remote off-site storage one can get to 200 - 300ms
RTT latency, which means that for a protocol needing multiple rounds of
communication, one can easily get over 2s while not being in a broken
network.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-10-27 07:03:19 +01:00
Fabian Ebner
3353698f45 Introduce prune-backups property for directory-based storages
Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2020-07-24 15:44:53 +02:00
Dominik Csapak
d1eb35ea74 enable snippets content type for all directory based storages
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2019-01-31 11:04:29 +01:00
Wolfgang Bumiller
9edb99a5a7 add Storage::get_bandwidth_limit helper
Takes an operation, an optional requested bandwidth
limit override, and a list of storages involved in the
operation and lowers the requested bandwidth against global
and storage-specific limits unless the user has permissions
to change those.
This means:
 * Global limits apply to all users without Sys.Modify on /
   (as they can change datacenter.cfg options via the API).
 * Storage specific limits apply to users without
   Datastore.Allocate access on /storage/X for any involved
   storage X.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2018-01-31 12:25:32 +01:00
Wolfgang Bumiller
c7616abcb2 path based storages: improve the mkdir option
So far this only prevented the creation of the toplevel
directory. This does not cover all problem cases,
particularly when said directory is supposed to be a mount
point, including NFS and glusterfs beside ZFS.

The directory based storages we have already use mkpath
whenever they need to create files, and for actions on files
which are supposed to exist it's fine if it errors out.
So it should also be safe to skip the creation of standard
subdirectories in activate_storage().

Additionally NFS and glusterfs storages should also accept
the mkdir option as they otherwise may exhibit similar
issues, eg. when an NFS storage is mounted onto a directory
inside a ZFS subvolume.
2016-09-27 09:54:53 +02:00
Wolfgang Bumiller
1773e785c2 nfs: is_mounted: match /^nfs.*/ type
This is consistent with the old behavior.
2015-12-09 16:15:31 +01:00
Wolfgang Bumiller
aed6c85d28 nfs/glusterfs: is_mounted fixes
The parse_proc_mounts change made the glusterfs is_mounted
check fail (causing it to be shown as inactive on the GUI).
The NFS check was stricter (not allowing a trailing / in the
source anymore).
2015-12-09 09:22:15 +01:00
Wolfgang Bumiller
80b647882e make use of the new ProcFSTools::parse_proc_mounts 2015-11-14 10:37:06 +01:00
Wolfgang Link
bb5520eb17 move read_proc_mounts from NFSPlugin to Tools.
this function will be uesd in more path of the code.
2015-09-03 10:12:07 +02:00
Wolfgang Bumiller
f8b0d82fe6 NFS: replace rpcinfo with showmounts
rpcinfo from rpcbind-0.2.1 in debian doesn't support ipv6 addresses.
At the same time the used command only actually tests for
portmapper/rpcbind availability, not for NFS directly.
Storage::scan_nfs uses /sbin/showmount to get a list of NFS exports from a
server and happily accepts ipv6 addresses. It is also more specific to NFS.

Replacing the rpcinfo call with showmount here means checking explicitly
for NFS and supporting IPv6 without the need for an updated rpcbind
package.
2015-05-21 11:49:35 +02:00
Wolfgang Bumiller
da63f58832 NFSPlugin: deal with ipv6 addresses and fix regexps
NFS needs brackets around ipv6 addresses.
Also: nfs_is_mounted needs to quote the variables. This becomes apparent
when ipv6 addresses are used as then the address would otherwise be
treated as a character class, causing the check to always fail.
2015-05-21 11:49:21 +02:00
Wolfgang Link
37121146ec fix rpcinfo path
change path in jessie of package rpcbind
from /usr/bin/rpcinfo to /usr/sbin/rpcinfo

Signed-off-by: Wolfgang Link <w.link@proxmox.com>
2015-03-06 10:33:26 +01:00
Dietmar Maurer
86a9a680de use rpcinfo instead of Ping
This works for NFS servers behind firewalls.
2012-08-01 08:45:33 +02:00
Alexandre Derumier
4d284721ed nfs: add check_connection
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2012-07-19 11:00:06 +02:00
Dietmar Maurer
be2e0c16b1 import run_command 2012-05-23 12:56:25 +02:00
Dietmar Maurer
d9e4e1ce2c use File::Path 2012-05-23 12:48:44 +02:00
Dietmar Maurer
1dc01b9f30 new plugin architecture 2012-05-23 08:00:13 +02:00