[pve-devel] [PATCH pve-container] vzdump: warn about lack of xattr/acl support on nfs

Wolfgang Bumiller w.bumiller at proxmox.com
Thu Nov 19 10:55:48 CET 2015


When rsyncing to a temporary location mounted via nfs warn
about the lack of xattr and acl support and disable it.
---
 src/PVE/VZDump/LXC.pm | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/src/PVE/VZDump/LXC.pm b/src/PVE/VZDump/LXC.pm
index 72ad9c0..9c40ea3 100644
--- a/src/PVE/VZDump/LXC.pm
+++ b/src/PVE/VZDump/LXC.pm
@@ -24,7 +24,9 @@ my $rsync_vm = sub {
 
     my $opts = $self->{vzdump}->{opts};
 
-    my $rsync = ['rsync', '--stats', '-X', '-A', '--numeric-ids',
+    my @xattr = $task->{no_xattrs} ? () : ('-X', '-A');
+
+    my $rsync = ['rsync', '--stats', @xattr, '--numeric-ids',
                  '-aH', '--delete', '--no-whole-file', '--inplace',
                  '--one-file-system', '--relative'];
     push @$rsync, "--bwlimit=$opts->{bwlimit}" if $opts->{bwlimit};
@@ -207,6 +209,14 @@ sub snapshot {
 sub copy_data_phase1 {
     my ($self, $task) = @_;
 
+    if (my $mntinfo = PVE::VZDump::get_mount_info($task->{snapdir})) {
+	if ($mntinfo->{fstype} =~ /^nfs4?/) {
+	    warn "temporary directory is on NFS, disabling xattr and acl support"
+	    . ", consider configuring a local tmpdir via /etc/vzdump.conf\n";
+	    $task->{no_xattrs} = 1;
+	}
+    }
+
     $self->$rsync_vm($task, $task->{snapdir}, "first");
 }
 
-- 
2.1.4





More information about the pve-devel mailing list