Deny stop mode backups from HA managed and enabled services

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
Thomas Lamprecht 2015-09-18 11:21:03 +02:00 committed by Dietmar Maurer
parent ad21a2ff91
commit 2de3ee58c8

View 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";