mirror of
https://git.proxmox.com/git/pve-manager
synced 2025-08-06 01:13:19 +00:00
refuse to create replication jobs for unreplicatable VMs
This commit is contained in:
parent
224c78da76
commit
25420507b2
@ -20,7 +20,7 @@ use base qw(PVE::RESTHandler);
|
||||
|
||||
my $pvesr_lock_path = "/var/lock/pvesr.lck";
|
||||
|
||||
my $lookup_guest_class = sub {
|
||||
our $lookup_guest_class = sub {
|
||||
my ($vmtype) = @_;
|
||||
|
||||
if ($vmtype eq 'qemu') {
|
||||
|
@ -118,11 +118,16 @@ __PACKAGE__->register_method ({
|
||||
my $nodelist = PVE::Cluster::get_members();
|
||||
my $vmlist = PVE::Cluster::get_vmlist();
|
||||
|
||||
my $guest_info = $vmlist->{ids}->{$guest};
|
||||
die "Guest '$guest' does not exists.\n"
|
||||
if !defined($vmlist->{ids}->{$guest});
|
||||
if !defined($guest_info);
|
||||
die "Target '$param->{target}' does not exists.\n"
|
||||
if defined($param->{target}) && !defined($nodelist->{$param->{target}});
|
||||
|
||||
my $guest_class = $PVE::API2::Replication::lookup_guest_class->($guest_info->{type});
|
||||
my $guest_conf = $guest_class->load_config($guest);
|
||||
$guest_class->get_replicatable_volumes(PVE::Storage::config(), $guest, $guest_conf, 0, 0);
|
||||
|
||||
my $code = sub {
|
||||
my $cfg = PVE::ReplicationConfig->new();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user