Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
N
nmvetcli-mirror
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
JetBrains YouTrack
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
KSZK
Sysadmin
Archived
nmvetcli-mirror
Commits
c5b36ff0
Commit
c5b36ff0
authored
9 years ago
by
Christoph Hellwig
Browse files
Options
Downloads
Patches
Plain Diff
update README and examples
Signed-off-by:
Christoph Hellwig
<
hch@lst.de
>
parent
5ad1da24
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
README.md
+52
-7
52 additions, 7 deletions
README.md
loop.json
+44
-0
44 additions, 0 deletions
loop.json
rdma.json
+42
-0
42 additions, 0 deletions
rdma.json
with
138 additions
and
7 deletions
README.md
+
52
−
7
View file @
c5b36ff0
...
...
@@ -25,16 +25,13 @@ configfs is mounted on /sys/kernel/config, using:
mount -t configs none /sys/kernel/config
You can load the default config that exports the first NVMe device and
the first ramdisk by running "nvmetcli restore nvmet.json". The default
config is stored in /etc/nvmet.json. You can also edit the json file
directly.
To get started with the interactive mode start nvmetcli without
arguments. Then in the nvmetcli prompt type:
#
# Create a subsystem. If you do not specify a name a NQN will be generated.
# Create a subsystem. If you do not specify a name a NQN will be generated,
# which is probably the best choice, we we don't do it here as the name
# would be random
#
> cd /subsystems
...
...
@@ -55,6 +52,20 @@ arguments. Then in the nvmetcli prompt type:
...> cd /subsystems/testnqn/
...> set attr allow_any_host=1
#
# Create a port through which access is allowed, and enable access to
# a subsystem through it.
#
# This creates a trivial loopback port that can be used with nvme-loop on
# the same machine:
#
...> cd /ports/
...> create 1
...> cd 1/
...> set addr trtype=loop
...> cd subsystems/
...> create testnqn
#
# Create a new namespace. If you do not specify a namespace ID the fist
# unused one will be used.
...
...
@@ -63,9 +74,43 @@ arguments. Then in the nvmetcli prompt type:
...> cd namespaces
...> create 1
...> cd 1
...> set device path=/dev/
ram
1
...> set device path=/dev/
nvme0n
1
...> enable
#
# Or create a RDMA (IB, RoCE, iWarp) port using IPv4 addressing, 4420 is the
# IANA assigned port for NVMe over Fabrics using RDMA:
#
...> cd /ports/
...> create 2
...> cd 2/
...> set addr trtype=rdma
...> set addr adrfam=ipv4
...> set addr traddr=192.168.6.68
...> set addr trsvcid=4420
...> cd subsystems/
...> create testnqn
Saving and restoring the configuration
--------------------------------------
The saveconfig and restoreconfig commands inside nvmetcli save and restore
the current configuration, but you can also invoke these commands for the
command line using the load and restore arguments to nvmetcli. Without
an additional file name these operate on /etc/nvmet.json.
To load the loop + explicit host version above do the following:
./nvmetcli load loop.json
Or to load the rdma + no host authentication version do the following
after you've ensured that the IP address in rdma.json fits your setup:
./nvmetcli load rdma.json
You can also edit the json files directly.
Testing
-------
...
...
This diff is collapsed.
Click to expand it.
loop.json
0 → 100644
+
44
−
0
View file @
c5b36ff0
{
"hosts"
:
[
{
"nqn"
:
"hostnqn"
}
],
"ports"
:
[
{
"addr"
:
{
"adrfam"
:
""
,
"traddr"
:
""
,
"treq"
:
"not specified"
,
"trsvcid"
:
""
,
"trtype"
:
"loop"
},
"portid"
:
1
,
"referrals"
:
[],
"subsystems"
:
[
"testnqn"
]
}
],
"subsystems"
:
[
{
"allowed_hosts"
:
[
"hostnqn"
],
"attr"
:
{
"allow_any_host"
:
"0"
},
"namespaces"
:
[
{
"device"
:
{
"nguid"
:
"ef90689c-6c46-d44c-89c1-4067801309a8"
,
"path"
:
"/dev/nvme0n1"
},
"enable"
:
1
,
"nsid"
:
1
}
],
"nqn"
:
"testnqn"
}
]
}
This diff is collapsed.
Click to expand it.
nvmet
.json
→
rdma
.json
+
42
−
0
View file @
c5b36ff0
{
"hosts"
:
[],
"hosts"
:
[
{
"nqn"
:
"hostnqn"
}
],
"ports"
:
[
{
"addr"
:
{
"adrfam"
:
"ipv4"
,
"traddr"
:
"192.168.
7
.68"
,
"traddr"
:
"192.168.
6
.68"
,
"treq"
:
"not specified"
,
"trsvcid"
:
"
1023
"
,
"trsvcid"
:
"
4420
"
,
"trtype"
:
"rdma"
},
"portid"
:
2
,
"referrals"
:
[],
"subsystems"
:
[
"
nqn.2014-08.org.nvmexpress:NVMf:uuid:77dca664-0d3e-4f67-b8b2-04c70e3f991d
"
"
testnqn
"
]
}
],
...
...
@@ -24,22 +29,14 @@
"namespaces"
:
[
{
"device"
:
{
"nguid"
:
"
289ae029-c396-3143-87e8-aec0d7a4b1
a8"
,
"nguid"
:
"
ef90689c-6c46-d44c-89c1-4067801309
a8"
,
"path"
:
"/dev/nvme0n1"
},
"enable"
:
1
,
"nsid"
:
1
},
{
"device"
:
{
"nguid"
:
"8a6a2e57-1a2d-2b41-8938-bc409c4ebb6c"
,
"path"
:
"/dev/ram0"
},
"enable"
:
0
,
"nsid"
:
2
}
],
"nqn"
:
"
nqn.2014-08.org.nvmexpress:NVMf:uuid:77dca664-0d3e-4f67-b8b2-04c70e3f991d
"
"nqn"
:
"
testnqn
"
}
]
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment