Personal tools
You are here: Home Members marc blog The Blog [OSR-GFS] Implement scsi_reserve/fence_scsi to the GFS based clusters
Document Actions

[OSR-GFS] Implement scsi_reserve/fence_scsi to the GFS based clusters

This blog describes the design concept on how to implement the scsi_reserve/fence_scsi implementation derived from the Red Hat way.

Background

The scsi_reserve/fence_scsi reservation should be implemented in OSR GFS Sharedroot Clusters in order to have a hardware independent implementation on cluster recovery.

Current Implementation

The implementation on RHEL5/6 clusters is as follows.

The starting and stopping is done via the init-process as follows:

Implementation with RHEL5 is as follows:

initprocess
   |
   V
/etc/rc.sysinit
 -> Setup multipath
   |
  ...
   |
   V
/etc/rc.d/init.d/multipathd start|stop (S:06, K: 87)
   |
   V
  ...
   |
   V
/etc/rc.d/init.d/cman start|stop (S:21, K: 79)
 -> start|stop cman
 -> start|stop qdisk
   |
   V
  ...
   |
   V
/etc/rc.d/init.d/clvmd start|stop (S:24, K: 76)
  -> if $LVM_VGS (LVM_VGS should be setup in /etc/sysconfig/cluster)
     -> vgchange -ayl $LVM_VGS
  -> else vgchagne -ayl
        (Will fail cause all VGS<c> are reserved and we are not yet part of the reservation)
   |
   V
  ...
   |
   V
/etc/rc.d/init.d/scsi_reserve (S:26, K: 75)
  -> make a group reservation for all phyiscal volumes under cluster control as follows:
    -> get list of pvs (stored in scsi_devices)::

      scsi_devices=$(vgs --config 'global { locking_type = 0 }' \
        --noheadings -o vg_attr,pv_name 2> /dev/null \
        | awk ' $1 ~ /.*c$/ { print $2 } ')

    -> Generate a key for this node in the cluster as follows:

      cluster_id=$( cman_tool status | grep -i "Cluster ID" \
          | awk -F": " '{ print $2 }' )
      node_id=$( cman_tool status | grep -i "Node ID" \
       | awk -F": " '{ print $2 }' )
      key=$( printf "%x%.4x" $cluster_id $node_id )

    -> for each scsi_device in $scsi_devices create the registration with the device as follows

      sg_persist --no-inquiry --device=$dev --out --register-ignore --param-sark=$key

    -> Reserve the registration in Mode write  exclusive - registrants only as follows

      sg_persist --no-inquiry --device=$dev --out --reserve --param-rk=$key --prout-type=5
   |
   V
  ...

Idea of Implementation

We could stay with this kind of implementation.

The only change should be to get the list of scsidevices also from a list of regular expressions (similar to the lvm_filters).

This would mean the list of scsi_devices should reside from a function called scsi_reservation_devices that should return a list of devices. If no filters are been given fall back to the current implementation.

The part of the clusterconfiguration should look as follows:

<cluster..>
  <clusternode ..>
     ..
  </clusternode>
  <fencedevices>
     <fencedevice .. agent="fence_scsi"  ..>
        <scsi device="device|regexptodevicepath"/>
        ..
     </fencedevice>
  </fencedevice>

Hopefully this will not influence the cluster implementation in any way. An alternative implementation will be to have a configurationfile /etc/sysconfig/cluster (included in the initrd) with the variable SCSI_RESERVATION_DEVICES set as follows:

SCSI_RESERVATION_DEVICES="device|regextodevicepath+"

So there are two additional ways to specify the devices that are of shared between the node.

For this there must also be a rewritten fence_agent (fence_scsi).


Powered by Plone CMS, the Open Source Content Management System

This site conforms to the following standards: