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

[Xen-devel] [PATCH] v1 - Add exclusive locking option to block-iscsi



Overview

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 = ['script=block-iscsi,vdev=xvda,target=iqn=iqn.1986-03.com.sun:02:mytarget,portal=iscsi.example.com,locktarget=y']

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 ;)

--
Steven Haigh

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

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

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel

 


Rackspace

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