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

[Xen-devel] pvSCSI test



On Wednesday, February 4, 2015 05:41, Juergen Gross <jgross@xxxxxxxx> wrote:
> To: Kristian Hagsted Rasmussen; Olaf Hering; xen-devel@xxxxxxxxxxxxxxxxxxx
> Subject: Re: pvSCSI test
> 
> On 02/03/2015 07:16 PM, Kristian Hagsted Rasmussen wrote:
>>
>> Hi Olaf and Juergen
>>
>>
>> I am interested in testing pvSCSI as I have a system were it would be ideal.
>> I have tried to apply this patch 
>> "http://marc.info/?l=xen-devel&m=139885599019457&w=2"; called "libbxl: add 
>> support for pvscsi, iteration 1", to my xen-4.5 tree.
>> I am using kernel 3.18.4 compiled with xen-scsiback and xen-scsifront 
>> compiled into the kernel, for both Dom0 and DomU.
>>
>>   My Ubuntu domU is running fine, however the scsi disk I want to pass 
>> through does not appear.
>>
>> in my config I have added the line:
>> vscsi= ['3:0:0:0,0:0:0:0']
>> I have also tried with:
>> vscsi= ['/dev/sdb,0:0:0:0']
>>
>> but no matter which syntax I use I get the following error in dmesg log:
>> xen-pvscsi: 3:0:0:0 doesn't exist
>>
>> I have no errors in the log files for the domU.
>>
>> Am I missing something in my configuration, perhaps some device hiding like 
>> for pci pass through?
> 
> The upstream pvscsi backend is using the target infrastructure. Until
> the tools are aware of this you'll have to configure the device to
> pass to a domain in Dom0 e.g. via a script:
> 
> #!/bin/bash
> # usage:
> # mkpvscsi device
> # e.g. mkpvscsi /dev/sr0
> 
> DEV=$1
> 
> gen_uuid()
> {
>          cat /proc/sys/kernel/random/uuid | \
>         awk '{print "naa.6001405" substr($1,1,8) substr($1,10,1);}'
> }
> 
> TARG=`gen_uuid`
> INIT=`gen_uuid`
> 
> NODE=`lsscsi | awk '$(NF) == "'$DEV'"
>         { print substr($1,2,length($1)-4); }'`
> NAME=`echo $NODE | sed 's/:/_/g'`
> 

I used targetcli to create the pscsi target, so 
skipped from here

> modprobe configfs
> mount -t configfs configfs /sys/kernel/config
> modprobe xen-scsiback
> modprobe target_core_mod

to here 

> cd /sys/kernel/config/target
> 

and here to 

> mkdir -p core/pscsi_0/$NAME
> echo "$DEV" >core/pscsi_0/$NAME/udev_path
> 
to here

> mkdir -p xen-pvscsi/$TARG/tpgt_0
> echo "$NODE" >xen-pvscsi/$TARG/tpgt_0/param/alias
> echo $INIT >xen-pvscsi/$TARG/tpgt_0/nexus
> mkdir xen-pvscsi/$TARG/tpgt_0/lun/lun_0
> 
> cd xen-pvscsi/$TARG/tpgt_0/lun/lun_0
> ln -s ../../../../../../target/core/pscsi_0/$NAME xen-pvscsi_port
> 
> 
> 
> -------------
> 
> After doing this you can use the xen tools to give the device to a domU.
> Please note: this script is untested, I've used a simpler one which
> fitted my needs (using targetcli, which isn't available everywhere).
> I have tested all single steps of the script above, though.

Thanks for the script, I had some problems with the symlinking when
running the script, so tried to make the pscsi in targetcli, and then
shortening the script to skip all script lines concerning the core dir.
This made the script working for me, however I still get:
xen-pvscsi: 3:0:0:0 doesn't exist
error in dmesg log.

Are you using another patch for the xen-tree than the one I listed above?

Thanks Kristian

> Happy testing,
> 
> Juergen
> 
> P.S.: If you are feeling adventurous you can try other target backends
>        than pscsi, e.g. iscsi or fileio.

_______________________________________________
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®.