Il giorno Ven 14 Gen 2011 17:34:10 CET, RaSca ha scritto:
[...]
I can say for sure that we will surely know. As you can see, in all of
my posts (and projects) I never give up until there is a clear solution
to the problem. I will find out also in this case.
Thanks again,

Dejan, here I am.
Attached to this mail you can find a patch to your original iscsi RA, in which I've added the possibility to do or do not the discovery (discovery_enable parameter). In this way, the RA works perfectly and I can use it in my environment. As I first supposed there's something in the code of the discovery that make things break. Note that I will continue my investigation on the discover problem, but in this way it's possible for me to use the "original" RA with my patch and, of course, the parameter discovery_enable set to "no". Maybe, since this is an optional parameter, it can be included in the official RA.

Hoping that you're unhappy anymore ;-)

--
Raoul Scarazzini
Mia Mamma Usa Linux: Niente รจ impossibile da capire, se lo spieghi bene!
[email protected]

*** heartbeat/iscsi	2011-01-16 13:26:12.000000000 +0100
--- rasca/iscsi	2011-01-16 13:27:57.000000000 +0100
***************
*** 31,36 ****
--- 31,37 ----
  #	OCF_RESKEY_portal: the iSCSI portal address or host name (required)
  #	OCF_RESKEY_target: the iSCSI target (required)
  #	OCF_RESKEY_iscsiadm: iscsiadm program path (optional)
+ #	OCF_RESKEY_discovery_enable: enable discovery? (default: yes)
  #	OCF_RESKEY_discovery_type: discovery type (optional; default: sendtargets)
  #
  # Initialization:
***************
*** 87,92 ****
--- 88,101 ----
  <content type="string" default="" />
  </parameter>
  
+ <parameter name="discovery_enable" unique="0" required="0">
+ <longdesc lang="en">
+ Enable discovery? In some cases doing the discovery can break things on startup.
+ </longdesc>
+ <shortdesc lang="en">discovery_enable</shortdesc>
+ <content type="string" default="yes" />
+ </parameter>
+ 
  <parameter name="discovery_type" unique="0" required="0">
  <longdesc lang="en">
  Discovery type. Currently, with open-iscsi, only the sendtargets
***************
*** 179,187 ****
  #   3: iscsiadm returned error
  
  open_iscsi_discovery() {
! 	output=`$iscsiadm -m discovery -p $OCF_RESKEY_portal -t $discovery_type`
  	if [ $? -ne 0 -o x = "x$output" ]; then
! 		[ x != "x$output" ] && echo "$output"
  		return 3
  	fi
  	portal=`echo "$output" |
--- 188,205 ----
  #   3: iscsiadm returned error
  
  open_iscsi_discovery() {
! 	local output
! 	local portal
! 	local severity=err
! 	local cmd="$iscsiadm -m discovery -p $OCF_RESKEY_portal -t $discovery_type"
! 
! 	ocf_is_probe && severity=info
! 	output=`$cmd`
  	if [ $? -ne 0 -o x = "x$output" ]; then
! 		[ x != "x$output" ] && {
! 			ocf_log $severity "$cmd FAILED"
! 			echo "$output"
! 		}
  		return 3
  	fi
  	portal=`echo "$output" |
***************
*** 196,202 ****
  	case `echo "$portal" | wc -w` in
  	0) #target not found
  		echo "$output"
! 		ocf_log err "target $OCF_RESKEY_target not found at portal $OCF_RESKEY_portal"
  		return 1
  	;;
  	1) #we're ok
--- 214,220 ----
  	case `echo "$portal" | wc -w` in
  	0) #target not found
  		echo "$output"
! 		ocf_log $severity "target $OCF_RESKEY_target not found at portal $OCF_RESKEY_portal"
  		return 1
  	;;
  	1) #we're ok
***************
*** 336,343 ****
--- 354,366 ----
  	exit $OCF_ERR_PERM
  fi
  
+ discovery_enable=${OCF_RESKEY_discovery_enable:-"yes"}
+ [ "$discovery_enable" != "yes" ] && portal=$OCF_RESKEY_portal
  discovery_type=${OCF_RESKEY_discovery_type:-"sendtargets"}
  udev=${OCF_RESKEY_udev:-"yes"}
+ 
+ if [ $discovery_enable = "yes" ]
+ then
  $discovery  # discover and setup the real portal string (address)
  case $? in
  0) ;;
***************
*** 346,353 ****
     [ "$1" = status ] && exit $LSB_STATUS_STOPPED
     exit $OCF_ERR_GENERIC
  ;;
! [23]) exit $OCF_ERR_GENERIC;;
  esac
  
  # which method was invoked?
  case "$1" in
--- 369,380 ----
     [ "$1" = status ] && exit $LSB_STATUS_STOPPED
     exit $OCF_ERR_GENERIC
  ;;
! 2) exit $OCF_ERR_GENERIC;;
! 3) ocf_is_probe && exit $OCF_NOT_RUNNING
!    exit $OCF_ERR_GENERIC
! ;;
  esac
+ fi
  
  # which method was invoked?
  case "$1" in

_______________________________________________
Linux-HA mailing list
[email protected]
http://lists.linux-ha.org/mailman/listinfo/linux-ha
See also: http://linux-ha.org/ReportingProblems

Reply via email to