[pve-devel] [PATCH pve-manager 2/2] Deny stop mode backups from HA managed and enabled services

Thomas Lamprecht t.lamprecht at proxmox.com
Fri Sep 18 11:21:03 CEST 2015


Signed-off-by: Thomas Lamprecht <t.lamprecht at proxmox.com>
---
 PVE/VZDump.pm | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/PVE/VZDump.pm b/PVE/VZDump.pm
index dd7a7e9..62b59ec 100644
--- a/PVE/VZDump.pm
+++ b/PVE/VZDump.pm
@@ -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";
-- 
2.1.4



More information about the pve-devel mailing list