[SOLVED] iSCSI target stopped working when upgrading to 3.0

martin67

Member
Jun 4, 2013
2
0
21
Hi,

I'm running my Proxmox host as a iSCSI target for some backup purposes. This worked fine in 2.3. But not now when upgrading to 3.0 :(

I use the iscsitarget and iscsitarget-dkms packages. The DKMS packages fails to compile because of missing definitions in linux/blkdev.h:

Code:
  CC [M]  /var/lib/dkms/iscsitarget/1.4.20.2/build/kernel/block-io.o                                                        
/var/lib/dkms/iscsitarget/1.4.20.2/build/kernel/block-io.c: In function ‘blockio_make_request’:                             
/var/lib/dkms/iscsitarget/1.4.20.2/build/kernel/block-io.c:59:18: error: storage size of ‘plug’ isn’t known

Apparently the definition of struct blk_plug is missing from the header files. Digging some more I found that /usr/src/linux-headers-2.6.32-20-pve/include/linux/blkdev.h does not define this. But it was there in the new wheezy kernel that came with 3.0 upgrade (/usr/src/linux-headers-3.2.0-4-common/include/linux/blkdev.h).

More checking found that the problem is really in the iscsitarget-dkms package. There is a patch that fixes the problem above, but the patch is for ver 2.6.38 and not applied. But the patch seems to fix the problems so what I did was to modify the /var/lib/dkms/iscsitarget/1.4.20.2/source/dkms.conf file so that the patch is applied.

Code:
--- dkms.conf.org       2013-06-04 14:49:28.000000000 +0200
+++ dkms.conf   2013-06-04 14:50:26.000000000 +0200
@@ -37,3 +37,5 @@
 PATCH_MATCH[13]="2\.6\.16\.60-.*"
 PATCH[14]="compat-rhel4.patch"
 PATCH_MATCH[14]="2\.6\.9-.*\.(el|plus\.c4)"
+PATCH[15]="compat-2.6.38.patch"
+PATCH_MATCH[15]="2\.6\.(9|14|15|16|17|18|19|20|21|22|23|24|25|26|27|28|29|30|31|32|33|34|35|36|37|38)"

So it works now; can't understand how I got it working for Proxmox 2.3 :D


Maybe this will help someone

//Martin
 

dietmar

Proxmox Staff Member
Staff member
Apr 28, 2005
17,124
521
133
Austria
www.proxmox.com
iscsitarget module 1.4.20.2 is included in our kernel, so why do you want to compile yourself?

Code:
modinfo iscsi_trgt

filename:       /lib/modules/2.6.32-20-pve/kernel/drivers/scsi/iscsi_trgt.ko
author:         IET development team <iscsitarget-devel@lists.sourceforge.net>
description:    iSCSI Enterprise Target
license:        GPL
version:        1.4.20.2
...
 
Last edited by a moderator:

ogg

New Member
Mar 27, 2013
2
0
1
iscsitarget module 1.4.20.2 is included in our kernel, so why do you want to compile yourself?

Code:
modinfo iscsi_trgt

filename:       /lib/modules/2.6.32-20-pve/kernel/drivers/scsi/iscsi_trgt.ko
author:         IET development team <iscsitarget-devel@lists.sourceforge.net>
description:    iSCSI Enterprise Target
license:        GPL
version:        1.4.20.2
...

I'm guessing Martin had the same problem as I did.

When you try to start ietd with the module included in your kernel, you would get a

Code:
root@pvebak02:# ietd -d 8 -f
1370711794.050896: kernel module version mismatch!

and then ietd wouldn't start at all.

To clarify, first apply the patch Martin suggested and then rebuild the module with dkms:

Code:
root@pvebak02:# dkms autoinstall


So thank you Martin! Your post saved me some gray hairs...


--
Olle Gustafsson
 

Trimmings

Member
Nov 5, 2012
53
0
6
This problem exists in a clean install of 3.1 also. What I did, edited /var/lib/dkms/iscsitarget/1.4.20.2/source/dkms.conf in the above instead of running the patch file

deleted the last three lines, added these (don't add the plusses above, these are if run in a patch file);

PATCH_MATCH[13]="2\.6\.16\.60-.*"
PATCH[14]="compat-rhel4.patch"
PATCH_MATCH[14]="2\.6\.9-.*\.(el|plus\.c4)"
PATCH[15]="compat-2.6.38.patch"
PATCH_MATCH[15]="2\.6\.(9|14|15|16|17|18|19|20|21|22|23|24|25|26|27|28|29|30|31|32|33|34|35|36|37|38)"
 
Last edited:

Trimmings

Member
Nov 5, 2012
53
0
6
Which, seems to work for block devices, but if you want to export something like a tape drive this seems to require rawio.

Rawio was written as a patch http://sourceforge.net/p/iscsitarget/patches/14/ but only for iscsitarget-0.4.17

Which, only supports up to 2.6.23 kernels. Yay.

So, looks like right now that since scsi passthrough doesn't work, tape drives are a no go for clients and a drive connected to a proxmox host (unless it seems you run version 1.x lol)
 

eric_f

New Member
Oct 14, 2011
13
0
1
Thank you so very much. I just upgraded to 3.1 and immediately my iSCSI wasn't working. This solved is.
Thanks again.
 

nitocris

New Member
Nov 5, 2013
1
0
1
Code:
apt-get install iscsitarget-dkms

cat<EOF>>/var/lib/dkms/iscsitarget/1.4.20.2/source/dkms.conf
PATCH[15]="compat-2.6.38.patch"
PATCH_MATCH[15]="2\.6\.(9|14|15|16|17|18|19|20|21|22|23|24|25|26|27|28|29|30|31|32|33|34|35|36|37|38)"
EOF

dkms autoinstall


Works magically, thanks
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get your own in 60 seconds.

Buy now!