use PVE::Storage::ISCSIPlugin;
use PVE::Storage::RBDPlugin;
use PVE::Storage::CephFSPlugin;
-use PVE::Storage::SheepdogPlugin;
use PVE::Storage::ISCSIDirectPlugin;
use PVE::Storage::GlusterfsPlugin;
use PVE::Storage::ZFSPoolPlugin;
PVE::Storage::ISCSIPlugin->register();
PVE::Storage::RBDPlugin->register();
PVE::Storage::CephFSPlugin->register();
-PVE::Storage::SheepdogPlugin->register();
PVE::Storage::ISCSIDirectPlugin->register();
PVE::Storage::GlusterfsPlugin->register();
PVE::Storage::ZFSPoolPlugin->register();
die "cannot migrate from storage type '$scfg->{type}' to '$tcfg->{type}'\n" if !@formats;
my $format = $formats[0];
- my @insecurecmd;
+ my $import_fn = '-'; # let pvesm import read from stdin per default
if ($insecure) {
- @insecurecmd = ('pvecm', 'mtunnel', '-run-command', 1);
- if (my $network = $target_sshinfo->{network}) {
- push @insecurecmd, '-migration_network', $network;
- }
+ my $net = $target_sshinfo->{network} // $target_sshinfo->{ip};
+ $import_fn = "tcp://$net";
}
$with_snapshots = $with_snapshots ? 1 : 0; # sanitize for passing as cli parameter
my $send = ['pvesm', 'export', $volid, $format, '-', '-with-snapshots', $with_snapshots];
- my $recv = [@$ssh, @insecurecmd, '--', 'pvesm', 'import', $volid, $format, '-', '-with-snapshots', $with_snapshots];
+ my $recv = [@$ssh, '--', 'pvesm', 'import', $volid, $format, $import_fn, '-with-snapshots', $with_snapshots];
if (defined($snapshot)) {
push @$send, '-snapshot', $snapshot
}
push @{$res->{$sid}}, {
volid => "$sid:snippets/". basename($fn),
format => 'snippet',
- size => -s $fn,
+ size => -s $fn // 0,
};
}
}
$info = { volid => "$sid:backup/$1", format => $2 };
}
- $info->{size} = -s $fn;
+ $info->{size} = -s $fn // 0;
push @{$res->{$sid}}, $info;
}
}
# Apply per-storage limits - if there are storages involved.
- if (@$storage_list) {
+ if (defined($storage_list) && @$storage_list) {
my $config = config();
# The Datastore.Allocate permission allows us to modify the per-storage
my %done;
foreach my $storage (@$storage_list) {
+ next if !defined($storage);
# Avoid duplicate checks:
next if $done{$storage};
$done{$storage} = 1;