[pve-devel] r6491 - in pve-storage/pve2: . PVE

svn-commits at proxmox.com svn-commits at proxmox.com
Thu Aug 18 09:21:00 CEST 2011


Author: dietmar
Date: 2011-08-18 09:21:00 +0200 (Thu, 18 Aug 2011)
New Revision: 6491

Modified:
   pve-storage/pve2/ChangeLog
   pve-storage/pve2/PVE/Storage.pm
Log:


Modified: pve-storage/pve2/ChangeLog
===================================================================
--- pve-storage/pve2/ChangeLog	2011-08-18 06:46:03 UTC (rev 6490)
+++ pve-storage/pve2/ChangeLog	2011-08-18 07:21:00 UTC (rev 6491)
@@ -1,3 +1,8 @@
+2011-08-18  Proxmox Support Team  <support at proxmox.com>
+
+	* PVE/Storage.pm (iscsi_login): login to target, instead of
+	portal-  to make it work when one portal is offline.
+
 2011-08-15  Proxmox Support Team  <support at proxmox.com>
 
 	* PVE/Storage.pm (parse_config): fix parser for files without
@@ -35,6 +40,7 @@
 
 	* PVE/Storage.pm (iscsi_login): use Net::Ping to check portal
 	availability (avoid long iscsi login timeouts)
+	(resolv_portal_dns): use resolv_server()
 
 2011-07-29  Proxmox Support Team  <support at proxmox.com>
 

Modified: pve-storage/pve2/PVE/Storage.pm
===================================================================
--- pve-storage/pve2/PVE/Storage.pm	2011-08-18 06:46:03 UTC (rev 6490)
+++ pve-storage/pve2/PVE/Storage.pm	2011-08-18 07:21:00 UTC (rev 6491)
@@ -821,18 +821,11 @@
 
     check_iscsi_support ();
 
-    my $res = iscsi_discovery ($portal_in);
+    eval { iscsi_discovery ($portal_in); };
+    warn $@ if $@;
 
-    my $success = 0;
-    foreach my $portal (@{$res->{$target}}) {
-	my $cmd = [$ISCSIADM, '--mode', 'node', '--portal', $portal, 
-		   '--targetname',  $target, '--login'];
-	if (iscsi_test_portal($portal)) {
-	    eval { run_command ($cmd); $success = 1; };
-	    warn $@ if $@;
-	}
-    }
-    die "iscsi login failed\n" if !$success;
+    my $cmd = [$ISCSIADM, '--mode', 'node', '--targetname',  $target, '--login'];
+    run_command ($cmd);
 }
 
 sub iscsi_logout {
@@ -840,8 +833,7 @@
 
     check_iscsi_support ();
 
-    my $cmd = [$ISCSIADM, '--mode', 'node', '--portal', $portal, '--targetname', 
-	       $target, '--logout'];
+    my $cmd = [$ISCSIADM, '--mode', 'node', '--targetname', $target, '--logout'];
     run_command ($cmd);
 }
 
@@ -2201,8 +2193,7 @@
 
 	if (my $ip = resolv_server($server)) {
 	    $server = $ip;
-	    $portal = $port ? "$server:$port" : $server;
-	    return $portal;
+	    return $port ? "$server:$port" : $server;
 	}
     }
     return undef if $noerr;



More information about the pve-devel mailing list