GithubHelp home page GithubHelp logo

sebastiangraf / jscsi Goto Github PK

View Code? Open in Web Editor NEW
59.0 59.0 28.0 68.76 MB

A Java iSCSI Framework

Home Page: http://jscsi.org

License: BSD 3-Clause "New" or "Revised" License

Java 98.34% AspectJ 0.52% CSS 0.07% XSLT 0.27% Shell 0.10% Makefile 0.07% C 0.43% HTML 0.20%

jscsi's People

Contributors

aymandf avatar buptunixguys avatar dsu-igeek avatar elek avatar gaul avatar gorky avatar kahing avatar saenridanra avatar sebastiangraf avatar takahirox avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

jscsi's Issues

MacOS 3rd party initiators like globalSAN and ATTO Xtend

Hello There,

First of all I want to thank you guys for doing this freaking awesome work!

In my project I needed to use just the Target component of your package. Hence I was able to download your source and run it as server.

It worked !!!!great!!!! to expose my data files as disks using Microsoft iSCSI initiator and Linux open-iscsi initiators (which I verified on Ubuntu 12.04).

However I had trouble making it work right out of the box using MacOS Third Party initiators. One of them is called globalSAN and other is called ATTO XTend.

While I am debugging this problem and collecting some debug logs on the server side I was wondering if you guys got chance to test it on the MAC side. Also just wondering is jSCSI suppose to work with other 3rd party initiators.

Cheers!

Target Compatibility

What about the compatibility of the jSCSI Target?

I tried with VirtualBox 4.2.18 and wasn't able to connect. The error is: "The D field is reserved in this ISID Format."

I tried to change the code so that this error is ignored, but then I get "Recieved unsupported opcode for LOGIN_REQUEST" and later a java.io.IOException that the host disconnected. I didn't setup any login in virtualbox.

Virtualbox writes:

  • VirtualBox's iSCSI support has been developed according to the iSCSI standard and should work with all standard-conforming iSCSI targets. To use an iSCSI target with VirtualBox, you must use the command line; see Section 8.18, “VBoxManage storageattach”.
    (http://www.virtualbox.org/manual/ch05.html#storage-iscsi)

Does anyone successfully use jSCSI with VirtualBox?

Btw: There is a spelling mistake in the word "Recieved"

Read Capacity reports total # of blocks, not address of last block

I've been getting reads past the end of my device from the Linux iSCSI initiator and the size reported in the log when login to the device occurs is the number of blocks + 1. The ReadCapacityStage uses the AbstractStorageModule.getSizeInBlocks() as the
returned LBA and I think it should be using getSizeInBlocks() - 1, the address of the last addressable block.

This man page explains the behavior, http://manpages.ubuntu.com/manpages/dapper/man8/sg_readcap.8.html.

If you agree, I'll submit a fix for this. It may require some changes on the initiator side as well but I'm not using that at the moment so I haven't dug too deeply into it.

JCloudsStorageModule is not closing blob file.

I think I found a issue at JCloudsStorageModule (http://grepcode.com/file/repo1.maven.org/maven2/org.jscsi/target/2.5.2/org/jscsi/target/storage/JCloudsStorageModule.java?av=f), it is not closing the "data = ByteStreams.toByteArray(blob.getPayload().getInput());"

if you guys agree it could be change to :
data = ByteStreams2.toByteArrayAndClose(blob.getPayload().getInput());

or

InputStream inputStream = null;
try {
inputStream = blob.getPayload().getInput();
data = ByteStreams.toByteArray(inputStream);
} finally {
if (inputStream != null) {
inputStream.close();
}
}

I got this error "too many files open" when I was testing a 400Gb copy.

Running Target Issue

Hi,

I wanting to work with the library to create a virtual iSCSI interface for a project. I cant seem to get it to work. Everything compiles fine, it executes, asks for the IP etc.

As soon as i try to connect to it, it throws 1000's of errors (as below).

17:04:02.449 [main] ERROR o.j.t.c.Connection$TargetConnection - Exception throws
java.io.IOException: Connection reset by peer
at sun.nio.ch.FileDispatcherImpl.read0(Native Method) ~[na:1.7.0_55]
at sun.nio.ch.SocketDispatcher.read(SocketDispatcher.java:39) ~[na:1.7.0_55]
at sun.nio.ch.IOUtil.readIntoNativeBuffer(IOUtil.java:223) ~[na:1.7.0_55]
at sun.nio.ch.IOUtil.read(IOUtil.java:197) ~[na:1.7.0_55]
at sun.nio.ch.SocketChannelImpl.read(SocketChannelImpl.java:379) ~[na:1.7.0_55]
at org.jscsi.parser.ProtocolDataUnit.read(ProtocolDataUnit.java:356) ~[target-2.5.3-SNAPSHOT-jar-with-dependencies.jar:na]
at org.jscsi.target.connection.TargetSenderWorker.receiveFromWire(TargetSenderWorker.java:133) ~[target-2.5.3-SNAPSHOT-jar-with-dependencies.jar:na]
at org.jscsi.target.connection.Connection$TargetConnection.receivePdu(Connection.java:169) [target-2.5.3-SNAPSHOT-jar-with-dependencies.jar:na]
at org.jscsi.target.connection.phase.TargetFullFeaturePhase.execute(TargetFullFeaturePhase.java:82) ~[target-2.5.3-SNAPSHOT-jar-with-dependencies.jar:na]
at org.jscsi.target.connection.Connection$TargetConnection.call(Connection.java:225) [target-2.5.3-SNAPSHOT-jar-with-dependencies.jar:na]
at org.jscsi.target.connection.Connection$TargetConnection.call(Connection.java:66) [target-2.5.3-SNAPSHOT-jar-with-dependencies.jar:na]
at org.jscsi.target.TargetServer.call(TargetServer.java:242) [target-2.5.3-SNAPSHOT-jar-with-dependencies.jar:na]
at org.jscsi.target.TargetServer.main(TargetServer.java:192) [target-2.5.3-SNAPSHOT-jar-with-dependencies.jar:na]

has anyone seen this before? Your help is much appreciated.

TSIH (Target Session Identifying Handle) is missing?

Hello,
I wonder to know about the commentary at https://github.com/sebastiangraf/jSCSI/blob/master/bundles/target/src/main/java/org/jscsi/target/TargetServer.java#L232
It says about TSIH that should be implemented at the future. I would like to help to implement it based at http://www.ietf.org/rfc/rfc3720.txt:

  • TSIH (Target Session Identifying Handle): A target assigned tag for
    a session with a specific named initiator. The target generates it
    during session establishment. Its internal format and content are
    not defined by this protocol, except for the value 0 that is
    reserved and used by the initiator to indicate a new session. It
    is given to the target during additional connection establishment
    for the same session.
    Based on the RFC 3720 I should get the session IDs and build these actions:

+------------------------------------------------------------------+
|ISID | TSIH | CID | Target action |
+------------------------------------------------------------------+
|new | non-zero | any | fail the login |
+------------------------------------------------------------------+
|new | zero | any | instantiate a new session |
+------------------------------------------------------------------+
|existing | zero | any | do session reinstatement |
+------------------------------------------------------------------+
|existing | non-zero | new | add a new connection to |
+------------------------------------------------------------------+
|existing | non-zero |existing| do connection reinstatement|
+------------------------------------------------------------------+
|existing | non-zero | any | fail the login |
+------------------------------------------------------------------+

Looks like the TargetSession has the ISID and TSIH but CID (ConnectionID) where is?
Am I correct? Could you give me any advice? Like if I have to create new classes? Which methods?
Thanks in advanced. Felipe

I think I found a bug at JCloudStorageModule

Hi,

I was executing Virtual Machines at jscsi and I got some bug at the JCloudStorageModule. The method storeBucket has to verify if the bucketId has different byte array.

https://github.com/sebastiangraf/jSCSI/blob/master/bundles/target/src/main/java/org/jscsi/target/storage/JCloudsStorageModule.java#L261

I change the IF for this:

if ((lastIndexWritten != pBucketId && lastBlobWritten != null) || (lastIndexWritten == pBucketId && !Arrays.equals(lastBlobWritten, pData) && lastBlobWritten != null)) {

I don't know if you agree. Maybe I could commit this on your code if you agree.

Thanks,
Felipe

Target as Callable

The target should be switched from a Process to a Callable reading all their own configurations

How to compile?

Unfortunately, I wasn't able to build this project:

me$ cd bundles/target

me$ mvn assembly:single
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Building Target
[INFO]    task-segment: [assembly:single]
[INFO] ------------------------------------------------------------------------
[INFO] [assembly:single {execution: default-cli}]
[INFO] Reading assembly descriptor: src/main/assembly/jarAssembly.xml
[WARNING] Cannot include project artifact: org.jscsi:target:jar:2.5.1-SNAPSHOT; it doesn't have an associated file or directory.
[INFO] Building jar: /daten/Projects/extPrj/jSCSI/jSCSI/bundles/target/target/target-2.5.1-SNAPSHOT-jar-with-dependencies.jar
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESSFUL
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 6 seconds
[INFO] Finished at: Thu Oct 31 11:48:23 CET 2013
[INFO] Final Memory: 30M/73M
[INFO] ------------------------------------------------------------------------

me$ find -name *.jar
./target/target-2.5.1-SNAPSHOT-jar-with-dependencies.jar

me$ java -jar target/target-2.5.1-SNAPSHOT-jar-with-dependencies.jar 
Error: Could not find or load main class org.jscsi.target.TargetServer

me$ jar -tf target/target-2.5.1-SNAPSHOT-jar-with-dependencies.jar |  grep TargetServer
src/main/java/org/jscsi/target/TargetServer.java

me$

It seems the source files are included into the target jar without compiling. Do I have to invoke another command (didn't find any recent doc about compiling) or is there a bug in the pom.xml (same happened with tag pom-2.5). I only need target.

Initiator not working with IET

The initiator at the moment fails when working with the ISCSI Enterprise Target. The problem is the response from the ReadCapacityState which is a SCSIResponse.

Is this an issue of Initiator?

I was just testing the target(on Linux, dd if=/dev/zero of=volumeOfTargte ) when the target encounter the exception blow.
I think It may be caused by initiator error. But I am not sure and do not know why
Has anyone ever meet this?

104543 [pool-1-thread-1] ERROR org.jscsi.target.connection.phase.TargetFullFeaturePhase - Recieved unsupported opcode for LOGIN_REQUEST
104544 [pool-1-thread-1] ERROR org.jscsi.target.connection.phase.TargetFullFeaturePhase - Recieved unsupported opcode for LOGIN_REQUEST
104544 [pool-1-thread-1] ERROR org.jscsi.target.connection.Connection$TargetConnection - Exception throws
java.io.IOException: Broken pipe
at sun.nio.ch.FileDispatcherImpl.write0(Native Method)
at sun.nio.ch.SocketDispatcher.write(SocketDispatcher.java:47)
at sun.nio.ch.IOUtil.writeFromNativeBuffer(IOUtil.java:93)
at sun.nio.ch.IOUtil.write(IOUtil.java:65)
at sun.nio.ch.SocketChannelImpl.write(SocketChannelImpl.java:487)
at org.jscsi.parser.ProtocolDataUnit.write(ProtocolDataUnit.java:332)
at org.jscsi.target.connection.TargetSenderWorker.sendOverWire(TargetSenderWorker.java:220)
at org.jscsi.target.connection.Connection$TargetConnection.sendPdu(Connection.java:200)
at org.jscsi.target.connection.stage.fullfeature.UnsupportedOpCodeStage.execute(UnsupportedOpCodeStage.java:60)
at org.jscsi.target.connection.phase.TargetFullFeaturePhase.execute(TargetFullFeaturePhase.java:173)
at org.jscsi.target.connection.Connection$TargetConnection.call(Connection.java:225)
at org.jscsi.target.connection.Connection$TargetConnection.call(Connection.java:66)
at org.jscsi.target.TargetServer.call(TargetServer.java:242)
at org.jscsi.target.TargetServer.call(TargetServer.java:44)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:744)
107799 [pool-1-thread-1] ERROR org.jscsi.target.connection.stage.fullfeature.InquiryStage - illegal INQUIRY request

TargetServer requires user input to start

Presently TargetServer emits:

This system provides more than one IP Address to advertise.

[0] 172.17.42.1
[1] fe80:0:0:0:6676:baff:fe92:27c6%wlan0
[2] 192.168.1.73
[3] 0:0:0:0:0:0:0:1%lo
[4] 127.0.0.1

and requires user input to proceed. Instead it should read this value from the config file.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.