Merge pull request #1 from ohwebmaster/master

Intial work on Linux-IO iSCSI script
backstore: add non-master/slave monitor to XML metadata

This silences a warning from crmsh stating that the monitor operation may not be
supported.

Signed-off-by: Chris Boot <crb@tiger-computing.co.uk>
backstore: remove some redundant comments

Signed-off-by: Chris Boot <crb@tiger-computing.co.uk>
backstore: first pass at enabling master/slave mode

This is enough to make the resource come up in master mode on one node and slave
on another, which twiddles the ALUA status for the LUN on each node. Not
extensively tested at all.

Signed-off-by: Chris Boot <crb@tiger-computing.co.uk>
Merge pull request #2 from ohwebmaster/master

Support "stop" of iscsi target

Signed-off-by: Chris Boot <crb@tiger-computing.co.uk>
backstore: correct behaviour with fileio backends
backstore: correct a syntax error introduced in the previous commit

Signed-off-by: Chris Boot <crb@tiger-computing.co.uk>
backstore: use ALUA Standby state in slave mode

This converts the backstore RA to use the Standby ALUA state rather than
Active/NonOptimised. It turns out that multipathd with the ALUA hardware handler
uses all active paths, which impacts on performance.

Signed-off-by: Chris Boot <crb@tiger-computing.co.uk>
iscsi: change the format of the 'luns' parameter

Previously, the parameter was a list of luns in <name>=<id> format, leaving no
room to specify the HBA type (iblock was assumed) and, in my opinion, in the
reverse order to what makes sense. This patch changes the format of this
parameter to be <id>:<hba>/<name>, e.g. "0:iblock/test1".

Signed-off-by: Chris Boot <crb@tiger-computing.co.uk>
iscsi: fix stop action with disabled TPGs

If an TPG exists but is already disabled (e.g. because it failed to be enabled
for whatever reason), stopping it fails. Without this commit, the stop action
attempts to disable already disabled TPGs, and doesn't attempt to disable
enabled TPGs.

Signed-off-by: Chris Boot <crb@tiger-computing.co.uk>
backstore: Introduce locking in backstore_start()

There is a critical section in backstore_start() between when we figure out
which HBA is free for us to use, and when we create it. Between these two points
another instance of the same RA can come along and decide to use the same HBA as
us, thus ending up with an HBA with two backing devices in it. This works, but
is a legacy/unsupported configuration, and confuses our stop() function. The
simplest fix is to take a lock before we try to find the HBA to use, and release
it once we have created the HBA.

Signed-off-by: Chris Boot <crb@tiger-computing.co.uk>
backstore: Use an ALUA port group per instance of the RA

When using the default port group (ID 0) on two different nodes in an HA setup,
initiators are confused by the port group being the same on both nodes. For
example multipathd with the ALUA hardware handler confuses the ports on both
targets with each other, and the port state bounces constantly when in failover
state, and nothing works. Using a different port group ID on both sides should
cure the problem.

This commit creates a new port group on the LUN for each instance. The name is
the hostname of the machine the RA is running on, and the ID is 16 + the
instance ID from pacemaker.

Signed-off-by: Chris Boot <crb@tiger-computing.co.uk>
iscsi: minor cleanups

Fix a typo in the XML metadata, some trailing whitespace and remove a debugging
statement I left behind while changing the format of the luns parameter.

Signed-off-by: Chris Boot <crb@tiger-computing.co.uk>