LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 11-20-2019, 06:31 AM   #1
stivraboti
LQ Newbie
 
Registered: Nov 2019
Posts: 5

Rep: Reputation: Disabled
Question Enable persistent reservations for iSCSI volumes


Hi,

I have configured iSCSI LUNs (targets) on Deiban 9 using targetcli-fb. Everything is working as expected. The problem comes when I try to use the LUNs as cluster storage for Xen or MS SQL - they require persistent reservations. I have installed sg3-utils to try to use sg_persist to turn on persistence for my targets/volumes but without any luck (I am really new to the iSCSI scene). I wen thru the man page for sg_persist, but I am struggling understanding its concept.

My LUNs are using FILEIO images and the images are located in /mystorage.
Here is what I've tried so far:
Code:
root@[REDACTED]~# sg_persist --in --report-capabilities -v /dev/vdb
    inquiry cdb: 12 00 00 00 24 00
inquiry: scsi status: Unknown status [0x7e]
sg_persist: /dev/vdb doesn't respond to a SCSI INQUIRY
Code:
root@[REDACTED] ~# sg_persist --in --report-capabilities -v /storage
    inquiry cdb: 12 00 00 00 24 00
inquiry: pass through os error: Inappropriate ioctl for device
sg_persist: /storage doesn't respond to a SCSI INQUIRY
Code:
root@[REDACTED] ~# sg_persist --device=/dev/vdb
>> No service action given; assume Persistent Reserve In command
>> with Read Keys service action
inquiry: scsi status: Unknown status [0x7e]
sg_persist: /dev/vdb doesn't respond to a SCSI INQUIRY
Code:
root@[REDACTED] ~# sg_persist --out --register --param-sark=123test /dev/vdb
inquiry: scsi status: Unknown status [0x7e]
sg_persist: /dev/vdb doesn't respond to a SCSI INQUIRY
Code:
root@[REDACTED] ~# sg_persist --out --register --param-sark=123test /storage/vol01.img
inquiry: pass through os error: Inappropriate ioctl for device
sg_persist: /storage/vol01.img doesn't respond to a SCSI INQUIRY
Here are more details:
- My /storage folder is located on: /dev/vdb/storage (LVM)
- System: Linux [REDACTED] 4.9.0-8-amd64 #1 SMP Debian 4.9.110-3+deb9u4 (2018-08-21) x86_64 GNU/Linux
- Targetcli version: targetcli version 2.1.fb43
- My initiators are on Windows Server 2019 (SQL 2017)

Code:
root@[REDACTED] ~# cat /sys/kernel/config/target/core/fileio_0/[REDACTED]/pr/res_*
APTPL Bit Status: Disabled
Ready to process PR APTPL metadata..
No SPC-3 Reservation holder
No SPC-3 Reservation holder
0x0000002d
No SPC-3 Reservation holder
SPC-3 PR Registrations:
iSCSI Node: iqn.[REDACTED],i,0x400001370000 Key: [REDACTED] PRgen: 0x0000002c
No SPC-3 Reservation holder
SPC3_PERSISTENT_RESERVATIONS
Some general guidance will mean a lot!

Last edited by stivraboti; 11-20-2019 at 06:36 AM. Reason: Added more tests.
 
Old 11-20-2019, 05:14 PM   #2
smallpond
Senior Member
 
Registered: Feb 2011
Location: Massachusetts, USA
Distribution: Fedora
Posts: 4,147

Rep: Reputation: 1264Reputation: 1264Reputation: 1264Reputation: 1264Reputation: 1264Reputation: 1264Reputation: 1264Reputation: 1264Reputation: 1264
Testing PR using sg_persist needs to be done from the client, not on the target. It is implemented in the target code, so is only available over the network. See file drivers/target/target_core_pr.c.

Example calls can be found here: http://www.linux-iscsi.org/wiki/Persistent_Reservations
 
1 members found this post helpful.
Old 11-21-2019, 03:04 AM   #3
stivraboti
LQ Newbie
 
Registered: Nov 2019
Posts: 5

Original Poster
Rep: Reputation: Disabled
EDIT: Duplicated answer.

Last edited by stivraboti; 11-21-2019 at 07:05 AM. Reason: EDIT: Duplicated answer.
 
Old 11-21-2019, 03:14 AM   #4
stivraboti
LQ Newbie
 
Registered: Nov 2019
Posts: 5

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by smallpond View Post
Testing PR using sg_persist needs to be done from the client, not on the target. It is implemented in the target code, so is only available over the network. See file drivers/target/target_core_pr.c.

Example calls can be found here: http://www.linux-iscsi.org/wiki/Persistent_Reservations
Thank you for your reply.
If the persistence mode has to be triggered from the client, don't I have to configure APTPL Bit Status: Disabled from the server/target to Enabled? I have researched it, but not sure how to do it.
 
Old 11-24-2019, 04:57 PM   #5
smallpond
Senior Member
 
Registered: Feb 2011
Location: Massachusetts, USA
Distribution: Fedora
Posts: 4,147

Rep: Reputation: 1264Reputation: 1264Reputation: 1264Reputation: 1264Reputation: 1264Reputation: 1264Reputation: 1264Reputation: 1264Reputation: 1264
Why do you need to enable that? Are your servers not on UPS?
 
Old 11-25-2019, 07:52 AM   #6
stivraboti
LQ Newbie
 
Registered: Nov 2019
Posts: 5

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by smallpond View Post
Why do you need to enable that? Are your servers not on UPS?
When I run MS cluster validation report it says that persistent reservation is not enabled.
 
Old 11-25-2019, 10:38 AM   #7
smallpond
Senior Member
 
Registered: Feb 2011
Location: Massachusetts, USA
Distribution: Fedora
Posts: 4,147

Rep: Reputation: 1264Reputation: 1264Reputation: 1264Reputation: 1264Reputation: 1264Reputation: 1264Reputation: 1264Reputation: 1264Reputation: 1264
There is no enable. Byte 2 of the inquiry data gives the SCSI version that is supported.
Code:
03 - SPC    SCSI-2 reservations
04 - SPC-2  basic PR
05 - SPC-3  multi-initiator PR
 
1 members found this post helpful.
Old 11-26-2019, 03:17 AM   #8
stivraboti
LQ Newbie
 
Registered: Nov 2019
Posts: 5

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by smallpond View Post
There is no enable. Byte 2 of the inquiry data gives the SCSI version that is supported.
Code:
03 - SPC    SCSI-2 reservations
04 - SPC-2  basic PR
05 - SPC-3  multi-initiator PR
Thank you for the clarification.
I managed to bypass the validation by creating the /var/target/pr folder manually. Everything is okay now.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Resizing large iSCSI volumes on CentOS lancherider Linux - Server 2 08-20-2013 01:29 PM
[SOLVED] pacemaker - iscsi: how to set up iscsi targets/logical units? eantoranz Linux - Server 9 01-02-2013 08:38 AM
Persistent persistent Persistent Going Nuts Here Fcukinyahoo Linux - Newbie 6 11-17-2011 09:56 PM
changes on other iscsi nodes attached to an ext3 iscsi target not being seen sldahlin Linux - Server 1 06-07-2008 02:02 AM
can linux dhcp do reservations? Court-Jester Linux - Networking 2 10-12-2006 12:52 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 06:46 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration