]> git.proxmox.com Git - pve-container.git/commitdiff
do not allow destroy if there are replication jobs
authorDietmar Maurer <dietmar@proxmox.com>
Tue, 23 May 2017 16:05:12 +0000 (18:05 +0200)
committerDietmar Maurer <dietmar@proxmox.com>
Mon, 29 May 2017 09:34:43 +0000 (11:34 +0200)
src/PVE/API2/LXC.pm

index 47dcb08acee40debd69403208bc841a905944a6b..a23b944a3c3cd6e09137eb2f40aff94390a3fab1 100644 (file)
@@ -13,6 +13,7 @@ use PVE::Firewall;
 use PVE::Storage;
 use PVE::RESTHandler;
 use PVE::RPCEnvironment;
+use PVE::ReplicationConfig;
 use PVE::LXC;
 use PVE::LXC::Create;
 use PVE::LXC::Migrate;
@@ -603,6 +604,10 @@ __PACKAGE__->register_method({
        die "unable to remove CT $vmid - used in HA resources\n"
            if PVE::HA::Config::vm_is_ha_managed($vmid);
 
+       # do not allow destroy if there are replication jobs
+       my $repl_conf = PVE::ReplicationConfig->new();
+       $repl_conf->check_for_existing_jobs($vmid);
+
        my $running_error_msg = "unable to destroy CT $vmid - container is running\n";
 
        die $running_error_msg if PVE::LXC::check_running($vmid); # check early