From 9f018118ad01e018350af1bbf9fef45c61ecee7f Mon Sep 17 00:00:00 2001 From: jbjohnso Date: Tue, 11 Mar 2008 13:01:35 +0000 Subject: [PATCH] -Fix mistake in previous checkin -Create sparse iSCSI luns by default -Provide a helpful hint on common error message cause git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@752 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server-2.0/lib/xcat/plugins/iscsi.pm | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/xCAT-server-2.0/lib/xcat/plugins/iscsi.pm b/xCAT-server-2.0/lib/xcat/plugins/iscsi.pm index b1bfbefb7..563b47ef9 100644 --- a/xCAT-server-2.0/lib/xcat/plugins/iscsi.pm +++ b/xCAT-server-2.0/lib/xcat/plugins/iscsi.pm @@ -88,7 +88,7 @@ sub process_request { %rsp=(name=>[$node]); next; } - $fileloc.=$iscsient->{file}; + $fileloc=$iscsiprefix."/".$iscsient->{file}; } } else { unless ($iscsiprefix) { @@ -109,7 +109,7 @@ sub process_request { $rsp{data}=["Creating $fileloc ($lunsize MB)"]; $callback->({node=>[\%rsp]}); %rsp=(name=>[$node]); - my $rc = system("dd if=/dev/zero of=$fileloc bs=1M count=$lunsize"); + my $rc = system("dd if=/dev/zero of=$fileloc bs=1M count=1 seek=$lunsize"); if ($rc) { $rsp{error}=["dd process exited with return code $rc"]; $rsp{errorcode} = [1]; @@ -134,6 +134,9 @@ sub process_request { my $rc = system("tgtadm --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"]; + if ($rc == 27392) { + push @{$rsp{error}},"This likely indicates the need to do /etc/init.d/tgtd start"; + } $rsp{errorcode} = [1]; $callback->({node=>[\%rsp]}); %rsp=(name=>[$node]);