xref: /spdk/doc/jsonrpc.md (revision cf4e8664bb3c88151bc31420bec430263d580f3d)
1# JSON-RPC {#jsonrpc}
2
3## Overview {#jsonrpc_overview}
4
5SPDK implements a [JSON-RPC 2.0](http://www.jsonrpc.org/specification) server
6to allow external management tools to dynamically configure SPDK components.
7
8## Parameters
9
10Most of the commands can take parameters. If present, parameter is validated against its domain. If this check fail
11whole command will fail with response error message [Invalid params](@ref jsonrpc_error_message).
12
13### Required parameters
14
15These parameters are mandatory. If any required parameter is missing RPC command will fail with proper error response.
16
17### Optional parameters
18
19Those parameters might be omitted. If an optional parameter is present it must be valid otherwise command will fail
20proper error response.
21
22## Error response message {#jsonrpc_error_message}
23
24Each error response will contain proper message. As much as possible the message should indicate what went wrong during
25command processing.
26
27There is ongoing effort to customize this messages but some RPC methods just return "Invalid parameters" as message body
28for any kind of error.
29
30Code   | Description
31------ | -----------
32-1     | Invalid state - given method exists but it is not callable in [current runtime state](@ref rpc_framework_start_init)
33-32600 | Invalid request - not compliant with JSON-RPC 2.0 Specification
34-32601 | Method not found
35-32602 | @ref jsonrpc_invalid_params
36-32603 | Internal error for e.g.: errors like out of memory
37-32700 | @ref jsonrpc_parser_error
38
39### Parser error {#jsonrpc_parser_error}
40
41Encountered some error during parsing request like:
42
43- the JSON object is malformed
44- parameter is too long
45- request is too long
46
47### Invalid params {#jsonrpc_invalid_params}
48
49This type of error is most common one. It mean that there is an error while processing the request like:
50
51- Parameters decoding in RPC method handler failed because required parameter is missing.
52- Unknown parameter present encountered.
53- Parameter type doesn't match expected type e.g.: given number when expected a string.
54- Parameter domain check failed.
55- Request is valid but some other error occurred during processing request. If possible message explains the error reason nature.
56
57## rpc.py {#rpc_py}
58
59SPDK provides a set of Python scripts which can invoke the JSON-RPC methods described in this document.  'rpc.py' in the scripts
60directory is the main script that users will invoke to execute a JSON-RPC method. The scripts/rpc directory contains modules
61that 'rpc.py' imports for definitions of each SPDK library's or module's methods.
62
63Example:
64
65~~~bash
66scripts/rpc.py bdev_nvme_attach_controller -b nvme0 -a 00:02.0 -t pcie
67~~~
68
69A brief description of each of the RPC methods and optional 'rpc.py' arguments can be viewed with:
70
71~~~bash
72scripts/rpc.py --help
73~~~
74
75A detailed description of each RPC method and its parameters is also available.  For example:
76
77~~~bash
78scripts/rpc.py bdev_nvme_attach_controller --help
79~~~
80
81### Generate JSON-RPC methods for current configuration {#jsonrpc_generate}
82
83An initial configuration can be specified for an SPDK application via the '-c' command line parameter.
84The configuration file is a JSON file containing all of the JSON-RPC method invocations necessary
85for the desired configuration. Writing these files by hand is extremely tedious however, so 'rpc.py'
86provides a mechanism to generate a JSON-RPC file based on the current configuration.
87
88~~~bash
89scripts/rpc.py save_config > config.json
90~~~
91
92'config.json' can then be passed to a new SPDK application using the '-c' command line parameter
93to reproduce the same configuration.
94
95### JSON-RPC batching
96
97'rpc.py' also supports batching of multiple JSON-RPC methods with one invocation.  So instead of
98calling 'rpc.py' once for each JSON-RPC method, such as:
99
100~~~bash
101scripts/rpc.py bdev_malloc_create -b malloc0 64 512
102scripts/rpc.py nvmf_create_subsystem nqn.2016-06.io.spdk:cnode1 -a
103scripts/rpc.py nvmf_subsystem_add_ns nqn.2016-06.io.spdk:cnode1 malloc0
104scripts/rpc.py nvmf_create_transport -t tcp
105scripts/rpc.py nvmf_subsystem_add_listener nqn.2016-06.io.spdk:cnode1 -t tcp -a 127.0.0.1 -s 4420
106~~~
107
108you can put the following into a text file:
109
110~~~bash
111bdev_malloc_create -b malloc0 64 512
112nvmf_create_subsystem nqn.2016-06.io.spdk:cnode1 -a
113nvmf_subsystem_add_ns nqn.2016-06.io.spdk:cnode1 malloc0
114nvmf_create_transport -t tcp
115nvmf_subsystem_add_listener nqn.2016-06.io.spdk:cnode1 -t tcp -a 127.0.0.1 -s 4420
116~~~
117
118and then just do:
119
120~~~bash
121scripts/rpc.py < rpc.txt
122~~~
123
124### Adding external RPC methods
125
126SPDK includes both in-tree modules as well as the ability to use external modules.  The in-tree modules include some python
127scripts to ease the process of sending RPCs to in-tree modules.  External modules can utilize this same framework to add new RPC
128methods as follows:
129
130If PYTHONPATH doesn't include the location of the external RPC python script, it should be updated:
131
132~~~bash
133export PYTHONPATH=/home/user/plugin_example/
134~~~
135
136In provided location, create python module file (e.g. rpc_plugin.py) with new RPC methods.  The file should contain
137spdk_rpc_plugin_initialize() method that will be called when the plugin is loaded to define new parsers for provided subparsers
138argument that adds new RPC calls (subparsers.add_parser()).  The new parsers should use the client.call() method to call RPC
139functions registered within the external module using the SPDK_RPC_REGISTER() macro.  Example:
140
141~~~python
142from spdk.rpc.client import print_json
143
144
145def example_create(client, num_blocks, block_size, name=None, uuid=None):
146    """Construct an example block device.
147
148    Args:
149        num_blocks: size of block device in blocks
150        block_size: block size of device; must be a power of 2 and at least 512
151        name: name of block device (optional)
152        uuid: UUID of block device (optional)
153
154    Returns:
155        Name of created block device.
156    """
157    params = {'num_blocks': num_blocks, 'block_size': block_size}
158    if name:
159        params['name'] = name
160    if uuid:
161        params['uuid'] = uuid
162    return client.call('bdev_example_create', params)
163
164
165def example_delete(client, name):
166    """Delete example block device.
167
168    Args:
169        bdev_name: name of bdev to delete
170    """
171    params = {'name': name}
172    return client.call('bdev_example_delete', params)
173
174
175def spdk_rpc_plugin_initialize(subparsers):
176    def bdev_example_create(args):
177        num_blocks = (args.total_size * 1024 * 1024) // args.block_size
178        print_json(example_create(args.client,
179                                  num_blocks=int(num_blocks),
180                                  block_size=args.block_size,
181                                  name=args.name,
182                                  uuid=args.uuid))
183
184    p = subparsers.add_parser('bdev_example_create',
185                              help='Create an example bdev')
186    p.add_argument('-b', '--name', help="Name of the bdev")
187    p.add_argument('-u', '--uuid', help="UUID of the bdev")
188    p.add_argument(
189        'total_size', help='Size of bdev in MB (float > 0)', type=float)
190    p.add_argument('block_size', help='Block size for this bdev', type=int)
191    p.set_defaults(func=bdev_example_create)
192
193    def bdev_example_delete(args):
194        example_delete(args.client,
195                      name=args.name)
196
197    p = subparsers.add_parser('bdev_example_delete',
198                              help='Delete an example disk')
199    p.add_argument('name', help='example bdev name')
200    p.set_defaults(func=bdev_example_delete)
201~~~
202
203Finally, call the rpc.py script with '--plugin' parameter to provide above python module name:
204
205~~~bash
206./scripts/rpc.py --plugin rpc_plugin bdev_example_create 10 4096
207~~~
208
209### Converting from legacy configuration {#jsonrpc_convert}
210
211Starting with SPDK 20.10, legacy configuration file support has been removed.
212Users with extensive configuration files already running in SPDK application,
213can [generate JSON-RPC for current configuration](@ref jsonrpc_generate).
214
215If binary for deploying the application is unavailable, the legacy configuration
216file can be converted to JSON-RPC using python tool:
217
218~~~bash
219./scripts/config_converter.py < config.ini > config.json
220~~~
221
222## App Framework {#jsonrpc_components_app}
223
224### spdk_kill_instance {#rpc_spdk_kill_instance}
225
226Send a signal to the application.
227
228#### Parameters
229
230Name                    | Optional | Type        | Description
231----------------------- | -------- | ----------- | -----------
232sig_name                | Required | string      | Signal to send (SIGINT, SIGTERM, SIGQUIT, SIGHUP, or SIGKILL)
233
234#### Example
235
236Example request:
237
238~~~json
239{
240  "jsonrpc": "2.0",
241  "id": 1,
242  "method": "spdk_kill_instance",
243  "params": {
244    "sig_name": "SIGINT"
245  }
246}
247~~~
248
249Example response:
250
251~~~json
252{
253  "jsonrpc": "2.0",
254  "id": 1,
255  "result": true
256}
257~~~
258
259### framework_monitor_context_switch {#rpc_framework_monitor_context_switch}
260
261Query, enable, or disable the context switch monitoring functionality.
262
263#### Parameters
264
265Name                    | Optional | Type        | Description
266----------------------- | -------- | ----------- | -----------
267enabled                 | Optional | boolean     | Enable (`true`) or disable (`false`) monitoring (omit this parameter to query the current state)
268
269#### Response
270
271Name                    | Type        | Description
272----------------------- | ----------- | -----------
273enabled                 | boolean     | The current state of context switch monitoring
274
275#### Example
276
277Example request:
278
279~~~json
280{
281  "jsonrpc": "2.0",
282  "id": 1,
283  "method": "framework_monitor_context_switch",
284  "params": {
285    "enabled": false
286  }
287}
288~~~
289
290Example response:
291
292~~~json
293{
294  "jsonrpc": "2.0",
295  "id": 1,
296  "result": {
297    "enabled": false
298  }
299}
300~~~
301
302### framework_start_init {#rpc_framework_start_init}
303
304Start initialization of SPDK subsystems when it is deferred by starting SPDK application with option -w.
305During its deferral some RPCs can be used to set global parameters for SPDK subsystems.
306This RPC can be called only once.
307
308#### Parameters
309
310This method has no parameters.
311
312#### Response
313
314Completion status of SPDK subsystem initialization is returned as a boolean.
315
316#### Example
317
318Example request:
319
320~~~json
321{
322  "jsonrpc": "2.0",
323  "id": 1,
324  "method": "framework_start_init"
325}
326~~~
327
328Example response:
329
330~~~json
331{
332  "jsonrpc": "2.0",
333  "id": 1,
334  "result": true
335}
336~~~
337
338### framework_wait_init {#rpc_framework_wait_init}
339
340Do not return until all subsystems have been initialized and the RPC system state is running.
341If the application is already running, this call will return immediately. This RPC can be called at any time.
342
343#### Parameters
344
345This method has no parameters.
346
347#### Response
348
349Returns True when subsystems have been initialized.
350
351#### Example
352
353Example request:
354
355~~~json
356{
357  "jsonrpc": "2.0",
358  "id": 1,
359  "method": "framework_wait_init"
360}
361~~~
362
363Example response:
364
365~~~json
366{
367  "jsonrpc": "2.0",
368  "id": 1,
369  "result": true
370}
371~~~
372
373### rpc_get_methods {#rpc_rpc_get_methods}
374
375Get an array of supported RPC methods.
376
377#### Parameters
378
379Name                    | Optional | Type        | Description
380----------------------- | -------- | ----------- | -----------
381current                 | Optional | boolean     | Get an array of RPC methods only callable in the current state.
382
383#### Response
384
385The response is an array of supported RPC methods.
386
387#### Example
388
389Example request:
390
391~~~json
392{
393  "jsonrpc": "2.0",
394  "id": 1,
395  "method": "rpc_get_methods"
396}
397~~~
398
399Example response:
400
401~~~json
402{
403  "jsonrpc": "2.0",
404  "id": 1,
405  "result": [
406    "framework_start_init",
407    "rpc_get_methods",
408    "scsi_get_devices",
409    "nbd_get_disks",
410    "nbd_stop_disk",
411    "nbd_start_disk",
412    "log_get_flags",
413    "log_clear_flag",
414    "log_set_flag",
415    "log_get_level",
416    "log_set_level",
417    "log_get_print_level",
418    "log_set_print_level",
419    "iscsi_get_options",
420    "iscsi_target_node_add_lun",
421    "iscsi_get_connections",
422    "iscsi_delete_portal_group",
423    "iscsi_create_portal_group",
424    "iscsi_get_portal_groups",
425    "iscsi_delete_target_node",
426    "iscsi_target_node_remove_pg_ig_maps",
427    "iscsi_target_node_add_pg_ig_maps",
428    "iscsi_create_target_node",
429    "iscsi_get_target_nodes",
430    "iscsi_delete_initiator_group",
431    "iscsi_initiator_group_remove_initiators",
432    "iscsi_initiator_group_add_initiators",
433    "iscsi_create_initiator_group",
434    "iscsi_get_initiator_groups",
435    "iscsi_set_options",
436    "bdev_set_options",
437    "bdev_set_qos_limit",
438    "bdev_get_bdevs",
439    "bdev_get_iostat",
440    "framework_get_config",
441    "framework_get_subsystems",
442    "framework_monitor_context_switch",
443    "spdk_kill_instance",
444    "accel_get_opc_assignments",
445    "ioat_scan_accel_module",
446    "dsa_scan_accel_module",
447    "bdev_virtio_attach_controller",
448    "bdev_virtio_scsi_get_devices",
449    "bdev_virtio_detach_controller",
450    "bdev_virtio_blk_set_hotplug",
451    "bdev_aio_delete",
452    "bdev_aio_create",
453    "bdev_split_delete",
454    "bdev_split_create",
455    "bdev_error_inject_error",
456    "bdev_error_delete",
457    "bdev_error_create",
458    "bdev_passthru_create",
459    "bdev_passthru_delete"
460    "bdev_nvme_apply_firmware",
461    "bdev_nvme_get_transport_statistics",
462    "bdev_nvme_get_controller_health_info",
463    "bdev_nvme_detach_controller",
464    "bdev_nvme_attach_controller",
465    "bdev_null_create",
466    "bdev_malloc_delete",
467    "bdev_malloc_create",
468    "bdev_ftl_delete",
469    "bdev_ftl_unload",
470    "bdev_ftl_create",
471    "bdev_ftl_load",
472    "bdev_ftl_unmap",
473    "bdev_ftl_get_stats",
474    "bdev_lvol_get_lvstores",
475    "bdev_lvol_delete",
476    "bdev_lvol_resize",
477    "bdev_lvol_set_read_only",
478    "bdev_lvol_decouple_parent",
479    "bdev_lvol_inflate",
480    "bdev_lvol_rename",
481    "bdev_lvol_clone",
482    "bdev_lvol_snapshot",
483    "bdev_lvol_create",
484    "bdev_lvol_delete_lvstore",
485    "bdev_lvol_rename_lvstore",
486    "bdev_lvol_create_lvstore",
487    "bdev_daos_delete",
488    "bdev_daos_create",
489    "bdev_daos_resize"
490  ]
491}
492~~~
493
494### framework_get_subsystems {#rpc_framework_get_subsystems}
495
496Get an array of name and dependency relationship of SPDK subsystems in initialization order.
497
498#### Parameters
499
500None
501
502#### Response
503
504The response is an array of name and dependency relationship of SPDK subsystems in initialization order.
505
506#### Example
507
508Example request:
509
510~~~json
511{
512  "jsonrpc": "2.0",
513  "id": 1,
514  "method": "framework_get_subsystems"
515}
516~~~
517
518Example response:
519
520~~~json
521{
522  "jsonrpc": "2.0",
523  "id": 1,
524  "result": [
525    {
526      "subsystem": "accel",
527      "depends_on": []
528    },
529    {
530      "subsystem": "interface",
531      "depends_on": []
532    },
533    {
534      "subsystem": "net_framework",
535      "depends_on": [
536        "interface"
537      ]
538    },
539    {
540      "subsystem": "bdev",
541      "depends_on": [
542        "accel"
543      ]
544    },
545    {
546      "subsystem": "nbd",
547      "depends_on": [
548        "bdev"
549      ]
550    },
551    {
552      "subsystem": "nvmf",
553      "depends_on": [
554        "bdev"
555      ]
556    },
557    {
558      "subsystem": "scsi",
559      "depends_on": [
560        "bdev"
561      ]
562    },
563    {
564      "subsystem": "vhost",
565      "depends_on": [
566        "scsi"
567      ]
568    },
569    {
570      "subsystem": "iscsi",
571      "depends_on": [
572        "scsi"
573      ]
574    }
575  ]
576}
577~~~
578
579### framework_get_config {#rpc_framework_get_config}
580
581Get current configuration of the specified SPDK framework
582
583#### Parameters
584
585Name                    | Optional | Type        | Description
586----------------------- | -------- | ----------- | -----------
587name                    | Required | string      | SPDK subsystem name
588
589#### Response
590
591The response is current configuration of the specified SPDK subsystem.
592Null is returned if it is not retrievable by the framework_get_config method and empty array is returned if it is empty.
593
594#### Example
595
596Example request:
597
598~~~json
599{
600  "jsonrpc": "2.0",
601  "id": 1,
602  "method": "framework_get_config",
603  "params": {
604    "name": "bdev"
605  }
606}
607~~~
608
609Example response:
610
611~~~json
612{
613  "jsonrpc": "2.0",
614  "id": 1,
615  "result": [
616    {
617      "params": {
618        "base_bdev": "Malloc2",
619        "split_size_mb": 0,
620        "split_count": 2
621      },
622      "method": "bdev_split_create"
623    },
624    {
625      "params": {
626        "trtype": "PCIe",
627        "name": "Nvme1",
628        "traddr": "0000:01:00.0"
629      },
630      "method": "bdev_nvme_attach_controller"
631    },
632    {
633      "params": {
634        "trtype": "PCIe",
635        "name": "Nvme2",
636        "traddr": "0000:03:00.0"
637      },
638      "method": "bdev_nvme_attach_controller"
639    },
640    {
641      "params": {
642        "block_size": 512,
643        "num_blocks": 131072,
644        "name": "Malloc0",
645        "uuid": "913fc008-79a7-447f-b2c4-c73543638c31"
646      },
647      "method": "bdev_malloc_create"
648    },
649    {
650      "params": {
651        "block_size": 512,
652        "num_blocks": 131072,
653        "name": "Malloc1",
654        "uuid": "dd5b8f6e-b67a-4506-b606-7fff5a859920"
655      },
656      "method": "bdev_malloc_create"
657    }
658  ]
659}
660~~~
661
662### framework_get_reactors {#rpc_framework_get_reactors}
663
664Retrieve an array of all reactors.
665
666#### Parameters
667
668This method has no parameters.
669
670#### Response
671
672The response is an array of all reactors.
673
674#### Example
675
676Example request:
677
678~~~json
679{
680  "jsonrpc": "2.0",
681  "method": "framework_get_reactors",
682  "id": 1
683}
684~~~
685
686Example response:
687
688~~~json
689{
690  "jsonrpc": "2.0",
691  "id": 1,
692  "result": {
693    "tick_rate": 2400000000,
694    "reactors": [
695      {
696        "lcore": 0,
697        "busy": 41289723495,
698        "idle": 3624832946,
699        "lw_threads": [
700          {
701            "name": "app_thread",
702            "id", 1,
703            "cpumask": "1",
704            "elapsed": 44910853363
705          }
706        ]
707      }
708    ]
709  }
710}
711~~~
712
713### framework_set_scheduler {#rpc_framework_set_scheduler}
714
715Select thread scheduler that will be activated.
716This feature is considered as experimental.
717
718#### Parameters
719
720Name                    | Optional | Type        | Description
721----------------------- | -------- | ----------- | -----------
722name                    | Required | string      | Name of a scheduler
723period                  | Optional | number      | Scheduler period
724load_limit              | Optional | number      | Thread load limit in % (dynamic only)
725core_limit              | Optional | number      | Load limit on the core to be considered full (dynamic only)
726core_busy               | Optional | number      | Indicates at what load on core scheduler should move threads to a different core (dynamic only)
727
728#### Response
729
730Completion status of the operation is returned as a boolean.
731
732#### Example
733
734Example request:
735
736~~~json
737{
738  "jsonrpc": "2.0",
739  "method": "framework_set_scheduler",
740  "id": 1,
741  "params": {
742    "name": "static",
743    "period": "1000000"
744  }
745}
746~~~
747
748Example response:
749
750~~~json
751{
752  "jsonrpc": "2.0",
753  "id": 1,
754  "result": true
755}
756~~~
757
758### framework_get_scheduler {#rpc_framework_get_scheduler}
759
760Retrieve currently set scheduler name and period, along with current governor name.
761
762#### Parameters
763
764This method has no parameters.
765
766#### Response
767
768Name                    | Description
769------------------------| -----------
770scheduler_name          | Current scheduler name
771scheduler_period        | Currently set scheduler period in microseconds
772governor_name           | Governor name
773
774#### Example
775
776Example request:
777
778~~~json
779{
780  "jsonrpc": "2.0",
781  "method": "framework_set_scheduler",
782  "id": 1,
783}
784~~~
785
786Example response:
787
788~~~json
789{
790  "jsonrpc": "2.0",
791  "id": 1,
792  "result": {
793    "scheduler_name": "static",
794    "scheduler_period": 2800000000,
795    "governor_name": "default"
796  }
797}
798~~~
799
800### framework_enable_cpumask_locks
801
802Enable CPU core lock files to block multiple SPDK applications from running on the same cpumask.
803The CPU core locks are enabled by default, unless user specified `--disable-cpumask-locks` command
804line option when launching SPDK.
805
806This RPC may be called after locks have already been enabled, with no effect and no error response.
807
808#### Parameters
809
810This method has no parameters.
811
812#### Response
813
814true on success
815
816#### Example
817
818Example request:
819
820~~~json
821{
822  "jsonrpc": "2.0",
823  "id": 1,
824  "method": "framework_enable_cpumask_locks"
825}
826~~~
827
828Example response:
829
830~~~json
831{
832  "jsonrpc": "2.0",
833  "id": 1,
834  "result": true
835}
836~~~
837
838### framework_disable_cpumask_locks
839
840Disable CPU core lock files. The locks can also be disabled during startup, when
841user specifies `--disable-cpumask-locks` command line option during SPDK launch.
842
843This RPC may be called after locks have already been disabled, with no effect and no error
844response.
845
846#### Parameters
847
848This method has no parameters.
849
850#### Response
851
852true on success
853
854#### Example
855
856Example request:
857
858~~~json
859{
860  "jsonrpc": "2.0",
861  "id": 1,
862  "method": "framework_disable_cpumask_locks"
863}
864~~~
865
866Example response:
867
868~~~json
869{
870  "jsonrpc": "2.0",
871  "id": 1,
872  "result": true
873}
874~~~
875
876### thread_get_stats {#rpc_thread_get_stats}
877
878Retrieve current statistics of all the threads.
879
880#### Parameters
881
882This method has no parameters.
883
884#### Response
885
886The response is an array of objects containing threads statistics.
887
888#### Example
889
890Example request:
891
892~~~json
893{
894  "jsonrpc": "2.0",
895  "method": "thread_get_stats",
896  "id": 1
897}
898~~~
899
900Example response:
901
902~~~json
903{
904  "jsonrpc": "2.0",
905  "id": 1,
906  "result": {
907    "tick_rate": 2400000000,
908    "threads": [
909      {
910        "name": "app_thread",
911        "id": 1,
912	"cpumask": "1",
913        "busy": 139223208,
914        "idle": 8641080608,
915        "in_interrupt": false,
916        "active_pollers_count": 1,
917        "timed_pollers_count": 2,
918        "paused_pollers_count": 0
919      }
920    ]
921  }
922}
923~~~
924
925### thread_set_cpumask {#rpc_thread_set_cpumask}
926
927Set the cpumask of the thread to the specified value. The thread may be migrated
928to one of the specified CPUs.
929
930#### Parameters
931
932Name                    | Optional | Type        | Description
933----------------------- | -------- | ----------- | -----------
934id                      | Required | string      | Thread ID
935cpumask                 | Required | string      | Cpumask for this thread
936
937#### Response
938
939Completion status of the operation is returned as a boolean.
940
941#### Example
942
943Example request:
944
945~~~json
946{
947  "jsonrpc": "2.0",
948  "method": "thread_set_cpumask",
949  "id": 1,
950  "params": {
951    "id": "1",
952    "cpumask": "1"
953  }
954}
955~~~
956
957Example response:
958
959~~~json
960{
961  "jsonrpc": "2.0",
962  "id": 1,
963  "result": true
964}
965~~~
966
967### trace_enable_tpoint_group {#rpc_trace_enable_tpoint_group}
968
969Enable trace on a specific tpoint group. For example "bdev" for bdev trace group,
970"all" for all trace groups.
971
972#### Parameters
973
974Name                    | Optional | Type        | Description
975----------------------- | -------- | ----------- | -----------
976name                    | Required | string      | bdev, nvmf_rdma, nvmf_tcp, blobfs, scsi, iscsi_conn, ftl, all
977
978#### Example
979
980Example request:
981
982~~~json
983{
984  "jsonrpc": "2.0",
985  "method": "trace_enable_tpoint_group",
986  "id": 1,
987  "params": {
988    "name": "bdev"
989  }
990}
991~~~
992
993Example response:
994
995~~~json
996{
997  "jsonrpc": "2.0",
998  "id": 1,
999  "result": true
1000}
1001~~~
1002
1003### trace_disable_tpoint_group {#rpc_trace_disable_tpoint_group}
1004
1005Disable trace on a specific tpoint group. For example "bdev" for bdev trace group,
1006"all" for all trace groups.
1007
1008#### Parameters
1009
1010Name                    | Optional | Type        | Description
1011----------------------- | -------- | ----------- | -----------
1012name                    | Required | string      | bdev, nvmf_rdma, nvmf_tcp, blobfs, all
1013
1014#### Example
1015
1016Example request:
1017
1018~~~json
1019{
1020  "jsonrpc": "2.0",
1021  "method": "trace_disable_tpoint_group",
1022  "id": 1,
1023  "params": {
1024    "name": "bdev"
1025  }
1026}
1027~~~
1028
1029Example response:
1030
1031~~~json
1032{
1033  "jsonrpc": "2.0",
1034  "id": 1,
1035  "result": true
1036}
1037~~~
1038
1039### trace_set_tpoint_mask {#rpc_trace_set_tpoint_mask}
1040
1041Enable tracepoint mask on a specific tpoint group. For example "bdev" for bdev trace group,
1042and 0x1 to enable the first tracepoint inside the group (BDEV_IO_START). This command will not
1043disable already active tracepoints or those not specified in the mask. For a full description
1044of all available trace groups, see
1045[tracepoint documentation](https://spdk.io/doc/nvmf_tgt_tracepoints.html).
1046
1047#### Parameters
1048
1049Name                    | Optional | Type        | Description
1050----------------------- | -------- | ----------- | -----------
1051name                    | Required | string      | bdev, nvmf_rdma, nvmf_tcp, blobfs, scsi, iscsi_conn, ftl
1052tpoint_mask             | Required | number      | mask to enable tracepoints inside a group
1053
1054#### Example
1055
1056Example request:
1057
1058~~~json
1059{
1060  "jsonrpc": "2.0",
1061  "method": "trace_set_tpoint_mask",
1062  "id": 1,
1063  "params": {
1064    "name": "bdev",
1065    "tpoint_mask": 0x1
1066  }
1067}
1068~~~
1069
1070Example response:
1071
1072~~~json
1073{
1074  "jsonrpc": "2.0",
1075  "id": 1,
1076  "result": true
1077}
1078~~~
1079
1080### trace_clear_tpoint_mask {#rpc_trace_clear_tpoint_mask}
1081
1082Disable tracepoint mask on a specific tpoint group. For example "bdev" for bdev trace group,
1083and 0x1 to disable the first tracepoint inside the group (BDEV_IO_START). For a full description
1084of all available trace groups, see
1085[tracepoint documentation](https://spdk.io/doc/nvmf_tgt_tracepoints.html).
1086
1087#### Parameters
1088
1089Name                    | Optional | Type        | Description
1090----------------------- | -------- | ----------- | -----------
1091name                    | Required | string      | bdev, nvmf_rdma, nvmf_tcp, blobfs, scsi, iscsi_conn, ftl
1092tpoint_mask             | Required | number      | mask to diesable tracepoints inside a group
1093
1094#### Example
1095
1096Example request:
1097
1098~~~json
1099{
1100  "jsonrpc": "2.0",
1101  "method": "trace_clear_tpoint_mask",
1102  "id": 1,
1103  "params": {
1104    "name": "bdev",
1105    "tpoint_mask": 0x1
1106  }
1107}
1108~~~
1109
1110Example response:
1111
1112~~~json
1113{
1114  "jsonrpc": "2.0",
1115  "id": 1,
1116  "result": true
1117}
1118~~~
1119
1120### trace_get_tpoint_group_mask {#rpc_trace_get_tpoint_group_mask}
1121
1122Display mask info for every group.
1123
1124#### Parameters
1125
1126No parameters required
1127
1128#### Example
1129
1130Example request:
1131
1132~~~json
1133{
1134  "jsonrpc": "2.0",
1135  "method": "trace_get_tpoint_group_mask",
1136  "id": 1
1137}
1138~~~
1139
1140Example response:
1141
1142~~~json
1143{
1144  "jsonrpc": "2.0",
1145  "id": 1,
1146  "result": {
1147    "tpoint_group_mask": "0x0",
1148  "iscsi_conn": {
1149    "enabled": false,
1150    "mask": "0x2"
1151  },
1152  "scsi": {
1153    "enabled": false,
1154    "mask": "0x4"
1155  },
1156  "bdev": {
1157    "enabled": false,
1158    "mask": "0x8"
1159  },
1160  "nvmf_tcp": {
1161    "enabled": false,
1162    "mask": "0x20"
1163  },
1164  "ftl": {
1165    "enabled": false,
1166    "mask": "0x40"
1167  },
1168  "blobfs": {
1169    "enabled": false,
1170    "mask": "0x80"
1171    }
1172  }
1173}
1174~~~
1175
1176### trace_get_info {#rpc_trace_get_info}
1177
1178Get name of shared memory file, list of the available trace point groups
1179and mask of the available trace points for each group
1180
1181#### Parameters
1182
1183No parameters required
1184
1185#### Example
1186
1187Example request:
1188
1189~~~json
1190{
1191  "jsonrpc": "2.0",
1192  "method": "trace_get_info",
1193  "id": 1
1194}
1195~~~
1196
1197Example response:
1198
1199~~~json
1200{
1201  "jsonrpc": "2.0",
1202  "id": 1,
1203  "result": {
1204    "tpoint_shm_path": "/dev/shm/spdk_tgt_trace.pid3071944",
1205    "tpoint_group_mask": "0x8",
1206    "iscsi_conn": {
1207      "mask": "0x2",
1208      "tpoint_mask": "0x0"
1209    },
1210    "scsi": {
1211      "mask": "0x4",
1212      "tpoint_mask": "0x0"
1213    },
1214    "bdev": {
1215      "mask": "0x8",
1216      "tpoint_mask": "0xffffffffffffffff"
1217    },
1218    "nvmf_tcp": {
1219      "mask": "0x20",
1220      "tpoint_mask": "0x0"
1221    },
1222    "blobfs": {
1223      "mask": "0x80",
1224      "tpoint_mask": "0x0"
1225    },
1226    "thread": {
1227      "mask": "0x400",
1228      "tpoint_mask": "0x0"
1229    },
1230    "nvme_pcie": {
1231      "mask": "0x800",
1232      "tpoint_mask": "0x0"
1233    },
1234    "nvme_tcp": {
1235      "mask": "0x2000",
1236      "tpoint_mask": "0x0"
1237    },
1238    "bdev_nvme": {
1239      "mask": "0x4000",
1240      "tpoint_mask": "0x0"
1241    }
1242  }
1243}
1244~~~
1245
1246### log_set_print_level {#rpc_log_set_print_level}
1247
1248Set the current level at which output will additionally be
1249sent to the current console.
1250
1251#### Parameters
1252
1253Name                    | Optional | Type        | Description
1254----------------------- | -------- | ----------- | -----------
1255level                   | Required | string      | ERROR, WARNING, NOTICE, INFO, DEBUG
1256
1257#### Example
1258
1259Example request:
1260
1261~~~json
1262{
1263  "jsonrpc": "2.0",
1264  "method": "log_set_print_level",
1265  "id": 1,
1266  "params": {
1267    "level": "ERROR"
1268  }
1269}
1270~~~
1271
1272Example response:
1273
1274~~~json
1275{
1276  "jsonrpc": "2.0",
1277  "id": 1,
1278  "result": true
1279}
1280~~~
1281
1282### log_get_print_level {#rpc_log_get_print_level}
1283
1284Get the current level at which output will additionally be
1285sent to the current console.
1286
1287#### Example
1288
1289Example request:
1290
1291~~~json
1292{
1293  "jsonrpc": "2.0",
1294  "method": "log_get_print_level",
1295  "id": 1,
1296}
1297~~~
1298
1299Example response:
1300
1301~~~json
1302{
1303  "jsonrpc": "2.0",
1304  "id": 1,
1305  "result": "NOTICE"
1306}
1307~~~
1308
1309### log_set_level {#rpc_log_set_level}
1310
1311Set the current logging level output by the `log` module.
1312
1313#### Parameters
1314
1315Name                    | Optional | Type        | Description
1316----------------------- | -------- | ----------- | -----------
1317level                   | Required | string      | ERROR, WARNING, NOTICE, INFO, DEBUG
1318
1319#### Example
1320
1321Example request:
1322
1323~~~json
1324{
1325  "jsonrpc": "2.0",
1326  "method": "log_set_level",
1327  "id": 1,
1328  "params": {
1329    "level": "ERROR"
1330  }
1331}
1332~~~
1333
1334Example response:
1335
1336~~~json
1337{
1338  "jsonrpc": "2.0",
1339  "id": 1,
1340  "result": true
1341}
1342~~~
1343
1344### log_get_level {#rpc_log_get_level}
1345
1346Get the current logging level output by the `log` module.
1347
1348#### Example
1349
1350Example request:
1351
1352~~~json
1353{
1354  "jsonrpc": "2.0",
1355  "method": "log_get_level",
1356  "id": 1,
1357}
1358~~~
1359
1360Example response:
1361
1362~~~json
1363{
1364  "jsonrpc": "2.0",
1365  "id": 1,
1366  "result": "NOTICE"
1367}
1368~~~
1369
1370### log_set_flag {#rpc_log_set_flag}
1371
1372Enable logging for specific portions of the application. The list of possible
1373log flags can be obtained using the `log_get_flags` RPC and may be different
1374for each application.
1375
1376#### Parameters
1377
1378Name                    | Optional | Type        | Description
1379----------------------- | -------- | ----------- | -----------
1380flag                    | Required | string      | A log flag, or 'all'
1381
1382#### Example
1383
1384Example request:
1385
1386~~~json
1387{
1388  "jsonrpc": "2.0",
1389  "method": "log_set_flag",
1390  "id": 1,
1391  "params": {
1392    "flag": "all"
1393  }
1394}
1395~~~
1396
1397Example response:
1398
1399~~~json
1400{
1401  "jsonrpc": "2.0",
1402  "id": 1,
1403  "result": true
1404}
1405~~~
1406
1407### log_clear_flag {#rpc_log_clear_flag}
1408
1409Disable logging for specific portions of the application. The list of possible
1410log flags can be obtained using the `log_get_flags` RPC and may be different
1411for each application.
1412
1413#### Parameters
1414
1415Name                    | Optional | Type        | Description
1416----------------------- | -------- | ----------- | -----------
1417flag                    | Required | string      | A log flag, or 'all'
1418
1419#### Example
1420
1421Example request:
1422
1423~~~json
1424{
1425  "jsonrpc": "2.0",
1426  "method": "log_clear_flag",
1427  "id": 1,
1428  "params": {
1429    "flag": "all"
1430  }
1431}
1432~~~
1433
1434Example response:
1435
1436~~~json
1437{
1438  "jsonrpc": "2.0",
1439  "id": 1,
1440  "result": true
1441}
1442~~~
1443
1444### log_get_flags {#rpc_log_get_flags}
1445
1446Get the list of valid flags for this application and whether
1447they are currently enabled.
1448
1449#### Example
1450
1451Example request:
1452
1453~~~json
1454{
1455  "jsonrpc": "2.0",
1456  "method": "log_get_flags",
1457  "id": 1,
1458}
1459~~~
1460
1461Example response:
1462
1463~~~json
1464{
1465  "jsonrpc": "2.0",
1466  "id": 1,
1467  "result": {
1468    "nvmf": true,
1469    "nvme": true,
1470    "aio": false,
1471    "bdev" false
1472  }
1473}
1474~~~
1475
1476### log_enable_timestamps {#rpc_log_enable_timestamps}
1477
1478Enable or disable timestamps.
1479
1480#### Parameters
1481
1482Name                    | Optional | Type        | Description
1483----------------------- | -------- | ----------- | -----------
1484enabled                 | Required | boolean     | on or off
1485
1486#### Example
1487
1488Example request:
1489
1490~~~json
1491{
1492  "jsonrpc": "2.0",
1493  "method": "log_enable_timestamps",
1494  "id": 1,
1495  "params": {
1496    "enabled": true
1497  }
1498}
1499~~~
1500
1501Example response:
1502
1503~~~json
1504{
1505  "jsonrpc": "2.0",
1506  "id": 1,
1507  "result": true
1508}
1509~~~
1510
1511### thread_get_pollers {#rpc_thread_get_pollers}
1512
1513Retrieve current pollers of all the threads.
1514
1515#### Parameters
1516
1517This method has no parameters.
1518
1519### Response
1520
1521The response is an array of objects containing pollers of all the threads.
1522
1523#### Example
1524
1525Example request:
1526
1527~~~json
1528{
1529  "jsonrpc": "2.0",
1530  "method": "thread_get_pollers",
1531  "id": 1
1532}
1533~~~
1534
1535Example response:
1536
1537~~~json
1538{
1539  "jsonrpc": "2.0",
1540  "id": 1,
1541  "result": {
1542    "tick_rate": 2500000000,
1543    "threads": [
1544      {
1545        "name": "app_thread",
1546        "id": 1,
1547        "active_pollers": [],
1548        "timed_pollers": [
1549          {
1550            "name": "spdk_rpc_subsystem_poll",
1551            "id": 1,
1552            "state": "waiting",
1553            "run_count": 12345,
1554            "busy_count": 10000,
1555            "period_ticks": 10000000
1556          }
1557        ],
1558        "paused_pollers": []
1559      }
1560    ]
1561  }
1562}
1563~~~
1564
1565### thread_get_io_channels {#rpc_thread_get_io_channels}
1566
1567Retrieve current IO channels of all the threads.
1568
1569#### Parameters
1570
1571This method has no parameters.
1572
1573#### Response
1574
1575The response is an array of objects containing IO channels of all the threads.
1576
1577#### Example
1578
1579Example request:
1580
1581~~~json
1582{
1583  "jsonrpc": "2.0",
1584  "method": "thread_get_io_channels",
1585  "id": 1
1586}
1587~~~
1588
1589Example response:
1590
1591~~~json
1592{
1593  "jsonrpc": "2.0",
1594  "id": 1,
1595  "result": {
1596    "tick_rate": 2500000000,
1597    "threads": [
1598      {
1599        "name": "app_thread",
1600        "io_channels": [
1601          {
1602            "name": "nvmf_tgt",
1603            "ref": 1
1604          }
1605        ]
1606      }
1607    ]
1608  }
1609}
1610~~~
1611
1612### env_dpdk_get_mem_stats {#rpc_env_dpdk_get_mem_stats}
1613
1614Write the dpdk memory stats to a file.
1615
1616#### Parameters
1617
1618This method has no parameters.
1619
1620#### Response
1621
1622The response is a pathname to a text file containing the memory stats.
1623
1624#### Example
1625
1626Example request:
1627
1628~~~json
1629{
1630  "jsonrpc": "2.0",
1631  "method": "env_dpdk_get_mem_stats",
1632  "id": 1
1633}
1634~~~
1635
1636Example response:
1637
1638~~~json
1639{
1640  "jsonrpc": "2.0",
1641  "id": 1,
1642  "result": {
1643    "filename": "/tmp/spdk_mem_dump.txt"
1644  }
1645}
1646~~~
1647
1648## Acceleration Framework Layer {#jsonrpc_components_accel_fw}
1649
1650### accel_get_module_info {#accel_get_module_info}
1651
1652Get a list of valid module names and their supported operations.
1653
1654#### Parameters
1655
1656None
1657
1658#### Example
1659
1660Example request:
1661
1662~~~json
1663{
1664  "jsonrpc": "2.0",
1665  "method": "accel_get_module_info",
1666  "id": 1
1667}
1668~~~
1669
1670Example response:
1671
1672~~~json
1673[
1674  {
1675    "module": "software",
1676    "supported ops": [
1677      "copy",
1678      "fill",
1679      "dualcast",
1680      "compare",
1681      "crc32c",
1682      "copy_crc32c",
1683      "compress",
1684      "decompress"
1685    ]
1686  },
1687  {
1688    "module": "dsa",
1689    "supported ops": [
1690      "copy",
1691      "fill",
1692      "dualcast",
1693      "compare",
1694      "crc32c",
1695      "copy_crc32c"
1696    ]
1697  }
1698]
1699~~~
1700
1701### accel_get_opc_assignments {#rpc_accel_get_opc_assignments}
1702
1703Get a list of opcode names and their assigned accel_fw modules.
1704
1705#### Parameters
1706
1707None
1708
1709#### Example
1710
1711Example request:
1712
1713~~~json
1714{
1715  "jsonrpc": "2.0",
1716  "method": "accel_get_opc_assignments",
1717  "id": 1
1718}
1719~~~
1720
1721Example response:
1722
1723~~~json
1724{
1725  "jsonrpc": "2.0",
1726  "id": 1,
1727  "result": [
1728    {
1729      "copy": "software",
1730      "fill": "software",
1731      "dualcast": "software",
1732      "compare": "software",
1733      "crc32c": "software",
1734      "copy_crc32c": "software",
1735      "compress": "software",
1736      "decompress": "software"
1737    }
1738  ]
1739}
1740~~~
1741
1742### accel_assign_opc {#rpc_accel_assign_opc}
1743
1744Manually assign an operation to a module.
1745
1746#### Parameters
1747
1748Name                    | Optional | Type        | Description
1749----------------------- | -------- | ----------- | -----------------
1750opname                  | Required | string      | name of operation
1751module                  | Required | string      | name of module
1752
1753#### Example
1754
1755Example request:
1756
1757~~~json
1758{
1759  "jsonrpc": "2.0",
1760  "method": "accel_assign_opc",
1761  "id": 1,
1762  "params": {
1763    "opname": "copy",
1764    "module": "software"
1765  }
1766}
1767~~~
1768
1769Example response:
1770
1771~~~json
1772{
1773  "jsonrpc": "2.0",
1774  "id": 1,
1775  "result": true
1776}
1777~~~
1778
1779### dsa_scan_accel_module {#rpc_dsa_scan_accel_module}
1780
1781Set config and enable dsa accel module offload.
1782This feature is considered as experimental.
1783
1784#### Parameters
1785
1786Name                    | Optional | Type        | Description
1787----------------------- | -------- | ----------- | -----------
1788config_kernel_mode      | Optional | Boolean     | If set, will use kernel idxd driver.
1789
1790#### Example
1791
1792Example request:
1793
1794~~~json
1795{
1796  "params": {
1797    "config_kernel_mode": false
1798  },
1799  "jsonrpc": "2.0",
1800  "method": "dsa_scan_accel_module",
1801  "id": 1
1802}
1803~~~
1804
1805Example response:
1806
1807~~~json
1808{
1809  "jsonrpc": "2.0",
1810  "id": 1,
1811  "result": true
1812}
1813~~~
1814
1815### iaa_scan_accel_module {#rpc_iaa_scan_accel_module}
1816
1817Enable IAA accel module offload.
1818This feature is considered as experimental.
1819
1820#### Parameters
1821
1822None
1823
1824#### Example
1825
1826Example request:
1827
1828~~~json
1829{
1830  "jsonrpc": "2.0",
1831  "method": "iaa_scan_accel_module",
1832  "id": 1
1833}
1834~~~
1835
1836Example response:
1837
1838~~~json
1839{
1840  "jsonrpc": "2.0",
1841  "id": 1,
1842  "result": true
1843}
1844~~~
1845
1846### ioat_scan_accel_module {#rpc_ioat_scan_accel_module}
1847
1848Enable ioat accel module offload.
1849
1850#### Parameters
1851
1852None
1853
1854#### Example
1855
1856Example request:
1857
1858~~~json
1859{
1860  "jsonrpc": "2.0",
1861  "method": "ioat_scan_accel_module",
1862  "id": 1
1863}
1864~~~
1865
1866Example response:
1867
1868~~~json
1869{
1870  "jsonrpc": "2.0",
1871  "id": 1,
1872  "result": true
1873}
1874~~~
1875
1876## Block Device Abstraction Layer {#jsonrpc_components_bdev}
1877
1878### bdev_set_options {#rpc_bdev_set_options}
1879
1880Set global parameters for the block device (bdev) subsystem.  This RPC may only be called
1881before SPDK subsystems have been initialized.
1882
1883#### Parameters
1884
1885Name                    | Optional | Type        | Description
1886----------------------- | -------- | ----------- | -----------
1887bdev_io_pool_size       | Optional | number      | Number of spdk_bdev_io structures in shared buffer pool
1888bdev_io_cache_size      | Optional | number      | Maximum number of spdk_bdev_io structures cached per thread
1889bdev_auto_examine       | Optional | boolean     | If set to false, the bdev layer will not examine every disks automatically
1890
1891#### Example
1892
1893Example request:
1894
1895~~~json
1896{
1897  "jsonrpc": "2.0",
1898  "id": 1,
1899  "method": "bdev_set_options",
1900  "params": {
1901    "bdev_io_pool_size": 65536,
1902    "bdev_io_cache_size": 256
1903  }
1904}
1905~~~
1906
1907Example response:
1908
1909~~~json
1910{
1911  "jsonrpc": "2.0",
1912  "id": 1,
1913  "result": true
1914}
1915~~~
1916
1917### bdev_get_bdevs {#rpc_bdev_get_bdevs}
1918
1919Get information about block devices (bdevs).
1920
1921#### Parameters
1922
1923The user may specify no parameters in order to list all block devices, or a block device may be
1924specified by name.  If a timeout is specified, the method will block until a bdev with a specified
1925name appears or the timeout expires.  By default, the timeout is zero, meaning the method returns
1926immediately whether the bdev exists or not.
1927
1928Name                    | Optional | Type        | Description
1929----------------------- | -------- | ----------- | -----------
1930name                    | Optional | string      | Block device name
1931timeout                 | Optional | number      | Time (ms) to wait for a bdev with specified name to appear
1932
1933#### Response
1934
1935The response is an array of objects containing information about the requested block devices.
1936
1937#### Example
1938
1939Example request:
1940
1941~~~json
1942{
1943  "jsonrpc": "2.0",
1944  "id": 1,
1945  "method": "bdev_get_bdevs",
1946  "params": {
1947    "name": "Malloc0"
1948  }
1949}
1950~~~
1951
1952Example response:
1953
1954~~~json
1955{
1956  "jsonrpc": "2.0",
1957  "id": 1,
1958  "result": [
1959    {
1960      "name": "Malloc0",
1961      "product_name": "Malloc disk",
1962      "block_size": 512,
1963      "num_blocks": 20480,
1964      "claimed": false,
1965      "zoned": false,
1966      "supported_io_types": {
1967        "read": true,
1968        "write": true,
1969        "unmap": true,
1970        "write_zeroes": true,
1971        "flush": true,
1972        "reset": true,
1973        "nvme_admin": false,
1974        "nvme_io": false
1975      },
1976      "driver_specific": {}
1977    }
1978  ]
1979}
1980~~~
1981
1982### bdev_examine {#rpc_bdev_examine}
1983
1984Request that the bdev layer examines the given bdev for metadata and creates
1985new bdevs if metadata is found. This is only necessary if `auto_examine` has
1986been set to false using `bdev_set_options`. By default, `auto_examine` is true
1987and bdev examination is automatic.
1988
1989#### Parameters
1990
1991Name                    | Optional | Type        | Description
1992----------------------- | -------- | ----------- | -----------
1993name                    | Required | string      | Block device name
1994
1995#### Response
1996
1997The response is an array of objects containing I/O statistics of the requested block devices.
1998
1999#### Example
2000
2001Example request:
2002
2003~~~json
2004{
2005  "jsonrpc": "2.0",
2006  "id": 1,
2007  "method": "bdev_examine",
2008  "params": {
2009    "name": "Nvme0n1"
2010  }
2011}
2012~~~
2013
2014Example response:
2015
2016~~~json
2017{
2018  "jsonrpc": "2.0",
2019  "id": 1,
2020  "result": true
2021}
2022~~~
2023
2024### bdev_wait_for_examine {#rpc_bdev_wait_for_examine}
2025
2026Report when all bdevs have been examined by every bdev module.
2027
2028#### Parameters
2029
2030None
2031
2032#### Response
2033
2034The response is sent when all bdev modules had a chance to examine every bdev.
2035
2036#### Example
2037
2038Example request:
2039
2040~~~json
2041{
2042  "jsonrpc": "2.0",
2043  "method": "bdev_wait_for_examine",
2044  "id": 1
2045}
2046~~~
2047
2048Example response:
2049
2050~~~json
2051{
2052  "jsonrpc": "2.0",
2053  "id": 1,
2054  "result": true
2055}
2056~~~
2057
2058### bdev_get_iostat {#rpc_bdev_get_iostat}
2059
2060Get I/O statistics of block devices (bdevs).
2061
2062#### Parameters
2063
2064The user may specify no parameters in order to list all block devices, or a block device may be
2065specified by name.
2066
2067Name                    | Optional | Type        | Description
2068----------------------- | -------- | ----------- | -----------
2069name                    | Optional | string      | Block device name
2070per_channel             | Optional | bool        | Display per channel data for specified block device.
2071
2072#### Response
2073
2074The response is an array of objects containing I/O statistics of the requested block devices.
2075
2076#### Example
2077
2078Example request:
2079
2080~~~json
2081{
2082  "jsonrpc": "2.0",
2083  "id": 1,
2084  "method": "bdev_get_iostat",
2085  "params": {
2086    "name": "Nvme0n1",
2087    "per_channel": false
2088  }
2089}
2090~~~
2091
2092Example response:
2093
2094~~~json
2095{
2096  "jsonrpc": "2.0",
2097  "id": 1,
2098  "result": {
2099    "tick_rate": 2200000000,
2100    "bdevs" : [
2101      {
2102        "name": "Nvme0n1",
2103        "bytes_read": 36864,
2104        "num_read_ops": 2,
2105        "bytes_written": 0,
2106        "num_write_ops": 0,
2107        "bytes_unmapped": 0,
2108        "num_unmap_ops": 0,
2109        "read_latency_ticks": 178904,
2110        "write_latency_ticks": 0,
2111        "unmap_latency_ticks": 0,
2112        "queue_depth_polling_period": 2,
2113        "queue_depth": 0,
2114        "io_time": 0,
2115        "weighted_io_time": 0
2116      }
2117    ]
2118  }
2119}
2120~~~
2121
2122### bdev_reset_iostat {#rpc_bdev_reset_iostat}
2123
2124Reset I/O statistics of block devices (bdevs). Note that if one consumer resets I/O statistics,
2125it affects all other consumers.
2126
2127#### Parameters
2128
2129The user may specify no parameters in order to reset I/O statistics for all block devices, or
2130a block device may be specified by name.
2131
2132Name                    | Optional | Type        | Description
2133----------------------- | -------- | ----------- | -----------
2134name                    | Optional | string      | Block device name
2135
2136#### Example
2137
2138Example request:
2139
2140~~~json
2141{
2142  "jsonrpc": "2.0",
2143  "id": 1,
2144  "method": "bdev_reset_iostat",
2145  "params": {
2146    "name": "Nvme0n1"
2147  }
2148}
2149~~~
2150
2151Example response:
2152
2153~~~json
2154{
2155  "jsonrpc": "2.0",
2156  "id": 1,
2157  "result": true
2158}
2159~~~
2160
2161### bdev_enable_histogram {#rpc_bdev_enable_histogram}
2162
2163Control whether collecting data for histogram is enabled for specified bdev.
2164
2165#### Parameters
2166
2167Name                    | Optional | Type        | Description
2168----------------------- | -------- | ----------- | -----------
2169name                    | Required | string      | Block device name
2170enable                  | Required | boolean     | Enable or disable histogram on specified device
2171
2172#### Example
2173
2174Example request:
2175
2176~~~json
2177{
2178  "jsonrpc": "2.0",
2179  "id": 1,
2180  "method": "bdev_enable_histogram",
2181  "params": {
2182    "name": "Nvme0n1"
2183    "enable": true
2184  }
2185}
2186~~~
2187
2188Example response:
2189
2190~~~json
2191{
2192  "jsonrpc": "2.0",
2193  "id": 1,
2194  "result": true
2195}
2196~~~
2197
2198### bdev_get_histogram {#rpc_bdev_get_histogram}
2199
2200Get latency histogram for specified bdev.
2201
2202#### Parameters
2203
2204Name                    | Optional | Type        | Description
2205----------------------- | -------- | ----------- | -----------
2206name                    | Required | string      | Block device name
2207
2208#### Result
2209
2210Name                    | Description
2211------------------------| -----------
2212histogram               | Base64 encoded histogram
2213bucket_shift            | Granularity of the histogram buckets
2214tsc_rate                | Ticks per second
2215
2216#### Example
2217
2218Example request:
2219
2220~~~json
2221{
2222  "jsonrpc": "2.0",
2223  "id": 1,
2224  "method": "bdev_get_histogram",
2225  "params": {
2226    "name": "Nvme0n1"
2227  }
2228}
2229~~~
2230
2231Example response:
2232Note that histogram field is trimmed, actual encoded histogram length is ~80kb.
2233
2234~~~json
2235{
2236  "jsonrpc": "2.0",
2237  "id": 1,
2238  "result": {
2239    "histogram": "AAAAAAAAAAAAAA...AAAAAAAAA==",
2240    "tsc_rate": 2300000000,
2241    "bucket_shift": 7
2242  }
2243}
2244~~~
2245
2246### bdev_set_qos_limit {#rpc_bdev_set_qos_limit}
2247
2248Set the quality of service rate limit on a bdev.
2249
2250#### Parameters
2251
2252Name                    | Optional | Type        | Description
2253----------------------- | -------- | ----------- | -----------
2254name                    | Required | string      | Block device name
2255rw_ios_per_sec          | Optional | number      | Number of R/W I/Os per second to allow. 0 means unlimited.
2256rw_mbytes_per_sec       | Optional | number      | Number of R/W megabytes per second to allow. 0 means unlimited.
2257r_mbytes_per_sec        | Optional | number      | Number of Read megabytes per second to allow. 0 means unlimited.
2258w_mbytes_per_sec        | Optional | number      | Number of Write megabytes per second to allow. 0 means unlimited.
2259
2260#### Example
2261
2262Example request:
2263
2264~~~json
2265{
2266  "jsonrpc": "2.0",
2267  "id": 1,
2268  "method": "bdev_set_qos_limit",
2269  "params": {
2270    "name": "Malloc0"
2271    "rw_ios_per_sec": 20000
2272    "rw_mbytes_per_sec": 100
2273    "r_mbytes_per_sec": 50
2274    "w_mbytes_per_sec": 50
2275  }
2276}
2277~~~
2278
2279Example response:
2280
2281~~~json
2282{
2283  "jsonrpc": "2.0",
2284  "id": 1,
2285  "result": true
2286}
2287~~~
2288
2289### bdev_set_qd_sampling_period {#rpc_bdev_set_qd_sampling_period}
2290
2291Enable queue depth tracking on a specified bdev.
2292
2293#### Parameters
2294
2295Name                    | Optional | Type        | Description
2296----------------------- | -------- | ----------- | -----------
2297name                    | Required | string      | Block device name
2298period                  | Required | int         | period (in microseconds).If set to 0, polling will be disabled.
2299
2300#### Example
2301
2302Example request:
2303
2304~~~json
2305{
2306  "jsonrpc": "2.0",
2307  "method": "bdev_set_qd_sampling_period",
2308  "id": 1,
2309  "params": {
2310    "name": "Malloc0",
2311    "period": 20
2312  }
2313}
2314~~~
2315
2316Example response:
2317
2318~~~json
2319{
2320  "jsonrpc": "2.0",
2321  "id": 1,
2322  "result": true
2323}
2324~~~
2325
2326### bdev_compress_create {#rpc_bdev_compress_create}
2327
2328Create a new compress bdev on a given base bdev.
2329
2330#### Parameters
2331
2332Name                    | Optional | Type        | Description
2333----------------------- | -------- | ----------- | -----------
2334base_bdev_name          | Required | string      | Name of the base bdev
2335pm_path                 | Required | string      | Path to persistent memory
2336lb_size                 | Optional | int         | Compressed vol logical block size (512 or 4096)
2337
2338#### Result
2339
2340Name of newly created bdev.
2341
2342#### Example
2343
2344Example request:
2345
2346~~~json
2347{
2348  "params": {
2349    "base_bdev_name": "Nvme0n1",
2350    "pm_path": "/pm_files",
2351    "lb_size": 4096
2352  },
2353  "jsonrpc": "2.0",
2354  "method": "bdev_compress_create",
2355  "id": 1
2356}
2357~~~
2358
2359### bdev_compress_delete {#rpc_bdev_compress_delete}
2360
2361Delete a compressed bdev.
2362
2363#### Parameters
2364
2365Name                    | Optional | Type        | Description
2366----------------------- | -------- | ----------- | -----------
2367name                    | Required | string      | Name of the compress bdev
2368
2369#### Example
2370
2371Example request:
2372
2373~~~json
2374{
2375  "params": {
2376    "name": "COMP_Nvme0n1"
2377  },
2378  "jsonrpc": "2.0",
2379  "method": "bdev_compress_delete",
2380  "id": 1
2381}
2382~~~
2383
2384Example response:
2385
2386~~~json
2387{
2388  "jsonrpc": "2.0",
2389  "id": 1,
2390  "result": true
2391}
2392~~~
2393
2394### bdev_compress_get_orphans {#rpc_bdev_compress_get_orphans}
2395
2396Get a list of compressed volumes that are missing their pmem metadata.
2397
2398#### Parameters
2399
2400Name                    | Optional | Type        | Description
2401----------------------- | -------- | ----------- | -----------
2402name                    | Required | string      | Name of the compress bdev
2403
2404#### Example
2405
2406Example request:
2407
2408~~~json
2409{
2410  "params": {
2411    "name": "COMP_Nvme0n1"
2412  },
2413  "jsonrpc": "2.0",
2414  "method": "bdev_compress_get_orphans",
2415  "id": 1
2416}
2417~~~
2418
2419Example response:
2420
2421~~~json
2422{
2423  "jsonrpc": "2.0",
2424  "id": 1,
2425  "name": "COMP_Nvme0n1"
2426}
2427~~~
2428
2429### bdev_compress_set_pmd {#rpc_bdev_compress_set_pmd}
2430
2431Select the DPDK polled mode driver (pmd) for a compressed bdev,
24320 = auto-select, 1= QAT only, 2 = ISAL only, 3 = mlx5_pci only.
2433
2434#### Parameters
2435
2436Name                    | Optional | Type        | Description
2437----------------------- | -------- | ----------- | -----------
2438pmd                     | Required | int         | pmd selection
2439
2440#### Example
2441
2442Example request:
2443
2444~~~json
2445{
2446  "params": {
2447    "pmd": 1
2448  },
2449  "jsonrpc": "2.0",
2450  "method": "bdev_compress_set_pmd",
2451  "id": 1
2452}
2453~~~
2454
2455Example response:
2456
2457~~~json
2458{
2459  "jsonrpc": "2.0",
2460  "id": 1,
2461  "result": true
2462}
2463~~~
2464
2465### bdev_crypto_create {#rpc_bdev_crypto_create}
2466
2467Create a new crypto bdev on a given base bdev.
2468
2469#### Parameters
2470
2471Name                    | Optional | Type        | Description
2472----------------------- | -------- | ----------- | -----------
2473base_bdev_name          | Required | string      | Name of the base bdev
2474name                    | Required | string      | Name of the crypto vbdev to create
2475crypto_pmd              | Required | string      | Name of the crypto device driver
2476key                     | Required | string      | Key in hex form
2477cipher                  | Required | string      | Cipher to use, AES_CBC or AES_XTS (QAT and MLX5)
2478key2                    | Required | string      | 2nd key in hex form only required for cipher AES_XTS
2479
2480Both key and key2 must be passed in the hexlified form. For example, 256bit AES key may look like this:
2481afd9477abf50254219ccb75965fbe39f23ebead5676e292582a0a67f66b88215
2482
2483#### Result
2484
2485Name of newly created bdev.
2486
2487#### Example
2488
2489Example request:
2490
2491~~~json
2492{
2493  "params": {
2494    "base_bdev_name": "Nvme0n1",
2495    "name": "my_crypto_bdev",
2496    "crypto_pmd": "crypto_aesni_mb",
2497    "key": "12345678901234561234567890123456",
2498    "cipher": "AES_CBC"
2499  },
2500  "jsonrpc": "2.0",
2501  "method": "bdev_crypto_create",
2502  "id": 1
2503}
2504~~~
2505
2506Example response:
2507
2508~~~json
2509{
2510
2511  "jsonrpc": "2.0",
2512  "id": 1,
2513  "result": "my_crypto_bdev"
2514}
2515~~~
2516
2517### bdev_crypto_delete {#rpc_bdev_crypto_delete}
2518
2519Delete a crypto bdev.
2520
2521#### Parameters
2522
2523Name                    | Optional | Type        | Description
2524----------------------- | -------- | ----------- | -----------
2525name                    | Required | string      | Name of the crypto bdev
2526
2527#### Example
2528
2529Example request:
2530
2531~~~json
2532{
2533  "params": {
2534    "name": "my_crypto_bdev"
2535  },
2536  "jsonrpc": "2.0",
2537  "method": "bdev_crypto_delete",
2538  "id": 1
2539}
2540~~~
2541
2542Example response:
2543
2544~~~json
2545{
2546  "jsonrpc": "2.0",
2547  "id": 1,
2548  "result": true
2549}
2550~~~
2551
2552### bdev_ocf_create {#rpc_bdev_ocf_create}
2553
2554Construct new OCF bdev.
2555Command accepts cache mode that is going to be used.
2556You can find more details about supported cache modes in the [OCF documentation](https://open-cas.github.io/cache_configuration.html#cache-mode)
2557
2558#### Parameters
2559
2560Name                    | Optional | Type        | Description
2561----------------------- | -------- | ----------- | -----------
2562name                    | Required | string      | Bdev name to use
2563mode                    | Required | string      | OCF cache mode: wb, wt, pt, wa, wi, wo
2564cache_line_size         | Optional | int         | OCF cache line size in KiB: 4, 8, 16, 32, 64
2565cache_bdev_name         | Required | string      | Name of underlying cache bdev
2566core_bdev_name          | Required | string      | Name of underlying core bdev
2567
2568#### Result
2569
2570Name of newly created bdev.
2571
2572#### Example
2573
2574Example request:
2575
2576~~~json
2577{
2578  "params": {
2579    "name": "ocf0",
2580    "mode": "wt",
2581    "cache_line_size": 64,
2582    "cache_bdev_name": "Nvme0n1",
2583    "core_bdev_name": "aio0"
2584  },
2585  "jsonrpc": "2.0",
2586  "method": "bdev_ocf_create",
2587  "id": 1
2588}
2589~~~
2590
2591Example response:
2592
2593~~~json
2594{
2595  "jsonrpc": "2.0",
2596  "id": 1,
2597  "result": "ocf0"
2598}
2599~~~
2600
2601### bdev_ocf_delete {#rpc_bdev_ocf_delete}
2602
2603Delete the OCF bdev
2604
2605#### Parameters
2606
2607Name                    | Optional | Type        | Description
2608----------------------- | -------- | ----------- | -----------
2609name                    | Required | string      | Bdev name
2610
2611#### Example
2612
2613Example request:
2614
2615~~~json
2616{
2617  "params": {
2618    "name": "ocf0"
2619  },
2620  "jsonrpc": "2.0",
2621  "method": "bdev_ocf_delete",
2622  "id": 1
2623}
2624~~~
2625
2626Example response:
2627
2628~~~json
2629{
2630  "jsonrpc": "2.0",
2631  "id": 1,
2632  "result": true
2633}
2634~~~
2635
2636### bdev_ocf_get_stats {#rpc_bdev_ocf_get_stats}
2637
2638Get statistics of chosen OCF block device.
2639
2640#### Parameters
2641
2642Name                    | Optional | Type        | Description
2643----------------------- | -------- | ----------- | -----------
2644name                    | Required | string      | Block device name
2645
2646#### Response
2647
2648Statistics as json object.
2649
2650#### Example
2651
2652Example request:
2653
2654~~~json
2655{
2656  "jsonrpc": "2.0",
2657  "method": "bdev_ocf_get_stats",
2658  "id": 1
2659}
2660~~~
2661
2662Example response:
2663
2664~~~json
2665{
2666  "jsonrpc": "2.0",
2667  "id": 1,
2668  "result": [
2669  "usage": {
2670    "clean": {
2671      "count": 76033,
2672      "units": "4KiB blocks",
2673      "percentage": "100.0"
2674    },
2675    "free": {
2676      "count": 767,
2677      "units": "4KiB blocks",
2678      "percentage": "0.9"
2679    },
2680    "occupancy": {
2681      "count": 76033,
2682      "units": "4KiB blocks",
2683      "percentage": "99.0"
2684    },
2685    "dirty": {
2686      "count": 0,
2687      "units": "4KiB blocks",
2688      "percentage": "0.0"
2689    }
2690  },
2691  "requests": {
2692    "rd_total": {
2693      "count": 2,
2694      "units": "Requests",
2695      "percentage": "0.0"
2696    },
2697    "wr_full_misses": {
2698      "count": 76280,
2699      "units": "Requests",
2700      "percentage": "35.6"
2701    },
2702    "rd_full_misses": {
2703      "count": 1,
2704      "units": "Requests",
2705      "percentage": "0.0"
2706    },
2707    "rd_partial_misses": {
2708      "count": 0,
2709      "units": "Requests",
2710      "percentage": "0.0"
2711    },
2712    "wr_total": {
2713      "count": 212416,
2714      "units": "Requests",
2715      "percentage": "99.2"
2716    },
2717    "wr_pt": {
2718      "count": 1535,
2719      "units": "Requests",
2720      "percentage": "0.7"
2721    },
2722    "wr_partial_misses": {
2723      "count": 0,
2724      "units": "Requests",
2725      "percentage": "0.0"
2726    },
2727    "serviced": {
2728      "count": 212418,
2729      "units": "Requests",
2730      "percentage": "99.2"
2731    },
2732    "rd_pt": {
2733      "count": 0,
2734      "units": "Requests",
2735      "percentage": "0.0"
2736    },
2737    "total": {
2738      "count": 213953,
2739      "units": "Requests",
2740      "percentage": "100.0"
2741    },
2742    "rd_hits": {
2743      "count": 1,
2744      "units": "Requests",
2745      "percentage": "0.0"
2746    },
2747    "wr_hits": {
2748      "count": 136136,
2749      "units": "Requests",
2750      "percentage": "63.6"
2751    }
2752  },
2753  "errors": {
2754    "total": {
2755      "count": 0,
2756      "units": "Requests",
2757      "percentage": "0.0"
2758    },
2759    "cache_obj_total": {
2760      "count": 0,
2761      "units": "Requests",
2762      "percentage": "0.0"
2763    },
2764    "core_obj_total": {
2765      "count": 0,
2766      "units": "Requests",
2767      "percentage": "0.0"
2768    },
2769    "cache_obj_rd": {
2770      "count": 0,
2771      "units": "Requests",
2772      "percentage": "0.0"
2773    },
2774    "core_obj_wr": {
2775      "count": 0,
2776      "units": "Requests",
2777      "percentage": "0.0"
2778    },
2779    "core_obj_rd": {
2780      "count": 0,
2781      "units": "Requests",
2782      "percentage": "0.0"
2783    },
2784    "cache_obj_wr": {
2785      "count": 0,
2786      "units": "Requests",
2787      "percentage": "0.0"
2788    }
2789  },
2790  "blocks": {
2791    "volume_rd": {
2792      "count": 9,
2793      "units": "4KiB blocks",
2794      "percentage": "0.0"
2795    },
2796    "volume_wr": {
2797      "count": 213951,
2798      "units": "4KiB blocks",
2799      "percentage": "99.9"
2800    },
2801    "cache_obj_total": {
2802      "count": 212425,
2803      "units": "4KiB blocks",
2804      "percentage": "100.0"
2805    },
2806    "core_obj_total": {
2807      "count": 213959,
2808      "units": "4KiB blocks",
2809      "percentage": "100.0"
2810    },
2811    "cache_obj_rd": {
2812      "count": 1,
2813      "units": "4KiB blocks",
2814      "percentage": "0.0"
2815    },
2816    "core_obj_wr": {
2817      "count": 213951,
2818      "units": "4KiB blocks",
2819      "percentage": "99.9"
2820    },
2821    "volume_total": {
2822      "count": 213960,
2823      "units": "4KiB blocks",
2824      "percentage": "100.0"
2825    },
2826    "core_obj_rd": {
2827      "count": 8,
2828      "units": "4KiB blocks",
2829      "percentage": "0.0"
2830    },
2831    "cache_obj_wr": {
2832      "count": 212424,
2833      "units": "4KiB blocks",
2834      "percentage": "99.9"
2835    }
2836  ]
2837}
2838~~~
2839
2840### bdev_ocf_get_bdevs {#rpc_bdev_ocf_get_bdevs}
2841
2842Get list of OCF devices including unregistered ones.
2843
2844#### Parameters
2845
2846Name                    | Optional | Type        | Description
2847----------------------- | -------- | ----------- | -----------
2848name                    | Optional | string      | Name of OCF vbdev or name of cache device or name of core device
2849
2850#### Response
2851
2852Array of OCF devices with their current status, along with core and cache bdevs.
2853
2854#### Example
2855
2856Example request:
2857
2858~~~json
2859{
2860  "jsonrpc": "2.0",
2861  "method": "bdev_ocf_get_bdevs",
2862  "id": 1
2863}
2864~~~
2865
2866Example response:
2867
2868~~~json
2869{
2870  "jsonrpc": "2.0",
2871  "id": 1,
2872  "result": [
2873    {
2874      "name": "PartCache",
2875      "started": false,
2876      "cache": {
2877        "name": "Malloc0",
2878        "attached": true
2879      },
2880      "core": {
2881        "name": "Malloc1",
2882        "attached": false
2883      }
2884    }
2885  ]
2886}
2887~~~
2888
2889### bdev_ocf_set_cache_mode {#rpc_bdev_ocf_set_cache_mode}
2890
2891Set new cache mode on OCF bdev.
2892
2893#### Parameters
2894
2895Name                    | Optional | Type        | Description
2896----------------------- | -------- | ----------- | -----------
2897name                    | Required | string      | Bdev name
2898mode                    | Required | string      | OCF cache mode: wb, wt, pt, wa, wi, wo
2899
2900#### Response
2901
2902New cache mode name.
2903
2904#### Example
2905
2906Example request:
2907
2908~~~json
2909{
2910  "params": {
2911    "name": "ocf0",
2912    "mode": "pt",
2913  },
2914  "jsonrpc": "2.0",
2915  "method": "bdev_ocf_set_cache_mode",
2916  "id": 1
2917}
2918~~~
2919
2920Example response:
2921
2922~~~json
2923{
2924  "jsonrpc": "2.0",
2925  "id": 1,
2926  "result": "pt"
2927}
2928~~~
2929
2930### bdev_ocf_set_seqcutoff {#rpc_bdev_ocf_set_seqcutoff}
2931
2932Set sequential cutoff parameters on all cores for the given OCF cache device.
2933A brief description of this functionality can be found in [OpenCAS documentation](https://open-cas.github.io/guide_tool_details.html#seq-cutoff).
2934
2935#### Parameters
2936
2937Name                    | Optional | Type        | Description
2938----------------------- | -------- | ----------- | -----------
2939name                    | Required | string      | Bdev name
2940policy                  | Required | string      | Sequential cutoff policy: always, full, never
2941threshold               | Optional | int         | Activation threshold in KiB
2942promotion_count         | Optional | int         | Promotion request count
2943
2944#### Example
2945
2946Example request:
2947
2948~~~json
2949{
2950  "params": {
2951    "name": "ocf0",
2952    "policy": "full",
2953    "threshold": 4,
2954    "promotion_count": 2
2955  },
2956  "jsonrpc": "2.0",
2957  "method": "bdev_ocf_set_seqcutoff",
2958  "id": 1
2959}
2960~~~
2961
2962Example response:
2963
2964~~~json
2965{
2966  "jsonrpc": "2.0",
2967  "id": 1,
2968  "result": true
2969}
2970~~~
2971
2972### bdev_ocf_flush_start {#rpc_bdev_ocf_flush_start}
2973
2974Start flushing OCF cache device.
2975
2976Automatic flushes of dirty data are managed by OCF cleaning policy settings.
2977In addition to that, all dirty data is flushed to core device when there is
2978an attempt to stop caching.
2979On the other hand, this RPC call gives a possibility to flush dirty data manually
2980when there is a need for it, e.g. to speed up the shutdown process when data
2981hasn't been flushed for a long time.
2982This RPC returns immediately, and flush is then being performed in the
2983background. To see the status of flushing operation use bdev_ocf_flush_status.
2984
2985#### Parameters
2986
2987Name                    | Optional | Type        | Description
2988----------------------- | -------- | ----------- | -----------
2989name                    | Required | string      | Bdev name
2990
2991#### Example
2992
2993Example request:
2994
2995~~~json
2996{
2997  "params": {
2998    "name": "ocf0"
2999  },
3000  "jsonrpc": "2.0",
3001  "method": "bdev_ocf_flush_start",
3002  "id": 1
3003}
3004~~~
3005
3006Example response:
3007
3008~~~json
3009{
3010  "jsonrpc": "2.0",
3011  "id": 1,
3012  "result": true
3013}
3014~~~
3015
3016### bdev_ocf_flush_status {#rpc_bdev_ocf_flush_status}
3017
3018Get flush status of OCF cache device.
3019
3020Automatic flushes of dirty data are managed by OCF cleaning policy settings.
3021In addition to that, all dirty data is flushed to core device when there is
3022an attempt to stop caching.
3023On the other hand, there is a possibility to flush dirty data manually
3024when there is a need for it, e.g. to speed up the shutdown process when data
3025hasn't been flushed for a long time.
3026This RPC reports if such manual flush is still in progress and if the operation
3027was successful. To start manual flush use bdev_ocf_flush_start.
3028
3029#### Parameters
3030
3031Name                    | Optional | Type        | Description
3032----------------------- | -------- | ----------- | -----------
3033name                    | Required | string      | Bdev name
3034
3035#### Response
3036
3037Status of OCF cache device flush.
3038
3039#### Example
3040
3041Example request:
3042
3043~~~json
3044{
3045  "params": {
3046    "name": "ocf0"
3047  },
3048  "jsonrpc": "2.0",
3049  "method": "bdev_ocf_flush_status",
3050  "id": 1
3051}
3052~~~
3053
3054Example response:
3055
3056~~~json
3057{
3058  "jsonrpc": "2.0",
3059  "id": 1,
3060  "result": {
3061    "in_progress": false,
3062    "status": 0
3063  }
3064}
3065~~~
3066
3067### bdev_malloc_create {#rpc_bdev_malloc_create}
3068
3069Construct @ref bdev_config_malloc
3070
3071The `dif_type` parameter can have 0, 1, 2, or 3, and controls the check of the guard tag and the reference tag.
3072If the `dif_type` is 1, 2, or 3, the malloc bdev compares the guard tag to the CRC-16 computed over the block data.
3073If the `dif_type` is 1 or 2, the malloc bdev compares the reference tag to the computed reference tag.
3074The computed reference tag for the first block of the I/O is the `init_ref_tag` of the DIF context, and
3075the computed reference tag is incremented for each subsequent block.
3076If the `dif_type` is 3, the malloc bdev does not check the reference tag.
3077The application tag is not checked by the malloc bdev because the current block device API does not expose
3078it to the upper layer yet.
3079
3080#### Parameters
3081
3082Name                    | Optional | Type        | Description
3083----------------------- | -------- | ----------- | -----------
3084name                    | Optional | string      | Bdev name to use
3085block_size              | Required | number      | Data block size in bytes -must be multiple of 512
3086num_blocks              | Required | number      | Number of blocks
3087uuid                    | Optional | string      | UUID of new bdev
3088optimal_io_boundary     | Optional | number      | Split on optimal IO boundary, in number of blocks, default 0
3089md_size                 | Optional | number      | Metadata size for this bdev (0, 8, 16, 32, 64, or 128). Default is 0.
3090md_interleave           | Optional | boolean     | Metadata location, interleaved if true, and separated if false. Default is false.
3091dif_type                | Optional | number      | Protection information type. Parameter --md-size needs to be set along --dif-type. Default=0 - no protection.
3092dif_is_head_of_md       | Optional | boolean     | Protection information is in the first 8 bytes of metadata. Default=false.
3093
3094#### Result
3095
3096Name of newly created bdev.
3097
3098#### Example
3099
3100Example request:
3101
3102~~~json
3103{
3104  "params": {
3105    "block_size": 4096,
3106    "num_blocks": 16384,
3107    "name": "Malloc0",
3108    "uuid": "2b6601ba-eada-44fb-9a83-a20eb9eb9e90",
3109    "optimal_io_boundary": 16
3110  },
3111  "jsonrpc": "2.0",
3112  "method": "bdev_malloc_create",
3113  "id": 1
3114}
3115~~~
3116
3117Example response:
3118
3119~~~json
3120{
3121  "jsonrpc": "2.0",
3122  "id": 1,
3123  "result": "Malloc0"
3124}
3125~~~
3126
3127### bdev_malloc_delete {#rpc_bdev_malloc_delete}
3128
3129Delete @ref bdev_config_malloc
3130
3131#### Parameters
3132
3133Name                    | Optional | Type        | Description
3134----------------------- | -------- | ----------- | -----------
3135name                    | Required | string      | Bdev name
3136
3137#### Example
3138
3139Example request:
3140
3141~~~json
3142{
3143  "params": {
3144    "name": "Malloc0"
3145  },
3146  "jsonrpc": "2.0",
3147  "method": "bdev_malloc_delete",
3148  "id": 1
3149}
3150~~~
3151
3152Example response:
3153
3154~~~json
3155{
3156  "jsonrpc": "2.0",
3157  "id": 1,
3158  "result": true
3159}
3160~~~
3161
3162### bdev_null_create {#rpc_bdev_null_create}
3163
3164Construct @ref bdev_config_null
3165
3166#### Parameters
3167
3168Name                    | Optional | Type        | Description
3169----------------------- | -------- | ----------- | -----------
3170name                    | Optional | string      | Bdev name to use
3171block_size              | Required | number      | Block size in bytes
3172num_blocks              | Required | number      | Number of blocks
3173uuid                    | Optional | string      | UUID of new bdev
3174md_size                 | Optional | number      | Metadata size for this bdev. Default=0.
3175dif_type                | Optional | number      | Protection information type. Parameter --md-size needs to be set along --dif-type. Default=0 - no protection.
3176dif_is_head_of_md       | Optional | boolean     | Protection information is in the first 8 bytes of metadata. Default=false.
3177
3178#### Result
3179
3180Name of newly created bdev.
3181
3182#### Example
3183
3184Example request:
3185
3186~~~json
3187{
3188  "params": {
3189    "block_size": 4104,
3190    "num_blocks": 16384,
3191    "name": "Null0",
3192    "uuid": "2b6601ba-eada-44fb-9a83-a20eb9eb9e90",
3193    "md_size": 8,
3194    "dif_type": 1,
3195    "dif_is_head_of_md": true
3196  },
3197  "jsonrpc": "2.0",
3198  "method": "bdev_null_create",
3199  "id": 1
3200}
3201~~~
3202
3203Example response:
3204
3205~~~json
3206{
3207  "jsonrpc": "2.0",
3208  "id": 1,
3209  "result": "Null0"
3210}
3211~~~
3212
3213### bdev_null_delete {#rpc_bdev_null_delete}
3214
3215Delete @ref bdev_config_null.
3216
3217#### Parameters
3218
3219Name                    | Optional | Type        | Description
3220----------------------- | -------- | ----------- | -----------
3221name                    | Required | string      | Bdev name
3222
3223#### Example
3224
3225Example request:
3226
3227~~~json
3228{
3229  "params": {
3230    "name": "Null0"
3231  },
3232  "jsonrpc": "2.0",
3233  "method": "bdev_null_delete",
3234  "id": 1
3235}
3236~~~
3237
3238Example response:
3239
3240~~~json
3241{
3242  "jsonrpc": "2.0",
3243  "id": 1,
3244  "result": true
3245}
3246~~~
3247
3248### bdev_null_resize {#rpc_bdev_null_resize}
3249
3250Resize @ref bdev_config_null.
3251
3252#### Parameters
3253
3254Name                    | Optional | Type        | Description
3255----------------------- | -------- | ----------- | -----------
3256name                    | Required | string      | Bdev name
3257new_size                | Required | number      | Bdev new capacity in MB
3258
3259#### Example
3260
3261Example request:
3262
3263~~~json
3264{
3265  "params": {
3266    "name": "Null0",
3267    "new_size": 4096
3268  },
3269  "jsonrpc": "2.0",
3270  "method": "bdev_null_resize",
3271  "id": 1
3272}
3273~~~
3274
3275Example response:
3276
3277~~~json
3278{
3279  "jsonrpc": "2.0",
3280  "id": 1,
3281  "result": true
3282}
3283~~~
3284
3285### bdev_aio_create {#rpc_bdev_aio_create}
3286
3287Construct @ref bdev_config_aio.
3288
3289#### Parameters
3290
3291Name                    | Optional | Type        | Description
3292----------------------- | -------- | ----------- | -----------
3293name                    | Required | string      | Bdev name to use
3294filename                | Required | number      | Path to device or file
3295block_size              | Optional | number      | Block size in bytes
3296
3297#### Result
3298
3299Name of newly created bdev.
3300
3301#### Example
3302
3303Example request:
3304
3305~~~json
3306{
3307  "params": {
3308    "block_size": 4096,
3309    "name": "Aio0",
3310    "filename": "/tmp/aio_bdev_file"
3311  },
3312  "jsonrpc": "2.0",
3313  "method": "bdev_aio_create",
3314  "id": 1
3315}
3316~~~
3317
3318Example response:
3319
3320~~~json
3321{
3322  "jsonrpc": "2.0",
3323  "id": 1,
3324  "result": "Aio0"
3325}
3326~~~
3327
3328### bdev_aio_rescan {#rpc_bdev_aio_rescan}
3329
3330Rescan the size of @ref bdev_config_aio.
3331
3332#### Parameters
3333
3334Name                    | Optional | Type        | Description
3335----------------------- | -------- | ----------- | -----------
3336name                    | Required | string      | Bdev name
3337
3338#### Example
3339
3340Example request:
3341
3342~~~json
3343{
3344  "params": {
3345    "name": "Aio0"
3346  },
3347  "jsonrpc": "2.0",
3348  "method": "bdev_aio_rescan",
3349  "id": 1
3350}
3351~~~
3352
3353Example response:
3354
3355~~~json
3356{
3357  "jsonrpc": "2.0",
3358  "id": 1,
3359  "result": true
3360}
3361~~~
3362
3363### bdev_aio_delete {#rpc_bdev_aio_delete}
3364
3365Delete @ref bdev_config_aio.
3366
3367#### Parameters
3368
3369Name                    | Optional | Type        | Description
3370----------------------- | -------- | ----------- | -----------
3371name                    | Required | string      | Bdev name
3372
3373#### Example
3374
3375Example request:
3376
3377~~~json
3378{
3379  "params": {
3380    "name": "Aio0"
3381  },
3382  "jsonrpc": "2.0",
3383  "method": "bdev_aio_delete",
3384  "id": 1
3385}
3386~~~
3387
3388Example response:
3389
3390~~~json
3391{
3392  "jsonrpc": "2.0",
3393  "id": 1,
3394  "result": true
3395}
3396~~~
3397
3398### bdev_nvme_set_options {#rpc_bdev_nvme_set_options}
3399
3400Set global parameters for all bdev NVMe. This RPC may only be called before SPDK subsystems have been initialized
3401or any bdev NVMe has been created.
3402
3403Parameters, ctrlr_loss_timeout_sec, reconnect_delay_sec, and fast_io_fail_timeout_sec, are for I/O error resiliency.
3404They can be overridden if they are given by the RPC bdev_nvme_attach_controller.
3405
3406#### Parameters
3407
3408Name                       | Optional | Type        | Description
3409-------------------------- | -------- | ----------- | -----------
3410action_on_timeout          | Optional | string      | Action to take on command time out: none, reset or abort
3411timeout_us                 | Optional | number      | Timeout for each command, in microseconds. If 0, don't track timeouts
3412timeout_admin_us           | Optional | number      | Timeout for each admin command, in microseconds. If 0, treat same as io timeouts ('timeout_us')
3413keep_alive_timeout_ms      | Optional | number      | Keep alive timeout period in milliseconds, default is 10s
3414retry_count                | Optional | number      | The number of attempts per I/O before an I/O fails. (Deprecated. Please use transport_retry_count instead.)
3415arbitration_burst          | Optional | number      | The value is expressed as a power of two, a value of 111b indicates no limit
3416low_priority_weight        | Optional | number      | The maximum number of commands that the controller may launch at one time from a low priority queue
3417medium_priority_weight     | Optional | number      | The maximum number of commands that the controller may launch at one time from a medium priority queue
3418high_priority_weight       | Optional | number      | The maximum number of commands that the controller may launch at one time from a high priority queue
3419nvme_adminq_poll_period_us | Optional | number      | How often the admin queue is polled for asynchronous events in microseconds
3420nvme_ioq_poll_period_us    | Optional | number      | How often I/O queues are polled for completions, in microseconds. Default: 0 (as fast as possible).
3421io_queue_requests          | Optional | number      | The number of requests allocated for each NVMe I/O queue. Default: 512.
3422delay_cmd_submit           | Optional | boolean     | Enable delaying NVMe command submission to allow batching of multiple commands. Default: `true`.
3423transport_retry_count      | Optional | number      | The number of attempts per I/O in the transport layer before an I/O fails.
3424bdev_retry_count           | Optional | number      | The number of attempts per I/O in the bdev layer before an I/O fails. -1 means infinite retries.
3425transport_ack_timeout      | Optional | number      | Time to wait ack until retransmission for RDMA or connection close for TCP. Range 0-31 where 0 means use default.
3426ctrlr_loss_timeout_sec     | Optional | number      | Time to wait until ctrlr is reconnected before deleting ctrlr.  -1 means infinite reconnects. 0 means no reconnect.
3427reconnect_delay_sec        | Optional | number      | Time to delay a reconnect trial. 0 means no reconnect.
3428fast_io_fail_timeout_sec   | Optional | number      | Time to wait until ctrlr is reconnected before failing I/O to ctrlr. 0 means no such timeout.
3429disable_auto_failback      | Optional | boolean     | Disable automatic failback. The RPC bdev_nvme_set_preferred_path can be used to do manual failback.
3430generate_uuids             | Optional | boolean     | Enable generation of UUIDs for NVMe bdevs that do not provide this value themselves.
3431
3432#### Example
3433
3434Example request:
3435
3436~~~json
3437request:
3438{
3439  "params": {
3440    "transport_retry_count": 5,
3441    "arbitration_burst": 3,
3442    "low_priority_weight": 8,
3443    "medium_priority_weight":8,
3444    "high_priority_weight": 8,
3445    "nvme_adminq_poll_period_us": 2000,
3446    "timeout_us": 10000000,
3447    "timeout_admin_us": 20000000,
3448    "keep_alive_timeout_ms": 600000,
3449    "action_on_timeout": "reset",
3450    "io_queue_requests" : 2048,
3451    "delay_cmd_submit": true
3452  },
3453  "jsonrpc": "2.0",
3454  "method": "bdev_nvme_set_options",
3455  "id": 1
3456}
3457~~~
3458
3459Example response:
3460
3461~~~json
3462{
3463  "jsonrpc": "2.0",
3464  "id": 1,
3465  "result": true
3466}
3467~~~
3468
3469### bdev_nvme_set_hotplug {#rpc_bdev_nvme_set_hotplug}
3470
3471Change settings of the NVMe hotplug feature. If enabled, PCIe NVMe bdevs will be automatically discovered on insertion
3472and deleted on removal.
3473
3474#### Parameters
3475
3476Name                    | Optional | Type        | Description
3477----------------------- | -------- | ----------- | -----------
3478enabled                 | Required | string      | True to enable, false to disable
3479period_us               | Optional | number      | How often to poll for hot-insert and hot-remove events. Values: 0 - reset/use default or 1 to 10000000.
3480
3481#### Example
3482
3483Example request:
3484
3485~~~json
3486request:
3487{
3488  "params": {
3489    "enabled": true,
3490    "period_us": 2000
3491  },
3492  "jsonrpc": "2.0",
3493  "method": "bdev_nvme_set_hotplug",
3494  "id": 1
3495}
3496~~~
3497
3498Example response:
3499
3500~~~json
3501{
3502  "jsonrpc": "2.0",
3503  "id": 1,
3504  "result": true
3505}
3506~~~
3507
3508### bdev_nvme_attach_controller {#rpc_bdev_nvme_attach_controller}
3509
3510Construct @ref bdev_config_nvme. This RPC can also be used to add additional paths to an existing controller to enable
3511multipathing. This is done by specifying the `name` parameter as an existing controller. When adding an additional
3512path, the hostnqn, hostsvcid, hostaddr, prchk_reftag, and prchk_guard_arguments must not be specified and are assumed
3513to have the same value as the existing path.
3514
3515The parameters, `ctrlr_loss_timeout_sec`, `reconnect_delay_sec`, and `fast_io_fail_timeout_sec`, are mutually dependent.
3516If `reconnect_delay_sec` is non-zero, `ctrlr_loss_timeout_sec` has to be -1 or not less than `reconnect_delay_sec`.
3517If `reconnect_delay_sec` is zero, `ctrlr_loss_timeout_sec` has to be zero.
3518If `fast_io_fail_timeout_sec` is not zero, it has to be not less than `reconnect_delay_sec` and less than `ctrlr_loss_timeout_sec` if `ctrlr_loss_timeout_sec` is not -1.
3519
3520#### Result
3521
3522Array of names of newly created bdevs.
3523
3524#### Parameters
3525
3526Name                       | Optional | Type        | Description
3527-------------------------- | -------- | ----------- | -----------
3528name                       | Required | string      | Name of the NVMe controller, prefix for each bdev name
3529trtype                     | Required | string      | NVMe-oF target trtype: rdma or pcie
3530traddr                     | Required | string      | NVMe-oF target address: ip or BDF
3531adrfam                     | Optional | string      | NVMe-oF target adrfam: ipv4, ipv6, ib, fc, intra_host
3532trsvcid                    | Optional | string      | NVMe-oF target trsvcid: port number
3533subnqn                     | Optional | string      | NVMe-oF target subnqn
3534hostnqn                    | Optional | string      | NVMe-oF target hostnqn
3535hostaddr                   | Optional | string      | NVMe-oF host address: ip address
3536hostsvcid                  | Optional | string      | NVMe-oF host trsvcid: port number
3537prchk_reftag               | Optional | bool        | Enable checking of PI reference tag for I/O processing
3538prchk_guard                | Optional | bool        | Enable checking of PI guard for I/O processing
3539hdgst                      | Optional | bool        | Enable TCP header digest
3540ddgst                      | Optional | bool        | Enable TCP data digest
3541fabrics_connect_timeout_us | Optional | bool        | Timeout for fabrics connect (in microseconds)
3542multipath                  | Optional | string      | Multipathing behavior: disable, failover, multipath. Default is failover.
3543num_io_queues              | Optional | uint32_t    | The number of IO queues to request during initialization. Range: (0, UINT16_MAX + 1], Default is 1024.
3544ctrlr_loss_timeout_sec     | Optional | number      | Time to wait until ctrlr is reconnected before deleting ctrlr.  -1 means infinite reconnects. 0 means no reconnect.
3545reconnect_delay_sec        | Optional | number      | Time to delay a reconnect trial. 0 means no reconnect.
3546fast_io_fail_timeout_sec   | Optional | number      | Time to wait until ctrlr is reconnected before failing I/O to ctrlr. 0 means no such timeout.
3547psk                        | Optional | string      | PSK in hexadecimal digits, e.g. 1234567890ABCDEF (Enables SSL socket implementation for TCP)
3548
3549#### Example
3550
3551Example request:
3552
3553~~~json
3554{
3555  "params": {
3556    "trtype": "pcie",
3557    "name": "Nvme0",
3558    "traddr": "0000:0a:00.0"
3559  },
3560  "jsonrpc": "2.0",
3561  "method": "bdev_nvme_attach_controller",
3562  "id": 1
3563}
3564~~~
3565
3566Example response:
3567
3568~~~json
3569{
3570  "jsonrpc": "2.0",
3571  "id": 1,
3572  "result": [
3573    "Nvme0n1"
3574  ]
3575}
3576~~~
3577
3578### bdev_nvme_get_controllers {#rpc_bdev_nvme_get_controllers}
3579
3580Get information about NVMe controllers.
3581
3582#### Parameters
3583
3584The user may specify no parameters in order to list all NVMe controllers, or one NVMe controller may be
3585specified by name.
3586
3587Name                    | Optional | Type        | Description
3588----------------------- | -------- | ----------- | -----------
3589name                    | Optional | string      | NVMe controller name
3590
3591#### Response
3592
3593The response is an array of objects containing information about the requested NVMe controllers.
3594
3595#### Example
3596
3597Example request:
3598
3599~~~json
3600{
3601  "jsonrpc": "2.0",
3602  "id": 1,
3603  "method": "bdev_nvme_get_controllers",
3604  "params": {
3605    "name": "Nvme0"
3606  }
3607}
3608~~~
3609
3610Example response:
3611
3612~~~json
3613{
3614  "jsonrpc": "2.0",
3615  "id": 1,
3616  "result": [
3617    {
3618      "name": "Nvme0",
3619      "trid": {
3620        "trtype": "PCIe",
3621        "traddr": "0000:05:00.0"
3622      },
3623      "cntlid": 0
3624    }
3625  ]
3626}
3627~~~
3628
3629### bdev_nvme_detach_controller {#rpc_bdev_nvme_detach_controller}
3630
3631Detach NVMe controller and delete any associated bdevs. Optionally,
3632If all of the transport ID options are specified, only remove that
3633transport path from the specified controller. If that is the only
3634available path for the controller, this will also result in the
3635controller being detached and the associated bdevs being deleted.
3636
3637returns true if the controller and bdevs were successfully destroyed
3638or the address was properly removed, false otherwise.
3639
3640#### Parameters
3641
3642Name                    | Optional | Type        | Description
3643----------------------- | -------- | ----------- | -----------
3644name                    | Required | string      | Controller name
3645trtype                  | Optional | string      | NVMe-oF target trtype: rdma or tcp
3646traddr                  | Optional | string      | NVMe-oF target address: ip or BDF
3647adrfam                  | Optional | string      | NVMe-oF target adrfam: ipv4, ipv6, ib, fc, intra_host
3648trsvcid                 | Optional | string      | NVMe-oF target trsvcid: port number
3649subnqn                  | Optional | string      | NVMe-oF target subnqn
3650hostaddr                | Optional | string      | NVMe-oF host address: ip
3651hostsvcid               | Optional | string      | NVMe-oF host svcid: port number
3652
3653#### Example
3654
3655Example requests:
3656
3657~~~json
3658{
3659  "params": {
3660    "name": "Nvme0"
3661  },
3662  "jsonrpc": "2.0",
3663  "method": "bdev_nvme_detach_controller",
3664  "id": 1
3665}
3666~~~
3667
3668Example response:
3669
3670~~~json
3671{
3672  "jsonrpc": "2.0",
3673  "id": 1,
3674  "result": true
3675}
3676~~~
3677
3678### bdev_nvme_reset_controller {#rpc_bdev_nvme_reset_controller}
3679
3680Reset NVMe controller.
3681
3682Returns true if the controller reset was successful, false otherwise.
3683
3684#### Parameters
3685
3686Name                    | Optional | Type        | Description
3687----------------------- | -------- | ----------- | -----------
3688name                    | Required | string      | NVMe controller name
3689
3690#### Example
3691
3692Example request:
3693
3694~~~json
3695{
3696  "jsonrpc": "2.0",
3697  "id": 1,
3698  "method": "bdev_nvme_reset_controller",
3699  "params": {
3700    "name": "Nvme0"
3701  }
3702}
3703~~~
3704
3705Example response:
3706
3707~~~json
3708{
3709  "jsonrpc": "2.0",
3710  "id": 1,
3711  "result": true
3712}
3713~~~
3714
3715### bdev_nvme_start_discovery {#rpc_bdev_nvme_start_discovery}
3716
3717Start a discovery service for the discovery subsystem of the specified transport ID.
3718
3719The discovery service will read the discovery log page for the specified
3720discovery subsystem, and automatically attach to any subsystems found in the
3721log page. When determining a controller name to use when attaching, it will use
3722the 'name' parameter as a prefix, followed by a unique integer for that discovery
3723service. If the discovery service identifies a subsystem that has been previously
3724attached but is listed with a different path, it will use the same controller name
3725as the previous entry, and connect as a multipath.
3726
3727When the discovery service sees that a subsystem entry has been removed
3728from the log page, it will automatically detach from that controller as well.
3729
3730The 'name' is also used to later stop the discovery service.
3731
3732#### Parameters
3733
3734Name                       | Optional | Type        | Description
3735-------------------------- | -------- | ----------- | -----------
3736name                       | Required | string      | Prefix for NVMe controllers
3737trtype                     | Required | string      | NVMe-oF target trtype: rdma or tcp
3738traddr                     | Required | string      | NVMe-oF target address: ip
3739adrfam                     | Optional | string      | NVMe-oF target adrfam: ipv4, ipv6
3740trsvcid                    | Optional | string      | NVMe-oF target trsvcid: port number
3741hostnqn                    | Optional | string      | NVMe-oF target hostnqn
3742wait_for_attach            | Optional | bool        | Wait to complete until all discovered NVM subsystems are attached
3743attach_timeout_ms          | Optional | number      | Time to wait until the discovery and all discovered NVM subsystems are attached
3744ctrlr_loss_timeout_sec     | Optional | number      | Time to wait until ctrlr is reconnected before deleting ctrlr.  -1 means infinite reconnects. 0 means no reconnect.
3745reconnect_delay_sec        | Optional | number      | Time to delay a reconnect trial. 0 means no reconnect.
3746fast_io_fail_timeout_sec   | Optional | number      | Time to wait until ctrlr is reconnected before failing I/O to ctrlr. 0 means no such timeout.
3747
3748#### Example
3749
3750Example request:
3751
3752~~~json
3753{
3754  "jsonrpc": "2.0",
3755  "method": "bdev_nvme_start_discovery",
3756  "id": 1,
3757  "params": {
3758    "name": "nvme_auto",
3759    "trtype": "tcp",
3760    "traddr": "127.0.0.1",
3761    "hostnqn": "nqn.2021-12.io.spdk:host1",
3762    "adrfam": "ipv4",
3763    "trsvcid": "4420"
3764  }
3765}
3766~~~
3767
3768Example response:
3769
3770~~~json
3771{
3772  "jsonrpc": "2.0",
3773  "id": 1,
3774  "result": true
3775}
3776~~~
3777
3778### bdev_nvme_stop_discovery {#rpc_bdev_nvme_stop_discovery}
3779
3780Stop a discovery service. This includes detaching any controllers that were
3781discovered via the service that is being stopped.
3782
3783#### Parameters
3784
3785Name                       | Optional | Type        | Description
3786-------------------------- | -------- | ----------- | -----------
3787name                       | Required | string      | Name of service to stop
3788
3789#### Example
3790
3791Example request:
3792
3793~~~json
3794{
3795  "jsonrpc": "2.0",
3796  "method": "bdev_nvme_stop_discovery",
3797  "id": 1,
3798  "params": {
3799    "name": "nvme_auto"
3800  }
3801}
3802~~~
3803
3804Example response:
3805
3806~~~json
3807{
3808  "jsonrpc": "2.0",
3809  "id": 1,
3810  "result": true
3811}
3812~~~
3813
3814### bdev_nvme_get_discovery_info {#rpc_bdev_nvme_get_discovery_info}
3815
3816Get information about the discovery service.
3817
3818#### Example
3819
3820Example request:
3821~~~json
3822{
3823  "jsonrpc": "2.0",
3824  "method": "bdev_nvme_get_discovery_info",
3825  "id": 1
3826}
3827~~~
3828
3829Example response:
3830
3831~~~json
3832{
3833  "jsonrpc": "2.0",
3834  "id": 1,
3835  "result": [
3836    {
3837      "name": "nvme-disc",
3838      "trid": {
3839        "trtype": "TCP",
3840        "adrfam": "IPv4",
3841        "traddr": "127.0.0.1",
3842        "trsvcid": "8009",
3843        "subnqn": "nqn.2014-08.org.nvmexpress.discovery"
3844      },
3845      "referrals": []
3846    }
3847  ]
3848}
3849~~~
3850
3851### bdev_nvme_get_io_paths {#rpc_bdev_nvme_get_io_paths}
3852
3853Display all or the specified NVMe bdev's active I/O paths.
3854
3855#### Parameters
3856
3857Name                    | Optional | Type        | Description
3858----------------------- | -------- | ----------- | -----------
3859name                    | Optional | string      | Name of the NVMe bdev
3860
3861#### Example
3862
3863Example request:
3864
3865~~~json
3866{
3867  "jsonrpc": "2.0",
3868  "method": "bdev_nvme_get_io_paths",
3869  "id": 1,
3870  "params": {
3871    "name": "Nvme0n1"
3872  }
3873}
3874~~~
3875
3876Example response:
3877
3878~~~json
3879{
3880  "jsonrpc": "2.0",
3881  "id": 1,
3882  "result": {
3883    "poll_groups": [
3884      {
3885        "thread": "app_thread",
3886        "io_paths": [
3887          {
3888            "bdev_name": "Nvme0n1",
3889            "cntlid": 0,
3890            "current": true,
3891            "connected": true,
3892            "accessible": true,
3893            "transport": {
3894              "trtype": "RDMA",
3895              "traddr": "1.2.3.4",
3896              "trsvcid": "4420",
3897              "adrfam": "IPv4"
3898            }
3899          }
3900        ]
3901      }
3902    ]
3903  }
3904}
3905~~~
3906
3907### bdev_nvme_set_preferred_path {#rpc_bdev_nvme_set_preferred_path}
3908
3909Set the preferred I/O path for an NVMe bdev in multipath mode.
3910
3911NOTE: This RPC does not support NVMe bdevs in failover mode.
3912
3913#### Parameters
3914
3915Name                    | Optional | Type        | Description
3916----------------------- | -------- | ----------- | -----------
3917name                    | Required | string      | Name of the NVMe bdev
3918cntlid                  | Required | number      | NVMe-oF controller ID
3919
3920#### Example
3921
3922Example request:
3923
3924~~~json
3925{
3926  "jsonrpc": "2.0",
3927  "method": "bdev_nvme_set_preferred_path",
3928  "id": 1,
3929  "params": {
3930    "name": "Nvme0n1",
3931    "cntlid": 0
3932  }
3933}
3934~~~
3935
3936Example response:
3937
3938~~~json
3939{
3940  "jsonrpc": "2.0",
3941  "id": 1,
3942  "result": true
3943}
3944~~~
3945
3946### bdev_nvme_set_multipath_policy {#rpc_bdev_nvme_set_multipath_policy}
3947
3948Set multipath policy of the NVMe bdev in multipath mode.
3949
3950#### Parameters
3951
3952Name                    | Optional | Type        | Description
3953----------------------- | -------- | ----------- | -----------
3954name                    | Required | string      | Name of the NVMe bdev
3955policy                  | Required | string      | Multipath policy: active_active or active_passive
3956
3957#### Example
3958
3959Example request:
3960
3961~~~json
3962{
3963  "jsonrpc": "2.0",
3964  "method": "bdev_nvme_set_multipath_policy",
3965  "id": 1,
3966  "params": {
3967    "name": "Nvme0n1",
3968    "policy": "active_passive"
3969  }
3970}
3971~~~
3972
3973Example response:
3974
3975~~~json
3976{
3977  "jsonrpc": "2.0",
3978  "id": 1,
3979  "result": true
3980}
3981~~~
3982
3983### bdev_nvme_cuse_register {#rpc_bdev_nvme_cuse_register}
3984
3985Register CUSE device on NVMe controller.
3986This feature is considered as experimental.
3987
3988#### Parameters
3989
3990Name                    | Optional | Type        | Description
3991----------------------- | -------- | ----------- | -----------
3992name                    | Required | string      | Name of the NVMe controller
3993dev_path                | Required | string      | Path to the CUSE controller device, e.g. spdk/nvme0
3994
3995#### Example
3996
3997Example request:
3998
3999~~~json
4000{
4001  "params": {
4002    "dev_path": "spdk/nvme0",
4003    "name": "Nvme0"
4004  },
4005  "jsonrpc": "2.0",
4006  "method": "bdev_nvme_cuse_register",
4007  "id": 1
4008}
4009~~~
4010
4011Example response:
4012
4013~~~json
4014{
4015  "jsonrpc": "2.0",
4016  "id": 1,
4017  "result": true
4018}
4019~~~
4020
4021### bdev_nvme_cuse_unregister {#rpc_bdev_nvme_cuse_unregister}
4022
4023Unregister CUSE device on NVMe controller.
4024This feature is considered as experimental.
4025
4026#### Parameters
4027
4028Name                    | Optional | Type        | Description
4029----------------------- | -------- | ----------- | -----------
4030name                    | Required | string      | Name of the NVMe controller
4031
4032#### Example
4033
4034Example request:
4035
4036~~~json
4037{
4038  "params": {
4039    "name": "Nvme0"
4040  },
4041  "jsonrpc": "2.0",
4042  "method": "bdev_nvme_cuse_unregister",
4043  "id": 1
4044}
4045~~~
4046
4047Example response:
4048
4049~~~json
4050{
4051  "jsonrpc": "2.0",
4052  "id": 1,
4053  "result": true
4054}
4055~~~
4056
4057### bdev_zone_block_create {#rpc_bdev_zone_block_create}
4058
4059Creates a virtual zone device on top of existing non-zoned bdev.
4060
4061#### Parameters
4062
4063Name                    | Optional | Type        | Description
4064----------------------- | -------- | ----------- | -----------
4065name                    | Required | string      | Name of the Zone device
4066base_bdev               | Required | string      | Name of the Base bdev
4067zone_capacity           | Required | number      | Zone capacity in blocks
4068optimal_open_zones      | Required | number      | Number of zones required to reach optimal write speed
4069
4070#### Example
4071
4072Example request:
4073
4074~~~json
4075{
4076  "jsonrpc": "2.0",
4077  "method": "bdev_zone_block_create",
4078  "id": 1,
4079  "params": {
4080    "name": "zone1",
4081    "base_bdev": "NVMe0n1",
4082    "zone_capacity": 4096,
4083    "optimal_open_zones": 32
4084  }
4085}
4086~~~
4087
4088Example response:
4089
4090~~~json
4091{
4092  "jsonrpc": "2.0",
4093  "id": 1,
4094  "result": "zone1"
4095}
4096~~~
4097
4098### bdev_zone_block_delete {#rpc_bdev_zone_block_delete}
4099
4100Deletes a virtual zone device.
4101
4102#### Parameters
4103
4104Name                    | Optional | Type        | Description
4105----------------------- | -------- | ----------- | -----------
4106name                    | Required | string      | Name of the Zone device
4107
4108#### Example
4109
4110Example request:
4111
4112~~~json
4113{
4114  "jsonrpc": "2.0",
4115  "method": "bdev_zone_block_delete",
4116  "id": 1,
4117  "params": {
4118    "name": "zone1"
4119  }
4120}
4121~~~
4122
4123Example response:
4124
4125~~~json
4126{
4127  "jsonrpc": "2.0",
4128  "id": 1,
4129  "result": true
4130}
4131~~~
4132
4133### bdev_nvme_apply_firmware {#rpc_bdev_nvme_apply_firmware}
4134
4135Download and commit firmware to NVMe device.
4136
4137#### Parameters
4138
4139Name                    | Optional | Type        | Description
4140----------------------- | -------- | ----------- | -----------
4141filename                | Required | string      | filename of the firmware to download
4142bdev_name               | Required | string      | Name of the NVMe block device
4143
4144#### Example
4145
4146Example request:
4147
4148~~~json
4149{
4150  "jsonrpc": "2.0",
4151  "method": "bdev_nvme_apply_firmware",
4152  "id": 1,
4153  "params": {
4154    "filename": "firmware_file",
4155    "bdev_name": "NVMe0n1"
4156  }
4157}
4158~~~
4159
4160### bdev_nvme_get_transport_statistics {#rpc_bdev_nvme_get_transport_statistics}
4161
4162Get bdev_nvme poll group transport statistics.
4163
4164#### Parameters
4165
4166This RPC method accepts no parameters
4167
4168#### Response
4169
4170The response is an array of objects containing information about transport statistics per NVME poll group.
4171
4172#### Example
4173
4174Example request:
4175
4176~~~json
4177{
4178  "jsonrpc": "2.0",
4179  "id": 1,
4180  "method": "bdev_nvme_get_transport_statistics",
4181}
4182~~~
4183
4184Example response:
4185
4186~~~json
4187{
4188  "jsonrpc": "2.0",
4189  "id": 1,
4190	"result": {
4191	  "poll_groups": [
4192		{
4193		  "thread": "nvmf_tgt_poll_group_0",
4194		  "transports": [
4195			{
4196			  "trname": "RDMA",
4197			  "devices": [
4198				{
4199				  "dev_name": "mlx5_1",
4200				  "polls": 137492169,
4201				  "idle_polls": 137492169,
4202				  "completions": 0,
4203				  "queued_requests": 0,
4204				  "total_send_wrs": 0,
4205				  "send_sq_doorbell_updates": 0,
4206				  "total_recv_wrs": 0,
4207				  "recv_sq_doorbell_updates": 0
4208				},
4209				{
4210				  "dev_name": "mlx5_0",
4211				  "polls": 137985185,
4212				  "idle_polls": 137492169,
4213				  "completions": 1474593,
4214				  "queued_requests": 0,
4215				  "total_send_wrs": 1474593,
4216				  "send_sq_doorbell_updates": 426147,
4217				  "total_recv_wrs": 1474721,
4218				  "recv_sq_doorbell_updates": 348445
4219				}
4220			  ]
4221			},
4222			{
4223			  "trname": "PCIE",
4224			  "polls": 435419831,
4225			  "idle_polls": 434901004,
4226			  "completions": 1485543,
4227			  "cq_doorbell_updates": 518827,
4228			  "queued_requests": 0,
4229			  "submitted_requests": 1485543,
4230			  "sq_doorbell_updates": 516081
4231			}
4232		  ]
4233		},
4234		{
4235		  "thread": "nvmf_tgt_poll_group_1",
4236		  "transports": [
4237			{
4238			  "trname": "RDMA",
4239			  "devices": [
4240				{
4241				  "dev_name": "mlx5_1",
4242				  "polls": 140245630,
4243				  "idle_polls": 140245630,
4244				  "completions": 0,
4245				  "queued_requests": 0,
4246				  "total_send_wrs": 0,
4247				  "send_sq_doorbell_updates": 0,
4248				  "total_recv_wrs": 0,
4249				  "recv_sq_doorbell_updates": 0
4250				},
4251				{
4252				  "dev_name": "mlx5_0",
4253				  "polls": 140751844,
4254				  "idle_polls": 140245630,
4255				  "completions": 1489298,
4256				  "queued_requests": 0,
4257				  "total_send_wrs": 1489298,
4258				  "send_sq_doorbell_updates": 433510,
4259				  "total_recv_wrs": 1489426,
4260				  "recv_sq_doorbell_updates": 357956
4261				}
4262			  ]
4263			},
4264			{
4265			  "trname": "PCIE",
4266			  "polls": 429044294,
4267			  "idle_polls": 428525658,
4268			  "completions": 1478730,
4269			  "cq_doorbell_updates": 518636,
4270			  "queued_requests": 0,
4271			  "submitted_requests": 1478730,
4272			  "sq_doorbell_updates": 511658
4273			}
4274		  ]
4275		}
4276	  ]
4277	}
4278}
4279~~~
4280
4281### bdev_nvme_get_controller_health_info {#rpc_bdev_nvme_get_controller_health_info}
4282
4283Display health log of the required NVMe bdev device.
4284
4285#### Parameters
4286
4287Name                    | Optional | Type        | Description
4288----------------------- | -------- | ----------- | -----------
4289name                    | Required | string      | Name of the NVMe bdev controller
4290
4291#### Response
4292
4293The response is the object containing information about health log of the NVMe controller.
4294
4295#### Example
4296
4297Example request:
4298
4299~~~json
4300{
4301  "jsonrpc": "2.0",
4302  "method": "bdev_nvme_get_controller_health_info",
4303  "id": 1,
4304  "params": {
4305    "name": "Nvme0"
4306  }
4307}
4308~~~
4309
4310Example response:
4311
4312~~~json
4313{
4314  "model_number": "INTEL SSDPE2KX020T8",
4315  "serial_number": "BTLJ72430ARH2P0BGN",
4316  "firmware_revision": "VDV10110",
4317  "traddr": "0000:08:00.0",
4318  "temperature_celsius": 32,
4319  "available_spare_percentage": 99,
4320  "available_spare_threshold_percentage": 10,
4321  "percentage_used": 2,
4322  "data_units_read": 1013408619,
4323  "data_units_written": 346792685,
4324  "host_read_commands": 30457773282,
4325  "host_write_commands": 18949677715,
4326  "controller_busy_time": 4979,
4327  "power_cycles": 49,
4328  "power_on_hours": 31118,
4329  "unsafe_shutdowns": 18,
4330  "media_errors": 17,
4331  "num_err_log_entries": 19,
4332  "warning_temperature_time_minutes": 0,
4333  "critical_composite_temperature_time_minutes": 0
4334}
4335~~~
4336
4337### bdev_rbd_register_cluster {#rpc_bdev_rbd_register_cluster}
4338
4339This method is available only if SPDK was build with Ceph RBD support.
4340
4341#### Parameters
4342
4343Name                    | Optional | Type        | Description
4344----------------------- | -------- | ----------- | -----------
4345name                    | Required | string      | Registerd Rados cluster object name
4346user_id                 | Optional | string      | Ceph ID (i.e. admin, not client.admin)
4347config_param            | Optional | string map  | Explicit librados configuration
4348config_file             | Optional | string      | File path of libraodos configuration file
4349key_file                | Optional | string      | File path of libraodos key file
4350
4351This RPC registers a Rados Cluster object handle which is only known
4352to rbd module, it uses user_id + config_param or user_id + config_file +
4353key_file or user_id + config_param + config_file + key_file to identify
4354a Rados cluster object.
4355
4356When accessing the Ceph cluster as some user other than "admin" (the
4357default), the "user_id" has to be set.
4358
4359The configuration items and secret key can be specified by setting config_param,
4360config_file and key_file, all of them, or none of them. If only config_param is
4361passed, all key/value pairs are passed to rados_conf_set to configure cluster access.
4362In practice, "mon_host" (= list of monitor address+port) and "key" (= the secret key
4363stored in Ceph keyrings) are enough. If config_file and key_file are specified, they must
4364exist with all relevant settings for accessing the Ceph cluster. If config_param, config_file
4365and key_file are specified, get the key/value pairs from config_file first and set to
4366rados_conf_set function, then set pairs in config_param and keyring in key_file. If nothing
4367is specified, it will get configuration file and key file from the default location
4368/etc/ceph/ceph.conf and /etc/ceph/ceph.client.user_id.keyring.
4369
4370#### Result
4371
4372Name of newly created Rados cluster object.
4373
4374#### Example
4375
4376Example request:
4377
4378~~
4379{
4380  "params": {
4381    "name": "rbd_cluster",
4382    "user_id": cinder,
4383    "config_file": "/root/ceph_conf/ceph.conf",
4384    "key_file": "/root/ceph_conf/ceph.client.cinder.keyring"
4385  },
4386  "jsonrpc": "2.0",
4387  "method": "bdev_rbd_register_cluster",
4388  "id": 1
4389}
4390~~
4391
4392Example response:
4393
4394~~
4395response:
4396{
4397  "jsonrpc": "2.0",
4398  "id": 1,
4399  "result": "rbd_cluster"
4400}
4401~~
4402
4403### bdev_rbd_unregister_cluster {#rpc_bdev_rbd_unregister_cluster}
4404
4405This method is available only if SPDK was build with Ceph RBD support.
4406If there is still rbd bdev using this cluster, the unregisteration operation
4407will fail.
4408
4409#### Result
4410
4411`true` if Rados cluster object with provided name was deleted or `false` otherwise.
4412
4413#### Parameters
4414
4415Name                    | Optional | Type        | Description
4416----------------------- | -------- | ----------- | -------------------------
4417name                    | Required | string      | Rados cluster object name
4418
4419#### Example
4420
4421Example request:
4422
4423~~
4424{
4425  "params": {
4426    "name": "rbd_cluster"
4427  },
4428  "jsonrpc": "2.0",
4429  "method": "bdev_rbd_unregister_cluster",
4430  "id": 1
4431}
4432~~
4433
4434Example response:
4435
4436~~
4437{
4438  "jsonrpc": "2.0",
4439  "id": 1,
4440  "result": true
4441}
4442~~
4443
4444### bdev_rbd_get_clusters_info {#rpc_bdev_rbd_get_clusters_info}
4445
4446This method is available only if SPDK was build with Ceph RBD support.
4447
4448#### Result
4449
4450Returns the cluster info of the Rados Cluster name if provided. Otherwise, it
4451returns the cluster info of every registered Raods Cluster name.
4452
4453#### Parameters
4454
4455Name                    | Optional | Type        | Description
4456----------------------- | -------- | ----------- | -------------------------
4457name                    | Optional | string      | Rados cluster object name
4458
4459#### Example
4460
4461Example request:
4462
4463~~
4464{
4465  "params": {
4466    "name": "rbd_cluster"
4467  },
4468  "jsonrpc": "2.0",
4469  "method": "bdev_rbd_get_clusters_info",
4470  "id": 1
4471}
4472~~
4473
4474Example response:
4475
4476~~
4477{
4478  "jsonrpc": "2.0",
4479  "cluster_name": "rbd_cluster"
4480}
4481~~
4482
4483### bdev_rbd_create {#rpc_bdev_rbd_create}
4484
4485Create @ref bdev_config_rbd bdev
4486
4487This method is available only if SPDK was build with Ceph RBD support.
4488
4489#### Parameters
4490
4491Name                    | Optional | Type        | Description
4492----------------------- | -------- | ----------- | -----------
4493name                    | Optional | string      | Bdev name
4494user_id                 | Optional | string      | Ceph ID (i.e. admin, not client.admin)
4495pool_name               | Required | string      | Pool name
4496rbd_name                | Required | string      | Image name
4497block_size              | Required | number      | Block size
4498config                  | Optional | string map  | Explicit librados configuration
4499cluster_name            | Optional | string      | Rados cluster object name created in this module.
4500uuid                    | Optional | string      | UUID of new bdev
4501
4502If no config is specified, Ceph configuration files must exist with
4503all relevant settings for accessing the pool. If a config map is
4504passed, the configuration files are ignored and instead all key/value
4505pairs are passed to rados_conf_set to configure cluster access. In
4506practice, "mon_host" (= list of monitor address+port) and "key" (= the
4507secret key stored in Ceph keyrings) are enough.
4508
4509When accessing the image as some user other than "admin" (the
4510default), the "user_id" has to be set.
4511
4512If provided with cluster_name option, it will use the Rados cluster object
4513referenced by the name (created by bdev_rbd_register_cluster RPC) and ignores
4514"user_id + config" combination to create its own Rados cluster. In this scenario,
4515all the bdevs will share the same cluster with one connection of Ceph in librbd module.
4516Performance tuning on the I/O workload could be done by estimating how many io_contxt
4517threads and messager threads in Ceph side and how many cores would be reasonable to provide
4518for SPDK to get up to your projections.
4519
4520#### Result
4521
4522Name of newly created bdev.
4523
4524#### Example
4525
4526Example request with `key` from `/etc/ceph/ceph.client.admin.keyring`:
4527
4528~~~json
4529{
4530  "params": {
4531    "pool_name": "rbd",
4532    "rbd_name": "foo",
4533    "config": {
4534      "mon_host": "192.168.7.1:6789,192.168.7.2:6789",
4535      "key": "AQDwf8db7zR1GRAA5k7NKXjS5S5V4mntwUDnGQ==",
4536    }
4537    "block_size": 4096,
4538    "uuid": "76210ea4-7920-40a0-a07b-8992a7443c76"
4539  },
4540  "jsonrpc": "2.0",
4541  "method": "bdev_rbd_create",
4542  "id": 1
4543}
4544~~~
4545
4546Example response:
4547
4548~~~json
4549response:
4550{
4551  "jsonrpc": "2.0",
4552  "id": 1,
4553  "result": "Ceph0"
4554}
4555~~~
4556
4557Example request with `cluster_name`:
4558
4559~~
4560{
4561  "params": {
4562    "pool_name": "rbd",
4563    "rbd_name": "foo",
4564    "block_size": 4096,
4565    "cluster_name": "rbd_cluster"
4566  },
4567  "jsonrpc": "2.0",
4568  "method": "bdev_rbd_create",
4569  "id": 1
4570}
4571~~
4572
4573Example response:
4574
4575~~
4576response:
4577{
4578  "jsonrpc": "2.0",
4579  "id": 1,
4580  "result": "Ceph0"
4581}
4582~~
4583
4584### bdev_rbd_delete {#rpc_bdev_rbd_delete}
4585
4586Delete @ref bdev_config_rbd bdev
4587
4588This method is available only if SPDK was build with Ceph RBD support.
4589
4590#### Result
4591
4592`true` if bdev with provided name was deleted or `false` otherwise.
4593
4594#### Parameters
4595
4596Name                    | Optional | Type        | Description
4597----------------------- | -------- | ----------- | -----------
4598name                    | Required | string      | Bdev name
4599
4600#### Example
4601
4602Example request:
4603
4604~~~json
4605{
4606  "params": {
4607    "name": "Rbd0"
4608  },
4609  "jsonrpc": "2.0",
4610  "method": "bdev_rbd_delete",
4611  "id": 1
4612}
4613~~~
4614
4615Example response:
4616
4617~~~json
4618{
4619  "jsonrpc": "2.0",
4620  "id": 1,
4621  "result": true
4622}
4623~~~
4624
4625### bdev_rbd_resize {#rpc_bdev_rbd_resize}
4626
4627Resize @ref bdev_config_rbd bdev
4628
4629This method is available only if SPDK was build with Ceph RBD support.
4630
4631#### Result
4632
4633`true` if bdev with provided name was resized or `false` otherwise.
4634
4635#### Parameters
4636
4637Name                    | Optional | Type        | Description
4638----------------------- | -------- | ----------- | -----------
4639name                    | Required | string      | Bdev name
4640new_size                | Required | int         | New bdev size for resize operation in MiB
4641
4642#### Example
4643
4644Example request:
4645
4646~~~json
4647{
4648  "params": {
4649    "name": "Rbd0"
4650    "new_size": "4096"
4651  },
4652  "jsonrpc": "2.0",
4653  "method": "bdev_rbd_resize",
4654  "id": 1
4655}
4656~~~
4657
4658Example response:
4659
4660~~~json
4661{
4662  "jsonrpc": "2.0",
4663  "id": 1,
4664  "result": true
4665}
4666~~~
4667
4668### bdev_delay_create {#rpc_bdev_delay_create}
4669
4670Create delay bdev. This bdev type redirects all IO to it's base bdev and inserts a delay on the completion
4671path to create an artificial drive latency. All latency values supplied to this bdev should be in microseconds.
4672
4673#### Parameters
4674
4675Name                    | Optional | Type        | Description
4676----------------------- | -------- | ----------- | -----------
4677name                    | Required | string      | Bdev name
4678base_bdev_name          | Required | string      | Base bdev name
4679avg_read_latency        | Required | number      | average read latency (us)
4680p99_read_latency        | Required | number      | p99 read latency (us)
4681avg_write_latency       | Required | number      | average write latency (us)
4682p99_write_latency       | Required | number      | p99 write latency (us)
4683
4684#### Result
4685
4686Name of newly created bdev.
4687
4688#### Example
4689
4690Example request:
4691
4692~~~json
4693{
4694  "params": {
4695    "base_bdev_name": "Null0",
4696    "name": "Delay0",
4697    "avg_read_latency": "15",
4698    "p99_read_latency": "50",
4699    "avg_write_latency": "40",
4700    "p99_write_latency": "110",
4701  },
4702  "jsonrpc": "2.0",
4703  "method": "bdev_delay_create",
4704  "id": 1
4705}
4706~~~
4707
4708Example response:
4709
4710~~~json
4711{
4712  "jsonrpc": "2.0",
4713  "id": 1,
4714  "result": "Delay0"
4715}
4716~~~
4717
4718### bdev_delay_delete {#rpc_bdev_delay_delete}
4719
4720Delete delay bdev.
4721
4722#### Parameters
4723
4724Name                    | Optional | Type        | Description
4725----------------------- | -------- | ----------- | -----------
4726name                    | Required | string      | Bdev name
4727
4728#### Example
4729
4730Example request:
4731
4732~~~json
4733{
4734  "params": {
4735    "name": "Delay0"
4736  },
4737  "jsonrpc": "2.0",
4738  "method": "bdev_delay_delete",
4739  "id": 1
4740}
4741
4742~~~
4743
4744Example response:
4745
4746~~~json
4747{
4748  "jsonrpc": "2.0",
4749  "id": 1,
4750  "result": true
4751}
4752~~~
4753
4754### bdev_delay_update_latency {#rpc_bdev_delay_update_latency}
4755
4756Update a target latency value associated with a given delay bdev. Any currently
4757outstanding I/O will be completed with the old latency.
4758
4759#### Parameters
4760
4761Name                    | Optional | Type        | Description
4762----------------------- | -------- | ----------- | -----------
4763delay_bdev_name         | Required | string      | Name of the delay bdev
4764latency_type            | Required | string      | One of: avg_read, avg_write, p99_read, p99_write
4765latency_us              | Required | number      | The new latency value in microseconds
4766
4767#### Result
4768
4769Name of newly created bdev.
4770
4771#### Example
4772
4773Example request:
4774
4775~~~json
4776{
4777  "params": {
4778    "delay_bdev_name": "Delay0",
4779    "latency_type": "avg_read",
4780    "latency_us": "100",
4781  },
4782  "jsonrpc": "2.0",
4783  "method": "bdev_delay_update_latency",
4784  "id": 1
4785}
4786~~~
4787
4788Example response:
4789
4790~~~json
4791{
4792  "result": "true"
4793}
4794~~~
4795
4796### bdev_error_create {#rpc_bdev_error_create}
4797
4798Construct error bdev.
4799
4800#### Parameters
4801
4802Name                    | Optional | Type        | Description
4803----------------------- | -------- | ----------- | -----------
4804base_name               | Required | string      | Base bdev name
4805
4806#### Example
4807
4808Example request:
4809
4810~~~json
4811{
4812  "params": {
4813    "base_name": "Malloc0"
4814  },
4815  "jsonrpc": "2.0",
4816  "method": "bdev_error_create",
4817  "id": 1
4818}
4819~~~
4820
4821Example response:
4822
4823~~~json
4824{
4825  "jsonrpc": "2.0",
4826  "id": 1,
4827  "result": true
4828}
4829~~~
4830
4831### bdev_error_delete {#rpc_bdev_error_delete}
4832
4833Delete error bdev
4834
4835#### Result
4836
4837`true` if bdev with provided name was deleted or `false` otherwise.
4838
4839#### Parameters
4840
4841Name                    | Optional | Type        | Description
4842----------------------- | -------- | ----------- | -----------
4843name                    | Required | string      | Error bdev name
4844
4845#### Example
4846
4847Example request:
4848
4849~~~json
4850{
4851  "params": {
4852    "name": "EE_Malloc0"
4853  },
4854  "jsonrpc": "2.0",
4855  "method": "bdev_error_delete",
4856  "id": 1
4857}
4858~~~
4859
4860Example response:
4861
4862~~~json
4863{
4864  "jsonrpc": "2.0",
4865  "id": 1,
4866  "result": true
4867}
4868~~~
4869
4870### bdev_error_inject_error {#rpc_bdev_error_inject_error}
4871
4872Inject an error via an error bdev. Create an error bdev on base bdev first. Default 'num'
4873value is 1 and if 'num' is set to zero, the specified injection is disabled.
4874
4875#### Parameters
4876
4877Name                    | Optional | Type        | Description
4878----------------------- | -------- | ----------- | -----------
4879name                    | Required | string      | Name of the error injection bdev
4880io_type                 | Required | string      | io type 'clear' 'read' 'write' 'unmap' 'flush' 'all'
4881error_type              | Required | string      | error type 'failure' 'pending' 'corrupt_data'
4882num                     | Optional | int         | the number of commands you want to fail.(default:1)
4883corrupt_offset          | Optional | int         | the offset in bytes to xor with corrupt_value
4884corrupt_value           | Optional | int         | the value for xor (1-255, 0 is invalid)
4885
4886#### Example
4887
4888Example request:
4889
4890~~~json
4891{
4892  "jsonrpc": "2.0",
4893  "method": "bdev_error_inject_error",
4894  "id": 1,
4895  "params": {
4896    "name": "EE_Malloc0",
4897    "io_type": "write",
4898    "error_type": "pending",
4899    "num": 1
4900  }
4901}
4902~~~
4903
4904Example response:
4905
4906~~~json
4907{
4908  "jsonrpc": "2.0",
4909  "id": 1,
4910  "result": true
4911}
4912~~~
4913
4914### bdev_iscsi_set_options {#rpc_bdev_iscsi_set_options}
4915
4916This RPC can be called at any time, but the new value will only take effect for new iSCSI bdevs.
4917
4918#### Parameters
4919
4920Name                       | Optional | Type        | Description
4921-------------------------- | -------- | ----------- | -----------
4922timeout_sec                | Optional | number      | Timeout for command, in seconds, if 0, don't track timeout
4923
4924#### Example
4925
4926Example request:
4927
4928~~~json
4929request:
4930{
4931  "params": {
4932    "timeout_sec": 30
4933  },
4934  "jsonrpc": "2.0",
4935  "method": "bdev_iscsi_set_options",
4936  "id": 1
4937}
4938~~~
4939
4940Example response:
4941
4942~~~json
4943{
4944  "jsonrpc": "2.0",
4945  "id": 1,
4946  "result": true
4947}
4948~~~
4949
4950### bdev_iscsi_create {#rpc_bdev_iscsi_create}
4951
4952Connect to iSCSI target and create bdev backed by this connection.
4953
4954This method is available only if SPDK was build with iSCSI initiator support.
4955
4956#### Parameters
4957
4958Name                    | Optional | Type        | Description
4959----------------------- | -------- | ----------- | -----------
4960name                    | Required | string      | Bdev name
4961initiator_iqn           | Required | string      | IQN name used during connection
4962url                     | Required | string      | iSCSI resource URI
4963
4964#### Result
4965
4966Name of newly created bdev.
4967
4968#### Example
4969
4970Example request:
4971
4972~~~json
4973{
4974  "params": {
4975    "url": "iscsi://127.0.0.1/iqn.2016-06.io.spdk:disk1/0",
4976    "initiator_iqn": "iqn.2016-06.io.spdk:init",
4977    "name": "iSCSI0"
4978  },
4979  "jsonrpc": "2.0",
4980  "method": "bdev_iscsi_create",
4981  "id": 1
4982}
4983~~~
4984
4985Example response:
4986
4987~~~json
4988{
4989  "jsonrpc": "2.0",
4990  "id": 1,
4991  "result": "iSCSI0"
4992}
4993~~~
4994
4995### bdev_iscsi_delete {#rpc_bdev_iscsi_delete}
4996
4997Delete iSCSI bdev and terminate connection to target.
4998
4999This method is available only if SPDK was built with iSCSI initiator support.
5000
5001#### Parameters
5002
5003Name                    | Optional | Type        | Description
5004----------------------- | -------- | ----------- | -----------
5005name                    | Required | string      | Bdev name
5006
5007#### Example
5008
5009Example request:
5010
5011~~~json
5012{
5013  "params": {
5014    "name": "iSCSI0"
5015  },
5016  "jsonrpc": "2.0",
5017  "method": "bdev_iscsi_delete",
5018  "id": 1
5019}
5020~~~
5021
5022Example response:
5023
5024~~~json
5025{
5026  "jsonrpc": "2.0",
5027  "id": 1,
5028  "result": true
5029}
5030~~~
5031
5032### bdev_ftl_create {#rpc_bdev_ftl_create}
5033
5034Create FTL bdev.
5035
5036This RPC is subject to change.
5037
5038#### Parameters
5039
5040Name                    | Optional | Type        | Description
5041----------------------- | -------- | ----------- | -----------
5042name                    | Required | string      | Bdev name
5043base_bdev               | Required | string      | Name of the base device
5044cache                   | Required | string      | Name of the cache device
5045uuid                    | Optional | string      | UUID of restored bdev (not applicable when creating new instance)
5046core_mask               | Optional | string      | CPU core(s) possible for placement of the ftl core thread, application main thread by default
5047overprovisioning        | Optional | int         | Percentage of base device used for relocation, 20% by default
5048fast_shutdown           | Optional | bool        | When set FTL will minimize persisted data on target application shutdown and rely on shared memory during next load
5049
5050#### Result
5051
5052Name of newly created bdev.
5053
5054#### Example
5055
5056Example request:
5057
5058~~~json
5059{
5060  "params": {
5061    "name": "ftl0",
5062    "base_bdev": "nvme0n1",
5063    "cache": "nvme1n1",
5064    "uuid": "4a7481ce-786f-41a0-9b86-8f7465c8f4d3",
5065    "core_mask": "[0]",
5066    "overprovisioning": 10
5067  },
5068  "jsonrpc": "2.0",
5069  "method": "bdev_ftl_create",
5070  "id": 1
5071}
5072~~~
5073
5074Example response:
5075
5076~~~json
5077{
5078  "jsonrpc": "2.0",
5079  "id": 1,
5080  "result": {
5081      "name" : "ftl0"
5082      "uuid" : "4a7481ce-786f-41a0-9b86-8f7465c8f4d3"
5083  }
5084}
5085~~~
5086
5087### bdev_ftl_load {#rpc_bdev_ftl_load}
5088
5089Loads FTL bdev.
5090
5091This RPC is subject to change.
5092
5093#### Parameters
5094
5095Name                    | Optional | Type        | Description
5096----------------------- | -------- | ----------- | -----------
5097name                    | Required | string      | Bdev name
5098base_bdev               | Required | string      | Name of the base device
5099cache                   | Required | string      | Name of the cache device
5100uuid                    | Required | string      | UUID of restored bdev
5101core_mask               | Optional | string      | CPU core(s) possible for placement of the ftl core thread, application main thread by default
5102overprovisioning        | Optional | int         | Percentage of base device used for relocation, 20% by default
5103fast_shutdown           | Optional | bool        | When set FTL will minimize persisted data on target application shutdown and rely on shared memory during next load
5104
5105#### Result
5106
5107Name of loaded bdev.
5108
5109#### Example
5110
5111Example request:
5112
5113~~~json
5114{
5115  "params": {
5116    "name": "ftl0",
5117    "base_bdev": "nvme0n1",
5118    "cache": "nvme1n1",
5119    "uuid": "4a7481ce-786f-41a0-9b86-8f7465c8f4d3",
5120    "core_mask": "[0]",
5121    "overprovisioning": 10
5122  },
5123  "jsonrpc": "2.0",
5124  "method": "bdev_ftl_load",
5125  "id": 1
5126}
5127~~~
5128
5129Example response:
5130
5131~~~json
5132{
5133  "jsonrpc": "2.0",
5134  "id": 1,
5135  "result": {
5136      "name" : "ftl0"
5137      "uuid" : "4a7481ce-786f-41a0-9b86-8f7465c8f4d3"
5138  }
5139}
5140~~~
5141
5142### bdev_ftl_delete {#rpc_bdev_ftl_delete}
5143
5144Delete FTL bdev.
5145
5146This RPC is subject to change.
5147
5148#### Parameters
5149
5150Name                    | Optional | Type        | Description
5151----------------------- | -------- | ----------- | -----------
5152name                    | Required | string      | Bdev name
5153fast_shutdown           | Optional | bool        | When set FTL will minimize persisted data during deletion and rely on shared memory during next load
5154
5155#### Example
5156
5157Example request:
5158
5159~~~json
5160{
5161  "params": {
5162    "name": "ftl0"
5163  },
5164  "jsonrpc": "2.0",
5165  "method": "bdev_ftl_delete",
5166  "id": 1
5167}
5168~~~
5169
5170Example response:
5171
5172~~~json
5173{
5174  "jsonrpc": "2.0",
5175  "id": 1,
5176  "result": true
5177}
5178~~~
5179
5180### bdev_ftl_unload {#rpc_bdev_ftl_unload}
5181
5182Unloads FTL bdev.
5183
5184This RPC is subject to change.
5185
5186#### Parameters
5187
5188Name                    | Optional | Type        | Description
5189----------------------- | -------- | ----------- | -----------
5190name                    | Required | string      | Bdev name
5191fast_shutdown           | Optional | bool        | When set FTL will minimize persisted data during deletion and rely on shared memory during next load
5192
5193#### Example
5194
5195Example request:
5196
5197~~~json
5198{
5199  "params": {
5200    "name": "ftl0"
5201  },
5202  "jsonrpc": "2.0",
5203  "method": "bdev_ftl_unload",
5204  "id": 1
5205}
5206~~~
5207
5208Example response:
5209
5210~~~json
5211{
5212  "jsonrpc": "2.0",
5213  "id": 1,
5214  "result": true
5215}
5216~~~
5217
5218### bdev_ftl_unmap {#rpc_bdev_ftl_unmap}
5219
5220Unmap range of LBAs.
5221
5222This RPC is subject to change.
5223
5224#### Parameters
5225
5226Name                    | Optional | Type        | Description
5227----------------------- | -------- | ----------- | -----------
5228name                    | Required | string      | Bdev name
5229lba                     | Required | number      | start lba, aligned to 1024
5230num_blocks              | Required | number      | number of blocks, aligned to 1024
5231
5232#### Example
5233
5234Example request:
5235
5236~~~json
5237{
5238  "params": {
5239    "name": "ftl0"
5240    "lba": "0"
5241    "num_blocks": "1024"
5242  },
5243  "jsonrpc": "2.0",
5244  "method": "bdev_ftl_unmap",
5245  "id": 1
5246}
5247~~~
5248
5249Example response:
5250
5251~~~json
5252{
5253  "jsonrpc": "2.0",
5254  "id": 1,
5255  "result": true
5256}
5257~~~
5258
5259### bdev_ftl_get_stats {#rpc_bdev_ftl_get_stats}
5260
5261Get IO statistics for FTL bdev
5262
5263This RPC is subject to change.
5264
5265#### Parameters
5266
5267Name                    | Optional | Type        | Description
5268----------------------- | -------- | ----------- | -----------
5269name                    | Required | string      | Bdev name
5270
5271#### Response
5272
5273The response is an object containing IO statistics for an FTL instance, split into multiple subobjects:
5274
5275- `user` - contains information about number of IOs, and errors for any incoming requests,
5276- `cmp` - information about IO for the compaction process,
5277- `gc` - information about IO for the garbage collection process,
5278- `md_base` - internal metadata requests to the base FTL device,
5279- `md_nv_cache` - internal metadata requests to the cache device,
5280- `l2p` - requests done on the L2P cache region.
5281
5282Each subobject contains the following information:
5283
5284- `ios` - describes the total number of IOs requested,
5285- `blocks` - the total number of requested blocks,
5286- `errors` - describes the number of detected errors for a given operation, with the following distinctions:
5287  - `media` - media errors,
5288  - `crc` - mismatch in calculated CRC versus saved checksum in the metadata,
5289  - `other` - any other errors.
5290
5291#### Example
5292
5293Example request:
5294
5295~~~json
5296{
5297  "params": {
5298    "name": "ftl0"
5299  },
5300  "jsonrpc": "2.0",
5301  "method": "bdev_ftl_get_stats",
5302  "id": 1
5303}
5304~~~
5305
5306Example response:
5307
5308~~~json
5309{
5310  "jsonrpc": "2.0",
5311  "id": 1,
5312  "result": {
5313      "name": "ftl0",
5314      "user": {
5315        "read": {
5316          "ios": 0,
5317          "blocks": 0,
5318          "errors": {
5319            "media": 0,
5320            "crc": 0,
5321            "other": 0
5322          }
5323        },
5324        "write": {
5325          "ios": 318707,
5326          "blocks": 318707,
5327          "errors": {
5328            "media": 0,
5329            "other": 0
5330          }
5331        }
5332      },
5333      "cmp": {
5334        "read": {
5335          "ios": 0,
5336          "blocks": 0,
5337          "errors": {
5338            "media": 0,
5339            "crc": 0,
5340            "other": 0
5341          }
5342        },
5343        "write": {
5344          "ios": 0,
5345          "blocks": 0,
5346          "errors": {
5347            "media": 0,
5348            "other": 0
5349          }
5350        }
5351      },
5352      "gc": {
5353        "read": {
5354          "ios": 0,
5355          "blocks": 0,
5356          "errors": {
5357            "media": 0,
5358            "crc": 0,
5359            "other": 0
5360          }
5361        },
5362        "write": {
5363          "ios": 0,
5364          "blocks": 0,
5365          "errors": {
5366            "media": 0,
5367            "other": 0
5368          }
5369        }
5370      },
5371      "md_base": {
5372        "read": {
5373          "ios": 0,
5374          "blocks": 0,
5375          "errors": {
5376            "media": 0,
5377            "crc": 0,
5378            "other": 0
5379          }
5380        },
5381        "write": {
5382          "ios": 1,
5383          "blocks": 32,
5384          "errors": {
5385            "media": 0,
5386            "other": 0
5387          }
5388        }
5389      },
5390      "md_nv_cache": {
5391        "read": {
5392          "ios": 0,
5393          "blocks": 0,
5394          "errors": {
5395            "media": 0,
5396            "crc": 0,
5397            "other": 0
5398          }
5399        },
5400        "write": {
5401          "ios": 1064,
5402          "blocks": 1073896,
5403          "errors": {
5404            "media": 0,
5405            "other": 0
5406          }
5407        }
5408      },
5409      "l2p": {
5410        "read": {
5411          "ios": 240659,
5412          "blocks": 240659,
5413          "errors": {
5414            "media": 0,
5415            "crc": 0,
5416            "other": 0
5417          }
5418        },
5419        "write": {
5420          "ios": 235745,
5421          "blocks": 235745,
5422          "errors": {
5423            "media": 0,
5424            "other": 0
5425          }
5426        }
5427      }
5428    }
5429}
5430~~~
5431### bdev_pmem_create_pool {#rpc_bdev_pmem_create_pool}
5432
5433Create a @ref bdev_config_pmem blk pool file. It is equivalent of following `pmempool create` command:
5434
5435~~~bash
5436pmempool create -s $((num_blocks * block_size)) blk $block_size $pmem_file
5437~~~
5438
5439This method is available only if SPDK was built with PMDK support.
5440
5441#### Parameters
5442
5443Name                    | Optional | Type        | Description
5444----------------------- | -------- | ----------- | -----------
5445pmem_file               | Required | string      | Path to new pmem file
5446num_blocks              | Required | number      | Number of blocks
5447block_size              | Required | number      | Size of each block in bytes
5448
5449#### Example
5450
5451Example request:
5452
5453~~~json
5454{
5455  "params": {
5456    "block_size": 512,
5457    "num_blocks": 131072,
5458    "pmem_file": "/tmp/pmem_file"
5459  },
5460  "jsonrpc": "2.0",
5461  "method": "bdev_pmem_create_pool",
5462  "id": 1
5463}
5464~~~
5465
5466Example response:
5467
5468~~~json
5469{
5470  "jsonrpc": "2.0",
5471  "id": 1,
5472  "result": true
5473}
5474~~~
5475
5476### bdev_pmem_get_pool_info {#rpc_bdev_pmem_get_pool_info}
5477
5478Retrieve basic information about PMDK memory pool.
5479
5480This method is available only if SPDK was built with PMDK support.
5481
5482#### Parameters
5483
5484Name                    | Optional | Type        | Description
5485----------------------- | -------- | ----------- | -----------
5486pmem_file               | Required | string      | Path to existing pmem file
5487
5488#### Result
5489
5490Array of objects describing memory pool:
5491
5492Name                    | Type        | Description
5493----------------------- | ----------- | -----------
5494num_blocks              | number      | Number of blocks
5495block_size              | number      | Size of each block in bytes
5496
5497#### Example
5498
5499Example request:
5500
5501~~~json
5502request:
5503{
5504  "params": {
5505    "pmem_file": "/tmp/pmem_file"
5506  },
5507  "jsonrpc": "2.0",
5508  "method": "bdev_pmem_get_pool_info",
5509  "id": 1
5510}
5511~~~
5512
5513Example response:
5514
5515~~~json
5516{
5517  "jsonrpc": "2.0",
5518  "id": 1,
5519  "result": [
5520    {
5521      "block_size": 512,
5522      "num_blocks": 129728
5523    }
5524  ]
5525}
5526~~~
5527
5528### bdev_pmem_delete_pool {#rpc_bdev_pmem_delete_pool}
5529
5530Delete pmem pool by removing file `pmem_file`. This method will fail if `pmem_file` is not a
5531valid pmem pool file.
5532
5533This method is available only if SPDK was built with PMDK support.
5534
5535#### Parameters
5536
5537Name                    | Optional | Type        | Description
5538----------------------- | -------- | ----------- | -----------
5539pmem_file               | Required | string      | Path to new pmem file
5540
5541#### Example
5542
5543Example request:
5544
5545~~~json
5546{
5547  "params": {
5548    "pmem_file": "/tmp/pmem_file"
5549  },
5550  "jsonrpc": "2.0",
5551  "method": "bdev_pmem_delete_pool",
5552  "id": 1
5553}
5554~~~
5555
5556Example response:
5557
5558~~~json
5559{
5560  "jsonrpc": "2.0",
5561  "id": 1,
5562  "result": true
5563}
5564~~~
5565
5566### bdev_pmem_create {#rpc_bdev_pmem_create}
5567
5568Construct @ref bdev_config_pmem bdev.
5569
5570This method is available only if SPDK was built with PMDK support.
5571
5572#### Parameters
5573
5574Name                    | Optional | Type        | Description
5575----------------------- | -------- | ----------- | -----------
5576name                    | Required | string      | Bdev name
5577pmem_file               | Required | string      | Path to existing pmem blk pool file
5578
5579#### Result
5580
5581Name of newly created bdev.
5582
5583#### Example
5584
5585Example request:
5586
5587~~~json
5588{
5589  "params": {
5590    "pmem_file": "/tmp/pmem_file",
5591    "name": "Pmem0"
5592  },
5593  "jsonrpc": "2.0",
5594  "method": "bdev_pmem_create",
5595  "id": 1
5596}
5597~~~
5598
5599Example response:
5600
5601~~~json
5602{
5603  "jsonrpc": "2.0",
5604  "id": 1,
5605  "result": "Pmem0"
5606}
5607~~~
5608
5609### bdev_pmem_delete {#rpc_bdev_pmem_delete}
5610
5611Delete @ref bdev_config_pmem bdev. This call will not remove backing pool files.
5612
5613This method is available only if SPDK was built with PMDK support.
5614
5615#### Result
5616
5617`true` if bdev with provided name was deleted or `false` otherwise.
5618
5619#### Parameters
5620
5621Name                    | Optional | Type        | Description
5622----------------------- | -------- | ----------- | -----------
5623name                    | Required | string      | Bdev name
5624
5625#### Example
5626
5627Example request:
5628
5629~~~json
5630{
5631  "params": {
5632    "name": "Pmem0"
5633  },
5634  "jsonrpc": "2.0",
5635  "method": "bdev_pmem_delete",
5636  "id": 1
5637}
5638~~~
5639
5640Example response:
5641
5642~~~json
5643{
5644  "jsonrpc": "2.0",
5645  "id": 1,
5646  "result": true
5647}
5648~~~
5649
5650### bdev_passthru_create {#rpc_bdev_passthru_create}
5651
5652Create passthru bdev. This bdev type redirects all IO to it's base bdev. It has no other purpose than being an example
5653and a starting point in development of new bdev type.
5654
5655#### Parameters
5656
5657Name                    | Optional | Type        | Description
5658----------------------- | -------- | ----------- | -----------
5659name                    | Required | string      | Bdev name
5660base_bdev_name          | Required | string      | Base bdev name
5661
5662#### Result
5663
5664Name of newly created bdev.
5665
5666#### Example
5667
5668Example request:
5669
5670~~~json
5671{
5672  "params": {
5673    "base_bdev_name": "Malloc0",
5674    "name": "Passsthru0"
5675  },
5676  "jsonrpc": "2.0",
5677  "method": "bdev_passthru_create",
5678  "id": 1
5679}
5680~~~
5681
5682Example response:
5683
5684~~~json
5685{
5686  "jsonrpc": "2.0",
5687  "id": 1,
5688  "result": "Passsthru0"
5689}
5690~~~
5691
5692### bdev_passthru_delete {#rpc_bdev_passthru_delete}
5693
5694Delete passthru bdev.
5695
5696#### Parameters
5697
5698Name                    | Optional | Type        | Description
5699----------------------- | -------- | ----------- | -----------
5700name                    | Required | string      | Bdev name
5701
5702#### Example
5703
5704Example request:
5705
5706~~~json
5707{
5708  "params": {
5709    "name": "Passsthru0"
5710  },
5711  "jsonrpc": "2.0",
5712  "method": "bdev_passthru_delete",
5713  "id": 1
5714}
5715
5716~~~
5717
5718Example response:
5719
5720~~~json
5721{
5722  "jsonrpc": "2.0",
5723  "id": 1,
5724  "result": true
5725}
5726~~~
5727
5728### bdev_xnvme_create {#rpc_bdev_xnvme_create}
5729
5730Create xnvme bdev. This bdev type redirects all IO to its underlying backend.
5731
5732#### Parameters
5733
5734Name                    | Optional | Type        | Description
5735----------------------- | -------- | ----------- | -----------
5736name                    | Required | string      | name of xNVMe bdev to create
5737filename                | Required | string      | path to device or file (ex: /dev/nvme0n1)
5738io_mechanism            | Required | string      | IO mechanism to use (ex: libaio, io_uring, io_uring_cmd, etc.)
5739
5740#### Result
5741
5742Name of newly created bdev.
5743
5744#### Example
5745
5746Example request:
5747
5748~~~json
5749{
5750  "jsonrpc": "2.0",
5751  "method": "bdev_xnvme_create",
5752  "id": 1,
5753  "params": {
5754    "name": "bdev_ng0n1",
5755    "filename": "/dev/ng0n1",
5756    "io_mechanism": "io_uring_cmd"
5757  }
5758}
5759~~~
5760
5761Example response:
5762
5763~~~json
5764{
5765  "jsonrpc": "2.0",
5766  "id": 1,
5767  "result": "bdev_ng0n1"
5768}
5769~~~
5770
5771### bdev_xnvme_delete {#rpc_bdev_xnvme_delete}
5772
5773Delete xnvme bdev.
5774
5775#### Parameters
5776
5777Name                    | Optional | Type        | Description
5778----------------------- | -------- | ----------- | -----------
5779name                    | Required | string      | name of xnvme bdev to delete
5780
5781#### Example
5782
5783Example request:
5784
5785~~~json
5786{
5787  "params": {
5788    "name": "bdev_ng0n1"
5789  },
5790  "jsonrpc": "2.0",
5791  "method": "bdev_xnvme_delete",
5792  "id": 1
5793}
5794
5795~~~
5796
5797Example response:
5798
5799~~~json
5800{
5801  "jsonrpc": "2.0",
5802  "id": 1,
5803  "result": true
5804}
5805~~~
5806
5807### bdev_virtio_attach_controller {#rpc_bdev_virtio_attach_controller}
5808
5809Create new initiator @ref bdev_config_virtio_scsi or @ref bdev_config_virtio_blk and expose all found bdevs.
5810
5811#### Parameters
5812
5813Name                    | Optional | Type        | Description
5814----------------------- | -------- | ----------- | -----------
5815name                    | Required | string      | Virtio SCSI base bdev name or Virtio Blk bdev name
5816trtype                  | Required | string      | Virtio target trtype: pci or user
5817traddr                  | Required | string      | target address: BDF or UNIX socket file path
5818dev_type                | Required | string      | Virtio device type: blk or scsi
5819vq_count                | Optional | number      | Number of queues this controller will utilize (default: 1)
5820vq_size                 | Optional | number      | Size of each queue. Must be power of 2. (default: 512)
5821
5822In case of Virtio SCSI the `name` parameter will be base name for new created bdevs. For Virtio Blk `name` will be the
5823name of created bdev.
5824
5825`vq_count` and `vq_size` parameters are valid only if `trtype` is `user`.
5826
5827#### Result
5828
5829Array of names of newly created bdevs.
5830
5831#### Example
5832
5833Example request:
5834
5835~~~json
5836{
5837  "params": {
5838    "name": "VirtioScsi0",
5839    "trtype": "user",
5840    "vq_size": 128,
5841    "dev_type": "scsi",
5842    "traddr": "/tmp/VhostScsi0",
5843    "vq_count": 4
5844  },
5845  "jsonrpc": "2.0",
5846  "method": "bdev_virtio_attach_controller",
5847  "id": 1
5848}
5849~~~
5850
5851Example response:
5852
5853~~~json
5854{
5855  "jsonrpc": "2.0",
5856  "id": 1,
5857  "result": ["VirtioScsi0t2", "VirtioScsi0t4"]
5858}
5859~~~
5860
5861### bdev_virtio_scsi_get_devices {#rpc_bdev_virtio_scsi_get_devices}
5862
5863Show information about all available Virtio SCSI devices.
5864
5865#### Parameters
5866
5867This method has no parameters.
5868
5869#### Result
5870
5871Array of Virtio SCSI information objects.
5872
5873#### Example
5874
5875Example request:
5876
5877~~~json
5878{
5879  "jsonrpc": "2.0",
5880  "method": "bdev_virtio_scsi_get_devices",
5881  "id": 1
5882}
5883~~~
5884
5885Example response:
5886
5887~~~json
5888{
5889  "jsonrpc": "2.0",
5890  "id": 1,
5891  "result": [
5892    {
5893      "name": "VirtioScsi0",
5894      "virtio": {
5895          "vq_size": 128,
5896          "vq_count": 4,
5897          "type": "user",
5898          "socket": "/tmp/VhostScsi0"
5899      }
5900    }
5901  ]
5902}
5903~~~
5904
5905### bdev_virtio_detach_controller {#rpc_bdev_virtio_detach_controller}
5906
5907Remove a Virtio device. This command can be used to remove any type of virtio device.
5908
5909#### Parameters
5910
5911Name                    | Optional | Type        | Description
5912----------------------- | -------- | ----------- | -----------
5913name                    | Required | string      | Virtio name
5914
5915#### Example
5916
5917Example request:
5918
5919~~~json
5920{
5921  "params": {
5922    "name": "VirtioUser0"
5923  },
5924  "jsonrpc": "2.0",
5925  "method": "bdev_virtio_detach_controller",
5926  "id": 1
5927}
5928
5929~~~
5930
5931Example response:
5932
5933~~~json
5934{
5935  "jsonrpc": "2.0",
5936  "id": 1,
5937  "result": true
5938}
5939~~~
5940
5941### bdev_virtio_blk_set_hotplug {#rpc_bdev_virtio_blk_set_hotplug}
5942
5943Enable/Disable the virtio blk hotplug monitor or change the monitor period time
5944
5945#### Parameters
5946
5947Name                    | Optional | Type        | Description
5948----------------------- | -------- | ----------- | -----------
5949enable                  | Required | bool        | Enable or disable the virtio blk hotplug monitor
5950period-us               | Optional | number      | The period time of the monitor
5951
5952When the enable is true then the period-us is optional. If user don't set the period time then use the default
5953value. When the enable is false then the period-us is not required.
5954
5955#### Result
5956
5957True the rpc is successful otherwise false
5958
5959#### Example
5960
5961Example request:
5962
5963~~~json
5964{
5965  "params": {
5966    "enable": "true",
5967    "period-us": "1000000"
5968  },
5969  "jsonrpc": "2.0",
5970  "method": "bdev_virtio_blk_set_hotplug",
5971  "id": 1
5972}
5973~~~
5974
5975Example response:
5976
5977~~~json
5978{
5979  "jsonrpc": "2.0",
5980  "id": 1,
5981  "result": true
5982}
5983~~~
5984
5985## iSCSI Target {#jsonrpc_components_iscsi_tgt}
5986
5987### iscsi_set_options method {#rpc_iscsi_set_options}
5988
5989Set global parameters for iSCSI targets.
5990
5991This RPC may only be called before SPDK subsystems have been initialized. This RPC can be called only once.
5992
5993#### Parameters
5994
5995Name                            | Optional | Type    | Description
5996------------------------------- | -------- | ------- | -----------
5997auth_file                       | Optional | string  | Path to CHAP shared secret file (default: "")
5998node_base                       | Optional | string  | Prefix of the name of iSCSI target node (default: "iqn.2016-06.io.spdk")
5999nop_timeout                     | Optional | number  | Timeout in seconds to nop-in request to the initiator (default: 60)
6000nop_in_interval                 | Optional | number  | Time interval in secs between nop-in requests by the target (default: 30)
6001disable_chap                    | Optional | boolean | CHAP for discovery session should be disabled (default: `false`)
6002require_chap                    | Optional | boolean | CHAP for discovery session should be required (default: `false`)
6003mutual_chap                     | Optional | boolean | CHAP for discovery session should be unidirectional (`false`) or bidirectional (`true`) (default: `false`)
6004chap_group                      | Optional | number  | CHAP group ID for discovery session (default: 0)
6005max_sessions                    | Optional | number  | Maximum number of sessions in the host (default: 128)
6006max_queue_depth                 | Optional | number  | Maximum number of outstanding I/Os per queue (default: 64)
6007max_connections_per_session     | Optional | number  | Session specific parameter, MaxConnections (default: 2)
6008default_time2wait               | Optional | number  | Session specific parameter, DefaultTime2Wait (default: 2)
6009default_time2retain             | Optional | number  | Session specific parameter, DefaultTime2Retain (default: 20)
6010first_burst_length              | Optional | number  | Session specific parameter, FirstBurstLength (default: 8192)
6011immediate_data                  | Optional | boolean | Session specific parameter, ImmediateData (default: `true`)
6012error_recovery_level            | Optional | number  | Session specific parameter, ErrorRecoveryLevel (default: 0)
6013allow_duplicated_isid           | Optional | boolean | Allow duplicated initiator session ID (default: `false`)
6014max_large_datain_per_connection | Optional | number  | Max number of outstanding split read I/Os per connection (default: 64)
6015max_r2t_per_connection          | Optional | number  | Max number of outstanding R2Ts per connection (default: 4)
6016pdu_pool_size                   | Optional | number  | Number of PDUs in the pool (default: approximately 2 * max_sessions * (max_queue_depth + max_connections_per_session))
6017immediate_data_pool_size        | Optional | number  | Number of immediate data buffers in the pool (default: 128 * max_sessions)
6018data_out_pool_size              | Optional | number  | Number of data out buffers in the pool (default: 16 * max_sessions)
6019
6020To load CHAP shared secret file, its path is required to specify explicitly in the parameter `auth_file`.
6021
6022Parameters `disable_chap` and `require_chap` are mutually exclusive. Parameters `no_discovery_auth`, `req_discovery_auth`,
6023`req_discovery_auth_mutual`, and `discovery_auth_group` are still available instead of `disable_chap`, `require_chap`,
6024`mutual_chap`, and `chap_group`, respectivey but will be removed in future releases.
6025
6026#### Example
6027
6028Example request:
6029
6030~~~json
6031{
6032  "params": {
6033    "allow_duplicated_isid": true,
6034    "default_time2retain": 60,
6035    "first_burst_length": 8192,
6036    "immediate_data": true,
6037    "node_base": "iqn.2016-06.io.spdk",
6038    "max_sessions": 128,
6039    "nop_timeout": 30,
6040    "nop_in_interval": 30,
6041    "auth_file": "/usr/local/etc/spdk/auth.conf",
6042    "disable_chap": true,
6043    "default_time2wait": 2
6044  },
6045  "jsonrpc": "2.0",
6046  "method": "iscsi_set_options",
6047  "id": 1
6048}
6049~~~
6050
6051Example response:
6052
6053~~~json
6054{
6055  "jsonrpc": "2.0",
6056  "id": 1,
6057  "result": true
6058}
6059~~~
6060
6061### iscsi_get_options method {#rpc_iscsi_get_options}
6062
6063Show global parameters of iSCSI targets.
6064
6065#### Parameters
6066
6067This method has no parameters.
6068
6069#### Example
6070
6071Example request:
6072
6073~~~json
6074request:
6075{
6076  "jsonrpc": "2.0",
6077  "method": "iscsi_get_options",
6078  "id": 1
6079}
6080~~~
6081
6082Example response:
6083
6084~~~json
6085{
6086  "jsonrpc": "2.0",
6087  "id": 1,
6088  "result": {
6089    "allow_duplicated_isid": true,
6090    "default_time2retain": 60,
6091    "first_burst_length": 8192,
6092    "immediate_data": true,
6093    "node_base": "iqn.2016-06.io.spdk",
6094    "mutual_chap": false,
6095    "nop_in_interval": 30,
6096    "chap_group": 0,
6097    "max_connections_per_session": 2,
6098    "max_queue_depth": 64,
6099    "nop_timeout": 30,
6100    "max_sessions": 128,
6101    "error_recovery_level": 0,
6102    "auth_file": "/usr/local/etc/spdk/auth.conf",
6103    "disable_chap": true,
6104    "default_time2wait": 2,
6105    "require_chap": false,
6106    "max_large_datain_per_connection": 64,
6107    "max_r2t_per_connection": 4
6108  }
6109}
6110~~~
6111
6112### scsi_get_devices {#rpc_scsi_get_devices}
6113
6114Display SCSI devices
6115
6116#### Parameters
6117
6118This method has no parameters.
6119
6120#### Example
6121
6122Example request:
6123
6124~~~json
6125{
6126  "jsonrpc": "2.0",
6127  "method": "scsi_get_devices",
6128  "id": 1
6129}
6130~~~
6131
6132Example response:
6133
6134~~~json
6135{
6136  "jsonrpc": "2.0",
6137  "id": 1,
6138  "result": [
6139    {
6140      "id": 0,
6141      "device_name": "iqn.2016-06.io.spdk:Target3"
6142    }
6143  ]
6144}
6145~~~
6146
6147### iscsi_set_discovery_auth method {#rpc_iscsi_set_discovery_auth}
6148
6149Set CHAP authentication for sessions dynamically.
6150
6151#### Parameters
6152
6153Name                        | Optional | Type    | Description
6154--------------------------- | -------- | --------| -----------
6155disable_chap                | Optional | boolean | CHAP for discovery session should be disabled (default: `false`)
6156require_chap                | Optional | boolean | CHAP for discovery session should be required (default: `false`)
6157mutual_chap                 | Optional | boolean | CHAP for discovery session should be unidirectional (`false`) or bidirectional (`true`) (default: `false`)
6158chap_group                  | Optional | number  | CHAP group ID for discovery session (default: 0)
6159
6160Parameters `disable_chap` and `require_chap` are mutually exclusive.
6161
6162#### Example
6163
6164Example request:
6165
6166~~~json
6167request:
6168{
6169  "params": {
6170    "chap_group": 1,
6171    "require_chap": true,
6172    "mutual_chap": true
6173  },
6174  "jsonrpc": "2.0",
6175  "method": "iscsi_set_discovery_auth",
6176  "id": 1
6177}
6178~~~
6179
6180Example response:
6181
6182~~~json
6183{
6184  "jsonrpc": "2.0",
6185  "id": 1,
6186  "result": true
6187}
6188~~~
6189
6190### iscsi_create_auth_group method {#rpc_iscsi_create_auth_group}
6191
6192Create an authentication group for CHAP authentication.
6193
6194#### Parameters
6195
6196Name                        | Optional | Type    | Description
6197--------------------------- | -------- | --------| -----------
6198tag                         | Required | number  | Authentication group tag (unique, integer > 0)
6199secrets                     | Optional | array   | Array of @ref rpc_iscsi_create_auth_group_secret objects
6200
6201#### secret {#rpc_iscsi_create_auth_group_secret}
6202
6203Name                        | Optional | Type    | Description
6204--------------------------- | ---------| --------| -----------
6205user                        | Required | string  | Unidirectional CHAP name
6206secret                      | Required | string  | Unidirectional CHAP secret
6207muser                       | Optional | string  | Bidirectional CHAP name
6208msecret                     | Optional | string  | Bidirectional CHAP secret
6209
6210#### Example
6211
6212Example request:
6213
6214~~~json
6215{
6216  "params": {
6217    "secrets": [
6218      {
6219        "muser": "mu1",
6220        "secret": "s1",
6221        "user": "u1",
6222        "msecret": "ms1"
6223      }
6224    ],
6225    "tag": 2
6226  },
6227  "jsonrpc": "2.0",
6228  "method": "iscsi_create_auth_group",
6229  "id": 1
6230}
6231~~~
6232
6233Example response:
6234
6235~~~json
6236{
6237  "jsonrpc": "2.0",
6238  "id": 1,
6239  "result": true
6240}
6241~~~
6242
6243### iscsi_delete_auth_group method {#rpc_iscsi_delete_auth_group}
6244
6245Delete an existing authentication group for CHAP authentication.
6246
6247#### Parameters
6248
6249Name                        | Optional | Type    | Description
6250--------------------------- | -------- | --------| -----------
6251tag                         | Required | number  | Authentication group tag (unique, integer > 0)
6252
6253#### Example
6254
6255Example request:
6256
6257~~~json
6258{
6259  "params": {
6260    "tag": 2
6261  },
6262  "jsonrpc": "2.0",
6263  "method": "iscsi_delete_auth_group",
6264  "id": 1
6265}
6266~~~
6267
6268Example response:
6269
6270~~~json
6271{
6272  "jsonrpc": "2.0",
6273  "id": 1,
6274  "result": true
6275}
6276~~~
6277
6278### iscsi_get_auth_groups {#rpc_iscsi_get_auth_groups}
6279
6280Show information about all existing authentication group for CHAP authentication.
6281
6282#### Parameters
6283
6284This method has no parameters.
6285
6286#### Result
6287
6288Array of objects describing authentication group.
6289
6290Name                        | Type    | Description
6291--------------------------- | --------| -----------
6292tag                         | number  | Authentication group tag
6293secrets                     | array   | Array of @ref rpc_iscsi_create_auth_group_secret objects
6294
6295#### Example
6296
6297Example request:
6298
6299~~~json
6300{
6301  "jsonrpc": "2.0",
6302  "method": "iscsi_get_auth_groups",
6303  "id": 1
6304}
6305~~~
6306
6307Example response:
6308
6309~~~json
6310{
6311  "jsonrpc": "2.0",
6312  "id": 1,
6313  "result": [
6314    {
6315      "secrets": [
6316        {
6317          "muser": "mu1",
6318          "secret": "s1",
6319          "user": "u1",
6320          "msecret": "ms1"
6321        }
6322      ],
6323      "tag": 1
6324    },
6325    {
6326      "secrets": [
6327        {
6328          "secret": "s2",
6329          "user": "u2"
6330        }
6331      ],
6332      "tag": 2
6333    }
6334  ]
6335}
6336~~~
6337
6338### iscsi_auth_group_add_secret {#rpc_iscsi_auth_group_add_secret}
6339
6340Add a secret to an existing authentication group for CHAP authentication.
6341
6342#### Parameters
6343
6344Name                        | Optional | Type    | Description
6345--------------------------- | -------- | --------| -----------
6346tag                         | Required | number  | Authentication group tag (unique, integer > 0)
6347user                        | Required | string  | Unidirectional CHAP name
6348secret                      | Required | string  | Unidirectional CHAP secret
6349muser                       | Optional | string  | Bidirectional CHAP name
6350msecret                     | Optional | string  | Bidirectional CHAP secret
6351
6352#### Example
6353
6354Example request:
6355
6356~~~json
6357{
6358  "params": {
6359    "muser": "mu3",
6360    "secret": "s3",
6361    "tag": 2,
6362    "user": "u3",
6363    "msecret": "ms3"
6364  },
6365  "jsonrpc": "2.0",
6366  "method": "iscsi_auth_group_add_secret",
6367  "id": 1
6368}
6369~~~json
6370
6371Example response:
6372
6373~~~json
6374{
6375  "jsonrpc": "2.0",
6376  "id": 1,
6377  "result": true
6378}
6379~~~
6380
6381### iscsi_auth_group_remove_secret {#rpc_iscsi_auth_group_remove_secret}
6382
6383Remove a secret from an existing authentication group for CHAP authentication.
6384
6385#### Parameters
6386
6387Name                        | Optional | Type    | Description
6388--------------------------- | -------- | --------| -----------
6389tag                         | Required | number  | Authentication group tag (unique, integer > 0)
6390user                        | Required | string  | Unidirectional CHAP name
6391
6392#### Example
6393
6394Example request:
6395
6396~~~json
6397{
6398  "params": {
6399    "tag": 2,
6400    "user": "u3"
6401  },
6402  "jsonrpc": "2.0",
6403  "method": "iscsi_auth_group_remove_secret",
6404  "id": 1
6405}
6406~~~
6407
6408Example response:
6409
6410~~~json
6411{
6412  "jsonrpc": "2.0",
6413  "id": 1,
6414  "result": true
6415}
6416~~~
6417
6418### iscsi_get_initiator_groups method {#rpc_iscsi_get_initiator_groups}
6419
6420Show information about all available initiator groups.
6421
6422#### Parameters
6423
6424This method has no parameters.
6425
6426#### Result
6427
6428Array of objects describing initiator groups.
6429
6430Name                        | Type    | Description
6431--------------------------- | --------| -----------
6432tag                         | number  | Initiator group tag
6433initiators                  | array   | Array of initiator hostnames or IP addresses
6434netmasks                    | array   | Array of initiator netmasks
6435
6436#### Example
6437
6438Example request:
6439
6440~~~json
6441{
6442  "jsonrpc": "2.0",
6443  "method": "iscsi_get_initiator_groups",
6444  "id": 1
6445}
6446~~~
6447
6448Example response:
6449
6450~~~json
6451{
6452  "jsonrpc": "2.0",
6453  "id": 1,
6454  "result": [
6455    {
6456      "initiators": [
6457        "iqn.2016-06.io.spdk:host1",
6458        "iqn.2016-06.io.spdk:host2"
6459      ],
6460      "tag": 1,
6461      "netmasks": [
6462        "192.168.1.0/24"
6463      ]
6464    }
6465  ]
6466}
6467~~~
6468
6469### iscsi_create_initiator_group method {#rpc_iscsi_create_initiator_group}
6470
6471Add an initiator group.
6472
6473#### Parameters
6474
6475Name                        | Optional | Type    | Description
6476--------------------------- | -------- | --------| -----------
6477tag                         | Required | number  | Initiator group tag (unique, integer > 0)
6478initiators                  | Required | array   | Not empty array of initiator hostnames or IP addresses
6479netmasks                    | Required | array   | Not empty array of initiator netmasks
6480
6481#### Example
6482
6483Example request:
6484
6485~~~json
6486{
6487  "params": {
6488    "initiators": [
6489      "iqn.2016-06.io.spdk:host1",
6490      "iqn.2016-06.io.spdk:host2"
6491    ],
6492    "tag": 1,
6493    "netmasks": [
6494      "192.168.1.0/24"
6495    ]
6496  },
6497  "jsonrpc": "2.0",
6498  "method": "iscsi_create_initiator_group",
6499  "id": 1
6500}
6501~~~
6502
6503Example response:
6504
6505~~~json
6506response:
6507{
6508  "jsonrpc": "2.0",
6509  "id": 1,
6510  "result": true
6511}
6512~~~
6513
6514### iscsi_delete_initiator_group method {#rpc_iscsi_delete_initiator_group}
6515
6516Delete an existing initiator group.
6517
6518#### Parameters
6519
6520Name                        | Optional | Type    | Description
6521--------------------------- | -------- | --------| -----------
6522tag                         | Required | number  | Initiator group tag (unique, integer > 0)
6523
6524#### Example
6525
6526Example request:
6527
6528~~~json
6529{
6530  "params": {
6531    "tag": 1
6532  },
6533  "jsonrpc": "2.0",
6534  "method": "iscsi_delete_initiator_group",
6535  "id": 1
6536}
6537~~~
6538
6539Example response:
6540
6541~~~json
6542{
6543  "jsonrpc": "2.0",
6544  "id": 1,
6545  "result": true
6546}
6547~~~
6548
6549### iscsi_initiator_group_add_initiators method {#rpc_iscsi_initiator_group_add_initiators}
6550
6551Add initiators to an existing initiator group.
6552
6553#### Parameters
6554
6555Name                        | Optional | Type    | Description
6556--------------------------- | -------- | --------| -----------
6557tag                         | Required | number  | Existing initiator group tag.
6558initiators                  | Optional | array   | Array of initiator hostnames or IP addresses
6559netmasks                    | Optional | array   | Array of initiator netmasks
6560
6561#### Example
6562
6563Example request:
6564
6565~~~json
6566request:
6567{
6568  "params": {
6569    "initiators": [
6570      "iqn.2016-06.io.spdk:host3"
6571    ],
6572    "tag": 1,
6573    "netmasks": [
6574      "255.255.255.1"
6575    ]
6576  },
6577  "jsonrpc": "2.0",
6578  "method": "iscsi_initiator_group_add_initiators",
6579  "id": 1
6580}
6581~~~
6582
6583Example response:
6584
6585~~~json
6586response:
6587{
6588  "jsonrpc": "2.0",
6589  "id": 1,
6590  "result": true
6591}
6592~~~
6593
6594### iscsi_initiator_group_remove_initiators method {#rpc_iscsi_initiator_group_remove_initiators}
6595
6596Remove initiators from an initiator group.
6597
6598#### Parameters
6599
6600Name                        | Optional | Type    | Description
6601--------------------------- | -------- | --------| -----------
6602tag                         | Required | number  | Existing initiator group tag.
6603initiators                  | Optional | array   | Array of initiator hostnames or IP addresses
6604netmasks                    | Optional | array   | Array of initiator netmasks
6605
6606#### Example
6607
6608Example request:
6609
6610~~~json
6611request:
6612{
6613  "params": {
6614    "initiators": [
6615      "iqn.2016-06.io.spdk:host3"
6616    ],
6617    "tag": 1,
6618    "netmasks": [
6619      "255.255.255.1"
6620    ]
6621  },
6622  "jsonrpc": "2.0",
6623  "method": "iscsi_initiator_group_remove_initiators",
6624  "id": 1
6625}
6626~~~
6627
6628Example response:
6629
6630~~~json
6631response:
6632{
6633  "jsonrpc": "2.0",
6634  "id": 1,
6635  "result": true
6636}
6637~~~
6638
6639### iscsi_get_target_nodes method {#rpc_iscsi_get_target_nodes}
6640
6641Show information about all available iSCSI target nodes.
6642
6643#### Parameters
6644
6645This method has no parameters.
6646
6647#### Result
6648
6649Array of objects describing target node.
6650
6651Name                        | Type    | Description
6652--------------------------- | --------| -----------
6653name                        | string  | Target node name (ASCII)
6654alias_name                  | string  | Target node alias name (ASCII)
6655pg_ig_maps                  | array   | Array of Portal_Group_Tag:Initiator_Group_Tag mappings
6656luns                        | array   | Array of Bdev names to LUN ID mappings
6657queue_depth                 | number  | Target queue depth
6658disable_chap                | boolean | CHAP authentication should be disabled for this target
6659require_chap                | boolean | CHAP authentication should be required for this target
6660mutual_chap                 | boolean | CHAP authentication should be bidirectional (`true`) or unidirectional (`false`)
6661chap_group                  | number  | Authentication group ID for this target node
6662header_digest               | boolean | Header Digest should be required for this target node
6663data_digest                 | boolean | Data Digest should be required for this target node
6664
6665#### Example
6666
6667Example request:
6668
6669~~~json
6670{
6671  "jsonrpc": "2.0",
6672  "method": "iscsi_get_target_nodes",
6673  "id": 1
6674}
6675~~~
6676
6677Example response:
6678
6679~~~json
6680{
6681  "jsonrpc": "2.0",
6682  "id": 1,
6683  "result": [
6684    {
6685      "luns": [
6686        {
6687          "lun_id": 0,
6688          "bdev_name": "Nvme0n1"
6689        }
6690      ],
6691      "mutual_chap": false,
6692      "name": "iqn.2016-06.io.spdk:target1",
6693      "alias_name": "iscsi-target1-alias",
6694      "require_chap": false,
6695      "chap_group": 0,
6696      "pg_ig_maps": [
6697        {
6698          "ig_tag": 1,
6699          "pg_tag": 1
6700        }
6701      ],
6702      "data_digest": false,
6703      "disable_chap": false,
6704      "header_digest": false,
6705      "queue_depth": 64
6706    }
6707  ]
6708}
6709~~~
6710
6711### iscsi_create_target_node method {#rpc_iscsi_create_target_node}
6712
6713Add an iSCSI target node.
6714
6715#### Parameters
6716
6717Name                        | Optional | Type    | Description
6718--------------------------- | -------- | --------| -----------
6719name                        | Required | string  | Target node name (ASCII)
6720alias_name                  | Required | string  | Target node alias name (ASCII)
6721pg_ig_maps                  | Required | array   | Array of (Portal_Group_Tag:Initiator_Group_Tag) mappings
6722luns                        | Required | array   | Array of Bdev names to LUN ID mappings
6723queue_depth                 | Required | number  | Target queue depth
6724disable_chap                | Optional | boolean | CHAP authentication should be disabled for this target
6725require_chap                | Optional | boolean | CHAP authentication should be required for this target
6726mutual_chap                 | Optional | boolean | CHAP authentication should be bidirectional (`true`) or unidirectional (`false`)
6727chap_group                  | Optional | number  | Authentication group ID for this target node
6728header_digest               | Optional | boolean | Header Digest should be required for this target node
6729data_digest                 | Optional | boolean | Data Digest should be required for this target node
6730
6731Parameters `disable_chap` and `require_chap` are mutually exclusive.
6732
6733#### Example
6734
6735Example request:
6736
6737~~~json
6738{
6739  "params": {
6740    "luns": [
6741      {
6742        "lun_id": 0,
6743        "bdev_name": "Nvme0n1"
6744      }
6745    ],
6746    "mutual_chap": true,
6747    "name": "target2",
6748    "alias_name": "iscsi-target2-alias",
6749    "pg_ig_maps": [
6750      {
6751        "ig_tag": 1,
6752        "pg_tag": 1
6753      },
6754      {
6755        "ig_tag": 2,
6756        "pg_tag": 2
6757      }
6758    ],
6759    "data_digest": true,
6760    "disable_chap": true,
6761    "header_digest": true,
6762    "queue_depth": 24
6763  },
6764  "jsonrpc": "2.0",
6765  "method": "iscsi_create_target_node",
6766  "id": 1
6767}
6768~~~
6769
6770Example response:
6771
6772~~~json
6773{
6774  "jsonrpc": "2.0",
6775  "id": 1,
6776  "result": true
6777}
6778~~~
6779
6780### iscsi_target_node_set_auth method {#rpc_iscsi_target_node_set_auth}
6781
6782Set CHAP authentication to an existing iSCSI target node.
6783
6784#### Parameters
6785
6786Name                        | Optional | Type    | Description
6787--------------------------- | -------- | --------| -----------
6788name                        | Required | string  | Target node name (ASCII)
6789disable_chap                | Optional | boolean | CHAP authentication should be disabled for this target
6790require_chap                | Optional | boolean | CHAP authentication should be required for this target
6791mutual_chap                 | Optional | boolean | CHAP authentication should be bidirectional (`true`) or unidirectional (`false`)
6792chap_group                  | Optional | number  | Authentication group ID for this target node
6793
6794Parameters `disable_chap` and `require_chap` are mutually exclusive.
6795
6796#### Example
6797
6798Example request:
6799
6800~~~json
6801{
6802  "params": {
6803    "chap_group": 1,
6804    "require_chap": true,
6805    "name": "iqn.2016-06.io.spdk:target1",
6806    "mutual_chap": true
6807  },
6808  "jsonrpc": "2.0",
6809  "method": "iscsi_target_node_set_auth",
6810  "id": 1
6811}
6812~~~
6813
6814Example response:
6815
6816~~~json
6817{
6818  "jsonrpc": "2.0",
6819  "id": 1,
6820  "result": true
6821}
6822~~~
6823
6824### iscsi_target_node_add_pg_ig_maps method {#rpc_iscsi_target_node_add_pg_ig_maps}
6825
6826Add initiator group to portal group mappings to an existing iSCSI target node.
6827
6828#### Parameters
6829
6830Name                        | Optional | Type    | Description
6831--------------------------- | -------- | --------| -----------
6832name                        | Required | string  | Target node name (ASCII)
6833pg_ig_maps                  | Required | array   | Not empty array of initiator to portal group mappings objects
6834
6835Portal to Initiator group mappings object:
6836
6837Name                        | Optional | Type    | Description
6838--------------------------- | -------- | --------| -----------
6839ig_tag                      | Required | number  | Existing initiator group tag
6840pg_tag                      | Required | number  | Existing portal group tag
6841
6842#### Example
6843
6844Example request:
6845
6846~~~json
6847{
6848  "params": {
6849    "pg_ig_maps": [
6850      {
6851        "ig_tag": 1,
6852        "pg_tag": 1
6853      },
6854      {
6855        "ig_tag": 2,
6856        "pg_tag": 2
6857      },
6858      {
6859        "ig_tag": 3,
6860        "pg_tag": 3
6861      }
6862    ],
6863    "name": "iqn.2016-06.io.spdk:target3"
6864  },
6865  "jsonrpc": "2.0",
6866  "method": "iscsi_target_node_add_pg_ig_maps",
6867  "id": 1
6868}
6869~~~
6870
6871Example response:
6872
6873~~~json
6874{
6875  "jsonrpc": "2.0",
6876  "id": 1,
6877  "result": true
6878}
6879~~~
6880
6881### iscsi_target_node_remove_pg_ig_maps method {#rpc_iscsi_target_node_remove_pg_ig_maps}
6882
6883Delete initiator group to portal group mappings from an existing iSCSI target node.
6884
6885#### Parameters
6886
6887Name                        | Optional | Type    | Description
6888--------------------------- | -------- | --------| -----------
6889name                        | Required | string  | Target node name (ASCII)
6890pg_ig_maps                  | Required | array   | Not empty array of Portal to Initiator group mappings objects
6891
6892Portal to Initiator group mappings object:
6893
6894Name                        | Optional | Type    | Description
6895--------------------------- | -------- | --------| -----------
6896ig_tag                      | Required | number  | Existing initiator group tag
6897pg_tag                      | Required | number  | Existing portal group tag
6898
6899#### Example
6900
6901Example request:
6902
6903~~~json
6904{
6905  "params": {
6906    "pg_ig_maps": [
6907      {
6908        "ig_tag": 1,
6909        "pg_tag": 1
6910      },
6911      {
6912        "ig_tag": 2,
6913        "pg_tag": 2
6914      },
6915      {
6916        "ig_tag": 3,
6917        "pg_tag": 3
6918      }
6919    ],
6920    "name": "iqn.2016-06.io.spdk:target3"
6921  },
6922  "jsonrpc": "2.0",
6923  "method": "iscsi_target_node_remove_pg_ig_maps",
6924  "id": 1
6925}
6926~~~
6927
6928Example response:
6929
6930~~~json
6931{
6932  "jsonrpc": "2.0",
6933  "id": 1,
6934  "result": true
6935}
6936~~~
6937
6938### iscsi_delete_target_node method {#rpc_iscsi_delete_target_node}
6939
6940Delete an iSCSI target node.
6941
6942#### Parameters
6943
6944Name                        | Optional | Type    | Description
6945--------------------------- | -------- | --------| -----------
6946name                        | Required | string  | Target node name (ASCII)
6947
6948#### Example
6949
6950Example request:
6951
6952~~~json
6953{
6954  "params": {
6955    "name": "iqn.2016-06.io.spdk:target1"
6956  },
6957  "jsonrpc": "2.0",
6958  "method": "iscsi_delete_target_node",
6959  "id": 1
6960}
6961~~~
6962
6963Example response:
6964
6965~~~json
6966{
6967  "jsonrpc": "2.0",
6968  "id": 1,
6969  "result": true
6970}
6971~~~
6972
6973### iscsi_get_portal_groups method {#rpc_iscsi_get_portal_groups}
6974
6975Show information about all available portal groups.
6976
6977#### Parameters
6978
6979This method has no parameters.
6980
6981#### Example
6982
6983Example request:
6984
6985~~~json
6986request:
6987{
6988  "jsonrpc": "2.0",
6989  "method": "iscsi_get_portal_groups",
6990  "id": 1
6991}
6992~~~
6993
6994Example response:
6995
6996~~~json
6997{
6998  "jsonrpc": "2.0",
6999  "id": 1,
7000  "result": [
7001    {
7002      "portals": [
7003        {
7004          "host": "127.0.0.1",
7005          "port": "3260"
7006        }
7007      ],
7008      "tag": 1,
7009      "private": false
7010    }
7011  ]
7012}
7013~~~
7014
7015### iscsi_create_portal_group method {#rpc_iscsi_create_portal_group}
7016
7017Add a portal group.
7018
7019#### Parameters
7020
7021Name                        | Optional | Type    | Description
7022--------------------------- | -------- | --------| -----------
7023tag                         | Required | number  | Portal group tag
7024portals                     | Required | array   | Not empty array of portals
7025private                     | Optional | boolean | When true, portals in this group are not returned by a discovery session. Used for login redirection. (default: `false`)
7026wait                        | Optional | boolean | When true, do not listen on portals until it is started explicitly. (default: `false`)
7027
7028Portal object
7029
7030Name                        | Optional | Type    | Description
7031--------------------------- | -------- | --------| -----------
7032host                        | Required | string  | Hostname or IP address
7033port                        | Required | string  | Port number
7034
7035#### Example
7036
7037Example request:
7038
7039~~~json
7040{
7041  "params": {
7042    "portals": [
7043      {
7044        "host": "127.0.0.1",
7045        "port": "3260"
7046      }
7047    ],
7048    "tag": 1
7049  },
7050  "jsonrpc": "2.0",
7051  "method": "iscsi_create_portal_group",
7052  "id": 1
7053}
7054~~~
7055
7056Example response:
7057
7058~~~json
7059{
7060  "jsonrpc": "2.0",
7061  "id": 1,
7062  "result": true
7063}
7064~~~
7065
7066### iscsi_start_portal_group method {#rpc_iscsi_start_portal_group}
7067
7068Start listening on portals if the portal group is not started yet, or do nothing
7069if the portal group already started. Return a success response for both cases.
7070
7071#### Parameters
7072
7073Name                        | Optional | Type    | Description
7074--------------------------- | -------- | --------| -----------
7075tag                         | Required | number  | Existing portal group tag
7076
7077#### Example
7078
7079Example request:
7080
7081~~~json
7082{
7083  "params": {
7084    "tag": 1
7085  },
7086  "jsonrpc": "2.0",
7087  "method": "iscsi_start_portal_group",
7088  "id": 1
7089}
7090~~~
7091
7092Example response:
7093
7094~~~json
7095{
7096  "jsonrpc": "2.0",
7097  "id": 1,
7098  "result": true
7099}
7100~~~
7101
7102### iscsi_delete_portal_group method {#rpc_iscsi_delete_portal_group}
7103
7104Delete an existing portal group.
7105
7106#### Parameters
7107
7108Name                        | Optional | Type    | Description
7109--------------------------- | -------- | --------| -----------
7110tag                         | Required | number  | Existing portal group tag
7111
7112#### Example
7113
7114Example request:
7115
7116~~~json
7117{
7118  "params": {
7119    "tag": 1
7120  },
7121  "jsonrpc": "2.0",
7122  "method": "iscsi_delete_portal_group",
7123  "id": 1
7124}
7125~~~
7126
7127Example response:
7128
7129~~~json
7130{
7131  "jsonrpc": "2.0",
7132  "id": 1,
7133  "result": true
7134}
7135~~~
7136
7137### iscsi_portal_group_set_auth method {#rpc_iscsi_portal_group_set_auth}
7138
7139Set CHAP authentication for discovery sessions specific for the existing iSCSI portal group.
7140This RPC overwrites the setting by the global parameters for the iSCSI portal group.
7141
7142#### Parameters
7143
7144Name                        | Optional | Type    | Description
7145--------------------------- | -------- | --------| -----------
7146disable_chap                | Optional | boolean | CHAP for discovery session should be disabled (default: `false`)
7147require_chap                | Optional | boolean | CHAP for discovery session should be required (default: `false`)
7148mutual_chap                 | Optional | boolean | CHAP for discovery session should be unidirectional (`false`) or bidirectional (`true`) (default: `false`)
7149chap_group                  | Optional | number  | CHAP group ID for discovery session (default: 0)
7150
7151Parameters `disable_chap` and `require_chap` are mutually exclusive.
7152
7153#### Example
7154
7155Example request:
7156
7157~~~json
7158request:
7159{
7160  "params": {
7161    "tag": 1,
7162    "chap_group": 1,
7163    "require_chap": true,
7164    "mutual_chap": true
7165  },
7166  "jsonrpc": "2.0",
7167  "method": "iscsi_portal_group_set_auth",
7168  "id": 1
7169}
7170~~~
7171
7172Example response:
7173
7174~~~json
7175{
7176  "jsonrpc": "2.0",
7177  "id": 1,
7178  "result": true
7179}
7180~~~
7181
7182### iscsi_get_connections method {#rpc_iscsi_get_connections}
7183
7184Show information about all active connections.
7185
7186#### Parameters
7187
7188This method has no parameters.
7189
7190#### Results
7191
7192Array of objects describing iSCSI connection.
7193
7194Name                        | Type    | Description
7195--------------------------- | --------| -----------
7196id                          | number  | Index (used for TTT - Target Transfer Tag)
7197cid                         | number  | CID (Connection ID)
7198tsih                        | number  | TSIH (Target Session Identifying Handle)
7199lcore_id                    | number  | Core number on which the iSCSI connection runs
7200initiator_addr              | string  | Initiator address
7201target_addr                 | string  | Target address
7202target_node_name            | string  | Target node name (ASCII) without prefix
7203
7204#### Example
7205
7206Example request:
7207
7208~~~json
7209{
7210  "jsonrpc": "2.0",
7211  "method": "iscsi_get_connections",
7212  "id": 1
7213}
7214~~~
7215
7216Example response:
7217
7218~~~json
7219{
7220  "jsonrpc": "2.0",
7221  "id": 1,
7222  "result": [
7223    {
7224      "tsih": 4,
7225      "cid": 0,
7226      "target_node_name": "target1",
7227      "lcore_id": 0,
7228      "initiator_addr": "10.0.0.2",
7229      "target_addr": "10.0.0.1",
7230      "id": 0
7231    }
7232  ]
7233}
7234~~~
7235
7236### iscsi_target_node_add_lun method {#rpc_iscsi_target_node_add_lun}
7237
7238Add an LUN to an existing iSCSI target node.
7239
7240#### Parameters
7241
7242Name                        | Optional | Type    | Description
7243--------------------------- | -------- | --------| -----------
7244name                        | Required | string  | Target node name (ASCII)
7245bdev_name                   | Required | string  | bdev name to be added as a LUN
7246lun_id                      | Optional | number  | LUN ID (default: first free ID)
7247
7248#### Example
7249
7250Example request:
7251
7252~~~json
7253{
7254  "params": {
7255    "lun_id": 2,
7256    "name": "iqn.2016-06.io.spdk:target1",
7257    "bdev_name": "Malloc0"
7258  },
7259  "jsonrpc": "2.0",
7260  "method": "iscsi_target_node_add_lun",
7261  "id": 1
7262}
7263~~~
7264
7265Example response:
7266
7267~~~json
7268{
7269  "jsonrpc": "2.0",
7270  "id": 1,
7271  "result": true
7272}
7273~~~
7274
7275### iscsi_target_node_set_redirect method {#rpc_iscsi_target_node_set_redirect}
7276
7277Update redirect portal of the primary portal group for the target node,
7278
7279#### Parameters
7280
7281Name                        | Optional | Type    | Description
7282--------------------------- | -------- | --------| -----------
7283name                        | Required | string  | Target node name (ASCII)
7284pg_tag                      | Required | number  | Existing portal group tag
7285redirect_host               | Optional | string  | Numeric IP address to which the target node is redirected
7286redirect_port               | Optional | string  | Numeric TCP port to which the target node is redirected
7287
7288If both redirect_host and redirect_port are omitted, clear the redirect portal.
7289
7290#### Example
7291
7292Example request:
7293
7294~~~json
7295{
7296  "params": {
7297    "name": "iqn.2016-06.io.spdk:target1",
7298    "pg_tag": 1,
7299    "redirect_host": "10.0.0.3",
7300    "redirect_port": "3260"
7301  },
7302  "jsonrpc": "2.0",
7303  "method": "iscsi_target_node_set_redirect",
7304  "id": 1
7305}
7306~~~
7307
7308Example response:
7309
7310~~~json
7311{
7312  "jsonrpc": "2.0",
7313  "id": 1,
7314  "result": true
7315}
7316~~~
7317
7318### iscsi_target_node_request_logout method {#rpc_iscsi_target_node_request_logout}
7319
7320For the target node, request connections whose portal group tag match to logout,
7321or request all connections to logout if portal group tag is omitted.
7322
7323#### Parameters
7324
7325Name                        | Optional | Type    | Description
7326--------------------------- | -------- | --------| -----------
7327name                        | Required | string  | Target node name (ASCII)
7328pg_tag                      | Optional | number  | Existing portal group tag
7329
7330#### Example
7331
7332Example request:
7333
7334~~~json
7335{
7336  "params": {
7337    "name": "iqn.2016-06.io.spdk:target1",
7338    "pg_tag": 1
7339  },
7340  "jsonrpc": "2.0",
7341  "method": "iscsi_target_node_request_logout",
7342  "id": 1
7343}
7344~~~
7345
7346Example response:
7347
7348~~~json
7349{
7350  "jsonrpc": "2.0",
7351  "id": 1,
7352  "result": true
7353}
7354~~~
7355
7356## NVMe-oF Target {#jsonrpc_components_nvmf_tgt}
7357
7358### nvmf_create_transport method {#rpc_nvmf_create_transport}
7359
7360Initialize an NVMe-oF transport with the given options.
7361
7362#### Parameters
7363
7364Name                        | Optional | Type    | Description
7365--------------------------- | -------- | --------| -----------
7366trtype                      | Required | string  | Transport type (ex. RDMA)
7367tgt_name                    | Optional | string  | Parent NVMe-oF target name.
7368max_queue_depth             | Optional | number  | Max number of outstanding I/O per queue
7369max_io_qpairs_per_ctrlr     | Optional | number  | Max number of IO qpairs per controller
7370in_capsule_data_size        | Optional | number  | Max number of in-capsule data size
7371max_io_size                 | Optional | number  | Max I/O size (bytes)
7372io_unit_size                | Optional | number  | I/O unit size (bytes)
7373max_aq_depth                | Optional | number  | Max number of admin cmds per AQ
7374num_shared_buffers          | Optional | number  | The number of pooled data buffers available to the transport
7375buf_cache_size              | Optional | number  | The number of shared buffers to reserve for each poll group
7376num_cqe                     | Optional | number  | The number of CQ entires. Only used when no_srq=true (RDMA only)
7377max_srq_depth               | Optional | number  | The number of elements in a per-thread shared receive queue (RDMA only)
7378no_srq                      | Optional | boolean | Disable shared receive queue even for devices that support it. (RDMA only)
7379c2h_success                 | Optional | boolean | Disable C2H success optimization (TCP only)
7380dif_insert_or_strip         | Optional | boolean | Enable DIF insert for write I/O and DIF strip for read I/O DIF
7381sock_priority               | Optional | number  | The socket priority of the connection owned by this transport (TCP only)
7382acceptor_backlog            | Optional | number  | The number of pending connections allowed in backlog before failing new connection attempts (RDMA only)
7383abort_timeout_sec           | Optional | number  | Abort execution timeout value, in seconds
7384no_wr_batching              | Optional | boolean | Disable work requests batching (RDMA only)
7385control_msg_num             | Optional | number  | The number of control messages per poll group (TCP only)
7386disable_mappable_bar0       | Optional | boolean | disable client mmap() of BAR0 (VFIO-USER only)
7387disable_adaptive_irq        | Optional | boolean | Disable adaptive interrupt feature (VFIO-USER only)
7388disable_shadow_doorbells    | Optional | boolean | disable shadow doorbell support (VFIO-USER only)
7389zcopy                       | Optional | boolean | Use zero-copy operations if the underlying bdev supports them
7390
7391#### Example
7392
7393Example request:
7394
7395~~~json
7396{
7397  "jsonrpc": "2.0",
7398  "method": "nvmf_create_transport",
7399  "id": 1,
7400  "params": {
7401    "trtype": "RDMA",
7402    "max_queue_depth": 32
7403  }
7404}
7405~~~
7406
7407Example response:
7408
7409~~~json
7410{
7411  "jsonrpc": "2.0",
7412  "id": 1,
7413  "result": true
7414}
7415~~~
7416
7417### nvmf_get_subsystems method {#rpc_nvmf_get_subsystems}
7418
7419#### Parameters
7420
7421Name                        | Optional | Type        | Description
7422--------------------------- | -------- | ------------| -----------
7423tgt_name                    | Optional | string      | Parent NVMe-oF target name.
7424
7425#### Example
7426
7427Example request:
7428
7429~~~json
7430{
7431  "jsonrpc": "2.0",
7432  "id": 1,
7433  "method": "nvmf_get_subsystems"
7434}
7435~~~
7436
7437Example response:
7438
7439~~~json
7440{
7441  "jsonrpc": "2.0",
7442  "id": 1,
7443  "result": [
7444    {
7445      "nqn": "nqn.2014-08.org.nvmexpress.discovery",
7446      "subtype": "Discovery"
7447      "listen_addresses": [],
7448      "hosts": [],
7449      "allow_any_host": true
7450    },
7451    {
7452      "nqn": "nqn.2016-06.io.spdk:cnode1",
7453      "subtype": "NVMe",
7454      "listen_addresses": [
7455        {
7456          "trtype": "RDMA",
7457          "adrfam": "IPv4",
7458          "traddr": "192.168.0.123",
7459          "trsvcid": "4420"
7460        }
7461      ],
7462      "hosts": [
7463        {"nqn": "nqn.2016-06.io.spdk:host1"}
7464      ],
7465      "allow_any_host": false,
7466      "serial_number": "abcdef",
7467      "model_number": "ghijklmnop",
7468      "namespaces": [
7469        {"nsid": 1, "name": "Malloc2"},
7470        {"nsid": 2, "name": "Nvme0n1"}
7471      ]
7472    }
7473  ]
7474}
7475~~~
7476
7477### nvmf_create_subsystem method {#rpc_nvmf_create_subsystem}
7478
7479Construct an NVMe over Fabrics target subsystem.
7480
7481#### Parameters
7482
7483Name                    | Optional | Type        | Description
7484----------------------- | -------- | ----------- | -----------
7485nqn                     | Required | string      | Subsystem NQN
7486tgt_name                | Optional | string      | Parent NVMe-oF target name.
7487serial_number           | Optional | string      | Serial number of virtual controller
7488model_number            | Optional | string      | Model number of virtual controller
7489max_namespaces          | Optional | number      | Maximum number of namespaces that can be attached to the subsystem. Default: 0 (Unlimited)
7490allow_any_host          | Optional | boolean     | Allow any host (`true`) or enforce allowed host list (`false`). Default: `false`.
7491ana_reporting           | Optional | boolean     | Enable ANA reporting feature (default: `false`).
7492min_cntlid              | Optional | number      | Minimum controller ID. Default: 1
7493max_cntlid              | Optional | number      | Maximum controller ID. Default: 0xffef
7494
7495#### Example
7496
7497Example request:
7498
7499~~~json
7500{
7501  "jsonrpc": "2.0",
7502  "id": 1,
7503  "method": "nvmf_create_subsystem",
7504  "params": {
7505    "nqn": "nqn.2016-06.io.spdk:cnode1",
7506    "allow_any_host": false,
7507    "serial_number": "abcdef",
7508    "model_number": "ghijklmnop"
7509  }
7510}
7511~~~
7512
7513Example response:
7514
7515~~~json
7516{
7517  "jsonrpc": "2.0",
7518  "id": 1,
7519  "result": true
7520}
7521~~~
7522
7523### nvmf_delete_subsystem method {#rpc_nvmf_delete_subsystem}
7524
7525Delete an existing NVMe-oF subsystem.
7526
7527#### Parameters
7528
7529Parameter              | Optional | Type        | Description
7530---------------------- | -------- | ----------- | -----------
7531nqn                    | Required | string      | Subsystem NQN to delete.
7532tgt_name               | Optional | string      | Parent NVMe-oF target name.
7533
7534#### Example
7535
7536Example request:
7537
7538~~~json
7539{
7540  "jsonrpc": "2.0",
7541  "id": 1,
7542  "method": "nvmf_delete_subsystem",
7543  "params": {
7544    "nqn": "nqn.2016-06.io.spdk:cnode1"
7545  }
7546}
7547~~~
7548
7549Example response:
7550
7551~~~json
7552{
7553  "jsonrpc": "2.0",
7554  "id": 1,
7555  "result": true
7556}
7557~~~
7558
7559### nvmf_subsystem_add_listener  method {#rpc_nvmf_subsystem_add_listener}
7560
7561Add a new listen address to an NVMe-oF subsystem.
7562
7563#### Parameters
7564
7565Name                    | Optional | Type        | Description
7566----------------------- | -------- | ----------- | -----------
7567nqn                     | Required | string      | Subsystem NQN
7568tgt_name                | Optional | string      | Parent NVMe-oF target name.
7569listen_address          | Required | object      | @ref rpc_nvmf_listen_address object
7570
7571#### listen_address {#rpc_nvmf_listen_address}
7572
7573Name                    | Optional | Type        | Description
7574----------------------- | -------- | ----------- | -----------
7575trtype                  | Required | string      | Transport type ("RDMA")
7576adrfam                  | Required | string      | Address family ("IPv4", "IPv6", "IB", or "FC")
7577traddr                  | Required | string      | Transport address
7578trsvcid                 | Optional | string      | Transport service ID (required for RDMA or TCP)
7579
7580#### Example
7581
7582Example request:
7583
7584~~~json
7585{
7586  "jsonrpc": "2.0",
7587  "id": 1,
7588  "method": "nvmf_subsystem_add_listener",
7589  "params": {
7590    "nqn": "nqn.2016-06.io.spdk:cnode1",
7591    "listen_address": {
7592      "trtype": "RDMA",
7593      "adrfam": "IPv4",
7594      "traddr": "192.168.0.123",
7595      "trsvcid": "4420"
7596    }
7597  }
7598}
7599~~~
7600
7601Example response:
7602
7603~~~json
7604{
7605  "jsonrpc": "2.0",
7606  "id": 1,
7607  "result": true
7608}
7609~~~
7610
7611### nvmf_subsystem_remove_listener  method {#rpc_nvmf_subsystem_remove_listener}
7612
7613Remove a listen address from an NVMe-oF subsystem.
7614
7615#### Parameters
7616
7617Name                    | Optional | Type        | Description
7618----------------------- | -------- | ----------- | -----------
7619nqn                     | Required | string      | Subsystem NQN
7620tgt_name                | Optional | string      | Parent NVMe-oF target name.
7621listen_address          | Required | object      | @ref rpc_nvmf_listen_address object
7622
7623#### Example
7624
7625Example request:
7626
7627~~~json
7628{
7629  "jsonrpc": "2.0",
7630  "id": 1,
7631  "method": "nvmf_subsystem_remove_listener",
7632  "params": {
7633    "nqn": "nqn.2016-06.io.spdk:cnode1",
7634    "listen_address": {
7635      "trtype": "RDMA",
7636      "adrfam": "IPv4",
7637      "traddr": "192.168.0.123",
7638      "trsvcid": "4420"
7639    }
7640  }
7641}
7642~~~
7643
7644Example response:
7645
7646~~~json
7647{
7648  "jsonrpc": "2.0",
7649  "id": 1,
7650  "result": true
7651}
7652~~~
7653
7654### nvmf_subsystem_listener_set_ana_state  method {#rpc_nvmf_subsystem_listener_set_ana_state}
7655
7656Set ANA state of a listener for an NVMe-oF subsystem. Only the ANA state of the specified ANA
7657group is updated, or ANA states of all ANA groups if ANA group is not specified.
7658
7659#### Parameters
7660
7661Name                    | Optional | Type        | Description
7662----------------------- | -------- | ----------- | -----------
7663nqn                     | Required | string      | Subsystem NQN
7664tgt_name                | Optional | string      | Parent NVMe-oF target name.
7665listen_address          | Required | object      | @ref rpc_nvmf_listen_address object
7666ana_state               | Required | string      | ANA state to set ("optimized", "non_optimized", or "inaccessible")
7667anagrpid                | Optional | number      | ANA group ID
7668
7669#### Example
7670
7671Example request:
7672
7673~~~json
7674{
7675  "jsonrpc": "2.0",
7676  "id": 1,
7677  "method": "nvmf_subsystem_listener_set_ana_state",
7678  "params": {
7679    "nqn": "nqn.2016-06.io.spdk:cnode1",
7680    "listen_address": {
7681      "trtype": "RDMA",
7682      "adrfam": "IPv4",
7683      "traddr": "192.168.0.123",
7684      "trsvcid": "4420"
7685    },
7686    "ana_state", "inaccessible"
7687  }
7688}
7689~~~
7690
7691Example response:
7692
7693~~~json
7694{
7695  "jsonrpc": "2.0",
7696  "id": 1,
7697  "result": true
7698}
7699~~~
7700
7701### nvmf_subsystem_add_ns method {#rpc_nvmf_subsystem_add_ns}
7702
7703Add a namespace to a subsystem. The namespace ID is returned as the result.
7704
7705### Parameters
7706
7707Name                    | Optional | Type        | Description
7708----------------------- | -------- | ----------- | -----------
7709nqn                     | Required | string      | Subsystem NQN
7710namespace               | Required | object      | @ref rpc_nvmf_namespace object
7711tgt_name                | Optional | string      | Parent NVMe-oF target name.
7712
7713#### namespace {#rpc_nvmf_namespace}
7714
7715Name                    | Optional | Type        | Description
7716----------------------- | -------- | ----------- | -----------
7717nsid                    | Optional | number      | Namespace ID between 1 and 4294967294, inclusive. Default: Automatically assign NSID.
7718bdev_name               | Required | string      | Name of bdev to expose as a namespace.
7719nguid                   | Optional | string      | 16-byte namespace globally unique identifier in hexadecimal (e.g. "ABCDEF0123456789ABCDEF0123456789")
7720eui64                   | Optional | string      | 8-byte namespace EUI-64 in hexadecimal (e.g. "ABCDEF0123456789")
7721uuid                    | Optional | string      | RFC 4122 UUID (e.g. "ceccf520-691e-4b46-9546-34af789907c5")
7722ptpl_file               | Optional | string      | File path to save/restore persistent reservation information
7723anagrpid                | Optional | number      | ANA group ID. Default: Namespace ID.
7724
7725#### Example
7726
7727Example request:
7728
7729~~~json
7730{
7731  "jsonrpc": "2.0",
7732  "id": 1,
7733  "method": "nvmf_subsystem_add_ns",
7734  "params": {
7735    "nqn": "nqn.2016-06.io.spdk:cnode1",
7736    "namespace": {
7737      "nsid": 3,
7738      "bdev_name": "Nvme0n1",
7739      "ptpl_file": "/opt/Nvme0n1PR.json"
7740    }
7741  }
7742}
7743~~~
7744
7745Example response:
7746
7747~~~json
7748{
7749  "jsonrpc": "2.0",
7750  "id": 1,
7751  "result": 3
7752}
7753~~~
7754
7755### nvmf_subsystem_remove_ns method {#rpc_nvmf_subsystem_remove_ns}
7756
7757Remove a namespace from a subsystem.
7758
7759#### Parameters
7760
7761Name                    | Optional | Type        | Description
7762----------------------- | -------- | ----------- | -----------
7763nqn                     | Required | string      | Subsystem NQN
7764nsid                    | Required | number      | Namespace ID
7765tgt_name                | Optional | string      | Parent NVMe-oF target name.
7766
7767#### Example
7768
7769Example request:
7770
7771~~~json
7772{
7773  "jsonrpc": "2.0",
7774  "id": 1,
7775  "method": "nvmf_subsystem_remove_ns",
7776  "params": {
7777    "nqn": "nqn.2016-06.io.spdk:cnode1",
7778    "nsid": 1
7779  }
7780}
7781~~~
7782
7783Example response:
7784
7785~~~json
7786{
7787  "jsonrpc": "2.0",
7788  "id": 1,
7789  "result": true
7790}
7791~~~
7792
7793### nvmf_subsystem_add_host method {#rpc_nvmf_subsystem_add_host}
7794
7795Add a host NQN to the list of allowed hosts.
7796
7797#### Parameters
7798
7799Name                    | Optional | Type        | Description
7800----------------------- | -------- | ----------- | -----------
7801nqn                     | Required | string      | Subsystem NQN
7802host                    | Required | string      | Host NQN to add to the list of allowed host NQNs
7803tgt_name                | Optional | string      | Parent NVMe-oF target name.
7804
7805#### Example
7806
7807Example request:
7808
7809~~~json
7810{
7811  "jsonrpc": "2.0",
7812  "id": 1,
7813  "method": "nvmf_subsystem_add_host",
7814  "params": {
7815    "nqn": "nqn.2016-06.io.spdk:cnode1",
7816    "host": "nqn.2016-06.io.spdk:host1"
7817  }
7818}
7819~~~
7820
7821Example response:
7822
7823~~~json
7824{
7825  "jsonrpc": "2.0",
7826  "id": 1,
7827  "result": true
7828}
7829~~~
7830
7831### nvmf_subsystem_remove_host method {#rpc_nvmf_subsystem_remove_host}
7832
7833Remove a host NQN from the list of allowed hosts.
7834
7835#### Parameters
7836
7837Name                    | Optional | Type        | Description
7838----------------------- | -------- | ----------- | -----------
7839nqn                     | Required | string      | Subsystem NQN
7840host                    | Required | string      | Host NQN to remove from the list of allowed host NQNs
7841tgt_name                | Optional | string      | Parent NVMe-oF target name.
7842
7843#### Example
7844
7845Example request:
7846
7847~~~json
7848{
7849  "jsonrpc": "2.0",
7850  "id": 1,
7851  "method": "nvmf_subsystem_remove_host",
7852  "params": {
7853    "nqn": "nqn.2016-06.io.spdk:cnode1",
7854    "host": "nqn.2016-06.io.spdk:host1"
7855  }
7856}
7857~~~
7858
7859Example response:
7860
7861~~~json
7862{
7863  "jsonrpc": "2.0",
7864  "id": 1,
7865  "result": true
7866}
7867~~~
7868
7869### nvmf_subsystem_allow_any_host method {#rpc_nvmf_subsystem_allow_any_host}
7870
7871Configure a subsystem to allow any host to connect or to enforce the host NQN list.
7872
7873#### Parameters
7874
7875Name                    | Optional | Type        | Description
7876----------------------- | -------- | ----------- | -----------
7877nqn                     | Required | string      | Subsystem NQN
7878allow_any_host          | Required | boolean     | Allow any host (`true`) or enforce allowed host list (`false`).
7879tgt_name                | Optional | string      | Parent NVMe-oF target name.
7880
7881#### Example
7882
7883Example request:
7884
7885~~~json
7886{
7887  "jsonrpc": "2.0",
7888  "id": 1,
7889  "method": "nvmf_subsystem_allow_any_host",
7890  "params": {
7891    "nqn": "nqn.2016-06.io.spdk:cnode1",
7892    "allow_any_host": true
7893  }
7894}
7895~~~
7896
7897Example response:
7898
7899~~~json
7900{
7901  "jsonrpc": "2.0",
7902  "id": 1,
7903  "result": true
7904}
7905~~~
7906
7907### nvmf_subsystem_get_controllers {#rpc_nvmf_subsystem_get_controllers}
7908
7909#### Parameters
7910
7911Name                    | Optional | Type        | Description
7912----------------------- | -------- | ----------- | -----------
7913nqn                     | Required | string      | Subsystem NQN
7914tgt_name                | Optional | string      | Parent NVMe-oF target name.
7915
7916#### Example
7917
7918Example request:
7919
7920~~~json
7921{
7922  "jsonrpc": "2.0",
7923  "id": 1,
7924  "method": "nvmf_subsystem_get_controllers",
7925  "params": {
7926    "nqn": "nqn.2016-06.io.spdk:cnode1"
7927  }
7928}
7929~~~
7930
7931Example response:
7932
7933~~~json
7934{
7935  "jsonrpc": "2.0",
7936  "id": 1,
7937  "result": [
7938    {
7939      "cntlid": 1,
7940      "hostnqn": "nqn.2016-06.io.spdk:host1",
7941      "hostid": "27dad528-6368-41c3-82d3-0b956b49025d",
7942      "num_io_qpairs": 5
7943    }
7944  ]
7945}
7946~~~
7947
7948### nvmf_subsystem_get_qpairs {#rpc_nvmf_subsystem_get_qpairs}
7949
7950#### Parameters
7951
7952Name                    | Optional | Type        | Description
7953----------------------- | -------- | ----------- | -----------
7954nqn                     | Required | string      | Subsystem NQN
7955tgt_name                | Optional | string      | Parent NVMe-oF target name.
7956
7957#### Example
7958
7959Example request:
7960
7961~~~json
7962{
7963  "jsonrpc": "2.0",
7964  "id": 1,
7965  "method": "nvmf_subsystem_get_qpairs",
7966  "params": {
7967    "nqn": "nqn.2016-06.io.spdk:cnode1"
7968  }
7969}
7970~~~
7971
7972Example response:
7973
7974~~~json
7975{
7976  "jsonrpc": "2.0",
7977  "id": 1,
7978  "result": [
7979    {
7980      "cntlid": 1,
7981      "qid": 0,
7982      "state": "active",
7983      "listen_address": {
7984        "trtype": "RDMA",
7985        "adrfam": "IPv4",
7986        "traddr": "192.168.0.123",
7987        "trsvcid": "4420"
7988      }
7989    },
7990    {
7991      "cntlid": 1,
7992      "qid": 1,
7993      "state": "active",
7994      "listen_address": {
7995        "trtype": "RDMA",
7996        "adrfam": "IPv4",
7997        "traddr": "192.168.0.123",
7998        "trsvcid": "4420"
7999      }
8000    }
8001  ]
8002}
8003~~~
8004
8005### nvmf_subsystem_get_listeners {#rpc_nvmf_subsystem_get_listeners}
8006
8007#### Parameters
8008
8009Name                    | Optional | Type        | Description
8010----------------------- | -------- | ----------- | -----------
8011nqn                     | Required | string      | Subsystem NQN
8012tgt_name                | Optional | string      | Parent NVMe-oF target name.
8013
8014#### Example
8015
8016Example request:
8017
8018~~~json
8019{
8020  "jsonrpc": "2.0",
8021  "id": 1,
8022  "method": "nvmf_subsystem_get_listeners",
8023  "params": {
8024    "nqn": "nqn.2016-06.io.spdk:cnode1"
8025  }
8026}
8027~~~
8028
8029Example response:
8030
8031~~~json
8032{
8033  "jsonrpc": "2.0",
8034  "id": 1,
8035  "result": [
8036    {
8037      "address": {
8038        "trtype": "RDMA",
8039        "adrfam": "IPv4",
8040        "traddr": "192.168.0.123",
8041        "trsvcid": "4420"
8042      },
8043      "ana_state": "optimized"
8044    }
8045  ]
8046}
8047~~~
8048
8049### nvmf_set_max_subsystems {#rpc_nvmf_set_max_subsystems}
8050
8051Set the maximum allowed subsystems for the NVMe-oF target.  This RPC may only be called
8052before SPDK subsystems have been initialized.
8053
8054#### Parameters
8055
8056Name                    | Optional | Type        | Description
8057----------------------- | -------- | ----------- | -----------
8058max_subsystems          | Required | number      | Maximum number of NVMe-oF subsystems
8059
8060#### Example
8061
8062Example request:
8063
8064~~~json
8065{
8066  "jsonrpc": "2.0",
8067  "id": 1,
8068  "method": "nvmf_set_max_subsystems",
8069  "params": {
8070    "max_subsystems": 1024
8071  }
8072}
8073~~~
8074
8075Example response:
8076
8077~~~json
8078{
8079  "jsonrpc": "2.0",
8080  "id": 1,
8081  "result": true
8082}
8083~~~
8084
8085### nvmf_set_config {#rpc_nvmf_set_config}
8086
8087Set global configuration of NVMe-oF target.  This RPC may only be called before SPDK subsystems
8088have been initialized.
8089
8090#### Parameters
8091
8092Name                    | Optional | Type        | Description
8093----------------------- | -------- | ----------- | -----------
8094acceptor_poll_rate      | Optional | number      | Polling interval of the acceptor for incoming connections (microseconds)
8095admin_cmd_passthru      | Optional | object      | Admin command passthru configuration
8096poll_groups_mask        | Optional | string      | Set cpumask for NVMf poll groups
8097discovery_filter        | Optional | string      | Set discovery filter, possible values are: `match_any` (default) or comma separated values: `transport`, `address`, `svcid`
8098
8099#### admin_cmd_passthru {#spdk_nvmf_admin_passthru_conf}
8100
8101Name                    | Optional | Type        | Description
8102----------------------- | -------- | ----------- | -----------
8103identify_ctrlr          | Required | bool        | If true, enables custom identify handler that reports some identify attributes from the underlying NVMe drive
8104
8105#### Example
8106
8107Example request:
8108
8109~~~json
8110{
8111  "jsonrpc": "2.0",
8112  "id": 1,
8113  "method": "nvmf_set_config",
8114  "params": {
8115    "acceptor_poll_rate": 10000
8116  }
8117}
8118~~~
8119
8120Example response:
8121
8122~~~json
8123{
8124  "jsonrpc": "2.0",
8125  "id": 1,
8126  "result": true
8127}
8128~~~
8129
8130### nvmf_get_transports method {#rpc_nvmf_get_transports}
8131
8132#### Parameters
8133
8134The user may specify no parameters in order to list all transports, or a transport may be
8135specified by type.
8136
8137Name                        | Optional | Type        | Description
8138--------------------------- | -------- | ------------| -----------
8139tgt_name                    | Optional | string      | Parent NVMe-oF target name.
8140trtype                      | Optional | string      | Transport type.
8141
8142#### Example
8143
8144Example request:
8145
8146~~~json
8147{
8148  "jsonrpc": "2.0",
8149  "id": 1,
8150  "method": "nvmf_get_transports"
8151}
8152~~~
8153
8154Example response:
8155
8156~~~json
8157{
8158  "jsonrpc": "2.0",
8159  "id": 1,
8160  "result": [
8161    {
8162      "type": "RDMA".
8163      "max_queue_depth": 128,
8164      "max_io_qpairs_per_ctrlr": 64,
8165      "in_capsule_data_size": 4096,
8166      "max_io_size": 131072,
8167      "io_unit_size": 131072,
8168      "abort_timeout_sec": 1
8169    }
8170  ]
8171}
8172~~~
8173
8174### nvmf_get_stats method {#rpc_nvmf_get_stats}
8175
8176Retrieve current statistics of the NVMf subsystem.
8177
8178#### Parameters
8179
8180Name                        | Optional | Type        | Description
8181--------------------------- | -------- | ------------| -----------
8182tgt_name                    | Optional | string      | Parent NVMe-oF target name.
8183
8184#### Response
8185
8186The response is an object containing NVMf subsystem statistics.
8187In the response, `admin_qpairs` and `io_qpairs` are reflecting cumulative queue pair counts while
8188`current_admin_qpairs` and `current_io_qpairs` are showing the current number.
8189
8190#### Example
8191
8192Example request:
8193
8194~~~json
8195{
8196  "jsonrpc": "2.0",
8197  "method": "nvmf_get_stats",
8198  "id": 1
8199}
8200~~~
8201
8202Example response:
8203
8204~~~json
8205{
8206  "jsonrpc": "2.0",
8207  "id": 1,
8208  "result": {
8209    "tick_rate": 2400000000,
8210    "poll_groups": [
8211      {
8212        "name": "app_thread",
8213        "admin_qpairs": 1,
8214        "io_qpairs": 4,
8215        "current_admin_qpairs": 1,
8216        "current_io_qpairs": 2,
8217        "pending_bdev_io": 1721,
8218        "transports": [
8219          {
8220            "trtype": "RDMA",
8221            "pending_data_buffer": 12131888,
8222            "devices": [
8223              {
8224                "name": "mlx5_1",
8225                "polls": 72284105,
8226                "completions": 0,
8227                "requests": 0,
8228                "request_latency": 0,
8229                "pending_free_request": 0,
8230                "pending_rdma_read": 0,
8231                "pending_rdma_write": 0,
8232                "total_send_wrs": 0,
8233                "send_doorbell_updates": 0,
8234                "total_recv_wrs": 0,
8235                "recv_doorbell_updates": 1
8236              },
8237              {
8238                "name": "mlx5_0",
8239                "polls": 72284105,
8240                "completions": 15165875,
8241                "requests": 7582935,
8242                "request_latency": 1249323766184,
8243                "pending_free_request": 0,
8244                "pending_rdma_read": 337602,
8245                "pending_rdma_write": 0,
8246                "total_send_wrs": 15165875,
8247                "send_doorbell_updates": 1516587,
8248                "total_recv_wrs": 15165875,
8249                "recv_doorbell_updates": 1516587
8250              }
8251            ]
8252          }
8253        ]
8254      }
8255    ]
8256  }
8257}
8258~~~
8259
8260### nvmf_set_crdt {#rpc_nvmf_set_crdt}
8261
8262Set the 3 CRDT (Command Retry Delay Time) values. For details about
8263CRDT, please refer to the NVMe specification. Currently all the
8264SPDK nvmf subsystems share the same CRDT values. The default values
8265are 0. This rpc can only be invoked in STARTUP stage. All values are
8266in units of 100 milliseconds (same as the NVMe specification).
8267
8268#### Parameters
8269
8270Name                    | Optional | Type        | Description
8271----------------------- | -------- | ----------- | -----------
8272crdt1                   | Optional | number      | Command Retry Delay Time 1
8273crdt2                   | Optional | number      | Command Retry Delay Time 2
8274crdt3                   | Optional | number      | Command Retry Delay Time 3
8275
8276## Vfio-user Target
8277
8278### vfu_tgt_set_base_path {#rpc_vfu_tgt_set_base_path}
8279
8280Set base path of Unix Domain socket file.
8281
8282#### Parameters
8283
8284Name                    | Optional | Type        | Description
8285----------------------- | -------- | ----------- | -----------
8286path                    | Required | string      | Base path
8287
8288#### Example
8289
8290Example request:
8291
8292~~~json
8293{
8294  "params": {
8295    "path": "/var/run/vfu_tgt"
8296  },
8297  "jsonrpc": "2.0",
8298  "method": "vfu_tgt_set_base_path",
8299  "id": 1
8300}
8301~~~
8302
8303Example response:
8304
8305~~~json
8306{
8307  "jsonrpc": "2.0",
8308  "id": 1,
8309  "result": true
8310}
8311~~~
8312
8313### vfu_virtio_delete_endpoint {#rpc_vfu_virtio_delete_endpoint}
8314
8315Delete PCI device via endpoint name.
8316
8317#### Parameters
8318
8319Name                    | Optional | Type        | Description
8320----------------------- | -------- | ----------- | -----------
8321name                    | Required | string      | Endpoint name
8322
8323#### Example
8324
8325Example request:
8326
8327~~~json
8328{
8329  "params": {
8330    "name": "vfu.0"
8331  },
8332  "jsonrpc": "2.0",
8333  "method": "vfu_virtio_delete_endpoint",
8334  "id": 1
8335}
8336~~~
8337
8338Example response:
8339
8340~~~json
8341{
8342  "jsonrpc": "2.0",
8343  "id": 1,
8344  "result": true
8345}
8346~~~
8347
8348### vfu_virtio_create_blk_endpoint {#rpc_vfu_virtio_create_blk_endpoint}
8349
8350Create vfio-user virtio-blk PCI endpoint.
8351
8352#### Parameters
8353
8354Name                    | Optional | Type        | Description
8355----------------------- | -------- | ----------- | -----------
8356name                    | Required | string      | Endpoint name
8357bdev_name               | Required | string      | Block device name
8358cpumask                 | Optional | string      | CPU masks
8359num_queues              | Optional | number      | Number of queues
8360qsize                   | Optional | number      | Queue size
8361packed_ring             | Optional | boolean     | Enable packed ring
8362
8363#### Example
8364
8365Example request:
8366
8367~~~json
8368{
8369  "params": {
8370    "name": "vfu.0",
8371    "bdev_name": "Malloc0",
8372    "cpumask": "0x2",
8373    "num_queues": 4,
8374    "qsize": 256
8375  },
8376  "jsonrpc": "2.0",
8377  "method": "vfu_virtio_create_blk_endpoint",
8378  "id": 1
8379}
8380~~~
8381
8382Example response:
8383
8384~~~json
8385{
8386  "jsonrpc": "2.0",
8387  "id": 1,
8388  "result": true
8389}
8390~~~
8391
8392### vfu_virtio_scsi_add_target {#rpc_vfu_virtio_scsi_add_target}
8393
8394Add block device to specified SCSI target of vfio-user virtio-scsi PCI endpoint.
8395
8396#### Parameters
8397
8398Name                    | Optional | Type        | Description
8399----------------------- | -------- | ----------- | -----------
8400name                    | Required | string      | Endpoint name
8401scsi_target_num         | Required | number      | SCSI target number
8402bdev_name               | Required | string      | Block device name
8403
8404#### Example
8405
8406Example request:
8407
8408~~~json
8409{
8410  "params": {
8411    "name": "vfu.0",
8412    "scsi_target_num": 0,
8413    "bdev_name": "Malloc0"
8414  },
8415  "jsonrpc": "2.0",
8416  "method": "vfu_virtio_scsi_add_target",
8417  "id": 1
8418}
8419~~~
8420
8421Example response:
8422
8423~~~json
8424{
8425  "jsonrpc": "2.0",
8426  "id": 1,
8427  "result": true
8428}
8429~~~
8430
8431### vfu_virtio_scsi_remove_target {#rpc_vfu_virtio_scsi_remove_target}
8432
8433Remove a SCSI target of vfio-user virtio-scsi PCI endpoint.
8434
8435#### Parameters
8436
8437Name                    | Optional | Type        | Description
8438----------------------- | -------- | ----------- | -----------
8439name                    | Required | string      | Endpoint name
8440scsi_target_num         | Required | number      | SCSI target number
8441
8442#### Example
8443
8444Example request:
8445
8446~~~json
8447{
8448  "params": {
8449    "name": "vfu.0",
8450    "scsi_target_num": 0
8451  },
8452  "jsonrpc": "2.0",
8453  "method": "vfu_virtio_scsi_remove_target",
8454  "id": 1
8455}
8456~~~
8457
8458Example response:
8459
8460~~~json
8461{
8462  "jsonrpc": "2.0",
8463  "id": 1,
8464  "result": true
8465}
8466~~~
8467
8468### vfu_virtio_create_scsi_endpoint {#rpc_vfu_virtio_create_scsi_endpoint}
8469
8470Create vfio-user virtio-scsi PCI endpoint.
8471
8472#### Parameters
8473
8474Name                    | Optional | Type        | Description
8475----------------------- | -------- | ----------- | -----------
8476name                    | Required | string      | Endpoint name
8477cpumask                 | Optional | string      | CPU masks
8478num_io_queues           | Optional | number      | Number of IO queues
8479qsize                   | Optional | number      | Queue size
8480packed_ring             | Optional | boolean     | Enable packed ring
8481
8482#### Example
8483
8484Example request:
8485
8486~~~json
8487{
8488  "params": {
8489    "name": "vfu.0",
8490    "cpumask": "0x2",
8491    "num_io_queues": 4,
8492    "qsize": 256
8493  },
8494  "jsonrpc": "2.0",
8495  "method": "vfu_virtio_create_scsi_endpoint",
8496  "id": 1
8497}
8498~~~
8499
8500Example response:
8501
8502~~~json
8503{
8504  "jsonrpc": "2.0",
8505  "id": 1,
8506  "result": true
8507}
8508~~~
8509
8510## Vhost Target {#jsonrpc_components_vhost_tgt}
8511
8512The following common preconditions need to be met in all target types.
8513
8514Controller name will be used to create UNIX domain socket. This implies that name concatenated with vhost socket
8515directory path needs to be valid UNIX socket name.
8516
8517@ref cpu_mask parameter is used to choose CPU on which pollers will be launched when new initiator is connecting.
8518It must be a subset of application CPU mask. Default value is CPU mask of the application.
8519
8520### vhost_controller_set_coalescing {#rpc_vhost_controller_set_coalescing}
8521
8522Controls interrupt coalescing for specific target. Because `delay_base_us` is used to calculate delay in CPU ticks
8523there is no hardcoded limit for this parameter. Only limitation is that final delay in CPU ticks might not overflow
852432 bit unsigned integer (which is more than 1s @ 4GHz CPU). In real scenarios `delay_base_us` should be much lower
8525than 150us. To disable coalescing set `delay_base_us` to 0.
8526
8527#### Parameters
8528
8529Name                    | Optional | Type        | Description
8530----------------------- | -------- | ----------- | -----------
8531ctrlr                   | Required | string      | Controller name
8532delay_base_us           | Required | number      | Base (minimum) coalescing time in microseconds
8533iops_threshold          | Required | number      | Coalescing activation level greater than 0 in IO per second
8534
8535#### Example
8536
8537Example request:
8538
8539~~~json
8540{
8541  "params": {
8542    "iops_threshold": 100000,
8543    "ctrlr": "VhostScsi0",
8544    "delay_base_us": 80
8545  },
8546  "jsonrpc": "2.0",
8547  "method": "vhost_controller_set_coalescing",
8548  "id": 1
8549}
8550~~~
8551
8552Example response:
8553
8554~~~json
8555{
8556  "jsonrpc": "2.0",
8557  "id": 1,
8558  "result": true
8559}
8560~~~
8561
8562### vhost_create_scsi_controller {#rpc_vhost_create_scsi_controller}
8563
8564Construct vhost SCSI target.
8565
8566#### Parameters
8567
8568Name                    | Optional | Type        | Description
8569----------------------- | -------- | ----------- | -----------
8570ctrlr                   | Required | string      | Controller name
8571cpumask                 | Optional | string      | @ref cpu_mask for this controller
8572
8573#### Example
8574
8575Example request:
8576
8577~~~json
8578{
8579  "params": {
8580    "cpumask": "0x2",
8581    "ctrlr": "VhostScsi0"
8582  },
8583  "jsonrpc": "2.0",
8584  "method": "vhost_create_scsi_controller",
8585  "id": 1
8586}
8587~~~
8588
8589Example response:
8590
8591~~~json
8592{
8593  "jsonrpc": "2.0",
8594  "id": 1,
8595  "result": true
8596}
8597~~~
8598
8599### vhost_scsi_controller_add_target {#rpc_vhost_scsi_controller_add_target}
8600
8601In vhost target `ctrlr` create SCSI target with ID `scsi_target_num` and add `bdev_name` as LUN 0.
8602
8603#### Parameters
8604
8605Name                    | Optional | Type        | Description
8606----------------------- | -------- | ----------- | -----------
8607ctrlr                   | Required | string      | Controller name
8608scsi_target_num         | Required | number      | SCSI target ID between 0 and 7 or -1 to use first free ID.
8609bdev_name               | Required | string      | Name of bdev to expose as a LUN 0
8610
8611#### Response
8612
8613SCSI target ID.
8614
8615#### Example
8616
8617Example request:
8618
8619~~~json
8620{
8621  "params": {
8622    "scsi_target_num": 1,
8623    "bdev_name": "Malloc0",
8624    "ctrlr": "VhostScsi0"
8625  },
8626  "jsonrpc": "2.0",
8627  "method": "vhost_scsi_controller_add_target",
8628  "id": 1
8629}
8630~~~
8631
8632Example response:
8633
8634~~~json
8635response:
8636{
8637  "jsonrpc": "2.0",
8638  "id": 1,
8639  "result": 1
8640}
8641~~~
8642
8643### vhost_scsi_controller_remove_target {#rpc_vhost_scsi_controller_remove_target}
8644
8645Remove SCSI target ID `scsi_target_num` from vhost target `scsi_target_num`.
8646
8647This method will fail if initiator is connected, but doesn't support hot-remove (the `VIRTIO_SCSI_F_HOTPLUG` is not negotiated).
8648
8649#### Parameters
8650
8651Name                    | Optional | Type        | Description
8652----------------------- | -------- | ----------- | -----------
8653ctrlr                   | Required | string      | Controller name
8654scsi_target_num         | Required | number      | SCSI target ID between 0 and 7
8655
8656#### Example
8657
8658Example request:
8659
8660~~~json
8661request:
8662{
8663  "params": {
8664    "scsi_target_num": 1,
8665    "ctrlr": "VhostScsi0"
8666  },
8667  "jsonrpc": "2.0",
8668  "method": "vhost_scsi_controller_remove_target",
8669  "id": 1
8670}
8671~~~
8672
8673Example response:
8674
8675~~~json
8676{
8677  "jsonrpc": "2.0",
8678  "id": 1,
8679  "result": true
8680}
8681~~~
8682
8683### virtio_blk_create_transport {#rpc_virtio_blk_create_transport}
8684
8685Create virtio blk transport.
8686
8687#### Parameters
8688
8689Name                    | Optional | Type        | Description
8690----------------------- | -------- | ----------- | -----------
8691name                    | Required | string      | Transport name
8692
8693#### Example
8694
8695Example request:
8696
8697~~~json
8698{
8699  "params": {
8700    "name": "vhost_user_blk"
8701  },
8702  "jsonrpc": "2.0",
8703  "method": "virtio_blk_create_transport",
8704  "id": 1
8705}
8706~~~
8707
8708Example response:
8709
8710~~~json
8711{
8712  "jsonrpc": "2.0",
8713  "id": 1,
8714  "result": true
8715}
8716~~~
8717
8718### vhost_create_blk_controller {#rpc_vhost_create_blk_controller}
8719
8720Create vhost block controller
8721
8722If `readonly` is `true` then vhost block target will be created as read only and fail any write requests.
8723The `VIRTIO_BLK_F_RO` feature flag will be offered to the initiator.
8724
8725#### Parameters
8726
8727Name                    | Optional | Type        | Description
8728----------------------- | -------- | ----------- | -----------
8729ctrlr                   | Required | string      | Controller name
8730bdev_name               | Required | string      | Name of bdev to expose block device
8731readonly                | Optional | boolean     | If true, this target will be read only (default: false)
8732cpumask                 | Optional | string      | @ref cpu_mask for this controller
8733transport               | Optional | string      | virtio blk transport name (default: vhost_user_blk)
8734
8735#### Example
8736
8737Example request:
8738
8739~~~json
8740{
8741  "params": {
8742    "dev_name": "Malloc0",
8743    "ctrlr": "VhostBlk0"
8744  },
8745  "jsonrpc": "2.0",
8746  "method": "vhost_create_blk_controller",
8747  "id": 1
8748}
8749~~~
8750
8751Example response:
8752
8753~~~json
8754{
8755  "jsonrpc": "2.0",
8756  "id": 1,
8757  "result": true
8758}
8759~~~
8760
8761### vhost_get_controllers {#rpc_vhost_get_controllers}
8762
8763Display information about all or specific vhost controller(s).
8764
8765#### Parameters
8766
8767The user may specify no parameters in order to list all controllers, or a controller may be
8768specified by name.
8769
8770Name                    | Optional | Type        | Description
8771----------------------- | -------- | ----------- | -----------
8772name                    | Optional | string      | Vhost controller name
8773
8774#### Response {#rpc_vhost_get_controllers_response}
8775
8776Response is an array of objects describing requested controller(s). Common fields are:
8777
8778Name                    | Type        | Description
8779----------------------- | ----------- | -----------
8780ctrlr                   | string      | Controller name
8781cpumask                 | string      | @ref cpu_mask of this controller
8782delay_base_us           | number      | Base (minimum) coalescing time in microseconds (0 if disabled)
8783iops_threshold          | number      | Coalescing activation level
8784backend_specific        | object      | Backend specific informations
8785
8786### Vhost block {#rpc_vhost_get_controllers_blk}
8787
8788`backend_specific` contains one `block` object  of type:
8789
8790Name                    | Type        | Description
8791----------------------- | ----------- | -----------
8792bdev                    | string      | Backing bdev name or Null if bdev is hot-removed
8793readonly                | boolean     | True if controllers is readonly, false otherwise
8794
8795### Vhost SCSI {#rpc_vhost_get_controllers_scsi}
8796
8797`backend_specific` contains `scsi` array of following objects:
8798
8799Name                    | Type        | Description
8800----------------------- | ----------- | -----------
8801target_name             | string      | Name of this SCSI target
8802id                      | number      | Unique SPDK global SCSI target ID
8803scsi_dev_num            | number      | SCSI target ID initiator will see when scanning this controller
8804luns                    | array       | array of objects describing @ref rpc_vhost_get_controllers_scsi_luns
8805
8806### Vhost SCSI LUN {#rpc_vhost_get_controllers_scsi_luns}
8807
8808Object of type:
8809
8810Name                    | Type        | Description
8811----------------------- | ----------- | -----------
8812id                      | number      | SCSI LUN ID
8813bdev_name               | string      | Backing bdev name
8814
8815### Vhost NVMe {#rpc_vhost_get_controllers_nvme}
8816
8817`backend_specific` contains `namespaces` array of following objects:
8818
8819Name                    | Type        | Description
8820----------------------- | ----------- | -----------
8821nsid                    | number      | Namespace ID
8822bdev                    | string      | Backing bdev name
8823
8824#### Example
8825
8826Example request:
8827
8828~~~json
8829{
8830  "jsonrpc": "2.0",
8831  "method": "vhost_get_controllers",
8832  "id": 1
8833}
8834~~~
8835
8836Example response:
8837
8838~~~json
8839{
8840  "jsonrpc": "2.0",
8841  "id": 1,
8842  "result": [
8843    {
8844      "cpumask": "0x2",
8845      "backend_specific": {
8846        "block": {
8847          "readonly": false,
8848          "bdev": "Malloc0"
8849        }
8850      },
8851      "iops_threshold": 60000,
8852      "ctrlr": "VhostBlk0",
8853      "delay_base_us": 100
8854    },
8855    {
8856      "cpumask": "0x2",
8857      "backend_specific": {
8858        "scsi": [
8859          {
8860            "target_name": "Target 2",
8861            "luns": [
8862              {
8863                "id": 0,
8864                "bdev_name": "Malloc1"
8865              }
8866            ],
8867            "id": 0,
8868            "scsi_dev_num": 2
8869          },
8870          {
8871            "target_name": "Target 5",
8872            "luns": [
8873              {
8874                "id": 0,
8875                "bdev_name": "Malloc2"
8876              }
8877            ],
8878            "id": 1,
8879            "scsi_dev_num": 5
8880          }
8881        ]
8882      },
8883      "iops_threshold": 60000,
8884      "ctrlr": "VhostScsi0",
8885      "delay_base_us": 0
8886    },
8887    {
8888      "cpumask": "0x2",
8889      "backend_specific": {
8890        "namespaces": [
8891          {
8892            "bdev": "Malloc3",
8893            "nsid": 1
8894          },
8895          {
8896            "bdev": "Malloc4",
8897            "nsid": 2
8898          }
8899        ]
8900      },
8901      "iops_threshold": 60000,
8902      "ctrlr": "VhostNvme0",
8903      "delay_base_us": 0
8904    }
8905  ]
8906}
8907~~~
8908
8909### vhost_delete_controller {#rpc_vhost_delete_controller}
8910
8911Remove vhost target.
8912
8913This call will fail if there is an initiator connected or there is at least one SCSI target configured in case of
8914vhost SCSI target. In the later case please remove all SCSI targets first using @ref rpc_vhost_scsi_controller_remove_target.
8915
8916#### Parameters
8917
8918Name                    | Optional | Type        | Description
8919----------------------- | -------- | ----------- | -----------
8920ctrlr                   | Required | string      | Controller name
8921
8922#### Example
8923
8924Example request:
8925
8926~~~json
8927{
8928  "params": {
8929    "ctrlr": "VhostNvme0"
8930  },
8931  "jsonrpc": "2.0",
8932  "method": "vhost_delete_controller",
8933  "id": 1
8934}
8935~~~
8936
8937Example response:
8938
8939~~~json
8940{
8941  "jsonrpc": "2.0",
8942  "id": 1,
8943  "result": true
8944}
8945~~~
8946
8947## Logical Volume {#jsonrpc_components_lvol}
8948
8949Identification of logical volume store and logical volume is explained first.
8950
8951A logical volume store has a UUID and a name for its identification.
8952The UUID is generated on creation and it can be used as a unique identifier.
8953The name is specified on creation and can be renamed.
8954Either UUID or name is used to access logical volume store in RPCs.
8955
8956A logical volume has a UUID and a name for its identification.
8957The UUID of the logical volume is generated on creation and it can be unique identifier.
8958The alias of the logical volume takes the format _lvs_name/lvol_name_ where:
8959
8960* _lvs_name_ is the name of the logical volume store.
8961* _lvol_name_ is specified on creation and can be renamed.
8962
8963### bdev_lvol_create_lvstore {#rpc_bdev_lvol_create_lvstore}
8964
8965Construct a logical volume store.
8966
8967#### Parameters
8968
8969Name                          | Optional | Type        | Description
8970----------------------------- | -------- | ----------- | -----------
8971bdev_name                     | Required | string      | Bdev on which to construct logical volume store
8972lvs_name                      | Required | string      | Name of the logical volume store to create
8973cluster_sz                    | Optional | number      | Cluster size of the logical volume store in bytes (Default: 4MiB)
8974clear_method                  | Optional | string      | Change clear method for data region. Available: none, unmap (default), write_zeroes
8975num_md_pages_per_cluster_ratio| Optional | number      | Reserved metadata pages per cluster (Default: 100)
8976
8977The num_md_pages_per_cluster_ratio defines the amount of metadata to
8978allocate when the logical volume store is created. The default value
8979is '100', which translates to 1 4KiB per cluster. For the default 4MiB
8980cluster size, this equates to about 0.1% of the underlying block
8981device allocated for metadata. Logical volume stores can be grown, if
8982the size of the underlying block device grows in the future, but only
8983if enough metadata pages were allocated to support the growth. So
8984num_md_pages_per_cluster_ratio should be set to a higher value if
8985wanting to support future growth. For example,
8986num_md_pages_per_cluster_ratio = 200 would support future 2x growth of
8987the logical volume store, and would result in 0.2% of the underlying
8988block device allocated for metadata (with a default 4MiB cluster
8989size).
8990
8991#### Response
8992
8993UUID of the created logical volume store is returned.
8994
8995#### Example
8996
8997Example request:
8998
8999~~~json
9000{
9001  "jsonrpc": "2.0",
9002  "id": 1,
9003  "method": "bdev_lvol_create_lvstore",
9004  "params": {
9005    "lvs_name": "LVS0",
9006    "bdev_name": "Malloc0"
9007    "clear_method": "write_zeroes"
9008  }
9009}
9010~~~
9011
9012Example response:
9013
9014~~~json
9015{
9016  "jsonrpc": "2.0",
9017  "id": 1,
9018  "result": "a9959197-b5e2-4f2d-8095-251ffb6985a5"
9019}
9020~~~
9021
9022### bdev_lvol_delete_lvstore {#rpc_bdev_lvol_delete_lvstore}
9023
9024Destroy a logical volume store.
9025
9026#### Parameters
9027
9028Name                    | Optional | Type        | Description
9029----------------------- | -------- | ----------- | -----------
9030uuid                    | Optional | string      | UUID of the logical volume store to destroy
9031lvs_name                | Optional | string      | Name of the logical volume store to destroy
9032
9033Either uuid or lvs_name must be specified, but not both.
9034
9035#### Example
9036
9037Example request:
9038
9039~~~json
9040{
9041  "jsonrpc": "2.0",
9042  "method": "bdev_lvol_delete_lvstore",
9043  "id": 1
9044  "params": {
9045    "uuid": "a9959197-b5e2-4f2d-8095-251ffb6985a5"
9046  }
9047}
9048~~~
9049
9050Example response:
9051
9052~~~json
9053{
9054  "jsonrpc": "2.0",
9055  "id": 1,
9056  "result": true
9057}
9058~~~
9059
9060### bdev_lvol_get_lvstores {#rpc_bdev_lvol_get_lvstores}
9061
9062Get a list of logical volume stores.
9063
9064#### Parameters
9065
9066Name                    | Optional | Type        | Description
9067----------------------- | -------- | ----------- | -----------
9068uuid                    | Optional | string      | UUID of the logical volume store to retrieve information about
9069lvs_name                | Optional | string      | Name of the logical volume store to retrieve information about
9070
9071Either uuid or lvs_name may be specified, but not both.
9072If both uuid and lvs_name are omitted, information about all logical volume stores is returned.
9073
9074#### Example
9075
9076Example request:
9077
9078~~~json
9079{
9080  "jsonrpc": "2.0",
9081  "method": "bdev_lvol_get_lvstores",
9082  "id": 1,
9083  "params": {
9084    "lvs_name": "LVS0"
9085  }
9086}
9087~~~
9088
9089Example response:
9090
9091~~~json
9092{
9093  "jsonrpc": "2.0",
9094  "id": 1,
9095  "result": [
9096    {
9097      "uuid": "a9959197-b5e2-4f2d-8095-251ffb6985a5",
9098      "base_bdev": "Malloc0",
9099      "free_clusters": 31,
9100      "cluster_size": 4194304,
9101      "total_data_clusters": 31,
9102      "block_size": 4096,
9103      "name": "LVS0"
9104    }
9105  ]
9106}
9107~~~
9108
9109### bdev_lvol_rename_lvstore {#rpc_bdev_lvol_rename_lvstore}
9110
9111Rename a logical volume store.
9112
9113#### Parameters
9114
9115Name                    | Optional | Type        | Description
9116----------------------- | -------- | ----------- | -----------
9117old_name                | Required | string      | Existing logical volume store name
9118new_name                | Required | string      | New logical volume store name
9119
9120#### Example
9121
9122Example request:
9123
9124~~~json
9125{
9126  "jsonrpc": "2.0",
9127  "method": "bdev_lvol_rename_lvstore",
9128  "id": 1,
9129  "params": {
9130    "old_name": "LVS0",
9131    "new_name": "LVS2"
9132  }
9133}
9134~~~
9135
9136Example response:
9137
9138~~~json
9139{
9140  "jsonrpc": "2.0",
9141  "id": 1,
9142  "result": true
9143}
9144~~~
9145
9146### bdev_lvol_grow_lvstore {#rpc_bdev_lvol_grow_lvstore}
9147
9148Grow the logical volume store to fill the underlying bdev
9149
9150#### Parameters
9151
9152Name                    | Optional | Type        | Description
9153----------------------- | -------- | ----------- | -----------
9154uuid                    | Optional | string      | UUID of the logical volume store to grow
9155lvs_name                | Optional | string      | Name of the logical volume store to grow
9156
9157Either uuid or lvs_name must be specified, but not both.
9158
9159#### Example
9160
9161Example request:
9162
9163~~~json
9164{
9165  "jsonrpc": "2.0",
9166  "method": "bdev_lvol_grow_lvstore",
9167  "id": 1
9168  "params": {
9169    "uuid": "a9959197-b5e2-4f2d-8095-251ffb6985a5"
9170  }
9171}
9172~~~
9173
9174Example response:
9175
9176~~~json
9177{
9178  "jsonrpc": "2.0",
9179  "id": 1,
9180  "result": true
9181}
9182~~~
9183
9184### bdev_lvol_create {#rpc_bdev_lvol_create}
9185
9186Create a logical volume on a logical volume store.
9187
9188#### Parameters
9189
9190Name                    | Optional | Type        | Description
9191----------------------- | -------- | ----------- | -----------
9192lvol_name               | Required | string      | Name of logical volume to create
9193size                    | Required | number      | Desired size of logical volume in bytes
9194thin_provision          | Optional | boolean     | True to enable thin provisioning
9195uuid                    | Optional | string      | UUID of logical volume store to create logical volume on
9196lvs_name                | Optional | string      | Name of logical volume store to create logical volume on
9197clear_method            | Optional | string      | Change default data clusters clear method. Available: none, unmap, write_zeroes
9198
9199Size will be rounded up to a multiple of cluster size. Either uuid or lvs_name must be specified, but not both.
9200lvol_name will be used in the alias of the created logical volume.
9201
9202#### Response
9203
9204UUID of the created logical volume is returned.
9205
9206#### Example
9207
9208Example request:
9209
9210~~~json
9211{
9212  "jsonrpc": "2.0",
9213  "method": "bdev_lvol_create",
9214  "id": 1,
9215  "params": {
9216    "lvol_name": "LVOL0",
9217    "size": 1048576,
9218    "lvs_name": "LVS0",
9219    "clear_method": "unmap",
9220    "thin_provision": true
9221  }
9222}
9223~~~
9224
9225Example response:
9226
9227~~~json
9228{
9229  "jsonrpc": "2.0",
9230  "id": 1,
9231  "result": "1b38702c-7f0c-411e-a962-92c6a5a8a602"
9232}
9233~~~
9234
9235### bdev_lvol_snapshot {#rpc_bdev_lvol_snapshot}
9236
9237Capture a snapshot of the current state of a logical volume.
9238
9239#### Parameters
9240
9241Name                    | Optional | Type        | Description
9242----------------------- | -------- | ----------- | -----------
9243lvol_name               | Required | string      | UUID or alias of the logical volume to create a snapshot from
9244snapshot_name           | Required | string      | Name for the newly created snapshot
9245
9246#### Response
9247
9248UUID of the created logical volume snapshot is returned.
9249
9250#### Example
9251
9252Example request:
9253
9254~~~json
9255{
9256  "jsonrpc": "2.0",
9257  "method": "bdev_lvol_snapshot",
9258  "id": 1,
9259  "params": {
9260    "lvol_name": "1b38702c-7f0c-411e-a962-92c6a5a8a602",
9261    "snapshot_name": "SNAP1"
9262  }
9263}
9264~~~
9265
9266Example response:
9267
9268~~~json
9269{
9270  "jsonrpc": "2.0",
9271  "id": 1,
9272  "result": "cc8d7fdf-7865-4d1f-9fc6-35da8e368670"
9273}
9274~~~
9275
9276### bdev_lvol_clone {#rpc_bdev_lvol_clone}
9277
9278Create a logical volume based on a snapshot.
9279
9280#### Parameters
9281
9282Name                    | Optional | Type        | Description
9283----------------------- | -------- | ----------- | -----------
9284snapshot_name           | Required | string      | UUID or alias of the snapshot to clone
9285clone_name              | Required | string      | Name for the logical volume to create
9286
9287#### Response
9288
9289UUID of the created logical volume clone is returned.
9290
9291#### Example
9292
9293Example request:
9294
9295~~~json
9296{
9297  "jsonrpc": "2.0"
9298  "method": "bdev_lvol_clone",
9299  "id": 1,
9300  "params": {
9301    "snapshot_name": "cc8d7fdf-7865-4d1f-9fc6-35da8e368670",
9302    "clone_name": "CLONE1"
9303  }
9304}
9305~~~
9306
9307Example response:
9308
9309~~~json
9310{
9311  "jsonrpc": "2.0",
9312  "id": 1,
9313  "result": "8d87fccc-c278-49f0-9d4c-6237951aca09"
9314}
9315~~~
9316
9317### bdev_lvol_rename {#rpc_bdev_lvol_rename}
9318
9319Rename a logical volume. New name will rename only the alias of the logical volume.
9320
9321#### Parameters
9322
9323Name                    | Optional | Type        | Description
9324----------------------- | -------- | ----------- | -----------
9325old_name                | Required | string      | UUID or alias of the existing logical volume
9326new_name                | Required | string      | New logical volume name
9327
9328#### Example
9329
9330Example request:
9331
9332~~~json
9333{
9334  "jsonrpc": "2.0",
9335  "method": "bdev_lvol_rename",
9336  "id": 1,
9337  "params": {
9338    "old_name": "067df606-6dbc-4143-a499-0d05855cb3b8",
9339    "new_name": "LVOL2"
9340  }
9341}
9342~~~
9343
9344Example response:
9345
9346~~~json
9347{
9348  "jsonrpc": "2.0",
9349  "id": 1,
9350  "result": true
9351}
9352~~~
9353
9354### bdev_lvol_resize {#rpc_bdev_lvol_resize}
9355
9356Resize a logical volume.
9357
9358#### Parameters
9359
9360Name                    | Optional | Type        | Description
9361----------------------- | -------- | ----------- | -----------
9362name                    | Required | string      | UUID or alias of the logical volume to resize
9363size                    | Required | number      | Desired size of the logical volume in bytes
9364
9365#### Example
9366
9367Example request:
9368
9369~~~json
9370{
9371  "jsonrpc": "2.0",
9372  "method": "bdev_lvol_resize",
9373  "id": 1,
9374  "params": {
9375    "name": "51638754-ca16-43a7-9f8f-294a0805ab0a",
9376    "size": 2097152
9377  }
9378}
9379~~~
9380
9381Example response:
9382
9383~~~json
9384{
9385  "jsonrpc": "2.0",
9386  "id": 1,
9387  "result": true
9388}
9389~~~
9390
9391### bdev_lvol_set_read_only{#rpc_bdev_lvol_set_read_only}
9392
9393Mark logical volume as read only.
9394
9395#### Parameters
9396
9397Name                    | Optional | Type        | Description
9398----------------------- | -------- | ----------- | -----------
9399name                    | Required | string      | UUID or alias of the logical volume to set as read only
9400
9401#### Example
9402
9403Example request:
9404
9405~~~json
9406{
9407  "jsonrpc": "2.0",
9408  "method": "bdev_lvol_set_read_only",
9409  "id": 1,
9410  "params": {
9411    "name": "51638754-ca16-43a7-9f8f-294a0805ab0a",
9412  }
9413}
9414~~~
9415
9416Example response:
9417
9418~~~json
9419{
9420  "jsonrpc": "2.0",
9421  "id": 1,
9422  "result": true
9423}
9424~~~
9425
9426### bdev_lvol_delete {#rpc_bdev_lvol_delete}
9427
9428Destroy a logical volume.
9429
9430#### Parameters
9431
9432Name                    | Optional | Type        | Description
9433----------------------- | -------- | ----------- | -----------
9434name                    | Required | string      | UUID or alias of the logical volume to destroy
9435
9436#### Example
9437
9438Example request:
9439
9440~~~json
9441{
9442  "jsonrpc": "2.0",
9443  "method": "bdev_lvol_delete",
9444  "id": 1,
9445  "params": {
9446    "name": "51638754-ca16-43a7-9f8f-294a0805ab0a"
9447  }
9448}
9449~~~
9450
9451Example response:
9452
9453~~~json
9454{
9455  "jsonrpc": "2.0",
9456  "id": 1,
9457  "result": true
9458}
9459~~~
9460
9461### bdev_lvol_inflate {#rpc_bdev_lvol_inflate}
9462
9463Inflate a logical volume. All unallocated clusters are allocated and copied from the parent or zero filled
9464if not allocated in the parent. Then all dependencies on the parent are removed.
9465
9466### Parameters
9467
9468Name                    | Optional | Type        | Description
9469----------------------- | -------- | ----------- | -----------
9470name                    | Required | string      | UUID or alias of the logical volume to inflate
9471
9472#### Example
9473
9474Example request:
9475
9476~~~json
9477{
9478  "jsonrpc": "2.0",
9479  "method": "bdev_lvol_inflate",
9480  "id": 1,
9481  "params": {
9482    "name": "8d87fccc-c278-49f0-9d4c-6237951aca09"
9483  }
9484}
9485~~~
9486
9487Example response:
9488
9489~~~json
9490{
9491  "jsonrpc": "2.0",
9492  "id": 1,
9493  "result": true
9494}
9495~~~
9496
9497### bdev_lvol_decouple_parent {#rpc_bdev_lvol_decouple_parent}
9498
9499Decouple the parent of a logical volume. For unallocated clusters which is allocated in the parent, they are
9500allocated and copied from the parent, but for unallocated clusters which is thin provisioned in the parent,
9501they are kept thin provisioned. Then all dependencies on the parent are removed.
9502
9503#### Parameters
9504
9505Name                    | Optional | Type        | Description
9506----------------------- | -------- | ----------- | -----------
9507name                    | Required | string      | UUID or alias of the logical volume to decouple the parent of it
9508
9509#### Example
9510
9511Example request:
9512
9513~~~json
9514{
9515  "jsonrpc": "2.0",
9516  "method": "bdev_lvol_decouple_parent",
9517  "id": 1.
9518  "params": {
9519    "name": "8d87fccc-c278-49f0-9d4c-6237951aca09"
9520  }
9521}
9522~~~
9523
9524Example response:
9525
9526~~~json
9527{
9528  "jsonrpc": "2.0",
9529  "id": 1,
9530  "result": true
9531}
9532~~~
9533
9534## RAID
9535
9536### bdev_raid_get_bdevs {#rpc_bdev_raid_get_bdevs}
9537
9538This is used to list all the raid bdev details based on the input category requested. Category should be one
9539of 'all', 'online', 'configuring' or 'offline'. 'all' means all the raid bdevs whether they are online or
9540configuring or offline. 'online' is the raid bdev which is registered with bdev layer. 'configuring' is
9541the raid bdev which does not have full configuration discovered yet. 'offline' is the raid bdev which is
9542not registered with bdev as of now and it has encountered any error or user has requested to offline
9543the raid bdev.
9544
9545#### Parameters
9546
9547Name                    | Optional | Type        | Description
9548----------------------- | -------- | ----------- | -----------
9549category                | Required | string      | all or online or configuring or offline
9550
9551#### Example
9552
9553Example request:
9554
9555~~~json
9556{
9557  "jsonrpc": "2.0",
9558  "method": "bdev_raid_get_bdevs",
9559  "id": 1,
9560  "params": {
9561    "category": "all"
9562  }
9563}
9564~~~
9565
9566Example response:
9567
9568~~~json
9569{
9570  "jsonrpc": "2.0",
9571  "id": 1,
9572  "result": [
9573    {
9574      "name": "RaidBdev0",
9575      "strip_size_kb": 128,
9576      "state": "online",
9577      "raid_level": "raid0",
9578      "num_base_bdevs": 2,
9579      "num_base_bdevs_discovered": 2,
9580      "base_bdevs_list": [
9581        "malloc0",
9582        "malloc1"
9583      ]
9584    },
9585    {
9586      "name": "RaidBdev1",
9587      "strip_size_kb": 128,
9588      "state": "configuring",
9589      "raid_level": "raid0",
9590      "num_base_bdevs": 2,
9591      "num_base_bdevs_discovered": 1,
9592      "base_bdevs_list": [
9593        "malloc2",
9594        null
9595      ]
9596    }
9597  ]
9598}
9599~~~
9600
9601### bdev_raid_create {#rpc_bdev_raid_create}
9602
9603Constructs new RAID bdev.
9604
9605#### Parameters
9606
9607Name                    | Optional | Type        | Description
9608----------------------- | -------- | ----------- | -----------
9609name                    | Required | string      | RAID bdev name
9610strip_size_kb           | Required | number      | Strip size in KB
9611raid_level              | Required | string      | RAID level
9612base_bdevs              | Required | string      | Base bdevs name, whitespace separated list in quotes
9613
9614#### Example
9615
9616Example request:
9617
9618~~~json
9619{
9620  "jsonrpc": "2.0",
9621  "method": "bdev_raid_create",
9622  "id": 1,
9623  "params": {
9624    "name": "Raid0",
9625    "raid_level": "0",
9626    "base_bdevs": [
9627      "Malloc0",
9628      "Malloc1",
9629      "Malloc2",
9630      "Malloc3"
9631    ],
9632    "strip_size_kb": 4
9633  }
9634}
9635~~~
9636
9637Example response:
9638
9639~~~json
9640{
9641  "jsonrpc": "2.0",
9642  "id": 1,
9643  "result": true
9644}
9645~~~
9646
9647### bdev_raid_delete {#rpc_bdev_raid_delete}
9648
9649Removes RAID bdev.
9650
9651#### Parameters
9652
9653Name                    | Optional | Type        | Description
9654----------------------- | -------- | ----------- | -----------
9655name                    | Required | string      | RAID bdev name
9656
9657#### Example
9658
9659Example request:
9660
9661~~~json
9662{
9663  "jsonrpc": "2.0",
9664  "method": "bdev_raid_delete",
9665  "id": 1,
9666  "params": {
9667    "name": "Raid0"
9668  }
9669}
9670~~~
9671
9672Example response:
9673
9674~~~json
9675{
9676  "jsonrpc": "2.0",
9677  "id": 1,
9678  "result": true
9679}
9680~~~
9681
9682## SPLIT
9683
9684### bdev_split_create {#rpc_bdev_split_create}
9685
9686This is used to split an underlying block device and create several smaller equal-sized vbdevs.
9687
9688#### Parameters
9689
9690Name                    | Optional | Type        | Description
9691----------------------- | -------- | ----------- | -----------
9692base_bdev               | Required | string      | base bdev name
9693split_count             | Required | number      | number of splits
9694split_size_mb           | Optional | number      | size in MB to restrict the size
9695
9696#### Example
9697
9698Example request:
9699
9700~~~json
9701{
9702  "jsonrpc": "2.0",
9703  "method": "bdev_split_create",
9704  "id": 1,
9705  "params": {
9706    "base_bdev": "Malloc0",
9707    "split_count": 4
9708  }
9709}
9710~~~
9711
9712Example response:
9713
9714~~~json
9715{
9716  "jsonrpc": "2.0",
9717  "id": 1,
9718  "result": [
9719    "Malloc0p0",
9720    "Malloc0p1",
9721    "Malloc0p2",
9722    "Malloc0p3"
9723  ]
9724}
9725~~~
9726
9727### bdev_split_delete {#rpc_bdev_split_delete}
9728
9729This is used to remove the split vbdevs.
9730
9731#### Parameters
9732
9733Name                    | Optional | Type        | Description
9734----------------------- | -------- | ----------- | -----------
9735base_bdev               | Required | string      | base bdev name
9736
9737#### Example
9738
9739Example request:
9740
9741~~~json
9742{
9743  "jsonrpc": "2.0",
9744  "method": "bdev_split_delete",
9745  "id": 1,
9746  "params": {
9747    "base_bdev": "Malloc0"
9748  }
9749}
9750~~~
9751
9752Example response:
9753
9754~~~json
9755{
9756  "jsonrpc": "2.0",
9757  "id": 1,
9758  "result": true
9759}
9760~~~
9761
9762## Uring
9763
9764### bdev_uring_create {#rpc_bdev_uring_create}
9765
9766Create a bdev with io_uring backend.
9767
9768#### Parameters
9769
9770Name                    | Optional | Type        | Description
9771----------------------- | -------- | ----------- | -----------
9772filename                | Required | string      | path to device or file (ex: /dev/nvme0n1)
9773name                    | Required | string      | name of bdev
9774block_size              | Optional | number      | block size of device (If omitted, get the block size from the file)
9775
9776#### Example
9777
9778Example request:
9779
9780~~~json
9781{
9782  "jsonrpc": "2.0",
9783  "method": "bdev_uring_create",
9784  "id": 1,
9785  "params": {
9786    "name": "bdev_u0",
9787    "filename": "/dev/nvme0n1",
9788    "block_size": 512
9789  }
9790}
9791~~~
9792
9793Example response:
9794
9795~~~json
9796{
9797  "jsonrpc": "2.0",
9798  "id": 1,
9799  "result": "bdev_u0"
9800}
9801~~~
9802
9803### bdev_uring_delete {#rpc_bdev_uring_delete}
9804
9805Remove a uring bdev.
9806
9807#### Parameters
9808
9809Name                    | Optional | Type        | Description
9810----------------------- | -------- | ----------- | -----------
9811name                    | Required | string      | name of uring bdev to delete
9812
9813#### Example
9814
9815Example request:
9816
9817~~~json
9818{
9819  "jsonrpc": "2.0",
9820  "method": "bdev_uring_delete",
9821  "id": 1,
9822  "params": {
9823    "name": "bdev_u0"
9824  }
9825}
9826~~~
9827
9828Example response:
9829
9830~~~json
9831{
9832  "jsonrpc": "2.0",
9833  "id": 1,
9834  "result": true
9835}
9836~~~
9837
9838## OPAL
9839
9840### bdev_nvme_opal_init {#rpc_bdev_nvme_opal_init}
9841
9842This is used to initialize OPAL of a given NVMe ctrlr, including taking ownership and activating.
9843
9844#### Parameters
9845
9846Name                    | Optional | Type        | Description
9847----------------------- | -------- | ----------- | -----------
9848nvme_ctrlr_name         | Required | string      | name of nvme ctrlr
9849password                | Required | string      | admin password of OPAL
9850
9851#### Example
9852
9853Example request:
9854
9855~~~json
9856{
9857  "jsonrpc": "2.0",
9858  "method": "bdev_nvme_opal_init",
9859  "id": 1,
9860  "params": {
9861    "nvme_ctrlr_name": "nvme0",
9862    "password": "*****"
9863  }
9864}
9865~~~
9866
9867Example response:
9868
9869~~~json
9870{
9871  "jsonrpc": "2.0",
9872  "id": 1,
9873  "result": true
9874}
9875~~~
9876
9877### bdev_nvme_opal_revert {#rpc_bdev_nvme_opal_revert}
9878
9879This is used to revert OPAL to its factory settings. Erase all user configuration and data.
9880
9881#### Parameters
9882
9883Name                    | Optional | Type        | Description
9884----------------------- | -------- | ----------- | -----------
9885nvme_ctrlr_name         | Required | string      | name of nvme ctrlr
9886password                | Required | string      | admin password of OPAL
9887
9888#### Example
9889
9890Example request:
9891
9892~~~json
9893{
9894  "jsonrpc": "2.0",
9895  "method": "bdev_nvme_opal_revert",
9896  "id": 1,
9897  "params": {
9898    "nvme_ctrlr_name": "nvme0",
9899    "password": "*****"
9900  }
9901}
9902~~~
9903
9904Example response:
9905
9906~~~json
9907{
9908  "jsonrpc": "2.0",
9909  "id": 1,
9910  "result": true
9911}
9912~~~
9913
9914### bdev_opal_create {#rpc_bdev_opal_create}
9915
9916This is used to create an OPAL virtual bdev.
9917
9918#### Parameters
9919
9920Name                    | Optional | Type        | Description
9921----------------------- | -------- | ----------- | -----------
9922nvme_ctrlr_name         | Required | string      | name of nvme ctrlr that supports OPAL
9923nsid                    | Required | number      | namespace ID
9924locking_range_id        | Required | number      | OPAL locking range ID
9925range_start             | Required | number      | locking range start LBA
9926range_length            | Required | number      | locking range length
9927password                | Required | string      | admin password of OPAL
9928
9929#### Response
9930
9931The response is the name of created OPAL virtual bdev.
9932
9933#### Example
9934
9935Example request:
9936
9937~~~json
9938{
9939  "jsonrpc": "2.0",
9940  "method": "bdev_opal_create",
9941  "id": 1,
9942  "params": {
9943    "nvme_ctrlr_name": "nvme0",
9944    "nsid": 1,
9945    "locking_range_id": 1,
9946    "range_start": 0,
9947    "range_length": 4096,
9948    "password": "*****"
9949  }
9950}
9951~~~
9952
9953Example response:
9954
9955~~~json
9956{
9957  "jsonrpc": "2.0",
9958  "id": 1,
9959  "result": "nvme0n1r1"
9960}
9961~~~
9962
9963### bdev_opal_get_info {#rpc_bdev_opal_get_info}
9964
9965This is used to get information of a given OPAL bdev.
9966
9967#### Parameters
9968
9969Name                    | Optional | Type        | Description
9970----------------------- | -------- | ----------- | -----------
9971bdev_name               | Required | string      | name of OPAL vbdev
9972password                | Required | string      | admin password
9973
9974#### Response
9975
9976The response is the locking info of OPAL virtual bdev.
9977
9978#### Example
9979
9980Example request:
9981
9982~~~json
9983{
9984  "jsonrpc": "2.0",
9985  "method": "bdev_opal_get_info",
9986  "id": 1,
9987  "params": {
9988    "bdev_name": "nvme0n1r1",
9989    "password": "*****"
9990  }
9991}
9992~~~
9993
9994Example response:
9995
9996~~~json
9997{
9998  "jsonrpc": "2.0",
9999  "id": 1,
10000  "result": {
10001      "name": "nvme0n1r1",
10002      "range_start": 0,
10003      "range_length": 4096,
10004      "read_lock_enabled": true,
10005      "write_lock_enabled": true,
10006      "read_locked": false,
10007      "write_locked": false
10008    }
10009}
10010~~~
10011
10012### bdev_opal_delete {#rpc_bdev_opal_delete}
10013
10014This is used to delete OPAL vbdev.
10015
10016#### Parameters
10017
10018Name                    | Optional | Type        | Description
10019----------------------- | -------- | ----------- | -----------
10020bdev_name               | Required | string      | name of OPAL vbdev
10021password                | Required | string      | admin password
10022
10023#### Example
10024
10025Example request:
10026
10027~~~json
10028{
10029  "jsonrpc": "2.0",
10030  "method": "bdev_opal_delete",
10031  "id": 1,
10032  "params": {
10033    "bdev_name": "nvme0n1r1",
10034    "password": "*****"
10035  }
10036}
10037~~~
10038
10039Example response:
10040
10041~~~json
10042{
10043  "jsonrpc": "2.0",
10044  "id": 1,
10045  "result": true
10046}
10047~~~
10048
10049### bdev_opal_new_user {#rpc_bdev_opal_new_user}
10050
10051This enables a new user to the specified opal bdev so that the user can lock/unlock the bdev.
10052Recalling this for the same opal bdev, only the newest user will have the privilege.
10053
10054#### Parameters
10055
10056Name                    | Optional | Type        | Description
10057----------------------- | -------- | ----------- | -----------
10058bdev_name               | Required | string      | name of OPAL vbdev
10059admin_password          | Required | string      | admin password
10060user_id                 | Required | number      | user ID
10061user_password           | Required | string      | user password
10062
10063#### Example
10064
10065Example request:
10066
10067~~~json
10068{
10069  "jsonrpc": "2.0",
10070  "method": "bdev_opal_new_user",
10071  "id": 1,
10072  "params": {
10073    "bdev_name": "nvme0n1r1",
10074    "admin_password": "*****",
10075    "user_id": "1",
10076    "user_password": "********"
10077  }
10078}
10079~~~
10080
10081Example response:
10082
10083~~~json
10084{
10085  "jsonrpc": "2.0",
10086  "id": 1,
10087  "result": true
10088}
10089~~~
10090
10091### bdev_opal_set_lock_state {#rpc_bdev_opal_set_lock_state}
10092
10093This is used to lock/unlock specific opal bdev providing user ID and password.
10094
10095#### Parameters
10096
10097Name                    | Optional | Type        | Description
10098----------------------- | -------- | ----------- | -----------
10099bdev_name               | Required | string      | name of OPAL vbdev
10100user_id                 | Required | number      | user ID
10101password                | Required | string      | user password
10102lock_state              | Required | string      | lock state
10103
10104#### Example
10105
10106Example request:
10107
10108~~~json
10109{
10110  "jsonrpc": "2.0",
10111  "method": "bdev_opal_set_lock_state",
10112  "id": 1,
10113  "params": {
10114    "bdev_name": "nvme0n1r1",
10115    "user_id": "1",
10116    "user_password": "********",
10117    "lock_state": "rwlock"
10118  }
10119}
10120~~~
10121
10122Example response:
10123
10124~~~json
10125{
10126  "jsonrpc": "2.0",
10127  "id": 1,
10128  "result": true
10129}
10130~~~
10131
10132## Notifications
10133
10134### notify_get_types {#rpc_notify_get_types}
10135
10136Return list of all supported notification types.
10137
10138#### Parameters
10139
10140None
10141
10142#### Response
10143
10144The response is an array of strings - supported RPC notification types.
10145
10146#### Example
10147
10148Example request:
10149
10150~~~json
10151{
10152  "jsonrpc": "2.0",
10153  "method": "notify_get_types",
10154  "id": 1
10155}
10156~~~
10157
10158Example response:
10159
10160~~~json
10161{
10162  "id": 1,
10163  "result": [
10164    "bdev_register",
10165    "bdev_unregister"
10166  ],
10167  "jsonrpc": "2.0"
10168}
10169~~~
10170
10171### notify_get_notifications {#notify_get_notifications}
10172
10173Request notifications. Returns array of notifications that happend since the specified id (or first that is available).
10174
10175Notice: Notifications are kept in circular buffer with limited size. Older notifications might be inaccessible
10176due to being overwritten by new ones.
10177
10178#### Parameters
10179
10180Name                    | Optional | Type        | Description
10181----------------------- | -------- | ----------- | -----------
10182id                      | Optional | number      | First Event ID to fetch (default: first available).
10183max                     | Optional | number      | Maximum number of event to return (default: no limit).
10184
10185#### Response
10186
10187Response is an array of event objects.
10188
10189Name                    | Optional | Type        | Description
10190----------------------- | -------- | ----------- | -----------
10191id                      | Optional | number      | Event ID.
10192type                    | Optional | number      | Type of the event.
10193ctx                     | Optional | string      | Event context.
10194
10195#### Example
10196
10197Example request:
10198
10199~~~json
10200{
10201  "id": 1,
10202  "jsonrpc": "2.0",
10203  "method": "notify_get_notifications",
10204  "params": {
10205    "id": 1,
10206    "max": 10
10207  }
10208}
10209
10210~~~
10211
10212Example response:
10213
10214~~~json
10215{
10216  "jsonrpc": "2.0",
10217  "id": 1,
10218  "result": [
10219    {
10220      "ctx": "Malloc0",
10221      "type": "bdev_register",
10222      "id": 1
10223    },
10224    {
10225      "ctx": "Malloc2",
10226      "type": "bdev_register",
10227      "id": 2
10228    }
10229  ]
10230}
10231~~~
10232
10233## Linux Network Block Device (NBD) {#jsonrpc_components_nbd}
10234
10235SPDK supports exporting bdevs through Linux nbd. These devices then appear as standard Linux kernel block devices
10236and can be accessed using standard utilities like fdisk.
10237
10238In order to export a device over nbd, first make sure the Linux kernel nbd driver is loaded by running 'modprobe nbd'.
10239
10240### nbd_start_disk {#rpc_nbd_start_disk}
10241
10242Start to export one SPDK bdev as NBD disk
10243
10244#### Parameters
10245
10246Name                    | Optional | Type        | Description
10247----------------------- | -------- | ----------- | -----------
10248bdev_name               | Required | string      | Bdev name to export
10249nbd_device              | Optional | string      | NBD device name to assign
10250
10251#### Response
10252
10253Path of exported NBD disk
10254
10255#### Example
10256
10257Example request:
10258
10259~~~json
10260{
10261 "params": {
10262    "nbd_device": "/dev/nbd1",
10263    "bdev_name": "Malloc1"
10264  },
10265  "jsonrpc": "2.0",
10266  "method": "nbd_start_disk",
10267  "id": 1
10268}
10269~~~
10270
10271Example response:
10272
10273~~~json
10274{
10275  "jsonrpc": "2.0",
10276  "id": 1,
10277  "result": "/dev/nbd1"
10278}
10279~~~
10280
10281### nbd_stop_disk {#rpc_nbd_stop_disk}
10282
10283Stop one NBD disk which is based on SPDK bdev.
10284
10285#### Parameters
10286
10287Name                    | Optional | Type        | Description
10288----------------------- | -------- | ----------- | -----------
10289nbd_device              | Required | string      | NBD device name to stop
10290
10291#### Example
10292
10293Example request:
10294
10295~~~json
10296{
10297 "params": {
10298    "nbd_device": "/dev/nbd1",
10299  },
10300  "jsonrpc": "2.0",
10301  "method": "nbd_stop_disk",
10302  "id": 1
10303}
10304~~~
10305
10306Example response:
10307
10308~~~json
10309{
10310  "jsonrpc": "2.0",
10311  "id": 1,
10312  "result": "true"
10313}
10314~~~
10315
10316### nbd_get_disks {#rpc_nbd_get_disks}
10317
10318Display all or specified NBD device list
10319
10320#### Parameters
10321
10322Name                    | Optional | Type        | Description
10323----------------------- | -------- | ----------- | -----------
10324nbd_device              | Optional | string      | NBD device name to display
10325
10326#### Response
10327
10328The response is an array of exported NBD devices and their corresponding SPDK bdev.
10329
10330#### Example
10331
10332Example request:
10333
10334~~~json
10335{
10336  "jsonrpc": "2.0",
10337  "method": "nbd_get_disks",
10338  "id": 1
10339}
10340~~~
10341
10342Example response:
10343
10344~~~json
10345{
10346  "jsonrpc": "2.0",
10347  "id": 1,
10348  "result":  [
10349    {
10350      "bdev_name": "Malloc0",
10351      "nbd_device": "/dev/nbd0"
10352    },
10353    {
10354      "bdev_name": "Malloc1",
10355      "nbd_device": "/dev/nbd1"
10356    }
10357  ]
10358}
10359~~~
10360
10361## Blobfs {#jsonrpc_components_blobfs}
10362
10363### blobfs_detect {#rpc_blobfs_detect}
10364
10365Detect whether a blobfs exists on bdev.
10366
10367#### Parameters
10368
10369Name                    | Optional | Type        | Description
10370----------------------- | -------- | ----------- | -----------
10371bdev_name               | Required | string      | Block device name to detect blobfs
10372
10373#### Response
10374
10375True if a blobfs exists on the bdev; False otherwise.
10376
10377#### Example
10378
10379Example request:
10380
10381~~~json
10382{
10383  "jsonrpc": "2.0",
10384  "id": 1,
10385  "method": "blobfs_detect",
10386  "params": {
10387    "bdev_name": "Malloc0"
10388  }
10389}
10390~~~
10391
10392Example response:
10393
10394~~~json
10395{
10396  "jsonrpc": "2.0",
10397  "id": 1,
10398  "result": "true"
10399}
10400~~~
10401
10402### blobfs_create {#rpc_blobfs_create}
10403
10404Build blobfs on bdev.
10405
10406#### Parameters
10407
10408Name                    | Optional | Type        | Description
10409----------------------- | -------- | ----------- | -----------
10410bdev_name               | Required | string      | Block device name to create blobfs
10411cluster_sz              | Optional | number      | Size of cluster in bytes. Must be multiple of 4KiB page size, default and minimal value is 1M.
10412
10413#### Example
10414
10415Example request:
10416
10417~~~json
10418{
10419  "jsonrpc": "2.0",
10420  "id": 1,
10421  "method": "blobfs_create",
10422  "params": {
10423    "bdev_name": "Malloc0",
10424    "cluster_sz": 1M
10425  }
10426}
10427~~~
10428
10429Example response:
10430
10431~~~json
10432{
10433  "jsonrpc": "2.0",
10434  "id": 1,
10435  "result": "true"
10436}
10437~~~
10438
10439### blobfs_mount {#rpc_blobfs_mount}
10440
10441Mount a blobfs on bdev to one host path through FUSE
10442
10443#### Parameters
10444
10445Name                    | Optional | Type        | Description
10446----------------------- | -------- | ----------- | -----------
10447bdev_name               | Required | string      | Block device name where the blobfs is
10448mountpoint              | Required | string      | Mountpoint path in host to mount blobfs
10449
10450#### Example
10451
10452Example request:
10453
10454~~~json
10455{
10456  "jsonrpc": "2.0",
10457  "id": 1,
10458  "method": ""blobfs_mount"",
10459  "params": {
10460    "bdev_name": "Malloc0",
10461    "mountpoint": "/mnt/"
10462  }
10463}
10464~~~
10465
10466Example response:
10467
10468~~~json
10469{
10470  "jsonrpc": "2.0",
10471  "id": 1,
10472  "result": "true"
10473}
10474~~~
10475
10476### blobfs_set_cache_size {#rpc_blobfs_set_cache_size}
10477
10478Set cache pool size for blobfs filesystems.  This RPC is only permitted when the cache pool is not already initialized.
10479
10480The cache pool is initialized when the first blobfs filesystem is initialized or loaded.  It is freed when the all
10481initialized or loaded filesystems are unloaded.
10482
10483#### Parameters
10484
10485Name                    | Optional | Type        | Description
10486----------------------- | -------- | ----------- | -----------
10487size_in_mb              | Required | number      | Cache size in megabytes
10488
10489#### Response
10490
10491True if cache size is set successfully; False if failed to set.
10492
10493#### Example
10494
10495Example request:
10496
10497~~~json
10498{
10499  "jsonrpc": "2.0",
10500  "id": 1,
10501  "method": "blobfs_set_cache_size",
10502  "params": {
10503    "size_in_mb": 512,
10504  }
10505}
10506~~~
10507
10508Example response:
10509
10510~~~json
10511{
10512  "jsonrpc": "2.0",
10513  "id": 1,
10514  "result": true
10515}
10516~~~
10517
10518## Socket layer {#jsonrpc_components_sock}
10519
10520### sock_impl_get_options {#rpc_sock_impl_get_options}
10521
10522Get parameters for the socket layer implementation.
10523
10524#### Parameters
10525
10526Name                    | Optional | Type        | Description
10527----------------------- | -------- | ----------- | -----------
10528impl_name               | Required | string      | Name of socket implementation, e.g. posix
10529
10530#### Response
10531
10532Response is an object with current socket layer options for requested implementation.
10533
10534#### Example
10535
10536Example request:
10537
10538~~~json
10539{
10540  "jsonrpc": "2.0",
10541  "method": "sock_impl_get_options",
10542  "id": 1,
10543  "params": {
10544    "impl_name": "posix"
10545  }
10546}
10547~~~
10548
10549Example response:
10550
10551~~~json
10552{
10553  "jsonrpc": "2.0",
10554  "id": 1,
10555  "result": {
10556    "recv_buf_size": 2097152,
10557    "send_buf_size": 2097152,
10558    "enable_recv_pipe": true,
10559    "enable_quickack": true,
10560    "enable_placement_id": 0,
10561    "enable_zerocopy_send_server": true,
10562    "enable_zerocopy_send_client": false,
10563    "zerocopy_threshold": 0,
10564    "tls_version": 13,
10565    "enable_ktls": false,
10566    "psk_key": "1234567890ABCDEF",
10567    "psk_identity": "psk.spdk.io"
10568  }
10569}
10570~~~
10571
10572### sock_impl_set_options {#rpc_sock_impl_set_options}
10573
10574Set parameters for the socket layer implementation.
10575
10576#### Parameters
10577
10578Name                        | Optional | Type        | Description
10579--------------------------- | -------- | ----------- | -----------
10580impl_name                   | Required | string      | Name of socket implementation, e.g. posix
10581recv_buf_size               | Optional | number      | Size of socket receive buffer in bytes
10582send_buf_size               | Optional | number      | Size of socket send buffer in bytes
10583enable_recv_pipe            | Optional | boolean     | Enable or disable receive pipe
10584enable_quick_ack            | Optional | boolean     | Enable or disable quick ACK
10585enable_placement_id         | Optional | number      | Enable or disable placement_id. 0:disable,1:incoming_napi,2:incoming_cpu
10586enable_zerocopy_send_server | Optional | boolean     | Enable or disable zero copy on send for server sockets
10587enable_zerocopy_send_client | Optional | boolean     | Enable or disable zero copy on send for client sockets
10588zerocopy_threshold          | Optional | number      | Set zerocopy_threshold in bytes. A consecutive sequence of requests' iovecs
10589--                          | --       | --          | that fall below this threshold may be sent without zerocopy flag set
10590tls_version                 | Optional | number      | TLS protocol version, e.g. 13 for v1.3 (only applies when impl_name == ssl)
10591enable_ktls                 | Optional | boolean     | Enable or disable Kernel TLS (only applies when impl_name == ssl)
10592psk_key                     | Optional | string      | Default PSK KEY in hexadecimal digits, e.g. 1234567890ABCDEF (only applies when impl_name == ssl)
10593psk_identity                | Optional | string      | Default PSK ID, e.g. psk.spdk.io (only applies when impl_name == ssl)
10594
10595#### Response
10596
10597True if socket layer options were set successfully.
10598
10599#### Example
10600
10601Example request:
10602
10603~~~json
10604{
10605  "jsonrpc": "2.0",
10606  "method": "sock_impl_set_options",
10607  "id": 1,
10608  "params": {
10609    "impl_name": "posix",
10610    "recv_buf_size": 2097152,
10611    "send_buf_size": 2097152,
10612    "enable_recv_pipe": false,
10613    "enable_quick_ack": false,
10614    "enable_placement_id": 0,
10615    "enable_zerocopy_send_server": true,
10616    "enable_zerocopy_send_client": false,
10617    "zerocopy_threshold": 10240,
10618    "tls_version": 13,
10619    "enable_ktls": false,
10620    "psk_key": "1234567890ABCDEF",
10621    "psk_identity": "psk.spdk.io"
10622  }
10623}
10624~~~
10625
10626Example response:
10627
10628~~~json
10629{
10630  "jsonrpc": "2.0",
10631  "id": 1,
10632  "result": true
10633}
10634~~~
10635
10636### sock_set_default_impl {#rpc_sock_set_default_impl}
10637
10638Set the default sock implementation.
10639
10640#### Parameters
10641
10642Name                    | Optional | Type        | Description
10643----------------------- | -------- | ----------- | -----------
10644impl_name               | Required | string      | Name of socket implementation, e.g. posix
10645
10646#### Response
10647
10648True if the default socket layer configuration was set successfully.
10649
10650#### Example
10651
10652Example request:
10653
10654~~~json
10655{
10656  "jsonrpc": "2.0",
10657  "method": "sock_set_default_impl",
10658  "id": 1,
10659  "params": {
10660    "impl_name": "posix"
10661  }
10662}
10663~~~
10664
10665Example response:
10666
10667~~~json
10668{
10669  "jsonrpc": "2.0",
10670  "id": 1,
10671  "result": true
10672}
10673~~~
10674
10675## Miscellaneous RPC commands
10676
10677### bdev_nvme_send_cmd {#rpc_bdev_nvme_send_cmd}
10678
10679Send NVMe command directly to NVMe controller or namespace. Parameters and responses encoded by base64 urlsafe need further processing.
10680
10681Notice: bdev_nvme_send_cmd requires user to guarentee the correctness of NVMe command itself, and also optional parameters.
10682Illegal command contents or mismatching buffer size may result in unpredictable behavior.
10683
10684#### Parameters
10685
10686Name                    | Optional | Type        | Description
10687----------------------- | -------- | ----------- | -----------
10688name                    | Required | string      | Name of the operating NVMe controller
10689cmd_type                | Required | string      | Type of nvme cmd. Valid values are: admin, io
10690data_direction          | Required | string      | Direction of data transfer. Valid values are: c2h, h2c
10691cmdbuf                  | Required | string      | NVMe command encoded by base64 urlsafe
10692data                    | Optional | string      | Data transferring to controller from host, encoded by base64 urlsafe
10693metadata                | Optional | string      | Metadata transferring to controller from host, encoded by base64 urlsafe
10694data_len                | Optional | number      | Data length required to transfer from controller to host
10695metadata_len            | Optional | number      | Metadata length required to transfer from controller to host
10696timeout_ms              | Optional | number      | Command execution timeout value, in milliseconds
10697
10698#### Response
10699
10700Name                    | Type        | Description
10701----------------------- | ----------- | -----------
10702cpl                     | string      | NVMe completion queue entry, encoded by base64 urlsafe
10703data                    | string      | Data transferred from controller to host, encoded by base64 urlsafe
10704metadata                | string      | Metadata transferred from controller to host, encoded by base64 urlsafe
10705
10706#### Example
10707
10708Example request:
10709
10710~~~json
10711{
10712  "jsonrpc": "2.0",
10713  "method": "bdev_nvme_send_cmd",
10714  "id": 1,
10715  "params": {
10716    "name": "Nvme0",
10717    "cmd_type": "admin"
10718    "data_direction": "c2h",
10719    "cmdbuf": "BgAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAsGUs9P5_AAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==",
10720    "data_len": 60,
10721  }
10722}
10723~~~
10724
10725Example response:
10726
10727~~~json
10728{
10729  "jsonrpc": "2.0",
10730  "id": 1,
10731  "result":  {
10732    "cpl": "AAAAAAAAAAARAAAAWrmwABAA==",
10733    "data": "sIjg6AAAAACwiODoAAAAALCI4OgAAAAAAAYAAREAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
10734  }
10735
10736}
10737~~~
10738
10739### vmd_enable {#rpc_enable_vmd}
10740
10741Enable VMD enumeration.
10742
10743#### Parameters
10744
10745This method has no parameters.
10746
10747#### Response
10748
10749Completion status of enumeration is returned as a boolean.
10750
10751### Example
10752
10753Example request:
10754
10755~~~json
10756{
10757  "jsonrpc": "2.0",
10758  "method": "vmd_enable",
10759  "id": 1
10760}
10761~~~
10762
10763Example response:
10764
10765~~~json
10766{
10767  "jsonrpc": "2.0",
10768  "id": 1,
10769  "result": true
10770}
10771~~~
10772
10773### vmd_remove_device {#rpc_vmd_remove_device}
10774
10775Remove a device behind a VMD.
10776
10777### Parameters
10778
10779Name                    | Optional | Type        | Description
10780----------------------- | -------- | ----------- | -----------
10781addr                    | Required | string      | Address of the device to remove.
10782
10783### Example
10784
10785~~~json
10786{
10787  "jsonrpc": "2.0",
10788  "method": "vmd_remove_device",
10789  "params": {
10790    "addr": "5d0505:01:00.0"
10791  }
10792  "id": 1
10793}
10794~~~
10795
10796Example response:
10797
10798~~~json
10799{
10800  "jsonrpc": "2.0",
10801  "id": 1,
10802  "result": true
10803}
10804~~~
10805
10806### vmd_rescan {#rpc_vmd_rescan}
10807
10808Force a rescan of the devices behind VMD.
10809
10810### Parameters
10811
10812This method has no parameters.
10813
10814#### Response
10815
10816The response is the number of new devices found.
10817
10818### Example
10819
10820~~~json
10821{
10822  "jsonrpc": "2.0",
10823  "method": "vmd_rescan",
10824  "id": 1
10825}
10826~~~
10827
10828Example response:
10829
10830~~~json
10831{
10832  "jsonrpc": "2.0",
10833  "id": 1,
10834  "result": {
10835    "count": 1
10836  }
10837}
10838~~~
10839
10840### spdk_get_version {#rpc_spdk_get_version}
10841
10842Get the version info of the running SPDK application.
10843
10844#### Parameters
10845
10846This method has no parameters.
10847
10848#### Response
10849
10850The response is the version number including major version number, minor version number, patch level number and suffix string.
10851
10852#### Example
10853
10854Example request:
10855
10856~~~json
10857{
10858  "jsonrpc": "2.0",
10859  "id": 1,
10860  "method": "spdk_get_version"
10861}
10862~~~
10863
10864Example response:
10865
10866~~~json
10867{
10868  "jsonrpc": "2.0",
10869  "id": 1,
10870  "result":  {
10871    "version": "19.04-pre",
10872    "fields" : {
10873      "major": 19,
10874      "minor": 4,
10875      "patch": 0,
10876      "suffix": "-pre"
10877    }
10878  }
10879}
10880~~~
10881
10882### framework_get_pci_devices
10883
10884List PCIe devices attached to an SPDK application and the contents of their config space.
10885
10886#### Parameters
10887
10888This method has no parameters.
10889
10890#### Response
10891
10892The response is an array of attached PCIe devices.
10893
10894#### Example
10895
10896Example request:
10897
10898~~~json
10899{
10900  "jsonrpc": "2.0",
10901  "id": 1,
10902  "method": "framework_get_pci_devices"
10903}
10904~~~
10905
10906Example response:
10907Note that the config space buffer was trimmed.
10908
10909~~~json
10910{
10911  "jsonrpc": "2.0",
10912  "id": 1,
10913  "result": {
10914    [
10915      {
10916        "address": "0000:00:04.0",
10917        "config_space": "8680455807051000...0000000000000000"
10918      },
10919      {
10920        "address": "0000:00:03.0",
10921        "config_space": "8680455807051000...0000000000000000"
10922      }
10923    ]
10924  }
10925}
10926~~~
10927
10928### bdev_nvme_add_error_injection {#rpc_bdev_nvme_add_error_injection}
10929
10930Add a NVMe command error injection for a bdev nvme controller.
10931
10932#### Parameters
10933
10934Name                    | Optional | Type        | Description
10935----------------------- | -------- | ----------- | -----------
10936name                    | Required | string      | Name of the operating NVMe controller
10937cmd_type                | Required | string      | Type of NVMe command. Valid values are: admin, io
10938opc                     | Required | number      | Opcode for which the error injection is applied
10939do_not_submit           | Optional | boolean     | Set to true if request should not be submitted to the controller (default false)
10940timeout_in_us           | Optional | number      | Wait specified microseconds when do_not_submit is true
10941err_count               | Optional | number      | Number of matching NVMe commands to inject errors
10942sct                     | Optional | number      | Status code type (default 0)
10943sc                      | Optional | number      | Status code (default 0)
10944
10945#### Response
10946
10947true on success
10948
10949#### Example
10950
10951Example request:
10952
10953~~~json
10954{
10955  "jsonrpc": "2.0",
10956  "method": "bdev_nvme_add_error_injection",
10957  "id": 1,
10958  "params": {
10959    "name": "HotInNvme0",
10960    "opc": 2,
10961    "cmd_type": "io",
10962    "err_count": 1111111,
10963    "sct": 11,
10964    "sc": 33
10965  }
10966}
10967
10968~~~
10969
10970Example response:
10971
10972~~~json
10973{
10974  "jsonrpc": "2.0",
10975  "id": 1,
10976  "result": true
10977}
10978
10979~~~
10980
10981### bdev_nvme_remove_error_injection {#rpc_bdev_nvme_remove_error_injection}
10982
10983Remove a NVMe command error injection.
10984
10985#### Parameters
10986
10987Name                    | Optional | Type        | Description
10988----------------------- | -------- | ----------- | -----------
10989name                    | Required | string      | Name of the operating NVMe controller
10990cmd_type                | Required | string      | Type of NVMe command. Valid values are: admin, io
10991opc                     | Required | number      | Opcode for which the error injection is applied
10992
10993#### Response
10994
10995true on success
10996
10997#### Example
10998
10999Example request:
11000
11001~~~json
11002{
11003  "jsonrpc": "2.0",
11004  "method": "bdev_nvme_remove_error_injection",
11005  "id": 1,
11006  "params": {
11007    "name": "HotInNvme0",
11008    "opc": 2,
11009    "cmd_type": "io"
11010  }
11011}
11012
11013
11014~~~
11015
11016Example response:
11017
11018~~~json
11019{
11020  "jsonrpc": "2.0",
11021  "id": 1,
11022  "result": true
11023}
11024
11025~~~
11026
11027### bdev_daos_create {#rpc_bdev_daos_create}
11028
11029Construct @ref bdev_config_daos
11030
11031#### Parameters
11032
11033Name                    | Optional | Type        | Description
11034----------------------- | -------- | ----------- | -----------
11035name                    | Required | string      | Bdev name to use
11036pool                    | Required | string      | DAOS pool label or its uuid
11037cont                    | Required | string      | DAOS cont label or its uuid
11038block_size              | Required | number      | Block size in bytes -must be multiple of 512
11039num_blocks              | Required | number      | Number of blocks
11040uuid                    | Optional | string      | UUID of new bdev
11041oclass                  | Optional | string      | DAOS object class (default SX)
11042
11043To find more about various object classes please visit [DAOS documentation](https://github.com/daos-stack/daos/blob/master/src/object/README.md).
11044Please note, that DAOS bdev module uses the same CLI flag notation as `dmg` and `daos` commmands,
11045for instance, `SX` or `EC_4P2G2` rather than in DAOS header file `OC_SX` or `OC_EC_4P2G2`.
11046
11047#### Result
11048
11049Name of newly created bdev.
11050
11051#### Example
11052
11053Example request:
11054
11055~~~json
11056{
11057  "params": {
11058    "block_size": 4096,
11059    "num_blocks": 16384,
11060    "name": "daosdev0",
11061    "pool": "test-pool",
11062    "cont": "test-cont",
11063    "oclass": "EC_4P2G2"
11064  },
11065  "jsonrpc": "2.0",
11066  "method": "bdev_daos_create",
11067  "id": 1
11068}
11069~~~
11070
11071Example response:
11072
11073~~~json
11074{
11075  "jsonrpc": "2.0",
11076  "id": 1,
11077  "result": "daosdev0"
11078}
11079~~~
11080
11081### bdev_daos_delete {#rpc_bdev_daos_delete}
11082
11083Delete @ref bdev_config_daos
11084
11085#### Parameters
11086
11087Name                    | Optional | Type        | Description
11088----------------------- | -------- | ----------- | -----------
11089name                    | Required | string      | Bdev name
11090
11091#### Example
11092
11093Example request:
11094
11095~~~json
11096{
11097  "params": {
11098    "name": "daosdev0"
11099  },
11100  "jsonrpc": "2.0",
11101  "method": "bdev_daos_delete",
11102  "id": 1
11103}
11104~~~
11105
11106Example response:
11107
11108~~~json
11109{
11110  "jsonrpc": "2.0",
11111  "id": 1,
11112  "result": true
11113}
11114~~~
11115
11116### bdev_daos_resize {#rpc_bdev_daos_resize}
11117
11118Resize @ref bdev_config_daos.
11119
11120#### Parameters
11121
11122Name                    | Optional | Type        | Description
11123----------------------- | -------- | ----------- | -----------
11124name                    | Required | string      | Bdev name
11125new_size                | Required | number      | Bdev new capacity in MB
11126
11127#### Example
11128
11129Example request:
11130
11131~~~json
11132{
11133  "params": {
11134    "name": "daosdev0",
11135    "new_size": 8192
11136  },
11137  "jsonrpc": "2.0",
11138  "method": "bdev_daos_resize",
11139  "id": 1
11140}
11141~~~
11142
11143Example response:
11144
11145~~~json
11146{
11147  "jsonrpc": "2.0",
11148  "id": 1,
11149  "result": true
11150}
11151~~~
11152