GithubHelp home page GithubHelp logo

thirdmartini / go-nvme Goto Github PK

View Code? Open in Web Editor NEW
2.0 1.0 0.0 80 KB

go-nvme: An NVME/TCP target and client(initiator) in pure go

License: GNU Affero General Public License v3.0

Makefile 0.27% Go 99.73%
go nvme nvme-of nvme-over-fabrics nvme-storage nvme-target nvme-client

go-nvme's Introduction

Disclaimer

Use at your own risk, do not store any data you care about on this target.

This was a proof of concept project to play with the NVME/TCP support in ESX 6.x and is sufficient to run VMs from it. But I would not trust it with my data. There are a lot of mode and log pages that are not supported, and NVME client drivers have become more and more strict about that, so your mileage may vary.

This code base also grew pretty organically as I worked through the NVME specification, so its quite a mess. I'll refactor it one day...

That said feel free to experiment, find bugs, fix issues etc.

What is This?

An implementation fo NVME over TCP target and client in pure golang. Why? Reasons....

Building

$ go build github.com/thirdmartini/go-nvme/cmd/nvmed 

or use the make file

$ make 

To build with CEPH/RBD bridge support:

$ go build --tags ceph,luminous github.com/thirdmartini/go-nvme/cmd/nvmed

Running

Create a configuration file named target.yaml. see config/example.yml

cat targets.yaml:

targets:
 - name: "nqn.2020-20.com.thirdmartini.nvme:null"
   uuid: "2eff04dd-745a-4fc8-9f5f-10432b13a04f"
   type: "null"
   modelname: "ThirdMartini NVME"
   firmwareversion: "1.3.0test"
   serialnumber: "Volume0"
   options:

 - name: "nqn.2020-20.com.thirdmartini.nvme:ceph:volume0"
   uuid: "c5f83782-6bb5-47bc-a78a-b68a5af85974"
   modelname: "cephvolume"
   firmwareversion: "1.0"
   serialnumber: "0000000001"
   type: "rbd"
   options:
     cluster: "ceph"
     user: "admin"
     pool: "rbd"
     image: "volume0"
     
 - name: "nqn.2020-20.com.thirdmartini.nvme:file"
   uuid: "39e92c9c-f486-41e2-812b-4ebbc56665ee"
   type: "file"
   modelname: "file"
   firmwareversion: "1.0"
   type: "file"
   options:
     image: "/data/image.raw"        

Run the target

$ ./nvmed
Local Address: 10.0.0.111
NVME Server: 10.0.0.111:4420
Profiler started at http://10.0.0.111:6060/debug/pprof
    go tool pprof -http :8080 'http://10.0.0.111:6060/debug/pprof/profile?seconds=10'
Registering Target: nqn.2020-20.com.thirdmartini.nvme:ceph:volume0 (rbd)
Registering Target: nqn.2020-20.com.thirdmartini.nvme:null (null)
Registering Target: nqn.2020-20.com.thirdmartini.nvme:file (file)
WEB UI: http://137.184.39.71:8090/

Configuring Clients

To configure and use the target with an initiator, follow the OS/Network card guide that you are using. You can also use the built in NVME/TCP support in linux/vmware documented here:

Debuging

You can enable verbose PDU tracing by running with debug enabled

./nvmed --debug=0xffffffffffffffff

See source code for levels

go-nvme's People

Contributors

thirdmartini avatar

Stargazers

 avatar  avatar

Watchers

 avatar

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.