We had issues adding iscsi targets with multiple subnets where one of the subnets was not connectable from the proxmox server:
Getting the iscsi_discovery function to test for connectivity before adding it to the available targets fixed this for us:
Code:
root@debian:~# iscsiadm --mode discovery --type sendtargets --portal 172.16.123.111
172.16.124.1:3260,1 iqn.2011-07.local.wpps:std.drbd0
172.16.123.111:3260,1 iqn.2011-07.local.wpps:std.drbd0
Getting the iscsi_discovery function to test for connectivity before adding it to the available targets fixed this for us:
Code:
+++ /usr/share/perl5/PVE/Storage.pm 2011-07-28 14:27:30.993054558 +0200
@@ -16,6 +16,7 @@
use Getopt::Long qw(GetOptionsFromArray);
use Socket;
use Digest::SHA1;
+use Net::Ping;
my $ISCSIADM = '/usr/bin/iscsiadm';
my $UDEVADM = '/sbin/udevadm';
@@ -1139,15 +1140,19 @@
my $res = {};
run_command ($cmd, outfunc => sub {
my $line = shift;
-
if ($line =~ m/^(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}:\d+)\,\S+\s+(\S+)\s*$/) {
- my $portal = $1;
- my $target = $2;
- # one target can have more than one portal (multipath).
- push @{$res->{$target}}, $portal;
+ my $p = Net::Ping->new("tcp", 2);
+ my @ip = split(':',$1);
+ $p->port_number($ip[1]);
+ if ($p->ping($ip[0])){
+ my $portal = $1;
+ my $target = $2;
+ # one target can have more than one portal (multipath).
+ push @{$res->{$target}}, $portal;
+ }
+ $p->close();
}
});
-
return $res;
}