replication: refuse to create jobs with nothing to do

When a VM has no disks or all of them are on shared storage
the replication job has nothing to do and fails, so catch
this when creating a new job.
This commit is contained in:
Wolfgang Bumiller 2017-06-27 14:55:45 +02:00 committed by Dietmar Maurer
parent 5b35845009
commit 1adc6f7ab3

View File

@ -126,7 +126,8 @@ __PACKAGE__->register_method ({
my $guest_class = $PVE::API2::Replication::lookup_guest_class->($guest_info->{type}); my $guest_class = $PVE::API2::Replication::lookup_guest_class->($guest_info->{type});
my $guest_conf = $guest_class->load_config($guest); my $guest_conf = $guest_class->load_config($guest);
$guest_class->get_replicatable_volumes(PVE::Storage::config(), $guest, $guest_conf, 0, 0); my $rep_volumes = $guest_class->get_replicatable_volumes(PVE::Storage::config(), $guest, $guest_conf, 0, 0);
die "No replicatable volumes found\n" if !%$rep_volumes;
my $code = sub { my $code = sub {
my $cfg = PVE::ReplicationConfig->new(); my $cfg = PVE::ReplicationConfig->new();