[Linux-HA] OCF RA and BASH arrays

Andrew Beekhof beekhof at gmail.com
Thu Jan 29 04:15:30 MST 2009


On Mon, Jan 26, 2009 at 22:53, Ethan Bannister <ebannister at acsacc.com> wrote:
>
> Can anyone tell me if heartbeat can handle a multiple elements within a
> specific parameter in a OCF Agent using a BASH array?

no - the parameters are name=value environment variables
of course the RA can then parse them into whatever form it likes

> Basically, I am
> attempting to modify a custom Resource Agent by including a few arrays.  But
> I don't know how heartbeat will handle the (please excuse me if I have my
> terminology wrong but...) "sub-variables".  Ultimately, I would like to have
> someone place their variables in the CIB, and have heartbeat place those
> variables in the correct place when needed.  Ultimately, I would like
> heartbeat to add a proper lun device and matching lun number after they
> input the proper variables.  Here is the original syntax to add a lun:
>
> tgtadm --op new --mode=logicalunit --TID=1 --lun=$OCF_RESKEY_LunNum
> --backing-store=$OCF_RESKEY_Lun_Device
>
> Where OCF_RESKEY_LunNum is the actual Lun number that will be assigned with
> OCF_RESKEY_Lun_Device.  An actual example could be:
>
> tgtadm --op new --mode=logicalunit --TID=1 --lun=1 --backing-store=/dev/sdb
>
> This creates Lun: 1 using /dev/sdb in tgt (iSCSI Target Framework).  Now, if
> there were multiple lun's, I would need to put this very same command in,
> but replace the variables in the "--lun=" and "--backing-store=" arguments.
> This means that if I were to make my script work universally using the
> parameters, heartbeat would need to be able to handle arrays so I may do
> something like this:
>
> $OCF_RESKEY_Lun_Device [0]="/dev/sdb"
> $OCF_RESKEY_Lun_Device [1]="/dev/sdc1"
> $OCF_RESKEY_Lun_Device [2]="/dev/sdc2"
>
> $OCF_RESKEY_LunNum [0]="1"
> $OCF_RESKEY_LunNum [1]="2"
> $OCF_RESKEY_LunNum [2]="3"
>
> This is only a rough sketch of what I am trying to accomplish.  Hopefully I
> haven't confused too many people.  iSCSI Target Framework doesn't seem to be
> very popular within the Linux-HA community.
>
> I will attempt to create an array to allow the administrator to input the
> proper lun number with matching device, but if heartbeat doesn't handle
> arrays very well, then I may need suggestions.  Any would be a great help.
> --
> View this message in context: http://www.nabble.com/OCF-RA-and-BASH-arrays-tp21673993p21673993.html
> Sent from the Linux-HA mailing list archive at Nabble.com.
>
> _______________________________________________
> Linux-HA mailing list
> Linux-HA at lists.linux-ha.org
> http://lists.linux-ha.org/mailman/listinfo/linux-ha
> See also: http://linux-ha.org/ReportingProblems
>


More information about the Linux-HA mailing list