]> git.proxmox.com Git - pve-manager.git/commitdiff
Deny stop mode backups from HA managed and enabled services
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Fri, 18 Sep 2015 09:21:03 +0000 (11:21 +0200)
committerDietmar Maurer <dietmar@proxmox.com>
Sun, 20 Sep 2015 07:53:12 +0000 (09:53 +0200)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
PVE/VZDump.pm

index dd7a7e9e9270fd810846c16a20723d066c773ebc..62b59ecacc2317d06ce04f7feb9d344812923237 100644 (file)
@@ -16,6 +16,7 @@ use PVE::Cluster qw(cfs_read_file);
 use Time::localtime;
 use Time::Local;
 use PVE::JSONSchema qw(get_standard_option);
+use PVE::HA::Config;
 
 my @posix_filesystems = qw(ext3 ext4 nfs nfs4 reiserfs xfs);
 
@@ -826,6 +827,15 @@ sub exec_backup_task {
     eval {
        die "unable to find VM '$vmid'\n" if !$plugin;
 
+       # for now we deny backups of a running ha managed service in *stop* mode
+       # as it interferes with the HA stack (enabled services should not stop).
+       if ($opts->{mode} eq 'stop' &&
+           PVE::HA::Config::vm_is_ha_managed($vmid, 'enabled'))
+       {
+           die "Cannot execute a backup with stop mode on a HA managed and".
+               " enabled Service. Use snapshot mode or disable the Service.\n";
+       }
+
        my $vmtype = $plugin->type();
 
        my $tmplog = "$logdir/$vmtype-$vmid.log";