1 Reply Latest reply on May 14, 2013 4:08 AM by user10955371

    Configuring udev rules for Oracle 10g R2 Rac on OEL 5.5 U4 with Qnap

      I'm trying to setup a 10g RAC Cluster following the guide by Jeff Hunter on http://www.idevelopment.info/

      I have to admit, im no Linux admin, and have searched round the net for help with the following Issue.

      I'm trying to set my iSCSI targets to have persistent mappings using udev rules

      This is what I have done so far

      [root@racnode1 Server]# iscsiadm -m discovery -t sendtargets -p nas-priv | grep,1 iqn.2004-04.com.qnap:ts-459:iscsi.racdbvote1.c59a2d,1 iqn.2004-04.com.qnap:ts-459:iscsi.racdbfra2.c59a2d,1 iqn.2004-04.com.qnap:ts-459:iscsi.racdbdata2.c59a2d,1 iqn.2004-04.com.qnap:ts-459:iscsi.racdbvote2.c59a2d,1 iqn.2004-04.com.qnap:ts-459:iscsi.racdbcrs2.c59a2d,1 iqn.2004-04.com.qnap:ts-459:iscsi.racdbcrs1.c59a2d,1 iqn.2004-04.com.qnap:ts-459:iscsi.racdbdata1.c59a2d,1 iqn.2004-04.com.qnap:ts-459:iscsi.racdbvote3.c59a2d,1 iqn.2004-04.com.qnap:ts-459:iscsi.racdbfra1.c59a2d

      -- Manually Log into iSCSI Targets
      iscsiadm -m node -T iqn.2004-04.com.qnap:ts-459:iscsi.racdbvote1.c59a2d -p -l
      iscsiadm -m node -T iqn.2004-04.com.qnap:ts-459:iscsi.racdbfra2.c59a2d -p -l
      iscsiadm -m node -T iqn.2004-04.com.qnap:ts-459:iscsi.racdbdata2.c59a2d -p -l
      iscsiadm -m node -T iqn.2004-04.com.qnap:ts-459:iscsi.racdbvote2.c59a2d -p -l
      iscsiadm -m node -T iqn.2004-04.com.qnap:ts-459:iscsi.racdbcrs2.c59a2d -p -l
      iscsiadm -m node -T iqn.2004-04.com.qnap:ts-459:iscsi.racdbcrs1.c59a2d -p -l
      iscsiadm -m node -T iqn.2004-04.com.qnap:ts-459:iscsi.racdbdata1.c59a2d -p -l
      iscsiadm -m node -T iqn.2004-04.com.qnap:ts-459:iscsi.racdbvote3.c59a2d -p -l
      iscsiadm -m node -T iqn.2004-04.com.qnap:ts-459:iscsi.racdbfra1.c59a2d -p -l

      -- Make iSCSI Targets Automatically Login
      iscsiadm -m node -T iqn.2004-04.com.qnap:ts-459:iscsi.racdbvote1.c59a2d -p --op update -n node.startup -v automatic
      iscsiadm -m node -T iqn.2004-04.com.qnap:ts-459:iscsi.racdbfra2.c59a2d -p --op update -n node.startup -v automatic
      iscsiadm -m node -T iqn.2004-04.com.qnap:ts-459:iscsi.racdbdata2.c59a2d -p --op update -n node.startup -v automatic
      iscsiadm -m node -T iqn.2004-04.com.qnap:ts-459:iscsi.racdbvote2.c59a2d -p --op update -n node.startup -v automatic
      iscsiadm -m node -T iqn.2004-04.com.qnap:ts-459:iscsi.racdbcrs2.c59a2d -p --op update -n node.startup -v automatic
      iscsiadm -m node -T iqn.2004-04.com.qnap:ts-459:iscsi.racdbcrs1.c59a2d -p --op update -n node.startup -v automatic
      iscsiadm -m node -T iqn.2004-04.com.qnap:ts-459:iscsi.racdbdata1.c59a2d -p --op update -n node.startup -v automatic
      iscsiadm -m node -T iqn.2004-04.com.qnap:ts-459:iscsi.racdbvote3.c59a2d -p --op update -n node.startup -v automatic
      iscsiadm -m node -T iqn.2004-04.com.qnap:ts-459:iscsi.racdbfra1.c59a2d -p --op update -n node.startup -v automatic

      -- Create Persistent Local SCSI Device Names

      - Identify Mappings

      [root@racnode1 ~]# (cd /dev/disk/by-path; ls -l qnap | awk '{FS=" "; print $9 " " $10 " " $11}')
      ip- -> ../../sdg
      ip- -> ../../sdf
      ip- -> ../../sdi
      ip- -> ../../sdd
      ip- -> ../../sdj
      ip- -> ../../sdc
      ip- -> ../../sdb
      ip- -> ../../sde
      ip- -> ../../sdh

      - Create Rules File

      cat >> /etc/udev/rules.d/55-openiscsi.rules <<EOF
      # /etc/udev/rules.d/55-openiscsi.rules
      KERNEL=="sd*", BUS=="scsi", PROGRAM="/etc/udev/scripts/iscsidev.sh %b",SYMLINK+="iscsi/%c/part%n"

      - Create Shell Script
      mkdir -p /etc/udev/scripts

      vi /etc/udev/scripts/iscsidev.sh


      # FILE: /etc/udev/scripts/iscsidev.sh


      [ -e /sys/class/iscsi_host ] || exit 1


      target_name=$(cat ${file})

      # This is not an open-scsi drive
      if [ -z "${target_name}" ]; then
      exit 1

      # Check if QNAP drive
      if [ $check_qnap_target_name = "iqn.2004-04.com.qnap" ]; then
      target_name=`echo "${target_name%.*}"`

      echo "${target_name##*.}"

      chmod 755 /etc/udev/scripts/iscsidev.sh

      service iscsi stop
      service iscsi start

      [root@racnode1 ~]# ls /dev/iscsi/*
      ls: /dev/iscsi/*: No such file or directory

      1.) For some reason I cannot get the mappings to work correctly, I have rebooted the server and tried a number of different changes in the rules script. But for the life of me I cannot get it work.

      I noticed when I rebooted the server that it failed to execute the iscsidev. When I manually run the shell script with a parameter it produces output

      Can anyone help me to get this up and running?

      2.) My QNAP Nas doesnt seem to publish iSCSI targets to only one NIC. I think this is down to the firmware/feature not being available. When I discover targets I get the following

      [root@racnode1 ~]# (cd /dev/disk/by-path; ls -l *qnap* | awk '{FS=" "; print $9 " " $10 " " $11}')
      ip- -> ../../sdh
      ip- -> ../../sdm
      ip- -> ../../sdn
      ip- -> ../../sde
      ip- -> ../../sdr
      ip- -> ../../sdd
      ip- -> ../../sdb
      ip- -> ../../sdk
      ip- -> ../../sdp
      ip- -> ../../sdi
      ip- -> ../../sdg
      ip- -> ../../sdo
      ip- -> ../../sdj
      ip- -> ../../sds
      ip- -> ../../sdf
      ip- -> ../../sdc
      ip- -> ../../sdl
      ip- -> ../../sdq

      It shows the same targets on both NIC's, I only need them on the private ip

      Edited by: user1728822 on 07-May-2011 15:53

      Edited by: user1728822 on 07-May-2011 16:08