]> git.proxmox.com Git - pve-container.git/commitdiff
Closes #877: Skip mps with backup=0 for snapshot backups
authorFabian Grünbichler <f.gruenbichler@proxmox.com>
Thu, 28 Jan 2016 15:10:59 +0000 (16:10 +0100)
committerDietmar Maurer <dietmar@proxmox.com>
Thu, 28 Jan 2016 16:09:25 +0000 (17:09 +0100)
src/PVE/LXC.pm
src/PVE/VZDump/LXC.pm

index 2426ac37b349608ac5060ff4ab6bd0bb5a74262c..49a85b63b65fe5ece5099d6ed3798387c69b3539 100644 (file)
@@ -1743,7 +1743,8 @@ my $snapshot_prepare = sub {
            if defined($conf->{snapshots}->{$snapname});
 
        my $storecfg = PVE::Storage::config();
-       die "snapshot feature is not available\n" if !has_feature('snapshot', $conf, $storecfg);
+       my $feature = $snapname eq 'vzdump' ? 'vzdump' : 'snapshot';
+       die "snapshot feature is not available\n" if !has_feature($feature, $conf, $storecfg);
 
        $snap = $conf->{snapshots}->{$snapname} = {};
 
@@ -1793,11 +1794,14 @@ sub has_feature {
     my ($feature, $conf, $storecfg, $snapname) = @_;
     
     my $err;
+    my $vzdump = $feature eq 'vzdump';
+    $feature = 'snapshot' if $vzdump;
 
     foreach_mountpoint($conf, sub {
        my ($ms, $mountpoint) = @_;
 
        return if $err; # skip further test
+       return if $vzdump && $ms ne 'rootfs' && !$mountpoint->{backup};
        
        $err = 1 if !PVE::Storage::volume_has_feature($storecfg, $feature, $mountpoint->{volume}, $snapname);
 
index e2ed7b69e55fb6c6c5c8dfc331aeb1a322bbeb39..dddf17ef6be02aa45355b8c6f7d6c74f27f18ff4 100644 (file)
@@ -150,7 +150,7 @@ sub prepare {
     my $volid_list = [map { $_->{volume} } @$disks];
 
     if ($mode eq 'snapshot') {
-       if (!PVE::LXC::has_feature('snapshot', $conf, $storage_cfg)) {
+       if (!PVE::LXC::has_feature('vzdump', $conf, $storage_cfg)) {
            die "mode failure - some volumes do not support snapshots\n";
        }