# Persistent reservation support for iSCSI target



## zsolte (Nov 6, 2013)

Hello,

Does anyone know if SCSI VPD 83h and PR support will be developed for the FreeBSD 10 iSCSI target, which support would enable a FreeBSD iSCSI target block device to be used as a cluster disk under Windows failover clustering?

Thanks,
Zsolt


----------



## Jimlad (Dec 7, 2013)

Hello,

Has this been answered elsewhere? I'm very interested in knowing if SCSI-3 Persistent Reservation will be part of the "native" iSCSI implementation in 10-RELEASE.

Regards,
James


----------



## trasz@ (Apr 5, 2014)

Yes, persistent reservations are supported in the native iSCSI target (ctld et al).  Note that there were two bugs breaking things with Hyper-V Failover Cluster; one of them was already fixed in 10-STABLE, the other will be soon.


----------



## Jimlad (May 11, 2014)

Thanks Trasz@, do you have the PR numbers for the bugs?


----------



## trasz@ (May 12, 2014)

Not really; both come up in private communication.


----------



## Sebulon (May 30, 2014)

Hi @trasz@!

I´m struggilng making sense of using ctld together with Windows 2012R2, presenting a lun to multiple initiators to create a Cluster Shared Volume (CSV). If using istgt, it does present itself and you are able to create the CSV but it fails cluster validation on persistent reservations. If i stop istgt and instead fire up ctld serving the exact same volume (a ZVOL), you cannot create the CSV at all, it doesn´t show up as a resource to create the volume with. Tried setting up the CSV manually through cmd.exe gave:

```
cluster res "res1" /create /group:"Available Storage" /type:"Physical Disk"
cluster res "res1" /priv diskpath="Q:"
cluster res "res1" /on
Error 1069: Cluster resource 'res1' of type 'Physical Disk' in clustered role 'Available Storage' failed. The error code was '0x2' ('The system cannot find the file specified.').
```

My goal would be to have FreeBSD with ctld as a backing store for running Hyper-V virtualization in Windows 2012R2.

I have seen that work has been done (by you even) making ctld stable together with Microsoft Failover Cluster and so this machine has been upped to 10-STABLE (r266795), but I just can´t seem to figure out how to get this working. No problems initiating the target from both hosts, partitioning, creating filesystem, copying and such, but no dice creating the CSV to use together with Hyper-V.

Any pointers on how to get the CSV part sorted?

/Sebulon


----------



## trasz@ (Jun 17, 2014)

Sorry for the delay; I had some other duties lately.  I believe the problem you're seeing is due to missing item in VPD page returned by the target.  I've just committed a fix, see http://svnweb.freebsd.org/base?view=rev ... ion=267547.  This helps with Hyper-V Failover Cluster, and I believe it should also fix your case.  MFC to 10-STABLE is expected in two weeks or so.

Note that in 11-CURRENT there is also support for COMPARE AND WRITE SCSI command, which should help with shared volumes performance, at least with initiators that support it, such as ESX.


----------



## Sebulon (Jun 19, 2014)

trasz@ said:
			
		

> Sorry for the delay; I had some other duties lately.  I believe the problem you're seeing is due to missing item in VPD page returned by the target.  I've just committed a fix, see http://svnweb.freebsd.org/base?view=rev ... ion=267547.  This helps with Hyper-V Failover Cluster, and I believe it should also fix your case.  MFC to 10-STABLE is expected in two weeks or so.



That. Sounds. Awesome! Can´t wait to test it 

Is there some way to know exactly when it gets merged, or do I just wait?

/Sebulon


----------



## trasz@ (Aug 4, 2014)

I keep forgetting about this thread, sorry.  Anyway: it was merged about month ago.


----------



## Sebulon (Aug 27, 2014)

Hey @trasz@!

No worries man, been on vacation over the summer. Now that I´m back again I updated the source, rebooted the machine and tried again. The disk showed up just like it should, got the CSV created and passed all disk tests, no problems. Awesome job! Thanks!


```
Storage
Name															Result		Description
List Disks													✓			  Success
List Disks To Be Validated							  ✓		 	 Success
Validate CSV Network Bindings						  ✓			  Success
Validate CSV Settings								    ✓			  Success
Validate Disk Access Latency							✓			  Success
Validate Disk Arbitration							   ✓			  Success
Validate Disk Failover								   ✓			  Success
Validate File System									  ✓			  Success
Validate Microsoft MPIO-based disks				  ✓			  Success
Validate Multiple Arbitration						  ✓			  Success
Validate SCSI device Vital Product Data (VPD)	 ✓			  Success
Validate SCSI-3 Persistent Reservation			  ✓			  Success
Validate Simultaneous Failover						 ✓			  Success
Validate Storage Spaces Persistent Reservation	✓			  Success
```

FreeBSD-10.1-RELEASE is going to be 'da bomb'  

/Sebulon


----------



## trasz@ (Aug 28, 2014)

Thanks!


----------

