[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] Resend: [PATCH] v3 - Add exclusive locking option to block-iscsi

On 2016-05-09 14:22, Steven Haigh wrote:
On 2016-05-05 15:52, Steven Haigh wrote:
On 2016-05-05 12:32, Steven Haigh wrote:

If you're using iSCSI, you can mount a target by multiple Dom0
machines on the same target. For non-cluster aware filesystems, this
can lead to disk corruption and general bad times by all. The iSCSI
protocol allows the use of persistent reservations as per the SCSI
disk spec. Low level SCSI commands for locking are handled by the
sg_persist program (bundled with sg3_utils package in EL).

The aim of this patch is to create a 'locktarget=y' option specified
within the disk 'target' command for iSCSI to lock the target in
exclusive mode on VM start with a key generated from the local systems
IP, and release this lock on the shutdown of the DomU.

Example Config:
disk            =

In writing this, I have also re-factored parts of the script to put
some things in what I believe to be a better place to make expansion
easier. This is mainly in removing functions that purely call other
functions with no actual code execution.

Signed-off-by: Steven Haigh <netwiz@xxxxxxxxx>

(on a side note, first time I've submitted a patch to the list and I'm
currently stuck on a webmail client, so apologies in advance if this
all goes wrong ;)

Changes in v2:
Bugfix: Call find_device to locate the /dev/sdX component of the iSCSI
target before trying to run unlock_device().

Apologies for this oversight.

Changes in v3:
* Split the block-iscsi cleanup into a seperate patch
* Add locking in second patch file (block-iscsi-locking-v3_02_add_locking.patch)

Resend of patches.

There was a mention of having to add further documentation to xl-disk-configuration.txt - however there are no mentions of block-iscsi script within the documentation to add. As such, it probably would be out of place to add things here.

The locktarget option is presented directly to the block-iscsi script and not evaluated anywhere outside this script.

Steven Haigh

Email: netwiz@xxxxxxxxx
Web: https://www.crc.id.au
Phone: (03) 9001 6090 - 0412 935 897

Attachment: block-iscsi-locking-v3_01_simplify_block-iscsi.patch
Description: Text Data

Attachment: block-iscsi-locking-v3_02_add_locking.patch
Description: Text Data

Xen-devel mailing list



Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.