Fix problem where tgtadm as of late frequently prefers iSER, which would be great but has some steeper underlying requirements that make it harder to use.

Software iscsi for now continues to be intended primarily for prototyping, with an expectation of beefier storage.

git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@13926 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
jbjohnso 2012-10-01 19:52:23 +00:00
parent ea4c75b388
commit ea2114d9ef

View File

@ -148,10 +148,10 @@ sub process_request {
$targname = "iqn.$year-$month.$domain:$node";
$iscsitab->setNodeAttribs($node,{target=>$targname});
}
system("tgtadm --mode target --op delete --tid ".get_tid($node)." -T $targname");
my $rc = system("tgtadm --mode target --op new --tid ".get_tid($node)." -T $targname");
system("tgtadm --lld iscsi --mode target --op delete --tid ".get_tid($node)." -T $targname");
my $rc = system("tgtadm --lld iscsi --mode target --op new --tid ".get_tid($node)." -T $targname");
if ($rc) {
$rsp{error}=["tgtadm --mode target --op new --tid ".get_tid($node)." -T $targname returned $rc"];
$rsp{error}=["tgtadm --lld iscsi --mode target --op new --tid ".get_tid($node)." -T $targname returned $rc"];
if ($rc == 27392) {
push @{$rsp{error}},"This likely indicates the need to do /etc/init.d/tgtd start";
}
@ -160,17 +160,17 @@ sub process_request {
%rsp=(name=>[$node]);
next;
}
$rc = system("tgtadm --mode logicalunit --op new --tid ".get_tid($node)." --lun 1 --backing-store $fileloc --device-type disk");
$rc = system("tgtadm --lld iscsi --mode logicalunit --op new --tid ".get_tid($node)." --lun 1 --backing-store $fileloc --device-type disk");
if ($rc) {
$rsp{error}=["tgtadm --mode logicalunit --op new --tid ".get_tid($node)." --lun 1 --backing-store $fileloc returned $rc"];
$rsp{error}=["tgtadm --lld iscsi mode logicalunit --op new --tid ".get_tid($node)." --lun 1 --backing-store $fileloc returned $rc"];
$rsp{errorcode} = [1];
$callback->({node=>[\%rsp]});
%rsp=(name=>[$node]);
next;
}
$rc = system("tgtadm --mode target --op bind --tid ".get_tid($node)." -I ".inet_ntoa(inet_aton($node)));
$rc = system("tgtadm --lld iscsi --mode target --op bind --tid ".get_tid($node)." -I ".inet_ntoa(inet_aton($node)));
if ($rc) {
$rsp{error}=["tgtadm --mode target --op bind --tid ".get_tid($node)." -I ".inet_ntoa(inet_aton($node)) . " returned $rc"];
$rsp{error}=["tgtadm --lld iscsi --mode target --op bind --tid ".get_tid($node)." -I ".inet_ntoa(inet_aton($node)) . " returned $rc"];
$rsp{errorcode} = [1];
$callback->({node=>[\%rsp]});
%rsp=(name=>[$node]);